Subversion Repositories DevTools

Rev

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

Rev 335 Rev 339
Line 101... Line 101...
101
#.. Toolset configuration
101
#.. Toolset configuration
102
#
102
#
103
    $::ScmToolsetVersion = "1.0.0";             # our version
103
    $::ScmToolsetVersion = "1.0.0";             # our version
104
    $::ScmToolsetGenerate = 0;                  # GEN generate optional
104
    $::ScmToolsetGenerate = 0;                  # GEN generate optional
105
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
105
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
-
 
106
    $::ScmToolsetSoName = 1;                    # Shared library supports SoName
106
 
107
 
107
    my $ScmToolTarget = '';
108
    my $ScmToolTarget = '';
108
    my $ScmStudio = '';
109
    my $ScmStudio = '';
109
 
110
 
110
    #
111
    #
Line 458... Line 459...
458
###############################################################################
459
###############################################################################
459
 
460
 
460
sub ToolsetSHLD
461
sub ToolsetSHLD
461
{
462
{
462
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
463
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
463
    my( $shared, $merge_obj );
464
    my( $linkname, $soname ,$shared, $merge_obj );
-
 
465
    my $sosuffix = '';
464
 
466
 
465
#.. Parse arguments
467
#.. Parse arguments
466
#
468
#
467
    foreach $_ ( @$pArgs )
469
    foreach $_ ( @$pArgs )
468
    {
470
    {
469
        if ( m~^--WithMisalign~ ) {
471
        if ( m~^--WithMisalign~ ) {
470
            $merge_obj = $SunMisalignObject;
472
            $merge_obj = $SunMisalignObject;
471
 
473
 
-
 
474
        } elsif ( /^--SoNameSuffix=(.*)/i ) {
-
 
475
            $sosuffix = $1;
-
 
476
 
472
        } else {
477
        } else {
473
            Message( "SHLD: unknown option $_ -- ignored\n" );
478
            Message( "SHLD: unknown option $_ -- ignored\n" );
474
        }
479
        }
475
    }
480
    }
476
 
481
 
477
#.. Full name of shared library
482
#.. Various library names
478
#
-
 
479
    $shared = "$name\$(GBE_TYPE).${so}.$ver";
-
 
480
 
-
 
481
#.. Install and package the shared libraries that are generated
-
 
482
#
483
#
483
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
484
    $linkname = "$name\$(GBE_TYPE).$::so";
-
 
485
    $shared = "$linkname.$ver";
484
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
486
    $soname = "$linkname$sosuffix";
485
 
487
 
486
#.. Cleanup rules
488
#.. Cleanup rules
487
#
489
#
488
#   dep     Dependency file
-
 
489
#   map     Map file
490
#   map     Map file
490
#   ln      Link from LIBDIR to BINDIR
491
#   ln      Link from LIBDIR to BINDIR
491
#
492
#
492
    ToolsetGenerate( "\$(LIBDIR)/${shared}.map" );
493
    ToolsetGenerate( "\$(LIBDIR)/${shared}.map" );
493
    ToolsetGenerate( "\$(LIBDIR)/${shared}" );
494
    ToolsetGenerate( "\$(LIBDIR)/${shared}" );
494
    ToolsetGenerate( "\$(BINDIR)/${shared}" );
495
    ToolsetGenerate( "\$(BINDIR)/${soname}" );
495
    ToolsetDirTree( "\$(LIBDIR)/${name}/SunWS_cache" );
496
    ToolsetDirTree( "\$(LIBDIR)/${name}/SunWS_cache" );
496
    ToolsetDirTree( "\$(OBJDIR)/${name}/SunWS_cache" );
497
    ToolsetDirTree( "\$(OBJDIR)/${name}/SunWS_cache" );
497
 
498
 
498
#.. Build rules
499
#.. Build rules
499
#
500
#
500
#   name        Base name
501
#   name        Base name
501
#   shared      Library name, includes GBE_TYPE specification
502
#   shared      Library name, includes GBE_TYPE specification
502
#
503
#
503
    my ($io) = ToolsetPrinter::New();
504
    my ($io) = ToolsetPrinter::New();
504
 
-
 
505
    $io->Label( "Shared library", $name );
-
 
506
 
-
 
507
    $io->Prt( "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so:\t\\\n" .
-
 
508
              "\t\t\$(GBE_BINDIR)\\\n" .
-
 
509
              "\t\t\$(LIBDIR)/${shared}\n" .
-
 
510
              "\t\@(rm -f \$@; ln -s ./$shared \$@)\n" .
-
 
511
              "\t\@(rm -f \$(BINDIR)/$shared; ln -s ../\$(LIBDIR)/$shared \$(BINDIR)/$shared)\n\n" );
-
 
512
 
-
 
513
    my $dep = $io->SetShldTarget($shared);
505
    my $dep = $io->SetShldTarget($shared);
514
 
506
 
-
 
507
    $io->Label( "Shared library", $name );
-
 
508
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
-
 
509
    
515
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
510
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
516
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${shared}\n" );
511
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${soname}\n" );
517
    $io->Prt( "\$(LIBDIR)/${shared}: \\\n\t\t${dep}" );
512
    $io->Prt( "\$(LIBDIR)/${shared}: \\\n\t\t${dep}" );
518
    $io->Entry( "", "", " \\\n\t\t", ".$::o", @$pObjs );
513
    $io->Entry( "", "", " \\\n\t\t", ".$::o", @$pObjs );
519
    $io->Prt( "\n\t\$(SHLD)\n\n" );
514
    $io->Prt( "\n\t\$(SHLD)\n\n" );
-
 
515
    
520
 
516
 
-
 
517
#
-
 
518
#   Create soft links
-
 
519
#       'Real Name' to its 'Link Name'
-
 
520
#       'Real Name' to 'SoName' in the BINDIR (for testing I think)
-
 
521
#       'Real Name' to 'SoName' in the LIBDIR (if different)
-
 
522
#
-
 
523
    $io->Label( "Shared library Symbolic Links", $name );
-
 
524
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$linkname" );
-
 
525
    $io->Prt( "\$(LIBDIR)/$linkname:\t\\\n" .
-
 
526
              "\t\t\$(GBE_BINDIR)\\\n" .
-
 
527
              "\t\t\$(LIBDIR)/${shared}\n" .
-
 
528
              "\t\$(AA_PRE)(rm -f \$@; ln -s ./$shared \$@)\n" .
-
 
529
              "\t\$(AA_PRE)(rm -f \$(BINDIR)/$soname; ln -s ../\$(LIBDIR)/$shared \$(BINDIR)/$soname)\n\n" );
-
 
530
 
-
 
531
    if ( $soname ne $shared && $soname ne $linkname)
-
 
532
    {
-
 
533
        $io->Label( "Shared library SoName Symbolic Links", $name );
-
 
534
        PackageShlibAddFiles( $name, "\$(LIBDIR)/$soname" );
-
 
535
        $io->Prt( "\$(LIBDIR)/$soname:\t\\\n" .
-
 
536
                  "\t\t\$(GBE_LIBDIR)\\\n" .
-
 
537
                  "\t\t\$(LIBDIR)/${shared}\n" .
-
 
538
                  "\t\$(AA_PRE)(rm -f \$@; ln -s ./$shared \$@)\n" );
-
 
539
    }
521
 
540
 
522
#.. Linker command file
541
#.. Linker command file
523
#
542
#
524
#       Now the fun part... piecing together a variable $(name_shld)
543
#       Now the fun part... piecing together a variable $(name_shld)
525
#       which ends up in the command file.
544
#       which ends up in the command file.
526
#
545
#
-
 
546
    $io->Newline();
527
    $io->SetTag( "${name}_ld" );              # command tag
547
    $io->SetTag( "${name}_shld" );              # command tag
528
    $io->SetTerm( "\n" );
548
    $io->SetTerm( "\n" );
529
 
549
 
530
    $io->Label( "Linker commands", $name );     # label
550
    $io->Label( "Linker commands", $name );     # label
531
 
551
 
532
                                                # object list
552
                                                # object list
Line 536... Line 556...
536
    {
556
    {
537
        $io->PrtLn( "ifdef MISALIGN" );
557
        $io->PrtLn( "ifdef MISALIGN" );
538
        $io->Cmd( "\$(SUNWSPRO_SC)/$merge_obj" );
558
        $io->Cmd( "\$(SUNWSPRO_SC)/$merge_obj" );
539
        $io->PrtLn( "endif" );
559
        $io->PrtLn( "endif" );
540
    }
560
    }
-
 
561
 
541
    ToolsetLibStd( $pLibs );                    # push standard libraries
562
    ToolsetLibStd( $pLibs );                    # push standard libraries
542
 
563
 
543
                                                # library list
-
 
544
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
564
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
545
 
565
 
546
    $io->Newline();
566
    $io->Newline();
547
 
567
 
548
    #.. Dependency link,
568
    #.. Dependency link,
Line 551... Line 571...
551
    #       from the list of dependent libraries
571
    #       from the list of dependent libraries
552
    #
572
    #
553
    #       Create makefile directives to include the dependency
573
    #       Create makefile directives to include the dependency
554
    #       list into the makefile.
574
    #       list into the makefile.
555
    #
575
    #
556
    $io->DepRules( $pLibs, \&ToolsetLibRecipe, "\$(LIBDIR)/$shared" );
576
    $io->DepRules( $pLibs, \&ToolsetLibRecipe, "\$(LIBDIR)/${shared}" );
557
    $io->SHLDDEPEND($name, $shared);
577
    $io->SHLDDEPEND($name, $soname);
558
}
578
}
559
 
579
 
560
 
580
 
561
######################################################
581
######################################################
562
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
582
#   ToolsetLD( $name, \@args, \@objs, \@libraries )