dnl
AC_DEFUN([LIBAT_HAVE_INT_MODE],[
AC_CACHE_CHECK([for $2 byte integer],[libat_cv_have_mode_$1],
- [AC_COMPILE_IFELSE([int x __attribute__((mode($1)));],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([int x __attribute__((mode($1)));])],
[libat_cv_have_mode_$1=yes],[libat_cv_have_mode_$1=no])])
LIBAT_DEFINE_YESNO([HAVE_INT$2], [$libat_cv_have_mode_$1],
[Have support for $2 byte integers.])
else
old_CFLAGS="$CFLAGS"
# Compile unoptimized.
- CFLAGS='-O0 -S'
+ CFLAGS="$CFLAGS -O0 -S"
if AC_TRY_EVAL(ac_compile); then
if grep __atomic_ conftest.s >/dev/null 2>&1 ; then
eval $2=no
else
eval $2=yes
fi
+ else
+ eval $2=no
fi
CFLAGS="$old_CFLAGS"
fi
LIBAT_DEFINE_YESNO([HAVE_ATOMIC_LDST_$2], [$libat_cv_have_at_ldst_$2],
[Have __atomic_load/store for $2 byte integers.])
AH_BOTTOM([#define MAYBE_HAVE_ATOMIC_LDST_$2 HAVE_ATOMIC_LDST_$2])
+ AH_BOTTOM([#define FAST_ATOMIC_LDST_$2 HAVE_ATOMIC_LDST_$2])
])
dnl
])
dnl
-dnl Check whether the target supports ifuncs.
+dnl Check whether the target supports the ifunc attribute.
dnl
AC_DEFUN([LIBAT_CHECK_IFUNC], [
- AC_CACHE_CHECK([whether the target supports funcs], libat_cv_have_ifunc, [
+ AC_CACHE_CHECK([whether the target supports the ifunc attribute],
+ libat_cv_have_ifunc, [
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_TRY_LINK([
int foo_alt(void) { return 0; }
- void *foo_sel(void) { return foo_alt; }
+ typedef int F (void);
+ F *foo_sel(void) { return foo_alt; }
int foo(void) __attribute__((ifunc("foo_sel")));],
[return foo();], libat_cv_have_ifunc=yes, libat_cv_have_ifunc=no)])
LIBAT_DEFINE_YESNO([HAVE_IFUNC], [$libat_cv_have_ifunc],
dnl ----------------------------------------------------------------------
sinclude(../libtool.m4)
+sinclude(../config/enable.m4)
+sinclude(../config/cet.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl add a definition of LIBTOOL to Makefile.in.