Subversion Repositories DevTools

Rev

Rev 333 | Rev 339 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: perl; indent-width: 4; show-tabs: yes; -*-
2
#
3
# Module name   : Sunworks
4
# Module type   : Makefile system
5
# Compiler(s)   : ANSI C
6
# Environment(s): CC
7
#   
8
# Description:
9
#   Sunworks C/C++ toolset
10
#
11
#.............................................................................
12
 
13
use strict;
14
use warnings;
15
use JatsError;
16
 
17
#
18
#   Table to provide the location of SUNWSPRO_SC
19
#   This is hardcoded ( not good ) based on build machine
20
#
313 dpurdie 21
#       Key: StudioIdentifier
22
#                   SunWorkshop6.1          - Solaris8  32 bit builds
23
#                   SunStudio11             - Solaris10 32 bit builds
24
#                   SunStudio12.1           - Solaris10 64 bit builds
227 dpurdie 25
#       Key: build machine type
26
#     Value: Per machine-type data
27
#
28
#   Per machine type data is a hash
313 dpurdie 29
#       archiver        - Path to archiver
227 dpurdie 30
#       compiler        - Path to the compiler
313 dpurdie 31
#       misalign{32|64} - Path (relative to compiler) to the misalign obj file
227 dpurdie 32
#                         If not present then misalign not supported
33
#
313 dpurdie 34
my $SunProData;
35
my $SunMisalignObject;
227 dpurdie 36
my %SunProLocation = (
313 dpurdie 37
    'solaris10_sparc32' => { 'SunStudio11' =>
38
                                {   'compiler'   => '/opt/SUNWspro',
39
                                    'misalign32' => 'prod/lib/misalign.o',
40
                                    'misalign64' => 'prod/lib/v9/misalign.o',
41
                                    'archiver'   => '/usr/ccs/bin',
42
                                },
43
                             'SunStudio12.1' =>
44
                                {   'compiler'   => '/opt/sunstudio12.1',
45
                                    'misalign32' => 'prod/lib/misalign.o',      # This one is OK.
46
                                    'misalign64' => 'prod/lib/v9/misalign.o',   # May cause link errors as the .o file is not PIC
47
                                    'archiver'   => '/usr/ccs/bin',
48
                                },
49
                            },
227 dpurdie 50
 
313 dpurdie 51
    'solaris10_x86'     =>  { 'SunStudio11' =>
52
                                {   'compiler'   => '/opt/SUNWspro',
53
                                    'archiver'   => '/usr/ccs/bin',
54
                                },
55
                             'SunStudio12.1' =>
56
                                {   'compiler'   => '/opt/sunstudio12.1',
57
                                    'archiver'   => '/usr/ccs/bin',
58
                                },
59
                            },
227 dpurdie 60
 
313 dpurdie 61
    'sparc'             =>  { 'SunWorkshop6.1'   =>
62
                                {   'compiler'   => '/opt/SUNWspro/WS6U1',
63
                                    'misalign32' => 'lib/misalign.o',
64
                                    'archiver'   => '/usr/ccs/bin',
65
                                },
66
                            }
227 dpurdie 67
    );
68
 
69
#
70
#   Globals
71
#
72
our $GBE_MACHTYPE;
73
our $s;
74
our $o;
75
our $a;
76
our $so;
77
our $exe;
78
our @ScmToolsetArgs;
79
our @ScmPlatformArgs;
80
 
81
##############################################################################
82
#   ToolsetInit()
83
#       Runtime initialisation
84
#
85
##############################################################################
86
 
87
ToolsetInit();
88
 
89
my $toolsetccdepend      = 0;
90
 
