Subversion Repositories DevTools

Rev

Rev 7322 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7322 Rev 7323
Line 47... Line 47...
47
our $Clobber                = 0;
47
our $Clobber                = 0;
48
our $Archive                = 0;
48
our $Archive                = 0;
49
our $Interface              = 0;
49
our $Interface              = 0;
50
our $RootOnly               = 0;
50
our $RootOnly               = 0;
51
our $SignatureOnly          = 0;
51
our $SignatureOnly          = 0;
52
our $Perms                  = 0;
52
our $BuildInfo              = 0;
-
 
53
our $BuildInfoFile          = 'BuildInfo.properties';
53
our $Expert                 = 0;
54
our $Expert                 = 0;
54
our $All                    = 0;
55
our $All                    = 0;
55
our $Cache                  = $ENV{GBE_DPKG_CACHE_CTL} || 0;
56
our $Cache                  = $ENV{GBE_DPKG_CACHE_CTL} || 0;
56
our $NoPackageError         = 0;
57
our $NoPackageError         = 0;
57
our $ForceBuildPkg          = 0;
58
our $ForceBuildPkg          = 0;
Line 102... Line 103...
102
our $BUILDPHASE             = 0;                # In Build Phase
103
our $BUILDPHASE             = 0;                # In Build Phase
103
our @CLOBBERDIRS            = ();               # Directories to clobber
104
our @CLOBBERDIRS            = ();               # Directories to clobber
104
our @REMOVEDIRS             = ();               # Directories to remove - if empty
105
our @REMOVEDIRS             = ();               # Directories to remove - if empty
105
our %BUILD_KNOWNFILES       = ();               # Files that will be known
106
our %BUILD_KNOWNFILES       = ();               # Files that will be known
106
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
107
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
107
our @BUILDARGUMENTS         = ();               # Build Atguments
108
our @BUILDARGUMENTS         = ();               # Build Arguments
-
 
109
our @LINKPKGEXLUDES         = ();               # LinkPkgExclude arguments
108
 
110
 
109
our $Makelib                = "";
111
our $Makelib                = "";
110
our $GBE_CORE;                                  # Root of JATS
112
our $GBE_CORE;                                  # Root of JATS
111
our $InterfaceVersion;                          # Interface directory format version
113
our $InterfaceVersion;                          # Interface directory format version
112
our $ScmRoot;                                   # Package Root
114
our $ScmRoot;                                   # Package Root
Line 119... Line 121...
119
my  $build_source_pkg       = 0;                # Flag to build source package
121
my  $build_source_pkg       = 0;                # Flag to build source package
120
my  $opt_help               = 0;
122
my  $opt_help               = 0;
121
my  $opt_localCache         = 0;                # Create cache within the interface directory
123
my  $opt_localCache         = 0;                # Create cache within the interface directory
122
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
124
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
123
 
125
 
-
 
126
my  $toolsetData;                               # Parsed toolset data
124
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
127
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
125
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
128
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
126
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
129
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
127
my  @genToolsetArgs;                            # Args for a generated TOOLSET
130
my  @genToolsetArgs;                            # Args for a generated TOOLSET
128
my  $descpkgPath;                               # Path to the dscpkg file
131
my  $descpkgPath;                               # Path to the dscpkg file
Line 142... Line 145...
142
    EnvImport( 'GBE_CONFIG' );
145
    EnvImport( 'GBE_CONFIG' );
143
    EnvImport( 'GBE_DPKG' );
146
    EnvImport( 'GBE_DPKG' );
144
    EnvImport( 'GBE_MACHTYPE' );
147
    EnvImport( 'GBE_MACHTYPE' );
145
    EnvImport( 'USER' );
148
    EnvImport( 'USER' );
146
    EnvImport( 'GBE_HOSTNAME');
149
    EnvImport( 'GBE_HOSTNAME');
147
    EnvImport( 'GBE_DRV' )
-
 
148
        if ( $ScmHost ne 'Unix' );            # DOS or WIN special
150
    EnvImport( 'GBE_DRV' ) if ( $ScmHost ne 'Unix' );   # DOS or WIN special
149
 
151
 
150
    EnvImportOptional ( 'GBE_DPKG_ESCROW','' );
152
    EnvImportOptional ( 'GBE_DPKG_ESCROW','' );
151
    EnvImportOptional ( 'GBE_DPKG_REPLICA','' );
153
    EnvImportOptional ( 'GBE_DPKG_REPLICA','' );
152
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
154
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
153
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
155
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
154
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
156
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
155
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
157
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
156
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
158
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
157
    EnvImportOptional ( 'GBE_SANDBOX'   ,'' );
159
    EnvImportOptional ( 'GBE_SANDBOX'   ,'' );
158
 
160
 
159
    EnvImportOptional ( 'GBE_PLATFORM' );           # optional PLATFORM filter
161
    EnvImportOptional ( 'GBE_PLATFORM' );               # optional PLATFORM filter
160
    EnvImportOptional ( 'GBE_BUILDFILTER' );        # optional BUILD filter       
162
    EnvImportOptional ( 'GBE_BUILDFILTER' );            # optional BUILD filter       
161
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
163
    EnvImportOptional ( 'GBE_ABT' );                    # optional ABT flags          
162
    
164
    
163
#.. Common stuff
165
#.. Common stuff
164
#
166
#
165
    require "$::GBE_TOOLS/common.pl";
167
    require "$::GBE_TOOLS/common.pl";
166
    CommonInit( 'buildlib' );
168
    CommonInit( 'buildlib' );
Line 186... Line 188...
186
                             "nopackages"    => \$IgnorePkgs,
