* Major changes in Autoconf 2.52e -*- outline -*-
** Requirements
- Perl 5.005 is required.
+ Perl 5.005 is required: autom4te is written in Perl and is needed by
+ autoconf. autoheader, autoreconf, ifnames, and autoscan are
+ rewritten in Perl.
** Documentation
- AC_INIT
- --force, -f
Supported by autom4te, autoconf and autoheader.
- --include, -I
- Replaces --autoconf-dir and --localdir in autoconf, autoheader and
- autoupdate.
+ Replaces --autoconf-dir and --localdir in autoconf, autoheader,
+ autoupdate, and autoreconf.
- autoreconf
No longer passes --cygnus, --foreign, --gnits, --gnu, --include-deps:
automake options are to be given via AUTOMAKE_OPTIONS.
- autoreconf
Runs gettextize and libtoolize when appropriate.
+- autoreconf
+ --m4dir is no longer supported.
** Bug fixes
- The top level $prefix is propagated to the AC_CONFIG_SUBDIRS configures.
Library directories:
-I, --include=DIR look for FILES in DIR (cumulative)
- -M, --m4dir=M4DIR this package's Autoconf extensions
-
-Unless specified, heuristics try to compute `M4DIR' from the `Makefile.am',
-or defaults to `m4' if it exists.
The environment variables AUTOCONF, AUTOHEADER, AUTOMAKE, ACLOCAL,
GETTEXTIZE, LIBTOOLIZE are honored.
# --install -- as --add-missing in other tools.
my $install = 0;
my @include;
-# m4dir -- local Autoconf extensions. Typically `m4'.
-my $m4dir;
my $status = 0;
# symlink -- when --install, use symlinks instead.
my $symlink = 0;
my $srcdir;
getopt ('I|include|A|autoconf-dir|m|macrodir|l|localdir=s' => \@include,
- 'M|m4dir=s' => \$m4dir,
'i|install' => \$install,
's|symlink' => \$symlink);
# Dispatch autoreconf's option to the tools.
# --include;
- $autoconf .= join (' ', map { "--include=$_" } @include);
- $autoheader .= join (' ', map { "--include=$_" } @include);
+ $autoconf .= join (' --include=', '', @include);
+ $autoheader .= join (' --include=', '', @include);
# --install and --symlink;
if ($install)
}
-# &autoreconf ()
-# --------------
-# Reconf the current directory.
-sub autoreconf ()
+# &maybe_autoreconf ()
+# --------------------
+# If the current file ($_) is configure.ac, then there is work to perform
+# there. Otherwise return. The main point is preserving $_.
+sub maybe_autoreconf ()
{
# If there it's not `configure.ac' or `configure.in', we are not
# interested in the directory.
return
if !/^configure\.(ac|in)$/;
- my $configure_ac = $_;
- verbose "working on $File::Find::dir/$configure_ac";
+ # Save $_ as Find::File requires it to be preserved.
+ my $underscore = $_;
+ autoreconf ($_);
+ $_ = $underscore;
+}
+
+
+# &autoreconf ($CONFIGURE_AC)
+# ---------------------------
+# Reconf the current directory.
+sub autoreconf ($)
+{
+ my ($configure_ac) = @_;
+ verbose "working on $File::Find::name";
+
+ # ------------------------------- #
+ # See what tools will be needed. #
+ # ------------------------------- #
- # If there is no AC_INIT, then we are not interested: it looks like
- # a Cygnus thingy.
+ # Perform a single trace reading to avoid --force forcing a rerun
+ # between two --trace, that's useless. If there is no AC_INIT, then
+ # we are not interested: it looks like a Cygnus thingy.
my $configure_ac_file = new Autom4te::XFile $configure_ac;
my $uses_autoconf;
+ my $uses_gettext;
+ my $uses_libtool;
+ my $uses_autoheader;
while ($_ = $configure_ac_file->getline)
{
$uses_autoconf = 1
if /AC_INIT/;
}
+
+ my $traces = new Autom4te::XFile
+ ("$autoconf"
+ . join (' --trace=', '',
+ 'AC_INIT', 'AM_GNU_GETTEXT', 'AM_PROG_LIBTOOL',
+ 'AC_CONFIG_HEADERS')
+ . " |");
+ while ($_ = $traces->getline)
+ {
+ $uses_autoconf = 1 if /AC_INIT/;
+ $uses_gettext = 1 if /AM_GNU_GETTEXT/;
+ $uses_libtool = 1 if /AM_PROG_LIBTOOL/;
+ $uses_autoheader = 1 if /AC_CONFIG_HEADERS/;
+ }
+
+ # ------------------ #
+ # Running autoconf. #
+ # ------------------ #
+
if (!$uses_autoconf)
{
verbose "$configure_ac: not using Autoconf";
return;
}
-
# -------------------- #
# Running gettexitze. #
# -------------------- #
- my $uses_gettext = 0;
- my $traces = new Autom4te::XFile "$autoconf --trace=AM_GNU_GETTEXT |";
- while ($_ = $traces->getline)
- {
- $uses_gettext = 1
- if /AM_GNU_GETTEXT/;
- }
if (!$uses_gettext)
{
verbose "$configure_ac: not using Gettext";
}
- elsif (-d 'intl')
+ elsif (-d 'intl' && !$force)
{
verbose "$configure_ac: not running gettextize: `intl' is already present";
}
# Running libtoolize. #
# -------------------- #
- my $uses_libtool = 0;
- $traces = new Autom4te::XFile "$autoconf --trace=AM_PROG_LIBTOOL |";
- while ($_ = $traces->getline)
- {
- $uses_libtool = 1
- if /AM_PROG_LIBTOOL/;
- }
if (!$uses_libtool)
{
verbose "$configure_ac: not using Libtool";
# Running aclocal. #
# ----------------- #
- if (-f 'aclocal.m4' &&
- !up_to_date_p ('aclocal.m4', 'acinclude.m4'))
+ # Always run aclocal. Tracking its sources for up-to-dateness
+ # is too complex and too error prone. The best we can do is
+ # avoiding nuking the time stamp.
+
+ # If there are flags for aclocal in Makefile.am, use them.
+ my $aclocal_flags;
+ if (-f 'Makefile.am')
{
- # If there are flags for aclocal in Makefile.am, use them.
- my $aclocal_flags;
- if (-f 'Makefile.am')
+ my $aclocal_m4 = new Autom4te::XFile 'Makefile.am';
+ while ($_ = $aclocal_m4->getline)
{
- my $aclocal_m4 = new Autom4te::XFile 'Makefile.am';
- while ($_ = $aclocal_m4->getline)
+ if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
{
- if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
- {
- $aclocal_flags = $1;
- last;
- }
+ $aclocal_flags = $1;
+ last;
}
}
-
- # If m4dir is not specified and these flags do not specify the
- # location of the local Autoconf extensions, default to `m4'.
- if (!$aclocal_flags)
- {
- $aclocal_flags = '-I ' . ($m4dir || 'm4');
- }
- xsystem ("$aclocal $aclocal_flags")
}
-
+ xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
+ update_file ('aclocal.m4t', 'aclocal.m4');
# ------------------ #
# Running automake. #
# We now consider that if AC_CONFIG_HEADERS is used, then autoheader
# is used too.
# Just as for autoconf, up to date ness is performed by the tool itself.
- my $uses_autoheader = 0;
- $traces = new Autom4te::XFile "$autoconf --trace=AC_CONFIG_HEADERS |";
- while ($_ = $traces->getline)
- {
- $uses_autoheader = 1
- if /AC_CONFIG_HEADERS/;
- }
if (!$uses_autoheader)
{
verbose "$configure_ac: not using Autoheader";
@item --include=@var{dir}
@itemx -I @var{dir}
Also look for input files in @var{dir}. Multiple invocations
-accumulate. Latest directories are looking in first.
+accumulate. Directories are browsed from last to first.
@end table
@node ifnames Invocation
@item --include=@var{dir}
@itemx -I @var{dir}
Also look for input files in @var{dir}. Multiple invocations
-accumulate. Latest directories are looking in first.
+accumulate. Directories are browsed from last to first.
@item --output=@var{file}
@itemx -o @var{file}
@itemx -s
Instead of copying missing auxiliary files, install symbolic links.
-@item --localdir=@var{dir}
-@itemx -l @var{dir}
-Have @code{autoconf} and @code{autoheader} look for the package files
-@file{aclocal.m4} and (@code{autoheader} only) @file{acconfig.h} (but
-not @file{@var{file}.top} and @file{@var{file}.bot}) in directory
-@var{dir} instead of in the directory containing each @file{configure.ac}.
-
-@item --autoconf-dir=@var{dir}
-@itemx -A @var{dir}
-@evindex AC_MACRODIR
-Override the location where the installed Autoconf data files are looked
-for. You can also set the @code{AC_MACRODIR} environment variable to a
-directory; this option overrides the environment variable.
-
-This option is rarely needed and dangerous; it is only used when one
-plays with different versions of Autoconf simultaneously.
-
-@item --m4dir=@var{dir}
-@itemx -M @var{dir}
-Specify location of additional macro files (@file{m4} by default).
+@item --include=@var{dir}
+@itemx -I @var{dir}
+Also look for input files in @var{dir}. Multiple invocations
+accumulate. Directories are browsed from last to first.
@end table
@item --include=@var{dir}
@itemx -I @var{dir}
Also look for input files in @var{dir}. Multiple invocations accumulate.
-Latest directories are looking in first.
+Directories are browsed from last to first.
@item --warnings=@var{category}
@itemx -W @var{category}
@item --include=@var{dir}
@itemx -I @var{dir}
Also look for input files in @var{dir}. Multiple invocations accumulate.
-Latest directories are looking in first.
+Directories are browsed from last to first.
@end table
@node Obsolete Macros