Configure: clean away temporary section of code
[openssl.git] / Configure
index bf5b2c667c25b18d67cad8ef0bdfc52ca586bcc5..dda0ae7df1b29c98f18fb493cf6a436248ed632a 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -365,10 +365,13 @@ my %deprecated_disablables = (
 
 our %disabled = ( # "what"         => "comment"
                   "asan"               => "default",
 
 our %disabled = ( # "what"         => "comment"
                   "asan"               => "default",
+                 "crypto-mdebug"       => "default",
+                 "crypto-mdebug-backtrace" => "default",
                  "ec_nistp_64_gcc_128" => "default",
                  "egd"                 => "default",
                  "fuzz-libfuzzer"      => "default",
                  "fuzz-afl"            => "default",
                  "ec_nistp_64_gcc_128" => "default",
                  "egd"                 => "default",
                  "fuzz-libfuzzer"      => "default",
                  "fuzz-afl"            => "default",
+                 "heartbeats"          => "default",
                  "md2"                 => "default",
                   "msan"                => "default",
                  "rc5"                 => "default",
                  "md2"                 => "default",
                   "msan"                => "default",
                  "rc5"                 => "default",
@@ -381,9 +384,6 @@ our %disabled = ( # "what"         => "comment"
                  "weak-ssl-ciphers"    => "default",
                  "zlib"                => "default",
                  "zlib-dynamic"        => "default",
                  "weak-ssl-ciphers"    => "default",
                  "zlib"                => "default",
                  "zlib-dynamic"        => "default",
-                 "crypto-mdebug"       => "default",
-                 "crypto-mdebug-backtrace" => "default",
-                 "heartbeats"          => "default",
                );
 
 # Note: => pair form used for aesthetics, not to truly make a hash table
                );
 
 # Note: => pair form used for aesthetics, not to truly make a hash table
@@ -500,34 +500,16 @@ if (grep /^reconf(igure)?$/, @argvcopy) {
            if (grep(/^reconf/,@argvcopy));
        $ENV{CROSS_COMPILE} = $configdata::config{cross_compile_prefix}
            if defined($configdata::config{cross_compile_prefix});
            if (grep(/^reconf/,@argvcopy));
        $ENV{CROSS_COMPILE} = $configdata::config{cross_compile_prefix}
            if defined($configdata::config{cross_compile_prefix});
-       $ENV{CROSS_COMPILE} = $configdata::config{cc}
+       $ENV{CC} = $configdata::config{cc}
            if defined($configdata::config{cc});
            if defined($configdata::config{cc});
+       $ENV{BUILDFILE} = $configdata::config{build_file}
+           if defined($configdata::config{build_file});
 
        print "Reconfiguring with: ", join(" ",@argvcopy), "\n";
        print "    CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
            if $ENV{CROSS_COMPILE};
        print "    CC = ",$ENV{CC},"\n" if $ENV{CC};
 
        print "Reconfiguring with: ", join(" ",@argvcopy), "\n";
        print "    CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
            if $ENV{CROSS_COMPILE};
        print "    CC = ",$ENV{CC},"\n" if $ENV{CC};
-    } elsif (open IN, "<Makefile") {
-        #
-        # THIS SECTION IS TEMPORARY, it helps transitioning from Makefile
-        # centered information gathering the reading configdata.pm
-        #
-        while (<IN>) {
-            s|\R$||;
-            if (/^CONFIGURE_ARGS=\s*(.*)\s*/) {
-                # Older form, we split the string and hope for the best
-                @argvcopy = split /\s+/, $_;
-                die "Incorrect data to reconfigure, please do a normal configuration\n"
-                    if (grep(/^reconf/,@argvcopy));
-            } elsif (/^CROSS_COMPILE=\s*(.*)/) {
-                $ENV{CROSS_COMPILE}=$1;
-            } elsif (/^CC=\s*(?:\$\(CROSS_COMPILE\))?(.*?)$/) {
-                $ENV{CC}=$1;
-            }
-        }
-        #
-        # END OF TEMPORARY SECTION
-        #
+       print "    BUILDFILE = ",$ENV{BUILDFILE},"\n" if $ENV{BUILDFILE};
     } else {
        die "Insufficient data to reconfigure, please do a normal configuration\n";
     }
     } else {
        die "Insufficient data to reconfigure, please do a normal configuration\n";
     }
@@ -725,6 +707,13 @@ foreach (@argvcopy)
                        {
                        $libs.=$_." ";
                        }
                        {
                        $libs.=$_." ";
                        }
+               elsif (/^-static$/)
+                       {
+                       $libs.=$_." ";
+                       $disabled{"pic"} = "forced";
+                       $disabled{"shared"} = "forced";
+                       $disabled{"threads"} = "forced";
+                       }
                elsif (/^-D(.*)$/)
                        {
                        push @user_defines, $1;
                elsif (/^-D(.*)$/)
                        {
                        push @user_defines, $1;
@@ -931,6 +920,13 @@ $target{nm} =      $ENV{'NM'}      || $target{nm}      || "nm";
 $target{rc} =
     $ENV{'RC'}  || $ENV{'WINDRES'} || $target{rc}      || "windres";
 
 $target{rc} =
     $ENV{'RC'}  || $ENV{'WINDRES'} || $target{rc}      || "windres";
 
+# Allow overriding the build file name
+$target{build_file} = $ENV{BUILDFILE} || $target{build_file} || "Makefile";
+
+# Cache information necessary for reconfiguration
+$config{cc} = $target{cc};
+$config{build_file} = $target{build_file};
+
 # For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
 # or release_ attributes.
 # Do it in such a way that no spurious space is appended (hence the grep).
 # For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
 # or release_ attributes.
 # Do it in such a way that no spurious space is appended (hence the grep).
@@ -1116,6 +1112,9 @@ unless ($disabled{asm}) {
        push @{$config{defines}}, "SHA256_ASM" if ($target{sha1_asm_src} =~ /sha256/);
        push @{$config{defines}}, "SHA512_ASM" if ($target{sha1_asm_src} =~ /sha512/);
     }
        push @{$config{defines}}, "SHA256_ASM" if ($target{sha1_asm_src} =~ /sha256/);
        push @{$config{defines}}, "SHA512_ASM" if ($target{sha1_asm_src} =~ /sha512/);
     }
+    if ($target{rc4_asm_src} ne $table{DEFAULTS}->{rc4_asm_src}) {
+       push @{$config{defines}}, "RC4_ASM";
+    }
     if ($target{md5_asm_src}) {
        push @{$config{defines}}, "MD5_ASM";
     }
     if ($target{md5_asm_src}) {
        push @{$config{defines}}, "MD5_ASM";
     }