Subversion Repositories DevTools

Rev

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

Rev 7262 Rev 7296
Line 41... Line 41...
41
our $CmdSwitch              = "";
41
our $CmdSwitch              = "";
42
our $Clobber                = 0;
42
our $Clobber                = 0;
43
our $Archive                = 0;
43
our $Archive                = 0;
44
our $Interface              = 0;
44
our $Interface              = 0;
45
our $RootOnly               = 0;
45
our $RootOnly               = 0;
46
our $Perms                  = 0;
46
our $BuildInfo              = 0;
-
 
47
our $BuildInfoFile          = 'BuildInfo.properties';
47
our $Expert                 = 0;
48
our $Expert                 = 0;
48
our $All                    = 0;
49
our $All                    = 0;
49
our $Cache                  = $ENV{GBE_DPKG_CACHE_CTL} || 0;
50
our $Cache                  = $ENV{GBE_DPKG_CACHE_CTL} || 0;
50
our $NoPackageError         = 0;
51
our $NoPackageError         = 0;
51
our $ForceBuildPkg          = 0;
52
our $ForceBuildPkg          = 0;
Line 108... Line 109...
108
my  $opt_help               = 0;
109
my  $opt_help               = 0;
109
my  $opt_localCache         = 0;                # Create cache within the interface directory
110
my  $opt_localCache         = 0;                # Create cache within the interface directory
110
my  $sandbox_exact          = 0;                # Exact or in-exact sandbox
111
my  $sandbox_exact          = 0;                # Exact or in-exact sandbox
111
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
112
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
112
 
113
 
-
 
114
my  $toolsetData;                               # Parsed toolset data
113
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
115
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
114
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
116
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
115
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
117
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
116
my  @genToolsetArgs;                            # Args for a generated TOOLSET
118
my  @genToolsetArgs;                            # Args for a generated TOOLSET
117
my  $descpkgPath;                               # Path to the dscpkg file
119
my  $descpkgPath;                               # Path to the dscpkg file
Line 131... Line 133...
131
    EnvImport( 'GBE_CONFIG' );
133
    EnvImport( 'GBE_CONFIG' );
132
    EnvImport( 'GBE_DPKG' );
134
    EnvImport( 'GBE_DPKG' );
133
    EnvImport( 'GBE_MACHTYPE' );
135
    EnvImport( 'GBE_MACHTYPE' );
134
    EnvImport( 'USER' );
136
    EnvImport( 'USER' );
135
    EnvImport( 'GBE_HOSTNAME');
137
    EnvImport( 'GBE_HOSTNAME');
136
    EnvImport( 'GBE_DRV' )
-
 
137
        if ( $ScmHost ne 'Unix' );            # DOS or WIN special
138
    EnvImport( 'GBE_DRV' ) if ( $ScmHost ne 'Unix' );   # DOS or WIN special
138
 
139
 
139
    EnvImportOptional ( 'GBE_DPKG_ESCROW','' );
140
    EnvImportOptional ( 'GBE_DPKG_ESCROW','' );
140
    EnvImportOptional ( 'GBE_DPKG_REPLICA','' );
141
    EnvImportOptional ( 'GBE_DPKG_REPLICA','' );
141
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
142
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
142
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
143
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
143
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
144
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
144
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
145
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
145
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
146
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
146
    EnvImportOptional ( 'GBE_SANDBOX'   ,'' );
147
    EnvImportOptional ( 'GBE_SANDBOX'   ,'' );
147
 
148
 
148
    EnvImportOptional ( 'GBE_PLATFORM' );           # optional PLATFORM filter
149
    EnvImportOptional ( 'GBE_PLATFORM' );               # optional PLATFORM filter
149
    EnvImportOptional ( 'GBE_BUILDFILTER' );        # optional BUILD filter       
150
    EnvImportOptional ( 'GBE_BUILDFILTER' );            # optional BUILD filter       
150
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
151
    EnvImportOptional ( 'GBE_ABT' );                    # optional ABT flags          
151
    
152
    
152
#.. Common stuff
153
#.. Common stuff
153
#
154
#
154
    require "$::GBE_TOOLS/common.pl";
155
    require "$::GBE_TOOLS/common.pl";
155
    CommonInit( 'buildlib' );
