[asterisk-commits] file: trunk r96071 - in /trunk: ./ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 2 16:40:56 CST 2008


Author: file
Date: Wed Jan  2 16:40:55 2008
New Revision: 96071

URL: http://svn.digium.com/view/asterisk?view=rev&rev=96071
Log:
Don't use AST_C_DEFINE_CHECK for the two pthread things that may not actually be definitions, they could be enums for example.

Modified:
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in

Modified: trunk/configure
URL: http://svn.digium.com/view/asterisk/trunk/configure?view=diff&rev=96071&r1=96070&r2=96071
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Wed Jan  2 16:40:55 2008
@@ -1,5 +1,5 @@
 #! /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.
 #
@@ -16725,17 +16725,10 @@
     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; }
-	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
@@ -16744,25 +16737,19 @@
 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
-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
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -16771,46 +16758,31 @@
   (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; }
-		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_VERSION
-_ACEOF
-
-
 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
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-	CPPFLAGS="${saved_cppflags}"
-    fi
-
-
-    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
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
+{ 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; }
-	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
@@ -16819,25 +16791,19 @@
 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
-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
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -16846,33 +16812,26 @@
   (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; }
-		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_VERSION
-_ACEOF
-
-
 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
 
-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

Modified: trunk/configure.ac
URL: http://svn.digium.com/view/asterisk/trunk/configure.ac?view=diff&rev=96071&r1=96070&r2=96071
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Wed Jan  2 16:40:55 2008
@@ -393,8 +393,23 @@
 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";

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=96071&r1=96070&r2=96071
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Wed Jan  2 16:40:55 2008
@@ -574,11 +574,9 @@
 /* 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
-
-/* 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. */
@@ -593,11 +591,9 @@
 /* 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
-
-/* 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




More information about the asterisk-commits mailing list