From cc5348a2825a7b1fb29b91bc5eeb79f67ffe5395 Mon Sep 17 00:00:00 2001 From: Yalu Zhang Date: Tue, 29 Nov 2022 14:19:30 +0100 Subject: [PATCH] voicemngr: Divide libvoice to common code and platform specific one Also add a new packages libvoice-broadcom. --- libvoice-broadcom/Makefile | 62 ++++++++++++++++++++++++++++++++++++++ voicemngr/Makefile | 40 ++++++++++++------------ 2 files changed, 82 insertions(+), 20 deletions(-) create mode 100644 libvoice-broadcom/Makefile diff --git a/libvoice-broadcom/Makefile b/libvoice-broadcom/Makefile new file mode 100644 index 000000000..3f414d09c --- /dev/null +++ b/libvoice-broadcom/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2022 IOPSYS Software Solutions AB +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=libvoice-broadcom +PKG_VERSION:=0.1 +PKG_LICENSE:=PROPRIETARY +PKG_LICENSE_FILES:=LICENSE + +LOCAL_SRC_DIR:=~/git/voip/$(PKG_NAME) +LOCAL_DEV=0 +ifneq ($(LOCAL_DEV),1) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git +PKG_SOURCE_VERSION:=2d3f39d517e89df0f3e80f85b7efedd3efc6705c +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_MIRROR_HASH:=skip +endif + +# All config variable that are passed to the make invocation, directly or +# indirectly. This ensures that the package is rebuilt on config-changes. +PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD + +LIBVOICE_PKG_BUILD_DIR := $(PKG_BUILD_DIR) + +export CONFIG_BRCM_SDK_VER_504040 +export CONFIG_BCM_CHIP_ID + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS += -Wall -Werror + +define Package/$(PKG_NAME) + CATEGORY:=Utilities + TITLE:=IOPSYS libvoice for Broadcom + URL:= + DEPENDS:= +endef + +define Package/$(PKG_NAME)/description + Libvoice is a library that provides a uniform set of APIs and data types with hardware abstract layer for DSP/SLIC from different vendors +endef + +ifeq ($(LOCAL_DEV),1) +define Build/Prepare + @echo "Building from the local source. TARGET_PLATFORM=$(TARGET_PLATFORM)" + rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/ +endef +endif + +define Package/$(PKG_NAME)/install + # Although there is nothing needs to be installed, but the install section must NOT be empty. Otherwise the package will be skipped as below. + # WARNING: skipping libvoice-broadcom -- package has no install section + $(INSTALL_DIR) $(1)/usr/lib +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) + diff --git a/voicemngr/Makefile b/voicemngr/Makefile index 40c55447c..b9dd3d65a 100644 --- a/voicemngr/Makefile +++ b/voicemngr/Makefile @@ -4,19 +4,21 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # +export LIBVOICE_MAKE_OPTS:=$(TOPDIR)/tmp/.libvoice-opts.mk include $(TOPDIR)/rules.mk +-include $(LIBVOICE_MAKE_OPTS) PKG_NAME:=voicemngr PKG_VERSION:=0.1 PKG_LICENSE:=PROPRIETARY PKG_LICENSE_FILES:=LICENSE -LOCAL_SRC_DIR:=~/git/voip/voicemngr +LOCAL_SRC_DIR:=~/git/voip/$(PKG_NAME) LOCAL_DEV=0 ifneq ($(LOCAL_DEV),1) PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/voicemngr.git -PKG_SOURCE_VERSION:=13a14593daa610a87c363a1a0acd19f31f405a71 +PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git +PKG_SOURCE_VERSION:=be0efc70203d0f8b83269711388c7990d53db851 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip endif @@ -25,29 +27,21 @@ endif # indirectly. This ensures that the package is rebuilt on config-changes. PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD -TARGET_PLATFORM:= -ifeq ($(CONFIG_TARGET_brcmbca),y) - TARGET_PLATFORM:=BROADCOM -else ifeq ($(CONFIG_TARGET_iopsys_qualcomm),y) - TARGET_PLATFORM:=QUALCOMM -endif - -export TARGET_PLATFORM -export CONFIG_BRCM_SDK_VER_504040 -export CONFIG_BCM_CHIP_ID - include $(INCLUDE_DIR)/package.mk TARGET_CFLAGS += -Wall -Werror -define Package/voicemngr +export LIBVOICE_CFLAGS +export LIBVOICE_LIBS + +define Package/$(PKG_NAME) CATEGORY:=Utilities TITLE:=IOPSYS Voice Manager URL:= - DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_brcmbca:bcmkernel +TARGET_iopsys_qualcomm:vtsp + DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_brcmbca:bcmkernel +TARGET_brcmbca:libvoice-broadcom +TARGET_iopsys_qualcomm:vtsp endef -define Package/voicemngr/description +define Package/$(PKG_NAME)/description Voice manager is a daemon that bridges Asterisk and platform specific DSP/SLIC APIs endef @@ -55,16 +49,22 @@ ifeq ($(LOCAL_DEV),1) define Build/Prepare @echo "Building from the local source. TARGET_PLATFORM=$(TARGET_PLATFORM)" rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/ + $(LN) $(LIBVOICE_PKG_BUILD_DIR)/*.[ch] $(PKG_BUILD_DIR)/libvoice/ +endef +else +define Build/Prepare + $(call Build/Prepare/Default) + $(LN) $(LIBVOICE_PKG_BUILD_DIR)/*.[ch] $(PKG_BUILD_DIR)/libvoice/ endef endif -define Package/voicemngr/install +define Package/$(PKG_NAME)/install $(CP) ./files/* $(1)/ $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_BIN) $(PKG_BUILD_DIR)/voicemngr $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/ $(CP) $(PKG_BUILD_DIR)/libvoice/libvoice.so* $(1)/usr/lib/ endef -$(eval $(call BuildPackage,voicemngr)) +$(eval $(call BuildPackage,$(PKG_NAME)))