Consolidation of libatomic checks (#3314)

Problem: compiler might not support atomic warning flag

Solution: check before using it
This commit is contained in:
brubakerjeff 2018-11-27 04:51:31 -05:00 committed by Luca Boccassi
parent d98325160f
commit cad2423d82

View File

@ -195,7 +195,6 @@ case "${host_os}" in
case "${host_os}" in
*android*)
AC_DEFINE(ZMQ_HAVE_ANDROID, 1, [Have Android OS])
AC_CHECK_LIB([atomic],[__atomic_load_4],[LIBS="${LIBS} -latomic"])
libzmq_on_android="yes"
;;
esac
@ -638,6 +637,10 @@ AM_CONDITIONAL(ON_DEBIAN_KFREEBSD, test "x$libzmq_on_debian_kfreebsd" = "xyes")
# Check for __atomic_Xxx compiler intrinsics
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-Wno-atomic-alignment],
[CXXFLAGS+=" -Wno-atomic-alignment"],
[],
[-Werror])
LIBZMQ_CHECK_ATOMIC_INTRINSICS([
AC_DEFINE([ZMQ_HAVE_ATOMIC_INTRINSICS],
[1],