[PyObjC-svn] r2221 - in trunk/pyobjc/pyobjc-framework-CFNetwork: . Modules

[email protected] Thu, 14 May 2009 08:28:30 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Thu May 14 08:28:29 2009
New Revision: 2221

Log:
Make it possible to compile using python.org installation

Modified:
   trunk/pyobjc/pyobjc-framework-CFNetwork/Modules/pyobjc-api.h
   trunk/pyobjc/pyobjc-framework-CFNetwork/setup.py

Modified: trunk/pyobjc/pyobjc-framework-CFNetwork/Modules/pyobjc-api.h
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CFNetwork/Modules/pyobjc-api.h	(original)
+++ trunk/pyobjc/pyobjc-framework-CFNetwork/Modules/pyobjc-api.h	Thu May 14 08:28:29 2009
@@ -19,6 +19,41 @@
 #include "Python.h"
 #include <objc/objc.h>
 
+#import <Foundation/NSObjCRuntime.h>
+
+#ifndef CGFLOAT_DEFINED
+
+#ifdef __LP64__
+# error "Huh? 64-bit but no CFFloat available???"
+#endif
+
+typedef float CGFloat;
+#define CGFLOAT_MIN FLT_MIN
+#define CGFLOAT_MAX FLT_MAX
+#define CGFLOAT_IS_DOUBLE 0
+#define CGFLOAT_DEFINED
+
+#endif /* CGFLOAT_DEFINED */
+
+
+#ifndef NSINTEGER_DEFINED
+
+#ifdef __LP64__
+# error "Huh? 64-bit but no NSINTEGER available???"
+#endif
+
+typedef int NSInteger;
+typedef unsigned int NSUInteger;
+
+#define NSIntegerMax    LONG_MAX
+#define NSIntegerMin    LONG_MIN
+#define NSUIntegerMax   ULONG_MAX
+
+#define NSINTEGER_DEFINED
+
+#endif
+
+
 #ifndef PyObjC_COMPAT_H
 #if (PY_VERSION_HEX < 0x02050000)
 typedef int Py_ssize_t;

Modified: trunk/pyobjc/pyobjc-framework-CFNetwork/setup.py
==============================================================================
--- trunk/pyobjc/pyobjc-framework-CFNetwork/setup.py	(original)
+++ trunk/pyobjc/pyobjc-framework-CFNetwork/setup.py	Thu May 14 08:28:29 2009
@@ -22,6 +22,12 @@
     extra_cmdclass = {}
     extra_options = lambda name: {}
 
+import os
+if os.uname()[2] >= '8.':
+    CFLAGS=["-isysroot", "/"]
+else:
+    CFLAGS=[]
+
 setup(
     name='pyobjc-framework-CFNetwork',
     version='2.2b2',
@@ -44,6 +50,7 @@
         Extension("CFNetwork._manual",
             ["Modules/_manual.m"],
             extra_link_args=['-framework', 'CoreServices'],
+            extra_compile_args=CFLAGS,
         ),
     ],
     test_suite='PyObjCTest',

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com