Skip to content

Commit 176a614

Browse files
author
Andy Polyakov
committed
First draft for WCE PortSDK support. Once again! It's *draft* which requires
more work, i.e. more modifications are due...
1 parent f858d22 commit 176a614

File tree

3 files changed

+62
-33
lines changed

3 files changed

+62
-33
lines changed

INSTALL.WCE

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,36 @@
44

55
Building OpenSSL for Windows CE requires the following external tools:
66

7-
* Microsoft eMbedded Visual C++ 3.0
8-
* wcecompat compatibility library (www.essemer.com.au)
9-
* Optionally ceutils for running automated tests (www.essemer.com.au)
10-
11-
You also need Perl for Win32. You will need ActiveState Perl, available
12-
from http://www.activestate.com/ActivePerl.
13-
14-
Windows CE support in OpenSSL relies on wcecompat and therefore it's
15-
appropriate to check http://www.essemer.com.au/windowsce/ for updates in
16-
case of compilation problems. As for the moment of this writing version
17-
1.1 is available and actually required for WCE 4.2 and newer platforms.
18-
All Windows CE specific issues should be directed to www.essemer.com.au.
19-
20-
The C Runtime Library implementation for Windows CE that is included with
21-
Microsoft eMbedded Visual C++ 3.0 is incomplete and in some places
22-
incorrect. wcecompat plugs the holes and tries to bring the Windows CE
23-
CRT to a level that is more compatible with ANSI C. wcecompat goes further
24-
and provides low-level IO and stream IO support for stdin/stdout/stderr
25-
(which Windows CE does not provide). This IO functionality is not needed
26-
by the OpenSSL library itself but is used for the tests and openssl.exe.
27-
More information is available at www.essemer.com.au.
7+
* Microsoft eMbedded Visual C++ 3.0 or later
8+
* Appropriate SDK might be required
9+
* Perl for Win32 [commonly recommended ActiveState Perl is available
10+
from http://www.activestate.com/Products/ActivePerl/]
11+
12+
* wcecompat compatibility library available at
13+
http://www.essemer.com.au/windowsce/
14+
* Optionally ceutils for running automated tests (same location)
15+
16+
_or_
17+
18+
* PocketConsole driver and PortSDK available at
19+
http://www.symbolictools.de/public/pocketconsole/
20+
* CMD command interpreter (same location)
21+
22+
As Windows CE support in OpenSSL relies on 3rd party compatibility
23+
library, it's appropriate to check corresponding URL for updates. For
24+
example if you choose wcecompat, note that as for the moment of this
25+
writing version 1.2 is available and actually required for WCE 4.2
26+
and newer platforms. All wcecompat issues should be directed to
27+
www.essemer.com.au.
28+
29+
Why compatibility library at all? The C Runtime Library implementation
30+
for Windows CE that is included with Microsoft eMbedded Visual C++ is
31+
incomplete and in some places incorrect. Compatibility library plugs
32+
the holes and tries to bring the Windows CE CRT to [more] usable level.
33+
Most gaping hole in CRT is support for stdin/stdout/stderr IO, which
34+
proposed compatibility libraries solve in two different ways: wcecompat
35+
redirects IO to active sync link, while PortSDK - to NT-like console
36+
driver on the handheld itself.
2837

2938
Building
3039
--------
@@ -34,9 +43,21 @@
3443

3544
> "C:\Program Files\Microsoft eMbedded Tools\EVC\WCE300\BIN\WCEARM.BAT"
3645

37-
Next indicate where wcecompat is located:
46+
Next pick compatibility library according to your preferences.
3847

39-
> set WCECOMPAT=C:\wcecompat
48+
1. To choose wcecompat set up WCECOMPAT environment variable pointing
49+
at the location of wcecompat tree "root":
50+
51+
> set WCECOMPAT=C:\wcecompat
52+
> set PORTSDK_LIBPATH=
53+
54+
2. To choose PortSDK set up PORTSDK_LIBPATH to point at hardware-
55+
specific location where your portlib.lib is installed:
56+
57+
> set PORTSDK_LIBPATH=C:\PortSDK\lib\ARM
58+
> set WCECOMPAT=
59+
60+
Note that you may not set both variables.
4061

4162
Next you should run Configure:
4263

@@ -52,16 +73,16 @@
5273

5374
Then from the VC++ environment at a prompt do:
5475

55-
- to build static libraries:
76+
> nmake -f ms\cedll.mak
5677

57-
> nmake -f ms\ce.mak
78+
[note that static builds are not supported under CE]
5879

59-
- or to build DLLs:
80+
If all is well it should compile and you will have some DLLs and executables
81+
in out32dll*.
6082

61-
> nmake -f ms\cedll.mak
83+
<<< everyting below needs revision in respect to wcecompat vs. PortSDK >>>
6284

63-
If all is well it should compile and you will have some static libraries and
64-
executables in out32, or some DLLs and executables in out32dll. If you want
85+
If you want
6586
to try the tests then make sure the ceutils are in the path and do:
6687

6788
> cd out32

e_os.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ static unsigned int _strlen31(const char *str)
283283

284284
# ifdef OPENSSL_SYS_WINCE
285285
# define OPENSSL_NO_POSIX_IO
286-
# include <winsock_extras.h>
286+
# if defined(_WIN32_WCE) && _WIN32_WCE<410
287+
# include <winsock_extras.h>
288+
# endif
287289
# endif
288290

289291
# define ssize_t long

util/pl/VC-32.pl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@
7979
}
8080

