diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2001-02-27 20:54:23 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2001-02-27 20:54:23 (GMT) |
commit | 6efc6e783247f54e4dd3b4297a0a7d2bc654a141 (patch) | |
tree | 44e8bde777ed899f2589e8ceaa118c0d7b060e60 | |
parent | 5941d191deaf2a0c8eab5ce75316067ed16dfb1a (diff) | |
download | cpython-6efc6e783247f54e4dd3b4297a0a7d2bc654a141.zip cpython-6efc6e783247f54e4dd3b4297a0a7d2bc654a141.tar.gz cpython-6efc6e783247f54e4dd3b4297a0a7d2bc654a141.tar.bz2 |
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.
-rwxr-xr-x | Lib/test/test_dl.py | 1 | ||||
-rw-r--r-- | Modules/dlmodule.c | 7 | ||||
-rw-r--r-- | setup.py | 13 |
3 files changed, 13 insertions, 8 deletions
diff --git a/Lib/test/test_dl.py b/Lib/test/test_dl.py index 60a5cf0..390dbd8 100755 --- a/Lib/test/test_dl.py +++ b/Lib/test/test_dl.py @@ -9,6 +9,7 @@ from test_support import verbose,TestSkipped sharedlibs = [ ('/usr/lib/libc.so', 'getpid'), ('/lib/libc.so.6', 'getpid'), + ('/usr/bin/cygwin1.dll', 'getpid'), ] for s, func in sharedlibs: diff --git a/Modules/dlmodule.c b/Modules/dlmodule.c index bb49a50..8c77133 100644 --- a/Modules/dlmodule.c +++ b/Modules/dlmodule.c @@ -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*/ @@ -199,7 +199,7 @@ insint(PyObject *d, char *name, int value) Py_XDECREF(v); } -void +DL_EXPORT(void) initdl(void) { PyObject *m, *d, *x; @@ -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); @@ -387,12 +387,13 @@ class PyBuildExt(build_ext): 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. |