Subversion Repositories DevTools

Rev

Rev 3563 | 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',
279 dpurdie 47
        ],
48
 
49
    'solaris10_sparc32' => [
50
        'SOLARIS10_SPARC32',
51
        'SOLARIS10_SPARC64',
52
        'JAVA',
53
        ],
54
 
55
    'solaris10_x86' => [
56
        'SOLARIS10_X64',
57
        'SOLARIS10_X86',
58
        'JAVA',
59
        ],
60
 
61
    'sparc' => [
281 dpurdie 62
        'SOLARIS',
279 dpurdie 63
        'SOLARIS_I386',
64
        'SOLARIS_SPARC',
65
        'JAVA',
66
        ],
67
 
68
    'win32' => [
69
        'ACEX',
70
        'AMX',
363 dpurdie 71
        'ARM_I5100',
279 dpurdie 72
        'AVR_IAR',
73
        'BORLAND',
74
        'CMOS386',
75
        'CMOS68K',
76
        'CSHARP',
77
        'CSHARP2005',
291 dpurdie 78
        'CSHARP2008',
347 dpurdie 79
        'CSHARP2010',
279 dpurdie 80
        'DAFBR_MOS',
81
        'DAFBR_WIN',
289 dpurdie 82
        'DELPHI7',
279 dpurdie 83
        'DF4OBE',
84
        'DOS16',
85
        'DOS32',
86
        'EEPP386',
87
        'EETP386',
88
        'EOS',
89
        'EOSM68K',
90
        'EOSP386',
91
        'GMPCA',
92
        'GO32',
93
        'H8S',
283 dpurdie 94
        'H400',
279 dpurdie 95
        'HK386PC',
96
        'HKAVM',
97
        'HKAVM2',
98
        'HKBCP',
99
        'HKDDU',
100
        'HKGAK',
101
        'HKMPR',
102
        'HKPCA',
103
        'INGEN',
3830 dpurdie 104
        'INTELLECT',
279 dpurdie 105
        'JAVA',
106
        'MCR',
107
        'MERG',
108
        'MOS68K',
109
        'MOS68KRM',
110
        'MOSCF',
111
        'MPT',
3563 dpurdie 112
        'VSDEVRC',
279 dpurdie 113
        'NGBCP',
114
        'NGDDU',
115
        'PHARLAP',
345 dpurdie 116
        'PHP',
371 dpurdie 117
        'RIORDS',
279 dpurdie 118
        'THYRON',
315 dpurdie 119
        'VB6',
279 dpurdie 120
        'VERIX',
383 dpurdie 121
        'VIXITP',
279 dpurdie 122
        'VS2003',
123
        'VS2005',
291 dpurdie 124
        'VS2008',
347 dpurdie 125
        'VS2010',
355 dpurdie 126
        'WCEIPA280',
279 dpurdie 127
        'WCEIT3000',
396 dpurdie 128
        'WCENAUTIZX5',
279 dpurdie 129
        'WCEPA961',
130
        'WCEPA962',
131
        'WCEPA962_500',
132
        'WCEPCM7220',
133
        'WCEPSION_420',
134
        'WCEPSION_500',
135
        'WCEPSION_500_emu',
303 dpurdie 136
        'WCEPSION_500_VS2005',
279 dpurdie 137
        'WCEPSPC_arm',
138
        'WCEPSPC_emu',
139
        'WCEX86A420',
140
        'WCEX86A500',
141
        'WCEX86A500_SOM4455',
142
        'WIN32',
143
        ],
144
);
145
 
146
#
147
#   The above data will be reorganised and placed into the following
148
#   hash. This simplifies the data definition and lookup
149
#
150
my %BuildAvailabilityData;
151
 
152
#-------------------------------------------------------------------------------
153
# Function        : InitData
154
#
155
# Description     : Init data structures
156
#                   Done once
157
#
158
#                   Convert an array into a hash to simplify lookup
159
#
160
# Inputs          : None
161
#
162
# Returns         : Nothing
163
#
164
sub InitData
165
{
166
    #
167
    #   Only do this work once
168
    #
169
    return if exists $BuildAvailabilityData{'GENERIC'};
170
 
171
    #
172
    #   Validate build machine
173
    #
174
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
175
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
176
 
177
    #
178
    #   Convert the array into a hash to spped up access later
179
    #
180
    $BuildAvailabilityData{'GENERIC'} = 1;
181
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
182
    {
183
        $BuildAvailabilityData{$_} = 1;
184
    }
185
}
186
 
187
#-------------------------------------------------------------------------------
188
# Function        : checkBuildAvailability
189
#
190
# Description     : Check that a given target can be be built on the
191
#                   current machine type
192
#
193
# Inputs          : $target             - Name of target platform
194
#
195
#
196
# Returns         : True if Target can be built on current machine
197
#
198
sub checkBuildAvailability
199
{
200
    my ($target) = @_;
201
    InitData();
202
    return exists $BuildAvailabilityData{$target};
203
}
204
 
205
1;
206