[asterisk-commits] CFLAGS for BIND8 support (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 14 11:07:05 CDT 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5788 )

Change subject: CFLAGS for BIND8 support
......................................................................

CFLAGS for BIND8 support

Some systems (like macOS) require BIND_8_COMPAT to be defined so that
the nameser libraries are, well, BIND8 compatible.

Change-Id: If79fc27a64f90de1835b5aa3aadfa9be22bd16b0
---
M Makefile
M configure
M configure.ac
M makeopts.in
4 files changed, 45 insertions(+), 0 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Kevin Harwell: Looks good to me, approved



diff --git a/Makefile b/Makefile
index f29c07f..85a1152 100644
--- a/Makefile
+++ b/Makefile
@@ -124,6 +124,9 @@
 # libxml2 cflags
 _ASTCFLAGS+=$(LIBXML2_INCLUDE)
 
+# BIND_8_COMPAT
+_ASTCFLAGS+=$(BIND8_CFLAGS)
+
 #Uncomment this to see all build commands instead of 'quiet' output
 #NOISY_BUILD=yes
 
diff --git a/configure b/configure
index 739cf65..9111763 100755
--- a/configure
+++ b/configure
@@ -697,6 +697,7 @@
 PBX_RTLD_NOLOAD
 PBX_GLOB_BRACE
 PBX_GLOB_NOMAGIC
+BIND8_CFLAGS
 AST_RPATH
 AST_NATIVE_ARCH
 AST_SHADOW_WARNINGS
@@ -19410,6 +19411,33 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIND_8_COMPAT required" >&5
+$as_echo_n "checking for BIND_8_COMPAT required... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#undef BIND_8_COMPAT
+#include <arpa/nameser.h>
+
+int
+main ()
+{
+int x = NXDOMAIN
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+BIND8_CFLAGS=-DBIND_8_COMPAT
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 
     if test "x${PBX_GLOB_NOMAGIC}" != "x1"; then
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_NOMAGIC in glob.h" >&5
diff --git a/configure.ac b/configure.ac
index 9c07a4f..07aa167 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1360,6 +1360,18 @@
 	AC_MSG_RESULT(no)
 )
 
+AC_MSG_CHECKING(for BIND_8_COMPAT required)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[
+#undef BIND_8_COMPAT
+#include <arpa/nameser.h>
+]],
+[[int x = NXDOMAIN]])],
+AC_MSG_RESULT(no),
+AC_MSG_RESULT(yes)
+[BIND8_CFLAGS=-DBIND_8_COMPAT])
+AC_SUBST(BIND8_CFLAGS)
+
 AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h])
 
 AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h])
diff --git a/makeopts.in b/makeopts.in
index 03ef747..07360a7 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -62,6 +62,8 @@
 OSARCH=@OSARCH@
 OSREV=@PBX_OSREV@
 
+BIND8_CFLAGS=@BIND8_CFLAGS@
+
 PTHREAD_CFLAGS=@PTHREAD_CFLAGS@
 PTHREAD_LIBS=@PTHREAD_LIBS@
 

-- 
To view, visit https://gerrit.asterisk.org/5788
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If79fc27a64f90de1835b5aa3aadfa9be22bd16b0
Gerrit-Change-Number: 5788
Gerrit-PatchSet: 1
Gerrit-Owner: David M. Lee <dlee at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170614/a8722a71/attachment-0001.html>


More information about the asterisk-commits mailing list