diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2006-03-15 18:48:14 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2006-03-15 18:48:14 +0000 |
commit | 55d597732b7da4bb2b326ef1f83f4d773d97bbfe (patch) | |
tree | e34e6a96a7ccebdd61c83b0018558292b85948ac /modules/AutomakeWorkspaceCreator.pm | |
parent | 24db7006f6250f1d14a6cc720e8cf6609257d11f (diff) | |
download | MPC-55d597732b7da4bb2b326ef1f83f4d773d97bbfe.tar.gz |
ChangeLogTag: Wed Mar 15 18:44:03 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/AutomakeWorkspaceCreator.pm')
-rw-r--r-- | modules/AutomakeWorkspaceCreator.pm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/modules/AutomakeWorkspaceCreator.pm b/modules/AutomakeWorkspaceCreator.pm index f1c9bf6e..6ba3e66e 100644 --- a/modules/AutomakeWorkspaceCreator.pm +++ b/modules/AutomakeWorkspaceCreator.pm @@ -216,7 +216,7 @@ sub write_comps { $in_condition--; } - if ( /(^[a-zA-Z][a-zA-Z0-9_]*_(PROGRAMS|LIBRARIES|LTLIBRARIES|LISP|PYTHON|JAVA|SCRIPTS|DATA|SOURCES|HEADERS|MANS|TEXINFOS))\s*\+=\s*/ + if ( /(^[a-zA-Z][a-zA-Z0-9_]*_(PROGRAMS|LIBRARIES|LTLIBRARIES|LISP|PYTHON|JAVA|SCRIPTS|DATA|SOURCES|HEADERS|MANS|TEXINFOS|LIBADD|LDADD))\s*\+=\s*/ || /(^CLEANFILES)\s*\+=\s*/ || /(^EXTRA_DIST)\s*\+=\s*/ ) { @@ -325,6 +325,7 @@ sub write_comps { print $fh "## $local", $crlf; my($look_for_libs) = 0; + my($prev_line) = undef; while (<$pfh>) { # Don't emit comments @@ -345,7 +346,7 @@ sub write_comps { } } - if ( /(^[a-zA-Z][a-zA-Z0-9_]*_(PROGRAMS|LIBRARIES|LTLIBRARIES|LISP|PYTHON|JAVA|SCRIPTS|DATA|SOURCES|HEADERS|MANS|TEXINFOS))\s*\+=\s*/ + if ( /(^[a-zA-Z][a-zA-Z0-9_]*_(PROGRAMS|LIBRARIES|LTLIBRARIES|LISP|PYTHON|JAVA|SCRIPTS|DATA|SOURCES|HEADERS|MANS|TEXINFOS|LIBADD|LDADD))\s*\+=\s*/ || /(^CLEANFILES)\s*\+=\s*/ || /(^EXTRA_DIST)\s*\+=\s*/ ) { @@ -391,7 +392,22 @@ sub write_comps { $look_for_libs = 1; } - print $fh $_; + ## I have introduced a one line delay so that I can simplify + ## the automake template. If our current line is empty, then + ## we will remove the trailing backslash before printing the + ## previous line. Automake is horribly unforgiving so we must + ## avoid this situation at all cost. + if (defined $prev_line) { + $prev_line =~ s/\s*\\$// if ($_ =~ /^\s*$/); + print $fh $prev_line; + } + $prev_line = $_; + } + ## The one line delay requires that we print out the previous + ## line (if there was one) when we reach the end of the file. + if (defined $prev_line) { + $prev_line =~ s/\s*\\$//; + print $fh $prev_line; } close($pfh); |