source: trunk/essentials/sys-devel/automake-1.9/m4/init.m4

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 4.0 KB
Line 
1# Do all the work for Automake. -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4# Free Software Foundation, Inc.
5#
6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10# serial 12
11
12# This macro actually does too much. Some checks are only needed if
13# your package does certain things. But this isn't really a big deal.
14
15# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
16# AM_INIT_AUTOMAKE([OPTIONS])
17# -----------------------------------------------
18# The call with PACKAGE and VERSION arguments is the old style
19# call (pre autoconf-2.50), which is being phased out. PACKAGE
20# and VERSION should now be passed to AC_INIT and removed from
21# the call to AM_INIT_AUTOMAKE.
22# We support both call styles for the transition. After
23# the next Automake release, Autoconf can make the AC_INIT
24# arguments mandatory, and then we can depend on a new Autoconf
25# release and drop the old call support.
26AC_DEFUN([AM_INIT_AUTOMAKE],
27[AC_PREREQ([2.58])dnl
28dnl Autoconf wants to disallow AM_ names. We explicitly allow
29dnl the ones we care about.
30m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
31AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
32AC_REQUIRE([AC_PROG_INSTALL])dnl
33# test to see if srcdir already configured
34if test "`cd $srcdir && pwd`" != "`pwd`" &&
35 test -f $srcdir/config.status; then
36 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
37fi
38
39# test whether we have cygpath
40if test -z "$CYGPATH_W"; then
41 if (cygpath --version) >/dev/null 2>/dev/null; then
42 CYGPATH_W='cygpath -w'
43 else
44 CYGPATH_W=echo
45 fi
46fi
47AC_SUBST([CYGPATH_W])
48
49# Define the identity of the package.
50dnl Distinguish between old-style and new-style calls.
51m4_ifval([$2],
52[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
53 AC_SUBST([PACKAGE], [$1])dnl
54 AC_SUBST([VERSION], [$2])],
55[_AM_SET_OPTIONS([$1])dnl
56 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
57 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
58
59_AM_IF_OPTION([no-define],,
60[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
61 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
62
63# Some tools Automake needs.
64AC_REQUIRE([AM_SANITY_CHECK])dnl
65AC_REQUIRE([AC_ARG_PROGRAM])dnl
66AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
67AM_MISSING_PROG(AUTOCONF, autoconf)
68AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
69AM_MISSING_PROG(AUTOHEADER, autoheader)
70AM_MISSING_PROG(MAKEINFO, makeinfo)
71AM_PROG_INSTALL_SH
72AM_PROG_INSTALL_STRIP
73AC_REQUIRE([AM_PROG_MKDIR_P])dnl
74# We need awk for the "check" target. The system "awk" is bad on
75# some platforms.
76AC_REQUIRE([AC_PROG_AWK])dnl
77AC_REQUIRE([AC_PROG_MAKE_SET])dnl
78AC_REQUIRE([AM_SET_LEADING_DOT])dnl
79_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
80 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
81 [_AM_PROG_TAR([v7])])])
82_AM_IF_OPTION([no-dependencies],,
83[AC_PROVIDE_IFELSE([AC_PROG_CC],
84 [_AM_DEPENDENCIES(CC)],
85 [define([AC_PROG_CC],
86 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
87AC_PROVIDE_IFELSE([AC_PROG_CXX],
88 [_AM_DEPENDENCIES(CXX)],
89 [define([AC_PROG_CXX],
90 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
91])
92])
93
94
95# When config.status generates a header, we must update the stamp-h file.
96# This file resides in the same directory as the config header
97# that is generated. The stamp files are numbered to have different names.
98
99# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
100# loop where config.status creates the headers, so we can generate
101# our stamp files there.
102AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
103[# Compute $1's index in $config_headers.
104_am_stamp_count=1
105for _am_header in $config_headers :; do
106 case $_am_header in
107 $1 | $1:* )
108 break ;;
109 * )
110 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
111 esac
112done
113echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
Note: See TracBrowser for help on using the repository browser.