diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 43649e329..efeedb56d 100644 --- a/configure.ac +++ b/configure.ac @@ -352,6 +352,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 + AC_MSG_CHECKING(for compiler atomic operations) AC_LINK_IFELSE( AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);]), |