Subversion Repositories DevTools

Rev

Rev 5716 | Rev 6177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5716 Rev 6133
Line 30... Line 30...
30
 
30
 
31
#
31
#
32
#   The following structure is a hash of arrays
32
#   The following structure is a hash of arrays
33
#   The hash key is a supported machine type - one per machine
33
#   The hash key is a supported machine type - one per machine
34
#   The data is an array of supported PLATFORMS
34
#   The data is an array of supported PLATFORMS
-
 
35
#   Each platform may have a : seperated list of tags
-
 
36
#   Known tags include:
-
 
37
#       TOOLSET - Sutable for building JATS tools
-
 
38
#       NATIVE  - Can be expected to run on the build machine
-
 
39
#       KNOWN - Indicated platform is known to this machine type. Used to test existence 
-
 
40
#       GENERIC - Can be built on any machine
-
 
41
#       DEVLINUX - Part of the DEVLINUX alias
-
 
42
#       LINUX - Part of the LINUX alias 
-
 
43
#       LMOS - Bastard Platforms from Hell   
35
#
44
#
36
my %BuildAvailability = (
45
my %BuildAvailability = (
37
    'linux_i386' => [
46
    'linux_i386' => [
38
        'ANDROIDARM',
47
        'ANDROIDARM:ANDROIDNDK',
39
        'ANDROIDMIPS',
48
        'ANDROIDMIPS:ANDROIDNDK',
40
        'ANDROIDX86',
49
        'ANDROIDX86:ANDROIDNDK',
41
        'ANDROID',
50
        'ANDROID',
42
        'ARM9TDMI',
51
        'ARM9TDMI:DEVLINUX:LMOS',
43
        'COBRA',
52
        'COBRA:DEVLINUX:LMOS',
44
        'COBRA2',
53
        'COBRA2:DEVLINUX:LMOS',
45
        'HAMMERHEAD',
54
        'HAMMERHEAD',
46
        'JAVA:NATIVE',
55
        'JAVA:NATIVE',
47
        'LINUX86',
56
        'LINUX86',
48
        'LINUX_ARMV4',
57
        'LINUX_ARMV4',
49
        'LINUX_EMU',
58
        'LINUX_EMU',
50
        'LINUX_ETX',
59
        'LINUX_ETX:DEVLINUX:LMOS',
51
        'LINUX_I386:NATIVE',
60
        'LINUX_I386:NATIVE:TOOLSET',
52
        'PPC_603E',
61
        'PPC_603E:DEVLINUX:LMOS',
53
        'SK20',
62
        'SK20:DEVLINUX',
54
        'SK20V41',
63
        'SK20V41:DEVLINUX',
55
        'UBUNTU12:NATIVE',
64
        'UBUNTU12:NATIVE:TOOLSET:DEVLINUX:LMOS',
56
        'UBUNTU12_INSTRUMENT:NATIVE',
65
        'UBUNTU12_INSTRUMENT:NATIVE:DEVLINUX:INSTRUMENT',
57
        'UBUNTU12C11:NATIVE',
66
        'UBUNTU12C11:NATIVE:TOOLSET:DEVLINUX:LMOS',
58
        'UBUNTU12C11_INSTRUMENT:NATIVE',
67
        'UBUNTU12C11_INSTRUMENT:NATIVE:DEVLINUX:INSTRUMENT',
59
        'VIPER2',
68
        'VIPER2:DEVLINUX',
60
        ],
69
        ],
61
 
70
 
62
    'linux_x64' => [
71
    'linux_x64' => [
63
        'LINUX_I386:NATIVE',
72
        'LINUX_I386:NATIVE',
64
        'UBUNTU14:NATIVE',
73
        'JAVA:NATIVE',
-
 
74
        'UBUNTU14:NATIVE:TOOLSET:LINUX',
65
        'UBUNTU14_INSTRUMENT:NATIVE',
75
        'UBUNTU14_INSTRUMENT:NATIVE:LINUX:INSTRUMENT',
-
 
76
        'UBUNTU16:NATIVE:TOOLSET:LINUX',
-
 
77
        'UBUNTU16_INSTRUMENT:NATIVE:LINUX:INSTRUMENT',
-
 
78
        'ANDROIDARM:ANDROIDNDK',
-
 
79
        'ANDROIDMIPS:ANDROIDNDK',
-
 
80
        'ANDROIDX86:ANDROIDNDK',
-
 
81
        'ANDROID',
-
 
82
        'ARM9TDMI:DEVLINUX:LMOS',
-
 
83
        'COBRA:DEVLINUX:LMOS',
-
 
84
        'COBRA2:DEVLINUX:LMOS',
-
 
85
        'HAMMERHEAD',
-
 
86
        'LINUX_ETX:DEVLINUX:LMOS',
-
 
87
        'PPC_603E:DEVLINUX:LMOS',
-
 
88
        'SK20:DEVLINUX',
-
 
89
        'SK20V41:DEVLINUX',
-
 
90
        'UBUNTU12C11:NATIVE:DEVLINUX:LMOS',
-
 
91
        'UBUNTU12C11_INSTRUMENT:NATIVE:DEVLINUX:INSTRUMENT',
-
 
92
        'VIPER2:DEVLINUX',
-
 
93
        'RHEL7:LINUX:TOOLSET:NATIVE',
66
        ],
94
        ],
67
 
95
 
68
    'solaris10_sparc32' => [
96
    'solaris10_sparc32' => [
69
        'SOLARIS10_SPARC32:NATIVE',
97
        'SOLARIS10_SPARC32:NATIVE:TOOLSET',
70
        'SOLARIS10_SPARC64:NATIVE',
98
        'SOLARIS10_SPARC64:NATIVE',
71
        'JAVA:NATIVE',
99
        'JAVA:NATIVE',
72
        ],
100
        ],
73
 
101
 
74
    'solaris10_x86' => [
102
    'solaris10_x86' => [
-
 
103
        'SOLARIS10_X86:NATIVE:TOOLSET',
75
        'SOLARIS10_X64:NATIVE',
104
        'SOLARIS10_X64:NATIVE',
76
        'SOLARIS10_X86',
-
 
77
        'JAVA',
105
        'JAVA',
78
        ],
106
        ],
79
 
107
 
80
    'sparc' => [
108
    'sparc' => [
81
        'SOLARIS:NATIVE',
109
        'SOLARIS:NATIVE:TOOLSET',
82
        'SOLARIS_I386',
110
        'SOLARIS_I386',
83
        'SOLARIS_SPARC',
111
        'SOLARIS_SPARC',
84
        'JAVA:NATIVE',
112
        'JAVA:NATIVE',
85
        ],
113
        ],
86
 
114
 
Line 97... Line 125...
97
        'CSHARP:NATIVE',
125
        'CSHARP:NATIVE',
98
        'CSHARP2005:NATIVE',
126
        'CSHARP2005:NATIVE',
99
        'CSHARP2008:NATIVE',
127
        'CSHARP2008:NATIVE',
100
        'CSHARP2010:NATIVE',
128
        'CSHARP2010:NATIVE',
101
        'CSHARP2012:NATIVE',
129
        'CSHARP2012:NATIVE',
-
 
130
        'CSHARP2015:NATIVE',
102
        'DAFBR_MOS',
131
        'DAFBR_MOS',
103
        'DAFBR_WIN',
132
        'DAFBR_WIN',
104
        'DELPHI7',
133
        'DELPHI7',
105
        'DF4OBE',
134
        'DF4OBE',
106
        'DOS16',
135
        'DOS16',
Line 143... Line 172...
143
        'VIXITP',
172
        'VIXITP',
144
        'VS2003:NATIVE',
173
        'VS2003:NATIVE',
145
        'VS2005:NATIVE',
174
        'VS2005:NATIVE',
146
        'VS2008:NATIVE',
175
        'VS2008:NATIVE',
147
        'VS2010:NATIVE',
176
        'VS2010:NATIVE',
148
        'VS2012:NATIVE',
177
        'VS2012:NATIVE:TOOLSET:MSWIN32',
-
 
178
        'VS2015:NATIVE:TOOLSET:MSWIN32',
149
        'WCEIPA280',
179
        'WCEIPA280:WINCE',
150
        'WCEIT3000',
180
        'WCEIT3000:WINCE',
151
        'WCENAUTIZX5',
181
        'WCENAUTIZX5',
152
        'WCEPA961',
182
        'WCEPA961:WINCE',
153
        'WCEPA962',
183
        'WCEPA962:WINCE',
154
        'WCEPA962_500',
184
        'WCEPA962_500:WINCE',
155
        'WCEPCM7220',
185
        'WCEPCM7220:WINCE',
156
        'WCEPSION_420',
186
        'WCEPSION_420',
157
        'WCEPSION_500',
187
        'WCEPSION_500:WINCE',
158
        'WCEPSION_500_emu',
188
        'WCEPSION_500_emu:WINCE',
159
        'WCEPSION_500_VS2005',
189
        'WCEPSION_500_VS2005:WINCE',
160
        'WCEPSPC_arm',
190
        'WCEPSPC_arm:WINCE',
161
        'WCEPSPC_emu',
191
        'WCEPSPC_emu:WINCE',
162
        'WCEX86A420',
192
        'WCEX86A420:WINCE',
163
        'WCEX86A500',
193
        'WCEX86A500:WINCE',
164
        'WCEX86A500_SOM4455',
194
        'WCEX86A500_SOM4455:WINCE',
-
 
195
        'WIN32:NATIVE:TOOLSET:MSWIN32:LMOS',
165
        'WIN32:NATIVE',
196
        'VS2012_X64:NATIVE:MSWIN64',
166
        'VS2012_X64:NATIVE',
197
        'VS2015_X64:NATIVE:MSWIN64',
167
        ],
198
        ],
