Rev 4700 | Rev 4726 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
######################################################################### Copyright (C) 2008 ERG Limited, All rights reserved## Module name : PLATFORM_CFG.PM# Module type : Makefile system# Compiler(s) : Perl# Environment(s): jats## Description : Provides platform configuration information## The main pupose of this configuration information is to# prevent JATS from attempting to build software on# a platform that does not support the required compilers## ie: Its not possible to build PPC_302E on a windows# Nor is it possbile to build WIN32 on a Sun Sparc## This can be done via GBE_BUILDFILTER, but results in# an unwieldy GBE_BUILDFILTER. Better to prune the# targets at the start##......................................................................#require 5.008_002;use strict;use warnings;package PlatformConfig;use JatsError;## The following structure is a hash of arrays# The hash key is a supported machine type - one per machine# The data is an array of supported PLATFORMS#my %BuildAvailability = ('linux_i386' => ['ANDROIDARM','ANDROIDMIPS','ANDROIDX86','ANDROID','ARM9TDMI','COBRA','JAVA','LINUX86','LINUX_ARMV4','LINUX_EMU','LINUX_ETX','LINUX_I386','PPC_603E','SK20','UBUNTU12','UBUNTU12_INSTRUMENT',],'linux_x64' => ['LINUX_I386',],'solaris10_sparc32' => ['SOLARIS10_SPARC32','SOLARIS10_SPARC64','JAVA',],'solaris10_x86' => ['SOLARIS10_X64','SOLARIS10_X86','JAVA',],'sparc' => ['SOLARIS','SOLARIS_I386','SOLARIS_SPARC','JAVA',],'win32' => ['ACEX','AMX','ARM_I5100','AVR_IAR','BORLAND','CMOS386','CMOS68K','CSHARP','CSHARP2005','CSHARP2008','CSHARP2010','CSHARP2012','DAFBR_MOS','DAFBR_WIN','DELPHI7','DF4OBE','DOS16','DOS32','EEPP386','EETP386','EOS','EOSM68K','EOSP386','GMPCA','GO32','H8S','H400','HK386PC','HKAVM','HKAVM2','HKBCP','HKDDU','HKGAK','HKMPR','HKPCA','INGEN','INTELLECT','JAVA','MCR','MERG','MOS68K','MOS68KRM','MOSCF','MPT','VSDEVRC','NGBCP','NGDDU','PHARLAP','PHP','RIORDS','THYRON','VB6','VERIX','VIXITP','VS2003','VS2005','VS2008','VS2010','VS2012','WCEIPA280','WCEIT3000','WCENAUTIZX5','WCEPA961','WCEPA962','WCEPA962_500','WCEPCM7220','WCEPSION_420','WCEPSION_500','WCEPSION_500_emu','WCEPSION_500_VS2005','WCEPSPC_arm','WCEPSPC_emu','WCEX86A420','WCEX86A500','WCEX86A500_SOM4455','WIN32',],);## Convert Machine Type to Machine Class# These match the Release Manager and BuildTool definitions# Used for GENERIC Processing#my %MachineTypeToClass = (linux_i386 => 'LINUX',linux_x64 => 'LINUX',solaris10_sparc32 => 'SOLARIS',solaris10_x86 => 'SOLARIS',sparc => 'SOLARIS',win32 => 'WIN32',);## The above data will be reorganised and placed into the following# hash. This simplifies the data definition and lookup#my %BuildAvailabilityData;# A hash of 'special' known targets# Simply used to reduce JATS warnings about some psuedo targetsmy %knownSpecial;#-------------------------------------------------------------------------------# Function : InitData## Description : Init data structures# Done once## Convert the $BuildAvailability entry array into a hash to# simplify lookup. Add in thr three types of GENERIC target:# GENERIC - can be built on ANY machine# GENERIC_XXX - can be built on machine of class XXX# MACH_YYY - can be built on MACHTYPE YYY## Inputs : None## Returns : Nothing#sub InitData{## Only do this work once#return if exists $BuildAvailabilityData{'GENERIC'};## Validate build machine#Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );## Convert the array into a hash to speed up access later#$BuildAvailabilityData{'GENERIC'} = 2;foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}} ){$BuildAvailabilityData{$_} = 1;}# ## # Insert GENERIC_<MachClass># ## Error (__PACKAGE__ . " : Unknown build machine class: $::GBE_MACHTYPE")# unless ( exists $MachineTypeToClass{$::GBE_MACHTYPE} );# $BuildAvailabilityData{join('_','GENERIC', $MachineTypeToClass{$::GBE_MACHTYPE} )} = 2;## ## # Insert MachType definition# # These are of the form MACH_xxxx# ## $BuildAvailabilityData{join('_','MACH', uc($::GBE_MACHTYPE) )} = 2;## ## # Create a hash of special 'known' targets# #$knownSpecial{'GENERIC'} = 2;# foreach my $machtype ( keys %MachineTypeToClass ) {# $knownSpecial{join('_','MACH', uc($machtype) )} = 2;# $knownSpecial{join('_','GENERIC', $MachineTypeToClass{$machtype} )} = 2;# }}#-------------------------------------------------------------------------------# Function : checkBuildAvailability## Description : Check that a given target can be be built on the# current machine type. Also indicate if it is a GENERIC# target; one that can always be built.## Inputs : $target - Name of target platform### Returns : 0 - target cannot be built# 1 - target can be built, subject to build filter# 2 - target can be built, is Generic#sub checkBuildAvailability{my ($target) = @_;Error("Internal: checkBuildAvailability. No argument specified") unless $target;InitData();if (exists $BuildAvailabilityData{$target}){return $BuildAvailabilityData{$target} ;}return 0;}#-------------------------------------------------------------------------------# Function : checkKnownSpecial## Description : Check that a given (special) target is known to JATS# Used to suppress warnings about GENERIC targets not known# to the current machine type.## Inputs : $target - Name of target platform### Returns : 0 - target not known# 1 - target is known to JATS#sub checkKnownSpecial{my ($target) = @_;Error("Internal: checkKnown. No argument specified") unless $target;InitData();if (exists $knownSpecial{$target}){return $knownSpecial{$target} ;}return 0;}1;