1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/stdcpp/tsrc/boost_genatsmodules.bat Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,2715 @@
1.4 +@rem
1.5 +@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +@rem All rights reserved.
1.7 +@rem This component and the accompanying materials are made available
1.8 +@rem under the terms of "Eclipse Public License v1.0"
1.9 +@rem which accompanies this distribution, and is available
1.10 +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +@rem
1.12 +@rem Initial Contributors:
1.13 +@rem Nokia Corporation - initial contribution.
1.14 +@rem
1.15 +@rem Contributors:
1.16 +@rem
1.17 +@rem Description:
1.18 +@rem
1.19 +
1.20 +
1.21 +@perl -x boost_GenATSModules.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
1.22 +@goto end
1.23 +
1.24 +#!perl
1.25 +use strict;
1.26 +use File::Find;
1.27 +use File::Copy;
1.28 +use Cwd;
1.29 +use File::Basename;
1.30 +
1.31 +
1.32 +my $target = "winsspd";
1.33 +my $suite;
1.34 +my $install = "no";
1.35 +my $session = "no";
1.36 +my $combinedSession = "no";
1.37 +my $sdkversion="";
1.38 +my $noXmlsGenList = "play_new";
1.39 +my @AllModuleList = ();
1.40 +
1.41 +my %DirHash;
1.42 +
1.43 +my $sendEmail = "no";
1.44 +my $rootDrive = substr(getcwd(), 0,2);
1.45 +my $templateRoot = getcwd();
1.46 +my $ATSRoot = getcwd()."\\ATSINPUT";
1.47 +
1.48 +if($ENV{'ATS_SETUP'} ne "")
1.49 +{
1.50 + $sendEmail = "yes";
1.51 + $rootDrive = $ENV{'ATS_INDRIVE'};
1.52 + $templateRoot = $ENV{'ATS_TEMPLATEROOT'};
1.53 + $ATSRoot = $ENV{'ATS_ATSOUTDRIVE'};
1.54 +}
1.55 +
1.56 +
1.57 +if(scalar @ARGV ==0 || $ARGV[0] =~ /[\-\\\/][h\?]/ || $ARGV[0] =~ /help/ )
1.58 +{
1.59 + print <<EOHelp;
1.60 +genatsmodules.bat - hardcoded script to generate ATSINPUT folders for mobileruntime and ngi projects
1.61 +Usage:
1.62 + genatsmodules.bat
1.63 + Create ATSINPUT for the default testsuite based on
1.64 + location it is executed from place in stdlibs/internal
1.65 + and run and it generates ATSINPUT for stdlibs
1.66 + similiarly place it in ssl/internal or glib/internal or
1.67 + ngi/internal and run to generate ATSINPUT for ssl, glib
1.68 + and ngi respectively
1.69 +
1.70 + genatsmodules [libname]
1.71 + where libname can be stdlibs, ssl, glib, etc. Creates
1.72 + ats test drop for given library. Valid from any internal
1.73 + folder of mobileruntime.
1.74 +
1.75 +
1.76 + genatsmodules ngi
1.77 + create ngi testsuite. Valid inside ngi/internal only
1.78 +
1.79 +genatsmodules play_new
1.80 + create play_new testsuite. Valid inside play_new/internal only
1.81 +
1.82 +
1.83 +
1.84 + genatsmodules ltp
1.85 + create ltp testsuite. Valid inside stdlibs/internal only
1.86 +
1.87 + genatsmodules lsb
1.88 + create lsb testsuite. Valid inside stdlibs/internal only
1.89 +
1.90 + genatsmodules stdcpp
1.91 + create stdcpp testsuite. Valid inside stdcpp/internal only
1.92 +
1.93 + genatsmodules [libname] install
1.94 + where libname can be stdlibs, ssl, glib, ltp, lsb to create a
1.95 + ATSINPUT where the dependent mobileruntime libraries are also
1.96 + copied and used (It copies the dependent libraries using the
1.97 + ATS component files)
1.98 +
1.99 + genatsmodules session [libname] [target]
1.100 + where libname is any of the standard libs as shown above and
1.101 + target can be winsspd, winscw, scarfe, zeus etc. to create
1.102 + session files for scarfe, winsspd etc.
1.103 +
1.104 +genatsmodules session combined [target]
1.105 + will look at the existing ATSINPUT(which can have any
1.106 + combination of created components and create a combined
1.107 + session file. This way you get increased flexibility in
1.108 + the libraries you choose to combine into a single session
1.109 + file. If the target is a hardware target(that is not winsspd
1.110 + or winscw), the script will first attempt to find a target
1.111 + specific component file and if not found, the generic hw
1.112 + component file.
1.113 +
1.114 +
1.115 + Note:
1.116 + ATSINPUT creation is a 2 stage process. First we create
1.117 + the components and then we run (for example)
1.118 + "genatsmodules session stdlibs winscw" and
1.119 + "genatsmodules session stdlibs scarfe" to create the
1.120 + session files.
1.121 +EOHelp
1.122 + exit();
1.123 +}
1.124 +my $do_armv5 = 1;
1.125 +my $do_winscw = 1;
1.126 +
1.127 +if(scalar @ARGV == 1)
1.128 +{
1.129 + if($ARGV[0] eq "session")
1.130 + {
1.131 + die("parameter session must be followed by libname and target platform");
1.132 + }
1.133 + else
1.134 + {
1.135 + $suite = $ARGV[0];
1.136 + }
1.137 +}
1.138 +elsif(scalar @ARGV == 2)
1.139 +{
1.140 + if($ARGV[0] eq "session")
1.141 + {
1.142 + die("parameter session must be followed by libname and target platform");
1.143 + }
1.144 + elsif($ARGV[1] eq "install")
1.145 + {
1.146 + $suite = $ARGV[0];
1.147 + $install = "yes";
1.148 + }
1.149 + elsif($ARGV[1] eq "armv5")
1.150 + {
1.151 + $do_winscw = 0;
1.152 + }
1.153 + elsif($ARGV[1] eq "winscw")
1.154 + {
1.155 + $do_armv5 = 0;
1.156 + }
1.157 + else
1.158 + {
1.159 + die("second parameter after target platform $ARGV[0] can only be \"install\" ");
1.160 + }
1.161 +}
1.162 +elsif(scalar @ARGV == 3)
1.163 +{
1.164 + if($ARGV[0] ne "session")
1.165 + {
1.166 + die("invalid combination of parameters. Program expected 1st parameter to be \"session\" ");
1.167 + }
1.168 + else
1.169 + {
1.170 + $session = "yes";
1.171 + $suite = $ARGV[1];
1.172 + $target = $ARGV[2];
1.173 +
1.174 + if($suite eq "combined")
1.175 + {
1.176 + $combinedSession = "yes";
1.177 + }
1.178 +
1.179 + }
1.180 +}
1.181 +elsif(scalar @ARGV == 4)
1.182 +{
1.183 + if($ARGV[0] ne "session")
1.184 + {
1.185 + die("invalid combination of parameters. Program expected 1st parameter to be \"session\" ");
1.186 + }
1.187 + else
1.188 + {
1.189 + $session = "yes";
1.190 + $suite = $ARGV[1];
1.191 + $target = $ARGV[2];
1.192 + $sdkversion = $ARGV[3];
1.193 + if($suite eq "combined")
1.194 + {
1.195 + $combinedSession = "yes";
1.196 + }
1.197 + }
1.198 +}
1.199 +else
1.200 +{
1.201 + die("program recieved too many parameters!");
1.202 +}#end of commandline processing
1.203 +
1.204 +
1.205 +
1.206 +if( 0 )
1.207 +{
1.208 + die("Please run the script from the appropriate internal folder in the mobileruntime /omerta project!!");
1.209 +}
1.210 +else
1.211 +{
1.212 +
1.213 + my $srcPrefix = getcwd();
1.214 + $srcPrefix =~ /(.*)internal.*/;
1.215 + $srcPrefix = $1;
1.216 + if(rindex($templateRoot, "stdlibs") != -1)
1.217 + {
1.218 + $srcPrefix =~ /(.*)stdlibs.*/;
1.219 + $srcPrefix = $1;
1.220 +
1.221 + if($suite eq "glib")
1.222 + {
1.223 + $templateRoot = $srcPrefix."/glib/internal/";
1.224 + }
1.225 + elsif($suite eq "ssl")
1.226 + {
1.227 + $templateRoot = $srcPrefix."/ssl/internal/";
1.228 + }
1.229 + elsif($suite eq "ngi" && $session ne "yes")
1.230 + {
1.231 + print "ngi atsinput creation not supported from mobileruntime\n";
1.232 + exit();
1.233 + }
1.234 + }
1.235 +
1.236 + if(rindex($templateRoot, "glib") != -1)
1.237 + {
1.238 + $suite = "glib";
1.239 + }
1.240 + elsif(rindex($templateRoot, "ssl") != -1)
1.241 + {
1.242 + $suite = "ssl";
1.243 + }
1.244 + elsif(rindex($templateRoot, "ngi") != -1)
1.245 + {
1.246 + $suite = "ngi";
1.247 + }
1.248 +}
1.249 +
1.250 +
1.251 +my $optsGroupPath = $templateRoot."/ts/ltp/opts/group/";
1.252 +#$optsGroupPath = getcwd()."/ts/ltp/opts/group/";
1.253 +my $ltpPath =$templateRoot."/ts/ltp/";
1.254 +my $stdcppPath =$templateRoot."/testapps/stlport/";
1.255 +my @stdexeList = ("boost","Boost_test");
1.256 +#my $gnuPath =getcwd()."/testapps/gnu/";
1.257 +#my $tstdcppPath =getcwd()."/testapps/tstdcpp/";
1.258 +
1.259 +
1.260 +my @generatedModules;
1.261 +my %cfglocation;
1.262 +
1.263 +my $TDIR = "\\internal\\testapps\\";
1.264 +
1.265 +my @libcModules = ( "libc_loc_blr", "libc_time_blr", "libc_db_blr","tctype", "tifioctls", "tinet",
1.266 + "tlibcwchar", "tlink", "tmkfifo", "tmmap", "tmsgqueue",
1.267 + "tnetdb", "tpipe","tregex", "tsemaphore", "tshm","tsocket" ,
1.268 + "tstdio", "tstdlib", "tstring", "tsyscalls",
1.269 + "tsyssim", "twctype", "tselect", "tsysunistd", "twideapis", "twopen", "twchar",
1.270 + "twcharapi",
1.271 + );
1.272 +
1.273 +my @libdlModules = ("tlibdl");
1.274 +my @libmModules = ("libm_double_blr", "libm_float_blr","libm_ldouble_blr");
1.275 +
1.276 +
1.277 +my @pthreadModules = ( "testcondbroadcast", "testconddestroy", "testcondinit", "testcondsignal", "testcondtimedwait", "testcondwait",
1.278 +"tmutex", "tpthread", "testpthreadonce", "testsemclose", "testsemdestroy", "testsemgetvalue", "testseminit", "testsemopen", "testsempost",
1.279 +"testsemtimedwait", "testsemtrywait", "testsemunlink", "testsemwait");
1.280 +
1.281 +
1.282 +my @stdliblist = ( "libc", "libpthread", "libdl", "libm", "libz", "libcrypt");
1.283 +my @dllList = ("backend.dll", "libc.dll", "LibCIpcClient.dll", "LibCIpcServer.exe", "libdl.dll", "libm.dll", "libpthread.dll", "libcrypt.dll", "libz.dll");
1.284 +
1.285 +
1.286 +my @stdcpplist = (
1.287 + # ["fstream1_input.txt", "stlport_fstream", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
1.288 + # ["nextperm1_good.txt", "stlport_nextprm", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
1.289 + # ["nextperm2_good.txt", "stlport_nextprm", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
1.290 + #["ostmit_good.txt", "stlport_ostmit", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
1.291 + #["seek.txt", "stlport_seek", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
1.292 + # ["test.txt", "platsectest6", "/../internal/testapps/doc/", "/General/", "C:\\resource"],
1.293 + # ["test.txt", "platsectest11", "/../internal/testapps/doc/", "/General/", "C:\\sys"],
1.294 +);
1.295 +
1.296 +my @gliblist = (
1.297 + ["1.gmarkup", "markup_test", "/epoc32/winscw/c/", "/General/", "C:"],
1.298 + ["1.gmarkup", "markup-test", "/epoc32/winscw/c/", "/General/", "C:"],
1.299 + ["iochannel-test-infile", "iochannel_test", "/epoc32/winscw/c/", "/General/", "C:"],
1.300 + ["iochannel-test-infile", "iochannel-test", "/epoc32/winscw/c/", "/General/", "C:"],
1.301 +# ["casemap.bin", "unicode-caseconv", "/epoc32/winscw/c/", "/General/", "C:"],
1.302 +# ["casefold.bin", "unicode-caseconv", "/epoc32/winscw/c/", "/General/", "C:"],
1.303 + ["utf8.txt", "unicode-encoding","/epoc32/winscw/c/", "/General/", "C:"],
1.304 + ["casecollate.txt", "unicode-collate","/epoc32/winscw/c/", "/General/", "C:"],
1.305 + ["utf8_hindi.txt", "tutf8","/epoc32/winscw/c/", "/General/", "C:"],
1.306 + ["scanfile.txt", "tscanner","/epoc32/winscw/c/", "/General/", "C:"],
1.307 + ["test.txt", "dir_test","/epoc32/winscw/c/temp/tmp/", "/General/", "C:\\temp\\tmp"],
1.308 + ["NormalizationTest.txt", "unicode-normalize","/epoc32/winscw/c/", "/General/", "C:"],
1.309 +
1.310 + ["helloworld.exe", "spawn_test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
1.311 + ["helloworld.exe", "spawn_test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
1.312 +
1.313 + ["libmoduletestplugin_a.dll", "module-test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
1.314 + ["libmoduletestplugin_a.dll", "module-test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
1.315 +
1.316 + ["libmoduletestplugin_b.dll", "module-test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
1.317 + ["libmoduletestplugin_b.dll", "module-test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
1.318 +
1.319 +
1.320 + );
1.321 +
1.322 +my @ngilist = (
1.323 + ["Test.txt", "ngi_sa_runtimetester", "/EPOC32/winscw/c/Private/10202be9/", "/General/", ""],
1.324 + ["sa_input_repository.txt", "shared","/EPOC32/armv5/c/TestFramework/", "/armv5_urel/", ""],
1.325 + ["sa_input_repository.txt", "shared","/EPOC32/winscw/c/TestFramework/", "/winscw_udeb/", ""],
1.326 + ["audiomixingfiles.ini", "ngi_sa_audiomixing","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.327 + ["sa_camera_supported.ini", "ngi_sa_camera","/EPOC32/armv5/c/TestFramework/", "/general/", ""],
1.328 + ["sa_clip.ini", "ngi_sa_clip","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.329 + ["devicecapabilitiesdata.ini", "ngi_sa_devicecapabilities","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.330 + ["highlevelaudiofiles.ini", "ngi_sa_highlevelaudio","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.331 + ["lowlevelaudiofiles.ini", "ngi_sa_lowlevelaudio","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.332 + ["runtimedata.ini", "ngi_sa_runtimetester","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.333 + ["sa_stream.ini", "ngi_sa_stream","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
1.334 + #["*", "ngi_sa_videoplayback","/../graphics/video/internal/sa_videoplayback/data/", "/general/", ""],
1.335 + ["test.*", "ngi_sa_images","/Epoc32/winscw/c/Data/", "/general/", ""]
1.336 + );
1.337 +
1.338 +
1.339 +
1.340 +
1.341 +my $validexpansions = "all stdlibs combined";
1.342 +my $validLibraries = "ltp opts lsb glib ssl ngi pcts stdcpp gcce libc-locale play_new phall boost";
1.343 +if(rindex($validexpansions, $suite)== -1 && rindex($validLibraries, $suite) == -1)
1.344 +{
1.345 + die("$suite is not a valid library. Valid options are $validexpansions $validLibraries");
1.346 +}
1.347 +
1.348 +my $dontStrip = 1;
1.349 +my @liblist;
1.350 +if($suite eq "all")
1.351 +{
1.352 + @liblist = split " ", $validLibraries;
1.353 + @liblist = (@liblist, @stdliblist);
1.354 +
1.355 +}#suite all
1.356 +elsif($suite eq "ltp")
1.357 +{
1.358 + @liblist = ("ltp", "opts");
1.359 +}
1.360 +elsif($suite eq "stdlibs")
1.361 +{
1.362 + @liblist = @stdliblist;
1.363 +}
1.364 +elsif($suite eq "ssl")
1.365 +{
1.366 + @liblist = ("libcrypto", "libssl");
1.367 +}
1.368 +else
1.369 +{
1.370 + @liblist = ("$suite");
1.371 +}
1.372 +
1.373 +# foreach my $l(@liblist)
1.374 +# {
1.375 +# print "$l was there\n";
1.376 +# }
1.377 +
1.378 +
1.379 +if($combinedSession eq "yes")
1.380 +{
1.381 + GenerateSessionFile("combined", $target,"combined");
1.382 + exit();
1.383 +}
1.384 +
1.385 +if($session eq "yes")
1.386 +{
1.387 + my $file = $templateRoot."/testsession.xml";
1.388 + opendir(DIRHANDLE, $ATSRoot) || die("Please try to create Session files only after ATSINPUT/components has been created!");
1.389 + closedir(DIRHANDLE);
1.390 + $dontStrip = 1;
1.391 +
1.392 + if($suite eq "stdlibs")
1.393 + {
1.394 + #my $dst = $ATSRoot."/$suite"."_testsession.xml";
1.395 + #copy($file, $dst);
1.396 + GenerateSessionFile("combined",$target,$suite);
1.397 + exit();
1.398 + }
1.399 + elsif($suite eq "ssl")
1.400 + {
1.401 + my @componentFiles = GetSslXmls();
1.402 + GenerateSessionFile("combined",$target,$suite,\@componentFiles);
1.403 + exit();
1.404 + }
1.405 + else
1.406 + {
1.407 + @generatedModules = GenGenModules($suite);
1.408 + my @componentFiles = GetXmls($suite);
1.409 + GenerateSessionFile("combined",$target,$suite,\@componentFiles);
1.410 + exit();
1.411 + }
1.412 + foreach my $lib(@liblist)
1.413 + {
1.414 + @generatedModules = GenGenModules($lib);
1.415 + if(scalar @generatedModules != 0)
1.416 + {
1.417 + #print "Generating for $lib\n";
1.418 + GenerateSessionFile($lib, $target,$lib);
1.419 + }
1.420 + }
1.421 +
1.422 + #@generatedModules = GetAllModules();
1.423 + #if(scalar @generatedModules != 0)
1.424 + #{
1.425 + # GenerateSessionFile("combined",$target, "combined");
1.426 + #}
1.427 + exit();
1.428 +}#session generation code
1.429 +
1.430 +
1.431 +if ($suite eq "ltp" || $suite eq "all")
1.432 +{
1.433 + my @ltpModules = GetLtpModules();
1.434 + @generatedModules = @ltpModules;
1.435 + DoGen("ltp", ".dll");
1.436 + CopyLtpCfg("ltp");
1.437 +
1.438 +
1.439 + my @saved = @dllList;
1.440 + @dllList = ("ltplib.dll");
1.441 + CopySharedDlls("ltp", \@dllList);
1.442 + TransformXmls("ltp","shared");
1.443 + @dllList = @saved;
1.444 +
1.445 + @generatedModules = GetCompiledModules($optsGroupPath."/bld.inf");
1.446 + DoGen("opts",".dll");
1.447 +
1.448 +}
1.449 +if ($suite eq "glib")
1.450 +{
1.451 + my $bldfile = $templateRoot."/testapps/group/bld.inf";
1.452 + my @glibModules = GetCompiledModules($bldfile);
1.453 + @generatedModules = @glibModules;
1.454 + DoGen("glib",".exe");
1.455 + my $gDataRef = \@gliblist;
1.456 + CopyArbitDatFiles("glib",$gDataRef);
1.457 +
1.458 + if($install eq "yes")
1.459 + {
1.460 + my @saved = @dllList;
1.461 + my @glib2dllList = ("glibbackend.dll", "Libgobject.dll", "libgmodule.dll", "libgthread.dll",
1.462 + "libglib.dll");
1.463 +
1.464 + my @glib1List = ( "libgobject.dll", "libgmodule.dll", "libgthread.dll", "libglib.dll", );
1.465 + @dllList = @glib2dllList;
1.466 + CopySharedDlls("glib",\@dllList);
1.467 + TransformXmls("glib", "shared");
1.468 +
1.469 + @dllList = @saved;
1.470 + }#if install
1.471 +}#glib
1.472 +
1.473 +if ($suite eq "phall")
1.474 +{
1.475 + my $bldfile = getcwd()."/group/bld.inf";
1.476 + my @hallModules = GetCompiledModules($bldfile);
1.477 + @generatedModules = @hallModules;
1.478 + DoGen($suite,".exe");
1.479 + #my $gDataRef = \@gliblist;
1.480 + #CopyArbitDatFiles("glib",$gDataRef);
1.481 +
1.482 + if($install eq "yes")
1.483 + {
1.484 + my @saved = @dllList;
1.485 +
1.486 + my @phallList = ( "libstdcpp.dll" );
1.487 + @dllList = @phallList;
1.488 + CopySharedDlls($suite,\@dllList);
1.489 + TransformXmls($suite, "shared");
1.490 + @dllList = @saved;
1.491 + exit;
1.492 + }#if install
1.493 +}#phall
1.494 +
1.495 +if ($suite eq "ssl")
1.496 +{
1.497 + my $stripStatus = $dontStrip;
1.498 + $dontStrip = 0;
1.499 + GenCryptoTest();
1.500 + if($install eq "yes")
1.501 + {
1.502 + @dllList = (@dllList, "libcrypto.dll", "libssl.dll");
1.503 + }#if install
1.504 + $dontStrip = $stripStatus;
1.505 +}#ssl
1.506 +
1.507 +if($suite eq "ngi")
1.508 +{
1.509 +
1.510 + GenNgiTest();
1.511 + CopyNgiXmls();
1.512 + CopyArbitDatFiles("",\@ngilist);
1.513 +
1.514 +}
1.515 +
1.516 +if($suite eq "play_new")
1.517 +{
1.518 + my @play_newModules = ("fonttestmodule", "messagingtestmodule","locationtestmodule", "alertstestmodule",
1.519 + "libxmlstiff","ngisvgtestmodule");
1.520 + @generatedModules = @play_newModules;
1.521 + DoGen("play_new",".dll");
1.522 +
1.523 + my @list = (
1.524 + ["*.cfg", "fonttestmodule", "/../fonts/internal/testmodules/fonttestmodule/group/","/General/", ""],
1.525 + ["*.xml", "fonttestmodule", "/../fonts/internal/testmodules/fonttestmodule/group/","/", ""],
1.526 +
1.527 + ["*.cfg", "messagingtestmodule", "/../ngimessaging/internal/testmodules/messagingtestmodule/group/","/General/", ""],
1.528 + ["*.xml", "messagingtestmodule", "/../ngimessaging/internal/testmodules/messagingtestmodule/group/","/", ""],
1.529 + ["*", "messagingtestmodule", "/EPOC32/winscw/c/messagingtestmodule/","/General/", ""],
1.530 +
1.531 + ["*.cfg", "locationtestmodule", "/../ngilocation/internal/testmodules/locationtestmodule/group/","/General/", ""],
1.532 + ["*.xml", "locationtestmodule", "/../ngilocation/internal/testmodules/locationtestmodule/group/","/", ""],
1.533 +
1.534 + ["*.cfg", "alertstestmodule", "/../ngialerts/internal/testmodules/alertstestmodule/group/","/General/", ""],
1.535 + ["*.xml", "alertstestmodule", "/../ngialerts/internal/testmodules/alertstestmodule/group/","/", ""],
1.536 + ["vertigo.wav", "alertstestmodule", "/Epoc32/winscw/c/alertstestmodule/","/General/", ""],
1.537 +
1.538 + ["*.cfg", "libxmlstiff", "/../libxmlpp/internal/group/","/General/", ""],
1.539 + ["*.xml", "libxmlstiff", "/../libxmlpp/internal/group/","/", ""],
1.540 + ["*.*", "libxmlstiff", "/../libxmlpp/internal/data/","/General/", ""],
1.541 +
1.542 + ["*.cfg", "ngisvgtestmodule", "/../ngisvg/internal/testmodules/ngisvgtestmodule/group/","/General/", ""],
1.543 + ["*.xml", "ngisvgtestmodule", "/../ngisvg/internal/testmodules/ngisvgtestmodule/group/","/", ""],
1.544 + ["*.*", "ngisvgtestmodule", "/epoc32/winscw/c/ngisvgtest/","/General/", ""],
1.545 +
1.546 + );
1.547 +
1.548 + my $bDataRef = \@list;
1.549 + CopyArbitDatFiles("play_new",$bDataRef);
1.550 + if($install eq "yes")
1.551 + {
1.552 + @generatedModules = GenGenModules("play_new");
1.553 + my @saved = @dllList;
1.554 + my @playList = (
1.555 +"ngifonts.dll",
1.556 +"ngimessaging.dll",
1.557 +"ngisvg.dll",
1.558 +"ngilocation.dll",
1.559 +"ngialerts.dll",
1.560 +"libstdcpp.dll",
1.561 +"libxmlpp.dll",
1.562 +"FeedsLibXml2xmlpp.dll");
1.563 + @dllList = @playList;
1.564 + CopySharedDlls("play_new",\@dllList);
1.565 + TransformXmls("play_new", "shared");
1.566 + @dllList = @saved;
1.567 +
1.568 + }#end install
1.569 +
1.570 +
1.571 +}
1.572 +
1.573 +if($suite eq "boost")
1.574 +{
1.575 + #@generatedModules = GetstdcppModules();
1.576 + #DoGen("stdcpp",".dll");
1.577 + CopyLtpCfg("boost");
1.578 +
1.579 + my $bldfile = getcwd()."/filelist.txt";
1.580 + #@generatedModules = GetCompiledModules($bldfile);
1.581 +
1.582 + recurse("Boost_test");
1.583 +
1.584 + @generatedModules = @AllModuleList;
1.585 +
1.586 + DoGen("boost",".exe");
1.587 +
1.588 + #my @saved = @dllList;
1.589 +# @dllList = ("stdcxxtestengine.dll");
1.590 +# CopySharedDlls("stdcpp", \@dllList);
1.591 +# TransformXmls("stdcpp","shared");
1.592 +# @dllList = @saved;
1.593 +
1.594 + CopyArbitDatFiles("stdcpp",\@stdcpplist);
1.595 +
1.596 + if($install eq "yes")
1.597 + {
1.598 + @generatedModules = GenGenModules("boost");
1.599 + #my @saved = @dllList;
1.600 + #my @cppList = ("libstdcpp.dll");
1.601 + # @dllList = @cppList;
1.602 + # CopySharedDlls("stdcpp",\@dllList);
1.603 + # TransformXmls("boost", "shared");
1.604 + # @dllList = @saved;
1.605 +
1.606 + my @saved = @dllList;
1.607 +
1.608 + my @phallList = ( "libstdcpp.dll" );
1.609 + @dllList = @phallList;
1.610 + CopySharedDlls($suite,\@dllList);
1.611 + TransformXmls($suite, "shared");
1.612 + @dllList = @saved;
1.613 +
1.614 + exit;
1.615 + }#if install
1.616 +}
1.617 +
1.618 +
1.619 +if($suite eq "lsb" || $suite eq "all")
1.620 +{
1.621 + my @lsbModules = GetLsbModules();
1.622 + @generatedModules = @lsbModules;
1.623 + DoGen("lsb",".exe");
1.624 +
1.625 + my @depDlls;
1.626 + my $dll;
1.627 +
1.628 + #copying the common dlls
1.629 + @depDlls =
1.630 + (
1.631 + "libapi.dll",
1.632 + "tcm.dll",
1.633 + "vlib.dll",
1.634 + );
1.635 +
1.636 + foreach $dll (@depDlls)
1.637 + {
1.638 + CopyDeps("lsb",$dll);
1.639 + }
1.640 + #now copy the cfg files
1.641 + CopyLsbCfg("lsb");
1.642 + #now copy the extra dependency dlls
1.643 +
1.644 + #dlopen
1.645 + @generatedModules = ("dlopen");
1.646 +
1.647 +
1.648 +
1.649 + @depDlls =
1.650 + (
1.651 + "dynlibtest.1.dll",
1.652 + "dynlibtest.11.1.dll",
1.653 + "dynlibtest.11.2.dll",
1.654 + "dynlibtest.12g.dll",
1.655 + "dynlibtest.12r.dll",
1.656 + "dynlibtest.14.1.dll",
1.657 + "dynlibtest.14.2.dll",
1.658 + "dynlibtest.14.3.dll",
1.659 + "dynlibtest.3.1.dll",
1.660 + "dynlibtest.3.2.dll",
1.661 + "dynlibtest.3.dll",
1.662 + "dynlibtest.4.dll",
1.663 + "dynlibtest.8.dll",
1.664 + "dynlibtest.9.dll",
1.665 + "dynlibtest.3.dll",
1.666 + "dynlibtest.8.dll",
1.667 + );
1.668 +
1.669 + foreach $dll (@depDlls)
1.670 + {
1.671 + CopyDeps("lsb",$dll);
1.672 + }
1.673 +
1.674 + #dlclose
1.675 + @generatedModules = ("dlclose");
1.676 + @depDlls = ("dynlibclose.1.dll");
1.677 + foreach $dll (@depDlls)
1.678 + {
1.679 + CopyDeps("lsb",$dll);
1.680 + }
1.681 +
1.682 + #dlerror
1.683 + @generatedModules = ("dlerror");
1.684 + @depDlls = ("dynlib.dll");
1.685 + foreach $dll (@depDlls)
1.686 + {
1.687 + CopyDeps("lsb",$dll);
1.688 + }
1.689 +
1.690 + #now copy the xmls!
1.691 + my $srcDir = $templateRoot."/ts/lsbsuites/group/";
1.692 +
1.693 + my $dst;
1.694 +
1.695 + foreach my $dllib("dlopen", "dlclose", "dlerror")
1.696 + {
1.697 + $dst = $ATSRoot."\\components\\lsb_".$dllib."\\";
1.698 + copy($srcDir."/lsb_".$dllib."_module_blr_hw_component.xml", $dst) || die("DIED: unable to copy from $srcDir!\n");
1.699 + copy($srcDir."/lsb_".$dllib."_module_blr_winsspd_component.xml", $dst) || die("DIED: unable to copy from $srcDir!\n");
1.700 + }
1.701 +
1.702 +}
1.703 +
1.704 +if($suite eq "gcce")
1.705 +{
1.706 +
1.707 + mkdir $ATSRoot;
1.708 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.709 +
1.710 + @generatedModules = ("gcce-validate", "gcce-load");
1.711 +
1.712 + my @depDlls =
1.713 + (
1.714 + "gcce-lib.dll",
1.715 + );
1.716 +
1.717 + my $suffix = ".exe";
1.718 + my $libname = "gcce";
1.719 +
1.720 +
1.721 + my $src;
1.722 + my $dst;
1.723 + foreach my $module(@generatedModules)
1.724 + {
1.725 + my $relroot = $ATSRoot."\\components\\$libname"."_$module";
1.726 + mkdir $relroot || die("DIED: unable to create dir $module\n");
1.727 + mkdir $relroot."\\armv5_urel" || die("DIED: unable to create dir $relroot\\armv5_urel\n");
1.728 +
1.729 + #GenExeXmls($module,$libname);
1.730 +
1.731 + $src = $rootDrive."\\epoc32\\release\\gcce\\urel\\".$module.$suffix;
1.732 + $dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
1.733 + $dst = $dst."\\armv5_urel\\";
1.734 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.735 + }
1.736 + $src = $rootDrive."\\epoc32\\release\\gcce\\urel\\"."gcce-lib.dll";
1.737 + $dst = $ATSRoot."\\components\\gcce_gcce-load";
1.738 + $dst = $dst."\\armv5_urel\\";
1.739 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.740 +
1.741 +
1.742 + my @list = (
1.743 + ["gcce_gcce-load_module_blr_hw_component.xml", "gcce-load", "./","/", ""],
1.744 + ["gcce_gcce-validate_module_blr_hw_component.xml", "gcce-validate", "./","/", ""],
1.745 + );
1.746 +
1.747 + my $bDataRef = \@list;
1.748 + CopyArbitDatFiles("gcce",$bDataRef);
1.749 +
1.750 +
1.751 +}#if gcce
1.752 +
1.753 +
1.754 +
1.755 +if($suite eq "libc-locale")
1.756 +{
1.757 + $dontStrip = 0;
1.758 + mkdir $ATSRoot;
1.759 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.760 +
1.761 + @generatedModules = ("tstring");
1.762 + DoGen("libc",".dll");
1.763 +
1.764 + my @localelist = (
1.765 + ["locales.txt", "string", "../libc/internal/testapps/tstring/data/", "/General/", ""],
1.766 + ["tstring_locale_component.xml", "string", "../libc/internal/testapps/tstring/group/", "/", ""],
1.767 +
1.768 + );
1.769 +
1.770 + my $bDataRef = \@localelist;
1.771 + CopyArbitDatFiles("libc",$bDataRef);
1.772 + #delete($ATSRoot."/components/libc_string/"."libc_string_module_blr_hw_component.xml") || die("unable to delete");
1.773 + my $my_src = $ATSRoot."/components/libc_string/"."tstring_locale_component.xml";
1.774 + my $my_dst = $ATSRoot."/components/libc_string/"."libc_string_module_blr_hw_component.xml";
1.775 +
1.776 + unlink($my_dst) ||warn("unable to delete $my_dst");
1.777 + rename($my_src,$my_dst) || move($my_src,$my_dst) || die("Unable to rename!");
1.778 +
1.779 +}#if libc-locale
1.780 +
1.781 +
1.782 +if($suite eq "pcts")
1.783 +{
1.784 + my $bldfile = $templateRoot."/group/bld.inf";
1.785 + my @pctsModules = GetCompiledModules($bldfile);
1.786 + @generatedModules = @pctsModules;
1.787 + DoGen("pcts",".exe");
1.788 +
1.789 + my @depDlls;
1.790 + my $dll;
1.791 +
1.792 +
1.793 + #copying the common dlls
1.794 + @depDlls =
1.795 + (
1.796 + "vsxlibapi.dll",
1.797 + "rttm.exe",
1.798 + "rtlibapi.dll",
1.799 + "vsxvlib.dll",
1.800 + "vsxgenlib.dll",
1.801 + "vsxtsetlib.dll",
1.802 + "vsxvport.dll",
1.803 + );
1.804 +
1.805 + if($install eq "yes")
1.806 + {
1.807 + my @saved = @dllList;
1.808 + @dllList = @depDlls;
1.809 + CopySharedDlls("pcts", \@depDlls);
1.810 + TransformXmls("pcts","shared");
1.811 + @dllList = @saved;
1.812 +
1.813 + #now copy the cfg files
1.814 + my $dst;
1.815 + my $srcDir = "/epoc32/winscw/c/data/tet/";
1.816 + my $file1 = $srcDir."tet_code";
1.817 + my $file2 = $srcDir."tetexec.cfg";
1.818 + foreach my $module(@generatedModules)
1.819 + {
1.820 + $dst = $ATSRoot."\\components\\pcts_".$module;
1.821 + $dst = $dst."\\General\\";
1.822 + copy($file1, $dst) or die "copy: $! $file1 $dst";
1.823 + copy($file2,$dst) or die "copy: $! $file2 $dst";
1.824 + }
1.825 + }
1.826 +
1.827 +
1.828 +
1.829 +
1.830 + my $dst;
1.831 + foreach my $module(@generatedModules)
1.832 + {
1.833 + my $file3 = "/epoc32/winscw/c/logs/tet/m.".$module;
1.834 +
1.835 + $dst = $ATSRoot."\\components\\pcts_".$module;
1.836 + $dst = $dst."\\General\\";
1.837 + copy($file3, $dst) or die "copy: $! $file3 $dst";
1.838 + }#module
1.839 +}
1.840 +
1.841 +
1.842 +
1.843 +$dontStrip = 0;
1.844 +
1.845 +if($suite eq "stdlibs" || $suite eq "all")
1.846 +{
1.847 + @generatedModules = ("tzlib");
1.848 + DoGen("libz", ".dll");
1.849 +
1.850 + @generatedModules = ("tlibcrypt");
1.851 + DoGen("libcrypt",".dll");
1.852 +
1.853 + @generatedModules = @libcModules;
1.854 + DoGen("libc",".dll");
1.855 + GenBackendTest();
1.856 +
1.857 + @generatedModules = ("twchar");
1.858 + CopyDeps("libc","twchar_helloworld.exe");
1.859 +
1.860 + @generatedModules = ("twopen");
1.861 + CopyDeps("libc","twpopenwritechild.exe");
1.862 + CopyDeps("libc","twpopenreadchild.exe");
1.863 +
1.864 +
1.865 + @generatedModules = @libdlModules;
1.866 + DoGen("libdl",".dll");
1.867 + CopyDeps("libdl","Dll1.dll");
1.868 + CopyDeps("libdl","Dll2.dll");
1.869 + CopyDeps("libdl","DependencyTestDll.dll");
1.870 +
1.871 + @generatedModules = @libmModules;
1.872 + DoGen("libm",".dll");
1.873 +
1.874 + $TDIR = "\\internal\\";
1.875 + @generatedModules = @pthreadModules;
1.876 + DoGen("libpthread",".dll");
1.877 + CopyDeps("libpthread","testharness.dll");
1.878 +
1.879 + CopyDatFiles();
1.880 +}
1.881 +
1.882 +if($install eq "yes")
1.883 +{
1.884 + foreach my $lib(@liblist)
1.885 + {
1.886 + #print "Transforming lib $lib\n";
1.887 + @generatedModules = GenGenModules($lib);
1.888 + my @oldList = @dllList;
1.889 + if($do_winscw)
1.890 + {
1.891 + @dllList = (@dllList, "wsdsoln.dll", "libestw32.dll");
1.892 + CopySharedDlls($lib,\@dllList,"winscw");
1.893 + TransformXmls($lib, "shared","winscw");
1.894 + }
1.895 + @dllList = @oldList;
1.896 + if($do_armv5)
1.897 + {
1.898 + CopySharedDlls($lib,\@dllList,"armv5");
1.899 + TransformXmls($lib, "shared","armv5");
1.900 + }
1.901 + }#FOREACH
1.902 +}#if install
1.903 +
1.904 +
1.905 +# Function added by Roshan G (Dec 4th 2007) - Get list of modules from bld.inf by recursively searching testapps folder
1.906 +sub recurse
1.907 +{
1.908 +
1.909 + my $path = shift @_;
1.910 + $path .= '/' if($path !~ /\/$/);
1.911 +
1.912 + ## print the directory being searched
1.913 + # print "Path : $path,\n";
1.914 +
1.915 + ## loop through the files contained in the directory
1.916 + for my $eachFile (glob($path.'*')) {
1.917 + # print "Entry : $eachFile\n";
1.918 + ## if the file is a directory
1.919 + if( -d $eachFile && basename($eachFile) ne "test_framework") {
1.920 + ## pass the directory to the routine ( recursion )
1.921 + recurse($eachFile);
1.922 + } else {
1.923 +
1.924 + ## print the file ... tabbed for readability
1.925 + #print "\t",$eachFile,"\n";
1.926 + if(basename($eachFile) eq "bld.inf")
1.927 + {
1.928 + #print "\t",$eachFile,"\n";
1.929 + push (@AllModuleList,GetCompiledModules($eachFile));
1.930 + }
1.931 + }
1.932 + }
1.933 + }
1.934 +#End of recurse - Dec 4th 2007
1.935 +
1.936 +#function to generate ModuleList for a compiled bld.inf
1.937 +sub GetCompiledModules($)
1.938 +{
1.939 + my $file = shift @_;
1.940 + my @moduleList;
1.941 +
1.942 +
1.943 + # Open input file
1.944 + open (INFILE, "<".$file ) || die ("DIED: Can not find $file!");
1.945 +
1.946 + while (<INFILE>)
1.947 + {
1.948 + if(/(.*)\.mmp/ && $1 !~ /^\s*\/\//)
1.949 + {
1.950 + if($_ !~ /\/\/Not for ATS/)
1.951 + {
1.952 + my $text = $1;
1.953 + $text =~ s/^\s*//;
1.954 + push @moduleList, $text;
1.955 + }
1.956 + }
1.957 + }
1.958 + close (INFILE);
1.959 + return @moduleList;
1.960 +}
1.961 +
1.962 +my @groupList;
1.963 +sub GetLtpModules()
1.964 +{
1.965 + my $prevDir = getcwd();
1.966 + my @rootList = ("kernel", "misc");
1.967 + my @totalgroupList;
1.968 + foreach my $node(@rootList)
1.969 + {
1.970 + chdir $ltpPath."/$node";
1.971 + @groupList = ();
1.972 + find(\&MakeGroupList, ".");
1.973 + @totalgroupList = (@totalgroupList, @groupList);
1.974 + }
1.975 + chdir $prevDir;
1.976 + return @totalgroupList;
1.977 +}
1.978 +
1.979 +sub GetstdexeModules()
1.980 +{
1.981 + my $prevDir = getcwd();
1.982 + my @fullList = ();
1.983 + foreach my $group(@stdexeList)
1.984 + {
1.985 + my $groupPath = $templateRoot."/testapps/".$group. "/";
1.986 + chdir $groupPath;
1.987 + @groupList = ();
1.988 + find(\&grovelAllMmpFiles, ".");
1.989 + chdir $prevDir;
1.990 + @fullList = (@fullList,@groupList);
1.991 + }
1.992 + return @fullList;
1.993 +}
1.994 +
1.995 +sub grovelAllMmpFiles()
1.996 +{
1.997 + if($_ =~ /(.*)\.mmp/ && ! ($_ =~ /manual/))
1.998 + {
1.999 + push @groupList, $1;#get name of module
1.1000 + }
1.1001 +}
1.1002 +
1.1003 +sub GetstdcppModules()
1.1004 +{
1.1005 + my $prevDir = getcwd();
1.1006 + my @rootList = ("auto");
1.1007 + my @totalgroupList;
1.1008 + foreach my $node(@rootList)
1.1009 + {
1.1010 + chdir $stdcppPath."/$node";
1.1011 + @groupList = ();
1.1012 + find(\&MakeGroupList, ".");
1.1013 + @totalgroupList = (@totalgroupList, @groupList);
1.1014 + }
1.1015 + chdir $prevDir;
1.1016 + my @newmodules = ("tiostreams", "tlocale", "tstl_1", "tstl_2", "tstl_3", "twiostreams");
1.1017 + @totalgroupList = (@totalgroupList, @newmodules);
1.1018 + foreach my $mod(@newmodules)
1.1019 + {
1.1020 + $cfglocation{$mod} = getcwd()."/testapps/bc/$mod/group"."\/$mod.cfg";
1.1021 + #print "$cfglocation{$mod} - $mod\n";
1.1022 + }
1.1023 + return @totalgroupList;
1.1024 +}
1.1025 +
1.1026 +sub GetTstdcppModules()
1.1027 +{
1.1028 + my $prevDir = getcwd();
1.1029 + #chdir $tstdcppPath;
1.1030 + @groupList = ();
1.1031 + find(\&grovelAllMmpFiles, ".");
1.1032 + chdir $prevDir;
1.1033 + return @groupList;
1.1034 +}
1.1035 +
1.1036 +sub MakeGroupList()
1.1037 +{
1.1038 + my $currentDir = $File::Find::dir;
1.1039 +
1.1040 + #print "Current dir:$currentDir\n";
1.1041 + if( $currentDir =~ /.*\/(.*)\/group/)
1.1042 + {
1.1043 + if($cfglocation{$1} eq "")
1.1044 + {
1.1045 + $cfglocation{$1} = getcwd()."\/$1.cfg";
1.1046 + push @groupList, $1;#get name of module
1.1047 + }#first time in group
1.1048 + }#group found
1.1049 +}#subrtn end
1.1050 +
1.1051 +
1.1052 +#function that generates the ATS setup
1.1053 +sub DoGen($$)
1.1054 +{
1.1055 + my $libname = shift @_;
1.1056 + my $ext = shift @_;
1.1057 + mkdir $ATSRoot;
1.1058 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.1059 +
1.1060 +
1.1061 + GenDirs($libname);
1.1062 + my $module;
1.1063 + foreach my $listed(@generatedModules)
1.1064 + {
1.1065 + my @filesToProcess =
1.1066 + (
1.1067 + "LibXXX_ATSTemplateXXX_module_blr_hw_component.xml",
1.1068 + "LibXXX_ATSTemplateXXX_module_blr_winsspd_component.xml",
1.1069 + "testframework.ini",
1.1070 + );
1.1071 + if(rindex($noXmlsGenList, $libname) != -1 )
1.1072 + {
1.1073 + @filesToProcess = ("testframework.ini",);
1.1074 + }
1.1075 +
1.1076 + if($ext eq ".exe")
1.1077 + {
1.1078 + GenExeXmls($listed,$libname);
1.1079 + }
1.1080 + else
1.1081 + {
1.1082 + #just in case no xml file was supplied
1.1083 +
1.1084 + my $ref = \@filesToProcess;
1.1085 + GenXmls($libname, $listed,$ref);
1.1086 + }
1.1087 + }#foreach
1.1088 +
1.1089 + CopyDlls($libname,$ext);
1.1090 + #copy the provided cfg, ini and xmls
1.1091 + if($libname eq "opts")
1.1092 + {
1.1093 + CopyOptsCfg($libname);
1.1094 + }
1.1095 + elsif($libname eq "ltp" || $libname eq "lsb" || $libname eq "glib")
1.1096 + {
1.1097 + #copy latter and dont copy respectively for ltp and lsb
1.1098 + }
1.1099 + else
1.1100 + {
1.1101 + CopyCfgIniXmls($libname);
1.1102 + }
1.1103 +}
1.1104 +
1.1105 +sub CopyCfgIniXmls()
1.1106 +{
1.1107 + my $libname = pop @_;
1.1108 +
1.1109 + my $libRoot = $templateRoot;
1.1110 + $libRoot =~ /(.*)internal.*/;
1.1111 + $libRoot = $1;
1.1112 +
1.1113 +
1.1114 + my $module;
1.1115 + my $src;
1.1116 + my $dst;
1.1117 +
1.1118 + foreach my $listed(@generatedModules)
1.1119 + {
1.1120 + my $dirname = $listed;
1.1121 + $dirname =~ s/test/t/;
1.1122 + $module = StripModulePrefix($listed);
1.1123 +
1.1124 + $src = $libRoot.$libname.$TDIR.$dirname."\\group\\";
1.1125 +
1.1126 + my $xmlCopied = "0";
1.1127 + my @globpattern = ("*.ini", "*.xml","*.cfg");
1.1128 + foreach my $pat(@globpattern)
1.1129 + {
1.1130 + $dst = $ATSRoot."\\components\\".$libname."_".$module;
1.1131 + if($pat ne "*.xml")
1.1132 + {
1.1133 + $dst = $dst."\\General\\";
1.1134 + }
1.1135 + else
1.1136 + {
1.1137 + $dst = $dst."\\";
1.1138 + }
1.1139 + my @filesFound = glob($src."\\$pat");
1.1140 + if(scalar @filesFound eq "0")
1.1141 + {
1.1142 + #print "No files found for module $module $pat!\n";
1.1143 + #print $src;
1.1144 + }
1.1145 +
1.1146 + #handcoded
1.1147 + if($pat eq "*.cfg" && $xmlCopied eq "0")#rename only if xml not copied
1.1148 + {
1.1149 + if(scalar @filesFound > 1)
1.1150 + {
1.1151 + print "Multiple cfg files found. Copying all!\n";
1.1152 + }
1.1153 + else
1.1154 + {
1.1155 + $dst = $dst.$listed.".cfg";
1.1156 + }
1.1157 + }
1.1158 + elsif($pat eq "*.xml")
1.1159 + {
1.1160 + my $folder = $dst;
1.1161 + foreach my $from (@filesFound)
1.1162 + {
1.1163 + if($from =~ /winscw_component/)
1.1164 + {
1.1165 + $dst = $folder.$libname."_".$module."_module_blr_winscw_component.xml";
1.1166 + copy($from, $dst) or die "DIED: copy: $! $from $dst";
1.1167 + $xmlCopied = "1";
1.1168 + }
1.1169 + elsif($from =~ /winsspd_component/)
1.1170 + {
1.1171 + $dst = $folder.$libname."_".$module."_module_blr_winsspd_component.xml";
1.1172 + copy($from, $dst) or die "DIED: copy: $! $from $dst";
1.1173 + $xmlCopied = "1";
1.1174 + }
1.1175 + elsif($from =~ /hw_component/)
1.1176 + {
1.1177 + $dst = $folder.$libname."_".$module."_module_blr_hw_component.xml";
1.1178 + copy($from, $dst) or die "DIED: copy: $! $from $dst";
1.1179 + $xmlCopied = "1";
1.1180 + }
1.1181 + }#examine individually
1.1182 + if(scalar @filesFound > 2)
1.1183 + {
1.1184 + #print "Multiple xml files found!!!\n";
1.1185 + }
1.1186 + @filesFound = ();
1.1187 + }
1.1188 +
1.1189 +
1.1190 + foreach my $from (@filesFound)
1.1191 + {
1.1192 + copy($from, $dst) or die "DIED: copy: $! $from $dst";
1.1193 + }#copy individually
1.1194 + }#globpattern
1.1195 + }#module
1.1196 +}#fn
1.1197 +
1.1198 +#copy the cfg files for the opts test suite
1.1199 +sub CopyOptsCfg()
1.1200 +{
1.1201 + my $libname = pop @_;
1.1202 +
1.1203 + my $libRoot = $optsGroupPath."\\";
1.1204 + my $module;
1.1205 + my $src;
1.1206 + my $dst;
1.1207 +
1.1208 + foreach $module(@generatedModules)
1.1209 + {
1.1210 + $src = $libRoot.$module."\.cfg";
1.1211 + $dst = $ATSRoot."\\components\\".$libname."_".$module;
1.1212 + $dst = $dst."\\General\\";
1.1213 + copy($src, $dst) or warn "copy: $! $src $dst";
1.1214 + }#module
1.1215 +}#fn
1.1216 +
1.1217 +#copy the lsb cfg files
1.1218 +sub CopyLsbCfg()
1.1219 +{
1.1220 + my $libname = pop @_;
1.1221 +
1.1222 + my $module;
1.1223 +
1.1224 + my $dst;
1.1225 +
1.1226 + my $srcDir = $templateRoot."/ts/lsbsuites/lsblib/data/";
1.1227 +
1.1228 + foreach $module(@generatedModules)
1.1229 + {
1.1230 + my $file1 = $srcDir."tet_code.cfg";
1.1231 + my $file2 = $srcDir."tetexec.cfg";
1.1232 + $dst = $ATSRoot."\\components\\".$libname."_".$module;
1.1233 + $dst = $dst."\\General\\";
1.1234 + copy($file1, $dst) or die "copy: $! $file1 $dst";
1.1235 + copy($file2, $dst) or die "copy: $! $file2 $dst";
1.1236 + }#module
1.1237 +}#fn
1.1238 +
1.1239 +
1.1240 +#copy the ltp cfg files
1.1241 +sub CopyLtpCfg($)
1.1242 +{
1.1243 + my $libname = pop @_;
1.1244 +
1.1245 + my $module;
1.1246 + my $src;
1.1247 + my $dst;
1.1248 +
1.1249 + foreach $module(@generatedModules)
1.1250 + {
1.1251 + $src = $cfglocation{$module};
1.1252 + $dst = $ATSRoot."\\components\\".$libname."_".$module;
1.1253 + $dst = $dst."\\General\\";
1.1254 + copy($src, $dst) or warn "copy: $! $src $dst";
1.1255 + }#module
1.1256 +}#fn
1.1257 +
1.1258 +
1.1259 +sub CopyDlls($$)
1.1260 +{
1.1261 + my $libname = shift @_;
1.1262 + my $suffix = shift @_;
1.1263 +
1.1264 + my $module;
1.1265 + my $src;
1.1266 + my $dst;
1.1267 +
1.1268 +
1.1269 + foreach $module(@generatedModules)
1.1270 + {
1.1271 + if($do_winscw == 1)
1.1272 + {
1.1273 + $src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$module.$suffix;
1.1274 + $dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
1.1275 + $dst = $dst."\\winscw_udeb\\";
1.1276 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.1277 + }
1.1278 + if($do_armv5 == 1)
1.1279 + {
1.1280 + $src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$module.$suffix;
1.1281 + $dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
1.1282 + $dst = $dst."\\armv5_urel\\";
1.1283 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.1284 + }
1.1285 + }#foreach
1.1286 +}
1.1287 +#fn to generate the session file
1.1288 +sub GenerateSessionFile($$$$)
1.1289 +{
1.1290 + my $libname = shift @_;
1.1291 + my $target = shift @_;
1.1292 + my $name = shift @_;
1.1293 + my $listptr = shift @_;
1.1294 + my $outdir = $ATSRoot;
1.1295 + my $infile = $templateRoot."\\testsession.xml";
1.1296 + chdir $outdir || die("DIED: Unable to chdir!");
1.1297 + #open INFILE, $infile || die ("DIED: Can not open input file $infile");
1.1298 + my $prefix = $name."_".$target;
1.1299 + if($sdkversion ne "")
1.1300 + {
1.1301 + $prefix = $prefix."_".$sdkversion;
1.1302 + }
1.1303 +
1.1304 + open OUTFILE, ">".$outdir."\\".$prefix."_testsession.xml" || die ("DIED: Can not open output file");
1.1305 + my $line;
1.1306 + my $snippet = $target;
1.1307 + if($target ne "winscw" && $target ne "winsspd")
1.1308 + {
1.1309 + $snippet = "hw";
1.1310 + }
1.1311 +
1.1312 +print OUTFILE "<?xml version=\"1.0\"?>\n";
1.1313 +print OUTFILE "<testsession>\n";
1.1314 +#print OUTFILE "<symbian-version>$libname"."_".$snippet."_TestDrop_blr_component</symbian-version>\n";
1.1315 +print OUTFILE "<symbian-version>Boost_combined_test_session</symbian-version>\n";
1.1316 +print OUTFILE "<testitem>at</testitem>\n";
1.1317 +print OUTFILE "<resultfile>ATSOUTPUT\\".$prefix."_testsession_results.xml</resultfile>\n";
1.1318 +if($sendEmail eq "yes")
1.1319 +{
1.1320 +print OUTFILE <<EOEmailNote;
1.1321 +<email_notification>
1.1322 +<include_test_cases>false</include_test_cases>
1.1323 +<message_file>C:\\\\lm.txt </message_file>
1.1324 +<send_after_rerun>false</send_after_rerun>
1.1325 +<subject>Boost $snippet testreport</subject>
1.1326 +<from>swbuild\@nokia.com</from>
1.1327 +<to>ajith.narayanan\@nokia.com</to>
1.1328 +<to>hrishikesh.brahmakal\@nokia.com</to>
1.1329 +<to>santosh.ks\@nokia.com</to>
1.1330 +<to>shilpa.sharma\@nokia.com</to>
1.1331 +<to>kasthuri.n-s\@nokia.com</to>
1.1332 +<to>hema.1.s\@nokia.com</to>
1.1333 +<to>vineetha.hari-pai\@nokia.com</to>
1.1334 +<to>madhusudhan.p.reddy\@nokia.com</to>
1.1335 +</email_notification>
1.1336 +EOEmailNote
1.1337 +}
1.1338 +
1.1339 + if($libname ne "combined")
1.1340 + {
1.1341 + AddAssumedIncludes($libname,$snippet);
1.1342 + }
1.1343 + else
1.1344 + {
1.1345 + if($listptr ne "")
1.1346 + {
1.1347 + AddFileList($libname,$listptr);
1.1348 + }
1.1349 + else
1.1350 + {
1.1351 + AddActualIncludes($libname);
1.1352 + }
1.1353 + }
1.1354 +
1.1355 + print OUTFILE "</testsession>\n";
1.1356 +
1.1357 + close(OUTFILE);
1.1358 + #close(INFILE);
1.1359 +}#fn
1.1360 +
1.1361 +
1.1362 +sub AddAssumedIncludes($$)
1.1363 +{
1.1364 + my $libname = shift @_;
1.1365 + my $snippet = shift @_;
1.1366 +
1.1367 + my $APITest;
1.1368 + foreach my $listed(@generatedModules)
1.1369 + {
1.1370 + $APITest = StripModulePrefix($listed);
1.1371 + print OUTFILE "\n";
1.1372 + print OUTFILE " <!--Inclusion of $target xml for $APITest -->\n";
1.1373 + print OUTFILE " <component>\n";
1.1374 + print OUTFILE " <factory>Symbian</factory>\n";
1.1375 + if($libname eq "all")
1.1376 + {
1.1377 + print OUTFILE " <testplan>ATSINPUT\\components\\$listed\\$listed"."_module_blr_".$snippet."_component.xml</testplan>\n";
1.1378 + }
1.1379 + else
1.1380 + {
1.1381 + print OUTFILE " <testplan>ATSINPUT\\components\\$libname"."_"."$APITest\\$libname"."_$APITest"."_module_blr_".$snippet."_component.xml</testplan>\n";
1.1382 + }
1.1383 + if($target eq "winscw")
1.1384 + {
1.1385 + print OUTFILE " <target hardware=\"winscw\" build=\"udeb\" />\n";
1.1386 + }
1.1387 + elsif($target eq "winsspd")
1.1388 + {
1.1389 + print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n";
1.1390 + }
1.1391 + else
1.1392 + {
1.1393 + print OUTFILE " <target hardware=\"$target\" build=\"urel\" />\n";
1.1394 + }
1.1395 + print OUTFILE " </component>\n";
1.1396 + print OUTFILE "\n";
1.1397 + }#foreach @generatedModules
1.1398 +}
1.1399 +
1.1400 +
1.1401 +sub AddFileList($$)
1.1402 +{
1.1403 + my $libname = shift @_;
1.1404 + my $listptr = shift @_;
1.1405 + my @componentfiles = @$listptr;
1.1406 +
1.1407 + foreach my $listed(@componentfiles)
1.1408 + {
1.1409 + print OUTFILE "\n";
1.1410 + print OUTFILE " <!--Inclusion of $target xml -->\n";
1.1411 + print OUTFILE " <component>\n";
1.1412 + print OUTFILE " <factory>Symbian</factory>\n";
1.1413 + print OUTFILE " <testplan>ATSINPUT\\components\\$listed</testplan>\n";
1.1414 + if($target eq "winscw")
1.1415 + {
1.1416 + print OUTFILE " <target hardware=\"winscw\" build=\"udeb\" />\n";
1.1417 + }
1.1418 + elsif($target eq "winsspd")
1.1419 + {
1.1420 + print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n";
1.1421 + }
1.1422 + else
1.1423 + {
1.1424 + print OUTFILE " <target hardware=\"$target\" build=\"urel\" />\n";
1.1425 + }
1.1426 + print OUTFILE " </component>\n";
1.1427 + print OUTFILE "\n";
1.1428 + }#foreach @componentfiles
1.1429 +}
1.1430 +
1.1431 +
1.1432 +
1.1433 +sub GetSslXmls()
1.1434 +{
1.1435 + my $APITest;
1.1436 + my @componentfiles;
1.1437 +
1.1438 + my @emulatorfiles =
1.1439 + (
1.1440 + "libssl_ssltest\\libssl_blr_winsspd_component.xml",
1.1441 + "libcrypto_crypto_test\\libcrypto_blr_winsspd_component.xml",
1.1442 + "libcrypto_openssl\\libcrypto_topenssltestss_blr_winsspd_component.xml",
1.1443 + "libcrypto_openssl\\libcrypto_topenssltestverify_blr_winsspd_component.xml",
1.1444 + "libcrypto_openssl\\libcrypto_topenssltestenc_blr_winsspd_component.xml",
1.1445 + "libcrypto_openssl\\libcrypto_topenssltestgen_blr_winsspd_component.xml",
1.1446 + "libcrypto_openssl\\libcrypto_topenssltpkcs7_blr_winsspd_component.xml",
1.1447 + "libcrypto_openssl\\libcrypto_topenssltpkcs7d_blr_winsspd_component.xml",
1.1448 + "libcrypto_openssl\\libcrypto_topenssltreq_blr_winsspd_component.xml",
1.1449 + "libcrypto_openssl\\libcrypto_topenssltreq2_blr_winsspd_component.xml",
1.1450 + "libcrypto_openssl\\libcrypto_topenssltrsa_blr_winsspd_component.xml",
1.1451 + "libcrypto_openssl\\libcrypto_topenssltcrl_blr_winsspd_component.xml",
1.1452 + "libcrypto_openssl\\libcrypto_topenssltsid_blr_winsspd_component.xml",
1.1453 + "libcrypto_openssl\\libcrypto_topenssltx509_blr_winsspd_component.xml",
1.1454 + "libcrypto_openssl\\libcrypto_topenssltx5091_blr_winsspd_component.xml",
1.1455 + "libcrypto_openssl\\libcrypto_topenssltx5092_blr_winsspd_component.xml",
1.1456 + );
1.1457 +
1.1458 + my @hwfiles =
1.1459 + (
1.1460 + "libcrypto_openssl\\libcrypto_topenssltestss_blr_hw_component.xml",
1.1461 + "libcrypto_openssl\\libcrypto_topenssltestverify_blr_hw_component.xml",
1.1462 + "libcrypto_openssl\\libcrypto_topenssltestenc_blr_hw_component.xml",
1.1463 + "libcrypto_openssl\\libcrypto_topenssltestgen_blr_hw_component.xml",
1.1464 + "libcrypto_openssl\\libcrypto_topenssltpkcs7_blr_hw_component.xml",
1.1465 + "libcrypto_openssl\\libcrypto_topenssltpkcs7d_blr_hw_component.xml",
1.1466 + "libcrypto_openssl\\libcrypto_topenssltreq_blr_hw_component.xml",
1.1467 + "libcrypto_openssl\\libcrypto_topenssltreq2_blr_hw_component.xml",
1.1468 + "libcrypto_openssl\\libcrypto_topenssltrsa_blr_hw_component.xml",
1.1469 + "libcrypto_openssl\\libcrypto_topenssltcrl_blr_hw_component.xml",
1.1470 + "libcrypto_openssl\\libcrypto_topenssltsid_blr_hw_component.xml",
1.1471 + "libcrypto_openssl\\libcrypto_topenssltx509_blr_hw_component.xml",
1.1472 + "libcrypto_openssl\\libcrypto_topenssltx5091_blr_hw_component.xml",
1.1473 + "libcrypto_openssl\\libcrypto_topenssltx5092_blr_hw_component.xml",
1.1474 + "libssl_ssltest\\libssl_blr_hw_component.xml",
1.1475 + "libcrypto_crypto_test\\libcrypto_blr_hw_component.xml",
1.1476 + );
1.1477 + if($target eq "winsspd" || $target eq "winscw")
1.1478 + {
1.1479 + @componentfiles = @emulatorfiles;
1.1480 + }
1.1481 + else
1.1482 + {
1.1483 + @componentfiles = @hwfiles;
1.1484 + }
1.1485 + return @componentfiles;
1.1486 +}
1.1487 +
1.1488 +
1.1489 +
1.1490 +sub AddActualIncludes($)
1.1491 +{
1.1492 + my $libname = shift @_;
1.1493 + find(\&XmlComponentFiles, ".");
1.1494 + my $key;
1.1495 + my $value;
1.1496 + while(($key, $value) = each(%DirHash))
1.1497 + {
1.1498 + $value =~ s/\//\\/g;
1.1499 + print OUTFILE "\n";
1.1500 + print OUTFILE " <!--Inclusion of dynamically found $target xml -->\n";
1.1501 + print OUTFILE " <component>\n";
1.1502 + print OUTFILE " <factory>Symbian</factory>\n";
1.1503 + print OUTFILE " <testplan>$value</testplan>\n";
1.1504 + if($target eq "winscw")
1.1505 + {
1.1506 + print OUTFILE " <target hardware=\"winscw\" build=\"udeb\" />\n";
1.1507 + }
1.1508 + elsif($target eq "winsspd")
1.1509 + {
1.1510 + print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n";
1.1511 + }
1.1512 + else
1.1513 + {
1.1514 + print OUTFILE " <target hardware=\"$target\" build=\"urel\" />\n";
1.1515 + }
1.1516 + print OUTFILE " </component>\n";
1.1517 + print OUTFILE "\n";
1.1518 +
1.1519 + }#while
1.1520 +}#fn
1.1521 +
1.1522 +sub XmlComponentFiles()
1.1523 +{
1.1524 + if($_ !~ /\.xml/ || $_ =~ /manual/)
1.1525 + {
1.1526 + return;
1.1527 + }
1.1528 + #print "Processing $_\n";
1.1529 + my $dir = getcwd();
1.1530 + if($dir =~ /.*(ATSINPUT.*)/)
1.1531 + {
1.1532 + $dir = $1;
1.1533 + if($dir !~ /.*components.*/)
1.1534 + {
1.1535 + return;
1.1536 + }
1.1537 + #print "The dir is $dir\n";
1.1538 + }
1.1539 + else
1.1540 + {
1.1541 + return;
1.1542 + }
1.1543 +
1.1544 + if($target eq "winsspd" )
1.1545 + {
1.1546 + if($_ =~ /winsspd/)
1.1547 + {
1.1548 + #print "Adding $target file $_ for $dir\n";
1.1549 + $DirHash{$dir} = $dir."/".$_;
1.1550 + }
1.1551 + }
1.1552 + elsif($target eq "winscw")
1.1553 + {
1.1554 + if($_ =~ /winscw/)
1.1555 + {
1.1556 + #print "Adding $target file $_ for $dir\n";
1.1557 + $DirHash{$dir} = $dir."/".$_;
1.1558 + }
1.1559 + }
1.1560 + elsif($_ =~ /$target/)
1.1561 + {
1.1562 + #print "$_ matched $target \n";
1.1563 + #print "Adding $target file $_ for $dir\n";
1.1564 + $DirHash{$dir} = $dir."/".$_;
1.1565 + }
1.1566 + elsif($_ =~/hw/)
1.1567 + {
1.1568 + #print "$_ matched hw";
1.1569 + if(scalar $DirHash{$dir} == 0)
1.1570 + {
1.1571 + #print "Adding hw file $_ for $dir\n";
1.1572 + $DirHash{$dir} = $dir."/".$_;
1.1573 + #print " and added\n"
1.1574 + }
1.1575 + else
1.1576 + {
1.1577 + #print " and not added\n";
1.1578 + }
1.1579 + }
1.1580 +}
1.1581 +
1.1582 +
1.1583 +
1.1584 +sub emptyArray()
1.1585 +{
1.1586 + @generatedModules = ();
1.1587 +}
1.1588 +
1.1589 +sub GenDirs($)
1.1590 +{
1.1591 + my $libname = shift @_;
1.1592 + my $dirname;
1.1593 + foreach my $module(@generatedModules)
1.1594 + {
1.1595 + $dirname = StripModulePrefix($module);
1.1596 + my $relroot = $ATSRoot."\\components\\$libname"."_$dirname";
1.1597 + mkdir $relroot || die("DIED: unable to create dir $dirname\n");
1.1598 + mkdir $relroot."\\General" || die("DIED: unable to create dir $relroot\\General\n");
1.1599 + if($do_armv5 == 1)
1.1600 + {
1.1601 + mkdir $relroot."\\armv5_urel" || die("DIED: unable to create dir $relroot\\armv5_urel\n");
1.1602 + }
1.1603 + if($do_winscw == 1)
1.1604 + {
1.1605 + mkdir $relroot."\\winscw_udeb" || die("DIED: unable to create dir $relroot\\winscw_udeb\n");
1.1606 + }
1.1607 + }
1.1608 +}
1.1609 +
1.1610 +sub GenXmls($$$)
1.1611 +{
1.1612 + my $libname = shift @_;
1.1613 + my $listedName = shift @_;
1.1614 + my $bref = shift @_;
1.1615 + my @filesToProcess = @$bref;
1.1616 +
1.1617 + #strip leading test and t names from module
1.1618 + my $moduleName = StripModulePrefix($listedName);
1.1619 +
1.1620 + my $toPath = $ATSRoot."\\components\\$libname"."_$moduleName\\";
1.1621 +
1.1622 +
1.1623 + my $dst;
1.1624 + my $src;
1.1625 + foreach $src(@filesToProcess)
1.1626 + {
1.1627 + $dst = $src;
1.1628 + $dst =~ s/ATSTemplateXXX/$moduleName/;
1.1629 + $dst =~ s/LibXXX/$libname/;
1.1630 +
1.1631 +
1.1632 + if($src eq "testframework.ini")
1.1633 + {
1.1634 + $dst = $toPath."General\\".$dst;
1.1635 + }
1.1636 + else
1.1637 + {
1.1638 + $dst = $toPath.$dst;
1.1639 + }
1.1640 + copy($templateRoot."\\".$src, $dst) || die("DIED: Unable to copy $src to $dst\n");
1.1641 + ExpandModuleMacros($dst, $libname, $listedName);
1.1642 + }#foreach file
1.1643 +}
1.1644 +
1.1645 +
1.1646 +sub GenExeXmls()
1.1647 +{
1.1648 + my $moduleName = shift @_;
1.1649 + my $libname = shift @_;
1.1650 +
1.1651 + my $toPath = $ATSRoot."\\components\\$libname"."_$moduleName\\";
1.1652 + my @filesToProcess =
1.1653 + (
1.1654 + "LibXXX_ATSTemplateXXX_exemodule_blr_hw_component.xml",
1.1655 + "LibXXX_ATSTemplateXXX_exemodule_blr_winsspd_component.xml",
1.1656 + );
1.1657 +
1.1658 + my $dst;
1.1659 + my $src;
1.1660 + foreach $src(@filesToProcess)
1.1661 + {
1.1662 + $dst = $src;
1.1663 + $dst =~ s/ATSTemplateXXX/$moduleName/;
1.1664 + $dst =~ s/LibXXX/$libname/;
1.1665 + $dst =~ s/_exemodule_/_module_/;
1.1666 + $dst = $toPath.$dst;
1.1667 + copy($templateRoot."\\".$src, $dst) || die("DIED: Unable to copy to $dst\n");
1.1668 + ExpandModuleMacros($dst, $libname, $moduleName);
1.1669 + }#foreach file
1.1670 +}
1.1671 +
1.1672 +#function to expand the macros existing in a file
1.1673 +#file is replaced by new version
1.1674 +#args are relativePath. filename and $moduleName
1.1675 +sub ExpandModuleMacros()
1.1676 +{
1.1677 + # Take module name
1.1678 + my $moduleName = pop @_;
1.1679 + my $libname = pop @_;
1.1680 + my $filename = pop @_;
1.1681 +
1.1682 + my $MODULENAME = $moduleName;
1.1683 + $MODULENAME =~ tr/[a-z]/[A-Z]/;
1.1684 +
1.1685 + # Open input file
1.1686 + open (INFILE, $filename ) || die ("DIED: Can not find $filename");
1.1687 +
1.1688 + #Open output file
1.1689 + my $newOutput = $filename."new";
1.1690 + open (OUTFILE, ">".$newOutput ) || die ("DIED: Can not open $newOutput");
1.1691 +
1.1692 + # Replace text in files
1.1693 + while (<INFILE>)
1.1694 + {
1.1695 + s/ATSTemplateXXX/$moduleName/g;
1.1696 + s/LibXXX/$libname/g;
1.1697 + print OUTFILE $_;
1.1698 + }
1.1699 +
1.1700 + # Close filehandles
1.1701 + close (INFILE);
1.1702 + close (OUTFILE);
1.1703 +
1.1704 + # Rename result file
1.1705 + unlink $filename;
1.1706 + rename $newOutput,$filename;
1.1707 +}
1.1708 +
1.1709 +
1.1710 +
1.1711 +sub CopyDeps($$)
1.1712 +{
1.1713 + my $libname = shift @_;
1.1714 + my $copyDll = shift @_;
1.1715 + my $src;
1.1716 + my $dst;
1.1717 + foreach my $listed(@generatedModules)
1.1718 + {
1.1719 + my $module = StripModulePrefix($listed);
1.1720 + if($do_winscw == 1)
1.1721 + {
1.1722 + $src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
1.1723 + $dst = $ATSRoot."\\components\\$libname"."_$module";
1.1724 + $dst = $dst."\\winscw_udeb\\";
1.1725 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.1726 + }
1.1727 + if($do_armv5 == 1)
1.1728 + {
1.1729 + $src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
1.1730 + $dst = $ATSRoot."\\components\\$libname"."_$module";
1.1731 + $dst = $dst."\\armv5_urel\\";
1.1732 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.1733 + }
1.1734 + }#foreach
1.1735 +}#fn
1.1736 +
1.1737 +#dat file copy
1.1738 +sub CopyDatFiles()
1.1739 +{
1.1740 + my $libRoot = $templateRoot;
1.1741 + $libRoot =~ /(.*)internal.*/;
1.1742 + $libRoot = $1;
1.1743 +
1.1744 + my @list = (
1.1745 + ["libcrypt", "tlibcrypt", "group/Test_Data.dat"],
1.1746 + ["libc", "tnetdb", "data/services.txt"],
1.1747 + ["libc", "tstring", "data/locales.txt"],
1.1748 + ["libc", "libc_loc_blr", "data/locales.txt"],
1.1749 + ["libz", "tzlib", "data/*.*"],
1.1750 + ["libc", "tlink", "data/*.*"],
1.1751 + ["libc", "tmmap", "data/*.*"],
1.1752 + );
1.1753 +
1.1754 + my $libname;
1.1755 + my $dirname;
1.1756 + my $glob;
1.1757 + foreach my $ref(@list)
1.1758 + {
1.1759 + my @inarr = @$ref;
1.1760 + ($libname, $dirname, $glob) = @inarr;
1.1761 + my $modulename = StripModulePrefix($dirname);
1.1762 + my $src = "$libRoot/$libname/internal/testapps/$dirname/$glob";
1.1763 + my $dst = $ATSRoot."\\components\\$libname"."_"."$modulename\\General\\";
1.1764 + if($dirname eq "libc_loc_blr")
1.1765 + {
1.1766 + $src = "$libRoot/libc/src/locales.txt";
1.1767 + }
1.1768 + my @filesFound = glob($src);
1.1769 + if(scalar @filesFound == 0)
1.1770 + {
1.1771 + die("DIED: no Dat file found to copy!");
1.1772 + }
1.1773 + foreach my $file(@filesFound)
1.1774 + {
1.1775 + copy($file, $dst) || die("DIED: unable to copy $file to $dst");
1.1776 + }
1.1777 + }#ref processing
1.1778 +}#fn
1.1779 +
1.1780 +
1.1781 +#glib dat file copy
1.1782 +sub CopyArbitDatFiles($$)
1.1783 +{
1.1784 +
1.1785 + my $libname = shift @_;
1.1786 + my $refArr = shift @_;
1.1787 + my @list = @$refArr;
1.1788 +
1.1789 +
1.1790 + my $fname;
1.1791 + my $modulename;
1.1792 + my $location;
1.1793 + my $atsDst;
1.1794 + my $targetDst;
1.1795 +
1.1796 + #now copy the files appropriately
1.1797 + foreach my $ref(@list)
1.1798 + {
1.1799 + my @inarr = @$ref;
1.1800 + ($fname, $modulename, $location, $atsDst, $targetDst) = @inarr;
1.1801 + #print "[$fname, $modulename, $location, $atsDst, $targetDst]\n";
1.1802 + if($location =~ /(.*)\.\.(.*)/)
1.1803 + {
1.1804 + $location = GetPathPrefix().$2;
1.1805 + }
1.1806 + else
1.1807 + {
1.1808 + $location = $rootDrive.$location;
1.1809 + }
1.1810 + my $src = $location.$fname;
1.1811 + my $dst = $ATSRoot."\\components\\$libname"."_".$modulename.$atsDst;
1.1812 + if($libname eq "")
1.1813 + {
1.1814 + $dst = $ATSRoot."\\components\\".$modulename.$atsDst;
1.1815 + #print "$dst CHANGED!\n"
1.1816 + }
1.1817 +
1.1818 + my @filesFound = glob($src);
1.1819 + if(scalar @filesFound == 0)
1.1820 + {
1.1821 + die("DIED: no Dat file $src found to copy!");
1.1822 + }
1.1823 + foreach my $file(@filesFound)
1.1824 + {
1.1825 + copy($file, $dst) || die("DIED: unable to copy $file to $dst");
1.1826 + }
1.1827 +
1.1828 + if($targetDst ne "")
1.1829 + {
1.1830 + my @filesToChange = ();
1.1831 + if($atsDst =~ "armv5")
1.1832 + {
1.1833 + #armv5 component file
1.1834 + unshift @filesToChange, $libname."_".$modulename."_module_blr_hw_component.xml";
1.1835 +
1.1836 + }
1.1837 + elsif($atsDst =~ "winscw")
1.1838 + {
1.1839 + #winscw component file
1.1840 + unshift @filesToChange, $libname."_".$modulename."_module_blr_winsspd_component.xml";
1.1841 + }
1.1842 + else
1.1843 + {
1.1844 + #add entry to both xmls
1.1845 + unshift @filesToChange, $libname."_".$modulename."_module_blr_hw_component.xml";
1.1846 + unshift @filesToChange, $libname."_".$modulename."_module_blr_winsspd_component.xml";
1.1847 + }
1.1848 + foreach my $file(@filesToChange)
1.1849 + {
1.1850 + $src = $ATSRoot."/components/".$libname."_"."$modulename/".$file;
1.1851 + ModifyXml($src,$libname,$fname,$atsDst,$targetDst);
1.1852 + }
1.1853 + }#updating the xmls
1.1854 +
1.1855 + }#ref processing
1.1856 +
1.1857 +
1.1858 +}#fn
1.1859 +
1.1860 +sub ModifyXml($$$$$)
1.1861 +{
1.1862 + my $filename = shift @_;
1.1863 + my $lib = shift @_;
1.1864 + my $fname = shift @_;
1.1865 + my $atsDst = shift @_;
1.1866 + my $targetDst = shift @_;
1.1867 +
1.1868 +
1.1869 + #printf("Modifying $filename with lib= $lib fname= $fname atsDst = $atsDst targetDst = $targetDst\n");
1.1870 +
1.1871 + # Open input file
1.1872 + open (INFILE, $filename ) || die ("Can not find $filename");
1.1873 +
1.1874 + #Open output file
1.1875 + my $newOutput = $filename."new";
1.1876 + open (OUTFILE, ">".$newOutput ) || die ("Can not open $newOutput");
1.1877 +
1.1878 +
1.1879 + # Replace text in files
1.1880 + while (<INFILE>)
1.1881 + {
1.1882 + if(/\<stif\>/ || /\<execute\>/)
1.1883 + {
1.1884 + if(/\<stif\>/)
1.1885 + {
1.1886 + print OUTFILE "\<stif\>\n";
1.1887 + }
1.1888 + else
1.1889 + {
1.1890 + print OUTFILE "\<execute\>\n";
1.1891 + }
1.1892 + my $type = "data";
1.1893 + if($atsDst !~ "General")
1.1894 + {
1.1895 + $type = "binary";
1.1896 + }
1.1897 + print OUTFILE <<EObinary;
1.1898 +
1.1899 + <install type=\"$type\">
1.1900 + <src>$fname</src>
1.1901 + <dst>$targetDst\\$fname</dst>
1.1902 + </install>
1.1903 +EObinary
1.1904 + }#stif or execute tag found
1.1905 + else
1.1906 + {
1.1907 + print OUTFILE $_;
1.1908 + }
1.1909 + }#while
1.1910 + # Close filehandles
1.1911 + close (INFILE);
1.1912 + close (OUTFILE);
1.1913 +
1.1914 + # Rename result file
1.1915 + unlink $filename;
1.1916 + rename $newOutput,$filename;
1.1917 +
1.1918 +}#fn
1.1919 +sub GenGenModules($)
1.1920 +{
1.1921 + my $libname = shift @_;
1.1922 +
1.1923 +
1.1924 + my $src = $ATSRoot."/components/";
1.1925 + my @fileList = ();
1.1926 + opendir(DIRHANDLE, "$src") || die "Cannot opendir $src";
1.1927 + foreach my $name (readdir(DIRHANDLE))
1.1928 + {
1.1929 + if($name =~ /^$libname/)
1.1930 + {
1.1931 + if($libname ne "libc" || $name !~ /^libcrypt/)
1.1932 + {
1.1933 + $name =~ s/^$libname//;
1.1934 + $name =~ s/^_//;
1.1935 + unshift @fileList, $name;
1.1936 + }#excluded libcrypt from libc list
1.1937 + }#libname match
1.1938 + }#foreach
1.1939 + closedir(DIRHANDLE);
1.1940 + return @fileList;
1.1941 +}
1.1942 +
1.1943 +
1.1944 +sub GetAllModules()
1.1945 +{
1.1946 +
1.1947 + my $src = $ATSRoot."/components/";
1.1948 + my @fileList = ();
1.1949 + opendir(DIRHANDLE, "$src") || die "Cannot opendir $src";
1.1950 + foreach my $name (readdir(DIRHANDLE))
1.1951 + {
1.1952 + if($name ne "." && $name ne ".." && $name ne "shared")
1.1953 + {
1.1954 + unshift @fileList, $name;
1.1955 + }
1.1956 +
1.1957 + }#foreach
1.1958 + closedir(DIRHANDLE);
1.1959 + return @fileList;
1.1960 +}
1.1961 +
1.1962 +
1.1963 +
1.1964 +sub TransformXmls($$)
1.1965 +{
1.1966 + my $libname = shift @_;
1.1967 + my $shared = shift @_;
1.1968 + my $target = shift @_;
1.1969 + my $module;
1.1970 + my $src;
1.1971 + my $dst;
1.1972 +
1.1973 + my $armv5 = 0;
1.1974 + my $winscw = 0;
1.1975 + if($target eq "armv5")
1.1976 + {
1.1977 + $armv5 = 1;
1.1978 + }
1.1979 + elsif($target eq "winscw")
1.1980 + {
1.1981 + $winscw = 1;
1.1982 + }
1.1983 + else
1.1984 + {
1.1985 + $armv5 = $do_armv5;
1.1986 + $winscw = $do_winscw;
1.1987 + }
1.1988 +
1.1989 +
1.1990 + foreach $module(@generatedModules)
1.1991 + {
1.1992 + if($armv5 == 1 && $winscw == 1)
1.1993 + {
1.1994 + $src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
1.1995 + }
1.1996 + elsif($armv5 == 1)
1.1997 + {
1.1998 + $src = $ATSRoot."/components/".$libname."_"."$module/*_hw_component.xml";
1.1999 + }
1.2000 + elsif($winscw == 1)
1.2001 + {
1.2002 + $src = $ATSRoot."/components/".$libname."_"."$module/*_winsspd_component.xml";
1.2003 + }
1.2004 + my @fileList = glob($src);
1.2005 + foreach my $file(@fileList)
1.2006 + {
1.2007 + #print"$file to be transformed!\n";
1.2008 + AddLibsInXml($libname,$file,$shared);
1.2009 + }
1.2010 + }
1.2011 +}#fn
1.2012 +
1.2013 +sub AddLibsInXml($$$)
1.2014 +{
1.2015 + my $libname = shift @_;
1.2016 + my $filename = shift @_;
1.2017 + my $shared = shift @_;
1.2018 +
1.2019 + # Open input file
1.2020 + open (INFILE, $filename ) || die ("Can not find $filename");
1.2021 +
1.2022 + #Open output file
1.2023 + my $newOutput = $filename."new";
1.2024 + open (OUTFILE, ">".$newOutput ) || die ("Can not open $newOutput");
1.2025 +
1.2026 + my $drive = "c:";
1.2027 +
1.2028 + # Replace text in files
1.2029 + while (<INFILE>)
1.2030 + {
1.2031 + if(/\<stif\>/ || /\<execute\>/)
1.2032 + {
1.2033 + if(/\<stif\>/)
1.2034 + {
1.2035 + print OUTFILE "\<stif\>\n";
1.2036 + }
1.2037 + else
1.2038 + {
1.2039 + print OUTFILE "\<execute\>\n";
1.2040 + if($filename =~ /winsspd/)
1.2041 + {
1.2042 + $drive = "z:";
1.2043 + }
1.2044 + }
1.2045 + foreach my $installable(@dllList)
1.2046 + {
1.2047 + print OUTFILE <<EOLine;
1.2048 +
1.2049 + <install type=\"$shared binary\">
1.2050 + <src>$installable</src>
1.2051 + <dst>$drive\\sys\\bin\\$installable</dst>
1.2052 + </install>
1.2053 +EOLine
1.2054 + }
1.2055 +
1.2056 + }
1.2057 + else
1.2058 + {
1.2059 + print OUTFILE $_;
1.2060 + }
1.2061 + }#while
1.2062 + # Close filehandles
1.2063 + close (INFILE);
1.2064 + close (OUTFILE);
1.2065 +
1.2066 + # Rename result file
1.2067 + unlink $filename;
1.2068 + rename $newOutput,$filename;
1.2069 +}
1.2070 +
1.2071 +sub CopySharedDlls()
1.2072 +{
1.2073 + my $libname = shift @_;
1.2074 + my $ref = shift @_;
1.2075 + my @ListOfDlls = @$ref;
1.2076 + my $target = shift @_;
1.2077 + my $module;
1.2078 + my $src;
1.2079 + my $dst;
1.2080 +
1.2081 + my $do_armv5 = 0;
1.2082 + my $do_winscw = 0;
1.2083 + if($target eq "armv5")
1.2084 + {
1.2085 + $do_armv5 = 1;
1.2086 + }
1.2087 + elsif($target eq "winscw")
1.2088 + {
1.2089 + $do_winscw = 1;
1.2090 + }
1.2091 + else
1.2092 + {
1.2093 + $do_armv5 = 1;
1.2094 + $do_winscw = 1;
1.2095 + }
1.2096 +
1.2097 +
1.2098 + mkdir $ATSRoot."\\components\\shared" || die("Wouldn't make shared folder in $ATSRoot\\components");
1.2099 + if($do_winscw == 1)
1.2100 + {
1.2101 + mkdir $ATSRoot."\\components\\shared\\winscw_udeb" || die("Wouldn't make shared folder in $ATSRoot\\components\winscw_udeb");
1.2102 + }
1.2103 + if($do_armv5 == 1)
1.2104 + {
1.2105 + mkdir $ATSRoot."\\components\\shared\\armv5_urel" || die("Wouldn't make shared folder in $ATSRoot\\components\armv5_urel");
1.2106 + }
1.2107 +
1.2108 + foreach my $copyDll(@ListOfDlls)
1.2109 + {
1.2110 + if($do_winscw == 1)
1.2111 + {
1.2112 + $src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
1.2113 + $dst = $ATSRoot."\\components\\shared";
1.2114 + $dst = $dst."\\winscw_udeb\\";
1.2115 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.2116 + }
1.2117 + if($do_armv5 == 1)
1.2118 + {
1.2119 + $src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
1.2120 + $dst = $ATSRoot."\\components\\shared";
1.2121 + $dst = $dst."\\armv5_urel\\";
1.2122 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.2123 + }
1.2124 + }#foreach
1.2125 +}#fn
1.2126 +
1.2127 +
1.2128 +sub CopyMultiDlls($)
1.2129 +{
1.2130 + my $libname = shift @_;
1.2131 + my $module;
1.2132 + my $src;
1.2133 + my $dst;
1.2134 + foreach my $listed(@generatedModules)
1.2135 + {
1.2136 + foreach my $copyDll(@dllList)
1.2137 + {
1.2138 + if($do_winscw == 1)
1.2139 + {
1.2140 + $src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
1.2141 + $dst = $ATSRoot."\\components\\$libname"."_$listed";
1.2142 + $dst = $dst."\\winscw_udeb\\";
1.2143 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.2144 + }
1.2145 + if($do_armv5 == 1)
1.2146 + {
1.2147 + $src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
1.2148 + $dst = $ATSRoot."\\components\\$libname"."_$listed";
1.2149 + $dst = $dst."\\armv5_urel\\";
1.2150 + copy($src, $dst) || warn("unable to copy $src to $dst");
1.2151 + }
1.2152 + }#foreach
1.2153 + }
1.2154 +}#fn
1.2155 +
1.2156 +sub StripModulePrefix($)
1.2157 +{
1.2158 + my $listed = pop @_;
1.2159 + my $module = $listed;
1.2160 + if($dontStrip == 0)
1.2161 + {
1.2162 + $module =~ s/^test//;
1.2163 + $module =~ s/^t//;
1.2164 + $module =~ s/^libc_//;
1.2165 + $module =~ s/^libm_//;
1.2166 + }
1.2167 + return $module;
1.2168 +
1.2169 +}
1.2170 +
1.2171 +sub GetLsbModules()
1.2172 +{
1.2173 + my @lsbList =
1.2174 + (
1.2175 + "abs",
1.2176 +"acos",
1.2177 +"asctime",
1.2178 +"asin",
1.2179 +"atan",
1.2180 +"atan2",
1.2181 +"atof",
1.2182 +"atoi",
1.2183 +"atol",
1.2184 +"bsearch",
1.2185 +"calloc",
1.2186 +"ceil",
1.2187 +"chdir",
1.2188 +"clearerr",
1.2189 +"close",
1.2190 +"closedir",
1.2191 +"cos",
1.2192 +"cosh",
1.2193 +"creat",
1.2194 +"lsb_ctime",
1.2195 +"lsb_difftime",
1.2196 +"dlclose",
1.2197 +"dlerror",
1.2198 +"dlopen",
1.2199 +"dup",
1.2200 +"dup2",
1.2201 +"exp",
1.2202 +"fabs",
1.2203 +"fclose",
1.2204 +"fcntl_x",
1.2205 +"fdopen",
1.2206 +"feof",
1.2207 +"ferror",
1.2208 +"fflush",
1.2209 +"fgetpos",
1.2210 +"fgets",
1.2211 +"fileno",
1.2212 +"floor",
1.2213 +"fmod",
1.2214 +"fopen",
1.2215 +"fopen_X",
1.2216 +"fprintf",
1.2217 +"fputs",
1.2218 +"fread",
1.2219 +"free",
1.2220 +"freopen",
1.2221 +"freopen_X",
1.2222 +"frexp",
1.2223 +"fseek",
1.2224 +"fsetpos",
1.2225 +"fstat",
1.2226 +"ftell",
1.2227 +"ftok",
1.2228 +"ftok_l",
1.2229 +"fwrite",
1.2230 +"getc",
1.2231 +"getcwd",
1.2232 +"gets",
1.2233 +"lsb_gmtime",
1.2234 +"ldexp",
1.2235 +"link",
1.2236 +"lsb_localtime",
1.2237 +"log",
1.2238 +"log10",
1.2239 +"longjmp",
1.2240 +"lseek",
1.2241 +"malloc",
1.2242 +"memchr_X",
1.2243 +"memcmp_X",
1.2244 +"memcpy_X",
1.2245 +"memmove",
1.2246 +"memset_X",
1.2247 +"mkdir",
1.2248 +"mkfifo",
1.2249 +"lsb_mktime",
1.2250 +"modf",
1.2251 +"msgctl",
1.2252 +"msgget",
1.2253 +"msgsnd",
1.2254 +"open",
1.2255 +"opendir",
1.2256 +"open_x",
1.2257 +"perror",
1.2258 +"pipe",
1.2259 +"pow",
1.2260 +"printf",
1.2261 +"qsort",
1.2262 +"rand",
1.2263 +"read",
1.2264 +"readdir",
1.2265 +"readv_l",
1.2266 +"realloc",
1.2267 +"remove",
1.2268 +"rename",
1.2269 +"rewind",
1.2270 +"rewinddir",
1.2271 +"rmdir",
1.2272 +"scanf",
1.2273 +"scanf_X",
1.2274 +"seekdir",
1.2275 +"semctl",
1.2276 +"semget",
1.2277 +"semop",
1.2278 +"setbuf",
1.2279 +"setjmp",
1.2280 +"shmat",
1.2281 +"shmdt",
1.2282 +"shmget",
1.2283 +"sin",
1.2284 +"sinh",
1.2285 +"sqrt",
1.2286 +"srand",
1.2287 +"stat",
1.2288 +"strcat",
1.2289 +"strchr",
1.2290 +"strcmp",
1.2291 +"strcoll_X",
1.2292 +"strcpy",
1.2293 +"strcspn",
1.2294 +"strerror_X",
1.2295 +"strftime",
1.2296 +"strftime_X",
1.2297 +"strlen",
1.2298 +"strncat",
1.2299 +"strncmp",
1.2300 +"strncpy",
1.2301 +"strpbrk",
1.2302 +"strptime",
1.2303 +"strrchr",
1.2304 +"strspn",
1.2305 +"strstr",
1.2306 +"strtod_X",
1.2307 +"strtok",
1.2308 +"strtol_X",
1.2309 +"strxfrm_X",
1.2310 +"tan",
1.2311 +"tanh",
1.2312 +"telldir",
1.2313 +"telldir_l",
1.2314 +"lsb_time",
1.2315 +"tmpfile",
1.2316 +"tmpnam",
1.2317 +"ungetc",
1.2318 +"unlink",
1.2319 +"utime",
1.2320 +"vfprintf",
1.2321 +"vprintf",
1.2322 +"write",
1.2323 +"writev_l",
1.2324 +
1.2325 + );
1.2326 + return @lsbList;
1.2327 +}
1.2328 +
1.2329 +
1.2330 +
1.2331 +sub GenBackendTest()
1.2332 +{
1.2333 +
1.2334 + my @datList =
1.2335 + (
1.2336 + ["libc", "tlibcbackend"],
1.2337 + );
1.2338 +
1.2339 + mkdir $ATSRoot;
1.2340 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.2341 +
1.2342 + my $lib;
1.2343 + my $module;
1.2344 + my $ext;
1.2345 + foreach my $ref(@datList)
1.2346 + {
1.2347 + my @inarr = @$ref;
1.2348 + ($lib, $module,$ext) = @inarr;
1.2349 + @generatedModules = ($module);
1.2350 + GenDirs($lib);
1.2351 + CopyDlls($lib,".dll");
1.2352 + }
1.2353 + #now copy xmls
1.2354 + CopyAtsSetup();
1.2355 + #extra exes
1.2356 + @generatedModules = ("tlibcbackend");
1.2357 + CopyDeps("libc","TPopenReadChild.exe");
1.2358 + CopyDeps("libc","TPopenWriteChild.exe");
1.2359 +
1.2360 +}#fn
1.2361 +
1.2362 +sub CopyAtsSetup()
1.2363 +{
1.2364 + my $libname = "libc";
1.2365 + my @list = (
1.2366 + ["*.xml", "libcbackend", "/../backend/internal/tlibcbackend/group/","/", ""],
1.2367 + ["*.cfg", "libcbackend", "/../backend/internal/tlibcbackend/group/","/General/", ""],
1.2368 + ["*.ini", "libcbackend", "/../backend/internal/tlibcbackend/group/","/General/", ""],
1.2369 + );
1.2370 +
1.2371 + my $bDataRef = \@list;
1.2372 + CopyArbitDatFiles("libc",$bDataRef);
1.2373 +
1.2374 +}#fn
1.2375 +sub GetPathPrefix()
1.2376 +{
1.2377 + my $srcPrefix = $templateRoot;
1.2378 + $srcPrefix =~ /(.*)internal.*/;
1.2379 + $srcPrefix = $1;
1.2380 + return $srcPrefix;
1.2381 +}
1.2382 +
1.2383 +
1.2384 +#dat file copy
1.2385 +sub CopyCryptoDat()
1.2386 +{
1.2387 + my $libRoot = $templateRoot;
1.2388 + $libRoot =~ /(.*)internal.*/;
1.2389 + $libRoot = $1;
1.2390 +
1.2391 + my @list = (
1.2392 + ["libssl", "ssltest", "libssl/internal/testapps/ssl_test/data/*"],
1.2393 + ["libcrypto", "topenssl", "/libcrypto/internal/testapps/topenssl/data/*"],
1.2394 + );
1.2395 +
1.2396 + my $libname;
1.2397 + my $dirname;
1.2398 + my $glob;
1.2399 + foreach my $ref(@list)
1.2400 + {
1.2401 + my @inarr = @$ref;
1.2402 + ($libname, $dirname, $glob) = @inarr;
1.2403 + my $modulename = StripModulePrefix($dirname);
1.2404 + my $srcPrefix = GetPathPrefix();
1.2405 +
1.2406 + my $src = "$srcPrefix"."$glob";
1.2407 +
1.2408 + my $dst = $ATSRoot."\\components\\$libname"."_"."$modulename\\General\\";
1.2409 + my @filesFound = glob($src);
1.2410 + if(scalar @filesFound == 0)
1.2411 + {
1.2412 + die("DIED: no Dat file found to copy!");
1.2413 + }
1.2414 + foreach my $file(@filesFound)
1.2415 + {
1.2416 + copy($file, $dst) || die("DIED: unable to copy $file to $dst");
1.2417 + }
1.2418 + }#ref processing
1.2419 +}#fn
1.2420 +
1.2421 +#Crypto xmls copy
1.2422 +sub CopyCryptoXmls()
1.2423 +{
1.2424 + my @list = (
1.2425 + ["*.xml", "libssl_ssltest/", "/libssl/internal/testapps/ssl_test/group/"],
1.2426 + ["*.xml", "libcrypto_crypto_test/", "/libcrypto/internal/testapps/crypto_test/group/"],
1.2427 + ["*.xml", "libcrypto_openssl/", "/libcrypto/internal/testapps/topenssl/group/"],
1.2428 + );
1.2429 +
1.2430 +
1.2431 + my $fname;
1.2432 + my $moduleDst;
1.2433 + my $location;
1.2434 +
1.2435 + #now copy the files appropriately
1.2436 + foreach my $ref(@list)
1.2437 + {
1.2438 + my @inarr = @$ref;
1.2439 + ($fname, $moduleDst, $location) = @inarr;
1.2440 + my $src = GetPathPrefix().$location.$fname;
1.2441 + my $dst = $ATSRoot."\\components\\$moduleDst";
1.2442 +
1.2443 + my @filesFound = glob($src);
1.2444 + if(scalar @filesFound == 0)
1.2445 + {
1.2446 + die("DIED: no xml file found to copy!");
1.2447 + }
1.2448 + foreach my $file(@filesFound)
1.2449 + {
1.2450 + copy($file, $dst) || die("DIED: unable to copy $file to $dst");
1.2451 + }
1.2452 + }#ref
1.2453 +
1.2454 + my @crypto_copyList = ("*.txt", "*cfg", "*.ini");
1.2455 +
1.2456 + foreach my $item(@crypto_copyList)
1.2457 + {
1.2458 + $location = "/libcrypto/internal/testapps/crypto_test/group/";
1.2459 + $fname = GetPathPrefix().$location.$item;
1.2460 + my @filesFound = glob($fname);
1.2461 + foreach my $file(@filesFound)
1.2462 + {
1.2463 + $moduleDst = "libcrypto_crypto_test/";
1.2464 + my $dst = $ATSRoot."\\components\\".$moduleDst."/General/";
1.2465 + copy($file, $dst);
1.2466 + }
1.2467 + }
1.2468 +}#fn
1.2469 +
1.2470 +sub GenCryptoTest()
1.2471 +{
1.2472 +
1.2473 + my @datList =
1.2474 + (
1.2475 + ["libssl", "ssltest", ".exe"],
1.2476 + ["libcrypto", "crypto_test",".dll"],
1.2477 + ["libcrypto", "openssl",".exe"],
1.2478 + );
1.2479 +
1.2480 + mkdir $ATSRoot;
1.2481 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.2482 +
1.2483 + my $lib;
1.2484 + my $module;
1.2485 + my $ext;
1.2486 + foreach my $ref(@datList)
1.2487 + {
1.2488 + my @inarr = @$ref;
1.2489 + ($lib, $module,$ext) = @inarr;
1.2490 + @generatedModules = ($module);
1.2491 + GenDirs($lib);
1.2492 + CopyDlls($lib,$ext);
1.2493 + }
1.2494 + CopyCryptoDat();
1.2495 + CopyCryptoXmls();
1.2496 +
1.2497 +
1.2498 +}#fn
1.2499 +
1.2500 +
1.2501 +#ngi xml copy
1.2502 +sub CopyNgiXmls()
1.2503 +{
1.2504 + my @list = (
1.2505 + ["*.xml", "ngi_sa_amrrecording", "/audio/lowlevelaudio/internal/sa_amrrecording/group/"],
1.2506 + ["*.xml", "ngi_sa_highlevelaudio", "/audio/highlevelaudio/internal/sa_highlevelaudio/group/"],
1.2507 + ["*.xml", "ngi_sa_audiomixing", "/audio/lowlevelaudio/internal/sa_audiomixing/group/"],
1.2508 + ["*.xml", "ngi_sa_audiorecording", "/audio/lowlevelaudio/internal/sa_audiorecording/group/"],
1.2509 + ["*.xml", "ngi_sa_clip", "/audio/lowlevelaudio/internal/sa_clip/group/"],
1.2510 + ["*.xml", "ngi_sa_lowlevelaudio", "/audio/lowlevelaudio/internal/sa_lowlevelaudio/group/"],
1.2511 + ["*.xml", "ngi_sa_stream", "/audio/lowlevelaudio/internal/sa_stream/group/"],
1.2512 +
1.2513 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_antitearing/group/"],
1.2514 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_colortranslation/group/"],
1.2515 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_createfb565/group/"],
1.2516 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_createfb888/group/"],
1.2517 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_heapusage/group/"],
1.2518 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_multibb/group/"],
1.2519 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_performance/group/"],
1.2520 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_plswitching/group/"],
1.2521 + ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_misc/group/"],
1.2522 + ["*.xml", "ngi_sa_bitmap", "/graphics/bitmap/internal/sa_bitmap/group/"],
1.2523 + ["*.xml", "ngi_sa_camera", "/graphics/camera/internal/sa_camera/group/"],
1.2524 + ["*.xml", "ngi_sa_images", "/graphics/images/internal/sa_images/group/"],
1.2525 + ["*.xml", "ngi_sa_display", "/graphics/display/internal/sa_display/group/"],
1.2526 + ["*.xml", "ngi_sa_lights", "/graphics/lights/internal/sa_lights/group/"],
1.2527 + ["*.xml", "ngi_sa_videoplayback", "/graphics/video/internal/sa_videoplayback/group/"],
1.2528 +
1.2529 + ["*.xml", "ngi_sa_input", "/input/input/internal/sa_input/group/"],
1.2530 + ["*.xml", "ngi_sa_textinput", "/input/textinput/internal/sa_textinput/group/"],
1.2531 + ["*.xml", "ngi_sa_devicecapabilities", "/system/devicecapabilities/internal/sa_devicecapabilities/group/"],
1.2532 + ["*.xml", "ngi_sa_devicestatus", "/system/devicestatus/internal/sa_phone/group/"],
1.2533 + ["*.xml", "ngi_sa_runtimetester", "/system/runtime/internal/sa_runtimetester/group/"],
1.2534 + ["*.xml", "ngi_sa_timing", "/timing/internal/sa_timing/group/"],
1.2535 + );
1.2536 +
1.2537 +
1.2538 + my $fname;
1.2539 + my $moduleDst;
1.2540 + my $location;
1.2541 +
1.2542 + #now copy the files appropriately
1.2543 + foreach my $ref(@list)
1.2544 + {
1.2545 + my @inarr = @$ref;
1.2546 + ($fname, $moduleDst, $location) = @inarr;
1.2547 + my $src = GetPathPrefix().$location.$fname;
1.2548 + my $dst = $ATSRoot."\\components\\$moduleDst";
1.2549 +
1.2550 + #print "My src is $src\n";
1.2551 + #print "My dst is $dst\n";
1.2552 +
1.2553 + my @filesFound = glob($src);
1.2554 + if(scalar @filesFound == 0)
1.2555 + {
1.2556 + warn("warning: no xml file found to copy from $src!");
1.2557 + }
1.2558 + foreach my $file(@filesFound)
1.2559 + {
1.2560 + copy($file, $dst) || die("DIED: unable to copy $file to $dst");
1.2561 + }
1.2562 + }#ref
1.2563 +
1.2564 +}#fn
1.2565 +
1.2566 +
1.2567 +sub GenNgiTest()
1.2568 +{
1.2569 +
1.2570 + my @datList =
1.2571 + (
1.2572 + ["ngi", "sa_amrrecording", ".dll"],
1.2573 + ["ngi", "sa_highlevelaudio", ".dll"],
1.2574 + ["ngi", "sa_audiomixing", ".dll"],
1.2575 + ["ngi", "sa_audiorecording", ".dll"],
1.2576 + ["ngi", "sa_clip", ".dll"],
1.2577 + ["ngi", "sa_lowlevelaudio", ".dll"],
1.2578 + ["ngi", "sa_stream", ".dll"],
1.2579 + ["ngi", "sa_bitmap", ".dll"],
1.2580 + ["ngi", "sa_camera", ".dll"],
1.2581 + ["ngi", "sa_images", ".dll"],
1.2582 + ["ngi", "sa_display", ".dll"],
1.2583 + ["ngi", "sa_lights", ".dll"],
1.2584 + ["ngi", "sa_videoplayback", ".dll"],
1.2585 + ["ngi", "sa_input", ".dll"],
1.2586 + ["ngi", "sa_textinput", ".dll"],
1.2587 + ["ngi", "sa_devicecapabilities", ".dll"],
1.2588 + ["ngi", "sa_devicestatus", ".dll"],
1.2589 + ["ngi", "sa_runtimetester", ".dll"],
1.2590 + ["ngi", "sa_timing", ".dll"],
1.2591 +
1.2592 + );
1.2593 +
1.2594 + mkdir $ATSRoot;
1.2595 + mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
1.2596 +
1.2597 +
1.2598 + my $lib;
1.2599 + my $module;
1.2600 + my $ext;
1.2601 + foreach my $ref(@datList)
1.2602 + {
1.2603 + my @inarr = @$ref;
1.2604 + ($lib, $module,$ext) = @inarr;
1.2605 + @generatedModules = ($module);
1.2606 + GenDirs($lib);
1.2607 + CopyDlls($lib,$ext);
1.2608 + }
1.2609 +
1.2610 + @generatedModules =("sa_backbuffer");
1.2611 + GenDirs($lib);
1.2612 + @dllList =
1.2613 + (
1.2614 + "sa_bb_antitearing.dll",
1.2615 + "sa_bb_colortranslation.dll",
1.2616 + "sa_bb_createfb444.dll",
1.2617 + "sa_bb_createfb565.dll",
1.2618 + "sa_bb_createfb888.dll",
1.2619 + "sa_bb_misc.dll",
1.2620 + "sa_bb_heapusage.dll",
1.2621 + "sa_bb_multibb.dll",
1.2622 + "sa_bb_performance.dll",
1.2623 + "sa_bb_plswitch.dll",
1.2624 + "sa_bb_testenv.dll"
1.2625 + );
1.2626 + CopyMultiDlls("ngi");
1.2627 +
1.2628 +
1.2629 + mkdir $ATSRoot."\\components\\shared" || die("Wouldn't make shared folder in $ATSRoot\\components");
1.2630 + mkdir $ATSRoot."\\components\\shared\\winscw_udeb" || die("Wouldn't make shared folder in $ATSRoot\\components\winscw_udeb");
1.2631 + mkdir $ATSRoot."\\components\\shared\\armv5_urel" || die("Wouldn't make shared folder in $ATSRoot\\components\armv5_urel");
1.2632 +
1.2633 +}#fn
1.2634 +
1.2635 +
1.2636 +sub GetXmls()
1.2637 +{
1.2638 + my @foundList;
1.2639 + my $libname = shift @_;
1.2640 + my @globlist = ();
1.2641 + if($target eq "winsspd" && $sdkversion ne "")
1.2642 + {
1.2643 + @globlist = ("winsspd_".$sdkversion);
1.2644 + #print "winsspd ".$sdkversion." selected\n";
1.2645 + }
1.2646 + elsif($target eq "winsspd")
1.2647 + {
1.2648 + @globlist = ("winsspd");
1.2649 + #print "winsspd selected\n";
1.2650 + }
1.2651 + elsif($sdkversion ne "")
1.2652 + {
1.2653 + @globlist = ($target,"hw_".$sdkversion);
1.2654 + #print "$target $sdkversion selected\n";
1.2655 + }
1.2656 + else
1.2657 + {
1.2658 + @globlist = ($target,"hw");
1.2659 + #print "$target $sdkversion selected\n";
1.2660 + }
1.2661 +
1.2662 + foreach my $module(@generatedModules)
1.2663 + {
1.2664 + my $glob_to_use = "";
1.2665 + my @fileList;
1.2666 + foreach my $glob(@globlist)
1.2667 + {
1.2668 + my $src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
1.2669 + #print "Analysing $module and $glob\n";
1.2670 + @fileList = glob($src);
1.2671 + foreach my $file(@fileList)
1.2672 + {
1.2673 + my $pat = $glob."\_component\.xml";
1.2674 + #print "[$file - $glob"."_component.xml"."]\n";
1.2675 + if($file =~ /$pat/)
1.2676 + {
1.2677 + $glob_to_use = $pat;
1.2678 + #print "[$file - $glob"."_component.xml"."]\n";
1.2679 + last
1.2680 + }
1.2681 + }#foreach FILE
1.2682 + if($glob_to_use ne "")
1.2683 + {
1.2684 + last;
1.2685 + }
1.2686 + }#finding glob
1.2687 + if($glob_to_use ne "")
1.2688 + {
1.2689 + #print "Using the glob $glob_to_use\n";
1.2690 + my $src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
1.2691 + @fileList = glob($src);
1.2692 + foreach my $file(@fileList)
1.2693 + {
1.2694 + #print "[$file - $glob_to_use]\n";
1.2695 + if($file =~ /$glob_to_use/)
1.2696 + {
1.2697 + $file =~ /.*components[\\\/](.*)/;
1.2698 + my $value = $1;
1.2699 + $value =~ s/\//\\/g;
1.2700 + #print "adding $value for $module with $glob_to_use\n";
1.2701 + unshift @foundList,$value;
1.2702 + }#if
1.2703 + }#foreach
1.2704 + }#glob is present
1.2705 + else
1.2706 + {
1.2707 + warn("Unable to figure out glob to use for $module. Skipping...\n");
1.2708 + }
1.2709 + }#each module
1.2710 + return @foundList;
1.2711 + }#fn
1.2712 +
1.2713 +__END__
1.2714 +:end
1.2715 +
1.2716 +
1.2717 +
1.2718 +