1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
16 # @defmac AC_PROG_CC_STDC
17 # @maindex PROG_CC_STDC
19 # If the C compiler in not in ANSI C mode by default, try to add an option
20 # to output variable @code{CC} to make it so. This macro tries various
21 # options that select ANSI C on some system or another. It considers the
22 # compiler to be in ANSI C mode if it handles function prototypes correctly.
24 # If you use this macro, you should check after calling it whether the C
25 # compiler has been set to accept ANSI C; if not, the shell variable
26 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
27 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
28 # program @code{ansi2knr}, which comes with Ghostscript.
31 AC_DEFUN(AM_PROG_CC_STDC,
32 [AC_REQUIRE([AC_PROG_CC])
33 AC_BEFORE([$0], [AC_C_INLINE])
34 AC_BEFORE([$0], [AC_C_CONST])
35 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
36 dnl a magic option to avoid problems with ANSI preprocessor commands
38 dnl FIXME: can't do this because then AC_AIX won't work due to a
39 dnl circular dependency.
40 dnl AC_BEFORE([$0], [AC_PROG_CPP])
41 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
42 AC_CACHE_VAL(am_cv_prog_cc_stdc,
43 [am_cv_prog_cc_stdc=no
45 # Don't try gcc -ansi; that turns off useful extensions and
46 # breaks some systems' header files.
48 # Ultrix and OSF/1 -std1
49 # HP-UX -Aa -D_HPUX_SOURCE
50 # SVR4 -Xc -D__EXTENSIONS__
51 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
53 CC="$ac_save_CC $ac_arg"
57 #include <sys/types.h>
59 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
60 struct buf { int x; };
61 FILE * (*rcsopen) (struct buf *, struct stat *, int);
68 static char *f (char * (*g) (char **, int), char **p, ...)
73 s = g (p, va_arg (v,int));
77 int test (int i, double x);
78 struct s1 {int (*f) (int a);};
79 struct s2 {int (*f) (double a);};
80 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
84 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
86 [am_cv_prog_cc_stdc="$ac_arg"; break])
90 if test -z "$am_cv_prog_cc_stdc"; then
91 AC_MSG_RESULT([none needed])
93 AC_MSG_RESULT($am_cv_prog_cc_stdc)
95 case "x$am_cv_prog_cc_stdc" in
97 *) CC="$CC $am_cv_prog_cc_stdc" ;;