From ac7378391d85bb2e42b3b97b4d2737c1c140aed5 Mon Sep 17 00:00:00 2001 From: jongfoster Date: Sat, 25 May 2002 16:54:54 +0000 Subject: [PATCH] Detect if the compiler supports -pthread. Hopefully this will fix bug 560442. (I don't have a HP PA-RISC machine to test this!) --- configure.in | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 6e629ff1..2b697f1a 100644 --- a/configure.in +++ b/configure.in @@ -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 ], + [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 -- 2.39.2