On 5/1/07, David Glasser <email@example.com> wrote:
> On 5/1/07, David Glasser <firstname.lastname@example.org> wrote:
> > In autogen.py, the line
> > os.system("cd %s && python %s/ctypesgen/wrap.py %s %s "
> > "%s -o svn_all.py" % (tempdir, os.getcwd(),
> > flags, ldflags, includes))
> > doesn't work if your installation of Python 2.5 is not called python
> > (on MacPorts, for example, python is Python 2.4 by default); does
> > Python have a "current executable path" variable?
Yup! You can find out the path to the python executable using the
"PYTHON" config var in distutils.sysconfig. I've patched autogen.py to
use this flag in r24870, following the example from
build/get-py-info.py in Subversion trunk.
> Having changed that by hand to python2.5, I'm getting that autogen.py
> is trying to run
> cd /tmp/tmpuEnN3u && python2.5
> -I/opt/local/include/apr-1 -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK
> -no-cpp-precomp -I/opt/local/include/subversion-1 -llibapr-1.so
> -llibaprutil-1.so /opt/local/include/subversion-1/svn_*.h
> /opt/local/include/apr-1/ap[ru]_*.h -o svn_all.py
> but wrap.py doesn't seem to expect arguments that look anything like
> that, and I get
> wrap.py: error: no such option: -n
> (This is on OS X.) Am I doing something wrong?
Right now, autogen.py figures out what arguments to use when calling
wrap.py by running "apr-1-config --includes --cppflags".
Unfortunately, this doesn't work on your system, because wrap.py
doesn't handle the "-no-cpp-precomp" option.
At first, I thought I'd patch autogen.py to avoid passing arguments
that wrap.py doesn't understand (see r24869), but I later did some
more research and learned that the "-no-cpp-precomp" is an important
flag, so I looked for a different fix.
Instead, I've patched wrap.py to accept an arbitrary command line for
invoking the "c preprocessor" via the "--cpp" flag, and I've patched
the ctypes python bindings to now use this option. Further, there's no
longer any need for wrap.py to accept arguments like "-D" or "-I",
since the preprocessor handles this now, so I've removed the code
which processes these options.
You'll need to update both the ctypes python bindings and ctypesgen to
take advantage of this fix, which I committed in r24871.
Hope this helps,
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue May 1 19:46:26 2007