libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd configure configure.in


From: Edward Rosten
Subject: [libcvd-members] libcvd configure configure.in
Date: Thu, 06 Jul 2006 00:49:37 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        06/07/06 00:49:37

Modified files:
        .              : configure configure.in 

Log message:
        Configure check for threads now attempts to append -pthread to the 
compiler
        and linker flags. This seems to prevent wierd, inexplicable crashes on 
some
        platforms.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.65&r2=1.66

Patches:
Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- configure   16 May 2006 13:34:22 -0000      1.67
+++ configure   6 Jul 2006 00:49:37 -0000       1.68
@@ -6393,6 +6393,94 @@
 
        if test "$ac_cv_header_pthread_h" = yes && test 
"$ac_cv_lib_pthread_pthread_create" = yes
        then
+
+               echo "$as_me:$LINENO: checking if compiler supports -pthreads" 
>&5
+echo $ECHO_N "checking if compiler supports -pthreads... $ECHO_C" >&6
+               save_LIBS="$LIBS"
+               save_CXXFLAGS="$CXXFLAGS"
+               pthread_flag=yay
+               CXXFLAGS="$CXXFLAGS -pthread"
+               LIBS="$LIBS -pthread"
+               cat >conftest.$ac_ext <<_ACEOF
+int main(){return 0;}
+_ACEOF
+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
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (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); }; } &&
+        { 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
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+pthread_flag=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+               cat >conftest.$ac_ext <<_ACEOF
+int main(){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
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (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); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (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
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+pthread_flag=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+
+               if test $pthread_flag = no
+               then
+                       echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+                       LIBS="$save_LIBS"
+                       CXXFLAGS="$save_CXXFLAGS"
+               else
+                       echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+               fi
+
+
                cat >>confdefs.h <<\_ACEOF
 #define CVD_HAVE_PTHREAD 1
 _ACEOF

Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- configure.in        16 May 2006 13:34:23 -0000      1.65
+++ configure.in        6 Jul 2006 00:49:37 -0000       1.66
@@ -743,6 +743,26 @@
 
        if test "$ac_cv_header_pthread_h" = yes && test 
"$ac_cv_lib_pthread_pthread_create" = yes
        then
+               
+               AC_MSG_CHECKING([if compiler supports -pthreads])
+               save_LIBS="$LIBS"       
+               save_CXXFLAGS="$CXXFLAGS"
+               pthread_flag=yay
+               CXXFLAGS="$CXXFLAGS -pthread"
+               LIBS="$LIBS -pthread"
+               AC_COMPILE_IFELSE([int main(){return 0;}], [], 
[pthread_flag=no])
+               AC_LINK_IFELSE([int main(){return 0;}], [], [pthread_flag=no])
+
+               if test $pthread_flag = no
+               then
+                       AC_MSG_RESULT(no)
+                       LIBS="$save_LIBS"
+                       CXXFLAGS="$save_CXXFLAGS"
+               else
+                       AC_MSG_RESULT(yes)
+               fi
+
+
                AC_DEFINE(CVD_HAVE_PTHREAD, 1)
                AC_SUBST(have_pthread,yes)
                options="$options pthreads"




reply via email to

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