* aclocal.in (scan_m4_files): Scan configure.ac.
(trace_used_macros, write_aclocal): Remove configure.ac from the
list of files to include.
* tests/Makefile.am (TESTS): Add acloca15.test.
* tests/acloca15.test: New file.
2004-01-02 Alexandre Duret-Lutz <adl@gnu.org>
+ Fix for PR automake/319:
+ * aclocal.in (scan_m4_files): Scan configure.ac.
+ (trace_used_macros, write_aclocal): Remove configure.ac from the
+ list of files to include.
+ * tests/Makefile.am (TESTS): Add acloca15.test.
+ * tests/acloca15.test: New file.
+
* aclocal.in (%file_includes): New variable.
(scan_configure_dep): Compile $m4_include_rx and $ac_require_rx once.
(scan_file): Scan for included files, and process these files
(strip_redundant_includes): New function.
(trace_used_macros): Call it.
(write_aclocal): Likewise. Also check the mtime of included files.
- * tests/Makfile.am (TESTS): Add acloca14.test.
+ * tests/Makefile.am (TESTS): Add acloca14.test.
* tests/acloca14.test: New file.
Report from Phil Edwards.
{
local (@dirlist) = @_;
- # First, scan acinclude.m4 if it exists.
+ # First, scan configure.ac. It may contain macro definitions,
+ # or may include other files that define macros.
+ &scan_file ($configure_ac);
+
+ # Then, scan acinclude.m4 if it exists.
if (-f 'acinclude.m4')
{
&scan_file ('acinclude.m4');
}
+ # Finally, scan all files in our search path.
local ($m4dir);
foreach $m4dir (@dirlist)
{
my %files = map { $map{$_} => 1 } keys %macro_seen;
$files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
%files = strip_redundant_includes %files;
+ # configure.ac is implicitly included.
+ delete $files{$configure_ac};
my $traces = ($ENV{AUTOM4TE} || 'autom4te');
$traces .= " --language Autoconf-without-aclocal-m4 ";
my %files = map { $map{$_} => 1 } @macros;
$files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
%files = strip_redundant_includes %files;
+ delete $files{$configure_ac};
for $file (grep { exists $files{$_} } @file_order)
{
acloca12.test \
acloca13.test \
acloca14.test \
+acloca15.test \
acoutnoq.test \
acoutpt.test \
acoutpt2.test \
acloca12.test \
acloca13.test \
acloca14.test \
+acloca15.test \
acoutnoq.test \
acoutpt.test \
acoutpt2.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2004 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 aclocal scans configure.in for macro definitions.
+# PR/319.
+
+. ./defs || exit 1
+
+set -e
+
+# Start macros with AM_ because that causes aclocal to complain if it
+# cannot find them.
+
+cat >> configure.in << 'END'
+m4_include([somedef.m4])
+AC_DEFUN([AM_SOME_MACRO])
+AC_DEFUN([AM_SOME_OTHER_MACRO])
+AM_SOME_MACRO
+AM_SOME_OTHER_MACRO
+AM_MORE_MACRO
+END
+
+mkdir m4
+echo 'AC_DEFUN([AM_SOME_MACRO])' > m4/some.m4
+echo 'AC_DEFUN([AM_SOME_DEF])' > somedef.m4
+echo 'AC_DEFUN([AM_MORE_MACRO], [AC_REQUIRE([AM_SOME_DEF])])' > m4/more.m4
+
+$ACLOCAL -I m4
+$FGREP AM_SOME_MACRO aclocal.m4 && exit 1
+$FGREP AM_MORE_MACRO aclocal.m4 && exit 1
+$FGREP 'm4_include([m4/more.m4])' aclocal.m4
+test 1 = `grep m4_include aclocal.m4 | wc -l`