BIND 10 trac1442, updated. 15dffb02f179974c6726f16aff586c49eec8c7ca [1442] conditionally check whether gtest needs pthread

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Nov 30 14:27:50 UTC 2011


The branch, trac1442 has been updated
       via  15dffb02f179974c6726f16aff586c49eec8c7ca (commit)
      from  0737908f9e7cb615f80354131dca4df1a8c0bff6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 15dffb02f179974c6726f16aff586c49eec8c7ca
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Nov 30 15:27:36 2011 +0100

    [1442] conditionally check whether gtest needs pthread

-----------------------------------------------------------------------

Summary of changes:
 configure.ac |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index d2b1de9..d54cad2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -724,8 +724,37 @@ then
 	if test "${GTEST_FOUND}" != "true"; then
 		AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
 	fi
-	# TODO: check whether this is needed (depends on gtest compile flags)
-	GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
+	# On some systems, there is no gtest-config script, which is supposed
+	# to inform us whether we need -lpthread as well (a gtest compile-time
+	# option). So we still need to test that manually
+	LIBS_SAVED=$LIBS
+	LIBS="$LIBS $GTEST_LDADD"
+	AC_MSG_CHECKING([Checking whether gtest tests need -lpthread])
+	AC_TRY_LINK([
+		#include <gtest/gtest.h>
+		],[
+			int i = 0;
+			char* c = NULL;
+			::testing::InitGoogleTest(&i, &c);
+			return (0);
+		],
+		[ AC_MSG_RESULT(no) ],
+		[
+			LIBS="$LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
+			AC_TRY_LINK([
+				#include <gtest/gtest.h>
+				],[
+					int i = 0;
+					char* c = NULL;
+					::testing::InitGoogleTest(&i, &c);
+					return (0);
+				],
+				[ AC_MSG_RESULT(yes)
+				  GTEST_LDADD="$GTEST_LDADD $PTHREAD_LDFLAGS"
+				],
+				[ AC_MSG_ERROR(unable to compile with gtest) ])
+	])
+	LIBS=$LIBS_SAVED
 else
 	GTEST_INCLUDES=
 	GTEST_LDFLAGS=




More information about the bind10-changes mailing list