aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-05-30 17:59:31 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-05-30 17:59:31 +0100
commit58467dd19bc7eacad18448ac41c8bdeacd489a7b (patch)
tree85cc3d4d5e16a8b3bc3517e44f5468e98e9313ce
parent9964e96dc9999cf7f7c936ee854a795415d19b60 (diff)
downloadqemu-arm-58467dd19bc7eacad18448ac41c8bdeacd489a7b.tar.gz
configure: Consistently define _XOPEN_SOURCE=700
The ncurses header file requires _XOPEN_SOURCE to be defined to cause it to provide some wide character functions we use. With glibc this happens automatically, because if _GNU_SOURCE is defined then glibc defines _XOPEN_SOURCE. For other libc implementations (like musl and the OSX libc) this does not happen, and so we need to define _XOPEN_SOURCE ourselves to request these functions. Awkwardly, defining _XOPEN_SOURCE also means "and don't provide any functions that aren't in that standard" unless we also define some libc-specific define to enable those extra functions again: * glibc and musl: _GNU_SOURCE (already set) * Solaris: __EXTENSIONS__ (already set) * OSX: _DARWIN_C_SOURCE * BSDs: ??? Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-xconfigure5
1 files changed, 3 insertions, 2 deletions
diff --git a/configure b/configure
index 1a5ee4b909..75230633e8 100755
--- a/configure
+++ b/configure
@@ -402,6 +402,7 @@ QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
+QEMU_CFLAGS="-D_XOPEN_SOURCE=700 $QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
if test "$debug_info" = "yes"; then
CFLAGS="-g $CFLAGS"
@@ -638,6 +639,8 @@ Darwin)
# Disable attempts to use ObjectiveC features in os/object.h since they
# won't work when we're compiling with gcc as a C compiler.
QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
+ # Provide OSX specific functions (even if _XOPEN_SOURCE is defined):
+ QEMU_CFLAGS="-D_DARWIN_C_SOURCE $QEMU_CFLAGS"
HOST_VARIANT_DIR="darwin"
supported_os="yes"
;;
@@ -668,8 +671,6 @@ SunOS)
audio_drv_list="oss"
fi
audio_possible_drivers="oss sdl"
-# needed for CMSG_ macros in sys/socket.h
- QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
# needed for TIOCWIN* defines in termios.h
QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"