Subversion Repositories DevTools

Rev

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

Rev 227 Rev 255
Line 15... Line 15...
15
#
15
#
16
#   Global data
16
#   Global data
17
#
17
#
18
our $ScmExpert;
18
our $ScmExpert;
19
 
19
 
20
my $toolset_version = "1.1";
-
 
21
my %resource_files;
20
my %resource_files;
22
my $pdb_none;
21
my $pdb_none;
23
 
22
 
-
 
23
my $toolset_info;
-
 
24
my $toolset_version = '1.1';
-
 
25
my %ToolsetVersion =
-
 
26
    (
-
 
27
    '1.1' => { 'def'      => 'CSHARP.DEF',              # Def file to use
-
 
28
               'pragma'   => 0,                         # True: Compiler supports #pragma
-
 
29
               'warnings' => '',                        # Comma sep list of warnings to ignore
-
 
30
             },
-
 
31
 
-
 
32
    '2.0' => { 'def'      => 'CSHARP2005.DEF',
-
 
33
               'pragma'   => 1,
-
 
34
               'warnings' => '1668',
-
 
35
             },
-
 
36
    );
-
 
37
 
-
 
38
 
24
##############################################################################
39
##############################################################################
25
#   ToolsetInit()
40
#   ToolsetInit()
26
#       Runtime initialisation
41
#       Runtime initialisation
27
#
42
#
28
##############################################################################
43
##############################################################################
Line 58... Line 73...
58
        } else {
73
        } else {
59
            Message( "csharp toolset: unknown platform argument $_ -- ignored\n" );
74
            Message( "csharp toolset: unknown platform argument $_ -- ignored\n" );
60
        }
75
        }
61
    }
76
    }
62
 
77
 
-
 
78
    #.. Validate SDK version
-
 
79
    #   Currently supported versions are described in a HASH
63
    #
80
    #
64
    #   Sanity Test
-
 
65
    #
-
 
66
    if ( $toolset_version ne '1.1' )
81
    $toolset_info = $ToolsetVersion{$toolset_version};
67
    {
-
 
68
        Error ("csharp toolset: Only version 1.1 of the framework is supported");
82
    Error( "csharp toolset: Unknown version: $toolset_version" ) unless ( defined $toolset_info );
69
    }
83
    
70
 
-
 
71
    #.. Standard.rul requirements
84
    #.. Standard.rul requirements
72
    #
85
    #
73
    $::s    = undef;
86
    $::s    = undef;
74
    $::o    = '';
87
    $::o    = '';
75
    $::a    = 'netmodule';
88
    $::a    = 'netmodule';
Line 88... Line 101...
88
            '.dtd'      => '--Dtd=',            # Will be passed with prefix
101
            '.dtd'      => '--Dtd=',            # Will be passed with prefix
89
            );
102
            );
90
 
103
 
91
    #.. define Visual C/C+ environment
104
    #.. define Visual C/C+ environment
92
    Init( "csharp" );
105
    Init( "csharp" );
93
    ToolsetDefines( "csharp.def" );
106
    ToolsetDefines( $toolset_info->{'def'} );
94
    ToolsetRules( "csharp.rul" );
107
    ToolsetRules( "csharp.rul" );
95
#    ToolsetRules( "standard.rul" );
108
#    ToolsetRules( "standard.rul" );
96
 
109
 
97
 
110
 
98
    #.. Extend the CompilerOption directive
111
    #.. Extend the CompilerOption directive
Line 118... Line 131...
118
 
131
 
119
    #
132
    #
120
    #   Set default options
133
    #   Set default options
121
    #
134
    #
122
    $::ScmCompilerOpts{'ADDLINKLIBS'} = '1';
135
    $::ScmCompilerOpts{'ADDLINKLIBS'} = '1';
123
    $::ScmCompilerOpts{'NOWARNLIST'} = '';
136
    $::ScmCompilerOpts{'NOWARNLIST'} = $toolset_info->{'warnings'};
