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.