diff options
Diffstat (limited to 'libxcb/src')
-rw-r--r-- | libxcb/src/Makefile.am | 350 | ||||
-rw-r--r-- | libxcb/src/Makefile.in | 847 | ||||
-rw-r--r-- | libxcb/src/c_client.py | 1041 | ||||
-rw-r--r-- | libxcb/src/config.h.in | 20 | ||||
-rw-r--r-- | libxcb/src/xcb.h | 23 | ||||
-rw-r--r-- | libxcb/src/xcb_auth.c | 76 | ||||
-rw-r--r-- | libxcb/src/xcb_conn.c | 114 | ||||
-rw-r--r-- | libxcb/src/xcb_ext.c | 8 | ||||
-rw-r--r-- | libxcb/src/xcb_in.c | 116 | ||||
-rw-r--r-- | libxcb/src/xcb_out.c | 87 | ||||
-rw-r--r-- | libxcb/src/xcb_util.c | 158 | ||||
-rw-r--r-- | libxcb/src/xcb_xid.c | 44 | ||||
-rw-r--r-- | libxcb/src/xcbext.h | 17 | ||||
-rw-r--r-- | libxcb/src/xcbint.h | 56 |
14 files changed, 2204 insertions, 753 deletions
diff --git a/libxcb/src/Makefile.am b/libxcb/src/Makefile.am index b02caf33c..5de3b09f3 100644 --- a/libxcb/src/Makefile.am +++ b/libxcb/src/Makefile.am @@ -1,105 +1,21 @@ -lib_LTLIBRARIES = libxcb.la \ - libxcb-xlib.la \ - libxcb-composite.la \ - libxcb-damage.la \ - libxcb-dpms.la \ - libxcb-glx.la \ - libxcb-randr.la \ - libxcb-record.la \ - libxcb-render.la \ - libxcb-res.la \ - libxcb-screensaver.la \ - libxcb-shape.la \ - libxcb-shm.la \ - libxcb-sync.la \ - libxcb-xevie.la \ - libxcb-xf86dri.la \ - libxcb-xfixes.la \ - libxcb-xinerama.la \ - libxcb-xprint.la \ - libxcb-xtest.la \ - libxcb-xv.la \ - libxcb-xvmc.la +lib_LTLIBRARIES = libxcb.la EXTHEADERS = xproto.h \ bigreq.h \ - composite.h \ - damage.h \ - dpms.h \ - glx.h \ - randr.h \ - record.h \ - render.h \ - res.h \ - screensaver.h \ - shape.h \ - shm.h \ - sync.h \ - xc_misc.h \ - xevie.h \ - xf86dri.h \ - xfixes.h \ - xinerama.h \ - xprint.h \ - xtest.h \ - xv.h \ - xvmc.h + xc_misc.h EXTSOURCES = xproto.c \ bigreq.c \ - composite.c \ - damage.c \ - dpms.c \ - glx.c \ - randr.c \ - record.c \ - render.c \ - res.c \ - screensaver.c \ - shape.c \ - shm.c \ - sync.c \ - xc_misc.c \ - xevie.c \ - xf86dri.c \ - xfixes.c \ - xinerama.c \ - xprint.c \ - xtest.c \ - xv.c \ - xvmc.c + xc_misc.c EXTENSION_XML = xproto.xml \ bigreq.xml \ - composite.xml \ - damage.xml \ - dpms.xml \ - glx.xml \ - randr.xml \ - record.xml \ - render.xml \ - res.xml \ - screensaver.xml \ - shape.xml \ - shm.xml \ - sync.xml \ - xc_misc.xml \ - xevie.xml \ - xf86dri.xml \ - xfixes.xml \ - xinerama.xml \ - xprint.xml \ - xtest.xml \ - xvmc.xml \ - xv.xml - -xcbinclude_HEADERS = xcb.h xcbext.h xcbxlib.h $(EXTHEADERS) -noinst_HEADERS = xcbint.h + xc_misc.xml AM_CFLAGS = $(CWARNFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS) libxcb_la_LIBADD = $(NEEDED_LIBS) $(XDMCP_LIBS) libxcb_la_SOURCES = \ xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \ - xcb_list.c xcb_util.c xcb_auth.c c-client.xsl \ - xproto.c bigreq.c xc_misc.c + xcb_list.c xcb_util.c xcb_auth.c c_client.py +nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c # Explanation for -version-info: # -version-info current:revision:age @@ -108,116 +24,250 @@ libxcb_la_SOURCES = \ # * If you add an interface, increment current and age and set revision to 0. # * If you change or remove an interface, increment current and set revision # and age to 0. -libxcb_la_LDFLAGS = -version-info 1:0:0 - -BUILT_SOURCES = $(EXTSOURCES) $(EXTHEADERS) -CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(EXTENSION_XML) +libxcb_la_LDFLAGS = -version-info 2:0:1 XCB_LIBS = libxcb.la -libxcb_xlib_la_LDFLAGS = -version-info 0:0:0 -libxcb_xlib_la_LIBADD = $(XCB_LIBS) -libxcb_xlib_la_SOURCES = xcb_xlib.c - # FIXME: find a way to autogenerate this from the XML files. +EXTHEADERS += composite.h +EXTSOURCES += composite.c +EXTENSION_XML += composite.xml +if BUILD_COMPOSITE +lib_LTLIBRARIES += libxcb-composite.la libxcb_composite_la_LDFLAGS = -version-info 0:0:0 libxcb_composite_la_LIBADD = $(XCB_LIBS) -libxcb_composite_la_SOURCES = composite.c composite.h - +nodist_libxcb_composite_la_SOURCES = composite.c composite.h +endif + +EXTHEADERS += damage.h +EXTSOURCES += damage.c +EXTENSION_XML += damage.xml +if BUILD_DAMAGE +lib_LTLIBRARIES += libxcb-damage.la libxcb_damage_la_LDFLAGS = -version-info 0:0:0 libxcb_damage_la_LIBADD = $(XCB_LIBS) -libxcb_damage_la_SOURCES = damage.c damage.h - +nodist_libxcb_damage_la_SOURCES = damage.c damage.h +endif + +EXTHEADERS += dpms.h +EXTSOURCES += dpms.c +EXTENSION_XML += dpms.xml +if BUILD_DPMS +lib_LTLIBRARIES += libxcb-dpms.la libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 libxcb_dpms_la_LIBADD = $(XCB_LIBS) -libxcb_dpms_la_SOURCES = dpms.c dpms.h - +nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h +endif + +EXTHEADERS += glx.h +EXTSOURCES += glx.c +EXTENSION_XML += glx.xml +if BUILD_GLX +lib_LTLIBRARIES += libxcb-glx.la libxcb_glx_la_LDFLAGS = -version-info 0:0:0 libxcb_glx_la_LIBADD = $(XCB_LIBS) -libxcb_glx_la_SOURCES = glx.c glx.h - -libxcb_randr_la_LDFLAGS = -version-info 0:0:0 +nodist_libxcb_glx_la_SOURCES = glx.c glx.h +endif + +EXTHEADERS += randr.h +EXTSOURCES += randr.c +EXTENSION_XML += randr.xml +if BUILD_RANDR +lib_LTLIBRARIES += libxcb-randr.la +libxcb_randr_la_LDFLAGS = -version-info 1:0:1 libxcb_randr_la_LIBADD = $(XCB_LIBS) -libxcb_randr_la_SOURCES = randr.c randr.h - +nodist_libxcb_randr_la_SOURCES = randr.c randr.h +endif + +EXTHEADERS += record.h +EXTSOURCES += record.c +EXTENSION_XML += record.xml +if BUILD_RECORD +lib_LTLIBRARIES += libxcb-record.la libxcb_record_la_LDFLAGS = -version-info 0:0:0 libxcb_record_la_LIBADD = $(XCB_LIBS) -libxcb_record_la_SOURCES = record.c record.h - +nodist_libxcb_record_la_SOURCES = record.c record.h +endif + +EXTHEADERS += render.h +EXTSOURCES += render.c +EXTENSION_XML += render.xml +if BUILD_RENDER +lib_LTLIBRARIES += libxcb-render.la libxcb_render_la_LDFLAGS = -version-info 0:0:0 libxcb_render_la_LIBADD = $(XCB_LIBS) -libxcb_render_la_SOURCES = render.c render.h - +nodist_libxcb_render_la_SOURCES = render.c render.h +endif + +EXTHEADERS += res.h +EXTSOURCES += res.c +EXTENSION_XML += res.xml +if BUILD_RESOURCE +lib_LTLIBRARIES += libxcb-res.la libxcb_res_la_LDFLAGS = -version-info 0:0:0 libxcb_res_la_LIBADD = $(XCB_LIBS) -libxcb_res_la_SOURCES = res.c res.h - +nodist_libxcb_res_la_SOURCES = res.c res.h +endif + +EXTHEADERS += screensaver.h +EXTSOURCES += screensaver.c +EXTENSION_XML += screensaver.xml +if BUILD_SCREENSAVER +lib_LTLIBRARIES += libxcb-screensaver.la libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 libxcb_screensaver_la_LIBADD = $(XCB_LIBS) -libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h - +nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h +endif + +EXTHEADERS += shape.h +EXTSOURCES += shape.c +EXTENSION_XML += shape.xml +if BUILD_SHAPE +lib_LTLIBRARIES += libxcb-shape.la libxcb_shape_la_LDFLAGS = -version-info 0:0:0 libxcb_shape_la_LIBADD = $(XCB_LIBS) -libxcb_shape_la_SOURCES = shape.c shape.h - +nodist_libxcb_shape_la_SOURCES = shape.c shape.h +endif + +EXTHEADERS += shm.h +EXTSOURCES += shm.c +EXTENSION_XML += shm.xml +if BUILD_SHM +lib_LTLIBRARIES += libxcb-shm.la libxcb_shm_la_LDFLAGS = -version-info 0:0:0 libxcb_shm_la_LIBADD = $(XCB_LIBS) -libxcb_shm_la_SOURCES = shm.c shm.h - +nodist_libxcb_shm_la_SOURCES = shm.c shm.h +endif + +EXTHEADERS += sync.h +EXTSOURCES += sync.c +EXTENSION_XML += sync.xml +if BUILD_SYNC +lib_LTLIBRARIES += libxcb-sync.la libxcb_sync_la_LDFLAGS = -version-info 0:0:0 libxcb_sync_la_LIBADD = $(XCB_LIBS) -libxcb_sync_la_SOURCES = sync.c sync.h - +nodist_libxcb_sync_la_SOURCES = sync.c sync.h +endif + +EXTHEADERS += xevie.h +EXTSOURCES += xevie.c +EXTENSION_XML += xevie.xml +if BUILD_XEVIE +lib_LTLIBRARIES += libxcb-xevie.la libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 libxcb_xevie_la_LIBADD = $(XCB_LIBS) -libxcb_xevie_la_SOURCES = xevie.c xevie.h - +nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h +endif + +EXTHEADERS += xf86dri.h +EXTSOURCES += xf86dri.c +EXTENSION_XML += xf86dri.xml +if BUILD_XFREE86_DRI +lib_LTLIBRARIES += libxcb-xf86dri.la libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 libxcb_xf86dri_la_LIBADD = $(XCB_LIBS) -libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h - +nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h +endif + +EXTHEADERS += xfixes.h +EXTSOURCES += xfixes.c +EXTENSION_XML += xfixes.xml +if BUILD_XFIXES +lib_LTLIBRARIES += libxcb-xfixes.la libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 libxcb_xfixes_la_LIBADD = $(XCB_LIBS) -libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h - +nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h +endif + +EXTHEADERS += xinerama.h +EXTSOURCES += xinerama.c +EXTENSION_XML += xinerama.xml +if BUILD_XINERAMA +lib_LTLIBRARIES += libxcb-xinerama.la +libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 +libxcb_xinerama_la_LIBADD = $(XCB_LIBS) +nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h +endif + +EXTHEADERS += xinput.h +EXTSOURCES += xinput.c +EXTENSION_XML += xinput.xml +if BUILD_XINPUT +lib_LTLIBRARIES += libxcb-xinput.la +libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 +libxcb_xinput_la_LIBADD = $(XCB_LIBS) +nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h +endif + +EXTHEADERS += xprint.h +EXTSOURCES += xprint.c +EXTENSION_XML += xprint.xml +if BUILD_XPRINT +lib_LTLIBRARIES += libxcb-xprint.la libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 libxcb_xprint_la_LIBADD = $(XCB_LIBS) -libxcb_xprint_la_SOURCES = xprint.c xprint.h - +nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h +endif + +EXTHEADERS += xselinux.h +EXTSOURCES += xselinux.c +EXTENSION_XML += xselinux.xml +if BUILD_SELINUX +lib_LTLIBRARIES += libxcb-xselinux.la +libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 +libxcb_xselinux_la_LIBADD = $(XCB_LIBS) +nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h +endif + +EXTHEADERS += xtest.h +EXTSOURCES += xtest.c +EXTENSION_XML += xtest.xml +if BUILD_XTEST +lib_LTLIBRARIES += libxcb-xtest.la libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 libxcb_xtest_la_LIBADD = $(XCB_LIBS) -libxcb_xtest_la_SOURCES = xtest.c xtest.h - +nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h +endif + +EXTHEADERS += xv.h +EXTSOURCES += xv.c +EXTENSION_XML += xv.xml +if BUILD_XV +lib_LTLIBRARIES += libxcb-xv.la libxcb_xv_la_LDFLAGS = -version-info 0:0:0 libxcb_xv_la_LIBADD = $(XCB_LIBS) -libxcb_xv_la_SOURCES = xv.c xv.h - +nodist_libxcb_xv_la_SOURCES = xv.c xv.h +endif + +EXTHEADERS += xvmc.h +EXTSOURCES += xvmc.c +EXTENSION_XML += xvmc.xml +if BUILD_XVMC +lib_LTLIBRARIES += libxcb-xvmc.la libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 libxcb_xvmc_la_LIBADD = $(XCB_LIBS) -libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h +nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h +endif -libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -libxcb_xinerama_la_LIBADD = $(XCB_LIBS) -libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h -$(EXTHEADERS) $(EXTSOURCES): c-client.xsl + +xcbinclude_HEADERS = xcb.h xcbext.h +nodist_xcbinclude_HEADERS = $(EXTHEADERS) +noinst_HEADERS = xcbint.h + +BUILT_SOURCES = $(EXTSOURCES) $(EXTHEADERS) +CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(EXTENSION_XML) + +$(EXTHEADERS) $(EXTSOURCES): c_client.py SUFFIXES = .xml .xml.h: - @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n) - $(XSLTPROC) --stringparam mode header \ - --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - -o $@ $(srcdir)/c-client.xsl $< + $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$< .xml.c: - @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n) - $(XSLTPROC) --stringparam mode source \ - --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - -o $@ $(srcdir)/c-client.xsl $< + $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$< $(EXTENSION_XML): $(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@ diff --git a/libxcb/src/Makefile.in b/libxcb/src/Makefile.in index a6c214d3a..761348a35 100644 --- a/libxcb/src/Makefile.in +++ b/libxcb/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,15 +15,11 @@ @SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c @@ -37,6 +33,28 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@BUILD_COMPOSITE_TRUE@am__append_1 = libxcb-composite.la +@BUILD_DAMAGE_TRUE@am__append_2 = libxcb-damage.la +@BUILD_DPMS_TRUE@am__append_3 = libxcb-dpms.la +@BUILD_GLX_TRUE@am__append_4 = libxcb-glx.la +@BUILD_RANDR_TRUE@am__append_5 = libxcb-randr.la +@BUILD_RECORD_TRUE@am__append_6 = libxcb-record.la +@BUILD_RENDER_TRUE@am__append_7 = libxcb-render.la +@BUILD_RESOURCE_TRUE@am__append_8 = libxcb-res.la +@BUILD_SCREENSAVER_TRUE@am__append_9 = libxcb-screensaver.la +@BUILD_SHAPE_TRUE@am__append_10 = libxcb-shape.la +@BUILD_SHM_TRUE@am__append_11 = libxcb-shm.la +@BUILD_SYNC_TRUE@am__append_12 = libxcb-sync.la +@BUILD_XEVIE_TRUE@am__append_13 = libxcb-xevie.la +@BUILD_XFREE86_DRI_TRUE@am__append_14 = libxcb-xf86dri.la +@BUILD_XFIXES_TRUE@am__append_15 = libxcb-xfixes.la +@BUILD_XINERAMA_TRUE@am__append_16 = libxcb-xinerama.la +@BUILD_XINPUT_TRUE@am__append_17 = libxcb-xinput.la +@BUILD_XPRINT_TRUE@am__append_18 = libxcb-xprint.la +@BUILD_SELINUX_TRUE@am__append_19 = libxcb-xselinux.la +@BUILD_XTEST_TRUE@am__append_20 = libxcb-xtest.la +@BUILD_XV_TRUE@am__append_21 = libxcb-xv.la +@BUILD_XVMC_TRUE@am__append_22 = libxcb-xvmc.la subdir = src DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ @@ -55,121 +73,223 @@ am__vpath_adj = case $$p in \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xcbincludedir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xcbincludedir)" \ + "$(DESTDIR)$(xcbincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = libxcb.la -libxcb_composite_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_composite_la_OBJECTS = composite.lo -libxcb_composite_la_OBJECTS = $(am_libxcb_composite_la_OBJECTS) -libxcb_damage_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_damage_la_OBJECTS = damage.lo -libxcb_damage_la_OBJECTS = $(am_libxcb_damage_la_OBJECTS) -libxcb_dpms_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_dpms_la_OBJECTS = dpms.lo -libxcb_dpms_la_OBJECTS = $(am_libxcb_dpms_la_OBJECTS) -libxcb_glx_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_glx_la_OBJECTS = glx.lo -libxcb_glx_la_OBJECTS = $(am_libxcb_glx_la_OBJECTS) -libxcb_randr_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_randr_la_OBJECTS = randr.lo -libxcb_randr_la_OBJECTS = $(am_libxcb_randr_la_OBJECTS) -libxcb_record_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_record_la_OBJECTS = record.lo -libxcb_record_la_OBJECTS = $(am_libxcb_record_la_OBJECTS) -libxcb_render_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_render_la_OBJECTS = render.lo -libxcb_render_la_OBJECTS = $(am_libxcb_render_la_OBJECTS) -libxcb_res_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_res_la_OBJECTS = res.lo -libxcb_res_la_OBJECTS = $(am_libxcb_res_la_OBJECTS) -libxcb_screensaver_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_screensaver_la_OBJECTS = screensaver.lo -libxcb_screensaver_la_OBJECTS = $(am_libxcb_screensaver_la_OBJECTS) -libxcb_shape_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_shape_la_OBJECTS = shape.lo -libxcb_shape_la_OBJECTS = $(am_libxcb_shape_la_OBJECTS) -libxcb_shm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_shm_la_OBJECTS = shm.lo -libxcb_shm_la_OBJECTS = $(am_libxcb_shm_la_OBJECTS) -libxcb_sync_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_sync_la_OBJECTS = sync.lo -libxcb_sync_la_OBJECTS = $(am_libxcb_sync_la_OBJECTS) -libxcb_xevie_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xevie_la_OBJECTS = xevie.lo -libxcb_xevie_la_OBJECTS = $(am_libxcb_xevie_la_OBJECTS) -libxcb_xf86dri_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xf86dri_la_OBJECTS = xf86dri.lo -libxcb_xf86dri_la_OBJECTS = $(am_libxcb_xf86dri_la_OBJECTS) -libxcb_xfixes_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xfixes_la_OBJECTS = xfixes.lo -libxcb_xfixes_la_OBJECTS = $(am_libxcb_xfixes_la_OBJECTS) -libxcb_xinerama_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xinerama_la_OBJECTS = xinerama.lo -libxcb_xinerama_la_OBJECTS = $(am_libxcb_xinerama_la_OBJECTS) -libxcb_xlib_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xlib_la_OBJECTS = xcb_xlib.lo -libxcb_xlib_la_OBJECTS = $(am_libxcb_xlib_la_OBJECTS) -libxcb_xprint_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xprint_la_OBJECTS = xprint.lo -libxcb_xprint_la_OBJECTS = $(am_libxcb_xprint_la_OBJECTS) -libxcb_xtest_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xtest_la_OBJECTS = xtest.lo -libxcb_xtest_la_OBJECTS = $(am_libxcb_xtest_la_OBJECTS) -libxcb_xv_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xv_la_OBJECTS = xv.lo -libxcb_xv_la_OBJECTS = $(am_libxcb_xv_la_OBJECTS) -libxcb_xvmc_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libxcb_xvmc_la_OBJECTS = xvmc.lo -libxcb_xvmc_la_OBJECTS = $(am_libxcb_xvmc_la_OBJECTS) -am__DEPENDENCIES_2 = -libxcb_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_2) +@BUILD_COMPOSITE_TRUE@libxcb_composite_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_COMPOSITE_TRUE@nodist_libxcb_composite_la_OBJECTS = \ +@BUILD_COMPOSITE_TRUE@ composite.lo +libxcb_composite_la_OBJECTS = $(nodist_libxcb_composite_la_OBJECTS) +libxcb_composite_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_composite_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_COMPOSITE_TRUE@am_libxcb_composite_la_rpath = -rpath $(libdir) +@BUILD_DAMAGE_TRUE@libxcb_damage_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_DAMAGE_TRUE@nodist_libxcb_damage_la_OBJECTS = damage.lo +libxcb_damage_la_OBJECTS = $(nodist_libxcb_damage_la_OBJECTS) +libxcb_damage_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_damage_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_DAMAGE_TRUE@am_libxcb_damage_la_rpath = -rpath $(libdir) +@BUILD_DPMS_TRUE@libxcb_dpms_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_DPMS_TRUE@nodist_libxcb_dpms_la_OBJECTS = dpms.lo +libxcb_dpms_la_OBJECTS = $(nodist_libxcb_dpms_la_OBJECTS) +libxcb_dpms_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_dpms_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_DPMS_TRUE@am_libxcb_dpms_la_rpath = -rpath $(libdir) +@BUILD_GLX_TRUE@libxcb_glx_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_GLX_TRUE@nodist_libxcb_glx_la_OBJECTS = glx.lo +libxcb_glx_la_OBJECTS = $(nodist_libxcb_glx_la_OBJECTS) +libxcb_glx_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_glx_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_GLX_TRUE@am_libxcb_glx_la_rpath = -rpath $(libdir) +@BUILD_RANDR_TRUE@libxcb_randr_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_RANDR_TRUE@nodist_libxcb_randr_la_OBJECTS = randr.lo +libxcb_randr_la_OBJECTS = $(nodist_libxcb_randr_la_OBJECTS) +libxcb_randr_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_randr_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_RANDR_TRUE@am_libxcb_randr_la_rpath = -rpath $(libdir) +@BUILD_RECORD_TRUE@libxcb_record_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_RECORD_TRUE@nodist_libxcb_record_la_OBJECTS = record.lo +libxcb_record_la_OBJECTS = $(nodist_libxcb_record_la_OBJECTS) +libxcb_record_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_record_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_RECORD_TRUE@am_libxcb_record_la_rpath = -rpath $(libdir) +@BUILD_RENDER_TRUE@libxcb_render_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_RENDER_TRUE@nodist_libxcb_render_la_OBJECTS = render.lo +libxcb_render_la_OBJECTS = $(nodist_libxcb_render_la_OBJECTS) +libxcb_render_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_render_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_RENDER_TRUE@am_libxcb_render_la_rpath = -rpath $(libdir) +@BUILD_RESOURCE_TRUE@libxcb_res_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_RESOURCE_TRUE@nodist_libxcb_res_la_OBJECTS = res.lo +libxcb_res_la_OBJECTS = $(nodist_libxcb_res_la_OBJECTS) +libxcb_res_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_res_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_RESOURCE_TRUE@am_libxcb_res_la_rpath = -rpath $(libdir) +@BUILD_SCREENSAVER_TRUE@libxcb_screensaver_la_DEPENDENCIES = \ +@BUILD_SCREENSAVER_TRUE@ $(XCB_LIBS) +@BUILD_SCREENSAVER_TRUE@nodist_libxcb_screensaver_la_OBJECTS = \ +@BUILD_SCREENSAVER_TRUE@ screensaver.lo +libxcb_screensaver_la_OBJECTS = \ + $(nodist_libxcb_screensaver_la_OBJECTS) +libxcb_screensaver_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_screensaver_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_SCREENSAVER_TRUE@am_libxcb_screensaver_la_rpath = -rpath \ +@BUILD_SCREENSAVER_TRUE@ $(libdir) +@BUILD_SHAPE_TRUE@libxcb_shape_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_SHAPE_TRUE@nodist_libxcb_shape_la_OBJECTS = shape.lo +libxcb_shape_la_OBJECTS = $(nodist_libxcb_shape_la_OBJECTS) +libxcb_shape_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_shape_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_SHAPE_TRUE@am_libxcb_shape_la_rpath = -rpath $(libdir) +@BUILD_SHM_TRUE@libxcb_shm_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_SHM_TRUE@nodist_libxcb_shm_la_OBJECTS = shm.lo +libxcb_shm_la_OBJECTS = $(nodist_libxcb_shm_la_OBJECTS) +libxcb_shm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_shm_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_SHM_TRUE@am_libxcb_shm_la_rpath = -rpath $(libdir) +@BUILD_SYNC_TRUE@libxcb_sync_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_SYNC_TRUE@nodist_libxcb_sync_la_OBJECTS = sync.lo +libxcb_sync_la_OBJECTS = $(nodist_libxcb_sync_la_OBJECTS) +libxcb_sync_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_sync_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_SYNC_TRUE@am_libxcb_sync_la_rpath = -rpath $(libdir) +@BUILD_XEVIE_TRUE@libxcb_xevie_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XEVIE_TRUE@nodist_libxcb_xevie_la_OBJECTS = xevie.lo +libxcb_xevie_la_OBJECTS = $(nodist_libxcb_xevie_la_OBJECTS) +libxcb_xevie_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xevie_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XEVIE_TRUE@am_libxcb_xevie_la_rpath = -rpath $(libdir) +@BUILD_XFREE86_DRI_TRUE@libxcb_xf86dri_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XFREE86_DRI_TRUE@nodist_libxcb_xf86dri_la_OBJECTS = xf86dri.lo +libxcb_xf86dri_la_OBJECTS = $(nodist_libxcb_xf86dri_la_OBJECTS) +libxcb_xf86dri_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xf86dri_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XFREE86_DRI_TRUE@am_libxcb_xf86dri_la_rpath = -rpath $(libdir) +@BUILD_XFIXES_TRUE@libxcb_xfixes_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XFIXES_TRUE@nodist_libxcb_xfixes_la_OBJECTS = xfixes.lo +libxcb_xfixes_la_OBJECTS = $(nodist_libxcb_xfixes_la_OBJECTS) +libxcb_xfixes_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xfixes_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XFIXES_TRUE@am_libxcb_xfixes_la_rpath = -rpath $(libdir) +@BUILD_XINERAMA_TRUE@libxcb_xinerama_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XINERAMA_TRUE@nodist_libxcb_xinerama_la_OBJECTS = xinerama.lo +libxcb_xinerama_la_OBJECTS = $(nodist_libxcb_xinerama_la_OBJECTS) +libxcb_xinerama_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xinerama_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XINERAMA_TRUE@am_libxcb_xinerama_la_rpath = -rpath $(libdir) +@BUILD_XINPUT_TRUE@libxcb_xinput_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XINPUT_TRUE@nodist_libxcb_xinput_la_OBJECTS = xinput.lo +libxcb_xinput_la_OBJECTS = $(nodist_libxcb_xinput_la_OBJECTS) +libxcb_xinput_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xinput_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XINPUT_TRUE@am_libxcb_xinput_la_rpath = -rpath $(libdir) +@BUILD_XPRINT_TRUE@libxcb_xprint_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XPRINT_TRUE@nodist_libxcb_xprint_la_OBJECTS = xprint.lo +libxcb_xprint_la_OBJECTS = $(nodist_libxcb_xprint_la_OBJECTS) +libxcb_xprint_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xprint_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XPRINT_TRUE@am_libxcb_xprint_la_rpath = -rpath $(libdir) +@BUILD_SELINUX_TRUE@libxcb_xselinux_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_SELINUX_TRUE@nodist_libxcb_xselinux_la_OBJECTS = xselinux.lo +libxcb_xselinux_la_OBJECTS = $(nodist_libxcb_xselinux_la_OBJECTS) +libxcb_xselinux_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xselinux_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_SELINUX_TRUE@am_libxcb_xselinux_la_rpath = -rpath $(libdir) +@BUILD_XTEST_TRUE@libxcb_xtest_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XTEST_TRUE@nodist_libxcb_xtest_la_OBJECTS = xtest.lo +libxcb_xtest_la_OBJECTS = $(nodist_libxcb_xtest_la_OBJECTS) +libxcb_xtest_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xtest_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XTEST_TRUE@am_libxcb_xtest_la_rpath = -rpath $(libdir) +@BUILD_XV_TRUE@libxcb_xv_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XV_TRUE@nodist_libxcb_xv_la_OBJECTS = xv.lo +libxcb_xv_la_OBJECTS = $(nodist_libxcb_xv_la_OBJECTS) +libxcb_xv_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xv_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XV_TRUE@am_libxcb_xv_la_rpath = -rpath $(libdir) +@BUILD_XVMC_TRUE@libxcb_xvmc_la_DEPENDENCIES = $(XCB_LIBS) +@BUILD_XVMC_TRUE@nodist_libxcb_xvmc_la_OBJECTS = xvmc.lo +libxcb_xvmc_la_OBJECTS = $(nodist_libxcb_xvmc_la_OBJECTS) +libxcb_xvmc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_xvmc_la_LDFLAGS) $(LDFLAGS) -o $@ +@BUILD_XVMC_TRUE@am_libxcb_xvmc_la_rpath = -rpath $(libdir) +am__DEPENDENCIES_1 = +libxcb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libxcb_la_OBJECTS = xcb_conn.lo xcb_out.lo xcb_in.lo xcb_ext.lo \ - xcb_xid.lo xcb_list.lo xcb_util.lo xcb_auth.lo xproto.lo \ - bigreq.lo xc_misc.lo -libxcb_la_OBJECTS = $(am_libxcb_la_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. + xcb_xid.lo xcb_list.lo xcb_util.lo xcb_auth.lo +nodist_libxcb_la_OBJECTS = xproto.lo bigreq.lo xc_misc.lo +libxcb_la_OBJECTS = $(am_libxcb_la_OBJECTS) \ + $(nodist_libxcb_la_OBJECTS) +libxcb_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxcb_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libxcb_composite_la_SOURCES) $(libxcb_damage_la_SOURCES) \ - $(libxcb_dpms_la_SOURCES) $(libxcb_glx_la_SOURCES) \ - $(libxcb_randr_la_SOURCES) $(libxcb_record_la_SOURCES) \ - $(libxcb_render_la_SOURCES) $(libxcb_res_la_SOURCES) \ - $(libxcb_screensaver_la_SOURCES) $(libxcb_shape_la_SOURCES) \ - $(libxcb_shm_la_SOURCES) $(libxcb_sync_la_SOURCES) \ - $(libxcb_xevie_la_SOURCES) $(libxcb_xf86dri_la_SOURCES) \ - $(libxcb_xfixes_la_SOURCES) $(libxcb_xinerama_la_SOURCES) \ - $(libxcb_xlib_la_SOURCES) $(libxcb_xprint_la_SOURCES) \ - $(libxcb_xtest_la_SOURCES) $(libxcb_xv_la_SOURCES) \ - $(libxcb_xvmc_la_SOURCES) $(libxcb_la_SOURCES) -DIST_SOURCES = $(libxcb_composite_la_SOURCES) \ - $(libxcb_damage_la_SOURCES) $(libxcb_dpms_la_SOURCES) \ - $(libxcb_glx_la_SOURCES) $(libxcb_randr_la_SOURCES) \ - $(libxcb_record_la_SOURCES) $(libxcb_render_la_SOURCES) \ - $(libxcb_res_la_SOURCES) $(libxcb_screensaver_la_SOURCES) \ - $(libxcb_shape_la_SOURCES) $(libxcb_shm_la_SOURCES) \ - $(libxcb_sync_la_SOURCES) $(libxcb_xevie_la_SOURCES) \ - $(libxcb_xf86dri_la_SOURCES) $(libxcb_xfixes_la_SOURCES) \ - $(libxcb_xinerama_la_SOURCES) $(libxcb_xlib_la_SOURCES) \ - $(libxcb_xprint_la_SOURCES) $(libxcb_xtest_la_SOURCES) \ - $(libxcb_xv_la_SOURCES) $(libxcb_xvmc_la_SOURCES) \ - $(libxcb_la_SOURCES) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nodist_libxcb_composite_la_SOURCES) \ + $(nodist_libxcb_damage_la_SOURCES) \ + $(nodist_libxcb_dpms_la_SOURCES) \ + $(nodist_libxcb_glx_la_SOURCES) \ + $(nodist_libxcb_randr_la_SOURCES) \ + $(nodist_libxcb_record_la_SOURCES) \ + $(nodist_libxcb_render_la_SOURCES) \ + $(nodist_libxcb_res_la_SOURCES) \ + $(nodist_libxcb_screensaver_la_SOURCES) \ + $(nodist_libxcb_shape_la_SOURCES) \ + $(nodist_libxcb_shm_la_SOURCES) \ + $(nodist_libxcb_sync_la_SOURCES) \ + $(nodist_libxcb_xevie_la_SOURCES) \ + $(nodist_libxcb_xf86dri_la_SOURCES) \ + $(nodist_libxcb_xfixes_la_SOURCES) \ + $(nodist_libxcb_xinerama_la_SOURCES) \ + $(nodist_libxcb_xinput_la_SOURCES) \ + $(nodist_libxcb_xprint_la_SOURCES) \ + $(nodist_libxcb_xselinux_la_SOURCES) \ + $(nodist_libxcb_xtest_la_SOURCES) \ + $(nodist_libxcb_xv_la_SOURCES) \ + $(nodist_libxcb_xvmc_la_SOURCES) $(libxcb_la_SOURCES) \ + $(nodist_libxcb_la_SOURCES) +DIST_SOURCES = $(libxcb_la_SOURCES) +nodist_xcbincludeHEADERS_INSTALL = $(INSTALL_HEADER) xcbincludeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(noinst_HEADERS) $(xcbinclude_HEADERS) +HEADERS = $(nodist_xcbinclude_HEADERS) $(noinst_HEADERS) \ + $(xcbinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ @@ -177,8 +297,6 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_DOCS = @BUILD_DOCS@ -BUILD_DOCS_FALSE = @BUILD_DOCS_FALSE@ -BUILD_DOCS_TRUE = @BUILD_DOCS_TRUE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ @@ -187,41 +305,45 @@ CHECK_LIBS = @CHECK_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -HAVE_CHECK_FALSE = @HAVE_CHECK_FALSE@ -HAVE_CHECK_TRUE = @HAVE_CHECK_TRUE@ HTML_CHECK_RESULT = @HTML_CHECK_RESULT@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LAUNCHD = @LAUNCHD@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ NEEDED = @NEEDED@ NEEDED_CFLAGS = @NEEDED_CFLAGS@ NEEDED_LIBS = @NEEDED_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -230,24 +352,31 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XCBPROTO_CFLAGS = @XCBPROTO_CFLAGS@ XCBPROTO_LIBS = @XCBPROTO_LIBS@ +XCBPROTO_VERSION = @XCBPROTO_VERSION@ XCBPROTO_XCBINCLUDEDIR = @XCBPROTO_XCBINCLUDEDIR@ +XCBPROTO_XCBPYTHONDIR = @XCBPROTO_XCBPYTHONDIR@ XDMCP_CFLAGS = @XDMCP_CFLAGS@ XDMCP_LIBS = @XDMCP_LIBS@ XSLTPROC = @XSLTPROC@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -259,6 +388,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -277,122 +407,57 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ xcbincludedir = @xcbincludedir@ -lib_LTLIBRARIES = libxcb.la \ - libxcb-xlib.la \ - libxcb-composite.la \ - libxcb-damage.la \ - libxcb-dpms.la \ - libxcb-glx.la \ - libxcb-randr.la \ - libxcb-record.la \ - libxcb-render.la \ - libxcb-res.la \ - libxcb-screensaver.la \ - libxcb-shape.la \ - libxcb-shm.la \ - libxcb-sync.la \ - libxcb-xevie.la \ - libxcb-xf86dri.la \ - libxcb-xfixes.la \ - libxcb-xinerama.la \ - libxcb-xprint.la \ - libxcb-xtest.la \ - libxcb-xv.la \ - libxcb-xvmc.la - -EXTHEADERS = xproto.h \ - bigreq.h \ - composite.h \ - damage.h \ - dpms.h \ - glx.h \ - randr.h \ - record.h \ - render.h \ - res.h \ - screensaver.h \ - shape.h \ - shm.h \ - sync.h \ - xc_misc.h \ - xevie.h \ - xf86dri.h \ - xfixes.h \ - xinerama.h \ - xprint.h \ - xtest.h \ - xv.h \ - xvmc.h - -EXTSOURCES = xproto.c \ - bigreq.c \ - composite.c \ - damage.c \ - dpms.c \ - glx.c \ - randr.c \ - record.c \ - render.c \ - res.c \ - screensaver.c \ - shape.c \ - shm.c \ - sync.c \ - xc_misc.c \ - xevie.c \ - xf86dri.c \ - xfixes.c \ - xinerama.c \ - xprint.c \ - xtest.c \ - xv.c \ - xvmc.c - -EXTENSION_XML = xproto.xml \ - bigreq.xml \ - composite.xml \ - damage.xml \ - dpms.xml \ - glx.xml \ - randr.xml \ - record.xml \ - render.xml \ - res.xml \ - screensaver.xml \ - shape.xml \ - shm.xml \ - sync.xml \ - xc_misc.xml \ - xevie.xml \ - xf86dri.xml \ - xfixes.xml \ - xinerama.xml \ - xprint.xml \ - xtest.xml \ - xvmc.xml \ - xv.xml - -xcbinclude_HEADERS = xcb.h xcbext.h xcbxlib.h $(EXTHEADERS) -noinst_HEADERS = xcbint.h +lib_LTLIBRARIES = libxcb.la $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_9) $(am__append_10) $(am__append_11) \ + $(am__append_12) $(am__append_13) $(am__append_14) \ + $(am__append_15) $(am__append_16) $(am__append_17) \ + $(am__append_18) $(am__append_19) $(am__append_20) \ + $(am__append_21) $(am__append_22) + +# FIXME: find a way to autogenerate this from the XML files. +EXTHEADERS = xproto.h bigreq.h xc_misc.h composite.h damage.h dpms.h \ + glx.h randr.h record.h render.h res.h screensaver.h shape.h \ + shm.h sync.h xevie.h xf86dri.h xfixes.h xinerama.h xinput.h \ + xprint.h xselinux.h xtest.h xv.h xvmc.h +EXTSOURCES = xproto.c bigreq.c xc_misc.c composite.c damage.c dpms.c \ + glx.c randr.c record.c render.c res.c screensaver.c shape.c \ + shm.c sync.c xevie.c xf86dri.c xfixes.c xinerama.c xinput.c \ + xprint.c xselinux.c xtest.c xv.c xvmc.c +EXTENSION_XML = xproto.xml bigreq.xml xc_misc.xml composite.xml \ + damage.xml dpms.xml glx.xml randr.xml record.xml render.xml \ + res.xml screensaver.xml shape.xml shm.xml sync.xml xevie.xml \ + xf86dri.xml xfixes.xml xinerama.xml xinput.xml xprint.xml \ + xselinux.xml xtest.xml xv.xml xvmc.xml AM_CFLAGS = $(CWARNFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS) libxcb_la_LIBADD = $(NEEDED_LIBS) $(XDMCP_LIBS) libxcb_la_SOURCES = \ xcb_conn.c xcb_out.c xcb_in.c xcb_ext.c xcb_xid.c \ - xcb_list.c xcb_util.c xcb_auth.c c-client.xsl \ - xproto.c bigreq.c xc_misc.c + xcb_list.c xcb_util.c xcb_auth.c c_client.py +nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c # Explanation for -version-info: # -version-info current:revision:age @@ -401,75 +466,79 @@ libxcb_la_SOURCES = \ # * If you add an interface, increment current and age and set revision to 0. # * If you change or remove an interface, increment current and set revision # and age to 0. -libxcb_la_LDFLAGS = -version-info 1:0:0 +libxcb_la_LDFLAGS = -version-info 2:0:1 +XCB_LIBS = libxcb.la +@BUILD_COMPOSITE_TRUE@libxcb_composite_la_LDFLAGS = -version-info 0:0:0 +@BUILD_COMPOSITE_TRUE@libxcb_composite_la_LIBADD = $(XCB_LIBS) +@BUILD_COMPOSITE_TRUE@nodist_libxcb_composite_la_SOURCES = composite.c composite.h +@BUILD_DAMAGE_TRUE@libxcb_damage_la_LDFLAGS = -version-info 0:0:0 +@BUILD_DAMAGE_TRUE@libxcb_damage_la_LIBADD = $(XCB_LIBS) +@BUILD_DAMAGE_TRUE@nodist_libxcb_damage_la_SOURCES = damage.c damage.h +@BUILD_DPMS_TRUE@libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 +@BUILD_DPMS_TRUE@libxcb_dpms_la_LIBADD = $(XCB_LIBS) +@BUILD_DPMS_TRUE@nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h +@BUILD_GLX_TRUE@libxcb_glx_la_LDFLAGS = -version-info 0:0:0 +@BUILD_GLX_TRUE@libxcb_glx_la_LIBADD = $(XCB_LIBS) +@BUILD_GLX_TRUE@nodist_libxcb_glx_la_SOURCES = glx.c glx.h +@BUILD_RANDR_TRUE@libxcb_randr_la_LDFLAGS = -version-info 1:0:1 +@BUILD_RANDR_TRUE@libxcb_randr_la_LIBADD = $(XCB_LIBS) +@BUILD_RANDR_TRUE@nodist_libxcb_randr_la_SOURCES = randr.c randr.h +@BUILD_RECORD_TRUE@libxcb_record_la_LDFLAGS = -version-info 0:0:0 +@BUILD_RECORD_TRUE@libxcb_record_la_LIBADD = $(XCB_LIBS) +@BUILD_RECORD_TRUE@nodist_libxcb_record_la_SOURCES = record.c record.h +@BUILD_RENDER_TRUE@libxcb_render_la_LDFLAGS = -version-info 0:0:0 +@BUILD_RENDER_TRUE@libxcb_render_la_LIBADD = $(XCB_LIBS) +@BUILD_RENDER_TRUE@nodist_libxcb_render_la_SOURCES = render.c render.h +@BUILD_RESOURCE_TRUE@libxcb_res_la_LDFLAGS = -version-info 0:0:0 +@BUILD_RESOURCE_TRUE@libxcb_res_la_LIBADD = $(XCB_LIBS) +@BUILD_RESOURCE_TRUE@nodist_libxcb_res_la_SOURCES = res.c res.h +@BUILD_SCREENSAVER_TRUE@libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 +@BUILD_SCREENSAVER_TRUE@libxcb_screensaver_la_LIBADD = $(XCB_LIBS) +@BUILD_SCREENSAVER_TRUE@nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h +@BUILD_SHAPE_TRUE@libxcb_shape_la_LDFLAGS = -version-info 0:0:0 +@BUILD_SHAPE_TRUE@libxcb_shape_la_LIBADD = $(XCB_LIBS) +@BUILD_SHAPE_TRUE@nodist_libxcb_shape_la_SOURCES = shape.c shape.h +@BUILD_SHM_TRUE@libxcb_shm_la_LDFLAGS = -version-info 0:0:0 +@BUILD_SHM_TRUE@libxcb_shm_la_LIBADD = $(XCB_LIBS) +@BUILD_SHM_TRUE@nodist_libxcb_shm_la_SOURCES = shm.c shm.h +@BUILD_SYNC_TRUE@libxcb_sync_la_LDFLAGS = -version-info 0:0:0 +@BUILD_SYNC_TRUE@libxcb_sync_la_LIBADD = $(XCB_LIBS) +@BUILD_SYNC_TRUE@nodist_libxcb_sync_la_SOURCES = sync.c sync.h +@BUILD_XEVIE_TRUE@libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XEVIE_TRUE@libxcb_xevie_la_LIBADD = $(XCB_LIBS) +@BUILD_XEVIE_TRUE@nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h +@BUILD_XFREE86_DRI_TRUE@libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XFREE86_DRI_TRUE@libxcb_xf86dri_la_LIBADD = $(XCB_LIBS) +@BUILD_XFREE86_DRI_TRUE@nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h +@BUILD_XFIXES_TRUE@libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XFIXES_TRUE@libxcb_xfixes_la_LIBADD = $(XCB_LIBS) +@BUILD_XFIXES_TRUE@nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h +@BUILD_XINERAMA_TRUE@libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XINERAMA_TRUE@libxcb_xinerama_la_LIBADD = $(XCB_LIBS) +@BUILD_XINERAMA_TRUE@nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h +@BUILD_XINPUT_TRUE@libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XINPUT_TRUE@libxcb_xinput_la_LIBADD = $(XCB_LIBS) +@BUILD_XINPUT_TRUE@nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h +@BUILD_XPRINT_TRUE@libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XPRINT_TRUE@libxcb_xprint_la_LIBADD = $(XCB_LIBS) +@BUILD_XPRINT_TRUE@nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h +@BUILD_SELINUX_TRUE@libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 +@BUILD_SELINUX_TRUE@libxcb_xselinux_la_LIBADD = $(XCB_LIBS) +@BUILD_SELINUX_TRUE@nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h +@BUILD_XTEST_TRUE@libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XTEST_TRUE@libxcb_xtest_la_LIBADD = $(XCB_LIBS) +@BUILD_XTEST_TRUE@nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h +@BUILD_XV_TRUE@libxcb_xv_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XV_TRUE@libxcb_xv_la_LIBADD = $(XCB_LIBS) +@BUILD_XV_TRUE@nodist_libxcb_xv_la_SOURCES = xv.c xv.h +@BUILD_XVMC_TRUE@libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 +@BUILD_XVMC_TRUE@libxcb_xvmc_la_LIBADD = $(XCB_LIBS) +@BUILD_XVMC_TRUE@nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h +xcbinclude_HEADERS = xcb.h xcbext.h +nodist_xcbinclude_HEADERS = $(EXTHEADERS) +noinst_HEADERS = xcbint.h BUILT_SOURCES = $(EXTSOURCES) $(EXTHEADERS) CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(EXTENSION_XML) -XCB_LIBS = libxcb.la -libxcb_xlib_la_LDFLAGS = -version-info 0:0:0 -libxcb_xlib_la_LIBADD = $(XCB_LIBS) -libxcb_xlib_la_SOURCES = xcb_xlib.c - -# FIXME: find a way to autogenerate this from the XML files. -libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -libxcb_composite_la_LIBADD = $(XCB_LIBS) -libxcb_composite_la_SOURCES = composite.c composite.h -libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -libxcb_damage_la_LIBADD = $(XCB_LIBS) -libxcb_damage_la_SOURCES = damage.c damage.h -libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -libxcb_dpms_la_LIBADD = $(XCB_LIBS) -libxcb_dpms_la_SOURCES = dpms.c dpms.h -libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -libxcb_glx_la_LIBADD = $(XCB_LIBS) -libxcb_glx_la_SOURCES = glx.c glx.h -libxcb_randr_la_LDFLAGS = -version-info 0:0:0 -libxcb_randr_la_LIBADD = $(XCB_LIBS) -libxcb_randr_la_SOURCES = randr.c randr.h -libxcb_record_la_LDFLAGS = -version-info 0:0:0 -libxcb_record_la_LIBADD = $(XCB_LIBS) -libxcb_record_la_SOURCES = record.c record.h -libxcb_render_la_LDFLAGS = -version-info 0:0:0 -libxcb_render_la_LIBADD = $(XCB_LIBS) -libxcb_render_la_SOURCES = render.c render.h -libxcb_res_la_LDFLAGS = -version-info 0:0:0 -libxcb_res_la_LIBADD = $(XCB_LIBS) -libxcb_res_la_SOURCES = res.c res.h -libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -libxcb_screensaver_la_LIBADD = $(XCB_LIBS) -libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h -libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -libxcb_shape_la_LIBADD = $(XCB_LIBS) -libxcb_shape_la_SOURCES = shape.c shape.h -libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -libxcb_shm_la_LIBADD = $(XCB_LIBS) -libxcb_shm_la_SOURCES = shm.c shm.h -libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -libxcb_sync_la_LIBADD = $(XCB_LIBS) -libxcb_sync_la_SOURCES = sync.c sync.h -libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -libxcb_xevie_la_LIBADD = $(XCB_LIBS) -libxcb_xevie_la_SOURCES = xevie.c xevie.h -libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -libxcb_xf86dri_la_LIBADD = $(XCB_LIBS) -libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h -libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -libxcb_xfixes_la_LIBADD = $(XCB_LIBS) -libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h -libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -libxcb_xprint_la_LIBADD = $(XCB_LIBS) -libxcb_xprint_la_SOURCES = xprint.c xprint.h -libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -libxcb_xtest_la_LIBADD = $(XCB_LIBS) -libxcb_xtest_la_SOURCES = xtest.c xtest.h -libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -libxcb_xv_la_LIBADD = $(XCB_LIBS) -libxcb_xv_la_SOURCES = xv.c xv.h -libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -libxcb_xvmc_la_LIBADD = $(XCB_LIBS) -libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h -libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -libxcb_xinerama_la_LIBADD = $(XCB_LIBS) -libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h SUFFIXES = .xml all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -480,8 +549,8 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ @@ -509,7 +578,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -524,21 +593,21 @@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) - @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: @@ -550,49 +619,51 @@ clean-libLTLIBRARIES: rm -f "$${dir}/so_locations"; \ done libxcb-composite.la: $(libxcb_composite_la_OBJECTS) $(libxcb_composite_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_composite_la_LDFLAGS) $(libxcb_composite_la_OBJECTS) $(libxcb_composite_la_LIBADD) $(LIBS) + $(libxcb_composite_la_LINK) $(am_libxcb_composite_la_rpath) $(libxcb_composite_la_OBJECTS) $(libxcb_composite_la_LIBADD) $(LIBS) libxcb-damage.la: $(libxcb_damage_la_OBJECTS) $(libxcb_damage_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_damage_la_LDFLAGS) $(libxcb_damage_la_OBJECTS) $(libxcb_damage_la_LIBADD) $(LIBS) + $(libxcb_damage_la_LINK) $(am_libxcb_damage_la_rpath) $(libxcb_damage_la_OBJECTS) $(libxcb_damage_la_LIBADD) $(LIBS) libxcb-dpms.la: $(libxcb_dpms_la_OBJECTS) $(libxcb_dpms_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_dpms_la_LDFLAGS) $(libxcb_dpms_la_OBJECTS) $(libxcb_dpms_la_LIBADD) $(LIBS) + $(libxcb_dpms_la_LINK) $(am_libxcb_dpms_la_rpath) $(libxcb_dpms_la_OBJECTS) $(libxcb_dpms_la_LIBADD) $(LIBS) libxcb-glx.la: $(libxcb_glx_la_OBJECTS) $(libxcb_glx_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_glx_la_LDFLAGS) $(libxcb_glx_la_OBJECTS) $(libxcb_glx_la_LIBADD) $(LIBS) + $(libxcb_glx_la_LINK) $(am_libxcb_glx_la_rpath) $(libxcb_glx_la_OBJECTS) $(libxcb_glx_la_LIBADD) $(LIBS) libxcb-randr.la: $(libxcb_randr_la_OBJECTS) $(libxcb_randr_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_randr_la_LDFLAGS) $(libxcb_randr_la_OBJECTS) $(libxcb_randr_la_LIBADD) $(LIBS) + $(libxcb_randr_la_LINK) $(am_libxcb_randr_la_rpath) $(libxcb_randr_la_OBJECTS) $(libxcb_randr_la_LIBADD) $(LIBS) libxcb-record.la: $(libxcb_record_la_OBJECTS) $(libxcb_record_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_record_la_LDFLAGS) $(libxcb_record_la_OBJECTS) $(libxcb_record_la_LIBADD) $(LIBS) + $(libxcb_record_la_LINK) $(am_libxcb_record_la_rpath) $(libxcb_record_la_OBJECTS) $(libxcb_record_la_LIBADD) $(LIBS) libxcb-render.la: $(libxcb_render_la_OBJECTS) $(libxcb_render_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_render_la_LDFLAGS) $(libxcb_render_la_OBJECTS) $(libxcb_render_la_LIBADD) $(LIBS) + $(libxcb_render_la_LINK) $(am_libxcb_render_la_rpath) $(libxcb_render_la_OBJECTS) $(libxcb_render_la_LIBADD) $(LIBS) libxcb-res.la: $(libxcb_res_la_OBJECTS) $(libxcb_res_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_res_la_LDFLAGS) $(libxcb_res_la_OBJECTS) $(libxcb_res_la_LIBADD) $(LIBS) + $(libxcb_res_la_LINK) $(am_libxcb_res_la_rpath) $(libxcb_res_la_OBJECTS) $(libxcb_res_la_LIBADD) $(LIBS) libxcb-screensaver.la: $(libxcb_screensaver_la_OBJECTS) $(libxcb_screensaver_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_screensaver_la_LDFLAGS) $(libxcb_screensaver_la_OBJECTS) $(libxcb_screensaver_la_LIBADD) $(LIBS) + $(libxcb_screensaver_la_LINK) $(am_libxcb_screensaver_la_rpath) $(libxcb_screensaver_la_OBJECTS) $(libxcb_screensaver_la_LIBADD) $(LIBS) libxcb-shape.la: $(libxcb_shape_la_OBJECTS) $(libxcb_shape_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_shape_la_LDFLAGS) $(libxcb_shape_la_OBJECTS) $(libxcb_shape_la_LIBADD) $(LIBS) + $(libxcb_shape_la_LINK) $(am_libxcb_shape_la_rpath) $(libxcb_shape_la_OBJECTS) $(libxcb_shape_la_LIBADD) $(LIBS) libxcb-shm.la: $(libxcb_shm_la_OBJECTS) $(libxcb_shm_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_shm_la_LDFLAGS) $(libxcb_shm_la_OBJECTS) $(libxcb_shm_la_LIBADD) $(LIBS) + $(libxcb_shm_la_LINK) $(am_libxcb_shm_la_rpath) $(libxcb_shm_la_OBJECTS) $(libxcb_shm_la_LIBADD) $(LIBS) libxcb-sync.la: $(libxcb_sync_la_OBJECTS) $(libxcb_sync_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_sync_la_LDFLAGS) $(libxcb_sync_la_OBJECTS) $(libxcb_sync_la_LIBADD) $(LIBS) + $(libxcb_sync_la_LINK) $(am_libxcb_sync_la_rpath) $(libxcb_sync_la_OBJECTS) $(libxcb_sync_la_LIBADD) $(LIBS) libxcb-xevie.la: $(libxcb_xevie_la_OBJECTS) $(libxcb_xevie_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xevie_la_LDFLAGS) $(libxcb_xevie_la_OBJECTS) $(libxcb_xevie_la_LIBADD) $(LIBS) + $(libxcb_xevie_la_LINK) $(am_libxcb_xevie_la_rpath) $(libxcb_xevie_la_OBJECTS) $(libxcb_xevie_la_LIBADD) $(LIBS) libxcb-xf86dri.la: $(libxcb_xf86dri_la_OBJECTS) $(libxcb_xf86dri_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xf86dri_la_LDFLAGS) $(libxcb_xf86dri_la_OBJECTS) $(libxcb_xf86dri_la_LIBADD) $(LIBS) + $(libxcb_xf86dri_la_LINK) $(am_libxcb_xf86dri_la_rpath) $(libxcb_xf86dri_la_OBJECTS) $(libxcb_xf86dri_la_LIBADD) $(LIBS) libxcb-xfixes.la: $(libxcb_xfixes_la_OBJECTS) $(libxcb_xfixes_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xfixes_la_LDFLAGS) $(libxcb_xfixes_la_OBJECTS) $(libxcb_xfixes_la_LIBADD) $(LIBS) + $(libxcb_xfixes_la_LINK) $(am_libxcb_xfixes_la_rpath) $(libxcb_xfixes_la_OBJECTS) $(libxcb_xfixes_la_LIBADD) $(LIBS) libxcb-xinerama.la: $(libxcb_xinerama_la_OBJECTS) $(libxcb_xinerama_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xinerama_la_LDFLAGS) $(libxcb_xinerama_la_OBJECTS) $(libxcb_xinerama_la_LIBADD) $(LIBS) -libxcb-xlib.la: $(libxcb_xlib_la_OBJECTS) $(libxcb_xlib_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xlib_la_LDFLAGS) $(libxcb_xlib_la_OBJECTS) $(libxcb_xlib_la_LIBADD) $(LIBS) + $(libxcb_xinerama_la_LINK) $(am_libxcb_xinerama_la_rpath) $(libxcb_xinerama_la_OBJECTS) $(libxcb_xinerama_la_LIBADD) $(LIBS) +libxcb-xinput.la: $(libxcb_xinput_la_OBJECTS) $(libxcb_xinput_la_DEPENDENCIES) + $(libxcb_xinput_la_LINK) $(am_libxcb_xinput_la_rpath) $(libxcb_xinput_la_OBJECTS) $(libxcb_xinput_la_LIBADD) $(LIBS) libxcb-xprint.la: $(libxcb_xprint_la_OBJECTS) $(libxcb_xprint_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xprint_la_LDFLAGS) $(libxcb_xprint_la_OBJECTS) $(libxcb_xprint_la_LIBADD) $(LIBS) + $(libxcb_xprint_la_LINK) $(am_libxcb_xprint_la_rpath) $(libxcb_xprint_la_OBJECTS) $(libxcb_xprint_la_LIBADD) $(LIBS) +libxcb-xselinux.la: $(libxcb_xselinux_la_OBJECTS) $(libxcb_xselinux_la_DEPENDENCIES) + $(libxcb_xselinux_la_LINK) $(am_libxcb_xselinux_la_rpath) $(libxcb_xselinux_la_OBJECTS) $(libxcb_xselinux_la_LIBADD) $(LIBS) libxcb-xtest.la: $(libxcb_xtest_la_OBJECTS) $(libxcb_xtest_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xtest_la_LDFLAGS) $(libxcb_xtest_la_OBJECTS) $(libxcb_xtest_la_LIBADD) $(LIBS) + $(libxcb_xtest_la_LINK) $(am_libxcb_xtest_la_rpath) $(libxcb_xtest_la_OBJECTS) $(libxcb_xtest_la_LIBADD) $(LIBS) libxcb-xv.la: $(libxcb_xv_la_OBJECTS) $(libxcb_xv_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xv_la_LDFLAGS) $(libxcb_xv_la_OBJECTS) $(libxcb_xv_la_LIBADD) $(LIBS) + $(libxcb_xv_la_LINK) $(am_libxcb_xv_la_rpath) $(libxcb_xv_la_OBJECTS) $(libxcb_xv_la_LIBADD) $(LIBS) libxcb-xvmc.la: $(libxcb_xvmc_la_OBJECTS) $(libxcb_xvmc_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_xvmc_la_LDFLAGS) $(libxcb_xvmc_la_OBJECTS) $(libxcb_xvmc_la_LIBADD) $(LIBS) + $(libxcb_xvmc_la_LINK) $(am_libxcb_xvmc_la_rpath) $(libxcb_xvmc_la_OBJECTS) $(libxcb_xvmc_la_LIBADD) $(LIBS) libxcb.la: $(libxcb_la_OBJECTS) $(libxcb_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libxcb_la_LDFLAGS) $(libxcb_la_OBJECTS) $(libxcb_la_LIBADD) $(LIBS) + $(libxcb_la_LINK) -rpath $(libdir) $(libxcb_la_OBJECTS) $(libxcb_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -622,34 +693,35 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcb_out.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcb_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcb_xid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xcb_xlib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xevie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86dri.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfixes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinerama.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xproto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xselinux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xtest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvmc.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< @@ -659,13 +731,26 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-nodist_xcbincludeHEADERS: $(nodist_xcbinclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(xcbincludedir)" || $(MKDIR_P) "$(DESTDIR)$(xcbincludedir)" + @list='$(nodist_xcbinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_xcbincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(xcbincludedir)/$$f'"; \ + $(nodist_xcbincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(xcbincludedir)/$$f"; \ + done -distclean-libtool: - -rm -f libtool -uninstall-info-am: +uninstall-nodist_xcbincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_xcbinclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(xcbincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(xcbincludedir)/$$f"; \ + done install-xcbincludeHEADERS: $(xcbinclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(xcbincludedir)" || $(mkdir_p) "$(DESTDIR)$(xcbincludedir)" + test -z "$(xcbincludedir)" || $(MKDIR_P) "$(DESTDIR)$(xcbincludedir)" @list='$(xcbinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ @@ -686,8 +771,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -699,8 +784,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ @@ -710,13 +795,12 @@ ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ - here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -730,22 +814,21 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -761,8 +844,8 @@ check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xcbincludedir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(xcbincludedir)" "$(DESTDIR)$(xcbincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am @@ -800,7 +883,7 @@ distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags + distclean-hdr distclean-tags dvi: dvi-am @@ -812,14 +895,23 @@ info: info-am info-am: -install-data-am: install-xcbincludeHEADERS +install-data-am: install-nodist_xcbincludeHEADERS \ + install-xcbincludeHEADERS + +install-dvi: install-dvi-am install-exec-am: install-libLTLIBRARIES +install-html: install-html-am + install-info: install-info-am install-man: +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean: maintainer-clean-am @@ -840,39 +932,36 @@ ps: ps-am ps-am: -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-xcbincludeHEADERS +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-nodist_xcbincludeHEADERS uninstall-xcbincludeHEADERS + +.MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man \ - install-strip install-xcbincludeHEADERS installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES uninstall-xcbincludeHEADERS + install-nodist_xcbincludeHEADERS install-pdf install-pdf-am \ + install-ps install-ps-am install-strip \ + install-xcbincludeHEADERS installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_xcbincludeHEADERS uninstall-xcbincludeHEADERS -$(EXTHEADERS) $(EXTSOURCES): c-client.xsl +$(EXTHEADERS) $(EXTSOURCES): c_client.py .xml.h: - @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n) - $(XSLTPROC) --stringparam mode header \ - --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - -o $@ $(srcdir)/c-client.xsl $< + $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$< .xml.c: - @n=`dirname $*`; test -d $$n || (echo mkdir $$n; mkdir $$n) - $(XSLTPROC) --stringparam mode source \ - --stringparam base-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - --stringparam extension-path $(XCBPROTO_XCBINCLUDEDIR)/ \ - -o $@ $(srcdir)/c-client.xsl $< + $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$< $(EXTENSION_XML): $(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@ diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py new file mode 100644 index 000000000..d86d05e24 --- /dev/null +++ b/libxcb/src/c_client.py @@ -0,0 +1,1041 @@ +#!/usr/bin/env python +from xml.etree.cElementTree import * +from os.path import basename +import getopt +import sys +import re + +# Jump to the bottom of this file for the main routine + +# Some hacks to make the API more readable, and to keep backwards compability +_cname_re = re.compile('([A-Z0-9][a-z]+|[A-Z0-9]+(?![a-z])|[a-z]+)') +_cname_special_cases = {'DECnet':'decnet'} + +_extension_special_cases = ['XPrint', 'XCMisc', 'BigRequests'] + +_cplusplus_annoyances = {'class' : '_class', + 'new' : '_new', + 'delete': '_delete'} + +_hlines = [] +_hlevel = 0 +_clines = [] +_clevel = 0 +_ns = None + +def _h(fmt, *args): + ''' + Writes the given line to the header file. + ''' + _hlines[_hlevel].append(fmt % args) + +def _c(fmt, *args): + ''' + Writes the given line to the source file. + ''' + _clines[_clevel].append(fmt % args) + +def _hc(fmt, *args): + ''' + Writes the given line to both the header and source files. + ''' + _h(fmt, *args) + _c(fmt, *args) + +# XXX See if this level thing is really necessary. +def _h_setlevel(idx): + ''' + Changes the array that header lines are written to. + Supports writing different sections of the header file. + ''' + global _hlevel + while len(_hlines) <= idx: + _hlines.append([]) + _hlevel = idx + +def _c_setlevel(idx): + ''' + Changes the array that source lines are written to. + Supports writing to different sections of the source file. + ''' + global _clevel + while len(_clines) <= idx: + _clines.append([]) + _clevel = idx + +def _n_item(str): + ''' + Does C-name conversion on a single string fragment. + Uses a regexp with some hard-coded special cases. + ''' + if str in _cname_special_cases: + return _cname_special_cases[str] + else: + split = _cname_re.finditer(str) + name_parts = [match.group(0) for match in split] + return '_'.join(name_parts) + +def _cpp(str): + ''' + Checks for certain C++ reserved words and fixes them. + ''' + if str in _cplusplus_annoyances: + return _cplusplus_annoyances[str] + else: + return str + +def _ext(str): + ''' + Does C-name conversion on an extension name. + Has some additional special cases on top of _n_item. + ''' + if str in _extension_special_cases: + return _n_item(str).lower() + else: + return str.lower() + +def _n(list): + ''' + Does C-name conversion on a tuple of strings. + Different behavior depending on length of tuple, extension/not extension, etc. + Basically C-name converts the individual pieces, then joins with underscores. + ''' + if len(list) == 1: + parts = list + elif len(list) == 2: + parts = [list[0], _n_item(list[1])] + elif _ns.is_ext: + parts = [list[0], _ext(list[1])] + [_n_item(i) for i in list[2:]] + else: + parts = [list[0]] + [_n_item(i) for i in list[1:]] + return '_'.join(parts).lower() + +def _t(list): + ''' + Does C-name conversion on a tuple of strings representing a type. + Same as _n but adds a "_t" on the end. + ''' + if len(list) == 1: + parts = list + elif len(list) == 2: + parts = [list[0], _n_item(list[1]), 't'] + elif _ns.is_ext: + parts = [list[0], _ext(list[1])] + [_n_item(i) for i in list[2:]] + ['t'] + else: + parts = [list[0]] + [_n_item(i) for i in list[1:]] + ['t'] + return '_'.join(parts).lower() + + +def c_open(self): + ''' + Exported function that handles module open. + Opens the files and writes out the auto-generated comment, header file includes, etc. + ''' + global _ns + _ns = self.namespace + _ns.c_ext_global_name = _n(_ns.prefix + ('id',)) + + # Build the type-name collision avoidance table used by c_enum + build_collision_table() + + _h_setlevel(0) + _c_setlevel(0) + + _hc('/*') + _hc(' * This file generated automatically from %s by c_client.py.', _ns.file) + _hc(' * Edit at your peril.') + _hc(' */') + _hc('') + + _h('/**') + _h(' * @defgroup XCB_%s_API XCB %s API', _ns.ext_name, _ns.ext_name) + _h(' * @brief %s XCB Protocol Implementation.', _ns.ext_name) + _h(' * @{') + _h(' **/') + _h('') + _h('#ifndef __%s_H', _ns.header.upper()) + _h('#define __%s_H', _ns.header.upper()) + _h('') + _h('#include "xcb.h"') + + _c('#include <string.h>') + _c('#include <assert.h>') + _c('#include "xcbext.h"') + _c('#include "%s.h"', _ns.header) + + if _ns.is_ext: + for (n, h) in self.imports: + _hc('#include "%s.h"', h) + + _h('') + _h('#ifdef __cplusplus') + _h('extern "C" {') + _h('#endif') + + if _ns.is_ext: + _h('') + _h('#define XCB_%s_MAJOR_VERSION %s', _ns.ext_name.upper(), _ns.major_version) + _h('#define XCB_%s_MINOR_VERSION %s', _ns.ext_name.upper(), _ns.minor_version) + _h(' ') #XXX + _h('extern xcb_extension_t %s;', _ns.c_ext_global_name) + + _c('') + _c('xcb_extension_t %s = { "%s", 0 };', _ns.c_ext_global_name, _ns.ext_xname) + +def c_close(self): + ''' + Exported function that handles module close. + Writes out all the stored content lines, then closes the files. + ''' + _h_setlevel(2) + _c_setlevel(2) + _hc('') + + _h('') + _h('#ifdef __cplusplus') + _h('}') + _h('#endif') + + _h('') + _h('#endif') + _h('') + _h('/**') + _h(' * @}') + _h(' */') + + # Write header file + hfile = open('%s.h' % _ns.header, 'w') + for list in _hlines: + for line in list: + hfile.write(line) + hfile.write('\n') + hfile.close() + + # Write source file + cfile = open('%s.c' % _ns.header, 'w') + for list in _clines: + for line in list: + cfile.write(line) + cfile.write('\n') + cfile.close() + +def build_collision_table(): + global namecount + namecount = {} + + for v in module.types.values(): + name = _t(v[0]) + namecount[name] = (namecount.get(name) or 0) + 1 + +def c_enum(self, name): + ''' + Exported function that handles enum declarations. + ''' + + tname = _t(name) + if namecount[tname] > 1: + tname = _t(name + ('enum',)) + + _h_setlevel(0) + _h('') + _h('typedef enum %s {', tname) + + count = len(self.values) + + for (enam, eval) in self.values: + count = count - 1 + equals = ' = ' if eval != '' else '' + comma = ',' if count > 0 else '' + _h(' %s%s%s%s', _n(name + (enam,)).upper(), equals, eval, comma) + + _h('} %s;', tname) + +def _c_type_setup(self, name, postfix): + ''' + Sets up all the C-related state by adding additional data fields to + all Field and Type objects. Here is where we figure out most of our + variable and function names. + + Recurses into child fields and list member types. + ''' + # Do all the various names in advance + self.c_type = _t(name + postfix) + self.c_wiretype = 'char' if self.c_type == 'void' else self.c_type + + self.c_iterator_type = _t(name + ('iterator',)) + self.c_next_name = _n(name + ('next',)) + self.c_end_name = _n(name + ('end',)) + + self.c_request_name = _n(name) + self.c_checked_name = _n(name + ('checked',)) + self.c_unchecked_name = _n(name + ('unchecked',)) + self.c_reply_name = _n(name + ('reply',)) + self.c_reply_type = _t(name + ('reply',)) + self.c_cookie_type = _t(name + ('cookie',)) + + if self.is_container: + + self.c_container = 'union' if self.is_union else 'struct' + prev_varsized_field = None + prev_varsized_offset = 0 + first_field_after_varsized = None + + for field in self.fields: + _c_type_setup(field.type, field.field_type, ()) + if field.type.is_list: + _c_type_setup(field.type.member, field.field_type, ()) + + field.c_field_type = _t(field.field_type) + field.c_field_const_type = ('' if field.type.nmemb == 1 else 'const ') + field.c_field_type + field.c_field_name = _cpp(field.field_name) + field.c_subscript = '[%d]' % field.type.nmemb if (field.type.nmemb > 1) else '' + field.c_pointer = ' ' if field.type.nmemb == 1 else '*' + + field.c_iterator_type = _t(field.field_type + ('iterator',)) # xcb_fieldtype_iterator_t + field.c_iterator_name = _n(name + (field.field_name, 'iterator')) # xcb_container_field_iterator + field.c_accessor_name = _n(name + (field.field_name,)) # xcb_container_field + field.c_length_name = _n(name + (field.field_name, 'length')) # xcb_container_field_length + field.c_end_name = _n(name + (field.field_name, 'end')) # xcb_container_field_end + + field.prev_varsized_field = prev_varsized_field + field.prev_varsized_offset = prev_varsized_offset + + if prev_varsized_offset == 0: + first_field_after_varsized = field + field.first_field_after_varsized = first_field_after_varsized + + if field.type.fixed_size(): + prev_varsized_offset += field.type.size + else: + self.last_varsized_field = field + prev_varsized_field = field + prev_varsized_offset = 0 + +def _c_iterator_get_end(field, accum): + ''' + Figures out what C code is needed to find the end of a variable-length structure field. + For nested structures, recurses into its last variable-sized field. + For lists, calls the end function + ''' + if field.type.is_container: + accum = field.c_accessor_name + '(' + accum + ')' + # XXX there could be fixed-length fields at the end + return _c_iterator_get_end(field.type.last_varsized_field, accum) + if field.type.is_list: + # XXX we can always use the first way + if field.type.member.is_simple: + return field.c_end_name + '(' + accum + ')' + else: + return field.type.member.c_end_name + '(' + field.c_iterator_name + '(' + accum + '))' + +def _c_iterator(self, name): + ''' + Declares the iterator structure and next/end functions for a given type. + ''' + _h_setlevel(0) + _h('') + _h('/**') + _h(' * @brief %s', self.c_iterator_type) + _h(' **/') + _h('typedef struct %s {', self.c_iterator_type) + _h(' %s *data; /**< */', self.c_type) + _h(' int%s rem; /**< */', ' ' * (len(self.c_type) - 2)) + _h(' int%s index; /**< */', ' ' * (len(self.c_type) - 2)) + _h('} %s;', self.c_iterator_type) + + _h_setlevel(1) + _c_setlevel(1) + _h('') + _h('/**') + _h(' * Get the next element of the iterator') + _h(' * @param i Pointer to a %s', self.c_iterator_type) + _h(' *') + _h(' * Get the next element in the iterator. The member rem is') + _h(' * decreased by one. The member data points to the next') + _h(' * element. The member index is increased by sizeof(%s)', self.c_type) + _h(' */') + _c('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** void %s', self.c_next_name) + _hc(' ** ') + _hc(' ** @param %s *i', self.c_iterator_type) + _hc(' ** @returns void') + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('void') + _h('%s (%s *i /**< */);', self.c_next_name, self.c_iterator_type) + _c('%s (%s *i /**< */)', self.c_next_name, self.c_iterator_type) + _c('{') + + if not self.fixed_size(): + _c(' %s *R = i->data;', self.c_type) + _c(' xcb_generic_iterator_t child = %s;', _c_iterator_get_end(self.last_varsized_field, 'R')) + _c(' --i->rem;') + _c(' i->data = (%s *) child.data;', self.c_type) + _c(' i->index = child.index;') + else: + _c(' --i->rem;') + _c(' ++i->data;') + _c(' i->index += sizeof(%s);', self.c_type) + + _c('}') + + _h('') + _h('/**') + _h(' * Return the iterator pointing to the last element') + _h(' * @param i An %s', self.c_iterator_type) + _h(' * @return The iterator pointing to the last element') + _h(' *') + _h(' * Set the current element in the iterator to the last element.') + _h(' * The member rem is set to 0. The member data points to the') + _h(' * last element.') + _h(' */') + _c('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** xcb_generic_iterator_t %s', self.c_end_name) + _hc(' ** ') + _hc(' ** @param %s i', self.c_iterator_type) + _hc(' ** @returns xcb_generic_iterator_t') + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('xcb_generic_iterator_t') + _h('%s (%s i /**< */);', self.c_end_name, self.c_iterator_type) + _c('%s (%s i /**< */)', self.c_end_name, self.c_iterator_type) + _c('{') + _c(' xcb_generic_iterator_t ret;') + + if self.fixed_size(): + _c(' ret.data = i.data + i.rem;') + _c(' ret.index = i.index + ((char *) ret.data - (char *) i.data);') + _c(' ret.rem = 0;') + else: + _c(' while(i.rem > 0)') + _c(' %s(&i);', self.c_next_name) + _c(' ret.data = i.data;') + _c(' ret.rem = i.rem;') + _c(' ret.index = i.index;') + + _c(' return ret;') + _c('}') + +def _c_accessor_get_length(expr, prefix=''): + ''' + Figures out what C code is needed to get a length field. + For fields that follow a variable-length field, use the accessor. + Otherwise, just reference the structure field directly. + ''' + prefarrow = '' if prefix == '' else prefix + '->' + + if expr.lenfield != None and expr.lenfield.prev_varsized_field != None: + return expr.lenfield.c_accessor_name + '(' + prefix + ')' + elif expr.lenfield_name != None: + return prefarrow + expr.lenfield_name + else: + return str(expr.nmemb) + +def _c_accessor_get_expr(expr, prefix=''): + ''' + Figures out what C code is needed to get the length of a list field. + Recurses for math operations. + Returns bitcount for value-mask fields. + Otherwise, uses the value of the length field. + ''' + lenexp = _c_accessor_get_length(expr, prefix) + + if expr.op != None: + return '(' + _c_accessor_get_expr(expr.lhs, prefix) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, prefix) + ')' + elif expr.bitfield: + return 'xcb_popcount(' + lenexp + ')' + else: + return lenexp + +def _c_accessors_field(self, field): + ''' + Declares the accessor functions for a non-list field that follows a variable-length field. + ''' + if field.type.is_simple: + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s %s', field.c_field_type, field.c_accessor_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns %s', field.c_field_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s', field.c_field_type) + _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type) + _c('{') + _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R')) + _c(' return * (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset) + _c('}') + else: + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s * %s', field.c_field_type, field.c_accessor_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns %s *', field.c_field_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s *', field.c_field_type) + _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type) + _c('{') + _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R')) + _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset) + _c('}') + +def _c_accessors_list(self, field): + ''' + Declares the accessor functions for a list field. + Declares a direct-accessor function only if the list members are fixed size. + Declares length and get-iterator functions always. + ''' + list = field.type + + _h_setlevel(1) + _c_setlevel(1) + if list.member.fixed_size(): + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s * %s', field.c_field_type, field.c_accessor_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns %s *', field.c_field_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s *', field.c_field_type) + _h('%s (const %s *R /**< */);', field.c_accessor_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type) + _c('{') + + if field.prev_varsized_field == None: + _c(' return (%s *) (R + 1);', field.c_field_type) + else: + _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R')) + _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset) + + _c('}') + + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** int %s', field.c_length_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns int') + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('int') + _h('%s (const %s *R /**< */);', field.c_length_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_length_name, self.c_type) + _c('{') + _c(' return %s;', _c_accessor_get_expr(field.type.expr, 'R')) + _c('}') + + if field.type.member.is_simple: + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** xcb_generic_iterator_t %s', field.c_end_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns xcb_generic_iterator_t') + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('xcb_generic_iterator_t') + _h('%s (const %s *R /**< */);', field.c_end_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_end_name, self.c_type) + _c('{') + _c(' xcb_generic_iterator_t i;') + + if field.prev_varsized_field == None: + _c(' i.data = ((%s *) (R + 1)) + (%s);', field.type.c_wiretype, _c_accessor_get_expr(field.type.expr, 'R')) + else: + _c(' xcb_generic_iterator_t child = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R')) + _c(' i.data = ((%s *) child.data) + (%s);', field.type.c_wiretype, _c_accessor_get_expr(field.type.expr, 'R')) + + _c(' i.rem = 0;') + _c(' i.index = (char *) i.data - (char *) R;') + _c(' return i;') + _c('}') + + else: + _hc('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s %s', field.c_iterator_type, field.c_iterator_name) + _hc(' ** ') + _hc(' ** @param const %s *R', self.c_type) + _hc(' ** @returns %s', field.c_iterator_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s', field.c_iterator_type) + _h('%s (const %s *R /**< */);', field.c_iterator_name, self.c_type) + _c('%s (const %s *R /**< */)', field.c_iterator_name, self.c_type) + _c('{') + _c(' %s i;', field.c_iterator_type) + + if field.prev_varsized_field == None: + _c(' i.data = (%s *) (R + 1);', field.c_field_type) + else: + _c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R')) + _c(' i.data = (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index));', field.c_field_type, field.c_field_type) + + _c(' i.rem = %s;', _c_accessor_get_expr(field.type.expr, 'R')) + _c(' i.index = (char *) i.data - (char *) R;') + _c(' return i;') + _c('}') + +def _c_accessors(self, name, base): + ''' + Declares the accessor functions for the fields of a structure. + ''' + for field in self.fields: + if field.type.is_list and not field.type.fixed_size(): + _c_accessors_list(self, field) + elif field.prev_varsized_field != None: + _c_accessors_field(self, field) + +def c_simple(self, name): + ''' + Exported function that handles cardinal type declarations. + These are types which are typedef'd to one of the CARDx's, char, float, etc. + ''' + _c_type_setup(self, name, ()) + + if (self.name != name): + # Typedef + _h_setlevel(0) + my_name = _t(name) + _h('') + _h('typedef %s %s;', _t(self.name), my_name) + + # Iterator + _c_iterator(self, name) + +def _c_complex(self): + ''' + Helper function for handling all structure types. + Called for all structs, requests, replies, events, errors. + ''' + _h_setlevel(0) + _h('') + _h('/**') + _h(' * @brief %s', self.c_type) + _h(' **/') + _h('typedef %s %s {', self.c_container, self.c_type) + + struct_fields = [] + maxtypelen = 0 + + varfield = None + for field in self.fields: + if not field.type.fixed_size(): + varfield = field.c_field_name + continue + if varfield != None and not field.type.is_pad and field.wire: + errmsg = '%s: warning: variable field %s followed by fixed field %s\n' % (self.c_type, varfield, field.c_field_name) + sys.stderr.write(errmsg) + # sys.exit(1) + if field.wire: + struct_fields.append(field) + + for field in struct_fields: + if len(field.c_field_type) > maxtypelen: + maxtypelen = len(field.c_field_type) + + for field in struct_fields: + spacing = ' ' * (maxtypelen - len(field.c_field_type)) + _h(' %s%s %s%s; /**< */', field.c_field_type, spacing, field.c_field_name, field.c_subscript) + + _h('} %s;', self.c_type) + +def c_struct(self, name): + ''' + Exported function that handles structure declarations. + ''' + _c_type_setup(self, name, ()) + _c_complex(self) + _c_accessors(self, name, name) + _c_iterator(self, name) + +def c_union(self, name): + ''' + Exported function that handles union declarations. + ''' + _c_type_setup(self, name, ()) + _c_complex(self) + _c_iterator(self, name) + +def _c_request_helper(self, name, cookie_type, void, regular): + ''' + Declares a request function. + ''' + + # Four stunningly confusing possibilities here: + # + # Void Non-void + # ------------------------------ + # "req" "req" + # 0 flag CHECKED flag Normal Mode + # void_cookie req_cookie + # ------------------------------ + # "req_checked" "req_unchecked" + # CHECKED flag 0 flag Abnormal Mode + # void_cookie req_cookie + # ------------------------------ + + + # Whether we are _checked or _unchecked + checked = void and not regular + unchecked = not void and not regular + + # What kind of cookie we return + func_cookie = 'xcb_void_cookie_t' if void else self.c_cookie_type + + # What flag is passed to xcb_request + func_flags = '0' if (void and regular) or (not void and not regular) else 'XCB_REQUEST_CHECKED' + + # Global extension id variable or NULL for xproto + func_ext_global = '&' + _ns.c_ext_global_name if _ns.is_ext else '0' + + # What our function name is + func_name = self.c_request_name + if checked: + func_name = self.c_checked_name + if unchecked: + func_name = self.c_unchecked_name + + param_fields = [] + wire_fields = [] + maxtypelen = len('xcb_connection_t') + + for field in self.fields: + if field.visible: + # The field should appear as a call parameter + param_fields.append(field) + if field.wire and not field.auto: + # We need to set the field up in the structure + wire_fields.append(field) + + for field in param_fields: + if len(field.c_field_const_type) > maxtypelen: + maxtypelen = len(field.c_field_const_type) + + _h_setlevel(1) + _c_setlevel(1) + _h('') + _h('/**') + _h(' * Delivers a request to the X server') + _h(' * @param c The connection') + _h(' * @return A cookie') + _h(' *') + _h(' * Delivers a request to the X server.') + _h(' * ') + if checked: + _h(' * This form can be used only if the request will not cause') + _h(' * a reply to be generated. Any returned error will be') + _h(' * saved for handling by xcb_request_check().') + if unchecked: + _h(' * This form can be used only if the request will cause') + _h(' * a reply to be generated. Any returned error will be') + _h(' * placed in the event queue.') + _h(' */') + _c('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s %s', cookie_type, func_name) + _hc(' ** ') + + spacing = ' ' * (maxtypelen - len('xcb_connection_t')) + _hc(' ** @param xcb_connection_t%s *c', spacing) + + for field in param_fields: + spacing = ' ' * (maxtypelen - len(field.c_field_const_type)) + _hc(' ** @param %s%s %s%s', field.c_field_const_type, spacing, field.c_pointer, field.c_field_name) + + _hc(' ** @returns %s', cookie_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s', cookie_type) + + spacing = ' ' * (maxtypelen - len('xcb_connection_t')) + comma = ',' if len(param_fields) else ');' + _h('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) + comma = ',' if len(param_fields) else ')' + _c('%s (xcb_connection_t%s *c /**< */%s', func_name, spacing, comma) + + func_spacing = ' ' * (len(func_name) + 2) + count = len(param_fields) + for field in param_fields: + count = count - 1 + spacing = ' ' * (maxtypelen - len(field.c_field_const_type)) + comma = ',' if count else ');' + _h('%s%s%s %s%s /**< */%s', func_spacing, field.c_field_const_type, spacing, field.c_pointer, field.c_field_name, comma) + comma = ',' if count else ')' + _c('%s%s%s %s%s /**< */%s', func_spacing, field.c_field_const_type, spacing, field.c_pointer, field.c_field_name, comma) + + count = 2 + for field in param_fields: + if not field.type.fixed_size(): + count = count + 2 + + _c('{') + _c(' static const xcb_protocol_request_t xcb_req = {') + _c(' /* count */ %d,', count) + _c(' /* ext */ %s,', func_ext_global) + _c(' /* opcode */ %s,', self.c_request_name.upper()) + _c(' /* isvoid */ %d', 1 if void else 0) + _c(' };') + _c(' ') + _c(' struct iovec xcb_parts[%d];', count + 2) + _c(' %s xcb_ret;', func_cookie) + _c(' %s xcb_out;', self.c_type) + _c(' ') + + for field in wire_fields: + if field.type.fixed_size(): + if field.type.is_expr: + _c(' xcb_out.%s = %s;', field.c_field_name, _c_accessor_get_expr(field.type.expr)) + + elif field.type.is_pad: + if field.type.nmemb == 1: + _c(' xcb_out.%s = 0;', field.c_field_name) + else: + _c(' memset(xcb_out.%s, 0, %d);', field.c_field_name, field.type.nmemb) + else: + if field.type.nmemb == 1: + _c(' xcb_out.%s = %s;', field.c_field_name, field.c_field_name) + else: + _c(' memcpy(xcb_out.%s, %s, %d);', field.c_field_name, field.c_field_name, field.type.nmemb) + + _c(' ') + _c(' xcb_parts[2].iov_base = (char *) &xcb_out;') + _c(' xcb_parts[2].iov_len = sizeof(xcb_out);') + _c(' xcb_parts[3].iov_base = 0;') + _c(' xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;') + + count = 4 + for field in param_fields: + if not field.type.fixed_size(): + _c(' xcb_parts[%d].iov_base = (char *) %s;', count, field.c_field_name) + if field.type.is_list: + _c(' xcb_parts[%d].iov_len = %s * sizeof(%s);', count, _c_accessor_get_expr(field.type.expr), field.type.member.c_wiretype) + else: + _c(' xcb_parts[%d].iov_len = %s * sizeof(%s);', count, 'Uh oh', field.type.c_wiretype) + _c(' xcb_parts[%d].iov_base = 0;', count + 1) + _c(' xcb_parts[%d].iov_len = -xcb_parts[%d].iov_len & 3;', count + 1, count) + count = count + 2 + + _c(' xcb_ret.sequence = xcb_send_request(c, %s, xcb_parts + 2, &xcb_req);', func_flags) + _c(' return xcb_ret;') + _c('}') + +def _c_reply(self, name): + ''' + Declares the function that returns the reply structure. + ''' + spacing1 = ' ' * (len(self.c_cookie_type) - len('xcb_connection_t')) + spacing2 = ' ' * (len(self.c_cookie_type) - len('xcb_generic_error_t')) + spacing3 = ' ' * (len(self.c_reply_name) + 2) + + _h('') + _h('/**') + _h(' * Return the reply') + _h(' * @param c The connection') + _h(' * @param cookie The cookie') + _h(' * @param e The xcb_generic_error_t supplied') + _h(' *') + _h(' * Returns the reply of the request asked by') + _h(' * ') + _h(' * The parameter @p e supplied to this function must be NULL if') + _h(' * %s(). is used.', self.c_unchecked_name) + _h(' * Otherwise, it stores the error if any.') + _h(' *') + _h(' * The returned value must be freed by the caller using free().') + _h(' */') + _c('') + _hc('') + _hc('/*****************************************************************************') + _hc(' **') + _hc(' ** %s * %s', self.c_reply_type, self.c_reply_name) + _hc(' ** ') + _hc(' ** @param xcb_connection_t%s *c', spacing1) + _hc(' ** @param %s cookie', self.c_cookie_type) + _hc(' ** @param xcb_generic_error_t%s **e', spacing2) + _hc(' ** @returns %s *', self.c_reply_type) + _hc(' **') + _hc(' *****************************************************************************/') + _hc(' ') + _hc('%s *', self.c_reply_type) + _hc('%s (xcb_connection_t%s *c /**< */,', self.c_reply_name, spacing1) + _hc('%s%s cookie /**< */,', spacing3, self.c_cookie_type) + _h('%sxcb_generic_error_t%s **e /**< */);', spacing3, spacing2) + _c('%sxcb_generic_error_t%s **e /**< */)', spacing3, spacing2) + _c('{') + _c(' return (%s *) xcb_wait_for_reply(c, cookie.sequence, e);', self.c_reply_type) + _c('}') + +def _c_opcode(name, opcode): + ''' + Declares the opcode define for requests, events, and errors. + ''' + _h_setlevel(0) + _h('') + _h('/** Opcode for %s. */', _n(name)) + _h('#define %s %s', _n(name).upper(), opcode) + +def _c_cookie(self, name): + ''' + Declares the cookie type for a non-void request. + ''' + _h_setlevel(0) + _h('') + _h('/**') + _h(' * @brief %s', self.c_cookie_type) + _h(' **/') + _h('typedef struct %s {', self.c_cookie_type) + _h(' unsigned int sequence; /**< */') + _h('} %s;', self.c_cookie_type) + +def c_request(self, name): + ''' + Exported function that handles request declarations. + ''' + _c_type_setup(self, name, ('request',)) + + if self.reply: + # Cookie type declaration + _c_cookie(self, name) + + # Opcode define + _c_opcode(name, self.opcode) + + # Request structure declaration + _c_complex(self) + + if self.reply: + _c_type_setup(self.reply, name, ('reply',)) + # Reply structure definition + _c_complex(self.reply) + # Request prototypes + _c_request_helper(self, name, self.c_cookie_type, False, True) + _c_request_helper(self, name, self.c_cookie_type, False, False) + # Reply accessors + _c_accessors(self.reply, name + ('reply',), name) + _c_reply(self, name) + else: + # Request prototypes + _c_request_helper(self, name, 'xcb_void_cookie_t', True, False) + _c_request_helper(self, name, 'xcb_void_cookie_t', True, True) + +def c_event(self, name): + ''' + Exported function that handles event declarations. + ''' + _c_type_setup(self, name, ('event',)) + + # Opcode define + _c_opcode(name, self.opcodes[name]) + + if self.name == name: + # Structure definition + _c_complex(self) + else: + # Typedef + _h('') + _h('typedef %s %s;', _t(self.name + ('event',)), _t(name + ('event',))) + +def c_error(self, name): + ''' + Exported function that handles error declarations. + ''' + _c_type_setup(self, name, ('error',)) + + # Opcode define + _c_opcode(name, self.opcodes[name]) + + if self.name == name: + # Structure definition + _c_complex(self) + else: + # Typedef + _h('') + _h('typedef %s %s;', _t(self.name + ('error',)), _t(name + ('error',))) + + +# Main routine starts here + +# Must create an "output" dictionary before any xcbgen imports. +output = {'open' : c_open, + 'close' : c_close, + 'simple' : c_simple, + 'enum' : c_enum, + 'struct' : c_struct, + 'union' : c_union, + 'request' : c_request, + 'event' : c_event, + 'error' : c_error + } + +# Boilerplate below this point + +# Check for the argument that specifies path to the xcbgen python package. +try: + opts, args = getopt.getopt(sys.argv[1:], 'p:') +except getopt.GetoptError, err: + print str(err) + print 'Usage: c_client.py [-p path] file.xml' + sys.exit(1) + +for (opt, arg) in opts: + if opt == '-p': + sys.path.append(arg) + +# Import the module class +try: + from xcbgen.state import Module +except ImportError: + print '' + print 'Failed to load the xcbgen Python package!' + print 'Make sure that xcb/proto installed it on your Python path.' + print 'If not, you will need to create a .pth file or define $PYTHONPATH' + print 'to extend the path.' + print 'Refer to the README file in xcb/proto for more info.' + print '' + raise + +# Parse the xml header +module = Module(args[0], output) + +# Build type-registry and resolve type dependencies +module.register() +module.resolve() + +# Output the code +module.generate() diff --git a/libxcb/src/config.h.in b/libxcb/src/config.h.in index f09123227..6e7676734 100644 --- a/libxcb/src/config.h.in +++ b/libxcb/src/config.h.in @@ -6,8 +6,8 @@ /* Has Wraphelp.c needed for XDM AUTH protocols */ #undef HASXDMAUTH -/* Has backtrace*() needed for retrieving stack traces */ -#undef HAVE_BACKTRACE +/* Define if your platform supports abstract sockets */ +#undef HAVE_ABSTRACT_SOCKETS /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -15,9 +15,15 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* launchd support available */ +#undef HAVE_LAUNCHD + /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H +/* Have the sockaddr_un.sun_len member. */ +#undef HAVE_SOCKADDR_SUN_LEN + /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H @@ -39,6 +45,10 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + /* Name of package */ #undef PACKAGE @@ -60,5 +70,11 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* poll() function is available */ +#undef USE_POLL + /* Version number of package */ #undef VERSION + +/* XCB buffer queue size */ +#undef XCB_QUEUE_BUFFER_SIZE diff --git a/libxcb/src/xcb.h b/libxcb/src/xcb.h index 5a1c01ab1..f95127665 100644 --- a/libxcb/src/xcb.h +++ b/libxcb/src/xcb.h @@ -116,6 +116,23 @@ typedef struct { } xcb_generic_event_t; /** + * @brief GE event + * + * An event as sent by the XGE extension. The length field specifies the + * number of 4-byte blocks trailing the struct. + */ +typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t pad0; /**< Padding */ + uint16_t sequence; /**< Sequence number */ + uint32_t length; + uint16_t event_type; + uint16_t pad1; + uint32_t pad[5]; /**< Padding */ + uint32_t full_sequence; /**< full sequence */ +} xcb_ge_event_t; + +/** * @brief Generic error. * * A generic error structure. @@ -124,7 +141,11 @@ typedef struct { uint8_t response_type; /**< Type of the response */ uint8_t error_code; /**< Error code */ uint16_t sequence; /**< Sequence number */ - uint32_t pad[7]; /**< Padding */ + uint32_t resource_id; /** < Resource ID for requests with side effects only */ + uint16_t minor_code; /** < Minor opcode of the failed request */ + uint8_t major_code; /** < Major opcode of the failed request */ + uint8_t pad0; + uint32_t pad[5]; /**< Padding */ uint32_t full_sequence; /**< full sequence */ } xcb_generic_error_t; diff --git a/libxcb/src/xcb_auth.c b/libxcb/src/xcb_auth.c index ffc051547..104f2f07b 100644 --- a/libxcb/src/xcb_auth.c +++ b/libxcb/src/xcb_auth.c @@ -49,11 +49,21 @@ enum auth_protos { N_AUTH_PROTOS }; +#define AUTH_PROTO_XDM_AUTHORIZATION "XDM-AUTHORIZATION-1" +#define AUTH_PROTO_MIT_MAGIC_COOKIE "MIT-MAGIC-COOKIE-1" + static char *authnames[N_AUTH_PROTOS] = { #ifdef HASXDMAUTH - "XDM-AUTHORIZATION-1", + AUTH_PROTO_XDM_AUTHORIZATION, +#endif + AUTH_PROTO_MIT_MAGIC_COOKIE, +}; + +static int authnameslen[N_AUTH_PROTOS] = { +#ifdef HASXDMAUTH + sizeof(AUTH_PROTO_XDM_AUTHORIZATION) - 1, #endif - "MIT-MAGIC-COOKIE-1", + sizeof(AUTH_PROTO_MIT_MAGIC_COOKIE) - 1, }; static size_t memdup(char **dst, void *src, size_t len) @@ -68,9 +78,9 @@ static size_t memdup(char **dst, void *src, size_t len) return len; } -static int authname_match(enum auth_protos kind, char *name, int namelen) +static int authname_match(enum auth_protos kind, char *name, size_t namelen) { - if(strlen(authnames[kind]) != namelen) + if(authnameslen[kind] != namelen) return 0; if(memcmp(authnames[kind], name, namelen)) return 0; @@ -87,12 +97,12 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen, unsigned short family; char hostnamebuf[256]; /* big enough for max hostname */ char dispbuf[40]; /* big enough to hold more than 2^64 base 10 */ - int authnamelens[N_AUTH_PROTOS]; - int i; + int dispbuflen; family = FamilyLocal; /* 256 */ switch(sockname->sa_family) { +#ifdef AF_INET6 case AF_INET6: addr = (char *) SIN6_ADDR(sockname); addrlen = sizeof(*SIN6_ADDR(sockname)); @@ -104,6 +114,7 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen, } addr += 12; /* if v4-mapped, fall through. */ +#endif case AF_INET: if(!addr) addr = (char *) &((struct sockaddr_in *)sockname)->sin_addr; @@ -117,7 +128,11 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen, return 0; /* cannot authenticate this family */ } - snprintf(dispbuf, sizeof(dispbuf), "%d", display); + dispbuflen = snprintf(dispbuf, sizeof(dispbuf), "%d", display); + if(dispbuflen < 0) + return 0; + /* snprintf may have truncate our text */ + dispbuflen = MIN(dispbuflen, sizeof(dispbuf) - 1); if (family == FamilyLocal) { if (gethostname(hostnamebuf, sizeof(hostnamebuf)) == -1) @@ -126,12 +141,10 @@ static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen, addrlen = strlen(addr); } - for (i = 0; i < N_AUTH_PROTOS; i++) - authnamelens[i] = strlen(authnames[i]); return XauGetBestAuthByAddr (family, (unsigned short) addrlen, addr, - (unsigned short) strlen(dispbuf), dispbuf, - N_AUTH_PROTOS, authnames, authnamelens); + (unsigned short) dispbuflen, dispbuf, + N_AUTH_PROTOS, authnames, authnameslen); } #ifdef HASXDMAUTH @@ -179,12 +192,13 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * APPEND(info->data, j, si->sin_port); } break; +#ifdef AF_INET6 case AF_INET6: /*block*/ { struct sockaddr_in6 *si6 = (struct sockaddr_in6 *) sockname; if(IN6_IS_ADDR_V4MAPPED(SIN6_ADDR(sockname))) { - APPEND(info->data, j, si6->sin6_addr.s6_addr[12]); + do_append(info->data, &j, &si6->sin6_addr.s6_addr[12], 4); APPEND(info->data, j, si6->sin6_port); } else @@ -199,6 +213,7 @@ static int compute_auth(xcb_auth_info_t *info, Xauth *authptr, struct sockaddr * } } break; +#endif case AF_UNIX: /*block*/ { uint32_t fakeaddr = htonl(0xffffffff - next_nonce()); @@ -235,25 +250,50 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display) char sockbuf[sizeof(struct sockaddr) + MAXPATHLEN]; unsigned int socknamelen = sizeof(sockbuf); /* need extra space */ struct sockaddr *sockname = (struct sockaddr *) &sockbuf; + int gotsockname = 0; Xauth *authptr = 0; int ret = 1; + /* Some systems like hpux or Hurd do not expose peer names + * for UNIX Domain Sockets, but this is irrelevant, + * since compute_auth() ignores the peer name in this + * case anyway.*/ if (getpeername(fd, sockname, &socknamelen) == -1) - return 0; /* can only authenticate sockets */ + { + if (sockname->sa_family != AF_UNIX) + return 0; /* except for AF_UNIX, sockets should have peernames */ + if (getsockname(fd, sockname, &socknamelen) == -1) + return 0; /* can only authenticate sockets */ + gotsockname = 1; + } authptr = get_authptr(sockname, socknamelen, display); if (authptr == 0) return 0; /* cannot find good auth data */ info->namelen = memdup(&info->name, authptr->name, authptr->name_length); - if(info->namelen) - ret = compute_auth(info, authptr, sockname); + if (!info->namelen) + goto no_auth; /* out of memory */ + + if (!gotsockname && getsockname(fd, sockname, &socknamelen) == -1) + { + free(info->name); + goto no_auth; /* can only authenticate sockets */ + } + + ret = compute_auth(info, authptr, sockname); if(!ret) { - free(info->name); - info->name = 0; - info->namelen = 0; + free(info->name); + goto no_auth; /* cannot build auth record */ } + XauDisposeAuth(authptr); return ret; + + no_auth: + info->name = 0; + info->namelen = 0; + XauDisposeAuth(authptr); + return 0; } diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c index e7856c355..251d62e01 100644 --- a/libxcb/src/xcb_conn.c +++ b/libxcb/src/xcb_conn.c @@ -31,12 +31,16 @@ #include <unistd.h> #include <stdlib.h> #include <netinet/in.h> -#include <sys/select.h> #include <fcntl.h> #include <errno.h> #include "xcb.h" #include "xcbint.h" +#if USE_POLL +#include <poll.h> +#else +#include <sys/select.h> +#endif typedef struct { uint8_t status; @@ -59,28 +63,13 @@ static int set_fd_flags(const int fd) return 1; } -static int _xcb_xlib_init(_xcb_xlib *xlib) -{ - xlib->lock = 0; -#ifndef NDEBUG - xlib->sloppy_lock = (getenv("LIBXCB_ALLOW_SLOPPY_LOCK") != 0); -#endif - pthread_cond_init(&xlib->cond, 0); - return 1; -} - -static void _xcb_xlib_destroy(_xcb_xlib *xlib) -{ - pthread_cond_destroy(&xlib->cond); -} - static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info) { static const char pad[3]; xcb_setup_request_t out; struct iovec parts[6]; int count = 0; - int endian = 0x01020304; + static const uint32_t endian = 0x01020304; int ret; memset(&out, 0, sizeof(out)); @@ -110,14 +99,14 @@ static int write_setup(xcb_connection_t *c, xcb_auth_info_t *auth_info) parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len); parts[count++].iov_base = (char *) pad; } - assert(count <= sizeof(parts) / sizeof(*parts)); + assert(count <= (int) (sizeof(parts) / sizeof(*parts))); - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); { struct iovec *parts_ptr = parts; ret = _xcb_out_send(c, &parts_ptr, &count); } - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -230,7 +219,6 @@ xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info) if(!( set_fd_flags(fd) && pthread_mutex_init(&c->iolock, 0) == 0 && - _xcb_xlib_init(&c->xlib) && _xcb_in_init(&c->in) && _xcb_out_init(&c->out) && write_setup(c, auth_info) && @@ -255,7 +243,6 @@ void xcb_disconnect(xcb_connection_t *c) close(c->fd); pthread_mutex_destroy(&c->iolock); - _xcb_xlib_destroy(&c->xlib); _xcb_in_destroy(&c->in); _xcb_out_destroy(&c->out); @@ -272,91 +259,76 @@ void _xcb_conn_shutdown(xcb_connection_t *c) c->has_error = 1; } -void _xcb_lock_io(xcb_connection_t *c) -{ - pthread_mutex_lock(&c->iolock); - while(c->xlib.lock) - { - if(pthread_equal(c->xlib.thread, pthread_self())) - break; - pthread_cond_wait(&c->xlib.cond, &c->iolock); - } -} - -void _xcb_unlock_io(xcb_connection_t *c) -{ - pthread_mutex_unlock(&c->iolock); -} - -void _xcb_wait_io(xcb_connection_t *c, pthread_cond_t *cond) -{ - int xlib_locked = c->xlib.lock; - if(xlib_locked) - { - c->xlib.lock = 0; - pthread_cond_broadcast(&c->xlib.cond); - } - pthread_cond_wait(cond, &c->iolock); - if(xlib_locked) - { - while(c->xlib.lock) - pthread_cond_wait(&c->xlib.cond, &c->iolock); - c->xlib.lock = 1; - c->xlib.thread = pthread_self(); - } -} - int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count) { - int ret, xlib_locked; + int ret; +#if USE_POLL + struct pollfd fd; +#else fd_set rfds, wfds; +#endif /* If the thing I should be doing is already being done, wait for it. */ if(count ? c->out.writing : c->in.reading) { - _xcb_wait_io(c, cond); + pthread_cond_wait(cond, &c->iolock); return 1; } +#if USE_POLL + memset(&fd, 0, sizeof(fd)); + fd.fd = c->fd; + fd.events = POLLIN; +#else FD_ZERO(&rfds); FD_SET(c->fd, &rfds); +#endif ++c->in.reading; +#if USE_POLL + if(count) + { + fd.events |= POLLOUT; + ++c->out.writing; + } +#else FD_ZERO(&wfds); if(count) { FD_SET(c->fd, &wfds); ++c->out.writing; } +#endif - xlib_locked = c->xlib.lock; - if(xlib_locked) - { - c->xlib.lock = 0; - pthread_cond_broadcast(&c->xlib.cond); - } - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); do { +#if USE_POLL + ret = poll(&fd, 1, -1); +#else ret = select(c->fd + 1, &rfds, &wfds, 0, 0); +#endif } while (ret == -1 && errno == EINTR); if (ret < 0) { _xcb_conn_shutdown(c); ret = 0; } - _xcb_lock_io(c); - if(xlib_locked) - { - c->xlib.lock = 1; - c->xlib.thread = pthread_self(); - } + pthread_mutex_lock(&c->iolock); if(ret) { +#if USE_POLL + if((fd.revents & POLLIN) == POLLIN) +#else if(FD_ISSET(c->fd, &rfds)) +#endif ret = ret && _xcb_in_read(c); +#if USE_POLL + if((fd.revents & POLLOUT) == POLLOUT) +#else if(FD_ISSET(c->fd, &wfds)) +#endif ret = ret && write_vec(c, vector, count); } diff --git a/libxcb/src/xcb_ext.c b/libxcb/src/xcb_ext.c index 12cb16463..68bb29bdf 100644 --- a/libxcb/src/xcb_ext.c +++ b/libxcb/src/xcb_ext.c @@ -40,11 +40,11 @@ typedef struct lazyreply { } value; } lazyreply; -static lazyreply *get_index(xcb_connection_t *c, int index) +static lazyreply *get_index(xcb_connection_t *c, int idx) { - if(index > c->ext.extensions_size) + if(idx > c->ext.extensions_size) { - int new_size = index << 1; + int new_size = idx << 1; lazyreply *new_extensions = realloc(c->ext.extensions, sizeof(lazyreply) * new_size); if(!new_extensions) return 0; @@ -52,7 +52,7 @@ static lazyreply *get_index(xcb_connection_t *c, int index) c->ext.extensions = new_extensions; c->ext.extensions_size = new_size; } - return c->ext.extensions + index - 1; + return c->ext.extensions + idx - 1; } static lazyreply *get_lazyreply(xcb_connection_t *c, xcb_extension_t *ext) diff --git a/libxcb/src/xcb_in.c b/libxcb/src/xcb_in.c index 2997de4c4..26ab3581f 100644 --- a/libxcb/src/xcb_in.c +++ b/libxcb/src/xcb_in.c @@ -30,15 +30,20 @@ #include <stdlib.h> #include <unistd.h> #include <stdio.h> -#include <sys/select.h> #include <errno.h> #include "xcb.h" #include "xcbext.h" #include "xcbint.h" +#if USE_POLL +#include <poll.h> +#else +#include <sys/select.h> +#endif #define XCB_ERROR 0 #define XCB_REPLY 1 +#define XCB_XGE_EVENT 35 struct event_list { xcb_generic_event_t *event; @@ -51,7 +56,8 @@ struct reply_list { }; typedef struct pending_reply { - unsigned int request; + uint64_t first_request; + uint64_t last_request; enum workarounds workaround; int flags; struct pending_reply *next; @@ -77,6 +83,7 @@ static int read_packet(xcb_connection_t *c) { xcb_generic_reply_t genrep; int length = 32; + int eventlength = 0; /* length after first 32 bytes for GenericEvents */ void *buf; pending_reply *pend = 0; struct event_list *event; @@ -91,8 +98,8 @@ static int read_packet(xcb_connection_t *c) /* Compute 32-bit sequence number of this packet. */ if((genrep.response_type & 0x7f) != XCB_KEYMAP_NOTIFY) { - unsigned int lastread = c->in.request_read; - c->in.request_read = (lastread & 0xffff0000) | genrep.sequence; + uint64_t lastread = c->in.request_read; + c->in.request_read = (lastread & UINT64_C(0xffffffffffff0000)) | genrep.sequence; if(XCB_SEQUENCE_COMPARE(c->in.request_read, <, lastread)) c->in.request_read += 0x10000; if(XCB_SEQUENCE_COMPARE(c->in.request_read, >, c->in.request_expected)) @@ -110,7 +117,8 @@ static int read_packet(xcb_connection_t *c) } while(c->in.pending_replies && - XCB_SEQUENCE_COMPARE (c->in.pending_replies->request, <=, c->in.request_completed)) + c->in.pending_replies->workaround != WORKAROUND_EXTERNAL_SOCKET_OWNER && + XCB_SEQUENCE_COMPARE (c->in.pending_replies->last_request, <=, c->in.request_completed)) { pending_reply *oldpend = c->in.pending_replies; c->in.pending_replies = oldpend->next; @@ -126,7 +134,10 @@ static int read_packet(xcb_connection_t *c) if(genrep.response_type == XCB_ERROR || genrep.response_type == XCB_REPLY) { pend = c->in.pending_replies; - if(pend && pend->request != c->in.request_read) + if(pend && + !(XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->in.request_read) && + (pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER || + XCB_SEQUENCE_COMPARE(c->in.request_read, <=, pend->last_request)))) pend = 0; } @@ -141,17 +152,36 @@ static int read_packet(xcb_connection_t *c) length += genrep.length * 4; } - buf = malloc(length + (genrep.response_type == XCB_REPLY ? 0 : sizeof(uint32_t))); + /* XGE events may have sizes > 32 */ + if (genrep.response_type == XCB_XGE_EVENT) + { + eventlength = ((xcb_ge_event_t*)&genrep)->length * 4; + } + + buf = malloc(length + eventlength + + (genrep.response_type == XCB_REPLY ? 0 : sizeof(uint32_t))); if(!buf) { _xcb_conn_shutdown(c); return 0; } + if(_xcb_in_read_block(c, buf, length) <= 0) { free(buf); return 0; } + + /* pull in XGE event data if available, append after event struct */ + if (eventlength) + { + if(_xcb_in_read_block(c, &((xcb_generic_event_t*)buf)[1], eventlength) <= 0) + { + free(buf); + return 0; + } + } + if(pend && (pend->flags & XCB_REQUEST_DISCARD_REPLY)) { free(buf); @@ -170,6 +200,7 @@ static int read_packet(xcb_connection_t *c) if(!cur) { _xcb_conn_shutdown(c); + free(buf); return 0; } cur->reply = buf; @@ -178,10 +209,10 @@ static int read_packet(xcb_connection_t *c) c->in.current_reply_tail = &cur->next; for(reader = c->in.readers; reader && - XCB_SEQUENCE_COMPARE(reader->request, <=, c->in.request_read); + XCB_SEQUENCE_COMPARE_32(reader->request, <=, c->in.request_read); reader = reader->next) { - if(reader->request == c->in.request_read) + if(XCB_SEQUENCE_COMPARE_32(reader->request, ==, c->in.request_read)) { pthread_cond_signal(reader->data); break; @@ -231,7 +262,7 @@ static void free_reply_list(struct reply_list *head) } } -static int read_block(const int fd, void *buf, const size_t len) +static int read_block(const int fd, void *buf, const ssize_t len) { int done = 0; while(done < len) @@ -241,12 +272,22 @@ static int read_block(const int fd, void *buf, const size_t len) done += ret; if(ret < 0 && errno == EAGAIN) { +#if USE_POLL + struct pollfd pfd; + pfd.fd = fd; + pfd.events = POLLIN; + pfd.revents = 0; + do { + ret = poll(&pfd, 1, -1); + } while (ret == -1 && errno == EINTR); +#else fd_set fds; FD_ZERO(&fds); FD_SET(fd, &fds); do { ret = select(fd + 1, &fds, 0, 0, 0); } while (ret == -1 && errno == EINTR); +#endif } if(ret <= 0) return ret; @@ -263,7 +304,7 @@ static int poll_for_reply(xcb_connection_t *c, unsigned int request, void **repl head = 0; /* We've read requests past the one we want, so if it has replies we have * them all and they're in the replies map. */ - else if(XCB_SEQUENCE_COMPARE(request, <, c->in.request_read)) + else if(XCB_SEQUENCE_COMPARE_32(request, <, c->in.request_read)) { head = _xcb_map_remove(c->in.replies, request); if(head && head->next) @@ -271,7 +312,7 @@ static int poll_for_reply(xcb_connection_t *c, unsigned int request, void **repl } /* We're currently processing the responses to the request we want, and we * have a reply ready to return. So just return it without blocking. */ - else if(request == c->in.request_read && c->in.current_reply) + else if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_read) && c->in.current_reply) { head = c->in.current_reply; c->in.current_reply = head->next; @@ -280,7 +321,7 @@ static int poll_for_reply(xcb_connection_t *c, unsigned int request, void **repl } /* We know this request can't have any more replies, and we've already * established it doesn't have a reply now. Don't bother blocking. */ - else if(request == c->in.request_completed) + else if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_completed)) head = 0; /* We may have more replies on the way for this request: block until we're * sure. */ @@ -313,16 +354,21 @@ static int poll_for_reply(xcb_connection_t *c, unsigned int request, void **repl void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e) { + uint64_t widened_request; void *ret = 0; if(e) *e = 0; if(c->has_error) return 0; - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); + + widened_request = (c->out.request & UINT64_C(0xffffffff00000000)) | request; + if(widened_request > c->out.request) + widened_request -= UINT64_C(1) << 32; /* If this request has not been written yet, write it. */ - if(_xcb_out_flush_to(c, request)) + if(c->out.return_socket || _xcb_out_flush_to(c, widened_request)) { pthread_cond_t cond = PTHREAD_COND_INITIALIZER; reader_list reader; @@ -330,7 +376,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_ for(prev_reader = &c->in.readers; *prev_reader && - XCB_SEQUENCE_COMPARE ((*prev_reader)->request, <=, request); + XCB_SEQUENCE_COMPARE_32((*prev_reader)->request, <=, request); prev_reader = &(*prev_reader)->next) { /* empty */; @@ -346,7 +392,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_ for(prev_reader = &c->in.readers; *prev_reader && - XCB_SEQUENCE_COMPARE((*prev_reader)->request, <=, request); + XCB_SEQUENCE_COMPARE_32((*prev_reader)->request, <=, request); prev_reader = &(*prev_reader)->next) { if(*prev_reader == &reader) @@ -359,7 +405,7 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_ } wake_up_next_reader(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -374,9 +420,9 @@ int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, return 1; /* would not block */ } assert(reply != 0); - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); ret = poll_for_reply(c, request, reply, error); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -385,14 +431,14 @@ xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c) xcb_generic_event_t *ret; if(c->has_error) return 0; - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* get_event returns 0 on empty list. */ while(!(ret = get_event(c))) if(!_xcb_conn_wait(c, &c->in.event_cond, 0, 0)) break; wake_up_next_reader(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -401,12 +447,12 @@ xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c) xcb_generic_event_t *ret = 0; if(!c->has_error) { - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* FIXME: follow X meets Z architecture changes. */ ret = get_event(c); if(!ret && _xcb_in_read(c)) /* _xcb_in_read shuts down the connection on error */ ret = get_event(c); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); } return ret; } @@ -420,8 +466,8 @@ xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t co void *reply; if(c->has_error) return 0; - if(XCB_SEQUENCE_COMPARE(cookie.sequence,>,c->in.request_expected) - && XCB_SEQUENCE_COMPARE(cookie.sequence,>,c->in.request_completed)) + if(XCB_SEQUENCE_COMPARE_32(cookie.sequence,>,c->in.request_expected) + && XCB_SEQUENCE_COMPARE_32(cookie.sequence,>,c->in.request_completed)) { free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), &ret)); assert(!ret); @@ -475,7 +521,7 @@ void _xcb_in_destroy(_xcb_in *in) } } -int _xcb_in_expect_reply(xcb_connection_t *c, unsigned int request, enum workarounds workaround, int flags) +int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags) { pending_reply *pend = malloc(sizeof(pending_reply)); assert(workaround != WORKAROUND_NONE || flags != 0); @@ -484,7 +530,7 @@ int _xcb_in_expect_reply(xcb_connection_t *c, unsigned int request, enum workaro _xcb_conn_shutdown(c); return 0; } - pend->request = request; + pend->first_request = pend->last_request = request; pend->workaround = workaround; pend->flags = flags; pend->next = 0; @@ -493,6 +539,20 @@ int _xcb_in_expect_reply(xcb_connection_t *c, unsigned int request, enum workaro return 1; } +void _xcb_in_replies_done(xcb_connection_t *c) +{ + struct pending_reply *pend; + if (c->in.pending_replies_tail != &c->in.pending_replies) + { + pend = container_of(c->in.pending_replies_tail, struct pending_reply, next); + if(pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER) + { + pend->last_request = c->out.request; + pend->workaround = WORKAROUND_NONE; + } + } +} + int _xcb_in_read(xcb_connection_t *c) { int n = read(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len); diff --git a/libxcb/src/xcb_out.c b/libxcb/src/xcb_out.c index 60226e581..b3050fe3d 100644 --- a/libxcb/src/xcb_out.c +++ b/libxcb/src/xcb_out.c @@ -55,6 +55,25 @@ static int write_block(xcb_connection_t *c, struct iovec *vector, int count) return _xcb_out_send(c, &vector, &count); } +static void get_socket_back(xcb_connection_t *c) +{ + while(c->out.return_socket && c->out.socket_moving) + pthread_cond_wait(&c->out.socket_cond, &c->iolock); + if(!c->out.return_socket) + return; + + c->out.socket_moving = 1; + pthread_mutex_unlock(&c->iolock); + c->out.return_socket(c->out.socket_closure); + pthread_mutex_lock(&c->iolock); + c->out.socket_moving = 0; + + pthread_cond_broadcast(&c->out.socket_cond); + c->out.return_socket = 0; + c->out.socket_closure = 0; + _xcb_in_replies_done(c); +} + /* Public interface */ void xcb_prefetch_maximum_request_length(xcb_connection_t *c) @@ -111,8 +130,8 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect uint16_t len; } fields; uint32_t packet; - } sync = { { /* GetInputFocus */ 43, 0, 1 } }; - unsigned int request; + } sync_req = { { /* GetInputFocus */ 43, 0, 1 } }; + uint64_t request; uint32_t prefix[3] = { 0 }; int veclen = req->count; enum workarounds workaround = WORKAROUND_NONE; @@ -127,7 +146,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect if(!(flags & XCB_REQUEST_RAW)) { static const char pad[3]; - int i; + unsigned int i; uint16_t shortlen = 0; size_t longlen = 0; assert(vector[0].iov_len >= 4); @@ -187,22 +206,23 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect workaround = WORKAROUND_GLX_GET_FB_CONFIGS_BUG; /* get a sequence number and arrange for delivery. */ - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); /* wait for other writing threads to get out of my way. */ while(c->out.writing) - _xcb_wait_io(c, &c->out.cond); + pthread_cond_wait(&c->out.cond, &c->iolock); + get_socket_back(c); request = ++c->out.request; - /* send GetInputFocus (sync) when 64k-2 requests have been sent without + /* send GetInputFocus (sync_req) when 64k-2 requests have been sent without * a reply. - * Also send sync (could use NoOp) at 32-bit wrap to avoid having + * Also send sync_req (could use NoOp) at 32-bit wrap to avoid having * applications see sequence 0 as that is used to indicate * an error in sending the request */ while((req->isvoid && c->out.request == c->in.request_expected + (1 << 16) - 1) || request == 0) { - prefix[0] = sync.packet; + prefix[0] = sync_req.packet; _xcb_in_expect_reply(c, request, WORKAROUND_NONE, XCB_REQUEST_DISCARD_REPLY); c->in.request_expected = c->out.request; request = ++c->out.request; @@ -222,7 +242,7 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect vector[1].iov_base = (uint32_t *) vector[1].iov_base + 1; vector[1].iov_len -= sizeof(uint32_t); } - vector[0].iov_len = sizeof(uint32_t) * (prefix[0] ? 1 : 0 | prefix[2] ? 2 : 0); + vector[0].iov_len = sizeof(uint32_t) * ((prefix[0] ? 1 : 0) + (prefix[2] ? 2 : 0)); vector[0].iov_base = prefix + !prefix[0]; } @@ -231,18 +251,51 @@ unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vect _xcb_conn_shutdown(c); request = 0; } - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return request; } +int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent) +{ + int ret; + if(c->has_error) + return 0; + pthread_mutex_lock(&c->iolock); + get_socket_back(c); + ret = _xcb_out_flush_to(c, c->out.request); + if(ret) + { + c->out.return_socket = return_socket; + c->out.socket_closure = closure; + if(flags) + _xcb_in_expect_reply(c, c->out.request, WORKAROUND_EXTERNAL_SOCKET_OWNER, flags); + assert(c->out.request == c->out.request_written); + *sent = c->out.request; + } + pthread_mutex_unlock(&c->iolock); + return ret; +} + +int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests) +{ + int ret; + if(c->has_error) + return 0; + pthread_mutex_lock(&c->iolock); + c->out.request += requests; + ret = _xcb_out_send(c, &vector, &count); + pthread_mutex_unlock(&c->iolock); + return ret; +} + int xcb_flush(xcb_connection_t *c) { int ret; if(c->has_error) return 0; - _xcb_lock_io(c); + pthread_mutex_lock(&c->iolock); ret = _xcb_out_flush_to(c, c->out.request); - _xcb_unlock_io(c); + pthread_mutex_unlock(&c->iolock); return ret; } @@ -250,6 +303,12 @@ int xcb_flush(xcb_connection_t *c) int _xcb_out_init(_xcb_out *out) { + if(pthread_cond_init(&out->socket_cond, 0)) + return 0; + out->return_socket = 0; + out->socket_closure = 0; + out->socket_moving = 0; + if(pthread_cond_init(&out->cond, 0)) return 0; out->writing = 0; @@ -282,7 +341,7 @@ int _xcb_out_send(xcb_connection_t *c, struct iovec **vector, int *count) return ret; } -int _xcb_out_flush_to(xcb_connection_t *c, unsigned int request) +int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request) { assert(XCB_SEQUENCE_COMPARE(request, <=, c->out.request)); if(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request)) @@ -297,7 +356,7 @@ int _xcb_out_flush_to(xcb_connection_t *c, unsigned int request) return _xcb_out_send(c, &vec_ptr, &count); } while(c->out.writing) - _xcb_wait_io(c, &c->out.cond); + pthread_cond_wait(&c->out.cond, &c->iolock); assert(XCB_SEQUENCE_COMPARE(c->out.request_written, >=, request)); return 1; } diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c index dd2305abd..55aadb7ca 100644 --- a/libxcb/src/xcb_util.c +++ b/libxcb/src/xcb_util.c @@ -30,6 +30,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> +#include <netinet/tcp.h> #ifdef DNETCONN #include <netdnet/dnetdb.h> #include <netdnet/dn.h> @@ -38,6 +39,7 @@ #include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <stddef.h> #include <unistd.h> #include <string.h> @@ -123,12 +125,18 @@ static int _xcb_open_unix(char *protocol, const char *file); #ifdef DNETCONN static int _xcb_open_decnet(const char *host, char *protocol, const unsigned short port); #endif +#ifdef HAVE_ABSTRACT_SOCKETS +static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen); +#endif static int _xcb_open(char *host, char *protocol, const int display) { +#ifdef HAVE_ABSTRACT_SOCKETS int fd; +#endif static const char base[] = "/tmp/.X11-unix/X"; char file[sizeof(base) + 20]; + int filelen; if(*host) { @@ -155,11 +163,18 @@ static int _xcb_open(char *host, char *protocol, const int display) } /* display specifies Unix socket */ - snprintf(file, sizeof(file), "%s%d", base, display); - return _xcb_open_unix(protocol, file); - + filelen = snprintf(file, sizeof(file), "%s%d", base, display); + if(filelen < 0) + return -1; + /* snprintf may truncate the file */ + filelen = MIN(filelen, sizeof(file) - 1); +#ifdef HAVE_ABSTRACT_SOCKETS + fd = _xcb_open_abstract(protocol, file, filelen); + if (fd >= 0 || (errno != ENOENT && errno != ECONNREFUSED)) + return fd; - return fd; +#endif + return _xcb_open_unix(protocol, file); } #ifdef DNETCONN @@ -179,8 +194,9 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign addr.sdn_add.a_len = nodeaddr->n_length; memcpy(addr.sdn_add.a_addr, nodeaddr->n_addr, addr.sdn_add.a_len); - sprintf((char *)addr.sdn_objname, "X$X%d", port); - addr.sdn_objnamel = strlen((char *)addr.sdn_objname); + addr.sdn_objnamel = sprintf((char *)addr.sdn_objname, "X$X%d", port); + if(addr.sdn_objnamel < 0) + return -1; addr.sdn_objnum = 0; fd = socket(PF_DECnet, SOCK_STREAM, 0); @@ -188,12 +204,15 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign return -1; memset(&accessdata, 0, sizeof(accessdata)); - sprintf((char*)accessdata.acc_acc, "%d", getuid()); - accessdata.acc_accl = strlen((char *)accessdata.acc_acc); + accessdata.acc_accl = sprintf((char*)accessdata.acc_acc, "%d", getuid()); + if(accessdata.acc_accl < 0) + return -1; setsockopt(fd, DNPROTO_NSP, SO_CONACCESS, &accessdata, sizeof(accessdata)); - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) + if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { + close(fd); return -1; + } return fd; } #endif @@ -201,14 +220,7 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) { int fd = -1; - struct addrinfo hints = { 0 -#ifdef AI_ADDRCONFIG - | AI_ADDRCONFIG -#endif -#ifdef AI_NUMERICSERV - | AI_NUMERICSERV -#endif - , AF_UNSPEC, SOCK_STREAM }; + struct addrinfo hints; char service[6]; /* "65535" with the trailing '\0' */ struct addrinfo *results, *addr; char *bracket; @@ -216,6 +228,17 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) if (protocol && strcmp("tcp",protocol)) return -1; + memset(&hints, 0, sizeof(hints)); +#ifdef AI_ADDRCONFIG + hints.ai_flags |= AI_ADDRCONFIG; +#endif +#ifdef AI_NUMERICSERV + hints.ai_flags |= AI_NUMERICSERV; +#endif + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + +#ifdef AF_INET6 /* Allow IPv6 addresses enclosed in brackets. */ if(host[0] == '[' && (bracket = strrchr(host, ']')) && bracket[1] == '\0') { @@ -224,6 +247,7 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) hints.ai_flags |= AI_NUMERICHOST; hints.ai_family = AF_INET6; } +#endif snprintf(service, sizeof(service), "%hu", port); if(getaddrinfo(host, service, &hints, &results)) @@ -233,9 +257,15 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) for(addr = results; addr; addr = addr->ai_next) { fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); - if(fd >= 0 && connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0) - break; - fd = -1; + if(fd >= 0) { + int on = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); + + if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0) + break; + close(fd); + fd = -1; + } } freeaddrinfo(results); return fd; @@ -244,45 +274,56 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) static int _xcb_open_unix(char *protocol, const char *file) { int fd; - struct sockaddr_un addr = { AF_UNIX }; + struct sockaddr_un addr; if (protocol && strcmp("unix",protocol)) return -1; strcpy(addr.sun_path, file); - + addr.sun_family = AF_UNIX; +#ifdef HAVE_SOCKADDR_SUN_LEN + addr.sun_len = SUN_LEN(&addr); +#endif fd = socket(AF_UNIX, SOCK_STREAM, 0); if(fd == -1) return -1; - if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) + if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) { + close(fd); return -1; + } return fd; } -xcb_connection_t *xcb_connect(const char *displayname, int *screenp) +#ifdef HAVE_ABSTRACT_SOCKETS +static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen) { - int fd, display = 0; - char *host; - char *protocol; - xcb_connection_t *c; - xcb_auth_info_t auth; + int fd; + struct sockaddr_un addr = {0}; + socklen_t namelen; - if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp)) - return (xcb_connection_t *) &error_connection; - fd = _xcb_open(host, protocol, display); - free(host); - if(fd == -1) - return (xcb_connection_t *) &error_connection; + if (protocol && strcmp("unix",protocol)) + return -1; - if(_xcb_get_auth_info(fd, &auth, display)) - { - c = xcb_connect_to_fd(fd, &auth); - free(auth.name); - free(auth.data); + strcpy(addr.sun_path + 1, file); + addr.sun_family = AF_UNIX; + namelen = offsetof(struct sockaddr_un, sun_path) + 1 + filelen; +#ifdef HAVE_SOCKADDR_SUN_LEN + addr.sun_len = 1 + filelen; +#endif + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd == -1) + return -1; + if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) { + close(fd); + return -1; } - else - c = xcb_connect_to_fd(fd, 0); - return c; + return fd; +} +#endif + +xcb_connection_t *xcb_connect(const char *displayname, int *screenp) +{ + return xcb_connect_to_display_with_auth_info(displayname, NULL, screenp); } xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, xcb_auth_info_t *auth, int *screenp) @@ -290,13 +331,38 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname, int fd, display = 0; char *host; char *protocol; + xcb_auth_info_t ourauth; + xcb_connection_t *c; - if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp)) + int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp); + +#ifdef HAVE_LAUNCHD + if(!displayname) + displayname = getenv("DISPLAY"); + if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11)) + fd = _xcb_open_unix(NULL, displayname); + else +#endif + if(!parsed) return (xcb_connection_t *) &error_connection; - fd = _xcb_open(host, protocol, display); + else + fd = _xcb_open(host, protocol, display); free(host); + if(fd == -1) return (xcb_connection_t *) &error_connection; - return xcb_connect_to_fd(fd, auth); + if(auth) + return xcb_connect_to_fd(fd, auth); + + if(_xcb_get_auth_info(fd, &ourauth, display)) + { + c = xcb_connect_to_fd(fd, &ourauth); + free(ourauth.name); + free(ourauth.data); + } + else + c = xcb_connect_to_fd(fd, 0); + + return c; } diff --git a/libxcb/src/xcb_xid.c b/libxcb/src/xcb_xid.c index 7ff0c5fc2..3df5dbec6 100644 --- a/libxcb/src/xcb_xid.c +++ b/libxcb/src/xcb_xid.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2004 Bart Massey and Jamey Sharp. +/* Copyright (C) 2001-2008 Bart Massey and Jamey Sharp. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ /* XID allocators. */ +#include <assert.h> #include <stdlib.h> #include "xcb.h" #include "xcbext.h" @@ -39,21 +40,40 @@ uint32_t xcb_generate_id(xcb_connection_t *c) if(c->has_error) return -1; pthread_mutex_lock(&c->xid.lock); - if(c->xid.last == c->xid.max) + if(c->xid.last >= c->xid.max - c->xid.inc + 1) { xcb_xc_misc_get_xid_range_reply_t *range; - range = xcb_xc_misc_get_xid_range_reply(c, xcb_xc_misc_get_xid_range(c), 0); - if(!range) - { - pthread_mutex_unlock(&c->xid.lock); - return -1; + assert(c->xid.last == c->xid.max); + if (c->xid.last == 0) { + /* finish setting up initial range */ + c->xid.max = c->setup->resource_id_mask; + } else { + /* check for extension */ + const xcb_query_extension_reply_t *xc_misc_reply = + xcb_get_extension_data(c, &xcb_xc_misc_id); + if (!xc_misc_reply) { + pthread_mutex_unlock(&c->xid.lock); + return -1; + } + /* get new range */ + range = xcb_xc_misc_get_xid_range_reply(c, + xcb_xc_misc_get_xid_range(c), 0); + /* XXX The latter disjunct is what the server returns + when it is out of XIDs. Sweet. */ + if(!range || (range->start_id == 0 && range->count == 1)) + { + pthread_mutex_unlock(&c->xid.lock); + return -1; + } + assert(range->count > 0 && range->start_id > 0); + c->xid.last = range->start_id; + c->xid.max = range->start_id + (range->count - 1) * c->xid.inc; + free(range); } - c->xid.last = range->start_id; - c->xid.max = range->start_id + (range->count - 1) * c->xid.inc; - free(range); + } else { + c->xid.last += c->xid.inc; } ret = c->xid.last | c->xid.base; - c->xid.last += c->xid.inc; pthread_mutex_unlock(&c->xid.lock); return ret; } @@ -65,8 +85,8 @@ int _xcb_xid_init(xcb_connection_t *c) if(pthread_mutex_init(&c->xid.lock, 0)) return 0; c->xid.last = 0; + c->xid.max = 0; c->xid.base = c->setup->resource_id_base; - c->xid.max = c->setup->resource_id_mask; c->xid.inc = c->setup->resource_id_mask & -(c->setup->resource_id_mask); return 1; } diff --git a/libxcb/src/xcbext.h b/libxcb/src/xcbext.h index 01dd59015..2e10ba203 100644 --- a/libxcb/src/xcbext.h +++ b/libxcb/src/xcbext.h @@ -59,6 +59,23 @@ enum xcb_send_request_flags_t { unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request); +/* xcb_take_socket allows external code to ask XCB for permission to + * take over the write side of the socket and send raw data with + * xcb_writev. xcb_take_socket provides the sequence number of the last + * request XCB sent. The caller of xcb_take_socket must supply a + * callback which XCB can call when it wants the write side of the + * socket back to make a request. This callback synchronizes with the + * external socket owner, flushes any output queues if appropriate, and + * then returns the sequence number of the last request sent over the + * socket. */ +int xcb_take_socket(xcb_connection_t *c, void (*return_socket)(void *closure), void *closure, int flags, uint64_t *sent); + +/* You must own the write-side of the socket (you've called + * xcb_take_socket, and haven't returned from return_socket yet) to call + * xcb_writev. Also, the iovec must have at least 1 byte of data in it. + * */ +int xcb_writev(xcb_connection_t *c, struct iovec *vector, int count, uint64_t requests); + /* xcb_in.c */ diff --git a/libxcb/src/xcbint.h b/libxcb/src/xcbint.h index ab0264fe7..154cca04a 100644 --- a/libxcb/src/xcbint.h +++ b/libxcb/src/xcbint.h @@ -40,7 +40,8 @@ enum workarounds { WORKAROUND_NONE, - WORKAROUND_GLX_GET_FB_CONFIGS_BUG + WORKAROUND_GLX_GET_FB_CONFIGS_BUG, + WORKAROUND_EXTERNAL_SOCKET_OWNER }; enum lazy_reply_tag @@ -52,7 +53,18 @@ enum lazy_reply_tag #define XCB_PAD(i) (-(i) & 3) -#define XCB_SEQUENCE_COMPARE(a,op,b) ((int) ((a) - (b)) op 0) +#define XCB_SEQUENCE_COMPARE(a,op,b) ((int64_t) ((a) - (b)) op 0) +#define XCB_SEQUENCE_COMPARE_32(a,op,b) (((int) (a) - (int) (b)) op 0) + +#ifndef offsetof +#define offsetof(type,member) ((size_t) &((type *)0)->member) +#endif + +#ifndef MIN +#define MIN(x,y) ((x) < (y) ? (x) : (y)) +#endif + +#define container_of(pointer,type,member) ((type *)(((char *)(pointer)) - offsetof(type, member))) /* xcb_list.c */ @@ -72,11 +84,16 @@ typedef struct _xcb_out { pthread_cond_t cond; int writing; - char queue[4096]; + pthread_cond_t socket_cond; + void (*return_socket)(void *closure); + void *socket_closure; + int socket_moving; + + char queue[XCB_QUEUE_BUFFER_SIZE]; int queue_len; - unsigned int request; - unsigned int request_written; + uint64_t request; + uint64_t request_written; pthread_mutex_t reqlenlock; enum lazy_reply_tag maximum_request_length_tag; @@ -90,7 +107,7 @@ int _xcb_out_init(_xcb_out *out); void _xcb_out_destroy(_xcb_out *out); int _xcb_out_send(xcb_connection_t *c, struct iovec **vector, int *count); -int _xcb_out_flush_to(xcb_connection_t *c, unsigned int request); +int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request); /* xcb_in.c */ @@ -102,9 +119,9 @@ typedef struct _xcb_in { char queue[4096]; int queue_len; - unsigned int request_expected; - unsigned int request_read; - unsigned int request_completed; + uint64_t request_expected; + uint64_t request_read; + uint64_t request_completed; struct reply_list *current_reply; struct reply_list **current_reply_tail; @@ -120,22 +137,13 @@ typedef struct _xcb_in { int _xcb_in_init(_xcb_in *in); void _xcb_in_destroy(_xcb_in *in); -int _xcb_in_expect_reply(xcb_connection_t *c, unsigned int request, enum workarounds workaround, int flags); +int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags); +void _xcb_in_replies_done(xcb_connection_t *c); int _xcb_in_read(xcb_connection_t *c); int _xcb_in_read_block(xcb_connection_t *c, void *buf, int nread); -/* xcb_xlib.c */ - -typedef struct _xcb_xlib { - int lock; - int sloppy_lock; - pthread_t thread; - pthread_cond_t cond; -} _xcb_xlib; - - /* xcb_xid.c */ typedef struct _xcb_xid { @@ -173,7 +181,6 @@ struct xcb_connection_t { /* I/O data */ pthread_mutex_t iolock; - _xcb_xlib xlib; _xcb_in in; _xcb_out out; @@ -183,7 +190,6 @@ struct xcb_connection_t { }; void _xcb_conn_shutdown(xcb_connection_t *c); -void _xcb_wait_io(xcb_connection_t *c, pthread_cond_t *cond); int _xcb_conn_wait(xcb_connection_t *c, pthread_cond_t *cond, struct iovec **vector, int *count); @@ -195,10 +201,4 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display); #pragma GCC visibility pop #endif - -/* xcb_conn.c symbols visible to xcb-xlib */ - -void _xcb_lock_io(xcb_connection_t *c); -void _xcb_unlock_io(xcb_connection_t *c); - #endif |