Subversion Repositories DevTools

Rev

Go to most recent revision | Details | 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
#
103
    $::ScmToolsetVersion = "1.0.0";               # our version
104
    $::ScmToolsetGenerate = 0;                    # GEN generate optional
105
 
106
    my $ScmToolTarget = '';
313 dpurdie 107
    my $ScmStudio = '';
227 dpurdie 108
 
109
    #
110
    #   Toolset args
111
    #
112
    foreach $_ ( @ScmToolsetArgs ) {
113
        if (/^--Target=(.*)/) {                # Target System
114
            $ScmToolTarget = $1;
115
 
313 dpurdie 116
        } elsif ( /^--Studio=(.*)/) {
117
            $ScmStudio = $1;
118
 
227 dpurdie 119
        } else {
120
            Message( "sunworks toolset: unknown toolset option $_ -- ignored" );
121
        }
122
    }
123
 
124
    #
125
    #   Platform arguments
126
    #
127
    foreach $_ ( @ScmPlatformArgs ) {
128
        if (/^--product=(.*)/) {                # GBE product
129
 
130
        } else {
131
            Message( "sunworks toolset: unknown platform argument $_ -- ignored" );
132
        }
313 dpurdie 133
    }
227 dpurdie 134
 
313 dpurdie 135
    #
136
    #   Sanity check
137
    #
138
    Error ("Internal: Target configuration must specify Studio version")
139
        unless ( $ScmStudio );
140
 
141
    Error ("SunWorks compiler not configured for this type of machine",
142
           "GBE_MACHTYPE: $GBE_MACHTYPE" )
143
        unless ( exists $SunProLocation{$GBE_MACHTYPE} );
144
 
145
    Error ("Required SunWorks/Studio not configured for this type of machine",
146
           "GBE_MACHTYPE: $GBE_MACHTYPE",
147
           "Sun Studio  : $ScmStudio" )
148
        unless ( exists $SunProLocation{$GBE_MACHTYPE}{$ScmStudio} );
149
 
150
    #
151
    #   Determine machine / Studio version specific data
152
    #
153
    $SunProData = $SunProLocation{$GBE_MACHTYPE}{$ScmStudio};
154
 
227 dpurdie 155
#.. Define environment
156
#    
157
    Init( "sunworks" );
158
    ToolsetDefines( "sunworks.def" );
313 dpurdie 159
    ToolsetRules  ( "sunworks.rul" );
160
    ToolsetRules  ( "standard.rul" );
227 dpurdie 161
 
162
#.. Cleanup rules
163
#
164
    ToolsetDirTree( "\$(LIBDIR)/SunWS_cache" );
165
    ToolsetDirTree( "\$(OBJDIR)/SunWS_cache" );
166
    ToolsetDirTree( "\$(BINDIR)/SunWS_cache" );
167
    ToolsetDirTree( "./SunWS_cache" );
168
 
169
    AddLibDir( '*', '/usr/lib', '--NoWarn', '--System' );
170
 
171
#.. Extend the CompilerOption directive
172
#   Create a standard data structure
173
#   This is a hash of hashes
174
#       The first hash is keyed by CompileOption keyword
175
#       The second hash contains pairs of values to set or remove
176
#
177
    %::ScmToolsetCompilerOptions =
178
    (
179
        #
180
        #   Control the thread model to use
181
        #   This will affect the compiler options and the linker options
182
        #
183
        'multithread'        => { 'THREADMODE' , '1' },      # -mt (default)
184
        'multithread_none'   => { 'THREADMODE' , undef },    # (none)
185
        'no_multithread'     => { 'THREADMODE' , undef },    # (none)
186
 
187
        'no_misalign'        => { 'MISALIGN', undef },       # (default)
188
        'misalign'           => { 'MISALIGN', '1' },
189
    );
190
 
191
    #
192
    #   Set default options
193
    #
194
    $::ScmCompilerOpts{'THREADMODE'} = '1';
195
 
196
 
197
    #
