Change 24683 by rgs@bloom on 2005/06/03 07:45:21
Subject: [PATCH] symbian/xsbuild.pl
From: <jarkko.hietaniemi (AT) nokia (DOT) com>
Date: Fri, 3 Jun 2005 11:00:01 +0300
Message-ID: <@esebe105.NE.Nokia.com>
Affected files
//depot/perl/symbian/xsbuild.pl#2 edit
Differences
//depot/perl/symbian/xsbuild.pl#2 (text)
Index: perl/symbian/xsbuild.pl
perl/symbian/xsbuild.pl#1~24271~Thu Apr 21 08:38:30 2005
perl/symbian/xsbuild.plFri Jun 3 00:45:21 2005
@@ -36,7 +36,7 @@
my $PERLSDK;
my $WIN;
my $ARM;
-my $HME = getcwd();
+my $BUILDRT = getcwd();
if ( !defined $PerlVersion && $0 =~ m:\\symbian\\perl\\(.+)\\bin\\xsbuild.pl:i )
{
@@ -56,7 +56,7 @@
$SDK = do "sdk.pl";
$VERSIN = "$VERSIN{REVISIN}$VERSIN{VERSIN}$VERSIN{SUBVERSIN}";
$R_V_SV = "$VERSIN{REVISIN}.$VERSIN{VERSIN}.$VERSIN{SUBVERSIN }";
- $HME = do "cwd.pl";
+ $BUILDRT = do "cwd.pl";
$SymbianVersion = $1 if $SDK =~ m:\\Symbian\\([^\\]+):;
$PerlVersion = $R_V_SV;
$S60SDK = $ENV{S60SDK}; # from sdk.pl
@@ -144,18 +144,19 @@
}
my $cmd;
if ($CoreBuild) {
- # Problem: the Config.pm we have in $HME\\lib carries the
+ # Problem: the Config.pm we have in $BUILDRT\\lib carries the
# version number of the Perl we are building, while the Perl
# we are running might have some other version. Solution:
# temporarily replace the Config.pm with a patched version.
my $V = sprintf "%vd", $^V;
- unlink("$HME\\lib\\Config.pm.bak");
-system_echo("perl -pi.bak -e \"s:\\Q$R_V_SV:$V:\" $HME\\lib\\Config.pm");
+ unlink("$BUILDRT\\lib\\Config.pm.bak");
+print "(patching $BUILDRT\\lib\\Config.pm)\n";
+system_echo("perl -pi.bak -e \"s:\\Q$R_V_SV:$V:\" $BUILDRT\\lib\\Config.pm");
}
- system_echo("perl -I$HME\\lib -I$HME\\xlib\\symbian $PL") == 0
+ system_echo("perl -I$BUILDRT\\lib -I$BUILDRT\\xlib\\symbian $PL") == 0
or warn "$0: $PL failed.\n";
if ($CoreBuild) {
- system_echo("copy $HME\\lib\\Config.pm.bak $HME\\lib\\Config.pm");
+ system_echo("copy $BUILDRT\\lib\\Config.pm.bak $BUILDRT\\lib\\Config.pm");
}
if ( defined $file ) { -s $file or die "$0: No $file created.\n" }
}
@@ -204,10 +205,10 @@
$CNF{TARGET} = "$base.dll";
$CNF{TARGETPATH} = "\\System\\Libs\\Perl\\$R_V_SV";
$CNF{SURCE} = [@src];
- $CNF{SURCEPATH} = [ $CWD, $HME ];
- $CNF{USERINCLUDE} = [ $CWD, $HME ];
+ $CNF{SURCEPATH} = [ $CWD, $BUILDRT ];
+ $CNF{USERINCLUDE} = [ $CWD, $BUILDRT ];
$CNF{SYSTEMINCLUDE} = ["$PERLSDK\\include"] unless $CoreBuild;
- $CNF{SYSTEMINCLUDE} = [ $HME ] if $CoreBuild;
+ $CNF{SYSTEMINCLUDE} = [ $BUILDRT ] if $CoreBuild;
$CNF{LIBRARY} = [];
$CNF{MACR} = [];
read_mmp( \%CNF, "_init.mmp" );
@@ -219,7 +220,7 @@
push @{ $CNF{USERINCLUDE} }, $ui;
}
else {
- push @{ $CNF{USERINCLUDE} }, "$HME\\$ui";
+ push @{ $CNF{USERINCLUDE} }, "$BUILDRT\\$ui";
}
}
push @{ $CNF{SYSTEMINCLUDE} }, "\\epoc32\\include";
@@ -356,7 +357,7 @@
delete $ENV{MAKEFLAGS};
print "abld @ARGV\n";
-system("abld @ARGV");
+system_echo("abld @ARGV");
__EF__
close(B);
} else {
@@ -375,7 +376,7 @@
sub xsconfig {
my ( $ext, $dir ) = @_;
print "Configuring for $ext, directory $dir\n";
- my $extu = $CoreBuild ? "$HME\\lib\\ExtUtils" : "$PERLSDK\\lib\\ExtUtils";
+ my $extu = $CoreBuild ? "$BUILDRT\\lib\\ExtUtils" : "$PERLSDK\\lib\\ExtUtils";
update_dir($dir) or die "$0: chdir '$dir': $!\n";
my $build = dirname($ext);
my $base = basename($ext);
@@ -547,8 +548,8 @@
warn "$0: $basec: $!";
}
unless (
- system(
-"perl -I$PERLSDK\\lib $extu\\xsubpp -C++ -csuffix .cpp -typemap $extu\\typemap -noprototypes $basexs >$basec"
+ system_echo(
+"perl -I$BUILDRT\\lib -I$PERLSDK\\lib $extu\\xsubpp -csuffix .cpp -typemap $extu\\typemap -noprototypes $basexs >$basec"
) == 0
&& -s $basec
)
@@ -578,7 +579,7 @@
while (<SUBMF>) {
next if 1 /postamble/;
if (m!^(\w+_t)\.c : !) {
- system(
+ system_echo(
"perl \\bin\\enc2xs -Q -o $1.c -f $1.fnm")
== 0
or warn "$0: enc2xs: $!\n";
@@ -595,8 +596,8 @@
write_bld_inf($subbase);
unless (
- system(
-"perl -I$HME\\lib \\$extu\\xsubpp -C++ -csuffix .cpp -typemap \\$extu\\typemap -noprototypes $subbase.xs $subbase.c"
+ system_echo(
+"perl -I$BUILDRT\\lib \\$extu\\xsubpp -csuffix .cpp -typemap \\$extu\\typemap -noprototypes $subbase.xs $subbase.c"
) == 0
&& -s "$subbase.c"
)
@@ -624,7 +625,7 @@
$lstname =~ s:\\:-:g;
print "\t$lstname.lst\n";
my $lstout =
- $CoreBuild ? "$HME/symbian/$lstname.lst" : "$HME/$lstname.lst";
+ $CoreBuild ? "$BUILDRT/symbian/$lstname.lst" : "$BUILDRT/$lstname.lst";
if ( open( my $lst, ">$lstout" ) ) {
for my $f (@lst) { print $lst qq["$f"-"!:$lst{$f}"\n] }
close($lst);
@@ -632,7 +633,7 @@
else {
die "$0: $lstout: $!\n";
}
- update_dir($HME);
+ update_dir($BUILDRT);
}
sub update_cwd {
@@ -735,8 +736,8 @@
# (2) With the rest and the _init.c to get ordinals for the rest.
# (3) With an updated _init.c that carries the symbols from step (2).
- system("make clean");
- system("make defrost") == 0 or die "$0: make defrost failed\n";
+ system_echo("make clean");
+ system_echo("make defrost") == 0 or die "$0: make defrost failed\n";
my @TARGET;
@@ -745,19 +746,21 @@
# Compile #1.
# Hide all but the _init.c.
print "\n $ext - Compile 1 of 3.\n\n";
+print "(patching $base.mmp)\n";
system(
"perl -pi.bak -e \"s:^SURCE\\s+_init.c:SURCE\\t_init.c // :\" $base.mmp"
);
-system("bldmake bldfiles");
- system("make @TARGET") == 0 or die "$0: make #1 failed\n";
+system_echo("bldmake bldfiles");
+ system_echo("make @TARGET") == 0 or die "$0: make #1 failed\n";
# Compile #2.
# Reveal the rest again.
print "\n $ext - Compile 2 of 3.\n\n";
+print "(patching $base.mmp)\n";
system(
"perl -pi.bak -e \"s:^SURCE\\t_init.c // :SURCE\\t_init.c :\" $base.mmp"
);
- system("make @TARGET") == 0 or die "$0: make #2 failed\n";
+ system_echo("make @TARGET") == 0 or die "$0: make #2 failed\n";
unlink("$base.mmp.bak");
open( _INIT_C, ">_init.c" ) or die "$0: _init.c: $!\n";
@@ -828,7 +831,7 @@
# Compile #3. This is for real.
print "\n $ext - Compile 3 of 3.\n\n";
- system("make @TARGET") == 0 or die "$0: make #3 failed\n";
+ system_echo("make @TARGET") == 0 or die "$0: make #3 failed\n";
}
elsif ( $Clean || $DistClean ) {
@@ -838,10 +841,10 @@
else {
if ( -f "Makefile" ) {
if ($Clean) {
- system("make clean") == 0 or die "$0: make clean failed\n";
+ system_echo("make clean") == 0 or die "$0: make clean failed\n";
}
elsif ($DistClean) {
- system("make distclean") == 0
+ system_echo("make distclean") == 0
or die "$0: make distclean failed\n";
}
}
@@ -853,7 +856,7 @@
rmdir(@B) if @B;
}
- update_dir($HME);
+ update_dir($BUILDRT);
} # for my $ext
End of Patch.