Subversion Repositories DevTools

Rev

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

Rev 363 Rev 367
Line 3088... Line 3088...
3088
    #.. Build support files
3088
    #.. Build support files
3089
    #
3089
    #
3090
    DeleteCfg();
3090
    DeleteCfg();
3091
    BuildConfig();
3091
    BuildConfig();
3092
    LinkClean();                                # clean previous images
3092
    LinkClean();                                # clean previous images
3093
    BuildRuleFiles();
-
 
3094
    BuildSharedLibFiles();
3093
    BuildSharedLibFiles();
3095
    WriteParsedBuildConfig();
3094
    WriteParsedBuildConfig();
3096
    BuildPackageLink();
3095
    BuildPackageLink();
3097
    BuildSandboxData();
3096
    BuildSandboxData();
3098
 
3097
 
Line 3134... Line 3133...
3134
    UniquePush (\@BUILDSUBDIRS, $Srcdir );
3133
    UniquePush (\@BUILDSUBDIRS, $Srcdir );
3135
    SubDir( @BUILDSUBDIRS );
3134
    SubDir( @BUILDSUBDIRS );
3136
    Platform( @BUILD_ACTIVEPLATFORMS );
3135
    Platform( @BUILD_ACTIVEPLATFORMS );
3137
 
3136
 
3138
    #.. (re)build src makefiles and associated information
3137
    #.. (re)build src makefiles and associated information
-
 
3138
    #   JatsTool will not return on error
3139
    #
3139
    #
3140
    my @cmds = ('jmake.pl', 'rebuild');
3140
    my @cmds = ('jmake.pl', 'rebuild');
3141
    push @cmds, 'NORECURSE=1' if ( $RootOnly );
3141
    push @cmds, 'NORECURSE=1' if ( $RootOnly );
3142
 
-
 
3143
    JatsTool ( @cmds);
3142
    JatsTool ( @cmds);
3144
 
3143
 
3145
    #
3144
    #
3146
    #   Generate some warnings that will be seen at the end of the build
3145
    #   Generate some warnings that will be seen at the end of the build
3147
    #
3146
    #
Line 3453... Line 3452...
3453
        "ScmBuildPlatforms", \%ScmBuildPlatforms );
3452
        "ScmBuildPlatforms", \%ScmBuildPlatforms );
3454
 
3453
 
3455
 
3454
 
3456
# .. Create BuildPkgRules
3455
# .. Create BuildPkgRules
3457
#
3456
#
3458
#    This most of the information contained within %PKGRULES, which
3457
#    This is most of the information contained within %PKGRULES, which
3459
#    requires additional processing within makelib.
3458
#    requires additional processing within makelib.
3460
#
3459
#
-
 
3460
#   Need the True Path for windows.
-
 
3461
#       Some makefile functions (wildcard) only work as expected
-
 
3462
#       if the case of the pathname is correct. Really only a problem
-
 
3463
#       with badly formed legecy packages where the Windows user
-
 
3464
#       guessed at the package format.
-
 
3465
#
3461
    my %ScmBuildPkgRules;
3466
    my %ScmBuildPkgRules;
3462
    foreach my $platform ( keys %PKGRULES )
3467
    foreach my $platform ( keys %PKGRULES )
3463
    {
3468
    {
3464
        foreach my $package ( @{$PKGRULES{$platform}} )
3469
        foreach my $package ( @{$PKGRULES{$platform}} )
3465
        {
3470
        {
3466
            my %entry;
3471
            my %entry;
3467
 
3472
 
3468
            $entry{ROOT}     = $package->{'base'};
3473
            $entry{ROOT}     = TruePath( $package->{'base'} );
3469
            $entry{NAME}     = $package->{'name'};
3474
            $entry{NAME}     = $package->{'name'};
3470
            $entry{VERSION}  = $package->{'version'};
3475
            $entry{VERSION}  = $package->{'version'};
3471
            $entry{DNAME}    = $package->{'dname'};
3476
            $entry{DNAME}    = $package->{'dname'};
3472
            $entry{DVERSION} = $package->{'dversion'};
3477
            $entry{DVERSION} = $package->{'dversion'};
3473
            $entry{DPROJ}    = $package->{'dproj'};
3478
            $entry{DPROJ}    = $package->{'dproj'};
3474
            $entry{TYPE}     = $package->{'type'};
3479
            $entry{TYPE}     = $package->{'type'};
3475
            $entry{CFGDIR}   = $package->{'cfgdir'} if ( defined( $package->{'cfgdir'} ) );
3480
            $entry{CFGDIR}   = $package->{'cfgdir'} if ( defined( $package->{'cfgdir'} ) );
3476
 
3481
 
3477
 
-
 
3478
            foreach my $dir (qw (PINCDIRS PLIBDIRS TOOLDIRS THXDIRS) )
3482
            foreach my $dir (qw (TOOLDIRS) )
3479
            {
3483
            {
3480
                $entry{$dir} = $package->{$dir} ;
3484
                $entry{$dir} = $package->{$dir} ;
3481
            }
3485
            }
3482
 
3486
 
-
 
3487
            my $baselen = length($package->{'base'});
-
 
3488
            foreach my $dir (qw (PINCDIRS PLIBDIRS THXDIRS) )
-
 
3489
            {
-
 
3490
                $entry{$dir} = [];
-
 
3491
                foreach my $file ( @{$package->{$dir}} )
-
 
3492
                {
-
 
3493
                    push @{$entry{$dir}}, substr TruePath($package->{'base'} . $file ), $baselen;
-
 
3494
                }
-
 
3495
            }
-
 
3496
 
3483
            push @{$ScmBuildPkgRules{$platform}}, \%entry;
3497
            push @{$ScmBuildPkgRules{$platform}}, \%entry;
3484
        }
3498
        }
3485
    }
3499
    }
