From 83b5c7b86c23f1379d3a96ab4e70c41b032d8823 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 11 Aug 2012 23:42:14 +0000 Subject: Add lv2bench utility. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4660 a436a847-0d15-0410-975c-d299462d15a1 --- wscript | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index cccdb4e..b7183f4 100644 --- a/wscript +++ b/wscript @@ -112,6 +112,14 @@ def configure(conf): define_name='HAVE_FILENO', mandatory=False) + conf.check_cc(function_name='clock_gettime', + header_name=['sys/time.h','time.h'], + defines=['_POSIX_C_SOURCE=199309L'], + define_name='HAVE_CLOCK_GETTIME', + uselib_store='CLOCK_GETTIME', + lib=['rt'], + mandatory=False) + autowaf.define(conf, 'LILV_VERSION', LILV_VERSION) if Options.options.dyn_manifest: autowaf.define(conf, 'LILV_DYN_MANIFEST', 1) @@ -165,6 +173,23 @@ def configure(conf): conf.undefine('LILV_DEFAULT_LV2_PATH') # Cmd line errors with VC++ print('') +def build_util(bld, name, defines): + obj = bld(features = 'c cprogram', + source = name + '.c', + includes = ['.', './src', './utils'], + use = 'liblilv', + target = name, + defines = defines, + install_path = '${BINDIR}') + if not bld.env.BUILD_SHARED or bld.env.STATIC_PROGS: + obj.use = 'liblilv_static' + if bld.env.STATIC_PROGS: + if not bld.env.MSVC_COMPILER: + obj.lib = ['m'] + obj.env.SHLIB_MARKER = obj.env.STLIB_MARKER + obj.linkflags = ['-static', '-Wl,--start-group'] + return obj + def build(bld): # C/C++ Headers includedir = '${INCLUDEDIR}/lilv-%s/lilv' % LILV_MAJOR_VERSION @@ -296,25 +321,18 @@ def build(bld): # Utilities if bld.env.BUILD_UTILS: utils = ''' + utils/lilv-bench utils/lv2info utils/lv2ls - utils/lilv-bench ''' for i in utils.split(): - obj = bld(features = 'c cprogram', - source = i + '.c', - includes = ['.', './src', './utils'], - use = 'liblilv', - target = i, - defines = defines, - install_path = '${BINDIR}') - if not bld.env.BUILD_SHARED or bld.env.STATIC_PROGS: - obj.use = 'liblilv_static' - if bld.env.STATIC_PROGS: - if not bld.env.MSVC_COMPILER: - obj.lib = ['m'] - obj.env.SHLIB_MARKER = obj.env.STLIB_MARKER - obj.linkflags = ['-static', '-Wl,--start-group'] + build_util(bld, i, defines) + + # lv2bench (less portable than other utilities) + if bld.is_defined('HAVE_CLOCK_GETTIME'): + obj = build_util(bld, 'utils/lv2bench', defines) + if not bld.env.MSVC_COMPILER: + obj.lib = ['rt'] # Documentation autowaf.build_dox(bld, 'LILV', LILV_VERSION, top, out) -- cgit v1.2.1