summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile35
-rw-r--r--Makefile.hw2
-rw-r--r--Makefile.target37
-rw-r--r--acl.c4
-rw-r--r--audio/audio.h2
-rw-r--r--block.c4
-rw-r--r--block/raw-posix.c4
-rw-r--r--bsd-user/syscall.c6
-rw-r--r--bswap.h12
-rwxr-xr-xconfigure291
-rw-r--r--console.c8
-rw-r--r--cpu-all.h12
-rw-r--r--cpu-defs.h2
-rw-r--r--cpu-exec.c6
-rw-r--r--disas.c2
-rw-r--r--dyngen-exec.h2
-rw-r--r--fpu/softfloat-native.c4
-rw-r--r--fpu/softfloat-native.h4
-rw-r--r--fpu/softfloat.h4
-rw-r--r--hw/blizzard_template.h2
-rw-r--r--hw/bt-hci.c2
-rw-r--r--hw/gus.c2
-rw-r--r--hw/omap_lcd_template.h2
-rw-r--r--hw/petalogix_s3adsp1800_mmu.c8
-rw-r--r--hw/pl110_template.h6
-rw-r--r--hw/ppc440_bamboo.c2
-rw-r--r--hw/ppce500_mpc8544ds.c4
-rw-r--r--hw/pxa2xx_template.h2
-rw-r--r--hw/vga.c14
-rw-r--r--hw/vga_template.h6
-rw-r--r--linux-user/arm/nwfpe/double_cpdo.c4
-rw-r--r--linux-user/arm/nwfpe/fpa11_cpdt.c4
-rw-r--r--linux-user/syscall.c6
-rw-r--r--loader.c4
-rw-r--r--net.c6
-rw-r--r--osdep.c6
-rw-r--r--posix-aio-compat.c4
-rw-r--r--qemu-char.c2
-rw-r--r--qemu-common.h8
-rw-r--r--savevm.c4
-rw-r--r--sdl.c4
-rw-r--r--slirp/ip.h6
-rw-r--r--slirp/slirp_config.h2
-rw-r--r--slirp/tcp.h2
-rw-r--r--target-arm/neon_helper.c2
-rw-r--r--target-i386/cpu.h2
-rw-r--r--target-i386/exec.h2
-rw-r--r--target-i386/translate.c4
-rw-r--r--target-mips/cpu.h2
-rw-r--r--target-ppc/kvm_ppc.c2
-rw-r--r--target-ppc/op_helper.c30
-rw-r--r--target-ppc/translate.c4
-rw-r--r--target-ppc/translate_init.c4
-rw-r--r--target-sparc/op_helper.c2
-rw-r--r--tcg/arm/tcg-target.c2
-rw-r--r--tcg/tcg.c2
-rw-r--r--tcg/tcg.h2
-rw-r--r--vl.c6
-rw-r--r--vnc.c2
59 files changed, 289 insertions, 332 deletions
diff --git a/Makefile b/Makefile
index 25d215da6..10fb45b2e 100644
--- a/Makefile
+++ b/Makefile
@@ -20,9 +20,7 @@ CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CPPFLAGS += -U_FORTIFY_SOURCE
LIBS=
-ifdef CONFIG_STATIC
-LDFLAGS += -static
-endif
+
ifdef BUILD_DOCS
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
else
@@ -76,21 +74,13 @@ recurse-all: $(SUBDIR_RULES)
block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o
block-obj-y += nbd.o block.o aio.o aes.o
+block-obj-$(CONFIG_AIO) += posix-aio-compat.o
block-nested-y += cow.o qcow.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o
block-nested-y += parallels.o nbd.o
-
-
-ifdef CONFIG_WIN32
-block-nested-y += raw-win32.o
-else
-ifdef CONFIG_AIO
-block-obj-y += posix-aio-compat.o
-endif
-block-nested-y += raw-posix.o
-endif
-
+block-nested-$(CONFIG_WIN32) += raw-win32.o
+block-nested-$(CONFIG_POSIX) += raw-posix.o
block-nested-$(CONFIG_CURL) += curl.o
block-obj-y += $(addprefix block/, $(block-nested-y))
@@ -126,21 +116,16 @@ obj-y += qdev.o qdev-properties.o ssi.o
obj-$(CONFIG_BRLAPI) += baum.o
-ifdef CONFIG_BRLAPI
-LIBS+=-lbrlapi
-endif
+LIBS+=$(BRLAPI_LIBS)
-ifdef CONFIG_WIN32
-obj-y += tap-win32.o
-else
-obj-y += migration-exec.o
-endif
+obj-$(CONFIG_WIN32) += tap-win32.o
+obj-$(CONFIG_POSIX) += migration-exec.o
ifdef CONFIG_COREAUDIO
AUDIO_PT = y
endif
ifdef CONFIG_FMOD
-audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
+audio/audio.o audio/fmodaudio.o: CPPFLAGS := $(FMOD_CFLAGS) $(CPPFLAGS)
endif
ifdef CONFIG_ESD
AUDIO_PT = y
@@ -209,7 +194,7 @@ vnc.h: vnc-tls.h vnc-auth-vencrypt.h vnc-auth-sasl.h keymaps.h
vnc.o: vnc.c vnc.h vnc_keysym.h vnchextile.h d3des.c d3des.h acl.h
-vnc.o: CFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
+vnc.o: CFLAGS += $(VNC_TLS_CFLAGS)
vnc-tls.o: vnc-tls.c vnc.h
@@ -219,7 +204,7 @@ vnc-auth-sasl.o: vnc-auth-sasl.c vnc.h
curses.o: curses.c keymaps.h curses_keys.h
-bt-host.o: CFLAGS += $(CONFIG_BLUEZ_CFLAGS)
+bt-host.o: CFLAGS += $(BLUEZ_CFLAGS)
libqemu_common.a: $(obj-y)
diff --git a/Makefile.hw b/Makefile.hw
index 17c73df84..131ae51b1 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -1,7 +1,7 @@
# Makefile for qemu target independent devices.
-include config.mak
include ../config-host.mak
+include config.mak
include $(SRC_PATH)/rules.mak
.PHONY: all
diff --git a/Makefile.target b/Makefile.target
index 72f14f6de..ef312a447 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -212,10 +212,6 @@ ifdef CONFIG_LINUX_USER
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
-
ifeq ($(ARCH),i386)
ifdef TARGET_GPROF
USE_I386_LD=y
@@ -275,7 +271,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -283,7 +279,7 @@ endif
endif
ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -359,10 +355,6 @@ ifdef CONFIG_BSD_USER
VPATH+=:$(SRC_PATH)/bsd-user
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
-
ifeq ($(ARCH),i386)
ifdef TARGET_GPROF
USE_I386_LD=y
@@ -422,7 +414,7 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
ifeq ($(ARCH),mips)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -430,7 +422,7 @@ endif
endif
ifeq ($(ARCH),mips64)
-ifeq ($(WORDS_BIGENDIAN),yes)
+ifeq ($(HOST_WORDS_BIGENDIAN),y)
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
else
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
@@ -474,10 +466,10 @@ ifdef CONFIG_DSOUND
LIBS += -lole32 -ldxguid
endif
ifdef CONFIG_FMOD
-LIBS += $(CONFIG_FMOD_LIB)
+LIBS += $(FMOD_LIBS)
endif
ifdef CONFIG_OSS
-LIBS += $(CONFIG_OSS_LIB)
+LIBS += $(OSS_LIBS)
endif
sound-obj-y =
@@ -493,17 +485,17 @@ adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
endif
ifdef CONFIG_VNC_TLS
-CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
-LIBS += $(CONFIG_VNC_TLS_LIBS)
+CPPFLAGS += $(VNC_TLS_CFLAGS)
+LIBS += $(VNC_TLS_LIBS)
endif
ifdef CONFIG_VNC_SASL
-CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
-LIBS += $(CONFIG_VNC_SASL_LIBS)
+CPPFLAGS += $(VNC_SASL_CFLAGS)
+LIBS += $(VNC_SASL_LIBS)
endif
ifdef CONFIG_BLUEZ
-LIBS += $(CONFIG_BLUEZ_LIBS)
+LIBS += $(BLUEZ_LIBS)
endif
# xen backend driver support
@@ -578,8 +570,8 @@ ifeq ($(TARGET_BASE_ARCH), ppc)
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
endif
+obj-ppc-$(CONFIG_FDT) += device_tree.o
ifdef FDT_LIBS
-obj-ppc-y += device_tree.o
LIBS+= $(FDT_LIBS)
endif
@@ -606,8 +598,8 @@ obj-microblaze-y += xilinx_ethlite.o
obj-microblaze-y += pflash_cfi02.o
+obj-microblaze-$(CONFIG_FDT) += device_tree.o
ifdef FDT_LIBS
-obj-microblaze-y += device_tree.o
LIBS+= $(FDT_LIBS)
endif
@@ -677,9 +669,6 @@ CPPFLAGS+=-I$(SRC_PATH)/slirp
endif
# specific flags are needed for non soft mmu emulator
-ifdef CONFIG_STATIC
-LDFLAGS+=-static
-endif
ifndef CONFIG_DARWIN
ifndef CONFIG_WIN32
ifndef CONFIG_SOLARIS
diff --git a/acl.c b/acl.c
index f69db25c8..1a11a61d1 100644
--- a/acl.c
+++ b/acl.c
@@ -27,7 +27,7 @@
#include "sysemu.h"
#include "acl.h"
-#ifdef HAVE_FNMATCH_H
+#ifdef CONFIG_FNMATCH
#include <fnmatch.h>
#endif
@@ -79,7 +79,7 @@ int qemu_acl_party_is_allowed(qemu_acl *acl,
qemu_acl_entry *entry;
TAILQ_FOREACH(entry, &acl->entries, next) {
-#ifdef HAVE_FNMATCH_H
+#ifdef CONFIG_FNMATCH
if (fnmatch(entry->match, party, 0) == 0)
return entry->deny ? 0 : 1;
#else
diff --git a/audio/audio.h b/audio/audio.h
index 3fb2c8bbe..fda2af342 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -38,7 +38,7 @@ typedef enum {
AUD_FMT_S32
} audfmt_e;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define AUDIO_HOST_ENDIANNESS 1
#else
#define AUDIO_HOST_ENDIANNESS 0
diff --git a/block.c b/block.c
index 39f726cd6..82ffea875 100644
--- a/block.c
+++ b/block.c
@@ -22,7 +22,7 @@
* THE SOFTWARE.
*/
#include "config-host.h"
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
/* include native header before sys-queue.h */
#include <sys/queue.h>
#endif
@@ -32,7 +32,7 @@
#include "block_int.h"
#include "module.h"
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 74821506a..b3af76bc7 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -777,7 +777,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
BDRVRawState *s = bs->opaque;
int fd = s->fd;
int64_t size;
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
struct stat sb;
#ifdef __FreeBSD__
int reopened = 0;
@@ -793,7 +793,7 @@ static int64_t raw_getlength(BlockDriverState *bs)
if (ret < 0)
return ret;
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#ifdef __FreeBSD__
again:
#endif
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 4f713f2e8..3cff35765 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -66,7 +66,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
switch(num) {
case TARGET_FREEBSD_NR_exit:
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
@@ -138,7 +138,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1,
switch(num) {
case TARGET_NETBSD_NR_exit:
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
@@ -210,7 +210,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
switch(num) {
case TARGET_OPENBSD_NR_exit:
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
diff --git a/bswap.h b/bswap.h
index 1dd357eb9..455870429 100644
--- a/bswap.h
+++ b/bswap.h
@@ -5,13 +5,13 @@
#include <inttypes.h>
-#ifdef HAVE_MACHINE_BSWAP_H
+#ifdef CONFIG_MACHINE_BSWAP_H
#include <sys/endian.h>
#include <sys/types.h>
#include <machine/bswap.h>
#else
-#ifdef HAVE_BYTESWAP_H
+#ifdef CONFIG_BYTESWAP_H
#include <byteswap.h>
#else
@@ -47,7 +47,7 @@
(uint64_t)(((uint64_t)(__x) & (uint64_t)0xff00000000000000ULL) >> 56) )); \
})
-#endif /* !HAVE_BYTESWAP_H */
+#endif /* !CONFIG_BYTESWAP_H */
static inline uint16_t bswap16(uint16_t x)
{
@@ -64,7 +64,7 @@ static inline uint64_t bswap64(uint64_t x)
return bswap_64(x);
}
-#endif /* ! HAVE_MACHINE_BSWAP_H */
+#endif /* ! CONFIG_MACHINE_BSWAP_H */
static inline void bswap16s(uint16_t *s)
{
@@ -81,7 +81,7 @@ static inline void bswap64s(uint64_t *s)
*s = bswap64(*s);
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define be_bswap(v, size) (v)
#define le_bswap(v, size) bswap ## size(v)
#define be_bswaps(v, size)
@@ -203,7 +203,7 @@ static inline void cpu_to_be32wu(uint32_t *p, uint32_t v)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define cpu_to_32wu cpu_to_be32wu
#else
#define cpu_to_32wu cpu_to_le32wu
diff --git a/configure b/configure
index 158b2ba5d..ed4928a32 100755
--- a/configure
+++ b/configure
@@ -170,6 +170,7 @@ kvm_version() {
fi
}
+brlapi="yes"
gprof="no"
debug_tcg="no"
debug="no"
@@ -215,7 +216,6 @@ aix="no"
blobs="yes"
fdt="yes"
sdl="yes"
-sdl_x11="no"
xen="yes"
pkgversion=" ($(kvm_version))"
signalfd="no"
@@ -507,13 +507,25 @@ for opt do
--sparc_cpu=*)
sparc_cpu="$optarg"
case $sparc_cpu in
- v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
- target_arch2="sparc"; cpu="sparc" ;;
- v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
- target_arch2="sparc"; cpu="sparc" ;;
- v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
- target_arch2="sparc64"; cpu="sparc64" ;;
- *) echo "undefined SPARC architecture. Exiting";exit 1;;
+ v7|v8)
+ ARCH_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"
+ ARCH_LDFLAGS="-m32"
+ cpu="sparc"
+ ;;
+ v8plus|v8plusa)
+ ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"
+ ARCH_LDFLAGS="-m32"
+ cpu="sparc"
+ ;;
+ v9)
+ ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"
+ ARCH_LDFLAGS="-m64"
+ cpu="sparc64"
+ ;;
+ *)
+ echo "undefined SPARC architecture. Exiting";
+ exit 1
+ ;;
esac
;;
--enable-werror) werror="yes"
@@ -592,9 +604,6 @@ case "$cpu" in
sparc) if test -z "$sparc_cpu" ; then
ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
ARCH_LDFLAGS="-m32"
- else
- ARCH_CFLAGS="${SP_CFLAGS}"
- ARCH_LDFLAGS="${SP_LDFLAGS}"
fi
ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
if test "$solaris" = "no" ; then
@@ -604,9 +613,6 @@ case "$cpu" in
sparc64) if test -z "$sparc_cpu" ; then
ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
ARCH_LDFLAGS="-m64"
- else
- ARCH_CFLAGS="${SP_CFLAGS}"
- ARCH_LDFLAGS="${SP_LDFLAGS}"
fi
if test "$solaris" = "no" ; then
ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
@@ -978,16 +984,17 @@ fi
# xen probe
if test "$xen" = "yes" ; then
-cat > $TMPC <<EOF
+ xen_libs="-lxenstore -lxenctrl -lxenguest"
+ cat > $TMPC <<EOF
#include <xenctrl.h>
#include <xs.h>
int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
EOF
- if $cc $CFLAGS $ARCH_CFLAGS -c -o $TMPO $TMPC $LDFLAGS -lxenstore -lxenctrl 2> /dev/null > /dev/null ; then
- :
- else
- xen="no"
- fi
+ if $cc $CFLAGS $ARCH_CFLAGS -c -o $TMPO $TMPC $LDFLAGS $xen_libs 2> /dev/null > /dev/null ; then
+ :
+ else
+ xen="no"
+ fi
fi
##########################################
@@ -996,49 +1003,42 @@ fi
sdl_too_old=no
if test "$sdl" = "yes" ; then
- sdl_config="sdl-config"
- sdl=no
- sdl_static=no
-
-cat > $TMPC << EOF
+ sdl=no
+ cat > $TMPC << EOF
#include <SDL.h>
#undef main /* We don't want SDL to override our main() */
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then
- _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
- if test "$_sdlversion" -lt 121 ; then
- sdl_too_old=yes
- else
- if test "$cocoa" = "no" ; then
- sdl=yes
- fi
- fi
-
- # static link with sdl ?
- if test "$sdl" = "yes" ; then
- aa="no"
- `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
- sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
- if [ "$aa" = "yes" ] ; then
- sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
- fi
-
- if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
- sdl_static=yes
- fi
- fi # static link
- fi # sdl compile test
-else
- # Make sure to disable cocoa if sdl was set
- if test "$sdl" = "yes" ; then
- cocoa="no"
- audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
+ sdl_cflags=`sdl-config --cflags 2> /dev/null`
+ sdl_libs=`sdl-config --libs 2> /dev/null`
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $sdl_cflags $TMPC $sdl_libs > $TMPSDLLOG 2>&1 ; then
+ _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
+ if test "$_sdlversion" -lt 121 ; then
+ sdl_too_old=yes
+ else
+ if test "$cocoa" = "no" ; then
+ sdl=yes
+ fi
fi
-fi # -z $sdl
+
+ # static link with sdl ?
+ if test "$sdl" = "yes" -a "$static" = "yes" ; then
+ sdl_libs=`sdl-config --static-libs 2>/dev/null`
+ if test `sdl-config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` ; then
+ sdl_libs="$sdl_libs `aalib-config --static-libs >2 /dev/null`"
+ sdl_cflags="$sd_cflags `aalib-config --cflags >2 /dev/null`"
+ fi
+ if $cc -o $TMPE ${OS_CFLAGS} $sdl_cflags $TMPC $sdl_libs > /dev/null 2> /dev/null; then
+ :
+ else
+ sdl=no
+ fi
+ fi # static link
+ fi # sdl compile test
+fi
if test "$sdl" = "yes" ; then
-cat > $TMPC <<EOF
+ cat > $TMPC <<EOF
#include <SDL.h>
#if defined(SDL_VIDEO_DRIVER_X11)
#include <X11/XKBlib.h>
@@ -1047,9 +1047,9 @@ cat > $TMPC <<EOF
#endif
int main(void) { return 0; }
EOF
- if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then
- sdl_x11="yes"
- fi
+ if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $sdl_cflags $TMPC $sdl_libs > /dev/null 2>&1 ; then
+ sdl_libs="$sdl_libs -lX11"
+ fi
fi
##########################################
@@ -1194,23 +1194,22 @@ done
##########################################
# BrlAPI probe
-if test -z "$brlapi" ; then
- brlapi=no
-cat > $TMPC << EOF
+if test "$brlapi" = "yes" ; then
+ brlapi=no
+ brlapi_libs="-lbrlapi"
+ cat > $TMPC << EOF
#include <brlapi.h>
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
EOF
- if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
- brlapi=yes
- fi # brlapi compile test
-fi # -z $brlapi
+ if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC $brlapi_libs > /dev/null 2> /dev/null ; then
+ brlapi=yes
+ fi
+fi
##########################################
# curses probe
if test "$curses" = "yes" ; then
- curses=no
- ncurses=no
cat > $TMPC << EOF
#include <curses.h>
#ifdef __OpenBSD__
@@ -1219,10 +1218,11 @@ if test "$curses" = "yes" ; then
int main(void) { resize_term(0, 0); return curses_version(); }
EOF
if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lncurses > /dev/null 2> /dev/null ; then
- curses=yes
- ncurses=yes
+ curses_libs="-lncurses"
elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
- curses=yes
+ curses_libs="-lcurses"
+ else
+ curses=no
fi
fi # test "$curses"
@@ -1573,9 +1573,6 @@ if test "$darwin" = "yes" ; then
echo "Cocoa support $cocoa"
fi
echo "SDL support $sdl"
-if test "$sdl" != "no" ; then
- echo "SDL static link $sdl_static"
-fi
echo "curses support $curses"
echo "curl support $curl"
echo "mingw32 support $mingw32"
@@ -1616,9 +1613,6 @@ echo "preadv support $preadv"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
-#if test "$sdl_static" = "no"; then
-# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
-#fi
config_host_mak="config-host.mak"
config_host_h="config-host.h"
@@ -1633,27 +1627,8 @@ printf " '%s'" "$0" "$@" >> $config_host_mak
echo >> $config_host_mak
echo "/* Automatically generated by configure - do not modify */" > $config_host_h
-echo "prefix=$prefix" >> $config_host_mak
-echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
-echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
-echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
-echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_host_h
-echo "MAKE=$make" >> $config_host_mak
-echo "INSTALL=$install" >> $config_host_mak
-echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
-echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
-echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
-echo "CC=$cc" >> $config_host_mak
-echo "HOST_CC=$host_cc" >> $config_host_mak
-echo "AR=$ar" >> $config_host_mak
-echo "OBJCOPY=$objcopy" >> $config_host_mak
-echo "LD=$ld" >> $config_host_mak
-echo "CFLAGS=$CFLAGS $OS_CFLAGS $ARCH_CFLAGS $EXTRA_CFLAGS" >> $config_host_mak
-echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $ARCH_LDFLAGS $EXTRA_LDFLAGS" >> $config_host_mak
-echo "EXESUF=$EXESUF" >> $config_host_mak
-echo "PTHREADLIBS=$PTHREADLIBS" >> $config_host_mak
-echo "CLOCKLIBS=$CLOCKLIBS" >> $config_host_mak
+
case "$cpu" in
i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64)
ARCH=$cpu
@@ -1671,34 +1646,30 @@ arch_name=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
echo "#define HOST_$arch_name 1" >> $config_host_h
if test "$debug_tcg" = "yes" ; then
- echo "#define DEBUG_TCG 1" >> $config_host_h
+ echo "#define CONFIG_DEBUG_TCG 1" >> $config_host_h
fi
if test "$debug" = "yes" ; then
- echo "#define DEBUG_EXEC 1" >> $config_host_h
-fi
-if test "$sparse" = "yes" ; then
- echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
- echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
- echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
+ echo "#define CONFIG_DEBUG_EXEC 1" >> $config_host_h
fi
if test "$strip_opt" = "yes" ; then
echo "STRIP_OPT=-s" >> $config_host_mak
fi
if test "$bigendian" = "yes" ; then
- echo "WORDS_BIGENDIAN=yes" >> $config_host_mak
- echo "#define WORDS_BIGENDIAN 1" >> $config_host_h
+ echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
+ echo "#define HOST_WORDS_BIGENDIAN 1" >> $config_host_h
fi
echo "#define HOST_LONG_BITS $hostlongbits" >> $config_host_h
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
echo "#define CONFIG_WIN32 1" >> $config_host_h
else
+ echo "CONFIG_POSIX=y" >> $config_host_mak
cat > $TMPC << EOF
#include <byteswap.h>
int main(void) { return bswap_32(0); }
EOF
if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
- echo "#define HAVE_BYTESWAP_H 1" >> $config_host_h
+ echo "#define CONFIG_BYTESWAP_H 1" >> $config_host_h
fi
cat > $TMPC << EOF
#include <sys/endian.h>
@@ -1707,7 +1678,7 @@ EOF
int main(void) { return bswap32(0); }
EOF
if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
- echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_host_h
+ echo "#define CONFIG_MACHINE_BSWAP_H 1" >> $config_host_h
fi
fi
@@ -1740,11 +1711,12 @@ if test -n "$sparc_cpu"; then
fi
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_host_mak
- echo "#define HAVE_GPROF 1" >> $config_host_h
+ echo "#define TARGET_GPROF 1" >> $config_host_h
fi
if test "$static" = "yes" ; then
echo "CONFIG_STATIC=y" >> $config_host_mak
echo "#define CONFIG_STATIC 1" >> $config_host_h
+ LDFLAGS="$LDFLAGS -static"
fi
if test $profiler = "yes" ; then
echo "#define CONFIG_PROFILER 1" >> $config_host_h
@@ -1769,10 +1741,10 @@ for drv in $audio_drv_list; do
def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
echo "$def=y" >> $config_host_mak
if test "$drv" = "fmod"; then
- echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_host_mak
- echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_host_mak
+ echo "FMOD_LIBS=$fmod_lib" >> $config_host_mak
+ echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
elif test "$drv" = "oss"; then
- echo "CONFIG_OSS_LIB=$oss_lib" >> $config_host_mak
+ echo "OSS_LIBS=$oss_lib" >> $config_host_mak
fi
done
echo "" >>$config_host_h
@@ -1782,18 +1754,18 @@ if test "$mixemu" = "yes" ; then
fi
if test "$vnc_tls" = "yes" ; then
echo "CONFIG_VNC_TLS=y" >> $config_host_mak
- echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
- echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_host_mak
+ echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
+ echo "VNC_TLS_LIBS=$vnc_tls_libs" >> $config_host_mak
echo "#define CONFIG_VNC_TLS 1" >> $config_host_h
fi
if test "$vnc_sasl" = "yes" ; then
echo "CONFIG_VNC_SASL=y" >> $config_host_mak
- echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
- echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_host_mak
+ echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
+ echo "VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_host_mak
echo "#define CONFIG_VNC_SASL 1" >> $config_host_h
fi
if test "$fnmatch" = "yes" ; then
- echo "#define HAVE_FNMATCH_H 1" >> $config_host_h
+ echo "#define CONFIG_FNMATCH 1" >> $config_host_h
fi
qemu_version=`head $source_path/VERSION`
echo "VERSION=$qemu_version" >>$config_host_mak
@@ -1809,26 +1781,11 @@ echo "TARGET_DIRS=$target_list" >> $config_host_mak
if [ "$build_docs" = "yes" ] ; then
echo "BUILD_DOCS=yes" >> $config_host_mak
fi
-if test "$static" = "yes"; then
- sdl1=$sdl_static
-else
- sdl1=$sdl
-fi
-if test "$sdl1" = "yes" ; then
+if test "$sdl" = "yes" ; then
echo "#define CONFIG_SDL 1" >> $config_host_h
echo "CONFIG_SDL=y" >> $config_host_mak
- if test "$target_softmmu" = "no" -o "$static" = "yes"; then
- echo "SDL_LIBS=$sdl_static_libs" >> $config_host_mak
- elif test "$sdl_x11" = "yes" ; then
- echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_host_mak
- else
- echo "SDL_LIBS=`$sdl_config --libs`" >> $config_host_mak
- fi
- if [ "${aa}" = "yes" ] ; then
- echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_host_mak
- else
- echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_host_mak
- fi
+ echo "SDL_LIBS=$sdl_libs" >> $config_host_mak
+ echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
fi
if test "$cocoa" = "yes" ; then
echo "#define CONFIG_COCOA 1" >> $config_host_h
@@ -1837,11 +1794,7 @@ fi
if test "$curses" = "yes" ; then
echo "#define CONFIG_CURSES 1" >> $config_host_h
echo "CONFIG_CURSES=y" >> $config_host_mak
- if test "$ncurses" = "yes" ; then
- echo "CURSES_LIBS=-lncurses" >> $config_host_mak
- else
- echo "CURSES_LIBS=-lcurses" >> $config_host_mak
- fi
+ echo "CURSES_LIBS=$curses_libs" >> $config_host_mak
fi
if test "$atfile" = "yes" ; then
echo "#define CONFIG_ATFILE 1" >> $config_host_h
@@ -1866,16 +1819,16 @@ fi
if test "$brlapi" = "yes" ; then
echo "CONFIG_BRLAPI=y" >> $config_host_mak
echo "#define CONFIG_BRLAPI 1" >> $config_host_h
- echo "BRLAPI_LIBS=-lbrlapi" >> $config_host_mak
+ echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak
fi
if test "$bluez" = "yes" ; then
echo "CONFIG_BLUEZ=y" >> $config_host_mak
- echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
- echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_host_mak
+ echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
+ echo "BLUEZ_LIBS=$bluez_libs" >> $config_host_mak
echo "#define CONFIG_BLUEZ 1" >> $config_host_h
fi
if test "$xen" = "yes" ; then
- echo "XEN_LIBS=-lxenstore -lxenctrl -lxenguest" >> $config_host_mak
+ echo "XEN_LIBS=$xen_libs" >> $config_host_mak
fi
if test "$aio" = "yes" ; then
echo "#define CONFIG_AIO 1" >> $config_host_h
@@ -1889,13 +1842,14 @@ if test "$blobs" = "yes" ; then
echo "INSTALL_BLOBS=yes" >> $config_host_mak
fi
if test "$iovec" = "yes" ; then
- echo "#define HAVE_IOVEC 1" >> $config_host_h
+ echo "#define CONFIG_IOVEC 1" >> $config_host_h
fi
if test "$preadv" = "yes" ; then
- echo "#define HAVE_PREADV 1" >> $config_host_h
+ echo "#define CONFIG_PREADV 1" >> $config_host_h
fi
if test "$fdt" = "yes" ; then
- echo "#define HAVE_FDT 1" >> $config_host_h
+ echo "CONFIG_FDT=y" >> $config_host_mak
+ echo "#define CONFIG_FDT 1" >> $config_host_h
echo "FDT_LIBS=-lfdt" >> $config_host_mak
fi
if test "$signalfd" = "yes" ; then
@@ -1907,9 +1861,7 @@ fi
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
- echo "#define O_LARGEFILE 0" >> $config_host_h
- echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_host_h
- echo "#define HOST_BSD 1" >> $config_host_h
+ echo "#define CONFIG_BSD 1" >> $config_host_h
fi
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_host_h
@@ -1958,9 +1910,8 @@ else
exit 1
fi
-if test "$xen" = "yes" ;
- then
- echo "CONFIG_XEN=y" >> $config_host_mak
+if test "$xen" = "yes" ; then
+ echo "CONFIG_XEN=y" >> $config_host_mak
fi
# this is a temp hack needed for kvm
@@ -1985,6 +1936,32 @@ if test "$cpu" = "i386" -o "$cpu" = "x86_64" ; then
fi
echo "ROMS=$roms" >> $config_host_mak
+echo "prefix=$prefix" >> $config_host_mak
+echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
+echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
+echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
+echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
+echo "MAKE=$make" >> $config_host_mak
+echo "INSTALL=$install" >> $config_host_mak
+echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
+echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
+echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
+echo "CC=$cc" >> $config_host_mak
+echo "HOST_CC=$host_cc" >> $config_host_mak
+if test "$sparse" = "yes" ; then
+ echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
+ echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
+ echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
+fi
+echo "AR=$ar" >> $config_host_mak
+echo "OBJCOPY=$objcopy" >> $config_host_mak
+echo "LD=$ld" >> $config_host_mak
+echo "CFLAGS=$CFLAGS $OS_CFLAGS $ARCH_CFLAGS $EXTRA_CFLAGS" >> $config_host_mak
+echo "LDFLAGS=$LDFLAGS $OS_LDFLAGS $ARCH_LDFLAGS $EXTRA_LDFLAGS" >> $config_host_mak
+echo "EXESUF=$EXESUF" >> $config_host_mak
+echo "PTHREADLIBS=$PTHREADLIBS" >> $config_host_mak
+echo "CLOCKLIBS=$CLOCKLIBS" >> $config_host_mak
+
if test -f ${config_host_h}~ ; then
if cmp -s $config_host_h ${config_host_h}~ ; then
mv ${config_host_h}~ $config_host_h
@@ -2282,7 +2259,13 @@ fi
$source_path/create_config < $config_mak > $config_h
-test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
+if test -f ${config_h}~ ; then
+ if cmp -s $config_h ${config_h}~ ; then
+ mv ${config_h}~ $config_h
+ else
+ rm ${config_h}~
+ fi
+fi
done # for target in $targets
diff --git a/console.c b/console.c
index 52e3e57b8..d55e0fdc0 100644
--- a/console.c
+++ b/console.c
@@ -307,7 +307,7 @@ static void vga_bitblt(DisplayState *ds, int xs, int ys, int xd, int yd, int w,
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) ))
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) x
#else
#define PAT(x) cbswap_32(x)
@@ -1559,7 +1559,7 @@ DisplaySurface* defaultallocator_create_displaysurface(int width, int height)
surface->height = height;
surface->linesize = width * 4;
surface->pf = qemu_default_pixelformat(32);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -1580,7 +1580,7 @@ DisplaySurface* defaultallocator_resize_displaysurface(DisplaySurface *surface,
surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * surface->height);
else
surface->data = (uint8_t*) qemu_malloc(surface->linesize * surface->height);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -1598,7 +1598,7 @@ DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp,
surface->height = height;
surface->linesize = linesize;
surface->pf = qemu_default_pixelformat(bpp);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_BIG_ENDIAN_FLAG;
#endif
surface->data = data;
diff --git a/cpu-all.h b/cpu-all.h
index d8891f835..5c6c0512e 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -27,7 +27,7 @@
* WORDS_ALIGNED : if defined, the host cpu can only make word aligned
* memory accesses.
*
- * WORDS_BIGENDIAN : if defined, the host cpu is big endian and
+ * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and
* otherwise little endian.
*
* (TARGET_WORDS_ALIGNED : same for target cpu (not supported yet))
@@ -37,7 +37,7 @@
#include "softfloat.h"
-#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
#define BSWAP_NEEDED
#endif
@@ -123,7 +123,7 @@ typedef union {
endian ! */
typedef union {
float64 d;
-#if defined(WORDS_BIGENDIAN) \
+#if defined(HOST_WORDS_BIGENDIAN) \
|| (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
struct {
uint32_t upper;
@@ -141,7 +141,7 @@ typedef union {
#ifdef TARGET_SPARC
typedef union {
float128 q;
-#if defined(WORDS_BIGENDIAN) \
+#if defined(HOST_WORDS_BIGENDIAN) \
|| (defined(__arm__) && !defined(__VFP_FP__) && !defined(CONFIG_SOFTFLOAT))
struct {
uint32_t upmost;
@@ -221,7 +221,7 @@ static inline void stb_p(void *ptr, int v)
/* NOTE: on arm, putting 2 in /proc/sys/debug/alignment so that the
kernel handles unaligned load/stores may give better results, but
it is a system wide setting : bad */
-#if defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
+#if defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
/* conservative code for little endian unaligned accesses */
static inline int lduw_le_p(const void *ptr)
@@ -398,7 +398,7 @@ static inline void stfq_le_p(void *ptr, float64 v)
}
#endif
-#if !defined(WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
+#if !defined(HOST_WORDS_BIGENDIAN) || defined(WORDS_ALIGNED)
static inline int lduw_be_p(const void *ptr)
{
diff --git a/cpu-defs.h b/cpu-defs.h
index db17bd07b..1cd9a1504 100644
--- a/cpu-defs.h
+++ b/cpu-defs.h
@@ -107,7 +107,7 @@ typedef struct CPUTLBEntry {
sizeof(target_phys_addr_t))];
} CPUTLBEntry;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
typedef struct icount_decr_u16 {
uint16_t high;
uint16_t low;
diff --git a/cpu-exec.c b/cpu-exec.c
index 1bc367396..8f3f84c12 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -50,7 +50,7 @@
int tb_invalidated_flag;
-//#define DEBUG_EXEC
+//#define CONFIG_DEBUG_EXEC
//#define DEBUG_SIGNAL
int qemu_cpu_has_work(CPUState *env)
@@ -575,7 +575,7 @@ int cpu_exec(CPUState *env1)
env->exception_index = EXCP_INTERRUPT;
cpu_loop_exit();
}
-#ifdef DEBUG_EXEC
+#ifdef CONFIG_DEBUG_EXEC
if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
/* restore flags in standard format */
regs_to_env();
@@ -621,7 +621,7 @@ int cpu_exec(CPUState *env1)
next_tb = 0;
tb_invalidated_flag = 0;
}
-#ifdef DEBUG_EXEC
+#ifdef CONFIG_DEBUG_EXEC
qemu_log_mask(CPU_LOG_EXEC, "Trace 0x%08lx [" TARGET_FMT_lx "] %s\n",
(long)tb->tc_ptr, tb->pc,
lookup_symbol(tb->pc));
diff --git a/disas.c b/disas.c
index af5a9ea14..ce342bc8e 100644
--- a/disas.c
+++ b/disas.c
@@ -246,7 +246,7 @@ void disas(FILE *out, void *code, unsigned long size)
disasm_info.buffer_vma = (unsigned long)code;
disasm_info.buffer_length = size;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
disasm_info.endian = BFD_ENDIAN_BIG;
#else
disasm_info.endian = BFD_ENDIAN_LITTLE;
diff --git a/dyngen-exec.h b/dyngen-exec.h
index c1072cdcc..18819e470 100644
--- a/dyngen-exec.h
+++ b/dyngen-exec.h
@@ -39,7 +39,7 @@
/* XXX: This may be wrong for 64-bit ILP32 hosts. */
typedef void * host_reg_t;
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
typedef struct __sFILE FILE;
#else
typedef struct FILE FILE;
diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c
index 957698483..4c70b6c4f 100644
--- a/fpu/softfloat-native.c
+++ b/fpu/softfloat-native.c
@@ -9,7 +9,7 @@
void set_float_rounding_mode(int val STATUS_PARAM)
{
STATUS(float_rounding_mode) = val;
-#if defined(HOST_BSD) && !defined(__APPLE__) || \
+#if defined(CONFIG_BSD) && !defined(__APPLE__) || \
(defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
fpsetround(val);
#elif defined(__arm__)
@@ -26,7 +26,7 @@ void set_floatx80_rounding_precision(int val STATUS_PARAM)
}
#endif
-#if defined(HOST_BSD) || \
+#if defined(CONFIG_BSD) || \
(defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10)
#define lrint(d) ((int32_t)rint(d))
#define llrint(d) ((int64_t)rint(d))
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h
index 839e5b156..0bba08440 100644
--- a/fpu/softfloat-native.h
+++ b/fpu/softfloat-native.h
@@ -1,7 +1,7 @@
/* Native implementation of soft float functions */
#include <math.h>
-#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
+#if (defined(CONFIG_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
#include <ieeefp.h>
#define fabsf(f) ((float)fabs(f))
#else
@@ -112,7 +112,7 @@ typedef union {
/*----------------------------------------------------------------------------
| Software IEC/IEEE floating-point rounding mode.
*----------------------------------------------------------------------------*/
-#if (defined(HOST_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
+#if (defined(CONFIG_BSD) && !defined(__APPLE__)) || defined(CONFIG_SOLARIS)
#if defined(__OpenBSD__)
#define FE_RM FP_RM
#define FE_RP FP_RP
diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index b9537c144..bebfefd05 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -90,7 +90,7 @@ typedef int64_t sbits64;
#define FLOAT128
#else
/* native float support */
-#if (defined(__i386__) || defined(__x86_64__)) && !defined(HOST_BSD)
+#if (defined(__i386__) || defined(__x86_64__)) && !defined(CONFIG_BSD)
#define FLOATX80
#endif
#endif /* !CONFIG_SOFTFLOAT */
@@ -146,7 +146,7 @@ typedef struct {
#endif
#ifdef FLOAT128
typedef struct {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
uint64_t high, low;
#else
uint64_t low, high;
diff --git a/hw/blizzard_template.h b/hw/blizzard_template.h
index 0ef27d1c4..42f4e90b0 100644
--- a/hw/blizzard_template.h
+++ b/hw/blizzard_template.h
@@ -41,7 +41,7 @@
# error unknown bit depth
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif
diff --git a/hw/bt-hci.c b/hw/bt-hci.c
index 6a7909406..d510d8118 100644
--- a/hw/bt-hci.c
+++ b/hw/bt-hci.c
@@ -419,7 +419,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat
* be continuously allocated. We do it though, to preserve similar
* behaviour between hosts. Some things, like the BD_ADDR cannot be
* preserved though (for example if a real hci is used). */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define HNDL(raw) bswap16(raw)
#else
# define HNDL(raw) (raw)
diff --git a/hw/gus.c b/hw/gus.c
index 8915d4346..5e73c5a01 100644
--- a/hw/gus.c
+++ b/hw/gus.c
@@ -35,7 +35,7 @@
#define ldebug(...)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define GUS_ENDIANNESS 1
#else
#define GUS_ENDIANNESS 0
diff --git a/hw/omap_lcd_template.h b/hw/omap_lcd_template.h
index 0590e4501..2fb96f83a 100644
--- a/hw/omap_lcd_template.h
+++ b/hw/omap_lcd_template.h
@@ -152,7 +152,7 @@ static void glue(draw_line12_, DEPTH)(void *opaque,
static void glue(draw_line16_, DEPTH)(void *opaque,
uint8_t *d, const uint8_t *s, int width, int deststep)
{
-#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
uint16_t v;
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 1a1cc0e37..a04794d7f 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -52,14 +52,12 @@ static int petalogix_load_device_tree(target_phys_addr_t addr,
target_phys_addr_t initrd_size,
const char *kernel_cmdline)
{
-#ifdef HAVE_FDT
- void *fdt;
- int r;
-#endif
char *path;
int fdt_size;
+#ifdef CONFIG_FDT
+ void *fdt;
+ int r;
-#ifdef HAVE_FDT
/* Try the local "mb.dtb" override. */
fdt = load_device_tree("mb.dtb", &fdt_size);
if (!fdt) {
diff --git a/hw/pl110_template.h b/hw/pl110_template.h
index d7ff8bc61..b3c9077dc 100644
--- a/hw/pl110_template.h
+++ b/hw/pl110_template.h
@@ -95,18 +95,18 @@ static drawfn glue(pl110_draw_fn_,BITS)[36] =
#if ORDER == 0
#define NAME glue(glue(lblp_, BORDER), BITS)
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#elif ORDER == 1
#define NAME glue(glue(bbbp_, BORDER), BITS)
-#ifndef WORDS_BIGENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#else
#define SWAP_PIXELS 1
#define NAME glue(glue(lbbp_, BORDER), BITS)
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define SWAP_WORDS 1
#endif
#endif
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index a56dd09fe..91e40bc94 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -33,7 +33,7 @@ static void *bamboo_load_device_tree(target_phys_addr_t addr,
const char *kernel_cmdline)
{
void *fdt = NULL;
-#ifdef HAVE_FDT
+#ifdef CONFIG_FDT
uint32_t mem_reg_property[] = { 0, 0, ramsize };
char *filename;
int fdt_size;
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index 797af8366..e51851af2 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -47,7 +47,7 @@
#define MPC8544_PCI_IO 0xE1000000
#define MPC8544_PCI_IOLEN 0x10000
-#ifdef HAVE_FDT
+#ifdef CONFIG_FDT
static int mpc8544_copy_soc_cell(void *fdt, const char *node, const char *prop)
{
uint32_t cell;
@@ -78,7 +78,7 @@ static void *mpc8544_load_device_tree(target_phys_addr_t addr,
const char *kernel_cmdline)
{
void *fdt = NULL;
-#ifdef HAVE_FDT
+#ifdef CONFIG_FDT
uint32_t mem_reg_property[] = {0, ramsize};
char *filename;
int fdt_size;
diff --git a/hw/pxa2xx_template.h b/hw/pxa2xx_template.h
index 35312ec29..40f4e4d21 100644
--- a/hw/pxa2xx_template.h
+++ b/hw/pxa2xx_template.h
@@ -23,7 +23,7 @@
# error unknown bit depth
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# define SWAP_WORDS 1
#endif
diff --git a/hw/vga.c b/hw/vga.c
index 6aeb6b8f1..195159777 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -75,19 +75,19 @@ const uint8_t gr_mask[16] = {
(((uint32_t)(__x) & (uint32_t)0x00ff0000UL) >> 8) | \
(((uint32_t)(__x) & (uint32_t)0xff000000UL) >> 24) ))
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) cbswap_32(x)
#else
#define PAT(x) (x)
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define BIG 1
#else
#define BIG 0
#endif
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define GET_PLANE(data, p) (((data) >> (24 - (p) * 8)) & 0xff)
#else
#define GET_PLANE(data, p) (((data) >> ((p) * 8)) & 0xff)
@@ -114,7 +114,7 @@ static const uint32_t mask16[16] = {
#undef PAT
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define PAT(x) (x)
#else
#define PAT(x) cbswap_32(x)
@@ -1372,7 +1372,7 @@ static void vga_draw_text(VGAState *s, int full_update)
if (cx > cx_max)
cx_max = cx;
*ch_attr_ptr = ch_attr;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
ch = ch_attr >> 8;
cattr = ch_attr & 0xff;
#else
@@ -1636,7 +1636,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
disp_width != s->last_width ||
height != s->last_height ||
s->last_depth != depth) {
-#if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
if (depth == 16 || depth == 32) {
#else
if (depth == 32) {
@@ -1645,7 +1645,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth,
s->line_offset,
s->vram_ptr + (s->start_addr * 4));
-#if defined(WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
s->ds->surface->pf = qemu_different_endianness_pixelformat(depth);
#endif
dpy_resize(s->ds);
diff --git a/hw/vga_template.h b/hw/vga_template.h
index 0bc2e8020..8f32a77b6 100644
--- a/hw/vga_template.h
+++ b/hw/vga_template.h
@@ -417,7 +417,7 @@ void glue(vga_draw_cursor_line_, DEPTH)(uint8_t *d1,
static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 15 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 15 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
int w;
@@ -442,7 +442,7 @@ static void glue(vga_draw_line15_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
static void glue(vga_draw_line16_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 16 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
memcpy(d, s, width * 2);
#else
int w;
@@ -493,7 +493,7 @@ static void glue(vga_draw_line24_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
static void glue(vga_draw_line32_, PIXEL_NAME)(VGAState *s1, uint8_t *d,
const uint8_t *s, int width)
{
-#if DEPTH == 32 && defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)
+#if DEPTH == 32 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(BGR_FORMAT)
memcpy(d, s, width * 4);
#else
int w;
diff --git a/linux-user/arm/nwfpe/double_cpdo.c b/linux-user/arm/nwfpe/double_cpdo.c
index b5320c82a..655a83d0b 100644
--- a/linux-user/arm/nwfpe/double_cpdo.c
+++ b/linux-user/arm/nwfpe/double_cpdo.c
@@ -150,7 +150,7 @@ unsigned int DoubleCPDO(const unsigned int opcode)
case MNF_CODE:
{
unsigned int *p = (unsigned int*)&rFm;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
p[0] ^= 0x80000000;
#else
p[1] ^= 0x80000000;
@@ -162,7 +162,7 @@ unsigned int DoubleCPDO(const unsigned int opcode)
case ABS_CODE:
{
unsigned int *p = (unsigned int*)&rFm;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
p[0] &= 0x7fffffff;
#else
p[1] &= 0x7fffffff;
diff --git a/linux-user/arm/nwfpe/fpa11_cpdt.c b/linux-user/arm/nwfpe/fpa11_cpdt.c
index 76c6dcff3..1c4095402 100644
--- a/linux-user/arm/nwfpe/fpa11_cpdt.c
+++ b/linux-user/arm/nwfpe/fpa11_cpdt.c
@@ -44,7 +44,7 @@ void loadDouble(const unsigned int Fn, target_ulong addr)
unsigned int *p;
p = (unsigned int*)&fpa11->fpreg[Fn].fDouble;
fpa11->fType[Fn] = typeDouble;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
/* FIXME - handle failure of get_user() */
get_user_u32(p[0], addr); /* sign & exponent */
get_user_u32(p[1], addr + 4);
@@ -147,7 +147,7 @@ void storeDouble(const unsigned int Fn, target_ulong addr)
default: val = fpa11->fpreg[Fn].fDouble;
}
/* FIXME - handle put_user() failures */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
put_user_u32(p[0], addr); /* msw */
put_user_u32(p[1], addr + 4); /* lsw */
#else
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b5732388..4b230ddfc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -57,7 +57,7 @@
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <qemu-common.h>
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
#include <sys/gmon.h>
#endif
@@ -4162,7 +4162,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
pthread_exit(NULL);
}
#endif
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
@@ -5676,7 +5676,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef __NR_exit_group
/* new thread calls */
case TARGET_NR_exit_group:
-#ifdef HAVE_GPROF
+#ifdef TARGET_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
diff --git a/loader.c b/loader.c
index b5c5914c2..0cbcf9c6a 100644
--- a/loader.c
+++ b/loader.c
@@ -324,7 +324,7 @@ int load_elf(const char *filename, int64_t address_offset,
e_ident[2] != ELFMAG2 ||
e_ident[3] != ELFMAG3)
goto fail;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
data_order = ELFDATA2MSB;
#else
data_order = ELFDATA2LSB;
@@ -358,7 +358,7 @@ int load_elf(const char *filename, int64_t address_offset,
static void bswap_uboot_header(uboot_image_header_t *hdr)
{
-#ifndef WORDS_BIGENDIAN
+#ifndef HOST_WORDS_BIGENDIAN
bswap32s(&hdr->ih_magic);
bswap32s(&hdr->ih_hcrc);
bswap32s(&hdr->ih_time);
diff --git a/net.c b/net.c
index 192921604..c47f6fa10 100644
--- a/net.c
+++ b/net.c
@@ -29,7 +29,7 @@
#include <sys/time.h>
#include <zlib.h>
-/* Needed early for HOST_BSD etc. */
+/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"
#ifndef _WIN32
@@ -52,7 +52,7 @@
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h>
@@ -1585,7 +1585,7 @@ static TAPState *net_tap_fd_init(VLANState *vlan,
return s;
}
-#if defined (HOST_BSD) || defined (__FreeBSD_kernel__)
+#if defined (CONFIG_BSD) || defined (__FreeBSD_kernel__)
static int tap_open(char *ifname, int ifname_size)
{
int fd;
diff --git a/osdep.c b/osdep.c
index 8c74bf756..0672cdc3b 100644
--- a/osdep.c
+++ b/osdep.c
@@ -36,12 +36,12 @@
/* FIXME: This file should be target independent. However it has kqemu
hacks, so must be built for every target. */
-/* Needed early for HOST_BSD etc. */
+/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"
#ifdef _WIN32
#include <windows.h>
-#elif defined(HOST_BSD)
+#elif defined(CONFIG_BSD)
#include <stdlib.h>
#else
#include <malloc.h>
@@ -210,7 +210,7 @@ void *qemu_memalign(size_t alignment, size_t size)
if (ret != 0)
abort();
return ptr;
-#elif defined(HOST_BSD)
+#elif defined(CONFIG_BSD)
return oom_check(valloc(size));
#else
return oom_check(memalign(alignment, size));
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index e9fc9fa60..3d79f5985 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -33,7 +33,7 @@ static int cur_threads = 0;
static int idle_threads = 0;
static TAILQ_HEAD(, qemu_paiocb) request_list;
-#ifdef HAVE_PREADV
+#ifdef CONFIG_PREADV
static int preadv_present = 1;
#else
static int preadv_present = 0;
@@ -102,7 +102,7 @@ static size_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
return aiocb->aio_nbytes;
}
-#ifdef HAVE_PREADV
+#ifdef CONFIG_PREADV
static ssize_t
qemu_preadv(int fd, const struct iovec *iov, int nr_iov, off_t offset)
diff --git a/qemu-char.c b/qemu-char.c
index b42046dd8..6ec90594e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -61,7 +61,7 @@
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#include <sys/stat.h>
#ifdef __FreeBSD__
#include <libutil.h>
diff --git a/qemu-common.h b/qemu-common.h
index d478b47d3..1600a1005 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -32,13 +32,15 @@
#ifndef O_BINARY
#define O_BINARY 0
#endif
-
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
#ifndef ENOMEDIUM
#define ENOMEDIUM ENODEV
#endif
-#ifndef HAVE_IOVEC
-#define HAVE_IOVEC
+#ifndef CONFIG_IOVEC
+#define CONFIG_IOVEC
struct iovec {
void *iov_base;
size_t iov_len;
diff --git a/savevm.c b/savevm.c
index 0c0b49f1d..570377fdb 100644
--- a/savevm.c
+++ b/savevm.c
@@ -29,7 +29,7 @@
#include <sys/time.h>
#include <zlib.h>
-/* Needed early for HOST_BSD etc. */
+/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"
#ifndef _WIN32
@@ -52,7 +52,7 @@
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h>
diff --git a/sdl.c b/sdl.c
index 6d88cd525..50a4a016d 100644
--- a/sdl.c
+++ b/sdl.c
@@ -185,7 +185,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height)
surface->linesize = width * host_format.BytesPerPixel;
surface->pf = sdl_to_qemu_pixelformat(&host_format);
}
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_ALLOCATED_FLAG;
@@ -204,7 +204,7 @@ static DisplaySurface* sdl_create_displaysurface(int width, int height)
surface->linesize = real_screen->pitch;
surface->data = real_screen->pixels;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_REALPIXELS_FLAG | QEMU_BIG_ENDIAN_FLAG;
#else
surface->flags = QEMU_REALPIXELS_FLAG;
diff --git a/slirp/ip.h b/slirp/ip.h
index 574fc019a..5074e3312 100644
--- a/slirp/ip.h
+++ b/slirp/ip.h
@@ -33,7 +33,7 @@
#ifndef _IP_H_
#define _IP_H_
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
# ifndef NTOHL
# define NTOHL(d)
# endif
@@ -73,7 +73,7 @@ typedef u_int32_t n_long; /* long as received from the net */
* Structure of an internet header, naked of options.
*/
struct ip {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int ip_v:4, /* version */
ip_hl:4; /* header length */
#else
@@ -139,7 +139,7 @@ struct ip_timestamp {
u_int8_t ipt_code; /* IPOPT_TS */
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int ipt_oflw:4, /* overflow counter */
ipt_flg:4; /* flags, see below */
#else
diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h
index e977e77f8..a40248eb7 100644
--- a/slirp/slirp_config.h
+++ b/slirp/slirp_config.h
@@ -83,7 +83,7 @@
#undef HAVE_SYS_BITYPES_H
/* Define if the machine is big endian */
-//#undef WORDS_BIGENDIAN
+//#undef HOST_WORDS_BIGENDIAN
/* Define if your sprintf returns char * instead of int */
#undef BAD_SPRINTF
diff --git a/slirp/tcp.h b/slirp/tcp.h
index c65ed4342..c7e3457b7 100644
--- a/slirp/tcp.h
+++ b/slirp/tcp.h
@@ -50,7 +50,7 @@ struct tcphdr {
u_int16_t th_dport; /* destination port */
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
u_int th_off:4, /* data offset */
th_x2:4; /* (unused) */
#else
diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index 35fbaf530..f32ecd6e2 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -49,7 +49,7 @@ typedef struct \
{ \
type v1; \
} neon_##name;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define NEON_TYPE2(name, type) \
typedef struct \
{ \
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 08200edaf..6a96e9329 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -528,7 +528,7 @@ typedef union {
uint64_t q;
} MMXReg;
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define XMM_B(n) _b[15 - (n)]
#define XMM_W(n) _w[7 - (n)]
#define XMM_L(n) _l[3 - (n)]
diff --git a/target-i386/exec.h b/target-i386/exec.h
index 3e998d24f..c59c4e872 100644
--- a/target-i386/exec.h
+++ b/target-i386/exec.h
@@ -155,7 +155,7 @@ typedef union {
/* NOTE: arm is horrible as double 32 bit words are stored in big endian ! */
typedef union {
double d;
-#if !defined(WORDS_BIGENDIAN) && !defined(__arm__)
+#if !defined(HOST_WORDS_BIGENDIAN) && !defined(__arm__)
struct {
uint32_t lower;
int32_t upper;
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 380009e39..ff9398575 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -255,7 +255,7 @@ static inline void gen_op_andl_A0_ffff(void)
#endif /* !TARGET_X86_64 */
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define REG_B_OFFSET (sizeof(target_ulong) - 1)
#define REG_H_OFFSET (sizeof(target_ulong) - 2)
#define REG_W_OFFSET (sizeof(target_ulong) - 2)
@@ -7151,7 +7151,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
break;
case 4: /* smsw */
gen_svm_check_intercept(s, pc_start, SVM_EXIT_READ_CR0);
-#if defined TARGET_X86_64 && defined WORDS_BIGENDIAN
+#if defined TARGET_X86_64 && defined HOST_WORDS_BIGENDIAN
tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]) + 4);
#else
tcg_gen_ld32u_tl(cpu_T[0], cpu_env, offsetof(CPUX86State,cr[0]));
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 5115cd6fc..789176b7a 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -62,7 +62,7 @@ union fpr_t {
/* define FP_ENDIAN_IDX to access the same location
* in the fpr_t union regardless of the host endianess
*/
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
# define FP_ENDIAN_IDX 1
#else
# define FP_ENDIAN_IDX 0
diff --git a/target-ppc/kvm_ppc.c b/target-ppc/kvm_ppc.c
index 10cfdb3cf..6b7f4113c 100644
--- a/target-ppc/kvm_ppc.c
+++ b/target-ppc/kvm_ppc.c
@@ -21,7 +21,7 @@
static QEMUTimer *kvmppc_timer;
static unsigned int kvmppc_timer_rate;
-#ifdef HAVE_FDT
+#ifdef CONFIG_FDT
int kvmppc_read_host_property(const char *node_path, const char *prop,
void *val, size_t len)
{
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index c352aa71b..ad6d8ee9b 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1921,7 +1921,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
/*****************************************************************************/
/* Altivec extension helpers */
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define HI_IDX 0
#define LO_IDX 1
#else
@@ -1929,7 +1929,7 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
#define LO_IDX 0
#endif
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define VECTOR_FOR_INORDER_I(index, element) \
for (index = 0; index < ARRAY_SIZE(r->element); index++)
#else
@@ -2055,7 +2055,7 @@ STVE(stvewx, stl, bswap32, u32)
void helper_mtvscr (ppc_avr_t *r)
{
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
env->vscr = r->u32[3];
#else
env->vscr = r->u32[0];
@@ -2422,7 +2422,7 @@ void helper_vmladduhm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
} \
*r = result; \
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define MRGHI 0
#define MRGLO 1
#else
@@ -2583,7 +2583,7 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
int i;
VECTOR_FOR_INORDER_I (i, u8) {
int s = c->u8[i] & 0x1f;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
int index = s & 0xf;
#else
int index = 15 - (s & 0xf);
@@ -2597,7 +2597,7 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
*r = result;
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define PKBIG 1
#else
#define PKBIG 0
@@ -2606,7 +2606,7 @@ void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int i, j;
ppc_avr_t result;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
const ppc_avr_t *x[2] = { a, b };
#else
const ppc_avr_t *x[2] = { b, a };
@@ -2723,7 +2723,7 @@ void helper_vlogefp (ppc_avr_t *r, ppc_avr_t *b)
}
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define LEFT 0
#define RIGHT 1
#else
@@ -2783,7 +2783,7 @@ void helper_vsldoi (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift)
int i;
ppc_avr_t result;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
int index = sh + i;
if (index > 0xf) {
@@ -2809,7 +2809,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
-#if defined (WORDS_BIGENDIAN)
+#if defined (HOST_WORDS_BIGENDIAN)
memmove (&r->u8[0], &a->u8[sh], 16-sh);
memset (&r->u8[16-sh], 0, sh);
#else
@@ -2820,7 +2820,7 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
/* Experimental testing shows that hardware masks the immediate. */
#define _SPLAT_MASKED(element) (splat & (ARRAY_SIZE(r->element) - 1))
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define SPLAT_ELEMENT(element) _SPLAT_MASKED(element)
#else
#define SPLAT_ELEMENT(element) (ARRAY_SIZE(r->element)-1 - _SPLAT_MASKED(element))
@@ -2877,7 +2877,7 @@ void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
{
int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;
-#if defined (WORDS_BIGENDIAN)
+#if defined (HOST_WORDS_BIGENDIAN)
memmove (&r->u8[sh], &a->u8[0], 16-sh);
memset (&r->u8[0], 0, sh);
#else
@@ -2901,7 +2901,7 @@ void helper_vsumsws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
ppc_avr_t result;
int sat = 0;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
upper = ARRAY_SIZE(r->s32)-1;
#else
upper = 0;
@@ -2925,7 +2925,7 @@ void helper_vsum2sws (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
ppc_avr_t result;
int sat = 0;
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
upper = 1;
#else
upper = 0;
@@ -2997,7 +2997,7 @@ void helper_vsum4ubs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
}
}
-#if defined(WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN)
#define UPKHI 1
#define UPKLO 0
#else
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index da3d7de8a..58818c211 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -120,7 +120,7 @@ void ppc_translate_init(void)
cpu_reg_names_size -= (i < 10) ? 4 : 5;
snprintf(p, cpu_reg_names_size, "avr%dH", i);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
cpu_avrh[i] = tcg_global_mem_new_i64(TCG_AREG0,
offsetof(CPUState, avr[i].u64[0]), p);
#else
@@ -131,7 +131,7 @@ void ppc_translate_init(void)
cpu_reg_names_size -= (i < 10) ? 6 : 7;
snprintf(p, cpu_reg_names_size, "avr%dL", i);
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
cpu_avrl[i] = tcg_global_mem_new_i64(TCG_AREG0,
offsetof(CPUState, avr[i].u64[1]), p);
#else
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 3b6e2d504..1731d12ed 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9388,7 +9388,7 @@ static int gdb_set_float_reg(CPUState *env, uint8_t *mem_buf, int n)
static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
stq_p(mem_buf, env->avr[n].u64[0]);
stq_p(mem_buf+8, env->avr[n].u64[1]);
#else
@@ -9411,7 +9411,7 @@ static int gdb_get_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
static int gdb_set_avr_reg(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
env->avr[n].u64[0] = ldq_p(mem_buf);
env->avr[n].u64[1] = ldq_p(mem_buf+8);
#else
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 9b959fe30..0234e519e 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -385,7 +385,7 @@ void helper_faligndata(void)
*((uint64_t *)&DT0) = tmp;
}
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
#define VIS_B64(n) b[7 - (n)]
#define VIS_W64(n) w[3 - (n)]
#define VIS_SW64(n) sw[3 - (n)]
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 7ef2b898a..672373d3e 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -282,7 +282,7 @@ static inline void tcg_out_b(TCGContext *s, int cond, int32_t offset)
static inline void tcg_out_b_noaddr(TCGContext *s, int cond)
{
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
tcg_out8(s, (cond << 4) | 0x0a);
s->code_ptr += 3;
#else
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 0ba1b6a3e..93066e249 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -27,7 +27,7 @@
#include "config.h"
-#ifndef DEBUG_TCG
+#ifndef CONFIG_DEBUG_TCG
/* define it to suppress various consistency checks (faster) */
#define NDEBUG
#endif
diff --git a/tcg/tcg.h b/tcg/tcg.h
index ad0bd142a..35e6aeb6f 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -121,7 +121,7 @@ typedef tcg_target_ulong TCGArg;
are aliases for target_ulong and host pointer sized values respectively.
*/
-#ifdef DEBUG_TCG
+#ifdef CONFIG_DEBUG_TCG
#define DEBUG_TCGV 1
#endif
diff --git a/vl.c b/vl.c
index ffe6a5f77..acaa29c51 100644
--- a/vl.c
+++ b/vl.c
@@ -29,7 +29,7 @@
#include <sys/time.h>
#include <zlib.h>
-/* Needed early for HOST_BSD etc. */
+/* Needed early for CONFIG_BSD etc. */
#include "config-host.h"
/* Needed early to override system queue definitions on BSD */
#include "sys-queue.h"
@@ -56,7 +56,7 @@
#include <dirent.h>
#include <netdb.h>
#include <sys/select.h>
-#ifdef HOST_BSD
+#ifdef CONFIG_BSD
#include <sys/stat.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <libutil.h>
@@ -521,7 +521,7 @@ uint64_t muldiv64(uint64_t a, uint32_t b, uint32_t c)
union {
uint64_t ll;
struct {
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
uint32_t high, low;
#else
uint32_t low, high;
diff --git a/vnc.c b/vnc.c
index de0ff872d..dfcf34c01 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1656,7 +1656,7 @@ static void pixel_format_message (VncState *vs) {
vnc_write_u8(vs, vs->ds->surface->pf.bits_per_pixel); /* bits-per-pixel */
vnc_write_u8(vs, vs->ds->surface->pf.depth); /* depth */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
vnc_write_u8(vs, 1); /* big-endian-flag */
#else
vnc_write_u8(vs, 0); /* big-endian-flag */