Subversion Repositories DevTools

Rev

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

Rev 335 Rev 343
Line 19... Line 19...
19
my $pdb_first_lib;
19
my $pdb_first_lib;
20
my $target_file_lib;
20
my $target_file_lib;
21
my $target_file_dll;
21
my $target_file_dll;
22
my $target_file_exe;
22
my $target_file_exe;
23
my $pdb_none;
23
my $pdb_none;
-
 
24
my $toolset_name = 'vcwin32';                           # Toolset name : Error reporting
24
 
25
 
25
##############################################################################
26
##############################################################################
26
#   Version information
27
#   Version information
27
#
28
#
28
my $toolset_info;
29
my $toolset_info;
29
my $toolset_version = 'MSVC6';
30
my $toolset_version = 'MSVC6';
30
my %ToolsetVersion =
31
my %ToolsetVersion =
31
    (
32
    (
32
        'MSVC6'      =>  { 'def'        => 'vcwin32.def' ,
33
        'MSVC6'      =>  { 'def'        => 'vcwin32.def' ,
33
                           'buildcmd'   => 'msdev =DSW= /make "ALL - =TYPE=" /useenv /out =LOG=' ,
34
                           'buildcmd'   => 'msdev =DSW= /make =TYPE= /useenv /out =LOG=' ,
34
                           'cleancmd'   => 'msdev =DSW= /make "ALL - =TYPE=" /clean /useenv' ,
35
                           'cleancmd'   => 'msdev =DSW= /make =TYPE= /clean /useenv' ,
35
                           'tmp'        => 'vc60',
36
                           'tmp'        => 'vc60',
36
                           'VSCOMPILER' => '1',
37
                           'VSCOMPILER' => '1',
-
 
38
                           'def_targets' => [ 'ALL - RELEASE','ALL - DEBUG' ],
37
                           },
39
                           },
38
 
40
 
39
        'MS.NET2003' =>  { 'def'        => 'vcwin32_net2003.def' ,
41
        'MS.NET2003' =>  { 'def'        => 'vcwin32_net2003.def' ,
40
                           'buildcmd'   => 'devenv =DSW= /build =TYPE= /useenv /out =LOG=' ,
42
                           'buildcmd'   => 'devenv =DSW= /build =TYPE= /useenv /out =LOG=' ,
41
                           'cleancmd'   => 'devenv =DSW= /clean =TYPE= /useenv' ,
43
                           'cleancmd'   => 'devenv =DSW= /clean =TYPE= /useenv' ,
Line 73... Line 75...
73
sub ToolsetInit
75
sub ToolsetInit
74
{
76
{
75
 
77
 
76
#.. Parse arguments (Toolset arguments)
78
#.. Parse arguments (Toolset arguments)
77
#
79
#
78
    Debug( "vcwin32(@::ScmToolsetArgs)" );
80
    Debug( "$toolset_name(@::ScmToolsetArgs)" );
79
 
81
 
80
    foreach $_ ( @::ScmToolsetArgs ) {
82
    foreach $_ ( @::ScmToolsetArgs ) {
81
        if (/^--Version=(.*)/) {           # MS SDK Version
83
        if (/^--Version=(.*)/) {           # MS SDK Version
82
            $toolset_version = $1;
84
            $toolset_version = $1;
83
 
85
 
84
        } else {
86
        } else {
85
            Message( "vcwin32 toolset: unknown option $_ -- ignored\n" );
87
            Message( "$toolset_name toolset: unknown option $_ -- ignored\n" );
86
        }
88
        }
87
    }
89
    }
88
 
90
 
89
#.. Parse arguments (platform arguments)
91
#.. Parse arguments (platform arguments)
90
#
92
#
91
    Debug( "vcwin32(@::ScmPlatformArgs)" );
93
    Debug( "$toolset_name(@::ScmPlatformArgs)" );
92
 
94
 
93
    foreach $_ ( @::ScmPlatformArgs ) {
95
    foreach $_ ( @::ScmPlatformArgs ) {
94
        if (/^--product=(.*)/) {                # GBE product
96
        if (/^--product=(.*)/) {                # GBE product
95
 
97
 
96
        } elsif (/^--Version=(.*)/) {           # MS SDK Version
98
        } elsif (/^--Version=(.*)/) {           # MS SDK Version
97
            $toolset_version = $1;
99
            $toolset_version = $1;
98
 
100
 
99
        } elsif (/^--NoDinkumware/) {           # Dinkumware package test
101
        } elsif (/^--NoDinkumware/) {           # Dinkumware package test
100
 
102
 
101
        } else {
103
        } else {
102
            Message( "vcwin32 toolset: unknown platform argument $_ -- ignored\n" );
104
            Message( "$toolset_name toolset: unknown platform argument $_ -- ignored\n" );
103
        }
105
        }
104
    }
106
    }
105
 
107
 
106
#.. Validate SDK version
108
#.. Validate SDK version
107
#   Currently three versions are supported
109
#   Currently three versions are supported
Line 309... Line 311...
309
            $cflags = "$cflags \$(SHCFLAGS)";
311
            $cflags = "$cflags \$(SHCFLAGS)";
310
            $pdb = $::SHOBJ_LIB{$obj}
312
            $pdb = $::SHOBJ_LIB{$obj}
311
                if (exists $::SHOBJ_LIB{$obj} );
313
                if (exists $::SHOBJ_LIB{$obj} );
312
 
314
 
313
        } else {
315
        } else {
314
            Message( "vcwin32 $name: unknown option $_ -- ignored\n" );
316
            Message( "$toolset_name $name: unknown option $_ -- ignored\n" );
315
        }
317
        }
316
    }
318
    }
317
 
319
 
318
    MakePrint( "\n\t\$($name)\n" );
320
    MakePrint( "\n\t\$($name)\n" );
319
    MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tCFLAGS +=$cflags\n" )
321
    MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tCFLAGS +=$cflags\n" )
Line 444... Line 446...
444
 
446
 
445
        } elsif (/^--Resource=(.*)/) {          # Resource definition
447
        } elsif (/^--Resource=(.*)/) {          # Resource definition
446
            ($res, @reslist) = ToolsetRClist( "$name", $1 );
448
            ($res, @reslist) = ToolsetRClist( "$name", $1 );
447
 
449
 
448
        } else {                                # unknown
450
        } else {                                # unknown
449
            Message( "vcwin32 AR: unknown option $_ -- ignored\n" );
451
            Message( "$toolset_name AR: unknown option $_ -- ignored\n" );
450
        }
452
        }
