Subversion Repositories DevTools

Rev

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

Rev 3965 Rev 4001
Line 81... Line 81...
81
our %PKGRULES               = ();               # Package include and link rules
81
our %PKGRULES               = ();               # Package include and link rules
82
our @BUILDTOOLS             = ();               # Extended tool path
82
our @BUILDTOOLS             = ();               # Extended tool path
83
our $BUILDPHASE             = 0;                # In Build Phase
83
our $BUILDPHASE             = 0;                # In Build Phase
84
our @CLOBBERDIRS            = ();               # Directories to clobber
84
our @CLOBBERDIRS            = ();               # Directories to clobber
85
our @REMOVEDIRS             = ();               # Directories to remove - if empty
85
our @REMOVEDIRS             = ();               # Directories to remove - if empty
86
our @CLOBBERFILES           = ();               # Files to clobber
-
 
87
our %BUILD_KNOWNFILES       = ();               # Files that will be known
86
our %BUILD_KNOWNFILES       = ();               # Files that will be known
88
 
87
 
89
our $Makelib                = "";
88
our $Makelib                = "";
90
our $GBE_CORE;                                  # Root of JATS
89
our $GBE_CORE;                                  # Root of JATS
91
our $InterfaceVersion;                          # Interface directory format version
90
our $InterfaceVersion;                          # Interface directory format version
92
our $ScmRoot;                                   # Package Root
91
our $ScmRoot;                                   # Package Root
93
our $ScmInterface;                              # Interface directory
92
our $ScmInterface;                              # Interface directory
94
our $ScmBuildFilter;                            # Build Filter when build was created
93
our $ScmBuildFilter;                            # Build Filter when build was created
-
 
94
our $NoBuild                = 0;                # Dummy Build under ABT only
95
 
95
 
96
 
96
 
97
my  $DeleteDPACKAGE         = 0;                # Must clobber DPACKAGE
97
my  $DeleteDPACKAGE         = 0;                # Must clobber DPACKAGE
98
my  $build_source_pkg       = 0;                # Flag to build source package
98
my  $build_source_pkg       = 0;                # Flag to build source package
99
my  $opt_help               = 0;
99
my  $opt_help               = 0;
Line 1224... Line 1224...
1224
 
1224
 
1225
    #
1225
    #
1226
    #   Clobber processing done after values have been accumulated
1226
    #   Clobber processing done after values have been accumulated
1227
    #   as they may be used later
1227
    #   as they may be used later
1228
    #
1228
    #
1229
    push @CLOBBERFILES, 'build.log';
-
 
1230
    push @CLOBBERFILES, 'ChangeLog', 'ChangeLog.bak' if ( $ScmHost eq "Unix" );
-
 
1231
    return if ( $Clobber );
1229
    return if ( $Clobber );
-
 
1230
    ToolsetFile('build.log');
-
 
1231
    ToolsetFile('ChangeLog', 'ChangeLog.bak') if ( $ScmHost eq "Unix" );
1232
 
1232
    
1233
    #
1233
    #
1234
    #   Determine type of sandbox
1234
    #   Determine type of sandbox
1235
    #
1235
    #
1236
    $sandbox_exact = ( -f $::GBE_DPKG_SBOX . '/.exact' )
1236
    $sandbox_exact = ( -f $::GBE_DPKG_SBOX . '/.exact' )
1237
        if ( $::GBE_DPKG_SBOX );
1237
        if ( $::GBE_DPKG_SBOX );
Line 1278... Line 1278...
1278
 
1278
 
1279
    Log( "Platforms .. " . PrintPlatforms(\@BUILDPLATFORMS, $sep) );
1279
    Log( "Platforms .. " . PrintPlatforms(\@BUILDPLATFORMS, $sep) );
1280
 
1280
 
1281
    #
1281
    #
1282
    #   Generate a list of platforms that are completely unknown to JATS
1282
    #   Generate a list of platforms that are completely unknown to JATS
1283
    #   May be the result of a user type or a guess
1283
    #   May be the result of a user typo or a guess
1284
    #
1284
    #
1285
    if ( @BUILD_BADNAME )
1285
    if ( @BUILD_BADNAME )
