annotate aclocal.m4 @ 28562:374cbdbde9bd

*** empty log message ***
author Eli Zaretskii <eliz@gnu.org>
date Thu, 13 Apr 2000 10:17:16 +0000
parents e931b73f3b4f
children 0c4dc9f274f0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27939
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
1 dnl The following are from prerelease autoconf 2.14a. When 2.14 is
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
2 dnl released, we should be able to zap them and AC_PREREQ(2.14).
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
3
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
4
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
5 # AC_PROG_CC_STDC
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
6 # ---------------
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
7 # If the C compiler in not in ANSI C mode by default, try to add an
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
8 # option to output variable @code{CC} to make it so. This macro tries
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
9 # various options that select ANSI C on some system or another. It
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
10 # considers the compiler to be in ANSI C mode if it handles function
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
11 # prototypes correctly.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
12 AC_DEFUN(AC_PROG_CC_STDC,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
13 [AC_REQUIRE([AC_PROG_CC])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
14 AC_BEFORE([$0], [AC_C_INLINE])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
15 AC_BEFORE([$0], [AC_C_CONST])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
16 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
17 dnl a magic option to avoid problems with ANSI preprocessor commands
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
18 dnl like #elif.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
19 dnl FIXME: can't do this because then AC_AIX won't work due to a
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
20 dnl circular dependency.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
21 dnl AC_BEFORE([$0], [AC_PROG_CPP])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
22 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
23 AC_CACHE_VAL(ac_cv_prog_cc_stdc,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
24 [ac_cv_prog_cc_stdc=no
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
25 ac_save_CC="$CC"
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
26 # Don't try gcc -ansi; that turns off useful extensions and
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
27 # breaks some systems' header files.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
28 # AIX -qlanglvl=ansi
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
29 # Ultrix and OSF/1 -std1
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
30 # HP-UX 10.20 and later -Ae
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
31 # HP-UX older versions -Aa -D_HPUX_SOURCE
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
32 # SVR4 -Xc -D__EXTENSIONS__
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
33 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
34 do
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
35 CC="$ac_save_CC $ac_arg"
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
36 AC_TRY_COMPILE(
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
37 [#include <stdarg.h>
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
38 #include <stdio.h>
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
39 #include <sys/types.h>
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
40 #include <sys/stat.h>
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
41 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
42 struct buf { int x; };
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
43 FILE * (*rcsopen) (struct buf *, struct stat *, int);
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
44 static char *e (p, i)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
45 char **p;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
46 int i;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
47 {
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
48 return p[i];
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
49 }
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
50 static char *f (char * (*g) (char **, int), char **p, ...)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
51 {
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
52 char *s;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
53 va_list v;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
54 va_start (v,p);
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
55 s = g (p, va_arg (v,int));
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
56 va_end (v);
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
57 return s;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
58 }
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
59 int test (int i, double x);
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
60 struct s1 {int (*f) (int a);};
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
61 struct s2 {int (*f) (double a);};
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
62 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
63 int argc;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
64 char **argv;],
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
65 [return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];],
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
66 [ac_cv_prog_cc_stdc="$ac_arg"; break])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
67 done
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
68 CC="$ac_save_CC"
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
69 ])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
70 case "x$ac_cv_prog_cc_stdc" in
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
71 x|xno)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
72 AC_MSG_RESULT([none needed]) ;;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
73 *)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
74 AC_MSG_RESULT($ac_cv_prog_cc_stdc)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
75 CC="$CC $ac_cv_prog_cc_stdc" ;;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
76 esac
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
77 ])# AC_PROG_CC_STDC
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
78
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
79 # AC_C_VOLATILE
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
80 # -------------
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
81 # Note that, unlike const, #defining volatile to be the empty string can
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
82 # actually turn a correct program into an incorrect one, since removing
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
83 # uses of volatile actually grants the compiler permission to perform
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
84 # optimizations that could break the user's code. So, do not #define
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
85 # volatile away unless it is really necessary to allow the user's code
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
86 # to compile cleanly. Benign compiler failures should be tolerated.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
87 AC_DEFUN(AC_C_VOLATILE,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
88 [AC_REQUIRE([AC_PROG_CC_STDC])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
89 AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
90 [AC_TRY_COMPILE(,[
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
91 volatile int x;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
92 int * volatile y;],
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
93 ac_cv_c_volatile=yes, ac_cv_c_volatile=no)])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
94 if test $ac_cv_c_volatile = no; then
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
95 AC_DEFINE(volatile,,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
96 [Define to empty if the keyword `volatile' does not work.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
97 Warning: valid code using `volatile' can become incorrect
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
98 without. Disable with care.])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
99 fi
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
100 ])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
101
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
102 # AC_C_PROTOTYPES
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
103 # ---------------
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
104 # Check if the C compiler supports prototypes, included if it needs
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
105 # options.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
106 AC_DEFUN(AC_C_PROTOTYPES,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
107 [AC_REQUIRE([AC_PROG_CC_STDC])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
108 AC_REQUIRE([AC_PROG_CPP])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
109 AC_MSG_CHECKING([for function prototypes])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
110 if test "$ac_cv_prog_cc_stdc" != no; then
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
111 AC_MSG_RESULT(yes)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
112 AC_DEFINE(PROTOTYPES, 1,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
113 [Define if the compiler supports function prototypes.])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
114 else
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
115 AC_MSG_RESULT(no)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
116 fi
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
117 ])# AC_C_PROTOTYPES