test/context_internal_test.c: don't initialize as a separate test
[openssl.git] / Configure
index 63dcdc7..03053bc 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -145,6 +145,8 @@ my $gcc_devteam_warn = "-DDEBUG_UNUSED"
 #       -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
 #       -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"
 my $clang_devteam_warn = ""
         . " -Wswitch-default"
         . " -Wno-parentheses-equality"
@@ -154,6 +156,7 @@ my $clang_devteam_warn = ""
         . " -Wincompatible-pointer-types-discards-qualifiers"
         . " -Wmissing-variable-declarations"
         . " -Wno-unknown-warning-option"
         . " -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
         ;
 
 # This adds backtrace information to the memory leak info.  Is only used
@@ -749,7 +752,11 @@ while (@argvcopy)
                }
        elsif (/^--strict-warnings$/)
                {
                }
        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$/)
                {
                }
        elsif (/^--debug$/)
                {
@@ -1500,6 +1507,7 @@ $config{openssl_api_defines} = [
     "OPENSSL_MIN_API=".($apitable->{$config{api} // ""} // -1)
 ];
 
     "OPENSSL_MIN_API=".($apitable->{$config{api} // ""} // -1)
 ];
 
+my @strict_warnings_collection=();
 if ($strict_warnings)
        {
        my $wopt;
 if ($strict_warnings)
        {
        my $wopt;
@@ -1507,26 +1515,17 @@ if ($strict_warnings)
 
        die "ERROR --strict-warnings requires gcc[>=4] or gcc-alike"
             unless $gccver >= 4;
 
        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"})
        {
 
 unless ($disabled{"crypto-mdebug-backtrace"})
        {
@@ -1711,9 +1710,8 @@ if ($builder eq "unified") {
         # The basic things we're trying to build
         my @programs = ();
         my @libraries = ();
         # The basic things we're trying to build
         my @programs = ();
         my @libraries = ();
-        my @engines = ();
+        my @modules = ();
         my @scripts = ();
         my @scripts = ();
-        my @intermediates = ();
 
         my %attributes = ();
         my %sources = ();
 
         my %attributes = ();
         my %sources = ();
@@ -1803,7 +1801,6 @@ if ($builder eq "unified") {
                             $attributes{$p}->{$ak} = $av;
                         }
                     }
                             $attributes{$p}->{$ak} = $av;
                         }
                     }
-                    push @programs, @p;
                 }
             },
             qr/^\s*LIBS(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
                 }
             },
             qr/^\s*LIBS(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
@@ -1823,15 +1820,14 @@ if ($builder eq "unified") {
                             $attributes{$l}->{$ak} = $av;
                         }
                     }
                             $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*|);
             => 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;
                     foreach my $a (@a) {
                         my $ak = $a;
                         my $av = 1;
@@ -1839,11 +1835,10 @@ if ($builder eq "unified") {
                             $ak = $1;
                             $av = $2;
                         }
                             $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*$/
                 }
             },
             qr/^\s*SCRIPTS(?:{([\w=]+(?:\s*,\s*[\w=]+)*)})?\s*=\s*(.*)\s*$/
@@ -1863,7 +1858,6 @@ if ($builder eq "unified") {
                             $attributes{$s}->{$ak} = $av;
                         }
                     }
                             $attributes{$s}->{$ak} = $av;
                         }
                     }
-                    push @scripts, @s;
                 }
             },
 
                 }
             },
 
@@ -1904,10 +1898,13 @@ if ($builder eq "unified") {
             );
         die "runaway IF?" if (@skip);
 
             );
         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
 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 = $_;
 
         foreach (keys %attributes) {
             my $dest = $_;
@@ -1921,7 +1918,7 @@ EOF
         {
             my %infos = ( programs  => [ @programs  ],
                           libraries => [ @libraries ],
         {
             my %infos = ( programs  => [ @programs  ],
                           libraries => [ @libraries ],
-                          engines   => [ @engines   ],
+                          modules   => [ @modules   ],
                           scripts   => [ @scripts   ] );
             foreach my $k (keys %infos) {
                 foreach (@{$infos{$k}}) {
                           scripts   => [ @scripts   ] );
             foreach my $k (keys %infos) {
                 foreach (@{$infos{$k}}) {
@@ -2147,7 +2144,7 @@ EOF
                 if defined($unified_info{$_});
             delete $unified_info{$_};
         }
                 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
             # $intent serves multi purposes:
             # - give a prefix for the new object files names
             # - in the case of libraries, rearrange the object files so static
@@ -2163,7 +2160,7 @@ EOF
                                            src => [ 'sources',
                                                     'shared_sources' ],
                                            dst => 'shared_sources' } },
                                            src => [ 'sources',
                                                     'shared_sources' ],
                                            dst => 'shared_sources' } },
-                engines   => { dso    => { src => [ 'sources',
+                modules   => { dso    => { src => [ 'sources',
                                                     'shared_sources' ],
                                            dst => 'shared_sources' } },
                 scripts   => { script => { src => [ 'sources' ],
                                                     'shared_sources' ],
                                            dst => 'shared_sources' } },
                 scripts   => { script => { src => [ 'sources' ],
@@ -2225,7 +2222,7 @@ EOF
 
     ### Make unified_info a bit more efficient
     # One level structures
 
     ### Make unified_info a bit more efficient
     # One level structures
-    foreach (("programs", "libraries", "engines", "scripts")) {
+    foreach (("programs", "libraries", "modules", "scripts")) {
         $unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
     }
     # Two level structures
         $unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
     }
     # Two level structures
@@ -2273,7 +2270,7 @@ EOF
     # they end up in where applicable.  Then, add build rules for those
     # directories
     my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ],
     # 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) {
                      "bin" => [ @{$unified_info{programs}} ],
                      "script" => [ @{$unified_info{scripts}} ] );
     foreach my $type (keys %loopinfo) {