[Scummvm-cvs-logs] CVS: scummvm/backends/epoc .placeholder,NONE,1.1 AdaptAllMMPs.pl,NONE,1.1 README,1.3,1.4

Lars Persson anotherguest at users.sourceforge.net
Sat Dec 3 13:30:04 CET 2005


Update of /cvsroot/scummvm/scummvm/backends/epoc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31925/backends/epoc

Modified Files:
	README 
Added Files:
	.placeholder AdaptAllMMPs.pl 
Log Message:
1. New build structure for Symbian builds to allow easier build and project updates
2. Updated framework files for new structure
3. Uncommented Debug statements in vorbis.cpp (Should probably be removed alltogether.
4. Incorporated Sevs code formatting changes in the new Symbian source structure.
5. Removed/Changed EScummVM to ScummVM instead, hopefully most cases covered.
6. Beginning vibration support to be used for Scumm shake effects (Work ongoing by SumthinWicked)
7. Replaced the ScummVM icon for the FavIcon and upscaled the icon to 32x32. I think it looks ok, comments are welcome.
8. Built for S60V1 and UIQ2 targets from the cvs
9. Updated Readme with new build instructions.

Any comments are welcome.  Hopefully the other builds are not affected by this and all Sevs code updates are also incorporated.

--- NEW FILE: .placeholder ---
>> SumthinWicked *grins* <<
--- NEW FILE: AdaptAllMMPs.pl ---

use Cwd;

$buildDir = getcwd();
chdir("../../");

print "
=======================================================================================
Updating slave MACRO settings in MMP files from master 'scummvm_base.mmp'
=======================================================================================

";

@mmp_files = (	"mmp/scummvm_scumm.mmp", "mmp/scummvm_queen.mmp", "mmp/scummvm_simon.mmp", "mmp/scummvm_sky.mmp", "mmp/scummvm_gob.mmp", "mmp/scummvm_saga.mmp", "mmp/scummvm_kyra.mmp", "mmp/scummvm_sword1.mmp", "mmp/scummvm_sword2.mmp", 
				"UIQ2/ScummVM_UIQ2.mmp", "UIQ3/ScummVM_UIQ3.mmp", "S60/ScummVM_S60.mmp",  "S60v3/ScummVM_S60v3.mmp", "S80/ScummVM_S80.mmp", "S90/ScummVM_S90.mmp");

# do this first so we have @DisableDefines for correct inclusion of SOURCE files later
UpdateSlaveMacros();

print "
=======================================================================================
Preparing to update all the Symbian MMP project files with objects from module.mk files
=======================================================================================

";
	
my @section_empty = (""); # section standard: no #ifdef's in module.mk files
my @sections_scumm = ("", "DISABLE_SCUMM_7_8", "DISABLE_HE"); # special sections for engine SCUMM
my @base_excludes = ("mt32","fluidsynth"); # case insensitive exclusions for sound

#arseModule(mmpStr,		dirStr,		ifdefArray,		[exclusionsArray])
#ParseModule("_base",	"base",		\@section_empty); # now in ./TRG/ScummVM_TRG.mmp, these never change anyways...
ParseModule("_base",	"common",	\@section_empty);
ParseModule("_base",	"gui",		\@section_empty);
ParseModule("_base",	"graphics",	\@section_empty);
ParseModule("_base",	"sound",	\@section_empty,		\@base_excludes);

ParseModule("_scumm",	"scumm",	\@sections_scumm);
ParseModule("_queen",	"queen",	\@section_empty);
ParseModule("_simon",	"simon",	\@section_empty);
ParseModule("_sky",		"sky",		\@section_empty);
ParseModule("_gob",		"gob",		\@section_empty);
ParseModule("_saga",	"saga",		\@section_empty);

ParseModule("_kyra",	"kyra",		\@section_empty);
ParseModule("_sword1",	"sword1",	\@section_empty);
ParseModule("_sword2",	"sword2",	\@section_empty);

print "
=======================================================================================
Done. Enjoy :P
=======================================================================================
";

##################################################################################################################
##################################################################################################################

# parses multiple sections per mmp/module 
sub ParseModule
{
	my ($mmp,$module,$sections,$exclusions) = @_;
	my @sections = @{$sections};
	my @exclusions = @{$exclusions};

	foreach $section (@sections)
	{
		CheckForModuleMK($module, $section, @exclusions);
		UpdateProjectFile($mmp, $module, $section);
	}
}

##################################################################################################################

# parses all module.mk files in a dir and its subdirs
sub CheckForModuleMK
{
	my ($item,$section, at exclusions) = @_;

	# if dir: check subdirs too
	if (-d $item)
	{
		#print "$item\n";
		
		opendir DIR, $item;
		#my @Files = readdir DIR;
		my @Files = grep s/^([^\.].*)$/$1/, readdir DIR;
		closedir DIR;

		foreach $entry (@Files)
		{
			CheckForModuleMK("$item/$entry", $section, @exclusions);
		}
	}

	# if this is a module.mk file
	if (-f $item and $item =~ /.*\/module.mk$/)
	{
		my $sec = "";
		my $secnum = 0;
		
		print "Parsing  $item for section '$section' ... ";

		open FILE, $item;
		my @lines = <FILE>;
		close FILE;

		my $count = @lines;
		print "$count lines";
		
		A: foreach $line (@lines)
		{
			# found a section? reset 
			if ($line =~ /^ifndef (.*)/)
			{
				$sec = $1;
			}
			# found an object? Not uncommented!
			if (!($line =~ /^#/) && $line =~ s/\.o/.cpp/)
			{
				# handle this section?
				if ($sec eq $section)
				{
					$line =~ s/^\s*//g; # remove possible leading whitespace
					$line =~ s/ \\//; # remove possible trailing ' \'
					$line =~ s/\//\\/g; # replace / with \
					chop($line); # remove \n
					
					# do we need to skip this file? According to our own @exclusions array
					foreach $exclusion (@exclusions)
					{
						if ($line =~ /$exclusion/)
						{
							print "\n         !$line (excluded, \@exclusions)";
							next A;
						}
					}
					
					# do we need to skip this file? According to MACROs in .MMPs
					foreach $DisableDefine (@DisableDefines)
					{
						if ($DisableDefine eq $section && $section ne '')
						{
							print "\n         !$line (excluded, MACRO $DisableDefine)";
							next A;
						}
					}
										
					$secnum++;
					#print "\n         $line";
					$output .= "SOURCE $line\n";
				}
			}
		}
		print " -- $secnum objects selected\n";
	}
}

##################################################################################################################

# update an MMP project file with the new objects
sub UpdateProjectFile
{
	my ($mmp,$module,$section) = @_;
	my $n = "AUTO_OBJECTS_".uc($module)."_$section";
	my $a = "\/\/START_$n\/\/";
	my $b = "\/\/STOP_$n\/\/";
	my $name = "mmp/scummvm$mmp.mmp";	
	my $file = "$buildDir/$name";
	my $updated = " Updated @ ".localtime();

	print "     ===>Updating backends/epoc/$name @ $n ... ";

	open FILE, "$file";
	my @lines = <FILE>;
	close FILE;
	
	my $onestr = join("", at lines);
	$onestr =~ s/$a.*$b/$a$updated\n$output$b/s;
	
	open FILE, ">$file";
	print FILE $onestr;
	close FILE;
	
	print "done.\n";
	
	$output = "";
}

##################################################################################################################

sub UpdateSlaveMacros
{
	my $updated = " Updated @ ".localtime();

	my $name = "mmp/scummvm_base.mmp";	
	my $file = "$buildDir/$name";
	print "Reading master MACROS from backends/epoc/$name ... ";

	open FILE, "$file";
	my @lines = <FILE>;
	close FILE;
	my $onestr = join("", at lines);

	my $n = "AUTO_MACROS_MASTER";
	my $a = "\/\/START_$n\/\/";
	my $b = "\/\/STOP_$n\/\/";
	$onestr =~ /$a(.*)$b/s;
	my $macros = $1;
	
	my $libs_first = "\n// automagically enabled static libs from macros above\n";
	my $libs_second = "STATICLIBRARY	scummvm_base.lib // must be above USE_* .libs\n";
	my $macro_counter = 0;
	my $macros2 = "\n"; # output for in *.mmp MACROS section
	my $projects = "\n..\\mmp\\scummvm_base.mmp\n"; # output for in BLD.INF projects section

	foreach $line (split("\n", $macros))
	{
		# do we need to add a static .lib?
		if ($line =~ /^.*MACRO\s*([0-9A-Z_]*)\s*\/\/\s*LIB\:(.*)$/)
		{
			my $macro = $1; my $lib = $2;
			
			# this macro enabled? then also add the .lib
			if ($line =~ /^\s*MACRO\s*$macro/m)
			{
				# these are the USE_ libs
				$libs_second .= "STATICLIBRARY	$lib\n" if ($macro =~ /^USE_/);
			}
			else
			{
				# these are the non DISABLED_ libs
				$libs_first .= "STATICLIBRARY	$lib\n" if ($macro =~ /^DISABLE_/);
				
				# add projects for BLD.INF's
				my $projectname = substr("$lib",0,-4);
				$projects .= "..\\mmp\\$projectname.mmp\n" if ($macro =~ /^DISABLE_/);				
			}
			$macro_counter++;
		}
		# not commented out? then add the macro to output string
		if ($line =~ /^\s*MACRO\s*([0-9A-Z_]*)\s*/)
		{
			my $macro = $1;
			$macros2 .= "$line\n";
			push @DisableDefines, $macro; # used in CheckForModuleMK()!!
		}
	}		

	print "$macro_counter macro lines.\n";

	$n = "AUTO_MACROS_SLAVE";
	$a = "\/\/START_$n\/\/";
	$b = "\/\/STOP_$n\/\/";

	$m = "AUTO_PROJECTS";
	$p = "\/\/START_$m\/\/";
	$q = "\/\/STOP_$m\/\/";
	
	foreach $name (@mmp_files)
	{
		$file = "$buildDir/$name";
		$fileBLDINF = $buildDir .'/'. substr($name, 0, rindex($name, "/")) . "/BLD.INF";
		print "Updating macros in backends/epoc/$name ... ";
	
		open FILE, "$file";	@lines = <FILE>; close FILE;
		$onestr = join("", at lines);
	
		my $extralibs = ""; # output
		# slash in name means it's a phone specific build file: add LIBs
		$extralibs .= "$libs_first$libs_second" if (-e $fileBLDINF);
		
		$onestr =~ s/$a.*$b/$a$updated$macros2$extralibs$b/s;
		
		open FILE, ">$file"; print FILE $onestr; close FILE;

		my $count = @lines;
		print "wrote $count lines.\n";

		if (-e $fileBLDINF)
		{
			# slash in name means it's a phone specific build file:
			# this also means we need to update a BLD.INF file here!
			print "Updating projects in $fileBLDINF ... \n";

			open FILE, "$fileBLDINF";	@lines = <FILE>; close FILE;
			$onestr = join("", at lines);
		
			$onestr =~ s/$p.*$q/$p$updated$projects$q/s;
			
			open FILE, ">$fileBLDINF"; print FILE $onestr; close FILE;
		}
	}
}		

##################################################################################################################

Index: README
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/epoc/README,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- README	18 Oct 2005 01:30:10 -0000	1.3
+++ README	3 Dec 2005 21:29:10 -0000	1.4
@@ -1,5 +1,5 @@
 
- EScummVM - ScummVM ported to EPOC/SymbianOS
+ ScummVM - ScummVM ported to EPOC/SymbianOS
  
  Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson
  Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson
@@ -9,7 +9,7 @@
  $Id$ 
  
  
-About EScummVM
+About ScummVM
 --------------
 	The original ports (uptil 0.7.1) were made by Andreas Karlsson and Lars Persson.
 	The main transition to 0.8.0CVS and all relevant changes were done by Jurgen Braam.
@@ -18,7 +18,7 @@
 
 Nescessary components
 ---------------------
-	Building EScummVM yourself using the UIQ 2.1/Nokia S60 SDK/Nokia S80 SDK/Nokia S90 SDK framework is not an easy task!
+	Building ScummVM yourself using the UIQ 2.1/Nokia S60 SDK/Nokia S80 SDK/Nokia S90 SDK framework is not an easy task!
 	Lets just say the framework needs quite some time to set up and takes a while 
 	to get used to. If you choose to continue you will need the following items: 
 
@@ -58,7 +58,7 @@
 	  http://libmpeg2.sourceforge.net/
 
 
-Building EScummVM
+Building ScummVM
 -----------------
 	ECompXL: this is a tool that will compress your executable with GZIP and glue
 	it to a predefined loader app. The app will uncompress your application at
@@ -92,18 +92,23 @@
 	> bldmake bldfiles
 	> abld build
 
-	EScummVM: make sure the SYSTEMINCLUDE dirs in EScumVM.mmp are correct. For the 
+	ScummVM: make sure the SYSTEMINCLUDE dirs in ScumVM.mmp are correct. For the 
 	'wins' platform also check the LIBRARY entries for the correct path to your MSVC 
 	installation. Please note that you can only specify relative paths here, so every-
 	thing needs to be on the same physical drive! Another weird demand of the UIQ
-	platform...	In <DevRoot>/scummvm/backends/epoc/build/ go:
-	> bldmake bldfiles
-	> abld build
-	> makesis EScummVM_xxx.pkg
+	platform...	In <DevRoot>/scummvm/backends/epoc/ go:
+
+	> run 'unzip mmp\initial_mmps.zip'
+	> edit the scummvm_base.mmp to fit your needs (for supported target games and features, check the MACRO statements)
+	> run 'perl AdaptAllMMPs.pl' from the commandline, this will update all mmp and bld.inf files
+	> change to the directory for your designated target (uiq2 for UIQ 2.X, S60 for S60 v1 & V2 etc)
+	> 'bldmake bldfiles' to update and create the symbian build structure
+	> 'abld build armi urel' to build the target binaries
+	> makesis -d\sdkpath ScummVM_xxx.pkg to build the sis file for your target.
 	
-	Now you should have yourself a nice EScummVM_xxx.sis installer package for use 
+	Now you should have yourself a nice ScummVM_xxx.sis installer package for use 
 	on your phone. Please note that for development it will be a lot faster if you
-	transfer the ESCUMMVM.APP file directly to your !:\system\apps\EScummVM\ dir!
+	transfer the SCUMMVM.APP/Scummvm.EXE file directly to your !:\system\apps\ScummVM\ dir!
 
 	Platforms can be one of: ARMi, ARM4, THUMB, WINS. The SE P900 uses the ARMi platform,
 	which is a combined ARM4/THUMB programming mode. Configurations can be one of: 
@@ -116,7 +121,7 @@
 	- Sprawl for having the nerve to start & carry this puppy for so long
 	- AnotherGuest for having the nerve to start & carry this puppy for so long
 	- Fingolfin for taking the time to go through 1000 patch versions with me
-	- Myself (SumthinWicked), for writing this entire README :)
+	- Myself (SumthinWicked), for writing this entire README and adopting all sources together with Fingolfin :)
 	- the entire ScummVM Dev team for making a kicka$$ program
 	- the folks in #scummvm @ irc.freenode.net for their help, confort and support
 	- everybody else who wants to give me 'the look' for not including them here :P





More information about the Scummvm-git-logs mailing list