changeset 606 | 30b30f9da0b7 |
parent 0 | 044383f39525 |
child 607 | 378360dbbdba |
605:122d2b873fd1 | 606:30b30f9da0b7 |
---|---|
1 # |
1 # |
2 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 # Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 # All rights reserved. |
3 # All rights reserved. |
4 # This component and the accompanying materials are made available |
4 # This component and the accompanying materials are made available |
5 # under the terms of the License "Eclipse Public License v1.0" |
5 # under the terms of the License "Eclipse Public License v1.0" |
6 # which accompanies this distribution, and is available |
6 # which accompanies this distribution, and is available |
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
56 featurefile_creation_phase |
56 featurefile_creation_phase |
57 processData |
57 processData |
58 create_smrimage |
58 create_smrimage |
59 ); |
59 ); |
60 |
60 |
61 my $useinterpretsis = 1; |
|
62 if ($^O !~ /^MSWin32$/i){ |
|
63 $useinterpretsis = 0; |
|
64 } |
|
61 my $enforceFeatureManager = 0; # Flag to make Feature Manager mandatory if SYMBIAN_FEATURE_MANAGER macro is defined. |
65 my $enforceFeatureManager = 0; # Flag to make Feature Manager mandatory if SYMBIAN_FEATURE_MANAGER macro is defined. |
62 |
66 |
63 my $BuildromMajorVersion = 3 ; |
67 my $BuildromMajorVersion = 3 ; |
64 my $BuildromMinorVersion = 17; |
68 my $BuildromMinorVersion = 26; |
65 my $BuildromPatchVersion = 0; |
69 my $BuildromPatchVersion = 0; |
70 |
|
66 |
71 |
67 sub print_usage |
72 sub print_usage |
68 { |
73 { |
69 |
74 |
70 # Option "-fm" will be supported instead of option "-f|fr" if SYMBIAN_FEATURE_MANAGER macro is defined. |
75 # Option "-fm" will be supported instead of option "-f|fr" if SYMBIAN_FEATURE_MANAGER macro is defined. |
92 and subsequently adjusted by statements in the ROM specification language. |
97 and subsequently adjusted by statements in the ROM specification language. |
93 The final specification is in the subset of the specification language |
98 The final specification is in the subset of the specification language |
94 which is understood directly by ROMBUILD. |
99 which is understood directly by ROMBUILD. |
95 |
100 |
96 Each obyfile parameter specifies a file via a search path: if the |
101 Each obyfile parameter specifies a file via a search path: if the |
97 filename is not matched then buildrom will look in \\epoc32\\rom\\include. |
102 filename is not matched then buildrom will look in \/epoc32\/rom\/include. |
98 |
103 |
99 Buildrom invokes ROMBUILD to generate the ROM image, and produces a |
104 Buildrom invokes ROMBUILD to generate the ROM image, and produces a |
100 number of related files such as the ROM symbol file. The name of the |
105 number of related files such as the ROM symbol file. The name of the |
101 image file is specified directly by the -o option, or determined by |
106 image file is specified directly by the -o option, or determined by |
102 scanning the final specification for the "romname" keyword. If there is |
107 scanning the final specification for the "romname" keyword. If there is |
120 -ccomprmethod -- compression method: none|inflate|bytepair |
125 -ccomprmethod -- compression method: none|inflate|bytepair |
121 -geninc -- generate INC file |
126 -geninc -- generate INC file |
122 -gendep -- generate dependence graph for rom image |
127 -gendep -- generate dependence graph for rom image |
123 -nosymbols -- disable creation of symbol file |
128 -nosymbols -- disable creation of symbol file |
124 -noimage -- disable creation of ROM/ROFS/DataDrive Image |
129 -noimage -- disable creation of ROM/ROFS/DataDrive Image |
125 -fastcompress -- compress files with faster bytepair and tradeoff of compress ratio |
|
126 -j<digit> -- do the main job with <digit> threads |
130 -j<digit> -- do the main job with <digit> threads |
131 -cache -- allow the ROFSBUILD to reuse/generate cached executable files |
|
132 -nocache -- force the ROFSBUILD not to reuse/generate cached executable files |
|
133 -cleancache -- permanently remove all cached executable files |
|
127 -loglevel<level> -- Level of information logging where loglevel is 0,1,2 |
134 -loglevel<level> -- Level of information logging where loglevel is 0,1,2 |
128 0 default level of information |
135 0 default level of information |
129 1 host/ROM filenames, file size and the hidden attribute along with level0 log |
136 1 host/ROM filenames, file size and the hidden attribute along with level0 log |
130 2 E32 file header attributes along with level1 log |
137 2 E32 file header attributes along with level1 log |
131 -z=xxx or -zdrivepath=xxx -- specify a location to create Z drive directory. |
138 -z=xxx or -zdrivepath=xxx -- specify a location to create Z drive directory. |
132 -d=xxx or -datadrivepath=xxx -- specify a location to create data drive directory. |
139 -d=xxx or -datadrivepath=xxx -- specify a location to create data drive directory. |
133 -k or -keepgoing -- enable keepgoing,continue to create the data drive image even |
140 -k or -keepgoing -- enable keepgoing,continue to create the data drive image even |
134 if the non-sis, sis or zdrive image file(s) are missing or corrupt. |
141 if the non-sis, sis or zdrive image file(s) are missing or corrupt; create rom/rofs |
142 image even some oby files missing and/or duplicated definitions in oby files . |
|
135 -r or -retainfolder -- enable retainfolder,would retain pre-existence of z & data drive folder. |
143 -r or -retainfolder -- enable retainfolder,would retain pre-existence of z & data drive folder. |
136 -zdriveimage=xxx -- specify Z drive image (ROM, CORE, ROFS or Ext-ROFS image). |
144 -zdriveimage=xxx -- specify Z drive image (ROM, CORE, ROFS or Ext-ROFS image). |
137 -pfile=xxx -- specify a parameter file for interpretsis to take additional parameters. |
145 -pfile=xxx -- specify a parameter file for interpretsis to take additional parameters. |
138 -argforinterpretsis=xxx -- specify command line argument(s) for interpretsis which will override the |
146 -argforinterpretsis=xxx -- specify command line argument(s) for interpretsis which will override the |
139 parameter file contents. |
147 parameter file contents. |
140 -l=xxx or -logimagecontents=xxx -- extract all stub-sis and SWI certificate store file(s) only |
148 -l=xxx or -logimagecontents=xxx -- extract all stub-sis and SWI certificate store file(s) only |
141 and log all the file(s) that are part of the Z drive image on to a log file. |
149 and log all the file(s) that are part of the Z drive image on to a log file. |
142 -I<directory> -- Use <directory> for the referenced IBY/OBY files |
150 -I<directory> -- Use <directory> for the referenced IBY/OBY files |
143 -argfile=xxx -- specify argument-file name containing list of command-line arguments to buildrom |
151 -argfile=xxx -- specify argument-file name containing list of command-line arguments to buildrom |
144 -lowmem -- use memory-mapped file for image build to reduce physical memory consumption |
152 -lowmem -- use memory-mapped file for image build to reduce physical memory consumption |
153 -checkcase -- check character case of path/name in oby/iby files, |
|
154 the result will be checkcase.log, this option is only valid on windows. |
|
155 -workdir=xxx -- specify a directory to contain generated files. |
|
145 |
156 |
146 Popular -D defines to use include |
157 Popular -D defines to use include |
147 |
158 |
148 -D_DEBUG -- select debug versions of some files |
159 -D_DEBUG -- select debug versions of some files |
149 -D_FULL_DEBUG -- select debug versions of all files |
160 -D_FULL_DEBUG -- select debug versions of all files |
150 -D_ARM4 -- specify the target platform |
161 -D_ARM4 -- specify the target platform |
151 |
162 |
152 -D_EABI=xxxx -- specify target for all files (e.g. ARMV5) |
163 -D_EABI=xxxx -- specify target for all files (e.g. armv5) |
153 -D_KABI=xxxx -- specify the target platform for the Kernel (e.g. ARMV5) |
164 -D_KABI=xxxx -- specify the target platform for the Kernel (e.g. armv5) |
154 |
165 |
155 Other defines may be useful for particular OBY files. |
166 Other defines may be useful for particular OBY files. |
156 |
167 |
157 USAGE_EOF |
168 USAGE_EOF |
158 } |
169 } |
159 |
170 |
160 use strict; |
171 use strict; |
161 my $PerlLibPath; # fully qualified pathname of the directory containing our Perl modules |
172 use romutl; |
162 # establish the path to the Perl libraries |
173 use romosvariant; |
163 $PerlLibPath = $FindBin::Bin; # X:/epoc32/tools |
174 |
164 $PerlLibPath =~ s/\//\\/g; # X:\epoc32\tools |
175 my $PerlEPOCPath = &get_epocroot()."epoc32\/tools\/"; # fully qualified pathname of the directory containing EPOC Perl modules |
165 $PerlLibPath .= "\\"; |
176 |
166 sub ExportDirs ($); |
177 sub ExportDirs ($); |
167 |
|
168 use BPABIutl; # for BPABIutl::BPABIutl_Plat_List |
|
169 |
178 |
170 my $xmlrequired = 0; # assume xml required is false. Used to determine if xml |
179 my $xmlrequired = 0; # assume xml required is false. Used to determine if xml |
171 # modules should be loaded. |
180 # modules should be loaded. |
172 |
181 |
173 use Modload; # To load modules dynamically |
182 use flexmodload; # To load modules dynamically |
174 |
183 |
175 # Work out the relative path to the epoc32 directory |
184 # Work out the relative path to the epoc32 directory |
176 use spitool qw(&createSpi); |
185 use spitool qw(&createSpi); |
177 use Cwd; |
186 use Cwd; |
178 use Pathutl; |
|
179 use E32Variant; |
|
180 use E32Plat; |
|
181 use Genutl; |
|
182 use BPABIutl; # for BPABIutl::BPABIutl_Plat_List |
|
183 use externaltools; #To invoke External Tools |
187 use externaltools; #To invoke External Tools |
188 use File::Basename; |
|
184 |
189 |
185 my @tempfiles; |
190 my @tempfiles; |
186 my $preserve = 0; #flag to indicate if temporary files should be preserved |
191 my $preserve = 0; #flag to indicate if temporary files should be preserved |
187 my $uppath="x"; # will be initialised when first needed |
192 my $uppath="x"; # will be initialised when first needed |
188 |
193 |
189 my $epocroot = $ENV{EPOCROOT}; |
194 my $epocroot = &get_epocroot; |
190 die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot)); |
|
191 $epocroot =~ s-/-\\-go; # for those working with UNIX shells |
|
192 die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/); |
|
193 die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/); |
|
194 die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/); |
|
195 die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/); |
|
196 die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot); |
|
197 |
|
198 my $epoc32 = relative_path("${epocroot}epoc32"); |
|
199 $epoc32 =~ s-\\-/-go; |
|
200 |
195 |
201 my @obyfiles; |
196 my @obyfiles; |
202 my $cppargs = "-nostdinc -undef"; |
197 my $cppargs = "-nostdinc -undef"; |
203 my $opt_v = 0; |
198 my $opt_v = 0; |
204 my $opt_o = ""; |
199 my $opt_o = ""; |
221 use constant ALLSECTIONS => 1; # Indicates both paged section and unpaged section will be compressed. |
216 use constant ALLSECTIONS => 1; # Indicates both paged section and unpaged section will be compressed. |
222 use constant PAGEDSECTION => 2; # Indicates only paged section will be compressed. |
217 use constant PAGEDSECTION => 2; # Indicates only paged section will be compressed. |
223 use constant UNPAGEDSECTION => 3; # Indicates only unpaged section will be compressed. |
218 use constant UNPAGEDSECTION => 3; # Indicates only unpaged section will be compressed. |
224 my $opt_compression_type = UNCOMPRESSED; # Leave the ROM image uncompressed by default. |
219 my $opt_compression_type = UNCOMPRESSED; # Leave the ROM image uncompressed by default. |
225 |
220 |
221 #Variables to store cache command line options |
|
222 my $opt_cache = 0; |
|
223 my $opt_nocache = 0; |
|
224 my $opt_cleancache = 0; |
|
225 |
|
226 my $thisdir=cwd; |
226 my $thisdir=cwd; |
227 $thisdir=~s-/-\\-go; # separator from Perl 5.005_02+ is forward slash |
227 $thisdir=~s-\\-\/-go; # separator from Perl 5.005_02+ is forward slash |
228 $thisdir=~s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash |
228 $thisdir.= "\/" unless $thisdir =~ /\/$/; |
229 $thisdir=~s-^.:\\--o; # remove drive letter and leading backslash |
229 $thisdir =~ s-\/-\\-g if (&is_windows); |
230 |
230 |
231 my $rominclude = "$epoc32/rom/include"; |
231 my $rominclude = $epocroot."epoc32\/rom\/include\/"; |
232 $rominclude = &get_epocdrive().$rominclude unless $rominclude =~ /^.:/; |
|
233 $rominclude =~s-\\-\/-g; |
|
234 |
|
232 my %plugintypes; #hash of plugin types and their SPI files' destinations in ROM |
235 my %plugintypes; #hash of plugin types and their SPI files' destinations in ROM |
233 $plugintypes{"ECOM"} = "\\private\\10009d8f\\"; #ECOM SPI files' destination in ROM image |
236 $plugintypes{"ECOM"} = "\/private\/10009d8f\/"; #ECOM SPI files' destination in ROM image |
234 |
237 |
235 my @obydata; |
238 my @obydata; |
236 my @newobydata; |
239 my @newobydata; |
237 my %substitutionData; |
240 my %substitutionData; |
238 my @substitutionOrder; |
241 my @substitutionOrder; |
239 my %languageCodes; |
242 my %languageCodes; |
240 my $defaultLanguageCode; |
243 my $defaultLanguageCode; |
241 my %multiLinguifyAlias; # to by-pass the 'mustbesysbin' option for multilinguify 'alias'es. |
244 my %multiLinguifyAlias; # to by-pass the 'mustbesysbin' option for multilinguify 'alias'es. |
242 my $abiDowngrade; |
245 my $abiDowngrade = ""; |
243 my @binarySelectionOrder; |
246 my @binarySelectionOrder; |
244 my $fromDIR; |
247 my $fromDIR; |
245 my %rombuildOptions = ("-type-safe-link" => 1 ); |
248 my %rombuildOptions = ("-type-safe-link" => 1 ); |
246 my $enforceSysBin = 0; |
249 my $enforceSysBin = 0; |
247 |
250 |
250 my @romimage; |
253 my @romimage; |
251 my $rombasename; |
254 my $rombasename; |
252 |
255 |
253 my $sourcefile; |
256 my $sourcefile; |
254 my $sourceline; |
257 my $sourceline; |
255 my ($line); |
258 #my $line; |
256 my %romfiles; |
259 my %romfiles; |
257 |
260 |
258 # To handle BINARY_SELECTION_ORDER macro. |
261 # To handle BINARY_SELECTION_ORDER macro. |
259 my $firstDIR; |
262 my $firstDIR; |
260 my $binarySelectionOrderFlag = 0; |
263 my $binarySelectionOrderFlag = 0; |
274 my $geninc = ""; |
277 my $geninc = ""; |
275 my $gendep = ""; |
278 my $gendep = ""; |
276 my $nosymbols = ""; |
279 my $nosymbols = ""; |
277 my $noimage = ""; |
280 my $noimage = ""; |
278 my $customizedPlat = undef; |
281 my $customizedPlat = undef; |
279 my $opt_fastcompress = ""; |
|
280 my $opt_jobs= ""; |
282 my $opt_jobs= ""; |
281 |
283 |
282 #Summary of files(both executables and data files) currently includes |
284 #Summary of files(both executables and data files) currently includes |
283 # host and ROM file names, |
285 # host and ROM file names, |
284 # size of the file in ROM |
286 # size of the file in ROM |
289 |
291 |
290 # This option is used to pass -lowmem argument to rombuild/rofsbuild tools |
292 # This option is used to pass -lowmem argument to rombuild/rofsbuild tools |
291 my $lowMem=""; |
293 my $lowMem=""; |
292 |
294 |
293 # Feature Variation modules and data |
295 # Feature Variation modules and data |
294 use featurevariantparser; |
|
295 use featurevariantmap; |
|
296 my %featureVariant; |
296 my %featureVariant; |
297 |
297 |
298 # global variables specific to data drive image generation. |
298 # global variables specific to data drive image generation. |
299 use File::Path; # Module to provide functions to remove or create directories in a convenient way. |
299 use File::Path; # Module to provide functions to remove or create directories in a convenient way. |
300 use File::Copy; # Module to provide functions to copy file(s) from source to destination. |
300 use File::Copy; # Module to provide functions to copy file(s) from source to destination. |
336 my %smrPartitions; |
336 my %smrPartitions; |
337 my %smrNameInfo; |
337 my %smrNameInfo; |
338 my @obeyFileList; |
338 my @obeyFileList; |
339 my $smrNoImageName = 0; |
339 my $smrNoImageName = 0; |
340 my $onlysmrimage = 1; |
340 my $onlysmrimage = 1; |
341 my $checkcase = 0; |
|
342 my $checkcase_platform = ""; |
|
343 my $checkcase_test = 0; |
|
344 my $opt_workdir = 0; |
|
341 |
345 |
342 sub match_obyfile |
346 sub match_obyfile |
343 { |
347 { |
344 my ($obyfile) = @_; |
348 my ($obyfile) = @_; |
345 if (-f $obyfile) |
349 if (-f $obyfile) |
357 |
361 |
358 @otherDirs = @$dirRef if ($dirRef); |
362 @otherDirs = @$dirRef if ($dirRef); |
359 } |
363 } |
360 foreach my $dir (@otherDirs) |
364 foreach my $dir (@otherDirs) |
361 { |
365 { |
366 print "$dir/$obyfile\n" if ($opt_v); |
|
362 if (-f "$dir/$obyfile") |
367 if (-f "$dir/$obyfile") |
363 { |
368 { |
364 push @obyfiles, "$dir/$obyfile"; |
369 push @obyfiles, "$dir/$obyfile"; |
365 return 1; |
370 return 1; |
366 } |
371 } |
430 if($retVal) |
435 if($retVal) |
431 { |
436 { |
432 &datadriveimage::reportError("* Warning could not delete $ZDirloc",$opt_k); |
437 &datadriveimage::reportError("* Warning could not delete $ZDirloc",$opt_k); |
433 } |
438 } |
434 # delete data drive directory if and only if preserve(-p) option is disabled. |
439 # delete data drive directory if and only if preserve(-p) option is disabled. |
435 my $retVal = &deleteDirectory($DataDriveDirloc,$opt_v)if(!($preserve)); |
440 $retVal = &deleteDirectory($DataDriveDirloc,$opt_v)if(!($preserve)); |
436 if($retVal) |
441 if($retVal) |
437 { |
442 { |
438 &datadriveimage::reportError("* Warning could not delete $DataDriveDirloc",$opt_k); |
443 &datadriveimage::reportError("* Warning could not delete $DataDriveDirloc",$opt_k); |
439 } |
444 } |
440 # reset image count to zero. |
445 # reset image count to zero. |
451 |
456 |
452 if (!$preserve) |
457 if (!$preserve) |
453 { |
458 { |
454 foreach my $tempfiles (@tempfiles) |
459 foreach my $tempfiles (@tempfiles) |
455 { |
460 { |
461 print "remove $tempfiles\n" if ($opt_v); |
|
456 unlink "$tempfiles"; |
462 unlink "$tempfiles"; |
457 } |
463 } |
458 } |
464 } |
459 if($rombasename) |
465 if($rombasename) |
460 { |
466 { |
496 if($retVal) |
502 if($retVal) |
497 { |
503 { |
498 exit(1) if(!$opt_k); |
504 exit(1) if(!$opt_k); |
499 } |
505 } |
500 # delete pre-existence of data drive folder, if and only if -r option is not enabled. |
506 # delete pre-existence of data drive folder, if and only if -r option is not enabled. |
501 my $retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r); |
507 $retVal = &datadriveimage::deleteDirectory($DataDriveDirloc,$opt_v) if(!$opt_r); |
502 if($retVal) |
508 if($retVal) |
503 { |
509 { |
504 exit(1) if(!$opt_k); |
510 exit(1) if(!$opt_k); |
505 } |
511 } |
506 if($opt_logFile) |
512 if($opt_logFile) |
507 { |
513 { |
508 # clean any pre-existance of log file. |
514 # clean any pre-existance of log file. |
509 unlink($ZDirloc."\\".$imageEntryLogFile); |
515 unlink($ZDirloc."\/".$imageEntryLogFile); |
510 } |
516 } |
511 |
517 |
512 for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++) |
518 for (my $datadriveidx=0; $datadriveidx < $dataImageCount; $datadriveidx++) |
513 { |
519 { |
514 my $driveIndex = $dataIndexHash{$datadriveidx}; |
520 my $driveIndex = $dataIndexHash{$datadriveidx}; |
529 # check if more than one data drive image needs to be generated. |
535 # check if more than one data drive image needs to be generated. |
530 if( $dataImageCount > 1 ) |
536 if( $dataImageCount > 1 ) |
531 { |
537 { |
532 # if yes, then set the location of prototype data drive folder as |
538 # if yes, then set the location of prototype data drive folder as |
533 # DataDriveDirloc + datadrivename |
539 # DataDriveDirloc + datadrivename |
534 $proDataDriveDirloc = $DataDriveDirloc."\\".$datadrivename; |
540 $proDataDriveDirloc = $DataDriveDirloc."\/".$datadrivename; |
535 } |
541 } |
536 else |
542 else |
537 { |
543 { |
538 # else, then set the location of prototype data drive folder as DataDriveDirloc |
544 # else, then set the location of prototype data drive folder as DataDriveDirloc |
539 $proDataDriveDirloc = $DataDriveDirloc; |
545 $proDataDriveDirloc = $DataDriveDirloc; |
554 { |
560 { |
555 # find out size of the array |
561 # find out size of the array |
556 my $arraysize = scalar(@zDriveImageList); |
562 my $arraysize = scalar(@zDriveImageList); |
557 for( my $i=0; $i < $arraysize; $i++ ) |
563 for( my $i=0; $i < $arraysize; $i++ ) |
558 { |
564 { |
559 $zDriveSisFileLoc = $ZDirloc."\\".$datadrivename; |
565 $zDriveSisFileLoc = $ZDirloc."\/".$datadrivename; |
560 &datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k); |
566 &datadriveimage::invokeReadImage(pop(@zDriveImageList),$zDriveSisFileLoc,$opt_v,$imageEntryLogFile,$opt_k); |
561 } |
567 } |
562 } |
568 } |
563 else |
569 else |
564 { |
570 { |
590 } |
596 } |
591 } |
597 } |
592 } |
598 } |
593 } |
599 } |
594 # invoke INTERPRETSIS tool with z drive folder location. |
600 # invoke INTERPRETSIS tool with z drive folder location. |
595 &datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList)if($sisfilepresent); |
601 if ($useinterpretsis) |
602 { |
|
603 &datadriveimage::invokeInterpretsis( \@sisfilelist,$proDataDriveDirloc,$opt_v,$zDriveSisFileLoc,$paraFile,$opt_k,\@interpretsisOptList)if($sisfilepresent); |
|
604 }else |
|
605 { |
|
606 print "Warning: interpretsis is not ready on linux.\n"; |
|
607 } |
|
596 } |
608 } |
597 |
609 |
598 # create an oby file by traversing through upated prototype data drive directory. |
610 # create an oby file by traversing through upated prototype data drive directory. |
599 &datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist, |
611 &datadriveimage::dumpDatadriveObydata( $proDataDriveDirloc,$datadriveobyfile,$size,\@nonsisFilelist, |
600 \@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v ); |
612 \@renameList,\@aliaslist,\@hideList,\@sisobydata,\@datadrivedata,$opt_k,$opt_v ); |
727 } |
739 } |
728 |
740 |
729 if (!defined $paramFileFlag) |
741 if (!defined $paramFileFlag) |
730 { |
742 { |
731 # Enforce Feature Manager if macro SYMBIAN_FEATURE_MANAGER is defined in the HRH file. |
743 # Enforce Feature Manager if macro SYMBIAN_FEATURE_MANAGER is defined in the HRH file. |
732 my @hrhMacros = &Variant_GetMacroList; |
744 my @hrhMacros = &get_variantmacrolist; |
733 if (grep /^SYMBIAN_FEATURE_MANAGER\s*$/, @hrhMacros) |
745 if (grep /^SYMBIAN_FEATURE_MANAGER\s*$/, @hrhMacros) |
734 { |
746 { |
735 $enforceFeatureManager = 1; |
747 $enforceFeatureManager = 1; |
736 } |
748 } |
737 |
749 |
742 { |
754 { |
743 ¶meterFileProcessor($1); |
755 ¶meterFileProcessor($1); |
744 } |
756 } |
745 } |
757 } |
746 } |
758 } |
747 |
759 # first searching argList for keepgoing option |
760 foreach my $arg (@argList) { |
|
761 if ( $arg =~ /^-k$/i || $arg =~ /^-keepgoing$/i ) |
|
762 { |
|
763 $opt_k = 1; |
|
764 last; |
|
765 } |
|
766 } |
|
748 foreach my $arg (@argList) |
767 foreach my $arg (@argList) |
749 { |
768 { |
750 if ($arg =~ /^-argfile=(.*)/) |
769 if ($arg =~ /^-argfile=(.*)/) |
751 { |
770 { |
752 ¶meterFileProcessor($1) if (defined $paramFileFlag); |
771 ¶meterFileProcessor($1) if (defined $paramFileFlag); |
771 my $varname = $1; |
790 my $varname = $1; |
772 |
791 |
773 if ($varname =~ /^\.(.*)$/) |
792 if ($varname =~ /^\.(.*)$/) |
774 { |
793 { |
775 # for testing, locate the VAR file in the current directory |
794 # for testing, locate the VAR file in the current directory |
776 %featureVariant = featurevariantparser->GetVariant($1, "."); |
795 %featureVariant = get_variant($1, "."); |
777 } |
796 } |
778 else |
797 else |
779 { |
798 { |
780 %featureVariant = featurevariantparser->GetVariant($varname); |
799 %featureVariant = get_variant($varname); |
781 } |
800 } |
782 if (!$featureVariant{'VALID'}) |
801 if (!$featureVariant{'VALID'}) |
783 { |
802 { |
784 print "FEATUREVARIANT $varname is not VALID\n"; |
803 print "FEATUREVARIANT $varname is not VALID\n"; |
785 $errors++; |
804 $errors++; |
795 } |
814 } |
796 if ($arg =~ /^-o(.*)/i) |
815 if ($arg =~ /^-o(.*)/i) |
797 { |
816 { |
798 $opt_o = $1; |
817 $opt_o = $1; |
799 next; |
818 next; |
800 } |
|
801 if ($arg =~ /^-fastcompress$/i) |
|
802 { |
|
803 $opt_fastcompress = "-fastcompress"; |
|
804 next; |
|
805 } |
819 } |
806 if ($arg =~ /^-j(\d+)$/i) |
820 if ($arg =~ /^-j(\d+)$/i) |
807 { |
821 { |
808 $opt_jobs = "-j".$1; |
822 $opt_jobs = "-j".$1; |
809 next; |
823 next; |
869 { |
883 { |
870 print "Error: No filename specified with \"-fm=\" option.\n"; |
884 print "Error: No filename specified with \"-fm=\" option.\n"; |
871 } |
885 } |
872 next; |
886 next; |
873 } |
887 } |
888 #Process Cache command line options. |
|
889 if($arg =~ /^-cache/) |
|
890 { |
|
891 $opt_cache = 1; |
|
892 next; |
|
893 } |
|
894 if($arg =~ /^-nocache/) |
|
895 { |
|
896 $opt_nocache = 1; |
|
897 next; |
|
898 } |
|
899 if($arg =~ /^-cleancache/) |
|
900 { |
|
901 $opt_cleancache = 1; |
|
902 next; |
|
903 } |
|
904 |
|
874 #Process ROM image compression type if it's specified through command line option. |
905 #Process ROM image compression type if it's specified through command line option. |
875 if($arg =~ /^-compress(.*)/) |
906 if($arg =~ /^-compress(.*)/) |
876 { |
907 { |
877 if($1 eq '') |
908 if($1 eq '') |
878 { |
909 { |
956 if($arg =~ /^-gendep$/) |
987 if($arg =~ /^-gendep$/) |
957 { |
988 { |
958 $gendep=1; |
989 $gendep=1; |
959 next; |
990 next; |
960 } |
991 } |
992 if ($arg =~ /^-checkcase$/) |
|
993 { |
|
994 $checkcase=1; |
|
995 next; |
|
996 } |
|
997 if ($arg =~ /^-checkcase_test$/) |
|
998 { |
|
999 $checkcase_test=1; |
|
1000 next; |
|
1001 } |
|
1002 if ($arg =~ /^-workdir=(.*)/) |
|
1003 { |
|
1004 my $workdir = $1; |
|
1005 if (!-d $workdir) |
|
1006 { |
|
1007 die "directory $workdir does not exist\n"; |
|
1008 } |
|
1009 my $currentdir = cwd; |
|
1010 chdir "$workdir" or die "cannot change to directory $workdir\n"; |
|
1011 $thisdir=cwd; |
|
1012 $thisdir=~s-\\-\/-go; # separator from Perl 5.005_02+ is forward slash |
|
1013 $thisdir.= "\/" unless $thisdir =~ /\/$/; |
|
1014 if(&is_windows) |
|
1015 { |
|
1016 $thisdir =~ s-\/-\\-g; |
|
1017 } |
|
1018 $opt_workdir = 1; |
|
1019 chdir "$currentdir"; |
|
1020 next; |
|
1021 } |
|
961 if($arg =~/^-c(.*)/) |
1022 if($arg =~/^-c(.*)/) |
962 { |
1023 { |
963 if($1 eq 'none' ) |
1024 if($1 eq 'none' ) |
964 { |
1025 { |
965 $opt_compression = " -compressionmethod none"; |
1026 $opt_compression = " -compressionmethod none"; |
996 next; |
1057 next; |
997 } |
1058 } |
998 else |
1059 else |
999 { |
1060 { |
1000 $ZDirloc = $1; |
1061 $ZDirloc = $1; |
1001 if( $ZDirloc !~ m/\\(\Z)/) |
1062 $ZDirloc =~ s-\\-\/-g; |
1063 if( $ZDirloc !~ m/\/(\Z)/) |
|
1002 { |
1064 { |
1003 $ZDirloc .= "\\"; |
1065 $ZDirloc .= "\/"; |
1004 } |
1066 } |
1005 if( $ZDirloc !~ m/:/) |
1067 if( $ZDirloc !~ m/:/) |
1006 { |
1068 { |
1007 print "drive letter not specified\n"; |
1069 print "drive letter not specified\n"; |
1008 $ZDirloc = &datadriveimage::setPath($ZDirloc); |
1070 $ZDirloc = &datadriveimage::setPath($ZDirloc); |
1025 next; |
1087 next; |
1026 } |
1088 } |
1027 else |
1089 else |
1028 { |
1090 { |
1029 $DataDriveDirloc = $1; |
1091 $DataDriveDirloc = $1; |
1030 if( $DataDriveDirloc !~ m/\\(\Z)/) |
1092 $DataDriveDirloc =~ s-\\-\/-g; |
1093 if( $DataDriveDirloc !~ m/\/(\Z)/) |
|
1031 { |
1094 { |
1032 $DataDriveDirloc .= "\\"; |
1095 $DataDriveDirloc .= "\/"; |
1033 } |
1096 } |
1034 if( $DataDriveDirloc !~ m/:/) |
1097 if( $DataDriveDirloc !~ m/:/) |
1035 { |
1098 { |
1036 print "drive not specified\n"; |
1099 print "drive not specified\n"; |
1037 $DataDriveDirloc = &datadriveimage::setPath($DataDriveDirloc); |
1100 $DataDriveDirloc = &datadriveimage::setPath($DataDriveDirloc); |
1086 $paraFile = $1; |
1149 $paraFile = $1; |
1087 next; |
1150 next; |
1088 } |
1151 } |
1089 if ( $arg =~ /^-l=(.*)/i || $arg =~ /^-logimageentry=(.*)/i ) |
1152 if ( $arg =~ /^-l=(.*)/i || $arg =~ /^-logimageentry=(.*)/i ) |
1090 { |
1153 { |
1091 if( $1 =~/\\/ || $1 =~ m/:/) |
1154 if( $1 =~/[\/\\]/ || $1 =~ m/:/) |
1092 { |
1155 { |
1093 print "* Warning: Invalid log file extension try filename.txt\n"; |
1156 print "* Warning: Invalid log file extension try filename.txt\n"; |
1094 next; |
1157 next; |
1095 } |
1158 } |
1096 else |
1159 else |
1114 # It's an OBY file |
1177 # It's an OBY file |
1115 next if (match_obyfile($arg)); |
1178 next if (match_obyfile($arg)); |
1116 next if (match_obyfile("$arg.oby")); |
1179 next if (match_obyfile("$arg.oby")); |
1117 |
1180 |
1118 print "Cannot find oby file: $arg\n"; |
1181 print "Cannot find oby file: $arg\n"; |
1119 $errors++; |
1182 $errors++ if(!$opt_k); |
1120 } |
1183 } |
1121 |
1184 |
1122 if (defined $paramFileFlag) |
1185 if (defined $paramFileFlag) |
1123 { |
1186 { |
1124 return; |
1187 return; |
1125 } |
1188 } |
1126 |
1189 |
1127 if (@obyfiles<1) |
1190 if (@obyfiles<1) |
1128 { |
1191 { |
1129 print "Missing obyfile argument\n"; |
1192 print "Missing obyfile argument\n"; |
1130 $errors++; |
1193 $errors++ if(!$opt_k); |
1131 } |
1194 } |
1132 |
1195 |
1133 if ($errors) |
1196 if ($errors) |
1134 { |
1197 { |
1135 print_usage(); |
1198 print_usage(); |
1144 |
1207 |
1145 # Adding variant specific macros by including a HRH file |
1208 # Adding variant specific macros by including a HRH file |
1146 # (only required if no Feature Variant is used) |
1209 # (only required if no Feature Variant is used) |
1147 if (!$featureVariant{'VALID'}) |
1210 if (!$featureVariant{'VALID'}) |
1148 { |
1211 { |
1149 my $variantMacroHRHFile = Variant_GetMacroHRHFile(); |
1212 my $variantMacroHRHFile = get_variantmacroHRHfile(); |
1150 if($variantMacroHRHFile){ |
1213 if($variantMacroHRHFile){ |
1151 |
1214 my $variantFilePath = split_path('Path',$variantMacroHRHFile); |
1152 my $variantFilePath = Path_Split('Path',$variantMacroHRHFile); |
1215 $cppargs .= " -I " . &append_driveandquote($variantFilePath) . " -include " . &append_driveandquote($variantMacroHRHFile); |
1153 $cppargs .= " -I \"" . &Path_RltToWork($variantFilePath) . "\" -include \"" . &Path_RltToWork($variantMacroHRHFile) . "\""; |
1216 print "in cmd process $cppargs\n" if ($opt_v); |
1154 } |
1217 } |
1155 } |
1218 } |
1156 # load the required modules if xml is required |
1219 # load the required modules if xml is required |
1157 if ($xmlrequired == 1) |
1220 if ($xmlrequired == 1) |
1158 { |
1221 { |
1159 my $epocToolsPath = $ENV{EPOCROOT}."epoc32\\tools\\"; |
|
1160 Load_SetModulePath($epocToolsPath); |
|
1161 if (defined ($featureXml)) |
1222 if (defined ($featureXml)) |
1162 { |
1223 { |
1163 load_featuresutil(); |
1224 load_featuresutil(); |
1164 } |
1225 } |
1165 |
1226 |
1166 if ($image_content) |
1227 if ($image_content) |
1167 { |
1228 { |
1168 &Load_ModuleL("ImageContentHandler"); |
1229 &FlexLoad_ModuleL("ImageContentHandler"); |
1169 # some variables for ImageContentHandler may have been setup |
1230 # some variables for ImageContentHandler may have been setup |
1170 my ($key, $value); |
1231 my ($key, $value); |
1171 &ImageContentHandler::SetBldRomOpts; # Defaults to ARMV5 platform |
1232 &ImageContentHandler::SetBldRomOpts; # Defaults to armv5 platform |
1172 while (($key,$value) = each %tmpBldRomOpts) |
1233 while (($key,$value) = each %tmpBldRomOpts) |
1173 { |
1234 { |
1174 &ImageContentHandler::SetBldRomOpts($key, $value); |
1235 &ImageContentHandler::SetBldRomOpts($key, $value); |
1175 } |
1236 } |
1176 } |
1237 } |
1184 # Concatentate the specified .oby files and pass them through cpp |
1245 # Concatentate the specified .oby files and pass them through cpp |
1185 # to get the raw ROM specification in tmp1.oby |
1246 # to get the raw ROM specification in tmp1.oby |
1186 |
1247 |
1187 sub preprocessing_phase |
1248 sub preprocessing_phase |
1188 { |
1249 { |
1189 unlink "tmp1.oby"; |
1250 my $temp1OBYFile = $thisdir."tmp1.oby"; |
1251 unlink "$temp1OBYFile"; |
|
1190 |
1252 |
1191 # Macro "ROM_FEATURE_MANAGEMENT" is defined when "-f|fr" or "-fm" is used |
1253 # Macro "ROM_FEATURE_MANAGEMENT" is defined when "-f|fr" or "-fm" is used |
1192 if (defined ($featureXml)) |
1254 if (defined ($featureXml)) |
1193 { |
1255 { |
1194 $cppargs .= " -DROM_FEATURE_MANAGEMENT "; |
1256 $cppargs .= " -DROM_FEATURE_MANAGEMENT "; |
1213 } |
1275 } |
1214 } |
1276 } |
1215 else |
1277 else |
1216 { |
1278 { |
1217 # no feature variant so use the standard includes |
1279 # no feature variant so use the standard includes |
1218 $cppargs .= " -I. -I$rominclude"; |
1280 $cppargs .= " -I. -I \"$rominclude\""; |
1219 } |
1281 } |
1220 |
1282 |
1221 print "* cpp -o tmp1.oby $cppargs\n" if ($opt_v); |
1283 print "* cpp -Wno-endif-labels -o $temp1OBYFile $cppargs\n" if ($opt_v); |
1222 |
1284 |
1285 is_existinpath("cpp", romutl::DIE_NOT_FOUND); |
|
1223 $errors = 0; |
1286 $errors = 0; |
1224 open CPP, "| cpp -o tmp1.oby $cppargs" or die "* Can't execute cpp"; |
1287 open CPP, "| cpp -Wno-endif-labels -o $temp1OBYFile $cppargs" or die "* Can't execute cpp"; |
1225 foreach my $arg (@obyfiles) |
1288 foreach my $arg (@obyfiles) |
1226 { |
1289 { |
1227 print CPP "\n#line 1 \"$arg\"\n"; |
1290 print CPP "\n#line 1 \"$arg\"\n"; |
1228 |
1291 |
1229 open OBY, $arg or die "* Can't open $arg"; |
1292 if(open(OBY, $arg)) { |
1230 print "* reading $arg\n" if ($opt_v); |
1293 print "* reading $arg\n" if ($opt_v); |
1231 while ($line=<OBY>) |
1294 while ($line=<OBY>) { |
1232 { |
1295 print CPP $line; |
1233 print CPP $line; |
1296 } |
1234 } |
1297 close OBY; |
1235 close OBY; |
1298 } |
1299 else { |
|
1300 print STDERR "* Can't open $arg\n"; |
|
1301 if(!$opt_k){ |
|
1302 close CPP; |
|
1303 exit(1); |
|
1304 } |
|
1305 } |
|
1236 } |
1306 } |
1237 close CPP; |
1307 close CPP; |
1238 my $cpp_status = $?; |
1308 my $cpp_status = $?; |
1239 die "* cpp failed\n" if ($cpp_status != 0 || !-f "tmp1.oby"); |
1309 die "* cpp failed\n" if ($cpp_status != 0 || !-f "$temp1OBYFile"); |
1240 |
1310 |
1241 my $temp1OBYFile = "tmp1.oby"; |
|
1242 if( defined ($image_content)) |
1311 if( defined ($image_content)) |
1243 { |
1312 { |
1244 #Read the OBY file that was generated by the pre-processor |
1313 #Read the OBY file that was generated by the pre-processor |
1245 &ReadPreprocessedFile($temp1OBYFile); |
1314 &ReadPreprocessedFile($temp1OBYFile); |
1246 |
1315 |
1273 while($tmpline =<OBYFH>) { |
1342 while($tmpline =<OBYFH>) { |
1274 if ($tmpline=~/(\S+)\s*=\s*(\S+)\s+(\S+)/) {#Get the first parameter (source File path) from oby line |
1343 if ($tmpline=~/(\S+)\s*=\s*(\S+)\s+(\S+)/) {#Get the first parameter (source File path) from oby line |
1275 $srcFilePath = $2; |
1344 $srcFilePath = $2; |
1276 $dstFilePath = $3; |
1345 $dstFilePath = $3; |
1277 |
1346 |
1278 if ($srcFilePath=~/.*\\(\S+)/) { |
1347 if ($srcFilePath=~/.*[\/\\](\S+)/) { |
1279 $srcFileName = $1; |
1348 $srcFileName = $1; |
1280 } |
1349 } |
1281 if ($dstFilePath=~/.*\\(\S+)/) { |
1350 if ($dstFilePath=~/.*[\/\\](\S+)/) { |
1282 $dstFileName = $1; |
1351 $dstFileName = $1; |
1283 } |
1352 } |
1284 my $binaryInfoRef = &cdfparser::GetBinaryInfo($dstFileName); |
1353 my $binaryInfoRef = &cdfparser::GetBinaryInfo($dstFileName); |
1285 |
1354 |
1286 if(defined($binaryInfoRef)) |
1355 if(defined($binaryInfoRef)) |
1322 $substitutionData{"RIGHT_NOW"} = sprintf("%02d/%02d/%04d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec); |
1391 $substitutionData{"RIGHT_NOW"} = sprintf("%02d/%02d/%04d %02d:%02d:%02d", $mday, $mon+1, $year+1900, $hour, $min, $sec); |
1323 $substitutionData{"EPOCROOT"} = $epocroot; |
1392 $substitutionData{"EPOCROOT"} = $epocroot; |
1324 @substitutionOrder = ("TODAY", "RIGHT_NOW", "EPOCROOT"); |
1393 @substitutionOrder = ("TODAY", "RIGHT_NOW", "EPOCROOT"); |
1325 } |
1394 } |
1326 |
1395 |
1396 my $temp1OBYFile = $thisdir."tmp1.oby"; |
|
1327 |
1397 |
1328 open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n"); |
1398 open TMP1, "$temp1OBYFile" or die("* Can't open $temp1OBYFile\n"); |
1329 while ($line=<TMP1>) |
1399 while ($line=<TMP1>) |
1330 { |
1400 { |
1331 |
|
1332 if(($line =~ /^\s*romsize\s*=/i) || ( $line=~ /^\s*rom_image/i) || ($line =~ /^\s*data_image/i)) |
1401 if(($line =~ /^\s*romsize\s*=/i) || ( $line=~ /^\s*rom_image/i) || ($line =~ /^\s*data_image/i)) |
1333 { |
1402 { |
1334 $onlysmrimage = 0; |
1403 $onlysmrimage = 0; |
1335 last; |
1404 last; |
1336 } |
1405 } |
1337 } |
1406 } |
1338 close TMP1; |
1407 close TMP1; |
1339 if ($enforceFeatureManager && (!$featuremanager) && (!$noFeatureManager) ) |
1408 if ($enforceFeatureManager && (!$featuremanager) && (!$noFeatureManager) ) |
1340 { |
1409 { |
1341 my $defaultFeatureDbFlag = 0; |
1410 my $defaultFeatureDbFlag = 0; |
1342 open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n"); |
1411 open TMP1, "$temp1OBYFile" or die("* Can't open $temp1OBYFile\n"); |
1343 while ($line=<TMP1>) |
1412 while ($line=<TMP1>) |
1344 { |
1413 { |
1345 if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i) |
1414 if ($line=~/^\s*defaultfeaturedb\s*=?\s*(\S+)/i) |
1346 { |
1415 { |
1347 # Get the default value for featuredatabasefile |
1416 # Get the default value for featuredatabasefile |
1348 |
1417 |
1349 $featureXml = "$epocroot$1"; |
1418 $featureXml = "$epocroot$1"; |
1419 $featureXml =~ s-\\-\/-g; |
|
1350 $featuremanager = 1; |
1420 $featuremanager = 1; |
1351 $defaultFeatureDbFlag = 1; |
1421 $defaultFeatureDbFlag = 1; |
1352 load_featuresutil(); |
1422 load_featuresutil(); |
1353 last; |
1423 last; |
1354 } |
1424 } |
1360 print "Error: Neither option \"-fm|-nofm\" nor default value for featuredatabase file is provided.\n"; |
1430 print "Error: Neither option \"-fm|-nofm\" nor default value for featuredatabase file is provided.\n"; |
1361 exit(1); |
1431 exit(1); |
1362 } |
1432 } |
1363 } |
1433 } |
1364 |
1434 |
1365 open TMP1, "tmp1.oby" or die("* Can't open tmp1.oby\n"); |
1435 open TMP1, "$temp1OBYFile" or die("* Can't open $temp1OBYFile\n"); |
1366 while ($line=<TMP1>) |
1436 while ($line=<TMP1>) |
1367 { |
1437 { |
1368 track_source($line); |
1438 track_source($line); |
1439 $line =~ s-\\-\/-g; |
|
1440 |
|
1441 my $tempstring = $epocroot."epoc32"; |
|
1442 if(($line !~ /^\s*\#/) && ($line =~ /\/epoc32/i) |
|
1443 && ($line !~ /EPOCROOT##\/?epoc32/i) && ($line !~ /$tempstring/i)) |
|
1444 { |
|
1445 print "add EPOCROOT for line: $line\n" if ($opt_v); |
|
1446 $line =~ s-\/epoc32-EPOCROOT##epoc32-ig; |
|
1447 } |
|
1448 |
|
1369 # |
1449 # |
1370 # Recognise keywords in lines that we process before substitution |
1450 # Recognise keywords in lines that we process before substitution |
1371 # |
1451 # |
1372 # # lineno "file" flagno |
1452 # # lineno "file" flagno |
1373 # DEFINE name replacement-with-0-spaces |
1453 # DEFINE name replacement-with-0-spaces |
1690 push @obydata, $line; |
1770 push @obydata, $line; |
1691 } |
1771 } |
1692 |
1772 |
1693 close TMP1; |
1773 close TMP1; |
1694 exit(1) if ($errors); |
1774 exit(1) if ($errors); |
1695 |
|
1696 dump_obydata("tmp2.oby", "result of substitution phase") if ($opt_v); |
1775 dump_obydata("tmp2.oby", "result of substitution phase") if ($opt_v); |
1697 } |
1776 } |
1698 |
1777 |
1699 sub check_romimage |
1778 sub check_romimage |
1700 { |
1779 { |
1723 } |
1802 } |
1724 |
1803 |
1725 sub dump_obydata |
1804 sub dump_obydata |
1726 { |
1805 { |
1727 my ($dumpfile, $comment) = @_; |
1806 my ($dumpfile, $comment) = @_; |
1807 $dumpfile = $thisdir.$dumpfile; |
|
1728 unlink($dumpfile); |
1808 unlink($dumpfile); |
1729 open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n"); |
1809 open DUMPFILE, ">$dumpfile" or die("* Can't create $dumpfile\n"); |
1730 print "* Writing $dumpfile - $comment\n"; |
1810 print "* Writing $dumpfile - $comment\n"; |
1731 my $line; |
1811 my $line; |
1732 foreach $line (@obydata) |
1812 foreach $line (@obydata) |
1741 my ($line) = @_; |
1821 my ($line) = @_; |
1742 if ($line=~/^# (\d+) "(.*)"/) |
1822 if ($line=~/^# (\d+) "(.*)"/) |
1743 { |
1823 { |
1744 $sourceline=$1-1; |
1824 $sourceline=$1-1; |
1745 $sourcefile=$2; |
1825 $sourcefile=$2; |
1746 $sourcefile=~ s/\//\\/g; |
|
1747 $sourcefile=~ s/\\\\/\\/g; |
1826 $sourcefile=~ s/\\\\/\\/g; |
1827 $sourcefile=~ s/\\/\//g; |
|
1748 return; |
1828 return; |
1749 } |
1829 } |
1750 $sourceline++; |
1830 $sourceline++; |
1751 } |
1831 } |
1752 |
1832 |
2065 print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v); |
2145 print ("Warning: SPI creation/placement flag not enabled. Ignoring SPI_POSITION\n" ) if ($opt_v); |
2066 } |
2146 } |
2067 } |
2147 } |
2068 # a partition is specified |
2148 # a partition is specified |
2069 # push this line into the currently selected partition |
2149 # push this line into the currently selected partition |
2070 my $partition=@currentpartition[-1]; |
2150 my $partition=$currentpartition[-1]; |
2071 push @$partition, $modifiedLine; |
2151 push @$partition, $modifiedLine; |
2072 $line="REM handled $line"; |
2152 $line="REM handled $line"; |
2073 } |
2153 } |
2074 elsif ($line =~ /^\s*SPI_POSITION/i) |
2154 elsif ($line =~ /^\s*SPI_POSITION/i) |
2075 { |
2155 { |
2216 $errors++ if ($strict); |
2296 $errors++ if ($strict); |
2217 } |
2297 } |
2218 |
2298 |
2219 if ($spidatahide) |
2299 if ($spidatahide) |
2220 { |
2300 { |
2221 push @newobydata, "hide=$fileRomDir\\$pluginFileName\n"; |
2301 push @newobydata, "hide=$fileRomDir\/$pluginFileName\n"; |
2222 } |
2302 } |
2223 else |
2303 else |
2224 { |
2304 { |
2225 push @newobydata, "file=$emulatorDir\\$pluginFileName $fileRomDir\\$pluginFileName $paged_data\n"; |
2305 push @newobydata, "file=$emulatorDir\/$pluginFileName $fileRomDir\/$pluginFileName $paged_data\n"; |
2226 } |
2306 } |
2227 |
2307 |
2228 if($createspi) { |
2308 if($createspi) { |
2229 if ($spidatahide) |
2309 if ($spidatahide) |
2230 { |
2310 { |
2231 push @newobydata, "spidatahide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n"; |
2311 push @newobydata, "spidatahide=MULTI_LINGUIFY(RSC $dataz_\/$resourceDir\/$pluginResourceName $resourceDir\/$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n"; |
2232 } |
2312 } |
2233 else |
2313 else |
2234 { |
2314 { |
2235 push @newobydata, "spidata=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n"; |
2315 push @newobydata, "spidata=MULTI_LINGUIFY(RSC $dataz_\/$resourceDir\/$pluginResourceName $resourceDir\/$pluginResourceName) " . lc($plugintype) . "\.spi " . $plugintypes{$plugintype} . "\n"; |
2236 } |
2316 } |
2237 } else { |
2317 } else { |
2238 if ($spidatahide) |
2318 if ($spidatahide) |
2239 { |
2319 { |
2240 push @newobydata, "hide=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n"; |
2320 push @newobydata, "hide=MULTI_LINGUIFY(RSC $dataz_\/$resourceDir\/$pluginResourceName $resourceDir\/$pluginResourceName)\n"; |
2241 } |
2321 } |
2242 else |
2322 else |
2243 { |
2323 { |
2244 push @newobydata, "data=MULTI_LINGUIFY(RSC $dataz_\\$resourceDir\\$pluginResourceName $resourceDir\\$pluginResourceName)\n"; |
2324 push @newobydata, "data=MULTI_LINGUIFY(RSC $dataz_\/$resourceDir\/$pluginResourceName $resourceDir\/$pluginResourceName)\n"; |
2245 } |
2325 } |
2246 } |
2326 } |
2247 return 1; #successful match |
2327 return 1; #successful match |
2248 } |
2328 } |
2249 } |
2329 } |
2273 # ignore REM statements, to avoid processing "REM data=xxx yyy" |
2353 # ignore REM statements, to avoid processing "REM data=xxx yyy" |
2274 } |
2354 } |
2275 elsif ($line=~/^(.*?)\bMULTI_LINGUIFY\s*\(\s*(\S+)\s+(\S+)\s+(\S+)\s*\)(.*)$/i) |
2355 elsif ($line=~/^(.*?)\bMULTI_LINGUIFY\s*\(\s*(\S+)\s+(\S+)\s+(\S+)\s*\)(.*)$/i) |
2276 { |
2356 { |
2277 my $initialStuff=$1; |
2357 my $initialStuff=$1; |
2358 $initialStuff = lc ($initialStuff);# if ($enableLowercaseTransfer); |
|
2278 my $defaultFileNameExtension=$2; |
2359 my $defaultFileNameExtension=$2; |
2360 $defaultFileNameExtension = lc ($defaultFileNameExtension);# if ($enableLowercaseTransfer); |
|
2279 my $sourceFileNameWithoutExtension=$3; |
2361 my $sourceFileNameWithoutExtension=$3; |
2362 $sourceFileNameWithoutExtension = ($sourceFileNameWithoutExtension);# if ($enableLowercaseTransfer); |
|
2280 my $targetFileNameWithoutExtension=$4; |
2363 my $targetFileNameWithoutExtension=$4; |
2281 my $finalStuff=$5; |
2364 my $finalStuff=$5; |
2282 my $spidataflag = 0; |
2365 my $spidataflag = 0; |
2283 my $spidatahide = 0; |
2366 my $spidatahide = 0; |
2284 my $datahide = 0; |
2367 my $datahide = 0; |
2309 # ecom.spi should contain the .RSC files |
2392 # ecom.spi should contain the .RSC files |
2310 if ($spidataflag) |
2393 if ($spidataflag) |
2311 { |
2394 { |
2312 my $sourceFileNameExtension = $defaultFileNameExtension; |
2395 my $sourceFileNameExtension = $defaultFileNameExtension; |
2313 my $targetFileNameExtension = $defaultFileNameExtension; |
2396 my $targetFileNameExtension = $defaultFileNameExtension; |
2314 if (-e "$sourceFileNameWithoutExtension.$sourceFileNameExtension") |
2397 if (-e ("$sourceFileNameWithoutExtension.$sourceFileNameExtension")) |
2315 { |
2398 { |
2316 if ($spidatahide) |
2399 if ($spidatahide) |
2317 { |
2400 { |
2318 push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$finalStuff\n"; |
2401 push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension$finalStuff\n"; |
2319 } |
2402 } |
2325 } |
2408 } |
2326 my $useDefaultFileNameExtension=1; |
2409 my $useDefaultFileNameExtension=1; |
2327 foreach my $languageCode (keys %languageCodes) { |
2410 foreach my $languageCode (keys %languageCodes) { |
2328 my $sourceFileNameExtension=$defaultFileNameExtension; |
2411 my $sourceFileNameExtension=$defaultFileNameExtension; |
2329 $sourceFileNameExtension=~s/^(.*).{2}$/$1$languageCode/; |
2412 $sourceFileNameExtension=~s/^(.*).{2}$/$1$languageCode/; |
2330 if (! -e "$sourceFileNameWithoutExtension.$sourceFileNameExtension") |
2413 if (! -e ("$sourceFileNameWithoutExtension.$sourceFileNameExtension")) |
2331 { |
2414 { |
2332 if (!$spidataflag) |
2415 if (!$spidataflag) |
2333 { |
2416 { |
2334 next if (!$useDefaultFileNameExtension); |
2417 next if (!$useDefaultFileNameExtension); |
2335 next if (defined $defaultLanguageCode and !($languageCode eq $defaultLanguageCode)); |
2418 next if (defined $defaultLanguageCode and !($languageCode eq $defaultLanguageCode)); |
2375 { |
2458 { |
2376 push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n"; |
2459 push @newobydata, "$initialStuff$sourceFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$sourceFileNameExtension$modifiedfinalStuff\n"; |
2377 if(!($sourceFileNameExtension eq $targetFileNameExtension)) |
2460 if(!($sourceFileNameExtension eq $targetFileNameExtension)) |
2378 { |
2461 { |
2379 push @newobydata, "alias $targetFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension $modifiedfinalStuff\n"; |
2462 push @newobydata, "alias $targetFileNameWithoutExtension.$sourceFileNameExtension $targetFileNameWithoutExtension.$targetFileNameExtension $modifiedfinalStuff\n"; |
2463 $targetFileNameWithoutExtension =~ s-\\-\/-g; |
|
2380 $multiLinguifyAlias{"$targetFileNameWithoutExtension.$sourceFileNameExtension"} = 1; |
2464 $multiLinguifyAlias{"$targetFileNameWithoutExtension.$sourceFileNameExtension"} = 1; |
2381 } |
2465 } |
2382 } |
2466 } |
2383 } |
2467 } |
2384 $line = reassert_sourceline(); |
2468 $line = reassert_sourceline(); |
2453 { |
2537 { |
2454 push @hidedatainspi, $hidedatafiles[$j]{data}; #push name of data file to be hidden onto array if correct romimage and spi type |
2538 push @hidedatainspi, $hidedatafiles[$j]{data}; #push name of data file to be hidden onto array if correct romimage and spi type |
2455 } |
2539 } |
2456 } |
2540 } |
2457 my @spiargs; #arguments passed to createSpi |
2541 my @spiargs; #arguments passed to createSpi |
2458 push @spiargs, ("-t$targetspi", "-d\\$thisdir", "-hide@hidedatainspi"); |
2542 push @spiargs, ("-t$targetspi", "-d$thisdir", "-hide@hidedatainspi"); |
2459 if($existingspi ne "") { push @spiargs, $existingspi; } |
2543 if($existingspi ne "") { push @spiargs, $existingspi; } |
2460 &spitool::createSpi(@spiargs, @dataforspi); # external call to |
2544 &spitool::createSpi(@spiargs, @dataforspi); # external call to |
2461 } |
2545 } |
2462 } |
2546 } |
2463 |
2547 |
2619 next if (!$spipositionflag{$imageIdx});#This spi has already been entered into OBY. |
2703 next if (!$spipositionflag{$imageIdx});#This spi has already been entered into OBY. |
2620 my $spiIdx=0; |
2704 my $spiIdx=0; |
2621 while(defined $spiarray[$imageIdx][$spiIdx]) { |
2705 while(defined $spiarray[$imageIdx][$spiIdx]) { |
2622 if($spiarray[$imageIdx][$spiIdx]{spifile} =~ /(.+)\.(.*)$/) { |
2706 if($spiarray[$imageIdx][$spiIdx]{spifile} =~ /(.+)\.(.*)$/) { |
2623 my $targetspi="$1-$imageIdx-$spiIdx\.$2"; |
2707 my $targetspi="$1-$imageIdx-$spiIdx\.$2"; |
2624 push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$imageIdx][$spiIdx]{spi} . "\"\n"; |
2708 push @newobydata, "data=" . "$thisdir" . $targetspi . " \"" . $spiarray[$imageIdx][$spiIdx]{spi} . "\"\n"; |
2625 } |
2709 } |
2626 $spiIdx++; |
2710 $spiIdx++; |
2627 } |
2711 } |
2628 if($spiIdx == 0){ |
2712 if($spiIdx == 0){ |
2629 # If there is no plugin in this image, the SPI_POSITION statement is ignore. |
2713 # If there is no plugin in this image, the SPI_POSITION statement is ignore. |
2646 $flag=0; |
2730 $flag=0; |
2647 my $k=0; |
2731 my $k=0; |
2648 while(defined $spiarray[0][$k]) { |
2732 while(defined $spiarray[0][$k]) { |
2649 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2733 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2650 my $targetspi="$1-0-$k\.$2"; |
2734 my $targetspi="$1-0-$k\.$2"; |
2651 push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2735 push @newobydata, "data=" . "$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2652 } |
2736 } |
2653 $k++; |
2737 $k++; |
2654 } |
2738 } |
2655 } |
2739 } |
2656 my $j=0; |
2740 my $j=0; |
2657 push @newobydata, "\n" . $line . "\n"; |
2741 push @newobydata, "\n" . $line . "\n"; |
2658 while(defined $spiarray[$romimage][$j]) { #put in SPI files for current ROM_IMAGE |
2742 while(defined $spiarray[$romimage][$j]) { #put in SPI files for current ROM_IMAGE |
2659 if($spiarray[$romimage][$j]{spifile} =~ /(.+)\.(.*)$/) { |
2743 if($spiarray[$romimage][$j]{spifile} =~ /(.+)\.(.*)$/) { |
2660 my $targetspi="$1-$romimage-$j\.$2"; |
2744 my $targetspi="$1-$romimage-$j\.$2"; |
2661 push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[$romimage][$j]{spidir} . $targetspi . "\"\n"; |
2745 push @newobydata, "data=" . "$thisdir" . $targetspi . " \"" . $spiarray[$romimage][$j]{spidir} . $targetspi . "\"\n"; |
2662 } |
2746 } |
2663 $j++; |
2747 $j++; |
2664 } |
2748 } |
2665 } elsif($line =~ /^\s*extensionrom/i) { |
2749 } elsif($line =~ /^\s*extensionrom/i) { |
2666 if($flag) { #put in SPI files |
2750 if($flag) { #put in SPI files |
2667 my $k=0; |
2751 my $k=0; |
2668 while(defined $spiarray[0][$k]) { |
2752 while(defined $spiarray[0][$k]) { |
2669 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2753 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2670 my $targetspi="$1-0-$k\.$2"; |
2754 my $targetspi="$1-0-$k\.$2"; |
2671 push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2755 push @newobydata, "data=" . "$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2672 } |
2756 } |
2673 $k++; |
2757 $k++; |
2674 } |
2758 } |
2675 $flag = 0; |
2759 $flag = 0; |
2676 } |
2760 } |
2683 if($flag) { #put in SPI files for ROM_IMAGE[0] if it is the only ROM_IMAGE |
2767 if($flag) { #put in SPI files for ROM_IMAGE[0] if it is the only ROM_IMAGE |
2684 my $k=0; |
2768 my $k=0; |
2685 while(defined $spiarray[0][$k]) { |
2769 while(defined $spiarray[0][$k]) { |
2686 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2770 if($spiarray[0][$k]{spifile} =~ /(.+)\.(.*)$/) { |
2687 my $targetspi="$1-0-$k\.$2"; |
2771 my $targetspi="$1-0-$k\.$2"; |
2688 push @newobydata, "data=" . "\\$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2772 push @newobydata, "data=" . "$thisdir" . $targetspi . " \"" . $spiarray[0][$k]{spidir} . $targetspi . "\"\n"; |
2689 } |
2773 } |
2690 $k++; |
2774 $k++; |
2691 } |
2775 } |
2692 } |
2776 } |
2693 @obydata=@newobydata; |
2777 @obydata=@newobydata; |
2695 dump_obydata("tmp6.oby", "result of SPI stage") if ($opt_v); |
2779 dump_obydata("tmp6.oby", "result of SPI stage") if ($opt_v); |
2696 } |
2780 } |
2697 |
2781 |
2698 sub load_featuresutil |
2782 sub load_featuresutil |
2699 { |
2783 { |
2700 &Load_ModuleL("featuresutil"); |
2784 &FlexLoad_ModuleL("featuresutil"); |
2701 |
2785 |
2702 # Parse the feature database XML file |
2786 # Parse the feature database XML file |
2703 if(!&featuresutil::parseXMLDatabase($featureXml, $featuremanager, $strict)) |
2787 if(!&featuresutil::parseXMLDatabase($featureXml, $featuremanager, $strict)) |
2704 { |
2788 { |
2705 $featureXml = undef; |
2789 $featureXml = undef; |
2721 } |
2805 } |
2722 # Set the name and Rom Image location of feature file. |
2806 # Set the name and Rom Image location of feature file. |
2723 if ($enforceFeatureManager) |
2807 if ($enforceFeatureManager) |
2724 { |
2808 { |
2725 # features data file location |
2809 # features data file location |
2726 $dir = "private\\10205054\\"; |
2810 $dir = "private\/10205054\/"; |
2727 $featurefilename = "features.dat"; |
2811 $featurefilename = "features.dat"; |
2728 } |
2812 } |
2729 else |
2813 else |
2730 { |
2814 { |
2731 # feature registry configuration file location |
2815 # feature registry configuration file location |
2732 $dir = "private\\102744CA\\"; |
2816 $dir = "private\/102744CA\/"; |
2733 $featurefilename = "featreg.cfg"; |
2817 $featurefilename = "featreg.cfg"; |
2734 } |
2818 } |
2735 if (defined ($featureXml)) |
2819 if (defined ($featureXml)) |
2736 { |
2820 { |
2737 my $featurefilecount=0; |
2821 my $featurefilecount=0; |
2857 for(my $i=0;$i<scalar @featurefilearray;$i++) |
2941 for(my $i=0;$i<scalar @featurefilearray;$i++) |
2858 { |
2942 { |
2859 my $j=0; |
2943 my $j=0; |
2860 while(defined $featurefilearray[$i][$j]) |
2944 while(defined $featurefilearray[$i][$j]) |
2861 { |
2945 { |
2862 my $targetfeaturefile = $featurefilearray[$i][$j]{cfgfile}; |
2946 my $targetfeaturefile = $thisdir.$featurefilearray[$i][$j]{cfgfile}; |
2863 if (!(&featuresutil::createFeatureFile($i,$j,$targetfeaturefile,\@featureslist,$featuremanager))) |
2947 if (!(&featuresutil::createFeatureFile($i,$j,$targetfeaturefile,\@featureslist,$featuremanager))) |
2864 { |
2948 { |
2865 $featurefilearray[$i][$j]{cfgfile}= undef; |
2949 $featurefilearray[$i][$j]{cfgfile}= undef; |
2866 exit(1) if($strict); |
2950 exit(1) if($strict); |
2867 } |
2951 } |
2888 while(defined $featurefilearray[0][$k]) |
2972 while(defined $featurefilearray[0][$k]) |
2889 { |
2973 { |
2890 my $targetfeaturefile=$featurefilearray[0][$k]{cfgfile}; |
2974 my $targetfeaturefile=$featurefilearray[0][$k]{cfgfile}; |
2891 if (defined $targetfeaturefile) |
2975 if (defined $targetfeaturefile) |
2892 { |
2976 { |
2893 push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n"; |
2977 push @newobydata, "data=" . "$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n"; |
2894 } |
2978 } |
2895 $k++; |
2979 $k++; |
2896 } |
2980 } |
2897 } |
2981 } |
2898 push @newobydata, "\n" . $line . "\n"; |
2982 push @newobydata, "\n" . $line . "\n"; |
2911 # list with mangled names. Hence, mangled name for feature files should not be put in ROM_IMAGE. |
2995 # list with mangled names. Hence, mangled name for feature files should not be put in ROM_IMAGE. |
2912 my $exattribute = "exattrib=U"; |
2996 my $exattribute = "exattrib=U"; |
2913 |
2997 |
2914 if (defined $targetfeaturefile) |
2998 if (defined $targetfeaturefile) |
2915 { |
2999 { |
2916 push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[$romimage][$j]{cfgdir} . $destinationfeaturefile . "\"\t\t" . $exattribute . "\n"; |
3000 push @newobydata, "data=" . "$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[$romimage][$j]{cfgdir} . $destinationfeaturefile . "\"\t\t" . $exattribute . "\n"; |
2917 } |
3001 } |
2918 $j++; |
3002 $j++; |
2919 } |
3003 } |
2920 } |
3004 } |
2921 elsif($line !~ /^\s*(FEATURE)\s*/i && $line !~ /^\s*(EXCLUDE_FEATURE)\s*/i) |
3005 elsif($line !~ /^\s*(FEATURE)\s*/i && $line !~ /^\s*(EXCLUDE_FEATURE)\s*/i) |
2932 while(defined $featurefilearray[0][$k]) |
3016 while(defined $featurefilearray[0][$k]) |
2933 { |
3017 { |
2934 my $targetfeaturefile = $featurefilearray[0][$k]{cfgfile}; |
3018 my $targetfeaturefile = $featurefilearray[0][$k]{cfgfile}; |
2935 if (defined $targetfeaturefile) |
3019 if (defined $targetfeaturefile) |
2936 { |
3020 { |
2937 push @newobydata, "data=" . "\\$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n"; |
3021 push @newobydata, "data=" . "$thisdir" . $targetfeaturefile . " \"" . $featurefilearray[0][$k]{cfgdir} . $targetfeaturefile . "\"\n"; |
2938 } |
3022 } |
2939 $k++; |
3023 $k++; |
2940 } |
3024 } |
2941 } |
3025 } |
2942 @obydata=@newobydata; |
3026 @obydata=@newobydata; |
2974 elsif ($enforceFeatureManager) |
3058 elsif ($enforceFeatureManager) |
2975 { |
3059 { |
2976 print "Error: no feature data file or pre-built feature data file is provided!"; |
3060 print "Error: no feature data file or pre-built feature data file is provided!"; |
2977 exit(1); |
3061 exit(1); |
2978 } |
3062 } |
3063 |
|
3064 checkcase() if ($checkcase); |
|
2979 } |
3065 } |
2980 my ($fromABI,$toABI) = split / /,$abiDowngrade; |
3066 my ($fromABI,$toABI) = split / /,$abiDowngrade; |
2981 |
3067 |
2982 #---------------------------------------------------------------------------------- |
3068 #---------------------------------------------------------------------------------- |
2983 # Problem suppression phase |
3069 # Problem suppression phase |
2989 # correct source binary name using the VMAP file mechanism. |
3075 # correct source binary name using the VMAP file mechanism. |
2990 |
3076 |
2991 sub suppress_phase |
3077 sub suppress_phase |
2992 { |
3078 { |
2993 undef @newobydata; |
3079 undef @newobydata; |
2994 Plat_Init($PerlLibPath); |
3080 |
3081 init_plat($PerlEPOCPath); |
|
2995 |
3082 |
2996 # use the "default" feature variant by default. |
3083 # use the "default" feature variant by default. |
2997 my $varname = $featureVariant{'VALID'} ? $featureVariant{'NAME'} : "default"; |
3084 my $varname = $featureVariant{'VALID'} ? $featureVariant{'NAME'} : "default"; |
2998 |
3085 |
2999 foreach $line (@obydata) |
3086 foreach $line (@obydata) |
3000 { |
3087 { |
3001 track_source($line); |
3088 track_source($line); |
3002 if ($line =~ /^\s*REM/i) |
3089 if ($line =~ /^\s*REM/i || $line =~ /^\s*TIME\s*=\s*/i) |
3003 { |
3090 { |
3004 # ignore REM statements, to avoid processing "REM data=xxx yyy" |
3091 # ignore REM statements, to avoid processing "REM data=xxx yyy" |
3005 } |
3092 } |
3006 # |
3093 # |
3007 # thing=some\file |
3094 # thing=some\file |
3008 # |
3095 # |
3009 elsif ($line =~ /(\S+)\s*=\s*"?(\S+\\\S+)"?/) |
3096 elsif ($line =~ /(\S+)\s*=\s*"?(\S+[\/\\]\S+)"?/) |
3010 { |
3097 { |
3011 my $what = $1; |
3098 my $what = $1; |
3012 my $filename = $2; |
3099 my $filename = $2; |
3013 if ($line =~ /(\S+)\s*=\s*"([^"]+)"/) |
3100 if ($line =~ /(\S+)\s*=\s*"([^"]+)"/) |
3014 { |
3101 { |
3015 $filename = $2; |
3102 $filename = $2; |
3016 } |
3103 } |
3017 my $normedFilename = &Genutl_NormaliseVersionedName($filename); |
3104 my $normedFilename = &get_versionedname($filename); |
3018 |
3105 |
3019 # find all the alternative file locations |
3106 # find all the alternative file locations |
3020 my @alternatives = fallback($normedFilename); |
3107 my @alternatives = fallback($normedFilename); |
3021 # test the original location first |
3108 # test the original location first |
3022 unshift(@alternatives, $normedFilename); |
3109 unshift(@alternatives, $normedFilename); |
3025 my $fileExists = 0; |
3112 my $fileExists = 0; |
3026 foreach my $altFile (@alternatives) |
3113 foreach my $altFile (@alternatives) |
3027 { |
3114 { |
3028 my $tmpPath; |
3115 my $tmpPath; |
3029 my $tmpFile; |
3116 my $tmpFile; |
3030 if($altFile =~ /"?(.*\\arm\w+_?\w+)\\([^"]+)/i) |
3117 if($altFile =~ /"?(.*[\/\\]arm\w+_?\w+)[\/\\]([^"]+)/i) |
3031 { |
3118 { |
3032 $tmpPath = $1; |
3119 $tmpPath = $1; |
3033 $tmpFile = $2; |
3120 $tmpFile = $2; |
3034 } |
3121 } |
3035 $tmpPath .= "\.$varname"; |
3122 $tmpPath .= "\.$varname"; |
3036 if (-d $tmpPath){ |
3123 |
3037 if (-e $tmpPath ."\\$tmpFile"){ |
3124 if (-e $tmpPath ."\/$tmpFile"){ |
3038 $fileExists = $tmpPath . "\\$tmpFile"; |
3125 # SBSv2 variant binary exists |
3039 } |
3126 $fileExists = $tmpPath . "\/$tmpFile"; |
3040 elsif (-e $altFile){ |
|
3041 $fileExists = $altFile; |
|
3042 } |
|
3043 } |
3127 } |
3044 else { |
3128 else { |
3045 $fileExists = featurevariantmap->Find($altFile, $varname); |
3129 # SBSv1 variant binary or invariant binary |
3130 $fileExists = get_BVbinname($altFile, $varname); |
|
3046 } |
3131 } |
3047 last if $fileExists; |
3132 last if $fileExists; |
3048 } |
3133 } |
3049 |
3134 |
3050 # edit the OBY line to use the actual file name which we found. |
3135 # edit the OBY line to use the actual file name which we found. |
3051 # (maybe) warn if an alternative to the original was selected. |
3136 # (maybe) warn if an alternative to the original was selected. |
3052 if ($fileExists) |
3137 if ($fileExists) |
3053 { |
3138 { |
3054 my $from = $filename; |
3139 my $from = $filename; |
3055 $from =~ s/\\/\\\\/g; # need to escape backslashes |
3140 $from =~ s/\\/\\\\/g; |
3141 $from =~ s/\//\\\//g; # need to escape backslashes |
|
3056 $from =~ s/(\[|\])/\\$1/g; # need to escape square brackets for file names like "featreg.cfg[x-y]",etc. |
3142 $from =~ s/(\[|\])/\\$1/g; # need to escape square brackets for file names like "featreg.cfg[x-y]",etc. |
3057 my $into = $fileExists; |
3143 my $into = $fileExists; |
3058 |
3144 |
3059 $line =~ s/$from/$into/; |
3145 $line =~ s/$from/$into/i; |
3060 |
3146 |
3061 if ($warnSelection && ($fileExists ne $normedFilename)) |
3147 if ($warnSelection && ($fileExists ne $normedFilename)) |
3062 { |
3148 { |
3063 print "replaced $filename with $fileExists\n"; |
3149 print "replaced $filename with $fileExists\n"; |
3064 } |
3150 } |
3067 { |
3153 { |
3068 # No suitable alternative was found, so comment out the line unless |
3154 # No suitable alternative was found, so comment out the line unless |
3069 # it is a manatory ROMBUILD keyword, in which case it is better |
3155 # it is a manatory ROMBUILD keyword, in which case it is better |
3070 # to let ROMBUILD report the missing file rather than report the |
3156 # to let ROMBUILD report the missing file rather than report the |
3071 # missing keyword. |
3157 # missing keyword. |
3072 if ($what !~ /^bootbinary|variant|primary|secondary|hide/i) |
3158 if ($what !~ /^bootbinary|variant|primary|secondary|hide|dir/i) |
3073 { |
3159 { |
3074 $line = "REM MISSING " . $line; |
3160 $line = "REM MISSING " . $line; |
3075 print_source_error("Missing file: '$filename' in statement '$what='"); |
3161 print_source_error("Missing file: '$filename' in statement '$what='"); |
3076 print "\ttried @alternatives\n" if ($opt_v && @alternatives > 1); |
3162 print "\ttried @alternatives\n" if ($opt_v && @alternatives > 1); |
3077 # treat as an error if the strict option is selected. |
3163 # treat as an error if the strict option is selected. |
3091 |
3177 |
3092 if($aSrcfile =~ /"?([^"]+)/){ |
3178 if($aSrcfile =~ /"?([^"]+)/){ |
3093 $aSrcfile = $1; |
3179 $aSrcfile = $1; |
3094 } |
3180 } |
3095 |
3181 |
3096 $aSrcfile = &Genutl_NormaliseVersionedName($aSrcfile); |
3182 $aSrcfile = &get_versionedname($aSrcfile); |
3097 if($dstFile =~ /"?(.*)\\([^"]+)/) |
3183 if($dstFile =~ /"?(.*)[\/\\]([^"]+)/) |
3098 { |
3184 { |
3099 $dstPath = $1; |
3185 $dstPath = $1; |
3100 $dstFile = $2; |
3186 $dstFile = $2; |
3101 } |
3187 } |
3102 my $dllMapKey = lc ($dstFile); |
3188 my $dllMapKey = lc ($dstFile); |
3108 } |
3194 } |
3109 |
3195 |
3110 } |
3196 } |
3111 push @newobydata, $line; |
3197 push @newobydata, $line; |
3112 } |
3198 } |
3199 |
|
3113 @obydata = @newobydata; |
3200 @obydata = @newobydata; |
3114 dump_obydata("tmp7.oby", "result of problem-suppression phase") if ($opt_v); |
3201 dump_obydata("tmp7.oby", "result of problem-suppression phase") if ($opt_v); |
3115 die "ERROR: $errors missing file(s) detected\n" if ($strict && $errors ); |
3202 die "ERROR: $errors missing file(s) detected\n" if ($strict && $errors ); |
3116 } |
3203 } |
3117 |
3204 |
3134 |
3221 |
3135 # If BINARY_SELECTION_ORDER macro is specified in the oby file |
3222 # If BINARY_SELECTION_ORDER macro is specified in the oby file |
3136 if ($binarySelectionOrderFlag) |
3223 if ($binarySelectionOrderFlag) |
3137 { |
3224 { |
3138 # Search in the specified binary order |
3225 # Search in the specified binary order |
3139 if(!defined(@Global_PlatList)) |
3226 if(scalar(@Global_PlatList) == 0) |
3140 { |
3227 { |
3141 @Global_PlatList = Plat_List(); |
3228 @Global_PlatList = get_platlist(); |
3142 } |
3229 } |
3143 my $b; |
3230 my $b; |
3144 my $e; |
3231 my $e; |
3145 foreach my $plat (@Global_PlatList) |
3232 foreach my $plat (@Global_PlatList) |
3146 { |
3233 { |
3147 if ($file =~ /^(.*)\\$plat\\(.*)$/i) |
3234 if ($file =~ /^(.*)[\/\\]$plat[\/\\](.*)$/i) |
3148 { |
3235 { |
3149 $b = $1; |
3236 $b = $1; |
3150 $e = $2; |
3237 $e = $2; |
3151 last; |
3238 last; |
3152 } |
3239 } |
3153 } |
3240 } |
3154 push(@alternatives, "$b\\$firstDIR\\$e"); |
3241 push(@alternatives, "$b\/$firstDIR\/$e"); |
3155 |
3242 |
3156 foreach my $toDIR (@binarySelectionOrder) |
3243 foreach my $toDIR (@binarySelectionOrder) |
3157 { |
3244 { |
3158 push(@alternatives, "$b\\$toDIR\\$e"); |
3245 push(@alternatives, "$b\/$toDIR\/$e"); |
3159 } |
3246 } |
3160 } |
3247 } |
3161 |
3248 |
3162 # If the file is not found in the specified ABIV2 platform, then select from ARMV5 directory. |
3249 # If the file is not found in the specified ABIV2 platform, then select from armv5 directory. |
3163 # This is necessary as some of the runtime DLLs will be present only in ARMV5 directory. |
3250 # This is necessary as some of the runtime DLLs will be present only in armv5 directory. |
3164 # Add the BPABI Platforms to be added |
3251 # Add the BPABI Platforms to be added |
3165 if(!defined(@Global_BPABIPlats)) |
3252 if(scalar(@Global_BPABIPlats) == 0) |
3166 { |
3253 { |
3167 @Global_BPABIPlats = &BPABIutl_Plat_List; |
3254 @Global_BPABIPlats = &get_bpabiplatlist; |
3168 } |
3255 } |
3169 |
3256 |
3170 foreach my $BpabiPlat (@Global_BPABIPlats) |
3257 foreach my $BpabiPlat (@Global_BPABIPlats) |
3171 { |
3258 { |
3172 if ($fromABI eq "" && $file =~ /^(.*)\\$BpabiPlat\\(.*)$/) |
3259 if ($fromABI eq "" && $file =~ /^(.*)[\/\\]$BpabiPlat[\/\\](.*)$/i) |
3173 { |
3260 { |
3174 push(@alternatives, "$1\\armv5\\$2"); |
3261 push(@alternatives, "$1\/armv5\/$2"); |
3175 } |
3262 } |
3176 } |
3263 } |
3177 |
3264 |
3178 if ($customizedPlat && $fromABI eq "" && $file =~ /^(.*)\\$customizedPlat\\(.*)$/) |
3265 if ($customizedPlat && $fromABI eq "" && $file =~ /^(.*)[\/\\]$customizedPlat[\/\\](.*)$/i) |
3179 { |
3266 { |
3180 my $b = $1; |
3267 my $b = $1; |
3181 my $e = $2; |
3268 my $e = $2; |
3182 # if platform customization |
3269 # if platform customization |
3183 my $rootPlat = Plat_Root($customizedPlat); |
3270 my $rootPlat = get_platroot($customizedPlat); |
3184 |
3271 |
3185 #Check in ARMV7 folder for binaries in case GCCEV7 is used [DEF128457 ] |
3272 #Check in ARMV7 folder for binaries in case GCCEV7 is used [DEF128457 ] |
3186 if($customizedPlat == "GCCEV7") |
3273 if($customizedPlat == "GCCEV7") |
3187 { |
3274 { |
3188 push(@alternatives,"$b\\armv7\\$e"); |
3275 push(@alternatives,"$b\/armv7\/$e"); |
3189 } |
3276 } |
3190 |
3277 |
3191 if( grep /$rootPlat/, @Global_BPABIPlats) |
3278 if( grep /$rootPlat/, @Global_BPABIPlats) |
3192 { |
3279 { |
3193 push(@alternatives, "$b\\armv5\\$e"); |
3280 push(@alternatives, "$b\/armv5\/$e"); |
3194 } |
3281 } |
3195 } |
3282 } |
3196 |
3283 |
3197 if ($fromABI eq "" && $file =~ /^(.*)\\ARMV5_ABIV1\\(.*)$/i) |
3284 if ($fromABI eq "" && $file =~ /^(.*)[\/\\]armv5_abiv1[\/\\](.*)$/i) |
3198 { |
3285 { |
3199 push(@alternatives, "$1\\armv5\\$2"); |
3286 push(@alternatives, "$1\/armv5\/$2"); |
3200 } |
3287 } |
3201 |
3288 |
3202 if ($fromABI ne "" && $file =~ /^(.*)\\$fromABI\\(.*)$/) |
3289 if ($fromABI ne "" && $file =~ /^(.*)[\/\\]$fromABI[\/\\](.*)$/) |
3203 { |
3290 { |
3204 push(@alternatives, "$1\\$toABI\\$2"); |
3291 push(@alternatives, "$1\/$toABI\/$2"); |
3205 } |
3292 } |
3206 |
3293 |
3207 return @alternatives; |
3294 return @alternatives; |
3208 } |
3295 } |
3209 |
3296 |
3213 { |
3300 { |
3214 my $file = shift; |
3301 my $file = shift; |
3215 my @alternatives; |
3302 my @alternatives; |
3216 $customizedPlat = undef; # global (used in feedback) |
3303 $customizedPlat = undef; # global (used in feedback) |
3217 |
3304 |
3218 if(!defined(@Global_PlatList)) |
3305 if(scalar(@Global_PlatList) == 0) |
3219 { |
3306 { |
3220 @Global_PlatList = Plat_List(); |
3307 @Global_PlatList = get_platlist(); |
3221 } |
3308 } |
3222 foreach my $plat (@Global_PlatList) |
3309 foreach my $plat (@Global_PlatList) |
3223 { |
3310 { |
3224 if ($file =~ /^(.*)\\$plat\\(.*)$/i) |
3311 if ($file =~ /^(.*)[\/\\]$plat[\/\\](.*)$/i) |
3225 { |
3312 { |
3226 my $b = $1; |
3313 my $b = $1; |
3227 my $e = $2; |
3314 my $e = $2; |
3228 my $root = Plat_Customizes($plat); |
3315 my $root = get_platcustomizes($plat); |
3229 if ($root) |
3316 if ($root) |
3230 { |
3317 { |
3231 # Preserve the plat that is customized |
3318 # Preserve the plat that is customized |
3232 $customizedPlat = $plat; |
3319 $customizedPlat = $plat; |
3233 |
3320 |
3234 # If a BSF platform customizes another BSF platform (i.e. a |
3321 # If a BSF platform customizes another BSF platform (i.e. a |
3235 # BSF hierarchy exists), look for the file starting from the |
3322 # BSF hierarchy exists), look for the file starting from the |
3236 # child BSF platform and working back to the root BSF platform |
3323 # child BSF platform and working back to the root BSF platform |
3237 while ($root) |
3324 while ($root) |
3238 { |
3325 { |
3239 push(@alternatives, "$b\\$root\\$e"); |
3326 push(@alternatives, "$b\/$root\/$e"); |
3240 |
3327 |
3241 # Temporary special case for ARMV5_ABIV1 and ARMV5_ABIV2 |
3328 # Temporary special case for armv5_abiv1 and armv5_abiv2 |
3242 if ($root =~ /^armv5_abiv[12]$/i) |
3329 if ($root =~ /^armv5_abiv[12]$/i) |
3243 { |
3330 { |
3244 push(@alternatives, "$b\\armv5\\$e"); |
3331 push(@alternatives, "$b\/armv5\/$e"); |
3245 } |
3332 } |
3246 |
3333 |
3247 $root = Plat_Customizes($root); |
3334 $root = get_platcustomizes($root); |
3248 } |
3335 } |
3249 } |
3336 } |
3250 return @alternatives; |
3337 return @alternatives; |
3251 } |
3338 } |
3252 } |
3339 } |
3309 # bitmap=source dest |
3396 # bitmap=source dest |
3310 # |
3397 # |
3311 if ($line =~ /^\s*bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i) |
3398 if ($line =~ /^\s*bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i) |
3312 { |
3399 { |
3313 my $mbm = $1; |
3400 my $mbm = $1; |
3314 my $dest = $2; |
3401 my $dest = $2; |
3315 my $rom_mbm = "$1_rom"; |
3402 my $rom_mbm = "$1_rom"; |
3316 if ($is_xip eq 0) |
3403 if ($is_xip eq 0) |
3317 { |
3404 { |
3318 # non-XIP rom - just include the mbm file |
3405 # non-XIP rom - just include the mbm file |
3319 $line = "data=\"$mbm\"\t\"$dest\"\n"; |
3406 $line = "data=\"$mbm\"\t\"$dest\"\n"; |
3320 } |
3407 } |
3321 else |
3408 else |
3322 { |
3409 { |
3323 if (! -e $rom_mbm || -M $rom_mbm >= -M $mbm) |
3410 if (! -e $rom_mbm || -M $rom_mbm >= -M $mbm) |
3324 { |
3411 { |
3325 system "bmconv /q /r $rom_mbm /m$mbm"; |
3412 is_existinpath("bmconv", romutl::DIE_NOT_FOUND); |
3326 my $bmconv_status = $?; |
3413 |
3414 my $rom_mbm_tmp = $rom_mbm; |
|
3415 my $mbm_tmp = $mbm; |
|
3416 if ($^O =~ /^MSWIN32$/i){ |
|
3417 $mbm_tmp =~ s-\/-\\-g; |
|
3418 $rom_mbm_tmp =~ s-\/-\\-g; |
|
3419 } |
|
3420 |
|
3421 system "bmconv -q -r $rom_mbm_tmp -m$mbm_tmp"; |
|
3422 my $bmconv_status = $?; |
|
3327 die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $rom_mbm); |
3423 die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $rom_mbm); |
3328 } |
3424 } |
3329 $line = "data=\"$rom_mbm\"\t\"$dest\"\n"; |
3425 $line = "data=\"$rom_mbm\"\t\"$dest\"\n"; |
3330 push @tempfiles, $rom_mbm; |
3426 push @tempfiles, $rom_mbm; |
3331 } |
3427 } |
3335 # |
3431 # |
3336 # if file is a compressed ROM image file |
3432 # if file is a compressed ROM image file |
3337 elsif ($line =~ /^\s*compressed-bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i) |
3433 elsif ($line =~ /^\s*compressed-bitmap=\s*"?(\S+)"?\s+"?(\S+)"?/i) |
3338 { |
3434 { |
3339 my $mbm = $1; |
3435 my $mbm = $1; |
3340 my $dest = $2; |
3436 my $dest = $2; |
3341 my $cmprssd_rom_mbm = "$1_rom"; |
3437 my $cmprssd_rom_mbm = "$1_rom"; |
3342 if ($is_xip eq 0) |
3438 if ($is_xip eq 0) |
3343 { |
3439 { |
3344 # non-XIP rom - just include the mbm file |
3440 # non-XIP rom - just include the mbm file |
3345 $line = "data=\"$mbm\"\t\"$dest\"\n"; |
3441 $line = "data=\"$mbm\"\t\"$dest\"\n"; |
3346 } |
3442 } |
3347 else |
3443 else |
3348 { |
3444 { |
3349 if (! -e $cmprssd_rom_mbm || -M $cmprssd_rom_mbm >= -M $mbm) |
3445 if (! -e $cmprssd_rom_mbm || -M $cmprssd_rom_mbm >= -M $mbm) |
3350 { |
3446 { |
3351 system "bmconv /q /s $cmprssd_rom_mbm /m$mbm"; |
3447 is_existinpath("bmconv", romutl::DIE_NOT_FOUND); |
3448 |
|
3449 my $cmprssd_rom_mbm_tmp = $cmprssd_rom_mbm; |
|
3450 my $mbm_tmp = $mbm; |
|
3451 if ($^O =~ /^MSWIN32$/i){ |
|
3452 $mbm_tmp =~ s-\/-\\-g; |
|
3453 $cmprssd_rom_mbm_tmp =~ s-\/-\\-g; |
|
3454 } |
|
3455 |
|
3456 system "bmconv -q -s $cmprssd_rom_mbm_tmp -m$mbm_tmp"; |
|
3352 my $bmconv_status = $?; |
3457 my $bmconv_status = $?; |
3353 die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $cmprssd_rom_mbm); |
3458 die "* bmconv failed\n" if ($bmconv_status != 0 || !-f $cmprssd_rom_mbm); |
3354 } |
3459 } |
3355 $line = "data=\"$cmprssd_rom_mbm\"\t\"$dest\"\n"; |
3460 $line = "data=\"$cmprssd_rom_mbm\"\t\"$dest\"\n"; |
3356 push @tempfiles, $cmprssd_rom_mbm; |
3461 push @tempfiles, $cmprssd_rom_mbm; |
3377 # data=\epoc32\wins\C\System\Alarms\churchbell.snd "System\Alarms\Church bell" |
3482 # data=\epoc32\wins\C\System\Alarms\churchbell.snd "System\Alarms\Church bell" |
3378 # file[0x07060001]=\epoc32\release\MAWD\urel\cAkyb1.dll System\Libs\EKeyb.dll |
3483 # file[0x07060001]=\epoc32\release\MAWD\urel\cAkyb1.dll System\Libs\EKeyb.dll |
3379 # file=\epoc32\release\marm\urel\eikcore.dll System\Libs\Eikcore.dll |
3484 # file=\epoc32\release\marm\urel\eikcore.dll System\Libs\Eikcore.dll |
3380 # alias \System\Bin\DRTRVCT2_2.dll \System\Bin\DRTRVCT2_1.dll |
3485 # alias \System\Bin\DRTRVCT2_2.dll \System\Bin\DRTRVCT2_1.dll |
3381 # |
3486 # |
3487 $line =~ s-\\-\/-g; |
|
3382 if ($line =~ /^\s*TIME\s*=\s*/i) |
3488 if ($line =~ /^\s*TIME\s*=\s*/i) |
3383 { |
3489 { |
3384 return $line; |
3490 return $line; |
3385 } |
3491 } |
3386 elsif($line =~ /^\s*volume\s*=.*/i) |
3492 elsif($line =~ /^\s*volume\s*=.*/i) |
3389 } |
3495 } |
3390 elsif($line =~ /^\s*kerneltrace\s*=.*/i) |
3496 elsif($line =~ /^\s*kerneltrace\s*=.*/i) |
3391 { |
3497 { |
3392 return $line; |
3498 return $line; |
3393 } |
3499 } |
3394 if ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+"\\?(.*)"(.*)$/) |
3500 elsif($line =~ /^\s*dir\s*=.*/i) |
3501 { |
|
3502 return $line; |
|
3503 } |
|
3504 elsif($line =~ /^\s*bootbinary\s*=(.*)/i) |
|
3505 { |
|
3506 } |
|
3507 if ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+"\/?(.*)"(.*)$/) |
|
3395 { |
3508 { |
3396 $type = $1; |
3509 $type = $1; |
3397 $variant = ""; |
3510 $variant = ""; |
3398 $pcfile = $2; |
3511 $pcfile = $2; |
3399 $romfile = $3; |
3512 $romfile = $3; |
3400 $tail = $4; |
3513 $tail = $4; |
3401 } |
3514 } |
3402 elsif ($line =~ /^\s*(\S+)(\[\S+\])\s*=\s*(\S+)\s+\\?(\S+)(.*)$/) |
3515 elsif ($line =~ /^\s*(\S+)(\[\S+\])\s*=\s*(\S+)\s+\/?(\S+)(.*)$/) |
3403 { |
3516 { |
3404 $type = $1; |
3517 $type = $1; |
3405 $variant = $2; |
3518 $variant = $2; |
3406 $pcfile = $3; |
3519 $pcfile = $3; |
3407 $romfile = $4; |
3520 $romfile = $4; |
3408 $tail = $5; |
3521 $tail = $5; |
3409 } |
3522 } |
3410 elsif ($line =~ /(\S+)\s*=\s*"([^"]+)"\s+"\\?(.*)"(.*)$/) |
3523 elsif ($line =~ /(\S+)\s*=\s*"([^"]+)"\s+"\/?(.*)"(.*)$/ |
3524 || $line =~ /(\S+)\s*=\s*"([^"]+)"\s+\/?(\S+)(.*)$/) |
|
3411 { |
3525 { |
3412 if ($line !~ /^REM MISSING/i) |
3526 if ($line !~ /^REM MISSING/i) |
3413 { |
3527 { |
3414 $type = $1; |
3528 $type = $1; |
3415 $variant = ""; |
3529 $variant = ""; |
3419 } |
3533 } |
3420 else{ |
3534 else{ |
3421 return $line; |
3535 return $line; |
3422 } |
3536 } |
3423 } |
3537 } |
3424 elsif ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+\\?(\S+)(.*)$/) |
3538 elsif ($line =~ /^\s*(\S+)\s*=\s*(\S+)\s+\/?(\S+)(.*)$/) |
3425 { |
3539 { |
3426 $type = $1; |
3540 $type = $1; |
3427 $variant = ""; |
3541 $variant = ""; |
3428 $pcfile = $2; |
3542 $pcfile = $2; |
3429 $romfile = $3; |
3543 $romfile = $3; |
3449 if ($enforceSysBin) |
3563 if ($enforceSysBin) |
3450 { |
3564 { |
3451 if ($DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\\bin/i |
3565 if ($DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\\bin/i |
3452 && $DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\/bin/i) |
3566 && $DllDataMap{$patchdlldatamap_key}->{dstpath} !~ /^sys\/bin/i) |
3453 { |
3567 { |
3454 $DllDataMap{$patchdlldatamap_key}->{dstpath} = "sys\\bin"; |
3568 $DllDataMap{$patchdlldatamap_key}->{dstpath} = "sys\/bin"; |
3455 } |
3569 } |
3456 } |
3570 } |
3457 |
3571 |
3458 my $dllfile = $DllDataMap{$patchdlldatamap_key}->{dstpath} . "\\". $romfilename; |
3572 my $dllfile = $DllDataMap{$patchdlldatamap_key}->{dstpath} . "\/". $romfilename; |
3459 |
3573 |
3460 $line = "$1 "; |
3574 $line = "$1 "; |
3461 $line .= "$dllfile "; |
3575 $line .= "$dllfile "; |
3462 |
3576 |
3463 # Convert value into decimal (used to be done in AddDllDataInfo, but that limited us to |
3577 # Convert value into decimal (used to be done in AddDllDataInfo, but that limited us to |
3554 |
3668 |
3555 $line .= "$scalarSize $value\n"; |
3669 $line .= "$scalarSize $value\n"; |
3556 |
3670 |
3557 return $line; |
3671 return $line; |
3558 } |
3672 } |
3559 elsif ($line =~ /^\s*(\S+)\s*(\S+)\s+\\?(\S+)(.*)$/) |
3673 elsif ($line =~ /^\s*(\S+)\s*(\S+)\s+\/?(\S+)(.*)$/) |
3560 { |
3674 { |
3561 $type = $1; |
3675 $type = $1; |
3562 $variant = ""; |
3676 $variant = ""; |
3563 $pcfile = $2; |
3677 $pcfile = $2; |
3564 $romfile = $3; |
3678 $romfile = $3; |
3586 # Buildrom should generate warning when destination path provided for a file |
3700 # Buildrom should generate warning when destination path provided for a file |
3587 # is not a standard path(as per platsec) and "PlatSecEnforceSysBin" is turned off. |
3701 # is not a standard path(as per platsec) and "PlatSecEnforceSysBin" is turned off. |
3588 my $warnFlag = 1; |
3702 my $warnFlag = 1; |
3589 my $mustBeSysBin = $enforceSysBin; |
3703 my $mustBeSysBin = $enforceSysBin; |
3590 if ($type =~ /^(data|compress|nocompress)$/i |
3704 if ($type =~ /^(data|compress|nocompress)$/i |
3591 && $romfile !~ /^system\\(bin|libs|programs)\\/i) |
3705 && $romfile !~ /^system\/(bin|libs|programs)\//i) |
3592 { |
3706 { |
3593 $mustBeSysBin = 0; |
3707 $mustBeSysBin = 0; |
3594 $warnFlag = 0; |
3708 $warnFlag = 0; |
3595 } |
3709 } |
3596 |
3710 |
3603 # for multilinguify 'alias'es (generally resource files) 'MustBeSysBin' should not be enforced. |
3717 # for multilinguify 'alias'es (generally resource files) 'MustBeSysBin' should not be enforced. |
3604 if(defined($multiLinguifyAlias{$pcfile})) { |
3718 if(defined($multiLinguifyAlias{$pcfile})) { |
3605 return $line; |
3719 return $line; |
3606 } |
3720 } |
3607 |
3721 |
3608 my $filename = "\\$romfile"; # in case no path is specified |
3722 my $filename = "\/$romfile"; # in case no path is specified |
3609 $filename = substr $filename, rindex($filename, "\\"); |
3723 $filename = substr $filename, rindex($filename, "\/"); |
3610 $romfile = "sys\\bin".$filename; |
3724 $romfile = "sys\/bin".$filename; |
3611 |
3725 |
3612 if ($pcfile !~ /^sys\\bin\\/i |
3726 if ($pcfile !~ /^sys\\bin\\/i |
3613 && $pcfile !~ /^sys\/bin/i) |
3727 && $pcfile !~ /^sys\/bin/i) |
3614 { |
3728 { |
3615 my $pcfilename = "\\$pcfile"; # in case no path is specified |
3729 my $pcfilename = "\/$pcfile"; # in case no path is specified |
3616 $pcfilename = substr $pcfilename, rindex($pcfilename, "\\"); |
3730 $pcfilename = substr $pcfilename, rindex($pcfilename, "\/"); |
3617 $pcfile = "sys\\bin".$pcfilename; |
3731 $pcfile = "sys\/bin".$pcfilename; |
3618 } |
3732 } |
3619 return "$type$variant $pcfile \t$romfile$tail\n"; |
3733 return "$type$variant $pcfile \t$romfile$tail\n"; |
3620 } |
3734 } |
3621 |
3735 |
3622 if ($romfile !~ /^sys\\bin\\/i |
3736 if ($romfile !~ /^sys\\bin\\/i |
3623 && $romfile !~ /^sys\/bin/i) |
3737 && $romfile !~ /^sys\/bin/i) |
3624 { |
3738 { |
3625 my $filename = "\\$romfile"; # in case no path is specified |
3739 my $filename = "\/$romfile"; # in case no path is specified |
3626 $filename = substr $filename, rindex($filename, "\\"); |
3740 $filename = substr $filename, rindex($filename, "\/"); |
3627 $romfile = "sys\\bin".$filename; |
3741 $romfile = "sys\/bin".$filename; |
3628 } |
3742 } |
3629 } |
3743 } |
3630 else |
3744 else |
3631 { |
3745 { |
3632 if ($warnFlag && $romfile !~ /^sys\\bin\\/i && $romfile !~ /^sys\/bin/i) |
3746 if ($warnFlag && $romfile !~ /^sys\\bin\\/i && $romfile !~ /^sys\/bin/i) |
3694 my $skippingBlanks=0; |
3808 my $skippingBlanks=0; |
3695 undef @newobydata; |
3809 undef @newobydata; |
3696 |
3810 |
3697 if($opt_v) |
3811 if($opt_v) |
3698 { |
3812 { |
3699 my $logWin = "logwin.oby"; |
3813 my $logWin = $thisdir."logwin.oby"; |
3700 my $logLinux = "loglinux.oby"; |
3814 my $logLinux = $thisdir."loglinux.oby"; |
3701 unlink($logWin); |
3815 unlink($logWin); |
3702 unlink($logLinux); |
3816 unlink($logLinux); |
3703 open LOGWIN, ">$logWin" or die("* Can't create $logWin\n"); |
3817 open LOGWIN, ">$logWin" or die("* Can't create $logWin\n"); |
3704 open LOGLINUX, ">$logLinux" or die("* Can't create $logLinux\n"); |
3818 open LOGLINUX, ">$logLinux" or die("* Can't create $logLinux\n"); |
3705 } |
3819 } |
3731 $skippingBlanks=0; |
3845 $skippingBlanks=0; |
3732 } |
3846 } |
3733 # |
3847 # |
3734 # Track ROMNAME, allowing overrides |
3848 # Track ROMNAME, allowing overrides |
3735 # |
3849 # |
3736 if ($line=~/romname\s*=\s*"?(\S+)\.(\S+)"?\s*/i) |
3850 if ($line=~/romname\s*[=\s]\s*"?(\S+)\.(\S+)"?\s*/i) |
3737 { |
3851 { |
3738 if ($romname ne "" && $opt_o eq "") |
3852 if ($romname ne "" && $opt_o eq "") |
3739 { |
3853 { |
3740 print_source_error("Overrides previous ROM name $romname"); |
3854 print_source_error("Overrides previous ROM name $romname"); |
3741 } |
3855 } |
3742 $rombasename = $1; |
3856 $rombasename = $1; |
3743 $romname = "$1.$2"; |
3857 $romname = "$1.$2"; |
3858 if ($opt_workdir) |
|
3859 { |
|
3860 $rombasename = $thisdir.$rombasename; |
|
3861 $romname = $thisdir.$romname; |
|
3862 } |
|
3744 next; |
3863 next; |
3745 } |
3864 } |
3746 # |
3865 # |
3747 # ROM directory listing |
3866 # ROM directory listing |
3748 # |
3867 # |
3750 if( ($newline !~ /^\s*TIME\s*=\s*/i) |
3869 if( ($newline !~ /^\s*TIME\s*=\s*/i) |
3751 &&($newline !~ /^\s*volume\s*=.*/i) |
3870 &&($newline !~ /^\s*volume\s*=.*/i) |
3752 &&($newline !~ /^\s*kerneltrace\s*=.*/i)) |
3871 &&($newline !~ /^\s*kerneltrace\s*=.*/i)) |
3753 { |
3872 { |
3754 my $tmpline = $newline; |
3873 my $tmpline = $newline; |
3755 if($^O =~ /^MSWin32$/i) |
3874 if(&is_windows) |
3756 { |
3875 { |
3757 $newline =~ s-\/-\\-go; |
3876 $newline =~ s-\/-\\-go; |
3758 if($opt_v) |
3877 if($opt_v) |
3759 { |
3878 { |
3760 print LOGWIN $newline; |
3879 print LOGWIN $newline; |
3780 close LOGWIN; |
3899 close LOGWIN; |
3781 close LOGLINUX; |
3900 close LOGLINUX; |
3782 } |
3901 } |
3783 |
3902 |
3784 exit(1) if($errors && $strict); |
3903 exit(1) if($errors && $strict); |
3785 |
|
3786 # Handle ROMNAME and possible -o override |
3904 # Handle ROMNAME and possible -o override |
3787 if ($opt_o ne "") |
3905 if ($opt_o ne "") |
3788 { |
3906 { |
3907 if ($opt_workdir && $opt_o !~ /^[\\\/]/ && $opt_o !~ /^.:/) |
|
3908 { |
|
3909 $opt_o = $thisdir.$opt_o; |
|
3910 } |
|
3911 if (&is_windows) |
|
3912 { |
|
3913 $opt_o =~ s-\/-\\-g; |
|
3914 }else |
|
3915 { |
|
3916 $opt_o =~ s-\\-\/-g; |
|
3917 } |
|
3789 $romname=$opt_o; |
3918 $romname=$opt_o; |
3790 if ($opt_o=~/(\S+)\.(\S+)/) |
3919 if ($opt_o=~/(\S+)\.(\S+)/) |
3791 { |
3920 { |
3792 $rombasename=$1; |
3921 $rombasename=$1; |
3793 } |
3922 } |
4006 |
4135 |
4007 my $file; |
4136 my $file; |
4008 my $prevdir = ""; |
4137 my $prevdir = ""; |
4009 foreach $file (sort {uc($a) cmp uc($b)} keys %romfiles) |
4138 foreach $file (sort {uc($a) cmp uc($b)} keys %romfiles) |
4010 { |
4139 { |
4011 my $dir = substr $file,0,rindex($file, "\\"); |
4140 my $dir = substr $file,0,rindex($file, "\/"); |
4012 if (uc $dir ne uc $prevdir) |
4141 if (uc $dir ne uc $prevdir) |
4013 { |
4142 { |
4014 $prevdir = $dir; |
4143 $prevdir = $dir; |
4015 print DIRFILE "\n"; |
4144 print DIRFILE "\n"; |
4016 } |
4145 } |
4097 } |
4226 } |
4098 else |
4227 else |
4099 { |
4228 { |
4100 $rom_compression_type = ""; |
4229 $rom_compression_type = ""; |
4101 } |
4230 } |
4231 |
|
4232 #Compose command line options for Cache. |
|
4233 my $cache_options; |
|
4234 if($opt_cache == 1) |
|
4235 { |
|
4236 $cache_options = "-cache "; |
|
4237 } |
|
4238 if($opt_nocache == 1) |
|
4239 { |
|
4240 $cache_options .= "-nocache "; |
|
4241 } |
|
4242 if($opt_cleancache == 1) |
|
4243 { |
|
4244 $cache_options .= "-cleancache"; |
|
4245 } |
|
4102 |
4246 |
4103 my $rombuild; |
4247 my $rombuild; |
4104 if(!$geninc) |
4248 if(!$geninc) |
4105 { |
4249 { |
4106 $rombuild = "rombuild -slog $rom_compression_type $logLevel $lowMem $opt_fastcompress $opt_jobs"; |
4250 $rombuild = "rombuild -slog $rom_compression_type $logLevel $lowMem $opt_jobs"; |
4107 } |
4251 } |
4108 else |
4252 else |
4109 { |
4253 { |
4110 $rombuild = "rombuild -slog $rom_compression_type -geninc $logLevel $lowMem $opt_fastcompress $opt_jobs"; |
4254 $rombuild = "rombuild -slog $rom_compression_type -geninc $logLevel $lowMem $opt_jobs"; |
4111 } |
4255 } |
4112 if($gendep) |
4256 if($gendep) |
4113 { |
4257 { |
4114 $rombuild .= " -gendep"; |
4258 $rombuild .= " -gendep"; |
4115 } |
4259 } |
4116 my $rofsbuild = "rofsbuild -slog $logLevel $lowMem $opt_fastcompress $opt_jobs"; |
4260 $rombuild .= " -k" if($opt_k); |
4261 my $rofsbuild = "rofsbuild -slog $logLevel $lowMem $opt_jobs $cache_options"; |
|
4117 foreach my $arg (keys %rombuildOptions) |
4262 foreach my $arg (keys %rombuildOptions) |
4118 { |
4263 { |
4119 $rombuild .= " $arg"; |
4264 $rombuild .= " $arg"; |
4120 } |
4265 } |
4121 |
4266 $rofsbuild .= " -k" if($opt_k); |
4122 for (my $romidx=0; $romidx<8; $romidx++) |
4267 for (my $romidx=0; $romidx<8; $romidx++) |
4123 { |
4268 { |
4124 my $obeyfile=$romimage[$romidx]{obeyfile}; |
4269 my $obeyfile=$romimage[$romidx]{obeyfile}; |
4125 my $xip=$romimage[$romidx]{xip}; |
4270 my $xip=$romimage[$romidx]{xip}; |
4126 my $compress=$romimage[$romidx]{compress}; |
4271 my $compress=$romimage[$romidx]{compress}; |
4148 $compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/; |
4293 $compress =~m/\s-(compression)(method)\s(none|inflate|bytepair)/; |
4149 print "* ".$1." ".$2.": ".$3; |
4294 print "* ".$1." ".$2.": ".$3; |
4150 } |
4295 } |
4151 if ($xip) |
4296 if ($xip) |
4152 { |
4297 { |
4298 is_existinpath("rombuild", romutl::DIE_NOT_FOUND); |
|
4299 $rombuild .= " -symbols" unless($nosymbols) ; |
|
4153 run_rombuilder($rombuild.$compress, $obeyfile, "ROMBUILD.LOG"); |
4300 run_rombuilder($rombuild.$compress, $obeyfile, "ROMBUILD.LOG"); |
4154 if(!$nosymbols){ |
|
4155 print "* Writing $obeyfile.symbol - ROM symbol file\n"; |
|
4156 print "* Executing maksym $obeyfile.log $obeyfile.symbol\n" if ($opt_v); |
|
4157 system("maksym $obeyfile.log $obeyfile.symbol >maksym.out"); |
|
4158 exit(1) if (!-e "$obeyfile.symbol"); |
|
4159 } |
|
4160 } |
4301 } |
4161 else |
4302 else |
4162 { |
4303 { |
4163 # efficient_rom_paging.pm can move everything to core rom. |
4304 # efficient_rom_paging.pm can move everything to core rom. |
4164 # If that is the case, don't run rofsbuild at all to avoid errors. |
4305 # If that is the case, don't run rofsbuild at all to avoid errors. |
4165 use constant TRUE => 1; |
4306 # use constant TRUE => 1; |
4166 use constant FALSE => 0; |
4307 # use constant FALSE => 0; |
4167 my $run_rofs_build = FALSE; |
4308 my $run_rofs_build = 0; |
4168 |
4309 |
4169 open OBYFILE, "$obeyfile.oby"; |
4310 open OBYFILE, "$obeyfile.oby"; |
4170 for (<OBYFILE>) |
4311 for (<OBYFILE>) |
4171 { |
4312 { |
4172 if (is_oby_statement($_)) |
4313 if (is_oby_statement($_)) |
4173 { |
4314 { |
4174 $run_rofs_build = TRUE; |
4315 $run_rofs_build = 1; |
4175 last; |
4316 last; |
4176 } |
4317 } |
4177 } |
4318 } |
4178 close OBYFILE; |
4319 close OBYFILE; |
4179 if ($run_rofs_build) |
4320 if ($run_rofs_build) |
4180 { |
4321 { |
4322 is_existinpath("rofsbuild", romutl::DIE_NOT_FOUND); |
|
4323 if(!$nosymbols) |
|
4324 { |
|
4325 $rofsbuild .= " -symbols"; |
|
4326 } |
|
4181 run_rombuilder($rofsbuild.$compress, $obeyfile, "ROFSBUILD.LOG"); |
4327 run_rombuilder($rofsbuild.$compress, $obeyfile, "ROFSBUILD.LOG"); |
4182 if(!$nosymbols){ |
|
4183 print "* Writing $obeyfile.symbol - ROFS symbol file\n"; |
|
4184 print "* Executing maksymrofs $obeyfile.log $obeyfile.symbol\n" if ($opt_v); |
|
4185 system("maksymrofs $obeyfile.log $obeyfile.symbol >maksym.out"); |
|
4186 exit(1) if (!-e "$obeyfile.symbol" ); |
|
4187 } |
|
4188 } |
4328 } |
4189 } |
4329 } |
4190 unlink "rombuild.log"; |
4330 unlink "rombuild.log"; |
4191 unlink "maksym.out"; |
4331 unlink "maksym.out"; |
4192 } |
4332 } |
4212 # |
4352 # |
4213 |
4353 |
4214 sub relative_path |
4354 sub relative_path |
4215 { |
4355 { |
4216 my ($arg) = @_; |
4356 my ($arg) = @_; |
4217 return $arg if ($arg !~ /^\\/); # not an absolute path |
4357 return $arg if ($arg !~ /^\//); # not an absolute path |
4218 if ($uppath eq "x") |
4358 if ($uppath eq "x") |
4219 { |
4359 { |
4220 $uppath=cwd; |
4360 $uppath=cwd; |
4221 $uppath=~s-/-\\-go; # separator from Perl 5.005_02+ is forward slash |
4361 $uppath=~s-\\-\/-go; # separator from Perl 5.005_02+ is forward slash |
4222 $uppath=~s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash |
4362 $uppath=~s-^(.*[^\/])$-$1\/-o; # ensure path ends with a backslash |
4223 $uppath=~s-\\([^\\]+)-\\..-og; # convert directories into .. |
4363 $uppath=~s-\/([^\/]+)-\/..-og; # convert directories into .. |
4224 $uppath=~s-^.:\\--o; # remove drive letter and leading backslash |
4364 $uppath=~s-^.:\/--o; # remove drive letter and leading backslash |
4225 } |
4365 } |
4226 $arg=~s-^\\--o; # remove leading backslash from original path |
4366 $arg=~s-^\/--o; # remove leading backslash from original path |
4227 return "$uppath$arg"; |
4367 return "$uppath$arg"; |
4228 } |
4368 } |
4229 |
4369 |
4230 # Returns the global @obydata reference to support external tool invocation. |
4370 # Returns the global @obydata reference to support external tool invocation. |
4231 sub getOBYDataRef{ |
4371 sub getOBYDataRef{ |
4451 my $aDllFile = $DllMapRef->{srcfile}; |
4591 my $aDllFile = $DllMapRef->{srcfile}; |
4452 my $SymbolCount = scalar ( keys %{$DllMapRef}) - 2; #The map has 'srcfile' and 'dstpath' special keys besides the symbols. |
4592 my $SymbolCount = scalar ( keys %{$DllMapRef}) - 2; #The map has 'srcfile' and 'dstpath' special keys besides the symbols. |
4453 |
4593 |
4454 my $DllSymMapRef; |
4594 my $DllSymMapRef; |
4455 |
4595 |
4456 my @BPABIPlats = &BPABIutl_Plat_List; |
4596 my @BPABIPlats = &get_bpabiplatlist; |
4457 my $matchedSymbols = 0; |
4597 my $matchedSymbols = 0; |
4458 my $globalSyms = 0; |
4598 my $globalSyms = 0; |
4459 my @platlist = &Plat_List(); |
4599 my @platlist = &get_platlist; |
4460 my $platName; |
4600 my $platName; |
4461 my $rootPlatName; |
4601 my $rootPlatName; |
4462 my $plat = "ARMV5"; |
4602 my $plat = "armv5"; |
4463 $plat = &Variant_GetMacro() ? $plat."_ABIV1" : $plat."_ABIV2"; |
4603 $plat = &get_abiv2mode() ? $plat."_abiv1" : $plat."_abiv2"; |
4464 |
4604 |
4465 foreach my $plat(@platlist) |
4605 foreach my $plat(@platlist) |
4466 { |
4606 { |
4467 if(($aDllFile =~ /\\($plat)\\/i) or ($aDllFile =~ /\\($plat\.\w+)\\/i )) |
4607 if(($aDllFile =~ /[\/\\]($plat)[\/\\]/i) or ($aDllFile =~ /[\/\\]($plat\.\w+)[\/\\]/i )) |
4468 { |
4608 { |
4469 $platName = $1; |
4609 $platName = $1; |
4470 last; |
4610 last; |
4471 } |
4611 } |
4472 } |
4612 } |
4473 $rootPlatName = &Plat_Customizes($platName) ? &Plat_Root($platName) : $platName; |
4613 $rootPlatName = &get_platcustomizes($platName) ? &get_platroot($platName) : $platName; |
4474 |
4614 |
4475 # Map files will be referred for all ARM platforms, |
4615 # Map files will be referred for all ARM platforms, |
4476 # and for BSF platforms which cutomizes ARM platforms. |
4616 # and for BSF platforms which cutomizes ARM platforms. |
4477 if($rootPlatName =~ /^ARMV5|$plat$/i){ |
4617 if($rootPlatName =~ /^armv5|$plat$/i){ |
4478 my $mapfile = "${aDllFile}.map"; |
4618 my $mapfile = "${aDllFile}.map"; |
4479 |
4619 |
4480 open MAPFILE, "$mapfile" or die "Can't open $mapfile\n"; |
4620 open MAPFILE, "$mapfile" or die "Can't open $mapfile\n"; |
4481 while(<MAPFILE>){ |
4621 while(<MAPFILE>){ |
4482 my $line = $_; |
4622 my $line = $_; |
4516 |
4656 |
4517 # Record the address and the size of the symbol. |
4657 # Record the address and the size of the symbol. |
4518 $DllSymMapRef->{dataAddr} = $symbolValue; |
4658 $DllSymMapRef->{dataAddr} = $symbolValue; |
4519 $DllSymMapRef->{size} = $symbolSz; |
4659 $DllSymMapRef->{size} = $symbolSz; |
4520 |
4660 |
4661 |
|
4521 $matchedSymbols++; |
4662 $matchedSymbols++; |
4522 if( $matchedSymbols >= $SymbolCount){ |
4663 if( $matchedSymbols >= $SymbolCount){ |
4523 last; |
4664 last; |
4524 } |
4665 } |
4525 } |
4666 } |
4542 $errors++ if($strict); |
4683 $errors++ if($strict); |
4543 next; #go to the next patch dll data statement |
4684 next; #go to the next patch dll data statement |
4544 } |
4685 } |
4545 if( $aDllFile =~ /(.*)\.[^.]+$/ ){ |
4686 if( $aDllFile =~ /(.*)\.[^.]+$/ ){ |
4546 my $proxydsofile = "$1.dso"; |
4687 my $proxydsofile = "$1.dso"; |
4547 $proxydsofile =~ s/$abiDir\\(.*)\\/ARMV5\\LIB\\/ig; |
4688 $proxydsofile =~ s-$abiDir\/(.*)\/-armv5\/lib\/-ig; |
4548 open PIPE, "getexports -d $proxydsofile|" or die "Can't open file $proxydsofile\n"; |
4689 open PIPE, "getexports -d $proxydsofile|" or die "Can't open file $proxydsofile\n"; |
4549 while (<PIPE>){ |
4690 while (<PIPE>){ |
4550 my $line = $_; |
4691 my $line = $_; |
4551 if($line =~ /\s*(\S+)\s+(\d+)\s+((\S+)\s+(\d+))?/){ |
4692 if($line =~ /\s*(\S+)\s+(\d+)\s+((\S+)\s+(\d+))?/){ |
4552 my $symbol = $1; |
4693 my $symbol = $1; |
4585 # absolute paths starting with slashes. |
4726 # absolute paths starting with slashes. |
4586 sub addDrivesToFeatureVariantPaths |
4727 sub addDrivesToFeatureVariantPaths |
4587 { |
4728 { |
4588 return unless $featureVariant{'VALID'}; |
4729 return unless $featureVariant{'VALID'}; |
4589 |
4730 |
4590 my $current = cwd(); |
4731 my $current = &get_epocdrive; |
4591 my $drive = $1 if ($current =~ /^(.:)/); |
4732 my $drive = $1 if ($current =~ /^(.:)/); |
4592 |
4733 |
4593 # pre-include file |
4734 # pre-include file |
4594 my $HRH = $featureVariant{'VARIANT_HRH'}; |
4735 my $HRH = $featureVariant{'VARIANT_HRH'}; |
4595 $featureVariant{'VARIANT_HRH'} = $drive . $HRH if ($HRH =~ /^[\\\/]/); |
4736 $featureVariant{'VARIANT_HRH'} = $drive . $HRH if ($HRH =~ /^[\\\/]/); |
4609 { |
4750 { |
4610 if($needSmrImage) |
4751 if($needSmrImage) |
4611 { |
4752 { |
4612 foreach my $oby (@obeyFileList) |
4753 foreach my $oby (@obeyFileList) |
4613 { |
4754 { |
4755 is_existinpath("rofsbuild", romutl::ERROR_NOT_FOUND); |
|
4614 my $command = "rofsbuild -slog -smr=$oby.oby"; |
4756 my $command = "rofsbuild -slog -smr=$oby.oby"; |
4615 print "* Executing $command\n" if($opt_v); |
4757 print "* Executing $command\n" if($opt_v); |
4616 system($command); |
4758 system($command); |
4617 if($? != 0) |
4759 if($? != 0) |
4618 { |
4760 { |
4649 { |
4791 { |
4650 print "\n SMR image creating error for empty image name!\n"; |
4792 print "\n SMR image creating error for empty image name!\n"; |
4651 } |
4793 } |
4652 } |
4794 } |
4653 |
4795 |
4796 sub checkcase() |
|
4797 { |
|
4798 if (&is_windows) |
|
4799 { |
|
4800 my @checkcase_obydatatemp = @obydata; |
|
4801 |
|
4802 # call the phase without external tools. |
|
4803 plugin_phase(); |
|
4804 multlinguify_phase(); |
|
4805 #spi_creation_phase(); #spi creation phase will delete some lines, so do not call this phase |
|
4806 suppress_phase(); |
|
4807 process_dlldata(); |
|
4808 bitmap_aif_converison_phase(); |
|
4809 |
|
4810 my $checkcase_log = "checkcase.log"; |
|
4811 unlink $checkcase_log; |
|
4812 |
|
4813 open CHECKCASELOG, ">$checkcase_log" or die("* Can't create $checkcase_log\n"); |
|
4814 my @checkcase_lines = @obydata; |
|
4815 my %checkcase_macro; |
|
4816 my @checkcase_macrodir; |
|
4817 my $checkcase_line; |
|
4818 print CHECKCASELOG "======================Macro check part:======================\n"; |
|
4819 foreach $checkcase_line (@checkcase_lines) |
|
4820 { |
|
4821 track_source($checkcase_line); |
|
4822 $checkcase_line =~ s-\/-\\-g; |
|
4823 $checkcase_line =~ s-\\\\-\\-g; |
|
4824 if ($checkcase_line =~ /^\s*REM\s*(re)?defined\s*(\w*)\s*as\s*(\S+)/) |
|
4825 { |
|
4826 my $checkcase_macrocontent = $3; |
|
4827 my $checkcase_macroname = $2; |
|
4828 if ($checkcase_macrocontent =~ /[a-zA-Z]/) |
|
4829 { |
|
4830 $checkcase_macro{$checkcase_macroname} = $checkcase_macrocontent; |
|
4831 checkcase_macro(\@checkcase_macrodir, $checkcase_macroname, $checkcase_macrocontent); |
|
4832 } |
|
4833 } |
|
4834 } |
|
4835 print CHECKCASELOG "======================Macro check part end======================\n\n"; |
|
4836 print CHECKCASELOG "======================File check part:======================\n"; |
|
4837 foreach $checkcase_line (@checkcase_lines) |
|
4838 { |
|
4839 if ($checkcase_line =~ /^\s*REM\s*.*/) |
|
4840 { |
|
4841 next; |
|
4842 } |
|
4843 if ($checkcase_line =~ /^\s*#\s*\d+\s*\"(\S+)\"\s*\d*\s*$/) #oby filename |
|
4844 { |
|
4845 my $checkcase_whichfile = $1; |
|
4846 checkcase_obyfilename($checkcase_whichfile); |
|
4847 track_source($checkcase_line); |
|
4848 }elsif ($checkcase_line =~ /^\s*\S+\s*=\s*"([^"]+)"\s+\S*\s*/ |
|
4849 || $checkcase_line =~ /^\s*\S+\s*=\s*(\S+)\s+\S*\s*/) #oby content file name |
|
4850 { |
|
4851 my $checkcase_pcsidefile = $1; |
|
4852 checkcase_pcsidefilename(\@checkcase_macrodir, $checkcase_pcsidefile); |
|
4853 } |
|
4854 } |
|
4855 print CHECKCASELOG "======================File check part end======================\n"; |
|
4856 close CHECKCASELOG; |
|
4857 |
|
4858 @obydata = @checkcase_obydatatemp; |
|
4859 }else |
|
4860 { |
|
4861 print "WARNING: checkcase option is only valid on windows.\n"; |
|
4862 } |
|
4863 } |
|
4864 |
|
4865 sub checkcase_macro() |
|
4866 { |
|
4867 my $macrodir = shift; |
|
4868 my $name = shift; |
|
4869 my $content = shift; |
|
4870 |
|
4871 if ($content =~ /epoc32/i && (-d $content)) |
|
4872 { |
|
4873 my $realdir = `directory.bat $content`; |
|
4874 $realdir =~ s/\s+$//g; |
|
4875 $realdir =~ s/^\s*\w://g if ($content !~ /^\w:/); |
|
4876 $realdir =~ s/\\$//g if ($content !~ /\\$/); |
|
4877 $realdir .= "\\" if ($content =~ /\\$/ && $realdir !~ /\\$/); |
|
4878 $sourcefile =~ s/\//\\/g; |
|
4879 $sourcefile =~ s/\\\\/\\/g; |
|
4880 if ($realdir ne $content) |
|
4881 { |
|
4882 print CHECKCASELOG "check case: macro name is $name\n"; |
|
4883 print CHECKCASELOG "WARNING: macro case is not equal to real.\n"; |
|
4884 print CHECKCASELOG "file name is $sourcefile\n"; |
|
4885 print CHECKCASELOG "current is $content\n"; |
|
4886 print CHECKCASELOG "expect is $realdir\n\n"; |
|
4887 checkcase_convert($sourcefile, $content, $realdir); |
|
4888 } |
|
4889 $content =~ s-\\-\\\\-g; |
|
4890 push @$macrodir, $content; |
|
4891 }else |
|
4892 { |
|
4893 if($name eq "PLATFORM_NAME") |
|
4894 { |
|
4895 $content =~ s-\\-\\\\-g; |
|
4896 $content =~ s-\.-\\\.-g; |
|
4897 $checkcase_platform = $content; |
|
4898 } |
|
4899 } |
|
4900 } |
|
4901 |
|
4902 sub checkcase_obyfilename() |
|
4903 { |
|
4904 my $checkfile = shift; |
|
4905 if (-e $checkfile) |
|
4906 { |
|
4907 while ($checkfile=~s-[\\](?!\.{2}\\)[^\\]*\\\.{2}(?=\\)--go){}; |
|
4908 $sourcefile =~ s/\//\\/g; |
|
4909 if ($checkfile eq $sourcefile) |
|
4910 { |
|
4911 return; |
|
4912 } |
|
4913 my($filename, $dir, $suffix) = fileparse($checkfile); |
|
4914 |
|
4915 my $realdir = `directory.bat $dir`; |
|
4916 $realdir =~ s/\s+$//g; |
|
4917 $realdir .= "\\" if ($realdir !~ /\\$/); |
|
4918 if ($realdir ne $dir) |
|
4919 { |
|
4920 print CHECKCASELOG "check case: oby file name is $checkfile\n"; |
|
4921 print CHECKCASELOG "WARNING: dir case is not equal to real.\n"; |
|
4922 my $tempsrcfile = $sourcefile; |
|
4923 $tempsrcfile =~ s/\\\\/\\/g; |
|
4924 print CHECKCASELOG "file name is $tempsrcfile\n"; |
|
4925 print CHECKCASELOG "current is $dir\n"; |
|
4926 print CHECKCASELOG "expect is $realdir\n\n"; |
|
4927 checkcase_convert($sourcefile, $dir, $realdir); |
|
4928 } |
|
4929 |
|
4930 my $currentdir = cwd; |
|
4931 chdir "$dir"; |
|
4932 my @realfile = `dir "$filename" 2>&1`; |
|
4933 my $line; |
|
4934 foreach $line (@realfile) |
|
4935 { |
|
4936 if ($line =~ /^\s*(\S+)\s+(\d{2}:\d{2})\s+(PM|AM)?\s+([\d\,])+\s+([\S]+)\s*/) |
|
4937 { |
|
4938 my $realfilename = $5; |
|
4939 my $filetemp = lc $filename; |
|
4940 my $realtemp = lc $realfilename; |
|
4941 if ($filetemp eq $realtemp && $realfilename ne $filename) |
|
4942 { |
|
4943 print CHECKCASELOG "check case: oby file name is $checkfile\n"; |
|
4944 print CHECKCASELOG "WARNING: filename case is not equal to real.\n"; |
|
4945 my $tempsrcfile = $sourcefile; |
|
4946 $tempsrcfile =~ s/\\\\/\\/g; |
|
4947 print CHECKCASELOG "file name is $tempsrcfile\n"; |
|
4948 print CHECKCASELOG "current is $filename\n"; |
|
4949 print CHECKCASELOG "expect is $realfilename\n\n"; |
|
4950 checkcase_convert($sourcefile, $filename, $realfilename); |
|
4951 } |
|
4952 } |
|
4953 } |
|
4954 chdir "$currentdir"; |
|
4955 } |
|
4956 } |
|
4957 |
|
4958 sub checkcase_pcsidefilename() |
|
4959 { |
|
4960 my $macrodirs = shift; |
|
4961 my $checkfile = shift; |
|
4962 $checkfile =~ s/^\"//g; |
|
4963 $checkfile =~ s/\"$//g; |
|
4964 if (-e $checkfile) |
|
4965 { |
|
4966 while ($checkfile=~s-[\\](?!\.{2}\\)[^\\]*\\\.{2}(?=\\)--go){}; |
|
4967 $sourcefile =~ s/\//\\/g; |
|
4968 my($filename, $dir, $suffix) = fileparse($checkfile); |
|
4969 if ($dir eq "\.\\") |
|
4970 { |
|
4971 $dir = cwd; |
|
4972 $dir =~ s/\//\\/g; |
|
4973 $dir .= "\\" if ($dir !~ /\\$/); |
|
4974 } |
|
4975 |
|
4976 my $realdir = `directory.bat $dir`; |
|
4977 $realdir =~ s/\s+$//g; |
|
4978 $realdir =~ s/^\s*\w://g if ($dir !~ /^\w:/); |
|
4979 $realdir .= "\\" if ($realdir !~ /\\$/); |
|
4980 my $dirtemp = $dir; |
|
4981 if ($checkcase_test) |
|
4982 { |
|
4983 my $macrodirtemp = ""; |
|
4984 foreach my $macrodir (@$macrodirs) |
|
4985 { |
|
4986 if ($dirtemp =~ /^$macrodir(.*)$/) |
|
4987 { |
|
4988 $macrodirtemp = $macrodir if (length($macrodirtemp) < length($macrodir)); |
|
4989 } |
|
4990 } |
|
4991 if ($macrodirtemp ne "") |
|
4992 { |
|
4993 $dirtemp =~ s/^$macrodirtemp//g; |
|
4994 $realdir =~ s/^$macrodirtemp//ig; |
|
4995 } |
|
4996 } |
|
4997 if ($realdir ne $dirtemp) |
|
4998 { |
|
4999 print CHECKCASELOG "check case: pc side file name is $checkfile\n"; |
|
5000 print CHECKCASELOG "WARNING: dir case is not equal to real.\n"; |
|
5001 my $tempsrcfile = $sourcefile; |
|
5002 $tempsrcfile =~ s/\\\\/\\/g; |
|
5003 print CHECKCASELOG "file name is $tempsrcfile\n"; |
|
5004 print CHECKCASELOG "current is $dirtemp\n"; |
|
5005 print CHECKCASELOG "expect is $realdir\n\n"; |
|
5006 checkcase_convert($sourcefile, $dirtemp, $realdir); |
|
5007 } |
|
5008 |
|
5009 my $currentdir = cwd; |
|
5010 chdir "$dir"; |
|
5011 my @realfile = `dir "$filename" 2>&1`; |
|
5012 my $line; |
|
5013 foreach $line (@realfile) |
|
5014 { |
|
5015 if ($line =~ /^\s*(\S+)\s+(\d{2}:\d{2})\s+(PM|AM)?\s+([\d\,])+\s+(.+)\s*/) |
|
5016 { |
|
5017 my $realfilename = $5; |
|
5018 my $filetemp = lc $filename; |
|
5019 my $realtemp = lc $realfilename; |
|
5020 if ($filetemp eq $realtemp && $realfilename ne $filename) |
|
5021 { |
|
5022 print CHECKCASELOG "check case: pc side file name is $checkfile\n"; |
|
5023 print CHECKCASELOG "WARNING: filename case is not equal to real.\n"; |
|
5024 my $tempsrcfile = $sourcefile; |
|
5025 $tempsrcfile =~ s/\\\\/\\/g; |
|
5026 print CHECKCASELOG "file name is $tempsrcfile\n"; |
|
5027 print CHECKCASELOG "current is $filename\n"; |
|
5028 print CHECKCASELOG "expect is $realfilename\n\n"; |
|
5029 checkcase_convert($sourcefile, $filename, $realfilename); |
|
5030 } |
|
5031 } |
|
5032 } |
|
5033 chdir "$currentdir"; |
|
5034 } |
|
5035 } |
|
5036 |
|
5037 sub checkcase_convert() |
|
5038 { |
|
5039 return if (!$checkcase_test); |
|
5040 |
|
5041 my $file = shift; |
|
5042 my $origin = shift; |
|
5043 my $real = shift; |
|
5044 |
|
5045 my @realfile = `dir "$file" 2>&1`; |
|
5046 my $line; |
|
5047 foreach $line (@realfile) |
|
5048 { |
|
5049 if ($line =~ /^\s*(\S+)\s+(\d{2}:\d{2})\s+(PM|AM)?\s+([\d\,])+\s+([\S]+)\s*/) |
|
5050 { |
|
5051 my $realfilename = $5; |
|
5052 $realfilename =~ s-\.-\\\.-g; |
|
5053 $file =~ s-$realfilename$--ig; |
|
5054 $realfilename =~ s-\\\.-\.-g; |
|
5055 $file .= $realfilename; |
|
5056 } |
|
5057 } |
|
5058 |
|
5059 my $tempfile = $file.".temp"; |
|
5060 my $usemultimacro = 0; |
|
5061 my $uses60macro_aifrsc = 0; |
|
5062 my $uses60macro_exe = 0; |
|
5063 my $uses60macro_aificon = 0; |
|
5064 my $uses60macro_resource = 0; |
|
5065 my $originwithoutext = $origin; |
|
5066 my $realwithoutext = $real; |
|
5067 if ($origin =~ /epoc32/i) |
|
5068 { |
|
5069 my $tempepocroot = $ENV{EPOCROOT}; |
|
5070 $tempepocroot =~ s-\\-\\\\-g; |
|
5071 $origin =~ s/^$tempepocroot//g; |
|
5072 $real =~ s/^$tempepocroot//g; |
|
5073 }elsif ($checkcase_platform ne "" && $origin =~ /^_$checkcase_platform\_(.*)/) |
|
5074 { |
|
5075 $origin =~ s/^_$checkcase_platform\_/_PLATFORM_NAME_/g; |
|
5076 $real =~ s/^_$checkcase_platform\_/_PLATFORM_NAME_/g; |
|
5077 }elsif ($origin =~ /\S+\_reg\.rsc$/) |
|
5078 { |
|
5079 $originwithoutext =~ s/\_reg\.rsc$//g; |
|
5080 $realwithoutext =~ s/\_reg\.rsc$//ig; |
|
5081 $uses60macro_aifrsc = 1; |
|
5082 }elsif ($origin =~ /\S+\.rsc$/) |
|
5083 { |
|
5084 $originwithoutext =~ s/\.rsc$//g; |
|
5085 $realwithoutext =~ s/\.rsc$//ig; |
|
5086 $usemultimacro = 1; |
|
5087 $uses60macro_resource = 1; |
|
5088 }elsif ($origin =~ /\S+\.r01$/) |
|
5089 { |
|
5090 $originwithoutext =~ s/\.r01$//g; |
|
5091 $realwithoutext =~ s/\.r01$//ig; |
|
5092 $usemultimacro = 1; |
|
5093 }elsif ($origin =~ /\S+\.exe$/) |
|
5094 { |
|
5095 $originwithoutext =~ s/\.exe$//g; |
|
5096 $realwithoutext =~ s/\.exe$//ig; |
|
5097 $uses60macro_exe = 1; |
|
5098 }elsif ($origin =~ /\S+\_aif\.mif$/) |
|
5099 { |
|
5100 $originwithoutext =~ s/\_aif\.mif$//g; |
|
5101 $realwithoutext =~ s/\_aif\.mif$//ig; |
|
5102 $uses60macro_aificon = 1; |
|
5103 }elsif ($origin =~ /\S+\.mif$/) |
|
5104 { |
|
5105 $originwithoutext =~ s/\.mif$//g; |
|
5106 $realwithoutext =~ s/\.mif$//ig; |
|
5107 $uses60macro_aificon = 1; |
|
5108 } |
|
5109 $origin =~ s-\\-\\\\-g; |
|
5110 $origin =~ s-\.-\\\.-g; |
|
5111 |
|
5112 open (SRC, "<$file"); |
|
5113 open (DST, ">$tempfile"); |
|
5114 my $line; |
|
5115 while($line = <SRC>) |
|
5116 { |
|
5117 my $flag = 0; |
|
5118 |
|
5119 if ($line =~ /$origin/) |
|
5120 { |
|
5121 $originwithoutext = $origin; |
|
5122 $realwithoutext = $real; |
|
5123 $flag = 1; |
|
5124 }elsif ($usemultimacro) |
|
5125 { |
|
5126 if ($line =~ /^.*=\s*MULTI_LINGUIFY\s*\(.*$originwithoutext/) |
|
5127 { |
|
5128 $flag = 1; |
|
5129 }elsif ($line =~ /^\s*S60_APP_RESOURCE\s*\(\s*$originwithoutext\s*\)/ && $uses60macro_resource) |
|
5130 { |
|
5131 $flag = 1; |
|
5132 } |
|
5133 }elsif ($uses60macro_exe) |
|
5134 { |
|
5135 if ($line =~ /^\s*S60_APP_EXE\s*\(\s*$originwithoutext\s*\)/) |
|
5136 { |
|
5137 $flag = 1; |
|
5138 } |
|
5139 }elsif ($uses60macro_aificon) |
|
5140 { |
|
5141 if ($line =~ /^\s*S60_APP_AIF_ICONS\s*\(\s*$originwithoutext\s*\)/) |
|
5142 { |
|
5143 $flag = 1; |
|
5144 }elsif ($line =~ /^\s*SCALABLE_IMAGE\s*\(.*$originwithoutext\s*\)/) |
|
5145 { |
|
5146 $flag = 1; |
|
5147 }elsif ($line =~ /^\s*S60_APP_BITMAP\s*\(\s*$originwithoutext\s*\)/) |
|
5148 { |
|
5149 $flag = 1; |
|
5150 } |
|
5151 }elsif ($uses60macro_aifrsc) |
|
5152 { |
|
5153 if ($line =~ /^\s*S60_APP_AIF_RSC\s*\(\s*$originwithoutext\s*\)/) |
|
5154 { |
|
5155 $flag = 1; |
|
5156 }elsif ($line =~ /^\s*S60_UPGRADABLE_APP_REG_RSC\s*\(\s*$originwithoutext\s*\)/) |
|
5157 { |
|
5158 $flag = 1; |
|
5159 } |
|
5160 } |
|
5161 if ($flag) |
|
5162 { |
|
5163 print CHECKCASELOG "it has been converted automatically\n"; |
|
5164 print CHECKCASELOG "original line is $line"; |
|
5165 $line =~ s-$originwithoutext-$realwithoutext-; |
|
5166 print CHECKCASELOG "converted line is $line\n"; |
|
5167 } |
|
5168 print DST $line; |
|
5169 } |
|
5170 close SRC; |
|
5171 close DST; |
|
5172 |
|
5173 unlink "$file"; |
|
5174 rename ("$file.temp", "$file"); |
|
5175 } |
|
5176 |
|
4654 1; |
5177 1; |