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')
22 if ctx.env['DEST_OS'] == 'linux':
23 ctx.env.cshlib_PATTERN = '%s.pd_linux'
24 elif ctx.env['DEST_OS'] == 'darwin':
25 ctx.env.cshlib_PATTERN = '%s.pd_darwin'
26 # add default include path for both pd and pd-extended
27 # set CFLAGS for custom location
28 ctx.env.CFLAGS += ['-I/Applications/Pd-0.45-3.app/Contents/Resources/src']
29 ctx.env.CFLAGS += ['-I/Applications/Pd-extended.app/Contents/Resources/include']
30 ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
31 ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
32 ctx.env.LINKFLAGS_cshlib = ['-bundle', '-undefined', 'suppress', '-flat_namespace']
33 elif ctx.env['DEST_OS'] in ['win32', 'win64']:
34 ctx.env.cshlib_PATTERN = '%s.dll'
35 # do not use -fPIC -DPIC on windows
36 ctx.env.CFLAGS_cshlib = []
37 ctx.env.LINKFLAGS_cshlib += ['-export_dynamic', '-lpd']
39 ctx.start_msg("Checking for platform")
40 ctx.end_msg("no idea how to build for %s yet, assuming linux"
41 % ctx.env['DEST_OS'], 'YELLOW')
42 ctx.env.cshlib_PATTERN = '%s.pd_linux'
43 ctx.env.LINKFLAGS_cshlib += ['--export_dynamic']
45 # check for puredata header
46 ctx.check(header_name='m_pd.h')
48 # required dependencies
49 ctx.check_cfg(package = 'aubio', atleast_version = '0.4.0',
50 args = '--cflags --libs')
54 bld(features = 'c cshlib',
55 source = bld.path.ant_glob('src/*.c'),
58 defines = ['PD', 'PACKAGE_VERSION=\"'+repr(VERSION)+"\""],
59 install_path = '${PREFIX}/lib/pd/extra/aubio')
61 bld.install_files('${PREFIX}/lib/pd/extra/aubio',
62 bld.path.ant_glob('help/**.pd'))
64 bld.install_files('${PREFIX}/lib/pd/extra/aubio/examples',
65 bld.path.ant_glob('examples/**.pd'))