summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2011-12-13 17:21:24 -0800
committerChase Douglas <chase.douglas@ubuntu.com>2011-12-13 17:21:24 -0800
commit9a493fa6cbaa61582092b2484ab2cf95edcc8dcf (patch)
treefce7134fb32c0e1bff0c8efd0371103bf4a92424 /m4
parent9b93e8df1f350fd1fc3cd0888c0bf565bf3e18f0 (diff)
Link against pthread when checking for gtest library
Diffstat (limited to 'm4')
-rw-r--r--m4/gtest.m47
1 files changed, 6 insertions, 1 deletions
diff --git a/m4/gtest.m4 b/m4/gtest.m4
index 760638a..6471238 100644
--- a/m4/gtest.m4
+++ b/m4/gtest.m4
@@ -18,6 +18,11 @@ AC_DEFUN([AC_CHECK_GTEST],
AC_LANG_CPLUSPLUS
- AC_CHECK_LIB([gtest], [main])
+ # We need to get to the 5th arg to link with -lpthread too. Mimic the default
+ # AC_CHECK_LIB action when found.
+ AC_CHECK_LIB([gtest], [main],
+ [AC_DEFINE(HAVE_LIBGTEST) LIBS="-lgtest $LIBS"],
+ [],
+ [-lpthread])
]) # AC_CHECK_GTEST