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