summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2016-08-10 10:47:32 -0600
committerGeorge Joseph <gjoseph@digium.com>2016-08-10 11:08:25 -0600
commita8512f9afe9d8a6448027a41454dc4aaf079869f (patch)
treec217e2894df1c682a01064f6e0461f85daf25378 /configure
parent400ce294e6d4d5d8fd27214a79a16f1013aef3d5 (diff)
res_resolver_unbound: Allow compilation with libunbound version < 1.5
libunbound at version 1.4.20 (which CentOS still uses) declared all of their string function parameters as as 'char *'. 1.4.21 changed them all to 'const char *'. Thankfully 1.4.21 also introduced the UNBOUND_VERSION_MAJOR define so configure now checks for that and sets HAVE_UNBOUND_CONST_PARAMS. res_resolver_unbound then checks that and casts away the 'const' if it's not set. Tested compile and testsuite on CentOS6 (1.4.20), Ubuntu14 (1.4.22) and Fedora24 (1.5.4). There are a few failing tests to be addressed though. ASTERISK-26283 #close Change-Id: Ib708b19b706c5d0ba7b7d5473e6df339d9ae4148
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure45
1 files changed, 44 insertions, 1 deletions
diff --git a/configure b/configure
index 86ae2028b..d7d1fbbed 100755
--- a/configure
+++ b/configure
@@ -23683,7 +23683,7 @@ if test "x${PBX_UNBOUND}" != "x1" -a "${USE_UNBOUND}" != "no"; then
pbxlibdir="-L${UNBOUND_DIR}"
fi
fi
- pbxfuncname="ub_ctx_add_ta_autr"
+ pbxfuncname="ub_ctx_delete"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_UNBOUND_FOUND=yes
else
@@ -23777,6 +23777,49 @@ fi
+ if test "x${PBX_UNBOUND_CONST_PARAMS}" != "x1" -a "${USE_UNBOUND_CONST_PARAMS}" != "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNBOUND_VERSION_MAJOR declared in unbound.h" >&5
+$as_echo_n "checking for UNBOUND_VERSION_MAJOR declared in unbound.h... " >&6; }
+ saved_cppflags="${CPPFLAGS}"
+ if test "x${UNBOUND_CONST_PARAMS_DIR}" != "x"; then
+ UNBOUND_CONST_PARAMS_INCLUDE="-I${UNBOUND_CONST_PARAMS_DIR}/include"
+ fi
+ CPPFLAGS="${CPPFLAGS} ${UNBOUND_CONST_PARAMS_INCLUDE}"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+ #include <unbound.h>
+int
+main ()
+{
+#if !defined(UNBOUND_VERSION_MAJOR)
+ (void) UNBOUND_VERSION_MAJOR;
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ PBX_UNBOUND_CONST_PARAMS=1
+
+$as_echo "#define HAVE_UNBOUND_CONST_PARAMS 1" >>confdefs.h
+
+
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ CPPFLAGS="${saved_cppflags}"
+ fi
+
+
if test "x${PBX_UNIXODBC}" != "x1" -a "${USE_UNIXODBC}" != "no"; then
pbxlibdir=""