summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/config.threads.in
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2007-01-10 18:20:29 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2007-01-10 18:20:29 +0000
commit4ceaae588a26669445a79d94a13455d26920d0c8 (patch)
treead28ac16f068648b31ced04f5942a577e74f2de5 /usr.sbin/bind/config.threads.in
parentf3b478bb782d65db891eac62ffa66cce82e41959 (diff)
ISC BIND release 9.3.3
Diffstat (limited to 'usr.sbin/bind/config.threads.in')
-rw-r--r--usr.sbin/bind/config.threads.in25
1 files changed, 25 insertions, 0 deletions
diff --git a/usr.sbin/bind/config.threads.in b/usr.sbin/bind/config.threads.in
index f2816c447fb..c1c113b9372 100644
--- a/usr.sbin/bind/config.threads.in
+++ b/usr.sbin/bind/config.threads.in
@@ -140,6 +140,31 @@ then
fi
fi
;;
+ *-freebsd*)
+ # We don't want to set -lpthread as that break
+ # the ability to choose threads library at final
+ # link time and is not valid for all architectures.
+
+ PTHREAD=
+ if test "X$GCC" = "Xyes"; then
+ saved_cc="$CC"
+ CC="$CC -pthread"
+ AC_MSG_CHECKING(for gcc -pthread support);
+ AC_TRY_LINK([#include <pthread.h>],
+ [printf("%x\n", pthread_create);],
+ PTHREAD="yes"
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ CC="$saved_cc"
+ fi
+ if test "X$PTHREAD" != "Xyes"; then
+ AC_CHECK_LIB(pthread, pthread_create,,
+ AC_CHECK_LIB(thr, thread_create,,
+ AC_CHECK_LIB(c_r, pthread_create,,
+ AC_CHECK_LIB(c, pthread_create,,
+ AC_MSG_ERROR("could not find thread libraries")))))
+ fi
+ ;;
*)
AC_CHECK_LIB(pthread, pthread_create,,
AC_CHECK_LIB(pthread, __pthread_create,,