From 9df6c861233c422b4d24fd017773745781e8815a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 Mar 2010 16:21:28 +1100 Subject: build: honor both --enable-gnutls and --disable-gnutls This shows how we can do the dual-boolean rules we use so much with autoconf --- source4/lib/tls/wscript | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/tls/wscript b/source4/lib/tls/wscript index 4fbbd0deaa..6f517de48d 100644 --- a/source4/lib/tls/wscript +++ b/source4/lib/tls/wscript @@ -1,13 +1,19 @@ import Options +from optparse import SUPPRESS_HELP def set_options(opt): # allow users to disable gnutls - opt.add_option('--disable-gnutls', - help=("Disable use of gnutls"), - action="store_true", dest='disable_gnutls', default=False) + opt.add_option('--enable-gnutls', + help=("Enable use of gnutls"), + action="store_true", dest='enable_gnutls', default=True) + opt.add_option('--disable-gnutls', help=SUPPRESS_HELP, action="store_false", dest='enable_gnutls') + def configure(conf): - # check for gnutls + conf.env.enable_gnutls = Options.options.enable_gnutls + if not conf.env.enable_gnutls: + return + conf.check_cfg(package='gnutls', args='"gnutls >= 1.4.0" --cflags --libs', msg='Checking for gnutls >= 1.4.0', mandatory=False) @@ -38,5 +44,6 @@ def configure(conf): def build(bld): bld.SAMBA_SUBSYSTEM('LIBTLS', source='tls.c tlscert.c', - public_deps='talloc gnutls gcrypt LIBSAMBA-HOSTCONFIG samba_socket' + public_deps='talloc gnutls gcrypt LIBSAMBA-HOSTCONFIG samba_socket', + enabled = bld.env.enable_gnutls ) -- cgit