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