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
24 echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log
25 $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log
2>&1
31 echo $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log
32 $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log
2>&1
35 # check whether a command is available to this shell (may be either an
36 # executable or a builtin)
38 type "$1" >/dev
/null
2>&1
41 # search for an executable in PATH
47 # pathname has a dir component?
48 if [ "${local_command#*/}" != "$local_command" ]; then
49 if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then
54 if [ -z "$local_command" ]; then
59 for local_dir
in $PATH; do
60 if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then
61 echo "$local_dir/$local_command"
62 IFS
="${local_ifs:-$(printf ' \t\n')}"
67 IFS
="${local_ifs:-$(printf ' \t\n')}"
73 interp_prefix
="/usr/gnemul/qemu-%M"
79 audio_card_list
="ac97 es1370 sb16"
80 audio_possible_cards
="ac97 es1370 sb16 cs4231a adlib gus"
81 block_drv_whitelist
=""
96 # parse CC options first
98 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
100 --cross-prefix=*) cross_prefix
="$optarg"
104 --cpu=*) cpu
="$optarg"
106 --extra-cflags=*) QEMU_CFLAGS
="$optarg $QEMU_CFLAGS"
108 --extra-ldflags=*) LDFLAGS
="$optarg $LDFLAGS"
113 v7|v8|v8plus|v8plusa
)
120 echo "undefined SPARC architecture. Exiting";
128 # Using uname is really, really broken. Once we have the right set of checks
129 # we can eliminate it's usage altogether
131 cc
="${cross_prefix}${cc}"
132 ar="${cross_prefix}${ar}"
133 objcopy
="${cross_prefix}${objcopy}"
134 ld
="${cross_prefix}${ld}"
135 strip
="${cross_prefix}${strip}"
136 windres
="${cross_prefix}${windres}"
138 # default flags for all hosts
139 QEMU_CFLAGS
="-fno-strict-aliasing $QEMU_CFLAGS"
141 QEMU_CFLAGS
="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
142 QEMU_CFLAGS
="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
143 QEMU_CFLAGS
="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
144 QEMU_CFLAGS
="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
145 QEMU_CFLAGS
="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
146 LDFLAGS
="-g $LDFLAGS"
148 gcc_flags
="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
149 gcc_flags
="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
150 gcc_flags
="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
151 gcc_flags
="-fstack-protector-all $gcc_flags"
153 int main(void) { return 0; }
155 for flag
in $gcc_flags; do
156 if compile_prog
"-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
157 QEMU_CFLAGS
="$QEMU_CFLAGS $flag"
161 # check that the C compiler works.
166 if compile_object
; then
167 : C compiler works ok
169 echo "ERROR: \"$cc\" either does not exist or does not work"
178 int main(void) { return 0; }
183 if test ! -z "$cpu" ; then
184 # command line argument
186 elif check_define __i386__
; then
188 elif check_define __x86_64__
; then
190 elif check_define __sparc__
; then
191 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
192 # They must be specified using --sparc_cpu
193 if check_define __arch64__
; then
198 elif check_define _ARCH_PPC
; then
199 if check_define _ARCH_PPC64
; then
204 elif check_define __mips__
; then
206 elif check_define __ia64__
; then
208 elif check_define __s390__
; then
209 if check_define __s390x__
; then
220 alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64
)
223 i386|i486|i586|i686|i86pc|BePC
)
251 echo "Unsupported CPU = $cpu"
256 # Default value for a variable defining feature "foo".
257 # * foo="no" feature will only be used if --enable-foo arg is given
258 # * foo="" feature will be searched for, and if found, will be used
259 # unless --disable-foo is given
260 # * foo="yes" this value will only be set by --enable-foo flag.
261 # feature will searched for,
262 # if not found, configure exits with error
264 # Always add --enable-foo and --disable-foo command line args.
265 # Distributions want to ensure that several features are compiled in, and it
266 # is impossible without a --enable-foo that exits if a feature is not found.
300 mandir
="\${prefix}/share/man"
301 datadir
="\${prefix}/share/qemu"
302 docdir
="\${prefix}/share/doc/qemu"
303 bindir
="\${prefix}/bin"
304 sysconfdir
="\${prefix}/etc"
336 if check_define __linux__
; then
338 elif check_define _WIN32
; then
340 elif check_define __OpenBSD__
; then
342 elif check_define __sun__
; then
344 elif check_define __HAIKU__
; then
353 QEMU_CFLAGS
="-mno-cygwin $QEMU_CFLAGS"
354 audio_possible_drivers
="winwave sdl"
355 audio_drv_list
="winwave"
359 audio_possible_drivers
="winwave dsound sdl fmod"
360 audio_drv_list
="winwave"
365 audio_possible_drivers
="oss sdl esd pa"
371 audio_possible_drivers
="oss sdl esd pa"
372 # needed for kinfo_getvmmap(3) in libutil.h
379 audio_possible_drivers
="oss sdl esd pa"
385 audio_possible_drivers
="oss sdl esd"
392 audio_possible_drivers
="oss sdl esd"
398 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can
399 # run 64-bit userspace code
400 if [ "$cpu" = "i386" ] ; then
401 is_x86_64
=`sysctl -n hw.optional.x86_64`
402 [ "$is_x86_64" = "1" ] && cpu
=x86_64
404 if [ "$cpu" = "x86_64" ] ; then
405 QEMU_CFLAGS
="-arch x86_64 $QEMU_CFLAGS"
406 LDFLAGS
="-arch x86_64 $LDFLAGS"
408 QEMU_CFLAGS
="-mdynamic-no-pic $QEMU_CFLAGS"
412 audio_drv_list
="coreaudio"
413 audio_possible_drivers
="coreaudio sdl fmod"
414 LDFLAGS
="-framework CoreFoundation -framework IOKit $LDFLAGS"
415 libs_softmmu
="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
422 needs_libsunmath
="no"
423 solarisrev
=`uname -r | cut -f2 -d.`
424 # have to select again, because `uname -m` returns i86pc
425 # even on an x86_64 box.
426 solariscpu
=`isainfo -k`
427 if test "${solariscpu}" = "amd64" ; then
430 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
431 if test "$solarisrev" -le 9 ; then
432 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
433 needs_libsunmath
="yes"
434 QEMU_CFLAGS
="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS"
435 LDFLAGS
="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
436 LIBS
="-lsunmath $LIBS"
438 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
439 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
440 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
441 echo "Studio 11 can be downloaded from www.sun.com."
446 if test -f /usr
/include
/sys
/soundcard.h
; then
449 audio_possible_drivers
="oss sdl"
450 # needed for CMSG_ macros in sys/socket.h
451 QEMU_CFLAGS
="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
452 # needed for TIOCWIN* defines in termios.h
453 QEMU_CFLAGS
="-D__EXTENSIONS__ $QEMU_CFLAGS"
454 QEMU_CFLAGS
="-std=gnu99 $QEMU_CFLAGS"
455 LIBS
="-lsocket -lnsl -lresolv $LIBS"
463 QEMU_CFLAGS
="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
464 LIBS
="-lposix_error_mapper -lnetwork $LIBS"
468 audio_possible_drivers
="oss alsa sdl esd pa"
472 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
473 audio_possible_drivers
="$audio_possible_drivers fmod"
478 if [ "$bsd" = "yes" ] ; then
479 if [ "$darwin" != "yes" ] ; then
485 if test "$mingw32" = "yes" ; then
487 QEMU_CFLAGS
="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
488 # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
489 QEMU_CFLAGS
="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
490 LIBS
="-lwinmm -lws2_32 -liphlpapi $LIBS"
491 prefix
="c:/Program Files/Qemu"
496 sysconfdir
="\${prefix}"
501 source_path
=`dirname "$0"`
502 source_path_used
="no"
504 if [ -z "$source_path" ]; then
507 source_path
=`cd "$source_path"; pwd`
509 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
514 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
516 --help|
-h) show_help
=yes
518 --prefix=*) prefix
="$optarg"
520 --interp-prefix=*) interp_prefix
="$optarg"
522 --source-path=*) source_path
="$optarg"
523 source_path_used
="yes"
529 --host-cc=*) host_cc
="$optarg"
531 --make=*) make="$optarg"
533 --install=*) install="$optarg"
541 --target-list=*) target_list
="$optarg"
543 --trace-backend=*) trace_backend
="$optarg"
545 --trace-file=*) trace_file
="$optarg"
547 --enable-gprof) gprof
="yes"
551 LDFLAGS
="-static $LDFLAGS"
553 --mandir=*) mandir
="$optarg"
555 --bindir=*) bindir
="$optarg"
557 --datadir=*) datadir
="$optarg"
559 --docdir=*) docdir
="$optarg"
561 --sysconfdir=*) sysconfdir
="$optarg"
563 --disable-sdl) sdl
="no"
565 --enable-sdl) sdl
="yes"
567 --fmod-lib=*) fmod_lib
="$optarg"
569 --fmod-inc=*) fmod_inc
="$optarg"
571 --oss-lib=*) oss_lib
="$optarg"
573 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
575 --audio-drv-list=*) audio_drv_list
="$optarg"
577 --block-drv-whitelist=*) block_drv_whitelist
=`echo "$optarg" | sed -e 's/,/ /g'`
579 --enable-debug-tcg) debug_tcg
="yes"
581 --disable-debug-tcg) debug_tcg
="no"
583 --enable-debug-mon) debug_mon
="yes"
585 --disable-debug-mon) debug_mon
="no"
588 # Enable debugging options that aren't excessively noisy
594 --enable-sparse) sparse
="yes"
596 --disable-sparse) sparse
="no"
598 --disable-strip) strip_opt
="no"
600 --disable-vnc-tls) vnc_tls
="no"
602 --enable-vnc-tls) vnc_tls
="yes"
604 --disable-vnc-sasl) vnc_sasl
="no"
606 --enable-vnc-sasl) vnc_sasl
="yes"
608 --disable-vnc-jpeg) vnc_jpeg
="no"
610 --enable-vnc-jpeg) vnc_jpeg
="yes"
612 --disable-vnc-png) vnc_png
="no"
614 --enable-vnc-png) vnc_png
="yes"
616 --disable-vnc-thread) vnc_thread
="no"
618 --enable-vnc-thread) vnc_thread
="yes"
620 --disable-slirp) slirp
="no"
622 --disable-uuid) uuid
="no"
624 --enable-uuid) uuid
="yes"
626 --disable-vde) vde
="no"
628 --enable-vde) vde
="yes"
630 --disable-xen) xen
="no"
632 --enable-xen) xen
="yes"
634 --disable-brlapi) brlapi
="no"
636 --enable-brlapi) brlapi
="yes"
638 --disable-bluez) bluez
="no"
640 --enable-bluez) bluez
="yes"
642 --disable-kvm) kvm
="no"
644 --enable-kvm) kvm
="yes"
646 --disable-spice) spice
="no"
648 --enable-spice) spice
="yes"
650 --enable-profiler) profiler
="yes"
655 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
657 --disable-system) softmmu
="no"
659 --enable-system) softmmu
="yes"
667 --disable-linux-user) linux_user
="no"
669 --enable-linux-user) linux_user
="yes"
671 --disable-darwin-user) darwin_user
="no"
673 --enable-darwin-user) darwin_user
="yes"
675 --disable-bsd-user) bsd_user
="no"
677 --enable-bsd-user) bsd_user
="yes"
679 --enable-guest-base) guest_base
="yes"
681 --disable-guest-base) guest_base
="no"
683 --enable-user-pie) user_pie
="yes"
685 --disable-user-pie) user_pie
="no"
687 --enable-uname-release=*) uname_release
="$optarg"
691 --enable-werror) werror
="yes"
693 --disable-werror) werror
="no"
695 --disable-curses) curses
="no"
697 --enable-curses) curses
="yes"
699 --disable-curl) curl
="no"
701 --enable-curl) curl
="yes"
703 --disable-fdt) fdt
="no"
705 --enable-fdt) fdt
="yes"
707 --disable-check-utests) check_utests
="no"
709 --enable-check-utests) check_utests
="yes"
711 --disable-nptl) nptl
="no"
713 --enable-nptl) nptl
="yes"
715 --enable-mixemu) mixemu
="yes"
717 --disable-linux-aio) linux_aio
="no"
719 --enable-linux-aio) linux_aio
="yes"
721 --disable-attr) attr
="no"
723 --enable-attr) attr
="yes"
725 --enable-io-thread) io_thread
="yes"
727 --disable-blobs) blobs
="no"
729 --kerneldir=*) kerneldir
="$optarg"
731 --with-pkgversion=*) pkgversion
=" ($optarg)"
733 --disable-docs) docs
="no"
735 --enable-docs) docs
="yes"
737 --disable-vhost-net) vhost_net
="no"
739 --enable-vhost-net) vhost_net
="yes"
743 *) echo "ERROR: unknown option $opt"; show_help
="yes"
749 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
750 # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
754 sparc
) case $sparc_cpu in
756 QEMU_CFLAGS
="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
759 QEMU_CFLAGS
="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
761 *) # sparc_cpu not defined in the command line
762 QEMU_CFLAGS
="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
764 LDFLAGS
="-m32 $LDFLAGS"
765 QEMU_CFLAGS
="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
766 if test "$solaris" = "no" ; then
767 QEMU_CFLAGS
="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
768 helper_cflags
="-ffixed-i0"
772 QEMU_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
773 LDFLAGS
="-m64 $LDFLAGS"
774 QEMU_CFLAGS
="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
775 if test "$solaris" != "no" ; then
776 QEMU_CFLAGS
="-ffixed-g1 $QEMU_CFLAGS"
780 QEMU_CFLAGS
="-m31 -march=z990 $QEMU_CFLAGS"
781 LDFLAGS
="-m31 $LDFLAGS"
782 host_guest_base
="yes"
785 QEMU_CFLAGS
="-m64 -march=z990 $QEMU_CFLAGS"
786 LDFLAGS
="-m64 $LDFLAGS"
787 host_guest_base
="yes"
790 QEMU_CFLAGS
="-m32 $QEMU_CFLAGS"
791 LDFLAGS
="-m32 $LDFLAGS"
792 helper_cflags
="-fomit-frame-pointer"
793 host_guest_base
="yes"
796 QEMU_CFLAGS
="-m64 $QEMU_CFLAGS"
797 LDFLAGS
="-m64 $LDFLAGS"
798 host_guest_base
="yes"
801 host_guest_base
="yes"
804 host_guest_base
="yes"
807 host_guest_base
="yes"
810 host_guest_base
="yes"
813 host_guest_base
="yes"
817 [ -z "$guest_base" ] && guest_base
="$host_guest_base"
819 if test x
"$show_help" = x
"yes" ; then
822 Usage: configure [options]
823 Options: [defaults in brackets after descriptions]
826 echo "Standard options:"
827 echo " --help print this message"
828 echo " --prefix=PREFIX install in PREFIX [$prefix]"
829 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
830 echo " use %M for cpu name [$interp_prefix]"
831 echo " --target-list=LIST set target list [$target_list]"
833 echo "Advanced options (experts only):"
834 echo " --source-path=PATH path of source code [$source_path]"
835 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
836 echo " --cc=CC use C compiler CC [$cc]"
837 echo " --host-cc=CC use C compiler CC [$host_cc] for code run at"
839 echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS"
840 echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS"
841 echo " --make=MAKE use specified make [$make]"
842 echo " --install=INSTALL use specified install [$install]"
843 echo " --static enable static build [$static]"
844 echo " --mandir=PATH install man pages in PATH"
845 echo " --datadir=PATH install firmware in PATH"
846 echo " --docdir=PATH install documentation in PATH"
847 echo " --bindir=PATH install binaries in PATH"
848 echo " --sysconfdir=PATH install config in PATH/qemu"
849 echo " --enable-debug-tcg enable TCG debugging"
850 echo " --disable-debug-tcg disable TCG debugging (default)"
851 echo " --enable-debug enable common debug build options"
852 echo " --enable-sparse enable sparse checker"
853 echo " --disable-sparse disable sparse checker (default)"
854 echo " --disable-strip disable stripping binaries"
855 echo " --disable-werror disable compilation abort on warning"
856 echo " --disable-sdl disable SDL"
857 echo " --enable-sdl enable SDL"
858 echo " --enable-cocoa enable COCOA (Mac OS X only)"
859 echo " --audio-drv-list=LIST set audio drivers list:"
860 echo " Available drivers: $audio_possible_drivers"
861 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
862 echo " Available cards: $audio_possible_cards"
863 echo " --block-drv-whitelist=L set block driver whitelist"
864 echo " (affects only QEMU, not qemu-img)"
865 echo " --enable-mixemu enable mixer emulation"
866 echo " --disable-xen disable xen backend driver support"
867 echo " --enable-xen enable xen backend driver support"
868 echo " --disable-brlapi disable BrlAPI"
869 echo " --enable-brlapi enable BrlAPI"
870 echo " --disable-vnc-tls disable TLS encryption for VNC server"
871 echo " --enable-vnc-tls enable TLS encryption for VNC server"
872 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
873 echo " --enable-vnc-sasl enable SASL encryption for VNC server"
874 echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server"
875 echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server"
876 echo " --disable-vnc-png disable PNG compression for VNC server (default)"
877 echo " --enable-vnc-png enable PNG compression for VNC server"
878 echo " --disable-vnc-thread disable threaded VNC server"
879 echo " --enable-vnc-thread enable threaded VNC server"
880 echo " --disable-curses disable curses output"
881 echo " --enable-curses enable curses output"
882 echo " --disable-curl disable curl connectivity"
883 echo " --enable-curl enable curl connectivity"
884 echo " --disable-fdt disable fdt device tree"
885 echo " --enable-fdt enable fdt device tree"
886 echo " --disable-check-utests disable check unit-tests"
887 echo " --enable-check-utests enable check unit-tests"
888 echo " --disable-bluez disable bluez stack connectivity"
889 echo " --enable-bluez enable bluez stack connectivity"
890 echo " --disable-kvm disable KVM acceleration support"
891 echo " --enable-kvm enable KVM acceleration support"
892 echo " --disable-nptl disable usermode NPTL support"
893 echo " --enable-nptl enable usermode NPTL support"
894 echo " --enable-system enable all system emulation targets"
895 echo " --disable-system disable all system emulation targets"
896 echo " --enable-user enable supported user emulation targets"
897 echo " --disable-user disable all user emulation targets"
898 echo " --enable-linux-user enable all linux usermode emulation targets"
899 echo " --disable-linux-user disable all linux usermode emulation targets"
900 echo " --enable-darwin-user enable all darwin usermode emulation targets"
901 echo " --disable-darwin-user disable all darwin usermode emulation targets"
902 echo " --enable-bsd-user enable all BSD usermode emulation targets"
903 echo " --disable-bsd-user disable all BSD usermode emulation targets"
904 echo " --enable-guest-base enable GUEST_BASE support for usermode"
905 echo " emulation targets"
906 echo " --disable-guest-base disable GUEST_BASE support"
907 echo " --enable-user-pie build usermode emulation targets as PIE"
908 echo " --disable-user-pie do not build usermode emulation targets as PIE"
909 echo " --fmod-lib path to FMOD library"
910 echo " --fmod-inc path to FMOD includes"
911 echo " --oss-lib path to OSS library"
912 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
913 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
914 echo " --disable-uuid disable uuid support"
915 echo " --enable-uuid enable uuid support"
916 echo " --disable-vde disable support for vde network"
917 echo " --enable-vde enable support for vde network"
918 echo " --disable-linux-aio disable Linux AIO support"
919 echo " --enable-linux-aio enable Linux AIO support"
920 echo " --disable-attr disables attr and xattr support"
921 echo " --enable-attr enable attr and xattr support"
922 echo " --enable-io-thread enable IO thread"
923 echo " --disable-blobs disable installing provided firmware blobs"
924 echo " --kerneldir=PATH look for kernel includes in PATH"
925 echo " --enable-docs enable documentation build"
926 echo " --disable-docs disable documentation build"
927 echo " --disable-vhost-net disable vhost-net acceleration support"
928 echo " --enable-vhost-net enable vhost-net acceleration support"
929 echo " --trace-backend=B Trace backend nop simple ust"
930 echo " --trace-file=NAME Full PATH,NAME of file to store traces"
931 echo " Default:trace-<pid>"
932 echo " --disable-spice disable spice"
933 echo " --enable-spice enable spice"
935 echo "NOTE: The object files are built at the place where configure is launched"
940 # Solaris specific configure tool chain decisions
942 if test "$solaris" = "yes" ; then
943 if has
$install; then
946 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
947 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
948 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
951 if test "`path_of $install`" = "/usr/sbin/install" ; then
952 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
953 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
954 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
960 echo "Error: No path includes ar"
961 if test -f /usr
/ccs
/bin
/ar ; then
962 echo "Add /usr/ccs/bin to your path and rerun configure"
969 if test -z "$target_list" ; then
970 # these targets are portable
971 if [ "$softmmu" = "yes" ] ; then
992 # the following are Linux specific
993 if [ "$linux_user" = "yes" ] ; then
994 target_list
="${target_list}\
1002 microblaze-linux-user \
1007 ppc64abi32-linux-user \
1011 sparc64-linux-user \
1012 sparc32plus-linux-user \
1015 # the following are Darwin specific
1016 if [ "$darwin_user" = "yes" ] ; then
1017 target_list
="$target_list i386-darwin-user ppc-darwin-user "
1019 # the following are BSD specific
1020 if [ "$bsd_user" = "yes" ] ; then
1021 target_list
="${target_list}\
1029 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
1031 if test -z "$target_list" ; then
1032 echo "No targets enabled"
1035 # see if system emulation was really requested
1036 case " $target_list " in
1037 *"-softmmu "*) softmmu
=yes
1043 feature_not_found
() {
1047 echo "ERROR: User requested feature $feature"
1048 echo "ERROR: configure was not able to find it"
1053 if test -z "$cross_prefix" ; then
1056 # big/little endian test
1058 #include <inttypes.h>
1059 int main(int argc, char ** argv){
1060 volatile uint32_t i=0x01234567;
1061 return (*((uint8_t*)(&i))) == 0x67;
1065 if compile_prog
"" "" ; then
1066 $TMPE && bigendian
="yes"
1068 echo big
/little
test failed
1073 # if cross compiling, cannot launch a program, so make a static guess
1075 armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64
)
1082 # host long bits test
1085 x86_64|alpha|ia64|sparc64|ppc64|s390x
)
1091 ##########################################
1094 if test "$nptl" != "no" ; then
1097 #include <linux/futex.h>
1100 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
1106 if compile_object
; then
1109 if test "$nptl" = "yes" ; then
1110 feature_not_found
"nptl"
1116 ##########################################
1121 int main(void) { zlibVersion(); return 0; }
1123 if compile_prog
"" "-lz" ; then
1127 echo "Error: zlib check failed"
1128 echo "Make sure to have the zlib libs and headers installed."
1133 ##########################################
1136 if test "$xen" != "no" ; then
1137 xen_libs
="-lxenstore -lxenctrl -lxenguest"
1139 #include <xenctrl.h>
1141 int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
1143 if compile_prog
"" "$xen_libs" ; then
1145 libs_softmmu
="$xen_libs $libs_softmmu"
1147 if test "$xen" = "yes" ; then
1148 feature_not_found
"xen"
1154 ##########################################
1157 pkgconfig
="${cross_prefix}pkg-config"
1158 if ! has
$pkgconfig; then
1159 # likely not cross compiling, or hope for the best
1160 pkgconfig
=pkg-config
1163 ##########################################
1165 if test "$sparse" != "no" ; then
1169 if test "$sparse" = "yes" ; then
1170 feature_not_found
"sparse"
1176 ##########################################
1179 # Look for sdl configuration program (pkg-config or sdl-config).
1180 # Prefer variant with cross prefix if cross compiling,
1181 # and favour pkg-config with sdl over sdl-config.
1182 if test -n "$cross_prefix" -a $pkgconfig != pkg-config
&& \
1183 $pkgconfig sdl
--modversion >/dev
/null
2>&1; then
1184 sdlconfig
="$pkgconfig sdl"
1185 _sdlversion
=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1186 elif test -n "$cross_prefix" && has
${cross_prefix}sdl-config
; then
1187 sdlconfig
="${cross_prefix}sdl-config"
1188 _sdlversion
=`$sdlconfig --version | sed 's/[^0-9]//g'`
1189 elif $pkgconfig sdl
--modversion >/dev
/null
2>&1; then
1190 sdlconfig
="$pkgconfig sdl"
1191 _sdlversion
=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1192 elif has sdl-config
; then
1193 sdlconfig
='sdl-config'
1194 _sdlversion
=`$sdlconfig --version | sed 's/[^0-9]//g'`
1196 if test "$sdl" = "yes" ; then
1197 feature_not_found
"sdl"
1203 if test "$sdl" != "no" ; then
1206 #undef main /* We don't want SDL to override our main() */
1207 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1209 sdl_cflags
=`$sdlconfig --cflags 2> /dev/null`
1210 if test "$static" = "yes" ; then
1211 sdl_libs
=`$sdlconfig --static-libs 2>/dev/null`
1213 sdl_libs
=`$sdlconfig --libs 2> /dev/null`
1215 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1216 if test "$_sdlversion" -lt 121 ; then
1219 if test "$cocoa" = "no" ; then
1224 # static link with sdl ? (note: sdl.pc's --static --libs is broken)
1225 if test "$sdl" = "yes" -a "$static" = "yes" ; then
1226 if test $?
= 0 && echo $sdl_libs |
grep -- -laa > /dev
/null
; then
1227 sdl_libs
="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
1228 sdl_cflags
="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
1230 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1236 else # sdl not found
1237 if test "$sdl" = "yes" ; then
1238 feature_not_found
"sdl"
1241 fi # sdl compile test
1244 if test "$sdl" = "yes" ; then
1247 #if defined(SDL_VIDEO_DRIVER_X11)
1248 #include <X11/XKBlib.h>
1250 #error No x11 support
1252 int main(void) { return 0; }
1254 if compile_prog
"$sdl_cflags" "$sdl_libs" ; then
1255 sdl_libs
="$sdl_libs -lX11"
1257 if test "$mingw32" = "yes" ; then
1258 sdl_libs
="`echo $sdl_libs | sed s/-mwindows//g` -mconsole"
1260 libs_softmmu
="$sdl_libs $libs_softmmu"
1263 ##########################################
1265 if test "$vnc_tls" != "no" ; then
1267 #include <gnutls/gnutls.h>
1268 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1270 vnc_tls_cflags
=`$pkgconfig --cflags gnutls 2> /dev/null`
1271 vnc_tls_libs
=`$pkgconfig --libs gnutls 2> /dev/null`
1272 if compile_prog
"$vnc_tls_cflags" "$vnc_tls_libs" ; then
1274 libs_softmmu
="$vnc_tls_libs $libs_softmmu"
1276 if test "$vnc_tls" = "yes" ; then
1277 feature_not_found
"vnc-tls"
1283 ##########################################
1284 # VNC SASL detection
1285 if test "$vnc_sasl" != "no" ; then
1287 #include <sasl/sasl.h>
1289 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
1291 # Assuming Cyrus-SASL installed in /usr prefix
1293 vnc_sasl_libs
="-lsasl2"
1294 if compile_prog
"$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
1296 libs_softmmu
="$vnc_sasl_libs $libs_softmmu"
1298 if test "$vnc_sasl" = "yes" ; then
1299 feature_not_found
"vnc-sasl"
1305 ##########################################
1306 # VNC JPEG detection
1307 if test "$vnc_jpeg" != "no" ; then
1310 #include <jpeglib.h>
1311 int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; }
1314 vnc_jpeg_libs
="-ljpeg"
1315 if compile_prog
"$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
1317 libs_softmmu
="$vnc_jpeg_libs $libs_softmmu"
1319 if test "$vnc_jpeg" = "yes" ; then
1320 feature_not_found
"vnc-jpeg"
1326 ##########################################
1328 if test "$vnc_png" != "no" ; then
1330 //#include <stdio.h>
1334 png_structp png_ptr;
1335 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
1340 vnc_png_libs
="-lpng"
1341 if compile_prog
"$vnc_png_cflags" "$vnc_png_libs" ; then
1343 libs_softmmu
="$vnc_png_libs $libs_softmmu"
1345 if test "$vnc_png" = "yes" ; then
1346 feature_not_found
"vnc-png"
1352 ##########################################
1353 # fnmatch() probe, used for ACL routines
1356 #include <fnmatch.h>
1359 fnmatch("foo", "foo", 0);
1363 if compile_prog
"" "" ; then
1367 ##########################################
1368 # uuid_generate() probe, used for vdi block driver
1369 if test "$uuid" != "no" ; then
1372 #include <uuid/uuid.h>
1376 uuid_generate(my_uuid);
1380 if compile_prog
"" "$uuid_libs" ; then
1382 libs_softmmu
="$uuid_libs $libs_softmmu"
1383 libs_tools
="$uuid_libs $libs_tools"
1385 if test "$uuid" = "yes" ; then
1386 feature_not_found
"uuid"
1392 ##########################################
1393 # vde libraries probe
1394 if test "$vde" != "no" ; then
1395 vde_libs
="-lvdeplug"
1397 #include <libvdeplug.h>
1400 struct vde_open_args a = {0, 0, 0};
1401 vde_open("", "", &a);
1405 if compile_prog
"" "$vde_libs" ; then
1407 libs_softmmu
="$vde_libs $libs_softmmu"
1408 libs_tools
="$vde_libs $libs_tools"
1410 if test "$vde" = "yes" ; then
1411 feature_not_found
"vde"
1417 ##########################################
1418 # Sound support libraries probe
1429 int main(void) { $exp }
1431 if compile_prog
"$cfl" "$lib" ; then
1435 echo "Error: $drv check failed"
1436 echo "Make sure to have the $drv libs and headers installed."
1442 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1443 for drv
in $audio_drv_list; do
1446 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
1447 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1448 libs_softmmu
="-lasound $libs_softmmu"
1452 if test -z $fmod_lib ||
test -z $fmod_inc; then
1454 echo "Error: You must specify path to FMOD library and headers"
1455 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1459 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1460 libs_softmmu
="$fmod_lib $libs_softmmu"
1464 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
1465 libs_softmmu
="-lesd $libs_softmmu"
1470 audio_drv_probe
$drv pulse
/simple.h
"-lpulse-simple -lpulse" \
1471 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1472 libs_softmmu
="-lpulse -lpulse-simple $libs_softmmu"
1477 libs_softmmu
="-framework CoreAudio $libs_softmmu"
1481 libs_softmmu
="-lole32 -ldxguid $libs_softmmu"
1486 libs_softmmu
="$oss_lib $libs_softmmu"
1490 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1494 libs_softmmu
="-lwinmm $libs_softmmu"
1499 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
1501 echo "Error: Unknown driver '$drv' selected"
1502 echo "Possible drivers are: $audio_possible_drivers"
1510 ##########################################
1513 if test "$brlapi" != "no" ; then
1514 brlapi_libs
="-lbrlapi"
1518 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1520 if compile_prog
"" "$brlapi_libs" ; then
1522 libs_softmmu
="$brlapi_libs $libs_softmmu"
1524 if test "$brlapi" = "yes" ; then
1525 feature_not_found
"brlapi"
1531 ##########################################
1533 curses_list
="-lncurses -lcurses"
1535 if test "$curses" != "no" ; then
1540 #define resize_term resizeterm
1542 int main(void) { resize_term(0, 0); return curses_version(); }
1544 for curses_lib
in $curses_list; do
1545 if compile_prog
"" "$curses_lib" ; then
1547 libs_softmmu
="$curses_lib $libs_softmmu"
1551 if test "$curses_found" = "yes" ; then
1554 if test "$curses" = "yes" ; then
1555 feature_not_found
"curses"
1561 ##########################################
1564 if $pkgconfig libcurl
--modversion >/dev
/null
2>&1; then
1565 curlconfig
="$pkgconfig libcurl"
1567 curlconfig
=curl-config
1570 if test "$curl" != "no" ; then
1572 #include <curl/curl.h>
1573 int main(void) { return curl_easy_init(); }
1575 curl_cflags
=`$curlconfig --cflags 2>/dev/null`
1576 curl_libs
=`$curlconfig --libs 2>/dev/null`
1577 if compile_prog
"$curl_cflags" "$curl_libs" ; then
1579 libs_tools
="$curl_libs $libs_tools"
1580 libs_softmmu
="$curl_libs $libs_softmmu"
1582 if test "$curl" = "yes" ; then
1583 feature_not_found
"curl"
1589 ##########################################
1590 # check framework probe
1592 if test "$check_utests" != "no" ; then
1595 int main(void) { suite_create("qemu test"); return 0; }
1597 check_libs
=`$pkgconfig --libs check`
1598 if compile_prog
"" $check_libs ; then
1600 libs_tools
="$check_libs $libs_tools"
1602 if test "$check_utests" = "yes" ; then
1603 feature_not_found
"check"
1607 fi # test "$check_utests"
1609 ##########################################
1610 # bluez support probe
1611 if test "$bluez" != "no" ; then
1613 #include <bluetooth/bluetooth.h>
1614 int main(void) { return bt_error(0); }
1616 bluez_cflags
=`$pkgconfig --cflags bluez 2> /dev/null`
1617 bluez_libs
=`$pkgconfig --libs bluez 2> /dev/null`
1618 if compile_prog
"$bluez_cflags" "$bluez_libs" ; then
1620 libs_softmmu
="$bluez_libs $libs_softmmu"
1622 if test "$bluez" = "yes" ; then
1623 feature_not_found
"bluez"
1629 ##########################################
1631 if test "$kvm" != "no" ; then
1633 #include <linux/kvm.h>
1634 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1635 #error Invalid KVM version
1637 #if !defined(KVM_CAP_USER_MEMORY)
1638 #error Missing KVM capability KVM_CAP_USER_MEMORY
1640 #if !defined(KVM_CAP_SET_TSS_ADDR)
1641 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1643 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1644 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1646 int main(void) { return 0; }
1648 if test "$kerneldir" != "" ; then
1649 kvm_cflags
=-I"$kerneldir"/include
1650 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) \
1651 -a -d "$kerneldir/arch/x86/include" ; then
1652 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/x86/include"
1653 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1654 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1655 elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
1656 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/s390/include"
1657 elif test -d "$kerneldir/arch/$cpu/include" ; then
1658 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1661 kvm_cflags
=`$pkgconfig --cflags kvm-kmod 2>/dev/null`
1663 if compile_prog
"$kvm_cflags" "" ; then
1666 #include <linux/kvm_para.h>
1667 int main(void) { return 0; }
1669 if compile_prog
"$kvm_cflags" "" ; then
1673 if test "$kvm" = "yes" ; then
1674 if has
awk && has
grep; then
1675 kvmerr
=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
1677 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1678 if test "$kvmerr" != "" ; then
1679 echo -e "${kvmerr}\n\
1680 NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
1681 recent kvm-kmod from http://sourceforge.net/projects/kvm."
1684 feature_not_found
"kvm"
1690 ##########################################
1691 # test for vhost net
1693 if test "$vhost_net" != "no"; then
1694 if test "$kvm" != "no"; then
1696 #include <linux/vhost.h>
1697 int main(void) { return 0; }
1699 if compile_prog
"$kvm_cflags" "" ; then
1702 if test "$vhost_net" = "yes" ; then
1703 feature_not_found
"vhost-net"
1708 if test "$vhost_net" = "yes" ; then
1709 echo "NOTE: vhost-net feature requires KVM (--enable-kvm)."
1710 feature_not_found
"vhost-net"
1716 ##########################################
1718 PTHREADLIBS_LIST
="-lpthread -lpthreadGC2"
1722 #include <pthread.h>
1723 int main(void) { pthread_create(0,0,0,0); return 0; }
1725 if compile_prog
"" "" ; then
1728 for pthread_lib
in $PTHREADLIBS_LIST; do
1729 if compile_prog
"" "$pthread_lib" ; then
1731 LIBS
="$pthread_lib $LIBS"
1737 if test "$mingw32" != yes -a "$pthread" = no
; then
1739 echo "Error: pthread check failed"
1740 echo "Make sure to have the pthread libs and headers installed."
1745 ##########################################
1748 if test "$linux_aio" != "no" ; then
1751 #include <sys/eventfd.h>
1753 int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
1755 if compile_prog
"" "-laio" ; then
1757 libs_softmmu
="$libs_softmmu -laio"
1758 libs_tools
="$libs_tools -laio"
1760 if test "$linux_aio" = "yes" ; then
1761 feature_not_found
"linux AIO"
1767 ##########################################
1770 if test "$attr" != "no" ; then
1773 #include <sys/types.h>
1774 #include <attr/xattr.h>
1775 int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }
1777 if compile_prog
"" "-lattr" ; then
1781 if test "$attr" = "yes" ; then
1782 feature_not_found
"ATTR"
1788 ##########################################
1791 #include <sys/types.h>
1792 #include <sys/uio.h>
1794 int main(void) { struct iovec iov; return 0; }
1797 if compile_prog
"" "" ; then
1801 ##########################################
1804 #include <sys/types.h>
1805 #include <sys/uio.h>
1807 int main(void) { preadv; }
1810 if compile_prog
"" "" ; then
1814 ##########################################
1816 if test "$fdt" != "no" ; then
1819 int main(void) { return 0; }
1821 if compile_prog
"" "$fdt_libs" ; then
1823 libs_softmmu
="$fdt_libs $libs_softmmu"
1825 if test "$fdt" = "yes" ; then
1826 feature_not_found
"fdt"
1833 # Check for xxxat() functions when we are building linux-user
1834 # emulator. This is done because older glibc versions don't
1835 # have syscall stubs for these implemented.
1839 #define _ATFILE_SOURCE
1840 #include <sys/types.h>
1847 /* try to unlink nonexisting file */
1848 return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
1851 if compile_prog
"" "" ; then
1855 # Check for inotify functions when we are building linux-user
1856 # emulator. This is done because older glibc versions don't
1857 # have syscall stubs for these implemented. In that case we
1858 # don't provide them even if kernel supports them.
1862 #include <sys/inotify.h>
1867 /* try to start inotify */
1868 return inotify_init();
1871 if compile_prog
"" "" ; then
1877 #include <sys/inotify.h>
1882 /* try to start inotify */
1883 return inotify_init1(0);
1886 if compile_prog
"" "" ; then
1890 # check if utimensat and futimens are supported
1893 #define _ATFILE_SOURCE
1899 utimensat(AT_FDCWD, "foo", NULL, 0);
1904 if compile_prog
"" "" ; then
1908 # check if pipe2 is there
1917 pipe2(pipefd, O_CLOEXEC);
1921 if compile_prog
"" "" ; then
1925 # check if accept4 is there
1928 #include <sys/socket.h>
1933 accept4(0, NULL, NULL, SOCK_CLOEXEC);
1937 if compile_prog
"" "" ; then
1941 # check if tee/splice is there. vmsplice was added same time.
1951 len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
1952 splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
1956 if compile_prog
"" "" ; then
1960 ##########################################
1966 #include <sys/syscall.h>
1968 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1971 if compile_prog
"" "" ; then
1975 # check if eventfd is supported
1978 #include <sys/eventfd.h>
1982 int efd = eventfd(0, 0);
1986 if compile_prog
"" "" ; then
1990 # check for fallocate
1997 fallocate(0, 0, 0, 0);
2001 if compile_prog
"$ARCH_CFLAGS" "" ; then
2016 if compile_prog
"" "" ; then
2020 # Check if tools are available to build documentation.
2021 if test "$docs" != "no" ; then
2022 if has makeinfo
&& has pod2man
; then
2025 if test "$docs" = "yes" ; then
2026 feature_not_found
"docs"
2032 # Search for bswap_32 function
2035 #include <byteswap.h>
2036 int main(void) { return bswap_32(0); }
2038 if compile_prog
"" "" ; then
2042 # Search for bswap_32 function
2045 #include <sys/endian.h>
2046 #include <sys/types.h>
2047 #include <machine/bswap.h>
2048 int main(void) { return bswap32(0); }
2050 if compile_prog
"" "" ; then
2054 ##########################################
2059 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
2062 if compile_prog
"" "" ; then
2064 elif compile_prog
"" "-lrt" ; then
2068 if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
2069 "$aix" != "yes" -a "$haiku" != "yes" ; then
2070 libs_softmmu
="-lutil $libs_softmmu"
2073 ##########################################
2074 # check if the compiler defines offsetof
2079 int main(void) { struct s { int f; }; return offsetof(struct s, f); }
2081 if compile_prog
"" "" ; then
2085 ##########################################
2086 # check if the compiler understands attribute warn_unused_result
2088 # This could be smarter, but gcc -Werror does not error out even when warning
2089 # about attribute warn_unused_result
2091 gcc_attribute_warn_unused_result
=no
2093 #if defined(__GNUC__) && (__GNUC__ < 4) && defined(__GNUC_MINOR__) && (__GNUC__ < 4)
2094 #error gcc 3.3 or older
2096 int main(void) { return 0;}
2098 if compile_prog
"" ""; then
2099 gcc_attribute_warn_unused_result
=yes
2103 if test "$spice" != "no" ; then
2106 int main(void) { spice_server_new(); return 0; }
2108 spice_cflags
=$
($pkgconfig --cflags spice-protocol spice-server
2>/dev
/null
)
2109 spice_libs
=$
($pkgconfig --libs spice-protocol spice-server
2>/dev
/null
)
2110 if $pkgconfig --atleast-version=0.5.3 spice-server
>/dev
/null
2>&1 && \
2111 compile_prog
"$spice_cflags" "$spice_libs" ; then
2113 libs_softmmu
="$libs_softmmu $spice_libs"
2114 QEMU_CFLAGS
="$QEMU_CFLAGS $spice_cflags"
2116 if test "$spice" = "yes" ; then
2117 feature_not_found
"spice"
2123 ##########################################
2125 ##########################################
2126 # check if we have fdatasync
2131 int main(void) { return fdatasync(0); }
2133 if compile_prog
"" "" ; then
2137 ##########################################
2138 # check if we have madvise
2142 #include <sys/types.h>
2143 #include <sys/mman.h>
2145 int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }
2147 if compile_prog
"" "" ; then
2151 ##########################################
2152 # check if we have posix_madvise
2156 #include <sys/mman.h>
2158 int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }
2160 if compile_prog
"" "" ; then
2164 ##########################################
2165 # check if trace backend exists
2167 sh
"$source_path/tracetool" "--$trace_backend" --check-backend > /dev
/null
2> /dev
/null
2168 if test "$?" -ne 0 ; then
2170 echo "Error: invalid trace backend"
2171 echo "Please choose a supported trace backend."
2176 ##########################################
2177 # For 'ust' backend, test if ust headers are present
2178 if test "$trace_backend" = "ust"; then
2180 #include <ust/tracepoint.h>
2181 #include <ust/marker.h>
2182 int main(void) { return 0; }
2184 if compile_prog
"" "" ; then
2188 echo "Error: Trace backend 'ust' missing libust header files"
2193 ##########################################
2195 # After here, no more $cc or $ld runs
2197 if test "$debug" = "no" ; then
2198 CFLAGS
="-O2 $CFLAGS"
2201 # Consult white-list to determine whether to enable werror
2202 # by default. Only enable by default for git builds
2203 z_version
=`cut -f3 -d. $source_path/VERSION`
2205 if test -z "$werror" ; then
2206 if test "$z_version" = "50" -a \
2207 "$linux" = "yes" ; then
2214 # Disable zero malloc errors for official releases unless explicitly told to
2216 if test -z "$zero_malloc" ; then
2217 if test "$z_version" = "50" ; then
2224 if test "$werror" = "yes" ; then
2225 QEMU_CFLAGS
="-Werror $QEMU_CFLAGS"
2228 if test "$solaris" = "no" ; then
2229 if $ld --version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
2230 LDFLAGS
="-Wl,--warn-common $LDFLAGS"
2234 # Use ASLR, no-SEH and DEP if available
2235 if test "$mingw32" = "yes" ; then
2236 for flag
in --dynamicbase --no-seh --nxcompat; do
2237 if $ld --help 2>/dev
/null |
grep ".$flag" >/dev
/null
2>/dev
/null
; then
2238 LDFLAGS
="-Wl,$flag $LDFLAGS"
2243 confdir
=$sysconfdir$confsuffix
2246 if test "$softmmu" = yes ; then
2247 tools
="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
2248 if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
2249 tools
="qemu-nbd\$(EXESUF) $tools"
2250 if [ "$check_utests" = "yes" ]; then
2251 tools
="check-qint check-qstring check-qdict check-qlist $tools"
2252 tools
="check-qfloat check-qjson $tools"
2257 # Mac OS X ships with a broken assembler
2259 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) -a \
2260 "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
2261 "$softmmu" = yes ; then
2266 echo "Install prefix $prefix"
2267 echo "BIOS directory `eval echo $datadir`"
2268 echo "binary directory `eval echo $bindir`"
2269 echo "config directory `eval echo $sysconfdir`"
2270 if test "$mingw32" = "no" ; then
2271 echo "Manual directory `eval echo $mandir`"
2272 echo "ELF interp prefix $interp_prefix"
2274 echo "Source path $source_path"
2275 echo "C compiler $cc"
2276 echo "Host C compiler $host_cc"
2277 echo "CFLAGS $CFLAGS"
2278 echo "QEMU_CFLAGS $QEMU_CFLAGS"
2279 echo "LDFLAGS $LDFLAGS"
2281 echo "install $install"
2282 echo "host CPU $cpu"
2283 echo "host big endian $bigendian"
2284 echo "target list $target_list"
2285 echo "tcg debug enabled $debug_tcg"
2286 echo "Mon debug enabled $debug_mon"
2287 echo "gprof enabled $gprof"
2288 echo "sparse enabled $sparse"
2289 echo "strip binaries $strip_opt"
2290 echo "profiler $profiler"
2291 echo "static build $static"
2292 echo "-Werror enabled $werror"
2293 if test "$darwin" = "yes" ; then
2294 echo "Cocoa support $cocoa"
2296 echo "SDL support $sdl"
2297 echo "curses support $curses"
2298 echo "curl support $curl"
2299 echo "check support $check_utests"
2300 echo "mingw32 support $mingw32"
2301 echo "Audio drivers $audio_drv_list"
2302 echo "Extra audio cards $audio_card_list"
2303 echo "Block whitelist $block_drv_whitelist"
2304 echo "Mixer emulation $mixemu"
2305 echo "VNC TLS support $vnc_tls"
2306 echo "VNC SASL support $vnc_sasl"
2307 echo "VNC JPEG support $vnc_jpeg"
2308 echo "VNC PNG support $vnc_png"
2309 echo "VNC thread $vnc_thread"
2310 if test -n "$sparc_cpu"; then
2311 echo "Target Sparc Arch $sparc_cpu"
2313 echo "xen support $xen"
2314 echo "brlapi support $brlapi"
2315 echo "bluez support $bluez"
2316 echo "Documentation $docs"
2317 [ ! -z "$uname_release" ] && \
2318 echo "uname -r $uname_release"
2319 echo "NPTL support $nptl"
2320 echo "GUEST_BASE $guest_base"
2321 echo "PIE user targets $user_pie"
2322 echo "vde support $vde"
2323 echo "IO thread $io_thread"
2324 echo "Linux AIO support $linux_aio"
2325 echo "ATTR/XATTR support $attr"
2326 echo "Install blobs $blobs"
2327 echo "KVM support $kvm"
2328 echo "fdt support $fdt"
2329 echo "preadv support $preadv"
2330 echo "fdatasync $fdatasync"
2331 echo "madvise $madvise"
2332 echo "posix_madvise $posix_madvise"
2333 echo "uuid support $uuid"
2334 echo "vhost-net support $vhost_net"
2335 echo "Trace backend $trace_backend"
2336 echo "Trace output file $trace_file-<pid>"
2337 echo "spice support $spice"
2339 if test $sdl_too_old = "yes"; then
2340 echo "-> Your SDL version is too old - please upgrade to have SDL support"
2343 config_host_mak
="config-host.mak"
2344 config_host_ld
="config-host.ld"
2346 echo "# Automatically generated by configure - do not modify" > $config_host_mak
2347 printf "# Configured with:" >> $config_host_mak
2348 printf " '%s'" "$0" "$@" >> $config_host_mak
2349 echo >> $config_host_mak
2351 echo "prefix=$prefix" >> $config_host_mak
2352 echo "bindir=$bindir" >> $config_host_mak
2353 echo "mandir=$mandir" >> $config_host_mak
2354 echo "datadir=$datadir" >> $config_host_mak
2355 echo "sysconfdir=$sysconfdir" >> $config_host_mak
2356 echo "docdir=$docdir" >> $config_host_mak
2357 echo "confdir=$confdir" >> $config_host_mak
2360 i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64
)
2367 echo "ARCH=$ARCH" >> $config_host_mak
2368 if test "$debug_tcg" = "yes" ; then
2369 echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
2371 if test "$debug_mon" = "yes" ; then
2372 echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
2374 if test "$debug" = "yes" ; then
2375 echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
2377 if test "$strip_opt" = "yes" ; then
2378 echo "STRIP=${strip}" >> $config_host_mak
2380 if test "$bigendian" = "yes" ; then
2381 echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
2383 echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
2384 if test "$mingw32" = "yes" ; then
2385 echo "CONFIG_WIN32=y" >> $config_host_mak
2386 rc_version
=`cat $source_path/VERSION`
2387 version_major
=${rc_version%%.*}
2388 rc_version
=${rc_version#*.}
2389 version_minor
=${rc_version%%.*}
2390 rc_version
=${rc_version#*.}
2391 version_subminor
=${rc_version%%.*}
2393 echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
2394 echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
2396 echo "CONFIG_POSIX=y" >> $config_host_mak
2399 if test "$linux" = "yes" ; then
2400 echo "CONFIG_LINUX=y" >> $config_host_mak
2403 if test "$darwin" = "yes" ; then
2404 echo "CONFIG_DARWIN=y" >> $config_host_mak
2407 if test "$aix" = "yes" ; then
2408 echo "CONFIG_AIX=y" >> $config_host_mak
2411 if test "$solaris" = "yes" ; then
2412 echo "CONFIG_SOLARIS=y" >> $config_host_mak
2413 echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
2414 if test "$needs_libsunmath" = "yes" ; then
2415 echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
2418 if test "$haiku" = "yes" ; then
2419 echo "CONFIG_HAIKU=y" >> $config_host_mak
2421 if test "$static" = "yes" ; then
2422 echo "CONFIG_STATIC=y" >> $config_host_mak
2424 if test $profiler = "yes" ; then
2425 echo "CONFIG_PROFILER=y" >> $config_host_mak
2427 if test "$slirp" = "yes" ; then
2428 echo "CONFIG_SLIRP=y" >> $config_host_mak
2429 QEMU_CFLAGS
="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
2431 if test "$vde" = "yes" ; then
2432 echo "CONFIG_VDE=y" >> $config_host_mak
2434 for card
in $audio_card_list; do
2435 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
2436 echo "$def=y" >> $config_host_mak
2438 echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
2439 for drv
in $audio_drv_list; do
2440 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
2441 echo "$def=y" >> $config_host_mak
2442 if test "$drv" = "fmod"; then
2443 echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
2446 if test "$audio_pt_int" = "yes" ; then
2447 echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
2449 if test "$audio_win_int" = "yes" ; then
2450 echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
2452 echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
2453 if test "$mixemu" = "yes" ; then
2454 echo "CONFIG_MIXEMU=y" >> $config_host_mak
2456 if test "$vnc_tls" = "yes" ; then
2457 echo "CONFIG_VNC_TLS=y" >> $config_host_mak
2458 echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
2460 if test "$vnc_sasl" = "yes" ; then
2461 echo "CONFIG_VNC_SASL=y" >> $config_host_mak
2462 echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
2464 if test "$vnc_jpeg" != "no" ; then
2465 echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
2466 echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
2468 if test "$vnc_png" != "no" ; then
2469 echo "CONFIG_VNC_PNG=y" >> $config_host_mak
2470 echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
2472 if test "$vnc_thread" != "no" ; then
2473 echo "CONFIG_VNC_THREAD=y" >> $config_host_mak
2474 echo "CONFIG_THREAD=y" >> $config_host_mak
2476 if test "$fnmatch" = "yes" ; then
2477 echo "CONFIG_FNMATCH=y" >> $config_host_mak
2479 if test "$uuid" = "yes" ; then
2480 echo "CONFIG_UUID=y" >> $config_host_mak
2482 qemu_version
=`head $source_path/VERSION`
2483 echo "VERSION=$qemu_version" >>$config_host_mak
2484 echo "PKGVERSION=$pkgversion" >>$config_host_mak
2485 echo "SRC_PATH=$source_path" >> $config_host_mak
2486 echo "TARGET_DIRS=$target_list" >> $config_host_mak
2487 if [ "$docs" = "yes" ] ; then
2488 echo "BUILD_DOCS=yes" >> $config_host_mak
2490 if test "$sdl" = "yes" ; then
2491 echo "CONFIG_SDL=y" >> $config_host_mak
2492 echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
2494 if test "$cocoa" = "yes" ; then
2495 echo "CONFIG_COCOA=y" >> $config_host_mak
2497 if test "$curses" = "yes" ; then
2498 echo "CONFIG_CURSES=y" >> $config_host_mak
2500 if test "$atfile" = "yes" ; then
2501 echo "CONFIG_ATFILE=y" >> $config_host_mak
2503 if test "$utimens" = "yes" ; then
2504 echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
2506 if test "$pipe2" = "yes" ; then
2507 echo "CONFIG_PIPE2=y" >> $config_host_mak
2509 if test "$accept4" = "yes" ; then
2510 echo "CONFIG_ACCEPT4=y" >> $config_host_mak
2512 if test "$splice" = "yes" ; then
2513 echo "CONFIG_SPLICE=y" >> $config_host_mak
2515 if test "$eventfd" = "yes" ; then
2516 echo "CONFIG_EVENTFD=y" >> $config_host_mak
2518 if test "$fallocate" = "yes" ; then
2519 echo "CONFIG_FALLOCATE=y" >> $config_host_mak
2521 if test "$dup3" = "yes" ; then
2522 echo "CONFIG_DUP3=y" >> $config_host_mak
2524 if test "$inotify" = "yes" ; then
2525 echo "CONFIG_INOTIFY=y" >> $config_host_mak
2527 if test "$inotify1" = "yes" ; then
2528 echo "CONFIG_INOTIFY1=y" >> $config_host_mak
2530 if test "$byteswap_h" = "yes" ; then
2531 echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
2533 if test "$bswap_h" = "yes" ; then
2534 echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
2536 if test "$curl" = "yes" ; then
2537 echo "CONFIG_CURL=y" >> $config_host_mak
2538 echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
2540 if test "$brlapi" = "yes" ; then
2541 echo "CONFIG_BRLAPI=y" >> $config_host_mak
2543 if test "$bluez" = "yes" ; then
2544 echo "CONFIG_BLUEZ=y" >> $config_host_mak
2545 echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
2547 if test "$xen" = "yes" ; then
2548 echo "CONFIG_XEN=y" >> $config_host_mak
2550 if test "$io_thread" = "yes" ; then
2551 echo "CONFIG_IOTHREAD=y" >> $config_host_mak
2552 echo "CONFIG_THREAD=y" >> $config_host_mak
2554 if test "$linux_aio" = "yes" ; then
2555 echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
2557 if test "$attr" = "yes" ; then
2558 echo "CONFIG_ATTR=y" >> $config_host_mak
2560 if test "$linux" = "yes" ; then
2561 if test "$attr" = "yes" ; then
2562 echo "CONFIG_VIRTFS=y" >> $config_host_mak
2565 if test "$blobs" = "yes" ; then
2566 echo "INSTALL_BLOBS=yes" >> $config_host_mak
2568 if test "$iovec" = "yes" ; then
2569 echo "CONFIG_IOVEC=y" >> $config_host_mak
2571 if test "$preadv" = "yes" ; then
2572 echo "CONFIG_PREADV=y" >> $config_host_mak
2574 if test "$fdt" = "yes" ; then
2575 echo "CONFIG_FDT=y" >> $config_host_mak
2577 if test "$signalfd" = "yes" ; then
2578 echo "CONFIG_SIGNALFD=y" >> $config_host_mak
2580 if test "$need_offsetof" = "yes" ; then
2581 echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
2583 if test "$gcc_attribute_warn_unused_result" = "yes" ; then
2584 echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
2586 if test "$fdatasync" = "yes" ; then
2587 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
2589 if test "$madvise" = "yes" ; then
2590 echo "CONFIG_MADVISE=y" >> $config_host_mak
2592 if test "$posix_madvise" = "yes" ; then
2593 echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak
2596 if test "$spice" = "yes" ; then
2597 echo "CONFIG_SPICE=y" >> $config_host_mak
2600 # XXX: suppress that
2601 if [ "$bsd" = "yes" ] ; then
2602 echo "CONFIG_BSD=y" >> $config_host_mak
2605 echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
2607 if test "$zero_malloc" = "yes" ; then
2608 echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
2614 echo "HOST_USB=linux" >> $config_host_mak
2617 echo "HOST_USB=bsd" >> $config_host_mak
2620 echo "HOST_USB=stub" >> $config_host_mak
2624 echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
2625 if test "$trace_backend" = "simple"; then
2626 echo "CONFIG_SIMPLE_TRACE=y" >> $config_host_mak
2628 # Set the appropriate trace file.
2629 if test "$trace_backend" = "simple"; then
2630 trace_file
="\"$trace_file-%u\""
2632 echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
2634 echo "TOOLS=$tools" >> $config_host_mak
2635 echo "ROMS=$roms" >> $config_host_mak
2636 echo "MAKE=$make" >> $config_host_mak
2637 echo "INSTALL=$install" >> $config_host_mak
2638 echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
2639 echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
2640 echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
2641 echo "CC=$cc" >> $config_host_mak
2642 echo "HOST_CC=$host_cc" >> $config_host_mak
2643 if test "$sparse" = "yes" ; then
2644 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
2645 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
2646 echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
2648 echo "AR=$ar" >> $config_host_mak
2649 echo "OBJCOPY=$objcopy" >> $config_host_mak
2650 echo "LD=$ld" >> $config_host_mak
2651 echo "WINDRES=$windres" >> $config_host_mak
2652 echo "CFLAGS=$CFLAGS" >> $config_host_mak
2653 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
2654 echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
2655 echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
2656 echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
2657 echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
2658 echo "LIBS+=$LIBS" >> $config_host_mak
2659 echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
2660 echo "EXESUF=$EXESUF" >> $config_host_mak
2662 # generate list of library paths for linker script
2664 $ld --verbose -v 2> /dev
/null |
grep SEARCH_DIR
> ${config_host_ld}
2666 if test -f ${config_host_ld}~
; then
2667 if cmp -s $config_host_ld ${config_host_ld}~
; then
2668 mv ${config_host_ld}~
$config_host_ld
2670 rm ${config_host_ld}~
2674 for d
in libdis libdis-user
; do
2677 ln -s $source_path/Makefile.dis
$d/Makefile
2678 echo > $d/config.mak
2680 if test "$static" = "no" -a "$user_pie" = "yes" ; then
2681 echo "QEMU_CFLAGS+=-fpie" > libdis-user
/config.mak
2684 for target
in $target_list; do
2685 target_dir
="$target"
2686 config_target_mak
=$target_dir/config-target.mak
2687 target_arch2
=`echo $target | cut -d '-' -f 1`
2688 target_bigendian
="no"
2690 case "$target_arch2" in
2691 armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus
)
2692 target_bigendian
=yes
2696 target_user_only
="no"
2697 target_linux_user
="no"
2698 target_darwin_user
="no"
2699 target_bsd_user
="no"
2701 ${target_arch2}-softmmu)
2702 target_softmmu
="yes"
2704 ${target_arch2}-linux-user)
2705 if test "$linux" != "yes" ; then
2706 echo "ERROR: Target '$target' is only available on a Linux host"
2709 target_user_only
="yes"
2710 target_linux_user
="yes"
2712 ${target_arch2}-darwin-user)
2713 if test "$darwin" != "yes" ; then
2714 echo "ERROR: Target '$target' is only available on a Darwin host"
2717 target_user_only
="yes"
2718 target_darwin_user
="yes"
2720 ${target_arch2}-bsd-user)
2721 if test "$bsd" != "yes" ; then
2722 echo "ERROR: Target '$target' is only available on a BSD host"
2725 target_user_only
="yes"
2726 target_bsd_user
="yes"
2729 echo "ERROR: Target '$target' not recognised"
2734 mkdir
-p $target_dir
2735 mkdir
-p $target_dir/fpu
2736 mkdir
-p $target_dir/tcg
2737 mkdir
-p $target_dir/ide
2738 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
2739 mkdir
-p $target_dir/nwfpe
2743 # don't use ln -sf as not all "ln -sf" over write the file/link
2745 rm -f $target_dir/Makefile
2746 ln -s $source_path/Makefile.target
$target_dir/Makefile
2749 echo "# Automatically generated by configure - do not modify" > $config_target_mak
2753 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
2754 echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
2757 TARGET_ARCH
="$target_arch2"
2761 case "$target_arch2" in
2766 TARGET_BASE_ARCH
=i386
2777 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
2786 gdb_xml_files
="cf-core.xml cf-fp.xml"
2796 echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
2802 TARGET_BASE_ARCH
=mips
2803 echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
2808 TARGET_BASE_ARCH
=mips
2809 echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
2813 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2818 TARGET_BASE_ARCH
=ppc
2820 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2825 TARGET_BASE_ARCH
=ppc
2827 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2832 TARGET_BASE_ARCH
=ppc
2834 echo "TARGET_ABI32=y" >> $config_target_mak
2835 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2848 TARGET_BASE_ARCH
=sparc
2853 TARGET_BASE_ARCH
=sparc
2854 TARGET_ABI_DIR
=sparc
2855 echo "TARGET_ABI32=y" >> $config_target_mak
2862 echo "Unsupported target CPU"
2866 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
2867 target_arch_name
="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
2868 echo "TARGET_$target_arch_name=y" >> $config_target_mak
2869 echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
2870 # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
2871 if [ "$TARGET_BASE_ARCH" = "" ]; then
2872 TARGET_BASE_ARCH
=$TARGET_ARCH
2874 echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
2875 if [ "$TARGET_ABI_DIR" = "" ]; then
2876 TARGET_ABI_DIR
=$TARGET_ARCH
2878 echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
2879 case "$target_arch2" in
2881 if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
2882 echo "CONFIG_XEN=y" >> $config_target_mak
2885 case "$target_arch2" in
2886 i386|x86_64|ppcemb|ppc|ppc64|s390x
)
2887 # Make sure the target and host cpus are compatible
2888 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
2889 \
( "$target_arch2" = "$cpu" -o \
2890 \
( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \
) -o \
2891 \
( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \
) -o \
2892 \
( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \
) -o \
2893 \
( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
2894 echo "CONFIG_KVM=y" >> $config_target_mak
2895 echo "KVM_CFLAGS=$kvm_cflags" >> $config_target_mak
2896 if test "$kvm_para" = "yes"; then
2897 echo "CONFIG_KVM_PARA=y" >> $config_target_mak
2899 if test $vhost_net = "yes" ; then
2900 echo "CONFIG_VHOST_NET=y" >> $config_target_mak
2904 if test "$target_bigendian" = "yes" ; then
2905 echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
2907 if test "$target_softmmu" = "yes" ; then
2908 echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
2909 echo "CONFIG_SOFTMMU=y" >> $config_target_mak
2910 echo "LIBS+=$libs_softmmu" >> $config_target_mak
2911 echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
2912 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
2914 if test "$target_user_only" = "yes" ; then
2915 echo "CONFIG_USER_ONLY=y" >> $config_target_mak
2917 if test "$target_linux_user" = "yes" ; then
2918 echo "CONFIG_LINUX_USER=y" >> $config_target_mak
2920 if test "$target_darwin_user" = "yes" ; then
2921 echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
2924 if test ! -z "$gdb_xml_files" ; then
2925 for x
in $gdb_xml_files; do
2926 list
="$list $source_path/gdb-xml/$x"
2928 echo "TARGET_XML_FILES=$list" >> $config_target_mak
2931 case "$target_arch2" in
2932 alpha|arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus
)
2933 echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
2936 echo "CONFIG_NOSOFTFLOAT=y" >> $config_target_mak
2940 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2941 echo "TARGET_HAS_BFLT=y" >> $config_target_mak
2943 if test "$target_user_only" = "yes" \
2944 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2945 echo "CONFIG_USE_NPTL=y" >> $config_target_mak
2947 if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
2948 echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
2950 if test "$target_bsd_user" = "yes" ; then
2951 echo "CONFIG_BSD_USER=y" >> $config_target_mak
2954 # generate QEMU_CFLAGS/LDFLAGS for targets
2959 if test "$ARCH" = "sparc64" ; then
2960 cflags
="-I\$(SRC_PATH)/tcg/sparc $cflags"
2961 elif test "$ARCH" = "s390x" ; then
2962 cflags
="-I\$(SRC_PATH)/tcg/s390 $cflags"
2963 elif test "$ARCH" = "x86_64" ; then
2964 cflags
="-I\$(SRC_PATH)/tcg/i386 $cflags"
2966 cflags
="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
2968 cflags
="-I\$(SRC_PATH)/tcg $cflags"
2969 cflags
="-I\$(SRC_PATH)/fpu $cflags"
2971 if test "$target_user_only" = "yes" ; then
2972 libdis_config_mak
=libdis-user
/config.mak
2974 libdis_config_mak
=libdis
/config.mak
2977 for i
in $ARCH $TARGET_BASE_ARCH ; do
2980 echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak
2981 echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak
2984 echo "CONFIG_ARM_DIS=y" >> $config_target_mak
2985 echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak
2988 echo "CONFIG_CRIS_DIS=y" >> $config_target_mak
2989 echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak
2992 echo "CONFIG_HPPA_DIS=y" >> $config_target_mak
2993 echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak
2996 echo "CONFIG_I386_DIS=y" >> $config_target_mak
2997 echo "CONFIG_I386_DIS=y" >> $libdis_config_mak
3000 echo "CONFIG_IA64_DIS=y" >> $config_target_mak
3001 echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak
3004 echo "CONFIG_M68K_DIS=y" >> $config_target_mak
3005 echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak
3008 echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak
3009 echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak
3012 echo "CONFIG_MIPS_DIS=y" >> $config_target_mak
3013 echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak
3016 echo "CONFIG_PPC_DIS=y" >> $config_target_mak
3017 echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak
3020 echo "CONFIG_S390_DIS=y" >> $config_target_mak
3021 echo "CONFIG_S390_DIS=y" >> $libdis_config_mak
3024 echo "CONFIG_SH4_DIS=y" >> $config_target_mak
3025 echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak
3028 echo "CONFIG_SPARC_DIS=y" >> $config_target_mak
3029 echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak
3036 # Ensure there's only a single GP
3037 cflags
="-msmall-data $cflags"
3041 if test "$target_softmmu" = "yes" ; then
3042 case "$TARGET_BASE_ARCH" in
3044 cflags
="-DHAS_AUDIO $cflags"
3047 cflags
="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
3052 if test "$target_user_only" = "yes" -a "$static" = "no" -a \
3053 "$user_pie" = "yes" ; then
3054 cflags
="-fpie $cflags"
3055 ldflags
="-pie $ldflags"
3058 if test "$target_softmmu" = "yes" -a \
( \
3059 "$TARGET_ARCH" = "microblaze" -o \
3060 "$TARGET_ARCH" = "cris" \
) ; then
3061 echo "CONFIG_NEED_MMU=y" >> $config_target_mak
3064 if test "$gprof" = "yes" ; then
3065 echo "TARGET_GPROF=yes" >> $config_target_mak
3066 if test "$target_linux_user" = "yes" ; then
3068 ldflags
="-p $ldflags"
3070 if test "$target_softmmu" = "yes" ; then
3071 ldflags
="-p $ldflags"
3072 echo "GPROF_CFLAGS=-p" >> $config_target_mak
3076 linker_script
="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
3077 if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
3080 # -static is used to avoid g1/g3 usage by the dynamic linker
3081 ldflags
="$linker_script -static $ldflags"
3084 # The default placement of the application is fine.
3087 ldflags
="$linker_script $ldflags"
3092 echo "LDFLAGS+=$ldflags" >> $config_target_mak
3093 echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
3095 done # for target in $targets
3097 # build tree in object directory if source path is different from current one
3098 if test "$source_path_used" = "yes" ; then
3099 DIRS
="tests tests/cris slirp audio block net pc-bios/optionrom"
3100 DIRS
="$DIRS roms/seabios roms/vgabios"
3101 DIRS
="$DIRS fsdev ui"
3102 FILES
="Makefile tests/Makefile"
3103 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
3104 FILES
="$FILES tests/test-mmap.c"
3105 FILES
="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
3106 FILES
="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
3107 for bios_file
in $source_path/pc-bios
/*.bin
$source_path/pc-bios
/*.dtb
$source_path/pc-bios
/openbios-
*; do
3108 FILES
="$FILES pc-bios/`basename $bios_file`"
3110 for dir
in $DIRS ; do
3113 # remove the link and recreate it, as not all "ln -sf" overwrite the link
3114 for f
in $FILES ; do
3116 ln -s $source_path/$f $f
3120 # temporary config to build submodules
3121 for rom
in seabios vgabios
; do
3122 config_mak
=roms
/$rom/config.mak
3123 echo "# Automatically generated by configure - do not modify" > $config_mak
3124 echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
3125 echo "CC=$cc" >> $config_mak
3126 echo "BCC=bcc" >> $config_mak
3127 echo "CPP=${cross_prefix}cpp" >> $config_mak
3128 echo "OBJCOPY=objcopy" >> $config_mak
3129 echo "IASL=iasl" >> $config_mak
3130 echo "HOST_CC=$host_cc" >> $config_mak
3131 echo "LD=$ld" >> $config_mak
3134 for hwlib
in 32 64; do
3139 ln -s $source_path/Makefile.hw
$d/Makefile
3140 echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
3146 ln -s $source_path/Makefile.user
$d/Makefile
3147 if test "$static" = "no" -a "$user_pie" = "yes" ; then
3148 echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
3151 if test "$docs" = "yes" ; then