summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2015-10-14 13:11:37 +0530
committerNiels de Vos <ndevos@redhat.com>2015-11-09 01:11:58 -0800
commitf68c95a429b44afc0197152a7819d17ce1de734c (patch)
treec4b5e670ecabeb6d8d2d07e16cdce5f49f7d1a19 /configure.ac
parent01ed634a490d3ea7c4bbb051a0a9f0512f8f7694 (diff)
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 <anoopcs@redhat.com> Reviewed-on: http://review.gluster.org/12351 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac8
1 files changed, 3 insertions, 5 deletions
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