-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwscript
65 lines (53 loc) · 2.21 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#! /usr/bin/python
# build puredata external
top = '.'
out = 'build'
APPNAME = 'pd-aubio'
# source VERSION
for l in open('VERSION').readlines(): exec (l.strip())
VERSION = '.'.join ([str(x) for x in [
PD_AUBIO_MAJOR_VERSION,
PD_AUBIO_MINOR_VERSION,
]]) + PD_AUBIO_VERSION_STATUS
def options(ctx):
ctx.load('compiler_c')
def configure(ctx):
ctx.load('compiler_c')
if ctx.env['DEST_OS'] == 'linux':
ctx.env.cshlib_PATTERN = '%s.pd_linux'
elif ctx.env['DEST_OS'] == 'darwin':
ctx.env.cshlib_PATTERN = '%s.pd_darwin'
# add default include path for both pd and pd-extended
# set CFLAGS for custom location
ctx.env.CFLAGS += ['-I/Applications/Pd-0.47-1.app/Contents/Resources/src']
ctx.env.CFLAGS += ['-I/Applications/Pd-extended.app/Contents/Resources/include']
ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
ctx.env.LINKFLAGS_cshlib = ['-bundle', '-undefined', 'suppress', '-flat_namespace']
elif ctx.env['DEST_OS'] in ['win32', 'win64']:
ctx.env.cshlib_PATTERN = '%s.dll'
# do not use -fPIC -DPIC on windows
ctx.env.CFLAGS_cshlib = []
ctx.env.LINKFLAGS_cshlib += ['-export_dynamic', '-lpd']
else:
ctx.start_msg("Checking for platform")
ctx.end_msg("no idea how to build for %s yet, assuming linux"
% ctx.env['DEST_OS'], 'YELLOW')
ctx.env.cshlib_PATTERN = '%s.pd_linux'
ctx.env.LINKFLAGS_cshlib += ['--export_dynamic']
# check for puredata header
ctx.check(header_name='m_pd.h')
# required dependencies
ctx.check_cfg(package = 'aubio', atleast_version = '0.4.0',
args = '--cflags --libs')
def build(bld):
bld(features = 'c cshlib',
source = bld.path.ant_glob('src/*.c'),
uselib = ['AUBIO'],
target = 'aubio',
defines = ['PD', 'PACKAGE_VERSION=\"'+repr(VERSION)+"\""],
install_path = '${PREFIX}/lib/pd/extra/aubio')
bld.install_files('${PREFIX}/lib/pd/extra/aubio',
bld.path.ant_glob('help/**.pd'))
bld.install_files('${PREFIX}/lib/pd/extra/aubio/examples',
bld.path.ant_glob('examples/**.pd'))