cross_compile="no"
cross_prefix=""
host_cc="cc"
-lto="false"
stack_protector=""
safe_stack=""
use_containers="yes"
vhost_user="no"
vhost_user_fs="$default_feature"
vhost_vdpa="$default_feature"
-debug_info="yes"
debug_tcg="no"
-debug="no"
sanitizers="no"
tsan="no"
fortify_source="yes"
-gcov="no"
EXESUF=""
modules="no"
prefix="/usr/local"
fi
fdt="auto"
-# 2. Support --with/--without option
-default_devices="true"
-
-# 3. Automatically enable/disable other options
+# 2. Automatically enable/disable other options
tcg="enabled"
cfi="false"
. $source_path/scripts/meson-buildoptions.sh
meson_options=
+meson_option_add() {
+ meson_options="$meson_options $(quote_sh "$1")"
+}
meson_option_parse() {
meson_options="$meson_options $(_meson_option_parse "$@")"
if test $? -eq 1; then
;;
--cross-cc-*)
;;
- --enable-debug-info) debug_info="yes"
+ --enable-debug-info) meson_option_add -Ddebug=true
;;
- --disable-debug-info) debug_info="no"
+ --disable-debug-info) meson_option_add -Ddebug=false
;;
--enable-modules)
modules="yes"
error_exit "Can't mix --target-list-exclude with --target-list"
fi
;;
- --with-default-devices) default_devices="true"
+ --with-default-devices) meson_option_add -Ddefault_devices=true
;;
- --without-default-devices) default_devices="false"
+ --without-default-devices) meson_option_add -Ddefault_devices=false
;;
--with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option"
;;
;;
--without-default-features) # processed above
;;
- --enable-gcov) gcov="yes"
- ;;
--static)
static="yes"
QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
# Enable debugging options that aren't excessively noisy
debug_tcg="yes"
meson_option_parse --enable-debug-mutex ""
- debug="yes"
+ meson_option_add -Doptimization=0
fortify_source="no"
;;
--enable-sanitizers) sanitizers="yes"
;;
--disable-werror) werror="no"
;;
- --enable-lto) lto="true"
- ;;
- --disable-lto) lto="false"
- ;;
--enable-stack-protector) stack_protector="yes"
;;
--disable-stack-protector) stack_protector="no"
;;
--enable-cfi)
cfi="true";
- lto="true";
+ meson_option_add -Db_lto=true
;;
--disable-cfi) cfi="false"
;;
--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
--enable-plugins
enable plugins via shared library loading
--disable-containers don't use containers for cross-building
modules modules support (non-Windows)
debug-tcg TCG debugging (default is disabled)
debug-info debugging information
- lto Enable Link-Time Optimization.
safe-stack SafeStack Stack Smash Protection. Depends on
clang/llvm >= 3.7 and requires coroutine backend ucontext.
vhost-net vhost-net kernel acceleration support
if test "$fortify_source" = "yes" ; then
QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
- debug=no
fi
case "$ARCH" in
NINJA=$ninja $meson setup \
--prefix "$prefix" \
--bindir "$bindir" \
- -Ddefault_devices=$default_devices \
-Dqemu_suffix="$qemu_suffix" \
-Dsmbd="$smbd" \
- -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) \
-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 \
+ -Dcfi=$cfi -Dtcg=$tcg \
-Dcapstone=$capstone -Dfdt=$fdt -Dslirp=$slirp \
$(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=$LIB_FUZZING_ENGINE") \
$(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \
project('qemu', ['c'], meson_version: '>=0.59.3',
default_options: ['warning_level=1', 'c_std=gnu11', 'cpp_std=gnu++11', 'b_colorout=auto',
- 'b_staticpic=false', 'stdsplit=false'],
+ 'b_staticpic=false', 'stdsplit=false', 'optimization=2'],
version: files('VERSION'))
add_test_setup('quick', exclude_suites: ['slow', 'thorough'], is_default: true)
printf "%s\n" ' --enable-fdt[=CHOICE] Whether and how to find the libfdt library'
printf "%s\n" ' (choices: auto/disabled/enabled/internal/system)'
printf "%s\n" ' --enable-fuzzing build fuzzing targets'
+ printf "%s\n" ' --enable-gcov Enable coverage tracking.'
printf "%s\n" ' --enable-gprof QEMU profiling with gprof'
+ printf "%s\n" ' --enable-lto Use link time optimization'
printf "%s\n" ' --enable-malloc=CHOICE choose memory allocator to use [system] (choices:'
printf "%s\n" ' jemalloc/system/tcmalloc)'
printf "%s\n" ' --enable-module-upgrades try to load modules from alternate paths for'
--disable-avx2) printf "%s" -Davx2=disabled ;;
--enable-avx512f) printf "%s" -Davx512f=enabled ;;
--disable-avx512f) printf "%s" -Davx512f=disabled ;;
+ --enable-gcov) printf "%s" -Db_coverage=true ;;
+ --disable-gcov) printf "%s" -Db_coverage=false ;;
+ --enable-lto) printf "%s" -Db_lto=true ;;
+ --disable-lto) printf "%s" -Db_lto=false ;;
--block-drv-ro-whitelist=*) quote_sh "-Dblock_drv_ro_whitelist=$2" ;;
--block-drv-rw-whitelist=*) quote_sh "-Dblock_drv_rw_whitelist=$2" ;;
--enable-block-drv-whitelist-in-tools) printf "%s" -Dblock_drv_whitelist_in_tools=true ;;