Subversion Repositories DevTools

Rev

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

Rev 7309 Rev 7310
Line 28... Line 28...
28
use Getopt::Long;
28
use Getopt::Long;
29
use File::Path;
29
use File::Path;
30
use XML::Writer;
30
use XML::Writer;
31
use ArrayHashUtils;
31
use ArrayHashUtils;
32
use File::Find;
32
use File::Find;
-
 
33
use Storable qw(dclone);
33
use Digest::SHA qw(sha1);
34
#use Digest::SHA qw(sha1);
-
 
35
use Digest::SHA::PurePerl qw(sha1);
34
use IPC::Open3;
36
use IPC::Open3;
35
 
37
 
36
our $BuildVersion           = "2.1.0";
38
our $BuildVersion           = "2.1.0";
37
 
39
 
38
#.. Switchs
40
#.. Switchs
Line 69... Line 71...
69
our $BUILDINTERFACE         = "";               # BuildInterface()
71
our $BUILDINTERFACE         = "";               # BuildInterface()
70
our $BUILDLOCAL             = "";               # BuildInterface()
72
our $BUILDLOCAL             = "";               # BuildInterface()
71
our $BUILDDIRTREE           = "";               # BuildDirTree()
73
our $BUILDDIRTREE           = "";               # BuildDirTree()
72
our @BUILD_BADNAME          = ();               # Unknown platforms
74
our @BUILD_BADNAME          = ();               # Unknown platforms
73
our @GENERIC_TARGETS        = ();               # Generic targets - only one allowed
75
our @GENERIC_TARGETS        = ();               # Generic targets - only one allowed
74
our %BUILDERINFO            = ();               # Complete build info
-
 
75
 
76
 
76
our $BUILDNAME              = "";               # BuildName()
77
our $BUILDNAME              = "";               # BuildName()
77
our $BUILDVERSION           = "";               # BuildName()
78
our $BUILDVERSION           = "";               # BuildName()
78
our $BUILDNAME_PACKAGE;                         # Name
79
our $BUILDNAME_PACKAGE;                         # Name
79
our $BUILDNAME_VERSION;                         # Version
80
our $BUILDNAME_VERSION;                         # Version
Line 535... Line 536...
535
#
536
#
536
# Returns         : Nothing
537
# Returns         : Nothing
537
#
538
#
538
sub Process_TargetAlias
539
sub Process_TargetAlias
539
{
540
{
540
 
-
 
541
    #
541
    #
542
    #   Merge any delayed aliases with the complete set of alias
542
    #   Merge any delayed aliases with the complete set of alias
543
    #   Delayed alias are not used in expansions during the processing
543
    #   Delayed alias are not used in expansions during the processing
544
    #   of platforms and targets, but can be used to pick up errors
544
    #   of platforms and targets, but can be used to pick up errors
545
    #
545
    #
Line 552... Line 552...
552
        }
552
        }
553
        $BUILDALIAS{$key} = $value;
553
        $BUILDALIAS{$key} = $value;
554
    }
554
    }
555
    ErrorDoExit();
555
    ErrorDoExit();
556
 
556
 
-
 
557
    #
-
 
558
    #   Empty so that its not seen in Buildfile.
-
 
559
    #
-
 
560
    %BUILDALIAS_DELAY =();
-
 
561
 
557
    foreach my $alias ( keys %BUILDALIAS_TARGETS )
562
    foreach my $alias ( keys %BUILDALIAS_TARGETS )
