--- Python-2.2/setup.py.dlmodule Mon Dec 17 15:24:43 2001 +++ Python-2.2/setup.py Sat Dec 29 17:42:06 2001 @@ -567,6 +567,11 @@ define_macros = expat_defs, libraries = ['expat']) ) + # Dynamic loading module + dl_inc = find_file('dlfcn.h', [], inc_dirs) + if dl_inc is not None: + exts.append( Extension('dl', ['dlmodule.c']) ) + # Platform-specific libraries if platform == 'linux2': # Linux-specific modules --- Python-2.2/Modules/dlmodule.c.dlmodule Sat Dec 29 17:29:52 2001 +++ Python-2.2/Modules/dlmodule.c Sat Dec 29 17:31:25 2001 @@ -158,6 +158,13 @@ char *name; int mode; PyUnivPtr *handle; + if (sizeof(int) != sizeof(long) || + sizeof(long) != sizeof(char *)) { + PyErr_SetString(PyExc_SystemError, + "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)"); + return NULL; + } + if (PyArg_Parse(args, "z", &name)) mode = RTLD_LAZY; else { @@ -203,13 +210,6 @@ initdl(void) { PyObject *m, *d, *x; - - if (sizeof(int) != sizeof(long) || - sizeof(long) != sizeof(char *)) { - PyErr_SetString(PyExc_SystemError, - "module dl requires sizeof(int) == sizeof(long) == sizeof(char*)"); - return; - } /* Initialize object type */ Dltype.ob_type = &PyType_Type;