ssl/internal/genatsmodules.bat
author hgs
Tue, 02 Nov 2010 19:23:22 +0530
changeset 79 564bc7b7ad27
permissions -rw-r--r--
201043
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
79
hgs
parents:
diff changeset
     1
rem
hgs
parents:
diff changeset
     2
rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
hgs
parents:
diff changeset
     3
hgs
parents:
diff changeset
     4
rem Redistribution and use in source and binary forms, with or without 
hgs
parents:
diff changeset
     5
rem modification, are permitted provided that the following conditions are met:
hgs
parents:
diff changeset
     6
hgs
parents:
diff changeset
     7
rem Redistributions of source code must retain the above copyright notice, this 
hgs
parents:
diff changeset
     8
rem list of conditions and the following disclaimer.
hgs
parents:
diff changeset
     9
rem Redistributions in binary form must reproduce the above copyright notice, 
hgs
parents:
diff changeset
    10
rem this list of conditions and the following disclaimer in the documentation 
hgs
parents:
diff changeset
    11
rem and/or other materials provided with the distribution.
hgs
parents:
diff changeset
    12
rem Neither the name of Nokia Corporation nor the names of its contributors 
hgs
parents:
diff changeset
    13
rem may be used to endorse or promote products derived from this software 
hgs
parents:
diff changeset
    14
rem without specific prior written permission.
hgs
parents:
diff changeset
    15
hgs
parents:
diff changeset
    16
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
hgs
parents:
diff changeset
    17
rem AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
hgs
parents:
diff changeset
    18
rem IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
hgs
parents:
diff changeset
    19
rem DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 
hgs
parents:
diff changeset
    20
rem FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
hgs
parents:
diff changeset
    21
rem DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
hgs
parents:
diff changeset
    22
rem SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
hgs
parents:
diff changeset
    23
rem CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
hgs
parents:
diff changeset
    24
rem OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
hgs
parents:
diff changeset
    25
rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hgs
parents:
diff changeset
    26
rem
hgs
parents:
diff changeset
    27
rem Description:      
hgs
parents:
diff changeset
    28
rem
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
@perl -x GenATSModules.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 
hgs
parents:
diff changeset
    31
@goto end
hgs
parents:
diff changeset
    32
hgs
parents:
diff changeset
    33
#!perl
hgs
parents:
diff changeset
    34
use strict;
hgs
parents:
diff changeset
    35
use File::Find;
hgs
parents:
diff changeset
    36
use File::Copy;
hgs
parents:
diff changeset
    37
use Cwd;
hgs
parents:
diff changeset
    38
hgs
parents:
diff changeset
    39
my $sendEmail = "no";
hgs
parents:
diff changeset
    40
my $target = "winsspd";
hgs
parents:
diff changeset
    41
my $suite;
hgs
parents:
diff changeset
    42
my $install = "no";
hgs
parents:
diff changeset
    43
my $session = "no";
hgs
parents:
diff changeset
    44
my $combinedSession = "no";
hgs
parents:
diff changeset
    45
my $sdkversion="";
hgs
parents:
diff changeset
    46
