aboutsummaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-11 07:02:34 +0000
committerDavid Robillard <d@drobilla.net>2011-03-11 07:02:34 +0000
commitd810e069029ea3aa52c5d3fed02dc607f4e6b743 (patch)
tree64d7e6571e6d80a88fec1aab41037e1109f87340 /wscript
parentfd11b8580005889b10552d70e94b5e6c5a27db19 (diff)
downloadmda.lv2-d810e069029ea3aa52c5d3fed02dc607f4e6b743.tar.gz
mda.lv2-d810e069029ea3aa52c5d3fed02dc607f4e6b743.tar.bz2
mda.lv2-d810e069029ea3aa52c5d3fed02dc607f4e6b743.zip
Waf build system.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/mdala.lv2@3073 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r--wscript115
1 files changed, 115 insertions, 0 deletions
diff --git a/wscript b/wscript
new file mode 100644
index 0000000..5532455
--- /dev/null
+++ b/wscript
@@ -0,0 +1,115 @@
+#!/usr/bin/env python
+import autowaf
+import os
+
+# Version of this package (even if built as a child)
+MDALA_VERSION = '0.0.0'
+
+# Variables for 'waf dist'
+APPNAME = 'mdala.lv2'
+VERSION = MDALA_VERSION
+
+# Mandatory variables
+top = '.'
+out = 'build'
+
+def options(opt):
+ autowaf.set_options(opt)
+ opt.tool_options('compiler_cxx')
+
+def configure(conf):
+ autowaf.configure(conf)
+ autowaf.display_header('Mdala Configuration')
+ conf.check_tool('compiler_cxx')
+
+ autowaf.check_header(conf, 'lv2/lv2plug.in/ns/lv2core/lv2.h')
+
+ conf.env.append_value('CFLAGS', '-std=c99')
+
+ # Set env['pluginlib_PATTERN']
+ pat = conf.env['cshlib_PATTERN']
+ if pat[0:3] == 'lib':
+ pat = pat[3:]
+ conf.env['pluginlib_PATTERN'] = pat
+
+ print('')
+
+def build_plugin(bld, lang, bundle, name, source, cflags=[], libs=[]):
+ # Build plugin library
+ penv = bld.env.copy()
+ penv['cshlib_PATTERN'] = bld.env['pluginlib_PATTERN']
+ penv['cxxshlib_PATTERN'] = bld.env['pluginlib_PATTERN']
+ obj = bld(features = '%s %sshlib' % (lang,lang))
+ obj.env = penv
+ obj.source = source + ['lvz/wrapper.cpp']
+ obj.includes = [ '.', './lvz', './src' ]
+ obj.name = name
+ obj.target = os.path.join(bundle, name)
+ if cflags != []:
+ obj.cxxflags = cflags
+ if libs != []:
+ autowaf.use_lib(bld, obj, libs)
+ obj.install_path = '${LV2DIR}/' + bundle
+
+ # Install data file
+ data_file = '%s.ttl' % name
+ bld.install_files('${LV2DIR}/' + bundle, os.path.join(bundle, data_file))
+
+def build(bld):
+ # Copy data files to build bundle (build/mdala.lv2)
+ for i in bld.path.ant_glob('mdala.lv2/*.ttl'):
+ bld(rule = 'cp ${SRC} ${TGT}',
+ source = i,
+ target = bld.path.get_bld().make_node('mdala.lv2/%s' % i),
+ install_path = '${LV2DIR}/mdala.lv2')
+
+ plugins = '''
+ Ambience
+ Bandisto
+ BeatBox
+ Combo
+ DX10
+ DeEss
+ Degrade
+ Delay
+ Detune
+ Dither
+ DubDelay
+ Dynamics
+ EPiano
+ Image
+ JX10
+ Leslie
+ Limiter
+ Loudness
+ MultiBand
+ Overdrive
+ Piano
+ RePsycho
+ RezFilter
+ RingMod
+ RoundPan
+ Shepard
+ Splitter
+ Stereo
+ SubSynth
+ TalkBox
+ TestTone
+ ThruZero
+ Tracker
+ Transient
+ VocInput
+ Vocoder
+ '''.split()
+# Looplex
+
+ # Build plugin libraries
+ for i in plugins:
+ build_plugin(bld, 'cxx', 'mdala.lv2', i, ['src/mda%s.cpp' % i],
+ ['-DPLUGIN_CLASS=mda%s' % i,
+ '-DURI_PREFIX=\"http://drobilla.net/plugins/mdala/\"',
+ '-DPLUGIN_URI_SUFFIX="%s"' % i,
+ '-DPLUGIN_HEADER="src/mda%s.h"' % i])
+
+ bld.install_files('${LV2DIR}/mdala.lv2', 'mdala.lv2/manifest.ttl')
+