[Xcb] [patch] XCB headers are unusable.
Barton C Massey
bart at cs.pdx.edu
Fri Aug 18 17:32:52 PDT 2006
Thanks much for the patch idea! I think we can solve your
problem a little differently, however. We'll try to get
something in to help you real soon now.
Bart
In message <20060818185800.GH5251 at aehallh.com> you wrote:
>
> --===============0796740667==
> Content-Type: multipart/signed; micalg=pgp-sha1;
> protocol="application/pgp-signature"; boundary="Rn7IEEq3VEzCw+ji"
> Content-Disposition: inline
>
>
> --Rn7IEEq3VEzCw+ji
> Content-Type: multipart/mixed; boundary="PpAOPzA3dXsRhoo+"
> Content-Disposition: inline
>
>
> --PpAOPzA3dXsRhoo+
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
> While attempting to get XCB working for a new extension, I came across a
> tiny problem.
>
> XCB's headers all include "xcb.h", and in some cases go further to
> include other xcb header files in the same fashion.
>
> The .pc files all say to add -I/usr/include, not /usr/include/X11/XCB,
> so without further dancing it is impossible to include any of them.
>
> Adding /usr/include/X11/XCB to the include path would solve the problem,
> but not even vaguely nicely as it would pollute the header namespace
> quite awfully.
>
> So the attached patch, along with doing a git-mv of src/xcb.h,
> src/xcbext.h, and src/xcbxlib.h to include/X11/XCB, solves the problem
> much more solidly.
>
> Everything builds, and make install still finds them all and puts them
> in the right place.
>
> It would be greatly appreciated if this could be applied and a new
> release made, so that there is at least the off chance that X 7.1 will
> depend on some XCB generated headers instead of x11proto headers.
> (Not many, but it seems the easiest route for new extensions.)
>
>
> Zephaniah E. Hull.
>
> --
> 1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
> 92ED 94E4 B1E6 3624 226D 5727 4453 008B E65A 7801
> CCs of replies from mailing lists are requested.
>
> "Pshaw! *I* am a paid-up member of the Mystic Order of Arachnid
> Vigilance."
> "Please. Why don't you go fight evil somewhere else? I'm trying to sleep
> here."
> -- Rodger Donaldson and Eric The Read in the Scary Devil Monastery
>
> --PpAOPzA3dXsRhoo+
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="header_fix.diff"
>
> diff --git a/xcb/src/Makefile.am b/xcb/src/Makefile.am
> index f62c6e7..1018ef1 100644
> --- a/xcb/src/Makefile.am
> +++ b/xcb/src/Makefile.am
> @@ -1,3 +1,6 @@
> +INCLUDES = -I$(top_srcdir)/include
> +XCB_HDIR = $(top_srcdir)/include/X11/XCB
> +
> lib_LTLIBRARIES = libXCB.la \
> libXCBcomposite.la \
> libXCBdamage.la \
> @@ -20,27 +23,27 @@ lib_LTLIBRARIES = libXCB.la \
> libXCBxvmc.la
>
> EXTHEADERS = \
> - extensions/bigreq.h \
> - extensions/composite.h \
> - extensions/damage.h \
> - extensions/dpms.h \
> - extensions/glx.h \
> - extensions/randr.h \
> - extensions/record.h \
> - extensions/render.h \
> - extensions/res.h \
> - extensions/screensaver.h \
> - extensions/shape.h \
> - extensions/shm.h \
> - extensions/sync.h \
> - extensions/xc_misc.h \
> - extensions/xevie.h \
> - extensions/xf86dri.h \
> - extensions/xfixes.h \
> - extensions/xprint.h \
> - extensions/xtest.h \
> - extensions/xv.h \
> - extensions/xvmc.h
> + $(XCB_HDIR)/bigreq.h \
> + $(XCB_HDIR)/composite.h \
> + $(XCB_HDIR)/damage.h \
> + $(XCB_HDIR)/dpms.h \
> + $(XCB_HDIR)/glx.h \
> + $(XCB_HDIR)/randr.h \
> + $(XCB_HDIR)/record.h \
> + $(XCB_HDIR)/render.h \
> + $(XCB_HDIR)/res.h \
> + $(XCB_HDIR)/screensaver.h \
> + $(XCB_HDIR)/shape.h \
> + $(XCB_HDIR)/shm.h \
> + $(XCB_HDIR)/sync.h \
> + $(XCB_HDIR)/xc_misc.h \
> + $(XCB_HDIR)/xevie.h \
> + $(XCB_HDIR)/xf86dri.h \
> + $(XCB_HDIR)/xfixes.h \
> + $(XCB_HDIR)/xprint.h \
> + $(XCB_HDIR)/xtest.h \
> + $(XCB_HDIR)/xv.h \
> + $(XCB_HDIR)/xvmc.h
> EXTSOURCES = \
> extensions/bigreq.c \
> extensions/composite.c \
> @@ -66,16 +69,16 @@ EXTSOURCES = \
> EXTENSIONS = $(EXTSOURCES) $(EXTHEADERS)
>
> ESSENTIAL_EXTENSIONS = \
> - extensions/bigreq.h \
> + $(XCB_HDIR)/bigreq.h \
> extensions/bigreq.c \
> - extensions/xc_misc.h \
> + $(XCB_HDIR)/xc_misc.h \
> extensions/xc_misc.c
>
> -COREHEADERS = xproto.h
> +COREHEADERS = $(XCB_HDIR)/xproto.h
> CORESOURCES = xproto.c
> COREPROTO = $(CORESOURCES) $(COREHEADERS)
>
> -xcbinclude_HEADERS = xcb.h xcbext.h xcbxlib.h $(COREHEADERS) $(EXTHEADERS)
> +xcbinclude_HEADERS = $(XCB_HDIR)/xcb.h $(XCB_HDIR)/xcbext.h $(XCB_HDIR)/xcbxlib.h $(COREHEADERS) $(EXTHEADERS)
> noinst_HEADERS = xcbint.h
>
> AM_CFLAGS = $(COPTFLAGS) $(CWARNFLAGS) $(CDEBUGFLAGS) $(XCBPROTO_CFLAGS) $(XPROTO_CFLAGS) $(XAU_CFLAGS) $(XDMCP_CFLAGS)
> @@ -105,79 +108,79 @@ # FIXME: find a way to autogenerate this
>
> libXCBcomposite_la_LDFLAGS = -version-info 0:0:0
> libXCBcomposite_la_LIBADD = $(XCB_LIBS)
> -libXCBcomposite_la_SOURCES = extensions/composite.c extensions/composite.h
> +libXCBcomposite_la_SOURCES = extensions/composite.c $(XCB_HDIR)/composite.h
>
> libXCBdamage_la_LDFLAGS = -version-info 0:0:0
> libXCBdamage_la_LIBADD = $(XCB_LIBS)
> -libXCBdamage_la_SOURCES = extensions/damage.c extensions/damage.h
> +libXCBdamage_la_SOURCES = extensions/damage.c $(XCB_HDIR)/damage.h
>
> libXCBdpms_la_LDFLAGS = -version-info 0:0:0
> libXCBdpms_la_LIBADD = $(XCB_LIBS)
> -libXCBdpms_la_SOURCES = extensions/dpms.c extensions/dpms.h
> +libXCBdpms_la_SOURCES = extensions/dpms.c $(XCB_HDIR)/dpms.h
>
> libXCBglx_la_LDFLAGS = -version-info 0:0:0
> libXCBglx_la_LIBADD = $(XCB_LIBS)
> -libXCBglx_la_SOURCES = extensions/glx.c extensions/glx.h
> +libXCBglx_la_SOURCES = extensions/glx.c $(XCB_HDIR)/glx.h
>
> libXCBrandr_la_LDFLAGS = -version-info 0:0:0
> libXCBrandr_la_LIBADD = $(XCB_LIBS)
> -libXCBrandr_la_SOURCES = extensions/randr.c extensions/randr.h
> +libXCBrandr_la_SOURCES = extensions/randr.c $(XCB_HDIR)/randr.h
>
> libXCBrecord_la_LDFLAGS = -version-info 0:0:0
> libXCBrecord_la_LIBADD = $(XCB_LIBS)
> -libXCBrecord_la_SOURCES = extensions/record.c extensions/record.h
> +libXCBrecord_la_SOURCES = extensions/record.c $(XCB_HDIR)/record.h
>
> libXCBrender_la_LDFLAGS = -version-info 0:0:0
> libXCBrender_la_LIBADD = $(XCB_LIBS)
> -libXCBrender_la_SOURCES = extensions/render.c extensions/render.h
> +libXCBrender_la_SOURCES = extensions/render.c $(XCB_HDIR)/render.h
>
> libXCBres_la_LDFLAGS = -version-info 0:0:0
> libXCBres_la_LIBADD = $(XCB_LIBS)
> -libXCBres_la_SOURCES = extensions/res.c extensions/res.h
> +libXCBres_la_SOURCES = extensions/res.c $(XCB_HDIR)/res.h
>
> libXCBscreensaver_la_LDFLAGS = -version-info 0:0:0
> libXCBscreensaver_la_LIBADD = $(XCB_LIBS)
> -libXCBscreensaver_la_SOURCES = extensions/screensaver.c extensions/screensaver.h
> +libXCBscreensaver_la_SOURCES = extensions/screensaver.c $(XCB_HDIR)/screensaver.h
>
> libXCBshape_la_LDFLAGS = -version-info 0:0:0
> libXCBshape_la_LIBADD = $(XCB_LIBS)
> -libXCBshape_la_SOURCES = extensions/shape.c extensions/shape.h
> +libXCBshape_la_SOURCES = extensions/shape.c $(XCB_HDIR)/shape.h
>
> libXCBshm_la_LDFLAGS = -version-info 0:0:0
> libXCBshm_la_LIBADD = $(XCB_LIBS)
> -libXCBshm_la_SOURCES = extensions/shm.c extensions/shm.h
> +libXCBshm_la_SOURCES = extensions/shm.c $(XCB_HDIR)/shm.h
>
> libXCBsync_la_LDFLAGS = -version-info 0:0:0
> libXCBsync_la_LIBADD = $(XCB_LIBS)
> -libXCBsync_la_SOURCES = extensions/sync.c extensions/sync.h
> +libXCBsync_la_SOURCES = extensions/sync.c $(XCB_HDIR)/sync.h
>
> libXCBxevie_la_LDFLAGS = -version-info 0:0:0
> libXCBxevie_la_LIBADD = $(XCB_LIBS)
> -libXCBxevie_la_SOURCES = extensions/xevie.c extensions/xevie.h
> +libXCBxevie_la_SOURCES = extensions/xevie.c $(XCB_HDIR)/xevie.h
>
> libXCBxf86dri_la_LDFLAGS = -version-info 0:0:0
> libXCBxf86dri_la_LIBADD = $(XCB_LIBS)
> -libXCBxf86dri_la_SOURCES = extensions/xf86dri.c extensions/xf86dri.h
> +libXCBxf86dri_la_SOURCES = extensions/xf86dri.c $(XCB_HDIR)/xf86dri.h
>
> libXCBxfixes_la_LDFLAGS = -version-info 0:0:0
> libXCBxfixes_la_LIBADD = $(XCB_LIBS)
> -libXCBxfixes_la_SOURCES = extensions/xfixes.c extensions/xfixes.h
> +libXCBxfixes_la_SOURCES = extensions/xfixes.c $(XCB_HDIR)/xfixes.h
>
> libXCBxprint_la_LDFLAGS = -version-info 0:0:0
> libXCBxprint_la_LIBADD = $(XCB_LIBS)
> -libXCBxprint_la_SOURCES = extensions/xprint.c extensions/xprint.h
> +libXCBxprint_la_SOURCES = extensions/xprint.c $(XCB_HDIR)/xprint.h
>
> libXCBxtest_la_LDFLAGS = -version-info 0:0:0
> libXCBxtest_la_LIBADD = $(XCB_LIBS)
> -libXCBxtest_la_SOURCES = extensions/xtest.c extensions/xtest.h
> +libXCBxtest_la_SOURCES = extensions/xtest.c $(XCB_HDIR)/xtest.h
>
> libXCBxv_la_LDFLAGS = -version-info 0:0:0
> libXCBxv_la_LIBADD = $(XCB_LIBS)
> -libXCBxv_la_SOURCES = extensions/xv.c extensions/xv.h
> +libXCBxv_la_SOURCES = extensions/xv.c $(XCB_HDIR)/xv.h
>
> libXCBxvmc_la_LDFLAGS = -version-info 0:0:0
> libXCBxvmc_la_LIBADD = $(XCB_LIBS)
> -libXCBxvmc_la_SOURCES = extensions/xvmc.c extensions/xvmc.h
> +libXCBxvmc_la_SOURCES = extensions/xvmc.c $(XCB_HDIR)/xvmc.h
>
> vpath %.xml $(XCBPROTO_XCBINCLUDEDIR) $(XCBPROTO_XCBINCLUDEDIR)/extensions
>
> @@ -189,6 +192,14 @@ vpath %.xml $(XCBPROTO_XCBINCLUDEDIR) $(
> $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
> -o $@ $(srcdir)/c-client.xsl $<
>
> +$(XCB_HDIR)/%.h: %.xml c-client.xsl
> + @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n)
> + $(XSLTPROC) --stringparam mode header \
> + --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \
> + --stringparam extension-path \
> + $(XCBPROTO_XCBINCLUDEDIR)/extensions/ \
> + -o $@ $(srcdir)/c-client.xsl $<
> +
> %.c: %.xml c-client.xsl
> @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n)
> $(XSLTPROC) --stringparam mode source \
> diff --git a/xcb/src/c-client.xsl b/xcb/src/c-client.xsl
> index 218e093..81b6504 100644
> --- a/xcb/src/c-client.xsl
> +++ b/xcb/src/c-client.xsl
> @@ -885,9 +885,9 @@ authorization from the authors.
> #ifndef </xsl:text><xsl:value-of select="$guard" /><xsl:text>
> #define </xsl:text><xsl:value-of select="$guard" /><xsl:text>
> </xsl:text>
> -#include "xcb.h"
> +#include <X11/XCB/xcb.h>
> <xsl:for-each select="$root/xcb/import">
> -<xsl:text>#include "</xsl:text><xsl:value-of select="." /><xsl:text>.h"
> +<xsl:text>#include <X11/XCB/</xsl:text><xsl:value-of select="." /><xsl:text>.h>
> </xsl:text>
> </xsl:for-each>
> <xsl:text>
> @@ -896,8 +896,8 @@ #include "xcb.h"
>
> <xsl:if test="$c"><xsl:text>
> #include <assert.h>
> -#include "xcbext.h"
> -#include "</xsl:text><xsl:value-of select="$header" /><xsl:text>.h"
> +#include <X11/XCB/xcbext.h>
> +#include <X11/XCB/</xsl:text><xsl:value-of select="$header" /><xsl:text>.h>
>
> </xsl:text></xsl:if>
>
> diff --git a/xcb/src/xcb_auth.c b/xcb/src/xcb_auth.c
> index 46c85fd..79cf828 100644
> --- a/xcb/src/xcb_auth.c
> +++ b/xcb/src/xcb_auth.c
> @@ -46,7 +46,7 @@ #ifdef HASXDMAUTH
> #include <X11/Xdmcp.h>
> #endif
>
> -#include "xcb.h"
> +#include <X11/XCB/xcb.h>
> #include "xcbint.h"
>
> enum auth_protos {
> diff --git a/xcb/src/xcb_conn.c b/xcb/src/xcb_conn.c
> index be80bac..190c539 100644
> --- a/xcb/src/xcb_conn.c
> +++ b/xcb/src/xcb_conn.c
> @@ -35,7 +35,7 @@ #include <sys/select.h>
> #include <fcntl.h>
> #include <errno.h>
>
> -#include "xcb.h"
> +#include <X11/XCB/xcb.h>
> #include "xcbint.h"
>
> typedef struct {
> diff --git a/xcb/src/xcb_ext.c b/xcb/src/xcb_ext.c
> index 610ec57..380ccac 100644
> --- a/xcb/src/xcb_ext.c
> +++ b/xcb/src/xcb_ext.c
> @@ -28,8 +28,8 @@
> #include <stdlib.h>
> #include <string.h>
>
> -#include "xcb.h"
> -#include "xcbext.h"
> +#include <X11/XCB/xcb.h>
> +#include <X11/XCB/xcbext.h>
> #include "xcbint.h"
>
> typedef struct lazyreply {
> diff --git a/xcb/src/xcb_in.c b/xcb/src/xcb_in.c
> index b45637f..b5e645e 100644
> --- a/xcb/src/xcb_in.c
> +++ b/xcb/src/xcb_in.c
> @@ -33,8 +33,8 @@ #include <stdio.h>
> #include <sys/select.h>
> #include <errno.h>
>
> -#include "xcb.h"
> -#include "xcbext.h"
> +#include <X11/XCB/xcb.h>
> +#include <X11/XCB/xcbext.h>
> #include "xcbint.h"
>
> #define XCBError 0
> diff --git a/xcb/src/xcb_list.c b/xcb/src/xcb_list.c
> index 9854ead..0cae84e 100644
> --- a/xcb/src/xcb_list.c
> +++ b/xcb/src/xcb_list.c
> @@ -27,7 +27,7 @@
>
> #include <stdlib.h>
>
> -#include "xcb.h"
> +#include <X11/XCB/xcb.h>
> #include "xcbint.h"
>
> typedef struct node {
> diff --git a/xcb/src/xcb_out.c b/xcb/src/xcb_out.c
> index 56e02f7..4c96122 100644
> --- a/xcb/src/xcb_out.c
> +++ b/xcb/src/xcb_out.c
> @@ -30,10 +30,10 @@ #include <stdlib.h>
> #include <unistd.h>
> #include <string.h>
>
> -#include "xcb.h"
> -#include "xcbext.h"
> +#include <X11/XCB/xcb.h>
> +#include <X11/XCB/xcbext.h>
> #include "xcbint.h"
> -#include "extensions/bigreq.h"
> +#include <X11/XCB/bigreq.h>
>
> static int write_block(XCBConnection *c, struct iovec *vector, int count)
> {
> diff --git a/xcb/src/xcb_util.c b/xcb/src/xcb_util.c
> index 3bcaefd..8636df4 100644
> --- a/xcb/src/xcb_util.c
> +++ b/xcb/src/xcb_util.c
> @@ -41,8 +41,8 @@ #include <stdlib.h>
> #include <unistd.h>
> #include <string.h>
>
> -#include "xcb.h"
> -#include "xcbext.h"
> +#include <X11/XCB/xcb.h>
> +#include <X11/XCB/xcbext.h>
> #include "xcbint.h"
>
> int XCBPopcount(CARD32 mask)
> diff --git a/xcb/src/xcb_xid.c b/xcb/src/xcb_xid.c
> index 7d7f784..4c0cda3 100644
> --- a/xcb/src/xcb_xid.c
> +++ b/xcb/src/xcb_xid.c
> @@ -26,10 +26,10 @@
> /* XID allocators. */
>
> #include <stdlib.h>
> -#include "xcb.h"
> -#include "xcbext.h"
> +#include <X11/XCB/xcb.h>
> +#include <X11/XCB/xcbext.h>
> #include "xcbint.h"
> -#include "extensions/xc_misc.h"
> +#include <X11/XCB/xc_misc.h>
>
> /* Public interface */
>
> diff --git a/xcb/src/xcb_xlib.c b/xcb/src/xcb_xlib.c
> index 09f74a7..bf2073f 100644
> --- a/xcb/src/xcb_xlib.c
> +++ b/xcb/src/xcb_xlib.c
> @@ -23,7 +23,7 @@
> * authorization from the authors.
> */
>
> -#include "xcbxlib.h"
> +#include <X11/XCB/xcbxlib.h>
> #include "xcbint.h"
>
> unsigned int XCBGetQueuedRequestRead(XCBConnection *c)
>
> --PpAOPzA3dXsRhoo+--
>
> --Rn7IEEq3VEzCw+ji
> Content-Type: application/pgp-signature; name="signature.asc"
> Content-Description: Digital signature
> Content-Disposition: inline
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (GNU/Linux)
>
> iD8DBQFE5g23RFMAi+ZaeAERAiOOAKCAoDIATWOWV3ROc1/20MubtxKRawCZARbj
> bl2KoXybkY39dxtzY/Hzkck=
> =0ZIZ
> -----END PGP SIGNATURE-----
>
> --Rn7IEEq3VEzCw+ji--
>
> --===============0796740667==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
> --===============0796740667==--
More information about the Xcb
mailing list