fix pthread linkage problem for openbsd
authorMatthias Kilian <kili@outback.escape.de>
Sat, 29 Nov 2008 00:06:38 +0000 (00:06 +0000)
committerMatthias Kilian <kili@outback.escape.de>
Sat, 29 Nov 2008 00:06:38 +0000 (00:06 +0000)
This should make my openbsd build slave happy when SplitObjs=NO.
May be useful for other BSDs and even Linux, regardless wether you
need -pthread or -lpthread. Time will tell...

configure.ac
unix.buildinfo.in

index 5283a55..83f010b 100644 (file)
@@ -194,6 +194,22 @@ fi
 AC_CHECK_LIB(dl, dlopen, [EXTRA_LIBS="$EXTRA_LIBS dl"])
 AC_SUBST([EXTRA_LIBS])
 
+# -{l,}pthread goo
+AC_CANONICAL_TARGET
+
+PTHREAD_CFLAGS=
+PTHREAD_LDFLAGS=
+PTHREAD_LIBS=
+case "$host_os" in
+openbsd*)
+       PTHREAD_CFLAGS=-pthread
+       PTHREAD_LDFLAGS=-pthread
+       ;;
+esac
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_LDFLAGS)
+AC_SUBST(PTHREAD_LIBS)
+
 AC_CONFIG_FILES([unix.buildinfo])
 
 AC_OUTPUT
index 7283015..4f70920 100644 (file)
@@ -1,2 +1,4 @@
 buildable: @BUILD_PACKAGE_BOOL@
-extra-libraries: @EXTRA_LIBS@
+cc-options: @PTHREAD_CFLAGS@
+ld-options: @PTHREAD_LDFLAGS@
+extra-libraries: @EXTRA_LIBS@ @PTHREAD_LIBS@