aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-28 15:31:22 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-28 15:31:22 +0000
commit3741af94a6e90d695587d1b8f1c7d2312fb883eb (patch)
tree33cb501df2a27268277517cb280a7947c45803d5 /configure.ac
parentdcb89a02ad31bba945c946b94ab00add8f68a338 (diff)
Merged revisions 236613 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r236613 | seanbright | 2009-12-28 10:22:54 -0500 (Mon, 28 Dec 2009) | 14 lines Merged revisions 236585 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r236585 | seanbright | 2009-12-28 10:12:08 -0500 (Mon, 28 Dec 2009) | 7 lines Try a test compile to see if PTHREAD_ONCE_INIT requires extra braces. There was conditional code (based on build platform) to optioinally wrap PTHREAD_ONCE_INIT in braces that was removed since it is fixed in newer versions of Solaris/OpenSolaris, but I am still running into it on Solaris 10 x86 so add a configure-time check for it. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@236634 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 39ccba9bb..f00751803 100644
--- a/configure.ac
+++ b/configure.ac
@@ -474,6 +474,26 @@ if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then
AC_DEFINE([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK], 1, [Define if your system has pthread_rwlock_timedwrlock()])
fi
+AC_MSG_CHECKING(if PTHREAD_ONCE_INIT needs braces)
+saved_CFLAGS="${CFLAGS}"
+CFLAGS="${CFLAGS} -Werror -Wmissing-braces"
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <pthread.h>],
+ [pthread_once_t once = PTHREAD_ONCE_INIT;])
+ ],[
+ AC_MSG_RESULT(no)
+ ac_cv_pthread_once_needsbraces="no"
+ ],[
+ AC_MSG_RESULT(yes)
+ ac_cv_pthread_once_needsbraces="yes"
+ ]
+)
+CFLAGS="${saved_CFLAGS}"
+if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then
+ AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
+fi
+
AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
#if test "${cross_compiling}" = "no";