3 # build puredata external
10 for l in open('VERSION').readlines(): exec (l.strip())
11 VERSION = '.'.join ([str(x) for x in [
12 PD_AUBIO_MAJOR_VERSION,
13 PD_AUBIO_MINOR_VERSION,
14 ]]) + PD_AUBIO_VERSION_STATUS
17 ctx.load('compiler_c')
20 ctx.load('compiler_c')
21 # check for puredata header
22 ctx.check(header_name='m_pd.h')
23 # required dependancies
24 ctx.check_cfg(package = 'aubio', atleast_version = '0.4.0',
25 args = '--cflags --libs')
30 bld(features = 'c cshlib',
31 source = bld.path.ant_glob('*.c'),
34 defines = ['PD', 'PACKAGE_VERSION=\"'+repr(VERSION)+"\""],
35 install_path = '${PREFIX}/lib/pd/extra')
37 if bld.env['DEST_OS'] == 'win32':
38 bld.env.cshlib_PATTERN = '%s.dll'
39 # do not use -fPIC -DPIC on windows
40 bld.env.cshlib_CCFLAGS.remove('-fPIC')
41 bld.env.cshlib_CCFLAGS.remove('-DPIC')
42 bld.env.append_unique('shlib_LINKFLAGS', ['-export_dynamic', '-lpd'])
43 elif bld.env['DEST_OS'] == 'darwin':
44 bld.env.cshlib_PATTERN = '%s.pd_darwin'
45 bld.env.append_unique('shlib_LINKFLAGS',
46 ['-bundle', '-undefined suppres', '-flat_namespace'])
47 else: #if bld.env['DEST_OS'] == 'linux':
48 bld.env.cshlib_PATTERN = '%s.pd_linux'
49 bld.env.append_unique('shlib_LINKFLAGS', ['--export_dynamic'])
51 # do not rename the shlib at all
52 bld.env.shlib_PATTERN = '%s'
54 bld.install_files('${PREFIX}/lib/pd/doc/5.reference',
55 bld.path.ant_glob('help/**.pd'))
57 bld.install_files('${PREFIX}/lib/pd/doc/aubio',
58 bld.path.ant_glob('examples/**.pd'))