Subversion Repositories DevTools

Rev

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

Rev 4700 Rev 4701
Line 125... Line 125...
125
my %NativeCompilers = (
125
my %NativeCompilers = (
126
    'Linux i386'       => 'linux_i386',
126
    'Linux i386'       => 'linux_i386',
127
    );
127
    );
128
 
128
 
129
my $UseGcov = 0;
129
my $UseGcov = 0;
-
 
130
my $UseCppcheck = 0;
130
 
131
 
131
##############################################################################
132
##############################################################################
132
#   ToolsetInit()
133
#   ToolsetInit()
133
#       Runtime initialisation
134
#       Runtime initialisation
134
#
135
#
Line 169... Line 170...
169
            $arg_alias = $1;
170
            $arg_alias = $1;
170
 
171
 
171
        } elsif (/^--UseGcov/) {                # Compile for code coverage
172
        } elsif (/^--UseGcov/) {                # Compile for code coverage
172
            $UseGcov = 1;
173
            $UseGcov = 1;
173
 
174
 
-
 
175
        } elsif (/^--UseCppcheck/) {            # Use cppcheck as the lint tool
-
 
176
            $UseCppcheck = 1;
-
 
177
 
174
        } elsif (/^--CompilerTool=(.*)/) {      # CrossCompiler located in package
178
        } elsif (/^--CompilerTool=(.*)/) {      # CrossCompiler located in package
175
            $compiler_tool = $1;
179
            $compiler_tool = $1;
176
 
180
 
177
        } else {
181
        } else {
178
            Message( "gcc toolset: unknown option $_ -- ignored\n" );
182
            Message( "gcc toolset: unknown option $_ -- ignored\n" );
Line 341... Line 345...
341
    if ( $UseGcov )
345
    if ( $UseGcov )
342
    {
346
    {
343
        $GCCFlags=$GCCFlags . ' -coverage';
347
        $GCCFlags=$GCCFlags . ' -coverage';
344
        $LDFlags=$LDFlags . ' -coverage';
348
        $LDFlags=$LDFlags . ' -coverage';
345
    }
349
    }
-
 
350
    
-
 
351
    #
-
 
352
    #   When running with cppcheck we need to include it in our environment
-
 
353
    #
-
 
354
    if ( $UseCppcheck )
-
 
355
    {
-
 
356
        ToolsetRequire( "cppcheck" );
-
 
357
        PlatformDefine( "CPPCHECK_PLATFORM := unix32" );
-
 
358
        PlatformDefine( "CPPCHECK_DEFINES := -U_MSC_VER -U_MOS_ -U_WIN32_WCE -U_WIN32_WINNT -U_SUPRO_C -U__SUNPRO_CC" );
-
 
359
    }
346
        
360
        
347
 
361
 
348
#.. Define GCC environment
362
#.. Define GCC environment
349
#
363
#
350
    PlatformDefine( "
364
    PlatformDefine( "
Line 932... Line 946...
932
sub ToolsetPreprocessTests
946
sub ToolsetPreprocessTests
933
{
947
{
934
    my ($io) = ToolsetPrinter::New();
948
    my ($io) = ToolsetPrinter::New();
935
    if ( $UseGcov && scalar(keys %::OBJSOURCE) > 0 )
949
    if ( $UseGcov && scalar(keys %::OBJSOURCE) > 0 )
936
    {
950
    {
-
 
951
        my $finaldir='$(LOCALDIR)/lcov/$(GBE_PLATFORM)$(GBE_TYPE)';
-
 
952
        my $final=$finaldir . '/lcov-final.info';
-
 
953
 
937
        my $key;
954
        my $key;
938
        my $value;
955
        my $value;
939
        while(($key, $value) = each(%::OBJSOURCE))
956
        while(($key, $value) = each(%::OBJSOURCE))
940
        {
957
        {
941
            Verbose("$key ==> $value");
958
            Verbose("$key ==> $value");
942
            $io->Prt("\t" . '$(XX_PRE)rm -f $(OBJDIR)/' . $key . ".gcda\n");
959
            $io->Prt("\t" . '$(XX_PRE)rm -f $(OBJDIR)/' . $key . ".gcda\n");
943
        }
960
        }
-
 
961
        $io->Prt("\t" . '${XX_PRE}$(rm) -f ' . $final . "\n");
944
        $io->Prt("\t" . '${XX_PRE}lcov'
962
        $io->Prt("\t" . '${XX_PRE}lcov'
945
                      . ' --capture'
963
                      . ' --capture'
946
                      . ' --initial'
964
                      . ' --initial'
947
                      . ' --base-directory ' . $::Cwd
965
                      . ' --base-directory ' . $::Cwd
948
                      . ' --directory $(OBJDIR)'
966
                      . ' --directory $(OBJDIR)'
Line 1049... Line 1067...
1049
                      . ' ' . $final
1067
                      . ' ' . $final
1050
                      . "\n");
1068
                      . "\n");
1051
    }
1069
    }
1052
}
1070
}
1053
 
1071
 
-
 
1072
 
-
 
1073
###############################################################################
-
 
1074
#   ToolsetARLINT( $name, \@args, \@objs )
-
 
1075
#       This subroutine takes the user options and builds the rules
-
 
1076
#       required to lint the static library 'name'.
-
 
1077
#
-
 
1078
#   Arguments:
-
 
1079
#       --xxx                   No arguments currently defined
-
 
1080
#
-
 
1081
#   Output:
-
 
1082
#       [ $(LIBDIR)/name$_lint:   .... ]
-
 
1083
#           $(ARLINT)
-
 
1084
#
-
 
1085
###############################################################################
-
 
1086
 
-
 
1087
sub ToolsetARLINT
-
 
1088
{
-
 
1089
    if ( $UseCppcheck )
-
 
1090
    {
-
 
1091
        CppcheckAR( @_ );
-
 
1092
    }
-
 
1093
}
-
 
1094
 
-
 
1095
 
-
 
1096
###############################################################################
-
 
1097
#   ToolsetSHLDLINT $name, \@args, \@objs, \@libraries )
-
 
1098
#       This subroutine takes the user options and builds the rules
-
 
1099
#       required to lint the shared library 'name'.
-
 
1100
#
-
 
1101
#   Arguments:
-
 
1102
#       (none)
-
 
1103
#
-
 
1104
#   Output:
-
 
1105
#       [ $(LIBDIR)/$name_lint:   .... ]
-
 
1106
#           $(SHLIBLINT)
-
 
1107
#
-
 
1108
###############################################################################
-
 
1109
 
-
 
1110
sub ToolsetSHLDLINT
-
 
1111
{
-
 
1112
    if ( $UseCppcheck )
-
 
1113
    {
-
 
1114
        CppcheckSHLD( @_ );
-
 
1115
    }
-
 
1116
}
-
 
1117
 
-
 
1118
 
-
 
1119
###############################################################################
-
 
1120
#   ToolsetLD( $name, \@args, \@objs, \@libraries, \@csrc, \@cxxsrc )
-
 
1121
#       This subroutine takes the user options and builds the rules
-
 
1122
#       required to lint the program 'name'.
-
 
1123
#
-
 
1124
#   Arguments:
-
 
1125
#       (none)
-
 
1126
#
-
 
1127
#   Output:
-
 
1128
#       [ $(BINDIR)/$name_lint:   .... ]
-
 
1129
#           $(LDLINT)
-
 
1130
#
-
 
1131
###############################################################################
-
 
1132
 
-
 
1133
sub ToolsetLDLINT
-
 
1134
{
-
 
1135
    if ( $UseCppcheck )
-
 
1136
    {
-
 
1137
        CppcheckLD( @_ );
-
 
1138
    }
-
 
1139
}
-
 
1140
 
1054
########################################################################
1141
########################################################################
1055
#
1142
#
1056
#   Push standard "system" libraries. This is a helper function
1143
#   Push standard "system" libraries. This is a helper function
1057
#   used within this toolset.
1144
#   used within this toolset.
1058
#
1145
#