]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
For automake PR/46:
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 24 Apr 2003 18:39:32 +0000 (18:39 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 24 Apr 2003 18:39:32 +0000 (18:39 +0000)
* automake.in (scan_aclocal_m4): Work in all directories, not only
the top-level.  Prepend $(top_srcdir) in front of each aclocal.m4
dependency.
* lib/am/configure.am (config.status, configure, $(ACLOCAL_M4)):
Define rebuild rules in each directory.
* tests/subdir8.test: Augment to exercise aclocal.m4's dependencies
from the top-level directory.
* tests/aclocal5.test: New file.  Exercise aclocal.m4's dependencies
from a subdirectory.
* tests/Makefile.am (TESTS): Add aclocal5.test.
(XFAIL_TESTS): Replace subdir8.test by aclocal5.test.

ChangeLog
NEWS
automake.in
lib/am/configure.am
tests/Makefile.am
tests/Makefile.in
tests/aclocal5.test [new file with mode: 0755]
tests/subdir8.test

index 17f04c81a0446fdd8dc0109d1fd567c678530a0a..5ca1331743c1c5b6c4af4c1a65c2c354bb23ada4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2003-04-24  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       For automake PR/46:
+       * automake.in (scan_aclocal_m4): Work in all directories, not only
+       the top-level.  Prepend $(top_srcdir) in front of each aclocal.m4
+       dependency.
+       * lib/am/configure.am (config.status, configure, $(ACLOCAL_M4)):
+       Define rebuild rules in each directory.
+       * tests/subdir8.test: Augment to exercise aclocal.m4's dependencies
+       from the top-level directory.
+       * tests/aclocal5.test: New file.  Exercise aclocal.m4's dependencies
+       from a subdirectory.
+       * tests/Makefile.am (TESTS): Add aclocal5.test.
+       (XFAIL_TESTS): Replace subdir8.test by aclocal5.test.
+
 2003-04-24  Akim Demaille  <akim@epita.fr>
            Alexandre Duret-Lutz  <adl@gnu.org>
 
diff --git a/NEWS b/NEWS
index 77a989d175afeece8a5758231f8ec79bbe2aa474..2d824e57449421cafc8aa2676a59e6751152d0d9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -83,6 +83,24 @@ New in 1.7a:
   overridden.  Fortunately, it appears that few packages use a
   non-PHONY `html' rule.
 
+* Any file which is m4_included from configure.ac will appear as
+  a configure and Makefile.in dependency.
+
+* The rules for rebuilding Makefiles and Makefile.ins will now rebuild
+  all Makefiles and all Makefile.ins at once when one of configure's
+  dependencies has changed.  This is considerably faster than
+  previous implementations, where config.status and automake were run
+  separately in each directory (this still happens when you change
+  a Makefile.am locally, without touching configure.ac or friends).
+  Doing this also solves a longstanding issue: these rebuild rule
+  failed to work when adding new directories to the tree, forcing
+  you to run automake manually.
+
+* For similar reasons, the rules to rebuild configure, config.status, and
+  aclocal.m4 are now defined in all directories.  Note that if you
+  were using the CONFIG_STATUS_DEPENDENCIES and CONFIGURE_DEPENDENCIES
+  (undocumented) variables, you will have to define them in all directories.
+  This is easily done using an AC_SUBST.
 \f
 New in 1.7:
 * Autoconf 2.54 is required.
index 5a536a84b2bfca1b3bcc5f1decc4f0611b3f1e43..03316957e9ef2f97431fc1b1ef12bda217fb17b6 100755 (executable)
@@ -4294,22 +4294,13 @@ sub scan_aclocal_m4
 {
     my $regen_aclocal = 0;
 
-    if (-f 'aclocal.m4')
-    {
-       # When using aclocal.m4, define this variable even in subdirectories,
-       # because every Makefile.in depends on $(ACLOCAL_M4).
-       &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
-    }
-
-    return (0, ())
-      unless $relative_dir eq '.';
-
     &examine_variable ('CONFIG_STATUS_DEPENDENCIES');
     &examine_variable ('CONFIGURE_DEPENDENCIES');
 
     if (-f 'aclocal.m4')
     {
        &push_dist_common ('aclocal.m4');
+       &define_variable ("ACLOCAL_M4", '$(top_srcdir)/aclocal.m4', INTERNAL);
 
        my $aclocal = new Automake::XFile "< aclocal.m4";
        my $line = $aclocal->getline;
@@ -4343,7 +4334,7 @@ sub scan_aclocal_m4
                    foreach my $ac_dep (&my_glob ($amdir . '/*.m4'))
                    {
                        $ac_dep =~ s/^\.\/+//;
-                       push (@ac_deps, $ac_dep)
+                       push (@ac_deps, '$(top_srcdir)/' . $ac_dep)
                          unless $ac_dep eq "aclocal.m4"
                            || $ac_dep eq "acinclude.m4";
                    }
index cb265f3f1887ac1204e21c1d1119fb862176661e..6ba9a77b8541c407266b0cf72fdfbddb8c720a50 100644 (file)
 ## --------------------------- ##
 
 if %?TOPDIR_P%
-## Explicitly look in srcdir for benefit of non-GNU makes.
-## Use `$(top_builddir)' for the benefit of Tru64 v5.1 make and also
-## NetBSD v1.5 make.  These `make's don't know that
-## `$(top_builddir)/config.status' and `config.status' are the same
-## file when top_builddir==`.'.
-$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-       $(SHELL) ./config.status --recheck
-
 ## Always require configure.ac and configure at top level, even if they
 ## don't exist.  This is especially important for configure, since it
 ## won't be created until autoconf is run -- which might be after
 ## automake is run.
 DIST_COMMON += configure %CONFIGURE-AC%
-
-## Explicitly look in srcdir for benefit of non-GNU makes.
-$(srcdir)/configure: %MAINTAINER-MODE% $(srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) %CONFIGURE_DEPS%
-       cd $(srcdir) && $(AUTOCONF)
 endif %?TOPDIR_P%
 
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: %MAINTAINER-MODE% $(top_srcdir)/%CONFIGURE-AC% $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) %CONFIGURE_DEPS%
+       cd $(top_srcdir) && $(AUTOCONF)
 
 
 ## ------------ ##
 ## aclocal.m4.  ##
 ## ------------ ##
 
