summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstwo <stwo>2010-02-19 13:25:06 (GMT)
committerstwo <stwo>2010-02-19 13:25:06 (GMT)
commit76bfa8368792738afb69378d51241d1b8d7385ad (patch)
tree9be0aeb733939ab2133c450205043fccda70b334
parent57ee061f92f967744eb386d744f4fb4d41534e55 (diff)
downloadtcl-76bfa8368792738afb69378d51241d1b8d7385ad.zip
tcl-76bfa8368792738afb69378d51241d1b8d7385ad.tar.gz
tcl-76bfa8368792738afb69378d51241d1b8d7385ad.tar.bz2
Correct compiler/linker flags for threaded builds on OpenBSD.
-rw-r--r--ChangeLog6
-rwxr-xr-xunix/configure10
-rw-r--r--unix/tcl.m49
3 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 92df407..e34da81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-19 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Correct compiler/linker flags
+ for threaded builds on OpenBSD.
+ * configure: (regenerated).
+
2010-02-19 Donal K. Fellows <dkf@users.sf.net>
* unix/installManPage: [Bug 2954638]: Correct behaviour of manual page
diff --git a/unix/configure b/unix/configure
index 41cd40a..576abf2 100755
--- a/unix/configure
+++ b/unix/configure
@@ -7697,6 +7697,14 @@ else
LDFLAGS=""
fi
+ if test "${TCL_THREADS}" = "1"; then
+
+ # OpenBSD builds and links with -pthread, never -lpthread.
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+ SHLIB_CFLAGS="$SHLIB_CFLAGS -pthread"
+
+fi
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
@@ -8952,7 +8960,7 @@ fi
BSD/OS*) ;;
CYGWIN_*) ;;
IRIX*) ;;
- NetBSD-*|FreeBSD-*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index d7ca5a2..2013aa1 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1574,7 +1574,12 @@ dnl AC_CHECK_TOOL(AR, ar)
AS_IF([test $tcl_cv_ld_elf = yes], [
LDFLAGS=-Wl,-export-dynamic
], [LDFLAGS=""])
-
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # OpenBSD builds and links with -pthread, never -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'
TCL_LIB_VERSIONS_OK=nodots
@@ -2111,7 +2116,7 @@ dnl # preprocessing tests use only CPPFLAGS.
BSD/OS*) ;;
CYGWIN_*) ;;
IRIX*) ;;
- NetBSD-*|FreeBSD-*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;