Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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