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