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