Fix config.status depfiles failure.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 21 Dec 2008 16:33:17 +0000 (17:33 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 21 Dec 2008 16:34:15 +0000 (17:34 +0100)
* m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Commands are
again a single shell brace group, so they are correctly skipped
when dependencies are turned off.  The failure is noisy with
ksh only.
* tests/depend6.test: New test.
* tests/Makefile.am: Adjust.
* THANKS: Update.
Report and different suggested patch by Markus Duft.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
m4/depout.m4
tests/Makefile.am
tests/Makefile.in
tests/depend6.test [new file with mode: 0755]

index 4b5809b3f8b534a17a233511e54c6df9774f6b8e..94b447635e6cfa51ef9a4e5638232dd9128b6390 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-12-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix config.status depfiles failure.
+       * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Commands are
+       again a single shell brace group, so they are correctly skipped
+       when dependencies are turned off.  The failure is noisy with
+       ksh only.
+       * tests/depend6.test: New test.
+       * tests/Makefile.am: Adjust.
+       * THANKS: Update.
+       Report and different suggested patch by Markus Duft.
+
 2008-12-21  Zoltan Rado  <z.rado@chello.hu>  (tiny change)
 
        * doc/automake.texi (DESTDIR): Fix a couple of typos.
diff --git a/THANKS b/THANKS
index 10d4ddc1e8f8f0f0ec1e5905d48ceabbdcca3bb0..f617d1f3ec98647b270c3204f7a81b80b3be4f8d 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -190,6 +190,7 @@ Mark Galassi                rosalia@nis.lanl.gov
 Mark Mitchell          mark@codesourcery.com
 Mark Phillips          msp@nortelnetworks.com
 Markku Rossi           mtr@ngs.fi
+Markus Duft            Markus.Duft@salomon.at
 Markus F.X.J. Oberhumer        k3040e4@wildsau.idv-edu.uni-linz.ac.at
 Martin Bravenboer      martin@cs.uu.nl
 Martin Frydl           martin@idoox.com
index 3f5d6cf1a5437a9109b7288d91999430cf7ddda9..80a3926f17f4bd89bdae9341de638d09a3d855b9 100644 (file)
@@ -7,59 +7,61 @@
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 4
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 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
-shift
-for 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
-  # 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"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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"
+[{
+  # Autoconf 2.62 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
+  shift
+  for 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
+    # 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"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
index cac16a1ce33f8781bdfa6d7caaca35ff35f29bb9..c2ace7843e5d68f1c21cd3305ae53f42c1e49e53 100644 (file)
@@ -223,6 +223,7 @@ depend2.test \
 depend3.test \
 depend4.test \
 depend5.test \
+depend6.test \
 destdir.test \
 dirforbid.test \
 dirlist.test \
index 993dd7c41fd8553bf1318a0a6dda7a3a12eb762b..f71bb7cab84c9366d62d09b2fba97214c6debcda 100644 (file)
@@ -377,6 +377,7 @@ depend2.test \
 depend3.test \
 depend4.test \
 depend5.test \
+depend6.test \
 destdir.test \
 dirforbid.test \
 dirlist.test \
diff --git a/tests/depend6.test b/tests/depend6.test
new file mode 100755 (executable)
index 0000000..6a1595c
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh
+# Copyright (C) 2008  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 3, 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 for _AM_OUTPUT_DEPENDENCY_COMMANDS grouping bug,
+# reported by Markus Duft.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in << END
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << END
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c foo.h
+END
+
+cat >foo.c << END
+#include "foo.h"
+END
+: >foo.h
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+./configure --disable-dependency-tracking 2>stderr || { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep shift stderr && Exit 1
+: