From f52e4020653a3848efef47424e21481ed18d3935 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 29 Mar 2019 18:20:52 +0100 Subject: [PATCH] s3:wscript: fix flex and bison detection message when not installed If flex or bison are not installed, conf.env['BISON'] and conf.env['FLEX'] respectively return an empty string, so conf.CHECK_COMMAND() runs $ /bin/sh -c " --version | head -n1" and $ /bin/sh -c " --version" which results in the following message /bin/sh: []: command not found Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- source3/wscript | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/source3/wscript b/source3/wscript index dcd2a303063..6f50f5bc552 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1652,18 +1652,20 @@ main() { Logs.info("Checking for bison") bison.configure(conf) - conf.CHECK_COMMAND('%s --version | head -n1' % conf.env['BISON'], - msg='Using bison version', - define=None, - on_target=False) + if conf.env['BISON']: + conf.CHECK_COMMAND('%s --version | head -n1' % conf.env.BISON, + msg='Using bison version', + define=None, + on_target=False) Logs.info("Checking for flex") conf.find_program('flex', var='FLEX') - conf.env.FLEXFLAGS = ['-t'] - conf.CHECK_COMMAND('%s --version' % conf.env['FLEX'], - msg='Using flex version', - define=None, - on_target=False) + if conf.env['FLEX']: + conf.env.FLEXFLAGS = ['-t'] + conf.CHECK_COMMAND('%s --version' % conf.env.FLEX, + msg='Using flex version', + define=None, + on_target=False) conf.env.with_spotlight = False if Options.options.with_spotlight: -- 2.47.3