diff options
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2014-08-04 19:39:55 +0100 |
---|---|---|
committer | Christopher Li <sparse@chrisli.org> | 2014-10-10 22:43:37 +0800 |
commit | d4029acb1036726aa83261bda14f31e9a55d7e59 (patch) | |
tree | 88c6a9c19d64e7aee53a2c7fb5826012192970a3 | |
parent | 85e2e2a25266ffd24f08f3a396e7ac57fb307fbc (diff) | |
download | sparse-d4029acb1036726aa83261bda14f31e9a55d7e59.tar.gz |
cgcc: use only the cc command to determine $gcc_base_dir
Capture the c-compiler command, in the $ccom variable, in order to
later invoke the compiler without extraneous command-line options.
In particular, use the $ccom variable in order to cleanly invoke the
compiler when setting the $gcc_base_dir variable.
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
-rwxr-xr-x | cgcc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3,6 +3,7 @@ my $cc = $ENV{'REAL_CC'} || 'cc'; my $check = $ENV{'CHECK'} || 'sparse'; +my $ccom = $cc; my $m32 = 0; my $m64 = 0; @@ -72,7 +73,7 @@ if ($do_check) { $check .= &add_specs ('host_os_specs'); } - $gcc_base_dir = qx($cc -print-file-name=) if !$gcc_base_dir; + $gcc_base_dir = qx($ccom -print-file-name=) if !$gcc_base_dir; chomp($gcc_base_dir); # possibly remove '\n' from compiler $check .= " -gcc-base-dir " . $gcc_base_dir if $gcc_base_dir; |