summaryrefslogtreecommitdiff
path: root/setup_base.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2012-06-18 14:04:36 +0200
committerArmin Rigo <arigo@tunes.org>2012-06-18 14:04:36 +0200
commitdc7f01255c84865855d3bda4f859868422bc9326 (patch)
tree07defbe3b39812f0481a61837544ef3c78eba4a2 /setup_base.py
parent2082978abb8302e5093022fe37c6801be0e2f1b0 (diff)
downloadcffi-dc7f01255c84865855d3bda4f859868422bc9326.tar.gz
Move things around to avoid duplication of code. I hope "if
__name__=='__main__'" works in setup.py.
Diffstat (limited to 'setup_base.py')
-rw-r--r--setup_base.py21
1 files changed, 1 insertions, 20 deletions
diff --git a/setup_base.py b/setup_base.py
index b51514c..4f6b489 100644
--- a/setup_base.py
+++ b/setup_base.py
@@ -1,26 +1,7 @@
import sys, os
-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'))
+from setup import include_dirs, sources, libraries
if __name__ == '__main__':