Skip to content

Commit

Permalink
Darwin userspace emulation, by Pierre d'Herbemont.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2332 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
ths committed Jan 18, 2007
1 parent 54421cb commit 831b782
Show file tree
Hide file tree
Showing 13 changed files with 4,996 additions and 11 deletions.
17 changes: 16 additions & 1 deletion Makefile.target
Expand Up @@ -13,7 +13,11 @@ endif
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
ifdef CONFIG_USER_ONLY
ifdef CONFIG_DARWIN_USER
VPATH+=:$(SRC_PATH)/darwin-user
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
endif
ifdef CONFIG_LINUX_USER
VPATH+=:$(SRC_PATH)/linux-user
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
endif
Expand Down Expand Up @@ -85,21 +89,25 @@ endif
ifdef USE_I386_LD
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
ifdef CONFIG_LINUX_USER
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
# that the kernel ELF loader considers as an executable. I think this
# is the simplest way to make it self virtualizable!
BASE_LDFLAGS+=-Wl,-shared
endif
endif
endif

ifeq ($(ARCH),x86_64)
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif

ifeq ($(ARCH),ppc)
CPPFLAGS+= -D__powerpc__
ifdef CONFIG_LINUX_USER
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
endif

ifeq ($(ARCH),s390)
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
Expand Down Expand Up @@ -186,6 +194,7 @@ BASE_LDFLAGS+=-p
main.o: BASE_CFLAGS+=-p
endif

ifdef CONFIG_LINUX_USER
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
elfload.o linuxload.o
ifdef TARGET_HAS_BFLT
Expand All @@ -203,6 +212,12 @@ endif
ifeq ($(TARGET_ARCH), m68k)
OBJS+= m68k-sim.o m68k-semi.o
endif
endif #CONFIG_LINUX_USER

ifdef CONFIG_DARWIN_USER
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
endif

SRCS:= $(OBJS:.o=.c)
OBJS+= libqemu.a

Expand Down
48 changes: 39 additions & 9 deletions configure
Expand Up @@ -94,7 +94,8 @@ cocoa="no"
check_gfx="yes"
check_gcc="yes"
softmmu="yes"
user="no"
linux_user="no"
darwin_user="no"
build_docs="no"
uname_release=""

Expand Down Expand Up @@ -126,6 +127,7 @@ oss="yes"
Darwin)
bsd="yes"
darwin="yes"
darwin_user="yes"
OS_CFLAGS="-mdynamic-no-pic"
;;
SunOS)
Expand All @@ -134,7 +136,7 @@ solaris="yes"
*)
oss="yes"
linux="yes"
user="yes"
linux_user="yes"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
kqemu="yes"
fi
Expand Down Expand Up @@ -240,9 +242,13 @@ for opt do
;;
--enable-system) softmmu="yes"
;;
--disable-user) user="no"
--disable-linux-user) linux_user="no"
;;
--enable-user) user="yes"
--enable-linux-user) linux_user="yes"
;;
--disable-darwin-user) darwin_user="no"
;;
--enable-darwin-user) darwin_user="yes"
;;
--enable-uname-release=*) uname_release="$optarg"
;;
Expand Down Expand Up @@ -287,8 +293,10 @@ echo " --enable-fmod enable FMOD audio driver"
echo " --enabled-dsound enable DirectSound audio driver"
echo " --enable-system enable all system emulation targets"
echo " --disable-system disable all system emulation targets"
echo " --enable-user enable all linux usermode emulation targets"
echo " --disable-user disable all linux usermode emulation targets"
echo " --enable-linux-user enable all linux usermode emulation targets"
echo " --disable-linux-user disable all linux usermode emulation targets"
echo " --enable-darwin-user enable all darwin usermode emulation targets"
echo " --disable-darwin-user disable all darwin usermode emulation targets"
echo " --fmod-lib path to FMOD library"
echo " --fmod-inc path to FMOD includes"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
Expand Down Expand Up @@ -408,8 +416,12 @@ if test -z "$target_list" ; then
target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
fi
# the following are Linux specific
if [ "$user" = "yes" ] ; then
target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user m68k-user $target_list"
if [ "$linux_user" = "yes" ] ; then
target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user $target_list"
fi
# the following are Darwin specific
if [ "$darwin_user" = "yes" ] ; then
target_list="i386-darwin-user ppc-darwin-user $target_list"
fi
else
target_list=`echo "$target_list" | sed -e 's/,/ /g'`
Expand Down Expand Up @@ -787,6 +799,16 @@ if expr $target : '.*-user' > /dev/null ; then
target_user_only="yes"
fi

target_linux_user="no"
if expr $target : '.*-linux-user' > /dev/null ; then
target_linux_user="yes"
fi

target_darwin_user="no"
if expr $target : '.*-darwin-user' > /dev/null ; then
target_darwin_user="yes"
fi

if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
-a "$sdl" = "no" -a "$cocoa" = "no" ; then
echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
Expand All @@ -799,7 +821,7 @@ fi

mkdir -p $target_dir
mkdir -p $target_dir/fpu
if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
mkdir -p $target_dir/nwfpe
fi
if test "$target_user_only" = "no" ; then
Expand Down Expand Up @@ -894,6 +916,14 @@ if test "$target_user_only" = "yes" ; then
echo "CONFIG_USER_ONLY=yes" >> $config_mak
echo "#define CONFIG_USER_ONLY 1" >> $config_h
fi
if test "$target_linux_user" = "yes" ; then
echo "CONFIG_LINUX_USER=yes" >> $config_mak
echo "#define CONFIG_LINUX_USER 1" >> $config_h
fi
if test "$target_darwin_user" = "yes" ; then
echo "CONFIG_DARWIN_USER=yes" >> $config_mak
echo "#define CONFIG_DARWIN_USER 1" >> $config_h
fi

if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
Expand Down

0 comments on commit 831b782

Please sign in to comment.