From 71f8b2cb45d2b2638e6e28c44d5113aea6f3e622 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 23 Apr 2002 16:59:58 +0000 Subject: [PATCH] * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Grep the whole file for 'generated by automake', not only the first line. This accounts for post-processed Makefile.in's. * tests/postproc.test: New file. * tests/Makefile.am (TESTS): Add postproc.test. --- ChangeLog | 8 ++++++++ m4/depout.m4 | 8 +++++++- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/postproc.test | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 tests/postproc.test diff --git a/ChangeLog b/ChangeLog index 7710fea..2ba160f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-04-23 Alexandre Duret-Lutz + + * m4/depout.m4 (_AM_OUTPUT_DEPENDENCY_COMMANDS): Grep + the whole file for 'generated by automake', not only the + first line. This accounts for post-processed Makefile.in's. + * tests/postproc.test: New file. + * tests/Makefile.am (TESTS): Add postproc.test. + 2002-04-22 Alexandre Duret-Lutz For PR automake/151 and PR automake/314: diff --git a/m4/depout.m4 b/m4/depout.m4 index ef9a4cf..f1900e1 100644 --- a/m4/depout.m4 +++ b/m4/depout.m4 @@ -25,7 +25,13 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` - if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then + # 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. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue diff --git a/tests/Makefile.am b/tests/Makefile.am index 985004c..e9a8ba4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -251,6 +251,7 @@ pluseq5.test \ pluseq6.test \ pluseq7.test \ pluseq8.test \ +postproc.test \ ppf77.test \ pr2.test \ pr9.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 93d1f61..280033f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -335,6 +335,7 @@ pluseq5.test \ pluseq6.test \ pluseq7.test \ pluseq8.test \ +postproc.test \ ppf77.test \ pr2.test \ pr9.test \ diff --git a/tests/postproc.test b/tests/postproc.test new file mode 100755 index 0000000..aa84026 --- /dev/null +++ b/tests/postproc.test @@ -0,0 +1,33 @@ +#! /bin/sh + +# Check to make sure we recognize a Makefile.in, even if post-processed +# and renamed. + +. $srcdir/defs || exit 1 + +cat >configure.in <<'END' +AC_INIT([mumble], [0.1]) +AM_INIT_AUTOMAKE +AC_PROG_CC +AC_CONFIG_FILES([myMakefile]) +AC_OUTPUT +END + +cat > myMakefile.am << 'END' +bin_PROGRAMS = fred +fred_SOURCES = fred.c +END + +$ACLOCAL || exit 1 +$AUTOCONF || exit 1 +$AUTOMAKE myMakefile || exit 1 + +mv myMakefile.in myMakefile.old +echo '# Post-processed by post-processor 3.14.' > myMakefile.in +cat myMakefile.old >> myMakefile.in + +./configure || exit 1 + +test -f .deps/fred.Po || test -f _deps/fred.Po || exit 1 + +: -- 2.7.4