Subversion Repositories DevTools

Rev

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

Rev 4161 Rev 4551
Line 62... Line 62...
62
our @BUILDSETENV            = ();               # BuildSetenv()
62
our @BUILDSETENV            = ();               # BuildSetenv()
63
our $BUILDINTERFACE         = "";               # BuildInterface()
63
our $BUILDINTERFACE         = "";               # BuildInterface()
64
our $BUILDLOCAL             = "";               # BuildInterface()
64
our $BUILDLOCAL             = "";               # BuildInterface()
65
our $BUILDDIRTREE           = "";               # BuildDirTree()
65
our $BUILDDIRTREE           = "";               # BuildDirTree()
66
our @BUILD_BADNAME          = ();               # Unknown platforms
66
our @BUILD_BADNAME          = ();               # Unknown platforms
-
 
67
our @GENERIC_TARGETS        = ();               # Generic targets - only one allowed    
67
 
68
 
68
our $BUILDNAME              = "";               # BuildName()
69
our $BUILDNAME              = "";               # BuildName()
69
our $BUILDVERSION           = "";               # BuildName()
70
our $BUILDVERSION           = "";               # BuildName()
70
our $BUILDNAME_PACKAGE;                         # Name
71
our $BUILDNAME_PACKAGE;                         # Name
71
our $BUILDNAME_VERSION;                         # Version
72
our $BUILDNAME_VERSION;                         # Version
Line 395... Line 396...
395
    $BUILDALIAS_TARGETS{ $alias } = ''
396
    $BUILDALIAS_TARGETS{ $alias } = ''
396
        if ( $target_mode );
397
        if ( $target_mode );
397
 
398
 
398
    #   Define alias
399
    #   Define alias
399
    #
400
    #
400
    if ( $alias eq "GENERIC" )
401
    if ( PlatformConfig::checkBuildAvailability($alias) == 2 )
401
    {
402
    {
402
        Error( "BuildAlias() cannot create an alias named GENERIC" );
403
        Error( "BuildAlias() cannot create an alias named $alias", "That name is reserved for generic targets" );
403
    }
404
    }
404
    elsif ( $alias ne quotemeta( $alias ) )
405
    elsif ( $alias ne quotemeta( $alias ) )
405
    {
406
    {
406
        Warning( "BuildAlias() alias '$alias' contains invalid characters -- ignored" );
407
        Warning( "BuildAlias() alias '$alias' contains invalid characters -- ignored" );
407
    }
408
    }
Line 643... Line 644...
643
        #
644
        #
644
        unless ( $arg eq '++' )
645
        unless ( $arg eq '++' )
645
        {
646
        {
646
            $target = $arg;
647
            $target = $arg;
647
            Error( "BuildProduct() cannot create a product based on a GENERIC platform" )
648
            Error( "BuildProduct() cannot create a product based on a GENERIC platform" )
648
                if ( $target eq "GENERIC" );
649
                if ( PlatformConfig::checkBuildAvailability($target) == 2);
649
            next;
650
            next;
650
        }
651
        }
651
 
652
 
652
        #
653
        #
653
        #   Infer a BuildPlatform
654
        #   Infer a BuildPlatform
Line 677... Line 678...
677
#                   $pArgs                  - Ref to an array of platform arguments
678
#                   $pArgs                  - Ref to an array of platform arguments
678
#
679
#
679
# Returns         :
680
# Returns         :
680
#
681
#
681
 
682
 
682
my $have_generic;
-
 
683
my $have_no_generic;
-
 
