MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX:
--with-universal-archs=[32-bit|64-bit|all]
When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).
This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.
I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
diff --git a/Mac/Modules/OSATerminology.c b/Mac/Modules/OSATerminology.c
index 66fb969..e56a0db 100644
--- a/Mac/Modules/OSATerminology.c
+++ b/Mac/Modules/OSATerminology.c
@@ -11,6 +11,7 @@
#include <Carbon/Carbon.h>
+#ifndef __LP64__
static PyObject *
PyOSA_GetAppTerminology(PyObject* self, PyObject* args)
{
@@ -68,12 +69,14 @@
if (err) return PyMac_Error(err);
return Py_BuildValue("O&i", AEDesc_New, &theDesc, didLaunch);
}
+#endif /* !__LP64__ */
/*
* List of methods defined in the module
*/
static struct PyMethodDef OSATerminology_methods[] =
{
+#ifndef __LP64__
{"GetAppTerminology",
(PyCFunction) PyOSA_GetAppTerminology,
METH_VARARGS,
@@ -82,14 +85,14 @@
(PyCFunction) PyOSA_GetSysTerminology,
METH_VARARGS,
"Get an applications system terminology, as an AEDesc object."},
+#endif /* !__LP64__ */
{NULL, (PyCFunction) NULL, 0, NULL}
};
-
void
initOSATerminology(void)
{
if (PyErr_WarnPy3k("In 3.x, OSATerminology is removed.", 1) < 0)
return;
Py_InitModule("OSATerminology", OSATerminology_methods);
-}
\ No newline at end of file
+}