diff options
author | Richard Levitte <levitte@openssl.org> | 2016-10-14 16:56:34 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2018-11-05 08:13:04 +0100 |
commit | b96ab5e6d0125c7e2a6804d568cb2a732cbf4504 (patch) | |
tree | 474adbf96faeb2b365487e21085e5424ab9036a9 /Configure | |
parent | Add poly1305 MAC support (diff) | |
download | openssl-b96ab5e6d0125c7e2a6804d568cb2a732cbf4504.tar.xz openssl-b96ab5e6d0125c7e2a6804d568cb2a732cbf4504.zip |
Build: make it possible to assign macro definitions for specific outputs
Sometimes, some specific program or object file might need an extra
macro definition of its own. This allows that to be easily done.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7553)
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -1722,6 +1722,7 @@ if ($builder eq "unified") { my %sources = (); my %shared_sources = (); my %includes = (); + my %defines = (); my %depends = (); my %renames = (); my %sharednames = (); @@ -1837,6 +1838,9 @@ if ($builder eq "unified") { qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ => sub { push @{$includes{$1}}, tokenize($2) if !@skip || $skip[$#skip] > 0 }, + qr/^\s*DEFINE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ + => sub { push @{$defines{$1}}, tokenize($2) + if !@skip || $skip[$#skip] > 0 }, qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/ => sub { push @{$depends{$1}}, tokenize($2) if !@skip || $skip[$#skip] > 0 }, @@ -2169,6 +2173,27 @@ EOF unless grep { $_ eq $ib } @{$unified_info{includes}->{$ddest}->{build}}; } } + + foreach (keys %defines) { + my $dest = $_; + 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 (@{$defines{$dest}}) { + m|^([^=]*)(=.*)?$|; + die "0 length macro name not permitted\n" if $1 eq ""; + die "$1 defined more than once\n" + if defined $unified_info{defines}->{$ddest}->{$1}; + $unified_info{defines}->{$ddest}->{$1} = $2; + } + } } my $ordinals_text = join(', ', sort keys %ordinals); @@ -2311,6 +2336,12 @@ EOF } } } + # Defines + foreach my $dest (sort keys %{$unified_info{defines}}) { + $unified_info{defines}->{$dest} + = [ map { $_.$unified_info{defines}->{$dest}->{$_} } + sort keys %{$unified_info{defines}->{$dest}} ]; + } # Includes foreach my $dest (sort keys %{$unified_info{includes}}) { if (defined($unified_info{includes}->{$dest}->{build})) { |