[PATCH xorg-gtest] m4: if a source is specified, use that for the include path

Peter Hutterer peter.hutterer at who-t.net
Tue May 15 16:07:41 PDT 2012


Don't require users to specify both source and include path. We can assume
that if they have the source at a certain location, they want those headers
too.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 m4/gtest.m4 |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/m4/gtest.m4 b/m4/gtest.m4
index 2de334c..6722fef 100644
--- a/m4/gtest.m4
+++ b/m4/gtest.m4
@@ -25,17 +25,17 @@
 # source location respectively.
 AC_DEFUN([CHECK_GTEST],
 [
-  AC_ARG_WITH([gtest-include-path],
-              [AS_HELP_STRING([--with-gtest-include-path],
-                              [location of the Google test headers])],
-              [GTEST_CPPFLAGS="-I$withval"])
-
   AC_ARG_WITH([gtest-source-path],
               [AS_HELP_STRING([--with-gtest-source-path],
                               [location of the Google test sources, defaults to /usr/src/gtest])],
-              [GTEST_SOURCE="$withval"],
+              [GTEST_SOURCE="$withval"; GTEST_CPPFLAGS="-I$withval/include"],
               [GTEST_SOURCE="/usr/src/gtest"])
 
+  AC_ARG_WITH([gtest-include-path],
+              [AS_HELP_STRING([--with-gtest-include-path],
+                              [location of the Google test headers])],
+              [GTEST_CPPFLAGS="-I$withval"])
+
   GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
 
   AC_LANG_PUSH([C++])
-- 
1.7.10.1



More information about the xorg-devel mailing list