automake-patches
[Top][All Lists]
Advanced

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

head-comments.patch


From: Alexandre Duret-Lutz
Subject: head-comments.patch
Date: 29 Dec 2001 13:37:43 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

In the current Automake, the `UnIqUe_MUMBLE_COMMENT' from the
test case is output at the top of the Makefile.in along with
UnIqUe_COPYRIGHT_BOILERPLATE and the mumble= declaration is left
uncommented.

Index: ChangeLog
--- ChangeLog
+++ ChangeLog
@@ -1,1 +1,10 @@
+2001-12-29  Alexandre Duret-Lutz  <address@hidden>
+
+       * 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.
+

Index: Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- Makefile.in 21 Dec 2001 10:07:42 -0000      1.1
+++ Makefile.in 29 Dec 2001 12:36:14 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
Index: automake.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/automake.in,v
retrieving revision 1.1
diff -u -r1.1 automake.in
--- automake.in 21 Dec 2001 10:07:42 -0000      1.1
+++ automake.in 29 Dec 2001 12:34:45 -0000
@@ -6691,6 +6691,12 @@
            # 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)
        {
@@ -6706,10 +6712,6 @@
            last;
        }
     }
-
-    $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
Index: lib/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/lib/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- lib/Makefile.in     21 Dec 2001 10:07:42 -0000      1.1
+++ lib/Makefile.in     29 Dec 2001 12:36:15 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
Index: lib/Automake/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/lib/Automake/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- lib/Automake/Makefile.in    21 Dec 2001 10:07:43 -0000      1.1
+++ lib/Automake/Makefile.in    29 Dec 2001 12:36:15 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
Index: lib/am/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/lib/am/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- lib/am/Makefile.in  21 Dec 2001 10:07:43 -0000      1.1
+++ lib/am/Makefile.in  29 Dec 2001 12:36:15 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
Index: m4/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/m4/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- m4/Makefile.in      21 Dec 2001 10:07:43 -0000      1.1
+++ m4/Makefile.in      29 Dec 2001 12:36:15 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
Index: tests/Makefile.am
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/tests/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- tests/Makefile.am   21 Dec 2001 10:07:44 -0000      1.1
+++ tests/Makefile.am   29 Dec 2001 11:26:01 -0000
@@ -53,6 +53,7 @@
 comment.test \
 comment2.test \
 comment3.test \
+comment4.test \
 compile_f_c_cxx.test \
 cond.test \
 cond2.test \
Index: tests/Makefile.in
===================================================================
RCS file: /home/adl/CVSROOT/automake-20011221-1107/tests/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- tests/Makefile.in   21 Dec 2001 10:07:44 -0000      1.1
+++ tests/Makefile.in   29 Dec 2001 12:36:16 -0000
@@ -13,7 +13,6 @@
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
-
 SHELL = @SHELL@
 
 srcdir = @srcdir@
@@ -126,6 +125,7 @@
 comment.test \
 comment2.test \
 comment3.test \
+comment4.test \
 compile_f_c_cxx.test \
 cond.test \
 cond2.test \
Index: tests/comment4.test
===================================================================
RCS file: tests/comment4.test
diff -N tests/comment4.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/comment4.test 29 Dec 2001 12:01:49 -0000
@@ -0,0 +1,27 @@
+#! /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
+
+#foo
+
+# 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
-- 
Alexandre Duret-Lutz



reply via email to

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