* tests/Makefile.am (XFAIL_TESTS): Removed distcommon.test.
[automake.git] / aclocal.m4
blob94db5bf51df3eda11bb7b8f38fcf4be8d1d1d8d4
1 # aclocal.m4 generated automatically by aclocal 1.4c
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 # Some tools Automake needs.
64 AC_REQUIRE([AM_SANITY_CHECK])dnl
65 AC_REQUIRE([AC_ARG_PROGRAM])dnl
66 AM_MISSING_PROG(ACLOCAL, aclocal)
67 AM_MISSING_PROG(AUTOCONF, autoconf)
68 AM_MISSING_PROG(AUTOMAKE, automake)
69 AM_MISSING_PROG(AUTOHEADER, autoheader)
70 AM_MISSING_PROG(MAKEINFO, makeinfo)
71 AM_MISSING_PROG(AMTAR, tar)
72 AM_MISSING_INSTALL_SH
73 # We need awk for the "check" target.  The system "awk" is bad on
74 # some platforms.
75 AC_REQUIRE([AC_PROG_AWK])dnl
76 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
77 AC_REQUIRE([AM_DEP_TRACK])dnl
78 AC_REQUIRE([AM_SET_DEPDIR])dnl
79 AC_PROVIDE_IFELSE([AC_PROG_][CC],
80                   [AM_DEPENDENCIES(CC)],
81                   [define([AC_PROG_][CC],
82                           defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
83 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
84                   [AM_DEPENDENCIES(CXX)],
85                   [define([AC_PROG_][CXX],
86                           defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl
90 # Check to make sure that the build environment is sane.
93 # serial 3
95 # AM_SANITY_CHECK
96 # ---------------
97 AC_DEFUN([AM_SANITY_CHECK],
98 [AC_MSG_CHECKING([whether build environment is sane])
99 # Just in case
100 sleep 1
101 echo timestamp > conftest.file
102 # Do `set' in a subshell so we don't clobber the current shell's
103 # arguments.  Must try -L first in case configure is actually a
104 # symlink; some systems play weird games with the mod time of symlinks
105 # (eg FreeBSD returns the mod time of the symlink's containing
106 # directory).
107 if (
108    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
109    if test "$[*]" = "X"; then
110       # -L didn't work.
111       set X `ls -t $srcdir/configure conftest.file`
112    fi
113    if test "$[*]" != "X $srcdir/configure conftest.file" \
114       && test "$[*]" != "X conftest.file $srcdir/configure"; then
116       # If neither matched, then we have a broken ls.  This can happen
117       # if, for instance, CONFIG_SHELL is bash and it inherits a
118       # broken ls alias from the environment.  This has actually
119       # happened.  Such a system could not be considered "sane".
120       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
121 alias in your environment])
122    fi
124    test "$[2]" = conftest.file
125    )
126 then
127    # Ok.
128    :
129 else
130    AC_MSG_ERROR([newly created file is older than distributed files!
131 Check your system clock])
133 rm -f conftest*
134 AC_MSG_RESULT(yes)])
137 # serial 2
139 # AM_MISSING_PROG(NAME, PROGRAM)
140 # ------------------------------
141 AC_DEFUN([AM_MISSING_PROG],
142 [AC_REQUIRE([AM_MISSING_HAS_RUN])
143 $1=${$1-"${am_missing_run}$2"}
144 AC_SUBST($1)])
147 # AM_MISSING_INSTALL_SH
148 # ---------------------
149 # Like AM_MISSING_PROG, but only looks for install-sh.
150 AC_DEFUN([AM_MISSING_INSTALL_SH],
151 [AC_REQUIRE([AM_MISSING_HAS_RUN])
152 if test -z "$install_sh"; then
153    for install_sh in "$ac_aux_dir/install-sh" \
154                      "$ac_aux_dir/install.sh" \
155                      "${am_missing_run}${ac_auxdir}/install-sh";
156    do
157      test -f "$install_sh" && break
158    done
159    # FIXME: an evil hack: we remove the SHELL invocation from
160    # install_sh because automake adds it back in.  Sigh.
161    install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
163 AC_SUBST(install_sh)])
166 # AM_MISSING_HAS_RUN
167 # ------------------
168 # Define MISSING if not defined so far and test if it supports --run.
169 # If it does, set am_missing_run to use it, otherwise, to nothing.
170 AC_DEFUN([AM_MISSING_HAS_RUN],
171 [test x"${MISSING+set}" = xset ||
172   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
173 # Use eval to expand $SHELL
174 if eval "$MISSING --run :"; then
175   am_missing_run="$MISSING --run "
176 else
177   am_missing_run=
178   am_backtick='`'
179   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
183 # serial 3
185 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
186 # written in clear, in which case automake, when reading aclocal.m4,
187 # will think it sees a *use*, and therefore will trigger all it's
188 # C support machinery.  Also note that it means that autoscan, seeing
189 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
191 # AM_DEPENDENCIES(NAME)
192 # ---------------------
193 # See how the compiler implements dependency checking.
194 # NAME is "CC", "CXX" or "OBJC".
195 # We try a few techniques and use that to set a single cache variable.
196 AC_DEFUN([AM_DEPENDENCIES],
197 [AC_REQUIRE([AM_SET_DEPDIR])dnl
198 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
199 ifelse([$1], CC,
200        [AC_REQUIRE([AC_PROG_][CC])dnl
201 AC_REQUIRE([AC_PROG_][CPP])
202 depcc="$CC"
203 depcpp="$CPP"],
204        [$1], CXX, [AC_REQUIRE([AC_PROG_][CXX])dnl
205 AC_REQUIRE([AC_PROG_][CXXCPP])
206 depcc="$CXX"
207 depcpp="$CXXCPP"],
208        [$1], OBJC, [am_cv_OBJC_dependencies_compiler_type=gcc],
209        [AC_REQUIRE([AC_PROG_][$1])dnl
210 depcc="$$1"
211 depcpp=""])
213 AC_CACHE_CHECK([dependency style of $depcc],
214                [am_cv_$1_dependencies_compiler_type],
215 [if test -z "$AMDEP"; then
216   echo '#include "conftest.h"' > conftest.c
217   echo 'int i;' > conftest.h
219   am_cv_$1_dependencies_compiler_type=none
220   for depmode in `sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < "$am_depcomp"`; do
221     case "$depmode" in
222     nosideeffect)
223       # after this tag, mechanisms are not by side-effect, so they'll
224       # only be used when explicitly requested
225       if test "x$enable_dependency_tracking" = xyes; then
226         continue
227       else
228         break
229       fi
230       ;;
231     none) break ;;
232     esac
233     # We check with `-c' and `-o' for the sake of the "dashmstdout"
234     # mode.  It turns out that the SunPro C++ compiler does not properly
235     # handle `-M -o', and we need to detect this.
236     if depmode="$depmode" \
237        source=conftest.c object=conftest.o \
238        depfile=conftest.Po tmpdepfile=conftest.TPo \
239        $SHELL $am_depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
240        grep conftest.h conftest.Po > /dev/null 2>&1; then
241       am_cv_$1_dependencies_compiler_type="$depmode"
242       break
243     fi
244   done
246   rm -f conftest.*
247 else
248   am_cv_$1_dependencies_compiler_type=none
251 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
252 AC_SUBST([$1DEPMODE])
256 # AM_SET_DEPDIR
257 # -------------
258 # Choose a directory name for dependency files.
259 # This macro is AC_REQUIREd in AM_DEPENDENCIES
260 AC_DEFUN([AM_SET_DEPDIR],
261 [if test -d .deps || mkdir .deps 2> /dev/null || test -d .deps; then
262   DEPDIR=.deps
263   # We redirect because .deps might already exist and be populated.
264   # In this situation we don't want to see an error.
265   rmdir .deps > /dev/null 2>&1
266 else
267   DEPDIR=_deps
269 AC_SUBST(DEPDIR)
273 # AM_DEP_TRACK
274 # ------------
275 AC_DEFUN([AM_DEP_TRACK],
276 [AC_ARG_ENABLE(dependency-tracking,
277 [  --disable-dependency-tracking Speeds up one-time builds
278   --enable-dependency-tracking  Do not reject slow dependency extractors])
279 if test "x$enable_dependency_tracking" = xno; then
280   AMDEP="#"
281 else
282   am_depcomp="$ac_aux_dir/depcomp"
283   if test ! -f "$am_depcomp"; then
284     AMDEP="#"
285   else
286     AMDEP=
287   fi
289 AC_SUBST(AMDEP)
290 if test -z "$AMDEP"; then
291   AMDEPBACKSLASH='\'
292 else
293   AMDEPBACKSLASH=
295 pushdef([subst], defn([AC_SUBST]))
296 subst(AMDEPBACKSLASH)
297 popdef([subst])
300 # Generate code to set up dependency tracking.
301 # This macro should only be invoked once -- use via AC_REQUIRE.
302 # Usage:
303 # AM_OUTPUT_DEPENDENCY_COMMANDS
306 # This code is only required when automatic dependency tracking
307 # is enabled.  FIXME.  This creates each `.P' file that we will
308 # need in order to bootstrap the dependency handling code.
309 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
310 AC_OUTPUT_COMMANDS([
311 test x"$AMDEP" != x"" ||
312 for mf in $CONFIG_FILES; do
313   case "$mf" in
314   Makefile) dirpart=.;;
315   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
316   *) continue;;
317   esac
318   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
319   # Extract the definition of DEP_FILES from the Makefile without
320   # running `make'.
321   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
322   test -z "$DEPDIR" && continue
323   # When using ansi2knr, U may be empty or an underscore; expand it
324   U=`sed -n -e '/^U = / s///p' < "$mf"`
325   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
326   # We invoke sed twice because it is the simplest approach to
327   # changing $(DEPDIR) to its actual value in the expansion.
328   for file in `sed -n -e '
329     /^DEP_FILES = .*\\\\$/ {
330       s/^DEP_FILES = //
331       :loop
332         s/\\\\$//
333         p
334         n
335         /\\\\$/ b loop
336       p
337     }
338     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
339        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
340     # Make sure the directory exists.
341     test -f "$dirpart/$file" && continue
342     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
343     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
344     # echo "creating $dirpart/$file"
345     echo '# dummy' > "$dirpart/$file"
346   done
347 done
348 ], [AMDEP="$AMDEP"
349 ac_aux_dir="$ac_aux_dir"])])