Don't use AST_C_DEFINE_CHECK for the two pthread things that may not actually be...
authorJoshua Colp <jcolp@digium.com>
Wed, 2 Jan 2008 22:40:55 +0000 (22:40 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 2 Jan 2008 22:40:55 +0000 (22:40 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
include/asterisk/autoconfig.h.in

index 69fdc12..7ce35ee 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
 #! /bin/sh
-# From configure.ac Revision: 95817 .
+# From configure.ac Revision: 95937 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
@@ -16725,17 +16725,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
 
 
     fi
 
 
-    if test "x${PBX_PTHREAD_RWLOCK_PREFER_WRITER_NP}" != "x1" -a "${USE_PTHREAD_RWLOCK_PREFER_WRITER_NP}" != "no"; then
-       { echo "$as_me:$LINENO: checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h" >&5
+{ echo "$as_me:$LINENO: checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h" >&5
 echo $ECHO_N "checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h... $ECHO_C" >&6; }
 echo $ECHO_N "checking for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h... $ECHO_C" >&6; }
-       saved_cppflags="${CPPFLAGS}"
-       if test "x${PTHREAD_RWLOCK_PREFER_WRITER_NP_DIR}" != "x"; then
-           PTHREAD_RWLOCK_PREFER_WRITER_NP_INCLUDE="-I${PTHREAD_RWLOCK_PREFER_WRITER_NP_DIR}/include"
-       fi
-       CPPFLAGS="${CPPFLAGS} ${PTHREAD_RWLOCK_PREFER_WRITER_NP_INCLUDE}"
-
-       cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
@@ -16744,25 +16737,19 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
 int
 main ()
 {
-#if defined(PTHREAD_RWLOCK_PREFER_WRITER_NP)
-                               int foo = 0;
-                               #else
-                               int foo = bar;
-                               #endif
-                               0
-
+int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;
   ;
   return 0;
 }
 _ACEOF
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -16771,46 +16758,31 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-     { echo "$as_me:$LINENO: result: yes" >&5
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 echo "${ECHO_T}yes" >&6; }
-               PBX_PTHREAD_RWLOCK_PREFER_WRITER_NP=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP 1
 _ACEOF
 
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP 1
 _ACEOF
 
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP_VERSION
-_ACEOF
-
-
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-              { echo "$as_me:$LINENO: result: no" >&5
+       { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 
 fi
 
 echo "${ECHO_T}no" >&6; }
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="${saved_cppflags}"
-    fi
-
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
 
-    if test "x${PBX_PTHREAD_MUTEX_RECURSIVE_NP}" != "x1" -a "${USE_PTHREAD_MUTEX_RECURSIVE_NP}" != "no"; then
-       { echo "$as_me:$LINENO: checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h" >&5
+{ echo "$as_me:$LINENO: checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h" >&5
 echo $ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h... $ECHO_C" >&6; }
 echo $ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h... $ECHO_C" >&6; }
-       saved_cppflags="${CPPFLAGS}"
-       if test "x${PTHREAD_MUTEX_RECURSIVE_NP_DIR}" != "x"; then
-           PTHREAD_MUTEX_RECURSIVE_NP_INCLUDE="-I${PTHREAD_MUTEX_RECURSIVE_NP_DIR}/include"
-       fi
-       CPPFLAGS="${CPPFLAGS} ${PTHREAD_MUTEX_RECURSIVE_NP_INCLUDE}"
-
-       cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
@@ -16819,25 +16791,19 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
 int
 main ()
 {
-#if defined(PTHREAD_MUTEX_RECURSIVE_NP)
-                               int foo = 0;
-                               #else
-                               int foo = bar;
-                               #endif
-                               0
-
+int a = PTHREAD_MUTEX_RECURSIVE_NP;
   ;
   return 0;
 }
 _ACEOF
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -16846,33 +16812,26 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-     { echo "$as_me:$LINENO: result: yes" >&5
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 echo "${ECHO_T}yes" >&6; }
-               PBX_PTHREAD_MUTEX_RECURSIVE_NP=1
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_PTHREAD_MUTEX_RECURSIVE_NP 1
 _ACEOF
 
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_PTHREAD_MUTEX_RECURSIVE_NP 1
 _ACEOF
 
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PTHREAD_MUTEX_RECURSIVE_NP_VERSION
-_ACEOF
-
-
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-              { echo "$as_me:$LINENO: result: no" >&5
+       { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 
 fi
 
 echo "${ECHO_T}no" >&6; }
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       CPPFLAGS="${saved_cppflags}"
-    fi
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 
 
     if test "x${PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}" != "x1" -a "${USE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}" != "no"; then
 
 
     if test "x${PBX_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}" != "x1" -a "${USE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}" != "no"; then
index 19d12cb..002e6be 100644 (file)
@@ -393,8 +393,23 @@ then
 fi
 
 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
 fi
 
 AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
-AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_PREFER_WRITER_NP], [PTHREAD_RWLOCK_PREFER_WRITER_NP], [pthread.h])
-AST_C_DEFINE_CHECK([PTHREAD_MUTEX_RECURSIVE_NP], [PTHREAD_MUTEX_RECURSIVE_NP], [pthread.h])
+
+AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h)
+AC_LINK_IFELSE(
+AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;]),
+AC_MSG_RESULT(yes)
+AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h]),
+AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h)
+AC_LINK_IFELSE(
+AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_RECURSIVE_NP;]),
+AC_MSG_RESULT(yes)
+AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h]),
+AC_MSG_RESULT(no)
+)
+
 AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
 
 if test "${cross_compiling}" = "no";
 AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
 
 if test "${cross_compiling}" = "no";
index d7251ab..080b4ef 100644 (file)
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
-/* Define if your system has the PTHREAD_MUTEX_RECURSIVE_NP headers. */
+/* Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h
+   */
 #undef HAVE_PTHREAD_MUTEX_RECURSIVE_NP
 
 #undef HAVE_PTHREAD_MUTEX_RECURSIVE_NP
 
-/* Define PTHREAD_MUTEX_RECURSIVE_NP headers version */
-#undef HAVE_PTHREAD_MUTEX_RECURSIVE_NP_VERSION
-
 /* Define if your system has the PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
    headers. */
 #undef HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 /* Define if your system has the PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
    headers. */
 #undef HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 /* Define PTHREAD_RWLOCK_INITIALIZER headers version */
 #undef HAVE_PTHREAD_RWLOCK_INITIALIZER_VERSION
 
 /* Define PTHREAD_RWLOCK_INITIALIZER headers version */
 #undef HAVE_PTHREAD_RWLOCK_INITIALIZER_VERSION
 
-/* Define if your system has the PTHREAD_RWLOCK_PREFER_WRITER_NP headers. */
+/* Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in
+   pthread.h */
 #undef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP
 
 #undef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP
 
-/* Define PTHREAD_RWLOCK_PREFER_WRITER_NP headers version */
-#undef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP_VERSION
-
 /* Define to 1 if the system has the type `ptrdiff_t'. */
 #undef HAVE_PTRDIFF_T
 
 /* Define to 1 if the system has the type `ptrdiff_t'. */
 #undef HAVE_PTRDIFF_T