X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Configure;h=8192f9e7d2649f62442e71d543563abb0ebc2fd0;hp=67c401369c83a29f69c175555fa37326b900a24f;hb=d90a6beb0e8b519e345204cc533597a2e563dab5;hpb=0ef1ce49eeed417c143a8c1bf77ce0d843306e3d diff --git a/Configure b/Configure index 67c401369c..8192f9e7d2 100755 --- a/Configure +++ b/Configure @@ -77,10 +77,21 @@ my $usage="Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lx # Minimum warning options... any contributions to OpenSSL should at least get # past these. -my $gcc_devteam_warn = "-DPEDANTIC -DREF_DEBUG -DDEBUG_UNUSED -DBIO_DEBUG" - . " -pedantic" +# DEBUG_UNUSED enables __owur (warn unused result) checks. +my $gcc_devteam_warn = "-DDEBUG_UNUSED" + # -DPEDANTIC complements -pedantic and is meant to mask code that + # is not strictly standard-compliant and/or implementation-specifc, + # e.g. inline assembly, disregards to alignment requirements, such + # that -pedantic would complain about. Incidentally -DPEDANTIC has + # to be used even in sanitized builds, because sanitizer too is + # supposed to and does take notice of non-standard behaviour. Then + # -pedantic with pre-C9x compiler would also complain about 'long + # long' not being supported. As 64-bit algorithms are common now, + # it grew impossible to resolve this without sizeable additional + # code, so we just tell compiler to be pedantic about everything + # but 'long long' type. + . " -DPEDANTIC -pedantic -Wno-long-long" . " -Wall" - . " -Wno-long-long" . " -Wsign-compare" . " -Wmissing-prototypes" . " -Wshadow" @@ -232,7 +243,6 @@ my @dtls = qw(dtls1 dtls1_2); # For developers: keep it sorted alphabetically my @disablables = ( - "aes", "afalgeng", "asm", "async", @@ -267,16 +277,14 @@ my @disablables = ( "engine", "err", "filenames", + "gost", "heartbeats", - "hmac", "hw(-.+)?", "idea", "makedepend", "md2", "md4", - "md5", "mdc2", - "md[-_]ghost94", "multiblock", "nextprotoneg", "ocb", @@ -290,15 +298,12 @@ my @disablables = ( "rc5", "rdrand", "rfc3779", - "rijndael", # Old AES name "ripemd", "rmd160", - "rsa", "scrypt", "sct", "sctp", "seed", - "sha", "shared", "sock", "srp", @@ -356,11 +361,11 @@ my @disable_cascades = ( "ssl" => [ "ssl3" ], "ssl3-method" => [ "ssl3" ], "zlib" => [ "zlib-dynamic" ], - "rijndael" => [ "aes" ], "des" => [ "mdc2" ], "ec" => [ "ecdsa", "ecdh" ], - "dgram" => [ "dtls" ], + "dgram" => [ "dtls", "sctp" ], + "sock" => [ "sctp" ], "dtls" => [ @dtls ], # SSL 3.0, (D)TLS 1.0 and TLS 1.1 require MD5 and SHA @@ -395,6 +400,14 @@ my @disable_cascades = ( "pic" => [ "shared" ], "shared" => [ "dynamic-engine" ], "engine" => [ "afalgeng" ], + + # no-autoalginit is only useful when building non-shared + "autoalginit" => [ "shared", "apps" ], + + "stdio" => [ "apps" ], + "apps" => [ "tests" ], + "comp" => [ "zlib" ], + sub { !$disabled{"unit-test"} } => [ "heartbeats" ], ); # Avoid protocol support holes. Also disable all versions below N, if version @@ -550,6 +563,7 @@ foreach (@argvcopy) { $disabled{$proto} = "option(dtls)"; } + $disabled{"dtls"} = "option(dtls)"; } elsif ($1 eq "ssl") { @@ -659,7 +673,7 @@ foreach (@argvcopy) } elsif (/^--with-zlib-include=(.*)$/) { - $withargs{zlib_include}="-I$1"; + $withargs{zlib_include}=$1; } elsif (/^--with-fipslibdir=(.*)$/) { @@ -741,9 +755,9 @@ while (@tocheckfor) { while (@cascade_copy) { my ($test, $descendents) = (shift @cascade_copy, shift @cascade_copy); if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) { - map { + foreach(grep { !defined($disabled{$_}) } @$descendents) { $new_tocheckfor{$_} = 1; $disabled{$_} = "forced"; - } grep { !defined($disabled{$_}) } @$descendents; + } } } @tocheckfor = (keys %new_tocheckfor); @@ -873,7 +887,7 @@ $config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'} if $config{cross_compile_prefix} eq ""; # Allow overriding the names of some tools. USE WITH CARE -$config{perl} = $ENV{'PERL'} || which("perl5") || which("perl") || "perl"; +$config{perl} = $ENV{'PERL'} || ($^O ne "VMS" ? $^X : "perl"); $target{cc} = $ENV{'CC'} || $target{cc} || "cc"; $target{ranlib} = $ENV{'RANLIB'} || $target{ranlib} || which("ranlib") || "true"; $target{ar} = $ENV{'AR'} || $target{ar} || "ar"; @@ -910,6 +924,8 @@ if ($target{build_scheme}->[0] eq "unified" && $classic) { my ($builder, $builder_platform, @builder_opts) = @{$target{build_scheme}}; +push @{$config{defines}}, "NDEBUG" if $config{build_type} eq "release"; + if ($target =~ /^mingw/ && `$target{cc} --target-help 2>&1` =~ m/-mno-cygwin/m) { $config{cflags} .= " -mno-cygwin"; @@ -1303,6 +1319,7 @@ if ($builder eq "unified") { my %ordinals = (); my %sources = (); + my %shared_sources = (); my %includes = (); my %depends = (); my %renames = (); @@ -1382,6 +1399,9 @@ if ($builder eq "unified") { qr/^\s*SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ => sub { push @{$sources{$1}}, split(/\s+/, $2) if !@skip || $skip[$#skip] > 0 }, + qr/^\s*SHARED_SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ + => sub { push @{$shared_sources{$1}}, split(/\s+/, $2) + if !@skip || $skip[$#skip] > 0 }, qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/ => sub { push @{$includes{$1}}, split(/\s+/, $2) if !@skip || $skip[$#skip] > 0 }, @@ -1567,6 +1587,32 @@ EOF } } + foreach (keys %shared_sources) { + my $dest = $_; + my $ddest = cleanfile($buildd, $_, $blddir); + if ($unified_info{rename}->{$ddest}) { + $ddest = $unified_info{rename}->{$ddest}; + } + foreach (@{$shared_sources{$dest}}) { + my $s = cleanfile($sourced, $_, $blddir); + + # If it isn't in the source tree, we assume it's generated + # in the build tree + if (! -f $s) { + $s = cleanfile($buildd, $_, $blddir); + } + # We recognise C and asm files + if ($s =~ /\.[csS]\b$/) { + (my $o = $_) =~ s/\.[csS]\b$/.o/; + $o = cleanfile($buildd, $o, $blddir); + $unified_info{shared_sources}->{$ddest}->{$o} = 1; + $unified_info{sources}->{$o}->{$s} = 1; + } else { + die "unrecognised source file type for shared library: $s\n"; + } + } + } + foreach (keys %generate) { my $dest = $_; my $ddest = cleanfile($buildd, $_, $blddir); @@ -1636,7 +1682,7 @@ EOF $unified_info{$_} = [ sort keys %{$unified_info{$_}} ]; } # Two level structures - foreach my $l1 (("sources", "ldadd", "depends")) { + foreach my $l1 (("sources", "shared_sources", "ldadd", "depends")) { foreach my $l2 (sort keys %{$unified_info{$l1}}) { $unified_info{$l1}->{$l2} = [ sort keys %{$unified_info{$l1}->{$l2}} ]; @@ -1778,7 +1824,6 @@ print OUT "1;\n"; close(OUT); -print "IsMK1MF =", ($builder eq "mk1mf" ? "yes" : "no"), "\n"; print "CC =$target{cc}\n"; print "CFLAG =$target{cflags} $config{cflags}\n"; print "SHARED_CFLAG =$target{shared_cflag}\n"; @@ -1870,11 +1915,6 @@ my %builders = ( run_dofile("util/domd", "util/domd.in"); chmod 0755, "util/domd"; }, - mk1mf => sub { - my $platform = shift; - # The only reason we do this is to have something to build MINFO from - build_Makefile(); - }, ); $builders{$builder}->($builder_platform, @builder_opts); @@ -2100,12 +2140,12 @@ sub resolve_config { # the config that had it. delete $inherited_config{template}; - map { + foreach (keys %inherited_config) { if (!$combined_inheritance{$_}) { $combined_inheritance{$_} = []; } push @{$combined_inheritance{$_}}, $inherited_config{$_}; - } keys %inherited_config; + } } } @@ -2387,7 +2427,7 @@ sub quotify { my $processor = defined($processors{$for}) ? $processors{$for} : sub { shift; }; - map { $processor->($_); } @_; + return map { $processor->($_); } @_; } # collect_from_file($filename, $line_concat_cond_re, $line_concat)