Hi folks, Despite the fact that dlopen() is available on OS X for 10.3 and above, the python dl module has not been made available on 10.3 and 10.4.
Specifically, some code in the python setup.py script explicitly prevents the dl module from being built on darwin even if python sees dlfcn.h: dl_inc = find_file('dlfcn.h', [], inc_dirs) if (dl_inc is not None) and (platform not in ['atheos', 'darwin']): exts.append( Extension('dl', ['dlmodule.c']) ) Does anyone know the reason for this explicit check to keep the dl module from being built on darwin? Now, currently dl is not too useful since mac python does not respect sys.setdlopenflags(), and since ctypes are coming in python 2.5. However, I am testing a patch to make python on the mac use dlopen() instead of the NeXT-derived extension loading mechanism, precisely so that sys.setdlopenflags() can be used meaningfully on may python. In addition to providing functions to call dlopen(), the python dl module declares the values of the various dlopenflags that a user might want to pass to sys.setdlopenflags(). Thus, it would be worthwhile making the dl module work in the future. So, is there any reason that one could not just remove the 'darwin' from the above platform check in setup.py? Presumably versions of OS X below 10.3 would not have dlfcn.h, and thus on those platforms, the dl module would not be built. But on 10.3 and up, it would be built. Is this an acceptable solution? Or do there need to be explicit checks to keep dl from being build on 10.2 and below (say, because 10.2 actually does have some inoperative dlfcn.h header somewhere?) Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig