Subversion Repositories DevTools

Rev

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

Rev 6619 Rev 6684
Line 89... Line 89...
89
our $BUILDPHASE             = 0;                # In Build Phase
89
our $BUILDPHASE             = 0;                # In Build Phase
90
our @CLOBBERDIRS            = ();               # Directories to clobber
90
our @CLOBBERDIRS            = ();               # Directories to clobber
91
our @REMOVEDIRS             = ();               # Directories to remove - if empty
91
our @REMOVEDIRS             = ();               # Directories to remove - if empty
92
our %BUILD_KNOWNFILES       = ();               # Files that will be known
92
our %BUILD_KNOWNFILES       = ();               # Files that will be known
93
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
93
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
94
our @BUILDARGUMENTS         = ();               # Build Atguments
94
our @BUILDARGUMENTS         = ();               # Build Arguments
-
 
95
our @LINKPKGEXLUDES         = ();               # LinkPkgExclude arguments
95
 
96
 
96
our $Makelib                = "";
97
our $Makelib                = "";
97
our $GBE_CORE;                                  # Root of JATS
98
our $GBE_CORE;                                  # Root of JATS
98
our $InterfaceVersion;                          # Interface directory format version
99
our $InterfaceVersion;                          # Interface directory format version
99
our $ScmRoot;                                   # Package Root
100
our $ScmRoot;                                   # Package Root
Line 2473... Line 2474...
2473
        }
2474
        }
2474
    }
2475
    }
2475
}
2476
}
2476
 
2477
 
2477
#-------------------------------------------------------------------------------
2478
#-------------------------------------------------------------------------------
-
 
2479
# Function        : LinkPkgExclude 
-
 
2480
#
-
 
2481
# Description     : Mark a package to be excluded / included for a specific build
-
 
2482
#                   Intended use:
-
 
2483
#                       Recover from really (reaaly) badly constructed packages
-
 
2484
#                       
-
 
2485
#                   Essentially this directive will 'Exclude' packages from the
-
 
2486
#                   a specific build target (platform) by removing it from data
-
 
2487
#                   structures that are exported to the make stage
-
 
2488
#                   
-
 
2489
#                   Process ONLY works for LinkPkgArchive packages
-
 
2490
#
-
 
2491
# Inputs          : platform-selector   - A JATS style platform specifier
-
 
2492
#                   package-list        - one or or packages to process
-
 
2493
#                   
-
 
2494
# Example         : LinkPkgExclude('!SK100', 'PulseSdk');
-
 
2495
#                   LinkPkgExclude('SK100' , 'crypto');
-
 
2496
#
-
 
2497
sub LinkPkgExclude
-
 
2498
{
-
 
2499
    DataDirective('LinkPkgExclude');
-
 
2500
    Error("LinkPkgExclude(@_) requires at least two arguments") unless ((scalar @_) >= 2);
-
 
2501
    #
-
 
2502
    #   Simply save the arguments for later processing
-
 
2503
    #
-
 
2504
    push @LINKPKGEXLUDES, join($;, @_);
-
 
2505
}
-
 
2506
 
-
 
2507
#-------------------------------------------------------------------------------
-
 
2508
# Function        : ProcessLinkPkgExclude 
-
 
2509
#
-
 
2510
# Description     : INTERNAL Function
-
 
2511
#                   Process the data collected by the LinkPkgExclude directives  
-
 
2512
#
-
 
2513
# Inputs          : None
-
 
2514
#                   Uses: LINKPKGEXLUDES    
-
 
2515
#
-
 
2516
# Returns         : Will modify interal classes and data structures
-
 
2517
#
-
 
2518
sub ProcessLinkPkgExclude
-
 
