net/asterisk-11.x: compile fixes
authorSebastian Kemper <sebastian_ml@gmx.net>
Sat, 22 Jul 2017 14:36:23 +0000 (16:36 +0200)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sat, 22 Jul 2017 14:40:42 +0000 (16:40 +0200)
- 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>
net/asterisk-11.x/Makefile
net/asterisk-11.x/patches/010-asterisk-configure-undef-res-ninit.patch
net/asterisk-11.x/patches/052-musl-libcap.patch
net/asterisk-11.x/patches/054-fix-cross-compile.patch [new file with mode: 0644]

index e86865b90503d683bcafdd9145a224e23bebe07b..e83f5549f508a00f42dc08abea87f2c053833646 100644 (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 \
index 90259083d4ed13811504ffc39188a3f2219cdc78..71fe3d7065489fc17e14a99449286b21587682ac 100644 (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)
index 460a8c4198e775f3cb769ba6e7cae5ceeed89fe0..fd80d5994e512dfda6ddeed643d9ab99fe82150c 100644 (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
  
diff --git a/net/asterisk-11.x/patches/054-fix-cross-compile.patch b/net/asterisk-11.x/patches/054-fix-cross-compile.patch
new file mode 100644 (file)
index 0000000..92e83eb
--- /dev/null
@@ -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