Clarify example of .. in perlop
[p5sagit/p5-mst-13.2.git] / README.ce
CommitLineData
e1caacb4 1If you read this file _as_is_, just ignore the funny characters you
2see. It is written in the POD format (see pod/perlpod.pod) which is
3specifically designed to be readable as is.
4
c7bcd97d 5=head1 NAME
e1caacb4 6
c7bcd97d 7perlce - Perl for WinCE
e1caacb4 8
75472953 9=head1 Building Perl for WinCE
10
11=head2 DESCRIPTION
e1caacb4 12
2e64bfdb 13This file gives the instructions for building Perl5.8 and above for
e1caacb4 14WinCE. Please read and understand the terms under which this
15software is distributed.
16
75472953 17=head2 General explanations on cross-compiling WinCE
e1caacb4 18
75472953 19=over
20
21=item *
22
23C<miniperl> is built. This is a single executable (without DLL), intended
24to run on Win32, and it will facilitate remaining build process; all binaries
25built after it are foreign and should not run locally.
26
27C<miniperl> is built using ../win32/Makefile; this is part of normal
28build process invoked as dependency from wince/Makefile.ce
29
30=item *
31
32After C<miniperl> is built, 'configpm' is invoked to create right Config.pm
33in right place and its corresponding Cross.pm.
2e64bfdb 34
75472953 35Unlike Win32 build, miniperl will not have Config.pm of host within reach;
36it rather will use Config.pm from within cross-compilation directories.
2e64bfdb 37
75472953 38File Cross.pm is dead simple: for given cross-architecture places in @INC
39a path where perl modules are, and right Config.pm in that place.
e1caacb4 40
75472953 41That said, C<miniperl -Ilib -MConfig -we 1> should report an error, because
42it can not find Config.pm. If it does not gives an error -- wrong Config.pm
43is substituted, and resulting binaries will be a mess.
44
45C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide right
46Config.pm for further compilations.
47
48=item *
49
50During extensions build phase, a script C<./win32/buldext.pl> is invoked,
51which in turn steps in ./ext subdirectories and performs a build of
52each extension in turn.
53
54All invokes of Makefile.PL are provided with C<-MCross> so to enable cross-
55compile.
56
57=item *
58
59=back
8f33b42a 60
75472953 61=head2 BUILD
62
63This section describes the steps to be performed to build PerlCE.
64You may find additional information about building perl for WinCE
65at L<http://perlce.sourceforge.net> and some pre-built binaries.
66
67=head3 Tools & SDK
e1caacb4 68
2e64bfdb 69For compiling, you need following:
70
71=over 4
72
73=item * Microsoft Embedded Visual Tools
74
75=item * Microsoft Visual C++
76
77=item * Rainer Keuchel's celib-sources
78
79=item * Rainer Keuchel's console-sources
80
81=back
e1caacb4 82
75472953 83Needed source files can be downloaded at
84L<http://www.rainer-keuchel.de/wince/dirlist.html>
e1caacb4 85
75472953 86=head3 Make
e1caacb4 87
75472953 88Normally you only need to edit ./wince/compile.bat
2e64bfdb 89to reflect your system and run it.
e1caacb4 90
2e64bfdb 91File ./wince/compile.bat is actually a wrapper to call
92nmake -f makefile.ce with appropriate parameters and it accepts extra
93parameters and forwards them to "nmake" command as additional
94arguments. You should pass target this way.
e1caacb4 95
8f33b42a 96To prepare distribution you need to do following:
2e64bfdb 97
98=over 4
99
100=item * go to ./wince subdirectory
101
102=item * edit file compile.bat
e1caacb4 103
2e64bfdb 104=item * run
105 compile.bat
e1caacb4 106
2e64bfdb 107=item * run
108 compile.bat dist
e1caacb4 109
2e64bfdb 110=back
111
8f33b42a 112makefile.ce has CROSS_NAME macro, and it is used further to refer to
113your cross-compilation scheme. You could assign a name to it, but this
114is not necessary, because by default it is assigned after your machine
115configuration name, such as "wince-sh3-hpc-wce211", and this is enough
116to distinguish different builds at the same time. This option could be
117handy for several different builds on same platform to perform, say,
118threaded build. In a following example we assume that all required
119environment variables are set properly for C cross-compiler (a special
120*.bat file could fit perfectly to this purpose) and your compile.bat
121has proper "MACHINE" parameter set, to, say, "wince-mips-pocket-wce300".
122
123 compile.bat
124 compile.bat dist
125 compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define"
126 compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" dist
127
128If all goes okay and no errors during a build, you'll get two independent
129distributions: "wince-mips-pocket-wce300" and "mips-wce300-thr".
130
131Target 'dist' prepares distribution file set. Target 'zipdist' performs
132same as 'dist' but additionally compresses distribution files into zip
133archive.
134
135NOTE: during a build there could be created a number (or one) of Config.pm
136for cross-compilation ("foreign" Config.pm) and those are hidden inside
137../xlib/$(CROSS_NAME) with other auxilary files, but, and this is important to
138note, there should be *no* Config.pm for host miniperl.
139If you'll get an error that perl could not find Config.pm somewhere in building
140process this means something went wrong. Most probably you forgot to
141specify a cross-compilation when invoking miniperl.exe to Makefile.PL
142When building an extension for cross-compilation your command line should
143look like
144
145 ..\miniperl.exe -I..\lib -MCross=mips-wce300-thr Makefile.PL
146
147or just
148
149 ..\miniperl.exe -I..\lib -MCross Makefile.PL
150
151to refer a cross-compilation that was created last time.
152
8f33b42a 153All questions related to building for WinCE devices could be asked in
154perlce-users@lists.sourceforge.net mailing list.
e1caacb4 155
75472953 156=head1 Using Perl on WinCE
157
158=head2 DESCRIPTION
159
160PerlCE is currently linked with a simple console window, so it also
161works on non-hpc devices.
162
163The simple stdio implementation creates the files stdin.txt,
164stdout.txt and stderr.txt, so you might examine them if your
165console has only a liminted number of cols.
166
167When exitcode is non-zero, a message box appears, otherwise the
168console closes, so you might have to catch an exit with
169status 0 in your program to see any output.
170
171stdout/stderr now go into the files /perl-stdout.txt and
172/perl-stderr.txt.
173
174=head2 LIMITATIONS
175
176No fork(), pipe(), popen() etc.
177
178=head2 ENVIRONMENT
179
180All environment vars must be stored in HKLM\Environment as
181strings. They are read at process startup.
182
183 PERL5LIB - Usual perl lib path (semi-list).
184 PATH - Semi-list for executables.
185 TMP - Tempdir.
186 UNIXROOTPATH - Root for accessing some special files,
187 i.e. /dev/null, /etc/services.
188 ROWS/COLS - Rows/cols for console.
189 HOME - Home directory.
190 CONSOLEFONTSIZE - Size for console font.
191
192You can set these with cereg.exe, a (remote) registry editor
193or via the PerlIDE.
194
195=head2 REGISTRY
196
197To start perl by clicking on a perl source file, you have
198to make the according entries in HKCR (see wince-reg.bat).
199cereg.exe (which must be executed on a desktop pc with
200ActiveSync) is reported not to work on some devices.
201You have to create the registry entries by hand using a
202registry editor.
203
204=head2 PERLFILES
205
206The following files are a reasonable minimum if you want to do
207some socket stuff:
208
209 ./auto
210 ./auto/DynaLoader
211 ./auto/DynaLoader/autosplit.ix
212 ./auto/DynaLoader/dl_expandspec.al
213 ./auto/DynaLoader/dl_findfile.al
214 ./auto/DynaLoader/dl_find_symbol_anywhere.al
215 ./auto/IO
216 ./auto/IO/IO.bs
217 ./auto/IO/IO.dll
218 ./auto/Socket
219 ./auto/Socket/Socket.bs
220 ./auto/Socket/Socket.dll
221 ./Carp
222 ./Carp/Heavy.pm
223 ./Carp.pm
224 ./Config.pm
225 ./DynaLoader.pm
226 ./Exporter
227 ./Exporter/Heavy.pm
228 ./Exporter.pm
229 ./IO
230 ./IO/File.pm
231 ./IO/Handle.pm
232 ./IO/Socket.pm
233 ./IO.pm
234 ./SelectSaver.pm
235 ./Socket.pm
236 ./strict.pm
237 ./Symbol.pm
238 ./warnings
239 ./warnings/register.pm
240 ./warnings.pm
241 ./XSLoader.pm
242
243=head2 XS
244
245The following Win32-Methods are built-in:
246
247 newXS("Win32::GetCwd", w32_GetCwd, file);
248 newXS("Win32::SetCwd", w32_SetCwd, file);
249 newXS("Win32::GetTickCount", w32_GetTickCount, file);
250 newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
251 newXS("Win32::IsWinNT", w32_IsWinNT, file);
252 newXS("Win32::IsWin95", w32_IsWin95, file);
253 newXS("Win32::IsWinCE", w32_IsWinCE, file);
254 newXS("Win32::CopyFile", w32_CopyFile, file);
255 newXS("Win32::Sleep", w32_Sleep, file);
256 newXS("Win32::MessageBox", w32_MessageBox, file);
257 newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file);
258 newXS("Win32::GetOemInfo", w32_GetOemInfo, file);
259 newXS("Win32::ShellEx", w32_ShellEx, file);
260
261=head2 BUGS
262
263Opening files for read-write is currently not supported if
264they use stdio (normal perl file handles).
265
266If you find bugs or if it does not work at all on your
267device, send mail to the address below. Please report
268the details of your device (processor, ceversion,
269devicetype (hpc/palm/pocket)) and the date of the downloaded
270files.
271
272=head2 INSTALLATION
273
274Currently installation instructions are at L<http://perlce.sourceforge.net/>.
275
276After installation & testing processes will stabilize, information will
277be more precise.
278
c7bcd97d 279=head1 ACKNOWLEDGEMENTS
e1caacb4 280
281The port for Win32 was used as a reference.
282
2e64bfdb 283=head1 AUTHORS
e1caacb4 284
75472953 285=over
286
287=item Rainer Keuchel <coyxc@rainer-keuchel.de>
288
289provided initial port of Perl, which appears to be most essential work, as
290it was a breakthrough on having Perl ported at all.
291Many thanks and obligations to Rainer!
292
293=item Vadim Konovalov
294
295made further support of WinCE port.
296
297=back
2e64bfdb 298