* test/tools.at: Use AT_CHECK_AUTOCONF.
(AWK portability): Remove, for autoconf no longer uses AWK.
(Syntax of the Perl scripts): New.
* configure.ac: autoconf no longer needs an AWK with a good
regexp engine.
Use a static test on AC_PACKAGE_VERSION.
* autom4te.in (&up_to_date_p): Output depends on the arguments.
* lib/autoconf/Makefile.am: Ship version.m4, maintainer file.
* tests/atconfig.in (PERL): New.
+2001-08-01 Akim Demaille <akim@epita.fr>
+
+ * autoconf.in ($AWK): Remove, no longer used.
+ * test/tools.at: Use AT_CHECK_AUTOCONF.
+ (AWK portability): Remove, for autoconf no longer uses AWK.
+ (Syntax of the Perl scripts): New.
+ * configure.ac: autoconf no longer needs an AWK with a good
+ regexp engine.
+ Use a static test on AC_PACKAGE_VERSION.
+ * autom4te.in (&up_to_date_p): Output depends on the arguments.
+ * lib/autoconf/Makefile.am: Ship version.m4, maintainer file.
+ * tests/atconfig.in (PERL): New.
+
2001-08-01 Akim Demaille <akim@epita.fr>
* lib/autoconf/lang.m4 (AC_LANG(C), AC_LANG_C, _AC_LANG_ABBREV(C))
operating system features that the package can use, in the form of M4
macro calls.
-Producing configuration scripts using Autoconf requires GNU M4. You
-must install GNU M4 (version 1.4 or later) before configuring
-Autoconf, so that Autoconf's configure script can find it. The
-configuration scripts produced by Autoconf are self-contained, so
-their users do not need to have Autoconf (or GNU M4).
-
-Some optional utilities that come with Autoconf (autoscan and
-autoupdate) use Perl 5.5. However, it is not required in order to use
-the main Autoconf programs. If it is not present, the affected
-Autoconf utilities will not be installed.
+Producing configuration scripts using Autoconf requires GNU M4 and
+Perl. You must install GNU M4 (version 1.4 or later) and Perl (5.005
+or later) before configuring Autoconf, so that Autoconf's configure
+script can find them. The configuration scripts produced by Autoconf
+are self-contained, so their users do not need to have Autoconf (or
+GNU M4, Perl etc.).
The file INSTALL should be distributed with packages that use
Autoconf-generated configure scripts and Makefiles that conform to the
instructions on compilation and installation. This removes the need
to maintain many similar sets of installation instructions.
-Be sure to read BUGS (especially if this Autoconf is not an official
+Be sure to read BUGS (especially if this version is not an official
release) and INSTALL.
Mail suggestions to autoconf@gnu.org, report bugs on
esac
-# Find a good AWK.
-: ${AWK=@AWK@}
-if echo xfoo | $AWK '/foo|^bar$/ { print }' | grep xfoo >/dev/null; then :; else
- echo "$me: the regex engine of $AWK is too broken to be used" >&2
- echo "$me: you might want to install GNU AWK" >&2
- exit 1
-fi
-
-
# We test "$dir/autom4te" in case we are in the build tree, in which case
# the names are not transformed yet.
for autom4te in "$AUTOM4TE" \
{
if (! exists ${$obj->macro}{$_})
{
+ # FIXME: This is too rough an approximation: we should have
+ # a means to select only M4 builtins, but @m4_builtins is not
+ # visible here.
s/^m4_//;
${$obj->macro}{$_} = 1;
- ${$obj->macro}{"m4_$_"} = 1;
+ ${$obj->macro}{"m4_$_"} = 1;
$obj->valid (0);
}
}
my @required_trace =
(
# We need `include' to find the dependencies.
- 'include',
+ 'include', 'm4_include',
# These are wanted by autoheader.
'AC_CONFIG_HEADERS',
'AH_OUTPUT',
$macro =~ s/^m4_//;
# See &handle_traces for an explanation for this paragraph.
if (grep /^$macro$/, @m4_builtins)
- {
- $res{$macro} = 1;
- $res{"m4_$macro"} = 1;
- }
+ {
+ $res{$macro} = 1;
+ $res{"m4_$macro"} = 1;
+ }
}
return %res;
handle_traces ($req, "$tmp/dependencies",('include' => '$1'));
my $mtime = (stat ($file))[9];
my $deps = new IO::File ("$tmp/dependencies");
- while ($_ = $deps->getline)
+ push @dep, map { chomp; find_file ($_) } $deps->getlines;
+ foreach (@dep)
{
- chop;
- $_ = find_file ($_);
verbose "$file depends on $_";
if ($mtime < (stat ($_))[9])
{
esac
-# Find a good AWK.
-: ${AWK=@AWK@}
-if echo xfoo | $AWK '/foo|^bar$/ { print }' | grep xfoo >/dev/null; then :; else
- echo "$me: the regex engine of $AWK is too broken to be used" >&2
- echo "$me: you might want to install GNU AWK" >&2
- exit 1
-fi
-
-
# We test "$dir/autom4te" in case we are in the build tree, in which case
# the names are not transformed yet.
for autom4te in "$AUTOM4TE" \
{
if (! exists ${$obj->macro}{$_})
{
+ # FIXME: This is too rough an approximation: we should have
+ # a means to select only M4 builtins, but @m4_builtins is not
+ # visible here.
s/^m4_//;
${$obj->macro}{$_} = 1;
- ${$obj->macro}{"m4_$_"} = 1;
+ ${$obj->macro}{"m4_$_"} = 1;
$obj->valid (0);
}
}
my @required_trace =
(
# We need `include' to find the dependencies.
- 'include',
+ 'include', 'm4_include',
# These are wanted by autoheader.
'AC_CONFIG_HEADERS',
'AH_OUTPUT',
$macro =~ s/^m4_//;
# See &handle_traces for an explanation for this paragraph.
if (grep /^$macro$/, @m4_builtins)
- {
- $res{$macro} = 1;
- $res{"m4_$macro"} = 1;
- }
+ {
+ $res{$macro} = 1;
+ $res{"m4_$macro"} = 1;
+ }
}
return %res;
handle_traces ($req, "$tmp/dependencies",('include' => '$1'));
my $mtime = (stat ($file))[9];
my $deps = new IO::File ("$tmp/dependencies");
- while ($_ = $deps->getline)
+ push @dep, map { chomp; find_file ($_) } $deps->getlines;
+ foreach (@dep)
{
- chop;
- $_ = find_file ($_);
verbose "$file depends on $_";
if ($mtime < (stat ($_))[9])
{
# a AC-SUBST inside AC-PROG-GNU-M4. Grmph!
AC_SUBST(M4)
-# `autoconf' and `ifnames' use AWK. And we need decent RE support.
+# `ifnames' uses AWK.
AC_PROG_AWK
-# Some AWK fail
-if echo xfoo | $AWK '/foo|^bar$/ { print }' | grep xfoo >/dev/null; then :; else
- AC_MSG_ERROR([the regex engine of $AWK is too broken to be used
- you might want to install GNU AWK])
-fi
# Generating man pages.
AM_MISSING_PROG(HELP2MAN, help2man)
if test "$PERL" = no; then
AC_MSG_ERROR([perl is not found])
fi
+$PERL -e 'require 5.005;' || {
+ AC_MSG_ERROR([perl 5.005 or better is required])
+}
AC_PROG_INSTALL
tests/Makefile tests/atconfig)
AC_OUTPUT
-
# Report the state of this version of Autoconf if this is a beta.
-case AC_PACKAGE_VERSION in
- *[[a-z]]*)
- cat <<EOF
+m4_match(m4_defn([AC_PACKAGE_VERSION]), [[a-z]],
+[ cat <<EOF
You are about to use an experimental version of Autoconf. Be sure to
read the relevant mailing lists, most importantly <autoconf@gnu.org>.
EOF
- sed -n '/^\* Status/,$p' $srcdir/BUGS;;
-esac
+ sed -n '/^\* Status/,$p' $srcdir/BUGS
+])
# The order matters: we need version.m4 to build autoconf.m4f.
nodistautoconflib_DATA = version.m4 autoconf.m4f
-EXTRA_DIST = $(distautoconflib_DATA) version.in
+EXTRA_DIST = $(distautoconflib_DATA) version.in version.m4
## version.m4. ##
# The order matters: we need version.m4 to build autoconf.m4f.
nodistautoconflib_DATA = version.m4 autoconf.m4f
-EXTRA_DIST = $(distautoconflib_DATA) version.in
+EXTRA_DIST = $(distautoconflib_DATA) version.in version.m4
SUFFIXES = .m4 .m4f
M4_INCLUDES = --include $(srcdir) --include $(top_builddir)/lib --include $(top_srcdir)/lib
SHELL=${CONFIG_SHELL-'@SHELL@'}
PATH_SEPARATOR='@PATH_SEPARATOR@'
-# We need GNU m4.
+# We need GNU m4, and Perl.
M4='@M4@'
+PERL='@PERL@'
# Be sure to use the non installed Perl modules.
# We need no special protection for the subtools (e.g., autoheader runs
AT_BANNER([Executables (autoheader, autoupdate...).])
-## -------------------------------------------------------- ##
-## Check that the shell scripts are syntactically correct. ##
-## -------------------------------------------------------- ##
+## ----------------------------- ##
+## Syntax of the shell scripts. ##
+## ----------------------------- ##
# We use `/bin/sh -n script' to check that there are no syntax errors
# in the scripts. Although incredible, there are /bin/sh that go into
# So before using `/bin/sh -n' to check our scripts, we first check
# that `/bin/sh -n' is not broken to death.
-AT_SETUP([Syntax of the scripts])
+AT_SETUP([Syntax of the shell scripts])
# A script that never returns. We don't care that it never returns,
# broken /bin/sh loop equally with `false', but it makes it easier to
+## ---------------------------- ##
+## Syntax of the Perl scripts. ##
+## ---------------------------- ##
+
+AT_SETUP([Syntax of the Perl scripts])
+
+# Perl says things like:
+# | % perl -c ./autom4te
+# | ./autom4te syntax OK
+# Ignore it, it might change between releases.
+AT_CHECK([$PERL -c ../autom4te], 0, [], [ignore])
+AT_CHECK([$PERL -c ../autoupdate], 0, [], [ignore])
+
+AT_CLEANUP
+
+
+
## ----------------- ##
## AWK portability. ##
## ----------------- ##
AT_SETUP([AWK portability])
-AT_DATA([configure.ac],
-[])
-
# Skip if we don't have GNU Awk.
AT_CHECK([gawk --version || exit 77], 0, ignore, ignore)
-# Generation of the script.
-AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir ../lib -l $at_srcdir], 0,
- [], [])
-# Tracing.
-AT_CHECK([AWK='gawk --posix' autoconf --autoconf-dir ../lib -l $at_srcdir -t AC_INIT], 0,
- ignore, [])
# Syntax correctness of ifnames.
-AT_CHECK([AWK='gawk --posix' ifnames /dev/null], 0,
- [], [])
+AT_CHECK([AWK='gawk --posix' ifnames /dev/null])
-AT_CLEANUP(configure)
+AT_CLEANUP
]])
# Several --traces.
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE1 -t TRACE2], 0,
+AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
[[configure.ac:4:TRACE1:foo:bar:baz
configure.ac:4:TRACE2:bar:baz
configure.ac:5:TRACE1:bar:baz
]])
# Several line requests.
-AT_CHECK([[autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE1:'
+AT_CHECK_AUTOCONF([[-t TRACE1:'
[$1], [$2], [$3].']], 0,
[[
[foo], [bar], [baz].
]])
# ${sep}@.
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir -t TRACE2:'${)===(}@'], 0,
+AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
[[[bar])===([baz]
[baz]
[])===([baz]
[[define([active], [ACTIVE])
]])
-AT_CHECK([[autoconf --autoconf-dir ../lib -l $at_srcdir -t define |
- sed -n '$p']],
+AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
0,
[[configure.ac:1:define:active:ACTIVE
]])
# dive into obscure feature interaction...
# Note that using `-i' means we need the *.m4 files, not the *.m4f files,
# hence we need srcdir, not builddir.
-AT_CHECK([[autoconf --autoconf-dir $at_top_srcdir/lib -l $at_srcdir -t define:'$1' -i|
+AT_CHECK_AUTOCONF([[--autoconf-dir $at_top_srcdir/lib -t define:'$1' -i|
sed -n '$p']],
0,
[[active
_AS_BAR
]])
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir], 1, [], [stderr])
+AT_CHECK_AUTOCONF([], 1, [], [stderr])
# The output of autoconf is not deterministic here because it
# uses `for (ind in array)'. So be sure to have a unique representation.
AT_CHECK([sort stderr], 0,
It would be very bad if Autoconf forgot to expand [AC_]OUTPUT!
]])
-AT_CHECK([autoconf --autoconf-dir ../lib -l $at_srcdir], 1, [], [stderr])
+AT_CHECK_AUTOCONF([], 1, [], [stderr])
# The output of autoconf is not deterministic here because it
# uses `for (ind in array)'. So be sure to have a unique representation.
AT_CHECK([sort stderr], 0,