Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: perl; indent-width: 4; -*-
2
##############################################################################
6177 dpurdie 3
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
227 dpurdie 4
#
5
# File:         PLATFORM/unix
6
#
7
# Contents:     Generic UNIX platform definition
8
#               The definitions of
9
#                   HOST_KERNEL
10
#                   HOST_CPU
11
#                   HOST_PROD
12
#                   HOST_FAM
13
#               must be provided before this file is 'Required'
14
#               Suitable definitions will the added to the build system
15
#
16
#               NOTE: The platform config file MUST provide the definitions
17
#                     This is not a suitable place to make the decisions
18
#
19
##############################################################################
20
#
21
#use strict;
22
use warnings;
23
 
24
UnixInit();
25
 
26
sub UnixInit
27
{
28
    #
29
    #   Sanity test
30
    #   'Unix' is not a PLATFORM that should be directly invoked
31
    #   It should only be invoked by a another platform that defines the
32
    #   required valies.
33
    #
34
    Error ("Unix platform: HOST_KERNEL has not been defined") unless (defined($HOST_KERNEL));
35
    Error ("Unix platform: HOST_CPU has not been defined")    unless ($HOST_CPU);
36
    Error ("Unix platform: HOST_PROD has not been defined")   unless (defined ($HOST_PROD));
37
    Error ("Unix platform: HOST_FAM has not been defined")    unless (defined (HOST_FAM));
38
 
39
    #.. Target defines
40
    #
41
    PlatformDefine( "#################################################");
42
    PlatformDefine( "# Building a UNIX application" );
43
    PlatformDefine( "#" );
44
    PlatformDefine( "HOST_KERNEL    = $HOST_KERNEL" );
45
    PlatformDefine( "HOST_CPU       = $HOST_CPU" );
46
    PlatformDefine( "HOST_PROD      = $HOST_PROD" );
47
    PlatformDefine( "HOST_FAM       = $HOST_FAM" );
48
    PlatformDefine( "" );
49
 
50
    #.. Order of directory search
51
    #       CPU, PROD, then FAMILY ...
52
    #
53
    AddFlags( '*',          "-DHOST_CPU=$HOST_CPU" );
54
    AddFlags( '*',          "-DHOST_$HOST_CPU" );
55
    AddDir( '*',            "$HOST_CPU", '--Local', '--NoWarn' );
56
 
57
    if ( "$HOST_PROD" ne "" ) {
58
        AddFlags( '*',      "-DHOST_PROD=$HOST_PROD" );
59
        AddFlags( '*',      "-DHOST_$HOST_PROD" );
60
        AddDir( '*',        "$HOST_PROD", '--Local', '--NoWarn' );
61
    }        
62
 
63
    AddFlags( '*',  "-DHOST_FAM=$HOST_FAM" );
64
    if ( "$HOST_PROD" ne "$HOST_FAM" ) {
65
        if ( "$HOST_FAM" ne "" ) {
66
            AddFlags( '*',  "-DHOST_$HOST_FAM" );
67
            AddDir( '*',    "$HOST_FAM", '--Local', '--NoWarn' );
68
        }            
69
    }
70
}
71
 
72
1;