diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-09-29 01:15:53 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-09-29 01:15:53 -0700 |
commit | 494b45734c8b4953be471ef76b9d09349c855af8 (patch) | |
tree | c93411ee3f1409c541a5fe292dd035ce508e59d1 /aclocal.m4 | |
parent | c632b5f3d1251b4c4f16171d0963d92b6689d41b (diff) | |
download | tcpdump-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.m4 | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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], |