1c3883a3b6
consolidate include files into one dir, improved building wrt threads/compiler flags, etc. ok landry@, sebastiap@
66 lines
1.9 KiB
Plaintext
66 lines
1.9 KiB
Plaintext
$OpenBSD: patch-unix_tcl_m4,v 1.4 2011/01/05 16:18:09 stu Exp $
|
|
--- unix/tcl.m4.orig Thu Sep 2 14:12:14 2010
|
|
+++ unix/tcl.m4 Mon Dec 6 18:57:26 2010
|
|
@@ -1522,17 +1522,37 @@ dnl AC_CHECK_TOOL(AR, ar)
|
|
TCL_LIB_VERSIONS_OK=nodots
|
|
;;
|
|
OpenBSD-*)
|
|
- CFLAGS_OPTIMIZE='-O2'
|
|
- SHLIB_CFLAGS="-fPIC"
|
|
- SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
|
|
- SHLIB_LD_LIBS='${LIBS}'
|
|
- SHLIB_SUFFIX=".so"
|
|
- DL_OBJS="tclLoadDl.o"
|
|
- DL_LIBS=""
|
|
- AS_IF([test $doRpath = yes], [
|
|
- CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
|
|
- LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
|
|
- SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
|
|
+ arch=`arch -s`
|
|
+ case "$arch" in
|
|
+ m88k|vax)
|
|
+ # Equivalent using configure option --disable-load
|
|
+ # Step 4 will set the necessary variables
|
|
+ DL_OBJS=""
|
|
+ ;;
|
|
+ *)
|
|
+ SHLIB_CFLAGS="-fPIC"
|
|
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
|
|
+ SHLIB_LD_LIBS='${LIBS}'
|
|
+ SHLIB_SUFFIX=".so"
|
|
+ DL_OBJS="tclLoadDl.o"
|
|
+ DL_LIBS=""
|
|
+ AS_IF([test $doRpath = yes], [
|
|
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
|
|
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
|
|
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
|
|
+ ;;
|
|
+ esac
|
|
+ case "$arch" in
|
|
+ m88k|vax)
|
|
+ CFLAGS_OPTIMIZE="-O1"
|
|
+ ;;
|
|
+ sh)
|
|
+ CFLAGS_OPTIMIZE="-O0"
|
|
+ ;;
|
|
+ *)
|
|
+ CFLAGS_OPTIMIZE="-O2"
|
|
+ ;;
|
|
+ esac
|
|
AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
|
|
AC_EGREP_CPP(yes, [
|
|
#ifdef __ELF__
|
|
@@ -1543,10 +1563,10 @@ dnl AC_CHECK_TOOL(AR, ar)
|
|
LDFLAGS=-Wl,-export-dynamic
|
|
], [LDFLAGS=""])
|
|
AS_IF([test "${TCL_THREADS}" = "1"], [
|
|
- # OpenBSD builds and links with -pthread, never -lpthread.
|
|
+ # On OpenBSD: Compile with -pthread
|
|
+ # Don't link with -lpthread
|
|
LIBS=`echo $LIBS | sed s/-lpthread//`
|
|
CFLAGS="$CFLAGS -pthread"
|
|
- SHLIB_CFLAGS="$SHLIB_CFLAGS -pthread"
|
|
])
|
|
# OpenBSD doesn't do version numbers with dots.
|
|
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
|