Re: [Distutils] Linking against the interpreter - how?
Jack Jansen <Jack.Jansen@oratrix.nl> writes:
I'm in the process of converting Python to use two-level namespaces on Mac OS X (a way to make sure globals in different extension modules don't bite each other) but I'm running into a problem.
If you use two level namespaces the LD command line for the extension module needs to specify the executable into which the extension will be loaded. But unfortunately the Makefile variable for this, BLDFLAGS, does double duty: it is used during the build process for building the standard extension modules (with the setup.py in the Python source directory) and it is later (when Python is installed, and you're building a new extension module) picked up by distutils.
In the first case BLDFLAGS would need to contain the pathname of the Python executable in the build directory. In the second case it would need to contain the pathname of the installed Python.
Does anyone have any suggestions on how I could fix this?
Um, can you use a strategy like that of command/build_scripts.py? I.e. check sysconfig.python_build and then use either sys.executable or sysconfig.get_config_var("BINDIR") + "python", depending? Cheers, M. -- The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
participants (1)
-
Michael Hudson