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 <kzak@redhat.com>
ncursesw/term.h
ncurses.h
term.h
- slang.h
- slang/slang.h
- slcurses.h
- slang/slcurses.h
'''.split()
foreach header : headers
'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()