#39223: incorrect flags from distutils when linking against python27 @2.7.5_0 -----------------------+------------------- Reporter: ram@… | Owner: jwa@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: python27 | -----------------------+------------------- Comment (by nad@…): LINKFORSHARED is a configuration variable used to build the Python interpreter itself in its build directory. It isn't intended to be used directly by other components. Unfortunately, Python builds export all configuration variables whether they are meaningful or not. To embed Python, the supported interface for finding build flags is to use the pythonx.y-config script: {{{ $ /opt/local/bin/python2.7-config --cflags -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -pipe -O2 -fwrapv -arch x86_64 -arch i386 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes $ /opt/local/bin/python2.7-config --ldflags -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -ldl -framework CoreFoundation -lpython2.7 }}} This is explained in the "Extending and Embedding the Python Interpreter" manual of the Python docs [http://docs.python.org/3/extending/embedding.html#compiling-and-linking- under-unix-like-systems] Note that the Python 3 version of this doc is more up-to-date than the Python 2 version. -- Ticket URL: <https://trac.macports.org/ticket/39223#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X