* automake.in (handle_configure): Replace multiple occurrences of
[automake.git] / aclocal.m4
blob1b97697212f097fb01dc4245ac93e744c1ef4bb8
1 dnl aclocal.m4 generated automatically by aclocal 1.4a
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
17 # serial 1
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 dnl We require 2.13 because we rely on SHELL being computed by configure.
25 AC_PREREQ([2.13])
26 PACKAGE=[$1]
27 AC_SUBST(PACKAGE)
28 VERSION=[$2]
29 AC_SUBST(VERSION)
30 dnl test to see if srcdir already configured
31 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
32   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
34 ifelse([$3],,
35 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
36 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
37 AC_REQUIRE([AM_SANITY_CHECK])
38 AC_REQUIRE([AC_ARG_PROGRAM])
39 dnl FIXME This is truly gross.
40 missing_dir=`cd $ac_aux_dir && pwd`
41 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
42 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
43 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
44 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
45 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
46 dnl We check for tar when the user configures the end package.
47 dnl This is sad, since we only need this for "dist".  However,
48 dnl there's no other good way to do it.  We prefer GNU tar if
49 dnl we can find it.  If we can't find a tar, it doesn't really matter.
50 AC_CHECK_PROGS(TAR, gnutar gtar tar)
51 AMTARFLAGS=
52 if test -n "$TAR"; then
53   if $SHELL -c "$TAR --version" > /dev/null 2>&1; then
54     dnl We have GNU tar.
55     AMTARFLAGS=o
56   fi
58 AC_SUBST(AMTARFLAGS)
59 AC_REQUIRE([AC_PROG_MAKE_SET])])
62 # Check to make sure that the build environment is sane.
65 AC_DEFUN(AM_SANITY_CHECK,
66 [AC_MSG_CHECKING([whether build environment is sane])
67 # Just in case
68 sleep 1
69 echo timestamp > conftestfile
70 # Do `set' in a subshell so we don't clobber the current shell's
71 # arguments.  Must try -L first in case configure is actually a
72 # symlink; some systems play weird games with the mod time of symlinks
73 # (eg FreeBSD returns the mod time of the symlink's containing
74 # directory).
75 if (
76    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
77    if test "[$]*" = "X"; then
78       # -L didn't work.
79       set X `ls -t $srcdir/configure conftestfile`
80    fi
81    if test "[$]*" != "X $srcdir/configure conftestfile" \
82       && test "[$]*" != "X conftestfile $srcdir/configure"; then
84       # If neither matched, then we have a broken ls.  This can happen
85       # if, for instance, CONFIG_SHELL is bash and it inherits a
86       # broken ls alias from the environment.  This has actually
87       # happened.  Such a system could not be considered "sane".
88       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
89 alias in your environment])
90    fi
92    test "[$]2" = conftestfile
93    )
94 then
95    # Ok.
96    :
97 else
98    AC_MSG_ERROR([newly created file is older than distributed files!
99 Check your system clock])
101 rm -f conftest*
102 AC_MSG_RESULT(yes)])
104 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
105 dnl The program must properly implement --version.
106 AC_DEFUN(AM_MISSING_PROG,
107 [AC_MSG_CHECKING(for working $2)
108 # Run test in a subshell; some versions of sh will print an error if
109 # an executable is not found, even if stderr is redirected.
110 # Redirect stdin to placate older versions of autoconf.  Sigh.
111 if ($2 --version) < /dev/null > /dev/null 2>&1; then
112    $1=$2
113    AC_MSG_RESULT(found)
114 else
115    $1="$3/missing $2"
116    AC_MSG_RESULT(missing)
118 AC_SUBST($1)])