8181
$cc='$(CC)';
82-
$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 -DOPENSSL_SMALL_FOOTPRINT';
82+
$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';
8383
$base_cflags.=" $wcecdefs";
84+
$base_cflags.=' $(WCECOMPAT)/include' if (defined($ENV{'WCECOMPAT'}));
85+
$base_cflags.=' $(PORTSDK_LIBPATH)/../../include' if (defined($ENV{'PORTSDK_LIBPATH'}));
8486
$opt_cflags=' /MC /O1i'; # optimize for space, but with intrinsics...
8587
$dbg_clfags=' /MC /Od -DDEBUG -D_DEBUG';
8688
$lflags="/nologo /opt:ref $wcelflag";
@@ -124,7 +126,8 @@
124126

125127
if ($FLAVOR =~ /CE/)
126128
{
127-
$ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib';
129+
$ex_libs.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'}));
130+
$ex_libs.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'}));
128131
$ex_libs.=' /nodefaultlib:oldnames.lib coredll.lib corelibc.lib' if ($ENV{'TARGETCPU'} eq "X86");
129132
}
130133
else
@@ -225,6 +228,7 @@
225228
elsif ($shlib && $FLAVOR =~ /CE/)
226229
{
227230
$mlflags.=" $lflags /dll";
231+
$lflags.=' /entry:mainCRTstartup' if(defined($ENV{'PORTSDK_LIBPATH'}));
228232
$lib_cflag=" -D_WINDLL -D_DLL";
229233
$out_def='out32dll_$(TARGETCPU)';
230234
$tmp_def='tmp32dll_$(TARGETCPU)';
@@ -259,7 +263,9 @@ sub do_lib_rule
259263
{}
260264
elsif ($FLAVOR =~ /CE/)
261265
{
262-
$ex.=' winsock.lib $(WCECOMPAT)/lib/wcecompatex.lib';
266+
$ex.=' winsock.lib';
267+
$ex.=' $(WCECOMPAT)/lib/wcecompatex.lib' if (defined($ENV{'WCECOMPAT'}));
268+
$ex.=' $(PORTSDK_LIBPATH)/portlib.lib' if (defined($ENV{'PORTSDK_LIBPATH'}));
263269
}
264270
else
265271
{

0 commit comments

Comments
 (0)