1 | # vim:set syntax=python: |
---|
2 | |
---|
3 | uselib = [] |
---|
4 | uselib += ['M'] |
---|
5 | uselib += ['FFTW3', 'FFTW3F'] |
---|
6 | uselib += ['INTEL_IPP'] |
---|
7 | uselib += ['SAMPLERATE'] |
---|
8 | uselib += ['SNDFILE'] |
---|
9 | uselib += ['RUBBERBAND'] |
---|
10 | uselib += ['AVCODEC'] |
---|
11 | uselib += ['AVFORMAT'] |
---|
12 | uselib += ['SWRESAMPLE'] |
---|
13 | uselib += ['AVRESAMPLE'] |
---|
14 | uselib += ['AVUTIL'] |
---|
15 | uselib += ['BLAS'] |
---|
16 | |
---|
17 | source = ctx.path.ant_glob('*.c **/*.c') |
---|
18 | |
---|
19 | ctx(features = 'c', |
---|
20 | source = source, |
---|
21 | includes = ['.'], |
---|
22 | use = uselib, |
---|
23 | target = 'lib_objects') |
---|
24 | |
---|
25 | # build libaubio.so (cshlib) and/or libaubio.a (cstlib) |
---|
26 | if ctx.env['DEST_OS'] in ['ios', 'iosimulator']: |
---|
27 | build_features = ['cstlib', 'cshlib'] |
---|
28 | elif ctx.env['DEST_OS'] in ['win32', 'win64']: |
---|
29 | build_features = ['cstlib', 'cshlib gensyms'] |
---|
30 | elif ctx.env['DEST_OS'] in ['emscripten']: |
---|
31 | build_features = ['cstlib','cshlib'] |
---|
32 | elif '--static' in ctx.env['LDFLAGS'] or '--static' in ctx.env['LINKFLAGS']: |
---|
33 | # static in cflags, ... |
---|
34 | build_features = ['cstlib'] |
---|
35 | else: |
---|
36 | # linux, darwin, android, mingw, ... |
---|
37 | build_features = ['cstlib', 'cshlib'] |
---|
38 | |
---|
39 | # also install static lib |
---|
40 | from waflib.Tools.c import cstlib |
---|
41 | cstlib.inst_to = '${LIBDIR}' |
---|
42 | |
---|
43 | for target in build_features: |
---|
44 | ctx(features = 'c ' + target, |
---|
45 | use = uselib + ['lib_objects'], |
---|
46 | target = 'aubio', |
---|
47 | export_symbols_regex=r'(?:.*aubio|fvec|lvec|cvec|fmat|new|del)_.*', |
---|
48 | vnum = ctx.env['LIB_VERSION']) |
---|
49 | |
---|
50 | # install headers, except _priv.h ones |
---|
51 | ctx.install_files('${INCLUDEDIR}/aubio/', |
---|
52 | ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']), |
---|
53 | relative_trick=True) |
---|