kamailio-5.x: improve module selection

Currently INCL_MODULES is filled with all modules. This commit changes
this so that only the modules that are selected are added to it.

To further limit the number of modules built group_include="standard" is
added. This way only the modules of the standard group plus the modules
selected in menuconfig are built. The "standard" group only includes
modules without any depends.

This fixes build failures on targets where not all depends are
available, i.e. postgresql on ARC. Now these modules can be properly
prevented from being built.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-02-03 13:56:25 +01:00
parent 07bcdd9fa7
commit 706ea18d8c

View file

@ -28,6 +28,8 @@ TARGET_CFLAGS += $(FPIC) -DVERSION_NODATE=1
PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt PREBUILT_STAMP=$(STAGING_DIR)/stamp/.$(PKG_NAME)_prebuilt
TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS) TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components 1 $(TAR_OPTIONS)
INCL_MODULES:=
define Package/kamailio5/Default define Package/kamailio5/Default
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
@ -94,6 +96,9 @@ define BuildKamailio5Module
$$(call Package/kamailio5/Default) $$(call Package/kamailio5/Default)
TITLE:=$(2) for Kamailio5 TITLE:=$(2) for Kamailio5
DEPENDS:=kamailio5 $(patsubst +%,+PACKAGE_kamailio5-mod-$(subst _,-,$(1)):%,$(4)) DEPENDS:=kamailio5 $(patsubst +%,+PACKAGE_kamailio5-mod-$(subst _,-,$(1)):%,$(4))
ifneq ($$(CONFIG_PACKAGE_kamailio5-mod-$(subst _,-,$(1))),)
INCL_MODULES+=$(1)
endif
endef endef
define Package/kamailio5-mod-$(subst _,-,$(1))/install define Package/kamailio5-mod-$(subst _,-,$(1))/install
@ -101,8 +106,6 @@ $(call Package/kamailio5/install/module,$$(1),$(1))
$(foreach d,$(5),$(call Package/kamailio5/install/dbfiles,$$(1),$(d));) $(foreach d,$(5),$(call Package/kamailio5/install/dbfiles,$$(1),$(d));)
endef endef
INCL_MODULES+=$(1)
$$(eval $$(call BuildPackage,kamailio5-mod-$(subst _,-,$(1)))) $$(eval $$(call BuildPackage,kamailio5-mod-$(subst _,-,$(1))))
endef endef
@ -113,7 +116,8 @@ PKG_MAKE_ARGS:= \
data_dir=/usr/share/kamailio/ \ data_dir=/usr/share/kamailio/ \
lib_dir=/usr/lib/kamailio/ \ lib_dir=/usr/lib/kamailio/ \
modules_dir=/usr/lib/kamailio/ \ modules_dir=/usr/lib/kamailio/ \
include_modules="$(INCL_MODULES)" \ group_include="standard" \
include_modules="$$(INCL_MODULES)" \
cfg_target:=/etc/kamailio/ \ cfg_target:=/etc/kamailio/ \
TLS_HOOKS=1 \ TLS_HOOKS=1 \
extra_defs="-DUSE_PTHREAD_MUTEX " \ extra_defs="-DUSE_PTHREAD_MUTEX " \