1286
    {
1286
    {
1287
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1287
        Log( "Unknown Pl . " . PrintPlatforms(\@BUILD_BADNAME, $sep) );
1288
         Warning ("The following platform names are not known to JATS", "@BUILD_BADNAME");
1288
         Warning ("The following platform names are not known to JATS", "@BUILD_BADNAME");
Line 1291... Line 1291...
1291
    #
1291
    #
1292
    #   Generate a list of active platforms
1292
    #   Generate a list of active platforms
1293
    #   Ensure that there are some active platforms
1293
    #   Ensure that there are some active platforms
1294
    #
1294
    #
1295
    GeneratePlatformList();
1295
    GeneratePlatformList();
-
 
1296
    unless( @BUILD_ACTIVEPLATFORMS )
-
 
1297
    {
-
 
1298
        if (defined($::GBE_ABT)) {
-
 
1299
 
-
 
1300
            # Build filter on this machine prevents the package building
-
 
1301
            # On a Build System this is not an error
-
 
1302
            #   Create a dummy platform called NOBUILD
-
 
1303
            #   Do not populate the interface directory with package data
-
 
1304
            #   Flag for jmake to do very little
-
 
1305
            #
-
 
1306
            CreateBuildPlatformEntry('Internal', 0, undef, 'NOBUILD');
-
 
1307
            $IgnorePkgs = 1;
-
 
1308
            $NoBuild = 1;
-
 
1309
            Log( "Build for .. ". PrintPlatforms(['NOBUILD - GBE_BUILDFILTER prevents any targets being built'], $sep));
-
 
1310
 
-
 
1311
        } else {
1296
    Error( "GBE_BUILDFILTER prevents any targets being built" )
1312
            Error( "GBE_BUILDFILTER prevents any targets being built" );
1297
        unless( @BUILD_ACTIVEPLATFORMS );
1313
        }
-
 
1314
    }
-
 
1315
    else
-
 
1316
    {
1298
    Log( "Build for .. ". PrintPlatforms(\@BUILD_ACTIVEPLATFORMS, $sep));
1317
        Log( "Build for .. ". PrintPlatforms(\@BUILD_ACTIVEPLATFORMS, $sep));
-
 
1318
    }
1299
 
1319
 
1300
    #
1320
    #
1301
    #   Generate an error if nothing can be done because the GBE_PLATFORM
1321
    #   Generate an error if nothing can be done because the GBE_PLATFORM
1302
    #   masks any useful operation.
1322
    #   masks any useful operation.
1303
    #
1323
    #
Line 1594... Line 1614...
1594
            LinkEntry( $platform, $pkg, $name, $version, 0, $local );
1614
            LinkEntry( $platform, $pkg, $name, $version, 0, $local );
1595
        }
1615
        }
1596
    }
1616
    }
1597
}
1617
}
1598
 
1618
 
1599
sub LinkClean
-
 
1600
{
-
 
1601
    if ( $BUILDINTERFACE )
-
 
1602
    {                                           # only once
-
 
1603
        # remove generated images
-
 
1604
 
-
 
1605
        Debug( "LinkClean" );
-
 
1606
        foreach my $platform ( @BUILDPLATFORMS )
-
 
1607
        {
-
 
1608
            RmDirTree( "$BUILDINTERFACE/$platform.rul" );
-
 
1609
        }
-
 
1610
    }
-
 
1611
}
-
 
1612
 
-
 
1613
 
-
 
1614
#-------------------------------------------------------------------------------
1619
#-------------------------------------------------------------------------------
1615
# Function        : PackageLocate
1620
# Function        : PackageLocate
1616
#
1621
#
1617
# Description     : Locate a package
1622
# Description     : Locate a package
1618
#                   Once located a package will be processed for each
1623
#                   Once located a package will be processed for each
Line 3076... Line 3081...
3076
        unlink "$BUILDINTERFACE/Dpackage.cfg";
3081
        unlink "$BUILDINTERFACE/Dpackage.cfg";
3077
    }
3082
    }
3078
 
3083
 
3079
    if ( $Clobber )                             # clobber mode ?
3084
    if ( $Clobber )                             # clobber mode ?