558
    {
563
    {
559
        Debug( "BuildTargetAlias($alias)" );
564
        Debug( "BuildTargetAlias($alias)" );
560
 
565
 
561
        #
566
        #
Line 604... Line 609...
604
{
609
{
605
    #
610
    #
606
    #   Clean up Aliases
611
    #   Clean up Aliases
607
    #
612
    #
608
#DebugDumpData("BEFORE CleanUp_Aliases", \%BUILDALIAS);
613
#DebugDumpData("BEFORE CleanUp_Aliases", \%BUILDALIAS);
-
 
614
 
609
    foreach my $alias ( keys %BUILDALIAS )
615
    foreach my $alias ( keys %BUILDALIAS )
610
    {
616
    {
-
 
617
        #
-
 
618
        #   Build hash of bits to be added and bits to be removed
-
 
619
        #   Remove all options - only need platforms
-
 
620
        #
611
        my @aliasList = split(/ /, $BUILDALIAS{$alias});
621
        my @aliasList = split(/ /, $BUILDALIAS{$alias});
612
        my @expanded =  ExpandPlatforms(@aliasList);
622
        my @expanded =  ExpandPlatforms(@aliasList);
613
 
623
 
614
        my %add;
624
        my %add;
615
        my %remove;
625
        my %remove;
Line 627... Line 637...
627
        #
637
        #
628
        #   If there are NO additive expressions in the alias, then
638
        #   If there are NO additive expressions in the alias, then
629
        #   assume all the active targets
639
        #   assume all the active targets
630
        #
640
        #
631
        unless (keys %add) {
641
        unless (keys %add) {
632
            foreach  ( @BUILD_ACTIVEPLATFORMS)
642
            my %add = map { $_ => 1 } @BUILD_ACTIVEPLATFORMS;
633
            {
-
 
634
                 $add{$_} = 1;
-
 
635
            }
-
 
636
        }
643
        }
637
 
644
 
638
 
-
 
639
        foreach ( keys %remove) {
645
        foreach ( keys %remove) {
640
            delete $add { $_};
646
            delete $add { $_};
641
        }
647
        }
642
 
648
 
-
 
649
        #
-
 
650
        #   Delete ALIAS if it has no expansion
-
 
651
        #       May cause issues with the Platforms directive
-
 
652
        #
-
 
653
        if (keys %add) {
643
        $BUILDALIAS{$alias} = join(' ',keys %add);
654
            $BUILDALIAS{$alias} = join(' ',keys %add);
-
 
655
        } else {
-
 
656
            delete $BUILDALIAS{$alias};
-
 
657
        }
644
    }
658
    }
645
#DebugDumpData("AFTER CleanUp_Aliases", \%BUILDALIAS);
659
#DebugDumpData("AFTER CleanUp_Aliases", \%BUILDALIAS);
646
}
660
}
647
 
661
 
-
 
662
#-------------------------------------------------------------------------------
-
 
663
# Function        : ProcessBuildExclude  
-
 
664
#
-
 
665
# Description     : Process BuildExclude directive info
-
 
666
#                   A list of targets to be excluded
-
 
667
#                   INSTRUMENT is a key word
-
 
668
#  
-
 
669
#
-
 
670
# Inputs          : None
-
 
671
#
-
 
672
# Returns         : Modifies BUILDINFO
-
 
673
#
-
 
674
sub ProcessBuildExclude
-
 
675
{
-
 
676
    for my $word (@BUILDEXCLUDE)
-
 
677
    {
-
 
678
        Debug("ProcessBuildExclude: $word");
-
 
679
        Error('BuildExclude: Unknown option: ' . $word) if ($word =~ m~^-~);
-
 
680
        Error('BuildExclude: Invalid format: ' . $word) if ($word =~ m~^!~);
-
 
681
 
-
 
682
        #
-
 
683
        #   INSTRUMENT is a key word
-
 
684
        #       Remove all instrumented builds
-
 
685
        #
-
 
686
        if ($word eq 'INSTRUMENT')
-
 
687
        {
-
 
688
            foreach my $platform ( keys %BUILDINFO )
-
 
689
            {
-
 
690
                if ( PlatformConfig::targetHasTag( $platform, 'INSTRUMENT') ) {
-
 
691
                    $BUILDINFO{$platform}{NOT_AVAILABLE} = 2;
-
 
692
                    Debug("ProcessBuildExclude. Remove $platform ");
-
 
693
                }
-
 
694
            }
-
 
695
        }
-
 
696
        elsif (exists $BUILDINFO{$word} )
-
 
697
        {
-
 
698
            $BUILDINFO{$word}{NOT_AVAILABLE} = 2;
-
 
699
            Debug("ProcessBuildExclude. Remove $word ");
-
 
700
 
-
 
701
        } else {
-
 
702
            Warning('BuildExclude: Unknown target:' . $word ) 
-
 
703
        }
-
 
704
    }
-
 
705
}
648
 
706
 
649
#-------------------------------------------------------------------------------
707
#-------------------------------------------------------------------------------
650
# Function        : BuildProduct
708
# Function        : BuildProduct
651
#
709
#
652
# Description     : Create a family of Platforms with a common product line
710
# Description     : Create a family of Platforms with a common product line
Line 799... Line 857...
799
 
857
 
800
    #
858
    #
801
    #   Create a basic BUILDINFO entry
859
    #   Create a basic BUILDINFO entry
802
    #
860
    #
803
    $buildentry{FNAME} = $fname;
861
    $buildentry{FNAME} = $fname;
804
    $buildentry{NOT_DEFAULT} = $notdefault;
862
    $buildentry{NOT_DEFAULT} = $notdefault if $notdefault;
805
    $buildentry{PRODUCT} = $product;
863
    $buildentry{PRODUCT} = $product;
806
    $buildentry{TARGET} = $target;
864
    $buildentry{TARGET} = $target;
807
    $buildentry{BASE} = $target;
865
    $buildentry{BASE} = $target;
808
    foreach ( @$pArgs )
866
    foreach ( @$pArgs )
809
    {
867
    {
Line 830... Line 888...
830
        Error("Invalid use of the platform alias $reserved","The $reserved alias cannot be used to define build platforms")
888
        Error("Invalid use of the platform alias $reserved","The $reserved alias cannot be used to define build platforms")
831
            if (uc($target) eq uc($reserved));
889
            if (uc($target) eq uc($reserved));
832
    }
890
    }
833
 
891
 
834
    #
892
    #
835
    #   Allow per-platform processing to alter the basic information
-
 
836
    #   Special processing may be perform to extend the information
-
 
837
    #   Allows special processing to be enabled on a per-target basis
-
 
838
    #
-
 
839
    #   There are three forms of processing that have been allowed for:
893
    #   Expand families of platforms into multiple platforms
840
    #       1) None:        There is not platform specific extension
-
 
841
    #       2) Basic:       The extension will add or extend build information
-
 
842
    #       3) Advanced:    The extension will generate additional build information
-
 
843
    #                       structures.
894
    #       ie: DEVLINUX -> COBRA, VIPER, ....
844
    #
-
 
845
 
-
 
846
    #
-
 
847
    #   Locate the optional PLATFORM configuration file
-
 
848
    #   If it does exist then it can alter build-time information
-
 
849
    #
895
    #
850
    if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "$target.cfg"  ) )
896
    foreach my $name (@PlatformConfig::BuildFamilies)
851
    {
897
    {
852
        Verbose ("Processing(new) Platform Configuration file: $build_cfg");
-
 
853
 
-
 
854
        #
898
        #
855
        #   Create package name with an uppercase target
-
 
856
        #   Target should be UC, but under windows its not detected
-
 
857
        #   at this time
899
        #   Is this target a buildFamily alias
858
        #
-
 
859
        my $package_name = uc($target) . '_Build';
-
 
860
 
-
 
861
        #
900
        #
862
        #   Ensure that the CFG is correctly formed
-
 
863
        #       Perhaps the package that it implements was misnamed
-
 
864
        #
-
 
865
        Error ("INTERNAL: $target.cfg does not satisfy API " )
-
 
866
            unless ( $package_name->can('new_platform') || $package_name->can('add_platform') );
-
 
867
 
-
 
868
        if ( $package_name->can('new_platform') )
901
        if (uc($target) eq uc($name))
869
        {
902
        {
-
 
903
            #
-
 
904
            #   Get the list of targets that have been tagged with the family name
-
 
905
            #   Must exist - else its an internal error
-
 
906
            #   
870
            Verbose ("Processing(new) Platform Configuration: $package_name");
907
            my @targets = PlatformConfig::getTargetsByTag($name);
-
 
908
            Error ("Internal: No platforms are tagged as members of $name") unless @targets;
-
 
909
 
-
 
910
            #   Instantiate all targets
-
 
911
            #       Give them an ALIAS for the Family name
871
            $package_name->new_platform( \%buildentry );
912
            #       Register new enrty with the build system
872
        }
913
            #
-
 
914
            foreach my $target ( @targets )
873
        else
915
            {
-
 
916
                my $pInfo = dclone(\%buildentry);
-
 
917
                $pInfo->{ALIAS} = $pInfo->{TARGET};
-
 
918
                $pInfo->{TARGET} = $target;
-
 
919
                AddBuildPlatformEntry( $pInfo );
874
        {
920
            }
875
            Debug ("Processing(new) Platform Configuration: $package_name. 'new_platform' function not found");
921
            #   Mark the original entry as a TEMPLATE so that it won't be added
-
 
922
            $buildentry{TEMPLATE} = 1;
-
 
923
            last;
876
        }
924
        }
877
    }
925
    }
878
 
926
    
879
    #
927
    #
880
    #   Add the basic entry into the build system, unless its been
928
    #   Add the basic entry into the build system, unless its been flagged as a TEMPLATE
881
    #   flagged as a TEMPLATE
-
 
882
    #
929
    #
883
    AddBuildPlatformEntry (\%buildentry )
930
    AddBuildPlatformEntry (\%buildentry )
884
        unless ( $buildentry{TEMPLATE} );
931
        unless ( $buildentry{TEMPLATE} );
885
}
932
}
886
 
933
 
887
END {
-
 
888
    DebugDumpData("BUILDERINFO", \%BUILDERINFO);
-
 
889
    }
-
 
890
 
-
 
