From e5f99adf775ef4162cb8459a462ba4efa684b261 Mon Sep 17 00:00:00 2001 From: Phil Carns Date: Thu, 11 Nov 2021 14:17:11 -0500 Subject: [PATCH] adjust include path for 128-bit CAS autoconf test - ensures that the test works correctly for both in-tree and out-of-tree builds --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac b/configure.ac index b478e98c..9c5e4739 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,6 +1108,11 @@ AS_IF([test x"$use_huge_page" = x"yes"], # check for the availability of int128 CAS. It is hard to get availability of # instructions (and compiler support), so we rely on AC_RUN_IFELSE(). atomic_int128_cas_mode="disabled" +# Note: temporarily prepend the source directory to the include path so that +# the following configure test can locate abtd_asm_int128_cas.h regardless +# of where the configure script is executed. +SAVE_CFLAGS="$CFLAGS" +CFLAGS="-I$srcdir $CFLAGS" AC_RUN_IFELSE([AC_LANG_PROGRAM([#include "src/include/asm/abtd_asm_int128_cas.h"],[ __int128 val, old, neu; int ret1, ret2; @@ -1117,6 +1122,7 @@ val = 0, old = 1, neu = 1; ret2 = !ABTD_asm_bool_cas_weak_int128(&val, old, neu) && (val == 0); return !(ret1 && ret2); ])], [AC_DEFINE(ABT_CONFIG_HAVE_ATOMIC_INT128, 1, [Define if 128-bit CAS is supported.])]) +CFLAGS="$SAVE_CFLAGS" AM_CONDITIONAL([ABT_USE_INT128_ATOMIC], [test "x$ABT_CONFIG_HAVE_ATOMIC_INT128" != "x"])