Within this commit asterisk has been upgraded to version 11.22.0.
Several build issues has also been fixed (thanks to musl fixes from
Alpine linux).
Signed-off-by: Jiri Slachta <slachta@cesnet.cz>
#
-# Copyright (C) 2015 OpenWrt.org
-# Copyright (C) 2015 Cesnet, z.s.p.o.
+# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2016 Cesnet, z.s.p.o.
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk13
-PKG_VERSION:=13.6.0
+PKG_VERSION:=13.8.0
PKG_RELEASE:=1
PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
-PKG_MD5SUM:=66355aec4336c068f25e7df739786e72
+PKG_MD5SUM:=ad48eb4a01df72c8e30d3aec524b1a02
-PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=libxml2/host
PKG_LICENSE:=GPL-2.0
$(HOST_CONFIGURE_ARGS) \
$(AST_MENUSELECT_OPTS) \
LDFLAGS="$(HOST_LDFLAGS) -lxml2" \
- CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOST)/include/libxml2" \
+ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR)/host/include/libxml2" \
);
endef
define Build/Compile
$(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" \
- CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOST)/include/libxml2" \
+ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR)/host/include/libxml2" \
LDFLAGS="$(HOST_LDFLAGS) -lxml2"
$(MAKE) -C "$(PKG_BUILD_DIR)" \
include/asterisk/version.h \
$(eval $(call BuildAsterisk13Module,cdr,Provides CDR,Call Detail Record,,cdr.conf cdr_custom.conf cdr_manager.conf cdr_syslog.conf,app_cdr app_forkcdr cdr_custom cdr_manager cdr_syslog func_cdr,,))
$(eval $(call BuildAsterisk13Module,cdr-csv,Provides CDR CSV,Call Detail Record with CSV support,,,cdr_csv,,))
$(eval $(call BuildAsterisk13Module,cdr-sqlite3,Provides CDR SQLITE3,Call Detail Record with SQLITE3 support,libsqlite3,,cdr_sqlite3_custom,,))
+$(eval $(call BuildAsterisk13Module,chan-alsa,ALSA channel,the channel chan_alsa,+alsa-lib,,chan_alsa,,))
$(eval $(call BuildAsterisk13Module,chan-dahdi,DAHDI channel,DAHDI channel support,+dahdi-tools-libtonezone +kmod-dahdi +libpri,chan_dahdi.conf,chan_dahdi,,))
$(eval $(call BuildAsterisk13Module,chan-iax2,IAX2 channel,IAX support,+asterisk13-res-timing-timerfd,iax.conf iaxprov.conf,chan_iax2,,))
+$(eval $(call BuildAsterisk13Module,chan-oss,OSS channel,the channel chan_oss,,oss.conf,chan_oss,,))
$(eval $(call BuildAsterisk13Module,chan-sip,SIP channel,the channel chan_sip,+asterisk13-app-confbridge,sip.conf sip_notify.conf,chan_sip,,))
$(eval $(call BuildAsterisk13Module,chan-skinny,Skinny channel,the channel chan_skinny,,skinny.conf,chan_skinny,,))
$(eval $(call BuildAsterisk13Module,chan-unistim,Unistim channel,channel driver for the UNISTIM (Unified Networks IP Stimulus) protocol,,unistim.conf,chan_unistim,,))
--- a/configure.ac
+++ b/configure.ac
-@@ -900,19 +900,6 @@ AC_LINK_IFELSE(
+@@ -927,19 +927,6 @@ AC_LINK_IFELSE(
]
)
--- a/configure.ac
+++ b/configure.ac
-@@ -1170,7 +1170,6 @@ AC_LINK_IFELSE(
+@@ -1261,7 +1261,6 @@ AC_LINK_IFELSE(
#include <resolv.h>],
[int foo = res_ninit(NULL);])],
AC_MSG_RESULT(yes)
--- /dev/null
+--- asterisk-13.8.0/main/config_options.c 2016-03-29 21:39:33.000000000 +0200
++++ ast1380/main/config_options.c 2016-04-04 13:07:25.331238309 +0200
+@@ -198,8 +198,8 @@ static int link_option_to_types(struct a
+ #ifdef AST_DEVMODE
+ opt->doc_unavailable = 1;
+ #endif
+-#endif
+ }
++#endif
+ }
+ /* The container(s) should hold the only ref to opt */
+ ao2_ref(opt, -1);
--- /dev/null
+--- asterisk-11.7.0.orig/res/ael/ael.flex
++++ asterisk-11.7.0/res/ael/ael.flex
+@@ -79,6 +79,12 @@
+ #if !defined(GLOB_ABORTED)
+ #define GLOB_ABORTED GLOB_ABEND
+ #endif
++#if !defined(GLOB_BRACE)
++#define GLOB_BRACE 0
++#endif
++#if !defined(GLOB_NOMAGIC)
++#define GLOB_NOMAGIC 0
++#endif
+
+ #include "asterisk/logger.h"
+ #include "asterisk/utils.h"
+Only in asterisk-11.7.0: res/ael/ael.tab.o
+--- asterisk-11.7.0.orig/res/ael/ael_lex.c
++++ asterisk-11.7.0/res/ael/ael_lex.c
+@@ -838,6 +838,12 @@
+ #if !defined(GLOB_ABORTED)
+ #define GLOB_ABORTED GLOB_ABEND
+ #endif
++#if !defined(GLOB_BRACE)
++#define GLOB_BRACE 0
++#endif
++#if !defined(GLOB_NOMAGIC)
++#define GLOB_NOMAGIC 0
++#endif
+
+ #include "asterisk/logger.h"
+ #include "asterisk/utils.h"
--- /dev/null
+diff -ru asterisk-13.0.0.orig/include/asterisk/compat.h asterisk-13.0.0/include/asterisk/compat.h
+--- asterisk-13.0.0.orig/include/asterisk/compat.h 2014-10-31 08:48:56.000000000 -0200
++++ asterisk-13.0.0/include/asterisk/compat.h 2014-10-31 08:49:10.163808393 -0200
+@@ -68,7 +68,7 @@
+ #endif
+
+ #ifndef AST_POLL_COMPAT
+-#include <sys/poll.h>
++#include <poll.h>
+ #else
+ #include "asterisk/poll-compat.h"
+ #endif
+diff -ru asterisk-13.0.0.orig/include/asterisk/poll-compat.h asterisk-13.0.0/include/asterisk/poll-compat.h
+--- asterisk-13.0.0.orig/include/asterisk/poll-compat.h 2014-10-31 08:48:56.000000000 -0200
++++ asterisk-13.0.0/include/asterisk/poll-compat.h 2014-10-31 08:49:10.163808393 -0200
+@@ -83,7 +83,7 @@
+
+ #ifndef AST_POLL_COMPAT
+
+-#include <sys/poll.h>
++#include <poll.h>
+
+ #define ast_poll(a, b, c) poll(a, b, c)
+
+diff -ru asterisk-13.0.0.orig/main/ast_expr2.c asterisk-13.0.0/main/ast_expr2.c
+--- asterisk-13.0.0.orig/main/ast_expr2.c 2014-10-31 08:48:56.000000000 -0200
++++ asterisk-13.0.0/main/ast_expr2.c 2014-10-31 08:49:10.163808393 -0200
+@@ -93,6 +93,7 @@
+
+ #include "asterisk.h"
+
++#include <sys/cdefs.h>
+ #include <sys/types.h>
+ #include <stdio.h>
+
+diff -ru asterisk-13.0.0.orig/main/ast_expr2.y asterisk-13.0.0/main/ast_expr2.y
+--- asterisk-13.0.0.orig/main/ast_expr2.y 2014-10-31 08:48:56.000000000 -0200
++++ asterisk-13.0.0/main/ast_expr2.y 2014-10-31 08:49:10.163808393 -0200
+@@ -14,6 +14,7 @@
+
+ #include "asterisk.h"
+
++#include <sys/cdefs.h>
+ #include <sys/types.h>
+ #include <stdio.h>
+
--- /dev/null
+diff -rupN asterisk-13.8.0/configure.ac ast13/configure.ac
+--- asterisk-13.8.0/configure.ac 2016-04-04 14:41:26.398129246 +0200
++++ ast13/configure.ac 2016-04-04 14:40:48.421815607 +0200
+@@ -181,6 +181,9 @@ case "${host_os}" in
+ linux-gnueabi* | linux-gnuspe)
+ OSARCH=linux-gnu
+ ;;
++ linux-musl*)
++ OSARCH=linux-musl
++ ;;
+ kfreebsd*-gnu)
+ OSARCH=kfreebsd-gnu
+ ;;
+@@ -1373,9 +1376,11 @@ if test "${PBX_BFD}" = "0"; then
+ AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
+ fi
+
+-if test "x${OSARCH}" = "xlinux-gnu" ; then
++case "${OSARCH}" in
++linux*)
+ AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
+-fi
++ ;;
++esac
+
+ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
+ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
+diff -rupN asterisk-13.8.0/main/Makefile ast13/main/Makefile
+--- asterisk-13.8.0/main/Makefile 2016-03-29 21:39:33.000000000 +0200
++++ ast13/main/Makefile 2016-04-04 14:40:48.421815607 +0200
+@@ -45,7 +45,7 @@ AST_LIBS+=$(UUID_LIB)
+ AST_LIBS+=$(CRYPT_LIB)
+ AST_LIBS+=$(AST_CLANG_BLOCKS_LIBS)
+
+-ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),)
++ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc linux-musl kfreebsd-gnu),)
+ ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
+ AST_LIBS+=-ldl
+ endif
--- /dev/null
+diff -ru asterisk-12.4.0.orig/include/asterisk/lock.h asterisk-12.4.0/include/asterisk/lock.h
+--- asterisk-12.4.0.orig/include/asterisk/lock.h 2013-11-02 06:05:24.000000000 -0200
++++ asterisk-12.4.0/include/asterisk/lock.h 2014-08-04 16:00:29.811967599 -0300
+@@ -68,7 +68,7 @@
+ #define AST_PTHREADT_NULL (pthread_t) -1
+ #define AST_PTHREADT_STOP (pthread_t) -2
+
+-#if (defined(SOLARIS) || defined(BSD))
++#if (defined(SOLARIS) || defined(BSD) || !defined(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP))
+ #define AST_MUTEX_INIT_W_CONSTRUCTORS
+ #endif /* SOLARIS || BSD */
+