245 dpurdie 198
    #   Ensure that we know where the compiler and archiver are
227 dpurdie 199
    #
313 dpurdie 200
    my $sunpro = $SunProData->{compiler};
201
    ToolsetDefine ( "SUNWSPRO_SC  = $sunpro" );
202
 
203
    my $ar_path = $SunProData->{archiver};
204
    ToolsetDefine ( "AR_PATH  = $ar_path" );
205
 
206
    #
207
    #   Specify definitions to support 32 and 64 bit compilation
208
    #   Default operation is only intended for existing (solaris8) work
209
    #
210
    if ( ($ScmToolTarget =~ m/32$/) )
227 dpurdie 211
    {
313 dpurdie 212
        ToolsetDefine ( "COMPILE32  = 1" );
213
        $SunMisalignObject = $SunProData->{'misalign32'};
227 dpurdie 214
    }
313 dpurdie 215
    elsif ( ($ScmToolTarget =~ m/64$/) )
216
    {
217
        ToolsetDefine ( "COMPILE64  = 1" );
218
        $SunMisalignObject = $SunProData->{'misalign64'};
219
    }
227 dpurdie 220
    else
221
    {
313 dpurdie 222
        $SunMisalignObject = $SunProData->{'misalign32'};
227 dpurdie 223
    }
224
 
225
    #
313 dpurdie 226
    #   Allow SPARC and X86 compilation options to differ
227 dpurdie 227
    #
313 dpurdie 228
    my $isa_sparc = ( $GBE_MACHTYPE =~ m/sparc/i ) ? 1 : 0;
229
    ToolsetDefine ( "ISA_SPARC  = 1" ) if ($isa_sparc);
227 dpurdie 230
}
231
 
232
##############################################################################
233
#   ToolsetPreprocess()
234
#       Process collected data before the makefile is generated
235
#       This, optional, routine is called from within MakefileGenerate()
236
#       It allows the toolset to massage any of the collected data before
237
#       the makefile is created
238
#
239
##############################################################################
240
 
241
sub ToolsetPreprocess
242
{
243
    #
244
    #   If the machine does not support misalignment and the user has requested
245
    #   it, then kill the option - it makes life easier later.
246
    #
313 dpurdie 247
    unless ( $SunMisalignObject )
227 dpurdie 248
    {
249
        if ( $::ScmCompilerOpts{'MISALIGN'} )
250
        {
251
            Warning("Platform does not support MISALIGN option. Will be ignored");
252
            delete $::ScmCompilerOpts{'MISALIGN'};
253
        }
254
    }
255
}
256
 
257
###############################################################################
258
#   ToolsetCC( $source, $obj, \@args )
259
#       This subroutine takes the user options and builds the rule(s)
260
#       required to compile the source file 'source' to 'obj'
261
#
262
###############################################################################
263
 
264
sub ToolsetCC
265
{
266
    my( $source, $obj, $pArgs ) = @_;
267
    my( $cflags ) = "";
268
 
269
    Debug( "CC:  $source -> $obj" );
270
    foreach ( @$pArgs ) {
271
        Debug( "option:    $_" );
272
        if ( /--Shared$/ ) {                    # Building a 'shared' object
273
            $cflags = "$cflags \$(SHCFLAGS)";
274
            Debug( "CC:    as shared object" );
275
 
276
        } else {                                # unknown option
277
            Message( "CC: unknown option $_ -- ignored\n" );
278
        }
279
    }
280
 
281
    MakePrint( "\n\t\$(CC)\n" );
282
    if ( $cflags )
283
    {                                           # object specific CFLAGS
284
        MakePadded( 4, "\$(OBJDIR)/$obj.${o}:" );
285
        MakePrint( "\tCFLAGS +=$cflags\n" );
286
    }
287
}
288
 
289
 
290
###############################################################################
291
#   ToolsetCCDepend( $depend, \@sources )
292
#       This subroutine takes the user options and builds the
293
#       rule(s) required to build the dependencies for the source
294
#       files 'sources' to 'depend'.
295
#
296
###############################################################################
297
 
