[Xcb] [PATCH libX11 3/3] Move libX11-xcb to its own subdirectory.

Rami Ylimäki rami.ylimaki at vincit.fi
Tue Mar 22 05:33:24 PDT 2011


This change makes it easier to use different compiler and linker flags
for libX11 and libX11-xcb. Also libX11-xcb doesn't depend on libX11
anymore, because it's not using any of its symbols.

Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac        |    1 +
 src/Makefile.am     |    8 ++------
 src/x11_xcb.c       |   15 ---------------
 src/xcb/Makefile.am |   27 +++++++++++++++++++++++++++
 src/xcb/x11_xcb.c   |   15 +++++++++++++++
 5 files changed, 45 insertions(+), 21 deletions(-)
 delete mode 100644 src/x11_xcb.c
 create mode 100644 src/xcb/Makefile.am
 create mode 100644 src/xcb/x11_xcb.c

diff --git a/configure.ac b/configure.ac
index aa39b38..db1ca83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -442,6 +442,7 @@ AC_CONFIG_FILES([Makefile
 		man/xkb/Makefile
 		src/Makefile
 		src/util/Makefile
+		src/xcb/Makefile
 		src/xcms/Makefile
 		src/xlibi18n/Makefile
 		modules/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 71e02e7..7232a41 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,9 @@
 if XKB
 XKB_SUBDIRS = xkb
 endif
-SUBDIRS = util xcms xlibi18n $(XKB_SUBDIRS)
+SUBDIRS = util xcb xcms xlibi18n $(XKB_SUBDIRS)
 
-lib_LTLIBRARIES = libX11.la libX11-xcb.la
+lib_LTLIBRARIES = libX11.la
 
 BUILT_SOURCES=ks_tables.h
 CLEANFILES=ks_tables.h ks_tables_h
@@ -348,10 +348,6 @@ EXTRA_DIST = \
 	udcInf.c \
 	UIThrStubs.c 
 
-libX11_xcb_la_SOURCES = x11_xcb.c Xxcbint.h
-libX11_xcb_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libX11_xcb_la_LIBADD = libX11.la
-
 #
 # Figure out which sub-libraries to link into Xlib
 #
diff --git a/src/x11_xcb.c b/src/x11_xcb.c
deleted file mode 100644
index 3ddf403..0000000
--- a/src/x11_xcb.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (C) 2003,2006 Jamey Sharp, Josh Triplett
- * This file is licensed under the MIT license. See the file COPYING. */
-
-#include "Xlibint.h"
-#include "Xxcbint.h"
-
-xcb_connection_t *XGetXCBConnection(Display *dpy)
-{
-	return dpy->xcb->connection;
-}
-
-void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner)
-{
-	dpy->xcb->event_owner = owner;
-}
diff --git a/src/xcb/Makefile.am b/src/xcb/Makefile.am
new file mode 100644
index 0000000..9bf15ee
--- /dev/null
+++ b/src/xcb/Makefile.am
@@ -0,0 +1,27 @@
+AM_CPPFLAGS= \
+	-I$(top_srcdir)/include \
+	-I$(top_builddir)/include \
+	-I$(top_srcdir)/include/X11 \
+	-I$(top_srcdir)/src
+
+AM_CFLAGS= \
+	$(X11_CFLAGS) \
+	$(XMALLOC_ZERO_CFLAGS) \
+	$(CWARNFLAGS)
+
+AM_LDFLAGS = -version-number 1:0:0 -no-undefined
+
+lib_LTLIBRARIES = libX11-xcb.la
+
+libX11_xcb_la_SOURCES = x11_xcb.c Xxcbint.h
+
+if LINT
+# Check source code with tools like lint & sparse
+
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+		$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+
+lint:
+	$(LINT) $(ALL_LINT_FLAGS) $(libX11_xcb_la_SOURCES)
+
+endif LINT
diff --git a/src/xcb/x11_xcb.c b/src/xcb/x11_xcb.c
new file mode 100644
index 0000000..3ddf403
--- /dev/null
+++ b/src/xcb/x11_xcb.c
@@ -0,0 +1,15 @@
+/* Copyright (C) 2003,2006 Jamey Sharp, Josh Triplett
+ * This file is licensed under the MIT license. See the file COPYING. */
+
+#include "Xlibint.h"
+#include "Xxcbint.h"
+
+xcb_connection_t *XGetXCBConnection(Display *dpy)
+{
+	return dpy->xcb->connection;
+}
+
+void XSetEventQueueOwner(Display *dpy, enum XEventQueueOwner owner)
+{
+	dpy->xcb->event_owner = owner;
+}
-- 
1.6.3.3



More information about the Xcb mailing list