Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
###############################################################################
247 dpurdie 2
# Copyright (c) ERG Transit Systems. 1996-2008
227 dpurdie 3
#
4
# File:         PLATFORM/DEVLINUX.cfg
5
#
6
# Contents:     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
use strict;
16
use warnings;
17
 
18
package DEVLINUX_Build;
19
use JatsError;
20
use Storable qw(dclone);
21
 
22
#
23
#   Create a hash of GBE_MACHTYPEs for which the DEVLINUX platform is available
24
#   It won't just build on any old machine
25
#
26
#   Hash values are an array of:
27
#           Operating System
28
#           architecture
29
#
30
my %valid_machines = (
337 dpurdie 31
    'linux_i386'             => [ 'COBRA',
32
                                  'ARM9TDMI',
227 dpurdie 33
                                  'LINUX_EMU',
247 dpurdie 34
                                  'LINUX_ETX',
35
                                  'PPC_603E' ],
227 dpurdie 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 ("DEVLINUX 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
        DEVLINUX_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        : DEVLINUX_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 DEVLINUX_generic
98
{
99
    my ($pInfo, $target) = @_;
100
    Debug("DEVLINUX_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