Subversion Repositories DevTools

Rev

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