From: Ivan Maidanski Date: Sun, 26 May 2013 12:32:32 +0000 (+0400) Subject: Define AO_NO_PTHREADS in configure if no pthreads (Win32 and VxWorks) X-Git-Tag: libatomic_ops-7_4_0~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e7a0f7f75b46a5980ca711a8fc674c64c9567dd;p=libatomic_ops Define AO_NO_PTHREADS in configure if no pthreads (Win32 and VxWorks) * configure.ac (have_pthreads): Do not define to true if check for pthread_self failed. * configure.ac (AO_NO_PTHREADS): Define if not have_pthreads. --- diff --git a/configure.ac b/configure.ac index 3701650..be79faf 100644 --- a/configure.ac +++ b/configure.ac @@ -141,10 +141,11 @@ AH_TEMPLATE([AO_WEAK_DOUBLE_CAS_EMULATION], AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.]) # Libraries needed to support threads (if any). -THREADDLLIBS= -have_pthreads=true -AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,) -case "$host" in +have_pthreads=false +AC_CHECK_LIB(pthread, pthread_self, have_pthreads=true) +if test x$have_pthreads = xtrue; then + THREADDLLIBS=-lpthread + case "$host" in *-*-netbsd*) # Indicates the use of pthreads. AC_DEFINE(_PTHREADS) @@ -163,7 +164,12 @@ case "$host" in # Skip test_atomic_pthreads. have_pthreads=false ;; -esac + esac +else + AC_DEFINE([AO_NO_PTHREADS], 1, [No pthreads library available]) + # Assume VxWorks or Win32. + THREADDLLIBS= +fi AC_SUBST(THREADDLLIBS) AM_CONDITIONAL(HAVE_PTHREAD_H, test x$have_pthreads = xtrue)