From 6053ff527b85c8f50cfa64533a9643286a66d6c4 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Tue, 16 Jan 2018 20:09:53 +0100 Subject: [PATCH] asterisk-13.x: change LOW_MEMORY and -march=native treatment - LOW_MEMORY is known to cause sporadic crashes, disable it by default. - Prevent Asterisk from adding -march=native to CFLAGS. Signed-off-by: Sebastian Kemper --- net/asterisk-13.x/Config.in | 11 +++++++++++ net/asterisk-13.x/Makefile | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 net/asterisk-13.x/Config.in diff --git a/net/asterisk-13.x/Config.in b/net/asterisk-13.x/Config.in new file mode 100644 index 0000000..fd38585 --- /dev/null +++ b/net/asterisk-13.x/Config.in @@ -0,0 +1,11 @@ +menu "Advanced configuration" + depends on PACKAGE_asterisk13 + +config ASTERISK13_LOW_MEMORY + bool "Optimize Asterisk 13 for low memory usage" + default n + help + Warning: this feature is known to cause problems with some modules. + Disable it if you experience problems like segmentation faults. + +endmenu diff --git a/net/asterisk-13.x/Makefile b/net/asterisk-13.x/Makefile index 151a37f..5ebe9d1 100644 --- a/net/asterisk-13.x/Makefile +++ b/net/asterisk-13.x/Makefile @@ -50,6 +50,10 @@ define Package/asterisk13/install/sounds $(CP) $(PKG_INSTALL_DIR)/usr/share/asterisk/sounds/en/$(2) $(1)/usr/share/asterisk/sounds/ endef +define Package/$(PKG_NAME)/config + source "$(SOURCE)/Config.in" +endef + define BuildAsterisk13Module define Package/asterisk13-$(1) $$(call Package/asterisk13/Default) @@ -268,6 +272,19 @@ define Build/Compile $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect" \ CFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR)/host/include/libxml2" \ LDFLAGS="$(HOST_LDFLAGS) -lxml2" + $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree + cd "$(PKG_BUILD_DIR)" && \ + ./menuselect/menuselect \ + --disable BUILD_NATIVE \ + $(if $(CONFIG_ASTERISK13_LOW_MEMORY),--enable LOW_MEMORY) \ + menuselect.makeopts + # Hack: + # When changing anything in MENUSELECT_CFLAGS the file ".lastclean" + # gets deleted. E.g. when compiling on x86 for x86 "--disable + # BUILD_NATIVE" changes MENUSELECT_CFLAGS and the file gets removed. + # But that will result in a rebuild attempt of menuselect which will + # likely fail. Prevent that by recreating ".lastclean". + $(CP) "$(PKG_BUILD_DIR)/.cleancount" "$(PKG_BUILD_DIR)/.lastclean" $(call Build/Compile/Default,all install samples) endef -- 2.30.2