[svn] commit: r3849 - in /branches/trac436: configure.ac src/lib/nsas/tests/Makefile.am
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Dec 15 17:11:26 UTC 2010
Author: jinmei
Date: Wed Dec 15 17:11:23 2010
New Revision: 3849
Log:
committing the initial proposed patch to the branch.
Modified:
branches/trac436/configure.ac
branches/trac436/src/lib/nsas/tests/Makefile.am
Modified: branches/trac436/configure.ac
==============================================================================
--- branches/trac436/configure.ac (original)
+++ branches/trac436/configure.ac Wed Dec 15 17:11:23 2010
@@ -322,6 +322,36 @@
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.
+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: branches/trac436/src/lib/nsas/tests/Makefile.am
==============================================================================
--- branches/trac436/src/lib/nsas/tests/Makefile.am (original)
+++ branches/trac436/src/lib/nsas/tests/Makefile.am Wed Dec 15 17:11:23 2010
@@ -47,6 +47,9 @@
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
+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
More information about the bind10-changes
mailing list