xorg-libxcb-errors/Makefile.am
Uli Schlachter 5d660ebe87 Do not distribute extensions.c and fix out-of-tree builds
It all started with src/extensions.c being distributed. Thanks to this, tarballs
shipped with this generated file and actually building this file was skipped.
Fix this by using the nodist_ variant of the SOURCES variable.

Due to this oversight (sorry!), the out-of-tree build wasn't actually tested.
The rule that generates src/extensions.c was missing $(srcdir) in front of the
path to extensions.py. This rule is now fixed and, as suggested by Daphne
Pfister, also changed to explicitly call the python interpreter. Configure is
changed to look for it.

Finally, extensions.c couldn't include errors.h. This worked before, because the
C compiler automatically looks for headers in the same directory as the source
file. However, for out-of-tree builds, the source directory and build directory
are different. Paper over this problem by explicitly making it look in the right
directory.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90328
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-05-06 08:16:54 +02:00

41 lines
1.1 KiB
Makefile

ACLOCAL_AMFLAGS = -I m4
MAINTAINERCLEANFILES = ChangeLog INSTALL Makefile.in
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
EXTRA_DIST = autogen.sh xcb-errors.pc.in src/errors.h src/extensions.py
lib_LTLIBRARIES = libxcb-errors.la
xcbinclude_HEADERS = src/xcb_errors.h
AM_CFLAGS = $(CWARNFLAGS)
libxcb_errors_la_SOURCES = src/xcb_errors.c
nodist_libxcb_errors_la_SOURCES = src/extensions.c
libxcb_errors_la_CPPFLAGS = $(XCB_CFLAGS) $(XPROTO_CFLAGS) -I$(srcdir)/src
libxcb_errors_la_LIBADD = $(XCB_LIBS) $(XPROTO_LIBS)
libxcb_errors_la_LDFLAGS = -version-info 0:0:0 -no-undefined -export-symbols-regex '^xcb_errors_'
pkgconfig_DATA = xcb-errors.pc
TESTS = tests/test
check_PROGRAMS = tests/test
tests_test_SOURCE = tests/test.c
tests_test_CPPFLAGS = -I$(srcdir)/src/ $(XCB_CFLAGS)
tests_test_LDADD = libxcb-errors.la $(XCB_LIBS)
CLEANFILES = src/extensions.c
src/extensions.c: src/extensions.py
$(AM_V_GEN)$(PYTHON) $(srcdir)/src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
mv $@.tmp $@