891
#-------------------------------------------------------------------------------
934
#-------------------------------------------------------------------------------
892
# Function        : AddBuildPlatformEntry
935
# Function        : AddBuildPlatformEntry
893
#
936
#
894
# Description     : Internal routine to add a Build Entry into the build system
937
# Description     : Internal routine to add a Build Entry into the build system
895
#                   This function MAY be called from the build extensions
938
#                   This function MAY be called from the build extensions
Line 909... Line 952...
909
{
952
{
910
    my ($pInfo) = @_;
953
    my ($pInfo) = @_;
911
    my $fname = $pInfo->{FNAME};
954
    my $fname = $pInfo->{FNAME};
912
 
955
 
913
    #
956
    #
-
 
957
    #   Ensure that it exsists and is numeric
-
 
958
    #
-
 
959
    $pInfo->{NOT_AVAILABLE} = 0;
-
 
960
 
-
 
961
    #
914
    #   Locate the optional PLATFORM configuration file
962
    #   Locate the optional PLATFORM configuration file
915
    #   If it does exist then it can extend build-time information
963
    #   If it does exist then it can extend build-time information
916
    #
964
    #
917
    my $target = $pInfo->{TARGET};
965
    my $target = $pInfo->{TARGET};
918
 
966
 
Line 932... Line 980...
932
    if (PlatformConfig::targetHasTag( $target, 'GENERIC_MACHTYPE' ) )
980
    if (PlatformConfig::targetHasTag( $target, 'GENERIC_MACHTYPE' ) )
933
    {
981
    {
934
        $pInfo->{IS_GENERIC} = 1;
982
        $pInfo->{IS_GENERIC} = 1;
935
        $pInfo->{ALIAS} = 'GENERIC';
983
        $pInfo->{ALIAS} = 'GENERIC';
936
        $pInfo->{NOT_AVAILABLE} = 1 unless needToolset();
984
        $pInfo->{NOT_AVAILABLE} = 1 unless needToolset();
937
        $All = 1;
-
 
938
    }
985
    }
939
 
986
 
940
    #
987
    #
941
    #   Ensure target is known to JATS
988
    #   Ensure target is known to JATS
942
    #   Remove unknown targets from the build. Create a list of unknown
989
    #   Remove unknown targets from the build. 
943
    #   targets and report them later.
990
    #   Create a list of unknown targets and report them later.
944
    #
991
    #
945
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC} || ($target =~ m~^GENERIC_~) )
992
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC}  )
946
    {
993
    {
947
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
994
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
948
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
995
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
949
        {
996
        {
950
            UniquePush (\@BUILD_BADNAME, $target ); 
997
            UniquePush (\@BUILD_BADNAME, $target ); 
951
            $pInfo->{NOT_AVAILABLE} = 1;
998
            $pInfo->{NOT_AVAILABLE} = 3;
-
 
999
            $pInfo->{BADNAME} = 1;
952
        }
1000
        }
953
    }
1001
    }
954
 
1002
 
-
 
1003
    #
-
 
1004
    #   Mark as NOT_AVAILABLE platforms that are not available on this machine
-
 
1005
    #
955
    if ($buildAvailability)
1006
    if ($buildAvailability)
956
    {
1007
    {
957
        $BUILDERINFO{$target}{$buildAvailability} = 1;
1008
         $pInfo->{MACHTYPE} = $buildAvailability;
958
         $pInfo->{NOT_AVAILABLE} = 1 unless ($buildAvailability eq $::GBE_MACHTYPE)
1009
         $pInfo->{NOT_AVAILABLE} = 1 unless ($buildAvailability eq $::GBE_MACHTYPE)
959
    }
1010
    }
960
 
1011
 
961
    #
1012
    #
962
    #   Mark as NOT_AVAILABLE platforms that are not available on this machine
1013
    #   Extend the build information
963
    #
1014
    #
964
    unless ($pInfo->{NOT_AVAILABLE} )
1015
    unless ($pInfo->{NOT_AVAILABLE} )
965
    {
1016
    {
966
        $pInfo->{NOT_AVAILABLE} = 1
-
 
967
            unless ($buildAvailability);
-
 
968
    }
-
 
969
 
-
 
970
    unless ($pInfo->{NOT_AVAILABLE} )
-
 
971
    {
-
 
972
        my $target_cfg = $pInfo->{TARGET_CFG} || $target;
-
 
973
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target_cfg}.cfg"  ) )
1017
        if ( my $build_cfg = Require( "$::GBE_CONFIG/PLATFORM", "${target}.cfg"  ) )
974
        {
1018
        {
975
            Verbose ("Processing(add) Platform Configuration file: $build_cfg");
1019
            Verbose ("Processing(add) Platform Configuration file: $build_cfg");
976
            my $package_name = "${target_cfg}_Build";
1020
            my $package_name = "${target}_Build";
977
 
1021
 
978
            if ( $package_name->can('add_platform') )
1022
            if ( $package_name->can('add_platform') )
979
            {
1023
            {
980
                Verbose ("Processing(add) Platform Configuration: $package_name");
1024
                Verbose ("Processing(add) Platform Configuration: $package_name");
981
                $package_name->add_platform( $pInfo );
1025
                $package_name->add_platform( $pInfo );
Line 1037... Line 1081...
1037
    }
1081
    }
1038
 
1082
 
1039
    #
1083
    #
1040
    #   Add platform (tag) to various lists
1084
    #   Add platform (tag) to various lists
1041
    #
1085
    #
1042
    UniquePush( \@BUILDPLATFORMS, $platform );
1086
    UniquePush( \@BUILDPLATFORMS, $platform ) unless exists ($pInfo->{BADNAME});
1043
    UniquePush( \@DEFBUILDPLATFORMS, $platform ) unless ( $pInfo->{NOT_DEFAULT} );
1087
    UniquePush( \@DEFBUILDPLATFORMS, $platform ) unless ( $pInfo->{NOT_DEFAULT} );
1044
 
1088
 
1045
    #
1089
    #
1046
    #   Create a simple alias if requested
1090
    #   Create a simple alias if requested
1047
    #   Used if a platform creates multiple entires
1091
    #   Used if a platform creates multiple entires
Line 1057... Line 1101...
1057
        HashJoin( \%BUILDALIAS_DELAY, ' ', $_, $platform )
1101
        HashJoin( \%BUILDALIAS_DELAY, ' ', $_, $platform )
1058
            foreach ( ArrayList($pInfo->{USERALIAS}) );
1102
            foreach ( ArrayList($pInfo->{USERALIAS}) );
1059
    }
1103
    }
1060
    
1104
    
1061
    #
1105
    #
1062
    #   Create a HARDWARE type alias if requested
-
 
1063
    #   ie: SOLARIS_SPARC or SOLARIS_X86
-
 
1064
    #
-
 
1065
    if ( $pInfo->{HARDWARE} )
-
 
1066
    {
-
 
1067
        HashJoin( \%BUILDALIAS_DELAY, ' ',  $pInfo->{BASE} . '_' . $pInfo->{HARDWARE}, $platform );
-
 
1068
    }
-
 
1069
 
-
 
1070
    #
-
 
1071
    #   Create the 'parts' of the platform. This is a list of unique
1106
    #   Create the 'parts' of the platform. This is a list of unique
1072
    #   bits to search. It will consist of:
1107
    #   bits to search. It will consist of:
1073
    #       [0]     - platform
1108
    #       [0]     - platform
1074
    #       [1]     - product
1109
    #       [1]     - product
1075
    #       ...     - Uses bits ...
1110
    #       ...     - Uses bits ...
Line 1292... Line 1327...
1292
#                           in this version.
1327
#                           in this version.
1293
#                   Multiple BuildExclude directives are allowed
1328
#                   Multiple BuildExclude directives are allowed
1294
#                   Order or location is not important        
1329
#                   Order or location is not important        
1295
#
1330
#
1296
# Inputs          : Platforms names and options
1331
# Inputs          : Platforms names and options
1297
#                   Format:
-
 
1298
#                       --PLATFORM=xxxxx    (Marginal use)
-
 
1299
#                       --PRODUCT=yyyy      (Not very useful)
-
 
1300
#                       --TARGET=zzzz       (Default)
1332
#                       zzzz                Build Platform Name
1301
#                       zzzz                (Same as --TARGET=ZZZZ)
1333
#                       INSTRUMENT          (Keyword - no instrumented builds)
1302
#                       
1334
#                       
1303
#
1335
#
1304
# Returns         : Nothing 
1336
# Returns         : Nothing 
1305
#
1337
#
1306
sub BuildExclude
1338
sub BuildExclude
Line 1315... Line 1347...
1315
    #   Simply save the arguments for later
1347
    #   Simply save the arguments for later
1316
    #   Allow multiple specs in the one definition
1348
    #   Allow multiple specs in the one definition
1317
    #
1349
    #
1318
    foreach ( @arguments)
1350
    foreach ( @arguments)
1319
    {
1351
    {
1320
        Error ("Invalid format: $_") if m/[,\s]/;
1352
        Error ("Invalid format: $_") if m/[\s]/;
1321
        UniquePush (\@BUILDEXCLUDE, split(/\s*,\s*/,$_));
1353
        UniquePush (\@BUILDEXCLUDE, split(/\s*,\s*/,$_));
1322
    }
1354
    }
1323
}
1355
}
1324
 
