VERSION: added, bumping from 0.2 to 0.3~alpha
[pd-aubio.git] / wscript
1 #! /usr/bin/python
2
3 # build puredata external
4
5 top = '.'
6 out = 'build'
7 VERSION = '0.2'
8
9 def options(ctx):
10     ctx.load('compiler_c')
11
12 def configure(conf):
13     conf.load('compiler_c')
14     # required dependancies
15     conf.check_cfg(package = 'aubio', atleast_version = '0.4.0',
16             args = '--cflags --libs')
17     # check for puredata header
18     conf.check(header_name='m_pd.h')
19
20 def build(bld):
21     aubio_pd = bld.new_task_gen(
22         features = 'cc cshlib',
23         uselib = ['AUBIO'],
24         defines = ['PD', 'PACKAGE_VERSION=\"'+repr(VERSION)+"\""],
25         install_path = '${PREFIX}/lib/pd/extra')
26
27     if bld.env['DEST_OS'] == 'win32':
28         aubio_pd.target = 'aubio.dll'
29         # do not use -fPIC -DPIC on windows
30         aubio_pd.env.shlib_CCFLAGS.remove('-fPIC')
31         aubio_pd.env.shlib_CCFLAGS.remove('-DPIC')
32         aubio_pd.env.append_unique('shlib_LINKFLAGS', ['-export_dynamic', '-lpd'])
33     elif bld.env['DEST_OS'] == 'darwin':
34         aubio_pd.target = 'aubio.pd_darwin'
35         aubio_pd.env.append_unique('shlib_LINKFLAGS', 
36             ['-bundle', '-undefined suppres', '-flat_namespace'])
37     else: #if bld.env['DEST_OS'] == 'linux':
38         aubio_pd.target = 'aubio.pd_linux'
39         aubio_pd.env.append_unique('shlib_LINKFLAGS', ['--export_dynamic'])
40
41     # do not rename the shlib at all
42     aubio_pd.env.shlib_PATTERN = '%s'
43     # get the source files
44     aubio_pd.find_sources_in_dirs('.')
45
46     bld.install_files('${PREFIX}/lib/pd/doc/5.reference', 'help/*.pd')
47
48     bld.install_files('${PREFIX}/lib/pd/doc/aubio', 'examples/*.pd')