168
 
199
 
169
);
200
);
170
 
201
 
171
#
202
#
172
#   Convert Machine Type to Machine Class
-
 
173
#       These match the Release Manager and BuildTool definitions
-
 
174
#       Used for GENERIC Processing
-
 
175
#
-
 
176
my %MachineTypeToClass = (
-
 
177
      linux_i386        => 'LINUX',
-
 
178
      linux_x64         => 'LINUX',
-
 
179
      solaris10_sparc32 => 'SOLARIS',
-
 
180
      solaris10_x86     => 'SOLARIS',
-
 
181
      sparc             => 'SOLARIS',
-
 
182
      win32             => 'WIN32',
-
 
183
);
-
 
184
#
-
 
185
#   The above data will be reorganised and placed into the following
203
#   The above data will be reorganised and placed into the following
186
#   hash. This simplifies the data definition and lookup
204
#   hashes to simplify data access
187
#
205
#
188
my %BuildAvailabilityData;
-
 
189
 
-
 
190
#   A hash of 'special' known targets
-
 
191
#   Simply used to reduce JATS warnings about some psuedo targets
-
 
192
my %knownSpecial;
206
my %TargetByTag;
193
 
-
 
194
#   List of Native targets
-
 
195
my  @nativeTargets;
207
my %TagByTarget;
196
 
208
 
197
#-------------------------------------------------------------------------------
209
#-------------------------------------------------------------------------------
198
# Function        : InitData
210
# Function        : InitData
199
#
211
#
200
# Description     : Init data structures
212
# Description     : Init data structures
201
#                   Done once
213
#                   Done once
202
#
214
#
203
#                   Convert the $BuildAvailability entry array into a hash to 
215
#                   Convert the $BuildAvailability entry array into a hash to 
204
#                   simplify lookup. Add in thr three types of GENERIC target:
216
#                   simplify lookup. Add in the GENERIC target:
205
#                       GENERIC         - can be built on ANY machine
217
#                       GENERIC         - can be built on ANY machine
206
#                       GENERIC_XXX     - can be built on machine of class XXX
-
 
207
#                       MACH_YYY        - can be built on MACHTYPE YYY
-
 
208
#
218
#
209
# Inputs          : None
219
# Inputs          : None
210
#
220
#
211
# Returns         : Nothing
221
# Returns         : Nothing
212
#
222
#
213
sub InitData
223
sub InitData
214
{
224
{
215
    #
225
    #
216
    #   Only do this work once
226
    #   Only do this work once
217
    #
227
    #
218
    return if exists $BuildAvailabilityData{'GENERIC'};
228
    return if exists $TagByTarget{'GENERIC'};
219
 
-
 
220
    #
229
    #
221
    #   Validate build machine
230
    #   Validate build machine
222
    #
231
    #
223
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
232
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
224
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
233
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
225
 
234
 
226
    #
235
    #
227
    #   Convert the array into a hash to speed up access later
236
    #   Convert the array into a hash to speed up access later
-
 
237
    #   Create GENERIC platform
-
 
238
    #
-
 
239
    push @{$BuildAvailability{$::GBE_MACHTYPE}}, 'GENERIC:GENERIC';
-
 
240
 
228
    #
241
    #
-
 
242
    #   Create Machine Type specific Generic
-
 
243
    #       GENERIC_XXXX:GENERIC_MACHTYPE:TOOLSET
-
 
244
    #   
229
    $BuildAvailabilityData{'GENERIC'} = 2;
245
    my $genericMachTypes = 'GENERIC_' . uc ($::GBE_MACHTYPE);
-
 
246
    push @{$BuildAvailability{$::GBE_MACHTYPE}}, join (':', $genericMachTypes, 'GENERIC_MACHTYPE', 'TOOLSET' );
-
 
247
 
230
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
248
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
231
    {
249
    {
232
        my @data = split(':', $_ );
250
        my @data = split(':', $_ );
-
 
251
        my $target = shift @data;
-
 
252
 
233
        $BuildAvailabilityData{$data[0]} = 1;
253
        $TagByTarget{$target}{'KNOWN'} = 1;
234
        if (grep(/^NATIVE$/i, @data))
254
        foreach my $item ( @data )
235
        {
255
        {
-
 
256
            $TagByTarget{$target}{uc($item)} = 1;
236
            push @nativeTargets, $data[0];
257
            push @{$TargetByTag{uc($item)}}, $target;
237
        }
258
        }
238
    }
259
    }
239
 
260
 
240
#   #
-
 
241
#   #   Insert GENERIC_<MachClass>
-
 
242
#   #
-
 
243
#   Error (__PACKAGE__ . " : Unknown build machine class: $::GBE_MACHTYPE")
-
 
244
#       unless ( exists $MachineTypeToClass{$::GBE_MACHTYPE} );
-
 
245
#   $BuildAvailabilityData{join('_','GENERIC', $MachineTypeToClass{$::GBE_MACHTYPE} )} = 2;
-
 
246
#
-
 
247
#   #
-
 
248
#   #   Insert MachType definition
-
 
249
#   #   These are of the form MACH_xxxx
-
 
250
#   #
-
 
251
#   $BuildAvailabilityData{join('_','MACH', uc($::GBE_MACHTYPE) )} = 2;
-
 
252
#
-
 
253
#   #
-
 
254
#   #   Create a hash of special 'known' targets
261
    #DebugDumpData("TagByTarget", \%TagByTarget);
255
#   #
-
 
256
   $knownSpecial{'GENERIC'} = 2;
-
 
257
#   foreach my $machtype ( keys %MachineTypeToClass ) {
262
    #DebugDumpData("TargetByTag", \%TargetByTag);
258
#       $knownSpecial{join('_','MACH', uc($machtype) )} = 2;
-
 
259
#       $knownSpecial{join('_','GENERIC', $MachineTypeToClass{$machtype} )} = 2;
-
 
260
#   }
-
 
261
}
263
}
262
 