my $noXmlsGenList = "play_new";
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
my %DirHash;
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
if(scalar @ARGV ==0 || $ARGV[0] =~ /[\-\\\/][h\?]/ || $ARGV[0] =~ /help/ )
hgs
parents:
diff changeset
    52
{
hgs
parents:
diff changeset
    53
	print <<EOHelp;
hgs
parents:
diff changeset
    54
genatsmodules.bat - hardcoded script to generate ATSINPUT folders for mobileruntime and ngi projects	
hgs
parents:
diff changeset
    55
Usage:
hgs
parents:
diff changeset
    56
	genatsmodules.bat
hgs
parents:
diff changeset
    57
		Create ATSINPUT for the default testsuite based on 
hgs
parents:
diff changeset
    58
		location it is executed from place in stdlibs/internal 
hgs
parents:
diff changeset
    59
		and run and it generates ATSINPUT for stdlibs
hgs
parents:
diff changeset
    60
		similiarly place it in ssl/internal or glib/internal or 
hgs
parents:
diff changeset
    61
    ngi/internal and run to generate  ATSINPUT for ssl, glib  
hgs
parents:
diff changeset
    62
    and ngi respectively	
hgs
parents:
diff changeset
    63
  
hgs
parents:
diff changeset
    64
  genatsmodules [libname]
hgs
parents:
diff changeset
    65
			where libname can be stdlibs, ssl, glib, etc. Creates 
hgs
parents:
diff changeset
    66
			ats test drop for given library. Valid from any internal
hgs
parents:
diff changeset
    67
			folder of mobileruntime.
hgs
parents:
diff changeset
    68
			
hgs
parents:
diff changeset
    69
  
hgs
parents:
diff changeset
    70
  genatsmodules ngi
hgs
parents:
diff changeset
    71
			create ngi testsuite. Valid inside ngi/internal only
hgs
parents:
diff changeset
    72
			
hgs
parents:
diff changeset
    73
genatsmodules play_new
hgs
parents:
diff changeset
    74
			create play_new testsuite. Valid inside play_new/internal only
hgs
parents:
diff changeset
    75
				
hgs
parents:
diff changeset
    76
	
hgs
parents:
diff changeset
    77
      
hgs
parents:
diff changeset
    78
	genatsmodules ltp
hgs
parents:
diff changeset
    79
			create ltp testsuite. Valid inside stdlibs/internal only
hgs
parents:
diff changeset
    80
	
hgs
parents:
diff changeset
    81
	genatsmodules lsb
hgs
parents:
diff changeset
    82
			create lsb testsuite. Valid inside stdlibs/internal only
hgs
parents:
diff changeset
    83
			
hgs
parents:
diff changeset
    84
	genatsmodules stdcpp
hgs
parents:
diff changeset
    85
			create stdcpp testsuite. Valid inside stdcpp/internal only
hgs
parents:
diff changeset
    86
			
hgs
parents:
diff changeset
    87
	genatsmodules [libname] install 
hgs
parents:
diff changeset
    88
		 where libname can be stdlibs, ssl, glib, ltp, lsb to create a 
hgs
parents:
diff changeset
    89
		 ATSINPUT where the dependent mobileruntime libraries are also 
hgs
parents:
diff changeset
    90
		 copied and used (It copies the dependent libraries using the 
hgs
parents:
diff changeset
    91
		 ATS component files)
hgs
parents:
diff changeset
    92
		
hgs
parents:
diff changeset
    93
	genatsmodules session [libname] [target] 		
hgs
parents:
diff changeset
    94
		where libname is any of the standard libs as shown above and 
hgs
parents:
diff changeset
    95
		target can be winsspd, winscw, scarfe, zeus etc. to create 
hgs
parents:
diff changeset
    96
		session files for scarfe, winsspd etc. 
hgs
parents:
diff changeset
    97
		
hgs
parents:
diff changeset
    98
genatsmodules session combined [target] 				
hgs
parents:
diff changeset
    99
      will look at the existing ATSINPUT(which can have any 
hgs
parents:
diff changeset
   100
      combination of created components and create a combined 
hgs
parents:
diff changeset
   101
      session file. This way you get increased flexibility in 
hgs
parents:
diff changeset
   102
      the libraries you choose to combine into a single session 
hgs
parents:
diff changeset
   103
      file. If the target is a hardware target(that is not winsspd
hgs
parents:
diff changeset
   104
      or winscw), the script will first attempt to find a target 
hgs
parents:
diff changeset
   105
      specific component file and if not found, the generic hw 
hgs
parents:
diff changeset
   106
      component file. 
hgs
parents:
diff changeset
   107
	
hgs
parents:
diff changeset
   108
hgs
parents:
diff changeset
   109
	Note:
hgs
parents:
diff changeset
   110
	ATSINPUT creation is a 2 stage process. First we create 
hgs
parents:
diff changeset
   111
	the components and then we run (for example) 
hgs
parents:
diff changeset
   112
	"genatsmodules session stdlibs winscw" and 
hgs
parents:
diff changeset
   113
	"genatsmodules session stdlibs scarfe" to create the 
hgs
parents:
diff changeset
   114
	session files.
hgs
parents:
diff changeset
   115
EOHelp
hgs
parents:
diff changeset
   116
		exit();
hgs
parents:
diff changeset
   117
}
hgs
parents:
diff changeset
   118
my $do_armv5 = 1;
hgs
parents:
diff changeset
   119
my $do_winscw = 1;
hgs
parents:
diff changeset
   120
hgs
parents:
diff changeset
   121
if(scalar @ARGV == 1)
hgs
parents:
diff changeset
   122
{
hgs
parents:
diff changeset
   123
	if($ARGV[0] eq "session")
hgs
parents:
diff changeset
   124
	{
hgs
parents:
diff changeset
   125
		die("parameter session must be followed by libname and target platform");
hgs
parents:
diff changeset
   126
	}
hgs
parents:
diff changeset
   127
	else
hgs
parents:
diff changeset
   128
	{
hgs
parents:
diff changeset
   129
		$suite = $ARGV[0];
hgs
parents:
diff changeset
   130
	}
hgs
parents:
diff changeset
   131
}
hgs
parents:
diff changeset
   132
elsif(scalar @ARGV == 2)
hgs
parents:
diff changeset
   133
{
hgs
parents:
diff changeset
   134
	if($ARGV[0] eq  "session")
hgs
parents:
diff changeset
   135
	{
hgs
parents:
diff changeset
   136
		die("parameter session must be followed by libname and target platform");
hgs
parents:
diff changeset
   137
	}
hgs
parents:
diff changeset
   138
	elsif($ARGV[1] eq "install")
hgs
parents:
diff changeset
   139
	{
hgs
parents:
diff changeset
   140
		$suite = $ARGV[0];
hgs
parents:
diff changeset
   141
		$install = "yes";
hgs
parents:
diff changeset
   142
	}
hgs
parents:
diff changeset
   143
	elsif($ARGV[1] eq "armv5")
hgs
parents:
diff changeset
   144
	{
hgs
parents:
diff changeset
   145
		$do_winscw = 0;
hgs
parents:
diff changeset
   146
	}
hgs
parents:
diff changeset
   147
	elsif($ARGV[1] eq "winscw")
hgs
parents:
diff changeset
   148
	{
hgs
parents:
diff changeset
   149
		$do_armv5 = 0; 
hgs
parents:
diff changeset
   150
	}
hgs
parents:
diff changeset
   151
	else
hgs
parents:
diff changeset
   152
	{
hgs
parents:
diff changeset
   153
		die("second parameter after target platform $ARGV[0] can only be \"install\" ");
hgs
parents:
diff changeset
   154
	}
hgs
parents:
diff changeset
   155
}
hgs
parents:
diff changeset
   156
elsif(scalar @ARGV == 3)
hgs
parents:
diff changeset
   157
{
hgs
parents:
diff changeset
   158
		if($ARGV[0] ne "session")
hgs
parents:
diff changeset
   159
		{
hgs
parents:
diff changeset
   160
			die("invalid combination of parameters. Program expected 1st parameter to be \"session\" ");
hgs
parents:
diff changeset
   161
		}
hgs
parents:
diff changeset
   162
		else
hgs
parents:
diff changeset
   163
		{
hgs
parents:
diff changeset
   164
			$session = "yes";
hgs
parents:
diff changeset
   165
			$suite = $ARGV[1];
hgs
parents:
diff changeset
   166
			$target = $ARGV[2];
hgs
parents:
diff changeset
   167
	
hgs
parents:
diff changeset
   168
			if($suite eq "combined")
hgs
parents:
diff changeset
   169
			{		
hgs
parents:
diff changeset
   170
				$combinedSession = "yes";
hgs
parents:
diff changeset
   171
	  	}
hgs
parents:
diff changeset
   172
			
hgs
parents:
diff changeset
   173
		}
hgs
parents:
diff changeset
   174
}
hgs
parents:
diff changeset
   175
elsif(scalar @ARGV == 4)
hgs
parents:
diff changeset
   176
{
hgs
parents:
diff changeset
   177
		if($ARGV[0] ne "session")
hgs
parents:
diff changeset
   178
		{
hgs
parents:
diff changeset
   179
			die("invalid combination of parameters. Program expected 1st parameter to be \"session\" ");
hgs
parents:
diff changeset
   180
		}
hgs
parents:
diff changeset
   181
		else
hgs
parents:
diff changeset
   182
		{
hgs
parents:
diff changeset
   183
			$session = "yes";
hgs
parents:
diff changeset
   184
			$suite = $ARGV[1];
hgs
parents:
diff changeset
   185
			$target = $ARGV[2];
hgs
parents:
diff changeset
   186
			$sdkversion = $ARGV[3];
hgs
parents:
diff changeset
   187
			if($suite eq "combined")
hgs
parents:
diff changeset
   188
			{		
hgs
parents:
diff changeset
   189
				$combinedSession = "yes";
hgs
parents:
diff changeset
   190
	  	}
hgs
parents:
diff changeset
   191
		}
hgs
parents:
diff changeset
   192
}
hgs
parents:
diff changeset
   193
else
hgs
parents:
diff changeset
   194
{
hgs
parents:
diff changeset
   195
		die("program recieved too many parameters!");
hgs
parents:
diff changeset
   196
}#end of commandline processing
hgs
parents:
diff changeset
   197
hgs
parents:
diff changeset
   198
hgs
parents:
diff changeset
   199
	
hgs
parents:
diff changeset
   200
my $rootDrive = substr(getcwd(), 0,2);
hgs
parents:
diff changeset
   201
my $templateRoot = getcwd();
hgs
parents:
diff changeset
   202
if(rindex($templateRoot, "internal") == -1 && ($suite ne "stdlibs" && $suite ne "pcts" ) )
hgs
parents:
diff changeset
   203
{
hgs
parents:
diff changeset
   204
	die("Please run the script from the appropriate internal folder in the mobileruntime /omerta project!!");
hgs
parents:
diff changeset
   205
}
hgs
parents:
diff changeset
   206
else
hgs
parents:
diff changeset
   207
{
hgs
parents:
diff changeset
   208
hgs
parents:
diff changeset
   209
	 my $srcPrefix = getcwd();
hgs
parents:
diff changeset
   210
	 $srcPrefix =~ /(.*)internal.*/;
hgs
parents:
diff changeset
   211
	 $srcPrefix = $1;
hgs
parents:
diff changeset
   212
	 if(rindex($templateRoot, "stdlibs") != -1)
hgs
parents:
diff changeset
   213
	 {
hgs
parents:
diff changeset
   214
	 	$srcPrefix =~ /(.*)stdlibs.*/;
hgs
parents:
diff changeset
   215
	 	$srcPrefix = $1;
hgs
parents:
diff changeset
   216
	 	
hgs
parents:
diff changeset
   217
	 	if($suite eq "glib")
hgs
parents:
diff changeset
   218
	 	{
hgs
parents:
diff changeset
   219
	 		$templateRoot = $srcPrefix."/glib/internal/";
hgs
parents:
diff changeset
   220
	 	}
hgs
parents:
diff changeset
   221
	 	elsif($suite eq "ssl")
hgs
parents:
diff changeset
   222
	 	{
hgs
parents:
diff changeset
   223
	 		$templateRoot = $srcPrefix."/ssl/internal/";
hgs
parents:
diff changeset
   224
	 	}
hgs
parents:
diff changeset
   225
	 	elsif($suite eq "ngi" && $session ne "yes")
hgs
parents:
diff changeset
   226
	 	{
hgs
parents:
diff changeset
   227
	 		print "ngi atsinput creation not supported from mobileruntime\n";
hgs
parents:
diff changeset
   228
	 		exit();
hgs
parents:
diff changeset
   229
	 	}
hgs
parents:
diff changeset
   230
	 }
hgs
parents:
diff changeset
   231
	 
hgs
parents:
diff changeset
   232
	if(rindex($templateRoot, "glib") != -1)
hgs
parents:
diff changeset
   233
	{
hgs
parents:
diff changeset
   234
		$suite = "glib";
hgs
parents:
diff changeset
   235
	}
hgs
parents:
diff changeset
   236
	elsif(rindex($templateRoot, "ssl") != -1)
hgs
parents:
diff changeset
   237
	{
hgs
parents:
diff changeset
   238
		$suite = "ssl";
hgs
parents:
diff changeset
   239
	}
hgs
parents:
diff changeset
   240
	elsif(rindex($templateRoot, "ngi") != -1)
hgs
parents:
diff changeset
   241
	{
hgs
parents:
diff changeset
   242
		$suite = "ngi";
hgs
parents:
diff changeset
   243
	}
hgs
parents:
diff changeset
   244
}
hgs
parents:
diff changeset
   245
hgs
parents:
diff changeset
   246
hgs
parents:
diff changeset
   247
my $optsGroupPath = $templateRoot."/ts/ltp/opts/group/";
hgs
parents:
diff changeset
   248
#$optsGroupPath = getcwd()."/ts/ltp/opts/group/";
hgs
parents:
diff changeset
   249
my $ltpPath =$templateRoot."/ts/ltp/";
hgs
parents:
diff changeset
   250
my $stdcppPath =$templateRoot."/testapps/stlport/";
hgs
parents:
diff changeset
   251
my @stdexeList = ("gnu","tstdcpp","stdcxx/tstapps");
hgs
parents:
diff changeset
   252
#my $gnuPath =getcwd()."/testapps/gnu/";
hgs
parents:
diff changeset
   253
#my $tstdcppPath =getcwd()."/testapps/tstdcpp/";
hgs
parents:
diff changeset
   254
my	$ATSRoot = getcwd()."\\ATSINPUT";
hgs
parents:
diff changeset
   255
hgs
parents:
diff changeset
   256
my @generatedModules;
hgs
parents:
diff changeset
   257
my %cfglocation;
hgs
parents:
diff changeset
   258
hgs
parents:
diff changeset
   259
my $TDIR = "\\internal\\testapps\\";
hgs
parents:
diff changeset
   260
hgs
parents:
diff changeset
   261
my @libcModules = ( "libc_loc_blr",  "libc_time_blr", "libc_db_blr","tctype", "tifioctls", "tinet",
hgs
parents:
diff changeset
   262
                      "tlibcwchar", "tlink", "tmkfifo", "tmmap", "tmsgqueue",
hgs
parents:
diff changeset
   263
		      "tnetdb", "tpipe","tregex", "tsemaphore", "tshm","tsocket" ,
hgs
parents:
diff changeset
   264
		      "tstdio", "tstdlib", "tstring", "tsyscalls",
hgs
parents:
diff changeset
   265
		      "tsyssim", "twctype", "tselect", "tsysunistd", "twideapis", "twopen", "twchar",
hgs
parents:
diff changeset
   266
		      "twcharapi",
hgs
parents:
diff changeset
   267
               );
hgs
parents:
diff changeset
   268
hgs
parents:
diff changeset
   269
my @libdlModules = ("tlibdl");
hgs
parents:
diff changeset
   270
my @libmModules = ("libm_double_blr", "libm_float_blr","libm_ldouble_blr");
hgs
parents:
diff changeset
   271
hgs
parents:
diff changeset
   272
hgs
parents:
diff changeset
   273
my @pthreadModules = ( "testcondbroadcast", "testconddestroy", "testcondinit", "testcondsignal", "testcondtimedwait", "testcondwait",
hgs
parents:
diff changeset
   274
"tmutex", "tpthread", "testpthreadonce", "testsemclose", "testsemdestroy", "testsemgetvalue", "testseminit", "testsemopen", "testsempost",
hgs
parents:
diff changeset
   275
"testsemtimedwait", "testsemtrywait", "testsemunlink", "testsemwait");
hgs
parents:
diff changeset
   276
hgs
parents:
diff changeset
   277
hgs
parents:
diff changeset
   278
my @stdliblist = ( "libc", "libpthread", "libdl", "libm", "libz", "libcrypt");
hgs
parents:
diff changeset
   279
my @dllList = ("backend.dll", "libc.dll", "LibCIpcClient.dll", "LibCIpcServer.exe", "libdl.dll", "libm.dll", "libpthread.dll", "libcrypt.dll", "libz.dll", "liblogger.dll");
hgs
parents:
diff changeset
   280
hgs
parents:
diff changeset
   281
hgs
parents:
diff changeset
   282
my @stdcpplist = (
hgs
parents:
diff changeset
   283
  				 ["fstream1_input.txt", "stlport_fstream", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   284
  				 ["nextperm1_good.txt", "stlport_nextprm", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   285
  				 ["nextperm2_good.txt", "stlport_nextprm", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   286
  				 ["ostmit_good.txt", "stlport_ostmit", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   287
  				 ["seek.txt", "stlport_seek", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   288
  				 ["istream_extractor_other-1.tst","istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   289
  				 ["istream_extractor_other-1.txt","istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   290
  				 ["istream_extractor_other-2.tst","istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   291
  				 ["istream_unformatted-1.tst","istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   292
  				 ["istream_unformatted-1.txt","istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   293
  				 ["istream_unformatted-2.tst","istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   294
  				 ["ostream_inserter_char-1.tst","ostream_inserter_char", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   295
  				 ["ostream_inserter_other-1.tst","ostream_inserter_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   296
  				 ["ostream_inserter_other-2.tst","ostream_inserter_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],  				 
hgs
parents:
diff changeset
   297
  				 ["istream_extractor_other-1.tst","w_istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   298
  				 ["istream_extractor_other-1.txt","w_istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   299
  				 ["istream_extractor_other-2.tst","w_istream_extractor_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   300
  				 ["istream_unformatted-1.tst","w_istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   301
  				 ["istream_unformatted-1.txt","w_istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   302
  				 ["istream_unformatted-2.tst","w_istream_unformatted", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   303
  				 ["ostream_inserter_char-1.tst","w_ostream_inserter_char", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   304
  				 ["ostream_inserter_other-1.tst","w_ostream_inserter_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   305
  				 ["ostream_inserter_other-2.tst","w_ostream_inserter_other", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   306
  				 ["filebuf_members-1.tst","filebuf_members", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   307
  				 ["filebuf_members-1.txt","filebuf_members", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   308
  				 ["filebuf_virtuals-1.tst","filebuf_virtuals", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   309
  				 ["filebuf_virtuals-1.txt","filebuf_virtuals", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   310
  				 ["filebuf_virtuals-2.tst","filebuf_virtuals", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   311
  				 ["filebuf_virtuals-3.tst","filebuf_virtuals", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   312
  				 ["ifstream_members-1.tst","ifstream_members", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   313
  				 ["ifstream_members-1.txt","ifstream_members", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   314
  				 ["ios_base_members_static-1.tst","ios_base_members_static", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   315
  				 ["istream_seeks-1.tst","istream_seeks", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   316
  				 ["istream_seeks-1.txt","istream_seeks", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   317
  				 ["istream_seeks-2.tst","istream_seeks", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   318
  				 ["istream_seeks-3.tst","istream_seeks", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   319
  				 ["ofstream_members-1.tst","ofstream_members", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   320
  				 ["ostream_inserter_char-1.txt","ostream_inserter_char", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   321
  				 ["ostream_seeks-1.tst","ostream_seeks", "/../internal/testapps/gnu/io/doc/", "/General/", "C:\\TestFramework\\gnu"],
hgs
parents:
diff changeset
   322
  				 ["infile_auto.txt","multi_thread_auto", "/../internal/testapps/doc/", "/General/", "C:\\TestFramework\\tstdcpp"],
hgs
parents:
diff changeset
   323
);
hgs
parents:
diff changeset
   324
hgs
parents:
diff changeset
   325
my @gliblist = (
hgs
parents:
diff changeset
   326
  				 ["1.gmarkup", "markup_test", "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   327
   				 ["1.gmarkup", "markup-test", "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   328
  				 ["iochannel-test-infile", "iochannel_test",  "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   329
  				 ["iochannel-test-infile", "iochannel-test",  "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   330
#  				 ["casemap.bin",  "unicode-caseconv",  "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   331
#  				 ["casefold.bin", "unicode-caseconv",  "/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   332
  				 ["utf8.txt", "unicode-encoding","/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   333
  				 ["casecollate.txt", "unicode-collate","/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   334
  				 ["utf8_hindi.txt", "tutf8","/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   335
  				 ["scanfile.txt", "tscanner","/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   336
  				 ["test.txt", "dir_test","/epoc32/winscw/c/temp/tmp/", "/General/", "C:\\temp\\tmp"],
hgs
parents:
diff changeset
   337
  				 ["NormalizationTest.txt", "unicode-normalize","/epoc32/winscw/c/", "/General/", "C:"],
hgs
parents:
diff changeset
   338
  				 
hgs
parents:
diff changeset
   339
  				 ["helloworld.exe", "spawn_test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
hgs
parents:
diff changeset
   340
  				 ["helloworld.exe", "spawn_test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
hgs
parents:
diff changeset
   341
  				 
hgs
parents:
diff changeset
   342
  				 ["libmoduletestplugin_a.dll", "module-test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
hgs
parents:
diff changeset
   343
  				 ["libmoduletestplugin_a.dll", "module-test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
hgs
parents:
diff changeset
   344
  				 
hgs
parents:
diff changeset
   345
  				 ["libmoduletestplugin_b.dll", "module-test","/epoc32/release/armv5/urel/", "/armv5_urel/", "C:\\sys\\bin"],
hgs
parents:
diff changeset
   346
  				 ["libmoduletestplugin_b.dll", "module-test","/epoc32/release/winscw/udeb/", "/winscw_udeb/", "Z:\\sys\\bin"],
hgs
parents:
diff changeset
   347
  				 
hgs
parents:
diff changeset
   348
  			  				 
hgs
parents:
diff changeset
   349
  				 );
hgs
parents:
diff changeset
   350
  				 
hgs
parents:
diff changeset
   351
my @ngilist = (
hgs
parents:
diff changeset
   352
           ["Test.txt", "ngi_sa_runtimetester", "/EPOC32/winscw/c/Private/10202be9/", "/General/", ""],
hgs
parents:
diff changeset
   353
  				 ["sa_input_repository.txt", "shared","/EPOC32/armv5/c/TestFramework/", "/armv5_urel/", ""],
hgs
parents:
diff changeset
   354
  				 ["sa_input_repository.txt", "shared","/EPOC32/winscw/c/TestFramework/", "/winscw_udeb/", ""],
hgs
parents:
diff changeset
   355
  				 ["audiomixingfiles.ini", "ngi_sa_audiomixing","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   356
  				 ["sa_camera_supported.ini", "ngi_sa_camera","/EPOC32/armv5/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   357
  				 ["sa_clip.ini", "ngi_sa_clip","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   358
  				 ["devicecapabilitiesdata.ini", "ngi_sa_devicecapabilities","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   359
   				 ["highlevelaudiofiles.ini", "ngi_sa_highlevelaudio","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   360
					 ["lowlevelaudiofiles.ini", "ngi_sa_lowlevelaudio","/EPOC32/winscw/c/TestFramework/", "/general/", ""],
hgs
parents:
diff changeset
   361
					 ["runtimedata.ini", "ngi_sa_runtimetester","/EPOC32/winscw/c/TestFramework/", "/general/", ""],						
hgs
parents:
diff changeset
   362
					 ["sa_stream.ini", "ngi_sa_stream","/EPOC32/winscw/c/TestFramework/", "/general/", ""],						
hgs
parents:
diff changeset
   363
					 #["*", "ngi_sa_videoplayback","/../graphics/video/internal/sa_videoplayback/data/", "/general/", ""],
hgs
parents:
diff changeset
   364
					 ["test.*", "ngi_sa_images","/Epoc32/winscw/c/Data/", "/general/", ""]
hgs
parents:
diff changeset
   365
					);
hgs
parents:
diff changeset
   366
hgs
parents:
diff changeset
   367
  				 
hgs
parents:
diff changeset
   368
hgs
parents:
diff changeset
   369
hgs
parents:
diff changeset
   370
my $validexpansions = "all stdlibs combined";
hgs
parents:
diff changeset
   371
my $validLibraries = "ltp opts lsb glib ssl ngi pcts stdcpp gcce libc-locale play_new";
hgs
parents:
diff changeset
   372
if(rindex($validexpansions, $suite)== -1 && rindex($validLibraries, $suite) == -1)
hgs
parents:
diff changeset
   373
{
hgs
parents:
diff changeset
   374
	die("$suite is not a valid library. Valid options are $validexpansions $validLibraries");
hgs
parents:
diff changeset
   375
}
hgs
parents:
diff changeset
   376
hgs
parents:
diff changeset
   377
my $dontStrip = 1;
hgs
parents:
diff changeset
   378
my	@liblist;
hgs
parents:
diff changeset
   379
if($suite eq "all")
hgs
parents:
diff changeset
   380
{
hgs
parents:
diff changeset
   381
		@liblist = split " ", $validLibraries;
hgs
parents:
diff changeset
   382
		@liblist = (@liblist, @stdliblist);
hgs
parents:
diff changeset
   383
		
hgs
parents:
diff changeset
   384
}#suite all
hgs
parents:
diff changeset
   385
elsif($suite eq "ltp")
hgs
parents:
diff changeset
   386
{
hgs
parents:
diff changeset
   387
	 @liblist = ("ltp", "opts");
hgs
parents:
diff changeset
   388
}
hgs
parents:
diff changeset
   389
elsif($suite eq "stdlibs")
hgs
parents:
diff changeset
   390
{
hgs
parents:
diff changeset
   391
		@liblist = @stdliblist;
hgs
parents:
diff changeset
   392
}
hgs
parents:
diff changeset
   393
elsif($suite eq "ssl")
hgs
parents:
diff changeset
   394
{
hgs
parents:
diff changeset
   395
	@liblist = ("libcrypto", "libssl");
hgs
parents:
diff changeset
   396
}
hgs
parents:
diff changeset
   397
else
hgs
parents:
diff changeset
   398
{
hgs
parents:
diff changeset
   399
		@liblist = ("$suite");
hgs
parents:
diff changeset
   400
}
hgs
parents:
diff changeset
   401
hgs
parents:
diff changeset
   402
#	foreach my $l(@liblist)
hgs
parents:
diff changeset
   403
#	{
hgs
parents:
diff changeset
   404
#			print "$l was there\n";
hgs
parents:
diff changeset
   405
#	}
hgs
parents:
diff changeset
   406
hgs
parents:
diff changeset
   407
hgs
parents:
diff changeset
   408
if($combinedSession eq "yes")
hgs
parents:
diff changeset
   409
{
hgs
parents:
diff changeset
   410
	GenerateSessionFile("combined", $target,"combined");
hgs
parents:
diff changeset
   411
	exit();
hgs
parents:
diff changeset
   412
}
hgs
parents:
diff changeset
   413
hgs
parents:
diff changeset
   414
if($session eq "yes")
hgs
parents:
diff changeset
   415
{
hgs
parents:
diff changeset
   416
	my $file = $templateRoot."/testsession.xml";
hgs
parents:
diff changeset
   417
	opendir(DIRHANDLE, $ATSRoot) || die("Please try to create Session files only after ATSINPUT/components has been created!");
hgs
parents:
diff changeset
   418
	closedir(DIRHANDLE);
hgs
parents:
diff changeset
   419
	$dontStrip = 1;
hgs
parents:
diff changeset
   420
	if($suite eq "ngi" || $suite eq "play_new")
hgs
parents:
diff changeset
   421
	{
hgs
parents:
diff changeset
   422
		@generatedModules = GenGenModules($suite);
hgs
parents:
diff changeset
   423
		my @componentFiles = GetXmls($suite);
hgs
parents:
diff changeset
   424
		GenerateSessionFile("combined",$target,$suite,\@componentFiles);
hgs
parents:
diff changeset
   425
		exit();
hgs
parents:
diff changeset
   426
	}
hgs
parents:
diff changeset
   427
	elsif($suite eq "ssl")
hgs
parents:
diff changeset
   428
	{
hgs
parents:
diff changeset
   429
		my @componentFiles = GetSslXmls();
hgs
parents:
diff changeset
   430
		GenerateSessionFile("combined",$target,$suite,\@componentFiles);
hgs
parents:
diff changeset
   431
		exit();
hgs
parents:
diff changeset
   432
	}
hgs
parents:
diff changeset
   433
	elsif($suite eq "stdlibs")
hgs
parents:
diff changeset
   434
	{
hgs
parents:
diff changeset
   435
		#my $dst = $ATSRoot."/$suite"."_testsession.xml";
hgs
parents:
diff changeset
   436
		#copy($file, $dst);
hgs
parents:
diff changeset
   437
		GenerateSessionFile("combined",$target,$suite);
hgs
parents:
diff changeset
   438
		exit();
hgs
parents:
diff changeset
   439
	}
hgs
parents:
diff changeset
   440
	foreach my $lib(@liblist)
hgs
parents:
diff changeset
   441
	{          
hgs
parents:
diff changeset
   442
			@generatedModules = GenGenModules($lib);
hgs
parents:
diff changeset
   443
			if(scalar @generatedModules != 0)
hgs
parents:
diff changeset
   444
			{
hgs
parents:
diff changeset
   445
				#print "Generating for $lib\n";
hgs
parents:
diff changeset
   446
				GenerateSessionFile($lib, $target,$lib);
hgs
parents:
diff changeset
   447
			}
hgs
parents:
diff changeset
   448
	}
hgs
parents:
diff changeset
   449
	
hgs
parents:
diff changeset
   450
	#@generatedModules = GetAllModules();
hgs
parents:
diff changeset
   451
	#if(scalar @generatedModules != 0)
hgs
parents:
diff changeset
   452
	#{
hgs
parents:
diff changeset
   453
	#		GenerateSessionFile("combined",$target, "combined");
hgs
parents:
diff changeset
   454
	#}
hgs
parents:
diff changeset
   455
	exit();
hgs
parents:
diff changeset
   456
}#session generation code
hgs
parents:
diff changeset
   457
hgs
parents:
diff changeset
   458
hgs
parents:
diff changeset
   459
if ($suite eq "ltp" || $suite eq "all")
hgs
parents:
diff changeset
   460
{
hgs
parents:
diff changeset
   461
	my @ltpModules = GetLtpModules();
hgs
parents:
diff changeset
   462
	@generatedModules = @ltpModules;
hgs
parents:
diff changeset
   463
	DoGen("ltp", ".dll");
hgs
parents:
diff changeset
   464
	CopyLtpCfg("ltp");
hgs
parents:
diff changeset
   465
	
hgs
parents:
diff changeset
   466
	
hgs
parents:
diff changeset
   467
	my @saved = @dllList;
hgs
parents:
diff changeset
   468
	@dllList = ("ltplib.dll");
hgs
parents:
diff changeset
   469
	CopySharedDlls("ltp", \@dllList);
hgs
parents:
diff changeset
   470
	TransformXmls("ltp","shared");
hgs
parents:
diff changeset
   471
	@dllList = @saved;
hgs
parents:
diff changeset
   472
	
hgs
parents:
diff changeset
   473
	@generatedModules = GetCompiledModules($optsGroupPath."/bld.inf");
hgs
parents:
diff changeset
   474
	DoGen("opts",".dll");
hgs
parents:
diff changeset
   475
hgs
parents:
diff changeset
   476
}
hgs
parents:
diff changeset
   477
if ($suite eq "glib")
hgs
parents:
diff changeset
   478
{
hgs
parents:
diff changeset
   479
	my $bldfile = $templateRoot."/testapps/group/bld.inf";
hgs
parents:
diff changeset
   480
	my @glibModules = GetCompiledModules($bldfile);
hgs
parents:
diff changeset
   481
	@generatedModules = @glibModules;
hgs
parents:
diff changeset
   482
	DoGen("glib",".exe");
hgs
parents:
diff changeset
   483
	my $gDataRef = \@gliblist;
hgs
parents:
diff changeset
   484
	CopyArbitDatFiles("glib",$gDataRef);
hgs
parents:
diff changeset
   485
	
hgs
parents:
diff changeset
   486
	if($install eq "yes")
hgs
parents:
diff changeset
   487
	{
hgs
parents:
diff changeset
   488
		my @saved = @dllList;
hgs
parents:
diff changeset
   489
		my @glib2dllList = ("glibbackend.dll", "Libgobject.dll", "libgmodule.dll", "libgthread.dll",
hgs
parents:
diff changeset
   490
                "libglib.dll");
hgs
parents:
diff changeset
   491
                
hgs
parents:
diff changeset
   492
   my  @glib1List = ( "libgobject.dll", "libgmodule.dll", "libgthread.dll",  "libglib.dll", );
hgs
parents:
diff changeset
   493
  @dllList = @glib2dllList;
hgs
parents:
diff changeset
   494
  CopySharedDlls("glib",\@dllList);     	
hgs
parents:
diff changeset
   495
  TransformXmls("glib", "shared");
hgs
parents:
diff changeset
   496
   	
hgs
parents:
diff changeset
   497
		@dllList = @saved;
hgs
parents:
diff changeset
   498
	}#if install
hgs
parents:
diff changeset
   499
}#glib
hgs
parents:
diff changeset
   500
hgs
parents:
diff changeset
   501
hgs
parents:
diff changeset
   502
if ($suite eq "ssl")
hgs
parents:
diff changeset
   503
{
hgs
parents:
diff changeset
   504
	my $stripStatus = $dontStrip;
hgs
parents:
diff changeset
   505
	$dontStrip = 0;
hgs
parents:
diff changeset
   506
	GenCryptoTest();
hgs
parents:
diff changeset
   507
	if($install eq "yes")
hgs
parents:
diff changeset
   508
	{
hgs
parents:
diff changeset
   509
		@dllList = (@dllList, "libcrypto.dll", "libssl.dll");   
hgs
parents:
diff changeset
   510
	}#if install
hgs
parents:
diff changeset
   511
	$dontStrip = $stripStatus;
hgs
parents:
diff changeset
   512
}#ssl
hgs
parents:
diff changeset
   513
hgs
parents:
diff changeset
   514
if($suite eq "ngi")
hgs
parents:
diff changeset
   515
{
hgs
parents:
diff changeset
   516
hgs
parents:
diff changeset
   517
	GenNgiTest();
hgs
parents:
diff changeset
   518
	CopyNgiXmls();
hgs
parents:
diff changeset
   519
	CopyArbitDatFiles("",\@ngilist);
hgs
parents:
diff changeset
   520
hgs
parents:
diff changeset
   521
}
hgs
parents:
diff changeset
   522
hgs
parents:
diff changeset
   523
if($suite eq "play_new")
hgs
parents:
diff changeset
   524
{
hgs
parents:
diff changeset
   525
	my @play_newModules = ("fonttestmodule", "messagingtestmodule","locationtestmodule", "alertstestmodule", 
hgs
parents:
diff changeset
   526
	"libxmlstiff","ngisvgtestmodule");
hgs
parents:
diff changeset
   527
	@generatedModules = @play_newModules;
hgs
parents:
diff changeset
   528
	DoGen("play_new",".dll");
hgs
parents:
diff changeset
   529
	
hgs
parents:
diff changeset
   530
	 my @list = (
hgs
parents:
diff changeset
   531
  				 			 ["*.cfg", "fonttestmodule", "/../fonts/internal/testmodules/fonttestmodule/group/","/General/", ""],
hgs
parents:
diff changeset
   532
	 				 			 ["*.xml", "fonttestmodule", "/../fonts/internal/testmodules/fonttestmodule/group/","/", ""],
hgs
parents:
diff changeset
   533
	 				 			 
hgs
parents:
diff changeset
   534
	 				 			 ["*.cfg", "messagingtestmodule", "/../ngimessaging/internal/testmodules/messagingtestmodule/group/","/General/", ""],
hgs
parents:
diff changeset
   535
	 				 			 ["*.xml", "messagingtestmodule", "/../ngimessaging/internal/testmodules/messagingtestmodule/group/","/", ""],
hgs
parents:
diff changeset
   536
	 				 			 ["*", "messagingtestmodule", "/EPOC32/winscw/c/messagingtestmodule/","/General/", ""],
hgs
parents:
diff changeset
   537
	 				 			 
hgs
parents:
diff changeset
   538
	 				 			 ["*.cfg", "locationtestmodule", "/../ngilocation/internal/testmodules/locationtestmodule/group/","/General/", ""],
hgs
parents:
diff changeset
   539
	 				 			 ["*.xml", "locationtestmodule", "/../ngilocation/internal/testmodules/locationtestmodule/group/","/", ""],
hgs
parents:
diff changeset
   540
	 				 			 
hgs
parents:
diff changeset
   541
	 				 			 ["*.cfg", "alertstestmodule", "/../ngialerts/internal/testmodules/alertstestmodule/group/","/General/", ""],
hgs
parents:
diff changeset
   542
								 ["*.xml", "alertstestmodule", "/../ngialerts/internal/testmodules/alertstestmodule/group/","/", ""],	 				 			 
hgs
parents:
diff changeset
   543
								 ["vertigo.wav", "alertstestmodule", "/Epoc32/winscw/c/alertstestmodule/","/General/", ""],	 				 			 	 				 			 
hgs
parents:
diff changeset
   544
	 		
hgs
parents:
diff changeset
   545
	 			 			  ["*.cfg", "libxmlstiff", "/../libxmlpp/internal/group/","/General/", ""],
hgs
parents:
diff changeset
   546
	 		 	 			  ["*.xml", "libxmlstiff", "/../libxmlpp/internal/group/","/", ""],
hgs
parents:
diff changeset
   547
	 		 	 			  ["*.*", "libxmlstiff", "/../libxmlpp/internal/data/","/General/", ""],
hgs
parents:
diff changeset
   548
	 		 	 			  
hgs
parents:
diff changeset
   549
	 		 	 			  ["*.cfg", "ngisvgtestmodule", "/../ngisvg/internal/testmodules/ngisvgtestmodule/group/","/General/", ""],
hgs
parents:
diff changeset
   550
   		 	 			  ["*.xml", "ngisvgtestmodule", "/../ngisvg/internal/testmodules/ngisvgtestmodule/group/","/", ""],
hgs
parents:
diff changeset
   551
	 		 	 			  ["*.*", "ngisvgtestmodule", "/epoc32/winscw/c/ngisvgtest/","/General/", ""],
hgs
parents:
diff changeset
   552
	 				 			 
hgs
parents:
diff changeset
   553
  				 );
hgs
parents:
diff changeset
   554
 
hgs
parents:
diff changeset
   555
  my $bDataRef = \@list;  				 
hgs
parents:
diff changeset
   556
	CopyArbitDatFiles("play_new",$bDataRef);  				 
hgs
parents:
diff changeset
   557
	if($install eq "yes")
hgs
parents:
diff changeset
   558
	{
hgs
parents:
diff changeset
   559
		@generatedModules = GenGenModules("play_new");
hgs
parents:
diff changeset
   560
		my @saved = @dllList;
hgs
parents:
diff changeset
   561
		my @playList = (
hgs
parents:
diff changeset
   562
"ngifonts.dll",
hgs
parents:
diff changeset
   563
"ngimessaging.dll",
hgs
parents:
diff changeset
   564
"ngisvg.dll",
hgs
parents:
diff changeset
   565
"ngilocation.dll",
hgs
parents:
diff changeset
   566
"ngialerts.dll",
hgs
parents:
diff changeset
   567
"libstdcpp.dll",
hgs
parents:
diff changeset
   568
"libxmlpp.dll",
hgs
parents:
diff changeset
   569
"FeedsLibXml2xmlpp.dll");
hgs
parents:
diff changeset
   570
       @dllList = @playList;
hgs
parents:
diff changeset
   571
		CopySharedDlls("play_new",\@dllList);     
hgs
parents:
diff changeset
   572
	  TransformXmls("play_new", "shared");
hgs
parents:
diff changeset
   573
		@dllList = @saved;
hgs
parents:
diff changeset
   574
hgs
parents:
diff changeset
   575
	}#end install
hgs
parents:
diff changeset
   576
hgs
parents:
diff changeset
   577
hgs
parents:
diff changeset
   578
}
hgs
parents:
diff changeset
   579
hgs
parents:
diff changeset
   580
if($suite eq "stdcpp")
hgs
parents:
diff changeset
   581
{
hgs
parents:
diff changeset
   582
	@generatedModules = GetstdcppModules();
hgs
parents:
diff changeset
   583
	DoGen("stdcpp",".dll");
hgs
parents:
diff changeset
   584
	CopyLtpCfg("stdcpp");
hgs
parents:
diff changeset
   585
	@generatedModules = GetstdexeModules();
hgs
parents:
diff changeset
   586
	DoGen("stdcpp",".exe");
hgs
parents:
diff changeset
   587
	
hgs
parents:
diff changeset
   588
	my @saved = @dllList;
hgs
parents:
diff changeset
   589
	@dllList = ("stdcxxtestengine.dll");
hgs
parents:
diff changeset
   590
	CopySharedDlls("stdcpp", \@dllList);
hgs
parents:
diff changeset
   591
	TransformXmls("stdcpp","shared");
hgs
parents:
diff changeset
   592
	@dllList = @saved;
hgs
parents:
diff changeset
   593
	
hgs
parents:
diff changeset
   594
	CopyArbitDatFiles("stdcpp",\@stdcpplist);
hgs
parents:
diff changeset
   595
	
hgs
parents:
diff changeset
   596
	if($install eq "yes")
hgs
parents:
diff changeset
   597
	{
hgs
parents:
diff changeset
   598
		@generatedModules = GenGenModules("stdcpp");
hgs
parents:
diff changeset
   599
		my @saved = @dllList;
hgs
parents:
diff changeset
   600
		my @cppList = ("libstdcpp.dll");
hgs
parents:
diff changeset
   601
       @dllList = @cppList;
hgs
parents:
diff changeset
   602
		CopySharedDlls("stdcpp",\@dllList);     
hgs
parents:
diff changeset
   603
	  TransformXmls("stdcpp", "shared");
hgs
parents:
diff changeset
   604
		@dllList = @saved;
hgs
parents:
diff changeset
   605
	}#if install
hgs
parents:
diff changeset
   606
}
hgs
parents:
diff changeset
   607
	
hgs
parents:
diff changeset
   608
hgs
parents:
diff changeset
   609
if($suite eq "lsb" || $suite eq "all")
hgs
parents:
diff changeset
   610
{
hgs
parents:
diff changeset
   611
	my @lsbModules = GetLsbModules();
hgs
parents:
diff changeset
   612
	@generatedModules = @lsbModules;
hgs
parents:
diff changeset
   613
	DoGen("lsb",".exe");
hgs
parents:
diff changeset
   614
	
hgs
parents:
diff changeset
   615
	my @depDlls;
hgs
parents:
diff changeset
   616
	my $dll;
hgs
parents:
diff changeset
   617
	
hgs
parents:
diff changeset
   618
	#copying the common dlls
hgs
parents:
diff changeset
   619
	@depDlls  = 
hgs
parents:
diff changeset
   620
	(
hgs
parents:
diff changeset
   621
	 "libapi.dll",
hgs
parents:
diff changeset
   622
	 "tcm.dll",
hgs
parents:
diff changeset
   623
	 "vlib.dll",
hgs
parents:
diff changeset
   624
	);
hgs
parents:
diff changeset
   625
		
hgs
parents:
diff changeset
   626
	foreach $dll (@depDlls)
hgs
parents:
diff changeset
   627
	{
hgs
parents:
diff changeset
   628
		CopyDeps("lsb",$dll);
hgs
parents:
diff changeset
   629
	}
hgs
parents:
diff changeset
   630
	#now copy the cfg files
hgs
parents:
diff changeset
   631
	CopyLsbCfg("lsb");	
hgs
parents:
diff changeset
   632
	#now copy the extra dependency dlls
hgs
parents:
diff changeset
   633
	
hgs
parents:
diff changeset
   634
	#dlopen
hgs
parents:
diff changeset
   635
	@generatedModules = ("dlopen");
hgs
parents:
diff changeset
   636
	
hgs
parents:
diff changeset
   637
	
hgs
parents:
diff changeset
   638
	
hgs
parents:
diff changeset
   639
	@depDlls  = 
hgs
parents:
diff changeset
   640
	(
hgs
parents:
diff changeset
   641
	 "dynlibtest.1.dll",
hgs
parents:
diff changeset
   642
	 "dynlibtest.11.1.dll",
hgs
parents:
diff changeset
   643
	 "dynlibtest.11.2.dll",
hgs
parents:
diff changeset
   644
	 "dynlibtest.12g.dll",
hgs
parents:
diff changeset
   645
	 "dynlibtest.12r.dll",
hgs
parents:
diff changeset
   646
	 "dynlibtest.14.1.dll",
hgs
parents:
diff changeset
   647
	 "dynlibtest.14.2.dll",
hgs
parents:
diff changeset
   648
	 "dynlibtest.14.3.dll",
hgs
parents:
diff changeset
   649
	 "dynlibtest.3.1.dll",
hgs
parents:
diff changeset
   650
	 "dynlibtest.3.2.dll",
hgs
parents:
diff changeset
   651
	 "dynlibtest.3.dll",
hgs
parents:
diff changeset
   652
	 "dynlibtest.4.dll",
hgs
parents:
diff changeset
   653
	 "dynlibtest.8.dll",
hgs
parents:
diff changeset
   654
	 "dynlibtest.9.dll",
hgs
parents:
diff changeset
   655
	 "dynlibtest.3.dll",
hgs
parents:
diff changeset
   656
	 "dynlibtest.8.dll",
hgs
parents:
diff changeset
   657
	);
hgs
parents:
diff changeset
   658
	
hgs
parents:
diff changeset
   659
	foreach $dll (@depDlls)
hgs
parents:
diff changeset
   660
	{
hgs
parents:
diff changeset
   661
		CopyDeps("lsb",$dll);
hgs
parents:
diff changeset
   662
	}
hgs
parents:
diff changeset
   663
	
hgs
parents:
diff changeset
   664
	#dlclose
hgs
parents:
diff changeset
   665
	@generatedModules = ("dlclose");
hgs
parents:
diff changeset
   666
	@depDlls = ("dynlibclose.1.dll");
hgs
parents:
diff changeset
   667
	foreach $dll (@depDlls)
hgs
parents:
diff changeset
   668
	{
hgs
parents:
diff changeset
   669
		CopyDeps("lsb",$dll);
hgs
parents:
diff changeset
   670
	}
hgs
parents:
diff changeset
   671
	
hgs
parents:
diff changeset
   672
	#dlerror
hgs
parents:
diff changeset
   673
	@generatedModules = ("dlerror");
hgs
parents:
diff changeset
   674
	@depDlls = ("dynlib.dll");
hgs
parents:
diff changeset
   675
	foreach $dll (@depDlls)
hgs
parents:
diff changeset
   676
	{
hgs
parents:
diff changeset
   677
		CopyDeps("lsb",$dll);
hgs
parents:
diff changeset
   678
	}
hgs
parents:
diff changeset
   679
	
hgs
parents:
diff changeset
   680
	#now copy the xmls!
hgs
parents:
diff changeset
   681
	my $srcDir = $templateRoot."/ts/lsbsuites/group/";
hgs
parents:
diff changeset
   682
	
hgs
parents:
diff changeset
   683
	my $dst;
hgs
parents:
diff changeset
   684
	
hgs
parents:
diff changeset
   685
	foreach my $dllib("dlopen", "dlclose", "dlerror")
hgs
parents:
diff changeset
   686
	{
hgs
parents:
diff changeset
   687
		$dst  = $ATSRoot."\\components\\lsb_".$dllib."\\";
hgs
parents:
diff changeset
   688
		copy($srcDir."/lsb_".$dllib."_module_blr_hw_component.xml", $dst) || die("DIED: unable to copy from $srcDir!\n");
hgs
parents:
diff changeset
   689
		copy($srcDir."/lsb_".$dllib."_module_blr_winsspd_component.xml", $dst) || die("DIED: unable to copy from $srcDir!\n");
hgs
parents:
diff changeset
   690
	}
hgs
parents:
diff changeset
   691
	
hgs
parents:
diff changeset
   692
}
hgs
parents:
diff changeset
   693
hgs
parents:
diff changeset
   694
if($suite eq "gcce")
hgs
parents:
diff changeset
   695
{
hgs
parents:
diff changeset
   696
hgs
parents:
diff changeset
   697
	mkdir $ATSRoot;
hgs
parents:
diff changeset
   698
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
   699
	
hgs
parents:
diff changeset
   700
	@generatedModules = ("gcce-validate", "gcce-load");
hgs
parents:
diff changeset
   701
		
hgs
parents:
diff changeset
   702
	my @depDlls  = 
hgs
parents:
diff changeset
   703
	(
hgs
parents:
diff changeset
   704
		"gcce-lib.dll",
hgs
parents:
diff changeset
   705
	);
hgs
parents:
diff changeset
   706
	
hgs
parents:
diff changeset
   707
	my $suffix = ".exe";
hgs
parents:
diff changeset
   708
	my $libname = "gcce";
hgs
parents:
diff changeset
   709
	
hgs
parents:
diff changeset
   710
	
hgs
parents:
diff changeset
   711
	my $src;
hgs
parents:
diff changeset
   712
	my $dst;
hgs
parents:
diff changeset
   713
	foreach my $module(@generatedModules)
hgs
parents:
diff changeset
   714
	{
hgs
parents:
diff changeset
   715
		my $relroot = $ATSRoot."\\components\\$libname"."_$module";
hgs
parents:
diff changeset
   716
		mkdir $relroot || die("DIED: unable to create dir $module\n");
hgs
parents:
diff changeset
   717
		mkdir $relroot."\\armv5_urel" || die("DIED: unable to create dir $relroot\\armv5_urel\n");
hgs
parents:
diff changeset
   718
		
hgs
parents:
diff changeset
   719
		#GenExeXmls($module,$libname);
hgs
parents:
diff changeset
   720
		
hgs
parents:
diff changeset
   721
		$src = $rootDrive."\\epoc32\\release\\gcce\\urel\\".$module.$suffix;
hgs
parents:
diff changeset
   722
		$dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
hgs
parents:
diff changeset
   723
		$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
   724
		copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
   725
	}
hgs
parents:
diff changeset
   726
	$src = $rootDrive."\\epoc32\\release\\gcce\\urel\\"."gcce-lib.dll";
hgs
parents:
diff changeset
   727
	$dst = $ATSRoot."\\components\\gcce_gcce-load";
hgs
parents:
diff changeset
   728
	$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
   729
	copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
   730
	
hgs
parents:
diff changeset
   731
	
hgs
parents:
diff changeset
   732
	my @list = (
hgs
parents:
diff changeset
   733
  				 ["gcce_gcce-load_module_blr_hw_component.xml", "gcce-load", "./","/", ""],
hgs
parents:
diff changeset
   734
  				 ["gcce_gcce-validate_module_blr_hw_component.xml", "gcce-validate", "./","/", ""],
hgs
parents:
diff changeset
   735
  				 );
hgs
parents:
diff changeset
   736
 
hgs
parents:
diff changeset
   737
  my $bDataRef = \@list;  				 
hgs
parents:
diff changeset
   738
	CopyArbitDatFiles("gcce",$bDataRef);  				 
hgs
parents:
diff changeset
   739
hgs
parents:
diff changeset
   740
	
hgs
parents:
diff changeset
   741
}#if gcce
hgs
parents:
diff changeset
   742
hgs
parents:
diff changeset
   743
hgs
parents:
diff changeset
   744
hgs
parents:
diff changeset
   745
if($suite eq "libc-locale")
hgs
parents:
diff changeset
   746
{
hgs
parents:
diff changeset
   747
	$dontStrip = 0;
hgs
parents:
diff changeset
   748
	mkdir $ATSRoot;
hgs
parents:
diff changeset
   749
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
   750
	
hgs
parents:
diff changeset
   751
	@generatedModules = ("tstring");
hgs
parents:
diff changeset
   752
	DoGen("libc",".dll");
hgs
parents:
diff changeset
   753
	
hgs
parents:
diff changeset
   754
	my @localelist = (
hgs
parents:
diff changeset
   755
	  				 ["locales.txt", "string", "../libc/internal/testapps/tstring/data/", "/General/", ""],
hgs
parents:
diff changeset
   756
	  				 ["tstring_locale_component.xml", "string", "../libc/internal/testapps/tstring/group/", "/", ""],
hgs
parents:
diff changeset
   757
	 
hgs
parents:
diff changeset
   758
	  				 );
hgs
parents:
diff changeset
   759
		
hgs
parents:
diff changeset
   760
  my $bDataRef = \@localelist;  				 
hgs
parents:
diff changeset
   761
	CopyArbitDatFiles("libc",$bDataRef);  				 
hgs
parents:
diff changeset
   762
	#delete($ATSRoot."/components/libc_string/"."libc_string_module_blr_hw_component.xml") || die("unable to delete");
hgs
parents:
diff changeset
   763
	my $my_src = $ATSRoot."/components/libc_string/"."tstring_locale_component.xml";
hgs
parents:
diff changeset
   764
	my $my_dst = $ATSRoot."/components/libc_string/"."libc_string_module_blr_hw_component.xml";
hgs
parents:
diff changeset
   765
	
hgs
parents:
diff changeset
   766
	unlink($my_dst) ||warn("unable to delete $my_dst");
hgs
parents:
diff changeset
   767
	rename($my_src,$my_dst) || move($my_src,$my_dst) || die("Unable to rename!");
hgs
parents:
diff changeset
   768
	
hgs
parents:
diff changeset
   769
}#if libc-locale
hgs
parents:
diff changeset
   770
hgs
parents:
diff changeset
   771
hgs
parents:
diff changeset
   772
if($suite eq "pcts")
hgs
parents:
diff changeset
   773
{
hgs
parents:
diff changeset
   774
	my $bldfile = $templateRoot."/group/bld.inf";
hgs
parents:
diff changeset
   775
	my @pctsModules = GetCompiledModules($bldfile);
hgs
parents:
diff changeset
   776
	@generatedModules = @pctsModules;
hgs
parents:
diff changeset
   777
	DoGen("pcts",".exe");
hgs
parents:
diff changeset
   778
	
hgs
parents:
diff changeset
   779
	my @depDlls;
hgs
parents:
diff changeset
   780
	my $dll;
hgs
parents:
diff changeset
   781
	
hgs
parents:
diff changeset
   782
	
hgs
parents:
diff changeset
   783
	#copying the common dlls
hgs
parents:
diff changeset
   784
	@depDlls  = 
hgs
parents:
diff changeset
   785
	(
hgs
parents:
diff changeset
   786
		"vsxlibapi.dll",
hgs
parents:
diff changeset
   787
		"rttm.exe",
hgs
parents:
diff changeset
   788
		"rtlibapi.dll",
hgs
parents:
diff changeset
   789
		"vsxvlib.dll",
hgs
parents:
diff changeset
   790
		"vsxgenlib.dll",
hgs
parents:
diff changeset
   791
		"vsxtsetlib.dll",
hgs
parents:
diff changeset
   792
		"vsxvport.dll",
hgs
parents:
diff changeset
   793
	);
hgs
parents:
diff changeset
   794
	
hgs
parents:
diff changeset
   795
	if($install eq "yes")
hgs
parents:
diff changeset
   796
	{
hgs
parents:
diff changeset
   797
		my @saved = @dllList; 
hgs
parents:
diff changeset
   798
		@dllList = @depDlls;	
hgs
parents:
diff changeset
   799
		CopySharedDlls("pcts", \@depDlls);
hgs
parents:
diff changeset
   800
		TransformXmls("pcts","shared");
hgs
parents:
diff changeset
   801
		@dllList = @saved;
hgs
parents:
diff changeset
   802
		
hgs
parents:
diff changeset
   803
		#now copy the cfg files
hgs
parents:
diff changeset
   804
		my $dst;
hgs
parents:
diff changeset
   805
		my $srcDir = "/epoc32/winscw/c/data/tet/";
hgs
parents:
diff changeset
   806
		my $file1 = $srcDir."tet_code";
hgs
parents:
diff changeset
   807
		my $file2 = $srcDir."tetexec.cfg";
hgs
parents:
diff changeset
   808
		foreach my $module(@generatedModules)
hgs
parents:
diff changeset
   809
		{
hgs
parents:
diff changeset
   810
			$dst = $ATSRoot."\\components\\pcts_".$module;
hgs
parents:
diff changeset
   811
			$dst = $dst."\\General\\";
hgs
parents:
diff changeset
   812
			copy($file1, $dst) or die "copy: $! $file1 $dst";
hgs
parents:
diff changeset
   813
			copy($file2,$dst) or die "copy: $! $file2 $dst";
hgs
parents:
diff changeset
   814
		}
hgs
parents:
diff changeset
   815
	}
hgs
parents:
diff changeset
   816
		
hgs
parents:
diff changeset
   817
	
hgs
parents:
diff changeset
   818
	
hgs
parents:
diff changeset
   819
	
hgs
parents:
diff changeset
   820
	my $dst;	
hgs
parents:
diff changeset
   821
	foreach my $module(@generatedModules)
hgs
parents:
diff changeset
   822
	{
hgs
parents:
diff changeset
   823
		my $file3 = "/epoc32/winscw/c/logs/tet/m.".$module;
hgs
parents:
diff changeset
   824
hgs
parents:
diff changeset
   825
		$dst = $ATSRoot."\\components\\pcts_".$module;
hgs
parents:
diff changeset
   826
		$dst = $dst."\\General\\";
hgs
parents:
diff changeset
   827
		copy($file3, $dst) or die "copy: $! $file3 $dst";
hgs
parents:
diff changeset
   828
	}#module
hgs
parents:
diff changeset
   829
}
hgs
parents:
diff changeset
   830
hgs
parents:
diff changeset
   831
hgs
parents:
diff changeset
   832
hgs
parents:
diff changeset
   833
$dontStrip = 0;
hgs
parents:
diff changeset
   834
hgs
parents:
diff changeset
   835
if($suite eq "stdlibs" || $suite eq "all")
hgs
parents:
diff changeset
   836
{
hgs
parents:
diff changeset
   837
	@generatedModules = ("tzlib");
hgs
parents:
diff changeset
   838
	DoGen("libz", ".dll");
hgs
parents:
diff changeset
   839
hgs
parents:
diff changeset
   840
	@generatedModules = ("tlibcrypt");
hgs
parents:
diff changeset
   841
	DoGen("libcrypt",".dll");
hgs
parents:
diff changeset
   842
hgs
parents:
diff changeset
   843
	@generatedModules = @libcModules;
hgs
parents:
diff changeset
   844
	DoGen("libc",".dll");
hgs
parents:
diff changeset
   845
	GenBackendTest();
hgs
parents:
diff changeset
   846
	
hgs
parents:
diff changeset
   847
	@generatedModules = ("twchar");
hgs
parents:
diff changeset
   848
	CopyDeps("libc","twchar_helloworld.exe");
hgs
parents:
diff changeset
   849
	
hgs
parents:
diff changeset
   850
	@generatedModules = ("twopen");
hgs
parents:
diff changeset
   851
	CopyDeps("libc","twpopenwritechild.exe");
hgs
parents:
diff changeset
   852
	CopyDeps("libc","twpopenreadchild.exe");
hgs
parents:
diff changeset
   853
hgs
parents:
diff changeset
   854
hgs
parents:
diff changeset
   855
	@generatedModules = @libdlModules;
hgs
parents:
diff changeset
   856
	DoGen("libdl",".dll");
hgs
parents:
diff changeset
   857
	CopyDeps("libdl","Dll1.dll");
hgs
parents:
diff changeset
   858
	CopyDeps("libdl","Dll2.dll");
hgs
parents:
diff changeset
   859
	CopyDeps("libdl","DependencyTestDll.dll");
hgs
parents:
diff changeset
   860
hgs
parents:
diff changeset
   861
	@generatedModules = @libmModules;
hgs
parents:
diff changeset
   862
	DoGen("libm",".dll");
hgs
parents:
diff changeset
   863
hgs
parents:
diff changeset
   864
	$TDIR = "\\internal\\";
hgs
parents:
diff changeset
   865
	@generatedModules = @pthreadModules;
hgs
parents:
diff changeset
   866
	DoGen("libpthread",".dll");
hgs
parents:
diff changeset
   867
	CopyDeps("libpthread","testharness.dll");
hgs
parents:
diff changeset
   868
hgs
parents:
diff changeset
   869
	CopyDatFiles();
hgs
parents:
diff changeset
   870
}
hgs
parents:
diff changeset
   871
hgs
parents:
diff changeset
   872
if($install eq "yes")
hgs
parents:
diff changeset
   873
{
hgs
parents:
diff changeset
   874
	foreach my $lib(@liblist)
hgs
parents:
diff changeset
   875
	{   
hgs
parents:
diff changeset
   876
		#print "Transforming lib $lib\n";       
hgs
parents:
diff changeset
   877
		@generatedModules = GenGenModules($lib);
hgs
parents:
diff changeset
   878
		my @oldList = @dllList;
hgs
parents:
diff changeset
   879
		if($do_winscw)
hgs
parents:
diff changeset
   880
  	{
hgs
parents:
diff changeset
   881
  		@dllList = (@dllList, "wsdsoln.dll", "libestw32.dll");
hgs
parents:
diff changeset
   882
  		CopySharedDlls($lib,\@dllList,"winscw");     	
hgs
parents:
diff changeset
   883
	  	TransformXmls($lib, "shared","winscw");
hgs
parents:
diff changeset
   884
  	}
hgs
parents:
diff changeset
   885
  	@dllList = @oldList;
hgs
parents:
diff changeset
   886
  	if($do_armv5)
hgs
parents:
diff changeset
   887
  	{
hgs
parents:
diff changeset
   888
	  	CopySharedDlls($lib,\@dllList,"armv5");     	
hgs
parents:
diff changeset
   889
	  	TransformXmls($lib, "shared","armv5");
hgs
parents:
diff changeset
   890
  	}
hgs
parents:
diff changeset
   891
	}#FOREACH
hgs
parents:
diff changeset
   892
}#if install
hgs
parents:
diff changeset
   893
hgs
parents:
diff changeset
   894
hgs
parents:
diff changeset
   895
hgs
parents:
diff changeset
   896
#function to generate ModuleList for a compiled bld.inf
hgs
parents:
diff changeset
   897
sub GetCompiledModules($)
hgs
parents:
diff changeset
   898
{
hgs
parents:
diff changeset
   899
	my $file = shift @_;
hgs
parents:
diff changeset
   900
	my @moduleList;
hgs
parents:
diff changeset
   901
	
hgs
parents:
diff changeset
   902
	
hgs
parents:
diff changeset
   903
	# Open input file
hgs
parents:
diff changeset
   904
	open (INFILE, "<".$file ) || die ("DIED: Can not find $file!");
hgs
parents:
diff changeset
   905
hgs
parents:
diff changeset
   906
	while (<INFILE>)
hgs
parents:
diff changeset
   907
	{
hgs
parents:
diff changeset
   908
		if(/(.*)\.mmp/ && $1 !~ /^\/\//) 
hgs
parents:
diff changeset
   909
	  {
hgs
parents:
diff changeset
   910
	  		if($_ !~ /\/\/Not for ATS/)
hgs
parents:
diff changeset
   911
	  		{
hgs
parents:
diff changeset
   912
	  			push @moduleList, $1;
hgs
parents:
diff changeset
   913
	  		}
hgs
parents:
diff changeset
   914
	  }
hgs
parents:
diff changeset
   915
	}
hgs
parents:
diff changeset
   916
	close (INFILE);
hgs
parents:
diff changeset
   917
	return @moduleList;
hgs
parents:
diff changeset
   918
}
hgs
parents:
diff changeset
   919
hgs
parents:
diff changeset
   920
my @groupList;
hgs
parents:
diff changeset
   921
sub GetLtpModules()
hgs
parents:
diff changeset
   922
{
hgs
parents:
diff changeset
   923
        my $prevDir = getcwd();
hgs
parents:
diff changeset
   924
        my @rootList = ("kernel", "misc");
hgs
parents:
diff changeset
   925
        my @totalgroupList;
hgs
parents:
diff changeset
   926
        foreach my $node(@rootList)
hgs
parents:
diff changeset
   927
        {
hgs
parents:
diff changeset
   928
        	chdir $ltpPath."/$node";
hgs
parents:
diff changeset
   929
        	@groupList = ();
hgs
parents:
diff changeset
   930
        	find(\&MakeGroupList, ".");
hgs
parents:
diff changeset
   931
        	@totalgroupList = (@totalgroupList, @groupList);
hgs
parents:
diff changeset
   932
        }
hgs
parents:
diff changeset
   933
        chdir $prevDir;
hgs
parents:
diff changeset
   934
        return @totalgroupList;
hgs
parents:
diff changeset
   935
}
hgs
parents:
diff changeset
   936
hgs
parents:
diff changeset
   937
sub GetstdexeModules()
hgs
parents:
diff changeset
   938
{
hgs
parents:
diff changeset
   939
      my $prevDir = getcwd();
hgs
parents:
diff changeset
   940
      my @fullList = ();
hgs
parents:
diff changeset
   941
      foreach my $group(@stdexeList)
hgs
parents:
diff changeset
   942
      {
hgs
parents:
diff changeset
   943
      	my $groupPath = $templateRoot."/testapps/".$group. "/";
hgs
parents:
diff changeset
   944
      	chdir $groupPath;
hgs
parents:
diff changeset
   945
      	@groupList = ();
hgs
parents:
diff changeset
   946
      	find(\&grovelAllMmpFiles, ".");
hgs
parents:
diff changeset
   947
      	chdir $prevDir;
hgs
parents:
diff changeset
   948
      	@fullList = (@fullList,@groupList);
hgs
parents:
diff changeset
   949
      }
hgs
parents:
diff changeset
   950
      return @fullList;      
hgs
parents:
diff changeset
   951
}
hgs
parents:
diff changeset
   952
hgs
parents:
diff changeset
   953
sub grovelAllMmpFiles()
hgs
parents:
diff changeset
   954
{
hgs
parents:
diff changeset
   955
	if($_ =~ /(.*)\.mmp/ && ! ($_ =~ /manual/))
hgs
parents:
diff changeset
   956
	{
hgs
parents:
diff changeset
   957
		push @groupList, $1;#get name of module
hgs
parents:
diff changeset
   958
	}
hgs
parents:
diff changeset
   959
}
hgs
parents:
diff changeset
   960
hgs
parents:
diff changeset
   961
sub GetstdcppModules()
hgs
parents:
diff changeset
   962
{
hgs
parents:
diff changeset
   963
        my $prevDir = getcwd();
hgs
parents:
diff changeset
   964
        my @rootList = ("auto");
hgs
parents:
diff changeset
   965
        my @totalgroupList;
hgs
parents:
diff changeset
   966
        foreach my $node(@rootList)
hgs
parents:
diff changeset
   967
        {
hgs
parents:
diff changeset
   968
        	chdir $stdcppPath."/$node";
hgs
parents:
diff changeset
   969
        	@groupList = ();
hgs
parents:
diff changeset
   970
        	find(\&MakeGroupList, ".");
hgs
parents:
diff changeset
   971
        	@totalgroupList = (@totalgroupList, @groupList);
hgs
parents:
diff changeset
   972
        }
hgs
parents:
diff changeset
   973
        chdir $prevDir;
hgs
parents:
diff changeset
   974
        return @totalgroupList;
hgs
parents:
diff changeset
   975
}
hgs
parents:
diff changeset
   976
hgs
parents:
diff changeset
   977
sub GetTstdcppModules()
hgs
parents:
diff changeset
   978
{
hgs
parents:
diff changeset
   979
      my $prevDir = getcwd();
hgs
parents:
diff changeset
   980
      #chdir $tstdcppPath;
hgs
parents:
diff changeset
   981
      @groupList = ();
hgs
parents:
diff changeset
   982
      find(\&grovelAllMmpFiles, ".");
hgs
parents:
diff changeset
   983
      chdir $prevDir;
hgs
parents:
diff changeset
   984
      return @groupList;
hgs
parents:
diff changeset
   985
}
hgs
parents:
diff changeset
   986
hgs
parents:
diff changeset
   987
sub MakeGroupList()
hgs
parents:
diff changeset
   988
{
hgs
parents:
diff changeset
   989
	my $currentDir = $File::Find::dir;
hgs
parents:
diff changeset
   990
	
hgs
parents:
diff changeset
   991
	#print "Current dir:$currentDir\n";
hgs
parents:
diff changeset
   992
	if( $currentDir =~ /.*\/(.*)\/group/)
hgs
parents:
diff changeset
   993
	{
hgs
parents:
diff changeset
   994
		if($cfglocation{$1} eq "")
hgs
parents:
diff changeset
   995
		{
hgs
parents:
diff changeset
   996
			$cfglocation{$1} = getcwd()."\/$1.cfg";
hgs
parents:
diff changeset
   997
			push @groupList, $1;#get name of module
hgs
parents:
diff changeset
   998
		}#first time in group
hgs
parents:
diff changeset
   999
	}#group found
hgs
parents:
diff changeset
  1000
}#subrtn end
hgs
parents:
diff changeset
  1001
hgs
parents:
diff changeset
  1002
hgs
parents:
diff changeset
  1003
#function that generates the ATS setup
hgs
parents:
diff changeset
  1004
sub DoGen($$)
hgs
parents:
diff changeset
  1005
{
hgs
parents:
diff changeset
  1006
	my $libname = shift @_;
hgs
parents:
diff changeset
  1007
	my $ext = shift @_;
hgs
parents:
diff changeset
  1008
	mkdir $ATSRoot;
hgs
parents:
diff changeset
  1009
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
  1010
	
hgs
parents:
diff changeset
  1011
	
hgs
parents:
diff changeset
  1012
	GenDirs($libname);
hgs
parents:
diff changeset
  1013
	my $module;
hgs
parents:
diff changeset
  1014
	foreach my $listed(@generatedModules)
hgs
parents:
diff changeset
  1015
	{
hgs
parents:
diff changeset
  1016
	my @filesToProcess =
hgs
parents:
diff changeset
  1017
        (
hgs
parents:
diff changeset
  1018
         "LibXXX_ATSTemplateXXX_module_blr_hw_component.xml",
hgs
parents:
diff changeset
  1019
         "LibXXX_ATSTemplateXXX_module_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1020
         "testframework.ini",
hgs
parents:
diff changeset
  1021
        );
hgs
parents:
diff changeset
  1022
		if(rindex($noXmlsGenList, $libname) != -1 )	
hgs
parents:
diff changeset
  1023
		{
hgs
parents:
diff changeset
  1024
			@filesToProcess = ("testframework.ini",);
hgs
parents:
diff changeset
  1025
		}
hgs
parents:
diff changeset
  1026
hgs
parents:
diff changeset
  1027
			if($ext eq ".exe")
hgs
parents:
diff changeset
  1028
			{
hgs
parents:
diff changeset
  1029
				GenExeXmls($listed,$libname);
hgs
parents:
diff changeset
  1030
			}
hgs
parents:
diff changeset
  1031
			else
hgs
parents:
diff changeset
  1032
			{
hgs
parents:
diff changeset
  1033
				#just in case no xml file was supplied
hgs
parents:
diff changeset
  1034
				
hgs
parents:
diff changeset
  1035
        my $ref = \@filesToProcess;
hgs
parents:
diff changeset
  1036
				GenXmls($libname, $listed,$ref);
hgs
parents:
diff changeset
  1037
			}
hgs
parents:
diff changeset
  1038
	}#foreach
hgs
parents:
diff changeset
  1039
	
hgs
parents:
diff changeset
  1040
	CopyDlls($libname,$ext);
hgs
parents:
diff changeset
  1041
	#copy the provided cfg, ini and xmls
hgs
parents:
diff changeset
  1042
	if($libname eq "opts")
hgs
parents:
diff changeset
  1043
	{
hgs
parents:
diff changeset
  1044
		CopyOptsCfg($libname);
hgs
parents:
diff changeset
  1045
	}
hgs
parents:
diff changeset
  1046
	elsif($libname eq "ltp" || $libname eq "lsb" || $libname eq "glib")
hgs
parents:
diff changeset
  1047
	{
hgs
parents:
diff changeset
  1048
	  #copy latter and  dont copy respectively for ltp and lsb
hgs
parents:
diff changeset
  1049
	}
hgs
parents:
diff changeset
  1050
	else
hgs
parents:
diff changeset
  1051
	{
hgs
parents:
diff changeset
  1052
	  CopyCfgIniXmls($libname);
hgs
parents:
diff changeset
  1053
	}
hgs
parents:
diff changeset
  1054
}
hgs
parents:
diff changeset
  1055
hgs
parents:
diff changeset
  1056
sub CopyCfgIniXmls()
hgs
parents:
diff changeset
  1057
{
hgs
parents:
diff changeset
  1058
	my $libname = pop @_;
hgs
parents:
diff changeset
  1059
	
hgs
parents:
diff changeset
  1060
	my $libRoot = $templateRoot;
hgs
parents:
diff changeset
  1061
	$libRoot =~ /(.*)internal.*/;
hgs
parents:
diff changeset
  1062
	$libRoot = $1;
hgs
parents:
diff changeset
  1063
hgs
parents:
diff changeset
  1064
hgs
parents:
diff changeset
  1065
	my $module;
hgs
parents:
diff changeset
  1066
	my $src;
hgs
parents:
diff changeset
  1067
	my $dst;
hgs
parents:
diff changeset
  1068
		
hgs
parents:
diff changeset
  1069
	foreach my $listed(@generatedModules)
hgs
parents:
diff changeset
  1070
	{
hgs
parents:
diff changeset
  1071
	  my $dirname = $listed;
hgs
parents:
diff changeset
  1072
	  $dirname =~ s/test/t/;
hgs
parents:
diff changeset
  1073
	  $module = StripModulePrefix($listed);
hgs
parents:
diff changeset
  1074
	    
hgs
parents:
diff changeset
  1075
		$src = $libRoot.$libname.$TDIR.$dirname."\\group\\";
hgs
parents:
diff changeset
  1076
				
hgs
parents:
diff changeset
  1077
		my $xmlCopied = "0";
hgs
parents:
diff changeset
  1078
		my @globpattern = ("*.ini", "*.xml","*.cfg");
hgs
parents:
diff changeset
  1079
		foreach my $pat(@globpattern)
hgs
parents:
diff changeset
  1080
		{
hgs
parents:
diff changeset
  1081
			$dst = $ATSRoot."\\components\\".$libname."_".$module;
hgs
parents:
diff changeset
  1082
			if($pat ne "*.xml")
hgs
parents:
diff changeset
  1083
			{
hgs
parents:
diff changeset
  1084
				$dst = $dst."\\General\\";
hgs
parents:
diff changeset
  1085
			}
hgs
parents:
diff changeset
  1086
			else
hgs
parents:
diff changeset
  1087
			{
hgs
parents:
diff changeset
  1088
				$dst = $dst."\\";
hgs
parents:
diff changeset
  1089
			}
hgs
parents:
diff changeset
  1090
			my @filesFound = glob($src."\\$pat");
hgs
parents:
diff changeset
  1091
			if(scalar @filesFound eq "0")
hgs
parents:
diff changeset
  1092
			{
hgs
parents:
diff changeset
  1093
				#print "No files found for module $module $pat!\n";
hgs
parents:
diff changeset
  1094
				#print $src;
hgs
parents:
diff changeset
  1095
			}
hgs
parents:
diff changeset
  1096
			
hgs
parents:
diff changeset
  1097
			#handcoded
hgs
parents:
diff changeset
  1098
			if($pat eq "*.cfg" && $xmlCopied eq "0")#rename only if xml not copied
hgs
parents:
diff changeset
  1099
			{
hgs
parents:
diff changeset
  1100
				if(scalar @filesFound > 1)
hgs
parents:
diff changeset
  1101
				{
hgs
parents:
diff changeset
  1102
					print "Multiple cfg files found. Copying all!\n";
hgs
parents:
diff changeset
  1103
				}
hgs
parents:
diff changeset
  1104
				else
hgs
parents:
diff changeset
  1105
				{
hgs
parents:
diff changeset
  1106
						$dst = $dst.$listed.".cfg";
hgs
parents:
diff changeset
  1107
				}
hgs
parents:
diff changeset
  1108
			}				
hgs
parents:
diff changeset
  1109
			elsif($pat eq "*.xml")
hgs
parents:
diff changeset
  1110
			{
hgs
parents:
diff changeset
  1111
				my $folder = $dst;
hgs
parents:
diff changeset
  1112
				foreach my $from (@filesFound) 
hgs
parents:
diff changeset
  1113
				{
hgs
parents:
diff changeset
  1114
					if($from =~ /winscw_component/)
hgs
parents:
diff changeset
  1115
					{
hgs
parents:
diff changeset
  1116
						$dst = $folder.$libname."_".$module."_module_blr_winscw_component.xml";
hgs
parents:
diff changeset
  1117
						copy($from, $dst) or die "DIED: copy: $! $from $dst";
hgs
parents:
diff changeset
  1118
						$xmlCopied = "1";
hgs
parents:
diff changeset
  1119
					}
hgs
parents:
diff changeset
  1120
					elsif($from =~ /winsspd_component/)
hgs
parents:
diff changeset
  1121
					{
hgs
parents:
diff changeset
  1122
						$dst = $folder.$libname."_".$module."_module_blr_winsspd_component.xml";
hgs
parents:
diff changeset
  1123
						copy($from, $dst) or die "DIED: copy: $! $from $dst";
hgs
parents:
diff changeset
  1124
						$xmlCopied = "1";
hgs
parents:
diff changeset
  1125
					}
hgs
parents:
diff changeset
  1126
					elsif($from =~ /hw_component/)
hgs
parents:
diff changeset
  1127
					{
hgs
parents:
diff changeset
  1128
						$dst = $folder.$libname."_".$module."_module_blr_hw_component.xml";
hgs
parents:
diff changeset
  1129
						copy($from, $dst) or die "DIED: copy: $! $from $dst";
hgs
parents:
diff changeset
  1130
						$xmlCopied = "1";
hgs
parents:
diff changeset
  1131
					}
hgs
parents:
diff changeset
  1132
				}#examine individually			
hgs
parents:
diff changeset
  1133
				if(scalar @filesFound > 2)
hgs
parents:
diff changeset
  1134
				{
hgs
parents:
diff changeset
  1135
					#print "Multiple xml files found!!!\n";
hgs
parents:
diff changeset
  1136
				}
hgs
parents:
diff changeset
  1137
				@filesFound = ();
hgs
parents:
diff changeset
  1138
			}	
hgs
parents:
diff changeset
  1139
				
hgs
parents:
diff changeset
  1140
			
hgs
parents:
diff changeset
  1141
			foreach my $from (@filesFound) 
hgs
parents:
diff changeset
  1142
			{
hgs
parents:
diff changeset
  1143
					copy($from, $dst) or die "DIED: copy: $! $from $dst";
hgs
parents:
diff changeset
  1144
			}#copy individually			
hgs
parents:
diff changeset
  1145
		}#globpattern
hgs
parents:
diff changeset
  1146
	}#module
hgs
parents:
diff changeset
  1147
}#fn
hgs
parents:
diff changeset
  1148
hgs
parents:
diff changeset
  1149
#copy the cfg files for the opts test suite
hgs
parents:
diff changeset
  1150
sub CopyOptsCfg()
hgs
parents:
diff changeset
  1151
{
hgs
parents:
diff changeset
  1152
	my $libname = pop @_;
hgs
parents:
diff changeset
  1153
	
hgs
parents:
diff changeset
  1154
	my $libRoot = $optsGroupPath."\\";
hgs
parents:
diff changeset
  1155
	my $module;
hgs
parents:
diff changeset
  1156
	my $src;
hgs
parents:
diff changeset
  1157
	my $dst;
hgs
parents:
diff changeset
  1158
		
hgs
parents:
diff changeset
  1159
	foreach $module(@generatedModules)
hgs
parents:
diff changeset
  1160
	{
hgs
parents:
diff changeset
  1161
		$src = $libRoot.$module."\.cfg";
hgs
parents:
diff changeset
  1162
		$dst = $ATSRoot."\\components\\".$libname."_".$module;
hgs
parents:
diff changeset
  1163
		$dst = $dst."\\General\\";
hgs
parents:
diff changeset
  1164
		copy($src, $dst) or warn "copy: $! $src $dst";
hgs
parents:
diff changeset
  1165
	}#module
hgs
parents:
diff changeset
  1166
}#fn
hgs
parents:
diff changeset
  1167
hgs
parents:
diff changeset
  1168
#copy the lsb cfg files
hgs
parents:
diff changeset
  1169
sub CopyLsbCfg()
hgs
parents:
diff changeset
  1170
{
hgs
parents:
diff changeset
  1171
	my $libname = pop @_;
hgs
parents:
diff changeset
  1172
	
hgs
parents:
diff changeset
  1173
	my $module;
hgs
parents:
diff changeset
  1174
	
hgs
parents:
diff changeset
  1175
	my $dst;
hgs
parents:
diff changeset
  1176
	
hgs
parents:
diff changeset
  1177
	my $srcDir = $templateRoot."/ts/lsbsuites/lsblib/data/";
hgs
parents:
diff changeset
  1178
		
hgs
parents:
diff changeset
  1179
	foreach $module(@generatedModules)
hgs
parents:
diff changeset
  1180
	{
hgs
parents:
diff changeset
  1181
		my $file1 = $srcDir."tet_code.cfg";
hgs
parents:
diff changeset
  1182
		my $file2 = $srcDir."tetexec.cfg";
hgs
parents:
diff changeset
  1183
		$dst = $ATSRoot."\\components\\".$libname."_".$module;
hgs
parents:
diff changeset
  1184
		$dst = $dst."\\General\\";
hgs
parents:
diff changeset
  1185
		copy($file1, $dst) or die "copy: $! $file1 $dst";
hgs
parents:
diff changeset
  1186
		copy($file2, $dst) or die "copy: $! $file2 $dst";
hgs
parents:
diff changeset
  1187
	}#module
hgs
parents:
diff changeset
  1188
}#fn
hgs
parents:
diff changeset
  1189
hgs
parents:
diff changeset
  1190
hgs
parents:
diff changeset
  1191
#copy the ltp cfg files
hgs
parents:
diff changeset
  1192
sub CopyLtpCfg($)
hgs
parents:
diff changeset
  1193
{
hgs
parents:
diff changeset
  1194
	my $libname = pop @_;
hgs
parents:
diff changeset
  1195
	
hgs
parents:
diff changeset
  1196
	my $module;
hgs
parents:
diff changeset
  1197
	my $src;
hgs
parents:
diff changeset
  1198
	my $dst;
hgs
parents:
diff changeset
  1199
		
hgs
parents:
diff changeset
  1200
	foreach $module(@generatedModules)
hgs
parents:
diff changeset
  1201
	{
hgs
parents:
diff changeset
  1202
		$src = $cfglocation{$module};
hgs
parents:
diff changeset
  1203
		$dst = $ATSRoot."\\components\\".$libname."_".$module;
hgs
parents:
diff changeset
  1204
		$dst = $dst."\\General\\";
hgs
parents:
diff changeset
  1205
		copy($src, $dst) or warn "copy: $! $src $dst";
hgs
parents:
diff changeset
  1206
	}#module
hgs
parents:
diff changeset
  1207
}#fn
hgs
parents:
diff changeset
  1208
hgs
parents:
diff changeset
  1209
hgs
parents:
diff changeset
  1210
sub CopyDlls($$)
hgs
parents:
diff changeset
  1211
{
hgs
parents:
diff changeset
  1212
	my $libname = shift @_;
hgs
parents:
diff changeset
  1213
	my $suffix = shift @_;
hgs
parents:
diff changeset
  1214
	
hgs
parents:
diff changeset
  1215
	my $module;
hgs
parents:
diff changeset
  1216
	my $src;
hgs
parents:
diff changeset
  1217
	my $dst;
hgs
parents:
diff changeset
  1218
	
hgs
parents:
diff changeset
  1219
	
hgs
parents:
diff changeset
  1220
	foreach $module(@generatedModules)
hgs
parents:
diff changeset
  1221
	{
hgs
parents:
diff changeset
  1222
	  if($do_winscw == 1)
hgs
parents:
diff changeset
  1223
	  { 	  
hgs
parents:
diff changeset
  1224
			$src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$module.$suffix;
hgs
parents:
diff changeset
  1225
			$dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
hgs
parents:
diff changeset
  1226
			$dst = $dst."\\winscw_udeb\\";
hgs
parents:
diff changeset
  1227
			copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  1228
		}
hgs
parents:
diff changeset
  1229
	  if($do_armv5 == 1)
hgs
parents:
diff changeset
  1230
	  {
hgs
parents:
diff changeset
  1231
			$src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$module.$suffix;
hgs
parents:
diff changeset
  1232
			$dst = $ATSRoot."\\components\\".$libname."_".StripModulePrefix($module);
hgs
parents:
diff changeset
  1233
			$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
  1234
			copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  1235
		}
hgs
parents:
diff changeset
  1236
	}#foreach
hgs
parents:
diff changeset
  1237
}
hgs
parents:
diff changeset
  1238
#fn to generate the session file
hgs
parents:
diff changeset
  1239
sub GenerateSessionFile($$$$)
hgs
parents:
diff changeset
  1240
{
hgs
parents:
diff changeset
  1241
	my $libname = shift @_;
hgs
parents:
diff changeset
  1242
	my $target = shift @_;
hgs
parents:
diff changeset
  1243
	my $name = shift @_;
hgs
parents:
diff changeset
  1244
	my $listptr = shift @_;
hgs
parents:
diff changeset
  1245
	my $outdir = $ATSRoot;
hgs
parents:
diff changeset
  1246
	my $infile = $templateRoot."\\testsession.xml";
hgs
parents:
diff changeset
  1247
	chdir $outdir || die("DIED: Unable to chdir!"); 
hgs
parents:
diff changeset
  1248
	#open INFILE, $infile || die ("DIED: Can not open input file $infile");
hgs
parents:
diff changeset
  1249
	my $prefix = $name."_".$target;
hgs
parents:
diff changeset
  1250
	if($sdkversion ne "")
hgs
parents:
diff changeset
  1251
	{
hgs
parents:
diff changeset
  1252
		$prefix = $prefix."_".$sdkversion;
hgs
parents:
diff changeset
  1253
	}
hgs
parents:
diff changeset
  1254
	
hgs
parents:
diff changeset
  1255
	open OUTFILE, ">".$outdir."\\".$prefix."_testsession.xml" || die ("DIED: Can not open output file");
hgs
parents:
diff changeset
  1256
	my $line;
hgs
parents:
diff changeset
  1257
  my $snippet = $target;
hgs
parents:
diff changeset
  1258
  if($target ne "winscw" && $target ne "winsspd")
hgs
parents:
diff changeset
  1259
  {
hgs
parents:
diff changeset
  1260
  	$snippet = "hw";
hgs
parents:
diff changeset
  1261
  }
hgs
parents:
diff changeset
  1262
hgs
parents:
diff changeset
  1263
print OUTFILE "<?xml version=\"1.0\"?>\n";
hgs
parents:
diff changeset
  1264
print OUTFILE "<testsession>\n";
hgs
parents:
diff changeset
  1265
#print OUTFILE "<symbian-version>$libname"."_".$snippet."_TestDrop_blr_component</symbian-version>\n";	
hgs
parents:
diff changeset
  1266
print OUTFILE "<symbian-version>ats_test_session</symbian-version>\n";	
hgs
parents:
diff changeset
  1267
print OUTFILE "<testitem>at</testitem>\n";	
hgs
parents:
diff changeset
  1268
print OUTFILE "<resultfile>ATSOUTPUT\\".$prefix."_testsession_results.xml</resultfile>\n";		
hgs
parents:
diff changeset
  1269
if($sendEmail eq "yes")
hgs
parents:
diff changeset
  1270
{
hgs
parents:
diff changeset
  1271
print OUTFILE <<EOEmailNote;
hgs
parents:
diff changeset
  1272
<email_notification>
hgs
parents:
diff changeset
  1273
<include_test_cases>true</include_test_cases>
hgs
parents:
diff changeset
  1274
<message_file>C:\\\\lm.txt </message_file>
hgs
parents:
diff changeset
  1275
<send_after_rerun>false</send_after_rerun>
hgs
parents:
diff changeset
  1276
<subject>ATS testreport</subject>
hgs
parents:
diff changeset
  1277
<from>swbuild\@nokia.com</from>
hgs
parents:
diff changeset
  1278
<to>santosh.ks\@nokia.com</to>
hgs
parents:
diff changeset
  1279
<to>Imtiyaj.Kaji\@nokia.com</to>
hgs
parents:
diff changeset
  1280
<to>tp-ap-india-mrt-testdg\@nokia.com</to>
hgs
parents:
diff changeset
  1281
<to>tp-ap-india-mrt-libsdg\@nokia.com</to>
hgs
parents:
diff changeset
  1282
<to>subeesh.sivanandan\@nokia.com</to>
hgs
parents:
diff changeset
  1283
<to>girish.bhat\@nokia.com</to>
hgs
parents:
diff changeset
  1284
</email_notification>
hgs
parents:
diff changeset
  1285
EOEmailNote
hgs
parents:
diff changeset
  1286
}
hgs
parents:
diff changeset
  1287
hgs
parents:
diff changeset
  1288
	if($libname ne "combined")
hgs
parents:
diff changeset
  1289
	{
hgs
parents:
diff changeset
  1290
		AddAssumedIncludes($libname,$snippet);
hgs
parents:
diff changeset
  1291
	}
hgs
parents:
diff changeset
  1292
	else
hgs
parents:
diff changeset
  1293
	{
hgs
parents:
diff changeset
  1294
		if($listptr ne "")
hgs
parents:
diff changeset
  1295
		{
hgs
parents:
diff changeset
  1296
			AddFileList($libname,$listptr);
hgs
parents:
diff changeset
  1297
		}
hgs
parents:
diff changeset
  1298
		else
hgs
parents:
diff changeset
  1299
		{
hgs
parents:
diff changeset
  1300
			AddActualIncludes($libname);
hgs
parents:
diff changeset
  1301
		}
hgs
parents:
diff changeset
  1302
	}
hgs
parents:
diff changeset
  1303
   				
hgs
parents:
diff changeset
  1304
	print OUTFILE "</testsession>\n";
hgs
parents:
diff changeset
  1305
hgs
parents:
diff changeset
  1306
	close(OUTFILE);
hgs
parents:
diff changeset
  1307
	#close(INFILE);
hgs
parents:
diff changeset
  1308
}#fn
hgs
parents:
diff changeset
  1309
hgs
parents:
diff changeset
  1310
hgs
parents:
diff changeset
  1311
sub AddAssumedIncludes($$)
hgs
parents:
diff changeset
  1312
{
hgs
parents:
diff changeset
  1313
	my $libname = shift @_; 
hgs
parents:
diff changeset
  1314
	my $snippet = shift @_;
hgs
parents:
diff changeset
  1315
	
hgs
parents:
diff changeset
  1316
	my $APITest;
hgs
parents:
diff changeset
  1317
	foreach my $listed(@generatedModules)
hgs
parents:
diff changeset
  1318
						{
hgs
parents:
diff changeset
  1319
							$APITest = StripModulePrefix($listed);
hgs
parents:
diff changeset
  1320
							print OUTFILE  "\n";
hgs
parents:
diff changeset
  1321
							print OUTFILE "	<!--Inclusion of $target xml for $APITest -->\n";
hgs
parents:
diff changeset
  1322
							print OUTFILE "	<component>\n";
hgs
parents:
diff changeset
  1323
							print OUTFILE "		<factory>Symbian</factory>\n";
hgs
parents:
diff changeset
  1324
							if($libname eq "all")
hgs
parents:
diff changeset
  1325
							{
hgs
parents:
diff changeset
  1326
									print OUTFILE "		 <testplan>ATSINPUT\\components\\$listed\\$listed"."_module_blr_".$snippet."_component.xml</testplan>\n";	 
hgs
parents:
diff changeset
  1327
							}
hgs
parents:
diff changeset
  1328
							else
hgs
parents:
diff changeset
  1329
							{
hgs
parents:
diff changeset
  1330
									print OUTFILE "		 <testplan>ATSINPUT\\components\\$libname"."_"."$APITest\\$libname"."_$APITest"."_module_blr_".$snippet."_component.xml</testplan>\n";	 
hgs
parents:
diff changeset
  1331
							}
hgs
parents:
diff changeset
  1332
							if($target eq "winscw")
hgs
parents:
diff changeset
  1333
							{
hgs
parents:
diff changeset
  1334
									print OUTFILE "		<target hardware=\"winscw\" build=\"udeb\" />\n";
hgs
parents:
diff changeset
  1335
							}
hgs
parents:
diff changeset
  1336
							elsif($target eq "winsspd")
hgs
parents:
diff changeset
  1337
							{
hgs
parents:
diff changeset
  1338
								print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n"; 
hgs
parents:
diff changeset
  1339
							}
hgs
parents:
diff changeset
  1340
							else
hgs
parents:
diff changeset
  1341
							{
hgs
parents:
diff changeset
  1342
										print OUTFILE "		<target hardware=\"$target\" build=\"urel\" />\n";
hgs
parents:
diff changeset
  1343
							}
hgs
parents:
diff changeset
  1344
							print OUTFILE "	</component>\n";
hgs
parents:
diff changeset
  1345
							print OUTFILE "\n";
hgs
parents:
diff changeset
  1346
	           }#foreach @generatedModules
hgs
parents:
diff changeset
  1347
}
hgs
parents:
diff changeset
  1348
hgs
parents:
diff changeset
  1349
hgs
parents:
diff changeset
  1350
sub AddFileList($$)
hgs
parents:
diff changeset
  1351
{
hgs
parents:
diff changeset
  1352
	my $libname = shift @_; 
hgs
parents:
diff changeset
  1353
	my $listptr = shift @_;
hgs
parents:
diff changeset
  1354
	my @componentfiles = @$listptr;
hgs
parents:
diff changeset
  1355
	
hgs
parents:
diff changeset
  1356
			foreach my $listed(@componentfiles)
hgs
parents:
diff changeset
  1357
						{
hgs
parents:
diff changeset
  1358
								print OUTFILE  "\n";
hgs
parents:
diff changeset
  1359
							print OUTFILE "	<!--Inclusion of $target xml -->\n";
hgs
parents:
diff changeset
  1360
							print OUTFILE "	<component>\n";
hgs
parents:
diff changeset
  1361
							print OUTFILE "		<factory>Symbian</factory>\n";
hgs
parents:
diff changeset
  1362
							print OUTFILE "		 <testplan>ATSINPUT\\components\\$listed</testplan>\n";	 
hgs
parents:
diff changeset
  1363
							if($target eq "winscw")
hgs
parents:
diff changeset
  1364
							{
hgs
parents:
diff changeset
  1365
									print OUTFILE "		<target hardware=\"winscw\" build=\"udeb\" />\n";
hgs
parents:
diff changeset
  1366
							}
hgs
parents:
diff changeset
  1367
							elsif($target eq "winsspd")
hgs
parents:
diff changeset
  1368
							{
hgs
parents:
diff changeset
  1369
								print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n"; 
hgs
parents:
diff changeset
  1370
							}
hgs
parents:
diff changeset
  1371
							else
hgs
parents:
diff changeset
  1372
							{
hgs
parents:
diff changeset
  1373
										print OUTFILE "		<target hardware=\"$target\" build=\"urel\" />\n";
hgs
parents:
diff changeset
  1374
							}
hgs
parents:
diff changeset
  1375
							print OUTFILE "	</component>\n";
hgs
parents:
diff changeset
  1376
							print OUTFILE "\n";
hgs
parents:
diff changeset
  1377
	           }#foreach @componentfiles
hgs
parents:
diff changeset
  1378
}
hgs
parents:
diff changeset
  1379
hgs
parents:
diff changeset
  1380
hgs
parents:
diff changeset
  1381
hgs
parents:
diff changeset
  1382
sub GetSslXmls()
hgs
parents:
diff changeset
  1383
{
hgs
parents:
diff changeset
  1384
	my $APITest;
hgs
parents:
diff changeset
  1385
	my @componentfiles;
hgs
parents:
diff changeset
  1386
	
hgs
parents:
diff changeset
  1387
	my @emulatorfiles = 
hgs
parents:
diff changeset
  1388
	(
hgs
parents:
diff changeset
  1389
	"libssl_ssltest\\libssl_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1390
	"libcrypto_crypto_test\\libcrypto_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1391
	"libcrypto_openssl\\libcrypto_topenssltestss_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1392
	"libcrypto_openssl\\libcrypto_topenssltestverify_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1393
	"libcrypto_openssl\\libcrypto_topenssltestenc_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1394
	"libcrypto_openssl\\libcrypto_topenssltestgen_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1395
	"libcrypto_openssl\\libcrypto_topenssltpkcs7_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1396
	"libcrypto_openssl\\libcrypto_topenssltpkcs7d_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1397
	"libcrypto_openssl\\libcrypto_topenssltreq_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1398
	"libcrypto_openssl\\libcrypto_topenssltreq2_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1399
	"libcrypto_openssl\\libcrypto_topenssltrsa_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1400
	"libcrypto_openssl\\libcrypto_topenssltcrl_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1401
	"libcrypto_openssl\\libcrypto_topenssltsid_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1402
	"libcrypto_openssl\\libcrypto_topenssltx509_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1403
	"libcrypto_openssl\\libcrypto_topenssltx5091_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1404
	"libcrypto_openssl\\libcrypto_topenssltx5092_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1405
	 );
hgs
parents:
diff changeset
  1406
	 
hgs
parents:
diff changeset
  1407
	my @hwfiles =
hgs
parents:
diff changeset
  1408
	(
hgs
parents:
diff changeset
  1409
		"libcrypto_openssl\\libcrypto_topenssltestss_blr_hw_component.xml",
hgs
parents:
diff changeset
  1410
		"libcrypto_openssl\\libcrypto_topenssltestverify_blr_hw_component.xml",
hgs
parents:
diff changeset
  1411
		"libcrypto_openssl\\libcrypto_topenssltestenc_blr_hw_component.xml",
hgs
parents:
diff changeset
  1412
		"libcrypto_openssl\\libcrypto_topenssltestgen_blr_hw_component.xml",
hgs
parents:
diff changeset
  1413
		"libcrypto_openssl\\libcrypto_topenssltpkcs7_blr_hw_component.xml",
hgs
parents:
diff changeset
  1414
		"libcrypto_openssl\\libcrypto_topenssltpkcs7d_blr_hw_component.xml",
hgs
parents:
diff changeset
  1415
		"libcrypto_openssl\\libcrypto_topenssltreq_blr_hw_component.xml",
hgs
parents:
diff changeset
  1416
		"libcrypto_openssl\\libcrypto_topenssltreq2_blr_hw_component.xml",
hgs
parents:
diff changeset
  1417
		"libcrypto_openssl\\libcrypto_topenssltrsa_blr_hw_component.xml",
hgs
parents:
diff changeset
  1418
		"libcrypto_openssl\\libcrypto_topenssltcrl_blr_hw_component.xml",
hgs
parents:
diff changeset
  1419
		"libcrypto_openssl\\libcrypto_topenssltsid_blr_hw_component.xml",
hgs
parents:
diff changeset
  1420
		"libcrypto_openssl\\libcrypto_topenssltx509_blr_hw_component.xml",
hgs
parents:
diff changeset
  1421
		"libcrypto_openssl\\libcrypto_topenssltx5091_blr_hw_component.xml",
hgs
parents:
diff changeset
  1422
		"libcrypto_openssl\\libcrypto_topenssltx5092_blr_hw_component.xml",		
hgs
parents:
diff changeset
  1423
		"libssl_ssltest\\libssl_blr_hw_component.xml",
hgs
parents:
diff changeset
  1424
		"libcrypto_crypto_test\\libcrypto_blr_hw_component.xml",
hgs
parents:
diff changeset
  1425
	);
hgs
parents:
diff changeset
  1426
	if($target eq "winsspd" || $target eq "winscw")
hgs
parents:
diff changeset
  1427
	{
hgs
parents:
diff changeset
  1428
		@componentfiles = @emulatorfiles;
hgs
parents:
diff changeset
  1429
	}
hgs
parents:
diff changeset
  1430
	else
hgs
parents:
diff changeset
  1431
	{
hgs
parents:
diff changeset
  1432
		@componentfiles = @hwfiles;
hgs
parents:
diff changeset
  1433
	}
hgs
parents:
diff changeset
  1434
	return @componentfiles;
hgs
parents:
diff changeset
  1435
}
hgs
parents:
diff changeset
  1436
hgs
parents:
diff changeset
  1437
hgs
parents:
diff changeset
  1438
hgs
parents:
diff changeset
  1439
sub AddActualIncludes($)
hgs
parents:
diff changeset
  1440
{
hgs
parents:
diff changeset
  1441
	my $libname = shift @_; 
hgs
parents:
diff changeset
  1442
	find(\&XmlComponentFiles, ".");
hgs
parents:
diff changeset
  1443
	my $key;
hgs
parents:
diff changeset
  1444
	my $value;
hgs
parents:
diff changeset
  1445
	while(($key, $value) = each(%DirHash)) 
hgs
parents:
diff changeset
  1446
	{
hgs
parents:
diff changeset
  1447
							$value =~ s/\//\\/g;
hgs
parents:
diff changeset
  1448
							print OUTFILE  "\n";
hgs
parents:
diff changeset
  1449
							print OUTFILE "	<!--Inclusion of dynamically found $target xml -->\n";
hgs
parents:
diff changeset
  1450
							print OUTFILE "	<component>\n";
hgs
parents:
diff changeset
  1451
							print OUTFILE "		<factory>Symbian</factory>\n";
hgs
parents:
diff changeset
  1452
							print OUTFILE "		 <testplan>$value</testplan>\n";	 
hgs
parents:
diff changeset
  1453
							if($target eq "winscw")
hgs
parents:
diff changeset
  1454
							{
hgs
parents:
diff changeset
  1455
									print OUTFILE "		<target hardware=\"winscw\" build=\"udeb\" />\n";
hgs
parents:
diff changeset
  1456
							}
hgs
parents:
diff changeset
  1457
							elsif($target eq "winsspd")
hgs
parents:
diff changeset
  1458
							{
hgs
parents:
diff changeset
  1459
								print OUTFILE " <target hardware=\"winsspd\" platform=\"winscw\" build=\"udeb\" />\n"; 
hgs
parents:
diff changeset
  1460
							}
hgs
parents:
diff changeset
  1461
							else
hgs
parents:
diff changeset
  1462
							{
hgs
parents:
diff changeset
  1463
										print OUTFILE "		<target hardware=\"$target\" build=\"urel\" />\n";
hgs
parents:
diff changeset
  1464
							}
hgs
parents:
diff changeset
  1465
							print OUTFILE "	</component>\n";
hgs
parents:
diff changeset
  1466
							print OUTFILE "\n";
hgs
parents:
diff changeset
  1467
	
hgs
parents:
diff changeset
  1468
	}#while
hgs
parents:
diff changeset
  1469
}#fn
hgs
parents:
diff changeset
  1470
hgs
parents:
diff changeset
  1471
sub XmlComponentFiles()
hgs
parents:
diff changeset
  1472
{
hgs
parents:
diff changeset
  1473
	if($_ !~ /\.xml/ || $_ =~ /manual/)
hgs
parents:
diff changeset
  1474
	{
hgs
parents:
diff changeset
  1475
		return;
hgs
parents:
diff changeset
  1476
	}
hgs
parents:
diff changeset
  1477
	#print "Processing $_\n";
hgs
parents:
diff changeset
  1478
	my $dir = getcwd();
hgs
parents:
diff changeset
  1479
	if($dir =~ /.*(ATSINPUT.*)/)
hgs
parents:
diff changeset
  1480
	{
hgs
parents:
diff changeset
  1481
			$dir = $1;
hgs
parents:
diff changeset
  1482
			if($dir !~ /.*components.*/)
hgs
parents:
diff changeset
  1483
			{
hgs
parents:
diff changeset
  1484
				return;
hgs
parents:
diff changeset
  1485
			}
hgs
parents:
diff changeset
  1486
			#print "The dir is $dir\n";
hgs
parents:
diff changeset
  1487
	}
hgs
parents:
diff changeset
  1488
	else
hgs
parents:
diff changeset
  1489
	{
hgs
parents:
diff changeset
  1490
		return;
hgs
parents:
diff changeset
  1491
	}
hgs
parents:
diff changeset
  1492
	
hgs
parents:
diff changeset
  1493
	if($target eq "winsspd" )
hgs
parents:
diff changeset
  1494
	{
hgs
parents:
diff changeset
  1495
		if($_ =~ /winsspd/)
hgs
parents:
diff changeset
  1496
		{
hgs
parents:
diff changeset
  1497
			#print "Adding $target file $_ for $dir\n";
hgs
parents:
diff changeset
  1498
			$DirHash{$dir} = $dir."/".$_;
hgs
parents:
diff changeset
  1499
		}
hgs
parents:
diff changeset
  1500
	}
hgs
parents:
diff changeset
  1501
	elsif($target eq "winscw")
hgs
parents:
diff changeset
  1502
	{
hgs
parents:
diff changeset
  1503
		if($_ =~ /winscw/)
hgs
parents:
diff changeset
  1504
		{
hgs
parents:
diff changeset
  1505
			#print "Adding $target file $_ for $dir\n";
hgs
parents:
diff changeset
  1506
			$DirHash{$dir} = $dir."/".$_;
hgs
parents:
diff changeset
  1507
		}
hgs
parents:
diff changeset
  1508
	}
hgs
parents:
diff changeset
  1509
	elsif($_ =~ /$target/)
hgs
parents:
diff changeset
  1510
	{
hgs
parents:
diff changeset
  1511
		#print "$_ matched $target \n";
hgs
parents:
diff changeset
  1512
		#print "Adding $target file $_ for $dir\n";
hgs
parents:
diff changeset
  1513
		$DirHash{$dir} = $dir."/".$_;
hgs
parents:
diff changeset
  1514
	}
hgs
parents:
diff changeset
  1515
	elsif($_ =~/hw/)
hgs
parents:
diff changeset
  1516
	{
hgs
parents:
diff changeset
  1517
		#print "$_ matched hw";
hgs
parents:
diff changeset
  1518
		if(scalar $DirHash{$dir} == 0)
hgs
parents:
diff changeset
  1519
		{
hgs
parents:
diff changeset
  1520
			#print "Adding hw file $_ for $dir\n";
hgs
parents:
diff changeset
  1521
			$DirHash{$dir} = $dir."/".$_;
hgs
parents:
diff changeset
  1522
			#print " and added\n"
hgs
parents:
diff changeset
  1523
		}
hgs
parents:
diff changeset
  1524
		else
hgs
parents:
diff changeset
  1525
		{
hgs
parents:
diff changeset
  1526
			#print " and not added\n";
hgs
parents:
diff changeset
  1527
		}
hgs
parents:
diff changeset
  1528
	}
hgs
parents:
diff changeset
  1529
}
hgs
parents:
diff changeset
  1530
hgs
parents:
diff changeset
  1531
hgs
parents:
diff changeset
  1532
hgs
parents:
diff changeset
  1533
sub emptyArray()
hgs
parents:
diff changeset
  1534
{
hgs
parents:
diff changeset
  1535
	@generatedModules = ();
hgs
parents:
diff changeset
  1536
}
hgs
parents:
diff changeset
  1537
hgs
parents:
diff changeset
  1538
sub GenDirs($)
hgs
parents:
diff changeset
  1539
{
hgs
parents:
diff changeset
  1540
 my $libname = shift @_;
hgs
parents:
diff changeset
  1541
 my $dirname;
hgs
parents:
diff changeset
  1542
 foreach my $module(@generatedModules)
hgs
parents:
diff changeset
  1543
 {
hgs
parents:
diff changeset
  1544
  $dirname = StripModulePrefix($module);
hgs
parents:
diff changeset
  1545
	my $relroot = $ATSRoot."\\components\\$libname"."_$dirname";
hgs
parents:
diff changeset
  1546
	mkdir $relroot || die("DIED: unable to create dir $dirname\n");
hgs
parents:
diff changeset
  1547
	mkdir $relroot."\\General" || die("DIED: unable to create dir $relroot\\General\n");
hgs
parents:
diff changeset
  1548
	if($do_armv5 == 1)
hgs
parents:
diff changeset
  1549
	{
hgs
parents:
diff changeset
  1550
		mkdir $relroot."\\armv5_urel" || die("DIED: unable to create dir $relroot\\armv5_urel\n");
hgs
parents:
diff changeset
  1551
	}
hgs
parents:
diff changeset
  1552
	if($do_winscw == 1)
hgs
parents:
diff changeset
  1553
	{
hgs
parents:
diff changeset
  1554
		mkdir $relroot."\\winscw_udeb" || die("DIED: unable to create dir $relroot\\winscw_udeb\n");
hgs
parents:
diff changeset
  1555
	}
hgs
parents:
diff changeset
  1556
 }
hgs
parents:
diff changeset
  1557
}
hgs
parents:
diff changeset
  1558
hgs
parents:
diff changeset
  1559
sub GenXmls($$$)
hgs
parents:
diff changeset
  1560
{
hgs
parents:
diff changeset
  1561
	my $libname = shift @_;
hgs
parents:
diff changeset
  1562
	my $listedName = shift @_;
hgs
parents:
diff changeset
  1563
	my $bref = shift @_;
hgs
parents:
diff changeset
  1564
	my @filesToProcess = @$bref;
hgs
parents:
diff changeset
  1565
	
hgs
parents:
diff changeset
  1566
	#strip leading test and t names from module
hgs
parents:
diff changeset
  1567
	my $moduleName = StripModulePrefix($listedName);
hgs
parents:
diff changeset
  1568
hgs
parents:
diff changeset
  1569
      my $toPath = $ATSRoot."\\components\\$libname"."_$moduleName\\"; 
hgs
parents:
diff changeset
  1570
        
hgs
parents:
diff changeset
  1571
hgs
parents:
diff changeset
  1572
       my $dst;
hgs
parents:
diff changeset
  1573
       my $src;
hgs
parents:
diff changeset
  1574
       foreach $src(@filesToProcess)
hgs
parents:
diff changeset
  1575
       {
hgs
parents:
diff changeset
  1576
               $dst = $src;
hgs
parents:
diff changeset
  1577
               $dst =~ s/ATSTemplateXXX/$moduleName/;
hgs
parents:
diff changeset
  1578
               $dst =~ s/LibXXX/$libname/;
hgs
parents:
diff changeset
  1579
             
hgs
parents:
diff changeset
  1580
hgs
parents:
diff changeset
  1581
               if($src eq "testframework.ini")
hgs
parents:
diff changeset
  1582
               {
hgs
parents:
diff changeset
  1583
					$dst =  $toPath."General\\".$dst;
hgs
parents:
diff changeset
  1584
               }
hgs
parents:
diff changeset
  1585
               else
hgs
parents:
diff changeset
  1586
               {
hgs
parents:
diff changeset
  1587
					$dst =  $toPath.$dst;
hgs
parents:
diff changeset
  1588
               }
hgs
parents:
diff changeset
  1589
               copy($templateRoot."\\".$src, $dst) || die("DIED: Unable to copy $src to $dst\n");
hgs
parents:
diff changeset
  1590
               ExpandModuleMacros($dst, $libname, $listedName);
hgs
parents:
diff changeset
  1591
       }#foreach file
hgs
parents:
diff changeset
  1592
}
hgs
parents:
diff changeset
  1593
hgs
parents:
diff changeset
  1594
hgs
parents:
diff changeset
  1595
sub GenExeXmls()
hgs
parents:
diff changeset
  1596
{
hgs
parents:
diff changeset
  1597
	my $moduleName = shift @_;
hgs
parents:
diff changeset
  1598
	my $libname = shift @_;
hgs
parents:
diff changeset
  1599
			
hgs
parents:
diff changeset
  1600
	my $toPath = $ATSRoot."\\components\\$libname"."_$moduleName\\"; 
hgs
parents:
diff changeset
  1601
  my @filesToProcess =
hgs
parents:
diff changeset
  1602
  (
hgs
parents:
diff changeset
  1603
     "LibXXX_ATSTemplateXXX_exemodule_blr_hw_component.xml",
hgs
parents:
diff changeset
  1604
     "LibXXX_ATSTemplateXXX_exemodule_blr_winsspd_component.xml",
hgs
parents:
diff changeset
  1605
  );
hgs
parents:
diff changeset
  1606
	
hgs
parents:
diff changeset
  1607
	my $dst;
hgs
parents:
diff changeset
  1608
  my $src;
hgs
parents:
diff changeset
  1609
  foreach $src(@filesToProcess)
hgs
parents:
diff changeset
  1610
  {
hgs
parents:
diff changeset
  1611
        $dst = $src;
hgs
parents:
diff changeset
  1612
        $dst =~ s/ATSTemplateXXX/$moduleName/;
hgs
parents:
diff changeset
  1613
        $dst =~ s/LibXXX/$libname/;
hgs
parents:
diff changeset
  1614
        $dst =~ s/_exemodule_/_module_/;
hgs
parents:
diff changeset
  1615
				$dst =  $toPath.$dst;
hgs
parents:
diff changeset
  1616
        copy($templateRoot."\\".$src, $dst) || die("DIED: Unable to copy to $dst\n");
hgs
parents:
diff changeset
  1617
        ExpandModuleMacros($dst, $libname, $moduleName);
hgs
parents:
diff changeset
  1618
   }#foreach file
hgs
parents:
diff changeset
  1619
}
hgs
parents:
diff changeset
  1620
hgs
parents:
diff changeset
  1621
#function to expand the macros existing in a file
hgs
parents:
diff changeset
  1622
#file is replaced by new version
hgs
parents:
diff changeset
  1623
#args are relativePath. filename and  $moduleName
hgs
parents:
diff changeset
  1624
sub ExpandModuleMacros()
hgs
parents:
diff changeset
  1625
{
hgs
parents:
diff changeset
  1626
	# Take module name
hgs
parents:
diff changeset
  1627
	my $moduleName = pop @_;
hgs
parents:
diff changeset
  1628
	my $libname = pop @_;
hgs
parents:
diff changeset
  1629
	my $filename = pop @_;
hgs
parents:
diff changeset
  1630
hgs
parents:
diff changeset
  1631
	my $MODULENAME = $moduleName;
hgs
parents:
diff changeset
  1632
	$MODULENAME =~ tr/[a-z]/[A-Z]/;
hgs
parents:
diff changeset
  1633
hgs
parents:
diff changeset
  1634
	# Open input file
hgs
parents:
diff changeset
  1635
	open (INFILE, $filename ) || die ("DIED: Can not find $filename");
hgs
parents:
diff changeset
  1636
hgs
parents:
diff changeset
  1637
	#Open output file
hgs
parents:
diff changeset
  1638
	my $newOutput = $filename."new";
hgs
parents:
diff changeset
  1639
	open (OUTFILE, ">".$newOutput ) || die ("DIED: Can not open $newOutput");
hgs
parents:
diff changeset
  1640
hgs
parents:
diff changeset
  1641
	# Replace text in files
hgs
parents:
diff changeset
  1642
	while (<INFILE>)
hgs
parents:
diff changeset
  1643
	{
hgs
parents:
diff changeset
  1644
	  s/ATSTemplateXXX/$moduleName/g;
hgs
parents:
diff changeset
  1645
	  s/LibXXX/$libname/g;
hgs
parents:
diff changeset
  1646
    	  print OUTFILE $_;
hgs
parents:
diff changeset
  1647
	}
hgs
parents:
diff changeset
  1648
hgs
parents:
diff changeset
  1649
	# Close filehandles
hgs
parents:
diff changeset
  1650
	close (INFILE);
hgs
parents:
diff changeset
  1651
	close (OUTFILE);
hgs
parents:
diff changeset
  1652
hgs
parents:
diff changeset
  1653
	# Rename result file
hgs
parents:
diff changeset
  1654
	unlink $filename;
hgs
parents:
diff changeset
  1655
	rename $newOutput,$filename;
hgs
parents:
diff changeset
  1656
}
hgs
parents:
diff changeset
  1657
hgs
parents:
diff changeset
  1658
hgs
parents:
diff changeset
  1659
hgs
parents:
diff changeset
  1660
sub CopyDeps($$)
hgs
parents:
diff changeset
  1661
{
hgs
parents:
diff changeset
  1662
  my $libname = shift @_;
hgs
parents:
diff changeset
  1663
  my $copyDll = shift @_;
hgs
parents:
diff changeset
  1664
	my $src;
hgs
parents:
diff changeset
  1665
	my $dst;
hgs
parents:
diff changeset
  1666
	foreach my $listed(@generatedModules)
hgs
parents:
diff changeset
  1667
	{
hgs
parents:
diff changeset
  1668
				my $module = StripModulePrefix($listed);
hgs
parents:
diff changeset
  1669
				if($do_winscw == 1)
hgs
parents:
diff changeset
  1670
				{
hgs
parents:
diff changeset
  1671
					$src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
hgs
parents:
diff changeset
  1672
					$dst = $ATSRoot."\\components\\$libname"."_$module";
hgs
parents:
diff changeset
  1673
					$dst = $dst."\\winscw_udeb\\";
hgs
parents:
diff changeset
  1674
					copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  1675
				}
hgs
parents:
diff changeset
  1676
				if($do_armv5 == 1)
hgs
parents:
diff changeset
  1677
				{
hgs
parents:
diff changeset
  1678
					$src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
hgs
parents:
diff changeset
  1679
					$dst = $ATSRoot."\\components\\$libname"."_$module";
hgs
parents:
diff changeset
  1680
					$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
  1681
					copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  1682
				}
hgs
parents:
diff changeset
  1683
	}#foreach
hgs
parents:
diff changeset
  1684
}#fn
hgs
parents:
diff changeset
  1685
hgs
parents:
diff changeset
  1686
#dat file copy
hgs
parents:
diff changeset
  1687
sub CopyDatFiles()
hgs
parents:
diff changeset
  1688
{
hgs
parents:
diff changeset
  1689
	my $libRoot = $templateRoot;
hgs
parents:
diff changeset
  1690
	$libRoot =~ /(.*)internal.*/;
hgs
parents:
diff changeset
  1691
	$libRoot = $1;
hgs
parents:
diff changeset
  1692
hgs
parents:
diff changeset
  1693
 my @list = (
hgs
parents:
diff changeset
  1694
  				 ["libcrypt", "tlibcrypt", "group/Test_Data.dat"],
hgs
parents:
diff changeset
  1695
  				 ["libc", "tnetdb", "data/services.txt"],
hgs
parents:
diff changeset
  1696
  				 ["libc", "tstring", "data/locales.txt"],
hgs
parents:
diff changeset
  1697
  				 ["libc", "libc_loc_blr", "data/locales.txt"],
hgs
parents:
diff changeset
  1698
  				 ["libz", "tzlib", "data/*.*"],
hgs
parents:
diff changeset
  1699
  				 ["libc", "tlink", "data/*.*"],
hgs
parents:
diff changeset
  1700
  				 ["libc", "tmmap", "data/*.*"],
hgs
parents:
diff changeset
  1701
           );
hgs
parents:
diff changeset
  1702
hgs
parents:
diff changeset
  1703
	 my $libname;
hgs
parents:
diff changeset
  1704
	 my $dirname;
hgs
parents:
diff changeset
  1705
	 my $glob;
hgs
parents:
diff changeset
  1706
	foreach my $ref(@list)
hgs
parents:
diff changeset
  1707
	{
hgs
parents:
diff changeset
  1708
			my @inarr = @$ref;
hgs
parents:
diff changeset
  1709
			($libname, $dirname, $glob) = @inarr;
hgs
parents:
diff changeset
  1710
			my $modulename = StripModulePrefix($dirname);
hgs
parents:
diff changeset
  1711
			my $src = "$libRoot/$libname/internal/testapps/$dirname/$glob";
hgs
parents:
diff changeset
  1712
			my $dst = $ATSRoot."\\components\\$libname"."_"."$modulename\\General\\";
hgs
parents:
diff changeset
  1713
  		if($dirname eq "libc_loc_blr")
hgs
parents:
diff changeset
  1714
  		{
hgs
parents:
diff changeset
  1715
  			$src = "$libRoot/libc/src/locales.txt";
hgs
parents:
diff changeset
  1716
  		}
hgs
parents:
diff changeset
  1717
  		my @filesFound = glob($src);
hgs
parents:
diff changeset
  1718
  		if(scalar @filesFound == 0)
hgs
parents:
diff changeset
  1719
  		{
hgs
parents:
diff changeset
  1720
  			die("DIED: no Dat file found to copy!");
hgs
parents:
diff changeset
  1721
  		}
hgs
parents:
diff changeset
  1722
  		foreach my $file(@filesFound)
hgs
parents:
diff changeset
  1723
  		{
hgs
parents:
diff changeset
  1724
  			copy($file, $dst) || die("DIED: unable to copy $file to $dst");
hgs
parents:
diff changeset
  1725
  		}
hgs
parents:
diff changeset
  1726
  }#ref processing
hgs
parents:
diff changeset
  1727
}#fn
hgs
parents:
diff changeset
  1728
hgs
parents:
diff changeset
  1729
hgs
parents:
diff changeset
  1730
#glib dat file copy
hgs
parents:
diff changeset
  1731
sub CopyArbitDatFiles($$)
hgs
parents:
diff changeset
  1732
{
hgs
parents:
diff changeset
  1733
	
hgs
parents:
diff changeset
  1734
	 my $libname = shift @_;
hgs
parents:
diff changeset
  1735
	 my $refArr = shift @_;
hgs
parents:
diff changeset
  1736
	 my @list = @$refArr;
hgs
parents:
diff changeset
  1737
	 
hgs
parents:
diff changeset
  1738
 	
hgs
parents:
diff changeset
  1739
	my $fname;
hgs
parents:
diff changeset
  1740
	my $modulename;
hgs
parents:
diff changeset
  1741
	my $location;
hgs
parents:
diff changeset
  1742
	my $atsDst;
hgs
parents:
diff changeset
  1743
	my $targetDst;
hgs
parents:
diff changeset
  1744
	
hgs
parents:
diff changeset
  1745
	#now copy the files appropriately
hgs
parents:
diff changeset
  1746
	foreach my $ref(@list)
hgs
parents:
diff changeset
  1747
	{
hgs
parents:
diff changeset
  1748
			my @inarr = @$ref;
hgs
parents:
diff changeset
  1749
			($fname, $modulename, $location, $atsDst, $targetDst) = @inarr;
hgs
parents:
diff changeset
  1750
			#print "[$fname, $modulename, $location, $atsDst, $targetDst]\n";
hgs
parents:
diff changeset
  1751
			if($location =~ /(.*)\.\.(.*)/)
hgs
parents:
diff changeset
  1752
			{
hgs
parents:
diff changeset
  1753
				$location = GetPathPrefix().$2;
hgs
parents:
diff changeset
  1754
			}
hgs
parents:
diff changeset
  1755
			else
hgs
parents:
diff changeset
  1756
			{
hgs
parents:
diff changeset
  1757
				$location = $rootDrive.$location;
hgs
parents:
diff changeset
  1758
			}
hgs
parents:
diff changeset
  1759
			my $src = $location.$fname;
hgs
parents:
diff changeset
  1760
			my $dst = $ATSRoot."\\components\\$libname"."_".$modulename.$atsDst;
hgs
parents:
diff changeset
  1761
			if($libname eq "")
hgs
parents:
diff changeset
  1762
			{
hgs
parents:
diff changeset
  1763
				$dst = $ATSRoot."\\components\\".$modulename.$atsDst;
hgs
parents:
diff changeset
  1764
				#print "$dst CHANGED!\n"
hgs
parents:
diff changeset
  1765
			}
hgs
parents:
diff changeset
  1766
  		
hgs
parents:
diff changeset
  1767
  		my @filesFound = glob($src);
hgs
parents:
diff changeset
  1768
  		if(scalar @filesFound == 0)
hgs
parents:
diff changeset
  1769
  		{
hgs
parents:
diff changeset
  1770
  			die("DIED: no Dat file  $src found to copy!");
hgs
parents:
diff changeset
  1771
  		}
hgs
parents:
diff changeset
  1772
  		foreach my $file(@filesFound)
hgs
parents:
diff changeset
  1773
  		{
hgs
parents:
diff changeset
  1774
  			copy($file, $dst) || die("DIED: unable to copy $file to $dst");
hgs
parents:
diff changeset
  1775
  		}
hgs
parents:
diff changeset
  1776
  		
hgs
parents:
diff changeset
  1777
  		if($targetDst ne "")
hgs
parents:
diff changeset
  1778
  		{
hgs
parents:
diff changeset
  1779
  			 		my @filesToChange = ();
hgs
parents:
diff changeset
  1780
			  		if($atsDst =~ "armv5")
hgs
parents:
diff changeset
  1781
			  		{
hgs
parents:
diff changeset
  1782
			  			#armv5 component file
hgs
parents:
diff changeset
  1783
			  			unshift @filesToChange, $libname."_".$modulename."_module_blr_hw_component.xml";
hgs
parents:
diff changeset
  1784
			  			
hgs
parents:
diff changeset
  1785
			  		}
hgs
parents:
diff changeset
  1786
			  		elsif($atsDst =~ "winscw")
hgs
parents:
diff changeset
  1787
			  		{
hgs
parents:
diff changeset
  1788
			  			#winscw component file
hgs
parents:
diff changeset
  1789
			  			unshift @filesToChange, $libname."_".$modulename."_module_blr_winsspd_component.xml";
hgs
parents:
diff changeset
  1790
			  		}
hgs
parents:
diff changeset
  1791
			  		else
hgs
parents:
diff changeset
  1792
			  		{
hgs
parents:
diff changeset
  1793
			  			#add entry to both xmls
hgs
parents:
diff changeset
  1794
			  			unshift @filesToChange, $libname."_".$modulename."_module_blr_hw_component.xml";
hgs
parents:
diff changeset
  1795
			  			unshift @filesToChange, $libname."_".$modulename."_module_blr_winsspd_component.xml";
hgs
parents:
diff changeset
  1796
			  		}
hgs
parents:
diff changeset
  1797
			  		foreach my $file(@filesToChange)
hgs
parents:
diff changeset
  1798
			  		{
hgs
parents:
diff changeset
  1799
			  			$src = $ATSRoot."/components/".$libname."_"."$modulename/".$file;
hgs
parents:
diff changeset
  1800
			  			ModifyXml($src,$libname,$fname,$atsDst,$targetDst);
hgs
parents:
diff changeset
  1801
			  		}
hgs
parents:
diff changeset
  1802
			  }#updating the xmls
hgs
parents:
diff changeset
  1803
    		
hgs
parents:
diff changeset
  1804
  }#ref processing
hgs
parents:
diff changeset
  1805
 
hgs
parents:
diff changeset
  1806
  
hgs
parents:
diff changeset
  1807
}#fn
hgs
parents:
diff changeset
  1808
hgs
parents:
diff changeset
  1809
sub ModifyXml($$$$$)
hgs
parents:
diff changeset
  1810
{
hgs
parents:
diff changeset
  1811
	my $filename = shift @_;
hgs
parents:
diff changeset
  1812
	my $lib = shift @_;
hgs
parents:
diff changeset
  1813
	my $fname = shift @_;
hgs
parents:
diff changeset
  1814
	my $atsDst = shift @_;
hgs
parents:
diff changeset
  1815
	my $targetDst = shift @_;
hgs
parents:
diff changeset
  1816
	
hgs
parents:
diff changeset
  1817
	
hgs
parents:
diff changeset
  1818
	#printf("Modifying $filename with lib= $lib fname= $fname atsDst = $atsDst targetDst = $targetDst\n");
hgs
parents:
diff changeset
  1819
	
hgs
parents:
diff changeset
  1820
	# Open input file
hgs
parents:
diff changeset
  1821
	open (INFILE, $filename ) || die ("Can not find $filename");
hgs
parents:
diff changeset
  1822
hgs
parents:
diff changeset
  1823
	#Open output file
hgs
parents:
diff changeset
  1824
	my $newOutput = $filename."new";
hgs
parents:
diff changeset
  1825
	open (OUTFILE, ">".$newOutput ) || die ("Can not open $newOutput");
hgs
parents:
diff changeset
  1826
hgs
parents:
diff changeset
  1827
		
hgs
parents:
diff changeset
  1828
	# Replace text in files
hgs
parents:
diff changeset
  1829
	while (<INFILE>)
hgs
parents:
diff changeset
  1830
	{
hgs
parents:
diff changeset
  1831
	  if(/\<stif\>/ || /\<execute\>/)
hgs
parents:
diff changeset
  1832
	  {
hgs
parents:
diff changeset
  1833
	  	if(/\<stif\>/)
hgs
parents:
diff changeset
  1834
	  	{
hgs
parents:
diff changeset
  1835
	  		print OUTFILE "\<stif\>\n";
hgs
parents:
diff changeset
  1836
	  	}
hgs
parents:
diff changeset
  1837
	  	else
hgs
parents:
diff changeset
  1838
	  	{
hgs
parents:
diff changeset
  1839
	  		print OUTFILE "\<execute\>\n";
hgs
parents:
diff changeset
  1840
	  	}
hgs
parents:
diff changeset
  1841
	  	my $type = "data";
hgs
parents:
diff changeset
  1842
	  	if($atsDst !~ "General")
hgs
parents:
diff changeset
  1843
			{
hgs
parents:
diff changeset
  1844
				$type = "binary";
hgs
parents:
diff changeset
  1845
			}
hgs
parents:
diff changeset
  1846
			print OUTFILE <<EObinary;
hgs
parents:
diff changeset
  1847
				
hgs
parents:
diff changeset
  1848
	  		<install type=\"$type\">
hgs
parents:
diff changeset
  1849
				<src>$fname</src>
hgs
parents:
diff changeset
  1850
				<dst>$targetDst\\$fname</dst>
hgs
parents:
diff changeset
  1851
 				</install>
hgs
parents:
diff changeset
  1852
EObinary
hgs
parents:
diff changeset
  1853
	  }#stif or execute tag found
hgs
parents:
diff changeset
  1854
	  else
hgs
parents:
diff changeset
  1855
	  {
hgs
parents:
diff changeset
  1856
	  	  print OUTFILE $_;
hgs
parents:
diff changeset
  1857
	  }
hgs
parents:
diff changeset
  1858
	}#while
hgs
parents:
diff changeset
  1859
	# Close filehandles
hgs
parents:
diff changeset
  1860
	close (INFILE);
hgs
parents:
diff changeset
  1861
	close (OUTFILE);
hgs
parents:
diff changeset
  1862
hgs
parents:
diff changeset
  1863
	# Rename result file
hgs
parents:
diff changeset
  1864
	unlink $filename;
hgs
parents:
diff changeset
  1865
	rename $newOutput,$filename;
hgs
parents:
diff changeset
  1866
	
hgs
parents:
diff changeset
  1867
}#fn
hgs
parents:
diff changeset
  1868
sub GenGenModules($)
hgs
parents:
diff changeset
  1869
{
hgs
parents:
diff changeset
  1870
	my $libname = shift @_;
hgs
parents:
diff changeset
  1871
	
hgs
parents:
diff changeset
  1872
		
hgs
parents:
diff changeset
  1873
	my $src = $ATSRoot."/components/";
hgs
parents:
diff changeset
  1874
	my @fileList = ();
hgs
parents:
diff changeset
  1875
	opendir(DIRHANDLE, "$src") || die "Cannot opendir $src";
hgs
parents:
diff changeset
  1876
  foreach my $name (readdir(DIRHANDLE)) 
hgs
parents:
diff changeset
  1877
  {
hgs
parents:
diff changeset
  1878
    if($name =~ /^$libname/)
hgs
parents:
diff changeset
  1879
    {
hgs
parents:
diff changeset
  1880
    	if($libname ne "libc" || $name !~ /^libcrypt/) 
hgs
parents:
diff changeset
  1881
    	{
hgs
parents:
diff changeset
  1882
    		$name =~ s/^$libname//;
hgs
parents:
diff changeset
  1883
    		$name =~ s/^_//;
hgs
parents:
diff changeset
  1884
    		unshift @fileList, $name;
hgs
parents:
diff changeset
  1885
    	}#excluded libcrypt from libc list
hgs
parents:
diff changeset
  1886
    }#libname match
hgs
parents:
diff changeset
  1887
  }#foreach
hgs
parents:
diff changeset
  1888
  closedir(DIRHANDLE);
hgs
parents:
diff changeset
  1889
	return @fileList;
hgs
parents:
diff changeset
  1890
}
hgs
parents:
diff changeset
  1891
hgs
parents:
diff changeset
  1892
hgs
parents:
diff changeset
  1893
sub GetAllModules()
hgs
parents:
diff changeset
  1894
{
hgs
parents:
diff changeset
  1895
	
hgs
parents:
diff changeset
  1896
	my $src = $ATSRoot."/components/";
hgs
parents:
diff changeset
  1897
	my @fileList = ();
hgs
parents:
diff changeset
  1898
	opendir(DIRHANDLE, "$src") || die "Cannot opendir $src";
hgs
parents:
diff changeset
  1899
  foreach my $name (readdir(DIRHANDLE)) 
hgs
parents:
diff changeset
  1900
  {
hgs
parents:
diff changeset
  1901
    	if($name ne "." && $name ne ".." && $name ne "shared")
hgs
parents:
diff changeset
  1902
			{
hgs
parents:
diff changeset
  1903
				unshift @fileList, $name;
hgs
parents:
diff changeset
  1904
			}
hgs
parents:
diff changeset
  1905
hgs
parents:
diff changeset
  1906
  }#foreach
hgs
parents:
diff changeset
  1907
  closedir(DIRHANDLE);
hgs
parents:
diff changeset
  1908
	return @fileList;
hgs
parents:
diff changeset
  1909
}
hgs
parents:
diff changeset
  1910
hgs
parents:
diff changeset
  1911
hgs
parents:
diff changeset
  1912
hgs
parents:
diff changeset
  1913
sub TransformXmls($$)
hgs
parents:
diff changeset
  1914
{
hgs
parents:
diff changeset
  1915
	my $libname = shift @_;
hgs
parents:
diff changeset
  1916
	my $shared = shift @_;
hgs
parents:
diff changeset
  1917
	my $target = shift @_;
hgs
parents:
diff changeset
  1918
	my $module;
hgs
parents:
diff changeset
  1919
	my $src;
hgs
parents:
diff changeset
  1920
	my $dst;
hgs
parents:
diff changeset
  1921
hgs
parents:
diff changeset
  1922
	my $armv5 = 0;
hgs
parents:
diff changeset
  1923
	my $winscw = 0;
hgs
parents:
diff changeset
  1924
	if($target eq "armv5")
hgs
parents:
diff changeset
  1925
	{
hgs
parents:
diff changeset
  1926
			$armv5 = 1;
hgs
parents:
diff changeset
  1927
  }	
hgs
parents:
diff changeset
  1928
  elsif($target eq "winscw")
hgs
parents:
diff changeset
  1929
  {
hgs
parents:
diff changeset
  1930
  		$winscw = 1;
hgs
parents:
diff changeset
  1931
  }
hgs
parents:
diff changeset
  1932
  else
hgs
parents:
diff changeset
  1933
  {
hgs
parents:
diff changeset
  1934
  	$armv5  = $do_armv5;
hgs
parents:
diff changeset
  1935
  	$winscw = $do_winscw;
hgs
parents:
diff changeset
  1936
	}
hgs
parents:
diff changeset
  1937
		
hgs
parents:
diff changeset
  1938
hgs
parents:
diff changeset
  1939
	foreach $module(@generatedModules)
hgs
parents:
diff changeset
  1940
	{
hgs
parents:
diff changeset
  1941
	  if($armv5 == 1 && $winscw == 1)
hgs
parents:
diff changeset
  1942
	  {
hgs
parents:
diff changeset
  1943
			$src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
hgs
parents:
diff changeset
  1944
		}
hgs
parents:
diff changeset
  1945
		elsif($armv5 == 1)
hgs
parents:
diff changeset
  1946
		{
hgs
parents:
diff changeset
  1947
			$src = $ATSRoot."/components/".$libname."_"."$module/*_hw_component.xml";
hgs
parents:
diff changeset
  1948
		}
hgs
parents:
diff changeset
  1949
		elsif($winscw == 1)
hgs
parents:
diff changeset
  1950
		{
hgs
parents:
diff changeset
  1951
			$src = $ATSRoot."/components/".$libname."_"."$module/*_winsspd_component.xml";
hgs
parents:
diff changeset
  1952
		}
hgs
parents:
diff changeset
  1953
		my @fileList = glob($src);
hgs
parents:
diff changeset
  1954
		foreach my $file(@fileList)
hgs
parents:
diff changeset
  1955
		{
hgs
parents:
diff changeset
  1956
		 	#print"$file to  be transformed!\n";
hgs
parents:
diff changeset
  1957
			AddLibsInXml($libname,$file,$shared);
hgs
parents:
diff changeset
  1958
		}
hgs
parents:
diff changeset
  1959
   }
hgs
parents:
diff changeset
  1960
}#fn
hgs
parents:
diff changeset
  1961
hgs
parents:
diff changeset
  1962
sub AddLibsInXml($$$)
hgs
parents:
diff changeset
  1963
{
hgs
parents:
diff changeset
  1964
	my $libname = shift @_;
hgs
parents:
diff changeset
  1965
	my $filename = shift @_;
hgs
parents:
diff changeset
  1966
	my $shared = shift @_;
hgs
parents:
diff changeset
  1967
	
hgs
parents:
diff changeset
  1968
	# Open input file
hgs
parents:
diff changeset
  1969
	open (INFILE, $filename ) || die ("Can not find $filename");
hgs
parents:
diff changeset
  1970
hgs
parents:
diff changeset
  1971
	#Open output file
hgs
parents:
diff changeset
  1972
	my $newOutput = $filename."new";
hgs
parents:
diff changeset
  1973
	open (OUTFILE, ">".$newOutput ) || die ("Can not open $newOutput");
hgs
parents:
diff changeset
  1974
hgs
parents:
diff changeset
  1975
	my $drive = "c:";
hgs
parents:
diff changeset
  1976
	
hgs
parents:
diff changeset
  1977
	# Replace text in files
hgs
parents:
diff changeset
  1978
	while (<INFILE>)
hgs
parents:
diff changeset
  1979
	{
hgs
parents:
diff changeset
  1980
	  if(/\<stif\>/ || /\<execute\>/)
hgs
parents:
diff changeset
  1981
	  {
hgs
parents:
diff changeset
  1982
	  	if(/\<stif\>/)
hgs
parents:
diff changeset
  1983
	  	{
hgs
parents:
diff changeset
  1984
	  		print OUTFILE "\<stif\>\n";
hgs
parents:
diff changeset
  1985
	  	}
hgs
parents:
diff changeset
  1986
	  	else
hgs
parents:
diff changeset
  1987
	  	{
hgs
parents:
diff changeset
  1988
	  		print OUTFILE "\<execute\>\n";
hgs
parents:
diff changeset
  1989
	  		if($filename =~ /winsspd/)
hgs
parents:
diff changeset
  1990
				{
hgs
parents:
diff changeset
  1991
					$drive = "z:";
hgs
parents:
diff changeset
  1992
				}
hgs
parents:
diff changeset
  1993
	  	}
hgs
parents:
diff changeset
  1994
	  	foreach my $installable(@dllList)
hgs
parents:
diff changeset
  1995
			{
hgs
parents:
diff changeset
  1996
				print OUTFILE <<EOLine;
hgs
parents:
diff changeset
  1997
				
hgs
parents:
diff changeset
  1998
	  		<install type=\"$shared binary\">
hgs
parents:
diff changeset
  1999
				<src>$installable</src>
hgs
parents:
diff changeset
  2000
				<dst>$drive\\sys\\bin\\$installable</dst>
hgs
parents:
diff changeset
  2001
 				</install>
hgs
parents:
diff changeset
  2002
EOLine
hgs
parents:
diff changeset
  2003
			}
hgs
parents:
diff changeset
  2004
hgs
parents:
diff changeset
  2005
	  }
hgs
parents:
diff changeset
  2006
	  else
hgs
parents:
diff changeset
  2007
	  {
hgs
parents:
diff changeset
  2008
	  	  print OUTFILE $_;
hgs
parents:
diff changeset
  2009
	  }
hgs
parents:
diff changeset
  2010
	}#while
hgs
parents:
diff changeset
  2011
	# Close filehandles
hgs
parents:
diff changeset
  2012
	close (INFILE);
hgs
parents:
diff changeset
  2013
	close (OUTFILE);
hgs
parents:
diff changeset
  2014
hgs
parents:
diff changeset
  2015
	# Rename result file
hgs
parents:
diff changeset
  2016
	unlink $filename;
hgs
parents:
diff changeset
  2017
	rename $newOutput,$filename;
hgs
parents:
diff changeset
  2018
}
hgs
parents:
diff changeset
  2019
hgs
parents:
diff changeset
  2020
sub CopySharedDlls()
hgs
parents:
diff changeset
  2021
{
hgs
parents:
diff changeset
  2022
  my $libname = shift @_;
hgs
parents:
diff changeset
  2023
  my $ref = shift @_;
hgs
parents:
diff changeset
  2024
  my @ListOfDlls = @$ref;
hgs
parents:
diff changeset
  2025
  my $target = shift @_;
hgs
parents:
diff changeset
  2026
	my $module;
hgs
parents:
diff changeset
  2027
	my $src;
hgs
parents:
diff changeset
  2028
	my $dst;
hgs
parents:
diff changeset
  2029
	
hgs
parents:
diff changeset
  2030
	my $do_armv5 = 0;
hgs
parents:
diff changeset
  2031
	my $do_winscw = 0;
hgs
parents:
diff changeset
  2032
	if($target eq "armv5")
hgs
parents:
diff changeset
  2033
	{
hgs
parents:
diff changeset
  2034
		$do_armv5 = 1;
hgs
parents:
diff changeset
  2035
	}
hgs
parents:
diff changeset
  2036
	elsif($target eq "winscw")
hgs
parents:
diff changeset
  2037
	{
hgs
parents:
diff changeset
  2038
		$do_winscw =  1;
hgs
parents:
diff changeset
  2039
	}
hgs
parents:
diff changeset
  2040
	else
hgs
parents:
diff changeset
  2041
	{
hgs
parents:
diff changeset
  2042
		$do_armv5  = 1;
hgs
parents:
diff changeset
  2043
		$do_winscw = 1;
hgs
parents:
diff changeset
  2044
	}
hgs
parents:
diff changeset
  2045
	
hgs
parents:
diff changeset
  2046
	
hgs
parents:
diff changeset
  2047
	mkdir  $ATSRoot."\\components\\shared" || die("Wouldn't make shared folder in $ATSRoot\\components");
hgs
parents:
diff changeset
  2048
	if($do_winscw == 1)
hgs
parents:
diff changeset
  2049
	{
hgs
parents:
diff changeset
  2050
		mkdir  $ATSRoot."\\components\\shared\\winscw_udeb" || die("Wouldn't make shared folder in $ATSRoot\\components\winscw_udeb");
hgs
parents:
diff changeset
  2051
	}
hgs
parents:
diff changeset
  2052
	if($do_armv5 == 1)
hgs
parents:
diff changeset
  2053
	{
hgs
parents:
diff changeset
  2054
		mkdir  $ATSRoot."\\components\\shared\\armv5_urel" || die("Wouldn't make shared folder in $ATSRoot\\components\armv5_urel");
hgs
parents:
diff changeset
  2055
	}
hgs
parents:
diff changeset
  2056
	
hgs
parents:
diff changeset
  2057
	foreach my $copyDll(@ListOfDlls)
hgs
parents:
diff changeset
  2058
	{
hgs
parents:
diff changeset
  2059
		if($do_winscw == 1)
hgs
parents:
diff changeset
  2060
		{
hgs
parents:
diff changeset
  2061
			$src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
hgs
parents:
diff changeset
  2062
			$dst = $ATSRoot."\\components\\shared";
hgs
parents:
diff changeset
  2063
			$dst = $dst."\\winscw_udeb\\";
hgs
parents:
diff changeset
  2064
			copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  2065
		}	
hgs
parents:
diff changeset
  2066
		if($do_armv5 == 1)
hgs
parents:
diff changeset
  2067
		{	
hgs
parents:
diff changeset
  2068
			$src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
hgs
parents:
diff changeset
  2069
			$dst = $ATSRoot."\\components\\shared";
hgs
parents:
diff changeset
  2070
			$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
  2071
			copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  2072
		}
hgs
parents:
diff changeset
  2073
	}#foreach
hgs
parents:
diff changeset
  2074
}#fn
hgs
parents:
diff changeset
  2075
hgs
parents:
diff changeset
  2076
hgs
parents:
diff changeset
  2077
sub CopyMultiDlls($)
hgs
parents:
diff changeset
  2078
{
hgs
parents:
diff changeset
  2079
  my $libname = shift @_;
hgs
parents:
diff changeset
  2080
	my $module;
hgs
parents:
diff changeset
  2081
	my $src;
hgs
parents:
diff changeset
  2082
	my $dst;
hgs
parents:
diff changeset
  2083
	foreach my $listed(@generatedModules)
hgs
parents:
diff changeset
  2084
	{
hgs
parents:
diff changeset
  2085
		foreach my $copyDll(@dllList)
hgs
parents:
diff changeset
  2086
		{
hgs
parents:
diff changeset
  2087
			if($do_winscw == 1)
hgs
parents:
diff changeset
  2088
			{
hgs
parents:
diff changeset
  2089
				$src = $rootDrive."\\epoc32\\release\\winscw\\udeb\\".$copyDll;
hgs
parents:
diff changeset
  2090
				$dst = $ATSRoot."\\components\\$libname"."_$listed";
hgs
parents:
diff changeset
  2091
				$dst = $dst."\\winscw_udeb\\";
hgs
parents:
diff changeset
  2092
				copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  2093
			}
hgs
parents:
diff changeset
  2094
			if($do_armv5 == 1)
hgs
parents:
diff changeset
  2095
			{
hgs
parents:
diff changeset
  2096
				$src = $rootDrive."\\epoc32\\release\\armv5\\urel\\".$copyDll;
hgs
parents:
diff changeset
  2097
				$dst = $ATSRoot."\\components\\$libname"."_$listed";
hgs
parents:
diff changeset
  2098
				$dst = $dst."\\armv5_urel\\";
hgs
parents:
diff changeset
  2099
				copy($src, $dst)  || warn("unable to copy $src to $dst");
hgs
parents:
diff changeset
  2100
			}
hgs
parents:
diff changeset
  2101
		}#foreach
hgs
parents:
diff changeset
  2102
	}
hgs
parents:
diff changeset
  2103
}#fn
hgs
parents:
diff changeset
  2104
hgs
parents:
diff changeset
  2105
sub StripModulePrefix($)
hgs
parents:
diff changeset
  2106
{
hgs
parents:
diff changeset
  2107
	my $listed = pop @_;
hgs
parents:
diff changeset
  2108
	my $module = $listed;
hgs
parents:
diff changeset
  2109
	if($dontStrip == 0)
hgs
parents:
diff changeset
  2110
	{
hgs
parents:
diff changeset
  2111
		$module =~ s/^test//;
hgs
parents:
diff changeset
  2112
		$module =~ s/^t//;
hgs
parents:
diff changeset
  2113
		$module =~ s/^libc_//;
hgs
parents:
diff changeset
  2114
		$module =~ s/^libm_//;
hgs
parents:
diff changeset
  2115
  }
hgs
parents:
diff changeset
  2116
  return $module;
hgs
parents:
diff changeset
  2117
  	
hgs
parents:
diff changeset
  2118
}
hgs
parents:
diff changeset
  2119
hgs
parents:
diff changeset
  2120
sub GetLsbModules()
hgs
parents:
diff changeset
  2121
{
hgs
parents:
diff changeset
  2122
	my @lsbList = 
hgs
parents:
diff changeset
  2123
	(
hgs
parents:
diff changeset
  2124
	 "abs",
hgs
parents:
diff changeset
  2125
"acos",
hgs
parents:
diff changeset
  2126
"asctime",
hgs
parents:
diff changeset
  2127
"asin",
hgs
parents:
diff changeset
  2128
"atan",
hgs
parents:
diff changeset
  2129
"atan2",
hgs
parents:
diff changeset
  2130
"atof",
hgs
parents:
diff changeset
  2131
"atoi",
hgs
parents:
diff changeset
  2132
"atol",
hgs
parents:
diff changeset
  2133
"bsearch",
hgs
parents:
diff changeset
  2134
"calloc",
hgs
parents:
diff changeset
  2135
"ceil",
hgs
parents:
diff changeset
  2136
"chdir",
hgs
parents:
diff changeset
  2137
"clearerr",
hgs
parents:
diff changeset
  2138
"close",
hgs
parents:
diff changeset
  2139
"closedir",
hgs
parents:
diff changeset
  2140
"cos",
hgs
parents:
diff changeset
  2141
"cosh",
hgs
parents:
diff changeset
  2142
"creat",
hgs
parents:
diff changeset
  2143
"lsb_ctime",
hgs
parents:
diff changeset
  2144
"lsb_difftime",
hgs
parents:
diff changeset
  2145
"dlclose",
hgs
parents:
diff changeset
  2146
"dlerror",
hgs
parents:
diff changeset
  2147
"dlopen",
hgs
parents:
diff changeset
  2148
"dup",
hgs
parents:
diff changeset
  2149
"dup2",
hgs
parents:
diff changeset
  2150
"exp",
hgs
parents:
diff changeset
  2151
"fabs",
hgs
parents:
diff changeset
  2152
"fclose",
hgs
parents:
diff changeset
  2153
"fcntl_x",
hgs
parents:
diff changeset
  2154
"fdopen",
hgs
parents:
diff changeset
  2155
"feof",
hgs
parents:
diff changeset
  2156
"ferror",
hgs
parents:
diff changeset
  2157
"fflush",
hgs
parents:
diff changeset
  2158
"fgetpos",
hgs
parents:
diff changeset
  2159
"fgets",
hgs
parents:
diff changeset
  2160
"fileno",
hgs
parents:
diff changeset
  2161
"floor",
hgs
parents:
diff changeset
  2162
"fmod",
hgs
parents:
diff changeset
  2163
"fopen",
hgs
parents:
diff changeset
  2164
"fopen_X",
hgs
parents:
diff changeset
  2165
"fprintf",
hgs
parents:
diff changeset
  2166
"fputs",
hgs
parents:
diff changeset
  2167
"fread",
hgs
parents:
diff changeset
  2168
"free",
hgs
parents:
diff changeset
  2169
"freopen",
hgs
parents:
diff changeset
  2170
"freopen_X",
hgs
parents:
diff changeset
  2171
"frexp",
hgs
parents:
diff changeset
  2172
"fseek",
hgs
parents:
diff changeset
  2173
"fsetpos",
hgs
parents:
diff changeset
  2174
"fstat",
hgs
parents:
diff changeset
  2175
"ftell",
hgs
parents:
diff changeset
  2176
"ftok",
hgs
parents:
diff changeset
  2177
"ftok_l",
hgs
parents:
diff changeset
  2178
"fwrite",
hgs
parents:
diff changeset
  2179
"getc",
hgs
parents:
diff changeset
  2180
"getcwd",
hgs
parents:
diff changeset
  2181
"gets",
hgs
parents:
diff changeset
  2182
"lsb_gmtime",
hgs
parents:
diff changeset
  2183
"ldexp",
hgs
parents:
diff changeset
  2184
"link",
hgs
parents:
diff changeset
  2185
"lsb_localtime",
hgs
parents:
diff changeset
  2186
"log",
hgs
parents:
diff changeset
  2187
"log10",
hgs
parents:
diff changeset
  2188
"longjmp",
hgs
parents:
diff changeset
  2189
"lseek",
hgs
parents:
diff changeset
  2190
"malloc",
hgs
parents:
diff changeset
  2191
"memchr_X",
hgs
parents:
diff changeset
  2192
"memcmp_X",
hgs
parents:
diff changeset
  2193
"memcpy_X",
hgs
parents:
diff changeset
  2194
"memmove",
hgs
parents:
diff changeset
  2195
"memset_X",
hgs
parents:
diff changeset
  2196
"mkdir",
hgs
parents:
diff changeset
  2197
"mkfifo",
hgs
parents:
diff changeset
  2198
"lsb_mktime",
hgs
parents:
diff changeset
  2199
"modf",
hgs
parents:
diff changeset
  2200
"msgctl",
hgs
parents:
diff changeset
  2201
"msgget",
hgs
parents:
diff changeset
  2202
"msgsnd",
hgs
parents:
diff changeset
  2203
"open",
hgs
parents:
diff changeset
  2204
"opendir",
hgs
parents:
diff changeset
  2205
"open_x",
hgs
parents:
diff changeset
  2206
"perror",
hgs
parents:
diff changeset
  2207
"pipe",
hgs
parents:
diff changeset
  2208
"pow",
hgs
parents:
diff changeset
  2209
"printf",
hgs
parents:
diff changeset
  2210
"qsort",
hgs
parents:
diff changeset
  2211
"rand",
hgs
parents:
diff changeset
  2212
"read",
hgs
parents:
diff changeset
  2213
"readdir",
hgs
parents:
diff changeset
  2214
"readv_l",
hgs
parents:
diff changeset
  2215
"realloc",
hgs
parents:
diff changeset
  2216
"remove",
hgs
parents:
diff changeset
  2217
"rename",
hgs
parents:
diff changeset
  2218
"rewind",
hgs
parents:
diff changeset
  2219
"rewinddir",
hgs
parents:
diff changeset
  2220
"rmdir",
hgs
parents:
diff changeset
  2221
"scanf",
hgs
parents:
diff changeset
  2222
"scanf_X",
hgs
parents:
diff changeset
  2223
"seekdir",
hgs
parents:
diff changeset
  2224
"semctl",
hgs
parents:
diff changeset
  2225
"semget",
hgs
parents:
diff changeset
  2226
"semop",
hgs
parents:
diff changeset
  2227
"setbuf",
hgs
parents:
diff changeset
  2228
"setjmp",
hgs
parents:
diff changeset
  2229
"shmat",
hgs
parents:
diff changeset
  2230
"shmdt",
hgs
parents:
diff changeset
  2231
"shmget",
hgs
parents:
diff changeset
  2232
"sin",
hgs
parents:
diff changeset
  2233
"sinh",
hgs
parents:
diff changeset
  2234
"sqrt",
hgs
parents:
diff changeset
  2235
"srand",
hgs
parents:
diff changeset
  2236
"stat",
hgs
parents:
diff changeset
  2237
"strcat",
hgs
parents:
diff changeset
  2238
"strchr",
hgs
parents:
diff changeset
  2239
"strcmp",
hgs
parents:
diff changeset
  2240
"strcoll_X",
hgs
parents:
diff changeset
  2241
"strcpy",
hgs
parents:
diff changeset
  2242
"strcspn",
hgs
parents:
diff changeset
  2243
"strerror_X",
hgs
parents:
diff changeset
  2244
"strftime",
hgs
parents:
diff changeset
  2245
"strftime_X",
hgs
parents:
diff changeset
  2246
"strlen",
hgs
parents:
diff changeset
  2247
"strncat",
hgs
parents:
diff changeset
  2248
"strncmp",
hgs
parents:
diff changeset
  2249
"strncpy",
hgs
parents:
diff changeset
  2250
"strpbrk",
hgs
parents:
diff changeset
  2251
"strptime",
hgs
parents:
diff changeset
  2252
"strrchr",
hgs
parents:
diff changeset
  2253
"strspn",
hgs
parents:
diff changeset
  2254
"strstr",
hgs
parents:
diff changeset
  2255
"strtod_X",
hgs
parents:
diff changeset
  2256
"strtok",
hgs
parents:
diff changeset
  2257
"strtol_X",
hgs
parents:
diff changeset
  2258
"strxfrm_X",
hgs
parents:
diff changeset
  2259
"tan",
hgs
parents:
diff changeset
  2260
"tanh",
hgs
parents:
diff changeset
  2261
"telldir",
hgs
parents:
diff changeset
  2262
"telldir_l",
hgs
parents:
diff changeset
  2263
"lsb_time",
hgs
parents:
diff changeset
  2264
"tmpfile",
hgs
parents:
diff changeset
  2265
"tmpnam",
hgs
parents:
diff changeset
  2266
"ungetc",
hgs
parents:
diff changeset
  2267
"unlink",
hgs
parents:
diff changeset
  2268
"utime",
hgs
parents:
diff changeset
  2269
"vfprintf",
hgs
parents:
diff changeset
  2270
"vprintf",
hgs
parents:
diff changeset
  2271
"write",
hgs
parents:
diff changeset
  2272
"writev_l",
hgs
parents:
diff changeset
  2273
hgs
parents:
diff changeset
  2274
	);
hgs
parents:
diff changeset
  2275
  return @lsbList;
hgs
parents:
diff changeset
  2276
}
hgs
parents:
diff changeset
  2277
hgs
parents:
diff changeset
  2278
hgs
parents:
diff changeset
  2279
hgs
parents:
diff changeset
  2280
sub GenBackendTest()
hgs
parents:
diff changeset
  2281
{
hgs
parents:
diff changeset
  2282
hgs
parents:
diff changeset
  2283
	my @datList = 
hgs
parents:
diff changeset
  2284
	(
hgs
parents:
diff changeset
  2285
	["libc", "tlibcbackend"],
hgs
parents:
diff changeset
  2286
	);
hgs
parents:
diff changeset
  2287
	
hgs
parents:
diff changeset
  2288
	mkdir $ATSRoot;
hgs
parents:
diff changeset
  2289
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
  2290
		
hgs
parents:
diff changeset
  2291
	my $lib;
hgs
parents:
diff changeset
  2292
	my $module;
hgs
parents:
diff changeset
  2293
	my $ext;
hgs
parents:
diff changeset
  2294
	foreach my $ref(@datList)
hgs
parents:
diff changeset
  2295
	{
hgs
parents:
diff changeset
  2296
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2297
			($lib, $module,$ext) = @inarr;
hgs
parents:
diff changeset
  2298
			@generatedModules = ($module);
hgs
parents:
diff changeset
  2299
			GenDirs($lib);
hgs
parents:
diff changeset
  2300
			CopyDlls($lib,".dll");
hgs
parents:
diff changeset
  2301
	}
hgs
parents:
diff changeset
  2302
 #now copy xmls			
hgs
parents:
diff changeset
  2303
 CopyAtsSetup();
hgs
parents:
diff changeset
  2304
 #extra exes
hgs
parents:
diff changeset
  2305
 @generatedModules = ("tlibcbackend");
hgs
parents:
diff changeset
  2306
 CopyDeps("libc","TPopenReadChild.exe");
hgs
parents:
diff changeset
  2307
 CopyDeps("libc","TPopenWriteChild.exe");
hgs
parents:
diff changeset
  2308
			
hgs
parents:
diff changeset
  2309
}#fn
hgs
parents:
diff changeset
  2310
hgs
parents:
diff changeset
  2311
sub CopyAtsSetup()
hgs
parents:
diff changeset
  2312
{
hgs
parents:
diff changeset
  2313
	 my $libname = "libc"; 
hgs
parents:
diff changeset
  2314
	 my @list = (
hgs
parents:
diff changeset
  2315
  				 ["*.xml", "libcbackend", "/../backend/internal/tlibcbackend/group/","/", ""],
hgs
parents:
diff changeset
  2316
  				 ["*.cfg", "libcbackend", "/../backend/internal/tlibcbackend/group/","/General/", ""],
hgs
parents:
diff changeset
  2317
  				 ["*.ini", "libcbackend", "/../backend/internal/tlibcbackend/group/","/General/", ""],
hgs
parents:
diff changeset
  2318
  				 );
hgs
parents:
diff changeset
  2319
 
hgs
parents:
diff changeset
  2320
  my $bDataRef = \@list;  				 
hgs
parents:
diff changeset
  2321
	CopyArbitDatFiles("libc",$bDataRef);  				 
hgs
parents:
diff changeset
  2322
hgs
parents:
diff changeset
  2323
}#fn
hgs
parents:
diff changeset
  2324
sub GetPathPrefix()
hgs
parents:
diff changeset
  2325
{
hgs
parents:
diff changeset
  2326
	 my $srcPrefix = $templateRoot;
hgs
parents:
diff changeset
  2327
	 $srcPrefix =~ /(.*)internal.*/;
hgs
parents:
diff changeset
  2328
	 $srcPrefix = $1;
hgs
parents:
diff changeset
  2329
	 return $srcPrefix;
hgs
parents:
diff changeset
  2330
}
hgs
parents:
diff changeset
  2331
	
hgs
parents:
diff changeset
  2332
hgs
parents:
diff changeset
  2333
#dat file copy
hgs
parents:
diff changeset
  2334
sub CopyCryptoDat()
hgs
parents:
diff changeset
  2335
{
hgs
parents:
diff changeset
  2336
	my $libRoot = $templateRoot;
hgs
parents:
diff changeset
  2337
	$libRoot =~ /(.*)internal.*/;
hgs
parents:
diff changeset
  2338
	$libRoot = $1;
hgs
parents:
diff changeset
  2339
hgs
parents:
diff changeset
  2340
 my @list = (
hgs
parents:
diff changeset
  2341
 								 ["libssl", "ssltest", "libssl/internal/testapps/ssl_test/data/*"],
hgs
parents:
diff changeset
  2342
 								 ["libcrypto", "topenssl", "/libcrypto/internal/testapps/topenssl/data/*"],
hgs
parents:
diff changeset
  2343
           );
hgs
parents:
diff changeset
  2344
hgs
parents:
diff changeset
  2345
	 my $libname;
hgs
parents:
diff changeset
  2346
	 my $dirname;
hgs
parents:
diff changeset
  2347
	 my $glob;
hgs
parents:
diff changeset
  2348
	foreach my $ref(@list)
hgs
parents:
diff changeset
  2349
	{
hgs
parents:
diff changeset
  2350
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2351
			($libname, $dirname, $glob) = @inarr;
hgs
parents:
diff changeset
  2352
			my $modulename = StripModulePrefix($dirname);
hgs
parents:
diff changeset
  2353
			my	$srcPrefix = GetPathPrefix();
hgs
parents:
diff changeset
  2354
			
hgs
parents:
diff changeset
  2355
			my $src = "$srcPrefix"."$glob";
hgs
parents:
diff changeset
  2356
			
hgs
parents:
diff changeset
  2357
			my $dst = $ATSRoot."\\components\\$libname"."_"."$modulename\\General\\";
hgs
parents:
diff changeset
  2358
  		my @filesFound = glob($src);
hgs
parents:
diff changeset
  2359
  		if(scalar @filesFound == 0)
hgs
parents:
diff changeset
  2360
  		{
hgs
parents:
diff changeset
  2361
  			die("DIED: no Dat file found to copy!");
hgs
parents:
diff changeset
  2362
  		}
hgs
parents:
diff changeset
  2363
  		foreach my $file(@filesFound)
hgs
parents:
diff changeset
  2364
  		{
hgs
parents:
diff changeset
  2365
  			copy($file, $dst) || die("DIED: unable to copy $file to $dst");
hgs
parents:
diff changeset
  2366
  		}
hgs
parents:
diff changeset
  2367
  }#ref processing
hgs
parents:
diff changeset
  2368
}#fn
hgs
parents:
diff changeset
  2369
hgs
parents:
diff changeset
  2370
#Crypto xmls copy
hgs
parents:
diff changeset
  2371
sub CopyCryptoXmls()
hgs
parents:
diff changeset
  2372
{
hgs
parents:
diff changeset
  2373
	  my @list = (
hgs
parents:
diff changeset
  2374
  				 ["*.xml", "libssl_ssltest/", "/libssl/internal/testapps/ssl_test/group/"],
hgs
parents:
diff changeset
  2375
   				 ["*.xml", "libcrypto_crypto_test/", "/libcrypto/internal/testapps/crypto_test/group/"],
hgs
parents:
diff changeset
  2376
   				 ["*.xml", "libcrypto_openssl/", "/libcrypto/internal/testapps/topenssl/group/"],   				    				 			 
hgs
parents:
diff changeset
  2377
  				 );
hgs
parents:
diff changeset
  2378
hgs
parents:
diff changeset
  2379
	
hgs
parents:
diff changeset
  2380
	my $fname;
hgs
parents:
diff changeset
  2381
	my $moduleDst;
hgs
parents:
diff changeset
  2382
	my $location;
hgs
parents:
diff changeset
  2383
	
hgs
parents:
diff changeset
  2384
	#now copy the files appropriately
hgs
parents:
diff changeset
  2385
	foreach my $ref(@list)
hgs
parents:
diff changeset
  2386
	{
hgs
parents:
diff changeset
  2387
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2388
			($fname, $moduleDst, $location) = @inarr;
hgs
parents:
diff changeset
  2389
			my $src = GetPathPrefix().$location.$fname;
hgs
parents:
diff changeset
  2390
			my $dst = $ATSRoot."\\components\\$moduleDst";
hgs
parents:
diff changeset
  2391
  		
hgs
parents:
diff changeset
  2392
  		my @filesFound = glob($src);
hgs
parents:
diff changeset
  2393
  		if(scalar @filesFound == 0)
hgs
parents:
diff changeset
  2394
  		{
hgs
parents:
diff changeset
  2395
  			die("DIED: no xml file found to copy!");
hgs
parents:
diff changeset
  2396
  		}
hgs
parents:
diff changeset
  2397
  		foreach my $file(@filesFound)
hgs
parents:
diff changeset
  2398
  		{
hgs
parents:
diff changeset
  2399
  			copy($file, $dst) || die("DIED: unable to copy $file to $dst");
hgs
parents:
diff changeset
  2400
  		}
hgs
parents:
diff changeset
  2401
  	}#ref
hgs
parents:
diff changeset
  2402
  	
hgs
parents:
diff changeset
  2403
  	my @crypto_copyList = ("*.txt", "*cfg", "*.ini");
hgs
parents:
diff changeset
  2404
  	
hgs
parents:
diff changeset
  2405
  	foreach my $item(@crypto_copyList)
hgs
parents:
diff changeset
  2406
  	{
hgs
parents:
diff changeset
  2407
  			$location = "/libcrypto/internal/testapps/crypto_test/group/";
hgs
parents:
diff changeset
  2408
  			$fname = GetPathPrefix().$location.$item;
hgs
parents:
diff changeset
  2409
  			my @filesFound = glob($fname);
hgs
parents:
diff changeset
  2410
  			foreach my $file(@filesFound)
hgs
parents:
diff changeset
  2411
  			{
hgs
parents:
diff changeset
  2412
    			$moduleDst = "libcrypto_crypto_test/";	
hgs
parents:
diff changeset
  2413
  				my $dst = $ATSRoot."\\components\\".$moduleDst."/General/";
hgs
parents:
diff changeset
  2414
  				copy($file, $dst);
hgs
parents:
diff changeset
  2415
  			}
hgs
parents:
diff changeset
  2416
  	}
hgs
parents:
diff changeset
  2417
}#fn
hgs
parents:
diff changeset
  2418
hgs
parents:
diff changeset
  2419
sub GenCryptoTest()
hgs
parents:
diff changeset
  2420
{
hgs
parents:
diff changeset
  2421
hgs
parents:
diff changeset
  2422
	my @datList = 
hgs
parents:
diff changeset
  2423
	(
hgs
parents:
diff changeset
  2424
	["libssl", "ssltest", ".exe"],
hgs
parents:
diff changeset
  2425
	["libcrypto", "crypto_test",".dll"],
hgs
parents:
diff changeset
  2426
	["libcrypto", "openssl",".exe"],
hgs
parents:
diff changeset
  2427
	);
hgs
parents:
diff changeset
  2428
	
hgs
parents:
diff changeset
  2429
	mkdir $ATSRoot;
hgs
parents:
diff changeset
  2430
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
  2431
		
hgs
parents:
diff changeset
  2432
	my $lib;
hgs
parents:
diff changeset
  2433
	my $module;
hgs
parents:
diff changeset
  2434
	my $ext;
hgs
parents:
diff changeset
  2435
	foreach my $ref(@datList)
hgs
parents:
diff changeset
  2436
	{
hgs
parents:
diff changeset
  2437
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2438
			($lib, $module,$ext) = @inarr;
hgs
parents:
diff changeset
  2439
			@generatedModules = ($module);
hgs
parents:
diff changeset
  2440
			GenDirs($lib);
hgs
parents:
diff changeset
  2441
			CopyDlls($lib,$ext);
hgs
parents:
diff changeset
  2442
	}
hgs
parents:
diff changeset
  2443
	CopyCryptoDat();
hgs
parents:
diff changeset
  2444
	CopyCryptoXmls();
hgs
parents:
diff changeset
  2445
	
hgs
parents:
diff changeset
  2446
			
hgs
parents:
diff changeset
  2447
}#fn
hgs
parents:
diff changeset
  2448
hgs
parents:
diff changeset
  2449
hgs
parents:
diff changeset
  2450
#ngi xml copy
hgs
parents:
diff changeset
  2451
sub CopyNgiXmls()
hgs
parents:
diff changeset
  2452
{
hgs
parents:
diff changeset
  2453
	  my @list = (
hgs
parents:
diff changeset
  2454
   				 ["*.xml", "ngi_sa_amrrecording", "/audio/lowlevelaudio/internal/sa_amrrecording/group/"],
hgs
parents:
diff changeset
  2455
   				 ["*.xml", "ngi_sa_highlevelaudio", "/audio/highlevelaudio/internal/sa_highlevelaudio/group/"],
hgs
parents:
diff changeset
  2456
  				 ["*.xml", "ngi_sa_audiomixing", "/audio/lowlevelaudio/internal/sa_audiomixing/group/"],
hgs
parents:
diff changeset
  2457
  				 ["*.xml", "ngi_sa_audiorecording", "/audio/lowlevelaudio/internal/sa_audiorecording/group/"],
hgs
parents:
diff changeset
  2458
  				 ["*.xml", "ngi_sa_clip", "/audio/lowlevelaudio/internal/sa_clip/group/"],
hgs
parents:
diff changeset
  2459
  				 ["*.xml", "ngi_sa_lowlevelaudio", "/audio/lowlevelaudio/internal/sa_lowlevelaudio/group/"],
hgs
parents:
diff changeset
  2460
  				 ["*.xml", "ngi_sa_stream", "/audio/lowlevelaudio/internal/sa_stream/group/"],
hgs
parents:
diff changeset
  2461
  				 
hgs
parents:
diff changeset
  2462
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_antitearing/group/"],
hgs
parents:
diff changeset
  2463
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_colortranslation/group/"],
hgs
parents:
diff changeset
  2464
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_createfb565/group/"],
hgs
parents:
diff changeset
  2465
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_createfb888/group/"],
hgs
parents:
diff changeset
  2466
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_heapusage/group/"],
hgs
parents:
diff changeset
  2467
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_multibb/group/"],
hgs
parents:
diff changeset
  2468
  				 ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_performance/group/"],
hgs
parents:
diff changeset
  2469
           ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_plswitching/group/"],
hgs
parents:
diff changeset
  2470
           ["*.xml", "ngi_sa_backbuffer", "/graphics/backbuffer/internal/sa_bb_misc/group/"],
hgs
parents:
diff changeset
  2471
  				 ["*.xml", "ngi_sa_bitmap", "/graphics/bitmap/internal/sa_bitmap/group/"],
hgs
parents:
diff changeset
  2472
  				 ["*.xml", "ngi_sa_camera", "/graphics/camera/internal/sa_camera/group/"],
hgs
parents:
diff changeset
  2473
  				 ["*.xml", "ngi_sa_images", "/graphics/images/internal/sa_images/group/"],
hgs
parents:
diff changeset
  2474
  				 ["*.xml", "ngi_sa_display", "/graphics/display/internal/sa_display/group/"],
hgs
parents:
diff changeset
  2475
  				 ["*.xml", "ngi_sa_lights", "/graphics/lights/internal/sa_lights/group/"],
hgs
parents:
diff changeset
  2476
  				 ["*.xml", "ngi_sa_videoplayback", "/graphics/video/internal/sa_videoplayback/group/"],
hgs
parents:
diff changeset
  2477
  				 
hgs
parents:
diff changeset
  2478
  				 ["*.xml", "ngi_sa_input", "/input/input/internal/sa_input/group/"],
hgs
parents:
diff changeset
  2479
  				 ["*.xml", "ngi_sa_textinput", "/input/textinput/internal/sa_textinput/group/"],
hgs
parents:
diff changeset
  2480
  				 ["*.xml", "ngi_sa_devicecapabilities", "/system/devicecapabilities/internal/sa_devicecapabilities/group/"],
hgs
parents:
diff changeset
  2481
  				 ["*.xml", "ngi_sa_devicestatus", "/system/devicestatus/internal/sa_phone/group/"],
hgs
parents:
diff changeset
  2482
  				 ["*.xml", "ngi_sa_runtimetester", "/system/runtime/internal/sa_runtimetester/group/"],
hgs
parents:
diff changeset
  2483
  				 ["*.xml", "ngi_sa_timing", "/timing/internal/sa_timing/group/"],
hgs
parents:
diff changeset
  2484
	  				 );
hgs
parents:
diff changeset
  2485
hgs
parents:
diff changeset
  2486
	
hgs
parents:
diff changeset
  2487
	my $fname;
hgs
parents:
diff changeset
  2488
	my $moduleDst;
hgs
parents:
diff changeset
  2489
	my $location;
hgs
parents:
diff changeset
  2490
	
hgs
parents:
diff changeset
  2491
	#now copy the files appropriately
hgs
parents:
diff changeset
  2492
	foreach my $ref(@list)
hgs
parents:
diff changeset
  2493
	{
hgs
parents:
diff changeset
  2494
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2495
			($fname, $moduleDst, $location) = @inarr;
hgs
parents:
diff changeset
  2496
			my $src = GetPathPrefix().$location.$fname;
hgs
parents:
diff changeset
  2497
			my $dst = $ATSRoot."\\components\\$moduleDst";
hgs
parents:
diff changeset
  2498
			
hgs
parents:
diff changeset
  2499
			#print "My src is $src\n";
hgs
parents:
diff changeset
  2500
			#print "My dst is $dst\n";
hgs
parents:
diff changeset
  2501
			  		
hgs
parents:
diff changeset
  2502
  		my @filesFound = glob($src);
hgs
parents:
diff changeset
  2503
  		if(scalar @filesFound == 0)
hgs
parents:
diff changeset
  2504
  		{
hgs
parents:
diff changeset
  2505
  			warn("warning: no xml file found to copy from $src!");
hgs
parents:
diff changeset
  2506
  		}
hgs
parents:
diff changeset
  2507
  		foreach my $file(@filesFound)
hgs
parents:
diff changeset
  2508
  		{
hgs
parents:
diff changeset
  2509
  			copy($file, $dst) || die("DIED: unable to copy $file to $dst");
hgs
parents:
diff changeset
  2510
  		}
hgs
parents:
diff changeset
  2511
  	}#ref
hgs
parents:
diff changeset
  2512
    	
hgs
parents:
diff changeset
  2513
}#fn
hgs
parents:
diff changeset
  2514
hgs
parents:
diff changeset
  2515
hgs
parents:
diff changeset
  2516
sub GenNgiTest()
hgs
parents:
diff changeset
  2517
{
hgs
parents:
diff changeset
  2518
hgs
parents:
diff changeset
  2519
	my @datList = 
hgs
parents:
diff changeset
  2520
	(
hgs
parents:
diff changeset
  2521
	["ngi", "sa_amrrecording", ".dll"],
hgs
parents:
diff changeset
  2522
	["ngi", "sa_highlevelaudio", ".dll"],
hgs
parents:
diff changeset
  2523
	["ngi", "sa_audiomixing", ".dll"],
hgs
parents:
diff changeset
  2524
	["ngi", "sa_audiorecording", ".dll"],
hgs
parents:
diff changeset
  2525
	["ngi", "sa_clip", ".dll"],
hgs
parents:
diff changeset
  2526
	["ngi", "sa_lowlevelaudio", ".dll"],
hgs
parents:
diff changeset
  2527
	["ngi", "sa_stream", ".dll"],
hgs
parents:
diff changeset
  2528
	["ngi", "sa_bitmap", ".dll"],
hgs
parents:
diff changeset
  2529
	["ngi", "sa_camera", ".dll"],
hgs
parents:
diff changeset
  2530
	["ngi", "sa_images", ".dll"],
hgs
parents:
diff changeset
  2531
	["ngi", "sa_display", ".dll"],
hgs
parents:
diff changeset
  2532
	["ngi", "sa_lights", ".dll"],	
hgs
parents:
diff changeset
  2533
	["ngi", "sa_videoplayback", ".dll"],	
hgs
parents:
diff changeset
  2534
	["ngi", "sa_input", ".dll"],	
hgs
parents:
diff changeset
  2535
	["ngi", "sa_textinput", ".dll"],
hgs
parents:
diff changeset
  2536
	["ngi", "sa_devicecapabilities", ".dll"],	
hgs
parents:
diff changeset
  2537
	["ngi", "sa_devicestatus", ".dll"],	
hgs
parents:
diff changeset
  2538
	["ngi", "sa_runtimetester", ".dll"],	
hgs
parents:
diff changeset
  2539
	["ngi", "sa_timing", ".dll"],	
hgs
parents:
diff changeset
  2540
		
hgs
parents:
diff changeset
  2541
	);
hgs
parents:
diff changeset
  2542
	
hgs
parents:
diff changeset
  2543
	mkdir $ATSRoot;
hgs
parents:
diff changeset
  2544
	mkdir $ATSRoot."\\components" || die ("DIED: unable to create component dir");
hgs
parents:
diff changeset
  2545
hgs
parents:
diff changeset
  2546
		
hgs
parents:
diff changeset
  2547
	my $lib;
hgs
parents:
diff changeset
  2548
	my $module;
hgs
parents:
diff changeset
  2549
	my $ext;
hgs
parents:
diff changeset
  2550
	foreach my $ref(@datList)
hgs
parents:
diff changeset
  2551
	{
hgs
parents:
diff changeset
  2552
			my @inarr = @$ref;
hgs
parents:
diff changeset
  2553
			($lib, $module,$ext) = @inarr;
hgs
parents:
diff changeset
  2554
			@generatedModules = ($module);
hgs
parents:
diff changeset
  2555
			GenDirs($lib);
hgs
parents:
diff changeset
  2556
			CopyDlls($lib,$ext);
hgs
parents:
diff changeset
  2557
	}
hgs
parents:
diff changeset
  2558
	
hgs
parents:
diff changeset
  2559
   @generatedModules =("sa_backbuffer");
hgs
parents:
diff changeset
  2560
   GenDirs($lib);
hgs
parents:
diff changeset
  2561
   @dllList = 
hgs
parents:
diff changeset
  2562
   (
hgs
parents:
diff changeset
  2563
   	"sa_bb_antitearing.dll",
hgs
parents:
diff changeset
  2564
   	"sa_bb_colortranslation.dll",
hgs
parents:
diff changeset
  2565
   	"sa_bb_createfb444.dll",
hgs
parents:
diff changeset
  2566
   	"sa_bb_createfb565.dll",
hgs
parents:
diff changeset
  2567
   	"sa_bb_createfb888.dll",
hgs
parents:
diff changeset
  2568
   	"sa_bb_misc.dll",
hgs
parents:
diff changeset
  2569
   	"sa_bb_heapusage.dll",
hgs
parents:
diff changeset
  2570
   	"sa_bb_multibb.dll",
hgs
parents:
diff changeset
  2571
   	"sa_bb_performance.dll",
hgs
parents:
diff changeset
  2572
   	"sa_bb_plswitch.dll",
hgs
parents:
diff changeset
  2573
   	"sa_bb_testenv.dll"
hgs
parents:
diff changeset
  2574
   );
hgs
parents:
diff changeset
  2575
   CopyMultiDlls("ngi");
hgs
parents:
diff changeset
  2576
hgs
parents:
diff changeset
  2577
	
hgs
parents:
diff changeset
  2578
 	mkdir  $ATSRoot."\\components\\shared" || die("Wouldn't make shared folder in $ATSRoot\\components");
hgs
parents:
diff changeset
  2579
  mkdir  $ATSRoot."\\components\\shared\\winscw_udeb" || die("Wouldn't make shared folder in $ATSRoot\\components\winscw_udeb");
hgs
parents:
diff changeset
  2580
  mkdir  $ATSRoot."\\components\\shared\\armv5_urel" || die("Wouldn't make shared folder in $ATSRoot\\components\armv5_urel");
hgs
parents:
diff changeset
  2581
			
hgs
parents:
diff changeset
  2582
}#fn
hgs
parents:
diff changeset
  2583
hgs
parents:
diff changeset
  2584
hgs
parents:
diff changeset
  2585
sub GetXmls()
hgs
parents:
diff changeset
  2586
{
hgs
parents:
diff changeset
  2587
  my @foundList;
hgs
parents:
diff changeset
  2588
  my $libname = shift @_;
hgs
parents:
diff changeset
  2589
	my @globlist = ();
hgs
parents:
diff changeset
  2590
	if($target eq "winsspd" && $sdkversion ne "")
hgs
parents:
diff changeset
  2591
	{
hgs
parents:
diff changeset
  2592
		@globlist = ("winsspd_".$sdkversion);
hgs
parents:
diff changeset
  2593
		#print "winsspd ".$sdkversion." selected\n";
hgs
parents:
diff changeset
  2594
	}
hgs
parents:
diff changeset
  2595
	elsif($target eq "winsspd")
hgs
parents:
diff changeset
  2596
	{
hgs
parents:
diff changeset
  2597
		@globlist = ("winsspd");
hgs
parents:
diff changeset
  2598
		#print "winsspd selected\n";
hgs
parents:
diff changeset
  2599
	}
hgs
parents:
diff changeset
  2600
	elsif($sdkversion ne "")
hgs
parents:
diff changeset
  2601
	{
hgs
parents:
diff changeset
  2602
		@globlist = ($target,"hw_".$sdkversion);
hgs
parents:
diff changeset
  2603
		#print "$target $sdkversion selected\n";
hgs
parents:
diff changeset
  2604
	}
hgs
parents:
diff changeset
  2605
	else
hgs
parents:
diff changeset
  2606
	{
hgs
parents:
diff changeset
  2607
		@globlist = ($target,"hw");
hgs
parents:
diff changeset
  2608
		#print "$target $sdkversion selected\n";
hgs
parents:
diff changeset
  2609
	}
hgs
parents:
diff changeset
  2610
	
hgs
parents:
diff changeset
  2611
	foreach my $module(@generatedModules)
hgs
parents:
diff changeset
  2612
	{
hgs
parents:
diff changeset
  2613
	  my $glob_to_use = "";
hgs
parents:
diff changeset
  2614
	  my @fileList;
hgs
parents:
diff changeset
  2615
	  foreach my $glob(@globlist)
hgs
parents:
diff changeset
  2616
	  {
hgs
parents:
diff changeset
  2617
			my $src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
hgs
parents:
diff changeset
  2618
			#print "Analysing $module and  $glob\n";
hgs
parents:
diff changeset
  2619
			@fileList = glob($src);
hgs
parents:
diff changeset
  2620
			foreach my $file(@fileList)
hgs
parents:
diff changeset
  2621
			{
hgs
parents:
diff changeset
  2622
			 my $pat = $glob."\_component\.xml";
hgs
parents:
diff changeset
  2623
			 #print "[$file - $glob"."_component.xml"."]\n";
hgs
parents:
diff changeset
  2624
				if($file =~ /$pat/)
hgs
parents:
diff changeset
  2625
				{
hgs
parents:
diff changeset
  2626
					$glob_to_use = $pat;
hgs
parents:
diff changeset
  2627
					#print "[$file - $glob"."_component.xml"."]\n";
hgs
parents:
diff changeset
  2628
					last
hgs
parents:
diff changeset
  2629
				}
hgs
parents:
diff changeset
  2630
			}#foreach FILE
hgs
parents:
diff changeset
  2631
			if($glob_to_use ne "")
hgs
parents:
diff changeset
  2632
			{
hgs
parents:
diff changeset
  2633
				last;
hgs
parents:
diff changeset
  2634
			}
hgs
parents:
diff changeset
  2635
		}#finding glob	
hgs
parents:
diff changeset
  2636
		if($glob_to_use ne "")
hgs
parents:
diff changeset
  2637
		{
hgs
parents:
diff changeset
  2638
				#print "Using the glob $glob_to_use\n";
hgs
parents:
diff changeset
  2639
				my $src = $ATSRoot."/components/".$libname."_"."$module/*.xml";
hgs
parents:
diff changeset
  2640
				@fileList = glob($src);
hgs
parents:
diff changeset
  2641
				foreach my $file(@fileList)
hgs
parents:
diff changeset
  2642
				{
hgs
parents:
diff changeset
  2643
					#print "[$file - $glob_to_use]\n";
hgs
parents:
diff changeset
  2644
					if($file =~ /$glob_to_use/)
hgs
parents:
diff changeset
  2645
					{
hgs
parents:
diff changeset
  2646
				  	$file =~ /.*components[\\\/](.*)/;
hgs
parents:
diff changeset
  2647
				  	my $value = $1;
hgs
parents:
diff changeset
  2648
				  	$value =~ s/\//\\/g;
hgs
parents:
diff changeset
  2649
				  	#print "adding $value for $module with $glob_to_use\n";
hgs
parents:
diff changeset
  2650
						unshift @foundList,$value;
hgs
parents:
diff changeset
  2651
				  }#if
hgs
parents:
diff changeset
  2652
				}#foreach
hgs
parents:
diff changeset
  2653
		}#glob is present
hgs
parents:
diff changeset
  2654
		else
hgs
parents:
diff changeset
  2655
		{
hgs
parents:
diff changeset
  2656
			warn("Unable to figure out glob to use for $module. Skipping...\n");
hgs
parents:
diff changeset
  2657
		}
hgs
parents:
diff changeset
  2658
	}#each module
hgs
parents:
diff changeset
  2659
  return @foundList;
hgs
parents:
diff changeset
  2660
 }#fn
hgs
parents:
diff changeset
  2661
hgs
parents:
diff changeset
  2662
__END__
hgs
parents:
diff changeset
  2663
:end
hgs
parents:
diff changeset
  2664
hgs
parents:
diff changeset
  2665
hgs
parents:
diff changeset
  2666
hgs
parents:
diff changeset
  2667