summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-06-13 21:57:51 +0200
committerRichard Levitte <levitte@openssl.org>2016-06-14 22:11:38 +0200
commit4f858293a9b5a5db8c8af0725b6402d21626040b (patch)
treea184fc2ba2a3084026d35aefa7564368a988d599
parent7c46746bf2958fd2eccc59ecb48039e4e20ce38a (diff)
downloadopenssl-new-4f858293a9b5a5db8c8af0725b6402d21626040b.tar.gz
Configure: Make it possible to generate mandatory header files
'DEPEND[]=file.h' becomes a special way to say that 'file.h' must be generated before anything else is built. It's likely that a number of source files depend on these header files, this provides a simple way to make sure they are always generated even it the dependency data hasn't been added to the build file yet. Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r--Configurations/common.tmpl3
-rwxr-xr-xConfigure10
2 files changed, 8 insertions, 5 deletions
diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index 48b3d18716..9d7fbf2e77 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -213,6 +213,9 @@
}
}
+ # Build mandatory generated headers
+ foreach (@{$unified_info{depends}->{""}}) { dogenerate($_); }
+
# Build all known libraries, engines, programs and scripts.
# Everything else will be handled as a consequence.
foreach (@{$unified_info{libraries}}) { dolib($_); }
diff --git a/Configure b/Configure
index 7bbb5b7697..cc36087aa7 100755
--- a/Configure
+++ b/Configure
@@ -1465,7 +1465,7 @@ if ($builder eq "unified") {
qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
=> sub { push @{$includes{$1}}, tokenize($2)
if !@skip || $skip[$#skip] > 0 },
- qr/^\s*DEPEND\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/
=> sub { push @{$depends{$1}}, tokenize($2)
if !@skip || $skip[$#skip] > 0 },
qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
@@ -1689,11 +1689,11 @@ EOF
foreach (keys %depends) {
my $dest = $_;
- my $ddest = cleanfile($sourced, $_, $blddir);
+ my $ddest = $dest eq "" ? "" : cleanfile($sourced, $_, $blddir);
# If the destination doesn't exist in source, it can only be
# a generated file in the build tree.
- if (! -f $ddest) {
+ if ($ddest ne "" && ! -f $ddest) {
$ddest = cleanfile($buildd, $_, $blddir);
if ($unified_info{rename}->{$ddest}) {
$ddest = $unified_info{rename}->{$ddest};
@@ -1710,7 +1710,7 @@ EOF
if (! -f $d
|| (grep { $d eq $_ }
map { cleanfile($srcdir, $_, $blddir) }
- (@generated_headers, @generated_by_make_headers))) {
+ grep { /\.h$/ } keys %{$unified_info{generate}})) {
$d = cleanfile($buildd, $_, $blddir);
}
# Take note if the file to depend on is being renamed
@@ -1720,7 +1720,7 @@ EOF
$unified_info{depends}->{$ddest}->{$d} = 1;
# If we depend on a header file or a perl module, let's make
# sure it can get included
- if ($d =~ /\.(h|pm)$/) {
+ if ($dest ne "" && $d =~ /\.(h|pm)$/) {
my $i = dirname($d);
push @{$unified_info{includes}->{$ddest}}, $i
unless grep { $_ eq $i } @{$unified_info{includes}->{$ddest}};