summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2016-08-23 16:04:57 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2017-09-20 20:41:25 +0200
commit7871b86d086d7cd51f2301a5b46d4a6da0a3f218 (patch)
treead87d26cb367c1a8a2d66da4ba0dab825ac2169f /configure
parent56f51802672305ef82016b30adedb6da2996362c (diff)
downloadtcpdump-7871b86d086d7cd51f2301a5b46d4a6da0a3f218.tar.gz
Compile with '-Wassign-enum' in devel mode if supported
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure b/configure
index 9a261d52..434c87cf 100755
--- a/configure
+++ b/configure
@@ -7235,6 +7235,49 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wassign-enum option" >&5
+$as_echo_n "checking whether the compiler supports the -Wassign-enum option... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ if expr "x-Wassign-enum" : "x-W.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wassign-enum"
+ elif expr "x-Wassign-enum" : "x-f.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wassign-enum"
+ elif expr "x-Wassign-enum" : "x-m.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wassign-enum"
+ else
+ CFLAGS="$CFLAGS -Wassign-enum"
+ fi
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+return 0
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ CFLAGS="$save_CFLAGS"
+ V_CCOPT="$V_CCOPT -Wassign-enum"
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$save_CFLAGS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports generating dependencies" >&5