Subversion Repositories DevTools

Rev

Rev 4309 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4309 dpurdie 1
###############################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
3
#
4
# File:         PLATFORM/MSWIN32.cfg
5
#
6
# Contents:     MSWIN32 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 MSWIN32_Build;
19
use JatsError;
20
use Storable qw(dclone);
21
 
22
#
23
#   Create a hash of GBE_MACHTYPEs for which the MSWIN32 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 = (
31
    'win32'     => [ 'WIN32',
32
                     'VS2005',
33
                     'VS2012',
34
                     ],
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 'MSWIN32' 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 ("MSWIN32 will not build on this machine type: $::GBE_MACHTYPE");
64
        $pInfo->{NOT_AVAILABLE} = 1;
65
        return;
66
    }
67
 
68
    #
69
    #   Instantiate all targets
70
    #
71
    foreach my $target ( @$entry )
72
    {
73
        MSWIN32_generic(  dclone($pInfo), $target );
74
    }
75
 
76
    #
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
80
    #
81
    $pInfo->{TEMPLATE} = 1;
82
}
83
 
84
#-------------------------------------------------------------------------------
85
# Function        : MSWIN32_generic
86
#
87
# Description     : Take a clone of the buildinfo structure and specialise it
88
#                   for the required target
89
#
90
# Inputs          : $pInfo       - A clone of the buildinfo data
91
#                   $target      - Name of the target platform
92
#
93
# Returns         : Nothing
94
#                   The buildinfo MUST be added to the build system
95
#
96
sub MSWIN32_generic
97
{
98
    my ($pInfo, $target) = @_;
99
    Debug("MSWIN32_generic: $target");
100
 
101
    #
102
    #   Request that a simple BuildAlias be created for this platform
103
    #   Use the original name of the TARGET
104
    #
105
    $pInfo->{ALIAS} = $pInfo->{TARGET};
106
 
107
#    #
108
#    #   Specify the hardware family
109
#    #   Will be used to create an ALIAS
110
#    #
111
#    $pInfo->{HARDWARE} = uc($arch);
112
 
113
    #
114
    #   Alter the 'TARGET' name
115
    #   This is allowed (expected)
116
    #
117
    $pInfo->{TARGET} = uc($target);
118
 
119
    #
120
    #   Register this 'new' buildinfo entry with the build system
121
    #
122
    ::AddBuildPlatformEntry( $pInfo );
123
}
124
 
125
1;
126