Otherwise, target and variable mangling may only apply to the first
line.
my $m4output = undef;
my $m4macro = "DX_FIX_GNULIB";
my $m4output = undef;
my $m4macro = "DX_FIX_GNULIB";
Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
GetOptions(
"o|output=s" => \$output,
Getopt::Long::Configure("gnu_getopt", "no_auto_abbrev");
GetOptions(
"o|output=s" => \$output,
# Fix up things that look like filenames.
$word = "lib/$word";
} else {
# Fix up things that look like filenames.
$word = "lib/$word";
} else {
- print STDERR "$0: warning: unrecognized source file: $word\n";
+ print STDERR "$0:$line: warning: unrecognized source file: $word\n";
sub mangle_variable {
my $raw = shift;
sub mangle_variable {
my $raw = shift;
- $raw =~ /([^=]+=)[[:space:]]*(.*)/;
+ $raw =~ /([^=]+=)[[:space:]]*(.*)/s;
my ($left, @right) = ($1, split(/[[:space:]]+/, $2));
return join(" ", ($left, map(mangle_file($_), @right))) . "\n";
my ($left, @right) = ($1, split(/[[:space:]]+/, $2));
return join(" ", ($left, map(mangle_file($_), @right))) . "\n";
sub mangle_target {
my $raw = shift;
sub mangle_target {
my $raw = shift;
- $raw =~ /([^:]+):[[:space:]]*(.*)/;
+ $raw =~ /([^:]+):[[:space:]]*(.*)/s;
my @left = split(/[[:space:]]+/, $1);
my @right = split(/[[:space:]]+/, $2);
my @left = split(/[[:space:]]+/, $1);
my @right = split(/[[:space:]]+/, $2);
+ $line++;
+
+ # Combine line splices.
+ while (s/\\$//) {
+ $line++;
+ $_ = $_ . <STDIN>
+ }
+
next if (/^#/);
if (!$printed_header) {
next if (/^#/);
if (!$printed_header) {
# Targets are similar to variables: the target and its dependencies
# need to be mangled.
# Targets are similar to variables: the target and its dependencies
# need to be mangled.
$_ = mangle_target($_);
}
$_ = mangle_target($_);
}
# Finally, references to $(srcdir) and $(builddir) need to be fixed up.
s:\$\(srcdir\):\$\(top_srcdir\)/lib:g;
s:\$\(builddir\):\$\(top_builddir\)/lib:g;
# Finally, references to $(srcdir) and $(builddir) need to be fixed up.
s:\$\(srcdir\):\$\(top_srcdir\)/lib:g;
s:\$\(builddir\):\$\(top_builddir\)/lib:g;
+} continue { s/(\n.)/\\\1/g; print; };
print <<'EOF';
gnulib_lt_objects = $(libgnu_la_OBJECTS) $(gl_LTLIBOBJS)
print <<'EOF';
gnulib_lt_objects = $(libgnu_la_OBJECTS) $(gl_LTLIBOBJS)