AM_INIT_AUTOMAKE. Remove AM_AUTOMAKE_OPTIONS documentaion.
* m4/init.m4 (AM_INIT_AUTOMAKE): Get PACKAGE and VERSION from
AC_INIT if they are available there. Support a new call form
where the only argument is an optional space-separated list of
Automake options.
* m4/options.m4 (AM_AUTOMAKE_OPTIONS): Remove.
(_AM_MANGLE_OPTION, _AM_SET_OPTION, _AM_SET_OPTIONS,
_AM_IF_OPTION): New functions.
* automake.in (AC_INIT_PATTERN): New variable.
(global_options_line): Remove, use $seen_init_automake instead.
(scan_one_autoconf_file, scan_autoconf_traces): Set $package_version
from AC_INIT if available. Support the new style AM_INIT_AUTOMAKE.
Remove the AM_AUTOMAKE_OPTIONS handling.
* configure.in: Modernize.
* tests/defs (configure.in): Modernize. One third of the tests
still overwrite the default configure.in and use an old
AM_INIT_AUTOMAKE call, so that makes testing for both.
* tests/nodefine.test, tests/nodefine2.test: New files.
* tests/Makefile.am (TESTS): Add them.
+2002-01-09 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * automake.texi (Complete, Macros, Options): Document the new style
+ AM_INIT_AUTOMAKE. Remove AM_AUTOMAKE_OPTIONS documentaion.
+ * m4/init.m4 (AM_INIT_AUTOMAKE): Get PACKAGE and VERSION from
+ AC_INIT if they are available there. Support a new call form
+ where the only argument is an optional space-separated list of
+ Automake options.
+ * m4/options.m4 (AM_AUTOMAKE_OPTIONS): Remove.
+ (_AM_MANGLE_OPTION, _AM_SET_OPTION, _AM_SET_OPTIONS,
+ _AM_IF_OPTION): New functions.
+ * automake.in (AC_INIT_PATTERN): New variable.
+ (global_options_line): Remove, use $seen_init_automake instead.
+ (scan_one_autoconf_file, scan_autoconf_traces): Set $package_version
+ from AC_INIT if available. Support the new style AM_INIT_AUTOMAKE.
+ Remove the AM_AUTOMAKE_OPTIONS handling.
+ * configure.in: Modernize.
+ * tests/defs (configure.in): Modernize. One third of the tests
+ still overwrite the default configure.in and use an old
+ AM_INIT_AUTOMAKE call, so that makes testing for both.
+ * tests/nodefine.test, tests/nodefine2.test: New files.
+ * tests/Makefile.am (TESTS): Add them.
+
2002-01-08 Raja R Harinath <harinath@cs.umn.edu>
* automake.in (define_configure_variable): Propagate line numbers.
-New in 1.5b:
+New in 1.5c:
* Autoconf 2.52 is required.
* `dist' generates all the archive flavors, as did `dist-all'.
* `dist-gzip' generates the Gzip tar file only.
* Fixed handling of nobase_ targets.
* Fixed support of implicit rules leading to .lo objects.
* Fixed late inclusion of --add-missing files (e.g. depcomp) in DIST_COMMON
-* Added new AM_AUTOMAKE_OPTIONS macro
* Added uninstall-hook target
+* `AC_INIT AM_INIT_AUTOMAKE(package,version)' is an obsolete construct.
+ You can now use `AC_INIT(package,version) AM_INIT_AUTOMAKE' instead.
+ It is also possible to pass a list of global Automake options as
+ first argument to this new form of AM_INIT_AUTOMAKE.
\f
New in 1.5:
* Support for `configure.ac'.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# serial 7
+# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
-# ----------------------------------------------
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+ [m4_ifval([$3],, [_AM_SET_OPTION([no-define])])],
+ [_AM_SET_OPTIONS([$1])])dnl
+
# Define the identity of the package.
-AC_SUBST([PACKAGE], [$1])dnl
-AC_SUBST([VERSION], [$2])dnl
-ifelse([$3],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+AC_SUBST([PACKAGE],
+[m4_ifset([AC_PACKAGE_TARNAME], [AC_PACKAGE_TARNAME], [$1])])dnl
+AC_SUBST([VERSION],
+[m4_ifset([AC_PACKAGE_VERSION], [AC_PACKAGE_VERSION], [$2])])dnl
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.5c])])
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_if(_AM_MANGLE_OPTION([$1]), 1, [$2], [$3])])
+
#
# Check to make sure that the build environment is sane.
#
Usually this means the macro was only invoked conditionally.])
fi])])
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
-
-# AM_AUTOMAKE_OPTIONS([OPTIONS])
-# ------------------------------
-# Set some automake options globally.
-AC_DEFUN([AM_AUTOMAKE_OPTIONS],
-[dnl nothing
-])
-
# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*-
# This program is free software; you can redistribute it and/or modify
# makes indentation work better in Emacs.
my $AC_CONFIG_AUX_DIR_PATTERN = 'AC_CONFIG_AUX_DIR\(([^)]+)\)';
my $AM_INIT_AUTOMAKE_PATTERN = 'AM_INIT_AUTOMAKE\([^,]*,([^,)]+)[,)]';
+my $AC_INIT_PATTERN = 'AC_INIT\([^,]*,([^,)]+)[,)]';
my $AM_PACKAGE_VERSION_PATTERN = '^\s*\[?([^]\s]+)\]?\s*$';
# This handles substitution references like ${foo:.a=.b}.
# TRUE if we've seen AM_PROG_CC_C_O
my $seen_cc_c_o = 0;
-# TRUE if we've seen AM_INIT_AUTOMAKE.
+# Where AM_INIT_AUTOMAKE is called;
my $seen_init_automake = 0;
# TRUE if we've seen AM_AUTOMAKE_VERSION.
# should distribute depcomp -- has been generated.)
my $automake_needs_to_reprocess_all_files = 0;
-# Options set via AM_AUTOMAKE_OPTIONS.
+# Options set via AM_INIT_AUTOMAKE.
my $global_options = '';
-# Line number for AM_AUTOMAKE_OPTIONS.
-my $global_options_line;
\f
|| $_ eq 'dejagnu' || $_ eq 'no-texinfo.tex'
|| $_ eq 'readme-alpha' || $_ eq 'check-news'
|| $_ eq 'subdir-objects' || $_ eq 'nostdinc'
- || $_ eq 'no-exeext')
+ || $_ eq 'no-exeext' || $_ eq 'no-define')
{
# Explicitly recognize these.
}
{
if ($config)
{
- file_error ($global_options_line,
+ file_error ($seen_init_automake,
"option `" . $_ . "\' not recognized");
}
else
AC_CANONICAL_SYSTEM
AC_CONFIG_AUX_DIR
AC_CONFIG_FILES
+ AC_INIT
AC_LIBSOURCE
- AC_PROG_LIBTOOL AM_PROG_LIBTOOL
AC_PROG_LEX
+ AC_PROG_LIBTOOL AM_PROG_LIBTOOL
AC_SUBST
+ AM_AUTOMAKE_VERSION
AM_CONDITIONAL
AM_CONFIG_HEADER
AM_C_PROTOTYPES
AM_GNU_GETTEXT
AM_INIT_AUTOMAKE
- AM_AUTOMAKE_OPTIONS
- AM_AUTOMAKE_VERSION
AM_MAINTAINER_MODE
AM_PATH_LISPDIR
AM_PATH_PYTHON
$ac_config_files_location = $here;
&scan_autoconf_config_files ($args[1]);
}
+ elsif ($macro eq 'AC_INIT')
+ {
+ if (defined $args[2])
+ {
+ $package_version = $args[2];
+ $package_version_location = $here;
+ }
+ }
elsif ($macro eq 'AC_LIBSOURCE')
{
$libsources{$args[1]} = $here;
$configure_vars{$args[1]} = $here
if $args[1] =~ /^\w+$/;
}
+ elsif ($macro eq 'AM_AUTOMAKE_VERSION')
+ {
+ file_error ($here,
+ "version mismatch. This is Automake $VERSION,\n" .
+ "but the definition used by this AM_INIT_AUTOMAKE\n" .
+ "comes from Automake $args[1]. You should recreate\n" .
+ "aclocal.m4 with aclocal and run automake again.\n")
+ if ($VERSION ne $args[1]);
+
+ $seen_automake_version = 1;
+ }
elsif ($macro eq 'AM_CONDITIONAL')
{
$configure_cond{$args[1]} = $here;
}
elsif ($macro eq 'AM_INIT_AUTOMAKE')
{
- $package_version = $args[2];
- $package_version_location = $here;
- $seen_init_automake = 1;
- }
- elsif ($macro eq 'AM_AUTOMAKE_OPTIONS')
- {
- $global_options = $args[1];
- $global_options_line = $here;
+ $seen_init_automake = $here;
+ if (defined $args[2])
+ {
+ $package_version = $args[2];
+ $package_version_location = $here;
+ }
+ elsif (defined $args[1])
+ {
+ $global_options = $args[1];
+ }
}
- elsif ($macro eq 'AM_AUTOMAKE_VERSION')
- {
- file_error ($here,
- "version mismatch. This is Automake $VERSION,\n" .
- "but the definition used by this AM_INIT_AUTOMAKE\n" .
- "comes from Automake $args[1]. You should recreate\n" .
- "aclocal.m4 with aclocal and run automake again.\n")
- if ($VERSION ne $args[1]);
-
- $seen_automake_version = 1;
- }
elsif ($macro eq 'AM_MAINTAINER_MODE')
{
$seen_maint_mode = $here;
}
}
- # This macro handles several different things.
- if (/$AM_INIT_AUTOMAKE_PATTERN/o)
+ # AM_INIT_AUTOMAKE with any number of argument
+ if (/AM_INIT_AUTOMAKE/)
{
- ($package_version = $1) =~ s/$AM_PACKAGE_VERSION_PATTERN/$1/o;
- $package_version_location = $here;
$seen_init_automake = $here;
+ }
+
+ # AC_INIT or AM_INIT_AUTOMAKE with two arguments
+ if (/$AC_INIT_PATTERN/o || /$AM_INIT_AUTOMAKE_PATTERN/o)
+ {
+ if ($1 =~ /$AM_PACKAGE_VERSION_PATTERN/o)
+ {
+ $package_version = $1;
+ $package_version_location = $here;
+ }
}
- if (/AM_AUTOMAKE_OPTIONS\(([^)]+)\)/)
+ # AM_INIT_AUTOMAKE with one argument.
+ if (/AM_INIT_AUTOMAKE\(([^),]+)\)/)
{
$global_options = &unquote_m4_arg ($1);
- $global_options_line = $here;
}
if (/AM_AUTOMAKE_VERSION\(([^)]+)\)/)
{
if (-f 'aclocal.m4')
{
- file_error ($package_version_location || $me,
+ file_error ($seen_init_automake || $me,
"your implementation of AM_INIT_AUTOMAKE comes from " .
"an\nold Automake version. You should recreate " .
"aclocal.m4\nwith aclocal and run automake again.\n");
}
else
{
- file_error ($package_version_location || $me,
+ file_error ($seen_init_automake || $me,
"no proper implementation of AM_INIT_AUTOMAKE was " .
"found,\nprobably because aclocal.m4 is missing...\n" .
"You should run aclocal to create this file, then\n" .
@code{AM_INIT_AUTOMAKE} call just after @code{AC_INIT}:
@example
-AM_INIT_AUTOMAKE(zardoz, 1.0)
+AC_INIT(zardoz, 1.0)
+AM_INIT_AUTOMAKE
+...
@end example
Since your program doesn't have any complicating factors (e.g., it
@cindex Hello, configure.in
Here is the @file{configure.in} from GNU Hello:
+@c FIXME: This definitively requires an update.
@example
dnl Process this file with autoconf to produce a configure script.
@c consider generating this node automatically from m4 files.
@table @code
-@item AM_AUTOMAKE_OPTIONS
-This takes a single argument which is a list of options which should be
-applied to every @file{Makefile.am} in the tree. The effect is as if
-each option were listed in @code{AUTOMAKE_OPTIONS}.
-
@item AM_CONFIG_HEADER
Automake will generate rules to automatically regenerate the config
header.
found in @file{<termios.h>}.
@cvindex AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
-@item AM_INIT_AUTOMAKE
+@item AM_INIT_AUTOMAKE([OPTIONS])
+@itemx AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
Runs many macros that most @file{configure.in}'s need. This macro has
-two required arguments, the package and the version number. By default
-this macro @code{AC_DEFINE}'s @samp{PACKAGE} and @samp{VERSION}. This
-can be avoided by passing in a non-empty third argument.
+two forms, the second of which has two required arguments: the package
+and the version number. This latter form is obsolete because the
+@var{package} and @var{version} are now arguments of the @samp{AC_INIT}
+Autoconf macro, and Automake can get this information from there.
+
+If your @file{configure.in} has:
+@example
+AC_INIT(src/foo.c)
+AM_INIT_AUTOMAKE(mumble, 1.5)
+@end example
+you can modernize it as follow:
+@example
+AC_INIT(mumble, 1.5)
+AC_CONFIG_SRCDIR(src/foo.c)
+AM_INIT_AUTOMAKE
+@end example
+
+If this macro is called with a single argument, it is interpreted as a
+space-separated list of Automake options which should be applied to
+every @file{Makefile.am} in the tree. The effect is as if each option
+were listed in @code{AUTOMAKE_OPTIONS}.
+
+By default this macro @code{AC_DEFINE}'s @samp{PACKAGE} and
+@samp{VERSION}. This can be avoided by passing the @samp{no-define}
+option, as in:
+@example
+AM_INIT_AUTOMAKE([gnits 1.5 no-define dist-bzip2])
+@end example
+or by passing a third non-empty argument to the obsolete form.
+
+@cvindex PACKAGE, prevent definition
+@cvindex VERSION, prevent definition
@item AM_MAKE_INCLUDE
This macro is used to discover how the user's @code{make} handles
@chapter Changing Automake's Behavior
Various features of Automake can be controlled by options in the
-@file{Makefile.am}. Such options are listed in a special variable named
-@code{AUTOMAKE_OPTIONS}. Currently understood options are:
+@file{Makefile.am}. Such options are applied on a per-@file{Makefile}
+basis when listed in a special @file{Makefile} variable named
+@code{AUTOMAKE_OPTIONS}. They are applied globally to all processed
+@file{Makefiles} when listed in the first argument of
+@code{AM_INIT_AUTOMAKE} in @file{configure.in}. Currently understood
+options are:
@vindex AUTOMAKE_OPTIONS
@table @asis
formats.
@trindex dist-tarZ
+@item @code{no-define}
+@cindex Option, no-define
+This options is meaningful only when passed as an argument to
+AM_INIT_AUTOMAKE. It will prevent the @code{PACKAGE} and @code{VERSION}
+variable to be @code{AC_DEFINE}d.
+
@item @code{no-dependencies}
@cindex Option, no-dependencies
This is similar to using @samp{--include-deps} on the command line, but
{ (exit 1); exit 1; }; }
fi
+
# Define the identity of the package.
PACKAGE=automake
VERSION=1.5c
+
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
#define VERSION "$VERSION"
_ACEOF
-
-
# Some tools Automake needs.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
# some platforms.
-
# $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
# hence `.' is really what we want for perllibdir and libdir.
ACLOCAL="perllibdir=./lib `pwd`/aclocal --acdir=m4"
AC_CONFIG_SRCDIR(automake.in)
AC_CONFIG_AUX_DIR(lib)
-AM_INIT_AUTOMAKE(automake, 1.5c)
-AM_AUTOMAKE_OPTIONS([1.5 dist-bzip2])
+AM_INIT_AUTOMAKE([1.5 dist-bzip2])
# $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
# hence `.' is really what we want for perllibdir and libdir.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# serial 7
+# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
-# ----------------------------------------------
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+ [m4_ifval([$3],, [_AM_SET_OPTION([no-define])])],
+ [_AM_SET_OPTIONS([$1])])dnl
+
# Define the identity of the package.
-AC_SUBST([PACKAGE], [$1])dnl
-AC_SUBST([VERSION], [$2])dnl
-ifelse([$3],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+AC_SUBST([PACKAGE],
+[m4_ifset([AC_PACKAGE_TARNAME], [AC_PACKAGE_TARNAME], [$1])])dnl
+AC_SUBST([VERSION],
+[m4_ifset([AC_PACKAGE_VERSION], [AC_PACKAGE_VERSION], [$2])])dnl
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
-# Do all the work for Automake. -*- Autoconf -*-
+# Helper functions for option handling. -*- Autoconf -*-
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
-# serial 1
+# serial 2
-# AM_AUTOMAKE_OPTIONS([OPTIONS])
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
# ------------------------------
-# Set some automake options globally.
-AC_DEFUN([AM_AUTOMAKE_OPTIONS],
-[dnl nothing
-])
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_if(_AM_MANGLE_OPTION([$1]), 1, [$2], [$3])])
-@set UPDATED 7 January 2002
+@set UPDATED 9 January 2002
@set UPDATED-MONTH January 2002
@set EDITION 1.5c
@set VERSION 1.5c
nobase.test \
nodep.test \
nodepcomp.test \
+nodefine.test \
+nodefine2.test \
nodist.test \
nodist2.test \
noinst.test \
nobase.test \
nodep.test \
nodepcomp.test \
+nodefine.test \
+nodefine2.test \
nodist.test \
nodist2.test \
noinst.test \
# still produces a valid configure.ac. But then, tests running
# config.status really need to append AC_OUTPUT.
cat > configure.in << END
-AC_INIT
-AM_INIT_AUTOMAKE($me, 1.0)
+AC_INIT($me, 1.0)
+AM_INIT_AUTOMAKE
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CONFIG_FILES(Makefile)
--- /dev/null
+#! /bin/sh
+# Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+# -------------------------------------------------------------------
+# Do not upgrade this file to use the modern AC_INIT/AM_INIT_AUTOMAKE
+# forms. The day these obsolete AC_INIT and AM_INIT_AUTOMAKE forms
+# are dropped, just erase the file.
+# nodefine2.test contains the modern version of this test.
+# -------------------------------------------------------------------
+
+# First, check that PACKAGE and VERSION are output by default.
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AC_OUTPUT(output)
+END
+
+echo 'DEFS = @DEFS@' > output.in
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output
+
+# Then, check that PACKAGE and VERSION are not output if requested.
+
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN], [no])
+AC_OUTPUT(output)
+END
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output || exit 1
+:
--- /dev/null
+#! /bin/sh
+# Make sure that PACKAGE and VERSION are AC_DEFINEd when requested.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+# First, check that PACKAGE and VERSION are output by default.
+
+cat > configure.in << 'END'
+AC_INIT([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AM_INIT_AUTOMAKE
+AC_OUTPUT(output)
+END
+
+echo 'DEFS = @DEFS@' > output.in
+
+$ACLOCAL
+$AUTOCONF
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output
+
+# Then, check that PACKAGE and VERSION are not output if requested.
+
+cat > configure.in << 'END'
+AC_INIT([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN])
+AM_INIT_AUTOMAKE([no-define])
+AC_OUTPUT(output Makefile)
+END
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE # Dummy call to make sure Automake grok `no-define' silently.
+./configure
+
+grep 'DEFS.*-DVERSION=\\"UnIqUe' output || exit 1
+:
-@set UPDATED 7 January 2002
+@set UPDATED 9 January 2002
@set UPDATED-MONTH January 2002
@set EDITION 1.5c
@set VERSION 1.5c