Subversion Repositories DevTools

Rev

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

Rev 7321 Rev 7322
Line 76... Line 76...
76
our @BUILD_BADNAME          = ();               # Unknown platforms
76
our @BUILD_BADNAME          = ();               # Unknown platforms
77
our @GENERIC_TARGETS        = ();               # Generic targets - only one allowed
77
our @GENERIC_TARGETS        = ();               # Generic targets - only one allowed
78
 
78
 
79
our $BUILDNAME              = "";               # BuildName()
79
our $BUILDNAME              = "";               # BuildName()
80
our $BUILDVERSION           = "";               # BuildName()
80
our $BUILDVERSION           = "";               # BuildName()
-
 
81
our $BUILDBASEVERSION       = "";               # BuildName
81
our $BUILDNAME_PACKAGE;                         # Name
82
our $BUILDNAME_PACKAGE;                         # Name
82
our $BUILDNAME_VERSION;                         # Version
83
our $BUILDNAME_VERSION;                         # Version
83
our $BUILDNAME_PROJECT;                         # Project(optional)
84
our $BUILDNAME_PROJECT;                         # Project(optional)
84
our $BUILDNAME_SUFFIX;                          # Project (available)
85
our $BUILDNAME_SUFFIX;                          # Project (available)
85
our $DEPLOY_PATCH           = 0;                # Deplyment patch number
86
our $DEPLOY_PATCH           = 0;                # Deplyment patch number
Line 115... Line 116...
115
our $BUILD_UUID             = time() . substr(rand(),2); # Build Unique Identifier
116
our $BUILD_UUID             = time() . substr(rand(),2); # Build Unique Identifier
116
 
117
 
117
my  $DeleteDPACKAGE         = 0;                # Must clobber DPACKAGE
118
my  $DeleteDPACKAGE         = 0;                # Must clobber DPACKAGE
118
my  $build_source_pkg       = 0;                # Flag to build source package
119
my  $build_source_pkg       = 0;                # Flag to build source package
119
my  $opt_help               = 0;
120
my  $opt_help               = 0;
-
 
121
my  $opt_localCache         = 0;                # Create cache within the interface directory
120
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
122
my  $pkgFromSandbox         = 0;                # Flags that we have imported a package from a sandbox
121
 
123
 
122
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
124
my  $genToolsetPlatform     = 0;                # BuildToolset directive has been seen
123
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
125
my  $genToolsetActive       = 0;                # TOOLSET platform required:1, Error:2
124
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
126
my  $toolsetPlatform        = 'NONE';           # TOOLSET Display Value
Line 183... Line 185...
183
                             "package"       => \$NoPackageError,
185
                             "package"       => \$NoPackageError,
184
                             "nopackages"    => \$IgnorePkgs,
186
                             "nopackages"    => \$IgnorePkgs,
185
                             "forcebuildpkg" => \$ForceBuildPkg,
187
                             "forcebuildpkg" => \$ForceBuildPkg,
186
                             "force!"        => \$ForceBuild,
188
                             "force!"        => \$ForceBuild,
187
                             "generic!"      => \$GenericBuild,
189
                             "generic!"      => \$GenericBuild,
-
 
190
                             "localcache!"   => \$opt_localCache,
188
                             "signature:s"   => \$CheckSignature,
191
                             "signature:s"   => \$CheckSignature,
189
                             );
192
                             );
190
    Usage() if ( $opt_help || !$result );
193
    Usage() if ( $opt_help || !$result );
191
 
194
 
192
    Debug( "Host:          ", $ScmHost );
195
    Debug( "Host:          ", $ScmHost );
Line 202... Line 205...
202
    Debug( "package:       ", $NoPackageError );
205
    Debug( "package:       ", $NoPackageError );
203
    Debug( "ForcePkg  :    ", $ForceBuildPkg );
206
    Debug( "ForcePkg  :    ", $ForceBuildPkg );
204
    Debug( "ForceBuild :   ", $ForceBuild );
