diff options
author | fanquake <fanquake@gmail.com> | 2021-03-10 11:42:34 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-03-31 17:05:52 +0800 |
commit | 735610940c0cac72343ca247eb3062b2e09512a0 (patch) | |
tree | b3e1e25af199d5cf4eee0f9f610188d79ea14ff8 /depends/funcs.mk | |
parent | b14462083f82aeaa9a376978f210db5538db296f (diff) |
build: set --build when configuring packages in depends
After reading
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.70/autoconf.html#Specifying-Target-Triplets,
my understanding is that this change should mostly be a no-op, as
--build defaults to the output of config.guess, however, this may be
slightly more correct
> For historical reasons, whenever you specify --host, be sure to
> specify --build too; this will be fixed in the future.
and will quell some warnings in depends (#16354). If anything, this
also explicitly enables cross-compilation mode when `--host` differs
from `--build`.
As for "fixed in the future", this is the case for Autoconf 2.70+.
Diffstat (limited to 'depends/funcs.mk')
-rw-r--r-- | depends/funcs.mk | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/depends/funcs.mk b/depends/funcs.mk index c0159f0e38..6e1a922f89 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -140,7 +140,13 @@ $(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake $(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) $(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) -$(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" + +# Setting a --build type that differs from --host will explicitly enable +# cross-compilation mode. Note that --build defaults to the output of +# config.guess, which is what we set it too here. This also quells autoconf +# warnings, "If you wanted to set the --build type, don't use --host.", +# when using versions older than 2.70. +$(1)_autoconf=./configure --build=$(BUILD) --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" ifneq ($($(1)_nm),) $(1)_autoconf += NM="$$($(1)_nm)" endif |