Subversion Repositories DevTools

Rev

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

Rev 289 Rev 313
Line 16... Line 16...
16
 
16
 
17
#
17
#
18
#   Table to provide the location of SUNWSPRO_SC
18
#   Table to provide the location of SUNWSPRO_SC
19
#   This is hardcoded ( not good ) based on build machine
19
#   This is hardcoded ( not good ) based on build machine
20
#
20
#
-
 
21
#       Key: StudioIdentifier
-
 
22
#                   SunWorkshop6.1          - Solaris8  32 bit builds
-
 
23
#                   SunStudio11             - Solaris10 32 bit builds
-
 
24
#                   SunStudio12.1           - Solaris10 64 bit builds
21
#       Key: build machine type
25
#       Key: build machine type
22
#     Value: Per machine-type data
26
#     Value: Per machine-type data
23
#
27
#
24
#   Per machine type data is a hash
28
#   Per machine type data is a hash
-
 
29
#       archiver        - Path to archiver
25
#       compiler        - Path to the compiler
30
#       compiler        - Path to the compiler
26
#       misalign        - Path (relative to compiler) to the misalign obj file
31
#       misalign{32|64} - Path (relative to compiler) to the misalign obj file
27
#                         If not present then misalign not supported
32
#                         If not present then misalign not supported
28
#
33
#
-
 
34
my $SunProData;
-
 
35
my $SunMisalignObject;
29
my %SunProLocation = (
36
my %SunProLocation = (
-
 
37
    'solaris10_sparc32' => { 'SunStudio11' =>
30
    'solaris10_sparc32' => { 'compiler' => '/opt/SUNWspro/prod',
38
                                {   'compiler'   => '/opt/SUNWspro',
31
                             'misalign' => 'lib/misalign.o',
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
32
                             'archiver' => '/usr/ccs/bin',
47
                                    'archiver'   => '/usr/ccs/bin',
-
 
48
                                },
33
                           },
49
                            },
34
 
50
 
-
 
51
    'solaris10_x86'     =>  { 'SunStudio11' =>
35
    'solaris10_x86'     => { 'compiler' => '/opt/SUNWspro/prod',
52
                                {   'compiler'   => '/opt/SUNWspro',
-
 
53
                                    'archiver'   => '/usr/ccs/bin',
-
 
54
                                },
-
 
55
                             'SunStudio12.1' =>
-
 
56
                                {   'compiler'   => '/opt/sunstudio12.1',
36
                             'archiver' => '/usr/ccs/bin',
57
                                    'archiver'   => '/usr/ccs/bin',
-
 
58
                                },
37
                           },
59
                            },
38
 
60
 
-
 
61
    'sparc'             =>  { 'SunWorkshop6.1'   =>
39
    'sparc'             => { 'compiler' => '/opt/SUNWspro/WS6U1',
62
                                {   'compiler'   => '/opt/SUNWspro/WS6U1',
40
                             'misalign' => 'lib/misalign.o',
63
                                    'misalign32' => 'lib/misalign.o',
41
                             'archiver' => '/usr/ccs/bin',
64
                                    'archiver'   => '/usr/ccs/bin',
-
 
65
                                },
42
                           },
66
                            }
43
    );
67
    );
44
 
68
 
45
#
69
#
46
#   Globals
70
#   Globals
47
#
71
#
Line 78... Line 102...
78
#
102
#
79
    $::ScmToolsetVersion = "1.0.0";               # our version
103
    $::ScmToolsetVersion = "1.0.0";               # our version
80
    $::ScmToolsetGenerate = 0;                    # GEN generate optional
104
    $::ScmToolsetGenerate = 0;                    # GEN generate optional
81
 
105
 
82
    my $ScmToolTarget = '';
106
    my $ScmToolTarget = '';
-
 
107
    my $ScmStudio = '';
83
 
108
 
84
    #
109
    #
85
    #   Toolset args
110
    #   Toolset args
86
    #
111
    #
