From f920cc9f593d86ca17a20b70bd107a6dfdb9814f Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 11 Jan 2018 20:03:16 +0100 Subject: [PATCH 1/4] asterisk-11.x-chan-dongle: folder rename Rename the folder to asterisk-chan-dongle to prepare for VARIANT build. Signed-off-by: Sebastian Kemper --- net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/Makefile | 0 .../patches/001-add-send-ussd.patch | 0 .../patches/050-add-E1752-to-seven_bit_modems.patch | 0 .../patches/051-bump-package-revision.patch | 0 .../patches/100-fix-audio-on-big-endian-systems.patch | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/Makefile (100%) rename net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/patches/001-add-send-ussd.patch (100%) rename net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/patches/050-add-E1752-to-seven_bit_modems.patch (100%) rename net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/patches/051-bump-package-revision.patch (100%) rename net/{asterisk-11.x-chan-dongle => asterisk-chan-dongle}/patches/100-fix-audio-on-big-endian-systems.patch (100%) diff --git a/net/asterisk-11.x-chan-dongle/Makefile b/net/asterisk-chan-dongle/Makefile similarity index 100% rename from net/asterisk-11.x-chan-dongle/Makefile rename to net/asterisk-chan-dongle/Makefile diff --git a/net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch b/net/asterisk-chan-dongle/patches/001-add-send-ussd.patch similarity index 100% rename from net/asterisk-11.x-chan-dongle/patches/001-add-send-ussd.patch rename to net/asterisk-chan-dongle/patches/001-add-send-ussd.patch diff --git a/net/asterisk-11.x-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch b/net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch similarity index 100% rename from net/asterisk-11.x-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch rename to net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch diff --git a/net/asterisk-11.x-chan-dongle/patches/051-bump-package-revision.patch b/net/asterisk-chan-dongle/patches/051-bump-package-revision.patch similarity index 100% rename from net/asterisk-11.x-chan-dongle/patches/051-bump-package-revision.patch rename to net/asterisk-chan-dongle/patches/051-bump-package-revision.patch diff --git a/net/asterisk-11.x-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch b/net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch similarity index 100% rename from net/asterisk-11.x-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch rename to net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch From 37f40d02b8fa0a23c269256ae310350dcda0718f Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 11 Jan 2018 20:20:24 +0100 Subject: [PATCH 2/4] asterisk-chan-dongle: version bump, add variant for Asterisk 13 This commit adds VARIANT support. This is so that the module will also be available for Asterisk 13. The current version does not support Asterisk 13. So this commit also updates the package to use the (more recent) source from wdoekes on github, which is also used in master. Signed-off-by: Sebastian Kemper --- net/asterisk-chan-dongle/Makefile | 102 +++++++++++++----- .../patches/001-add-send-ussd.patch | 64 ----------- .../050-add-E1752-to-seven_bit_modems.patch | 19 ---- .../patches/051-bump-package-revision.patch | 20 ---- .../100-fix-audio-on-big-endian-systems.patch | 46 -------- .../patches/200-fix-iconv-detection.patch | 11 ++ 6 files changed, 85 insertions(+), 177 deletions(-) delete mode 100644 net/asterisk-chan-dongle/patches/001-add-send-ussd.patch delete mode 100644 net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch delete mode 100644 net/asterisk-chan-dongle/patches/051-bump-package-revision.patch delete mode 100644 net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch create mode 100644 net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch diff --git a/net/asterisk-chan-dongle/Makefile b/net/asterisk-chan-dongle/Makefile index 6b64ece..03518b8 100644 --- a/net/asterisk-chan-dongle/Makefile +++ b/net/asterisk-chan-dongle/Makefile @@ -7,18 +7,17 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=asterisk11-chan-dongle -PKG_VERSION:=1.1r35 -PKG_REV:=28a46567a88cebdc365db6f294e682246fd2dd7b -PKG_RELEASE:=6 +PKG_NAME:=asterisk-chan-dongle +PKG_VERSION:=1.1-20170913 +PKG_RELEASE:=1 -PKG_SOURCE_SUBDIR:=asterisk11-chan-dongle-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz -PKG_SOURCE_URL:=https://github.com/jstasiak/asterisk-chan-dongle.git +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/wdoekes/asterisk-chan-dongle.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=4ef5ad7eea7245a031101875be08b924aa1e151b PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=$(PKG_REV) -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_FIXUP:=autoreconf @@ -28,51 +27,98 @@ PKG_MAINTAINER:=Jiri Slachta include $(INCLUDE_DIR)/package.mk -define Package/asterisk11-chan-dongle +define Package/asterisk-chan-dongle/Default SUBMENU:=Telephony SECTION:=net CATEGORY:=Network - URL:=https://code.google.com/p/asterisk-chan-dongle/ - DEPENDS:= asterisk11 +libiconv-full +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +usb-modeswitch + URL:=https://github.com/wdoekes/asterisk-chan-dongle + DEPENDS:=+USE_UCLIBC:libiconv-full +kmod-usb-acm +kmod-usb-serial +kmod-usb-serial-option +libusb-1.0 +usb-modeswitch TITLE:=Huawei UMTS 3G dongle support endef -define Package/asterisk11-chan-dongle/description +define Package/asterisk11-chan-dongle +$(call Package/asterisk-chan-dongle/Default) + DEPENDS+=asterisk11 + VARIANT:=asterisk11 +endef + +define Package/asterisk13-chan-dongle +$(call Package/asterisk-chan-dongle/Default) + DEPENDS+=asterisk13 + VARIANT:=asterisk13 +endef + +define Package/description/Default Asterisk channel driver for Huawei UMTS 3G dongle. endef +Package/asterisk11-chan-dongle/description = $(Package/description/Default) +Package/asterisk13-chan-dongle/description = $(Package/description/Default) + +ifeq ($(BUILD_VARIANT),asterisk11) + CHAN_DONGLE_AST_HEADERS:=$(STAGING_DIR)/usr/include/asterisk-11/include + CONFIGURE_ARGS+= \ + --with-astversion=11 +endif + +ifeq ($(BUILD_VARIANT),asterisk13) + CHAN_DONGLE_AST_HEADERS:=$(STAGING_DIR)/usr/include/asterisk-13/include + CONFIGURE_ARGS+= \ + --with-astversion=13 +endif + +CONFIGURE_ARGS+= \ + --with-asterisk=$(CHAN_DONGLE_AST_HEADERS) + +TARGET_CFLAGS+= \ + -I$(CHAN_DONGLE_AST_HEADERS) + +# musl and glibc include their own iconv, but uclibc does not +ifneq ($(CONFIG_USE_UCLIBC),) +TARGET_CPPFLAGS+= \ + -I$(STAGING_DIR)/usr/lib/libiconv-full/include +endif + +CHAN_DONGLE_EXTRA_CFLAGS:= \ + -Wno-old-style-declaration \ + -I$(PKG_BUILD_DIR) \ + $(TARGET_CPPFLAGS) \ + -D_GNU_SOURCE \ + -DHAVE_CONFIG_H \ + $(FPIC) + MAKE_ARGS:= \ CC="$(TARGET_CC)" \ LD="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/lib/libiconv-full/include -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \ - LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv" \ - DESTDIR="$(PKG_INSTALL_DIR)/usr/lib/asterisk/modules" + CFLAGS="$(TARGET_CFLAGS) $(CHAN_DONGLE_EXTRA_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_UCLIBC),-L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv)" +# $CHAN_DONGLE_ICONV_INC used by 200-fix-iconv-detection.patch CONFIGURE_VARS += \ + CHAN_DONGLE_ICONV_INC="$(TOOLCHAIN_DIR)/include $(STAGING_DIR)/usr/lib/libiconv-full/include" \ ac_cv_type_size_t=yes \ ac_cv_type_ssize_t=yes -define Build/Configure - $(call Build/Configure/Default, \ - --with-asterisk=$(STAGING_DIR)/usr/include/asterisk-11/include \ - $(MAKE_ARGS) \ - ) -endef - define Build/Compile - mkdir -p $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules - $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_ARGS) all install + $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" $(MAKE_ARGS) endef -define Package/asterisk11-chan-dongle/conffiles +define Package/conffiles/Default /etc/asterisk/dongle.conf endef -define Package/asterisk11-chan-dongle/install +Package/asterisk11-chan-dongle/conffiles = $(Package/conffiles/Default) +Package/asterisk13-chan-dongle/conffiles = $(Package/conffiles/Default) + +define Package/Install/Default $(INSTALL_DIR) $(1)/etc/asterisk $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/dongle.conf $(1)/etc/asterisk/ $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dongle.so $(1)/usr/lib/asterisk/modules/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/chan_dongle.so $(1)/usr/lib/asterisk/modules/ endef +Package/asterisk11-chan-dongle/install = $(Package/Install/Default) +Package/asterisk13-chan-dongle/install = $(Package/Install/Default) + $(eval $(call BuildPackage,asterisk11-chan-dongle)) +$(eval $(call BuildPackage,asterisk13-chan-dongle)) diff --git a/net/asterisk-chan-dongle/patches/001-add-send-ussd.patch b/net/asterisk-chan-dongle/patches/001-add-send-ussd.patch deleted file mode 100644 index bc59bf9..0000000 --- a/net/asterisk-chan-dongle/patches/001-add-send-ussd.patch +++ /dev/null @@ -1,64 +0,0 @@ ---- a/app.c -+++ b/app.c -@@ -114,7 +114,44 @@ static int app_send_sms_exec (attribute_ - return !status; - } - -+static int app_send_ussd_exec (attribute_unused struct ast_channel* channel, const char* data) -+{ -+ char* parse; -+ const char* msg; -+ int status; -+ void * msgid; - -+ AST_DECLARE_APP_ARGS (args, -+ AST_APP_ARG (device); -+ AST_APP_ARG (ussd); -+ ); -+ -+ if (ast_strlen_zero (data)) -+ { -+ return -1; -+ } -+ -+ parse = ast_strdupa (data); -+ -+ AST_STANDARD_APP_ARGS (args, parse); -+ -+ if (ast_strlen_zero (args.device)) -+ { -+ ast_log (LOG_ERROR, "NULL device for ussd -- USSD will not be sent\n"); -+ return -1; -+ } -+ -+ if (ast_strlen_zero (args.ussd)) -+ { -+ ast_log (LOG_ERROR, "NULL ussd command -- USSD will not be sent\n"); -+ return -1; -+ } -+ -+ msg = send_ussd(args.device, args.ussd, &status, &msgid); -+ if(!status) -+ ast_log (LOG_ERROR, "[%s] %s with id %p\n", args.device, msg, msgid); -+ return !status; -+} - - static const struct dongle_application - { -@@ -144,7 +181,15 @@ static const struct dongle_application - " Message - text of the message\n" - " Validity - Validity period in minutes\n" - " Report - Boolean flag for report request\n" -- } -+ }, -+ { -+ "DongleSendUSSD", -+ app_send_ussd_exec, -+ "DongleSendUSSD(Device,USSD)", -+ "DongleSendUSSD(Device,USSD)\n" -+ " Device - Id of device from dongle.conf\n" -+ " USSD - ussd command\n" -+ } - }; - - #if ASTERISK_VERSION_NUM >= 10800 diff --git a/net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch b/net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch deleted file mode 100644 index a2c490c..0000000 --- a/net/asterisk-chan-dongle/patches/050-add-E1752-to-seven_bit_modems.patch +++ /dev/null @@ -1,19 +0,0 @@ -From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001 -From: "bg_one@mail.ru" -Date: Fri, 6 Sep 2013 19:37:05 +0000 -Subject: [PATCH] added E1752 to seven_bit_modems - ---- - at_response.c | 1 + - 1 files changed, 1 insertions(+), 0 deletion(-) - ---- a/at_response.c -+++ b/at_response.c -@@ -1590,6 +1590,7 @@ static int at_response_cgmm (struct pvt* - "E171", - "E153", - "E156B", -+ "E1752", - }; - - ast_copy_string (pvt->model, str, sizeof (pvt->model)); diff --git a/net/asterisk-chan-dongle/patches/051-bump-package-revision.patch b/net/asterisk-chan-dongle/patches/051-bump-package-revision.patch deleted file mode 100644 index 3d85dd6..0000000 --- a/net/asterisk-chan-dongle/patches/051-bump-package-revision.patch +++ /dev/null @@ -1,20 +0,0 @@ -From da5cd41e8554eaf1133f85282c253da2c74ff7eb Mon Sep 17 00:00:00 2001 -From: "bg_one@mail.ru" -Date: Fri, 6 Sep 2013 19:37:05 +0000 -Subject: [PATCH] added E1752 to seven_bit_modems - ---- - configure.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletion(-) - ---- a/configure.in -+++ b/configure.in -@@ -2,7 +2,7 @@ dnl init - dnl AC_REVISION($Revision: 1.30 $) - AC_PREREQ([2.60]) - AC_INIT([chan_dongle],[1.1],[http://code.google.com/p/asterisk-chan-dongle/issues/list],[chan_dongle],[http://code.google.com/p/asterisk-chan-dongle]) --PACKAGE_REVISION="34" -+PACKAGE_REVISION="35" - AC_CANONICAL_TARGET - AM_INIT_AUTOMAKE - AC_CONFIG_HEADERS([config.h]) diff --git a/net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch b/net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch deleted file mode 100644 index a6b1c07..0000000 --- a/net/asterisk-chan-dongle/patches/100-fix-audio-on-big-endian-systems.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/channel.c -+++ b/channel.c -@@ -495,6 +495,19 @@ again: - } - } - -+// see https://github.com/openwrt/telephony/issues/7 -+static inline void change_audio_endianness_to_le(struct iovec *iov, int iovcnt) -+{ -+#if __BYTE_ORDER == __LITTLE_ENDIAN -+ return; // nothing to do -+#else -+ for(;iovcnt-->0;iov++) -+ { -+ ast_swapcopy_samples(iov->iov_base, iov->iov_base, iov->iov_len/2); -+ } -+#endif -+} -+ - #/* */ - static void timing_write (struct pvt* pvt) - { -@@ -522,6 +535,7 @@ static void timing_write (struct pvt* pv - iovcnt = mixb_read_n_iov (&pvt->a_write_mixb, iov, FRAME_SIZE); - mixb_read_n_iov (&pvt->a_write_mixb, iov, FRAME_SIZE); - mixb_read_upd (&pvt->a_write_mixb, FRAME_SIZE); -+ change_audio_endianness_to_le(iov, iovcnt); - } - else if (used > 0) - { -@@ -535,6 +549,7 @@ static void timing_write (struct pvt* pv - iov[iovcnt].iov_base = silence_frame; - iov[iovcnt].iov_len = FRAME_SIZE - used; - iovcnt++; -+ change_audio_endianness_to_le(iov, iovcnt); - } - else - { -@@ -544,6 +559,7 @@ static void timing_write (struct pvt* pv - iov[0].iov_base = silence_frame; - iov[0].iov_len = FRAME_SIZE; - iovcnt = 1; -+ // ignore endianness for zeros - // continue; - } - diff --git a/net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch b/net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch new file mode 100644 index 0000000..211764f --- /dev/null +++ b/net/asterisk-chan-dongle/patches/200-fix-iconv-detection.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -102,7 +102,7 @@ AC_DEFUN([AC_HEADER_FIND], [ + ) + + AC_HEADER_FIND([asterisk.h], $with_asterisk) +-AC_HEADER_FIND([iconv.h], /usr/include /usr/local/include /opt/local/include) ++AC_HEADER_FIND([iconv.h], ${CHAN_DONGLE_ICONV_INC}) + + AC_DEFINE([ICONV_CONST],[], [Define to const if you has iconv() const declaration of input buffer]) + AC_MSG_CHECKING([for iconv use const inbuf]) From 07b74591945dea02f235b7cad74a81d715cee0d5 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 11 Jan 2018 20:28:18 +0100 Subject: [PATCH 3/4] asterisk-g72x: fix variant build Currently variant building isn't working properly because PKG_BUILD_DIR is not set. This commit fixes that. It also cleans up the Makefile, making it much simpler. The cleanups are already in master. Signed-off-by: Sebastian Kemper --- net/asterisk-g72x/Makefile | 52 ++++++++++---------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/net/asterisk-g72x/Makefile b/net/asterisk-g72x/Makefile index 1422719..44de964 100644 --- a/net/asterisk-g72x/Makefile +++ b/net/asterisk-g72x/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=asterisk-g72x PKG_VERSION:=1.3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=asterisk-g72x-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://asterisk.hosting.lv/src/ @@ -23,6 +23,8 @@ PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=README.md PKG_MAINTAINER:=Alex Samorukov +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + include $(INCLUDE_DIR)/package.mk define Package/asterisk-g72x/Default @@ -60,52 +62,26 @@ Package/asterisk18-codec-g729/description = $(Package/description/Default) Package/asterisk11-codec-g729/description = $(Package/description/Default) Package/asterisk13-codec-g729/description = $(Package/description/Default) -ifeq ($(BUILD_VARIANT),asterisk18) - MAKE_ARGS:= \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_LD)" \ - CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-1.8/include -DHAVE_CONFIG_H -I. -fPIC" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - DESTDIR="$(PKG_INSTALL_DIR)" - - CONFIGURE_ARGS+=\ - --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-1.8/include \ - --with-asterisk18 \ +CONFIGURE_ARGS += \ --with-bcg729 \ - --enable-shared \ - $(MAKE_ARGS) + --enable-shared + +ifeq ($(BUILD_VARIANT),asterisk18) +CONFIGURE_ARGS += \ + --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-1.8/include \ + --with-asterisk18 endif ifeq ($(BUILD_VARIANT),asterisk11) - MAKE_ARGS:= \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_LD)" \ - CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=110000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-11/include -DHAVE_CONFIG_H -I. -fPIC" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - DESTDIR="$(PKG_INSTALL_DIR)" - - CONFIGURE_ARGS+=\ +CONFIGURE_ARGS += \ --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-11/include \ - --with-asterisk100 \ - --with-bcg729 \ - --enable-shared \ - $(MAKE_ARGS) + --with-asterisk100 endif ifeq ($(BUILD_VARIANT),asterisk13) - MAKE_ARGS:= \ - CC="$(TARGET_CC)" \ - LD="$(TARGET_LD)" \ - CFLAGS="$(TARGET_CFLAGS) -DASTERISK_VERSION_NUM=130000 -DLOW_MEMORY -D_XOPEN_SOURCE=600 $(TARGET_CPPFLAGS) -I$(STAGING_DIR)/usr/include/asterisk-13/include -DHAVE_CONFIG_H -I. -fPIC" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - DESTDIR="$(PKG_INSTALL_DIR)" - - CONFIGURE_ARGS+=\ +CONFIGURE_ARGS += \ --with-asterisk-includes=$(STAGING_DIR)/usr/include/asterisk-13/include \ - --with-asterisk130 \ - --with-bcg729 \ - --enable-shared \ - $(MAKE_ARGS) + --with-asterisk130 endif define Package/Install/Default From b7e986640a86b74742933ce8f516dedd27673c25 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Thu, 11 Jan 2018 20:33:23 +0100 Subject: [PATCH 4/4] chan-sccp-b: fix variant build The variant builing is not working properly because PKG_BUILD_DIR is unset. This fixes that. Also the Makefile is cleaned up. LOW_MEMORY is not explicitly defined anymore because chan-sccp-b is getting the define from the Asterisk headers. Signed-off-by: Sebastian Kemper --- net/chan-sccp-b/Makefile | 31 +++++++++++++------ .../01-prevent-extra-optimization.patch | 26 ++++++++++++++++ 2 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 net/chan-sccp-b/patches/01-prevent-extra-optimization.patch diff --git a/net/chan-sccp-b/Makefile b/net/chan-sccp-b/Makefile index f8f88d9..99605f4 100644 --- a/net/chan-sccp-b/Makefile +++ b/net/chan-sccp-b/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=chan-sccp-b PKG_REV:=6139 PKG_VERSION:=v4.2-r$(PKG_REV) -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/branches/v4.2 @@ -19,21 +19,39 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_VERSION:=$(PKG_REV) PKG_SOURCE_PROTO:=svn -PKG_FIXUP:=autoreconf -fi +PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-1.0 PKG_LICENSE_FILES:=COPYING LICENSE PKG_MAINTAINER:=Jiri Slachta +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_DEPENDS:=libiconv + include $(INCLUDE_DIR)/package.mk +# musl and glibc include their own iconv, but uclibc does not +ifneq ($(CONFIG_USE_UCLIBC),) +TARGET_CPPFLAGS+= \ + -I$(STAGING_DIR)/usr/lib/libiconv-full/include +TARGET_LDFLAGS+= \ + -L$(STAGING_DIR)/usr/lib/libiconv-full/lib -liconv +endif + +CONFIGURE_ARGS += \ + --enable-optimization=no \ + --enable-debug=no + define Package/chan-sccp-b/Default SUBMENU:=Telephony SECTION:=net CATEGORY:=Network TITLE:=SCCP channel provider support URL:=http://chan-sccp-b.sourceforge.net/ - DEPENDS:= +libltdl + DEPENDS:=+USE_UCLIBC:libiconv-full +libltdl endef define Package/asterisk18-chan-sccp-b @@ -90,13 +108,6 @@ Package/asterisk18-chan-sccp-b/conffiles = $(Package/conffiles/Default) Package/asterisk11-chan-sccp-b/conffiles = $(Package/conffiles/Default) Package/asterisk13-chan-sccp-b/conffiles = $(Package/conffiles/Default) -define Build/Compile - $(MAKE) -C "$(PKG_BUILD_DIR)" \ - CFLAGS="$(CFLAGS) -I$(PKG_BUILD_DIR)/src -DLOW_MEMORY -fno-stack-protector" \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - all install -endef - define Package/Install/Default $(INSTALL_DIR) $(1)/etc/asterisk $(CP) ./files/sccp.conf $(1)/etc/asterisk/sccp.conf diff --git a/net/chan-sccp-b/patches/01-prevent-extra-optimization.patch b/net/chan-sccp-b/patches/01-prevent-extra-optimization.patch new file mode 100644 index 0000000..e9fa9b0 --- /dev/null +++ b/net/chan-sccp-b/patches/01-prevent-extra-optimization.patch @@ -0,0 +1,26 @@ +--- a/autoconf/extra.m4 ++++ b/autoconf/extra.m4 +@@ -460,23 +460,8 @@ AC_DEFUN([CS_ENABLE_OPTIMIZATION], [ + AC_MSG_NOTICE([--enable-optimization: ${enable_optimization}]) + AC_MSG_NOTICE([--enable-debug: ${enable_debug}]) + +- if test -n "${CPPFLAGS_saved}"; then +- CPPFLAGS_saved="${CPPFLAGS_saved} -U_FORTIFY_SOURCE" +- else +- CPPFLAGS_saved="-U_FORTIFY_SOURCE" +- fi + if test "$enable_optimization" == "no"; then + strip_binaries="no" +- optimize_flag="-O0" +- case "${CC}" in +- *gcc*) +- AX_CHECK_COMPILE_FLAG(-Og, [ +- optimize_flag="-Og" +- ]) +- ;; +- esac +- CFLAGS_saved="${CFLAGS_saved} ${optimize_flag} " +- CPPFLAGS_saved="${CPPFLAGS_saved} ${optimize_flag}" + else + strip_binaries="yes" + CFLAGS_saved="${CFLAGS_saved} -O2 "