1 dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 dnl This library is free software; you can redistribute it and/or
5 dnl modify it under the terms of the GNU Lesser General Public
6 dnl License as published by the Free Software Foundation; either
7 dnl version 2.1 of the License.
9 dnl This library is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 dnl Lesser General Public License for more details.
14 dnl You should have received a copy of the GNU Lesser General Public
15 dnl License along with this library; if not, write to the Free Software
16 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 AC_DEFUN([CHECK_BOOST],[
24 AC_CHECKING(for BOOST Library)
26 AC_REQUIRE([ENABLE_PTHREADS])dnl
35 AC_CHECKING(for BOOST location)
37 [AC_HELP_STRING([--with-boost=DIR],[root directory path to BOOST library installation])],
39 AC_MSG_RESULT("select $withval as path to BOOST library")
42 AC_MSG_RESULT(\$BOOSTDIR = ${BOOSTDIR})
44 CPPFLAGS_old="${CPPFLAGS}"
47 if test "x${BOOSTDIR}" != "x" ; then
48 BOOST_CPPFLAGS="-I${BOOSTDIR}/include"
49 BOOST_LIBS="-L${BOOSTDIR}/lib"
57 AC_CHECKING(for BOOST headers)
58 CPPFLAGS="${CPPFLAGS_old} ${BOOST_CPPFLAGS}"
60 boost_include_dir_ok=yes
61 if test "x${BOOSTDIR}" != "x" ; then
62 AC_CHECK_FILE(${BOOSTDIR}/include/boost/shared_ptr.hpp,
63 boost_include_dir_ok=yes,
64 boost_include_dir_ok=no)
67 if test "x${boost_include_dir_ok}" = "xyes" ; then
68 AC_TRY_COMPILE([#include <boost/shared_ptr.hpp>],
69 [boost::shared_ptr<int>(new int)],
74 if test "x${boost_headers_ok}" = "xno" ; then
75 BOOST_CPPFLAGS="BOOST_CPPFLAGS_NOT_DEFINED"
77 AC_MSG_RESULT(\$BOOST_CPPFLAGS = ${BOOST_CPPFLAGS})
79 AC_MSG_RESULT(for boost headers: $boost_headers_ok)
81 if test "x${boost_headers_ok}" = "xyes" ; then
83 AC_CHECKING(for BOOST binaries)
85 if test "x${BOOSTDIR}" != "x" ; then
86 AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread${BOOST_LIBSUFFIX}.so,
89 if test "x${boost_lib_dir_ok}" = "xno" ; then
91 AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread${BOOST_LIBSUFFIX}.so,
96 if test "x${boost_lib_dir_ok}" = "xyes" ; then
97 LIBS="${LIBS_old} ${BOOST_LIBS} -lboost_thread${BOOST_LIBSUFFIX}"
98 AC_TRY_LINK([#include <boost/thread/thread.hpp>],
99 [struct TBody{ void operator()(){} }; boost::thread(TBody())],
100 boost_binaries_ok=yes,
101 boost_binaries_ok=no)
102 if test "x${boost_binaries_ok}" = "xno" ; then
104 LIBS="${LIBS_old} ${BOOST_LIBS} -lboost_thread${BOOST_LIBSUFFIX}"
105 AC_TRY_LINK([#include <boost/thread/thread.hpp>],
106 [struct TBody{ void operator()(){} }; boost::thread(TBody())],
107 boost_binaries_ok=yes,
108 boost_binaries_ok=no)
113 if test "x${boost_binaries_ok}" = "xno" ; then
114 BOOST_LIBS="BOOST_LIBS_NOT_FOUND"
115 BOOST_LIBSUFFIX="-not-defined"
117 AC_MSG_RESULT(\$BOOST_LIBSUFFIX = ${BOOST_LIBSUFFIX})
118 AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS})
120 AC_MSG_RESULT(for boost binaries: $boost_binaries_ok)
122 CPPFLAGS="${CPPFLAGS_old}"
125 if test "x${boost_headers_ok}" = "xyes" ; then
126 if test "x${boost_binaries_ok}" = "xyes" ; then
131 AC_MSG_RESULT(for boost: $boost_ok)
133 AC_SUBST(BOOST_CPPFLAGS)
134 AC_SUBST(BOOST_LIBSUFFIX)