[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/22] meson: cleanup curses/iconv test
From: |
Paolo Bonzini |
Subject: |
[PULL 13/22] meson: cleanup curses/iconv test |
Date: |
Fri, 16 Oct 2020 07:48:05 -0400 |
Skip the test if it is system emulation is not requested, and
differentiate errors for lack of iconv and lack of curses.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 85 ++++++++++++++++++++++++++++-------------------------
1 file changed, 45 insertions(+), 40 deletions(-)
diff --git a/meson.build b/meson.build
index c1c45e9845..15732f4701 100644
--- a/meson.build
+++ b/meson.build
@@ -455,40 +455,40 @@ if targetos == 'linux' and have_tools and not
get_option('mpath').disabled()
endif
iconv = not_found
-if not get_option('iconv').disabled()
- libiconv = cc.find_library('iconv',
- required: false,
- static: enable_static)
- if cc.links('''
- #include <iconv.h>
- int main(void) {
- iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
- return conv != (iconv_t) -1;
- }''', dependencies: [libiconv])
- iconv = declare_dependency(dependencies: [libiconv])
- endif
-endif
-if get_option('iconv').enabled() and not iconv.found()
- error('Cannot detect iconv API')
-endif
-
curses = not_found
-if iconv.found() and not get_option('curses').disabled()
- curses_libname_list = ['ncursesw', 'ncurses', 'cursesw', 'pdcurses']
- curses_test = '''
- #include <locale.h>
- #include <curses.h>
- #include <wchar.h>
- int main(void) {
- wchar_t wch = L'w';
- setlocale(LC_ALL, "");
- resize_term(0, 0);
- addwstr(L"wide chars\n");
- addnwstr(&wch, 1);
- add_wch(WACS_DEGREE);
- return 0;
- }'''
- foreach curses_libname : curses_libname_list
+if have_system and not get_option('curses').disabled()
+ if not get_option('iconv').disabled()
+ libiconv = cc.find_library('iconv',
+ required: false,
+ static: enable_static)
+ if cc.links('''
+ #include <iconv.h>
+ int main(void) {
+ iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
+ return conv != (iconv_t) -1;
+ }''', dependencies: [libiconv])
+ iconv = declare_dependency(dependencies: [libiconv])
+ endif
+ endif
+ if get_option('iconv').enabled() and not iconv.found()
+ error('Cannot detect iconv API')
+ endif
+ if iconv.found()
+ curses_libname_list = ['ncursesw', 'ncurses', 'cursesw', 'pdcurses']
+ curses_test = '''
+ #include <locale.h>
+ #include <curses.h>
+ #include <wchar.h>
+ int main(void) {
+ wchar_t wch = L'w';
+ setlocale(LC_ALL, "");
+ resize_term(0, 0);
+ addwstr(L"wide chars\n");
+ addnwstr(&wch, 1);
+ add_wch(WACS_DEGREE);
+ return 0;
+ }'''
+ foreach curses_libname : curses_libname_list
libcurses = dependency(curses_libname,
required: false,
method: 'pkg-config',
@@ -510,13 +510,18 @@ if iconv.found() and not get_option('curses').disabled()
break
endif
endif
- endforeach
-endif
-if get_option('curses').enabled() and not curses.found()
- if not iconv.found()
- error('Cannot detect iconv API')
- else
- error('Cannot detect curses API')
+ endforeach
+ endif
+ if not curses.found()
+ if iconv.found()
+ if get_option('curses').enabled()
+ error('Cannot find curses')
+ endif
+ elif get_option('curses').enabled()
+ error('iconv required for curses UI but not available')
+ else
+ warning('iconv required for curses UI but not available, disabling')
+ endif
endif
endif
--
2.26.2
- [PULL 01/22] submodules: bump meson to 0.55.3, (continued)
- [PULL 01/22] submodules: bump meson to 0.55.3, Paolo Bonzini, 2020/10/16
- [PULL 02/22] Makefile: Ensure cscope.out/tags/TAGS are generated in the source tree, Paolo Bonzini, 2020/10/16
- [PULL 03/22] tests/Makefile.include: unbreak non-tcg builds, Paolo Bonzini, 2020/10/16
- [PULL 06/22] configure: move QEMU_INCLUDES to meson, Paolo Bonzini, 2020/10/16
- [PULL 05/22] tests: add missing generated sources to testqapi, Paolo Bonzini, 2020/10/16
- [PULL 08/22] add ninja to dockerfiles, CI configurations and test VMs, Paolo Bonzini, 2020/10/16
- [PULL 11/22] build: add --enable/--disable-libudev, Paolo Bonzini, 2020/10/16
- [PULL 04/22] make: run shell with pipefail, Paolo Bonzini, 2020/10/16
- [PULL 14/22] configure: fix handling of --docdir parameter, Paolo Bonzini, 2020/10/16
- [PULL 07/22] dockerfiles: enable Centos 8 PowerTools, Paolo Bonzini, 2020/10/16
- [PULL 13/22] meson: cleanup curses/iconv test,
Paolo Bonzini <=
- [PULL 12/22] meson.build: don't condition iconv detection on library detection, Paolo Bonzini, 2020/10/16
- [PULL 09/22] build: cleanups to Makefile, Paolo Bonzini, 2020/10/16
- [PULL 15/22] meson: Only install icons and qemu.desktop if have_system, Paolo Bonzini, 2020/10/16
- [PULL 16/22] docs: Fix Sphinx configuration for msys2/mingw, Paolo Bonzini, 2020/10/16
- [PULL 18/22] meson: Move the detection logic for sphinx to meson, Paolo Bonzini, 2020/10/16
- [PULL 10/22] build: replace ninjatool with ninja, Paolo Bonzini, 2020/10/16
- [PULL 20/22] fuzz: Disable QEMU's SIG{INT,HUP,TERM} handlers, Paolo Bonzini, 2020/10/16
- [PULL 21/22] hax: unbreak accelerator cpu code after cpus.c split, Paolo Bonzini, 2020/10/16