summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-09-17 20:54:40 (GMT)
committerjenglish <jenglish@flightlab.com>2007-09-17 20:54:40 (GMT)
commit8c80f424b9b3b3e0b16e846cd884d5b94d8cf515 (patch)
tree2ae20bd317770a906e984b0006bde6299ebaed73 /unix/tcl.m4
parentd98de46cbf3d68ad1e6176baa680db013ca5a890 (diff)
downloadtk-8c80f424b9b3b3e0b16e846cd884d5b94d8cf515.zip
tk-8c80f424b9b3b3e0b16e846cd884d5b94d8cf515.tar.gz
tk-8c80f424b9b3b3e0b16e846cd884d5b94d8cf515.tar.bz2
Use '${CC} -shared' instead of 'ld -Bshareable' to build shared libraries
on current NetBSDs [#1749251].
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m418
1 files changed, 6 insertions, 12 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 6844843..dd36bf1 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1507,8 +1507,7 @@ dnl AC_CHECK_TOOL(AR, ar)
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- NetBSD-*|FreeBSD-[[1-2]].*)
- # NetBSD/SPARC needs -fPIC, -fpic will not do.
+ NetBSD-1.*|FreeBSD-[[1-2]].*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
SHLIB_LD_LIBS='${LIBS}'
@@ -1535,13 +1534,7 @@ dnl AC_CHECK_TOOL(AR, ar)
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
- # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
- case `machine` in
- sparc|sparc64)
- SHLIB_CFLAGS="-fPIC";;
- *)
- SHLIB_CFLAGS="-fpic";;
- esac
+ SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
@@ -1566,17 +1559,18 @@ dnl AC_CHECK_TOOL(AR, ar)
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
- FreeBSD-*)
+ NetBSD-*|FreeBSD-*)
# FreeBSD 3.* and greater have ELF.
+ # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
if test "${TCL_THREADS}" = "1" ; then
# The -pthread needs to go in the CFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`