$NetBSD: patch-ac,v 1.4 2001/12/23 17:11:30 bjoern Exp $ --- tcl.m4.orig Sat Oct 20 02:24:40 2001 +++ tcl.m4 @@ -602,6 +602,7 @@ do64bit_ok=no fullSrcDir=`cd $srcdir; pwd` + RPATH_FLAG="" EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" @@ -915,7 +916,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 +927,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 +1138,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 +1185,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 +1666,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) - XLIBSW="-L$i -lX11" + 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 +1679,11 @@ if test "$x_libraries" = ""; then XLIBSW=-lX11 else - XLIBSW="-L$x_libraries -lX11" + 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