summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-29 01:23:22 +0000
committerDavid Robillard <d@drobilla.net>2011-09-29 01:23:22 +0000
commit8de5b8a7768b2c733c358824b12b4050aee84273 (patch)
tree4cc5da4e04fd7e860fb86e3a942a17afae0781f0 /wscript
parent9fe0099b416b78b6b883b8a2422842f44d954f1d (diff)
downloadlilv-8de5b8a7768b2c733c358824b12b4050aee84273.tar.gz
lilv-8de5b8a7768b2c733c358824b12b4050aee84273.tar.bz2
lilv-8de5b8a7768b2c733c358824b12b4050aee84273.zip
Add ability to build static library.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3508 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'wscript')
-rw-r--r--wscript37
1 files changed, 27 insertions, 10 deletions
diff --git a/wscript b/wscript
index 56de5e1..669645e 100644
--- a/wscript
+++ b/wscript
@@ -46,6 +46,8 @@ def options(opt):
opt.add_option('--default-lv2-path', type='string', default='',
dest='default_lv2_path',
help="Default LV2 path to use if $LV2_PATH is unset (globs and ~ supported)")
+ opt.add_option('--static', action='store_true', default=False, dest='static',
+ help="Build static library")
def configure(conf):
conf.load('compiler_c')
@@ -114,6 +116,7 @@ def configure(conf):
conf.env['BUILD_TESTS'] = Options.options.build_tests
conf.env['BUILD_UTILS'] = not Options.options.no_utils
+ conf.env['BUILD_STATIC'] = Options.options.static
conf.env['BASH_COMPLETION'] = not Options.options.no_bash_completion
conf.env['LIB_LILV'] = ['lilv-%s' % LILV_MAJOR_VERSION]
@@ -163,7 +166,7 @@ def build(bld):
linkflags = []
libflags = []
- # Library
+ # Shared Library
obj = bld(features = 'c cshlib',
export_includes = ['.'],
source = lib_source,
@@ -172,34 +175,48 @@ def build(bld):
target = 'lilv-%s' % LILV_MAJOR_VERSION,
vnum = LILV_LIB_VERSION,
install_path = '${LIBDIR}',
- cflags = libflags + [
- '-DLILV_SHARED',
- '-DLILV_INTERNAL' ],
+ cflags = libflags + [ '-DLILV_SHARED',
+ '-DLILV_INTERNAL' ],
linkflags = linkflags)
autowaf.use_lib(bld, obj, 'SORD LV2CORE')
+ # Static library
+ if bld.env['BUILD_STATIC']:
+ obj = bld(features = 'c cstlib',
+ export_includes = ['.'],
+ source = lib_source,
+ includes = ['.', './src'],
+ name = 'liblilv_static',
+ target = 'lilv-%s' % LILV_MAJOR_VERSION,
+ vnum = LILV_LIB_VERSION,
+ install_path = '${LIBDIR}',
+ cflags = [ '-DLILV_INTERNAL' ])
+ autowaf.use_lib(bld, obj, 'SORD LV2CORE')
+
if bld.env['BUILD_TESTS']:
- # Static library (for unit test code coverage)
+ # Static profiled library (for unit test code coverage)
obj = bld(features = 'c cstlib',
source = lib_source,
includes = ['.', './src'],
- name = 'liblilv_static',
- target = 'lilv_static',
+ name = 'liblilv_profiled',
+ target = 'lilv_profiled',
install_path = '',
- cflags = [ '-fprofile-arcs', '-ftest-coverage', '-DLILV_INTERNAL' ],
- linkflags = linkflags)
+ cflags = [ '-fprofile-arcs', '-ftest-coverage',
+ '-DLILV_INTERNAL' ],
+ linkflags = linkflags + ['-lgcov'])
autowaf.use_lib(bld, obj, 'SORD LV2CORE')
# Unit test program
obj = bld(features = 'c cprogram',
source = 'test/lilv_test.c',
includes = ['.', './src'],
- use = 'liblilv_static',
+ use = 'liblilv_profiled',
uselib = 'SORD LV2CORE',
linkflags = linkflags + ['-lgcov'],
target = 'test/lilv_test',
install_path = '',
cflags = [ '-fprofile-arcs', '-ftest-coverage' ])
+ autowaf.use_lib(bld, obj, 'SORD LV2CORE')
# Utilities
if bld.env['BUILD_UTILS']: