]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
deps: 'subdir-object' option now works when foo_SOURCES contains $(var)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 24 Dec 2014 09:57:17 +0000 (10:57 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 6 Jan 2015 10:24:58 +0000 (11:24 +0100)
Following a suggestions of Johan Kristensen, we have config.status use
'make' invocations rather than Makefile-parsing 'sed' hacks to bootstrap
the dependency-tracking '.Po' and '.Plo' makefile fragments. To handle
the inclusion of such files that are still missing when make is first
we basically generate a temporary Makefile without these includes, and
call 'make' on that Makefile.

This fixes the serious bug bug#13928, which was an hard blocker to make the
behavior mandated by the 'subdir-object' active by default (which we want
to do in Automake 2.0).

The issue has also been reported in bug#15919.

* NEWS, THANKS: Update.
* bin/automake.in (handle_languages): Add a trailing "marking" comment
("# am--include-marker") to the generated Makefile lines issuing 'include'
directives for the dependency-tracking '.Po' and '.Plo' makefile fragments.
Also rename the generated Makefile variable 'am__depfiles_maybe' to the
clearer 'am__maybe_remake_depfiles'.
Minor unrelated refactoring.
* lib/am/configure.am: Adjust to account for the 'am__depfiles_maybe' ->
'am__maybe_remake_depfiles' renaming.
* lib/am/depend.am: Add rules to generate a dummy version of all the
dependency-tracking '.Po' and '.Plo' makefile fragments.
* m4/depout.m4: Use make invocations rather than Makefile-parsing sed hacks
to bootstrap the dependency-tracking '.Po' and '.Plo' makefile fragments.
We still use some sed trickery in order to remove the inclusion of the
still non existing .Po and .Plo files from the Makefile we invoke make
upon; this is done stripping lines that contain the magic string
"# am--include-marker".
* m4/make.m4 (AM_MAKE_INCLUDE): Given that now automake generates Makefiles
containing include statements with trailing comment, adjust the checks done
here to make sure $MAKE support that; e.g., "include foo.mk # comment"
rather than just "include foo.mk".
Also refactor and adjust to leave better debugging info in config.log.
* t/postproc.sh: Rename ...
* t/depend-postproc.sh: ... to this, and adjust and enhance.
* t/list-of-tests.mk (handwritten_TESTS): Adjust.
(XFAIL_TESTS): Remove 't/subobj-indir-pr13928.sh', which is now succeeding.
* t/subobj-indir-pr13928.sh: Simplify slightly, now that we expect it to
pass.
* t/depcomp8a.sh: Adjust grepping check to account for the changes in
the generated Makefile, and tp be somewhat more robust in light of possible
future modifications.
* t/depcomp8b.sh: Likewise.
* t/subobj11b.sh: Likewise.
* t/subobj11c.sh: Likewise.
* t/extra-sources.sh: Likewise.
* t/lex-depend-grep.sh: Likewise.
* t/lex-depend-cxx.sh: Add a command to help debugging in case of test
failure.

Helped-by: Johan Kristensen <johankristensen@gmail.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
17 files changed:
NEWS
THANKS
bin/automake.in
lib/am/configure.am
lib/am/depend.am
m4/depout.m4
m4/make.m4
t/depcomp8a.sh
t/depcomp8b.sh
t/depend-postproc.sh [moved from t/postproc.sh with 68% similarity]
t/extra-sources.sh
t/lex-depend-cxx.sh
t/lex-depend-grep.sh
t/list-of-tests.mk
t/subobj-indir-pr13928.sh
t/subobj11b.sh
t/subobj11c.sh

diff --git a/NEWS b/NEWS
index 294d2030b47a4b8376249f96a235a1537bbb2229..226f76c66608771885253f4066ca62ba48a1f9c0 100644 (file)
--- a/NEWS
+++ b/NEWS
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+New in 1.16:
+
+* Bugs fixed:
+
+  - Automatic dependency tracking has been fixed to work also when the
+    subdir-object option is used and some 'foo_SOURCES' definition contains
+    unexpanded references to make variables, as in, e.g.:
+
+        a_src = sources/libs/aaa
+        b_src = sources/bbb
+        foo_SOURCES = $(a_src)/bar.c $(b_src)/baz.c
+
+    With such a setup, the created makefile fragment containing dependency
+    tracking information will be correctly placed under the directories
+    named 'sources/libs/aaa/.deps' and 'sources/bbb/.deps', rather than
+    mistakenly under directories named (literally!) '$(src_a)/.deps' and
+    '$(src_b)/.deps' (this was automake bug#13928).
+
+    Notice that in order to fix this bug we had to slightly change the
+    semantics of how config.status bootstraps the makefile fragments
+    required for the dependency tracking to work: rather than attempting
+    to parse the Makefiles via grep and sed trickeries only, we actually
+    invoke 'make' on a slightly preprocessed version of those Makefiles,
+    using a private target that is only meant to bootstrap the required
+    makefile fragments.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
 New in 1.15:
 
 * Improvements and refactorings in the install-sh script:
diff --git a/THANKS b/THANKS
index b66f744f3b3566719d34e12d1e34a0fd26b1786c..8b87d585b924ed1bb856b629476fa95310971981 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -192,6 +192,7 @@ Joel N. Weber II                nemo@koa.iolani.honolulu.hi.us
 Joerg-Martin Schwarz            jms@jms.prima.ruhr.de
 Johan Dahlin                    jdahlin@async.com.br
 Johan Danielsson                joda@pdc.kth.se
+Johan Kristensen                johankristensen@gmail.com
 Johannes Nicolai                johannes.nicolai@student.hpi.uni-potsdam.de
 John Calcote                    john.calcote@gmail.com
 John F Trudeau                  JohnTrudeau@firsthealth.com
index a3a0aa318db23ffec869085bccb9e71b9d8117d1..681b3d2a5022c0e75e815f7ae46073f7520e8dbc 100644 (file)
@@ -1230,48 +1230,50 @@ sub check_user_variables
 sub handle_languages ()
 {
     if (! option 'no-dependencies')
-    {
-       # Include auto-dep code.  Don't include it if DEP_FILES would
-       # be empty.
-       if (keys %extension_seen && keys %dep_files)
-       {
-           # Set location of depcomp.
-           define_variable ('depcomp',
-                            "\$(SHELL) $am_config_aux_dir/depcomp",
-                            INTERNAL);
-           define_variable ('am__depfiles_maybe', 'depfiles', INTERNAL);
-
-           require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
-
-           my @deplist = sort keys %dep_files;
-           # Generate each 'include' individually.  Irix 6 make will
-           # not properly include several files resulting from a
-           # variable expansion; generating many separate includes
-           # seems safest.
-           $output_rules .= "\n";
-           foreach my $iter (@deplist)
-           {
-               $output_rules .= (subst ('AMDEP_TRUE')
-                                 . subst ('am__include')
-                                 . ' '
-                                 . subst ('am__quote')
-                                 . $iter
-                                 . subst ('am__quote')
-                                 . "\n");
-           }
-
-           # Compute the set of directories to remove in distclean-depend.
-           my @depdirs = uniq (map { dirname ($_) } @deplist);
-           $output_rules .= file_contents ('depend',
-                                           new Automake::Location,
-                                           DEPDIRS => "@depdirs");
-       }
-    }
+      {
+        # Include auto-dep code.  Don't include it if DEP_FILES would
+        # be empty.
+        if (keys %extension_seen && keys %dep_files)
+          {
+            my @dep_files = sort keys %dep_files;
+            # Set location of depcomp.
+            define_variable ('depcomp',
+                             "\$(SHELL) $am_config_aux_dir/depcomp",
+                             INTERNAL);
+            define_variable ('am__maybe_remake_depfiles', 'depfiles', INTERNAL);
+            define_variable ('am__depfiles_remade', "@dep_files", INTERNAL);
+            # Generate each 'include' directive individually.  Several make
+            # implementations (IRIX 6, Solaris 10, FreeBSD 8) will fail to
+            # properly include several files resulting from a variable
+            # expansion. Just Generating many separate includes seems thus
+            # safest.
+            $output_rules .= "\n";
+            foreach my $depfile (@dep_files)
+              {
+                $output_rules .= subst ('AMDEP_TRUE') .
+                                 subst ('am__include') .
+                                 " " .
+                                 subst('am__quote') .
+                                 $depfile .
+                                 subst('am__quote') .
+                                 " " .
+                                 "# am--include-marker\n";
+              }
+
+            require_conf_file ("$am_file.am", FOREIGN, 'depcomp');
+
+            # Compute the set of directories to remove in distclean-depend.
+            my @dep_dirs = uniq (map { dirname ($_) } @dep_files);
+            $output_rules .= file_contents ('depend',
+                                            new Automake::Location,
+                                            DEPDIRS => "@dep_dirs");
+          }
+      }
     else
-    {
-       define_variable ('depcomp', '', INTERNAL);
-       define_variable ('am__depfiles_maybe', '', INTERNAL);
-    }
+      {
+        define_variable ('depcomp', '', INTERNAL);
+        define_variable ('am__maybe_remake_depfiles', '', INTERNAL);
+      }
 
     my %done;
 
index 0f1abac386d2b0999f47816b8e9aa73e2df66cd1..ad6717b41e4b8ee01ede1c9491fcaa1cc89493aa 100644 (file)
@@ -76,10 +76,10 @@ endif %?TOPDIR_P%
 ?TOPDIR_P?         $(SHELL) ./config.status;; \
 ?!TOPDIR_P?        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
+## FIXME: $(am__maybe_remake_depfiles) lets us re-run the rule to create the
 ## .P files.  Ideally we wouldn't have to do this by hand.
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__maybe_remake_depfiles);; \
        esac;
 
 ## Avoid the "deleted header file" problem for the dependencies.
index 54ea220fe13387e790eb3bbb11ac75a2bf2becfc..3711d5d12c8fdda03902858ef741457288001c84 100644 (file)
 
 am__mv = mv -f
 
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+.PHONY: am--depfiles
+
 ## This Makefile depends on Depdirs' files, so we should never
 ## erase them in -am or -recursive rules; that would prevent any other
 ## rules from being recursive (for instance multilib clean rules are
index 0032e8ed4d946d57c31b6f081cb254ff180027a1..c3936a71d044eb2458417b42383730f0ec79d5e8 100644 (file)
@@ -6,7 +6,6 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -14,49 +13,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -65,11 +56,10 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
index 704e32fdd9f10b57095a9aa187d33b7d45f514ac..fff073329787eb3d4b942f025d3fcdcdb5445b5d 100644 (file)
@@ -8,42 +8,35 @@
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
index 5f14ee09a9cf150d9bf8c33bbf9a316c6228abc2..07bbfc1fd33e56aa6c35128a965176712fe9f253 100644 (file)
@@ -51,10 +51,10 @@ $ACLOCAL
 # FIXME: stop disabling the warnings in the 'unsupported' category
 # FIXME: once the 'subdir-objects' option has been mandatory.
 $AUTOMAKE -a -Wno-unsupported
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Po' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Po' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
 
 $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
@@ -68,10 +68,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 echo AUTOMAKE_OPTIONS = subdir-objects >> Makefile.am
 
 $AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
-$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Po' Makefile.in
+grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Po' Makefile.in
+$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
 
 $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
index 8dd86a30818192bb033110ca501544df769fec44..3f7f082441a8f3a76f01393de231fcf584a10f4f 100644 (file)
@@ -48,10 +48,10 @@ $ACLOCAL
 # FIXME: stop disabling the warnings in the 'unsupported' category
 # FIXME: once the 'subdir-objects' option has been mandatory.
 $AUTOMAKE -a -Wno-unsupported
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*\./\$(DEPDIR)/bar\.P' Makefile.in
-grep 'include.*/\./\$(DEPDIR)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
+grep '\./\$(DEPDIR)/bar\.Plo' Makefile.in
+grep '/\./\$(DEPDIR)' Makefile.in && exit 1
 
 $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
@@ -64,10 +64,10 @@ DISTCHECK_CONFIGURE_FLAGS='--enable-dependency-tracking' $MAKE distcheck
 echo AUTOMAKE_OPTIONS += subdir-objects >> Makefile.am
 
 $AUTOMAKE
-grep include Makefile.in # For debugging.
-grep 'include.*\./\$(DEPDIR)/foo\.P' Makefile.in
-grep 'include.*[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.P' Makefile.in
-$EGREP 'include.*/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+grep '\./\$(DEPDIR)/foo\.Plo' Makefile.in
+grep '[^a-zA-Z0-9_/]sub/\$(DEPDIR)/bar\.Plo' Makefile.in
+$EGREP '/(\.|sub)/\$\(DEPDIR\)' Makefile.in && exit 1
 
 $AUTOCONF
 # Don't reject slower dependency extractors, for better coverage.
similarity index 68%
rename from t/postproc.sh
rename to t/depend-postproc.sh
index 94909ce15b8b8fe74bd18dd9c4a97871dc5609d8..1411783e04bbadc08210201303d330e4bdcb327d 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Check to make sure we recognize a Makefile.in, even if post-processed
-# and renamed.
+# and renamed.  The particularly tricky code for automatic dependency
+# tracking support used to have issues with that.
 
 required=cc
 . test-init.sh
 
-cat >configure.ac <<END
+cat > configure.ac <<END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
 AC_PROG_CC
 AC_CONFIG_FILES([myMakefile])
+dnl: AC_CONFIG_LINKS([Makefile:Makefile])
 AC_OUTPUT
 END
 
-cat > myMakefile.am << 'END'
+cat > myMakefile.am <<'END'
 bin_PROGRAMS = fred
 fred_SOURCES = fred.c
 END
@@ -45,4 +47,25 @@ cat myMakefile.old >> myMakefile.in
 
 test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
 
+$sleep
+
+cat > Makefile <<'END'
+include myMakefile
+END
+
+sed 's/^dnl: *//' configure.ac >t
+mv -f t configure.ac
+
+$MAKE myMakefile Makefile
+
+rm -rf .deps _deps
+./config.status
+
+test ! -e fred.c
+echo 'int main (void) { return 0; }' > fred.c
+
+$MAKE
+test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1
+$MAKE distcheck
+
 :
index cd276dbcc9cd6c668751d29f70fa88f853e40a1c..cbffc9080e5de48939f81a6d110ec34a5bb649f5 100644 (file)
@@ -21,7 +21,7 @@
 
 echo AC_PROG_CC >> configure.ac
 
-cat > Makefile.am << 'END'
+cat > Makefile.am <<'END'
 bin_PROGRAMS = www
 www_SOURCES = www.c
 EXTRA_www_SOURCES = xtra.c
@@ -31,6 +31,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '@am__include@ .*/xtra\.P' Makefile.in
+grep '@am__include@ .*/xtra\.Po' Makefile.in
+grep '^am__depfiles_remade =.*/xtra.Po' Makefile.in
 
 :
index fc89c8aa5817960ae7a87f5b967f6a30f4f478f9..79a2f3b7767a119f1f0c5c525a92b971b97cf13c 100644 (file)
@@ -82,6 +82,11 @@ $AUTOCONF
 # using slow dependency extractors.
 ./configure --enable-dependency-tracking
 
+# For debugging.
+for f in $(find . -name '*.Po'); do
+  cat $f
+done
+
 $MAKE test-deps-exist
 $MAKE
 
index dedea2d31da805fbe6919284084956aede6f7964..70e5cb8d2c374dd2c1b481a44c1847f9882e9b76 100644 (file)
@@ -40,7 +40,7 @@ $AUTOMAKE -a
 $EGREP '([mj]oe|_[01234]|include|\.P)' Makefile.in # For debugging.
 
 for x in joe moe _0 _1 _2 _3 _4; do
-  grep "include.*$x\.Po" Makefile.in
+  $EGREP '\$\(DEPDIR\)/'"$x"'\.Po( |$)' Makefile.in
 done
 
 :
index 01c1a53aeb008ae4e007d1797cf804037d23613b..862bb29d24b3adf821efd74954200f0c7a3aca8b 100644 (file)
@@ -41,7 +41,6 @@ t/java-nobase.sh \
 t/objext-pr10128.sh \
 t/remake-timing-bug-pr8365.sh \
 t/lex-subobj-nodep.sh \
-t/subobj-indir-pr13928.sh \
 t/subobj-vpath-pr13928.sh \
 t/remake-am-pr10111.sh \
 t/remake-m4-pr10111.sh \
@@ -391,6 +390,7 @@ t/depend3.sh \
 t/depend4.sh \
 t/depend5.sh \
 t/depend6.sh \
+t/depend-postproc.sh \
 t/deprecated-acinit.sh \
 t/destdir.sh \
 t/dir-named-obj-is-bad.sh \
@@ -866,7 +866,6 @@ t/posixsubst-programs.sh \
 t/posixsubst-scripts.sh \
 t/posixsubst-sources.sh \
 t/posixsubst-tests.sh \
-t/postproc.sh \
 t/ppf77.sh \
 t/pr2.sh \
 t/pr9.sh \
index afad53b21425e5830457bfe7da330ca2d1a26d30..9a7116d35aec3d36f1ef179041ff3e7cfb4b204a 100644 (file)
@@ -38,7 +38,9 @@ END
 mkdir s
 echo 'int main(void) { return 0; }' > s/foo.c
 
-$ACLOCAL && $AUTOCONF && $AUTOMAKE -a || fatal_ "autotools failed"
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
 
 ./configure
 $MAKE
index db29e5e58932f9e731f64a64f416dd5e6c6bb51a..12e2216d229996166eeb2af5324fb4bc78d93d97 100644 (file)
@@ -56,9 +56,9 @@ END
 $ACLOCAL
 $AUTOMAKE -a
 
-# Be lax in the regexp, to account for automake conditionals, the
-# use of @am__include@, and similar stuff.
-grep 'include.*//.*foobar' Makefile.in && exit 1
+grep '\.P' Makefile.in # For debugging.
+
+grep '//.*foobar\.P' Makefile.in && exit 1
 
 # These checks depend on automake internals, but presently this is
 # the only way to test the code path we are interested in.
@@ -71,12 +71,12 @@ for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
   esac
   # Be a little lax in the regexp, to account for automake conditionals,
   # quoting, and similar stuff.
-  grep "^[^/]*am__include[^/]*//server/$d\\\$(DEPDIR)/$b\\.[^/]*$" Makefile.in
+  grep "[      ]//server/$d\\\$(DEPDIR)/$b\\.Po" Makefile.in
 done
 
 # Sanity checks.
 for i in 0 1 2 3 4 5 6 7 8 9; do
-  grep "am__include.*/foobar$i\\." Makefile.in
+  grep "\$(DEPDIR)/foobar$i\\.Po" Makefile.in
 done
 
 :
index 652a31d5637bcfa236d453e76c51155c6deeaa5d..79abef96cf6c2748fce40dc38547297d40c1ea32 100644 (file)
@@ -43,6 +43,6 @@ $AUTOMAKE -a
 #
 # FIXME: Are we sure this is the most sensible output in our situation?
 #
-grep '^[^/]*am__include[^/]*//\$(DEPDIR)/zardoz\.[^/]*$' Makefile.in
+grep 'am__depfiles_remade =.* //\$(DEPDIR)/zardoz\.Po' Makefile.in
 
 :