.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PERLCE 1" .TH PERLCE 1 "2020-06-07" "perl v5.30.3" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" perlce \- Perl for WinCE .SH "Building Perl for WinCE" .IX Header "Building Perl for WinCE" .SS "\s-1WARNING\s0" .IX Subsection "WARNING" \&\fBMuch of this document has become very out of date and needs updating, rewriting or deleting. The build process was overhauled during the 5.19 development track and the current instructions as of that time are given in \*(L"\s-1CURRENT BUILD INSTRUCTIONS\*(R"\s0; the previous build instructions, which are largely superseded but may still contain some useful information, are left in \*(L"\s-1OLD BUILD INSTRUCTIONS\*(R"\s0 but really need removing after anything of use has been extracted from them.\fR .SS "\s-1DESCRIPTION\s0" .IX Subsection "DESCRIPTION" This file gives the instructions for building Perl5.8 and above for WinCE. Please read and understand the terms under which this software is distributed. .SS "General explanations on cross-compiling WinCE" .IX Subsection "General explanations on cross-compiling WinCE" .IP "\(bu" 4 \&\fIminiperl\fR is built. This is a single executable (without \s-1DLL\s0), intended to run on Win32, and it will facilitate remaining build process; all binaries built after it are foreign and should not run locally. .Sp \&\fIminiperl\fR is built using \fI./win32/Makefile\fR; this is part of normal build process invoked as dependency from wince/Makefile.ce .IP "\(bu" 4 After \fIminiperl\fR is built, \fIconfigpm\fR is invoked to create right \fIConfig.pm\fR in right place and its corresponding Cross.pm. .Sp Unlike Win32 build, miniperl will not have \fIConfig.pm\fR of host within reach; it rather will use \fIConfig.pm\fR from within cross-compilation directories. .Sp File \fICross.pm\fR is dead simple: for given cross-architecture places in \f(CW@INC\fR a path where perl modules are, and right \fIConfig.pm\fR in that place. .Sp That said, \f(CW\*(C`miniperl \-Ilib \-MConfig \-we 1\*(C'\fR should report an error, because it can not find \fIConfig.pm\fR. If it does not give an error \*(-- wrong \fIConfig.pm\fR is substituted, and resulting binaries will be a mess. .Sp \&\f(CW\*(C`miniperl \-MCross \-MConfig \-we 1\*(C'\fR should run okay, and it will provide right \&\fIConfig.pm\fR for further compilations. .IP "\(bu" 4 During extensions build phase, a script \fI./win32/buildext.pl\fR is invoked, which in turn steps in \fI./ext\fR subdirectories and performs a build of each extension in turn. .Sp All invokes of \fIMakefile.PL\fR are provided with \f(CW\*(C`\-MCross\*(C'\fR so to enable cross\- compile. .SS "\s-1CURRENT BUILD INSTRUCTIONS\s0" .IX Subsection "CURRENT BUILD INSTRUCTIONS" (These instructions assume the host is 32\-bit Windows. If you're on 64\-bit Windows then change \*(L"C:\eProgram Files\*(R" to \*(L"C:\eProgram Files (x86)\*(R" throughout.) .PP 1. Install \s-1EVC4\s0 from .PP .Vb 1 \& http://download.microsoft.com/download/c/3/f/c3f8b58b\-9753\-4c2e\-8b96\-2dfe3476a2f7/eVC4.exe .Ve .PP Use the key mentioned at .PP .Vb 1 \& http://download.cnet.com/Microsoft\-eMbedded\-Visual\-C/3000\-2212_4\-10108490.html?tag=bc .Ve .PP The installer is ancient and has a few bugs on the paths it uses. You will have to fix them later. Basically, some things go into \*(L"C:/Program Files/Windows \s-1CE\s0 Tools\*(R", others go into \*(L"C:/Windows \s-1CE\s0 Tools\*(R" regardless of the path you gave to the installer (the default will be \*(L"C:/Windows \&\s-1CE\s0 Tools\*(R"). Reboots will be required for the installer to proceed. Also \&.c and .h associations with Visual Studio might get overridden when installing \s-1EVC4.\s0 You have been warned. .PP 2. Download celib from GitHub (using \*(L"Download \s-1ZIP\*(R"\s0) at .PP .Vb 1 \& https://github.com/bulk88/celib .Ve .PP Extract it to a spaceless path but not into the perl build source. I call this directory \*(L"celib\-palm\-3.0\*(R" but in the GitHub snapshot it will be called \*(L"celib-master\*(R". Make a copy of the \&\*(L"wince\-arm\-pocket\-wce300\-release\*(R" folder and rename the copy to \&\*(L"wince\-arm\-pocket\-wce400\*(R". This is a hack so we can build a \s-1CE 4.0\s0 binary by linking in \s-1CE 3.0 ARM\s0 asm; the linker doesn't care. Windows Mobile/WinCE are backwards compatible with machine code like Desktop Windows. .PP 3. Download console\-1.3\-src.tar.gz from .PP .Vb 1 \& http://sourceforge.net/projects/perlce/files/PerlCE%20support%20files/console/ .Ve .PP Extract it to a spaceless path but not into the perl build source. Don't extract it into the same directory as celib. Make a copy of the \&\*(L"wince\-arm\-pocket\-wce300\*(R" folder and rename the copy to \&\*(L"wince\-arm\-pocket\-wce400\*(R". This is a hack so we can build a \s-1CE 4.0\s0 binary by linking in \s-1CE 3.0 ARM\s0 asm; the linker doesn't care. Windows Mobile/WinCE are backwards compatible with machine code like Desktop Windows. .PP 4. Open a command prompt, run your regular batch file to set the environment for desktop Visual C building, goto the perl source directory, cd into win32/, fill out Makefile, and do a \*(L"nmake all\*(R" to build a Desktop Perl. .PP 5. Open win32/Makefile.ce in a text editor and do something similar to the following patch. .PP .Vb 4 \& \-CELIBDLLDIR = h:\esrc\ewince\ecelib\-palm\-3.0 \& \-CECONSOLEDIR = h:\esrc\ewince\ew32console \& +CELIBDLLDIR = C:\esources\ecelib\-palm\-3.0 \& +CECONSOLEDIR = C:\esources\ew32console .Ve .PP Also change .PP .Vb 10 \& !if "$(MACHINE)" == "" \& MACHINE=wince\-arm\-hpc\-wce300 \& #MACHINE=wince\-arm\-hpc\-wce211 \& #MACHINE=wince\-sh3\-hpc\-wce211 \& #MACHINE=wince\-mips\-hpc\-wce211 \& #MACHINE=wince\-sh3\-hpc\-wce200 \& #MACHINE=wince\-mips\-hpc\-wce200 \& #MACHINE=wince\-arm\-pocket\-wce300 \& #MACHINE=wince\-mips\-pocket\-wce300 \& #MACHINE=wince\-sh3\-pocket\-wce300 \& #MACHINE=wince\-x86em\-pocket\-wce300 \& #MACHINE=wince\-mips\-palm\-wce211 \& #MACHINE=wince\-sh3\-palm\-wce211 \& #MACHINE=wince\-x86em\-palm\-wce211 \& #MACHINE=wince\-x86\-hpc\-wce300 \& #MACHINE=wince\-arm\-pocket\-wce400 \& !endif .Ve .PP to .PP .Vb 10 \& !if "$(MACHINE)" == "" \& #MACHINE=wince\-arm\-hpc\-wce300 \& #MACHINE=wince\-arm\-hpc\-wce211 \& #MACHINE=wince\-sh3\-hpc\-wce211 \& #MACHINE=wince\-mips\-hpc\-wce211 \& #MACHINE=wince\-sh3\-hpc\-wce200 \& #MACHINE=wince\-mips\-hpc\-wce200 \& #MACHINE=wince\-arm\-pocket\-wce300 \& #MACHINE=wince\-mips\-pocket\-wce300 \& #MACHINE=wince\-sh3\-pocket\-wce300 \& #MACHINE=wince\-x86em\-pocket\-wce300 \& #MACHINE=wince\-mips\-palm\-wce211 \& #MACHINE=wince\-sh3\-palm\-wce211 \& #MACHINE=wince\-x86em\-palm\-wce211 \& #MACHINE=wince\-x86\-hpc\-wce300 \& MACHINE=wince\-arm\-pocket\-wce400 \& !endif .Ve .PP so wince\-arm\-pocket\-wce400 is the \s-1MACHINE\s0 type. .PP 6. Use a text editor to open \*(L"C:\eProgram Files\eMicrosoft eMbedded \*(C+ 4.0\eEVC\eWCE400\eBIN\eWCEARMV4.BAT\*(R". Look for .PP .Vb 1 \& if "%SDKROOT%"=="" set SDKROOT=... .Ve .PP On a new install it is \*(L"C:\eWindows \s-1CE\s0 Tools\*(R". Goto \&\*(L"C:\eWindows \s-1CE\s0 Tools\*(R" in a file manager and see if \*(L"C:\eWindows \s-1CE\s0 Tools\ewce400\eSTANDARDSDK\eInclude\eArmv4\*(R" exists on your disk. If not the \s-1SDKROOT\s0 need to be changed to \*(L"C:\eProgram Files\eWindows \s-1CE\s0 Tools\*(R". .PP Goto celib\-palm\-3.0\einc\ecewin32.h, search for .PP .Vb 1 \& typedef struct _ABC { .Ve .PP and uncomment the struct. .PP 7. Open another command prompt, ensure \s-1PLATFORM\s0 is not set to anything already unless you know what you're doing (so that the correct default value is set by the next command), and run \*(L"C:\eProgram Files\eMicrosoft eMbedded \*(C+ 4.0\eEVC\eWCE400\eBIN\eWCEARMV4.BAT\*(R" .PP 8. In the WinCE command prompt you made with \s-1WCEARMV4.BAT,\s0 goto the perl source directory, cd into win32/ and run \*(L"nmake \-f Makefile.ce\*(R". .PP 9. The \s-1ARM\s0 perl interpreter (perl519.dll and perl.exe) will be in something like \*(L"C:\eperl519\esrc\ewin32\ewince\-arm\-pocket\-wce400\*(R", with the \s-1XS\s0 DLLs in \&\*(L"C:\eperl519\esrc\exlib\ewince\-arm\-hpc\-wce400\eauto\*(R". .PP To prove success on the host machine, run \&\*(L"dumpbin /headers wince\-arm\-pocket\-wce400\eperl.exe\*(R" from the win32/ folder and look for \*(L"machine (\s-1ARM\s0)\*(R" in the \s-1FILE HEADER VALUES\s0 and \&\*(L"subsystem (Windows \s-1CE GUI\s0)\*(R" in the \s-1OPTIONAL HEADER VALUES.\s0 .SS "\s-1OLD BUILD INSTRUCTIONS\s0" .IX Subsection "OLD BUILD INSTRUCTIONS" This section describes the steps to be performed to build PerlCE. You may find additional information about building perl for WinCE at and some pre-built binaries. .PP \fITools & \s-1SDK\s0\fR .IX Subsection "Tools & SDK" .PP For compiling, you need following: .IP "\(bu" 4 Microsoft Embedded Visual Tools .IP "\(bu" 4 Microsoft Visual \*(C+ .IP "\(bu" 4 Rainer Keuchel's celib-sources .IP "\(bu" 4 Rainer Keuchel's console-sources .PP Needed source files can be downloaded at .PP \fIMake\fR .IX Subsection "Make" .PP Normally you only need to edit \fI./win32/ce\-helpers/compile.bat\fR to reflect your system and run it. .PP File \fI./win32/ce\-helpers/compile.bat\fR is actually a wrapper to call \&\f(CW\*(C`nmake \-f makefile.ce\*(C'\fR with appropriate parameters and it accepts extra parameters and forwards them to \f(CW\*(C`nmake\*(C'\fR command as additional arguments. You should pass target this way. .PP To prepare distribution you need to do following: .IP "\(bu" 4 go to \fI./win32\fR subdirectory .IP "\(bu" 4 edit file \fI./win32/ce\-helpers/compile.bat\fR .IP "\(bu" 4 run compile.bat .IP "\(bu" 4 run compile.bat dist .PP \&\fIMakefile.ce\fR has \f(CW\*(C`CROSS_NAME\*(C'\fR macro, and it is used further to refer to your cross-compilation scheme. You could assign a name to it, but this is not necessary, because by default it is assigned after your machine configuration name, such as \*(L"wince\-sh3\-hpc\-wce211\*(R", and this is enough to distinguish different builds at the same time. This option could be handy for several different builds on same platform to perform, say, threaded build. In a following example we assume that all required environment variables are set properly for C cross-compiler (a special *.bat file could fit perfectly to this purpose) and your \fIcompile.bat\fR has proper \*(L"\s-1MACHINE\*(R"\s0 parameter set, to, say, \f(CW\*(C`wince\-mips\-pocket\-wce300\*(C'\fR. .PP .Vb 6 \& compile.bat \& compile.bat dist \& compile.bat CROSS_NAME=mips\-wce300\-thr "USE_ITHREADS=define" ^ \& "USE_IMP_SYS=define" "USE_MULTI=define" \& compile.bat CROSS_NAME=mips\-wce300\-thr "USE_ITHREADS=define" ^ \& "USE_IMP_SYS=define" "USE_MULTI=define" dist .Ve .PP If all goes okay and no errors during a build, you'll get two independent distributions: \f(CW\*(C`wince\-mips\-pocket\-wce300\*(C'\fR and \f(CW\*(C`mips\-wce300\-thr\*(C'\fR. .PP Target \f(CW\*(C`dist\*(C'\fR prepares distribution file set. Target \f(CW\*(C`zipdist\*(C'\fR performs same as \f(CW\*(C`dist\*(C'\fR but additionally compresses distribution files into zip archive. .PP \&\s-1NOTE:\s0 during a build there could be created a number (or one) of \fIConfig.pm\fR for cross-compilation (\*(L"foreign\*(R" \fIConfig.pm\fR) and those are hidden inside \&\fI../xlib/$(\s-1CROSS_NAME\s0)\fR with other auxiliary files, but, and this is important to note, there should be \fBno\fR \fIConfig.pm\fR for host miniperl. If you'll get an error that perl could not find Config.pm somewhere in building process this means something went wrong. Most probably you forgot to specify a cross-compilation when invoking miniperl.exe to Makefile.PL When building an extension for cross-compilation your command line should look like .PP .Vb 1 \& ..\eminiperl.exe \-I..\elib \-MCross=mips\-wce300\-thr Makefile.PL .Ve .PP or just .PP .Vb 1 \& ..\eminiperl.exe \-I..\elib \-MCross Makefile.PL .Ve .PP to refer a cross-compilation that was created last time. .PP All questions related to building for WinCE devices could be asked in \&\fIperlce\-user@lists.sourceforge.net\fR mailing list. .SH "Using Perl on WinCE" .IX Header "Using Perl on WinCE" .SS "\s-1DESCRIPTION\s0" .IX Subsection "DESCRIPTION" PerlCE is currently linked with a simple console window, so it also works on non-hpc devices. .PP The simple stdio implementation creates the files \fIstdin.txt\fR, \&\fIstdout.txt\fR and \fIstderr.txt\fR, so you might examine them if your console has only a limited number of cols. .PP When exitcode is non-zero, a message box appears, otherwise the console closes, so you might have to catch an exit with status 0 in your program to see any output. .PP stdout/stderr now go into the files \fI/perl\-stdout.txt\fR and \&\fI/perl\-stderr.txt.\fR .PP PerlIDE is handy to deal with perlce. .SS "\s-1LIMITATIONS\s0" .IX Subsection "LIMITATIONS" No \fBfork()\fR, \fBpipe()\fR, \fBpopen()\fR etc. .SS "\s-1ENVIRONMENT\s0" .IX Subsection "ENVIRONMENT" All environment vars must be stored in HKLM\eEnvironment as strings. They are read at process startup. .IP "\s-1PERL5LIB\s0" 4 .IX Item "PERL5LIB" Usual perl lib path (semi-list). .IP "\s-1PATH\s0" 4 .IX Item "PATH" Semi-list for executables. .IP "\s-1TMP\s0" 4 .IX Item "TMP" \&\- Tempdir. .IP "\s-1UNIXROOTPATH\s0" 4 .IX Item "UNIXROOTPATH" \&\- Root for accessing some special files, i.e. \fI/dev/null\fR, \fI/etc/services\fR. .IP "\s-1ROWS/COLS\s0" 4 .IX Item "ROWS/COLS" \&\- Rows/cols for console. .IP "\s-1HOME\s0" 4 .IX Item "HOME" \&\- Home directory. .IP "\s-1CONSOLEFONTSIZE\s0" 4 .IX Item "CONSOLEFONTSIZE" \&\- Size for console font. .PP You can set these with cereg.exe, a (remote) registry editor or via the PerlIDE. .SS "\s-1REGISTRY\s0" .IX Subsection "REGISTRY" To start perl by clicking on a perl source file, you have to make the according entries in \s-1HKCR\s0 (see \fIce\-helpers/wince\-reg.bat\fR). cereg.exe (which must be executed on a desktop pc with ActiveSync) is reported not to work on some devices. You have to create the registry entries by hand using a registry editor. .SS "\s-1XS\s0" .IX Subsection "XS" The following Win32\-Methods are built-in: .PP .Vb 10 \& newXS("Win32::GetCwd", w32_GetCwd, file); \& newXS("Win32::SetCwd", w32_SetCwd, file); \& newXS("Win32::GetTickCount", w32_GetTickCount, file); \& newXS("Win32::GetOSVersion", w32_GetOSVersion, file); \& newXS("Win32::IsWinNT", w32_IsWinNT, file); \& newXS("Win32::IsWin95", w32_IsWin95, file); \& newXS("Win32::IsWinCE", w32_IsWinCE, file); \& newXS("Win32::CopyFile", w32_CopyFile, file); \& newXS("Win32::Sleep", w32_Sleep, file); \& newXS("Win32::MessageBox", w32_MessageBox, file); \& newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file); \& newXS("Win32::GetOemInfo", w32_GetOemInfo, file); \& newXS("Win32::ShellEx", w32_ShellEx, file); .Ve .SS "\s-1BUGS\s0" .IX Subsection "BUGS" Opening files for read-write is currently not supported if they use stdio (normal perl file handles). .PP If you find bugs or if it does not work at all on your device, send mail to the address below. Please report the details of your device (processor, ceversion, devicetype (hpc/palm/pocket)) and the date of the downloaded files. .SS "\s-1INSTALLATION\s0" .IX Subsection "INSTALLATION" Currently installation instructions are at . .PP After installation & testing processes will stabilize, information will be more precise. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" The port for Win32 was used as a reference. .SH "History of WinCE port" .IX Header "History of WinCE port" .IP "5.6.0" 4 .IX Item "5.6.0" Initial port of perl to WinCE. It was performed in separate directory named \fIwince\fR. This port was based on contents of \fI./win32\fR directory. \&\fIminiperl\fR was not built, user must have \s-1HOST\s0 perl and properly edit \&\fImakefile.ce\fR to reflect this. .IP "5.8.0" 4 .IX Item "5.8.0" wince port was kept in the same \fI./wince\fR directory, and \fIwince/Makefile.ce\fR was used to invoke native compiler to create \s-1HOST\s0 miniperl, which then facilitates cross-compiling process. Extension building support was added. .IP "5.9.4" 4 .IX Item "5.9.4" Two directories \fI./win32\fR and \fI./wince\fR were merged, so perlce build process comes in \fI./win32\fR directory. .SH "AUTHORS" .IX Header "AUTHORS" .IP "Rainer Keuchel " 4 .IX Item "Rainer Keuchel " provided initial port of Perl, which appears to be most essential work, as it was a breakthrough on having Perl ported at all. Many thanks and obligations to Rainer! .IP "Vadim Konovalov" 4 .IX Item "Vadim Konovalov" made further support of WinCE port. .IP "Daniel Dragan" 4 .IX Item "Daniel Dragan" updated the build process during the 5.19 development track.