]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't try -W flags with HP's C compiler.
authorGuy Harris <[email protected]>
Wed, 8 May 2013 06:58:51 +0000 (23:58 -0700)
committerGuy Harris <[email protected]>
Wed, 8 May 2013 06:58:51 +0000 (23:58 -0700)
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.

aclocal.m4
configure

index 55e32103900afa60c7547e5adc14ea2a9ae3b137..6797b20501d22356dc515d08c17672462296c0b0 100644 (file)
@@ -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
index f7b49d81dc909ac51e287e9510dd045a1cad9505..f46c469d8b5426ce71757eebe84ccdaa6d22a461 100755 (executable)
--- 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