@@ -6,9 +6,10 @@ include config-devices.mak
include $(SRC_PATH)/rules.mak
$(call set-vpath, $(SRC_PATH))
-ifdef CONFIG_LINUX
-QEMU_CFLAGS += -I../linux-headers
+ifndef CONFIG_LINUX
+QEMU_CFLAGS += -I../linux-stubs
endif
+QEMU_CFLAGS += -I../linux-headers
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
QEMU_CFLAGS+=-I$(SRC_PATH)/include
@@ -427,6 +427,7 @@ fi
# OS specific
+QEMU_LINUX_HEADER_INCLUDES="-I\$(SRC_PATH)/linux-stubs -I\$(SRC_PATH)/linux-headers "
case $targetos in
CYGWIN*)
mingw32="yes"
@@ -547,10 +548,14 @@ Haiku)
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
audio_possible_drivers="$audio_possible_drivers fmod"
fi
- QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers $QEMU_INCLUDES"
+ QEMU_LINUX_HEADER_INCLUDES="-I\$(SRC_PATH)/linux-headers "
;;
esac
+#Always pull in linux-headers, we make sure they are
+#cross-platform
+QEMU_INCLUDES="$QEMU_LINUX_HEADER_INCLUDES$QEMU_INCLUDES"
+
if [ "$bsd" = "yes" ] ; then
if [ "$darwin" != "yes" ] ; then
usb="bsd"
Things we pull from linux-headers are actually quite portable. All we need is implement linux/types.h using stdint.h and we are able to compile on any platform. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> --- Makefile.target | 5 +++-- configure | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-)