298
sub ToolsetCCDepend
299
{
300
    MakePrint( "\t\$(CCDEPEND)\n" );
301
    $toolsetccdepend = 1;
302
}
303
 
304
 
305
###############################################################################
306
#   ToolsetCXX( $source, $obj, \@args )
307
#       This subroutine takes the user options and builds the rule(s)
308
#       required to compile the source file 'source' to 'obj'
309
#
310
###############################################################################
311
 
312
sub ToolsetCXX
313
{
314
    my( $source, $obj, $pArgs ) = @_;
315
    my( $cflags ) = "";
316
 
317
    Debug( "CCX: $source -> $obj" );
318
    foreach ( @$pArgs ) {
319
        Debug( "option:    $_" );
320
        if ( /--Shared$/ ) {                    # Building a 'shared' object
321
            $cflags = "$cflags \$(SHCXXFLAGS)";
322
            Debug( "CCX:    as shared object" );
323
 
324
        } else {
325
            Message( "CCX: unknown option $_ -- ignored\n" );
326
        }
327
    }
328
 
329
    MakePrint( "\n\t\$(CXX)\n" );
330
    if ( $cflags )
331
    {                                           # object specific CFLAGS
332
        MakePadded( 4, "\$(OBJDIR)/$obj.${o}:" );
333
        MakePrint( "\tCXXFLAGS +=$cflags\n" );
334
    }
335
}
336
 
337
 
338
###############################################################################
339
#   ToolsetCXXDepend( $depend, \@sources )
340
#       This subroutine takes the user options and builds the
341
#       rule(s) required to build the dependencies for the source
342
#       files 'sources' to 'depend'.
343
#
344
###############################################################################
345
 
346
sub ToolsetCXXDepend
347
{
348
    MakePrint( "\t\$(CCDEPEND)\n" )
349
        if ( $toolsetccdepend == 0 );
350
}
351
 
352
 
353
###############################################################################
354
#   ToolsetAS( $source, $obj, \@args )
355
#       This subroutine takes the user options and builds the rule(s)
356
#       required to compile the source file 'source' to 'obj'
357
#
358
###############################################################################
359
 
360
sub ToolsetAS
361
{
362
    my( $source, $obj, $pArgs ) = @_;
363
 
364
    foreach $_ ( @$pArgs ) {
365
        Message( "CC: unknown option $_ -- ignored\n" );
366
    }
367
 
368
    MakePrint( "\n\t\$(AS)\n" );
369
}
370
 
371
sub ToolsetASDepend
372
{
373
}
374
 
375
 
376
###############################################################################
377
#   ToolsetAR( $name, \@args, \@objs )
378
#       This subroutine takes the user options and builds the rules
379
#       required to build the library 'name'.
380
#
381
#   Arguments:
382
#
383
#   Options:
384
#       n/a
385
#
386
#   Output:
387
#       [ $(LIBDIR)/name$.${a}:   .... ]
388
#           $(AR)
389
#
390
###############################################################################
391
 
392
sub ToolsetAR
393
{
394
    my( $name, $pArgs, $pObjs ) = @_;
395
 
396
#.. Parse arguments
397
#
398
    foreach $_ ( @$pArgs ) {
399
        Message( "AR: unknown option $_ -- ignored\n" );
400
    }
401
 
402
#.. Standard library builds
403
#
404
    MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).${a}:\t",
405
                  "", "\\\n\t\t", ".${o} ", @$pObjs );
406
    MakePrint( "\n\t\$(AR)\n\n" );
407
}
408
 
409
 
410
###############################################################################
411
#   ToolsetARMerge( $name, \@args, \@libs )
412
#       This subroutine takes the user options and builds the rules
413
#       required to build the library 'name' by merging the specified
414
#       libaries
415
#
416
#   Arguments:
417
#       --xxx                   No arguments currently defined
418
#
419
#   Output:
420
#       [ $(LIBDIR)/name$.${a}:   .... ]
421
#           ...
422
#
423
###############################################################################
424
 
