Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Building and installing Perl f ...Perl for Cygwin (Berikutnya)
Platform Specific

Perl for WinCE

Daftar Isi

NAME

perlce - Perl for WinCE

Building Perl for WinCE

DESCRIPTION

This file gives the instructions for building Perl5.8 and above forWinCE. Please read and understand the terms under which thissoftware is distributed.

General explanations on cross-compiling WinCE

  • miniperl is built. This is a single executable (without DLL), intendedto run on Win32, and it will facilitate remaining build process; all binariesbuilt after it are foreign and should not run locally.

    miniperl is built using ./win32/Makefile; this is part of normalbuild process invoked as dependency from wince/Makefile.ce

  • After miniperl is built, configpm is invoked to create right Config.pmin right place and its corresponding Cross.pm.

    Unlike Win32 build, miniperl will not have Config.pm of host within reach;it rather will use Config.pm from within cross-compilation directories.

    File Cross.pm is dead simple: for given cross-architecture places in @INCa path where perl modules are, and right Config.pm in that place.

    That said, miniperl -Ilib -MConfig -we 1 should report an error, becauseit can not find Config.pm. If it does not give an error -- wrong Config.pmis substituted, and resulting binaries will be a mess.

    miniperl -MCross -MConfig -we 1 should run okay, and it will provide rightConfig.pm for further compilations.

  • During extensions build phase, a script ./win32/buldext.pl is invoked,which in turn steps in ./ext subdirectories and performs a build ofeach extension in turn.

    All invokes of Makefile.PL are provided with -MCross so to enable cross-compile.

BUILD

This section describes the steps to be performed to build PerlCE.You may find additional information about building perl for WinCEat http://perlce.sourceforge.net and some pre-built binaries.

Tools & SDK

For compiling, you need following:

  • Microsoft Embedded Visual Tools
  • Microsoft Visual C++
  • Rainer Keuchel's celib-sources
  • Rainer Keuchel's console-sources

Needed source files can be downloaded athttp://perlce.sourceforge.net

Make

Normally you only need to edit ./win32/ce-helpers/compile.batto reflect your system and run it.

File ./win32/ce-helpers/compile.bat is actually a wrapper to callnmake -f makefile.ce with appropriate parameters and it accepts extraparameters and forwards them to nmake command as additionalarguments. You should pass target this way.

To prepare distribution you need to do following:

  • go to ./win32 subdirectory
  • edit file ./win32/ce-helpers/compile.bat
  • run compile.bat
  • run compile.bat dist

Makefile.ce has CROSS_NAME macro, and it is used further to refer toyour cross-compilation scheme. You could assign a name to it, but thisis not necessary, because by default it is assigned after your machineconfiguration name, such as "wince-sh3-hpc-wce211", and this is enoughto distinguish different builds at the same time. This option could behandy for several different builds on same platform to perform, say,threaded build. In a following example we assume that all requiredenvironment variables are set properly for C cross-compiler (a special*.bat file could fit perfectly to this purpose) and your compile.bathas proper "MACHINE" parameter set, to, say, wince-mips-pocket-wce300.

  1. compile.bat
  2. compile.bat dist
  3. compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define"
  4. compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" dist

If all goes okay and no errors during a build, you'll get two independentdistributions: wince-mips-pocket-wce300 and mips-wce300-thr.

Target dist prepares distribution file set. Target zipdist performssame as dist but additionally compresses distribution files into ziparchive.

NOTE: during a build there could be created a number (or one) of Config.pmfor cross-compilation ("foreign" Config.pm) and those are hidden inside../xlib/$(CROSS_NAME) with other auxiliary files, but, and this is important tonote, there should be no Config.pm for host miniperl.If you'll get an error that perl could not find Config.pm somewhere in buildingprocess this means something went wrong. Most probably you forgot tospecify a cross-compilation when invoking miniperl.exe to Makefile.PLWhen building an extension for cross-compilation your command line shouldlook like

  1. ..\miniperl.exe -I..\lib -MCross=mips-wce300-thr Makefile.PL

