Subversion Repositories DevTools

Rev

Rev 396 | Rev 2476 | Go to most recent revision | 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',
45
        'PPC_603E',
335 dpurdie 46
        'JAVA',
2449 dpurdie 47
        'WIN32',
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',
105
        'JAVA',
106
        'MCR',
107
        'MERG',
108
        'MOS68K',
109
        'MOS68KRM',
110
        'MOSCF',
111
        'MPT',
112
        'NGBCP',
113
        'NGDDU',
114
        'PHARLAP',
345 dpurdie 115
        'PHP',
371 dpurdie 116
        'RIORDS',
279 dpurdie 117
        'THYRON',
315 dpurdie 118
        'VB6',
279 dpurdie 119
        'VERIX',
383 dpurdie 120
        'VIXITP',
279 dpurdie 121
        'VS2003',
122
        'VS2005',
291 dpurdie 123
        'VS2008',
347 dpurdie 124
        'VS2010',
355 dpurdie 125
        'WCEIPA280',
279 dpurdie 126
        'WCEIT3000',
396 dpurdie 127
        'WCENAUTIZX5',
279 dpurdie 128
        'WCEPA961',
129
        'WCEPA962',
130
        'WCEPA962_500',
131
        'WCEPCM7220',
132
        'WCEPSION_420',
133
        'WCEPSION_500',
134
        'WCEPSION_500_emu',
303 dpurdie 135
        'WCEPSION_500_VS2005',
279 dpurdie 136
        'WCEPSPC_arm',
137
        'WCEPSPC_emu',
138
        'WCEX86A420',
139
        'WCEX86A500',
140
        'WCEX86A500_SOM4455',
141
        'WIN32',
142
        ],
143
);
144
 
145
#
146
#   The above data will be reorganised and placed into the following
147
#   hash. This simplifies the data definition and lookup
148
#
149
my %BuildAvailabilityData;
150
 
151
#-------------------------------------------------------------------------------
152
# Function        : InitData
153
#
154
# Description     : Init data structures
155
#                   Done once
156
#
157
#                   Convert an array into a hash to simplify lookup
158
#
159
# Inputs          : None
160
#
161
# Returns         : Nothing
162
#
163
sub InitData
164
{
165
    #
166
    #   Only do this work once
167
    #
168
    return if exists $BuildAvailabilityData{'GENERIC'};
169
 
170
    #
171
    #   Validate build machine
172
    #
173
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
174
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
175
 
176
    #
177
    #   Convert the array into a hash to spped up access later
178
    #
179
    $BuildAvailabilityData{'GENERIC'} = 1;
180
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
181
    {
182
        $BuildAvailabilityData{$_} = 1;
183
    }
184
}
185
 
186
#-------------------------------------------------------------------------------
187
# Function        : checkBuildAvailability
188
#
189
# Description     : Check that a given target can be be built on the
190
#                   current machine type
191
#
192
# Inputs          : $target             - Name of target platform
193
#
194
#
195
# Returns         : True if Target can be built on current machine
196
#
197
sub checkBuildAvailability
198
{
199
    my ($target) = @_;
200
    InitData();
201
    return exists $BuildAvailabilityData{$target};
202
}
203
 
204
1;
205