Relax the requirements for a debug build
[openssl.git] / Configure
index 1b0cddb3631fa19bb13f331fdbabaac8f5ced240..c309485b24cb215f75b0de88dc9ccca1af130bd5 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -4,7 +4,7 @@
 ##
 ##  Configure -- OpenSSL source tree configuration script
 ##  If editing this file, run this command before committing
-##     make -f Makefile.org TABLE
+##     make -f Makefile.in TABLE
 ##
 
 require 5.000;
@@ -921,7 +921,7 @@ my @experimental = ();
 
 # This is what $depflags will look like with the above defaults
 # (we need this to see if we should advise the user to run "make depend"):
-my $default_depflags = " -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
+my $default_depflags = " -DOPENSSL_NO_CRYPTO_MDEBUG -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST";
 
 # Explicit "no-..." options will be collected in %disabled along with the defaults.
 # To remove something from %disabled, use "enable-foo" (unless it's experimental).
@@ -1268,22 +1268,17 @@ print "Configuring for $target\n";
 my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
 if ($d) {
     $build_prefix = "debug_";
+    $target = $t;
 
     # If we do not find debug-foo in the table, the target is set to foo,
     # but only if the foo target has a noon-empty debug_cflags or debug_lflags
     # attribute.
-    if (!$table{$target} && ($table{$t}->{debug_cflags}
-                            || $table{$t}->{debug_lflags})) {
+    if (!$table{$target}) {
        $target = $t;
     }
 }
 
-&usage if (!defined($table{$target})
-          || $table{$target}->{template}
-          || ($build_prefix eq "debug_"
-              && $target !~ /^debug-/
-              && !($table{$target}->{debug_cflags}
-                   || $table{$target}->{debug_lflags})));
+&usage if (!defined($table{$target}) || $table{$target}->{template});
 
 if ($fips)
        {
@@ -1570,7 +1565,7 @@ if (defined($disabled{"deprecated"})) {
         $api = $maxapi;
 }
 
-# You will find shlib_mark1 and shlib_mark2 explained in Makefile.org
+# You will find shlib_mark1 and shlib_mark2 explained in Makefile.in
 my $shared_mark = "";
 if ($shared_target eq "")
        {
@@ -1822,10 +1817,10 @@ if ($strict_warnings)
                 }
        }
 
-open(IN,"<Makefile.org") || die "unable to read Makefile.org:$!\n";
+open(IN,"<Makefile.in") || die "unable to read Makefile.in$!\n";
 unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
 open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
-print OUT "### Generated automatically from Makefile.org by Configure.\n\n";
+print OUT "### Generated automatically from Makefile.in by Configure.\n\n";
 my $sdirs=0;
 
 while (<IN>)
@@ -1933,7 +1928,7 @@ while (<IN>)
        }
 close(IN);
 close(OUT);
-rename($Makefile,"$Makefile.bak") || die "unable to rename $Makefile\n" if -e $Makefile;
+rename($Makefile,"$Makefile.orig") || die "unable to rename $Makefile\n" if -e $Makefile;
 rename("$Makefile.new",$Makefile) || die "unable to rename $Makefile.new\n";
 
 print "CC            =$cc\n";
@@ -2089,8 +2084,8 @@ while (<IN>)
                { printf OUT "#%s EIGHT_BIT\n",($b8)?"define":"undef"; }
        elsif   (/^#((define)|(undef))\s+BN_LLONG\s*$/)
                { printf OUT "#%s BN_LLONG\n",($bn_ll)?"define":"undef"; }
-       elsif   (/^\#define\s+DES_LONG\s+.*/)
-               { printf OUT "#define DES_LONG unsigned %s\n",
+       elsif   (/^\#define\s+OSSL_DES_LONG\s+.*/)
+               { printf OUT "#define OSSL_DES_LONG unsigned %s\n",
                        ($des_int)?'int':'long'; }
        elsif   (/^\#(define|undef)\s+DES_PTR/)
                { printf OUT "#%s DES_PTR\n",($des_ptr)?'define':'undef'; }
@@ -2161,6 +2156,27 @@ print "RC2 uses u$type[$rc2_int]\n" if $rc2_int != $def_int;
 print "BF_PTR used\n" if $bf_ptr == 1;
 print "BF_PTR2 used\n" if $bf_ptr == 2;
 
+# Copy all Makefile.in to Makefile (except top-level)
+use File::Find;
+use IO::File;
+find(sub {
+        return if ($_ ne "Makefile.in" || $File::Find::dir eq ".");
+        my $in = IO::File->new($_, "r") or
+            die sprintf "Error reading Makefile.in in %s: !$\n",
+                $File::Find::dir;
+        my $out = IO::File->new("Makefile", "w") or
+            die sprintf "Error writing Makefile in %s: !$\n",
+                $File::Find::dir;
+        print $out "# Generated from $_, do not edit\n";
+        while (my $line = <$in>) { print $out $line }
+        $in->close() or
+            die sprintf "Error reading Makefile.in in %s: !$\n",
+                $File::Find::dir;
+        $out->close() or
+            die sprintf "Error writing Makefile in %s: !$\n",
+                $File::Find::dir;
+    }, ".");
+
 {
     my $perlguess = $perl =~ m@^/@ ? $perl : '/usr/local/bin/perl';