util/pl/VC-32.pl: refresh, switch to ws2, add crypt32, fix typo (based on
authorAndy Polyakov <appro@openssl.org>
Tue, 18 Dec 2012 09:42:31 +0000 (09:42 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 18 Dec 2012 09:42:31 +0000 (09:42 +0000)
suggestions from Pierre Delaage).

util/pl/VC-32.pl

index 68865a8..69197b0 100644 (file)
@@ -96,7 +96,7 @@ elsif ($FLAVOR =~ /CE/)
     $wcetgt = $ENV{'TARGETCPU'};       # just shorter name...
     SWITCH: for($wcetgt) {
        /^X86/          && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
-                               $wcelflag.=" /machine:IX86";    last; };
+                               $wcelflag.=" /machine:X86";     last; };
        /^ARMV4[IT]/    && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
                                $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
                                $wcecdefs.=" -QRarch4T -QRinterwork-return";
@@ -121,12 +121,12 @@ elsif ($FLAVOR =~ /CE/)
          $wcelflag.=" /machine:$wcetgt";                       last; };
     }
 
-    $cc='$(CC)';
+    $cc=($ENV{CC} or "cl");
     $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT';
     $base_cflags.=" $wcecdefs";
     $base_cflags.=' -I$(WCECOMPAT)/include'            if (defined($ENV{'WCECOMPAT'}));
     $base_cflags.=' -I$(PORTSDK_LIBPATH)/../../include'        if (defined($ENV{'PORTSDK_LIBPATH'}));
-    if (`cl 2>&1` =~ /Version 1[4-9]\./) {
+    if ($cc =~ /\bcl(\.exe)*$/) {
        $base_cflags.=($shlib and !$fipscanisterbuild)?' /MD':' /MT';
     } else {
        $base_cflags.=' /MC';
@@ -178,14 +178,26 @@ $rsc="rc";
 $efile="/out:";
 $exep='.exe';
 if ($no_sock)          { $ex_libs=''; }
-elsif ($FLAVOR =~ /CE/)        { $ex_libs='winsock.lib'; }
+elsif ($FLAVOR =~ /CE/)        { $ex_libs='ws2.lib'; }
 else                   { $ex_libs='ws2_32.lib'; }
 
 if ($FLAVOR =~ /CE/)
        {
-       $ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib'   if (defined($ENV{'WCECOMPAT'}));
+       $ex_libs.=' crypt32.lib';       # for e_capi.c
+       if (defined($ENV{WCECOMPAT}))
+               {
+               $ex_libs.= ' $(WCECOMPAT)/lib';
+               if (-f "$ENV{WCECOMPAT}/lib/$ENV{TARGETCPU}/wcecompatex.lib")
+                       {
+                       $ex_libs.='/$(TARGETCPU)/whecompatex.lib';
+                       }
+               else
+                       {
+                       $ex_libs.='/wcecompatex.lib';
+                       }
+               }
        $ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib'     if (defined($ENV{'PORTSDK_LIBPATH'}));
-       $ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
+       $ex_libs.=' /nodefaultlib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
        }
 else
        {