Remember the cleanup
[openssl.git] / Configure
index 91b3404b8c662a674390089dbba25d1ba39a484b..c89306b5831f7c8e635add0b1efa09a72cbf0c2d 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -2,7 +2,6 @@
 
 require 5.000;
 use strict;
-use POSIX qw(:errno_h);
 
 #
 # see PROBLEMS for instructions on what sort of things to do when 
@@ -78,7 +77,7 @@ my %table=(
 # A few of my development configs
 "purify",      "purify gcc:-g -DPURIFY -Wall:-lsocket -lnsl::::",
 "debug",       "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror:-lefence::::",
-"debug-rse","gcc:-DTERMIOS -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG -g -ggdb3 -Wall:::::",
+"debug-rse","gcc:-DTERMIOS -DL_ENDIAN -O -g -ggdb3 -m486 -Wall::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_out_asm",
 "dist",                "cc:-O -DNOPROTO::::",
 
 # Basic configs that should work on any box
@@ -211,6 +210,9 @@ my %table=(
 "BC-32","bcc32:::DES_PTR RC4_INDEX:::",
 "BC-16","bcc:::BN_LLONG DES_PTR RC4_INDEX SIXTEEN_BIT:::",
 
+# CygWin32
+"CygWin32", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall::BN_LLONG $x86_gcc_des $x86_gcc_opts:",
+
 # Our old Ultrix box :-). -O2 breaks some of the bignum stuff (now fixed,
 # it is a compiler bug, look in bug/ultrixcc.c for example code.
 "ultrix","cc:-O2 -DNOPROTO -DNOCONST -DL_ENDIAN:::asm/mips1.o:::",
@@ -269,7 +271,7 @@ foreach (@ARGV)
                        }
                else
                        {
-                       die "unknown options, only -Dxxx, -Lxxx -lxxx supported\n";
+                       die "unknown options, only -Dxxx, -Lxxx and -lxxx supported\n";
                        }
                }
        else
@@ -292,7 +294,7 @@ if (!defined($table{$target}))
 
 (my $cc,my $cflags,my $lflags,my $bn_ops,my $bn_obj,my $des_obj,my $bf_obj,
  $md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj)=
-       split(/\s*:\s*/,$table{$target});
+       split(/\s*:\s*/,$table{$target} . ":" x 20 , -1);
 $cflags="$flags$cflags" if ($flags ne "");
 $lflags="$libs$lflags"if ($libs ne "");
 
@@ -303,6 +305,7 @@ if ($no_asm)
        }
 
 my ($bn1)=split(/\s+/,$bn_obj);
+$bn1 = "" unless defined $bn1;
 $bn1=$bn_asm unless ($bn1 =~ /\.o$/);
 $bn_obj="$bn1";
 
@@ -596,7 +599,8 @@ sub bad_target
        print STDERR "Usage: Configure [-Dxxx] [-Lxxx] [-lxxx] os/compiler\n";
        print STDERR "pick os/compiler from:";
        my $j=0;
-       foreach my $i (sort keys %table)
+       my $i;
+       foreach $i (sort keys %table)
                {
                print STDERR "\n" if ($j++ % 4) == 0;
                printf(STDERR "%-18s ",$i);
@@ -607,13 +611,12 @@ sub bad_target
 sub Rename
        {
        my($from,$to)=@_;
-
        unlink($to);
        if(!rename($from,$to))
            {
-           POSIX::errno() == POSIX::ENOENT || die "unable to rename $from to $to:$!\n";
+            -e $from && die "unable to rename $from to $to:$!\n";
            }
        }
 
-sub file_new { local($a)=@_; $a =~ s/(\.[^.]+$|$)/.new/; $a; }
-sub file_old { local($a)=@_; $a =~ s/(\.[^.]+$|$)/.old/; $a; }
+sub file_new { my($a)=@_; $a =~ s/(\.[^.]+$|$)/.new/; $a; }
+sub file_old { my($a)=@_; $a =~ s/(\.[^.]+$|$)/.old/; $a; }