[02/49,v2] package/asterisk: enable backtrace when available

Message ID 17231a88705fcf91d91826458d23d819ec63094c.1504993178.git.yann.morin.1998@free.fr
State New
Headers show
Series
  • [01/49,v2] package/asterisk: new package
Related show

Commit Message

Yann E. MORIN Sept. 9, 2017, 9:39 p.m.
asterisk uses backtrace() from execinfo.h to print beuatiful backtraces
when it fails. But execinfo is only reliably available with glibc, while
it is optionbal in uClibc and completely missing in musl.

So, only enable backtrace support for glibc toolchains.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/asterisk/asterisk.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/package/asterisk/asterisk.mk b/package/asterisk/asterisk.mk
index 21326ab046..82d69afe49 100644
--- a/package/asterisk/asterisk.mk
+++ b/package/asterisk/asterisk.mk
@@ -43,7 +43,6 @@  ASTERISK_CONF_OPTS = \
 	--disable-rpath \
 	--without-asound \
 	--without-bfd \
-	--without-execinfo \
 	--without-bluetooth \
 	--without-cap \
 	--without-cpg \
@@ -128,6 +127,12 @@  ASTERISK_CONF_OPTS += --without-avcodec
 ASTERISK_CONF_ENV = \
 	ac_cv_path_CONFIG_LIBXML2=$(STAGING_DIR)/usr/bin/xml2-config
 
+ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
+ASTERISK_CONF_OPTS += --with-execinfo
+else
+ASTERISK_CONF_OPTS += --without-execinfo
+endif
+
 ASTERISK_DIRS = \
 	ASTVARLIBDIR="/usr/lib/asterisk" \
 	ASTDATADIR="/usr/lib/asterisk" \