cvs: /php3 aclocal.m4 configure.in
| From: | Sascha Schumann | Date: | Tue, 21 Sep 1999 08:47:48 +0000 |
| Subject: | cvs: /php3 aclocal.m4 configure.in | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11132@lists.php.net to get a copy of this message | ||
sas Tue Sep 21 04:47:48 1999 EDT
Modified files:
/php3 aclocal.m4 configure.in
Log:
Use AM_PROG_CC_STDC in php3 as well.
Index: php3/aclocal.m4
diff -u php3/aclocal.m4:1.46 php3/aclocal.m4:1.47
--- php3/aclocal.m4:1.46 Wed Aug 25 12:11:42 1999
+++ php3/aclocal.m4 Tue Sep 21 04:47:47 1999
@@ -1,4 +1,4 @@
-dnl $Id: aclocal.m4,v 1.46 1999/08/25 16:11:42 sas Exp $
+dnl $Id: aclocal.m4,v 1.47 1999/09/21 08:47:47 sas Exp $
dnl
dnl This file contains local autoconf functions.
@@ -587,3 +587,89 @@
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so. This macro tries various
+# options that select ANSI C on some system or another. It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN(AM_PROG_CC_STDC,
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc
-D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT($am_cv_prog_cc_stdc)
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
+
Index: php3/configure.in
diff -u php3/configure.in:1.464 php3/configure.in:1.465
--- php3/configure.in:1.464 Mon Sep 20 12:31:16 1999
+++ php3/configure.in Tue Sep 21 04:47:47 1999
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.464 1999/09/20 16:31:16 sas Exp $
+dnl $Id: configure.in,v 1.465 1999/09/21 08:47:47 sas Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT(main.c)
@@ -26,6 +26,7 @@
AC_MSG_RESULT($1.$2 (ok))
fi
AC_PROG_CC
+AM_PROG_CC_STDC
AC_PROG_RANLIB
AC_PROG_CC_C_O
AC_PROG_LN_S
@@ -2885,11 +2886,6 @@
dnl If we're using gcc and the user hasn't specified CFLAGS, add -O2.
test -n "$auto_cflags" && test -n "$GCC" &&
CFLAGS="$CFLAGS -O2"
-
-dnl If we're using cc on HP-UX, add the -Ae to CFLAGS
-if test -n "$auto_cflags" && test "
uname -s
2>/dev/null" = "HP-UX"; then
- test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
-fi
dnl *** Commented out - generates slow code and consumes a lot of
dnl *** resources during compilation - we need to figure out how