From: Tom Tromey Date: Wed, 31 Mar 1999 13:54:15 +0000 (+0000) Subject: * automake.in (quote_cond_val): Quote \n. X-Git-Tag: last-merge-into-user-dep-gen-branch~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a78b324c5121633114792cbf4cf51321e1aa6e15;p=thirdparty%2Fautomake.git * automake.in (quote_cond_val): Quote \n. (unquote_cond_val): Unquote \n. (read_am_file): If line ends with `\', preserve it and add a newline. (read_main_am_file): In conditional case, put conditional text at beginning of each generated line. --- diff --git a/ChangeLog b/ChangeLog index caac9ff02..27ed4a6a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +1999-03-31 Tom Tromey + + * automake.in (quote_cond_val): Quote \n. + (unquote_cond_val): Unquote \n. + (read_am_file): If line ends with `\', preserve it and add a + newline. + (read_main_am_file): In conditional case, put conditional text at + beginning of each generated line. + 1999-03-31 Alexandre Oliva * automake.in (handle_tests): support XFAIL_TEST diff --git a/TODO b/TODO index fbb19a2f8..3fafa147e 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +* Write tests for `\' preservation. + * Run automake before libtool. It will report an error but still won't put the file into the disty. This is wrong. From Mark H Wilkinson @@ -45,12 +47,6 @@ * Add code to generate foo-config script like gnome, gtk -* right now automake sets `TAR' when automake is configured - this loses in some situations. - however, checking for it in every configure.in also seems lame. - probably should just give in on this; meanwhile people can - override TAR themselves. - * `DEFS += foo' won't work. That's because DEFS is defined in header-vars.am, which is read after the user's Makefile.am. diff --git a/automake.in b/automake.in index 576a85b7f..ffac781fd 100755 --- a/automake.in +++ b/automake.in @@ -5223,8 +5223,7 @@ sub examine_variable sub quote_cond_val { local ($val) = @_; - $val =~ s/ /\001/g; - $val =~ s/\t/\003/g; + $val =~ tr/ \t\n/\001\003\004/; $val = "\002" if $val eq ''; return $val; } @@ -5233,8 +5232,7 @@ sub quote_cond_val sub unquote_cond_val { local ($val) = @_; - $val =~ s/\001/ /g; - $val =~ s/\003/\t/g; + $val =~ tr/\001\003\004/ \t\n/; $val =~ s/\002//g; return $val; } @@ -5866,10 +5864,6 @@ sub read_am_file else { $saw_bk = /\\$/; - # Chop newline and backslash if this line is - # continued. ensure trailing whitespace exists. - chop if $saw_bk; - chop if $saw_bk; $contents{$last_var_name} .= ' ' unless $contents{$last_var_name} =~ /\s$/; $contents{$last_var_name} .= $_; @@ -5980,7 +5974,10 @@ sub read_am_file local ($value); if ($3 ne '' && substr ($3, -1) eq "\\") { - $value = substr ($3, 0, length ($3) - 1); + # We preserve the `\' because otherwise the long lines + # that are generated will be truncated by broken + # `sed's. + $value = $3 . "\n"; } else { @@ -6221,9 +6218,13 @@ sub read_main_am_file { local ($vcond) = shift (@cond_vals); local ($val) = &unquote_cond_val (shift (@cond_vals)); - $output_vars .= ($vcond . $curs - . ' ' . $def_type{$curs} . '= ' - . $val . "\n"); + $output_vars .= ($vcond . $curs . ' ' + . $def_type{$curs} . "= \\\n"); + local ($line); + foreach $line (split ("\n", $val)) + { + $output_vars .= $vcond . $line . "\n"; + } } } else diff --git a/stamp-vti b/stamp-vti index d0a06f902..898461506 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,3 +1,3 @@ -@set UPDATED 26 March 1999 +@set UPDATED 31 March 1999 @set EDITION 1.4a @set VERSION 1.4a diff --git a/version.texi b/version.texi index d0a06f902..898461506 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 26 March 1999 +@set UPDATED 31 March 1999 @set EDITION 1.4a @set VERSION 1.4a