From: Alexandre Duret-Lutz Date: Sat, 24 Apr 2004 14:18:49 +0000 (+0000) Subject: * lib/Automake/VarDef.pm (append): Turn VAR_ASIS variables into X-Git-Tag: Release-1-8b~30 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6ee90220da093caf8072d4863a0252e3ceceb665;p=automake.git * lib/Automake/VarDef.pm (append): Turn VAR_ASIS variables into VAR_PRETTY variables to work around make implementation with limited line length, such as OSF1/Tru64 make. * tests/longline.test: New file. * tests/Makefile.am (TESTS): Add it. * tests/pluseq3.test, tests/pluseq8.test: Adjust. Report from Simon Josefsson. --- diff --git a/ChangeLog b/ChangeLog index b8e7815e..acd88ede 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2004-04-24 Alexandre Duret-Lutz + * lib/Automake/VarDef.pm (append): Turn VAR_ASIS variables into + VAR_PRETTY variables to work around make implementation with + limited line length, such as OSF1/Tru64 make. + * tests/longline.test: New file. + * tests/Makefile.am (TESTS): Add it. + * tests/pluseq3.test, tests/pluseq8.test: Adjust. + Report from Simon Josefsson. + * lib/am/tags.am (TAGS): Pass `.' to Exuberant Ctags if --etags-include is used but no other files are supplied, so it creates the TAGS file anyway. diff --git a/Makefile.in b/Makefile.in index 46ea9099..35e70f73 100644 --- a/Makefile.in +++ b/Makefile.in @@ -304,8 +304,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ @@ -319,9 +321,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) diff --git a/NEWS b/NEWS index 0bc8c04f..e504bda0 100644 --- a/NEWS +++ b/NEWS @@ -46,7 +46,21 @@ New in 1.8a: * Tar format can be chosen with the new options tar-v7, tar-ustar, and tar-pax. The new option filename-length-max=99 helps diagnosing - filenames that are too long for tar-v7. + filenames that are too long for tar-v7. (PR/414) + +* Variables aumented with `+=' are now automatically flattened (i.e., + trailing backslashes removed) and then wrapped around 80 colummns + (adding trailing backslashes). In previous versions, a long series + of + VAR += value1 + VAR += value2 + VAR += value3 + ... + would result in a single-line definition of VAR that could possibly + exceed the maximum line length of some make implementations. + + Non-augmented variables are still output as they are defined in + the Makefile.am. New in 1.8: diff --git a/doc/Makefile.in b/doc/Makefile.in index d29cb3f6..fd86d67c 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -315,9 +315,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index 8f69874c..d36d0740 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -318,8 +318,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ @@ -333,9 +335,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) diff --git a/lib/Automake/VarDef.pm b/lib/Automake/VarDef.pm index ea004440..78ed30ea 100644 --- a/lib/Automake/VarDef.pm +++ b/lib/Automake/VarDef.pm @@ -189,6 +189,9 @@ sub append ($$$) $val .= ' '; } $self->{'value'} = $val . $value; + # Turn ASIS appended variables into PRETTY variables. This is to + # cope with `make' implementation that cannot read very long lines. + $self->{'pretty'} = VAR_PRETTY if $self->{'pretty'} == VAR_ASIS; } =item C<$def-Evalue> diff --git a/lib/Makefile.in b/lib/Makefile.in index 516eb861..1bc991bc 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -294,8 +294,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ + empty_fix=.; \ else \ include_option=--include; \ + empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ @@ -309,9 +311,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) diff --git a/tests/Makefile.am b/tests/Makefile.am index 6e1f6411..56402194 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -306,6 +306,7 @@ lisp5.test \ lisp6.test \ listval.test \ location.test \ +longline.test \ ltcond.test \ ltcond2.test \ ltconv.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 2eaf4db4..36f41c76 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -423,6 +423,7 @@ lisp5.test \ lisp6.test \ listval.test \ location.test \ +longline.test \ ltcond.test \ ltcond2.test \ ltconv.test \ diff --git a/tests/longline.test b/tests/longline.test new file mode 100755 index 00000000..dc435fb8 --- /dev/null +++ b/tests/longline.test @@ -0,0 +1,36 @@ +#! /bin/sh +# Copyright (C) 2004 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 of += should be wrapped. +# Report from Simon Josefsson. + +. ./defs || exit 1 + +set -e + +(echo DUMMY = some_long_filename_1; +for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; +do + echo DUMMY += some_long_filename_$i +done) > Makefile.am + +$ACLOCAL +$AUTOMAKE +test 80 -ge `grep DUMMY Makefile.in | wc -c` diff --git a/tests/pluseq3.test b/tests/pluseq3.test index 2a9eee52..85f31ca7 100755 --- a/tests/pluseq3.test +++ b/tests/pluseq3.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -27,7 +27,7 @@ echo 'AM_CONDITIONAL(CHECK, true)' >> configure.in cat > Makefile.am << 'END' if CHECK -data_DATA = zar +data_DATA = zarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr else data_DATA = endif @@ -50,8 +50,8 @@ set -e $ACLOCAL || exit 1 $AUTOMAKE -grep '^@CHECK_TRUE@data_DATA = zar \\$' Makefile.in -grep '^@CHECK_TRUE@ doz$' Makefile.in +grep '^@CHECK_TRUE@data_DATA = zarrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \\$' Makefile.in +grep '^@CHECK_TRUE@ doz$' Makefile.in grep '^@CHECK_FALSE@data_DATA = dog$' Makefile.in diff --git a/tests/pluseq8.test b/tests/pluseq8.test index 8475ee49..12c910df 100755 --- a/tests/pluseq8.test +++ b/tests/pluseq8.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001, 2002, 2004 Free Software Foundation, Inc. # # This file is part of GNU Automake. # @@ -32,7 +32,7 @@ END $ACLOCAL || exit 1 $AUTOMAKE || exit 1 -sed -n -e '/^VAR =.*\\$/ { +sed -n -e '/^VAR =/ { :loop p n