TMPC="${TMPDIR1}/${TMPB}.c"
TMPO="${TMPDIR1}/${TMPB}.o"
TMPCXX="${TMPDIR1}/${TMPB}.cxx"
+TMPM="${TMPDIR1}/${TMPB}.m"
TMPE="${TMPDIR1}/${TMPB}.exe"
rm -f config.log
do_compiler "$cxx" $CPU_CFLAGS "$@"
}
+do_objc() {
+ do_compiler "$objcc" $CPU_CFLAGS "$@"
+}
+
# Append $2 to the variable named $1, with space separation
add_to() {
eval $1=\${$1:+\"\$$1 \"}\$2
eval test -z '"${1#'"$2"'}"'
}
-ld_has() {
- $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
-}
-
if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
then
error_exit "main directory cannot contain spaces nor colons"
# default parameters
cpu=""
-iasl="iasl"
-interp_prefix="/usr/gnemul/qemu-%M"
static="no"
cross_compile="no"
cross_prefix=""
-audio_drv_list="default"
-block_drv_rw_whitelist=""
-block_drv_ro_whitelist=""
host_cc="cc"
-debug_info="yes"
-lto="false"
stack_protector=""
safe_stack=""
use_containers="yes"
EXTRA_CFLAGS=""
EXTRA_CXXFLAGS=""
+EXTRA_OBJCFLAGS=""
EXTRA_LDFLAGS=""
-xen_ctrl_version="$default_feature"
-vhost_kernel="$default_feature"
-vhost_net="$default_feature"
-vhost_crypto="$default_feature"
-vhost_scsi="$default_feature"
-vhost_vsock="$default_feature"
-vhost_user="no"
-vhost_user_fs="$default_feature"
-vhost_vdpa="$default_feature"
-rdma="$default_feature"
-pvrdma="$default_feature"
debug_tcg="no"
-debug="no"
sanitizers="no"
tsan="no"
-fortify_source="$default_feature"
-gcov="no"
+fortify_source="yes"
EXESUF=""
modules="no"
-module_upgrades="no"
prefix="/usr/local"
qemu_suffix="qemu"
softmmu="yes"
linux_user=""
bsd_user=""
-pkgversion=""
pie=""
-trace_backends="log"
-trace_file="trace"
-opengl="$default_feature"
coroutine=""
-tls_priority="NORMAL"
plugins="$default_feature"
-secret_keyring="$default_feature"
meson=""
meson_args=""
ninja=""
-gio="$default_feature"
+bindir="bin"
skip_meson=no
# 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
+ slirp="disabled"
+else
+ slirp="auto"
+fi
fdt="auto"
-slirp="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"
-# 4. Detection partly done in configure
-xen=${default_feature:+disabled}
-
# parse CC options second
for opt do
optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)')
--extra-cflags=*)
EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
+ EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg"
;;
--extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
;;
- --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
- ;;
- --enable-debug-info) debug_info="yes"
+ --extra-objcflags=*) EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg"
;;
- --disable-debug-info) debug_info="no"
+ --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
;;
--cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option"
;;
cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}"
;;
--cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*}
- cc_archs="$cc_archs $cc_arch"
eval "cross_cc_${cc_arch}=\$optarg"
cross_cc_vars="$cross_cc_vars cross_cc_${cc_arch}"
;;
nm="${NM-${cross_prefix}nm}"
smbd="$SMBD"
strip="${STRIP-${cross_prefix}strip}"
+widl="${WIDL-${cross_prefix}widl}"
windres="${WINDRES-${cross_prefix}windres}"
pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
query_pkg_config() {
;;
linux)
linux="yes"
- vhost_user=${default_feature:-yes}
;;
esac
ppc)
CPU_CFLAGS="-m32" ;;
ppc64)
- CPU_CFLAGS="-m64 -mbig" ;;
+ CPU_CFLAGS="-m64 -mbig-endian" ;;
ppc64le)
cpu="ppc64"
- CPU_CFLAGS="-m64 -mlittle" ;;
+ CPU_CFLAGS="-m64 -mlittle-endian" ;;
s390)
CPU_CFLAGS="-m31" ;;
CONFIGURE_CFLAGS="-mthreads $CONFIGURE_CFLAGS"
write_c_skeleton;
prefix="/qemu"
+ bindir=""
qemu_suffix=""
fi
. $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
;;
--prefix=*) prefix="$optarg"
;;
- --interp-prefix=*) interp_prefix="$optarg"
- ;;
--cross-prefix=*)
;;
--cc=*)
;;
--cxx=*)
;;
- --iasl=*) iasl="$optarg"
- ;;
--objcc=*) objcc="$optarg"
;;
--make=*) make="$optarg"
;;
--python=*) python="$optarg" ; explicit_python=yes
;;
- --sphinx-build=*) sphinx_build="$optarg"
- ;;
--skip-meson) skip_meson=yes
;;
--meson=*) meson="$optarg"
;;
--extra-cxxflags=*)
;;
+ --extra-objcflags=*)
+ ;;
--extra-ldflags=*)
;;
- --enable-debug-info)
+ --cross-cc-*)
;;
- --disable-debug-info)
+ --enable-debug-info) meson_option_add -Ddebug=true
;;
- --cross-cc-*)
+ --disable-debug-info) meson_option_add -Ddebug=false
;;
--enable-modules)
modules="yes"
--disable-modules)
modules="no"
;;
- --disable-module-upgrades) module_upgrades="no"
- ;;
- --enable-module-upgrades) module_upgrades="yes"
- ;;
--cpu=*)
;;
--target-list=*) target_list="$optarg"
error_exit "Can't mix --target-list-exclude with --target-list"
fi
;;
- --with-trace-file=*) trace_file="$optarg"
- ;;
- --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"
;;
- --mandir=*) mandir="$optarg"
- ;;
--bindir=*) bindir="$optarg"
;;
- --libdir=*) libdir="$optarg"
- ;;
- --libexecdir=*) libexecdir="$optarg"
- ;;
- --includedir=*) includedir="$optarg"
- ;;
- --datadir=*) datadir="$optarg"
- ;;
--with-suffix=*) qemu_suffix="$optarg"
;;
- --docdir=*) docdir="$optarg"
- ;;
- --localedir=*) localedir="$optarg"
- ;;
- --sysconfdir=*) sysconfdir="$optarg"
- ;;
- --localstatedir=*) local_statedir="$optarg"
- ;;
- --firmwarepath=*) firmwarepath="$optarg"
- ;;
--host=*|--build=*|\
--disable-dependency-tracking|\
--sbindir=*|--sharedstatedir=*|\
# configure to be used by RPM and similar macros that set
# lots of directory switches by default.
;;
- --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-debug-tcg) debug_tcg="yes"
;;
--disable-debug-tcg) debug_tcg="no"
# 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"
;;
--enable-slirp=*) slirp="$optarg"
;;
- --disable-xen) xen="disabled"
- ;;
- --enable-xen) xen="enabled"
- ;;
--disable-tcg) tcg="disabled"
plugins="no"
;;
;;
--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"
;;
;;
--enable-fdt=*) fdt="$optarg"
;;
- --with-pkgversion=*) pkgversion="$optarg"
- ;;
--with-coroutine=*) coroutine="$optarg"
;;
- --disable-vhost-net) vhost_net="no"
- ;;
- --enable-vhost-net) vhost_net="yes"
- ;;
- --disable-vhost-crypto) vhost_crypto="no"
- ;;
- --enable-vhost-crypto) vhost_crypto="yes"
- ;;
- --disable-vhost-scsi) vhost_scsi="no"
- ;;
- --enable-vhost-scsi) vhost_scsi="yes"
- ;;
- --disable-vhost-vsock) vhost_vsock="no"
- ;;
- --enable-vhost-vsock) vhost_vsock="yes"
- ;;
- --disable-vhost-user-fs) vhost_user_fs="no"
- ;;
- --enable-vhost-user-fs) vhost_user_fs="yes"
- ;;
- --disable-opengl) opengl="no"
- ;;
- --enable-opengl) opengl="yes"
- ;;
--disable-zlib-test)
;;
--disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane)
--enable-uuid|--disable-uuid)
echo "$0: $opt is obsolete, UUID support is always built" >&2
;;
- --tls-priority=*) tls_priority="$optarg"
- ;;
- --enable-rdma) rdma="yes"
- ;;
- --disable-rdma) rdma="no"
- ;;
- --enable-pvrdma) pvrdma="yes"
- ;;
- --disable-pvrdma) pvrdma="no"
- ;;
- --disable-vhost-user) vhost_user="no"
- ;;
- --enable-vhost-user) vhost_user="yes"
- ;;
- --disable-vhost-vdpa) vhost_vdpa="no"
- ;;
- --enable-vhost-vdpa) vhost_vdpa="yes"
- ;;
- --disable-vhost-kernel) vhost_kernel="no"
- ;;
- --enable-vhost-kernel) vhost_kernel="yes"
- ;;
- --disable-capstone) capstone="disabled"
- ;;
- --enable-capstone) capstone="enabled"
- ;;
- --enable-capstone=git) capstone="internal"
- ;;
- --enable-capstone=*) capstone="$optarg"
- ;;
--with-git=*) git="$optarg"
;;
--with-git-submodules=*)
;;
--gdb=*) gdb_bin="$optarg"
;;
- --enable-keyring) secret_keyring="yes"
- ;;
- --disable-keyring) secret_keyring="no"
- ;;
- --enable-gio) gio=yes
- ;;
- --disable-gio) gio=no
- ;;
# backwards compatibility options
--enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg"
;;
--enable-jemalloc) meson_option_parse --enable-malloc=jemalloc jemalloc
;;
# everything else has the same name in configure and meson
- --enable-* | --disable-*) meson_option_parse "$opt" "$optarg"
- ;;
- *)
- echo "ERROR: unknown option $opt"
- echo "Try '$0 --help' for more information"
- exit 1
+ --*) meson_option_parse "$opt" "$optarg"
;;
esac
done
;;
esac
-libdir="${libdir:-$prefix/lib}"
-libexecdir="${libexecdir:-$prefix/libexec}"
-includedir="${includedir:-$prefix/include}"
-
-if test "$mingw32" = "yes" ; then
- bindir="${bindir:-$prefix}"
-else
- bindir="${bindir:-$prefix/bin}"
-fi
-mandir="${mandir:-$prefix/share/man}"
-datadir="${datadir:-$prefix/share}"
-docdir="${docdir:-$prefix/share/doc}"
-sysconfdir="${sysconfdir:-$prefix/etc}"
-local_statedir="${local_statedir:-$prefix/var}"
-firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
-localedir="${localedir:-$datadir/locale}"
-
if eval test -z "\${cross_cc_$cpu}"; then
eval "cross_cc_${cpu}=\$cc"
cross_cc_vars="$cross_cc_vars cross_cc_${cpu}"
Standard options:
--help print this message
--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)
$(echo Available targets: $default_target_list | \
fold -s -w 53 | sed -e 's/^/ /')
Advanced options (experts only):
--cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
--cc=CC use C compiler CC [$cc]
- --iasl=IASL use ACPI compiler IASL [$iasl]
--host-cc=CC use C compiler CC [$host_cc] for code run at
build time
--cxx=CXX use C++ compiler CXX [$cxx]
--objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
--extra-cflags=CFLAGS append extra C compiler flags CFLAGS
--extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
+ --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
--cross-cc-ARCH=CC use compiler when building ARCH guest test cases
--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]
--meson=MESON use specified meson [$meson]
--ninja=NINJA use specified ninja [$ninja]
--smbd=SMBD use specified smbd [$smbd]
--with-git-submodules=validate fail if git submodules are not up to date
--with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
--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
- --libexecdir=PATH install helper binaries in PATH
- --sysconfdir=PATH install config in PATH/$qemu_suffix
- --localstatedir=PATH install local state in PATH (set at runtime on win32)
- --firmwarepath=PATH search PATH for firmware files
--efi-aarch64=PATH PATH of efi file to use for aarch64 VMs.
--with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
- --with-pkgversion=VERS use specified string as sub-version of the package
--without-default-features default all --enable-* options to "disabled"
--without-default-devices do not include any device that is not needed to
start the emulator (only use if you are including
--enable-tsan enable thread sanitizer
--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-whitelist=L Same as --block-drv-rw-whitelist=L
- --block-drv-rw-whitelist=L
- set block driver read-write whitelist
- (by default affects only QEMU, not tools like qemu-img)
- --block-drv-ro-whitelist=L
- set block driver read-only whitelist
- (by default affects only QEMU, not tools like qemu-img)
- --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
- --tls-priority default TLS protocol/cipher priority string
--enable-plugins
enable plugins via shared library loading
--disable-containers don't use containers for cross-building
bsd-user all BSD usermode emulation targets
pie Position Independent Executables
modules modules support (non-Windows)
- module-upgrades try to load modules from alternate paths for upgrades
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.
- rdma Enable RDMA-based migration
- pvrdma Enable PVRDMA support
- vhost-net vhost-net kernel acceleration support
- vhost-vsock virtio sockets device support
- vhost-scsi vhost-scsi kernel target support
- vhost-crypto vhost-user-crypto backend support
- vhost-kernel vhost kernel backend support
- vhost-user vhost-user backend support
- vhost-vdpa vhost-vdpa kernel backend support
- opengl opengl support
- gio libgio support
NOTE: The object files are built at the place where configure is launched
EOF
compile_prog "-Werror $optflag" ""
}
+objcc_has_warning_flag() {
+ cat > $TMPM <<EOF
+int main(void) { return 0; }
+EOF
+
+ # Use the positive sense of the flag when testing for -Wno-wombat
+ # support (gcc will happily accept the -Wno- form of unknown
+ # warning options).
+ optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')"
+ do_objc -Werror $optflag \
+ $OBJCFLAGS $EXTRA_OBJCFLAGS $CONFIGURE_OBJCFLAGS $QEMU_OBJCFLAGS \
+ -o $TMPE $TMPM $QEMU_LDFLAGS
+}
+
for flag in $gcc_flags; do
if cc_has_warning_flag $flag ; then
QEMU_CFLAGS="$QEMU_CFLAGS $flag"
fi
+ if objcc_has_warning_flag $flag ; then
+ QEMU_OBJCFLAGS="$QEMU_OBJCFLAGS $flag"
+ fi
done
if test "$stack_protector" != "no"; then
error_exit "Modules are not available for Windows"
fi
-# module_upgrades is only reasonable if modules are enabled
-if test "$modules" = "no" && test "$module_upgrades" = "yes" ; then
- error_exit "Can't enable module-upgrades as Modules are not enabled"
-fi
-
# Static linking is not possible with plugins, modules or PIE
if test "$static" = "yes" ; then
if test "$modules" = "yes" ; then
exit 1
fi
-#########################################
-# vhost interdependencies and host support
-
-# vhost backends
-if test "$vhost_user" = "yes" && test "$linux" != "yes"; then
- error_exit "vhost-user is only available on Linux"
-fi
-test "$vhost_vdpa" = "" && vhost_vdpa=$linux
-if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
- error_exit "vhost-vdpa is only available on Linux"
-fi
-test "$vhost_kernel" = "" && vhost_kernel=$linux
-if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then
- error_exit "vhost-kernel is only available on Linux"
-fi
-
-# vhost-kernel devices
-test "$vhost_scsi" = "" && vhost_scsi=$vhost_kernel
-if test "$vhost_scsi" = "yes" && test "$vhost_kernel" != "yes"; then
- error_exit "--enable-vhost-scsi requires --enable-vhost-kernel"
-fi
-test "$vhost_vsock" = "" && vhost_vsock=$vhost_kernel
-if test "$vhost_vsock" = "yes" && test "$vhost_kernel" != "yes"; then
- error_exit "--enable-vhost-vsock requires --enable-vhost-kernel"
-fi
-
-# vhost-user backends
-test "$vhost_net_user" = "" && vhost_net_user=$vhost_user
-if test "$vhost_net_user" = "yes" && test "$vhost_user" = "no"; then
- error_exit "--enable-vhost-net-user requires --enable-vhost-user"
-fi
-test "$vhost_crypto" = "" && vhost_crypto=$vhost_user
-if test "$vhost_crypto" = "yes" && test "$vhost_user" = "no"; then
- error_exit "--enable-vhost-crypto requires --enable-vhost-user"
-fi
-test "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user
-if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then
- error_exit "--enable-vhost-user-fs requires --enable-vhost-user"
-fi
-#vhost-vdpa backends
-test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa
-if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then
- error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa"
-fi
-
-# OR the vhost-kernel, vhost-vdpa and vhost-user values for simplicity
-if test "$vhost_net" = ""; then
- test "$vhost_net_user" = "yes" && vhost_net=yes
- test "$vhost_net_vdpa" = "yes" && vhost_net=yes
- test "$vhost_kernel" = "yes" && vhost_net=yes
-fi
-
##########################################
# pkg-config probe
error_exit "pkg-config binary '$pkg_config_exe' not found"
fi
-##########################################
-# xen probe
-
-if test "$xen" != "disabled" ; then
- # Check whether Xen library path is specified via --extra-ldflags to avoid
- # overriding this setting with pkg-config output. If not, try pkg-config
- # to obtain all needed flags.
-
- if ! echo $EXTRA_LDFLAGS | grep tools/libxc > /dev/null && \
- $pkg_config --exists xencontrol ; then
- xen_ctrl_version="$(printf '%d%02d%02d' \
- $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
- xen=enabled
- xen_pc="xencontrol xenstore xenforeignmemory xengnttab"
- xen_pc="$xen_pc xenevtchn xendevicemodel"
- if $pkg_config --exists xentoolcore; then
- xen_pc="$xen_pc xentoolcore"
- fi
- xen_cflags="$($pkg_config --cflags $xen_pc)"
- xen_libs="$($pkg_config --libs $xen_pc)"
- else
-
- xen_libs="-lxenstore -lxenctrl"
- xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
-
- # First we test whether Xen headers and libraries are available.
- # If no, we are done and there is no Xen support.
- # If yes, more tests are run to detect the Xen version.
-
- # Xen (any)
- cat > $TMPC <<EOF
-#include <xenctrl.h>
-int main(void) {
- return 0;
-}
-EOF
- if ! compile_prog "" "$xen_libs" ; then
- # Xen not found
- if test "$xen" = "enabled" ; then
- feature_not_found "xen" "Install xen devel"
- fi
- xen=disabled
-
- # Xen unstable
- elif
- cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_DEVICEMODEL_API
-#define __XEN_TOOLS__
-#include <xendevicemodel.h>
-#include <xenforeignmemory.h>
-int main(void) {
- xendevicemodel_handle *xd;
- xenforeignmemory_handle *xfmem;
-
- xd = xendevicemodel_open(0, 0);
- xendevicemodel_pin_memory_cacheattr(xd, 0, 0, 0, 0);
-
- xfmem = xenforeignmemory_open(0, 0);
- xenforeignmemory_map_resource(xfmem, 0, 0, 0, 0, 0, NULL, 0, 0);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore"
- then
- xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore"
- xen_ctrl_version=41100
- xen=enabled
- elif
- cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenforeignmemory.h>
-#include <xentoolcore.h>
-int main(void) {
- xenforeignmemory_handle *xfmem;
-
- xfmem = xenforeignmemory_open(0, 0);
- xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0);
- xentoolcore_restrict_all(0);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore"
- then
- xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore"
- xen_ctrl_version=41000
- xen=enabled
- elif
- cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_DEVICEMODEL_API
-#define __XEN_TOOLS__
-#include <xendevicemodel.h>
-int main(void) {
- xendevicemodel_handle *xd;
-
- xd = xendevicemodel_open(0, 0);
- xendevicemodel_close(xd);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
- then
- xen_stable_libs="-lxendevicemodel $xen_stable_libs"
- xen_ctrl_version=40900
- xen=enabled
- elif
- cat > $TMPC <<EOF &&
-/*
- * If we have stable libs the we don't want the libxc compat
- * layers, regardless of what CFLAGS we may have been given.
- *
- * Also, check if xengnttab_grant_copy_segment_t is defined and
- * grant copy operation is implemented.
- */
-#undef XC_WANT_COMPAT_EVTCHN_API
-#undef XC_WANT_COMPAT_GNTTAB_API
-#undef XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <xenevtchn.h>
-#include <xengnttab.h>
-#include <xenforeignmemory.h>
-#include <stdint.h>
-#include <xen/hvm/hvm_info_table.h>
-#if !defined(HVM_MAX_VCPUS)
-# error HVM_MAX_VCPUS not defined
-#endif
-int main(void) {
- xc_interface *xc = NULL;
- xenforeignmemory_handle *xfmem;
- xenevtchn_handle *xe;
- xengnttab_handle *xg;
- xengnttab_grant_copy_segment_t* seg = NULL;
-
- xs_daemon_open();
-
- xc = xc_interface_open(0, 0, 0);
- xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
- xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
- xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
- xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
-
- xfmem = xenforeignmemory_open(0, 0);
- xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0);
-
- xe = xenevtchn_open(0, 0);
- xenevtchn_fd(xe);
-
- xg = xengnttab_open(0, 0);
- xengnttab_grant_copy(xg, 0, seg);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs $xen_stable_libs"
- then
- xen_ctrl_version=40800
- xen=enabled
- elif
- cat > $TMPC <<EOF &&
-/*
- * If we have stable libs the we don't want the libxc compat
- * layers, regardless of what CFLAGS we may have been given.
- */
-#undef XC_WANT_COMPAT_EVTCHN_API
-#undef XC_WANT_COMPAT_GNTTAB_API
-#undef XC_WANT_COMPAT_MAP_FOREIGN_API
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <xenevtchn.h>
-#include <xengnttab.h>
-#include <xenforeignmemory.h>
-#include <stdint.h>
-#include <xen/hvm/hvm_info_table.h>
-#if !defined(HVM_MAX_VCPUS)
-# error HVM_MAX_VCPUS not defined
-#endif
-int main(void) {
- xc_interface *xc = NULL;
- xenforeignmemory_handle *xfmem;
- xenevtchn_handle *xe;
- xengnttab_handle *xg;
-
- xs_daemon_open();
-
- xc = xc_interface_open(0, 0, 0);
- xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
- xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
- xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
- xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
-
- xfmem = xenforeignmemory_open(0, 0);
- xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0);
-
- xe = xenevtchn_open(0, 0);
- xenevtchn_fd(xe);
-
- xg = xengnttab_open(0, 0);
- xengnttab_map_grant_ref(xg, 0, 0, 0);
-
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs $xen_stable_libs"
- then
- xen_ctrl_version=40701
- xen=enabled
-
- # Xen 4.6
- elif
- cat > $TMPC <<EOF &&
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <stdint.h>
-#include <xen/hvm/hvm_info_table.h>
-#if !defined(HVM_MAX_VCPUS)
-# error HVM_MAX_VCPUS not defined
-#endif
-int main(void) {
- xc_interface *xc;
- xs_daemon_open();
- xc = xc_interface_open(0, 0, 0);
- xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
- xc_gnttab_open(NULL, 0);
- xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
- xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
- xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
- xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0);
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs"
- then
- xen_ctrl_version=40600
- xen=enabled
-
- # Xen 4.5
- elif
- cat > $TMPC <<EOF &&
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <stdint.h>
-#include <xen/hvm/hvm_info_table.h>
-#if !defined(HVM_MAX_VCPUS)
-# error HVM_MAX_VCPUS not defined
-#endif
-int main(void) {
- xc_interface *xc;
- xs_daemon_open();
- xc = xc_interface_open(0, 0, 0);
- xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
- xc_gnttab_open(NULL, 0);
- xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
- xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
- xc_hvm_create_ioreq_server(xc, 0, 0, NULL);
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs"
- then
- xen_ctrl_version=40500
- xen=enabled
-
- elif
- cat > $TMPC <<EOF &&
-#include <xenctrl.h>
-#include <xenstore.h>
-#include <stdint.h>
-#include <xen/hvm/hvm_info_table.h>
-#if !defined(HVM_MAX_VCPUS)
-# error HVM_MAX_VCPUS not defined
-#endif
-int main(void) {
- xc_interface *xc;
- xs_daemon_open();
- xc = xc_interface_open(0, 0, 0);
- xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
- xc_gnttab_open(NULL, 0);
- xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
- xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
- return 0;
-}
-EOF
- compile_prog "" "$xen_libs"
- then
- xen_ctrl_version=40200
- xen=enabled
-
- else
- if test "$xen" = "enabled" ; then
- feature_not_found "xen (unsupported version)" \
- "Install a supported xen (xen 4.2 or newer)"
- fi
- xen=disabled
- fi
-
- if test "$xen" = enabled; then
- if test $xen_ctrl_version -ge 40701 ; then
- xen_libs="$xen_libs $xen_stable_libs "
- fi
- fi
- fi
-fi
-
-##########################################
-# RDMA needs OpenFabrics libraries
-if test "$rdma" != "no" ; then
- cat > $TMPC <<EOF
-#include <rdma/rdma_cma.h>
-int main(void) { return 0; }
-EOF
- rdma_libs="-lrdmacm -libverbs -libumad"
- if compile_prog "" "$rdma_libs" ; then
- rdma="yes"
- else
- if test "$rdma" = "yes" ; then
- error_exit \
- " OpenFabrics librdmacm/libibverbs/libibumad not present." \
- " Your options:" \
- " (1) Fast: Install infiniband packages (devel) from your distro." \
- " (2) Cleanest: Install libraries from www.openfabrics.org" \
- " (3) Also: Install softiwarp if you don't have RDMA hardware"
- fi
- rdma="no"
- fi
-fi
-
-##########################################
-# PVRDMA detection
-
-cat > $TMPC <<EOF &&
-#include <sys/mman.h>
-
-int
-main(void)
-{
- char buf = 0;
- void *addr = &buf;
- addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
-
- return 0;
-}
-EOF
-
-if test "$rdma" = "yes" ; then
- case "$pvrdma" in
- "")
- if compile_prog "" ""; then
- pvrdma="yes"
- else
- pvrdma="no"
- fi
- ;;
- "yes")
- if ! compile_prog "" ""; then
- error_exit "PVRDMA is not supported since mremap is not implemented"
- fi
- pvrdma="yes"
- ;;
- "no")
- pvrdma="no"
- ;;
- esac
-else
- if test "$pvrdma" = "yes" ; then
- error_exit "PVRDMA requires rdma suppport"
- fi
- pvrdma="no"
-fi
-
-# Let's see if enhanced reg_mr is supported
-if test "$pvrdma" = "yes" ; then
-
-cat > $TMPC <<EOF &&
-#include <infiniband/verbs.h>
-
-int
-main(void)
-{
- struct ibv_mr *mr;
- struct ibv_pd *pd = NULL;
- size_t length = 10;
- uint64_t iova = 0;
- int access = 0;
- void *addr = NULL;
-
- mr = ibv_reg_mr_iova(pd, addr, length, iova, access);
-
- ibv_dereg_mr(mr);
-
- return 0;
-}
-EOF
- if ! compile_prog "" "-libverbs"; then
- QEMU_CFLAGS="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR"
- fi
-fi
-
##########################################
# glib support probe
+# When bumping glib_req_ver, please check also whether we should increase
+# the _WIN32_WINNT setting in osdep.h according to the value from glib
glib_req_ver=2.56
glib_modules=gthread-2.0
if test "$modules" = yes; then
fi
done
+glib_bindir="$($pkg_config --variable=bindir glib-2.0)"
+if test -z "$glib_bindir" ; then
+ glib_bindir="$($pkg_config --variable=prefix glib-2.0)"/bin
+fi
+
# This workaround is required due to a bug in pkg-config file for glib as it
# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static
glib_cflags="-DGLIB_STATIC_COMPILATION $glib_cflags"
fi
-if ! test "$gio" = "no"; then
- pass=no
- if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then
- 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 ! has "$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.
- cat > $TMPC <<EOF
-#include <gio/gio.h>
-int main(void)
-{
- g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0);
- return 0;
-}
-EOF
- if compile_prog "$gio_cflags" "$gio_libs" ; then
- pass=yes
- else
- pass=no
- fi
-
- if test "$pass" = "yes" &&
- $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then
- gio_cflags="$gio_cflags $($pkg_config --cflags gio-unix-2.0)"
- gio_libs="$gio_libs $($pkg_config --libs gio-unix-2.0)"
- fi
- fi
-
- if test "$pass" = "no"; then
- if test "$gio" = "yes"; then
- feature_not_found "gio" "Install libgio >= 2.0"
- else
- gio=no
- fi
- else
- gio=yes
- fi
-fi
-
# Sanity check that the current size_t matches the
# size that glib thinks it should be. This catches
# problems on multi-arch where people try to build
{
g_free(f);
}
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free)
int main(void) { return 0; }
EOF
if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
fi
fi
-##########################################
-# SHA command probe for modules
-if test "$modules" = yes; then
- shacmd_probe="sha1sum sha1 shasum"
- for c in $shacmd_probe; do
- if has $c; then
- shacmd="$c"
- break
- fi
- done
- if test "$shacmd" = ""; then
- error_exit "one of the checksum commands is required to enable modules: $shacmd_probe"
- fi
-fi
-
##########################################
# fdt probe
;;
esac
-##########################################
-# opengl probe (for sdl2, gtk)
-
-if test "$opengl" != "no" ; then
- epoxy=no
- if $pkg_config epoxy; then
- cat > $TMPC << EOF
-#include <epoxy/egl.h>
-int main(void) { return 0; }
-EOF
- if compile_prog "" "" ; then
- epoxy=yes
- fi
- fi
-
- if test "$epoxy" = "yes" ; then
- opengl_cflags="$($pkg_config --cflags epoxy)"
- opengl_libs="$($pkg_config --libs epoxy)"
- opengl=yes
- else
- if test "$opengl" = "yes" ; then
- feature_not_found "opengl" "Please install epoxy with EGL"
- fi
- opengl_cflags=""
- opengl_libs=""
- opengl=no
- fi
-fi
-
-# check for usbfs
-have_usbfs=no
-if test "$linux_user" = "yes"; then
- cat > $TMPC << EOF
-#include <linux/usbdevice_fs.h>
-
-#ifndef USBDEVFS_GET_CAPABILITIES
-#error "USBDEVFS_GET_CAPABILITIES undefined"
-#endif
-
-#ifndef USBDEVFS_DISCONNECT_CLAIM
-#error "USBDEVFS_DISCONNECT_CLAIM undefined"
-#endif
-
-int main(void)
-{
- return 0;
-}
-EOF
- if compile_prog "" ""; then
- have_usbfs=yes
- fi
-fi
-
-##########################################
-# capstone
-
-case "$capstone" in
- auto | enabled | internal)
- # Simpler to always update submodule, even if not needed.
- git_submodules="${git_submodules} capstone"
- ;;
-esac
-
##########################################
# check and set a backend for coroutine
fi
fi
-########################################
-# check if __[u]int128_t is usable.
-
-int128=no
-cat > $TMPC << EOF
-__int128_t a;
-__uint128_t b;
-int main (void) {
- a = a + b;
- b = a * b;
- a = a * a;
- return 0;
-}
-EOF
-if compile_prog "" "" ; then
- int128=yes
-fi
-
-#########################################
-# See if 128-bit atomic operations are supported.
-
-atomic128=no
-if test "$int128" = "yes"; then
- cat > $TMPC << EOF
-int main(void)
-{
- unsigned __int128 x = 0, y = 0;
- y = __atomic_load(&x, 0);
- __atomic_store(&x, y, 0);
- __atomic_compare_exchange(&x, &y, x, 0, 0, 0);
- return 0;
-}
-EOF
- if compile_prog "" "" ; then
- atomic128=yes
- fi
-fi
-
-cmpxchg128=no
-if test "$int128" = yes && test "$atomic128" = no; then
- cat > $TMPC << EOF
-int main(void)
-{
- unsigned __int128 x = 0, y = 0;
- __sync_val_compare_and_swap_16(&x, y, x);
- return 0;
-}
-EOF
- if compile_prog "" "" ; then
- cmpxchg128=yes
- fi
-fi
-
########################################
# check if ccache is interfering with
# semantic analysis of macros
;;
esac
-##########################################
-# check for usable __NR_keyctl syscall
-
-if test "$linux" = "yes" ; then
-
- have_keyring=no
- cat > $TMPC << EOF
-#include <errno.h>
-#include <asm/unistd.h>
-#include <linux/keyctl.h>
-#include <unistd.h>
-int main(void) {
- return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0);
-}
-EOF
- if compile_prog "" "" ; then
- have_keyring=yes
- fi
-fi
-if test "$secret_keyring" != "no"
-then
- if test "$have_keyring" = "yes"
- then
- secret_keyring=yes
- else
- if test "$secret_keyring" = "yes"
- then
- error_exit "syscall __NR_keyctl requested, \
-but not implemented on your system"
- else
- secret_keyring=no
- fi
- fi
-fi
-
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
write_c_skeleton
-if test "$gcov" = "yes" ; then
- :
-elif test "$fortify_source" = "yes" ; then
+if test "$fortify_source" = "yes" ; then
QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
- debug=no
fi
case "$ARCH" in
fi
fi
-# Use ASLR, no-SEH and DEP if available
-if test "$mingw32" = "yes" ; then
- 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
-
# Guest agent Windows MSI package
if test "$QEMU_GA_MANUFACTURER" = ""; then
QEMU_GA_VERSION=$(cat $source_path/VERSION)
fi
-QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
-
# Mac OS X ships with a broken assembler
roms=
if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
fi
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
- 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
echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
if test "$static" = "yes" ; then
echo "CONFIG_STATIC=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
-qemu_version=$(head $source_path/VERSION)
-echo "PKGVERSION=$pkgversion" >>$config_host_mak
echo "SRC_PATH=$source_path" >> $config_host_mak
echo "TARGET_DIRS=$target_list" >> $config_host_mak
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 "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
echo "CONFIG_MODULES=y" >> $config_host_mak
fi
-if test "$module_upgrades" = "yes"; then
- echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
-fi
-if test "$have_usbfs" = "yes" ; then
- echo "CONFIG_USBFS=y" >> $config_host_mak
-fi
-if test "$gio" = "yes" ; then
- echo "CONFIG_GIO=y" >> $config_host_mak
- echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
- echo "GIO_LIBS=$gio_libs" >> $config_host_mak
-fi
-if test "$gdbus_codegen" != "" ; then
- echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
-fi
-echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
-
-if test "$xen" = "enabled" ; then
- echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
- echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
- echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak
- echo "XEN_LIBS=$xen_libs" >> $config_host_mak
-fi
-if test "$vhost_scsi" = "yes" ; then
- echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
-fi
-if test "$vhost_net" = "yes" ; then
- echo "CONFIG_VHOST_NET=y" >> $config_host_mak
-fi
-if test "$vhost_net_user" = "yes" ; then
- echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
-fi
-if test "$vhost_net_vdpa" = "yes" ; then
- echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak
-fi
-if test "$vhost_crypto" = "yes" ; then
- echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
-fi
-if test "$vhost_vsock" = "yes" ; then
- echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak
- if test "$vhost_user" = "yes" ; then
- echo "CONFIG_VHOST_USER_VSOCK=y" >> $config_host_mak
- fi
-fi
-if test "$vhost_kernel" = "yes" ; then
- echo "CONFIG_VHOST_KERNEL=y" >> $config_host_mak
-fi
-if test "$vhost_user" = "yes" ; then
- echo "CONFIG_VHOST_USER=y" >> $config_host_mak
-fi
-if test "$vhost_vdpa" = "yes" ; then
- echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
-fi
-if test "$vhost_user_fs" = "yes" ; then
- echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
-fi
-if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then
- echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
-fi
-
-if test "$opengl" = "yes" ; then
- echo "CONFIG_OPENGL=y" >> $config_host_mak
- echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak
- echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
-fi
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then
echo "CONFIG_TSAN=y" >> $config_host_mak
fi
-if test "$int128" = "yes" ; then
- echo "CONFIG_INT128=y" >> $config_host_mak
-fi
-
-if test "$atomic128" = "yes" ; then
- echo "CONFIG_ATOMIC128=y" >> $config_host_mak
-fi
-
-if test "$cmpxchg128" = "yes" ; then
- echo "CONFIG_CMPXCHG128=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
-fi
-
-if test "$pvrdma" = "yes" ; then
- echo "CONFIG_PVRDMA=y" >> $config_host_mak
-fi
-
if test "$plugins" = "yes" ; then
echo "CONFIG_PLUGIN=y" >> $config_host_mak
fi
fi
fi
-if test "$secret_keyring" = "yes" ; then
- echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
-fi
-
echo "ROMS=$roms" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "PYTHON=$python" >> $config_host_mak
echo "MESON=$meson" >> $config_host_mak
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 "CPP=$cpp" >> $config_host_mak
echo "OBJCOPY=$objcopy" >> $config_host_mak
echo "LD=$ld" >> $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_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
+echo "GLIB_BINDIR=$glib_bindir" >> $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
esac
done
-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
LINKS="$LINKS tests/tcg/Makefile.target"
LINKS="$LINKS pc-bios/optionrom/Makefile"
LINKS="$LINKS pc-bios/s390-ccw/Makefile"
-LINKS="$LINKS roms/seabios/Makefile"
-LINKS="$LINKS pc-bios/qemu-icon.bmp"
LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
LINKS="$LINKS tests/avocado tests/data"
LINKS="$LINKS tests/qemu-iotests/check"
(for i in $cross_cc_vars; do
export $i
done
-export target_list source_path use_containers cpu
+export target_list source_path use_containers cpu host_cc
$source_path/tests/tcg/configure.sh)
-# temporary config to build submodules
-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 "AS=$as" >> $config_mak
- echo "CCAS=$ccas" >> $config_mak
- echo "CC=$cc" >> $config_mak
- echo "BCC=bcc" >> $config_mak
- echo "CPP=$cpp" >> $config_mak
- echo "OBJCOPY=objcopy" >> $config_mak
- echo "IASL=$iasl" >> $config_mak
- echo "LD=$ld" >> $config_mak
- echo "RANLIB=$ranlib" >> $config_mak
- done
-fi
-
config_mak=pc-bios/optionrom/config.mak
echo "# Automatically generated by configure - do not modify" > $config_mak
echo "TOPSRC_DIR=$source_path" >> $config_mak
echo "[built-in options]" >> $cross
echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross
+ test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS $EXTRA_OBJCFLAGS)]" >> $cross
echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross
echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross
echo "[binaries]" >> $cross
echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross
fi
echo "strip = [$(meson_quote $strip)]" >> $cross
+ echo "widl = [$(meson_quote $widl)]" >> $cross
echo "windres = [$(meson_quote $windres)]" >> $cross
if test "$cross_compile" = "yes"; then
cross_arg="--cross-file config-meson.cross"
mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs
+
+ # Built-in options
+ test "$bindir" != "bin" && meson_option_add "-Dbindir=$bindir"
+ test "$default_feature" = no && meson_option_add -Dauto_features=disabled
+ test "$pie" = no && meson_option_add -Db_pie=false
+ test "$werror" = yes && meson_option_add -Dwerror=true
+
+ # QEMU options
+ test "$cfi" != false && meson_option_add "-Dcfi=$cfi"
+ test "$fdt" != auto && meson_option_add "-Dfdt=$fdt"
+ test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
+ test "$qemu_suffix" != qemu && meson_option_add "-Dqemu_suffix=$qemu_suffix"
+ test "$slirp" != auto && meson_option_add "-Dslirp=$slirp"
+ test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"
+ test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
run_meson() {
- NINJA=$ninja $meson setup \
- --prefix "$prefix" \
- --libdir "$libdir" \
- --libexecdir "$libexecdir" \
- --bindir "$bindir" \
- --includedir "$includedir" \
- --datadir "$datadir" \
- --mandir "$mandir" \
- --sysconfdir "$sysconfdir" \
- --localedir "$localedir" \
- --localstatedir "$local_statedir" \
- -Daudio_drv_list=$audio_drv_list \
- -Ddefault_devices=$default_devices \
- -Ddocdir="$docdir" \
- -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) \
- -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 \
- -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) \
- "$@" $cross_arg "$PWD" "$source_path"
+ NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path"
}
eval run_meson $meson_options
if test "$?" -ne 0 ; then
preserve_env SDL2_CONFIG
preserve_env SMBD
preserve_env STRIP
+preserve_env WIDL
preserve_env WINDRES
printf "exec" >>config.status