Subversion Repositories DevTools

Rev

Rev 3830 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
279 dpurdie 1
########################################################################
2
# Copyright (C) 2008 ERG Limited, All rights reserved
3
#
4
# Module name   : PLATFORM_CFG.PM
5
# Module type   : Makefile system
6
# Compiler(s)   : Perl
7
# Environment(s): jats
8
#
9
# Description   : Provides platform configuration information
10
#
11
#                 The main pupose of this configuration information is to
12
#                 prevent JATS from attempting to build software on
13
#                 a platform that does not support the required compilers
14
#
15
#                 ie: Its not possible to build PPC_302E on a windows
16
#                     Nor is it possbile to build WIN32 on a Sun Sparc
17
#
18
#                 This can be done via GBE_BUILDFILTER, but results in
19
#                 an unwieldy GBE_BUILDFILTER. Better to prune the
20
#                 targets at the start
21
#
22
#......................................................................#
23
 
24
require 5.008_002;
25
use strict;
26
use warnings;
27
 
28
package PlatformConfig;
29
use JatsError;
30
 
31
#
32
#   The following structure is a hash of arrays
33
#   The hash key is a supported machine type - one per machine
34
#   The data is an array of supported PLATFORMS
35
#
36
my %BuildAvailability = (
37
    'linux_i386' => [
337 dpurdie 38
        'COBRA',
279 dpurdie 39
        'ARM9TDMI',
40
        'LINUX86',
41
        'LINUX_ARMV4',
42
        'LINUX_EMU',
43
        'LINUX_ETX',
44
        'LINUX_I386',
3965 dpurdie 45
        'UBUNTU12',
279 dpurdie 46
        'PPC_603E',
335 dpurdie 47
        'JAVA',
279 dpurdie 48
        ],
49
 
50
    'solaris10_sparc32' => [
51
        'SOLARIS10_SPARC32',
52
        'SOLARIS10_SPARC64',
53
        'JAVA',
54
        ],
55
 
56
    'solaris10_x86' => [
57
        'SOLARIS10_X64',
58
        'SOLARIS10_X86',
59
        'JAVA',
60
        ],
61
 
62
    'sparc' => [
281 dpurdie 63
        'SOLARIS',
279 dpurdie 64
        'SOLARIS_I386',
65
        'SOLARIS_SPARC',
66
        'JAVA',
67
        ],
68
 
69
    'win32' => [
70
        'ACEX',
71
        'AMX',
363 dpurdie 72
        'ARM_I5100',
279 dpurdie 73
        'AVR_IAR',
74
        'BORLAND',
75
        'CMOS386',
76
        'CMOS68K',
77
        'CSHARP',
78
        'CSHARP2005',
291 dpurdie 79
        'CSHARP2008',
347 dpurdie 80
        'CSHARP2010',
279 dpurdie 81
        'DAFBR_MOS',
82
        'DAFBR_WIN',
289 dpurdie 83
        'DELPHI7',
279 dpurdie 84
        'DF4OBE',
85
        'DOS16',
86
        'DOS32',
87
        'EEPP386',
88
        'EETP386',
89
        'EOS',
90
        'EOSM68K',
91
        'EOSP386',
92
        'GMPCA',
93
        'GO32',
94
        'H8S',
283 dpurdie 95
        'H400',
279 dpurdie 96
        'HK386PC',
97
        'HKAVM',
98
        'HKAVM2',
99
        'HKBCP',
100
        'HKDDU',
101
        'HKGAK',
102
        'HKMPR',
103
        'HKPCA',
104
        'INGEN',
3830 dpurdie 105
        'INTELLECT',
279 dpurdie 106
        'JAVA',
107
        'MCR',
108
        'MERG',
109
        'MOS68K',
110
        'MOS68KRM',
111
        'MOSCF',
112
        'MPT',
3563 dpurdie 113
        'VSDEVRC',
279 dpurdie 114
        'NGBCP',
115
        'NGDDU',
116
        'PHARLAP',
345 dpurdie 117
        'PHP',
371 dpurdie 118
        'RIORDS',
279 dpurdie 119
        'THYRON',
315 dpurdie 120
        'VB6',
279 dpurdie 121
        'VERIX',
383 dpurdie 122
        'VIXITP',
279 dpurdie 123
        'VS2003',
124
        'VS2005',
291 dpurdie 125
        'VS2008',
347 dpurdie 126
        'VS2010',
355 dpurdie 127
        'WCEIPA280',
279 dpurdie 128
        'WCEIT3000',
396 dpurdie 129
        'WCENAUTIZX5',
279 dpurdie 130
        'WCEPA961',
131
        'WCEPA962',
132
        'WCEPA962_500',
133
        'WCEPCM7220',
134
        'WCEPSION_420',
135
        'WCEPSION_500',
136
        'WCEPSION_500_emu',
303 dpurdie 137
        'WCEPSION_500_VS2005',
279 dpurdie 138
        'WCEPSPC_arm',
139
        'WCEPSPC_emu',
140
        'WCEX86A420',
141
        'WCEX86A500',
142
        'WCEX86A500_SOM4455',
143
        'WIN32',
144
        ],
145
);
146
 
147
#
148
#   The above data will be reorganised and placed into the following
149
#   hash. This simplifies the data definition and lookup
150
#
151
my %BuildAvailabilityData;
152
 
153
#-------------------------------------------------------------------------------
154
# Function        : InitData
155
#
156
# Description     : Init data structures
157
#                   Done once
158
#
159
#                   Convert an array into a hash to simplify lookup
160
#
161
# Inputs          : None
162
#
163
# Returns         : Nothing
164
#
165
sub InitData
166
{
167
    #
168
    #   Only do this work once
169
    #
170
    return if exists $BuildAvailabilityData{'GENERIC'};
171
 
172
    #
173
    #   Validate build machine
174
    #
175
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
176
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
177
 
178
    #
179
    #   Convert the array into a hash to spped up access later
180
    #
181
    $BuildAvailabilityData{'GENERIC'} = 1;
182
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
183
    {
184
        $BuildAvailabilityData{$_} = 1;
185
    }
186
}
187
 
188
#-------------------------------------------------------------------------------
189
# Function        : checkBuildAvailability
190
#
191
# Description     : Check that a given target can be be built on the
192
#                   current machine type
193
#
194
# Inputs          : $target             - Name of target platform
195
#
196
#
197
# Returns         : True if Target can be built on current machine
198
#
199
sub checkBuildAvailability
200
{
201
    my ($target) = @_;
202
    InitData();
203
    return exists $BuildAvailabilityData{$target};
204
}
205
 
206
1;
207