Subversion Repositories DevTools

Rev

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

Rev 343 Rev 345
Line 7793... Line 7793...
7793
#-------------------------------------------------------------------------------
7793
#-------------------------------------------------------------------------------
7794
# Function        : ActiveProject
7794
# Function        : ActiveProject
7795
#
7795
#
7796
# Description     : Determine if the specified project is currenly 'active'
7796
# Description     : Determine if the specified project is currenly 'active'
7797
#
7797
#
7798
# Inputs          : A list of projects. The projects may be comma seperated
7798
# Inputs          : $project            - one or more project names separated
-
 
7799
#                                         by either a comma or a colon
7799
#
7800
#
7800
# Returns         : TRUE    if the project is active
7801
# Returns         : TRUE    if the project is active
7801
#
7802
#
7802
sub ActiveProject
7803
sub ActiveProject
7803
{
7804
{
7804
    my ($project) = @_;
7805
    my ($project) = @_;
7805
    foreach (  split( '\s*,\s*', $project ) )
7806
    foreach (  split( '\s*[:,]\s*', $project ) )
7806
    {
7807
    {
7807
        return 1
7808
        return 1
7808
            if ( $_ eq $::ScmBuildProject );
7809
            if ( $_ eq $::ScmBuildProject );
7809
    }
7810
    }
7810
    return 0;
7811
    return 0;
7811
}
7812
}
7812
 
7813
 
-
 
7814
#-------------------------------------------------------------------------------
-
 
7815
# Function        : ActiveDefine
-
 
7816
#
-
 
7817
# Description     : Determine if the specified definition is currenly 'active'
-
 
7818
#
-
 
7819
# Inputs          : $defs               - one or more variable names separated
-
 
7820
#                                         by either a comma or a colon
-
 
7821
#
-
 
7822
# Returns         : TRUE    if any of the definitions are known
-
 
7823
#
-
 
7824
sub ActiveDefine
-
 
7825
{
-
 
7826
    my ($defs) = @_;
-
 
7827
    no strict 'refs';
-
 
7828
    foreach (  split( '\s*[:,]\s*', $defs ) )
-
 
7829
    {
-
 
7830
        return 1
-
 
7831
            if ( defined( $$_ ) || defined( @$_ ) );
-
 
7832
    }
-
 
7833
    use strict 'refs';
-
 
7834
    return 0;
-
 
7835
}
-
 
7836
 
-
 
7837
#-------------------------------------------------------------------------------
-
 
7838
# Function        : ActiveMachType
-
 
7839
#
-
 
7840
# Description     : Determine if the specified MachType is currenly 'active'
-
 
7841
#
-
 
7842
# Inputs          : $mtype              - one or more machine names separated
-
 
7843
#                                         by either a comma or a colon
-
 
7844
#
-
 
7845
# Returns         : TRUE    if any of the current MachType is in the list
-
 
7846
#
-
 
7847
sub ActiveMachType
-
 
7848
{
-
 
7849
    my ($mtype) = @_;
-
 
7850
    foreach (  split( '\s*[:,]\s*', $mtype ) )
-
 
7851
    {
-
 
7852
        return 1
-
 
7853
            if ( uc($_) eq uc($::GBE_MACHTYPE) );
-
 
7854
    }
-
 
7855
    return 0;
-
 
7856
}
7813
 
7857
 
7814
#-------------------------------------------------------------------------------
7858
#-------------------------------------------------------------------------------
7815
# Function        : ActivePlatform
7859
# Function        : ActivePlatform
7816
#
7860
#
7817
# Description     : Determine if the specified platform is currently 'active'
7861
# Description     : Determine if the specified platform is currently 'active'
Line 7823... Line 7867...
7823
#
7867
#
7824
#                   Format of platform_spec. One or more of
7868
#                   Format of platform_spec. One or more of
7825
#                       PlatformName
7869
#                       PlatformName
7826
#                       AliasName
7870
#                       AliasName
7827
#                       TargetName,--Target
7871
#                       TargetName,--Target
7828
#                       --Project=ProjectName
-
 
7829
#                       --Defined=SomeValue
-
 
7830
#                       --MachType=SomeValue
-
 