207
    Debug( "ForceBuild :   ", $ForceBuild );
205
    Debug( "IgnorePkgs :   ", $IgnorePkgs );
208
    Debug( "IgnorePkgs :   ", $IgnorePkgs );
206
    Debug( "GenericTest :  ", $GenericBuild );
209
    Debug( "GenericTest :  ", $GenericBuild );
-
 
210
    Debug( "LocalCache :   ", $opt_localCache );
207
 
211
 
208
#.. Command
212
#.. Command
209
#
213
#
210
 
214
 
211
    $CmdSwitch = (lc shift @ARGV) if @ARGV;
215
    $CmdSwitch = (lc shift @ARGV) if @ARGV;
Line 239... Line 243...
239
    #
243
    #
240
    #   If we are not performing a ForceBuild, then we don't need to continue
244
    #   If we are not performing a ForceBuild, then we don't need to continue
241
    #   We have updated the interface directory with BuildPkgArchive
245
    #   We have updated the interface directory with BuildPkgArchive
242
    #   information.
246
    #   information.
243
    #
247
    #
244
    unless ( $::GBE_SANDBOX ) {
248
    unless ( $::GBE_SANDBOX )
-
 
249
    {
245
        TestForForcedBuild();
250
        TestForForcedBuild();
246
    }
251
    }
247
 
252
 
248
    #
253
    #
249
    #   Must inform makelib that its running under buildlib
254
    #   Must inform makelib that its running under buildlib
Line 1541... Line 1546...
1541
    $BUILDNAME_PROJECT = $build_info->{BUILDNAME_PROJECT};
1546
    $BUILDNAME_PROJECT = $build_info->{BUILDNAME_PROJECT};
1542
    $BUILDNAME_SUFFIX  = $BUILDNAME_PROJECT ? '.' . $BUILDNAME_PROJECT : '';
1547
    $BUILDNAME_SUFFIX  = $BUILDNAME_PROJECT ? '.' . $BUILDNAME_PROJECT : '';
1543
 
1548
 
1544
    $BUILDNAME         = $build_info->{BUILDNAME};
1549
    $BUILDNAME         = $build_info->{BUILDNAME};
1545
    $BUILDVERSION      = $build_info->{BUILDVERSION};
1550
    $BUILDVERSION      = $build_info->{BUILDVERSION};
-
 
1551
    $BUILDBASEVERSION  = $build_info->{BUILDNAME_BASE_VERSION};
1546
 
1552
 
1547
    $DEPLOY_PATCH      = $build_info->{DEPLOY_PATCH} || 0;
1553
    $DEPLOY_PATCH      = $build_info->{DEPLOY_PATCH} || 0;
1548
 
1554
 
1549
    #
1555
    #
1550
    #   Clobber processing done after values have been accumulated
1556
    #   Clobber processing done after values have been accumulated
Line 1902... Line 1908...
1902
 
1908
 
1903
    } else {
1909
    } else {
1904
        push @createDirs, "$ifdirname/include";
1910
        push @createDirs, "$ifdirname/include";
1905
        $BUILDINTERFACE = $ifdirname;
1911
        $BUILDINTERFACE = $ifdirname;
1906
        $::ScmInterface = $ifdirname;
1912
        $::ScmInterface = $ifdirname;
-
 
1913
 
-
 
1914
        #
-
 
1915
        #   Set up the local cache
-
 
1916
        #
-
 
1917
        my $iCache = "$ifdirname/dpkg_cache";
-
 
1918
        if ($BUILDINTERFACE && $opt_localCache) {
-
 
1919
            my $iCache = "$ifdirname/dpkg_cache";
-
 
1920
            push @createDirs, $iCache;
-
 
1921
 
-
 
1922
            $Cache = $opt_localCache;
-
 
1923
            $::GBE_DPKG_CACHE = FullPath($iCache);
-
 
1924
            $ENV{GBE_DPKG_CACHE} = $::GBE_DPKG_CACHE; 
-
 
1925
        } elsif (-d  $iCache ){
-
 
1926
            #$Cache = 1 if $Cache == 0;
-
 
1927
            $::GBE_DPKG_CACHE = FullPath($iCache);
-
 
1928
            $ENV{GBE_DPKG_CACHE} = $::GBE_DPKG_CACHE; 
-
 
1929
        }
1907
    }
