Compile perlce 5.8.8 using Virsual Studio 2005

Compile perlce 5.8.8 using Virsual Studio 2005
PerlCE is Perl for CE, can be running at Window Mobile 5.0(The OS in My Imate PocketPCs)


0.Prepaid source and compiler

*perl5.8.8 source
*Microsoft Visual Studio 2005
*Rainer Keuchel's celib-sources
*Rainer Keuchel's console-sources

Needed source files can be downloaded via:
www.rainer-keuchel.de/wince/dirlist.html

1.compile miniperl and perl
  D:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat
  ./win32/nmake -f makefile
  OR
  You can download binary pack of Perl,copy them to ./perl-5.8.8/.
 
2.Missing some code in perl5.8.8,we modify/add the following code to
  ./win32/FindExt.pm
 
sub dynamic_extensions
{
 return grep $ext{$_} eq 'dynamic',keys %ext;
}

sub noxs_extensions
{
 return grep $ext{$_} eq 'nonxs',keys %ext;
}
 

3.The Codes are conflict bewteen VS2005 and "celib-palm-3.0\inc\cewin32.h",
  so comment the following lines in celib-palm-3.0\inc\cewin32.h.
//typedef struct _ABC {
//    int     abcA;
//    UINT    abcB;
//    int     abcC;
//} ABC, *PABC, NEAR *NPABC, FAR *LPABC;
 

4._getdcwd is not in VS2005 libs,so comment the following lines ./ext/Cwd/cwd.xs
//    if (_getdcwd(drive, dir, MAXPATHLEN)) {
//        sv_setpvn(TARG, dir, strlen(dir));
//        SvPOK_only(TARG);
//    }
//    else


5.Modify the following lines in ../wince/Makefile.ce

INCLUDE=D:\program files\Microsoft Visual Studio 8\SmartDevices\SDK\PocketPC2003\Include
    LIB=D:\program files\Microsoft Visual Studio 8\SmartDevices\SDK\PocketPC2003\Lib\armv4

!if "$(MACHINE)" == "wince-arm-pocket-wce300"
#CC         = clarm.exe 
CC         = cl.exe 
ARCH       = ARM
CPU        = ARM
TARGETCPU  = ARM
CEVersion  = 500
OSVERSION  = WCE500
PLATFORM   = MS Pocket PC
MCFLAGS    = /GS- -D ARM -D arm -D _ARM_ -D _arm_ -DPROCESSOR_ARM \
             -D _MT -D _DLL -DPALM_SIZE -DPOCKET_SIZE \
             -I $(CELIBDLLDIR)\inc
#add /GS- disable VS2005 safecheck
MACH       = -machine:arm
SUBSYS     = -subsystem:windowsce,5.01
CELIBPATH  = $(CELIBDLLDIR)\$(MACHINE)-release
LDLIBPATH  = -libpath:$(CELIBPATH)
STARTOBJS  = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
             $(CECONSOLEDIR)/$(MACHINE)/w32console.obj
!endif


6.Edit ../wince/compile.bat


7./wince/compile.bat
 ./wince/compile.bat dist

That's it,copy  dist-wince-arm-pocket-wce300/bin /lib to your WindowCE
then install perlide-wince-arm-pocket-wce300.tar, you can edit/run perl in your Mobile.