Commit fb95fbd3 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1991] added checks for FreeBSD build failure due to a ports bug.

parent 96e4248d
......@@ -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 <asio.hpp> right without this
......
......@@ -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 <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])
AC_SUBST(BOOST_INCLUDES)
CPPFLAGS="$CPPFLAGS_SAVED"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment