summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
authorVadim Konovalov <vkonovalov@lucent.com>2002-05-07 03:54:24 +0400
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-06 21:05:20 +0000
commit47bcb90df7a586901a81b64f5b3fa15123a641fa (patch)
tree21b76e392efd119f6214ee6c3eee2891d89ba99e /configpm
parent136430a4e342703ae104e15e3ffe4fcab3462180 (diff)
downloadperl-47bcb90df7a586901a81b64f5b3fa15123a641fa.tar.gz
two and a half steps further for WinCE cross-build
Message-ID: <022001c1f537$d2dd4f10$cb5cc3d9@vad> p4raw-id: //depot/perl@16436
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm20
1 files changed, 17 insertions, 3 deletions
diff --git a/configpm b/configpm
index e473bb5ef4..87df478960 100755
--- a/configpm
+++ b/configpm
@@ -527,12 +527,26 @@ close(GLOS);
# Now create Cross.pm if needed
if ($opts{cross}) {
open CROSS, ">lib/Cross.pm" or die "Can not open >lib/Cross.pm: $!";
- print CROSS <<"EOS";
-sub BEGIN {
- \@INC = map {/\\blib\\b/?(do{local \$_=\$_;s/\\blib\\b/xlib\\/$opts{cross}/;\$_},\$_):(\$_)} \@INC;
+ my $cross = <<'EOS';
+# typical invocation:
+# perl -MCross Makefile.PL
+# perl -MCross=wince -V:cc
+package Cross;
+
+sub import {
+ my ($package,$platform) = @_;
+ unless (defined $platform) {
+ # if $platform is not specified, then use last one when
+ # 'configpm; was invoked with --cross option
+ $platform = '***replace-marker***';
+ }
+ @INC = map {/\blib\b/?(do{local $_=$_;s/\blib\b/xlib\/$platform/;$_},$_):($_)} @INC;
}
+
1;
EOS
+ $cross =~ s/\*\*\*replace-marker\*\*\*/$opts{cross}/g;
+ print CROSS $cross;
close CROSS;
}