Subversion Repositories DevTools

Rev

Go to most recent revision | 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/SOLARIS.cfg
5
#
6
# Contents:     SOLARIS 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
# Version   Who      Date       Description
15
#           DDP      01-Aug-06  Created
16
###############################################################################
17
 
18
use strict;
19
use warnings;
20
 
21
package SOLARIS_Build;
22
use JatsError;
23
use Storable qw(dclone);
24
 
25
#
26
#   Create a hash of GBE_MACHTYPEs for which the SOLARIS platform is available
27
#   It won't just build on any only machine
28
#
29
#   Hash values are an array of:
30
#           Operating System
31
#           architecture
32
#
33
my %valid_machines = (
34
    'sparc'             => [ 'SOLARIS8' , 'sparc' ],
35
    'solaris10_sparc32' => [ 'SOLARIS10', 'sparc' ],
36
    'solaris10_sparc64' => [ 'SOLARIS10', 'sparc' ],
37
    'solaris10_x86'     => [ 'SOLARIS10', 'amd' ],
38
    'solaris10_x64'     => [ 'SOLARIS10', 'amd' ],
39
);
40
 
41
my %arch_to_name = (
42
    'sparc' => { '32' => 'sparc32', '64' => 'sparc64' },
43
    'amd'   => { '32' => 'x86'    , '64' => 'x64' },
44
);
45
 
46
#-------------------------------------------------------------------------------
47
# Function        : new_platform
48
#
49
# Description     : Called when a new platform is being created
50
#                   The function can extend the build information
51
#
52
#                   The 'SOLARIS' platform will be converted into a 'suitable'
53
#                   platform for the current machine.
54
#
55
#                   There a few legacy issues to contend with.
56
#
57
# Inputs          : $pInfo          - Reference to the platform build info hash
58
#
59
# Returns         : Nothing yet
60
#
61
 
62
sub new_platform
63
{
64
    my $class = shift;              # Not really a class, but its called like a class
65
    my $pInfo  = shift;
66
 
67
    #
68
    #   Ignore this platform if there is no way that it can be built on the
69
    #   current machine.
70
    #
71
    my $entry = $valid_machines{$::GBE_MACHTYPE};
72
    unless ( $entry )
73
    {
74
        Verbose ("SOLARIS will not build on this machine type: $::GBE_MACHTYPE");
75
        $pInfo->{NOT_AVAILABLE} = 1;
76
        return;
77
    }
78
 
79
    #-------------------------------------------------------------------------------
80
    #
81
    #   Determine the type of system we are dealing with the GBE_MACHTYPE
82
    #   is the only real way of doing this
83
    #
84
    if ( $::GBE_MACHTYPE eq 'sparc' )
85
    {
86
        #
317 dpurdie 87
        #   Legacy target.
88
        #   Really SOLARIS8_SPARC32, but it has been configured
227 dpurdie 89
        #   as SOLARIS. This, unfortunately, must continue.
90
        #
91
        $pInfo->{TARGET} = 'SOLARIS';
92
 
93
        #
317 dpurdie 94
        #   Specify the Platform config file that should be used for the
95
        #   remainder of the configuration information.
227 dpurdie 96
        #
317 dpurdie 97
        $pInfo->{TARGET_CFG} = 'SOLARIS8_SPARC32';
227 dpurdie 98
        return;
99
    }
100
 
101
    #
102
    #   Not building for the legacy :)
103
    #   Generate a 32-bit and a 64-bit build target
104
    #
105
 
106
    my $os   = $entry->[0];
107
    my $arch = $entry->[1];
108
 
109
    SOLARIS_generic(  dclone($pInfo), $os, $arch, '32' );
110
    SOLARIS_generic(  dclone($pInfo), $os, $arch, '64' );
111
 
112
    #
113
    #   All done
114
    #   Mark the original entry as a TEMPLATE so that it won't be added
115
    #   We have cloned two copies of SOLARIS
116
    #
117
    $pInfo->{TEMPLATE} = 1;
118
}
119
 
120
#-------------------------------------------------------------------------------
121
# Function        : SOLARIS_generic
122
#
123
# Description     : Take a clone of the buildinfo structure and specialise it
124
#                   for either a 32-bit or a 64-bit build target
125
#
126
# Inputs          : $pInfo       - A clone of the buildinfo data
127
#                   $os         - Current OS
128
#                   $arch       - Current architecture
129
#                   $size       - Length required
130
#
131
# Returns         : Nothing
132
#                   The buildinfo MUST be added to the build system
133
#
134
sub SOLARIS_generic
135
{
136
    my ($pInfo, $os, $arch, $size) = @_;
137
    Debug("SOLARIS_generic: $os, $arch, $size");
138
 
139
    #
140
    #   Request that a simple BuildAlias be created for this platform
141
    #   Use the original name of the TARGET
142
    #
143
    $pInfo->{ALIAS} = $pInfo->{TARGET};
144
 
145
    #
146
    #   Specify the hardware family
147
    #   Will be used to create an ALIAS
148
    #
149
    $pInfo->{HARDWARE} = uc($arch);
150
 
151
    #
152
    #   Alter the 'TARGET' name
153
    #   This is allowed (expected)
154
    #
155
    my $name = $arch_to_name{$arch}{$size};
156
    Error ("Bad table: %arch_to_name") unless ( $name );
157
    $pInfo->{TARGET} = uc("${os}_${name}");
158
 
159
    #
160
    #   Register this 'new' buildinfo entry with the build system
161
    #
162
    ::AddBuildPlatformEntry( $pInfo );
163
}
164
1;
165