aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/ccc-analyzer4
-rwxr-xr-xutils/scan-build22
2 files changed, 25 insertions, 1 deletions
diff --git a/utils/ccc-analyzer b/utils/ccc-analyzer
index d41978c01f..c760a864fd 100755
--- a/utils/ccc-analyzer
+++ b/utils/ccc-analyzer
@@ -184,7 +184,9 @@ my $Lang;
my $Output;
# Forward arguments to gcc.
-my $Status = system("gcc",@ARGV);
+my $CC = $ENV{'CCC_CC'};
+if (!defined $CC) { $CC = "gcc"; }
+my $Status = system($CC,@ARGV);
if ($Status) { exit($Status); }
# Get the analysis options.
diff --git a/utils/scan-build b/utils/scan-build
index 44c2db3f0d..d04c2897e9 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -719,6 +719,10 @@ OPTIONS:
exit status of $Prog to be 1 if it found potential bugs
and 0 otherwise.
+ --use-cc [compiler path] - By default, $Prog uses 'gcc' to compile
+ --use-cc=[compiler path] your code. This option specifies what compiler
+ to use for regular code compilation.
+
-v - Verbose output from $Prog and the analyzer.
A second and third "-v" increases verbosity.
@@ -811,6 +815,24 @@ while (@ARGV) {
next;
}
+ if ($arg =~ /^--use-cc(=(.+))?$/) {
+ shift @ARGV;
+ my $cc;
+
+ if ($2 eq "") {
+ if (!@ARGV) {
+ DieDiag("'--use-cc' option requires a compiler executable name.\n");
+ }
+ $cc = shift @ARGV;
+ }
+ else {
+ $cc = $2;
+ }
+
+ $ENV{"CCC_CC"} = $cc;
+ next;
+ }
+
if ($arg eq "-v") {
shift @ARGV;
$Verbose++;