Subversion Repositories DevTools

Rev

Rev 4324 | Rev 4728 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4324 Rev 4551
Line 154... Line 154...
154
        'WIN32',
154
        'WIN32',
155
        ],
155
        ],
156
);
156
);
157
 
157
 
158
#
158
#
-
 
159
#   Convert Machine Type to Machine Class
-
 
160
#       These match the Release Manager and BuildTool definitions
-
 
161
#       Used for GENERIC Processing
-
 
162
#
-
 
163
my %MachineTypeToClass = (
-
 
164
      linux_i386        => 'LINUX',
-
 
165
      linux_x64         => 'LINUX',
-
 
166
      solaris10_sparc32 => 'SOLARIS',
-
 
167
      solaris10_x86     => 'SOLARIS',
-
 
168
      sparc             => 'SOLARIS',
-
 
169
      win32             => 'WIN32',
-
 
170
);
-
 
171
#
159
#   The above data will be reorganised and placed into the following
172
#   The above data will be reorganised and placed into the following
160
#   hash. This simplifies the data definition and lookup
173
#   hash. This simplifies the data definition and lookup
161
#
174
#
162
my %BuildAvailabilityData;
175
my %BuildAvailabilityData;
163
 
176
 
-
 
177
#   A hash of 'special' knon targets
-
 
178
#   Simply used to reduce JATS warnins about some psuedo targets
-
 
179
my %knownSpecial;
-
 
180
 
164
#-------------------------------------------------------------------------------
181
#-------------------------------------------------------------------------------
165
# Function        : InitData
182
# Function        : InitData
166
#
183
#
167
# Description     : Init data structures
184
# Description     : Init data structures
168
#                   Done once
185
#                   Done once
169
#
186
#
170
#                   Convert an array into a hash to simplify lookup
187
#                   Convert the $BuildAvailability entry array into a hash to 
-
 
188
#                   simplify lookup. Add in thr three types of GENERIC target:
-
 
189
#                       GENERIC         - can be built on ANY machine
-
 
190
#                       GENERIC_XXX     - can be built on machine of class XXX
-
 
191
#                       MACH_YYY        - can be built on MACHTYPE YYY
171
#
192
#
172
# Inputs          : None
193
# Inputs          : None
173
#
194
#
174
# Returns         : Nothing
195
# Returns         : Nothing
175
#
196
#
Line 185... Line 206...
185
    #
206
    #
186
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
207
    Error (__PACKAGE__ . " : Unknown build machine type: $::GBE_MACHTYPE")
187
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
208
        unless ( exists $BuildAvailability{$::GBE_MACHTYPE} );
188
 
209
 
189
    #
210
    #
190
    #   Convert the array into a hash to spped up access later
211
    #   Convert the array into a hash to speed up access later
191
    #
212
    #
192
    $BuildAvailabilityData{'GENERIC'} = 1;
213
    $BuildAvailabilityData{'GENERIC'} = 2;
193
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
214
    foreach ( @{$BuildAvailability{$::GBE_MACHTYPE}}  )
194
    {
215
    {
195
        $BuildAvailabilityData{$_} = 1;
216
        $BuildAvailabilityData{$_} = 1;
196
    }
217
    }
-
 
218
 
-
 
219
#   #
-
 
220
#   #   Insert GENERIC_<MachClass>
-
 
221
#   #
-
 
222
#   Error (__PACKAGE__ . " : Unknown build machine class: $::GBE_MACHTYPE")
-
 
223
#       unless ( exists $MachineTypeToClass{$::GBE_MACHTYPE} );
-
 
224
#   $BuildAvailabilityData{join('_','GENERIC', $MachineTypeToClass{$::GBE_MACHTYPE} )} = 2;
-
 
225
#
-
 
226
#   #
-
 
227
#   #   Insert MachType definition
-
 
228
#   #   These are of the form MACH_xxxx
-
 
229
#   #
-
 
230
#   $BuildAvailabilityData{join('_','MACH', uc($::GBE_MACHTYPE) )} = 2;
-
 
231
#
-
 
232
#   #
-
 
233
#   #   Create a hash of special 'known' targets
-
 
234
#   #
-
 
235
   $knownSpecial{'GENERIC'} = 2;
-
 
236
#   foreach my $machtype ( keys %MachineTypeToClass ) {
-
 
237
#       $knownSpecial{join('_','MACH', uc($machtype) )} = 2;
-
 
238
#       $knownSpecial{join('_','GENERIC', $MachineTypeToClass{$machtype} )} = 2;
-
 
239
#   }
197
}
240
}
198
 
241
 
199
#-------------------------------------------------------------------------------
242
#-------------------------------------------------------------------------------
200
# Function        : checkBuildAvailability
243
# Function        : checkBuildAvailability
201
#
244
#
202
# Description     : Check that a given target can be be built on the
245
# Description     : Check that a given target can be be built on the
-
 
246
#                   current machine type. Also indicate if it is a GENERIC
203
#                   current machine type
247
#                   target; one that can always be built.
204
#
248
#
205
# Inputs          : $target             - Name of target platform
249
# Inputs          : $target             - Name of target platform
206
#
250
#
207
#
251
#
208
# Returns         : True if Target can be built on current machine
252
# Returns         : 0                   - target cannot be built
-
 
253
#                   1                   - target can be built, subject to build filter
-
 
254
#                   2                   - target can be built, is Generic           
209
#
255
#
210
sub checkBuildAvailability
256
sub checkBuildAvailability
211
{
257
{
212
    my ($target) = @_;
258
    my ($target) = @_;
-
 
259
    Error("Internal: checkBuildAvailability. No argument specified") unless $target;
-
 
260
 
213
    InitData();
261
    InitData();
214
    return exists $BuildAvailabilityData{$target};
262
    if (exists $BuildAvailabilityData{$target})
-
 
263
    {
-
 
264
        return $BuildAvailabilityData{$target} ;
-
 
265
    }
-
 
266
    return 0;
215
}
267
}
216
 
268
 
-
 
269
#-------------------------------------------------------------------------------
-
 
270
# Function        : checkKnownSpecial
-
 
271
#
-
 
272
# Description     : Check that a given (special) target is known to JATS
-
 
273
#                   Used to suppress warnings about GENERIC targets not known
-
 
274
#                   to the current machine type.
-
 
275
#
-
 
276
# Inputs          : $target             - Name of target platform
-
 
277
#
-
 
278
#
-
 
279
# Returns         : 0                   - target not known
-
 
280
#                   1                   - target is known to JATS
-
 
281
#
-
 
282
sub checkKnownSpecial
-
 
283
{
-
 
284
    my ($target) = @_;
-
 
285
    Error("Internal: checkKnown. No argument specified") unless $target;
-
 
286
 
-
 
287
    InitData();
-
 
288
    if (exists $knownSpecial{$target})
-
 
289
    {
-
 
290
        return $knownSpecial{$target} ;
-
 
291
    }
-
 
292
    return 0;
-
 
293
}
-
 
294
 
-
 
295
 
217
1;
296
1;
218
 
297