[Python-checkins] python/dist/src/Mac/Modules macosmodule.c,1.64,1.65

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Sun, 23 Feb 2003 15:23:49 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv14326

Modified Files:
	macosmodule.c 
Log Message:
Added a linkmodel attribute, showing how Python was built. This is so
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.


Index: macosmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macosmodule.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** macosmodule.c	21 Feb 2003 16:31:11 -0000	1.64
--- macosmodule.c	23 Feb 2003 23:23:47 -0000	1.65
***************
*** 765,768 ****
--- 765,781 ----
  				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;
+ 
  }