From 3e9f6b468b8515e155280c414fdff64bd78e27f4 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Wed, 2 Jan 2002 15:52:31 +0000 Subject: [PATCH] * tests/comment4.test: New file. * tests/Makefile.am (TESTS): Add command4.test. Fix for comment4.test: * automake.in (read_am_file): Output leading comments only when encountering white lines. --- ChangeLog | 9 +++++++++ Makefile.in | 1 - automake.in | 10 ++++++---- lib/Automake/Makefile.in | 2 +- lib/Makefile.in | 2 +- lib/am/Makefile.in | 2 +- m4/Makefile.in | 2 +- tests/Makefile.am | 1 + tests/Makefile.in | 2 +- tests/comment4.test | 25 +++++++++++++++++++++++++ 10 files changed, 46 insertions(+), 10 deletions(-) create mode 100755 tests/comment4.test diff --git a/ChangeLog b/ChangeLog index fc65a7d48..abbcce833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-12-29 Alexandre Duret-Lutz + + * tests/comment4.test: New file. + * tests/Makefile.am (TESTS): Add command4.test. + + Fix for comment4.test: + * automake.in (read_am_file): Output leading comments only when + encountering white lines. + 2002-01-01 Tom Tromey For PR automake/234: diff --git a/Makefile.in b/Makefile.in index dcc9a1264..335232aea 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ diff --git a/automake.in b/automake.in index 00c99f6bf..b2e0c3e25 100755 --- a/automake.in +++ b/automake.in @@ -6802,6 +6802,12 @@ sub read_am_file ($) # Stick a single white line before the incoming macro or rule. $spacing = "\n"; $blank = 1; + # Flush all comments seen so far. + if ($comment ne '') + { + $output_vars .= $comment; + $comment = ''; + } } elsif (/$COMMENT_PATTERN/o) { @@ -6818,10 +6824,6 @@ sub read_am_file ($) } } - $output_vars .= $comment . "\n"; - $comment = ''; - $spacing = "\n"; - # We save the conditional stack on entry, and then check to make # sure it is the same on exit. This lets us conditonally include # other files. diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 42e775677..8d1f41f51 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ @@ -151,6 +150,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: diff --git a/lib/Makefile.in b/lib/Makefile.in index 31596d155..3c1d1925b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ @@ -286,6 +285,7 @@ install-am: all-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index 6747875c7..fd8bbe25b 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ @@ -159,6 +158,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: diff --git a/m4/Makefile.in b/m4/Makefile.in index 3b441911d..938a8a136 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ @@ -159,6 +158,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: diff --git a/tests/Makefile.am b/tests/Makefile.am index 6f3d62ad2..b57a1ef4b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,6 +54,7 @@ colon7.test \ comment.test \ comment2.test \ comment3.test \ +comment4.test \ compile_f_c_cxx.test \ cond.test \ cond2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index fb04f2214..a906d27a7 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - SHELL = @SHELL@ srcdir = @srcdir@ @@ -127,6 +126,7 @@ colon7.test \ comment.test \ comment2.test \ comment3.test \ +comment4.test \ compile_f_c_cxx.test \ cond.test \ cond2.test \ diff --git a/tests/comment4.test b/tests/comment4.test new file mode 100755 index 000000000..7f571ef8d --- /dev/null +++ b/tests/comment4.test @@ -0,0 +1,25 @@ +#! /bin/sh +# Make sure commented variables are output near their comments. + +. $srcdir/defs || exit 1 + +cat >> configure.in <<'EOF' +AC_OUTPUT +EOF + +cat > Makefile.am << 'EOF' +# UnIqUe_COPYRIGHT_BOILERPLATE + +# UnIqUe_MUMBLE_COMMENT +mumble = UnIqUe_MUMBLE_VALUE +EOF + +set -e +$ACLOCAL +$AUTOMAKE +# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file +test `sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' Makefile.in \ + | wc -l` -le 30 +# UnIqUe_MUMBLE_COMMENT should appear right before the mumble declaration. +test `sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' Makefile.in \ + | wc -l` -eq 2 -- 2.47.2