Subversion Repositories DevTools

Rev

Rev 7018 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7018 Rev 7547
Line 42... Line 42...
42
                           'buildcmd'   => 'devenv =DSW= /build "=TYPE=" /useenv /out =LOG=' ,
42
                           'buildcmd'   => 'devenv =DSW= /build "=TYPE=" /useenv /out =LOG=' ,
43
                           'cleancmd'   => 'devenv =DSW= /clean "=TYPE=" /useenv' ,
43
                           'cleancmd'   => 'devenv =DSW= /clean "=TYPE=" /useenv' ,
44
                           'tmp'        => 'vc70',
44
                           'tmp'        => 'vc70',
45
                           'VSCOMPILER' => '2',
45
                           'VSCOMPILER' => '2',
46
                           },
46
                           },
47
                           
-
 
-
 
47
 
48
        'MS.NET2005' =>  { 'def'        => 'vcwin32_net2005.def' ,
48
        'MS.NET2005' =>  { 'def'        => 'vcwin32_net2005.def' ,
49
                           'buildcmd'   => 'devenv =DSW= /build "=TYPE=" /useenv /out =LOG=' ,
49
                           'buildcmd'   => 'devenv =DSW= /build "=TYPE=" /useenv /out =LOG=' ,
50
                           'cleancmd'   => 'devenv =DSW= /clean "=TYPE=" /useenv' ,
50
                           'cleancmd'   => 'devenv =DSW= /clean "=TYPE=" /useenv' ,
51
                           'tmp'        => 'vc80',
51
                           'tmp'        => 'vc80',
52
                           'VSCOMPILER' => '3',
52
                           'VSCOMPILER' => '3',
Line 107... Line 107...
107
                         'Rules'      => 'vcwin64.rul',
107
                         'Rules'      => 'vcwin64.rul',
108
                         'NoKludges'  => 1,
108
                         'NoKludges'  => 1,
109
                       },
109
                       },
110
 
110
 
111
 
111
 
112
                           
-
 
-
 
112
 
113
    );
113
    );
114
 
114
 
115
 
115
 
116
##############################################################################
116
##############################################################################
117
#   ToolsetInit()
117
#   ToolsetInit()
Line 169... Line 169...
169
    #
169
    #
170
    #   Insert defaults
170
    #   Insert defaults
171
    #
171
    #
172
    $toolset_info->{'Machine'} = 'X86' unless defined  $toolset_info->{'Machine'};
172
    $toolset_info->{'Machine'} = 'X86' unless defined  $toolset_info->{'Machine'};
173
    $toolset_info->{'Rules'}   = 'vcwin32.rul' unless defined  $toolset_info->{'Rules'};
173
    $toolset_info->{'Rules'}   = 'vcwin32.rul' unless defined  $toolset_info->{'Rules'};
174
    
174
 
175
 
175
 
176
#.. Standard.rul requirements
176
#.. Standard.rul requirements
177
#
177
#
178
    $::s = 'asm';
178
    $::s = 'asm';
179
    $::o = 'obj';
179
    $::o = 'obj';
Line 185... Line 185...
185
#
185
#
186
    $::ScmToolsetVersion = "1.0.0";             # our version
186
    $::ScmToolsetVersion = "1.0.0";             # our version
187
    $::ScmToolsetGenerate = 0;                  # generate optional
187
    $::ScmToolsetGenerate = 0;                  # generate optional
188
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
188
    $::ScmToolsetProgDependancies = 0;          # handle Prog dependancies myself
189
    $::ScmToolsetProperties{'LdFlagSpace'} = 1; # LdFlags support embedded spaces
189
    $::ScmToolsetProperties{'LdFlagSpace'} = 1; # LdFlags support embedded spaces
190
                                                # 
190
                                                #
191
 
191
 
192
#.. define Visual C/C+ environment
192
#.. define Visual C/C+ environment
193
    Init( "visualc" );
193
    Init( "visualc" );
194
    ToolsetDefines( $toolset_info->{'def'} );
194
    ToolsetDefines( $toolset_info->{'def'} );
195
    PlatformDefine ("VSCOMPILER\t= $toolset_info->{'VSCOMPILER'}" );
195
    PlatformDefine ("VSCOMPILER\t= $toolset_info->{'VSCOMPILER'}" );
Line 300... Line 300...
300
    #
300
    #
301
    #   Attempt to fix bugs in Microsofts mspdbsrv in a multi-build environment
301
    #   Attempt to fix bugs in Microsofts mspdbsrv in a multi-build environment
302
    #   Export EnvVar _MSPDBSRV_ENDPOINT_ with a unique text string
302
    #   Export EnvVar _MSPDBSRV_ENDPOINT_ with a unique text string
303
    #   Thus instances of mspdbsrv started by the build will be able to find there
303
    #   Thus instances of mspdbsrv started by the build will be able to find there