or just

  1. ..\miniperl.exe -I..\lib -MCross Makefile.PL

to refer a cross-compilation that was created last time.

All questions related to building for WinCE devices could be asked in[email protected] mailing list.

Using Perl on WinCE

DESCRIPTION

PerlCE is currently linked with a simple console window, so it alsoworks on non-hpc devices.

The simple stdio implementation creates the files stdin.txt,stdout.txt and stderr.txt, so you might examine them if yourconsole has only a limited number of cols.

When exitcode is non-zero, a message box appears, otherwise theconsole closes, so you might have to catch an exit withstatus 0 in your program to see any output.

stdout/stderr now go into the files /perl-stdout.txt and/perl-stderr.txt.

PerlIDE is handy to deal with perlce.

LIMITATIONS

No fork(), pipe(), popen() etc.

ENVIRONMENT

All environment vars must be stored in HKLM\Environment asstrings. They are read at process startup.

  • PERL5LIB

    Usual perl lib path (semi-list).

  • PATH

    Semi-list for executables.

  • TMP

    - Tempdir.

  • UNIXROOTPATH

    - Root for accessing some special files, i.e. /dev/null, /etc/services.

  • ROWS/COLS

    - Rows/cols for console.

  • HOME

    - Home directory.

  • CONSOLEFONTSIZE

    - Size for console font.

You can set these with cereg.exe, a (remote) registry editoror via the PerlIDE.

REGISTRY

To start perl by clicking on a perl source file, you haveto make the according entries in HKCR (see ce-helpers/wince-reg.bat).cereg.exe (which must be executed on a desktop pc withActiveSync) is reported not to work on some devices.You have to create the registry entries by hand using a registry editor.

XS

The following Win32-Methods are built-in:

  1. newXS("Win32::GetCwd", w32_GetCwd, file);
  2. newXS("Win32::SetCwd", w32_SetCwd, file);
  3. newXS("Win32::GetTickCount", w32_GetTickCount, file);
  4. newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
  5. newXS("Win32::IsWinNT", w32_IsWinNT, file);
  6. newXS("Win32::IsWin95", w32_IsWin95, file);
  7. newXS("Win32::IsWinCE", w32_IsWinCE, file);
  8. newXS("Win32::CopyFile", w32_CopyFile, file);
  9. newXS("Win32::Sleep", w32_Sleep, file);
  10. newXS("Win32::MessageBox", w32_MessageBox, file);
  11. newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file);
  12. newXS("Win32::GetOemInfo", w32_GetOemInfo, file);
  13. newXS("Win32::ShellEx", w32_ShellEx, file);

BUGS

Opening files for read-write is currently not supported ifthey use stdio (normal perl file handles).

If you find bugs or if it does not work at all on yourdevice, send mail to the address below. Please reportthe details of your device (processor, ceversion, devicetype (hpc/palm/pocket)) and the date of the downloadedfiles.

INSTALLATION

Currently installation instructions are at http://perlce.sourceforge.net/.

After installation & testing processes will stabilize, information willbe more precise.

ACKNOWLEDGEMENTS

The port for Win32 was used as a reference.

History of WinCE port

5.
6.0

Initial port of perl to WinCE. It was performed in separate directorynamed wince. This port was based on contents of ./win32 directory.miniperl was not built, user must have HOST perl and properly editmakefile.ce to reflect this.

5.
8.0

wince port was kept in the same ./wince directory, and wince/Makefile.cewas used to invoke native compiler to create HOST miniperl, which thenfacilitates cross-compiling process.Extension building support was added.

5.
9.4

Two directories ./win32 and ./wince were merged, so perlce buildprocess comes in ./win32 directory.

AUTHORS

  • Rainer Keuchel <[email protected]>

    provided initial port of Perl, which appears to be most essential work, asit was a breakthrough on having Perl ported at all.Many thanks and obligations to Rainer!

  • Vadim Konovalov

    made further support of WinCE port.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Building and installing Perl f ...Perl for Cygwin (Berikutnya)