Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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