* automake.in (yacc_lex_finish_helper): Find ylwrap in
[automake.git] / aclocal.m4
blobbc8cc48eaf66e166cf2099e2413f43d5c7cf83ca
1 # aclocal.m4 generated automatically by aclocal 1.4f
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.
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.
14 # Do all the work for Automake.  This macro actually does too much --
15 # some checks are only needed if your package does certain things.
16 # But this isn't really a big deal.
18 # serial 5
20 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
21 # written in clear, in which case automake, when reading aclocal.m4,
22 # will think it sees a *use*, and therefore will trigger all it's
23 # C support machinery.  Also note that it means that autoscan, seeing
24 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
27 # We require 2.13 because we rely on SHELL being computed by configure.
28 AC_PREREQ([2.13])
30 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
31 # -----------------------------------------------------------
32 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
33 # The purpose of this macro is to provide the user with a means to
34 # check macros which are provided without letting her know how the
35 # information is coded.
36 # If this macro is not defined by Autoconf, define it here.
37 ifdef([AC_PROVIDE_IFELSE],
38       [],
39       [define([AC_PROVIDE_IFELSE],
40               [ifdef([AC_PROVIDE_$1],
41                      [$2], [$3])])])
44 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
45 # ----------------------------------------------
46 AC_DEFUN([AM_INIT_AUTOMAKE],
47 [AC_REQUIRE([AC_PROG_INSTALL])dnl
48 # test to see if srcdir already configured
49 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
50    test -f $srcdir/config.status; then
51   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
54 # Define the identity of the package.
55 PACKAGE=$1
56 AC_SUBST(PACKAGE)dnl
57 VERSION=$2
58 AC_SUBST(VERSION)dnl
59 ifelse([$3],,
60 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
61 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
63 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
64 # the ones we care about.
65 ifdef([m4_pattern_allow],
66       [m4_pattern_allow([^AM_(C|CPP|CXX|OBJC|F|R|GCJ)FLAGS])])dnl
68 # Some tools Automake needs.
69 AC_REQUIRE([AM_SANITY_CHECK])dnl
70 AC_REQUIRE([AC_ARG_PROGRAM])dnl
71 AM_MISSING_PROG(ACLOCAL, aclocal)
72 AM_MISSING_PROG(AUTOCONF, autoconf)
73 AM_MISSING_PROG(AUTOMAKE, automake)
74 AM_MISSING_PROG(AUTOHEADER, autoheader)
75 AM_MISSING_PROG(MAKEINFO, makeinfo)
76 AM_MISSING_PROG(AMTAR, tar)
77 AM_MISSING_INSTALL_SH
78 AM_PROG_INSTALL_STRIP
79 # We need awk for the "check" target.  The system "awk" is bad on
80 # some platforms.
81 AC_REQUIRE([AC_PROG_AWK])dnl
82 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
83 AC_REQUIRE([AM_DEP_TRACK])dnl
84 AC_REQUIRE([AM_SET_DEPDIR])dnl
85 AC_PROVIDE_IFELSE([AC_PROG_][CC],
86                   [AM_DEPENDENCIES(CC)],
87                   [define([AC_PROG_][CC],
88                           defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
89 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
90                   [AM_DEPENDENCIES(CXX)],
91                   [define([AC_PROG_][CXX],
92                           defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
96 # Check to make sure that the build environment is sane.
99 # serial 3
101 # AM_SANITY_CHECK
102 # ---------------
103 AC_DEFUN([AM_SANITY_CHECK],
104 [AC_MSG_CHECKING([whether build environment is sane])
105 # Just in case
106 sleep 1
107 echo timestamp > conftest.file
108 # Do `set' in a subshell so we don't clobber the current shell's
109 # arguments.  Must try -L first in case configure is actually a
110 # symlink; some systems play weird games with the mod time of symlinks
111 # (eg FreeBSD returns the mod time of the symlink's containing
112 # directory).
113 if (
114    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
115    if test "$[*]" = "X"; then
116       # -L didn't work.
117       set X `ls -t $srcdir/configure conftest.file`
118    fi
119    rm -f conftest.file
120    if test "$[*]" != "X $srcdir/configure conftest.file" \
121       && test "$[*]" != "X conftest.file $srcdir/configure"; then
123       # If neither matched, then we have a broken ls.  This can happen
124       # if, for instance, CONFIG_SHELL is bash and it inherits a
125       # broken ls alias from the environment.  This has actually
126       # happened.  Such a system could not be considered "sane".
127       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
128 alias in your environment])
129    fi
131    test "$[2]" = conftest.file
132    )
133 then
134    # Ok.
135    :
136 else
137    AC_MSG_ERROR([newly created file is older than distributed files!
138 Check your system clock])
140 AC_MSG_RESULT(yes)])
143 # serial 2
145 # AM_MISSING_PROG(NAME, PROGRAM)
146 # ------------------------------
147 AC_DEFUN([AM_MISSING_PROG],
148 [AC_REQUIRE([AM_MISSING_HAS_RUN])
149 $1=${$1-"${am_missing_run}$2"}
150 AC_SUBST($1)])
153 # AM_MISSING_INSTALL_SH
154 # ---------------------
155 # Like AM_MISSING_PROG, but only looks for install-sh.
156 AC_DEFUN([AM_MISSING_INSTALL_SH],
157 [AC_REQUIRE([AM_MISSING_HAS_RUN])
158 if test -z "$install_sh"; then
159    for install_sh in "$ac_aux_dir/install-sh" \
160                      "$ac_aux_dir/install.sh" \
161                      "${am_missing_run}${ac_auxdir}/install-sh";
162    do
163      test -f "$install_sh" && break
164    done
165    # FIXME: an evil hack: we remove the SHELL invocation from
166    # install_sh because automake adds it back in.  Sigh.
167    install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
169 AC_SUBST(install_sh)])
172 # AM_MISSING_HAS_RUN
173 # ------------------
174 # Define MISSING if not defined so far and test if it supports --run.
175 # If it does, set am_missing_run to use it, otherwise, to nothing.
176 AC_DEFUN([AM_MISSING_HAS_RUN],
177 [test x"${MISSING+set}" = xset ||
178   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
179 # Use eval to expand $SHELL
180 if eval "$MISSING --run true"; then
181   am_missing_run="$MISSING --run "
182 else
183   am_missing_run=
184   am_backtick='`'
185   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
189 # AM_AUX_DIR_EXPAND
191 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
192 # $ac_aux_dir to ${srcdir}/foo.  In other projects, it is set to `.'.
193 # Of course, Automake must honor this variable whenever it call a tool
194 # from the auxiliary directory.  The problem is that $srcdir (hence
195 # $ac_aux_dir) can be either an absolute path or a path relative to
196 # $top_srcdir or absolute, this depends on how configure is run.  This
197 # is pretty anoying since it makes $ac_aux_dir quite unusable in
198 # subdirectories: on the top source directory, any form will work
199 # fine, but in subdirectories relative pat needs to be adapted.
200 # - calling $top_srcidr/$ac_aux_dir/missing would success if $srcdir is
201 #   relative, but fail if $srcdir is absolute
202 # - conversly, calling $ax_aux_dir/missing would fail if $srcdir is
203 #   absolute, and success on relative paths.
205 # Consequently, we define and use $am_aux_dir, the "always absolute"
206 # version of $ac_aux_dir.
208 AC_DEFUN([AM_AUX_DIR_EXPAND], [
209 # expand $ac_aux_dir to an absolute path
210 am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
213 # One issue with vendor `install' (even GNU) is that you can't
214 # specify the program used to strip binaries.  This is especially
215 # annoying in cross-compiling environments, where the build's strip
216 # is unlikely to handle the host's binaries.
217 # Fortunately install-sh will honor a STRIPPROG variable, so we
218 # always use install-sh in `make install-strip', and initialize
219 # STRIPPROG with the value of the STRIP variable (set by the user).
220 AC_DEFUN([AM_PROG_INSTALL_STRIP],
221 [AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
222 _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
223 INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
224 AC_SUBST([INSTALL_STRIP_PROGRAM])])
226 # serial 3
228 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
229 # written in clear, in which case automake, when reading aclocal.m4,
230 # will think it sees a *use*, and therefore will trigger all it's
231 # C support machinery.  Also note that it means that autoscan, seeing
232 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
234 # AM_DEPENDENCIES(NAME)
235 # ---------------------
236 # See how the compiler implements dependency checking.
237 # NAME is "CC", "CXX" or "OBJC".
238 # We try a few techniques and use that to set a single cache variable.
239 AC_DEFUN([AM_DEPENDENCIES],
240 [AC_REQUIRE([AM_SET_DEPDIR])dnl
241 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
242 am_compiler_list=
243 ifelse([$1], CC,
244        [AC_REQUIRE([AC_PROG_][CC])dnl
245 AC_REQUIRE([AC_PROG_][CPP])
246 depcc="$CC"
247 depcpp="$CPP"],
248        [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
249 AC_REQUIRE([AC_PROG_][CXXCPP])
250 depcc="$CXX"
251 depcpp="$CXXCPP"],
252        [$1], OBJC, [am_compiler_list='gcc3 gcc'
253 depcc="$OBJC"
254 depcpp=""],
255        [$1], GCJ,  [am_compiler_list='gcc3 gcc'
256 depcc="$GCJ"
257 depcpp=""],
258        [AC_REQUIRE([AC_PROG_][$1])dnl
259 depcc="$$1"
260 depcpp=""])
262 AC_REQUIRE([AM_MAKE_INCLUDE])
263 AC_REQUIRE([AM_DEP_TRACK])
265 AC_CACHE_CHECK([dependency style of $depcc],
266                [am_cv_$1_dependencies_compiler_type],
267 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
268   # We make a subdir and do the tests there.  Otherwise we can end up
269   # making bogus files that we don't know about and never remove.  For
270   # instance it was reported that on HP-UX the gcc test will end up
271   # making a dummy file named `D' -- because `-MD' means `put the output
272   # in D'.
273   mkdir confdir
274   # Copy depcomp to subdir because otherwise we won't find it if we're
275   # using a relative directory.
276   cp "$am_depcomp" confdir
277   cd confdir
279   am_cv_$1_dependencies_compiler_type=none
280   if test "$am_compiler_list" = ""; then
281      am_compiler_list="`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`"
282   fi
283   for depmode in $am_compiler_list; do
284     # We need to recreate these files for each test, as the compiler may
285     # overwrite some of them when testing with obscure command lines.
286     # This happens at least with the AIX C compiler.
287     echo '#include "conftest.h"' > conftest.c
288     echo 'int i;' > conftest.h
290     case "$depmode" in
291     nosideeffect)
292       # after this tag, mechanisms are not by side-effect, so they'll
293       # only be used when explicitly requested
294       if test "x$enable_dependency_tracking" = xyes; then
295         continue
296       else
297         break
298       fi
299       ;;
300     none) break ;;
301     esac
302     # We check with `-c' and `-o' for the sake of the "dashmstdout"
303     # mode.  It turns out that the SunPro C++ compiler does not properly
304     # handle `-M -o', and we need to detect this.
305     if depmode="$depmode" \
306        source=conftest.c object=conftest.o \
307        depfile=conftest.Po tmpdepfile=conftest.TPo \
308        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
309        grep conftest.h conftest.Po > /dev/null 2>&1; then
310       am_cv_$1_dependencies_compiler_type="$depmode"
311       break
312     fi
313   done
315   cd ..
316   rm -rf confdir
317 else
318   am_cv_$1_dependencies_compiler_type=none
321 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
322 AC_SUBST([$1DEPMODE])
326 # AM_SET_DEPDIR
327 # -------------
328 # Choose a directory name for dependency files.
329 # This macro is AC_REQUIREd in AM_DEPENDENCIES
330 AC_DEFUN([AM_SET_DEPDIR],
331 [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
332   DEPDIR=.deps
333   # We redirect because .deps might already exist and be populated.
334   # In this situation we don't want to see an error.
335   rmdir .deps > /dev/null 2>&1
336 else
337   DEPDIR=_deps
339 AC_SUBST(DEPDIR)
343 # AM_DEP_TRACK
344 # ------------
345 AC_DEFUN([AM_DEP_TRACK],
346 [AC_ARG_ENABLE(dependency-tracking,
347 [  --disable-dependency-tracking Speeds up one-time builds
348   --enable-dependency-tracking  Do not reject slow dependency extractors])
349 if test "x$enable_dependency_tracking" != xno; then
350   am_depcomp="$ac_aux_dir/depcomp"
351   AMDEPBACKSLASH='\'
353 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
354 pushdef([subst], defn([AC_SUBST]))
355 subst(AMDEPBACKSLASH)
356 popdef([subst])
359 # Generate code to set up dependency tracking.
360 # This macro should only be invoked once -- use via AC_REQUIRE.
361 # Usage:
362 # AM_OUTPUT_DEPENDENCY_COMMANDS
365 # This code is only required when automatic dependency tracking
366 # is enabled.  FIXME.  This creates each `.P' file that we will
367 # need in order to bootstrap the dependency handling code.
368 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
369 AC_OUTPUT_COMMANDS([
370 test x"$AMDEP_TRUE" != x"" ||
371 for mf in $CONFIG_FILES; do
372   case "$mf" in
373   Makefile) dirpart=.;;
374   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
375   *) continue;;
376   esac
377   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
378   # Extract the definition of DEP_FILES from the Makefile without
379   # running `make'.
380   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
381   test -z "$DEPDIR" && continue
382   # When using ansi2knr, U may be empty or an underscore; expand it
383   U=`sed -n -e '/^U = / s///p' < "$mf"`
384   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
385   # We invoke sed twice because it is the simplest approach to
386   # changing $(DEPDIR) to its actual value in the expansion.
387   for file in `sed -n -e '
388     /^DEP_FILES = .*\\\\$/ {
389       s/^DEP_FILES = //
390       :loop
391         s/\\\\$//
392         p
393         n
394         /\\\\$/ b loop
395       p
396     }
397     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
398        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
399     # Make sure the directory exists.
400     test -f "$dirpart/$file" && continue
401     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
402     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
403     # echo "creating $dirpart/$file"
404     echo '# dummy' > "$dirpart/$file"
405   done
406 done
407 ], [AMDEP_TRUE="$AMDEP_TRUE"
408 ac_aux_dir="$ac_aux_dir"])])
410 # AM_MAKE_INCLUDE()
411 # -----------------
412 # Check to see how make treats includes.
413 AC_DEFUN([AM_MAKE_INCLUDE],
414 [am_make=${MAKE-make}
415 cat > confinc << 'END'
416 doit:
417         @echo done
419 # If we don't find an include directive, just comment out the code.
420 AC_MSG_CHECKING([for style of include used by $am_make])
421 _am_include='#'
422 _am_quote=
423 _am_result=none
424 # First try GNU make style include.
425 echo "include confinc" > confmf
426 # We grep out `Entering directory' and `Leaving directory'
427 # messages which can occur if `w' ends up in MAKEFLAGS.
428 # In particular we don't look at `^make:' because GNU make might
429 # be invoked under some other name (usually "gmake"), in which
430 # case it prints its new name instead of `make'.
431 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
432    _am_include=include
433    _am_quote=
434    _am_result=GNU
436 # Now try BSD make style include.
437 if test "$_am_include" = "#"; then
438    echo '.include "confinc"' > confmf
439    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
440       _am_include=.include
441       _am_quote='"'
442       _am_result=BSD
443    fi
445 AC_SUBST(_am_include)
446 AC_SUBST(_am_quote)
447 AC_MSG_RESULT($_am_result)
448 rm -f confinc confmf
451 # serial 3
453 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
454 # -------------------------------------
455 # Define a conditional.
457 # FIXME: Once using 2.50, use this:
458 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
459 AC_DEFUN([AM_CONDITIONAL],
460 [ifelse([$1], [TRUE],
461         [errprint(__file__:__line__: [$0: invalid condition: $1
462 ])dnl
463 m4exit(1)])dnl
464 ifelse([$1], [FALSE],
465        [errprint(__file__:__line__: [$0: invalid condition: $1
466 ])dnl
467 m4exit(1)])dnl
468 AC_SUBST([$1_TRUE])
469 AC_SUBST([$1_FALSE])
470 if $2; then
471   $1_TRUE=
472   $1_FALSE='#'
473 else
474   $1_TRUE='#'
475   $1_FALSE=
476 fi])