[mathic] 54/62: 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
Wed Apr 1 11:36:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository mathic.

commit a33fd790cf08044b6f4a90db7faf8f79d6b02473
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Thu Mar 21 19:14:28 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 | 25 +++++++++++++++++++------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 92de34b..a3ee648 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,7 +57,7 @@ pkgconfig_DATA = build/autotools/mathic-$(MATHIC_API_VERSION).pc
 # 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
 
 # tell automake what programs are there that are not built automatically
 EXTRA_PROGRAMS = pqsim divsim
@@ -89,10 +89,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)
 unittest_LDFLAGS= $(top_builddir)/libmathic-$(MATHIC_API_VERSION).la
 
diff --git a/configure.ac b/configure.ac
index 5991eb9..841453a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl AC_INIT sets up autoconf and must be first macro.
 AC_INIT([mathic], [1.0]) # package, version, bug-report-email
 
 # Check that memtailor is installed and locate it
-PKG_CHECK_MODULES([DEPS], [memtailor-1.0])
+PKG_CHECK_MODULES([MEMTAILOR], [memtailor-1.0])
 
 dnl ----- The gtest dependency
 
@@ -12,10 +12,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])
@@ -35,6 +35,12 @@ AS_IF([test "x$with_gtest" == "xdownload"],
       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], [], [
@@ -44,7 +50,14 @@ 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")
+
+DEPS_CFLAGS="$MEMTAILOR_CFLAGS $GTEST_CFLAGS"
+DEPS_LIBS="$MEMTAILOR_LIBS $GTEST_LIBS"
+AC_SUBST(DEPS_CFLAGS)
+AC_SUBST(DEPS_LIBS)
 
 # set up information about directories
 AC_CONFIG_MACRO_DIR([build/autotools/m4]) # directory of extra autoconf macroes

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathic.git



More information about the debian-science-commits mailing list