91
sub ToolsetInit
92
{
93
#.. Standard.rul requirements
94
#   
95
    $s = 'asm';
96
    $o = 'o';
97
    $a = 'a';
98
    $so = 'so';
99
    $exe = '';
100
 
101
#.. Toolset configuration
102
#
315 dpurdie 103
    $::ScmToolsetVersion = "1.0.0";             # our version
104
    $::ScmToolsetGenerate = 0;                  # GEN generate optional
105
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
227 dpurdie 106
 
107
    my $ScmToolTarget = '';
313 dpurdie 108
    my $ScmStudio = '';
227 dpurdie 109
 
110
    #
111
    #   Toolset args
112
    #
113
    foreach $_ ( @ScmToolsetArgs ) {
114
        if (/^--Target=(.*)/) {                # Target System
115
            $ScmToolTarget = $1;
116
 
313 dpurdie 117
        } elsif ( /^--Studio=(.*)/) {
118
            $ScmStudio = $1;
119
 
227 dpurdie 120
        } else {
121
            Message( "sunworks toolset: unknown toolset option $_ -- ignored" );
122
        }
123
    }
124
 
125
    #
126
    #   Platform arguments
127
    #
128
    foreach $_ ( @ScmPlatformArgs ) {
129
        if (/^--product=(.*)/) {                # GBE product
130
 
131
        } else {
132
            Message( "sunworks toolset: unknown platform argument $_ -- ignored" );
133
        }
313 dpurdie 134
    }
227 dpurdie 135
 
313 dpurdie 136
    #
137
    #   Sanity check
138
    #
139
    Error ("Internal: Target configuration must specify Studio version")
140
        unless ( $ScmStudio );
141
 
142
    Error ("SunWorks compiler not configured for this type of machine",
143
           "GBE_MACHTYPE: $GBE_MACHTYPE" )
144
        unless ( exists $SunProLocation{$GBE_MACHTYPE} );
145
 
146
    Error ("Required SunWorks/Studio not configured for this type of machine",
147
           "GBE_MACHTYPE: $GBE_MACHTYPE",
148
           "Sun Studio  : $ScmStudio" )
149
        unless ( exists $SunProLocation{$GBE_MACHTYPE}{$ScmStudio} );
150
 
151
    #
152
    #   Determine machine / Studio version specific data
153
    #
154
    $SunProData = $SunProLocation{$GBE_MACHTYPE}{$ScmStudio};
155
 
227 dpurdie 156
#.. Define environment
157
#    
158
    Init( "sunworks" );
159
    ToolsetDefines( "sunworks.def" );
313 dpurdie 160
    ToolsetRules  ( "sunworks.rul" );
161
    ToolsetRules  ( "standard.rul" );
227 dpurdie 162
 
163
#.. Cleanup rules
164
#
165
    ToolsetDirTree( "\$(LIBDIR)/SunWS_cache" );
166
    ToolsetDirTree( "\$(OBJDIR)/SunWS_cache" );
167
    ToolsetDirTree( "\$(BINDIR)/SunWS_cache" );
168
    ToolsetDirTree( "./SunWS_cache" );
169
 
170
    AddLibDir( '*', '/usr/lib', '--NoWarn', '--System' );
171
 
172
#.. Extend the CompilerOption directive
173
#   Create a standard data structure
174
#   This is a hash of hashes
175
#       The first hash is keyed by CompileOption keyword
176
#       The second hash contains pairs of values to set or remove
177
#
178
    %::ScmToolsetCompilerOptions =
179
    (
180
        #
181
        #   Control the thread model to use
182
        #   This will affect the compiler options and the linker options
183
        #
184
        'multithread'        => { 'THREADMODE' , '1' },      # -mt (default)
185
        'multithread_none'   => { 'THREADMODE' , undef },    # (none)
186
        'no_multithread'     => { 'THREADMODE' , undef },    # (none)
187
 
188
        'no_misalign'        => { 'MISALIGN', undef },       # (default)
189
        'misalign'           => { 'MISALIGN', '1' },
190
    );
191
 
192
    #
193
    #   Set default options
194
    #
195
    $::ScmCompilerOpts{'THREADMODE'} = '1';
196
 
197
 
198
    #
245 dpurdie 199
    #   Ensure that we know where the compiler and archiver are
227 dpurdie 200
    #
313 dpurdie 201
    my $sunpro = $SunProData->{compiler};
202
    ToolsetDefine ( "SUNWSPRO_SC  = $sunpro" );
203
 
204
    my $ar_path = $SunProData->{archiver};
205
    ToolsetDefine ( "AR_PATH  = $ar_path" );
206
 
207
    #
208
    #   Specify definitions to support 32 and 64 bit compilation
209
    #   Default operation is only intended for existing (solaris8) work
210
    #
211
    if ( ($ScmToolTarget =~ m/32$/) )
227 dpurdie 212
    {
313 dpurdie 213
        ToolsetDefine ( "COMPILE32  = 1" );
214
        $SunMisalignObject = $SunProData->{'misalign32'};
227 dpurdie 215
    }
313 dpurdie 216
    elsif ( ($ScmToolTarget =~ m/64$/) )
217
    {
218
        ToolsetDefine ( "COMPILE64  = 1" );
219
        $SunMisalignObject = $SunProData->{'misalign64'};
220
    }
227 dpurdie 221
    else
222
    {
313 dpurdie 223
        $SunMisalignObject = $SunProData->{'misalign32'};
227 dpurdie 224
    }
225
 
226
    #
313 dpurdie 227
    #   Allow SPARC and X86 compilation options to differ
227 dpurdie 228
    #
313 dpurdie 229
    my $isa_sparc = ( $GBE_MACHTYPE =~ m/sparc/i ) ? 1 : 0;
230
    ToolsetDefine ( "ISA_SPARC  = 1" ) if ($isa_sparc);
227 dpurdie 231
}
232
 
