Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
###############################################################################
5709 dpurdie 2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
227 dpurdie 3
#
4
# File:         PLATFORM/LMOS.cfg
5
#
6
# Contents:     LMOS Build support
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
use strict;
16
use warnings;
17
 
18
package LMOS_Build;
19
use JatsError;
20
use Storable qw(dclone);
21
 
22
#
23
#   Create a hash of GBE_MACHTYPEs for which the LMOS platform is available
24
#   It won't just build on any old machine
25
#
26
#   Hash values are an array of platforms to replace the given platform
27
#   Note: The process is not recursive, thus the named plaforms MUST be
28
#         real platforms, not one that will expand into more platforms
29
#
30
my %valid_machines = (
31
    'linux_i386'             => [ 'LMOS_ARM9TDMI',
271 dpurdie 32
                                  'LMOS_LINUX_ETX',
2772 dpurdie 33
                                  'LMOS_PPC_603E',
34
                                  'LMOS_COBRA',
3987 dpurdie 35
                                  'LMOS_UBUNTU12',
2772 dpurdie 36
                                  ],
227 dpurdie 37
    'win32'                  => [ 'LMOS_WIN32' ],
38
);
39
 
40
#-------------------------------------------------------------------------------
41
# Function        : new_platform
42
#
43
# Description     : Called when a new platform is being created
44
#                   The function can extend the build information
45
#
46
#                   The 'LINUX' platform will be converted into a 'suitable'
47
#                   platform for the current machine.
48
#
49
# Inputs          : $pInfo          - Reference to the platform build info hash
50
#
51
# Returns         : Nothing yet
52
#
53
 
54
sub new_platform
55
{
56
    my $class = shift;              # Not really a class, but its called like a class
57
    my $pInfo  = shift;
58
 
59
    #
60
    #   Ignore this platform if there is no way that it can be built on the
61
    #   current machine.
62
    #
63
    my $entry = $valid_machines{$::GBE_MACHTYPE};
64
    unless ( $entry )
65
    {
66
        Verbose ("LMOS will not build on this machine type: $::GBE_MACHTYPE");
67
        $pInfo->{NOT_AVAILABLE} = 1;
68
        return;
69
    }
70
 
71
    #
72
    #   Instantiate all targets
73
    #
74
    foreach my $target ( @$entry )
75
    {
76
        LMOS_generic(  dclone($pInfo), $target );
77
    }
78
 
79
    #
80
    #   All done
81
    #   Mark the original entry as a TEMPLATE so that it won't be added
82
    #   We have added cloned copies of it
83
    #
84
    $pInfo->{TEMPLATE} = 1;
85
}
86
 
87
#-------------------------------------------------------------------------------
88
# Function        : LMOS_generic
89
#
90
# Description     : Take a clone of the buildinfo structure and specialise it
91
#                   for the required target
92
#
93
# Inputs          : $pInfo       - A clone of the buildinfo data
94
#                   $target      - Name of the target platform
95
#
96
# Returns         : Nothing
97
#                   The buildinfo MUST be added to the build system
98
#
99
sub LMOS_generic
100
{
101
    my ($pInfo, $target) = @_;
102
    Debug("LMOS_generic: $target");
103
 
104
    #
105
    #   Request that a simple BuildAlias be created for this platform
106
    #   Use the original name of the TARGET
107
    #
108
    $pInfo->{ALIAS} = $pInfo->{TARGET};
109
 
110
#    #
111
#    #   Specify the hardware family
112
#    #   Will be used to create an ALIAS
113
#    #
114
#    $pInfo->{HARDWARE} = uc($arch);
115
 
116
    #
117
    #   Alter the 'TARGET' name
118
    #   This is allowed (expected)
119
    #
120
    $pInfo->{TARGET} = uc($target);
121
 
122
    #
123
    #   Register this 'new' buildinfo entry with the build system
124
    #
125
    ::AddBuildPlatformEntry( $pInfo );
126
}
127
 
128
1;
129