buildgcc: Allow environment to override $CC/$CXX

Also check for the presence of the given commands or "gcc", "cc" in this
order if $CC is empty. To untangle the given compilers from boostrapped
ones, introduce hostcc() and hostcxx() functions that return the respec-
tive compilers to be used.

Change-Id: Ic947be53eec25331173ac82ed742017ca3fbf83c
Signed-off-by: Nico Huber <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Paul Menzel <>
Reviewed-by: Philippe Mathieu-Daudé <>
Reviewed-by: Stefan Reinauer <>
1 file changed