summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-16 23:23:18 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-30 20:31:13 -0700
commit19989884334aa9b8be1b1389320e59f7927acc2f (patch)
treecac9ccb2a915cfb6f95783990c8cb0ad5117aa5f
parent043078947a576c7e4ab7ae67998302eff5c5d593 (diff)
Allow building without xcb for testing on older systems
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--configure.ac7
-rw-r--r--include/xhiv.h2
-rw-r--r--src/Makefile.am5
3 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index e6d7790..504b4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,12 @@ PKG_CHECK_MODULES(XHIV, [xproto >= 7.0.22 bigreqsproto xtrans])
# Use pkg-config to get required cflags & libraries for each library we test
PKG_CHECK_MODULES(LIBX11, [x11])
-PKG_CHECK_MODULES(LIBXCB, [xcb])
+PKG_CHECK_EXISTS([xcb], [HAVE_XCB="yes"], [HAVE_XCB="no"])
+if test "x$HAVE_XCB" = "xyes" ; then
+ PKG_CHECK_MODULES(LIBXCB, [xcb])
+ AC_DEFINE([HAVE_XCB], [1], [Define if you have the XCB library])
+fi
+AM_CONDITIONAL([HAVE_XCB], [test "x$HAVE_XCB" = "xyes"])
AC_CONFIG_FILES([
Makefile
diff --git a/include/xhiv.h b/include/xhiv.h
index b644e09..709afa0 100644
--- a/include/xhiv.h
+++ b/include/xhiv.h
@@ -56,9 +56,11 @@ extern char *XhivOpenServer(xhiv_response *responses, pid_t *return_pid);
extern Display *XhivOpenDisplay(xhiv_response *responses);
extern int XhivCloseDisplay(Display *dpy);
+#ifdef HAVE_XCB
/* Open an xcb display connection to a new Xhiv server */
#include <xcb/xcb.h>
extern xcb_connection_t *xhiv_connect(xhiv_response *responses);
extern int xhiv_disconnect(xcb_connection_t *conn);
+#endif
#endif /* XHIV_H */
diff --git a/src/Makefile.am b/src/Makefile.am
index d2bbe7d..a1d8306 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,11 +2,14 @@ noinst_LIBRARIES = libXhiv.a
libXhiv_a_SOURCES = \
proto.h \
- xcb_client.c \
xlib_client.c \
xstrans.c \
server.c
+if HAVE_XCB
+ libXhiv_a_SOURCES += xcb_client.c
+endif
+
AM_CFLAGS = $(XHIV_CFLAGS) $(CWARNFLAGS) $(LIBX11_CFLAGS) $(LIBXCB_CFLAGS)
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)/include