1356
 
1325
#-------------------------------------------------------------------------------
1357
#-------------------------------------------------------------------------------
Line 1489... Line 1521...
1489
    Log( "DPKG_SBOX .. $::GBE_DPKG_SBOX" );
1521
    Log( "DPKG_SBOX .. $::GBE_DPKG_SBOX" );
1490
    Log( "Sandbox .... Development" );
1522
    Log( "Sandbox .... Development" );
1491
    Log( "LocalFilter. $::GBE_DPKG_SBOX/buildfilter") if ( $::GBE_DPKG_SBOX && -f $::GBE_DPKG_SBOX . '/buildfilter' );
1523
    Log( "LocalFilter. $::GBE_DPKG_SBOX/buildfilter") if ( $::GBE_DPKG_SBOX && -f $::GBE_DPKG_SBOX . '/buildfilter' );
1492
 
1524
 
1493
    #
1525
    #
1494
    #   Generate a list of platforms that are completely unknown to JATS
-
 
1495
    #   May be the result of a user typo or a guess
-
 
1496
    #
-
 
1497
    if ( @BUILD_BADNAME )
-
 
1498
    {
-
 
1499
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
-
 
1500
        Warning ("The following platform names are not known to JATS", "@BUILD_BADNAME");
-
 
1501
    }
-
 
1502
 
-
 
1503
    #
-
 
1504
    #   Detect multiple GENERIC targets
-
 
1505
    #       Only one such target can be processed on any one machine
-
 
1506
    #
-
 
1507
    if ($#GENERIC_TARGETS > 0)
-
 
1508
    {
-
 
1509
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
-
 
1510
    }
-
 
1511
    if ($#GENERIC_TARGETS >= 0 )
-
 
1512
    {
-
 
1513
        $All = 1;
-
 
1514
    }
-
 
1515
 
-
 
1516
    #
-
 
1517
    #   Generate a list of active platforms
1526
    #   Generate a list of active platforms
1518
    #   Ensure that there are some active platforms
1527
    #   Ensure that there are some active platforms
1519
    #
1528
    #
-
 
1529
    ProcessBuildExclude();
1520
    GeneratePlatformList();
1530
    GeneratePlatformList();
1521
    Log( "Platforms .. " . PrintPlatforms(\@BUILDPLATFORMS, $sep) );
1531
    Log( "Platforms .. " . PrintPlatforms(\@BUILDPLATFORMS, $sep) );
1522
 
1532
 
1523
    #
1533
    #
1524
    #   Detect a mix of Generic and non Generic targets
1534
    #   Detect a mix of Generic and non Generic targets
Line 1608... Line 1618...
1608
            Log( "Make for ... ". PrintPlatforms(\@MAKE_PLATFORMS, $sep));
1618
            Log( "Make for ... ". PrintPlatforms(\@MAKE_PLATFORMS, $sep));
1609
        }
1619
        }
1610
 
1620
 
1611
    }
1621
    }
1612
 
1622
 
-
 
1623
    #
-
 
1624
    #   NoBuilds do not generate warnings
-
 
1625
    #
-
 
1626
    return if $NoBuild;
-
 
1627
 
-
 
1628
    #
-
 
1629
    #   Generate a list of platforms that are completely unknown to JATS
-
 
1630
    #   May be the result of a user typo or a guess
-
 
1631
    #
-
 
1632
    if ( @BUILD_BADNAME )
-
 
1633
    {
-
 
1634
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
-
 
1635
        Error ("The following platform names are not known to JATS", "@BUILD_BADNAME");
-
 
1636
    }
-
 
1637
 
-
 
1638
    #
-
 
1639
    #   Detect multiple GENERIC targets
-
 
1640
    #       Only one such target can be processed on any one machine
-
 
1641
    #
-
 
1642
    if ($#GENERIC_TARGETS > 0)
-
 
1643
    {
-
 
1644
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
-
 
1645
    }
-
 
1646
 
1613
    return 1;
1647
    return 1;
1614
}
1648
}
1615
 
1649
 
1616
#-------------------------------------------------------------------------------
1650
#-------------------------------------------------------------------------------
1617
# Function        : needToolset 
1651
# Function        : needToolset 
Line 1922... Line 1956...
1922
    Debug( "Name:      $name" );
1956
    Debug( "Name:      $name" );
1923
    Debug( "Version:   $version" );
1957
    Debug( "Version:   $version" );
1924
 
1958
 
1925
    DataDirective("LinkPkgArchive");            # This directive allowed here
1959
    DataDirective("LinkPkgArchive");            # This directive allowed here
1926
 
1960
 
1927
#   if ( $IgnorePkgs )
1961
   if ( $IgnorePkgs )
1928
#   {
1962
   {
1929
#       Log( "LinkPkgArchive .. $name ($version) - Ignored" );
1963
       Log( "LinkPkgArchive .. $name ($version) - Ignored" );
1930
#       return;
1964
       return;
1931
#   }
1965
   }
1932
 
1966
 
1933
    #
1967
    #
1934
    #   Ensure that we have do not have multiple definitions
