# symbolically link $1 to $2. Portable version of "ln -sf".
symlink() {
- rm -f $2
- ln -s $1 $2
+ rm -rf "$2"
+ mkdir -p "$(dirname "$2")"
+ ln -s "$1" "$2"
}
# check whether a command is available to this shell (may be either an
vnc_sasl=""
vnc_jpeg=""
vnc_png=""
-vnc_thread="no"
xen=""
xen_ctrl_version=""
+xen_pci_passthrough=""
linux_aio=""
cap_ng=""
attr=""
cocoa="no"
softmmu="yes"
linux_user="no"
-darwin_user="no"
bsd_user="no"
guest_base=""
uname_release=""
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_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
if test "$debug_info" = "yes"; then
CFLAGS="-g $CFLAGS"
else
QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
fi
- darwin_user="yes"
cocoa="yes"
audio_drv_list="coreaudio"
audio_possible_drivers="coreaudio sdl fmod"
# needed for TIOCWIN* defines in termios.h
QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
- LIBS="-lsocket -lnsl -lresolv $LIBS"
+ solarisnetlibs="-lsocket -lnsl -lresolv"
+ LIBS="$solarisnetlibs $LIBS"
+ libs_qga="$solarisnetlibs $libs_qga"
;;
AIX)
aix="yes"
if [ "$bsd" = "yes" ] ; then
if [ "$darwin" != "yes" ] ; then
usb="bsd"
+ bsd_user="yes"
fi
- bsd_user="yes"
fi
: ${make=${MAKE-make}}
;;
--enable-vnc-png) vnc_png="yes"
;;
- --disable-vnc-thread) vnc_thread="no"
- ;;
- --enable-vnc-thread) vnc_thread="yes"
- ;;
--disable-slirp) slirp="no"
;;
--disable-uuid) uuid="no"
;;
--enable-xen) xen="yes"
;;
+ --disable-xen-pci-passthrough) xen_pci_passthrough="no"
+ ;;
+ --enable-xen-pci-passthrough) xen_pci_passthrough="yes"
+ ;;
--disable-brlapi) brlapi="no"
;;
--enable-brlapi) brlapi="yes"
;;
--enable-profiler) profiler="yes"
;;
+ --disable-cocoa) cocoa="no"
+ ;;
--enable-cocoa)
cocoa="yes" ;
sdl="no" ;
--disable-user)
linux_user="no" ;
bsd_user="no" ;
- darwin_user="no"
;;
--enable-user) ;;
--disable-linux-user) linux_user="no"
;;
--enable-linux-user) linux_user="yes"
;;
- --disable-darwin-user) darwin_user="no"
- ;;
- --enable-darwin-user) darwin_user="yes"
- ;;
--disable-bsd-user) bsd_user="no"
;;
--enable-bsd-user) bsd_user="yes"
s390x-linux-user \
"
fi
-# the following are Darwin specific
-if [ "$darwin_user" = "yes" ] ; then
- default_target_list="$default_target_list i386-darwin-user ppc-darwin-user "
-fi
# the following are BSD specific
if [ "$bsd_user" = "yes" ] ; then
default_target_list="${default_target_list}\
echo " --docdir=PATH install documentation in PATH$confsuffix"
echo " --bindir=PATH install binaries in PATH"
echo " --sysconfdir=PATH install config in PATH$confsuffix"
-echo " --with-confsuffix=SUFFIX suffix for Qemu data inside datadir and sysconfdir [$confsuffix]"
+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 enable common debug build options"
echo " --enable-virtfs enable VirtFS"
echo " --disable-vnc disable VNC"
echo " --enable-vnc enable VNC"
-echo " --enable-cocoa enable COCOA (Mac OS X only)"
+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 " --enable-mixemu enable mixer emulation"
echo " --disable-xen disable xen backend driver support"
echo " --enable-xen enable xen backend driver support"
+echo " --disable-xen-pci-passthrough"
+echo " --enable-xen-pci-passthrough"
echo " --disable-brlapi disable BrlAPI"
echo " --enable-brlapi enable BrlAPI"
echo " --disable-vnc-tls disable TLS encryption 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-thread disable threaded VNC server"
-echo " --enable-vnc-thread enable threaded VNC server"
echo " --disable-curses disable curses output"
echo " --enable-curses enable curses output"
echo " --disable-curl disable curl connectivity"
echo " --disable-user disable all user emulation targets"
echo " --enable-linux-user enable all linux usermode emulation targets"
echo " --disable-linux-user disable all linux usermode emulation targets"
-echo " --enable-darwin-user enable all darwin usermode emulation targets"
-echo " --disable-darwin-user disable all darwin usermode emulation targets"
echo " --enable-bsd-user enable all BSD usermode emulation targets"
echo " --disable-bsd-user disable all BSD usermode emulation targets"
echo " --enable-guest-base enable GUEST_BASE support for usermode"
# 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[0] >= 3)'; then
- echo "Python 2 required but '$python' is version 3 or better."
- echo "Use --python=/path/to/python to specify a Python 2."
+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
fi
elif (
cat > $TMPC <<EOF
#include <xenctrl.h>
-#include <xs.h>
+#include <xenstore.h>
#include <stdint.h>
#include <xen/hvm/hvm_info_table.h>
#if !defined(HVM_MAX_VCPUS)
fi
fi
+if test "$xen_pci_passthrough" != "no"; then
+ if test "$xen" = "yes" && test "$linux" = "yes" &&
+ test "$xen_ctrl_version" -ge 340; 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"
+ fi
+ echo "ERROR"
+ exit 1;
+ fi
+ xen_pci_passthrough=no
+ fi
+fi
+
##########################################
# pkg-config probe
##########################################
# Do we have libiscsi
+# We check for iscsi_unmap_sync() to make sure we have a
+# recent enough version of libiscsi.
if test "$libiscsi" != "no" ; then
cat > $TMPC << EOF
+#include <stdio.h>
#include <iscsi/iscsi.h>
-int main(void) { iscsi_create_context(""); return 0; }
+int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
EOF
if compile_prog "-Werror" "-liscsi" ; then
libiscsi="yes"
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.8.2 spice-server >/dev/null 2>&1 && \
+ $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
compile_prog "$spice_cflags" "$spice_libs" ; then
spice="yes"
libs_softmmu="$libs_softmmu $spice_libs"
##########################################
# check if we have open_by_handle_at
-open_by_hande_at=no
+open_by_handle_at=no
cat > $TMPC << EOF
#include <fcntl.h>
+#if !defined(AT_EMPTY_PATH)
+# error missing definition
+#else
int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
+#endif
EOF
if compile_prog "" "" ; then
open_by_handle_at=yes
linux_magic_h=yes
fi
+########################################
+# check if environ is declared
+
+has_environ=no
+cat > $TMPC << EOF
+#include <unistd.h>
+int main(void) {
+ environ = environ;
+ return 0;
+}
+EOF
+if compile_prog "" "" ; then
+ has_environ=yes
+fi
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
if test "$debug" = "no" ; then
- CFLAGS="-O2 $CFLAGS"
+ CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
fi
# Consult white-list to determine whether to enable werror
if test "$softmmu" = yes ; then
tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
if test "$virtfs" != no ; then
- if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then
- virtfs=yes
- tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
- else
- if test "$virtfs" = yes; then
- feature_not_found "virtfs"
- fi
+ if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then
+ virtfs=yes
+ 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
fi
+ virtfs=no
+ fi
fi
if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
tools="qemu-nbd\$(EXESUF) $tools"
fi
fi
fi
+if test "$smartcard_nss" = "yes" ; then
+ tools="vscclient\$(EXESUF) $tools"
+fi
# Mac OS X ships with a broken assembler
roms=
echo "VNC SASL support $vnc_sasl"
echo "VNC JPEG support $vnc_jpeg"
echo "VNC PNG support $vnc_png"
- echo "VNC thread $vnc_thread"
fi
if test -n "$sparc_cpu"; then
echo "Target Sparc Arch $sparc_cpu"
echo "CONFIG_VNC_PNG=y" >> $config_host_mak
echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
fi
-if test "$vnc_thread" = "yes" ; then
- echo "CONFIG_VNC_THREAD=y" >> $config_host_mak
-fi
if test "$fnmatch" = "yes" ; then
echo "CONFIG_FNMATCH=y" >> $config_host_mak
fi
echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
fi
+if test "$has_environ" = "yes" ; then
+ echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak
+fi
+
# USB host support
case "$usb" in
linux)
fi
for d in libdis libdis-user; do
- mkdir -p $d
- symlink $source_path/Makefile.dis $d/Makefile
+ symlink "$source_path/Makefile.dis" "$d/Makefile"
echo > $d/config.mak
done
mkdir -p linux-headers
case "$cpu" in
i386|x86_64)
- symlink $source_path/linux-headers/asm-x86 linux-headers/asm
+ symlink "$source_path/linux-headers/asm-x86" linux-headers/asm
;;
ppcemb|ppc|ppc64)
- symlink $source_path/linux-headers/asm-powerpc linux-headers/asm
+ symlink "$source_path/linux-headers/asm-powerpc" linux-headers/asm
;;
s390x)
- symlink $source_path/linux-headers/asm-s390 linux-headers/asm
+ symlink "$source_path/linux-headers/asm-s390" linux-headers/asm
;;
esac
fi
target_softmmu="no"
target_user_only="no"
target_linux_user="no"
-target_darwin_user="no"
target_bsd_user="no"
case "$target" in
${target_arch2}-softmmu)
target_user_only="yes"
target_linux_user="yes"
;;
- ${target_arch2}-darwin-user)
- if test "$darwin" != "yes" ; then
- echo "ERROR: Target '$target' is only available on a Darwin host"
- exit 1
- fi
- target_user_only="yes"
- target_darwin_user="yes"
- ;;
${target_arch2}-bsd-user)
if test "$bsd" != "yes" ; then
echo "ERROR: Target '$target' is only available on a BSD host"
esac
mkdir -p $target_dir
-mkdir -p $target_dir/fpu
-mkdir -p $target_dir/tcg
-mkdir -p $target_dir/ide
-mkdir -p $target_dir/usb
-mkdir -p $target_dir/9pfs
-mkdir -p $target_dir/kvm
-if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
- mkdir -p $target_dir/nwfpe
-fi
-symlink $source_path/Makefile.target $target_dir/Makefile
-
-
echo "# Automatically generated by configure - do not modify" > $config_target_mak
bflt="no"
bflt="yes"
target_nptl="yes"
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
- target_phys_bits=32
+ target_phys_bits=64
target_llong_alignment=4
target_libs_softmmu="$fdt_libs"
;;
exit 1
;;
esac
+# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
+if [ "$TARGET_BASE_ARCH" = "" ]; then
+ TARGET_BASE_ARCH=$TARGET_ARCH
+fi
+
+symlink "$source_path/Makefile.target" "$target_dir/Makefile"
+
case "$target_arch2" in
- alpha | sparc*)
+ alpha | sparc* | xtensa* | ppc*)
echo "CONFIG_TCG_PASS_AREG0=y" >> $config_target_mak
;;
esac
target_arch_name="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
-# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
-if [ "$TARGET_BASE_ARCH" = "" ]; then
- TARGET_BASE_ARCH=$TARGET_ARCH
-fi
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
if [ "$TARGET_ABI_DIR" = "" ]; then
TARGET_ABI_DIR=$TARGET_ARCH
if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
target_phys_bits=64
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
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 "$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
if test "$target_linux_user" = "yes" ; then
echo "CONFIG_LINUX_USER=y" >> $config_target_mak
fi
-if test "$target_darwin_user" = "yes" ; then
- echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
-fi
list=""
if test ! -z "$gdb_xml_files" ; then
for x in $gdb_xml_files; do
esac
fi
-if test "$target_softmmu" = "yes" -a \( \
- "$TARGET_ARCH" = "microblaze" -o \
- "$TARGET_ARCH" = "cris" \) ; then
- echo "CONFIG_NEED_MMU=y" >> $config_target_mak
-fi
-
if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=yes" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
# 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 slirp audio block net pc-bios/optionrom"
-DIRS="$DIRS pc-bios/spapr-rtas"
+DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"
DIRS="$DIRS roms/seabios roms/vgabios"
-DIRS="$DIRS fsdev ui usb"
-DIRS="$DIRS qapi qapi-generated"
-DIRS="$DIRS qga trace qom"
+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"
+FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile"
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
FILES="$FILES pc-bios/spapr-rtas/Makefile"
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
done
mkdir -p $DIRS
for f in $FILES ; do
- if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then
+ if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then
symlink "$source_path/$f" "$f"
fi
done
for hwlib in 32 64; do
d=libhw$hwlib
- mkdir -p $d
- mkdir -p $d/ide
- mkdir -p $d/usb
- symlink $source_path/Makefile.hw $d/Makefile
- mkdir -p $d/9pfs
+ symlink "$source_path/Makefile.hw" "$d/Makefile"
echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
done
-if [ "$source_path" != `pwd` ]; then
- # out of tree build
- mkdir -p libcacard
- rm -f libcacard/Makefile
- symlink "$source_path/libcacard/Makefile" libcacard/Makefile
-fi
-
d=libuser
-mkdir -p $d
-mkdir -p $d/trace
-mkdir -p $d/qom
-symlink $source_path/Makefile.user $d/Makefile
+symlink "$source_path/Makefile.user" "$d/Makefile"
if test "$docs" = "yes" ; then
mkdir -p QMP