1PERLCE(1)              Perl Programmers Reference Guide              PERLCE(1)
2
3
4

NAME

6       perlce - Perl for WinCE
7

Building Perl for WinCE

9   DESCRIPTION
10       This file gives the instructions for building Perl5.8 and above for
11       WinCE.  Please read and understand the terms under which this software
12       is distributed.
13
14   General explanations on cross-compiling WinCE
15       ·   miniperl is built. This is a single executable (without DLL),
16           intended to run on Win32, and it will facilitate remaining build
17           process; all binaries built after it are foreign and should not run
18           locally.
19
20           miniperl is built using ./win32/Makefile; this is part of normal
21           build process invoked as dependency from wince/Makefile.ce
22
23       ·   After miniperl is built, configpm is invoked to create right
24           Config.pm in right place and its corresponding Cross.pm.
25
26           Unlike Win32 build, miniperl will not have Config.pm of host within
27           reach; it rather will use Config.pm from within cross-compilation
28           directories.
29
30           File Cross.pm is dead simple: for given cross-architecture places
31           in @INC a path where perl modules are, and right Config.pm in that
32           place.
33
34           That said, "miniperl -Ilib -MConfig -we 1" should report an error,
35           because it can not find Config.pm. If it does not give an error --
36           wrong Config.pm is substituted, and resulting binaries will be a
37           mess.
38
39           "miniperl -MCross -MConfig -we 1" should run okay, and it will
40           provide right Config.pm for further compilations.
41
42       ·   During extensions build phase, a script ./win32/buldext.pl is
43           invoked, which in turn steps in ./ext subdirectories and performs a
44           build of each extension in turn.
45
46           All invokes of Makefile.PL are provided with "-MCross" so to enable
47           cross- compile.
48
49   BUILD
50       This section describes the steps to be performed to build PerlCE.  You
51       may find additional information about building perl for WinCE at
52       <http://perlce.sourceforge.net> and some pre-built binaries.
53
54       Tools & SDK
55
56       For compiling, you need following:
57
58       ·   Microsoft Embedded Visual Tools
59
60       ·   Microsoft Visual C++
61
62       ·   Rainer Keuchel's celib-sources
63
64       ·   Rainer Keuchel's console-sources
65
66       Needed source files can be downloaded at
67       <http://perlce.sourceforge.net>
68
69       Make
70
71       Normally you only need to edit ./win32/ce-helpers/compile.bat to
72       reflect your system and run it.
73
74       File ./win32/ce-helpers/compile.bat is actually a wrapper to call
75       "nmake -f makefile.ce" with appropriate parameters and it accepts extra
76       parameters and forwards them to "nmake" command as additional
77       arguments. You should pass target this way.
78
79       To prepare distribution you need to do following:
80
81       ·   go to ./win32 subdirectory
82
83       ·   edit file ./win32/ce-helpers/compile.bat
84
85       ·   run
86             compile.bat
87
88       ·   run
89             compile.bat dist
90
91       Makefile.ce has "CROSS_NAME" macro, and it is used further to refer to
92       your cross-compilation scheme. You could assign a name to it, but this
93       is not necessary, because by default it is assigned after your machine
94       configuration name, such as "wince-sh3-hpc-wce211", and this is enough
95       to distinguish different builds at the same time. This option could be
96       handy for several different builds on same platform to perform, say,
97       threaded build. In a following example we assume that all required
98       environment variables are set properly for C cross-compiler (a special
99       *.bat file could fit perfectly to this purpose) and your compile.bat
100       has proper "MACHINE" parameter set, to, say,
101       "wince-mips-pocket-wce300".
102
103         compile.bat
104         compile.bat dist
105         compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define"
106         compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" dist
107
108       If all goes okay and no errors during a build, you'll get two
109       independent distributions: "wince-mips-pocket-wce300" and
110       "mips-wce300-thr".
111
112       Target "dist" prepares distribution file set. Target "zipdist" performs
113       same as "dist" but additionally compresses distribution files into zip
114       archive.
115
116       NOTE: during a build there could be created a number (or one) of
117       Config.pm for cross-compilation ("foreign" Config.pm) and those are
118       hidden inside ../xlib/$(CROSS_NAME) with other auxiliary files, but,
119       and this is important to note, there should be no Config.pm for host
120       miniperl.  If you'll get an error that perl could not find Config.pm
121       somewhere in building process this means something went wrong. Most
122       probably you forgot to specify a cross-compilation when invoking
123       miniperl.exe to Makefile.PL When building an extension for cross-
124       compilation your command line should look like
125
126         ..\miniperl.exe -I..\lib -MCross=mips-wce300-thr Makefile.PL
127
128       or just
129
130         ..\miniperl.exe -I..\lib -MCross Makefile.PL
131
132       to refer a cross-compilation that was created last time.
133
134       All questions related to building for WinCE devices could be asked in
135       perlce-user@lists.sourceforge.net mailing list.
136

