TMPO="${TMPDIR1}/${TMPB}.o"
TMPCXX="${TMPDIR1}/${TMPB}.cxx"
TMPE="${TMPDIR1}/${TMPB}.exe"
-TMPTXT="${TMPDIR1}/${TMPB}.txt"
rm -f config.log
audio_drv_list="default"
block_drv_rw_whitelist=""
block_drv_ro_whitelist=""
-block_drv_whitelist_tools="no"
host_cc="cc"
-libs_qga=""
debug_info="yes"
lto="false"
stack_protector=""
EXTRA_LDFLAGS=""
xen_ctrl_version="$default_feature"
-xfs="$default_feature"
-membarrier="$default_feature"
vhost_kernel="$default_feature"
vhost_net="$default_feature"
vhost_crypto="$default_feature"
vhost_vdpa="$default_feature"
rdma="$default_feature"
pvrdma="$default_feature"
-gprof="no"
debug_tcg="no"
debug="no"
sanitizers="no"
tsan="no"
fortify_source="$default_feature"
-strip_opt="yes"
-mingw32="no"
gcov="no"
EXESUF=""
modules="no"
module_upgrades="no"
prefix="/usr/local"
qemu_suffix="qemu"
-bsd="no"
-linux="no"
-solaris="no"
-profiler="no"
softmmu="yes"
-linux_user="no"
-bsd_user="no"
+linux_user=""
+bsd_user=""
pkgversion=""
pie=""
-qom_cast_debug="yes"
trace_backends="log"
trace_file="trace"
opengl="$default_feature"
-cpuid_h="no"
-avx2_opt="$default_feature"
-guest_agent="$default_feature"
-guest_agent_with_vss="no"
-guest_agent_ntddscsi="no"
-vss_win32_sdk="$default_feature"
-win_sdk="no"
-want_tools="$default_feature"
coroutine=""
-coroutine_pool="$default_feature"
-debug_stack_usage="no"
-crypto_afalg="no"
tls_priority="NORMAL"
-tpm="$default_feature"
-live_block_migration=${default_feature:-yes}
-numa="$default_feature"
-replication=${default_feature:-yes}
-bochs=${default_feature:-yes}
-cloop=${default_feature:-yes}
-dmg=${default_feature:-yes}
-qcow1=${default_feature:-yes}
-vdi=${default_feature:-yes}
-vvfat=${default_feature:-yes}
-qed=${default_feature:-yes}
-parallels=${default_feature:-yes}
-debug_mutex="no"
plugins="$default_feature"
-rng_none="no"
secret_keyring="$default_feature"
meson=""
meson_args=""
ninja=""
gio="$default_feature"
skip_meson=no
-slirp_smbd="$default_feature"
# The following Meson options are handled manually (still they
# are included in the automatically generated help message)
# 1. Track which submodules are needed
-capstone="auto"
+if test "$default_feature" = no ; then
+ capstone="disabled"
+ slirp="disabled"
+else
+ capstone="auto"
+ slirp="auto"
+fi
fdt="auto"
-slirp="auto"
# 2. Support --with/--without option
default_devices="true"
;;
--cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
;;
- --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*}
+ --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-cflags-}; cc_arch=${cc_arch%%=*}
eval "cross_cc_cflags_${cc_arch}=\$optarg"
cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
;;
ld="${LD-${cross_prefix}ld}"
ranlib="${RANLIB-${cross_prefix}ranlib}"
nm="${NM-${cross_prefix}nm}"
+smbd="$SMBD"
strip="${STRIP-${cross_prefix}strip}"
windres="${WINDRES-${cross_prefix}windres}"
pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
# OS specific
+mingw32="no"
+bsd="no"
+linux="no"
+solaris="no"
case $targetos in
windows)
mingw32="yes"
;;
freebsd)
bsd="yes"
- bsd_user="yes"
make="${MAKE-gmake}"
# needed for kinfo_getvmmap(3) in libutil.h
;;
sunos)
solaris="yes"
make="${MAKE-gmake}"
- smbd="${SMBD-/usr/sfw/sbin/smbd}"
# needed for CMSG_ macros in sys/socket.h
QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
# needed for TIOCWIN* defines in termios.h
;;
linux)
linux="yes"
- linux_user="yes"
vhost_user=${default_feature:-yes}
;;
esac
cpu="arm"
elif check_define __aarch64__ ; then
cpu="aarch64"
+elif check_define __loongarch64 ; then
+ cpu="loongarch64"
else
cpu=$(uname -m)
fi
-ARCH=
-# Normalise host CPU name, set ARCH and multilib cflags
+# Normalise host CPU name, set multilib cflags
# Note that this case should only have supported host CPUs, not guests.
case "$cpu" in
- aarch64|riscv) ;;
armv*b|armv*l|arm)
cpu="arm" ;;
CPU_CFLAGS="-m64 -mlittle" ;;
s390)
- CPU_CFLAGS="-m31"
- ARCH=unknown ;;
+ CPU_CFLAGS="-m31" ;;
s390x)
CPU_CFLAGS="-m64" ;;
CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" ;;
sparc64)
CPU_CFLAGS="-m64 -mcpu=ultrasparc" ;;
-
- *)
- # This will result in either an error or falling back to TCI later
- ARCH=unknown
- ;;
esac
-if test -z "$ARCH"; then
- ARCH="$cpu"
-fi
: ${make=${MAKE-make}}
write_c_skeleton;
prefix="/qemu"
qemu_suffix=""
- libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga"
fi
werror=""
;;
--without-default-features) # processed above
;;
- --enable-gprof) gprof="yes"
- ;;
--enable-gcov) gcov="yes"
;;
--static)
# configure to be used by RPM and similar macros that set
# lots of directory switches by default.
;;
- --disable-qom-cast-debug) qom_cast_debug="no"
- ;;
- --enable-qom-cast-debug) qom_cast_debug="yes"
- ;;
--audio-drv-list=*) audio_drv_list="$optarg"
;;
--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-block-drv-whitelist-in-tools) block_drv_whitelist_tools="yes"
- ;;
- --disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="no"
- ;;
--enable-debug-tcg) debug_tcg="yes"
;;
--disable-debug-tcg) debug_tcg="no"
--enable-debug)
# Enable debugging options that aren't excessively noisy
debug_tcg="yes"
- debug_mutex="yes"
+ meson_option_parse --enable-debug-mutex ""
debug="yes"
- strip_opt="no"
fortify_source="no"
;;
--enable-sanitizers) sanitizers="yes"
;;
--disable-tsan) tsan="no"
;;
- --disable-strip) strip_opt="no"
- ;;
--disable-slirp) slirp="disabled"
;;
--enable-slirp) slirp="enabled"
;;
--enable-tcg) tcg="enabled"
;;
- --enable-profiler) profiler="yes"
- ;;
--disable-system) softmmu="no"
;;
--enable-system) softmmu="yes"
;;
--enable-fdt=*) fdt="$optarg"
;;
- --disable-membarrier) membarrier="no"
- ;;
- --enable-membarrier) membarrier="yes"
- ;;
--with-pkgversion=*) pkgversion="$optarg"
;;
--with-coroutine=*) coroutine="$optarg"
;;
- --disable-coroutine-pool) coroutine_pool="no"
- ;;
- --enable-coroutine-pool) coroutine_pool="yes"
- ;;
- --enable-debug-stack-usage) debug_stack_usage="yes"
- ;;
- --enable-crypto-afalg) crypto_afalg="yes"
- ;;
- --disable-crypto-afalg) crypto_afalg="no"
- ;;
--disable-vhost-net) vhost_net="no"
;;
--enable-vhost-net) vhost_net="yes"
;;
--enable-opengl) opengl="yes"
;;
- --disable-xfsctl) xfs="no"
- ;;
- --enable-xfsctl) xfs="yes"
- ;;
--disable-zlib-test)
;;
- --enable-guest-agent) guest_agent="yes"
- ;;
- --disable-guest-agent) guest_agent="no"
- ;;
- --with-vss-sdk) vss_win32_sdk=""
- ;;
- --with-vss-sdk=*) vss_win32_sdk="$optarg"
- ;;
- --without-vss-sdk) vss_win32_sdk="no"
- ;;
- --with-win-sdk) win_sdk=""
- ;;
- --with-win-sdk=*) win_sdk="$optarg"
- ;;
- --without-win-sdk) win_sdk="no"
- ;;
- --enable-tools) want_tools="yes"
- ;;
- --disable-tools) want_tools="no"
- ;;
- --disable-avx2) avx2_opt="no"
- ;;
- --enable-avx2) avx2_opt="yes"
- ;;
- --disable-avx512f) avx512f_opt="no"
- ;;
- --enable-avx512f) avx512f_opt="yes"
- ;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2
;;
;;
--disable-pvrdma) pvrdma="no"
;;
- --disable-tpm) tpm="no"
- ;;
- --enable-tpm) tpm="yes"
- ;;
- --disable-live-block-migration) live_block_migration="no"
- ;;
- --enable-live-block-migration) live_block_migration="yes"
- ;;
- --disable-numa) numa="no"
- ;;
- --enable-numa) numa="yes"
- ;;
- --disable-replication) replication="no"
- ;;
- --enable-replication) replication="yes"
- ;;
- --disable-bochs) bochs="no"
- ;;
- --enable-bochs) bochs="yes"
- ;;
- --disable-cloop) cloop="no"
- ;;
- --enable-cloop) cloop="yes"
- ;;
- --disable-dmg) dmg="no"
- ;;
- --enable-dmg) dmg="yes"
- ;;
- --disable-qcow1) qcow1="no"
- ;;
- --enable-qcow1) qcow1="yes"
- ;;
- --disable-vdi) vdi="no"
- ;;
- --enable-vdi) vdi="yes"
- ;;
- --disable-vvfat) vvfat="no"
- ;;
- --enable-vvfat) vvfat="yes"
- ;;
- --disable-qed) qed="no"
- ;;
- --enable-qed) qed="yes"
- ;;
- --disable-parallels) parallels="no"
- ;;
- --enable-parallels) parallels="yes"
- ;;
--disable-vhost-user) vhost_user="no"
;;
--enable-vhost-user) vhost_user="yes"
--with-git-submodules=*)
git_submodules_action="$optarg"
;;
- --enable-debug-mutex) debug_mutex=yes
- ;;
- --disable-debug-mutex) debug_mutex=no
- ;;
--enable-plugins) if test "$mingw32" = "yes"; then
error_exit "TCG plugins not currently supported on Windows platforms"
else
;;
--gdb=*) gdb_bin="$optarg"
;;
- --enable-rng-none) rng_none=yes
- ;;
- --disable-rng-none) rng_none=no
- ;;
--enable-keyring) secret_keyring="yes"
;;
--disable-keyring) secret_keyring="no"
;;
--disable-gio) gio=no
;;
- --enable-slirp-smbd) slirp_smbd=yes
- ;;
- --disable-slirp-smbd) slirp_smbd=no
- ;;
# backwards compatibility options
--enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg"
;;
cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"
fi
-# For user-mode emulation the host arch has to be one we explicitly
-# support, even if we're using TCI.
-if [ "$ARCH" = "unknown" ]; then
- bsd_user="no"
- linux_user="no"
-fi
-
default_target_list=""
-deprecated_targets_list=ppc64abi32-linux-user
-deprecated_features=""
mak_wilds=""
+if [ "$linux_user" != no ]; then
+ if [ "$targetos" = linux ] && [ -d $source_path/linux-user/include/host/$cpu ]; then
+ linux_user=yes
+ elif [ "$linux_user" = yes ]; then
+ error_exit "linux-user not supported on this architecture"
+ fi
+fi
+if [ "$bsd_user" != no ]; then
+ if [ "$bsd_user" = "" ]; then
+ test $targetos = freebsd && bsd_user=yes
+ fi
+ if [ "$bsd_user" = yes ] && ! [ -d $source_path/bsd-user/$targetos ]; then
+ error_exit "bsd-user not supported on this host OS"
+ fi
+fi
if [ "$softmmu" = "yes" ]; then
mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak"
fi
mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
fi
-# If the user doesn't explicitly specify a deprecated target we will
-# skip it.
-if test -z "$target_list"; then
- if test -z "$target_list_exclude"; then
- target_list_exclude="$deprecated_targets_list"
- else
- target_list_exclude="$target_list_exclude,$deprecated_targets_list"
- fi
-fi
-
for config in $mak_wilds; do
target="$(basename "$config" .mak)"
if echo "$target_list_exclude" | grep -vq "$target"; then
--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 all non-deprecated)
+ --target-list=LIST set target list (default: build all)
$(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):
--extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
--cross-cc-ARCH=CC use compiler when building ARCH guest test cases
- --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests
+ --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests
--make=MAKE use specified make [$make]
--python=PYTHON use specified python [$python]
--sphinx-build=SPHINX use specified sphinx-build [$sphinx_build]
--enable-debug enable common debug build options
--enable-sanitizers enable default sanitizers
--enable-tsan enable thread sanitizer
- --disable-strip disable stripping binaries
--disable-werror disable compilation abort on warning
--disable-stack-protector disable compiler-provided stack protection
--audio-drv-list=LIST set audio drivers to try if -audiodev is not used
--block-drv-ro-whitelist=L
set block driver read-only whitelist
(by default affects only QEMU, not tools like qemu-img)
- --enable-block-drv-whitelist-in-tools
- use block whitelist also in tools instead of only QEMU
--with-trace-file=NAME Full PATH,NAME of file to store traces
Default:trace-<pid>
--cpu=CPU Build for host CPU [$cpu]
--with-coroutine=BACKEND coroutine backend. Supported options:
ucontext, sigaltstack, windows
--enable-gcov enable test coverage analysis with gcov
- --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
- --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
--tls-priority default TLS protocol/cipher priority string
- --enable-gprof QEMU profiling with gprof
- --enable-profiler profiler support
- --enable-debug-stack-usage
- track the maximum stack usage of stacks created by qemu_alloc_stack
--enable-plugins
enable plugins via shared library loading
--disable-containers don't use containers for cross-building
user supported user emulation targets
linux-user all linux usermode emulation targets
bsd-user all BSD usermode emulation targets
- guest-agent build the QEMU Guest Agent
pie Position Independent Executables
modules modules support (non-Windows)
module-upgrades try to load modules from alternate paths for upgrades
lto Enable Link-Time Optimization.
safe-stack SafeStack Stack Smash Protection. Depends on
clang/llvm >= 3.7 and requires coroutine backend ucontext.
- membarrier membarrier system call (for Linux 4.14+ or Windows)
rdma Enable RDMA-based migration
pvrdma Enable PVRDMA support
vhost-net vhost-net kernel acceleration support
vhost-kernel vhost kernel backend support
vhost-user vhost-user backend support
vhost-vdpa vhost-vdpa kernel backend support
- live-block-migration Block migration in the main migration stream
- coroutine-pool coroutine freelist (better performance)
- tpm TPM support
- numa libnuma support
- avx2 AVX2 optimization support
- avx512f AVX512F optimization support
- replication replication support
opengl opengl support
- xfsctl xfsctl support
- qom-cast-debug cast debugging support
- tools build qemu-io, qemu-nbd and qemu-img tools
- bochs bochs image format support
- cloop cloop image format support
- dmg dmg image format support
- qcow1 qcow v1 image format support
- vdi vdi image format support
- vvfat vvfat image format support
- qed qed image format support
- parallels parallels image format support
- crypto-afalg Linux AF_ALG crypto backend driver
- debug-mutex mutex debugging support
- rng-none dummy RNG, avoid using /dev/(u)random and getrandom()
gio libgio support
- slirp-smbd use smbd (at path --smbd=*) in slirp networking
NOTE: The object files are built at the place where configure is launched
EOF
plugins="no"
fi
fi
+test "$plugins" = "" && plugins=yes
cat > $TMPC << EOF
done
fi
-for target in $target_list; do
- # if a deprecated target is enabled we note it here
- if echo "$deprecated_targets_list" | grep -q "$target"; then
- add_to deprecated_features $target
- fi
-done
-
# see if system emulation was really requested
case " $target_list " in
*"-softmmu "*) softmmu=yes
exit 1
fi
-##########################################
-# system tools
-if test -z "$want_tools"; then
- if test "$softmmu" = "no"; then
- want_tools=no
- else
- want_tools=yes
- fi
-fi
-
#########################################
# vhost interdependencies and host support
fi
fi
-##########################################
-# xfsctl() probe, used for file-posix.c
-if test "$xfs" != "no" ; then
- cat > $TMPC << EOF
-#include <stddef.h> /* NULL */
-#include <xfs/xfs.h>
-int main(void)
-{
- xfsctl(NULL, 0, 0, NULL);
- return 0;
-}
-EOF
- if compile_prog "" "" ; then
- xfs="yes"
- else
- if test "$xfs" = "yes" ; then
- feature_not_found "xfs" "Install xfsprogs/xfslibs devel"
- fi
- xfs=no
- fi
-fi
-
-##########################################
-# plugin linker support probe
-
-if test "$plugins" != "no"; then
-
- #########################################
- # See if --dynamic-list is supported by the linker
-
- ld_dynamic_list="no"
- cat > $TMPTXT <<EOF
-{
- foo;
-};
-EOF
-
- cat > $TMPC <<EOF
-#include <stdio.h>
-void foo(void);
-
-void foo(void)
-{
- printf("foo\n");
-}
-
-int main(void)
-{
- foo();
- return 0;
-}
-EOF
-
- if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then
- ld_dynamic_list="yes"
- fi
-
- #########################################
- # See if -exported_symbols_list is supported by the linker
-
- ld_exported_symbols_list="no"
- cat > $TMPTXT <<EOF
- _foo
-EOF
-
- if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then
- ld_exported_symbols_list="yes"
- fi
-
- if test "$ld_dynamic_list" = "no" &&
- test "$ld_exported_symbols_list" = "no" ; then
- if test "$plugins" = "yes"; then
- error_exit \
- "Plugin support requires dynamic linking and specifying a set of symbols " \
- "that are exported to plugins. Unfortunately your linker doesn't " \
- "support the flag (--dynamic-list or -exported_symbols_list) used " \
- "for this purpose."
- else
- plugins="no"
- fi
- else
- plugins="yes"
- fi
-fi
-
##########################################
# glib support probe
fi
fi
-##########################################
-# TPM emulation is only on POSIX
-
-if test "$tpm" = ""; then
- if test "$mingw32" = "yes"; then
- tpm=no
- else
- tpm=yes
- fi
-elif test "$tpm" = "yes"; then
- if test "$mingw32" = "yes" ; then
- error_exit "TPM emulation only available on POSIX systems"
- fi
-fi
-
##########################################
# fdt probe
fi
fi
-##########################################
-# libnuma probe
-
-if test "$numa" != "no" ; then
- cat > $TMPC << EOF
-#include <numa.h>
-int main(void) { return numa_available(); }
-EOF
-
- if compile_prog "" "-lnuma" ; then
- numa=yes
- numa_libs="-lnuma"
- else
- if test "$numa" = "yes" ; then
- feature_not_found "numa" "install numactl devel"
- fi
- numa=no
- fi
-fi
-
# check for usbfs
have_usbfs=no
if test "$linux_user" = "yes"; then
fi
fi
-##########################################
-# check if we have VSS SDK headers for win
-
-if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
- test "$vss_win32_sdk" != "no" ; then
- case "$vss_win32_sdk" in
- "") vss_win32_include="-isystem $source_path" ;;
- *\ *) # The SDK is installed in "Program Files" by default, but we cannot
- # handle path with spaces. So we symlink the headers into ".sdk/vss".
- vss_win32_include="-isystem $source_path/.sdk/vss"
- symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc"
- ;;
- *) vss_win32_include="-isystem $vss_win32_sdk"
- esac
- cat > $TMPC << EOF
-#define __MIDL_user_allocate_free_DEFINED__
-#include <inc/win2003/vss.h>
-int main(void) { return VSS_CTX_BACKUP; }
-EOF
- if compile_prog "$vss_win32_include" "" ; then
- guest_agent_with_vss="yes"
- QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include"
- libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
- qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
- else
- if test "$vss_win32_sdk" != "" ; then
- echo "ERROR: Please download and install Microsoft VSS SDK:"
- echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490"
- echo "ERROR: On POSIX-systems, you can extract the SDK headers by:"
- echo "ERROR: scripts/extract-vsssdk-headers setup.exe"
- echo "ERROR: The headers are extracted in the directory \`inc'."
- feature_not_found "VSS support"
- fi
- guest_agent_with_vss="no"
- fi
-fi
-
-##########################################
-# lookup Windows platform SDK (if not specified)
-# The SDK is needed only to build .tlb (type library) file of guest agent
-# VSS provider from the source. It is usually unnecessary because the
-# pre-compiled .tlb file is included.
-
-if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
- test "$guest_agent_with_vss" = "yes" ; then
- if test -z "$win_sdk"; then
- programfiles="$PROGRAMFILES"
- test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432"
- if test -n "$programfiles"; then
- win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null
- else
- feature_not_found "Windows SDK"
- fi
- elif test "$win_sdk" = "no"; then
- win_sdk=""
- fi
-fi
-
-##########################################
-# check if mingw environment provides a recent ntddscsi.h
-if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then
- cat > $TMPC << EOF
-#include <windows.h>
-#include <ntddscsi.h>
-int main(void) {
-#if !defined(IOCTL_SCSI_GET_ADDRESS)
-#error Missing required ioctl definitions
-#endif
- SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
- return addr.Lun;
-}
-EOF
- if compile_prog "" "" ; then
- guest_agent_ntddscsi=yes
- libs_qga="-lsetupapi -lcfgmgr32 $libs_qga"
- fi
-fi
-
##########################################
# capstone
esac
fi
-if test "$coroutine_pool" = ""; then
- coroutine_pool=yes
-fi
-
-if test "$debug_stack_usage" = "yes"; then
- if test "$coroutine_pool" = "yes"; then
- echo "WARN: disabling coroutine pool for stack usage debugging"
- coroutine_pool=no
- fi
-fi
-
##################################################
# SafeStack
fi
fi
-########################################
-# check if cpuid.h is usable.
-
-cat > $TMPC << EOF
-#include <cpuid.h>
-int main(void) {
- unsigned a, b, c, d;
- int max = __get_cpuid_max(0, 0);
-
- if (max >= 1) {
- __cpuid(1, a, b, c, d);
- }
-
- if (max >= 7) {
- __cpuid_count(7, 0, a, b, c, d);
- }
-
- return 0;
-}
-EOF
-if compile_prog "" "" ; then
- cpuid_h=yes
-fi
-
-##########################################
-# avx2 optimization requirement check
-#
-# There is no point enabling this if cpuid.h is not usable,
-# since we won't be able to select the new routines.
-
-if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
- cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx2")
-#include <cpuid.h>
-#include <immintrin.h>
-static int bar(void *a) {
- __m256i x = *(__m256i *)a;
- return _mm256_testz_si256(x, x);
-}
-int main(int argc, char *argv[]) { return bar(argv[0]); }
-EOF
- if compile_object "-Werror" ; then
- avx2_opt="yes"
- else
- avx2_opt="no"
- fi
-fi
-
-##########################################
-# avx512f optimization requirement check
-#
-# There is no point enabling this if cpuid.h is not usable,
-# since we won't be able to select the new routines.
-# by default, it is turned off.
-# if user explicitly want to enable it, check environment
-
-if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then
- cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx512f")
-#include <cpuid.h>
-#include <immintrin.h>
-static int bar(void *a) {
- __m512i x = *(__m512i *)a;
- return _mm512_test_epi64_mask(x, x);
-}
-int main(int argc, char *argv[])
-{
- return bar(argv[0]);
-}
-EOF
- if ! compile_object "-Werror" ; then
- avx512f_opt="no"
- fi
-else
- avx512f_opt="no"
-fi
-
########################################
# check if __[u]int128_t is usable.
fi
fi
-##########################################
-# check for usable membarrier system call
-if test "$membarrier" = "yes"; then
- have_membarrier=no
- if test "$mingw32" = "yes" ; then
- have_membarrier=yes
- elif test "$linux" = "yes" ; then
- cat > $TMPC << EOF
- #include <linux/membarrier.h>
- #include <sys/syscall.h>
- #include <unistd.h>
- #include <stdlib.h>
- int main(void) {
- syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0);
- syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0);
- exit(0);
- }
-EOF
- if compile_prog "" "" ; then
- have_membarrier=yes
- fi
- fi
- if test "$have_membarrier" = "no"; then
- feature_not_found "membarrier" "membarrier system call not available"
- fi
-else
- # Do not enable it by default even for Mingw32, because it doesn't
- # work on Wine.
- membarrier=no
-fi
-
-##########################################
-# check for usable AF_ALG environment
-have_afalg=no
-cat > $TMPC << EOF
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <linux/if_alg.h>
-int main(void) {
- int sock;
- sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
- return sock;
-}
-EOF
-if compile_prog "" "" ; then
- have_afalg=yes
-fi
-if test "$crypto_afalg" = "yes"
-then
- if test "$have_afalg" != "yes"
- then
- error_exit "AF_ALG requested but could not be detected"
- fi
-fi
-
-
##########################################
# checks for sanitizers
;;
esac
-# Check for slirp smbd dupport
-: ${smbd=${SMBD-/usr/sbin/smbd}}
-if test "$slirp_smbd" != "no" ; then
- if test "$mingw32" = "yes" ; then
- if test "$slirp_smbd" = "yes" ; then
- error_exit "Host smbd not supported on this platform."
- fi
- slirp_smbd=no
- else
- slirp_smbd=yes
- fi
-fi
-
##########################################
# check for usable __NR_keyctl syscall
;;
esac
-if test "$gprof" = "yes" ; then
- QEMU_CFLAGS="-p $QEMU_CFLAGS"
- QEMU_LDFLAGS="-p $QEMU_LDFLAGS"
-fi
-
if test "$have_asan" = "yes"; then
QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS"
QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS"
done
fi
-# Probe for guest agent support/options
-
-if [ "$guest_agent" != "no" ]; then
- if [ "$softmmu" = no -a "$want_tools" = no ] ; then
- guest_agent=no
- elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
- guest_agent=yes
- elif [ "$guest_agent" != yes ]; then
- guest_agent=no
- else
- error_exit "Guest agent is not supported on this platform"
- fi
-fi
-
# Guest agent Windows MSI package
if test "$QEMU_GA_MANUFACTURER" = ""; then
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
-echo "ARCH=$ARCH" >> $config_host_mak
-
if test "$debug_tcg" = "yes" ; then
echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
fi
-if test "$strip_opt" = "yes" ; then
- echo "STRIP=${strip}" >> $config_host_mak
-fi
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
- if test "$guest_agent_with_vss" = "yes" ; then
- echo "CONFIG_QGA_VSS=y" >> $config_host_mak
- echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
- echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
- fi
- if test "$guest_agent_ntddscsi" = "yes" ; then
- echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak
- fi
echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
if test "$static" = "yes" ; then
echo "CONFIG_STATIC=y" >> $config_host_mak
fi
-if test "$profiler" = "yes" ; then
- echo "CONFIG_PROFILER=y" >> $config_host_mak
-fi
-if test "$want_tools" = "yes" ; then
- echo "CONFIG_TOOLS=y" >> $config_host_mak
-fi
-if test "$guest_agent" = "yes" ; then
- echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak
-fi
-if test "$slirp_smbd" = "yes" ; then
- echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
- echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
-fi
-if test "$gprof" = "yes" ; then
- echo "CONFIG_GPROF=y" >> $config_host_mak
-fi
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 "$block_drv_whitelist_tools" = "yes" ; then
- echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak
-fi
-if test "$xfs" = "yes" ; then
- echo "CONFIG_XFS=y" >> $config_host_mak
-fi
qemu_version=$(head $source_path/VERSION)
echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
if test "$vhost_user_fs" = "yes" ; then
echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
fi
-if test "$membarrier" = "yes" ; then
- echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
-fi
if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then
echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
fi
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi
-if test "$avx2_opt" = "yes" ; then
- echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
-fi
-
-if test "$avx512f_opt" = "yes" ; then
- echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak
-fi
-
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
echo "CONFIG_BSD=y" >> $config_host_mak
fi
-if test "$qom_cast_debug" = "yes" ; then
- echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
-fi
-
echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
-if test "$coroutine_pool" = "yes" ; then
- echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak
-else
- echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak
-fi
-
-if test "$debug_stack_usage" = "yes" ; then
- echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak
-fi
-
-if test "$crypto_afalg" = "yes" ; then
- echo "CONFIG_AF_ALG=y" >> $config_host_mak
-fi
if test "$have_asan_iface_fiber" = "yes" ; then
echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak
echo "CONFIG_TSAN=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
echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
fi
-if test "$live_block_migration" = "yes" ; then
- echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
-fi
-
-if test "$tpm" = "yes"; then
- echo 'CONFIG_TPM=y' >> $config_host_mak
-fi
-
if test "$rdma" = "yes" ; then
echo "CONFIG_RDMA=y" >> $config_host_mak
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
echo "CONFIG_PVRDMA=y" >> $config_host_mak
fi
-if test "$replication" = "yes" ; then
- echo "CONFIG_REPLICATION=y" >> $config_host_mak
-fi
-
-if test "$debug_mutex" = "yes" ; then
- echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
-fi
-
-if test "$bochs" = "yes" ; then
- echo "CONFIG_BOCHS=y" >> $config_host_mak
-fi
-if test "$cloop" = "yes" ; then
- echo "CONFIG_CLOOP=y" >> $config_host_mak
-fi
-if test "$dmg" = "yes" ; then
- echo "CONFIG_DMG=y" >> $config_host_mak
-fi
-if test "$qcow1" = "yes" ; then
- echo "CONFIG_QCOW1=y" >> $config_host_mak
-fi
-if test "$vdi" = "yes" ; then
- echo "CONFIG_VDI=y" >> $config_host_mak
-fi
-if test "$vvfat" = "yes" ; then
- echo "CONFIG_VVFAT=y" >> $config_host_mak
-fi
-if test "$qed" = "yes" ; then
- echo "CONFIG_QED=y" >> $config_host_mak
-fi
-if test "$parallels" = "yes" ; then
- echo "CONFIG_PARALLELS=y" >> $config_host_mak
-fi
-
if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak
- # Copy the export object list to the build dir
- if test "$ld_dynamic_list" = "yes" ; then
- echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak
- ld_symbols=qemu-plugins-ld.symbols
- cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols
- elif test "$ld_exported_symbols_list" = "yes" ; then
- echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak
- ld64_symbols=qemu-plugins-ld64.symbols
- echo "# Automatically generated by configure - do not modify" > $ld64_symbols
- grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' | \
- sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols
- else
- error_exit \
- "If \$plugins=yes, either \$ld_dynamic_list or " \
- "\$ld_exported_symbols_list should have been set to 'yes'."
- fi
fi
if test -n "$gdb_bin"; then
echo "NINJA=$ninja" >> $config_host_mak
echo "CC=$cc" >> $config_host_mak
echo "HOST_CC=$host_cc" >> $config_host_mak
-if $iasl -h > /dev/null 2>&1; then
- echo "CONFIG_IASL=$iasl" >> $config_host_mak
-fi
echo "AR=$ar" >> $config_host_mak
echo "AS=$as" >> $config_host_mak
echo "CCAS=$ccas" >> $config_host_mak
echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
+echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
+echo "STRIP=$strip" >> $config_host_mak
echo "EXESUF=$EXESUF" >> $config_host_mak
-echo "LIBS_QGA=$libs_qga" >> $config_host_mak
-
-if test "$rng_none" = "yes"; then
- echo "CONFIG_RNG_NONE=y" >> $config_host_mak
-fi
# use included Linux headers
if test "$linux" = "yes" ; then
aarch64)
linux_arch=arm64
;;
+ loongarch*)
+ linux_arch=loongarch
+ ;;
mips64)
linux_arch=mips
;;
echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak
fi
-if test "$numa" = "yes"; then
- echo "CONFIG_NUMA=y" >> $config_host_mak
- echo "NUMA_LIBS=$numa_libs" >> $config_host_mak
-fi
-
if test "$ccache_cpp2" = "yes"; then
echo "export CCACHE_CPP2=y" >> $config_host_mak
fi
fi
# If we're using a separate build tree, set it up now.
-# DIRS are directories which we simply mkdir in the build tree;
# LINKS are things to symlink back into the source tree
# (these can be both files and directories).
# Caution: do not add files or directories here using wildcards. This
# so the build tree will be missing the link back to the new file, and
# tests might fail. Prefer to keep the relevant files in their own
# directory and symlink the directory instead.
-# UNLINK is used to remove symlinks from older development versions
-# that might get into the way when doing "git update" without doing
-# a "make distclean" in between.
-DIRS="tests tests/tcg tests/qapi-schema tests/qtest/libqos"
-DIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph"
-DIRS="$DIRS docs docs/interop fsdev scsi"
-DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
-DIRS="$DIRS roms/seabios"
-DIRS="$DIRS contrib/plugins/"
LINKS="Makefile"
LINKS="$LINKS tests/tcg/Makefile.target"
LINKS="$LINKS pc-bios/optionrom/Makefile"
LINKS="$LINKS tests/qemu-iotests/check"
LINKS="$LINKS python"
LINKS="$LINKS contrib/plugins/Makefile "
-UNLINK="pc-bios/keymaps"
for bios_file in \
$source_path/pc-bios/*.bin \
$source_path/pc-bios/*.elf \
$source_path/pc-bios/*.img \
$source_path/pc-bios/openbios-* \
$source_path/pc-bios/u-boot.* \
- $source_path/pc-bios/edk2-*.fd.bz2 \
$source_path/pc-bios/palcode-* \
$source_path/pc-bios/qemu_vga.ndrv
do
LINKS="$LINKS pc-bios/$(basename $bios_file)"
done
-mkdir -p $DIRS
for f in $LINKS ; do
if [ -e "$source_path/$f" ]; then
+ mkdir -p `dirname ./$f`
symlink "$source_path/$f" "$f"
fi
done
-for f in $UNLINK ; do
- if [ -L "$f" ]; then
- rm -f "$f"
- fi
-done
(for i in $cross_cc_vars; do
export $i
done
-export target_list source_path use_containers ARCH
+export target_list source_path use_containers cpu
$source_path/tests/tcg/configure.sh)
# temporary config to build submodules
-for rom in seabios; do
+if test -f $source_path/roms/seabios/Makefile; then
+ for rom in seabios; 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 "IASL=$iasl" >> $config_mak
echo "LD=$ld" >> $config_mak
echo "RANLIB=$ranlib" >> $config_mak
-done
+ done
+fi
config_mak=pc-bios/optionrom/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
cross_arg="--cross-file config-meson.cross"
echo "[host_machine]" >> $cross
echo "system = '$targetos'" >> $cross
- case "$ARCH" in
+ case "$cpu" in
i386)
echo "cpu_family = 'x86'" >> $cross
;;
*)
- echo "cpu_family = '$ARCH'" >> $cross
+ echo "cpu_family = '$cpu'" >> $cross
;;
esac
echo "cpu = '$cpu'" >> $cross
-Daudio_drv_list=$audio_drv_list \
-Ddefault_devices=$default_devices \
-Ddocdir="$docdir" \
+ -Diasl="$($iasl -h >/dev/null 2>&1 && printf %s "$iasl")" \
-Dqemu_firmwarepath="$firmwarepath" \
-Dqemu_suffix="$qemu_suffix" \
+ -Dsmbd="$smbd" \
-Dsphinx_build="$sphinx_build" \
-Dtrace_file="$trace_file" \
-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) \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
-Db_lto=$lto -Dcfi=$cfi -Dtcg=$tcg -Dxen=$xen \
fi
fi
-if test -n "${deprecated_features}"; then
- echo "Warning, deprecated features enabled."
- echo "Please see docs/about/deprecated.rst"
- echo " features: ${deprecated_features}"
-fi
-
-# Create list of config switches that should be poisoned in common code...
-# but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special.
-target_configs_h=$(ls *-config-devices.h *-config-target.h 2>/dev/null)
-if test -n "$target_configs_h" ; then
- sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \
- -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \
- $target_configs_h | sort -u > config-poison.h
-else
- :> config-poison.h
-fi
-
# Save the configure command line for later reuse.
cat <<EOD >config.status
#!/bin/sh