tools/buildrom.pm
author William Roberts <williamr@symbian.org>
Thu, 18 Nov 2010 15:45:28 +0000
changeset 138 6028e81d48fd
parent 57 a44af1db196f
permissions -rw-r--r--
Update stem_rom.oby and rom_content.csv to remove multimedia Also removed spurious Phonebook2_reg.rsc file which causes PhoneBook to appear in the matrix menu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     1
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
# Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
# All rights reserved.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
# Contributors:
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
# Description: 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
# This package is to build rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
package buildrom;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
require Exporter;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
@ISA=qw(Exporter);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
@EXPORT=qw(
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	image_content_processing_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
	process_cmdline_arguments
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	preprocessing_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	substitution_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
	reorganize_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
	plugin_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	multlinguify_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	spi_creation_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
	suppress_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	bitmap_aif_converison_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
	cleaning_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
	create_dumpfile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	create_dirlisting
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
	suppress_image_generation
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	invoke_rombuild
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
	getOBYDataRef
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	isobystatement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	isdatastatement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	isspidatastatement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
	isexecutablefile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
	isdirectorymetadata
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
	isbitmap
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
	isaif
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
	isresource
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
	hardwarevariant
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
	executableextension
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
	executabletype
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	getSourceFile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
	getDestFile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
	getOBYAttributes
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
	getHardwareVariant
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
	getObyCommand
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
	process_dlldata
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
	featurefile_creation_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	processData
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	create_smrimage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
my $BuildromMajorVersion = 3 ;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
my $BuildromMinorVersion = 17;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
my $BuildromPatchVersion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
sub print_usage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	my $featuresOptionUsage = "-ffeatureuids or -fr=featureuids -- feature registry database XML file name";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	if ($enforceFeatureManager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
		$featuresOptionUsage = "-fm=featuredatabasefile          -- feature manager/feature registry database XML file name.\n".
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
							   "\t\t\t\t    Multiple XML files can be passed seperated by commas.\n".
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
							   "   -nofm=featuresdatafile           -- don't generate features data file.".
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
							   " Instead use pre-built features data file.";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    80
#........1.........2.........3.........4.........5.........6.........7.....
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    81
	print <<USAGE_EOF;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    82
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    83
BUILDROM - ROM configuration tool V$BuildromMajorVersion.$BuildromMinorVersion.$BuildromPatchVersion
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    84
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    85
Usage:
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    86
  buildrom [options] obyfile [obyfile2 ...]   
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    87
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    88
Build a ROM according to the specification defined by concatenating the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    89
specified obyfiles.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    90
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    91
The initial specification is modified by C++ preprocessor directives,
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    92
and subsequently adjusted by statements in the ROM specification language.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    93
The final specification is in the subset of the specification language
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    94
which is understood directly by ROMBUILD.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    95
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    96
Each obyfile parameter specifies a file via a search path: if the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    97
filename is not matched then buildrom will look in \\epoc32\\rom\\include.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    98
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
    99
Buildrom invokes ROMBUILD to generate the ROM image, and produces a
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   100
number of related files such as the ROM symbol file. The name of the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   101
image file is specified directly by the -o option, or determined by 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   102
scanning the final specification for the "romname" keyword. If there is 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   103
more than one "romname" statement, the last one takes precedence.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   104
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   105
The available options are
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   106
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   107
   -Dxxx                            -- C++ preprocessor arguments
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   108
   -oimagename                      -- ROM image name, overriding any ROMNAME statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   109
   -s                               -- strict option, any missing files will stop buildrom 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   110
   -p                               -- preserves the intermediate files pertaining to data drive, Z drive and BMCONV
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   111
   -spi                             -- enable producing SPI files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   112
   -spiplacement                    -- enable positioning of spi file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   113
   -w                               -- warn if file has been selected from a different directory 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   114
   $featuresOptionUsage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   115
   -etool                           -- external tool specification (xx is tool's perl module)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   116
   -compress                        -- compression type of ROM image:
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   117
                                       -compress compress whole ROM image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   118
                                       -compress=paged compress paged section in the ROM image only.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   119
                                       -compress=unpaged compress unpaged section in the ROM image only. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   120
   -ccomprmethod                    -- compression method: none|inflate|bytepair
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   121
   -geninc                          -- generate INC file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   122
   -gendep                          -- generate dependence graph for rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   123
   -nosymbols                       -- disable creation of symbol file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   124
   -noimage                         -- disable creation of ROM/ROFS/DataDrive Image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   125
   -fastcompress                    -- compress files with faster bytepair and tradeoff of compress ratio
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   126
   -j<digit>                        -- do the main job with <digit> threads
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   127
   -loglevel<level>                 -- Level of information logging where loglevel is 0,1,2
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   128
                                       0 default level of information
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   129
                                       1 host/ROM filenames, file size and the hidden attribute along with level0 log
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   130
                                       2 E32 file header attributes along with level1 log
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   131
   -z=xxx or -zdrivepath=xxx        -- specify a location to create Z drive directory. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   132
   -d=xxx or -datadrivepath=xxx     -- specify a location to create data drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   133
   -k or -keepgoing                 -- enable keepgoing,continue to create the data drive image even
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   134
                                    if the non-sis, sis or zdrive image file(s) are missing or corrupt.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   135
   -r or -retainfolder              -- enable retainfolder,would retain pre-existence of z & data drive folder. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   136
   -zdriveimage=xxx                 -- specify Z drive image (ROM, CORE, ROFS or Ext-ROFS image).
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   137
   -pfile=xxx                       -- specify a parameter file for interpretsis to take additional parameters.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   138
   -argforinterpretsis=xxx          -- specify command line argument(s) for interpretsis which will override the 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   139
                                    parameter file contents.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.  
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   142
   -I<directory>                    -- Use <directory> for the referenced IBY/OBY files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   143
   -argfile=xxx                     -- specify argument-file name containing list of command-line arguments to buildrom   
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   144
   -lowmem                          -- use memory-mapped file for image build to reduce physical memory consumption   
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   145
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   146
Popular -D defines to use include
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   147
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   148
   -D_DEBUG         -- select debug versions of some files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   149
   -D_FULL_DEBUG    -- select debug versions of all files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   150
   -D_ARM4          -- specify the target platform
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   151
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   152
   -D_EABI=xxxx     -- specify target for all files (e.g. ARMV5)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   153
   -D_KABI=xxxx     -- specify the target platform for the Kernel (e.g. ARMV5)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   154
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   155
Other defines may be useful for particular OBY files.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   156
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   157
USAGE_EOF
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   158
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   159
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   160
use strict;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   161
my $PerlLibPath;    # fully qualified pathname of the directory containing our Perl modules
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   162
# establish the path to the Perl libraries
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   163
$PerlLibPath = $FindBin::Bin;	# X:/epoc32/tools
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   164
$PerlLibPath =~ s/\//\\/g;	# X:\epoc32\tools
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   165
$PerlLibPath .= "\\";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   166
sub ExportDirs ($);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   167
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   168
use BPABIutl; # for BPABIutl::BPABIutl_Plat_List
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   169
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   170
my $xmlrequired = 0; # assume xml required is false. Used to determine if xml
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   171
                     # modules should be loaded.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   172
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   173
use Modload;	     # To load modules dynamically
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   174
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   175
# Work out the relative path to the epoc32 directory
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   176
use spitool qw(&createSpi);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   177
use Cwd;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   178
use Pathutl;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   179
use E32Variant;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   180
use E32Plat;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   181
use Genutl;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   182
use BPABIutl;		# for BPABIutl::BPABIutl_Plat_List
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   183
use externaltools; 	#To invoke External Tools
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   184
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   185
my @tempfiles;  	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   186
my $preserve = 0; 	#flag to indicate if temporary files should be preserved
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   187
my $uppath="x";	    	# will be initialised when first needed
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   188
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   189
my $epocroot = $ENV{EPOCROOT};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   190
die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   191
$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   192
die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   193
die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   194
die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   195
die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   196
die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   197
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   198
my $epoc32 = relative_path("${epocroot}epoc32");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   199
$epoc32 =~ s-\\-/-go;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   200
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   201
my @obyfiles;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   202
my $cppargs = "-nostdinc -undef";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   203
my $opt_v = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   204
my $opt_o = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   205
my $strict = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   206
my $warnSelection = 0; # default is not warn about selecting files from 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   207
		       # different directories when the file is missing from
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   208
		       # the specified directory
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   209
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   210
my $createspi = 0; # don't create SPI files by default
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   211
my $spiset=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   212
my $spiplacement = 0; # enable the placement of spi file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   213
my %spipositionflag = (); # map of Image index at which the keyword SPI_POSITION is used.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   214
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   215
use constant NONE => 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   216
use constant INFLATE => 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   217
use constant BYTEPAIR => 2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   218
my $opt_compression;  # Default compression method parameter undefined
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   219
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   220
use constant UNCOMPRESSED   => 0;        # Indicates the ROM image will not be compressed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   221
use constant ALLSECTIONS    => 1;        # Indicates both paged section and unpaged section will be compressed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   222
use constant PAGEDSECTION   => 2;        # Indicates only paged section will be compressed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   223
use constant UNPAGEDSECTION => 3;        # Indicates only unpaged section will be compressed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   224
my $opt_compression_type = UNCOMPRESSED; # Leave the ROM image uncompressed by default.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   225
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   226
my $thisdir=cwd;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   227
$thisdir=~s-/-\\-go;		    # separator from Perl 5.005_02+ is forward slash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   228
$thisdir=~s-^(.*[^\\])$-$1\\-o;	    # ensure path ends with a backslash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   229
$thisdir=~s-^.:\\--o;		    # remove drive letter and leading backslash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   230
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   231
my $rominclude = "$epoc32/rom/include";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   232
my %plugintypes; #hash of plugin types and their SPI files' destinations in ROM
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   233
$plugintypes{"ECOM"} = "\\private\\10009d8f\\"; #ECOM SPI files' destination in ROM image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   234
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   235
my @obydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   236
my @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   237
my %substitutionData;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   238
my @substitutionOrder;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   239
my %languageCodes;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   240
my $defaultLanguageCode;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   241
my %multiLinguifyAlias;  # to by-pass the 'mustbesysbin' option for multilinguify 'alias'es. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   242
my $abiDowngrade;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   243
my @binarySelectionOrder;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   244
my $fromDIR;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   245
my %rombuildOptions = ("-type-safe-link" => 1 );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   246
my $enforceSysBin = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   247
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   248
my $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   249
my $errors = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   250
my @romimage;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   251
my $rombasename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   252
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   253
my $sourcefile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   254
my $sourceline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   255
my ($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   256
my %romfiles;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   257
my %ibyfiles; # record the iby file for each ROM file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   258
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   259
# To handle BINARY_SELECTION_ORDER macro.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   260
my $firstDIR;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   261
my $binarySelectionOrderFlag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   262
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   263
my %DllDataMap = ();	#Map to keep track of DLL Data patch statements.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   264
my $patchDataStmtFlag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   265
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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  
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   267
			# features data file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   270
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   271
#Image Content XML file that supports specific feature to be added
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   272
my $image_content = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   273
#Feature list XML file that acts as database containing all features details
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   274
my $featureXml = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   275
my $geninc = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   276
my $gendep = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   277
my $nosymbols = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   278
my $noimage = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   279
my $customizedPlat = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   280
my $opt_fastcompress = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   281
my $opt_jobs= "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   282
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   283
#Summary of files(both executables and data files) currently includes 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   284
#	host and ROM file names, 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   285
#	size of the file in ROM
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   286
#	whether the file is hidden
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   288
# only when supplied with this option so that the existing tools don't get affected.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   289
my $logLevel="";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   290
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   291
# This option is used to pass -lowmem argument to rombuild/rofsbuild tools
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   292
my $lowMem="";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   293
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   294
# Feature Variation modules and data
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   295
use featurevariantparser;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   296
use featurevariantmap;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   297
my %featureVariant;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   298
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   299
# global variables specific to data drive image generation. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   301
use File::Copy;					# Module to provide functions to copy file(s) from source to destination.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   302
use File::Find;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   303
use datadriveimage;				# module which provides all necessary functions to create data drive image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   304
my $ZDirloc = "";				# location of Z drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   305
my $DataDriveDirloc = "";		# location of data drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   306
my @sisfilelist;				# an array to hold sis file(s).
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   307
my @zDriveImageList;			# an array to hold z drive image name.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   308
my @datadiveobydata;			# an array to hold data drive oby data.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   309
my @datadriveimage;				# array which holds data drive image attribute.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   310
my $rootdir = "";				# which holds root directory information.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   311
my @datadrivedata;				# array to maintain list of lines taken from processed data drive oby file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   312
my @nonsisFilelist;				# array to maintain list of nonsis file(s). 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   313
my @sisobydata;					# array to maintain all list of files(s) got by installing sis files. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   314
my @renameList;					# array to maintain list of file(s) that has to be renamed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   315
my @aliaslist;					# array to maintain list of file(s) that has to be made alias.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   316
my @hideList;					# array to maintain list of file(s) that has to be made hidden.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   317
my $sisfilepresent = 0;			# enable if sis file(s) are present.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   318
my $stubsisfilepresent = 0;		# enable if stub-sis file(s) are present.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   319
my $opt_k = 0;					# enable if keepgoing option is specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   321
my $dataImageCount = 0;			# no of data drive image that has to generated.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   323
my $opt_zimage = 0;				# enable if z drive image is found.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   324
my $zDrivePresent = 0;			# flag to check whether Z drive needs to be created.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   325
my @dataDriveFileList;			# list of processed data drive related files.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   326
my $paraFile = undef;			# parameter file for interpretsis.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   327
my @romImages;					# list of generated z drive image(s)(rom/rofs). 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   328
my $imageEntryLogFile = undef;	# a log file to log all the z drive image contents.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   331
my $interpretsisOpt = undef;	# enable if command line arguments are specified by the user to INTERPRETSIS.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   333
my @Global_BPABIPlats;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   334
my @Global_PlatList;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   335
my @smrImageFileList;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   336
my $needSmrImage = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   337
my %smrPartitions;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   338
my %smrNameInfo;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   339
my @obeyFileList;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   340
my $smrNoImageName = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   341
my $onlysmrimage = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   342
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   343
sub match_obyfile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   344
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   345
	my ($obyfile) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   346
	if (-f $obyfile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   347
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   348
		push @obyfiles, $obyfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   349
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   350
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   351
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   352
	# search for the oby file in the list of include directories
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   353
	my @otherDirs = ($rominclude);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   354
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   355
	if ($featureVariant{'VALID'})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   356
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   357
		my $dirRef = $featureVariant{'ROM_INCLUDES'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   358
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   359
		@otherDirs = @$dirRef if ($dirRef);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   360
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   361
	foreach my $dir (@otherDirs)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   362
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   363
		if (-f "$dir/$obyfile")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   364
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   365
		    push @obyfiles, "$dir/$obyfile";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   366
		    return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   367
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   368
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   369
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   370
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   371
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   372
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   373
# This function invokes ROFSBUILD tool with appropriate parameters to generate data drive image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   375
# if and only if preserve(-p) option is disabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   376
sub create_datadriveImage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   377
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   378
	for (my $dataidx=0; $dataidx < $dataImageCount; $dataidx++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   379
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   380
		my $driveIndex = $dataIndexHash{$dataidx};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   381
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   382
		if(defined($driveIndex))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   383
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   384
			my $obeyfile=$datadriveimage[$driveIndex]{obeyfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   385
			my $compress=$datadriveimage[$driveIndex]{compress};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   386
			my $uncompress=$datadriveimage[$driveIndex]{uncompress};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   387
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   388
			if ($obeyfile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   389
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   390
				if(!defined $opt_compression)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   391
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   392
					if ($compress ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   393
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   394
						$compress=" -compress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   395
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   396
					elsif($uncompress ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   397
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   398
						$compress=" -uncompress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   399
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   400
					elsif($compress eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   401
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   402
						$compress=" ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   403
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   404
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   405
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   406
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   407
					$compress = $opt_compression;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   408
					$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   409
					print "* ".$1." ".$2.": ".$3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   410
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   411
				my $command = "rofsbuild -slog".$compress." -datadrive=$obeyfile.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   412
				print "* Executing $command\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   413
				system($command);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   414
				if ($? != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   415
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   416
					&datadriveimage::reportError("* ROFSBUILD failed to generate data drive image",$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   417
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   418
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   419
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   420
					push(@dataDriveFileList,$obeyfile.".img");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   421
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   422
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   423
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   424
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   425
	# after processing all the data drive image(s) delete zdrive and datadrive directory 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   426
	# if and only if preserve(-p) option is disabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   427
	if($dataImageCount)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   428
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   429
		# delete Z drive directory if and only if preserve(-p) option is disabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   430
		my $retVal = &deleteDirectory($ZDirloc,$opt_v)if(!($preserve));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   431
		if($retVal)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   432
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   433
			&datadriveimage::reportError("* Warning could not delete $ZDirloc",$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   434
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   435
		# delete data drive directory if and only if preserve(-p) option is disabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   436
		my $retVal = &deleteDirectory($DataDriveDirloc,$opt_v)if(!($preserve));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   437
		if($retVal)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   438
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   439
			&datadriveimage::reportError("* Warning could not delete $DataDriveDirloc",$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   440
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   441
		# reset image count to zero.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   442
		$dataImageCount = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   443
		# reset z drive present to zero.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   444
		$zDrivePresent = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   445
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   446
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   447
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   448
sub tidy_exit
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   449
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   450
	#-------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   451
	# Tidy and exit
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   452
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   453
	if (!$preserve)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   454
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   455
	    foreach my $tempfiles (@tempfiles)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   456
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   457
			unlink "$tempfiles";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   458
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   459
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   460
	if($rombasename)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   461
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   462
		system("dir $rombasename.*");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   463
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   464
	if(@dataDriveFileList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   465
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   466
		print "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   467
		print " ----------------------------------------------------------\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   468
		print "| List of file(s) generated pertaining to data drive image |\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   469
		print " ----------------------------------------------------------\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   470
		my $arraySize = scalar(@dataDriveFileList);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   471
		for( my $i=0; $i < $arraySize; $i++ )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   472
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   473
			# remove the first element from an array and return it 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   474
			my $element = shift(@dataDriveFileList);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   475
			# get the size of the file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   476
			my $size = -s $element;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   477
			print "Size = ".$size." bytes"."\t"."File = ".$element."\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   478
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   479
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   480
	exit(0);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   481
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   482
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   483
# This is the main function which is responsible for processing data drive image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   484
# This function internally calls other functions to create datadrive folder,zdrive folder
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   485
# and external tools such as INTERPRETSIS, READIMAGE and finally ROFSBUILD to generate 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   486
# appropriate data drive image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   487
sub processData		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   488
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   489
	if($dataImageCount)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   490
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   491
		# set the default path for Z drive and Data drive directory,
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   492
		# if and only if, path is not specified by the user. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   493
		$ZDirloc = &datadriveimage::setPath("zdrive") unless ($ZDirloc);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   494
		$DataDriveDirloc = &datadriveimage::setPath("datadrive") unless ($DataDriveDirloc);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   495
		#delete any existing Z drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   496
		my $retVal = &datadriveimage::deleteDirectory($ZDirloc,$opt_v)if(!$opt_r);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   497
		if($retVal)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   498
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   499
			exit(1) if(!$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   500
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   502
		my $retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   503
		if($retVal)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   504
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   505
			exit(1) if(!$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   506
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   507
		if($opt_logFile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   508
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   509
			# clean any pre-existance of log file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   510
			unlink($ZDirloc."\\".$imageEntryLogFile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   511
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   512
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   513
		for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   514
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   515
			my $driveIndex = $dataIndexHash{$datadriveidx};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   516
			# get the data drive name.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   517
			if( defined( $driveIndex ) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   518
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   519
				my $datadrivename=$datadriveimage[$driveIndex]{obeyfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   520
				# get the size of the data drive.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   521
				my $size = $datadriveimage[$driveIndex]{size};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   522
				if( $datadrivename )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   523
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   524
					# set data drive oby file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   525
					my $datadriveobyfile = $datadrivename.".oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   526
					# final location of prototype data drive.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   527
					my $proDataDriveDirloc;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   528
					# Location of stub-sis file(s) inside Z Drive folder.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   529
					my $zDriveSisFileLoc;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   530
					# check if more than one data drive image needs to be generated. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   531
					if( $dataImageCount > 1 )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   532
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   533
						# if yes, then set the location of prototype data drive folder as 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   534
						# DataDriveDirloc + datadrivename
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   535
						$proDataDriveDirloc = $DataDriveDirloc."\\".$datadrivename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   536
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   537
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   538
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   539
						# else, then set the location of prototype data drive folder as DataDriveDirloc 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   540
						$proDataDriveDirloc = $DataDriveDirloc;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   541
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   542
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   543
					# create prototype data drive folder.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   544
					print "creating data drive folder\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   545
					&datadriveimage::createDirectory($proDataDriveDirloc);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   546
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   547
					# check for sis file keyword in ROM description file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   548
					# if found,then locate for stub-sisfile.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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 )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   550
					# and dump all the non-sis files on to the Z drive folder. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   551
					if(&datadriveimage::checkForSisFile($datadriveobyfile,\@sisfilelist,\$sisfilepresent))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   552
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   553
						my $zDriveImagePresent = 0; # flag to check whether z drive image is Present;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   554
						if(&datadriveimage::checkForZDriveImageKeyword($datadriveobyfile,\@zDriveImageList,\$zDriveImagePresent) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   555
						{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   556
							# find out size of the array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   557
							my $arraysize = scalar(@zDriveImageList);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   558
							for( my $i=0; $i < $arraysize; $i++ )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   559
							{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   560
								$zDriveSisFileLoc =  $ZDirloc."\\".$datadrivename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   561
								&datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   562
							}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   563
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   564
						else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   565
						{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   566
							$zDriveSisFileLoc = $ZDirloc;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   567
							# locate and copy stub-sis file(s),for the first time.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   568
							if( !$zDrivePresent )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   569
							{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   570
								# check for image file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   571
								if( $opt_zimage )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   572
								{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   573
									# image(s)supplied to BUILDROM(like rom,rofs,extrofs or core) using "-zdriveimage" option, 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   575
									# fed to READIMAGE as an input.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   576
									foreach my $element (@zdriveImageName)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   577
									{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   578
										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   579
										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   580
									}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   581
								}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   582
								else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   583
								{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
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 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   586
									# fed to READIMAGE as an input.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   587
									foreach my $element (@romImages)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   588
									{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   589
										# invoke READIMAGE to extract all /swi stub sis file(s) from the given image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   590
										$zDrivePresent = &datadriveimage::invokeReadImage($element,$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   591
									}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   592
								}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   593
							}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   594
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   595
						# invoke INTERPRETSIS tool with z drive folder location.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   596
						&datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList)if($sisfilepresent);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   597
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   598
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   599
					# create an oby file by traversing through upated prototype data drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   600
					&datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist,
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   601
										\@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   602
					#reset sisfilepresent flag to zero;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   603
					$sisfilepresent =0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   604
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   605
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   606
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   607
		create_datadriveImage();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   608
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   609
	tidy_exit;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   610
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   611
#Parse and process image content xml file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   612
#Gets the oby files listed in the xml file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   613
# Pushes all the oby files found to an array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   614
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   615
sub image_content_processing_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   616
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   617
	if(!defined ($image_content))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   618
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   619
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   620
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   621
	&ImageContentHandler::ParseImageContentXML($image_content);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   622
	&ImageContentHandler::ProcessImageContent;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   623
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   624
	if(defined ($image_content) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   625
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   626
#		Collect the oby files if any in the Image content file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   627
		my $files = &ImageContentHandler::GetObyFiles;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   628
		foreach my $obeyfile (@$files)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   629
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   630
			next if match_obyfile($obeyfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   631
			next if (match_obyfile("$obeyfile.oby"));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   632
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   633
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   634
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   635
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   636
# Subroutine to process parameter-file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   637
sub parameterFileProcessor
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   638
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   639
	my $paramFile = shift(@_);	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   640
	my @paramFileParamaters = ();	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   641
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   642
	my $fileOpenFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   643
	open FILE,"<", $paramFile or $fileOpenFlag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   644
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   645
	if(!$fileOpenFlag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   646
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   647
		print "Error: Could not open parameter-file \"$paramFile\" for reading.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   648
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   649
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   650
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   651
	# Parse parameter-file and collect all the parameters in an array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   652
	while(my $line = <FILE>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   653
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   654
		# Read the line till character ';'(used for providing comments in the file) or EOL
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   655
		$line = $1 if ($line =~ /(.*);/); 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   656
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   657
		# Split the parameters specified in a line based on white-spaces		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   658
		my @paramaters = split(/(\s)/,$line);	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   659
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   660
		my $flag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   661
		my $argWithQuotes='';
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   662
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   663
		foreach my $value (@paramaters) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   664
		{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   665
			# If the parameter doesn't conatian double quotes then push it 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   666
			# to the list of parameters.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   667
			if(($value !~ /\"/) && (!$argWithQuotes)) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   668
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   669
				if ($value !~ /^\s*$/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   670
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   671
					push @paramFileParamaters,$value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   672
				}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   673
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   674
			# If the parameter is in the form  -fm="faturedb.xml" then remove
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   675
			# double quotes and push it to the list of parameters.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   676
			elsif(($value =~ /\".*\"/))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   677
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   678
				$value =~ s/\"//g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   679
				push @paramFileParamaters,$value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   680
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   681
			# If the parameter is in the form  -fm="fature  db.xml" then read
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   682
			# the parameter starting from opening quote till the closing quote.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   683
			elsif( ($value =~ /\"/) && $argWithQuotes) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   684
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   685
				$argWithQuotes .= $value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   686
				$argWithQuotes =~ s/\"//g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   687
				push @paramFileParamaters,$argWithQuotes;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   688
				$argWithQuotes='';		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   689
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   690
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   691
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   692
				$argWithQuotes .= $value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   693
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   694
		}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   695
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   696
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   697
	close FILE;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   698
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   699
	if (!@paramFileParamaters)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   700
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   701
		print "Warning: No parameters specified in paramer-file \"$paramFile\".\n";		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   702
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   703
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   704
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   705
	my $paramFileFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   706
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   707
	# Invoke subroutine "process_cmdline_arguments" to process the parameters read from
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   708
	# the parameter file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   709
	&process_cmdline_arguments($paramFileFlag, @paramFileParamaters);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   710
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   711
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   712
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   713
# Processes the command line arguments passed to buildrom tool
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   714
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   715
sub process_cmdline_arguments
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   716
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   717
   	my %tmpBldRomOpts;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   718
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   719
	my ($paramFileFlag, @argList); 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   720
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   721
	if (defined @_)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   722
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   723
		($paramFileFlag, @argList) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   724
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   725
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   726
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   727
		@argList = @ARGV;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   728
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   729
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   730
	if (!defined $paramFileFlag) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   731
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   732
		# Enforce Feature Manager if macro SYMBIAN_FEATURE_MANAGER is defined in the HRH file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   733
		my @hrhMacros = &Variant_GetMacroList;	
52
8e8f3d664437 Catch the "no cpp.exe" problem before it triggers an "Unknown arg: -fm" message.
William Roberts <williamr@symbian.org>
parents: 9
diff changeset
   734
		die("No system-wide #defines??!") if (scalar @hrhMacros == 0);	
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   735
		if (grep /^SYMBIAN_FEATURE_MANAGER\s*$/, @hrhMacros)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   736
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   737
			$enforceFeatureManager = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   738
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   739
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   740
		# Process the parameters of parameter-file if passed.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   741
		foreach my $arg (@argList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   742
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   743
			if ($arg =~ /^-argfile=(.*)/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   744
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   745
				&parameterFileProcessor($1);				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   746
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   747
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   748
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   749
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   750
	foreach my $arg (@argList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   751
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   752
	    if ($arg =~ /^-argfile=(.*)/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   753
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   754
			&parameterFileProcessor($1) if (defined $paramFileFlag);						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   755
			next;			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   756
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   757
		if ($arg =~ /^-[DI]/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   758
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   759
		$cppargs .= " $arg";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   760
		#Set 'udeb' for debug option 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   761
		if($arg =~ /^-D_FULL_DEBUG/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   762
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   763
		    $tmpBldRomOpts{"BUILD_DIR"} = "udeb";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   764
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   765
		#Set specific platform supplied from the command option 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   766
		elsif($arg =~ /^-D_PLAT=(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   767
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   768
		    $tmpBldRomOpts{"ABI_DIR"} = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   769
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   770
		# Check for a Feature Variant
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   771
		elsif ($arg =~ /^-DFEATUREVARIANT=(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   772
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   773
			my $varname = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   774
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   775
			if ($varname =~ /^\.(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   776
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   777
				# for testing, locate the VAR file in the current directory
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   778
				%featureVariant = featurevariantparser->GetVariant($1, ".");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   779
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   780
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   781
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   782
				%featureVariant = featurevariantparser->GetVariant($varname);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   783
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   784
			if (!$featureVariant{'VALID'})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   785
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   786
			    print "FEATUREVARIANT $varname is not VALID\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   787
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   788
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   789
			if ($featureVariant{'VIRTUAL'})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   790
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   791
			    print "FEATUREVARIANT $varname is VIRTUAL\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   792
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   793
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   794
			addDrivesToFeatureVariantPaths();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   795
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   796
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   797
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   798
	    if ($arg =~ /^-o(.*)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   799
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   800
		$opt_o = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   801
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   802
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   803
	    if ($arg =~ /^-fastcompress$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   804
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   805
		    $opt_fastcompress = "-fastcompress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   806
		    next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   807
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   808
	    if ($arg =~ /^-j(\d+)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   809
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   810
		    $opt_jobs = "-j".$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   811
		    next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   812
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   813
	    if ($arg =~ /^-v$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   814
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   815
		$opt_v =1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   816
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   817
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   818
	    if ($arg =~ /^-s$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   819
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   820
		$strict = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   821
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   822
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   823
	    if ($arg =~ /^-w$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   824
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   825
		$warnSelection = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   826
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   827
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   828
	    if ($arg =~ /^-p$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   829
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   830
		$preserve = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   831
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   832
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   833
	    if ($arg =~ /^-nospi$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   834
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   835
		$createspi=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   836
		$spiset=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   837
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   838
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   839
	    if ($arg =~ /^-spi$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   840
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   841
		$createspi=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   842
		$spiset=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   843
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   844
	    }	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   845
	    #Process External Tool
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   846
	    if ($arg =~/^-e(.*)/)#Match to get the tool perl module files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   847
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   848
		&externaltools::loadTools($1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   849
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   850
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   851
   		#Process imagecontent file 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   852
	    if( $arg =~ /^-i(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   853
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   854
# Disabling -i option
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   855
		print "Warning: Ignoring invalid Option $arg \n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   856
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   857
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   858
		#Process feature manager database xml file 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   859
	    if($arg =~ /^-fm=(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   860
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   861
			if (!$enforceFeatureManager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   862
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   863
				print "Unknown arg: $arg\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   864
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   865
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   866
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   867
			$featureXml = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   868
			$xmlrequired = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   869
			$featuremanager = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   870
			if ($featureXml =~ /^$/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   871
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   872
				print "Error: No filename specified with \"-fm=\" option.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   873
			}			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   874
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   875
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   876
	    #Process ROM image compression type if it's specified through command line option.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   877
	    if($arg =~ /^-compress(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   878
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   879
	    	if($1 eq '')
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   880
	    	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   881
	    		$opt_compression_type = ALLSECTIONS;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   882
	    		print "Whole ROM image will be compressed.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   883
	    	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   884
	    	elsif($1 eq '=paged')
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   885
	    	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   886
	    		$opt_compression_type = PAGEDSECTION;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   887
	    		print "Paged section of the ROM image will be compressed.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   888
	    	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   889
	    	elsif($1 eq '=unpaged')
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   890
	    	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   891
	    		$opt_compression_type = UNPAGEDSECTION;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   892
	    		print "Unpaged section of the ROM image will be compressed.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   893
	    	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   894
	    	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   895
	    	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   896
	    		print "Unknown compression type: $1\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   897
	    		$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   898
	    	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   899
	    	next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   900
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   901
		if ($arg =~ /^-nofm(=(.*))?$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   902
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   903
			if (!$enforceFeatureManager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   904
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   905
				print "Unknown arg: $arg\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   906
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   907
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   908
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   909
   			$noFeatureManager = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   910
            #DEF125375 If caller is simply giving -nofm without any parameter, a warning message will be given.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   911
            if(!$2)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   912
            {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   913
                print "Warning: No filename specified with \"-nofm=\" option, feature data file might not be included.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   914
            }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   915
            else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   916
            {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   917
                $preBuiltFeaturesDataFile = $2;						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   918
            }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   919
			next;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   920
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   921
		#Process feature registry database xml file 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   922
	    if($arg =~ /^-fr=(.*)/ || $arg =~ /^-f(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   923
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   924
			if ($enforceFeatureManager)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   925
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   926
				print "Error: Option \"-f|-fr\" is no longer supported.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   927
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   928
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   929
			}			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   930
			$featureXml = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   931
			$xmlrequired = 1;			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   932
			if ($featureXml =~ /^$/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   933
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   934
				print "Error: No filename specified with \"-f|-fr\" option.\n";				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   935
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   936
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   937
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   938
	    if ($arg =~ /^-spiplacement$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   939
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   940
			$spiplacement = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   941
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   942
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   943
		if ($arg =~ /^-noimage$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   944
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   945
			$noimage=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   946
			next;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   947
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   948
		if ($arg =~ /^-nosymbols$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   949
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   950
			$nosymbols=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   951
			next;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   952
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   953
		if ($arg =~ /^-geninc$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   954
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   955
			$geninc=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   956
			next;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   957
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   958
		if($arg =~ /^-gendep$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   959
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   960
			$gendep=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   961
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   962
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   963
        if($arg =~/^-c(.*)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   964
        {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   965
          if($1 eq 'none' )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   966
          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   967
              $opt_compression = " -compressionmethod none";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   968
          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   969
          elsif($1 eq 'inflate' )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   970
          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   971
              $opt_compression = " -compressionmethod inflate";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   972
          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   973
          elsif($1 eq 'bytepair' )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   974
          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   975
              $opt_compression = " -compressionmethod bytepair";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   976
          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   977
          else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   978
          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   979
              print "Unknown compression method: $1\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   980
              $errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   981
          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   982
          next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   983
        }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   984
		if( $arg =~ /^-loglevel\d+$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   985
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   986
			$logLevel= $arg;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   987
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   988
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   989
		# get Z directory location if specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   990
		# if yes, then extract directory location from the given array element. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   991
		if( $arg =~ /^-z=(.*)/  || $arg =~ /^-zdrivepath=(.*)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   992
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   993
			# check for white space in the specified folder path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   994
			# if "yes" then warn the user saying folder will be created under default location.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   995
			# else set the path specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   996
			if(&datadriveimage::checkForWhiteSpace($1,"zdrive"))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   997
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   998
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
   999
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1000
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1001
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1002
				$ZDirloc  = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1003
				if( $ZDirloc !~ m/\\(\Z)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1004
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1005
					$ZDirloc .= "\\"; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1006
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1007
				if( $ZDirloc !~ m/:/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1008
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1009
					print "drive letter not specified\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1010
					$ZDirloc = &datadriveimage::setPath($ZDirloc);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1011
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1012
				print "Z Drive directory location = $ZDirloc\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1013
				#set the location of Z Drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1014
				$ZDirloc .= "zdrive";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1015
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1016
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1017
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1018
		# get data directory location if specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1019
		# if yes, then extract directory location from the given array element. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1020
		if( $arg =~ /^-d=(.*)/ || $arg =~ /^-datadrivepath=(.*)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1021
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1022
			# check for white space in the specified folder path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1023
			# if "yes" then warn the user saying folder will be created under default location.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1024
			# else set the path specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1025
			if(&datadriveimage::checkForWhiteSpace($1,"datadrive"))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1026
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1027
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1028
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1029
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1030
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1031
				$DataDriveDirloc = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1032
				if( $DataDriveDirloc !~ m/\\(\Z)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1033
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1034
					$DataDriveDirloc .= "\\"; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1035
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1036
				if( $DataDriveDirloc !~ m/:/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1037
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1038
					print "drive not specified\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1039
					$DataDriveDirloc = &datadriveimage::setPath($DataDriveDirloc);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1040
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1041
				print "Data Drive directory location = $DataDriveDirloc\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1042
				#set the location of Data Drive directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1043
				$DataDriveDirloc .= "datadrive";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1044
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1045
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1046
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1047
		# get Z dive image if specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1048
		if( $arg =~ /^-zdriveimage=(.*)/i )	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1049
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1050
			my $imageName = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1051
			if( $imageName =~ m/\,/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1052
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1053
				@zdriveImageName = split(/\,/,$imageName);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1054
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1055
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1056
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1057
				push(@zdriveImageName,$imageName);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1058
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1059
			$opt_zimage = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1060
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1061
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1062
		# get command line arguments which needs to be passed to INTERPRETSIS, if specified by the user.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1063
		if( $arg =~ /^-argforinterpretsis=(.*)/i )	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1064
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1065
			my $interpretsisOpt = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1066
			if( $interpretsisOpt =~ m/\,/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1067
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1068
				@interpretsisOptList = split(/\,/,$interpretsisOpt);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1069
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1070
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1071
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1072
				push(@interpretsisOptList,$interpretsisOpt);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1073
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1074
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1075
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1076
		if ( $arg =~ /^-k$/i || $arg =~ /^-keepgoing$/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1077
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1078
			$opt_k = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1079
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1080
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1081
		if ( $arg =~ /^-r$/i || $arg =~ /^-retainfolder$/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1082
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1083
			$opt_r = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1084
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1085
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1086
		if ( $arg =~ /^-pfile=(.*)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1087
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1088
			$paraFile = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1089
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1090
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1091
		if ( $arg =~ /^-l=(.*)/i || $arg =~ /^-logimageentry=(.*)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1092
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1093
			if( $1 =~/\\/ || $1 =~ m/:/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1094
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1095
				print "* Warning: Invalid log file extension try filename.txt\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1096
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1097
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1098
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1099
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1100
				$opt_logFile = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1101
				$imageEntryLogFile = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1102
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1103
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1104
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1105
		if ( $arg =~ /^-lowmem/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1106
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1107
			$lowMem = $arg;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1108
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1109
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1110
	    if ($arg =~ /^-/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1111
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1112
		print "Unknown arg: $arg\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1113
		$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1114
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1115
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1116
	    # It's an OBY file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1117
	    next if (match_obyfile($arg));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1118
	    next if (match_obyfile("$arg.oby"));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1119
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1120
	    print "Cannot find oby file: $arg\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1121
	    $errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1122
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1123
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1124
	if (defined $paramFileFlag) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1125
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1126
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1127
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1128
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1129
	if (@obyfiles<1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1130
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1131
	    print "Missing obyfile argument\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1132
	    $errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1133
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1134
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1135
	if ($errors)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1136
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1137
	    print_usage();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1138
	    exit 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1139
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1140
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1141
	if ($noFeatureManager && $featuremanager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1142
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1143
		print "Warning: Ignoring \"-nofm\" option, as both \"-nofm\" and \"-fm\" options are provided.\n";			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1144
		$noFeatureManager = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1145
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1146
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1147
	# Adding variant specific macros by including a HRH file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1148
	# (only required if no Feature Variant is used)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1149
	if (!$featureVariant{'VALID'})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1150
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1151
	    my $variantMacroHRHFile = Variant_GetMacroHRHFile();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1152
	    if($variantMacroHRHFile){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1153
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1154
	        my $variantFilePath = Path_Split('Path',$variantMacroHRHFile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1155
	        $cppargs .= " -I \"" . &Path_RltToWork($variantFilePath) . "\" -include \"" . &Path_RltToWork($variantMacroHRHFile) . "\""; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1156
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1157
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1158
	# load the required modules if xml is required
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1159
	if ($xmlrequired == 1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1160
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1161
	    my $epocToolsPath = $ENV{EPOCROOT}."epoc32\\tools\\";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1162
	    Load_SetModulePath($epocToolsPath);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1163
	    if (defined ($featureXml))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1164
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1165
			load_featuresutil();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1166
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1167
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1168
	    if ($image_content)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1169
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1170
	    	&Load_ModuleL("ImageContentHandler");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1171
	    	# some variables for ImageContentHandler may have been setup
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1172
	    	my ($key, $value);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1173
	    	&ImageContentHandler::SetBldRomOpts; # Defaults to ARMV5 platform
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1174
	    	while (($key,$value) = each %tmpBldRomOpts)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1175
	    	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1176
			&ImageContentHandler::SetBldRomOpts($key, $value);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1177
	    	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1178
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1179
	    
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1180
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1181
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1182
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1183
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1184
# Preprocessing phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1185
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1186
# Concatentate the specified .oby files and pass them through cpp
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1187
# to get the raw ROM specification in tmp1.oby
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1188
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1189
sub preprocessing_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1190
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1191
	unlink "tmp1.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1192
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1193
#	Macro "ROM_FEATURE_MANAGEMENT" is defined when "-f|fr" or "-fm" is used
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1194
	if (defined ($featureXml))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1195
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1196
		$cppargs .= " -DROM_FEATURE_MANAGEMENT ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1197
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1198
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1199
	# add pre-include file and include directories for feature variants
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1200
	if ($featureVariant{'VALID'})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1201
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1202
		$cppargs .= " -I.";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1203
		my $incRef = $featureVariant{'ROM_INCLUDES'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1204
		if ($incRef)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1205
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1206
			foreach (@$incRef)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1207
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1208
		    	$cppargs .= " -I \"$_\"";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1209
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1210
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1211
		my $HRH = $featureVariant{'VARIANT_HRH'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1212
		if ($HRH)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1213
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1214
		    $cppargs .= " -include \"$HRH\"";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1215
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1216
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1217
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1218
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1219
		# no feature variant so use the standard includes
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1220
		$cppargs .= " -I. -I$rominclude";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1221
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1222
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1223
	print "* cpp -o tmp1.oby $cppargs\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1224
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1225
	$errors = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1226
	open CPP, "| cpp -o tmp1.oby $cppargs" or die "* Can't execute cpp";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1227
	foreach my $arg (@obyfiles)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1228
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1229
		print CPP "\n#line 1 \"$arg\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1230
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1231
		open OBY, $arg or die "* Can't open $arg";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1232
		print "* reading $arg\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1233
		while ($line=<OBY>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1234
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1235
			print CPP $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1236
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1237
		close OBY;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1238
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1239
	close CPP;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1240
	my $cpp_status = $?;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1241
	die "* cpp failed\n" if ($cpp_status != 0 || !-f "tmp1.oby");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1242
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1243
	my $temp1OBYFile = "tmp1.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1244
	if( defined ($image_content))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1245
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1246
		#Read the OBY file that was generated by the pre-processor
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1247
		&ReadPreprocessedFile($temp1OBYFile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1248
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1249
#		Check if the static dependencies of the OBY binaries are resolved.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1250
		&ImageContentHandler::UpdateObyBinaryStaticDep();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1251
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1252
		#Now append the files collected from cdfs.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1253
		&ImageContentHandler::GenObyFile($temp1OBYFile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1254
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1255
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1256
	# Setup default rom configuration
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1257
	$romimage[0] = {xip=>1, compress=>0, extension=>0, composite=>"none",uncompress=>0 };
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1258
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1259
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1260
sub ReadPreprocessedFile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1261
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1262
#	Read the OBY file that was generated by the pre-processor. This OBY is a conglomeration of all the OBYs
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1263
#	passed directly to buildrom and/or the ones passed through Image Content XML.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1264
#	It marks the binaries coming from OBY. This is required to be able to point out the binaries that are 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1265
#	mentioned neither in the OBY nor in the CDF. Such binaries are arrived at through static dependencies
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1266
#	and need to be included in ROM.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1267
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1268
	my $temp1OBYFile = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1269
	my $tmpline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1270
	my $srcFileName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1271
	my $srcFilePath;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1272
	my $dstFileName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1273
	my $dstFilePath;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1274
	open (OBYFH, "$temp1OBYFile") or die("* Can't open $temp1OBYFile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1275
	while($tmpline =<OBYFH>) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1276
		if ($tmpline=~/(\S+)\s*=\s*(\S+)\s+(\S+)/) {#Get the first parameter (source File path) from oby line
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1277
			$srcFilePath = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1278
			$dstFilePath = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1279
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1280
			if ($srcFilePath=~/.*\\(\S+)/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1281
				$srcFileName = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1282
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1283
			if ($dstFilePath=~/.*\\(\S+)/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1284
				$dstFileName = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1285
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1286
			my $binaryInfoRef = &cdfparser::GetBinaryInfo($dstFileName);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1287
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1288
			if(defined($binaryInfoRef)) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1289
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1290
				#Found in CDF file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1291
				if($binaryInfoRef->{IsFoundInCDF})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1292
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1293
					print "Warning: File $srcFileName mentioned in OBY as well as CDF file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1294
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1295
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1296
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1297
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1298
				#Found in OBY file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1299
				&ImageContentHandler::AddBinaryFromOby($dstFileName, $srcFilePath);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1300
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1301
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1302
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1303
	close OBYFH;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1304
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1305
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1306
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1307
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1308
# Substitution phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1309
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1310
# Handle the "define XXX YYY" lines, perform the substitutions.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1311
# Print out any ECHO lines or ERROR lines. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1312
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1313
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1314
# Predefined substitutions: 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1315
#   TODAY means todays' date
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1316
#   RIGHT_NOW means the exact time
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1317
#   EPOCROOT taken from the environment
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1318
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1319
sub substitution_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1320
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1321
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1322
		my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1323
		$substitutionData{"TODAY"} = sprintf("%02d/%02d/%04d", $mday, $mon+1, $year+1900);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1324
		$substitutionData{"RIGHT_NOW"} = sprintf("%02d/%02d/%04d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1325
		$substitutionData{"EPOCROOT"} = $epocroot;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1326
		@substitutionOrder = ("TODAY", "RIGHT_NOW", "EPOCROOT");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1327
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1328
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1329
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1330
	open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1331
	while ($line=<TMP1>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1332
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1333
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1334
		if(($line =~ /^\s*romsize\s*=/i) || ( $line=~ /^\s*rom_image/i) || ($line =~ /^\s*data_image/i))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1335
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1336
			$onlysmrimage = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1337
			last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1338
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1339
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1340
	close TMP1;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1341
	if ($enforceFeatureManager && (!$featuremanager) && (!$noFeatureManager) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1342
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1343
		my $defaultFeatureDbFlag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1344
		open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1345
		while ($line=<TMP1>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1346
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1347
			if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1348
			{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1349
				# Get the default value for featuredatabasefile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1350
                
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1351
				$featureXml = "$epocroot$1";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1352
				$featuremanager = 1;				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1353
				$defaultFeatureDbFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1354
				load_featuresutil();				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1355
				last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1356
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1357
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1358
		close TMP1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1359
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1360
		if(!$defaultFeatureDbFlag && !$onlysmrimage)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1361
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1362
			print "Error: Neither option \"-fm|-nofm\" nor default value for featuredatabase file is provided.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1363
			exit(1);			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1364
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1365
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1366
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1367
	open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1368
	while ($line=<TMP1>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1369
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1370
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1371
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1372
		# Recognise keywords in lines that we process before substitution
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1373
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1374
		# # lineno "file" flagno
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1375
		# DEFINE name replacement-with-0-spaces
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1376
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1377
		if($line=~/^\s*$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1378
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1379
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1380
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1381
		if ($line=~/^# (\d+) "(.*)" (\d+)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1382
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1383
			push @obydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1384
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1385
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1386
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1387
		if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1388
		{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1389
			push @obydata, "REM $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1390
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1391
		}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1392
		#process the External tool invocation using IBY file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1393
		if ($line=~/externaltool=(.*),?/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1394
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1395
			&externaltools::loadTools($1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1396
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1397
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1398
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1399
		#Process the patch statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1400
		if($line =~ /^\s*patchdata\s*(.*)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1401
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1402
			$patchDataStmtFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1403
			my $new_line = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1404
 			# syntax "<DLLnamewithpath> addr <variableaddress> <variablesize> <newvalue>"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1405
 			# If the line matches with above syntax, just add the line into oby file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1406
 			if($new_line !~ /^\s*(\S+)\s+addr\s+(\S+)\s+(\S+)\s+(\S+)\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1407
 			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1408
 				if(AddDllDataInfo($new_line))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1409
 				{
57
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1410
 					# wasn't a valid line, so comment it out
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1411
					$line = "REM $line";
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1412
 				}
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1413
 				else
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1414
 				{
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1415
 					# valid patchdata command, retain it for final processing (during reformat_line!)
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1416
 					# In expectation that it will be OK later, emit the "REM processed" marker here
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1417
 					push @obydata, "REM processed $line";
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1418
 					push @obydata, reassert_sourceline();
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1419
 				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1420
 			}
57
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1421
 			push @obydata, "$line";
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  1422
 			next;
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1423
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1424
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1425
		if($line =~ /^\s*FEATURE\s*(.*)/i || $line =~ /^\s*EXCLUDE_FEATURE\s*(.*)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1426
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1427
			# Process the feature keywords only when "-f|fr" or "-fm" is passed to buildrom
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1428
			if(defined ($featureXml))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1429
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1430
				push @obydata, "$line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1431
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1432
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1433
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1434
				push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1435
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1436
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1437
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1438
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1439
		if ($line=~/^\s*DEFINE\s+(\w+)\s+(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1440
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1441
			my $key=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1442
			my $value=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1443
			foreach my $wordToSubstitute (@substitutionOrder)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1444
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1445
				my $whatToSubstituteItWith=$substitutionData{$wordToSubstitute};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1446
				$value=~s/$wordToSubstitute/$whatToSubstituteItWith/g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1447
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1448
			$value=~s/##//g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1449
			if (defined $substitutionData{$key})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1450
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1451
				# If the key is redefined, apply it at the new position rather
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1452
				# than the old one.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1453
				push @obydata, "REM redefined $key as $value\n";# Leave a record of the definition
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1454
				@substitutionOrder = grep !/^$key$/, @substitutionOrder;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1455
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1456
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1457
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1458
				push @obydata, "REM defined $key as $value\n";	# Leave a record of the definition
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1459
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1460
			$substitutionData{$key}=$value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1461
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1462
			foreach my $wordToSubstitute (@substitutionOrder)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1463
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1464
	   	        if ($key =~ /$wordToSubstitute/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1465
	   	        {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1466
				   print_source_error("Warning: $key is masked by earlier definition of $wordToSubstitute");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1467
			 	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1468
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1469
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1470
			push @substitutionOrder, $key;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1471
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1472
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1473
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1474
		# Do the substitutions in strict order of definition, 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1475
		# then eliminate any old-fashioned ## things which may be left
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1476
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1477
		foreach my $wordToSubstitute (@substitutionOrder)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1478
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1479
			my $whatToSubstituteItWith=$substitutionData{$wordToSubstitute};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1480
			$line=~s/$wordToSubstitute/$whatToSubstituteItWith/g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1481
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1482
		$line=~s/##//g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1483
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1484
		# Recognise keywords in lines that we process after substitution
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1485
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1486
		# ECHO  anything at all
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1487
		# WARNING anything at all
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1488
		# ERROR anything at all
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1489
		# LANGUAGE_CODE nnn
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1490
		# DEFAULT_LANGUAGE nnn
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1491
		# ABI_DOWNGRADE from to
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1492
		# ROMBUILD_OPTION command-line-option
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1493
		# ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1494
		# PlatSecEnforceSysBin on|off
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1495
		# ENABLE_SPI/DISABLE_SPI
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1496
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1497
		if ($line=~/^\s*ECHO\s+(.*?)\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1498
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1499
			print "$1\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1500
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1501
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1502
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1503
		if ($line=~/^\s*(ERROR|WARNING)\s+(.*?)\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1504
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1505
			print_source_error("$1 $2");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1506
			$errors++ if ($1 =~ /ERROR/i);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1507
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1508
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1509
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1510
		if ($line=~/^\s*(PlatSecEnforceSysBin)\s+(\S+)\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1511
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1512
			$enforceSysBin = ($2 =~ /ON/i);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1513
			push @obydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1514
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1515
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1516
		if ($line=~/^\s*LANGUAGE_CODE\s+(\S+)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1517
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1518
			my $code = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1519
			if ($code !~ /^\d\d+$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1520
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1521
				print_source_error("bad language code $code");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1522
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1523
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1524
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1525
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1526
				$languageCodes{$code} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1527
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1528
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1529
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1530
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1531
		if ($line=~/^\s*DEFAULT_LANGUAGE\s+(\S+)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1532
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1533
			my $code = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1534
			if ($code !~ /^\d\d+$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1535
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1536
				print_source_error("bad default language code $code");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1537
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1538
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1539
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1540
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1541
				$defaultLanguageCode = $code;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1542
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1543
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1544
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1545
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1546
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1547
		if ($line=~/^\s*ABI_DOWNGRADE\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1548
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1549
			if ($line =~ /\s(.+)\s*->\s*(.+)\s*$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1550
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1551
				$abiDowngrade = "$1 $2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1552
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1553
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1554
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1555
				print_source_error("bad ABI downgrade : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1556
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1557
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1558
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1559
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1560
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1561
		if ($line=~/^\s*BINARY_SELECTION_ORDER\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1562
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1563
	 		if ($line =~ /\s([^,]+)\s*,\s*(.+)\s*$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1564
   			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1565
  				$binarySelectionOrderFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1566
 				$firstDIR = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1567
   				# remove whitespaces
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1568
 				$firstDIR = trim($firstDIR); 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1569
   				@binarySelectionOrder = split(',', $2);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1570
   				@binarySelectionOrder = trim(@binarySelectionOrder);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1571
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1572
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1573
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1574
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1575
				print_source_error("bad order specified: $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1576
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1577
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1578
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1579
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1580
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1581
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1582
		if ($line=~/^\s*ROMBUILD_OPTION\s+(\S+)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1583
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1584
			$rombuildOptions{$1} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1585
			push @obydata, "REM processed $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1586
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1587
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1588
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1589
		if ($line=~/^\s*enable_spi\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1590
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1591
			if(!($spiset)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1592
				$createspi=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1593
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1594
			push @obydata, "REM processed $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1595
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1596
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1597
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1598
		if ($line=~/^\s*disable_spi\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1599
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1600
			if(!($spiset)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1601
				$createspi=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1602
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1603
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1604
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1605
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1606
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1607
		if ($line=~/^\s*DATA_IMAGE\s+/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1608
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1609
			if ($line =~ /\s+(\d+)\s+(\S+)\s+/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1610
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1611
				my $datadriveidx = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1612
				my $datadriveimagename = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1613
				# have a count on number of data drive images that needs to be created
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1614
				print "data drive partion name = $datadriveimagename\n " if($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1615
				my $dataimagesize = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1616
				if ($line =~ /\s+size=(\S+)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1617
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1618
					$dataimagesize=$1; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1619
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1620
				my $fstype = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1621
				my $compress=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1622
				my $uncompress=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1623
				if ($line =~ /\s+compress\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1624
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1625
					$compress=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1626
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1627
				elsif($line =~ /\s+uncompress\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1628
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1629
					$uncompress=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1630
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1631
				if ($line =~ /\s+fat16\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1632
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1633
					$fstype = "fat16"; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1634
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1635
				if ($line =~ /\s+fat32\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1636
				{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1637
					$fstype = "fat32"; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1638
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1639
				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1640
				$datadriveimage[$datadriveidx] = {name=>$datadriveimagename, size=>$dataimagesize, compress=>$compress, uncompress=>$uncompress, fstype=>$fstype};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1641
				print "DATA_IMAGE[$datadriveidx] $datadriveimage[$datadriveidx]{name} size=$datadriveimage[$datadriveidx]{size} compress=$compress uncompress=$uncompress fstype=$fstype\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1642
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1643
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1644
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1645
				print_source_error("bad DATA_IMAGE specification : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1646
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1647
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1648
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1649
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1650
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1651
		if ($line=~/^\s*ROM_IMAGE\s+/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1652
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1653
			if ($line =~ /\s+(\d+)\s+(\S+)\s+/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1654
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1655
				my $romidx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1656
				my $rompartitionname=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1657
				my $rompartitionsize=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1658
				if ($line =~ /\s+size=(\S+)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1659
					{ $rompartitionsize=$1; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1660
				my $xip=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1661
				my $compress=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1662
				my $uncompress=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1663
				my $extend=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1664
				my $composite="none";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1665
				if ($line =~ /\s+non-xip\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1666
					{ $xip=0; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1667
				if ($line =~ /\s+compress\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1668
					{ $compress=1; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1669
				elsif($line =~ /\s+uncompress\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1670
					{ $uncompress=1;} # This option is passed to rofsbuild. For rombuild, not saying --compress means to uncompress
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1671
				if ($line =~ /\s+extension\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1672
					{ $extend=1; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1673
				if ($line =~ /\s+composite_primary\s*/i) # added to support new composite_primary keyword in obey files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1674
				{	if (!($extend))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1675
						{ $composite="composite_primary"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1676
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1677
						{ print "Error: composite_primary keyword must be used with a core image\n"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1678
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1679
				if ($line =~ /\s+composite_secondary\s*/i) # added to support new composite_secondary keyword in obey files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1680
				{ if (!($extend))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1681
						{ $composite="composite_secondary"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1682
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1683
						{ print "Error: composite_secondary keyword must be used with core image\n"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1684
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1685
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1686
				#	Compress and Uncompress are 2 different options and
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1687
				#	not mentioning one of them doesn't necessarily mean the other.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1688
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1689
				$romimage[$romidx] = {name=>$rompartitionname, size=>$rompartitionsize, xip=>$xip, compress=>$compress, extension=>$extend, composite=>$composite, uncompress=>$uncompress};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1690
				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);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1691
				check_romimage($romidx, $line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1692
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1693
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1694
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1695
				print_source_error("bad ROM_IMAGE specification : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1696
				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1697
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1698
			push @obydata, "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1699
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1700
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1701
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1702
		push @obydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1703
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1704
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1705
	close TMP1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1706
	exit(1) if ($errors);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1707
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1708
	dump_obydata("tmp2.oby", "result of substitution phase") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1709
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1710
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1711
sub check_romimage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1712
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1713
	my ($idx, $line) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1714
	if ($idx gt 7)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1715
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1716
		print_source_error("too many roms : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1717
		$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1718
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1719
	if ($romimage[$idx]{xip} eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1720
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1721
		if ($romimage[$idx]{size} eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1722
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1723
			print_source_error("must specify a size for non-xip ROM : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1724
			$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1725
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1726
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1727
	if ($romimage[$idx]{extension} ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1728
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1729
		if ($romimage[$idx-1]{extension} ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1730
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1731
			print_source_error("cannot extend ROM image multiple times : $line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1732
			$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1733
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1734
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1735
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1736
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1737
sub dump_obydata
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1738
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1739
	my ($dumpfile, $comment) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1740
	unlink($dumpfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1741
	open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1742
	print "* Writing $dumpfile - $comment\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1743
	my $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1744
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1745
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1746
		print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1747
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1748
	close DUMPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1749
	open SLY_COPY, ">xxx_$dumpfile";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1750
	print SLY_COPY @obydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1751
	close SLY_COPY;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1752
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1753
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1754
sub track_source
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1755
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1756
	my ($line) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1757
	if ($line=~/^# (\d+) "(.*)"/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1758
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1759
		$sourceline=$1-1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1760
		$sourcefile=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1761
		$sourcefile=~ s/\//\\/g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1762
		$sourcefile=~ s/\\\\/\\/g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1763
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1764
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1765
	$sourceline++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1766
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1767
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1768
sub print_source_error
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1769
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1770
	my ($message) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1771
	print "$sourcefile($sourceline): $message\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1772
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1773
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1774
sub reassert_sourceline
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1775
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1776
	my ($offset) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1777
	return sprintf "# %d \"$sourcefile\" \n", $sourceline+1+$offset;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1778
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1779
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1780
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1781
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1782
# Reorganisation phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1783
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1784
# Group lines beginning with "rom_image[<id>]" and deposit them in the appropriate
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1785
# order.  Truncate the description at the "stop" line, if there is one.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1786
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1787
sub reorganize_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1788
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1789
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1790
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1791
	my @section2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1792
	my @part3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1793
	my @part4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1794
	my @part5;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1795
	my @part6;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1796
	my @part7;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1797
	my @part8;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1798
	my @partitions = ( \@newobydata, \@section2, \@part3, \@part4, \@part5, \@part6, \@part7, \@part8 );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1799
	my @currentpartition;	# partition stack
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1800
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1801
	my @processedImageIdx;		# list of proccesed data drive image index. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1802
	my $dataDriveStartRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1803
	my $dataDriveEndRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1804
	my $dataDriveIdx;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1805
	my @datapartition;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1806
	my @linesArray;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1807
	my $curlyBraceShouldFollow;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1808
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1809
	my $collect_section2=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1810
	my $smrImageStartRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1811
	my $smrImageEndRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1812
	my $smrImageIndex = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1813
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1814
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1815
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1816
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1817
		if ($line=~/^\s*stop/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1818
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1819
			last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1820
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1821
		if ($line =~ /^\s*ROM_IMAGE\[(\S+)\]\s+\{(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1822
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1823
			# ROM_IMAGE[n] {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1824
			my $idx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1825
			my $partition=$partitions[$idx];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1826
			push @currentpartition, $partition;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1827
			$line="REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1828
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1829
		elsif( ($line =~ /^\s*DATA_IMAGE\[(\S+)\]\s*$/i) || ($line =~ /^\s*DATA_IMAGE\[(\S+)\]\s*\{\s*$/i))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1830
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1831
			# DATA_IMAGE[n] or DATA_IMAGE[n] {  is specified.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1832
			# get the index.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1833
			$dataDriveIdx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1834
 			if($line !~ /\s*\{\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1835
 			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1836
 				$curlyBraceShouldFollow = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1837
 			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1838
			# make a check if dataDriveIdx exists in the processedImageIdx array.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1839
			# if no, then push the dataDriveIdx on the processedImageIdx array.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1840
			# if yes,then dont execute the loop.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1841
			if(&datadriveimage::checkInArray(\@processedImageIdx,$dataDriveIdx))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1842
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1843
				# push the index on to the array.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1844
				push(@processedImageIdx,$dataDriveIdx);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1845
				# increment the image count. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1846
				++$dataImageCount;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1847
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1848
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1849
			$dataIndexHash{($dataImageCount-1)} = $dataDriveIdx;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1850
			# set start of the image section.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1851
			$dataDriveStartRegion = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1852
			# set end of image section to zero.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1853
			$dataDriveEndRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1854
			push (@linesArray,"\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1855
			$line="REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1856
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1857
		elsif( $line =~ /^\s*SMR_IMAGE\s*\{\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1858
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1859
			$smrImageStartRegion = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1860
			$smrImageEndRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1861
			$needSmrImage = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1862
			push (@linesArray, "\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1863
			$line="REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1864
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1865
 		elsif((defined $curlyBraceShouldFollow) && ($line !~ /^\s*$/i))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1866
 		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1867
			undef $curlyBraceShouldFollow;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1868
 			if($line !~ /^\s*\{\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1869
 			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1870
 				print "Error: Symbol '{' not followed after the keyword DATA_IMAGE\[".$dataDriveIdx."\]\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1871
 				$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1872
 			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1873
 			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1874
 		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1875
		# data drive specific keywords.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1876
		elsif( $line =~/^\s*dataimagename\s*\=\s*(\S+)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1877
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1878
			# set the name for the image, if image name is specified using driveimagename keyword.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1879
			$datadriveimage[$dataDriveIdx]{name} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1880
			print"datadriveimagename = $datadriveimage[$dataDriveIdx]{name}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1881
			# skip the line.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1882
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1883
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1884
		elsif( $line =~/^\s*dataimagesize\s*\=\s*(\S+)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1885
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1886
			# set the size for the image, if image size is specified using driveimagesize keyword.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1887
			$datadriveimage[$dataDriveIdx]{size} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1888
			print"datadriveimagesize = $datadriveimage[$dataDriveIdx]{size}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1889
			# skip the line.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1890
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1891
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1892
		elsif( $line =~/^\s*dataimagefilesystem\s*\=\s*(\S+)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1893
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1894
			# set the file system type for the image, if image file system is specified using dataimagefilesystem keyword.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1895
			$datadriveimage[$dataDriveIdx]{fstype} = $1 if($dataDriveStartRegion && !$dataDriveEndRegion);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1896
			print"datadriveimagefstype = $datadriveimage[$dataDriveIdx]{fstype}\n" if($dataDriveStartRegion && !$dataDriveEndRegion && $opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1897
			# skip the line.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1898
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1899
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1900
		elsif( $line =~/^\s*compress/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1901
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1902
			# Compresses the resulting data drive image using the Deflate, Huffman+LZ77 algorithm.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1903
			if($dataDriveStartRegion && !$dataDriveEndRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1904
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1905
				$datadriveimage[$dataDriveIdx]{compress} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1906
				$datadriveimage[$dataDriveIdx]{uncompress} = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1907
				print"datadriveimage[$dataDriveIdx] compress = $datadriveimage[$dataDriveIdx]{compress}\n" if($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1908
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1909
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1910
		elsif( $line =~/^\s*uncompress/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1911
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1912
			# Uncompresses the resulting data drive image.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1913
			if($dataDriveStartRegion && !$dataDriveEndRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1914
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1915
				$datadriveimage[$dataDriveIdx]{uncompress} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1916
				$datadriveimage[$dataDriveIdx]{compress} = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1917
				print"datadriveimage[$dataDriveIdx] uncompress = $datadriveimage[$dataDriveIdx]{uncompress}\n" if($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1918
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1919
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1920
		elsif ($line =~ /^\s*ROM_IMAGE\[(\S+)\](.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1921
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1922
			# ROM_IMAGE[n] file=...
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1923
			my $origline=$line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1924
			$line="$2\n";	# remove the ROM_IMAGE[.] keyword
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1925
			my $idx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1926
			my $partition=$partitions[$idx];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1927
			push @$partition, reassert_sourceline(-1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1928
			push @$partition, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1929
			$line="REM handled $origline";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1930
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1931
		elsif ($line =~ /^\s*DATA_IMAGE\[(\S+)\](.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1932
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1933
			# DATA_IMAGE[n] file=...
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1934
			my $origline=$line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1935
			# remove the DATA_IMAGE[.] keyword
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1936
			$line="$2\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1937
			# get the index value
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1938
			my $idx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1939
			# iterate through the hash to get corresponding 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1940
			# key from the value(i.e idx) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1941
			while (my($key, $value) = each(%dataIndexHash))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1942
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1943
				if ($value eq $idx ) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1944
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1945
					$idx = $key;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1946
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1947
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1948
			push @{$datapartition[$idx]}, reassert_sourceline(-1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1949
			push @{$datapartition[$idx]}, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1950
			$line="REM handled $origline";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1951
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1952
		elsif ($line =~ /^\s*\}.*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1953
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1954
			if($dataDriveStartRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1955
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1956
				# since "}" brace is encountered
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1957
				# reset the start of DATA_IMAGE to zero.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1958
				$dataDriveStartRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1959
				# mark the the end of the DATA_IMAGE.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1960
				$dataDriveEndRegion = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1961
				if(!$datadriveimage[$dataDriveIdx]{name})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1962
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1963
					# image name is not defined, define a default name.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1964
					$datadriveimage[$dataDriveIdx]{name} = "dataImage".$dataDriveIdx;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1965
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1966
				if(!$datadriveimage[$dataDriveIdx]{fstype})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1967
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1968
					# image name is not defined, define a default name.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1969
					$datadriveimage[$dataDriveIdx]{fstype} = "fat16";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1970
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1971
				foreach my $file (@linesArray)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1972
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1973
					push @{$datapartition[($dataImageCount-1)]},$file;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1974
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1975
				## if end of the DATA_IMAGE is true,
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1976
				## make room for next DATA_IMAGE if any.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1977
				undef(@linesArray); 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1978
				#un define $dataDriveIdx;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1979
				undef($dataDriveIdx);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1980
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1981
			elsif($smrImageStartRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1982
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1983
				$smrImageStartRegion = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1984
				$smrImageEndRegion = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1985
				foreach my $file (@linesArray)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1986
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1987
					push @{$smrPartitions{$smrImageIndex}}, $file;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1988
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1989
				undef(@linesArray);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1990
				$smrImageIndex++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1991
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1992
			elsif (scalar @currentpartition > 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1993
			{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1994
				pop @currentpartition; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1995
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1996
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1997
			{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1998
				print "WARNING: closing '}' found with no matching 'ROM_IMAGE[<n>]/DATA_IMAGE[<n>] {'\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  1999
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2000
			$line="REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2001
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2002
		elsif ($line=~/^\s*section2(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2003
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2004
			my $origline=$line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2005
			$line="$1\n";	# remove the section2 keyword
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2006
			if ($collect_section2)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2007
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2008
				push @section2, reassert_sourceline(-1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2009
				push @section2, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2010
				$line="REM handled $origline";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2011
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2012
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2013
		elsif ($line=~/^\s*section/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2014
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2015
			push @newobydata, $line;		# insert the section statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2016
			if (@section2 != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2017
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2018
				push @newobydata, "REM accumulated section2 lines\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2019
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2020
			foreach $line (@section2)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2021
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2022
				push @newobydata, $line;	# insert accumulated section2 lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2023
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2024
			$collect_section2=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2025
			$line = reassert_sourceline();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2026
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2027
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2028
		elsif ($line=~/^\s*extensionrom/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2029
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2030
			# end of ROM description, so deposit accumulated lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2031
			if (@section2 != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2032
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2033
				push @newobydata, "REM accumulated section2 lines\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2034
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2035
			foreach $line (@section2)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2036
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2037
				push @newobydata, $line;	# insert accumulated section2 lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2038
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2039
			$collect_section2=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2040
			push @newobydata, reassert_sourceline();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2041
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2042
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2043
		elsif ( scalar(@linesArray) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2044
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2045
			if($dataDriveStartRegion && !$dataDriveEndRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2046
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2047
				my $modifiedLine = $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2048
				push @linesArray, $modifiedLine;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2049
				$line = "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2050
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2051
			elsif($smrImageStartRegion && !$smrImageEndRegion)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2052
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2053
				if($line =~ /^\s*IMAGENAME\s*=\s*(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2054
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2055
					my $smrimagename = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2056
					$smrimagename =~s/(\.img)//i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2057
					if(exists($smrNameInfo{$smrimagename}))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2058
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2059
						$smrNameInfo{$smrimagename}++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2060
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2061
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2062
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2063
						$smrNameInfo{$smrimagename} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2064
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2065
					$line =~s/(\.img)//i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2066
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2067
				push @linesArray, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2068
				$line = "REM handled $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2069
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2070
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2071
		elsif (scalar @currentpartition)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2072
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2073
			my $modifiedLine = $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2074
			if ($line =~ /^\s*SPI_POSITION/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2075
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2076
				if(!($createspi && $spiplacement))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2077
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2078
					# comment the line if the spi placement flag is not enabled or if the spi creation is not enabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2079
					$modifiedLine = "REM SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2080
					print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2081
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2082
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2083
			# a partition is specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2084
			# push this line into the currently selected partition
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2085
			my $partition=@currentpartition[-1];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2086
			push @$partition, $modifiedLine;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2087
			next; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2088
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2089
		elsif ($line =~ /^\s*SPI_POSITION/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2090
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2091
			if(!($createspi && $spiplacement))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2092
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2093
                # comment the line if the spi placement flag is not enabled or if the spi creation is not enabled.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2094
                $line = "REM SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2095
                print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2096
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2097
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2098
		push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2099
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2100
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2101
	# output the grouped data
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2102
	my $partitionidx=2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2103
	if ($collect_section2)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2104
		{ $partitionidx=1; } # output old "section2" if not done already
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2105
	for (; $partitionidx<8; $partitionidx++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2106
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2107
		my $partition=$partitions[$partitionidx];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2108
		if (@$partition != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2109
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2110
			push @newobydata, "REM ROM_IMAGE[$partitionidx]\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2111
			foreach $line (@$partition)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2112
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2113
				push @newobydata, $line;	# insert accumulated section2 lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2114
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2115
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2116
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2117
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2118
	for ( my $datapartitionidx=0; $datapartitionidx < $dataImageCount; $datapartitionidx++ )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2119
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2120
		if( defined( @{ $datapartition[$datapartitionidx] } ) )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2121
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2122
			push @newobydata, "REM DATA_IMAGE[$dataIndexHash{$datapartitionidx}]\n" ;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2123
			foreach my $file (@{$datapartition[$datapartitionidx]})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2124
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2125
				push @newobydata, $file;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2126
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2127
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2128
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2129
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2130
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2131
	foreach my $imageIndex (keys(%smrPartitions))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2132
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2133
		my $imagename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2134
		my @obeyfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2135
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2136
		foreach (@{$smrPartitions{$imageIndex}})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2137
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2138
			if(/^\s*imagename\s*=\s*(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2139
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2140
				$imagename = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2141
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2142
			push @obeyfile, $_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2143
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2144
		if($smrNameInfo{$imagename} == 1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2145
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2146
			push @obeyFileList, $imagename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2147
			push @newobydata, "REM SMR_IMAGE \n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2148
			push @newobydata, @obeyfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2149
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2150
		if(! defined($imagename))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2151
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2152
			$smrNoImageName = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2153
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2154
		undef $imagename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2155
		undef @obeyfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2156
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2157
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2158
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2159
	exit(1) if ($errors);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2160
	dump_obydata("tmp3.oby", "result of reorganisation phase") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2161
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2162
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2163
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2164
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2165
# Plugin phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2166
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2167
# Process any plugin annotation lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2168
# Note: This expands resource lines to include MULTI_LINGUIFY so must be done before
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2169
# the Multilinguify phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2170
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2171
# hash of SPI file target directories is located near the start of this file, before sub match_obyfile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2172
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2173
sub plugin_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2174
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2175
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2176
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2177
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2178
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2179
	 	if ($line =~ /^\s*REM/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2180
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2181
		# ignore REM statements, to avoid processing "REM ECOM_PLUGIN(xxx,yyy)"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2182
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2183
		elsif(plugin_match($line)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2184
			$line = reassert_sourceline();		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2185
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2186
		push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2187
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2188
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2189
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2190
	dump_obydata("tmp4.oby", "result of Plugin stage") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2191
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2192
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2193
sub plugin_match ()
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2194
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2195
	my ($line) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2196
	foreach my $plugintype (keys(%plugintypes)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2197
	  if ($line =~ m/^.*__$plugintype\_PLUGIN\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2198
	  	# __<plugin-type>_PLUGIN(emulator directory, file rom dir, dataz_, resource rom dir, filename, resource filename)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2199
	  {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2200
		    my $emulatorDir=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2201
		    my $fileRomDir=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2202
		    my $dataz_= $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2203
		    my $resourceDir=$4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2204
		    my $pluginFileName=$5;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2205
		    my $pluginResourceName=$6;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2206
		    my $spidatahide = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2207
			my $paged_data = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2208
  
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2209
			if ($line =~ m/paged\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2210
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2211
				$line =~ m/\s+(\S+)\s*$/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2212
				$paged_data = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2213
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2214
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2215
		    if ($line =~ m/^\s*(_hide)/i )
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2216
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2217
		    	$spidatahide = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2218
		    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2219
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2220
		    # for resource files strip the .rsc or .dll from the end   (will be .dll where we use
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2221
		    # SYMBIAN_SECURE_ECOM and are building resources to  the same name as ecom plugin dlls)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2222
		    
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2223
		    if ($pluginResourceName =~ m/^(.+)\./)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2224
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2225
		      $pluginResourceName = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2226
		    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2227
		    else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2228
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2229
		      print_source_error("Invalid Resource name: $pluginResourceName in " . $plugintype . "_PLUGIN :$line");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2230
		      #treat as error if strict option selected;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2231
		      $errors++ if ($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2232
		    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2233
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2234
		    push @newobydata, "REM expanded $line";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2235
		    if ($spidatahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2236
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2237
			push @newobydata, "hide=$fileRomDir\\$pluginFileName\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2238
		    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2239
		    else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2240
		    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2241
		    	push @newobydata, "file=$emulatorDir\\$pluginFileName $fileRomDir\\$pluginFileName $paged_data\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2242
		    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2243
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2244
		    if($createspi) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2245
		    	    if ($spidatahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2246
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2247
			    	push @newobydata, "spidatahide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n";      
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2248
			    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2249
			    else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2250
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2251
			    	push @newobydata, "spidata=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n";      
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2252
			    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2253
		  	} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2254
		    	    if ($spidatahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2255
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2256
			    	push @newobydata, "hide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2257
			    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2258
			    else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2259
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2260
			    	push @newobydata, "data=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2261
			    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2262
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2263
				return 1; #successful match
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2264
	   }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2265
     }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2266
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2267
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2268
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2269
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2270
# Multilinguify phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2271
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2272
# Process the MULTILINGUIFY() lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2273
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2274
sub multlinguify_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2275
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2276
	if ((scalar keys %languageCodes) == 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2277
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2278
		print "* No language codes specified, defaulting to 01\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2279
		$defaultLanguageCode = "01";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2280
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2281
	$languageCodes{$defaultLanguageCode} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2282
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2283
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2284
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2285
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2286
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2287
		if ($line =~ /^\s*REM/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2288
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2289
			# ignore REM statements, to avoid processing "REM data=xxx yyy"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2290
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2291
		elsif ($line=~/^(.*?)\bMULTI_LINGUIFY\s*\(\s*(\S+)\s+(\S+)\s+(\S+)\s*\)(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2292
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2293
			my $initialStuff=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2294
			my $defaultFileNameExtension=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2295
			my $sourceFileNameWithoutExtension=$3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2296
			my $targetFileNameWithoutExtension=$4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2297
			my $finalStuff=$5;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2298
			my $spidataflag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2299
			my $spidatahide = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2300
			my $datahide = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2301
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2302
			if ($initialStuff=~/\w$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2303
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2304
				$initialStuff.=" ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2305
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2306
			if ($finalStuff=~/^\w/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2307
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2308
				$finalStuff=" ".$finalStuff;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2309
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2310
			if ($initialStuff =~ /^\s*spidata/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2311
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2312
				$spidataflag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2313
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2314
			if ($initialStuff =~ /^\s*spidatahide/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2315
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2316
				$spidataflag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2317
				$spidatahide = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2318
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2319
			if ($initialStuff =~ /^\s*hide/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2320
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2321
				$datahide = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2322
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2323
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2324
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2325
# ecom.spi should contain the .RSC files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2326
			if ($spidataflag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2327
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2328
				my $sourceFileNameExtension = $defaultFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2329
				my $targetFileNameExtension = $defaultFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2330
				if (-e "$sourceFileNameWithoutExtension.$sourceFileNameExtension")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2331
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2332
					if ($spidatahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2333
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2334
						push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$finalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2335
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2336
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2337
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2338
						push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension$finalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2339
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2340
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2341
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2342
			my $useDefaultFileNameExtension=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2343
			foreach my $languageCode (keys %languageCodes) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2344
				my $sourceFileNameExtension=$defaultFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2345
				$sourceFileNameExtension=~s/^(.*).{2}$/$1$languageCode/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2346
				if (! -e "$sourceFileNameWithoutExtension.$sourceFileNameExtension")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2347
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2348
					if (!$spidataflag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2349
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2350
						next if (!$useDefaultFileNameExtension);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2351
						next if (defined $defaultLanguageCode and !($languageCode eq $defaultLanguageCode));
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2352
						$useDefaultFileNameExtension=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2353
						if (!$datahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2354
						{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2355
							print "Converting >$sourceFileNameWithoutExtension.$sourceFileNameExtension< to $defaultFileNameExtension\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2356
							$sourceFileNameExtension=$defaultFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2357
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2358
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2359
					else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2360
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2361
						next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2362
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2363
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2364
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2365
				my $targetFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2366
# ecom.sNN should contain the corresponding language code .RNN files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2367
				if(!$spidataflag and (defined $defaultLanguageCode and ($languageCode eq $defaultLanguageCode)))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2368
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2369
					$targetFileNameExtension = $defaultFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2370
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2371
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2372
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2373
					$targetFileNameExtension = $sourceFileNameExtension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2374
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2375
				my $modifiedfinalStuff = $finalStuff;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2376
				$modifiedfinalStuff =~ s/\.spi/\.s$languageCode/i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2377
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2378
				if ($spidatahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2379
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2380
					push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2381
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2382
				elsif ($datahide)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2383
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2384
					push @newobydata, "$initialStuff$targetFileNameWithoutExtension.$targetFileNameExtension$modifiedfinalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2385
					if(!($sourceFileNameExtension eq $targetFileNameExtension))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2386
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2387
						push @newobydata, "$initialStuff$targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2388
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2389
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2390
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2391
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2392
					push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2393
					if(!($sourceFileNameExtension eq $targetFileNameExtension))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2394
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2395
						push @newobydata, "alias $targetFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension $modifiedfinalStuff\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2396
						$multiLinguifyAlias{"$targetFileNameWithoutExtension.$sourceFileNameExtension"} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2397
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2398
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2399
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2400
			$line = reassert_sourceline();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2401
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2402
		push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2403
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2404
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2405
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2406
	dump_obydata("tmp5.oby", "result of choosing language-specific files") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2407
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2408
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2409
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2410
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2411
my @featurefilearray; #2d array storing names and locations of feature files in each rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2412
my @featureslist; #array of hashes, stores all the features which are to go into the feature files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2413
my $featurefilecount=0; #counts number of feature files in each rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2414
my $featurescount=0; #counts number of features
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2415
my $dir; # Stores the ROM image location of features.dat/featreg.cfg files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2416
my $featurefilename; # Stores the name of feature file to be generated(i.e. "features.dat" or "featreg.cfg")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2417
my @spiarray; #2d array storing names and locations of spi files in each rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2418
my @datafiles; #array of hashes, stores all the data files which are to go into the spi files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2419
my @hidedatafiles; #array of hashes, stores all the data files which are to be hidden in the spi files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2420
my $spicount=0; #counts number of spi files in each rom image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2421
my $filescount=0; #counts number of data files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2422
my $hidefilescount=0; #counts number of data files to be hidden
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2423
my $romimage=0; #number of rom image currently working with
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2424
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2425
sub locateexisting 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2426
{ # if an SPI file of this type exists in a base image then returns name of SPI file from the array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2427
	my ($romimage, $spifile, $base) =@_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2428
	my $i=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2429
	while(defined $spiarray[$base][$i]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2430
		if($spiarray[$base][$i]{spi} eq $spiarray[$romimage][$spifile]{spi}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2431
			my $spiname;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2432
			my $spiextension;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2433
			if($spiarray[$base][$i]{spifile} =~ /(.*)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2434
				$spiname=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2435
				$spiextension=$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2436
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2437
			if(-e "$spiname-$base-$i\.$spiextension") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2438
					return "$spiname-$base-$i\.$spiextension";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2439
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2440
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2441
		$i++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2442
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2443
	return "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2444
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2445
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2446
sub create 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2447
{ #called to create SPI file and store in specified directory
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2448
	my ($romimage, $spifile, $base) =@_; #$romimage = current rom image number, $spifile = current spifile number, $base=number of rom image basing on
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2449
	my $existingspi = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2450
	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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2451
		$existingspi = locateexisting($romimage, $spifile, $base);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2452
		if($existingspi ne "") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2453
			$existingspi = "-i$existingspi";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2454
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2455
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2456
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2457
	if($spiarray[$romimage][$spifile]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2458
		my $targetspi="$1-$romimage-$spifile\.$2"; #add romimage number and identifier for spi file to spi file name to distinguish from other spi files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2459
		my @dataforspi; # array to store names of data files to include in spi file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2460
		my @hidedatainspi; # array to store names of data files that are to be hidden in spi file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2461
		for(my $k=0;$k<scalar @datafiles;$k++) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2462
			if($datafiles[$k]{rom}==$romimage && $datafiles[$k]{spifile} == $spifile) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2463
				push @dataforspi, $datafiles[$k]{data}; #push name of data file onto array if correct romimage and spi type
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2464
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2465
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2466
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2467
		for(my $j=0;$j<scalar @hidedatafiles;$j++) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2468
			if($hidedatafiles[$j]{rom}==$romimage && $hidedatafiles[$j]{spifile} == $spifile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2469
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2470
				push @hidedatainspi, $hidedatafiles[$j]{data}; #push name of data file to be hidden onto array if correct romimage and spi type
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2471
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2472
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2473
		my @spiargs; #arguments passed to createSpi
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2474
		push @spiargs, ("-t$targetspi", "-d\\$thisdir", "-hide@hidedatainspi");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2475
		if($existingspi ne "") { push @spiargs, $existingspi; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2476
		&spitool::createSpi(@spiargs, @dataforspi); # external call to 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2477
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2478
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2479
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2480
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2481
# SPI file creation phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2482
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2483
# If SPI files for resource (.rsc) are required then creates SPI files for each ROM image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2484
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2485
sub spi_creation_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2486
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2487
	my $composite_secondary=-1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2488
	if($createspi) { 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2489
		my $secondary=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2490
		for (my $i=1; $i<8; $i++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2491
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2492
			if($romimage[$i]{composite} eq "composite_secondary") 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2493
				{ $secondary++; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2494
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2495
		if(!$secondary) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2496
			{ $romimage[0]{composite} = "composite_secondary"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2497
		if($secondary>1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2498
			{ print "Warning, more than one composite_primary specified, using image with lowest ROM_IMAGE number\n"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2499
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2500
		foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2501
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2502
			if ($line=~/^\s*REM \s*ROM_IMAGE\[(\d)\]/) # specify which romimage following lines are part of
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2503
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2504
				$romimage=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2505
				$spicount=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2506
			}	elsif ($line =~ /^\s*REM/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2507
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2508
				# ignore any other REM statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2509
			} elsif ($line=~/^\s*spidata\s*=\s*(\S+)\s+(\S+)\s+(\S+)\s(\S+)\s*$/)	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2510
				#spidata=\epoc32\data\Z\Resource\Plugins\Obexclasscontroller.RSC Resource\Plugins\Obexclasscontroller.RSC ecom.spi \private\10003a3f\
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2511
				my $targetspi=$4.$3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2512
				my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2513
				my $i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2514
				for($i=0;$i<$spicount && $flag;$i++) { #loop to see if name of spi file already added to this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2515
					if($spiarray[$romimage][$i]{spi} eq $targetspi) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2516
						$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2517
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2518
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2519
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2520
				if($flag) { # adds spi file if not yet listed for this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2521
					$spiarray[$romimage][$spicount++]={spifile=>$3, spidir=>$4, spi=>$4.$3};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2522
					$i=$spicount;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2523
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2524
					$datafiles[$filescount++]= {data=>$1, rom=>$romimage, spifile=>$i-1}; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2525
                        } elsif ($spiplacement && $line =~/^\s*SPI_POSITION/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2526
        			# mark the image index at which the SPI_POSITION keyword has occured in order to avoid writing duplicate
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2527
        			# entries of the spi file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2528
        			$spipositionflag{$romimage} = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2529
        		} elsif ($line=~/^\s*spidatahide\s*=\s*(\S+)\s+(\S+)\s(\S+)\s*$/)	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2530
				#spidatahide=\epoc32\data\Z\Resource\Plugins\Obexclasscontroller.RSC ecom.spi \private\10003a3f\
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2531
				my $targetspi=$3.$2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2532
				my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2533
				my $i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2534
				for($i=0;$i<$spicount && $flag;$i++) { #loop to see if name of spi file already added to this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2535
					if($spiarray[$romimage][$i]{spi} eq $targetspi) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2536
						$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2537
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2538
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2539
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2540
				if($flag) { # adds spi file if not yet listed for this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2541
					$spiarray[$romimage][$spicount++]={spifile=>$2, spidir=>$3, spi=>$3.$2};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2542
					$i=$spicount;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2543
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2544
					$hidedatafiles[$hidefilescount++]= {data=>$1, rom=>$romimage, spifile=>$i-1}; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2545
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2546
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2547
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2548
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2549
		for(my $i=0;$i<8 && $composite_secondary<0;$i++) { # loop to set $composite_secondary value
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2550
			if($romimage[$i]{composite} eq "composite_secondary") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2551
				$composite_secondary=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2552
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2553
		}	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2554
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2555
		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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2556
			if($romimage[$i]{composite} eq "composite_primary") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2557
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2558
				while(defined $spiarray[$composite_secondary][$j]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2559
					my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2560
					my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2561
					while(defined $spiarray[$i][$k] && $flag) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2562
						if($spiarray[$composite_secondary][$j]{spi} eq $spiarray[$i][$k]{spi}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2563
							$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2564
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2565
						$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2566
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2567
					if($flag) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2568
						$spiarray[$i][$k]{spifile}=$spiarray[$composite_secondary][$j]{spifile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2569
						$spiarray[$i][$k]{spidir}=$spiarray[$composite_secondary][$j]{spidir};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2570
						$spiarray[$i][$k]{spi}=$spiarray[$composite_secondary][$j]{spi};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2571
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2572
					$j++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2573
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2574
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2575
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2576
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2577
		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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2578
			if($romimage[$i]{extension}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2579
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2580
				while(defined $spiarray[$i-1][$j]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2581
					my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2582
					my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2583
					while(defined $spiarray[$i][$k] && $flag) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2584
						if($spiarray[$i-1][$j]{spi} eq $spiarray[$i][$k]{spi}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2585
							$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2586
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2587
						$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2588
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2589
					if($flag) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2590
						$spiarray[$i][$k]{spifile}=$spiarray[$i-1][$j]{spifile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2591
						$spiarray[$i][$k]{spidir}=$spiarray[$i-1][$j]{spidir};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2592
						$spiarray[$i][$k]{spi}=$spiarray[$i-1][$j]{spi};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2593
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2594
					$j++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2595
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2596
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2597
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2598
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2599
		for(my $i=0;$i<scalar @spiarray;$i++) { #create SPI files for ROMs which are neither composite_primary nor extensions
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2600
			if(!($romimage[$i]{extension}) && $romimage[$i]{composite} ne "composite_primary") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2601
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2602
				while(defined $spiarray[$i][$j]) { 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2603
					create($i,$j++);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2604
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2605
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2606
		}	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2607
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2608
		for(my $i=0;$i<8;$i++) { #create SPI files for ROMs marked as composite_primary
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2609
			if($romimage[$i]{composite} eq "composite_primary") {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2610
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2611
				while(defined $spiarray[$i][$j]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2612
					create($i,$j++,$composite_secondary);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2613
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2614
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2615
		}	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2616
		for(my $i=0;$i<8;$i++) { #create SPI files for ROMs marked as extension
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2617
			if($romimage[$i]{extension}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2618
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2619
				while(defined $spiarray[$i][$j]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2620
					create($i,$j++,$i-1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2621
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2622
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2623
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2624
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2625
		undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2626
		my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2627
        	my $imageIdx=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2628
		foreach $line (@obydata) { #add SPI files to ROM image, adds lines to obey file to specify existing locations of SPI files and target locations.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2629
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2630
                        if($spiplacement){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2631
                                $flag = 0;	# Reset the flag since the spi file must be added to the final OBY only on finding SPI_POSITION 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2632
                                                        # keyword when the spiplacement flag is set. If the spiplacement flag is set but SPI_POSITION
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2633
                                                        # is not found in the oby files, then no spi entry is emitted.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2634
                                if($line =~ /^\s*SPI_POSITION/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2635
                                        next if (!$spipositionflag{$imageIdx});#This spi has already been entered into OBY.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2636
                                        my $spiIdx=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2637
                                        while(defined $spiarray[$imageIdx][$spiIdx]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2638
                                                if($spiarray[$imageIdx][$spiIdx]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2639
                                                        my $targetspi="$1-$imageIdx-$spiIdx\.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2640
                                                        push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$imageIdx][$spiIdx]{spi} . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2641
                                                }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2642
                                                $spiIdx++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2643
                                        }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2644
                                        if($spiIdx == 0){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2645
                                                # If there is no plugin in this image, the SPI_POSITION statement is ignore.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2646
                                                print ("Warning: statement SPI_POSTION ignored as no plugin was found at ROM_IMAGE[${imageIdx}]\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2647
                                        }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2648
                                        $spipositionflag{$imageIdx} = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2649
                                }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2650
                                elsif( $line =~ /REM ROM_IMAGE\[(\d)\]/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2651
                                        $imageIdx = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2652
                                        push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2653
                                }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2654
                                elsif($line =~ /^\s*spidata/i) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2655
                                } else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2656
                                        push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2657
                                }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2658
                        }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2659
			elsif($line =~/REM ROM_IMAGE\[(\d)\]/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2660
				my $romimage=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2661
				if($flag) { #put in SPI files for ROM_IMAGE[0]
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2662
					$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2663
					my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2664
					while(defined $spiarray[0][$k]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2665
						if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2666
							my $targetspi="$1-0-$k\.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2667
							push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi .  "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2668
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2669
						$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2670
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2671
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2672
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2673
				push @newobydata, "\n" . $line . "\n";			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2674
				while(defined $spiarray[$romimage][$j]) { #put in SPI files for current ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2675
					if($spiarray[$romimage][$j]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2676
						my $targetspi="$1-$romimage-$j\.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2677
						push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$romimage][$j]{spidir} . $targetspi .  "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2678
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2679
					$j++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2680
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2681
			} elsif($line =~ /^\s*extensionrom/i) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2682
				if($flag) { #put in SPI files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2683
					my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2684
					while(defined $spiarray[0][$k]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2685
						if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2686
							my $targetspi="$1-0-$k\.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2687
							push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2688
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2689
						$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2690
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2691
					$flag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2692
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2693
				push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2694
			} elsif($line =~ /^\s*spidata/i) {;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2695
			} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2696
				push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2697
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2698
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2699
		if($flag) { #put in SPI files for ROM_IMAGE[0] if it is the only ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2700
			my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2701
			while(defined $spiarray[0][$k]) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2702
				if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2703
					my $targetspi="$1-0-$k\.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2704
					push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2705
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2706
				$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2707
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2708
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2709
		@obydata=@newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2710
	}	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2711
	dump_obydata("tmp6.oby", "result of SPI stage") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2712
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2713
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2714
sub load_featuresutil
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2715
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2716
	&Load_ModuleL("featuresutil");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2717
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2718
	# Parse the feature database XML file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2719
	if(!&featuresutil::parseXMLDatabase($featureXml, $featuremanager, $strict))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2720
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2721
	  print STDERR "Failed to parse feature database XML file $featureXml\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2722
		$featureXml = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2723
		exit(1) if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2724
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2725
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2726
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2727
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2728
# Feature registry configuration file/Features data file generation phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2729
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2730
# If feature registry configuration files/features data files are required then creates these files for
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2731
# each ROM/ROFS image
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2732
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2733
sub featurefile_creation_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2734
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2735
	if($onlysmrimage)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2736
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2737
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2738
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2739
	# Set the name and Rom Image location of feature file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2740
	if ($enforceFeatureManager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2741
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2742
		# features data file location
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2743
		$dir = "private\\10205054\\";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2744
		$featurefilename = "features.dat";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2745
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2746
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2747
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2748
		# feature registry configuration file location
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2749
		$dir = "private\\102744CA\\"; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2750
		$featurefilename = "featreg.cfg";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2751
	}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2752
	if (defined ($featureXml)) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2753
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2754
		my $featurefilecount=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2755
		my $romimage=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2756
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2757
		foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2758
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2759
			# specify which romimage following lines are part of
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2760
			if ($line=~/^\s*REM \s*ROM_IMAGE\[(\d)\]/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2761
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2762
				$romimage=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2763
				$featurefilecount=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2764
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2765
			elsif ($line =~ /^\s*REM/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2766
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2767
				# ignore any other REM statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2768
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2769
			elsif($line =~ /^\s*(FEATURE)\s*(\S*)\s*(.*)/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2770
					|| $line =~ /^\s*(EXCLUDE_FEATURE)\s*(\S*)\s*(.*)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2771
			{				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2772
				# FEATURE  <feature_name>  [ SF  <status falgs> ] [ UD  <user data> ]
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2773
				my $feature = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2774
				my $featurevalue = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2775
				my $featureargs = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2776
				my $reservedbit = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2777
				my %featureflags=();				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2778
				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2779
				# Options 'SF' and 'UD' will be supported only for "-fm" option
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2780
				if ($featuremanager) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2781
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2782
					# [ SF  <status falgs> ] [ UD  <user data> ]
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2783
					$featureargs =~	/(\S*)\s*(\S*)\s*(\S*)\s*(\S*)\s*/ ;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2784
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2785
					# Store the values of 'SF' and 'UD', or any invalid option, if provided					
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2786
					if ($1) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2787
					{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2788
						$featureflags{uc($1)} = $2;						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2789
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2790
					if ($3) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2791
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2792
						$featureflags{uc($3)} = $4;									
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2793
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2794
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2795
					# Generate a warning if the option provided with Feature/Exclude_Feature keyword is  
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2796
					# not 'SF' or 'UD'.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2797
					foreach my $Key (keys %featureflags)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2798
					{						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2799
						if ($Key !~ /^(SF|UD)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2800
						{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2801
							print "Warning: Invalid argument \"$Key\" specified for feature $featurevalue\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2802
							delete $featureflags{$Key};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2803
							next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2804
						}						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2805
					}							
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2806
				}				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2807
				# In verbose mode, generate warning if "SF|UD" arguments or invalid arguments are specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2808
				# for "-f|fr" option.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2809
				elsif ($featureargs && $opt_v)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2810
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2811
					print "Invalid argument(s) \"$featureargs\" provided for feature \"$featurevalue\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2812
					foreach my $Key (keys %featureflags)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2813
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2814
						delete $featureflags{$Key};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2815
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2816
				}				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2817
				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2818
				# The feature file name is of the format featreg.cfg[x-y] or features.dat[x-y] 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2819
				# where x is the romimage id, y is always 0, reserved for future use.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2820
				my $targetfeaturefile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2821
				if (($romimage == 0) && ($reservedbit == 0))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2822
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2823
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2824
					# Core image will not have the mangled name
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2825
				 	$targetfeaturefile = $featurefilename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2826
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2827
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2828
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2829
				 	$targetfeaturefile = $featurefilename . "\[". $romimage . "\-$reservedbit\]";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2830
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2831
				my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2832
				my $featureflag;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2833
				if ($feature =~ /^FEATURE$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2834
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2835
					$featureflag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2836
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2837
				else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2838
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2839
					$featureflag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2840
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2841
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2842
				my $i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2843
 				# loop to see if name of feature file already added to this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2844
				for($i=0;$i<$featurefilecount && $flag;$i++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2845
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2846
					if($featurefilearray[$romimage][$i]{cfgfile} eq $targetfeaturefile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2847
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2848
						$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2849
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2850
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2851
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2852
				if($flag) { # adds feature file if not yet listed for this romimage in array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2853
					$featurefilearray[$romimage][$featurefilecount++]={cfgfile=>$targetfeaturefile, cfgdir=>$dir};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2854
					$i=$featurefilecount;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2855
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2856
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2857
				$featureslist[$featurescount]= {feature=>$featurevalue, include=>$featureflag, rom=>$romimage, cfgfile=>$i-1};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2858
				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2859
				# Store the value of 'SF' in 'featureslist' array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2860
				if (defined $featureflags{SF}) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2861
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2862
					$featureslist[$featurescount]->{SF} = $featureflags{SF};						
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2863
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2864
				# Store the value of 'UD' in 'featureslist' array
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2865
				if (defined $featureflags{UD}) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2866
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2867
					$featureslist[$featurescount]->{UD} = $featureflags{UD};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2868
				}				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2869
				$featurescount++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2870
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2871
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2872
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2873
		# Create Feature File
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2874
		for(my $i=0;$i<scalar @featurefilearray;$i++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2875
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2876
			my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2877
			while(defined $featurefilearray[$i][$j])
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2878
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2879
				my $targetfeaturefile = $featurefilearray[$i][$j]{cfgfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2880
				if (!(&featuresutil::createFeatureFile($i,$j,$targetfeaturefile,\@featureslist,$featuremanager))) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2881
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2882
					print STDERR "Failed to create Feature file $targetfeaturefile\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2883
					$featurefilearray[$i][$j]{cfgfile}= undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2884
					exit(1) if($strict);					
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2885
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2886
				$j++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2887
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2888
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2889
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2890
		undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2891
		my $flag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2892
        	my $imageIdx=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2893
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2894
		# Add feature files to ROM image, adds lines to obey file to specify existing locations
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2895
		# of feature files and target locations.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2896
		foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2897
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2898
			if($line =~/REM ROM_IMAGE\[(\d)\]/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2899
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2900
				my $romimage=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2901
				if($flag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2902
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2903
					# Put in feature files for ROM_IMAGE[0]
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2904
					$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2905
					my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2906
					while(defined $featurefilearray[0][$k])
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2907
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2908
						my $targetfeaturefile=$featurefilearray[0][$k]{cfgfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2909
						if (defined $targetfeaturefile) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2910
						{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2911
							push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile .  "\"\n";							
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2912
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2913
						$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2914
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2915
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2916
				push @newobydata, "\n" . $line . "\n";			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2917
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2918
				my $j=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2919
				while(defined $featurefilearray[$romimage][$j])
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2920
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2921
					# Put in feature files for current ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2922
					my $targetfeaturefile=$featurefilearray[$romimage][$j]{cfgfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2923
					
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2924
					# Rom images will not have mangled name for feature files
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2925
				 	my $destinationfeaturefile = $featurefilename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2926
					
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2927
					# Rofsbuild will set attribute 'exattrib=U' in the entry record when this field is used.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2928
					# File Server when asked for a directory listing would notice the attribute and will return the 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2929
					# list with mangled names. Hence, mangled name for feature files should not be put in ROM_IMAGE.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2930
					my $exattribute = "exattrib=U";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2931
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2932
					if (defined $targetfeaturefile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2933
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2934
						push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[$romimage][$j]{cfgdir} . $destinationfeaturefile .  "\"\t\t" . $exattribute . "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2935
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2936
					$j++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2937
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2938
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2939
			elsif($line !~ /^\s*(FEATURE)\s*/i && $line !~ /^\s*(EXCLUDE_FEATURE)\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2940
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2941
				# Put in all other lines except the FEATURE and EXCLUDE_FEATURE keywords
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2942
				push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2943
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2944
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2945
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2946
		if($flag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2947
		{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2948
			# Put in feature files for ROM_IMAGE[0] if it is the only ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2949
			my $k=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2950
			while(defined $featurefilearray[0][$k])
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2951
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2952
				my $targetfeaturefile = $featurefilearray[0][$k]{cfgfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2953
				if (defined $targetfeaturefile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2954
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2955
					push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2956
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2957
				$k++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2958
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2959
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2960
		@obydata=@newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2961
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2962
	elsif ($enforceFeatureManager && $noFeatureManager && $preBuiltFeaturesDataFile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2963
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2964
        print "Valid: $preBuiltFeaturesDataFile\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2965
		if (-e $preBuiltFeaturesDataFile) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2966
		{			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2967
			my @newobydata = ();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2968
			my $flag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2969
			foreach my $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2970
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2971
				# Put in the pre-built features data file in ROM_IMAGE[0] 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2972
				if($line =~/REM ROM_IMAGE\[1\]/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2973
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2974
					push @newobydata, "data=$preBuiltFeaturesDataFile" . " \"" . $dir . $featurefilename . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2975
					$flag =0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2976
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2977
				push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2978
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2979
			if($flag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2980
			{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2981
				# Put in the pre-built features data file in ROM_IMAGE[0] if it is the only ROM_IMAGE
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2982
				push @newobydata, "data=$preBuiltFeaturesDataFile" . " \"" . $dir . $featurefilename . "\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2983
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2984
			@obydata =  @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2985
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2986
		else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2987
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2988
			print "Error: File \"$preBuiltFeaturesDataFile\" doesn't exist.\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2989
			exit(1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2990
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2991
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2992
	elsif ($enforceFeatureManager)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2993
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2994
	    print "Error: no feature data file or pre-built feature data file is provided!";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2995
	    exit(1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2996
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2997
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2998
my ($fromABI,$toABI) = split / /,$abiDowngrade;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  2999
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3000
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3001
# Problem suppression phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3002
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3003
# Downgrade files which don't exist for the ABI (if a downgrade path is specified)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3004
# Comment out missing files or report errors if strict option enabled
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3005
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3006
# Detect any references to Feature Variant binaries and substitute in the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3007
# correct source binary name using the VMAP file mechanism.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3008
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3009
sub suppress_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3010
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3011
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3012
	Plat_Init($PerlLibPath);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3013
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3014
	# use the "default" feature variant by default.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3015
	my $varname = $featureVariant{'VALID'} ? $featureVariant{'NAME'} : "default";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3016
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3017
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3018
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3019
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3020
		if ($line =~ /^\s*REM/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3021
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3022
			# ignore REM statements, to avoid processing "REM data=xxx yyy"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3023
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3024
		# 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3025
		# thing=some\file 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3026
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3027
		elsif ($line =~ /(\S+)\s*=\s*"?(\S+\\\S+)"?/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3028
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3029
			my $what = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3030
			my $filename = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3031
			if ($line =~ /(\S+)\s*=\s*"([^"]+)"/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3032
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3033
				$filename = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3034
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3035
			my $normedFilename = &Genutl_NormaliseVersionedName($filename);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3036
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3037
			# find all the alternative file locations
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3038
			my @alternatives = fallback($normedFilename);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3039
			# test the original location first
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3040
			unshift(@alternatives, $normedFilename);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3041
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3042
			# choose the first file location that actually exists
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3043
			my $fileExists = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3044
			foreach my $altFile (@alternatives)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3045
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3046
			    my $tmpPath;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3047
			    my $tmpFile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3048
				if($altFile =~ /"?(.*\\arm\w+_?\w+)\\([^"]+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3049
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3050
					$tmpPath = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3051
					$tmpFile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3052
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3053
				$tmpPath .= "\.$varname";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3054
				if (-d $tmpPath){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3055
				  if (-e $tmpPath ."\\$tmpFile"){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3056
				   $fileExists = $tmpPath . "\\$tmpFile";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3057
				  }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3058
				  elsif (-e $altFile){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3059
				   $fileExists = $altFile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3060
				  }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3061
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3062
				else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3063
				  $fileExists = featurevariantmap->Find($altFile, $varname);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3064
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3065
				last if $fileExists;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3066
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3067
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3068
			# edit the OBY line to use the actual file name which we found.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3069
			# (maybe) warn if an alternative to the original was selected.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3070
			if ($fileExists)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3071
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3072
				my $from = $filename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3073
				$from =~ s/\\/\\\\/g;		# need to escape backslashes
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3074
				$from =~ s/(\[|\])/\\$1/g;	# need to escape square brackets for file names like "featreg.cfg[x-y]",etc.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3075
				my $into = $fileExists;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3076
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3077
 				$line =~ s/$from/$into/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3078
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3079
 				if ($warnSelection && ($fileExists ne $normedFilename))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3080
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3081
			    	print "replaced $filename with $fileExists\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3082
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3083
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3084
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3085
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3086
   				# No suitable alternative was found, so comment out the line unless
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3087
				# it is a manatory ROMBUILD keyword, in which case it is better
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3088
				# to let ROMBUILD report the missing file rather than report the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3089
				# missing keyword.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3090
   				if ($what !~ /^bootbinary|variant|primary|secondary|hide/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3091
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3092
   					$line = "REM MISSING " . $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3093
   					print_source_error("Missing file: '$filename' in statement '$what='");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3094
					print "\ttried @alternatives\n"  if ($opt_v && @alternatives > 1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3095
   					# treat as an error if the strict option is selected.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3096
   					$errors++ if ($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3097
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3098
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3099
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3100
			# Once the binary is located in the appropriate ABI directory (e.g.,following the binary 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3101
			# selection order), check if the binary has been used in a patch dll statement. This is
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3102
			# required to find out the source file. In ABIv1, the source file is required to find the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3103
			# .map file, while, in ABIv2, the destination file gives the dso file name.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3104
			if($line =~ /(\S+)\s*=\s*(\S+)\s+(\S+)\s*(.*)?/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3105
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3106
				my $aSrcfile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3107
				my $dstFile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3108
				my $dstPath = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3109
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3110
				if($aSrcfile =~ /"?([^"]+)/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3111
				$aSrcfile = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3112
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3113
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3114
				$aSrcfile = &Genutl_NormaliseVersionedName($aSrcfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3115
				if($dstFile =~ /"?(.*)\\([^"]+)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3116
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3117
					$dstPath = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3118
					$dstFile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3119
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3120
				my $dllMapKey = lc ($dstFile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3121
				if(exists $DllDataMap{$dllMapKey}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3122
					my $dllSymInfo = \%{$DllDataMap{$dllMapKey}};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3123
					$dllSymInfo->{srcfile} = $aSrcfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3124
					$dllSymInfo->{dstpath} = $dstPath;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3125
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3126
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3127
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3128
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3129
		push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3130
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3131
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3132
	dump_obydata("tmp7.oby", "result of problem-suppression phase") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3133
	die "ERROR: $errors missing file(s) detected\n" if ($strict && $errors );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3134
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3135
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3136
# Remove leading and trailing whitespaces from a list of strings or a single string
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3137
sub trim 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3138
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3139
	my @out = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3140
	for (@out) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3141
		s/^\s+//;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3142
		s/\s+$//;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3143
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3144
	return wantarray ? @out : $out[0];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3145
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3146
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3147
# Generate a list of alternative locations for the given filename
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3148
sub fallback
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3149
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3150
   	my $file = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3151
   	my @alternatives = CheckCustomization($file);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3152
 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3153
 	# If BINARY_SELECTION_ORDER macro is specified in the oby file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3154
 	if ($binarySelectionOrderFlag)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3155
   	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3156
 		# Search in the specified binary order 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3157
 		if(!@Global_PlatList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3158
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3159
			@Global_PlatList = Plat_List();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3160
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3161
 		my $b;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3162
 		my $e;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3163
 		foreach my $plat (@Global_PlatList) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3164
  		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3165
  			if ($file =~ /^(.*)\\$plat\\(.*)$/i) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3166
  			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3167
  				$b = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3168
  				$e = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3169
 				last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3170
 			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3171
 		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3172
 		push(@alternatives, "$b\\$firstDIR\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3173
 			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3174
 		foreach my $toDIR (@binarySelectionOrder)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3175
   		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3176
 			push(@alternatives, "$b\\$toDIR\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3177
   		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3178
   	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3179
  	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3180
 	# If the file is not found in the specified ABIV2 platform, then select from ARMV5 directory.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3181
 	# This is necessary as some of the runtime DLLs will be present only in ARMV5 directory. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3182
	# Add the BPABI Platforms to be added
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3183
	if(!@Global_BPABIPlats)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3184
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3185
		@Global_BPABIPlats = &BPABIutl_Plat_List;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3186
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3187
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3188
 	foreach my $BpabiPlat (@Global_BPABIPlats)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3189
 	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3190
 		if ($fromABI eq "" && $file =~ /^(.*)\\$BpabiPlat\\(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3191
   		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3192
 			push(@alternatives, "$1\\armv5\\$2");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3193
   		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3194
   	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3195
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3196
	if ($customizedPlat && $fromABI eq "" && $file =~ /^(.*)\\$customizedPlat\\(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3197
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3198
		my $b = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3199
		my $e = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3200
		# if platform customization 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3201
		my $rootPlat = Plat_Root($customizedPlat);		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3202
        
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3203
   		#Check in ARMV7 folder for binaries in case GCCEV7 is used [DEF128457 ]
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3204
   		if($customizedPlat == "GCCEV7")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3205
   		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3206
   			push(@alternatives,"$b\\armv7\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3207
   		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3208
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3209
		if( grep /$rootPlat/, @Global_BPABIPlats)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3210
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3211
 			push(@alternatives, "$b\\armv5\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3212
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3213
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3214
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3215
	if ($fromABI eq "" && $file =~ /^(.*)\\ARMV5_ABIV1\\(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3216
   	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3217
 		push(@alternatives, "$1\\armv5\\$2");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3218
   	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3219
  		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3220
   	if ($fromABI ne "" && $file =~ /^(.*)\\$fromABI\\(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3221
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3222
 		push(@alternatives, "$1\\$toABI\\$2");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3223
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3224
   
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3225
   	return @alternatives;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3226
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3227
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3228
# Generate a list of alternative locations for the given filename which
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3229
# result from the possible platform customizations.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3230
sub CheckCustomization
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3231
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3232
 	my $file = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3233
 	my @alternatives;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3234
	$customizedPlat = undef;	# global (used in feedback)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3235
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3236
 	if(!@Global_PlatList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3237
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3238
		@Global_PlatList = Plat_List();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3239
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3240
 	foreach my $plat (@Global_PlatList) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3241
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3242
 		if ($file =~ /^(.*)\\$plat\\(.*)$/i) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3243
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3244
 			my $b = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3245
 			my $e = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3246
 			my $root = Plat_Customizes($plat);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3247
 			if ($root) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3248
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3249
				# Preserve the plat that is customized
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3250
				$customizedPlat = $plat;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3251
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3252
				# If a BSF platform customizes another BSF platform (i.e. a
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3253
				# BSF hierarchy exists), look for the file starting from the
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3254
				# child BSF platform and working back to the root BSF platform
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3255
				while ($root)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3256
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3257
					push(@alternatives, "$b\\$root\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3258
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3259
					# Temporary special case for ARMV5_ABIV1 and ARMV5_ABIV2
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3260
					if ($root =~ /^armv5_abiv[12]$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3261
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3262
						push(@alternatives, "$b\\armv5\\$e");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3263
 					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3264
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3265
					$root = Plat_Customizes($root);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3266
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3267
 			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3268
			return @alternatives;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3269
 		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3270
 	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3271
	return @alternatives;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3272
}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3273
   
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3274
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3275
# Bitmap and aif conversion phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3276
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3277
# Convert any "bitmap=" or "compressed-bitmap=" files into ROM format bitmaps
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3278
# Convert any "auto-bitmap=" to handle bitmap appropriately for xip and non-xip images
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3279
# Convert "aif=" files appropriately for xip and non-xip images
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3280
sub bitmap_aif_converison_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3281
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3282
	my $is_xip=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3283
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3284
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3285
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3286
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3287
		# keep track of the XIP-ness of this rom partition
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3288
		if ($line =~ /^\s*REM ROM_IMAGE\[(\d+)\]\s+(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3289
		{ $is_xip=$romimage[$1]{xip}; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3290
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3291
		# aif=source dest 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3292
		# include aif file - use XIP version for XIP roms if it exists, otherwise use the file specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3293
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3294
		if ($line =~ /^\s*aif=/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3295
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3296
			my $xip="_xip";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3297
			my @aif= split(/\s+/,$line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3298
			my $path=Path_Split('Path',"$aif[0]");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3299
			my $base=Path_Split('Base',"$aif[0]");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3300
			$path =~ s/^....//;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3301
			my $ext=Path_Split('Ext',"$aif[0]");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3302
			if ($is_xip && (-e "$path$base$xip$ext"))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3303
			{ $line="data=$path$base$xip$ext\t\t$aif[1]\n"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3304
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3305
			{ $line="data=$path$base$ext\t\t$aif[1]\n"; }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3306
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3307
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3308
		# auto-bitmap=
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3309
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3310
		# if currently in XIP image, then use a compressed-bitmap
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3311
		# otherwise use a RAM format bitmap
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3312
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3313
		if ($line =~ /^\s*auto-bitmap=/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3314
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3315
			if ($is_xip)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3316
			{ $line =~ s/auto-bitmap=/compressed-bitmap=/i }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3317
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3318
			{ $line =~ s/auto-bitmap=/data=/i }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3319
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3320
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3321
		# uncompressed-bitmap
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3322
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3323
		# this is currently just a synonym for 'bitmap'
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3324
		$line =~ s/uncompressed-bitmap=/bitmap=/i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3325
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3326
		# 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3327
		# bitmap=source dest 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3328
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3329
		if ($line =~ /^\s*bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3330
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3331
			my $mbm = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3332
			my $dest = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3333
			my $rom_mbm = "$1_rom";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3334
			if ($is_xip eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3335
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3336
				# non-XIP rom - just include the mbm file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3337
				$line = "data=\"$mbm\"\t\"$dest\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3338
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3339
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3340
			{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3341
		        if (! -e $rom_mbm || -M $rom_mbm >= -M $mbm)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3342
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3343
				    system "bmconv /q /r $rom_mbm /m$mbm";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3344
				    my $bmconv_status = $?;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3345
				    die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $rom_mbm);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3346
			    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3347
				$line = "data=\"$rom_mbm\"\t\"$dest\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3348
				push @tempfiles, $rom_mbm;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3349
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3350
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3351
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3352
		# compressed-bitmap=
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3353
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3354
		# if file is a compressed ROM image file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3355
		elsif ($line =~ /^\s*compressed-bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3356
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3357
			my $mbm = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3358
			my $dest = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3359
			my $cmprssd_rom_mbm = "$1_rom";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3360
			if ($is_xip eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3361
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3362
				# non-XIP rom - just include the mbm file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3363
				$line = "data=\"$mbm\"\t\"$dest\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3364
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3365
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3366
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3367
				if (! -e $cmprssd_rom_mbm || -M $cmprssd_rom_mbm >= -M $mbm)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3368
			    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3369
				    system "bmconv /q /s $cmprssd_rom_mbm /m$mbm";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3370
				    my $bmconv_status = $?;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3371
				    die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $cmprssd_rom_mbm);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3372
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3373
				$line = "data=\"$cmprssd_rom_mbm\"\t\"$dest\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3374
				push @tempfiles, $cmprssd_rom_mbm;			    
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3375
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3376
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3377
		push @newobydata, $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3378
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3379
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3380
	dump_obydata("tmp8.oby", "result of bitmap conversion phase") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3381
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3382
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3383
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3384
sub reformat_line($)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3385
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3386
	my ($line) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3387
	my $type = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3388
	my $variant = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3389
	my $pcfile = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3390
	my $romfile = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3391
	my $tail = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3392
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3393
	# time=21/07/1999 12:00:00
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3394
	# primary[0x09080004]   =\epoc32\release\misa\udeb\ekern.exe
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3395
	# data=\epoc32\wins\C\System\Alarms\churchbell.snd    "System\Alarms\Church bell"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3396
	# file[0x07060001]=\epoc32\release\MAWD\urel\cAkyb1.dll          System\Libs\EKeyb.dll
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3397
	# file=\epoc32\release\marm\urel\eikcore.dll 			System\Libs\Eikcore.dll
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3398
	# alias \System\Bin\DRTRVCT2_2.dll 			\System\Bin\DRTRVCT2_1.dll
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3399
	#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3400
	if ($line =~ /^\s*TIME\s*=\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3401
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3402
		return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3403
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3404
  	elsif($line =~ /^\s*volume\s*=.*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3405
  	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3406
  		return $line;		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3407
  	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3408
	elsif($line =~ /^\s*kerneltrace\s*=.*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3409
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3410
		return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3411
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3412
	if ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+"\\?(.*)"(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3413
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3414
		$type = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3415
		$variant = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3416
		$pcfile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3417
		$romfile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3418
		$tail = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3419
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3420
	elsif ($line =~ /^\s*(\S+)(\[\S+\])\s*=\s*(\S+)\s+\\?(\S+)(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3421
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3422
		$type = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3423
		$variant = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3424
		$pcfile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3425
		$romfile = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3426
		$tail = $5;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3427
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3428
	elsif ($line =~ /(\S+)\s*=\s*"([^"]+)"\s+"\\?(.*)"(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3429
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3430
		if ($line !~ /^REM MISSING/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3431
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3432
			$type = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3433
			$variant = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3434
			$pcfile = "\"$2\"";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3435
			$romfile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3436
			$tail = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3437
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3438
		else{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3439
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3440
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3441
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3442
	elsif ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+\\?(\S+)(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3443
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3444
		$type = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3445
		$variant = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3446
		$pcfile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3447
		$romfile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3448
		$tail = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3449
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3450
	elsif($line =~ /^\s*(patchdata)\s*(\S+)\s*\@\s*(\S+)\s+(\S+)/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3451
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3452
		# Reformat the patchdata statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3453
		my $romfilename = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3454
		my $patchdlldatamap_key = lc ($romfilename);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3455
		my $symbolname = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3456
		my $value = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3457
		my ($index, $elementSize);		# For when the symbol is an array, and we're patching one element
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3458
		my $scalarSize;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3459
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3460
		if(!defined $DllDataMap{$patchdlldatamap_key}->{dstpath}){
57
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  3461
			print_source_error(" Bad patchdata statement: $romfilename has not been included into ROM image");
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3462
			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3463
			$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3464
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3465
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3466
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3467
		if ($enforceSysBin)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3468
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3469
			if ($DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\\bin/i 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3470
			 && $DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3471
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3472
				$DllDataMap{$patchdlldatamap_key}->{dstpath} = "sys\\bin";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3473
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3474
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3475
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3476
		my $dllfile = $DllDataMap{$patchdlldatamap_key}->{dstpath} . "\\". $romfilename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3477
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3478
		$line = "$1  ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3479
		$line .= "$dllfile ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3480
 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3481
		# Convert value into decimal (used to be done in AddDllDataInfo, but that limited us to
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3482
		# one value per symbol, and we now support patching arrays, e.g. the Hal's InitialValue[],
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3483
		# so we can't do it that way any more.)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3484
		if ($value =~ /^0x([0-9a-f]+)$/i) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3485
			$value = hex($1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3486
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3487
		elsif ($value =~ /^(-?\d+)$/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3488
			$value = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3489
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3490
		else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3491
			print_source_error("Attempt to set $symbolname to illegal value $value");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3492
			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3493
			$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3494
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3495
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3496
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3497
		if ($symbolname =~ s/:(\d+)\[((0x)?[0-9a-f]+)\]$//i) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3498
			($index, $elementSize) = ($2, $1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3499
			$index = hex($index) if $index =~ /^0x/i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3500
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3501
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3502
		my $DllSymInfoRef = $DllDataMap{$patchdlldatamap_key}->{$symbolname};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3503
 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3504
		if (!defined($DllSymInfoRef->{size})) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3505
			print_source_error("Size for symbol $symbolname not found");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3506
			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3507
			$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3508
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3509
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3510
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3511
		if (defined($elementSize)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3512
			$scalarSize = $elementSize / 8;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3513
			if ($scalarSize != 1 && $scalarSize != 2 && $scalarSize != 4) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3514
				print_source_error("Invalid bit size $elementSize for array $symbolname in $romfilename");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3515
				$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3516
				$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3517
				return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3518
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3519
			if (($index + 1) * $scalarSize > $DllSymInfoRef->{size}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3520
				print_source_error("Invalid index $index into array $symbolname in $romfilename");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3521
				$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3522
				$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3523
				return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3524
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3525
		} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3526
			$scalarSize = $DllSymInfoRef->{size};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3527
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3528
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3529
		my $max_value = 0xffffffff;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3530
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3531
		if ($scalarSize == 1) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3532
			$max_value = 0xff;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3533
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3534
		elsif ($scalarSize == 2) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3535
			$max_value = 0xffff;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3536
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3537
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3538
		if ($value > $max_value) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3539
			$value &= $max_value;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3540
			print "$DllSymInfoRef->{obyfilename}($DllSymInfoRef->{lineno}): Warning:Value overflow of $symbolname\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3541
			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3542
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3543
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3544
		if(defined $DllSymInfoRef->{ordinal}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3545
			if (defined($elementSize)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3546
				my $ord = $DllSymInfoRef->{ordinal};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3547
				my $offset = $index * $scalarSize;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3548
				$line .= "ordinal $ord+$offset ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3549
			} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3550
				$line .= "ordinal ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3551
				$line .= $DllSymInfoRef->{ordinal} . " ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3552
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3553
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3554
		elsif(defined $DllSymInfoRef->{dataAddr}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3555
			if (defined($elementSize)) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3556
				my $addr = $DllSymInfoRef->{dataAddr};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3557
				$addr = hex($addr) if $addr =~ /^0x/i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3558
				$addr = sprintf("0x%08x", $addr + $index * $scalarSize);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3559
				$line .= "addr $addr ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3560
			} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3561
				$line .= "addr ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3562
				$line .= $DllSymInfoRef->{dataAddr} . " ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3563
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3564
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3565
		else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3566
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3567
			print_source_error("Ordinal or Address for exported symbol $symbolname in $romfilename couldn't be located");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3568
			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3569
			$line = "REM $line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3570
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3571
		};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3572
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3573
		$line .= "$scalarSize $value\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3574
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3575
		return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3576
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3577
	elsif ($line =~ /^\s*(\S+)\s*(\S+)\s+\\?(\S+)(.*)$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3578
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3579
		$type = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3580
		$variant = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3581
		$pcfile = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3582
		$romfile = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3583
		$tail = $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3584
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3585
		if ($type !~ /^(alias)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3586
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3587
			# Return now, if it is not an 'alias'.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3588
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3589
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3590
		else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3591
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3592
			# There is no substitution needed for SysBin 'alias'es.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3593
			if ($romfile =~ /^sys\\bin\\/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3594
			  ||$romfile =~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3595
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3596
				return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3597
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3598
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3599
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3600
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3601
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3602
		return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3603
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3604
 	# Buildrom should generate warning when destination path provided for a file 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3605
 	# is not a standard path(as per platsec) and "PlatSecEnforceSysBin" is turned off. 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3606
 	my $warnFlag = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3607
	my $mustBeSysBin = $enforceSysBin;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3608
	if ($type =~ /^(data|compress|nocompress)$/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3609
		&& $romfile !~ /^system\\(bin|libs|programs)\\/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3610
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3611
		$mustBeSysBin = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3612
 		$warnFlag = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3613
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3614
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3615
	if ($mustBeSysBin)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3616
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3617
		if ($type =~ /^(alias)$/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3618
			&& $romfile !~ /^sys\\bin\\/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3619
			&& $romfile !~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3620
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3621
			# for multilinguify 'alias'es (generally resource files) 'MustBeSysBin' should not be enforced.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3622
			if($romfile =~ /\.rsc$/i || defined($multiLinguifyAlias{$pcfile})) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3623
				return $line;  
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3624
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3625
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3626
			my $filename = "\\$romfile";	# in case no path is specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3627
			$filename = substr $filename, rindex($filename, "\\");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3628
			$romfile = "sys\\bin".$filename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3629
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3630
			if ($pcfile !~ /^sys\\bin\\/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3631
			    && $pcfile !~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3632
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3633
				my $pcfilename = "\\$pcfile";	# in case no path is specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3634
				$pcfilename = substr $pcfilename, rindex($pcfilename, "\\");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3635
				$pcfile = "sys\\bin".$pcfilename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3636
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3637
			return "$type$variant $pcfile \t$romfile$tail\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3638
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3639
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3640
		if ($romfile !~ /^sys\\bin\\/i
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3641
		    && $romfile !~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3642
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3643
			my $filename = "\\$romfile";	# in case no path is specified
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3644
			$filename = substr $filename, rindex($filename, "\\");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3645
			$romfile = "sys\\bin".$filename;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3646
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3647
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3648
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3649
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3650
 		if ($warnFlag && $romfile !~ /^sys\\bin\\/i && $romfile !~ /^sys\/bin/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3651
 		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3652
 			print "Warning: Outside standard path at \"$line\"\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3653
 		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3654
		if ($type =~ /^(alias)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3655
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3656
			# Return the line as it is for non-MustBeSysBin 'alias'es.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3657
			return $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3658
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3659
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3660
	$romfiles{$romfile} = $variant.$pcfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3661
	$ibyfiles{$romfile} = $sourcefile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3662
	return "$type$variant=$pcfile \t\"$romfile\"$tail\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3663
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3664
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3665
my @hidearray;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3666
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3667
sub mark
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3668
{ # function to mark files in ROMs as hidden
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3669
	my ($base,$ext) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3670
	my $i=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3671
	my @coreimagerange = (-1,-1); #coreimagerange stores the places within @hidearray where the $base files start and end
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3672
	my @extensionimagerange = (-1,-1); #extensionimagerange stores the places within @hidearray where the $ext files start and end
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3673
	for(my $i=0;$i<scalar @hidearray;$i++) { #loop sets values in @coreimagerange and in @extensionimagerange
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3674
		if($hidearray[$i]{rom}==$base) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3675
			if($coreimagerange[0]<0) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3676
				$coreimagerange[0]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3677
				$coreimagerange[1]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3678
			} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3679
				$coreimagerange[1]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3680
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3681
		} elsif($hidearray[$i]{rom}==$ext) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3682
			if($extensionimagerange[0]<0) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3683
				$extensionimagerange[0]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3684
				$extensionimagerange[1]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3685
			} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3686
				$extensionimagerange[1]=$i;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3687
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3688
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3689
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3690
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3691
	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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3692
		for(my $j=$coreimagerange[0];$j<=$coreimagerange[1];$j++) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3693
			if($hidearray[$i]{dest} eq $hidearray[$j]{dest}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3694
				$hidearray[$i]{hide}=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3695
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3696
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3697
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3698
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3699
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3700
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3701
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3702
# Cleaning phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3703
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3704
# Remove "REM defined", "REM handled"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3705
# Remove the "# lineno" information
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3706
# Collapse multiple blank lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3707
# Apply the PlatSecEnforceSysBin setting
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3708
# Produce ROM directory listing
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3709
# Identify the ROM image name
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3710
sub cleaning_phase
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3711
{	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3712
	my $romname;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3713
	my $skippingBlanks=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3714
	undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3715
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3716
    if($opt_v)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3717
    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3718
	  my $logWin = "logwin.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3719
	  my $logLinux = "loglinux.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3720
	  unlink($logWin);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3721
	  unlink($logLinux);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3722
	  open LOGWIN, ">$logWin" or die("* Can't create $logWin\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3723
	  open LOGLINUX, ">$logLinux" or die("* Can't create $logLinux\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3724
    }	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3725
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3726
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3727
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3728
		track_source($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3729
		if ($line=~/^REM (defined|handled)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3730
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3731
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3732
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3733
		if ($line=~/^# (\d+) "(.*)"/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3734
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3735
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3736
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3737
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3738
		# Blank line compression
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3739
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3740
		if ($line=~/^\s*$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3741
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3742
			if ($skippingBlanks==1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3743
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3744
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3745
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3746
			$skippingBlanks=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3747
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3748
		else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3749
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3750
			$skippingBlanks=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3751
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3752
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3753
		# Track ROMNAME, allowing overrides
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3754
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3755
		if ($line=~/romname\s*=\s*"?(\S+)\.(\S+)"?\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3756
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3757
			if ($romname ne "" && $opt_o eq "")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3758
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3759
				print_source_error("Overrides previous ROM name $romname");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3760
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3761
			$rombasename = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3762
			$romname = "$1.$2";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3763
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3764
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3765
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3766
		# ROM directory listing
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3767
		#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3768
		    my $newline = reformat_line($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3769
	    if( ($newline !~ /^\s*TIME\s*=\s*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3770
  	      &&($newline !~ /^\s*volume\s*=.*/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3771
	      &&($newline !~ /^\s*kerneltrace\s*=.*/i))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3772
	    {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3773
	        my $tmpline = $newline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3774
	        if($^O =~ /^MSWin32$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3775
	        {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3776
	          $newline =~ s-\/-\\-go;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3777
	          if($opt_v)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3778
	          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3779
                print LOGWIN $newline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3780
	            $tmpline =~ s-\\-\/-go;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3781
	            print LOGLINUX $tmpline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3782
	          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3783
	        }else #unix os
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3784
	        {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3785
	          $newline =~ s-\\-\/-go;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3786
	          if($opt_v)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3787
	          {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3788
	            print LOGLINUX $newline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3789
	            $tmpline =~ s-\/-\\-go;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3790
	            print LOGWIN $tmpline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3791
	          }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3792
	        }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3793
	    }
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3794
	    
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3795
		push @newobydata, $newline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3796
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3797
	if($opt_v)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3798
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3799
	  close LOGWIN;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3800
	  close LOGLINUX;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3801
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3802
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3803
	exit(1) if($errors && $strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3804
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3805
	# Handle ROMNAME and possible -o override
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3806
	if ($opt_o ne "")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3807
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3808
		$romname=$opt_o;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3809
		if ($opt_o=~/(\S+)\.(\S+)/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3810
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3811
			$rombasename=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3812
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3813
		else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3814
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3815
			$rombasename=$romname;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3816
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3817
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3818
	if(!$onlysmrimage)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3819
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3820
		unshift @newobydata, "romname=$romname\n";	# first line of final OBY file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3821
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3822
	@obydata = @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3823
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3824
	print "* Removing previous image and logs...\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3825
	unlink glob("$rombasename.*");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3826
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3827
	my $obyrecordline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3828
	if($createspi) {# section added to mark SPI files in core images as hidden (if appropriate) if extension ROMs are being produced
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3829
		my $imagenum=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3830
		my $count=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3831
		foreach my $line (@obydata) { # fill @hidearray with all file= or data= entries from @obydata, recording which image they are in and their target destination
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3832
			if($line =~/^\s*(file|data)\s*=\s*(\S+)\s+(\S+)\s*$/gi) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3833
				$hidearray[$count] = {rom=>$imagenum, type=>$1, dest=>$3};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3834
				$hidearray[$count]{dest} =~s/\"//g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3835
				$count++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3836
			} elsif($line =~/^\s*REM\s+ROM_IMAGE\[(\d)\]\s*$/i ) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3837
				$imagenum=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3838
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3839
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3840
		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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3841
			if($romimage[$i]{extension}) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3842
				mark($i-1,$i);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3843
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3844
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3845
		undef @newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3846
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3847
		my $hideflag=0; # is set to 1 if there are files which need to be hidden, determines whether to run next section of code 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3848
		for(my $i=0;$i<scalar @hidearray;$i++) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3849
			if($hidearray[$i]{hide}==1) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3850
				$hideflag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3851
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3852
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3853
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3854
		my $obeyrom=0;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3855
		if($hideflag) { #if there exist files which need hiding
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3856
			my $i=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3857
			my $exitflag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3858
			$obyrecordline=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3859
			for(;$obyrecordline<scalar @obydata && !$exitflag;) { # nested for loops produce new obey file in @newobydata, including hide= lines
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3860
				print "Line = $obyrecordline $i " . scalar @hidearray . "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3861
				if($i==scalar @hidearray) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3862
					$exitflag=1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3863
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3864
				for(;$i<scalar @hidearray;$i++) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3865
					if($hidearray[$i]{hide}==1) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3866
						my $rom=$hidearray[$i]{rom};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3867
						my $destination=$hidearray[$i]{dest};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3868
						while($obeyrom<$rom && $obyrecordline<scalar @obydata) { #pushes lines to @newobydata until specified rom is reached
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3869
							push @newobydata, $obydata[$obyrecordline];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3870
							if($obydata[$obyrecordline] =~/^\s*REM\s+ROM_IMAGE\[(\d)\]\s*$/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3871
								$obeyrom=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3872
							}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3873
							$obyrecordline++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3874
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3875
						my $flag=1; #get to here when $obeyrom==$rom
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3876
						while($flag && $obyrecordline<scalar @obydata) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3877
							$destination=~s|\\|/|g;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3878
							my $obyline=$obydata[$obyrecordline];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3879
							$obyline=~s|\\|/|g;			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3880
							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
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3881
								push @newobydata, "hide=$hidearray[$i]{dest}\n$obydata[$obyrecordline]";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3882
								$obyrecordline++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3883
								$flag=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3884
							} else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3885
								push @newobydata, $obydata[$obyrecordline++];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3886
							}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3887
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3888
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3889
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3890
			}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3891
		}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3892
		while($obyrecordline< scalar @obydata) { # add the rest of the lines from @obydata to @newobydata
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3893
			push @newobydata, $obydata[$obyrecordline++];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3894
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3895
		@obydata=@newobydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3896
		undef @newobydata;	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3897
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3898
	dump_obydata("tmp9.oby", "result of cleaning phase") if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3899
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3900
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3901
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3902
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3903
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3904
# Divide the oby file into multiple sections - one for each rom image - ready
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3905
# for the appropriate rom builder.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3906
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3907
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3908
sub generate_romheader
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3909
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3910
	my ($idx) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3911
	if ($romimage[$idx]{xip} ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3912
	{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3913
		my $header = "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3914
		if ($romimage[$idx]{extension})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3915
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3916
			$header = "extensionrom=$rombasename.$romimage[$idx]{name}.img\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3917
			$header .= "romsize=$romimage[$idx]{size}\n\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3918
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3919
		return $header; 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3920
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3921
	# non-xip
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3922
	my $header;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3923
	if ($romimage[$idx]{extension})
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3924
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3925
		$header =  "extensionrofs=$rombasename.$romimage[$idx]{name}.img\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3926
		$header .= "rofssize=$romimage[$idx]{size}\n\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3927
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3928
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3929
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3930
		$header="rofsname=$rombasename.$romimage[$idx]{name}.img\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3931
		$header .= "rofssize=$romimage[$idx]{size}\n\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3932
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3933
	return $header;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3934
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3935
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3936
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3937
# Dump OBY file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3938
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3939
# Creates final OBY file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3940
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3941
sub create_dumpfile
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3942
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3943
	my $romimageidx;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3944
	my $smrimageidx = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3945
	my $dumpfile="$rombasename";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3946
	$romimage[0]{obeyfile}=$dumpfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3947
	$dumpfile .= ".oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3948
	unlink($dumpfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3949
	if($rombasename && !$onlysmrimage)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3950
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3951
		open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3952
		print "* Writing $dumpfile - final OBY file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3953
		$romimageidx=0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3954
		print DUMPFILE generate_romheader($romimageidx);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3955
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3956
	foreach $line (@obydata)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3957
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3958
		if ($line =~ /^\s*REM ROM_IMAGE\[(\d+)\]\s+(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3959
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3960
			$romimageidx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3961
			if ($romimage[$romimageidx]{extension} eq '0')
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3962
			{ # next rom oby file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3963
				close DUMPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3964
				$dumpfile="$rombasename.$romimage[$romimageidx]{name}";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3965
				$romimage[$romimageidx]{obeyfile}=$dumpfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3966
				$dumpfile .= ".oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3967
				open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3968
				print "* Writing $dumpfile - final OBY file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3969
				# header
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3970
				print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3971
				print DUMPFILE generate_romheader($romimageidx);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3972
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3973
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3974
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3975
			{ # extension
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3976
				# header
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3977
				print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3978
				print DUMPFILE generate_romheader($romimageidx);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3979
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3980
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3981
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3982
		# write data drive oby file.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3983
		elsif ($line =~ /^\s*REM DATA_IMAGE\[(\d+)\]\s+(.*)$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3984
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3985
				my $dataimageidx=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3986
				close DUMPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3987
				$dumpfile="$datadriveimage[$dataimageidx]{name}";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3988
				$datadriveimage[$dataimageidx]{obeyfile}=$dumpfile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3989
				$dumpfile .= ".oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3990
				open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3991
				print "* Writing $dumpfile - intermediate OBY file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3992
				# header
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3993
				print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3994
				print DUMPFILE generate_datadriveheader($dataimageidx,\@datadriveimage);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3995
				push(@dataDriveFileList,$dumpfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3996
				next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3997
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3998
		elsif ($line =~ /^\s*REM SMR_IMAGE\s*$/i)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  3999
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4000
			close DUMPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4001
			$dumpfile = $obeyFileList[$smrimageidx];
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4002
			$smrimageidx++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4003
			$dumpfile .= ".oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4004
			open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4005
			print "*Writing $dumpfile - intermediate OBY file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4006
			print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4007
			push(@smrImageFileList, $dumpfile);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4008
			next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4009
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4010
		print DUMPFILE $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4011
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4012
	close DUMPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4013
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4014
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4015
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4016
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4017
# Full ROM directory listing - use case-insensitive sort
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4018
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4019
sub create_dirlisting
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4020
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4021
	if($rombasename)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4022
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4023
		print "* Writing $rombasename.dir - ROM directory listing\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4024
		open DIRFILE, ">$rombasename.dir" or die("* Can't create ROM directory listing\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4025
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4026
		my $file;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4027
		my $prevdir = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4028
		foreach $file (sort {uc($a) cmp uc($b)} keys %romfiles)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4029
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4030
			my $dir = substr $file,0,rindex($file, "\\");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4031
			if (uc $dir ne uc $prevdir)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4032
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4033
				$prevdir = $dir;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4034
				print DIRFILE "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4035
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4036
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4037
			my @sources = split /\n/,$romfiles{$file};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4038
			my @ibyfiles = split /\n/,$ibyfiles{$file};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4039
			printf DIRFILE "%-40s\t%s\t%s\n", $file, shift @sources, shift @ibyfiles;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4040
			while (@sources)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4041
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4042
				printf DIRFILE "%39s+\t%s\t%s\n", "", shift @sources, shift @ibyfiles;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4043
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4044
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4045
		close DIRFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4046
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4047
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4048
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4049
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4050
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4051
# Suppress Rom/Rofs/DataDrive Image creation if "-noimage" option is provided.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4052
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4053
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4054
sub suppress_image_generation
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4055
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4056
	if($noimage) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4057
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4058
		&tidy_exit;		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4059
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4060
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4061
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4062
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4063
# Execute rombuild & maksym for each final XIP OBY file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4064
# Execute rofsbuild for each non-XIP oby file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4065
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4066
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4067
sub run_rombuilder
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4068
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4069
	my ($command, $obeyfile, $logfile) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4070
	$command .= " $obeyfile.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4071
	#CR1258 test cases are depending on the following output.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4072
	print "* Executing $command\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4073
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4074
	open DATA, "$command 2>&1 |"   or die "Couldn't execute command: $command";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4075
	while ( defined( my $line = <DATA> ) ) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4076
	chomp($line);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4077
	print "$line\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4078
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4079
	close DATA;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4080
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4081
	if ($? != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4082
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4083
		$errors++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4084
		$command =~ /^\s*(\S+)\s+-slog/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4085
		print "* $1 failed\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4086
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4087
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4088
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4089
		push(@romImages,$obeyfile.".img");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4090
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4091
	print "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4092
	rename "$logfile","$obeyfile.log" or die("* Can't rename $logfile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4093
	exit(1) if ($errors);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4094
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4095
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4096
#----------------------------------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4097
# ROMBUILD AND ROFSBUILD
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4098
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4099
# Invokes rombuild and rofsbuild.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4100
# Creates .log, .symbol files.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4101
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4102
sub invoke_rombuild
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4103
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4104
	#For CR1258, -compress command line option is introduced, and it's being handled as following
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4105
	my $rom_compression_type;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4106
	if($opt_compression_type eq ALLSECTIONS)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4107
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4108
		$rom_compression_type = "-compress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4109
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4110
	elsif($opt_compression_type eq PAGEDSECTION)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4111
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4112
		$rom_compression_type = "-compress=paged";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4113
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4114
	elsif($opt_compression_type eq UNPAGEDSECTION)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4115
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4116
		$rom_compression_type = "-compress=unpaged";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4117
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4118
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4119
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4120
		$rom_compression_type = "";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4121
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4122
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4123
	my $rombuild;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4124
	if(!$geninc)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4125
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4126
		$rombuild = "rombuild -slog $rom_compression_type $logLevel $lowMem $opt_fastcompress $opt_jobs";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4127
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4128
	else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4129
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4130
		$rombuild = "rombuild -slog $rom_compression_type -geninc $logLevel $lowMem $opt_fastcompress $opt_jobs";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4131
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4132
	if($gendep)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4133
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4134
		$rombuild .= " -gendep";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4135
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4136
	my $rofsbuild = "rofsbuild -slog $logLevel $lowMem $opt_fastcompress $opt_jobs";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4137
	foreach my $arg (keys %rombuildOptions)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4138
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4139
		$rombuild .= " $arg";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4140
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4141
	        
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4142
	for (my $romidx=0; $romidx<8; $romidx++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4143
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4144
		my $obeyfile=$romimage[$romidx]{obeyfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4145
		my $xip=$romimage[$romidx]{xip};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4146
		my $compress=$romimage[$romidx]{compress};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4147
		my $uncompress=$romimage[$romidx]{uncompress};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4148
		if ($obeyfile)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4149
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4150
			if(!defined $opt_compression)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4151
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4152
				if ($compress ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4153
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4154
					$compress=" -compress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4155
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4156
				elsif($uncompress ne 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4157
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4158
					$compress=" -uncompress";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4159
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4160
 				elsif($compress eq 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4161
 				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4162
 					$compress=" ";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4163
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4164
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4165
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4166
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4167
				$compress = $opt_compression;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4168
				$compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4169
				print "* ".$1." ".$2.": ".$3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4170
			}                        
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4171
			if ($xip)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4172
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4173
				run_rombuilder($rombuild.$compress, $obeyfile, "ROMBUILD.LOG");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4174
				if(!$nosymbols){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4175
				print "* Writing $obeyfile.symbol - ROM symbol file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4176
				print "* Executing maksym $obeyfile.log $obeyfile.symbol\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4177
				system("maksym $obeyfile.log $obeyfile.symbol >maksym.out");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4178
				exit(1) if (!-e "$obeyfile.symbol");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4179
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4180
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4181
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4182
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4183
				# efficient_rom_paging.pm can move everything to core rom.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4184
				# If that is the case, don't run rofsbuild at all to avoid errors.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4185
				use constant TRUE => 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4186
				use constant FALSE => 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4187
				my $run_rofs_build = FALSE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4188
				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4189
				open OBYFILE, "$obeyfile.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4190
				for (<OBYFILE>)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4191
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4192
					if (is_oby_statement($_))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4193
					{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4194
						$run_rofs_build = TRUE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4195
						last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4196
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4197
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4198
				close OBYFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4199
				if ($run_rofs_build)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4200
				{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4201
					run_rombuilder($rofsbuild.$compress, $obeyfile, "ROFSBUILD.LOG");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4202
					if(!$nosymbols){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4203
					print "* Writing $obeyfile.symbol - ROFS symbol file\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4204
					print "* Executing maksymrofs $obeyfile.log $obeyfile.symbol\n" if ($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4205
					system("maksymrofs $obeyfile.log $obeyfile.symbol >maksym.out");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4206
					exit(1) if (!-e "$obeyfile.symbol" );
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4207
					}			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4208
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4209
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4210
			unlink "rombuild.log";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4211
			unlink "maksym.out";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4212
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4213
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4214
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4215
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4216
#-------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4217
# Subroutine: check if current statement is a valid oby statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4218
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4219
sub is_oby_statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4220
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4221
	my ($li) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4222
	if ($li =~ /\s*data\s*=/) { return 1;}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4223
	if ($li =~ /\s*file\s*=/) { return 1;}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4224
	if ($li =~ /\s*dll\s*=/) { return 1;}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4225
	if ($li =~ /\s*secondary\s*=/) { return 1;}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4226
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4227
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4228
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4229
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4230
#-------------------------------------------------------
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4231
# Subroutine: convert possibly absolute path into relative path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4232
#
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4233
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4234
sub relative_path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4235
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4236
    my ($arg) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4237
    return $arg if ($arg !~ /^\\/);	# not an absolute path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4238
    if ($uppath eq "x")
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4239
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4240
		$uppath=cwd;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4241
		$uppath=~s-/-\\-go;		    # separator from Perl 5.005_02+ is forward slash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4242
		$uppath=~s-^(.*[^\\])$-$1\\-o;	    # ensure path ends with a backslash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4243
		$uppath=~s-\\([^\\]+)-\\..-og;	    # convert directories into ..
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4244
		$uppath=~s-^.:\\--o;		    # remove drive letter and leading backslash
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4245
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4246
    $arg=~s-^\\--o;	# remove leading backslash from original path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4247
    return "$uppath$arg";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4248
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4249
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4250
# Returns the global @obydata reference to support external tool invocation.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4251
sub getOBYDataRef{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4252
	return \@obydata;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4253
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4254
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4255
#Match the blank or the comment
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4256
sub isobystatement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4257
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4258
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4259
	if ($l !~ /=/) { 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4260
		return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4261
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4262
	return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4263
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4264
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4265
#Match the data statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4266
sub isdatastatement {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4267
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4268
	if ($l !~ /data=/) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4269
	{ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4270
		return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4271
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4272
	return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4273
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4274
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4275
#Match the spidata statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4276
sub isspidatastatement {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4277
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4278
	if ($l !~ /spidata=/) { 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4279
		return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4280
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4281
	return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4282
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4283
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4284
#Match the executable statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4285
sub isexecutablefile {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4286
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4287
	if (($l=~/file=/)||($l=~/dll=/)||($l=~/primary=/)||($l=~/secondary=/)||($l=~/variant=/)||($l=~/device=/)||($l=~/extension=/)){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4288
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4289
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4290
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4291
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4292
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4293
#Match the directory metadata statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4294
sub isdirectorymetadata {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4295
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4296
	if (($l=~/hide=/) || ($l=~/rename=/) || ($l=~/alias=/)){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4297
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4298
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4299
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4300
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4301
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4302
#Match the bitmap statements
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4303
sub isbitmap {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4304
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4305
	if ($l=~/bitmap=/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4306
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4307
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4308
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4309
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4310
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4311
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4312
#Match the aif file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4313
sub isaif {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4314
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4315
	if ($l=~/(.*)\.aif/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4316
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4317
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4318
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4319
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4320
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4321
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4322
#Match the resource file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4323
sub isresource {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4324
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4325
	if ($l=~/(.*)\.rsc/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4326
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4327
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4328
	return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4329
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4330
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4331
#Returns the executable extensions
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4332
sub executableextension {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4333
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4334
	if ($l=~/file=(.*)\.exe$/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4335
		return "exe";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4336
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4337
	elsif ($l=~/file=(.*)\.dll$/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4338
		return "dll";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4339
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4340
	elsif ($l=~/file=(.*)\.ldd$/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4341
		return "ldd";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4342
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4343
	elsif ($l=~/file=(.*)\.fsy$/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4344
		return "fsy";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4345
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4346
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4347
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4348
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4349
#Returns all 3 UIDS
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4350
sub executabletype {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4351
	my ($l) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4352
	my $uid1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4353
	my $uid2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4354
	my $uid3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4355
	if ($l=~/uid1\s(0x[\d]*)/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4356
		$uid1=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4357
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4358
	if ($l=~/uid2\s(0x[\d]*)/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4359
		$uid2=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4360
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4361
	if ($l=~/uid3\s(0x[\d]*)/){ 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4362
		$uid3=$1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4363
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4364
	
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4365
	return $uid1." ".$uid2." ".$uid3."\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4366
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4367
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4368
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4369
#Return source file name
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4370
sub getSourceFile {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4371
	my ($line) = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4372
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4373
		return $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4374
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4375
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4376
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4377
#Return destination file name
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4378
sub getDestFile{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4379
	my ($line) = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4380
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4381
		return $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4382
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4383
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4384
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4385
#Return the obycommand attributes
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4386
sub getOBYAttributes{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4387
	my ($line) = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4388
	if ($line=~/(\w*=)(\S*\s+\S*)\s+(\S*)\s+(\S*)?/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4389
		return $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4390
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4391
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4392
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4393
#Return the hardware variant delimiter
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4394
sub getHardwareVariant{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4395
	my ($line) = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4396
	if ($line=~/(\w*[0x[\d]*]=)/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4397
		return $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4398
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4399
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4400
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4401
#Return the hardware variant delimiter
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4402
sub getObyCommand{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4403
	my ($line) = shift;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4404
	if ($line=~/^[data=]/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4405
		return "data";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4406
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4407
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4408
	if ($line=~/^[file=]/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4409
		return "file";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4410
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4411
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4412
	if ($line=~/^[dll=]/) {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4413
		return "dll";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4414
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4415
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4416
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4417
# Initialize the symbol info within the given DLL.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4418
sub AddDllDataInfo
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4419
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4420
	my ($line) = @_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4421
	# syntax "<DLLname>@<symbolname> <newvalue>"
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4422
	if($line =~ /^\s*(\S+)\s*\@\s*(\S+)\s+(\S+)\s*$/)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4423
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4424
		my $dllName = lc ($1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4425
		my $symbolname = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4426
		my $intVal = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4427
		my $newVal = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4428
		if($intVal =~ /^0x([0-9a-fA-F]+)$/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4429
		$newVal = hex($1);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4430
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4431
		elsif($intVal =~ /^(-\d+)$/ or $intVal =~ /^(\d+)$/){		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4432
			$newVal = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4433
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4434
		else{
57
a44af1db196f Update buildrom.pm to keep better information for patchdata, with corresponding changes in repair_obyfile.pl and filter_obyfile.pl
William Roberts <williamr@symbian.org>
parents: 52
diff changeset
  4435
 			print_source_error("ERROR: Invalid patchable value : $line");
9
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4436
 			$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4437
 			return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4438
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4439
		$symbolname =~ s/:(\d+)\[(0x)?[0-9a-f]+\]$//i;	# Remove array element specification (:ELEMENT_BIT_SIZE[INDEX]) to get symbol name
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4440
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4441
		my $DllMapRef = \%{$DllDataMap{$dllName}};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4442
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4443
		my %DllSymInfo = ();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4444
		$DllSymInfo{ordinal}	= undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4445
		$DllSymInfo{dataAddr}	= undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4446
		$DllSymInfo{size}		= undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4447
		# We don't store the value here, since patchdata can be used on an array,
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4448
		# in which case we'll create another one of these, and lose the value.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4449
		# Instead, the value is retrieved by re-parsing the command line later.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4450
		$DllSymInfo{lineno}		= $sourceline;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4451
		$DllSymInfo{obyfilename}= $sourcefile;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4452
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4453
		$DllMapRef->{$symbolname} = \%DllSymInfo;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4454
		return 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4455
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4456
		return 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4457
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4458
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4459
sub process_dlldata
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4460
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4461
	if(!$patchDataStmtFlag){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4462
		return;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4463
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4464
	my $symbolTblEntry;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4465
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4466
	foreach my $dll (keys %DllDataMap){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4467
		my $DllMapRef = $DllDataMap{$dll};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4468
		if(!$DllMapRef->{srcfile}){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4469
		next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4470
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4471
		my $aDllFile = $DllMapRef->{srcfile};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4472
		my $SymbolCount = scalar ( keys %{$DllMapRef}) - 2; #The map has 'srcfile' and 'dstpath' special keys besides the symbols.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4473
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4474
		my $DllSymMapRef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4475
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4476
		my @BPABIPlats = &BPABIutl_Plat_List;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4477
		my $matchedSymbols = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4478
		my $globalSyms = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4479
		my @platlist = &Plat_List();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4480
		my $platName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4481
		my $rootPlatName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4482
		my $plat = "ARMV5";				
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4483
		$plat = &Variant_GetMacro() ? $plat."_ABIV1" : $plat."_ABIV2";		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4484
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4485
		foreach my $plat(@platlist) 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4486
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4487
			if(($aDllFile =~ /\\($plat)\\/i) or ($aDllFile =~ /\\($plat\.\w+)\\/i ))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4488
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4489
				$platName = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4490
				last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4491
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4492
		}		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4493
		$rootPlatName =	&Plat_Customizes($platName) ? &Plat_Root($platName) : $platName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4494
		
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4495
		# Map files will be referred for all ARM platforms, 
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4496
		# and for BSF platforms which cutomizes ARM platforms.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4497
		if($rootPlatName =~ /^ARMV5|$plat$/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4498
			my $mapfile = "${aDllFile}.map";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4499
			
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4500
			open MAPFILE, "$mapfile" or die "Can't open $mapfile\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4501
			while(<MAPFILE>){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4502
			my $line = $_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4503
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4504
				#Ignore Local symbols.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4505
				if(!$globalSyms){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4506
					if($line =~ /Global Symbols/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4507
						$globalSyms = 1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4508
						next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4509
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4510
					else{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4511
						next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4512
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4513
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4514
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4515
				$symbolTblEntry = $line;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4516
				if($symbolTblEntry =~ /\s*(\S+)(?:\s+\(EXPORTED\))?\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4517
					my $symbol		= $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4518
					my $symbolValue = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4519
					my $data		= $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4520
					my $symbolSz	= $4;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4521
					if(!exists $DllMapRef->{$symbol}){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4522
						next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4523
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4524
					$DllSymMapRef = $DllMapRef->{$symbol};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4525
					if($data =~ /Data/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4526
					# Valid
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4527
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4528
					else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4529
					#	Invalid to patch a code symbol.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4530
						print( "$DllSymMapRef->{obyfilename}($DllSymMapRef->{lineno}): Warning: $symbol is not a data Symbol.Ignoring patch statement.\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4531
						$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4532
						$DllMapRef->{$symbol} = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4533
						next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4534
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4535
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4536
					
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4537
					# Record the address and the size of the symbol.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4538
					$DllSymMapRef->{dataAddr} = $symbolValue;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4539
					$DllSymMapRef->{size} = $symbolSz;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4540
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4541
					$matchedSymbols++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4542
					if( $matchedSymbols >= $SymbolCount){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4543
						last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4544
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4545
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4546
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4547
			close MAPFILE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4548
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4549
		# DSO files will be referred for BPABI platforms(excluding ARM platforms),
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4550
		# and for BSF platforms which cutomizes BPABI platforms.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4551
		else {
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4552
			my $abiDir = undef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4553
			foreach my $bpabi (@BPABIPlats){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4554
				if($rootPlatName =~ /^$bpabi$/i){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4555
					$abiDir = $platName;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4556
					last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4557
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4558
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4559
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4560
			if(!defined $abiDir){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4561
				print("Can't locate the map or proxy dso file for $aDllFile\n");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4562
				$errors++ if($strict);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4563
				next; #go to the next patch dll data statement
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4564
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4565
			if( $aDllFile =~ /(.*)\.[^.]+$/ ){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4566
				my $proxydsofile = "$1.dso";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4567
				$proxydsofile =~ s/$abiDir\\(.*)\\/ARMV5\\LIB\\/ig;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4568
				open PIPE, "getexports -d $proxydsofile|" or die "Can't open file $proxydsofile\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4569
				while (<PIPE>){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4570
					my $line = $_;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4571
					if($line =~ /\s*(\S+)\s+(\d+)\s+((\S+)\s+(\d+))?/){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4572
						my $symbol = $1;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4573
						my $ordinal = $2;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4574
						my $data = $3;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4575
						my $symbolSz = $5;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4576
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4577
						if(!$data){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4578
							next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4579
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4580
						if(!exists $DllMapRef->{$symbol}){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4581
							next;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4582
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4583
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4584
						$DllSymMapRef = $DllMapRef->{$symbol};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4585
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4586
						# Record the ordinal and the size of the symbol.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4587
						$DllSymMapRef->{ordinal} = $ordinal;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4588
						$DllSymMapRef->{size} = $symbolSz;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4589
						$matchedSymbols++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4590
						if( $matchedSymbols >= $SymbolCount){
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4591
						last;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4592
						}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4593
					}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4594
				}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4595
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4596
				close PIPE;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4597
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4598
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4599
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4600
	exit(1) if ($errors && $strict ) ;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4601
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4602
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4603
# make sure that all the absolute feature variant paths include a
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4604
# drive letter. This is required because cpp will not work with
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4605
# absolute paths starting with slashes.
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4606
sub addDrivesToFeatureVariantPaths
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4607
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4608
	return unless $featureVariant{'VALID'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4609
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4610
	my $current = cwd();
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4611
	my $drive = $1 if ($current =~ /^(.:)/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4612
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4613
	# pre-include file
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4614
	my $HRH = $featureVariant{'VARIANT_HRH'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4615
	$featureVariant{'VARIANT_HRH'} = $drive . $HRH if ($HRH =~ /^[\\\/]/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4616
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4617
	# ROM include path
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4618
	my $dirRef = $featureVariant{'ROM_INCLUDES'};
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4619
	return unless $dirRef;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4620
	my $i = 0;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4621
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4622
	foreach my $dir (@$dirRef)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4623
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4624
		$$dirRef[$i] = $drive . $dir if ($dir =~ /^[\\\/]/);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4625
		$i++;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4626
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4627
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4628
sub create_smrimage
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4629
{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4630
	if($needSmrImage)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4631
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4632
		foreach my $oby (@obeyFileList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4633
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4634
			my $command = "rofsbuild -slog -smr=$oby.oby";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4635
			print "* Executing $command\n" if($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4636
			system($command);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4637
			if($? != 0)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4638
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4639
				print("* ROFSBUILD failed to generate SMR IMAGE\n") if($opt_v);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4640
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4641
			else
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4642
			{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4643
				push(@smrImageFileList, $oby.".img");
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4644
			}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4645
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4646
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4647
	if(@smrImageFileList)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4648
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4649
		print "\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4650
		print "-------------------------------------------------------\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4651
		print "| List of file(s) generated pertaining to SMR image |\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4652
		print "-------------------------------------------------------\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4653
		my $arraySize = scalar(@smrImageFileList);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4654
		for(my $i=0; $i < $arraySize; $i++)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4655
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4656
			my $element = shift(@smrImageFileList);
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4657
			my $size = -s $element;
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4658
			print "Size = ".$size." bytes"."\t"."File = ".$element."\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4659
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4660
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4661
	foreach my $errSmr (keys(%smrNameInfo))
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4662
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4663
		if($smrNameInfo{$errSmr} > 1)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4664
		{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4665
			print "\n SMR image: $errSmr.img creating error for duplicated names!\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4666
		}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4667
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4668
	if($smrNoImageName)
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4669
	{
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4670
		print "\n SMR image creating error for empty image name!\n";
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4671
	}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4672
}
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4673
b5c893269cd5 Update repair_obyfile.pl to handle the features and spi generation correctly - now has "-f" option to specify a "features.iby" file.
William Roberts <williamr@symbian.org>
parents:
diff changeset
  4674
1;