1968
    #   Ensure that we have do not have multiple definitions
1935
    #
1969
    #
1936
    if ( PackageEntry::Exists( $name, $version ) )
1970
    if ( PackageEntry::Exists( $name, $version ) )
Line 1955... Line 1989...
1955
    {
1989
    {
1956
        #
1990
        #
1957
        #   Generate package rules for each active platform
1991
        #   Generate package rules for each active platform
1958
        #
1992
        #
1959
        IncludePkg ( $name, $pkg );
1993
        IncludePkg ( $name, $pkg );
1960
        foreach my $platform ( @BUILD_ACTIVEPLATFORMS, '--' )
1994
        foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
1961
        {
1995
        {
1962
            LinkEntry( $platform, $pkg, $name, $version, 0, $local, $pkgSig );
1996
            LinkEntry( $platform, $pkg, $name, $version, 0, $local, $pkgSig );
1963
        }
1997
        }
1964
    }
1998
    }
1965
}
1999
}
Line 2316... Line 2350...
2316
 
2350
 
2317
    #
2351
    #
2318
    #   Package not found
2352
    #   Package not found
2319
    #   This is an error, although it can be bypassed
2353
    #   This is an error, although it can be bypassed
2320
    #
2354
    #
2321
    Error ("Required package not found: '$name/$version'" ) unless ( $NoPackageError );
2355
    #Error ("Required package not found by signature: '$name/$version'" ) unless ( $NoPackageError );
2322
 
2356
    #
2323
    Log( "WARNING .... Package not available: '$name/$version'" );
2357
    #Log( "WARNING .... Package not available: '$name/$version'" );
2324
    return;
2358
    return;
2325
}
2359
}
2326
 
2360
 
2327
#-------------------------------------------------------------------------------
2361
#-------------------------------------------------------------------------------
2328
# Function        : LinkEntry
2362
# Function        : LinkEntry
2329
#
2363
#
2330
# Description     : Scan a package an locate platform specific directories
2364
# Description     : Scan a package an locate platform specific directories
2331
#                   Create data structures to capture the information
2365
#                   Create data structures to capture the information
2332
#                   This function is used by LinkPkgArchive and LinkSandbox
2366
#                   This function is used by LinkPkgArchive
2333
#                   to perfom the bulk of package inclusion work.
2367
#                   to perfom the bulk of package inclusion work.
2334
#
2368
#
2335
# Inputs          : platform being processed
2369
# Inputs          : platform being processed
2336
#                   path to the package
2370
#                   path to the package
2337
#                   name of the package
2371
#                   name of the package
Line 2455... Line 2489...
2455
    Debug( "Name:      $name" );
2489
    Debug( "Name:      $name" );
2456
    Debug( "Version:   $version" );
2490
    Debug( "Version:   $version" );
2457
 
2491
 
2458
    DataDirective("BuildPkgArchive");           # This directive allowed here
2492
    DataDirective("BuildPkgArchive");           # This directive allowed here
2459
 
2493
 
2460
#   if ( $IgnorePkgs )
2494
   if ( $IgnorePkgs )
2461
#   {
2495
   {
2462
#       Log( "BuildPkgArchive . $name ($version) - Ignored" );
2496
       Log( "BuildPkgArchive . $name ($version) - Ignored" );
2463
#       return;
2497
       return;
2464
#   }
2498
   }
2465
    
2499
    
2466
    #
2500
    #
2467
    #   Ensure that we have do not have multiple definitions
2501
    #   Ensure that we have do not have multiple definitions
2468
    #
2502
    #
2469
    if ( PackageEntry::Exists( $name, $version ) )
2503
    if ( PackageEntry::Exists( $name, $version ) )
Line 2701... Line 2735...
2701
# Inputs          : GBE_BUILDFILTER from the environment
2735
# Inputs          : GBE_BUILDFILTER from the environment
2702
#
2736
#
2703
# Returns         : An array of platforms to include in the build
2737
# Returns         : An array of platforms to include in the build
2704
#                   Maintains @BUILD_ACTIVEPLATFORMS  - the last calculated result
2738
#                   Maintains @BUILD_ACTIVEPLATFORMS  - the last calculated result
2705
#                   Ensures that @DEFBUILDPLATFORMS is a subset of @BUILD_ACTIVEPLATFORMS
2739
#                   Ensures that @DEFBUILDPLATFORMS is a subset of @BUILD_ACTIVEPLATFORMS
-
 
