automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-370-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-370-g67ca694
Date: Wed, 01 Jun 2011 18:24:58 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=67ca6940688ed14d84642b34df4f28a07b9d9f00

The branch, maint has been updated
       via  67ca6940688ed14d84642b34df4f28a07b9d9f00 (commit)
       via  bee9871d6a8743b7f01789f196c214354e7f612a (commit)
      from  d235db335eaae0934ede72698395f8591d115f9a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   17 ++++
 Makefile.in                                        |    2 +-
 lib/am/configure.am                                |    2 +-
 tests/Makefile.am                                  |    4 +
 tests/Makefile.in                                  |    4 +
 tests/defs.in                                      |   10 +++
 .../{gcj6.test => remake-subdir-from-subdir.test}  |   43 ++++++-----
 tests/remake-subdir-gnu.test                       |   80 +++++++++++++++++++
 ...-acconfig-no-subdir.test => remake-subdir.test} |   65 +++++++++++-----
 tests/remake-subdir2.test                          |   82 ++++++++++++++++++++
 10 files changed, 266 insertions(+), 43 deletions(-)
 copy tests/{gcj6.test => remake-subdir-from-subdir.test} (58%)
 create mode 100755 tests/remake-subdir-gnu.test
 copy tests/{autodist-acconfig-no-subdir.test => remake-subdir.test} (51%)
 create mode 100755 tests/remake-subdir2.test

diff --git a/ChangeLog b/ChangeLog
index cd0f593..fd1312e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2011-05-29  Stefano Lattarini  <address@hidden>
 
+       remake: behave better with non-GNU make in subdirectories
+       Currently, with every decent make program, it is possible to
+       rebuild out-of-date autotools-generated files with a simple
+       "make Makefile" -- but for this to work reliably with non-GNU
+       make implementations, the command must be issued from the
+       top-level directory.  This patch removes such limitation.
+       * lib/am/configure.am (am--refresh): Depend on `%MAKEFILE%'.
+       * tests/defs.in (using_gmake): New function, backported from the
+       `master' branch (and simplified).
+       * tests/remake-subdir.test: New test.
+       * tests/remake-subdir2.test: Likewise.
+       * tests/remake-subdir-gnu.test: Likewise.
+       * tests/remake-subdir-from-subdir.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-05-29  Stefano Lattarini  <address@hidden>
+
        automake, aclocal: honour configure-time AUTOCONF and AUTOM4TE
        Currently, the Automake's own configure script allow definition
        of AUTOCONF and AUTOM4TE, expected to point respectively to an
diff --git a/Makefile.in b/Makefile.in
index 326530a..c530c01 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -377,7 +377,7 @@ texinfo.tex
 all: all-recursive
 
 .SUFFIXES:
-am--refresh:
+am--refresh: Makefile
        @:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
        @for dep in $?; do \
diff --git a/lib/am/configure.am b/lib/am/configure.am
index e9299d6..d00846a 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -22,7 +22,7 @@
 ## %MAKEFILE% is updated before considering the am--refresh target.
 if %?TOPDIR_P%
 .PHONY: am--refresh
-am--refresh:
+am--refresh: %MAKEFILE%
        @:
 endif %?TOPDIR_P%
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 49d8942..33ae8bc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -654,6 +654,10 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake-subdir-from-subdir.test \
+remake-subdir-gnu.test \
+remake-subdir.test \
+remake-subdir2.test \
 pr8365-remake-timing.test \
 regex.test \
 req.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index d4b7c78..d7a1761 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -925,6 +925,10 @@ remake4.test \
 remake5.test \
 remake6.test \
 remake7.test \
+remake-subdir-from-subdir.test \
+remake-subdir-gnu.test \
+remake-subdir.test \
+remake-subdir2.test \
 pr8365-remake-timing.test \
 regex.test \
 req.test \
diff --git a/tests/defs.in b/tests/defs.in
index f6f12ec..87a350d 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -515,6 +515,16 @@ is_newest ()
   test -z "$is_newest_files"
 }
 
