number of arguments of each traced macro.
* tests/overrid.test: Fix call to AM_CONDITIONAL.
* tests/conff2.test: New files.
* tests/Makefile.am (TESTS): Add conff2.test.
Report from Paolo Bonzini.
+2003-07-01 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * automake.in (scan_autoconf_traces): Check the expected
+ number of arguments of each traced macro.
+ * tests/overrid.test: Fix call to AM_CONDITIONAL.
+ * tests/conff2.test: New files.
+ * tests/Makefile.am (TESTS): Add conff2.test.
+ Report from Paolo Bonzini.
+
2003-06-30 Alexandre Duret-Lutz <adl@gnu.org>
* automake.in ($SUBST_REF_PATTERN): Do not define.
_value_as_list_recursive_worker,
value_as_list_recursive, loc_and_value_as_list_recursive): ... here.
(reset): Reset %_gen_varname.
+ (require_variables_for_variable): Accept an Automake::Variable
+ as argument.
2003-06-27 Alexandre Duret-Lutz <adl@gnu.org>
{
my ($filename) = @_;
- my @traced = qw(AC_CANONICAL_HOST
- AC_CANONICAL_SYSTEM
- AC_CONFIG_AUX_DIR
- AC_CONFIG_FILES
- AC_CONFIG_HEADERS
- AC_INIT
- AC_LIBSOURCE
- AC_SUBST
- AM_AUTOMAKE_VERSION
- AM_CONDITIONAL
- AM_GNU_GETTEXT
- AM_INIT_AUTOMAKE
- AM_MAINTAINER_MODE
- AM_PROG_CC_C_O
- m4_include
- m4_sinclude);
+ # Macros to trace, with their minimal number of arguments.
+ my %traced = (
+ AC_CANONICAL_HOST => 0,
+ AC_CANONICAL_SYSTEM => 0,
+ AC_CONFIG_AUX_DIR => 1,
+ AC_CONFIG_FILES => 1,
+ AC_CONFIG_HEADERS => 1,
+ AC_INIT => 0,
+ AC_LIBSOURCE => 1,
+ AC_SUBST => 1,
+ AM_AUTOMAKE_VERSION => 1,
+ AM_CONDITIONAL => 2,
+ AM_GNU_GETTEXT => 0,
+ AM_INIT_AUTOMAKE => 0,
+ AM_MAINTAINER_MODE => 0,
+ AM_PROG_CC_C_O => 0,
+ m4_include => 1,
+ m4_sinclude => 1,
+ );
my $traces = ($ENV{AUTOCONF} || 'autoconf') . " ";
# Use a separator unlikely to be used, not `:', the default, which
# has a precise meaning for AC_CONFIG_FILES and so on.
$traces .= join (' ',
- map { "--trace=$_" . ':\$f:\$l::\$n::\${::}%' } @traced);
+ map { "--trace=$_" . ':\$f:\$l::\$n::\${::}%' }
+ (keys %traced));
my $tracefh = new Automake::XFile ("$traces $filename |");
verb "reading $traces";
my $where = new Automake::Location $here;
my $macro = $args[0];
+ prog_error ("unrequested trace `$macro'")
+ unless exists $traced{$macro};
+
+ # Skip and diagnose malformed calls.
+ if ($#args < $traced{$macro})
+ {
+ msg ('syntax', $where, "not enough arguments for $macro");
+ next;
+ }
+
# Alphabetical ordering please.
if ($macro eq 'AC_CANONICAL_HOST')
{
conf2.test \
confdeps.test \
conff.test \
+conff2.test \
confh.test \
confh4.test \
config.test \
conf2.test \
confdeps.test \
conff.test \
+conff2.test \
confh.test \
confh4.test \
config.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2003 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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 2, or (at your option)
+# any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure empty calls to AC_CONFIG_FILES or AC_CONFIG_HEADERS are diagnosed.
+
+. ./defs || exit 1
+
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES ([oops])
+AC_CONFIG_HEADERS
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOMAKE 2>stderr && exit 1
+cat stderr
+grep 'configure.in:3:.*AC_CONFIG_FILES' stderr
+grep 'configure.in:4:.*AC_CONFIG_HEADERS' stderr
set -e
cat >> configure.in << 'END'
-AM_CONDITIONAL([COND])
+AM_CONDITIONAL([COND], [:])
END
cat > Makefile.am << 'END'