+dnl BOOST headers
+AC_CHECKING(for BOOST headers)
+CPPFLAGS="${CPPFLAGS_old} ${BOOST_CPPFLAGS}"
+
+boost_include_dir_ok=yes
+if test "x${BOOSTDIR}" != "x" ; then
+ AC_CHECK_FILE(${BOOSTDIR}/include/boost/shared_ptr.hpp,
+ boost_include_dir_ok=yes,
+ boost_include_dir_ok=no)
+fi
+
+BOOST_PROGRAM_OPTIONS_LIB=no
+if test "x${boost_include_dir_ok}" = "xyes" ; then
+ AC_CHECK_FILE(${BOOSTDIR}/include/boost/program_options.hpp,
+ BOOST_PROGRAM_OPTIONS_LIB=yes,
+ BOOST_PROGRAM_OPTIONS_LIB=no)
+fi
+AC_MSG_RESULT(for boost program_options tool: $BOOST_PROGRAM_OPTIONS_LIB)
+
+if test "x${boost_include_dir_ok}" = "xyes" ; then
+ AC_TRY_COMPILE([#include <boost/shared_ptr.hpp>],
+ [boost::shared_ptr<int>(new int)],
+ boost_headers_ok=yes,
+ boost_headers_ok=no)
+fi
+
+if test "x${boost_headers_ok}" = "xno" ; then
+ BOOST_CPPFLAGS="BOOST_CPPFLAGS_NOT_DEFINED"
+else
+ AC_MSG_RESULT(\$BOOST_CPPFLAGS = ${BOOST_CPPFLAGS})
+fi
+AC_MSG_RESULT(for boost headers: $boost_headers_ok)
+
+if test "x${boost_headers_ok}" = "xyes" ; then
+ dnl BOOST binaries
+ AC_CHECKING(for BOOST binaries)
+ boost_lib_dir_ok=yes
+ if test "x${BOOSTDIR}" != "x" ; then
+ for BOOST_LIBSUFFIX in ${SUFFIXES} ; do
+ test "${BOOST_LIBSUFFIX}" == "empty" && BOOST_LIBSUFFIX=""
+ AC_CHECK_FILE([${BOOSTDIR}/lib${LIB_SUFFIX}/libboost_thread${BOOST_LIBSUFFIX}.so],
+ [boost_lib_dir_ok=yes],
+ [AC_CHECK_FILE([${BOOSTDIR}/lib64/libboost_thread${BOOST_LIBSUFFIX}.so],
+ [boost_lib_dir_ok=yes; LIB_SUFFIX=64],
+ [boost_lib_dir_ok=no])
+ ])
+ if test "x${boost_lib_dir_ok}" = "xyes" ; then
+ break
+ fi
+ done
+ fi
+ if test "x${boost_lib_dir_ok}" = "xyes" ; then
+ LIBS="${LIBS_old} ${BOOST_LIBS} -lboost_thread${BOOST_LIBSUFFIX} -lboost_system${BOOST_LIBSUFFIX}"
+ AC_TRY_LINK([#include <boost/thread/thread.hpp>],
+ [struct TBody{ void operator()(){} }; boost::thread(TBody())],
+ boost_binaries_ok=yes,
+ boost_binaries_ok=no)
+ if test "x${boost_binaries_ok}" = "xyes" ; then
+ break
+ fi
+ fi
+fi
+
+if test "x${boost_binaries_ok}" = "xno" ; then
+ BOOST_LIBS="BOOST_LIBS_NOT_FOUND"
+ BOOST_LIBSUFFIX="-not-defined"