264
 
263
#-------------------------------------------------------------------------------
265
#-------------------------------------------------------------------------------
264
# Function        : checkBuildAvailability
266
# Function        : getTargetsByTag 
265
#
-
 
266
# Description     : Check that a given target can be be built on the
-
 
267
#                   current machine type. Also indicate if it is a GENERIC
-
 
268
#                   target; one that can always be built.
-
 
269
#
267
#
270
# Inputs          : $target             - Name of target platform
268
# Description     : Fetch an array of build platforms that are tagged
271
#
269
#
-
 
270
# Inputs          : $tag    - Tag to process
272
#
271
#
273
# Returns         : 0                   - target cannot be built
272
# Returns         : An array of targets. May be empty
274
#                   1                   - target can be built, subject to build filter
-
 
275
#                   2                   - target can be built, is Generic           
-
 
276
#
273
#
277
sub checkBuildAvailability
-
 
278
{
-
 
279
    my ($target) = @_;
-
 
280
    Error("Internal: checkBuildAvailability. No argument specified") unless $target;
-
 
281
 
274
 
-
 
275
sub getTargetsByTag
-
 
276
{
-
 
277
    my ($tag) = @_;
-
 
278
    Error("Internal: getTargetsByTag. No tag specified") unless ($tag);
282
    InitData();
279
    InitData();
-
 
280
 
283
    if (exists $BuildAvailabilityData{$target})
281
    if (exists ($TargetByTag{uc($tag)}) )
284
    {
282
    {
285
        return $BuildAvailabilityData{$target} ;
283
        return @{$TargetByTag{uc($tag)}};
286
    }
284
    }
-
 
285
 
-
 
286
    my @empty;
287
    return 0;
287
    return @empty;
288
}
288
}
289
 
