mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 13:06:22 +00:00
build: only check for ncurses{w}
In out autotools build we check for all kinds of curses and their support for wide character. Let's focus on more modern systems until someone complains.
This commit is contained in:
63
meson.build
63
meson.build
@@ -94,52 +94,29 @@ if cc.links('''
|
|||||||
conf_data.set('HAVE_XMPP_CERT_PUBKEY_FINGERPRINT_SHA256', 1)
|
conf_data.set('HAVE_XMPP_CERT_PUBKEY_FINGERPRINT_SHA256', 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Curses/ncurses library
|
# ncurses
|
||||||
ncursesw_dep = dependency('ncursesw', required: false)
|
curses_dep = disabler()
|
||||||
ncurses_dep = dependency('ncurses', required: false)
|
foreach lib : ['ncursesw', 'ncurses']
|
||||||
|
d = dependency(lib, required: false)
|
||||||
if ncursesw_dep.found()
|
if not d.found()
|
||||||
curses_dep = ncursesw_dep
|
d = cc.find_library(lib, required: false)
|
||||||
curses_name = 'ncursesw'
|
|
||||||
elif ncurses_dep.found()
|
|
||||||
curses_dep = ncurses_dep
|
|
||||||
curses_name = 'ncurses'
|
|
||||||
else
|
|
||||||
curses_dep = cc.find_library('ncursesw', required: false)
|
|
||||||
if curses_dep.found()
|
|
||||||
curses_name = 'ncursesw'
|
|
||||||
else
|
|
||||||
curses_dep = cc.find_library('ncurses', required: false)
|
|
||||||
if curses_dep.found()
|
|
||||||
curses_name = 'ncurses'
|
|
||||||
else
|
|
||||||
curses_dep = cc.find_library('curses', required: true)
|
|
||||||
curses_name = 'curses'
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if d.found()
|
||||||
|
curses_dep = d
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
if not curses_dep.found()
|
||||||
|
error('ncursesw/ncurses library not found')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Check for wide character support
|
# Check for ncursesw/ncurses.h, Arch linux uses ncurses.h for ncursesw
|
||||||
if not cc.links('''
|
foreach h : ['ncursesw/ncurses.h', 'ncurses.h']
|
||||||
void wget_wch(void);
|
if cc.has_header(h)
|
||||||
int main() {
|
conf_data.set('HAVE_@0@'.format(h.underscorify().to_upper()), 1)
|
||||||
wget_wch();
|
endif
|
||||||
return 0;
|
endforeach
|
||||||
}
|
|
||||||
''', dependencies: curses_dep)
|
|
||||||
error('ncurses does not support wide characters')
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Check for ncurses headers
|
|
||||||
if cc.has_header('ncursesw/ncurses.h')
|
|
||||||
conf_data.set('HAVE_NCURSESW_NCURSES_H', 1)
|
|
||||||
endif
|
|
||||||
if cc.has_header('ncurses.h')
|
|
||||||
conf_data.set('HAVE_NCURSES_H', 1)
|
|
||||||
endif
|
|
||||||
if cc.has_header('curses.h')
|
|
||||||
conf_data.set('HAVE_CURSES_H', 1)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Readline:
|
# Readline:
|
||||||
# we need to declare the variable before
|
# we need to declare the variable before
|
||||||
|
|||||||
Reference in New Issue
Block a user