8 'distdir' => 'distdir',
9 'unicode' => 1, # include unicode by default
10 'minimal' => 0, # minimal possible distribution.
11 # actually this is just perl.exe and perlXX.dll
12 # but can be extended by additional exts
13 # ... (as soon as this will be implemented :)
14 'include-modules' => '', # TODO
15 'exclude-modules' => '', # TODO
16 #??? 'only-modules' => '', # TODO
17 'platform' => 'wince',
18 'strip-pod' => 0, # TODO strip POD from perl modules
19 'adaptation' => 0, # TODO do some adaptation, such as stripping such
20 # occurences as "if ($^O eq 'VMS'){...}" for certain modules
21 'zip' => 0, # perform zip (TODO)
24 (map {/^--([\-_\w]+)=(.*)$/} @ARGV), # --opt=smth
25 (map {/^no-?(.*)$/i?($1=>0):($_=>1)} map {/^--([\-_\w]+)$/} @ARGV), # --opt --no-opt --noopt
28 # TODO -- error checking. When something goes wrong, just exit with rc!=0
32 if ($opts{'clean-exts'}) {
33 # unfortunately, unlike perl58.dll and like, extensions for different
34 # platforms are built in same directory, therefore we must be able to clean
36 unlink '../config.sh'; # delete cache config file, which remembers our previous config
38 find({no_chdir=>1,wanted => sub{
39 unlink if /((?:\.obj|\/makefile|\/errno\.pm))$/i;
45 my (%libexclusions, %extexclusions);
51 find({no_chdir=>1,wanted=>sub{push @lfiles, $_ if /\.p[lm]$/}},'.');
54 @lfiles = grep {!exists $libexclusions{$_}} @lfiles;
60 mkpath "$opts{distdir}/lib/$1";
61 copy "../lib/$_", "$opts{distdir}/lib/$_";
67 find({no_chdir=>1,wanted=>sub{push @efiles, $_ if /\.pm$/}},'.');
74 #{s[/(\w+)/\1\.pm][/$1.pm]} @efiles;
76 /^(.*)\/([^\/]+)\/([^\/]+)$/;
77 copy "../ext/$_", "$opts{distdir}/lib/$1/$3";
81 copy "../xlib/$opts{platform}/Config.pm", "$opts{distdir}/lib/Config.pm";
85 chdir "../xlib/$opts{platform}/auto";
86 find({no_chdir=>1,wanted=>sub{push @afiles, $_ if /\.(dll|bs)$/}},'.');
89 copy "../xlib/$opts{platform}/auto/$_", "$opts{distdir}/lib/auto/$_";
93 my ($fnfrom, $fnto) = @_;
94 my $ffrom = do {local (@ARGV,$/) = $fnfrom; <>};
95 if ($opts{'strip-pod'}) {
96 # actually following regexp is suspicious to not work everywhere.
97 # but we've checked on our set of modules, and it's fit for our purposes
98 $ffrom =~ s/^=\w+.*?^=cut(?:\n|\Z)//msg;
99 # $ffrom =~ s/^__END__.*\Z//msg; # TODO -- deal with Autoload
101 mkpath $1 if $fnto=~/^(.*)\/([^\/]+)$/;
102 open my $fhout, ">$fnto";
107 %libexclusions = map {$_=>1} split/\s/, <<"EOS";
108 abbrev.pl bigfloat.pl bigint.pl bigrat.pl cacheout.pl complete.pl ctime.pl
109 dotsh.pl exceptions.pl fastcwd.pl flush.pl ftp.pl getcwd.pl getopt.pl
110 getopts.pl hostname.pl look.pl newgetopt.pl pwd.pl termcap.pl
112 %extexclusions = map {$_=>1} split/\s/, <<"EOS";