3 # qemu configure script (c) 2003 Fabrice Bellard
6 # Unset some variables known to interfere with behavior of common tools,
7 # just as autoconf does.
8 CLICOLOR_FORCE
= GREP_OPTIONS
=
9 unset CLICOLOR_FORCE GREP_OPTIONS
11 # Don't allow CCACHE, if present, to use cached results of compile tests!
12 export CCACHE_RECACHE
=yes
14 # make source path absolute
15 source_path
=$
(cd "$(dirname -- "$0")"; pwd)
17 if test "$PWD" = "$source_path"
19 echo "Using './build' as the directory for build output"
21 MARKER
=build
/auto-created-by-configure
29 echo "ERROR: ./build dir already exists and was not previously created by configure"
37 cat > GNUmakefile
<<'EOF'
38 # This file is auto-generated by configure to support in-source tree
39 # 'make' command invocation
41 ifeq ($(MAKECMDGOALS),)
47 @echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...'
48 @$(MAKE) -C build -f Makefile $(MAKECMDGOALS)
49 @if test "$(MAKECMDGOALS)" = "distclean" && \
50 test -e build/auto-created-by-configure ; \
52 rm -rf build GNUmakefile ; \
60 exec $source_path/configure
"$@"
63 # Temporary directory used for files created while
64 # configure runs. Since it is in the build directory
65 # we can safely blow away any previous version of it
66 # (and we need not jump through hoops to try to delete
67 # it when configure exits.)
72 echo "ERROR: failed to create temporary directory"
77 TMPC
="${TMPDIR1}/${TMPB}.c"
78 TMPO
="${TMPDIR1}/${TMPB}.o"
79 TMPCXX
="${TMPDIR1}/${TMPB}.cxx"
80 TMPE
="${TMPDIR1}/${TMPB}.exe"
81 TMPTXT
="${TMPDIR1}/${TMPB}.txt"
85 # Print a helpful header at the top of config.log
86 echo "# QEMU configure log $(date)" >> config.log
87 printf "# Configured with:" >> config.log
88 printf " '%s'" "$0" "$@" >> config.log
90 echo "#" >> config.log
93 printf "%s" "$1" |
sed "s,','\\\\'',g; s,.*,'&',"
99 while test -n "$2"; do
112 # Run the compiler, capturing its output to the log. First argument
113 # is compiler binary to execute.
116 if test -n "$BASH_VERSION"; then eval '
118 funcs: ${FUNCNAME[*]}
119 lines: ${BASH_LINENO[*]}"
121 echo $compiler "$@" >> config.log
122 $compiler "$@" >> config.log
2>&1 ||
return $?
123 # Test passed. If this is an --enable-werror build, rerun
124 # the test with -Werror and bail out if it fails. This
125 # makes warning-generating-errors in configure test code
126 # obvious to developers.
127 if test "$werror" != "yes"; then
130 # Don't bother rerunning the compile if we were already using -Werror
136 echo $compiler -Werror "$@" >> config.log
137 $compiler -Werror "$@" >> config.log
2>&1 && return $?
138 error_exit
"configure test passed without -Werror but failed with -Werror." \
139 "This is probably a bug in the configure script. The failing command" \
140 "will be at the bottom of config.log." \
141 "You can run configure with --disable-werror to bypass this check."
145 do_compiler
"$cc" $CPU_CFLAGS "$@"
149 do_compiler
"$cxx" $CPU_CFLAGS "$@"
152 # Append $2 to the variable named $1, with space separation
154 eval $1=\
${$1:+\"\$$1 \"}\
$2
158 # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those
159 # options which some versions of GCC's C++ compiler complain about
160 # because they only make sense for C programs.
161 QEMU_CXXFLAGS
="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS"
162 CONFIGURE_CXXFLAGS
=$
(echo "$CONFIGURE_CFLAGS" |
sed s
/-std=gnu11
/-std=gnu
++11/)
163 for arg
in $QEMU_CFLAGS; do
165 -Wstrict-prototypes|
-Wmissing-prototypes|
-Wnested-externs|\
166 -Wold-style-declaration|
-Wold-style-definition|
-Wredundant-decls)
169 QEMU_CXXFLAGS
=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg
177 do_cc
$CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC
183 do_cc
$CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC \
184 $LDFLAGS $EXTRA_LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags
187 # symbolically link $1 to $2. Portable version of "ln -sf".
190 mkdir
-p "$(dirname "$2")"
194 # check whether a command is available to this shell (may be either an
195 # executable or a builtin)
197 type "$1" >/dev
/null
2>&1
201 local_ver1
=$
(expr "$1" : '\([0-9.]*\)' |
tr .
' ')
202 local_ver2
=$
(echo "$2" |
tr .
' ')
206 # 'shift 2' if $2 is set, or 'shift' if $2 is not set
210 # the second argument finished, the first must be greater or equal
211 test $# = 1 && return 0
212 test $local_first -lt $2 && return 1
213 test $local_first -gt $2 && return 0
220 eval test -z '"${1#'"$2"'}"'
224 $ld --help 2>/dev
/null |
grep ".$1" >/dev
/null
2>&1
227 if printf %s
\\n
"$source_path" "$PWD" |
grep -q "[[:space:]:]";
229 error_exit
"main directory cannot contain spaces nor colons"
235 interp_prefix
="/usr/gnemul/qemu-%M"
239 audio_drv_list
="default"
240 block_drv_rw_whitelist
=""
241 block_drv_ro_whitelist
=""
242 block_drv_whitelist_tools
="no"
250 gdb_bin
=$
(command -v "gdb-multiarch" ||
command -v "gdb")
252 if test -e "$source_path/.git"
254 git_submodules_action
="update"
256 git_submodules_action
="ignore"
259 git_submodules
="ui/keycodemapdb"
262 # Don't accept a target_list environment variable.
264 unset target_list_exclude
266 # Default value for a variable defining feature "foo".
267 # * foo="no" feature will only be used if --enable-foo arg is given
268 # * foo="" feature will be searched for, and if found, will be used
269 # unless --disable-foo is given
270 # * foo="yes" this value will only be set by --enable-foo flag.
271 # feature will searched for,
272 # if not found, configure exits with error
274 # Always add --enable-foo and --disable-foo command line args.
275 # Distributions want to ensure that several features are compiled in, and it
276 # is impossible without a --enable-foo that exits if a feature is not found.
279 # parse CC options second
281 optarg
=$
(expr "x$opt" : 'x[^=]*=\(.*\)')
283 --without-default-features)
293 xen_ctrl_version
="$default_feature"
294 xfs
="$default_feature"
295 membarrier
="$default_feature"
296 vhost_kernel
="$default_feature"
297 vhost_net
="$default_feature"
298 vhost_crypto
="$default_feature"
299 vhost_scsi
="$default_feature"
300 vhost_vsock
="$default_feature"
302 vhost_user_fs
="$default_feature"
303 vhost_vdpa
="$default_feature"
304 rdma
="$default_feature"
305 pvrdma
="$default_feature"
311 fortify_source
="$default_feature"
332 opengl
="$default_feature"
334 avx2_opt
="$default_feature"
335 guest_agent
="$default_feature"
336 guest_agent_with_vss
="no"
337 guest_agent_ntddscsi
="no"
338 vss_win32_sdk
="$default_feature"
340 want_tools
="$default_feature"
342 coroutine_pool
="$default_feature"
343 debug_stack_usage
="no"
345 tls_priority
="NORMAL"
346 tpm
="$default_feature"
347 live_block_migration
=${default_feature:-yes}
348 numa
="$default_feature"
349 replication
=${default_feature:-yes}
350 bochs
=${default_feature:-yes}
351 cloop
=${default_feature:-yes}
352 dmg
=${default_feature:-yes}
353 qcow1
=${default_feature:-yes}
354 vdi
=${default_feature:-yes}
355 vvfat
=${default_feature:-yes}
356 qed
=${default_feature:-yes}
357 parallels
=${default_feature:-yes}
359 plugins
="$default_feature"
361 secret_keyring
="$default_feature"
365 gio
="$default_feature"
367 slirp_smbd
="$default_feature"
369 # The following Meson options are handled manually (still they
370 # are included in the automatically generated help message)
372 # 1. Track which submodules are needed
377 # 2. Support --with/--without option
378 default_devices
="true"
380 # 3. Automatically enable/disable other options
384 # 4. Detection partly done in configure
385 xen
=${default_feature:+disabled}
387 # parse CC options second
389 optarg
=$
(expr "x$opt" : 'x[^=]*=\(.*\)')
391 --cross-prefix=*) cross_prefix
="$optarg"
396 --cxx=*) CXX
="$optarg"
398 --cpu=*) cpu
="$optarg"
401 EXTRA_CFLAGS
="$EXTRA_CFLAGS $optarg"
402 EXTRA_CXXFLAGS
="$EXTRA_CXXFLAGS $optarg"
404 --extra-cxxflags=*) EXTRA_CXXFLAGS
="$EXTRA_CXXFLAGS $optarg"
406 --extra-ldflags=*) EXTRA_LDFLAGS
="$EXTRA_LDFLAGS $optarg"
408 --enable-debug-info) debug_info
="yes"
410 --disable-debug-info) debug_info
="no"
412 --cross-cc-*[!a-zA-Z0-9_-
]*=*) error_exit
"Passed bad --cross-cc-FOO option"
414 --cross-cc-cflags-*) cc_arch
=${opt#--cross-cc-flags-}; cc_arch
=${cc_arch%%=*}
415 eval "cross_cc_cflags_${cc_arch}=\$optarg"
416 cross_cc_vars
="$cross_cc_vars cross_cc_cflags_${cc_arch}"
418 --cross-cc-*) cc_arch
=${opt#--cross-cc-}; cc_arch
=${cc_arch%%=*}
419 cc_archs
="$cc_archs $cc_arch"
420 eval "cross_cc_${cc_arch}=\$optarg"
421 cross_cc_vars
="$cross_cc_vars cross_cc_${cc_arch}"
426 # Using uname is really, really broken. Once we have the right set of checks
427 # we can eliminate its usage altogether.
429 # Preferred compiler:
431 # ${cross_prefix}gcc (if cross-prefix specified)
433 if test -z "${CC}${cross_prefix}"; then
436 cc
="${CC-${cross_prefix}gcc}"
439 if test -z "${CXX}${cross_prefix}"; then
442 cxx
="${CXX-${cross_prefix}g++}"
445 ar="${AR-${cross_prefix}ar}"
446 as
="${AS-${cross_prefix}as}"
449 objcopy
="${OBJCOPY-${cross_prefix}objcopy}"
450 ld
="${LD-${cross_prefix}ld}"
451 ranlib
="${RANLIB-${cross_prefix}ranlib}"
452 nm
="${NM-${cross_prefix}nm}"
453 strip
="${STRIP-${cross_prefix}strip}"
454 windres
="${WINDRES-${cross_prefix}windres}"
455 pkg_config_exe
="${PKG_CONFIG-${cross_prefix}pkg-config}"
457 "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
459 pkg_config
=query_pkg_config
460 sdl2_config
="${SDL2_CONFIG-${cross_prefix}sdl2-config}"
462 # default flags for all hosts
463 # We use -fwrapv to tell the compiler that we require a C dialect where
464 # left shift of signed integers is well defined and has the expected
465 # 2s-complement style results. (Both clang and gcc agree that it
466 # provides these semantics.)
467 QEMU_CFLAGS
="-fno-strict-aliasing -fno-common -fwrapv"
468 QEMU_CFLAGS
="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
469 QEMU_CFLAGS
="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
470 QEMU_CFLAGS
="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
474 # Flags that are needed during configure but later taken care of by Meson
475 CONFIGURE_CFLAGS
="-std=gnu11 -Wall"
482 #error $1 not defined
484 int main(void) { return 0; }
492 int main(void) { return 0; }
499 int main(void) { return 0; }
503 if check_define __linux__
; then
505 elif check_define _WIN32
; then
507 elif check_define __OpenBSD__
; then
509 elif check_define __sun__
; then
511 elif check_define __HAIKU__
; then
513 elif check_define __FreeBSD__
; then
515 elif check_define __FreeBSD_kernel__
&& check_define __GLIBC__
; then
516 targetos
='GNU/kFreeBSD'
517 elif check_define __DragonFly__
; then
519 elif check_define __NetBSD__
; then
521 elif check_define __APPLE__
; then
524 # This is a fatal error, but don't report it yet, because we
525 # might be going to just print the --help text, or it might
526 # be the result of a missing compiler.
530 # Some host OSes need non-standard checks for which CPU to use.
531 # Note that these checks are broken for cross-compilation: if you're
532 # cross-compiling to one of these OSes then you'll need to specify
533 # the correct CPU with the --cpu option.
536 # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo
537 if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
542 if test ! -z "$cpu" ; then
543 # command line argument
545 elif check_define __i386__
; then
547 elif check_define __x86_64__
; then
548 if check_define __ILP32__
; then
553 elif check_define __sparc__
; then
554 if check_define __arch64__
; then
559 elif check_define _ARCH_PPC
; then
560 if check_define _ARCH_PPC64
; then
561 if check_define _LITTLE_ENDIAN
; then
569 elif check_define __mips__
; then
571 elif check_define __s390__
; then
572 if check_define __s390x__
; then
577 elif check_define __riscv
; then
579 elif check_define __arm__
; then
581 elif check_define __aarch64__
; then
588 # Normalise host CPU name and set ARCH.
589 # Note that this case should only have supported host CPUs, not guests.
591 ppc|ppc64|s390x|sparc64|x32|riscv
)
596 i386|i486|i586|i686|i86pc|BePC
)
615 # This will result in either an error or falling back to TCI later
619 if test -z "$ARCH"; then
639 # needed for kinfo_getvmmap(3) in libutil.h
656 # Disable attempts to use ObjectiveC features in os/object.h since they
657 # won't work when we're compiling with gcc as a C compiler.
658 QEMU_CFLAGS
="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
663 smbd
="${SMBD-/usr/sfw/sbin/smbd}"
664 # needed for CMSG_ macros in sys/socket.h
665 QEMU_CFLAGS
="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
666 # needed for TIOCWIN* defines in termios.h
667 QEMU_CFLAGS
="-D__EXTENSIONS__ $QEMU_CFLAGS"
672 QEMU_CFLAGS
="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
677 vhost_user
=${default_feature:-yes}
681 : ${make=${MAKE-make}}
683 # We prefer python 3.x. A bare 'python' is traditionally
684 # python 2.x, but some distros have it as python 3.x, so
688 for binary
in "${PYTHON-python3}" python
692 python
=$
(command -v "$binary")
698 # Check for ancillary tools used in testing
700 for binary
in genisoimage mkisofs
704 genisoimage
=$
(command -v "$binary")
709 # Default objcc to clang if available, otherwise use CC
716 if test "$mingw32" = "yes" ; then
718 # MinGW needs -mthreads for TLS and macro _MT.
719 CONFIGURE_CFLAGS
="-mthreads $CONFIGURE_CFLAGS"
723 libs_qga
="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga"
728 .
$source_path/scripts
/meson-buildoptions.sh
731 meson_option_parse
() {
732 meson_options
="$meson_options $(_meson_option_parse "$@
")"
733 if test $?
-eq 1; then
734 echo "ERROR: unknown option $1"
735 echo "Try '$0 --help' for more information"
741 optarg
=$
(expr "x$opt" : 'x[^=]*=\(.*\)')
743 --help|
-h) show_help
=yes
745 --version|
-V) exec cat $source_path/VERSION
747 --prefix=*) prefix
="$optarg"
749 --interp-prefix=*) interp_prefix
="$optarg"
755 --host-cc=*) host_cc
="$optarg"
759 --iasl=*) iasl
="$optarg"
761 --objcc=*) objcc
="$optarg"
763 --make=*) make="$optarg"
767 --python=*) python
="$optarg" ; explicit_python
=yes
769 --sphinx-build=*) sphinx_build
="$optarg"
771 --skip-meson) skip_meson
=yes
773 --meson=*) meson
="$optarg"
775 --ninja=*) ninja
="$optarg"
777 --smbd=*) smbd
="$optarg"
787 --disable-debug-info)
797 --disable-module-upgrades) module_upgrades
="no"
799 --enable-module-upgrades) module_upgrades
="yes"
803 --target-list=*) target_list
="$optarg"
804 if test "$target_list_exclude"; then
805 error_exit
"Can't mix --target-list with --target-list-exclude"
808 --target-list-exclude=*) target_list_exclude
="$optarg"
809 if test "$target_list"; then
810 error_exit
"Can't mix --target-list-exclude with --target-list"
813 --with-trace-file=*) trace_file
="$optarg"
815 --with-default-devices) default_devices
="true"
817 --without-default-devices) default_devices
="false"
819 --with-devices-*[!a-zA-Z0-9_-
]*=*) error_exit
"Passed bad --with-devices-FOO option"
821 --with-devices-*) device_arch
=${opt#--with-devices-};
822 device_arch
=${device_arch%%=*}
823 cf
=$source_path/configs
/devices
/$device_arch-softmmu/$optarg.mak
824 if test -f "$cf"; then
825 device_archs
="$device_archs $device_arch"
826 eval "devices_${device_arch}=\$optarg"
828 error_exit
"File $cf does not exist"
831 --without-default-features) # processed above
833 --enable-gprof) gprof
="yes"
835 --enable-gcov) gcov
="yes"
839 QEMU_PKG_CONFIG_FLAGS
="--static $QEMU_PKG_CONFIG_FLAGS"
841 --mandir=*) mandir
="$optarg"
843 --bindir=*) bindir
="$optarg"
845 --libdir=*) libdir
="$optarg"
847 --libexecdir=*) libexecdir
="$optarg"
849 --includedir=*) includedir
="$optarg"
851 --datadir=*) datadir
="$optarg"
853 --with-suffix=*) qemu_suffix
="$optarg"
855 --docdir=*) docdir
="$optarg"
857 --localedir=*) localedir
="$optarg"
859 --sysconfdir=*) sysconfdir
="$optarg"
861 --localstatedir=*) local_statedir
="$optarg"
863 --firmwarepath=*) firmwarepath
="$optarg"
866 --disable-dependency-tracking|\
867 --sbindir=*|
--sharedstatedir=*|\
868 --oldincludedir=*|
--datarootdir=*|
--infodir=*|\
869 --htmldir=*|
--dvidir=*|
--pdfdir=*|
--psdir=*)
870 # These switches are silently ignored, for compatibility with
871 # autoconf-generated configure scripts. This allows QEMU's
872 # configure to be used by RPM and similar macros that set
873 # lots of directory switches by default.
875 --disable-qom-cast-debug) qom_cast_debug
="no"
877 --enable-qom-cast-debug) qom_cast_debug
="yes"
879 --audio-drv-list=*) audio_drv_list
="$optarg"
881 --block-drv-rw-whitelist=*|
--block-drv-whitelist=*) block_drv_rw_whitelist
=$
(echo "$optarg" |
sed -e 's/,/ /g')
883 --block-drv-ro-whitelist=*) block_drv_ro_whitelist
=$
(echo "$optarg" |
sed -e 's/,/ /g')
885 --enable-block-drv-whitelist-in-tools) block_drv_whitelist_tools
="yes"
887 --disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools
="no"
889 --enable-debug-tcg) debug_tcg
="yes"
891 --disable-debug-tcg) debug_tcg
="no"
894 # Enable debugging options that aren't excessively noisy
901 --enable-sanitizers) sanitizers
="yes"
903 --disable-sanitizers) sanitizers
="no"
905 --enable-tsan) tsan
="yes"
907 --disable-tsan) tsan
="no"
909 --disable-strip) strip_opt
="no"
911 --disable-slirp) slirp
="disabled"
913 --enable-slirp) slirp
="enabled"
915 --enable-slirp=git
) slirp
="internal"
917 --enable-slirp=*) slirp
="$optarg"
919 --disable-xen) xen
="disabled"
921 --enable-xen) xen
="enabled"
923 --disable-tcg) tcg
="disabled"
926 --enable-tcg) tcg
="enabled"
928 --enable-profiler) profiler
="yes"
930 --disable-system) softmmu
="no"
932 --enable-system) softmmu
="yes"
939 --disable-linux-user) linux_user
="no"
941 --enable-linux-user) linux_user
="yes"
943 --disable-bsd-user) bsd_user
="no"
945 --enable-bsd-user) bsd_user
="yes"
947 --enable-pie) pie
="yes"
949 --disable-pie) pie
="no"
951 --enable-werror) werror
="yes"
953 --disable-werror) werror
="no"
955 --enable-lto) lto
="true"
957 --disable-lto) lto
="false"
959 --enable-stack-protector) stack_protector
="yes"
961 --disable-stack-protector) stack_protector
="no"
963 --enable-safe-stack) safe_stack
="yes"
965 --disable-safe-stack) safe_stack
="no"
971 --disable-cfi) cfi
="false"
973 --disable-fdt) fdt
="disabled"
975 --enable-fdt) fdt
="enabled"
977 --enable-fdt=git
) fdt
="internal"
979 --enable-fdt=*) fdt
="$optarg"
981 --disable-membarrier) membarrier
="no"
983 --enable-membarrier) membarrier
="yes"
985 --with-pkgversion=*) pkgversion
="$optarg"
987 --with-coroutine=*) coroutine
="$optarg"
989 --disable-coroutine-pool) coroutine_pool
="no"
991 --enable-coroutine-pool) coroutine_pool
="yes"
993 --enable-debug-stack-usage) debug_stack_usage
="yes"
995 --enable-crypto-afalg) crypto_afalg
="yes"
997 --disable-crypto-afalg) crypto_afalg
="no"
999 --disable-vhost-net) vhost_net
="no"
1001 --enable-vhost-net) vhost_net
="yes"
1003 --disable-vhost-crypto) vhost_crypto
="no"
1005 --enable-vhost-crypto) vhost_crypto
="yes"
1007 --disable-vhost-scsi) vhost_scsi
="no"
1009 --enable-vhost-scsi) vhost_scsi
="yes"
1011 --disable-vhost-vsock) vhost_vsock
="no"
1013 --enable-vhost-vsock) vhost_vsock
="yes"
1015 --disable-vhost-user-fs) vhost_user_fs
="no"
1017 --enable-vhost-user-fs) vhost_user_fs
="yes"
1019 --disable-opengl) opengl
="no"
1021 --enable-opengl) opengl
="yes"
1023 --disable-xfsctl) xfs
="no"
1025 --enable-xfsctl) xfs
="yes"
1027 --disable-zlib-test)
1029 --enable-guest-agent) guest_agent
="yes"
1031 --disable-guest-agent) guest_agent
="no"
1033 --with-vss-sdk) vss_win32_sdk
=""
1035 --with-vss-sdk=*) vss_win32_sdk
="$optarg"
1037 --without-vss-sdk) vss_win32_sdk
="no"
1039 --with-win-sdk) win_sdk
=""
1041 --with-win-sdk=*) win_sdk
="$optarg"
1043 --without-win-sdk) win_sdk
="no"
1045 --enable-tools) want_tools
="yes"
1047 --disable-tools) want_tools
="no"
1049 --disable-avx2) avx2_opt
="no"
1051 --enable-avx2) avx2_opt
="yes"
1053 --disable-avx512f) avx512f_opt
="no"
1055 --enable-avx512f) avx512f_opt
="yes"
1057 --disable-virtio-blk-data-plane|
--enable-virtio-blk-data-plane)
1058 echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2
1060 --enable-vhdx|
--disable-vhdx)
1061 echo "$0: $opt is obsolete, VHDX driver is always built" >&2
1063 --enable-uuid|
--disable-uuid)
1064 echo "$0: $opt is obsolete, UUID support is always built" >&2
1066 --tls-priority=*) tls_priority
="$optarg"
1068 --enable-rdma) rdma
="yes"
1070 --disable-rdma) rdma
="no"
1072 --enable-pvrdma) pvrdma
="yes"
1074 --disable-pvrdma) pvrdma
="no"
1076 --disable-tpm) tpm
="no"
1078 --enable-tpm) tpm
="yes"
1080 --disable-live-block-migration) live_block_migration
="no"
1082 --enable-live-block-migration) live_block_migration
="yes"
1084 --disable-numa) numa
="no"
1086 --enable-numa) numa
="yes"
1088 --disable-replication) replication
="no"
1090 --enable-replication) replication
="yes"
1092 --disable-bochs) bochs
="no"
1094 --enable-bochs) bochs
="yes"
1096 --disable-cloop) cloop
="no"
1098 --enable-cloop) cloop
="yes"
1100 --disable-dmg) dmg
="no"
1102 --enable-dmg) dmg
="yes"
1104 --disable-qcow1) qcow1
="no"
1106 --enable-qcow1) qcow1
="yes"
1108 --disable-vdi) vdi
="no"
1110 --enable-vdi) vdi
="yes"
1112 --disable-vvfat) vvfat
="no"
1114 --enable-vvfat) vvfat
="yes"
1116 --disable-qed) qed
="no"
1118 --enable-qed) qed
="yes"
1120 --disable-parallels) parallels
="no"
1122 --enable-parallels) parallels
="yes"
1124 --disable-vhost-user) vhost_user
="no"
1126 --enable-vhost-user) vhost_user
="yes"
1128 --disable-vhost-vdpa) vhost_vdpa
="no"
1130 --enable-vhost-vdpa) vhost_vdpa
="yes"
1132 --disable-vhost-kernel) vhost_kernel
="no"
1134 --enable-vhost-kernel) vhost_kernel
="yes"
1136 --disable-capstone) capstone
="disabled"
1138 --enable-capstone) capstone
="enabled"
1140 --enable-capstone=git
) capstone
="internal"
1142 --enable-capstone=*) capstone
="$optarg"
1144 --with-git=*) git
="$optarg"
1146 --with-git-submodules=*)
1147 git_submodules_action
="$optarg"
1149 --enable-debug-mutex) debug_mutex
=yes
1151 --disable-debug-mutex) debug_mutex
=no
1153 --enable-plugins) if test "$mingw32" = "yes"; then
1154 error_exit
"TCG plugins not currently supported on Windows platforms"
1159 --disable-plugins) plugins
="no"
1161 --enable-containers) use_containers
="yes"
1163 --disable-containers) use_containers
="no"
1165 --gdb=*) gdb_bin
="$optarg"
1167 --enable-rng-none) rng_none
=yes
1169 --disable-rng-none) rng_none
=no
1171 --enable-keyring) secret_keyring
="yes"
1173 --disable-keyring) secret_keyring
="no"
1175 --enable-gio) gio
=yes
1177 --disable-gio) gio
=no
1179 --enable-slirp-smbd) slirp_smbd
=yes
1181 --disable-slirp-smbd) slirp_smbd
=no
1183 # backwards compatibility options
1184 --enable-trace-backend=*) meson_option_parse
"--enable-trace-backends=$optarg" "$optarg"
1186 --disable-blobs) meson_option_parse
--disable-install-blobs ""
1188 --enable-tcmalloc) meson_option_parse
--enable-malloc=tcmalloc tcmalloc
1190 --enable-jemalloc) meson_option_parse
--enable-malloc=jemalloc jemalloc
1192 # everything else has the same name in configure and meson
1193 --enable-* |
--disable-*) meson_option_parse
"$opt" "$optarg"
1196 echo "ERROR: unknown option $opt"
1197 echo "Try '$0 --help' for more information"
1203 # test for any invalid configuration combinations
1204 if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
1205 error_exit
"Can't enable plugins on non-TCG builds"
1208 case $git_submodules_action in
1210 if test ! -e "$source_path/.git"; then
1211 echo "ERROR: cannot $git_submodules_action git submodules without .git"
1216 if ! test -f "$source_path/ui/keycodemapdb/README"
1219 echo "ERROR: missing GIT submodules"
1221 if test -e "$source_path/.git"; then
1222 echo "--with-git-submodules=ignore specified but submodules were not"
1223 echo "checked out. Please initialize and update submodules."
1225 echo "This is not a GIT checkout but module content appears to"
1226 echo "be missing. Do not use 'git archive' or GitHub download links"
1227 echo "to acquire QEMU source archives. Non-GIT builds are only"
1228 echo "supported with source archives linked from:"
1230 echo " https://www.qemu.org/download/#source"
1232 echo "Developers working with GIT can use scripts/archive-source.sh"
1233 echo "if they need to create valid source archives."
1240 echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'"
1245 libdir
="${libdir:-$prefix/lib}"
1246 libexecdir
="${libexecdir:-$prefix/libexec}"
1247 includedir
="${includedir:-$prefix/include}"
1249 if test "$mingw32" = "yes" ; then
1250 bindir
="${bindir:-$prefix}"
1252 bindir
="${bindir:-$prefix/bin}"
1254 mandir
="${mandir:-$prefix/share/man}"
1255 datadir
="${datadir:-$prefix/share}"
1256 docdir
="${docdir:-$prefix/share/doc}"
1257 sysconfdir
="${sysconfdir:-$prefix/etc}"
1258 local_statedir
="${local_statedir:-$prefix/var}"
1259 firmwarepath
="${firmwarepath:-$datadir/qemu-firmware}"
1260 localedir
="${localedir:-$datadir/locale}"
1263 ppc
) CPU_CFLAGS
="-m32" ;;
1264 ppc64
) CPU_CFLAGS
="-m64" ;;
1265 sparc
) CPU_CFLAGS
="-m32 -mv8plus -mcpu=ultrasparc" ;;
1266 sparc64
) CPU_CFLAGS
="-m64 -mcpu=ultrasparc" ;;
1267 s390
) CPU_CFLAGS
="-m31" ;;
1268 s390x
) CPU_CFLAGS
="-m64" ;;
1269 i386
) CPU_CFLAGS
="-m32" ;;
1270 x32
) CPU_CFLAGS
="-mx32" ;;
1272 # ??? Only extremely old AMD cpus do not have cmpxchg16b.
1273 # If we truly care, we should simply detect this case at
1274 # runtime and generate the fallback to serial emulation.
1275 x86_64
) CPU_CFLAGS
="-m64 -mcx16" ;;
1277 # No special flags required for other host CPUs
1280 if eval test -z "\${cross_cc_$cpu}"; then
1281 eval "cross_cc_${cpu}=\$cc"
1282 cross_cc_vars
="$cross_cc_vars cross_cc_${cpu}"
1285 # For user-mode emulation the host arch has to be one we explicitly
1286 # support, even if we're using TCI.
1287 if [ "$ARCH" = "unknown" ]; then
1292 default_target_list
=""
1293 deprecated_targets_list
=ppc64abi32-linux-user
1294 deprecated_features
=""
1297 if [ "$softmmu" = "yes" ]; then
1298 mak_wilds
="${mak_wilds} $source_path/configs/targets/*-softmmu.mak"
1300 if [ "$linux_user" = "yes" ]; then
1301 mak_wilds
="${mak_wilds} $source_path/configs/targets/*-linux-user.mak"
1303 if [ "$bsd_user" = "yes" ]; then
1304 mak_wilds
="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak"
1307 # If the user doesn't explicitly specify a deprecated target we will
1309 if test -z "$target_list"; then
1310 if test -z "$target_list_exclude"; then
1311 target_list_exclude
="$deprecated_targets_list"
1313 target_list_exclude
="$target_list_exclude,$deprecated_targets_list"
1317 for config
in $mak_wilds; do
1318 target
="$(basename "$config" .mak)"
1319 if echo "$target_list_exclude" |
grep -vq "$target"; then
1320 default_target_list
="${default_target_list} $target"
1324 if test x
"$show_help" = x
"yes" ; then
1327 Usage: configure [options]
1328 Options: [defaults in brackets after descriptions]
1331 --help print this message
1332 --prefix=PREFIX install in PREFIX [$prefix]
1333 --interp-prefix=PREFIX where to find shared libraries, etc.
1334 use %M for cpu name [$interp_prefix]
1335 --target-list=LIST set target list (default: build all non-deprecated)
1336 $(echo Available targets: $default_target_list | \
1337 fold -s -w 53 | sed -e 's/^/ /')
1338 $(echo Deprecated targets: $deprecated_targets_list | \
1339 fold -s -w 53 | sed -e 's/^/ /')
1340 --target-list-exclude=LIST exclude a set of targets from the default target-list
1342 Advanced options (experts only):
1343 --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix]
1344 --cc=CC use C compiler CC [$cc]
1345 --iasl=IASL use ACPI compiler IASL [$iasl]
1346 --host-cc=CC use C compiler CC [$host_cc] for code run at
1348 --cxx=CXX use C++ compiler CXX [$cxx]
1349 --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
1350 --extra-cflags=CFLAGS append extra C compiler flags CFLAGS
1351 --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
1352 --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
1353 --cross-cc-ARCH=CC use compiler when building ARCH guest test cases
1354 --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests
1355 --make=MAKE use specified make [$make]
1356 --python=PYTHON use specified python [$python]
1357 --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build]
1358 --meson=MESON use specified meson [$meson]
1359 --ninja=NINJA use specified ninja [$ninja]
1360 --smbd=SMBD use specified smbd [$smbd]
1361 --with-git=GIT use specified git [$git]
1362 --with-git-submodules=update update git submodules (default if .git dir exists)
1363 --with-git-submodules=validate fail if git submodules are not up to date
1364 --with-git-submodules=ignore do not update or check git submodules (default if no .git dir)
1365 --static enable static build [$static]
1366 --mandir=PATH install man pages in PATH
1367 --datadir=PATH install firmware in PATH/$qemu_suffix
1368 --localedir=PATH install translation in PATH/$qemu_suffix
1369 --docdir=PATH install documentation in PATH/$qemu_suffix
1370 --bindir=PATH install binaries in PATH
1371 --libdir=PATH install libraries in PATH
1372 --libexecdir=PATH install helper binaries in PATH
1373 --sysconfdir=PATH install config in PATH/$qemu_suffix
1374 --localstatedir=PATH install local state in PATH (set at runtime on win32)
1375 --firmwarepath=PATH search PATH for firmware files
1376 --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs.
1377 --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
1378 --with-pkgversion=VERS use specified string as sub-version of the package
1379 --without-default-features default all --enable-* options to "disabled"
1380 --without-default-devices do not include any device that is not needed to
1381 start the emulator (only use if you are including
1382 desired devices in configs/devices/)
1383 --with-devices-ARCH=NAME override default configs/devices
1384 --enable-debug enable common debug build options
1385 --enable-sanitizers enable default sanitizers
1386 --enable-tsan enable thread sanitizer
1387 --disable-strip disable stripping binaries
1388 --disable-werror disable compilation abort on warning
1389 --disable-stack-protector disable compiler-provided stack protection
1390 --audio-drv-list=LIST set audio drivers to try if -audiodev is not used
1391 --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L
1392 --block-drv-rw-whitelist=L
1393 set block driver read-write whitelist
1394 (by default affects only QEMU, not tools like qemu-img)
1395 --block-drv-ro-whitelist=L
1396 set block driver read-only whitelist
1397 (by default affects only QEMU, not tools like qemu-img)
1398 --enable-block-drv-whitelist-in-tools
1399 use block whitelist also in tools instead of only QEMU
1400 --with-trace-file=NAME Full PATH,NAME of file to store traces
1402 --cpu=CPU Build for host CPU [$cpu]
1403 --with-coroutine=BACKEND coroutine backend. Supported options:
1404 ucontext, sigaltstack, windows
1405 --enable-gcov enable test coverage analysis with gcov
1406 --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
1407 --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
1408 --tls-priority default TLS protocol/cipher priority string
1409 --enable-gprof QEMU profiling with gprof
1410 --enable-profiler profiler support
1411 --enable-debug-stack-usage
1412 track the maximum stack usage of stacks created by qemu_alloc_stack
1414 enable plugins via shared library loading
1415 --disable-containers don't use containers for cross-building
1416 --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin]
1420 system all system emulation targets
1421 user supported user emulation targets
1422 linux-user all linux usermode emulation targets
1423 bsd-user all BSD usermode emulation targets
1424 guest-agent build the QEMU Guest Agent
1425 pie Position Independent Executables
1426 modules modules support (non-Windows)
1427 module-upgrades try to load modules from alternate paths for upgrades
1428 debug-tcg TCG debugging (default is disabled)
1429 debug-info debugging information
1430 lto Enable Link-Time Optimization.
1431 safe-stack SafeStack Stack Smash Protection. Depends on
1432 clang/llvm >= 3.7 and requires coroutine backend ucontext.
1433 membarrier membarrier system call (for Linux 4.14+ or Windows)
1434 rdma Enable RDMA-based migration
1435 pvrdma Enable PVRDMA support
1436 vhost-net vhost-net kernel acceleration support
1437 vhost-vsock virtio sockets device support
1438 vhost-scsi vhost-scsi kernel target support
1439 vhost-crypto vhost-user-crypto backend support
1440 vhost-kernel vhost kernel backend support
1441 vhost-user vhost-user backend support
1442 vhost-vdpa vhost-vdpa kernel backend support
1443 live-block-migration Block migration in the main migration stream
1444 coroutine-pool coroutine freelist (better performance)
1446 numa libnuma support
1447 avx2 AVX2 optimization support
1448 avx512f AVX512F optimization support
1449 replication replication support
1450 opengl opengl support
1451 xfsctl xfsctl support
1452 qom-cast-debug cast debugging support
1453 tools build qemu-io, qemu-nbd and qemu-img tools
1454 bochs bochs image format support
1455 cloop cloop image format support
1456 dmg dmg image format support
1457 qcow1 qcow v1 image format support
1458 vdi vdi image format support
1459 vvfat vvfat image format support
1460 qed qed image format support
1461 parallels parallels image format support
1462 crypto-afalg Linux AF_ALG crypto backend driver
1463 debug-mutex mutex debugging support
1464 rng-none dummy RNG, avoid using /dev/(u)random and getrandom()
1466 slirp-smbd use smbd (at path --smbd=*) in slirp networking
1468 NOTE: The object files are built at the place where configure is launched
1473 # Remove old dependency files to make sure that they get properly regenerated
1474 rm -f */config-devices.mak.d
1476 if test -z "$python"
1478 error_exit
"Python not found. Use --python=/path/to/python"
1482 error_exit
"GNU make ($make) not found"
1485 # Note that if the Python conditional here evaluates True we will exit
1486 # with status 1 which is a shell 'false' value.
1487 if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
1488 error_exit
"Cannot use '$python', Python >= 3.6 is required." \
1489 "Use --python=/path/to/python to specify a supported Python."
1492 # Preserve python version since some functionality is dependent on it
1493 python_version
=$
($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev
/null
)
1495 # Suppress writing compiled files
1498 if test -z "$meson"; then
1499 if test "$explicit_python" = no
&& has meson
&& version_ge
"$(meson --version)" 0.59.3; then
1501 elif test $git_submodules_action != 'ignore' ; then
1503 elif test -e "${source_path}/meson/meson.py" ; then
1506 if test "$explicit_python" = yes; then
1507 error_exit
"--python requires using QEMU's embedded Meson distribution, but it was not found."
1509 error_exit
"Meson not found. Use --meson=/path/to/meson"
1513 # Meson uses its own Python interpreter to invoke other Python scripts,
1514 # but the user wants to use the one they specified with --python.
1516 # We do not want to override the distro Python interpreter (and sometimes
1517 # cannot: for example in Homebrew /usr/bin/meson is a bash script), so
1518 # just require --meson=git|internal together with --python.
1519 if test "$explicit_python" = yes; then
1522 *) error_exit
"--python requires using QEMU's embedded Meson distribution." ;;
1527 if test "$meson" = git
; then
1528 git_submodules
="${git_submodules} meson"
1533 meson
="$python ${source_path}/meson/meson.py"
1535 *) meson
=$
(command -v "$meson") ;;
1540 if test -z "$ninja"; then
1541 for c
in ninja ninja-build samu
; do
1543 ninja
=$
(command -v "$c")
1547 if test -z "$ninja"; then
1548 error_exit
"Cannot find Ninja"
1552 # Check that the C compiler works. Doing this here before testing
1553 # the host CPU ensures that we had a valid CC to autodetect the
1554 # $cpu var (and we should bail right here if that's not the case).
1555 # It also allows the help message to be printed without a CC.
1557 if compile_object
; then
1558 : C compiler works ok
1560 error_exit
"\"$cc\" either does not exist or does not work"
1562 if ! compile_prog
; then
1563 error_exit
"\"$cc\" cannot build an executable (is your linker broken?)"
1566 # Consult white-list to determine whether to enable werror
1567 # by default. Only enable by default for git builds
1568 if test -z "$werror" ; then
1569 if test "$git_submodules_action" != "ignore" && \
1570 { test "$linux" = "yes" ||
test "$mingw32" = "yes"; }; then
1577 if test "$targetos" = "bogus"; then
1578 # Now that we know that we're not printing the help and that
1579 # the compiler works (so the results of the check_defines we used
1580 # to identify the OS are reliable), if we didn't recognize the
1581 # host OS we should stop now.
1582 error_exit
"Unrecognized host OS (uname -s reports '$(uname -s)')"
1585 # Check whether the compiler matches our minimum requirements:
1587 #if defined(__clang_major__) && defined(__clang_minor__)
1588 # ifdef __apple_build_version__
1589 # if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0)
1590 # error You need at least XCode Clang v10.0 to compile QEMU
1593 # if __clang_major__ < 6 || (__clang_major__ == 6 && __clang_minor__ < 0)
1594 # error You need at least Clang v6.0 to compile QEMU
1597 #elif defined(__GNUC__) && defined(__GNUC_MINOR__)
1598 # if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4)
1599 # error You need at least GCC v7.4.0 to compile QEMU
1602 # error You either need GCC or Clang to compiler QEMU
1604 int main (void) { return 0; }
1606 if ! compile_prog
"" "" ; then
1607 error_exit
"You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)"
1610 # Accumulate -Wfoo and -Wno-bar separately.
1611 # We will list all of the enable flags first, and the disable flags second.
1612 # Note that we do not add -Werror, because that would enable it for all
1613 # configure tests. If a configure test failed due to -Werror this would
1614 # just silently disable some features, so it's too error prone.
1617 add_to warn_flags
-Wold-style-declaration
1618 add_to warn_flags
-Wold-style-definition
1619 add_to warn_flags
-Wtype-limits
1620 add_to warn_flags
-Wformat-security
1621 add_to warn_flags
-Wformat-y2k
1622 add_to warn_flags
-Winit-self
1623 add_to warn_flags
-Wignored-qualifiers
1624 add_to warn_flags
-Wempty-body
1625 add_to warn_flags
-Wnested-externs
1626 add_to warn_flags
-Wendif-labels
1627 add_to warn_flags
-Wexpansion-to-defined
1628 add_to warn_flags
-Wimplicit-fallthrough=2
1631 add_to nowarn_flags
-Wno-initializer-overrides
1632 add_to nowarn_flags
-Wno-missing-include-dirs
1633 add_to nowarn_flags
-Wno-shift-negative-value
1634 add_to nowarn_flags
-Wno-string-plus-int
1635 add_to nowarn_flags
-Wno-typedef-redefinition
1636 add_to nowarn_flags
-Wno-tautological-type-limit-compare
1637 add_to nowarn_flags
-Wno-psabi
1639 gcc_flags
="$warn_flags $nowarn_flags"
1641 cc_has_warning_flag
() {
1644 # Use the positive sense of the flag when testing for -Wno-wombat
1645 # support (gcc will happily accept the -Wno- form of unknown
1647 optflag
="$(echo $1 | sed -e 's/^-Wno-/-W/')"
1648 compile_prog
"-Werror $optflag" ""
1651 for flag
in $gcc_flags; do
1652 if cc_has_warning_flag
$flag ; then
1653 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
1657 if test "$stack_protector" != "no"; then
1659 int main(int argc, char *argv[])
1661 char arr[64], *p = arr, *c = argv[0];
1668 gcc_flags
="-fstack-protector-strong -fstack-protector-all"
1670 for flag
in $gcc_flags; do
1671 # We need to check both a compile and a link, since some compiler
1672 # setups fail only on a .c->.o compile and some only at link time
1673 if compile_object
"-Werror $flag" &&
1674 compile_prog
"-Werror $flag" ""; then
1675 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
1676 QEMU_LDFLAGS
="$QEMU_LDFLAGS $flag"
1681 if test "$stack_protector" = yes; then
1682 if test $sp_on = 0; then
1683 error_exit
"Stack protector not supported"
1688 # Disable -Wmissing-braces on older compilers that warn even for
1689 # the "universal" C zero initializer {0}.
1695 if compile_object
"-Werror" "" ; then
1698 QEMU_CFLAGS
="$QEMU_CFLAGS -Wno-missing-braces"
1701 # Our module code doesn't support Windows
1702 if test "$modules" = "yes" && test "$mingw32" = "yes" ; then
1703 error_exit
"Modules are not available for Windows"
1706 # module_upgrades is only reasonable if modules are enabled
1707 if test "$modules" = "no" && test "$module_upgrades" = "yes" ; then
1708 error_exit
"Can't enable module-upgrades as Modules are not enabled"
1711 # Static linking is not possible with plugins, modules or PIE
1712 if test "$static" = "yes" ; then
1713 if test "$modules" = "yes" ; then
1714 error_exit
"static and modules are mutually incompatible"
1716 if test "$plugins" = "yes"; then
1717 error_exit
"static and plugins are mutually incompatible"
1726 # define THREAD __thread
1730 static THREAD int tls_var;
1731 int main(void) { return tls_var; }
1734 # Check we support -fno-pie and -no-pie first; we will need the former for
1735 # building ROMs, and both for everything if --disable-pie is passed.
1736 if compile_prog
"-Werror -fno-pie" "-no-pie"; then
1737 CFLAGS_NOPIE
="-fno-pie"
1738 LDFLAGS_NOPIE
="-no-pie"
1741 if test "$static" = "yes"; then
1742 if test "$pie" != "no" && compile_prog
"-Werror -fPIE -DPIE" "-static-pie"; then
1743 CONFIGURE_CFLAGS
="-fPIE -DPIE $CONFIGURE_CFLAGS"
1744 QEMU_LDFLAGS
="-static-pie $QEMU_LDFLAGS"
1746 elif test "$pie" = "yes"; then
1747 error_exit
"-static-pie not available due to missing toolchain support"
1749 QEMU_LDFLAGS
="-static $QEMU_LDFLAGS"
1752 elif test "$pie" = "no"; then
1753 CONFIGURE_CFLAGS
="$CFLAGS_NOPIE $CONFIGURE_CFLAGS"
1754 CONFIGURE_LDFLAGS
="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS"
1755 elif compile_prog
"-Werror -fPIE -DPIE" "-pie"; then
1756 CONFIGURE_CFLAGS
="-fPIE -DPIE $CONFIGURE_CFLAGS"
1757 CONFIGURE_LDFLAGS
="-pie $CONFIGURE_LDFLAGS"
1759 elif test "$pie" = "yes"; then
1760 error_exit
"PIE not available due to missing toolchain support"
1762 echo "Disabling PIE due to missing toolchain support"
1766 # Detect support for PT_GNU_RELRO + DT_BIND_NOW.
1767 # The combination is known as "full relro", because .got.plt is read-only too.
1768 if compile_prog
"" "-Wl,-z,relro -Wl,-z,now" ; then
1769 QEMU_LDFLAGS
="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS"
1772 ##########################################
1773 # __sync_fetch_and_and requires at least -march=i486. Many toolchains
1774 # use i686 as default anyway, but for those that don't, an explicit
1775 # specification is necessary
1777 if test "$cpu" = "i386"; then
1779 static int sfaa(int *ptr)
1781 return __sync_fetch_and_and(ptr, 0);
1787 val = __sync_val_compare_and_swap(&val, 0, 1);
1792 if ! compile_prog
"" "" ; then
1793 QEMU_CFLAGS
="-march=i486 $QEMU_CFLAGS"
1797 if test "$tcg" = "enabled"; then
1798 git_submodules
="$git_submodules tests/fp/berkeley-testfloat-3"
1799 git_submodules
="$git_submodules tests/fp/berkeley-softfloat-3"
1802 if test -z "${target_list+xxx}" ; then
1804 for target
in $default_target_list; do
1805 target_list
="$target_list $target"
1807 target_list
="${target_list# }"
1810 target_list
=$
(echo "$target_list" |
sed -e 's/,/ /g')
1811 for target
in $target_list; do
1812 # Check that we recognised the target name; this allows a more
1813 # friendly error message than if we let it fall through.
1814 case " $default_target_list " in
1818 error_exit
"Unknown target name '$target'"
1824 for target
in $target_list; do
1825 # if a deprecated target is enabled we note it here
1826 if echo "$deprecated_targets_list" |
grep -q "$target"; then
1827 add_to deprecated_features
$target
1831 # see if system emulation was really requested
1832 case " $target_list " in
1833 *"-softmmu "*) softmmu
=yes
1839 feature_not_found
() {
1843 error_exit
"User requested feature $feature" \
1844 "configure was not able to find it." \
1849 # big/little endian test
1852 short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, };
1853 short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, };
1854 int main(int argc, char *argv[])
1856 return printf("%s %s\n", (char *)big_endian, (char *)little_endian);
1860 if compile_prog
; then
1861 if strings -a $TMPE |
grep -q BiGeNdIaN
; then
1863 elif strings -a $TMPE |
grep -q LiTtLeEnDiAn
; then
1866 echo big
/little
test failed
1870 echo big
/little
test failed
1874 ##########################################
1876 if test -z "$want_tools"; then
1877 if test "$softmmu" = "no"; then
1884 #########################################
1885 # vhost interdependencies and host support
1888 if test "$vhost_user" = "yes" && test "$linux" != "yes"; then
1889 error_exit
"vhost-user is only available on Linux"
1891 test "$vhost_vdpa" = "" && vhost_vdpa
=$linux
1892 if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then
1893 error_exit
"vhost-vdpa is only available on Linux"
1895 test "$vhost_kernel" = "" && vhost_kernel
=$linux
1896 if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then
1897 error_exit
"vhost-kernel is only available on Linux"
1900 # vhost-kernel devices
1901 test "$vhost_scsi" = "" && vhost_scsi
=$vhost_kernel
1902 if test "$vhost_scsi" = "yes" && test "$vhost_kernel" != "yes"; then
1903 error_exit
"--enable-vhost-scsi requires --enable-vhost-kernel"
1905 test "$vhost_vsock" = "" && vhost_vsock
=$vhost_kernel
1906 if test "$vhost_vsock" = "yes" && test "$vhost_kernel" != "yes"; then
1907 error_exit
"--enable-vhost-vsock requires --enable-vhost-kernel"
1910 # vhost-user backends
1911 test "$vhost_net_user" = "" && vhost_net_user
=$vhost_user
1912 if test "$vhost_net_user" = "yes" && test "$vhost_user" = "no"; then
1913 error_exit
"--enable-vhost-net-user requires --enable-vhost-user"
1915 test "$vhost_crypto" = "" && vhost_crypto
=$vhost_user
1916 if test "$vhost_crypto" = "yes" && test "$vhost_user" = "no"; then
1917 error_exit
"--enable-vhost-crypto requires --enable-vhost-user"
1919 test "$vhost_user_fs" = "" && vhost_user_fs
=$vhost_user
1920 if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then
1921 error_exit
"--enable-vhost-user-fs requires --enable-vhost-user"
1923 #vhost-vdpa backends
1924 test "$vhost_net_vdpa" = "" && vhost_net_vdpa
=$vhost_vdpa
1925 if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then
1926 error_exit
"--enable-vhost-net-vdpa requires --enable-vhost-vdpa"
1929 # OR the vhost-kernel, vhost-vdpa and vhost-user values for simplicity
1930 if test "$vhost_net" = ""; then
1931 test "$vhost_net_user" = "yes" && vhost_net
=yes
1932 test "$vhost_net_vdpa" = "yes" && vhost_net
=yes
1933 test "$vhost_kernel" = "yes" && vhost_net
=yes
1936 ##########################################
1939 if ! has
"$pkg_config_exe"; then
1940 error_exit
"pkg-config binary '$pkg_config_exe' not found"
1943 ##########################################
1946 if test "$xen" != "disabled" ; then
1947 # Check whether Xen library path is specified via --extra-ldflags to avoid
1948 # overriding this setting with pkg-config output. If not, try pkg-config
1949 # to obtain all needed flags.
1951 if ! echo $EXTRA_LDFLAGS |
grep tools
/libxc
> /dev
/null
&& \
1952 $pkg_config --exists xencontrol
; then
1953 xen_ctrl_version
="$(printf '%d%02d%02d' \
1954 $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
1956 xen_pc
="xencontrol xenstore xenforeignmemory xengnttab"
1957 xen_pc
="$xen_pc xenevtchn xendevicemodel"
1958 if $pkg_config --exists xentoolcore
; then
1959 xen_pc
="$xen_pc xentoolcore"
1961 xen_cflags
="$($pkg_config --cflags $xen_pc)"
1962 xen_libs
="$($pkg_config --libs $xen_pc)"
1965 xen_libs
="-lxenstore -lxenctrl"
1966 xen_stable_libs
="-lxenforeignmemory -lxengnttab -lxenevtchn"
1968 # First we test whether Xen headers and libraries are available.
1969 # If no, we are done and there is no Xen support.
1970 # If yes, more tests are run to detect the Xen version.
1974 #include <xenctrl.h>
1979 if ! compile_prog
"" "$xen_libs" ; then
1981 if test "$xen" = "enabled" ; then
1982 feature_not_found
"xen" "Install xen devel"
1988 cat > $TMPC <<EOF &&
1989 #undef XC_WANT_COMPAT_DEVICEMODEL_API
1990 #define __XEN_TOOLS__
1991 #include <xendevicemodel.h>
1992 #include <xenforeignmemory.h>
1994 xendevicemodel_handle *xd;
1995 xenforeignmemory_handle *xfmem;
1997 xd = xendevicemodel_open(0, 0);
1998 xendevicemodel_pin_memory_cacheattr(xd, 0, 0, 0, 0);
2000 xfmem = xenforeignmemory_open(0, 0);
2001 xenforeignmemory_map_resource(xfmem, 0, 0, 0, 0, 0, NULL, 0, 0);
2006 compile_prog
"" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore"
2008 xen_stable_libs
="-lxendevicemodel $xen_stable_libs -lxentoolcore"
2009 xen_ctrl_version
=41100
2012 cat > $TMPC <<EOF &&
2013 #undef XC_WANT_COMPAT_MAP_FOREIGN_API
2014 #include <xenforeignmemory.h>
2015 #include <xentoolcore.h>
2017 xenforeignmemory_handle *xfmem;
2019 xfmem = xenforeignmemory_open(0, 0);
2020 xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0);
2021 xentoolcore_restrict_all(0);
2026 compile_prog
"" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore"
2028 xen_stable_libs
="-lxendevicemodel $xen_stable_libs -lxentoolcore"
2029 xen_ctrl_version
=41000
2032 cat > $TMPC <<EOF &&
2033 #undef XC_WANT_COMPAT_DEVICEMODEL_API
2034 #define __XEN_TOOLS__
2035 #include <xendevicemodel.h>
2037 xendevicemodel_handle *xd;
2039 xd = xendevicemodel_open(0, 0);
2040 xendevicemodel_close(xd);
2045 compile_prog
"" "$xen_libs -lxendevicemodel $xen_stable_libs"
2047 xen_stable_libs
="-lxendevicemodel $xen_stable_libs"
2048 xen_ctrl_version
=40900
2051 cat > $TMPC <<EOF &&
2053 * If we have stable libs the we don't want the libxc compat
2054 * layers, regardless of what CFLAGS we may have been given.
2056 * Also, check if xengnttab_grant_copy_segment_t is defined and
2057 * grant copy operation is implemented.
2059 #undef XC_WANT_COMPAT_EVTCHN_API
2060 #undef XC_WANT_COMPAT_GNTTAB_API
2061 #undef XC_WANT_COMPAT_MAP_FOREIGN_API
2062 #include <xenctrl.h>
2063 #include <xenstore.h>
2064 #include <xenevtchn.h>
2065 #include <xengnttab.h>
2066 #include <xenforeignmemory.h>
2068 #include <xen/hvm/hvm_info_table.h>
2069 #if !defined(HVM_MAX_VCPUS)
2070 # error HVM_MAX_VCPUS not defined
2073 xc_interface *xc = NULL;
2074 xenforeignmemory_handle *xfmem;
2075 xenevtchn_handle *xe;
2076 xengnttab_handle *xg;
2077 xengnttab_grant_copy_segment_t* seg = NULL;
2081 xc = xc_interface_open(0, 0, 0);
2082 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
2083 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
2084 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
2085 xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
2087 xfmem = xenforeignmemory_open(0, 0);
2088 xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0);
2090 xe = xenevtchn_open(0, 0);
2093 xg = xengnttab_open(0, 0);
2094 xengnttab_grant_copy(xg, 0, seg);
2099 compile_prog
"" "$xen_libs $xen_stable_libs"
2101 xen_ctrl_version
=40800
2104 cat > $TMPC <<EOF &&
2106 * If we have stable libs the we don't want the libxc compat
2107 * layers, regardless of what CFLAGS we may have been given.
2109 #undef XC_WANT_COMPAT_EVTCHN_API
2110 #undef XC_WANT_COMPAT_GNTTAB_API
2111 #undef XC_WANT_COMPAT_MAP_FOREIGN_API
2112 #include <xenctrl.h>
2113 #include <xenstore.h>
2114 #include <xenevtchn.h>
2115 #include <xengnttab.h>
2116 #include <xenforeignmemory.h>
2118 #include <xen/hvm/hvm_info_table.h>
2119 #if !defined(HVM_MAX_VCPUS)
2120 # error HVM_MAX_VCPUS not defined
2123 xc_interface *xc = NULL;
2124 xenforeignmemory_handle *xfmem;
2125 xenevtchn_handle *xe;
2126 xengnttab_handle *xg;
2130 xc = xc_interface_open(0, 0, 0);
2131 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
2132 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
2133 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
2134 xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
2136 xfmem = xenforeignmemory_open(0, 0);
2137 xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0);
2139 xe = xenevtchn_open(0, 0);
2142 xg = xengnttab_open(0, 0);
2143 xengnttab_map_grant_ref(xg, 0, 0, 0);
2148 compile_prog
"" "$xen_libs $xen_stable_libs"
2150 xen_ctrl_version
=40701
2155 cat > $TMPC <<EOF &&
2156 #include <xenctrl.h>
2157 #include <xenstore.h>
2159 #include <xen/hvm/hvm_info_table.h>
2160 #if !defined(HVM_MAX_VCPUS)
2161 # error HVM_MAX_VCPUS not defined
2166 xc = xc_interface_open(0, 0, 0);
2167 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
2168 xc_gnttab_open(NULL, 0);
2169 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
2170 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
2171 xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
2172 xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0);
2176 compile_prog
"" "$xen_libs"
2178 xen_ctrl_version
=40600
2183 cat > $TMPC <<EOF &&
2184 #include <xenctrl.h>
2185 #include <xenstore.h>
2187 #include <xen/hvm/hvm_info_table.h>
2188 #if !defined(HVM_MAX_VCPUS)
2189 # error HVM_MAX_VCPUS not defined
2194 xc = xc_interface_open(0, 0, 0);
2195 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
2196 xc_gnttab_open(NULL, 0);
2197 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
2198 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
2199 xc_hvm_create_ioreq_server(xc, 0, 0, NULL);
2203 compile_prog
"" "$xen_libs"
2205 xen_ctrl_version
=40500
2209 cat > $TMPC <<EOF &&
2210 #include <xenctrl.h>
2211 #include <xenstore.h>
2213 #include <xen/hvm/hvm_info_table.h>
2214 #if !defined(HVM_MAX_VCPUS)
2215 # error HVM_MAX_VCPUS not defined
2220 xc = xc_interface_open(0, 0, 0);
2221 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
2222 xc_gnttab_open(NULL, 0);
2223 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
2224 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
2228 compile_prog
"" "$xen_libs"
2230 xen_ctrl_version
=40200
2234 if test "$xen" = "enabled" ; then
2235 feature_not_found
"xen (unsupported version)" \
2236 "Install a supported xen (xen 4.2 or newer)"
2241 if test "$xen" = enabled
; then
2242 if test $xen_ctrl_version -ge 40701 ; then
2243 xen_libs
="$xen_libs $xen_stable_libs "
2249 ##########################################
2250 # RDMA needs OpenFabrics libraries
2251 if test "$rdma" != "no" ; then
2253 #include <rdma/rdma_cma.h>
2254 int main(void) { return 0; }
2256 rdma_libs
="-lrdmacm -libverbs -libumad"
2257 if compile_prog
"" "$rdma_libs" ; then
2260 if test "$rdma" = "yes" ; then
2262 " OpenFabrics librdmacm/libibverbs/libibumad not present." \
2264 " (1) Fast: Install infiniband packages (devel) from your distro." \
2265 " (2) Cleanest: Install libraries from www.openfabrics.org" \
2266 " (3) Also: Install softiwarp if you don't have RDMA hardware"
2272 ##########################################
2275 cat > $TMPC <<EOF &&
2276 #include <sys/mman.h>
2283 addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED);
2289 if test "$rdma" = "yes" ; then
2292 if compile_prog
"" ""; then
2299 if ! compile_prog
"" ""; then
2300 error_exit
"PVRDMA is not supported since mremap is not implemented"
2309 if test "$pvrdma" = "yes" ; then
2310 error_exit
"PVRDMA requires rdma suppport"
2315 # Let's see if enhanced reg_mr is supported
2316 if test "$pvrdma" = "yes" ; then
2318 cat > $TMPC <<EOF &&
2319 #include <infiniband/verbs.h>
2325 struct ibv_pd *pd = NULL;
2331 mr = ibv_reg_mr_iova(pd, addr, length, iova, access);
2338 if ! compile_prog
"" "-libverbs"; then
2339 QEMU_CFLAGS
="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR"
2343 ##########################################
2344 # xfsctl() probe, used for file-posix.c
2345 if test "$xfs" != "no" ; then
2347 #include <stddef.h> /* NULL */
2348 #include <xfs/xfs.h>
2351 xfsctl(NULL, 0, 0, NULL);
2355 if compile_prog
"" "" ; then
2358 if test "$xfs" = "yes" ; then
2359 feature_not_found
"xfs" "Install xfsprogs/xfslibs devel"
2365 ##########################################
2366 # plugin linker support probe
2368 if test "$plugins" != "no"; then
2370 #########################################
2371 # See if --dynamic-list is supported by the linker
2373 ld_dynamic_list
="no"
2396 if compile_prog
"" "-Wl,--dynamic-list=$TMPTXT" ; then
2397 ld_dynamic_list
="yes"
2400 #########################################
2401 # See if -exported_symbols_list is supported by the linker
2403 ld_exported_symbols_list
="no"
2408 if compile_prog
"" "-Wl,-exported_symbols_list,$TMPTXT" ; then
2409 ld_exported_symbols_list
="yes"
2412 if test "$ld_dynamic_list" = "no" &&
2413 test "$ld_exported_symbols_list" = "no" ; then
2414 if test "$plugins" = "yes"; then
2416 "Plugin support requires dynamic linking and specifying a set of symbols " \
2417 "that are exported to plugins. Unfortunately your linker doesn't " \
2418 "support the flag (--dynamic-list or -exported_symbols_list) used " \
2428 ##########################################
2429 # glib support probe
2432 glib_modules
=gthread-2.0
2433 if test "$modules" = yes; then
2434 glib_modules
="$glib_modules gmodule-export-2.0"
2435 elif test "$plugins" = "yes"; then
2436 glib_modules
="$glib_modules gmodule-no-export-2.0"
2439 for i
in $glib_modules; do
2440 if $pkg_config --atleast-version=$glib_req_ver $i; then
2441 glib_cflags
=$
($pkg_config --cflags $i)
2442 glib_libs
=$
($pkg_config --libs $i)
2444 error_exit
"glib-$glib_req_ver $i is required to compile QEMU"
2448 # This workaround is required due to a bug in pkg-config file for glib as it
2449 # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static
2451 if test "$static" = yes && test "$mingw32" = yes; then
2452 glib_cflags
="-DGLIB_STATIC_COMPILATION $glib_cflags"
2455 if ! test "$gio" = "no"; then
2457 if $pkg_config --atleast-version=$glib_req_ver gio-2.0
; then
2458 gio_cflags
=$
($pkg_config --cflags gio-2.0
)
2459 gio_libs
=$
($pkg_config --libs gio-2.0
)
2460 gdbus_codegen
=$
($pkg_config --variable=gdbus_codegen gio-2.0
)
2461 if ! has
"$gdbus_codegen"; then
2464 # Check that the libraries actually work -- Ubuntu 18.04 ships
2465 # with pkg-config --static --libs data for gio-2.0 that is missing
2466 # -lblkid and will give a link error.
2468 #include <gio/gio.h>
2471 g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0);
2475 if compile_prog
"$gio_cflags" "$gio_libs" ; then
2481 if test "$pass" = "yes" &&
2482 $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0
; then
2483 gio_cflags
="$gio_cflags $($pkg_config --cflags gio-unix-2.0)"
2484 gio_libs
="$gio_libs $($pkg_config --libs gio-unix-2.0)"
2488 if test "$pass" = "no"; then
2489 if test "$gio" = "yes"; then
2490 feature_not_found
"gio" "Install libgio >= 2.0"
2499 # Sanity check that the current size_t matches the
2500 # size that glib thinks it should be. This catches
2501 # problems on multi-arch where people try to build
2502 # 32-bit QEMU while pointing at 64-bit glib headers
2507 #define QEMU_BUILD_BUG_ON(x) \
2508 typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused));
2511 QEMU_BUILD_BUG_ON(sizeof(size_t) != GLIB_SIZEOF_SIZE_T);
2516 if ! compile_prog
"$glib_cflags" "$glib_libs" ; then
2517 error_exit
"sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\
2518 "You probably need to set PKG_CONFIG_LIBDIR"\
2519 "to point to the right pkg-config files for your"\
2523 # Silence clang warnings triggered by glib < 2.57.2
2526 typedef struct Foo {
2529 static void foo_free(Foo *f)
2533 G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free);
2534 int main(void) { return 0; }
2536 if ! compile_prog
"$glib_cflags -Werror" "$glib_libs" ; then
2537 if cc_has_warning_flag
"-Wno-unused-function"; then
2538 glib_cflags
="$glib_cflags -Wno-unused-function"
2539 CONFIGURE_CFLAGS
="$CONFIGURE_CFLAGS -Wno-unused-function"
2543 ##########################################
2544 # SHA command probe for modules
2545 if test "$modules" = yes; then
2546 shacmd_probe
="sha1sum sha1 shasum"
2547 for c
in $shacmd_probe; do
2553 if test "$shacmd" = ""; then
2554 error_exit
"one of the checksum commands is required to enable modules: $shacmd_probe"
2558 ##########################################
2559 # TPM emulation is only on POSIX
2561 if test "$tpm" = ""; then
2562 if test "$mingw32" = "yes"; then
2567 elif test "$tpm" = "yes"; then
2568 if test "$mingw32" = "yes" ; then
2569 error_exit
"TPM emulation only available on POSIX systems"
2573 ##########################################
2577 auto | enabled | internal
)
2578 # Simpler to always update submodule, even if not needed.
2579 git_submodules
="${git_submodules} dtc"
2583 ##########################################
2584 # opengl probe (for sdl2, gtk)
2586 if test "$opengl" != "no" ; then
2588 if $pkg_config epoxy
; then
2590 #include <epoxy/egl.h>
2591 int main(void) { return 0; }
2593 if compile_prog
"" "" ; then
2598 if test "$epoxy" = "yes" ; then
2599 opengl_cflags
="$($pkg_config --cflags epoxy)"
2600 opengl_libs
="$($pkg_config --libs epoxy)"
2603 if test "$opengl" = "yes" ; then
2604 feature_not_found
"opengl" "Please install epoxy with EGL"
2612 ##########################################
2615 if test "$numa" != "no" ; then
2618 int main(void) { return numa_available(); }
2621 if compile_prog
"" "-lnuma" ; then
2625 if test "$numa" = "yes" ; then
2626 feature_not_found
"numa" "install numactl devel"
2634 if test "$linux_user" = "yes"; then
2636 #include <linux/usbdevice_fs.h>
2638 #ifndef USBDEVFS_GET_CAPABILITIES
2639 #error "USBDEVFS_GET_CAPABILITIES undefined"
2642 #ifndef USBDEVFS_DISCONNECT_CLAIM
2643 #error "USBDEVFS_DISCONNECT_CLAIM undefined"
2651 if compile_prog
"" ""; then
2656 ##########################################
2657 # check if we have VSS SDK headers for win
2659 if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
2660 test "$vss_win32_sdk" != "no" ; then
2661 case "$vss_win32_sdk" in
2662 "") vss_win32_include
="-isystem $source_path" ;;
2663 *\
*) # The SDK is installed in "Program Files" by default, but we cannot
2664 # handle path with spaces. So we symlink the headers into ".sdk/vss".
2665 vss_win32_include
="-isystem $source_path/.sdk/vss"
2666 symlink
"$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc"
2668 *) vss_win32_include
="-isystem $vss_win32_sdk"
2671 #define __MIDL_user_allocate_free_DEFINED__
2672 #include <inc/win2003/vss.h>
2673 int main(void) { return VSS_CTX_BACKUP; }
2675 if compile_prog
"$vss_win32_include" "" ; then
2676 guest_agent_with_vss
="yes"
2677 QEMU_CFLAGS
="$QEMU_CFLAGS $vss_win32_include"
2678 libs_qga
="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga"
2679 qga_vss_provider
="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb"
2681 if test "$vss_win32_sdk" != "" ; then
2682 echo "ERROR: Please download and install Microsoft VSS SDK:"
2683 echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490"
2684 echo "ERROR: On POSIX-systems, you can extract the SDK headers by:"
2685 echo "ERROR: scripts/extract-vsssdk-headers setup.exe"
2686 echo "ERROR: The headers are extracted in the directory \`inc'."
2687 feature_not_found
"VSS support"
2689 guest_agent_with_vss
="no"
2693 ##########################################
2694 # lookup Windows platform SDK (if not specified)
2695 # The SDK is needed only to build .tlb (type library) file of guest agent
2696 # VSS provider from the source. It is usually unnecessary because the
2697 # pre-compiled .tlb file is included.
2699 if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \
2700 test "$guest_agent_with_vss" = "yes" ; then
2701 if test -z "$win_sdk"; then
2702 programfiles
="$PROGRAMFILES"
2703 test -n "$PROGRAMW6432" && programfiles
="$PROGRAMW6432"
2704 if test -n "$programfiles"; then
2705 win_sdk
=$
(ls -d "$programfiles/Microsoft SDKs/Windows/v"* |
tail -1) 2>/dev
/null
2707 feature_not_found
"Windows SDK"
2709 elif test "$win_sdk" = "no"; then
2714 ##########################################
2715 # check if mingw environment provides a recent ntddscsi.h
2716 if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then
2718 #include <windows.h>
2719 #include <ntddscsi.h>
2721 #if !defined(IOCTL_SCSI_GET_ADDRESS)
2722 #error Missing required ioctl definitions
2724 SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 };
2728 if compile_prog
"" "" ; then
2729 guest_agent_ntddscsi
=yes
2730 libs_qga
="-lsetupapi -lcfgmgr32 $libs_qga"
2734 ##########################################
2738 auto | enabled | internal
)
2739 # Simpler to always update submodule, even if not needed.
2740 git_submodules
="${git_submodules} capstone"
2744 ##########################################
2745 # check and set a backend for coroutine
2747 # We prefer ucontext, but it's not always possible. The fallback
2748 # is sigcontext. On Windows the only valid backend is the Windows
2752 if test "$darwin" != "yes"; then
2754 #include <ucontext.h>
2755 #ifdef __stub_makecontext
2756 #error Ignoring glibc stub makecontext which will always fail
2758 int main(void) { makecontext(0, 0, 0); return 0; }
2760 if compile_prog
"" "" ; then
2765 if test "$coroutine" = ""; then
2766 if test "$mingw32" = "yes"; then
2768 elif test "$ucontext_works" = "yes"; then
2771 coroutine
=sigaltstack
2776 if test "$mingw32" != "yes"; then
2777 error_exit
"'windows' coroutine backend only valid for Windows"
2779 # Unfortunately the user visible backend name doesn't match the
2780 # coroutine-*.c filename for this case, so we have to adjust it here.
2784 if test "$ucontext_works" != "yes"; then
2785 feature_not_found
"ucontext"
2789 if test "$mingw32" = "yes"; then
2790 error_exit
"only the 'windows' coroutine backend is valid for Windows"
2794 error_exit
"unknown coroutine backend $coroutine"
2799 if test "$coroutine_pool" = ""; then
2803 if test "$debug_stack_usage" = "yes"; then
2804 if test "$coroutine_pool" = "yes"; then
2805 echo "WARN: disabling coroutine pool for stack usage debugging"
2810 ##################################################
2814 if test "$safe_stack" = "yes"; then
2816 int main(int argc, char *argv[])
2818 #if ! __has_feature(safe_stack)
2819 #error SafeStack Disabled
2824 flag
="-fsanitize=safe-stack"
2825 # Check that safe-stack is supported and enabled.
2826 if compile_prog
"-Werror $flag" "$flag"; then
2827 # Flag needed both at compilation and at linking
2828 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
2829 QEMU_LDFLAGS
="$QEMU_LDFLAGS $flag"
2831 error_exit
"SafeStack not supported by your compiler"
2833 if test "$coroutine" != "ucontext"; then
2834 error_exit
"SafeStack is only supported by the coroutine backend ucontext"
2838 int main(int argc, char *argv[])
2840 #if defined(__has_feature)
2841 #if __has_feature(safe_stack)
2842 #error SafeStack Enabled
2848 if test "$safe_stack" = "no"; then
2849 # Make sure that safe-stack is disabled
2850 if ! compile_prog
"-Werror" ""; then
2851 # SafeStack was already enabled, try to explicitly remove the feature
2852 flag
="-fno-sanitize=safe-stack"
2853 if ! compile_prog
"-Werror $flag" "$flag"; then
2854 error_exit
"Configure cannot disable SafeStack"
2856 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
2857 QEMU_LDFLAGS
="$QEMU_LDFLAGS $flag"
2859 else # "$safe_stack" = ""
2860 # Set safe_stack to yes or no based on pre-existing flags
2861 if compile_prog
"-Werror" ""; then
2865 if test "$coroutine" != "ucontext"; then
2866 error_exit
"SafeStack is only supported by the coroutine backend ucontext"
2872 ########################################
2873 # check if cpuid.h is usable.
2878 unsigned a, b, c, d;
2879 int max = __get_cpuid_max(0, 0);
2882 __cpuid(1, a, b, c, d);
2886 __cpuid_count(7, 0, a, b, c, d);
2892 if compile_prog
"" "" ; then
2896 ##########################################
2897 # avx2 optimization requirement check
2899 # There is no point enabling this if cpuid.h is not usable,
2900 # since we won't be able to select the new routines.
2902 if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
2904 #pragma GCC push_options
2905 #pragma GCC target("avx2")
2907 #include <immintrin.h>
2908 static int bar(void *a) {
2909 __m256i x = *(__m256i *)a;
2910 return _mm256_testz_si256(x, x);
2912 int main(int argc, char *argv[]) { return bar(argv[0]); }
2914 if compile_object
"-Werror" ; then
2921 ##########################################
2922 # avx512f optimization requirement check
2924 # There is no point enabling this if cpuid.h is not usable,
2925 # since we won't be able to select the new routines.
2926 # by default, it is turned off.
2927 # if user explicitly want to enable it, check environment
2929 if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then
2931 #pragma GCC push_options
2932 #pragma GCC target("avx512f")
2934 #include <immintrin.h>
2935 static int bar(void *a) {
2936 __m512i x = *(__m512i *)a;
2937 return _mm512_test_epi64_mask(x, x);
2939 int main(int argc, char *argv[])
2941 return bar(argv[0]);
2944 if ! compile_object
"-Werror" ; then
2951 ########################################
2952 # check if __[u]int128_t is usable.
2965 if compile_prog
"" "" ; then
2969 #########################################
2970 # See if 128-bit atomic operations are supported.
2973 if test "$int128" = "yes"; then
2977 unsigned __int128 x = 0, y = 0;
2978 y = __atomic_load(&x, 0);
2979 __atomic_store(&x, y, 0);
2980 __atomic_compare_exchange(&x, &y, x, 0, 0, 0);
2984 if compile_prog
"" "" ; then
2990 if test "$int128" = yes && test "$atomic128" = no
; then
2994 unsigned __int128 x = 0, y = 0;
2995 __sync_val_compare_and_swap_16(&x, y, x);
2999 if compile_prog
"" "" ; then
3004 ########################################
3005 # check if ccache is interfering with
3006 # semantic analysis of macros
3011 static const int Z = 1;
3012 #define fn() ({ Z; })
3013 #define TAUT(X) ((X) == Z)
3014 #define PAREN(X, Y) (X == Y)
3016 int main(int argc, char *argv[])
3022 if (PAREN(x, y)) return 0;
3023 if (TAUT(Z)) return 0;
3028 if ! compile_object
"-Werror"; then
3032 #################################################
3033 # clang does not support glibc + FORTIFY_SOURCE.
3035 if test "$fortify_source" != "no"; then
3036 if echo |
$cc -dM -E - |
grep __clang__
> /dev
/null
2>&1 ; then
3037 fortify_source
="no";
3038 elif test -n "$cxx" && has
$cxx &&
3039 echo |
$cxx -dM -E - |
grep __clang__
>/dev
/null
2>&1 ; then
3040 fortify_source
="no";
3042 fortify_source
="yes"
3046 ##########################################
3047 # check for usable membarrier system call
3048 if test "$membarrier" = "yes"; then
3050 if test "$mingw32" = "yes" ; then
3052 elif test "$linux" = "yes" ; then
3054 #include <linux/membarrier.h>
3055 #include <sys/syscall.h>
3059 syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0);
3060 syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0);
3064 if compile_prog
"" "" ; then
3068 if test "$have_membarrier" = "no"; then
3069 feature_not_found
"membarrier" "membarrier system call not available"
3072 # Do not enable it by default even for Mingw32, because it doesn't
3077 ##########################################
3078 # check for usable AF_ALG environment
3082 #include <sys/types.h>
3083 #include <sys/socket.h>
3084 #include <linux/if_alg.h>
3087 sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
3091 if compile_prog
"" "" ; then
3094 if test "$crypto_afalg" = "yes"
3096 if test "$have_afalg" != "yes"
3098 error_exit
"AF_ALG requested but could not be detected"
3103 ##########################################
3104 # checks for sanitizers
3108 have_asan_iface_h
=no
3109 have_asan_iface_fiber
=no
3111 if test "$sanitizers" = "yes" ; then
3113 if compile_prog
"$CPU_CFLAGS -Werror -fsanitize=address" ""; then
3117 # we could use a simple skeleton for flags checks, but this also
3118 # detect the static linking issue of ubsan, see also:
3119 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285
3123 void *tmp = malloc(10);
3125 return *(int *)(tmp + 2);
3130 if compile_prog
"$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then
3134 if check_include
"sanitizer/asan_interface.h" ; then
3135 have_asan_iface_h
=yes
3139 #include <sanitizer/asan_interface.h>
3141 __sanitizer_start_switch_fiber(0, 0, 0);
3145 if compile_prog
"$CPU_CFLAGS -Werror -fsanitize=address" "" ; then
3146 have_asan_iface_fiber
=yes
3150 # Thread sanitizer is, for now, much noisier than the other sanitizers;
3151 # keep it separate until that is not the case.
3152 if test "$tsan" = "yes" && test "$sanitizers" = "yes"; then
3153 error_exit
"TSAN is not supported with other sanitiziers."
3156 have_tsan_iface_fiber
=no
3157 if test "$tsan" = "yes" ; then
3159 if compile_prog
"$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then
3163 #include <sanitizer/tsan_interface.h>
3165 __tsan_create_fiber(0);
3169 if compile_prog
"$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then
3170 have_tsan_iface_fiber
=yes
3174 ##########################################
3178 auto | enabled | internal
)
3179 # Simpler to always update submodule, even if not needed.
3180 git_submodules
="${git_submodules} slirp"
3184 # Check for slirp smbd dupport
3185 : ${smbd=${SMBD-/usr/sbin/smbd}}
3186 if test "$slirp_smbd" != "no" ; then
3187 if test "$mingw32" = "yes" ; then
3188 if test "$slirp_smbd" = "yes" ; then
3189 error_exit
"Host smbd not supported on this platform."
3197 ##########################################
3198 # check for usable __NR_keyctl syscall
3200 if test "$linux" = "yes" ; then
3205 #include <asm/unistd.h>
3206 #include <linux/keyctl.h>
3209 return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0);
3212 if compile_prog
"" "" ; then
3216 if test "$secret_keyring" != "no"
3218 if test "$have_keyring" = "yes"
3222 if test "$secret_keyring" = "yes"
3224 error_exit
"syscall __NR_keyctl requested, \
3225 but not implemented on your system"
3232 ##########################################
3234 # After here, no more $cc or $ld runs
3238 if test "$gcov" = "yes" ; then
3240 elif test "$fortify_source" = "yes" ; then
3241 QEMU_CFLAGS
="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
3247 # Ensure there's only a single GP
3248 QEMU_CFLAGS
="-msmall-data $QEMU_CFLAGS"
3252 if test "$gprof" = "yes" ; then
3253 QEMU_CFLAGS
="-p $QEMU_CFLAGS"
3254 QEMU_LDFLAGS
="-p $QEMU_LDFLAGS"
3257 if test "$have_asan" = "yes"; then
3258 QEMU_CFLAGS
="-fsanitize=address $QEMU_CFLAGS"
3259 QEMU_LDFLAGS
="-fsanitize=address $QEMU_LDFLAGS"
3260 if test "$have_asan_iface_h" = "no" ; then
3261 echo "ASAN build enabled, but ASAN header missing." \
3262 "Without code annotation, the report may be inferior."
3263 elif test "$have_asan_iface_fiber" = "no" ; then
3264 echo "ASAN build enabled, but ASAN header is too old." \
3265 "Without code annotation, the report may be inferior."
3268 if test "$have_tsan" = "yes" ; then
3269 if test "$have_tsan_iface_fiber" = "yes" ; then
3270 QEMU_CFLAGS
="-fsanitize=thread $QEMU_CFLAGS"
3271 QEMU_LDFLAGS
="-fsanitize=thread $QEMU_LDFLAGS"
3273 error_exit
"Cannot enable TSAN due to missing fiber annotation interface."
3275 elif test "$tsan" = "yes" ; then
3276 error_exit
"Cannot enable TSAN due to missing sanitize thread interface."
3278 if test "$have_ubsan" = "yes"; then
3279 QEMU_CFLAGS
="-fsanitize=undefined $QEMU_CFLAGS"
3280 QEMU_LDFLAGS
="-fsanitize=undefined $QEMU_LDFLAGS"
3283 ##########################################
3285 # Exclude --warn-common with TSan to suppress warnings from the TSan libraries.
3286 if test "$solaris" = "no" && test "$tsan" = "no"; then
3287 if $ld --version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
3288 QEMU_LDFLAGS
="-Wl,--warn-common $QEMU_LDFLAGS"
3292 # Use ASLR, no-SEH and DEP if available
3293 if test "$mingw32" = "yes" ; then
3294 flags
="--no-seh --nxcompat"
3296 # Disable ASLR for debug builds to allow debugging with gdb
3297 if test "$debug" = "no" ; then
3298 flags
="--dynamicbase $flags"
3301 for flag
in $flags; do
3302 if ld_has
$flag ; then
3303 QEMU_LDFLAGS
="-Wl,$flag $QEMU_LDFLAGS"
3308 # Probe for guest agent support/options
3310 if [ "$guest_agent" != "no" ]; then
3311 if [ "$softmmu" = no
-a "$want_tools" = no
] ; then
3313 elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
3315 elif [ "$guest_agent" != yes ]; then
3318 error_exit
"Guest agent is not supported on this platform"
3322 # Guest agent Windows MSI package
3324 if test "$QEMU_GA_MANUFACTURER" = ""; then
3325 QEMU_GA_MANUFACTURER
=QEMU
3327 if test "$QEMU_GA_DISTRO" = ""; then
3328 QEMU_GA_DISTRO
=Linux
3330 if test "$QEMU_GA_VERSION" = ""; then
3331 QEMU_GA_VERSION
=$
(cat $source_path/VERSION
)
3334 QEMU_GA_MSI_MINGW_DLL_PATH
="$($pkg_config --variable=prefix glib-2.0)/bin"
3336 # Mac OS X ships with a broken assembler
3338 if { test "$cpu" = "i386" ||
test "$cpu" = "x86_64"; } && \
3339 test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \
3340 test "$targetos" != "Haiku" && test "$softmmu" = yes ; then
3341 # Different host OS linkers have different ideas about the name of the ELF
3342 # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd
3343 # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe.
3344 for emu
in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe
; do
3345 if "$ld" -verbose 2>&1 |
grep -q "^[[:space:]]*$emu[[:space:]]*$"; then
3346 ld_i386_emulation
="$emu"
3353 # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
3354 # or -march=z10 (which is the lowest architecture level that Clang supports)
3355 if test "$cpu" = "s390x" ; then
3357 compile_prog
"-march=z900" ""
3359 if [ $has_z900 = 0 ] || compile_object
"-march=z10 -msoft-float -Werror"; then
3360 if [ $has_z900 != 0 ]; then
3361 echo "WARNING: Your compiler does not support the z900!"
3362 echo " The s390-ccw bios will only work with guest CPUs >= z10."
3364 roms
="$roms s390-ccw"
3365 # SLOF is required for building the s390-ccw firmware on s390x,
3366 # since it is using the libnet code from SLOF for network booting.
3367 git_submodules
="${git_submodules} roms/SLOF"
3371 # Check that the C++ compiler exists and works with the C compiler.
3372 # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added.
3375 int c_function(void);
3376 int main(void) { return c_function(); }
3383 int c_function(void);
3385 int c_function(void) { return 42; }
3390 if do_cxx
$CXXFLAGS $EXTRA_CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then
3391 # C++ compiler $cxx works ok with C compiler $cc
3394 echo "C++ compiler $cxx does not work with C compiler $cc"
3395 echo "Disabling C++ specific optional code"
3399 echo "No C++ compiler available; disabling C++ specific optional code"
3403 if !(GIT
="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then
3407 config_host_mak
="config-host.mak"
3409 echo "# Automatically generated by configure - do not modify" > $config_host_mak
3410 echo >> $config_host_mak
3412 echo all
: >> $config_host_mak
3413 echo "GIT=$git" >> $config_host_mak
3414 echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
3415 echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
3417 echo "ARCH=$ARCH" >> $config_host_mak
3419 if test "$debug_tcg" = "yes" ; then
3420 echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
3422 if test "$strip_opt" = "yes" ; then
3423 echo "STRIP=${strip}" >> $config_host_mak
3425 if test "$mingw32" = "yes" ; then
3426 echo "CONFIG_WIN32=y" >> $config_host_mak
3427 if test "$guest_agent_with_vss" = "yes" ; then
3428 echo "CONFIG_QGA_VSS=y" >> $config_host_mak
3429 echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak
3430 echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak
3432 if test "$guest_agent_ntddscsi" = "yes" ; then
3433 echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak
3435 echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak
3436 echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak
3437 echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak
3438 echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak
3440 echo "CONFIG_POSIX=y" >> $config_host_mak
3443 if test "$linux" = "yes" ; then
3444 echo "CONFIG_LINUX=y" >> $config_host_mak
3447 if test "$darwin" = "yes" ; then
3448 echo "CONFIG_DARWIN=y" >> $config_host_mak
3451 if test "$solaris" = "yes" ; then
3452 echo "CONFIG_SOLARIS=y" >> $config_host_mak
3454 if test "$haiku" = "yes" ; then
3455 echo "CONFIG_HAIKU=y" >> $config_host_mak
3457 if test "$static" = "yes" ; then
3458 echo "CONFIG_STATIC=y" >> $config_host_mak
3460 if test "$profiler" = "yes" ; then
3461 echo "CONFIG_PROFILER=y" >> $config_host_mak
3463 if test "$want_tools" = "yes" ; then
3464 echo "CONFIG_TOOLS=y" >> $config_host_mak
3466 if test "$guest_agent" = "yes" ; then
3467 echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak
3469 if test "$slirp_smbd" = "yes" ; then
3470 echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak
3471 echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
3473 if test "$gprof" = "yes" ; then
3474 echo "CONFIG_GPROF=y" >> $config_host_mak
3476 echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak
3477 echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak
3478 if test "$block_drv_whitelist_tools" = "yes" ; then
3479 echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak
3481 if test "$xfs" = "yes" ; then
3482 echo "CONFIG_XFS=y" >> $config_host_mak
3484 qemu_version
=$
(head $source_path/VERSION
)
3485 echo "PKGVERSION=$pkgversion" >>$config_host_mak
3486 echo "SRC_PATH=$source_path" >> $config_host_mak
3487 echo "TARGET_DIRS=$target_list" >> $config_host_mak
3488 if test "$modules" = "yes"; then
3489 # $shacmd can generate a hash started with digit, which the compiler doesn't
3490 # like as an symbol. So prefix it with an underscore
3491 echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
3492 echo "CONFIG_MODULES=y" >> $config_host_mak
3494 if test "$module_upgrades" = "yes"; then
3495 echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak
3497 if test "$have_usbfs" = "yes" ; then
3498 echo "CONFIG_USBFS=y" >> $config_host_mak
3500 if test "$gio" = "yes" ; then
3501 echo "CONFIG_GIO=y" >> $config_host_mak
3502 echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
3503 echo "GIO_LIBS=$gio_libs" >> $config_host_mak
3505 if test "$gdbus_codegen" != "" ; then
3506 echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
3508 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak
3510 if test "$xen" = "enabled" ; then
3511 echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
3512 echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
3513 echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak
3514 echo "XEN_LIBS=$xen_libs" >> $config_host_mak
3516 if test "$vhost_scsi" = "yes" ; then
3517 echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
3519 if test "$vhost_net" = "yes" ; then
3520 echo "CONFIG_VHOST_NET=y" >> $config_host_mak
3522 if test "$vhost_net_user" = "yes" ; then
3523 echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
3525 if test "$vhost_net_vdpa" = "yes" ; then
3526 echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak
3528 if test "$vhost_crypto" = "yes" ; then
3529 echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak
3531 if test "$vhost_vsock" = "yes" ; then
3532 echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak
3533 if test "$vhost_user" = "yes" ; then
3534 echo "CONFIG_VHOST_USER_VSOCK=y" >> $config_host_mak
3537 if test "$vhost_kernel" = "yes" ; then
3538 echo "CONFIG_VHOST_KERNEL=y" >> $config_host_mak
3540 if test "$vhost_user" = "yes" ; then
3541 echo "CONFIG_VHOST_USER=y" >> $config_host_mak
3543 if test "$vhost_vdpa" = "yes" ; then
3544 echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak
3546 if test "$vhost_user_fs" = "yes" ; then
3547 echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak
3549 if test "$membarrier" = "yes" ; then
3550 echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
3552 if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then
3553 echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
3556 if test "$opengl" = "yes" ; then
3557 echo "CONFIG_OPENGL=y" >> $config_host_mak
3558 echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak
3559 echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
3562 if test "$avx2_opt" = "yes" ; then
3563 echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
3566 if test "$avx512f_opt" = "yes" ; then
3567 echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak
3570 # XXX: suppress that
3571 if [ "$bsd" = "yes" ] ; then
3572 echo "CONFIG_BSD=y" >> $config_host_mak
3575 if test "$qom_cast_debug" = "yes" ; then
3576 echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
3579 echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak
3580 if test "$coroutine_pool" = "yes" ; then
3581 echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak
3583 echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak
3586 if test "$debug_stack_usage" = "yes" ; then
3587 echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak
3590 if test "$crypto_afalg" = "yes" ; then
3591 echo "CONFIG_AF_ALG=y" >> $config_host_mak
3594 if test "$have_asan_iface_fiber" = "yes" ; then
3595 echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak
3598 if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then
3599 echo "CONFIG_TSAN=y" >> $config_host_mak
3602 if test "$cpuid_h" = "yes" ; then
3603 echo "CONFIG_CPUID_H=y" >> $config_host_mak
3606 if test "$int128" = "yes" ; then
3607 echo "CONFIG_INT128=y" >> $config_host_mak
3610 if test "$atomic128" = "yes" ; then
3611 echo "CONFIG_ATOMIC128=y" >> $config_host_mak
3614 if test "$cmpxchg128" = "yes" ; then
3615 echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
3618 if test "$live_block_migration" = "yes" ; then
3619 echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak
3622 if test "$tpm" = "yes"; then
3623 echo 'CONFIG_TPM=y' >> $config_host_mak
3626 if test "$rdma" = "yes" ; then
3627 echo "CONFIG_RDMA=y" >> $config_host_mak
3628 echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
3631 if test "$pvrdma" = "yes" ; then
3632 echo "CONFIG_PVRDMA=y" >> $config_host_mak
3635 if test "$replication" = "yes" ; then
3636 echo "CONFIG_REPLICATION=y" >> $config_host_mak
3639 if test "$debug_mutex" = "yes" ; then
3640 echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak
3643 if test "$bochs" = "yes" ; then
3644 echo "CONFIG_BOCHS=y" >> $config_host_mak
3646 if test "$cloop" = "yes" ; then
3647 echo "CONFIG_CLOOP=y" >> $config_host_mak
3649 if test "$dmg" = "yes" ; then
3650 echo "CONFIG_DMG=y" >> $config_host_mak
3652 if test "$qcow1" = "yes" ; then
3653 echo "CONFIG_QCOW1=y" >> $config_host_mak
3655 if test "$vdi" = "yes" ; then
3656 echo "CONFIG_VDI=y" >> $config_host_mak
3658 if test "$vvfat" = "yes" ; then
3659 echo "CONFIG_VVFAT=y" >> $config_host_mak
3661 if test "$qed" = "yes" ; then
3662 echo "CONFIG_QED=y" >> $config_host_mak
3664 if test "$parallels" = "yes" ; then
3665 echo "CONFIG_PARALLELS=y" >> $config_host_mak
3668 if test "$plugins" = "yes" ; then
3669 echo "CONFIG_PLUGIN=y" >> $config_host_mak
3670 # Copy the export object list to the build dir
3671 if test "$ld_dynamic_list" = "yes" ; then
3672 echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak
3673 ld_symbols
=qemu-plugins-ld.symbols
3674 cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols
3675 elif test "$ld_exported_symbols_list" = "yes" ; then
3676 echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak
3677 ld64_symbols
=qemu-plugins-ld64.symbols
3678 echo "# Automatically generated by configure - do not modify" > $ld64_symbols
3679 grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" |
sed 's/;//g' | \
3680 sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols
3683 "If \$plugins=yes, either \$ld_dynamic_list or " \
3684 "\$ld_exported_symbols_list should have been set to 'yes'."
3688 if test -n "$gdb_bin"; then
3689 gdb_version
=$
($gdb_bin --version |
head -n 1)
3690 if version_ge
${gdb_version##* } 9.1; then
3691 echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak
3695 if test "$secret_keyring" = "yes" ; then
3696 echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak
3699 echo "ROMS=$roms" >> $config_host_mak
3700 echo "MAKE=$make" >> $config_host_mak
3701 echo "PYTHON=$python" >> $config_host_mak
3702 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
3703 echo "MESON=$meson" >> $config_host_mak
3704 echo "NINJA=$ninja" >> $config_host_mak
3705 echo "CC=$cc" >> $config_host_mak
3706 echo "HOST_CC=$host_cc" >> $config_host_mak
3707 if $iasl -h > /dev
/null
2>&1; then
3708 echo "CONFIG_IASL=$iasl" >> $config_host_mak
3710 echo "AR=$ar" >> $config_host_mak
3711 echo "AS=$as" >> $config_host_mak
3712 echo "CCAS=$ccas" >> $config_host_mak
3713 echo "CPP=$cpp" >> $config_host_mak
3714 echo "OBJCOPY=$objcopy" >> $config_host_mak
3715 echo "LD=$ld" >> $config_host_mak
3716 echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
3717 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
3718 echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
3719 echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
3720 echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
3721 echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak
3722 echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak
3723 echo "EXESUF=$EXESUF" >> $config_host_mak
3724 echo "LIBS_QGA=$libs_qga" >> $config_host_mak
3726 if test "$rng_none" = "yes"; then
3727 echo "CONFIG_RNG_NONE=y" >> $config_host_mak
3730 # use included Linux headers
3731 if test "$linux" = "yes" ; then
3732 mkdir
-p linux-headers
3750 # For most CPUs the kernel architecture name and QEMU CPU name match.
3754 # For non-KVM architectures we will not have asm headers
3755 if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then
3756 symlink
"$source_path/linux-headers/asm-$linux_arch" linux-headers
/asm
3760 for target
in $target_list; do
3761 target_dir
="$target"
3762 target_name
=$
(echo $target | cut
-d '-' -f 1)
3763 mkdir
-p $target_dir
3765 *-user) symlink
"../qemu-$target_name" "$target_dir/qemu-$target_name" ;;
3766 *) symlink
"../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" ;;
3770 echo "CONFIG_QEMU_INTERP_PREFIX=$interp_prefix" |
sed 's/%M/@0@/' >> $config_host_mak
3771 if test "$default_targets" = "yes"; then
3772 echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak
3775 if test "$numa" = "yes"; then
3776 echo "CONFIG_NUMA=y" >> $config_host_mak
3777 echo "NUMA_LIBS=$numa_libs" >> $config_host_mak
3780 if test "$ccache_cpp2" = "yes"; then
3781 echo "export CCACHE_CPP2=y" >> $config_host_mak
3784 if test "$safe_stack" = "yes"; then
3785 echo "CONFIG_SAFESTACK=y" >> $config_host_mak
3788 # If we're using a separate build tree, set it up now.
3789 # DIRS are directories which we simply mkdir in the build tree;
3790 # LINKS are things to symlink back into the source tree
3791 # (these can be both files and directories).
3792 # Caution: do not add files or directories here using wildcards. This
3793 # will result in problems later if a new file matching the wildcard is
3794 # added to the source tree -- nothing will cause configure to be rerun
3795 # so the build tree will be missing the link back to the new file, and
3796 # tests might fail. Prefer to keep the relevant files in their own
3797 # directory and symlink the directory instead.
3798 # UNLINK is used to remove symlinks from older development versions
3799 # that might get into the way when doing "git update" without doing
3800 # a "make distclean" in between.
3801 DIRS
="tests tests/tcg tests/qapi-schema tests/qtest/libqos"
3802 DIRS
="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph"
3803 DIRS
="$DIRS docs docs/interop fsdev scsi"
3804 DIRS
="$DIRS pc-bios/optionrom pc-bios/s390-ccw"
3805 DIRS
="$DIRS roms/seabios"
3806 DIRS
="$DIRS contrib/plugins/"
3808 LINKS
="$LINKS tests/tcg/Makefile.target"
3809 LINKS
="$LINKS pc-bios/optionrom/Makefile"
3810 LINKS
="$LINKS pc-bios/s390-ccw/Makefile"
3811 LINKS
="$LINKS roms/seabios/Makefile"
3812 LINKS
="$LINKS pc-bios/qemu-icon.bmp"
3813 LINKS
="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
3814 LINKS
="$LINKS tests/avocado tests/data"
3815 LINKS
="$LINKS tests/qemu-iotests/check"
3816 LINKS
="$LINKS python"
3817 LINKS
="$LINKS contrib/plugins/Makefile "
3818 UNLINK
="pc-bios/keymaps"
3820 $source_path/pc-bios
/*.bin \
3821 $source_path/pc-bios
/*.elf \
3822 $source_path/pc-bios
/*.lid \
3823 $source_path/pc-bios
/*.rom \
3824 $source_path/pc-bios
/*.dtb \
3825 $source_path/pc-bios
/*.img \
3826 $source_path/pc-bios
/openbios-
* \
3827 $source_path/pc-bios
/u-boot.
* \
3828 $source_path/pc-bios
/edk2-
*.fd.bz2 \
3829 $source_path/pc-bios
/palcode-
* \
3830 $source_path/pc-bios
/qemu_vga.ndrv
3833 LINKS
="$LINKS pc-bios/$(basename $bios_file)"
3836 for f
in $LINKS ; do
3837 if [ -e "$source_path/$f" ]; then
3838 symlink
"$source_path/$f" "$f"
3841 for f
in $UNLINK ; do
3842 if [ -L "$f" ]; then
3847 (for i
in $cross_cc_vars; do
3850 export target_list source_path use_containers ARCH
3851 $source_path/tests
/tcg
/configure.sh
)
3853 # temporary config to build submodules
3854 for rom
in seabios
; do
3855 config_mak
=roms
/$rom/config.mak
3856 echo "# Automatically generated by configure - do not modify" > $config_mak
3857 echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
3858 echo "AS=$as" >> $config_mak
3859 echo "CCAS=$ccas" >> $config_mak
3860 echo "CC=$cc" >> $config_mak
3861 echo "BCC=bcc" >> $config_mak
3862 echo "CPP=$cpp" >> $config_mak
3863 echo "OBJCOPY=objcopy" >> $config_mak
3864 echo "IASL=$iasl" >> $config_mak
3865 echo "LD=$ld" >> $config_mak
3866 echo "RANLIB=$ranlib" >> $config_mak
3869 config_mak
=pc-bios
/optionrom
/config.mak
3870 echo "# Automatically generated by configure - do not modify" > $config_mak
3871 echo "TOPSRC_DIR=$source_path" >> $config_mak
3873 if test "$skip_meson" = no
; then
3874 cross
="config-meson.cross.new"
3876 test $# = 0 && return
3877 echo "'$(echo $* | sed "s
/ /','/g
")'"
3880 echo "# Automatically generated by configure - do not modify" > $cross
3881 echo "[properties]" >> $cross
3883 # unroll any custom device configs
3884 for a
in $device_archs; do
3885 eval "c=\$devices_${a}"
3886 echo "${a}-softmmu = '$c'" >> $cross
3889 test -z "$cxx" && echo "link_language = 'c'" >> $cross
3890 echo "[built-in options]" >> $cross
3891 echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
3892 echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross
3893 echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross
3894 echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross
3895 echo "[binaries]" >> $cross
3896 echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross
3897 test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross
3898 test -n "$objcc" && echo "objc = [$(meson_quote $objcc $CPU_CFLAGS)]" >> $cross
3899 echo "ar = [$(meson_quote $ar)]" >> $cross
3900 echo "nm = [$(meson_quote $nm)]" >> $cross
3901 echo "pkgconfig = [$(meson_quote $pkg_config_exe)]" >> $cross
3902 echo "ranlib = [$(meson_quote $ranlib)]" >> $cross
3903 if has
$sdl2_config; then
3904 echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross
3906 echo "strip = [$(meson_quote $strip)]" >> $cross
3907 echo "windres = [$(meson_quote $windres)]" >> $cross
3908 if test "$cross_compile" = "yes"; then
3909 cross_arg
="--cross-file config-meson.cross"
3910 echo "[host_machine]" >> $cross
3911 if test "$mingw32" = "yes" ; then
3912 echo "system = 'windows'" >> $cross
3914 if test "$linux" = "yes" ; then
3915 echo "system = 'linux'" >> $cross
3917 if test "$darwin" = "yes" ; then
3918 echo "system = 'darwin'" >> $cross
3922 echo "cpu_family = 'x86'" >> $cross
3925 echo "cpu_family = 'x86_64'" >> $cross
3928 echo "cpu_family = 'ppc64'" >> $cross
3931 echo "cpu_family = '$ARCH'" >> $cross
3934 echo "cpu = '$cpu'" >> $cross
3935 if test "$bigendian" = "yes" ; then
3936 echo "endian = 'big'" >> $cross
3938 echo "endian = 'little'" >> $cross
3941 cross_arg
="--native-file config-meson.cross"
3943 mv $cross config-meson.cross
3945 rm -rf meson-private meson-info meson-logs
3947 NINJA
=$ninja $meson setup \
3948 --prefix "$prefix" \
3949 --libdir "$libdir" \
3950 --libexecdir "$libexecdir" \
3951 --bindir "$bindir" \
3952 --includedir "$includedir" \
3953 --datadir "$datadir" \
3954 --mandir "$mandir" \
3955 --sysconfdir "$sysconfdir" \
3956 --localedir "$localedir" \
3957 --localstatedir "$local_statedir" \
3958 -Daudio_drv_list=$audio_drv_list \
3959 -Ddefault_devices=$default_devices \
3960 -Ddocdir="$docdir" \
3961 -Dqemu_firmwarepath="$firmwarepath" \
3962 -Dqemu_suffix="$qemu_suffix" \
3963 -Dsphinx_build="$sphinx_build" \
3964 -Dtrace_file="$trace_file" \
3965 -Doptimization=$
(if test "$debug" = yes; then echo 0; else echo 2; fi) \
3966 -Ddebug=$
(if test "$debug_info" = yes; then echo true
; else echo false
; fi) \
3967 -Dwerror=$
(if test "$werror" = yes; then echo true
; else echo false
; fi) \
3968 -Dstrip=$
(if test "$strip_opt" = yes; then echo true
; else echo false
; fi) \
3969 -Db_pie=$
(if test "$pie" = yes; then echo true
; else echo false
; fi) \
3970 -Db_coverage=$
(if test "$gcov" = yes; then echo true
; else echo false
; fi) \
3971 -Db_lto=$lto -Dcfi=$cfi -Dtcg=$tcg -Dxen=$xen \
3972 -Dcapstone=$capstone -Dfdt=$fdt -Dslirp=$slirp \
3973 $
(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=$LIB_FUZZING_ENGINE") \
3974 $
(if test "$default_feature" = no
; then echo "-Dauto_features=disabled"; fi) \
3975 "$@" $cross_arg "$PWD" "$source_path"
3977 eval run_meson
$meson_options
3978 if test "$?" -ne 0 ; then
3979 error_exit
"meson setup failed"
3982 if test -f meson-private
/cmd_line.txt
; then
3983 # Adjust old command line options whose type was changed
3984 # Avoids having to use "setup --wipe" when Meson is upgraded
3986 s/^gettext = true$/gettext = auto/;
3987 s/^gettext = false$/gettext = disabled/;
3988 /^b_staticpic/ && next;
3989 print;' meson-private
/cmd_line.txt
3993 if test -n "${deprecated_features}"; then
3994 echo "Warning, deprecated features enabled."
3995 echo "Please see docs/about/deprecated.rst"
3996 echo " features: ${deprecated_features}"
3999 # Create list of config switches that should be poisoned in common code...
4000 # but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special.
4001 target_configs_h
=$
(ls *-config-devices.h
*-config-target.h
2>/dev
/null
)
4002 if test -n "$target_configs_h" ; then
4003 sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \
4004 -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \
4005 $target_configs_h |
sort -u > config-poison.h
4010 # Save the configure command line for later reuse.
4011 cat <<EOD >config.status
4013 # Generated by configure.
4014 # Run this file to recreate the current configuration.
4015 # Compiler output produced by configure, useful for debugging
4016 # configure, is in config.log if it exists.
4022 eval envval
=\$
$envname
4024 if test -n "$envval"
4026 echo "$envname='$envval'" >> config.status
4027 echo "export $envname" >> config.status
4029 echo "unset $envname" >> config.status
4033 # Preserve various env variables that influence what
4034 # features/build target configure will detect
4041 preserve_env CXXFLAGS
4042 preserve_env INSTALL
4044 preserve_env LDFLAGS
4045 preserve_env LD_LIBRARY_PATH
4046 preserve_env LIBTOOL
4049 preserve_env OBJCOPY
4051 preserve_env PKG_CONFIG
4052 preserve_env PKG_CONFIG_LIBDIR
4053 preserve_env PKG_CONFIG_PATH
4055 preserve_env SDL2_CONFIG
4058 preserve_env WINDRES
4060 printf "exec" >>config.status
4061 for i
in "$0" "$@"; do
4062 test "$i" = --skip-meson ||
printf " %s" "$(quote_sh "$i")" >>config.status
4064 echo ' "$@"' >>config.status
4065 chmod +x config.status