From eead619fb1a0006e4d1547dd082cfa2d28a21c11 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Fri, 28 Jul 2017 21:45:25 +0200 Subject: [PATCH] net/asterisk-11.x and net/asterisk-13.x: fix LOW_MEMORY, drop patch LOW_MEMORY can't be enabled by defining it in ASTCFLAGS. This can be verified in the headers Asterisk installs: LOW_MEMORY actually is not defined (it would be if LOW_MEMORY was enabled). LOW_MEMORY can be enabled successfully with menuselect. This commit makes menuselect usable and calls it to enable LOW_MEMORY. This commit also disables BUILD_NATIVE with menuselect. So even if configure detects that -march=native is available, it won't be used. This means the configure.ac patch that was added previously can be dropped. Signed-off-by: Sebastian Kemper --- net/asterisk-11.x/Makefile | 8 +++++++- .../patches/054-fix-cross-compile.patch | 14 -------------- net/asterisk-13.x/Makefile | 8 +++++++- .../patches/054-fix-cross-compile.patch | 14 -------------- 4 files changed, 14 insertions(+), 30 deletions(-) delete mode 100644 net/asterisk-11.x/patches/054-fix-cross-compile.patch delete mode 100644 net/asterisk-13.x/patches/054-fix-cross-compile.patch diff --git a/net/asterisk-11.x/Makefile b/net/asterisk-11.x/Makefile index 5dc0374..366685c 100644 --- a/net/asterisk-11.x/Makefile +++ b/net/asterisk-11.x/Makefile @@ -323,10 +323,16 @@ define Build/Compile CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" + $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable BUILD_NATIVE \ + --enable LOW_MEMORY \ + menuselect.makeopts $(MAKE) -C "$(PKG_BUILD_DIR)" include/asterisk/version.h \ include/asterisk/buildopts.h defaults.h \ makeopts.embed_rules - ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTCFLAGS="$(EXTRA_CFLAGS)" \ ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ $(MAKE) -C "$(PKG_BUILD_DIR)" \ ASTVARLIBDIR="/usr/lib/asterisk" \ diff --git a/net/asterisk-11.x/patches/054-fix-cross-compile.patch b/net/asterisk-11.x/patches/054-fix-cross-compile.patch deleted file mode 100644 index 92e83eb..0000000 --- a/net/asterisk-11.x/patches/054-fix-cross-compile.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- 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 diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 13614fd..6400c6b 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -264,10 +264,16 @@ define Build/Compile CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOSTPKG)/include/libxml2" \ LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \ $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" + $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable BUILD_NATIVE \ + --enable LOW_MEMORY \ + menuselect.makeopts $(MAKE) -C "$(PKG_BUILD_DIR)" \ include/asterisk/version.h \ include/asterisk/buildopts.h defaults.h - ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \ + ASTCFLAGS="$(EXTRA_CFLAGS)" \ ASTLDFLAGS="$(EXTRA_LDFLAGS)" \ $(MAKE) -C "$(PKG_BUILD_DIR)" \ ASTVARLIBDIR="/usr/lib/asterisk" \ diff --git a/net/asterisk-13.x/patches/054-fix-cross-compile.patch b/net/asterisk-13.x/patches/054-fix-cross-compile.patch deleted file mode 100644 index dd1f2ea..0000000 --- a/net/asterisk-13.x/patches/054-fix-cross-compile.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1226,7 +1226,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 -- 2.30.2