Ugly hack to make sure static libraries are usable. Without this,
[openssl.git] / util / pl / VC-32.pl
index 9167abfce548fdbe5da4c046cc9b457294ac5b5f..6978104234a95f4c159e6bd59360bda504ccae40 100644 (file)
@@ -7,7 +7,7 @@ $crypto="libeay32";
 $RSAref="RSAref32";
 
 $o='\\';
-$cp='"copy /b nul+ "'; # Timestamps get stuffed otherwise
+$cp='copy nul+';       # Timestamps get stuffed otherwise
 $rm='del';
 
 # C compiler stuff
@@ -22,10 +22,11 @@ $inc_def="inc32";
 
 if ($debug)
        {
-       $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWINDOWS -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG";
+       $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG";
        $lflags.=" /debug";
        $mlflags.=' /debug';
        }
+$cflags .= " -DWINNT" if $NT == 1;
 
 $obj='.obj';
 $ofile="/Fo";
@@ -48,10 +49,14 @@ $lfile='/out:';
 
 $shlib_ex_obj="";
 $app_ex_obj="setargv.obj";
-
-$asm='ml /Cp /coff /c /Cx';
-$asm.=" /Zi" if $debug;
-$afile='/Fo';
+if ($nasm) {
+       $asm='nasmw -f win32';
+       $afile='-o ';
+} else {
+       $asm='ml /Cp /coff /c /Cx';
+       $asm.=" /Zi" if $debug;
+       $afile='/Fo';
+}
 
 $bn_asm_obj='';
 $bn_asm_src='';
@@ -107,12 +112,13 @@ sub do_lib_rule
        if (!$shlib)
                {
 #              $ret.="\t\$(RM) \$(O_$Name)\n";
-               $ret.="\t\$(MKLIB) $lfile$target @<<\n  $objs\n<<\n";
+               $ex =' advapi32.lib';
+               $ret.="\t\$(MKLIB) $lfile$target @<<\n  $objs $ex\n<<\n";
                }
        else
                {
                local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
-               $ex.=' wsock32.lib gdi32.lib';
+               $ex.=' wsock32.lib gdi32.lib advapi32.lib';
                $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target /def:ms/${Name}.def @<<\n  \$(SHLIB_EX_OBJ) $objs $ex\n<<\n";
                }
        $ret.="\n";