wafsamba: Add INSTALL_DIR function
[samba.git] / buildtools / wafsamba / wscript
index fcaaf1b792e50542ec74795d9d17c3e606c6bf86..430d164b60d71318cfe47cdee8b6348f359d55b3 100644 (file)
@@ -196,6 +196,10 @@ def set_options(opt):
                    help='tag release in git at the same time',
                    type='string', action='store', dest='TAG_RELEASE')
 
+    opt.add_option('--disable-python',
+                    help='do not generate python modules',
+                    action='store_true', dest='disable_python', default=False)
+
     opt.add_option('--extra-python', type=str,
                     help=("build selected libraries for the specified "
                           "additional version of Python "
@@ -208,6 +212,8 @@ def configure(conf):
     conf.env.hlist = []
     conf.env.srcdir = conf.srcdir
 
+    conf.define('SRCDIR', conf.env['srcdir'])
+
     if Options.options.timestamp_dependencies:
         conf.ENABLE_TIMESTAMP_DEPENDENCIES()
 
@@ -279,8 +285,14 @@ def configure(conf):
     conf.env.AUTOCONF_HOST  = Options.options.AUTOCONF_HOST
     conf.env.AUTOCONF_PROGRAM_PREFIX = Options.options.AUTOCONF_PROGRAM_PREFIX
 
+    conf.env.disable_python = Options.options.disable_python
+
     conf.env.EXTRA_PYTHON = Options.options.EXTRA_PYTHON
 
+    if (conf.env.disable_python and conf.env.EXTRA_PYTHON):
+        Logs.error('ERROR: cannot specify both --disable-python and --extra-python.')
+        sys.exit(1)
+
     if (conf.env.AUTOCONF_HOST and
         conf.env.AUTOCONF_BUILD and
         conf.env.AUTOCONF_BUILD != conf.env.AUTOCONF_HOST):