aboutsummaryrefslogtreecommitdiff
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-10 09:04:09 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-10 10:02:29 +0100
commitd46057277f3b805e5f198e31fc81a892bf5c9141 (patch)
tree1af8070e94fbdf7cc4b799936380c68000341274 /Configurations
parent8cffddc0f2c59768e724a4c8dc68822cfea5cacc (diff)
downloadopenssl-d46057277f3b805e5f198e31fc81a892bf5c9141.zip
openssl-d46057277f3b805e5f198e31fc81a892bf5c9141.tar.gz
openssl-d46057277f3b805e5f198e31fc81a892bf5c9141.tar.bz2
Pass down inclusion directories to source file generators
The source file generators sometimes use $(CC) to post-process generated source, and getting the inclusion directories may be necessary at times, so we pass them down. RT#4406 Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/common.tmpl11
-rw-r--r--Configurations/unix-Makefile.tmpl5
-rw-r--r--Configurations/windows-makefile.tmpl5
3 files changed, 15 insertions, 6 deletions
diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index c2362d0..d89817e 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -32,17 +32,24 @@
@newlist;
}
+ # dogenerate is responsible for producing all the recipes that build
+ # generated source files. It recurses in case a dependency is also a
+ # generated source file.
sub dogenerate {
my $src = shift;
return "" if $cache{$src};
+ my $obj = shift;
+ my $bin = shift;
my %opts = @_;
if ($unified_info{generate}->{$src}) {
$OUT .= generatesrc(src => $src,
generator => $unified_info{generate}->{$src},
deps => $unified_info{depends}->{$src},
+ incs => [ @{$unified_info{includes}->{$bin}},
+ @{$unified_info{includes}->{$obj}} ],
%opts);
foreach (@{$unified_info{depends}->{$src}}) {
- dogenerate($_, %opts);
+ dogenerate($_, $obj, $bin, %opts);
}
}
$cache{$src} = 1;
@@ -65,7 +72,7 @@
%opts);
foreach ((@{$unified_info{sources}->{$obj}},
@{$unified_info{depends}->{$obj}})) {
- dogenerate($_, %opts);
+ dogenerate($_, $obj, $bin, %opts);
}
}
$cache{$obj} = 1;
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 02e8cb4..114a4be 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -825,6 +825,7 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)/Configurations/commo
sub generatesrc {
my %args = @_;
my $generator = join(" ", @{$args{generator}});
+ my $incs = join("", map { " -I".$_ } @{$args{incs}});
if ($args{src} !~ /\.[sS]$/) {
return <<"EOF";
@@ -851,7 +852,7 @@ EOF
$target: $args{generator}->[0]
( trap "rm -f \$@.S" INT; \\
$generator \$@.S; \\
- \$(CC) \$(CFLAGS) -E -P \$@.S > \$@ && rm -f \$@.S )
+ \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@ && rm -f \$@.S )
EOF
}
# Otherwise....
@@ -862,7 +863,7 @@ EOF
}
return <<"EOF";
$args{src}: $args{generator}->[0]
- \$(CC) \$(CFLAGS) -E -P \$< > \$@
+ \$(CC) \$(CFLAGS) $incs -E -P \$< > \$@
EOF
}
}
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 7b78f9f..967146f 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -171,6 +171,7 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)\Configure
my %args = @_;
(my $target = $args{src}) =~ s/\.[sS]$/.asm/;
my $generator = join(" ", @{$args{generator}});
+ my $incs = join("", map { " /I ".$_ } @{$args{incs}});
if ($target !~ /\.asm$/) {
return <<"EOF";
@@ -195,7 +196,7 @@ $target: $args{generator}->[0]
set ASM=\$(AS)
set CC=\$(CC)
$generator \$@.S
- \$(CC) \$(CFLAGS) /EP /C \$@.S > \$@
+ \$(CC) \$(CFLAGS) $incs /EP /C \$@.S > \$@
del /Q \$@.S
EOF
}
@@ -209,7 +210,7 @@ EOF
}
return <<"EOF";
$target: $args{generator}->[0]
- \$(CC) \$(CFLAGS) /EP /C \$< > \$@
+ \$(CC) \$(CFLAGS) $incs /EP /C \$< > \$@
EOF
}
}