[pypy-commit] cffi default: Copy-pasted :-(

arigo noreply at buildbot.pypy.org
Mon Jun 18 14:02:30 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r453:3c10fb4fc3c5
Date: 2012-06-18 14:02 +0200
http://bitbucket.org/cffi/cffi/changeset/3c10fb4fc3c5/

Log:	Copy-pasted :-(

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,26 @@
 from setuptools import setup, Feature, Extension
 
 
-from setup_base import sources, libraries, include_dirs
+sources = ['c/_ffi_backend.c']
+libraries = ['ffi']
+include_dirs = []
+
+
+if sys.platform == 'win32':
+    COMPILE_LIBFFI = 'c/libffi_msvc'    # from the CPython distribution
+else:
+    COMPILE_LIBFFI = None
+
+if COMPILE_LIBFFI:
+    assert os.path.isdir(COMPILE_LIBFFI), (
+        "On Windows, you need to copy the directory "
+        "Modules\\_ctypes\\libffi_msvc from the CPython sources (2.6 or 2.7) "
+        "into the top-level directory.")
+    include_dirs.append(COMPILE_LIBFFI)
+    libraries.remove('ffi')
+    sources.extend(os.path.join(COMPILE_LIBFFI, filename)
+                   for filename in os.listdir(COMPILE_LIBFFI)
+                   if filename.lower().endswith('.c'))
 
 
 


More information about the pypy-commit mailing list