From b97b12fabb292eab6c31585046fbdec374ab68ad Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Thu, 1 Aug 2019 10:12:09 +0200 Subject: [PATCH] fix #5816 --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 356f6d0d2..d4636941f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,25 @@ CFLAGS="-Wall $CFLAGS" AS_IF([gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1], [CFLAGS="-fno-strict-aliasing $CFLAGS"]) +# A helper which allows us to check cflags if compiler +AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [ + AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]), + [ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])], + [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"], + [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"]) + CFLAGS="$ac_save_CFLAGS" + ]) + + AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes], + [$2], [$3]) +]) + +# We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable. +CC_CHECK_CFLAGS_SILENT([-Wno-address-of-packed-member], + [CFLAGS="-Wno-address-of-packed-member $CFLAGS"]) + # Use Linux interface name unless the OS has a different preference DEFAULT_INTERFACE="\"eth0\"" -- 2.25.1