-if %?TOPDIR_P%
-if  %?REGEN-ACLOCAL-M4%
-$(ACLOCAL_M4): %MAINTAINER-MODE% %CONFIGURE-AC% %ACLOCAL_M4_DEPS%
-       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-endif  %?REGEN-ACLOCAL-M4%
-endif %?TOPDIR_P%
+## aclocal.m4 must be built by the top-level Makefile, because this is
+## where the user is expected to define $(ACLOCAL_AMFLAGS).
+if %?REGEN-ACLOCAL-M4%
+$(ACLOCAL_M4): %MAINTAINER-MODE% $(top_srcdir)/%CONFIGURE-AC% %ACLOCAL_M4_DEPS%
+?TOPDIR_P?     $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+?!TOPDIR_P?    cd $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) '$$(ACLOCAL_M4)'
+endif %?REGEN-ACLOCAL-M4%
 
 
 ## --------- ##
index 14783df5f22f59353f2b4bfa9fd1f5165439d115..65f913923a0a06ac0d584c2c53a4cd2d1f286143 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to create Makefile.in
 
-XFAIL_TESTS = subdir8.test auxdir2.test cond17.test txinfo5.test
+XFAIL_TESTS = aclocal5.test auxdir2.test cond17.test txinfo5.test
 
 TESTS =        \
 acinclude.test \
@@ -11,6 +11,7 @@ aclocal.test \
 aclocal2.test \
 aclocal3.test \
 aclocal4.test \
+aclocal5.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
index 12472b215aed871d4e38741e55d4077eb3f1ac29..085e985d2da9a4942ac940788d8bba454b20047c 100644 (file)
@@ -33,7 +33,7 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-DIST_COMMON = Makefile.in Makefile.am defs.in README
+DIST_COMMON = Makefile.in Makefile.am aclocal.m4 defs.in README
 subdir = tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/lib/mkinstalldirs
@@ -104,7 +104,7 @@ sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
-XFAIL_TESTS = subdir8.test auxdir2.test cond17.test txinfo5.test
+XFAIL_TESTS = aclocal5.test auxdir2.test cond17.test txinfo5.test
 TESTS = \
 acinclude.test \
 aclibobj.test \
@@ -114,6 +114,7 @@ aclocal.test \
 aclocal2.test \
 aclocal3.test \
 aclocal4.test \
+aclocal5.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
@@ -600,6 +601,14 @@ Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
        esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(top_srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) 
+       cd $(top_srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(top_srcdir)/configure.in 
+       cd $(top_srcdir) && $(MAKE) $(AM_MAKEFLAGS) '$$(ACLOCAL_M4)'
 defs: $(top_builddir)/config.status defs.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 uninstall-info-am:
diff --git a/tests/aclocal5.test b/tests/aclocal5.test
new file mode 100755 (executable)
index 0000000..449de36
--- /dev/null
@@ -0,0 +1,61 @@
+#! /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.
+
+# Test to make sure that aclocal.m4's dependencies are honored
+# in sub-directories.
+
+# This test assumes that the `make' utility is able to start
+# over and reload Makefiles which have been remade (a non-POSIX feature).
+required='GNUmake'
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+MORE_DEFS
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+ACLOCAL_AMFLAGS = -I m4
+END
+
+mkdir sub
+: > sub/Makefile.am
+
+mkdir m4
+echo 'AC_DEFUN([MORE_DEFS], [])' > m4/moredefs.m4
+
+$ACLOCAL -I m4
+$AUTOCONF
+$AUTOMAKE --copy --add-missing
+./configure
+$MAKE
+
+# Update an aclocal.m4 dependency, then make sure all Makefiles
+# are updated, even from a sub-directory.
+echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
+cd sub
+$MAKE
+cd ..
+grep GREPME Makefile
+grep GREPME sub/Makefile
index 9ef72199424465af132ead389b5ff5853da4feae..ed8610d0447315554f0f4348df23929d7d6eed0e 100755 (executable)
@@ -36,10 +36,14 @@ cat >> configure.in << 'END'
 AM_PROG_CC_C_O
 AC_PROG_CC
 m4_include([confiles.m4])
+MORE_DEFS
 AC_OUTPUT
 END
 
-echo 'SUBDIRS = sub' > Makefile.am
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+ACLOCAL_AMFLAGS = -I m4
+END
 
 mkdir sub
 
@@ -57,7 +61,10 @@ int main ()
 }
 END
 
-$ACLOCAL
+mkdir m4
+echo 'AC_DEFUN([MORE_DEFS], [])' > m4/moredefs.m4
+
+$ACLOCAL -I m4
 $AUTOCONF
 $AUTOMAKE --copy --add-missing
 ./configure
@@ -89,3 +96,12 @@ $MAKE
 cd ..
 test -f maude/Makefile
 test -f sub/maude/Makefile
+
+# Make sure the dependencies of aclocal.m4 or honored at least from
+# the top-level directory.
+echo 'AC_DEFUN([MORE_DEFS], [AC_SUBST([GREPME])])' > m4/moredefs.m4
+$MAKE
+grep GREPME Makefile
+grep GREPME maude/Makefile
+grep GREPME sub/Makefile
+grep GREPME sub/maude/Makefile