124
    $::ScmCompilerOpts{'LDSUBSYSTEM'} = 'winexe';
137
    $::ScmCompilerOpts{'LDSUBSYSTEM'} = 'winexe';
125
}
138
}
126
 
139
 
127
 
140
 
128
#-------------------------------------------------------------------------------
141
#-------------------------------------------------------------------------------
129
# Function        : NoWarns
142
# Function        : NoWarns
130
#
143
#
131
# Description     : ScmToolsetCompilerOptions  extension function
144
# Description     : ScmToolsetCompilerOptions  extension function
132
#                   Accumulates the NoWarn options
145
#                   Accumulates the NoWarn options as a comma seperated list
133
#
146
#
134
# Inputs          : $key        - Name of the Option
147
# Inputs          : $key        - Name of the Option
135
#                   $value      - Option Value. Comma sep list of numbers
148
#                   $value      - Option Value. Comma sep list of numbers
-
 
149
#                   $ukey       - User key (within $::ScmCompilerOpts)
136
#
150
#
137
# Returns         : New sting to save
151
# Returns         : New sting to save
138
#
152
#
139
my @NoWarnList;
-
 
140
sub NoWarns
153
sub NoWarns
141
{
154
{
142
    my ($key, $value) = @_;
155
    my ($key, $value, $ukey) = @_;
-
 
156
    my @NoWarnList =  split (',', $::ScmCompilerOpts{$ukey});
143
    UniquePush \@NoWarnList, split (',', $value);
157
    UniquePush \@NoWarnList, split (',', $value);
144
    return join ',', @NoWarnList;
158
    return join ',', @NoWarnList;
145
}
159
}
146
 
160
 
147
##############################################################################
161
##############################################################################
Line 361... Line 375...
361
 
375
 
362
    my $ms_snk = $snk;
376
    my $ms_snk = $snk;
363
 
377
 
364
    $io->Label( "SNK Wrapper file content", $tag );    # label
378
    $io->Label( "SNK Wrapper file content", $tag );    # label
365
    $io->SetTag( $tag );                                # macro tag
379
    $io->SetTag( $tag );                                # macro tag
-
 
380
    $io->Cmd( '// This is JATS GENERATED FILE' );
-
 
381
    $io->Cmd( '//    Do not edit' );
-
 
382
    $io->Cmd( '//    Do not version control' );
-
 
383
 
366
    $io->Cmd( 'using System.Reflection;' );
384
    $io->Cmd( 'using System.Reflection;' );
367
    $io->Cmd( 'using System.Runtime.CompilerServices;' );
385
    $io->Cmd( 'using System.Runtime.CompilerServices;' );
368
 
386
 
369
    $io->Cmd( '//' );
387
    $io->Cmd( '//' );
370
    $io->Cmd( '// In order to sign your assembly you must specify a key to use. Refer to the' );
388
    $io->Cmd( '// In order to sign your assembly you must specify a key to use. Refer to the' );
Line 391... Line 409...
391
    $io->Cmd( '//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework' );
409
    $io->Cmd( '//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework' );
392
    $io->Cmd( '//       documentation for more information on this.' );
410
    $io->Cmd( '//       documentation for more information on this.' );
393
    $io->Cmd( '//' );
411
    $io->Cmd( '//' );
394
 
412
 
395
    $io->Cmd( '[assembly: AssemblyDelaySign(false)]' );
413
    $io->Cmd( '[assembly: AssemblyDelaySign(false)]' );
-
 
414
    $io->Cmd( '#pragma warning disable 1699' ) if ($toolset_info->{'pragma'});
396
    $io->Cmd( '[assembly: AssemblyKeyFile(@"'. $snk  .'")]' );
415
    $io->Cmd( '[assembly: AssemblyKeyFile(@"'. $snk  .'")]' );
-
 
