BIND 10 trac1442, updated. eb703a7e5b3749ca95a43c7582c9cccde564f123 [1442] only do threads check when there is no gtest-config
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Nov 30 17:54:33 UTC 2011
The branch, trac1442 has been updated
via eb703a7e5b3749ca95a43c7582c9cccde564f123 (commit)
from 7019db2a44f39897486eea618f4447c37dbabcf8 (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 eb703a7e5b3749ca95a43c7582c9cccde564f123
Author: Jelte Jansen <jelte at isc.org>
Date: Wed Nov 30 18:54:11 2011 +0100
[1442] only do threads check when there is no gtest-config
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 82 +++++++++++++++++++++++++++++----------------------------
1 files changed, 42 insertions(+), 40 deletions(-)
-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 22382e6..56a370c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,6 +717,48 @@ then
GTEST_LDFLAGS="-L$dir/lib"
GTEST_LDADD="-lgtest"
GTEST_FOUND="true"
+ # There is no gtest-config script, which
+ # is supposed to inform us whether we need
+ # pthreads as well (a gtest compile-time
+ # option). So we still need to test that
+ # manually.
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $GTEST_INCLUDES"
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $GTEST_LDFLAGS"
+ LIBS_SAVED=$LIBS
+ LIBS="$LIBS $GTEST_LDADD"
+ AC_MSG_CHECKING([Checking whether gtest tests need pthreads])
+ # First try to compile without pthreads
+ AC_TRY_LINK([
+ #include <gtest/gtest.h>
+ ],[
+ int i = 0;
+ char* c = NULL;
+ ::testing::InitGoogleTest(&i, &c);
+ return (0);
+ ],
+ [ AC_MSG_RESULT(no) ],
+ [
+ LIBS="$SAVED_LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
+ # Now try to compile with pthreads
+ 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"
+ ],
+ # Apparently we can't compile it at all
+ [ AC_MSG_ERROR(unable to compile with gtest) ])
+ ])
+ CPPFLAGS=$CPPFLAGS_SAVED
+ LDFLAGS=$LDFLAGS_SAVED
+ LIBS=$LIBS_SAVED
break
fi
done
@@ -724,46 +766,6 @@ then
if test "${GTEST_FOUND}" != "true"; then
AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
fi
- # 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.
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $GTEST_INCLUDES"
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $GTEST_LDFLAGS"
- LIBS_SAVED=$LIBS
- LIBS="$LIBS $GTEST_LDADD"
- AC_MSG_CHECKING([Checking whether gtest tests need -lpthread])
- # First try to compile without pthreads
- AC_TRY_LINK([
- #include <gtest/gtest.h>
- ],[
- int i = 0;
- char* c = NULL;
- ::testing::InitGoogleTest(&i, &c);
- return (0);
- ],
- [ AC_MSG_RESULT(no) ],
- [
- LIBS="$SAVED_LIBS $GTEST_LDADD $PTHREAD_LDFLAGS"
- # Now try to compile with pthreads
- 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"
- ],
- # Apparently we can't compile it at all
- [ AC_MSG_ERROR(unable to compile with gtest) ])
- ])
- CPPFLAGS=$CPPFLAGS_SAVED
- LDFLAGS=$LDFLAGS_SAVED
- LIBS=$LIBS_SAVED
else
GTEST_INCLUDES=
GTEST_LDFLAGS=
More information about the bind10-changes
mailing list