]> granicus.if.org Git - python/commitdiff
Patch #404680: disables the nis module and enables the dl module when
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 27 Feb 2001 20:54:23 +0000 (20:54 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 27 Feb 2001 20:54:23 +0000 (20:54 +0000)
    building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.

Lib/test/test_dl.py
Modules/dlmodule.c
setup.py

index 60a5cf0cefc754438f0dd5efb2e68836be09da6f..390dbd8afa7b90228e4df5d3af3d3868e1489a6f 100755 (executable)
@@ -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:
index bb49a500079bb1f3aaa52ff9fc34886a7f5b8338..8c771335961df5207be6b63c471a8518b01c72a2 100644 (file)
@@ -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);
 
index 0892f160f880866cf691ccd6a1f77052fcbab80a..f9524e68f08e60904e1a6b35f76cacb6c269a04c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -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.