summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-09-29 01:15:53 -0700
committerGuy Harris <guy@alum.mit.edu>2015-09-29 01:15:53 -0700
commit494b45734c8b4953be471ef76b9d09349c855af8 (patch)
treec93411ee3f1409c541a5fe292dd035ce508e59d1 /aclocal.m4
parentc632b5f3d1251b4c4f16171d0963d92b6689d41b (diff)
downloadtcpdump-494b45734c8b4953be471ef76b9d09349c855af8.tar.gz
We need -Werror when testing whether -f or -m flags work.
Thank you, clang, for treating unknown -f flags as warnings, only failing with them if run with -Werror, and spewing out warning messages whenever they're used.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m413
1 files changed, 12 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 6b04a4c4..ca78a02c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -257,7 +257,18 @@ AC_DEFUN(AC_LBL_CHECK_COMPILER_OPT,
[
AC_MSG_CHECKING([whether the compiler supports the $2 option])
save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error $2"
+ if expr "x$2" : "x-W.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error $2"
+ elif expr "x$2" : "x-f.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror $2"
+ elif expr "x$2" : "x-m.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror $2"
+ else
+ CFLAGS="$CFLAGS $2"
+ fi
AC_TRY_COMPILE(
[],
[return 0],