1930
    }
1908
 
1931
 
1909
    unless ($Clobber) {
1932
    unless ($Clobber) {
1910
        push @createDirs, "$ifdirname/bin";
1933
        push @createDirs, "$ifdirname/bin";
1911
        push @createDirs, "$ifdirname/lib";
1934
        push @createDirs, "$ifdirname/lib";
Line 2234... Line 2257...
2234
        #   version as having been used. Used by cache cleanup algorithms
2257
        #   version as having been used. Used by cache cleanup algorithms
2235
        #
2258
        #
2236
        if ( $isa_cache  )
2259
        if ( $isa_cache  )
2237
        {
2260
        {
2238
            TouchFile ( "$pkg/used.cache", "Marks the cache copy as being used");
2261
            TouchFile ( "$pkg/used.cache", "Marks the cache copy as being used");
-
 
2262
            #print( "                  Cached -> $pkg\n" );
2239
        }
2263
        }
2240
 
2264
 
2241
        #
2265
        #
2242
        #   Use the first suitable package found
2266
        #   Use the first suitable package found
2243
        #..
2267
        #..
Line 2452... Line 2476...
2452
}
2476
}
2453
 
2477
 
2454
#-------------------------------------------------------------------------------
2478
#-------------------------------------------------------------------------------
2455
# Function        : LinkEntry
2479
# Function        : LinkEntry
2456
#
2480
#
2457
# Description     : Scan a package an locate platform specific directories
2481
# Description     : Scan a package and locate platform specific directories
2458
#                   Create data structures to capture the information
2482
#                   Create data structures to capture the information
2459
#                   This function is used by LinkPkgArchive
2483
#                   This function is used by LinkPkgArchive
2460
#                   to perfom the bulk of package inclusion work.
2484
#                   to perfom the bulk of package inclusion work.
2461
#
2485
#
2462
# Inputs          : $platform   - Platform being processed
2486
# Inputs          : $platform   - Platform being processed
Line 3096... Line 3120...
3096
#
3120
#
3097
# Returns         : Undefined
3121
# Returns         : Undefined
3098
#
3122
#
3099
sub BuildReleaseFile
3123
sub BuildReleaseFile
3100
{
3124
{
-
 
3125
    Warning("BuildReleaseFile directive does nothing and should be removed") unless $Clobber;
3101
}
3126
}
3102
 
3127
 
3103
#-------------------------------------------------------------------------------
3128
#-------------------------------------------------------------------------------
3104
# Function        : BuildSnapshot
3129
# Function        : BuildSnapshot
3105
#
3130
#
Line 3111... Line 3136...
3111
#
3136
#
3112
# Returns         : Undefined
3137
# Returns         : Undefined
3113
#
3138
#
3114
sub BuildSnapshot
3139
sub BuildSnapshot
3115
{
3140
{
-
 
3141
    Warning("BuildSnapshot directive does nothing and should be removed") unless $Clobber;
3116
}
3142
}
3117
 
3143
 
3118
#-------------------------------------------------------------------------------
3144
#-------------------------------------------------------------------------------
3119
# Function        : BuildSrcArchive
3145
# Function        : BuildSrcArchive
3120
#
3146
#
Line 3312... Line 3338...
3312
#
3338
#
3313
# Returns         : Undefined
3339
# Returns         : Undefined
3314
#
3340
#
3315
sub BuildAccessPerms
3341
sub BuildAccessPerms
3316
{
3342
{
-
 
3343
    Warning("BuildAccessPerms directive does nothing and should be removed") unless $Clobber;
3317
}
3344
}
3318
 
3345
 
