Subversion Repositories DevTools

Rev

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