From 735610940c0cac72343ca247eb3062b2e09512a0 Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 10 Mar 2021 11:42:34 +0800 Subject: [PATCH] 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+. --- depends/funcs.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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