From 207f0439eeecb505f74590af481236ec60c09876 Mon Sep 17 00:00:00 2001 From: Mark Weiman Date: Fri, 16 Apr 2021 23:45:21 -0400 Subject: meson.build: Fix detection of symbols This patch changes the behavior of meson to define configuration options *only* when the symbol checked is present. Currently, it defines all of them in config.h whether the symbol exists or not and the code that looks for it doesn't check the macro's value, but whether it's defined. Signed-off-by: Mark Weiman Signed-off-by: Allan McRae --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 579ff2ed..f76a647b 100644 --- a/meson.build +++ b/meson.build @@ -146,7 +146,9 @@ foreach sym : [ 'tcflush', ] have = cc.has_function(sym, args : '-D_GNU_SOURCE') - conf.set10('HAVE_' + sym.to_upper(), have) + if have + conf.set10('HAVE_' + sym.to_upper(), have) + endif endforeach foreach member : [ -- cgit v1.2.3-54-g00ecf