1 # Local additions to Autoconf macros.
2 # Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
3 # François Pinard <pinard@iro.umontreal.ca>, 1992.
5 ## ------------------------------- ##
6 ## Check for function prototypes. ##
7 ## ------------------------------- ##
9 AC_DEFUN(fp_C_PROTOTYPES,
10 [AC_REQUIRE([fp_PROG_CC_STDC])
11 AC_MSG_CHECKING([for function prototypes])
12 if test "$ac_cv_prog_cc_stdc" != no; then
18 U=_ ANSI2KNR=./ansi2knr
24 ## ----------------------------------------- ##
25 ## ANSIfy the C compiler whenever possible. ##
26 ## ----------------------------------------- ##
28 # @defmac AC_PROG_CC_STDC
29 # @maindex PROG_CC_STDC
31 # If the C compiler in not in ANSI C mode by default, try to add an option
32 # to output variable @code{CC} to make it so. This macro tries various
33 # options that select ANSI C on some system or another. It considers the
34 # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
35 # handles function prototypes correctly.
37 # If you use this macro, you should check after calling it whether the C
38 # compiler has been set to accept ANSI C; if not, the shell variable
39 # @code{ac_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
40 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
41 # program @code{ansi2knr}, which comes with Ghostscript.
44 AC_DEFUN(fp_PROG_CC_STDC,
45 [AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
46 AC_CACHE_VAL(ac_cv_prog_cc_stdc,
47 [ac_cv_prog_cc_stdc=no
48 ac_save_CFLAGS="$CFLAGS"
49 # Don't try gcc -ansi; that turns off useful extensions and
50 # breaks some systems' header files.
52 # Ultrix and OSF/1 -std1
53 # HP-UX -Aa -D_HPUX_SOURCE
55 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
57 CFLAGS="$ac_save_CFLAGS $ac_arg"
59 [#if !defined(__STDC__) || __STDC__ != 1
62 ], [int test (int i, double x);
63 struct s1 {int (*f) (int a);};
64 struct s2 {int (*f) (double a);};],
65 [ac_cv_prog_cc_stdc="$ac_arg"; break])
67 CFLAGS="$ac_save_CFLAGS"
69 AC_MSG_RESULT($ac_cv_prog_cc_stdc)
70 case "x$ac_cv_prog_cc_stdc" in
72 *) CC="$CC $ac_cv_prog_cc_stdc" ;;
76 ## --------------------------------------------------------- ##
77 ## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
79 ## --------------------------------------------------------- ##
81 AC_DEFUN(fp_PROG_INSTALL,
83 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
84 AC_SUBST(INSTALL_SCRIPT)dnl