summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-04-11 09:35:08 +0200
committerKai Blin <kai@samba.org>2010-05-20 22:16:13 +0200
commit3d1c0f1a2152b456be112ce992d281e0234f1a96 (patch)
tree1f91ad2d72ff49c63c93f319cef6cbb5c3addce4 /buildtools
parentadfd1db476cb1c399d5146b47f432199c585666c (diff)
downloadsamba-3d1c0f1a2152b456be112ce992d281e0234f1a96.tar.gz
samba-3d1c0f1a2152b456be112ce992d281e0234f1a96.tar.bz2
samba-3d1c0f1a2152b456be112ce992d281e0234f1a96.zip
s3-waf: Add helper that facilitates defining --with-x and --without-x options
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba3.py20
1 files changed, 20 insertions, 0 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