+2008-04-10 Eric Blake <ebb9@byu.net>
+
+ AC_AUTOCONF_VERSION can inadvertently expand to a macro name.
+ * m4/amversion.in (AM_SET_CURRENT_AUTOMAKE_VERSION): Use proper
+ m4 quoting.
+ * aclocal.in (write_aclocal): Likewise.
+ * tests/missing6.test: New test.
+ * tests/Makefile.am (TESTS): Run it.
+ * tests/missing4.test: Adjust.
+
2008-04-02 Eric Blake <ebb9@byu.net>
Make gnupload friendlier for VPATH usage.
# the file in the diagnostic anyway.
$output = "m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [$ac_version],,
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [$ac_version],,
[m4_warning([this file was generated for autoconf $ac_version.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
## -*- Autoconf -*-
## @configure_input@
-# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
[AM_AUTOMAKE_VERSION([@VERSION@])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
missing3.test \
missing4.test \
missing5.test \
+missing6.test \
mkinstall.test \
mkinst2.test \
mkinst3.test \
#! /bin/sh
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 2008 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
./configure
$MAKE
-sed '1,20 s/AC_AUTOCONF_VERSION,/&9999/' < aclocal.m4 > aclocal.tmp
+sed '1,20 s/m4_defn(\[AC_AUTOCONF_VERSION\]),/9999,/' < aclocal.m4 > aclocal.tmp
cmp aclocal.m4 aclocal.tmp && exit 1
mv aclocal.tmp aclocal.m4
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2008 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 3, 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, see <http://www.gnu.org/licenses/>.
+
+# Make sure autoconf version checks in aclocal.m4 are robust.
+
+. ./defs || exit 1
+
+set -e
+
+{
+ echo 'm4_define([AC_AUTOCONF_VERSION], [9999a])'
+ echo 'm4_define([b], [oops])'
+ cat configure.in
+ echo AC_OUTPUT
+} >configure.ac
+rm configure.in
+
+touch Makefile.am
+
+$ACLOCAL
+$AUTOCONF 2>stderr
+grep 'You have another version of autoconf' stderr
+grep 'aclocal.m4:.*this file was generated for' stderr
+$AUTOMAKE
+./configure
+$MAKE
+
+sed 's/\[b\]/[a]/' < configure.ac > configure.tmp
+cmp configure.ac configure.tmp && exit 1
+
+mv configure.tmp configure.ac
+
+$MAKE 2>stderr
+cat stderr
+grep 'You have another version of autoconf' stderr
+grep 'aclocal.m4:.*this file was generated for autoconf 9999a' stderr
+
+: