summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJunfeng Dong <junfeng.dong@intel.com>2013-11-19 17:45:23 +0800
committerJunfeng Dong <junfeng.dong@intel.com>2013-11-19 17:45:23 +0800
commit340f06c9eaee097e626c251bf7a013350649c091 (patch)
tree107e5705050a12da68fc80a56ae37afd50a2cc94 /configure
parent42bf3037d458a330856a0be584200c1e41c3f417 (diff)
downloadqemu-340f06c9eaee097e626c251bf7a013350649c091.tar.gz
qemu-340f06c9eaee097e626c251bf7a013350649c091.tar.bz2
qemu-340f06c9eaee097e626c251bf7a013350649c091.zip
Import upstream 1.6.0.upstream/1.6.0
Change-Id: Icf52b556470cac8677297f2ef14ded16684f7887 Signed-off-by: Junfeng Dong <junfeng.dong@intel.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure1577
1 files changed, 954 insertions, 623 deletions
diff --git a/configure b/configure
index 994f7310b..18fa60824 100755
--- a/configure
+++ b/configure
@@ -27,6 +27,17 @@ printf " '%s'" "$0" "$@" >> config.log
echo >> config.log
echo "#" >> config.log
+error_exit() {
+ echo
+ echo "ERROR: $1"
+ while test -n "$2"; do
+ echo " $2"
+ shift
+ done
+ echo
+ exit 1
+}
+
do_cc() {
# Run the compiler, capturing its output to the log.
echo $cc "$@" >> config.log
@@ -46,11 +57,10 @@ do_cc() {
esac
echo $cc -Werror "$@" >> config.log
$cc -Werror "$@" >> config.log 2>&1 && return $?
- echo "ERROR: configure test passed without -Werror but failed with -Werror."
- echo "This is probably a bug in the configure script. The failing command"
- echo "will be at the bottom of config.log."
- echo "You can run configure with --disable-werror to bypass this check."
- exit 1
+ error_exit "configure test passed without -Werror but failed with -Werror." \
+ "This is probably a bug in the configure script. The failing command" \
+ "will be at the bottom of config.log." \
+ "You can run configure with --disable-werror to bypass this check."
}
compile_object() {
@@ -113,10 +123,9 @@ interp_prefix="/usr/gnemul/qemu-%M"
static="no"
cross_prefix=""
audio_drv_list=""
-audio_card_list="ac97 es1370 sb16 hda"
-audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda"
-block_drv_whitelist=""
-host_cc="gcc"
+block_drv_rw_whitelist=""
+block_drv_ro_whitelist=""
+host_cc="cc"
libs_softmmu=""
libs_tools=""
audio_pt_int=""
@@ -146,7 +155,6 @@ curl=""
curses=""
docs=""
fdt=""
-nptl=""
pixman=""
sdl=""
virtfs=""
@@ -158,6 +166,7 @@ vnc_tls=""
vnc_sasl=""
vnc_jpeg=""
vnc_png=""
+vnc_ws=""
xen=""
xen_ctrl_version=""
xen_pci_passthrough=""
@@ -168,7 +177,9 @@ libattr=""
xfs=""
vhost_net="no"
+vhost_scsi="no"
kvm="no"
+rdma=""
gprof="no"
debug_tcg="no"
debug="no"
@@ -176,6 +187,8 @@ strip_opt="yes"
tcg_interpreter="no"
bigendian="no"
mingw32="no"
+gcov="no"
+gcov_tool="gcov"
EXESUF=""
prefix="/usr/local"
mandir="\${prefix}/share/man"
@@ -208,21 +221,28 @@ blobs="yes"
pkgversion=""
pie=""
zero_malloc=""
+qom_cast_debug="yes"
trace_backend="nop"
trace_file="trace"
spice=""
rbd=""
-smartcard=""
smartcard_nss=""
+libusb=""
usb_redir=""
-opengl=""
+glx=""
zlib="yes"
-guest_agent="yes"
+guest_agent=""
want_tools="yes"
libiscsi=""
coroutine=""
seccomp=""
glusterfs=""
+glusterfs_discard="no"
+virtio_blk_data_plane=""
+gtk=""
+gtkabi="2.0"
+tpm="no"
+libssh2=""
# parse CC options first
for opt do
@@ -237,8 +257,10 @@ for opt do
--cpu=*) cpu="$optarg"
;;
--extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
+ EXTRA_CFLAGS="$optarg"
;;
--extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
+ EXTRA_LDFLAGS="$optarg"
;;
--enable-debug-info) debug_info="yes"
;;
@@ -250,8 +272,19 @@ done
# Using uname is really, really broken. Once we have the right set of checks
# we can eliminate its usage altogether.
-cc="${CC-${cross_prefix}gcc}"
+# Preferred compiler:
+# ${CC} (if set)
+# ${cross_prefix}gcc (if cross-prefix specified)
+# system compiler
+if test -z "${CC}${cross_prefix}"; then
+ cc="$host_cc"
+else
+ cc="${CC-${cross_prefix}gcc}"
+fi
+
ar="${AR-${cross_prefix}ar}"
+as="${AS-${cross_prefix}as}"
+cpp="${CPP-$cc -E}"
objcopy="${OBJCOPY-${cross_prefix}objcopy}"
ld="${LD-${cross_prefix}ld}"
libtool="${LIBTOOL-${cross_prefix}libtool}"
@@ -269,7 +302,7 @@ QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
-QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
+QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include"
if test "$debug_info" = "yes"; then
CFLAGS="-g $CFLAGS"
LDFLAGS="-g $LDFLAGS"
@@ -354,6 +387,8 @@ elif check_define __s390__ ; then
fi
elif check_define __arm__ ; then
cpu="arm"
+elif check_define __aarch64__ ; then
+ cpu="aarch64"
elif check_define __hppa__ ; then
cpu="hppa"
else
@@ -376,6 +411,9 @@ case "$cpu" in
armv*b|armv*l|arm)
cpu="arm"
;;
+ aarch64)
+ cpu="aarch64"
+ ;;
hppa|parisc|parisc64)
cpu="hppa"
;;
@@ -437,9 +475,8 @@ NetBSD)
OpenBSD)
bsd="yes"
make="${MAKE-gmake}"
- audio_drv_list="oss"
- audio_possible_drivers="oss sdl esd"
- oss_lib="-lossaudio"
+ audio_drv_list="sdl"
+ audio_possible_drivers="sdl esd"
;;
Darwin)
bsd="yes"
@@ -475,11 +512,10 @@ SunOS)
LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
LIBS="-lsunmath $LIBS"
else
- echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
- echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
- echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
- echo "Studio 11 can be downloaded from www.sun.com."
- exit 1
+ error_exit "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" \
+ "libsunmath from the Sun Studio compilers tools, due to a lack of" \
+ "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" \
+ "Studio 11 can be downloaded from www.sun.com."
fi
fi
fi
@@ -513,15 +549,19 @@ Haiku)
usb="linux"
kvm="yes"
vhost_net="yes"
+ vhost_scsi="yes"
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
audio_possible_drivers="$audio_possible_drivers fmod"
fi
+ QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES"
;;
esac
if [ "$bsd" = "yes" ] ; then
if [ "$darwin" != "yes" ] ; then
- usb="bsd"
+ if [ "$targetos" != "FreeBSD" ]; then
+ usb="bsd"
+ fi
bsd_user="yes"
fi
fi
@@ -556,7 +596,7 @@ EOF
qemu_docdir="\${prefix}"
bindir="\${prefix}"
sysconfdir="\${prefix}"
- local_statedir="\${prefix}"
+ local_statedir=
confsuffix=""
libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga"
fi
@@ -590,6 +630,8 @@ for opt do
;;
--python=*) python="$optarg"
;;
+ --gcov=*) gcov_tool="$optarg"
+ ;;
--smbd=*) smbd="$optarg"
;;
--extra-cflags=*)
@@ -610,6 +652,8 @@ for opt do
;;
--enable-gprof) gprof="yes"
;;
+ --enable-gcov) gcov="yes"
+ ;;
--static)
static="yes"
LDFLAGS="-static $LDFLAGS"
@@ -647,10 +691,16 @@ for opt do
;;
--without-system-pixman) pixman="internal"
;;
+ --without-pixman) pixman="none"
+ ;;
--disable-sdl) sdl="no"
;;
--enable-sdl) sdl="yes"
;;
+ --disable-qom-cast-debug) qom_cast_debug="no"
+ ;;
+ --enable-qom-cast-debug) qom_cast_debug="yes"
+ ;;
--disable-virtfs) virtfs="no"
;;
--enable-virtfs) virtfs="yes"
@@ -665,11 +715,11 @@ for opt do
;;
--oss-lib=*) oss_lib="$optarg"
;;
- --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
- ;;
--audio-drv-list=*) audio_drv_list="$optarg"
;;
- --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
+ --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
+ ;;
+ --block-drv-ro-whitelist=*) block_drv_ro_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
;;
--enable-debug-tcg) debug_tcg="yes"
;;
@@ -703,6 +753,10 @@ for opt do
;;
--enable-vnc-png) vnc_png="yes"
;;
+ --disable-vnc-ws) vnc_ws="no"
+ ;;
+ --enable-vnc-ws) vnc_ws="yes"
+ ;;
--disable-slirp) slirp="no"
;;
--disable-uuid) uuid="no"
@@ -801,10 +855,6 @@ for opt do
;;
--enable-fdt) fdt="yes"
;;
- --disable-nptl) nptl="no"
- ;;
- --enable-nptl) nptl="yes"
- ;;
--enable-mixemu) mixemu="yes"
;;
--disable-linux-aio) linux_aio="no"
@@ -829,9 +879,13 @@ for opt do
;;
--enable-vhost-net) vhost_net="yes"
;;
- --disable-opengl) opengl="no"
+ --disable-vhost-scsi) vhost_scsi="no"
;;
- --enable-opengl) opengl="yes"
+ --enable-vhost-scsi) vhost_scsi="yes"
+ ;;
+ --disable-glx) glx="no"
+ ;;
+ --enable-glx) glx="yes"
;;
--disable-rbd) rbd="no"
;;
@@ -841,14 +895,14 @@ for opt do
;;
--enable-xfsctl) xfs="yes"
;;
- --disable-smartcard) smartcard="no"
- ;;
- --enable-smartcard) smartcard="yes"
- ;;
--disable-smartcard-nss) smartcard_nss="no"
;;
--enable-smartcard-nss) smartcard_nss="yes"
;;
+ --disable-libusb) libusb="no"
+ ;;
+ --enable-libusb) libusb="yes"
+ ;;
--disable-usb-redir) usb_redir="no"
;;
--enable-usb-redir) usb_redir="yes"
@@ -871,6 +925,26 @@ for opt do
;;
--enable-glusterfs) glusterfs="yes"
;;
+ --disable-virtio-blk-data-plane) virtio_blk_data_plane="no"
+ ;;
+ --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes"
+ ;;
+ --disable-gtk) gtk="no"
+ ;;
+ --enable-gtk) gtk="yes"
+ ;;
+ --enable-rdma) rdma="yes"
+ ;;
+ --disable-rdma) rdma="no"
+ ;;
+ --with-gtkabi=*) gtkabi="$optarg"
+ ;;
+ --enable-tpm) tpm="yes"
+ ;;
+ --disable-libssh2) libssh2="no"
+ ;;
+ --enable-libssh2) libssh2="yes"
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
@@ -879,102 +953,54 @@ done
case "$cpu" in
sparc)
LDFLAGS="-m32 $LDFLAGS"
- QEMU_CFLAGS="-m32 -mcpu=ultrasparc $QEMU_CFLAGS"
+ CPU_CFLAGS="-m32 -mcpu=ultrasparc"
;;
sparc64)
LDFLAGS="-m64 $LDFLAGS"
- QEMU_CFLAGS="-m64 -mcpu=ultrasparc $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64 -mcpu=ultrasparc"
;;
s390)
- QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m31 -march=z990"
LDFLAGS="-m31 $LDFLAGS"
;;
s390x)
- QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64 -march=z990"
LDFLAGS="-m64 $LDFLAGS"
;;
i386)
- QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m32"
LDFLAGS="-m32 $LDFLAGS"
cc_i386='$(CC) -m32'
;;
x86_64)
- QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
+ CPU_CFLAGS="-m64"
LDFLAGS="-m64 $LDFLAGS"
cc_i386='$(CC) -m32'
;;
# No special flags required for other host CPUs
esac
+QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS"
+EXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS"
+
default_target_list=""
-# these targets are portable
-if [ "$softmmu" = "yes" ] ; then
- default_target_list="\
-i386-softmmu \
-x86_64-softmmu \
-alpha-softmmu \
-arm-softmmu \
-cris-softmmu \
-lm32-softmmu \
-m68k-softmmu \
-microblaze-softmmu \
-microblazeel-softmmu \
-mips-softmmu \
-mipsel-softmmu \
-mips64-softmmu \
-mips64el-softmmu \
-or32-softmmu \
-ppc-softmmu \
-ppcemb-softmmu \
-ppc64-softmmu \
-sh4-softmmu \
-sh4eb-softmmu \
-sparc-softmmu \
-sparc64-softmmu \
-s390x-softmmu \
-xtensa-softmmu \
-xtensaeb-softmmu \
-unicore32-softmmu \
-"
-fi
-# the following are Linux specific
-if [ "$linux_user" = "yes" ] ; then
- default_target_list="${default_target_list}\
-i386-linux-user \
-x86_64-linux-user \
-alpha-linux-user \
-arm-linux-user \
-armeb-linux-user \
-cris-linux-user \
-m68k-linux-user \
-microblaze-linux-user \
-microblazeel-linux-user \
-mips-linux-user \
-mipsel-linux-user \
-or32-linux-user \
-ppc-linux-user \
-ppc64-linux-user \
-ppc64abi32-linux-user \
-sh4-linux-user \
-sh4eb-linux-user \
-sparc-linux-user \
-sparc64-linux-user \
-sparc32plus-linux-user \
-unicore32-linux-user \
-s390x-linux-user \
-"
-fi
-# the following are BSD specific
-if [ "$bsd_user" = "yes" ] ; then
- default_target_list="${default_target_list}\
-i386-bsd-user \
-x86_64-bsd-user \
-sparc-bsd-user \
-sparc64-bsd-user \
-"
+mak_wilds=""
+
+if [ "$softmmu" = "yes" ]; then
+ mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak"
+fi
+if [ "$linux_user" = "yes" ]; then
+ mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak"
+fi
+if [ "$bsd_user" = "yes" ]; then
+ mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak"
fi
+for config in $mak_wilds; do
+ default_target_list="${default_target_list} $(basename "$config" .mak)"
+done
+
if test x"$show_help" = x"yes" ; then
cat << EOF
@@ -1009,11 +1035,14 @@ echo " --mandir=PATH install man pages in PATH"
echo " --datadir=PATH install firmware in PATH$confsuffix"
echo " --docdir=PATH install documentation in PATH$confsuffix"
echo " --bindir=PATH install binaries in PATH"
+echo " --libdir=PATH install libraries in PATH"
echo " --sysconfdir=PATH install config in PATH$confsuffix"
-echo " --localstatedir=PATH install local state in PATH"
+echo " --localstatedir=PATH install local state in PATH (set at runtime on win32)"
echo " --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]"
echo " --enable-debug-tcg enable TCG debugging"
echo " --disable-debug-tcg disable TCG debugging (default)"
+echo " --enable-debug-info enable debugging information (default)"
+echo " --disable-debug-info disable debugging information"
echo " --enable-debug enable common debug build options"
echo " --enable-sparse enable sparse checker"
echo " --disable-sparse disable sparse checker (default)"
@@ -1021,6 +1050,8 @@ echo " --disable-strip disable stripping binaries"
echo " --disable-werror disable compilation abort on warning"
echo " --disable-sdl disable SDL"
echo " --enable-sdl enable SDL"
+echo " --disable-gtk disable gtk UI"
+echo " --enable-gtk enable gtk UI"
echo " --disable-virtfs disable VirtFS"
echo " --enable-virtfs enable VirtFS"
echo " --disable-vnc disable VNC"
@@ -1029,9 +1060,12 @@ echo " --disable-cocoa disable Cocoa (Mac OS X only)"
echo " --enable-cocoa enable Cocoa (default on Mac OS X)"
echo " --audio-drv-list=LIST set audio drivers list:"
echo " Available drivers: $audio_possible_drivers"
-echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
-echo " Available cards: $audio_possible_cards"
-echo " --block-drv-whitelist=L set block driver whitelist"
+echo " --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L"
+echo " --block-drv-rw-whitelist=L"
+echo " set block driver read-write whitelist"
+echo " (affects only QEMU, not qemu-img)"
+echo " --block-drv-ro-whitelist=L"
+echo " set block driver read-only whitelist"
echo " (affects only QEMU, not qemu-img)"
echo " --enable-mixemu enable mixer emulation"
echo " --disable-xen disable xen backend driver support"
@@ -1048,6 +1082,8 @@ echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server"
echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server"
echo " --disable-vnc-png disable PNG compression for VNC server (default)"
echo " --enable-vnc-png enable PNG compression for VNC server"
+echo " --disable-vnc-ws disable Websockets support for VNC server"
+echo " --enable-vnc-ws enable Websockets support for VNC server"
echo " --disable-curses disable curses output"
echo " --enable-curses enable curses output"
echo " --disable-curl disable curl connectivity"
@@ -1059,9 +1095,9 @@ echo " --enable-bluez enable bluez stack connectivity"
echo " --disable-slirp disable SLIRP userspace network connectivity"
echo " --disable-kvm disable KVM acceleration support"
echo " --enable-kvm enable KVM acceleration support"
+echo " --disable-rdma disable RDMA-based migration support"
+echo " --enable-rdma enable RDMA-based migration support"
echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
-echo " --disable-nptl disable usermode NPTL support"
-echo " --enable-nptl enable usermode NPTL support"
echo " --enable-system enable all system emulation targets"
echo " --disable-system disable all system emulation targets"
echo " --enable-user enable supported user emulation targets"
@@ -1080,7 +1116,6 @@ echo " --fmod-inc path to FMOD includes"
echo " --oss-lib path to OSS library"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
echo " --cpu=CPU Build for host CPU [$cpu]"
-echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
echo " --disable-uuid disable uuid support"
echo " --enable-uuid enable uuid support"
echo " --disable-vde disable support for vde network"
@@ -1105,10 +1140,10 @@ echo " --enable-spice enable spice"
echo " --enable-rbd enable building the rados block device (rbd)"
echo " --disable-libiscsi disable iscsi support"
echo " --enable-libiscsi enable iscsi support"
-echo " --disable-smartcard disable smartcard support"
-echo " --enable-smartcard enable smartcard support"
echo " --disable-smartcard-nss disable smartcard nss support"
echo " --enable-smartcard-nss enable smartcard nss support"
+echo " --disable-libusb disable libusb (for usb passthrough)"
+echo " --enable-libusb enable libusb (for usb passthrough)"
echo " --disable-usb-redir disable usb network redirection support"
echo " --enable-usb-redir enable usb network redirection support"
echo " --disable-guest-agent disable building of the QEMU Guest Agent"
@@ -1119,6 +1154,11 @@ echo " --with-coroutine=BACKEND coroutine backend. Supported options:"
echo " gthread, ucontext, sigaltstack, windows"
echo " --enable-glusterfs enable GlusterFS backend"
echo " --disable-glusterfs disable GlusterFS backend"
+echo " --enable-gcov enable test coverage analysis with gcov"
+echo " --gcov=GCOV use specified gcov [$gcov_tool]"
+echo " --enable-tpm enable TPM support"
+echo " --disable-libssh2 disable ssh block device support"
+echo " --enable-libssh2 enable ssh block device support"
echo ""
echo "NOTE: The object files are built at the place where configure is launched"
exit 1
@@ -1131,8 +1171,7 @@ if test "$ARCH" = "unknown"; then
echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)"
ARCH=tci
else
- echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter"
- exit 1
+ error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter"
fi
fi
@@ -1144,8 +1183,7 @@ EOF
if compile_object ; then
: C compiler works ok
else
- echo "ERROR: \"$cc\" either does not exist or does not work"
- exit 1
+ error_exit "\"$cc\" either does not exist or does not work"
fi
# Consult white-list to determine whether to enable werror
@@ -1153,7 +1191,7 @@ fi
z_version=`cut -f3 -d. $source_path/VERSION`
if test -z "$werror" ; then
- if test "$z_version" = "50" -a \
+ if test -d "$source_path/.git" -a \
"$linux" = "yes" ; then
werror="yes"
else
@@ -1164,7 +1202,7 @@ fi
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
-gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
+gcc_flags="-Wendif-labels $gcc_flags"
gcc_flags="-Wno-initializer-overrides $gcc_flags"
# Note that we do not add -Werror to gcc_flags here, because that would
# enable it for all configure tests. If a configure test failed due
@@ -1183,6 +1221,11 @@ for flag in $gcc_flags; do
fi
done
+if compile_prog "-Werror -fstack-protector-all" "" ; then
+ QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all"
+ LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all"
+fi
+
# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and
# large functions that use global variables. The bug is in all releases of
# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in
@@ -1200,8 +1243,7 @@ fi
if test "$static" = "yes" ; then
if test "$pie" = "yes" ; then
- echo "static and pie are mutually incompatible"
- exit 1
+ error_exit "static and pie are mutually incompatible"
else
pie="no"
fi
@@ -1240,8 +1282,7 @@ EOF
fi
else
if test "$pie" = "yes"; then
- echo "PIE not available due to missing toolchain support"
- exit 1
+ error_exit "PIE not available due to missing toolchain support"
else
echo "Disabling PIE due to missing toolchain support"
pie="no"
@@ -1249,47 +1290,68 @@ EOF
fi
fi
-#
+##########################################
+# __sync_fetch_and_and requires at least -march=i486. Many toolchains
+# use i686 as default anyway, but for those that don't, an explicit
+# specification is necessary
+
+if test "$cpu" = "i386"; then
+ cat > $TMPC << EOF
+static int sfaa(int *ptr)
+{
+ return __sync_fetch_and_and(ptr, 0);
+}
+
+int main(void)
+{
+ int val = 42;
+ val = __sync_val_compare_and_swap(&val, 0, 1);
+ sfaa(&val);
+ return val;
+}
+EOF
+ if ! compile_prog "" "" ; then
+ QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS"
+ fi
+fi
+
+#########################################
# Solaris specific configure tool chain decisions
-#
+
if test "$solaris" = "yes" ; then
if has $install; then
:
else
- echo "Solaris install program not found. Use --install=/usr/ucb/install or"
- echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
- echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
- exit 1
+ error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \
+ "install fileutils from www.blastwave.org using pkg-get -i fileutils" \
+ "to get ginstall which is used by default (which lives in /opt/csw/bin)"
fi
if test "`path_of $install`" = "/usr/sbin/install" ; then
- echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
- echo "try ginstall from the GNU fileutils available from www.blastwave.org"
- echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
- exit 1
+ error_exit "Solaris /usr/sbin/install is not an appropriate install program." \
+ "try ginstall from the GNU fileutils available from www.blastwave.org" \
+ "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
fi
if has ar; then
:
else
- echo "Error: No path includes ar"
if test -f /usr/ccs/bin/ar ; then
- echo "Add /usr/ccs/bin to your path and rerun configure"
+ error_exit "No path includes ar" \
+ "Add /usr/ccs/bin to your path and rerun configure"
fi
- exit 1
+ error_exit "No path includes ar"
fi
fi
if ! has $python; then
- echo "Python not found. Use --python=/path/to/python"
- exit 1
+ error_exit "Python not found. Use --python=/path/to/python"
fi
# Note that if the Python conditional here evaluates True we will exit
# with status 1 which is a shell 'false' value.
if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then
- echo "Cannot use '$python', Python 2.4 or later is required."
- echo "Note that Python 3 or later is not yet supported."
- echo "Use --python=/path/to/python to specify a supported Python."
- exit 1
+ error_exit "Cannot use '$python', Python 2.4 or later is required." \
+ "Note that Python 3 or later is not yet supported." \
+ "Use --python=/path/to/python to specify a supported Python."
fi
if test -z "${target_list+xxx}" ; then
@@ -1297,6 +1359,19 @@ if test -z "${target_list+xxx}" ; then
else
target_list=`echo "$target_list" | sed -e 's/,/ /g'`
fi
+
+# Check that we recognised the target name; this allows a more
+# friendly error message than if we let it fall through.
+for target in $target_list; do
+ case " $default_target_list " in
+ *" $target "*)
+ ;;
+ *)
+ error_exit "Unknown target name '$target'"
+ ;;
+ esac
+done
+
# see if system emulation was really requested
case " $target_list " in
*"-softmmu "*) softmmu=yes
@@ -1308,11 +1383,8 @@ esac
feature_not_found() {
feature=$1
- echo "ERROR"
- echo "ERROR: User requested feature $feature"
- echo "ERROR: configure was not able to find it"
- echo "ERROR"
- exit 1;
+ error_exit "User requested feature $feature" \
+ "configure was not able to find it"
}
if test -z "$cross_prefix" ; then
@@ -1351,9 +1423,16 @@ esac
fi
##########################################
+# pkg-config probe
+
+if ! has "$pkg_config_exe"; then
+ error_exit "pkg-config binary '$pkg_config_exe' not found"
+fi
+
+##########################################
# NPTL probe
-if test "$nptl" != "no" ; then
+if test "$linux_user" = "yes"; then
cat > $TMPC <<EOF
#include <sched.h>
#include <linux/futex.h>
@@ -1364,14 +1443,8 @@ int main(void) {
return 0;
}
EOF
-
- if compile_object ; then
- nptl=yes
- else
- if test "$nptl" = "yes" ; then
- feature_not_found "nptl"
- fi
- nptl=no
+ if ! compile_object ; then
+ feature_not_found "nptl"
fi
fi
@@ -1386,20 +1459,19 @@ EOF
if compile_prog "" "-lz" ; then
:
else
- echo
- echo "Error: zlib check failed"
- echo "Make sure to have the zlib libs and headers installed."
- echo
- exit 1
+ error_exit "zlib check failed" \
+ "Make sure to have the zlib libs and headers installed."
fi
fi
+libs_softmmu="$libs_softmmu -lz"
##########################################
# libseccomp check
if test "$seccomp" != "no" ; then
- if $pkg_config --atleast-version=1.0.0 libseccomp --modversion >/dev/null 2>&1; then
- LIBS=`$pkg_config --libs libseccomp`
+ if $pkg_config --atleast-version=2.1.0 libseccomp --modversion >/dev/null 2>&1; then
+ libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`"
+ QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`"
seccomp="yes"
else
if test "$seccomp" = "yes"; then
@@ -1567,34 +1639,32 @@ if test "$xen_pci_passthrough" != "no"; then
xen_pci_passthrough=yes
else
if test "$xen_pci_passthrough" = "yes"; then
- echo "ERROR"
- echo "ERROR: User requested feature Xen PCI Passthrough"
- echo "ERROR: but this feature require /sys from Linux"
if test "$xen_ctrl_version" -lt 340; then
- echo "ERROR: This feature does not work with Xen 3.3"
+ error_exit "User requested feature Xen PCI Passthrough" \
+ "This feature does not work with Xen 3.3"
fi
- echo "ERROR"
- exit 1;
+ error_exit "User requested feature Xen PCI Passthrough" \
+ " but this feature requires /sys from Linux"
fi
xen_pci_passthrough=no
fi
fi
##########################################
-# pkg-config probe
-
-if ! has "$pkg_config_exe"; then
- echo "Error: pkg-config binary '$pkg_config_exe' not found"
- exit 1
-fi
-
-##########################################
# libtool probe
if ! has $libtool; then
libtool=
fi
+# MacOSX ships with a libtool which isn't the GNU one; weed this
+# out by checking whether libtool supports the --version switch
+if test -n "$libtool"; then
+ if ! "$libtool" --version >/dev/null 2>&1; then
+ libtool=
+ fi
+fi
+
##########################################
# Sparse probe
if test "$sparse" != "no" ; then
@@ -1609,6 +1679,40 @@ if test "$sparse" != "no" ; then
fi
##########################################
+# GTK probe
+
+if test "$gtk" != "no"; then
+ gtkpackage="gtk+-$gtkabi"
+ if test "$gtkabi" = "3.0" ; then
+ gtkversion="3.0.0"
+ vtepackage="vte-2.90"
+ vteversion="0.32.0"
+ else
+ gtkversion="2.18.0"
+ vtepackage="vte"
+ vteversion="0.24.0"
+ fi
+ if ! $pkg_config --exists "$gtkpackage >= $gtkversion"; then
+ if test "$gtk" = "yes" ; then
+ feature_not_found "gtk"
+ fi
+ gtk="no"
+ elif ! $pkg_config --exists "$vtepackage >= $vteversion"; then
+ if test "$gtk" = "yes" ; then
+ error_exit "libvte not found (required for gtk support)"
+ fi
+ gtk="no"
+ else
+ gtk_cflags=`$pkg_config --cflags $gtkpackage 2>/dev/null`
+ gtk_libs=`$pkg_config --libs $gtkpackage 2>/dev/null`
+ vte_cflags=`$pkg_config --cflags $vtepackage 2>/dev/null`
+ vte_libs=`$pkg_config --libs $vtepackage 2>/dev/null`
+ libs_softmmu="$gtk_libs $vte_libs $libs_softmmu"
+ gtk="yes"
+ fi
+fi
+
+##########################################
# SDL probe
# Look for sdl configuration program (pkg-config or sdl-config). Try
@@ -1692,8 +1796,32 @@ EOF
fi
##########################################
-# VNC TLS detection
-if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then
+# RDMA needs OpenFabrics libraries
+if test "$rdma" != "no" ; then
+ cat > $TMPC <<EOF
+#include <rdma/rdma_cma.h>
+int main(void) { return 0; }
+EOF
+ rdma_libs="-lrdmacm -libverbs"
+ if compile_prog "" "$rdma_libs" ; then
+ rdma="yes"
+ libs_softmmu="$libs_softmmu $rdma_libs"
+ else
+ if test "$rdma" = "yes" ; then
+ error_exit \
+ " OpenFabrics librdmacm/libibverbs not present." \
+ " Your options:" \
+ " (1) Fast: Install infiniband packages from your distro." \
+ " (2) Cleanest: Install libraries from www.openfabrics.org" \
+ " (3) Also: Install softiwarp if you don't have RDMA hardware"
+ fi
+ rdma="no"
+ fi
+fi
+
+##########################################
+# VNC TLS/WS detection
+if test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then
cat > $TMPC <<EOF
#include <gnutls/gnutls.h>
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
@@ -1701,13 +1829,23 @@ EOF
vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null`
vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null`
if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then
- vnc_tls=yes
+ if test "$vnc_tls" != "no" ; then
+ vnc_tls=yes
+ fi
+ if test "$vnc_ws" != "no" ; then
+ vnc_ws=yes
+ fi
libs_softmmu="$vnc_tls_libs $libs_softmmu"
+ QEMU_CFLAGS="$QEMU_CFLAGS $vnc_tls_cflags"
else
if test "$vnc_tls" = "yes" ; then
feature_not_found "vnc-tls"
fi
+ if test "$vnc_ws" = "yes" ; then
+ feature_not_found "vnc-ws"
+ fi
vnc_tls=no
+ vnc_ws=no
fi
fi
@@ -1725,6 +1863,7 @@ EOF
if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
vnc_sasl=yes
libs_softmmu="$vnc_sasl_libs $libs_softmmu"
+ QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags"
else
if test "$vnc_sasl" = "yes" ; then
feature_not_found "vnc-sasl"
@@ -1746,6 +1885,7 @@ EOF
if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
vnc_jpeg=yes
libs_softmmu="$vnc_jpeg_libs $libs_softmmu"
+ QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags"
else
if test "$vnc_jpeg" = "yes" ; then
feature_not_found "vnc-jpeg"
@@ -1803,6 +1943,8 @@ fi
##########################################
# uuid_generate() probe, used for vdi block driver
+# Note that on some systems (notably MacOSX) no extra library
+# need be linked to get the uuid functions.
if test "$uuid" != "no" ; then
uuid_libs="-luuid"
cat > $TMPC << EOF
@@ -1814,7 +1956,9 @@ int main(void)
return 0;
}
EOF
- if compile_prog "" "$uuid_libs" ; then
+ if compile_prog "" "" ; then
+ uuid="yes"
+ elif compile_prog "" "$uuid_libs" ; then
uuid="yes"
libs_softmmu="$uuid_libs $libs_softmmu"
libs_tools="$uuid_libs $libs_tools"
@@ -1914,11 +2058,8 @@ EOF
if compile_prog "$cfl" "$lib" ; then
:
else
- echo
- echo "Error: $drv check failed"
- echo "Make sure to have the $drv libs and headers installed."
- echo
- exit 1
+ error_exit "$drv check failed" \
+ "Make sure to have the $drv libs and headers installed."
fi
}
@@ -1933,11 +2074,8 @@ for drv in $audio_drv_list; do
fmod)
if test -z $fmod_lib || test -z $fmod_inc; then
- echo
- echo "Error: You must specify path to FMOD library and headers"
- echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
- echo
- exit 1
+ error_exit "You must specify path to FMOD library and headers" \
+ "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
fi
audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
libs_softmmu="$fmod_lib $libs_softmmu"
@@ -1980,11 +2118,8 @@ for drv in $audio_drv_list; do
*)
echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
- echo
- echo "Error: Unknown driver '$drv' selected"
- echo "Possible drivers are: $audio_possible_drivers"
- echo
- exit 1
+ error_exit "Unknown driver '$drv' selected" \
+ "Possible drivers are: $audio_possible_drivers"
}
;;
esac
@@ -2013,13 +2148,12 @@ fi
##########################################
# curses probe
-if test "$mingw32" = "yes" ; then
- curses_list="-lpdcurses"
-else
- curses_list="-lncurses -lcurses"
-fi
-
if test "$curses" != "no" ; then
+ if test "$mingw32" = "yes" ; then
+ curses_list="-lpdcurses"
+ else
+ curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses"
+ fi
curses_found=no
cat > $TMPC << EOF
#include <curses.h>
@@ -2029,13 +2163,16 @@ int main(void) {
return s != 0;
}
EOF
+ IFS=:
for curses_lib in $curses_list; do
+ unset IFS
if compile_prog "" "$curses_lib" ; then
curses_found=yes
libs_softmmu="$curses_lib $libs_softmmu"
break
fi
done
+ unset IFS
if test "$curses_found" = "yes" ; then
curses=yes
else
@@ -2048,14 +2185,12 @@ fi
##########################################
# curl probe
-
-if $pkg_config libcurl --modversion >/dev/null 2>&1; then
- curlconfig="$pkg_config libcurl"
-else
- curlconfig=curl-config
-fi
-
if test "$curl" != "no" ; then
+ if $pkg_config libcurl --modversion >/dev/null 2>&1; then
+ curlconfig="$pkg_config libcurl"
+ else
+ curlconfig=curl-config
+ fi
cat > $TMPC << EOF
#include <curl/curl.h>
int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
@@ -2110,31 +2245,40 @@ then
LIBS="$glib_libs $LIBS"
libs_qga="$glib_libs $libs_qga"
else
- echo "glib-$glib_req_ver required to compile QEMU"
- exit 1
+ error_exit "glib-$glib_req_ver required to compile QEMU"
fi
##########################################
# pixman support probe
if test "$pixman" = ""; then
- if $pkg_config pixman-1 > /dev/null 2>&1; then
+ if test "$want_tools" = "no" -a "$softmmu" = "no"; then
+ pixman="none"
+ elif $pkg_config pixman-1 > /dev/null 2>&1; then
pixman="system"
else
pixman="internal"
fi
fi
-if test "$pixman" = "system"; then
+if test "$pixman" = "none"; then
+ if test "$want_tools" != "no" -o "$softmmu" != "no"; then
+ error_exit "pixman disabled but system emulation or tools build" \
+ "enabled. You can turn off pixman only if you also" \
+ "disable all system emulation targets and the tools" \
+ "build with '--disable-tools --disable-system'."
+ fi
+ pixman_cflags=
+ pixman_libs=
+elif test "$pixman" = "system"; then
pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null`
pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null`
else
if test ! -d ${source_path}/pixman/pixman; then
- echo "ERROR: pixman not present. Your options:"
- echo " (1) Prefered: Install the pixman devel package (any recent"
- echo " distro should have packages as Xorg needs pixman too)."
- echo " (2) Fetch the pixman submodule, using:"
- echo " git submodule update --init pixman"
- exit 1
+ error_exit "pixman not present. Your options:" \
+ " (1) Preferred: Install the pixman devel package (any recent" \
+ " distro should have packages as Xorg needs pixman too)." \
+ " (2) Fetch the pixman submodule, using:" \
+ " git submodule update --init pixman"
fi
mkdir -p pixman/pixman
pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman"
@@ -2193,11 +2337,8 @@ else
fi
if test "$mingw32" != yes -a "$pthread" = no; then
- echo
- echo "Error: pthread check failed"
- echo "Make sure to have the pthread libs and headers installed."
- echo
- exit 1
+ error_exit "pthread check failed" \
+ "Make sure to have the pthread libs and headers installed."
fi
##########################################
@@ -2226,6 +2367,51 @@ EOF
fi
##########################################
+# libssh2 probe
+min_libssh2_version=1.2.8
+if test "$libssh2" != "no" ; then
+ if $pkg_config --atleast-version=$min_libssh2_version libssh2 >/dev/null 2>&1
+ then
+ libssh2_cflags=`$pkg_config libssh2 --cflags`
+ libssh2_libs=`$pkg_config libssh2 --libs`
+ libssh2=yes
+ libs_tools="$libssh2_libs $libs_tools"
+ libs_softmmu="$libssh2_libs $libs_softmmu"
+ QEMU_CFLAGS="$QEMU_CFLAGS $libssh2_cflags"
+ else
+ if test "$libssh2" = "yes" ; then
+ error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2"
+ fi
+ libssh2=no
+ fi
+fi
+
+##########################################
+# libssh2_sftp_fsync probe
+
+if test "$libssh2" = "yes"; then
+ cat > $TMPC <<EOF
+#include <stdio.h>
+#include <libssh2.h>
+#include <libssh2_sftp.h>
+int main(void) {
+ LIBSSH2_SESSION *session;
+ LIBSSH2_SFTP *sftp;
+ LIBSSH2_SFTP_HANDLE *sftp_handle;
+ session = libssh2_session_init ();
+ sftp = libssh2_sftp_init (session);
+ sftp_handle = libssh2_sftp_open (sftp, "/", 0, 0);
+ libssh2_sftp_fsync (sftp_handle);
+ return 0;
+}
+EOF
+ # libssh2_cflags/libssh2_libs defined in previous test.
+ if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then
+ QEMU_CFLAGS="-DHAS_LIBSSH2_SFTP_FSYNC $QEMU_CFLAGS"
+ fi
+fi
+
+##########################################
# linux-aio probe
if test "$linux_aio" != "no" ; then
@@ -2248,6 +2434,25 @@ EOF
fi
##########################################
+# TPM passthrough is only on x86 Linux
+
+if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then
+ tpm_passthrough=$tpm
+else
+ tpm_passthrough=no
+fi
+
+##########################################
+# adjust virtio-blk-data-plane based on linux-aio
+
+if test "$virtio_blk_data_plane" = "yes" -a \
+ "$linux_aio" != "yes" ; then
+ error_exit "virtio-blk-data-plane requires Linux AIO, please try --enable-linux-aio"
+elif test -z "$virtio_blk_data_plane" ; then
+ virtio_blk_data_plane=$linux_aio
+fi
+
+##########################################
# attr probe
if test "$attr" != "no" ; then
@@ -2304,89 +2509,104 @@ fi
##########################################
# fdt probe
+# fdt support is mandatory for at least some target architectures,
+# so insist on it if we're building those system emulators.
+fdt_required=no
+for target in $target_list; do
+ case $target in
+ arm*-softmmu|ppc*-softmmu|microblaze*-softmmu)
+ fdt_required=yes
+ ;;
+ esac
+done
+
+if test "$fdt_required" = "yes"; then
+ if test "$fdt" = "no"; then
+ error_exit "fdt disabled but some requested targets require it." \
+ "You can turn off fdt only if you also disable all the system emulation" \
+ "targets which need it (by specifying a cut down --target-list)."
+ fi
+ fdt=yes
+fi
+
if test "$fdt" != "no" ; then
fdt_libs="-lfdt"
+ # explicitly check for libfdt_env.h as it is missing in some stable installs
cat > $TMPC << EOF
+#include <libfdt_env.h>
int main(void) { return 0; }
EOF
if compile_prog "" "$fdt_libs" ; then
+ # system DTC is good - use it
fdt=yes
- else
- if test "$fdt" = "yes" ; then
- feature_not_found "fdt"
+ elif test -d ${source_path}/dtc/libfdt ; then
+ # have submodule DTC - use it
+ fdt=yes
+ dtc_internal="yes"
+ mkdir -p dtc
+ if [ "$source_path" != `pwd` ] ; then
+ symlink "$source_path/dtc/Makefile" "dtc/Makefile"
+ symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
+ fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
+ fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
+ elif test "$fdt" = "yes" ; then
+ # have neither and want - prompt for system/submodule install
+ error_exit "DTC not present. Your options:" \
+ " (1) Preferred: Install the DTC devel package" \
+ " (2) Fetch the DTC submodule, using:" \
+ " git submodule update --init dtc"
+ else
+ # don't have and don't want
fdt_libs=
fdt=no
fi
fi
+libs_softmmu="$libs_softmmu $fdt_libs"
+
##########################################
-# opengl probe, used by milkymist-tmu2
-if test "$opengl" != "no" ; then
- opengl_libs="-lGL"
+# GLX probe, used by milkymist-tmu2
+if test "$glx" != "no" ; then
+ glx_libs="-lGL -lX11"
cat > $TMPC << EOF
#include <X11/Xlib.h>
#include <GL/gl.h>
#include <GL/glx.h>
-int main(void) { return GL_VERSION != 0; }
+int main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; }
EOF
- if compile_prog "" "-lGL" ; then
- opengl=yes
+ if compile_prog "" "-lGL -lX11" ; then
+ glx=yes
else
- if test "$opengl" = "yes" ; then
- feature_not_found "opengl"
+ if test "$glx" = "yes" ; then
+ feature_not_found "glx"
fi
- opengl_libs=
- opengl=no
+ glx_libs=
+ glx=no
fi
fi
##########################################
# glusterfs probe
if test "$glusterfs" != "no" ; then
- cat > $TMPC <<EOF
-#include <glusterfs/api/glfs.h>
-int main(void) {
- (void) glfs_new("volume");
- return 0;
-}
-EOF
- glusterfs_libs="-lgfapi -lgfrpc -lgfxdr"
- if compile_prog "" "$glusterfs_libs" ; then
- glusterfs=yes
+ if $pkg_config --atleast-version=3 glusterfs-api >/dev/null 2>&1; then
+ glusterfs="yes"
+ glusterfs_cflags=`$pkg_config --cflags glusterfs-api 2>/dev/null`
+ glusterfs_libs=`$pkg_config --libs glusterfs-api 2>/dev/null`
+ CFLAGS="$CFLAGS $glusterfs_cflags"
libs_tools="$glusterfs_libs $libs_tools"
libs_softmmu="$glusterfs_libs $libs_softmmu"
+ if $pkg_config --atleast-version=5 glusterfs-api >/dev/null 2>&1; then
+ glusterfs_discard="yes"
+ fi
else
if test "$glusterfs" = "yes" ; then
feature_not_found "GlusterFS backend support"
fi
- glusterfs=no
+ glusterfs="no"
fi
fi
-#
-# Check for xxxat() functions when we are building linux-user
-# emulator. This is done because older glibc versions don't
-# have syscall stubs for these implemented.
-#
-atfile=no
-cat > $TMPC << EOF
-#define _ATFILE_SOURCE
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-int
-main(void)
-{
- /* try to unlink nonexisting file */
- return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
-}
-EOF
-if compile_prog "" "" ; then
- atfile=yes
-fi
-
# Check for inotify functions when we are building linux-user
# emulator. This is done because older glibc versions don't
# have syscall stubs for these implemented. In that case we
@@ -2535,6 +2755,22 @@ if compile_prog "" "" ; then
fallocate=yes
fi
+# check for fallocate hole punching
+fallocate_punch_hole=no
+cat > $TMPC << EOF
+#include <fcntl.h>
+#include <linux/falloc.h>
+
+int main(void)
+{
+ fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0);
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ fallocate_punch_hole=yes
+fi
+
# check for sync_file_range
sync_file_range=no
cat > $TMPC << EOF
@@ -2634,6 +2870,20 @@ if compile_prog "" "" ; then
epoll_pwait=yes
fi
+# check for sendfile support
+sendfile=no
+cat > $TMPC << EOF
+#include <sys/sendfile.h>
+
+int main(void)
+{
+ return sendfile(0, 0, 0, 0);
+}
+EOF
+if compile_prog "" "" ; then
+ sendfile=yes
+fi
+
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
if has makeinfo && has pod2man; then
@@ -2656,7 +2906,7 @@ if compile_prog "" "" ; then
byteswap_h=yes
fi
-# Search for bswap_32 function
+# Search for bswap32 function
bswap_h=no
cat > $TMPC << EOF
#include <sys/endian.h>
@@ -2678,7 +2928,13 @@ if test "$libiscsi" != "no" ; then
#include <iscsi/iscsi.h>
int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
EOF
- if compile_prog "" "-liscsi" ; then
+ if $pkg_config --atleast-version=1.7.0 libiscsi --modversion >/dev/null 2>&1; then
+ libiscsi="yes"
+ libiscsi_cflags=$($pkg_config --cflags libiscsi 2>/dev/null)
+ libiscsi_libs=$($pkg_config --libs libiscsi 2>/dev/null)
+ CFLAGS="$CFLAGS $libiscsi_cflags"
+ LIBS="$LIBS $libiscsi_libs"
+ elif compile_prog "" "-liscsi" ; then
libiscsi="yes"
LIBS="$LIBS -liscsi"
else
@@ -2702,10 +2958,7 @@ elif compile_prog "" "-lm" ; then
LIBS="-lm $LIBS"
libs_qga="-lm $libs_qga"
else
- echo
- echo "Error: libm check failed"
- echo
- exit 1
+ error_exit "libm check failed"
fi
##########################################
@@ -2746,7 +2999,7 @@ EOF
spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
if $pkg_config --atleast-version=0.12.0 spice-server >/dev/null 2>&1 && \
- $pkg_config --atleast-version=0.12.2 spice-protocol > /dev/null 2>&1 && \
+ $pkg_config --atleast-version=0.12.3 spice-protocol > /dev/null 2>&1 && \
compile_prog "$spice_cflags" "$spice_libs" ; then
spice="yes"
libs_softmmu="$libs_softmmu $spice_libs"
@@ -2762,47 +3015,59 @@ EOF
fi
# check for libcacard for smartcard support
-if test "$smartcard" != "no" ; then
- smartcard="yes"
- smartcard_cflags=""
- # TODO - what's the minimal nss version we support?
- if test "$smartcard_nss" != "no"; then
- cat > $TMPC << EOF
+smartcard_cflags=""
+# TODO - what's the minimal nss version we support?
+if test "$smartcard_nss" != "no"; then
+ cat > $TMPC << EOF
#include <pk11pub.h>
int main(void) { PK11_FreeSlot(0); return 0; }
EOF
- smartcard_includes="-I\$(SRC_PATH)/libcacard"
- libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
- libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
- test_cflags="$libcacard_cflags"
- # The header files in nss < 3.13.3 have a bug which causes them to
- # emit a warning. If we're going to compile QEMU with -Werror, then
- # test that the headers don't have this bug. Otherwise we would pass
- # the configure test but fail to compile QEMU later.
- if test "$werror" = "yes"; then
- test_cflags="-Werror $test_cflags"
- fi
- if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
- compile_prog "$test_cflags" "$libcacard_libs"; then
- smartcard_nss="yes"
- QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags"
- QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes"
- libs_softmmu="$libcacard_libs $libs_softmmu"
- else
- if test "$smartcard_nss" = "yes"; then
- feature_not_found "nss"
- fi
- smartcard_nss="no"
+ smartcard_includes="-I\$(SRC_PATH)/libcacard"
+ libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
+ libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
+ test_cflags="$libcacard_cflags"
+ # The header files in nss < 3.13.3 have a bug which causes them to
+ # emit a warning. If we're going to compile QEMU with -Werror, then
+ # test that the headers don't have this bug. Otherwise we would pass
+ # the configure test but fail to compile QEMU later.
+ if test "$werror" = "yes"; then
+ test_cflags="-Werror $test_cflags"
+ fi
+ if test -n "$libtool" &&
+ $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \
+ compile_prog "$test_cflags" "$libcacard_libs"; then
+ smartcard_nss="yes"
+ QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags"
+ QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes"
+ libs_softmmu="$libcacard_libs $libs_softmmu"
+ else
+ if test "$smartcard_nss" = "yes"; then
+ feature_not_found "nss"
fi
+ smartcard_nss="no"
fi
fi
-if test "$smartcard" = "no" ; then
- smartcard_nss="no"
+
+# check for libusb
+if test "$libusb" != "no" ; then
+ if $pkg_config --atleast-version=1.0.13 libusb-1.0 >/dev/null 2>&1 ; then
+ libusb="yes"
+ usb="libusb"
+ libusb_cflags=$($pkg_config --cflags libusb-1.0 2>/dev/null)
+ libusb_libs=$($pkg_config --libs libusb-1.0 2>/dev/null)
+ QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags"
+ libs_softmmu="$libs_softmmu $libusb_libs"
+ else
+ if test "$libusb" = "yes"; then
+ feature_not_found "libusb"
+ fi
+ libusb="no"
+ fi
fi
# check for usbredirparser for usb network redirection support
if test "$usb_redir" != "no" ; then
- if $pkg_config --atleast-version=0.5.3 libusbredirparser-0.5 >/dev/null 2>&1 ; then
+ if $pkg_config --atleast-version=0.6 libusbredirparser-0.5 >/dev/null 2>&1 ; then
usb_redir="yes"
usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5 2>/dev/null)
usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5 2>/dev/null)
@@ -2886,11 +3151,8 @@ fi
$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null
if test "$?" -ne 0 ; then
- echo
- echo "Error: invalid trace backend"
- echo "Please choose a supported trace backend."
- echo
- exit 1
+ error_exit "invalid trace backend" \
+ "Please choose a supported trace backend."
fi
##########################################
@@ -2905,10 +3167,7 @@ EOF
LIBS="-lust -lurcu-bp $LIBS"
libs_qga="-lust -lurcu-bp $libs_qga"
else
- echo
- echo "Error: Trace backend 'ust' missing libust header files"
- echo
- exit 1
+ error_exit "Trace backend 'ust' missing libust header files"
fi
fi
@@ -2916,10 +3175,7 @@ fi
# For 'dtrace' backend, test if 'dtrace' command is present
if test "$trace_backend" = "dtrace"; then
if ! has 'dtrace' ; then
- echo
- echo "Error: dtrace command is not found in PATH $PATH"
- echo
- exit 1
+ error_exit "dtrace command is not found in PATH $PATH"
fi
trace_backend_stap="no"
if has 'stap' ; then
@@ -2928,61 +3184,60 @@ if test "$trace_backend" = "dtrace"; then
fi
##########################################
-# __sync_fetch_and_and requires at least -march=i486. Many toolchains
-# use i686 as default anyway, but for those that don't, an explicit
-# specification is necessary
-if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then
- cat > $TMPC << EOF
-static int sfaa(int *ptr)
-{
- return __sync_fetch_and_and(ptr, 0);
-}
-
-int main(void)
-{
- int val = 42;
- sfaa(&val);
- return val;
-}
-EOF
- if ! compile_prog "" "" ; then
- QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS"
- fi
-fi
-
-##########################################
# check and set a backend for coroutine
-# default is ucontext, but always fallback to gthread
-# windows autodetected by make
-if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then
- if test "$darwin" != "yes"; then
- cat > $TMPC << EOF
+# We prefer ucontext, but it's not always possible. The fallback
+# is sigcontext. gthread is not selectable except explicitly, because
+# it is not functional enough to run QEMU proper. (It is occasionally
+# useful for debugging purposes.) On Windows the only valid backend
+# is the Windows-specific one.
+
+ucontext_works=no
+if test "$darwin" != "yes"; then
+ cat > $TMPC << EOF
#include <ucontext.h>
#ifdef __stub_makecontext
#error Ignoring glibc stub makecontext which will always fail
#endif
int main(void) { makecontext(0, 0, 0); return 0; }
EOF
- if compile_prog "" "" ; then
- coroutine_backend=ucontext
- else
- coroutine_backend=gthread
- fi
+ if compile_prog "" "" ; then
+ ucontext_works=yes
+ fi
+fi
+
+if test "$coroutine" = ""; then
+ if test "$mingw32" = "yes"; then
+ coroutine=win32
+ elif test "$ucontext_works" = "yes"; then
+ coroutine=ucontext
else
- echo "Silently falling back into gthread backend under darwin"
+ coroutine=sigaltstack
fi
-elif test "$coroutine" = "gthread" ; then
- coroutine_backend=gthread
-elif test "$coroutine" = "windows" ; then
- coroutine_backend=windows
-elif test "$coroutine" = "sigaltstack" ; then
- coroutine_backend=sigaltstack
else
- echo
- echo "Error: unknown coroutine backend $coroutine"
- echo
- exit 1
+ case $coroutine in
+ windows)
+ if test "$mingw32" != "yes"; then
+ error_exit "'windows' coroutine backend only valid for Windows"
+ fi
+ # Unfortunately the user visible backend name doesn't match the
+ # coroutine-*.c filename for this case, so we have to adjust it here.
+ coroutine=win32
+ ;;
+ ucontext)
+ if test "$ucontext_works" != "yes"; then
+ feature_not_found "ucontext"
+ fi
+ ;;
+ gthread|sigaltstack)
+ if test "$mingw32" = "yes"; then
+ error_exit "only the 'windows' coroutine backend is valid for Windows"
+ fi
+ ;;
+ *)
+ error_exit "unknown coroutine backend $coroutine"
+ ;;
+ esac
fi
##########################################
@@ -3016,20 +3271,29 @@ if compile_prog "" "" ; then
fi
########################################
-# check whether we can disable the -Wunused-but-set-variable
-# option with a pragma (this is needed to silence a warning in
-# some versions of the valgrind VALGRIND_STACK_DEREGISTER macro.)
-# This test has to be compiled with -Werror as otherwise an
-# unknown pragma is only a warning.
+# check whether we can disable warning option with a pragma (this is needed
+# to silence warnings in the headers of some versions of external libraries).
+# This test has to be compiled with -Werror as otherwise an unknown pragma is
+# only a warning.
+#
+# If we can't selectively disable warning in the code, disable -Werror so that
+# the build doesn't fail anyway.
+
pragma_disable_unused_but_set=no
cat > $TMPC << EOF
+#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#pragma GCC diagnostic pop
+
int main(void) {
return 0;
}
EOF
if compile_prog "-Werror" "" ; then
- pragma_disable_unused_but_set=yes
+ pragma_diagnostic_available=yes
+else
+ werror=no
fi
########################################
@@ -3062,14 +3326,64 @@ if compile_prog "" "" ; then
has_environ=yes
fi
+########################################
+# check if cpuid.h is usable.
+
+cpuid_h=no
+cat > $TMPC << EOF
+#include <cpuid.h>
+int main(void) {
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ cpuid_h=yes
+fi
+
+########################################
+# check if __[u]int128_t is usable.
+
+int128=no
+cat > $TMPC << EOF
+__int128_t a;
+__uint128_t b;
+int main (void) {
+ a = a + b;
+ b = a * b;
+ a = a * a;
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ int128=yes
+fi
+
+########################################
+# check if getauxval is available.
+
+getauxval=no
+cat > $TMPC << EOF
+#include <sys/auxv.h>
+int main(void) {
+ return getauxval(AT_HWCAP) == 0;
+}
+EOF
+if compile_prog "" "" ; then
+ getauxval=yes
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
-if test "$debug" = "no" ; then
+if test "$gcov" = "yes" ; then
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+elif test "$debug" = "no" ; then
CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
fi
+
# Disable zero malloc errors for official releases unless explicitly told to
# enable/disable
if test -z "$zero_malloc" ; then
@@ -3109,6 +3423,7 @@ fi
qemu_confdir=$sysconfdir$confsuffix
qemu_datadir=$datadir$confsuffix
+qemu_localedir="$datadir/locale"
tools=""
if test "$want_tools" = "yes" ; then
@@ -3124,19 +3439,20 @@ if test "$softmmu" = yes ; then
tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
else
if test "$virtfs" = yes; then
- echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel"
- exit 1
+ error_exit "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel"
fi
virtfs=no
fi
fi
+fi
+if [ "$guest_agent" != "no" ]; then
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
- if [ "$guest_agent" = "yes" ]; then
tools="qemu-ga\$(EXESUF) $tools"
- fi
- fi
- if test "$smartcard_nss" = "yes" ; then
- tools="vscclient\$(EXESUF) $tools"
+ guest_agent=yes
+ elif [ "$guest_agent" != yes ]; then
+ guest_agent=no
+ else
+ error_exit "Guest agent is not supported on this platform"
fi
fi
@@ -3151,8 +3467,42 @@ if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
roms="$roms spapr-rtas"
fi
+if test "$cpu" = "s390x" ; then
+ roms="$roms s390-ccw"
+fi
+
+# Probe for the need for relocating the user-only binary.
+if test "$pie" = "no" ; then
+ textseg_addr=
+ case "$cpu" in
+ arm | hppa | i386 | m68k | ppc | ppc64 | s390* | sparc | sparc64 | x86_64)
+ textseg_addr=0x60000000
+ ;;
+ mips)
+ textseg_addr=0x400000
+ ;;
+ esac
+ if [ -n "$textseg_addr" ]; then
+ cat > $TMPC <<EOF
+ int main(void) { return 0; }
+EOF
+ textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr"
+ if ! compile_prog "" "$textseg_ldflags"; then
+ # In case ld does not support -Ttext-segment, edit the default linker
+ # script via sed to set the .text start addr. This is needed on FreeBSD
+ # at least.
+ $ld --verbose | sed \
+ -e '1,/==================================================/d' \
+ -e '/==================================================/,$d' \
+ -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \
+ -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld
+ textseg_ldflags="-Wl,-T../config-host.ld"
+ fi
+ fi
+fi
+
# add pixman flags after all config tests are done
-QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags"
+QEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags"
libs_softmmu="$libs_softmmu $pixman_libs"
echo "Install prefix $prefix"
@@ -3162,10 +3512,12 @@ echo "library directory `eval echo $libdir`"
echo "libexec directory `eval echo $libexecdir`"
echo "include directory `eval echo $includedir`"
echo "config directory `eval echo $sysconfdir`"
-echo "local state directory `eval echo $local_statedir`"
if test "$mingw32" = "no" ; then
+echo "local state directory `eval echo $local_statedir`"
echo "Manual directory `eval echo $mandir`"
echo "ELF interp prefix $interp_prefix"
+else
+echo "local state directory queried at runtime"
fi
echo "Source path $source_path"
echo "C compiler $cc"
@@ -3195,12 +3547,13 @@ if test "$darwin" = "yes" ; then
fi
echo "pixman $pixman"
echo "SDL support $sdl"
+echo "GTK support $gtk"
echo "curses support $curses"
echo "curl support $curl"
echo "mingw32 support $mingw32"
echo "Audio drivers $audio_drv_list"
-echo "Extra audio cards $audio_card_list"
-echo "Block whitelist $block_drv_whitelist"
+echo "Block whitelist (rw) $block_drv_rw_whitelist"
+echo "Block whitelist (ro) $block_drv_ro_whitelist"
echo "Mixer emulation $mixemu"
echo "VirtFS support $virtfs"
echo "VNC support $vnc"
@@ -3209,6 +3562,7 @@ if test "$vnc" = "yes" ; then
echo "VNC SASL support $vnc_sasl"
echo "VNC JPEG support $vnc_jpeg"
echo "VNC PNG support $vnc_png"
+ echo "VNC WS support $vnc_ws"
fi
if test -n "$sparc_cpu"; then
echo "Target Sparc Arch $sparc_cpu"
@@ -3219,7 +3573,6 @@ echo "bluez support $bluez"
echo "Documentation $docs"
[ ! -z "$uname_release" ] && \
echo "uname -r $uname_release"
-echo "NPTL support $nptl"
echo "GUEST_BASE $guest_base"
echo "PIE $pie"
echo "vde support $vde"
@@ -3227,6 +3580,7 @@ echo "Linux AIO support $linux_aio"
echo "ATTR/XATTR support $attr"
echo "Install blobs $blobs"
echo "KVM support $kvm"
+echo "RDMA support $rdma"
echo "TCG interpreter $tcg_interpreter"
echo "fdt support $fdt"
echo "preadv support $preadv"
@@ -3237,26 +3591,36 @@ echo "sigev_thread_id $sigev_thread_id"
echo "uuid support $uuid"
echo "libcap-ng support $cap_ng"
echo "vhost-net support $vhost_net"
+echo "vhost-scsi support $vhost_scsi"
echo "Trace backend $trace_backend"
echo "Trace output file $trace_file-<pid>"
echo "spice support $spice ($spice_protocol_version/$spice_server_version)"
echo "rbd support $rbd"
echo "xfsctl support $xfs"
echo "nss used $smartcard_nss"
+echo "libusb $libusb"
echo "usb net redir $usb_redir"
-echo "OpenGL support $opengl"
+echo "GLX support $glx"
echo "libiscsi support $libiscsi"
echo "build guest agent $guest_agent"
echo "seccomp support $seccomp"
-echo "coroutine backend $coroutine_backend"
+echo "coroutine backend $coroutine"
echo "GlusterFS support $glusterfs"
+echo "virtio-blk-data-plane $virtio_blk_data_plane"
+echo "gcov $gcov_tool"
+echo "gcov enabled $gcov"
+echo "TPM support $tpm"
+echo "libssh2 support $libssh2"
+echo "TPM passthrough $tpm_passthrough"
+echo "QOM debugging $qom_cast_debug"
if test "$sdl_too_old" = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
fi
config_host_mak="config-host.mak"
-config_host_ld="config-host.ld"
+
+echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
echo "# Automatically generated by configure - do not modify" > $config_host_mak
printf "# Configured with:" >> $config_host_mak
@@ -3274,16 +3638,28 @@ echo "sysconfdir=$sysconfdir" >> $config_host_mak
echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
-echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
+if test "$mingw32" = "no" ; then
+ echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
+fi
echo "qemu_helperdir=$libexecdir" >> $config_host_mak
+echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak
+echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
+echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
+echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
echo "ARCH=$ARCH" >> $config_host_mak
+
+case "$cpu" in
+ arm|i386|x86_64|ppc|aarch64)
+ # The TCG interpreter currently does not support ld/st optimization.
+ if test "$tcg_interpreter" = "no" ; then
+ echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_host_mak
+ fi
+ ;;
+esac
if test "$debug_tcg" = "yes" ; then
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
fi
-if test "$debug" = "yes" ; then
- echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
-fi
if test "$strip_opt" = "yes" ; then
echo "STRIP=${strip}" >> $config_host_mak
fi
@@ -3336,7 +3712,6 @@ fi
if test "$slirp" = "yes" ; then
echo "CONFIG_SLIRP=y" >> $config_host_mak
echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
- QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
fi
if test "$vde" = "yes" ; then
echo "CONFIG_VDE=y" >> $config_host_mak
@@ -3344,10 +3719,6 @@ fi
if test "$cap_ng" = "yes" ; then
echo "CONFIG_LIBCAP=y" >> $config_host_mak
fi
-for card in $audio_card_list; do
- def=CONFIG_`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'`
- echo "$def=y" >> $config_host_mak
-done
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
for drv in $audio_drv_list; do
def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'`
@@ -3362,7 +3733,8 @@ fi
if test "$audio_win_int" = "yes" ; then
echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
fi
-echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
+echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
+echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
if test "$mixemu" = "yes" ; then
echo "CONFIG_MIXEMU=y" >> $config_host_mak
fi
@@ -3371,19 +3743,19 @@ if test "$vnc" = "yes" ; then
fi
if test "$vnc_tls" = "yes" ; then
echo "CONFIG_VNC_TLS=y" >> $config_host_mak
- echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
fi
if test "$vnc_sasl" = "yes" ; then
echo "CONFIG_VNC_SASL=y" >> $config_host_mak
- echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
fi
if test "$vnc_jpeg" = "yes" ; then
echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
- echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
fi
if test "$vnc_png" = "yes" ; then
echo "CONFIG_VNC_PNG=y" >> $config_host_mak
- echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
+fi
+if test "$vnc_ws" = "yes" ; then
+ echo "CONFIG_VNC_WS=y" >> $config_host_mak
+ echo "VNC_WS_CFLAGS=$vnc_ws_cflags" >> $config_host_mak
fi
if test "$fnmatch" = "yes" ; then
echo "CONFIG_FNMATCH=y" >> $config_host_mak
@@ -3412,9 +3784,6 @@ fi
if test "$curses" = "yes" ; then
echo "CONFIG_CURSES=y" >> $config_host_mak
fi
-if test "$atfile" = "yes" ; then
- echo "CONFIG_ATFILE=y" >> $config_host_mak
-fi
if test "$utimens" = "yes" ; then
echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
fi
@@ -3433,6 +3802,9 @@ fi
if test "$fallocate" = "yes" ; then
echo "CONFIG_FALLOCATE=y" >> $config_host_mak
fi
+if test "$fallocate_punch_hole" = "yes" ; then
+ echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak
+fi
if test "$sync_file_range" = "yes" ; then
echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
fi
@@ -3451,6 +3823,9 @@ fi
if test "$epoll_pwait" = "yes" ; then
echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak
fi
+if test "$sendfile" = "yes" ; then
+ echo "CONFIG_SENDFILE=y" >> $config_host_mak
+fi
if test "$inotify" = "yes" ; then
echo "CONFIG_INOTIFY=y" >> $config_host_mak
fi
@@ -3475,6 +3850,11 @@ if test "$bluez" = "yes" ; then
echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
fi
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
+if test "$gtk" = "yes" ; then
+ echo "CONFIG_GTK=y" >> $config_host_mak
+ echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
+ echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
+fi
if test "$xen" = "yes" ; then
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
@@ -3491,6 +3871,9 @@ fi
if test "$virtfs" = "yes" ; then
echo "CONFIG_VIRTFS=y" >> $config_host_mak
fi
+if test "$vhost_scsi" = "yes" ; then
+ echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
+fi
if test "$blobs" = "yes" ; then
echo "INSTALL_BLOBS=yes" >> $config_host_mak
fi
@@ -3526,22 +3909,23 @@ if test "$spice" = "yes" ; then
echo "CONFIG_SPICE=y" >> $config_host_mak
fi
-if test "$smartcard" = "yes" ; then
- echo "CONFIG_SMARTCARD=y" >> $config_host_mak
-fi
-
if test "$smartcard_nss" = "yes" ; then
echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak
fi
+if test "$libusb" = "yes" ; then
+ echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak
+fi
+
if test "$usb_redir" = "yes" ; then
echo "CONFIG_USB_REDIR=y" >> $config_host_mak
fi
-if test "$opengl" = "yes" ; then
- echo "CONFIG_OPENGL=y" >> $config_host_mak
+if test "$glx" = "yes" ; then
+ echo "CONFIG_GLX=y" >> $config_host_mak
+ echo "GLX_LIBS=$glx_libs" >> $config_host_mak
fi
if test "$libiscsi" = "yes" ; then
@@ -3562,15 +3946,14 @@ echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
if test "$zero_malloc" = "yes" ; then
echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
fi
+if test "$qom_cast_debug" = "yes" ; then
+ echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
+fi
if test "$rbd" = "yes" ; then
echo "CONFIG_RBD=y" >> $config_host_mak
fi
-if test "$coroutine_backend" = "ucontext" ; then
- echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
-elif test "$coroutine_backend" = "sigaltstack" ; then
- echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak
-fi
+echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
if test "$open_by_handle_at" = "yes" ; then
echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak
@@ -3580,8 +3963,8 @@ if test "$linux_magic_h" = "yes" ; then
echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
fi
-if test "$pragma_disable_unused_but_set" = "yes" ; then
- echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak
+if test "$pragma_diagnostic_available" = "yes" ; then
+ echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak
fi
if test "$valgrind_h" = "yes" ; then
@@ -3592,23 +3975,62 @@ if test "$has_environ" = "yes" ; then
echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak
fi
+if test "$cpuid_h" = "yes" ; then
+ echo "CONFIG_CPUID_H=y" >> $config_host_mak
+fi
+
+if test "$int128" = "yes" ; then
+ echo "CONFIG_INT128=y" >> $config_host_mak
+fi
+
+if test "$getauxval" = "yes" ; then
+ echo "CONFIG_GETAUXVAL=y" >> $config_host_mak
+fi
+
if test "$glusterfs" = "yes" ; then
echo "CONFIG_GLUSTERFS=y" >> $config_host_mak
fi
+if test "$glusterfs_discard" = "yes" ; then
+ echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
+fi
+
+if test "$libssh2" = "yes" ; then
+ echo "CONFIG_LIBSSH2=y" >> $config_host_mak
+fi
+
+if test "$virtio_blk_data_plane" = "yes" ; then
+ echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=$(CONFIG_VIRTIO)' >> $config_host_mak
+fi
+
# USB host support
case "$usb" in
linux)
- echo "HOST_USB=linux" >> $config_host_mak
+ echo "HOST_USB=linux legacy" >> $config_host_mak
;;
bsd)
echo "HOST_USB=bsd" >> $config_host_mak
;;
+libusb)
+ if test "$linux" = "yes"; then
+ echo "HOST_USB=libusb linux legacy" >> $config_host_mak
+ else
+ echo "HOST_USB=libusb legacy" >> $config_host_mak
+ fi
+;;
*)
echo "HOST_USB=stub" >> $config_host_mak
;;
esac
+# TPM passthrough support?
+if test "$tpm" = "yes"; then
+ echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak
+ if test "$tpm_passthrough" = "yes"; then
+ echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak
+ fi
+fi
+
# use default implementation for tracing backend-specific routines
trace_default=yes
echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
@@ -3634,24 +4056,57 @@ if test "$trace_backend" = "dtrace"; then
echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak
fi
fi
+if test "$trace_backend" = "ftrace"; then
+ if test "$linux" = "yes" ; then
+ echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak
+ trace_default=no
+ else
+ feature_not_found "ftrace(trace backend)"
+ fi
+fi
echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
if test "$trace_default" = "yes"; then
echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
fi
+if test "$rdma" = "yes" ; then
+ echo "CONFIG_RDMA=y" >> $config_host_mak
+fi
+
+if test "$tcg_interpreter" = "yes"; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
+elif test "$ARCH" = "sparc64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES"
+elif test "$ARCH" = "s390x" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES"
+elif test "$ARCH" = "x86_64" ; then
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES"
+else
+ QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
+fi
+QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES"
+
echo "TOOLS=$tools" >> $config_host_mak
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "INSTALL=$install" >> $config_host_mak
echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak
echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak
-echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
+if test -n "$libtool"; then
+ echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak
+ echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak
+else
+ echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
+ echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
+fi
echo "PYTHON=$python" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
echo "CC_I386=$cc_i386" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
echo "OBJCC=$objcc" >> $config_host_mak
echo "AR=$ar" >> $config_host_mak
+echo "AS=$as" >> $config_host_mak
+echo "CPP=$cpp" >> $config_host_mak
echo "OBJCOPY=$objcopy" >> $config_host_mak
echo "LD=$ld" >> $config_host_mak
echo "WINDRES=$windres" >> $config_host_mak
@@ -3670,32 +4125,18 @@ else
echo "AUTOCONF_HOST := " >> $config_host_mak
fi
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
-echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
-echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
+echo "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak
echo "LIBS+=$LIBS" >> $config_host_mak
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
echo "POD2MAN=$POD2MAN" >> $config_host_mak
echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak
-
-# generate list of library paths for linker script
-
-$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld}
-
-if test -f ${config_host_ld}~ ; then
- if cmp -s $config_host_ld ${config_host_ld}~ ; then
- mv ${config_host_ld}~ $config_host_ld
- else
- rm ${config_host_ld}~
- fi
+if test "$gcov" = "yes" ; then
+ echo "CONFIG_GCOV=y" >> $config_host_mak
+ echo "GCOV=$gcov_tool" >> $config_host_mak
fi
-for d in libdis libdis-user; do
- symlink "$source_path/Makefile.dis" "$d/Makefile"
- echo > $d/config.mak
-done
-
# use included Linux headers
if test "$linux" = "yes" ; then
mkdir -p linux-headers
@@ -3709,6 +4150,9 @@ if test "$linux" = "yes" ; then
s390x)
linux_arch=s390
;;
+ aarch64)
+ linux_arch=arm64
+ ;;
*)
# For most CPUs the kernel architecture name and QEMU CPU name match.
linux_arch="$cpu"
@@ -3723,11 +4167,11 @@ fi
for target in $target_list; do
target_dir="$target"
config_target_mak=$target_dir/config-target.mak
-target_arch2=`echo $target | cut -d '-' -f 1`
+target_name=`echo $target | cut -d '-' -f 1`
target_bigendian="no"
-case "$target_arch2" in
- armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
+case "$target_name" in
+ armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
target_bigendian=yes
;;
esac
@@ -3736,27 +4180,25 @@ target_user_only="no"
target_linux_user="no"
target_bsd_user="no"
case "$target" in
- ${target_arch2}-softmmu)
+ ${target_name}-softmmu)
target_softmmu="yes"
;;
- ${target_arch2}-linux-user)
+ ${target_name}-linux-user)
if test "$linux" != "yes" ; then
- echo "ERROR: Target '$target' is only available on a Linux host"
- exit 1
+ error_exit "Target '$target' is only available on a Linux host"
fi
target_user_only="yes"
target_linux_user="yes"
;;
- ${target_arch2}-bsd-user)
+ ${target_name}-bsd-user)
if test "$bsd" != "yes" ; then
- echo "ERROR: Target '$target' is only available on a BSD host"
- exit 1
+ error_exit "Target '$target' is only available on a BSD host"
fi
target_user_only="yes"
target_bsd_user="yes"
;;
*)
- echo "ERROR: Target '$target' not recognised"
+ error_exit "Target '$target' not recognised"
exit 1
;;
esac
@@ -3765,72 +4207,54 @@ mkdir -p $target_dir
echo "# Automatically generated by configure - do not modify" > $config_target_mak
bflt="no"
-target_nptl="no"
-interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
+interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"`
gdb_xml_files=""
-target_short_alignment=2
-target_int_alignment=4
-target_long_alignment=4
-target_llong_alignment=8
-target_libs_softmmu=
-TARGET_ARCH="$target_arch2"
+TARGET_ARCH="$target_name"
TARGET_BASE_ARCH=""
TARGET_ABI_DIR=""
-case "$target_arch2" in
+case "$target_name" in
i386)
;;
x86_64)
TARGET_BASE_ARCH=i386
- target_long_alignment=8
;;
alpha)
- target_long_alignment=8
- target_nptl="yes"
;;
arm|armeb)
TARGET_ARCH=arm
bflt="yes"
- target_nptl="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
- target_llong_alignment=4
- target_libs_softmmu="$fdt_libs"
;;
cris)
- target_nptl="yes"
;;
lm32)
- target_libs_softmmu="$opengl_libs"
;;
m68k)
bflt="yes"
gdb_xml_files="cf-core.xml cf-fp.xml"
- target_int_alignment=2
- target_long_alignment=2
- target_llong_alignment=2
;;
microblaze|microblazeel)
TARGET_ARCH=microblaze
bflt="yes"
- target_nptl="yes"
- target_libs_softmmu="$fdt_libs"
;;
mips|mipsel)
TARGET_ARCH=mips
echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
- target_nptl="yes"
;;
mipsn32|mipsn32el)
- TARGET_ARCH=mipsn32
+ TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
+ echo "TARGET_ABI32=y" >> $config_target_mak
;;
mips64|mips64el)
TARGET_ARCH=mips64
TARGET_BASE_ARCH=mips
echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
- target_long_alignment=8
+ ;;
+ moxie)
;;
or32)
TARGET_ARCH=openrisc
@@ -3838,22 +4262,16 @@ case "$target_arch2" in
;;
ppc)
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- target_nptl="yes"
- target_libs_softmmu="$fdt_libs"
;;
ppcemb)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- target_nptl="yes"
- target_libs_softmmu="$fdt_libs"
;;
ppc64)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- target_long_alignment=8
- target_libs_softmmu="$fdt_libs"
;;
ppc64abi32)
TARGET_ARCH=ppc64
@@ -3861,18 +4279,15 @@ case "$target_arch2" in
TARGET_ABI_DIR=ppc
echo "TARGET_ABI32=y" >> $config_target_mak
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
- target_libs_softmmu="$fdt_libs"
;;
sh4|sh4eb)
TARGET_ARCH=sh4
bflt="yes"
- target_nptl="yes"
;;
sparc)
;;
sparc64)
TARGET_BASE_ARCH=sparc
- target_long_alignment=8
;;
sparc32plus)
TARGET_ARCH=sparc64
@@ -3881,8 +4296,6 @@ case "$target_arch2" in
echo "TARGET_ABI32=y" >> $config_target_mak
;;
s390x)
- target_nptl="yes"
- target_long_alignment=8
;;
unicore32)
;;
@@ -3890,8 +4303,7 @@ case "$target_arch2" in
TARGET_ARCH=xtensa
;;
*)
- echo "Unsupported target CPU"
- exit 1
+ error_exit "Unsupported target CPU"
;;
esac
# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
@@ -3905,80 +4317,47 @@ upper() {
echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]'
}
-case "$cpu" in
- i386|x86_64|ppc)
- # The TCG interpreter currently does not support ld/st optimization.
- if test "$tcg_interpreter" = "no" ; then
- echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak
- fi
- ;;
-esac
-
-echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
-echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
-echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
-echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
-echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
target_arch_name="`upper $TARGET_ARCH`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
-echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
-echo "TARGET_TYPE=TARGET_TYPE_`upper $target_arch2`" >> $config_target_mak
+echo "TARGET_NAME=$target_name" >> $config_target_mak
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
if [ "$TARGET_ABI_DIR" = "" ]; then
TARGET_ABI_DIR=$TARGET_ARCH
fi
echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
-case "$target_arch2" in
+case "$target_name" in
i386|x86_64)
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
echo "CONFIG_XEN=y" >> $config_target_mak
if test "$xen_pci_passthrough" = yes; then
echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak"
fi
- else
- echo "CONFIG_NO_XEN=y" >> $config_target_mak
fi
;;
*)
- echo "CONFIG_NO_XEN=y" >> $config_target_mak
esac
-case "$target_arch2" in
- i386|x86_64|ppcemb|ppc|ppc64|s390x)
+case "$target_name" in
+ arm|i386|x86_64|ppcemb|ppc|ppc64|s390x)
# Make sure the target and host cpus are compatible
if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
- \( "$target_arch2" = "$cpu" -o \
- \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
- \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \
- \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \
- \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \
- \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \
- \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then
+ \( "$target_name" = "$cpu" -o \
+ \( "$target_name" = "ppcemb" -a "$cpu" = "ppc" \) -o \
+ \( "$target_name" = "ppc64" -a "$cpu" = "ppc" \) -o \
+ \( "$target_name" = "ppc" -a "$cpu" = "ppc64" \) -o \
+ \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \
+ \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \
+ \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) \) ; then
echo "CONFIG_KVM=y" >> $config_target_mak
if test "$vhost_net" = "yes" ; then
echo "CONFIG_VHOST_NET=y" >> $config_target_mak
fi
fi
esac
-case "$target_arch2" in
- i386|x86_64)
- echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak
-esac
-if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
- echo "CONFIG_PSERIES=y" >> $config_target_mak
-fi
if test "$target_bigendian" = "yes" ; then
echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
fi
if test "$target_softmmu" = "yes" ; then
echo "CONFIG_SOFTMMU=y" >> $config_target_mak
- echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
- if test "$smartcard_nss" = "yes" ; then
- echo "subdir-$target: subdir-libcacard" >> $config_host_mak
- fi
- case "$target_arch2" in
- i386|x86_64)
- echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak
- esac
fi
if test "$target_user_only" = "yes" ; then
echo "CONFIG_USER_ONLY=y" >> $config_target_mak
@@ -3998,10 +4377,6 @@ fi
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
echo "TARGET_HAS_BFLT=y" >> $config_target_mak
fi
-if test "$target_user_only" = "yes" \
- -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
- echo "CONFIG_USE_NPTL=y" >> $config_target_mak
-fi
if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
fi
@@ -4009,111 +4384,86 @@ if test "$target_bsd_user" = "yes" ; then
echo "CONFIG_BSD_USER=y" >> $config_target_mak
fi
-# the static way of configuring available audio cards requires this workaround
-if test "$target_user_only" != "yes" && grep -q CONFIG_PCSPK $source_path/default-configs/$target.mak; then
- echo "CONFIG_PCSPK=y" >> $config_target_mak
-fi
-
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
-includes=""
ldflags=""
-if test "$tcg_interpreter" = "yes"; then
- includes="-I\$(SRC_PATH)/tcg/tci $includes"
-elif test "$ARCH" = "sparc64" ; then
- includes="-I\$(SRC_PATH)/tcg/sparc $includes"
-elif test "$ARCH" = "s390x" ; then
- includes="-I\$(SRC_PATH)/tcg/s390 $includes"
-elif test "$ARCH" = "x86_64" ; then
- includes="-I\$(SRC_PATH)/tcg/i386 $includes"
-else
- includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
-fi
-includes="-I\$(SRC_PATH)/tcg $includes"
-
-if test "$linux" = "yes" ; then
- includes="-I\$(SRC_PATH)/linux-headers $includes"
-fi
-
-if test "$target_user_only" = "yes" ; then
- libdis_config_mak=libdis-user/config.mak
-else
- libdis_config_mak=libdis/config.mak
-fi
-
for i in $ARCH $TARGET_BASE_ARCH ; do
case "$i" in
alpha)
echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak
- echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_ALPHA_DIS=y" >> config-all-disas.mak
;;
arm)
echo "CONFIG_ARM_DIS=y" >> $config_target_mak
- echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_ARM_DIS=y" >> config-all-disas.mak
;;
cris)
echo "CONFIG_CRIS_DIS=y" >> $config_target_mak
- echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_CRIS_DIS=y" >> config-all-disas.mak
;;
hppa)
echo "CONFIG_HPPA_DIS=y" >> $config_target_mak
- echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_HPPA_DIS=y" >> config-all-disas.mak
;;
i386|x86_64)
echo "CONFIG_I386_DIS=y" >> $config_target_mak
- echo "CONFIG_I386_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_I386_DIS=y" >> config-all-disas.mak
;;
ia64*)
echo "CONFIG_IA64_DIS=y" >> $config_target_mak
- echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_IA64_DIS=y" >> config-all-disas.mak
;;
lm32)
echo "CONFIG_LM32_DIS=y" >> $config_target_mak
- echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_LM32_DIS=y" >> config-all-disas.mak
;;
m68k)
echo "CONFIG_M68K_DIS=y" >> $config_target_mak
- echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_M68K_DIS=y" >> config-all-disas.mak
;;
microblaze*)
echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak
- echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_MICROBLAZE_DIS=y" >> config-all-disas.mak
;;
mips*)
echo "CONFIG_MIPS_DIS=y" >> $config_target_mak
- echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_MIPS_DIS=y" >> config-all-disas.mak
+ ;;
+ moxie*)
+ echo "CONFIG_MOXIE_DIS=y" >> $config_target_mak
+ echo "CONFIG_MOXIE_DIS=y" >> config-all-disas.mak
;;
or32)
echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak
- echo "CONFIG_OPENRISC_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_OPENRISC_DIS=y" >> config-all-disas.mak
;;
ppc*)
echo "CONFIG_PPC_DIS=y" >> $config_target_mak
- echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_PPC_DIS=y" >> config-all-disas.mak
;;
s390*)
echo "CONFIG_S390_DIS=y" >> $config_target_mak
- echo "CONFIG_S390_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_S390_DIS=y" >> config-all-disas.mak
;;
sh4)
echo "CONFIG_SH4_DIS=y" >> $config_target_mak
- echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_SH4_DIS=y" >> config-all-disas.mak
;;
sparc*)
echo "CONFIG_SPARC_DIS=y" >> $config_target_mak
- echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_SPARC_DIS=y" >> config-all-disas.mak
;;
xtensa*)
echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak
- echo "CONFIG_XTENSA_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_XTENSA_DIS=y" >> config-all-disas.mak
;;
esac
done
if test "$tcg_interpreter" = "yes" ; then
echo "CONFIG_TCI_DIS=y" >> $config_target_mak
- echo "CONFIG_TCI_DIS=y" >> $libdis_config_mak
+ echo "CONFIG_TCI_DIS=y" >> config-all-disas.mak
fi
case "$ARCH" in
@@ -4123,20 +4473,6 @@ alpha)
;;
esac
-if test "$target_softmmu" = "yes" ; then
- case "$TARGET_BASE_ARCH" in
- arm)
- cflags="-DHAS_AUDIO $cflags"
- ;;
- lm32)
- cflags="-DHAS_AUDIO $cflags"
- ;;
- i386|mips|ppc)
- cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
- ;;
- esac
-fi
-
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
@@ -4149,26 +4485,12 @@ if test "$gprof" = "yes" ; then
fi
fi
-if test "$ARCH" = "tci"; then
- linker_script=""
-else
- linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
-fi
-
if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
- case "$ARCH" in
- alpha | s390x)
- # The default placement of the application is fine.
- ;;
- *)
- ldflags="$linker_script $ldflags"
- ;;
- esac
+ ldflags="$ldflags $textseg_ldflags"
fi
echo "LDFLAGS+=$ldflags" >> $config_target_mak
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
-echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
done # for target in $targets
@@ -4176,22 +4498,33 @@ if [ "$pixman" = "internal" ]; then
echo "config-host.h: subdir-pixman" >> $config_host_mak
fi
+if test "$rdma" = "yes" ; then
+echo "CONFIG_RDMA=y" >> $config_host_mak
+fi
+
+if [ "$dtc_internal" = "yes" ]; then
+ echo "config-host.h: subdir-dtc" >> $config_host_mak
+fi
+
# build tree in object directory in case the source is not in the current directory
-DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32"
-DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"
+DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa"
+DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw"
DIRS="$DIRS roms/seabios roms/vgabios"
DIRS="$DIRS qapi-generated"
-DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace"
FILES="Makefile tests/tcg/Makefile qdict-test-data.txt"
FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
-FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile"
+FILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile"
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
FILES="$FILES pc-bios/spapr-rtas/Makefile"
+FILES="$FILES pc-bios/s390-ccw/Makefile"
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
+FILES="$FILES pc-bios/qemu-icon.bmp"
for bios_file in \
$source_path/pc-bios/*.bin \
+ $source_path/pc-bios/*.aml \
$source_path/pc-bios/*.rom \
$source_path/pc-bios/*.dtb \
+ $source_path/pc-bios/*.img \
$source_path/pc-bios/openbios-* \
$source_path/pc-bios/palcode-*
do
@@ -4209,17 +4542,15 @@ for rom in seabios vgabios ; do
config_mak=roms/$rom/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
+ echo "AS=$as" >> $config_mak
echo "CC=$cc" >> $config_mak
echo "BCC=bcc" >> $config_mak
- echo "CPP=${cross_prefix}cpp" >> $config_mak
+ echo "CPP=$cpp" >> $config_mak
echo "OBJCOPY=objcopy" >> $config_mak
echo "IASL=iasl" >> $config_mak
echo "LD=$ld" >> $config_mak
done
-d=libuser
-symlink "$source_path/Makefile.user" "$d/Makefile"
-
if test "$docs" = "yes" ; then
mkdir -p QMP
fi