This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Apply #30197 to win32/makefile.mk too
[perl5.git] / README.symbian
CommitLineData
27da23d5
JH
1If you read this file _as_is_, just ignore the funny characters you see.
2It is written in the POD format (see pod/perlpod.pod) which is specially
3designed to be readable as is.
4
5=head1 NAME
6
7README.symbian - Perl version 5 on Symbian OS
8
9=head1 DESCRIPTION
10
11This document describes various features of the Symbian operating
12system that will affect how Perl version 5 (hereafter just Perl)
13is compiled and/or runs.
14
d1dd14d1 15B<NOTE: this port (as of 0.4.1) does not compile into a Symbian
27da23d5
JH
16OS GUI application, but instead it results in a Symbian DLL.>
17The DLL includes a C++ class called CPerlBase, which one can then
18(derive from and) use to embed Perl into applications, see F<symbian/README>.
19
20The base port of Perl to Symbian only implements the basic POSIX-like
25ca88e0
JH
21functionality; it does not implement any further Symbian or Series 60,
22Series 80, or UIQ bindings for Perl.
27da23d5
JH
23
24It is also possible to generate Symbian executables for "miniperl"
25and "perl", but since there is no standard command line interface
26for Symbian (nor full keyboards in the devices), these are useful
27mainly as demonstrations.
28
29=head2 Compiling Perl on Symbian
30
d1dd14d1 31(0) You need to have the appropriate Symbian SDK installed.
27da23d5
JH
32
33 These instructions have been tested under various Nokia Series 60
c042ae3a 34 Symbian SDKs (1.2 to 2.6, 2.8 should also work, 1.2 compiles but
53d44271
JH
35 does not work), Series 80 2.0, and Nokia 7710 (Series 90) SDK.
36 You can get the SDKs from Forum Nokia (http://www.forum.nokia.com/).
d1dd14d1 37 A very rough port ("it compiles") to UIQ 2.1 has also been made.
27da23d5
JH
38
39 A prerequisite for any of the SDKs is to install ActivePerl
40 from ActiveState, http://www.activestate.com/Products/ActivePerl/
41
42 Having the SDK installed also means that you need to have either
43 the Metrowerks CodeWarrior installed (2.8 and 3.0 were used in testing)
44 or the Microsoft Visual C++ 6.0 installed (SP3 minimum, SP5 recommended).
45
53d44271 46 Note that for example the Series 60 2.0 VC SDK installation talks
c042ae3a 47 about ActivePerl build 518, which does no more (as of mid-2005) exist
27da23d5
JH
48 at the ActiveState website. The ActivePerl 5.8.4 build 810 was
49 used successfully for compiling Perl on Symbian. The 5.6.x ActivePerls
50 do not work.
51
52 Other SDKs or compilers like Visual.NET, command-line-only
53 Visual.NET, Borland, GnuPoc, or sdk2unix have not been tried.
54
55 These instructions almost certainly won't work with older Symbian
56 releases or other SDKs. Patches to get this port running in other
57 releases, SDKs, compilers, platforms, or devices are naturally welcome.
58
59(1) Get a Perl source code distribution (for example the file
60 perl-5.9.2.tar.gz is fine) from http://www.cpan.org/src/
61 and unpack it in your the C:/Symbian directory of your Windows
62 system.
63
64(2) Change to the perl source directory.
65
66 cd c:\Symbian\perl-5.x.x
67
68(3) Run the following script using the perl coming with the SDK
69
70 perl symbian\config.pl
71
72 You must use the cmd.exe, the Cygwin shell will not work
73 (the PATH must include the SDK tools, including a Perl,
74 which should be the case under cmd.exe)
75
76(4) Build the project, either by
77
78 make all
79
80 in cmd.exe or by using either the Metrowerks CodeWarrior
81 or the Visual C++ 6.0.
82
83 If you use the VC IDE, you will have to run F<symbian\config.pl>
84 first using the cmd.exe, and then run 'make win.mf vc6.mf' to generate
ed76c0e4
JH
85 the VC6 makefiles and workspaces. "make vc6" will compile for the VC6,
86 and "make cw" for the CodeWarrior.
27da23d5 87
53d44271
JH
88 The following SDK and compiler configurations and Nokia phones were
89 tested at some point in time (+ = compiled and PerlApp run, - = not),
27da23d5
JH
90 both for Perl 5.8.x and 5.9.x:
91
ed76c0e4
JH
92 SDK | VC | CW |
93 --------+----+----+---
94 S60 1.2 | + | + | 3650 (*)
95 S60 2.0 | + | + | 6600
96 S60 2.1 | - | + | 6670
97 S60 2.6 | + | + | 6630
53d44271 98 S60 2.8 | - | + | (not tested in a device)
25ca88e0 99 S80 2.6 | - | + | 9300
53d44271 100 S90 1.1 | + | - | 7710
d1dd14d1 101 UIQ 2.1 | - | + | (not tested in a device)
27da23d5 102
d1dd14d1 103 (*) Compiles but does not work, unfortunately, a problem with Symbian.
c042ae3a 104
27da23d5
JH
105 If you are using the 'make' directly, it is the GNU make from the SDKs,
106 and it will invoke the right make commands for the Windows emulator
107 build and the Arm target builds ('thumb' by default) as necessary.
27da23d5
JH
108
109 The build scripts assume the 'absolute style' SDK installs under C:,
110 the 'subst style' will not work.
111
112 If using the VC IDE, to build use for example the File->Open Workspace->
ed76c0e4 113 C:\Symbian\8.0a\S60_2nd_FP2\epoc32\build\symbian\perl\perl\wins\perl.dsw
27da23d5
JH
114 The emulator binaries will appear in the same directory.
115
116 If using the VC IDE, you will a lot of warnings in the beginning of
117 the build because a lot of headers mentioned by the source cannot
118 be found, but this is not serious since those headers are not used.
119
120 The Metrowerks will give a lot of warnings about unused variables and
121 empty declarations, you can ignore those.
122
123 When the Windows and Arm DLLs are built do not be scared by a very long
124 messages whizzing by: it is the "export freeze" phase where the whole
125 (rather large) API of Perl is listed.
126
127 Once the build is completed you need to create the DLL SIS file by
128
129 make perldll.sis
130
131 which will create the file perlXYZ.sis (the XYZ being the Perl version)
132 which you can then install into your Symbian device: an easy way
133 to do this is to send them via Bluetooth or infrared and just open
134 the messages.
135
136 Since the total size of all Perl SIS files once installed is
c8f896e5 137 over 2 MB, it is recommended to do the installation into a
27da23d5
JH
138 memory card (drive E:) instead of the C: drive.
139
140 The size of the perlXYZ.SIS is about 370 kB but once it is in the
141 device it is about one 750 kB (according to the application manager).
142
143 The perlXYZ.sis includes only the Perl DLL: to create an additional
144 SIS file which includes some of the standard (pure) Perl libraries,
145 issue the command
146
147 make perllib.sis
148
149 Some of the standard Perl libraries are included, but not all:
150 see L</HISTORY> or F<symbian\install.cfg> for more details
151 (250 kB -> 700 kB).
152
153 Some of the standard Perl XS extensions (see L</HISTORY> are
154 also available:
155
156 make perlext.sis
157
c8f896e5 158 which will create perlXYZext.sis (290 kB -> 770 kB).
27da23d5
JH
159
160 To compile the demonstration application PerlApp you need first to
161 install the Perl headers under the SDK.
162
163 To install the Perl headers and the class CPerlBase documentation
164 so that you no more need the Perl sources around to compile Perl
165 applications using the SDK:
166
167 make sdkinstall
168
169 The destination directory is C:\Symbian\perl\X.Y.Z. For more
170 details, see F<symbian\PerlBase.pod>.
171
172 Once the headers have been installed, you can create a SIS for
173 the PerlApp:
174
175 make perlapp.sis
176
177 The perlapp.sis (11 kB -> 16 kB) will be built in the symbian
178 subdirectory, but a copy will also be made to the main directory.
179
180 If you want to package the Perl DLLs (one for WINS, one for ARMI),
181 the headers, and the documentation:
182
183 make perlsdk.zip
184
185 which will create perlXYZsdk.zip that can be used in another
186 Windows system with the SDK, without having to compile Perl in
187 that system.
188
189 If you want to package the PerlApp sources:
190
191 make perlapp.zip
192
193 If you want to package the perl.exe and miniperl.exe, you
194 can use the perlexe.sis and miniperlexe.sis make targets.
195 You also probably want the perllib.sis for the libraries
196 and maybe even the perlapp.sis for the recognizer.
197
198 The make target 'allsis' combines all the above SIS targets.
199
200 To clean up after compilation you can use either of
201
202 make clean
203 make distclean
204
205 depending on how clean you want to be.
206
207=head2 Compilation problems
208
209If you see right after "make" this
210
211 cat makefile.sh >makefile
212 'cat' is not recognized as an internal or external command,
213 operable program or batch file.
214
215it means you need to (re)run the symbian\config.pl.
216
217If you get the error
218
219 'perl' is not recognized as an internal or external command,
220 operable program or batch file.
221
222you may need to reinstall the ActivePerl.
223
224If you see this
225
226 ren makedef.pl nomakedef.pl
227 The system cannot find the file specified.
228 C:\Symbian\...\make.exe: [rename_makedef] Error 1 (ignored)
229
230please ignore it since it is nothing serious (the build process of
231renames the Perl makedef.pl as nomakedef.pl to avoid confusing it
232with a makedef.pl of the SDK).
233
234=head2 PerlApp
235
236The PerlApp application demonstrates how to embed Perl interpreters
237to a Symbian application. The "Time" menu item runs the following
238Perl code: C<print "Running in ", $^O, "\n", scalar localtime>,
239the "Oneliner" allows one to type in Perl code, and the "Run"
240opens a file chooser for selecting a Perl file to run.
241
242The PerlApp also is started when the "Perl recognizer" (also included
243and installed) detects a Perl file being activated througg the GUI,
244and offers either to install it under \Perl (if the Perl file is in
245the inbox of the messaging application) or to run it (if the Perl file
246is under \Perl).
247
f26f4a2f
JH
248=head2 sisify.pl
249
250In the symbian subdirectory there is sisify.pl utility which can be
251used to package Perl scripts and/or Perl library directories into SIS
252files, which can be installed to the device. To run the sisify.pl
253utility, you will need to have the 'makesis' and 'uidcrc' utilities
ed76c0e4 254already installed. If you don't have the Win32 SDKs, you may try
f26f4a2f
JH
255for example http://gnupoc.sourceforge.net/ or http://symbianos.org/~andreh/.
256
27da23d5
JH
257=head2 Using Perl in Symbian
258
259First of all note that you have full access to the Symbian device
260when using Perl: you can do a lot of damage to your device (like
261removing system files) unless you are careful. Please do take
262backups before doing anything.
263
264The Perl port has been done for the most part using the Symbian
265standard POSIX-ish STDLIB library. It is a reasonably complete
266library, but certain corners of such emulation libraries that tend
267to be left unimplemented on non-UNIX platforms have been left
268unimplemented also this time: fork(), signals(), user/group ids,
269select() working for sockets, non-blocking sockets, and so forth.
270See the file symbian/config.sh and look for 'undef' to find the
271unsupported APIs (or from Perl use Config).
272
273The filesystem of Symbian devices uses DOSish syntax, "drives"
ed76c0e4
JH
274separated from paths by a colon, and backslashes for the path. The
275exact assignment of the drives probably varies between platforms, but
276for example in Series 60 you might see C: as the (flash) main memory,
277D: as the RAM drive, E: as the memory card (MMC), Z: as the ROM. In
278Series 80 D: is the memory card. As far the devices go the NUL: is
279the bit bucket, the COMx: are the serial lines, IRCOMx: are the IR
280ports, TMP: might be C:\System\Temp. Remember to double those
281backslashes in doublequoted strings.
27da23d5
JH
282
283The Perl DLL is installed in \System\Libs\. The Perl libraries and
284extension DLLs are installed in \System\Libs\Perl\X.Y.Z\. The PerlApp
285is installed in \System\Apps\, and the SIS also installs a couple of
53d44271 286demo scripts in \Perl\ (C:\Mydocs\Perl\ on Nokia 7710).
27da23d5
JH
287
288Note that the Symbian filesystem is very picky: it strongly prefers
289the \ instead of the /.
290
291When doing XS / Symbian C++ programming include first the Symbian
292headers, then any standard C/POSIX headers, then Perl headers, and finally
293any application headers.
294
295New() and Copy() are unfortunately used by both Symbian and Perl code
296so you'll have to play cpp games if you need them. PerlBase.h undefines
297the Perl definitions and redefines them as PerlNew() and PerlCopy().
298
299=head1 TO DO
300
301Lots. See F<symbian\TODO>.
302
303=head1 WARNING
304
d1dd14d1 305As of Perl Symbian port version 0.4.1 any part of Perl's standard
27da23d5
JH
306regression test suite has not been run on a real Symbian device using
307the ported Perl, so innumerable bugs may lie in wait. Therefore there
308is absolutely no warranty.
309
310=head1 NOTE
311
312When creating and extending application programming interfaces (APIs)
d1dd14d1
JH
313for Symbian or Series 60 or Series 80 or Series 90 it is suggested
314that trademarks, registered trademarks, or trade names are not used in
315the API names. Instead, developers should consider basing the API
316naming in the existing (C++, or maybe Java) public component and API
317naming, modified as appropriate by the rules of the programming
318language the new APIs are for.
27da23d5
JH
319
320Nokia is a registered trademark of Nokia Corporation. Nokia's product
321names are trademarks or registered trademarks of Nokia. Other product
322and company names mentioned herein may be trademarks or trade names of
323their respective owners.
324
325=head1 AUTHOR
326
327Jarkko Hietaniemi
328
329=head1 COPYRIGHT
330
331Copyright (c) 2004-2005 Nokia. All rights reserved.
332
333=head1 LICENSE
334
335The Symbian port is licensed under the same terms as Perl itself.
336
337=head1 HISTORY
338
f26f4a2f
JH
339=over 4
340
341=item *
342
3430.1.0: April 2005
344
27da23d5
JH
345(This will show as "0.01" in the Symbian Installer.)
346
347 - The console window is a very simple console indeed: one can
348 get the newline with "000" and the "C" button is a backspace.
349 Do not expect a terminal capable of vt100 or ANSI sequences.
350 The console is also "ASCII", you cannot input e.g. any accented
351 letters. Because of obvious physical constraints the console is
352 also very small: (in Nokia 6600) 22 columns, 17 rows.
353 - The following libraries are available:
354 AnyDBM_File AutoLoader base Carp Config Cwd constant
355 DynaLoader Exporter File::Spec integer lib strict Symbol
356 vars warnings XSLoader
357 - The following extensions are available:
c042ae3a 358 attrs Compress::Zlib Cwd Data::Dumper Devel::Peek Digest::MD5 DynaLoader
27da23d5
JH
359 Fcntl File::Glob Filter::Util::Call IO List::Util MIME::Base64
360 PerlIO::scalar PerlIO::via SDBM_File Socket Storable Time::HiRes
361 - The following extensions are missing for various technical reasons:
362 B ByteLoader Devel::DProf Devel::PPPort Encode GDBM_File
363 I18N::Langinfo IPC::SysV NDBM_File Opcode PerlIO::encoding POSIX
364 re Safe Sys::Hostname Sys::Syslog
365 threads threads::shared Unicode::Normalize
366 - Using MakeMaker or the Module::* to build and install modules
f26f4a2f 367 is not supported.
27da23d5
JH
368 - Building XS other than the ones in the core is not supported.
369
f26f4a2f
JH
370Since this is 0.something release, any future releases are almost
371guaranteed to be binary incompatible. As a sign of this the Symbian
db5886f1
JH
372symbol exports are kept unfrozen and the .def files fully rebuilt
373every time.
f26f4a2f
JH
374
375=item *
376
3770.2.0: October 2005
378
379 - Perl 5.9.3 (patch level 25741)
380 - Compress::Zlib and IO::Zlib supported
381 - sisify.pl added
382
383We maintain the binary incompatibility.
384
25ca88e0
JH
385=item *
386
3870.3.0: October 2005
388
389 - Perl 5.9.3 (patch level 25911)
390 - Series 80 2.0 and UIQ 2.1 support
391
392We maintain the binary incompatibility.
393
db5886f1
JH
394=item *
395
3960.4.0: November 2005
397
398 - Perl 5.9.3 (patch level 26052)
399 - adding a sample Symbian extension
400
401We maintain the binary incompatibility.
402
53d44271
JH
4030.4.1: December 2006
404
5909b2ae 405 - Perl 5.9.5 (patch level 30002)
53d44271
JH
406 - added extensions: Compress/Raw/Zlib, Digest/SHA,
407 Hash/Util, Math/BigInt/FastCalc, Text/Soundex, Time/Piece
d1dd14d1 408 - port to S90 1.1 by alexander smishlajev
53d44271
JH
409
410We maintain the binary incompatibility.
411
f26f4a2f 412=back
27da23d5
JH
413
414=cut
415