Subversion Repositories DevTools

Rev

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

Rev 7309 Rev 7310
Line 31... Line 31...
31
#
31
#
32
#   An array of known Keywords and Aliases
32
#   An array of known Keywords and Aliases
33
#       Keywords should not be used for platform names
33
#       Keywords should not be used for platform names
34
#       Aliases are set up for the user
34
#       Aliases are set up for the user
35
# 
35
# 
36
our @BuildAliases = qw (NATIVE INSTRUMENT PKG_WIN PKG_RPM PKG_DEB SK );
36
our @BuildAliases = qw (NATIVE INSTRUMENT PKG_WIN PKG_RPM PKG_DEB SK);
37
our @BuildKeywords = ( qw (TOOLSET GENERIC GENERIC_MACHTYPE BASE_TARGET), @BuildAliases );
37
our @BuildKeywords = ( qw (TOOLSET GENERIC GENERIC_MACHTYPE BASE_TARGET), @BuildAliases );
38
 
38
 
39
#
39
#
-
 
40
#   An array of platform aliases that will be expanded into multiple platforms
-
 
41
#
-
 
42
our @BuildFamilies = qw (ANDROIDNDK DEVLINUX GENERICS LINUX LMOS LMOS_DEVLINUX MSWIN32 MSWIN64 SOLARIS WINCE SK);
-
 
43
 
-
 
44
#
40
#   The following structure is a hash of arrays
45
#   The following structure is a hash of arrays
41
#   The hash key is a supported machine type - one per machine
46
#   The hash key is a supported machine type - one per machine
42
#   The data is an array of supported PLATFORMS
47
#   The data is an array of supported PLATFORMS
43
#   Each platform may have a : seperated list of tags
48
#   Each platform may have a : seperated list of tags
44
#   Known tags include:
49
#   Known tags include:
45
#       TOOLSET - Sutable for building JATS tools
50
#       TOOLSET - Sutable for building JATS tools
46
#       NATIVE  - Can be expected to run on the build machine
51
#       NATIVE  - Can be expected to run on the build machine
47
#       KNOWN - Indicated platform is known to this machine type. Used to test existence 
52
#       KNOWN - Indicated platform is known to this machine type. Used to test existence 
48
#       GENERIC - Can be built on any machine
53
#       GENERIC - Can be built on any machine
-
 
54
#       GENERIC_MACHTYPE - Can be built on a specific machine type (Auto generated)
49
#       DEVLINUX - Part of the DEVLINUX alias
55
#       DEVLINUX - Part of the DEVLINUX alias
50
#       LINUX - Part of the LINUX alias 
56
#       LINUX - Part of the LINUX alias 
51
#       LMOS - Bastard Platforms from Hell
57
#       LMOS - Bastard Platforms from Hell
52
#       PKG_DEB - Install Debian Packages   
58
#       PKG_DEB - Install Debian Packages   
53
#       PKG_RPM - Install RPM Packages
59
#       PKG_RPM - Install RPM Packages
54
#       PKG_WIN - Install Windows Installers
60
#       PKG_WIN - Install Windows Installers
55
#       SK - The SK familty of platforms
61
#       SK - The SK familty of platforms
-
 
62
#       SOLARIS - Part of the SOLARIS alias
-
 
63
#       MACHTYPE - Machine Type to build on (Auto generated)
-
 
