summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Kemper2021-08-20 20:59:49 +0000
committerSebastian Kemper2021-08-20 21:29:31 +0000
commit79a0acfe56256748615159f6e08687570ac2cf88 (patch)
tree6f3b636549e190c57e2245f9dee982738d13df3b
parent2feac1069fbaf58a110c741bcba4f9e092ec2704 (diff)
downloadtelephony-79a0acfe56256748615159f6e08687570ac2cf88.tar.gz
asterisk: update AST_EXT_TOOL_CHECK for OpenWrt
Issue #672 shows that the current macro has some pitfalls, at least when running within OpenWrt's buildroot. The macro is used to detect these tools: 1. xml2-config 2. mysql_config 3. neon-config 4. net-snmp-config 5. sdl-config (we're not using SDL) The macro also adds configure arguments that allow to specify a path like so: --with-mysqlclient=PATH Macro problems: 1. If no PATH is specified, it adds "/bin" to the search path. Obviously this is a bad thing when cross-compiling. 2. If a PATH is specified, it adds it to the start of every include and library path it encounters. These paths are then broken. This commit makes problem 1 go away by making the addition of "${$1_DIR}/bin" to the PATH dependent on there being a PATH handed to the macro. An alternative would be to remove the PATH addition altogether, but then the macro wouldn't behave as expected. It also removes the path filtering of the include and lib dirs to address problem 2. Closes #672 Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
-rw-r--r--net/asterisk/patches/160-AST_EXT_TOOL_CHECK.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/net/asterisk/patches/160-AST_EXT_TOOL_CHECK.patch b/net/asterisk/patches/160-AST_EXT_TOOL_CHECK.patch
new file mode 100644
index 0000000..97c9d35
--- /dev/null
+++ b/net/asterisk/patches/160-AST_EXT_TOOL_CHECK.patch
@@ -0,0 +1,22 @@
+--- a/autoconf/ast_ext_tool_check.m4
++++ b/autoconf/ast_ext_tool_check.m4
+@@ -8,13 +8,16 @@ AC_DEFUN([AST_EXT_TOOL_CHECK],
+ AC_REQUIRE([AST_PROG_SED])dnl
+ if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
+ PBX_$1=0
+- AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
++ if test "x${$1_DIR}" != "x"; then
++ AC_PATH_TOOL(CONFIG_$1, $2, No, [${$1_DIR}/bin:$PATH])
++ else
++ AC_PATH_TOOL(CONFIG_$1, $2, No, [$PATH])
++ fi
+ if test ! "x${CONFIG_$1}" = xNo; then
+ $1_INCLUDE=$(${CONFIG_$1} m4_default([$3],[--cflags]))
+- $1_INCLUDE=$(echo ${$1_INCLUDE} | $SED -e "s|-I|-I${$1_DIR}|g" -e "s|-std=c99||g")
++ $1_INCLUDE=$(echo ${$1_INCLUDE} | $SED -e "s|-std=c99||g")
+
+ $1_LIB=$(${CONFIG_$1} m4_default([$4],[--libs]))
+- $1_LIB=$(echo ${$1_LIB} | $SED -e "s|-L|-L${$1_DIR}|g")
+
+ m4_ifval([$5], [
+ saved_cppflags="${CPPFLAGS}"