build: Preserve all *_FOR_TARGET environment variables if already set.
Some of the *_FOR_TARGET environment variables (e.g. CC_FOR_TARGET) were
already preserved because they use the NCN_STRICT_CHECK_TARGET_TOOLS macro
directly. Other *_FOR_TARGET environment variables (e.g. AS_FOR_TARGET) use the
ACX_CHECK_INSTALLED_TARGET_TOOL macro, which falls back to
NCN_STRICT_CHECK_TARGET_TOOLS but overwrote the environment variable in some
cases before that. E.g. in the case `$build != $host`, the environment variable
was not preserved.
With this patch, each of the *_FOR_TARGET environment variables and their
unsuffixed (“for host”) correspondents are handled consistently in the sense
that a non-empty value takes precedence over:
- cached values
- values inferred by checking for a suitable program in PATH
- tools in the directory passed to --with-build-time-tools (applies only to *_FOR_TARGET)
Changelog
* configure: Regenerated.
config
* acx.m4 (ACX_CHECK_INSTALLED_TARGET_TOOL): Fix handling of
environment variables.
Signed-off-by: Manuel Jacob <me@manueljacob.de>
2 files changed