+# using_gmake
+# -----------
+# Return success if $MAKE is GNU make, return failure otherwise.
+using_gmake ()
+{
+  # Use --version AND -v, because SGI Make doesn't fail on --version.
+  # Also grep for GNU because newer versions of FreeBSD make do
+  # not complain about `--version' (they seem to silently ignore it).
+  $MAKE --version -v | grep GNU
+}
 
 # AUTOMAKE_run status [options...]
 # --------------------------------
diff --git a/tests/gcj6.test b/tests/remake-subdir-from-subdir.test
similarity index 58%
copy from tests/gcj6.test
copy to tests/remake-subdir-from-subdir.test
index be5f49c..1e369f8 100755
--- a/tests/gcj6.test
+++ b/tests/remake-subdir-from-subdir.test
@@ -14,40 +14,43 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# AM_PROG_GCJ should cause OBJEXT and EXEEXT to be set.
+# Check that remake rules works for adding a new subdirectory from a
+# pre-existing subdirectory.
 
-required='gcj'
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in << 'END'
-AM_PROG_GCJ
+cat >> configure.in <<'END'
+m4_include([subdirs.m4])
+AC_SUBST([MAGIC], [magic])
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-noinst_PROGRAMS = test
-test_SOURCES = Test.java
-test_LDFLAGS = --main=Test
-END
+echo 'AC_CONFIG_FILES([sub/Makefile])' > subdirs.m4
+echo 'SUBDIRS = sub' > Makefile.am
 
-cat >Test.java << 'END'
-public class Test {
-    public static void main(String[] argv) {
-        System.out.println("Hello, automake!");
-    }
-}
-END
+mkdir sub
+: > sub/Makefile.am
 
 $ACLOCAL
-$AUTOMAKE
 $AUTOCONF
+$AUTOMAKE
+
 ./configure
+$MAKE
 
-# These fail without e.g., AC_PROG_CC.
+cd sub
+$sleep
+echo 'AC_CONFIG_FILES([sub/subsub/Makefile])' >> ../subdirs.m4
+echo 'SUBDIRS = subsub' >> Makefile.am
+mkdir subsub
+cat > subsub/Makefile.am <<'END'
+all-local:
+       : > ok-it-works
+END
+using_gmake || $MAKE Makefile
 $MAKE
-grep "OBJEXT = " Makefile
-grep "EXEEXT = " Makefile
+test -f subsub/ok-it-works
 
 :
