diff options
author | Corey Farrell <git@cfware.com> | 2018-01-25 02:37:32 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2018-01-25 10:38:45 -0500 |
commit | 23381d2c5ea84cb45e41163b81c3b7bb43a9db75 (patch) | |
tree | 633dcd16c3f30644c55d942876b18c778fc3c9ee /configure.ac | |
parent | 6fbd85522896c9c94281ed775c98a041721de424 (diff) |
Build System: Require __sync or __atomic functions.
This change causes the configure script to throw an error if neither
__sync nor __atomic builtin functions are available.
ASTERISK-27619
Change-Id: Ie01a281e0f5c41dfeeb5f250c1ccea8752f56ef9
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 07ff3b3f8..6e54f3c51 100644 --- a/configure.ac +++ b/configure.ac @@ -1074,6 +1074,7 @@ AC_MSG_CHECKING(for compiler sync operations) AC_LINK_IFELSE( [AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])], AC_MSG_RESULT(yes) +ax_cv_have_gcc_atomics=1 AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides __sync atomic operations.]), AC_MSG_RESULT(no) ) @@ -1082,10 +1083,15 @@ AC_MSG_CHECKING(for compiler atomic operations) AC_LINK_IFELSE( [AC_LANG_PROGRAM([], [int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED);])], AC_MSG_RESULT(yes) +ax_cv_have_c_atomics=1 AC_DEFINE([HAVE_C_ATOMICS], 1, [Define to 1 if your C compiler provides __atomic operations.]), AC_MSG_RESULT(no) ) +if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then + AC_MSG_ERROR([*** Atomic operations are not supported by your compiler.]) +fi + # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe. AC_MSG_CHECKING([if your system printf is NULL-safe.]) AC_RUN_IFELSE( @@ -1413,9 +1419,6 @@ AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h]) AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h]) -AC_CHECK_HEADER([libkern/OSAtomic.h], - [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])]) - AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([long long]) |