summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/file/filesupport.py
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2008-06-05 12:58:24 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2008-06-05 12:58:24 (GMT)
commit5640ce2f1edc0148ee14fd3daeb7ac700700bb71 (patch)
tree9bc8b41710d3a86ccbb579a0209928d787386b69 /Mac/Modules/file/filesupport.py
parent80af6da7489c3b28e0a46c73849da34273972e3b (diff)
downloadcpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.zip
cpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.tar.gz
cpython-5640ce2f1edc0148ee14fd3daeb7ac700700bb71.tar.bz2
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.
Diffstat (limited to 'Mac/Modules/file/filesupport.py')
-rw-r--r--Mac/Modules/file/filesupport.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index 37aeb50..88f88cd 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -6,6 +6,13 @@
# XXXX TO DO:
# - Implement correct missing FSSpec handling for Alias methods
# - Implement FInfo
+#
+# WARNING WARNING WARNING
+# The file _Filemodule.c was modified manually, don't run this script
+# unless you really know what you're doing.
+
+import sys
+sys.exit(42)
import string
@@ -199,6 +206,7 @@ PyMac_BuildHFSUniStr255(HFSUniStr255 *itself)
return Py_BuildValue("u#", itself->unicode, itself->length);
}
+#ifndef __LP64__
/*
** Get pathname for a given FSSpec
*/
@@ -244,10 +252,13 @@ _PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
}
return 0;
}
+#endif /* !__LP64__ */
"""
finalstuff = finalstuff + """
+
+#ifndef __LP64__
int
PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
{
@@ -286,6 +297,8 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *spec)
return 0;
}
+#endif /* !__LP64__ */
+
int
PyMac_GetFSRef(PyObject *v, FSRef *fsr)
{
@@ -309,6 +322,7 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
}
/* XXXX Should try unicode here too */
/* Otherwise we try to go via an FSSpec */
+#ifndef __LP64__
if (FSSpec_Check(v)) {
fss = ((FSSpecObject *)v)->ob_itself;
if ((err=FSpMakeFSRef(&fss, fsr)) == 0)
@@ -317,14 +331,19 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
return 0;
}
PyErr_SetString(PyExc_TypeError, "FSRef, FSSpec or pathname required");
+#else /* __LP64__ */
+ PyErr_SetString(PyExc_TypeError, "FSRef or pathname required");
+#endif /* __LP64__ */
return 0;
}
+#ifndef __LP64__
extern PyObject *
PyMac_BuildFSSpec(FSSpec *spec)
{
return FSSpec_New(spec);
}
+#endif /* __LP64__ */
extern PyObject *
PyMac_BuildFSRef(FSRef *spec)
@@ -334,9 +353,11 @@ PyMac_BuildFSRef(FSRef *spec)
"""
initstuff = initstuff + """
+#ifndef __LP64__
PyMac_INIT_TOOLBOX_OBJECT_NEW(FSSpec *, PyMac_BuildFSSpec);
-PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSSpec, PyMac_GetFSSpec);
+#endif /* !__LP64__*/
+PyMac_INIT_TOOLBOX_OBJECT_NEW(FSRef *, PyMac_BuildFSRef);
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(FSRef, PyMac_GetFSRef);
"""