asterisk-11.x: update source and fix build with musl
authorDaniel Golle <daniel@makrotopia.org>
Fri, 19 Jun 2015 02:42:39 +0000 (04:42 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 19 Jun 2015 06:02:31 +0000 (08:02 +0200)
 * update to 11.18.0
 * GNU specific glob extenions are not availble on musl, don't
   use them.
 * PTHREAD_MUTEX_FAST_NP also isn't available, use fallback mutex
   types instead.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
net/asterisk-11.x/Makefile
net/asterisk-11.x/patches/001-pjproject-change-configure-args.patch
net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch
net/asterisk-11.x/patches/022-asterisk-11.17.1-fix-cross-compile.patch [deleted file]
net/asterisk-11.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch [new file with mode: 0644]
net/asterisk-11.x/patches/035-pjproject-non-gnu-mutex-type.patch [new file with mode: 0644]

index a9de21b85fe65921493f3814e38ac78a924064a8..6e2cf5719812bb452a94ae095d5fe3a397cb70b7 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk11
-PKG_VERSION:=11.17.1
+PKG_VERSION:=11.18.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
-PKG_MD5SUM:=2c6cd0f499152d0d5ff32f36e274fc2e
+PKG_MD5SUM:=3ddb42b54db200faccd68906df210a40
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE
@@ -289,13 +289,13 @@ define Build/Configure
 endef
 
 define Build/Compile
-       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+       ( retry=""; while [ ! "$$$$retry" ] && ! $(MAKE) -C "$(PKG_BUILD_DIR)" \
                include/asterisk/version.h \
                include/asterisk/buildopts.h defaults.h \
-               makeopts.embed_rules
+               makeopts.embed_rules; do retry=1; done )
        ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY"
        ASTLDFLAGS="$(EXTRA_LDFLAGS)"
-       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+       ( retry=""; while [ ! "$$$$retry" ] && ! $(MAKE) -C "$(PKG_BUILD_DIR)" \
                ASTVARLIBDIR="/usr/lib/asterisk" \
                ASTDATADIR="/usr/lib/asterisk" \
                ASTKEYDIR="/usr/lib/asterisk" \
@@ -304,7 +304,7 @@ define Build/Compile
                DEBUG="" \
                OPTIMIZE="" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install samples
+               all install samples; do retry=1; done )
 endef
 
 define Build/InstallDev
index 761dd5db67f46440b2ad47a519109731aeb40daf..335a6bde053327eb0bb7ac3ddaff190a39c218b3 100644 (file)
@@ -1,6 +1,6 @@
 --- a/res/Makefile
 +++ b/res/Makefile
-@@ -75,7 +75,7 @@ dist-clean::
+@@ -78,7 +78,7 @@ distclean::
        rm -f pjproject/build.mak
  
  pjproject/build.mak: pjproject/aconfigure
index 57797141396182d9431e39cebfb75e9bc18229d7..937ab0fe6b5f4a9efdf3397635905cfced9947a9 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -16533,7 +16533,6 @@ if ac_fn_c_try_link "$LINENO"; then :
+@@ -16606,7 +16606,6 @@ if ac_fn_c_try_link "$LINENO"; then :
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  $as_echo "yes" >&6; }
  
diff --git a/net/asterisk-11.x/patches/022-asterisk-11.17.1-fix-cross-compile.patch b/net/asterisk-11.x/patches/022-asterisk-11.17.1-fix-cross-compile.patch
deleted file mode 100644 (file)
index eff0081..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -901,7 +901,7 @@ nmenuselect: menuselect/nmenuselect menu
-       -@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
- # options for make in menuselect/
--MAKE_MENUSELECT=CC="$(CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" \
-+MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" \
-               CFLAGS="$(BUILD_CFLAGS)" LDFLAGS="$(BUILD_LDFLAGS)" \
-               $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
diff --git a/net/asterisk-11.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch b/net/asterisk-11.x/patches/030-GNU-GLOB-exts-only-on-glibc.patch
new file mode 100644 (file)
index 0000000..bf1ffdf
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/res/ael/ael.flex
++++ b/res/ael/ael.flex
+@@ -595,7 +595,7 @@ includes   { STORE_POS; return KW_INCLUDES
+                  snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
+                  ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
+               }
+-#ifdef SOLARIS
++#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
+                       glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
+ #else
+                       glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
+--- a/res/ael/ael_lex.c
++++ b/res/ael/ael_lex.c
+@@ -1976,7 +1967,7 @@ YY_RULE_SETUP
+                  snprintf(fnamebuf2,sizeof(fnamebuf2), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, fnamebuf);
+                  ast_copy_string(fnamebuf,fnamebuf2,sizeof(fnamebuf));
+               }
+-#ifdef SOLARIS
++#if !defined(HAVE_GLOB_NOMAGIC) || !defined(HAVE_GLOB_BRACE) || defined(DEBUG_NONGNU)
+                       glob_ret = glob(fnamebuf, GLOB_NOCHECK, NULL, &globbuf);
+ #else
+                       glob_ret = glob(fnamebuf, GLOB_NOMAGIC|GLOB_BRACE, NULL, &globbuf);
diff --git a/net/asterisk-11.x/patches/035-pjproject-non-gnu-mutex-type.patch b/net/asterisk-11.x/patches/035-pjproject-non-gnu-mutex-type.patch
new file mode 100644 (file)
index 0000000..7a70858
--- /dev/null
@@ -0,0 +1,26 @@
+Index: asterisk-11.18.0/res/pjproject/pjlib/src/pj/os_core_unix.c
+===================================================================
+--- asterisk-11.18.0.orig/res/pjproject/pjlib/src/pj/os_core_unix.c
++++ asterisk-11.18.0/res/pjproject/pjlib/src/pj/os_core_unix.c
+@@ -1091,7 +1091,7 @@ static pj_status_t init_mutex(pj_mutex_t
+       return PJ_RETURN_OS_ERROR(rc);
+     if (type == PJ_MUTEX_SIMPLE) {
+-#if (defined(PJ_LINUX) && PJ_LINUX!=0) || \
++#if (defined(PJ_LINUX) && PJ_LINUX!=0 && defined(__GLIBC__)) || \
+     defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE)
+       rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_FAST_NP);
+ #elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \
+@@ -1101,10 +1101,10 @@ static pj_status_t init_mutex(pj_mutex_t
+       rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
+ #endif
+     } else {
+-#if (defined(PJ_LINUX) && PJ_LINUX!=0) || \
++#if (defined(PJ_LINUX) && PJ_LINUX!=0 && defined(__GLIBC__)) || \
+      defined(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE)
+       rc = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+-#elif (defined(PJ_RTEMS) && PJ_RTEMS!=0) || \
++#elif (defined(PJ_RTEMS) && PJ_RTEMS!=0 && defined(__GLIBC__)) || \
+        defined(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE)
+       // Phil Torre <ptorre@zetron.com>:
+       // The RTEMS implementation of POSIX mutexes doesn't include