summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorstwo <stwo>2010-02-19 13:40:18 (GMT)
committerstwo <stwo>2010-02-19 13:40:18 (GMT)
commit0399234c3de3213b5bcd19d06ca35f1bd9cf9c18 (patch)
treeb17a1dddb0f4d6382f458e90e6834f9272d107c3 /unix/tcl.m4
parentda7deecd72e7ddb17c8a6786f300574ee14c2ca1 (diff)
downloadtk-0399234c3de3213b5bcd19d06ca35f1bd9cf9c18.zip
tk-0399234c3de3213b5bcd19d06ca35f1bd9cf9c18.tar.gz
tk-0399234c3de3213b5bcd19d06ca35f1bd9cf9c18.tar.bz2
Correct compiler/linker flags for threaded builds on OpenBSD.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m49
1 files changed, 7 insertions, 2 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index b7cb2ac..a4a18eb 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1547,7 +1547,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
@@ -2084,7 +2089,7 @@ dnl # preprocessing tests use only CPPFLAGS.
BSD/OS*) ;;
CYGWIN_*) ;;
IRIX*) ;;
- NetBSD-*|FreeBSD-*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;