From: Alexander Bokovoy Date: Thu, 6 Sep 2018 07:51:00 +0000 (+0000) Subject: wafsamba/samba_autoconf: when setting undefined result, use empty tuple X-Git-Tag: tdb-1.3.17~1671 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95ba6b97441b75f28aef5ec1ee5a9442683f3763;p=thirdparty%2Fsamba.git wafsamba/samba_autoconf: when setting undefined result, use empty tuple A difference between waf 1.x and 2.x is that we gained 0 as an undefined variable in the cache file. This does not allow to differentiate unset and set to 0 defines. Force to use empty tuple () to signify unset defines. Signed-off-by: Alexander Bokovoy Reviewed-by: Andrew Bartlett --- diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 6b940e53c00..6bc34c086f0 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -445,8 +445,12 @@ def CHECK_CODE(conf, code, define, exec_args=exec_args, define_ret=define_ret) except Exception: + # Even when exception happened, conf.check might have set the define + # already to int(ret). We want to undefine it in the case of 'always'. + # Otherwise, we'd get defines set to 0 when they should be undefined + # and it foils #ifdef check if always: - conf.DEFINE(define, 0) + conf.undefine(define) conf.COMPOUND_END(False) if mandatory: raise