summaryrefslogtreecommitdiff
path: root/bin/automake.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/automake.in')
-rwxr-xr-xbin/automake.in89
1 files changed, 47 insertions, 42 deletions
diff --git a/bin/automake.in b/bin/automake.in
index 761491fbf..6c79d1422 100755
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -1738,54 +1738,59 @@ sub check_canonical_spelling
# Set up the compile suite.
sub handle_compile ()
{
- return if ! $must_handle_compiled_objects;
+ return if ! $must_handle_compiled_objects;
- # Boilerplate.
- my $default_includes = '';
- if (! option 'nostdinc')
- {
- my @incs = ('-I.', subst ('am__isrc'));
+ # Boilerplate.
+ my $default_includes = '';
+ if (! option 'nostdinc')
+ {
+ my @incs = ('-I.', subst ('am__isrc'));
- my $var = var 'CONFIG_HEADER';
- if ($var)
- {
- foreach my $hdr (split (' ', $var->variable_value))
- {
- push @incs, '-I' . dirname ($hdr);
- }
- }
- # We want '-I. -I$(srcdir)', but the latter -I is redundant
- # and unaesthetic in non-VPATH builds. We use `-I.@am__isrc@`
- # instead. It will be replaced by '-I.' or '-I. -I$(srcdir)'.
- # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
- # to just put @am__isrc@ right after '-I.', without a space.
- ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
- }
+ my $var = var 'CONFIG_HEADER';
+ if ($var)
+ {
+ foreach my $hdr (split (' ', $var->variable_value))
+ {
+ push @incs, '-I' . dirname ($hdr);
+ }
+ }
+ # We want '-I. -I$(srcdir)', but the latter -I is redundant
+ # and unaesthetic in non-VPATH builds. We use `-I.@am__isrc@`
+ # instead. It will be replaced by '-I.' or '-I. -I$(srcdir)'.
+ # Items in CONFIG_HEADER are never in $(srcdir) so it is safe
+ # to just put @am__isrc@ right after '-I.', without a space.
+ ($default_includes = ' ' . uniq (@incs)) =~ s/ @/@/;
+ }
- my (@mostly_rms, @dist_rms);
- foreach my $item (sort keys %compile_clean_files)
+ my (@mostly_rms, @dist_rms);
+ foreach my $item (sort keys %compile_clean_files)
{
- if ($compile_clean_files{$item} == MOSTLY_CLEAN)
- {
- push (@mostly_rms, "\t-rm -f $item");
- }
- elsif ($compile_clean_files{$item} == DIST_CLEAN)
- {
- push (@dist_rms, "\t-rm -f $item");
- }
- else
- {
- prog_error 'invalid entry in %compile_clean_files';
- }
+ if ($compile_clean_files{$item} == MOSTLY_CLEAN)
+ {
+ push (@mostly_rms, "\t-rm -f $item");
+ }
+ elsif ($compile_clean_files{$item} == DIST_CLEAN)
+ {
+ push (@dist_rms, "\t-rm -f $item");
+ }
+ else
+ {
+ prog_error 'invalid entry in %compile_clean_files';
+ }
}
- my ($coms, $vars, $rules) =
- file_contents_internal (1, "$libdir/am/compile.am",
- new Automake::Location,
- 'DEFAULT_INCLUDES' => $default_includes,
- 'MOSTLYRMS' => join ("\n", @mostly_rms),
- 'DISTRMS' => join ("\n", @dist_rms));
- $output_vars .= $vars;
+ my $filename = "$libdir/am/compile.am";
+ my %transform =
+ (
+ 'DEFAULT_INCLUDES' => $default_includes,
+ 'MOSTLYRMS' => join ("\n", @mostly_rms),
+ 'DISTRMS' => join ("\n", @dist_rms)
+ );
+
+ my @paragraphs = make_paragraphs ($filename, %transform);
+ my ($coms, $vars, $rules) =
+ file_contents_internal (1, $filename, new Automake::Location,
+ \@paragraphs, %transform);
$output_rules .= "$coms$rules";
}