[Xcb-commit] util-errors: Makefile.am configure.ac
Uli Schlachter
psychon at kemper.freedesktop.org
Tue May 5 23:18:40 PDT 2015
Makefile.am | 7 ++++---
configure.ac | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 5d660ebe872cadcdc85de9d6f9afe05de629c030
Author: Uli Schlachter <psychon at znc.in>
Date: Wed May 6 08:10:53 2015 +0200
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 at znc.in>
diff --git a/Makefile.am b/Makefile.am
index 746cde3..bdf4a30 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,8 +20,9 @@ xcbinclude_HEADERS = src/xcb_errors.h
AM_CFLAGS = $(CWARNFLAGS)
-libxcb_errors_la_SOURCES = src/xcb_errors.c src/extensions.c
-libxcb_errors_la_CPPFLAGS = $(XCB_CFLAGS) $(XPROTO_CFLAGS)
+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_'
@@ -36,5 +37,5 @@ tests_test_LDADD = libxcb-errors.la $(XCB_LIBS)
CLEANFILES = src/extensions.c
src/extensions.c: src/extensions.py
- $(AM_V_GEN)src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/src/extensions.py $@.tmp ${XCBPROTO_XCBINCLUDEDIR}/*.xml && \
mv $@.tmp $@
diff --git a/configure.ac b/configure.ac
index d0bcc63..0379093 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,8 @@ AC_TYPE_SSIZE_T
XCB_UTIL_M4_WITH_INCLUDE_PATH
XCB_UTIL_COMMON([1.4], [1.6])
+AM_PATH_PYTHON
+
# Checks for xcb-proto's XML files, inspired from libxcb's configure.ac
PKG_CHECK_MODULES(XCBPROTO, xcb-proto)
AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
More information about the xcb-commit
mailing list