Subversion Repositories DevTools

Rev

Go to most recent revision | 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.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',
32
                                  'LMOS_LINUX_EMU',
271 dpurdie 33
                                  'LMOS_LINUX_ETX',
34
                                  'LMOS_PPC_603E' ],
227 dpurdie 35
    'win32'                  => [ 'LMOS_WIN32' ],
36
);
37
 
38
#-------------------------------------------------------------------------------
39
# Function        : new_platform
40
#
41
# Description     : Called when a new platform is being created
42
#                   The function can extend the build information
43
#
44
#                   The 'LINUX' platform will be converted into a 'suitable'
45
#                   platform for the current machine.
46
#
47
# Inputs          : $pInfo          - Reference to the platform build info hash
48
#
49
# Returns         : Nothing yet
50
#
51
 
52
sub new_platform
53
{
54
    my $class = shift;              # Not really a class, but its called like a class
55
    my $pInfo  = shift;
56
 
57
    #
58
    #   Ignore this platform if there is no way that it can be built on the
59
    #   current machine.
60
    #
61
    my $entry = $valid_machines{$::GBE_MACHTYPE};
62
    unless ( $entry )
63
    {
64
        Verbose ("LMOS will not build on this machine type: $::GBE_MACHTYPE");
65
        $pInfo->{NOT_AVAILABLE} = 1;
66
        return;
67
    }
68
 
69
    #
70
    #   Instantiate all targets
71
    #
72
    foreach my $target ( @$entry )
73
    {
74
        LMOS_generic(  dclone($pInfo), $target );
75
    }
76
 
77
    #
78
    #   All done
79
    #   Mark the original entry as a TEMPLATE so that it won't be added
80
    #   We have added cloned copies of it
81
    #
82
    $pInfo->{TEMPLATE} = 1;
83
}
84
 
85
#-------------------------------------------------------------------------------
86
# Function        : LMOS_generic
87
#
88
# Description     : Take a clone of the buildinfo structure and specialise it
89
#                   for the required target
90
#
91
# Inputs          : $pInfo       - A clone of the buildinfo data
92
#                   $target      - Name of the target platform
93
#
94
# Returns         : Nothing
95
#                   The buildinfo MUST be added to the build system
96
#
97
sub LMOS_generic
98
{
99
    my ($pInfo, $target) = @_;
100
    Debug("LMOS_generic: $target");
101
 
102
    #
103
    #   Request that a simple BuildAlias be created for this platform
104
    #   Use the original name of the TARGET
105
    #
106
    $pInfo->{ALIAS} = $pInfo->{TARGET};
107
 
108
#    #
109
#    #   Specify the hardware family
110
#    #   Will be used to create an ALIAS
111
#    #
112
#    $pInfo->{HARDWARE} = uc($arch);
113
 
114
    #
115
    #   Alter the 'TARGET' name
116
    #   This is allowed (expected)
117
    #
118
    $pInfo->{TARGET} = uc($target);
119
 
120
    #
121
    #   Register this 'new' buildinfo entry with the build system
122
    #
123
    ::AddBuildPlatformEntry( $pInfo );
124
}
125
 
126
1;
127