425
sub ToolsetARMerge
426
{
427
    MakePrint( "\n\t\$(ARMERGE)\n\n" );
428
}
429
 
430
 
431
###############################################################################
289 dpurdie 432
#   ToolsetSHLD( $name, \@args, \@objs, \@libraries, $ver )
227 dpurdie 433
#       This subroutine takes the user options and builds the rules
434
#       required to link the program 'name'.
435
#
436
#   Arguments:
437
#       --WithMisalign
438
#
439
#   Output:
440
#       $(LIBDIR)/name:         $(LIBDIR)/shared
441
#               ln -s $shared $name
442
#
443
#       $(LIBDIR)/name.dep:     $(GBE_PLATFORM).mk
444
#               $(SHLDDEPEND)
445
#
446
#       $(LIBDIR)/shared:       SHLIB=name
447
#       $(LIBDIR)/shared:       $(LIBDIR)/name.dep      \
448
#               $(OBJECTS)
449
#                               
450
#       ifneq "$(findstring $(IFLAG),23)" ""
451
#       -include                "$(LIBDIR)/name.dep"
452
#       endif
453
#
454
#       name_ld += ...
455
#           :
456
#
457
###############################################################################
458
 
459
sub ToolsetSHLD
460
{
289 dpurdie 461
    my( $name, $pArgs, $pObjs, $pLibs, $ver ) = @_;
227 dpurdie 462
    my( $shared, $merge_obj );
463
 
464
#.. Parse arguments
465
#
466
    foreach $_ ( @$pArgs )
467
    {
468
        if ( m~^--WithMisalign~ ) {
313 dpurdie 469
            $merge_obj = $SunMisalignObject;
227 dpurdie 470
 
471
        } else {
472
            Message( "SHLD: unknown option $_ -- ignored\n" );
473
        }
474
    }
475
 
476
#.. Full name of shared library
477
#
289 dpurdie 478
    $shared = "$name\$(GBE_TYPE).${so}.$ver";
227 dpurdie 479
 
480
#.. Install and package the shared libraries that are generated
481
#
482
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
483
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
313 dpurdie 484
 
227 dpurdie 485
#.. Cleanup rules
486
#
487
#   dep     Dependency file
488
#   map     Map file
489
#   ln      Link from LIBDIR to BINDIR
490
#
261 dpurdie 491
    ToolsetGenerate( "\$(LIBDIR)/${name}.dep" );
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
 
513
    $io->SHLDDEPEND($name, $name, $shared);     # std SHLDDEPEND rules
514
 
515
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
516
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${shared}\n" );
517
    $io->Entry( "\$(LIBDIR)/${shared}:\t", "", "\\\n\t\t", ".$::o", @$pObjs );
518
    $io->Prt( "\\\n\t\t\$(LIBDIR)/${name}.dep\n" );
519
    $io->Prt( "\t\$(SHLD)\n\n" );
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
 
548
#.. Dependency link,
549
#
550
#       Now piece together a variable $(name_dp) which ends up in
551
#       the command file building the application dependency list.
552
#
553
    $io->SetTag( "${name}_dp" );              # command tag
554
    $io->SetTerm();
555
 
556
    $io->DepRules( $name, $pLibs,               # library depends rules
557
        \&ToolsetLibRecipe, "$shared" );
558
 
559
    $io->Newline();
560
}
561
 
562
 
563
######################################################
564
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
565
#       This subroutine takes the user options and builds the rules
566
#       required to link the program 'name'.
567
#
568
#   Arguments:
569
#       n/a
570
#
571
#   Output:
572
#       $(BINDIR)/name:
573
#                       $(BINDIR)/name.dep
574
#           $(LD)
575
#       $(BINDIR)/name.dep:     $(GBE_PLATFORM).mk
576
#               $(LDDEPEND)
577
#
578
#       ifeq "$(IFLAG)" "3"
579
#       -include        "$(BINDIR)/name.dep"
580
#       endif
581
#
582
#       name_ld += ...
583
#           :
584
#
585
###############################################################################
586
 
