Subversion Repositories DevTools

Rev

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

Rev 369 Rev 373
Line 99... Line 99...
99
 
99
 
100
ToolsetInit();
100
ToolsetInit();
101
 
101
 
102
sub ToolsetInit
102
sub ToolsetInit
103
{
103
{
104
    my( $GCCTarget, $GCCToolchain, $GCCRoot, $GCCBin, $GCCAr, $GCCFlags );
104
    my( $GCCTarget, $GCCToolchain, $GCCRoot, $GCCBin, $GCCAr, $GCCFlags, $GCCObjCopy );
105
    my( $arg_alias, $tools_found );
105
    my( $arg_alias, $tools_found );
106
 
106
 
107
#.. Toolset configuration
107
#.. Toolset configuration
108
#
108
#
109
    $::ScmToolsetVersion = "1.0.0";             # our version
109
    $::ScmToolsetVersion = "1.0.0";             # our version
Line 200... Line 200...
200
        #       GCCFlags    - Additional compiler flags
200
        #       GCCFlags    - Additional compiler flags
201
        #
201
        #
202
        $GCCRoot = $GCCToolchain->{ROOT};
202
        $GCCRoot = $GCCToolchain->{ROOT};
203
        $GCCBin = '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'gcc';
203
        $GCCBin = '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'gcc';
204
        $GCCAr =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'ar';
204
        $GCCAr =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'ar';
-
 
205
        $GCCObjCopy =  '${GCC_ROOT}/' . $GCCToolchain->{BASE} . 'objcopy';
205
        $GCCFlags = $GCCToolchain->{CC_OPTS};
206
        $GCCFlags = $GCCToolchain->{CC_OPTS};
206
    }
207
    }
207
    else
208
    else
208
    {
209
    {
209
        $GCCRoot = "/usr";
210
        $GCCRoot = '/usr';
210
        $GCCBin = "gcc";
211
        $GCCBin = 'gcc';
211
        $GCCAr = "ar";
212
        $GCCAr = 'ar';
-
 
213
        $GCCObjCopy =  'objcopy';
212
    }
214
    }
213
 
215
 
