configure.c: fix AX_GCC_FUNC_ATTRIBUTE detection on custom CFLAGS

AX_GCC_FUNC_ATTRIBUTE detect attribute feature by compiler warnings.
Custom or unrecognized CFLAGS can causes extra warnings so attribute
check failed.

Reset CFLAGS and restore after AX_GCC_FUNC_ATTRIBUTE call.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2019-01-11 16:08:28 +00:00 committed by Andrew Borodin
parent 9f4e2b945f
commit ee013b383f

View File

@ -45,7 +45,13 @@ if test "x$enable_werror" = xyes; then
mc_CHECK_ONE_CFLAG([-Werror]) mc_CHECK_ONE_CFLAG([-Werror])
fi fi
dnl Compiler can generate warnings for unrecognized flags added to CFLAGS
dnl which causes attribute checks to fail
ax_gcc_func_attribute_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS=
AX_GCC_FUNC_ATTRIBUTE([fallthrough]) AX_GCC_FUNC_ATTRIBUTE([fallthrough])
_AC_LANG_PREFIX[]FLAGS=$ax_gcc_func_attribute_save_flags
unset ax_gcc_func_attribute_save_flags
LT_INIT LT_INIT