Showing the changes to python (2 of 2 files). Show all
Unified · Split
| @@ -22,7 +22,11 @@ · 21 unmodified lines | |||
| 22 | //#include <numpy/npy_3kcompat.h> | 22 | //#include <numpy/npy_3kcompat.h> |
| 23 | 23 | ||
| 24 | #define AUBIO_UNSTABLE 1 | 24 | #define AUBIO_UNSTABLE 1 |
| 25 | #ifdef LOCAL_AUBIO | ||
| 25 | #include "aubio.h" | 26 | #include "aubio.h" |
| 27 | #else | ||
| 28 | #include "aubio/aubio.h" | ||
| 29 | #endif | ||
| 26 | 30 | ||
| 27 | #define Py_default_vector_length 1024 | 31 | #define Py_default_vector_length 1024 |
| 28 | 32 | ||
| @@ -11,26 +11,30 @@ __version__ = '.'.join \ · 10 unmodified lines | |||
| 11 | ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \ | 11 | ([str(x) for x in [AUBIO_MAJOR_VERSION, AUBIO_MINOR_VERSION, AUBIO_PATCH_VERSION]]) \ |
| 12 | + AUBIO_VERSION_STATUS | 12 | + AUBIO_VERSION_STATUS |
| 13 | 13 | ||
| 14 | library_dirs = ['../build/src'] | 14 | include_dirs = [] |
| 15 | include_dirs = ['../src'] # aubio.h | 15 | library_dirs = [] |
| 16 | include_dirs += ['../build/src'] # config.h | 16 | define_macros = [] |
| 17 | include_dirs += ['ext'] | ||
| 18 | include_dirs += ['gen'] | ||
| 19 | #include_dirs += ['../build/src', '../src', '.' ] | ||
| 20 | |||
| 21 | library_dirs = filter (lambda x: os.path.isdir(x), library_dirs) | ||
| 22 | include_dirs = filter (lambda x: os.path.isdir(x), include_dirs) | ||
| 23 | 17 | ||
| 24 | generated_object_files = [] | 18 | include_dirs += ['ext'] |
| 19 | include_dirs += [ numpy.get_include() ] | ||
| 25 | 20 | ||
| 26 | output_path = 'gen' | 21 | output_path = 'gen' |
| 22 | generated_object_files = [] | ||
| 27 | 23 | ||
| 28 | if not os.path.isdir(output_path): | 24 | if not os.path.isdir(output_path): |
| 29 | from generator import generate_object_files | 25 | from generator import generate_object_files |
| 30 | generated_object_files = generate_object_files(output_path) | 26 | generated_object_files = generate_object_files(output_path) |
| 27 | # define include dirs | ||
| 31 | else: | 28 | else: |
| 32 | import glob | 29 | import glob |
| 33 | generated_object_files = glob.glob(os.path.join(output_path, '*.c')) | 30 | generated_object_files = glob.glob(os.path.join(output_path, '*.c')) |
| 31 | include_dirs += [output_path] | ||
| 32 | |||
| 33 | if os.path.isfile('../src/aubio.h'): | ||
| 34 | define_macros += [('USE_LOCAL_AUBIO', 1)] | ||
| 35 | include_dirs += ['../src'] # aubio.h | ||
| 36 | include_dirs += ['../build/src'] # config.h | ||
| 37 | library_dirs += ['../build/src'] | ||
| 34 | 38 | ||
| 35 | aubio_extension = Extension("aubio._aubio", [ | 39 | aubio_extension = Extension("aubio._aubio", [ |
| 36 | "ext/aubiomodule.c", | 40 | "ext/aubiomodule.c", |
| @@ -45,8 +49,9 @@ aubio_extension = Extension("aubio._aubio", [ · 8 unmodified lines | |||
| 45 | "ext/py-phasevoc.c", | 49 | "ext/py-phasevoc.c", |
| 46 | # generated files | 50 | # generated files |
| 47 | ] + generated_object_files, | 51 | ] + generated_object_files, |
| 48 | include_dirs = include_dirs + [ numpy.get_include() ], | 52 | include_dirs = include_dirs, |
| 49 | library_dirs = library_dirs, | 53 | library_dirs = library_dirs, |
| 54 | define_macros = define_macros, | ||
| 50 | libraries=['aubio']) | 55 | libraries=['aubio']) |
| 51 | 56 | ||
| 52 | if sys.platform.startswith('darwin'): | 57 | if sys.platform.startswith('darwin'): |