* bin/autoreconf.in (&autoreconf): Run aclocal before tracing, so

that we can trace macros from aclocal.m4.
Trace AC_PROG_LIBTOOL, not AM_PROG_LIBTOOL, since the latter is
obsoleted, and redirect to the former anyway.
Reported by Ralf Corsepius.
This commit is contained in:
Akim Demaille 2001-11-08 17:21:38 +00:00
parent 00b6183c8e
commit b863f27fcc
2 changed files with 69 additions and 54 deletions

View File

@ -1,3 +1,11 @@
2001-11-08 Akim Demaille <akim@epita.fr>
* bin/autoreconf.in (&autoreconf): Run aclocal before tracing, so
that we can trace macros from aclocal.m4.
Trace AC_PROG_LIBTOOL, not AM_PROG_LIBTOOL, since the latter is
obsoleted, and redirect to the former anyway.
Reported by Ralf Corsepius.
2001-11-08 Akim Demaille <akim@epita.fr> 2001-11-08 Akim Demaille <akim@epita.fr>
* bin/autoreconf.in (&autoreconf): AC_CONFIG_SUBIDRS are to be * bin/autoreconf.in (&autoreconf): AC_CONFIG_SUBIDRS are to be

View File

@ -215,6 +215,59 @@ sub autoreconf ($)
} }
# ----------------- #
# Running aclocal. #
# ----------------- #
# Run it first: it might discover new macros to add, e.g.,
# AC_PROG_LIBTOOL, which we will trace later to see if Libtool is
# used.
#
# Always run it. 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.
my $uses_aclocal = 1;
# Nevertheless, if aclocal.m4 exists and is not made by aclocal,
# don't run aclocal.
if (-f 'aclocal.m4')
{
my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4';
$_ = $aclocal_m4->getline;
$uses_aclocal = 0
unless /generated.*by aclocal/;
}
# If there are flags for aclocal in Makefile.am, use them.
my $aclocal_flags = '';
if ($uses_aclocal && -f 'Makefile.am')
{
my $makefile = new Autom4te::XFile 'Makefile.am';
while ($_ = $makefile->getline)
{
if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
{
$aclocal_flags = $1;
last;
}
}
}
if (!$uses_aclocal)
{
verbose "$configure_ac: not using aclocal";
}
else
{
xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
# aclocal may produce no output.
update_file ('aclocal.m4t', 'aclocal.m4')
if -f 'aclocal.m4t';
}
# ------------------------------- # # ------------------------------- #
# See what tools will be needed. # # See what tools will be needed. #
# ------------------------------- # # ------------------------------- #
@ -225,12 +278,11 @@ sub autoreconf ($)
my $uses_gettext; my $uses_gettext;
my $uses_libtool; my $uses_libtool;
my $uses_autoheader; my $uses_autoheader;
my $uses_aclocal;
my @subdir; my @subdir;
my $traces = new Autom4te::XFile my $traces = new Autom4te::XFile
("$autoconf" ("$autoconf"
. join (' --trace=', '', . join (' --trace=', '',
'AC_INIT', 'AM_GNU_GETTEXT', 'AM_PROG_LIBTOOL', 'AC_INIT', 'AM_GNU_GETTEXT', 'AC_PROG_LIBTOOL',
'AC_CONFIG_HEADERS', 'AC_CONFIG_HEADERS',
'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1') 'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1')
. ' |'); . ' |');
@ -238,7 +290,7 @@ sub autoreconf ($)
{ {
$uses_autoconf = 1 if /AC_INIT/; $uses_autoconf = 1 if /AC_INIT/;
$uses_gettext = 1 if /AM_GNU_GETTEXT/; $uses_gettext = 1 if /AM_GNU_GETTEXT/;
$uses_libtool = 1 if /AM_PROG_LIBTOOL/; $uses_libtool = 1 if /AC_PROG_LIBTOOL/;
$uses_autoheader = 1 if /AC_CONFIG_HEADERS/; $uses_autoheader = 1 if /AC_CONFIG_HEADERS/;
push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/; push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
} }
@ -257,6 +309,8 @@ sub autoreconf ($)
} }
} }
# -------------------- # # -------------------- #
# Running gettexitze. # # Running gettexitze. #
# -------------------- # # -------------------- #
@ -297,53 +351,6 @@ sub autoreconf ($)
} }
# ----------------- #
# Running aclocal. #
# ----------------- #
# 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.
$uses_aclocal = 1;
# Nevertheless, if aclocal.m4 exists and is not made by aclocal,
# don't run aclocal.
if (-f 'aclocal.m4')
{
my $aclocal_m4 = new Autom4te::XFile 'aclocal.m4';
$_ = $aclocal_m4->getline;
$uses_aclocal = 0
unless /generated.*by aclocal/;
}
# If there are flags for aclocal in Makefile.am, use them.
my $aclocal_flags = '';
if ($uses_aclocal && -f 'Makefile.am')
{
my $makefile = new Autom4te::XFile 'Makefile.am';
while ($_ = $makefile->getline)
{
if (/^ACLOCAL_[A-Z_]*FLAGS\s*=\s*(.*)/)
{
$aclocal_flags = $1;
last;
}
}
}
if (!$uses_aclocal)
{
verbose "$configure_ac: not using aclocal";
}
else
{
xsystem ("$aclocal $aclocal_flags --output=aclocal.m4t");
# aclocal may produce no output.
update_file ('aclocal.m4t', 'aclocal.m4')
if -f 'aclocal.m4t';
}
# ------------------ # # ------------------ #
# Running automake. # # Running automake. #
# ------------------ # # ------------------ #