From: Guy Harris Date: Wed, 8 May 2013 06:58:51 +0000 (-0700) Subject: Don't try -W flags with HP's C compiler. X-Git-Tag: tcpdump-4.5.0~80^2~11 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/e6ffaf83959eadaf224e2de9da1e71151e3734fd Don't try -W flags with HP's C compiler. HP's C compiler cannot be made to exit with a non-zero exit status when given an unknown compiler flag, so you can't use that to figure out if a flag is supported, but it *will* print a warning, which we don't want. In addition, it doesn't support -W flags for warnings in any case, so let's not bother with them. --- diff --git a/aclocal.m4 b/aclocal.m4 index 55e32103..6797b205 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -171,6 +171,15 @@ AC_DEFUN(AC_LBL_C_INIT, case "$host_os" in + hpux*) + # + # Note that this is HP C, because we have to + # treat it specially below. + # + ac_lbl_cc_is_hp_c=yes + ;; + + irix*) $1="$$1 -xansi -signed -O" ;; @@ -868,13 +877,24 @@ AC_DEFUN(AC_LBL_DEVEL, $1="$$1 ${LBL_CFLAGS}" fi if test -f .devel ; then - AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR() - AC_LBL_CHECK_COMPILER_OPT($1, -Wall) - AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes) - AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes) - AC_LBL_CHECK_COMPILER_OPT($1, -Wwrite-strings) - AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith) - AC_LBL_CHECK_COMPILER_OPT($1, -W) + # + # At least one version of HP's C compiler will not + # exit with a non-zero exit status when given an + # unknown -W flag, even if you use +We and the + # number of the warning it gives for that issue. + # + # We therefore skip all the warning option stuff + # on HP-UX. + # + if test "$ac_lbl_cc_is_hp_c" != yes; then + AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR() + AC_LBL_CHECK_COMPILER_OPT($1, -Wall) + AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes) + AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes) + AC_LBL_CHECK_COMPILER_OPT($1, -Wwrite-strings) + AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith) + AC_LBL_CHECK_COMPILER_OPT($1, -W) + fi if test "$GCC" = yes ; then if test "${LBL_CFLAGS+set}" != set; then if test "$ac_cv_prog_cc_g" = yes ; then diff --git a/configure b/configure index f7b49d81..f46c469d 100755 --- a/configure +++ b/configure @@ -3046,6 +3046,15 @@ echo "$as_me: error: see the INSTALL doc for more info" >&2;} case "$host_os" in + hpux*) + # + # Note that this is HP C, because we have to + # treat it specially below. + # + ac_lbl_cc_is_hp_c=yes + ;; + + irix*) V_CCOPT="$V_CCOPT -xansi -signed -O" ;; @@ -11289,6 +11298,16 @@ rm -f os-proto.h V_CCOPT="$V_CCOPT ${LBL_CFLAGS}" fi if test -f .devel ; then + # + # At least one version of HP's C compiler will not + # exit with a non-zero exit status when given an + # unknown -W flag, even if you use +We and the + # number of the warning it gives for that issue. + # + # We therefore skip all the warning option stuff + # on HP-UX. + # + if test "$ac_lbl_cc_is_hp_c" != yes; then { echo "$as_me:$LINENO: checking whether the compiler fails when given an unknown warning option" >&5 echo $ECHO_N "checking whether the compiler fails when given an unknown warning option... $ECHO_C" >&6; } @@ -11685,6 +11704,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi if test "$GCC" = yes ; then if test "${LBL_CFLAGS+set}" != set; then if test "$ac_cv_prog_cc_g" = yes ; then