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/Nav.c b/Mac/Modules/Nav.c
index 773664d..3e2d9d6 100644
--- a/Mac/Modules/Nav.c
+++ b/Mac/Modules/Nav.c
@@ -184,18 +184,22 @@
 		} else if( strcmp(keystr, "preferenceKey") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, &opt->preferenceKey) )
 				return 0;
+#ifndef __LP64__
 		} else if( strcmp(keystr, "popupExtension") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", ResObj_Convert, &opt->popupExtension) )
 				return 0;
+#endif /* !__LP64__ */
 		} else if( eventProcP && strcmp(keystr, "eventProc") == 0 ) {
 			*eventProcP = my_eventProcUPP;
 		} else if( previewProcP && strcmp(keystr, "previewProc") == 0 ) {
 			*previewProcP = my_previewProcUPP;
 		} else if( filterProcP && strcmp(keystr, "filterProc") == 0 ) {
 			*filterProcP = my_filterProcUPP;
+#ifndef __LP64__
 		} else if( typeListP && strcmp(keystr, "typeList") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", ResObj_Convert, typeListP) )
 				return 0;
+#endif /* !__LP64__ */
 		} else if( fileTypeP && strcmp(keystr, "fileType") == 0 ) {
 			if ( !PyArg_Parse(value, "O&", PyMac_GetOSType, fileTypeP) )
 				return 0;
@@ -301,13 +305,26 @@
 static PyObject *
 navrr_getattr(navrrobject *self, char *name)
 {
-	FSSpec fss;
 	FSRef fsr;
+#ifndef __LP64__
+	FSSpec fss;
+#endif /* !__LP64__ */
 	
 	if( strcmp(name, "__members__") == 0 )
-		return Py_BuildValue("ssssssssss", "version", "validRecord", "replacing",
-			"isStationery", "translationNeeded", "selection", "selection_fsr",
+		return Py_BuildValue(
+#ifndef __LP64__
+				"ssssssssss", 
+#else /* __LP64__ */
+				"ssssssssss", 
+#endif /* __LP64__ */
+				"version", "validRecord", "replacing",
+			"isStationery", "translationNeeded", 
+#ifndef __LP64__
+			"selection", 
+#endif /* !__LP64__ */
+			"selection_fsr",
 			"fileTranslation", "keyScript", "saveFileName");
+
 	if( strcmp(name, "version") == 0 )
 		return Py_BuildValue("h", self->itself.version);
 	if( strcmp(name, "validRecord") == 0 )
@@ -318,8 +335,10 @@
 		return Py_BuildValue("l", (long)self->itself.isStationery);
 	if( strcmp(name, "translationNeeded") == 0 )
 		return Py_BuildValue("l", (long)self->itself.translationNeeded);
+#ifndef __LP64__
 	if( strcmp(name, "selection") == 0 ) {
-		SInt32 i, count;
+		SInt32 i;
+		long count;
 		OSErr err;
 		PyObject *rv, *rvitem;
 		AEDesc desc;
@@ -348,8 +367,10 @@
 		}
 		return rv;
 	}
+#endif /* !__LP64__ */
 	if( strcmp(name, "selection_fsr") == 0 ) {
-		SInt32 i, count;
+		SInt32 i;
+		long count;
 		OSErr err;
 		PyObject *rv, *rvitem;
 		AEDesc desc;
@@ -378,8 +399,10 @@
 		}
 		return rv;
 	}
+#ifndef __LP64__
 	if( strcmp(name, "fileTranslation") == 0 )
 		return ResObj_New((Handle)self->itself.fileTranslation);
+#endif
 	if( strcmp(name, "keyScript") == 0 )
 		return Py_BuildValue("h", (short)self->itself.keyScript);
 	if( strcmp(name, "saveFileName") == 0 )
@@ -861,7 +884,12 @@
 		PyErr_Mac(ErrorObject, err);
 		return NULL;
 	}
-	return Py_BuildValue("{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
+	return Py_BuildValue(
+#ifndef __LP64__
+			"{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
+#else /* __LP64__ */
+			"{s:h,s:l,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&,s:O&}",
+#endif /* __LP64__ */
 		"version", dialogOptions.version,
 		"dialogOptionFlags", dialogOptions.dialogOptionFlags,
 		"location", PyMac_BuildPoint, dialogOptions.location,
@@ -871,8 +899,11 @@
 		"cancelButtonLabel", PyMac_BuildStr255, &dialogOptions.cancelButtonLabel,
 		"savedFileName", PyMac_BuildStr255, &dialogOptions.savedFileName,
 		"message", PyMac_BuildStr255, &dialogOptions.message,
-		"preferenceKey", PyMac_BuildOSType, dialogOptions.preferenceKey,
-		"popupExtension", OptResObj_New, dialogOptions.popupExtension);
+		"preferenceKey", PyMac_BuildOSType, dialogOptions.preferenceKey
+#ifndef __LP64__
+		,"popupExtension", OptResObj_New, dialogOptions.popupExtension
+#endif /* __LP64__ */
+		);
 }
 
 /* List of methods defined in the module */