1 # Local additions to Autoconf macros.
2 # Copyright (C) 1992, 1994 Free Software Foundation, Inc.
3 # Francois Pinard <pinard@iro.umontreal.ca>, 1992.
5 # @defmac fp_PROG_CC_STDC
6 # @maindex PROG_CC_STDC
8 # If the C compiler in not in ANSI C mode by default, try to add an option
9 # to output variable @code{CC} to make it so. This macro tries various
10 # options that select ANSI C on some system or another. It considers the
11 # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
12 # handles function prototypes correctly.
14 # If you use this macro, you should check after calling it whether the C
15 # compiler has been set to accept ANSI C; if not, the shell variable
16 # @code{fp_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
17 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
18 # program @code{ansi2knr}, which comes with Ghostscript.
21 define(fp_PROG_CC_STDC,
22 [AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C,
24 [fp_cv_prog_cc_stdc=no
25 ac_save_CFLAGS="$CFLAGS"
26 # Don't try gcc -ansi; that turns off useful extensions and
27 # breaks some systems' header files.
29 # Ultrix and OSF/1 -std1
30 # HP-UX -Ae or -Aa -D_HPUX_SOURCE
32 # For HP-UX, we try -Ae first; this turns on ANSI but also extensions,
33 # as well as defining _HPUX_SOURCE, and we can then use long long.
34 # We keep the old version for backward compatibility.
35 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" -Xc
37 CFLAGS="$ac_save_CFLAGS $ac_arg"
42 ], [int test (int i, double x);
43 struct s1 {int (*f) (int a);};
44 struct s2 {int (*f) (double a);};],
45 [fp_cv_prog_cc_stdc="$ac_arg"; break])
47 CFLAGS="$ac_save_CFLAGS"
49 case "x$fp_cv_prog_cc_stdc" in
51 *) CC="$CC $fp_cv_prog_cc_stdc" ;;
56 [AC_MSG_CHECKING(whether ln works)
57 AC_CACHE_VAL(ac_cv_prog_LN,
58 [rm -f conftestdata conftestlink
60 if ln conftestdata conftestlink 2>/dev/null
62 rm -f conftestdata conftestlink
69 if test "$ac_cv_prog_LN" = "ln"; then
77 builtin(include, aczsh.m4)