304
    #   own instance.
304
    #   own instance.
305
    #   
305
    #
306
    #    _MSPDBSRV_ENDPOINT_ needs to be unique within the machine
306
    #    _MSPDBSRV_ENDPOINT_ needs to be unique within the machine
307
    #    Its not intended to be globally unique - just not to generate two 
307
    #    Its not intended to be globally unique - just not to generate two
308
    #    of them.
308
    #    of them.
309
    #   
309
    #
310
    MakePrint("
310
    MakePrint("
311
#
311
#
312
#   Define endpoint to instantiate seperate instances of mspdbsrv 
312
#   Define endpoint to instantiate seperate instances of mspdbsrv
313
#
313
#
314
_MSPDBSRV_ENDPOINT_ = $::ScmBuildUuid
314
_MSPDBSRV_ENDPOINT_ = $::ScmBuildUuid
315
export _MSPDBSRV_ENDPOINT_
315
export _MSPDBSRV_ENDPOINT_
316
");
316
");
317
 
317
 
Line 424... Line 424...
424
            $pdb_file = "\$(OBJDIR)/${pdb}\$(GBE_TYPE)_shlib.pdb";
424
            $pdb_file = "\$(OBJDIR)/${pdb}\$(GBE_TYPE)_shlib.pdb";
425
        }
425
        }
426
        else
426
        else
427
        {
427
        {
428
            $pdb_file = "\$(OBJDIR)/${pdb}\$(GBE_TYPE).pdb";
428
            $pdb_file = "\$(OBJDIR)/${pdb}\$(GBE_TYPE).pdb";
429
        }    
429
        }
430
 
430
 
431
        MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tPDB = $pdb_file\n" );
431
        MakePadded( 4, "\$(OBJDIR)/$obj.$::o:", "\tPDB = $pdb_file\n" );
432
        ToolsetGenerate( $pdb_file );
432
        ToolsetGenerate( $pdb_file );
433
        ToolsetGenerate( $pdb_file . ".tmp" );
433
        ToolsetGenerate( $pdb_file . ".tmp" );
434
    }
434
    }
Line 656... Line 656...
656
#       --Implib                        # Alternate ruleset
656
#       --Implib                        # Alternate ruleset
657
#       --NoPDB                         # Do not package the PDB file
657
#       --NoPDB                         # Do not package the PDB file
658
#       --NoImplib                      # Do not package the import library
658
#       --NoImplib                      # Do not package the import library
659
#       --Entry=xxxxx                   # Entry point
659
#       --Entry=xxxxx                   # Entry point
660
#       --NoAddLibs                     # Do not add libraries
660
#       --NoAddLibs                     # Do not add libraries
-
 
661
#       --Node                          # Node library for Electron
-
 
