Hey all,

Some of you may remember a project i worked on for GSoC 2012, i wasn't
really happy with the project over all for a long time it basicaly
required at the time people to be running GCC from latest SVN/GIT for
it to work correctly.

Now gcc >= 4.7 is becoming more normal, so i went back into it and
rewrote it from scratch now and its shaping up to look fairly decent
and usable now.

https://github.com/redbrain/cython/tree/master/Tools/gccpxd

So the idea for this project is that you write a small configuration
file and it will integrate with your C/C++ build system for example
you could do:

./configure CC=cygcc ...
make
...

And you will get a project.pxd file after the build of your software.
the cygcc is simply a wrapper over GCC that shoves in the fplugin
arguments so you can run:

cygcc -g -O2 -Wall -c test.c -o test.o

So build systems wont really notice anything different it should just
think its gcc. The configuration file example in the folder .cygcc:

$ cat .cygcc
header = 'test.h'             # the header to get declaratiosn for
inputs = ['test.h', 'test.c'] # any locations of declarations that
would be involved
output = 'test.pxd'          # the output

The cygcc compiler looks for this in the current director or looks up
at the parent directory untill it finds it or it will fail with an
error message.

It will only ouput once if the test.pxd file exists in the current
working directory it wont do anything.

$ cat test.pxd
cdef extern from "test.h":
  int test (int, int)
  int global_variable
  int static_variable # this is a bug but hey...
  struct bla:
    int a
    float b

So far for the example code in there its working pretty well the gcc
python plugin has stabalized alot and so has some of gcc's bits a
bobs. I will try and keep you all updated i think the plugin is doing
alot more work now so this doesnt have to do so much.

Thanks to Robert Bradshaw for baring with me in the whole thing
because i probably wasn't the easiest to work with ;) lol.

Thanks everyone cython is awesome.

--Phil
_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to