* automake.in (generate_makefile): Define SUBDIRS if it is
authorAlexandre Duret-Lutz <adl@gnu.org>
Mon, 17 Nov 2003 23:18:20 +0000 (23:18 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Mon, 17 Nov 2003 23:18:20 +0000 (23:18 +0000)
not defined and DIST_SUBDIRS is.
* tests/subpkg2.test: New file.
* tests/Makefile.am (TESTS): Add subpkg2.test.
Report from Gary V. Vaughan.

12 files changed:
ChangeLog
Makefile.in
automake.in
doc/Makefile.in
lib/Automake/Makefile.in
lib/Automake/tests/Makefile.in
lib/Makefile.in
lib/am/Makefile.in
m4/Makefile.in
tests/Makefile.am
tests/Makefile.in
tests/subpkg2.test [new file with mode: 0755]

index c2aa232..20f0fb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2003-11-17  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * automake.in (generate_makefile): Define SUBDIRS if it is
+       not defined and DIST_SUBDIRS is.
+       * tests/subpkg2.test: New file.
+       * tests/Makefile.am (TESTS): Add subpkg2.test.
+       Report from Gary V. Vaughan.
+
        * tests/suffix11.test: Check for suffixes containing `-'.
        * lib/Automake/Rule.pm ($_SUFFIX_RULE_PATTERN): Accept `-' in
        suffixes.
index 7a130b8..d8a5e80 100644 (file)
@@ -184,6 +184,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index 034090e..12a8b65 100755 (executable)
@@ -6761,6 +6761,11 @@ sub generate_makefile ($$)
   # Must do this after reading .am file.
   define_variable ('subdir', $relative_dir, INTERNAL);
 
+  # If DIST_SUBDIRS is defined, make sure SUBDIRS is, so that
+  # recursive rules are enabled.
+  define_pretty_variable ('SUBDIRS', TRUE, INTERNAL, '')
+    if var 'DIST_SUBDIRS' && ! var 'SUBDIRS';
+
   # Check first, because we might modify some state.
   check_cygnus;
   check_gnu_standards;
index eba4132..1b1827b 100644 (file)
@@ -155,6 +155,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  doc/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  doc/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index 28e5386..464f99c 100644 (file)
@@ -178,6 +178,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Automake/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Automake/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index b2594ca..4c5db95 100644 (file)
@@ -137,6 +137,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Automake/tests/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Automake/tests/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index d4ba8ae..1c628d8 100644 (file)
@@ -156,6 +156,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index b7a9bdc..df118fb 100644 (file)
@@ -142,6 +142,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  lib/am/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  lib/am/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index 62218f0..f60b625 100644 (file)
@@ -168,6 +168,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  m4/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  m4/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
index 4f39f7b..8bc3b20 100644 (file)
@@ -439,6 +439,7 @@ subobj8.test \
 subobj9.test \
 subobjname.test \
 subpkg.test \
+subpkg2.test \
 subst.test \
 substref.test \
 substtarg.test \
index a8d0c28..8747c89 100644 (file)
@@ -553,6 +553,7 @@ subobj8.test \
 subobj9.test \
 subobjname.test \
 subpkg.test \
+subpkg2.test \
 subst.test \
 substref.test \
 substtarg.test \
@@ -645,6 +646,7 @@ $(srcdir)/Makefile.in:  Makefile.am  $(am__configure_deps)
        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/Makefile'; \
        cd $(top_srcdir) && \
          $(AUTOMAKE) --gnu  tests/Makefile
+.PRECIOUS: Makefile
 Makefile:  $(srcdir)/Makefile.in $(top_builddir)/config.status
        @case '$?' in \
          *config.status*) \
diff --git a/tests/subpkg2.test b/tests/subpkg2.test
new file mode 100755 (executable)
index 0000000..1c58aae
--- /dev/null
@@ -0,0 +1,72 @@
+#! /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.
+
+# Try a DIST_SUBDIRS subpackage with no SUBDIRS.
+# Report from Gary V. Vaughan.
+
+. ./defs || exit 1
+
+set -e
+
+mkdir m4
+
+cat >m4/foo.m4 <<'EOF'
+AC_DEFUN([FOO],[
+  AC_OUTPUT
+])
+EOF
+
+cat >>configure.in <<'END'
+AC_CONFIG_SUBDIRS([sub])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'EOF'
+DIST_SUBDIRS = sub
+dist-hook:
+       test -f $(distdir)/sub/script.in
+EOF
+
+mkdir sub
+
+cat >sub/configure.ac <<'EOF'
+AC_INIT([sub], [2.3])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([script])
+FOO
+EOF
+
+: >sub/script.in
+echo ACLOCAL_AMFLAGS = -I ../m4 > sub/Makefile.am
+
+$ACLOCAL -I m4
+$AUTOCONF
+$AUTOMAKE
+
+cd sub
+$ACLOCAL -I ../m4
+$FGREP 'm4_include([../m4/foo.m4])' aclocal.m4
+$AUTOCONF
+$AUTOMAKE -Wno-override
+cd ..
+
+./configure
+$MAKE distcheck