$NetBSD: patch-af,v 1.4 2007/10/27 15:16:52 hubertf Exp $ --- unix/tcl.m4.orig 2001-10-20 02:24:15.000000000 +0200 +++ unix/tcl.m4 2007-10-27 16:53:32.000000000 +0200 @@ -584,7 +584,7 @@ # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print $3}' /etc/.relid'` + system=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` @@ -601,6 +601,7 @@ # Step 3: set configuration options based on system name and version. do64bit_ok=no + TCL_LIB_SPEC_RPATH="" EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" @@ -790,6 +791,9 @@ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" LDFLAGS="" + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" @@ -814,6 +818,9 @@ esac LDFLAGS="-n32" fi + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -824,6 +831,9 @@ DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; Linux*) SHLIB_CFLAGS="-fPIC" @@ -865,6 +875,9 @@ EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline" fi + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + TCL_LIB_VERSIONS_OK=nodots ;; GNU*) SHLIB_CFLAGS="-fPIC" @@ -910,28 +923,36 @@ LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*) + if test "X${COMPILER_OPTIMIZATION_BUG}" = "XYES"; then + CFLAGS_OPTIMIZE=-O0 + fi # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" - SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' AC_MSG_CHECKING(for ELF) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif - ], + ], [ AC_MSG_RESULT(yes) - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', + SHLIB_LD='${TCL_CC} -shared -Wl,-x' + LD_SEARCH_FLAGS='-Wl,-R${LIB_RUNTIME_DIR}' + TCL_LIB_SPEC_RPATH="-Wl,-R${exec_prefix}/lib" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + ], [ AC_MSG_RESULT(no) + SHLIB_LD="ld -Bshareable -x" + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + TCL_LIB_SPEC_RPATH="-R${exec_prefix}/lib" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - ) + ]) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" @@ -949,7 +970,7 @@ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; - FreeBSD-*) + FreeBSD-* | DragonFly-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" @@ -1129,6 +1150,9 @@ DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5*) @@ -1173,6 +1197,9 @@ else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" @@ -1328,7 +1355,7 @@ ;; IRIX*) ;; - NetBSD-*|FreeBSD-*|OpenBSD-*) + NetBSD-*|FreeBSD-*|OpenBSD-*|DragonFly-*) ;; Rhapsody-*|Darwin-*) ;; @@ -1707,7 +1734,7 @@ # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print $3}' /etc/.relid'` + system=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r`