451
    }
453
    }
452
 
454
 
453
#.. Resource Creation
455
#.. Resource Creation
454
#
456
#
Line 671... Line 673...
671
            #
673
            #
672
            next unless ($2);
674
            next unless ($2);
673
            if ( $3 =~ /^--MutualDll$/ ) {
675
            if ( $3 =~ /^--MutualDll$/ ) {
674
                $mutual_dll = 1;
676
                $mutual_dll = 1;
675
            } else {
677
            } else {
676
                Message( "vcwin32 SHLD: unknown option $_ -- ignored\n" );
678
                Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
677
            }
679
            }
678
 
680
 
679
        } elsif (/^--Resource=(.*)/) {          # Resource definition
681
        } elsif (/^--Resource=(.*)/) {          # Resource definition
680
            ($res, @reslist) = ToolsetRClist( "$name/$name", $1 );
682
            ($res, @reslist) = ToolsetRClist( "$name/$name", $1 );
681
 
683
 
Line 701... Line 703...
701
            $mutual_dll = 1;
703
            $mutual_dll = 1;
702
 
704
 
703
        } elsif (/^--Stubonly/) {
705
        } elsif (/^--Stubonly/) {
704
            $stub_only = 1;
706
            $stub_only = 1;
705
        } else {                                # unknown
707
        } else {                                # unknown
706
            Message( "vcwin32 SHLD: unknown option $_ -- ignored\n" );
708
            Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
707
        }
709
        }
708
    }
710
    }
709
 
711
 
710
    #
712
    #
711
    #   Sanity test
713
    #   Sanity test
712
    #
714
    #
713
    Error ("vcwin32 SHLD:Stubonly option requires --Def=file ")
715
    Error ("$toolset_name SHLD:Stubonly option requires --Def=file ")
714
        if ( $stub_only && ! $def );
716
        if ( $stub_only && ! $def );
715
 
717
 
716
    Error ("vcwin32 SHLD:MutualDll option requires --Def=file ")
718
    Error ("$toolset_name SHLD:MutualDll option requires --Def=file ")
717
        if ( $mutual_dll && ! $def );
719
        if ( $mutual_dll && ! $def );
718
        
720
        
719
 
721
 
720
 
722
 
721
#.. Build rules
723
#.. Build rules
Line 1024... Line 1026...
1024
 
1026
 
1025
        } elsif (/^--NoAddLib/) {
1027
        } elsif (/^--NoAddLib/) {
1026
            $noaddlibs = 1;
1028
            $noaddlibs = 1;
1027
 
1029
 
1028
        } else {
1030
        } else {
1029
            Message( "vcwin32 LD: unknown option $_ -- ignored\n" );
1031
            Message( "$toolset_name LD: unknown option $_ -- ignored\n" );
1030
 
1032
 
1031
        }
1033
        }
1032
    }
1034
    }
1033
 
1035
 