156
    CommonInit( 'buildlib' );
Line 175... Line 176...
175
                             "nopackages"    => \$IgnorePkgs,
176
                             "nopackages"    => \$IgnorePkgs,
176
                             "forcebuildpkg" => \$ForceBuildPkg,
177
                             "forcebuildpkg" => \$ForceBuildPkg,
177
                             "force!"        => \$ForceBuild,
178
                             "force!"        => \$ForceBuild,
178
                             "generic!"      => \$GenericBuild,
179
                             "generic!"      => \$GenericBuild,
179
                             "localcache!"   => \$opt_localCache,
180
                             "localcache!"   => \$opt_localCache,
-
 
181
                             "buildinfo:s"   => \$BuildInfoFile,
180
                             );
182
                             );
181
    Usage() if ( $opt_help || !$result );
183
    Usage() if ( $opt_help || !$result );
182
 
184
 
183
    Debug( "Host:          ", $ScmHost );
185
    Debug( "Host:          ", $ScmHost );
184
    Debug( "Cwd:           ", $CwdFull );
186
    Debug( "Cwd:           ", $CwdFull );
Line 212... Line 214...
212
            $RootOnly       = 1;
214
            $RootOnly       = 1;
213
 
215
 
214
        } elsif ( $CmdSwitch eq "clobber" ) {
216
        } elsif ( $CmdSwitch eq "clobber" ) {
215
            $Clobber        = 1;
217
            $Clobber        = 1;
216
 
218
 
-
 
219
        } elsif ( $CmdSwitch eq "buildinfo" ) {
-
 
220
            $BuildInfo      = 1;
-
 
221
            $Interface      = 1;
-
 
222
            unlink $BuildInfoFile;
-
 
223
 
217
        } elsif ( $CmdSwitch eq "help" || $CmdSwitch eq "usage" ) {
224
        } elsif ( $CmdSwitch eq "help" || $CmdSwitch eq "usage" ) {
218
            $opt_help = 1;
225
            $opt_help = 1;
219
            Usage();
226
            Usage();
220
 
227
 
221
        } else {
228
        } else {
Line 266... Line 273...
266
sub Log
273
sub Log
267
{
274
{
268
    if ( ! $Clobber )
275
    if ( ! $Clobber )
269
    {
276
    {
270
        print "@_\n";
277
        print "@_\n";
271
        FileAppend ('build.log', \@_ );
278
        FileAppend ('build.log', \@_ ) unless $BuildInfo;
272
    }
279
    }
273
}
280
}
274
 
281
 
275
#-------------------------------------------------------------------------------
282
#-------------------------------------------------------------------------------
276
# Function        : BuildSubDir
283
# Function        : BuildSubDir
Line 1005... Line 1012...
1005
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC}  )
1012
    unless ( $pInfo->{NOT_AVAILABLE} || exists $BUILDINFO{$target} || $pInfo->{IS_GENERIC}  )
1006
    {
1013
    {
1007
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
1014
        my $base_target = PlatformConfig::targetHasTag( $target, 'BASE_TARGET' ) || $target;
1008
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
1015
        unless ( Exists( "$::GBE_CONFIG/PLATFORM", $base_target  ) )
1009
        {
1016
        {
1010
            UniquePush (\@BUILD_BADNAME, $target ); 
1017
            UniquePush (\@BUILD_BADNAME, $target ) unless ($target eq 'NOBUILD'); 
1011
            $pInfo->{NOT_AVAILABLE} = 3;
1018
            $pInfo->{NOT_AVAILABLE} = 3;
1012
            $pInfo->{BADNAME} = 1;
1019
            $pInfo->{BADNAME} = 1;
1013
        }
1020
        }
1014
    }
1021
    }
1015
 
1022
 
