toolchain vars set in env while using --target= messes up
Brought to you by:
complement
if CXX/CC are set to the full name of the toolchain in the environment and --target= is used with a normal configure host, the gcc.mak will make a mess of things
consider a config.mak that does:
TARGET_OS := bfin-linux-uclibc
_FORCE_CC := bfin-linux-uclibc-gcc
the gcc.mak will then proceed to do:
ifndef _FORCE_CC
CC := gcc
else
CC := ${_FORCE_CC}
endif
ifdef TARGET_OS
CC := ${TARGET_OS}-${CC}
endif
and the build will quickly fail with something like:
make[4]: bfin-linux-uclibc-bfin-linux-uclibc-gcc: Command not found
if a variable has a forced value, then TARGET_OS should not get prefixed to it:
ifdef _FORCE_CC
CC := ${_FORCE_CC}
else
CC := gcc
ifdef TARGET_OS
CC := ${TARGET_OS}-${CC}
endif
endif
Use either --target= or $CXX/$CC. Cross-compilation scheme present here only for gcc. Option --target= assume cross-compilation.