3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe"
18 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
19 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
20 trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
23 # Print a helpful header at the top of config.log
24 echo "# QEMU configure log $(date)" >> config.log
25 printf "# Configured with:" >> config.log
26 printf " '%s'" "$0" "$@" >> config.log
28 echo "#" >> config.log
31 # Run the compiler, capturing its output to the log.
32 echo $cc "$@" >> config.log
33 $cc "$@" >> config.log
2>&1 ||
return $?
34 # Test passed. If this is an --enable-werror build, rerun
35 # the test with -Werror and bail out if it fails. This
36 # makes warning-generating-errors in configure test code
37 # obvious to developers.
38 if test "$werror" != "yes"; then
41 # Don't bother rerunning the compile if we were already using -Werror
47 echo $cc -Werror "$@" >> config.log
48 $cc -Werror "$@" >> config.log
2>&1 && return $?
49 echo "ERROR: configure test passed without -Werror but failed with -Werror."
50 echo "This is probably a bug in the configure script. The failing command"
51 echo "will be at the bottom of config.log."
52 echo "You can run configure with --disable-werror to bypass this check."
57 do_cc
$QEMU_CFLAGS -c -o $TMPO $TMPC
63 do_cc
$QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
66 # symbolically link $1 to $2. Portable version of "ln -sf".
69 mkdir
-p "$(dirname "$2")"
73 # check whether a command is available to this shell (may be either an
74 # executable or a builtin)
76 type "$1" >/dev
/null
2>&1
79 # search for an executable in PATH
85 # pathname has a dir component?
86 if [ "${local_command#*/}" != "$local_command" ]; then
87 if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then
92 if [ -z "$local_command" ]; then
97 for local_dir
in $PATH; do
98 if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then
99 echo "$local_dir/$local_command"
100 IFS
="${local_ifs:-$(printf ' \t\n')}"
105 IFS
="${local_ifs:-$(printf ' \t\n')}"
110 source_path
=`dirname "$0"`
112 interp_prefix
="/usr/gnemul/qemu-%M"
117 audio_card_list
="ac97 es1370 sb16 hda"
118 audio_possible_cards
="ac97 es1370 sb16 cs4231a adlib gus hda"
119 block_drv_whitelist
=""
126 cc_i386
=i386-pc-linux-gnu-gcc
132 # Default value for a variable defining feature "foo".
133 # * foo="no" feature will only be used if --enable-foo arg is given
134 # * foo="" feature will be searched for, and if found, will be used
135 # unless --disable-foo is given
136 # * foo="yes" this value will only be set by --enable-foo flag.
137 # feature will searched for,
138 # if not found, configure exits with error
140 # Always add --enable-foo and --disable-foo command line args.
141 # Distributions want to ensure that several features are compiled in, and it
142 # is impossible without a --enable-foo that exits if a feature is not found.
163 xen_pci_passthrough
=""
182 mandir
="\${prefix}/share/man"
183 datadir
="\${prefix}/share"
184 qemu_docdir
="\${prefix}/share/doc/qemu"
185 bindir
="\${prefix}/bin"
186 libdir
="\${prefix}/lib"
187 includedir
="\${prefix}/include"
188 sysconfdir
="\${prefix}/etc"
223 # parse CC options first
225 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
227 --cross-prefix=*) cross_prefix
="$optarg"
231 --source-path=*) source_path
="$optarg"
233 --cpu=*) cpu
="$optarg"
235 --extra-cflags=*) QEMU_CFLAGS
="$optarg $QEMU_CFLAGS"
237 --extra-ldflags=*) LDFLAGS
="$optarg $LDFLAGS"
239 --enable-debug-info) debug_info
="yes"
241 --disable-debug-info) debug_info
="no"
246 v7|v8|v8plus|v8plusa
)
253 echo "undefined SPARC architecture. Exiting";
261 # Using uname is really, really broken. Once we have the right set of checks
262 # we can eliminate its usage altogether.
264 cc
="${CC-${cross_prefix}gcc}"
265 ar="${AR-${cross_prefix}ar}"
266 objcopy
="${OBJCOPY-${cross_prefix}objcopy}"
267 ld
="${LD-${cross_prefix}ld}"
268 libtool
="${LIBTOOL-${cross_prefix}libtool}"
269 strip
="${STRIP-${cross_prefix}strip}"
270 windres
="${WINDRES-${cross_prefix}windres}"
271 pkg_config_exe
="${PKG_CONFIG-${cross_prefix}pkg-config}"
273 "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
275 pkg_config
=query_pkg_config
276 sdl_config
="${SDL_CONFIG-${cross_prefix}sdl-config}"
278 # default flags for all hosts
279 QEMU_CFLAGS
="-fno-strict-aliasing $QEMU_CFLAGS"
280 QEMU_CFLAGS
="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
281 QEMU_CFLAGS
="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
282 QEMU_CFLAGS
="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
283 QEMU_INCLUDES
="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
284 if test "$debug_info" = "yes"; then
286 LDFLAGS
="-g $LDFLAGS"
289 # make source path absolute
290 source_path
=`cd "$source_path"; pwd`
295 #error $1 not defined
297 int main(void) { return 0; }
302 if test ! -z "$cpu" ; then
303 # command line argument
305 elif check_define __i386__
; then
307 elif check_define __x86_64__
; then
309 elif check_define __sparc__
; then
310 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
311 # They must be specified using --sparc_cpu
312 if check_define __arch64__
; then
317 elif check_define _ARCH_PPC
; then
318 if check_define _ARCH_PPC64
; then
323 elif check_define __mips__
; then
325 elif check_define __ia64__
; then
327 elif check_define __s390__
; then
328 if check_define __s390x__
; then
333 elif check_define __arm__
; then
335 elif check_define __hppa__
; then
342 # Normalise host CPU name and set ARCH.
343 # Note that this case should only have supported host CPUs, not guests.
345 ia64|ppc|ppc64|s390|s390x|sparc64
)
348 i386|i486|i586|i686|i86pc|BePC
)
357 hppa|parisc|parisc64
)
367 # This will result in either an error or falling back to TCI later
371 if test -z "$ARCH"; then
376 if check_define __linux__
; then
378 elif check_define _WIN32
; then
380 elif check_define __OpenBSD__
; then
382 elif check_define __sun__
; then
384 elif check_define __HAIKU__
; then
393 QEMU_CFLAGS
="-mno-cygwin $QEMU_CFLAGS"
394 audio_possible_drivers
="winwave sdl"
395 audio_drv_list
="winwave"
399 audio_possible_drivers
="winwave dsound sdl fmod"
400 audio_drv_list
="winwave"
405 audio_possible_drivers
="oss sdl esd pa"
411 audio_possible_drivers
="oss sdl esd pa"
412 # needed for kinfo_getvmmap(3) in libutil.h
419 audio_possible_drivers
="oss sdl esd pa"
425 audio_possible_drivers
="oss sdl esd"
432 audio_possible_drivers
="oss sdl esd"
438 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can
439 # run 64-bit userspace code
440 if [ "$cpu" = "i386" ] ; then
441 is_x86_64
=`sysctl -n hw.optional.x86_64`
442 [ "$is_x86_64" = "1" ] && cpu
=x86_64
444 if [ "$cpu" = "x86_64" ] ; then
445 QEMU_CFLAGS
="-arch x86_64 $QEMU_CFLAGS"
446 LDFLAGS
="-arch x86_64 $LDFLAGS"
448 QEMU_CFLAGS
="-mdynamic-no-pic $QEMU_CFLAGS"
451 audio_drv_list
="coreaudio"
452 audio_possible_drivers
="coreaudio sdl fmod"
453 LDFLAGS
="-framework CoreFoundation -framework IOKit $LDFLAGS"
454 libs_softmmu
="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
459 install="${INSTALL-ginstall}"
461 smbd
="${SMBD-/usr/sfw/sbin/smbd}"
462 needs_libsunmath
="no"
463 solarisrev
=`uname -r | cut -f2 -d.`
464 # have to select again, because `uname -m` returns i86pc
465 # even on an x86_64 box.
466 solariscpu
=`isainfo -k`
467 if test "${solariscpu}" = "amd64" ; then
470 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
471 if test "$solarisrev" -le 9 ; then
472 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
473 needs_libsunmath
="yes"
474 QEMU_CFLAGS
="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS"
475 LDFLAGS
="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
476 LIBS
="-lsunmath $LIBS"
478 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
479 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
480 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
481 echo "Studio 11 can be downloaded from www.sun.com."
486 if test -f /usr
/include
/sys
/soundcard.h
; then
489 audio_possible_drivers
="oss sdl"
490 # needed for CMSG_ macros in sys/socket.h
491 QEMU_CFLAGS
="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
492 # needed for TIOCWIN* defines in termios.h
493 QEMU_CFLAGS
="-D__EXTENSIONS__ $QEMU_CFLAGS"
494 QEMU_CFLAGS
="-std=gnu99 $QEMU_CFLAGS"
495 solarisnetlibs
="-lsocket -lnsl -lresolv"
496 LIBS
="$solarisnetlibs $LIBS"
497 libs_qga
="$solarisnetlibs $libs_qga"
505 QEMU_CFLAGS
="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
506 LIBS
="-lposix_error_mapper -lnetwork $LIBS"
510 audio_possible_drivers
="oss alsa sdl esd pa"
516 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
517 audio_possible_drivers
="$audio_possible_drivers fmod"
522 if [ "$bsd" = "yes" ] ; then
523 if [ "$darwin" != "yes" ] ; then
529 : ${make=${MAKE-make}}
530 : ${install=${INSTALL-install}}
531 : ${python=${PYTHON-python}}
532 : ${smbd=${SMBD-/usr/sbin/smbd}}
534 if test "$mingw32" = "yes" ; then
536 QEMU_CFLAGS
="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
537 # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
538 QEMU_CFLAGS
="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
539 LIBS
="-lwinmm -lws2_32 -liphlpapi $LIBS"
541 int main(void) { return 0; }
543 if compile_prog
"" "-liberty" ; then
544 LIBS
="-liberty $LIBS"
546 prefix
="c:/Program Files/QEMU"
549 qemu_docdir
="\${prefix}"
551 sysconfdir
="\${prefix}"
553 libs_qga
="-lws2_32 -lwinmm -lpowrprof $libs_qga"
559 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
561 --help|
-h) show_help
=yes
563 --version|
-V) exec cat $source_path/VERSION
565 --prefix=*) prefix
="$optarg"
567 --interp-prefix=*) interp_prefix
="$optarg"
575 --host-cc=*) host_cc
="$optarg"
577 --make=*) make="$optarg"
579 --install=*) install="$optarg"
581 --python=*) python
="$optarg"
583 --smbd=*) smbd
="$optarg"
591 --disable-debug-info)
595 --target-list=*) target_list
="$optarg"
597 --enable-trace-backend=*) trace_backend
="$optarg"
599 --with-trace-file=*) trace_file
="$optarg"
601 --enable-gprof) gprof
="yes"
605 LDFLAGS
="-static $LDFLAGS"
606 QEMU_PKG_CONFIG_FLAGS
="--static $QEMU_PKG_CONFIG_FLAGS"
608 --mandir=*) mandir
="$optarg"
610 --bindir=*) bindir
="$optarg"
612 --libdir=*) libdir
="$optarg"
614 --includedir=*) includedir
="$optarg"
616 --datadir=*) datadir
="$optarg"
618 --with-confsuffix=*) confsuffix
="$optarg"
620 --docdir=*) qemu_docdir
="$optarg"
622 --sysconfdir=*) sysconfdir
="$optarg"
624 --sbindir=*|
--libexecdir=*|
--sharedstatedir=*|
--localstatedir=*|\
625 --oldincludedir=*|
--datarootdir=*|
--infodir=*|
--localedir=*|\
626 --htmldir=*|
--dvidir=*|
--pdfdir=*|
--psdir=*)
627 # These switches are silently ignored, for compatibility with
628 # autoconf-generated configure scripts. This allows QEMU's
629 # configure to be used by RPM and similar macros that set
630 # lots of directory switches by default.
632 --disable-sdl) sdl
="no"
634 --enable-sdl) sdl
="yes"
636 --disable-virtfs) virtfs
="no"
638 --enable-virtfs) virtfs
="yes"
640 --disable-vnc) vnc
="no"
642 --enable-vnc) vnc
="yes"
644 --fmod-lib=*) fmod_lib
="$optarg"
646 --fmod-inc=*) fmod_inc
="$optarg"
648 --oss-lib=*) oss_lib
="$optarg"
650 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
652 --audio-drv-list=*) audio_drv_list
="$optarg"
654 --block-drv-whitelist=*) block_drv_whitelist
=`echo "$optarg" | sed -e 's/,/ /g'`
656 --enable-debug-tcg) debug_tcg
="yes"
658 --disable-debug-tcg) debug_tcg
="no"
660 --enable-debug-mon) debug_mon
="yes"
662 --disable-debug-mon) debug_mon
="no"
665 # Enable debugging options that aren't excessively noisy
671 --enable-sparse) sparse
="yes"
673 --disable-sparse) sparse
="no"
675 --disable-strip) strip_opt
="no"
677 --disable-vnc-tls) vnc_tls
="no"
679 --enable-vnc-tls) vnc_tls
="yes"
681 --disable-vnc-sasl) vnc_sasl
="no"
683 --enable-vnc-sasl) vnc_sasl
="yes"
685 --disable-vnc-jpeg) vnc_jpeg
="no"
687 --enable-vnc-jpeg) vnc_jpeg
="yes"
689 --disable-vnc-png) vnc_png
="no"
691 --enable-vnc-png) vnc_png
="yes"
693 --disable-slirp) slirp
="no"
695 --disable-uuid) uuid
="no"
697 --enable-uuid) uuid
="yes"
699 --disable-vde) vde
="no"
701 --enable-vde) vde
="yes"
703 --disable-xen) xen
="no"
705 --enable-xen) xen
="yes"
707 --disable-xen-pci-passthrough) xen_pci_passthrough
="no"
709 --enable-xen-pci-passthrough) xen_pci_passthrough
="yes"
711 --disable-brlapi) brlapi
="no"
713 --enable-brlapi) brlapi
="yes"
715 --disable-bluez) bluez
="no"
717 --enable-bluez) bluez
="yes"
719 --disable-kvm) kvm
="no"
721 --enable-kvm) kvm
="yes"
723 --disable-tcg-interpreter) tcg_interpreter
="no"
725 --enable-tcg-interpreter) tcg_interpreter
="yes"
727 --disable-cap-ng) cap_ng
="no"
729 --enable-cap-ng) cap_ng
="yes"
731 --disable-spice) spice
="no"
733 --enable-spice) spice
="yes"
735 --disable-libiscsi) libiscsi
="no"
737 --enable-libiscsi) libiscsi
="yes"
739 --enable-profiler) profiler
="yes"
741 --disable-cocoa) cocoa
="no"
746 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
748 --disable-system) softmmu
="no"
750 --enable-system) softmmu
="yes"
757 --disable-linux-user) linux_user
="no"
759 --enable-linux-user) linux_user
="yes"
761 --disable-bsd-user) bsd_user
="no"
763 --enable-bsd-user) bsd_user
="yes"
765 --enable-guest-base) guest_base
="yes"
767 --disable-guest-base) guest_base
="no"
769 --enable-pie) pie
="yes"
771 --disable-pie) pie
="no"
773 --enable-uname-release=*) uname_release
="$optarg"
777 --enable-werror) werror
="yes"
779 --disable-werror) werror
="no"
781 --disable-curses) curses
="no"
783 --enable-curses) curses
="yes"
785 --disable-curl) curl
="no"
787 --enable-curl) curl
="yes"
789 --disable-fdt) fdt
="no"
791 --enable-fdt) fdt
="yes"
793 --disable-nptl) nptl
="no"
795 --enable-nptl) nptl
="yes"
797 --enable-mixemu) mixemu
="yes"
799 --disable-linux-aio) linux_aio
="no"
801 --enable-linux-aio) linux_aio
="yes"
803 --disable-attr) attr
="no"
805 --enable-attr) attr
="yes"
807 --disable-blobs) blobs
="no"
809 --with-pkgversion=*) pkgversion
=" ($optarg)"
811 --with-coroutine=*) coroutine
="$optarg"
813 --disable-docs) docs
="no"
815 --enable-docs) docs
="yes"
817 --disable-vhost-net) vhost_net
="no"
819 --enable-vhost-net) vhost_net
="yes"
821 --disable-opengl) opengl
="no"
823 --enable-opengl) opengl
="yes"
825 --disable-rbd) rbd
="no"
827 --enable-rbd) rbd
="yes"
829 --disable-xfsctl) xfs
="no"
831 --enable-xfsctl) xfs
="yes"
833 --disable-smartcard) smartcard
="no"
835 --enable-smartcard) smartcard
="yes"
837 --disable-smartcard-nss) smartcard_nss
="no"
839 --enable-smartcard-nss) smartcard_nss
="yes"
841 --disable-usb-redir) usb_redir
="no"
843 --enable-usb-redir) usb_redir
="yes"
845 --disable-zlib-test) zlib
="no"
847 --enable-guest-agent) guest_agent
="yes"
849 --disable-guest-agent) guest_agent
="no"
851 *) echo "ERROR: unknown option $opt"; show_help
="yes"
857 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
858 # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
862 sparc
) case $sparc_cpu in
864 QEMU_CFLAGS
="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
867 QEMU_CFLAGS
="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
869 *) # sparc_cpu not defined in the command line
870 QEMU_CFLAGS
="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
872 LDFLAGS
="-m32 $LDFLAGS"
873 QEMU_CFLAGS
="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
874 if test "$solaris" = "no" ; then
875 QEMU_CFLAGS
="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
876 helper_cflags
="-ffixed-i0"
880 QEMU_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
881 LDFLAGS
="-m64 $LDFLAGS"
882 QEMU_CFLAGS
="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
883 if test "$solaris" != "no" ; then
884 QEMU_CFLAGS
="-ffixed-g1 $QEMU_CFLAGS"
888 QEMU_CFLAGS
="-m31 -march=z990 $QEMU_CFLAGS"
889 LDFLAGS
="-m31 $LDFLAGS"
890 host_guest_base
="yes"
893 QEMU_CFLAGS
="-m64 -march=z990 $QEMU_CFLAGS"
894 LDFLAGS
="-m64 $LDFLAGS"
895 host_guest_base
="yes"
898 QEMU_CFLAGS
="-m32 $QEMU_CFLAGS"
899 LDFLAGS
="-m32 $LDFLAGS"
901 helper_cflags
="-fomit-frame-pointer"
902 host_guest_base
="yes"
905 QEMU_CFLAGS
="-m64 $QEMU_CFLAGS"
906 LDFLAGS
="-m64 $LDFLAGS"
908 host_guest_base
="yes"
911 host_guest_base
="yes"
914 host_guest_base
="yes"
917 host_guest_base
="yes"
920 host_guest_base
="yes"
923 host_guest_base
="yes"
926 host_guest_base
="yes"
930 [ -z "$guest_base" ] && guest_base
="$host_guest_base"
933 default_target_list
=""
935 # these targets are portable
936 if [ "$softmmu" = "yes" ] ; then
937 default_target_list
="\
946 microblazeel-softmmu \
965 # the following are Linux specific
966 if [ "$linux_user" = "yes" ] ; then
967 default_target_list
="${default_target_list}\
975 microblaze-linux-user \
976 microblazeel-linux-user \
982 ppc64abi32-linux-user \
987 sparc32plus-linux-user \
988 unicore32-linux-user \
992 # the following are BSD specific
993 if [ "$bsd_user" = "yes" ] ; then
994 default_target_list
="${default_target_list}\
1002 if test x
"$show_help" = x
"yes" ; then
1005 Usage: configure [options]
1006 Options: [defaults in brackets after descriptions]
1009 echo "Standard options:"
1010 echo " --help print this message"
1011 echo " --prefix=PREFIX install in PREFIX [$prefix]"
1012 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
1013 echo " use %M for cpu name [$interp_prefix]"
1014 echo " --target-list=LIST set target list (default: build everything)"
1015 echo "Available targets: $default_target_list" | \
1016 fold -s -w 53 |
sed -e 's/^/ /'
1018 echo "Advanced options (experts only):"
1019 echo " --source-path=PATH path of source code [$source_path]"
1020 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
1021 echo " --cc=CC use C compiler CC [$cc]"
1022 echo " --host-cc=CC use C compiler CC [$host_cc] for code run at"
1024 echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS"
1025 echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS"
1026 echo " --make=MAKE use specified make [$make]"
1027 echo " --install=INSTALL use specified install [$install]"
1028 echo " --python=PYTHON use specified python [$python]"
1029 echo " --smbd=SMBD use specified smbd [$smbd]"
1030 echo " --static enable static build [$static]"
1031 echo " --mandir=PATH install man pages in PATH"
1032 echo " --datadir=PATH install firmware in PATH$confsuffix"
1033 echo " --docdir=PATH install documentation in PATH$confsuffix"
1034 echo " --bindir=PATH install binaries in PATH"
1035 echo " --sysconfdir=PATH install config in PATH$confsuffix"
1036 echo " --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]"
1037 echo " --enable-debug-tcg enable TCG debugging"
1038 echo " --disable-debug-tcg disable TCG debugging (default)"
1039 echo " --enable-debug enable common debug build options"
1040 echo " --enable-sparse enable sparse checker"
1041 echo " --disable-sparse disable sparse checker (default)"
1042 echo " --disable-strip disable stripping binaries"
1043 echo " --disable-werror disable compilation abort on warning"
1044 echo " --disable-sdl disable SDL"
1045 echo " --enable-sdl enable SDL"
1046 echo " --disable-virtfs disable VirtFS"
1047 echo " --enable-virtfs enable VirtFS"
1048 echo " --disable-vnc disable VNC"
1049 echo " --enable-vnc enable VNC"
1050 echo " --disable-cocoa disable Cocoa (Mac OS X only)"
1051 echo " --enable-cocoa enable Cocoa (default on Mac OS X)"
1052 echo " --audio-drv-list=LIST set audio drivers list:"
1053 echo " Available drivers: $audio_possible_drivers"
1054 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
1055 echo " Available cards: $audio_possible_cards"
1056 echo " --block-drv-whitelist=L set block driver whitelist"
1057 echo " (affects only QEMU, not qemu-img)"
1058 echo " --enable-mixemu enable mixer emulation"
1059 echo " --disable-xen disable xen backend driver support"
1060 echo " --enable-xen enable xen backend driver support"
1061 echo " --disable-xen-pci-passthrough"
1062 echo " --enable-xen-pci-passthrough"
1063 echo " --disable-brlapi disable BrlAPI"
1064 echo " --enable-brlapi enable BrlAPI"
1065 echo " --disable-vnc-tls disable TLS encryption for VNC server"
1066 echo " --enable-vnc-tls enable TLS encryption for VNC server"
1067 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
1068 echo " --enable-vnc-sasl enable SASL encryption for VNC server"
1069 echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server"
1070 echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server"
1071 echo " --disable-vnc-png disable PNG compression for VNC server (default)"
1072 echo " --enable-vnc-png enable PNG compression for VNC server"
1073 echo " --disable-curses disable curses output"
1074 echo " --enable-curses enable curses output"
1075 echo " --disable-curl disable curl connectivity"
1076 echo " --enable-curl enable curl connectivity"
1077 echo " --disable-fdt disable fdt device tree"
1078 echo " --enable-fdt enable fdt device tree"
1079 echo " --disable-bluez disable bluez stack connectivity"
1080 echo " --enable-bluez enable bluez stack connectivity"
1081 echo " --disable-slirp disable SLIRP userspace network connectivity"
1082 echo " --disable-kvm disable KVM acceleration support"
1083 echo " --enable-kvm enable KVM acceleration support"
1084 echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
1085 echo " --disable-nptl disable usermode NPTL support"
1086 echo " --enable-nptl enable usermode NPTL support"
1087 echo " --enable-system enable all system emulation targets"
1088 echo " --disable-system disable all system emulation targets"
1089 echo " --enable-user enable supported user emulation targets"
1090 echo " --disable-user disable all user emulation targets"
1091 echo " --enable-linux-user enable all linux usermode emulation targets"
1092 echo " --disable-linux-user disable all linux usermode emulation targets"
1093 echo " --enable-bsd-user enable all BSD usermode emulation targets"
1094 echo " --disable-bsd-user disable all BSD usermode emulation targets"
1095 echo " --enable-guest-base enable GUEST_BASE support for usermode"
1096 echo " emulation targets"
1097 echo " --disable-guest-base disable GUEST_BASE support"
1098 echo " --enable-pie build Position Independent Executables"
1099 echo " --disable-pie do not build Position Independent Executables"
1100 echo " --fmod-lib path to FMOD library"
1101 echo " --fmod-inc path to FMOD includes"
1102 echo " --oss-lib path to OSS library"
1103 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
1104 echo " --cpu=CPU Build for host CPU [$cpu]"
1105 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
1106 echo " --disable-uuid disable uuid support"
1107 echo " --enable-uuid enable uuid support"
1108 echo " --disable-vde disable support for vde network"
1109 echo " --enable-vde enable support for vde network"
1110 echo " --disable-linux-aio disable Linux AIO support"
1111 echo " --enable-linux-aio enable Linux AIO support"
1112 echo " --disable-cap-ng disable libcap-ng support"
1113 echo " --enable-cap-ng enable libcap-ng support"
1114 echo " --disable-attr disables attr and xattr support"
1115 echo " --enable-attr enable attr and xattr support"
1116 echo " --disable-blobs disable installing provided firmware blobs"
1117 echo " --enable-docs enable documentation build"
1118 echo " --disable-docs disable documentation build"
1119 echo " --disable-vhost-net disable vhost-net acceleration support"
1120 echo " --enable-vhost-net enable vhost-net acceleration support"
1121 echo " --enable-trace-backend=B Set trace backend"
1122 echo " Available backends:" $
($python "$source_path"/scripts
/tracetool.py
--list-backends)
1123 echo " --with-trace-file=NAME Full PATH,NAME of file to store traces"
1124 echo " Default:trace-<pid>"
1125 echo " --disable-spice disable spice"
1126 echo " --enable-spice enable spice"
1127 echo " --enable-rbd enable building the rados block device (rbd)"
1128 echo " --disable-libiscsi disable iscsi support"
1129 echo " --enable-libiscsi enable iscsi support"
1130 echo " --disable-smartcard disable smartcard support"
1131 echo " --enable-smartcard enable smartcard support"
1132 echo " --disable-smartcard-nss disable smartcard nss support"
1133 echo " --enable-smartcard-nss enable smartcard nss support"
1134 echo " --disable-usb-redir disable usb network redirection support"
1135 echo " --enable-usb-redir enable usb network redirection support"
1136 echo " --disable-guest-agent disable building of the QEMU Guest Agent"
1137 echo " --enable-guest-agent enable building of the QEMU Guest Agent"
1138 echo " --with-coroutine=BACKEND coroutine backend. Supported options:"
1139 echo " gthread, ucontext, sigaltstack, windows"
1141 echo "NOTE: The object files are built at the place where configure is launched"
1145 # Now we have handled --enable-tcg-interpreter and know we're not just
1146 # printing the help message, bail out if the host CPU isn't supported.
1147 if test "$ARCH" = "unknown"; then
1148 if test "$tcg_interpreter" = "yes" ; then
1149 echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)"
1152 echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter"
1157 # check that the C compiler works.
1159 int main(void) { return 0; }
1162 if compile_object
; then
1163 : C compiler works ok
1165 echo "ERROR: \"$cc\" either does not exist or does not work"
1169 # Consult white-list to determine whether to enable werror
1170 # by default. Only enable by default for git builds
1171 z_version
=`cut -f3 -d. $source_path/VERSION`
1173 if test -z "$werror" ; then
1174 if test "$z_version" = "50" -a \
1175 "$linux" = "yes" ; then
1182 gcc_flags
="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
1183 gcc_flags
="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
1184 gcc_flags
="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
1185 gcc_flags
="-fstack-protector-all -Wendif-labels $gcc_flags"
1186 # Note that we do not add -Werror to gcc_flags here, because that would
1187 # enable it for all configure tests. If a configure test failed due
1188 # to -Werror this would just silently disable some features,
1189 # so it's too error prone.
1191 int main(void) { return 0; }
1193 for flag
in $gcc_flags; do
1194 if compile_prog
"-Werror $flag" "" ; then
1195 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
1199 if test "$static" = "yes" ; then
1200 if test "$pie" = "yes" ; then
1201 echo "static and pie are mutually incompatible"
1208 if test "$pie" = ""; then
1209 case "$cpu-$targetos" in
1210 i386-Linux|x86_64-Linux|i386-OpenBSD|x86_64-OpenBSD
)
1218 if test "$pie" != "no" ; then
1222 # define THREAD __thread
1227 static THREAD int tls_var;
1229 int main(void) { return tls_var; }
1232 if compile_prog
"-fPIE -DPIE" "-pie"; then
1233 QEMU_CFLAGS
="-fPIE -DPIE $QEMU_CFLAGS"
1234 LDFLAGS
="-pie $LDFLAGS"
1236 if compile_prog
"" "-Wl,-z,relro -Wl,-z,now" ; then
1237 LDFLAGS
="-Wl,-z,relro -Wl,-z,now $LDFLAGS"
1240 if test "$pie" = "yes"; then
1241 echo "PIE not available due to missing toolchain support"
1244 echo "Disabling PIE due to missing toolchain support"
1251 # Solaris specific configure tool chain decisions
1253 if test "$solaris" = "yes" ; then
1254 if has
$install; then
1257 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
1258 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
1259 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
1262 if test "`path_of $install`" = "/usr/sbin/install" ; then
1263 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
1264 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
1265 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
1271 echo "Error: No path includes ar"
1272 if test -f /usr
/ccs
/bin
/ar ; then
1273 echo "Add /usr/ccs/bin to your path and rerun configure"
1279 if ! has
$python; then
1280 echo "Python not found. Use --python=/path/to/python"
1284 # Note that if the Python conditional here evaluates True we will exit
1285 # with status 1 which is a shell 'false' value.
1286 if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then
1287 echo "Cannot use '$python', Python 2.4 or later is required."
1288 echo "Note that Python 3 or later is not yet supported."
1289 echo "Use --python=/path/to/python to specify a supported Python."
1293 if test -z "$target_list" ; then
1294 target_list
="$default_target_list"
1296 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
1298 if test -z "$target_list" ; then
1299 echo "No targets enabled"
1302 # see if system emulation was really requested
1303 case " $target_list " in
1304 *"-softmmu "*) softmmu
=yes
1310 feature_not_found
() {
1314 echo "ERROR: User requested feature $feature"
1315 echo "ERROR: configure was not able to find it"
1320 if test -z "$cross_prefix" ; then
1323 # big/little endian test
1325 #include <inttypes.h>
1326 int main(int argc, char ** argv){
1327 volatile uint32_t i=0x01234567;
1328 return (*((uint8_t*)(&i))) == 0x67;
1332 if compile_prog
"" "" ; then
1333 $TMPE && bigendian
="yes"
1335 echo big
/little
test failed
1340 # if cross compiling, cannot launch a program, so make a static guess
1343 # ARM can be either way; ask the compiler which one we are
1344 if check_define __ARMEB__
; then
1348 hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64
)
1355 ##########################################
1358 if test "$nptl" != "no" ; then
1361 #include <linux/futex.h>
1363 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
1370 if compile_object
; then
1373 if test "$nptl" = "yes" ; then
1374 feature_not_found
"nptl"
1380 ##########################################
1383 if test "$zlib" != "no" ; then
1386 int main(void) { zlibVersion(); return 0; }
1388 if compile_prog
"" "-lz" ; then
1392 echo "Error: zlib check failed"
1393 echo "Make sure to have the zlib libs and headers installed."
1399 ##########################################
1402 if test "$xen" != "no" ; then
1403 xen_libs
="-lxenstore -lxenctrl -lxenguest"
1405 # First we test whether Xen headers and libraries are available.
1406 # If no, we are done and there is no Xen support.
1407 # If yes, more tests are run to detect the Xen version.
1411 #include <xenctrl.h>
1416 if ! compile_prog
"" "$xen_libs" ; then
1418 if test "$xen" = "yes" ; then
1419 feature_not_found
"xen"
1425 cat > $TMPC <<EOF &&
1426 #include <xenctrl.h>
1427 #include <xenstore.h>
1429 #include <xen/hvm/hvm_info_table.h>
1430 #if !defined(HVM_MAX_VCPUS)
1431 # error HVM_MAX_VCPUS not defined
1436 xc = xc_interface_open(0, 0, 0);
1437 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1438 xc_gnttab_open(NULL, 0);
1439 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
1440 xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
1444 compile_prog
"" "$xen_libs"
1446 xen_ctrl_version
=420
1450 cat > $TMPC <<EOF &&
1451 #include <xenctrl.h>
1454 #include <xen/hvm/hvm_info_table.h>
1455 #if !defined(HVM_MAX_VCPUS)
1456 # error HVM_MAX_VCPUS not defined
1460 xc_interface_open(0, 0, 0);
1461 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1462 xc_gnttab_open(NULL, 0);
1463 xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
1467 compile_prog
"" "$xen_libs"
1469 xen_ctrl_version
=410
1474 cat > $TMPC <<EOF &&
1475 #include <xenctrl.h>
1478 #include <xen/hvm/hvm_info_table.h>
1479 #if !defined(HVM_MAX_VCPUS)
1480 # error HVM_MAX_VCPUS not defined
1483 struct xen_add_to_physmap xatp = {
1484 .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
1487 xc_interface_open();
1489 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1490 xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
1494 compile_prog
"" "$xen_libs"
1496 xen_ctrl_version
=400
1501 cat > $TMPC <<EOF &&
1502 #include <xenctrl.h>
1505 struct xen_add_to_physmap xatp = {
1506 .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
1509 xc_interface_open();
1511 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1512 xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
1516 compile_prog
"" "$xen_libs"
1518 xen_ctrl_version
=340
1523 cat > $TMPC <<EOF &&
1524 #include <xenctrl.h>
1528 xc_interface_open();
1530 xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1534 compile_prog
"" "$xen_libs"
1536 xen_ctrl_version
=330
1539 # Xen version unsupported
1541 if test "$xen" = "yes" ; then
1542 feature_not_found
"xen (unsupported version)"
1547 if test "$xen" = yes; then
1548 libs_softmmu
="$xen_libs $libs_softmmu"
1552 if test "$xen_pci_passthrough" != "no"; then
1553 if test "$xen" = "yes" && test "$linux" = "yes" &&
1554 test "$xen_ctrl_version" -ge 340; then
1555 xen_pci_passthrough
=yes
1557 if test "$xen_pci_passthrough" = "yes"; then
1559 echo "ERROR: User requested feature Xen PCI Passthrough"
1560 echo "ERROR: but this feature require /sys from Linux"
1561 if test "$xen_ctrl_version" -lt 340; then
1562 echo "ERROR: This feature does not work with Xen 3.3"
1567 xen_pci_passthrough
=no
1571 ##########################################
1574 if ! has
"$pkg_config_exe"; then
1575 echo "Error: pkg-config binary '$pkg_config_exe' not found"
1579 ##########################################
1582 if ! has
$libtool; then
1586 ##########################################
1588 if test "$sparse" != "no" ; then
1592 if test "$sparse" = "yes" ; then
1593 feature_not_found
"sparse"
1599 ##########################################
1602 # Look for sdl configuration program (pkg-config or sdl-config). Try
1603 # sdl-config even without cross prefix, and favour pkg-config over sdl-config.
1604 if test "`basename $sdl_config`" != sdl-config
&& ! has
${sdl_config}; then
1605 sdl_config
=sdl-config
1608 if $pkg_config sdl
--modversion >/dev
/null
2>&1; then
1609 sdlconfig
="$pkg_config sdl"
1610 _sdlversion
=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1611 elif has
${sdl_config}; then
1612 sdlconfig
="$sdl_config"
1613 _sdlversion
=`$sdlconfig --version | sed 's/[^0-9]//g'`
1615 if test "$sdl" = "yes" ; then
1616 feature_not_found
"sdl"
1620 if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config
; then
1621 echo warning
: using
"\"$sdlconfig\"" to detect cross-compiled sdl
>&2
1625 if test "$sdl" != "no" ; then
1628 #undef main /* We don't want SDL to override our main() */
1629 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1631 sdl_cflags
=`$sdlconfig --cflags 2> /dev/null`
1632 if test "$static" = "yes" ; then
1633 sdl_libs
=`$sdlconfig --static-libs 2>/dev/null`
1635 sdl_libs
=`$sdlconfig --libs 2> /dev/null`
1637 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1638 if test "$_sdlversion" -lt 121 ; then
1641 if test "$cocoa" = "no" ; then
1646 # static link with sdl ? (note: sdl.pc's --static --libs is broken)
1647 if test "$sdl" = "yes" -a "$static" = "yes" ; then
1648 if test $?
= 0 && echo $sdl_libs |
grep -- -laa > /dev
/null
; then
1649 sdl_libs
="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
1650 sdl_cflags
="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
1652 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1658 else # sdl not found
1659 if test "$sdl" = "yes" ; then
1660 feature_not_found
"sdl"
1663 fi # sdl compile test
1666 if test "$sdl" = "yes" ; then
1669 #if defined(SDL_VIDEO_DRIVER_X11)
1670 #include <X11/XKBlib.h>
1672 #error No x11 support
1674 int main(void) { return 0; }
1676 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1677 sdl_libs
="$sdl_libs -lX11"
1679 libs_softmmu
="$sdl_libs $libs_softmmu"
1682 ##########################################
1684 if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then
1686 #include <gnutls/gnutls.h>
1687 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1689 vnc_tls_cflags
=`$pkg_config --cflags gnutls 2> /dev/null`
1690 vnc_tls_libs
=`$pkg_config --libs gnutls 2> /dev/null`
1691 if compile_prog
"$vnc_tls_cflags" "$vnc_tls_libs" ; then
1693 libs_softmmu
="$vnc_tls_libs $libs_softmmu"
1695 if test "$vnc_tls" = "yes" ; then
1696 feature_not_found
"vnc-tls"
1702 ##########################################
1703 # VNC SASL detection
1704 if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then
1706 #include <sasl/sasl.h>
1708 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
1710 # Assuming Cyrus-SASL installed in /usr prefix
1712 vnc_sasl_libs
="-lsasl2"
1713 if compile_prog
"$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
1715 libs_softmmu
="$vnc_sasl_libs $libs_softmmu"
1717 if test "$vnc_sasl" = "yes" ; then
1718 feature_not_found
"vnc-sasl"
1724 ##########################################
1725 # VNC JPEG detection
1726 if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then
1729 #include <jpeglib.h>
1730 int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; }
1733 vnc_jpeg_libs
="-ljpeg"
1734 if compile_prog
"$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
1736 libs_softmmu
="$vnc_jpeg_libs $libs_softmmu"
1738 if test "$vnc_jpeg" = "yes" ; then
1739 feature_not_found
"vnc-jpeg"
1745 ##########################################
1747 if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then
1749 //#include <stdio.h>
1753 png_structp png_ptr;
1754 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
1755 return png_ptr != 0;
1758 if $pkg_config libpng
--modversion >/dev
/null
2>&1; then
1759 vnc_png_cflags
=`$pkg_config libpng --cflags 2> /dev/null`
1760 vnc_png_libs
=`$pkg_config libpng --libs 2> /dev/null`
1763 vnc_png_libs
="-lpng"
1765 if compile_prog
"$vnc_png_cflags" "$vnc_png_libs" ; then
1767 libs_softmmu
="$vnc_png_libs $libs_softmmu"
1768 QEMU_CFLAGS
="$QEMU_CFLAGS $vnc_png_cflags"
1770 if test "$vnc_png" = "yes" ; then
1771 feature_not_found
"vnc-png"
1777 ##########################################
1778 # fnmatch() probe, used for ACL routines
1781 #include <fnmatch.h>
1784 fnmatch("foo", "foo", 0);
1788 if compile_prog
"" "" ; then
1792 ##########################################
1793 # uuid_generate() probe, used for vdi block driver
1794 if test "$uuid" != "no" ; then
1797 #include <uuid/uuid.h>
1801 uuid_generate(my_uuid);
1805 if compile_prog
"" "$uuid_libs" ; then
1807 libs_softmmu
="$uuid_libs $libs_softmmu"
1808 libs_tools
="$uuid_libs $libs_tools"
1810 if test "$uuid" = "yes" ; then
1811 feature_not_found
"uuid"
1817 ##########################################
1818 # xfsctl() probe, used for raw-posix
1819 if test "$xfs" != "no" ; then
1821 #include <stddef.h> /* NULL */
1822 #include <xfs/xfs.h>
1825 xfsctl(NULL, 0, 0, NULL);
1829 if compile_prog
"" "" ; then
1832 if test "$xfs" = "yes" ; then
1833 feature_not_found
"xfs"
1839 ##########################################
1840 # vde libraries probe
1841 if test "$vde" != "no" ; then
1842 vde_libs
="-lvdeplug"
1844 #include <libvdeplug.h>
1847 struct vde_open_args a = {0, 0, 0};
1853 if compile_prog
"" "$vde_libs" ; then
1855 libs_softmmu
="$vde_libs $libs_softmmu"
1856 libs_tools
="$vde_libs $libs_tools"
1858 if test "$vde" = "yes" ; then
1859 feature_not_found
"vde"
1865 ##########################################
1866 # libcap-ng library probe
1867 if test "$cap_ng" != "no" ; then
1873 capng_capability_to_name(CAPNG_EFFECTIVE);
1877 if compile_prog
"" "$cap_libs" ; then
1879 libs_tools
="$cap_libs $libs_tools"
1881 if test "$cap_ng" = "yes" ; then
1882 feature_not_found
"cap_ng"
1888 ##########################################
1889 # Sound support libraries probe
1900 int main(void) { $exp }
1902 if compile_prog
"$cfl" "$lib" ; then
1906 echo "Error: $drv check failed"
1907 echo "Make sure to have the $drv libs and headers installed."
1913 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1914 for drv
in $audio_drv_list; do
1917 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
1918 "return snd_pcm_close((snd_pcm_t *)0);"
1919 libs_softmmu
="-lasound $libs_softmmu"
1923 if test -z $fmod_lib ||
test -z $fmod_inc; then
1925 echo "Error: You must specify path to FMOD library and headers"
1926 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1930 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1931 libs_softmmu
="$fmod_lib $libs_softmmu"
1935 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
1936 libs_softmmu
="-lesd $libs_softmmu"
1941 audio_drv_probe
$drv pulse
/mainloop.h
"-lpulse" \
1942 "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;"
1943 libs_softmmu
="-lpulse $libs_softmmu"
1948 libs_softmmu
="-framework CoreAudio $libs_softmmu"
1952 libs_softmmu
="-lole32 -ldxguid $libs_softmmu"
1957 libs_softmmu
="$oss_lib $libs_softmmu"
1961 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1965 libs_softmmu
="-lwinmm $libs_softmmu"
1970 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
1972 echo "Error: Unknown driver '$drv' selected"
1973 echo "Possible drivers are: $audio_possible_drivers"
1981 ##########################################
1984 if test "$brlapi" != "no" ; then
1985 brlapi_libs
="-lbrlapi"
1989 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1991 if compile_prog
"" "$brlapi_libs" ; then
1993 libs_softmmu
="$brlapi_libs $libs_softmmu"
1995 if test "$brlapi" = "yes" ; then
1996 feature_not_found
"brlapi"
2002 ##########################################
2004 if test "$mingw32" = "yes" ; then
2005 curses_list
="-lpdcurses"
2007 curses_list
="-lncurses -lcurses"
2010 if test "$curses" != "no" ; then
2015 const char *s = curses_version();
2020 for curses_lib
in $curses_list; do
2021 if compile_prog
"" "$curses_lib" ; then
2023 libs_softmmu
="$curses_lib $libs_softmmu"
2027 if test "$curses_found" = "yes" ; then
2030 if test "$curses" = "yes" ; then
2031 feature_not_found
"curses"
2037 ##########################################
2040 if $pkg_config libcurl
--modversion >/dev
/null
2>&1; then
2041 curlconfig
="$pkg_config libcurl"
2043 curlconfig
=curl-config
2046 if test "$curl" != "no" ; then
2048 #include <curl/curl.h>
2049 int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
2051 curl_cflags
=`$curlconfig --cflags 2>/dev/null`
2052 curl_libs
=`$curlconfig --libs 2>/dev/null`
2053 if compile_prog
"$curl_cflags" "$curl_libs" ; then
2055 libs_tools
="$curl_libs $libs_tools"
2056 libs_softmmu
="$curl_libs $libs_softmmu"
2058 if test "$curl" = "yes" ; then
2059 feature_not_found
"curl"
2065 ##########################################
2066 # bluez support probe
2067 if test "$bluez" != "no" ; then
2069 #include <bluetooth/bluetooth.h>
2070 int main(void) { return bt_error(0); }
2072 bluez_cflags
=`$pkg_config --cflags bluez 2> /dev/null`
2073 bluez_libs
=`$pkg_config --libs bluez 2> /dev/null`
2074 if compile_prog
"$bluez_cflags" "$bluez_libs" ; then
2076 libs_softmmu
="$bluez_libs $libs_softmmu"
2078 if test "$bluez" = "yes" ; then
2079 feature_not_found
"bluez"
2085 ##########################################
2086 # glib support probe
2088 if test "$mingw32" = yes; then
2089 # g_poll is required in order to integrate with the glib main loop.
2094 if $pkg_config --atleast-version=$glib_req_ver gthread-2.0
> /dev
/null
2>&1
2096 glib_cflags
=`$pkg_config --cflags gthread-2.0 2>/dev/null`
2097 glib_libs
=`$pkg_config --libs gthread-2.0 2>/dev/null`
2098 LIBS
="$glib_libs $LIBS"
2099 libs_qga
="$glib_libs $libs_qga"
2101 echo "glib-$glib_req_ver required to compile QEMU"
2105 ##########################################
2108 if test "$cap" != "no" ; then
2111 #include <sys/capability.h>
2112 int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; }
2114 if compile_prog
"" "-lcap" ; then
2121 ##########################################
2123 PTHREADLIBS_LIST
="-pthread -lpthread -lpthreadGC2"
2127 #include <pthread.h>
2128 static void *f(void *p) { return NULL; }
2131 pthread_create(&thread, 0, f, 0);
2135 if compile_prog
"" "" ; then
2138 for pthread_lib
in $PTHREADLIBS_LIST; do
2139 if compile_prog
"" "$pthread_lib" ; then
2142 for lib_entry
in $LIBS; do
2143 if test "$lib_entry" = "$pthread_lib"; then
2148 if test "$found" = "no"; then
2149 LIBS
="$pthread_lib $LIBS"
2156 if test "$mingw32" != yes -a "$pthread" = no
; then
2158 echo "Error: pthread check failed"
2159 echo "Make sure to have the pthread libs and headers installed."
2164 ##########################################
2166 if test "$rbd" != "no" ; then
2169 #include <rbd/librbd.h>
2172 rados_create(&cluster, NULL);
2176 rbd_libs
="-lrbd -lrados"
2177 if compile_prog
"" "$rbd_libs" ; then
2179 libs_tools
="$rbd_libs $libs_tools"
2180 libs_softmmu
="$rbd_libs $libs_softmmu"
2182 if test "$rbd" = "yes" ; then
2183 feature_not_found
"rados block device"
2189 ##########################################
2192 if test "$linux_aio" != "no" ; then
2195 #include <sys/eventfd.h>
2197 int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
2199 if compile_prog
"" "-laio" ; then
2201 libs_softmmu
="$libs_softmmu -laio"
2202 libs_tools
="$libs_tools -laio"
2204 if test "$linux_aio" = "yes" ; then
2205 feature_not_found
"linux AIO"
2211 ##########################################
2214 if test "$attr" != "no" ; then
2217 #include <sys/types.h>
2218 #ifdef CONFIG_LIBATTR
2219 #include <attr/xattr.h>
2221 #include <sys/xattr.h>
2223 int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }
2225 if compile_prog
"" "" ; then
2227 # Older distros have <attr/xattr.h>, and need -lattr:
2228 elif compile_prog
"-DCONFIG_LIBATTR" "-lattr" ; then
2233 if test "$attr" = "yes" ; then
2234 feature_not_found
"ATTR"
2240 ##########################################
2243 #include <sys/types.h>
2244 #include <sys/uio.h>
2246 int main(void) { return sizeof(struct iovec); }
2249 if compile_prog
"" "" ; then
2253 ##########################################
2256 #include <sys/types.h>
2257 #include <sys/uio.h>
2259 int main(void) { return preadv(0, 0, 0, 0); }
2262 if compile_prog
"" "" ; then
2266 ##########################################
2268 if test "$fdt" != "no" ; then
2271 int main(void) { return 0; }
2273 if compile_prog
"" "$fdt_libs" ; then
2276 if test "$fdt" = "yes" ; then
2277 feature_not_found
"fdt"
2284 ##########################################
2285 # opengl probe, used by milkymist-tmu2
2286 if test "$opengl" != "no" ; then
2289 #include <X11/Xlib.h>
2292 int main(void) { return GL_VERSION != 0; }
2294 if compile_prog
"" "-lGL" ; then
2297 if test "$opengl" = "yes" ; then
2298 feature_not_found
"opengl"
2306 # Check for xxxat() functions when we are building linux-user
2307 # emulator. This is done because older glibc versions don't
2308 # have syscall stubs for these implemented.
2312 #define _ATFILE_SOURCE
2313 #include <sys/types.h>
2320 /* try to unlink nonexisting file */
2321 return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
2324 if compile_prog
"" "" ; then
2328 # Check for inotify functions when we are building linux-user
2329 # emulator. This is done because older glibc versions don't
2330 # have syscall stubs for these implemented. In that case we
2331 # don't provide them even if kernel supports them.
2335 #include <sys/inotify.h>
2340 /* try to start inotify */
2341 return inotify_init();
2344 if compile_prog
"" "" ; then
2350 #include <sys/inotify.h>
2355 /* try to start inotify */
2356 return inotify_init1(0);
2359 if compile_prog
"" "" ; then
2363 # check if utimensat and futimens are supported
2366 #define _ATFILE_SOURCE
2369 #include <sys/stat.h>
2373 utimensat(AT_FDCWD, "foo", NULL, 0);
2378 if compile_prog
"" "" ; then
2382 # check if pipe2 is there
2391 pipe2(pipefd, O_CLOEXEC);
2395 if compile_prog
"" "" ; then
2399 # check if accept4 is there
2402 #include <sys/socket.h>
2407 accept4(0, NULL, NULL, SOCK_CLOEXEC);
2411 if compile_prog
"" "" ; then
2415 # check if tee/splice is there. vmsplice was added same time.
2425 len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
2426 splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
2430 if compile_prog
"" "" ; then
2434 ##########################################
2439 #include <sys/syscall.h>
2441 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
2444 if compile_prog
"" "" ; then
2448 # check if eventfd is supported
2451 #include <sys/eventfd.h>
2455 return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
2458 if compile_prog
"" "" ; then
2462 # check for fallocate
2469 fallocate(0, 0, 0, 0);
2473 if compile_prog
"" "" ; then
2477 # check for sync_file_range
2484 sync_file_range(0, 0, 0, 0);
2488 if compile_prog
"" "" ; then
2492 # check for linux/fiemap.h and FS_IOC_FIEMAP
2495 #include <sys/ioctl.h>
2496 #include <linux/fs.h>
2497 #include <linux/fiemap.h>
2501 ioctl(0, FS_IOC_FIEMAP, 0);
2505 if compile_prog
"" "" ; then
2520 if compile_prog
"" "" ; then
2524 # check for epoll support
2527 #include <sys/epoll.h>
2535 if compile_prog
"" "" ; then
2539 # epoll_create1 and epoll_pwait are later additions
2540 # so we must check separately for their presence
2543 #include <sys/epoll.h>
2547 /* Note that we use epoll_create1 as a value, not as
2548 * a function being called. This is necessary so that on
2549 * old SPARC glibc versions where the function was present in
2550 * the library but not declared in the header file we will
2551 * fail the configure check. (Otherwise we will get a compiler
2552 * warning but not an error, and will proceed to fail the
2553 * qemu compile where we compile with -Werror.)
2555 return (int)(uintptr_t)&epoll_create1;
2558 if compile_prog
"" "" ; then
2564 #include <sys/epoll.h>
2568 epoll_pwait(0, 0, 0, 0, 0);
2572 if compile_prog
"" "" ; then
2576 # Check if tools are available to build documentation.
2577 if test "$docs" != "no" ; then
2578 if has makeinfo
&& has pod2man
; then
2581 if test "$docs" = "yes" ; then
2582 feature_not_found
"docs"
2588 # Search for bswap_32 function
2591 #include <byteswap.h>
2592 int main(void) { return bswap_32(0); }
2594 if compile_prog
"" "" ; then
2598 # Search for bswap_32 function
2601 #include <sys/endian.h>
2602 #include <sys/types.h>
2603 #include <machine/bswap.h>
2604 int main(void) { return bswap32(0); }
2606 if compile_prog
"" "" ; then
2610 ##########################################
2611 # Do we have libiscsi
2612 # We check for iscsi_unmap_sync() to make sure we have a
2613 # recent enough version of libiscsi.
2614 if test "$libiscsi" != "no" ; then
2617 #include <iscsi/iscsi.h>
2618 int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
2620 if compile_prog
"" "-liscsi" ; then
2622 LIBS
="$LIBS -liscsi"
2624 if test "$libiscsi" = "yes" ; then
2625 feature_not_found
"libiscsi"
2632 ##########################################
2637 int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); }
2640 if compile_prog
"" "" ; then
2642 elif compile_prog
"" "-lrt" ; then
2646 if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
2647 "$aix" != "yes" -a "$haiku" != "yes" ; then
2648 libs_softmmu
="-lutil $libs_softmmu"
2651 ##########################################
2653 if test "$spice" != "no" ; then
2656 int main(void) { spice_server_new(); return 0; }
2658 spice_cflags
=$
($pkg_config --cflags spice-protocol spice-server
2>/dev
/null
)
2659 spice_libs
=$
($pkg_config --libs spice-protocol spice-server
2>/dev
/null
)
2660 if $pkg_config --atleast-version=0.8.2 spice-server
>/dev
/null
2>&1 && \
2661 $pkg_config --atleast-version=0.8.1 spice-protocol
> /dev
/null
2>&1 && \
2662 compile_prog
"$spice_cflags" "$spice_libs" ; then
2664 libs_softmmu
="$libs_softmmu $spice_libs"
2665 QEMU_CFLAGS
="$QEMU_CFLAGS $spice_cflags"
2667 if test "$spice" = "yes" ; then
2668 feature_not_found
"spice"
2674 # check for libcacard for smartcard support
2675 if test "$smartcard" != "no" ; then
2678 # TODO - what's the minimal nss version we support?
2679 if test "$smartcard_nss" != "no"; then
2681 #include <pk11pub.h>
2682 int main(void) { PK11_FreeSlot(0); return 0; }
2684 smartcard_includes
="-I\$(SRC_PATH)/libcacard"
2685 libcacard_libs
="$($pkg_config --libs nss 2>/dev/null) $glib_libs"
2686 libcacard_cflags
="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags"
2687 test_cflags
="$libcacard_cflags"
2688 # The header files in nss < 3.13.3 have a bug which causes them to
2689 # emit a warning. If we're going to compile QEMU with -Werror, then
2690 # test that the headers don't have this bug. Otherwise we would pass
2691 # the configure test but fail to compile QEMU later.
2692 if test "$werror" = "yes"; then
2693 test_cflags
="-Werror $test_cflags"
2695 if $pkg_config --atleast-version=3.12.8 nss
>/dev
/null
2>&1 && \
2696 compile_prog
"$test_cflags" "$libcacard_libs"; then
2698 QEMU_CFLAGS
="$QEMU_CFLAGS $libcacard_cflags"
2699 QEMU_INCLUDES
="$QEMU_INCLUDES $smartcard_includes"
2700 libs_softmmu
="$libcacard_libs $libs_softmmu"
2702 if test "$smartcard_nss" = "yes"; then
2703 feature_not_found
"nss"
2709 if test "$smartcard" = "no" ; then
2713 # check for usbredirparser for usb network redirection support
2714 if test "$usb_redir" != "no" ; then
2715 if $pkg_config --atleast-version=0.3.4 libusbredirparser
>/dev
/null
2>&1 ; then
2717 usb_redir_cflags
=$
($pkg_config --cflags libusbredirparser
2>/dev
/null
)
2718 usb_redir_libs
=$
($pkg_config --libs libusbredirparser
2>/dev
/null
)
2719 QEMU_CFLAGS
="$QEMU_CFLAGS $usb_redir_cflags"
2720 LIBS
="$LIBS $usb_redir_libs"
2722 if test "$usb_redir" = "yes"; then
2723 feature_not_found
"usb-redir"
2729 ##########################################
2731 ##########################################
2732 # check if we have fdatasync
2738 #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
2739 return fdatasync(0);
2741 #error Not supported
2745 if compile_prog
"" "" ; then
2749 ##########################################
2750 # check if we have madvise
2754 #include <sys/types.h>
2755 #include <sys/mman.h>
2757 int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }
2759 if compile_prog
"" "" ; then
2763 ##########################################
2764 # check if we have posix_madvise
2768 #include <sys/mman.h>
2770 int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }
2772 if compile_prog
"" "" ; then
2776 ##########################################
2777 # check if trace backend exists
2779 $python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev
/null
2> /dev
/null
2780 if test "$?" -ne 0 ; then
2782 echo "Error: invalid trace backend"
2783 echo "Please choose a supported trace backend."
2788 ##########################################
2789 # For 'ust' backend, test if ust headers are present
2790 if test "$trace_backend" = "ust"; then
2792 #include <ust/tracepoint.h>
2793 #include <ust/marker.h>
2794 int main(void) { return 0; }
2796 if compile_prog
"" "" ; then
2797 LIBS
="-lust -lurcu-bp $LIBS"
2798 libs_qga
="-lust -lurcu-bp $libs_qga"
2801 echo "Error: Trace backend 'ust' missing libust header files"
2807 ##########################################
2808 # For 'dtrace' backend, test if 'dtrace' command is present
2809 if test "$trace_backend" = "dtrace"; then
2810 if ! has
'dtrace' ; then
2812 echo "Error: dtrace command is not found in PATH $PATH"
2816 trace_backend_stap
="no"
2817 if has
'stap' ; then
2818 trace_backend_stap
="yes"
2822 ##########################################
2823 # __sync_fetch_and_and requires at least -march=i486. Many toolchains
2824 # use i686 as default anyway, but for those that don't, an explicit
2825 # specification is necessary
2826 if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then
2828 static int sfaa(int *ptr)
2830 return __sync_fetch_and_and(ptr, 0);
2833 int main(int argc, char **argv)
2840 if ! compile_prog
"" "" ; then
2841 QEMU_CFLAGS
="-march=i486 $QEMU_CFLAGS"
2845 ##########################################
2846 # check and set a backend for coroutine
2848 # default is ucontext, but always fallback to gthread
2849 # windows autodetected by make
2850 if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then
2851 if test "$darwin" != "yes"; then
2853 #include <ucontext.h>
2854 #ifdef __stub_makecontext
2855 #error Ignoring glibc stub makecontext which will always fail
2857 int main(void) { makecontext(0, 0, 0); return 0; }
2859 if compile_prog
"" "" ; then
2860 coroutine_backend
=ucontext
2862 coroutine_backend
=gthread
2865 echo "Silently falling back into gthread backend under darwin"
2867 elif test "$coroutine" = "gthread" ; then
2868 coroutine_backend
=gthread
2869 elif test "$coroutine" = "windows" ; then
2870 coroutine_backend
=windows
2871 elif test "$coroutine" = "sigaltstack" ; then
2872 coroutine_backend
=sigaltstack
2875 echo "Error: unknown coroutine backend $coroutine"
2880 ##########################################
2881 # check if we have open_by_handle_at
2883 open_by_handle_at
=no
2886 #if !defined(AT_EMPTY_PATH)
2887 # error missing definition
2889 int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); }
2892 if compile_prog
"" "" ; then
2893 open_by_handle_at
=yes
2896 ########################################
2897 # check if we have linux/magic.h
2901 #include <linux/magic.h>
2906 if compile_prog
"" "" ; then
2910 ########################################
2911 # check whether we can disable the -Wunused-but-set-variable
2912 # option with a pragma (this is needed to silence a warning in
2913 # some versions of the valgrind VALGRIND_STACK_DEREGISTER macro.)
2914 # This test has to be compiled with -Werror as otherwise an
2915 # unknown pragma is only a warning.
2916 pragma_disable_unused_but_set
=no
2918 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
2923 if compile_prog
"-Werror" "" ; then
2924 pragma_disable_unused_but_set
=yes
2927 ########################################
2928 # check if we have valgrind/valgrind.h
2932 #include <valgrind/valgrind.h>
2937 if compile_prog
"" "" ; then
2941 ########################################
2942 # check if environ is declared
2952 if compile_prog
"" "" ; then
2956 ##########################################
2958 # After here, no more $cc or $ld runs
2960 if test "$debug" = "no" ; then
2961 CFLAGS
="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
2964 # Disable zero malloc errors for official releases unless explicitly told to
2966 if test -z "$zero_malloc" ; then
2967 if test "$z_version" = "50" ; then
2974 # Now we've finished running tests it's OK to add -Werror to the compiler flags
2975 if test "$werror" = "yes"; then
2976 QEMU_CFLAGS
="-Werror $QEMU_CFLAGS"
2979 if test "$solaris" = "no" ; then
2980 if $ld --version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
2981 LDFLAGS
="-Wl,--warn-common $LDFLAGS"
2985 # test if pod2man has --utf8 option
2986 if pod2man
--help |
grep -q utf8
; then
2987 POD2MAN
="pod2man --utf8"
2992 # Use ASLR, no-SEH and DEP if available
2993 if test "$mingw32" = "yes" ; then
2994 for flag
in --dynamicbase --no-seh --nxcompat; do
2995 if $ld --help 2>/dev
/null |
grep ".$flag" >/dev
/null
2>/dev
/null
; then
2996 LDFLAGS
="-Wl,$flag $LDFLAGS"
3001 qemu_confdir
=$sysconfdir$confsuffix
3002 qemu_datadir
=$datadir$confsuffix
3005 if test "$softmmu" = yes ; then
3006 tools
="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
3007 if test "$virtfs" != no
; then
3008 if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then
3010 tools
="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
3012 if test "$virtfs" = yes; then
3013 echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel"
3019 if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
3020 tools
="qemu-nbd\$(EXESUF) $tools"
3021 if [ "$guest_agent" = "yes" ]; then
3022 tools
="qemu-ga\$(EXESUF) $tools"
3026 if test "$smartcard_nss" = "yes" ; then
3027 tools
="vscclient\$(EXESUF) $tools"
3030 # Mac OS X ships with a broken assembler
3032 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) -a \
3033 "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
3034 "$softmmu" = yes ; then
3037 if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
3038 roms
="$roms spapr-rtas"
3041 echo "Install prefix $prefix"
3042 echo "BIOS directory `eval echo $qemu_datadir`"
3043 echo "binary directory `eval echo $bindir`"
3044 echo "library directory `eval echo $libdir`"
3045 echo "include directory `eval echo $includedir`"
3046 echo "config directory `eval echo $sysconfdir`"
3047 if test "$mingw32" = "no" ; then
3048 echo "Manual directory `eval echo $mandir`"
3049 echo "ELF interp prefix $interp_prefix"
3051 echo "Source path $source_path"
3052 echo "C compiler $cc"
3053 echo "Host C compiler $host_cc"
3054 echo "CFLAGS $CFLAGS"
3055 echo "QEMU_CFLAGS $QEMU_CFLAGS"
3056 echo "LDFLAGS $LDFLAGS"
3058 echo "install $install"
3059 echo "python $python"
3060 if test "$slirp" = "yes" ; then
3063 echo "host CPU $cpu"
3064 echo "host big endian $bigendian"
3065 echo "target list $target_list"
3066 echo "tcg debug enabled $debug_tcg"
3067 echo "Mon debug enabled $debug_mon"
3068 echo "gprof enabled $gprof"
3069 echo "sparse enabled $sparse"
3070 echo "strip binaries $strip_opt"
3071 echo "profiler $profiler"
3072 echo "static build $static"
3073 echo "-Werror enabled $werror"
3074 if test "$darwin" = "yes" ; then
3075 echo "Cocoa support $cocoa"
3077 echo "SDL support $sdl"
3078 echo "curses support $curses"
3079 echo "curl support $curl"
3080 echo "mingw32 support $mingw32"
3081 echo "Audio drivers $audio_drv_list"
3082 echo "Extra audio cards $audio_card_list"
3083 echo "Block whitelist $block_drv_whitelist"
3084 echo "Mixer emulation $mixemu"
3085 echo "VirtFS support $virtfs"
3086 echo "VNC support $vnc"
3087 if test "$vnc" = "yes" ; then
3088 echo "VNC TLS support $vnc_tls"
3089 echo "VNC SASL support $vnc_sasl"
3090 echo "VNC JPEG support $vnc_jpeg"
3091 echo "VNC PNG support $vnc_png"
3093 if test -n "$sparc_cpu"; then
3094 echo "Target Sparc Arch $sparc_cpu"
3096 echo "xen support $xen"
3097 echo "brlapi support $brlapi"
3098 echo "bluez support $bluez"
3099 echo "Documentation $docs"
3100 [ ! -z "$uname_release" ] && \
3101 echo "uname -r $uname_release"
3102 echo "NPTL support $nptl"
3103 echo "GUEST_BASE $guest_base"
3105 echo "vde support $vde"
3106 echo "Linux AIO support $linux_aio"
3107 echo "ATTR/XATTR support $attr"
3108 echo "Install blobs $blobs"
3109 echo "KVM support $kvm"
3110 echo "TCG interpreter $tcg_interpreter"
3111 echo "fdt support $fdt"
3112 echo "preadv support $preadv"
3113 echo "fdatasync $fdatasync"
3114 echo "madvise $madvise"
3115 echo "posix_madvise $posix_madvise"
3116 echo "uuid support $uuid"
3117 echo "libcap-ng support $cap_ng"
3118 echo "vhost-net support $vhost_net"
3119 echo "Trace backend $trace_backend"
3120 echo "Trace output file $trace_file-<pid>"
3121 echo "spice support $spice"
3122 echo "rbd support $rbd"
3123 echo "xfsctl support $xfs"
3124 echo "nss used $smartcard_nss"
3125 echo "usb net redir $usb_redir"
3126 echo "OpenGL support $opengl"
3127 echo "libiscsi support $libiscsi"
3128 echo "build guest agent $guest_agent"
3129 echo "coroutine backend $coroutine_backend"
3131 if test "$sdl_too_old" = "yes"; then
3132 echo "-> Your SDL version is too old - please upgrade to have SDL support"
3135 config_host_mak
="config-host.mak"
3136 config_host_ld
="config-host.ld"
3138 echo "# Automatically generated by configure - do not modify" > $config_host_mak
3139 printf "# Configured with:" >> $config_host_mak
3140 printf " '%s'" "$0" "$@" >> $config_host_mak
3141 echo >> $config_host_mak
3143 echo all
: >> $config_host_mak
3144 echo "prefix=$prefix" >> $config_host_mak
3145 echo "bindir=$bindir" >> $config_host_mak
3146 echo "libdir=$libdir" >> $config_host_mak
3147 echo "includedir=$includedir" >> $config_host_mak
3148 echo "mandir=$mandir" >> $config_host_mak
3149 echo "sysconfdir=$sysconfdir" >> $config_host_mak
3150 echo "qemu_confdir=$qemu_confdir" >> $config_host_mak
3151 echo "qemu_datadir=$qemu_datadir" >> $config_host_mak
3152 echo "qemu_docdir=$qemu_docdir" >> $config_host_mak
3153 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
3154 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak
3156 echo "ARCH=$ARCH" >> $config_host_mak
3157 if test "$debug_tcg" = "yes" ; then
3158 echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
3160 if test "$debug_mon" = "yes" ; then
3161 echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
3163 if test "$debug" = "yes" ; then
3164 echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
3166 if test "$strip_opt" = "yes" ; then
3167 echo "STRIP=${strip}" >> $config_host_mak
3169 if test "$bigendian" = "yes" ; then
3170 echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
3172 if test "$mingw32" = "yes" ; then
3173 echo "CONFIG_WIN32=y" >> $config_host_mak
3174 rc_version
=`cat $source_path/VERSION`
3175 version_major
=${rc_version%%.*}
3176 rc_version
=${rc_version#*.}
3177 version_minor
=${rc_version%%.*}
3178 rc_version
=${rc_version#*.}
3179 version_subminor
=${rc_version%%.*}
3181 echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
3182 echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
3184 echo "CONFIG_POSIX=y" >> $config_host_mak
3187 if test "$linux" = "yes" ; then
3188 echo "CONFIG_LINUX=y" >> $config_host_mak
3191 if test "$darwin" = "yes" ; then
3192 echo "CONFIG_DARWIN=y" >> $config_host_mak
3195 if test "$aix" = "yes" ; then
3196 echo "CONFIG_AIX=y" >> $config_host_mak
3199 if test "$solaris" = "yes" ; then
3200 echo "CONFIG_SOLARIS=y" >> $config_host_mak
3201 echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
3202 if test "$needs_libsunmath" = "yes" ; then
3203 echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
3206 if test "$haiku" = "yes" ; then
3207 echo "CONFIG_HAIKU=y" >> $config_host_mak
3209 if test "$static" = "yes" ; then
3210 echo "CONFIG_STATIC=y" >> $config_host_mak
3212 if test "$profiler" = "yes" ; then
3213 echo "CONFIG_PROFILER=y" >> $config_host_mak
3215 if test "$slirp" = "yes" ; then
3216 echo "CONFIG_SLIRP=y" >> $config_host_mak
3217 echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
3218 QEMU_INCLUDES
="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
3220 if test "$vde" = "yes" ; then
3221 echo "CONFIG_VDE=y" >> $config_host_mak
3223 if test "$cap_ng" = "yes" ; then
3224 echo "CONFIG_LIBCAP=y" >> $config_host_mak
3226 for card
in $audio_card_list; do
3227 def
=CONFIG_
`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'`
3228 echo "$def=y" >> $config_host_mak
3230 echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
3231 for drv
in $audio_drv_list; do
3232 def
=CONFIG_
`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'`
3233 echo "$def=y" >> $config_host_mak
3234 if test "$drv" = "fmod"; then
3235 echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
3238 if test "$audio_pt_int" = "yes" ; then
3239 echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
3241 if test "$audio_win_int" = "yes" ; then
3242 echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
3244 echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
3245 if test "$mixemu" = "yes" ; then
3246 echo "CONFIG_MIXEMU=y" >> $config_host_mak
3248 if test "$vnc" = "yes" ; then
3249 echo "CONFIG_VNC=y" >> $config_host_mak
3251 if test "$vnc_tls" = "yes" ; then
3252 echo "CONFIG_VNC_TLS=y" >> $config_host_mak
3253 echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
3255 if test "$vnc_sasl" = "yes" ; then
3256 echo "CONFIG_VNC_SASL=y" >> $config_host_mak
3257 echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
3259 if test "$vnc_jpeg" = "yes" ; then
3260 echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
3261 echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
3263 if test "$vnc_png" = "yes" ; then
3264 echo "CONFIG_VNC_PNG=y" >> $config_host_mak
3265 echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
3267 if test "$fnmatch" = "yes" ; then
3268 echo "CONFIG_FNMATCH=y" >> $config_host_mak
3270 if test "$uuid" = "yes" ; then
3271 echo "CONFIG_UUID=y" >> $config_host_mak
3273 if test "$xfs" = "yes" ; then
3274 echo "CONFIG_XFS=y" >> $config_host_mak
3276 qemu_version
=`head $source_path/VERSION`
3277 echo "VERSION=$qemu_version" >>$config_host_mak
3278 echo "PKGVERSION=$pkgversion" >>$config_host_mak
3279 echo "SRC_PATH=$source_path" >> $config_host_mak
3280 echo "TARGET_DIRS=$target_list" >> $config_host_mak
3281 if [ "$docs" = "yes" ] ; then
3282 echo "BUILD_DOCS=yes" >> $config_host_mak
3284 if test "$sdl" = "yes" ; then
3285 echo "CONFIG_SDL=y" >> $config_host_mak
3286 echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
3288 if test "$cocoa" = "yes" ; then
3289 echo "CONFIG_COCOA=y" >> $config_host_mak
3291 if test "$curses" = "yes" ; then
3292 echo "CONFIG_CURSES=y" >> $config_host_mak
3294 if test "$atfile" = "yes" ; then
3295 echo "CONFIG_ATFILE=y" >> $config_host_mak
3297 if test "$utimens" = "yes" ; then
3298 echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
3300 if test "$pipe2" = "yes" ; then
3301 echo "CONFIG_PIPE2=y" >> $config_host_mak
3303 if test "$accept4" = "yes" ; then
3304 echo "CONFIG_ACCEPT4=y" >> $config_host_mak
3306 if test "$splice" = "yes" ; then
3307 echo "CONFIG_SPLICE=y" >> $config_host_mak
3309 if test "$eventfd" = "yes" ; then
3310 echo "CONFIG_EVENTFD=y" >> $config_host_mak
3312 if test "$fallocate" = "yes" ; then
3313 echo "CONFIG_FALLOCATE=y" >> $config_host_mak
3315 if test "$sync_file_range" = "yes" ; then
3316 echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
3318 if test "$fiemap" = "yes" ; then
3319 echo "CONFIG_FIEMAP=y" >> $config_host_mak
3321 if test "$dup3" = "yes" ; then
3322 echo "CONFIG_DUP3=y" >> $config_host_mak
3324 if test "$epoll" = "yes" ; then
3325 echo "CONFIG_EPOLL=y" >> $config_host_mak
3327 if test "$epoll_create1" = "yes" ; then
3328 echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak
3330 if test "$epoll_pwait" = "yes" ; then
3331 echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak
3333 if test "$inotify" = "yes" ; then
3334 echo "CONFIG_INOTIFY=y" >> $config_host_mak
3336 if test "$inotify1" = "yes" ; then
3337 echo "CONFIG_INOTIFY1=y" >> $config_host_mak
3339 if test "$byteswap_h" = "yes" ; then
3340 echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
3342 if test "$bswap_h" = "yes" ; then
3343 echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
3345 if test "$curl" = "yes" ; then
3346 echo "CONFIG_CURL=y" >> $config_host_mak
3347 echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
3349 if test "$brlapi" = "yes" ; then
3350 echo "CONFIG_BRLAPI=y" >> $config_host_mak
3352 if test "$bluez" = "yes" ; then
3353 echo "CONFIG_BLUEZ=y" >> $config_host_mak
3354 echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
3356 echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
3357 if test "$xen" = "yes" ; then
3358 echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
3359 echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
3361 if test "$linux_aio" = "yes" ; then
3362 echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
3364 if test "$attr" = "yes" ; then
3365 echo "CONFIG_ATTR=y" >> $config_host_mak
3367 if test "$libattr" = "yes" ; then
3368 echo "CONFIG_LIBATTR=y" >> $config_host_mak
3370 if test "$virtfs" = "yes" ; then
3371 echo "CONFIG_VIRTFS=y" >> $config_host_mak
3373 if test "$blobs" = "yes" ; then
3374 echo "INSTALL_BLOBS=yes" >> $config_host_mak
3376 if test "$iovec" = "yes" ; then
3377 echo "CONFIG_IOVEC=y" >> $config_host_mak
3379 if test "$preadv" = "yes" ; then
3380 echo "CONFIG_PREADV=y" >> $config_host_mak
3382 if test "$fdt" = "yes" ; then
3383 echo "CONFIG_FDT=y" >> $config_host_mak
3385 if test "$signalfd" = "yes" ; then
3386 echo "CONFIG_SIGNALFD=y" >> $config_host_mak
3388 if test "$tcg_interpreter" = "yes" ; then
3389 echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
3391 if test "$fdatasync" = "yes" ; then
3392 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
3394 if test "$madvise" = "yes" ; then
3395 echo "CONFIG_MADVISE=y" >> $config_host_mak
3397 if test "$posix_madvise" = "yes" ; then
3398 echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak
3401 if test "$spice" = "yes" ; then
3402 echo "CONFIG_SPICE=y" >> $config_host_mak
3405 if test "$smartcard" = "yes" ; then
3406 echo "CONFIG_SMARTCARD=y" >> $config_host_mak
3409 if test "$smartcard_nss" = "yes" ; then
3410 echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
3411 echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
3412 echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak
3415 if test "$usb_redir" = "yes" ; then
3416 echo "CONFIG_USB_REDIR=y" >> $config_host_mak
3419 if test "$opengl" = "yes" ; then
3420 echo "CONFIG_OPENGL=y" >> $config_host_mak
3423 if test "$libiscsi" = "yes" ; then
3424 echo "CONFIG_LIBISCSI=y" >> $config_host_mak
3427 # XXX: suppress that
3428 if [ "$bsd" = "yes" ] ; then
3429 echo "CONFIG_BSD=y" >> $config_host_mak
3432 echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
3434 if test "$zero_malloc" = "yes" ; then
3435 echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
3437 if test "$rbd" = "yes" ; then
3438 echo "CONFIG_RBD=y" >> $config_host_mak
3441 if test "$coroutine_backend" = "ucontext" ; then
3442 echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
3443 elif test "$coroutine_backend" = "sigaltstack" ; then
3444 echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak
3447 if test "$open_by_handle_at" = "yes" ; then
3448 echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak
3451 if test "$linux_magic_h" = "yes" ; then
3452 echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
3455 if test "$pragma_disable_unused_but_set" = "yes" ; then
3456 echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak
3459 if test "$valgrind_h" = "yes" ; then
3460 echo "CONFIG_VALGRIND_H=y" >> $config_host_mak
3463 if test "$has_environ" = "yes" ; then
3464 echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak
3470 echo "HOST_USB=linux" >> $config_host_mak
3473 echo "HOST_USB=bsd" >> $config_host_mak
3476 echo "HOST_USB=stub" >> $config_host_mak
3480 # use default implementation for tracing backend-specific routines
3482 echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
3483 if test "$trace_backend" = "nop"; then
3484 echo "CONFIG_TRACE_NOP=y" >> $config_host_mak
3486 if test "$trace_backend" = "simple"; then
3487 echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak
3489 # Set the appropriate trace file.
3490 trace_file
="\"$trace_file-\" FMT_pid"
3492 if test "$trace_backend" = "stderr"; then
3493 echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak
3496 if test "$trace_backend" = "ust"; then
3497 echo "CONFIG_TRACE_UST=y" >> $config_host_mak
3499 if test "$trace_backend" = "dtrace"; then
3500 echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak
3501 if test "$trace_backend_stap" = "yes" ; then
3502 echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak
3505 echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
3506 if test "$trace_default" = "yes"; then
3507 echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
3510 echo "TOOLS=$tools" >> $config_host_mak
3511 echo "ROMS=$roms" >> $config_host_mak
3512 echo "MAKE=$make" >> $config_host_mak
3513 echo "INSTALL=$install" >> $config_host_mak
3514 echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak
3515 echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak
3516 echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
3517 echo "PYTHON=$python" >> $config_host_mak
3518 echo "CC=$cc" >> $config_host_mak
3519 echo "CC_I386=$cc_i386" >> $config_host_mak
3520 echo "HOST_CC=$host_cc" >> $config_host_mak
3521 echo "AR=$ar" >> $config_host_mak
3522 echo "OBJCOPY=$objcopy" >> $config_host_mak
3523 echo "LD=$ld" >> $config_host_mak
3524 echo "WINDRES=$windres" >> $config_host_mak
3525 echo "LIBTOOL=$libtool" >> $config_host_mak
3526 echo "CFLAGS=$CFLAGS" >> $config_host_mak
3527 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
3528 echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
3529 if test "$sparse" = "yes" ; then
3530 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
3531 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
3532 echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
3534 echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
3535 echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
3536 echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
3537 echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
3538 echo "LIBS+=$LIBS" >> $config_host_mak
3539 echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
3540 echo "EXESUF=$EXESUF" >> $config_host_mak
3541 echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
3542 echo "POD2MAN=$POD2MAN" >> $config_host_mak
3544 # generate list of library paths for linker script
3546 $ld --verbose -v 2> /dev
/null |
grep SEARCH_DIR
> ${config_host_ld}
3548 if test -f ${config_host_ld}~
; then
3549 if cmp -s $config_host_ld ${config_host_ld}~
; then
3550 mv ${config_host_ld}~
$config_host_ld
3552 rm ${config_host_ld}~
3556 for d
in libdis libdis-user
; do
3557 symlink
"$source_path/Makefile.dis" "$d/Makefile"
3558 echo > $d/config.mak
3561 # use included Linux headers
3562 if test "$linux" = "yes" ; then
3563 mkdir
-p linux-headers
3566 symlink
"$source_path/linux-headers/asm-x86" linux-headers
/asm
3569 symlink
"$source_path/linux-headers/asm-powerpc" linux-headers
/asm
3572 symlink
"$source_path/linux-headers/asm-s390" linux-headers
/asm
3577 for target
in $target_list; do
3578 target_dir
="$target"
3579 config_target_mak
=$target_dir/config-target.mak
3580 target_arch2
=`echo $target | cut -d '-' -f 1`
3581 target_bigendian
="no"
3583 case "$target_arch2" in
3584 armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb
)
3585 target_bigendian
=yes
3589 target_user_only
="no"
3590 target_linux_user
="no"
3591 target_bsd_user
="no"
3593 ${target_arch2}-softmmu)
3594 target_softmmu
="yes"
3596 ${target_arch2}-linux-user)
3597 if test "$linux" != "yes" ; then
3598 echo "ERROR: Target '$target' is only available on a Linux host"
3601 target_user_only
="yes"
3602 target_linux_user
="yes"
3604 ${target_arch2}-bsd-user)
3605 if test "$bsd" != "yes" ; then
3606 echo "ERROR: Target '$target' is only available on a BSD host"
3609 target_user_only
="yes"
3610 target_bsd_user
="yes"
3613 echo "ERROR: Target '$target' not recognised"
3618 mkdir
-p $target_dir
3619 echo "# Automatically generated by configure - do not modify" > $config_target_mak
3623 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
3625 target_short_alignment
=2
3626 target_int_alignment
=4
3627 target_long_alignment
=4
3628 target_llong_alignment
=8
3629 target_libs_softmmu
=
3631 TARGET_ARCH
="$target_arch2"
3635 case "$target_arch2" in
3640 TARGET_BASE_ARCH
=i386
3642 target_long_alignment
=8
3646 target_long_alignment
=8
3653 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
3655 target_llong_alignment
=4
3656 target_libs_softmmu
="$fdt_libs"
3664 target_libs_softmmu
="$opengl_libs"
3668 gdb_xml_files
="cf-core.xml cf-fp.xml"
3670 target_int_alignment
=2
3671 target_long_alignment
=2
3672 target_llong_alignment
=2
3674 microblaze|microblazeel
)
3675 TARGET_ARCH
=microblaze
3679 target_libs_softmmu
="$fdt_libs"
3683 echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
3689 TARGET_BASE_ARCH
=mips
3690 echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
3695 TARGET_BASE_ARCH
=mips
3696 echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
3698 target_long_alignment
=8
3701 TARGET_ARCH
=openrisc
3702 TARGET_BASE_ARCH
=openrisc
3706 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3709 target_libs_softmmu
="$fdt_libs"
3712 TARGET_BASE_ARCH
=ppc
3714 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3717 target_libs_softmmu
="$fdt_libs"
3720 TARGET_BASE_ARCH
=ppc
3722 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3724 target_long_alignment
=8
3725 target_libs_softmmu
="$fdt_libs"
3729 TARGET_BASE_ARCH
=ppc
3731 echo "TARGET_ABI32=y" >> $config_target_mak
3732 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3734 target_libs_softmmu
="$fdt_libs"
3746 TARGET_BASE_ARCH
=sparc
3748 target_long_alignment
=8
3752 TARGET_BASE_ARCH
=sparc
3753 TARGET_ABI_DIR
=sparc
3754 echo "TARGET_ABI32=y" >> $config_target_mak
3760 target_long_alignment
=8
3770 echo "Unsupported target CPU"
3774 # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
3775 if [ "$TARGET_BASE_ARCH" = "" ]; then
3776 TARGET_BASE_ARCH
=$TARGET_ARCH
3779 symlink
"$source_path/Makefile.target" "$target_dir/Makefile"
3782 case "$target_arch2" in
3783 alpha | or32 | sparc
* | xtensa
* | ppc
*)
3784 echo "CONFIG_TCG_PASS_AREG0=y" >> $config_target_mak
3788 echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
3789 echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
3790 echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
3791 echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
3792 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
3793 target_arch_name
="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`"
3794 echo "TARGET_$target_arch_name=y" >> $config_target_mak
3795 echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
3796 echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
3797 if [ "$TARGET_ABI_DIR" = "" ]; then
3798 TARGET_ABI_DIR
=$TARGET_ARCH
3800 echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
3801 case "$target_arch2" in
3803 if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
3805 echo "CONFIG_XEN=y" >> $config_target_mak
3806 if test "$xen_pci_passthrough" = yes; then
3807 echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak"
3810 echo "CONFIG_NO_XEN=y" >> $config_target_mak
3814 echo "CONFIG_NO_XEN=y" >> $config_target_mak
3816 case "$target_arch2" in
3817 i386|x86_64|ppcemb|ppc|ppc64|s390x
)
3818 # Make sure the target and host cpus are compatible
3819 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
3820 \
( "$target_arch2" = "$cpu" -o \
3821 \
( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \
) -o \
3822 \
( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \
) -o \
3823 \
( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \
) -o \
3824 \
( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \
) -o \
3825 \
( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \
) -o \
3826 \
( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
3827 echo "CONFIG_KVM=y" >> $config_target_mak
3828 if test "$vhost_net" = "yes" ; then
3829 echo "CONFIG_VHOST_NET=y" >> $config_target_mak
3833 case "$target_arch2" in
3835 echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak
3837 if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
3838 echo "CONFIG_PSERIES=y" >> $config_target_mak
3840 if test "$target_bigendian" = "yes" ; then
3841 echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
3843 if test "$target_softmmu" = "yes" ; then
3844 echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
3845 echo "CONFIG_SOFTMMU=y" >> $config_target_mak
3846 echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
3847 echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
3848 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
3849 if test "$smartcard_nss" = "yes" ; then
3850 echo "subdir-$target: subdir-libcacard" >> $config_host_mak
3852 case "$target_arch2" in
3854 echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak
3857 if test "$target_user_only" = "yes" ; then
3858 echo "CONFIG_USER_ONLY=y" >> $config_target_mak
3859 echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
3861 if test "$target_linux_user" = "yes" ; then
3862 echo "CONFIG_LINUX_USER=y" >> $config_target_mak
3865 if test ! -z "$gdb_xml_files" ; then
3866 for x
in $gdb_xml_files; do
3867 list
="$list $source_path/gdb-xml/$x"
3869 echo "TARGET_XML_FILES=$list" >> $config_target_mak
3872 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
3873 echo "TARGET_HAS_BFLT=y" >> $config_target_mak
3875 if test "$target_user_only" = "yes" \
3876 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
3877 echo "CONFIG_USE_NPTL=y" >> $config_target_mak
3879 if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
3880 echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
3882 if test "$target_bsd_user" = "yes" ; then
3883 echo "CONFIG_BSD_USER=y" >> $config_target_mak
3886 # generate QEMU_CFLAGS/LDFLAGS for targets
3892 if test "$tcg_interpreter" = "yes"; then
3893 includes
="-I\$(SRC_PATH)/tcg/tci $includes"
3894 elif test "$ARCH" = "sparc64" ; then
3895 includes
="-I\$(SRC_PATH)/tcg/sparc $includes"
3896 elif test "$ARCH" = "s390x" ; then
3897 includes
="-I\$(SRC_PATH)/tcg/s390 $includes"
3898 elif test "$ARCH" = "x86_64" ; then
3899 includes
="-I\$(SRC_PATH)/tcg/i386 $includes"
3901 includes
="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
3903 includes
="-I\$(SRC_PATH)/tcg $includes"
3905 if test "$linux" = "yes" ; then
3906 includes
="-I\$(SRC_PATH)/linux-headers $includes"
3909 if test "$target_user_only" = "yes" ; then
3910 libdis_config_mak
=libdis-user
/config.mak
3912 libdis_config_mak
=libdis
/config.mak
3915 for i
in $ARCH $TARGET_BASE_ARCH ; do
3918 echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak
3919 echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak
3922 echo "CONFIG_ARM_DIS=y" >> $config_target_mak
3923 echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak
3926 echo "CONFIG_CRIS_DIS=y" >> $config_target_mak
3927 echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak
3930 echo "CONFIG_HPPA_DIS=y" >> $config_target_mak
3931 echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak
3934 echo "CONFIG_I386_DIS=y" >> $config_target_mak
3935 echo "CONFIG_I386_DIS=y" >> $libdis_config_mak
3938 echo "CONFIG_IA64_DIS=y" >> $config_target_mak
3939 echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak
3942 echo "CONFIG_LM32_DIS=y" >> $config_target_mak
3943 echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak
3946 echo "CONFIG_M68K_DIS=y" >> $config_target_mak
3947 echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak
3950 echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak
3951 echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak
3954 echo "CONFIG_MIPS_DIS=y" >> $config_target_mak
3955 echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak
3958 echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak
3959 echo "CONFIG_OPENRISC_DIS=y" >> $libdis_config_mak
3962 echo "CONFIG_PPC_DIS=y" >> $config_target_mak
3963 echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak
3966 echo "CONFIG_S390_DIS=y" >> $config_target_mak
3967 echo "CONFIG_S390_DIS=y" >> $libdis_config_mak
3970 echo "CONFIG_SH4_DIS=y" >> $config_target_mak
3971 echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak
3974 echo "CONFIG_SPARC_DIS=y" >> $config_target_mak
3975 echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak
3978 echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak
3979 echo "CONFIG_XTENSA_DIS=y" >> $libdis_config_mak
3983 if test "$tcg_interpreter" = "yes" ; then
3984 echo "CONFIG_TCI_DIS=y" >> $config_target_mak
3985 echo "CONFIG_TCI_DIS=y" >> $libdis_config_mak
3990 # Ensure there's only a single GP
3991 cflags
="-msmall-data $cflags"
3995 if test "$target_softmmu" = "yes" ; then
3996 case "$TARGET_BASE_ARCH" in
3998 cflags
="-DHAS_AUDIO $cflags"
4001 cflags
="-DHAS_AUDIO $cflags"
4004 cflags
="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
4009 if test "$gprof" = "yes" ; then
4010 echo "TARGET_GPROF=yes" >> $config_target_mak
4011 if test "$target_linux_user" = "yes" ; then
4013 ldflags
="-p $ldflags"
4015 if test "$target_softmmu" = "yes" ; then
4016 ldflags
="-p $ldflags"
4017 echo "GPROF_CFLAGS=-p" >> $config_target_mak
4021 if test "$ARCH" = "tci"; then
4024 linker_script
="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
4027 if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
4030 # -static is used to avoid g1/g3 usage by the dynamic linker
4031 ldflags
="$linker_script -static $ldflags"
4034 # The default placement of the application is fine.
4037 ldflags
="$linker_script $ldflags"
4042 echo "LDFLAGS+=$ldflags" >> $config_target_mak
4043 echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
4044 echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
4046 done # for target in $targets
4048 # build tree in object directory in case the source is not in the current directory
4049 DIRS
="tests tests/tcg tests/tcg/cris tests/tcg/lm32"
4050 DIRS
="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"
4051 DIRS
="$DIRS roms/seabios roms/vgabios"
4052 DIRS
="$DIRS qapi-generated"
4053 DIRS
="$DIRS libcacard libcacard/libcacard libcacard/trace"
4054 FILES
="Makefile tests/tcg/Makefile qdict-test-data.txt"
4055 FILES
="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit"
4056 FILES
="$FILES tests/tcg/lm32/Makefile libcacard/Makefile"
4057 FILES
="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
4058 FILES
="$FILES pc-bios/spapr-rtas/Makefile"
4059 FILES
="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
4061 $source_path/pc-bios
/*.bin \
4062 $source_path/pc-bios
/*.rom \
4063 $source_path/pc-bios
/*.dtb \
4064 $source_path/pc-bios
/openbios-
* \
4065 $source_path/pc-bios
/palcode-
*
4067 FILES
="$FILES pc-bios/`basename $bios_file`"
4070 for f
in $FILES ; do
4071 if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then
4072 symlink
"$source_path/$f" "$f"
4076 # temporary config to build submodules
4077 for rom
in seabios vgabios
; do
4078 config_mak
=roms
/$rom/config.mak
4079 echo "# Automatically generated by configure - do not modify" > $config_mak
4080 echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
4081 echo "CC=$cc" >> $config_mak
4082 echo "BCC=bcc" >> $config_mak
4083 echo "CPP=${cross_prefix}cpp" >> $config_mak
4084 echo "OBJCOPY=objcopy" >> $config_mak
4085 echo "IASL=iasl" >> $config_mak
4086 echo "LD=$ld" >> $config_mak
4089 for hwlib
in 32 64; do
4091 symlink
"$source_path/Makefile.hw" "$d/Makefile"
4092 echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
4096 symlink
"$source_path/Makefile.user" "$d/Makefile"
4098 if test "$docs" = "yes" ; then