This script tries to figure out which compiler is installed, then
configures and compiles OpenSSL. (Tested with Mingw32 only.) Comments?

# ms/config.pl

my $compiler = "";
my $asm = "no-asm";

$compiler = "BC-NT" if &find("bcc32");
$compiler = "Mingw32" if &find("gcc");
$compiler = "VC-WIN32" if &find("cl");

die "No compiler found. Be sure to set the PATH correctly.\n" if $compiler eq "";

print "Looks like your compiler is $compiler ...\n";

if ($compiler eq "VC-WIN32") {
        $asm = "masm" if &find("nasmw");
        $asm = "masm" if &find("ml");
        print "Looks like your assembler is $asm ...\n";
}

#########################################################################

system ("perl Configure $compiler @ARGV") == 0 or die;
system ('perl util\mkfiles.pl >MINFO') == 0 or die;
system ('perl util\mkdef.pl 32 libeay ms\\libeay32.def') == 0 or die;
system ('perl util\mkdef.pl 32 ssleay ms\\ssleay32.def') == 0 or die;

if ($compiler eq "Mingw32") {
        system ('perl util\mk1mf.pl Mingw32 >ms\mingw32.mak') == 0 or die;
        system ('perl util\mk1mf.pl Mingw32-files >ms\mingw32f.mak') == 0 or die;
        # Creating files -- this can be skipped if using the GNU file utilities
        system ('make -f ms/mingw32f.mak') == 0 or
          print "You can ignore the error messages above.\n";
        system ('make -f ms/mingw32.mak') == 0 or die;
        # Generate the DLLs and input libraries
        system ('dllwrap --dllname libeay32.dll --output-lib out/libeay32.a --def 
ms/libeay32.def out/libcrypto.a -lwsock32 -lgdi32') == 0 or die;
        system ('dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def 
ms/ssleay32.def out/libssl.a out/libeay32.a') == 0 or die;
}

if ($compiler eq "BC-NT") {
        system ('perl util\mk1mf.pl no-asm BC-NT >ms\bcb.mak') == 0 or die;
        system ('make -f ms\bcb.mak') == 0 or die;
}

if ($compiler eq "VC-WIN32") {
        if ($asm ne "no-asm") {
                die "XXXXXXXXXXXXXXXX"; # generate asm files...
        }
        system ("perl util\\mk1mf.pl $asm VC-WIN32 >ms\\nt.mak") == 0 or die;
        system ("perl util\\mk1mf.pl dll $asm VC-WIN32 >ms\\ntdll.mak") == 0 or die;
        system ('nmake -f ms\ntdll.mak') == 0 or die;
}

print "\nDone compiling OpenSSL.\n";
exit(1);

sub find {
        my ($name)=@_;
        my $path;
        foreach $path (split /;/, $ENV{PATH}) {
                return "$path\\$name.exe" if (-f "$path\\$name.exe");
        }
}

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to