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