[PATCH v3 2/3] config: Move Xlib-xcb to its own subdirectory.
Gaetan Nadon
memsize at videotron.ca
Fri Feb 4 13:17:20 PST 2011
On Fri, 2011-02-04 at 16:42 +0200, Rami Ylimäki wrote:
> 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>
> ---
> configure.ac | 1 +
> src/Makefile.am | 9 +++------
> src/Xxcbint.h | 46 ----------------------------------------------
> src/x11_xcb.c | 15 ---------------
> src/xcb/Makefile.am | 26 ++++++++++++++++++++++++++
> src/xcb/Xxcbint.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> src/xcb/x11_xcb.c | 15 +++++++++++++++
> 7 files changed, 91 insertions(+), 67 deletions(-)
> delete mode 100644 src/Xxcbint.h
> delete mode 100644 src/x11_xcb.c
> create mode 100644 src/xcb/Makefile.am
> create mode 100644 src/xcb/Xxcbint.h
> create mode 100644 src/xcb/x11_xcb.c
>
> diff --git a/configure.ac b/configure.ac
> index 40d032d..a69735b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -448,6 +448,7 @@ AC_OUTPUT([Makefile
You will need to rebase, file has changed since.
> 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 8b0953c..05c7663 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 xcms xlibi18n $(XKB_SUBDIRS) . xcb
Can you explain why libX11 must be built before xcb subdir?
The commit text says it does not use any symbols from libX11.
>
> -lib_LTLIBRARIES = libX11.la libX11-xcb.la
> +lib_LTLIBRARIES = libX11.la
>
> BUILT_SOURCES=ks_tables.h
> CLEANFILES=ks_tables.h ks_tables_h
> @@ -13,6 +13,7 @@ AM_CPPFLAGS= \
> -I$(top_srcdir)/include/X11 \
> -I$(top_builddir)/include \
> -I$(top_builddir)/include/X11 \
> + -I$(top_srcdir)/src/xcb \
> -I$(top_srcdir)/src/xcms \
> -I$(top_srcdir)/src/xkb \
> -I$(top_srcdir)/src/xlibi18n \
> @@ -349,10 +350,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/Xxcbint.h b/src/Xxcbint.h
> deleted file mode 100644
> index 1fa1a4d..0000000
> --- a/src/Xxcbint.h
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett
> - * This file is licensed under the MIT license. See the file COPYING. */
> -
> -#ifndef XXCBINT_H
> -#define XXCBINT_H
> -
> -#include <assert.h>
> -#include <stdint.h>
> -#include <X11/Xlibint.h>
> -#include <X11/Xlib-xcb.h>
> -#include "locking.h"
> -
> -#define XLIB_SEQUENCE_COMPARE(a,op,b) (((long) (a) - (long) (b)) op 0)
> -
> -typedef struct PendingRequest PendingRequest;
> -struct PendingRequest {
> - PendingRequest *next;
> - unsigned long sequence;
> - unsigned reply_waiter;
> -};
> -
> -typedef struct _X11XCBPrivate {
> - xcb_connection_t *connection;
> - PendingRequest *pending_requests;
> - PendingRequest *pending_requests_tail;
> - xcb_generic_event_t *next_event;
> - char *real_bufmax;
> - char *reply_data;
> - int reply_length;
> - int reply_consumed;
> - uint64_t last_flushed;
> - enum XEventQueueOwner event_owner;
> - XID next_xid;
> -
> - /* handle simultaneous threads waiting for responses */
> - xcondition_t event_notify;
> - int event_waiter;
> - xcondition_t reply_notify;
> -} _X11XCBPrivate;
> -
> -/* xcb_disp.c */
> -
> -int _XConnectXCB(Display *dpy, _Xconst char *display, int *screenp);
> -void _XFreeX11XCBStructure(Display *dpy);
> -
> -#endif /* XXCBINT_H */
> 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..5c68639
> --- /dev/null
> +++ b/src/xcb/Makefile.am
> @@ -0,0 +1,26 @@
> +AM_CPPFLAGS= \
> + -I$(top_srcdir)/include/X11 \
> + -I$(top_builddir)/include/X11 \
> + -I$(top_srcdir)/src \
> + -D_BSD_SOURCE
_BSD_SOURCE is not required due to AC_USE_SYSTEM_EXTENSIONS.
Notice the duplication in the gcc command.
> +
> +AM_CFLAGS= \
> + $(X11_CFLAGS) \
> + $(XMALLOC_ZERO_CFLAGS) \
> + $(CWARNFLAGS)
> +
> +lib_LTLIBRARIES = libX11-xcb.la
> +
> +libX11_xcb_la_SOURCES = x11_xcb.c Xxcbint.h
> +libX11_xcb_la_LDFLAGS = -version-number 1:0:0 -no-undefined
AM_LDFLAGS would do just fine. Now that each target is separated no need
to use per-target flags.
> +
> +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/Xxcbint.h b/src/xcb/Xxcbint.h
> new file mode 100644
> index 0000000..1fa1a4d
> --- /dev/null
> +++ b/src/xcb/Xxcbint.h
> @@ -0,0 +1,46 @@
> +/* Copyright (C) 2003-2006 Jamey Sharp, Josh Triplett
> + * This file is licensed under the MIT license. See the file COPYING. */
> +
> +#ifndef XXCBINT_H
> +#define XXCBINT_H
> +
> +#include <assert.h>
> +#include <stdint.h>
> +#include <X11/Xlibint.h>
> +#include <X11/Xlib-xcb.h>
> +#include "locking.h"
> +
> +#define XLIB_SEQUENCE_COMPARE(a,op,b) (((long) (a) - (long) (b)) op 0)
> +
> +typedef struct PendingRequest PendingRequest;
> +struct PendingRequest {
> + PendingRequest *next;
> + unsigned long sequence;
> + unsigned reply_waiter;
> +};
> +
> +typedef struct _X11XCBPrivate {
> + xcb_connection_t *connection;
> + PendingRequest *pending_requests;
> + PendingRequest *pending_requests_tail;
> + xcb_generic_event_t *next_event;
> + char *real_bufmax;
> + char *reply_data;
> + int reply_length;
> + int reply_consumed;
> + uint64_t last_flushed;
> + enum XEventQueueOwner event_owner;
> + XID next_xid;
> +
> + /* handle simultaneous threads waiting for responses */
> + xcondition_t event_notify;
> + int event_waiter;
> + xcondition_t reply_notify;
> +} _X11XCBPrivate;
> +
> +/* xcb_disp.c */
> +
> +int _XConnectXCB(Display *dpy, _Xconst char *display, int *screenp);
> +void _XFreeX11XCBStructure(Display *dpy);
> +
> +#endif /* XXCBINT_H */
> 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;
> +}
Thanks!
Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110204/55cd7a20/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110204/55cd7a20/attachment.pgp>
More information about the xorg-devel
mailing list