build: Do not make python mandatory to build
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Feb 2019 04:45:27 +0000 (17:45 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Mar 2019 04:06:15 +0000 (04:06 +0000)
Clearly we have python or else we would not be running, so this is about if
we have a new enough version.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
buildtools/wafsamba/samba_python.py
wscript

index b29a9d75745268ff9f765dd8d5e854cf330b815b..db9634015ec10753594851e9c36de8d330f819d1 100644 (file)
@@ -6,6 +6,10 @@ from waflib.Configure import conf
 
 @conf
 def SAMBA_CHECK_PYTHON(conf, mandatory=True, version=(2,6,0)):
+
+    if not mandatory:
+        version=(2,6,0)
+
     # enable tool to build python extensions
     if conf.env.HAVE_PYTHON_H:
         conf.check_python_version(version)
diff --git a/wscript b/wscript
index 4a5fc421baa29b0de224aa63f4aa3c03bc752784..ff6dae23330f4c65eeba89258da8e89a7f6f4570 100644 (file)
--- a/wscript
+++ b/wscript
@@ -151,7 +151,8 @@ def configure(conf):
         if not (Options.options.without_ad_dc):
             raise Errors.WafError('--disable-python requires --without-ad-dc')
 
-    conf.SAMBA_CHECK_PYTHON(mandatory=True, version=(2, 6, 0))
+    conf.SAMBA_CHECK_PYTHON(mandatory=not conf.env.disable_python,
+                            version=(2, 6, 0))
     conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=(not conf.env.disable_python))
 
     if sys.platform == 'darwin' and not conf.env['HAVE_ENVIRON_DECL']: