[eggheads-patches] PATCH: pthreads-test.diff

Tothwolf tothwolf at concentric.net
Sat Oct 30 16:17:19 CST 1999


pthreads-test.diff:
  Test pthread lib for 'pthread_mutex_init' instead of 'pthread_create'

-Toth
-------------- next part --------------
diff -urNPX ../exclude ../eggdrop1.3/configure ./configure
--- ../eggdrop1.3/configure	Wed Oct 27 15:17:39 1999
+++ ./configure	Thu Oct 28 15:47:58 1999
@@ -1712,9 +1712,9 @@
   echo "$ac_t""no" 1>&6
 fi
 
-  echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1717: checking for pthread_create in -lpthread" >&5
-ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
+  echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6
+echo "configure:1717: checking for pthread_mutex_init in -lpthread" >&5
+ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1726,10 +1726,10 @@
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char pthread_create();
+char pthread_mutex_init();
 
 int main() {
-pthread_create()
+pthread_mutex_init()
 ; return 0; }
 EOF
 if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
@@ -1747,10 +1747,10 @@
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  ac_cv_lib_pthread_pthread_create=yes
+  ac_cv_lib_pthread_pthread_mutex_init=yes
 else
   echo "$ac_t""no" 1>&6
-ac_cv_lib_pthread_pthread_create=no
+ac_cv_lib_pthread_pthread_mutex_init=no
 fi
 
   if test "$SUNOS" = "yes"
@@ -3195,7 +3195,7 @@
     TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
   fi
 fi
-if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
 then
   TCL_TESTLIBS="-lpthread $TCL_TESTLIBS"
 fi
@@ -3291,7 +3291,7 @@
 
 
   # add -lpthread to $LIBS if we have it
-  if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+  if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
   then
     LIBS="-lpthread $LIBS"
   fi
diff -urNPX ../exclude ../eggdrop1.3/configure.in ./configure.in
--- ../eggdrop1.3/configure.in	Wed Oct 27 15:17:39 1999
+++ ./configure.in	Thu Oct 28 15:47:49 1999
@@ -273,7 +273,9 @@
   AC_CHECK_LIB(dns,gethostbyname)
   AC_CHECK_LIB(dl,dlopen)
 dnl this is needed for Tcl compiled with thread support
-  AC_CHECK_LIB(pthread,pthread_create,ac_cv_lib_pthread_pthread_create=yes,ac_cv_lib_pthread_pthread_create=no)
+  AC_CHECK_LIB(pthread,pthread_mutex_init,
+ac_cv_lib_pthread_pthread_mutex_init=yes,
+ac_cv_lib_pthread_pthread_mutex_init=no)
   if test "$SUNOS" = "yes"
   then
     dnl for suns without yp or something like that
@@ -747,7 +749,7 @@
     TCL_TESTLIBS="-L$TCLLIB -l$TCLLIBFNS -lm $LIBS"
   fi
 fi
-if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
 then
   TCL_TESTLIBS="-lpthread $TCL_TESTLIBS"
 fi
@@ -835,7 +837,7 @@
   AC_DEFINE(HAVE_TCL_THREADS)
 
   # add -lpthread to $LIBS if we have it
-  if test "x${ac_cv_lib_pthread_pthread_create}" = "xyes"
+  if test "x${ac_cv_lib_pthread_pthread_mutex_init}" = "xyes"
   then
     LIBS="-lpthread $LIBS"
   fi


More information about the Patches mailing list