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