aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
diff options
context:
space:
mode:
authorLars Persson2008-06-26 16:51:02 +0000
committerLars Persson2008-06-26 16:51:02 +0000
commitfafda89d0c53a2ac9b0521c1e4549388f14ccea0 (patch)
treee0a9b109f0b72bc5a7969598e3a0a86d0869d798 /backends/platform/symbian/BuildPackageUpload_AllVersions.pl
parentd7051a8ef7e9569bb0d13ef437c6605ce4dbe1cc (diff)
downloadscummvm-rg350-fafda89d0c53a2ac9b0521c1e4549388f14ccea0.tar.gz
scummvm-rg350-fafda89d0c53a2ac9b0521c1e4549388f14ccea0.tar.bz2
scummvm-rg350-fafda89d0c53a2ac9b0521c1e4549388f14ccea0.zip
Fixed Symbian buildsystem for new defines. Fixed ARM asm syntax for Symbian build.
svn-id: r32803
Diffstat (limited to 'backends/platform/symbian/BuildPackageUpload_AllVersions.pl')
-rw-r--r--backends/platform/symbian/BuildPackageUpload_AllVersions.pl267
1 files changed, 214 insertions, 53 deletions
diff --git a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
index a40f8b7663..be5f9d39d2 100644
--- a/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
+++ b/backends/platform/symbian/BuildPackageUpload_AllVersions.pl
@@ -8,6 +8,7 @@ require "BuildPackageUpload_LocalSettings.pl";
##################################################################################################################
# prep some vars
+# the dir containing the build files: '.\backends\platforms\symbian\$SDK_BuildDir\'
$SDK_BuildDirs{'UIQ2'} = "UIQ2";
$SDK_BuildDirs{'UIQ3'} = "UIQ3";
$SDK_BuildDirs{'S60v1'} = "S60";
@@ -16,6 +17,7 @@ $SDK_BuildDirs{'S60v3'} = "S60v3";
$SDK_BuildDirs{'S80'} = "S80";
$SDK_BuildDirs{'S90'} = "S90";
+# the target name inserted here: 'abld BUILD $SDK_TargetName UREL'
$SDK_TargetName{'UIQ2'} = "armi";
$SDK_TargetName{'UIQ3'} = "gcce";
$SDK_TargetName{'S60v1'}= "armi";
@@ -24,6 +26,7 @@ $SDK_TargetName{'S60v3'}= "gcce";
$SDK_TargetName{'S80'} = "armi";
$SDK_TargetName{'S90'} = "armi";
+# Binaries are installed here: '$SDK_RootDirs\epoc32\release\$SDK_TargetDir\urel\'
$SDK_TargetDir{'UIQ2'} = "armi";
$SDK_TargetDir{'UIQ3'} = "armv5";
$SDK_TargetDir{'S60v1'} = "armi";
@@ -34,11 +37,11 @@ $SDK_TargetDir{'S90'} = "armi";
$build_dir = getcwd();
$output_dir = "$build_dir/Packages";
-chdir("../../");
+chdir("../../../");
$base_dir = getcwd();
chdir($build_dir);
-$build_log_out = "$build_dir/Build.out.log";
-$build_log_err = "$build_dir/Build.err.log";
+$build_log_out = "$build_dir/out.build.out.log"; # don't start these files with "Build"
+$build_log_err = "$build_dir/out.build.err.log"; # so "B"+TAB completion works in 1 go :P
$initial_path = $ENV{'PATH'}; # so we can start with a fresh PATH for each Build
@@ -54,14 +57,27 @@ $PackagesUploaded = 0;
@ErrorMessages = ();
$ftp_url = "FTP://$FTP_User\@$FTP_Host/$FTP_Dir/";
-$ExtraMacros = "MACRO NONSTANDARD_PORT\n";
-$ExtraMacros .= "MACRO DISABLE_FANCY_THEMES\n";
+# these macros are always defined:
+$ExtraMacros = "MACRO NONSTANDARD_PORT\n";
+$ExtraMacros .= "MACRO DISABLE_FANCY_THEMES\n";
+$ExtraMacros .= "MACRO DISABLE_SCALERS\n";
+$ExtraMacros .= "MACRO DISABLE_HQ_SCALERS\n";
# prep nice list of SDKs
#while( ($SDK, $RootDir) = each(%SDK_RootDirs) )
foreach $SDK (sort keys(%SDK_RootDirs))
{
- $SDKs .= "$SDK\t$SDK_RootDirs{$SDK}\n\t\t\t";
+ # see if it exists!
+ if (-d $SDK_RootDirs{$SDK})
+ {
+ $SDKs .= "$SDK\t$SDK_RootDirs{$SDK}\n\t\t\t";
+ }
+ else # missing?
+ {
+ $SDKs .= "$SDK\t$SDK_RootDirs{$SDK}\t[MISSING: Skipping!]\n\t\t\t";
+ # remove it from array, to prevent building!
+ delete $SDK_RootDirs{$SDK};
+ }
}
# prep nice list of Libraries
@@ -69,7 +85,16 @@ while( ($SDK, $Value) = each(%SDK_LibraryDirs) )
{
while( ($Library, $Path) = each(%{$SDK_LibraryDirs{$SDK}}) )
{
- $PresentLibs{$Library} = $Path;
+ # maybe it's already been built?
+ if (-e $SDK_RootDirs{$SDK}."\\epoc32\\release\\$SDK_TargetDir{$SDK}\\urel\\$Library")
+ {
+ $PresentLibs{$Library} = "$Path [EXISTS: Skipping!]";
+ delete $SDK_LibraryDirs{$SDK}{$Library};
+ }
+ else # make it!
+ {
+ $PresentLibs{$Library} = "$Path";
+ }
}
}
foreach $Library (sort keys(%PresentLibs))
@@ -78,10 +103,37 @@ foreach $Library (sort keys(%PresentLibs))
}
# prep nice list of Variations
-while( ($SDK, $Value) = each(%SDK_Variations) )
+#while( ($SDK, $Value) = each(%SDK_Variations) )
+#{
+# while( ($Variation, $Value2) = each(%{$SDK_Variations{$SDK}}) )
+# {
+# $Extra = ($Variation ne '' ? "_$Variation" : "");
+# if ($SDK eq "ALL")
+# {
+# while( ($SDK2, $RootDir) = each(%SDK_RootDirs) )
+# {
+# if ($SDK_RootDirs{$SDK2} ne '') # is this SDK listed as installed? (fails silently)
+# {
+# push @Packages, sprintf($file_tpl_sis, $version_tpl_sis, $SDK2, $Extra);
+# $PackagesQueued++;
+# }
+# }
+# }
+# else
+# {
+# if ($SDK_RootDirs{$SDK} ne '') # is this SDK listed as installed? (fails silently)
+# {
+# push @Packages, sprintf($file_tpl_sis, $version_tpl_sis, $SDK, $Extra);
+# $PackagesQueued++;
+# }
+# }
+# }
+#}
+while( ($SDK, $Value) = each(%VariationSets) )
{
- while( ($Variation, $Value2) = each(%{$SDK_Variations{$SDK}}) )
+ while( ($Variation, $FeaturesBlock) = each(%{$VariationSets{$SDK}}) )
{
+#my $MacroBlock = &MakeMppMacroDefs($FeaturesBlock);
$Extra = ($Variation ne '' ? "_$Variation" : "");
if ($SDK eq "ALL")
{
@@ -92,7 +144,7 @@ while( ($SDK, $Value) = each(%SDK_Variations) )
push @Packages, sprintf($file_tpl_sis, $version_tpl_sis, $SDK2, $Extra);
$PackagesQueued++;
}
- }
+ }
}
else
{
@@ -118,7 +170,7 @@ Preparing to Build, Package & Upload $PackagesQueued SymbianOS ScummVM variation
SDKs inst'd \t$SDKs ".( %SDK_LibraryDirs ? "
LIBs inst'd \t$LIBs " : "" )."
- $PackagesQueued Variations \t$PackagesStr
+ $PackagesQueued Variations \t$PackagesStr
DIR base \t$base_dir
build \t$build_dir
output \t$output_dir
@@ -126,7 +178,7 @@ Preparing to Build, Package & Upload $PackagesQueued SymbianOS ScummVM variation
FTP host \t$FTP_Host
user \t$FTP_User
pass \t"."*" x length($FTP_Pass)."
- dir \t$FTP_Dir
+ dir \t$FTP_Dir
" : "" )."
=======================================================================================
Press Ctrl-C to abort or enter to continue Build, Package & Upload $PackagesQueued Variations...
@@ -142,7 +194,7 @@ unlink($build_log_out);
unlink($build_log_err);
# init _base.mmp now, so we can start changing it without affecting the CVS version _base.mmp.in!
-my $name = "mmp/scummvm_base.mmp";
+my $name = "mmp/scummvm_base.mmp";
my $file = "$build_dir/$name";
open FILE, "$file.in"; @lines = <FILE>; close FILE;
my $onestr = join("",@lines);
@@ -161,15 +213,21 @@ while( ($SDK, $Value) = each(%SDK_LibraryDirs) )
{
if ($SDK_RootDirs{$SDK2} ne '') # is this SDK listed as installed? (fails silently)
{
+ # do we already have this one?
+ next if (-e $SDK_RootDirs{$SDK2}."\\epoc32\\release\\$SDK_TargetDir{$SDK2}\\urel\\$Library");
+
$LibrariesQueued++;
DoLibrary($SDK2, $Library, $Path);
}
- }
+ }
}
else
{
if ($SDK_RootDirs{$SDK} ne '') # is this SDK listed as installed? (fails silently)
{
+ # do we already have this one?
+ next if (-e $SDK_RootDirs{$SDK}."\\epoc32\\release\\$SDK_TargetDir{$SDK}\\urel\\$Library");
+
$LibrariesQueued++;
DoLibrary($SDK, $Library, $Path);
}
@@ -194,8 +252,33 @@ while( ($SDK, $VariationsHash) = each(%SDK_Variations) )
{
DoVariation($SDK2, $Variation, $MacroBlock);
}
+ }
+ }
+ else
+ {
+ if ($SDK_RootDirs{$SDK} ne '')
+ {
+ DoVariation($SDK, $Variation, $MacroBlock);
}
}
+ }
+}
+
+while( ($SDK, $VariationsHash) = each(%VariationSets) )
+{
+ while( ($Variation, $FeaturesBlock) = each(%{$VariationSets{$SDK}}) )
+ {
+ my $MacroBlock = &MakeMppMacroDefs($FeaturesBlock);
+ if ($SDK eq "ALL")
+ {
+ while( ($SDK2, $RootDir) = each(%SDK_RootDirs) )
+ {
+ if ($SDK_RootDirs{$SDK2} ne '')
+ {
+ DoVariation($SDK2, $Variation, $MacroBlock);
+ }
+ }
+ }
else
{
if ($SDK_RootDirs{$SDK} ne '')
@@ -248,7 +331,81 @@ print " SumthinWicked wishes you a ridiculously good and optimally happy d
##################################################################################################################
##################################################################################################################
-# Build, Package & Upload a single Variation
+# create a set of "MACRO xxx" definitions for use in the scummvm_base.mpp file
+sub MakeMppMacroDefs
+{
+ my ($features) = @_;
+
+ my %EnabledFeatures = ();
+ foreach (split(/\W|\r|\n/, $features))
+ {
+ if ($_ ne "")
+ {
+ #print "FEATURE: $_\n";
+ $EnabledFeatures{$_} = 1;
+ }
+ }
+
+ my $MacroDefs = "";
+
+ $MacroDefs .= " // Features //\n";
+ foreach my $e (sort keys %UseableFeatures)
+ {
+ my $E = uc($e);
+ if ($EnabledFeatures{$e})
+ {
+ $MacroDefs .= "MACRO USE_$E // LIB:$UseableFeatures{$e}\n";
+ # this one is used: remove it now
+ delete $EnabledFeatures{$e};
+ # this will leave us with a list of unparsed options!
+ }
+ else
+ {
+ $MacroDefs .= "//MACRO USE_$E\n";
+ }
+ }
+
+ $MacroDefs .= " // Engines //\n";
+ foreach my $e (sort @EnablableEngines)
+ {
+ my $E = uc($e);
+ if ($EnabledFeatures{$e})
+ {
+ $MacroDefs .= "MACRO ENABLE_$E // LIB:scummvm_$e.lib\n";
+ # this one is used: remove it now
+ delete $EnabledFeatures{$e};
+ # this will leave us with a list of unparsed options!
+ }
+ else
+ {
+ $MacroDefs .= "//MACRO ENABLE_$E\n";
+ }
+ }
+
+ $MacroDefs .= " // SubEngines //\n";
+ foreach my $e (sort @EnablableSubEngines)
+ {
+ my $E = uc($e);
+ if ($EnabledFeatures{$e})
+ {
+ $MacroDefs .= "MACRO ENABLE_$E\n";
+ # this one is used: remove it now
+ delete $EnabledFeatures{$e};
+ # this will leave us with a list of unparsed options!
+ }
+ else
+ {
+ $MacroDefs .= "//MACRO ENABLE_$E\n";
+ }
+ }
+
+#print "\n\n'$features' ==> $MacroDefs\n\n\n";
+ return $MacroDefs;
+}
+
+##################################################################################################################
+
+# Build, Package & Upload a single Variation
sub DoLibrary
{
my ($SDK, $Library, $Path) = @_;
@@ -278,19 +435,19 @@ my $header = "
my $OK = 1;
PrepSdkPaths($SDK);
-
+
chdir($Path) or $OK=0;
PrintErrorMessage("Changing to $Path failed!") if (!$OK);
- return 0 if (!$OK);
+ return 0 if (!$OK);
PrintMessage("Cleaning for $Target") if (!$ReallyQuiet);
system("bldmake bldfiles > NUL 2> NUL");
PrintErrorMessage("'bldmake bldfiles' exited with value " . ($? >> 8)) if ($? >> 8);
- system("abld clean $TargetName urel > NUL 2> NUL");
- PrintErrorMessage("'abld clean $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
+ system("abld CLEAN $TargetName UREL > NUL 2> NUL");
+ PrintErrorMessage("'abld CLEAN $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
# remove file so we are sure that after .lib generation we have a fresh copy!
if (-e $TargetFilePath) { unlink($TargetFilePath) or PrintErrorMessage("Removing $TargetFilePath"); }
-
+
my $Redirection = "OUT:file, ERR:".($RedirectSTDERR ? "file" : "screen");
my $Message = "Building $Target ($Redirection)";
PrintMessage($Message) if (!$ReallyQuiet);
@@ -298,18 +455,18 @@ my $header = "
my $OldSize = (-s $build_log_err);
$Redirection = ($RedirectSTDERR ? "2>> $build_log_err" : "");
- system("abld build $TargetName urel $Redirection >> $build_log_out");
+ system("abld BUILD $TargetName UREL $Redirection >> $build_log_out");
$OK = 0 if ($? >> 8);
# print " STDERR: ".((-s $build_log_err)-$OldSize)." bytes output written to $build_log_err\n+--------------------------------------------------------------------------------------\n" if ($OldSize != (-s $build_log_err));
- PrintErrorMessage("'abld build $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
- return 0 if (!$OK); # ABLD always returns ok :( grr
+ PrintErrorMessage("'abld BUILD $TargetName UREL' exited with value " . ($? >> 8)) if ($? >> 8);
+ return 0 if (!$OK); # ABLD always returns ok :( grr
PrintMessage("Done.") if (!$ReallyQuiet);
# did it work? :)
if (-e $TargetFilePath)
{
$LibrariesSucceeded++;
-
+
if ($TargetIntermediatePath ne '' && $TargetIntermediatePath =~ /\\EPOC32\\BUILD\\/i) # make really sure it's a valid path!
{
system("del /S /Q $TargetIntermediatePath > NUL");
@@ -318,9 +475,9 @@ my $header = "
}
else
{
- PrintErrorMessage("'abld build $TargetName urel' apparently failed.");
+ PrintErrorMessage("'abld BUILD $TargetName UREL' apparently failed.");
if ($HaltOnError)
- {
+ {
PrintErrorMessage("Halting on error as requested!");
exit 1;
}
@@ -330,12 +487,12 @@ my $header = "
##################################################################################################################
-# Build, Package & Upload a single Variation
+# Build, Package & Upload a single Variation
sub DoVariation
{
my ($SDK, $Variation, $MacroBlock) = @_;
my $Extra = ($Variation ne '' ? "_$Variation" : "");
- my $Package = sprintf($file_tpl_sis, $version_tpl_sis, $SDK, $Extra);
+ my $Package = sprintf($file_tpl_sis, $version_tpl_sis, $SDK, $Extra);
if ($SkipExistingPackages && -f "$output_dir/$Package")
{
@@ -366,7 +523,7 @@ my $header = "
if ($OK)
{
$OK = BuildVariation($SDK, $Variation, $Package, $MacroBlock);
-
+
if ($OK && $FTP_Host ne '')
{
UploadVariation($SDK, $Variation, $Package);
@@ -382,17 +539,17 @@ sub PrepVariation()
my $OK = 1;
PrepSdkPaths($SDK);
-
+
chdir($build_dir) or $OK=0;
PrintErrorMessage("Changing to $build_dir failed!") if (!$OK);
- return 0 if (!$OK);
+ return 0 if (!$OK);
# insert $MacroBlock into AUTO_MACRO_MASTER in scummvm_base.mmp
PrintMessage("Setting new AUTO_MACROS_MASTER in scummvm_base.mmp for '$Variation'") if (!$ReallyQuiet);
my $n = "AUTO_MACROS_MASTER";
my $a = "\/\/START_$n\/\/";
my $b = "\/\/STOP_$n\/\/";
- my $name = "scummvm_base.mmp";
+ my $name = "scummvm_base.mmp";
my $file = "$build_dir/mmp/$name";
my $updated = " Updated @ ".localtime();
@@ -401,11 +558,11 @@ sub PrepVariation()
return 0 if (!$OK);
my @lines = <FILE>;
close FILE;
-
+
my $onestr = join("",@lines);
$MacroBlock =~ s/^\s*//gm;
$onestr =~ s/$a(.*)$b/$a$updated\n$ExtraMacros$MacroBlock$b/s;
-
+
open FILE, ">$file" or $OK=0;
PrintErrorMessage("Writing file '$file'") if (!$OK);
return 0 if (!$OK);
@@ -418,7 +575,7 @@ sub PrepVariation()
$OK = 0 if ($? >> 8);
PrintErrorMessage("'AdaptAllMMPs.pl' exited with value " . ($? >> 8)) if ($? >> 8);
return 0 if (!$OK);
-
+
# we are here: so all is ok :)
return 1;
}
@@ -431,7 +588,7 @@ sub BuildVariation()
my $TargetName = $SDK_TargetName{$SDK};
my $TargetDir = $SDK_TargetDir{$SDK};
my $OK = 1;
-
+
my $dir = $build_dir."/".$SDK_BuildDirs{$SDK};
$dir =~ s#/#\\#g;
chdir($dir);
@@ -449,13 +606,15 @@ sub BuildVariation()
if (-e $UnlinkFile) { unlink($UnlinkFile) or PrintErrorMessage("Removing $UnlinkFile"); }
$UnlinkFile = $SDK_RootDirs{$SDK}."/epoc32/release/$TargetDir/urel/ScummVM.exe";
if (-e $UnlinkFile) { unlink($UnlinkFile) or PrintErrorMessage("Removing $UnlinkFile"); }
+ # remove all libs here, note they are in another dir!
+ system("rm ".$SDK_RootDirs{$SDK}."/epoc32/release/$TargetName/urel/scummvm_*.lib");
system("bldmake bldfiles 2> NUL > NUL");
PrintErrorMessage("'bldmake bldfiles' exited with value " . ($? >> 8)) if ($? >> 8);
- system("abld clean $TargetName urel 2> NUL > NUL");
- PrintErrorMessage("'abld clean $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
-
+ system("abld CLEAN $TargetName UREL 2> NUL > NUL");
+ PrintErrorMessage("'abld CLEAN $TargetName UREL' exited with value " . ($? >> 8)) if ($? >> 8);
+
my $Redirection = "OUT:file, ERR:".($RedirectSTDERR ? "file" : "screen");
my $Message = "Building $Package ($Redirection)";
PrintMessage($Message) if (!$ReallyQuiet);
@@ -463,11 +622,11 @@ sub BuildVariation()
my $OldSize = (-s $build_log_err);
$Redirection = ($RedirectSTDERR ? "2>> $build_log_err" : "");
- system("abld build $TargetName urel $Redirection >> $build_log_out");
+ system("abld BUILD $TargetName UREL $Redirection >> $build_log_out");
$OK = 0 if ($? >> 8);
print " STDERR: ".((-s $build_log_err)-$OldSize)." bytes output written to $build_log_err\n+--------------------------------------------------------------------------------------\n" if ($OldSize != (-s $build_log_err) && !$ReallyQuiet);
- PrintErrorMessage("'abld build $TargetName urel' exited with value " . ($? >> 8)) if ($? >> 8);
- return 0 if (!$OK); # ABLD always returns ok :( grr
+ PrintErrorMessage("'abld BUILD $TargetName UREL' exited with value " . ($? >> 8)) if ($? >> 8);
+ return 0 if (!$OK); # ABLD always returns ok :( grr
PrintMessage("Done.") if (!$ReallyQuiet);
# do we have an override suffix for the package name?
@@ -491,7 +650,7 @@ sub BuildVariation()
if (-e "$output_dir/$Package")
{
$PackagesCreated++;
-
+
if ($TargetIntermediatePath ne '' && $TargetIntermediatePath =~ /\\EPOC32\\BUILD\\/i) # make really sure it's a valid path!
{
#PrintMessage("Cleaning $TargetIntermediatePath");
@@ -514,7 +673,7 @@ sub UploadVariation()
use Net::FTP;
my $newerr;
-
+
PrintMessage("Connecting to FTP $FTP_Host") if (!$ReallyQuiet);
$ftp = Net::FTP->new($FTP_Host,Timeout=>240) or $newerr=1;
@@ -529,7 +688,7 @@ sub UploadVariation()
{
PrintMessage("Changing to dir $FTP_Dir");
$ftp->cwd($FTP_Dir) or $newerr=1;
-
+
if ($newerr)
{
PrintErrorMessage("Changing to dir $FTP_Dir! Aborting!");
@@ -541,20 +700,20 @@ sub UploadVariation()
# leave this for possible auto-deletion of old files?
# @files = $ftp->dir or $newerr=1;
# push @ERRORS, "Can't get file list $!\n" if $newerr;
-# print "Got file list\n";
+# print "Got file list\n";
# foreach(@files) {
# print "$_\n";
# }
-
+
PrintMessage("Uploading $Package (".(-s "$output_dir/$Package")." bytes)");
-
+
$ftp->binary;
$ftp->put("$output_dir/$Package") or $newerr=1;
PrintErrorMessage("Uploading package! Aborting!") if $newerr;
$PackagesUploaded++ if (!$newerr);
- }
+ }
- $ftp->quit;
+ $ftp->quit;
}
}
@@ -574,6 +733,7 @@ sub PrepSdkPaths()
# set env stuff
PrintMessage("Prepending $SDK specific paths to %PATH%") if (!$ReallyQuiet);
+ $AdditionalPathEntries .= "$SDK_ToolchainDirs{$SDK};" if ($SDK_ToolchainDirs{$SDK} ne '');
$AdditionalPathEntries .= "$ECompXL_BinDir;" if ($ECompXL_BinDir ne '' && $SDK eq 'UIQ2');
$AdditionalPathEntries .= "$EPOC32RT\\include;";
$AdditionalPathEntries .= "$EPOC32RT\\tools;";
@@ -594,7 +754,7 @@ sub CleanupPath()
{
$path =~ s/\"\Q$ECompXL_BinDir\E\";//g;
}
-
+
while( ($SDK, $RootDir) = each(%SDK_RootDirs) )
{
if ($SDK_RootDirs{$SDK} ne '')
@@ -602,8 +762,8 @@ sub CleanupPath()
my $path_component = "\"".$SDK_RootDirs{$SDK}."\\epoc32\\";
$path =~ s/\Q$path_component\E.*?\";//g;
}
- }
-
+ }
+
return $path;
}
@@ -634,4 +794,5 @@ sub PrintMessage()
}
##################################################################################################################
+