[pacman-dev] [PATCH 2/5] meson.build: Fix detection of symbols

Mark Weiman mark.weiman at markzz.com
Sat Apr 17 03:45:21 UTC 2021


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 <mark.weiman at markzz.com>
---
 meson.build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 483c4fbd..14b3381a 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 : [
-- 
2.31.1


More information about the pacman-dev mailing list