3080
    {
3085
    {
-
 
3086
        #
-
 
3087
        #   Read in toolset files - a list of files collected during
3081
        if ( -e "Makefile.gbe" )
3088
        #   previous builds
3082
        {
3089
        #
-
 
3090
        ToolsetFile();
-
 
3091
 
-
 
3092
        #
3083
            JatsTool ( 'jmake.pl', 'unmakefiles');
3093
        #   Unmake all the makefiles
-
 
3094
        #   No longer needed as we track the file that are created
-
 
3095
        #
3084
            unlink "Makefile.gbe";
3096
        #if ( -e "Makefile.gbe" )
-
 
3097
        #{
-
 
3098
        #    JatsTool ( 'jmake.pl', 'unmakefiles');
3085
        }
3099
        #}
3086
 
3100
 
-
 
3101
        #
-
 
3102
        #   Delete my own configuration files
-
 
3103
        #
3087
        DeleteCfg();
3104
        DeleteCfg();
3088
        LinkClean();
-
 
3089
 
3105
 
3090
        #
3106
        #
3091
        #   JATS creates a 'pkg' directory for the target package
3107
        #   JATS creates a 'pkg' directory for the target package
3092
        #
3108
        #
3093
        push @CLOBBERDIRS, "pkg";
3109
        push @CLOBBERDIRS, "pkg";
Line 3121... Line 3137...
3121
            {
3137
            {
3122
                rmdir ( $dir ); # Only if empty
3138
                rmdir ( $dir ); # Only if empty
3123
            }
3139
            }
3124
        }
3140
        }
3125
 
3141
 
3126
        foreach my $file ( @CLOBBERFILES )
3142
        if ( exists $::GBE_TOOLSETFiles{Files} )
3127
        {
3143
        {
3128
            if ( -f $file )
3144
            foreach my $file (keys $::GBE_TOOLSETFiles{Files})
3129
            {
3145
            {
-
 
3146
                if ( -f $file )
-
 
3147
                {
3130
                RmDirTree ( $file );
3148
                    RmDirTree ( $file );
-
 
3149
                }
3131
            }
3150
            }
3132
        }
3151
        }
3133
        
3152
        
3134
        #
3153
        #
3135
        #   DPACKAGE may be a user file, Only delete it if we created it
3154
        #   DPACKAGE may be a user file, Only delete it if we created it
Line 3143... Line 3162...
3143
 
3162
 
3144
    #.. Build support files
3163
    #.. Build support files
3145
    #
3164
    #
3146
    DeleteCfg();
3165
    DeleteCfg();
3147
    BuildConfig();
3166
    BuildConfig();
3148
    LinkClean();                                # clean previous images
-
 
3149
    BuildSharedLibFiles();
3167
    BuildSharedLibFiles();
3150
    WriteParsedBuildConfig();
3168
    WriteParsedBuildConfig();
3151
    BuildPackageLink();
3169
    BuildPackageLink();
3152
    BuildSandboxData();
3170
    BuildSandboxData();
-
 
3171
    NoBuildMarker();
3153
 
3172
 
3154
    #
3173
    #
3155
    #  ONLY (re)building interface dir
3174
    #  ONLY (re)building interface dir
3156
    #
3175
    #
3157
    return
3176
    return
Line 3181... Line 3200...
3181
    #
3200
    #
3182
    $ScmBuildlib = 0;                           # clear Buildlib flag for 'makelib.pl'
3201
    $ScmBuildlib = 0;                           # clear Buildlib flag for 'makelib.pl'
3183
    RootMakefile();                             # inform 'makelib.pl'
3202
    RootMakefile();                             # inform 'makelib.pl'
3184
    MakeLibInit();                              # run initialisation
3203
    MakeLibInit();                              # run initialisation
3185
 
3204
 
3186
 
-
 
3187
    #.. Register subdir(s)
3205
    #.. Register subdir(s)
3188
    #
3206
    #
3189
    UniquePush (\@BUILDSUBDIRS, $Srcdir );
3207
    UniquePush (\@BUILDSUBDIRS, $Srcdir );
3190
    SubDir( @BUILDSUBDIRS );
3208
    SubDir( @BUILDSUBDIRS );
3191
    Platform( @BUILD_ACTIVEPLATFORMS );
3209
    Platform( @BUILD_ACTIVEPLATFORMS );
Line 3346... Line 3364...
3346
#
3364
#
3347
# Returns         :
3365
# Returns         :
3348
#
3366
#
3349
sub BuildDescpkg
3367
sub BuildDescpkg
3350
{
3368
{
3351
    StartBuildPhase();                          # Starting the build phase. No more data collection
3369
    StartBuildPhase();                      # Starting the build phase. No more data collection
-
 
3370
    return if ( $Clobber );                 # clobber mode ?
3352
 
3371
 
3353
    #
3372
    #
3354
    #   Store the files location for use at runtime
3373
    #   Store the files location for use at runtime
3355
    #   It will be a file that is 'known' to JATS
3374
    #   It will be a file that is 'known' to JATS
3356
    #
3375
    #
3357
    my $pkgfile = BuildAddKnownFile ( $Srcdir, 'descpkg' );
3376
    my $pkgfile = BuildAddKnownFile ( $NoBuild ? $Cwd : $Srcdir, 'descpkg' );
3358
    return if ( $Clobber );                 # clobber mode ?
-
 
3359
 
3377
 
3360
    my @desc;
3378
    my @desc;
3361
    push @desc, "Package Name:  $BUILDNAME_PACKAGE";
3379
    push @desc, "Package Name:  $BUILDNAME_PACKAGE";
3362
    push @desc, "Version:       $BUILDVERSION";
3380
    push @desc, "Version:       $BUILDVERSION";
3363
    push @desc, "Released By:   $::USER";
3381
    push @desc, "Released By:   $::USER";
Line 3385... Line 3403...
3385
 
3403
 
3386
    FileCreate ($pkgfile, \@desc );
3404
    FileCreate ($pkgfile, \@desc );
3387
}
3405
}
3388
 
