Ticket #3955: mc-3955-autoconf-fix-gcc-function-check-detection.patch

File mc-3955-autoconf-fix-gcc-function-check-detection.patch, 1.1 KB (added by and, 5 years ago)
  • configure.ac

    From fb43e6ae14a5080d9d3d44192d6341ebee60febc Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Fri, 11 Jan 2019 16:08:28 +0000
    Subject: [PATCH] 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>
    ---
     configure.ac | 6 ++++++
     1 file changed, 6 insertions(+)
    
    diff --git a/configure.ac b/configure.ac
    index 22bf30f2b..f1200e7b9 100644
    a b if test "x$enable_werror" = xyes; then 
    4545    mc_CHECK_ONE_CFLAG([-Werror]) 
    4646fi 
    4747 
     48dnl Compiler can generate warnings for unrecognized flags added to CFLAGS 
     49dnl which causes attribute checks to fail 
     50ax_gcc_func_attribute_save_flags=$[]_AC_LANG_PREFIX[]FLAGS 
     51_AC_LANG_PREFIX[]FLAGS= 
    4852AX_GCC_FUNC_ATTRIBUTE([fallthrough]) 
     53_AC_LANG_PREFIX[]FLAGS=$ax_gcc_func_attribute_save_flags 
     54unset ax_gcc_func_attribute_save_flags 
    4955 
    5056LT_INIT 
    5157