[0e355f6] | 1 | # vim:set syntax=python: |
---|
| 2 | |
---|
[eae5898] | 3 | uselib = [] |
---|
[ccc55bd] | 4 | uselib += ['M'] |
---|
[0318cc1] | 5 | uselib += ['FFTW3', 'FFTW3F'] |
---|
| 6 | uselib += ['SAMPLERATE'] |
---|
| 7 | uselib += ['SNDFILE'] |
---|
[ba0ba10] | 8 | uselib += ['AVCODEC'] |
---|
| 9 | uselib += ['AVFORMAT'] |
---|
[cd133ba] | 10 | uselib += ['SWRESAMPLE'] |
---|
[ba0ba10] | 11 | uselib += ['AVRESAMPLE'] |
---|
| 12 | uselib += ['AVUTIL'] |
---|
[f0ce36a1] | 13 | uselib += ['BLAS'] |
---|
[eae5898] | 14 | |
---|
[dc0e759] | 15 | source = ctx.path.ant_glob('*.c **/*.c') |
---|
[ccc55bd] | 16 | |
---|
[985a5d1] | 17 | ctx(features = 'c', |
---|
[dc0e759] | 18 | source = source, |
---|
| 19 | includes = ['.'], |
---|
[ccc55bd] | 20 | use = uselib, |
---|
[dc0e759] | 21 | target = 'lib_objects') |
---|
[afbd7e7] | 22 | |
---|
[985a5d1] | 23 | # build libaubio.so (cshlib) and/or libaubio.a (cstlib) |
---|
[19ddbf3] | 24 | if ctx.env['DEST_OS'] in ['ios', 'iosimulator']: |
---|
[a90e9d4] | 25 | build_features = ['cstlib', 'cshlib'] |
---|
[06dba46] | 26 | elif ctx.env['DEST_OS'] in ['win32', 'win64']: |
---|
[25e2001] | 27 | build_features = ['cstlib', 'cshlib'] |
---|
[fb5838a] | 28 | elif ctx.env['DEST_OS'] in ['emscripten']: |
---|
[8f343e6] | 29 | build_features = ['cstlib','cshlib'] |
---|
[0ec7113] | 30 | elif '--static' in ctx.env['LDFLAGS'] or '--static' in ctx.env['LINKFLAGS']: |
---|
| 31 | # static in cflags, ... |
---|
| 32 | build_features = ['cstlib'] |
---|
| 33 | else: |
---|
| 34 | # linux, darwin, android, mingw, ... |
---|
[3bf80b9] | 35 | build_features = ['cstlib', 'cshlib'] |
---|
[b712146] | 36 | |
---|
[8698499] | 37 | # also install static lib |
---|
| 38 | from waflib.Tools.c import cstlib |
---|
| 39 | from waflib.Tools.fc import fcstlib |
---|
| 40 | fcstlib.inst_to = cstlib.inst_to = '${LIBDIR}' |
---|
| 41 | |
---|
[7fd1831] | 42 | for target in build_features: |
---|
[dc0e759] | 43 | ctx(features = 'c ' + target, |
---|
[ccc55bd] | 44 | use = uselib + ['lib_objects'], |
---|
[dc0e759] | 45 | target = 'aubio', |
---|
| 46 | vnum = ctx.env['LIB_VERSION']) |
---|
[000b090] | 47 | |
---|
| 48 | # install headers, except _priv.h ones |
---|
[0ec7113] | 49 | ctx.install_files('${INCLUDEDIR}/aubio/', |
---|
[dc0e759] | 50 | ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']), |
---|
| 51 | relative_trick=True) |
---|