233
##############################################################################
234
#   ToolsetPreprocess()
235
#       Process collected data before the makefile is generated
236
#       This, optional, routine is called from within MakefileGenerate()
237
#       It allows the toolset to massage any of the collected data before
238
#       the makefile is created
239
#
240
##############################################################################
241
 
242
sub ToolsetPreprocess
243
{
244
    #
245
    #   If the machine does not support misalignment and the user has requested
246
    #   it, then kill the option - it makes life easier later.
247
    #
313 dpurdie 248
    unless ( $SunMisalignObject )
227 dpurdie 249
    {
250
        if ( $::ScmCompilerOpts{'MISALIGN'} )
251
        {
252
            Warning("Platform does not support MISALIGN option. Will be ignored");
253
            delete $::ScmCompilerOpts{'MISALIGN'};
254
        }
255
    }
256
}
257
 
258
###############################################################################
259
#   ToolsetCC( $source, $obj, \@args )
260
#       This subroutine takes the user options and builds the rule(s)
261
#       required to compile the source file 'source' to 'obj'
262
#
263
###############################################################################
264
 
265
sub ToolsetCC
266
{
267
    my( $source, $obj, $pArgs ) = @_;
268
    my( $cflags ) = "";
269
 
270
    Debug( "CC:  $source -> $obj" );
271
    foreach ( @$pArgs ) {
272
        Debug( "option:    $_" );
273
        if ( /--Shared$/ ) {                    # Building a 'shared' object
274
            $cflags = "$cflags \$(SHCFLAGS)";
275
            Debug( "CC:    as shared object" );
276
 
277
        } else {                                # unknown option
278
            Message( "CC: unknown option $_ -- ignored\n" );
279
        }
280
    }
281
 
282
    MakePrint( "\n\t\$(CC)\n" );
283
    if ( $cflags )
284
    {                                           # object specific CFLAGS
285
        MakePadded( 4, "\$(OBJDIR)/$obj.${o}:" );
286
        MakePrint( "\tCFLAGS +=$cflags\n" );
287
    }
288
}
289
 
290
 
291
###############################################################################
292
#   ToolsetCCDepend( $depend, \@sources )
293
#       This subroutine takes the user options and builds the
294
#       rule(s) required to build the dependencies for the source
295
#       files 'sources' to 'depend'.
296
#
297
###############################################################################
298
 
299
sub ToolsetCCDepend
300
{
301
    MakePrint( "\t\$(CCDEPEND)\n" );
302
    $toolsetccdepend = 1;
303
}
304
 
305
 
306
###############################################################################
307
#   ToolsetCXX( $source, $obj, \@args )
308
#       This subroutine takes the user options and builds the rule(s)
309
#       required to compile the source file 'source' to 'obj'
310
#
311
###############################################################################
312
 
