From: Karel Zak Date: Mon, 4 May 2026 12:15:45 +0000 (+0200) Subject: meson: check slang headers only when slang library is found X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=adebde389801d2f7dc810c7c8155cc9855d18ee2;p=thirdparty%2Futil-linux.git meson: check slang headers only when slang library is found The slcurses.h and slang*.h headers were detected unconditionally in the generic header check loop. When the headers existed on the system but slang was not actually used (ncurses preferred), irqtop and cfdisk would include slcurses.h instead of ncurses.h, causing build failures for ncurses-specific functions like vw_printw() and resizeterm(). Move slang header checks after slang library detection, guarded by lib_slang.found(), matching the autotools behavior where these headers are only checked with --with-slang. Signed-off-by: Karel Zak --- diff --git a/meson.build b/meson.build index a3e4abdbf..785a9e94e 100644 --- a/meson.build +++ b/meson.build @@ -176,10 +176,6 @@ headers = ''' ncursesw/term.h ncurses.h term.h - slang.h - slang/slang.h - slcurses.h - slang/slcurses.h '''.split() foreach header : headers @@ -321,6 +317,12 @@ lib_slang = dependency( 'slang', required : get_option('slang')) conf.set('HAVE_SLANG', lib_slang.found() ? 1 : false) +if lib_slang.found() + foreach h : ['slang.h', 'slang/slang.h', 'slcurses.h', 'slang/slcurses.h'] + have = cc.has_header(h) + conf.set('HAVE_' + h.underscorify().to_upper(), have ? 1 : false) + endforeach +endif foreach curses_libs : [lib_slang, lib_ncursesw, lib_ncurses] if curses_libs.found()