diff --git a/tests/remake-subdir-gnu.test b/tests/remake-subdir-gnu.test
new file mode 100755
index 0000000..cc683f3
--- /dev/null
+++ b/tests/remake-subdir-gnu.test
@@ -0,0 +1,80 @@
+#! /bin/sh
+# Copyright (C) 2011 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 2, 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/>.
+
+# Check that remake rules works from subdirectories, even using
+# `GNUmakefile' as makefiles name.  This obviously requires GNU
+# make.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure GNUmakefile.in GNUmakefile \
+                sub/GNUmakefile.in sub/GNUmakefile
+}
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([GNUmakefile sub/GNUmakefile])
+AC_SUBST([MAGIC], [magic])
+AC_OUTPUT
+END
+
+cat > GNUmakefile.am <<'END'
+SUBDIRS = sub
+END
+
+mkdir sub
+: > sub/GNUmakefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$MAKE
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 GNUmakefile
+$FGREP $magic1 sub/GNUmakefile
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> GNUmakefile.am
+$MAKE
+cd ..
+debug_info
+$FGREP $magic2 sub/GNUmakefile
+$FGREP $magic2 sub/GNUmakefile.in
+$FGREP $magic1 sub/GNUmakefile sub/GNUmakefile.in && Exit 1
+$FGREP $magic2 GNUmakefile GNUmakefile.in && Exit 1
+
+:
diff --git a/tests/autodist-acconfig-no-subdir.test b/tests/remake-subdir.test
similarity index 51%
copy from tests/autodist-acconfig-no-subdir.test
copy to tests/remake-subdir.test
index e6bd5a9..5bbc345 100755
--- a/tests/autodist-acconfig-no-subdir.test
+++ b/tests/remake-subdir.test
@@ -14,45 +14,68 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Check that `acconfig.h' is *not* automatically distributed when
-# placed in a subdirectory.
-# Related to automake bug#7819.
+# Check that remake rules works from subdirectories, even with non-GNU
+# make implementations.
 
 . ./defs || Exit 1
 
 set -e
 
-cat >> configure.in <<END
+if using_gmake; then
+  remake=$MAKE
+else
+  remake="$MAKE Makefile"
+fi
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure Makefile.in Makefile sub/Makefile.in sub/Makefile
+}
+
+cat >> configure.in <<'END'
 AC_CONFIG_FILES([sub/Makefile])
+AC_SUBST([MAGIC], [magic])
 AC_OUTPUT
 END
 
 cat > Makefile.am <<'END'
 SUBDIRS = sub
-sub/acconfig.h:
-       echo target $@ should not be built >&2; exit 1
-check-local: distdir
-       ls -l $(distdir)/sub
-       test ! -f $(distdir)/sub/acconfig.h
 END
 
 mkdir sub
-
-cat > sub/Makefile.am <<'END'
-acconfig.h:
-       echo target $@ should not be built >&2; exit 1
-check-local:
-       echo $(DISTFILES) | grep 'acconfig\.h' && exit 1; :
-       echo $(DIST_COMMON) | grep 'acconfig\.h' && exit 1; :
-END
-
-: > sub/acconfig.h
+: > sub/Makefile.am
 
 $ACLOCAL
-$AUTOMAKE
 $AUTOCONF
+$AUTOMAKE
 
 ./configure
-$MAKE check
+$MAKE
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$remake
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 Makefile
+$FGREP $magic1 sub/Makefile
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> Makefile.am
+$remake
+cd ..
+debug_info
+$FGREP $magic2 sub/Makefile
+$FGREP $magic2 sub/Makefile.in
+$FGREP $magic1 sub/Makefile sub/Makefile.in && Exit 1
+$FGREP $magic2 Makefile Makefile.in && Exit 1
 
 :
diff --git a/tests/remake-subdir2.test b/tests/remake-subdir2.test
new file mode 100755
index 0000000..09d1a36
--- /dev/null
+++ b/tests/remake-subdir2.test
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2011 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 2, 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/>.
+
+# Check that remake rules works from subdirectories, even when makefiles
+# are not named "Makefile".
+
+. ./defs || Exit 1
+
+set -e
+
+magic1='::MagicString::One::'
+magic2='__MagicString__Two__'
+
+debug_info ()
+{
+  grep -i magic configure build.in build.mk sub/build.in sub/build.mk
+}
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([build.mk:build.in])
+AC_CONFIG_FILES([sub/build.mk:sub/build.in])
+AC_SUBST([MAGIC], [magic])
+AC_OUTPUT
+END
+
+cat > build.am <<'END'
+AM_MAKEFLAGS = -f build.mk
+SUBDIRS = sub
+END
+
+mkdir sub
+cat > sub/build.am <<'END'
+AM_MAKEFLAGS = -f build.mk
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+ls -l # For debugging.
+
+$MAKE -f build.mk
+debug_info
+
+$sleep
+sed "s|magic|$magic1|" configure.in > t
+mv -f t configure.in
+cd sub
+$MAKE -f build.mk build.mk
+cd ..
+debug_info
+$FGREP $magic1 configure
+$FGREP $magic1 build.mk
+$FGREP $magic1 sub/build.mk
+
+$sleep
+cd sub
+echo MAGIC = $magic2 >> build.am
+$MAKE -f build.mk build.mk
+cd ..
+debug_info
+$FGREP $magic2 sub/build.mk
+$FGREP $magic2 sub/build.in
+$FGREP $magic1 sub/build.in sub/build.mk && Exit 1
+$FGREP $magic2 build.in build.mk && Exit 1
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]