source: trunk/third/m4/aclocal.m4 @ 13394

Revision 13394, 2.4 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r13393, which included commits to RCS files with non-trunk default branches.
Line 
1# Local additions to Autoconf macros.
2# Copyright (C) 1992, 1994 Free Software Foundation, Inc.
3# Francois Pinard <pinard@iro.umontreal.ca>, 1992.
4
5# @defmac AC_PROG_CC_STDC
6# @maindex PROG_CC_STDC
7# @ovindex CC
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.
13#
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{ac_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.
19# @end defmac
20
21define(fp_PROG_CC_STDC,
22[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
23AC_CACHE_VAL(ac_cv_prog_cc_stdc,
24[ac_cv_prog_cc_stdc=no
25ac_save_CFLAGS="$CFLAGS"
26# Don't try gcc -ansi; that turns off useful extensions and
27# breaks some systems' header files.
28# AIX                   -qlanglvl=ansi
29# Ultrix and OSF/1      -std1
30# HP-UX                 -Aa -D_HPUX_SOURCE
31# SVR4                  -Xc
32for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
33do
34  CFLAGS="$ac_save_CFLAGS $ac_arg"
35  AC_TRY_COMPILE(
36[#if !defined(__STDC__) || __STDC__ != 1
37choke me
38#endif 
39], [int test (int i, double x);
40struct s1 {int (*f) (int a);};
41struct s2 {int (*f) (double a);};],
42[ac_cv_prog_cc_stdc="$ac_arg"; break])
43done
44CFLAGS="$ac_save_CFLAGS"
45])
46AC_MSG_RESULT($ac_cv_prog_cc_stdc)
47case "x$ac_cv_prog_cc_stdc" in
48  x|xno) ;;
49  *) CC="$CC $ac_cv_prog_cc_stdc" ;;
50esac
51])
52
53# Check for function prototypes.
54
55AC_DEFUN(fp_C_PROTOTYPES,
56[AC_REQUIRE([fp_PROG_CC_STDC])
57AC_MSG_CHECKING([for function prototypes])
58if test "$ac_cv_prog_cc_stdc" != no; then
59  AC_MSG_RESULT(yes)
60  AC_DEFINE(PROTOTYPES)
61  U= ANSI2KNR=
62else
63  AC_MSG_RESULT(no)
64  U=_ ANSI2KNR=ansi2knr
65fi
66AC_SUBST(U)dnl
67AC_SUBST(ANSI2KNR)dnl
68])
69
70# Check if --with-dmalloc was given.
71
72AC_DEFUN(fp_WITH_DMALLOC,
73[AC_MSG_CHECKING(if malloc debugging is wanted)
74AC_ARG_WITH(dmalloc,
75[  --with-dmalloc          use dmalloc, as in dmalloc.tar.gz from
76                          @/ftp.antaire.com:antaire/src/dmalloc.],
77[if test "$withval" = yes; then
78  AC_MSG_RESULT(yes)
79  AC_DEFINE(WITH_DMALLOC)
80  LIBS="$LIBS -ldmalloc"
81  LDFLAGS="$LDFLAGS -g"
82else
83  AC_MSG_RESULT(no)
84fi], [AC_MSG_RESULT(no)])])
85
Note: See TracBrowser for help on using the repository browser.