Fix for nolink.test:
[automake.git] / m4 / init.m4
blob5881a3489ed68b9aa2a1ce80d5575e0b63888eda
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 5
7 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8 # written in clear, in which case automake, when reading aclocal.m4,
9 # will think it sees a *use*, and therefore will trigger all it's
10 # C support machinery.  Also note that it means that autoscan, seeing
11 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
14 # We require 2.13 because we rely on SHELL being computed by configure.
15 AC_PREREQ([2.13])
17 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
18 # -----------------------------------------------------------
19 # If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
20 # The purpose of this macro is to provide the user with a means to
21 # check macros which are provided without letting her know how the
22 # information is coded.
23 # If this macro is not defined by Autoconf, define it here.
24 ifdef([AC_PROVIDE_IFELSE],
25       [],
26       [define([AC_PROVIDE_IFELSE],
27               [ifdef([AC_PROVIDE_$1],
28                      [$2], [$3])])])
31 # AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
32 # ----------------------------------------------
33 AC_DEFUN([AM_INIT_AUTOMAKE],
34 [AC_REQUIRE([AC_PROG_INSTALL])dnl
35 # test to see if srcdir already configured
36 if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
37    test -f $srcdir/config.status; then
38   AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
41 # Define the identity of the package.
42 PACKAGE=$1
43 AC_SUBST(PACKAGE)dnl
44 VERSION=$2
45 AC_SUBST(VERSION)dnl
46 ifelse([$3],,
47 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
50 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
51 # the ones we care about.
52 ifdef([m4_pattern_allow],
53       [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
55 # Some tools Automake needs.
56 AC_REQUIRE([AM_SANITY_CHECK])dnl
57 AC_REQUIRE([AC_ARG_PROGRAM])dnl
58 AM_MISSING_PROG(ACLOCAL, aclocal)
59 AM_MISSING_PROG(AUTOCONF, autoconf)
60 AM_MISSING_PROG(AUTOMAKE, automake)
61 AM_MISSING_PROG(AUTOHEADER, autoheader)
62 AM_MISSING_PROG(MAKEINFO, makeinfo)
63 AM_MISSING_PROG(AMTAR, tar)
64 AM_MISSING_INSTALL_SH
65 AM_PROG_INSTALL_STRIP
66 # We need awk for the "check" target.  The system "awk" is bad on
67 # some platforms.
68 AC_REQUIRE([AC_PROG_AWK])dnl
69 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
70 AC_REQUIRE([AM_DEP_TRACK])dnl
71 AC_REQUIRE([AM_SET_DEPDIR])dnl
72 AC_PROVIDE_IFELSE([AC_PROG_][CC],
73                   [AM_DEPENDENCIES(CC)],
74                   [define([AC_PROG_][CC],
75                           defn([AC_PROG_][CC])[AM_DEPENDENCIES(CC)])])dnl
76 AC_PROVIDE_IFELSE([AC_PROG_][CXX],
77                   [AM_DEPENDENCIES(CXX)],
78                   [define([AC_PROG_][CXX],
79                           defn([AC_PROG_][CXX])[AM_DEPENDENCIES(CXX)])])dnl