[PATCH xorg-gtest 8/8] Ship xorg-gtest.m4 and Makefile-xorg-gtest.am

Chase Douglas chase.douglas at canonical.com
Fri Mar 9 13:28:29 PST 2012


On 03/09/2012 12:45 PM, Chase Douglas wrote:
> See README for instructions on how to use them.
>
> Signed-off-by: Chase Douglas<chase.douglas at canonical.com>
> ---
>   Makefile.am                |    2 +-
>   README                     |   43 +++++++++++++++--
>   aclocal/Makefile.am        |   27 ++++++++++
>   aclocal/xorg-gtest.m4      |  113 ++++++++++++++++++++++++++++++++++++++++++++
>   configure.ac               |    3 +
>   src/Makefile-xorg-gtest.am |   60 +++++++++++++++++++++++
>   src/Makefile.am            |    5 ++-
>   xorg-gtest.pc.in           |    1 +
>   8 files changed, 248 insertions(+), 6 deletions(-)
>   create mode 100644 aclocal/Makefile.am
>   create mode 100644 aclocal/xorg-gtest.m4
>   create mode 100644 src/Makefile-xorg-gtest.am
>
> diff --git a/Makefile.am b/Makefile.am
> index 2542b44..8e0a0c6 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -23,7 +23,7 @@
>   # SOFTWARE.
>   #
>
> -SUBDIRS = data doc include src examples
> +SUBDIRS = aclocal data doc include src examples
>
>   pkgconfigdir = $(libdir)/pkgconfig
>   pkgconfig_DATA = xorg-gtest.pc
> diff --git a/README b/README
> index 6b79f05..c5a3216 100644
> --- a/README
> +++ b/README
> @@ -1,4 +1,4 @@
> -X.Org dummy testing environment for Google Test
> +X.Org GTest testing environment for Google Test
>   ===============================================
>
>   Provides a Google Test environment for starting and stopping
> @@ -7,6 +7,41 @@ environment is defined in header environment.h. Please refer to
>   the Google test documentation for information on how to add a custom
>   environment.
>
> -Moreover, a custom main()-function that takes care of setting up the
> -environment is provided in libxtestingenvironment_main.a. This library can be
> -used as a replacement for libgtest_main.a
> +Moreover, a custom main() function that takes care of setting up the
> +environment is provided in xorg-gtest_main.cpp. This can be used as a
> +replacement for libgtest_main.a
> +
> +Using X.org GTest in a project
> +==============================
> +
> +The X.org GTest does not provide precompiled libraries. Each project must build
> +the X.org GTest sources. To facilitate this, aclocal and automake include files
> +are provided.
> +
> +Add the following line to the top level Makefile.am for your project:
> +
> +ACLOCAL_AMFLAGS = -I m4 --install
> +
> +This will ensure the latest xorg-gtest.m4 macro installed on your system is
> +copied into aclocal/.
> +
> +Add the following in autogen.sh above the call to autoreconf:
> +
> +echo Copying Makefile-xorg-gtest.am
> +XORG_GTEST_MAKEFILE=`pkg-config --variable=makefile --print-errors xorg-gtest` || exit 1
> +cp $XORG_GTEST_MAKEFILE $srcdir/ || exit 1

After some more thinking, I realized that this will break building 
unless you have xorg-gtest installed. This isn't a reasonable solution.

The simple alternative is to ask the project using xorg-gtest to copy 
the Makefile-xorg-gtest.am manually, but that leaves the user open to a 
stale file.

If there was something like aclocal --install but for makefiles that 
would probably be useful, but I can't find anything.

-- Chase


More information about the xorg-devel mailing list