313
sub ToolsetCXX
314
{
315
    my( $source, $obj, $pArgs ) = @_;
316
    my( $cflags ) = "";
317
 
318
    Debug( "CCX: $source -> $obj" );
319
    foreach ( @$pArgs ) {
320
        Debug( "option:    $_" );
321
        if ( /--Shared$/ ) {                    # Building a 'shared' object
322
            $cflags = "$cflags \$(SHCXXFLAGS)";
323
            Debug( "CCX:    as shared object" );
324
 
325
        } else {
326
            Message( "CCX: unknown option $_ -- ignored\n" );
327
        }
328
    }
329
 
330
    MakePrint( "\n\t\$(CXX)\n" );
331
    if ( $cflags )
332
    {                                           # object specific CFLAGS
333
        MakePadded( 4, "\$(OBJDIR)/$obj.${o}:" );
334
        MakePrint( "\tCXXFLAGS +=$cflags\n" );
335
    }
336
}
337
 
338
 
339
###############################################################################
340
#   ToolsetCXXDepend( $depend, \@sources )
341
#       This subroutine takes the user options and builds the
342
#       rule(s) required to build the dependencies for the source
343
#       files 'sources' to 'depend'.
344
#
345
###############################################################################
346
 
347
sub ToolsetCXXDepend
348
{
349
    MakePrint( "\t\$(CCDEPEND)\n" )
350
        if ( $toolsetccdepend == 0 );
351
}
352
 
353
 
354
###############################################################################
355
#   ToolsetAS( $source, $obj, \@args )
356
#       This subroutine takes the user options and builds the rule(s)
357
#       required to compile the source file 'source' to 'obj'
358
#
359
###############################################################################
360
 
361
sub ToolsetAS
362
{
363
    my( $source, $obj, $pArgs ) = @_;
364
 
365
    foreach $_ ( @$pArgs ) {
366
        Message( "CC: unknown option $_ -- ignored\n" );
367
    }
368
 
369
    MakePrint( "\n\t\$(AS)\n" );
370
}
371
 
372
sub ToolsetASDepend
373
{
374
}
375
 
376
 
377
###############################################################################
378
#   ToolsetAR( $name, \@args, \@objs )
379
#       This subroutine takes the user options and builds the rules
380
#       required to build the library 'name'.
381
#
382
#   Arguments:
383
#
384
#   Options:
385
#       n/a
386
#
387
#   Output:
388
#       [ $(LIBDIR)/name$.${a}:   .... ]
389
#           $(AR)
390
#
391
###############################################################################
392
 
393
sub ToolsetAR
394
{
395
    my( $name, $pArgs, $pObjs ) = @_;
396
 
397
#.. Parse arguments
398
#
399
    foreach $_ ( @$pArgs ) {
400
        Message( "AR: unknown option $_ -- ignored\n" );
401
    }
402
 
403
#.. Standard library builds
404
#
405
    MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}:\t",
406
                  "", "\\\n\t\t", ".${o} ", @$pObjs );
407
    MakePrint( "\n\t\$(AR)\n\n" );
408
}
409
 
410
 
411
###############################################################################
412
#   ToolsetARMerge( $name, \@args, \@libs )
413
#       This subroutine takes the user options and builds the rules
414
#       required to build the library 'name' by merging the specified
415
#       libaries
416
#
417
#   Arguments:
418
#       --xxx                   No arguments currently defined
419
#
420
#   Output:
421
#       [ $(LIBDIR)/name$.${a}:   .... ]
422
#           ...
423
#
424
###############################################################################
425
 
426
sub ToolsetARMerge
427
{
428
    MakePrint( "\n\t\$(ARMERGE)\n\n" );
429
}
430
 
431
 
432
###############################################################################
289 dpurdie 433
#   ToolsetSHLD( $name, \@args, \@objs, \@libraries, $ver )
227 dpurdie 434
#       This subroutine takes the user options and builds the rules
435
#       required to link the program 'name'.
436
#
437
#   Arguments:
438
#       --WithMisalign
439
#
440
#   Output:
441
#       $(LIBDIR)/name:         $(LIBDIR)/shared
442
#               ln -s $shared $name
443
#
444
#       $(LIBDIR)/name.dep:     $(GBE_PLATFORM).mk
445
#               $(SHLDDEPEND)
446
#
447
#       $(LIBDIR)/shared:       SHLIB=name
448
#       $(LIBDIR)/shared:       $(LIBDIR)/name.dep      \
449
#               $(OBJECTS)
450
#                               
451
#       ifneq "$(findstring $(IFLAG),23)" ""
452
#       -include                "$(LIBDIR)/name.dep"
453
#       endif
454
#
455
#       name_ld += ...
456
#           :
457
#
458
###############################################################################
459
 
