diff options
author | David Robillard <d@drobilla.net> | 2011-01-08 19:11:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-08 19:11:13 +0000 |
commit | 9a1cd7003886f89e2228d74d61130dc5d24c06a3 (patch) | |
tree | 133972adfb7802750f62d9db69639cd2c18459ba /wscript | |
parent | c92301fc4cd5620fe8193e2e6648ea86c580784d (diff) | |
download | patchage-9a1cd7003886f89e2228d74d61130dc5d24c06a3.tar.gz patchage-9a1cd7003886f89e2228d74d61130dc5d24c06a3.tar.bz2 patchage-9a1cd7003886f89e2228d74d61130dc5d24c06a3.zip |
Support via waf for running from the build directory.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2799 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -32,6 +32,8 @@ def options(opt): help="Do not build Lash support") opt.add_option('--no-alsa', action='store_true', default=False, dest='no_alsa', help="Do not build Alsa Sequencer support") + opt.add_option('--no-binloc', action='store_true', default=False, dest='no_binloc', + help="Do not try to read files from executable's parent directory") def configure(conf): autowaf.configure(conf) @@ -53,6 +55,13 @@ def configure(conf): autowaf.check_pkg(conf, 'raul', uselib_store='RAUL', atleast_version='0.5.1', mandatory=True) + # Check for dladdr + conf.check(function_name='dladdr', + header_name='dlfcn.h', + cflags='-D_GNU_SOURCE', + linkflags='-ldl', + define_name='HAVE_DLADDR') + # Use Jack D-Bus if requested (only one jack driver is allowed) conf.env['HAVE_JACK_DBUS'] = conf.env['HAVE_DBUS'] == 1 and conf.env['HAVE_DBUS_GLIB'] == 1 and Options.options.jack_dbus @@ -73,6 +82,10 @@ def configure(conf): if not Options.options.no_lash and conf.env['HAVE_DBUS_GLIB']: autowaf.define(conf, 'HAVE_LASH', 1) + # Find files at binary location if we have dladdr unless --no-binloc + if not Options.options.no_binloc and conf.env['HAVE_DLADDR']: + autowaf.define(conf, 'PATCHAGE_BINLOC', 1) + # Boost headers autowaf.check_header(conf, 'boost/shared_ptr.hpp', mandatory=True) autowaf.check_header(conf, 'boost/weak_ptr.hpp', mandatory=True) @@ -131,13 +144,15 @@ def build(bld): if bld.env['HAVE_ALSA'] == 1: prog.source += ' src/AlsaDriver.cpp ' prog.uselib += ' ALSA ' + if bld.env['PATCHAGE_BINLOC']: + prog.linkflags = '-ldl' # Glade XML UI definition bld(features = 'subst', source = 'src/patchage.glade', target = 'patchage.glade', install_path = '${DATADIR}/' + bld.env['APP_INSTALL_NAME'], - chmod = 0755, + chmod = 0644, PATCHAGE_VERSION = PATCHAGE_VERSION) # 'Desktop' file (menu entry, icon, etc) @@ -145,7 +160,7 @@ def build(bld): source = 'patchage.desktop.in', target = 'patchage.desktop', install_path = '${DATADIR}/applications', - chmod = 0755, + chmod = 0644, BINDIR = os.path.normpath(bld.env['BINDIR']), APP_INSTALL_NAME = bld.env['APP_INSTALL_NAME'], APP_HUMAN_NAME = bld.env['APP_HUMAN_NAME']) |