aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStacey Son <sson@FreeBSD.org>2014-06-08 09:57:22 -0700
committerPeter Maydell <peter.maydell@linaro.org>2014-06-11 00:25:06 +0100
commitadfc3e91e2e2293ae667f606d3449b855940fe41 (patch)
tree1b1c0f6d83b9464eaac0def4812891d5e2644036
parent7224f66ec3c5a51bdfa96a6686efba917b289fc7 (diff)
bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code
This change adds HOST_VARIANT_DIR so the various BSD OS dependent code can be separated into its own directories rather than using #ifdef's. This may also allow an BSD variant OS to host another BSD variant's executable as a target. Signed-off-by: Sean Bruno <sbruno@freebsd.org> Message-id: 1402246651-71099-2-git-send-email-sbruno@freebsd.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--Makefile.target3
-rwxr-xr-xconfigure11
2 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.target b/Makefile.target
index 8155496eaa..422328314a 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -102,7 +102,8 @@ endif #CONFIG_LINUX_USER
ifdef CONFIG_BSD_USER
-QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR)
+QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \
+ -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR)
obj-y += bsd-user/
obj-y += gdbstub.o user-exec.o
diff --git a/configure b/configure
index a994f4196f..baffaaa6dc 100755
--- a/configure
+++ b/configure
@@ -541,6 +541,9 @@ fi
# OS specific
+# host *BSD for user mode
+HOST_VARIANT_DIR=""
+
case $targetos in
CYGWIN*)
mingw32="yes"
@@ -566,12 +569,14 @@ FreeBSD)
# needed for kinfo_getvmmap(3) in libutil.h
LIBS="-lutil $LIBS"
netmap="" # enable netmap autodetect
+ HOST_VARIANT_DIR="freebsd"
;;
DragonFly)
bsd="yes"
make="${MAKE-gmake}"
audio_drv_list="oss"
audio_possible_drivers="oss sdl esd pa"
+ HOST_VARIANT_DIR="dragonfly"
;;
NetBSD)
bsd="yes"
@@ -579,12 +584,14 @@ NetBSD)
audio_drv_list="oss"
audio_possible_drivers="oss sdl esd"
oss_lib="-lossaudio"
+ HOST_VARIANT_DIR="netbsd"
;;
OpenBSD)
bsd="yes"
make="${MAKE-gmake}"
audio_drv_list="sdl"
audio_possible_drivers="sdl esd"
+ HOST_VARIANT_DIR="openbsd"
;;
Darwin)
bsd="yes"
@@ -602,6 +609,7 @@ 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"
+ HOST_VARIANT_DIR="darwin"
;;
SunOS)
solaris="yes"
@@ -4981,6 +4989,9 @@ if [ "$TARGET_ABI_DIR" = "" ]; then
TARGET_ABI_DIR=$TARGET_ARCH
fi
echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
+if [ "$HOST_VARIANT_DIR" != "" ]; then
+ echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak
+fi
case "$target_name" in
i386|x86_64)
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then