Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / contrib / ntp / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.4e
2
3 # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 AC_DEFUN(hs_ULONG_CONST,
15 [ AC_EGREP_CPP(Circus,
16  [#define ACAT(a,b)a ## b
17 ACAT(Cir,cus)
18 ], AC_DEFINE([ULONG_CONST(a)], [a ## UL]),
19     AC_EGREP_CPP(Reiser,
20 [#define RCAT(a,b)a/**/b
21 RCAT(Rei,ser)
22 ], AC_DEFINE([ULONG_CONST(a)], [a/**/L]),
23     AC_MSG_ERROR([How do we create an unsigned long constant?])))])
24 dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
25 dnl
26 dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR
27 dnl variable, taking care of fixing up ${prefix} and such.
28 dnl
29 dnl Note that the 3 argument form is only supported with autoconf 2.13 and
30 dnl later (i.e. only where AC_DEFINE supports 3 arguments).
31 dnl
32 dnl Examples:
33 dnl
34 dnl    AC_DEFINE_DIR(DATADIR, datadir)
35 dnl    AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
36 dnl
37 dnl @version $Id: acinclude.m4,v 1.3 2000/08/04 03:26:22 stenn Exp $
38 dnl @author Alexandre Oliva <oliva@lsd.ic.unicamp.br>
39
40 AC_DEFUN(AC_DEFINE_DIR, [
41         ac_expanded=`(
42             test "x$prefix" = xNONE && prefix="$ac_default_prefix"
43             test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
44             eval echo \""[$]$2"\"
45         )`
46         ifelse($3, ,
47           AC_DEFINE_UNQUOTED($1, "$ac_expanded"),
48           AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3))
49 ])
50
51 # Like AC_CONFIG_HEADER, but automatically create stamp file.
52
53 # serial 3
54
55 # When config.status generates a header, we must update the stamp-h file.
56 # This file resides in the same directory as the config header
57 # that is generated.  We must strip everything past the first ":",
58 # and everything past the last "/".
59
60 AC_PREREQ([2.12])
61
62 AC_DEFUN([AM_CONFIG_HEADER],
63 [AC_CONFIG_HEADER([$1])
64   AC_OUTPUT_COMMANDS(
65    ifelse(patsubst([$1], [[^ ]], []),
66           [],
67           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
68            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),
69   [am_indx=1
70   for am_file in $1; do
71     case " $CONFIG_HEADERS " in
72     *" $am_file "*)
73       echo timestamp > `echo $am_file | sed 's%:.*%%;s%[^/]*$%%'`stamp-h$am_indx
74       ;;
75     esac
76     am_indx=\`expr \$am_indx + 1\`
77   done])
78 ])
79
80 # Do all the work for Automake.  This macro actually does too much --
81 # some checks are only needed if your package does certain things.
82 # But this isn't really a big deal.
83
84 # serial 5
85
86 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
87 # written in clear, in which case automake, when reading aclocal.m4,
88 # will think it sees a *use*, and therefore will trigger all it's
89 # C support machinery.  Also note that it means that autoscan, seeing
90 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
91
92
93 # We require 2.13 because we rely on SHELL being computed by configure.
94 AC_PREREQ([2.13])
95
96 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
97 # -----------------------------------------------------------
98 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
99 # The purpose of this macro is to provide the user with a means to
100 # check macros which are provided without letting her know how the
101 # information is coded.
102 # If this macro is not defined by Autoconf, define it here.
103 ifdef([AC_PROVIDE_IFELSE],
104       [],
105       [define([AC_PROVIDE_IFELSE],
106               [ifdef([AC_PROVIDE_$1],
107                      [$2], [$3])])])
108
109
110 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
111 # ----------------------------------------------
112 AC_DEFUN([AM_INIT_AUTOMAKE],
113 [AC_REQUIRE([AC_PROG_INSTALL])dnl
114 # test to see if srcdir already configured
115 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
116    test -f $srcdir/config.status; then
117   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
118 fi
119
120 # Define the identity of the package.
121 PACKAGE=$1
122 AC_SUBST(PACKAGE)dnl
123 VERSION=$2
124 AC_SUBST(VERSION)dnl
125 ifelse([$3],,
126 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
127 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
128
129 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
130 # the ones we care about.
131 ifdef([m4_pattern_allow],
132       [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
133
134 # Some tools Automake needs.
135 AC_REQUIRE([AM_SANITY_CHECK])dnl
136 AC_REQUIRE([AC_ARG_PROGRAM])dnl
137 AM_MISSING_PROG(ACLOCAL, aclocal)
138 AM_MISSING_PROG(AUTOCONF, autoconf)
139 AM_MISSING_PROG(AUTOMAKE, automake)
140 AM_MISSING_PROG(AUTOHEADER, autoheader)
141 AM_MISSING_PROG(MAKEINFO, makeinfo)
142 AM_MISSING_PROG(AMTAR, tar)
143 AM_MISSING_INSTALL_SH
144 AM_PROG_INSTALL_STRIP
145 # We need awk for the "check" target.  The system "awk" is bad on
146 # some platforms.
147 AC_REQUIRE([AC_PROG_AWK])dnl
148 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
149 AC_REQUIRE([AM_DEP_TRACK])dnl
150 AC_REQUIRE([AM_SET_DEPDIR])dnl
151 AC_PROVIDE_IFELSE([AC_PROG_][CC],
152                   [AM_DEPENDENCIES(CC)],
153                   [define([AC_PROG_][CC],
154                           defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
155 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
156                   [AM_DEPENDENCIES(CXX)],
157                   [define([AC_PROG_][CXX],
158                           defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
159 ])
160
161 #
162 # Check to make sure that the build environment is sane.
163 #
164
165 # serial 3
166
167 # AM_SANITY_CHECK
168 # ---------------
169 AC_DEFUN([AM_SANITY_CHECK],
170 [AC_MSG_CHECKING([whether build environment is sane])
171 # Just in case
172 sleep 1
173 echo timestamp > conftest.file
174 # Do `set' in a subshell so we don't clobber the current shell's
175 # arguments.  Must try -L first in case configure is actually a
176 # symlink; some systems play weird games with the mod time of symlinks
177 # (eg FreeBSD returns the mod time of the symlink's containing
178 # directory).
179 if (
180    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
181    if test "$[*]" = "X"; then
182       # -L didn't work.
183       set X `ls -t $srcdir/configure conftest.file`
184    fi
185    if test "$[*]" != "X $srcdir/configure conftest.file" \
186       && test "$[*]" != "X conftest.file $srcdir/configure"; then
187
188       # If neither matched, then we have a broken ls.  This can happen
189       # if, for instance, CONFIG_SHELL is bash and it inherits a
190       # broken ls alias from the environment.  This has actually
191       # happened.  Such a system could not be considered "sane".
192       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
193 alias in your environment])
194    fi
195
196    test "$[2]" = conftest.file
197    )
198 then
199    # Ok.
200    :
201 else
202    AC_MSG_ERROR([newly created file is older than distributed files!
203 Check your system clock])
204 fi
205 rm -f conftest*
206 AC_MSG_RESULT(yes)])
207
208
209 # serial 2
210
211 # AM_MISSING_PROG(NAME, PROGRAM)
212 # ------------------------------
213 AC_DEFUN([AM_MISSING_PROG],
214 [AC_REQUIRE([AM_MISSING_HAS_RUN])
215 $1=${$1-"${am_missing_run}$2"}
216 AC_SUBST($1)])
217
218
219 # AM_MISSING_INSTALL_SH
220 # ---------------------
221 # Like AM_MISSING_PROG, but only looks for install-sh.
222 AC_DEFUN([AM_MISSING_INSTALL_SH],
223 [AC_REQUIRE([AM_MISSING_HAS_RUN])
224 if test -z "$install_sh"; then
225    for install_sh in "$ac_aux_dir/install-sh" \
226                      "$ac_aux_dir/install.sh" \
227                      "${am_missing_run}${ac_auxdir}/install-sh";
228    do
229      test -f "$install_sh" && break
230    done
231    # FIXME: an evil hack: we remove the SHELL invocation from
232    # install_sh because automake adds it back in.  Sigh.
233    install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
234 fi
235 AC_SUBST(install_sh)])
236
237
238 # AM_MISSING_HAS_RUN
239 # ------------------
240 # Define MISSING if not defined so far and test if it supports --run.
241 # If it does, set am_missing_run to use it, otherwise, to nothing.
242 AC_DEFUN([AM_MISSING_HAS_RUN],
243 [test x"${MISSING+set}" = xset ||
244   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
245 # Use eval to expand $SHELL
246 if eval "$MISSING --run :"; then
247   am_missing_run="$MISSING --run "
248 else
249   am_missing_run=
250   am_backtick='`'
251   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
252 fi
253 ])
254
255 # AM_AUX_DIR_EXPAND
256
257 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
258 # $ac_aux_dir to ${srcdir}/foo.  In other projects, it is set to `.'.
259 # Of course, Automake must honor this variable whenever it call a tool
260 # from the auxiliary directory.  The problem is that $srcdir (hence
261 # $ac_aux_dir) can be either an absolute path or a path relative to
262 # $top_srcdir or absolute, this depends on how configure is run.  This
263 # is pretty anoying since it makes $ac_aux_dir quite unusable in
264 # subdirectories: on the top source directory, any form will work
265 # fine, but in subdirectories relative pat needs to be adapted.
266 # - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
267 #   relative, but fail if $srcdir is absolute
268 # - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
269 #   absolute, and success on relative paths.
270 #
271 # Consequently, we define and use $am_aux_dir, the "always absolute"
272 # version of $ac_aux_dir.
273
274 AC_DEFUN([AM_AUX_DIR_EXPAND], [
275 # expand $ac_aux_dir to an absolute path
276 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
277 ])
278
279 # One issue with vendor `install' (even GNU) is that you can't
280 # specify the program used to strip binaries.  This is especially
281 # annoying in cross=compiling environments, where the build's strip
282 # is unlikely to handle the host's binaries.
283 # Fortunately install-sh will honor a STRIPPROG variable, so if we ever
284 # need to use a non standard strip, we just have to make sure we use
285 # install-sh with the STRIPPROG variable set.
286 AC_DEFUN([AM_PROG_INSTALL_STRIP],
287 [AC_REQUIRE([AM_MISSING_INSTALL_SH])
288 dnl Don't test for $cross_compiling = yes, it might be `maybe'...
289 # We'd like to do this but we can't because it will unconditionally
290 # require config.guess.  One way would be if autoconf had the capability
291 # to let us compile in this code only when config.guess was already
292 # a possibility.
293 #if test "$cross_compiling" != no; then
294 #  # since we are cross-compiling, we need to check for a suitable `strip'
295 #  AM_PROG_STRIP
296 #  if test -z "$STRIP"; then
297 #    AC_MSG_WARN([strip missing, install-strip will not strip binaries])
298 #  fi
299 #fi
300
301 # If $STRIP is defined (either by the user, or by AM_PROG_STRIP),
302 # instruct install-strip to use install-sh and the given $STRIP program.
303 # Otherwise, just use ${INSTALL}: the idea is to use the vendor install
304 # as much as possible, because it's faster.
305 if test -z "$STRIP"; then
306   # The top level make will set INSTALL_PROGRAM=$(INSTALL_STRIP_PROGRAM)
307   # and the double dolard below is there to make sure that ${INSTALL}
308   # is substitued in the sub-makes, not at the top-level; this is
309   # needed if ${INSTALL} is a relative path (ajusted in each subdirectory
310   # by config.status).
311   INSTALL_STRIP_PROGRAM='$${INSTALL} -s'
312   INSTALL_STRIP_PROGRAM_ENV=''
313 else
314   _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
315   INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
316   INSTALL_STRIP_PROGRAM_ENV="STRIPPROG='\$(STRIP)'"
317 fi
318 AC_SUBST([STRIP])
319 AC_SUBST([INSTALL_STRIP_PROGRAM])
320 AC_SUBST([INSTALL_STRIP_PROGRAM_ENV])])
321
322 #AC_DEFUN([AM_PROG_STRIP],
323 #[# Check for `strip', unless the installer
324 # has set the STRIP environment variable.
325 # Note: don't explicitly check for -z "$STRIP" here because
326 # that will cause problems if AC_CANONICAL_* is AC_REQUIREd after
327 # this macro, and anyway it doesn't have an effect anyway.
328 #AC_CHECK_TOOL([STRIP],[strip])
329 #])
330
331 # serial 3
332
333 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
334 # written in clear, in which case automake, when reading aclocal.m4,
335 # will think it sees a *use*, and therefore will trigger all it's
336 # C support machinery.  Also note that it means that autoscan, seeing
337 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
338
339 # AM_DEPENDENCIES(NAME)
340 # ---------------------
341 # See how the compiler implements dependency checking.
342 # NAME is "CC", "CXX" or "OBJC".
343 # We try a few techniques and use that to set a single cache variable.
344 AC_DEFUN([AM_DEPENDENCIES],
345 [AC_REQUIRE([AM_SET_DEPDIR])dnl
346 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
347 ifelse([$1], CC,
348        [AC_REQUIRE([AC_PROG_][CC])dnl
349 AC_REQUIRE([AC_PROG_][CPP])
350 depcc="$CC"
351 depcpp="$CPP"],
352        [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
353 AC_REQUIRE([AC_PROG_][CXXCPP])
354 depcc="$CXX"
355 depcpp="$CXXCPP"],
356        [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
357        [AC_REQUIRE([AC_PROG_][$1])dnl
358 depcc="$$1"
359 depcpp=""])
360
361 AC_REQUIRE([AM_MAKE_INCLUDE])
362
363 AC_CACHE_CHECK([dependency style of $depcc],
364                [am_cv_$1_dependencies_compiler_type],
365 [if test -z "$AMDEP"; then
366   # We make a subdir and do the tests there.  Otherwise we can end up
367   # making bogus files that we don't know about and never remove.  For
368   # instance it was reported that on HP-UX the gcc test will end up
369   # making a dummy file named `D' -- because `-MD' means `put the output
370   # in D'.
371   mkdir confdir
372   # Copy depcomp to subdir because otherwise we won't find it if we're
373   # using a relative directory.
374   cp "$am_depcomp" confdir
375   cd confdir
376
377   am_cv_$1_dependencies_compiler_type=none
378   for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "./depcomp"`; do
379     # We need to recreate these files for each test, as the compiler may
380     # overwrite some of them when testing with obscure command lines.
381     # This happens at least with the AIX C compiler.
382     echo '#include "conftest.h"' > conftest.c
383     echo 'int i;' > conftest.h
384
385     case "$depmode" in
386     nosideeffect)
387       # after this tag, mechanisms are not by side-effect, so they'll
388       # only be used when explicitly requested
389       if test "x$enable_dependency_tracking" = xyes; then
390         continue
391       else
392         break
393       fi
394       ;;
395     none) break ;;
396     esac
397     # We check with `-c' and `-o' for the sake of the "dashmstdout"
398     # mode.  It turns out that the SunPro C++ compiler does not properly
399     # handle `-M -o', and we need to detect this.
400     if depmode="$depmode" \
401        source=conftest.c object=conftest.o \
402        depfile=conftest.Po tmpdepfile=conftest.TPo \
403        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
404        grep conftest.h conftest.Po > /dev/null 2>&1; then
405       am_cv_$1_dependencies_compiler_type="$depmode"
406       break
407     fi
408   done
409
410   cd ..
411   rm -rf confdir
412 else
413   am_cv_$1_dependencies_compiler_type=none
414 fi
415 ])
416 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
417 AC_SUBST([$1DEPMODE])
418 ])
419
420
421 # AM_SET_DEPDIR
422 # -------------
423 # Choose a directory name for dependency files.
424 # This macro is AC_REQUIREd in AM_DEPENDENCIES
425 AC_DEFUN([AM_SET_DEPDIR],
426 [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
427   DEPDIR=.deps
428   # We redirect because .deps might already exist and be populated.
429   # In this situation we don't want to see an error.
430   rmdir .deps > /dev/null 2>&1
431 else
432   DEPDIR=_deps
433 fi
434 AC_SUBST(DEPDIR)
435 ])
436
437
438 # AM_DEP_TRACK
439 # ------------
440 AC_DEFUN([AM_DEP_TRACK],
441 [AC_ARG_ENABLE(dependency-tracking,
442 [  --disable-dependency-tracking Speeds up one-time builds
443   --enable-dependency-tracking  Do not reject slow dependency extractors])
444 if test "x$enable_dependency_tracking" = xno; then
445   AMDEP="#"
446 else
447   am_depcomp="$ac_aux_dir/depcomp"
448   if test ! -f "$am_depcomp"; then
449     AMDEP="#"
450   else
451     AMDEP=
452   fi
453 fi
454 AC_SUBST(AMDEP)
455 if test -z "$AMDEP"; then
456   AMDEPBACKSLASH='\'
457 else
458   AMDEPBACKSLASH=
459 fi
460 pushdef([subst], defn([AC_SUBST]))
461 subst(AMDEPBACKSLASH)
462 popdef([subst])
463 ])
464
465 # Generate code to set up dependency tracking.
466 # This macro should only be invoked once -- use via AC_REQUIRE.
467 # Usage:
468 # AM_OUTPUT_DEPENDENCY_COMMANDS
469
470 #
471 # This code is only required when automatic dependency tracking
472 # is enabled.  FIXME.  This creates each `.P' file that we will
473 # need in order to bootstrap the dependency handling code.
474 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
475 AC_OUTPUT_COMMANDS([
476 test x"$AMDEP" != x"" ||
477 for mf in $CONFIG_FILES; do
478   case "$mf" in
479   Makefile) dirpart=.;;
480   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
481   *) continue;;
482   esac
483   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
484   # Extract the definition of DEP_FILES from the Makefile without
485   # running `make'.
486   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
487   test -z "$DEPDIR" && continue
488   # When using ansi2knr, U may be empty or an underscore; expand it
489   U=`sed -n -e '/^U = / s///p' < "$mf"`
490   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
491   # We invoke sed twice because it is the simplest approach to
492   # changing $(DEPDIR) to its actual value in the expansion.
493   for file in `sed -n -e '
494     /^DEP_FILES = .*\\\\$/ {
495       s/^DEP_FILES = //
496       :loop
497         s/\\\\$//
498         p
499         n
500         /\\\\$/ b loop
501       p
502     }
503     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
504        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
505     # Make sure the directory exists.
506     test -f "$dirpart/$file" && continue
507     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
508     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
509     # echo "creating $dirpart/$file"
510     echo '# dummy' > "$dirpart/$file"
511   done
512 done
513 ], [AMDEP="$AMDEP"
514 ac_aux_dir="$ac_aux_dir"])])
515
516 # AM_MAKE_INCLUDE()
517 # -----------------
518 # Check to see how make treats includes.
519 AC_DEFUN([AM_MAKE_INCLUDE],
520 [am_make=${MAKE-make}
521 # BSD make uses .include
522 cat > confinc << 'END'
523 doit:
524         @echo done
525 END
526 # If we don't find an include directive, just comment out the code.
527 AC_MSG_CHECKING([for style of include used by $am_make])
528 _am_include='#'
529 for am_inc in include .include; do
530    echo "$am_inc confinc" > confmf
531    if test "`$am_make -f confmf 2> /dev/null`" = "done"; then
532       _am_include=$am_inc
533       break
534    fi
535 done
536 AC_SUBST(_am_include)
537 AC_MSG_RESULT($_am_include)
538 rm -f confinc confmf
539 ])
540
541
542 # serial 1
543
544 AC_DEFUN([AM_C_PROTOTYPES],
545 [AC_REQUIRE([AM_PROG_CC_STDC])
546 AC_REQUIRE([AC_PROG_CPP])
547 AC_MSG_CHECKING([for function prototypes])
548 if test "$am_cv_prog_cc_stdc" != no; then
549   AC_MSG_RESULT(yes)
550   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
551   U= ANSI2KNR=
552 else
553   AC_MSG_RESULT(no)
554   U=_ ANSI2KNR=./ansi2knr
555 fi
556 # Ensure some checks needed by ansi2knr itself.
557 AC_HEADER_STDC
558 AC_CHECK_HEADERS(string.h)
559 AC_SUBST(U)dnl
560 AC_SUBST(ANSI2KNR)dnl
561 ])
562
563
564 # serial 1
565
566 # @defmac AC_PROG_CC_STDC
567 # @maindex PROG_CC_STDC
568 # @ovindex CC
569 # If the C compiler in not in ANSI C mode by default, try to add an option
570 # to output variable @code{CC} to make it so.  This macro tries various
571 # options that select ANSI C on some system or another.  It considers the
572 # compiler to be in ANSI C mode if it handles function prototypes correctly.
573 #
574 # If you use this macro, you should check after calling it whether the C
575 # compiler has been set to accept ANSI C; if not, the shell variable
576 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
577 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
578 # program @code{ansi2knr}, which comes with Ghostscript.
579 # @end defmac
580
581 AC_DEFUN([AM_PROG_CC_STDC],
582 [AC_REQUIRE([AC_PROG_CC])
583 AC_BEFORE([$0], [AC_C_INLINE])
584 AC_BEFORE([$0], [AC_C_CONST])
585 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
586 dnl a magic option to avoid problems with ANSI preprocessor commands
587 dnl like #elif.
588 dnl FIXME: can't do this because then AC_AIX won't work due to a
589 dnl circular dependency.
590 dnl AC_BEFORE([$0], [AC_PROG_CPP])
591 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
592 AC_CACHE_VAL(am_cv_prog_cc_stdc,
593 [am_cv_prog_cc_stdc=no
594 ac_save_CC="$CC"
595 # Don't try gcc -ansi; that turns off useful extensions and
596 # breaks some systems' header files.
597 # AIX                   -qlanglvl=ansi
598 # Ultrix and OSF/1      -std1
599 # HP-UX 10.20 and later -Ae
600 # HP-UX older versions  -Aa -D_HPUX_SOURCE
601 # SVR4                  -Xc -D__EXTENSIONS__
602 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
603 do
604   CC="$ac_save_CC $ac_arg"
605   AC_TRY_COMPILE(
606 [#include <stdarg.h>
607 #include <stdio.h>
608 #include <sys/types.h>
609 #include <sys/stat.h>
610 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
611 struct buf { int x; };
612 FILE * (*rcsopen) (struct buf *, struct stat *, int);
613 static char *e (p, i)
614      char **p;
615      int i;
616 {
617   return p[i];
618 }
619 static char *f (char * (*g) (char **, int), char **p, ...)
620 {
621   char *s;
622   va_list v;
623   va_start (v,p);
624   s = g (p, va_arg (v,int));
625   va_end (v);
626   return s;
627 }
628 int test (int i, double x);
629 struct s1 {int (*f) (int a);};
630 struct s2 {int (*f) (double a);};
631 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
632 int argc;
633 char **argv;
634 ], [
635 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
636 ],
637 [am_cv_prog_cc_stdc="$ac_arg"; break])
638 done
639 CC="$ac_save_CC"
640 ])
641 if test -z "$am_cv_prog_cc_stdc"; then
642   AC_MSG_RESULT([none needed])
643 else
644   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
645 fi
646 case "x$am_cv_prog_cc_stdc" in
647   x|xno) ;;
648   *) CC="$CC $am_cv_prog_cc_stdc" ;;
649 esac
650 ])
651