3406
 
3389
#-------------------------------------------------------------------------------
3407
#-------------------------------------------------------------------------------
-
 
3408
# Function        : NoBuildMarker
-
 
3409
#
-
 
3410
# Description     : Maintain the nobuild marker
-
 
3411
#                   This is file placed in the interface directory simply
-
 
3412
#                   to indicate to the 'create_dpkg' utility that this build
-
 
3413
#                   does not do anything useful.
-
 
3414
#
-
 
3415
#                   It will only be used on a build machine by the buid daemon
-
 
3416
#
-
 
3417
#                   Its not placed in the interface directory as it would be
-
 
3418
#                   harder for create_dpkg to find it.
-
 
3419
#
-
 
3420
# Inputs          : None
-
 
3421
# Globals         : $NoBuild, $Clobber
-
 
3422
#
-
 
3423
# Returns         : Nothing
-
 
3424
#
-
 
3425
sub NoBuildMarker
-
 
3426
{
-
 
3427
    return if ( $Clobber );
-
 
3428
 
-
 
3429
    # Always delete the file - in case we toggle build forms
-
 
3430
    #
-
 
3431
    my $markerFile = BuildAddKnownFile( $Cwd, 'noBuild.gbe');
-
 
3432
    unlink($markerFile);
-
 
3433
 
-
 
3434
    TouchFile($markerFile)
-
 
3435
        if ($NoBuild);
-
 
3436
}
-
 
3437
 
-
 
3438
#-------------------------------------------------------------------------------
3390
# Function        : BuildIncpkg
3439
# Function        : BuildIncpkg
3391
#
3440
#
3392
# Description     : Create a package inclusion file
3441
# Description     : Create a package inclusion file
3393
#
3442
#
3394
# Inputs          :
3443
# Inputs          :
Line 3450... Line 3499...
3450
\$ScmDeploymentPatch            = \"$DEPLOY_PATCH\";
3499
\$ScmDeploymentPatch            = \"$DEPLOY_PATCH\";
3451
\$ScmSrcDir                     = \"$Srcdir\";
3500
\$ScmSrcDir                     = \"$Srcdir\";
3452
\$ScmBuildSrc                   = \"$ScmBuildSrc\";
3501
\$ScmBuildSrc                   = \"$ScmBuildSrc\";
3453
\$ScmExpert                     = \"$Expert\";
3502
\$ScmExpert                     = \"$Expert\";
3454
\$ScmAll                        = \"$All\";
3503
\$ScmAll                        = \"$All\";
-
 
3504
\$ScmNoBuild                    = \"$NoBuild\";
3455
");
3505
");
3456
 
3506
 
3457
#.. Alias
3507
#.. Alias
3458
#
3508
#
3459
    $fh->DumpData(
3509
    $fh->DumpData(
Line 3881... Line 3931...
3881
    my ($path, $file, $noadd) = @_;
3931
    my ($path, $file, $noadd) = @_;
3882
    $path .= '/'. $file;
3932
    $path .= '/'. $file;
3883
    $path =~ tr~/~/~s;
3933
    $path =~ tr~/~/~s;
3884
    $BUILD_KNOWNFILES {$file} = $path
3934
    $BUILD_KNOWNFILES {$file} = $path
3885
        unless ( defined($noadd) && $noadd);
3935
        unless ( defined($noadd) && $noadd);
3886
    push @CLOBBERFILES, $path;
-
 
-
 
3936
 
3887
    ToolsetFile( $path )
3937
    ToolsetFile( $path )
3888
        unless ($Clobber);
3938
        unless ($Clobber);
3889
 
3939
 
3890
    return $path;
3940
    return $path;
3891
}
3941
}