From 09acd7ad1bee9a948c7219a9e56502f3e023c3ba Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Aug 2012 18:20:32 +0000 Subject: Support building Suil as a static library. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4622 a436a847-0d15-0410-975c-d299462d15a1 --- wscript | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 7873a00..aeee8b3 100644 --- a/wscript +++ b/wscript @@ -29,6 +29,8 @@ def options(opt): opt.load('compiler_c') opt.load('compiler_cxx') autowaf.set_options(opt) + opt.add_option('--static', action='store_true', default=False, dest='static', + help="Build static library") opt.add_option('--gtk2-lib-name', type='string', dest='gtk2_lib_name', default="libgtk-x11-2.0.so", help="Gtk2 library name [Default: libgtk-x11-2.0.so]") @@ -41,6 +43,8 @@ def configure(conf): autowaf.display_header('Suil Configuration') conf.env['NODELETE_FLAGS'] = [] + conf.env['BUILD_STATIC'] = Options.options.static + if conf.env['MSVC_COMPILER']: conf.env.append_unique('CFLAGS', ['-TP', '-MD']) else: @@ -110,7 +114,7 @@ def build(bld): module_dir = '${LIBDIR}/suil-' + SUIL_MAJOR_VERSION - # Library + # Shared Library obj = bld(features = 'c cshlib', export_includes = ['.'], source = 'src/host.c src/instance.c', @@ -124,6 +128,21 @@ def build(bld): lib = lib, uselib = 'LV2') + # Static library + if bld.env['BUILD_STATIC']: + obj = bld(features = 'c cstlib', + export_includes = ['.'], + source = 'src/host.c src/instance.c', + target = 'suil-%s' % SUIL_MAJOR_VERSION, + includes = ['.'], + defines = ['SUIL_INTERNAL'], + name = 'libsuil_static', + vnum = SUIL_LIB_VERSION, + install_path = '${LIBDIR}', + cflags = cflags, + lib = lib, + uselib = 'LV2') + if bld.is_defined('HAVE_GTK2') and bld.is_defined('HAVE_QT4'): obj = bld(features = 'cxx cxxshlib', source = 'src/gtk2_in_qt4.cpp', -- cgit v1.2.1