pidl/wscript: configure should insist on Parse::Yapp::Driver
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 2 Feb 2020 03:05:38 +0000 (16:05 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 2 Feb 2020 10:09:11 +0000 (10:09 +0000)
following 83ffe6752d589180eac96d7b8e7d1a54e3476bfd, you get a build
error if you lack a system perl Parse::Yapp. Let's make it a configure
failure instead.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Feb  2 10:09:11 UTC 2020 on sn-devel-184

pidl/wscript

index d1b8278990a2d7f94941accb9dd8e46322d27fa7..88cb9132fd63a5982996dbc4cd5eb5f64ec81a53 100644 (file)
@@ -2,7 +2,7 @@
 
 import os, string
 from samba_utils import MODE_755
-from waflib import Logs
+from waflib import Logs, Errors
 
 # This function checks if a perl module is installed on the system.
 def check_system_perl_module(conf, module, version=None):
@@ -30,10 +30,14 @@ def options(opt):
 
 def configure(conf):
     # Check if perl(Parse::Yapp::Driver) is available.
-    check_system_perl_module(conf, "Parse::Yapp::Driver", 1.05)
+    if not check_system_perl_module(conf,
+                                    "Parse::Yapp::Driver",
+                                    1.05):
+        raise Errors.WafError('perl module "Parse::Yapp::Driver" not found')
 
     # yapp is used for building the parser
-    conf.find_program('yapp', var='YAPP')
+    if not conf.find_program('yapp', var='YAPP'):
+        raise Errors.WafError('yapp not found')
 
 def build(bld):