2740
#                   Rebuilds BUILDPLATFORMS to ensure that excluded platforms are not present
2706
#
2741
#
2707
sub GeneratePlatformList
2742
sub GeneratePlatformList
2708
{
2743
{
2709
    #
2744
    #
2710
    #   Return the cached result for speed
2745
    #   Return the cached result for speed
Line 2713... Line 2748...
2713
    unless ( @BUILD_ACTIVEPLATFORMS )
2748
    unless ( @BUILD_ACTIVEPLATFORMS )
2714
    {
2749
    {
2715
        my ($platform_filter);
2750
        my ($platform_filter);
2716
        my %result;
2751
        my %result;
2717
        my %part_to_platform;
2752
        my %part_to_platform;
-
 
2753
        my @New_BUILDPLATFORMS = ();
2718
 
2754
 
2719
        #
2755
        #
2720
        #   Create a data structure to assist in the production of the platform list
2756
        #   Create a data structure to assist in the production of the platform list
2721
        #   The structure will be a hash of hashes of arrays
2757
        #   The structure will be a hash of hashes of arrays
2722
        #
2758
        #
Line 2727... Line 2763...
2727
        for my $platform (keys (%::BUILDINFO))
2763
        for my $platform (keys (%::BUILDINFO))
2728
        {
2764
        {
2729
            my $pParts = $::BUILDINFO{$platform};
2765
            my $pParts = $::BUILDINFO{$platform};
2730
 
2766
 
2731
            #
2767
            #
-
 
2768
            #   Include into New_BUILDPLATFORMS 
-
 
2769
            #
-
 
2770
            if ($pParts->{NOT_AVAILABLE} <= 1) {
-
 
2771
                push @New_BUILDPLATFORMS, $platform;
-
 
2772
            }
-
 
2773
 
-
 
2774
            #
2732
            #   Skip platforms that are known to be unavailable on this build
2775
            #   Skip platforms that are known to be unavailable on this build
2733
            #   machine. Self configure
2776
            #   machine. Self configure
2734
            #
2777
            #
2735
            next if ( $pParts->{NOT_AVAILABLE} );
2778
            next if ( $pParts->{NOT_AVAILABLE} );
2736
 
2779
 
Line 2772... Line 2815...
2772
        {
2815
        {
2773
            %result = %{$part_to_platform{'PLATFORM'}}
2816
            %result = %{$part_to_platform{'PLATFORM'}}
2774
                if exists $part_to_platform{'PLATFORM'} ;
2817
                if exists $part_to_platform{'PLATFORM'} ;
2775
        }
2818
        }
2776
 
2819
 
-
 
2820
        #
-
 
2821
        # Add GENERIC platforms to the platform filter, if available
-
 
2822
        #
-
 
2823
        if (exists $part_to_platform{'PLATFORM'})
-
 
2824
        {
-
 
2825
            foreach my $platform( 'GENERIC', 'GENERIC_' . uc($::GBE_MACHTYPE) )
-
 
2826
            {
-
 
2827
                $result{$platform} = 1 if (exists $part_to_platform{'PLATFORM'}{$platform}) 
-
 
2828
            }
-
 
2829
        }
-
 
2830
 
2777
#DebugDumpData( "PartToPlatform", \%part_to_platform );
2831
#DebugDumpData( "PartToPlatform", \%part_to_platform );
-
 
2832
#DebugDumpData("Result", \%result);
2778
 
2833
 
2779
        #
2834
        #
2780
        #   Process each element in the user filter list
2835
        #   Process each element in the user filter list
2781
        #   Expand platforms into known aliases
2836
        #   Expand platforms into known aliases
2782
        #
2837
        #
Line 2826... Line 2881...
2826
                print "GBE_BUILDFILTER filter term not understood: $word\n";
2881
                print "GBE_BUILDFILTER filter term not understood: $word\n";
2827
            }
2882
            }
2828
        }
2883
        }
2829
 
2884
 
2830
        #
2885
        #
2831
        #   Process BuildExclude
-
 
2832
        #   A list of targets to be excluded
-
 
2833
        #       INSTRUMENT is a key word
-
 
2834
        #
-
 
2835
        for my $word (@BUILDEXCLUDE)
-
 
2836
        {
-
 
2837
            my $platform;
-
 
2838
 
-
 
2839
            Error('BuildExclude: Unknown option: ' . $word) if ($word =~ m~^-~);
-
 
2840
            Error('BuildExclude: Invalid format: ' . $word) if ($word =~ m~^!~);
-
 
2841
 
-
 
2842
            #
-
 
2843
            #   INSTRUMENT is a key word
-
 
2844
            #       Remove all instrumented builds
-
 
2845
            #
-
 
2846
            if ($word eq 'INSTRUMENT')
-
 
2847
            {
-
 
2848
                for ( keys %result) {
-
 
2849
                    if ( PlatformConfig::targetHasTag( $_, 'INSTRUMENT') ) {
-
 
2850
                        delete $result{$_} ;
-
 
2851
                    }
-
 
2852
                }
-
 
2853
            }
-
 
2854
            else
-
 
2855
            {
-
 
2856
                #
-
 
2857
                #   Remove items from the result
-
 
2858
                #
-
 
2859
                my $table = "PLATFORM";
-
 
2860
                my $plist = $part_to_platform{$table}{$word};
-
 
2861
                if ($plist) {
-
 
2862
                    for ( @{$plist}) {
-
 
2863
                        delete $result{$_};
-
 
2864
                    }
-
 
2865
                }
-
 
2866
                else  {
-
 
2867
                    Warning('BuildExclude: Unknown target:' . $word ) 
-
 
2868
                        unless exists $::BUILDINFO{$word};
-
 
2869
                }
-
 
2870
            }
-
 
2871
        }
-
 
2872
 
-
 
2873
        #
-
 
2874
        #   Return an array of platforms to process
2886
        #   Return an array of platforms to process
2875
        #
2887
        #
2876
        @BUILD_ACTIVEPLATFORMS = sort keys %result;
2888
        @BUILD_ACTIVEPLATFORMS = sort keys %result;
2877
 
2889
 
2878
        #
2890
        #
Line 2883... Line 2895...
2883
        {
2895
        {
2884
            push @NEW_DEFBUILDPLATFORMS, $_
2896
            push @NEW_DEFBUILDPLATFORMS, $_
2885
                if ( exists $result{$_} );
2897
                if ( exists $result{$_} );
2886
        }
2898
        }
2887
        @DEFBUILDPLATFORMS = @NEW_DEFBUILDPLATFORMS;
2899
        @DEFBUILDPLATFORMS = @NEW_DEFBUILDPLATFORMS;
-
 
2900
 
-
 
2901
        #
-
 
2902
        #   Update BUILDPLATFORMS
-
 
2903
        #
-
 
2904
        @BUILDPLATFORMS = @New_BUILDPLATFORMS;
2888
    }
2905
    }
2889
 
2906
 
2890
    Debug("GeneratePlatformList: Result:@BUILD_ACTIVEPLATFORMS");
2907
    Debug("GeneratePlatformList: Result:@BUILD_ACTIVEPLATFORMS");
2891
    return @BUILD_ACTIVEPLATFORMS;
2908
    return @BUILD_ACTIVEPLATFORMS;
2892
}
2909
}
2893
 
2910
 
2894
#-------------------------------------------------------------------------------
2911
#-------------------------------------------------------------------------------
2895
# Function        : PrintPlatforms
2912
# Function        : PrintPlatforms
2896
#
2913
#
2897
# Description     : Petty print the specified platform list, breaking line
2914
# Description     : Petty print the specified platform list, breaking line
2898
#                   on either a primary key change or length width >78.
2915
#                   on either a primary key change or length width >100.
2899
#
2916
#
-
 
2917
# Inputs          : $list           - Reference to an array
-
 
2918
#                   $nl             - New line stuff.
-
 
2919
#                                     Use to prefix new lines
-
 