460
sub ToolsetSHLD
461
{
289 dpurdie 462
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
227 dpurdie 463
    my( $shared, $merge_obj );
464
 
465
#.. Parse arguments
466
#
467
    foreach $_ ( @$pArgs )
468
    {
469
        if ( m~^--WithMisalign~ ) {
313 dpurdie 470
            $merge_obj = $SunMisalignObject;
227 dpurdie 471
 
472
        } else {
473
            Message( "SHLD: unknown option $_ -- ignored\n" );
474
        }
475
    }
476
 
477
#.. Full name of shared library
478
#
289 dpurdie 479
    $shared = "$name\$(GBE_TYPE).${so}.$ver";
227 dpurdie 480
 
481
#.. Install and package the shared libraries that are generated
482
#
483
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
484
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
313 dpurdie 485
 
227 dpurdie 486
#.. Cleanup rules
487
#
488
#   dep     Dependency file
489
#   map     Map file
490
#   ln      Link from LIBDIR to BINDIR
491
#
261 dpurdie 492
    ToolsetGenerate( "\$(LIBDIR)/${shared}.map" );
493
    ToolsetGenerate( "\$(LIBDIR)/${shared}" );
494
    ToolsetGenerate( "\$(BINDIR)/${shared}" );
227 dpurdie 495
    ToolsetDirTree( "\$(LIBDIR)/${name}/SunWS_cache" );
496
    ToolsetDirTree( "\$(OBJDIR)/${name}/SunWS_cache" );
497
 
498
#.. Build rules
499
#
500
#   name        Base name
501
#   shared      Library name, includes GBE_TYPE specification
502
#
503
    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
 
335 dpurdie 513
    my $dep = $io->SetShldTarget($shared);
227 dpurdie 514
 
515
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
516
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${shared}\n" );
335 dpurdie 517
    $io->Prt( "\$(LIBDIR)/${shared}: \\\n\t\t${dep}" );
315 dpurdie 518
    $io->Entry( "", "", " \\\n\t\t", ".$::o", @$pObjs );
519
    $io->Prt( "\n\t\$(SHLD)\n\n" );
227 dpurdie 520
 
521
 
522
#.. Linker command file
523
#
524
#       Now the fun part... piecing together a variable $(name_shld)
525
#       which ends up in the command file.
526
#
527
    $io->SetTag( "${name}_ld" );              # command tag
528
    $io->SetTerm( "\n" );
529
 
530
    $io->Label( "Linker commands", $name );     # label
531
 
532
                                                # object list
533
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
534
 
535
    if ( $merge_obj )
536
    {
537
        $io->PrtLn( "ifdef MISALIGN" );
538
        $io->Cmd( "\$(SUNWSPRO_SC)/$merge_obj" );
539
        $io->PrtLn( "endif" );
540
    }
541
    ToolsetLibStd( $pLibs );                    # push standard libraries
542
 
543
                                                # library list
544
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
545
 
546
    $io->Newline();
547
 
335 dpurdie 548
    #.. Dependency link,
549
    #   Create a library dependency file
550
    #       Create command file to build applicaton dependency list
551
    #       from the list of dependent libraries
552
    #
553
    #       Create makefile directives to include the dependency
554
    #       list into the makefile.
555
    #
556
    $io->DepRules( $pLibs, \&ToolsetLibRecipe, "\$(LIBDIR)/$shared" );
557
    $io->SHLDDEPEND($name, $shared);
227 dpurdie 558
}
559
 
560
 
561
######################################################
562
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
563
#       This subroutine takes the user options and builds the rules
564
#       required to link the program 'name'.
565
#
566
#   Arguments:
567
#       n/a
568
#
569
#   Output:
570
#       $(BINDIR)/name:
571
#                       $(BINDIR)/name.dep
572
#           $(LD)
573
#       $(BINDIR)/name.dep:     $(GBE_PLATFORM).mk
574
#               $(LDDEPEND)
575
#
576
#       ifeq "$(IFLAG)" "3"
577
#       -include        "$(BINDIR)/name.dep"
578
#       endif
579
#
580
#       name_ld += ...
581
#           :
582
#
583
###############################################################################
584
 
