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; tabs: 8; indent-width: 4; show-tabs: yes; -*-
2
#
3
# Module name   : GCC
4
# Module type   : Makefile system
5
# Compiler(s)   : ANSI C
6
# Environment(s): GCC
7
#
8
# Description:
9
#       GCC C/C++ toolset
10
#
11
#............................................................................#
12
 
13
use strict;
14
use warnings;
15
 
16
##############################################################################
17
#   Configuration information
18
#   Cross reference from CrossCompiler Alias to actual paths
19
#   Structure:
20
#   Hash reference: Array of toolchain information
21
#           Root of compiler
22
#           Path to gcc
23
#           Path to ar
24
#
25
#
26
my %ToolsetConfig = (
27
    #
28
    #   Preferred version of the embedded toolchain
29
    #
30
    'i386-unknown-linux-gnu' => ['/opt/crosstool/gcc-4.1.1-glibc-2.5/i586-unknown-linux-gnu',
31
                                 'bin/i586-unknown-linux-gnu-gcc' ],
32
 
33
    'arm-9tdmi-linux-gnu'    => ['/opt/crosstool/gcc-4.1.1-glibc-2.5/arm-9tdmi-linux-gnu/',
34
                                 'bin/arm-9tdmi-linux-gnu-gcc' ],
35
 
36
    #
37
    #   Old (not to be used) version of the embedded toolchain
38
    #   This was depricated in favor of gcc-4.1.1-glibc-2.5
39
    #   It is not possible to reproduce old packages using the old compiler
40
    #   This is a known issue
41
    #
42
    'i386-unknown-linux-gnu.glibc-2.3.2' => ['/opt/crosstool/gcc-4.1.0-glibc-2.3.2/i386-unknown-linux-gnu',
43
                                 'bin/i386-unknown-linux-gnu-gcc' ],
44
 
45
    'arm-9tdmi-linux-gnu.glibc-2.3.2'    => ['/opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-9tdmi-linux-gnu',
46
                                 'bin/arm-9tdmi-linux-gnu-gcc' ],
47
 
48
    #
49
    #   Not too sure where this is used
50
    #
51
    'armv4l-unknown-linux-gcc' => [ '/opt/host/armv4l',
52
                                    'bin/armv4l-unknown-linux-gcc' ],
53
 
54
    #
55
    #   The compiler for the current local machine
56
    #
57
    'i386-unknown-linux-gcc' => [ '/opt/host/i386',
58
                                  'bin/i386-unknown-linux-gcc' ],
59
 
60
    );
61
 
62
#
63
#   Cross reference from GCCTarget to GBE_MACHTYPE for which it can
64
#   build using the 'native gcc'. This is NOT the preferred mode of operation
65
#   as the compiler is not as controlled as the cross compilers.
66
#
67
my %NativeCompilers = (
68
    'Linux i386'       => 'linux_i386',
69
    );
70
 
71
##############################################################################
72
#   ToolsetInit()
73
#       Runtime initialisation
74
#
75
##############################################################################
76
 
77
ToolsetInit();
78
 
