Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
###############################################################################
7300 dpurdie 2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
227 dpurdie 3
#
4
# File:         PLATFORM/LINUX.cfg
5
#
4814 dpurdie 6
# Contents:     LINUX Build support
227 dpurdie 7
#
8
#               This package is used during the processing of the build.pl file
9
#               Values provided by this package are used to extend the Platform
10
#               information as platforms are being created. This provides a
11
#               powerful set of mechanism to extend the entire JATS toolset
12
#
13
#
14
###############################################################################
15
 
16
use strict;
17
use warnings;
18
 
19
package LINUX_Build;
20
use JatsError;
4969 dpurdie 21
use Storable qw(dclone);
227 dpurdie 22
 
23
#-------------------------------------------------------------------------------
24
# Function        : new_platform
25
#
26
# Description     : Called when a new platform is being created
27
#                   The function can extend the build information
28
#
29
#                   The 'LINUX' platform will be converted into a 'suitable'
30
#                   platform for the current machine.
31
#
32
# Inputs          : $pInfo          - Reference to the platform build info hash
33
#
34
# Returns         : Nothing yet
35
#
36
 
37
sub new_platform
38
{
39
    my $class = shift;              # Not really a class, but its called like a class
40
    my $pInfo  = shift;
41
 
42
    #
6133 dpurdie 43
    #   Get the list of targets that have been tagged as LINUX
44
    #   
45
    my @targets = PlatformConfig::getTargetsByTag('LINUX');
46
 
47
    #
227 dpurdie 48
    #   Ignore this platform if there is no way that it can be built on the
49
    #   current machine.
50
    #
6133 dpurdie 51
    unless ( @targets )
227 dpurdie 52
    {
53
        Verbose ("LINUX will not build on this machine type: $::GBE_MACHTYPE");
54
        $pInfo->{NOT_AVAILABLE} = 1;
55
        return;
56
    }
57
 
58
    #
4969 dpurdie 59
    #   Instantiate all targets
227 dpurdie 60
    #
6133 dpurdie 61
    foreach my $target ( @targets )
4969 dpurdie 62
    {
63
        LINUX_generic(  dclone($pInfo), $target );
64
    }
227 dpurdie 65
 
66
    #
4969 dpurdie 67
    #   All done
68
    #   Mark the original entry as a TEMPLATE so that it won't be added
69
    #   We have added cloned copies of it
227 dpurdie 70
    #
4969 dpurdie 71
    $pInfo->{TEMPLATE} = 1;
227 dpurdie 72
}
73
 
74
#-------------------------------------------------------------------------------
4969 dpurdie 75
# Function        : LINUX_generic
227 dpurdie 76
#
4969 dpurdie 77
# Description     : Take a clone of the buildinfo structure and specialise it
78
#                   for the required target
227 dpurdie 79
#
4969 dpurdie 80
# Inputs          : $pInfo       - A clone of the buildinfo data
81
#                   $target      - Name of the target platform
227 dpurdie 82
#
4969 dpurdie 83
# Returns         : Nothing
84
#                   The buildinfo MUST be added to the build system
227 dpurdie 85
#
4969 dpurdie 86
sub LINUX_generic
227 dpurdie 87
{
4969 dpurdie 88
    my ($pInfo, $target) = @_;
89
    Debug("DEVLINUX_generic: $target");
227 dpurdie 90
 
91
    #
4969 dpurdie 92
    #   Request that a simple BuildAlias be created for this platform
93
    #   Use the original name of the TARGET
227 dpurdie 94
    #
4969 dpurdie 95
    $pInfo->{ALIAS} = $pInfo->{TARGET};
227 dpurdie 96
 
4969 dpurdie 97
#    #
98
#    #   Specify the hardware family
99
#    #   Will be used to create an ALIAS
100
#    #
101
#    $pInfo->{HARDWARE} = uc($arch);
102
 
227 dpurdie 103
    #
4969 dpurdie 104
    #   Alter the 'TARGET' name
105
    #   This is allowed (expected)
227 dpurdie 106
    #
4969 dpurdie 107
    $pInfo->{TARGET} = uc($target);
227 dpurdie 108
 
109
    #
4969 dpurdie 110
    #   Register this 'new' buildinfo entry with the build system
227 dpurdie 111
    #
4969 dpurdie 112
    ::AddBuildPlatformEntry( $pInfo );
113
}
227 dpurdie 114
 
115
1;
116