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

Submitted by Peter Hutterer on May 15, 2012, 11:07 p.m.

Details

Message ID 20120515230741.GA19756@yabbi.redhat.com
State Superseded
Headers show

Not browsing as part of any series.

Commit Message

Peter Hutterer May 15, 2012, 11:07 p.m.
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@who-t.net>
---
 m4/gtest.m4 |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

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++])

Comments

On 05/15/2012 04:07 PM, Peter Hutterer wrote:
> 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@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++])

Looks good to me. When I merge this I will also bump the serial number
at the top. This will ensure all users pull in the updated version of
the file when aclocal is run.

Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
On 05/15/2012 04:45 PM, Chase Douglas wrote:
> On 05/15/2012 04:07 PM, Peter Hutterer wrote:
>> 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@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++])
> 
> Looks good to me. When I merge this I will also bump the serial number
> at the top. This will ensure all users pull in the updated version of
> the file when aclocal is run.

I realized that this change is against the xorg-gtest gtest.m4 script,
not against the xorg-gtest.m4 aclocal script installed by xorg-gtest.
The patch applies to that script as well, so I ammended it in.

I have now pushed both commits in this thread.

Thanks!

- Chase