3319
 
3346
 
3320
sub BuildSetenv
3347
sub BuildSetenv
3321
{
3348
{
-
 
3349
    Warning("BuildSetenv directive does nothing and should be removed") unless $Clobber;
3322
    push( @BUILDSETENV, @_ );
3350
    push( @BUILDSETENV, @_ );
3323
}
3351
}
3324
 
3352
 
3325
#-------------------------------------------------------------------------------
3353
#-------------------------------------------------------------------------------
3326
# Function        : DataDirective
3354
# Function        : DataDirective
Line 4335... Line 4363...
4335
\$ScmBuildName                  = \"$BUILDNAME\";
4363
\$ScmBuildName                  = \"$BUILDNAME\";
4336
\$ScmBuildPackage               = \"$BUILDNAME_PACKAGE\";
4364
\$ScmBuildPackage               = \"$BUILDNAME_PACKAGE\";
4337
\$ScmBuildVersion               = \"$BUILDNAME_VERSION\";
4365
\$ScmBuildVersion               = \"$BUILDNAME_VERSION\";
4338
\$ScmBuildProject               = \"$BUILDNAME_PROJECT\";
4366
\$ScmBuildProject               = \"$BUILDNAME_PROJECT\";
4339
\$ScmBuildVersionFull           = \"$BUILDVERSION\";
4367
\$ScmBuildVersionFull           = \"$BUILDVERSION\";
-
 
