[PATCH v2] Fix build system.

Chase Douglas chase.douglas at canonical.com
Thu Feb 2 12:08:20 PST 2012


On 02/02/2012 01:36 PM, Jussi Pakkanen wrote:
> The project could not be built from scratch due to erroneous
> Autofoo setup. This commit makes it work.
> 
> Signed-off-by: Jussi Pakkanen <jussi.pakkanen at canonical.com>
> ---
>  Makefile.am          |   37 +------------------------------------
>  configure.ac         |    4 ++--
>  examples/Makefile.am |    6 ++++--
>  src/Makefile.am      |   32 ++++++++++++++++++++++++++++++++
>  4 files changed, 39 insertions(+), 40 deletions(-)
>  create mode 100644 src/Makefile.am
> 
> diff --git a/Makefile.am b/Makefile.am
> index d10bca8..841193c 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,43 +1,8 @@
> -SUBDIRS = doc examples
> -
> -lib_LTLIBRARIES = libxorg-gtest.la libxorg-gtest_main.la
> -
> -libxorg_gtest_la_SOURCES = \
> -	src/environment.cpp \
> -	src/process.cpp \
> -	src/test.cpp
> -
> -libxorg_gtest_la_CPPFLAGS = \
> -	$(AM_CPPFLAGS) \
> -	$(GTEST_CPPFLAGS)
> -
> -libxorg_gtest_main_la_SOURCES = \
> -	src/main.cpp
> -
> -library_includedir = $(includedir)/xorg/gtest
> -library_include_HEADERS = \
> -	include/xorg/gtest/environment.h \
> -	include/xorg/gtest/process.h \
> -	include/xorg/gtest/test.h
> -
> -library_datadir = $(datadir)/xorg/gtest
> -library_data_DATA = conf/dummy.conf
> -
> -libxorg_gtest_main_la_CPPFLAGS = \
> -	$(AM_CPPFLAGS) \
> -	$(GTEST_CPPFLAGS) \
> -	-DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
> -
> -libxorg_gtest_la_LDFLAGS = $(X11_LIBS)
> -libxorg_gtest_main_la_LDFLAGS = $(X11_LIBS)
> +SUBDIRS = src doc examples
>  
>  pkgconfigdir = $(libdir)/pkgconfig
>  pkgconfig_DATA = xorg-gtest.pc
>  
> -ACLOCAL_AMFLAGS = -I m4

This ^^ needs to be left in the toplevel Makefile.am:

http://www.gnu.org/software/automake/manual/html_node/Local-Macros.html

> -
> -AM_CXXFLAGS = -Iinclude
> -
>  .PHONY: ChangeLog INSTALL
>  INSTALL:
>  	$(INSTALL_CMD)
> diff --git a/configure.ac b/configure.ac
> index 9d7b36b..1623394 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -12,7 +12,7 @@ m4_include([m4/gtest.m4])
>  # Initialize Automake
>  AM_INIT_AUTOMAKE([1.11 foreign dist-bzip2])
>  AM_SILENT_RULES([yes])
> -AM_MAINTAINER_MODE
> +AM_MAINTAINER_MODE([enable])
>  
>  LIB_VERSION=0:0:0
>  AC_SUBST([LIB_VERSION])
> @@ -43,6 +43,6 @@ AC_CONFIG_FILES([Makefile
>                  
>  AC_SUBST(AM_CPPFLAGS, "-Wall -Werror")
>  
> -AC_CONFIG_FILES([doc/Makefile examples/Makefile])
> +AC_CONFIG_FILES([doc/Makefile examples/Makefile src/Makefile])
>  
>  AC_OUTPUT
> diff --git a/examples/Makefile.am b/examples/Makefile.am
> index 0bc8272..c70714b 100644
> --- a/examples/Makefile.am
> +++ b/examples/Makefile.am
> @@ -24,6 +24,8 @@ xorg_gtest_example_SOURCES = xorg-gtest.cpp
>  
>  xorg_gtest_example_CPPFLAGS = \
>  	$(AM_CPPFLAGS) \
> -	$(GTEST_CPPFLAGS)
> +	$(GTEST_CPPFLAGS)\

^^ Missing ' ' between the variable and '\'

> +	-I$(top_srcdir)/include
> +
> +xorg_gtest_example_LDADD = $(top_builddir)/src/libxorg-gtest.la $(top_builddir)/src/libxorg-gtest_main.la -lgtest -lpthread -lX11
>  
> -xorg_gtest_example_LDFLAGS = -lxorg-gtest -lxorg-gtest_main -lgtest -lpthread -lX11
> diff --git a/src/Makefile.am b/src/Makefile.am
> new file mode 100644
> index 0000000..77c7a86
> --- /dev/null
> +++ b/src/Makefile.am
> @@ -0,0 +1,32 @@
> +lib_LTLIBRARIES = libxorg-gtest.la libxorg-gtest_main.la
> +
> +libxorg_gtest_la_SOURCES = \
> +	environment.cpp \
> +	process.cpp \
> +	test.cpp
> +
> +libxorg_gtest_la_CPPFLAGS = \
> +	$(AM_CPPFLAGS) \
> +	$(GTEST_CPPFLAGS)
> +
> +libxorg_gtest_main_la_SOURCES = \
> +	main.cpp
> +
> +library_includedir = $(includedir)/xorg/gtest
> +library_include_HEADERS = \
> +	$(top_srcdir)/include/xorg/gtest/environment.h \
> +	$(top_srcdir)/include/xorg/gtest/process.h \
> +	$(top_srcdir)/include/xorg/gtest/test.h
> +library_datadir = $(datadir)/xorg/gtest
> +library_data_DATA = $(top_srcdir)/conf/dummy.conf
> +
> +libxorg_gtest_main_la_CPPFLAGS = \
> +	$(AM_CPPFLAGS) \
> +	$(GTEST_CPPFLAGS) \
> +	-DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
> +
> +libxorg_gtest_la_LDFLAGS = $(X11_LIBS)
> +libxorg_gtest_main_la_LDFLAGS = $(X11_LIBS)
> +
> +ACLOCAL_AMFLAGS = -I m4
> +AM_CXXFLAGS = -I$(top_srcdir)/include

Otherwise, it looks good :). I've ammended those two issues and applied
to the tree.

Thanks!

-- Chase


More information about the xorg-devel mailing list