freeswitch-stable: add FreeTDM support

The OpenWrt telephony feed already has DAHDI support. This commit
enables FreeTDM so FreeSWITCH can make use of DAHDI via libpri.

This does not change the existing FreeSWITCH packages as FreeTDM is a
separate library in the FreeSWITCH distribution, hence no revision bump.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2018-01-04 16:34:36 +01:00
parent acc5806357
commit 70a99e695b
2 changed files with 50 additions and 0 deletions

View file

@ -241,6 +241,8 @@ FS_STABLE_MOD_AVAILABLE:= \
yaml \
yuv
LIBFTDM:=libfreetdm
PKG_CONFIG_DEPENDS:= \
$(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-%,$(FS_STABLE_MISC_AVAILABLE)) \
$(patsubst %,CONFIG_PACKAGE_$(PKG_NAME)-mod-%,$(FS_STABLE_MOD_AVAILABLE)) \
@ -257,6 +259,7 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_FS_STABLE_WITH_VPX \
CONFIG_FS_STABLE_WITH_ZRTP \
CONFIG_LIBC \
CONFIG_PACKAGE_$(LIBFTDM) \
CONFIG_SOFT_FLOAT
include $(INCLUDE_DIR)/package.mk
@ -311,6 +314,24 @@ define Package/$(PKG_NAME)/install/mod
$(1)$(FS_STABLE_MOD_DIR)
endef
define Package/$(LIBFTDM)
CATEGORY:=Libraries
DEPENDS:=$(PKG_NAME)
SECTION:=libs
SUBMENU:=Telephony
TITLE:=TDM signaling and media API
URL:=https://www.$(PRG_NAME).org
endef
define Package/$(LIBFTDM)/description
Provides a unified interface to hardware TDM cards and ss7 stacks for
FreeSWITCH.
endef
define Package/$(LIBFTDM)/install
$(call Package/$(PKG_NAME)/install/lib,$(1),$(LIBFTDM))
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
@ -922,6 +943,12 @@ endef
define Build/Compile
$(call Build/Compile/Default)
# FreeTDM is only compiled/installed automatically if mod_freetdm is selected
ifneq ($(CONFIG_PACKAGE_$(LIBFTDM)),)
ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-freetdm),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/freetdm)
endif
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-perl-esl),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl perlmod)
endif
@ -932,6 +959,11 @@ endef
define Build/Install
$(call Build/Install/Default)
ifneq ($(CONFIG_PACKAGE_$(LIBFTDM)),)
ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-freetdm),)
$(call Build/Install/Default,-C $(PKG_BUILD_DIR)/libs/freetdm install)
endif
endif
ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-misc-perl-esl),)
$(call Build/Compile/Default,-C $(PKG_BUILD_DIR)/libs/esl DESTDIR=$(PKG_INSTALL_DIR) perlmod-install)
endif
@ -948,8 +980,15 @@ define Build/InstallDev
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(FS_STABLE_PKGCONFIG_DIR)/$(PRG_NAME).pc \
$(1)$(FS_STABLE_PKGCONFIG_DIR)
ifneq ($(CONFIG_PACKAGE_$(LIBFTDM)),)
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)$(FS_STABLE_PKGCONFIG_DIR)/freetdm.pc \
$(1)$(FS_STABLE_PKGCONFIG_DIR)
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
endif
endef
$(eval $(call BuildPackage,$(LIBFTDM)))
$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)-misc-hotplug))
$(eval $(call BuildPackage,$(PKG_NAME)-misc-perl-esl))

View file

@ -0,0 +1,11 @@
--- a/libs/freetdm/configure.ac
+++ b/libs/freetdm/configure.ac
@@ -88,7 +88,7 @@ AC_ARG_ENABLE([enable_64],
case "${ax_cv_c_compiler_vendor}" in
gnu)
- COMP_VENDOR_CFLAGS="-ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -O0"
+ COMP_VENDOR_CFLAGS="-ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
;;
sun)
COMP_VENDOR_CFLAGS="-xc99=all -mt -xCC -xvpara"