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