]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/ntp/aclocal.m4
This commit was generated by cvs2svn to compensate for changes in r124703,
[FreeBSD/FreeBSD.git] / contrib / ntp / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.5
2
3 # Copyright 1996, 1997, 1998, 1999, 2000, 2001
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$
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 [ifdef([AC_FOREACH],dnl
64          [dnl init our file count if it isn't already
65          m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
66          dnl prepare to store our destination file list for use in config.status
67          AC_FOREACH([_AM_File], [$1],
68                     [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
69                     m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
70                     dnl and add it to the list of files AC keeps track of, along
71                     dnl with our hook
72                     AC_CONFIG_HEADERS(_AM_File,
73 dnl COMMANDS, [, INIT-CMDS]
74 [# update the timestamp
75 echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
76 ][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
77                     m4_popdef([_AM_Dest])])],dnl
78 [AC_CONFIG_HEADER([$1])
79   AC_OUTPUT_COMMANDS(
80    ifelse(patsubst([$1], [[^ ]], []),
81           [],
82           [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
83            patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
84 [am_indx=1
85 for am_file in $1; do
86   case " \$CONFIG_HEADERS " in
87   *" \$am_file "*)
88     am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
89     if test -n "\$am_dir"; then
90       am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
91       for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
92         am_tmpdir=\$am_tmpdir\$am_subdir/
93         if test ! -d \$am_tmpdir; then
94           mkdir \$am_tmpdir
95         fi
96       done
97     fi
98     echo timestamp > "\$am_dir"stamp-h\$am_indx
99     ;;
100   esac
101   am_indx=\`expr \$am_indx + 1\`
102 done])
103 ])]) # AM_CONFIG_HEADER
104
105 # _AM_DIRNAME(PATH)
106 # -----------------
107 # Like AS_DIRNAME, only do it during macro expansion
108 AC_DEFUN([_AM_DIRNAME],
109        [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
110               m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
111                     m4_if(m4_regexp([$1], [^/.*]), -1,
112                           [.],
113                           m4_patsubst([$1], [^\(/\).*], [\1])),
114                     m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
115               m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
116 ]) # _AM_DIRNAME
117
118 # Do all the work for Automake.  This macro actually does too much --
119 # some checks are only needed if your package does certain things.
120 # But this isn't really a big deal.
121
122 # serial 5
123
124 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
125 # written in clear, in which case automake, when reading aclocal.m4,
126 # will think it sees a *use*, and therefore will trigger all it's
127 # C support machinery.  Also note that it means that autoscan, seeing
128 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
129
130
131 # We require 2.13 because we rely on SHELL being computed by configure.
132 AC_PREREQ([2.13])
133
134 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
135 # -----------------------------------------------------------
136 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
137 # The purpose of this macro is to provide the user with a means to
138 # check macros which are provided without letting her know how the
139 # information is coded.
140 # If this macro is not defined by Autoconf, define it here.
141 ifdef([AC_PROVIDE_IFELSE],
142       [],
143       [define([AC_PROVIDE_IFELSE],
144               [ifdef([AC_PROVIDE_$1],
145                      [$2], [$3])])])
146
147
148 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
149 # ----------------------------------------------
150 AC_DEFUN([AM_INIT_AUTOMAKE],
151 [AC_REQUIRE([AC_PROG_INSTALL])dnl
152 # test to see if srcdir already configured
153 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
154    test -f $srcdir/config.status; then
155   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
156 fi
157
158 # Define the identity of the package.
159 PACKAGE=$1
160 AC_SUBST(PACKAGE)dnl
161 VERSION=$2
162 AC_SUBST(VERSION)dnl
163 ifelse([$3],,
164 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
165 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
166
167 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
168 # the ones we care about.
169 ifdef([m4_pattern_allow],
170       [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
171
172 # Autoconf 2.50 always computes EXEEXT.  However we need to be
173 # compatible with 2.13, for now.  So we always define EXEEXT, but we
174 # don't compute it.
175 AC_SUBST(EXEEXT)
176 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
177 # requests that it be used.  This is a bit dumb.
178 : ${OBJEXT=o}
179 AC_SUBST(OBJEXT)
180
181 # Some tools Automake needs.
182 AC_REQUIRE([AM_SANITY_CHECK])dnl
183 AC_REQUIRE([AC_ARG_PROGRAM])dnl
184 AM_MISSING_PROG(ACLOCAL, aclocal)
185 AM_MISSING_PROG(AUTOCONF, autoconf)
186 AM_MISSING_PROG(AUTOMAKE, automake)
187 AM_MISSING_PROG(AUTOHEADER, autoheader)
188 AM_MISSING_PROG(MAKEINFO, makeinfo)
189 AM_MISSING_PROG(AMTAR, tar)
190 AM_PROG_INSTALL_SH
191 AM_PROG_INSTALL_STRIP
192 # We need awk for the "check" target.  The system "awk" is bad on
193 # some platforms.
194 AC_REQUIRE([AC_PROG_AWK])dnl
195 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
196 AC_REQUIRE([AM_DEP_TRACK])dnl
197 AC_REQUIRE([AM_SET_DEPDIR])dnl
198 AC_PROVIDE_IFELSE([AC_PROG_][CC],
199                   [_AM_DEPENDENCIES(CC)],
200                   [define([AC_PROG_][CC],
201                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
202 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
203                   [_AM_DEPENDENCIES(CXX)],
204                   [define([AC_PROG_][CXX],
205                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
206 ])
207
208 #
209 # Check to make sure that the build environment is sane.
210 #
211
212 # serial 3
213
214 # AM_SANITY_CHECK
215 # ---------------
216 AC_DEFUN([AM_SANITY_CHECK],
217 [AC_MSG_CHECKING([whether build environment is sane])
218 # Just in case
219 sleep 1
220 echo timestamp > conftest.file
221 # Do `set' in a subshell so we don't clobber the current shell's
222 # arguments.  Must try -L first in case configure is actually a
223 # symlink; some systems play weird games with the mod time of symlinks
224 # (eg FreeBSD returns the mod time of the symlink's containing
225 # directory).
226 if (
227    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
228    if test "$[*]" = "X"; then
229       # -L didn't work.
230       set X `ls -t $srcdir/configure conftest.file`
231    fi
232    rm -f conftest.file
233    if test "$[*]" != "X $srcdir/configure conftest.file" \
234       && test "$[*]" != "X conftest.file $srcdir/configure"; then
235
236       # If neither matched, then we have a broken ls.  This can happen
237       # if, for instance, CONFIG_SHELL is bash and it inherits a
238       # broken ls alias from the environment.  This has actually
239       # happened.  Such a system could not be considered "sane".
240       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
241 alias in your environment])
242    fi
243
244    test "$[2]" = conftest.file
245    )
246 then
247    # Ok.
248    :
249 else
250    AC_MSG_ERROR([newly created file is older than distributed files!
251 Check your system clock])
252 fi
253 AC_MSG_RESULT(yes)])
254
255
256 # serial 2
257
258 # AM_MISSING_PROG(NAME, PROGRAM)
259 # ------------------------------
260 AC_DEFUN([AM_MISSING_PROG],
261 [AC_REQUIRE([AM_MISSING_HAS_RUN])
262 $1=${$1-"${am_missing_run}$2"}
263 AC_SUBST($1)])
264
265
266 # AM_MISSING_HAS_RUN
267 # ------------------
268 # Define MISSING if not defined so far and test if it supports --run.
269 # If it does, set am_missing_run to use it, otherwise, to nothing.
270 AC_DEFUN([AM_MISSING_HAS_RUN],
271 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
272 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
273 # Use eval to expand $SHELL
274 if eval "$MISSING --run true"; then
275   am_missing_run="$MISSING --run "
276 else
277   am_missing_run=
278   am_backtick='`'
279   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
280 fi
281 ])
282
283 # AM_AUX_DIR_EXPAND
284
285 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
286 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
287 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
288 #
289 # Of course, Automake must honor this variable whenever it calls a
290 # tool from the auxiliary directory.  The problem is that $srcdir (and
291 # therefore $ac_aux_dir as well) can be either absolute or relative,
292 # depending on how configure is run.  This is pretty annoying, since
293 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
294 # source directory, any form will work fine, but in subdirectories a
295 # relative path needs to be adjusted first.
296 #
297 # $ac_aux_dir/missing
298 #    fails when called from a subdirectory if $ac_aux_dir is relative
299 # $top_srcdir/$ac_aux_dir/missing
300 #    fails if $ac_aux_dir is absolute,
301 #    fails when called from a subdirectory in a VPATH build with
302 #          a relative $ac_aux_dir
303 #
304 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
305 # are both prefixed by $srcdir.  In an in-source build this is usually
306 # harmless because $srcdir is `.', but things will broke when you
307 # start a VPATH build or use an absolute $srcdir.
308 #
309 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
310 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
311 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
312 # and then we would define $MISSING as
313 #   MISSING="\${SHELL} $am_aux_dir/missing"
314 # This will work as long as MISSING is not called from configure, because
315 # unfortunately $(top_srcdir) has no meaning in configure.
316 # However there are other variables, like CC, which are often used in
317 # configure, and could therefore not use this "fixed" $ac_aux_dir.
318 #
319 # Another solution, used here, is to always expand $ac_aux_dir to an
320 # absolute PATH.  The drawback is that using absolute paths prevent a
321 # configured tree to be moved without reconfiguration.
322
323 AC_DEFUN([AM_AUX_DIR_EXPAND], [
324 # expand $ac_aux_dir to an absolute path
325 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
326 ])
327
328 # AM_PROG_INSTALL_SH
329 # ------------------
330 # Define $install_sh.
331 AC_DEFUN([AM_PROG_INSTALL_SH],
332 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
333 install_sh=${install_sh-"$am_aux_dir/install-sh"}
334 AC_SUBST(install_sh)])
335
336 # One issue with vendor `install' (even GNU) is that you can't
337 # specify the program used to strip binaries.  This is especially
338 # annoying in cross-compiling environments, where the build's strip
339 # is unlikely to handle the host's binaries.
340 # Fortunately install-sh will honor a STRIPPROG variable, so we
341 # always use install-sh in `make install-strip', and initialize
342 # STRIPPROG with the value of the STRIP variable (set by the user).
343 AC_DEFUN([AM_PROG_INSTALL_STRIP],
344 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
345 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
346 AC_SUBST([INSTALL_STRIP_PROGRAM])])
347
348 # serial 4                                              -*- Autoconf -*-
349
350
351
352 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
353 # written in clear, in which case automake, when reading aclocal.m4,
354 # will think it sees a *use*, and therefore will trigger all it's
355 # C support machinery.  Also note that it means that autoscan, seeing
356 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
357
358
359
360 # _AM_DEPENDENCIES(NAME)
361 # ---------------------
362 # See how the compiler implements dependency checking.
363 # NAME is "CC", "CXX" or "OBJC".
364 # We try a few techniques and use that to set a single cache variable.
365 #
366 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
367 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
368 # dependency, and given that the user is not expected to run this macro,
369 # just rely on AC_PROG_CC.
370 AC_DEFUN([_AM_DEPENDENCIES],
371 [AC_REQUIRE([AM_SET_DEPDIR])dnl
372 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
373 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
374 AC_REQUIRE([AM_DEP_TRACK])dnl
375
376 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
377        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
378        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
379        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
380                    [depcc="$$1"   am_compiler_list=])
381
382 AC_CACHE_CHECK([dependency style of $depcc],
383                [am_cv_$1_dependencies_compiler_type],
384 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
385   # We make a subdir and do the tests there.  Otherwise we can end up
386   # making bogus files that we don't know about and never remove.  For
387   # instance it was reported that on HP-UX the gcc test will end up
388   # making a dummy file named `D' -- because `-MD' means `put the output
389   # in D'.
390   mkdir conftest.dir
391   # Copy depcomp to subdir because otherwise we won't find it if we're
392   # using a relative directory.
393   cp "$am_depcomp" conftest.dir
394   cd conftest.dir
395
396   am_cv_$1_dependencies_compiler_type=none
397   if test "$am_compiler_list" = ""; then
398      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
399   fi
400   for depmode in $am_compiler_list; do
401     # We need to recreate these files for each test, as the compiler may
402     # overwrite some of them when testing with obscure command lines.
403     # This happens at least with the AIX C compiler.
404     echo '#include "conftest.h"' > conftest.c
405     echo 'int i;' > conftest.h
406     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
407
408     case $depmode in
409     nosideeffect)
410       # after this tag, mechanisms are not by side-effect, so they'll
411       # only be used when explicitly requested
412       if test "x$enable_dependency_tracking" = xyes; then
413         continue
414       else
415         break
416       fi
417       ;;
418     none) break ;;
419     esac
420     # We check with `-c' and `-o' for the sake of the "dashmstdout"
421     # mode.  It turns out that the SunPro C++ compiler does not properly
422     # handle `-M -o', and we need to detect this.
423     if depmode=$depmode \
424        source=conftest.c object=conftest.o \
425        depfile=conftest.Po tmpdepfile=conftest.TPo \
426        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
427        grep conftest.h conftest.Po > /dev/null 2>&1 &&
428        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
429       am_cv_$1_dependencies_compiler_type=$depmode
430       break
431     fi
432   done
433
434   cd ..
435   rm -rf conftest.dir
436 else
437   am_cv_$1_dependencies_compiler_type=none
438 fi
439 ])
440 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
441 AC_SUBST([$1DEPMODE])
442 ])
443
444
445 # AM_SET_DEPDIR
446 # -------------
447 # Choose a directory name for dependency files.
448 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
449 AC_DEFUN([AM_SET_DEPDIR],
450 [rm -f .deps 2>/dev/null
451 mkdir .deps 2>/dev/null
452 if test -d .deps; then
453   DEPDIR=.deps
454 else
455   # MS-DOS does not allow filenames that begin with a dot.
456   DEPDIR=_deps
457 fi
458 rmdir .deps 2>/dev/null
459 AC_SUBST(DEPDIR)
460 ])
461
462
463 # AM_DEP_TRACK
464 # ------------
465 AC_DEFUN([AM_DEP_TRACK],
466 [AC_ARG_ENABLE(dependency-tracking,
467 [  --disable-dependency-tracking Speeds up one-time builds
468   --enable-dependency-tracking  Do not reject slow dependency extractors])
469 if test "x$enable_dependency_tracking" != xno; then
470   am_depcomp="$ac_aux_dir/depcomp"
471   AMDEPBACKSLASH='\'
472 fi
473 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
474 pushdef([subst], defn([AC_SUBST]))
475 subst(AMDEPBACKSLASH)
476 popdef([subst])
477 ])
478
479 # Generate code to set up dependency tracking.
480 # This macro should only be invoked once -- use via AC_REQUIRE.
481 # Usage:
482 # AM_OUTPUT_DEPENDENCY_COMMANDS
483
484 #
485 # This code is only required when automatic dependency tracking
486 # is enabled.  FIXME.  This creates each `.P' file that we will
487 # need in order to bootstrap the dependency handling code.
488 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
489 AC_OUTPUT_COMMANDS([
490 test x"$AMDEP_TRUE" != x"" ||
491 for mf in $CONFIG_FILES; do
492   case "$mf" in
493   Makefile) dirpart=.;;
494   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
495   *) continue;;
496   esac
497   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
498   # Extract the definition of DEP_FILES from the Makefile without
499   # running `make'.
500   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
501   test -z "$DEPDIR" && continue
502   # When using ansi2knr, U may be empty or an underscore; expand it
503   U=`sed -n -e '/^U = / s///p' < "$mf"`
504   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
505   # We invoke sed twice because it is the simplest approach to
506   # changing $(DEPDIR) to its actual value in the expansion.
507   for file in `sed -n -e '
508     /^DEP_FILES = .*\\\\$/ {
509       s/^DEP_FILES = //
510       :loop
511         s/\\\\$//
512         p
513         n
514         /\\\\$/ b loop
515       p
516     }
517     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
518        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
519     # Make sure the directory exists.
520     test -f "$dirpart/$file" && continue
521     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
522     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
523     # echo "creating $dirpart/$file"
524     echo '# dummy' > "$dirpart/$file"
525   done
526 done
527 ], [AMDEP_TRUE="$AMDEP_TRUE"
528 ac_aux_dir="$ac_aux_dir"])])
529
530 # AM_MAKE_INCLUDE()
531 # -----------------
532 # Check to see how make treats includes.
533 AC_DEFUN([AM_MAKE_INCLUDE],
534 [am_make=${MAKE-make}
535 cat > confinc << 'END'
536 doit:
537         @echo done
538 END
539 # If we don't find an include directive, just comment out the code.
540 AC_MSG_CHECKING([for style of include used by $am_make])
541 am__include='#'
542 am__quote=
543 _am_result=none
544 # First try GNU make style include.
545 echo "include confinc" > confmf
546 # We grep out `Entering directory' and `Leaving directory'
547 # messages which can occur if `w' ends up in MAKEFLAGS.
548 # In particular we don't look at `^make:' because GNU make might
549 # be invoked under some other name (usually "gmake"), in which
550 # case it prints its new name instead of `make'.
551 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
552    am__include=include
553    am__quote=
554    _am_result=GNU
555 fi
556 # Now try BSD make style include.
557 if test "$am__include" = "#"; then
558    echo '.include "confinc"' > confmf
559    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
560       am__include=.include
561       am__quote='"'
562       _am_result=BSD
563    fi
564 fi
565 AC_SUBST(am__include)
566 AC_SUBST(am__quote)
567 AC_MSG_RESULT($_am_result)
568 rm -f confinc confmf
569 ])
570
571 # serial 3
572
573 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
574 # -------------------------------------
575 # Define a conditional.
576 #
577 # FIXME: Once using 2.50, use this:
578 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
579 AC_DEFUN([AM_CONDITIONAL],
580 [ifelse([$1], [TRUE],
581         [errprint(__file__:__line__: [$0: invalid condition: $1
582 ])dnl
583 m4exit(1)])dnl
584 ifelse([$1], [FALSE],
585        [errprint(__file__:__line__: [$0: invalid condition: $1
586 ])dnl
587 m4exit(1)])dnl
588 AC_SUBST([$1_TRUE])
589 AC_SUBST([$1_FALSE])
590 if $2; then
591   $1_TRUE=
592   $1_FALSE='#'
593 else
594   $1_TRUE='#'
595   $1_FALSE=
596 fi])
597
598
599 # serial 1
600
601 AC_DEFUN([AM_C_PROTOTYPES],
602 [AC_REQUIRE([AM_PROG_CC_STDC])
603 AC_REQUIRE([AC_PROG_CPP])
604 AC_MSG_CHECKING([for function prototypes])
605 if test "$am_cv_prog_cc_stdc" != no; then
606   AC_MSG_RESULT(yes)
607   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
608   U= ANSI2KNR=
609 else
610   AC_MSG_RESULT(no)
611   U=_ ANSI2KNR=./ansi2knr
612 fi
613 # Ensure some checks needed by ansi2knr itself.
614 AC_HEADER_STDC
615 AC_CHECK_HEADERS(string.h)
616 AC_SUBST(U)dnl
617 AC_SUBST(ANSI2KNR)dnl
618 ])
619
620
621 # serial 1
622
623 # @defmac AC_PROG_CC_STDC
624 # @maindex PROG_CC_STDC
625 # @ovindex CC
626 # If the C compiler in not in ANSI C mode by default, try to add an option
627 # to output variable @code{CC} to make it so.  This macro tries various
628 # options that select ANSI C on some system or another.  It considers the
629 # compiler to be in ANSI C mode if it handles function prototypes correctly.
630 #
631 # If you use this macro, you should check after calling it whether the C
632 # compiler has been set to accept ANSI C; if not, the shell variable
633 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
634 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
635 # program @code{ansi2knr}, which comes with Ghostscript.
636 # @end defmac
637
638 AC_DEFUN([AM_PROG_CC_STDC],
639 [AC_REQUIRE([AC_PROG_CC])
640 AC_BEFORE([$0], [AC_C_INLINE])
641 AC_BEFORE([$0], [AC_C_CONST])
642 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
643 dnl a magic option to avoid problems with ANSI preprocessor commands
644 dnl like #elif.
645 dnl FIXME: can't do this because then AC_AIX won't work due to a
646 dnl circular dependency.
647 dnl AC_BEFORE([$0], [AC_PROG_CPP])
648 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
649 AC_CACHE_VAL(am_cv_prog_cc_stdc,
650 [am_cv_prog_cc_stdc=no
651 ac_save_CC="$CC"
652 # Don't try gcc -ansi; that turns off useful extensions and
653 # breaks some systems' header files.
654 # AIX                   -qlanglvl=ansi
655 # Ultrix and OSF/1      -std1
656 # HP-UX 10.20 and later -Ae
657 # HP-UX older versions  -Aa -D_HPUX_SOURCE
658 # SVR4                  -Xc -D__EXTENSIONS__
659 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
660 do
661   CC="$ac_save_CC $ac_arg"
662   AC_TRY_COMPILE(
663 [#include <stdarg.h>
664 #include <stdio.h>
665 #include <sys/types.h>
666 #include <sys/stat.h>
667 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
668 struct buf { int x; };
669 FILE * (*rcsopen) (struct buf *, struct stat *, int);
670 static char *e (p, i)
671      char **p;
672      int i;
673 {
674   return p[i];
675 }
676 static char *f (char * (*g) (char **, int), char **p, ...)
677 {
678   char *s;
679   va_list v;
680   va_start (v,p);
681   s = g (p, va_arg (v,int));
682   va_end (v);
683   return s;
684 }
685 int test (int i, double x);
686 struct s1 {int (*f) (int a);};
687 struct s2 {int (*f) (double a);};
688 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
689 int argc;
690 char **argv;
691 ], [
692 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
693 ],
694 [am_cv_prog_cc_stdc="$ac_arg"; break])
695 done
696 CC="$ac_save_CC"
697 ])
698 if test -z "$am_cv_prog_cc_stdc"; then
699   AC_MSG_RESULT([none needed])
700 else
701   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
702 fi
703 case "x$am_cv_prog_cc_stdc" in
704   x|xno) ;;
705   *) CC="$CC $am_cv_prog_cc_stdc" ;;
706 esac
707 ])
708