lines as VAR_PRETTY to work around tools with limited input width.
* tests/longlin2.test: New file.
* tests/Makefile.am (TESTS): Add it.
Report from Albert Chin.
+2005-02-12 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * automake.in (read_am_file): Define variable containing long
+ lines as VAR_PRETTY to work around tools with limited input width.
+ * tests/longlin2.test: New file.
+ * tests/Makefile.am (TESTS): Add it.
+ Report from Albert Chin.
+
2005-02-09 Alexandre Duret-Lutz <adl@gnu.org>
Fix for PR automake/447:
my $comment = '';
my $blank = 0;
my $saw_bk = 0;
+ my $var_look = VAR_ASIS;
use constant IN_VAR_DEF => 0;
use constant IN_RULE_DEF => 1;
$last_var_value = $3;
$last_where = $where->clone;
if ($3 ne '' && substr ($3, -1) eq "\\")
- {
+ {
# We preserve the `\' because otherwise the long lines
# that are generated will be truncated by broken
# `sed's.
$last_var_value = $3 . "\n";
- }
+ }
+ # Normally we try to output variable definitions in the
+ # same format they were input. However, POSIX compliant
+ # systems are not required to support lines longer than
+ # 2048 bytes (most notably, some sed implementation are
+ # limited to 4000 bytes, and sed is used by config.status
+ # to rewrite Makefile.in into Makefile). Moreover nobody
+ # would really write such long lines by hand since it is
+ # hardly maintainable. So if a line is longer that 1000
+ # bytes (an arbitrary limit), assume it has been
+ # automatically generated by some tools, and flatten the
+ # variable definition. Otherwise, keep the variable as it
+ # as been input.
+ $var_look = VAR_PRETTY if length ($last_var_value) >= 1000;
if (!/\\$/)
{
Automake::Variable::define ($last_var_name, VAR_MAKEFILE,
$last_var_type, $cond,
$last_var_value, $comment,
- $last_where, VAR_ASIS)
+ $last_where, $var_look)
if $cond != FALSE;
$comment = $spacing = '';
+ $var_look = VAR_ASIS;
}
}
elsif (/$INCLUDE_PATTERN/o)
listval.test \
location.test \
longline.test \
+longlin2.test \
ltcond.test \
ltcond2.test \
ltconv.test \
listval.test \
location.test \
longline.test \
+longlin2.test \
ltcond.test \
ltcond2.test \
ltconv.test \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2005 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Long lines should be wrapped.
+# Report from Albert Chin.
+
+. ./defs || exit 1
+
+set -e
+
+n=1
+files=
+match=
+while test $n -le 100
+do
+ files="$files filename$n"
+ match="..........$match"
+ n=`expr $n + 1`
+done
+files2=`echo "$files" | sed s/filename/filenameb/g`
+
+cat >Makefile.am <<EOF
+FOO = $files $files2 \
+ grepme
+EOF
+
+# The `FOO = ...' line is 2293-byte long. More than what a POSIX
+# conforment system is expected to support.
+
+# (It's OK if grep truncates the long line.)
+grep $match Makefile.am
+
+$ACLOCAL
+$AUTOMAKE
+
+grep $match Makefile.in && exit 1
+grep 'filenameb100 grepme' Makefile.in