logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Static win32 builds for lxml 1.1: msg#00036

Subject: Static win32 builds for lxml 1.1
Hello,

I've made static win32 builds for lxml 1.1. However, I faced a few problems so 
I'm just mentioning them here.

The builds are available at http://puggy.symonds.net/~ashish/downloads/

side-note: the static build is now 2.1MB, compared to the 1.2MB for 1.0.4.

1] the lxml.etree extension failed to compile

etree.c
src\lxml\etree.c(49440) : error C2137: empty character constant

The code at the location is in function __Pyx_ImportModuleCApi, and looks like 
this:

if (*t->s == '<NUL>')

Apparently, MSVC chokes on the raw <NUL> character (gcc doesn't have a problem 
with it). Ideally such a character should not be present -- it should use 
something like '\x0', which is what I did. If this is correct, then it should 
be fixed either in the Pyrex code, the patched Pyrex or swig (wherever the 
problem originated).

2] the lxml.objectify extension failed to link

The lxml.objectify extension is using the xmlNanoHTTP/xmlNanoFTP functions from 
libxml2, which in turn require linking to wsock32. The solution is to add that 
to the list of libraries.

# This is called if the '--static' option is passed
def setupStaticBuild():
    cflags = [
        "-I..\\libxml2-2.6.23.win32\\include",
        "-I..\\libxslt-1.1.15.win32\\include",
        "-I..\\zlib-1.2.3.win32\\include",
        "-I..\\iconv-1.9.1.win32\\include"
    ]
    xslt_libs = [
        "..\\libxml2-2.6.23.win32\\lib\\libxml2_a.lib",
        "..\\libxslt-1.1.15.win32\\lib\\libxslt_a.lib",
        "..\\libxslt-1.1.15.win32\\lib\\libexslt_a.lib",
        "..\\zlib-1.2.3.win32\\lib\\zlib.lib",
        "..\\iconv-1.9.1.win32\\lib\\iconv_a.lib",
        "wsock32.lib"   # required for xmlNano* methods
    ]
    result = (cflags, xslt_libs)
    return result

The documentation should ideally be updated to reflect this.

Regards,
ashish


<Prev in Thread] Current Thread [Next in Thread>