Showing the changes to python/setup.py (1 of 8 files). Show all
Unified · Split
| @@ -1,22 +1,37 @@ | ||
| 1 | 1 | #! /usr/bin/python |
| 2 | 2 | |
| 3 | 3 | from distutils.core import setup, Extension |
| 4 | −from generator import generate_object_files | |
| 5 | 4 | import sys |
| 6 | 5 | import os.path |
| 7 | 6 | import numpy |
| 8 | 7 | |
| 9 | 8 | # read from VERSION |
| 10 | −for l in open(os.path.join('..','VERSION')).readlines(): exec (l.strip()) | |
| 9 | +for l in open('VERSION').readlines(): exec (l.strip()) | |
| 11 | 10 | __version__ = '.'.join \ |
| 12 | 11 | ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \ |
| 13 | 12 | + AUBIO_VERSION_STATUS |
| 14 | 13 | |
| 15 | −library_dirs = ['../build/src', '../src/.libs'] | |
| 16 | −include_dirs = ['../build/src', '../src', '.' ] | |
| 14 | +library_dirs = ['../build/src'] | |
| 15 | +include_dirs = ['../src'] # aubio.h | |
| 16 | +include_dirs += ['../build/src'] # config.h | |
| 17 | +include_dirs += ['ext'] | |
| 18 | +include_dirs += ['gen'] | |
| 19 | +#include_dirs += ['../build/src', '../src', '.' ] | |
| 20 | + | |
| 17 | 21 | library_dirs = filter (lambda x: os.path.isdir(x), library_dirs) |
| 18 | 22 | include_dirs = filter (lambda x: os.path.isdir(x), include_dirs) |
| 19 | 23 | |
| 24 | +generated_object_files = [] | |
| 25 | + | |
| 26 | +output_path = 'gen' | |
| 27 | + | |
| 28 | +if not os.path.isdir(output_path): | |
| 29 | + from generator import generate_object_files | |
| 30 | + generated_object_files = generate_object_files(output_path) | |
| 31 | +else: | |
| 32 | + import glob | |
| 33 | + generated_object_files = glob.glob(os.path.join(output_path, '*.c')) | |
| 34 | + | |
| 20 | 35 | aubio_extension = Extension("aubio._aubio", [ |
| 21 | 36 | "ext/aubiomodule.c", |
| 22 | 37 | "ext/aubioproxy.c", |
| @@ -29,7 +44,7 @@ aubio_extension = Extension("aubio._aubio", [ · 6 unmodified lines | ||
| 29 | 44 | "ext/py-fft.c", |
| 30 | 45 | "ext/py-phasevoc.c", |
| 31 | 46 | # generated files |
| 32 | − ] + generate_object_files(), | |
| 47 | + ] + generated_object_files, | |
| 33 | 48 | include_dirs = include_dirs + [ numpy.get_include() ], |
| 34 | 49 | library_dirs = library_dirs, |
| 35 | 50 | libraries=['aubio']) |