shithub: aubio

ref: 2d071ad1c546923854587280a312f23872905ee2
dir: /src/wscript_build/

View raw version
# vim:set syntax=python:

uselib = []
uselib += ['FFTW3', 'FFTW3F']
uselib += ['SAMPLERATE']
uselib += ['SNDFILE']
uselib += ['AVCODEC']
uselib += ['AVFORMAT']
uselib += ['AVRESAMPLE']
uselib += ['AVUTIL']
uselib += ['BLAS']

# build each source files
source = ctx.path.ant_glob('*.c **/*.c')
lib = 'm' if 'CL.exe' not in ctx.env.CC[0] else None
ctx(features = 'c',
        source = source,
        includes = ['.'],
        uselib = uselib,
        lib = lib,
        target = 'lib_objects')

# build libaubio.so (cshlib) and/or libaubio.a (cstlib)
if ctx.env['DEST_OS'] in ['ios', 'iosimulator']:
    build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['win32', 'win64']:
    build_features = ['cstlib', 'cshlib']
elif ctx.env['DEST_OS'] in ['emscripten']:
    build_features = ['cstlib']
else: #linux, darwin, android, mingw, ...
    build_features = ['cshlib', 'cstlib']

for target in build_features:
    ctx(features = 'c ' + target,
            use = ['lib_objects'],
            uselib = uselib,
            lib = lib,
            target = 'aubio',
            vnum = ctx.env['LIB_VERSION'])

# install headers, except _priv.h ones
ctx.install_files('${PREFIX}/include/aubio/',
        ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']),
        relative_trick=True)