Line 1402... Line 1409...
1402
# Returns         : 
1409
# Returns         : 
1403
#
1410
#
1404
sub BuildToolset
1411
sub BuildToolset
1405
{
1412
{
1406
    my( @arguments ) = @_;
1413
    my( @arguments ) = @_;
1407
    my ($exclude, $include, $including);
-
 
1408
 
1414
 
1409
    $genToolsetPlatform = 1;
1415
    $genToolsetPlatform = 1;
1410
    Debug( "BuildToolset(@arguments)" );
1416
    Debug( "BuildToolset(@arguments)" );
1411
    Error( "BuildToolset must appear before BuildName()..." )
1417
    Error( "BuildToolset must appear before BuildName()..." )
1412
        if ( $BUILDNAME ne "" );
1418
        if ( $BUILDNAME ne "" );
Line 1414... Line 1420...
1414
    #
1420
    #
1415
    #   Process TOOLSET specific options
1421
    #   Process TOOLSET specific options
1416
    #       --ExcludeMachType=xxxx,yyy
1422
    #       --ExcludeMachType=xxxx,yyy
1417
    #       --MachType=xxxx,yyy
1423
    #       --MachType=xxxx,yyy
1418
    #
1424
    #
-
 
1425
    $toolsetData->{enableToolset} = 1;
1419
    foreach ( @arguments )
1426
    foreach ( @arguments )
1420
    {
1427
    {
1421
        if ( m~^--ExcludeMachType=(.+)~i ) {
1428
        if ( m~^--ExcludeMachType=(.+)~i ) {
1422
            foreach my $arch (split(',',$1))
1429
            foreach my $arch (split(',',$1))
1423
            {
1430
            {
-
 
1431
                ReportError("BuildToolset: Unknown MachType: $arch") unless PlatformConfig::validMachType($arch);
-
 
1432
                $toolsetData->{exclude}{lc $arch} = 1;
1424
                if (uc($arch) eq uc($::GBE_MACHTYPE))
1433
                if (lc($arch) eq lc($::GBE_MACHTYPE))
1425
                {
1434
                {
1426
                    Verbose("Exclude TOOLSET on this machine");
1435
                    Verbose("Exclude TOOLSET on this machine");
1427
                    $exclude = 1;
1436
                    $toolsetData->{excludeThis} = lc($arch);
1428
                    last;
-
 
1429
                }
1437
                }
1430
            }
1438
            }
1431
        } elsif ( m~^--MachType=(.+)~i ) {
1439
        } elsif ( m~^--MachType=(.+)~i ) {
1432
            $including = 1;
-
 
1433
            foreach my $arch (split(',',$1))
1440
            foreach my $arch (split(',',$1))
1434
            {
1441
            {
-
 
1442
                ReportError("BuildToolset: Unknown MachType: $arch") unless PlatformConfig::validMachType($arch);
-
 
1443
                $toolsetData->{include}{lc $arch} = 1;
1435
                if (uc($arch) eq uc($::GBE_MACHTYPE))
1444
                if (lc($arch) eq lc($::GBE_MACHTYPE))
1436
                {
1445
                {
1437
                    Verbose("Include TOOLSET on this machine");
1446
                    Verbose("Include TOOLSET on this machine");
1438
                    $include = 1;
1447
                    $toolsetData->{includeThis} = lc($arch);
1439
                    last;
-
 
1440
                }
1448
                }
1441
            }
1449
            }
1442
 
1450
 
1443
        } else {
1451
        } else {
1444
            Error ("BuildToolset: Unknown option: $_");
1452
            ReportError ("BuildToolset: Unknown option: $_");
1445
        }
1453
        }
1446
    }
1454
    }
1447
 
1455
 
-
 
1456
    if ( exists $toolsetData->{exclude} && exists $toolsetData->{include}) {
-
 
1457
        ReportError ("BuildToolset: Cannot use both --MachType and --ExcludeMachType");
-
 
1458
    }
-
 
1459
    ErrorDoExit();
-
 
1460
 
1448
    #
1461
    #
1449
    #   Show we build for this architecture
1462
    #   Show we build for this architecture
-
 
1463
    #   Have three conditions:
-
 
1464
    #       1) Current machType specifically excluded
-
 
1465
    #       2) Current machtype specifically included
-
 
1466
    #       3) Neither - further processing required
1450
    #
1467
    #
1451
    $genToolsetActive = 0;
1468
    $genToolsetActive = 0;
1452
    if ($exclude) {
1469
    if (exists $toolsetData->{excludeThis}) {
1453
        $toolsetPlatform = 'Excluded';
1470
        $toolsetPlatform = 'Excluded';
1454
        return;
1471
        return;
1455
    }
1472
    }
1456
 
1473
 
1457
    if ($including) {
1474
    if (exists $toolsetData->{include}) {
1458
        if ($include) {
1475
        if (exists $toolsetData->{includeThis}) {
1459
            $genToolsetActive = 1;
1476
            $genToolsetActive = 1;
1460
        } else {
1477
        } else {
1461
            $toolsetPlatform = 'Not included';
1478
            $toolsetPlatform = 'Not included';
1462
        }
1479
        }
1463
        return;
1480
        return;
Line 1517... Line 1534...
1517
    #
1534
    #
1518
    #   Clobber processing done after values have been accumulated
1535
    #   Clobber processing done after values have been accumulated
1519
    #   as they may be used later
1536
    #   as they may be used later
1520
    #
1537
    #
1521
    return if ( $Clobber );
1538
    return if ( $Clobber );
1522
    ToolsetFiles::AddFile('build.log');
1539
    ToolsetFiles::AddFile('build.log') unless ($BuildInfo);
1523
    
1540
    
1524
    #
1541
    #
1525
    #   Determine type of sandbox
1542
    #   Determine type of sandbox
1526
    #
1543
    #
1527
    $sandbox_exact = ( -f $::GBE_DPKG_SBOX . '/.exact' )
1544
    $sandbox_exact = ( -f $::GBE_DPKG_SBOX . '/.exact' )
Line 1540... Line 1557...
1540
    Log( "DateTime ... $::CurrentTime" );
1557
    Log( "DateTime ... $::CurrentTime" );
1541
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1558
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1542
    Log( "Build dir... $CwdFull" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1559
    Log( "Build dir... $CwdFull" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1543
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
1560
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
1544
    Log( "Build Cmd .. $CmdSwitch") if $CmdSwitch;
1561
    Log( "Build Cmd .. $CmdSwitch") if $CmdSwitch;
-
 
1562
    Log( "Build Info . $BuildInfoFile") if $BuildInfo;
1545
 
1563
 
1546
    Log( "PERL ....... $::GBE_PERL" );
1564
    Log( "PERL ....... $::GBE_PERL" );
1547
    Log( "BIN  ....... $::GBE_BIN" );
1565
    Log( "BIN  ....... $::GBE_BIN" );
1548
    Log( "TOOLS ...... $::GBE_TOOLS" );
1566
    Log( "TOOLS ...... $::GBE_TOOLS" );
1549
    Log( "CONFIG ..... $::GBE_CONFIG" );
1567
    Log( "CONFIG ..... $::GBE_CONFIG" );
Line 1573... Line 1591...
1573
 
1591
 
1574
    #
1592
    #
1575
    #   Detect a mix of Generic and non Generic targets
1593
    #   Detect a mix of Generic and non Generic targets
1576
    #       Cannot mix generic and non-generic targets
1594
    #       Cannot mix generic and non-generic targets
1577
    #
1595
    #
1578
    if ($#GENERIC_TARGETS >= 0 && $#BUILD_ACTIVEPLATFORMS >= 0)
1596
    if ($#GENERIC_TARGETS >= 0 && $#BUILDPLATFORMS >= 0)
1579
    {
1597
    {
1580
        if ($#BUILD_ACTIVEPLATFORMS != $#GENERIC_TARGETS )
1598
        if ($#BUILDPLATFORMS != $#GENERIC_TARGETS )
1581
        {
1599
        {
1582
            Verbose("Active:", @BUILD_ACTIVEPLATFORMS);
1600
            Verbose("Active:", @BUILD_ACTIVEPLATFORMS);
1583
            Verbose("Generic:", @GENERIC_TARGETS);
1601
            Verbose("Generic:", @GENERIC_TARGETS);
1584
            Error("Cannot mix GENERIC and non-GENERIC targets in the one build");
1602
            Error("Cannot mix GENERIC and non-GENERIC targets in the one build");
1585
        }
1603
        }
Line 1663... Line 1681...
1663
    }
1681
    }
1664
 
1682
 
1665
    #
1683
    #
1666
    #   NoBuilds do not generate warnings
1684
    #   NoBuilds do not generate warnings
1667
    #
1685
    #
1668
    return if $NoBuild;
1686
    return if $NoBuild && !$BuildInfo;
1669
 
1687
 
1670
    #
1688
    #
1671
    #   Generate a list of platforms that are completely unknown to JATS
1689
    #   Generate a list of platforms that are completely unknown to JATS
1672
    #   May be the result of a user typo or a guess
1690
    #   May be the result of a user typo or a guess
1673
    #
1691
    #
Line 1684... Line 1702...
1684
    if ($#GENERIC_TARGETS > 0)
1702
    if ($#GENERIC_TARGETS > 0)
1685
    {
1703
    {
1686
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
1704
        Error ("Multiple GENERIC targets detected", PrintPlatforms(\@GENERIC_TARGETS, $sep));
1687
    }
1705
    }
1688
 
1706
 
-
 
1707
    generateBuildInfo() if ($BuildInfo);
1689
    return 1;
1708
    return 1;
1690
}
1709
}
1691
 
1710
 
1692
#-------------------------------------------------------------------------------
1711
#-------------------------------------------------------------------------------
-
 
1712
# Function        : generateBuildInfo 
-
 
1713
#
-
 
1714
# Description     : Using in BuildInfo mode to save the required information
-
 
1715
#
-
 
1716
#                   In BuildInfo mode we have all the data that we need
-
 
1717
#                   Save it into a file for the build system and then exit the build process
-
 
1718
#                   We do not need to do any further work at this point in time
-
 
1719
#
-
 
1720
# Inputs          : Globals 
-
 
1721
#
-
 
1722
# Returns         : This function does not return
-
 
1723
#                   It will exit as there is no more work to be done
-
 
1724
#                   
-
 
1725
#                   Will generate a JAVA properties file with BuildInfo required by the
-
 
1726
#                   Build System.
-
 
1727
#
-
 
1728
sub generateBuildInfo
-
 
1729
{
-
 
1730
    DumpCapture();
-
 
1731
    Message ("Generate BuildInfo Data: ". $BuildInfoFile);
-
 
1732
    my @propLines = ();
-
 
1733
 
-
 
1734
 
-
 
1735
    my $fh = ConfigurationFile::New( $BuildInfoFile, '--Type=Properties' );
-
 
1736
    $fh->HeaderSimple( "buildlib (Version $BuildVersion)", "BuildInfo properties" );
-
 
1737
 
-
 
1738
    # Build style
-
 
1739
    push @propLines, "buildstyle = JATS";
-
 
1740
 
-
 
1741
    # Current Build Filter
-
 
1742
    push @propLines, "buildfilter = " . join(',', sort split(' ', $::GBE_BUILDFILTER));
-
 
1743
 
-
 
1744
    # All platforms that the package can be built for.
-
 
1745
    push @propLines, "platforms = " . join(',', sort @BUILDPLATFORMS);
-
 
1746
 
-
 
1747
    # All platforms that the package will be built for with the current build filter
-
 
1748
    my @AllCanBuild;
-
 
1749
    my %filterMap;
-
 
1750
    foreach ( split(' ', $::GBE_BUILDFILTER) ) {
-
 
1751
        $filterMap{$_} = 1;
-
 
1752
        my $genericMachType = PlatformConfig::getGenericMachType($_);
-
 
1753
        if ($genericMachType) {
-
 
1754
            $filterMap{$genericMachType} = 1;
-
 
1755
        }
-
 
1756
    }
-
 
1757
    push (@AllCanBuild, 'GENERIC') if ($#GENERIC_TARGETS >= 0);
-
 
1758
 
-
 
1759
    foreach ( @BUILDPLATFORMS ) {
-
 
1760
        if (exists $filterMap{$_}) {
-
 
1761
            push @AllCanBuild, $_;
-
 
1762
        }
-
 
1763
    }
-
 
1764
    push @propLines, "build.platforms = " . join(',', sort @AllCanBuild);
-
 
1765
 
-
 
1766
    # Platforms that have been specifically excluded from the build
-
 
1767
    push @propLines, "excluded.platforms = " . join(',', sort @BUILDEXCLUDE);
-
 
1768
 
-
 
1769
    # Platforms not known to JATS
-
 
1770
    # Only works in ABT mode. Errors will be detected before this
-
 
1771
    push @propLines, "unknown.platforms = " . join(',', sort @BUILD_BADNAME);
-
 
1772
    
-
 
1773
    # Toolset build information
-
 
1774
    CalcToolsetBuildInfo(@AllCanBuild);
-
 
1775
    if (exists $toolsetData->{platforms}) {
-
 
1776
        push @propLines, "toolset.platforms = " . join(',', sort @{$toolsetData->{platforms}});
-
 
1777
    }
-
 
1778
 
-
 
1779
    # Indication of production and debug builds
-
 
1780
    my (@OnlyProd, @OnlyDebug);
-
 
1781
    foreach my $platform ( sort keys %BUILDPLATFORMARGS) {
-
 
1782
        foreach my $arg ( split($;, $BUILDPLATFORMARGS{$platform})) {
-
 
1783
            push (@OnlyProd,  $platform) if ($arg =~ m~--OnlyProd~);
-
 
1784
            push (@OnlyDebug, $platform)  if ($arg =~ m~--OnlyDebug~);
-
 
1785
        }
-
 
1786
    }
-
 
1787
    push @propLines, "prod.platforms = " . join(',', sort @OnlyProd) ;
-
 
1788
    push @propLines, "debug.platforms = " . join(',', sort @OnlyDebug) ;
-
 
1789
 
-
 
1790
    # JAVA version specified
-
 
1791
    if ($BUILDPLATFORMARGS{JAVA}) {
-
 
1792
        foreach my $arg ( split($;, $BUILDPLATFORMARGS{JAVA})) {
-
 
1793
            if ($arg =~ m~^--Version=(.*)~i) {
-
 
1794
                push @propLines, "java.version = " . $1;
-
 
1795
                last;
-
 
1796
            }
-
 
1797
        }
-
 
1798
    }
-
 
1799
 
-
 
1800
    # The package is GENERIC
-
 
1801
    if ($#GENERIC_TARGETS >= 0) {
-
 
1802
        push @propLines, "generic.build = 1";
-
 
1803
    }
-
 
1804
 
-
 
1805
    $fh->WriteLn(@propLines);
-
 
1806
    $fh->Close();
-
 
1807
 
-
 
1808
    # Display for user gratification (and build system logging)
-
 
1809
    Information($BuildInfoFile,@propLines);
-
 
1810
    exit 0;
-
 
1811
}
-
 
1812
 
-
 
1813
#-------------------------------------------------------------------------------
1693
# Function        : needToolset 
1814
# Function        : needToolset 
1694
#
1815
#
1695
# Description     : Internal. Determine if this machine needs to build for
1816
# Description     : Internal. Determine if this machine needs to build for
1696
#                   a TOOLSET or a GENERIC_<MachType>
1817
#                   a TOOLSET or a GENERIC_<MachType>
1697
#                   
1818
#                   
Line 1767... Line 1888...
1767
 
1888
 
1768
    #
1889
    #
1769
    #   Need to ensure that we have a TOOLSET platform in the build set
1890
    #   Need to ensure that we have a TOOLSET platform in the build set
1770
    #
1891
    #
1771
    my %activePlatformMap = map {$_ => 1} @BUILD_ACTIVEPLATFORMS;
1892
    my %activePlatformMap = map {$_ => 1} @BUILD_ACTIVEPLATFORMS;
1772
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET'); 
1893
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET');
1773
    foreach my $item (@toolsetTargets)
1894
    foreach my $item (@toolsetTargets)
1774
    {
1895
    {
1775
        if (exists($activePlatformMap{$item}))
1896
        if (exists($activePlatformMap{$item}))
1776
        {
1897
        {
1777
            #
1898
            #
Line 1804... Line 1925...
1804
    $BUILDALIAS{TOOLSET} = $toolset;
1925
    $BUILDALIAS{TOOLSET} = $toolset;
1805
    push @{$BUILDINFO{$toolset}{USERALIAS}}, 'TOOLSET';
1926
    push @{$BUILDINFO{$toolset}{USERALIAS}}, 'TOOLSET';
1806
}
1927
}
1807
 
1928
 
1808
#-------------------------------------------------------------------------------
1929
#-------------------------------------------------------------------------------
-
 
1930
# Function        : CalcToolsetBuildInfo 
-
 
1931
#
-
 
1932
# Description     : Calculate the Toolset component of the BuildInfo
-
 
1933
#                   Note: Similar to ProcessToolSetPlatform (above)
-
 
1934
#                   
-
 
1935
#                   Need to determine the most suitable platform for building toolsets. 
-
 
1936
#                   Only consider those that are a part of the build set
-
 
1937
#
-
 
1938
# Inputs          : AllPlatforms    - an Array of all platrform that this package can
-
 
1939
#                                     be built on with the current build filter 
-
 
1940
#
-
 
1941
# Returns         : 
-
 
1942
#
-
 
1943
sub  CalcToolsetBuildInfo {
-
 
1944
    my (@allPlatforms) = @_;
-
 
1945
    return unless $toolsetData->{enableToolset};
-
 
1946
       
-
 
1947
    my %toolsetSelected;
-
 
1948
    my %platformMap = map {$_ => 1} @allPlatforms;
-
 
1949
    my @toolsetTargets = PlatformConfig::getTargetsByTag('TOOLSET');
-
 
1950
    foreach my $item (@toolsetTargets)
-
 
1951
    {
-
 
1952
        if (exists($platformMap{$item}))
-
 
1953
        {
-
 
1954
            my $include = 0;
-
 
1955
            my $toolMachType = PlatformConfig::targetHasTag($item, 'MACHTYPE');
-
 
1956
 
-
 
1957
            # Specifically included
-
 
1958
            if (exists $toolsetData->{include}){
-
 
1959
                if (exists $toolsetData->{include}{ lc $toolMachType}) {
-
 
1960
                    $include = 1;
-
 
1961
                }
-
 
1962
            # Specifically excluded
-
 
1963
            } elsif (exists $toolsetData->{exclude}) {
-
 
1964
                unless (exists $toolsetData->{exclude}{ lc $toolMachType}) {
-
 
1965
                    $include = 1;
-
 
1966
                }
-
 
1967
            # Default
-
 
1968
            } else {
-
 
1969
                $include = 1;
-
 
1970
            }
-
 
1971
 
-
 
1972
            if ($include) {
-
 
1973
                unless (exists $toolsetSelected{$toolMachType}) {
-
 
1974
                    $toolsetSelected{$toolMachType} = $item;
-
 
1975
                    push @{$toolsetData->{platforms}}, $item;
-
 
1976
                }
-
 
1977
            }
-
 
1978
        }
-
 
1979
    }
-
 
1980
#DebugDumpData("toolsetSelected", \%toolsetSelected);
-
 
1981
}
-
 
1982
 
-
 
1983
#-------------------------------------------------------------------------------
1809
# Function        : BuildPreviousVersion 
1984
# Function        : BuildPreviousVersion 
1810
#
1985
#
1811
# Description     : Deprecated. Do not use 
1986
# Description     : Deprecated. Do not use 
1812
#
1987
#
1813
# Inputs          : 
1988
# Inputs          : 
Line 4962... Line 5137...
4962
jats build [options] [command]
5137
jats build [options] [command]
4963
 
5138
 
4964
     [perl buildlib.pl [options] PWD [command]]
5139
     [perl buildlib.pl [options] PWD [command]]
4965
 
5140
 
4966
 Options:
5141
 Options:
4967
    -help          - Display terse usage
5142
    -help           - Display terse usage
4968
    -help -help    - Display verbose usage
5143
    -help -help     - Display verbose usage
4969
    -man           - Display internal manual
5144
    -man            - Display internal manual
4970
    -verbose[=n]   - Set level of progress verbosity
5145
    -verbose[=n]    - Set level of progress verbosity
4971
    -debug[=n]     - Set the debug level
5146
    -debug[=n]      - Set the debug level
4972
    -cache         - Cache packages in the local dpkg_package cache
5147
    -cache          - Cache packages in the local dpkg_package cache
4973
    -localcache    - Cache packages into the interface directory
5148
    -localcache     - Cache packages into the interface directory
4974
    -cache -cache  - Forced refresh dependent packages in the local cache
5149
    -cache -cache   - Forced refresh dependent packages in the local cache
4975
    -package       - Ignore packages that are not available and continue
5150
    -package        - Ignore packages that are not available and continue
4976
    -nopackages    - Ignore package processing directives
5151
    -nopackages     - Ignore package processing directives
4977
    -forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
5152
    -forcebuildpkg  - Treat LinkPkgArchive directives as BuildPkgArchive
4978
                     Also suppress the use of symlinks so that the physical
5153
                      Also suppress the use of symlinks so that the physical
4979
                     file will be copied locally.
5154
                      file will be copied locally.
4980
    -[no]force     - Force build even if build.pl is not newer
5155
    -[no]force      - Force build even if build.pl is not newer
4981
                     Default: -force
5156
                      Default: -force
4982
    -[no]generic   - Build system sanity test
5157
    -[no]generic    - Build system sanity test
4983
                     Default: Do not test
5158
                      Default: Do not test
-
 
5159
    -buildinfo=path - Specify name of the buildinfo file
4984
 
5160
 
4985
 Sticky settings:
5161
 Sticky settings:
4986
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
5162
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
4987
    -expert[=n]    - Relaxing dependency checks on the user makefiles
5163
    -expert[=n]    - Relaxing dependency checks on the user makefiles
4988
 
5164
 
4989
 Commands:
5165
 Commands:
4990
    clobber        - Remove generated build system (eg Makefiles).
5166
    clobber        - Remove generated build system (eg Makefiles).
4991
    interface      - Only (re)build the interface tree.
5167
    interface      - Only (re)build the interface tree.
4992
    rootonly       - Only (re)build the root directory.
5168
    rootonly       - Only (re)build the root directory.
-
 
5169
    buildinfo      - Only generate build system info.
4993
 
5170
 
4994
=head1 OPTIONS
5171
=head1 OPTIONS
4995
 
5172
 
4996
=over 8
5173
=over 8
4997
 
5174
 
Line 5094... Line 5271...
5094
 
5271
 
5095
The default is to not perform the test.
5272
The default is to not perform the test.
5096
 
5273
 
5097
This option is intended to be used by the automated build system.
5274
This option is intended to be used by the automated build system.
5098
 
5275
 
-
 
5276
=item B<-buildinfo>
-
 
5277
 
-
 
5278
This option is only used in conjunction with the 'buildinfo' command. It will specify 
-
 
5279
the path of a file to write the build information. The dafault value is 'BuildInfo.properties'.
-
 
5280
 
-
 
5281
This option, by itslef, will not invoke the buildinfo mode.
-
 
5282
 
5099
=item B<-all>
5283
=item B<-all>
5100
 
5284
 
5101
This option will cause the build process to generate makefiles for all
5285
This option will cause the build process to generate makefiles for all
5102
possible build targets ignoring the use of GBE_BUILDFILTER.
5286
possible build targets ignoring the use of GBE_BUILDFILTER.
5103
 
5287
 
Line 5137... Line 5321...
5137
the root-level makefiles.
5321
the root-level makefiles.
5138
 
5322
 
5139
The build process will not recurse through the subdirectories creating
5323
The build process will not recurse through the subdirectories creating
5140
makefiles. These can be made on-demand by jats if a 'make' command is issued.
5324
makefiles. These can be made on-demand by jats if a 'make' command is issued.
5141
 
5325
 
-
 
5326
 
-
 
5327
=item B<buildinfo>
-
 
5328
 
-
 
5329
This command is used by the build system to generate information about the
-
 
5330
build. It will create a file with the following information.
-
 
5331
 
-
 
5332
=over 4
-
 
5333
 
-
 
5334
=item * All platforms that the package can be built for.
-
 
5335
 
-
 
5336
=item * All platforms that the package will be built for with the current build filter
-
 
5337
 
-
 
5338
=item * Platforms that have been specifically excluded from the build
-
 
5339
 
-
 
5340
=item * Platforms not known to JATS
-
 
5341
 
-
 
5342
=item * Toolset build information
-
 
5343
 
-
 
5344
=item * Generic build information
-
 
5345
 
-
 
5346
=item * Indication of production and debug builds
-
 
5347
 
-
 
5348
=item * JAVA version specified
-
 
5349
 
-
 
5350
=back
-
 
5351
 
-
 
5352
 
-
 
5353
 
5142
=item B<clobber>
5354
=item B<clobber>
5143
 
5355
 
5144
This command will remove generated build system files and directories.
5356
This command will remove generated build system files and directories.
5145
 
5357
 
5146
=back
5358
=back