1034
#.. Names of important files
1036
#.. Names of important files
Line 1350... Line 1352...
1350
sub ToolsetPROJECT
1352
sub ToolsetPROJECT
1351
{
1353
{
1352
    my( $name, $solution ,$pArgs ) = @_;
1354
    my( $name, $solution ,$pArgs ) = @_;
1353
    my $buildcmd = $toolset_info->{'buildcmd'};
1355
    my $buildcmd = $toolset_info->{'buildcmd'};
1354
    my $cleancmd = $toolset_info->{'cleancmd'};
1356
    my $cleancmd = $toolset_info->{'cleancmd'};
-
 
1357
    my $release = ${$toolset_info->{'def_targets'}}[0] || 'RELEASE';
-
 
1358
    my $debug =   ${$toolset_info->{'def_targets'}}[1] || 'DEBUG';
1355
 
1359
 
1356
    #
1360
    #
1357
    #   Process options
1361
    #   Process options
1358
    #
1362
    #
1359
    foreach ( @$pArgs ) {
1363
    foreach ( @$pArgs ) {
-
 
1364
        if ( m/^--TargetProd*=(.+)/ ) {
-
 
1365
            $release = $1;
-
 
1366
 
-
 
1367
        } elsif ( m/^--TargetDebug=(.+)/ ) {
-
 
1368
            $debug = $1;
-
 
1369
            
-
 
1370
        } else {
1360
        Message( "vcwin32 PROJECT: unknown option $_ -- ignored\n" );
1371
            Message( "$toolset_name PROJECT: unknown option $_ -- ignored\n" );
-
 
1372
        }
1361
    }
1373
    }
1362
 
1374
 
1363
    my ($io) = ToolsetPrinter::New();
1375
    my ($io) = ToolsetPrinter::New();
1364
 
1376
 
1365
    #
1377
    #
1366
    #   Setup toolset pecific difinitions. Once
1378
    #   Setup toolset specific difinitions. Once
1367
    #
1379
    #
1368
    unless( $project_defines_done )
1380
    unless( $project_defines_done )
1369
    {
1381
    {
1370
        $project_defines_done = 1;
1382
        $project_defines_done = 1;
1371
        $io->PrtLn( "ifeq \"\$(DEBUG)\" \"1\"");
1383
        $io->PrtLn( 'project_target = $(if $(findstring 1,$(DEBUG)),$2,$1)' );
1372
        $io->PrtLn( "PROJECT_CMD\t:= DEBUG");
-
 
1373
        $io->PrtLn( "else");
-
 
1374
        $io->PrtLn( "PROJECT_CMD\t:= RELEASE");
-
 
1375
        $io->PrtLn( "endif");
-
 
1376
        $io->Newline();
1384
        $io->Newline();
1377
    }
1385
    }
1378
 
1386
 
1379
    #
1387
    #
1380
    #   Process the build and clean commands
1388
    #   Process the build and clean commands
1381
    #       Substitute arguments
1389
    #       Substitute arguments
1382
    #           =TYPE=
1390
    #           =TYPE=
1383
    #           =LOG=
1391
    #           =LOG=
1384
    #           =DSW=
1392
    #           =DSW=
1385
    #
1393
    #
1386
    $buildcmd =~ s~=TYPE=~\$\(PROJECT_CMD)~g;
1394
    $buildcmd =~ s~=TYPE=~"\$(call project_target,$release,$debug)"~g;
1387
    $buildcmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1395
    $buildcmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1388
    $buildcmd =~ s~=DSW=~$solution~g;
1396
    $buildcmd =~ s~=DSW=~$solution~g;
1389
 
1397
 
1390
    $cleancmd =~ s~=TYPE=~\$\(PROJECT_CMD)~g;
1398
    $cleancmd =~ s~=TYPE=~"\$(call project_target,$release,$debug)"~g;
1391
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1399
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1392
    $cleancmd =~ s~=DSW=~$solution~g;
1400
    $cleancmd =~ s~=DSW=~$solution~g;
1393
    
1401
    
1394
    #
1402
    #
1395
    #   Generate the recipe to create the project
1403
    #   Generate the recipe to create the project
1396
    #   Use the set_WIN32.sh file to extend the DLL search path
1404
    #   Use the set_<PLATFORM>.sh file to extend the DLL search path
1397
    #
1405
    #
1398
    $io->Label( "Build project", $name );
1406
    $io->Label( "Build project", $name );
1399
    $io->PrtLn( "Project_$name: $solution \$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
1407
    $io->PrtLn( "Project_$name: $solution \$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
1400
 
1408
 
1401
    $io->PrtLn( "\t\$(XX_PRE)( \$(rm) -f $name\$(GBE_TYPE).log; \\" );
1409
    $io->PrtLn( "\t\$(XX_PRE)( \$(rm) -f $name\$(GBE_TYPE).log; \\" );