* configure.in: Upped to version 1.4k.
[platform/upstream/automake.git] / aclocal.m4
1 # aclocal.m4 generated automatically by aclocal 1.4k
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 # 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.
17
18 # serial 5
19
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...
25
26
27 # We require 2.13 because we rely on SHELL being computed by configure.
28 AC_PREREQ([2.13])
29
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])])])
42
43
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])
52 fi
53
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])])
62
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_[A-Z]+FLAGS])])dnl
67
68 # Autoconf 2.50 always computes EXEEXT.  However we need to be
69 # compatible with 2.13, for now.  So we always define EXEEXT, but we
70 # don't compute it.
71 AC_SUBST(EXEEXT)
72 # Similar for OBJEXT -- only we only use OBJEXT if the user actually
73 # requests that it be used.  This is a bit dumb.
74 : ${OBJEXT=o}
75 AC_SUBST(OBJEXT)
76
77 # Some tools Automake needs.
78 AC_REQUIRE([AM_SANITY_CHECK])dnl
79 AC_REQUIRE([AC_ARG_PROGRAM])dnl
80 AM_MISSING_PROG(ACLOCAL, aclocal)
81 AM_MISSING_PROG(AUTOCONF, autoconf)
82 AM_MISSING_PROG(AUTOMAKE, automake)
83 AM_MISSING_PROG(AUTOHEADER, autoheader)
84 AM_MISSING_PROG(MAKEINFO, makeinfo)
85 AM_MISSING_PROG(AMTAR, tar)
86 AM_MISSING_INSTALL_SH
87 AM_PROG_INSTALL_STRIP
88 # We need awk for the "check" target.  The system "awk" is bad on
89 # some platforms.
90 AC_REQUIRE([AC_PROG_AWK])dnl
91 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
92 AC_REQUIRE([AM_DEP_TRACK])dnl
93 AC_REQUIRE([AM_SET_DEPDIR])dnl
94 AC_PROVIDE_IFELSE([AC_PROG_][CC],
95                   [_AM_DEPENDENCIES(CC)],
96                   [define([AC_PROG_][CC],
97                           defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
98 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
99                   [_AM_DEPENDENCIES(CXX)],
100                   [define([AC_PROG_][CXX],
101                           defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
102 ])
103
104 #
105 # Check to make sure that the build environment is sane.
106 #
107
108 # serial 3
109
110 # AM_SANITY_CHECK
111 # ---------------
112 AC_DEFUN([AM_SANITY_CHECK],
113 [AC_MSG_CHECKING([whether build environment is sane])
114 # Just in case
115 sleep 1
116 echo timestamp > conftest.file
117 # Do `set' in a subshell so we don't clobber the current shell's
118 # arguments.  Must try -L first in case configure is actually a
119 # symlink; some systems play weird games with the mod time of symlinks
120 # (eg FreeBSD returns the mod time of the symlink's containing
121 # directory).
122 if (
123    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
124    if test "$[*]" = "X"; then
125       # -L didn't work.
126       set X `ls -t $srcdir/configure conftest.file`
127    fi
128    rm -f conftest.file
129    if test "$[*]" != "X $srcdir/configure conftest.file" \
130       && test "$[*]" != "X conftest.file $srcdir/configure"; then
131
132       # If neither matched, then we have a broken ls.  This can happen
133       # if, for instance, CONFIG_SHELL is bash and it inherits a
134       # broken ls alias from the environment.  This has actually
135       # happened.  Such a system could not be considered "sane".
136       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
137 alias in your environment])
138    fi
139
140    test "$[2]" = conftest.file
141    )
142 then
143    # Ok.
144    :
145 else
146    AC_MSG_ERROR([newly created file is older than distributed files!
147 Check your system clock])
148 fi
149 AC_MSG_RESULT(yes)])
150
151
152 # serial 2
153
154 # AM_MISSING_PROG(NAME, PROGRAM)
155 # ------------------------------
156 AC_DEFUN([AM_MISSING_PROG],
157 [AC_REQUIRE([AM_MISSING_HAS_RUN])
158 $1=${$1-"${am_missing_run}$2"}
159 AC_SUBST($1)])
160
161
162 # AM_MISSING_INSTALL_SH
163 # ---------------------
164 # Like AM_MISSING_PROG, but only looks for install-sh.
165 AC_DEFUN([AM_MISSING_INSTALL_SH],
166 [AC_REQUIRE([AM_MISSING_HAS_RUN])
167 if test -z "$install_sh"; then
168    for install_sh in "$ac_aux_dir/install-sh" \
169                      "$ac_aux_dir/install.sh" \
170                      "${am_missing_run}${ac_auxdir}/install-sh";
171    do
172      test -f "$install_sh" && break
173    done
174    # FIXME: an evil hack: we remove the SHELL invocation from
175    # install_sh because automake adds it back in.  Sigh.
176    install_sh=`echo $install_sh | sed -e 's/\${SHELL}//'`
177 fi
178 AC_SUBST(install_sh)])
179
180
181 # AM_MISSING_HAS_RUN
182 # ------------------
183 # Define MISSING if not defined so far and test if it supports --run.
184 # If it does, set am_missing_run to use it, otherwise, to nothing.
185 AC_DEFUN([AM_MISSING_HAS_RUN],
186 [test x"${MISSING+set}" = xset ||
187   MISSING="\${SHELL} `CDPATH=:; cd $ac_aux_dir && pwd`/missing"
188 # Use eval to expand $SHELL
189 if eval "$MISSING --run true"; then
190   am_missing_run="$MISSING --run "
191 else
192   am_missing_run=
193   am_backtick='`'
194   AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
195 fi
196 ])
197
198 # One issue with vendor `install' (even GNU) is that you can't
199 # specify the program used to strip binaries.  This is especially
200 # annoying in cross-compiling environments, where the build's strip
201 # is unlikely to handle the host's binaries.
202 # Fortunately install-sh will honor a STRIPPROG variable, so we
203 # always use install-sh in `make install-strip', and initialize
204 # STRIPPROG with the value of the STRIP variable (set by the user).
205 AC_DEFUN([AM_PROG_INSTALL_STRIP],
206 [AC_REQUIRE([AM_MISSING_INSTALL_SH])dnl
207 _am_dirpart="`echo $install_sh | sed -e 's,//*[[^/]]*$,,'`"
208 INSTALL_STRIP_PROGRAM="\${SHELL} \`CDPATH=: && cd $_am_dirpart && pwd\`/install-sh -c -s"
209 AC_SUBST([INSTALL_STRIP_PROGRAM])])
210
211 # serial 4                                              -*- Autoconf -*-
212
213
214
215 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
216 # written in clear, in which case automake, when reading aclocal.m4,
217 # will think it sees a *use*, and therefore will trigger all it's
218 # C support machinery.  Also note that it means that autoscan, seeing
219 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
220
221
222
223 # _AM_DEPENDENCIES(NAME)
224 # ---------------------
225 # See how the compiler implements dependency checking.
226 # NAME is "CC", "CXX" or "OBJC".
227 # We try a few techniques and use that to set a single cache variable.
228 #
229 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
230 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
231 # dependency, and given that the user is not expected to run this macro,
232 # just rely on AC_PROG_CC.
233 AC_DEFUN([_AM_DEPENDENCIES],
234 [AC_REQUIRE([AM_SET_DEPDIR])dnl
235 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
236 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
237 AC_REQUIRE([AM_DEP_TRACK])dnl
238
239 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
240        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
241        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
242        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
243                    [depcc="$$1"   am_compiler_list=])
244
245 AC_CACHE_CHECK([dependency style of $depcc],
246                [am_cv_$1_dependencies_compiler_type],
247 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
248   # We make a subdir and do the tests there.  Otherwise we can end up
249   # making bogus files that we don't know about and never remove.  For
250   # instance it was reported that on HP-UX the gcc test will end up
251   # making a dummy file named `D' -- because `-MD' means `put the output
252   # in D'.
253   mkdir conftest.dir
254   # Copy depcomp to subdir because otherwise we won't find it if we're
255   # using a relative directory.
256   cp "$am_depcomp" conftest.dir
257   cd conftest.dir
258
259   am_cv_$1_dependencies_compiler_type=none
260   if test "$am_compiler_list" = ""; then
261      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
262   fi
263   for depmode in $am_compiler_list; do
264     # We need to recreate these files for each test, as the compiler may
265     # overwrite some of them when testing with obscure command lines.
266     # This happens at least with the AIX C compiler.
267     echo '#include "conftest.h"' > conftest.c
268     echo 'int i;' > conftest.h
269     echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
270
271     case $depmode in
272     nosideeffect)
273       # after this tag, mechanisms are not by side-effect, so they'll
274       # only be used when explicitly requested
275       if test "x$enable_dependency_tracking" = xyes; then
276         continue
277       else
278         break
279       fi
280       ;;
281     none) break ;;
282     esac
283     # We check with `-c' and `-o' for the sake of the "dashmstdout"
284     # mode.  It turns out that the SunPro C++ compiler does not properly
285     # handle `-M -o', and we need to detect this.
286     if depmode=$depmode \
287        source=conftest.c object=conftest.o \
288        depfile=conftest.Po tmpdepfile=conftest.TPo \
289        $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
290        grep conftest.h conftest.Po > /dev/null 2>&1 &&
291        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
292       am_cv_$1_dependencies_compiler_type=$depmode
293       break
294     fi
295   done
296
297   cd ..
298   rm -rf conftest.dir
299 else
300   am_cv_$1_dependencies_compiler_type=none
301 fi
302 ])
303 $1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
304 AC_SUBST([$1DEPMODE])
305 ])
306
307
308 # AM_SET_DEPDIR
309 # -------------
310 # Choose a directory name for dependency files.
311 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
312 AC_DEFUN([AM_SET_DEPDIR],
313 [rm -f .deps 2>/dev/null
314 mkdir .deps 2>/dev/null
315 if test -d .deps; then
316   DEPDIR=.deps
317 else
318   # MS-DOS does not allow filenames that begin with a dot.
319   DEPDIR=_deps
320 fi
321 rmdir .deps 2>/dev/null
322 AC_SUBST(DEPDIR)
323 ])
324
325
326 # AM_DEP_TRACK
327 # ------------
328 AC_DEFUN([AM_DEP_TRACK],
329 [AC_ARG_ENABLE(dependency-tracking,
330 [  --disable-dependency-tracking Speeds up one-time builds
331   --enable-dependency-tracking  Do not reject slow dependency extractors])
332 if test "x$enable_dependency_tracking" != xno; then
333   am_depcomp="$ac_aux_dir/depcomp"
334   AMDEPBACKSLASH='\'
335 fi
336 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
337 pushdef([subst], defn([AC_SUBST]))
338 subst(AMDEPBACKSLASH)
339 popdef([subst])
340 ])
341
342 # Generate code to set up dependency tracking.
343 # This macro should only be invoked once -- use via AC_REQUIRE.
344 # Usage:
345 # AM_OUTPUT_DEPENDENCY_COMMANDS
346
347 #
348 # This code is only required when automatic dependency tracking
349 # is enabled.  FIXME.  This creates each `.P' file that we will
350 # need in order to bootstrap the dependency handling code.
351 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
352 AC_OUTPUT_COMMANDS([
353 test x"$AMDEP_TRUE" != x"" ||
354 for mf in $CONFIG_FILES; do
355   case "$mf" in
356   Makefile) dirpart=.;;
357   */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
358   *) continue;;
359   esac
360   grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
361   # Extract the definition of DEP_FILES from the Makefile without
362   # running `make'.
363   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
364   test -z "$DEPDIR" && continue
365   # When using ansi2knr, U may be empty or an underscore; expand it
366   U=`sed -n -e '/^U = / s///p' < "$mf"`
367   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
368   # We invoke sed twice because it is the simplest approach to
369   # changing $(DEPDIR) to its actual value in the expansion.
370   for file in `sed -n -e '
371     /^DEP_FILES = .*\\\\$/ {
372       s/^DEP_FILES = //
373       :loop
374         s/\\\\$//
375         p
376         n
377         /\\\\$/ b loop
378       p
379     }
380     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
381        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
382     # Make sure the directory exists.
383     test -f "$dirpart/$file" && continue
384     fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
385     $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
386     # echo "creating $dirpart/$file"
387     echo '# dummy' > "$dirpart/$file"
388   done
389 done
390 ], [AMDEP_TRUE="$AMDEP_TRUE"
391 ac_aux_dir="$ac_aux_dir"])])
392
393 # AM_MAKE_INCLUDE()
394 # -----------------
395 # Check to see how make treats includes.
396 AC_DEFUN([AM_MAKE_INCLUDE],
397 [am_make=${MAKE-make}
398 cat > confinc << 'END'
399 doit:
400         @echo done
401 END
402 # If we don't find an include directive, just comment out the code.
403 AC_MSG_CHECKING([for style of include used by $am_make])
404 am__include='#'
405 am__quote=
406 _am_result=none
407 # First try GNU make style include.
408 echo "include confinc" > confmf
409 # We grep out `Entering directory' and `Leaving directory'
410 # messages which can occur if `w' ends up in MAKEFLAGS.
411 # In particular we don't look at `^make:' because GNU make might
412 # be invoked under some other name (usually "gmake"), in which
413 # case it prints its new name instead of `make'.
414 if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
415    am__include=include
416    am__quote=
417    _am_result=GNU
418 fi
419 # Now try BSD make style include.
420 if test "$am__include" = "#"; then
421    echo '.include "confinc"' > confmf
422    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
423       am__include=.include
424       am__quote='"'
425       _am_result=BSD
426    fi
427 fi
428 AC_SUBST(am__include)
429 AC_SUBST(am__quote)
430 AC_MSG_RESULT($_am_result)
431 rm -f confinc confmf
432 ])
433
434 # serial 3
435
436 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
437 # -------------------------------------
438 # Define a conditional.
439 #
440 # FIXME: Once using 2.50, use this:
441 # m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
442 AC_DEFUN([AM_CONDITIONAL],
443 [ifelse([$1], [TRUE],
444         [errprint(__file__:__line__: [$0: invalid condition: $1
445 ])dnl
446 m4exit(1)])dnl
447 ifelse([$1], [FALSE],
448        [errprint(__file__:__line__: [$0: invalid condition: $1
449 ])dnl
450 m4exit(1)])dnl
451 AC_SUBST([$1_TRUE])
452 AC_SUBST([$1_FALSE])
453 if $2; then
454   $1_TRUE=
455   $1_FALSE='#'
456 else
457   $1_TRUE='#'
458   $1_FALSE=
459 fi])
460