libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] gvars3 configure configure.ac


From: Edward Rosten
Subject: [libcvd-members] gvars3 configure configure.ac
Date: Mon, 31 Jul 2006 15:56:18 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    gvars3
Changes by:     Edward Rosten <edrosten>        06/07/31 15:56:18

Modified files:
        .              : configure configure.ac 

Log message:
        Updated pthread test so it works with FreeBSD (which does not have 
        libpthread.so)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gvars3/configure?cvsroot=libcvd&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gvars3/configure.ac?cvsroot=libcvd&r1=1.5&r2=1.6

Patches:
Index: configure
===================================================================
RCS file: /cvsroot/libcvd/gvars3/configure,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- configure   11 May 2006 22:37:14 -0000      1.5
+++ configure   31 Jul 2006 15:56:18 -0000      1.6
@@ -2977,39 +2977,19 @@
    { (exit 1); exit 1; }; }
 fi
 
-
-echo "$as_me:$LINENO: checking for pthread_join in -lpthread" >&5
-echo $ECHO_N "checking for pthread_join in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_pthread_join+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+echo "$as_me:$LINENO: checking for working pthreads" >&5
+echo $ECHO_N "checking for working pthreads... $ECHO_C" >&6
+CPPFLAGS="$CPPFLAGS -pthread"
+LIBS="$LIBS -pthread"
+a=0
 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+#include <pthread.h>
+                                       void*foo(void*){}
+                                       int 
main(){pthread_create(0,0,foo,0);return 0;}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char pthread_join ();
-int
-main ()
-{
-pthread_join ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3023,44 +3003,27 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_pthread_pthread_join=yes
+  a=1
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_pthread_join=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_join" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_join" >&6
-if test $ac_cv_lib_pthread_pthread_join = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPTHREAD 1
-_ACEOF
-
-  LIBS="-lpthread $LIBS"
-
 fi
-
-if test x$ac_cv_lib_pthread_pthread_join != xyes
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+LIBS="$LIBS -pthread"
+if test $a == 0
 then
        { { echo "$as_me:$LINENO: error: pthread is not optional. It should be. 
Sorry." >&5
 echo "$as_me: error: pthread is not optional. It should be. Sorry." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-LIBS="$LIBS -pthread"
-CPPFLAGS="$CPPFLAGS -pthread"
-
 
 echo ------------------------------------------------
 echo "Extra GVars2 Compat:"

Index: configure.ac
===================================================================
RCS file: /cvsroot/libcvd/gvars3/configure.ac,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- configure.ac        11 May 2006 22:37:14 -0000      1.5
+++ configure.ac        31 Jul 2006 15:56:18 -0000      1.6
@@ -120,15 +120,19 @@
        AC_MSG_ERROR(Readline is not optional. It should be. Sorry.)
 fi
 
-AC_CHECK_LIB(pthread, pthread_join, [], [])
-if test x$ac_cv_lib_pthread_pthread_join != xyes
+AC_MSG_CHECKING(for working pthreads)
+CPPFLAGS="$CPPFLAGS -pthread"
+LIBS="$LIBS -pthread"
+a=0
+AC_COMPILE_IFELSE([#include <pthread.h>
+                                       void*foo(void*){}
+                                       int 
main(){pthread_create(0,0,foo,0);return 0;}],[a=1])
+LIBS="$LIBS -pthread"
+if test $a == 0
 then
        AC_MSG_ERROR(pthread is not optional. It should be. Sorry.)
 fi
 
-LIBS="$LIBS -pthread"
-CPPFLAGS="$CPPFLAGS -pthread"
-
 
 echo ------------------------------------------------
 echo "Extra GVars2 Compat:"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]