From dad0784ecbd1c167bf36d2d36c22633bc649c5a0 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 28 Nov 2017 22:20:16 +0100 Subject: [PATCH 1/2] asterisk-13.x: add menuselect mechanism This adds a mechanism that disables all modules by default and then enables only the modules needed for the packages selected, resulting in less build time. Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 9fb5602..1b4ac06 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -24,6 +24,23 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING LICENSE PKG_MAINTAINER:=Jiri Slachta +MENUSELECT_CATEGORIES:= \ + MENUSELECT_ADDONS \ + MENUSELECT_APPS \ + MENUSELECT_BRIDGES \ + MENUSELECT_CDR \ + MENUSELECT_CEL \ + MENUSELECT_CHANNELS \ + MENUSELECT_CODECS \ + MENUSELECT_FORMATS \ + MENUSELECT_FUNCS \ + MENUSELECT_PBX \ + MENUSELECT_RES \ + MENUSELECT_UTILS \ + MENUSELECT_AGIS + +AST_ENABLE:= + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -61,6 +78,9 @@ define BuildAsterisk13Module $$(call Package/asterisk13/Default) TITLE:=$(2) support DEPENDS:= asterisk13 $(patsubst +%,+PACKAGE_asterisk13-$(1):%,$(4)) + ifneq ($$(CONFIG_PACKAGE_asterisk13-$(1)),) + AST_ENABLE+=$(6) + endif endef define Package/asterisk13-$(1)/conffiles @@ -305,6 +325,18 @@ define Build/Compile LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + for cat in $(MENUSELECT_CATEGORIES); do \ + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable-category $$$$cat \ + menuselect.makeopts; \ + done + for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --enable $$$$item \ + menuselect.makeopts; \ + done cd "$(PKG_BUILD_DIR)" && \ ./menuselect/menuselect \ --disable BUILD_NATIVE \ From 2c7e8c72b475ede36b7326b0b3a3073f2f66384e Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 28 Nov 2017 22:25:03 +0100 Subject: [PATCH 2/2] asterisk-15.x: add menuselect mechanism This adds a mechanism that disables all modules by default and then enables only the modules needed for the packages selected, resulting in less build time. Signed-off-by: Sebastian Kemper --- net/asterisk-15.x/Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/net/asterisk-15.x/Makefile b/net/asterisk-15.x/Makefile index a368a75..b466ee1 100644 --- a/net/asterisk-15.x/Makefile +++ b/net/asterisk-15.x/Makefile @@ -22,6 +22,23 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING LICENSE PKG_MAINTAINER:=Jiri Slachta +MENUSELECT_CATEGORIES:= \ + MENUSELECT_ADDONS \ + MENUSELECT_APPS \ + MENUSELECT_BRIDGES \ + MENUSELECT_CDR \ + MENUSELECT_CEL \ + MENUSELECT_CHANNELS \ + MENUSELECT_CODECS \ + MENUSELECT_FORMATS \ + MENUSELECT_FUNCS \ + MENUSELECT_PBX \ + MENUSELECT_RES \ + MENUSELECT_UTILS \ + MENUSELECT_AGIS + +AST_ENABLE:= + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -59,6 +76,9 @@ define BuildAsterisk15Module $$(call Package/asterisk15/Default) TITLE:=$(2) support DEPENDS:= asterisk15 $(patsubst +%,+PACKAGE_asterisk15-$(1):%,$(4)) + ifneq ($$(CONFIG_PACKAGE_asterisk15-$(1)),) + AST_ENABLE+=$(6) + endif endef define Package/asterisk15-$(1)/conffiles @@ -305,6 +325,18 @@ define Build/Compile LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + for cat in $(MENUSELECT_CATEGORIES); do \ + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable-category $$$$cat \ + menuselect.makeopts; \ + done + for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \ + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --enable $$$$item \ + menuselect.makeopts; \ + done cd "$(PKG_BUILD_DIR)" && \ ./menuselect/menuselect \ --disable BUILD_NATIVE \