1PERLCE(1) Perl Programmers Reference Guide PERLCE(1)
2
3
4
6 perlce - Perl for WinCE
7
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
21 normal 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
27 within reach; it rather will use "Config.pm" from within cross-
28 compilation 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
32 that 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
37 a 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
44 a build of each extension in turn.
45
46 All invokes of "Makefile.PL" are provided with "-MCross" so to
47 enable 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://www.rainer-keuchel.de/wince/dirlist.html <http://www.rainer-
68 keuchel.de/wince/dirlist.html>
69
70 Make
71
72 Normally you only need to edit "./win32/ce-helpers/compile.bat" to
73 reflect your system and run it.
74
75 File "./win32/ce-helpers/compile.bat" is actually a wrapper to call
76 "nmake -f makefile.ce" with appropriate parameters and it accepts extra
77 parameters and forwards them to "nmake" command as additional
78 arguments. You should pass target this way.
79
80 To prepare distribution you need to do following:
81
82 · go to "./win32" subdirectory
83
84 · edit file "./win32/ce-helpers/compile.bat"
85
86 · run
87 compile.bat
88
89 · run
90 compile.bat dist
91
92 "Makefile.ce" has "CROSS_NAME" macro, and it is used further to refer
93 to your cross-compilation scheme. You could assign a name to it, but
94 this is not necessary, because by default it is assigned after your
95 machine configuration name, such as "wince-sh3-hpc-wce211", and this is
96 enough to distinguish different builds at the same time. This option
97 could be handy for several different builds on same platform to
98 perform, say, threaded build. In a following example we assume that all
99 required environment variables are set properly for C cross-compiler (a
100 special *.bat file could fit perfectly to this purpose) and your
101 "compile.bat" has proper "MACHINE" parameter set, to, say,
102 "wince-mips-pocket-wce300".
103
104 compile.bat
105 compile.bat dist
106 compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define"
107 compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" dist
108
109 If all goes okay and no errors during a build, you'll get two
110 independent distributions: "wince-mips-pocket-wce300" and
111 "mips-wce300-thr".
112
113 Target "dist" prepares distribution file set. Target "zipdist" performs
114 same as "dist" but additionally compresses distribution files into zip
115 archive.
116
117 NOTE: during a build there could be created a number (or one) of
118 "Config.pm" for cross-compilation ("foreign" "Config.pm") and those are
119 hidden inside "../xlib/$(CROSS_NAME)" with other auxilary files, but,
120 and this is important to note, there should be no "Config.pm" for host
121 miniperl. If you'll get an error that perl could not find Config.pm
122 somewhere in building process this means something went wrong. Most
123 probably you forgot to specify a cross-compilation when invoking
124 miniperl.exe to Makefile.PL When building an extension for cross-
125 compilation your command line should look like
126
127 ..\miniperl.exe -I..\lib -MCross=mips-wce300-thr Makefile.PL
128
129 or just
130
131 ..\miniperl.exe -I..\lib -MCross Makefile.PL
132
133 to refer a cross-compilation that was created last time.
134
135 All questions related to building for WinCE devices could be asked in
136 perlce-user@lists.sourceforge.net mailing list.
137
139 DESCRIPTION
140 PerlCE is currently linked with a simple console window, so it also
141 works on non-hpc devices.
142
143 The simple stdio implementation creates the files "stdin.txt",
144 "stdout.txt" and "stderr.txt", so you might examine them if your
145 console has only a liminted number of cols.
146
147 When exitcode is non-zero, a message box appears, otherwise the console
148 closes, so you might have to catch an exit with status 0 in your
149 program to see any output.
150
151 stdout/stderr now go into the files "/perl-stdout.txt" and
152 "/perl-stderr.txt."
153
154 PerlIDE is handy to deal with perlce.
155
156 LIMITATIONS
157 No fork(), pipe(), popen() etc.
158
159 ENVIRONMENT
160 All environment vars must be stored in HKLM\Environment as strings.
161 They are read at process startup.
162
163 PERL5LIB
164 Usual perl lib path (semi-list).
165
166 PATH
167 Semi-list for executables.
168
169 TMP - Tempdir.
170
171 UNIXROOTPATH
172 - Root for accessing some special files, i.e. "/dev/null",
173 "/etc/services".
174
175 ROWS/COLS
176 - Rows/cols for console.
177
178 HOME
179 - Home directory.
180
181 CONSOLEFONTSIZE
182 - Size for console font.
183
184 You can set these with cereg.exe, a (remote) registry editor or via the
185 PerlIDE.
186
187 REGISTRY
188 To start perl by clicking on a perl source file, you have to make the
189 according entries in HKCR (see "ce-helpers/wince-reg.bat"). cereg.exe
190 (which must be executed on a desktop pc with ActiveSync) is reported
191 not to work on some devices. You have to create the registry entries
192 by hand using a registry editor.
193
194 XS
195 The following Win32-Methods are built-in:
196
197 newXS("Win32::GetCwd", w32_GetCwd, file);
198 newXS("Win32::SetCwd", w32_SetCwd, file);
199 newXS("Win32::GetTickCount", w32_GetTickCount, file);
200 newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
201 newXS("Win32::IsWinNT", w32_IsWinNT, file);
202 newXS("Win32::IsWin95", w32_IsWin95, file);
203 newXS("Win32::IsWinCE", w32_IsWinCE, file);
204 newXS("Win32::CopyFile", w32_CopyFile, file);
205 newXS("Win32::Sleep", w32_Sleep, file);
206 newXS("Win32::MessageBox", w32_MessageBox, file);
207 newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file);
208 newXS("Win32::GetOemInfo", w32_GetOemInfo, file);
209 newXS("Win32::ShellEx", w32_ShellEx, file);
210
211 BUGS
212 Opening files for read-write is currently not supported if they use
213 stdio (normal perl file handles).
214
215 If you find bugs or if it does not work at all on your device, send
216 mail to the address below. Please report the details of your device
217 (processor, ceversion, devicetype (hpc/palm/pocket)) and the date of
218 the downloaded files.
219
220 INSTALLATION
221 Currently installation instructions are at
222 <http://perlce.sourceforge.net/>.
223
224 After installation & testing processes will stabilize, information will
225 be more precise.
226
228 The port for Win32 was used as a reference.
229
231 5.6.0
232 Initial port of perl to WinCE. It was performed in separate
233 directory named "wince". This port was based on contents of
234 "./win32" directory. "miniperl" was not built, user must have HOST
235 perl and properly edit "makefile.ce" to reflect this.
236
237 5.8.0
238 wince port was kept in the same "./wince" directory, and
239 "wince/Makefile.ce" was used to invoke native compiler to create
240 HOST miniperl, which then facilitates cross-compiling process.
241 Extension building support was added.
242
243 5.9.4
244 Two directories "./win32" and "./wince" were merged, so perlce
245 build process comes in "./win32" directory.
246
248 Rainer Keuchel <coyxc@rainer-keuchel.de>
249 provided initial port of Perl, which appears to be most essential
250 work, as it was a breakthrough on having Perl ported at all. Many
251 thanks and obligations to Rainer!
252
253 Vadim Konovalov
254 made further support of WinCE port.
255
256
257
258perl v5.12.4 2011-06-07 PERLCE(1)