develooper Front page | perl.perl5.porters | Postings from October 2013

[perl #120365] WinCE build instructions

Thread Previous
From:
bulk88
Date:
October 25, 2013 16:35
Subject:
[perl #120365] WinCE build instructions
Message ID:
rt-4.0.18-24731-1382718935-1746.120365-75-0@perl.org
# New Ticket Created by  bulk88 
# Please include the string:  [perl #120365]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120365 >


This is a branch off of 
https://rt.perl.org/Public/Bug/Display.html?id=115118 as to not clutter 
the high level discussion in that ticket with back and forth on how to 
build WinCE Perl.

This is what I think are the instructions to build WinCE Perl with EVC4.

1. Install EVC4 
http://download.microsoft.com/download/c/3/f/c3f8b58b-9753-4c2e-8b96-2dfe3476a2f7/eVC4.exe 
use the key at mentioned at 
http://download.cnet.com/Microsoft-eMbedded-Visual-C/3000-2212_4-10108490.html?tag=bc 


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 "C:/Program 
Files/Windows CE Tools", others go into "C:/Windows CE Tools" regardless 
of the path you gave to the installer (the default will be "C:/Windows 
CE Tools"), Reboots will be required for the installer to proceed. Also 
.c and .h associations with Visual Studio might get overridden when 
installing EVC4. You have been warned.

2. Download celib from my github at https://github.com/bulk88/celib 
using "Download Zip". Extract it to a spaceless path but not into the 
perl build source. I call this dir "celib-palm-3.0" but in the github 
snapshot it will be called "celib-master". Make a copy of the 
"wince-arm-pocket-wce300" folder and rename the copy to 
"wince-arm-pocket-wce400". This is a hack so we can build a CE 4.0 
binary by linking in CE 3.0 ARM asm, linker doesn't care. Windows 
Mobile/WinCE are backwards compat with machine code like Desktop Windows.

3. Download w32console from 
http://sourceforge.net/projects/perlce/files/PerlCE%20support%20files/console/ 
. Extract it to a spaceless path but not into the perl build source. 
Don't extract it into the same dir as celib. Make a copy of the 
"wince-arm-pocket-wce300" folder and rename the copy to 
"wince-arm-pocket-wce400". This is a hack so we can build a CE 4.0 
binary by linking in CE 3.0 ARM asm, linker doesn't care. Windows 
Mobile/WinCE are backwards compat with machine code like Desktop Windows.

4. Open a command prompt, run your regular batch file to set the env for 
desktop Visual C building, goto the perl source dir, fill out 
win32/Makefile, do a "nmake all" to build a Desktop Perl.

5. Open win32/Makefile.ce in a text editor, do something similar to the 
following patch.

-CELIBDLLDIR  = h:\src\wince\celib-palm-3.0
-CECONSOLEDIR = h:\src\wince\w32console
+CELIBDLLDIR  = C:\sources\celib-palm-3.0
+CECONSOLEDIR = C:\sources\w32console

Also change
___________________________________
!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

___________________________________

to

___________________________________
!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

___________________________________

so wince-arm-pocket-wce400 is the MACHINE type.

6. Use a text editor to open "C:\Program Files\Microsoft eMbedded C++ 
4.0\EVC\WCE400\BIN\WCEARMV4.BAT". Look for "if "%SDKROOT%"=="" set 
SDKROOT=", on an install I *THINK* it is "C:\Windows CE Tools", goto 
"C:\Windows CE Tools" in a file manager, then make sure "C:\Windows CE 
Tools\wce400\STANDARDSDK\Include\Armv4" exists on your disk. If 
"C:\Windows CE Tools\wce400\STANDARDSDK\Include\Armv4" doesn't exist,  
SDKROOT need to be changed to "C:\Program Files\Windows CE Tools" from 
"C:\Windows CE Tools"

7. Open another command prompt, run "C:\Program Files\Microsoft eMbedded 
C++ 4.0\EVC\WCE400\BIN\WCEARMV4.BAT"

8. In the WinCE command prompt you made with WCEARMV4.BAT, goto the perl 
source dir, and goto "/win32" and type "nmake -f Makefile.ce" then enter.

This is where all errors will happen BTW.

9. The ARM perl interp (perl519.dll and perl.exe) will be in 
"C:\perl519\src\win32\wince-arm-pocket-wce400" on my disk. XS DLLs will 
be in "C:\perl519\src\xlib\wince-arm-hpc-wce400\auto"

To prove success do
_______________________________________________________
C:\perl519\src\win32>dumpbin /headers 
"C:\perl519\src\win32\wince-arm-pocket-wce
400\perl.exe"
Microsoft (R) COFF/PE Dumper Version 6.24.1243
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\perl519\src\win32\wince-arm-pocket-wce400\perl.exe

PE signature found

File Type: EXECUTABLE IMAGE

FILE HEADER VALUES
             1C0 machine (ARM)<<<<<<<<<<<<<<<<<<<<<<<<<<< required
               5 number of sections
        5265D6D4 time date stamp Mon Oct 21 21:37:24 2013
               0 file pointer to symbol table
               0 number of symbols
              E0 size of optional header
             10F characteristics
                   Relocations stripped
                   Executable
                   Line numbers stripped
                   Symbols stripped
                   32 bit word machine

OPTIONAL HEADER VALUES
             10B magic # (PE32)
            6.24 linker version
            3E00 size of code
            2400 size of initialized data
               0 size of uninitialized data
            4B5C entry point (00014B5C)
            1000 base of code
            5000 base of data
           10000 image base (00010000 to 00018FFF)
            1000 section alignment
             200 file alignment
            4.00 operating system version
            0.00 image version
            4.00 subsystem version
               0 Win32 version
            9000 size of image
             400 size of headers
               0 checksum
               9 subsystem (Windows CE 
GUI)<<<<<<<<<<<<<<<<<<<<<<<<<<<required
               0 DLL characteristics
          100000 size of stack reserve
            1000 size of stack commit
          100000 size of heap reserve
            1000 size of heap commit
               0 loader flags
              10 number of directories
               0 [       0] RVA [size] of Export Directory
            50D0 [      50] RVA [size] of Import Directory
            8000 [     FB0] RVA [size] of Resource Directory
..........
_______________________________________________________


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About