aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac19
1 files changed, 16 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 7ca7250e7..5e0b3bd14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,7 @@ AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
71 AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]), 71 AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
72 [ac_save_CFLAGS="$CFLAGS" 72 [ac_save_CFLAGS="$CFLAGS"
73 CFLAGS="$CFLAGS $1" 73 CFLAGS="$CFLAGS $1"
74 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])], 74 AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
75 [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"], 75 [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"],
76 [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"]) 76 [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"])
77 CFLAGS="$ac_save_CFLAGS" 77 CFLAGS="$ac_save_CFLAGS"
@@ -81,9 +81,22 @@ AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
81 [$2], [$3]) 81 [$2], [$3])
82]) 82])
83 83
84
85# CC_CHECK_CFLAG_APPEND(FLAG, [action-if-found], [action-if-not-found])
86# Check for CFLAG and appends them to CFLAGS if supported
87AC_DEFUN([CC_CHECK_CFLAG_APPEND], [
88 AC_CACHE_CHECK([if $CC supports $1 flag],
89 AS_TR_SH([cc_cv_cflags_$1]),
90 CC_CHECK_CFLAGS_SILENT([$1])
91 )
92
93 AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
94 [CFLAGS="$CFLAGS $1"; $2], [$3])
95])
96
97
84# We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable. 98# We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable.
85CC_CHECK_CFLAGS_SILENT([-Wno-address-of-packed-member], 99CC_CHECK_CFLAG_APPEND([-Wno-address-of-packed-member])
86 [CFLAGS="-Wno-address-of-packed-member $CFLAGS"])
87 100
88# Use Linux interface name unless the OS has a different preference 101# Use Linux interface name unless the OS has a different preference
89DEFAULT_INTERFACE="\"eth0\"" 102DEFAULT_INTERFACE="\"eth0\""