$NetBSD: patch-ac,v 1.2 2005/03/06 22:41:28 jschauma Exp $ --- tcl.m4.orig Fri Oct 19 20:24:40 2001 +++ tcl.m4 Sun Mar 6 16:06:56 2005 @@ -602,6 +602,7 @@ do64bit_ok=no fullSrcDir=`cd $srcdir; pwd` + RPATH_FLAG="" EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" @@ -791,8 +792,11 @@ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' EXTRA_CFLAGS="" LDFLAGS="" + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; - IRIX-6.*|IRIX64-6.5*) + IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' @@ -815,6 +819,9 @@ esac LDFLAGS="-n32" fi + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -825,6 +832,15 @@ DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' + TCL_LIB_VERSIONS_OK=nodots + + # Check to enable 64-bit flags for compiler/linker + if test "${ABI}" = "64" ; then + SHLIB_LD="ld -64 -shared -rdata_shared" + LDFLAGS="$LDFLAGS -64" + fi ;; Linux*) SHLIB_CFLAGS="-fPIC" @@ -915,7 +931,6 @@ 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" @@ -927,11 +942,19 @@ #ifdef __ELF__ yes #endif - ], + ], [ AC_MSG_RESULT(yes) - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', + SHLIB_LD='${TCL_CC} -shared -Wl,-x' + RPATH_FLAG='-Wl,-R' + LD_SEARCH_FLAGS='-Wl,-R${LIB_RUNTIME_DIR}' + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + ], [ AC_MSG_RESULT(no) + SHLIB_LD="ld -Bshareable -x" + RPATH_FLAG='-R' + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + ] ) ], [ SHLIB_CFLAGS="" @@ -1130,6 +1153,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*) @@ -1174,6 +1200,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" @@ -1652,7 +1681,11 @@ for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT($i) + if test "${RPATH_FLAG}" != ""; then + XLIBSW="-L$i ${RPATH_FLAG}$i -lX11" + else XLIBSW="-L$i -lX11" + fi x_libraries="$i" break fi @@ -1661,7 +1694,11 @@ if test "$x_libraries" = ""; then XLIBSW=-lX11 else + if test "${RPATH_FLAG}" != ""; then + XLIBSW="-L$x_libraries ${RPATH_FLAG}$x_libraries -lX11" + else XLIBSW="-L$x_libraries -lX11" + fi fi fi if test "$XLIBSW" = nope ; then