662
#                                         Fixed extension. No versioned dll, no .lib file
661
#
663
#
662
#   Output:
664
#   Output:
663
#
665
#
664
#       There is two supported rule sets differentiated by --Implib
666
#       There is two supported rule sets differentiated by --Implib
665
#       The two are very similar and generated exportable files of:
667
#       The two are very similar and generated exportable files of:
Line 734... Line 736...
734
{
736
{
735
    our( $name, $pArgs, $pObjs, $pLibs, $_ver ) = @_;
737
    our( $name, $pArgs, $pObjs, $pLibs, $_ver ) = @_;
736
    our( $def, $mutual_dll, $res, @reslist, $doimplib, $stub_only );
738
    our( $def, $mutual_dll, $res, @reslist, $doimplib, $stub_only );
737
    our( $no_implib, $no_pdb, $resource_only );
739
    our( $no_implib, $no_pdb, $resource_only );
738
    our( $entry, $noaddlibs );
740
    our( $entry, $noaddlibs );
-
 
741
    our( $isNodeFile );
739
 
742
 
740
#.. Parse arguments
743
#.. Parse arguments
741
#
744
#
742
    $def = "";                                  # options
745
    $def = "";                                  # options
743
    $doimplib = 0;
746
    $doimplib = 0;
744
    $res = "";
747
    $res = "";
745
    $no_pdb = $pdb_none;
748
    $no_pdb = $pdb_none;
-
 
749
    $isNodeFile = 0;
746
 
750
 
747
    foreach $_ ( @$pArgs ) {
751
    foreach $_ ( @$pArgs ) {
748
        if (/^--Def=(.*?)(\,(.*))?$/) {         # Library definition
752
        if (/^--Def=(.*?)(\,(.*))?$/) {         # Library definition
749
            #
753
            #
750
            #   Locate the Def file.
754
            #   Locate the Def file.
Line 787... Line 791...
787
        } elsif (/^--MutualDll$/) {
791
        } elsif (/^--MutualDll$/) {
788
            $mutual_dll = 1;
792
            $mutual_dll = 1;
789
 
793
 
790
        } elsif (/^--Stubonly/) {
794
        } elsif (/^--Stubonly/) {
791
            $stub_only = 1;
795
            $stub_only = 1;
-
 
796
 
-
 
797
        } elsif (/^--Node$/i) {
-
 
798
            $isNodeFile = 1;
-
 
799
 
792
        } else {                                # unknown
800
        } else {                                # unknown
793
            Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
801
            Message( "$toolset_name SHLD: unknown option $_ -- ignored\n" );
794
        }
802
        }
795
    }
803
    }
796
 
804
 
Line 800... Line 808...
800
    Error ("$toolset_name SHLD:Stubonly option requires --Def=file ")
808
    Error ("$toolset_name SHLD:Stubonly option requires --Def=file ")
801
        if ( $stub_only && ! $def );
809
        if ( $stub_only && ! $def );
802
 
810
 
803
    Error ("$toolset_name SHLD:MutualDll option requires --Def=file ")
811
    Error ("$toolset_name SHLD:MutualDll option requires --Def=file ")
804
        if ( $mutual_dll && ! $def );
812
        if ( $mutual_dll && ! $def );
805
        
813
 
806
 
814
 
807
 
815
 
808
#.. Build rules
816
#.. Build rules
809
#
817
#
810
#   base    -   Basic name of the DLL
818
#   base    -   Basic name of the DLL
Line 812... Line 820...
812
#   lib     -   Name of the DLL
820
#   lib     -   Name of the DLL
813
#
821
#
814
    sub BuildSHLD
822
    sub BuildSHLD
815
    {
823
    {
816
        my ($base, $name, $lib) = @_;
824
        my ($base, $name, $lib) = @_;
-
 
825
        my $ext = $isNodeFile ? '.node' : ".$::so"; 
817
        my $full = $lib.".$::so";
826
        my $full = $lib.$ext;
818
        my $link_with_def;
827
        my $link_with_def;
819
 
828
 
820
    #.. Cleanup rules
829
    #.. Cleanup rules
821
    #
830
    #
822
    #   ld      Linker command file
831
    #   ld      Linker command file
Line 857... Line 866...
857
            $io->Entry( "\$(LIBDIR)/${name}.${a}: \\\n\t\t\$(OBJDIR)/${base}",
866
            $io->Entry( "\$(LIBDIR)/${name}.${a}: \\\n\t\t\$(OBJDIR)/${base}",
858
                                            "", " \\\n\t\t", ".$::o", @$pObjs );
867
                                            "", " \\\n\t\t", ".$::o", @$pObjs );
859
            $io->Prt( " \\\n\t\t$def" );
868
            $io->Prt( " \\\n\t\t$def" );
860
            $io->Prt( "\n\t\t\$(AR)\n" );
869
            $io->Prt( "\n\t\t\$(AR)\n" );
861
            $io->Newline();
870
            $io->Newline();
862
            
871
 
863
            #
872
            #
864
            #   Files to be cleanup up
873
            #   Files to be cleanup up
865
            #
874
            #
866
            ToolsetGenerate( "\$(LIBDIR)/${name}.exp" );
875
            ToolsetGenerate( "\$(LIBDIR)/${name}.exp" );
867
            ToolsetGenerate( "\$(LIBDIR)/${name}.${a}" );
876
            ToolsetGenerate( "\$(LIBDIR)/${name}.${a}" );
Line 993... Line 1002...
993
        $io->Cmd( "\$(subst /,\\\\,$res)" )                 if ( $res );
1002
        $io->Cmd( "\$(subst /,\\\\,$res)" )                 if ( $res );
994
        $io->Cmd( "\$(subst /,\\\\,$export_file)" )         if ( $export_file );
1003
        $io->Cmd( "\$(subst /,\\\\,$export_file)" )         if ( $export_file );
995
 
1004
 
996
                                                # object list
1005
                                                # object list
997
        $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
1006
        $io->ObjList( $name, $pObjs, \&ToolsetObjRecipe );
998
            
1007
 
999
                                                # library list
1008
                                                # library list
1000
        $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
1009
        $io->LibList( $name, $pLibs, \&ToolsetLibRecipe );
1001
 
1010
 
1002
        $io->Newline();
1011
        $io->Newline();
1003
 
1012
 
Line 1009... Line 1018...
1009
        #       Create makefile directives to include the dependency
1018
        #       Create makefile directives to include the dependency
1010
        #       list into the makefile.
1019
        #       list into the makefile.
1011
        #
1020
        #
1012
        $io->DepRules( $pLibs, \&ToolsetLibRecipe, "\$(LIBDIR)/${full}" );
1021
        $io->DepRules( $pLibs, \&ToolsetLibRecipe, "\$(LIBDIR)/${full}" );
1013
        $io->SHLDDEPEND( $name, $lib );
1022
        $io->SHLDDEPEND( $name, $lib );
1014
    }
1023
    }   # End BuildSHLD
1015
 
1024
 
1016
    ToolsetLibStd( $pLibs )                    # push standard libraries
1025
    ToolsetLibStd( $pLibs )                    # push standard libraries
1017
        unless ( $noaddlibs );
1026
        unless ( $noaddlibs );
1018
 
1027
 
1019
    if ( $doimplib ) {
1028
    if ( $doimplib ) {
Line 1024... Line 1033...
1024
        #
1033
        #
1025
        $target_file_dll = "\$(LIBDIR)/$name\$(GBE_TYPE).$_ver.$::so";
1034
        $target_file_dll = "\$(LIBDIR)/$name\$(GBE_TYPE).$_ver.$::so";
1026
        BuildSHLD(
1035
        BuildSHLD(
1027
            "$name",                        # Base Name
1036
            "$name",                        # Base Name
1028
            "$name\$(GBE_TYPE)",            # Name of Export Lib
1037
            "$name\$(GBE_TYPE)",            # Name of Export Lib
1029
            "$name\$(GBE_TYPE).$_ver");      # Name of the DLL + PDB
1038
            "$name\$(GBE_TYPE).$_ver");     # Name of the DLL + PDB
-
 
1039
 
-
 
1040
    } elsif ($isNodeFile) {
-
 
1041
        #
-
 
1042
        #   A 'node' file is a specific shared library for Electron applications
-
 
1043
        #       They have a fixed file extension of .node on all platforms
-
 
1044
        #       Do not generate a Versioned DLL
-
 
1045
        #       Do not generate an export library
-
 
1046
        #   --Node flavor will create
-
 
1047
        #       a) Unversioned DLL $name$(GBE_TYPE).node
-
 
1048
        #   
-
 
1049
        $target_file_dll = "\$(LIBDIR)/$name\$(GBE_TYPE).node";
-
 
1050
        BuildSHLD( "$name", ""                  , "$name\$(GBE_TYPE)" )
1030
 
1051
 
1031
    } else {
1052
    } else {
1032
        #
1053
        #
1033
        #   Original flavor will create
1054
        #   Original flavor will create
1034
        #       a) Import library   $name$(GBE_TYPE).lib    ---+
1055
        #       a) Import library   $name$(GBE_TYPE).lib    ---+
Line 1304... Line 1325...
1304
}
1325
}
1305
 
1326
 
1306
 
1327
 
1307
########################################################################
1328
########################################################################
1308
#
1329
#
1309
#   Generate a linker object recipe.  This is a helper function used 
1330
#   Generate a linker object recipe.  This is a helper function used
1310
#   within this toolset.
1331
#   within this toolset.
1311
#
1332
#
1312
#   Arguments:
1333
#   Arguments:
1313
#       $io         I/O stream
1334
#       $io         I/O stream
1314
#
1335
#
Line 1463... Line 1484...
1463
        if ( m/^--TargetProd*=(.+)/ ) {
1484
        if ( m/^--TargetProd*=(.+)/ ) {
1464
            $release = $1;
1485
            $release = $1;
1465
 
1486
 
1466
        } elsif ( m/^--TargetDebug=(.+)/ ) {
1487
        } elsif ( m/^--TargetDebug=(.+)/ ) {
1467
            $debug = $1;
1488
            $debug = $1;
1468
            
1489
 
1469
        } else {
1490
        } else {
1470
            Message( "$toolset_name PROJECT: unknown option $_ -- ignored\n" );
1491
            Message( "$toolset_name PROJECT: unknown option $_ -- ignored\n" );
1471
        }
1492
        }
1472
    }
1493
    }
1473
 
1494
 
Line 1495... Line 1516...
1495
    $buildcmd =~ s~=DSW=~$solution~g;
1516
    $buildcmd =~ s~=DSW=~$solution~g;
1496
 
1517
 
1497
    $cleancmd =~ s~=TYPE=~\$(call project_target,$release,$debug)~g;
1518
    $cleancmd =~ s~=TYPE=~\$(call project_target,$release,$debug)~g;
1498
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1519
    $cleancmd =~ s~=LOG=~$name\$(GBE_TYPE).log~g;
1499
    $cleancmd =~ s~=DSW=~$solution~g;
1520
    $cleancmd =~ s~=DSW=~$solution~g;
1500
    
1521
 
1501
    #
1522
    #
1502
    #   Generate the recipe to create the project
1523
    #   Generate the recipe to create the project
1503
    #   Use the set_<PLATFORM>.sh file to extend the DLL search path
1524
    #   Use the set_<PLATFORM>.sh file to extend the DLL search path
1504
    #
1525
    #
1505
    $io->Label( "Build project", $name );
1526
    $io->Label( "Build project", $name );