build.sh: use a gcc with target triplet from PATH if CC=gcc is set

The motivation of this change is to be able to use the gcc version from
PATH (e.g. the bundled prebuilt) even in case CC=clang has been set
as default by the build.config:

-- Build with Clang from $PATH
$ ./build/build.sh

-- Build with GCC from $PATH
$ CC=gcc ./build/build.sh

In case of build/build.sh, $PATH is usually setup for a prebuilt
cross-compiler toolchain.
In order to accomodate any cross compiler settings when falling back to
gcc, simply unset CC to let kbuild figure out the correct compiler from
PATH.

It appears a bit hacky, but only breaks backward compatibility for the
case that somebody uses CC=gcc and expects the gcc from PATH to be used.
That case is still supported by passing an absolute path.

Change-Id: I537192168a27bdda9b288443de88ed45d7c4ec68
Signed-off-by: Matthias Maennich <maennich@google.com>
1 file changed