More WinCE tweaking for Vadim Konovalov.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 7 Apr 2003 03:41:17 +0000 (03:41 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 7 Apr 2003 03:41:17 +0000 (03:41 +0000)
p4raw-id: //depot/perl@19158

wince/Makefile.ce
wince/compile-all.bat
wince/compile.bat
wince/makedist.pl

index d02f1a4..af482dc 100644 (file)
@@ -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
index 5f94d44..c85f5e9 100644 (file)
@@ -1,13 +1,62 @@
-call compile.bat MACHINE=wince-arm-hpc-wce300     \r
-call compile.bat MACHINE=wince-arm-hpc-wce211     \r
-call compile.bat MACHINE=wince-sh3-hpc-wce211     \r
-call compile.bat MACHINE=wince-mips-hpc-wce211    \r
-call compile.bat MACHINE=wince-sh3-hpc-wce200     \r
-call compile.bat MACHINE=wince-mips-hpc-wce200    \r
-call compile.bat MACHINE=wince-arm-pocket-wce300  \r
-call compile.bat MACHINE=wince-mips-pocket-wce300 \r
-call compile.bat MACHINE=wince-sh3-pocket-wce300  \r
-call compile.bat MACHINE=wince-x86em-pocket-wce300\r
-call compile.bat MACHINE=wince-mips-palm-wce211   \r
-call compile.bat MACHINE=wince-sh3-palm-wce211    \r
-call compile.bat MACHINE=wince-x86em-palm-wce211  \r
+@echo off\r
+rem\r
+rem Normally you do not need to run this file.\r
+rem Instead you should edit and execute compile.bat .\r
+rem\r
+rem This file assumes that you have a set of appropriate\r
+rem bat-files that prepare environment variables for build process\r
+rem and execute commands passed as arguments\r
+rem\r
+\r
+call wcearm-300 compile.bat "MACHINE=wince-arm-hpc-wce300"\r
+call wcearm-300 compile.bat "MACHINE=wince-arm-hpc-wce300" zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call wcearm-211 compile.bat "MACHINE=wince-arm-hpc-wce211"\r
+call wcearm-211 compile.bat "MACHINE=wince-arm-hpc-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call wcesh3-211 compile.bat "MACHINE=wince-sh3-hpc-wce211"\r
+call wcesh3-211 compile.bat "MACHINE=wince-sh3-hpc-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call wcemips-211 compile.bat "MACHINE=wince-mips-hpc-wce211"\r
+call wcemips-211 compile.bat "MACHINE=wince-mips-hpc-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+rem TODO call wcesh3-200 compile.bat "MACHINE=wince-sh3-hpc-wce200"\r
+rem TODO call wcesh3-200 compile.bat "MACHINE=wince-sh3-hpc-wce200"  zipdist\r
+rem TODO ..\miniperl makedist.pl --clean-exts\r
+\r
+rem TODO call compile.bat "MACHINE=wince-mips-hpc-wce200"\r
+rem TODO call compile.bat "MACHINE=wince-mips-hpc-wce200"  zipdist\r
+rem TODO ..\miniperl makedist.pl --clean-exts\r
+\r
+call WCEARM-p300 compile.bat "MACHINE=wince-arm-pocket-wce300"\r
+call WCEARM-p300 compile.bat "MACHINE=wince-arm-pocket-wce300"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCEMIPS-300 compile.bat "MACHINE=wince-mips-pocket-wce300"\r
+call WCEMIPS-300 compile.bat "MACHINE=wince-mips-pocket-wce300"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCESH3-300 compile.bat "MACHINE=wince-sh3-pocket-wce300"\r
+call WCESH3-300 compile.bat "MACHINE=wince-sh3-pocket-wce300"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCEx86-300 compile.bat "MACHINE=wince-x86em-pocket-wce300"\r
+call WCEx86-300 compile.bat "MACHINE=wince-x86em-pocket-wce300"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCEMIPS-palm211 compile.bat "MACHINE=wince-mips-palm-wce211"\r
+call WCEMIPS-palm211 compile.bat "MACHINE=wince-mips-palm-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCESH3-palm211 compile.bat "MACHINE=wince-sh3-palm-wce211"\r
+call WCESH3-palm211 compile.bat "MACHINE=wince-sh3-palm-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
+call WCEx86-palm211 compile.bat "MACHINE=wince-x86em-palm-wce211"\r
+call WCEx86-palm211 compile.bat "MACHINE=wince-x86em-palm-wce211"  zipdist\r
+..\miniperl makedist.pl --clean-exts\r
+\r
index 73c731f..72c7042 100644 (file)
@@ -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
index 5729922..be447e8 100644 (file)
@@ -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 {