smbprinting: fix wrong == in shell tests
[Samba/gebeck_regimport.git] / buildtools / wafsamba / samba3.py
blob5008abb9492f4dbe81a0562a5be9166e4aa81323
1 # a waf tool to add autoconf-like macros to the configure section
2 # and for SAMBA_ macros for building libraries, binaries etc
4 import Options
5 import Build
6 from optparse import SUPPRESS_HELP
8 def SAMBA3_ADD_OPTION(opt, option, help=(), dest=None, default=True,
9 with_name="with", without_name="without"):
10 if help == ():
11 help = ("Build with %s support" % option)
12 if dest is None:
13 dest = "with_%s" % option.replace('-', '_')
15 with_val = "--%s-%s" % (with_name, option)
16 without_val = "--%s-%s" % (without_name, option)
18 #FIXME: This is broken and will always default to "default" no matter if
19 # --with or --without is chosen.
20 opt.add_option(with_val, help=help, action="store_true", dest=dest,
21 default=default)
22 opt.add_option(without_val, help=SUPPRESS_HELP, action="store_false",
23 dest=dest)
24 Options.Handler.SAMBA3_ADD_OPTION = SAMBA3_ADD_OPTION
26 def SAMBA3_IS_STATIC_MODULE(bld, module):
27 '''Check whether module is in static list'''
28 if module in bld.env['static_modules']:
29 return True
30 return False
31 Build.BuildContext.SAMBA3_IS_STATIC_MODULE = SAMBA3_IS_STATIC_MODULE
33 def SAMBA3_IS_SHARED_MODULE(bld, module):
34 '''Check whether module is in shared list'''
35 if module in bld.env['shared_modules']:
36 return True
37 return False
38 Build.BuildContext.SAMBA3_IS_SHARED_MODULE = SAMBA3_IS_SHARED_MODULE
40 def SAMBA3_IS_ENABLED_MODULE(bld, module):
41 '''Check whether module is in either shared or static list '''
42 return SAMBA3_IS_STATIC_MODULE(bld, module) or SAMBA3_IS_SHARED_MODULE(bld, module)
43 Build.BuildContext.SAMBA3_IS_ENABLED_MODULE = SAMBA3_IS_ENABLED_MODULE