* subdir3.test: Allow any number of dependencies.
[automake.git] / m4 / init.m4
blob613e908b171dd2339ddc30dce76b405b482cb728
1 # Do all the work for Automake.  This macro actually does too much --
2 # some checks are only needed if your package does certain things.
3 # But this isn't really a big deal.
5 # serial 3
7 AC_PREREQ([2.13])
9 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
10 # -----------------------------------------------------------
11 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
12 # The purpose of this macro is to provide the user with a means to
13 # check macros which are provided without letting her know how the
14 # information is coded.
15 # If this macro is not defined by Autoconf, define it here.
16 ifdef([AC_PROVIDE_IFELSE],
17       [],
18       [define([AC_PROVIDE_IFELSE],
19               [ifdef([AC_PROVIDE_$1],
20                      [$2], [$3])])])
23 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
24 # ----------------------------------------------
25 AC_DEFUN([AM_INIT_AUTOMAKE],
26 [dnl We require 2.13 because we rely on SHELL being computed by configure.
27 AC_REQUIRE([AC_PROG_INSTALL])dnl
28 # test to see if srcdir already configured
29 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
30    test -f $srcdir/config.status; then
31   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
34 # Define the identity of the package.
35 PACKAGE=$1
36 AC_SUBST(PACKAGE)dnl
37 VERSION=$2
38 AC_SUBST(VERSION)dnl
39 ifelse([$3],,
40 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
41 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
43 # Some tools Automake needs.
44 AC_REQUIRE([AM_SANITY_CHECK])dnl
45 AC_REQUIRE([AC_ARG_PROGRAM])dnl
46 AM_MISSING_PROG(ACLOCAL, aclocal)
47 AM_MISSING_PROG(AUTOCONF, autoconf)
48 AM_MISSING_PROG(AUTOMAKE, automake)
49 AM_MISSING_PROG(AUTOHEADER, autoheader)
50 AM_MISSING_PROG(MAKEINFO, makeinfo)
51 AM_MISSING_PROG(AMTAR, tar)
52 AM_MISSING_INSTALL_SH
53 # We need awk for the "check" target.  The system "awk" is bad on
54 # some platforms.
55 AC_REQUIRE([AC_PROG_AWK])dnl
56 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
57 AC_REQUIRE([AM_DEP_TRACK])dnl
58 AC_REQUIRE([AM_SET_DEPDIR])dnl
59 AC_PROVIDE_IFELSE([AC_PROG_CC],
60                   [AM_DEPENDENCIES(CC)],
61                   [define([AC_PROG_CC],
62                           defn([AC_PROG_CC])[AM_DEPENDENCIES(CC)])])dnl
63 AC_PROVIDE_IFELSE([AC_PROG_CXX],
64                   [AM_DEPENDENCIES(CXX)],
65                   [define([AC_PROG_CXX],
66                           defn([AC_PROG_CXX])[AM_DEPENDENCIES(CXX)])])dnl