annotate aclocal.m4 @ 29328:a55fb9812416

*** empty log message ***
author Kenichi Handa <handa@m17n.org>
date Wed, 31 May 2000 03:50:57 +0000
parents 235bba09bd4c
children f97066fb42ae
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
28583
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
2 dnl released, we should be able to zap them and just use AC_PREREQ(2.14).
27939
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
28583
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
79 # AC_FUNC_MKTIME
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
80 # --------------
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
81 AC_DEFUN(AC_FUNC_MKTIME,
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
82 [AC_REQUIRE([AC_HEADER_TIME])dnl
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
83 AC_CHECK_HEADERS(sys/time.h unistd.h)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
84 AC_CHECK_FUNCS(alarm)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
85 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
86 [AC_TRY_RUN(
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
87 [/* Test program from Paul Eggert (eggert@twinsun.com)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
88 and Tony Leneis (tony@plaza.ds.adp.com). */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
89 #if TIME_WITH_SYS_TIME
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
90 # include <sys/time.h>
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
91 # include <time.h>
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
92 #else
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
93 # if HAVE_SYS_TIME_H
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
94 # include <sys/time.h>
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
95 # else
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
96 # include <time.h>
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
97 # endif
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
98 #endif
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
99
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
100 #if HAVE_UNISTD_H
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
101 # include <unistd.h>
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
102 #endif
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
103
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
104 #if !HAVE_ALARM
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
105 # define alarm(X) /* empty */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
106 #endif
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
107
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
108 /* Work around redefinition to rpl_putenv by other config tests. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
109 #undef putenv
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
110
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
111 static time_t time_t_max;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
112
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
113 /* Values we'll use to set the TZ environment variable. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
114 static const char *const tz_strings[] = {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
115 (const char *) 0, "TZ=GMT0", "TZ=JST-9",
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
116 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
117 };
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
118 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
119
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
120 /* Fail if mktime fails to convert a date in the spring-forward gap.
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
121 Based on a problem report from Andreas Jaeger. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
122 static void
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
123 spring_forward_gap ()
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
124 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
125 /* glibc (up to about 1998-10-07) failed this test) */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
126 struct tm tm;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
127
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
128 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
129 instead of "TZ=America/Vancouver" in order to detect the bug even
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
130 on systems that don't support the Olson extension, or don't have the
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
131 full zoneinfo tables installed. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
132 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
133
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
134 tm.tm_year = 98;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
135 tm.tm_mon = 3;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
136 tm.tm_mday = 5;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
137 tm.tm_hour = 2;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
138 tm.tm_min = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
139 tm.tm_sec = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
140 tm.tm_isdst = -1;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
141 if (mktime (&tm) == (time_t)-1)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
142 exit (1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
143 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
144
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
145 static void
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
146 mktime_test (now)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
147 time_t now;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
148 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
149 struct tm *lt;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
150 if ((lt = localtime (&now)) && mktime (lt) != now)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
151 exit (1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
152 now = time_t_max - now;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
153 if ((lt = localtime (&now)) && mktime (lt) != now)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
154 exit (1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
155 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
156
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
157 static void
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
158 irix_6_4_bug ()
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
159 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
160 /* Based on code from Ariel Faigon. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
161 struct tm tm;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
162 tm.tm_year = 96;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
163 tm.tm_mon = 3;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
164 tm.tm_mday = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
165 tm.tm_hour = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
166 tm.tm_min = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
167 tm.tm_sec = 0;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
168 tm.tm_isdst = -1;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
169 mktime (&tm);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
170 if (tm.tm_mon != 2 || tm.tm_mday != 31)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
171 exit (1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
172 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
173
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
174 static void
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
175 bigtime_test (j)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
176 int j;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
177 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
178 struct tm tm;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
179 time_t now;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
180 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
181 now = mktime (&tm);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
182 if (now != (time_t) -1)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
183 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
184 struct tm *lt = localtime (&now);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
185 if (! (lt
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
186 && lt->tm_year == tm.tm_year
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
187 && lt->tm_mon == tm.tm_mon
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
188 && lt->tm_mday == tm.tm_mday
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
189 && lt->tm_hour == tm.tm_hour
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
190 && lt->tm_min == tm.tm_min
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
191 && lt->tm_sec == tm.tm_sec
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
192 && lt->tm_yday == tm.tm_yday
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
193 && lt->tm_wday == tm.tm_wday
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
194 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
195 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
196 exit (1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
197 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
198 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
199
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
200 int
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
201 main ()
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
202 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
203 time_t t, delta;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
204 int i, j;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
205
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
206 /* This test makes some buggy mktime implementations loop.
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
207 Give up after 60 seconds; a mktime slower than that
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
208 isn't worth using anyway. */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
209 alarm (60);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
210
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
211 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
212 continue;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
213 time_t_max--;
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
214 delta = time_t_max / 997; /* a suitable prime number */
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
215 for (i = 0; i < N_STRINGS; i++)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
216 {
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
217 if (tz_strings[i])
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
218 putenv (tz_strings[i]);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
219
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
220 for (t = 0; t <= time_t_max - delta; t += delta)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
221 mktime_test (t);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
222 mktime_test ((time_t) 60 * 60);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
223 mktime_test ((time_t) 60 * 60 * 24);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
224
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
225 for (j = 1; 0 < j; j *= 2)
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
226 bigtime_test (j);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
227 bigtime_test (j - 1);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
228 }
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
229 irix_6_4_bug ();
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
230 spring_forward_gap ();
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
231 exit (0);
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
232 }],
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
233 ac_cv_func_working_mktime=yes, ac_cv_func_working_mktime=no,
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
234 ac_cv_func_working_mktime=no)])
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
235 if test $ac_cv_func_working_mktime = no; then
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
236 LIBOBJS="$LIBOBJS mktime.${ac_objext}"
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
237 fi
28638
235bba09bd4c (AC_FUNC_MKTIME): Use AC_SUBST.
Dave Love <fx@gnu.org>
parents: 28583
diff changeset
238 AC_SUBST(LIBOBJS)dnl
28583
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
239 ])# AC_FUNC_MKTIME
0c4dc9f274f0 (AC_FUNC_MKTIME): New.
Dave Love <fx@gnu.org>
parents: 27939
diff changeset
240
27939
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
241 # AC_C_VOLATILE
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
242 # -------------
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
243 # Note that, unlike const, #defining volatile to be the empty string can
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
244 # actually turn a correct program into an incorrect one, since removing
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
245 # uses of volatile actually grants the compiler permission to perform
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
246 # optimizations that could break the user's code. So, do not #define
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
247 # 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
248 # to compile cleanly. Benign compiler failures should be tolerated.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
249 AC_DEFUN(AC_C_VOLATILE,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
250 [AC_REQUIRE([AC_PROG_CC_STDC])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
251 AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
252 [AC_TRY_COMPILE(,[
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
253 volatile int x;
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
254 int * volatile y;],
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
255 ac_cv_c_volatile=yes, ac_cv_c_volatile=no)])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
256 if test $ac_cv_c_volatile = no; then
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
257 AC_DEFINE(volatile,,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
258 [Define to empty if the keyword `volatile' does not work.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
259 Warning: valid code using `volatile' can become incorrect
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
260 without. Disable with care.])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
261 fi
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
262 ])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
263
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
264 # AC_C_PROTOTYPES
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
265 # ---------------
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
266 # Check if the C compiler supports prototypes, included if it needs
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
267 # options.
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
268 AC_DEFUN(AC_C_PROTOTYPES,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
269 [AC_REQUIRE([AC_PROG_CC_STDC])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
270 AC_REQUIRE([AC_PROG_CPP])dnl
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
271 AC_MSG_CHECKING([for function prototypes])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
272 if test "$ac_cv_prog_cc_stdc" != no; then
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
273 AC_MSG_RESULT(yes)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
274 AC_DEFINE(PROTOTYPES, 1,
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
275 [Define if the compiler supports function prototypes.])
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
276 else
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
277 AC_MSG_RESULT(no)
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
278 fi
e931b73f3b4f *** empty log message ***
Dave Love <fx@gnu.org>
parents:
diff changeset
279 ])# AC_C_PROTOTYPES