When I try to build Subversion's ctypes-python bindings, I get this
failure:
$ (cd obj-dir && make ctypes-python)
[...]/build/run_ctypesgen.sh [...very long line...]
Status: Preprocessing /tmp/tmpejFJ1B.h
Status: i486-linux-gnu-gcc -E -DLINUX=2 [...] /tmp/tmpejFJ1B.h
Status: Parsing /tmp/tmpejFJ1B.h
Error: /usr/include/lber.h:71: Syntax error at '\n'
Status: Processing description list.
Warning: Member "in" of Struct "apr_proc_t" has been renamed to "_in"
because it has the same name as a Python keyword.
Status: Writing to subversion/bindings/ctypes-python/svn_all.py.
Status: Wrapping complete.
I tried Google("ctypesgen lber") and ("ctypesgen \"Syntax error at\""),
and found no solutions, just
<http://svn.haxx.se/dev/archive-2008-07/0048.shtml> in which Arfrever
saw the same error.
ctypesgen.py is an up-to-date trunk checkout:
<http://ctypesgen.googlecode.com/svn/tr...@123>.
The root cause is twofold:
First, line 71-72 of </usr/include/lber.h> defines a macro with
mismatched parentheses in its expansion text:
#define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080UL) \
&& (((t) & (ber_tag_t) ~ 0x0FF))
That was fixed (the macro was removed) in a later version of lber.h:
<http://www.openldap.org/its/index.cgi/Software%
20Bugs?id=6402;usearchives=1>, but my system's packaging does not yet
use the later version.
Second, ctypesgen chokes on parsing this macro. I haven't investigated
trying to make ctypesgen parse this macro correctly, I just thought I'd
bring it up.
I am working around the issue by hand-editing my copy of "lber.h" to
remove that macro definition.
- Julian