doc update from akim
[automake.git] / aclocal.m4
blob9949e1c9d999bea905d7ec4c22788bfeddfb2b93
1 dnl aclocal.m4 generated automatically by aclocal 1.2b
3 dnl Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
4 dnl This Makefile.in 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([AM_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
35 AM_SANITY_CHECK
36 AC_ARG_PROGRAM
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_PROG_MAKE_SET])
47 # serial 1
49 AC_DEFUN(AM_PROG_INSTALL,
50 [AC_REQUIRE([AC_PROG_INSTALL])
51 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
52 AC_SUBST(INSTALL_SCRIPT)dnl
56 # Check to make sure that the build environment is sane.
59 AC_DEFUN(AM_SANITY_CHECK,
60 [AC_MSG_CHECKING([whether build environment is sane])
61 # Just in case
62 sleep 1
63 echo timestamp > conftestfile
64 # Do `set' in a subshell so we don't clobber the current shell's
65 # arguments.  Must try -L first in case configure is actually a
66 # symlink; some systems play weird games with the mod time of symlinks
67 # (eg FreeBSD returns the mod time of the symlink's containing
68 # directory).
69 if (
70    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
71    if test "[$]@" = "X"; then
72       # -L didn't work.
73       set X `ls -t $srcdir/configure conftestfile`
74    fi
75    test "[$]2" = conftestfile
76    )
77 then
78    # Ok.
79    :
80 else
81    AC_MSG_ERROR([newly created file is older than distributed files!
82 Check your system clock])
84 rm -f conftest*
85 AC_MSG_RESULT(yes)])
87 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
88 dnl The program must properly implement --version.
89 AC_DEFUN(AM_MISSING_PROG,
90 [AC_MSG_CHECKING(for working $2)
91 # Run test in a subshell; some versions of sh will print an error if
92 # an executable is not found, even if stderr is redirected.
93 # Redirect stdin to placate older versions of autoconf.  Sigh.
94 if ($2 --version) < /dev/null > /dev/null 2>&1; then
95    $1=$2
96    AC_MSG_RESULT(found)
97 else
98    $1="$3/missing $2"
99    AC_MSG_RESULT(missing)
101 AC_SUBST($1)])