684
sub CreateBuildPlatformEntry
683
sub CreateBuildPlatformEntry
685
{
684
{
686
    my ($fname, $notdefault, $product, $target, $pUses, $pArgs ) = @_;
685
    my ($fname, $notdefault, $product, $target, $pUses, $pArgs ) = @_;
687
    my %buildentry;
686
    my %buildentry;
688
    my $platform;
687
    my $platform;
689
 
688
 
690
    #
689
    #
691
    #   Detect GENERIC platform
-
 
692
    #       Generic platforms force a build for all
-
 
693
    #       Don't mix generic with others
-
 
694
    #
-
 
695
    if ( $target eq "GENERIC" )
-
 
696
    {
-
 
697
        $All = 1;
-
 
698
        $have_generic = 1;
-
 
699
    }
-
 
700
    else
-
 
701
    {
-
 
702
        $have_no_generic = 1;
-
 
703
    }
-
 
704
    Error("Cannot use a 'GENERIC' platform with any other platform names")
-
 
705
        if ( $have_generic && $have_no_generic );
-
 
706
        
-
 
707
 
-
 
708
    #
-
 
709
    #   Create a basic BUILDINFO entry
690
    #   Create a basic BUILDINFO entry
710
    #
691
    #
711
    $buildentry{FNAME} = $fname;
692
    $buildentry{FNAME} = $fname;
712
    $buildentry{NOT_DEFAULT} = $notdefault;
693
    $buildentry{NOT_DEFAULT} = $notdefault;
713
    $buildentry{PRODUCT} = $product;
694
    $buildentry{PRODUCT} = $product;
Line 750... Line 731...
750
        #   at this time
731
        #   at this time
751
        #
732
        #
752
        my $package_name = uc($target) . '_Build';
733
        my $package_name = uc($target) . '_Build';
753
 
734
 
754
        #
735
        #
755
        #   Ensure that the CFG is correclt formed
736
        #   Ensure that the CFG is correctly formed
756
        #       Perhaps the package that it implements was misnamed
737
        #       Perhaps the package that it implements was misnamed
757
        #
738
        #
758
        Error ("INTERNAL: $target.cfg does not satisfy API " )
739
        Error ("INTERNAL: $target.cfg does not satisfy API " )
759
            unless ( $package_name->can('new_platform') || $package_name->can('add_platform') );
740
            unless ( $package_name->can('new_platform') || $package_name->can('add_platform') );
760
 
741
 
Line 818... Line 799...
818
    #
799
    #
819
    my $base_target = $target;
800
    my $base_target = $target;
820
    $base_target =~ s~^LMOS_~~;
801
    $base_target =~ s~^LMOS_~~;
821
 
802
 
822
    #
803
    #
-
 
804
    #   Detect GENERIC targets
-
 
805
    #       The Build file is only allowed to have one that can be built on any one machine
-
 
806
    #
-
 
807
    my $buildAvailability = PlatformConfig::checkBuildAvailability( $base_target );
-
 
808
    if ($buildAvailability == 2 )
-
 
809
    {
-
 
810
        UniquePush (\@GENERIC_TARGETS, $target );
-
 
811
        $pInfo->{IS_GENERIC} = 1;
-
 
812
    }
-
 
813
 
-
 
814
    #
823
    #   Ensure target is known to JATS
815
    #   Ensure target is known to JATS
824
    #   Remove unknown targets from the build. Create a list of unknown
816
    #   Remove unknown targets from the build. Create a list of unknown
825
    #   targets and report them later.
817
    #   targets and report them later.
826
    #
818
    #
827
    #   If there are signs that the target has been processed, then it may be
819
    #   If there are signs that the target has been processed, then it may be
828
    #   an alias that has not been expanded.
820
    #   an alias that has not been expanded.
829
    #
821
    #
830
    #   One result will be that alias platforms, such as DEVLINUX, that don't
822
    #   One result will be that alias platforms, such as DEVLINUX, that don't
831
    #   expand on WIN32 will be shown as DEVLINUX and not its components.
823
    #   expand on WIN32 will be shown as DEVLINUX and not its components.
832
    #
824
    #
833
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} )
825
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC} )
834
    {
826
    {
835
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
827
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
836
        {
828
        {
837
            UniquePush (\@BUILD_BADNAME, $target );
829
            UniquePush (\@BUILD_BADNAME, $target ) 
-
 
830
                unless PlatformConfig::checkKnownSpecial($target);
838
            $pInfo->{NOT_AVAILABLE} = 1;
831
            $pInfo->{NOT_AVAILABLE} = 1;
839
        }
832
        }
840
    }
833
    }
841
 
834
 
842
    #
835
    #
843
    #   Mark as NOT_AVAILABLE platforms that are not available on the machine
836
    #   Mark as NOT_AVAILABLE platforms that are not available on this machine
844
    #
837
    #
845
    unless ($pInfo->{NOT_AVAILABLE} )
838
    unless ($pInfo->{NOT_AVAILABLE} )
846
    {
839
    {
847
        $pInfo->{NOT_AVAILABLE} = 1
840
        $pInfo->{NOT_AVAILABLE} = 1
848
            unless ( PlatformConfig::checkBuildAvailability( $base_target ) );
841
            if ($buildAvailability == 0 )
849
    }
842
    }
850
 
843
 
