BIND 10 master, updated. e52fc6f0961bb5c54548760b7363b6ccb2bc1020 Merge branch 'trac2026'

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Jan 14 13:20:10 UTC 2014


The branch, master has been updated
       via  e52fc6f0961bb5c54548760b7363b6ccb2bc1020 (commit)
       via  e3913c4a5ce52f94fcde221e5c9412970eb5f251 (commit)
      from  e64974ccce21ce592789ca36ba887ffddf2a1486 (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 e52fc6f0961bb5c54548760b7363b6ccb2bc1020
Merge: e64974c e3913c4
Author: Mukund Sivaraman <muks at isc.org>
Date:   Tue Jan 14 18:44:48 2014 +0530

    Merge branch 'trac2026'

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                       |   19 ++++++++++++++
 src/lib/dns/python/.gitignore                      |    1 +
 src/lib/dns/python/Makefile.am                     |    3 ++-
 src/lib/dns/python/pydnspp_common.h                |    7 ++----
 .../dns/python/pydnspp_config.h.in}                |   26 ++++++++------------
 5 files changed, 34 insertions(+), 22 deletions(-)
 copy src/{bin/d2/d2_asio.h => lib/dns/python/pydnspp_config.h.in} (66%)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5bfd318..afa9ade 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,6 +410,24 @@ fi
 AC_SUBST(PYTHON_LIB)
 LDFLAGS=$LDFLAGS_SAVED
 
+# Python 3.2 changed the return type of internal hash function to
+# Py_hash_t and some platforms (such as Solaris) strictly check for long
+# vs Py_hash_t. So we detect and use the appropriate return type.
+# Remove this test (and associated changes in pydnspp_config.h.in) when
+# we require Python 3.2.
+have_py_hash_t=0
+CPPFLAGS_SAVED="$CPPFLAGS"
+CPPFLAGS=${PYTHON_INCLUDES}
+AC_MSG_CHECKING(for Py_hash_t)
+AC_TRY_COMPILE([#include <Python.h>
+                Py_hash_t h;],,
+    [AC_MSG_RESULT(yes)
+     have_py_hash_t=1],
+    [AC_MSG_RESULT(no)])
+CPPFLAGS="$CPPFLAGS_SAVED"
+HAVE_PY_HASH_T=$have_py_hash_t
+AC_SUBST(HAVE_PY_HASH_T)
+
 # Check for the setproctitle module
 if test "$setproctitle_check" = "yes" ; then
     AC_MSG_CHECKING(for setproctitle module)
@@ -1478,6 +1496,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
                  src/lib/dns/gen-rdatacode.py
                  src/lib/dns/Makefile
                  src/lib/dns/python/Makefile
+                 src/lib/dns/python/pydnspp_config.h
                  src/lib/dns/python/tests/Makefile
                  src/lib/dns/tests/Makefile
                  src/lib/dns/tests/testdata/Makefile
diff --git a/src/lib/dns/python/.gitignore b/src/lib/dns/python/.gitignore
index 025ddd1..0713cf8 100644
--- a/src/lib/dns/python/.gitignore
+++ b/src/lib/dns/python/.gitignore
@@ -1,2 +1,3 @@
 /rrclass_constants_inc.cc
 /rrtype_constants_inc.cc
+/pydnspp_config.h
diff --git a/src/lib/dns/python/Makefile.am b/src/lib/dns/python/Makefile.am
index a221bfe..9654239 100644
--- a/src/lib/dns/python/Makefile.am
+++ b/src/lib/dns/python/Makefile.am
@@ -5,7 +5,8 @@ AM_CPPFLAGS += $(BOOST_INCLUDES)
 AM_CXXFLAGS = $(B10_CXXFLAGS)
 
 lib_LTLIBRARIES = libb10-pydnspp.la
-libb10_pydnspp_la_SOURCES = pydnspp_common.cc pydnspp_common.h pydnspp_towire.h
+libb10_pydnspp_la_SOURCES = pydnspp_common.cc pydnspp_common.h
+libb10_pydnspp_la_SOURCES += pydnspp_config.h pydnspp_towire.h
 libb10_pydnspp_la_SOURCES += name_python.cc name_python.h
 libb10_pydnspp_la_SOURCES += nsec3hash_python.cc nsec3hash_python.h
 libb10_pydnspp_la_SOURCES += rrset_python.cc rrset_python.h
diff --git a/src/lib/dns/python/pydnspp_common.h b/src/lib/dns/python/pydnspp_common.h
index 8e498b3..9c27cfd 100644
--- a/src/lib/dns/python/pydnspp_common.h
+++ b/src/lib/dns/python/pydnspp_common.h
@@ -15,6 +15,8 @@
 #ifndef LIBDNS_PYTHON_COMMON_H
 #define LIBDNS_PYTHON_COMMON_H 1
 
+#include <dns/python/pydnspp_config.h>
+
 #include <Python.h>
 
 #include <boost/static_assert.hpp>
@@ -60,11 +62,6 @@ int addClassVariable(PyTypeObject& c, const char* name, PyObject* obj);
 /// \return true on success, false on failure
 bool initClass(PyTypeObject& type, const char* name, PyObject* mod);
 
-// Short term workaround for unifying the return type of tp_hash
-#if PY_MINOR_VERSION < 2
-typedef long Py_hash_t;
-#endif
-
 /// \brief Convert a hash value of arbitrary type to a Python hash value.
 ///
 /// This templated function is a convenient wrapper to produce a valid hash
diff --git a/src/lib/dns/python/pydnspp_config.h.in b/src/lib/dns/python/pydnspp_config.h.in
new file mode 100644
index 0000000..6326e8c
--- /dev/null
+++ b/src/lib/dns/python/pydnspp_config.h.in
@@ -0,0 +1,25 @@
+// Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef LIBDNS_PYTHON_CONFIG_H
+#define LIBDNS_PYTHON_CONFIG_H 1
+
+// Short term workaround for unifying the return type of tp_hash.
+// Remove this test (and associated changes in configure.ac) when we
+// require Python 3.2.
+#if (!(@HAVE_PY_HASH_T@))
+typedef long Py_hash_t;
+#endif
+
+#endif // LIBDNS_PYTHON_CONFIG_H



More information about the bind10-changes mailing list