From 18c9076c989f9ed51601e250c0ad117c74bfafa7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Aug 2012 21:48:56 +0000 Subject: Add --no-shared option to avoid building shared libraries. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4626 a436a847-0d15-0410-975c-d299462d15a1 --- wscript | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/wscript b/wscript index bc4d863..6dc7ff0 100644 --- a/wscript +++ b/wscript @@ -31,6 +31,8 @@ def options(opt): autowaf.set_options(opt) opt.add_option('--static', action='store_true', dest='static', help="Build static library") + opt.add_option('--no-shared', action='store_true', dest='no_shared', + help='Do not build shared 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]") @@ -43,9 +45,11 @@ def configure(conf): autowaf.set_c99_mode(conf) autowaf.display_header('Suil Configuration') - conf.env.NODELETE_FLAGS = [] - conf.env.BUILD_STATIC = Options.options.static + conf.env.BUILD_SHARED = not Options.options.no_shared + conf.env.BUILD_STATIC = (Options.options.static or + Options.options.static_progs) + conf.env.NODELETE_FLAGS = [] if (not conf.env.MSVC_COMPILER and conf.check(linkflags = ['-Wl,-z,nodelete'], msg = 'Checking for link flags -Wl,-z,-nodelete', @@ -113,18 +117,19 @@ def build(bld): module_dir = '${LIBDIR}/suil-' + SUIL_MAJOR_VERSION # Shared Library - obj = bld(features = 'c cshlib', - export_includes = ['.'], - source = 'src/host.c src/instance.c', - target = 'suil-%s' % SUIL_MAJOR_VERSION, - includes = ['.'], - defines = ['SUIL_SHARED', 'SUIL_INTERNAL'], - name = 'libsuil', - vnum = SUIL_LIB_VERSION, - install_path = '${LIBDIR}', - cflags = cflags, - lib = lib, - uselib = 'LV2') + if bld.env.BUILD_SHARED: + obj = bld(features = 'c cshlib', + export_includes = ['.'], + source = 'src/host.c src/instance.c', + target = 'suil-%s' % SUIL_MAJOR_VERSION, + includes = ['.'], + defines = ['SUIL_SHARED', 'SUIL_INTERNAL'], + name = 'libsuil', + vnum = SUIL_LIB_VERSION, + install_path = '${LIBDIR}', + cflags = cflags, + lib = lib, + uselib = 'LV2') # Static library if bld.env.BUILD_STATIC: -- cgit v1.2.1