79
sub ToolsetInit
80
{
81
    my( $GCCTarget, @GCCToolchain, $GCCRoot, $GCCBin, $GCCAr );
82
    my( $arg_alias, $tools_found );
83
 
84
#.. Toolset configuration
85
#
86
    $::ScmToolsetVersion = "1.0.0";             # our version
87
    $::ScmToolsetGenerate = 0;                  # GEN generate optional
88
    $::ScmToolsetIFLAG3 = 1;                    # IFLAG3 supported
89
    $::ScmToolsetCompilerPath = 1;              # Exports Compiler path to makefile via SCM_COMPILERPATH
90
 
91
#.. Standard.rul requirements
92
#
93
    $::s = "asm";
94
    $::o = "o";
95
    $::so = "so";
96
    $::a = "a";
97
    $::exe = "";
98
 
99
#.. Parse arguments
100
#
101
    foreach $_ ( @::ScmToolsetArgs ) {
102
        if (/^--Target=(.*)/) {                 # OS Version
103
            $GCCTarget = "$1";
104
 
105
        } elsif (/^--CrossAlias=(.*)/) {        # CrossCompiler target-alias
106
            $arg_alias = $1;
107
 
108
        } else {
109
            Message( "gcc toolset: unknown option $_ -- ignored\n" );
110
        }
111
    }
112
 
113
    foreach $_ ( @::ScmPlatformArgs ) {
114
        if (/^--product=(.*)/) {                # GBE product
115
 
116
        } else {
117
            Message( "gcc toolset: unknown platform argument $_ -- ignored\n" );
118
        }
119
    }
120
 
121
    Error ("TOOLSET/gcc - Target undefined" )
122
        unless ($GCCTarget);
123
 
124
#.. Cross compile support
125
#
126
#   Toolchain=root,[bin]
127
#
128
    if ( $arg_alias )
129
    {
130
        if ( exists $ToolsetConfig{ $arg_alias } )
131
        {
132
            @GCCToolchain = @{$ToolsetConfig{ $arg_alias }};
133
            $tools_found = (-d $GCCToolchain[0]);
134
            Warning ("gcc toolset: CrossPlatform toolchain not found for: $arg_alias",
135
                     "Path: $GCCToolchain[0]" ) unless $tools_found;
136
        }
137
        else
138
        {
139
            Error("gcc toolset: CrossPlatform Alias not configured: $arg_alias");
140
        }
141
    }
142
 
143
    #
144
    #   If no Cross compiler toolchain is found (preferred method), then attempt
145
    #   to match a native compiler. Only known targets allow a native build
146
    #
147
    unless ( $tools_found )
148
    {
149
        if ( exists ( $NativeCompilers{$GCCTarget} ))
150
        {
151
            if ( $NativeCompilers{$GCCTarget} eq $::GBE_MACHTYPE )
152
            {
153
                $tools_found = 1;
154
                @GCCToolchain = ();
155
            }
156
        }
157
    }
158
 
159
    #
160
    #   Must have a toolset by now, either a cross compiler or Native
161
    #
162
    Error ("gcc toolset: Toolchain not found for: $GCCTarget" )
163
        unless ( $tools_found );
164
 
165
 
166
    if ( @GCCToolchain )
167
    {
168
        #
169
        #   Parse GCCToolchain. Potentially three parts
170
        #   [0] - GCCRoot - Location to find the effective /usr/include directory
171
        #   [1] - GCCBin  - Path to the gcc executable
172
        #                   If relative, then its relative to GCCRoot
173
        #   [2] - GCCAr   - Path to the ar executable
174
        #                   If relative, then its relative to GCCRoot
175
        #                   If not defined then its the same as GCCBin with gcc replaced with ar
176
        #
177
        $GCCRoot = $GCCToolchain[0];
178
 
179
        #   GCC_CC definition
180
        #
181
        if ( $GCCToolchain[1] )
182
        {                                           # user specification
183
            if ( substr($GCCToolchain[1],0,1) ne "/") {
184
                $GCCBin = $GCCToolchain[0].'/'.$GCCToolchain[1];
185
            } else {
186
                $GCCBin = $GCCToolchain[1];         # abs path
187
            }
188
        }
189
        else
190
        {                                           # default
191
            $GCCBin = $GCCToolchain[0] . '/bin/gcc';
192
        }
193
 
194
        #   GCC_AR definition
195
        #
196
        if ( defined($GCCToolchain[2]) && $GCCToolchain[2] )
197
        {                                           # user specification
198
            if ( substr($GCCToolchain[2],0,1) ne "/") {
199
                $GCCAr = $GCCToolchain[0].'/'.$GCCToolchain[2];
200
            } else {
201
                $GCCAr = $GCCToolchain[2];          # abs path
202
            }
203
        } 
204
        else 
205
        {                                           # default, base on GCCBin
206
            $GCCAr = substr($GCCBin,0,length($GCCBin)-3)."ar";
207
        }
208
    }
209
    else
210
    {
211
        $GCCRoot = "/usr";
212
        $GCCBin = "gcc";
213
        $GCCAr = "ar";
214
    }
215
 
216
#.. Define GCC environment
217
#
218
    PlatformDefine( "
219
#################################################
220
# GCC toolchain definitions 
221
#
222
#..");
223
    PlatformDefine( "GCC_TARGET\t".     ":=$GCCTarget" );
224
    PlatformDefine( "GCC_ROOT\t".       ":=$GCCRoot" );
225
    PlatformDefine( "GCC_CC\t\t".       ":=$GCCBin" );
226
    PlatformDefine( "GCC_AR\t\t".       ":=$GCCAr" );
227
    PlatformDefine( "" );
228
 
229
    #
230
    #   Required since this toolset advertises: ScmToolsetCompilerPath
231
    #
232
    PlatformDefine( "SCM_COMPILERPATH\t\t".       ":=$GCCBin" );
233
 
234
 
235
#.. Piece the world together
236
#
237
    Init( "gcc" );
238
    ToolsetDefines( "gcc.def" );
239
    ToolsetRules( "gcc.rul" );
240
    ToolsetRules( "standard.rul" );
241
 
242
#   Create a standard data structure
243
#   This is a hash of hashes
244
#       The first hash is keyed by CompileOption keyword
245
#       The second hash contains pairs of values to set or remove
246
#
247
    %::ScmToolsetCompilerOptions =
248
    (
249
        #
250
        #   Control the thread model to use
251
        #   This will affect the compiler options and the linker options
252
        #
253
        'staticprogs'        => { 'STATIC_PROGS' , '1' },      # Progams link staticlly
254
        'no_staticprogs'     => { 'STATIC_PROGS' , undef },    # Default
255
    );
256
 
257
    #
258
    #   Set default options
259
    #
260
    $::ScmCompilerOpts{'STATIC_PROGS'} = undef;
261
}
262
 
263
 
264
###############################################################################
265
#   ToolsetCC( $source, $obj, \@args )
266
#       This subroutine takes the user options and builds the rule(s)
267
#       required to compile the source file 'source' to 'obj'
268
#
269
###############################################################################
270
 
271
sub ToolsetCC
272
{
273
    my( $source, $obj, $pArgs ) = @_;
274
    my( $cflags, $file ) = "";
275
 
276
    foreach $_ ( @$pArgs ) {
277
        if (/--Shared$/) {                      # Building a 'shared' object
278
            $cflags  = "$cflags \$(SHCFLAGS)";
279
        } else {
280
            Message( "CC: unknown option $_ -- ignored\n" );
281
        }
282
    }
283
 
284
    MakePrint( "\n\t\$(CC)\n" );
285
    if ( $cflags )
286
    {                                           # object specific CFLAGS
287
        MakePadded( 4, "\$(OBJDIR)/$obj.$::o:" );
288
        MakePrint( "\tCFLAGS +=$cflags\n" );
289
    }
290
 
291
    $file = StripExt( $obj );                   # Metric working file
292
    ToolsetGenerate( "\$(OBJDIR)/$file.met" );
293
}
294
 
295
 
296
###############################################################################
297
#   ToolsetCCDepend( $depend, \@sources )
298
#       This subroutine takes the user options and builds the
299
#       rule(s) required to build the dependencies for the source
300
#       files 'sources' to 'depend'.
301
#
302
###############################################################################
303
 
304
sub ToolsetCCDepend
305
{
306
    MakePrint( "\t\$(CCDEPEND)\n" );
307
}
308
 
309
 
310
###############################################################################
311
#   ToolsetCXX( $source, $obj, \@args )
312
#       This subroutine takes the user options and builds the rule(s)
313
#       required to compile the source file 'source' to 'obj'
314
#
315
###############################################################################
316
 
317
sub ToolsetCXX
318
{
319
    my( $source, $obj, $pArgs ) = @_;
320
    my( $cflags, $file ) = "";
321
 
322
    foreach $_ ( @$pArgs ) {
323
        if (/--Shared$/) {                      # Building a 'shared' object
324
            $cflags  = "$cflags \$(SHCXXFLAGS)";
325
        } else {
326
            Message( "CXX: 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
    $file = StripExt( $obj );                   # Metric working file
338
    ToolsetGenerate( "\$(OBJDIR)/$file.met" );
339
}
340
 
341
 
342
###############################################################################
343
#   ToolsetCXXDepend( $depend, \@sources )
344
#       This subroutine takes the user options and builds the
345
#       rule(s) required to build the dependencies for the source
346
#       files 'sources' to 'depend'.
347
#
348
###############################################################################
349
 
350
sub ToolsetCXXDepend
351
{
352
    #ToolsetCCDepend() handles both CC and CXX source
353
}
354
 
355
 
356
###############################################################################
357
#   ToolsetAS( $source, $obj, \@args )
358
#       This subroutine takes the user options and builds the rule(s)
359
#       required to compile the source file 'source' to 'obj'
360
#
361
###############################################################################
362
 
363
sub ToolsetAS
364
{
365
    MakePrint( "\n\t\$(AS)\n" );
366
}
367
 
368
sub ToolsetASDepend
369
{
370
}
371
 
372
 
373
###############################################################################
374
#   ToolsetAR( $name, \@args, \@objs )
375
#       This subroutine takes the user options and builds the rules
376
#       required to build the library 'name'.
377
#
378
#   Arguments:
379
#       n/a
380
#
381
#   Output:
382
#       $(BINDIR)/name$.${a}:   .... ]
383
#           $(AR)
384
#
385
#       name_ld += ...  Linker command file
386
#           :
387
#
388
#       name_dp += ...  Dependency list
389
#           :
390
#
391
###############################################################################
392
 
393
sub ToolsetAR
394
{
395
    my( $name, $pArgs, $pObjs ) = @_;
396
 
397
#.. Parse arguments
398
#
399
    foreach $_ ( @$pArgs )
400
    {
401
        Message( "AR: unknown option $_ -- ignored\n" );
402
    }
403
 
404
#.. Target
405
#
406
    MakePrint( "#.. Library ($name)\n\n" );     # label
407
 
408
    MakeEntry( "\$(LIBDIR)/$name\$(GBE_TYPE).$::a:\t",
409
        "", "\\\n\t\t", ".$::o", @$pObjs );
410
 
411
#.. Build library rule (just append to standard rule)
412
#
413
    MakePrint( "\n\t\$(AR)\n\n" );
414
}
415
 
416
 
417
###############################################################################
418
#   ToolsetARMerge( $name, \@args, \@libs )
419
#       This subroutine takes the user options and builds the rules
420
#       required to build the library 'name' by merging the specified
421
#       libaries
422
#
423
#   Arguments:
424
#       --xxx                   No arguments currently defined
425
#
426
#   Output:
427
#       [ $(LIBDIR)/name$.${a}:   .... ]
428
#           ...
429
#
430
###############################################################################
431
 
432
sub ToolsetARMerge
433
{
434
    MakePrint( "\n\t\$(ARMERGE)\n\n" );
435
}
436
 
437
 
438
###############################################################################
439
#   ToolsetSHLD( $name, \@args, \@objs, \@libraries )
440
#       This subroutine takes the user options and builds the rules
441
#       required to link the program 'name'.
442
#
443
#   Arguments:
444
#   n/a
445
#
446
#   Output:
447
#       $(LIBDIR)/name:     $(LIBDIR)/shared
448
#           ln -s $shared $name
449
#
450
#       $(LIBDIR)/name.dep: $(GBE_OBJDIR)
451
#       $(LIBDIR)/name.dep: $(GBE_LIBDIR)
452
#       $(LIBDIR)/name.dep: $(GBE_PLATFORM).mk
453
#           $(SHLDDEPEND)
454
#
455
#       $(LIBDIR)/shared:   SHNAME=name
456
#       $(LIBDIR)/shared:   SHBASE=base
457
#       $(LIBDIR)/shared:   $(LIBDIR)/name.dep  \
458
#           $(OBJECTS)
459
#                           
460
#       ifneq "$(findstring $(IFLAG),23)" ""
461
#       -include            "$(LIBDIR)/name.dep"
462
#       endif
463
#
464
#       name_ld += ...
465
#           :
466
#
467
###############################################################################
468
 
469
sub ToolsetSHLD
470
{
471
    my( $name, $pArgs, $pObjs, $pLibs ) = @_;
472
    my( $shared, $def, $def_pref, $multi_scan );
473
 
474
#.. Parse arguments
475
#
476
    foreach $_ ( @$pArgs )
477
    {
478
        if (/^--Def=(.*?)(\,(.*))?$/) {         # Library definition
479
            #
480
            #   Locate the Def file.
481
            #   If it is a generate file so it will be in the SRCS hash
482
            #   Otherwise the user will have to use Src to locate the file
483
            #
484
            $def = MakeSrcResolve($1);
485
            $def_pref = '';
486
            if ( $1 =~ m~\.def$~ ) {
487
                $def_pref = '--version-script='; # Old def file
488
            }
489
        } elsif ( /^--MultiScan/i ) {
490
            $multi_scan = 1;
491
 
492
        } elsif ( /^--NoMultiScan/i ) {
493
            $multi_scan = 0;
494
 
495
        } else {
496
            Message( "SHLD: unknown option $_ -- ignored\n" );
497
        }
498
    }
499
 
500
#.. Full name of shared library
501
#
502
    $shared = "$name\$(GBE_TYPE).$::so.$::SHLIB_VER{ $name }";
503
 
504
#.. Install and package the shared libraries that are generated
505
#
506
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
507
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
508
 
509
#.. Cleanup rules
510
#
511
#   dep     Dependency file
512
#   map     Map file
513
#   ln      Link from LIBDIR to BINDIR
514
#
515
    ToolsetProg( "\$(LIBDIR)/${name}.dep" );
516
    ToolsetProg( "\$(LIBDIR)/${name}.map" );
517
    ToolsetProg( "\$(LIBDIR)/${shared}" );
518
    ToolsetProg( "\$(BINDIR)/${shared}" );
519
 
520
#.. Build rules
521
#
522
#   name        Base name
523
#   shared      Library name, includes GBE_TYPE specification
524
#
525
    my ($io) = ToolsetPrinter::New();
526
 
527
    $io->Label( "Shared library", $name );
528
 
529
    $io->Prt( "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so:\t\\\n" .
530
              "\t\t\$(GBE_BINDIR)\\\n" .
531
              "\t\t\$(LIBDIR)/${shared}\n" .
532
              "\t\@(rm -f \$@; ln -s ./$shared \$@)\n" .
533
              "\t\@(rm -f \$(BINDIR)/$shared; ln -s ../\$(LIBDIR)/$shared \$(BINDIR)/$shared)\n\n" );
534
 
535
    $io->SHLDDEPEND($name, $name, $shared);     # std SHLDDEPEND rules
536
 
537
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHBASE=${name}\n" );
538
    $io->Prt( "\$(LIBDIR)/${shared}:\tSHNAME=${shared}\n" );
539
    $io->Entry( "\$(LIBDIR)/${shared}:\t", "", "\\\n\t\t", ".$::o", @$pObjs );
540
    $io->Prt( "\\\n\t\t$def" ) if($def);
541
    $io->Prt( "\\\n\t\t\$(LIBDIR)/${name}.dep\n" );
542
    $io->Prt( "\t\$(SHLD)\n\n" );
543
 
544
 
545
#.. Linker command file
546
#
547
#       Now the fun part... piecing together a variable $(name_shld)
548
#       which ends up in the command file.
549
#
550
    $io->SetTag( "${name}_shld" );              # command tag
551
    $io->SetTerm( "\n" );
552
 
553
    $io->Label( "Linker commands", $name );     # label
554
 
555
                                                # object list
556
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
557
 
558
    ToolsetLibStd( $pLibs );                    # push standard libraries
559
 
560
    $io->Cmd( "-Wl,$def_pref$def" ) if ($def);
561
 
562
    $io->Cmd( "-Wl,--start-group" ) if ($multi_scan);
563
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
564
    $io->Cmd( "-Wl,--end-group" ) if ($multi_scan);
565
 
566
    $io->Newline();
567
 
568
#.. Dependency link,
569
#
570
#       Now piece together a variable $(name_dp) which ends up in
571
#       the command file building the application dependency list.
572
#
573
    $io->SetTag( "${name}_shdp" );              # command tag
574
    $io->SetTerm();
575
 
576
    $io->DepRules( $name, $pLibs,               # library depends rules
577
        \&ToolsetLibRecipe, "$shared" );
578
 
579
    $io->Newline();
580
}
581
 
582
 
583
###############################################################################
584
#   ToolsetLD( $name, \@args, \@objs, \@libraries )
585
#       This subroutine takes the user options and builds the rules
586
#       required to link the program 'name'.
587
#
588
#   Arguments:
589
#       n/a
590
#
591
#   Output:
592
#       $(BINDIR)/name:
593
#                       $(BINDIR)/name.dep
594
#           $(LD)
595
#                               
596
#       $(BINDIR)/name.dep:     $(GBE_BINDIR)
597
#       $(BINDIR)/name.dep:     $(GBE_PLATFORM).mk
598
#               $(LDDEPEND)
599
#
600
#       ifeq "$(IFLAG)" "3"
601
#       -include        "$(BINDIR)/name.dep"
602
#       endif
603
#
604
#       name_ld += ...
605
#           :
606
#
607
###############################################################################
608
 
609
sub ToolsetLD
610
{
611
    my( $name, $pArgs, $pObjs, $pLibs ) = @_;
612
    my $static = $::ScmCompilerOpts{'STATIC_PROGS'};
613
    my $multi_scan;
614
 
615
#.. Parse arguments
616
#
617
    foreach $_ ( @$pArgs )
618
    {
619
        if ( m/^--Static$/ ) {
620
            $static = 1;
621
 
622
        } elsif ( m/^--Shared/ ) {
623
            $static = 0;
624
 
625
        } elsif ( /^--MultiScan/i ) {
626
            $multi_scan = 1;
627
 
628
        } elsif ( /^--NoMultiScan/i ) {
629
            $multi_scan = 0;
630
 
631
        } else {
632
            Message( "LD: unknown option $_ -- ignored\n" );
633
        }
634
    }
635
 
636
#.. Cleanup rules
637
#
638
    ToolsetProg( "\$(BINDIR)/${name}.ld" );
639
    ToolsetProg( "\$(BINDIR)/${name}.dep" );
640
    ToolsetProg( "\$(BINDIR)/${name}.map" );
641
 
642
#.. Build rules
643
#
644
    my ($io) = ToolsetPrinter::New();
645
 
646
    $io->Prt( "\\\n\t\t\$(BINDIR)/${name}.dep\n" .
647
              "\t\$(LD)\n\n" );
648
    $io->LDDEPEND( $name );                     # standard LDDEPEND rules
649
    $io->Newline();
650
 
651
#.. Linker command file
652
#
653
#       Now the fun part... piecing together a variable $(name_ld)
654
#       which ends up in the command file.
655
#
656
    $io->SetTag( "${name}_ld" );                # macro tag
657
    $io->SetTerm( "\n" );
658
 
659
    $io->Label( "Linker commands", $name );     # label
660
 
661
    $io->Cmd( "-static" ) if ($static);         # Link as a static program
662
 
663
                                                # object list
664
    $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
665
 
666
    ToolsetLibStd( $pLibs );                    # push standard libraries
667
 
668
                                                # library list
669
    $io->Cmd( "-Wl,--start-group" ) if ($multi_scan);
670
    $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
671
    $io->Cmd( "-Wl,--end-group" ) if ($multi_scan);
672
 
673
    $io->Newline();
674
 
675
#.. Dependency link,
676
#
677
#       Now piece together a variable $(name_dp) which ends up in
678
#       the command file building the application dependency list.
679
#
680
    $io->SetTag( "${name}_dp" );                # macro tag
681
    $io->SetTerm();
682
 
683
    $io->DepRules( $name, $pLibs,               # library depends rules
684
        \&ToolsetLibRecipe, "\$(BINDIR)/${name}" );
685
 
686
    $io->Newline();
687
}
688
 
689
 
690
########################################################################
691
#
692
#   Push standard "system" libraries. This is a helper function
693
#   used within this toolset.
694
#
695
#   Arguments:
696
#       $plib       Reference to library array.
697
#
698
########################################################################
699
 
700
sub ToolsetLibStd
701
{
702
}
703
 
704
 
705
########################################################################
706
#
707
#   Generate a linker object recipe.  This is a helper function used 
708
#   within this toolset.
709
#
710
#   Arguments:
711
#       $io         I/O stream
712
#
713
#       $target     Name of the target
714
#
715
#       $obj        Library specification
716
#
717
########################################################################
718
 
719
sub ToolsetObjRecipe
720
{
721
    my ($io, $target, $obj) = @_;
722
 
723
    $io->Cmd( "\$(strip $obj).$::o" );
724
}
725
 
726
 
727
###############################################################################
728
#
729
#   Parse a linker lib list
730
#   This is a helper function used within this toolset
731
#
732
#   Arguments:
733
#       $target     Name of the target
734
#
735
#       $lib        Library specification
736
#
737
#       $tag        Tag (user specified)
738
#
739
#       $dp         If building a depend list, the full target name.
740
#
741
###############################################################################
742
 
743
sub ToolsetLibRecipe
744
{
745
    my ($io, $target, $lib, $dp) = @_;
746
 
747
    if ( ! defined($dp) ) {                     # linker
748
        $lib =~ s/^lib//;                       # .. remove leading 'lib'
749
        $io->Cmd( "-l$lib" );
750
 
751
    } else {                                    # depend
752
        $io->Cmd( "$dp:\t@(vlib2,$lib,GCC_LIB)" );
753
 
754
    }
755
}
756
 
757
#.. Successful termination
758
1;
759