# options which some versions of GCC's C++ compiler complain about
# because they only make sense for C programs.
QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
- CXXFLAGS=$(echo "$CFLAGS" | sed s/-std=gnu99/-std=gnu++11/)
+ CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu99/-std=gnu++11/)
for arg in $QEMU_CFLAGS; do
case $arg in
-Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\
compile_object() {
local_cflags="$1"
- do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
+ do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
}
compile_prog() {
local_cflags="$1"
local_ldflags="$2"
- do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $QEMU_LDFLAGS $local_ldflags
+ do_cc $CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC \
+ $LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags
}
# symbolically link $1 to $2. Portable version of "ln -sf".
brlapi=""
curl=""
-curses=""
-docs=""
-fdt=""
+iconv="auto"
+curses="auto"
+docs="auto"
+fdt="auto"
netmap="no"
sdl="auto"
sdl_image="auto"
+virtiofsd="auto"
virtfs=""
+libudev="auto"
mpath="auto"
vnc="enabled"
-sparse="no"
+sparse="auto"
vde=""
vnc_sasl="auto"
vnc_jpeg="auto"
vhost_scsi=""
vhost_vsock=""
vhost_user=""
+vhost_user_blk_server=""
vhost_user_fs=""
kvm="auto"
hax="auto"
module_upgrades="no"
prefix="/usr/local"
qemu_suffix="qemu"
-slirp=""
+slirp="auto"
oss_lib=""
bsd="no"
linux="no"
softmmu="yes"
linux_user="no"
bsd_user="no"
-blobs="yes"
-edk2_blobs="no"
+blobs="true"
pkgversion=""
pie=""
qom_cast_debug="yes"
opengl_dmabuf="no"
cpuid_h="no"
avx2_opt=""
-capstone=""
+capstone="auto"
lzo=""
snappy=""
bzip2=""
vvfat="yes"
qed="yes"
parallels="yes"
-sheepdog="yes"
+sheepdog="no"
libxml2=""
debug_mutex="no"
libpmem=""
QEMU_CFLAGS="-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="-iquote . -iquote ${source_path} -iquote ${source_path}/accel/tcg -iquote ${source_path}/include"
-QEMU_INCLUDES="$QEMU_INCLUDES -iquote ${source_path}/disas/libvixl"
-CFLAGS="-std=gnu99 -Wall"
+
+# Flags that are needed during configure but later taken care of by Meson
+CONFIGURE_CFLAGS="-std=gnu99 -Wall"
+CONFIGURE_LDFLAGS=
check_define() {
if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then
cpu="x86_64"
fi
+ HOST_DSOSUF=".dylib"
;;
SunOS)
# $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo
audio_possible_drivers="oss alsa sdl pa"
linux="yes"
linux_user="yes"
- QEMU_INCLUDES="-isystem ${source_path}/linux-headers -Ilinux-headers $QEMU_INCLUDES"
;;
esac
fi
done
-sphinx_build=
-for binary in sphinx-build-3 sphinx-build
-do
- if has "$binary"
- then
- sphinx_build=$(command -v "$binary")
- break
- fi
-done
# Check for ancillary tools used in testing
genisoimage=
EXESUF=".exe"
HOST_DSOSUF=".dll"
# MinGW needs -mthreads for TLS and macro _MT.
- CFLAGS="-mthreads $CFLAGS"
+ CONFIGURE_CFLAGS="-mthreads $CONFIGURE_CFLAGS"
write_c_skeleton;
prefix="/qemu"
qemu_suffix=""
;;
--with-suffix=*) qemu_suffix="$optarg"
;;
- --docdir=*) qemu_docdir="$optarg"
+ --docdir=*) docdir="$optarg"
+ ;;
+ --localedir=*) localedir="$optarg"
;;
--sysconfdir=*) sysconfdir="$optarg"
;;
--host=*|--build=*|\
--disable-dependency-tracking|\
--sbindir=*|--sharedstatedir=*|\
- --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\
+ --oldincludedir=*|--datarootdir=*|--infodir=*|\
--htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
# These switches are silently ignored, for compatibility with
# autoconf-generated configure scripts. This allows QEMU's
;;
--enable-virtfs) virtfs="yes"
;;
+ --disable-libudev) libudev="disabled"
+ ;;
+ --enable-libudev) libudev="enabled"
+ ;;
+ --disable-virtiofsd) virtiofsd="disabled"
+ ;;
+ --enable-virtiofsd) virtiofsd="enabled"
+ ;;
--disable-mpath) mpath="disabled"
;;
--enable-mpath) mpath="enabled"
;;
--disable-tsan) tsan="no"
;;
- --enable-sparse) sparse="yes"
+ --enable-sparse) sparse="enabled"
;;
- --disable-sparse) sparse="no"
+ --disable-sparse) sparse="disabled"
;;
--disable-strip) strip_opt="no"
;;
;;
--enable-vnc-png) vnc_png="enabled"
;;
- --disable-slirp) slirp="no"
+ --disable-slirp) slirp="disabled"
;;
- --enable-slirp=git) slirp="git"
+ --enable-slirp=git) slirp="internal"
;;
--enable-slirp=system) slirp="system"
;;
;;
--disable-safe-stack) safe_stack="no"
;;
- --disable-curses) curses="no"
+ --disable-curses) curses="disabled"
;;
- --enable-curses) curses="yes"
+ --enable-curses) curses="enabled"
;;
- --disable-iconv) iconv="no"
+ --disable-iconv) iconv="disabled"
;;
- --enable-iconv) iconv="yes"
+ --enable-iconv) iconv="enabled"
;;
--disable-curl) curl="no"
;;
--enable-curl) curl="yes"
;;
- --disable-fdt) fdt="no"
+ --disable-fdt) fdt="disabled"
;;
- --enable-fdt) fdt="yes"
+ --enable-fdt) fdt="enabled"
+ ;;
+ --enable-fdt=git) fdt="internal"
+ ;;
+ --enable-fdt=system) fdt="system"
;;
--disable-linux-aio) linux_aio="no"
;;
;;
--enable-membarrier) membarrier="yes"
;;
- --disable-blobs) blobs="no"
+ --disable-blobs) blobs="false"
;;
--with-pkgversion=*) pkgversion="$optarg"
;;
;;
--disable-crypto-afalg) crypto_afalg="no"
;;
- --disable-docs) docs="no"
+ --disable-docs) docs="disabled"
;;
- --enable-docs) docs="yes"
+ --enable-docs) docs="enabled"
;;
--disable-vhost-net) vhost_net="no"
;;
;;
--enable-vhost-vsock) vhost_vsock="yes"
;;
+ --disable-vhost-user-blk-server) vhost_user_blk_server="no"
+ ;;
+ --enable-vhost-user-blk-server) vhost_user_blk_server="yes"
+ ;;
--disable-vhost-user-fs) vhost_user_fs="no"
;;
--enable-vhost-user-fs) vhost_user_fs="yes"
;;
--enable-vhost-kernel) vhost_kernel="yes"
;;
- --disable-capstone) capstone="no"
+ --disable-capstone) capstone="disabled"
;;
- --enable-capstone) capstone="yes"
+ --enable-capstone) capstone="enabled"
;;
- --enable-capstone=git) capstone="git"
+ --enable-capstone=git) capstone="internal"
;;
--enable-capstone=system) capstone="system"
;;
esac
done
-firmwarepath="${firmwarepath:-$prefix/share/qemu-firmware}"
libdir="${libdir:-$prefix/lib}"
libexecdir="${libexecdir:-$prefix/libexec}"
includedir="${includedir:-$prefix/include}"
docdir="$prefix"
bindir="$prefix"
sysconfdir="$prefix"
- local_statedir=
+ local_statedir="$prefix"
else
mandir="${mandir:-$prefix/share/man}"
datadir="${datadir:-$prefix/share}"
sysconfdir="${sysconfdir:-$prefix/etc}"
local_statedir="${local_statedir:-$prefix/var}"
fi
+firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
+localedir="${localedir:-$datadir/locale}"
case "$cpu" in
ppc)
linux_user="no"
fi
-if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
- tcg="disabled"
-fi
-
default_target_list=""
deprecated_targets_list=ppc64abi32-linux-user,tilegx-linux-user,lm32-softmmu,unicore32-softmmu
deprecated_features=""
mak_wilds=""
if [ "$softmmu" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/devices/*-softmmu.mak"
+ mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-softmmu.mak"
fi
if [ "$linux_user" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/devices/*-linux-user.mak"
+ mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-linux-user.mak"
fi
if [ "$bsd_user" = "yes" ]; then
- mak_wilds="${mak_wilds} $source_path/default-configs/devices/*-bsd-user.mak"
+ mak_wilds="${mak_wilds} $source_path/default-configs/targets/*-bsd-user.mak"
fi
# If the user doesn't explicitly specify a deprecated target we will
--prefix=PREFIX install in PREFIX [$prefix]
--interp-prefix=PREFIX where to find shared libraries, etc.
use %M for cpu name [$interp_prefix]
- --target-list=LIST set target list (default: build everything)
+ --target-list=LIST set target list (default: build all non-deprecated)
$(echo Available targets: $default_target_list | \
fold -s -w 53 | sed -e 's/^/ /')
+$(echo Deprecated targets: $deprecated_targets_list | \
+ fold -s -w 53 | sed -e 's/^/ /')
--target-list-exclude=LIST exclude a set of targets from the default target-list
Advanced options (experts only):
--static enable static build [$static]
--mandir=PATH install man pages in PATH
--datadir=PATH install firmware in PATH/$qemu_suffix
+ --localedir=PATH install translation in PATH/$qemu_suffix
--docdir=PATH install documentation in PATH/$qemu_suffix
--bindir=PATH install binaries in PATH
--libdir=PATH install libraries in PATH
vnc-png PNG compression for VNC server
cocoa Cocoa UI (Mac OS X only)
virtfs VirtFS
+ virtiofsd build virtiofs daemon (virtiofsd)
+ libudev Use libudev to enumerate host devices
mpath Multipath persistent reservation passthrough
xen xen backend driver support
xen-pci-passthrough PCI passthrough support for Xen
vhost-crypto vhost-user-crypto backend support
vhost-kernel vhost kernel backend support
vhost-user vhost-user backend support
+ vhost-user-blk-server vhost-user-blk server support
vhost-vdpa vhost-vdpa kernel backend support
spice spice
rbd rados block device (rbd)
vvfat vvfat image format support
qed qed image format support
parallels parallels image format support
- sheepdog sheepdog block driver support
+ sheepdog sheepdog block driver support (deprecated)
crypto-afalg Linux AF_ALG crypto backend driver
capstone capstone disassembler support
debug-mutex mutex debugging support
python="$python -B"
if test -z "$meson"; then
- if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.1; then
+ if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.3; then
meson=meson
elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
meson=git
*) meson=$(command -v "$meson") ;;
esac
-# Probe for ninja (used for compdb)
+# Probe for ninja
if test -z "$ninja"; then
for c in ninja ninja-build samu; do
break
fi
done
+ if test -z "$ninja"; then
+ error_exit "Cannot find Ninja"
+ fi
fi
# Check that the C compiler works. Doing this here before testing
if test "$static" = "yes"; then
if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then
- CFLAGS="-fPIE -DPIE $CFLAGS"
+ CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS"
pie="yes"
elif test "$pie" = "yes"; then
pie="no"
fi
elif test "$pie" = "no"; then
- CFLAGS="$CFLAGS_NOPIE $CFLAGS"
- LDFLAGS="$LDFLAGS_NOPIE $LDFLAGS"
+ CONFIGURE_CFLAGS="$CFLAGS_NOPIE $CONFIGURE_CFLAGS"
+ CONFIGURE_LDFLAGS="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS"
elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then
- CFLAGS="-fPIE -DPIE $CFLAGS"
- LDFLAGS="-pie $LDFLAGS"
+ CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS"
+ CONFIGURE_LDFLAGS="-pie $CONFIGURE_LDFLAGS"
pie="yes"
elif test "$pie" = "yes"; then
error_exit "PIE not available due to missing toolchain support"
;;
esac
-for target in $target_list; do
- case "$target" in
- arm-softmmu | aarch64-softmmu | i386-softmmu | x86_64-softmmu)
- edk2_blobs="yes"
- ;;
- esac
-done
-# The EDK2 binaries are compressed with bzip2
-if test "$edk2_blobs" = "yes" && ! has bzip2; then
- error_exit "The bzip2 program is required for building QEMU"
-fi
-
feature_not_found() {
feature=$1
remedy=$2
test "$vhost_kernel" = "yes" && vhost_net=yes
fi
-##########################################
-# MinGW / Mingw-w64 localtime_r/gmtime_r check
-
-if test "$mingw32" = "yes"; then
- # Some versions of MinGW / Mingw-w64 lack localtime_r
- # and gmtime_r entirely.
- #
- # Some versions of Mingw-w64 define a macro for
- # localtime_r/gmtime_r.
- #
- # Some versions of Mingw-w64 will define functions
- # for localtime_r/gmtime_r, but only if you have
- # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun
- # though, unistd.h and pthread.h both define
- # that for you.
- #
- # So this #undef localtime_r and #include <unistd.h>
- # are not in fact redundant.
-cat > $TMPC << EOF
-#include <unistd.h>
-#include <time.h>
-#undef localtime_r
-int main(void) { localtime_r(NULL, NULL); return 0; }
-EOF
- if compile_prog "" "" ; then
- localtime_r="yes"
- else
- localtime_r="no"
- fi
+# libvhost-user is Linux-only
+test "$vhost_user_blk_server" = "" && vhost_user_blk_server=$linux
+if test "$vhost_user_blk_server" = "yes" && test "$linux" = "no"; then
+ error_exit "--enable-vhost-user-blk-server is only available on Linux"
fi
##########################################
xen_ctrl_version="$(printf '%d%02d%02d' \
$($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
xen=enabled
- xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab"
+ xen_pc="xencontrol xenstore xenforeignmemory xengnttab"
xen_pc="$xen_pc xenevtchn xendevicemodel"
if $pkg_config --exists xentoolcore; then
xen_pc="$xen_pc xentoolcore"
xen_libs="$($pkg_config --libs $xen_pc)"
else
- xen_libs="-lxenstore -lxenctrl -lxenguest"
+ xen_libs="-lxenstore -lxenctrl"
xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
# First we test whether Xen headers and libraries are available.
fi
##########################################
-# Sparse probe
-if test "$sparse" != "no" ; then
- if has sparse; then
- sparse=yes
- else
- if test "$sparse" = "yes" ; then
- feature_not_found "sparse" "Install sparse binary"
- fi
- sparse=no
- fi
-fi
-
-##########################################
# X11 probe
if $pkg_config --exists "x11"; then
have_x11=yes
fi
##########################################
-# iconv probe
-if test "$iconv" != "no" ; then
- cat > $TMPC << EOF
-#include <iconv.h>
-int main(void) {
- iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
- return conv != (iconv_t) -1;
-}
-EOF
- iconv_prefix_list="/usr/local:/usr"
- iconv_lib_list=":-liconv"
- IFS=:
- for iconv_prefix in $iconv_prefix_list; do
- IFS=:
- iconv_cflags="-I$iconv_prefix/include"
- iconv_ldflags="-L$iconv_prefix/lib"
- for iconv_link in $iconv_lib_list; do
- unset IFS
- iconv_lib="$iconv_ldflags $iconv_link"
- echo "looking at iconv in '$iconv_cflags' '$iconv_lib'" >> config.log
- if compile_prog "$iconv_cflags" "$iconv_lib" ; then
- iconv_found=yes
- break
- fi
- done
- if test "$iconv_found" = yes ; then
- break
- fi
- done
- if test "$iconv_found" = "yes" ; then
- iconv=yes
- else
- if test "$iconv" = "yes" ; then
- feature_not_found "iconv" "Install iconv devel"
- fi
- iconv=no
- fi
-fi
-
-##########################################
-# curses probe
-if test "$iconv" = "no" ; then
- # curses will need iconv
- curses=no
-fi
-if test "$curses" != "no" ; then
- if test "$mingw32" = "yes" ; then
- curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):"
- curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
- else
- curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:"
- curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw"
- fi
- curses_found=no
- cat > $TMPC << EOF
-#include <locale.h>
-#include <curses.h>
-#include <wchar.h>
-#include <langinfo.h>
-int main(void) {
- const char *codeset;
- wchar_t wch = L'w';
- setlocale(LC_ALL, "");
- resize_term(0, 0);
- addwstr(L"wide chars\n");
- addnwstr(&wch, 1);
- add_wch(WACS_DEGREE);
- codeset = nl_langinfo(CODESET);
- return codeset != 0;
-}
-EOF
- IFS=:
- for curses_inc in $curses_inc_list; do
- # Make sure we get the wide character prototypes
- curses_inc="-DNCURSES_WIDECHAR $curses_inc"
- IFS=:
- for curses_lib in $curses_lib_list; do
- unset IFS
- if compile_prog "$curses_inc" "$curses_lib" ; then
- curses_found=yes
- break
- fi
- done
- if test "$curses_found" = yes ; then
- break
- fi
- done
- unset IFS
- if test "$curses_found" = "yes" ; then
- curses=yes
- else
- if test "$curses" = "yes" ; then
- feature_not_found "curses" "Install ncurses devel"
- fi
- curses=no
- fi
-fi
-
-##########################################
# curl probe
if test "$curl" != "no" ; then
if $pkg_config libcurl --exists; then
fi
if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then
- gio=yes
gio_cflags=$($pkg_config --cflags gio-2.0)
gio_libs=$($pkg_config --libs gio-2.0)
gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0)
if [ ! -x "$gdbus_codegen" ]; then
gdbus_codegen=
fi
+ # Check that the libraries actually work -- Ubuntu 18.04 ships
+ # with pkg-config --static --libs data for gio-2.0 that is missing
+ # -lblkid and will give a link error.
+ write_c_skeleton
+ if compile_prog "" "$gio_libs" ; then
+ gio=yes
+ else
+ gio=no
+ fi
else
gio=no
fi
if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
if cc_has_warning_flag "-Wno-unknown-attributes"; then
glib_cflags="-Wno-unknown-attributes $glib_cflags"
- CFLAGS="-Wno-unknown-attributes $CFLAGS"
+ CONFIGURE_CFLAGS="-Wno-unknown-attributes $CONFIGURE_CFLAGS"
fi
fi
if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
if cc_has_warning_flag "-Wno-unused-function"; then
glib_cflags="$glib_cflags -Wno-unused-function"
- CFLAGS="$CFLAGS -Wno-unused-function"
+ CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Wno-unused-function"
fi
fi
if test "$found" = "no"; then
LIBS="$pthread_lib $LIBS"
fi
- PTHREAD_LIB="$pthread_lib"
break
fi
done
##########################################
# 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
- aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu|rx-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
-elif test "$fdt" != "yes" ; then
- fdt=no
-fi
-
-# fdt is only required when building softmmu targets
-if test -z "$fdt" -a "$softmmu" != "yes" ; then
- fdt="no"
-fi
-
-if test "$fdt" != "no" ; then
- fdt_libs="-lfdt"
- # explicitly check for libfdt_env.h as it is missing in some stable installs
- # and test for required functions to make sure we are on a version >= 1.4.2
- cat > $TMPC << EOF
-#include <libfdt.h>
-#include <libfdt_env.h>
-int main(void) { fdt_check_full(NULL, 0); return 0; }
-EOF
- if compile_prog "" "$fdt_libs" ; then
- # system DTC is good - use it
- fdt=system
- else
- # have GIT checkout, so activate dtc submodule
- if test -e "${source_path}/.git" ; then
- git_submodules="${git_submodules} dtc"
- fi
- if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
- fdt=git
- mkdir -p dtc
- fdt_cflags="-I${source_path}/dtc/libfdt"
- fdt_ldflags="-Ldtc/libfdt"
- fdt_libs="$fdt_libs"
- elif test "$fdt" = "yes" ; then
- # Not a git build & no libfdt found, prompt for system install
- error_exit "DTC (libfdt) version >= 1.4.2 not present." \
- "Please install the DTC (libfdt) devel package"
- else
- # don't have and don't want
- fdt_libs=
- fdt=no
- fi
- fi
-fi
+case "$fdt" in
+ auto | enabled | internal)
+ # Simpler to always update submodule, even if not needed.
+ if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
+ git_submodules="${git_submodules} dtc"
+ fi
+ ;;
+esac
##########################################
# opengl probe (for sdl2, gtk, milkymist-tmu2)
btrfs=yes
fi
-# If we're making warnings fatal, apply this to Sphinx runs as well
-sphinx_werror=""
-if test "$werror" = "yes"; then
- sphinx_werror="-W"
-fi
-
-# Check we have a new enough version of sphinx-build
-has_sphinx_build() {
- # This is a bit awkward but works: create a trivial document and
- # try to run it with our configuration file (which enforces a
- # version requirement). This will fail if either
- # sphinx-build doesn't exist at all or if it is too old.
- mkdir -p "$TMPDIR1/sphinx"
- touch "$TMPDIR1/sphinx/index.rst"
- "$sphinx_build" $sphinx_werror -c "$source_path/docs" \
- -b html "$TMPDIR1/sphinx" \
- "$TMPDIR1/sphinx/out" >> config.log 2>&1
-}
-
-# Check if tools are available to build documentation.
-if test "$docs" != "no" ; then
- if has_sphinx_build; then
- sphinx_ok=yes
- else
- sphinx_ok=no
- fi
- if test "$sphinx_ok" = "yes"; then
- docs=yes
- else
- if test "$docs" = "yes" ; then
- if has $sphinx_build && test "$sphinx_ok" != "yes"; then
- echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2
- fi
- feature_not_found "docs" "Install a Python 3 version of python-sphinx"
- fi
- docs=no
- fi
-fi
-
# Search for bswap_32 function
byteswap_h=no
cat > $TMPC << EOF
# capstone
case "$capstone" in
- "" | yes)
- if $pkg_config capstone; then
- capstone=system
- elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
- capstone=git
- elif test -e "${source_path}/capstone/Makefile" ; then
- capstone=internal
- elif test -z "$capstone" ; then
- capstone=no
- else
- feature_not_found "capstone" "Install capstone devel or git submodule"
- fi
- ;;
-
- system)
- if ! $pkg_config capstone; then
- feature_not_found "capstone" "Install capstone devel"
- fi
- ;;
-esac
-
-case "$capstone" in
- git | internal)
- if test "$capstone" = git; then
+ auto | enabled | internal)
+ # Simpler to always update submodule, even if not needed.
+ if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
git_submodules="${git_submodules} capstone"
fi
- mkdir -p capstone
- if test "$mingw32" = "yes"; then
- LIBCAPSTONE=capstone.lib
- else
- LIBCAPSTONE=libcapstone.a
- fi
- capstone_libs="-Lcapstone -lcapstone"
- capstone_cflags="-I${source_path}/capstone/include"
- ;;
-
- system)
- capstone_libs="$($pkg_config --libs capstone)"
- capstone_cflags="$($pkg_config --cflags capstone)"
- ;;
-
- no)
- ;;
- *)
- error_exit "Unknown state for capstone: $capstone"
;;
esac
##########################################
# check for slirp
-# slirp is only required when building softmmu targets
-if test -z "$slirp" -a "$softmmu" != "yes" ; then
- slirp="no"
-fi
-
-case "$slirp" in
- "" | yes)
- if $pkg_config slirp; then
- slirp=system
- elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then
- slirp=git
- elif test -e "${source_path}/slirp/Makefile" ; then
- slirp=internal
- elif test -z "$slirp" ; then
- slirp=no
- else
- feature_not_found "slirp" "Install slirp devel or git submodule"
- fi
- ;;
-
- system)
- if ! $pkg_config slirp; then
- feature_not_found "slirp" "Install slirp devel"
- fi
- ;;
-esac
-
case "$slirp" in
- git | internal)
- if test "$slirp" = git; then
+ auto | enabled | internal)
+ # Simpler to always update submodule, even if not needed.
+ if test -e "${source_path}/.git" && test $git_update = 'yes' ; then
git_submodules="${git_submodules} slirp"
fi
- mkdir -p slirp
- slirp_cflags="-I${source_path}/slirp/src -Islirp/src"
- slirp_libs="-Lslirp -lslirp"
- if test "$mingw32" = "yes" ; then
- slirp_libs="$slirp_libs -lws2_32 -liphlpapi"
- fi
- ;;
-
- system)
- slirp_version=$($pkg_config --modversion slirp 2>/dev/null)
- slirp_cflags=$($pkg_config --cflags slirp 2>/dev/null)
- slirp_libs=$($pkg_config --libs slirp 2>/dev/null)
- ;;
-
- no)
- ;;
- *)
- error_exit "Unknown state for slirp: $slirp"
;;
esac
QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
debug=no
fi
-if test "$debug_info" = "yes"; then
- CFLAGS="-g $CFLAGS"
- LDFLAGS="-g $LDFLAGS"
-fi
-if test "$debug" = "no"; then
- CFLAGS="-O2 $CFLAGS"
-fi
case "$ARCH" in
alpha)
# Use ASLR, no-SEH and DEP if available
if test "$mingw32" = "yes" ; then
- for flag in --dynamicbase --no-seh --nxcompat; do
+ flags="--no-seh --nxcompat"
+
+ # Disable ASLR for debug builds to allow debugging with gdb
+ if test "$debug" = "no" ; then
+ flags="--dynamicbase $flags"
+ fi
+
+ for flag in $flags; do
if ld_has $flag ; then
QEMU_LDFLAGS="-Wl,$flag $QEMU_LDFLAGS"
fi
done
fi
-# Disable OpenBSD W^X if available
-if test "$tcg" = "enabled" && test "$targetos" = "OpenBSD"; then
- cat > $TMPC <<EOF
- int main(void) { return 0; }
-EOF
- wx_ldflags="-Wl,-z,wxneeded"
- if compile_prog "" "$wx_ldflags"; then
- QEMU_LDFLAGS="$QEMU_LDFLAGS $wx_ldflags"
- fi
-fi
-
-qemu_confdir="$sysconfdir/$qemu_suffix"
-qemu_moddir="$libdir/$qemu_suffix"
-qemu_datadir="$datadir/$qemu_suffix"
-qemu_docdir="$docdir/$qemu_suffix"
-qemu_localedir="$datadir/locale"
-qemu_icondir="$datadir/icons"
-qemu_desktopdir="$datadir/applications"
-
# We can only support ivshmem if we have eventfd
if [ "$eventfd" = "yes" ]; then
ivshmem=yes
update_cxxflags
- if do_cxx $CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
+ if do_cxx $CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
# C++ compiler $cxx works ok with C compiler $cc
:
else
if test $git_update = 'yes' ; then
(cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules")
fi
-if test "$fdt" = "git" ; then
- symlink "$source_path/dtc/Makefile" "dtc/Makefile"
-fi
config_host_mak="config-host.mak"
echo >> $config_host_mak
echo all: >> $config_host_mak
-echo "prefix=$prefix" >> $config_host_mak
-echo "bindir=$bindir" >> $config_host_mak
-echo "libdir=$libdir" >> $config_host_mak
-echo "libexecdir=$libexecdir" >> $config_host_mak
-echo "includedir=$includedir" >> $config_host_mak
-echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
-echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
-echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak
-echo "qemu_moddir=$qemu_moddir" >> $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 "qemu_localedir=$qemu_localedir" >> $config_host_mak
-echo "qemu_icondir=$qemu_icondir" >> $config_host_mak
-echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak
echo "GIT=$git" >> $config_host_mak
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "GIT_UPDATE=$git_update" >> $config_host_mak
if test "$guest_agent" = "yes" ; then
echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak
fi
-if test "$slirp" != "no"; then
- echo "CONFIG_SLIRP=y" >> $config_host_mak
- echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
- echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak
- echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak
-fi
-subdirs=
-if [ "$slirp" = "git" -o "$slirp" = "internal" ]; then
- subdirs="$subdirs slirp"
-fi
+echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
if test "$vde" = "yes" ; then
echo "CONFIG_VDE=y" >> $config_host_mak
echo "VDE_LIBS=$vde_libs" >> $config_host_mak
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "TARGET_DIRS=$target_list" >> $config_host_mak
-if [ "$docs" = "yes" ] ; then
- echo "BUILD_DOCS=yes" >> $config_host_mak
-fi
if test "$modules" = "yes"; then
# $shacmd can generate a hash started with digit, which the compiler doesn't
# like as an symbol. So prefix it with an underscore
echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak
echo "X11_LIBS=$x11_libs" >> $config_host_mak
fi
-if test "$iconv" = "yes" ; then
- echo "CONFIG_ICONV=y" >> $config_host_mak
- echo "ICONV_CFLAGS=$iconv_cflags" >> $config_host_mak
- echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak
-fi
-if test "$curses" = "yes" ; then
- echo "CONFIG_CURSES=y" >> $config_host_mak
- echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak
- echo "CURSES_LIBS=$curses_lib" >> $config_host_mak
-fi
if test "$pipe2" = "yes" ; then
echo "CONFIG_PIPE2=y" >> $config_host_mak
fi
if test "$vhost_vdpa" = "yes" ; then
echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
fi
+if test "$vhost_user_blk_server" = "yes" ; then
+ echo "CONFIG_VHOST_USER_BLK_SERVER=y" >> $config_host_mak
+fi
if test "$vhost_user_fs" = "yes" ; then
echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
fi
-if test "$blobs" = "yes" ; then
- echo "INSTALL_BLOBS=yes" >> $config_host_mak
-fi
if test "$iovec" = "yes" ; then
echo "CONFIG_IOVEC=y" >> $config_host_mak
fi
if test "$preadv" = "yes" ; then
echo "CONFIG_PREADV=y" >> $config_host_mak
fi
-if test "$fdt" != "no" ; then
- echo "CONFIG_FDT=y" >> $config_host_mak
- echo "FDT_CFLAGS=$fdt_cflags" >> $config_host_mak
- echo "FDT_LIBS=$fdt_ldflags $fdt_libs" >> $config_host_mak
-fi
if test "$membarrier" = "yes" ; then
echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
fi
echo "CONFIG_BSD=y" >> $config_host_mak
fi
-if test "$localtime_r" = "yes" ; then
- echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak
-fi
if test "$qom_cast_debug" = "yes" ; then
echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
fi
if test "$ivshmem" = "yes" ; then
echo "CONFIG_IVSHMEM=y" >> $config_host_mak
fi
-if test "$capstone" != "no" ; then
- echo "CONFIG_CAPSTONE=y" >> $config_host_mak
- echo "CAPSTONE_CFLAGS=$capstone_cflags" >> $config_host_mak
- echo "CAPSTONE_LIBS=$capstone_libs" >> $config_host_mak
-fi
if test "$debug_mutex" = "yes" ; then
echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
fi
echo "CONFIG_PARALLELS=y" >> $config_host_mak
fi
if test "$sheepdog" = "yes" ; then
+ add_to deprecated_features "sheepdog"
echo "CONFIG_SHEEPDOG=y" >> $config_host_mak
fi
if test "$pty_h" = "yes" ; then
echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
fi
-if test "$tcg_interpreter" = "yes"; then
- QEMU_INCLUDES="-iquote ${source_path}/tcg/tci $QEMU_INCLUDES"
-elif test "$ARCH" = "sparc64" ; then
- QEMU_INCLUDES="-iquote ${source_path}/tcg/sparc $QEMU_INCLUDES"
-elif test "$ARCH" = "s390x" ; then
- QEMU_INCLUDES="-iquote ${source_path}/tcg/s390 $QEMU_INCLUDES"
-elif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then
- QEMU_INCLUDES="-iquote ${source_path}/tcg/i386 $QEMU_INCLUDES"
-elif test "$ARCH" = "ppc64" ; then
- QEMU_INCLUDES="-iquote ${source_path}/tcg/ppc $QEMU_INCLUDES"
-elif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then
- QEMU_INCLUDES="-I${source_path}/tcg/riscv $QEMU_INCLUDES"
-else
- QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES"
-fi
-
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak
-echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
echo "MESON=$meson" >> $config_host_mak
+echo "NINJA=$ninja" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
if $iasl -h > /dev/null 2>&1; then
echo "CONFIG_IASL=$iasl" >> $config_host_mak
echo "NM=$nm" >> $config_host_mak
echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak
echo "WINDRES=$windres" >> $config_host_mak
-echo "CFLAGS=$CFLAGS" >> $config_host_mak
echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
-echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
-if test "$sparse" = "yes" ; then
- echo "SPARSE_CFLAGS = -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
-fi
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
-echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak
echo "LIBS_QGA=$libs_qga" >> $config_host_mak
fi
echo "FUZZ_EXE_LDFLAGS=$FUZZ_EXE_LDFLAGS" >> $config_host_mak
-if test "$edk2_blobs" = "yes" ; then
- echo "DECOMPRESS_EDK2_BLOBS=y" >> $config_host_mak
-fi
-
if test "$rng_none" = "yes"; then
echo "CONFIG_RNG_NONE=y" >> $config_host_mak
fi
esac
done
-if [ "$fdt" = "git" ]; then
- subdirs="$subdirs dtc"
-fi
-if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then
- subdirs="$subdirs capstone"
-fi
echo "CONFIG_QEMU_INTERP_PREFIX=$interp_prefix" | sed 's/%M/@0@/' >> $config_host_mak
if test "$default_targets" = "yes"; then
echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak
fi
-echo "SUBDIRS=$subdirs" >> $config_host_mak
-if test -n "$LIBCAPSTONE"; then
- echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak
-fi
if test "$numa" = "yes"; then
echo "CONFIG_NUMA=y" >> $config_host_mak
if test "$skip_meson" = no; then
cross="config-meson.cross.new"
meson_quote() {
- echo "['$(echo $* | sed "s/ /','/g")']"
+ echo "'$(echo $* | sed "s/ /','/g")'"
}
echo "# Automatically generated by configure - do not modify" > $cross
echo "[properties]" >> $cross
test -z "$cxx" && echo "link_language = 'c'" >> $cross
+echo "[built-in options]" >> $cross
+echo "c_args = [${CFLAGS:+$(meson_quote $CFLAGS)}]" >> $cross
+echo "cpp_args = [${CXXFLAGS:+$(meson_quote $CXXFLAGS)}]" >> $cross
+echo "c_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
+echo "cpp_link_args = [${LDFLAGS:+$(meson_quote $LDFLAGS)}]" >> $cross
echo "[binaries]" >> $cross
-echo "c = $(meson_quote $cc)" >> $cross
-test -n "$cxx" && echo "cpp = $(meson_quote $cxx)" >> $cross
-echo "ar = $(meson_quote $ar)" >> $cross
-echo "nm = $(meson_quote $nm)" >> $cross
-echo "pkgconfig = $(meson_quote $pkg_config_exe)" >> $cross
-echo "ranlib = $(meson_quote $ranlib)" >> $cross
+echo "c = [$(meson_quote $cc)]" >> $cross
+test -n "$cxx" && echo "cpp = [$(meson_quote $cxx)]" >> $cross
+echo "ar = [$(meson_quote $ar)]" >> $cross
+echo "nm = [$(meson_quote $nm)]" >> $cross
+echo "pkgconfig = [$(meson_quote $pkg_config_exe)]" >> $cross
+echo "ranlib = [$(meson_quote $ranlib)]" >> $cross
if has $sdl2_config; then
- echo "sdl2-config = $(meson_quote $sdl2_config)" >> $cross
+ echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross
fi
-echo "strip = $(meson_quote $strip)" >> $cross
-echo "windres = $(meson_quote $windres)" >> $cross
+echo "strip = [$(meson_quote $strip)]" >> $cross
+echo "windres = [$(meson_quote $windres)]" >> $cross
if test -n "$cross_prefix"; then
cross_arg="--cross-file config-meson.cross"
echo "[host_machine]" >> $cross
mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs
-NINJA=${ninja:-$PWD/ninjatool} $meson setup \
+unset staticpic
+if ! version_ge "$($meson --version)" 0.56.0; then
+ staticpic=$(if test "$pie" = yes; then echo true; else echo false; fi)
+fi
+NINJA=$ninja $meson setup \
--prefix "$prefix" \
--libdir "$libdir" \
--libexecdir "$libexecdir" \
--datadir "$datadir" \
--mandir "$mandir" \
--sysconfdir "$sysconfdir" \
+ --localedir "$localedir" \
--localstatedir "$local_statedir" \
-Ddocdir="$docdir" \
+ -Dqemu_firmwarepath="$firmwarepath" \
-Dqemu_suffix="$qemu_suffix" \
-Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
-Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
-Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
-Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
+ ${staticpic:+-Db_staticpic=$staticpic} \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
- -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim \
- -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
- -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
- -Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
- -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
- -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f\
+ -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
+ -Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
+ -Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
+ -Dcocoa=$cocoa -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
+ -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
+ -Dgettext=$gettext -Dxkbcommon=$xkbcommon -Du2f=$u2f -Dvirtiofsd=$virtiofsd \
+ -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \
+ -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
+ -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
$cross_arg \
"$PWD" "$source_path"
if test "$?" -ne 0 ; then
error_exit "meson setup failed"
fi
-touch ninjatool.stamp
fi
if test -n "${deprecated_features}"; then