Detect if the compiler supports -pthread. v_3_0_branchpoint
authorjongfoster <jongfoster@users.sourceforge.net>
Sat, 25 May 2002 16:54:54 +0000 (16:54 +0000)
committerjongfoster <jongfoster@users.sourceforge.net>
Sat, 25 May 2002 16:54:54 +0000 (16:54 +0000)
Hopefully this will fix bug 560442.  (I don't have a HP PA-RISC
machine to test this!)

configure.in

index 6e629ff..2b697f1 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl 
-dnl $Id: configure.in,v 1.66 2002/05/03 00:41:56 oes Exp $
+dnl $Id: configure.in,v 1.67 2002/05/03 14:33:59 oes Exp $
 dnl 
 dnl Written by and Copyright (C) 2001, 2002 the SourceForge
 dnl Privoxy team. http://www.privoxy.org/
@@ -28,6 +28,9 @@ dnl or write to the Free Software Foundation, Inc., 59
 dnl Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl 
 dnl $Log: configure.in,v $
+dnl Revision 1.67  2002/05/03 14:33:59  oes
+dnl Generate doc/soucre/ldp.dsl
+dnl
 dnl Revision 1.66  2002/05/03 00:41:56  oes
 dnl Set version to 2.9.15 to comply with new versioning scheme
 dnl
@@ -362,7 +365,7 @@ dnl =================================================================
 dnl AutoConf Initialization
 dnl =================================================================
 
-AC_REVISION($Revision: 1.66 $)
+AC_REVISION($Revision: 1.67 $)
 AC_INIT(jcc.c)
 
 if test ! -f config.h.in; then
@@ -673,11 +676,17 @@ if test $have_pthread = yes; then
   if test "$GCC" = "yes"; then
     # Set a GCC specific switch:
     if test "$target_type" = "unix"; then
-      # This compiler switch makes Linux thread-safe
-      # Don't know about other OS's?  Is this switch
-      # supported?
-      PTHREAD_LIB=
-      SPECIAL_CFLAGS="-pthread"
+      ac_jgf_save_CFLAGS=$CFLAGS
+      CFLAGS="$CFLAGS -pthread"
+      AC_TRY_LINK([#include <pthread.h>],
+        [void *p = pthread_create;],
+        [
+          # This compiler switch makes GCC on Linux thread-safe
+          # However, it's not supported on most other OS.
+          PTHREAD_LIB=
+          SPECIAL_CFLAGS="-pthread"
+        ])
+      CFLAGS=$ac_jgf_save_CFLAGS
     fi
   fi
 else