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