buildtools/wafsamba: undefine a define for a failed test unless asked to keep it
authorAlexander Bokovoy <ab@samba.org>
Fri, 7 Sep 2018 14:34:48 +0000 (14:34 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 10 Sep 2018 17:28:15 +0000 (19:28 +0200)
If conf.CHECK_CODE() is called without `always=True` and the test has
failed, undefine the define already set to '0' by conf.check_code().

This restores expectations that undefined symbols are not considered to
be set by CONFIG_SET() method.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_autoconf.py

index 6b940e5..ced824d 100644 (file)
@@ -447,6 +447,8 @@ def CHECK_CODE(conf, code, define,
     except Exception:
         if always:
             conf.DEFINE(define, 0)
+        else:
+            conf.undefine(define)
         conf.COMPOUND_END(False)
         if mandatory:
             raise