summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-09-17 20:55:16 (GMT)
committerjenglish <jenglish@flightlab.com>2007-09-17 20:55:16 (GMT)
commit6502142465cc91c57c9846811dc96dd65fec60af (patch)
tree29a29ab9edef14984c15585edf80533744048724 /unix/tcl.m4
parentbae09a447a6986bdcf878f74b3556b395d8ab940 (diff)
downloadtcl-6502142465cc91c57c9846811dc96dd65fec60af.zip
tcl-6502142465cc91c57c9846811dc96dd65fec60af.tar.gz
tcl-6502142465cc91c57c9846811dc96dd65fec60af.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//`