Hi,

At 01 Aug 2005 11:31:57 +0200 Andy Polyakov wrote:
> And therefore I've decided to eliminate dependency on wcedefs.mak [from
> wcecompat] and implemented the corresponding logic directly to VC-32.mak.
> Grab latest snapshot to test it. For reference. Note that this change
> doesn't eliminate dependency on wcecompat [which is not the goal], but
> dependency on wcedefs.mak file from wcecompat. A.


I got openssl-0.9.8-stable-SNAP-20050801.tar.gz and found some problems.

1. Use /MC instead of /MD and /MDd
/MD and /MDd are not supported for Windows CE.

2. Define UNDER_CE as well as _WIN32_WCE.
Some system headers use UNDER_CE instead of _WIN32_CE.

3. Define CPU dependent macros such as _X86_ or _ARM_
System headers use them.

4. /Gs0 is not supported by the compiler for SH3 and SH4

5. /Qsh4 is required for SH4


Here is a patch.

I've tested it for Pocket PC platforms, but not tested for other
platforms and emulartion environments. I'll do it later.


--- openssl-0.9.8-stable-SNAP-20050801.orig/util/pl/VC-32.pl 2005-07-31 05:05:40.000000000 +0900
+++ openssl-0.9.8-stable-SNAP-20050801/util/pl/VC-32.pl 2005-08-02 23:33:19.006385400 +0900
@@ -41,6 +41,7 @@
$wcevers = $ENV{'OSVERSION'}; # WCENNN
die '%OSVERSION% value is insane' if ($wcevers !~ /^WCE([1-9])([0-9]{2})$/);
$wcecdefs = "-D_WIN32_WCE=$1$2"; # -D_WIN32_WCE=NNN
+ $wcecdefs .= "-DUNDER_CE=$1$2"; # -DUNDER_CE=NNN
$wcelflag = "/subsystem:windowsce,$1.$2"; # ...,N.NN
if ($ENV{'TARGETCPU'} =~ /^X86/)
{ $wcelflag .= " /machine:X86"; }
@@ -49,12 +50,24 @@
$wceplatf = $ENV{'PLATFORM'};
$wceplatf =~ tr/a-z0-9 /A-Z0-9_/d;
$wcecdefs .= " -DWCEPLATFORM=$wceplatf";
+ if ($ENV{'TARGETCPU'} =~ /^X86/)
+ { $wcecdefs .= " -Dx86 -D_X86_" }
+ elsif ($ENV{'TARGETCPU'} =~ /^R4[0-9]{3}/)
+ { $wcecdefs .= " -DMIPS -D_MIPS_ -DMIPS_R4000" }
+ elsif ($ENV{'TARGETCPU'} =~ /^ARM/)
+ { $wcecdefs .= " -DARM -D_ARM_" }
+ else
+ { $wcecdefs .= " -D$ENV{'TARGETCPU'} -D_$ENV{'TARGETCPU'}_" }
+ if ($ENV{'TARGETCPU'} =~ /^SH[0-9]/)
+ { $wcecdefs .= " -DSHx" }

$cc='$(CC)';
- $base_cflags=' /W3 /WX /Gs0 /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include';
+ $base_cflags=' /W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYSNAME_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -I$(WCECOMPAT)/include';
+ $base_cflags.= " /Gs0" if ($ENV{'TARGETCPU'} !~ /^SH[0-9]/);
$base_cflags.=" $wcecdefs";
- $opt_cflags=' /MD /Ox /O2 /Ob2';
- $dbg_clfags=' /MDd /Od -DDEBUG -D_DEBUG';
+ $base_cflags.=" -Qsh4" if ($ENV{'TARGETCPU'} =~ /^SH4/);
+ $opt_cflags=' /MC /Ox /O2 /Ob2';
+ $dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
$lflags="/nologo /opt:ref $wcelflag";
}
else # Win32


--
Satoshi Nakamura
__________________________________________________ ____________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-dev@openssl.org
Automated List Manager majordomo@openssl.org