]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: use explicit values for curses/slang config defines
authorKarel Zak <kzak@redhat.com>
Thu, 19 Mar 2026 12:21:01 +0000 (13:21 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Mar 2026 09:21:15 +0000 (10:21 +0100)
Use 'found() ? 1 : false' instead of bare 'found()' to generate
'#define HAVE_xxx 1' rather than '#define HAVE_xxx', consistent
with autotools.

Signed-off-by: Karel Zak <kzak@redhat.com>
meson.build

index cec3fd79e61e5ad842d687e1c6296f73e74b81df..cfc1fbb88182b5ed21ac6cca2b5f2a66e85ea5cb 100644 (file)
@@ -301,9 +301,9 @@ else
               'term.h']
 endif
 
-conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found())
-conf.set('HAVE_LIBNCURSES', lib_ncurses.found())
-conf.set('HAVE_NCURSES', lib_ncursesw.found() or lib_ncurses.found())
+conf.set('HAVE_LIBNCURSESW', lib_ncursesw.found() ? 1 : false)
+conf.set('HAVE_LIBNCURSES', lib_ncurses.found() ? 1 : false)
+conf.set('HAVE_NCURSES', (lib_ncursesw.found() or lib_ncurses.found()) ? 1 : false)
 
 lib_slang = dependency(
   'slang',
@@ -314,7 +314,7 @@ if lib_slang.found()
               'slcurses.h',
               'slang/slcurses.h']
 endif
-conf.set('HAVE_SLANG', lib_slang.found())
+conf.set('HAVE_SLANG', lib_slang.found() ? 1 : false)
 
 foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses]
   if curses_libs.found()