diff options
-rw-r--r-- | buildtools/wafsamba/samba3.py | 20 | ||||
-rw-r--r-- | source3/wscript | 13 |
2 files changed, 30 insertions, 3 deletions
diff --git a/buildtools/wafsamba/samba3.py b/buildtools/wafsamba/samba3.py new file mode 100644 index 0000000000..ebf2565146 --- /dev/null +++ b/buildtools/wafsamba/samba3.py @@ -0,0 +1,20 @@ +# a waf tool to add autoconf-like macros to the configure section +# and for SAMBA_ macros for building libraries, binaries etc + +import Options +from optparse import SUPPRESS_HELP + +def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True): + if help == (): + help = ("Build with %s support" % option) + if dest is None: + dest = "with_%s" % option + + with_val = "--with-%s" % option + without_val = "--without-%s" % option + + opt.add_option(with_val, help=help, action="store_true", dest=dest, + default=default) + opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false", + dest=dest) +Options.Handler.SAMBA3_ADD_OPTION = SAMBA3_ADD_OPTION diff --git a/source3/wscript b/source3/wscript index 5b582b5f49..bb17c7cccb 100644 --- a/source3/wscript +++ b/source3/wscript @@ -4,10 +4,12 @@ srcdir = '..' blddir = 'bin' import sys, os +from optparse import SUPPRESS_HELP sys.path.insert(0, srcdir+"/buildtools/wafsamba") import wafsamba, Options import build.charset from samba_utils import * +from samba3 import * def set_options(opt): opt.BUILTIN_DEFAULT('NONE') @@ -25,6 +27,10 @@ def set_options(opt): help=("Comma-separated list of names of modules to build shared"), action="store", dest='shared_modules', default='') + opt.SAMBA3_ADD_OPTION('winbind') + opt.SAMBA3_ADD_OPTION('ads') + opt.SAMBA3_ADD_OPTION('cups') + def configure(conf): conf.define('PACKAGE_NAME', 'Samba') @@ -269,13 +275,14 @@ yp_get_default_domain else: conf.DEFINE('static_init_%s' % p, '{}') - #TODO: Actually check for these - conf.DEFINE('WITH_WINBIND', '1') + if Options.options.with_winbind: + conf.DEFINE('WITH_WINBIND', '1') + conf.DEFINE('WITH_ADS', '1') # Look for CUPS conf.find_program('cups-config', var='CUPS_CONFIG') - if conf.env.CUPS_CONFIG: + if conf.env.CUPS_CONFIG and Options.options.with_cups: conf.check_cfg(path="cups-config", args="--cflags --ldflags --libs", package="", uselib_store="cups") conf.CHECK_HEADERS('cups/cups.h cups/language.h', lib='cups') |