[Xcb-commit] 2 commits - configure.ac src

Eamon Walsh ewalsh at kemper.freedesktop.org
Wed Apr 23 17:34:09 PDT 2008


 configure.ac    |    6 ++++++
 src/Makefile.am |    6 +++---
 src/c_client.py |   17 +++++++++++++++--
 3 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 4a405feba8cde8490d847a57b7e833176e18b90f
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Apr 23 20:26:28 2008 -0400

    Replace a stray c-client.xsl in the libxcb SOURCES.  Fixes make distcheck.

diff --git a/src/Makefile.am b/src/Makefile.am
index 0399039..a176d86 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,7 +15,7 @@ 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 \
+		xcb_list.c xcb_util.c xcb_auth.c c_client.py \
 		xproto.c bigreq.c xc_misc.c
 
 # Explanation for -version-info:
commit 40566c36d543edc2118cbb358e0303d9e8862892
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Apr 23 20:25:57 2008 -0400

    Use the python install path from xcb-xproto.pc to locate the xcbgen package.

diff --git a/configure.ac b/configure.ac
index 9b94392..5d21e81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,12 @@ XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
 AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
 AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
 
+# Find the xcbgen Python package
+AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
+XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
+AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
+AC_SUBST(XCBPROTO_XCBPYTHONDIR)
+
 AC_HEADER_STDC
 AC_SEARCH_LIBS(getaddrinfo, socket)
 AC_SEARCH_LIBS(connect, socket)
diff --git a/src/Makefile.am b/src/Makefile.am
index 49ae77c..0399039 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -268,10 +268,10 @@ $(EXTHEADERS) $(EXTSOURCES): c_client.py
 SUFFIXES = .xml
 
 .xml.h:
-	$(PYTHON) c_client.py $(XCBPROTO_XCBINCLUDEDIR)/$<
+	$(PYTHON) c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$<
 
 .xml.c:
-	$(PYTHON) c_client.py $(XCBPROTO_XCBINCLUDEDIR)/$<
+	$(PYTHON) c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$<
 
 $(EXTENSION_XML):
 	$(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@
diff --git a/src/c_client.py b/src/c_client.py
index 835ae5c..19c8015 100755
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -1,7 +1,8 @@
 #!/usr/bin/env python
 from xml.etree.cElementTree import *
-from sys import argv
 from os.path import basename
+import getopt
+import sys
 import re
 
 # Jump to the bottom of this file for the main routine
@@ -982,6 +983,18 @@ output = {'open'    : c_open,
 
 # 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
@@ -996,7 +1009,7 @@ except ImportError:
     raise
 
 # Parse the xml header
-module = Module(argv[1], output)
+module = Module(args[0], output)
 
 # Build type-registry and resolve type dependencies
 module.register()


More information about the xcb-commit mailing list