587
sub ToolsetLD
588
{
589
    my( $name, $pArgs, $pObjs, $pLibs ) = @_;
590
 
591
#.. Parse arguments
592
#
593
    foreach $_ ( @$pArgs )
594
    {
595
        Message( "LD: unknown option $_ -- ignored\n" );
596
    }
597
 
598
#.. Cleanup rules
599
#
600
#       dep     Dependency file
601
#       map     Mape file
602
#
261 dpurdie 603
    ToolsetGenerate( "\$(BINDIR)/${name}.dep" );
604
    ToolsetGenerate( "\$(BINDIR)/${name}.map" );
227 dpurdie 605
 
606
 
607
#.. Build rules
608
#
609
    my ($io) = ToolsetPrinter::New();
610
 
611
    $io->Prt( "\\\n\t\t\$(BINDIR)/${name}.dep\n" .
612
              "\t\$(LD)\n\n" );
613
    $io->LDDEPEND( $name );                     # standard LDDEPEND rules
614
    $io->Newline();
615
 
616
#.. Linker command file
617
#
618
#       Now the fun part... piecing together a variable $(name_ld)
619
#       which ends up in the command file.
620
#
621
    $io->SetTag( "${name}_ld" );                        # macro tag
622
    $io->SetTerm( "\n" );
623
 
624
    $io->Label( "Linker commands", $name );             # label
625
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );  # object list
626
    ToolsetLibStd( $pLibs );                            # push standard libraries
627
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );  # library list
628
    $io->Newline();
629
 
630
#.. Dependency link,
631
#
632
#       Now piece together a variable $(name_dp) which ends up in
633
#       the command file building the application dependency list.
634
#
635
    $io->SetTag( "${name}_dp" );                        # macro tag
636
    $io->SetTerm();
637
 
638
    $io->DepRules( $name, $pLibs,                       # library depends rules
639
        \&ToolsetLibRecipe, "\$(BINDIR)/${name}" );
640
 
641
    $io->Newline();
642
}
643
 
644
 
645
########################################################################
646
#
647
#   Push standard "system" libraries. This is a helper function
648
#   used within this toolset.
649
#
650
#   Arguments:
651
#       $plib       Reference to library array.
652
#
653
########################################################################
654
 
655
sub ToolsetLibStd
656
{
657
}
658
 
659
########################################################################
660
#
661
#   Generate a linker object recipe.  This is a helper function used 
662
#   within this toolset.
663
#
664
#   Arguments:
665
#       $io         I/O stream
666
#
667
#       $target     Name of the target
668
#
669
#       $obj        Library specification
670
#
671
########################################################################
672
 
673
sub ToolsetObjRecipe
674
{
675
    my ($io, $target, $obj) = @_;
676
 
677
    $io->Cmd( "\$(strip $obj).$::o" );
678
}
679
 
680
 
681
###############################################################################
682
#
683
#   Parse a linker lib list
684
#   This is a helper function used within this toolset
685
#
686
#   Arguments:
687
#       $target     Name of the target
688
#
689
#       $lib        Library specification
690
#
691
#       $tag        Tag (user specified)
692
#
693
#       $dp         If building a depend list, the full target name.
694
#
695
###############################################################################
696
 
697
sub ToolsetLibRecipe
698
{
699
    my ($io, $target, $lib, $dp) = @_;
700
 
701
    if ( ! defined($dp) ) {                     # linker
702
        $lib =~ s/^lib//;                       # .. remove leading 'lib'
703
        $io->Cmd( "-l $lib" );
704
 
705
    } else {                                    # depend
706
        $io->Cmd( "$dp:\t@(vlib2,$lib,CC_LIB)" );
707
 
708
    }
709
}
710
#.. Successful termination
711
 
712
1;