2920
#
2900
# Returns         : Formated string
2921
# Returns         : Formatted string
2901
#
2922
#
2902
# Example Output :
2923
# Example Output :
2903
#
2924
#
2904
#           DDU_LMOS_WIN32 DDU_LMOS_linux_armv4 DDU_LMOS_linux_i386
2925
#           DDU_LMOS_WIN32 DDU_LMOS_linux_armv4 DDU_LMOS_linux_i386
2905
#           IDFC_LMOS_WIN32 IDFC_LMOS_linux_armv4 IDFC_LMOS_linux_i386
2926
#           IDFC_LMOS_WIN32 IDFC_LMOS_linux_armv4 IDFC_LMOS_linux_i386
Line 2907... Line 2928...
2907
#           LMOS_linux_i386
2928
#           LMOS_linux_i386
2908
#..
2929
#..
2909
sub PrintPlatforms
2930
sub PrintPlatforms
2910
{
2931
{
2911
    my ($platforms, $nl) = @_;
2932
    my ($platforms, $nl) = @_;
2912
    my ($string) = "";                          # result
2933
    my ($string) = "";
-
 
2934
    my $maxLen = 100 - length($nl);
2913
 
2935
 
2914
    if ( @$platforms )
2936
    if ( @$platforms )
2915
    {
2937
    {
2916
        my ($key_run) = 0;
2938
        my $line = "";
2917
        my ($pkey);                             # previous key
-
 
2918
 
-
 
2919
        #   Perform a simple formatting and determine if there is key 
-
 
2920
        #   change greater then 1 or whether the total length exceeds 78.
-
 
2921
        #
2939
        my $pel = "";
2922
        #   If the line exceeds 78, the printer shall then reformat 
-
 
2923
        #   breaking based on line length and possiblity keys.
-
 
2924
        #
2940
        my $first = 1;
2925
        $pkey = "";
2941
        my $prefix = '';
2926
        for my $k (sort @$platforms) 
2942
        foreach my $k ( sort @$platforms)
2927
        {
2943
        {
2928
            my ($d);                            # delimitor
2944
            my $k2 = substr($k, 0 , 2);
2929
 
-
 
2930
            if (($d = index( $k, '_' )) != index( $pkey, '_' ) ||
-
 
2931
                    substr( $k, 0, $d ) ne substr( $pkey, 0, $d )) {
2945
            if (( $k2 ne $pel  || (length($line) + length ($k) > $maxLen) ) && (!$first)) {
2932
                $key_run = 1
2946
                $string .= $line;
2933
                    if ($key_run <= 1);         # change, reset run if <= 1
-
 
2934
            } else {
2947
                $line = $nl;
2935
                $key_run++;                     # same primary key
2948
                $prefix = '';
2936
            }
2949
            }
2937
 
-
 
2938
            $string .= " " if ($pkey);
2950
            $line .= $prefix . $k;
-
 
2951
            $pel = $k2;
2939
            $string .= $k;
2952
            $first = 0;
2940
            $pkey = $k;
2953
            $prefix = ' ';
2941
        }
2954
        }
2942
 
-
 
2943
        #   Reprint if required.
-
 
2944
        #
-
 
2945
        if (length($nl)+length($string) > 78)
-
 
2946
        {
-
 
2947
            my ($llen);                         # line length
-
 
2948
 
-
 
2949
            $llen = length($nl);
-
 
2950
 
-
 
2951
            $pkey = "";
-
 
2952
            $string = "";
2955
        $string .= $line;
2953
 
-
 
2954
            for my $k (sort @$platforms)
-
 
2955
            {
-
 
2956
                my ($klen, $d);                 # key length, delimitor
-
 
2957
 
-
 
2958
                $klen = length($k);
-
 
2959
                if ($pkey ne "")
-
 
2960
                {
-
 
2961
                    if ($llen + $klen > 78 ||
-
 
2962
                        ($key_run > 1 && (
-
 
2963
                            ($d = index( $k, '_' )) != index( $pkey, '_' ) ||
-
 
2964
                            substr( $k, 0, $d ) ne substr( $pkey, 0, $d ) )) )
-
 
2965
                    {                           # line >70 or key change
-
 
2966
                        $string .= $nl;
-
 
2967
                        $llen = length($nl);
-
 
2968
                    }
-
 
2969
                    else
-
 
2970
                    {
-
 
2971
                        $string .= " ";
-
 
2972
                        $llen++;
-
 
2973
                    }
-
 
2974
                }
-
 
2975
                $string .= $k;
-
 
2976
                $pkey = $k;
-
 
2977
                $llen += $klen;
-
 
2978
            }
-
 
2979
        }    
-
 
2980
    }
2956
    }
2981
    return $string;
2957
    return $string;
2982
}
2958
}
2983
#-------------------------------------------------------------------------------
2959
#-------------------------------------------------------------------------------
2984
# Function        : PrintList
2960
# Function        : PrintList
Line 2992... Line 2968...
2992
#
2968
#
2993
# Returns         : string
2969
# Returns         : string
2994
#
2970
#
2995
sub PrintList
2971
sub PrintList
2996
{
2972
{
2997
    my ($list, $nl) = @_;
2973
    my ($platforms, $nl) = @_;
2998
    my ($string) = '';                          # result
2974
    my ($string) = "";
2999
    my $sep;
2975
    my $maxLen = 100 - length($nl);
3000
 
2976
 
3001
    if ( @$list )
2977
    if ( @$platforms )
3002
    {
2978
    {
3003
        my ($llen) = length($nl);
2979
        my $line = "";
3004
 
-
 
3005
        for my $k (@$list)
2980
        my $first = 1;
3006
        {
-
 
3007
            my $klen = length($k);
2981
        my $prefix = '';
3008
            if ($llen + $klen > 78 )
2982
        foreach my $k ( sort @$platforms)
3009
            {
2983
        {
3010
                $string .= $nl;
-
 
3011
                $llen = length($nl);
2984
            if ((length($line) + length ($k) > $maxLen) && (!$first)) {
3012
            }
-
 
3013
            else
-
 
3014
            {
-
 
3015
                if ( $sep )
-
 
3016
                {
-
 
3017
                    $string .= $sep;
2985
                $string .= $line;
3018
                    $llen++;
2986
                $line = $nl;
3019
                }
-
 
3020
                else
2987
                $prefix = '';
3021
                {
2988
            }
3022
                    $sep = ' ';
2989
            $line .= $prefix . $k;
3023
                }
-
 
3024
            }
-
 
3025
            $string .= $k;
2990
            $first = 0;
3026
            $llen += $klen;
2991
            $prefix = ' ';
3027
        }
2992
        }
-
 
2993
        $string .= $line;
3028
    }
2994
    }
3029
    return $string;
2995
    return $string;
3030
}
2996
}
3031
 
2997
 