585
sub ToolsetLD
586
{
587
    my( $name, $pArgs, $pObjs, $pLibs ) = @_;
588
 
589
#.. Parse arguments
590
#
591
    foreach $_ ( @$pArgs )
592
    {
593
        Message( "LD: unknown option $_ -- ignored\n" );
594
    }
595
 
315 dpurdie 596
#.. Names of programs and components
597
#
598
    my $base = "\$(BINDIR)/${name}";
599
    my $full = $base . $::exe;
600
    my $map  = $base . '.map';
601
    my $ld  =  $base . '.ld';
602
 
227 dpurdie 603
#.. Cleanup rules
604
#
605
#       dep     Dependency file
606
#       map     Mape file
607
#
315 dpurdie 608
    ToolsetGenerate( $map );
227 dpurdie 609
 
610
 
335 dpurdie 611
    my ($io) = ToolsetPrinter::New();
612
    my $dep =$io->SetLdTarget( $name );
613
 
227 dpurdie 614
#.. Build rules
615
#
616
 
315 dpurdie 617
    $io->Prt( "$full : $dep " );
618
    $io->Entry( "", "", "\\\n\t", ".$::o ", @$pObjs );
619
    $io->Prt( "\n\t\$(LD)\n\n" );
620
 
621
 
227 dpurdie 622
#.. Linker command file
623
#
624
#       Now the fun part... piecing together a variable $(name_ld)
625
#       which ends up in the command file.
626
#
627
    $io->SetTag( "${name}_ld" );                        # macro tag
628
    $io->SetTerm( "\n" );
629
 
630
    $io->Label( "Linker commands", $name );             # label
631
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );  # object list
632
    ToolsetLibStd( $pLibs );                            # push standard libraries
633
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );  # library list
634
    $io->Newline();
635
 
636
#.. Dependency link,
335 dpurdie 637
#   Create a library dependency file
638
#       Create command file to build applicaton dependency list
639
#       from the list of dependent libraries
227 dpurdie 640
#
335 dpurdie 641
#       Create makefile directives to include the dependency
642
#       list into the makefile.
227 dpurdie 643
#
335 dpurdie 644
    $io->DepRules( $pLibs, \&ToolsetLibRecipe, $base );
645
    $io->LDDEPEND();                                    # standard LDDEPEND rules
227 dpurdie 646
 
647
 
315 dpurdie 648
#.. Package up the program and other artifacts
649
#
650
    PackageProgAddFiles ( $name, $full );
651
 
227 dpurdie 652
}
653
 
654
 
655
########################################################################
656
#
657
#   Push standard "system" libraries. This is a helper function
658
#   used within this toolset.
659
#
660
#   Arguments:
661
#       $plib       Reference to library array.
662
#
663
########################################################################
664
 
665
sub ToolsetLibStd
666
{
667
}
668
 
669
########################################################################
670
#
671
#   Generate a linker object recipe.  This is a helper function used 
672
#   within this toolset.
673
#
674
#   Arguments:
675
#       $io         I/O stream
676
#
677
#       $target     Name of the target
678
#
679
#       $obj        Library specification
680
#
681
########################################################################
682
 
683
sub ToolsetObjRecipe
684
{
685
    my ($io, $target, $obj) = @_;
686
 
687
    $io->Cmd( "\$(strip $obj).$::o" );
688
}
689
 
690
 
691
###############################################################################
692
#
693
#   Parse a linker lib list
694
#   This is a helper function used within this toolset
695
#
696
#   Arguments:
697
#       $target     Name of the target
698
#
699
#       $lib        Library specification
700
#
701
#       $tag        Tag (user specified)
702
#
703
#       $dp         If building a depend list, the full target name.
704
#
705
###############################################################################
706
 
707
sub ToolsetLibRecipe
708
{
709
    my ($io, $target, $lib, $dp) = @_;
710
 
711
    if ( ! defined($dp) ) {                     # linker
712
        $lib =~ s/^lib//;                       # .. remove leading 'lib'
713
        $io->Cmd( "-l $lib" );
714
 
715
    } else {                                    # depend
716
        $io->Cmd( "$dp:\t@(vlib2,$lib,CC_LIB)" );
717
 
718
    }
719
}
720
#.. Successful termination
721
 
722
1;