common/tools/CheckBuildEnv.pl
author Simon Howkins <simonh@symbian.org>
Thu, 10 Dec 2009 12:01:59 +0000
changeset 825 1de547e13d13
parent 358 61571c10c5d0
permissions -rw-r--r--
Updates to make the build environment check more reasonable: Mercurial v1.3 permitted The Java compiler is not a showstopping issue 7-zip can be installed in any location Update to Helium 5 Helium can be installed in PDT 1.*, not necessarily 1.0 Raptor installation path not significant Update to Raptor 2.9.* The Raptor patch to update the bundled version of python is no longer relevant BRAG calculations updated to ignore items not being in the system path, as this just doesn't matter. Overall effect is that the build environment check should pass on a machine that is able to do a build!

## @file BuildEnvXML.pl
# @ingroup userscripts clientscripts
#
# Uses information which is defined in the BuildEnvXML.xml to set up a machine
# specific environment, such as path for compilers. 
#
# @todo Document this script.
#
# Copyright (c) 2009 Symbian Foundation  Ltd. All rights reserved.
#

package BuildEnvXML;

use Getopt::Long;
use BuildEnvXML qw(&getToolEnvironment &getLastErrorMsg);

my $toolenvxml = "";
my $dbgfile = "";
my $sbsconfig = "";
my $toolsconfig = "";

GetOptions ("xml=s" => \$toolenvxml, "dbg:s" => \$dbgfile, "sbs:s" => \$sbsconfig, "tools:s" => \$sbsconfig); 

my @contexts = @ARGV;

if ($toolenvxml eq "")
{
	print ("ERROR: XML file cannot be found!\n");
}

# Checking the SBS config to test only what's necessary for that build
if ($sbsconfig =~ /armv5/i)
{
	push @contexts, "ARMv5";
}

# Checking the tools config to test only what's necessary for that build
if ($sbsconfig =~ /tools[^2]?(,|$|_)/i)
{
	push @contexts, "tools";
}

my $sErrMsg;
my $result = 0;

if (-e $dbgfile)
{
	unlink($dbgfile);
}

&setDbgFile($dbgfile);

foreach my $context (@contexts){
	print "\n\n### Checking $context Tools ###\n";
	my $sSystemPath = &getToolEnvironment($toolenvxml, $context);

	$sErrMsg = &getLastErrorMsg;
	if ($sErrMsg eq "") { $sErrMsg = "\nAll OK.\n";}
	if($sErrMsg =~ /ERROR/)
	{
		print "\n$context Tools VERIFICATION FAILED:";
		print $sErrMsg."\n\n";
		$result = -1;
	}else{
		print "\n$context tools VERIFICATION PASSED:";
		print $sErrMsg."\n\n";
	}
}
if ($result ne 0)
{
	print "\n ==> PROGRAM STOPPED!!\n";
}
exit($result);