188
                             "nopackages"    => \$IgnorePkgs,
187
                             "forcebuildpkg" => \$ForceBuildPkg,
189
                             "forcebuildpkg" => \$ForceBuildPkg,
188
                             "force!"        => \$ForceBuild,
190
                             "force!"        => \$ForceBuild,
189
                             "generic!"      => \$GenericBuild,
191
                             "generic!"      => \$GenericBuild,
190
                             "localcache!"   => \$opt_localCache,
192
                             "localcache!"   => \$opt_localCache,
-
 
193
                             "buildinfo:s"   => \$BuildInfoFile,
191
                             "signature:s"   => \$CheckSignature,
194
                             "signature:s"   => \$CheckSignature,
192
                             );
195
                             );
193
    Usage() if ( $opt_help || !$result );
196
    Usage() if ( $opt_help || !$result );
194
 
197
 
195
    Debug( "Host:          ", $ScmHost );
198
    Debug( "Host:          ", $ScmHost );
Line 224... Line 227...
224
            $RootOnly       = 1;
227
            $RootOnly       = 1;
225
 
228
 
226
        } elsif ( $CmdSwitch eq "clobber" ) {
229
        } elsif ( $CmdSwitch eq "clobber" ) {
227
            $Clobber        = 1;
230
            $Clobber        = 1;
228
 
231
 
-
 
232
        } elsif ( $CmdSwitch eq "buildinfo" ) {
-
 
233
            $BuildInfo      = 1;
-
 
234
            $Interface      = 1;
-
 
235
            unlink $BuildInfoFile;
-
 
236
 
229
        } elsif ( $CmdSwitch eq "signature" ) {
237
        } elsif ( $CmdSwitch eq "signature" ) {
230
            $SignatureOnly  = 1;
238
            $SignatureOnly  = 1;
231
            $Interface      = 1;
239
            $Interface      = 1;
232
            $IgnorePkgs     = 1;
240
            $IgnorePkgs     = 1;
233
 
241
 
Line 283... Line 291...
283
sub Log
291
sub Log
284
{
292
{
285
    if ( ! $Clobber )
293
    if ( ! $Clobber )
286
    {
294
    {
287
        print "@_\n";
295
        print "@_\n";
288
        FileAppend ('build.log', \@_ );
296
        FileAppend ('build.log', \@_ ) unless $BuildInfo;
289
    }
297
    }
290
}
298
}
291
 
299
 
292
#-------------------------------------------------------------------------------
300
#-------------------------------------------------------------------------------
293
# Function        : BuildSubDir
301
# Function        : BuildSubDir
Line 1022... Line 1030...
1022
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC}  )
1030
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC}  )
1023
    {
1031
    {
1024
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
1032
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
1025
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
1033
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
1026
        {
1034
        {
1027
            UniquePush (\@BUILD_BADNAME, $target ); 
1035
            UniquePush (\@BUILD_BADNAME, $target ) unless ($target eq 'NOBUILD'); 
1028
            $pInfo->{NOT_AVAILABLE} = 3;
1036
            $pInfo->{NOT_AVAILABLE} = 3;
1029
            $pInfo->{BADNAME} = 1;
1037
            $pInfo->{BADNAME} = 1;
1030
        }
1038
        }
1031
    }
1039
    }
1032
 
1040
 
