summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-06-02 15:35:38 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-26 13:21:16 +0100
commitb01a4fd3bd7d6f2ebd9eeba9cb6502d423c3bc85 (patch)
tree85c17b533cbb9ce88030a75c10c5496609be3ced /configure
parent931892e8a691a8a4151cc5fe1e13c14294bb28fb (diff)
downloadqemu-b01a4fd3bd7d6f2ebd9eeba9cb6502d423c3bc85.tar.gz
configure: Define NCURSES_WIDECHAR if we're using curses
We want the wide character functions from the ncurses header. Unfortunately it doesn't provide them by default, but only if either: * NCURSES_WIDECHAR is defined (for ncurses 20111030 and up) * _XOPEN_SOURCE/_XOPEN_SOURCE_EXTENDED are suitably defined So far we have been implicitly relying on the latter, because for GNU libc when we define _GNU_SOURCE this causes libc to define the _XOPEN_SOURCE macros for us. Unfortunately this doesn't work on all libcs, because some (like OSX and musl libc) do not define _XOPEN_SOURCE when _GNU_SOURCE is defined. We can't fix this by defining _XOPEN_SOURCE ourselves, because that also means "and don't provide any functions that aren't in that standard", and not all libcs provide any way to override that to also get the non-standard functions. In particular FreeBSD has no such mechanism, and OSX's _DARWIN_C_SOURCE doesn't reenable everything (for instance getpagesize() is still not prototyped if _DARWIN_C_SOURCE and _XOPEN_SOURCE are both defined). So we have to define NCURSES_WIDECHAR. (This will only work if your ncurses is at least 20111030, as older versions don't honour this macro.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Message-id: 1496414138-7622-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure b/configure
index bd0d9dbd7e..c571ad14e5 100755
--- a/configure
+++ b/configure
@@ -3029,6 +3029,8 @@ int main(void) {
EOF
IFS=:
for curses_inc in $curses_inc_list; do
+ # Make sure we get the wide character prototypes
+ curses_inc="-DNCURSES_WIDECHAR $curses_inc"
IFS=:
for curses_lib in $curses_lib_list; do
unset IFS