summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2005-03-15 00:15:59 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2005-03-15 00:15:59 (GMT)
commit8fcf4b23507f94dd3ea8de33640f7cf34431a022 (patch)
tree1a4c09e605c6446d99a009b2c17de56a4a34d1e0 /unix/tcl.m4
parent05d3c7804d87884e7d7f1abb843602a31a5aeb73 (diff)
downloadtcl-8fcf4b23507f94dd3ea8de33640f7cf34431a022.zip
tcl-8fcf4b23507f94dd3ea8de33640f7cf34431a022.tar.gz
tcl-8fcf4b23507f94dd3ea8de33640f7cf34431a022.tar.bz2
Make it all work on OpenBSD. Imported patch from ports tree.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m454
1 files changed, 39 insertions, 15 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 16eb892..92722c4 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1283,24 +1283,48 @@ dnl AC_CHECK_TOOL(AR, ar)
TCL_LIB_VERSIONS_OK=nodots
;;
OpenBSD-*)
- SHLIB_LD="${CC} -shared"
- SHLIB_LD_LIBS='${LIBS}'
- SHLIB_SUFFIX=".so"
- DL_OBJS="tclLoadDl.o"
- DL_LIBS=""
- CC_SEARCH_FLAGS=""
- LD_SEARCH_FLAGS=""
- AC_MSG_CHECKING(for ELF)
- AC_EGREP_CPP(yes, [
+ case `arch -s` in
+ m88k|vax)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".a"
+ DL_OBJS="tclLoadAout.o"
+ DL_LIBS=""
+ LDFLAGS=""
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ ;;
+ *)
+ # OpenBSD/SPARC[64] needs -fPIC, -fpic will not do.
+ case `machine` in
+ sparc|sparc64)
+ SHLIB_CFLAGS="-fPIC";;
+ *)
+ SHLIB_CFLAGS="-fpic";;
+ esac
+ SHLIB_LD="${CC} -shared ${SHLIB_CFLAGS}"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0'
+ 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.1.0'],
- [AC_MSG_RESULT(no)
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0']
- )
+ ],
+ AC_MSG_RESULT(yes)
+ [ LDFLAGS=-Wl,-export-dynamic ],
+ AC_MSG_RESULT(no)
+ LDFLAGS=""
+ )
+ ;;
+ esac
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'