make: Use the host architecture for build time tools.

This commit is contained in:
Rémi Bernon 2025-01-12 21:29:47 +01:00 committed by Arkadiusz Hiler
parent 99660553f4
commit 6990bd8e88
2 changed files with 9 additions and 5 deletions

View File

@ -181,6 +181,7 @@ GST_BASE_MESON_ARGS := \
--wrap-mode nodownload \
GST_BASE_DEPENDS = gst_orc graphene gstreamer
GST_BASE_HOST_DEPENDS = gst_orc
$(eval $(call rules-source,gst_base,$(SRCDIR)/gstreamer/subprojects/gst-plugins-base))
$(eval $(call rules-meson,gst_base,i386,unix))
@ -212,6 +213,7 @@ GST_GOOD_MESON_ARGS := \
-Dorc=enabled
GST_GOOD_DEPENDS = gst_orc gstreamer gst_base
GST_GOOD_HOST_DEPENDS = gst_orc
$(eval $(call rules-source,gst_good,$(SRCDIR)/gstreamer/subprojects/gst-plugins-good/))
$(eval $(call rules-meson,gst_good,i386,unix))
@ -514,7 +516,7 @@ DXVK_SOURCE_ARGS = \
DXVK_i386_MESON_ARGS = --bindir=$(DXVK_i386_DST)/lib/wine/dxvk/i386-windows
DXVK_x86_64_MESON_ARGS = --bindir=$(DXVK_x86_64_DST)/lib/wine/dxvk/x86_64-windows
DXVK_DEPENDS = glslang
DXVK_HOST_DEPENDS = glslang
$(eval $(call rules-source,dxvk,$(SRCDIR)/dxvk))
$(eval $(call rules-meson,dxvk,i386,windows))
@ -611,7 +613,7 @@ VKD3D_PROTON_SOURCE_ARGS = \
VKD3D_PROTON_i386_MESON_ARGS = --bindir=$(VKD3D_PROTON_i386_DST)/lib/wine/vkd3d-proton/i386-windows
VKD3D_PROTON_x86_64_MESON_ARGS = --bindir=$(VKD3D_PROTON_x86_64_DST)/lib/wine/vkd3d-proton/x86_64-windows
VKD3D_PROTON_DEPENDS = glslang
VKD3D_PROTON_HOST_DEPENDS = glslang
ifneq ($(UNSTRIPPED_BUILD),)
VKD3D_PROTON_MESON_ARGS = -Denable_trace=true

View File

@ -7,6 +7,7 @@ define create-rules-common
$(2)_$(3)_OBJ := $$(OBJ)/obj-$(1)-$(3)
$(2)_$(3)_DST := $$(OBJ)/dst-$(1)-$(3)
$(2)_$(3)_DEPS := $$(call toupper,$$($(2)_DEPENDS)) $$(call toupper,$$($(2)_$(3)_DEPENDS))
$(2)_$(3)_HOST_DEPS := $$(call toupper,$$($(2)_HOST_DEPENDS))
$(2)_$(3)_BINDIR ?= $$($(2)_$(3)_DST)/bin
$(2)_$(3)_LIBDIR ?= $$($(2)_$(3)_DST)/lib
@ -15,6 +16,7 @@ $(2)_$(3)_INCDIR ?= $$($(2)_$(3)_DST)/include
$$(OBJ)/.$(1)-$(3)-configure: $$(shell mkdir -p $$($(2)_$(3)_OBJ))
$$(OBJ)/.$(1)-$(3)-configure: CCACHE_BASEDIR = $$($(2)_SRC)
$$(OBJ)/.$(1)-$(3)-configure: $$(patsubst %,%-$(3)-build,$$($(2)_DEPENDS) $$($(2)_$(3)_DEPENDS))
$$(OBJ)/.$(1)-$(3)-configure: $$(patsubst %,%-$$(HOST_ARCH)-build,$$($(2)_HOST_DEPENDS))
$$(OBJ)/.$(1)-$(3)-configure: | $$(OBJ)/.$(1)-post-source
$(1)-$(3)-configure: $$(OBJ)/.$(1)-$(3)-configure
@ -126,9 +128,9 @@ $(2)_$(3)_ENV = \
LD="$$($(3)-$(4)_TARGET)-ld" \
RC="$$($(3)-windows_TARGET)-windres" \
WIDL="$$($(3)-windows_TARGET)-widl" \
PKG_CONFIG="$$($(3)-unix_TARGET)-pkg-config" \
PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_BINDIR)),,:):$$$$PATH" \
LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)),,:)$$$$LD_LIBRARY_PATH" \
PKG_CONFIG="$$($$(HOST_ARCH)-unix_TARGET)-pkg-config" \
PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_HOST_DEPS),$$($$(d)_$$(HOST_ARCH)_BINDIR)),,:):$$$$PATH" \
LD_LIBRARY_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_HOST_DEPS),$$($$(d)_$$(HOST_ARCH)_LIBDIR)/$$($$(HOST_ARCH)-unix_LIBDIR)),,:)$$$$LD_LIBRARY_PATH" \
PKG_CONFIG_PATH="$$(call list-join,:,$$(foreach d,$$($(2)_$(3)_DEPS),$$($$(d)_$(3)_LIBDIR)/$$($(3)-$(4)_LIBDIR)/pkgconfig))" \
PKG_CONFIG_LIBDIR="/usr/lib/$$($(3)-$(4)_LIBDIR)/pkgconfig:/usr/share/pkgconfig" \
CFLAGS="$$($(2)_$(3)_INCFLAGS) $$($(2)_CFLAGS) $$($(3)_CFLAGS) $$(CFLAGS)" \