source: trunk/grep/m4/init.m4@ 3003

Last change on this file since 3003 was 2557, checked in by bird, 19 years ago

grep 2.5.1a

File size: 3.2 KB
Line 
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.
4
5# serial 5
6
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...
12
13
14# We require 2.13 because we rely on SHELL being computed by configure.
15AC_PREREQ([2.13])
16
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.
24ifdef([AC_PROVIDE_IFELSE],
25 [],
26 [define([AC_PROVIDE_IFELSE],
27 [ifdef([AC_PROVIDE_$1],
28 [$2], [$3])])])
29
30
31# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
32# ----------------------------------------------
33AC_DEFUN([AM_INIT_AUTOMAKE],
34[AC_REQUIRE([AC_PROG_INSTALL])dnl
35# test to see if srcdir already configured
36if 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])
39fi
40
41# Define the identity of the package.
42PACKAGE=$1
43AC_SUBST(PACKAGE)dnl
44VERSION=$2
45AC_SUBST(VERSION)dnl
46ifelse([$3],,
47[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
48AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
49
50# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
51# the ones we care about.
52ifdef([m4_pattern_allow],
53 [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
54
55# Autoconf 2.50 always computes EXEEXT. However we need to be
56# compatible with 2.13, for now. So we always define EXEEXT, but we
57# don't compute it.
58AC_SUBST(EXEEXT)
59# Similar for OBJEXT -- only we only use OBJEXT if the user actually
60# requests that it be used. This is a bit dumb.
61: ${OBJEXT=o}
62AC_SUBST(OBJEXT)
63
64# Some tools Automake needs.
65AC_REQUIRE([AM_SANITY_CHECK])dnl
66AC_REQUIRE([AC_ARG_PROGRAM])dnl
67AM_MISSING_PROG(ACLOCAL, aclocal)
68AM_MISSING_PROG(AUTOCONF, autoconf)
69AM_MISSING_PROG(AUTOMAKE, automake)
70AM_MISSING_PROG(AUTOHEADER, autoheader)
71AM_MISSING_PROG(MAKEINFO, makeinfo)
72AM_MISSING_PROG(AMTAR, tar)
73AM_PROG_INSTALL_SH
74AM_PROG_INSTALL_STRIP
75# We need awk for the "check" target. The system "awk" is bad on
76# some platforms.
77AC_REQUIRE([AC_PROG_AWK])dnl
78AC_REQUIRE([AC_PROG_MAKE_SET])dnl
79AC_REQUIRE([AM_DEP_TRACK])dnl
80AC_REQUIRE([AM_SET_DEPDIR])dnl
81AC_PROVIDE_IFELSE([AC_PROG_][CC],
82 [_AM_DEPENDENCIES(CC)],
83 [define([AC_PROG_][CC],
84 defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
85AC_PROVIDE_IFELSE([AC_PROG_][CXX],
86 [_AM_DEPENDENCIES(CXX)],
87 [define([AC_PROG_][CXX],
88 defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
89])
Note: See TracBrowser for help on using the repository browser.