net/asterisk-11.x: compile fixes

- Refresh patches.
- $(STAGING_DIR)/host doesn't work anymore resulting in libxml2 host
  headers not being found. Replace with $(STAGING_DIR_HOSTPGK).
- Prevent Asterisk from adding -march=native when cross-compiling (patch
  for configure.ac).

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2017-07-22 16:36:23 +02:00
parent afb2de7e2e
commit 4774e211c7
4 changed files with 21 additions and 6 deletions

View file

@ -282,8 +282,8 @@ CONFIGURE_VARS += \
AST_MENUSELECT_OPTS = \
--without-newt \
--without-curses \
--with-ncurses="$(STAGING_DIR)/host/usr" \
--with-libxml2="$(STAGING_DIR)/host/usr"
--with-ncurses="$(STAGING_DIR_HOSTPKG)/usr" \
--with-libxml2="$(STAGING_DIR_HOSTPKG)/usr"
define Build/Prepare
$(call Build/Prepare/Default)
@ -307,17 +307,18 @@ define Build/Configure
>> $(PKG_BUILD_DIR)/res/pjproject/user.mak;
$(call Build/Configure/Default,,$(SITE_VARS))
(cd $(PKG_BUILD_DIR)/menuselect; \
ac_cv_path_ac_pt_CONFIG_LIBXML2=$(STAGING_DIR_HOSTPKG)/bin/xml2-config \
./configure \
$(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_HOSTPKG)/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_HOSTPKG)/include/libxml2" \
LDFLAGS="$(HOST_LDFLAGS) -lxml2"
$(MAKE) -C "$(PKG_BUILD_DIR)" include/asterisk/version.h \
include/asterisk/buildopts.h defaults.h \

View file

@ -1,6 +1,6 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1175,7 +1175,6 @@ AC_LINK_IFELSE(
@@ -1168,7 +1168,6 @@ AC_LINK_IFELSE(
#include <resolv.h>],
[int foo = res_ninit(NULL);])],
AC_MSG_RESULT(yes)

View file

@ -10,7 +10,7 @@
kfreebsd*-gnu)
OSARCH=kfreebsd-gnu
;;
@@ -1285,9 +1288,11 @@ if test "${PBX_BFD}" = "0"; then
@@ -1278,9 +1281,11 @@ if test "${PBX_BFD}" = "0"; then
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
fi

View file

@ -0,0 +1,14 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1104,7 +1104,10 @@ fi
AC_SUBST(AST_SHADOW_WARNINGS)
AC_MSG_CHECKING(for -march=native support)
-if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+if test "${cross_compiling}" = "yes"; then
+ AC_MSG_RESULT(cross-compile)
+ AST_NATIVE_ARCH=0
+elif $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
AC_MSG_RESULT(yes)
AST_NATIVE_ARCH=1
else