Re: [xml] Building Python wrappers for libxml2 and libxslt under Python 2.2

On Tue, Nov 19, 2002 at 10:08:41AM -0500, Tres Seaver wrote:
I need to use the wrappers for a Python which RPM doesn't know about (we
build a custom one in order to guarantee that it has the configuration
we need).


I tried building the Python wrappers via distutils after commenting out
the '#include <config.h>' lines;  the compile succeeds, which suggests
that the lines are not needed.  Can you suggest a way to test that the
wrappers are OK?  The wrapper modules import without problems.

 the problem is that some of the entry points are conditionally compiled
depending whether the assocaited support was compiled within the libxml2
library. This requires the xmlversion.h file. But I don't see why 
config.h is needed:
paphio:~/XML/python -> grep HAVE_ *.c
paphio:~/XML/python ->

'distutils.sysconfig' has an API, 'get_config_vars', which can tell you
where the Python configuration expects to find "system" includes:

  excellent, let's reuse that !

I think that running 'xml-config' via 'os.popen' would work:

  >>> foo = os.popen( 'xml-config --cflags' )
  >>> bar =
  >>> print bar

  except you would need xml2-config that's good :-)
Could you assemble a patch for this, you're well aware of the
issues so you're in a good position to do this,



Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]