3032
#-------------------------------------------------------------------------------
2998
#-------------------------------------------------------------------------------
Line 3305... Line 3271...
3305
#
3271
#
3306
sub StartBuildPhase
3272
sub StartBuildPhase
3307
{
3273
{
3308
    my ($last) = @_;
3274
    my ($last) = @_;
3309
 
3275
 
-
 
3276
 
3310
    #
3277
    #
3311
    #   Ensure directive is allowed
3278
    #   Ensure directive is allowed
3312
    #       $BUILDPHASE >  1     - No more directives allowed
3279
    #       $BUILDPHASE >  1     - No more directives allowed
3313
    #       $BUILDPHASE == 1     - Allowed directive
3280
    #       $BUILDPHASE == 1     - Allowed directive
3314
    #
3281
    #
Line 3340... Line 3307...
3340
    #
3307
    #
3341
    #   Calculate defined aliases
3308
    #   Calculate defined aliases
3342
    #       Limit the Aliases to active platforms
3309
    #       Limit the Aliases to active platforms
3343
    #       ie: NATIVE INSTRUMENT PKG_WIN PKG_RPM PKG_DEB SK
3310
    #       ie: NATIVE INSTRUMENT PKG_WIN PKG_RPM PKG_DEB SK
3344
    #
3311
    #
-
 
3312
    my %activePlatformMap;
-
 
3313
#    foreach my $item (@BUILD_ACTIVEPLATFORMS) {
-
 
3314
    foreach my $item ( keys %BUILDINFO) {
-
 
3315
           my $pInfo = $BUILDINFO{$item};
-
 
3316
           next if $pInfo->{NOT_AVAILABLE} > 1; 
-
 
3317
           push @{$activePlatformMap{$pInfo->{TARGET}}}, $item;
-
 
3318
    }
-
 
3319
 
3345
    foreach my $alias ( @PlatformConfig::BuildAliases )
3320
    foreach my $alias ( @PlatformConfig::BuildAliases )
3346
    {
3321
    {
3347
        if (exists $BUILDALIAS{$alias}) 
3322
        if (exists $BUILDALIAS{$alias})  
3348
        {
3323
        {
3349
            # Will occur if GBE_ABT has been set, for backward compatibility
3324
            # Will occur if GBE_ABT has been set, for backward compatibility
3350
            Warning("User has manually specified a $alias alias",'Default alias will not be set.');
3325
            Warning("User has manually specified a $alias alias",'Default alias will not be set.');
-
 
3326
            #DebugDumpData("BUILDALIAS", \%BUILDALIAS);
3351
        }
3327
        }
3352
        else
3328
        else
3353
        {
3329
        {
3354
            my %activePlatformMap;
-
 
3355
            foreach my $item (@BUILD_ACTIVEPLATFORMS) {
-
 
3356
                    $activePlatformMap{$item} = $item;
-
 
3357
            }
-
 
3358
            
-
 
3359
            my @activeAliases;
3330
            my @activeAliases;
3360
            foreach my $item (PlatformConfig::getTargetsByTag($alias)) {
3331
            foreach my $item (PlatformConfig::getTargetsByTag($alias)) {
-
 
3332
                if (exists($activePlatformMap{$item})) {
3361
                push (@activeAliases, $activePlatformMap{$item}) if exists($activePlatformMap{$item});
3333
                    push (@activeAliases, @{$activePlatformMap{$item}});
-
 
3334
                }
3362
            }
3335
            }
-
 
3336
 
3363
            $BUILDALIAS{$alias} = join(' ', @activeAliases) if (@activeAliases);
3337
            $BUILDALIAS{$alias} = join(' ', @activeAliases) if (@activeAliases);
3364
 
3338
 
3365
            #
3339
            #
3366
            #   Add to the build entry too
3340
            #   Add to the build entry too
3367
            #
3341
            #
3368
            foreach my $aliasTarget (@activeAliases)
3342
            foreach my $aliasTarget (@activeAliases) {
3369
            {
-
 
3370
                push @{$BUILDINFO{$aliasTarget}{USERALIAS}}, $alias;
3343
                push @{$BUILDINFO{$aliasTarget}{USERALIAS}}, $alias;
3371
            }
3344
            }
3372
        }
3345
        }
3373
    }
3346
    }
3374
    CleanUp_Aliases();
3347
    CleanUp_Aliases();
Line 3477... Line 3450...
3477
        }
3450
        }
3478
 
3451
 
3479
        #
3452
        #
3480
        #   See if the dependencies have changed
3453
        #   See if the dependencies have changed
3481
        #   
3454
        #   
3482
        my $BuildpkgSig = Digest::SHA->new;
3455
        my $BuildpkgSig = Digest::SHA::PurePerl->new;
3483
        $BuildpkgSig->add("PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX");
3456
        $BuildpkgSig->add("PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX");
3484
 
3457
 
3485
        #
3458
        #
3486
        #   Include the signature of ALL dependent packages
3459
        #   Include the signature of ALL dependent packages
3487
        #   Ie: The build fingerprint is a function of the source and its dependents
3460
        #   Ie: The build fingerprint is a function of the source and its dependents
Line 3970... Line 3943...
3970
 
3943
 
3971
    #
3944
    #
3972
    #   Start generating the signature
3945
    #   Start generating the signature
3973
    #       Include the package Name,Version and Project
3946
    #       Include the package Name,Version and Project
3974
    #
3947
    #
3975
    $BuildSignatureSha1 = Digest::SHA->new;
3948
    $BuildSignatureSha1 = Digest::SHA::PurePerl->new;
3976
    $BuildSignatureSha1->add("PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX");
3949
    $BuildSignatureSha1->add("PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX");
3977
    push @sigList, "PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX: " . $BuildSignatureSha1->clone->hexdigest;
3950
    push @sigList, "PKGNAME: $BUILDNAME_PACKAGE $BUILDNAME_VERSION $BUILDNAME_SUFFIX: " . $BuildSignatureSha1->clone->hexdigest;
3978
 
3951
 
3979
    #
3952
    #
3980
    #   Include the signature of ALL dependent packages
3953
    #   Include the signature of ALL dependent packages
Line 4529... Line 4502...
4529
#   Contains per platform options extracted from alias and platform args
4502
#   Contains per platform options extracted from alias and platform args
4530
#
4503
#
4531
    my %ScmBuildPlatforms;
4504
    my %ScmBuildPlatforms;
4532
    foreach my $key ( @platforms_merged ) {
4505
    foreach my $key ( @platforms_merged ) {
4533
 
4506
 
-
 
4507
        my $pInfo = $BUILDINFO{$key};
-
 
4508
        next if ($pInfo->{NOT_AVAILABLE});
-
 
4509
 
4534
        my( @arguments ) = ();
4510
        my( @arguments ) = ();
4535
        UniquePush( \@arguments, split( /$;/, $BUILDPLATFORMARGS{ $key } ))
4511
        UniquePush( \@arguments, split( /$;/, $BUILDPLATFORMARGS{ $key } ))
4536
            if ( exists $BUILDPLATFORMARGS{ $key } );
4512
            if ( exists $BUILDPLATFORMARGS{ $key } );
4537
 
4513
 
4538
        UniquePush( \@arguments, split( /$;/, $platform_args{ $key } ))
4514
        UniquePush( \@arguments, split( /$;/, $platform_args{ $key } ))
Line 4543... Line 4519...
4543
 
4519
 
4544
    $fh->DumpData(
4520
    $fh->DumpData(
4545
        "# Platform and global argument list.\n#\n",
4521
        "# Platform and global argument list.\n#\n",
4546
        "ScmBuildPlatforms", \%ScmBuildPlatforms );
4522
        "ScmBuildPlatforms", \%ScmBuildPlatforms );
4547
 
4523
 
-
 
4524
#.. Create ScmBuildMatrix
-
 
4525
#   Contains information on all the platforms that the package builds for and target machines
-
 
4526
#   
-
 
4527
    my %ScmBuildMatrix;
-
 
4528
    foreach my $key ( keys %BUILDINFO ) {
-
 
4529
        my $pInfo = $BUILDINFO{$key};
-
 
4530
        next if exists ($pInfo->{BADNAME});
-
 
4531
        next if ($pInfo->{NOT_AVAILABLE} > 1);
-
 
4532
        Error ("Internal: No MACHTYPE provided for $key") unless exists $pInfo->{MACHTYPE};
-
 
4533
        $ScmBuildMatrix{$key} = $pInfo->{MACHTYPE};
-
 
4534
    }
-
 
4535
 
-
 
4536
    $fh->DumpData(
-
 
4537
        "# Build Matrix.\n#\n",
-
 
4538
        "ScmBuildMatrix", \%ScmBuildMatrix );
4548
 
4539
 
4549
# .. Create BuildPkgRules
4540
# .. Create BuildPkgRules
4550
#
4541
#
4551
#    This is most of the information contained within %PKGRULES, which
4542
#    This is most of the information contained within %PKGRULES, which
4552
#    requires additional processing within makelib.
4543
#    requires additional processing within makelib.