# -Wlanguage-extension-token -- no, we use asm()
# -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc
# -Wextended-offsetof -- no, needed in CMS ASN1 code
+# -Wunused-function -- no, it forces header use of safestack et al
+# DEFINE macros
my $clang_devteam_warn = ""
. " -Wswitch-default"
. " -Wno-parentheses-equality"
. " -Wincompatible-pointer-types-discards-qualifiers"
. " -Wmissing-variable-declarations"
. " -Wno-unknown-warning-option"
+ . " -Wno-unused-function"
;
# This adds backtrace information to the memory leak info. Is only used
}
elsif (/^--strict-warnings$/)
{
- $strict_warnings = 1;
+ # Pretend that our strict flags is a C flag, and replace it
+ # with the proper flags later on
+ push @{$useradd{CFLAGS}}, '--ossl-strict-warnings';
+ push @{$useradd{CXXFLAGS}}, '--ossl-strict-warnings';
+ $strict_warnings=1;
}
elsif (/^--debug$/)
{
"OPENSSL_MIN_API=".($apitable->{$config{api} // ""} // -1)
];
+my @strict_warnings_collection=();
if ($strict_warnings)
{
my $wopt;
die "ERROR --strict-warnings requires gcc[>=4] or gcc-alike"
unless $gccver >= 4;
- foreach $wopt (split /\s+/, $gcc_devteam_warn)
- {
- push @{$config{cflags}}, $wopt
- unless grep { $_ eq $wopt } @{$config{cflags}};
- push @{$config{cxxflags}}, $wopt
- if ($config{CXX}
- && !grep { $_ eq $wopt } @{$config{cxxflags}});
- }
- if (defined($predefined{__clang__}))
- {
- foreach $wopt (split /\s+/, $clang_devteam_warn)
- {
- push @{$config{cflags}}, $wopt
- unless grep { $_ eq $wopt } @{$config{cflags}};
- push @{$config{cxxflags}}, $wopt
- if ($config{CXX}
- && !grep { $_ eq $wopt } @{$config{cxxflags}});
- }
- }
+ push @strict_warnings_collection, (split /\s+/, $gcc_devteam_warn);
+ push @strict_warnings_collection, (split /\s+/, $clang_devteam_warn)
+ if (defined($predefined{__clang__}));
}
+foreach (qw(CFLAGS CXXFLAGS))
+ {
+ $useradd{$_} = [ map { $_ eq '--ossl-strict-warnings'
+ ? @strict_warnings_collection
+ : ( $_ ) }
+ @{$useradd{$_}} ];
+ }
unless ($disabled{"crypto-mdebug-backtrace"})
{
# The basic things we're trying to build
my @programs = ();
my @libraries = ();
- my @engines = ();
+ my @modules = ();
my @scripts = ();
- my @extra = ();
- my @intermediates = ();
my %attributes = ();
my %sources = ();
$attributes{$p}->{$ak} = $av;
}
}
- push @programs, @p;
}
},
qr/^\s*LIBS(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
$attributes{$l}->{$ak} = $av;
}
}
- push @libraries, @l;
}
},
- qr/^\s*ENGINES(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
+ qr/^\s*MODULES(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
=> sub {
if (!@skip || $skip[$#skip] > 0) {
my @a = tokenize($1, qr|\s*,\s*|);
- my @e = tokenize($2);
- push @engines, @e;
+ my @m = tokenize($2);
+ push @modules, @m;
foreach my $a (@a) {
my $ak = $a;
my $av = 1;
$ak = $1;
$av = $2;
}
- foreach my $e (@e) {
- $attributes{$e}->{$ak} = $av;
+ foreach my $m (@m) {
+ $attributes{$m}->{$ak} = $av;
}
}
- push @engines, @e;
}
},
qr/^\s*SCRIPTS(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
$attributes{$s}->{$ak} = $av;
}
}
- push @scripts, @s;
}
},
- qr/^\s*EXTRA\s*=\s*(.*)\s*$/
- => sub { push @extra, tokenize($1)
- if !@skip || $skip[$#skip] > 0 },
qr/^\s*ORDINALS\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/,
=> sub { push @{$ordinals{$1}}, tokenize($2)
qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
=> sub { push @{$generate{$1}}, $2
if !@skip || $skip[$#skip] > 0 },
- qr/^\s*RENAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
- => sub { warn "RENAME is no longer supported\n" },
- qr/^\s*SHARED_NAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
- => sub { warn "SHARED_NAME is no longer supported\n" },
qr/^\s*(?:#.*)?$/ => sub { },
"OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
"BEFORE" => sub {
);
die "runaway IF?" if (@skip);
- die <<"EOF" if scalar @engines and !$config{dynamic_engines};
+ if (grep { defined $attributes{$_}->{engine} } keys %attributes
+ and !$config{dynamic_engines}) {
+ die <<"EOF"
ENGINES can only be used if configured with 'dynamic-engine'.
This is usually a fault in a build.info file.
EOF
+ }
foreach (keys %attributes) {
my $dest = $_;
{
my %infos = ( programs => [ @programs ],
libraries => [ @libraries ],
- engines => [ @engines ],
- scripts => [ @scripts ],
- extra => [ @extra ] );
+ modules => [ @modules ],
+ scripts => [ @scripts ] );
foreach my $k (keys %infos) {
foreach (@{$infos{$k}}) {
my $item = cleanfile($buildd, $_, $blddir);
if defined($unified_info{$_});
delete $unified_info{$_};
}
- foreach my $prodtype (('programs', 'libraries', 'engines', 'scripts')) {
+ foreach my $prodtype (('programs', 'libraries', 'modules', 'scripts')) {
# $intent serves multi purposes:
# - give a prefix for the new object files names
# - in the case of libraries, rearrange the object files so static
src => [ 'sources',
'shared_sources' ],
dst => 'shared_sources' } },
- engines => { dso => { src => [ 'sources',
+ modules => { dso => { src => [ 'sources',
'shared_sources' ],
dst => 'shared_sources' } },
scripts => { script => { src => [ 'sources' ],
### Make unified_info a bit more efficient
# One level structures
- foreach (("programs", "libraries", "modules", "scripts", "extra")) {
+ foreach (("programs", "libraries", "modules", "scripts")) {
$unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
}
# Two level structures
# they end up in where applicable. Then, add build rules for those
# directories
my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ],
- "dso" => [ @{$unified_info{engines}} ],
+ "dso" => [ @{$unified_info{modules}} ],
"bin" => [ @{$unified_info{programs}} ],
"script" => [ @{$unified_info{scripts}} ] );
foreach my $type (keys %loopinfo) {