diff options
author | Richard Levitte <levitte@openssl.org> | 2016-03-07 14:37:00 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-03-07 18:25:56 +0100 |
commit | ae4c7450754ea13265edd69e6ff74d87c89401cd (patch) | |
tree | 8acb4c1b1120b58109e4b66d60b2cccf9750b6d7 /Configure | |
parent | 667867cced0013c1cfd8d7a9efa43b8f2cebc942 (diff) | |
download | openssl-ae4c7450754ea13265edd69e6ff74d87c89401cd.tar.gz |
Unified - Add the build.info command GENERATE, to generate source files
In some cases, one might want to generate some source files from
others, that's done as follows:
GENERATE[foo.s]=asm/something.pl $(CFLAGS)
GENERATE[bar.s]=asm/bar.S
The value of each GENERATE line is a command line or part of it.
Configure places no rules on the command line, except the the first
item muct be the generator file. It is, however, entirely up to the
build file template to define exactly how those command lines should
be handled, how the output is captured and so on.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1283,6 +1283,7 @@ if ($builder eq "unified") { my %depends = (); my %renames = (); my %sharednames = (); + my %generate = (); push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f); my $template = Text::Template->new(TYPE => 'FILE', @@ -1354,6 +1355,9 @@ if ($builder eq "unified") { qr/^\s*DEPEND\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ => sub { push @{$depends{$1}}, split(/\s+/, $2) if !@skip || $skip[$#skip] > 0 }, + qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ + => sub { push @{$generate{$1}}, $2 + if !@skip || $skip[$#skip] > 0 }, qr/^\s*RENAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ => sub { push @{$renames{$1}}, split(/\s+/, $2) if !@skip || $skip[$#skip] > 0 }, @@ -1514,6 +1518,20 @@ EOF } } + foreach (keys %generate) { + my $dest = $_; + my $ddest = cleanfile($buildd, $_, $blddir); + if ($unified_info{rename}->{$ddest}) { + $ddest = $unified_info{rename}->{$ddest}; + } + die "more than one generator for $dest: " + ,join(" ", @{$generate{$_}}),"\n" + if scalar @{$generate{$_}} > 1; + my @generator = split /\s+/, $generate{$dest}->[0]; + $generator[0] = cleanfile($sourced, $generator[0], $blddir), + $unified_info{generate}->{$ddest} = [ @generator ]; + } + foreach (keys %depends) { my $dest = $_; my $ddest = cleanfile($buildd, $_, $blddir); |