summaryrefslogtreecommitdiffstats
path: root/Configure
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-04-21 14:30:08 +0200
committerRichard Levitte <levitte@openssl.org>2016-04-25 18:06:06 +0200
commit8d34daf0ce3bd2fc08dda0f1b0d1213dec452a1d (patch)
treebddf80d3549bba3a35ffabe413e4ec150f78528d /Configure
parent79356a83b78a2d936dcd022847465d9ebf6c67b1 (diff)
Build system: add include directories and dependencies for generators
In the case of generating a file like this: GENERATE[foo.S]=mkfoo.pl arg1 arg2 the 'mkfoo.pl' generator itself might need to include other files, such as perl modules within our source tree. We can reuse already existing syntax for it, like this: INCLUDE[mkfoo.pl]=module/path or: DEPEND[mkfoo.pl]=modules/mymodule.pm This change implements the support for such constructs, and for the DEPEND statement, for any value that indicates a perl module (.pm file), it will automatically infer an INCLUDE statement for its directory, just like it does for C header files, so you won't have do write this: DEPEND[mkfoo.pl]=modules/mymodule.pm INCLUDE[mkfoo.pl]=modules Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure30
1 files changed, 21 insertions, 9 deletions
diff --git a/Configure b/Configure
index 4a870c0a82..b32cb942a7 100755
--- a/Configure
+++ b/Configure
@@ -1612,9 +1612,15 @@ EOF
foreach (keys %depends) {
my $dest = $_;
- my $ddest = cleanfile($buildd, $_, $blddir);
- if ($unified_info{rename}->{$ddest}) {
- $ddest = $unified_info{rename}->{$ddest};
+ my $ddest = 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) {
+ $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
}
foreach (@{$depends{$dest}}) {
my $d = cleanfile($sourced, $_, $blddir);
@@ -1635,9 +1641,9 @@ EOF
$d = $unified_info{rename}->{$d};
}
$unified_info{depends}->{$ddest}->{$d} = 1;
- # If we depend on a header file, let's make sure it
- # can get included
- if ($d =~ /\.h$/) {
+ # If we depend on a header file or a perl module, let's make
+ # sure it can get included
+ if ($d =~ /\.(h|pm)$/) {
my $i = dirname($d);
push @{$unified_info{includes}->{$ddest}}, $i
unless grep { $_ eq $i } @{$unified_info{includes}->{$ddest}};
@@ -1647,9 +1653,15 @@ EOF
foreach (keys %includes) {
my $dest = $_;
- my $ddest = cleanfile($buildd, $_, $blddir);
- if ($unified_info{rename}->{$ddest}) {
- $ddest = $unified_info{rename}->{$ddest};
+ my $ddest = 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) {
+ $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
}
foreach (@{$includes{$dest}}) {
my $i = cleandir($sourced, $_, $blddir);