7831
#                   Special markers (Must be True)
7872
#                   Special Options (Must all be True)
7832
#                       (!)++Project=ProjectName
7873
#                       --Project=ProjectName[:ProjectName]+
7833
#                       (!)++Defined=SomeValue
7874
#                       --Defined=SomeValue[:SomeValue]+
7834
#                       (!)++MachType=SomeValue
7875
#                       --MachType=SomeValue[:SomeValue]+
7835
#
7876
 
7836
#                   Each can be prefxied with a '!' to negate the test
7877
#                   Each can be prefixed with a '!' to negate the test
7837
#
7878
#
7838
#                   Valid options are:
7879
#                   Valid options are:
7839
#                       --Target        - indicates that the platform is a 'target'
7880
#                       --Target        - indicates that the platform is a 'target'
7840
#
7881
#
7841
# Returns         : TRUE if the platform spec is satisfied
7882
# Returns         : TRUE if the platform spec is satisfied
Line 7864... Line 7905...
7864
    #   Extract non-platform arguments
7905
    #   Extract non-platform arguments
7865
    #   Process to yield a dummy platform of '0' or '1' - these will be seen later
7906
    #   Process to yield a dummy platform of '0' or '1' - these will be seen later
7866
    #
7907
    #
7867
    foreach ( split( '\s*,\s*', $platform_spec ) )
7908
    foreach ( split( '\s*,\s*', $platform_spec ) )
7868
    {
7909
    {
7869
        my ($result, $mode, $not);
7910
        my ($result, $not);
7870
        if ( m~^(!?)(--|\+\+)Project=(.+)~ ) {
7911
        if ( m~^(!?)--Project=(.+)~ ) {
7871
            $not = $1;
7912
            $not = $1;
7872
            $mode = $2;
-
 
7873
            $result = ActiveProject($3);
7913
            $result = ActiveProject($2);
7874
 
7914
 
7875
        } elsif ( m~^(!?)(--|\+\+)Defined=(.+)~ ) {
7915
        } elsif ( m~^(!?)--Defined=(.+)~ ) {
7876
            $not = $1;
7916
            $not = $1;
7877
            $mode = $2;
-
 
7878
            $result = 0;
7917
            $result = ActiveDefine($2);
7879
            no strict 'refs';
-
 
7880
            $result = 1 if ( defined( $$3 ) || defined( @$3 ) );
-
 
7881
            use strict 'refs';
-
 
7882
 
7918
 
7883
        } elsif ( m~^(!?)(--|\+\+)MachType=(.+)~ ) {
7919
        } elsif ( m~^(!?)--MachType=(.+)~ ) {
7884
            $not = $1;
7920
            $not = $1;
7885
            $mode = $2;
-
 
7886
            $result = ( uc($3) eq uc($::GBE_MACHTYPE) );
7921
            $result = ActiveMachType($2);
-
 
7922
 
7887
        } else {
7923
        } else {
7888
            #
7924
            #
7889
            #   Must be a platform argument
7925
            #   Must be a platform argument
7890
            #   Add to a list
7926
            #   Add to a list
7891
            #
7927
            #
Line 7893... Line 7929...
7893
            next;
7929
            next;
7894
        }
7930
        }
7895
 
7931
 
7896
        #
7932
        #
7897
        #   Continue processing non-platform arguments
7933
        #   Continue processing non-platform arguments
7898
        #   If an ++ prefix, then its an AND operation so we can
-
 
7899
        #   terminate now if its not satisfied
7934
        #   Each one must be TRUE, allowing for negation.
7900
        #
7935
        #
7901
        $result = $result ? 1 : 0;
7936
        $result = $result ? 1 : 0;
7902
        if ( $mode eq '++' ) {
-
 
7903
            $result = ! $result if ( $not );
7937
        $result = ! $result if ( $not );
7904
            return 0 unless ( $result );
7938
        return 0 unless ( $result );
7905
        } else {
-
 
7906
            push @plist, "$not$result";
-
 
7907
        }
-
 
7908
    }
7939
    }
7909
 
7940
 
7910
    #   Platform specified may be an Alias
7941
    #   Platform specified may be an Alias
7911
    #   Perform alias expansion
7942
    #   Perform alias expansion
7912
    #
7943
    #