416
    $io->Cmd( '#pragma warning restore 1699' ) if ($toolset_info->{'pragma'});
397
    $io->Cmd( '[assembly: AssemblyKeyName("")]' );
417
    $io->Cmd( '[assembly: AssemblyKeyName("")]' );
398
    $io->Newline();
418
    $io->Newline();
399
 
419
 
400
    #
420
    #
401
    #   Return the path to where the file will be created
421
    #   Return the path to where the file will be created
Line 522... Line 542...
522
 
542
 
523
        my $me = MakeEntry::New (*MAKEFILE, $exe_name, '--Phony' );
543
        my $me = MakeEntry::New (*MAKEFILE, $exe_name, '--Phony' );
524
        $me->AddComment ("Build Program: $name as a DLL" );
544
        $me->AddComment ("Build Program: $name as a DLL" );
525
        $me->AddDependancy ( $dll_name );
545
        $me->AddDependancy ( $dll_name );
526
        $me->Print();
546
        $me->Print();
-
 
547
 
-
 
548
        #
-
 
549
        #   Need to specifically clean this up, since we have fiddled with the
-
 
550
        #   name of the generated file
-
 
551
        #
-
 
552
        ToolsetGenerate( $dll_name );
527
    }
553
    }
528
 
554
 
529
    #
555
    #
530
    #   Create Rules and Recipes to convert the .resx files to .resource files
556
    #   Create Rules and Recipes to convert the .resx files to .resource files
531
    #
557
    #
Line 861... Line 887...
861
 
887
 
862
    if ( !defined($dp) ) {                      # linker
888
    if ( !defined($dp) ) {                      # linker
863
        $io->Cmd( "/reference:\$(subst /,\\\\,\$(strip $lib)).$::so" );
889
        $io->Cmd( "/reference:\$(subst /,\\\\,\$(strip $lib)).$::so" );
864
 
890
 
865
    } else {                                    # depend
891
    } else {                                    # depend
866
        $io->Cmd( "$dp:\t@(vglob2,$lib.$::so,LIB)" );
892
        $io->Cmd( "$dp:\t@(vglob2,$lib.$::so,CS_LIB)" );
867
    }
893
    }
868
}
894
}
869
 
895
 
870
########################################################################
896
########################################################################
871
#
897
#
Line 930... Line 956...
930
    $io->Label( "Build project", $name );
956
    $io->Label( "Build project", $name );
931
    $io->PrtLn( "Project_$name: $solution \$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
957
    $io->PrtLn( "Project_$name: $solution \$(INTERFACEDIR)/set_$::ScmPlatform.sh" );
932
 
958
 
933
    $io->PrtLn( "\t\$(XX_PRE)( \$(rm) -f $name\$(GBE_TYPE).log; \\" );
959
    $io->PrtLn( "\t\$(XX_PRE)( \$(rm) -f $name\$(GBE_TYPE).log; \\" );
934
    $io->PrtLn( "\t. \$(INTERFACEDIR)/set_$::ScmPlatform.sh; \\" );
960
    $io->PrtLn( "\t. \$(INTERFACEDIR)/set_$::ScmPlatform.sh; \\" );
-
 
961
    $io->PrtLn( "\t\$(show_environment); \\" );
935
    $io->PrtLn( "\t$buildcmd; \\" );
962
    $io->PrtLn( "\t$buildcmd; \\" );
936
    $io->PrtLn( "\tret=\$\$?; \\" );
963
    $io->PrtLn( "\tret=\$\$?; \\" );
937
    $io->PrtLn( "\t\$(GBE_BIN)/cat $name\$(GBE_TYPE).log; \\" );
964
    $io->PrtLn( "\t\$(GBE_BIN)/cat $name\$(GBE_TYPE).log; \\" );
938
    $io->PrtLn( "\texit \$\$ret )" );
965
    $io->PrtLn( "\texit \$\$ret )" );
939
    $io->Newline();
966
    $io->Newline();