Browse Source

Merge pull request #15860 from neheb/meson3

meson: use ninja from tools
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
c9ca45bbb3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 55 deletions
  1. +0
    -2
      devel/meson/Makefile
  2. +7
    -6
      devel/meson/meson.mk
  3. +2
    -28
      devel/ninja/Makefile
  4. +0
    -19
      devel/ninja/ninja.mk

+ 0
- 2
devel/meson/Makefile View File

@ -11,8 +11,6 @@ PKG_MAINTAINER:=Andre Heider <a.heider@gmail.com>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=COPYING
HOST_BUILD_DEPENDS:=ninja/host
include ../../lang/python/pypi.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk


+ 7
- 6
devel/meson/meson.mk View File

@ -24,7 +24,8 @@
# MESON_HOST_ARGS+=-Dfoo -Dbar=baz
# MESON_HOST_VARS+=FOO=bar
include $(dir $(lastword $(MAKEFILE_LIST)))/../../devel/ninja/ninja.mk
PKG_BUILD_PARALLEL ?= 1
HOST_BUILD_PARALLEL ?= 1
MESON_DIR:=$(STAGING_DIR_HOSTPKG)/lib/meson
@ -105,15 +106,15 @@ define Host/Configure/Meson
endef
define Host/Compile/Meson
$(call Ninja,-C $(MESON_HOST_BUILD_DIR),)
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) $(1)
endef
define Host/Install/Meson
$(call Ninja,-C $(MESON_HOST_BUILD_DIR) install,)
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) install
endef
define Host/Uninstall/Meson
-$(call Ninja,-C $(MESON_HOST_BUILD_DIR) uninstall,)
+$(NINJA) -C $(MESON_HOST_BUILD_DIR) uninstall
endef
define Build/Configure/Meson
@ -130,11 +131,11 @@ define Build/Configure/Meson
endef
define Build/Compile/Meson
$(call Ninja,-C $(MESON_BUILD_DIR),)
+$(NINJA) -C $(MESON_BUILD_DIR) $(1)
endef
define Build/Install/Meson
$(call Ninja,-C $(MESON_BUILD_DIR) install,DESTDIR="$(PKG_INSTALL_DIR)")
+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(MESON_BUILD_DIR) install
endef
Host/Configure=$(call Host/Configure/Meson)


+ 2
- 28
devel/ninja/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ninja
PKG_VERSION:=1.10.2
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ninja-build/ninja/tar.gz/v$(PKG_VERSION)?
@ -12,38 +12,13 @@ PKG_MAINTAINER:=Andre Heider <a.heider@gmail.com>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DEPENDS:=ninja/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include ./ninja.mk
CONFIGURE_ARGS:=
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
CONFIGURE_ARGS+=--verbose
endif
define Host/Configure
endef
define Host/Compile
cd $(HOST_BUILD_DIR) && \
CXX="$(HOSTCXX)" \
CXXFLAGS="$(HOST_CXXFLAGS) $(HOST_CPPFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
$(STAGING_DIR_HOST)/bin/$(PYTHON) configure.py --bootstrap $(CONFIGURE_ARGS)
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/ninja $(STAGING_DIR_HOSTPKG)/bin/
endef
define Host/Clean
$(call Host/Clean/Default)
rm -f $(STAGING_DIR_HOSTPKG)/bin/ninja
endef
define Package/ninja
SECTION:=devel
CATEGORY:=Development
@ -70,8 +45,7 @@ define Build/Configure
endef
define Build/Compile
$(call Ninja,-C $(PKG_BUILD_DIR),)
+$(NINJA) -C $(PKG_BUILD_DIR) $(1)
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,ninja))

+ 0
- 19
devel/ninja/ninja.mk View File

@ -1,19 +0,0 @@
# To execute ninja from you package's Makefile:
#
# include ../../devel/ninja/ninja.mk
#
# define Build/Compile
# $(call Ninja,-C $(MY_NINJA_BUILD_DIR),$(MY_NINJA_ENV_VARS))
# endef
HOST_BUILD_DEPENDS += ninja/host
PKG_BUILD_DEPENDS += ninja/host
NINJA_ARGS:=$(filter -j%,$(filter-out -j,$(MAKEFLAGS)))
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
NINJA_ARGS+=-v
endif
define Ninja
$(2) $(STAGING_DIR_HOSTPKG)/bin/ninja $(NINJA_ARGS) $(1)
endef

Loading…
Cancel
Save