Unified - adapt the generation of rc4 assembler to use GENERATE
[openssl.git] / Configure
index 0e2a5995d897d9bbb84eb3cd18d3254f166308d9..17f45b0bd0dede733ef72acc86ac983d54dbc460 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -275,6 +275,7 @@ my @disablables = (
     "hw(-.+)?",
     "idea",
     "locking",
+    "makedepend",
     "md2",
     "md4",
     "md5",
@@ -448,6 +449,8 @@ my $target="";
 $config{options}="";
 $config{build_type} = "release";
 
+my $classic = 0;
+
 my @argvcopy=@ARGV;
 
 if (grep /^reconf(igure)?$/, @argvcopy) {
@@ -631,7 +634,11 @@ foreach (@argvcopy)
                }
        elsif (/^[-+]/)
                {
-               if (/^--prefix=(.*)$/)
+               if (/^--classic$/)
+                       {
+                       $classic=1;
+                       }
+               elsif (/^--prefix=(.*)$/)
                        {
                        $config{prefix}=$1;
                        die "Directory given with --prefix MUST be absolute\n"
@@ -790,6 +797,8 @@ foreach (sort (keys %disabled))
                { }
        elsif (/^dynamic-engine$/)
                { }
+       elsif (/^makedepend$/)
+               { }
        elsif (/^zlib-dynamic$/)
                { }
        elsif (/^sse2$/)
@@ -886,6 +895,22 @@ $config{shared_ldflag} = "";
 $target{build_scheme} = [ $target{build_scheme} ]
     if ref($target{build_scheme}) ne "ARRAY";
 
+###### TO BE REMOVED WHEN CLASSIC BUILD IS REMOVED
+######
+###### If the user has chosen --classic, we give it to them.
+###### If they try that with an out-of-source config, we complain.
+if ($target{build_scheme}->[0] eq "unified" && $classic) {
+    die "Can't perform a classic build out of source tree\n"
+        if $srcdir ne $blddir;
+
+    $target{build_scheme} = { unix    => [ "unixmake" ],
+                              windows => [ "mk1mf", $target{build_scheme}->[2] ],
+                              VMS     => undef } -> {$target{build_scheme}->[1]};
+
+    die "Classic mode unavailable on this platform\n"
+        unless defined($target{build_scheme});
+}
+
 my ($builder, $builder_platform, @builder_opts) =
     @{$target{build_scheme}};
 
@@ -1072,11 +1097,11 @@ unless ($disabled{asm}) {
 }
 
 my $ecc = $target{cc};
-if ($^O ne "VMS") {
+if ($^O ne "VMS" && !$disabled{makedepend}) {
     # Is the compiler gcc or clang?  $ecc is used below to see if
     # error-checking can be turned on.
     my $ccpcc = "$config{cross_compile_prefix}$target{cc}";
-    $config{makedepprog} = 'makedepend';
+    $config{makedepprog} = which('makedepend');
     open(PIPE, "$ccpcc --version 2>&1 | head -2 |");
     while ( <PIPE> ) {
         $config{makedepprog} = $ccpcc if /clang|gcc/;
@@ -1084,9 +1109,12 @@ if ($^O ne "VMS") {
         $ecc = "gcc" if /gcc/;
     }
     close(PIPE);
+
+    $disabled{makedepend} = "unavailable" unless $config{makedepprog};
 }
 
 
+
 # Deal with bn_ops ###################################################
 
 $config{bn_ll}                 =0;
@@ -2313,10 +2341,12 @@ sub which
        my $path;
        foreach $path (split /:/, $ENV{PATH})
                {
-               if (-f "$path/$name$target{exe_extension}" and -x _)
+               my $fullpath = "$path/$name$target{exe_extension}";
+               if (-f $fullpath and -x $fullpath)
                        {
-                       return "$path/$name$target{exe_extension}" unless ($name eq "perl" and
-                        system("$path/$name$target{exe_extension} -e " . '\'exit($]<5.0);\''));
+                       return $fullpath
+                           unless ($name eq "perl" and
+                                   system("$fullpath -e " . '\'exit($]<5.0);\''));
                        }
                }
        }