mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
meson: fix readline detection if there is no pkg-config file
Commit <74416b1d4849ef77ef31de5344dd75f03094434b> added check for rl_completion_quote_character to make sure we have correct readline library. Commit <a9443bc9a9ef451b46306e66ed3b706756fc1414> added inaccurate comment that it's a function. We need to check for generic symbol instead of checking for function. In addition the readline/readline.h file requires stdio.h to by included beforehand which was done in autotools but I dropped it in meson. And lastly the final condition to print error or disable readline was broken as well by replacing the readline_dep every time if readline was not explicitly enabled. Reported-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
f1a298c20d
commit
84bb5fd1ab
16
meson.build
16
meson.build
@ -1268,17 +1268,19 @@ if not readline_dep.found()
|
|||||||
readline_dep = cc.find_library('readline', required: get_option('readline'))
|
readline_dep = cc.find_library('readline', required: get_option('readline'))
|
||||||
|
|
||||||
if readline_dep.found()
|
if readline_dep.found()
|
||||||
# This function is present in all reasonable (5.0+) readline versions;
|
# This variable is present in all reasonable (5.0+) readline versions;
|
||||||
# however, the macOS base system contains a library called libedit which
|
# however, the macOS base system contains a library called libedit which
|
||||||
# takes over the readline name despite lacking many of its features. We
|
# takes over the readline name despite lacking many of its features. We
|
||||||
# want to make sure we only enable readline support when linking against
|
# want to make sure we only enable readline support when linking against
|
||||||
# the actual readline library, and the availability of this specific
|
# the actual readline library, and the availability of this specific
|
||||||
# functions is as good a witness for that fact as any.
|
# variable is as good a witness for that fact as any.
|
||||||
correct_rl = cc.has_function('rl_completion_quote_character', prefix: '#include <readline/readline.h>')
|
correct_rl = cc.has_header_symbol('readline/readline.h', 'rl_completion_quote_character', prefix: '#include <stdio.h>')
|
||||||
if not correct_rl and get_option('readline').enabled()
|
if not correct_rl
|
||||||
error('readline is missing rl_completion_quote_character')
|
if get_option('readline').enabled()
|
||||||
else
|
error('readline is missing rl_completion_quote_character')
|
||||||
readline_dep = dependency('', required: false)
|
else
|
||||||
|
readline_dep = dependency('', required: false)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user