87
    foreach $_ ( @ScmToolsetArgs ) {
112
    foreach $_ ( @ScmToolsetArgs ) {
88
        if (/^--Target=(.*)/) {                # Target System
113
        if (/^--Target=(.*)/) {                # Target System
89
            $ScmToolTarget = $1;
114
            $ScmToolTarget = $1;
90
 
115
 
-
 
116
        } elsif ( /^--Studio=(.*)/) {
-
 
117
            $ScmStudio = $1;
-
 
118
 
91
        } else {
119
        } else {
92
            Message( "sunworks toolset: unknown toolset option $_ -- ignored" );
120
            Message( "sunworks toolset: unknown toolset option $_ -- ignored" );
93
        }
121
        }
94
    }
122
    }
95
 
123
 
Line 100... Line 128...
100
        if (/^--product=(.*)/) {                # GBE product
128
        if (/^--product=(.*)/) {                # GBE product
101
               
129
               
102
        } else {
130
        } else {
103
            Message( "sunworks toolset: unknown platform argument $_ -- ignored" );
131
            Message( "sunworks toolset: unknown platform argument $_ -- ignored" );
104
        }
132
        }
105
    } 
133
    }
-
 
134
 
-
 
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};
106
 
154
 
107
#.. Define environment
155
#.. Define environment
108
#    
156
#    
109
    Init( "sunworks" );
157
    Init( "sunworks" );
110
    ToolsetDefines( "sunworks.def" );
158
    ToolsetDefines( "sunworks.def" );
111
    ToolsetRules( "sunworks.rul" );
159
    ToolsetRules  ( "sunworks.rul" );
112
    ToolsetRules( "standard.rul" );
160
    ToolsetRules  ( "standard.rul" );
113
    
161
    
114
#.. Cleanup rules
162
#.. Cleanup rules
115
#
163
#
116
    ToolsetDirTree( "\$(LIBDIR)/SunWS_cache" );
164
    ToolsetDirTree( "\$(LIBDIR)/SunWS_cache" );
117
    ToolsetDirTree( "\$(OBJDIR)/SunWS_cache" );
165
    ToolsetDirTree( "\$(OBJDIR)/SunWS_cache" );
Line 147... Line 195...
147
 
195
 
148
 
196
 
149
    #
197
    #
150
    #   Ensure that we know where the compiler and archiver are
198
    #   Ensure that we know where the compiler and archiver are
151
    #
199
    #
152
    if ( exists $SunProLocation{$GBE_MACHTYPE} )
-
 
153
    {
-
 
154
        my $sunpro = $SunProLocation{$GBE_MACHTYPE}{compiler};
200
    my $sunpro = $SunProData->{compiler};
155
        ToolsetDefine ( "SUNWSPRO_SC  = $sunpro" );
201
    ToolsetDefine ( "SUNWSPRO_SC  = $sunpro" );
156
 
202
 
157
        my $ar_path = $SunProLocation{$GBE_MACHTYPE}{archiver};
203
    my $ar_path = $SunProData->{archiver};
158
        ToolsetDefine ( "AR_PATH  = $ar_path" );
204
    ToolsetDefine ( "AR_PATH  = $ar_path" );
159
    }
-
 
160
    else
-
 
161
    {
-
 
162
        Error ("SunWorks compiler not configured for this type of machine",
-
 
163
               "GBE_MACHTYPE: $GBE_MACHTYPE" );
-
 
164
    }
-
 
165
 
205
 
166
    #
206
    #
167
    #   Specify definitions to support 32 and 64 bit compilation
207
    #   Specify definitions to support 32 and 64 bit compilation
168
    #   Default operation is only intended for existing (solaris8) work
208
    #   Default operation is only intended for existing (solaris8) work
169
    #
209
    #
170
    if ( $ScmToolTarget )
210
    if ( ($ScmToolTarget =~ m/32$/) )
-
 
211
    {
-
 
212
        ToolsetDefine ( "COMPILE32  = 1" );
-
 
213
        $SunMisalignObject = $SunProData->{'misalign32'};
-
 
214
    }
