Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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