64
#       BASE_TARGET - Underling platform
56
#
65
#
57
our %BuildAvailability = (
66
our %BuildAvailability = (
58
    'linux_i386' => [
67
    'linux_i386' => [
59
        'ANDROIDARM:ANDROIDNDK',
68
        'ANDROIDARM:ANDROIDNDK',
60
        'ANDROIDMIPS:ANDROIDNDK',
69
        'ANDROIDMIPS:ANDROIDNDK',
Line 109... Line 118...
109
        'RHEL7:LINUX:TOOLSET:NATIVE:PKG_RPM',
118
        'RHEL7:LINUX:TOOLSET:NATIVE:PKG_RPM',
110
        'RHEL7_INSTRUMENT:NATIVE:LINUX:INSTRUMENT',
119
        'RHEL7_INSTRUMENT:NATIVE:LINUX:INSTRUMENT',
111
        ],
120
        ],
112
 
121
 
113
    'solaris10_sparc32' => [
122
    'solaris10_sparc32' => [
114
        'SOLARIS10_SPARC32:NATIVE:TOOLSET',
123
        'SOLARIS10_SPARC32:SOLARIS:NATIVE:TOOLSET',
115
        'SOLARIS10_SPARC64:NATIVE',
124
        'SOLARIS10_SPARC64:SOLARIS:NATIVE',
116
        'JAVA:NATIVE',
125
        'JAVA:NATIVE',
117
        ],
126
        ],
118
 
127
 
119
    'solaris10_x86' => [
128
    'solaris10_x86' => [
120
        'SOLARIS10_X86:NATIVE:TOOLSET',
129
        'SOLARIS10_X86:SOLARIS:NATIVE:TOOLSET',
121
        'SOLARIS10_X64:NATIVE',
130
        'SOLARIS10_X64:SOLARIS:NATIVE',
122
        'JAVA',
131
        'JAVA:NATIVE',
123
        ],
132
        ],
124
 
133
 
125
    'sparc' => [
134
    'sparc' => [
126
        'SOLARIS:NATIVE:TOOLSET:TARGET_CFG=SOLARIS8_SPARC32',
135
        'SOLARIS8_SPARC32:SOLARIS:NATIVE:TOOLSET',
127
        'SOLARIS_I386',
-
 
128
        'SOLARIS_SPARC',
-
 
129
        'JAVA:NATIVE',
136
        'JAVA:NATIVE',
130
        ],
137
        ],
131
 
138
 
132
    'win32' => [
139
    'win32' => [
133
        'ANDROID',
140
        'ANDROID',
Line 228... Line 235...
228
#
235
#
229
# Description     : Init data structures
236
# Description     : Init data structures
230
#                   Done once
237
#                   Done once
231
#
238
#
232
#                   Convert the $BuildAvailability entry array into a hash to 
239
#                   Convert the $BuildAvailability entry array into a hash to 
-
 
240
#                   simplify lookup. 
233
#                   simplify lookup. Add in the GENERIC target:
241
#                       Add in the GENERIC target
234
#                       GENERIC         - can be built on ANY machine
242
#                       Add in the GENERIC_MACHTYPE target
-
 
243
#                       Add in LMOS targets
235
#
244
#
236
# Inputs          : None
245
# Inputs          : None
237
#
246
#
238
# Returns         : Nothing
247
# Returns         : Nothing
239
#
248
#
Line 241... Line 250...
241
{
250
{
242
    #
251
    #
243
    #   Only do this work once
252
    #   Only do this work once
244
    #
253
    #
245
    return if exists $TagByTarget{'GENERIC'};
254
    return if exists $TagByTarget{'GENERIC'};
246
 
255
    
-
 
256
    #
-
 
257
    #   Process all machine types
-
 
258
    #       Processes myself first
-
 
259
    #       Process linux_x64 before linux_i386
-
 
260
    #
-
 
261
    Error("GBE_MACHTYPE has not been defined ") unless defined $::GBE_MACHTYPE;
247
    foreach my $machType ( qw(linux_x64  linux_i386 linux_el7_x64 solaris10_sparc32 solaris10_x86 sparc win32 ))
262
    foreach my $machType ( $::GBE_MACHTYPE, qw(linux_x64  linux_i386 linux_el7_x64 solaris10_sparc32 solaris10_x86 sparc win32 ))
248
    {
263
    {
249
 
-
 
250
        #
264
        #
251
        #   Validate build machine
265
        #   Validate build machine
252
        #
266
        #
253
        Error("GBE_MACHTYPE has not been defined ") unless defined $machType;
267
        Error("GBE_MACHTYPE has not been defined ") unless defined $machType;
254
        Error (__PACKAGE__ . " : Unknown build machine type: $machType")
268
        Error (__PACKAGE__ . " : Unknown build machine type: $machType")
Line 263... Line 277...
263
        #
277
        #
264
        #   Create Machine Type specific Generic
278
        #   Create Machine Type specific Generic
265
        #       GENERIC_XXXX:GENERIC_MACHTYPE:TOOLSET
279
        #       GENERIC_XXXX:GENERIC_MACHTYPE:TOOLSET
266
        #   
280
        #   
267
        my $genericMachTypes = 'GENERIC_' . uc ($machType);
281
        my $genericMachTypes = 'GENERIC_' . uc ($machType);
268
        push @{$BuildAvailability{$machType}}, join (':', $genericMachTypes, 'GENERIC_MACHTYPE', 'TOOLSET' );
282
        push @{$BuildAvailability{$machType}}, join (':', $genericMachTypes, 'GENERIC_MACHTYPE', 'TOOLSET', 'GENERICS' );
269
 
283
 
270
        foreach ( @{$BuildAvailability{$machType}}  )
284
        foreach ( @{$BuildAvailability{$machType}}  )
271
        {
285
        {
272
            my @data = split(':', $_ );
286
            my @data = split(':', $_ );
273
            my $target = shift @data;
287
            my $target = uc shift @data;
274
            my $hasLMOS;
288
            my $hasLMOS;
275
 
289
 
-
 
290
            #
-
 
291
            #   Add in MACHTYPE, only the first machine is processed
-
 
292
            #
276
            next if exists $TagByTarget{$target}{'MACHTYPE'};
293
            next if exists $TagByTarget{$target}{'MACHTYPE'};
277
            $TagByTarget{$target}{'MACHTYPE'} = $machType;
294
            $TagByTarget{$target}{'MACHTYPE'} = $machType;
-
 
295
 
-
 
296
            #
-
 
297
            #   Add items into data structures
-
 
298
            #   Allow for AAAAA=Value
-
 
299
            #
278
            foreach my $item ( @data )
300
            foreach my $item ( @data )
279
            {
301
            {
280
                if ($item eq 'LMOS') {
302
                if ($item eq 'LMOS') {
281
                    $hasLMOS = 1;
303
                    $hasLMOS = 1;
282
                    next;
304
                    next;
Line 288... Line 310...
288
                push @{$TargetByTag{uc($item)}}, $target;
310
                push @{$TargetByTag{uc($item)}}, $target;
289
            }
311
            }
290
 
312
 
291
            #
313
            #
292
            #   Generate LMOS platforms entries from the base platform entry
314
            #   Generate LMOS platforms entries from the base platform entry
-
 
315
            #   Similar to above, but it has LMOS prefix
293
            #
316
            #
294
            if ($hasLMOS)
317
            if ($hasLMOS)
295
            {
318
            {
296
                my $lmosTarget = 'LMOS_' . $target;
319
                my $lmosTarget = 'LMOS_' . $target;
297
                next if exists $TagByTarget{$lmosTarget}{'MACHTYPE'};
320
                next if exists $TagByTarget{$lmosTarget}{'MACHTYPE'};
298
                $TagByTarget{$lmosTarget}{'MACHTYPE'} = $machType;
321
                $TagByTarget{$lmosTarget}{'MACHTYPE'} = $machType;
-
 
322
 
299
                $TagByTarget{$lmosTarget}{'BASE_TARGET'} = $target;
323
                $TagByTarget{$lmosTarget}{'BASE_TARGET'} = $target;
300
                push @{$TargetByTag{uc('LMOS')}}, $lmosTarget;
324
                push @{$TargetByTag{uc('LMOS')}}, $lmosTarget;
-
 
325
 
301
                foreach my $item ( @data )
326
                foreach my $item ( @data )
302
                {
327
                {
303
                    next if ($item eq 'LMOS');
328
                    next if ($item eq 'LMOS');
304
                    ($item, my $value) = split (/=/, $item,2);
329
                    ($item, my $value) = split (/=/, $item,2);
305
                    $value = 1 unless defined $value;
330
                    $value = 1 unless defined $value;
Line 354... Line 379...
354
#                   Tags of the form NAME=VALUE wull return 'VALUE'
379
#                   Tags of the form NAME=VALUE wull return 'VALUE'
355
#
380
#
356
sub targetHasTag
381
sub targetHasTag
357
{
382
{
358
    my ($target, $tag) = @_;
383
    my ($target, $tag) = @_;
-
 
384
    my $value = 0;
359
    Error("Internal: targetHasTag. No target specified") unless ($target);
385
    Error("Internal: targetHasTag. No target specified") unless ($target);
360
    Error("Internal: targetHasTag. No tag specified") unless ($tag);
386
    Error("Internal: targetHasTag. No tag specified") unless ($tag);
361
 
387
 
362
    InitData();
388
    InitData();
-
 
389
    $target = uc ($target);
363
    if (exists ($TagByTarget{$target}) && exists ($TagByTarget{$target}{$tag}))
390
    if (exists ($TagByTarget{$target}) && exists ($TagByTarget{$target}{$tag}))
364
    {
391
    {
365
        return $TagByTarget{$target}{$tag};
392
        $value = $TagByTarget{$target}{$tag};
366
    }
393
    }
-
 
394
    Debug3("targetHasTag: @_ -> $value");
367
    return 0;
395
    return $value;
368
}
396
}
369
 
397
 
370
1;
398
1;
371
 
399