BIND 10 trac1991, updated. 4323bf82f07269a4f99a951b659749a5a1234ef2 [1991] make sure the check is with -Werror and only for g++-variants

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Dec 28 02:37:23 UTC 2012


The branch, trac1991 has been updated
       via  4323bf82f07269a4f99a951b659749a5a1234ef2 (commit)
      from  fb95fbd37114f9c8fed764979cc5dc9124e3439c (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 4323bf82f07269a4f99a951b659749a5a1234ef2
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Dec 27 18:36:49 2012 -0800

    [1991] make sure the check is with -Werror and only for g++-variants

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

Summary of changes:
 configure.ac                    |    4 ++--
 m4macros/ax_boost_for_bind10.m4 |   28 +++++++++++++++++++---------
 2 files changed, 21 insertions(+), 11 deletions(-)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index b474d0f..1868c9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -846,8 +846,8 @@ if test "$BOOST_OFFSET_PTR_FAILURE" = "yes"; then
 fi
 
 # There's a known bug in FreeBSD ports for Boost that would trigger a false
-# warning in build.
-if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes"; then
+# warning in build with g++ and -Werror
+if test "$BOOST_NUMERIC_CAST_WOULDFAIL" = "yes" -a X"$with_werror" = X1; then
     AC_MSG_ERROR([Failed to compile a required header file.  If you are using FreeBSD and Boost installed via ports, retry with specifying --without-werror.  See the ChangeLog entry for Trac no. 1991 for more details.])
 fi
 
diff --git a/m4macros/ax_boost_for_bind10.m4 b/m4macros/ax_boost_for_bind10.m4
index 55e3c89..1ce367e 100644
--- a/m4macros/ax_boost_for_bind10.m4
+++ b/m4macros/ax_boost_for_bind10.m4
@@ -85,15 +85,25 @@ AC_TRY_COMPILE([
 
 # Detect build failure case known to happen with Boost installed via
 # FreeBSD ports
-AC_MSG_CHECKING([Boost numeric_cast compiles])
-AC_TRY_COMPILE([
-#include <boost/numeric/conversion/cast.hpp>
-],[
-return (boost::numeric_cast<short>(0));
-],[AC_MSG_RESULT(yes)
-   BOOST_NUMERIC_CAST_WOULDFAIL=no],
-  [AC_MSG_RESULT(no)
-   BOOST_NUMERIC_CAST_WOULDFAIL=yes])
+if test "X$GXX" = "Xyes"; then
+   CXXFLAGS_SAVED="$CXXFLAGS"
+   CXXFLAGS="$CXXFLAGS -Werror"
+
+   AC_MSG_CHECKING([Boost numeric_cast compiles with -Werror])
+   AC_TRY_COMPILE([
+   #include <boost/numeric/conversion/cast.hpp>
+   ],[
+   return (boost::numeric_cast<short>(0));
+   ],[AC_MSG_RESULT(yes)
+      BOOST_NUMERIC_CAST_WOULDFAIL=no],
+   [AC_MSG_RESULT(no)
+    BOOST_NUMERIC_CAST_WOULDFAIL=yes])
+
+   CXXFLAGS="$CXXFLAGS_SAVED"
+else
+  # This doesn't matter for non-g++
+  BOOST_NUMERIC_CAST_WOULDFAIL=no
+fi
 
 AC_SUBST(BOOST_INCLUDES)
 



More information about the bind10-changes mailing list