-
 
215
    elsif ( ($ScmToolTarget =~ m/64$/) )
171
    {
216
    {
172
        ToolsetDefine ( "COMPILE32  = 1" ) if ($ScmToolTarget =~ m/32$/);
217
        ToolsetDefine ( "COMPILE64  = 1" );
173
        ToolsetDefine ( "COMPILE64  = 1" ) if ($ScmToolTarget =~ m/64$/);
218
        $SunMisalignObject = $SunProData->{'misalign64'};
174
    }
219
    }
-
 
220
    else
-
 
221
    {
-
 
222
        $SunMisalignObject = $SunProData->{'misalign32'};
-
 
223
    }
-
 
224
 
-
 
225
    #
-
 
226
    #   Allow SPARC and X86 compilation options to differ
-
 
227
    #
-
 
228
    my $isa_sparc = ( $GBE_MACHTYPE =~ m/sparc/i ) ? 1 : 0;
-
 
229
    ToolsetDefine ( "ISA_SPARC  = 1" ) if ($isa_sparc);
175
}
230
}
176
 
231
 
177
##############################################################################
232
##############################################################################
178
#   ToolsetPreprocess()
233
#   ToolsetPreprocess()
179
#       Process collected data before the makefile is generated
234
#       Process collected data before the makefile is generated
Line 187... Line 242...
187
{
242
{
188
    #
243
    #
189
    #   If the machine does not support misalignment and the user has requested
244
    #   If the machine does not support misalignment and the user has requested
190
    #   it, then kill the option - it makes life easier later.
245
    #   it, then kill the option - it makes life easier later.
191
    #
246
    #
192
    unless ( exists ($SunProLocation{$GBE_MACHTYPE}{misalign}) )
247
    unless ( $SunMisalignObject )
193
    {
248
    {
194
        if ( $::ScmCompilerOpts{'MISALIGN'} )
249
        if ( $::ScmCompilerOpts{'MISALIGN'} )
195
        {
250
        {
196
            Warning("Platform does not support MISALIGN option. Will be ignored");
251
            Warning("Platform does not support MISALIGN option. Will be ignored");
197
            delete $::ScmCompilerOpts{'MISALIGN'};
252
            delete $::ScmCompilerOpts{'MISALIGN'};
Line 409... Line 464...
409
#.. Parse arguments
464
#.. Parse arguments
410
#
465
#
411
    foreach $_ ( @$pArgs )
466
    foreach $_ ( @$pArgs )
412
    {
467
    {
413
        if ( m~^--WithMisalign~ ) {
468
        if ( m~^--WithMisalign~ ) {
414
            if ( exists $SunProLocation{$GBE_MACHTYPE}{misalign} ) {
-
 
415
                $merge_obj = $SunProLocation{$GBE_MACHTYPE}{misalign};
469
            $merge_obj = $SunMisalignObject;
416
            }
-
 
417
 
470
 
418
        } else {
471
        } else {
419
            Message( "SHLD: unknown option $_ -- ignored\n" );
472
            Message( "SHLD: unknown option $_ -- ignored\n" );
420
        }
473
        }
421
    }
474
    }
Line 426... Line 479...
426
 
479
 
427
#.. Install and package the shared libraries that are generated
480
#.. Install and package the shared libraries that are generated
428
#
481
#
429
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
482
    PackageShlibAddFiles( $name, "\$(LIBDIR)/${name}\$(GBE_TYPE).$::so" );
430
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
483
    PackageShlibAddFiles( $name, "\$(LIBDIR)/$shared" );
-
 
484
 
431
#.. Cleanup rules
485
#.. Cleanup rules
432
#
486
#
433
#   dep     Dependency file
487
#   dep     Dependency file
434
#   map     Map file
488
#   map     Map file
435
#   ln      Link from LIBDIR to BINDIR
489
#   ln      Link from LIBDIR to BINDIR