summaryrefslogtreecommitdiff
path: root/aclocal.in
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2006-04-21 19:02:29 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2006-04-21 19:02:29 +0000
commit0562c007c70d0346938f82c1d4d950e88c3528bd (patch)
tree20854bb6460a905c8cfb0fd19c8704ffe62da36a /aclocal.in
parentf2bc3b45f3a28fec6837e07ada63b124df0720a4 (diff)
downloadautomake-0562c007c70d0346938f82c1d4d950e88c3528bd.tar.gz
* m4/amversion.in (_AM_AUTOCONF_VERSION): New macro.
(AM_SET_CURRENT_AUTOMAKE_VERSION): Call it. * aclocal.in (trace_used_macros): Trace _AM_AUTOCONF_VERSION. (write_aclocal): Output a check for Autoconf's version in aclocal.m4. Doing so ensures that users cannot build configure and Makefiles with two different autoconf versions. Report from Noah Misch. * tests/missing4.test: New file. * tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'aclocal.in')
-rw-r--r--aclocal.in25
1 files changed, 22 insertions, 3 deletions
diff --git a/aclocal.in b/aclocal.in
index b2738e435..acb05d253 100644
--- a/aclocal.in
+++ b/aclocal.in
@@ -140,6 +140,10 @@ my $m4_include_rx = "(m4_|m4_s|s)include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Match a serial number.
my $serial_line_rx = '^#\s*serial\s+(\S*)';
my $serial_number_rx = '^\d+(?:\.\d+)*$';
+
+# Autoconf version
+# Set by trace_used_macros.
+my $ac_version;
################################################################
@@ -607,9 +611,11 @@ sub trace_used_macros ()
$traces .= join (' ', grep { exists $files{$_} } @file_order) . " ";
# All candidate macros.
$traces .= join (' ',
- (map { "--trace='$_:\$f::\$n::\$1'" } ('AC_DEFUN',
- 'AC_DEFUN_ONCE',
- 'AU_DEFUN')),
+ (map { "--trace='$_:\$f::\$n::\$1'" }
+ ('AC_DEFUN',
+ 'AC_DEFUN_ONCE',
+ 'AU_DEFUN',
+ '_AM_AUTOCONF_VERSION')),
# Do not trace $1 for all other macros as we do
# not need it and it might contains harmful
# characters (like newlines).
@@ -632,6 +638,8 @@ sub trace_used_macros ()
if ($macro eq 'AC_DEFUN'
|| $macro eq 'AC_DEFUN_ONCE'
|| $macro eq 'AU_DEFUN');
+
+ $ac_version = $arg1 if $macro eq '_AM_AUTOCONF_VERSION';
}
$tracefh->close;
@@ -726,6 +734,17 @@ sub write_aclocal ($@)
# FIXME: Shouldn't we diagnose this?
return 1 if ! length ($output);
+ if ($ac_version)
+ {
+ # Do not use "$output_file" here for the same reason we do not
+ # use it in the header below. autom4te will output the name of
+ # the file in the diagnostic anyway.
+ $output = "m4_if(m4_PACKAGE_VERSION, [$ac_version],,
+[m4_fatal([this file was generated for autoconf $ac_version], [63])])
+
+$output";
+ }
+
# We used to print `# $output_file generated automatically etc.' But
# this creates spurious differences when using autoreconf. Autoreconf
# creates aclocal.m4t and then rename it to aclocal.m4, but the