851
    unless ($pInfo->{NOT_AVAILABLE} )
844
    unless ($pInfo->{NOT_AVAILABLE} )
852
    {
845
    {
853
        my $target_cfg = $pInfo->{TARGET_CFG} || $target ;
846
        my $target_cfg = $pInfo->{TARGET_CFG} || $target;
854
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target_cfg}.cfg"  ) )
847
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target_cfg}.cfg"  ) )
855
        {
848
        {
856
            Verbose ("Processing(add) Platform Configuration file: $build_cfg");
849
            Verbose ("Processing(add) Platform Configuration file: $build_cfg");
857
            my $package_name = "${target_cfg}_Build";
850
            my $package_name = "${target_cfg}_Build";
858
 
851
 
Line 1284... Line 1277...
1284
    #   May be the result of a user typo or a guess
1277
    #   May be the result of a user typo or a guess
1285
    #
1278
    #
1286
    if ( @BUILD_BADNAME )
1279
    if ( @BUILD_BADNAME )
1287
    {
1280
    {
1288
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1281
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1289
         Warning ("The following platform names are not known to JATS", "@BUILD_BADNAME");
1282
        Warning ("The following platform names are not known to JATS", "@BUILD_BADNAME");
1290
    }
1283
    }
-
 
1284
 
1291
    
1285
    #
-
 
1286
    #   Detect multiple GENERIC targets
-
 
1287
    #       Only one such target can be processed on any one machine
-
 
1288
    #
-
 
1289
    if ($#GENERIC_TARGETS > 0)
-
 
1290
    {
-
 
1291
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
-
 
1292
    }
-
 
1293
    if ($#GENERIC_TARGETS >= 0 )
-
 
1294
    {
-
 
1295
        $All = 1;
-
 
1296
    }
-
 
1297
 
1292
    #
1298
    #
1293
    #   Generate a list of active platforms
1299
    #   Generate a list of active platforms
1294
    #   Ensure that there are some active platforms
1300
    #   Ensure that there are some active platforms
1295
    #
1301
    #
1296
    GeneratePlatformList();
1302
    GeneratePlatformList();
-
 
1303
 
-
 
1304
    #
-
 
1305
    #   Detect a mix of Generic and non Generic targets
-
 
1306
    #       Cannot mix generic and non-generic targets
-
 
1307
    #
-
 
1308
    if ($#GENERIC_TARGETS >= 0 && $#BUILD_ACTIVEPLATFORMS >= 0)
-
 
1309
    {
-
 
1310
        if ($#BUILD_ACTIVEPLATFORMS != $#GENERIC_TARGETS )
-
 
1311
        {
-
 
1312
            Verbose("Active:", @BUILD_ACTIVEPLATFORMS);
-
 
1313
            Verbose("Generic:", @GENERIC_TARGETS);
-
 
1314
            Error("Cannot mix GENERIC and non-GENERIC targets in the one build");
-
 
1315
        }
-
 
1316
    }
-
 
1317
 
1297
    unless( @BUILD_ACTIVEPLATFORMS )
1318
    unless( @BUILD_ACTIVEPLATFORMS )
1298
    {
1319
    {
1299
        if (defined($::GBE_ABT)) {
1320
        if (defined($::GBE_ABT)) {
1300
 
1321
 
1301
            # Build filter on this machine prevents the package building
1322
            # Build filter on this machine prevents the package building
Line 1331... Line 1352...
1331
        #   Create a hash of active platforms based on the array of
1352
        #   Create a hash of active platforms based on the array of
1332
        #   active platforms to simplify testing
1353
        #   active platforms to simplify testing
1333
        #
1354
        #
1334
        $active_platforms{$_} = 1 foreach ( @BUILD_ACTIVEPLATFORMS  );
1355
        $active_platforms{$_} = 1 foreach ( @BUILD_ACTIVEPLATFORMS  );
1335
 
1356
 
1336
        unless ( defined($active_platforms{GENERIC}) )
1357
        unless ( $#GENERIC_TARGETS >= 0 )
1337
        {
1358
        {
1338
            foreach  ( split( ' ', $::GBE_PLATFORM) )
1359
            foreach  ( split( ' ', $::GBE_PLATFORM) )
1339
            {
1360
            {
1340
                push @MAKE_PLATFORMS, $_
1361
                push @MAKE_PLATFORMS, $_
1341
                    if ( $active_platforms{$_} );
1362
                    if ( $active_platforms{$_} );