Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
###############################################################################
2
# Copyright (c) ERG Transit Systems. 1996-2006
3
#
4
# File:         PLATFORM/LINUX.cfg
5
#
4814 dpurdie 6
# Contents:     LINUX Build support
227 dpurdie 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
 
16
use strict;
17
use warnings;
18
 
19
package LINUX_Build;
20
use JatsError;
4969 dpurdie 21
use Storable qw(dclone);
227 dpurdie 22
 
23
#
24
#   Create a hash of GBE_MACHTYPEs for which the LINUX platform is available
4969 dpurdie 25
#   It won't just build on any old machine
227 dpurdie 26
#
27
#   Hash values are an array of:
28
#           Operating System
29
#           architecture
30
#
31
my %valid_machines = (
4969 dpurdie 32
    'linux_i386'             => [ 'LINUX_I386' ],                   # Current compiler on 32 bit linux
5035 dpurdie 33
    'linux_x64'              => [ 'UBUNTU14',                       # Current compiler on 64 bit linux
4814 dpurdie 34
                                  'UBUNTU14_INSTRUMENT' ],    
227 dpurdie 35
);
36
 
37
#-------------------------------------------------------------------------------
38
# Function        : new_platform
39
#
40
# Description     : Called when a new platform is being created
41
#                   The function can extend the build information
42
#
43
#                   The 'LINUX' platform will be converted into a 'suitable'
44
#                   platform for the current machine.
45
#
46
# Inputs          : $pInfo          - Reference to the platform build info hash
47
#
48
# Returns         : Nothing yet
49
#
50
 
51
sub new_platform
52
{
53
    my $class = shift;              # Not really a class, but its called like a class
54
    my $pInfo  = shift;
55
 
56
    #
57
    #   Ignore this platform if there is no way that it can be built on the
58
    #   current machine.
59
    #
60
    my $entry = $valid_machines{$::GBE_MACHTYPE};
61
    unless ( $entry )
62
    {
63
        Verbose ("LINUX will not build on this machine type: $::GBE_MACHTYPE");
64
        $pInfo->{NOT_AVAILABLE} = 1;
65
        return;
66
    }
67
 
68
    #
4969 dpurdie 69
    #   Instantiate all targets
227 dpurdie 70
    #
4969 dpurdie 71
    foreach my $target ( @$entry )
72
    {
73
        LINUX_generic(  dclone($pInfo), $target );
74
    }
227 dpurdie 75
 
76
    #
4969 dpurdie 77
    #   All done
78
    #   Mark the original entry as a TEMPLATE so that it won't be added
79
    #   We have added cloned copies of it
227 dpurdie 80
    #
4969 dpurdie 81
    $pInfo->{TEMPLATE} = 1;
227 dpurdie 82
}
83
 
84
#-------------------------------------------------------------------------------
4969 dpurdie 85
# Function        : LINUX_generic
227 dpurdie 86
#
4969 dpurdie 87
# Description     : Take a clone of the buildinfo structure and specialise it
88
#                   for the required target
227 dpurdie 89
#
4969 dpurdie 90
# Inputs          : $pInfo       - A clone of the buildinfo data
91
#                   $target      - Name of the target platform
227 dpurdie 92
#
4969 dpurdie 93
# Returns         : Nothing
94
#                   The buildinfo MUST be added to the build system
227 dpurdie 95
#
4969 dpurdie 96
sub LINUX_generic
227 dpurdie 97
{
4969 dpurdie 98
    my ($pInfo, $target) = @_;
99
    Debug("DEVLINUX_generic: $target");
227 dpurdie 100
 
101
    #
4969 dpurdie 102
    #   Request that a simple BuildAlias be created for this platform
103
    #   Use the original name of the TARGET
227 dpurdie 104
    #
4969 dpurdie 105
    $pInfo->{ALIAS} = $pInfo->{TARGET};
227 dpurdie 106
 
4969 dpurdie 107
#    #
108
#    #   Specify the hardware family
109
#    #   Will be used to create an ALIAS
110
#    #
111
#    $pInfo->{HARDWARE} = uc($arch);
112
 
227 dpurdie 113
    #
4969 dpurdie 114
    #   Alter the 'TARGET' name
115
    #   This is allowed (expected)
227 dpurdie 116
    #
4969 dpurdie 117
    $pInfo->{TARGET} = uc($target);
227 dpurdie 118
 
119
    #
4969 dpurdie 120
    #   Register this 'new' buildinfo entry with the build system
227 dpurdie 121
    #
4969 dpurdie 122
    ::AddBuildPlatformEntry( $pInfo );
123
}
227 dpurdie 124
 
125
1;
126