Kaydet (Commit) 6efc6e78 authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Patch #404680: disables the nis module and enables the dl module when

    building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.
üst 5941d191
...@@ -9,6 +9,7 @@ from test_support import verbose,TestSkipped ...@@ -9,6 +9,7 @@ from test_support import verbose,TestSkipped
sharedlibs = [ sharedlibs = [
('/usr/lib/libc.so', 'getpid'), ('/usr/lib/libc.so', 'getpid'),
('/lib/libc.so.6', 'getpid'), ('/lib/libc.so.6', 'getpid'),
('/usr/bin/cygwin1.dll', 'getpid'),
] ]
for s, func in sharedlibs: for s, func in sharedlibs:
......
...@@ -134,7 +134,7 @@ dl_getattr(dlobject *xp, char *name) ...@@ -134,7 +134,7 @@ dl_getattr(dlobject *xp, char *name)
static PyTypeObject Dltype = { static PyTypeObject Dltype = {
PyObject_HEAD_INIT(&PyType_Type) PyObject_HEAD_INIT(NULL)
0, /*ob_size*/ 0, /*ob_size*/
"dl", /*tp_name*/ "dl", /*tp_name*/
sizeof(dlobject), /*tp_basicsize*/ sizeof(dlobject), /*tp_basicsize*/
...@@ -199,7 +199,7 @@ insint(PyObject *d, char *name, int value) ...@@ -199,7 +199,7 @@ insint(PyObject *d, char *name, int value)
Py_XDECREF(v); Py_XDECREF(v);
} }
void DL_EXPORT(void)
initdl(void) initdl(void)
{ {
PyObject *m, *d, *x; PyObject *m, *d, *x;
...@@ -211,6 +211,9 @@ initdl(void) ...@@ -211,6 +211,9 @@ initdl(void)
return; return;
} }
/* Initialize object type */
Dltype.ob_type = &PyType_Type;
/* Create the module and add the functions */ /* Create the module and add the functions */
m = Py_InitModule("dl", dl_methods); m = Py_InitModule("dl", dl_methods);
......
...@@ -387,12 +387,13 @@ class PyBuildExt(build_ext): ...@@ -387,12 +387,13 @@ class PyBuildExt(build_ext):
exts.append( Extension('dl', ['dlmodule.c']) ) exts.append( Extension('dl', ['dlmodule.c']) )
# Sun yellow pages. Some systems have the functions in libc. # Sun yellow pages. Some systems have the functions in libc.
if (self.compiler.find_library_file(lib_dirs, 'nsl')): if platform not in ['cygwin']:
libs = ['nsl'] if (self.compiler.find_library_file(lib_dirs, 'nsl')):
else: libs = ['nsl']
libs = [] else:
exts.append( Extension('nis', ['nismodule.c'], libs = []
libraries = libs) ) exts.append( Extension('nis', ['nismodule.c'],
libraries = libs) )
# Curses support, requring the System V version of curses, often # Curses support, requring the System V version of curses, often
# provided by the ncurses library. # provided by the ncurses library.
......
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