Rename asc2uni and uni2asc functions to avoid clashes.
[openssl.git] / util / pl / VC-32.pl
index d873c721d22518ec5208343dddf0bc85a540487e..676275df67d625df039ee08f0712b238bef78704 100644 (file)
@@ -42,6 +42,7 @@ if ($FLAVOR =~ /WIN64/)
        $bname =~ s/(.*)\.[^\.]$/$1/;
        $ret=<<___;
 \$(TMP_D)$o$bname.asm: $source
+       set ASM=\$(ASM)
        \$(PERL) $source \$\@
 
 $target: \$(TMP_D)$o$bname.asm
@@ -153,7 +154,7 @@ if ($FLAVOR =~ /CE/)
        }
 else
        {
-       $ex_libs.=' gdi32.lib advapi32.lib user32.lib';
+       $ex_libs.=' gdi32.lib advapi32.lib crypt32.lib user32.lib';
        $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
        # WIN32 UNICODE build gets linked with unicows.lib for
        # backward compatibility with Win9x.
@@ -161,7 +162,7 @@ else
        }
 
 # static library stuff
-$mklib='lib';
+$mklib='lib /nologo';
 $ranlib='';
 $plib="";
 $libp=".lib";
@@ -171,9 +172,15 @@ $lfile='/out:';
 $shlib_ex_obj="";
 $app_ex_obj="setargv.obj" if ($FLAVOR !~ /CE/);
 if ($FLAVOR =~ /WIN64A/) {
-       $asm='ml64 /c /Cp /Cx';
-       $asm.=" /Zi" if $debug;
-       $afile='/Fo';
+       if (`nasm -v` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
+               $asm='nasm -f win64 -DNEAR -Ox';
+               $asm.=' -g' if $debug;
+               $afile='-o ';
+       } else {
+               $asm='ml64 /c /Cp /Cx';
+               $asm.=" /Zi" if $debug;
+               $afile='/Fo';
+       }
 } elsif ($FLAVOR =~ /WIN64I/) {
        $asm='ias';
        $asm.=" -d debug" if $debug;
@@ -186,7 +193,7 @@ if ($FLAVOR =~ /WIN64A/) {
        $asmtype="win32n";
        $afile='-o ';
 } else {
-       $asm='ml /Cp /coff /c /Cx';
+       $asm='ml /nologo /Cp /coff /c /Cx';
        $asm.=" /Zi" if $debug;
        $afile='/Fo';
        $asmtype="win32";
@@ -284,6 +291,10 @@ sub do_lib_rule
                if ($name eq "")
                        {
                        $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
+                       if ($target =~ /capi/)
+                               {
+                               $ex.=' crypt32.lib advapi32.lib';
+                               }
                        }
                elsif ($FLAVOR =~ /CE/)
                        {
@@ -295,6 +306,8 @@ sub do_lib_rule
                        {
                        $ex.=' unicows.lib' if ($FLAVOR =~ /NT/);
                        $ex.=' ws2_32.lib gdi32.lib advapi32.lib user32.lib';
+                       $ex.=' crypt32.lib';
+                       $ex.=' cryptui.lib' if $cflags =~ /-DOPENSSL_CAPIENG_DIALOG/;
                        $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
                        }
                $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;