From: Jarkko Hietaniemi Date: Mon, 7 Apr 2003 03:41:17 +0000 (+0000) Subject: More WinCE tweaking for Vadim Konovalov. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c96f74cebd2ba17e2fcad5375199dd60d38b38e0;p=p5sagit%2Fp5-mst-13.2.git More WinCE tweaking for Vadim Konovalov. p4raw-id: //depot/perl@19158 --- diff --git a/wince/Makefile.ce b/wince/Makefile.ce index d02f1a4..af482dc 100644 --- a/wince/Makefile.ce +++ b/wince/Makefile.ce @@ -192,7 +192,7 @@ CPU = ARM TARGETCPU = ARM CEVersion = 300 OSVERSION = WCE300 -PLATFORM = HPC2000 +#PLATFORM = HPC2000 MCFLAGS = -D _MT -D _DLL -D ARM -D arm -D _arm_ -D _ARM_ \ -DPROCESSOR_ARM -DPALM_SIZE \ -I $(CELIBDLLDIR)\inc @@ -349,9 +349,13 @@ CECFLAGS = $(CECFLAGS) -Zi -Od !if "$(CFG)" == "RELEASE" # -O2 and -Ot give internal compiler error in perl.c and lexer. # Also the dll cannot be loaded by perl.exe... +!if "$(CPU)" == "SH3" +!else CECFLAGS = $(CECFLAGS) -O2 -Ot !endif +!endif + RCDEFS = /l 0x407 /r /d "UNICODE" /d UNDER_CE=$(CEVersion) \ /d _WIN32_WCE=$(CEVersion) @@ -756,7 +760,7 @@ $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs #---------------------------------------------------------------------------------- Extensions: ..\win32\buildext.pl $(PERLDEP) $(CONFIGPM) $(HPERL) -I..\lib -I..\win32 -MCross=$(CROSS_NAME) ..\win32\buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) \ - !POSIX !Time/HiRes + !POSIX !Time/HiRes !XS/Typemap Extensions_clean: -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean @@ -902,7 +906,14 @@ install: all !endif dist: all - $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) + $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) + +zipdist: all + $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) + $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip + +zip: + $(HPERL) -I..\lib -MCross=$(CROSS_NAME) makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) --zip perl.ico: $(HPERL) makeico.pl diff --git a/wince/compile-all.bat b/wince/compile-all.bat index 5f94d44..c85f5e9 100644 --- a/wince/compile-all.bat +++ b/wince/compile-all.bat @@ -1,13 +1,62 @@ -call compile.bat MACHINE=wince-arm-hpc-wce300 -call compile.bat MACHINE=wince-arm-hpc-wce211 -call compile.bat MACHINE=wince-sh3-hpc-wce211 -call compile.bat MACHINE=wince-mips-hpc-wce211 -call compile.bat MACHINE=wince-sh3-hpc-wce200 -call compile.bat MACHINE=wince-mips-hpc-wce200 -call compile.bat MACHINE=wince-arm-pocket-wce300 -call compile.bat MACHINE=wince-mips-pocket-wce300 -call compile.bat MACHINE=wince-sh3-pocket-wce300 -call compile.bat MACHINE=wince-x86em-pocket-wce300 -call compile.bat MACHINE=wince-mips-palm-wce211 -call compile.bat MACHINE=wince-sh3-palm-wce211 -call compile.bat MACHINE=wince-x86em-palm-wce211 +@echo off +rem +rem Normally you do not need to run this file. +rem Instead you should edit and execute compile.bat . +rem +rem This file assumes that you have a set of appropriate +rem bat-files that prepare environment variables for build process +rem and execute commands passed as arguments +rem + +call wcearm-300 compile.bat "MACHINE=wince-arm-hpc-wce300" +call wcearm-300 compile.bat "MACHINE=wince-arm-hpc-wce300" zipdist +..\miniperl makedist.pl --clean-exts + +call wcearm-211 compile.bat "MACHINE=wince-arm-hpc-wce211" +call wcearm-211 compile.bat "MACHINE=wince-arm-hpc-wce211" zipdist +..\miniperl makedist.pl --clean-exts + +call wcesh3-211 compile.bat "MACHINE=wince-sh3-hpc-wce211" +call wcesh3-211 compile.bat "MACHINE=wince-sh3-hpc-wce211" zipdist +..\miniperl makedist.pl --clean-exts + +call wcemips-211 compile.bat "MACHINE=wince-mips-hpc-wce211" +call wcemips-211 compile.bat "MACHINE=wince-mips-hpc-wce211" zipdist +..\miniperl makedist.pl --clean-exts + +rem TODO call wcesh3-200 compile.bat "MACHINE=wince-sh3-hpc-wce200" +rem TODO call wcesh3-200 compile.bat "MACHINE=wince-sh3-hpc-wce200" zipdist +rem TODO ..\miniperl makedist.pl --clean-exts + +rem TODO call compile.bat "MACHINE=wince-mips-hpc-wce200" +rem TODO call compile.bat "MACHINE=wince-mips-hpc-wce200" zipdist +rem TODO ..\miniperl makedist.pl --clean-exts + +call WCEARM-p300 compile.bat "MACHINE=wince-arm-pocket-wce300" +call WCEARM-p300 compile.bat "MACHINE=wince-arm-pocket-wce300" zipdist +..\miniperl makedist.pl --clean-exts + +call WCEMIPS-300 compile.bat "MACHINE=wince-mips-pocket-wce300" +call WCEMIPS-300 compile.bat "MACHINE=wince-mips-pocket-wce300" zipdist +..\miniperl makedist.pl --clean-exts + +call WCESH3-300 compile.bat "MACHINE=wince-sh3-pocket-wce300" +call WCESH3-300 compile.bat "MACHINE=wince-sh3-pocket-wce300" zipdist +..\miniperl makedist.pl --clean-exts + +call WCEx86-300 compile.bat "MACHINE=wince-x86em-pocket-wce300" +call WCEx86-300 compile.bat "MACHINE=wince-x86em-pocket-wce300" zipdist +..\miniperl makedist.pl --clean-exts + +call WCEMIPS-palm211 compile.bat "MACHINE=wince-mips-palm-wce211" +call WCEMIPS-palm211 compile.bat "MACHINE=wince-mips-palm-wce211" zipdist +..\miniperl makedist.pl --clean-exts + +call WCESH3-palm211 compile.bat "MACHINE=wince-sh3-palm-wce211" +call WCESH3-palm211 compile.bat "MACHINE=wince-sh3-palm-wce211" zipdist +..\miniperl makedist.pl --clean-exts + +call WCEx86-palm211 compile.bat "MACHINE=wince-x86em-palm-wce211" +call WCEx86-palm211 compile.bat "MACHINE=wince-x86em-palm-wce211" zipdist +..\miniperl makedist.pl --clean-exts + diff --git a/wince/compile.bat b/wince/compile.bat index 73c731f..72c7042 100644 --- a/wince/compile.bat +++ b/wince/compile.bat @@ -6,7 +6,7 @@ rem set ARG-1=PV= set ARG-2=INST_VER= -set ARG-3=INSTALL_ROOT=\Storage Card\perl-tests\perl@19041 +set ARG-3=INSTALL_ROOT=\Storage Card\perl-tests\perl@19053 set ARG-4=WCEROOT=%SDKROOT% set ARG-5=CEPATH=%WCEROOT% set ARG-6=CELIBDLLDIR=d:\personal\pocketPC\celib-palm-3.0 diff --git a/wince/makedist.pl b/wince/makedist.pl index 5729922..be447e8 100644 --- a/wince/makedist.pl +++ b/wince/makedist.pl @@ -5,6 +5,7 @@ use File::Find; my %opts = ( #defaults + 'verbose' => 1, # verbose level, in range from 0 to 2 'distdir' => 'distdir', 'unicode' => 1, # include unicode by default 'minimal' => 0, # minimal possible distribution. @@ -14,18 +15,20 @@ my %opts = ( 'include-modules' => '', # TODO 'exclude-modules' => '', # TODO #??? 'only-modules' => '', # TODO - 'platform' => 'wince', + 'cross-name' => 'wince', 'strip-pod' => 0, # TODO strip POD from perl modules 'adaptation' => 0, # TODO do some adaptation, such as stripping such # occurences as "if ($^O eq 'VMS'){...}" for certain modules - 'zip' => 0, # perform zip (TODO) + 'zip' => 0, # perform zip 'clean-exts' => 0, #options itself (map {/^--([\-_\w]+)=(.*)$/} @ARGV), # --opt=smth (map {/^no-?(.*)$/i?($1=>0):($_=>1)} map {/^--([\-_\w]+)$/} @ARGV), # --opt --no-opt --noopt ); -# TODO -- error checking. When something goes wrong, just exit with rc!=0 +# TODO +# -- error checking. When something goes wrong, just exit with rc!=0 +# -- may be '--zip' option should be made differently? my $cwd = cwd; @@ -42,6 +45,17 @@ if ($opts{'clean-exts'}) { exit; } +# zip +if ($opts{'zip'}) { + if ($opts{'verbose'} >=1) { + print STDERR "zipping...\n"; + } + chdir $opts{'distdir'}; + unlink <*.zip>; + `zip -R perl-$opts{'cross-name'} *`; + exit; +} + my (%libexclusions, %extexclusions); my @lfiles; sub copy($$); @@ -55,6 +69,9 @@ chdir $cwd; #inclusions #... #copy them +if ($opts{'verbose'} >=1) { + print STDERR "Copying perl lib files...\n"; +} for (@lfiles) { /^(.*)\/[^\/]+$/; mkpath "$opts{distdir}/lib/$1"; @@ -72,26 +89,41 @@ chdir $cwd; #... #copy them #{s[/(\w+)/\1\.pm][/$1.pm]} @efiles; +if ($opts{'verbose'} >=1) { + print STDERR "Copying perl core extensions...\n"; +} for (@efiles) { /^(.*)\/([^\/]+)\/([^\/]+)$/; copy "../ext/$_", "$opts{distdir}/lib/$1/$3"; } -# Config.pm -copy "../xlib/$opts{platform}/Config.pm", "$opts{distdir}/lib/Config.pm"; +# Config.pm, perl binaries +if ($opts{'verbose'} >=1) { + print STDERR "Copying Config.pm, perl.dll and perl.exe...\n"; +} +copy "../xlib/$opts{'cross-name'}/Config.pm", "$opts{distdir}/lib/Config.pm"; +copy "$opts{'cross-name'}/perl.exe", "$opts{distdir}/bin/perl.exe"; +copy "$opts{'cross-name'}/perl.dll", "$opts{distdir}/bin/perl.dll"; +# how do we know exact name of perl.dll?) # auto my @afiles; -chdir "../xlib/$opts{platform}/auto"; +chdir "../xlib/$opts{'cross-name'}/auto"; find({no_chdir=>1,wanted=>sub{push @afiles, $_ if /\.(dll|bs)$/}},'.'); chdir $cwd; +if ($opts{'verbose'} >=1) { + print STDERR "Copying binaries for perl core extensions...\n"; +} for (@afiles) { - copy "../xlib/$opts{platform}/auto/$_", "$opts{distdir}/lib/auto/$_"; + copy "../xlib/$opts{'cross-name'}/auto/$_", "$opts{distdir}/lib/auto/$_"; } -sub copy { +sub copy($$) { my ($fnfrom, $fnto) = @_; - my $ffrom = do {local (@ARGV,$/) = $fnfrom; <>}; + open my $fh, "<$fnfrom" or die "can not open $fnfrom: $!"; + binmode $fh; + local $/; + my $ffrom = <$fh>; if ($opts{'strip-pod'}) { # actually following regexp is suspicious to not work everywhere. # but we've checked on our set of modules, and it's fit for our purposes @@ -100,7 +132,11 @@ sub copy { } mkpath $1 if $fnto=~/^(.*)\/([^\/]+)$/; open my $fhout, ">$fnto"; + binmode $fhout; print $fhout $ffrom; + if ($opts{'verbose'} >=2) { + print STDERR "copying $fnfrom=>$fnto\n"; + } } BEGIN {