diff options
author | David Robillard <d@drobilla.net> | 2011-02-12 09:11:17 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-12 09:11:17 +0000 |
commit | 7dd771da2752cb3d012575869d905ba1f77697bf (patch) | |
tree | 825a750f4fb153fcf37303f8c79a73e7ce0c8e02 /wscript | |
parent | 79f72150ed0b552962fbe4377208f2dea4db2cf1 (diff) | |
download | lilv-7dd771da2752cb3d012575869d905ba1f77697bf.tar.gz lilv-7dd771da2752cb3d012575869d905ba1f77697bf.tar.bz2 lilv-7dd771da2752cb3d012575869d905ba1f77697bf.zip |
Add C++ and Python bindings.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2940 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -1,5 +1,6 @@ #!/usr/bin/env python import autowaf +import os import sys import Options @@ -60,6 +61,14 @@ def configure(conf): autowaf.configure(conf) autowaf.display_header('SLV2 Configuration') conf.check_tool('compiler_cc') + + try: + conf.load('swig python') + conf.check_python_headers() + autowaf.define(conf, 'SLV2_SWIG', 1); + except: + pass + autowaf.check_pkg(conf, 'lv2core', uselib_store='LV2CORE', mandatory=True) autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.0.0', mandatory=True) @@ -126,9 +135,10 @@ def configure(conf): autowaf.display_msg(conf, "Utilities", str(conf.env['BUILD_UTILS'] == 1)) autowaf.display_msg(conf, "Jack clients", str(conf.env['USE_JACK'] == 1)) autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS'])) - autowaf.display_msg(conf, "Dynamic Manifest Support", str(conf.env['SLV2_DYN_MANIFEST'] == 1)) + autowaf.display_msg(conf, "Dynamic manifest support", str(conf.env['SLV2_DYN_MANIFEST'] == 1)) autowaf.display_msg(conf, "Default LV2_PATH", str(conf.env['SLV2_DEFAULT_LV2_PATH'])) autowaf.display_msg(conf, "UI support", str(conf.env['SLV2_WITH_UI'] == 1)) + autowaf.display_msg(conf, "Python bindings", str(conf.env['SLV2_SWIG'] == 1)) print @@ -229,9 +239,23 @@ def build(bld): bld.install_as( '/etc/bash_completion.d/slv2', 'utils/slv2.bash_completion') + if bld.env['SLV2_SWIG']: + # Python Wrapper + bld( + features = 'cxx cxxshlib pyext', + source = 'swig/slv2.i', + target = 'swig/_slv2', + swig_flags = '-c++ -python -Wall -I.. -lslv2 -features autodoc=1', + vnum = SLV2_LIB_VERSION, + use = 'libslv2') + bld.add_post_fun(autowaf.run_ldconfig) def test(ctx): autowaf.pre_test(ctx, APPNAME) autowaf.run_tests(ctx, APPNAME, tests.split(), dirs=['./src','./test']) autowaf.post_test(ctx, APPNAME) + +def wrap(ctx): + os.chdir(out) + os.system('swig -DPYTHON -Wall -python -I/usr/include -I/usr/local/include -I.. -o slv2_python.c -oh slv2_python.h ../swig/slv2.i') |