2519
{
-
 
2520
    my @unknownPlatforms;
-
 
2521
    my @unknownPkg;
-
 
2522
    my @notLinkPkg;
-
 
2523
 
-
 
2524
    #
-
 
2525
    #   Create a hash of known platforms - detect and report bad user input
-
 
2526
    #
-
 
2527
    my %fullPlatformList =  map { $_ => 1 } @BUILDPLATFORMS;
-
 
2528
 
-
 
2529
    #
-
 
2530
    #   Process each directive
-
 
2531
    #
-
 
2532
    foreach ( @LINKPKGEXLUDES )
-
 
2533
    {
-
 
2534
        my (@add, @remove);
-
 
2535
        my ($pSel, @pkgList) = split($;, $_);
-
 
2536
        Log("LinkPkgExclude $pSel, @pkgList");
-
 
2537
 
-
 
2538
 
-
 
2539
        #
-
 
2540
        #   Process the selector in the same manor as makefiles
-
 
2541
        #       Need the selector to be active
-
 
2542
        #       Selector may be an alias or a platform
-
 
2543
        #       Selector may be negated
-
 
2544
        #       Selectors are comma seperated
-
 
2545
        #       Additive elements are processed before subtactive elements
-
 
2546
        #           
-
 
2547
        my @pItems = split(/\s*,\s*/, $pSel);
-
 
2548
        @pItems = ExpandPlatforms( @pItems );
-
 
2549
 
-
 
2550
         foreach my $platform ( @pItems) {
-
 
2551
             my $pname = $platform;
-
 
2552
             my $invert;
-
 
2553
 
-
 
2554
             if (substr($platform, 0, 1) eq '!') {
-
 
2555
                 $invert = 1;
-
 
2556
                 $pname = substr($platform, 1)
-
 
2557
                 }
-
 
2558
 
-
 
2559
             unless (exists($fullPlatformList{$pname})) {
-
 
2560
                 UniquePush(\@unknownPlatforms, $pname);
-
 
2561
                 next;
-
 
2562
                 }
-
 
2563
 
-
 
2564
             if ( $invert )  {
-
 
2565
                 push @remove, $pname; 
-
 
2566
             } else {
-
 
2567
                 push @add, $pname; 
-
 
2568
             }
-
 
2569
         }
-
 
2570
 
-
 
2571
         #
-
 
2572
         #   Build complete list of allowed platforms
-
 
2573
         #       Process additive rules before removal rules
-
 
2574
         #       If there are no additive rules, then assume all protaforms
-
 
2575
         #
-
 
2576
         my %calcList;
-
 
2577
         @add = @BUILDPLATFORMS unless @add;
-
 
2578
         $calcList{uc $_} = 1 foreach (@add);
-
 
2579
         delete $calcList{uc $_} foreach (@remove);
-
 
2580
         Verbose2("LinkPkgExclude ", keys %calcList,",", @pkgList);
-
 
2581
 
-
 
2582
         #
-
 
2583
         #  Now have a list of platforms to process (exclude)
-
 
2584
         #  Now have a list of packages to exclude
-
 
2585
         #
-
 
2586
         #  Iterate over the package rules and mark those to be excluded
-
 
2587
         #
-
 
2588
         foreach my $platform ( keys %calcList )
-
 
2589
         {
-
 
2590
             unless (exists($PKGRULES{$platform})) {
-
 
2591
                 next;
-
 
2592
             }
-
 
2593
 
-
 
2594
             foreach my $ePackage (@pkgList) {
-
 
2595
                 my $pkgFound;
-
 
2596
                 foreach my $package ( @{$PKGRULES{$platform}} )
-
 
2597
                 {
-
 
2598
                     my $fname = $package->{'dname'};
-
 
2599
                     if ( $package->{'dproj'}) {
-
 
2600
                         $fname .= '.' . $package->{'dproj'};
-
 
2601
                     }
-
 
2602
 
-
 
2603
                     if ( $ePackage eq $package->{'dname'}  || $ePackage eq $fname) {
-
 
2604
                         $pkgFound = 1;
-
 
2605
 
-
 
2606
                         if ($package->{'type'} ne 'link') {
-
 
2607
                             UniquePush(\@notLinkPkg, $ePackage);
-
 
2608
                             last;
-
 
2609
                         }
-
 
2610
 
-
 
2611
                         $package->{'EXCLUDE'} = 1;
-
 
2612
                         Debug("Exclude", $platform, $fname );
-
 
2613
                         last;
-
 
2614
                     }
-
 
2615
                 }
-
 
2616
                 UniquePush(\@unknownPkg, $ePackage) unless $pkgFound;
-
 
2617
             }
-
 
2618
         }
-
 
2619
   }
-
 
2620
 
-
 
2621
    ReportError("LinkPkgExclude. Unknown platforms:", @unknownPlatforms) if @unknownPlatforms;
-
 
2622
    ReportError("LinkPkgExclude. Unknown packages:", @unknownPkg) if @unknownPkg;
-
 
2623
    ReportError("LinkPkgExclude. BuildPkgArchive not allowed for:", @notLinkPkg) if @notLinkPkg;
-
 
2624
    ErrorDoExit();
-
 
2625
}
-
 
2626
 
-
 
2627
#-------------------------------------------------------------------------------
2478
# Function        : CreateInterfacePackage
2628
# Function        : CreateInterfacePackage
2479
#
2629
#
2480
# Description     : Create a dummy package entry to describe the Interface
2630
# Description     : Create a dummy package entry to describe the Interface
2481
#                   This is done AFTER all the BuildPkgArchive directives have
2631
#                   This is done AFTER all the BuildPkgArchive directives have
2482
#                   been processed so that the interface directory is fully
2632
#                   been processed so that the interface directory is fully
Line 3213... Line 3363...
3213
            }
3363
            }
3214
        }
3364
        }
3215
    }
3365
    }
3216
    CleanUp_Aliases();
3366
    CleanUp_Aliases();
3217
    ProcessBuildArgument();
3367
    ProcessBuildArgument();
-
 
3368
    ProcessLinkPkgExclude();
3218
 
3369
 
3219
    #
3370
    #
3220
    #   Create dummy package to describe the Interface directory
3371
    #   Create dummy package to describe the Interface directory
3221
    #
3372
    #
3222
    CreateInterfacePackage();
3373
    CreateInterfacePackage();
Line 4113... Line 4264...
4113
    my %ScmBuildPkgRules;
4264
    my %ScmBuildPkgRules;
4114
    foreach my $platform ( keys %PKGRULES )
4265
    foreach my $platform ( keys %PKGRULES )
4115
    {
4266
    {
4116
        foreach my $package ( @{$PKGRULES{$platform}} )
4267
        foreach my $package ( @{$PKGRULES{$platform}} )
4117
        {
4268
        {
-
 
4269
            next if exists $package->{'EXCLUDE'};
4118
            my %entry;
4270
            my %entry;
4119
 
4271
 
4120
            $entry{ROOT}     = TruePath( $package->{'base'} );
4272
            $entry{ROOT}     = TruePath( $package->{'base'} );
4121
            $entry{NAME}     = $package->{'name'};
4273
            $entry{NAME}     = $package->{'name'};
4122
            $entry{VERSION}  = $package->{'version'};
4274
            $entry{VERSION}  = $package->{'version'};