Install msysDTK-1.0.1
[msysgit.git] / share / aclocal-1.7 / init.m4
blob3b74c1cb109f12fec422a570301439b2be17035f
1 # Do all the work for Automake.                            -*- Autoconf -*-
3 # This macro actually does too much some checks are only needed if
4 # your package does certain things.  But this isn't really a big deal.
6 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
7 # Free Software Foundation, Inc.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # 02111-1307, USA.
24 # serial 8
26 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
27 # written in clear, in which case automake, when reading aclocal.m4,
28 # will think it sees a *use*, and therefore will trigger all it's
29 # C support machinery.  Also note that it means that autoscan, seeing
30 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
33 AC_PREREQ([2.54])
35 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
36 # the ones we care about.
37 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
39 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
40 # AM_INIT_AUTOMAKE([OPTIONS])
41 # -----------------------------------------------
42 # The call with PACKAGE and VERSION arguments is the old style
43 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
44 # and VERSION should now be passed to AC_INIT and removed from
45 # the call to AM_INIT_AUTOMAKE.
46 # We support both call styles for the transition.  After
47 # the next Automake release, Autoconf can make the AC_INIT
48 # arguments mandatory, and then we can depend on a new Autoconf
49 # release and drop the old call support.
50 AC_DEFUN([AM_INIT_AUTOMAKE],
51 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
52  AC_REQUIRE([AC_PROG_INSTALL])dnl
53 # test to see if srcdir already configured
54 if test "`cd $srcdir && pwd`" != "`pwd`" &&
55    test -f $srcdir/config.status; then
56   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
59 # test whether we have cygpath
60 if test -z "$CYGPATH_W"; then
61   if (cygpath --version) >/dev/null 2>/dev/null; then
62     CYGPATH_W='cygpath -w'
63   else
64     CYGPATH_W=echo
65   fi
67 AC_SUBST([CYGPATH_W])
69 # Define the identity of the package.
70 dnl Distinguish between old-style and new-style calls.
71 m4_ifval([$2],
72 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
73  AC_SUBST([PACKAGE], [$1])dnl
74  AC_SUBST([VERSION], [$2])],
75 [_AM_SET_OPTIONS([$1])dnl
76  AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
77  AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
79 _AM_IF_OPTION([no-define],,
80 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
81  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
83 # Some tools Automake needs.
84 AC_REQUIRE([AM_SANITY_CHECK])dnl
85 AC_REQUIRE([AC_ARG_PROGRAM])dnl
86 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
87 AM_MISSING_PROG(AUTOCONF, autoconf)
88 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
89 AM_MISSING_PROG(AUTOHEADER, autoheader)
90 AM_MISSING_PROG(MAKEINFO, makeinfo)
91 AM_MISSING_PROG(AMTAR, tar)
92 AM_PROG_INSTALL_SH
93 AM_PROG_INSTALL_STRIP
94 # We need awk for the "check" target.  The system "awk" is bad on
95 # some platforms.
96 AC_REQUIRE([AC_PROG_AWK])dnl
97 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
99 _AM_IF_OPTION([no-dependencies],,
100 [AC_PROVIDE_IFELSE([AC_PROG_CC],
101                   [_AM_DEPENDENCIES(CC)],
102                   [define([AC_PROG_CC],
103                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
104 AC_PROVIDE_IFELSE([AC_PROG_CXX],
105                   [_AM_DEPENDENCIES(CXX)],
106                   [define([AC_PROG_CXX],
107                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
112 # When config.status generates a header, we must update the stamp-h file.
113 # This file resides in the same directory as the config header
114 # that is generated.  The stamp files are numbered to have different names.
116 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
117 # loop where config.status creates the headers, so we can generate
118 # our stamp files there.
119 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
120 [_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
121 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])