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