BIND 10 trac1999, updated. a430ea9289e56be4d0749d587d70d2f419154e79 [trac1999] add new configure option --with-gtest-source=PATH (checkpoint)

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jul 6 02:49:53 UTC 2012


The branch, trac1999 has been updated
       via  a430ea9289e56be4d0749d587d70d2f419154e79 (commit)
      from  7197d4f537cf2e2931ad17370eeaf34154479dea (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 a430ea9289e56be4d0749d587d70d2f419154e79
Author: Jeremy C. Reed <jreed at ISC.org>
Date:   Thu Jul 5 21:48:16 2012 -0500

    [trac1999] add new configure option --with-gtest-source=PATH (checkpoint)
    
    This is incomplete and not all tested.
    
    Added --with-gtest-source=PATH for location of the googletest source.
    
    Also tested old method (--with-gtest not source) with gtest 1.6.0.

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

Summary of changes:
 configure.ac |   48 ++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 40 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 3fdb6fb..a67f372 100644
--- a/configure.ac
+++ b/configure.ac
@@ -454,20 +454,30 @@ AC_SUBST(PYCOVERAGE)
 AC_SUBST(PYCOVERAGE_RUN)
 AC_SUBST(USE_PYCOVERAGE)
 
+enable_gtest="no"
+
+AC_ARG_WITH([gtest-source],
+            [AS_HELP_STRING([--with-gtest-source=PATH],
+                            [location of the Googletest source, defaults to /usr/src/gtest])],
+            [enable_gtest="yes" ; GTEST_SOURCE="$withval";
+             GTEST_CPPFLAGS="-I$withval/include"],
+            [GTEST_SOURCE="/usr/src/gtest"])
+
+AC_ARG_WITH([gtest],
+	    [AS_HELP_STRING([--with-gtest=PATH],
+			    [specify a path to gtest header files (PATH/include) and library (PATH/lib)])],
+	[gtest_path="$withval"; enable_gtest="yes"], [gtest_path="no"])
+
 AC_ARG_WITH(lcov,
 [  --with-lcov[=PROGRAM]         enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
 
-AC_ARG_WITH(gtest,
-[  --with-gtest=PATH       specify a path to gtest header files (PATH/include) and library (PATH/lib)],
-    gtest_path="$withval", gtest_path="no")
-
 USE_LCOV="no"
 if test "$lcov" != "no"; then
 	# force gtest if not set
-	if test "$gtest_path" = "no"; then
+	if test "$enable_gtest" = "no"; then
 #		AC_MSG_ERROR("lcov needs gtest for test coverage report")
 		AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
-		gtest_path="yes"
+		enable_gtest="yes"
 	fi
 	if test "$lcov" != "yes"; then
 		LCOV=$lcov
@@ -813,9 +823,31 @@ AC_SUBST(MULTITHREADING_FLAG)
 #
 # Check availability of gtest, which will be used for unit tests.
 #
-if test "$gtest_path" != "no"
+if test "x$enable_gtest" = "xyes"
 then
-	DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=\"$gtest_path\""
+	DISTCHECK_GTEST_CONFIGURE_FLAG="--enable-gtest"
+
+	if test -n "$with_gtest_source" ; then
+
+          if test "x$GTEST_SOURCE" = "xyes" ; then
+
+            # If not specified, try some common paths.
+	    for d in /usr/src/gtest /usr/local /usr/pkg /opt /opt/local ; do
+		if test -f $d/gtest-all.cc -a $d/gtest_main.cc; then
+# TODO: set
+			break
+		fi
+	    done
+         else
+AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
+               [$GTEST_SOURCE/src/gtest_main.cc],
+               [have_gtest_source=yes],
+               [AC_MSG_ERROR(no gtest source but it was selected)])
+
+		DISTCHECK_GTEST_CONFIGURE_FLAG="$DISTCHECK_GTEST_CONFIGURE_FLAG $GTEST_SOURCE"
+          fi
+        fi
+
 	if test "$gtest_path" != "yes"; then
 		GTEST_PATHS=$gtest_path
 		if test -x "${gtest_path}/bin/gtest-config" ; then



More information about the bind10-changes mailing list