automake
[Top][All Lists]
Advanced

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

Re: comment handling in aclocal ... bug or feature ?


From: Mike Frysinger
Subject: Re: comment handling in aclocal ... bug or feature ?
Date: Thu, 16 Mar 2006 23:52:00 -0500
User-agent: KMail/1.9.1

On Thursday 16 March 2006 23:24, Ralf Wildenhues wrote:
> Maybe even better if you test the other comment styles as well.

attached
-mike
2006-03-16  Mike Frysinger  <address@hidden>

        * aclocal.in (scan_configure_dep): Ignore ## lines.
        (scan_file): Remove dnl and # comments.
        * tests/commen11.test: New file.
        * tests/Makefile.am (TESTS): Add commen11.test.

--- aclocal.in
+++ aclocal.in
@@ -345,6 +345,8 @@ sub scan_configure_dep ($)
   foreach (split ("\n", $contents))
     {
       ++$line;
+      # Ignore `##' lines.
+      next if /^##/;
       # Remove comments from current line.
       s/\bdnl\b.*$//;
       s/\#.*$//;
@@ -434,6 +436,9 @@ sub scan_file ($$$)
     {
       # Ignore `##' lines.
       next if /^##/;
+      # Remove comments from current line.
+      s/\bdnl\b.*$//;
+      s/\#.*$//;
 
       $contents .= $_;
       my $line = $_;
--- tests/commen11.test
+++ tests/commen11.test
@@ -0,0 +1,33 @@
+#! /bin/sh
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Make sure include() commands in comments are ignored by aclocal.
+# Report from Mike Frysinger.
+
+. ./defs || exit 1
+
+set -e
+
+echo > configure.ac
+echo 'dnl include(__some_really_bogus_nonexistent_file__.m4)' >> configure.ac
+echo '  # include(__some_really_bogus_nonexistent_file__.m4)' >> configure.ac
+echo '##  include(__some_really_bogus_nonexistent_file__.m4)' >> configure.ac
+
+$ACLOCAL
--- tests/Makefile.am
+++ tests/Makefile.am
@@ -102,6 +102,7 @@ comment7.test \
 comment8.test \
 comment9.test \
 commen10.test \
+commen11.test \
 compile.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \

reply via email to

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