3486
 
3500
 
3487
    $fh->DumpData(
3501
    $fh->DumpData(
Line 3607... Line 3621...
3607
    $fh->Close();
3621
    $fh->Close();
3608
}
3622
}
3609
 
3623
 
3610
 
3624
 
3611
#-------------------------------------------------------------------------------
3625
#-------------------------------------------------------------------------------
3612
# Function        : BuildRuleFiles
-
 
3613
#
-
 
3614
# Description     : Create a set of rule files in the interface directory
-
 
3615
#                   These will be included directly into makefiles to
-
 
3616
#                   extend library and header search paths to the Linked
-
 
3617
#                   archives
-
 
3618
#
-
 
3619
#                   One file is created for each platform to simplify the
-
 
3620
#                   inclusion rules
-
 
3621
#
-
 
3622
#
-
 
3623
#                   The PKGRULES data structure is of the form:
-
 
3624
#
-
 
3625
#                   A hash, by platform, of an array of package information
-
 
3626
#                   Each block of package information is a hash containing
-
 
3627
#                       'name'      -  short name of the package
-
 
3628
#                       'version'   -  short name of the package
-
 
3629
#                       'base'      - path of the package root
-
 
3630
#                       'PINCDIRS'  - Array of included directories
-
 
3631
#                       'PLIBDIRS'  - Array of library directories
-
 
3632
#
-
 
3633
#                   Arrays are used to preserve the user specified search
-
 
3634
#                   order, both of packages and directories within each
-
 
3635
#                   package
-
 
3636
#
-
 
3637
# Inputs          :
-
 
3638
#
-
 
3639
# Returns         :
-
 
3640
#
-
 
3641
sub BuildRuleFiles
-
 
3642
{
-
 
3643
    #
-
 
3644
    #   A file is generated for each platform
-
 
3645
    #   Within this lines are generated for each package
-
 
3646
    #
-
 
3647
    foreach my $platform ( keys %PKGRULES )
-
 
3648
    {
-
 
3649
        my $pPlatform = $PKGRULES{$platform};
-
 
3650
 
-
 
3651
        my $fh = ::ConfigurationFile::New( "$BUILDINTERFACE/$platform.rul", '--NoEof', '--Type=mak' );
-
 
3652
        $fh->Header( "Buildlib ($BuildVersion)","Package import specification" );
-
 
3653
 
-
 
3654
        $fh->Write ( "PINCDIRS\t=\t\t" . "# includes\n" );
-
 
3655
        $fh->Write ( "PLIBDIRS\t=\t\t" . "# libraries\n" );
-
 
3656
        $fh->Write ( "\n" );
-
 
3657
 
-
 
3658
        #
-
 
3659
        #   For each Available package accessable to this platform
-
 
3660
        #
-
 
3661
        foreach my $package ( @{$pPlatform} )
-
 
3662
        {
-
 
3663
            #
-
 
3664
            #   Skip the pseudo package that encapsulates the interface
-
 
3665
            #   directory. Currently the makefiles do this in a different
-
 
3666
            #   manner - to be resolved
-
 
3667
            #
-
 
3668
            #   Just comment out the lines so that the data is visible
-
 
3669
            #   Its a hint to make use of the data
-
 
3670
            #
-
 
3671
            my $prefix = '';
-
 
3672
            $prefix = '# ' if ( $package->{'type'} eq 'interface' );
-
 
3673
 
-
 
3674
 
-
 
3675
            my $name = $package->{'name'} . '/' . $package->{'version'};
-
 
3676
            my $base = $package->{'base'};
-
 
3677
 
-
 
3678
            $fh->Write ( "##########################################################\n");
-
 
3679
            $fh->Write ( "# Source:  $name\n" );
-
 
3680
            $fh->Write ( "#\n" );
-
 
3681
 
-
 
3682
            #
-
 
3683
            #   List include and library directories
-
 
3684
            #   Need the True Path for windows.
-
 
3685
            #       Some makefile functions (wildcard) only work as expected
-
 
3686
            #       if the case of the pathname is correct. Really only a problem
-
 
3687
            #       with badly formed legecy packages where the Windows user
-
 
3688
            #       guessed at the package format.
-
 
3689
            #
-
 
3690
            #
-
 
3691
            for my $type (qw (PINCDIRS PLIBDIRS) )
-
 
3692
            {
-
 
3693
                for my $path ( @{$package->{$type}} )
-
 
3694
                {
-
 
3695
                    $fh->Write ( "$prefix$type\t+= " . TruePath($base . $path) . "\n" );
-
 
3696
                }
-
 
3697
            }
-
 
3698
            $fh->Write ( "\n" );
-
 
3699
        }
-
 
3700
        $fh->Close();
-
 
3701
    }
-
 
3702
}
-
 
3703
 
-
 
3704
#-------------------------------------------------------------------------------
-
 
3705
# Function        : BuildSharedLibFiles
3626
# Function        : BuildSharedLibFiles
3706
#
3627
#
3707
# Description     : Create a file in the interface directory that will specify
3628
# Description     : Create a file in the interface directory that will specify
3708
#                   the locations of shared libraries.
3629
#                   the locations of shared libraries.
3709
#
3630
#