214
#.. Define GCC environment
216
#.. Define GCC environment
215
#
217
#
216
    PlatformDefine( "
218
    PlatformDefine( "
Line 220... Line 222...
220
#..");
222
#..");
221
    PlatformDefine( "GCC_TARGET         := $GCCTarget" );
223
    PlatformDefine( "GCC_TARGET         := $GCCTarget" );
222
    PlatformDefine( "GCC_ROOT           := $GCCRoot" );
224
    PlatformDefine( "GCC_ROOT           := $GCCRoot" );
223
    PlatformDefine( "GCC_CC             := $GCCBin" );
225
    PlatformDefine( "GCC_CC             := $GCCBin" );
224
    PlatformDefine( "GCC_AR             := $GCCAr" );
226
    PlatformDefine( "GCC_AR             := $GCCAr" );
-
 
227
    PlatformDefine( "GCC_OBJCOPY        := $GCCObjCopy" );
225
    PlatformDefine( "" );
228
    PlatformDefine( "" );
226
 
229
 
227
    PlatformDefine( "GCC_CFLAGS         := $GCCFlags" ) if defined $GCCFlags;
230
    PlatformDefine( "GCC_CFLAGS         := $GCCFlags" ) if defined $GCCFlags;
228
 
231
 
229
 
232
 
Line 469... Line 472...
469
###############################################################################
472
###############################################################################
470
 
473
 
471
sub ToolsetSHLD
474
sub ToolsetSHLD
472
{
475
{
473
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
476
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
474
    my( $linkname, $soname, $shared, $def, $def_pref, $multi_scan );
477
    my( $linkname, $soname, $shared, $dbgname, $def, $def_pref, $multi_scan );
475
    my $sosuffix = '.' . $ver;
478
    my $sosuffix = '.' . $ver;
476
 
479
 
477
#.. Parse arguments
480
#.. Parse arguments
478
#
481
#
479
    foreach $_ ( @$pArgs )
482
    foreach $_ ( @$pArgs )
Line 506... Line 509...
506
#.. Various library names
509
#.. Various library names
507
#
510
#
508
    $linkname = "$name\$(GBE_TYPE).$::so";
511
    $linkname = "$name\$(GBE_TYPE).$::so";
509
    $shared = "$linkname.$ver";
512
    $shared = "$linkname.$ver";
510
    $soname = "$linkname$sosuffix";
513
    $soname = "$linkname$sosuffix";
-
 
514
    
-
 
515
    my $shared_path = "\$(LIBDIR)/${shared}";
-
 
516
    my $dbg_path =  $shared_path . '.dbg';
511
 
517
 
512
#.. Cleanup rules
518
#.. Cleanup rules
513
#
519
#
514
#   map     Map file
520
#   map     Map file
515
#   ln      Link from LIBDIR to BINDIR
521
#   ln      Link from LIBDIR to BINDIR
516
#
522
#
517
    ToolsetGenerate( "\$(LIBDIR)/${name}.map" );
523
    ToolsetGenerate( "\$(LIBDIR)/${name}.map" );
518
    ToolsetGenerate( "\$(LIBDIR)/${shared}" );
524
    ToolsetGenerate( "\$(LIBDIR)/${shared}" );
519
    ToolsetGenerate( "\$(BINDIR)/${soname}" );
525
    ToolsetGenerate( "\$(BINDIR)/${soname}" );
-
 
526
    ToolsetGenerate( $dbg_path );
520
 
527
 
521
#.. Build rules
528
#.. Build rules
522
#
529
#
523
#   name        Base name
530
#   name        Base name
524
#   shared      Library name, includes GBE_TYPE specification
531
#   shared      Library name, includes GBE_TYPE specification
Line 526... Line 533...
526
    my ($io) = ToolsetPrinter::New();
533
    my ($io) = ToolsetPrinter::New();
527
    my $dep = $io->SetShldTarget($shared);
534
    my $dep = $io->SetShldTarget($shared);
528
 
535
 
529
    $io->Label( "Shared library", $name );
536
    $io->Label( "Shared library", $name );
530
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
537
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
-
 
538
    PackageShlibAddFiles( $name, $dbg_path );
531
    
539
    
532
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
540
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
533
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${soname}\n" );
541
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${soname}\n" );
534
    $io->Prt( "\$(LIBDIR)/${shared}: \\\n\t\t${dep}" );
542
    $io->Prt( "\$(LIBDIR)/${shared}: \\\n\t\t${dep}" );
535
    $io->Entry( "", "", " \\\n\t\t", ".$::o", @$pObjs );
543
    $io->Entry( "", "", " \\\n\t\t", ".$::o", @$pObjs );
536
    $io->Prt( "\\\n\t\t$def" ) if($def);
544
    $io->Prt( "\\\n\t\t$def" ) if($def);
537
    $io->Prt( "\n\t\$(SHLD)\n\n" );
545
    $io->Prt( "\n\t\$(SHLD)" );
-
 
546
    $io->Prt( "\n\t\$(call LDSTRIP,$shared_path,$dbg_path)\n\n" );
538
    
547
    
539
 
-
 
540
#
548
#
541
#   Create soft links
549
#   Create soft links
542
#       'Real Name' to its 'Link Name'
550
#       'Real Name' to its 'Link Name'
543
#       'Real Name' to 'SoName' in the BINDIR (for testing I think)
551
#       'Real Name' to 'SoName' in the BINDIR (for testing I think)
544
#       'Real Name' to 'SoName' in the LIBDIR (if different)
552
#       'Real Name' to 'SoName' in the LIBDIR (if different)
Line 648... Line 656...
648
#
656
#
649
    my $base = "\$(BINDIR)/${name}";
657
    my $base = "\$(BINDIR)/${name}";
650
    my $full = $base . $::exe;
658
    my $full = $base . $::exe;
651
    my $map  = $base . '.map';
659
    my $map  = $base . '.map';
652
    my $ld  =  $base . '.ld';
660
    my $ld  =  $base . '.ld';
-
 
661
    my $dbg =  $base . '.dbg';
653
 
662
 
654
#.. Cleanup rules
663
#.. Cleanup rules
655
#
664
#
656
    ToolsetGenerate( $ld );
665
    ToolsetGenerate( $ld );
657
    ToolsetGenerate( $map );
666
    ToolsetGenerate( $map );
-
 
667
    ToolsetGenerate( $dbg );
658
 
668
 
659
#.. Build rules
669
#.. Build rules
660
#
670
#
661
    my ($io) = ToolsetPrinter::New();
671
    my ($io) = ToolsetPrinter::New();
662
    my $dep = $io->SetLdTarget( $name );
672
    my $dep = $io->SetLdTarget( $name );
663
 
673
 
664
    $io->Prt( "$full : $dep " );
674
    $io->Prt( "$full : $dep " );
665
    $io->Entry( "", "", "\\\n\t", ".$::o ", @$pObjs );
675
    $io->Entry( "", "", "\\\n\t", ".$::o ", @$pObjs );
666
    $io->Prt( "\n\t\$(LD)\n\n" );
676
    $io->Prt( "\n\t\$(LD)" );
-
 
677
    $io->Prt( "\n\t\$(call LDSTRIP,$full,$dbg)\n\n" );
667
 
678
 
668
 
679
 
669
#.. Linker command file
680
#.. Linker command file
670
#
681
#
671
#       Now the fun part... piecing together a variable $(name_ld)
682
#       Now the fun part... piecing together a variable $(name_ld)
Line 702... Line 713...
702
    $io->LDDEPEND();
713
    $io->LDDEPEND();
703
 
714
 
704
#.. Package up the program and other artifacts
715
#.. Package up the program and other artifacts
705
#
716
#
706
    PackageProgAddFiles ( $name, $full );
717
    PackageProgAddFiles ( $name, $full );
-
 
718
    PackageProgAddFiles ( $name, $dbg );
707
 
719
 
708
}
720
}
709
 
721
 
710
 
722
 
711
########################################################################
723
########################################################################