From 86ad8e431e437945b8d51ae332557774c836284d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 19 Dec 2013 22:48:08 -0500 Subject: [PATCH] wscript: fix darwin build, move flags to configure, clean up --- wscript | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/wscript b/wscript index 3037090..b3a18a2 100644 --- a/wscript +++ b/wscript @@ -18,15 +18,36 @@ def options(ctx): def configure(ctx): ctx.load('compiler_c') + + if ctx.env['DEST_OS'] == 'linux': + ctx.env.cshlib_PATTERN = '%s.pd_linux' + ctx.env.LINKFLAGS_cshlib += ['--export_dynamic'] + 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.45-3.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.fatal("Sorry, i don't know how to build for %s yet" % ctx.env['DEST_OS']) + # check for puredata header ctx.check(header_name='m_pd.h') - # required dependancies + + # required dependencies ctx.check_cfg(package = 'aubio', atleast_version = '0.4.0', args = '--cflags --libs') def build(bld): - uselib = ['AUBIO'] bld(features = 'c cshlib', source = bld.path.ant_glob('*.c'), uselib = ['AUBIO'], @@ -34,20 +55,6 @@ def build(bld): defines = ['PD', 'PACKAGE_VERSION=\"'+repr(VERSION)+"\""], install_path = '${PREFIX}/lib/pd/extra') - if bld.env['DEST_OS'] == 'win32': - bld.env.cshlib_PATTERN = '%s.dll' - # do not use -fPIC -DPIC on windows - bld.env.cshlib_CCFLAGS.remove('-fPIC') - bld.env.cshlib_CCFLAGS.remove('-DPIC') - bld.env.append_unique('shlib_LINKFLAGS', ['-export_dynamic', '-lpd']) - elif bld.env['DEST_OS'] == 'darwin': - bld.env.cshlib_PATTERN = '%s.pd_darwin' - bld.env.append_unique('shlib_LINKFLAGS', - ['-bundle', '-undefined suppres', '-flat_namespace']) - else: #if bld.env['DEST_OS'] == 'linux': - bld.env.cshlib_PATTERN = '%s.pd_linux' - bld.env.append_unique('shlib_LINKFLAGS', ['--export_dynamic']) - bld.install_files('${PREFIX}/lib/pd/doc/5.reference', bld.path.ant_glob('help/**.pd')) -- 2.11.0