From f68c95a429b44afc0197152a7819d17ce1de734c Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Wed, 14 Oct 2015 13:11:37 +0530 Subject: build: Fix autoconf warnings This patch avoids the following warnings on running autogen script . . . Running autoconf... configure.ac:896: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from... configure.ac:896: the top level . . . This change uses AC_LINK_IFELSE for checking the atomic built-in function support. Since AC_COMPILE_IFELSE checks for syntactical errors only, we need to use AC_LINK_IFELSE to achieve the same which is more appropriate. Reference links: [1] https://autotools.io/forwardporting/autoconf.html [2] http://www.gnu.org/software/autoconf/manual/autoconf.html#Generating-Sources [3] http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-the-Compiler Change-Id: I4597f2976623496745b66f98bb78a0c9f1b07f79 BUG: 1198849 Signed-off-by: Anoop C S Reviewed-on: http://review.gluster.org/12351 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- configure.ac | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e93bae92666..08403bd1434 100644 --- a/configure.ac +++ b/configure.ac @@ -893,11 +893,9 @@ AC_SUBST(ARGP_STANDALONE_DIR) # Check for atomic operation support echo -n "checking for atomic operation support... " -AC_LANG_CONFTEST([int main() { long int a = 4; __sync_fetch_and_add_8 (&a, 1); }]) -$CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null -ret=$? -rm -f conftest.o conftest -if test $ret -eq 0 ; then +AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { long int a = 4; __sync_fetch_and_add_8 (&a, 1); }]])], + [have_sync_fetch_and_add_8=yes], [have_sync_fetch_and_add_8=no]) +if test "x${have_sync_fetch_and_add_8}" = "xyes"; then echo "yes" AC_DEFINE(HAVE_ATOMIC_BUILTINS, 1, [have atomic builtins]) else -- cgit