]> The Tcpdump Group git mirrors - libpcap/commitdiff
In AC_LBL_C_INIT, don't explicitly set V_CCOPT, just set $1, as is done
authorGuy Harris <[email protected]>
Sun, 5 Jul 2009 00:56:27 +0000 (17:56 -0700)
committerGuy Harris <[email protected]>
Sun, 5 Jul 2009 00:56:27 +0000 (17:56 -0700)
elsewhere in the macro.

For the Alpha C compiler, don't set -std1 unless it's necessary for ANSI
mode - we don't want to limit the compiler only to C89 features and,
more importantly, C89 headers (<inttypes.h> doesn't work, on at least
some versions of Digital UNIX and some C compiler versions, with -std1).

aclocal.m4
configure

index 2346e53787a38643c94b14424371f1c197c65b05..26f44872199a920fd1578f8da1354dbc2208c3c3 100644 (file)
@@ -174,10 +174,28 @@ AC_DEFUN(AC_LBL_C_INIT,
                                    AC_MSG_ERROR(see the INSTALL doc for more info)
                            fi
                            CFLAGS="$savedcflags"
-                           V_CCOPT="-Aa $V_CCOPT"
+                           $1="-Aa $$1"
                            AC_DEFINE(_HPUX_SOURCE,1,[needed on HP-UX])
                            ;;
 
+                   osf*)
+                           AC_MSG_CHECKING(for ansi mode in DEC compiler ($CC -std1))
+                           savedcflags="$CFLAGS"
+                           CFLAGS="-std1"
+                           AC_CACHE_VAL(ac_cv_lbl_cc_osf1_cc_std1,
+                               AC_TRY_COMPILE(
+                                   [#include <sys/types.h>],
+                                   [int frob(int, char *)],
+                                   ac_cv_lbl_cc_osf1_cc_std1=yes,
+                                   ac_cv_lbl_cc_osf1_cc_std1=no))
+                           AC_MSG_RESULT($ac_cv_lbl_cc_osf1_cc_std1)
+                           if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
+                                   AC_MSG_ERROR(see the INSTALL doc for more info)
+                           fi
+                           CFLAGS="$savedcflags"
+                           $1="-std1 $$1"
+                           ;;
+
                    *)
                            AC_MSG_ERROR(see the INSTALL doc for more info)
                            ;;
@@ -217,7 +235,7 @@ AC_DEFUN(AC_LBL_C_INIT,
                    #
                    # "cc" is GCC.
                    #
-                   V_CCOPT="$V_CCOPT -fpic"
+                   $1="$$1 -fpic"
                    V_SHLIB_CMD="\$(CC)"
                    V_SHLIB_OPT="-shared"
                    V_SONAME_OPT="-Wl,-soname,"
@@ -225,7 +243,7 @@ AC_DEFUN(AC_LBL_C_INIT,
                    ;;
 
            hpux*)
-                   V_CCOPT="$V_CCOPT +z"
+                   $1="$$1 +z"
                    V_SHLIB_CMD="\$(LD)"
                    V_SHLIB_OPT="-b"
                    V_SONAME_OPT="+h "
@@ -237,7 +255,7 @@ AC_DEFUN(AC_LBL_C_INIT,
                    ;;
 
            irix*)
-                   V_CCOPT="$V_CCOPT -xansi -signed -g3"
+                   $1="$$1 -xansi -signed -g3"
                    ;;
 
            osf*)
@@ -245,7 +263,7 @@ AC_DEFUN(AC_LBL_C_INIT,
                    # Presumed to be DEC OSF/1, Digital UNIX, or
                    # Tru64 UNIX.
                    #
-                   V_CCOPT="$V_CCOPT -std1 -g3"
+                   $1="$$1 -g3"
                    V_SHLIB_CMD="\$(CC)"
                    V_SHLIB_OPT="-shared"
                    V_SONAME_OPT="-soname "
index 405d76aa54cee7b4bf9e16c100f2f36451e74103..9ead0355d57407d6e080c343b8cc4eb77b4d63e6 100755 (executable)
--- a/configure
+++ b/configure
@@ -3092,6 +3092,68 @@ _ACEOF
 
                            ;;
 
+                   osf*)
+                           { echo "$as_me:$LINENO: checking for ansi mode in DEC compiler ($CC -std1)" >&5
+echo $ECHO_N "checking for ansi mode in DEC compiler ($CC -std1)... $ECHO_C" >&6; }
+                           savedcflags="$CFLAGS"
+                           CFLAGS="-std1"
+                           if test "${ac_cv_lbl_cc_osf1_cc_std1+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main ()
+{
+int frob(int, char *)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_lbl_cc_osf1_cc_std1=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lbl_cc_osf1_cc_std1=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+                           { echo "$as_me:$LINENO: result: $ac_cv_lbl_cc_osf1_cc_std1" >&5
+echo "${ECHO_T}$ac_cv_lbl_cc_osf1_cc_std1" >&6; }
+                           if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
+                                   { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5
+echo "$as_me: error: see the INSTALL doc for more info" >&2;}
+   { (exit 1); exit 1; }; }
+                           fi
+                           CFLAGS="$savedcflags"
+                           V_CCOPT="-std1 $V_CCOPT"
+                           ;;
+
                    *)
                            { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5
 echo "$as_me: error: see the INSTALL doc for more info" >&2;}
@@ -3161,7 +3223,7 @@ echo "$as_me: error: see the INSTALL doc for more info" >&2;}
                    # Presumed to be DEC OSF/1, Digital UNIX, or
                    # Tru64 UNIX.
                    #
-                   V_CCOPT="$V_CCOPT -std1 -g3"
+                   V_CCOPT="$V_CCOPT -g3"
                    V_SHLIB_CMD="\$(CC)"
                    V_SHLIB_OPT="-shared"
                    V_SONAME_OPT="-soname "