Line 1419... Line 1427...
1419
# Returns         : 
1427
# Returns         : 
1420
#
1428
#
1421
sub BuildToolset
1429
sub BuildToolset
1422
{
1430
{
1423
    my( @arguments ) = @_;
1431
    my( @arguments ) = @_;
1424
    my ($exclude, $include, $including);
-
 
1425
 
1432
 
1426
    $genToolsetPlatform = 1;
1433
    $genToolsetPlatform = 1;
1427
    Debug( "BuildToolset(@arguments)" );
1434
    Debug( "BuildToolset(@arguments)" );
1428
    Error( "BuildToolset must appear before BuildName()..." )
1435
    Error( "BuildToolset must appear before BuildName()..." )
1429
        if ( $BUILDNAME ne "" );
1436
        if ( $BUILDNAME ne "" );
Line 1431... Line 1438...
1431
    #
1438
    #
1432
    #   Process TOOLSET specific options
1439
    #   Process TOOLSET specific options
1433
    #       --ExcludeMachType=xxxx,yyy
1440
    #       --ExcludeMachType=xxxx,yyy
1434
    #       --MachType=xxxx,yyy
1441
    #       --MachType=xxxx,yyy
1435
    #
1442
    #
-
 
1443
    $toolsetData->{enableToolset} = 1;
1436
    foreach ( @arguments )
1444
    foreach ( @arguments )
1437
    {
1445
    {
1438
        if ( m~^--ExcludeMachType=(.+)~i ) {
1446
        if ( m~^--ExcludeMachType=(.+)~i ) {
1439
            foreach my $arch (split(',',$1))
1447
            foreach my $arch (split(',',$1))
1440
            {
1448
            {
-
 
1449
                ReportError("BuildToolset: Unknown MachType: $arch") unless PlatformConfig::validMachType($arch);
-
 
1450
                $toolsetData->{exclude}{lc $arch} = 1;
1441
                if (uc($arch) eq uc($::GBE_MACHTYPE))
1451
                if (lc($arch) eq lc($::GBE_MACHTYPE))
1442
                {
1452
                {
1443
                    Verbose("Exclude TOOLSET on this machine");
1453
                    Verbose("Exclude TOOLSET on this machine");
1444
                    $exclude = 1;
1454
                    $toolsetData->{excludeThis} = lc($arch);
1445
                    last;
-
 
1446
                }
1455
                }
1447
            }
1456
            }
1448
        } elsif ( m~^--MachType=(.+)~i ) {
1457
        } elsif ( m~^--MachType=(.+)~i ) {
1449
            $including = 1;
-
 
1450
            foreach my $arch (split(',',$1))
1458
            foreach my $arch (split(',',$1))
1451
            {
1459
            {
-
 
1460
                ReportError("BuildToolset: Unknown MachType: $arch") unless PlatformConfig::validMachType($arch);
-
 
1461
                $toolsetData->{include}{lc $arch} = 1;
1452
                if (uc($arch) eq uc($::GBE_MACHTYPE))
1462
                if (lc($arch) eq lc($::GBE_MACHTYPE))
1453
                {
1463
                {
1454
                    Verbose("Include TOOLSET on this machine");
1464
                    Verbose("Include TOOLSET on this machine");
1455
                    $include = 1;
1465
                    $toolsetData->{includeThis} = lc($arch);
1456
                    last;
-
 
1457
                }
1466
                }
1458
            }
1467
            }
1459
 
1468
 
1460
        } else {
1469
        } else {
1461
            Error ("BuildToolset: Unknown option: $_");
1470
            ReportError ("BuildToolset: Unknown option: $_");
1462
        }
1471
        }
1463
    }
1472
    }
1464
 
1473
 
-
 
1474
    if ( exists $toolsetData->{exclude} && exists $toolsetData->{include}) {
-
 
1475
        ReportError ("BuildToolset: Cannot use both --MachType and --ExcludeMachType");
-
 
1476
    }
-
 
1477
    ErrorDoExit();
-
 
1478
 
1465
    #
1479
    #
1466
    #   Show we build for this architecture
1480
    #   Show we build for this architecture
-
 
1481
    #   Have three conditions:
-
 
1482
    #       1) Current machType specifically excluded
-
 
1483
    #       2) Current machtype specifically included
-
 
1484
    #       3) Neither - further processing required
1467
    #
1485
    #
1468
    $genToolsetActive = 0;
1486
    $genToolsetActive = 0;
1469
    if ($exclude) {
1487
    if (exists $toolsetData->{excludeThis}) {
1470
        $toolsetPlatform = 'Excluded';
1488
        $toolsetPlatform = 'Excluded';
1471
        return;
1489
        return;
1472
    }
1490
    }
1473
 
1491
 
1474
    if ($including) {
1492
    if (exists $toolsetData->{include}) {
1475
        if ($include) {
1493
        if (exists $toolsetData->{includeThis}) {
1476
            $genToolsetActive = 1;
1494
            $genToolsetActive = 1;
1477
        } else {
1495
        } else {
1478
            $toolsetPlatform = 'Not included';
1496
            $toolsetPlatform = 'Not included';
1479
        }
1497
        }
1480
        return;
1498
        return;
Line 1555... Line 1573...
1555
    #
1573
    #
1556
    #   Clobber processing done after values have been accumulated
1574
    #   Clobber processing done after values have been accumulated
1557
    #   as they may be used later
1575
    #   as they may be used later
1558
    #
1576
    #
1559
    return if ( $Clobber );
1577
    return if ( $Clobber );
1560
    ToolsetFiles::AddFile('build.log');
1578
    ToolsetFiles::AddFile('build.log') unless ($BuildInfo);
1561
    
1579
    
1562
#.. Create build.log summary information
1580
#.. Create build.log summary information
1563
#
1581
#
1564
    my ($sep) = "\n".(" " x 11) . ". ";
1582
    my ($sep) = "\n".(" " x 11) . ". ";
1565
 
1583
 
Line 1573... Line 1591...
1573
    Log( "DateTime ... $::CurrentTime" );
1591
    Log( "DateTime ... $::CurrentTime" );
1574
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1592
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1575
    Log( "Build dir... $CwdFull" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1593
    Log( "Build dir... $CwdFull" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1576
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
1594
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
1577
    Log( "Build Cmd .. $CmdSwitch") if $CmdSwitch;
1595
    Log( "Build Cmd .. $CmdSwitch") if $CmdSwitch;
-
 
1596
    Log( "Build Info . $BuildInfoFile") if $BuildInfo;
1578
 
1597
 
1579
    Log( "PERL ....... $::GBE_PERL" );
1598
    Log( "PERL ....... $::GBE_PERL" );
1580
    Log( "BIN  ....... $::GBE_BIN" );
1599
    Log( "BIN  ....... $::GBE_BIN" );
1581
    Log( "TOOLS ...... $::GBE_TOOLS" );
1600
    Log( "TOOLS ...... $::GBE_TOOLS" );
1582
    Log( "CONFIG ..... $::GBE_CONFIG" );
1601
    Log( "CONFIG ..... $::GBE_CONFIG" );
Line 1606... Line 1625...
1606
 
1625
 
1607
    #
1626
    #
1608
    #   Detect a mix of Generic and non Generic targets
1627
    #   Detect a mix of Generic and non Generic targets
1609
    #       Cannot mix generic and non-generic targets
1628
    #       Cannot mix generic and non-generic targets
1610
    #
1629
    #
1611
    if ($#GENERIC_TARGETS >= 0 && $#BUILD_ACTIVEPLATFORMS >= 0)
1630
    if ($#GENERIC_TARGETS >= 0 && $#BUILDPLATFORMS >= 0)
1612
    {
1631
    {
1613
        if ($#BUILD_ACTIVEPLATFORMS != $#GENERIC_TARGETS )
1632
        if ($#BUILDPLATFORMS != $#GENERIC_TARGETS )
1614
        {
1633
        {
1615
            Verbose("Active:", @BUILD_ACTIVEPLATFORMS);
1634
            Verbose("Active:", @BUILD_ACTIVEPLATFORMS);
1616
            Verbose("Generic:", @GENERIC_TARGETS);
1635
            Verbose("Generic:", @GENERIC_TARGETS);
1617
            Error("Cannot mix GENERIC and non-GENERIC targets in the one build");
1636
            Error("Cannot mix GENERIC and non-GENERIC targets in the one build");
1618
        }
1637
        }
Line 1696... Line 1715...
1696
    }
1715
    }
1697
 
1716
 
1698
    #
1717
    #
1699
    #   NoBuilds do not generate warnings
1718
    #   NoBuilds do not generate warnings
1700
    #
1719
    #
1701
    return if $NoBuild;
1720
    return if $NoBuild && !$BuildInfo;
1702
 
1721
 
1703
    #
1722
    #
1704
    #   Generate a list of platforms that are completely unknown to JATS
1723
    #   Generate a list of platforms that are completely unknown to JATS
1705
    #   May be the result of a user typo or a guess
1724
    #   May be the result of a user typo or a guess
1706
    #
1725
    #
1707
    if ( @BUILD_BADNAME )
1726
    if ( @BUILD_BADNAME )
1708
    {
1727
    {
1709
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1728
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1710
        Error ("The following platform names are not known to JATS", "@BUILD_BADNAME");
1729
        abtWarning (1,"The following platform names are not known to JATS", "@BUILD_BADNAME");
1711
    }
1730
    }
1712
 
1731
 
1713
    #
1732
    #
1714
    #   Detect multiple GENERIC targets
1733
    #   Detect multiple GENERIC targets
1715
    #       Only one such target can be processed on any one machine
1734
    #       Only one such target can be processed on any one machine
Line 1717... Line 1736...
1717
    if ($#GENERIC_TARGETS > 0)
1736
    if ($#GENERIC_TARGETS > 0)
1718
    {
1737
    {
1719
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
1738
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
1720
    }
1739
    }
1721
 
1740
 
-
 
1741
    generateBuildInfo() if ($BuildInfo);
1722
    return 1;
1742
    return 1;
1723
}
1743
}
1724
 
1744
 
1725
#-------------------------------------------------------------------------------
1745
#-------------------------------------------------------------------------------
-
 
1746
# Function        : generateBuildInfo 
-
 
1747
#
-
 
1748
# Description     : Using in BuildInfo mode to save the required information
-
 
1749
#
-
 
1750
#                   In BuildInfo mode we have all the data that we need
-
 
1751
#                   Save it into a file for the build system and then exit the build process
-
 
1752
#                   We do not need to do any further work at this point in time
-
 
1753
#
-
 
1754
# Inputs          : Globals 
-
 
1755
#
-
 
1756
# Returns         : This function does not return
-
 
1757
#                   It will exit as there is no more work to be done
-
 
1758
#                   
-
 
1759
#                   Will generate a JAVA properties file with BuildInfo required by the
-
 
1760
#                   Build System.
-
 
1761
#
-
 
1762
sub generateBuildInfo
-
 
1763
{
-
 
1764
    DumpCapture();
-
 
1765
    Message ("Generate BuildInfo Data: ". $BuildInfoFile);
-
 
1766
    my @propLines = ();
-
 
1767
 
-
 
1768
 
-
 
1769
    my $fh = ConfigurationFile::New( $BuildInfoFile, '--Type=Properties' );
-
 
1770
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)", "BuildInfo properties" );
-
 
1771
 
-
 
1772
    # Build style
-
 
1773
    push @propLines, "buildstyle = JATS";
-
 
1774
 
-
 
1775
    # Current Build Filter
-
 
1776
    push @propLines, "buildfilter = " . join(',', sort split(' ', $::GBE_BUILDFILTER));
-
 
1777
 
-
 
1778
    # All platforms that the package can be built for.
-
 
1779
    push @propLines, "platforms = " . join(',', sort @BUILDPLATFORMS);
-
 
1780
 
-
 
1781
    # All platforms that the package will be built for with the current build filter
-
 
1782
    my @AllCanBuild;
-
 
1783
    my %filterMap;
-
 
1784
    foreach ( split(' ', $::GBE_BUILDFILTER) ) {
-
 
1785
        $filterMap{$_} = 1;
-
 
1786
        my $genericMachType = PlatformConfig::getGenericMachType($_);
-
 
1787
        if ($genericMachType) {
-
 
1788
            $filterMap{$genericMachType} = 1;
-
 
1789
        }
-
 
1790
    }
-
 
1791
    push (@AllCanBuild, 'GENERIC') if ($#GENERIC_TARGETS >= 0);
-
 
1792
 
-
 
1793
    foreach ( @BUILDPLATFORMS ) {
-
 
1794
        if (exists $filterMap{$_}) {
-
 
1795
            push @AllCanBuild, $_;
-
 
1796
        }
-
 
1797
    }
-
 
1798
    push @propLines, "build.platforms = " . join(',', sort @AllCanBuild);
-
 
1799
 
-
 
1800
    # Platforms that have been specifically excluded from the build
-
 
1801
    push @propLines, "excluded.platforms = " . join(',', sort @BUILDEXCLUDE);
-
 
1802
 
-
 
1803
    # Platforms not known to JATS
-
 
1804
    # Only works in ABT mode. Errors will be detected before this
-
 
1805
    push @propLines, "unknown.platforms = " . join(',', sort @BUILD_BADNAME);
-
 
1806
    
-
 
1807
    # Toolset build information
-
 
1808
    CalcToolsetBuildInfo(@AllCanBuild);
-
 
1809
    if (exists $toolsetData->{platforms}) {
-
 
1810
        push @propLines, "toolset.platforms = " . join(',', sort @{$toolsetData->{platforms}});
-
 
1811
    }
-
 
1812
 
-
 
1813
    # Indication of production and debug builds
-
 
1814
    my (@OnlyProd, @OnlyDebug);
-
 
1815
    foreach my $platform ( sort keys %BUILDPLATFORMARGS) {
-
 
1816
        foreach my $arg ( split($;, $BUILDPLATFORMARGS{$platform})) {
-
 
1817
            push (@OnlyProd,  $platform) if ($arg =~ m~--OnlyProd~);
-
 
1818
            push (@OnlyDebug, $platform)  if ($arg =~ m~--OnlyDebug~);
-
 
1819
        }
-
 
1820
    }
-
 
1821
    push @propLines, "prod.platforms = " . join(',', sort @OnlyProd) ;
-
 
1822
    push @propLines, "debug.platforms = " . join(',', sort @OnlyDebug) ;
-
 
1823
 
-
 
1824
    # JAVA version specified
-
 
1825
    if ($BUILDPLATFORMARGS{JAVA}) {
-
 
1826
        foreach my $arg ( split($;, $BUILDPLATFORMARGS{JAVA})) {
-
 
1827
            if ($arg =~ m~^--Version=(.*)~i) {
-
 
1828
                push @propLines, "java.version = " . $1;
-
 
1829
                last;
-
 
1830
            }
-
 
1831
        }
-
 
1832
    }
-
 
1833
 
-
 
1834
    # The package is GENERIC
-
 
1835
    if ($#GENERIC_TARGETS >= 0) {
-
 
1836
        push @propLines, "generic.build = 1";
-
 
1837
    }
-
 
1838
 
-
 
1839
    $fh->WriteLn(@propLines);
-
 
1840
    $fh->Close();
-
 
1841
 
-
 
1842
    # Display for user gratification (and build system logging)
-
 
1843
    Information($BuildInfoFile,@propLines);
-
 
1844
    exit 0;
-
 
1845
}
-
 
1846
 
-
 
1847
#-------------------------------------------------------------------------------
1726
# Function        : needToolset 
1848
# Function        : needToolset 
1727
#
1849
#
1728
# Description     : Internal. Determine if this machine needs to build for
1850
# Description     : Internal. Determine if this machine needs to build for
1729
#                   a TOOLSET or a GENERIC_<MachType>
1851
#                   a TOOLSET or a GENERIC_<MachType>
1730
#                   
1852
#                   
Line 1801... Line 1923...
1801
 
1923
 
1802
    #
1924
    #
1803
    #   Need to ensure that we have a TOOLSET platform in the build set
1925
    #   Need to ensure that we have a TOOLSET platform in the build set
1804
    #
1926
    #
1805
    my %activePlatformMap = map {$_ => 1} @BUILD_ACTIVEPLATFORMS;
1927
    my %activePlatformMap = map {$_ => 1} @BUILD_ACTIVEPLATFORMS;
1806
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET'); 
1928
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET');
1807
    foreach my $item (@toolsetTargets)
1929
    foreach my $item (@toolsetTargets)
1808
    {
1930
    {
1809
        if (exists($activePlatformMap{$item}))
1931
        if (exists($activePlatformMap{$item}))
1810
        {
1932
        {
1811
            #
1933
            #
Line 1838... Line 1960...
1838
    $BUILDALIAS{TOOLSET} = $toolset;
1960
    $BUILDALIAS{TOOLSET} = $toolset;
1839
    push @{$BUILDINFO{$toolset}{USERALIAS}}, 'TOOLSET';
1961
    push @{$BUILDINFO{$toolset}{USERALIAS}}, 'TOOLSET';
1840
}
1962
}
1841
 
1963
 
1842
#-------------------------------------------------------------------------------
1964
#-------------------------------------------------------------------------------
-
 
1965
# Function        : CalcToolsetBuildInfo 
-
 
1966
#
-
 
1967
# Description     : Calculate the Toolset component of the BuildInfo
-
 
1968
#                   Note: Similar to ProcessToolSetPlatform (above)
-
 
1969
#                   
-
 
1970
#                   Need to determine the most suitable platform for building toolsets. 
-
 
1971
#                   Only consider those that are a part of the build set
-
 
1972
#
-
 
1973
# Inputs          : AllPlatforms    - an Array of all platrform that this package can
-
 
1974
#                                     be built on with the current build filter 
-
 
1975
#
-
 
1976
# Returns         : 
-
 
1977
#
-
 
1978
sub  CalcToolsetBuildInfo {
-
 
1979
    my (@allPlatforms) = @_;
-
 
1980
    return unless $toolsetData->{enableToolset};
-
 
1981
       
-
 
1982
    my %toolsetSelected;
-
 
1983
    my %platformMap = map {$_ => 1} @allPlatforms;
-
 
1984
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET');
-
 
1985
    foreach my $item (@toolsetTargets)
-
 
1986
    {
-
 
1987
        if (exists($platformMap{$item}))
-
 
1988
        {
-
 
1989
            my $include = 0;
-
 
1990
            my $toolMachType = PlatformConfig::targetHasTag($item, 'MACHTYPE');
-
 
1991
 
-
 
1992
            # Specifically included
-
 
1993
            if (exists $toolsetData->{include}){
-
 
1994
                if (exists $toolsetData->{include}{ lc $toolMachType}) {
-
 
1995
                    $include = 1;
-
 
1996
                }
-
 
1997
            # Specifically excluded
-
 
1998
            } elsif (exists $toolsetData->{exclude}) {
-
 
1999
                unless (exists $toolsetData->{exclude}{ lc $toolMachType}) {
-
 
2000
                    $include = 1;
-
 
2001
                }
-
 
2002
            # Default
-
 
2003
            } else {
-
 
2004
                $include = 1;
-
 
2005
            }
-
 
2006
 
-
 
2007
            if ($include) {
-
 
2008
                unless (exists $toolsetSelected{$toolMachType}) {
-
 
2009
                    $toolsetSelected{$toolMachType} = $item;
-
 
2010
                    push @{$toolsetData->{platforms}}, $item;
-
 
2011
                }
-
 
2012
            }
-
 
2013
        }
-
 
2014
    }
-
 
2015
#DebugDumpData("toolsetSelected", \%toolsetSelected);
-
 
2016
}
-
 
2017
 
-
 
2018
#-------------------------------------------------------------------------------
1843
# Function        : BuildPreviousVersion 
2019
# Function        : BuildPreviousVersion 
1844
#
2020
#
1845
# Description     : Deprecated. Do not use 
2021
# Description     : Deprecated. Do not use 
1846
#
2022
#
1847
# Inputs          : 
2023
# Inputs          : 
Line 2718... Line 2894...
2718
        }
2894
        }
2719
    }
2895
    }
2720
}
2896
}
2721
 
2897
 
2722
#-------------------------------------------------------------------------------
2898
#-------------------------------------------------------------------------------
-
 
2899
# Function        : LinkPkgExclude 
-
 
2900
#
-
 
2901
# Description     : Mark a package to be excluded / included for a specific build
-
 
2902
#                   Intended use:
-
 
2903
#                       Recover from really (reaaly) badly constructed packages
-
 
2904
#                       
-
 
2905
#                   Essentially this directive will 'Exclude' packages from the
-
 
2906
#                   a specific build target (platform) by removing it from data
-
 
2907
#                   structures that are exported to the make stage
-
 
2908
#                   
-
 
2909
#                   Process ONLY works for LinkPkgArchive packages
-
 
2910
#
-
 
2911
# Inputs          : platform-selector   - A JATS style platform specifier
-
 
2912
#                   package-list        - one or or packages to process
-
 
2913
#                   
-
 
2914
# Example         : LinkPkgExclude('!SK100', 'PulseSdk');
-
 
2915
#                   LinkPkgExclude('SK100' , 'crypto');
-
 
2916
#
-
 
2917
sub LinkPkgExclude
-
 
2918
{
-
 
2919
    DataDirective('LinkPkgExclude');
-
 
2920
    Error("LinkPkgExclude(@_) requires at least two arguments") unless ((scalar @_) >= 2);
-
 
2921
    #
-
 
2922
    #   Simply save the arguments for later processing
-
 
2923
    #
-
 
2924
    push @LINKPKGEXLUDES, join($;, @_);
-
 
2925
}
-
 
2926
 
-
 
2927
#-------------------------------------------------------------------------------
-
 
2928
# Function        : ProcessLinkPkgExclude 
-
 
2929
#
-
 
2930
# Description     : INTERNAL Function
-
 
2931
#                   Process the data collected by the LinkPkgExclude directives  
-
 
2932
#
-
 
2933
# Inputs          : None
-
 
2934
#                   Uses: LINKPKGEXLUDES    
-
 
2935
#
-
 
2936
# Returns         : Will modify interal classes and data structures
-
 
2937
#
-
 
2938
sub ProcessLinkPkgExclude
-
 
2939
{
-
 
2940
    my @unknownPlatforms;
-
 
2941
    my @unknownPkg;
-
 
2942
    my @notLinkPkg;
-
 
2943
 
-
 
2944
    #
-
 
2945
    #   Create a hash of known platforms - detect and report bad user input
-
 
2946
    #
-
 
2947
    my %fullPlatformList =  map { $_ => 1 } @BUILDPLATFORMS;
-
 
2948
 
-
 
2949
    #
-
 
2950
    #   Process each directive
-
 
2951
    #
-
 
2952
    foreach ( @LINKPKGEXLUDES )
-
 
2953
    {
-
 
2954
        my (@add, @remove);
-
 
2955
        my ($pSel, @pkgList) = split($;, $_);
-
 
2956
        Log("LinkPkgExclude $pSel, @pkgList");
-
 
2957
 
-
 
2958
 
-
 
2959
        #
-
 
2960
        #   Process the selector in the same manor as makefiles
-
 
2961
        #       Need the selector to be active
-
 
2962
        #       Selector may be an alias or a platform
-
 
2963
        #       Selector may be negated
-
 
2964
        #       Selectors are comma seperated
-
 
2965
        #       Additive elements are processed before subtactive elements
-
 
2966
        #           
-
 
2967
        my @pItems = split(/\s*,\s*/, $pSel);
-
 
2968
        @pItems = ExpandPlatforms( @pItems );
-
 
2969
 
-
 
2970
         foreach my $platform ( @pItems) {
-
 
2971
             my $pname = $platform;
-
 
2972
             my $invert;
-
 
2973
 
-
 
2974
             if (substr($platform, 0, 1) eq '!') {
-
 
2975
                 $invert = 1;
-
 
2976
                 $pname = substr($platform, 1)
-
 
2977
                 }
-
 
2978
 
-
 
2979
             unless (exists($fullPlatformList{$pname})) {
-
 
2980
                 UniquePush(\@unknownPlatforms, $pname);
-
 
2981
                 next;
-
 
2982
                 }
-
 
2983
 
-
 
2984
             if ( $invert )  {
-
 
2985
                 push @remove, $pname; 
-
 
2986
             } else {
-
 
2987
                 push @add, $pname; 
-
 
2988
             }
-
 
2989
         }
-
 
2990
 
-
 
2991
         #
-
 
2992
         #   Build complete list of allowed platforms
-
 
2993
         #       Process additive rules before removal rules
-
 
2994
         #       If there are no additive rules, then assume all protaforms
-
 
2995
         #
-
 
2996
         my %calcList;
-
 
2997
         @add = @BUILDPLATFORMS unless @add;
-
 
2998
         $calcList{uc $_} = 1 foreach (@add);
-
 
2999
         delete $calcList{uc $_} foreach (@remove);
-
 
3000
         Verbose2("LinkPkgExclude ", keys %calcList,",", @pkgList);
-
 
3001
 
-
 
3002
         #
-
 
3003
         #  Now have a list of platforms to process (exclude)
-
 
3004
         #  Now have a list of packages to exclude
-
 
3005
         #
-
 
3006
         #  Iterate over the package rules and mark those to be excluded
-
 
3007
         #
-
 
3008
         foreach my $platform ( keys %calcList )
-
 
3009
         {
-
 
3010
             unless (exists($PKGRULES{$platform})) {
-
 
3011
                 next;
-
 
3012
             }
-
 
3013
 
-
 
3014
             foreach my $ePackage (@pkgList) {
-
 
3015
                 my $pkgFound;
-
 
3016
                 foreach my $package ( @{$PKGRULES{$platform}} )
-
 
3017
                 {
-
 
3018
                     my $fname = $package->{'dname'};
-
 
3019
                     if ( $package->{'dproj'}) {
-
 
3020
                         $fname .= '.' . $package->{'dproj'};
-
 
3021
                     }
-
 
3022
 
-
 
3023
                     if ( $ePackage eq $package->{'dname'}  || $ePackage eq $fname) {
-
 
3024
                         $pkgFound = 1;
-
 
3025
 
-
 
3026
                         if ($package->{'type'} ne 'link') {
-
 
3027
                             UniquePush(\@notLinkPkg, $ePackage);
-
 
3028
                             last;
-
 
3029
                         }
-
 
3030
 
-
 
3031
                         $package->{'EXCLUDE'} = 1;
-
 
3032
                         Debug("Exclude", $platform, $fname );
-
 
3033
                         last;
-
 
3034
                     }
-
 
3035
                 }
-
 
3036
                 UniquePush(\@unknownPkg, $ePackage) unless $pkgFound;
-
 
3037
             }
-
 
3038
         }
-
 
3039
   }
-
 
3040
 
-
 
3041
    ReportError("LinkPkgExclude. Unknown platforms:", @unknownPlatforms) if @unknownPlatforms;
-
 
3042
    ReportError("LinkPkgExclude. Unknown packages:", @unknownPkg) if @unknownPkg;
-
 
3043
    ReportError("LinkPkgExclude. BuildPkgArchive not allowed for:", @notLinkPkg) if @notLinkPkg;
-
 
3044
    ErrorDoExit();
-
 
3045
}
-
 
3046
 
-
 
3047
#-------------------------------------------------------------------------------
2723
# Function        : CreateInterfacePackage
3048
# Function        : CreateInterfacePackage
2724
#
3049
#
2725
# Description     : Create a dummy package entry to describe the Interface
3050
# Description     : Create a dummy package entry to describe the Interface
2726
#                   This is done AFTER all the BuildPkgArchive directives have
3051
#                   This is done AFTER all the BuildPkgArchive directives have
2727
#                   been processed so that the interface directory is fully
3052
#                   been processed so that the interface directory is fully
Line 3458... Line 3783...
3458
            }
3783
            }
3459
        }
3784
        }
3460
    }
3785
    }