Using Perl on WinCE

138   DESCRIPTION
139       PerlCE is currently linked with a simple console window, so it also
140       works on non-hpc devices.
141
142       The simple stdio implementation creates the files stdin.txt, stdout.txt
143       and stderr.txt, so you might examine them if your console has only a
144       limited number of cols.
145
146       When exitcode is non-zero, a message box appears, otherwise the console
147       closes, so you might have to catch an exit with status 0 in your
148       program to see any output.
149
150       stdout/stderr now go into the files /perl-stdout.txt and
151       /perl-stderr.txt.
152
153       PerlIDE is handy to deal with perlce.
154
155   LIMITATIONS
156       No fork(), pipe(), popen() etc.
157
158   ENVIRONMENT
159       All environment vars must be stored in HKLM\Environment as strings.
160       They are read at process startup.
161
162       PERL5LIB
163           Usual perl lib path (semi-list).
164
165       PATH
166           Semi-list for executables.
167
168       TMP - Tempdir.
169
170       UNIXROOTPATH
171           - Root for accessing some special files, i.e. /dev/null,
172           /etc/services.
173
174       ROWS/COLS
175           - Rows/cols for console.
176
177       HOME
178           - Home directory.
179
180       CONSOLEFONTSIZE
181           - Size for console font.
182
183       You can set these with cereg.exe, a (remote) registry editor or via the
184       PerlIDE.
185
186   REGISTRY
187       To start perl by clicking on a perl source file, you have to make the
188       according entries in HKCR (see ce-helpers/wince-reg.bat).  cereg.exe
189       (which must be executed on a desktop pc with ActiveSync) is reported
190       not to work on some devices.  You have to create the registry entries
191       by hand using a registry editor.
192
193   XS
194       The following Win32-Methods are built-in:
195
196               newXS("Win32::GetCwd", w32_GetCwd, file);
197               newXS("Win32::SetCwd", w32_SetCwd, file);
198               newXS("Win32::GetTickCount", w32_GetTickCount, file);
199               newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
200               newXS("Win32::IsWinNT", w32_IsWinNT, file);
201               newXS("Win32::IsWin95", w32_IsWin95, file);
202               newXS("Win32::IsWinCE", w32_IsWinCE, file);
203               newXS("Win32::CopyFile", w32_CopyFile, file);
204               newXS("Win32::Sleep", w32_Sleep, file);
205               newXS("Win32::MessageBox", w32_MessageBox, file);
206               newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file);
207               newXS("Win32::GetOemInfo", w32_GetOemInfo, file);
208               newXS("Win32::ShellEx", w32_ShellEx, file);
209
210   BUGS
211       Opening files for read-write is currently not supported if they use
212       stdio (normal perl file handles).
213
214       If you find bugs or if it does not work at all on your device, send
215       mail to the address below. Please report the details of your device
216       (processor, ceversion, devicetype (hpc/palm/pocket)) and the date of
217       the downloaded files.
218
219   INSTALLATION
220       Currently installation instructions are at
221       <http://perlce.sourceforge.net/>.
222
223       After installation & testing processes will stabilize, information will
224       be more precise.
225

ACKNOWLEDGEMENTS

227       The port for Win32 was used as a reference.
228

History of WinCE port

230       5.6.0
231           Initial port of perl to WinCE. It was performed in separate
232           directory named wince. This port was based on contents of ./win32
233           directory.  miniperl was not built, user must have HOST perl and
234           properly edit makefile.ce to reflect this.
235
236       5.8.0
237           wince port was kept in the same ./wince directory, and
238           wince/Makefile.ce was used to invoke native compiler to create HOST
239           miniperl, which then facilitates cross-compiling process.
240           Extension building support was added.
241
242       5.9.4
243           Two directories ./win32 and ./wince were merged, so perlce build
244           process comes in ./win32 directory.
245

AUTHORS

247       Rainer Keuchel <coyxc@rainer-keuchel.de>
248           provided initial port of Perl, which appears to be most essential
249           work, as it was a breakthrough on having Perl ported at all.  Many
250           thanks and obligations to Rainer!
251
252       Vadim Konovalov
253           made further support of WinCE port.
254
255
256
257perl v5.16.3                      2013-03-04                         PERLCE(1)
Impressum