From: JINMEI Tatuya Date: Fri, 28 Dec 2012 02:14:36 +0000 (-0800) Subject: [1991] added checks for FreeBSD build failure due to a ports bug. X-Git-Tag: bind10-1.0.0-rc-release~95^2~21^2~8^2~4^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb95fbd37114f9c8fed764979cc5dc9124e3439c;p=thirdparty%2Fkea.git [1991] added checks for FreeBSD build failure due to a ports bug. --- diff --git a/configure.ac b/configure.ac index 94d57a540e..b474d0f6fb 100644 --- a/configure.ac +++ b/configure.ac @@ -841,10 +841,17 @@ LIBS=$LIBS_SAVED AX_BOOST_FOR_BIND10 # Boost offset_ptr is required in one library and not optional right now, so # we unconditionally fail here if it doesn't work. -if test "$BOOST_OFFSET_PTR_FAILURE" == "yes"; then +if test "$BOOST_OFFSET_PTR_FAILURE" = "yes"; then AC_MSG_ERROR([Failed to compile a required header file. Try upgrading Boost to 1.44 or higher (when using clang++) or specifying --without-werror. See the ChangeLog entry for Trac no. 2147 for more details.]) 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 + 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 + +# Add some default CPP flags needed for Boost, identified by the AX macro. CPPFLAGS="$CPPFLAGS_SAVES $CPPFLAGS_BOOST_THREADCONF" # I can't get some of the #include right without this diff --git a/m4macros/ax_boost_for_bind10.m4 b/m4macros/ax_boost_for_bind10.m4 index 9b48a4821b..55e3c890b6 100644 --- a/m4macros/ax_boost_for_bind10.m4 +++ b/m4macros/ax_boost_for_bind10.m4 @@ -19,8 +19,10 @@ dnl AC_SUBST(BOOST_INCLUDES) dnl dnl And possibly sets: dnl CPPFLAGS_BOOST_THREADCONF should be added to CPPFLAGS by caller -dnl BOOST_OFFSET_PTR_WOULDFAIL set to yes if offset_ptr would cause build -dnl error; otherwise set to no +dnl BOOST_OFFSET_PTR_WOULDFAIL set to "yes" if offset_ptr would cause build +dnl error; otherwise set to "no" +dnl BOOST_NUMERIC_CAST_WOULDFAIL set to "yes" if numeric_cast would cause +dnl build error; otherwise set to "no" dnl AC_DEFUN([AX_BOOST_FOR_BIND10], [ @@ -81,6 +83,18 @@ AC_TRY_COMPILE([ [AC_MSG_RESULT(no) BOOST_OFFSET_PTR_WOULDFAIL=yes]) +# Detect build failure case known to happen with Boost installed via +# FreeBSD ports +AC_MSG_CHECKING([Boost numeric_cast compiles]) +AC_TRY_COMPILE([ +#include +],[ +return (boost::numeric_cast(0)); +],[AC_MSG_RESULT(yes) + BOOST_NUMERIC_CAST_WOULDFAIL=no], + [AC_MSG_RESULT(no) + BOOST_NUMERIC_CAST_WOULDFAIL=yes]) + AC_SUBST(BOOST_INCLUDES) CPPFLAGS="$CPPFLAGS_SAVED"