meson: fix arch mapping 12870/head
authorRosen Penev <rosenp@gmail.com>
Sat, 18 Jul 2020 20:17:39 +0000 (13:17 -0700)
committerRosen Penev <rosenp@gmail.com>
Sat, 18 Jul 2020 22:31:37 +0000 (15:31 -0700)
meson uses a different architecture mapping than CONFIG_ARCH does.

Fix the problematic ones and fall back to CONFIG_ARCH.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
devel/meson/Makefile
devel/meson/meson.mk

index e83aef19f0e0d4bce2feb71ee706730b2effbbb5..7b09227e6f17edbd35e89e30cb02842c45849ac7 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=meson
 PKG_VERSION:=0.54.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PYPI_NAME:=meson
 PKG_HASH:=f2bdf4cf0694e696b48261cdd14380fb1d0fe33d24744d8b2df0c12f33ebb662
index 0a261ca64c80e534045e42c3d7890cc821440b60..b3364a19e0b3839f09c347958c53a553f1140bf7 100644 (file)
@@ -36,6 +36,22 @@ MESON_BUILD_DIR:=$(PKG_BUILD_DIR)/openwrt-build
 MESON_VARS:=
 MESON_ARGS:=
 
+ifneq ($(findstring i386,$(CONFIG_ARCH)),)
+MESON_ARCH:="x86"
+else ifneq ($(findstring powerpc64,$(CONFIG_ARCH)),)
+MESON_ARCH:="ppc64"
+else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
+MESON_ARCH:="ppc"
+else ifneq ($(findstring mips64el,$(CONFIG_ARCH)),)
+MESON_ARCH:="mips64"
+else ifneq ($(findstring mipsel,$(CONFIG_ARCH)),)
+MESON_ARCH:="mips"
+else ifneq ($(findstring armeb,$(CONFIG_ARCH)),)
+MESON_ARCH:="arm"
+else
+MESON_ARCH:=$(CONFIG_ARCH)
+endif
+
 define Meson
        $(2) $(STAGING_DIR_HOST)/bin/$(PYTHON) $(MESON_DIR)/meson.py $(1)
 endef
@@ -65,7 +81,7 @@ define Meson/CreateCrossFile
                -e "s|@CFLAGS@|$(foreach FLAG,$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
                -e "s|@CXXFLAGS@|$(foreach FLAG,$(TARGET_CXXFLAGS) $(EXTRA_CXXFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS),'$(FLAG)',)|" \
                -e "s|@LDFLAGS@|$(foreach FLAG,$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS),'$(FLAG)',)|" \
-               -e "s|@ARCH@|$(ARCH)|" \
+               -e "s|@ARCH@|$(MESON_ARCH)|" \
                -e "s|@CPU@|$(CONFIG_TARGET_SUBTARGET)|" \
                -e "s|@ENDIAN@|$(if $(CONFIG_BIG_ENDIAN),big,little)|" \
                < $(MESON_DIR)/openwrt-cross.txt.in \