Added a linkmodel attribute, showing how Python was built. This is so
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 23 Feb 2003 23:23:47 +0000 (23:23 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 23 Feb 2003 23:23:47 +0000 (23:23 +0000)
packages can check that extension modules are built for the right type
of python. Current values can be static, framework, shared and cfm (for
completeness, for MacPyton-OS9).

Closes bug #691889. The reporter suggests backporting this to 2.2.3
and I think I agree.

Mac/Modules/macosmodule.c

index 80188392231d0c10909f94f2ad0293fc21d6a8e3..92d54528f907ed7d213653005224d3c7764f4337 100644 (file)
@@ -764,5 +764,18 @@ initMacOS(void)
        if (PyDict_SetItemString(d, "runtimemodel", 
                                Py_BuildValue("s", PY_RUNTIMEMODEL)) != 0)
                return;
+#if !TARGET_API_MAC_OSX
+#define PY_LINKMODEL "cfm"
+#elif defined(WITH_NEXT_FRAMEWORK)
+#define PY_LINKMODEL "framework"
+#elif defined(Py_ENABLE_SHARED)
+#define PY_LINKMODEL "shared"
+#else
+#define PY_LINKMODEL "static"
+#endif
+       if (PyDict_SetItemString(d, "linkmodel", 
+                               Py_BuildValue("s", PY_LINKMODEL)) != 0)
+               return;
+
 }