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