summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Kemper <sebastian_ml@gmx.net>2018-01-16 20:09:53 +0100
committerSebastian Kemper <sebastian_ml@gmx.net>2018-01-16 20:09:55 +0100
commit6053ff527b85c8f50cfa64533a9643286a66d6c4 (patch)
tree6767ff230684984ba87b22c396bb3cdeb27f7cb1
parent6fba6f38a5bfa4badb1ea34b0289628ca715aaa1 (diff)
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 <sebastian_ml@gmx.net>
-rw-r--r--net/asterisk-13.x/Config.in11
-rw-r--r--net/asterisk-13.x/Makefile17
2 files changed, 28 insertions, 0 deletions
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