3461
    CleanUp_Aliases();
3786
    CleanUp_Aliases();
3462
    ProcessBuildArgument();
3787
    ProcessBuildArgument();
-
 
3788
    ProcessLinkPkgExclude();
3463
 
3789
 
3464
    #
3790
    #
3465
    #   Create dummy package to describe the Interface directory
3791
    #   Create dummy package to describe the Interface directory
3466
    #
3792
    #
3467
    CreateInterfacePackage();
3793
    CreateInterfacePackage();
Line 4463... Line 4789...
4463
    my %ScmBuildPkgRules;
4789
    my %ScmBuildPkgRules;
4464
    foreach my $platform ( keys %PKGRULES )
4790
    foreach my $platform ( keys %PKGRULES )
4465
    {
4791
    {
4466
        foreach my $package ( @{$PKGRULES{$platform}} )
4792
        foreach my $package ( @{$PKGRULES{$platform}} )
4467
        {
4793
        {
-
 
4794
            next if exists $package->{'EXCLUDE'};
4468
            my %entry;
4795
            my %entry;
4469
 
4796
 
4470
            $entry{ROOT}     = TruePath( $package->{'base'} );
4797
            $entry{ROOT}     = TruePath( $package->{'base'} );
4471
            $entry{NAME}     = $package->{'name'};
4798
            $entry{NAME}     = $package->{'name'};
4472
            $entry{VERSION}  = $package->{'version'};
4799
            $entry{VERSION}  = $package->{'version'};
Line 5160... Line 5487...
5160
jats build [options] [command]
5487
jats build [options] [command]
5161
 
5488
 
5162
     [perl buildlib.pl [options] PWD [command]]
5489
     [perl buildlib.pl [options] PWD [command]]
5163
 
5490
 
5164
 Options:
5491
 Options:
5165
    -help          - Display terse usage
5492
    -help           - Display terse usage
5166
    -help -help    - Display verbose usage
5493
    -help -help     - Display verbose usage
5167
    -man           - Display internal manual
5494
    -man            - Display internal manual
5168
    -verbose[=n]   - Set level of progress verbosity
5495
    -verbose[=n]    - Set level of progress verbosity
5169
    -debug[=n]     - Set the debug level
5496
    -debug[=n]      - Set the debug level
5170
    -cache         - Cache packages in the local dpkg_package cache
5497
    -cache          - Cache packages in the local dpkg_package cache
5171
    -localcache    - Cache packages into the interface directory
5498
    -localcache     - Cache packages into the interface directory
5172
    -cache -cache  - Forced refresh dependent packages in the local cache
5499
    -cache -cache   - Forced refresh dependent packages in the local cache
5173
    -package       - Ignore packages that are not available and continue
5500
    -package        - Ignore packages that are not available and continue
5174
    -nopackages    - Ignore package processing directives
5501
    -nopackages     - Ignore package processing directives
5175
    -forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
5502
    -forcebuildpkg  - Treat LinkPkgArchive directives as BuildPkgArchive
5176
                     Also suppress the use of symlinks so that the physical
5503
                      Also suppress the use of symlinks so that the physical
5177
                     file will be copied locally.
5504
                      file will be copied locally.
5178
    -[no]force     - Force build even if build.pl is not newer
5505
    -[no]force      - Force build even if build.pl is not newer
5179
                     Default: -force
5506
                      Default: -force
5180
    -[no]generic   - Build system sanity test
5507
    -[no]generic    - Build system sanity test
5181
                     Default: Do not test
5508
                      Default: Do not test
-
 
5509
    -buildinfo=path - Specify name of the buildinfo file
5182
    -signature=xx  - Check package signature
5510
    -signature=xx  - Check package signature
5183
 
5511
 
5184
 Sticky settings:
5512
 Sticky settings:
5185
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
5513
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
5186
    -expert[=n]    - Relaxing dependency checks on the user makefiles
5514
    -expert[=n]    - Relaxing dependency checks on the user makefiles
5187
 
5515
 
5188
 Commands:
5516
 Commands:
5189
    clobber        - Remove generated build system (eg Makefiles).
5517
    clobber        - Remove generated build system (eg Makefiles).
5190
    interface      - Only (re)build the interface tree.
5518
    interface      - Only (re)build the interface tree.
5191
    rootonly       - Only (re)build the root directory.
5519
    rootonly       - Only (re)build the root directory.
-
 
5520
    buildinfo      - Only generate build system info.
5192
    signature      - Create the packages signature
5521
    signature      - Create the packages signature
5193
 
5522
 
5194
=head1 OPTIONS
5523
=head1 OPTIONS
5195
 
5524
 
5196
=over 8
5525
=over 8
Line 5294... Line 5623...
5294
 
5623
 
5295
The default is to not perform the test.
5624
The default is to not perform the test.
5296
 
5625
 
5297
This option is intended to be used by the automated build system.
5626
This option is intended to be used by the automated build system.
5298
 
5627
 
-
 
5628
=item B<-buildinfo>
-
 
5629
 
-
 
5630
This option is only used in conjunction with the 'buildinfo' command. It will specify 
-
 
5631
the path of a file to write the build information. The dafault value is 'BuildInfo.properties'.
-
 
5632
 
-
 
5633
This option, by itslef, will not invoke the buildinfo mode.
-
 
5634
 
5299
=item B<-signature=xxxx>
5635
=item B<-signature=xxxx>
5300
 
5636
 
5301
If used, this option will perform a sanity test on the packages signature. It will
5637
If used, this option will perform a sanity test on the packages signature. It will
5302
ensure that the generated package signature is the same as that provided.
5638
ensure that the generated package signature is the same as that provided.
5303
 
5639
 
Line 5346... Line 5682...
5346
the root-level makefiles.
5682
the root-level makefiles.
5347
 
5683
 
5348
The build process will not recurse through the subdirectories creating
5684
The build process will not recurse through the subdirectories creating
5349
makefiles. These can be made on-demand by jats if a 'make' command is issued.
5685
makefiles. These can be made on-demand by jats if a 'make' command is issued.
5350
 
5686
 
-
 
5687
=item B<buildinfo>
-
 
5688
 
-
 
5689
This command is used by the build system to generate information about the
-
 
5690
build. It will create a file with the following information.
-
 
5691
 
-
 
5692
=over 4
-
 
5693
 
-
 
5694
=item * All platforms that the package can be built for.
-
 
5695
 
-
 
5696
=item * All platforms that the package will be built for with the current build filter
-
 
5697
 
-
 
5698
=item * Platforms that have been specifically excluded from the build
-
 
5699
 
-
 
5700
=item * Platforms not known to JATS
-
 
5701
 
-
 
5702
=item * Toolset build information
-
 
5703
 
-
 
5704
=item * Generic build information
-
 
5705
 
-
 
5706
=item * Indication of production and debug builds
-
 
5707
 
-
 
5708
=item * JAVA version specified
-
 
5709
 
-
 
5710
=back
-
 
5711
 
5351
=item B<signature>
5712
=item B<signature>
5352
 
5713
 
5353
This command will only build, or rebuild, the 'interface' directory and 
5714
This command will only build, or rebuild, the 'interface' directory and 
5354
the root-level makefiles. It will not process external packages.
5715
the root-level makefiles. It will not process external packages.
5355
 
5716