Embedding python in package using autoconf

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hallvard B Furuseth

    Embedding python in package using autoconf

    I want to use Python as an extension language in a package
    which uses autoconf. That means its and Python's autoconf
    #defines can conflict, so I can't safely #include both
    <Python.h> and the package's own include files:-(

    Do anyone have a safe way to #include at least <object.h>
    without <pyconfig.h>? E.g. copy the files (and <pyport.h>'s
    PyAPI_FUNC/PyAPI_DATA) and rename the autoconf macros - and
    fail compilation if that wouldn't work?

    Currently I have two sets of source files - one set which
    only #includes Python.h and one set which only #includes
    the package's files.
    They communicate through a single .h file with a bunch of
    enums for various functions and struct members, and wrapper
    functions to use these by their enum value. It has a few
    cheats like declaring "struct _object;" (that's PyObject)
    to make life simpler, but it's still rather tedious.

    --
    Hallvard
Working...