[svn] commit: r3868 - in /trunk: ./ configure.ac src/bin/bind10/bind10.py.in src/lib/nsas/tests/Makefile.am
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 16 09:27:52 UTC 2010
Author: jinmei
Date: Thu Dec 16 09:27:51 2010
New Revision: 3868
Log:
merged trunk #436: urgent care fix for the dependency issue between libboost_thread and boost::mutex.
Modified:
trunk/ (props changed)
trunk/configure.ac
trunk/src/bin/bind10/bind10.py.in (props changed)
trunk/src/lib/nsas/tests/Makefile.am
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Dec 16 09:27:51 2010
@@ -322,6 +322,40 @@
AC_MSG_ERROR([Missing required header files.]))
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BOOST_INCLUDES)
+
+# Using boost::mutex can result in requiring libboost_thread with older
+# versions of Boost. We'd like to avoid relying on a compiled Boost library
+# whenever possible, so we need to check for it step by step.
+#
+# NOTE: another fix of this problem is to simply require newer versions of
+# boost. If we choose that solution we should simplify the following tricky
+# checks accordingly and all Makefile.am's that refer to NEED_LIBBOOST_THREAD.
+AC_MSG_CHECKING(for boost::mutex)
+CPPFLAGS_SAVES="$CPPFLAGS"
+LIBS_SAVES="$LIBS"
+CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS"
+need_libboost_thread=0
+AC_TRY_LINK([
+#include <boost/thread.hpp>
+],[
+boost::mutex m;
+],
+ [ AC_MSG_RESULT(yes (without libboost_thread)) ],
+ [ LIBS=" $LIBS -lboost_thread"
+ AC_TRY_LINK([
+#include <boost/thread.hpp>
+],[
+boost::mutex m;
+],
+ [ AC_MSG_RESULT(yes (with libboost_thread))
+ need_libboost_thread=1 ],
+ [ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
+Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support. You may want to check the availability of the library or to upgrade Boost.])
+ ])])
+CPPFLAGS="$CPPFLAGS_SAVES"
+LIBS="$LIBS_SAVES"
+AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
#
# Check availability of gtest, which will be used for unit tests.
Modified: trunk/src/lib/nsas/tests/Makefile.am
==============================================================================
--- trunk/src/lib/nsas/tests/Makefile.am (original)
+++ trunk/src/lib/nsas/tests/Makefile.am Thu Dec 16 09:27:51 2010
@@ -48,6 +48,11 @@
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
+# NOTE: we may have to clean up this hack later (see the note in configure.ac)
+if NEED_LIBBOOST_THREAD
+run_unittests_LDADD += -lboost_thread
+endif
+
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
More information about the bind10-changes
mailing list