Extensively changed the DEF file generator mkdef.pl to use a modified version
[openssl.git] / Configure
index 57b536c4169bdca46c4e8042122bb53d35ade77e..98644fb182ddd3136cd9526321074f2b65935572 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -10,7 +10,7 @@ use strict;
 
 # see INSTALL for instructions.
 
-my $usage="Usage: Configure [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-asm] [rsaref] [--openssldir=OPENSSLDIR] [--prefix=DIR] os/compiler\n";
+my $usage="Usage: Configure [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [rsaref] [no-asm] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] os/compiler[:flags]\n";
 
 # Options:
 # --openssldir  install OpenSSL in OPENSSLDIR (Default: DIR/ssl if the
@@ -318,6 +318,7 @@ foreach (@ARGV)
                else
                        {
                        print STDERR $usage;
+                       exit(1);
                        }
                }
        elsif ($_ =~ /^([^:]+):(.+)$/) {
@@ -333,6 +334,8 @@ foreach (@ARGV)
 
 &usage if (!defined($table{$target}));
 
+my $IsWindows=scalar grep /^$target$/,@WinTargets;
+
 $openssldir="/usr/local/ssl" if ($openssldir eq "" and $installprefix eq "");
 $installprefix=$openssldir if $installprefix eq "";
 
@@ -342,7 +345,6 @@ chop $installprefix if $installprefix =~ /\/$/;
 $openssldir=$installprefix . "/ssl" if $openssldir eq "";
 $openssldir=$installprefix . "/" . $openssldir if $openssldir !~ /^\//;
 
-my $IsWindows=scalar grep /^$target$/,@WinTargets;
 
 print "IsWindows=$IsWindows\n";
 
@@ -477,8 +479,8 @@ open(IN,'<crypto/opensslconf.h.in') || die "unable to read crypto/opensslconf.h.
 open(OUT,'>crypto/opensslconf.h') || die "unable to create crypto/opensslconf.h:$!\n";
 while (<IN>)
        {
-       if      (/^#defined\s+OPENSSLDIR/)
-               { print OUT "#define OPENSSLDIR $openssldir\n"; }
+       if      (/^#define\s+OPENSSLDIR/)
+               { print OUT "#define OPENSSLDIR \"$openssldir\"\n"; }
        elsif   (/^#((define)|(undef))\s+SIXTY_FOUR_BIT_LONG/)
                { printf OUT "#%s SIXTY_FOUR_BIT_LONG\n",($b64l)?"define":"undef"; }
        elsif   (/^#((define)|(undef))\s+SIXTY_FOUR_BIT/)
@@ -547,18 +549,22 @@ if($IsWindows) {
        open (OUT,">crypto/date.h") || die "Can't open date.h";
        printf OUT "#define DATE \"%s\"\n", scalar gmtime();
        close(OUT);
+} else {
+       (system 'make -f Makefile.ssl links') == 0 or exit $?;
+       &dofile("tools/c_rehash",$openssldir,'^DIR=',   'DIR=%s',);
+       &dofile("util/mk1mf.pl",$openssldir,
+                               ('^\$INSTALLTOP=','$INSTALLTOP="%s";',));
 }
 
-if (!$IsWindows)
-       {
-       (system 'make -f Makefile.ssl links') == 0 or exit $?;
-       }
 
-&dofile("tools/c_rehash",$openssldir,'^DIR=',  'DIR=%s',);
-&dofile("util/mk1mf.pl",$openssldir,('^\$INSTALLTOP=','$INSTALLTOP="%s";',));
+my $pwd;
 
-my $pwd=`pwd`;
-chop($pwd);
+if($IsWindows) {
+       $pwd="(include directory)";
+} else {
+       $pwd =`pwd`;
+       chop($pwd);
+}
 print <<EOF;
 
 NOTE: The OpenSSL header files have been moved from include/*.h