Kaydet (Commit) 93227275 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Patch #497126: Always compile dl.

üst 7198a525
...@@ -312,6 +312,7 @@ Fredrik Nehr ...@@ -312,6 +312,7 @@ Fredrik Nehr
Chad Netzer Chad Netzer
Max Neunhffer Max Neunhffer
George Neville-Neil George Neville-Neil
Gustavo Niemeyer
Oscar Nierstrasz Oscar Nierstrasz
Hrvoje Niksic Hrvoje Niksic
Bill Noon Bill Noon
......
...@@ -12,6 +12,10 @@ Core and builtins ...@@ -12,6 +12,10 @@ Core and builtins
Extension modules Extension modules
- dl is now build on every system that has dlfcn.h. Failure in case
of sizeof(int)!=sizeof(long)!=sizeof(void*) is delayed until dl.open
is called.
Library Library
- ftplib: to safeguard the user's privacy, anonymous login will use - ftplib: to safeguard the user's privacy, anonymous login will use
......
...@@ -158,6 +158,13 @@ dl_open(PyObject *self, PyObject *args) ...@@ -158,6 +158,13 @@ dl_open(PyObject *self, PyObject *args)
char *name; char *name;
int mode; int mode;
PyUnivPtr *handle; 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)) if (PyArg_Parse(args, "z", &name))
mode = RTLD_LAZY; mode = RTLD_LAZY;
else { else {
...@@ -204,13 +211,6 @@ initdl(void) ...@@ -204,13 +211,6 @@ initdl(void)
{ {
PyObject *m, *d, *x; 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 */ /* Initialize object type */
Dltype.ob_type = &PyType_Type; Dltype.ob_type = &PyType_Type;
......
...@@ -567,6 +567,11 @@ class PyBuildExt(build_ext): ...@@ -567,6 +567,11 @@ class PyBuildExt(build_ext):
define_macros = expat_defs, define_macros = expat_defs,
libraries = ['expat']) ) 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 # Platform-specific libraries
if platform == 'linux2': if platform == 'linux2':
# Linux-specific modules # Linux-specific modules
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment