From 5eebac557236db50e3cfcb64095df21fb25adc2f Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 28 Jun 2015 22:27:00 +0200 Subject: [PATCH] yate: fix build with musl Signed-off-by: Daniel Golle --- net/yate/Makefile | 14 ++++++++-- net/yate/patches/100-non-gnu-mutex-type.patch | 28 +++++++++++++++++++ net/yate/patches/110-no-libnsl.patch | 13 +++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 net/yate/patches/100-non-gnu-mutex-type.patch create mode 100644 net/yate/patches/110-no-libnsl.patch diff --git a/net/yate/Makefile b/net/yate/Makefile index dc0d1ee..b6519ed 100644 --- a/net/yate/Makefile +++ b/net/yate/Makefile @@ -7,13 +7,12 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/uclibc++.mk RELEASEVER:=5.4.2 PKG_NAME:=yate PKG_VERSION:=$(RELEASEVER)-1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://yate.null.ro/tarballs/yate5/ @@ -24,8 +23,11 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Jiri Slachta +PKG_FIXUP:=autoreconf + PKG_INSTALL:=1 +include $(INCLUDE_DIR)/uclibc++.mk include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME)/Default @@ -78,7 +80,13 @@ define Package/$(PKG_NAME)-collection-basic TITLE := Basic Yate Server endef -TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include $(if $(CONFIG_BIG_ENDIAN),-DBIGENDIAN,) +ifneq ($(CONFIG_USE_MUSL),) + LIBNSL:= +else + LIBNSL:=-lnsl +endif + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include $(if $(CONFIG_BIG_ENDIAN),-DBIGENDIAN,) $(LIBNSL) CONFIGURE_ARGS+= \ --enable-strings \ diff --git a/net/yate/patches/100-non-gnu-mutex-type.patch b/net/yate/patches/100-non-gnu-mutex-type.patch new file mode 100644 index 0000000..af5d8b2 --- /dev/null +++ b/net/yate/patches/100-non-gnu-mutex-type.patch @@ -0,0 +1,28 @@ +Index: yate/engine/Mutex.cpp +=================================================================== +--- yate.orig/engine/Mutex.cpp ++++ yate/engine/Mutex.cpp +@@ -30,6 +30,10 @@ typedef HANDLE HSEMAPHORE; + #include + #include + ++#ifndef PTHREAD_MUTEX_RECURSIVE_NP ++#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE ++#endif ++ + #ifdef MUTEX_HACK + extern "C" { + #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) +Index: yate/configure.ac +=================================================================== +--- yate.orig/configure.ac ++++ yate/configure.ac +@@ -257,7 +257,7 @@ AC_TRY_COMPILE([ + #include + ],[ + pthread_mutexattr_t attr; +-pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE_NP); ++pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); + ], + have_mutex_settype="yes", + have_mutex_settype="no" diff --git a/net/yate/patches/110-no-libnsl.patch b/net/yate/patches/110-no-libnsl.patch new file mode 100644 index 0000000..1a1660a --- /dev/null +++ b/net/yate/patches/110-no-libnsl.patch @@ -0,0 +1,13 @@ +Index: yate/configure.ac +=================================================================== +--- yate.orig/configure.ac ++++ yate/configure.ac +@@ -689,7 +689,7 @@ if [[ "x$local_lib" != "xlib" -a ! -d "$ + fi + if [[ -f "$ac_cv_use_mysql/include/mysql/mysql.h" -a -d "$ac_cv_use_mysql/$local_lib/mysql" ]]; then + MYSQL_INC="-I$ac_cv_use_mysql/include/mysql" +-MYSQL_LIB="-L$ac_cv_use_mysql/$local_lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm" ++MYSQL_LIB="-L$ac_cv_use_mysql/$local_lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lm" + MYSQL_VER=`sed -n 's/^.*MYSQL_SERVER_VERSION[[^"]]*"\([[^"]]*\).*$/\1/p' "$ac_cv_use_mysql/include/mysql/mysql_version.h"` + HAVE_MYSQL=yes + fi -- 2.30.2