build: allow shell commands in `CC` and friends

When we added support for paths with spaces in the `CC`, `LD`, `AR`,
etc. variables in a previous patch, we explicitly broke support for
compiler launchers like `ccache`, which is usually used by prepending it
to `CC`, e.g. `CC='ccache gcc'`. This patch modifies the toolchain
detection logic to avoid sanitizing the toolchain variables for the
shell unless we are confident that they represent a path to the program
(i.e. that `which $(CC)` resolves to something).

Change-Id: I942d09cfc462d50ed07c5d22434b0275c22d1522
Signed-off-by: Chris Kay <chris.kay@arm.com>
1 file changed