From: Vadim Konovalov Date: Wed, 23 Nov 2005 20:55:00 +0000 (+0000) Subject: perlce touches X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=75472953029ad512c6b76bd0dea6d327f2613a02;p=p5sagit%2Fp5-mst-13.2.git perlce touches From: Konovalov, Vadim Message-ID: <7DD1BE2C50259746ABB8683672D2089E12DDC3@itotest-1.spb.lucent.com> p4raw-id: //depot/perl@26200 --- diff --git a/INSTALL b/INSTALL index 0ca20f5..95c8033 100644 --- a/INSTALL +++ b/INSTALL @@ -1881,7 +1881,7 @@ the particular platforms: =item WinCE/PocketPC -README.ce, wince/README.perlce +README.ce =item Open Zaurus diff --git a/MANIFEST b/MANIFEST index 7b23b6e..52c8b52 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3250,7 +3250,6 @@ wince/perlhost.h Perl "host" implementation wince/perllib.c WinCE port wince/perlmain.c WinCE port wince/perl.rc WinCE port -wince/README.perlce WinCE port wince/registry.bat WinCE port wince/runperl.c WinCE port wince/splittree.pl WinCE port diff --git a/README.ce b/README.ce index 83505af..ecb574d 100644 --- a/README.ce +++ b/README.ce @@ -6,27 +6,65 @@ specifically designed to be readable as is. perlce - Perl for WinCE -=head1 DESCRIPTION +=head1 Building Perl for WinCE + +=head2 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. -=head1 BUILD +=head2 General explanations on cross-compiling WinCE -This section describes the steps to be performed to build PerlCE. -You may find additional and newer information about building perl -for WinCE using following URL: +=over + +=item * + +C is built. This is a single executable (without DLL), intended +to run on Win32, and it will facilitate remaining build process; all binaries +built after it are foreign and should not run locally. + +C is built using ../win32/Makefile; this is part of normal +build process invoked as dependency from wince/Makefile.ce + +=item * + +After C is built, 'configpm' is invoked to create right Config.pm +in right place and its corresponding Cross.pm. - http://perlce.sourceforge.net +Unlike Win32 build, miniperl will not have Config.pm of host within reach; +it rather will use Config.pm from within cross-compilation directories. -There should also be pre-built binaries there. +File Cross.pm is dead simple: for given cross-architecture places in @INC +a path where perl modules are, and right Config.pm in that place. -Don't be confused by large size of downloaded distribution or constructed -binaries: entire distribution could be large for WinCE ideology, but -you may strip it at your wish and use only required parts. +That said, C should report an error, because +it can not find Config.pm. If it does not gives an error -- wrong Config.pm +is substituted, and resulting binaries will be a mess. + +C should run okay, and it will provide right +Config.pm for further compilations. + +=item * + +During extensions build phase, a script C<./win32/buldext.pl> is invoked, +which in turn steps in ./ext subdirectories and performs a build of +each extension in turn. + +All invokes of Makefile.PL are provided with C<-MCross> so to enable cross- +compile. + +=item * + +=back -=head2 Tools & SDK +=head2 BUILD + +This section describes the steps to be performed to build PerlCE. +You may find additional information about building perl for WinCE +at L and some pre-built binaries. + +=head3 Tools & SDK For compiling, you need following: @@ -42,18 +80,12 @@ For compiling, you need following: =back -Needed source files can be downloaded via: -www.rainer-keuchel.de/wince/dirlist.html - -=head2 Make +Needed source files can be downloaded at +L -Please pay attention that starting from 5.8.0 miniperl *is* built -and it facilitates in further building process. This means that -in addition to compiler installation for mobile device you also need -to have Microsoft Visual C++ installed as well. +=head3 Make -On the bright side, you do not need to edit any files from ./win32 -subdirectory. Normally you only need to edit ./wince/compile.bat +Normally you only need to edit ./wince/compile.bat to reflect your system and run it. File ./wince/compile.bat is actually a wrapper to call @@ -118,20 +150,149 @@ or just to refer a cross-compilation that was created last time. - -If you decided to build with fcrypt.c file, please refer to README.win32 -file, as long as all legal considerations and steps to do are exactly same -in this case. - All questions related to building for WinCE devices could be asked in perlce-users@lists.sourceforge.net mailing list. +=head1 Using Perl on WinCE + +=head2 DESCRIPTION + +PerlCE is currently linked with a simple console window, so it also +works on non-hpc devices. + +The simple stdio implementation creates the files stdin.txt, +stdout.txt and stderr.txt, so you might examine them if your +console has only a liminted number of cols. + +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. + +stdout/stderr now go into the files /perl-stdout.txt and +/perl-stderr.txt. + +=head2 LIMITATIONS + +No fork(), pipe(), popen() etc. + +=head2 ENVIRONMENT + +All environment vars must be stored in HKLM\Environment as +strings. 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 editor +or via the PerlIDE. + +=head2 REGISTRY + +To start perl by clicking on a perl source file, you have +to make the according entries in HKCR (see wince-reg.bat). +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. + +=head2 PERLFILES + +The following files are a reasonable minimum if you want to do +some socket stuff: + + ./auto + ./auto/DynaLoader + ./auto/DynaLoader/autosplit.ix + ./auto/DynaLoader/dl_expandspec.al + ./auto/DynaLoader/dl_findfile.al + ./auto/DynaLoader/dl_find_symbol_anywhere.al + ./auto/IO + ./auto/IO/IO.bs + ./auto/IO/IO.dll + ./auto/Socket + ./auto/Socket/Socket.bs + ./auto/Socket/Socket.dll + ./Carp + ./Carp/Heavy.pm + ./Carp.pm + ./Config.pm + ./DynaLoader.pm + ./Exporter + ./Exporter/Heavy.pm + ./Exporter.pm + ./IO + ./IO/File.pm + ./IO/Handle.pm + ./IO/Socket.pm + ./IO.pm + ./SelectSaver.pm + ./Socket.pm + ./strict.pm + ./Symbol.pm + ./warnings + ./warnings/register.pm + ./warnings.pm + ./XSLoader.pm + +=head2 XS + +The following Win32-Methods are built-in: + + 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); + +=head2 BUGS + +Opening files for read-write is currently not supported if +they use stdio (normal perl file handles). + +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. + +=head2 INSTALLATION + +Currently installation instructions are at L. + +After installation & testing processes will stabilize, information will +be more precise. + =head1 ACKNOWLEDGEMENTS The port for Win32 was used as a reference. =head1 AUTHORS -Rainer Keuchel (keuchel@netwave.de) -Vadim Konovalov (vkonovalov@spb.lucent.com) +=over + +=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! + +=item Vadim Konovalov + +made further support of WinCE port. + +=back diff --git a/makedef.pl b/makedef.pl index 9d3c632..9737605 100644 --- a/makedef.pl +++ b/makedef.pl @@ -45,7 +45,7 @@ if ($PLATFORM eq 'win32' or $PLATFORM eq 'wince' or $PLATFORM eq "aix") { # source files and header files and don't include any BUILDOPT's that # the user might have chosen to disable because the canned configs are # minimal configs that don't include any of those options. - my $opts = ($PLATFORM eq 'wince' ? '-MCross' : ''); + my $opts = ($PLATFORM eq 'wince' ? '-MCross' : ''); # for wince need Cross.pm to get Config.pm my $config = `$^X $opts -Ilib -V`; my($options) = $config =~ /^ Compile-time options: (.*?)\n^ \S/ms; $options =~ s/\s+/ /g; diff --git a/wince/Makefile.ce b/wince/Makefile.ce index 782ebac..d2ecc79 100644 --- a/wince/Makefile.ce +++ b/wince/Makefile.ce @@ -782,7 +782,7 @@ NOT_COMPILE_EXT = $(NOT_COMPILE_EXT) !XS/Typemap Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM) $(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \ - !POSIX !Math/BigInt/FastCalc $(NOT_COMPILE_EXT) + !POSIX $(NOT_COMPILE_EXT) Extensions_clean: -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean diff --git a/wince/wince.c b/wince/wince.c index db89413..da30dcb 100644 --- a/wince/wince.c +++ b/wince/wince.c @@ -466,7 +466,6 @@ win32_times(struct tms *timebuf) return -1; } -/* TODO */ Sighandler_t win32_signal(int sig, Sighandler_t subcode) {