Browse Source

[master] for trac #1247: distcheck should enable gtest when possible

If --with-gtest defined on ./configure line, then do same for distcheck
target.
Jeremy C. Reed 13 years ago
parent
commit
3183039728
2 changed files with 7 additions and 0 deletions
  1. 4 0
      Makefile.am
  2. 3 0
      configure.ac

+ 4 - 0
Makefile.am

@@ -2,12 +2,16 @@ SUBDIRS = doc src tests
 USE_LCOV=@USE_LCOV@
 USE_LCOV=@USE_LCOV@
 LCOV=@LCOV@
 LCOV=@LCOV@
 GENHTML=@GENHTML@
 GENHTML=@GENHTML@
+DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@
 
 
 DISTCLEANFILES = config.report
 DISTCLEANFILES = config.report
 
 
 # When running distcheck target, do not install the configurations
 # When running distcheck target, do not install the configurations
 DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
 DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
 
 
+# Use same --with-gtest flag if set
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GTEST_CONFIGURE_FLAG)
+
 clean-cpp-coverage:
 clean-cpp-coverage:
 	@if [ $(USE_LCOV) = yes ] ; then \
 	@if [ $(USE_LCOV) = yes ] ; then \
 		$(LCOV) --directory . --zerocounters; \
 		$(LCOV) --directory . --zerocounters; \

+ 3 - 0
configure.ac

@@ -650,6 +650,7 @@ fi
 #
 #
 if test "$gtest_path" != "no"
 if test "$gtest_path" != "no"
 then
 then
+	DISTCHECK_GTEST_CONFIGURE_FLAG="--with-gtest=\"$gtest_path\""
 	if test "$gtest_path" != "yes"; then
 	if test "$gtest_path" != "yes"; then
 		GTEST_PATHS=$gtest_path
 		GTEST_PATHS=$gtest_path
 		if test -x "${gtest_path}/bin/gtest-config" ; then
 		if test -x "${gtest_path}/bin/gtest-config" ; then
@@ -690,8 +691,10 @@ else
 	GTEST_INCLUDES=
 	GTEST_INCLUDES=
 	GTEST_LDFLAGS=
 	GTEST_LDFLAGS=
 	GTEST_LDADD=
 	GTEST_LDADD=
+	DISTCHECK_GTEST_CONFIGURE_FLAG=
 fi
 fi
 AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
 AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
+AC_SUBST(DISTCHECK_GTEST_CONFIGURE_FLAG)
 AC_SUBST(GTEST_INCLUDES)
 AC_SUBST(GTEST_INCLUDES)
 AC_SUBST(GTEST_LDFLAGS)
 AC_SUBST(GTEST_LDFLAGS)
 AC_SUBST(GTEST_LDADD)
 AC_SUBST(GTEST_LDADD)