4368
\$ScmBuildBaseVersion           = \"$BUILDBASEVERSION\";
4340
\$ScmBuildPreviousVersion       = \"$BUILDPREVIOUSVERSION\";
4369
\$ScmBuildPreviousVersion       = \"$BUILDPREVIOUSVERSION\";
4341
\$ScmLocal                      = \"$BUILDLOCAL\";
4370
\$ScmLocal                      = \"$BUILDLOCAL\";
4342
\$ScmDeploymentPatch            = \"$DEPLOY_PATCH\";
4371
\$ScmDeploymentPatch            = \"$DEPLOY_PATCH\";
4343
\$ScmSrcDir                     = \"$Srcdir\";
4372
\$ScmSrcDir                     = \"$Srcdir\";
4344
\$ScmBuildSrc                   = \"$ScmBuildSrc\";
4373
\$ScmBuildSrc                   = \"$ScmBuildSrc\";
Line 4637... Line 4666...
4637
sub BuildSharedLibFiles_WIN
4666
sub BuildSharedLibFiles_WIN
4638
{
4667
{
4639
 
4668
 
4640
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
4669
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
4641
    {
4670
    {
-
 
4671
        my @pathList;
4642
        next unless ( exists $BUILDINFO{$platform}{EXT_SHARED} );
4672
        if (exists $BUILDINFO{$platform}{EXT_SHARED} ) {
4643
        my @dos_paths = BuildSharedLibFiles_list( $platform, $BUILDINFO{$platform}{EXT_SHARED} );
4673
            push @pathList, reverse BuildSharedLibFiles_list( $platform, $BUILDINFO{$platform}{EXT_SHARED} );
-
 
4674
        }
-
 
4675
        push @pathList, @BUILDTOOLS; 
4644
 
4676
 
4645
        #
4677
        #
4646
        #   Create a .bat file for WIN32
4678
        #   Create a .bat file for WIN32
4647
        #   This may be consumed by user wrapper programs
4679
        #   This may be consumed by user wrapper programs
4648
        #
4680
        #
Line 4651... Line 4683...
4651
        #
4683
        #
4652
        my $fh = ::ConfigurationFile::New( "$BUILDINTERFACE/set_$platform.bat", '--NoEof', '--Type=bat' );
4684
        my $fh = ::ConfigurationFile::New( "$BUILDINTERFACE/set_$platform.bat", '--NoEof', '--Type=bat' );
4653
        $fh->Write ( "\@echo off\n");
4685
        $fh->Write ( "\@echo off\n");
4654
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4686
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4655
        $fh->Write ( "\nSETLOCAL\n");
4687
        $fh->Write ( "\nSETLOCAL\n");
4656
        foreach ( reverse @dos_paths )
4688
        foreach ( @pathList ) {
4657
        {
-
 
4658
            $_ =~ s~/~\\~g;
4689
            $_ =~ s~/~\\~g;
4659
            $fh->Write ( "PATH=$_;\%PATH\%\n" );
4690
            $fh->Write ( "PATH=$_;\%PATH\%\n" );
4660
        }
4691
        }
4661
        $fh->Write ( "\n%*\n" );
4692
        $fh->Write ( "\n%*\n" );
4662
        $fh->Write ( "\nENDLOCAL\n");
4693
        $fh->Write ( "\nENDLOCAL\n");
Line 4667... Line 4698...
4667
        #   Create a .sh file for WIN32
4698
        #   Create a .sh file for WIN32
4668
        #   This may be consumed by a shell - as used within JATS
4699
        #   This may be consumed by a shell - as used within JATS
4669
        #
4700
        #
4670
        $fh = ::ConfigurationFile::New( "$BUILDINTERFACE/set_$platform.sh", '--NoEof', '--Type=sh' );
4701
        $fh = ::ConfigurationFile::New( "$BUILDINTERFACE/set_$platform.sh", '--NoEof', '--Type=sh' );
4671
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4702
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4672
        foreach ( reverse @dos_paths )
4703
        foreach ( @pathList ) {
4673
        {
-
 
4674
            tr~\\/~/~s;
4704
            tr~\\/~/~s;
4675
            $fh->Write ( "PATH=$_\\;\$PATH\n" );
4705
            $fh->Write ( "PATH=$_\\;\$PATH\n" );
4676
        }
4706
        }
4677
        $fh->Write ( "\n" . '[ -n "$*" ] && "$@"'  ."\n" );
4707
        $fh->Write ( "\n" . '[ -n "$*" ] && "$@"'  ."\n" );
4678
        $fh->Close();
4708
        $fh->Close();
Line 4691... Line 4721...
4691
#
4721
#
4692
sub BuildSharedLibFiles_Unix
4722
sub BuildSharedLibFiles_Unix
4693
{
4723
{
4694
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
4724
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
4695
    {
4725
    {
-
 
4726
        my @unix_paths;
4696
        next unless ( exists $BUILDINFO{$platform}{EXT_SHARED} );
4727
        if ( exists $BUILDINFO{$platform}{EXT_SHARED} ) {
4697
        my @unix_paths = BuildSharedLibFiles_list( $platform, $BUILDINFO{$platform}{EXT_SHARED} );
4728
            @unix_paths = BuildSharedLibFiles_list( $platform, $BUILDINFO{$platform}{EXT_SHARED} );
4698
 
4729
 
4699
        #
4730
            #
4700
        #   Create sonames for all shared libraries
4731
            #   Create sonames for all shared libraries
4701
        #   Append to the begging of the search list - so that it will rendered last
4732
            #   Append to the begging of the search list - so that it will rendered last
4702
        #   
4733
            #   
4703
        my $sodir = BuildSoNameLinks_Unix($platform, @unix_paths);
4734
            my $sodir = BuildSoNameLinks_Unix($platform, @unix_paths);
4704
        unshift( @unix_paths, $sodir ) if defined $sodir;
4735
            unshift( @unix_paths, $sodir ) if defined $sodir;
-
 
4736
        }
4705
 
4737
 
4706
        #
4738
        #
4707
        #   Create a .sh file for Unix
4739
        #   Create a .sh file for Unix
4708
        #
4740
        #
4709
        my $file = "$BUILDINTERFACE/set_$platform.sh";
4741
        my $file = "$BUILDINTERFACE/set_$platform.sh";
4710
        my $fh = ::ConfigurationFile::New( $file , '--NoEof', '--Type=sh' );
4742
        my $fh = ::ConfigurationFile::New( $file , '--NoEof', '--Type=sh' );
4711
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4743
        $fh->Header( "Buildlib ($BuildVersion)","Shared Library Paths" );
4712
        foreach ( reverse @unix_paths )
4744
        foreach ( reverse @unix_paths, @BUILDTOOLS ) {
4713
        {
-
 
4714
            $fh->Write ( "export LD_LIBRARY_PATH=$_:\$LD_LIBRARY_PATH\n" );
4745
            $fh->Write ( "export LD_LIBRARY_PATH=$_:\$LD_LIBRARY_PATH\n" );
4715
        }
4746
        }
-
 
4747
 
-
 
4748
        #
-
 
4749
        #   Extend the search path to allow tools to be located
-
 
4750
        #   Have already extended LD_LIBRARY_PATH to allow for tools shared libaraies 
-
 
4751
        #   
-
 
4752
        $fh->Write ( "\n# Extend Tool Search Path\n" );
-
 
4753
        foreach ( @BUILDTOOLS ) {
-
 
4754
            tr~\\/~/~s;
-
 
4755
            $fh->Write ( "PATH=$_:\$PATH\n" );
-
 
4756
        }
-
 
4757
 
4716
        $fh->Write ( "\n\"\$\@\"\n" );
4758
        $fh->Write ( "\n\"\$\@\"\n" );
4717
        $fh->Close();
4759
        $fh->Close();
4718
 
4760
 
4719
        #
4761
        #
4720
        #   Make the file executable under unix
4762
        #   Make the file executable under unix
Line 5124... Line 5166...
5124
    -help -help    - Display verbose usage
5166
    -help -help    - Display verbose usage
5125
    -man           - Display internal manual
5167
    -man           - Display internal manual
5126
    -verbose[=n]   - Set level of progress verbosity
5168
    -verbose[=n]   - Set level of progress verbosity
5127
    -debug[=n]     - Set the debug level
5169
    -debug[=n]     - Set the debug level
5128
    -cache         - Cache packages in the local dpkg_package cache
5170
    -cache         - Cache packages in the local dpkg_package cache
-
 
5171
    -localcache    - Cache packages into the interface directory
5129
    -cache -cache  - Forced refresh dependent packages in the local cache
5172
    -cache -cache  - Forced refresh dependent packages in the local cache
5130
    -package       - Ignore packages that are not available and continue
5173
    -package       - Ignore packages that are not available and continue
5131
    -nopackages    - Ignore package processing directives
5174
    -nopackages    - Ignore package processing directives
5132
    -forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
5175
    -forcebuildpkg - Treat LinkPkgArchive directives as BuildPkgArchive
5133
                     Also suppress the use of symlinks so that the physical
5176
                     Also suppress the use of symlinks so that the physical
Line 5179... Line 5222...
5179
If an argument is provided, then it will be used to set the level, otherwise the
5222
If an argument is provided, then it will be used to set the level, otherwise the
5180
existing level will be incremented. This option may be specified multiple times.
5223
existing level will be incremented. This option may be specified multiple times.
5181
 
5224
 
5182
=item B<-cache>
5225
=item B<-cache>
5183
 
5226
 
5184
This option will cause dependent packages to be cached in the local
5227
This option will cause dependent packages to be cached in the users local
-
 
5228
dpkg_archive cache as defined via GBE_DPKG_CACHE
-
 
5229
 
-
 
5230
If the option is used twice then the packages will be forcibly refreshed.
-
 
5231
 
5185
dpkg_archive cache.
5232
=item B<-localcache>
-
 
5233
 
-
 
5234
This option will cause dependent packages to be cached into the interface 
-
 
5235
directory. This option simplifies the use of a cache when building single
-
 
5236
packages.
5186
 
5237
 
5187
If the option is used twice then the packages will be forcibly refreshed.
5238
If the option is used twice then the packages will be forcibly refreshed.
5188
 
5239
 
5189
=item B<-package>
5240
=item B<-package>
5190
 
5241