Fixup BIO demos for OpenSSL 1.1.x
[openssl.git] / Configure
index 445f928663ae7955f835b60d8f66f92e59f88d5e..0cfc3ea36d5cfeb410e0aaf0be0eb6b8936face6 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -886,7 +886,8 @@ foreach (sort (keys %disabled))
                $what = "ripemd" if $what eq "rmd160";
                $what = "whrlpool" if $what eq "whirlpool";
 
-               if (grep { $_ eq $what } @{$config{sdirs}})
+               if ($what ne "async" && $what ne "err"
+                   && grep { $_ eq $what } @{$config{sdirs}})
                        {
                        push @{$config{openssl_algorithm_defines}}, "OPENSSL_NO_$WHAT";
                        @{$config{sdirs}} = grep { $_ ne $what} @{$config{sdirs}};
@@ -921,6 +922,8 @@ my %target = resolve_config($target);
 
 &usage if (!%target || $target{template});
 
+my %conf_files = map { $_ => 1 } (@{$target{_conf_fname_int}});
+$config{conf_files} = [ sort keys %conf_files ];
 %target = ( %{$table{DEFAULTS}}, %target );
 
 $target{exe_extension}="";
@@ -941,7 +944,7 @@ $config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'}
 # Allow overriding the names of some tools.  USE WITH CARE
 # Note: only Unix cares about HASHBANGPERL...  that explains
 # the default string.
-$config{perl} =    $ENV{'PERL'}    || ($^O ne "VMS" ? $^X : "perl");
+$config{perl} =    ($^O ne "VMS" ? $^X : "perl");
 $config{hashbangperl} =
     $ENV{'HASHBANGPERL'}           || $ENV{'PERL'}     || "/usr/bin/env perl";
 $target{cc} =      $ENV{'CC'}      || $target{cc}      || "cc";
@@ -1198,7 +1201,7 @@ if ($^O ne "VMS" && !$disabled{makedepend}) {
         # We know that GNU C version 3 and up as well as all clang
         # versions support dependency generation
         $config{makedepprog} = $ccpcc
-            if (/clang/ || (/gcc/ && $compiler_major > 3));
+            if (/clang/ || (/gcc/ && $compiler_major >= 3));
         $ecc = "clang" if /clang/;
         $ecc = "gcc" if /gcc/;
         last if ($config{makedepprog} || !$lines--);
@@ -1314,44 +1317,6 @@ my %unified_info = ();
 
 my $buildinfo_debug = defined($ENV{CONFIGURE_DEBUG_BUILDINFO});
 if ($builder eq "unified") {
-    # Store the name of the template file we will build the build file from
-    # in %config.  This may be useful for the build file itself.
-    my @build_file_template_names =
-       ( $builder_platform."-".$target{build_file}.".tmpl",
-         $target{build_file}.".tmpl" );
-    my @build_file_templates = ();
-
-    # First, look in the user provided directory, if given
-    if (defined $ENV{$local_config_envname}) {
-       @build_file_templates =
-           map {
-               if ($^O eq 'VMS') {
-                   # VMS environment variables are logical names,
-                   # which can be used as is
-                   $local_config_envname . ':' . $_;
-               } else {
-                   catfile($ENV{$local_config_envname}, $_);
-               }
-           }
-           @build_file_template_names;
-    }
-    # Then, look in our standard directory
-    push @build_file_templates,
-       ( map { catfile($srcdir, "Configurations", $_) }
-         @build_file_template_names );
-
-    my $build_file_template;
-    for $_ (@build_file_templates) {
-       $build_file_template = $_;
-        last if -f $build_file_template;
-
-        $build_file_template = undef;
-    }
-    if (!defined $build_file_template) {
-       die "*** Couldn't find any of:\n", join("\n", @build_file_templates), "\n";
-    }
-    $config{build_file_template} = $build_file_template;
-
     use lib catdir(dirname(__FILE__),"util");
     use with_fallback qw(Text::Template);
 
@@ -1388,6 +1353,47 @@ if ($builder eq "unified") {
         return $res;
     }
 
+    # Store the name of the template file we will build the build file from
+    # in %config.  This may be useful for the build file itself.
+    my @build_file_template_names =
+       ( $builder_platform."-".$target{build_file}.".tmpl",
+         $target{build_file}.".tmpl" );
+    my @build_file_templates = ();
+
+    # First, look in the user provided directory, if given
+    if (defined $ENV{$local_config_envname}) {
+       @build_file_templates =
+           map {
+               if ($^O eq 'VMS') {
+                   # VMS environment variables are logical names,
+                   # which can be used as is
+                   $local_config_envname . ':' . $_;
+               } else {
+                   catfile($ENV{$local_config_envname}, $_);
+               }
+           }
+           @build_file_template_names;
+    }
+    # Then, look in our standard directory
+    push @build_file_templates,
+       ( map { cleanfile($srcdir, catfile("Configurations", $_), $blddir) }
+         @build_file_template_names );
+
+    my $build_file_template;
+    for $_ (@build_file_templates) {
+       $build_file_template = $_;
+        last if -f $build_file_template;
+
+        $build_file_template = undef;
+    }
+    if (!defined $build_file_template) {
+       die "*** Couldn't find any of:\n", join("\n", @build_file_templates), "\n";
+    }
+    $config{build_file_templates}
+      = [ $build_file_template,
+          cleanfile($srcdir, catfile("Configurations", "common.tmpl"),
+                    $blddir) ];
+
     my @build_infos = ( [ ".", "build.info" ] );
     foreach (@{$config{dirs}}) {
         push @build_infos, [ $_, "build.info" ]
@@ -2019,11 +2025,10 @@ EOF
 print OUT "1;\n";
 close(OUT);
 
-my $perlvers = &get_perl_version();
 print "\n";
 print "PROCESSOR     =$config{processor}\n" if $config{processor};
 print "PERL          =$config{perl}\n";
-print "PERLVERSION   =$perlvers\n";
+print "PERLVERSION   =$Config{version} for $Config{archname}\n";
 print "HASHBANGPERL  =$config{hashbangperl}\n";
 print "CC            =$config{cross_compile_prefix}$target{cc}\n";
 print "CFLAG         =$target{cflags} $config{cflags}\n";
@@ -2036,8 +2041,7 @@ print "EX_LIBS       =$target{ex_libs} $config{ex_libs}\n";
 my %builders = (
     unified => sub {
         run_dofile(catfile($blddir, $target{build_file}),
-                   $config{build_file_template},
-                   catfile($srcdir, "Configurations", "common.tmpl"));
+                   @{$config{build_file_templates}});
     },
     );
 
@@ -2210,7 +2214,8 @@ sub read_config {
     close(CONFFILE);
     my %targets = ();
     {
-       local %table = %::table;    # Protect %table from tampering
+       # Protect certain tables from tampering
+       local %table = %::table;
 
        eval $content;
        warn $@ if $@;
@@ -2225,7 +2230,9 @@ sub read_config {
                warn "Misconfigured target configuration for $_ (should be a hash table), ignoring...\n";
            }
            delete $targets{$_};
-       }
+       } else {
+            $targets{$_}->{_conf_fname_int} = add([ $fname ]);
+        }
     }
 
     %table = (%table, %targets);
@@ -2384,21 +2391,6 @@ sub usage
        exit(1);
        }
 
-# Return the perl version.
-sub get_perl_version
-{
-    return "$Config{version} for $Config{archname}" if $config{perl} eq $^X;
-    my $l;
-    open my $FH, "$config{perl} -v|" || return "??unknown??";
-    while ( <$FH> ) {
-        chop;
-        $l .= $_;
-    }
-    close $FH;
-    $l =~ s/This is (.{1,70}).*/$1/;
-    return $l;
-}
-
 sub run_dofile
 {
     my $out = shift;