qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sean Bruno <sbruno@freebsd.org>
To: qemu-devel@nongnu.org
Cc: Sean Bruno <sbruno@freebsd.org>
Subject: [Qemu-devel] [PATCH 01/10 v4] bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code
Date: Sun,  8 Jun 2014 09:57:22 -0700	[thread overview]
Message-ID: <1402246651-71099-2-git-send-email-sbruno@freebsd.org> (raw)
In-Reply-To: <1402246651-71099-1-git-send-email-sbruno@freebsd.org>

From: Stacey Son <sson@FreeBSD.org>

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>
---
 Makefile.target |  3 ++-
 configure       | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/Makefile.target b/Makefile.target
index 9986047..60c1ca6 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 0e516f9..3db9726 100755
--- a/configure
+++ b/configure
@@ -537,6 +537,9 @@ fi
 
 # OS specific
 
+# host *BSD for user mode
+HOST_VARIANT_DIR=""
+
 case $targetos in
 CYGWIN*)
   mingw32="yes"
@@ -562,12 +565,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"
@@ -575,12 +580,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"
@@ -598,6 +605,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"
@@ -4982,6 +4990,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
-- 
1.9.3

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

  reply	other threads:[~2014-06-08 16:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-08 16:57 [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros Sean Bruno
2014-06-08 16:57 ` Sean Bruno [this message]
2014-06-08 16:57 ` [Qemu-devel] [PATCH 02/10 v4] bsd-user: GPL v2 attribution update and style Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 03/10 v4] bsd-user: Implement strace support for print_sysctl syscall Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 04/10 v4] bsd-user: Implement strace support for print_ioctl syscall Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 05/10 v4] bsd-user: Implement new syscall print_sysarch and add strace support Sean Bruno
2014-06-10 22:53   ` Peter Maydell
2014-06-11 18:52     ` Sean Bruno
2014-06-15 15:33     ` Sean Bruno
2014-06-15 19:20       ` Peter Maydell
2014-06-15 19:30         ` Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 06/10 v4] bsd-user: Implement strace support for __acl_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 07/10 v4] bsd-user: Implement strace support for extattr_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 08/10 v4] bsd-user: Implement strace support for thr_* syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 09/10 v4] bsd-user: Fix syscall format, add strace support for more syscalls Sean Bruno
2014-06-08 16:57 ` [Qemu-devel] [PATCH 10/10 v4] bsd-user: Add TARGET_HW_MACHINE TARGET_HW_MACHINE_ARCH for future use Sean Bruno
2014-06-10 23:00   ` Peter Maydell
2014-06-10 23:29 ` [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402246651-71099-2-git-send-email-sbruno@freebsd.org \
    --to=sbruno@freebsd.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).