3 helper script to make life for PerlCE easier.
5 You need edit values for @defs array to reflect your changes and then do
7 perl comp.pl [any-additional-options]
11 with most parameters overrided as you specified and additional options
12 (such as build target) will also be prepended to command line to execute.
14 There are also additional different modes for running this script:
15 perl comp.pl --run [any-command-line-arguments]
17 perl comp.pl --do [any-command-line-arguments]
19 perl comp.pl --copy-pm pc:[pc-location] ce:[ce-location]
21 --run executes this build of perl on CE device with arguments provided
22 --run=test will display a predefined messagebox that say everything is ok.
24 --do Executes on local computer command that is presented by arguments
25 immediately following after --do
26 Most reason why you may want to execute script in this mode is that
27 arguments preprocessed to replace [p] occurences into current perl
28 location. Typically it is handy to run
29 perl comp.pl --do cecopy pc:..\lib\Exporter.pm ce:[p]\lib
31 --copy copies file to CE device
32 here also [p] will be expanded to corrent PerlCE path, and additionally
33 when --copy=compact specified then, if filename looks like perl module,
34 then POD will be stripped away from that file
43 # edit value of $inst_root variable to reflect your desired location of
45 my $inst_root = "\\Storage Card\\perl-tests\\perl\@16225";
49 "\"INSTALL_ROOT=$inst_root\"",
50 "\"WCEROOT=$ENV{SDKROOT}\"",
51 "NTPERL=$^X", #todo: check version: this must be (almost?) current version
52 "\"CEPATH=$ENV{WCEROOT}\"",
53 "CELIBDLLDIR=d:\\personal\\pocketPC\\celib-palm-3.0",
54 "CECONSOLEDIR=d:\\personal\\pocketPC\\w32console",
57 "MACHINE=wince-mips-pocket-wce300",
59 #NIY "\"CECOPY=\$(NTPERL) \$(PERLCEDIR)\\$0 --copy=compact\"",
60 "\"CECOPY=\$(NTPERL) \$(PERLCEDIR)\\$0 --copy\"",
64 # %known_opts enumerates allowed opts as well as specifies default
72 my %specified_opts = (
73 (map {/^--([\-_\w]+)=(.*)$/} @ARGV), # --opt=smth
74 (map {/^no-?(.*)$/i?($1=>0):($_=>1)} map {/^--([\-_\w]+)$/} @ARGV), # --opt --no-opt --noopt
77 die "option '$_' is not recognized" for grep {!exists $known_opts{$_}} keys %specified_opts;
78 @ARGV = grep {!/^--/} @ARGV;
81 s/\[p\]/$inst_root/g for @ARGV;
84 elsif ($opts{'run'}) {
85 if ($opts{'run'} eq 'test') {
86 system("ceexec","$inst_root\\bin\\perl","-we","Win32::MessageBox(\$].qq(\n).join'','cc'..'dx')");
89 system("ceexec","$inst_root\\bin\\perl", map {/^".*"$/s?$_:"\"$_\""} @ARGV);
92 elsif ($opts{'copy'}) {
93 if ($opts{'copy'} eq 'compact') {
96 s/\[p\]/$inst_root/g for @ARGV;
97 if ($ARGV[0]=~/^pc:/i) {system("cedel",$ARGV[1])}
98 system("cecopy",@ARGV);
101 my $cmd = "nmake -f Makefile.ce @defs @ARGV";
109 Author Vadim Konovalov.