diff --git a/make/rules-common.mk b/make/rules-common.mk index 7c4763e9..fa71f3f1 100644 --- a/make/rules-common.mk +++ b/make/rules-common.mk @@ -127,13 +127,7 @@ $(2)_$(3)_ENV = \ LDFLAGS="$$($(2)_$(3)_LIBFLAGS) $$($(2)_$(3)_LDFLAGS) $$($(2)_LDFLAGS) $$($(4)LDFLAGS)" \ SOURCE_DATE_EPOCH="$$($(2)_$(3)_SOURCE_DATE_EPOCH)" \ -ifneq ($(4),CROSS) - -# CROSS-prefixed variables for non-CROSS builds which may need to cross -# compile some binaries. -# -# This is for instance used by Wine, but also Meson, as it requires the -# environment variable to ones for native. +ifeq ($(1),wine) $(2)_$(3)_ENV += \ CROSSAR="$$(CROSS$(3)_TARGET)-ar" \ diff --git a/make/rules-meson.mk b/make/rules-meson.mk index 02e242a7..8e1baa23 100644 --- a/make/rules-meson.mk +++ b/make/rules-meson.mk @@ -5,17 +5,15 @@ # $(4): CROSS/, cross compile # define create-rules-meson -# Don't pass CROSS here, we need a native environment and we'll handle -# cross compilation below with the CROSS-prefixed variables. -$(call create-rules-common,$(1),$(2),$(3)) +$(call create-rules-common,$(1),$(2),$(3),$(4)) define $(2)_$(3)_MESON_CROSS cat <&2 rm -rf "$$($(2)_$(3)_OBJ)/meson-private/coredata.dat" - echo "$$$$$(2)_$(3)_MESON_CROSS" | env $$($(2)_$(3)_ENV) sh >"$$($(2)_$(3)_OBJ)/$(3)-cross.txt" + echo "$$$$$(2)_$(3)_MESON_CROSS" | env $$($(2)_$(3)_ENV) sh >"$$($(2)_$(3)_OBJ)/cross.txt" env $$($(2)_$(3)_ENV) \ meson "$$($(2)_$(3)_OBJ)" "$$($(2)_SRC)" \ --prefix="$$($(2)_$(3)_DST)" \ --libdir="lib/$$($(4)$(3)_LIBDIR)" \ --buildtype=plain \ - $(if $(4),--cross-file="$$($(2)_$(3)_OBJ)/$(3)-cross.txt",) \ + --cross-file=$$($(2)_$(3)_OBJ)/cross.txt \ $$($(3)_MESON_ARGS) \ $$($(2)_MESON_ARGS) \ $$($(2)_$(3)_MESON_ARGS) \ @@ -66,7 +64,12 @@ $$(OBJ)/.$(1)-$(3)-build: touch $$@ endef -32_MESON_CPU = x86 -64_MESON_CPU = x86_64 +32_MESON_CPU := x86 +64_MESON_CPU := x86_64 + +32_MESON_SYSTEM := linux +64_MESON_SYSTEM := linux +CROSS32_MESON_SYSTEM := windows +CROSS64_MESON_SYSTEM := windows rules-meson = $(call create-rules-meson,$(1),$(call toupper,$(1)),$(2),$(3))