Skip to content

Commit

Permalink
Patch #404680: disables the nis module and enables the dl module when
Browse files Browse the repository at this point in the history
    building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.
  • Loading branch information
akuchling committed Feb 27, 2001
1 parent 5941d19 commit 6efc6e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions Lib/test/test_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
sharedlibs = [
('/usr/lib/libc.so', 'getpid'),
('/lib/libc.so.6', 'getpid'),
('/usr/bin/cygwin1.dll', 'getpid'),
]

for s, func in sharedlibs:
Expand Down
7 changes: 5 additions & 2 deletions Modules/dlmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ dl_getattr(dlobject *xp, char *name)


static PyTypeObject Dltype = {
PyObject_HEAD_INIT(&PyType_Type)
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"dl", /*tp_name*/
sizeof(dlobject), /*tp_basicsize*/
Expand Down Expand Up @@ -199,7 +199,7 @@ insint(PyObject *d, char *name, int value)
Py_XDECREF(v);
}

void
DL_EXPORT(void)
initdl(void)
{
PyObject *m, *d, *x;
Expand All @@ -211,6 +211,9 @@ initdl(void)
return;
}

/* Initialize object type */
Dltype.ob_type = &PyType_Type;

/* Create the module and add the functions */
m = Py_InitModule("dl", dl_methods);

Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,13 @@ def detect_modules(self):
exts.append( Extension('dl', ['dlmodule.c']) )

# Sun yellow pages. Some systems have the functions in libc.
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:
libs = []
exts.append( Extension('nis', ['nismodule.c'],
libraries = libs) )
if platform not in ['cygwin']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:
libs = []
exts.append( Extension('nis', ['nismodule.c'],
libraries = libs) )

# Curses support, requring the System V version of curses, often
# provided by the ncurses library.
Expand Down

0 comments on commit 6efc6e7

Please sign in to comment.