]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] cleanup: remove a workaround for BSD make (comments continuation)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 20 May 2012 08:52:21 +0000 (10:52 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 07:25:32 +0000 (09:25 +0200)
* automake.in (read_am_file) [$prev_state == IN_COMMENT]: GNU make always
honors escaped newlines in comments, so we don't need to have a workaround
for when that might not be the case.
* t/comment6.sh: Adjust and enhance.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
t/comment6.sh

index 4351c14a89f1115eade4c8aa7d51aae4aab90298..f2aa402ae582da0f19ec9f4bfa8cc397334a1f13 100644 (file)
@@ -6394,14 +6394,6 @@ sub read_am_file ($$)
            }
            elsif ($prev_state == IN_COMMENT)
            {
-               # If the line doesn't start with a '#', add it.
-               # We do this because a continued 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
index 9fd8d10699443fb69f0a26bdf86da3acccb9e40a..19fc43b76412f0380b5e6abe2fa218d27b3472b8 100755 (executable)
@@ -24,6 +24,8 @@ cat >> configure.ac <<'EOF'
 AC_OUTPUT
 EOF
 
+SOME_FILES=; unset SOME_FILES # Avoid spurious environment interference.
+
 ## There are two tests: one with backslashed comments at the top
 ## of the file, and one with a rule first.  This is because
 ## Comments at the top of the file are handled specially
@@ -35,34 +37,41 @@ cat > Makefile.am << 'EOF'
          file2 \
          file3
 
-all-local:
-       @echo Good
-
+.PHONY: test
+test:
+       test -z '$(SOME_FILES)'
 EOF
 
+do_check ()
+{
+  $MAKE test
+  grep '^# SOME_FILES =' Makefile
+  # No useless munging please.
+  grep '#.*file[123]' Makefile && Exit 1
+  :
+}
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 ./configure
-$MAKE
-
-grep '# SOME_FILES' Makefile
-grep '# *file3' Makefile
+do_check
 
 cat > Makefile.am << 'EOF'
-all-local:
-       @echo Good
+test: test2
+.PHONY: test test2
 
 # SOME_FILES = \
          file1 \
          file2 \
          file3
+
+test:
+       test -z '$(SOME_FILES)'
 EOF
 
 $AUTOMAKE
-./configure
-$MAKE
-grep '# SOME_FILES' Makefile
-grep '# *file3' Makefile
+./config.status
+do_check
 
 :