Subversion Repositories DevTools

Rev

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