From c62da4c86a140130c033bd34cdcbbaf14f001f47 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 25 Jul 2002 21:28:41 +0000 Subject: [PATCH] * automake.in (read_am_file): Escaped newlines in comments are not portable. If a comment line doesn't start with a `#', add it. * tests/comment6.test: Ensure this is done. --- ChangeLog | 6 ++++++ automake.in | 8 ++++++++ tests/comment6.test | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 26fc8caef..e737dd386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-07-25 Alexandre Duret-Lutz + + * automake.in (read_am_file): Escaped newlines in comments are not + portable. If a comment line doesn't start with a `#', add it. + * tests/comment6.test: Ensure this is done. + 2002-07-24 Alexandre Duret-Lutz Fix failures reported by Patrick Welche on NetBSD. diff --git a/automake.in b/automake.in index b771965ce..313839c00 100755 --- a/automake.in +++ b/automake.in @@ -7361,6 +7361,14 @@ sub read_am_file ($) } elsif ($prev_state == IN_COMMENT) { + # If the line doesn't start with a `#', add it. + # We do this because a continuated comment like + # # A = foo \ + # bar \ + # baz + # is not portable. BSD make doesn't honor + # escaped newlines in comments. + s/^#?/#/; $comment .= $spacing . $_; } else # $prev_state == IN_VAR_DEF diff --git a/tests/comment6.test b/tests/comment6.test index 382139403..4438d6eb9 100755 --- a/tests/comment6.test +++ b/tests/comment6.test @@ -31,6 +31,9 @@ $AUTOMAKE ./configure $MAKE +grep '# SOME_FILES' Makefile +grep '# *file3' Makefile + cat > Makefile.am << 'EOF' all-local: @echo Good @@ -44,3 +47,5 @@ EOF $AUTOMAKE ./configure $MAKE +grep '# SOME_FILES' Makefile +grep '# *file3' Makefile -- 2.47.2