BIND 10 trac3135, updated. 96bafe5d6221238205f79e32ff67737d4ab17167 [trac3135] document asio dependency
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Aug 29 22:01:06 UTC 2013
The branch, trac3135 has been updated
via 96bafe5d6221238205f79e32ff67737d4ab17167 (commit)
via 0f2ef7af7acadfe842e2d38dacbde37bd03fa5ac (commit)
from 0fa8fea15013d43ebb70edd5698fcea25471f01e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 96bafe5d6221238205f79e32ff67737d4ab17167
Author: Jeremy C. Reed <jreed at isc.org>
Date: Thu Aug 29 14:59:10 2013 -0700
[trac3135] document asio dependency
commit 0f2ef7af7acadfe842e2d38dacbde37bd03fa5ac
Author: Jeremy C. Reed <jreed at isc.org>
Date: Thu Aug 29 14:57:53 2013 -0700
[trac3135] add m4 macro for --with-asio-include
This adds configure option to find asio headers.
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 10 +++++--
doc/guide/bind10-guide.xml | 14 +++++++--
m4macros/ax_asio_for_bind10.m4 | 63 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+), 4 deletions(-)
create mode 100644 m4macros/ax_asio_for_bind10.m4
-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index f97ce07..c779fa9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1096,11 +1096,16 @@ if test "x$have_sqlite" = "xyes" ; then
fi
#
-# Use our 'coroutine' header from ext
-CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
+# ASIO: we extensively use it as the C++ event management module.
+#
+AX_ASIO_FOR_BIND10
#
# Disable threads: Currently we don't use them.
CPPFLAGS="$CPPFLAGS -DASIO_DISABLE_THREADS=1"
+# TODO: if using boost.asio -DBOOST_ASIO_DISABLE_THREADS=1
+
+# Use our 'coroutine' header from ext
+CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/ext/coroutine"
# Check for functions that are not available on all platforms
AC_CHECK_FUNCS([pselect])
@@ -1543,6 +1548,7 @@ dnl includes too
${PYTHON_CXXFLAGS}
${PYTHON_LDFLAGS}
${PYTHON_LIB}
+ Asio: ${ASIO_INCLUDES}
Boost: ${BOOST_INCLUDES}
Botan: ${BOTAN_INCLUDES}
${BOTAN_LDFLAGS}
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index 6c538cd..c1cff65 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -617,8 +617,10 @@ $ <userinput>./configure</userinput></screen>
<para>
Building from source code requires the Boost
- build-time headers
- (<ulink url="http://www.boost.org/"/>).
+ (<ulink url="http://www.boost.org/"/>)
+ and Asio
+ (<ulink url="http://think-async.com/"/>)
+ C++ build-time headers.
At least Boost version 1.35 is required.
<!-- TODO: we don't check for this version -->
<!-- NOTE: jreed has tested with 1.34, 1.38, and 1.41. -->
@@ -754,6 +756,14 @@ as a dependency earlier -->
</varlistentry>
<varlistentry>
+ <term>--with-asio-include</term>
+ <listitem>
+ <simpara>Define the path to find the Asio headers.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>--with-boost-include</term>
<listitem>
<simpara>Define the path to find the Boost headers.
diff --git a/m4macros/ax_asio_for_bind10.m4 b/m4macros/ax_asio_for_bind10.m4
new file mode 100644
index 0000000..3b61d83
--- /dev/null
+++ b/m4macros/ax_asio_for_bind10.m4
@@ -0,0 +1,63 @@
+dnl @synopsis AX_ASIO_FOR_BIND10
+dnl
+dnl Test for the Asio header files intended to be used within BIND 10
+dnl
+dnl If no path to the installed Asio header files is given via the
+dnl --with-asio-include option, the macro searchs under
+dnl /usr/local /usr/pkg /opt /opt/local directories.
+dnl If it cannot detect any workable path for Asio, this macro treats it
+dnl as a fatal error (so it cannot be called if the availability of Asio
+dnl is optional).
+dnl
+dnl This macro calls:
+dnl
+dnl AC_SUBST(ASIO_INCLUDES)
+dnl
+
+AC_DEFUN([AX_ASIO_FOR_BIND10], [
+AC_LANG_SAVE
+AC_LANG([C++])
+
+#
+# Configure Asio header path
+#
+# If explicitly specified, use it.
+AC_ARG_WITH([asio-include],
+ AC_HELP_STRING([--with-asio-include=PATH],
+ [specify exact directory for Asio headers]),
+ [asio_include_path="$withval"])
+# If not specified, try some common paths.
+if test -z "$with_asio_include"; then
+ asiodirs="/usr/local /usr/pkg /opt /opt/local"
+ for d in $asiodirs
+ do
+ if test -f $d/include/asio/error_code.hpp; then
+ asio_include_path=$d/include
+ break
+ fi
+ done
+fi
+
+# TODO: this does not work, since Boost does not provide error_code.h
+#AC_ARG_WITH([boost-asio],
+# AC_HELP_STRING([--with-boost-asio]),
+# [boost_asio="$withval"])
+
+# Check the path with some specific headers.
+if test "${asio_include_path}" ; then
+ ASIO_INCLUDES="-I${asio_include_path}"
+fi
+#if test "${boost_asio}" = "yes" ; then
+# ASIO_INCLUDES="$ASIO_INCLUDES $BOOST_INCLUDES"
+#fi
+CPPFLAGS_SAVED="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $ASIO_INCLUDES"
+
+AC_CHECK_HEADERS([asio.hpp asio/deadline_timer.hpp asio/error.hpp asio/error_code.hpp asio/ip/udp.hpp asio/system_error.hpp],,
+ AC_MSG_ERROR([Missing required header file.]))
+
+AC_SUBST(ASIO_INCLUDES)
+
+CPPFLAGS="$CPPFLAGS_SAVED"
+AC_LANG_RESTORE
+])dnl AX_ASIO_FOR_BIND10
More information about the bind10-changes
mailing list