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