mirror of
https://github.com/openssl/openssl.git
synced 2025-03-07 19:38:33 +08:00
build.info: Make it possible to have more than one item in KEYWORD[]
So far, the "index" part of KEYWORD[whatever] could only handle one item. There are cases, however, where we want to add the exact same value to multiple items. This is especially helpful if a variable that may have multi-item values are used in the "index" part. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11185)
This commit is contained in:
parent
2888fc1590
commit
ad5be194c6
146
Configure
146
Configure
@ -1857,6 +1857,34 @@ if ($builder eq "unified") {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Support for pushing values on multiple indexes of a given hash
|
||||||
|
# array.
|
||||||
|
my $push_to = sub {
|
||||||
|
my $valueref = shift;
|
||||||
|
my $index_str = shift; # May be undef or empty
|
||||||
|
my $attrref = shift; # May be undef
|
||||||
|
my $attr_str = shift;
|
||||||
|
my @values = @_;
|
||||||
|
|
||||||
|
if (defined $index_str) {
|
||||||
|
my @indexes = ( '' );
|
||||||
|
if ($index_str !~ m|^\s*$|) {
|
||||||
|
@indexes = tokenize($index_str);
|
||||||
|
}
|
||||||
|
foreach (@indexes) {
|
||||||
|
push @{$valueref->{$_}}, @values;
|
||||||
|
if (defined $attrref) {
|
||||||
|
$handle_attributes->($attr_str, \$$attrref->{$_},
|
||||||
|
@values);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
push @$valueref, @values;
|
||||||
|
$handle_attributes->($attr_str, $attrref, @values)
|
||||||
|
if defined $attrref;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
# We want to detect configdata.pm in the source tree, so we
|
# We want to detect configdata.pm in the source tree, so we
|
||||||
# don't use it if the build tree is different.
|
# don't use it if the build tree is different.
|
||||||
my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir);
|
my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir);
|
||||||
@ -1937,88 +1965,64 @@ if ($builder eq "unified") {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
qr/^\s* PROGRAMS ${attribs_re} \s* = ${value_re} $/x
|
qr/^\s* PROGRAMS ${attribs_re} \s* = ${value_re} $/x
|
||||||
=> sub {
|
=> sub { $push_to->(\@programs, undef,
|
||||||
if (!@skip || $skip[$#skip] > 0) {
|
\$attributes{programs}, $+{ATTRIBS},
|
||||||
my @p = tokenize($expand_variables->($+{VALUE}));
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
push @programs, @p;
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
$handle_attributes->($+{ATTRIBS},
|
|
||||||
\$attributes{programs},
|
|
||||||
@p);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qr/^\s* LIBS ${attribs_re} \s* = ${value_re} $/x
|
qr/^\s* LIBS ${attribs_re} \s* = ${value_re} $/x
|
||||||
=> sub {
|
=> sub { $push_to->(\@libraries, undef,
|
||||||
if (!@skip || $skip[$#skip] > 0) {
|
\$attributes{libraries}, $+{ATTRIBS},
|
||||||
my @l = tokenize($expand_variables->($+{VALUE}));
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
push @libraries, @l;
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
$handle_attributes->($+{ATTRIBS},
|
|
||||||
\$attributes{libraries},
|
|
||||||
@l);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qr/^\s* MODULES ${attribs_re} \s* = ${value_re} $/x
|
qr/^\s* MODULES ${attribs_re} \s* = ${value_re} $/x
|
||||||
=> sub {
|
=> sub { $push_to->(\@modules, undef,
|
||||||
if (!@skip || $skip[$#skip] > 0) {
|
\$attributes{modules}, $+{ATTRIBS},
|
||||||
my @m = tokenize($expand_variables->($+{VALUE}));
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
push @modules, @m;
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
$handle_attributes->($+{ATTRIBS},
|
|
||||||
\$attributes{modules},
|
|
||||||
@m);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qr/^\s* SCRIPTS ${attribs_re} \s* = ${value_re} $/x
|
qr/^\s* SCRIPTS ${attribs_re} \s* = ${value_re} $/x
|
||||||
=> sub {
|
=> sub { $push_to->(\@scripts, undef,
|
||||||
if (!@skip || $skip[$#skip] > 0) {
|
\$attributes{scripts}, $+{ATTRIBS},
|
||||||
my @s = tokenize($expand_variables->($+{VALUE}));
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
push @scripts, @s;
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
$handle_attributes->($+{ATTRIBS},
|
|
||||||
\$attributes{scripts},
|
|
||||||
@s);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qr/^\s* HTMLDOCS ${index_re} = ${value_re} $/x
|
qr/^\s* HTMLDOCS ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$htmldocs{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%htmldocs, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* MANDOCS ${index_re} = ${value_re} $/x
|
qr/^\s* MANDOCS ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$mandocs{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%mandocs, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
qr/^\s* ORDINALS ${index_re} = ${value_re} $/x
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
=> sub { push @{$ordinals{$expand_variables->($+{INDEX})}},
|
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
|
||||||
qr/^\s* SOURCE ${index_re} = ${value_re} $/x
|
qr/^\s* SOURCE ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$sources{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%sources, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* SHARED_SOURCE ${index_re} = ${value_re} $/x
|
qr/^\s* SHARED_SOURCE ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$shared_sources{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%shared_sources, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* INCLUDE ${index_re} = ${value_re} $/x
|
qr/^\s* INCLUDE ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$includes{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%includes, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* DEFINE ${index_re} = ${value_re} $/x
|
qr/^\s* DEFINE ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$defines{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%defines, $expand_variables->($+{INDEX}),
|
||||||
tokenize($expand_variables->($+{VALUE}))
|
undef, undef,
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* DEPEND ${index_re} ${attribs_re} = ${value_re} $/x
|
qr/^\s* DEPEND ${index_re} ${attribs_re} = ${value_re} $/x
|
||||||
=> sub {
|
=> sub { $push_to->(\%depends, $expand_variables->($+{INDEX}),
|
||||||
if (!@skip || $skip[$#skip] > 0) {
|
\$attributes{depends}, $+{ATTRIBS},
|
||||||
my $i = $expand_variables->($+{INDEX});
|
tokenize($expand_variables->($+{VALUE})))
|
||||||
my @d = tokenize($expand_variables->($+{VALUE}));
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
push @{$depends{$i}}, @d;
|
|
||||||
$handle_attributes->($+{ATTRIBS},
|
|
||||||
\$attributes{depends}->{$i},
|
|
||||||
@d);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
qr/^\s* GENERATE ${index_re} = ${value_re} $/x
|
qr/^\s* GENERATE ${index_re} = ${value_re} $/x
|
||||||
=> sub { push @{$generate{$expand_variables->($+{INDEX})}},
|
=> sub { $push_to->(\%generate, $expand_variables->($+{INDEX}),
|
||||||
$+{VALUE}
|
undef, undef, $+{VALUE})
|
||||||
if !@skip || $skip[$#skip] > 0 },
|
if !@skip || $skip[$#skip] > 0; },
|
||||||
qr/^\s* (?:\#.*)? $/x => sub { },
|
qr/^\s* (?:\#.*)? $/x => sub { },
|
||||||
"OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
|
"OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
|
||||||
"BEFORE" => sub {
|
"BEFORE" => sub {
|
||||||
|
@ -24,7 +24,7 @@ B<MODULES=> I<name> ...
|
|||||||
|
|
||||||
B<SCRIPTS=> I<name> ...
|
B<SCRIPTS=> I<name> ...
|
||||||
|
|
||||||
B<DEPEND[>I<item>B<]=> I<otheritem> ...
|
B<DEPEND[>I<items>B<]=> I<otheritem> ...
|
||||||
|
|
||||||
B<GENERATE[>I<item>B<]=> I<generator> I<generator-args> ...
|
B<GENERATE[>I<item>B<]=> I<generator> I<generator-args> ...
|
||||||
|
|
||||||
@ -32,9 +32,9 @@ B<SOURCE[>I<item>B<]=> I<file> ...
|
|||||||
|
|
||||||
B<SHARED_SOURCE[>I<item>B<]=> I<file> ...
|
B<SHARED_SOURCE[>I<item>B<]=> I<file> ...
|
||||||
|
|
||||||
B<DEFINE[>I<item>B<]=> I<name>[B<=>I<value>] ...
|
B<DEFINE[>I<items>B<]=> I<name>[B<=>I<value>] ...
|
||||||
|
|
||||||
B<INCLUDE[>I<item>B<]=> I<dir> ...
|
B<INCLUDE[>I<items>B<]=> I<dir> ...
|
||||||
|
|
||||||
B<$>I<VARIABLE>B<=>I<value>
|
B<$>I<VARIABLE>B<=>I<value>
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ syntax is one of:
|
|||||||
|
|
||||||
=item B<I<KEYWORD>> B<=> I<value> ...
|
=item B<I<KEYWORD>> B<=> I<value> ...
|
||||||
|
|
||||||
=item B<I<KEYWORD>[>I<item>B<]> B<=> I<value> ...
|
=item B<I<KEYWORD>[>I<items>B<]> B<=> I<value> ...
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
@ -154,8 +154,14 @@ F<foo.c> and F<details.c>, and that it depends on the library
|
|||||||
C<libcookie> (in other words, the library will be included when
|
C<libcookie> (in other words, the library will be included when
|
||||||
linking that program together).
|
linking that program together).
|
||||||
|
|
||||||
For any indexed statement for which the item hasn't been specified
|
Multiple space separated items are allowed too:
|
||||||
through any plain statement, or where the item exists but the indexed
|
|
||||||
|
SOURCE[foo]=foo.c
|
||||||
|
SOURCE[details]=details.c
|
||||||
|
DEPEND[foo details]=libcookie
|
||||||
|
|
||||||
|
For any indexed statement for which the items haven't been specified
|
||||||
|
through any plain statement, or where the items exists but the indexed
|
||||||
statement does not apply, the value is simply ignored by the build
|
statement does not apply, the value is simply ignored by the build
|
||||||
file generators.
|
file generators.
|
||||||
|
|
||||||
@ -169,7 +175,7 @@ variations on how they are treated.
|
|||||||
=item B<I<KEYWORD>{> I<attrib> | I<attrib>B<=>I<attrib-value> [,...]B<}>
|
=item B<I<KEYWORD>{> I<attrib> | I<attrib>B<=>I<attrib-value> [,...]B<}>
|
||||||
B<=> I<value> ...
|
B<=> I<value> ...
|
||||||
|
|
||||||
=item B<I<KEYWORD>[>I<item>B<]{> I<attrib> | I<attrib>B<=>I<attrib-value>
|
=item B<I<KEYWORD>[>I<items>B<]{> I<attrib> | I<attrib>B<=>I<attrib-value>
|
||||||
[,...]B<}> B<=> I<value> ...
|
[,...]B<}> B<=> I<value> ...
|
||||||
|
|
||||||
=back
|
=back
|
||||||
@ -411,15 +417,15 @@ C<noinst>, while the script C<bar> will.
|
|||||||
|
|
||||||
=over 4
|
=over 4
|
||||||
|
|
||||||
=item B<DEPEND[>I<item>B<]> B<=> I<file> ...
|
=item B<DEPEND[>I<items>B<]> B<=> I<file> ...
|
||||||
|
|
||||||
Collects dependencies, where I<item> depends on the given I<file>s.
|
Collects dependencies, where I<items> depend on the given I<file>s.
|
||||||
|
|
||||||
As a special case, the I<item> may be empty, for which the build file
|
As a special case, the I<items> may be empty, for which the build file
|
||||||
generators should make the whole build depend on the given I<file>s,
|
generators should make the whole build depend on the given I<file>s,
|
||||||
rather than some specific I<item>.
|
rather than the specific I<items>.
|
||||||
|
|
||||||
The I<item> may be any program, library, module, script, or any
|
The I<items> may be any program, library, module, script, or any
|
||||||
filename used as a value anywhere.
|
filename used as a value anywhere.
|
||||||
|
|
||||||
B<DEPEND> statements may have attributes, which apply to each
|
B<DEPEND> statements may have attributes, which apply to each
|
||||||
@ -473,19 +479,19 @@ given with B<LIBS> or B<MODULES>. For libraries, the given filenames
|
|||||||
are only used for their shared form, so if the item is a library name
|
are only used for their shared form, so if the item is a library name
|
||||||
ending with C<.a>, the filenames will be ignored.
|
ending with C<.a>, the filenames will be ignored.
|
||||||
|
|
||||||
=item B<DEFINE[>I<item>B<]> B<=> I<name>[B<=>I<value>] ...
|
=item B<DEFINE[>I<items>B<]> B<=> I<name>[B<=>I<value>] ...
|
||||||
|
|
||||||
Collects I<name> / I<value> pairs (or just I<name> with no defined
|
Collects I<name> / I<value> pairs (or just I<name> with no defined
|
||||||
value if no I<value> is given) associated with I<item>.
|
value if no I<value> is given) associated with I<items>.
|
||||||
|
|
||||||
The build file generators will decide what to do with them. For
|
The build file generators will decide what to do with them. For
|
||||||
example, these pairs should become C macro definitions whenever a
|
example, these pairs should become C macro definitions whenever a
|
||||||
C<.c> file is built into an object file.
|
C<.c> file is built into an object file.
|
||||||
|
|
||||||
=item B<INCLUDE[>I<item>B<]> B<=> I<dir> ...
|
=item B<INCLUDE[>I<items>B<]> B<=> I<dir> ...
|
||||||
|
|
||||||
Collects inclusion directories that will be used when building the
|
Collects inclusion directories that will be used when building the
|
||||||
I<item> components (object files and whatever else). This is used at
|
I<items> components (object files and whatever else). This is used at
|
||||||
the discretion of the build file generators.
|
the discretion of the build file generators.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
@ -568,7 +574,7 @@ the exception of conditional statements and variable assignments.
|
|||||||
|
|
||||||
=item "indexed statement"
|
=item "indexed statement"
|
||||||
|
|
||||||
Any F<build.info> statement of the form B<I<KEYWORD>[>I<item>B<]=>I<values>,
|
Any F<build.info> statement of the form B<I<KEYWORD>[>I<items>B<]=>I<values>,
|
||||||
with the exception of conditional statements.
|
with the exception of conditional statements.
|
||||||
|
|
||||||
=item "intermediate file"
|
=item "intermediate file"
|
||||||
|
Loading…
Reference in New Issue
Block a user