diff options
author | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2006-02-28 17:54:14 +0000 |
---|---|---|
committer | jlovell <jlovell@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2006-02-28 17:54:14 +0000 |
commit | b423cd4cb9fa8cf030cc046a59c28196f3edf6b4 (patch) | |
tree | 021000e676623cbf68e9af3e1637c853d7cfbf78 /config-scripts/cups-threads.m4 | |
parent | ecdc06282a65bd04f801c877d2ceb83106d737e1 (diff) |
Load cups into easysw/current.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@69 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'config-scripts/cups-threads.m4')
-rw-r--r-- | config-scripts/cups-threads.m4 | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/config-scripts/cups-threads.m4 b/config-scripts/cups-threads.m4 index 788ce838c..639eb7414 100644 --- a/config-scripts/cups-threads.m4 +++ b/config-scripts/cups-threads.m4 @@ -25,26 +25,32 @@ dnl AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support]) have_pthread=no +PTHREAD_FLAGS="" if test "x$enable_threads" != xno; then AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H)) - AC_CHECK_LIB(pthread, pthread_create) - if test "x$ac_cv_lib_pthread_pthread_create" = xyes -a x$ac_cv_header_pthread_h = xyes; then - have_pthread=yes - else - dnl *BSD uses -pthread option... - AC_MSG_CHECKING([for pthread_create using -pthread]) - SAVELIBS="$LIBS" - LIBS="-pthread $LIBS" - AC_TRY_LINK([#include <pthread.h>], - [pthread_create(0, 0, 0, 0);], - have_pthread=yes, - LIBS="$SAVELIBS") - AC_MSG_RESULT([$have_pthread]) + if test x$ac_cv_header_pthread_h = xyes; then + dnl Check various threading options for the platforms we support + for flag in -lpthreads -lpthread -pthread; do + AC_MSG_CHECKING([for pthread_create using $flag]) + SAVELIBS="$LIBS" + LIBS="$flag $LIBS" + AC_TRY_LINK([#include <pthread.h>], + [pthread_create(0, 0, 0, 0);], + have_pthread=yes, + LIBS="$SAVELIBS") + AC_MSG_RESULT([$have_pthread]) + + if test $have_pthread = yes; then + PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT" + break + fi + done fi fi +AC_SUBST(PTHREAD_FLAGS) dnl dnl End of "$Id$". |