build.sh: Fix the behavior of specifying CC

Update the behavior of specifying CC.
The following cases are covered:
- CC == gcc: special case in which we fall back to the default
    triplet defined by CROSS_COMPILE;
- CC == XXX != gcc != "": force the use of the specified XXX compiler;
- CC defined both in env and in BUILD_CONFIG: env has higher priority
    than BUILD_CONFIG.

This patch solves this unexpected behavior of having the CC value
specified in the environment overwritten by the one defined in
BUILD_CONFIG, preserving the behavior of the other cases.

Test: manual build
Change-Id: I1193d15bb810f4e7989f58381f742f7cab23c6c2
Signed-off-by: Alessio Balsini <balsini@google.com>
1 file changed