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 += ['VORBISENC'] |
---|
16 | uselib += ['FLAC'] |
---|
17 | uselib += ['BLAS'] |
---|
18 | |
---|
19 | source = ctx.path.ant_glob('*.c **/*.c') |
---|
20 | |
---|
21 | ctx(features = 'c', |
---|
22 | source = source, |
---|
23 | includes = ['.'], |
---|
24 | use = uselib, |
---|
25 | target = 'lib_objects') |
---|
26 | |
---|
27 | # build libaubio.so (cshlib) and/or libaubio.a (cstlib) |
---|
28 | if ctx.env['DEST_OS'] in ['ios', 'iosimulator']: |
---|
29 | build_features = ['cstlib', 'cshlib'] |
---|
30 | elif ctx.env['DEST_OS'] in ['win32', 'win64']: |
---|
31 | build_features = ['cstlib', 'cshlib gensyms'] |
---|
32 | elif ctx.env['DEST_OS'] in ['emscripten']: |
---|
33 | build_features = ['cstlib','cshlib'] |
---|
34 | elif '--static' in ctx.env['LDFLAGS'] or '--static' in ctx.env['LINKFLAGS']: |
---|
35 | # static in cflags, ... |
---|
36 | build_features = ['cstlib'] |
---|
37 | else: |
---|
38 | # linux, darwin, android, mingw, ... |
---|
39 | build_features = ['cstlib', 'cshlib'] |
---|
40 | |
---|
41 | # also install static lib |
---|
42 | from waflib.Tools.c import cstlib |
---|
43 | cstlib.inst_to = '${LIBDIR}' |
---|
44 | |
---|
45 | for target in build_features: |
---|
46 | ctx(features = 'c ' + target, |
---|
47 | use = uselib + ['lib_objects'], |
---|
48 | target = 'aubio', |
---|
49 | export_symbols_regex=r'(?:.*aubio|fvec|lvec|cvec|fmat|new|del)_.*', |
---|
50 | vnum = ctx.env['LIB_VERSION']) |
---|
51 | |
---|
52 | # install headers, except _priv.h ones |
---|
53 | ctx.install_files('${INCLUDEDIR}/aubio/', |
---|
54 | ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']), |
---|
55 | relative_trick=True) |
---|