[mathicgb] 198/393: Fixed missing include directive for finding gtest in a non-standard location. Also, configure now detects failure to download gtest and continues without gtest in that case.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:58:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit 5726f281b9bbd84f83f58770ba16c8a73c28b8d3
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Thu Mar 21 19:14:43 2013 +0100
Fixed missing include directive for finding gtest in a non-standard location. Also, configure now detects failure to download gtest and continues without gtest in that case.
---
Makefile.am | 7 ++-----
configure.ac | 26 +++++++++++++++++---------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index a51e4b3..252a3fe 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -74,7 +74,7 @@ libmathicgb_la_SOURCES = src/mathicgb/BjarkeGeobucket2.cpp \
# When making a distribution file, Automake knows to include all files
# that are necessary to build the project. EXTRA_DIST specifies files
# to include beyond those used in the build process.
-EXTRA_DIST = autogen.sh libs/gtest
+EXTRA_DIST = autogen.sh
bin_PROGRAMS = mgb
@@ -96,10 +96,7 @@ TESTS=unittest
check_PROGRAMS=$(TESTS)
unittest_CPPFLAGS = $(DEPS_CFLAGS)
-unittest_CXXFLAGS=\
- -I$(top_srcdir)/libs/gtest/include\
- -I$(top_srcdir)/libs/gtest/\
- -I$(top_srcdir)/src/ -std=gnu++0x
+unittest_CXXFLAGS= -I$(top_srcdir)/src/ -std=gnu++0x
unittest_LDADD = $(DEPS_LIBS) libmathicgb.la $(DEPS_LIBS)
test_LIBS=
diff --git a/configure.ac b/configure.ac
index ede60d9..2979d70 100755
--- a/configure.ac
+++ b/configure.ac
@@ -13,10 +13,10 @@ AC_ARG_WITH([gtest], AS_HELP_STRING(
gtest if a gtest source directory cannot be found. Per the recommendation
of the gtest documentation, gtest is compiled with the tests, so an
installed gtest is not usable - you need the gtest source. GTEST_PATH
- indicates where to look for gtest and it is also where GTEST_PATH
- will be downloaded to if not found. The default path is \$srcdir/libs so
- that gtest needs to be at \$srcdir/libs/gtest/ where \$srcdir is the
- directory that contains configure.ac.]
+ indicates where to look for gtest and it is also where gtest
+ will be downloaded to if not found. The default path is srcdir/libs so
+ that gtest needs to be at srcdir/libs/gtest/ where srcdir is the
+ base of the directory being configured from.]
))
AC_MSG_CHECKING([for gtest])
@@ -30,12 +30,18 @@ AS_IF([test "x$with_gtest" == "xdownload"],
(
cd $GTEST_PATH;
rm -rf gtest-$GTEST_VERSION.zip
- wget http://googletest.googlecode.com/files/gtest-$GTEST_VERSION.zip;
+ wget http://googletest.googlfecode.com/files/gtest-$GTEST_VERSION.zip;
unzip gtest-$GTEST_VERSION.zip;
rm gtest-$GTEST_VERSION.zip
rm -rf gtest/
mv gtest-$GTEST_VERSION/ gtest/
);
+ if test ! -e "$GTEST_PATH/gtest/src/gtest-all.cc"; then
+ AC_MSG_WARN([Failed to download or extract gtest.]);
+ with_gtest="no";
+ else
+ with_gtest="yes";
+ fi
])],
[test "x$with_gtest" == "xyes"], [
AC_CHECK_FILE([$GTEST_PATH/gtest/src/gtest-all.cc], [], [
@@ -45,7 +51,9 @@ AS_IF([test "x$with_gtest" == "xdownload"],
[test "x$with_gtest" == "xno"], [],
[AC_MSG_ERROR([invalid value $with_gtest for with_gtest.])]
)
-AM_CONDITIONAL(with_gtest, test "x$with_gtest" != "xno")
+AS_IF([test "x$with_gtest" == "xyes"],
+ [GTEST_CFLAGS="-I`cd $GTEST_PATH/gtest/include; echo $PWD` -I`cd $GTEST_PATH/gtest/; echo $PWD`"]);
+AM_CONDITIONAL(with_gtest, test "x$with_gtest" == "xyes")
dnl ----- The TBB dependency
AC_ARG_WITH([tbb], AS_HELP_STRING(
@@ -65,9 +73,9 @@ AS_IF(
[test "x$with_tbb" == "xno"], [TBB_CFLAGS="-DMATHICGB_NO_TBB"],
[AC_MSG_ERROR([invalid value $with_tbb for with_tbb.])]
)
-
-DEPS_CFLAGS="$MEMTAILOR_CFLAGS $MATHIC_CFLAGS $TBB_CFLAGS"
-DEPS_LIBS="$MEMTAILOR_LIBS $MATHIC_LIBS $TBB_LIBS -lrt"
+
+DEPS_CFLAGS="$MEMTAILOR_CFLAGS $MATHIC_CFLAGS $TBB_CFLAGS $GTEST_CFLAGS"
+DEPS_LIBS="$MEMTAILOR_LIBS $MATHIC_LIBS $TBB_LIBS $GTEST_LIBS -lrt"
AC_SUBST(DEPS_CFLAGS)
AC_SUBST(DEPS_LIBS)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list