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.
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.
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],
26 [define([AC_PROVIDE_IFELSE],
27 [ifdef([AC_PROVIDE_$1],
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.
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)
66 # We need awk for the "check" target. The system "awk" is bad on
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