289
 
290
#-------------------------------------------------------------------------------
290
#-------------------------------------------------------------------------------
291
# Function        : checkKnownSpecial
291
# Function        : targetHasTag 
292
#
-
 
293
# Description     : Check that a given (special) target is known to JATS
-
 
294
#                   Used to suppress warnings about GENERIC targets not known
-
 
295
#                   to the current machine type.
-
 
296
#
292
#
297
# Inputs          : $target             - Name of target platform
293
# Description     : Determineif the named target has the specified tag
298
#
294
#
-
 
295
# Inputs          : $target
-
 
296
#                   $tag 
299
#
297
#
300
# Returns         : 0                   - target not known
298
# Returns         : Boolean
301
#                   1                   - target is known to JATS
-
 
302
#
299
#
303
sub checkKnownSpecial
300
sub targetHasTag
304
{
301
{
305
    my ($target) = @_;
302
    my ($target, $tag) = @_;
306
    Error("Internal: checkKnown. No argument specified") unless $target;
303
    Error("Internal: targetHasTag. No target specified") unless ($target);
-
 
304
    Error("Internal: targetHasTag. No tag specified") unless ($tag);
307
 
305
 
308
    InitData();
306
    InitData();
309
    if (exists $knownSpecial{$target})
307
    if (exists ($TagByTarget{$target}) && exists ($TagByTarget{$target}{$tag}))
310
    {
308
    {
311
        return $knownSpecial{$target} ;
309
        return 1;
312
    }
310
    }
313
    return 0;
311
    return 0;
314
}
312
}
315
 
313
 
316
#-------------------------------------------------------------------------------
-
 
317
# Function        : getNativeTargets 
-
 
318
#
-
 
319
# Description     : Fetch an array of build platforms that are native in the 
-
 
320
#                   current build .
-
 
321
#
-
 
322
#                   Native implies that programs compiled will run
-
 
323
#                   Used to create an ALIAS called NATIVE
-
 
324
#                   Used to simplify unit testing    
-
 
325
#
-
 
326
# Inputs          : 
-
 
327
#
-
 
328
# Returns         : 
-
 
329
#
-
 
330
sub getNativeTargets
-
 
331
{
-
 
332
    InitData();
-
 
333
    return @nativeTargets;
-
 
334
}
-
 
335
 
-
 
336
 
-
 
337
1;
314
1;
338
 
315