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