syborg_stem/buildrom.pm
author William Roberts <williamr@symbian.org>
Fri, 08 Oct 2010 17:25:30 +0100
changeset 3 df09f0d786ec
parent 1 aa7fc13e36fb
child 7 58366ddcbc93
permissions -rw-r--r--
More buildrom.pm tweaks - fix the stupid "REM handled x" on every input line - Create extra copies of the tmp files, so that iMaker can't clean them all away - Add "REM expanded" to the original processing of ECOM_PLUGIN lines, to help recover the originals again
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# All rights reserved.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description: 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# This package is to build rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
package buildrom;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
require Exporter;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
@ISA=qw(Exporter);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
@EXPORT=qw(
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	image_content_processing_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
	process_cmdline_arguments
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	preprocessing_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	substitution_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
	reorganize_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	plugin_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	multlinguify_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	spi_creation_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
	suppress_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	bitmap_aif_converison_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
	cleaning_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
	create_dumpfile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	create_dirlisting
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
	suppress_image_generation
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	invoke_rombuild
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
	getOBYDataRef
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	isobystatement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	isdatastatement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	isspidatastatement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
	isexecutablefile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
	isdirectorymetadata
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
	isbitmap
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
	isaif
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
	isresource
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
	hardwarevariant
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
	executableextension
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
	executabletype
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	getSourceFile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
	getDestFile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
	getOBYAttributes
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
	getHardwareVariant
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
	getObyCommand
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
	process_dlldata
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
	featurefile_creation_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	processData
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	create_smrimage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
my $enforceFeatureManager = 0; # Flag to make Feature Manager mandatory if SYMBIAN_FEATURE_MANAGER macro is defined. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
my $BuildromMajorVersion = 3 ;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
my $BuildromMinorVersion = 17;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
my $BuildromPatchVersion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
sub print_usage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
	# Option "-fm" will be supported instead of option "-f|fr" if SYMBIAN_FEATURE_MANAGER macro is defined.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	my $featuresOptionUsage = "-ffeatureuids or -fr=featureuids -- feature registry database XML file name";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	if ($enforceFeatureManager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
		$featuresOptionUsage = "-fm=featuredatabasefile          -- feature manager/feature registry database XML file name.\n".
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
							   "\t\t\t\t    Multiple XML files can be passed seperated by commas.\n".
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
							   "   -nofm=featuresdatafile           -- don't generate features data file.".
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
							   " Instead use pre-built features data file.";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
#........1.........2.........3.........4.........5.........6.........7.....
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
	print <<USAGE_EOF;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
BUILDROM - ROM configuration tool V$BuildromMajorVersion.$BuildromMinorVersion.$BuildromPatchVersion
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
Usage:
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
  buildrom [options] obyfile [obyfile2 ...]   
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
Build a ROM according to the specification defined by concatenating the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
specified obyfiles.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
The initial specification is modified by C++ preprocessor directives,
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
and subsequently adjusted by statements in the ROM specification language.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
The final specification is in the subset of the specification language
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
which is understood directly by ROMBUILD.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
Each obyfile parameter specifies a file via a search path: if the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
filename is not matched then buildrom will look in \\epoc32\\rom\\include.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
Buildrom invokes ROMBUILD to generate the ROM image, and produces a
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
number of related files such as the ROM symbol file. The name of the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
image file is specified directly by the -o option, or determined by 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
scanning the final specification for the "romname" keyword. If there is 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
more than one "romname" statement, the last one takes precedence.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
The available options are
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
   -Dxxx                            -- C++ preprocessor arguments
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
   -oimagename                      -- ROM image name, overriding any ROMNAME statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
   -s                               -- strict option, any missing files will stop buildrom 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
   -p                               -- preserves the intermediate files pertaining to data drive, Z drive and BMCONV
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
   -spi                             -- enable producing SPI files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
   -spiplacement                    -- enable positioning of spi file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
   -w                               -- warn if file has been selected from a different directory 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
   $featuresOptionUsage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
   -etool                           -- external tool specification (xx is tool's perl module)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
   -compress                        -- compression type of ROM image:
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
                                       -compress compress whole ROM image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
                                       -compress=paged compress paged section in the ROM image only.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
                                       -compress=unpaged compress unpaged section in the ROM image only. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
   -ccomprmethod                    -- compression method: none|inflate|bytepair
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
   -geninc                          -- generate INC file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
   -gendep                          -- generate dependence graph for rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
   -nosymbols                       -- disable creation of symbol file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
   -noimage                         -- disable creation of ROM/ROFS/DataDrive Image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
   -fastcompress                    -- compress files with faster bytepair and tradeoff of compress ratio
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
   -j<digit>                        -- do the main job with <digit> threads
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
   -loglevel<level>                 -- Level of information logging where loglevel is 0,1,2
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
                                       0 default level of information
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
                                       1 host/ROM filenames, file size and the hidden attribute along with level0 log
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
                                       2 E32 file header attributes along with level1 log
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
   -z=xxx or -zdrivepath=xxx        -- specify a location to create Z drive directory. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
   -d=xxx or -datadrivepath=xxx     -- specify a location to create data drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
   -k or -keepgoing                 -- enable keepgoing,continue to create the data drive image even
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
                                    if the non-sis, sis or zdrive image file(s) are missing or corrupt.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
   -r or -retainfolder              -- enable retainfolder,would retain pre-existence of z & data drive folder. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
   -zdriveimage=xxx                 -- specify Z drive image (ROM, CORE, ROFS or Ext-ROFS image).
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
   -pfile=xxx                       -- specify a parameter file for interpretsis to take additional parameters.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
   -argforinterpretsis=xxx          -- specify command line argument(s) for interpretsis which will override the 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
                                    parameter file contents.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   140
   -l=xxx or -logimagecontents=xxx  -- extract all stub-sis and SWI certificate store file(s) only 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   141
                                    and log all the file(s) that are part of the Z drive image on to a log file.  
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
   -I<directory>                    -- Use <directory> for the referenced IBY/OBY files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
   -argfile=xxx                     -- specify argument-file name containing list of command-line arguments to buildrom   
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
   -lowmem                          -- use memory-mapped file for image build to reduce physical memory consumption   
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
Popular -D defines to use include
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
   -D_DEBUG         -- select debug versions of some files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
   -D_FULL_DEBUG    -- select debug versions of all files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
   -D_ARM4          -- specify the target platform
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
   -D_EABI=xxxx     -- specify target for all files (e.g. ARMV5)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
   -D_KABI=xxxx     -- specify the target platform for the Kernel (e.g. ARMV5)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
Other defines may be useful for particular OBY files.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
USAGE_EOF
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
use strict;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
my $PerlLibPath;    # fully qualified pathname of the directory containing our Perl modules
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
# establish the path to the Perl libraries
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
$PerlLibPath .= "\\";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
sub ExportDirs ($);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
use BPABIutl; # for BPABIutl::BPABIutl_Plat_List
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
my $xmlrequired = 0; # assume xml required is false. Used to determine if xml
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
                     # modules should be loaded.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
use Modload;	     # To load modules dynamically
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
# Work out the relative path to the epoc32 directory
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
use spitool qw(&createSpi);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
use Cwd;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   178
use Pathutl;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
use E32Variant;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   180
use E32Plat;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   181
use Genutl;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
use BPABIutl;		# for BPABIutl::BPABIutl_Plat_List
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
use externaltools; 	#To invoke External Tools
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   184
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   185
my @tempfiles;  	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   186
my $preserve = 0; 	#flag to indicate if temporary files should be preserved
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   187
my $uppath="x";	    	# will be initialised when first needed
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   188
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   189
my $epocroot = $ENV{EPOCROOT};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   190
die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   191
$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   192
die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   193
die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   194
die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   195
die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   196
die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   197
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   198
my $epoc32 = relative_path("${epocroot}epoc32");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
$epoc32 =~ s-\\-/-go;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
my @obyfiles;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
my $cppargs = "-nostdinc -undef";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
my $opt_v = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
my $opt_o = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
my $strict = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   206
my $warnSelection = 0; # default is not warn about selecting files from 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
		       # different directories when the file is missing from
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
		       # the specified directory
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
my $createspi = 0; # don't create SPI files by default
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
my $spiset=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
my $spiplacement = 0; # enable the placement of spi file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
my %spipositionflag = (); # map of Image index at which the keyword SPI_POSITION is used.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
use constant NONE => 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
use constant INFLATE => 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
use constant BYTEPAIR => 2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
my $opt_compression;  # Default compression method parameter undefined
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
use constant UNCOMPRESSED   => 0;        # Indicates the ROM image will not be compressed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   221
use constant ALLSECTIONS    => 1;        # Indicates both paged section and unpaged section will be compressed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
use constant PAGEDSECTION   => 2;        # Indicates only paged section will be compressed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
use constant UNPAGEDSECTION => 3;        # Indicates only unpaged section will be compressed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
my $opt_compression_type = UNCOMPRESSED; # Leave the ROM image uncompressed by default.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   226
my $thisdir=cwd;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   227
$thisdir=~s-/-\\-go;		    # separator from Perl 5.005_02+ is forward slash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   228
$thisdir=~s-^(.*[^\\])$-$1\\-o;	    # ensure path ends with a backslash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   229
$thisdir=~s-^.:\\--o;		    # remove drive letter and leading backslash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   230
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
my $rominclude = "$epoc32/rom/include";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
my %plugintypes; #hash of plugin types and their SPI files' destinations in ROM
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   233
$plugintypes{"ECOM"} = "\\private\\10009d8f\\"; #ECOM SPI files' destination in ROM image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   234
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   235
my @obydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   236
my @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   237
my %substitutionData;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   238
my @substitutionOrder;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   239
my %languageCodes;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   240
my $defaultLanguageCode;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   241
my %multiLinguifyAlias;  # to by-pass the 'mustbesysbin' option for multilinguify 'alias'es. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   242
my $abiDowngrade;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   243
my @binarySelectionOrder;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   244
my $fromDIR;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
my %rombuildOptions = ("-type-safe-link" => 1 );
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
my $enforceSysBin = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
my $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
my $errors = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
my @romimage;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
my $rombasename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   253
my $sourcefile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   254
my $sourceline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   255
my ($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   256
my %romfiles;
1
aa7fc13e36fb Add iby file information to ROM directory listing, and update original/syborg.dir
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
   257
my %ibyfiles; # record the iby file for each ROM file
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   258
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   259
# To handle BINARY_SELECTION_ORDER macro.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   260
my $firstDIR;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   261
my $binarySelectionOrderFlag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   262
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   263
my %DllDataMap = ();	#Map to keep track of DLL Data patch statements.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   264
my $patchDataStmtFlag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   265
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   266
my $featuremanager = 0; #Flag to enable support for feature manager database XML file and to generate  
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   267
			# features data file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   268
my $noFeatureManager = 0; # Flag to stop the generation of features.dat file and use pre-built features.dat if provided.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   269
my $preBuiltFeaturesDataFile  = ''; # To store the name of pre-built features.dat file provided with "-nofm" option.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   270
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   271
#Image Content XML file that supports specific feature to be added
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   272
my $image_content = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   273
#Feature list XML file that acts as database containing all features details
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   274
my $featureXml = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   275
my $geninc = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   276
my $gendep = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   277
my $nosymbols = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   278
my $noimage = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   279
my $customizedPlat = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   280
my $opt_fastcompress = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   281
my $opt_jobs= "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   282
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   283
#Summary of files(both executables and data files) currently includes 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   284
#	host and ROM file names, 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   285
#	size of the file in ROM
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   286
#	whether the file is hidden
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   287
# This option is added so that the above additional information is emitted by rombuild/rofsbuild tools
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   288
# only when supplied with this option so that the existing tools don't get affected.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   289
my $logLevel="";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   290
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   291
# This option is used to pass -lowmem argument to rombuild/rofsbuild tools
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   292
my $lowMem="";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   293
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   294
# Feature Variation modules and data
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   295
use featurevariantparser;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   296
use featurevariantmap;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   297
my %featureVariant;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   298
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   299
# global variables specific to data drive image generation. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   300
use File::Path;					# Module to provide functions to remove or create directories in a convenient way.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   301
use File::Copy;					# Module to provide functions to copy file(s) from source to destination.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   302
use File::Find;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   303
use datadriveimage;				# module which provides all necessary functions to create data drive image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   304
my $ZDirloc = "";				# location of Z drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   305
my $DataDriveDirloc = "";		# location of data drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   306
my @sisfilelist;				# an array to hold sis file(s).
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   307
my @zDriveImageList;			# an array to hold z drive image name.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   308
my @datadiveobydata;			# an array to hold data drive oby data.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   309
my @datadriveimage;				# array which holds data drive image attribute.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   310
my $rootdir = "";				# which holds root directory information.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   311
my @datadrivedata;				# array to maintain list of lines taken from processed data drive oby file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   312
my @nonsisFilelist;				# array to maintain list of nonsis file(s). 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   313
my @sisobydata;					# array to maintain all list of files(s) got by installing sis files. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   314
my @renameList;					# array to maintain list of file(s) that has to be renamed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   315
my @aliaslist;					# array to maintain list of file(s) that has to be made alias.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   316
my @hideList;					# array to maintain list of file(s) that has to be made hidden.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   317
my $sisfilepresent = 0;			# enable if sis file(s) are present.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   318
my $stubsisfilepresent = 0;		# enable if stub-sis file(s) are present.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   319
my $opt_k = 0;					# enable if keepgoing option is specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   320
my $opt_r = 0;					# enable if retain pre-existence of folder is specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   321
my $dataImageCount = 0;			# no of data drive image that has to generated.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   322
my @zdriveImageName;			# list of Z drive image name(s) specified using zdriveimagename in oby/iby file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   323
my $opt_zimage = 0;				# enable if z drive image is found.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   324
my $zDrivePresent = 0;			# flag to check whether Z drive needs to be created.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   325
my @dataDriveFileList;			# list of processed data drive related files.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   326
my $paraFile = undef;			# parameter file for interpretsis.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   327
my @romImages;					# list of generated z drive image(s)(rom/rofs). 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   328
my $imageEntryLogFile = undef;	# a log file to log all the z drive image contents.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   329
my $opt_logFile = 0;			# enable if z drive entries has to be logged on to a log file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   330
my %dataIndexHash = ();			# a hash which holds key-value pair between datadrive index and datadrive image count.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   331
my $interpretsisOpt = undef;	# enable if command line arguments are specified by the user to INTERPRETSIS.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   332
my @interpretsisOptList;		# an array which holds all the list of option(s) that needs to passed to INTERPRETSIS. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   333
my @Global_BPABIPlats;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   334
my @Global_PlatList;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   335
my @smrImageFileList;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   336
my $needSmrImage = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   337
my %smrPartitions;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   338
my %smrNameInfo;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   339
my @obeyFileList;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   340
my $smrNoImageName = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   341
my $onlysmrimage = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   342
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   343
sub match_obyfile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   344
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   345
	my ($obyfile) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   346
	if (-f $obyfile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   347
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   348
		push @obyfiles, $obyfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   349
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   350
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   351
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   352
	# search for the oby file in the list of include directories
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   353
	my @otherDirs = ($rominclude);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   354
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   355
	if ($featureVariant{'VALID'})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   356
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   357
		my $dirRef = $featureVariant{'ROM_INCLUDES'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   358
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   359
		@otherDirs = @$dirRef if ($dirRef);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   360
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   361
	foreach my $dir (@otherDirs)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   362
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   363
		if (-f "$dir/$obyfile")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   364
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   365
		    push @obyfiles, "$dir/$obyfile";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   366
		    return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   367
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   368
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   369
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   370
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   371
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   372
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   373
# This function invokes ROFSBUILD tool with appropriate parameters to generate data drive image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   374
# It also deletes zdrive and datadrive folder after all the image has been processed and generated
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   375
# if and only if preserve(-p) option is disabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   376
sub create_datadriveImage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   377
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   378
	for (my $dataidx=0; $dataidx < $dataImageCount; $dataidx++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   379
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   380
		my $driveIndex = $dataIndexHash{$dataidx};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   381
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   382
		if(defined($driveIndex))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   383
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   384
			my $obeyfile=$datadriveimage[$driveIndex]{obeyfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   385
			my $compress=$datadriveimage[$driveIndex]{compress};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   386
			my $uncompress=$datadriveimage[$driveIndex]{uncompress};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   387
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   388
			if ($obeyfile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   389
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   390
				if(!defined $opt_compression)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   391
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   392
					if ($compress ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   393
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   394
						$compress=" -compress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   395
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   396
					elsif($uncompress ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   397
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   398
						$compress=" -uncompress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   399
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   400
					elsif($compress eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   401
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   402
						$compress=" ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   403
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   404
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   405
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   406
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   407
					$compress = $opt_compression;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   408
					$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   409
					print "* ".$1." ".$2.": ".$3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   410
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   411
				my $command = "rofsbuild -slog".$compress." -datadrive=$obeyfile.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   412
				print "* Executing $command\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   413
				system($command);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   414
				if ($? != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   415
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   416
					&datadriveimage::reportError("* ROFSBUILD failed to generate data drive image",$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   417
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   418
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   419
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   420
					push(@dataDriveFileList,$obeyfile.".img");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   421
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   422
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   423
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   424
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   425
	# after processing all the data drive image(s) delete zdrive and datadrive directory 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   426
	# if and only if preserve(-p) option is disabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   427
	if($dataImageCount)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   428
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   429
		# delete Z drive directory if and only if preserve(-p) option is disabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   430
		my $retVal = &deleteDirectory($ZDirloc,$opt_v)if(!($preserve));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   431
		if($retVal)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   432
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   433
			&datadriveimage::reportError("* Warning could not delete $ZDirloc",$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   434
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   435
		# delete data drive directory if and only if preserve(-p) option is disabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   436
		my $retVal = &deleteDirectory($DataDriveDirloc,$opt_v)if(!($preserve));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   437
		if($retVal)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   438
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   439
			&datadriveimage::reportError("* Warning could not delete $DataDriveDirloc",$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   440
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   441
		# reset image count to zero.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   442
		$dataImageCount = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   443
		# reset z drive present to zero.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   444
		$zDrivePresent = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   445
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   446
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   447
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   448
sub tidy_exit
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   449
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   450
	#-------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   451
	# Tidy and exit
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   452
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   453
	if (!$preserve)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   454
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   455
	    foreach my $tempfiles (@tempfiles)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   456
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   457
			unlink "$tempfiles";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   458
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   459
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   460
	if($rombasename)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   461
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   462
		system("dir $rombasename.*");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   463
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   464
	if(@dataDriveFileList)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   465
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   466
		print "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   467
		print " ----------------------------------------------------------\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   468
		print "| List of file(s) generated pertaining to data drive image |\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   469
		print " ----------------------------------------------------------\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   470
		my $arraySize = scalar(@dataDriveFileList);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   471
		for( my $i=0; $i < $arraySize; $i++ )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   472
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   473
			# remove the first element from an array and return it 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   474
			my $element = shift(@dataDriveFileList);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   475
			# get the size of the file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   476
			my $size = -s $element;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   477
			print "Size = ".$size." bytes"."\t"."File = ".$element."\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   478
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   479
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   480
	exit(0);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   481
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   482
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   483
# This is the main function which is responsible for processing data drive image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   484
# This function internally calls other functions to create datadrive folder,zdrive folder
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   485
# and external tools such as INTERPRETSIS, READIMAGE and finally ROFSBUILD to generate 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   486
# appropriate data drive image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   487
sub processData		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   488
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   489
	if($dataImageCount)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   490
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   491
		# set the default path for Z drive and Data drive directory,
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   492
		# if and only if, path is not specified by the user. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   493
		$ZDirloc = &datadriveimage::setPath("zdrive") unless ($ZDirloc);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   494
		$DataDriveDirloc = &datadriveimage::setPath("datadrive") unless ($DataDriveDirloc);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   495
		#delete any existing Z drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   496
		my $retVal = &datadriveimage::deleteDirectory($ZDirloc,$opt_v)if(!$opt_r);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   497
		if($retVal)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   498
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   499
			exit(1) if(!$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   500
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   501
		# delete pre-existence of data drive folder, if and only if -r option is not enabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   502
		my $retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   503
		if($retVal)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   504
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   505
			exit(1) if(!$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   506
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   507
		if($opt_logFile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   508
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   509
			# clean any pre-existance of log file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   510
			unlink($ZDirloc."\\".$imageEntryLogFile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   511
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   512
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   513
		for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   514
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   515
			my $driveIndex = $dataIndexHash{$datadriveidx};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   516
			# get the data drive name.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   517
			if( defined( $driveIndex ) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   518
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   519
				my $datadrivename=$datadriveimage[$driveIndex]{obeyfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   520
				# get the size of the data drive.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   521
				my $size = $datadriveimage[$driveIndex]{size};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   522
				if( $datadrivename )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   523
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   524
					# set data drive oby file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   525
					my $datadriveobyfile = $datadrivename.".oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   526
					# final location of prototype data drive.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   527
					my $proDataDriveDirloc;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   528
					# Location of stub-sis file(s) inside Z Drive folder.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   529
					my $zDriveSisFileLoc;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   530
					# check if more than one data drive image needs to be generated. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   531
					if( $dataImageCount > 1 )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   532
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   533
						# if yes, then set the location of prototype data drive folder as 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   534
						# DataDriveDirloc + datadrivename
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   535
						$proDataDriveDirloc = $DataDriveDirloc."\\".$datadrivename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   536
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   537
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   538
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   539
						# else, then set the location of prototype data drive folder as DataDriveDirloc 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   540
						$proDataDriveDirloc = $DataDriveDirloc;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   541
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   542
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   543
					# create prototype data drive folder.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   544
					print "creating data drive folder\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   545
					&datadriveimage::createDirectory($proDataDriveDirloc);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   546
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   547
					# check for sis file keyword in ROM description file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   548
					# if found,then locate for stub-sisfile.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   549
					# create Z drive( if and only if stub-sis files are present in ROM description file )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   550
					# and dump all the non-sis files on to the Z drive folder. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   551
					if(&datadriveimage::checkForSisFile($datadriveobyfile,\@sisfilelist,\$sisfilepresent))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   552
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   553
						my $zDriveImagePresent = 0; # flag to check whether z drive image is Present;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   554
						if(&datadriveimage::checkForZDriveImageKeyword($datadriveobyfile,\@zDriveImageList,\$zDriveImagePresent) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   555
						{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   556
							# find out size of the array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   557
							my $arraysize = scalar(@zDriveImageList);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   558
							for( my $i=0; $i < $arraysize; $i++ )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   559
							{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   560
								$zDriveSisFileLoc =  $ZDirloc."\\".$datadrivename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   561
								&datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   562
							}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   563
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   564
						else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   565
						{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   566
							$zDriveSisFileLoc = $ZDirloc;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   567
							# locate and copy stub-sis file(s),for the first time.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   568
							if( !$zDrivePresent )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   569
							{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   570
								# check for image file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   571
								if( $opt_zimage )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   572
								{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   573
									# image(s)supplied to BUILDROM(like rom,rofs,extrofs or core) using "-zdriveimage" option, 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   574
									# are maintained in a seperate array and the element from the array is fetched one by one and is 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   575
									# fed to READIMAGE as an input.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   576
									foreach my $element (@zdriveImageName)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   577
									{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   578
										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   579
										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   580
									}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   581
								}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   582
								else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   583
								{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   584
									# if zdrive image(s) such as (rom,core,rofs or extrofs) are generated ealier to the data drive image processing
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   585
									# then these images are maintained in an array and the element from the array is fetched one by one and is 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   586
									# fed to READIMAGE as an input.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   587
									foreach my $element (@romImages)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   588
									{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   589
										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   590
										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   591
									}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   592
								}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   593
							}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   594
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   595
						# invoke INTERPRETSIS tool with z drive folder location.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   596
						&datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList)if($sisfilepresent);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   597
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   598
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   599
					# create an oby file by traversing through upated prototype data drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   600
					&datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist,
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   601
										\@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v );
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   602
					#reset sisfilepresent flag to zero;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   603
					$sisfilepresent =0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   604
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   605
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   606
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   607
		create_datadriveImage();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   608
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   609
	tidy_exit;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   610
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   611
#Parse and process image content xml file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   612
#Gets the oby files listed in the xml file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   613
# Pushes all the oby files found to an array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   614
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   615
sub image_content_processing_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   616
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   617
	if(!defined ($image_content))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   618
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   619
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   620
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   621
	&ImageContentHandler::ParseImageContentXML($image_content);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   622
	&ImageContentHandler::ProcessImageContent;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   623
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   624
	if(defined ($image_content) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   625
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   626
#		Collect the oby files if any in the Image content file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   627
		my $files = &ImageContentHandler::GetObyFiles;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   628
		foreach my $obeyfile (@$files)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   629
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   630
			next if match_obyfile($obeyfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   631
			next if (match_obyfile("$obeyfile.oby"));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   632
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   633
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   634
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   635
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   636
# Subroutine to process parameter-file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   637
sub parameterFileProcessor
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   638
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   639
	my $paramFile = shift(@_);	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   640
	my @paramFileParamaters = ();	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   641
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   642
	my $fileOpenFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   643
	open FILE,"<", $paramFile or $fileOpenFlag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   644
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   645
	if(!$fileOpenFlag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   646
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   647
		print "Error: Could not open parameter-file \"$paramFile\" for reading.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   648
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   649
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   650
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   651
	# Parse parameter-file and collect all the parameters in an array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   652
	while(my $line = <FILE>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   653
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   654
		# Read the line till character ';'(used for providing comments in the file) or EOL
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   655
		$line = $1 if ($line =~ /(.*);/); 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   656
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   657
		# Split the parameters specified in a line based on white-spaces		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   658
		my @paramaters = split(/(\s)/,$line);	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   659
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   660
		my $flag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   661
		my $argWithQuotes='';
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   662
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   663
		foreach my $value (@paramaters) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   664
		{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   665
			# If the parameter doesn't conatian double quotes then push it 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   666
			# to the list of parameters.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   667
			if(($value !~ /\"/) && (!$argWithQuotes)) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   668
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   669
				if ($value !~ /^\s*$/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   670
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   671
					push @paramFileParamaters,$value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   672
				}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   673
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   674
			# If the parameter is in the form  -fm="faturedb.xml" then remove
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   675
			# double quotes and push it to the list of parameters.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   676
			elsif(($value =~ /\".*\"/))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   677
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   678
				$value =~ s/\"//g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   679
				push @paramFileParamaters,$value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   680
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   681
			# If the parameter is in the form  -fm="fature  db.xml" then read
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   682
			# the parameter starting from opening quote till the closing quote.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   683
			elsif( ($value =~ /\"/) && $argWithQuotes) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   684
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   685
				$argWithQuotes .= $value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   686
				$argWithQuotes =~ s/\"//g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   687
				push @paramFileParamaters,$argWithQuotes;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   688
				$argWithQuotes='';		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   689
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   690
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   691
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   692
				$argWithQuotes .= $value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   693
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   694
		}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   695
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   696
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   697
	close FILE;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   698
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   699
	if (!@paramFileParamaters)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   700
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   701
		print "Warning: No parameters specified in paramer-file \"$paramFile\".\n";		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   702
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   703
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   704
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   705
	my $paramFileFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   706
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   707
	# Invoke subroutine "process_cmdline_arguments" to process the parameters read from
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   708
	# the parameter file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   709
	&process_cmdline_arguments($paramFileFlag, @paramFileParamaters);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   710
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   711
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   712
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   713
# Processes the command line arguments passed to buildrom tool
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   714
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   715
sub process_cmdline_arguments
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   716
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   717
   	my %tmpBldRomOpts;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   718
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   719
	my ($paramFileFlag, @argList); 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   720
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   721
	if (defined @_)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   722
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   723
		($paramFileFlag, @argList) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   724
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   725
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   726
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   727
		@argList = @ARGV;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   728
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   729
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   730
	if (!defined $paramFileFlag) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   731
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   732
		# Enforce Feature Manager if macro SYMBIAN_FEATURE_MANAGER is defined in the HRH file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   733
		my @hrhMacros = &Variant_GetMacroList;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   734
		if (grep /^SYMBIAN_FEATURE_MANAGER\s*$/, @hrhMacros)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   735
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   736
			$enforceFeatureManager = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   737
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   738
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   739
		# Process the parameters of parameter-file if passed.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   740
		foreach my $arg (@argList)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   741
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   742
			if ($arg =~ /^-argfile=(.*)/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   743
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   744
				&parameterFileProcessor($1);				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   745
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   746
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   747
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   748
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   749
	foreach my $arg (@argList)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   750
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   751
	    if ($arg =~ /^-argfile=(.*)/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   752
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   753
			&parameterFileProcessor($1) if (defined $paramFileFlag);						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   754
			next;			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   755
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   756
		if ($arg =~ /^-[DI]/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   757
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   758
		$cppargs .= " $arg";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   759
		#Set 'udeb' for debug option 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   760
		if($arg =~ /^-D_FULL_DEBUG/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   761
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   762
		    $tmpBldRomOpts{"BUILD_DIR"} = "udeb";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   763
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   764
		#Set specific platform supplied from the command option 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   765
		elsif($arg =~ /^-D_PLAT=(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   766
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   767
		    $tmpBldRomOpts{"ABI_DIR"} = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   768
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   769
		# Check for a Feature Variant
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   770
		elsif ($arg =~ /^-DFEATUREVARIANT=(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   771
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   772
			my $varname = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   773
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   774
			if ($varname =~ /^\.(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   775
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   776
				# for testing, locate the VAR file in the current directory
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   777
				%featureVariant = featurevariantparser->GetVariant($1, ".");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   778
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   779
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   780
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   781
				%featureVariant = featurevariantparser->GetVariant($varname);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   782
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   783
			if (!$featureVariant{'VALID'})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   784
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   785
			    print "FEATUREVARIANT $varname is not VALID\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   786
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   787
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   788
			if ($featureVariant{'VIRTUAL'})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   789
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   790
			    print "FEATUREVARIANT $varname is VIRTUAL\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   791
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   792
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   793
			addDrivesToFeatureVariantPaths();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   794
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   795
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   796
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   797
	    if ($arg =~ /^-o(.*)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   798
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   799
		$opt_o = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   800
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   801
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   802
	    if ($arg =~ /^-fastcompress$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   803
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   804
		    $opt_fastcompress = "-fastcompress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   805
		    next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   806
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   807
	    if ($arg =~ /^-j(\d+)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   808
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   809
		    $opt_jobs = "-j".$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   810
		    next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   811
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   812
	    if ($arg =~ /^-v$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   813
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   814
		$opt_v =1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   815
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   816
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   817
	    if ($arg =~ /^-s$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   818
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   819
		$strict = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   820
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   821
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   822
	    if ($arg =~ /^-w$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   823
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   824
		$warnSelection = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   825
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   826
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   827
	    if ($arg =~ /^-p$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   828
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   829
		$preserve = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   830
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   831
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   832
	    if ($arg =~ /^-nospi$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   833
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   834
		$createspi=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   835
		$spiset=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   836
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   837
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   838
	    if ($arg =~ /^-spi$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   839
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   840
		$createspi=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   841
		$spiset=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   842
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   843
	    }	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   844
	    #Process External Tool
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   845
	    if ($arg =~/^-e(.*)/)#Match to get the tool perl module files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   846
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   847
		&externaltools::loadTools($1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   848
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   849
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   850
   		#Process imagecontent file 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   851
	    if( $arg =~ /^-i(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   852
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   853
# Disabling -i option
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   854
		print "Warning: Ignoring invalid Option $arg \n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   855
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   856
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   857
		#Process feature manager database xml file 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   858
	    if($arg =~ /^-fm=(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   859
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   860
			if (!$enforceFeatureManager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   861
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   862
				print "Unknown arg: $arg\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   863
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   864
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   865
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   866
			$featureXml = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   867
			$xmlrequired = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   868
			$featuremanager = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   869
			if ($featureXml =~ /^$/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   870
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   871
				print "Error: No filename specified with \"-fm=\" option.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   872
			}			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   873
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   874
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   875
	    #Process ROM image compression type if it's specified through command line option.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   876
	    if($arg =~ /^-compress(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   877
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   878
	    	if($1 eq '')
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   879
	    	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   880
	    		$opt_compression_type = ALLSECTIONS;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   881
	    		print "Whole ROM image will be compressed.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   882
	    	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   883
	    	elsif($1 eq '=paged')
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   884
	    	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   885
	    		$opt_compression_type = PAGEDSECTION;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   886
	    		print "Paged section of the ROM image will be compressed.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   887
	    	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   888
	    	elsif($1 eq '=unpaged')
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   889
	    	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   890
	    		$opt_compression_type = UNPAGEDSECTION;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   891
	    		print "Unpaged section of the ROM image will be compressed.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   892
	    	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   893
	    	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   894
	    	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   895
	    		print "Unknown compression type: $1\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   896
	    		$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   897
	    	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   898
	    	next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   899
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   900
		if ($arg =~ /^-nofm(=(.*))?$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   901
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   902
			if (!$enforceFeatureManager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   903
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   904
				print "Unknown arg: $arg\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   905
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   906
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   907
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   908
   			$noFeatureManager = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   909
            #DEF125375 If caller is simply giving -nofm without any parameter, a warning message will be given.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   910
            if(!$2)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   911
            {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   912
                print "Warning: No filename specified with \"-nofm=\" option, feature data file might not be included.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   913
            }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   914
            else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   915
            {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   916
                $preBuiltFeaturesDataFile = $2;						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   917
            }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   918
			next;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   919
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   920
		#Process feature registry database xml file 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   921
	    if($arg =~ /^-fr=(.*)/ || $arg =~ /^-f(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   922
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   923
			if ($enforceFeatureManager)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   924
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   925
				print "Error: Option \"-f|-fr\" is no longer supported.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   926
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   927
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   928
			}			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   929
			$featureXml = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   930
			$xmlrequired = 1;			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   931
			if ($featureXml =~ /^$/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   932
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   933
				print "Error: No filename specified with \"-f|-fr\" option.\n";				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   934
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   935
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   936
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   937
	    if ($arg =~ /^-spiplacement$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   938
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   939
			$spiplacement = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   940
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   941
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   942
		if ($arg =~ /^-noimage$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   943
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   944
			$noimage=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   945
			next;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   946
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   947
		if ($arg =~ /^-nosymbols$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   948
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   949
			$nosymbols=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   950
			next;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   951
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   952
		if ($arg =~ /^-geninc$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   953
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   954
			$geninc=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   955
			next;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   956
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   957
		if($arg =~ /^-gendep$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   958
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   959
			$gendep=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   960
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   961
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   962
        if($arg =~/^-c(.*)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   963
        {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   964
          if($1 eq 'none' )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   965
          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   966
              $opt_compression = " -compressionmethod none";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   967
          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   968
          elsif($1 eq 'inflate' )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   969
          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   970
              $opt_compression = " -compressionmethod inflate";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   971
          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   972
          elsif($1 eq 'bytepair' )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   973
          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   974
              $opt_compression = " -compressionmethod bytepair";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   975
          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   976
          else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   977
          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   978
              print "Unknown compression method: $1\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   979
              $errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   980
          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   981
          next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   982
        }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   983
		if( $arg =~ /^-loglevel\d+$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   984
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   985
			$logLevel= $arg;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   986
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   987
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   988
		# get Z directory location if specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   989
		# if yes, then extract directory location from the given array element. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   990
		if( $arg =~ /^-z=(.*)/  || $arg =~ /^-zdrivepath=(.*)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   991
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   992
			# check for white space in the specified folder path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   993
			# if "yes" then warn the user saying folder will be created under default location.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   994
			# else set the path specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   995
			if(&datadriveimage::checkForWhiteSpace($1,"zdrive"))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   996
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   997
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   998
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
   999
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1000
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1001
				$ZDirloc  = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1002
				if( $ZDirloc !~ m/\\(\Z)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1003
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1004
					$ZDirloc .= "\\"; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1005
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1006
				if( $ZDirloc !~ m/:/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1007
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1008
					print "drive letter not specified\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1009
					$ZDirloc = &datadriveimage::setPath($ZDirloc);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1010
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1011
				print "Z Drive directory location = $ZDirloc\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1012
				#set the location of Z Drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1013
				$ZDirloc .= "zdrive";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1014
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1015
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1016
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1017
		# get data directory location if specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1018
		# if yes, then extract directory location from the given array element. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1019
		if( $arg =~ /^-d=(.*)/ || $arg =~ /^-datadrivepath=(.*)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1020
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1021
			# check for white space in the specified folder path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1022
			# if "yes" then warn the user saying folder will be created under default location.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1023
			# else set the path specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1024
			if(&datadriveimage::checkForWhiteSpace($1,"datadrive"))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1025
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1026
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1027
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1028
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1029
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1030
				$DataDriveDirloc = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1031
				if( $DataDriveDirloc !~ m/\\(\Z)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1032
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1033
					$DataDriveDirloc .= "\\"; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1034
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1035
				if( $DataDriveDirloc !~ m/:/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1036
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1037
					print "drive not specified\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1038
					$DataDriveDirloc = &datadriveimage::setPath($DataDriveDirloc);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1039
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1040
				print "Data Drive directory location = $DataDriveDirloc\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1041
				#set the location of Data Drive directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1042
				$DataDriveDirloc .= "datadrive";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1043
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1044
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1045
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1046
		# get Z dive image if specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1047
		if( $arg =~ /^-zdriveimage=(.*)/i )	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1048
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1049
			my $imageName = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1050
			if( $imageName =~ m/\,/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1051
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1052
				@zdriveImageName = split(/\,/,$imageName);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1053
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1054
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1055
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1056
				push(@zdriveImageName,$imageName);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1057
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1058
			$opt_zimage = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1059
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1060
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1061
		# get command line arguments which needs to be passed to INTERPRETSIS, if specified by the user.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1062
		if( $arg =~ /^-argforinterpretsis=(.*)/i )	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1063
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1064
			my $interpretsisOpt = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1065
			if( $interpretsisOpt =~ m/\,/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1066
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1067
				@interpretsisOptList = split(/\,/,$interpretsisOpt);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1068
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1069
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1070
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1071
				push(@interpretsisOptList,$interpretsisOpt);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1072
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1073
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1074
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1075
		if ( $arg =~ /^-k$/i || $arg =~ /^-keepgoing$/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1076
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1077
			$opt_k = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1078
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1079
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1080
		if ( $arg =~ /^-r$/i || $arg =~ /^-retainfolder$/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1081
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1082
			$opt_r = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1083
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1084
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1085
		if ( $arg =~ /^-pfile=(.*)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1086
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1087
			$paraFile = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1088
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1089
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1090
		if ( $arg =~ /^-l=(.*)/i || $arg =~ /^-logimageentry=(.*)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1091
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1092
			if( $1 =~/\\/ || $1 =~ m/:/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1093
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1094
				print "* Warning: Invalid log file extension try filename.txt\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1095
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1096
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1097
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1098
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1099
				$opt_logFile = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1100
				$imageEntryLogFile = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1101
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1102
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1103
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1104
		if ( $arg =~ /^-lowmem/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1105
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1106
			$lowMem = $arg;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1107
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1108
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1109
	    if ($arg =~ /^-/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1110
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1111
		print "Unknown arg: $arg\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1112
		$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1113
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1114
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1115
	    # It's an OBY file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1116
	    next if (match_obyfile($arg));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1117
	    next if (match_obyfile("$arg.oby"));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1118
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1119
	    print "Cannot find oby file: $arg\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1120
	    $errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1121
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1122
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1123
	if (defined $paramFileFlag) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1124
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1125
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1126
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1127
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1128
	if (@obyfiles<1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1129
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1130
	    print "Missing obyfile argument\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1131
	    $errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1132
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1133
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1134
	if ($errors)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1135
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1136
	    print_usage();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1137
	    exit 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1138
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1139
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1140
	if ($noFeatureManager && $featuremanager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1141
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1142
		print "Warning: Ignoring \"-nofm\" option, as both \"-nofm\" and \"-fm\" options are provided.\n";			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1143
		$noFeatureManager = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1144
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1145
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1146
	# Adding variant specific macros by including a HRH file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1147
	# (only required if no Feature Variant is used)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1148
	if (!$featureVariant{'VALID'})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1149
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1150
	    my $variantMacroHRHFile = Variant_GetMacroHRHFile();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1151
	    if($variantMacroHRHFile){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1152
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1153
	        my $variantFilePath = Path_Split('Path',$variantMacroHRHFile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1154
	        $cppargs .= " -I \"" . &Path_RltToWork($variantFilePath) . "\" -include \"" . &Path_RltToWork($variantMacroHRHFile) . "\""; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1155
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1156
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1157
	# load the required modules if xml is required
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1158
	if ($xmlrequired == 1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1159
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1160
	    my $epocToolsPath = $ENV{EPOCROOT}."epoc32\\tools\\";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1161
	    Load_SetModulePath($epocToolsPath);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1162
	    if (defined ($featureXml))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1163
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1164
			load_featuresutil();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1165
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1166
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1167
	    if ($image_content)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1168
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1169
	    	&Load_ModuleL("ImageContentHandler");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1170
	    	# some variables for ImageContentHandler may have been setup
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1171
	    	my ($key, $value);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1172
	    	&ImageContentHandler::SetBldRomOpts; # Defaults to ARMV5 platform
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1173
	    	while (($key,$value) = each %tmpBldRomOpts)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1174
	    	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1175
			&ImageContentHandler::SetBldRomOpts($key, $value);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1176
	    	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1177
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1178
	    
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1179
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1180
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1181
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1182
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1183
# Preprocessing phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1184
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1185
# Concatentate the specified .oby files and pass them through cpp
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1186
# to get the raw ROM specification in tmp1.oby
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1187
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1188
sub preprocessing_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1189
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1190
	unlink "tmp1.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1191
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1192
#	Macro "ROM_FEATURE_MANAGEMENT" is defined when "-f|fr" or "-fm" is used
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1193
	if (defined ($featureXml))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1194
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1195
		$cppargs .= " -DROM_FEATURE_MANAGEMENT ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1196
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1197
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1198
	# add pre-include file and include directories for feature variants
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1199
	if ($featureVariant{'VALID'})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1200
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1201
		$cppargs .= " -I.";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1202
		my $incRef = $featureVariant{'ROM_INCLUDES'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1203
		if ($incRef)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1204
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1205
			foreach (@$incRef)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1206
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1207
		    	$cppargs .= " -I \"$_\"";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1208
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1209
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1210
		my $HRH = $featureVariant{'VARIANT_HRH'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1211
		if ($HRH)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1212
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1213
		    $cppargs .= " -include \"$HRH\"";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1214
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1215
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1216
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1217
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1218
		# no feature variant so use the standard includes
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1219
		$cppargs .= " -I. -I$rominclude";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1220
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1221
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1222
	print "* cpp -o tmp1.oby $cppargs\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1223
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1224
	$errors = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1225
	open CPP, "| cpp -o tmp1.oby $cppargs" or die "* Can't execute cpp";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1226
	foreach my $arg (@obyfiles)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1227
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1228
		print CPP "\n#line 1 \"$arg\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1229
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1230
		open OBY, $arg or die "* Can't open $arg";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1231
		print "* reading $arg\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1232
		while ($line=<OBY>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1233
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1234
			print CPP $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1235
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1236
		close OBY;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1237
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1238
	close CPP;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1239
	my $cpp_status = $?;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1240
	die "* cpp failed\n" if ($cpp_status != 0 || !-f "tmp1.oby");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1241
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1242
	my $temp1OBYFile = "tmp1.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1243
	if( defined ($image_content))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1244
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1245
		#Read the OBY file that was generated by the pre-processor
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1246
		&ReadPreprocessedFile($temp1OBYFile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1247
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1248
#		Check if the static dependencies of the OBY binaries are resolved.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1249
		&ImageContentHandler::UpdateObyBinaryStaticDep();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1250
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1251
		#Now append the files collected from cdfs.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1252
		&ImageContentHandler::GenObyFile($temp1OBYFile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1253
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1254
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1255
	# Setup default rom configuration
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1256
	$romimage[0] = {xip=>1, compress=>0, extension=>0, composite=>"none",uncompress=>0 };
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1257
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1258
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1259
sub ReadPreprocessedFile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1260
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1261
#	Read the OBY file that was generated by the pre-processor. This OBY is a conglomeration of all the OBYs
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1262
#	passed directly to buildrom and/or the ones passed through Image Content XML.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1263
#	It marks the binaries coming from OBY. This is required to be able to point out the binaries that are 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1264
#	mentioned neither in the OBY nor in the CDF. Such binaries are arrived at through static dependencies
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1265
#	and need to be included in ROM.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1266
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1267
	my $temp1OBYFile = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1268
	my $tmpline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1269
	my $srcFileName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1270
	my $srcFilePath;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1271
	my $dstFileName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1272
	my $dstFilePath;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1273
	open (OBYFH, "$temp1OBYFile") or die("* Can't open $temp1OBYFile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1274
	while($tmpline =<OBYFH>) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1275
		if ($tmpline=~/(\S+)\s*=\s*(\S+)\s+(\S+)/) {#Get the first parameter (source File path) from oby line
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1276
			$srcFilePath = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1277
			$dstFilePath = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1278
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1279
			if ($srcFilePath=~/.*\\(\S+)/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1280
				$srcFileName = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1281
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1282
			if ($dstFilePath=~/.*\\(\S+)/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1283
				$dstFileName = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1284
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1285
			my $binaryInfoRef = &cdfparser::GetBinaryInfo($dstFileName);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1286
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1287
			if(defined($binaryInfoRef)) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1288
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1289
				#Found in CDF file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1290
				if($binaryInfoRef->{IsFoundInCDF})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1291
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1292
					print "Warning: File $srcFileName mentioned in OBY as well as CDF file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1293
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1294
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1295
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1296
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1297
				#Found in OBY file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1298
				&ImageContentHandler::AddBinaryFromOby($dstFileName, $srcFilePath);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1299
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1300
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1301
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1302
	close OBYFH;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1303
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1304
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1305
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1306
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1307
# Substitution phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1308
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1309
# Handle the "define XXX YYY" lines, perform the substitutions.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1310
# Print out any ECHO lines or ERROR lines. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1311
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1312
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1313
# Predefined substitutions: 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1314
#   TODAY means todays' date
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1315
#   RIGHT_NOW means the exact time
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1316
#   EPOCROOT taken from the environment
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1317
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1318
sub substitution_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1319
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1320
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1321
		my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1322
		$substitutionData{"TODAY"} = sprintf("%02d/%02d/%04d", $mday, $mon+1, $year+1900);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1323
		$substitutionData{"RIGHT_NOW"} = sprintf("%02d/%02d/%04d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1324
		$substitutionData{"EPOCROOT"} = $epocroot;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1325
		@substitutionOrder = ("TODAY", "RIGHT_NOW", "EPOCROOT");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1326
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1327
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1328
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1329
	open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1330
	while ($line=<TMP1>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1331
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1332
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1333
		if(($line =~ /^\s*romsize\s*=/i) || ( $line=~ /^\s*rom_image/i) || ($line =~ /^\s*data_image/i))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1334
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1335
			$onlysmrimage = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1336
			last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1337
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1338
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1339
	close TMP1;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1340
	if ($enforceFeatureManager && (!$featuremanager) && (!$noFeatureManager) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1341
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1342
		my $defaultFeatureDbFlag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1343
		open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1344
		while ($line=<TMP1>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1345
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1346
			if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1347
			{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1348
				# Get the default value for featuredatabasefile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1349
                
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1350
				$featureXml = "$epocroot$1";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1351
				$featuremanager = 1;				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1352
				$defaultFeatureDbFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1353
				load_featuresutil();				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1354
				last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1355
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1356
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1357
		close TMP1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1358
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1359
		if(!$defaultFeatureDbFlag && !$onlysmrimage)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1360
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1361
			print "Error: Neither option \"-fm|-nofm\" nor default value for featuredatabase file is provided.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1362
			exit(1);			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1363
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1364
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1365
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1366
	open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1367
	while ($line=<TMP1>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1368
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1369
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1370
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1371
		# Recognise keywords in lines that we process before substitution
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1372
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1373
		# # lineno "file" flagno
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1374
		# DEFINE name replacement-with-0-spaces
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1375
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1376
		if($line=~/^\s*$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1377
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1378
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1379
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1380
		if ($line=~/^# (\d+) "(.*)" (\d+)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1381
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1382
			push @obydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1383
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1384
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1385
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1386
		if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1387
		{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1388
			push @obydata, "REM $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1389
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1390
		}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1391
		#process the External tool invocation using IBY file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1392
		if ($line=~/externaltool=(.*),?/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1393
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1394
			&externaltools::loadTools($1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1395
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1396
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1397
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1398
		#Process the patch statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1399
		if($line =~ /^\s*patchdata\s*(.*)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1400
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1401
			$patchDataStmtFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1402
			my $new_line = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1403
 			# syntax "<DLLnamewithpath> addr <variableaddress> <variablesize> <newvalue>"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1404
 			# If the line matches with above syntax, just add the line into oby file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1405
 			if($new_line !~ /^\s*(\S+)\s+addr\s+(\S+)\s+(\S+)\s+(\S+)\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1406
 			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1407
 				if(AddDllDataInfo($new_line))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1408
 				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1409
 					$line = "REM $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1410
 				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1411
 			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1412
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1413
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1414
		if($line =~ /^\s*FEATURE\s*(.*)/i || $line =~ /^\s*EXCLUDE_FEATURE\s*(.*)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1415
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1416
			# Process the feature keywords only when "-f|fr" or "-fm" is passed to buildrom
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1417
			if(defined ($featureXml))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1418
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1419
				push @obydata, "$line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1420
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1421
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1422
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1423
				push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1424
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1425
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1426
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1427
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1428
		if ($line=~/^\s*DEFINE\s+(\w+)\s+(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1429
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1430
			my $key=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1431
			my $value=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1432
			foreach my $wordToSubstitute (@substitutionOrder)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1433
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1434
				my $whatToSubstituteItWith=$substitutionData{$wordToSubstitute};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1435
				$value=~s/$wordToSubstitute/$whatToSubstituteItWith/g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1436
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1437
			$value=~s/##//g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1438
			if (defined $substitutionData{$key})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1439
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1440
				# If the key is redefined, apply it at the new position rather
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1441
				# than the old one.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1442
				push @obydata, "REM redefined $key as $value\n";# Leave a record of the definition
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1443
				@substitutionOrder = grep !/^$key$/, @substitutionOrder;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1444
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1445
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1446
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1447
				push @obydata, "REM defined $key as $value\n";	# Leave a record of the definition
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1448
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1449
			$substitutionData{$key}=$value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1450
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1451
			foreach my $wordToSubstitute (@substitutionOrder)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1452
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1453
	   	        if ($key =~ /$wordToSubstitute/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1454
	   	        {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1455
				   print_source_error("Warning: $key is masked by earlier definition of $wordToSubstitute");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1456
			 	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1457
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1458
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1459
			push @substitutionOrder, $key;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1460
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1461
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1462
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1463
		# Do the substitutions in strict order of definition, 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1464
		# then eliminate any old-fashioned ## things which may be left
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1465
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1466
		foreach my $wordToSubstitute (@substitutionOrder)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1467
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1468
			my $whatToSubstituteItWith=$substitutionData{$wordToSubstitute};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1469
			$line=~s/$wordToSubstitute/$whatToSubstituteItWith/g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1470
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1471
		$line=~s/##//g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1472
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1473
		# Recognise keywords in lines that we process after substitution
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1474
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1475
		# ECHO  anything at all
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1476
		# WARNING anything at all
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1477
		# ERROR anything at all
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1478
		# LANGUAGE_CODE nnn
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1479
		# DEFAULT_LANGUAGE nnn
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1480
		# ABI_DOWNGRADE from to
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1481
		# ROMBUILD_OPTION command-line-option
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1482
		# ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1483
		# PlatSecEnforceSysBin on|off
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1484
		# ENABLE_SPI/DISABLE_SPI
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1485
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1486
		if ($line=~/^\s*ECHO\s+(.*?)\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1487
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1488
			print "$1\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1489
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1490
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1491
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1492
		if ($line=~/^\s*(ERROR|WARNING)\s+(.*?)\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1493
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1494
			print_source_error("$1 $2");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1495
			$errors++ if ($1 =~ /ERROR/i);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1496
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1497
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1498
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1499
		if ($line=~/^\s*(PlatSecEnforceSysBin)\s+(\S+)\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1500
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1501
			$enforceSysBin = ($2 =~ /ON/i);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1502
			push @obydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1503
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1504
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1505
		if ($line=~/^\s*LANGUAGE_CODE\s+(\S+)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1506
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1507
			my $code = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1508
			if ($code !~ /^\d\d+$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1509
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1510
				print_source_error("bad language code $code");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1511
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1512
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1513
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1514
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1515
				$languageCodes{$code} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1516
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1517
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1518
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1519
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1520
		if ($line=~/^\s*DEFAULT_LANGUAGE\s+(\S+)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1521
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1522
			my $code = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1523
			if ($code !~ /^\d\d+$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1524
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1525
				print_source_error("bad default language code $code");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1526
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1527
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1528
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1529
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1530
				$defaultLanguageCode = $code;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1531
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1532
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1533
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1534
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1535
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1536
		if ($line=~/^\s*ABI_DOWNGRADE\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1537
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1538
			if ($line =~ /\s(.+)\s*->\s*(.+)\s*$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1539
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1540
				$abiDowngrade = "$1 $2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1541
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1542
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1543
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1544
				print_source_error("bad ABI downgrade : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1545
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1546
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1547
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1548
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1549
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1550
		if ($line=~/^\s*BINARY_SELECTION_ORDER\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1551
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1552
	 		if ($line =~ /\s([^,]+)\s*,\s*(.+)\s*$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1553
   			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1554
  				$binarySelectionOrderFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1555
 				$firstDIR = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1556
   				# remove whitespaces
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1557
 				$firstDIR = trim($firstDIR); 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1558
   				@binarySelectionOrder = split(',', $2);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1559
   				@binarySelectionOrder = trim(@binarySelectionOrder);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1560
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1561
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1562
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1563
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1564
				print_source_error("bad order specified: $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1565
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1566
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1567
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1568
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1569
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1570
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1571
		if ($line=~/^\s*ROMBUILD_OPTION\s+(\S+)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1572
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1573
			$rombuildOptions{$1} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1574
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1575
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1576
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1577
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1578
		if ($line=~/^\s*enable_spi\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1579
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1580
			if(!($spiset)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1581
				$createspi=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1582
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1583
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1584
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1585
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1586
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1587
		if ($line=~/^\s*disable_spi\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1588
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1589
			if(!($spiset)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1590
				$createspi=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1591
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1592
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1593
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1594
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1595
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1596
		if ($line=~/^\s*DATA_IMAGE\s+/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1597
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1598
			if ($line =~ /\s+(\d+)\s+(\S+)\s+/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1599
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1600
				my $datadriveidx = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1601
				my $datadriveimagename = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1602
				# have a count on number of data drive images that needs to be created
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1603
				print "data drive partion name = $datadriveimagename\n " if($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1604
				my $dataimagesize = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1605
				if ($line =~ /\s+size=(\S+)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1606
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1607
					$dataimagesize=$1; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1608
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1609
				my $fstype = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1610
				my $compress=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1611
				my $uncompress=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1612
				if ($line =~ /\s+compress\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1613
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1614
					$compress=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1615
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1616
				elsif($line =~ /\s+uncompress\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1617
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1618
					$uncompress=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1619
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1620
				if ($line =~ /\s+fat16\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1621
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1622
					$fstype = "fat16"; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1623
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1624
				if ($line =~ /\s+fat32\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1625
				{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1626
					$fstype = "fat32"; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1627
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1628
				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1629
				$datadriveimage[$datadriveidx] = {name=>$datadriveimagename, size=>$dataimagesize, compress=>$compress, uncompress=>$uncompress, fstype=>$fstype};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1630
				print "DATA_IMAGE[$datadriveidx] $datadriveimage[$datadriveidx]{name} size=$datadriveimage[$datadriveidx]{size} compress=$compress uncompress=$uncompress fstype=$fstype\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1631
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1632
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1633
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1634
				print_source_error("bad DATA_IMAGE specification : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1635
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1636
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1637
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1638
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1639
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1640
		if ($line=~/^\s*ROM_IMAGE\s+/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1641
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1642
			if ($line =~ /\s+(\d+)\s+(\S+)\s+/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1643
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1644
				my $romidx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1645
				my $rompartitionname=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1646
				my $rompartitionsize=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1647
				if ($line =~ /\s+size=(\S+)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1648
					{ $rompartitionsize=$1; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1649
				my $xip=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1650
				my $compress=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1651
				my $uncompress=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1652
				my $extend=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1653
				my $composite="none";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1654
				if ($line =~ /\s+non-xip\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1655
					{ $xip=0; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1656
				if ($line =~ /\s+compress\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1657
					{ $compress=1; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1658
				elsif($line =~ /\s+uncompress\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1659
					{ $uncompress=1;} # This option is passed to rofsbuild. For rombuild, not saying --compress means to uncompress
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1660
				if ($line =~ /\s+extension\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1661
					{ $extend=1; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1662
				if ($line =~ /\s+composite_primary\s*/i) # added to support new composite_primary keyword in obey files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1663
				{	if (!($extend))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1664
						{ $composite="composite_primary"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1665
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1666
						{ print "Error: composite_primary keyword must be used with a core image\n"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1667
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1668
				if ($line =~ /\s+composite_secondary\s*/i) # added to support new composite_secondary keyword in obey files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1669
				{ if (!($extend))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1670
						{ $composite="composite_secondary"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1671
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1672
						{ print "Error: composite_secondary keyword must be used with core image\n"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1673
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1674
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1675
				#	Compress and Uncompress are 2 different options and
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1676
				#	not mentioning one of them doesn't necessarily mean the other.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1677
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1678
				$romimage[$romidx] = {name=>$rompartitionname, size=>$rompartitionsize, xip=>$xip, compress=>$compress, extension=>$extend, composite=>$composite, uncompress=>$uncompress};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1679
				print "ROM_IMAGE[$romidx] $romimage[$romidx]{name} size=$romimage[$romidx]{size} xip=$xip compress=$compress extension=$extend composite=$composite uncompress=$uncompress \n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1680
				check_romimage($romidx, $line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1681
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1682
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1683
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1684
				print_source_error("bad ROM_IMAGE specification : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1685
				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1686
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1687
			push @obydata, "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1688
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1689
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1690
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1691
		push @obydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1692
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1693
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1694
	close TMP1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1695
	exit(1) if ($errors);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1696
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1697
	dump_obydata("tmp2.oby", "result of substitution phase") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1698
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1699
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1700
sub check_romimage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1701
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1702
	my ($idx, $line) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1703
	if ($idx gt 7)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1704
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1705
		print_source_error("too many roms : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1706
		$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1707
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1708
	if ($romimage[$idx]{xip} eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1709
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1710
		if ($romimage[$idx]{size} eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1711
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1712
			print_source_error("must specify a size for non-xip ROM : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1713
			$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1714
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1715
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1716
	if ($romimage[$idx]{extension} ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1717
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1718
		if ($romimage[$idx-1]{extension} ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1719
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1720
			print_source_error("cannot extend ROM image multiple times : $line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1721
			$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1722
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1723
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1724
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1725
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1726
sub dump_obydata
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1727
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1728
	my ($dumpfile, $comment) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1729
	unlink($dumpfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1730
	open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1731
	print "* Writing $dumpfile - $comment\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1732
	my $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1733
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1734
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1735
		print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1736
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1737
	close DUMPFILE;
3
df09f0d786ec More buildrom.pm tweaks
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
  1738
	open SLY_COPY, ">xxx_$dumpfile";
df09f0d786ec More buildrom.pm tweaks
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
  1739
	print SLY_COPY @obydata;
df09f0d786ec More buildrom.pm tweaks
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
  1740
	close SLY_COPY;
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1741
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1742
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1743
sub track_source
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1744
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1745
	my ($line) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1746
	if ($line=~/^# (\d+) "(.*)"/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1747
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1748
		$sourceline=$1-1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1749
		$sourcefile=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1750
		$sourcefile=~ s/\//\\/g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1751
		$sourcefile=~ s/\\\\/\\/g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1752
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1753
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1754
	$sourceline++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1755
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1756
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1757
sub print_source_error
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1758
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1759
	my ($message) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1760
	print "$sourcefile($sourceline): $message\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1761
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1762
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1763
sub reassert_sourceline
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1764
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1765
	my ($offset) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1766
	return sprintf "# %d \"$sourcefile\" \n", $sourceline+1+$offset;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1767
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1768
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1769
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1770
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1771
# Reorganisation phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1772
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1773
# Group lines beginning with "rom_image[<id>]" and deposit them in the appropriate
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1774
# order.  Truncate the description at the "stop" line, if there is one.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1775
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1776
sub reorganize_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1777
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1778
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1779
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1780
	my @section2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1781
	my @part3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1782
	my @part4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1783
	my @part5;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1784
	my @part6;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1785
	my @part7;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1786
	my @part8;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1787
	my @partitions = ( \@newobydata, \@section2, \@part3, \@part4, \@part5, \@part6, \@part7, \@part8 );
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1788
	my @currentpartition;	# partition stack
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1789
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1790
	my @processedImageIdx;		# list of proccesed data drive image index. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1791
	my $dataDriveStartRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1792
	my $dataDriveEndRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1793
	my $dataDriveIdx;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1794
	my @datapartition;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1795
	my @linesArray;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1796
	my $curlyBraceShouldFollow;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1797
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1798
	my $collect_section2=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1799
	my $smrImageStartRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1800
	my $smrImageEndRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1801
	my $smrImageIndex = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1802
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1803
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1804
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1805
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1806
		if ($line=~/^\s*stop/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1807
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1808
			last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1809
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1810
		if ($line =~ /^\s*ROM_IMAGE\[(\S+)\]\s+\{(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1811
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1812
			# ROM_IMAGE[n] {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1813
			my $idx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1814
			my $partition=$partitions[$idx];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1815
			push @currentpartition, $partition;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1816
			$line="REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1817
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1818
		elsif( ($line =~ /^\s*DATA_IMAGE\[(\S+)\]\s*$/i) || ($line =~ /^\s*DATA_IMAGE\[(\S+)\]\s*\{\s*$/i))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1819
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1820
			# DATA_IMAGE[n] or DATA_IMAGE[n] {  is specified.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1821
			# get the index.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1822
			$dataDriveIdx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1823
 			if($line !~ /\s*\{\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1824
 			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1825
 				$curlyBraceShouldFollow = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1826
 			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1827
			# make a check if dataDriveIdx exists in the processedImageIdx array.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1828
			# if no, then push the dataDriveIdx on the processedImageIdx array.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1829
			# if yes,then dont execute the loop.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1830
			if(&datadriveimage::checkInArray(\@processedImageIdx,$dataDriveIdx))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1831
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1832
				# push the index on to the array.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1833
				push(@processedImageIdx,$dataDriveIdx);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1834
				# increment the image count. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1835
				++$dataImageCount;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1836
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1837
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1838
			$dataIndexHash{($dataImageCount-1)} = $dataDriveIdx;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1839
			# set start of the image section.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1840
			$dataDriveStartRegion = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1841
			# set end of image section to zero.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1842
			$dataDriveEndRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1843
			push (@linesArray,"\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1844
			$line="REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1845
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1846
		elsif( $line =~ /^\s*SMR_IMAGE\s*\{\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1847
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1848
			$smrImageStartRegion = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1849
			$smrImageEndRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1850
			$needSmrImage = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1851
			push (@linesArray, "\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1852
			$line="REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1853
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1854
 		elsif((defined $curlyBraceShouldFollow) && ($line !~ /^\s*$/i))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1855
 		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1856
			undef $curlyBraceShouldFollow;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1857
 			if($line !~ /^\s*\{\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1858
 			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1859
 				print "Error: Symbol '{' not followed after the keyword DATA_IMAGE\[".$dataDriveIdx."\]\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1860
 				$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1861
 			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1862
 			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1863
 		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1864
		# data drive specific keywords.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1865
		elsif( $line =~/^\s*dataimagename\s*\=\s*(\S+)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1866
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1867
			# set the name for the image, if image name is specified using driveimagename keyword.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1868
			$datadriveimage[$dataDriveIdx]{name} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1869
			print"datadriveimagename = $datadriveimage[$dataDriveIdx]{name}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1870
			# skip the line.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1871
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1872
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1873
		elsif( $line =~/^\s*dataimagesize\s*\=\s*(\S+)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1874
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1875
			# set the size for the image, if image size is specified using driveimagesize keyword.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1876
			$datadriveimage[$dataDriveIdx]{size} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1877
			print"datadriveimagesize = $datadriveimage[$dataDriveIdx]{size}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1878
			# skip the line.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1879
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1880
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1881
		elsif( $line =~/^\s*dataimagefilesystem\s*\=\s*(\S+)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1882
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1883
			# set the file system type for the image, if image file system is specified using dataimagefilesystem keyword.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1884
			$datadriveimage[$dataDriveIdx]{fstype} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1885
			print"datadriveimagefstype = $datadriveimage[$dataDriveIdx]{fstype}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1886
			# skip the line.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1887
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1888
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1889
		elsif( $line =~/^\s*compress/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1890
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1891
			# Compresses the resulting data drive image using the Deflate, Huffman+LZ77 algorithm.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1892
			if($dataDriveStartRegion && !$dataDriveEndRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1893
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1894
				$datadriveimage[$dataDriveIdx]{compress} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1895
				$datadriveimage[$dataDriveIdx]{uncompress} = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1896
				print"datadriveimage[$dataDriveIdx] compress = $datadriveimage[$dataDriveIdx]{compress}\n" if($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1897
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1898
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1899
		elsif( $line =~/^\s*uncompress/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1900
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1901
			# Uncompresses the resulting data drive image.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1902
			if($dataDriveStartRegion && !$dataDriveEndRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1903
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1904
				$datadriveimage[$dataDriveIdx]{uncompress} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1905
				$datadriveimage[$dataDriveIdx]{compress} = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1906
				print"datadriveimage[$dataDriveIdx] uncompress = $datadriveimage[$dataDriveIdx]{uncompress}\n" if($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1907
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1908
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1909
		elsif ($line =~ /^\s*ROM_IMAGE\[(\S+)\](.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1910
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1911
			# ROM_IMAGE[n] file=...
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1912
			my $origline=$line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1913
			$line="$2\n";	# remove the ROM_IMAGE[.] keyword
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1914
			my $idx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1915
			my $partition=$partitions[$idx];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1916
			push @$partition, reassert_sourceline(-1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1917
			push @$partition, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1918
			$line="REM handled $origline";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1919
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1920
		elsif ($line =~ /^\s*DATA_IMAGE\[(\S+)\](.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1921
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1922
			# DATA_IMAGE[n] file=...
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1923
			my $origline=$line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1924
			# remove the DATA_IMAGE[.] keyword
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1925
			$line="$2\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1926
			# get the index value
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1927
			my $idx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1928
			# iterate through the hash to get corresponding 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1929
			# key from the value(i.e idx) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1930
			while (my($key, $value) = each(%dataIndexHash))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1931
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1932
				if ($value eq $idx ) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1933
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1934
					$idx = $key;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1935
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1936
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1937
			push @{$datapartition[$idx]}, reassert_sourceline(-1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1938
			push @{$datapartition[$idx]}, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1939
			$line="REM handled $origline";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1940
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1941
		elsif ($line =~ /^\s*\}.*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1942
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1943
			if($dataDriveStartRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1944
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1945
				# since "}" brace is encountered
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1946
				# reset the start of DATA_IMAGE to zero.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1947
				$dataDriveStartRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1948
				# mark the the end of the DATA_IMAGE.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1949
				$dataDriveEndRegion = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1950
				if(!$datadriveimage[$dataDriveIdx]{name})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1951
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1952
					# image name is not defined, define a default name.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1953
					$datadriveimage[$dataDriveIdx]{name} = "dataImage".$dataDriveIdx;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1954
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1955
				if(!$datadriveimage[$dataDriveIdx]{fstype})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1956
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1957
					# image name is not defined, define a default name.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1958
					$datadriveimage[$dataDriveIdx]{fstype} = "fat16";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1959
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1960
				foreach my $file (@linesArray)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1961
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1962
					push @{$datapartition[($dataImageCount-1)]},$file;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1963
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1964
				## if end of the DATA_IMAGE is true,
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1965
				## make room for next DATA_IMAGE if any.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1966
				undef(@linesArray); 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1967
				#un define $dataDriveIdx;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1968
				undef($dataDriveIdx);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1969
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1970
			elsif($smrImageStartRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1971
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1972
				$smrImageStartRegion = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1973
				$smrImageEndRegion = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1974
				foreach my $file (@linesArray)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1975
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1976
					push @{$smrPartitions{$smrImageIndex}}, $file;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1977
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1978
				undef(@linesArray);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1979
				$smrImageIndex++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1980
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1981
			elsif (scalar @currentpartition > 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1982
			{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1983
				pop @currentpartition; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1984
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1985
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1986
			{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1987
				print "WARNING: closing '}' found with no matching 'ROM_IMAGE[<n>]/DATA_IMAGE[<n>] {'\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1988
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1989
			$line="REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1990
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1991
		elsif ($line=~/^\s*section2(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1992
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1993
			my $origline=$line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1994
			$line="$1\n";	# remove the section2 keyword
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1995
			if ($collect_section2)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1996
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1997
				push @section2, reassert_sourceline(-1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1998
				push @section2, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1999
				$line="REM handled $origline";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2000
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2001
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2002
		elsif ($line=~/^\s*section/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2003
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2004
			push @newobydata, $line;		# insert the section statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2005
			if (@section2 != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2006
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2007
				push @newobydata, "REM accumulated section2 lines\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2008
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2009
			foreach $line (@section2)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2010
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2011
				push @newobydata, $line;	# insert accumulated section2 lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2012
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2013
			$collect_section2=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2014
			$line = reassert_sourceline();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2015
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2016
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2017
		elsif ($line=~/^\s*extensionrom/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2018
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2019
			# end of ROM description, so deposit accumulated lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2020
			if (@section2 != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2021
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2022
				push @newobydata, "REM accumulated section2 lines\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2023
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2024
			foreach $line (@section2)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2025
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2026
				push @newobydata, $line;	# insert accumulated section2 lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2027
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2028
			$collect_section2=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2029
			push @newobydata, reassert_sourceline();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2030
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2031
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2032
		elsif ( scalar(@linesArray) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2033
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2034
			if($dataDriveStartRegion && !$dataDriveEndRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2035
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2036
				my $modifiedLine = $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2037
				push @linesArray, $modifiedLine;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2038
				$line = "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2039
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2040
			elsif($smrImageStartRegion && !$smrImageEndRegion)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2041
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2042
				if($line =~ /^\s*IMAGENAME\s*=\s*(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2043
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2044
					my $smrimagename = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2045
					$smrimagename =~s/(\.img)//i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2046
					if(exists($smrNameInfo{$smrimagename}))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2047
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2048
						$smrNameInfo{$smrimagename}++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2049
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2050
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2051
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2052
						$smrNameInfo{$smrimagename} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2053
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2054
					$line =~s/(\.img)//i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2055
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2056
				push @linesArray, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2057
				$line = "REM handled $line";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2058
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2059
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2060
		elsif (scalar @currentpartition)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2061
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2062
			my $modifiedLine = $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2063
			if ($line =~ /^\s*SPI_POSITION/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2064
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2065
				if(!($createspi && $spiplacement))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2066
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2067
					# comment the line if the spi placement flag is not enabled or if the spi creation is not enabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2068
					$modifiedLine = "REM SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2069
					print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2070
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2071
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2072
			# a partition is specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2073
			# push this line into the currently selected partition
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2074
			my $partition=@currentpartition[-1];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2075
			push @$partition, $modifiedLine;
3
df09f0d786ec More buildrom.pm tweaks
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
  2076
			next; 
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2077
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2078
		elsif ($line =~ /^\s*SPI_POSITION/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2079
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2080
			if(!($createspi && $spiplacement))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2081
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2082
                # comment the line if the spi placement flag is not enabled or if the spi creation is not enabled.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2083
                $line = "REM SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2084
                print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2085
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2086
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2087
		push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2088
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2089
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2090
	# output the grouped data
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2091
	my $partitionidx=2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2092
	if ($collect_section2)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2093
		{ $partitionidx=1; } # output old "section2" if not done already
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2094
	for (; $partitionidx<8; $partitionidx++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2095
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2096
		my $partition=$partitions[$partitionidx];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2097
		if (@$partition != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2098
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2099
			push @newobydata, "REM ROM_IMAGE[$partitionidx]\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2100
			foreach $line (@$partition)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2101
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2102
				push @newobydata, $line;	# insert accumulated section2 lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2103
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2104
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2105
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2106
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2107
	for ( my $datapartitionidx=0; $datapartitionidx < $dataImageCount; $datapartitionidx++ )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2108
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2109
		if( defined( @{ $datapartition[$datapartitionidx] } ) )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2110
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2111
			push @newobydata, "REM DATA_IMAGE[$dataIndexHash{$datapartitionidx}]\n" ;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2112
			foreach my $file (@{$datapartition[$datapartitionidx]})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2113
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2114
				push @newobydata, $file;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2115
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2116
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2117
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2118
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2119
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2120
	foreach my $imageIndex (keys(%smrPartitions))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2121
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2122
		my $imagename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2123
		my @obeyfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2124
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2125
		foreach (@{$smrPartitions{$imageIndex}})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2126
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2127
			if(/^\s*imagename\s*=\s*(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2128
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2129
				$imagename = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2130
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2131
			push @obeyfile, $_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2132
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2133
		if($smrNameInfo{$imagename} == 1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2134
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2135
			push @obeyFileList, $imagename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2136
			push @newobydata, "REM SMR_IMAGE \n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2137
			push @newobydata, @obeyfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2138
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2139
		if(! defined($imagename))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2140
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2141
			$smrNoImageName = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2142
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2143
		undef $imagename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2144
		undef @obeyfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2145
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2146
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2147
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2148
	exit(1) if ($errors);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2149
	dump_obydata("tmp3.oby", "result of reorganisation phase") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2150
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2151
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2152
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2153
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2154
# Plugin phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2155
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2156
# Process any plugin annotation lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2157
# Note: This expands resource lines to include MULTI_LINGUIFY so must be done before
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2158
# the Multilinguify phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2159
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2160
# hash of SPI file target directories is located near the start of this file, before sub match_obyfile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2161
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2162
sub plugin_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2163
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2164
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2165
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2166
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2167
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2168
	 	if ($line =~ /^\s*REM/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2169
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2170
		# ignore REM statements, to avoid processing "REM ECOM_PLUGIN(xxx,yyy)"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2171
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2172
		elsif(plugin_match($line)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2173
			$line = reassert_sourceline();		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2174
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2175
		push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2176
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2177
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2178
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2179
	dump_obydata("tmp4.oby", "result of Plugin stage") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2180
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2181
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2182
sub plugin_match ()
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2183
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2184
	my ($line) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2185
	foreach my $plugintype (keys(%plugintypes)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2186
	  if ($line =~ m/^.*__$plugintype\_PLUGIN\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2187
	  	# __<plugin-type>_PLUGIN(emulator directory, file rom dir, dataz_, resource rom dir, filename, resource filename)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2188
	  {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2189
		    my $emulatorDir=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2190
		    my $fileRomDir=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2191
		    my $dataz_= $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2192
		    my $resourceDir=$4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2193
		    my $pluginFileName=$5;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2194
		    my $pluginResourceName=$6;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2195
		    my $spidatahide = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2196
			my $paged_data = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2197
  
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2198
			if ($line =~ m/paged\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2199
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2200
				$line =~ m/\s+(\S+)\s*$/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2201
				$paged_data = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2202
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2203
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2204
		    if ($line =~ m/^\s*(_hide)/i )
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2205
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2206
		    	$spidatahide = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2207
		    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2208
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2209
		    # for resource files strip the .rsc or .dll from the end   (will be .dll where we use
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2210
		    # SYMBIAN_SECURE_ECOM and are building resources to  the same name as ecom plugin dlls)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2211
		    
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2212
		    if ($pluginResourceName =~ m/^(.+)\./)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2213
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2214
		      $pluginResourceName = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2215
		    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2216
		    else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2217
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2218
		      print_source_error("Invalid Resource name: $pluginResourceName in " . $plugintype . "_PLUGIN :$line");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2219
		      #treat as error if strict option selected;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2220
		      $errors++ if ($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2221
		    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2222
3
df09f0d786ec More buildrom.pm tweaks
William Roberts <williamr@symbian.org>
parents: 1
diff changeset
  2223
		    push @newobydata, "REM expanded $line";
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2224
		    if ($spidatahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2225
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2226
			push @newobydata, "hide=$fileRomDir\\$pluginFileName\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2227
		    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2228
		    else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2229
		    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2230
		    	push @newobydata, "file=$emulatorDir\\$pluginFileName $fileRomDir\\$pluginFileName $paged_data\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2231
		    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2232
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2233
		    if($createspi) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2234
		    	    if ($spidatahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2235
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2236
			    	push @newobydata, "spidatahide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n";      
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2237
			    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2238
			    else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2239
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2240
			    	push @newobydata, "spidata=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n";      
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2241
			    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2242
		  	} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2243
		    	    if ($spidatahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2244
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2245
			    	push @newobydata, "hide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2246
			    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2247
			    else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2248
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2249
			    	push @newobydata, "data=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2250
			    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2251
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2252
				return 1; #successful match
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2253
	   }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2254
     }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2255
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2256
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2257
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2258
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2259
# Multilinguify phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2260
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2261
# Process the MULTILINGUIFY() lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2262
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2263
sub multlinguify_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2264
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2265
	if ((scalar keys %languageCodes) == 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2266
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2267
		print "* No language codes specified, defaulting to 01\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2268
		$defaultLanguageCode = "01";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2269
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2270
	$languageCodes{$defaultLanguageCode} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2271
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2272
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2273
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2274
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2275
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2276
		if ($line =~ /^\s*REM/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2277
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2278
			# ignore REM statements, to avoid processing "REM data=xxx yyy"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2279
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2280
		elsif ($line=~/^(.*?)\bMULTI_LINGUIFY\s*\(\s*(\S+)\s+(\S+)\s+(\S+)\s*\)(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2281
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2282
			my $initialStuff=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2283
			my $defaultFileNameExtension=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2284
			my $sourceFileNameWithoutExtension=$3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2285
			my $targetFileNameWithoutExtension=$4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2286
			my $finalStuff=$5;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2287
			my $spidataflag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2288
			my $spidatahide = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2289
			my $datahide = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2290
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2291
			if ($initialStuff=~/\w$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2292
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2293
				$initialStuff.=" ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2294
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2295
			if ($finalStuff=~/^\w/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2296
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2297
				$finalStuff=" ".$finalStuff;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2298
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2299
			if ($initialStuff =~ /^\s*spidata/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2300
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2301
				$spidataflag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2302
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2303
			if ($initialStuff =~ /^\s*spidatahide/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2304
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2305
				$spidataflag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2306
				$spidatahide = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2307
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2308
			if ($initialStuff =~ /^\s*hide/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2309
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2310
				$datahide = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2311
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2312
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2313
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2314
# ecom.spi should contain the .RSC files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2315
			if ($spidataflag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2316
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2317
				my $sourceFileNameExtension = $defaultFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2318
				my $targetFileNameExtension = $defaultFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2319
				if (-e "$sourceFileNameWithoutExtension.$sourceFileNameExtension")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2320
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2321
					if ($spidatahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2322
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2323
						push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$finalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2324
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2325
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2326
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2327
						push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension$finalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2328
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2329
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2330
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2331
			my $useDefaultFileNameExtension=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2332
			foreach my $languageCode (keys %languageCodes) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2333
				my $sourceFileNameExtension=$defaultFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2334
				$sourceFileNameExtension=~s/^(.*).{2}$/$1$languageCode/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2335
				if (! -e "$sourceFileNameWithoutExtension.$sourceFileNameExtension")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2336
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2337
					if (!$spidataflag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2338
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2339
						next if (!$useDefaultFileNameExtension);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2340
						next if (defined $defaultLanguageCode and !($languageCode eq $defaultLanguageCode));
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2341
						$useDefaultFileNameExtension=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2342
						if (!$datahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2343
						{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2344
							print "Converting >$sourceFileNameWithoutExtension.$sourceFileNameExtension< to $defaultFileNameExtension\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2345
							$sourceFileNameExtension=$defaultFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2346
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2347
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2348
					else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2349
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2350
						next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2351
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2352
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2353
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2354
				my $targetFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2355
# ecom.sNN should contain the corresponding language code .RNN files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2356
				if(!$spidataflag and (defined $defaultLanguageCode and ($languageCode eq $defaultLanguageCode)))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2357
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2358
					$targetFileNameExtension = $defaultFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2359
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2360
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2361
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2362
					$targetFileNameExtension = $sourceFileNameExtension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2363
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2364
				my $modifiedfinalStuff = $finalStuff;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2365
				$modifiedfinalStuff =~ s/\.spi/\.s$languageCode/i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2366
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2367
				if ($spidatahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2368
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2369
					push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2370
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2371
				elsif ($datahide)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2372
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2373
					push @newobydata, "$initialStuff$targetFileNameWithoutExtension.$targetFileNameExtension$modifiedfinalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2374
					if(!($sourceFileNameExtension eq $targetFileNameExtension))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2375
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2376
						push @newobydata, "$initialStuff$targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2377
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2378
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2379
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2380
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2381
					push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2382
					if(!($sourceFileNameExtension eq $targetFileNameExtension))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2383
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2384
						push @newobydata, "alias $targetFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension $modifiedfinalStuff\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2385
						$multiLinguifyAlias{"$targetFileNameWithoutExtension.$sourceFileNameExtension"} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2386
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2387
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2388
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2389
			$line = reassert_sourceline();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2390
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2391
		push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2392
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2393
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2394
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2395
	dump_obydata("tmp5.oby", "result of choosing language-specific files") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2396
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2397
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2398
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2399
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2400
my @featurefilearray; #2d array storing names and locations of feature files in each rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2401
my @featureslist; #array of hashes, stores all the features which are to go into the feature files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2402
my $featurefilecount=0; #counts number of feature files in each rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2403
my $featurescount=0; #counts number of features
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2404
my $dir; # Stores the ROM image location of features.dat/featreg.cfg files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2405
my $featurefilename; # Stores the name of feature file to be generated(i.e. "features.dat" or "featreg.cfg")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2406
my @spiarray; #2d array storing names and locations of spi files in each rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2407
my @datafiles; #array of hashes, stores all the data files which are to go into the spi files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2408
my @hidedatafiles; #array of hashes, stores all the data files which are to be hidden in the spi files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2409
my $spicount=0; #counts number of spi files in each rom image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2410
my $filescount=0; #counts number of data files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2411
my $hidefilescount=0; #counts number of data files to be hidden
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2412
my $romimage=0; #number of rom image currently working with
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2413
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2414
sub locateexisting 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2415
{ # if an SPI file of this type exists in a base image then returns name of SPI file from the array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2416
	my ($romimage, $spifile, $base) =@_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2417
	my $i=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2418
	while(defined $spiarray[$base][$i]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2419
		if($spiarray[$base][$i]{spi} eq $spiarray[$romimage][$spifile]{spi}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2420
			my $spiname;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2421
			my $spiextension;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2422
			if($spiarray[$base][$i]{spifile} =~ /(.*)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2423
				$spiname=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2424
				$spiextension=$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2425
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2426
			if(-e "$spiname-$base-$i\.$spiextension") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2427
					return "$spiname-$base-$i\.$spiextension";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2428
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2429
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2430
		$i++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2431
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2432
	return "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2433
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2434
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2435
sub create 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2436
{ #called to create SPI file and store in specified directory
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2437
	my ($romimage, $spifile, $base) =@_; #$romimage = current rom image number, $spifile = current spifile number, $base=number of rom image basing on
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2438
	my $existingspi = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2439
	if(defined($base)) { # checks core image for an existing SPI file of this type, if an existing file exists then $existingspi is set to -i<name of existing spi file> which will later be passed to spitool.pm
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2440
		$existingspi = locateexisting($romimage, $spifile, $base);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2441
		if($existingspi ne "") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2442
			$existingspi = "-i$existingspi";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2443
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2444
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2445
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2446
	if($spiarray[$romimage][$spifile]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2447
		my $targetspi="$1-$romimage-$spifile\.$2"; #add romimage number and identifier for spi file to spi file name to distinguish from other spi files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2448
		my @dataforspi; # array to store names of data files to include in spi file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2449
		my @hidedatainspi; # array to store names of data files that are to be hidden in spi file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2450
		for(my $k=0;$k<scalar @datafiles;$k++) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2451
			if($datafiles[$k]{rom}==$romimage && $datafiles[$k]{spifile} == $spifile) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2452
				push @dataforspi, $datafiles[$k]{data}; #push name of data file onto array if correct romimage and spi type
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2453
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2454
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2455
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2456
		for(my $j=0;$j<scalar @hidedatafiles;$j++) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2457
			if($hidedatafiles[$j]{rom}==$romimage && $hidedatafiles[$j]{spifile} == $spifile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2458
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2459
				push @hidedatainspi, $hidedatafiles[$j]{data}; #push name of data file to be hidden onto array if correct romimage and spi type
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2460
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2461
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2462
		my @spiargs; #arguments passed to createSpi
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2463
		push @spiargs, ("-t$targetspi", "-d\\$thisdir", "-hide@hidedatainspi");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2464
		if($existingspi ne "") { push @spiargs, $existingspi; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2465
		&spitool::createSpi(@spiargs, @dataforspi); # external call to 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2466
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2467
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2468
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2469
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2470
# SPI file creation phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2471
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2472
# If SPI files for resource (.rsc) are required then creates SPI files for each ROM image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2473
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2474
sub spi_creation_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2475
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2476
	my $composite_secondary=-1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2477
	if($createspi) { 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2478
		my $secondary=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2479
		for (my $i=1; $i<8; $i++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2480
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2481
			if($romimage[$i]{composite} eq "composite_secondary") 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2482
				{ $secondary++; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2483
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2484
		if(!$secondary) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2485
			{ $romimage[0]{composite} = "composite_secondary"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2486
		if($secondary>1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2487
			{ print "Warning, more than one composite_primary specified, using image with lowest ROM_IMAGE number\n"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2488
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2489
		foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2490
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2491
			if ($line=~/^\s*REM \s*ROM_IMAGE\[(\d)\]/) # specify which romimage following lines are part of
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2492
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2493
				$romimage=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2494
				$spicount=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2495
			}	elsif ($line =~ /^\s*REM/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2496
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2497
				# ignore any other REM statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2498
			} elsif ($line=~/^\s*spidata\s*=\s*(\S+)\s+(\S+)\s+(\S+)\s(\S+)\s*$/)	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2499
				#spidata=\epoc32\data\Z\Resource\Plugins\Obexclasscontroller.RSC Resource\Plugins\Obexclasscontroller.RSC ecom.spi \private\10003a3f\
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2500
				my $targetspi=$4.$3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2501
				my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2502
				my $i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2503
				for($i=0;$i<$spicount && $flag;$i++) { #loop to see if name of spi file already added to this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2504
					if($spiarray[$romimage][$i]{spi} eq $targetspi) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2505
						$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2506
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2507
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2508
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2509
				if($flag) { # adds spi file if not yet listed for this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2510
					$spiarray[$romimage][$spicount++]={spifile=>$3, spidir=>$4, spi=>$4.$3};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2511
					$i=$spicount;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2512
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2513
					$datafiles[$filescount++]= {data=>$1, rom=>$romimage, spifile=>$i-1}; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2514
                        } elsif ($spiplacement && $line =~/^\s*SPI_POSITION/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2515
        			# mark the image index at which the SPI_POSITION keyword has occured in order to avoid writing duplicate
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2516
        			# entries of the spi file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2517
        			$spipositionflag{$romimage} = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2518
        		} elsif ($line=~/^\s*spidatahide\s*=\s*(\S+)\s+(\S+)\s(\S+)\s*$/)	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2519
				#spidatahide=\epoc32\data\Z\Resource\Plugins\Obexclasscontroller.RSC ecom.spi \private\10003a3f\
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2520
				my $targetspi=$3.$2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2521
				my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2522
				my $i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2523
				for($i=0;$i<$spicount && $flag;$i++) { #loop to see if name of spi file already added to this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2524
					if($spiarray[$romimage][$i]{spi} eq $targetspi) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2525
						$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2526
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2527
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2528
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2529
				if($flag) { # adds spi file if not yet listed for this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2530
					$spiarray[$romimage][$spicount++]={spifile=>$2, spidir=>$3, spi=>$3.$2};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2531
					$i=$spicount;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2532
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2533
					$hidedatafiles[$hidefilescount++]= {data=>$1, rom=>$romimage, spifile=>$i-1}; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2534
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2535
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2536
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2537
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2538
		for(my $i=0;$i<8 && $composite_secondary<0;$i++) { # loop to set $composite_secondary value
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2539
			if($romimage[$i]{composite} eq "composite_secondary") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2540
				$composite_secondary=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2541
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2542
		}	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2543
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2544
		for(my $i=0;$i<8;$i++) { #loop to add any spi files to composite_primary roms which are present in composite_secondary rom. spi files in secondary ROMs must be present in primary ROMS, this check rules out the possibility of the spi file in the primary rom not being created because it has no data files to add
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2545
			if($romimage[$i]{composite} eq "composite_primary") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2546
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2547
				while(defined $spiarray[$composite_secondary][$j]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2548
					my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2549
					my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2550
					while(defined $spiarray[$i][$k] && $flag) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2551
						if($spiarray[$composite_secondary][$j]{spi} eq $spiarray[$i][$k]{spi}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2552
							$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2553
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2554
						$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2555
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2556
					if($flag) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2557
						$spiarray[$i][$k]{spifile}=$spiarray[$composite_secondary][$j]{spifile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2558
						$spiarray[$i][$k]{spidir}=$spiarray[$composite_secondary][$j]{spidir};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2559
						$spiarray[$i][$k]{spi}=$spiarray[$composite_secondary][$j]{spi};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2560
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2561
					$j++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2562
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2563
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2564
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2565
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2566
		for(my $i=0;$i<8;$i++) { #loop to add any spi files to extension roms which are present in core rom, same situation as in previous loop could potentially occur here
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2567
			if($romimage[$i]{extension}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2568
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2569
				while(defined $spiarray[$i-1][$j]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2570
					my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2571
					my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2572
					while(defined $spiarray[$i][$k] && $flag) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2573
						if($spiarray[$i-1][$j]{spi} eq $spiarray[$i][$k]{spi}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2574
							$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2575
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2576
						$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2577
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2578
					if($flag) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2579
						$spiarray[$i][$k]{spifile}=$spiarray[$i-1][$j]{spifile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2580
						$spiarray[$i][$k]{spidir}=$spiarray[$i-1][$j]{spidir};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2581
						$spiarray[$i][$k]{spi}=$spiarray[$i-1][$j]{spi};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2582
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2583
					$j++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2584
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2585
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2586
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2587
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2588
		for(my $i=0;$i<scalar @spiarray;$i++) { #create SPI files for ROMs which are neither composite_primary nor extensions
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2589
			if(!($romimage[$i]{extension}) && $romimage[$i]{composite} ne "composite_primary") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2590
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2591
				while(defined $spiarray[$i][$j]) { 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2592
					create($i,$j++);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2593
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2594
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2595
		}	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2596
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2597
		for(my $i=0;$i<8;$i++) { #create SPI files for ROMs marked as composite_primary
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2598
			if($romimage[$i]{composite} eq "composite_primary") {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2599
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2600
				while(defined $spiarray[$i][$j]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2601
					create($i,$j++,$composite_secondary);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2602
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2603
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2604
		}	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2605
		for(my $i=0;$i<8;$i++) { #create SPI files for ROMs marked as extension
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2606
			if($romimage[$i]{extension}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2607
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2608
				while(defined $spiarray[$i][$j]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2609
					create($i,$j++,$i-1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2610
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2611
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2612
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2613
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2614
		undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2615
		my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2616
        	my $imageIdx=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2617
		foreach $line (@obydata) { #add SPI files to ROM image, adds lines to obey file to specify existing locations of SPI files and target locations.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2618
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2619
                        if($spiplacement){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2620
                                $flag = 0;	# Reset the flag since the spi file must be added to the final OBY only on finding SPI_POSITION 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2621
                                                        # keyword when the spiplacement flag is set. If the spiplacement flag is set but SPI_POSITION
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2622
                                                        # is not found in the oby files, then no spi entry is emitted.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2623
                                if($line =~ /^\s*SPI_POSITION/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2624
                                        next if (!$spipositionflag{$imageIdx});#This spi has already been entered into OBY.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2625
                                        my $spiIdx=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2626
                                        while(defined $spiarray[$imageIdx][$spiIdx]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2627
                                                if($spiarray[$imageIdx][$spiIdx]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2628
                                                        my $targetspi="$1-$imageIdx-$spiIdx\.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2629
                                                        push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$imageIdx][$spiIdx]{spi} . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2630
                                                }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2631
                                                $spiIdx++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2632
                                        }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2633
                                        if($spiIdx == 0){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2634
                                                # If there is no plugin in this image, the SPI_POSITION statement is ignore.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2635
                                                print ("Warning: statement SPI_POSTION ignored as no plugin was found at ROM_IMAGE[${imageIdx}]\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2636
                                        }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2637
                                        $spipositionflag{$imageIdx} = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2638
                                }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2639
                                elsif( $line =~ /REM ROM_IMAGE\[(\d)\]/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2640
                                        $imageIdx = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2641
                                        push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2642
                                }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2643
                                elsif($line =~ /^\s*spidata/i) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2644
                                } else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2645
                                        push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2646
                                }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2647
                        }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2648
			elsif($line =~/REM ROM_IMAGE\[(\d)\]/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2649
				my $romimage=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2650
				if($flag) { #put in SPI files for ROM_IMAGE[0]
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2651
					$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2652
					my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2653
					while(defined $spiarray[0][$k]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2654
						if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2655
							my $targetspi="$1-0-$k\.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2656
							push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi .  "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2657
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2658
						$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2659
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2660
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2661
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2662
				push @newobydata, "\n" . $line . "\n";			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2663
				while(defined $spiarray[$romimage][$j]) { #put in SPI files for current ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2664
					if($spiarray[$romimage][$j]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2665
						my $targetspi="$1-$romimage-$j\.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2666
						push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$romimage][$j]{spidir} . $targetspi .  "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2667
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2668
					$j++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2669
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2670
			} elsif($line =~ /^\s*extensionrom/i) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2671
				if($flag) { #put in SPI files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2672
					my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2673
					while(defined $spiarray[0][$k]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2674
						if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2675
							my $targetspi="$1-0-$k\.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2676
							push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2677
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2678
						$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2679
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2680
					$flag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2681
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2682
				push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2683
			} elsif($line =~ /^\s*spidata/i) {;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2684
			} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2685
				push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2686
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2687
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2688
		if($flag) { #put in SPI files for ROM_IMAGE[0] if it is the only ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2689
			my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2690
			while(defined $spiarray[0][$k]) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2691
				if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2692
					my $targetspi="$1-0-$k\.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2693
					push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2694
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2695
				$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2696
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2697
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2698
		@obydata=@newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2699
	}	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2700
	dump_obydata("tmp6.oby", "result of SPI stage") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2701
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2702
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2703
sub load_featuresutil
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2704
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2705
	&Load_ModuleL("featuresutil");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2706
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2707
	# Parse the feature database XML file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2708
	if(!&featuresutil::parseXMLDatabase($featureXml, $featuremanager, $strict))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2709
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2710
		$featureXml = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2711
		exit(1) if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2712
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2713
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2714
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2715
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2716
# Feature registry configuration file/Features data file generation phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2717
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2718
# If feature registry configuration files/features data files are required then creates these files for
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2719
# each ROM/ROFS image
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2720
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2721
sub featurefile_creation_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2722
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2723
	if($onlysmrimage)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2724
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2725
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2726
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2727
	# Set the name and Rom Image location of feature file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2728
	if ($enforceFeatureManager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2729
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2730
		# features data file location
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2731
		$dir = "private\\10205054\\";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2732
		$featurefilename = "features.dat";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2733
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2734
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2735
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2736
		# feature registry configuration file location
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2737
		$dir = "private\\102744CA\\"; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2738
		$featurefilename = "featreg.cfg";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2739
	}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2740
	if (defined ($featureXml)) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2741
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2742
		my $featurefilecount=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2743
		my $romimage=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2744
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2745
		foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2746
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2747
			# specify which romimage following lines are part of
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2748
			if ($line=~/^\s*REM \s*ROM_IMAGE\[(\d)\]/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2749
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2750
				$romimage=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2751
				$featurefilecount=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2752
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2753
			elsif ($line =~ /^\s*REM/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2754
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2755
				# ignore any other REM statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2756
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2757
			elsif($line =~ /^\s*(FEATURE)\s*(\S*)\s*(.*)/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2758
					|| $line =~ /^\s*(EXCLUDE_FEATURE)\s*(\S*)\s*(.*)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2759
			{				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2760
				# FEATURE  <feature_name>  [ SF  <status falgs> ] [ UD  <user data> ]
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2761
				my $feature = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2762
				my $featurevalue = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2763
				my $featureargs = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2764
				my $reservedbit = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2765
				my %featureflags=();				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2766
				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2767
				# Options 'SF' and 'UD' will be supported only for "-fm" option
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2768
				if ($featuremanager) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2769
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2770
					# [ SF  <status falgs> ] [ UD  <user data> ]
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2771
					$featureargs =~	/(\S*)\s*(\S*)\s*(\S*)\s*(\S*)\s*/ ;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2772
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2773
					# Store the values of 'SF' and 'UD', or any invalid option, if provided					
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2774
					if ($1) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2775
					{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2776
						$featureflags{uc($1)} = $2;						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2777
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2778
					if ($3) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2779
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2780
						$featureflags{uc($3)} = $4;									
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2781
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2782
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2783
					# Generate a warning if the option provided with Feature/Exclude_Feature keyword is  
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2784
					# not 'SF' or 'UD'.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2785
					foreach my $Key (keys %featureflags)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2786
					{						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2787
						if ($Key !~ /^(SF|UD)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2788
						{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2789
							print "Warning: Invalid argument \"$Key\" specified for feature $featurevalue\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2790
							delete $featureflags{$Key};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2791
							next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2792
						}						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2793
					}							
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2794
				}				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2795
				# In verbose mode, generate warning if "SF|UD" arguments or invalid arguments are specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2796
				# for "-f|fr" option.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2797
				elsif ($featureargs && $opt_v)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2798
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2799
					print "Invalid argument(s) \"$featureargs\" provided for feature \"$featurevalue\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2800
					foreach my $Key (keys %featureflags)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2801
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2802
						delete $featureflags{$Key};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2803
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2804
				}				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2805
				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2806
				# The feature file name is of the format featreg.cfg[x-y] or features.dat[x-y] 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2807
				# where x is the romimage id, y is always 0, reserved for future use.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2808
				my $targetfeaturefile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2809
				if (($romimage == 0) && ($reservedbit == 0))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2810
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2811
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2812
					# Core image will not have the mangled name
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2813
				 	$targetfeaturefile = $featurefilename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2814
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2815
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2816
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2817
				 	$targetfeaturefile = $featurefilename . "\[". $romimage . "\-$reservedbit\]";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2818
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2819
				my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2820
				my $featureflag;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2821
				if ($feature =~ /^FEATURE$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2822
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2823
					$featureflag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2824
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2825
				else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2826
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2827
					$featureflag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2828
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2829
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2830
				my $i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2831
 				# loop to see if name of feature file already added to this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2832
				for($i=0;$i<$featurefilecount && $flag;$i++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2833
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2834
					if($featurefilearray[$romimage][$i]{cfgfile} eq $targetfeaturefile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2835
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2836
						$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2837
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2838
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2839
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2840
				if($flag) { # adds feature file if not yet listed for this romimage in array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2841
					$featurefilearray[$romimage][$featurefilecount++]={cfgfile=>$targetfeaturefile, cfgdir=>$dir};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2842
					$i=$featurefilecount;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2843
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2844
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2845
				$featureslist[$featurescount]= {feature=>$featurevalue, include=>$featureflag, rom=>$romimage, cfgfile=>$i-1};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2846
				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2847
				# Store the value of 'SF' in 'featureslist' array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2848
				if (defined $featureflags{SF}) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2849
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2850
					$featureslist[$featurescount]->{SF} = $featureflags{SF};						
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2851
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2852
				# Store the value of 'UD' in 'featureslist' array
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2853
				if (defined $featureflags{UD}) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2854
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2855
					$featureslist[$featurescount]->{UD} = $featureflags{UD};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2856
				}				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2857
				$featurescount++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2858
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2859
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2860
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2861
		# Create Feature File
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2862
		for(my $i=0;$i<scalar @featurefilearray;$i++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2863
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2864
			my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2865
			while(defined $featurefilearray[$i][$j])
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2866
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2867
				my $targetfeaturefile = $featurefilearray[$i][$j]{cfgfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2868
				if (!(&featuresutil::createFeatureFile($i,$j,$targetfeaturefile,\@featureslist,$featuremanager))) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2869
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2870
					$featurefilearray[$i][$j]{cfgfile}= undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2871
					exit(1) if($strict);					
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2872
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2873
				$j++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2874
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2875
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2876
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2877
		undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2878
		my $flag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2879
        	my $imageIdx=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2880
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2881
		# Add feature files to ROM image, adds lines to obey file to specify existing locations
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2882
		# of feature files and target locations.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2883
		foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2884
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2885
			if($line =~/REM ROM_IMAGE\[(\d)\]/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2886
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2887
				my $romimage=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2888
				if($flag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2889
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2890
					# Put in feature files for ROM_IMAGE[0]
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2891
					$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2892
					my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2893
					while(defined $featurefilearray[0][$k])
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2894
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2895
						my $targetfeaturefile=$featurefilearray[0][$k]{cfgfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2896
						if (defined $targetfeaturefile) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2897
						{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2898
							push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile .  "\"\n";							
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2899
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2900
						$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2901
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2902
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2903
				push @newobydata, "\n" . $line . "\n";			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2904
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2905
				my $j=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2906
				while(defined $featurefilearray[$romimage][$j])
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2907
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2908
					# Put in feature files for current ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2909
					my $targetfeaturefile=$featurefilearray[$romimage][$j]{cfgfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2910
					
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2911
					# Rom images will not have mangled name for feature files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2912
				 	my $destinationfeaturefile = $featurefilename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2913
					
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2914
					# Rofsbuild will set attribute 'exattrib=U' in the entry record when this field is used.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2915
					# File Server when asked for a directory listing would notice the attribute and will return the 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2916
					# list with mangled names. Hence, mangled name for feature files should not be put in ROM_IMAGE.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2917
					my $exattribute = "exattrib=U";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2918
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2919
					if (defined $targetfeaturefile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2920
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2921
						push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[$romimage][$j]{cfgdir} . $destinationfeaturefile .  "\"\t\t" . $exattribute . "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2922
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2923
					$j++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2924
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2925
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2926
			elsif($line !~ /^\s*(FEATURE)\s*/i && $line !~ /^\s*(EXCLUDE_FEATURE)\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2927
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2928
				# Put in all other lines except the FEATURE and EXCLUDE_FEATURE keywords
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2929
				push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2930
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2931
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2932
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2933
		if($flag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2934
		{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2935
			# Put in feature files for ROM_IMAGE[0] if it is the only ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2936
			my $k=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2937
			while(defined $featurefilearray[0][$k])
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2938
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2939
				my $targetfeaturefile = $featurefilearray[0][$k]{cfgfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2940
				if (defined $targetfeaturefile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2941
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2942
					push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2943
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2944
				$k++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2945
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2946
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2947
		@obydata=@newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2948
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2949
	elsif ($enforceFeatureManager && $noFeatureManager && $preBuiltFeaturesDataFile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2950
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2951
        print "Valid: $preBuiltFeaturesDataFile\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2952
		if (-e $preBuiltFeaturesDataFile) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2953
		{			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2954
			my @newobydata = ();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2955
			my $flag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2956
			foreach my $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2957
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2958
				# Put in the pre-built features data file in ROM_IMAGE[0] 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2959
				if($line =~/REM ROM_IMAGE\[1\]/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2960
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2961
					push @newobydata, "data=$preBuiltFeaturesDataFile" . " \"" . $dir . $featurefilename . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2962
					$flag =0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2963
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2964
				push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2965
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2966
			if($flag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2967
			{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2968
				# Put in the pre-built features data file in ROM_IMAGE[0] if it is the only ROM_IMAGE
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2969
				push @newobydata, "data=$preBuiltFeaturesDataFile" . " \"" . $dir . $featurefilename . "\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2970
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2971
			@obydata =  @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2972
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2973
		else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2974
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2975
			print "Error: File \"$preBuiltFeaturesDataFile\" doesn't exist.\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2976
			exit(1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2977
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2978
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2979
	elsif ($enforceFeatureManager)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2980
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2981
	    print "Error: no feature data file or pre-built feature data file is provided!";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2982
	    exit(1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2983
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2984
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2985
my ($fromABI,$toABI) = split / /,$abiDowngrade;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2986
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2987
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2988
# Problem suppression phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2989
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2990
# Downgrade files which don't exist for the ABI (if a downgrade path is specified)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2991
# Comment out missing files or report errors if strict option enabled
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2992
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2993
# Detect any references to Feature Variant binaries and substitute in the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2994
# correct source binary name using the VMAP file mechanism.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2995
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2996
sub suppress_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2997
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2998
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2999
	Plat_Init($PerlLibPath);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3000
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3001
	# use the "default" feature variant by default.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3002
	my $varname = $featureVariant{'VALID'} ? $featureVariant{'NAME'} : "default";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3003
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3004
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3005
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3006
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3007
		if ($line =~ /^\s*REM/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3008
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3009
			# ignore REM statements, to avoid processing "REM data=xxx yyy"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3010
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3011
		# 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3012
		# thing=some\file 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3013
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3014
		elsif ($line =~ /(\S+)\s*=\s*"?(\S+\\\S+)"?/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3015
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3016
			my $what = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3017
			my $filename = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3018
			if ($line =~ /(\S+)\s*=\s*"([^"]+)"/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3019
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3020
				$filename = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3021
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3022
			my $normedFilename = &Genutl_NormaliseVersionedName($filename);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3023
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3024
			# find all the alternative file locations
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3025
			my @alternatives = fallback($normedFilename);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3026
			# test the original location first
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3027
			unshift(@alternatives, $normedFilename);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3028
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3029
			# choose the first file location that actually exists
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3030
			my $fileExists = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3031
			foreach my $altFile (@alternatives)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3032
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3033
			    my $tmpPath;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3034
			    my $tmpFile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3035
				if($altFile =~ /"?(.*\\arm\w+_?\w+)\\([^"]+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3036
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3037
					$tmpPath = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3038
					$tmpFile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3039
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3040
				$tmpPath .= "\.$varname";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3041
				if (-d $tmpPath){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3042
				  if (-e $tmpPath ."\\$tmpFile"){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3043
				   $fileExists = $tmpPath . "\\$tmpFile";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3044
				  }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3045
				  elsif (-e $altFile){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3046
				   $fileExists = $altFile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3047
				  }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3048
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3049
				else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3050
				  $fileExists = featurevariantmap->Find($altFile, $varname);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3051
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3052
				last if $fileExists;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3053
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3054
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3055
			# edit the OBY line to use the actual file name which we found.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3056
			# (maybe) warn if an alternative to the original was selected.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3057
			if ($fileExists)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3058
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3059
				my $from = $filename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3060
				$from =~ s/\\/\\\\/g;		# need to escape backslashes
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3061
				$from =~ s/(\[|\])/\\$1/g;	# need to escape square brackets for file names like "featreg.cfg[x-y]",etc.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3062
				my $into = $fileExists;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3063
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3064
 				$line =~ s/$from/$into/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3065
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3066
 				if ($warnSelection && ($fileExists ne $normedFilename))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3067
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3068
			    	print "replaced $filename with $fileExists\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3069
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3070
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3071
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3072
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3073
   				# No suitable alternative was found, so comment out the line unless
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3074
				# it is a manatory ROMBUILD keyword, in which case it is better
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3075
				# to let ROMBUILD report the missing file rather than report the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3076
				# missing keyword.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3077
   				if ($what !~ /^bootbinary|variant|primary|secondary|hide/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3078
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3079
   					$line = "REM MISSING " . $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3080
   					print_source_error("Missing file: '$filename' in statement '$what='");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3081
					print "\ttried @alternatives\n"  if ($opt_v && @alternatives > 1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3082
   					# treat as an error if the strict option is selected.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3083
   					$errors++ if ($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3084
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3085
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3086
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3087
			# Once the binary is located in the appropriate ABI directory (e.g.,following the binary 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3088
			# selection order), check if the binary has been used in a patch dll statement. This is
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3089
			# required to find out the source file. In ABIv1, the source file is required to find the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3090
			# .map file, while, in ABIv2, the destination file gives the dso file name.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3091
			if($line =~ /(\S+)\s*=\s*(\S+)\s+(\S+)\s*(.*)?/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3092
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3093
				my $aSrcfile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3094
				my $dstFile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3095
				my $dstPath = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3096
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3097
				if($aSrcfile =~ /"?([^"]+)/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3098
				$aSrcfile = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3099
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3100
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3101
				$aSrcfile = &Genutl_NormaliseVersionedName($aSrcfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3102
				if($dstFile =~ /"?(.*)\\([^"]+)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3103
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3104
					$dstPath = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3105
					$dstFile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3106
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3107
				my $dllMapKey = lc ($dstFile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3108
				if(exists $DllDataMap{$dllMapKey}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3109
					my $dllSymInfo = \%{$DllDataMap{$dllMapKey}};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3110
					$dllSymInfo->{srcfile} = $aSrcfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3111
					$dllSymInfo->{dstpath} = $dstPath;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3112
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3113
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3114
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3115
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3116
		push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3117
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3118
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3119
	dump_obydata("tmp7.oby", "result of problem-suppression phase") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3120
	die "ERROR: $errors missing file(s) detected\n" if ($strict && $errors );
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3121
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3122
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3123
# Remove leading and trailing whitespaces from a list of strings or a single string
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3124
sub trim 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3125
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3126
	my @out = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3127
	for (@out) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3128
		s/^\s+//;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3129
		s/\s+$//;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3130
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3131
	return wantarray ? @out : $out[0];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3132
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3133
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3134
# Generate a list of alternative locations for the given filename
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3135
sub fallback
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3136
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3137
   	my $file = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3138
   	my @alternatives = CheckCustomization($file);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3139
 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3140
 	# If BINARY_SELECTION_ORDER macro is specified in the oby file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3141
 	if ($binarySelectionOrderFlag)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3142
   	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3143
 		# Search in the specified binary order 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3144
 		if(!defined(@Global_PlatList))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3145
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3146
			@Global_PlatList = Plat_List();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3147
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3148
 		my $b;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3149
 		my $e;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3150
 		foreach my $plat (@Global_PlatList) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3151
  		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3152
  			if ($file =~ /^(.*)\\$plat\\(.*)$/i) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3153
  			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3154
  				$b = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3155
  				$e = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3156
 				last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3157
 			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3158
 		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3159
 		push(@alternatives, "$b\\$firstDIR\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3160
 			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3161
 		foreach my $toDIR (@binarySelectionOrder)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3162
   		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3163
 			push(@alternatives, "$b\\$toDIR\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3164
   		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3165
   	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3166
  	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3167
 	# If the file is not found in the specified ABIV2 platform, then select from ARMV5 directory.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3168
 	# This is necessary as some of the runtime DLLs will be present only in ARMV5 directory. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3169
	# Add the BPABI Platforms to be added
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3170
	if(!defined(@Global_BPABIPlats))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3171
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3172
		@Global_BPABIPlats = &BPABIutl_Plat_List;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3173
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3174
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3175
 	foreach my $BpabiPlat (@Global_BPABIPlats)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3176
 	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3177
 		if ($fromABI eq "" && $file =~ /^(.*)\\$BpabiPlat\\(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3178
   		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3179
 			push(@alternatives, "$1\\armv5\\$2");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3180
   		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3181
   	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3182
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3183
	if ($customizedPlat && $fromABI eq "" && $file =~ /^(.*)\\$customizedPlat\\(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3184
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3185
		my $b = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3186
		my $e = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3187
		# if platform customization 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3188
		my $rootPlat = Plat_Root($customizedPlat);		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3189
        
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3190
   		#Check in ARMV7 folder for binaries in case GCCEV7 is used [DEF128457 ]
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3191
   		if($customizedPlat == "GCCEV7")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3192
   		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3193
   			push(@alternatives,"$b\\armv7\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3194
   		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3195
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3196
		if( grep /$rootPlat/, @Global_BPABIPlats)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3197
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3198
 			push(@alternatives, "$b\\armv5\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3199
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3200
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3201
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3202
	if ($fromABI eq "" && $file =~ /^(.*)\\ARMV5_ABIV1\\(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3203
   	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3204
 		push(@alternatives, "$1\\armv5\\$2");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3205
   	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3206
  		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3207
   	if ($fromABI ne "" && $file =~ /^(.*)\\$fromABI\\(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3208
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3209
 		push(@alternatives, "$1\\$toABI\\$2");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3210
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3211
   
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3212
   	return @alternatives;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3213
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3214
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3215
# Generate a list of alternative locations for the given filename which
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3216
# result from the possible platform customizations.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3217
sub CheckCustomization
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3218
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3219
 	my $file = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3220
 	my @alternatives;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3221
	$customizedPlat = undef;	# global (used in feedback)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3222
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3223
 	if(!defined(@Global_PlatList))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3224
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3225
		@Global_PlatList = Plat_List();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3226
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3227
 	foreach my $plat (@Global_PlatList) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3228
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3229
 		if ($file =~ /^(.*)\\$plat\\(.*)$/i) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3230
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3231
 			my $b = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3232
 			my $e = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3233
 			my $root = Plat_Customizes($plat);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3234
 			if ($root) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3235
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3236
				# Preserve the plat that is customized
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3237
				$customizedPlat = $plat;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3238
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3239
				# If a BSF platform customizes another BSF platform (i.e. a
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3240
				# BSF hierarchy exists), look for the file starting from the
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3241
				# child BSF platform and working back to the root BSF platform
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3242
				while ($root)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3243
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3244
					push(@alternatives, "$b\\$root\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3245
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3246
					# Temporary special case for ARMV5_ABIV1 and ARMV5_ABIV2
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3247
					if ($root =~ /^armv5_abiv[12]$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3248
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3249
						push(@alternatives, "$b\\armv5\\$e");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3250
 					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3251
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3252
					$root = Plat_Customizes($root);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3253
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3254
 			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3255
			return @alternatives;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3256
 		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3257
 	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3258
	return @alternatives;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3259
}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3260
   
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3261
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3262
# Bitmap and aif conversion phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3263
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3264
# Convert any "bitmap=" or "compressed-bitmap=" files into ROM format bitmaps
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3265
# Convert any "auto-bitmap=" to handle bitmap appropriately for xip and non-xip images
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3266
# Convert "aif=" files appropriately for xip and non-xip images
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3267
sub bitmap_aif_converison_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3268
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3269
	my $is_xip=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3270
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3271
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3272
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3273
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3274
		# keep track of the XIP-ness of this rom partition
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3275
		if ($line =~ /^\s*REM ROM_IMAGE\[(\d+)\]\s+(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3276
		{ $is_xip=$romimage[$1]{xip}; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3277
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3278
		# aif=source dest 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3279
		# include aif file - use XIP version for XIP roms if it exists, otherwise use the file specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3280
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3281
		if ($line =~ /^\s*aif=/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3282
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3283
			my $xip="_xip";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3284
			my @aif= split(/\s+/,$line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3285
			my $path=Path_Split('Path',"$aif[0]");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3286
			my $base=Path_Split('Base',"$aif[0]");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3287
			$path =~ s/^....//;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3288
			my $ext=Path_Split('Ext',"$aif[0]");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3289
			if ($is_xip && (-e "$path$base$xip$ext"))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3290
			{ $line="data=$path$base$xip$ext\t\t$aif[1]\n"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3291
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3292
			{ $line="data=$path$base$ext\t\t$aif[1]\n"; }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3293
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3294
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3295
		# auto-bitmap=
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3296
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3297
		# if currently in XIP image, then use a compressed-bitmap
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3298
		# otherwise use a RAM format bitmap
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3299
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3300
		if ($line =~ /^\s*auto-bitmap=/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3301
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3302
			if ($is_xip)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3303
			{ $line =~ s/auto-bitmap=/compressed-bitmap=/i }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3304
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3305
			{ $line =~ s/auto-bitmap=/data=/i }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3306
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3307
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3308
		# uncompressed-bitmap
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3309
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3310
		# this is currently just a synonym for 'bitmap'
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3311
		$line =~ s/uncompressed-bitmap=/bitmap=/i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3312
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3313
		# 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3314
		# bitmap=source dest 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3315
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3316
		if ($line =~ /^\s*bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3317
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3318
			my $mbm = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3319
			my $dest = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3320
			my $rom_mbm = "$1_rom";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3321
			if ($is_xip eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3322
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3323
				# non-XIP rom - just include the mbm file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3324
				$line = "data=\"$mbm\"\t\"$dest\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3325
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3326
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3327
			{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3328
		        if (! -e $rom_mbm || -M $rom_mbm >= -M $mbm)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3329
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3330
				    system "bmconv /q /r $rom_mbm /m$mbm";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3331
				    my $bmconv_status = $?;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3332
				    die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $rom_mbm);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3333
			    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3334
				$line = "data=\"$rom_mbm\"\t\"$dest\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3335
				push @tempfiles, $rom_mbm;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3336
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3337
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3338
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3339
		# compressed-bitmap=
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3340
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3341
		# if file is a compressed ROM image file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3342
		elsif ($line =~ /^\s*compressed-bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3343
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3344
			my $mbm = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3345
			my $dest = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3346
			my $cmprssd_rom_mbm = "$1_rom";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3347
			if ($is_xip eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3348
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3349
				# non-XIP rom - just include the mbm file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3350
				$line = "data=\"$mbm\"\t\"$dest\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3351
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3352
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3353
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3354
				if (! -e $cmprssd_rom_mbm || -M $cmprssd_rom_mbm >= -M $mbm)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3355
			    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3356
				    system "bmconv /q /s $cmprssd_rom_mbm /m$mbm";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3357
				    my $bmconv_status = $?;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3358
				    die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $cmprssd_rom_mbm);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3359
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3360
				$line = "data=\"$cmprssd_rom_mbm\"\t\"$dest\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3361
				push @tempfiles, $cmprssd_rom_mbm;			    
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3362
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3363
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3364
		push @newobydata, $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3365
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3366
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3367
	dump_obydata("tmp8.oby", "result of bitmap conversion phase") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3368
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3369
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3370
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3371
sub reformat_line($)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3372
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3373
	my ($line) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3374
	my $type = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3375
	my $variant = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3376
	my $pcfile = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3377
	my $romfile = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3378
	my $tail = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3379
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3380
	# time=21/07/1999 12:00:00
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3381
	# primary[0x09080004]   =\epoc32\release\misa\udeb\ekern.exe
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3382
	# data=\epoc32\wins\C\System\Alarms\churchbell.snd    "System\Alarms\Church bell"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3383
	# file[0x07060001]=\epoc32\release\MAWD\urel\cAkyb1.dll          System\Libs\EKeyb.dll
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3384
	# file=\epoc32\release\marm\urel\eikcore.dll 			System\Libs\Eikcore.dll
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3385
	# alias \System\Bin\DRTRVCT2_2.dll 			\System\Bin\DRTRVCT2_1.dll
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3386
	#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3387
	if ($line =~ /^\s*TIME\s*=\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3388
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3389
		return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3390
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3391
  	elsif($line =~ /^\s*volume\s*=.*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3392
  	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3393
  		return $line;		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3394
  	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3395
	elsif($line =~ /^\s*kerneltrace\s*=.*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3396
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3397
		return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3398
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3399
	if ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+"\\?(.*)"(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3400
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3401
		$type = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3402
		$variant = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3403
		$pcfile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3404
		$romfile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3405
		$tail = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3406
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3407
	elsif ($line =~ /^\s*(\S+)(\[\S+\])\s*=\s*(\S+)\s+\\?(\S+)(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3408
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3409
		$type = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3410
		$variant = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3411
		$pcfile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3412
		$romfile = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3413
		$tail = $5;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3414
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3415
	elsif ($line =~ /(\S+)\s*=\s*"([^"]+)"\s+"\\?(.*)"(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3416
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3417
		if ($line !~ /^REM MISSING/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3418
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3419
			$type = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3420
			$variant = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3421
			$pcfile = "\"$2\"";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3422
			$romfile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3423
			$tail = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3424
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3425
		else{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3426
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3427
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3428
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3429
	elsif ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+\\?(\S+)(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3430
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3431
		$type = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3432
		$variant = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3433
		$pcfile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3434
		$romfile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3435
		$tail = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3436
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3437
	elsif($line =~ /^\s*(patchdata)\s*(\S+)\s*\@\s*(\S+)\s+(\S+)/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3438
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3439
		# Reformat the patchdata statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3440
		my $romfilename = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3441
		my $patchdlldatamap_key = lc ($romfilename);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3442
		my $symbolname = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3443
		my $value = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3444
		my ($index, $elementSize);		# For when the symbol is an array, and we're patching one element
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3445
		my $scalarSize;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3446
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3447
		if(!defined $DllDataMap{$patchdlldatamap_key}->{dstpath}){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3448
			print_source_error(" File $romfilename has not been included into ROM image");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3449
			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3450
			$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3451
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3452
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3453
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3454
		if ($enforceSysBin)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3455
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3456
			if ($DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\\bin/i 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3457
			 && $DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3458
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3459
				$DllDataMap{$patchdlldatamap_key}->{dstpath} = "sys\\bin";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3460
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3461
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3462
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3463
		my $dllfile = $DllDataMap{$patchdlldatamap_key}->{dstpath} . "\\". $romfilename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3464
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3465
		$line = "$1  ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3466
		$line .= "$dllfile ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3467
 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3468
		# Convert value into decimal (used to be done in AddDllDataInfo, but that limited us to
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3469
		# one value per symbol, and we now support patching arrays, e.g. the Hal's InitialValue[],
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3470
		# so we can't do it that way any more.)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3471
		if ($value =~ /^0x([0-9a-f]+)$/i) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3472
			$value = hex($1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3473
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3474
		elsif ($value =~ /^(-?\d+)$/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3475
			$value = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3476
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3477
		else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3478
			print_source_error("Attempt to set $symbolname to illegal value $value");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3479
			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3480
			$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3481
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3482
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3483
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3484
		if ($symbolname =~ s/:(\d+)\[((0x)?[0-9a-f]+)\]$//i) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3485
			($index, $elementSize) = ($2, $1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3486
			$index = hex($index) if $index =~ /^0x/i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3487
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3488
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3489
		my $DllSymInfoRef = $DllDataMap{$patchdlldatamap_key}->{$symbolname};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3490
 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3491
		if (!defined($DllSymInfoRef->{size})) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3492
			print_source_error("Size for symbol $symbolname not found");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3493
			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3494
			$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3495
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3496
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3497
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3498
		if (defined($elementSize)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3499
			$scalarSize = $elementSize / 8;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3500
			if ($scalarSize != 1 && $scalarSize != 2 && $scalarSize != 4) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3501
				print_source_error("Invalid bit size $elementSize for array $symbolname in $romfilename");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3502
				$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3503
				$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3504
				return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3505
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3506
			if (($index + 1) * $scalarSize > $DllSymInfoRef->{size}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3507
				print_source_error("Invalid index $index into array $symbolname in $romfilename");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3508
				$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3509
				$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3510
				return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3511
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3512
		} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3513
			$scalarSize = $DllSymInfoRef->{size};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3514
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3515
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3516
		my $max_value = 0xffffffff;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3517
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3518
		if ($scalarSize == 1) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3519
			$max_value = 0xff;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3520
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3521
		elsif ($scalarSize == 2) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3522
			$max_value = 0xffff;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3523
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3524
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3525
		if ($value > $max_value) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3526
			$value &= $max_value;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3527
			print "$DllSymInfoRef->{obyfilename}($DllSymInfoRef->{lineno}): Warning:Value overflow of $symbolname\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3528
			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3529
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3530
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3531
		if(defined $DllSymInfoRef->{ordinal}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3532
			if (defined($elementSize)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3533
				my $ord = $DllSymInfoRef->{ordinal};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3534
				my $offset = $index * $scalarSize;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3535
				$line .= "ordinal $ord+$offset ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3536
			} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3537
				$line .= "ordinal ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3538
				$line .= $DllSymInfoRef->{ordinal} . " ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3539
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3540
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3541
		elsif(defined $DllSymInfoRef->{dataAddr}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3542
			if (defined($elementSize)) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3543
				my $addr = $DllSymInfoRef->{dataAddr};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3544
				$addr = hex($addr) if $addr =~ /^0x/i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3545
				$addr = sprintf("0x%08x", $addr + $index * $scalarSize);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3546
				$line .= "addr $addr ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3547
			} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3548
				$line .= "addr ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3549
				$line .= $DllSymInfoRef->{dataAddr} . " ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3550
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3551
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3552
		else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3553
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3554
			print_source_error("Ordinal or Address for exported symbol $symbolname in $romfilename couldn't be located");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3555
			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3556
			$line = "REM $line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3557
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3558
		};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3559
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3560
		$line .= "$scalarSize $value\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3561
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3562
		return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3563
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3564
	elsif ($line =~ /^\s*(\S+)\s*(\S+)\s+\\?(\S+)(.*)$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3565
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3566
		$type = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3567
		$variant = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3568
		$pcfile = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3569
		$romfile = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3570
		$tail = $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3571
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3572
		if ($type !~ /^(alias)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3573
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3574
			# Return now, if it is not an 'alias'.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3575
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3576
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3577
		else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3578
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3579
			# There is no substitution needed for SysBin 'alias'es.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3580
			if ($romfile =~ /^sys\\bin\\/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3581
			  ||$romfile =~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3582
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3583
				return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3584
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3585
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3586
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3587
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3588
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3589
		return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3590
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3591
 	# Buildrom should generate warning when destination path provided for a file 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3592
 	# is not a standard path(as per platsec) and "PlatSecEnforceSysBin" is turned off. 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3593
 	my $warnFlag = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3594
	my $mustBeSysBin = $enforceSysBin;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3595
	if ($type =~ /^(data|compress|nocompress)$/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3596
		&& $romfile !~ /^system\\(bin|libs|programs)\\/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3597
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3598
		$mustBeSysBin = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3599
 		$warnFlag = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3600
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3601
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3602
	if ($mustBeSysBin)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3603
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3604
		if ($type =~ /^(alias)$/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3605
			&& $romfile !~ /^sys\\bin\\/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3606
			&& $romfile !~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3607
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3608
			# for multilinguify 'alias'es (generally resource files) 'MustBeSysBin' should not be enforced.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3609
			if($romfile =~ /\.rsc$/i || defined($multiLinguifyAlias{$pcfile})) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3610
				return $line;  
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3611
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3612
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3613
			my $filename = "\\$romfile";	# in case no path is specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3614
			$filename = substr $filename, rindex($filename, "\\");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3615
			$romfile = "sys\\bin".$filename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3616
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3617
			if ($pcfile !~ /^sys\\bin\\/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3618
			    && $pcfile !~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3619
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3620
				my $pcfilename = "\\$pcfile";	# in case no path is specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3621
				$pcfilename = substr $pcfilename, rindex($pcfilename, "\\");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3622
				$pcfile = "sys\\bin".$pcfilename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3623
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3624
			return "$type$variant $pcfile \t$romfile$tail\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3625
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3626
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3627
		if ($romfile !~ /^sys\\bin\\/i
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3628
		    && $romfile !~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3629
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3630
			my $filename = "\\$romfile";	# in case no path is specified
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3631
			$filename = substr $filename, rindex($filename, "\\");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3632
			$romfile = "sys\\bin".$filename;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3633
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3634
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3635
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3636
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3637
 		if ($warnFlag && $romfile !~ /^sys\\bin\\/i && $romfile !~ /^sys\/bin/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3638
 		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3639
 			print "Warning: Outside standard path at \"$line\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3640
 		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3641
		if ($type =~ /^(alias)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3642
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3643
			# Return the line as it is for non-MustBeSysBin 'alias'es.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3644
			return $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3645
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3646
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3647
	$romfiles{$romfile} = $variant.$pcfile;
1
aa7fc13e36fb Add iby file information to ROM directory listing, and update original/syborg.dir
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
  3648
	$ibyfiles{$romfile} = $sourcefile;
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3649
	return "$type$variant=$pcfile \t\"$romfile\"$tail\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3650
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3651
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3652
my @hidearray;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3653
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3654
sub mark
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3655
{ # function to mark files in ROMs as hidden
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3656
	my ($base,$ext) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3657
	my $i=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3658
	my @coreimagerange = (-1,-1); #coreimagerange stores the places within @hidearray where the $base files start and end
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3659
	my @extensionimagerange = (-1,-1); #extensionimagerange stores the places within @hidearray where the $ext files start and end
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3660
	for(my $i=0;$i<scalar @hidearray;$i++) { #loop sets values in @coreimagerange and in @extensionimagerange
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3661
		if($hidearray[$i]{rom}==$base) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3662
			if($coreimagerange[0]<0) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3663
				$coreimagerange[0]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3664
				$coreimagerange[1]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3665
			} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3666
				$coreimagerange[1]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3667
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3668
		} elsif($hidearray[$i]{rom}==$ext) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3669
			if($extensionimagerange[0]<0) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3670
				$extensionimagerange[0]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3671
				$extensionimagerange[1]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3672
			} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3673
				$extensionimagerange[1]=$i;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3674
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3675
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3676
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3677
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3678
	for(my $i=$extensionimagerange[0];$i<=$extensionimagerange[1];$i++) { #loop marks files which need to be hidden based on the values in @coreimagerange and in @extensionimagerange
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3679
		for(my $j=$coreimagerange[0];$j<=$coreimagerange[1];$j++) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3680
			if($hidearray[$i]{dest} eq $hidearray[$j]{dest}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3681
				$hidearray[$i]{hide}=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3682
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3683
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3684
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3685
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3686
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3687
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3688
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3689
# Cleaning phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3690
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3691
# Remove "REM defined", "REM handled"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3692
# Remove the "# lineno" information
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3693
# Collapse multiple blank lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3694
# Apply the PlatSecEnforceSysBin setting
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3695
# Produce ROM directory listing
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3696
# Identify the ROM image name
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3697
sub cleaning_phase
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3698
{	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3699
	my $romname;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3700
	my $skippingBlanks=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3701
	undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3702
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3703
    if($opt_v)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3704
    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3705
	  my $logWin = "logwin.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3706
	  my $logLinux = "loglinux.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3707
	  unlink($logWin);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3708
	  unlink($logLinux);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3709
	  open LOGWIN, ">$logWin" or die("* Can't create $logWin\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3710
	  open LOGLINUX, ">$logLinux" or die("* Can't create $logLinux\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3711
    }	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3712
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3713
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3714
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3715
		track_source($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3716
		if ($line=~/^REM (defined|handled)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3717
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3718
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3719
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3720
		if ($line=~/^# (\d+) "(.*)"/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3721
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3722
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3723
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3724
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3725
		# Blank line compression
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3726
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3727
		if ($line=~/^\s*$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3728
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3729
			if ($skippingBlanks==1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3730
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3731
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3732
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3733
			$skippingBlanks=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3734
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3735
		else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3736
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3737
			$skippingBlanks=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3738
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3739
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3740
		# Track ROMNAME, allowing overrides
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3741
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3742
		if ($line=~/romname\s*=\s*"?(\S+)\.(\S+)"?\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3743
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3744
			if ($romname ne "" && $opt_o eq "")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3745
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3746
				print_source_error("Overrides previous ROM name $romname");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3747
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3748
			$rombasename = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3749
			$romname = "$1.$2";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3750
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3751
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3752
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3753
		# ROM directory listing
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3754
		#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3755
		    my $newline = reformat_line($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3756
	    if( ($newline !~ /^\s*TIME\s*=\s*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3757
  	      &&($newline !~ /^\s*volume\s*=.*/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3758
	      &&($newline !~ /^\s*kerneltrace\s*=.*/i))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3759
	    {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3760
	        my $tmpline = $newline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3761
	        if($^O =~ /^MSWin32$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3762
	        {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3763
	          $newline =~ s-\/-\\-go;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3764
	          if($opt_v)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3765
	          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3766
                print LOGWIN $newline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3767
	            $tmpline =~ s-\\-\/-go;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3768
	            print LOGLINUX $tmpline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3769
	          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3770
	        }else #unix os
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3771
	        {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3772
	          $newline =~ s-\\-\/-go;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3773
	          if($opt_v)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3774
	          {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3775
	            print LOGLINUX $newline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3776
	            $tmpline =~ s-\/-\\-go;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3777
	            print LOGWIN $tmpline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3778
	          }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3779
	        }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3780
	    }
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3781
	    
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3782
		push @newobydata, $newline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3783
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3784
	if($opt_v)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3785
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3786
	  close LOGWIN;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3787
	  close LOGLINUX;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3788
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3789
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3790
	exit(1) if($errors && $strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3791
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3792
	# Handle ROMNAME and possible -o override
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3793
	if ($opt_o ne "")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3794
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3795
		$romname=$opt_o;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3796
		if ($opt_o=~/(\S+)\.(\S+)/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3797
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3798
			$rombasename=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3799
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3800
		else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3801
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3802
			$rombasename=$romname;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3803
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3804
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3805
	if(!$onlysmrimage)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3806
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3807
		unshift @newobydata, "romname=$romname\n";	# first line of final OBY file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3808
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3809
	@obydata = @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3810
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3811
	print "* Removing previous image and logs...\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3812
	unlink glob("$rombasename.*");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3813
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3814
	my $obyrecordline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3815
	if($createspi) {# section added to mark SPI files in core images as hidden (if appropriate) if extension ROMs are being produced
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3816
		my $imagenum=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3817
		my $count=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3818
		foreach my $line (@obydata) { # fill @hidearray with all file= or data= entries from @obydata, recording which image they are in and their target destination
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3819
			if($line =~/^\s*(file|data)\s*=\s*(\S+)\s+(\S+)\s*$/gi) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3820
				$hidearray[$count] = {rom=>$imagenum, type=>$1, dest=>$3};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3821
				$hidearray[$count]{dest} =~s/\"//g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3822
				$count++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3823
			} elsif($line =~/^\s*REM\s+ROM_IMAGE\[(\d)\]\s*$/i ) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3824
				$imagenum=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3825
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3826
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3827
		for(my $i=0;$i<8;$i++) { #loop to mark files in @hidearray as hidden, does not add the hide= lines to the obey files
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3828
			if($romimage[$i]{extension}) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3829
				mark($i-1,$i);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3830
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3831
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3832
		undef @newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3833
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3834
		my $hideflag=0; # is set to 1 if there are files which need to be hidden, determines whether to run next section of code 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3835
		for(my $i=0;$i<scalar @hidearray;$i++) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3836
			if($hidearray[$i]{hide}==1) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3837
				$hideflag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3838
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3839
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3840
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3841
		my $obeyrom=0;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3842
		if($hideflag) { #if there exist files which need hiding
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3843
			my $i=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3844
			my $exitflag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3845
			$obyrecordline=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3846
			for(;$obyrecordline<scalar @obydata && !$exitflag;) { # nested for loops produce new obey file in @newobydata, including hide= lines
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3847
				print "Line = $obyrecordline $i " . scalar @hidearray . "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3848
				if($i==scalar @hidearray) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3849
					$exitflag=1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3850
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3851
				for(;$i<scalar @hidearray;$i++) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3852
					if($hidearray[$i]{hide}==1) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3853
						my $rom=$hidearray[$i]{rom};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3854
						my $destination=$hidearray[$i]{dest};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3855
						while($obeyrom<$rom && $obyrecordline<scalar @obydata) { #pushes lines to @newobydata until specified rom is reached
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3856
							push @newobydata, $obydata[$obyrecordline];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3857
							if($obydata[$obyrecordline] =~/^\s*REM\s+ROM_IMAGE\[(\d)\]\s*$/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3858
								$obeyrom=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3859
							}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3860
							$obyrecordline++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3861
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3862
						my $flag=1; #get to here when $obeyrom==$rom
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3863
						while($flag && $obyrecordline<scalar @obydata) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3864
							$destination=~s|\\|/|g;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3865
							my $obyline=$obydata[$obyrecordline];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3866
							$obyline=~s|\\|/|g;			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3867
							if($obyline=~m/$destination/) { # if the line in the obeyfile matches the destination of the specified spi file then a hide= line is added before the spi file's data= line
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3868
								push @newobydata, "hide=$hidearray[$i]{dest}\n$obydata[$obyrecordline]";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3869
								$obyrecordline++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3870
								$flag=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3871
							} else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3872
								push @newobydata, $obydata[$obyrecordline++];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3873
							}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3874
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3875
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3876
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3877
			}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3878
		}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3879
		while($obyrecordline< scalar @obydata) { # add the rest of the lines from @obydata to @newobydata
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3880
			push @newobydata, $obydata[$obyrecordline++];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3881
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3882
		@obydata=@newobydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3883
		undef @newobydata;	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3884
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3885
	dump_obydata("tmp9.oby", "result of cleaning phase") if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3886
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3887
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3888
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3889
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3890
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3891
# Divide the oby file into multiple sections - one for each rom image - ready
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3892
# for the appropriate rom builder.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3893
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3894
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3895
sub generate_romheader
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3896
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3897
	my ($idx) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3898
	if ($romimage[$idx]{xip} ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3899
	{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3900
		my $header = "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3901
		if ($romimage[$idx]{extension})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3902
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3903
			$header = "extensionrom=$rombasename.$romimage[$idx]{name}.img\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3904
			$header .= "romsize=$romimage[$idx]{size}\n\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3905
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3906
		return $header; 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3907
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3908
	# non-xip
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3909
	my $header;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3910
	if ($romimage[$idx]{extension})
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3911
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3912
		$header =  "extensionrofs=$rombasename.$romimage[$idx]{name}.img\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3913
		$header .= "rofssize=$romimage[$idx]{size}\n\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3914
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3915
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3916
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3917
		$header="rofsname=$rombasename.$romimage[$idx]{name}.img\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3918
		$header .= "rofssize=$romimage[$idx]{size}\n\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3919
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3920
	return $header;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3921
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3922
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3923
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3924
# Dump OBY file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3925
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3926
# Creates final OBY file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3927
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3928
sub create_dumpfile
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3929
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3930
	my $romimageidx;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3931
	my $smrimageidx = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3932
	my $dumpfile="$rombasename";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3933
	$romimage[0]{obeyfile}=$dumpfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3934
	$dumpfile .= ".oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3935
	unlink($dumpfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3936
	if($rombasename && !$onlysmrimage)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3937
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3938
		open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3939
		print "* Writing $dumpfile - final OBY file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3940
		$romimageidx=0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3941
		print DUMPFILE generate_romheader($romimageidx);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3942
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3943
	foreach $line (@obydata)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3944
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3945
		if ($line =~ /^\s*REM ROM_IMAGE\[(\d+)\]\s+(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3946
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3947
			$romimageidx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3948
			if ($romimage[$romimageidx]{extension} eq '0')
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3949
			{ # next rom oby file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3950
				close DUMPFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3951
				$dumpfile="$rombasename.$romimage[$romimageidx]{name}";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3952
				$romimage[$romimageidx]{obeyfile}=$dumpfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3953
				$dumpfile .= ".oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3954
				open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3955
				print "* Writing $dumpfile - final OBY file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3956
				# header
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3957
				print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3958
				print DUMPFILE generate_romheader($romimageidx);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3959
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3960
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3961
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3962
			{ # extension
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3963
				# header
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3964
				print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3965
				print DUMPFILE generate_romheader($romimageidx);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3966
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3967
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3968
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3969
		# write data drive oby file.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3970
		elsif ($line =~ /^\s*REM DATA_IMAGE\[(\d+)\]\s+(.*)$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3971
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3972
				my $dataimageidx=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3973
				close DUMPFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3974
				$dumpfile="$datadriveimage[$dataimageidx]{name}";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3975
				$datadriveimage[$dataimageidx]{obeyfile}=$dumpfile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3976
				$dumpfile .= ".oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3977
				open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3978
				print "* Writing $dumpfile - intermediate OBY file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3979
				# header
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3980
				print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3981
				print DUMPFILE generate_datadriveheader($dataimageidx,\@datadriveimage);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3982
				push(@dataDriveFileList,$dumpfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3983
				next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3984
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3985
		elsif ($line =~ /^\s*REM SMR_IMAGE\s*$/i)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3986
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3987
			close DUMPFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3988
			$dumpfile = $obeyFileList[$smrimageidx];
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3989
			$smrimageidx++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3990
			$dumpfile .= ".oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3991
			open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3992
			print "*Writing $dumpfile - intermediate OBY file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3993
			print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3994
			push(@smrImageFileList, $dumpfile);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3995
			next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3996
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3997
		print DUMPFILE $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3998
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3999
	close DUMPFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4000
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4001
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4002
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4003
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4004
# Full ROM directory listing - use case-insensitive sort
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4005
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4006
sub create_dirlisting
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4007
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4008
	if($rombasename)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4009
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4010
		print "* Writing $rombasename.dir - ROM directory listing\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4011
		open DIRFILE, ">$rombasename.dir" or die("* Can't create ROM directory listing\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4012
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4013
		my $file;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4014
		my $prevdir = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4015
		foreach $file (sort {uc($a) cmp uc($b)} keys %romfiles)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4016
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4017
			my $dir = substr $file,0,rindex($file, "\\");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4018
			if (uc $dir ne uc $prevdir)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4019
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4020
				$prevdir = $dir;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4021
				print DIRFILE "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4022
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4023
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4024
			my @sources = split /\n/,$romfiles{$file};
1
aa7fc13e36fb Add iby file information to ROM directory listing, and update original/syborg.dir
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
  4025
			my @ibyfiles = split /\n/,$ibyfiles{$file};
aa7fc13e36fb Add iby file information to ROM directory listing, and update original/syborg.dir
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
  4026
			printf DIRFILE "%-40s\t%s\t%s\n", $file, shift @sources, shift @ibyfiles;
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4027
			while (@sources)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4028
			{
1
aa7fc13e36fb Add iby file information to ROM directory listing, and update original/syborg.dir
William Roberts <williamr@symbian.org>
parents: 0
diff changeset
  4029
				printf DIRFILE "%39s+\t%s\t%s\n", "", shift @sources, shift @ibyfiles;
0
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4030
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4031
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4032
		close DIRFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4033
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4034
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4035
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4036
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4037
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4038
# Suppress Rom/Rofs/DataDrive Image creation if "-noimage" option is provided.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4039
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4040
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4041
sub suppress_image_generation
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4042
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4043
	if($noimage) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4044
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4045
		&tidy_exit;		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4046
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4047
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4048
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4049
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4050
# Execute rombuild & maksym for each final XIP OBY file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4051
# Execute rofsbuild for each non-XIP oby file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4052
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4053
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4054
sub run_rombuilder
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4055
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4056
	my ($command, $obeyfile, $logfile) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4057
	$command .= " $obeyfile.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4058
	#CR1258 test cases are depending on the following output.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4059
	print "* Executing $command\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4060
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4061
	open DATA, "$command 2>&1 |"   or die "Couldn't execute command: $command";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4062
	while ( defined( my $line = <DATA> ) ) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4063
	chomp($line);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4064
	print "$line\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4065
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4066
	close DATA;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4067
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4068
	if ($? != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4069
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4070
		$errors++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4071
		$command =~ /^\s*(\S+)\s+-slog/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4072
		print "* $1 failed\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4073
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4074
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4075
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4076
		push(@romImages,$obeyfile.".img");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4077
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4078
	print "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4079
	rename "$logfile","$obeyfile.log" or die("* Can't rename $logfile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4080
	exit(1) if ($errors);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4081
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4082
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4083
#----------------------------------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4084
# ROMBUILD AND ROFSBUILD
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4085
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4086
# Invokes rombuild and rofsbuild.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4087
# Creates .log, .symbol files.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4088
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4089
sub invoke_rombuild
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4090
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4091
	#For CR1258, -compress command line option is introduced, and it's being handled as following
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4092
	my $rom_compression_type;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4093
	if($opt_compression_type eq ALLSECTIONS)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4094
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4095
		$rom_compression_type = "-compress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4096
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4097
	elsif($opt_compression_type eq PAGEDSECTION)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4098
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4099
		$rom_compression_type = "-compress=paged";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4100
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4101
	elsif($opt_compression_type eq UNPAGEDSECTION)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4102
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4103
		$rom_compression_type = "-compress=unpaged";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4104
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4105
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4106
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4107
		$rom_compression_type = "";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4108
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4109
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4110
	my $rombuild;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4111
	if(!$geninc)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4112
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4113
		$rombuild = "rombuild -slog $rom_compression_type $logLevel $lowMem $opt_fastcompress $opt_jobs";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4114
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4115
	else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4116
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4117
		$rombuild = "rombuild -slog $rom_compression_type -geninc $logLevel $lowMem $opt_fastcompress $opt_jobs";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4118
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4119
	if($gendep)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4120
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4121
		$rombuild .= " -gendep";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4122
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4123
	my $rofsbuild = "rofsbuild -slog $logLevel $lowMem $opt_fastcompress $opt_jobs";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4124
	foreach my $arg (keys %rombuildOptions)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4125
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4126
		$rombuild .= " $arg";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4127
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4128
	        
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4129
	for (my $romidx=0; $romidx<8; $romidx++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4130
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4131
		my $obeyfile=$romimage[$romidx]{obeyfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4132
		my $xip=$romimage[$romidx]{xip};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4133
		my $compress=$romimage[$romidx]{compress};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4134
		my $uncompress=$romimage[$romidx]{uncompress};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4135
		if ($obeyfile)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4136
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4137
			if(!defined $opt_compression)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4138
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4139
				if ($compress ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4140
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4141
					$compress=" -compress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4142
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4143
				elsif($uncompress ne 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4144
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4145
					$compress=" -uncompress";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4146
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4147
 				elsif($compress eq 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4148
 				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4149
 					$compress=" ";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4150
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4151
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4152
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4153
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4154
				$compress = $opt_compression;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4155
				$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4156
				print "* ".$1." ".$2.": ".$3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4157
			}                        
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4158
			if ($xip)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4159
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4160
				run_rombuilder($rombuild.$compress, $obeyfile, "ROMBUILD.LOG");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4161
				if(!$nosymbols){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4162
				print "* Writing $obeyfile.symbol - ROM symbol file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4163
				print "* Executing maksym $obeyfile.log $obeyfile.symbol\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4164
				system("maksym $obeyfile.log $obeyfile.symbol >maksym.out");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4165
				exit(1) if (!-e "$obeyfile.symbol");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4166
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4167
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4168
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4169
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4170
				# efficient_rom_paging.pm can move everything to core rom.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4171
				# If that is the case, don't run rofsbuild at all to avoid errors.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4172
				use constant TRUE => 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4173
				use constant FALSE => 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4174
				my $run_rofs_build = FALSE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4175
				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4176
				open OBYFILE, "$obeyfile.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4177
				for (<OBYFILE>)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4178
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4179
					if (is_oby_statement($_))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4180
					{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4181
						$run_rofs_build = TRUE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4182
						last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4183
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4184
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4185
				close OBYFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4186
				if ($run_rofs_build)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4187
				{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4188
					run_rombuilder($rofsbuild.$compress, $obeyfile, "ROFSBUILD.LOG");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4189
					if(!$nosymbols){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4190
					print "* Writing $obeyfile.symbol - ROFS symbol file\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4191
					print "* Executing maksymrofs $obeyfile.log $obeyfile.symbol\n" if ($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4192
					system("maksymrofs $obeyfile.log $obeyfile.symbol >maksym.out");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4193
					exit(1) if (!-e "$obeyfile.symbol" );
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4194
					}			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4195
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4196
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4197
			unlink "rombuild.log";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4198
			unlink "maksym.out";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4199
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4200
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4201
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4202
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4203
#-------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4204
# Subroutine: check if current statement is a valid oby statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4205
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4206
sub is_oby_statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4207
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4208
	my ($li) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4209
	if ($li =~ /\s*data\s*=/) { return 1;}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4210
	if ($li =~ /\s*file\s*=/) { return 1;}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4211
	if ($li =~ /\s*dll\s*=/) { return 1;}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4212
	if ($li =~ /\s*secondary\s*=/) { return 1;}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4213
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4214
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4215
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4216
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4217
#-------------------------------------------------------
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4218
# Subroutine: convert possibly absolute path into relative path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4219
#
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4220
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4221
sub relative_path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4222
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4223
    my ($arg) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4224
    return $arg if ($arg !~ /^\\/);	# not an absolute path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4225
    if ($uppath eq "x")
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4226
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4227
		$uppath=cwd;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4228
		$uppath=~s-/-\\-go;		    # separator from Perl 5.005_02+ is forward slash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4229
		$uppath=~s-^(.*[^\\])$-$1\\-o;	    # ensure path ends with a backslash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4230
		$uppath=~s-\\([^\\]+)-\\..-og;	    # convert directories into ..
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4231
		$uppath=~s-^.:\\--o;		    # remove drive letter and leading backslash
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4232
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4233
    $arg=~s-^\\--o;	# remove leading backslash from original path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4234
    return "$uppath$arg";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4235
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4236
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4237
# Returns the global @obydata reference to support external tool invocation.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4238
sub getOBYDataRef{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4239
	return \@obydata;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4240
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4241
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4242
#Match the blank or the comment
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4243
sub isobystatement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4244
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4245
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4246
	if ($l !~ /=/) { 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4247
		return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4248
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4249
	return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4250
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4251
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4252
#Match the data statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4253
sub isdatastatement {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4254
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4255
	if ($l !~ /data=/) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4256
	{ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4257
		return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4258
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4259
	return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4260
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4261
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4262
#Match the spidata statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4263
sub isspidatastatement {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4264
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4265
	if ($l !~ /spidata=/) { 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4266
		return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4267
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4268
	return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4269
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4270
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4271
#Match the executable statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4272
sub isexecutablefile {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4273
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4274
	if (($l=~/file=/)||($l=~/dll=/)||($l=~/primary=/)||($l=~/secondary=/)||($l=~/variant=/)||($l=~/device=/)||($l=~/extension=/)){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4275
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4276
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4277
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4278
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4279
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4280
#Match the directory metadata statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4281
sub isdirectorymetadata {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4282
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4283
	if (($l=~/hide=/) || ($l=~/rename=/) || ($l=~/alias=/)){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4284
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4285
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4286
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4287
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4288
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4289
#Match the bitmap statements
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4290
sub isbitmap {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4291
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4292
	if ($l=~/bitmap=/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4293
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4294
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4295
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4296
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4297
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4298
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4299
#Match the aif file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4300
sub isaif {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4301
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4302
	if ($l=~/(.*)\.aif/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4303
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4304
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4305
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4306
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4307
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4308
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4309
#Match the resource file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4310
sub isresource {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4311
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4312
	if ($l=~/(.*)\.rsc/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4313
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4314
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4315
	return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4316
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4317
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4318
#Returns the executable extensions
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4319
sub executableextension {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4320
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4321
	if ($l=~/file=(.*)\.exe$/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4322
		return "exe";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4323
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4324
	elsif ($l=~/file=(.*)\.dll$/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4325
		return "dll";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4326
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4327
	elsif ($l=~/file=(.*)\.ldd$/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4328
		return "ldd";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4329
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4330
	elsif ($l=~/file=(.*)\.fsy$/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4331
		return "fsy";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4332
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4333
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4334
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4335
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4336
#Returns all 3 UIDS
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4337
sub executabletype {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4338
	my ($l) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4339
	my $uid1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4340
	my $uid2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4341
	my $uid3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4342
	if ($l=~/uid1\s(0x[\d]*)/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4343
		$uid1=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4344
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4345
	if ($l=~/uid2\s(0x[\d]*)/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4346
		$uid2=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4347
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4348
	if ($l=~/uid3\s(0x[\d]*)/){ 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4349
		$uid3=$1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4350
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4351
	
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4352
	return $uid1." ".$uid2." ".$uid3."\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4353
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4354
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4355
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4356
#Return source file name
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4357
sub getSourceFile {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4358
	my ($line) = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4359
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4360
		return $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4361
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4362
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4363
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4364
#Return destination file name
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4365
sub getDestFile{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4366
	my ($line) = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4367
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4368
		return $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4369
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4370
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4371
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4372
#Return the obycommand attributes
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4373
sub getOBYAttributes{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4374
	my ($line) = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4375
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4376
		return $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4377
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4378
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4379
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4380
#Return the hardware variant delimiter
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4381
sub getHardwareVariant{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4382
	my ($line) = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4383
	if ($line=~/(\w*[0x[\d]*]=)/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4384
		return $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4385
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4386
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4387
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4388
#Return the hardware variant delimiter
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4389
sub getObyCommand{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4390
	my ($line) = shift;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4391
	if ($line=~/^[data=]/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4392
		return "data";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4393
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4394
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4395
	if ($line=~/^[file=]/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4396
		return "file";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4397
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4398
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4399
	if ($line=~/^[dll=]/) {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4400
		return "dll";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4401
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4402
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4403
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4404
# Initialize the symbol info within the given DLL.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4405
sub AddDllDataInfo
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4406
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4407
	my ($line) = @_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4408
	# syntax "<DLLname>@<symbolname> <newvalue>"
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4409
	if($line =~ /^\s*(\S+)\s*\@\s*(\S+)\s+(\S+)\s*$/)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4410
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4411
		my $dllName = lc ($1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4412
		my $symbolname = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4413
		my $intVal = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4414
		my $newVal = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4415
		if($intVal =~ /^0x([0-9a-fA-F]+)$/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4416
		$newVal = hex($1);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4417
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4418
		elsif($intVal =~ /^(-\d+)$/ or $intVal =~ /^(\d+)$/){		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4419
			$newVal = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4420
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4421
		else{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4422
 			print "ERROR: Invalid patchable value at \"$line\"\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4423
 			$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4424
 			return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4425
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4426
		$symbolname =~ s/:(\d+)\[(0x)?[0-9a-f]+\]$//i;	# Remove array element specification (:ELEMENT_BIT_SIZE[INDEX]) to get symbol name
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4427
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4428
		my $DllMapRef = \%{$DllDataMap{$dllName}};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4429
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4430
		my %DllSymInfo = ();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4431
		$DllSymInfo{ordinal}	= undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4432
		$DllSymInfo{dataAddr}	= undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4433
		$DllSymInfo{size}		= undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4434
		# We don't store the value here, since patchdata can be used on an array,
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4435
		# in which case we'll create another one of these, and lose the value.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4436
		# Instead, the value is retrieved by re-parsing the command line later.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4437
		$DllSymInfo{lineno}		= $sourceline;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4438
		$DllSymInfo{obyfilename}= $sourcefile;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4439
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4440
		$DllMapRef->{$symbolname} = \%DllSymInfo;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4441
		return 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4442
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4443
		return 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4444
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4445
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4446
sub process_dlldata
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4447
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4448
	if(!$patchDataStmtFlag){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4449
		return;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4450
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4451
	my $symbolTblEntry;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4452
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4453
	foreach my $dll (keys %DllDataMap){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4454
		my $DllMapRef = $DllDataMap{$dll};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4455
		if(!$DllMapRef->{srcfile}){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4456
		next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4457
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4458
		my $aDllFile = $DllMapRef->{srcfile};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4459
		my $SymbolCount = scalar ( keys %{$DllMapRef}) - 2; #The map has 'srcfile' and 'dstpath' special keys besides the symbols.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4460
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4461
		my $DllSymMapRef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4462
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4463
		my @BPABIPlats = &BPABIutl_Plat_List;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4464
		my $matchedSymbols = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4465
		my $globalSyms = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4466
		my @platlist = &Plat_List();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4467
		my $platName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4468
		my $rootPlatName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4469
		my $plat = "ARMV5";				
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4470
		$plat = &Variant_GetMacro() ? $plat."_ABIV1" : $plat."_ABIV2";		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4471
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4472
		foreach my $plat(@platlist) 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4473
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4474
			if(($aDllFile =~ /\\($plat)\\/i) or ($aDllFile =~ /\\($plat\.\w+)\\/i ))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4475
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4476
				$platName = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4477
				last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4478
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4479
		}		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4480
		$rootPlatName =	&Plat_Customizes($platName) ? &Plat_Root($platName) : $platName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4481
		
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4482
		# Map files will be referred for all ARM platforms, 
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4483
		# and for BSF platforms which cutomizes ARM platforms.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4484
		if($rootPlatName =~ /^ARMV5|$plat$/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4485
			my $mapfile = "${aDllFile}.map";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4486
			
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4487
			open MAPFILE, "$mapfile" or die "Can't open $mapfile\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4488
			while(<MAPFILE>){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4489
			my $line = $_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4490
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4491
				#Ignore Local symbols.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4492
				if(!$globalSyms){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4493
					if($line =~ /Global Symbols/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4494
						$globalSyms = 1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4495
						next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4496
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4497
					else{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4498
						next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4499
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4500
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4501
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4502
				$symbolTblEntry = $line;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4503
				if($symbolTblEntry =~ /\s*(\S+)(?:\s+\(EXPORTED\))?\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4504
					my $symbol		= $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4505
					my $symbolValue = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4506
					my $data		= $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4507
					my $symbolSz	= $4;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4508
					if(!exists $DllMapRef->{$symbol}){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4509
						next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4510
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4511
					$DllSymMapRef = $DllMapRef->{$symbol};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4512
					if($data =~ /Data/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4513
					# Valid
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4514
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4515
					else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4516
					#	Invalid to patch a code symbol.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4517
						print( "$DllSymMapRef->{obyfilename}($DllSymMapRef->{lineno}): Warning: $symbol is not a data Symbol.Ignoring patch statement.\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4518
						$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4519
						$DllMapRef->{$symbol} = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4520
						next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4521
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4522
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4523
					
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4524
					# Record the address and the size of the symbol.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4525
					$DllSymMapRef->{dataAddr} = $symbolValue;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4526
					$DllSymMapRef->{size} = $symbolSz;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4527
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4528
					$matchedSymbols++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4529
					if( $matchedSymbols >= $SymbolCount){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4530
						last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4531
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4532
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4533
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4534
			close MAPFILE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4535
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4536
		# DSO files will be referred for BPABI platforms(excluding ARM platforms),
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4537
		# and for BSF platforms which cutomizes BPABI platforms.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4538
		else {
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4539
			my $abiDir = undef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4540
			foreach my $bpabi (@BPABIPlats){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4541
				if($rootPlatName =~ /^$bpabi$/i){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4542
					$abiDir = $platName;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4543
					last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4544
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4545
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4546
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4547
			if(!defined $abiDir){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4548
				print("Can't locate the map or proxy dso file for $aDllFile\n");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4549
				$errors++ if($strict);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4550
				next; #go to the next patch dll data statement
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4551
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4552
			if( $aDllFile =~ /(.*)\.[^.]+$/ ){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4553
				my $proxydsofile = "$1.dso";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4554
				$proxydsofile =~ s/$abiDir\\(.*)\\/ARMV5\\LIB\\/ig;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4555
				open PIPE, "getexports -d $proxydsofile|" or die "Can't open file $proxydsofile\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4556
				while (<PIPE>){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4557
					my $line = $_;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4558
					if($line =~ /\s*(\S+)\s+(\d+)\s+((\S+)\s+(\d+))?/){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4559
						my $symbol = $1;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4560
						my $ordinal = $2;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4561
						my $data = $3;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4562
						my $symbolSz = $5;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4563
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4564
						if(!$data){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4565
							next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4566
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4567
						if(!exists $DllMapRef->{$symbol}){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4568
							next;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4569
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4570
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4571
						$DllSymMapRef = $DllMapRef->{$symbol};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4572
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4573
						# Record the ordinal and the size of the symbol.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4574
						$DllSymMapRef->{ordinal} = $ordinal;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4575
						$DllSymMapRef->{size} = $symbolSz;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4576
						$matchedSymbols++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4577
						if( $matchedSymbols >= $SymbolCount){
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4578
						last;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4579
						}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4580
					}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4581
				}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4582
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4583
				close PIPE;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4584
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4585
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4586
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4587
	exit(1) if ($errors && $strict ) ;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4588
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4589
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4590
# make sure that all the absolute feature variant paths include a
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4591
# drive letter. This is required because cpp will not work with
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4592
# absolute paths starting with slashes.
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4593
sub addDrivesToFeatureVariantPaths
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4594
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4595
	return unless $featureVariant{'VALID'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4596
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4597
	my $current = cwd();
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4598
	my $drive = $1 if ($current =~ /^(.:)/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4599
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4600
	# pre-include file
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4601
	my $HRH = $featureVariant{'VARIANT_HRH'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4602
	$featureVariant{'VARIANT_HRH'} = $drive . $HRH if ($HRH =~ /^[\\\/]/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4603
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4604
	# ROM include path
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4605
	my $dirRef = $featureVariant{'ROM_INCLUDES'};
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4606
	return unless $dirRef;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4607
	my $i = 0;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4608
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4609
	foreach my $dir (@$dirRef)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4610
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4611
		$$dirRef[$i] = $drive . $dir if ($dir =~ /^[\\\/]/);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4612
		$i++;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4613
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4614
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4615
sub create_smrimage
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4616
{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4617
	if($needSmrImage)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4618
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4619
		foreach my $oby (@obeyFileList)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4620
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4621
			my $command = "rofsbuild -slog -smr=$oby.oby";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4622
			print "* Executing $command\n" if($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4623
			system($command);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4624
			if($? != 0)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4625
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4626
				print("* ROFSBUILD failed to generate SMR IMAGE\n") if($opt_v);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4627
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4628
			else
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4629
			{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4630
				push(@smrImageFileList, $oby.".img");
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4631
			}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4632
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4633
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4634
	if(@smrImageFileList)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4635
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4636
		print "\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4637
		print "-------------------------------------------------------\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4638
		print "| List of file(s) generated pertaining to SMR image |\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4639
		print "-------------------------------------------------------\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4640
		my $arraySize = scalar(@smrImageFileList);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4641
		for(my $i=0; $i < $arraySize; $i++)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4642
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4643
			my $element = shift(@smrImageFileList);
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4644
			my $size = -s $element;
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4645
			print "Size = ".$size." bytes"."\t"."File = ".$element."\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4646
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4647
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4648
	foreach my $errSmr (keys(%smrNameInfo))
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4649
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4650
		if($smrNameInfo{$errSmr} > 1)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4651
		{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4652
			print "\n SMR image: $errSmr.img creating error for duplicated names!\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4653
		}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4654
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4655
	if($smrNoImageName)
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4656
	{
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4657
		print "\n SMR image creating error for empty image name!\n";
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4658
	}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4659
}
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4660
01a8f4b3ef59 syborg_stem = massaged input file which gives matching rombuild.log (see notes.txt)
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4661
1;