Add RAM -> physical addr mapping in MCE simulation
[qemu-kvm/stefanha.git] / configure
blob8228c1c909163bbd9e82b847595addb7be302c32
1 #!/bin/sh
3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8 elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10 else
11 TMPDIR1="/tmp"
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 trap "rm -f $TMPC $TMPO $TMPE ; exit" EXIT INT QUIT TERM
20 compile_object() {
21 $cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
24 compile_prog() {
25 local_cflags="$1"
26 local_ldflags="$2"
27 $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > /dev/null 2> /dev/null
30 # check whether a command is available to this shell (may be either an
31 # executable or a builtin)
32 has() {
33 type "$1" >/dev/null 2>&1
36 # search for an executable in PATH
37 path_of() {
38 local_command="$1"
39 local_ifs="$IFS"
40 local_dir=""
42 # pathname has a dir component?
43 if [ "${local_command#*/}" != "$local_command" ]; then
44 if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then
45 echo "$local_command"
46 return 0
49 if [ -z "$local_command" ]; then
50 return 1
53 IFS=:
54 for local_dir in $PATH; do
55 if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then
56 echo "$local_dir/$local_command"
57 IFS="${local_ifs:-$(printf ' \t\n')}"
58 return 0
60 done
61 # not found
62 IFS="${local_ifs:-$(printf ' \t\n')}"
63 return 1
66 # default parameters
67 cpu=""
68 interp_prefix="/usr/gnemul/qemu-%M"
69 static="no"
70 sparc_cpu=""
71 cross_prefix=""
72 cc="gcc"
73 audio_drv_list=""
74 audio_card_list="ac97 es1370 sb16"
75 audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
76 block_drv_whitelist=""
77 host_cc="gcc"
78 ar="ar"
79 make="make"
80 install="install"
81 objcopy="objcopy"
82 ld="ld"
83 strip="strip"
84 helper_cflags=""
85 libs_softmmu=""
86 libs_tools=""
87 audio_pt_int=""
88 audio_win_int=""
90 # parse CC options first
91 for opt do
92 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
93 case "$opt" in
94 --cross-prefix=*) cross_prefix="$optarg"
96 --cc=*) cc="$optarg"
98 --cpu=*) cpu="$optarg"
100 --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
102 --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
104 --sparc_cpu=*)
105 sparc_cpu="$optarg"
106 case $sparc_cpu in
107 v7|v8|v8plus|v8plusa)
108 cpu="sparc"
111 cpu="sparc64"
114 echo "undefined SPARC architecture. Exiting";
115 exit 1
117 esac
119 esac
120 done
121 # OS specific
122 # Using uname is really, really broken. Once we have the right set of checks
123 # we can eliminate it's usage altogether
125 cc="${cross_prefix}${cc}"
126 ar="${cross_prefix}${ar}"
127 objcopy="${cross_prefix}${objcopy}"
128 ld="${cross_prefix}${ld}"
129 strip="${cross_prefix}${strip}"
131 # default flags for all hosts
132 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
133 CFLAGS="-g $CFLAGS"
134 QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
135 QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
136 QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
137 QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
138 QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
139 LDFLAGS="-g $LDFLAGS"
141 gcc_flags="-Wold-style-declaration -Wold-style-definition -fstack-protector-all"
142 cat > $TMPC << EOF
143 int main(void) { return 0; }
145 for flag in $gcc_flags; do
146 if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
147 QEMU_CFLAGS="$flag $QEMU_CFLAGS"
149 done
151 # check that the C compiler works.
152 cat > $TMPC <<EOF
153 int main(void) {}
156 if compile_object ; then
157 : C compiler works ok
158 else
159 echo "ERROR: \"$cc\" either does not exist or does not work"
160 exit 1
163 check_define() {
164 cat > $TMPC <<EOF
165 #if !defined($1)
166 #error Not defined
167 #endif
168 int main(void) { return 0; }
170 compile_object
173 if test ! -z "$cpu" ; then
174 # command line argument
176 elif check_define __i386__ ; then
177 cpu="i386"
178 elif check_define __x86_64__ ; then
179 cpu="x86_64"
180 elif check_define __sparc__ ; then
181 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
182 # They must be specified using --sparc_cpu
183 if check_define __arch64__ ; then
184 cpu="sparc64"
185 else
186 cpu="sparc"
188 elif check_define _ARCH_PPC ; then
189 if check_define _ARCH_PPC64 ; then
190 cpu="ppc64"
191 else
192 cpu="ppc"
194 elif check_define __mips__ ; then
195 cpu="mips"
196 elif check_define __ia64__ ; then
197 cpu="ia64"
198 elif check_define __s390__ ; then
199 if check_define __s390x__ ; then
200 cpu="s390x"
201 else
202 cpu="s390"
204 else
205 cpu=`uname -m`
208 target_list="x86_64-softmmu"
209 case "$cpu" in
210 alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64)
211 cpu="$cpu"
213 i386|i486|i586|i686|i86pc|BePC)
214 cpu="i386"
216 x86_64|amd64)
217 cpu="x86_64"
219 armv*b)
220 cpu="armv4b"
222 armv*l)
223 cpu="armv4l"
225 parisc|parisc64)
226 cpu="hppa"
228 mips*)
229 cpu="mips"
231 s390)
232 cpu="s390"
234 s390x)
235 cpu="s390x"
237 sparc|sun4[cdmuv])
238 cpu="sparc"
241 echo "Unsupported CPU = $cpu"
242 exit 1
244 esac
246 kvm_version() {
247 local fname="$(dirname "$0")/KVM_VERSION"
249 if test -f "$fname"; then
250 cat "$fname"
251 else
252 echo "qemu-kvm-devel"
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.
268 bluez=""
269 brlapi=""
270 curl=""
271 curses=""
272 docs=""
273 fdt=""
274 kvm=""
275 kvm_para=""
276 nptl=""
277 sdl=""
278 sparse="no"
279 uuid=""
280 vde=""
281 vnc_tls=""
282 vnc_sasl=""
283 vnc_jpeg=""
284 vnc_png=""
285 vnc_thread="no"
286 xen=""
287 linux_aio=""
288 attr=""
289 vhost_net=""
291 gprof="no"
292 debug_tcg="no"
293 debug_mon="no"
294 debug="no"
295 strip_opt="yes"
296 bigendian="no"
297 mingw32="no"
298 EXESUF=""
299 prefix="/usr/local"
300 mandir="\${prefix}/share/man"
301 datadir="\${prefix}/share/qemu"
302 docdir="\${prefix}/share/doc/qemu"
303 bindir="\${prefix}/bin"
304 sysconfdir="\${prefix}/etc"
305 confsuffix="/qemu"
306 slirp="yes"
307 fmod_lib=""
308 fmod_inc=""
309 oss_lib=""
310 bsd="no"
311 linux="no"
312 solaris="no"
313 profiler="no"
314 cocoa="no"
315 softmmu="yes"
316 linux_user="no"
317 darwin_user="no"
318 bsd_user="no"
319 guest_base=""
320 uname_release=""
321 io_thread="no"
322 mixemu="no"
323 kvm_cap_pit=""
324 kvm_cap_device_assignment=""
325 kerneldir=""
326 aix="no"
327 blobs="yes"
328 pkgversion=" ($(kvm_version))"
329 cpu_emulation="yes"
330 check_utests="no"
331 user_pie="no"
332 zero_malloc=""
334 # OS specific
335 if check_define __linux__ ; then
336 targetos="Linux"
337 elif check_define _WIN32 ; then
338 targetos='MINGW32'
339 elif check_define __OpenBSD__ ; then
340 targetos='OpenBSD'
341 elif check_define __sun__ ; then
342 targetos='SunOS'
343 else
344 targetos=`uname -s`
347 case $targetos in
348 CYGWIN*)
349 mingw32="yes"
350 QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS"
351 audio_possible_drivers="winwave sdl"
352 audio_drv_list="winwave"
354 MINGW32*)
355 mingw32="yes"
356 audio_possible_drivers="winwave dsound sdl fmod"
357 audio_drv_list="winwave"
359 GNU/kFreeBSD)
360 bsd="yes"
361 audio_drv_list="oss"
362 audio_possible_drivers="oss sdl esd pa"
364 FreeBSD)
365 bsd="yes"
366 make="gmake"
367 audio_drv_list="oss"
368 audio_possible_drivers="oss sdl esd pa"
369 # needed for kinfo_getvmmap(3) in libutil.h
370 LIBS="-lutil $LIBS"
372 DragonFly)
373 bsd="yes"
374 make="gmake"
375 audio_drv_list="oss"
376 audio_possible_drivers="oss sdl esd pa"
378 NetBSD)
379 bsd="yes"
380 make="gmake"
381 audio_drv_list="oss"
382 audio_possible_drivers="oss sdl esd"
383 oss_lib="-lossaudio"
385 OpenBSD)
386 bsd="yes"
387 make="gmake"
388 audio_drv_list="oss"
389 audio_possible_drivers="oss sdl esd"
390 oss_lib="-lossaudio"
392 Darwin)
393 bsd="yes"
394 darwin="yes"
395 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can
396 # run 64-bit userspace code
397 if [ "$cpu" = "i386" ] ; then
398 is_x86_64=`sysctl -n hw.optional.x86_64`
399 [ "$is_x86_64" = "1" ] && cpu=x86_64
401 if [ "$cpu" = "x86_64" ] ; then
402 QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
403 LDFLAGS="-arch x86_64 $LDFLAGS"
404 else
405 QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
407 darwin_user="yes"
408 cocoa="yes"
409 audio_drv_list="coreaudio"
410 audio_possible_drivers="coreaudio sdl fmod"
411 LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS"
412 libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
414 SunOS)
415 solaris="yes"
416 make="gmake"
417 install="ginstall"
418 ld="gld"
419 needs_libsunmath="no"
420 solarisrev=`uname -r | cut -f2 -d.`
421 # have to select again, because `uname -m` returns i86pc
422 # even on an x86_64 box.
423 solariscpu=`isainfo -k`
424 if test "${solariscpu}" = "amd64" ; then
425 cpu="x86_64"
427 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
428 if test "$solarisrev" -le 9 ; then
429 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
430 needs_libsunmath="yes"
431 QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS"
432 LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
433 LIBS="-lsunmath $LIBS"
434 else
435 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
436 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
437 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
438 echo "Studio 11 can be downloaded from www.sun.com."
439 exit 1
443 if test -f /usr/include/sys/soundcard.h ; then
444 audio_drv_list="oss"
446 audio_possible_drivers="oss sdl"
447 # needed for CMSG_ macros in sys/socket.h
448 QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
449 # needed for TIOCWIN* defines in termios.h
450 QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
451 QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
452 LIBS="-lsocket -lnsl -lresolv $LIBS"
454 AIX)
455 aix="yes"
456 make="gmake"
459 audio_drv_list="oss"
460 audio_possible_drivers="oss alsa sdl esd pa"
461 linux="yes"
462 linux_user="yes"
463 usb="linux"
464 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
465 audio_possible_drivers="$audio_possible_drivers fmod"
467 if [ "$cpu" = "ia64" ] ; then
468 xen="no"
469 target_list="ia64-softmmu"
470 cpu_emulation="no"
471 gdbstub="no"
472 slirp="no"
475 esac
477 if [ "$bsd" = "yes" ] ; then
478 if [ "$darwin" != "yes" ] ; then
479 usb="bsd"
481 bsd_user="yes"
484 if test "$mingw32" = "yes" ; then
485 EXESUF=".exe"
486 QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
487 # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
488 QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
489 LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
490 prefix="c:/Program Files/Qemu"
491 mandir="\${prefix}"
492 datadir="\${prefix}"
493 docdir="\${prefix}"
494 bindir="\${prefix}"
495 sysconfdir="\${prefix}"
496 confsuffix=""
499 # find source path
500 source_path=`dirname "$0"`
501 source_path_used="no"
502 workdir=`pwd`
503 if [ -z "$source_path" ]; then
504 source_path=$workdir
505 else
506 source_path=`cd "$source_path"; pwd`
508 [ -f "$workdir/vl.c" ] || source_path_used="yes"
510 werror=""
512 for opt do
513 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
514 case "$opt" in
515 --help|-h) show_help=yes
517 --prefix=*) prefix="$optarg"
519 --interp-prefix=*) interp_prefix="$optarg"
521 --source-path=*) source_path="$optarg"
522 source_path_used="yes"
524 --cross-prefix=*)
526 --cc=*)
528 --host-cc=*) host_cc="$optarg"
530 --make=*) make="$optarg"
532 --install=*) install="$optarg"
534 --extra-cflags=*)
536 --extra-ldflags=*)
538 --cpu=*)
540 --target-list=*) target_list="$optarg"
542 --enable-gprof) gprof="yes"
544 --static)
545 static="yes"
546 LDFLAGS="-static $LDFLAGS"
548 --mandir=*) mandir="$optarg"
550 --bindir=*) bindir="$optarg"
552 --datadir=*) datadir="$optarg"
554 --docdir=*) docdir="$optarg"
556 --sysconfdir=*) sysconfdir="$optarg"
558 --disable-sdl) sdl="no"
560 --enable-sdl) sdl="yes"
562 --fmod-lib=*) fmod_lib="$optarg"
564 --fmod-inc=*) fmod_inc="$optarg"
566 --oss-lib=*) oss_lib="$optarg"
568 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
570 --audio-drv-list=*) audio_drv_list="$optarg"
572 --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
574 --enable-debug-tcg) debug_tcg="yes"
576 --disable-debug-tcg) debug_tcg="no"
578 --enable-debug-mon) debug_mon="yes"
580 --disable-debug-mon) debug_mon="no"
582 --enable-debug)
583 # Enable debugging options that aren't excessively noisy
584 debug_tcg="yes"
585 debug_mon="yes"
586 debug="yes"
587 strip_opt="no"
589 --enable-sparse) sparse="yes"
591 --disable-sparse) sparse="no"
593 --disable-strip) strip_opt="no"
595 --disable-vnc-tls) vnc_tls="no"
597 --enable-vnc-tls) vnc_tls="yes"
599 --disable-vnc-sasl) vnc_sasl="no"
601 --enable-vnc-sasl) vnc_sasl="yes"
603 --disable-vnc-jpeg) vnc_jpeg="no"
605 --enable-vnc-jpeg) vnc_jpeg="yes"
607 --disable-vnc-png) vnc_png="no"
609 --enable-vnc-png) vnc_png="yes"
611 --disable-vnc-thread) vnc_thread="no"
613 --enable-vnc-thread) vnc_thread="yes"
615 --disable-slirp) slirp="no"
617 --disable-uuid) uuid="no"
619 --enable-uuid) uuid="yes"
621 --disable-vde) vde="no"
623 --enable-vde) vde="yes"
625 --disable-xen) xen="no"
627 --enable-xen) xen="yes"
629 --disable-brlapi) brlapi="no"
631 --enable-brlapi) brlapi="yes"
633 --disable-bluez) bluez="no"
635 --enable-bluez) bluez="yes"
637 --disable-kvm) kvm="no"
639 --enable-kvm) kvm="yes"
641 --disable-kvm-pit) kvm_cap_pit="no"
643 --enable-kvm-pit) kvm_cap_pit="yes"
645 --disable-kvm-device-assignment) kvm_cap_device_assignment="no"
647 --enable-kvm-device-assignment) kvm_cap_device_assignment="yes"
649 --enable-profiler) profiler="yes"
651 --enable-cocoa)
652 cocoa="yes" ;
653 sdl="no" ;
654 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
656 --disable-system) softmmu="no"
658 --enable-system) softmmu="yes"
660 --disable-user)
661 linux_user="no" ;
662 bsd_user="no" ;
663 darwin_user="no"
665 --enable-user) ;;
666 --disable-linux-user) linux_user="no"
668 --enable-linux-user) linux_user="yes"
670 --disable-darwin-user) darwin_user="no"
672 --enable-darwin-user) darwin_user="yes"
674 --disable-bsd-user) bsd_user="no"
676 --enable-bsd-user) bsd_user="yes"
678 --enable-guest-base) guest_base="yes"
680 --disable-guest-base) guest_base="no"
682 --enable-user-pie) user_pie="yes"
684 --disable-user-pie) user_pie="no"
686 --enable-uname-release=*) uname_release="$optarg"
688 --sparc_cpu=*)
690 --enable-werror) werror="yes"
692 --disable-werror) werror="no"
694 --disable-curses) curses="no"
696 --enable-curses) curses="yes"
698 --disable-curl) curl="no"
700 --enable-curl) curl="yes"
702 --disable-fdt) fdt="no"
704 --enable-fdt) fdt="yes"
706 --disable-check-utests) check_utests="no"
708 --enable-check-utests) check_utests="yes"
710 --disable-nptl) nptl="no"
712 --enable-nptl) nptl="yes"
714 --enable-mixemu) mixemu="yes"
716 --disable-linux-aio) linux_aio="no"
718 --enable-linux-aio) linux_aio="yes"
720 --disable-attr) attr="no"
722 --enable-attr) attr="yes"
724 --enable-io-thread) io_thread="yes"
726 --disable-blobs) blobs="no"
728 --kerneldir=*) kerneldir="$optarg"
730 --with-pkgversion=*) pkgversion=" ($optarg)"
732 --disable-docs) docs="no"
734 --enable-docs) docs="yes"
736 --disable-cpu-emulation) cpu_emulation="no"
738 --disable-vhost-net) vhost_net="no"
740 --enable-vhost-net) vhost_net="yes"
742 --*dir)
744 *) echo "ERROR: unknown option $opt"; show_help="yes"
746 esac
747 done
750 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
751 # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
753 host_guest_base="no"
754 case "$cpu" in
755 sparc) case $sparc_cpu in
756 v7|v8)
757 QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
759 v8plus|v8plusa)
760 QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
762 *) # sparc_cpu not defined in the command line
763 QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
764 esac
765 LDFLAGS="-m32 $LDFLAGS"
766 QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
767 if test "$solaris" = "no" ; then
768 QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
769 helper_cflags="-ffixed-i0"
772 sparc64)
773 QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
774 LDFLAGS="-m64 $LDFLAGS"
775 QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
776 if test "$solaris" != "no" ; then
777 QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS"
780 s390)
781 QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
782 LDFLAGS="-m31 $LDFLAGS"
783 host_guest_base="yes"
785 s390x)
786 QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
787 LDFLAGS="-m64 $LDFLAGS"
788 host_guest_base="yes"
790 i386)
791 QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
792 LDFLAGS="-m32 $LDFLAGS"
793 helper_cflags="-fomit-frame-pointer"
794 host_guest_base="yes"
796 x86_64)
797 QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
798 LDFLAGS="-m64 $LDFLAGS"
799 host_guest_base="yes"
801 arm*)
802 host_guest_base="yes"
804 ppc*)
805 host_guest_base="yes"
807 mips*)
808 host_guest_base="yes"
810 ia64*)
811 host_guest_base="yes"
813 hppa*)
814 host_guest_base="yes"
816 esac
818 [ -z "$guest_base" ] && guest_base="$host_guest_base"
820 if test x"$show_help" = x"yes" ; then
821 cat << EOF
823 Usage: configure [options]
824 Options: [defaults in brackets after descriptions]
827 echo "Standard options:"
828 echo " --help print this message"
829 echo " --prefix=PREFIX install in PREFIX [$prefix]"
830 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
831 echo " use %M for cpu name [$interp_prefix]"
832 echo " --target-list=LIST set target list [$target_list]"
833 echo ""
834 echo "Advanced options (experts only):"
835 echo " --source-path=PATH path of source code [$source_path]"
836 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
837 echo " --cc=CC use C compiler CC [$cc]"
838 echo " --host-cc=CC use C compiler CC [$host_cc] for code run at"
839 echo " build time"
840 echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS"
841 echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS"
842 echo " --make=MAKE use specified make [$make]"
843 echo " --install=INSTALL use specified install [$install]"
844 echo " --static enable static build [$static]"
845 echo " --mandir=PATH install man pages in PATH"
846 echo " --datadir=PATH install firmware in PATH"
847 echo " --docdir=PATH install documentation in PATH"
848 echo " --bindir=PATH install binaries in PATH"
849 echo " --sysconfdir=PATH install config in PATH/qemu"
850 echo " --enable-debug-tcg enable TCG debugging"
851 echo " --disable-debug-tcg disable TCG debugging (default)"
852 echo " --enable-debug enable common debug build options"
853 echo " --enable-sparse enable sparse checker"
854 echo " --disable-sparse disable sparse checker (default)"
855 echo " --disable-strip disable stripping binaries"
856 echo " --disable-werror disable compilation abort on warning"
857 echo " --disable-sdl disable SDL"
858 echo " --enable-sdl enable SDL"
859 echo " --enable-cocoa enable COCOA (Mac OS X only)"
860 echo " --audio-drv-list=LIST set audio drivers list:"
861 echo " Available drivers: $audio_possible_drivers"
862 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
863 echo " Available cards: $audio_possible_cards"
864 echo " --block-drv-whitelist=L set block driver whitelist"
865 echo " (affects only QEMU, not qemu-img)"
866 echo " --enable-mixemu enable mixer emulation"
867 echo " --disable-xen disable xen backend driver support"
868 echo " --enable-xen enable xen backend driver support"
869 echo " --disable-brlapi disable BrlAPI"
870 echo " --enable-brlapi enable BrlAPI"
871 echo " --disable-vnc-tls disable TLS encryption for VNC server"
872 echo " --enable-vnc-tls enable TLS encryption for VNC server"
873 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
874 echo " --enable-vnc-sasl enable SASL encryption for VNC server"
875 echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server"
876 echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server"
877 echo " --disable-vnc-png disable PNG compression for VNC server (default)"
878 echo " --enable-vnc-png enable PNG compression for VNC server"
879 echo " --disable-vnc-thread disable threaded VNC server"
880 echo " --enable-vnc-thread enable threaded VNC server"
881 echo " --disable-curses disable curses output"
882 echo " --enable-curses enable curses output"
883 echo " --disable-curl disable curl connectivity"
884 echo " --enable-curl enable curl connectivity"
885 echo " --disable-fdt disable fdt device tree"
886 echo " --enable-fdt enable fdt device tree"
887 echo " --disable-check-utests disable check unit-tests"
888 echo " --enable-check-utests enable check unit-tests"
889 echo " --disable-bluez disable bluez stack connectivity"
890 echo " --enable-bluez enable bluez stack connectivity"
891 echo " --disable-kvm disable KVM acceleration support"
892 echo " --enable-kvm enable KVM acceleration support"
893 echo " --disable-kvm-pit disable KVM pit support"
894 echo " --enable-kvm-pit enable KVM pit support"
895 echo " --disable-kvm-device-assignment disable KVM device assignment support"
896 echo " --enable-kvm-device-assignment enable KVM device assignment support"
897 echo " --disable-nptl disable usermode NPTL support"
898 echo " --enable-nptl enable usermode NPTL support"
899 echo " --enable-system enable all system emulation targets"
900 echo " --disable-system disable all system emulation targets"
901 echo " --enable-user enable supported user emulation targets"
902 echo " --disable-user disable all user emulation targets"
903 echo " --enable-linux-user enable all linux usermode emulation targets"
904 echo " --disable-linux-user disable all linux usermode emulation targets"
905 echo " --enable-darwin-user enable all darwin usermode emulation targets"
906 echo " --disable-darwin-user disable all darwin usermode emulation targets"
907 echo " --enable-bsd-user enable all BSD usermode emulation targets"
908 echo " --disable-bsd-user disable all BSD usermode emulation targets"
909 echo " --enable-guest-base enable GUEST_BASE support for usermode"
910 echo " emulation targets"
911 echo " --disable-guest-base disable GUEST_BASE support"
912 echo " --enable-user-pie build usermode emulation targets as PIE"
913 echo " --disable-user-pie do not build usermode emulation targets as PIE"
914 echo " --fmod-lib path to FMOD library"
915 echo " --fmod-inc path to FMOD includes"
916 echo " --oss-lib path to OSS library"
917 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
918 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
919 echo " --disable-uuid disable uuid support"
920 echo " --enable-uuid enable uuid support"
921 echo " --disable-vde disable support for vde network"
922 echo " --enable-vde enable support for vde network"
923 echo " --disable-linux-aio disable Linux AIO support"
924 echo " --enable-linux-aio enable Linux AIO support"
925 echo " --disable-attr disables attr and xattr support"
926 echo " --enable-attr enable attr and xattr support"
927 echo " --enable-io-thread enable IO thread"
928 echo " --disable-blobs disable installing provided firmware blobs"
929 echo " --kerneldir=PATH look for kernel includes in PATH"
930 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
931 echo " --enable-docs enable documentation build"
932 echo " --disable-docs disable documentation build"
933 echo " --disable-vhost-net disable vhost-net acceleration support"
934 echo " --enable-vhost-net enable vhost-net acceleration support"
935 echo ""
936 echo "NOTE: The object files are built at the place where configure is launched"
937 exit 1
941 # Solaris specific configure tool chain decisions
943 if test "$solaris" = "yes" ; then
944 if has $install; then
946 else
947 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
948 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
949 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
950 exit 1
952 if test "`path_of $install`" = "/usr/sbin/install" ; then
953 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
954 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
955 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
956 exit 1
958 if has ar; then
960 else
961 echo "Error: No path includes ar"
962 if test -f /usr/ccs/bin/ar ; then
963 echo "Add /usr/ccs/bin to your path and rerun configure"
965 exit 1
970 if test -z "$target_list" ; then
971 # these targets are portable
972 if [ "$softmmu" = "yes" ] ; then
973 target_list="\
974 i386-softmmu \
975 x86_64-softmmu \
976 arm-softmmu \
977 cris-softmmu \
978 m68k-softmmu \
979 microblaze-softmmu \
980 mips-softmmu \
981 mipsel-softmmu \
982 mips64-softmmu \
983 mips64el-softmmu \
984 ppc-softmmu \
985 ppcemb-softmmu \
986 ppc64-softmmu \
987 sh4-softmmu \
988 sh4eb-softmmu \
989 sparc-softmmu \
990 sparc64-softmmu \
993 # the following are Linux specific
994 if [ "$linux_user" = "yes" ] ; then
995 target_list="${target_list}\
996 i386-linux-user \
997 x86_64-linux-user \
998 alpha-linux-user \
999 arm-linux-user \
1000 armeb-linux-user \
1001 cris-linux-user \
1002 m68k-linux-user \
1003 microblaze-linux-user \
1004 mips-linux-user \
1005 mipsel-linux-user \
1006 ppc-linux-user \
1007 ppc64-linux-user \
1008 ppc64abi32-linux-user \
1009 sh4-linux-user \
1010 sh4eb-linux-user \
1011 sparc-linux-user \
1012 sparc64-linux-user \
1013 sparc32plus-linux-user \
1016 # the following are Darwin specific
1017 if [ "$darwin_user" = "yes" ] ; then
1018 target_list="$target_list i386-darwin-user ppc-darwin-user "
1020 # the following are BSD specific
1021 if [ "$bsd_user" = "yes" ] ; then
1022 target_list="${target_list}\
1023 i386-bsd-user \
1024 x86_64-bsd-user \
1025 sparc-bsd-user \
1026 sparc64-bsd-user \
1029 else
1030 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
1032 if test -z "$target_list" ; then
1033 echo "No targets enabled"
1034 exit 1
1036 # see if system emulation was really requested
1037 case " $target_list " in
1038 *"-softmmu "*) softmmu=yes
1040 *) softmmu=no
1042 esac
1044 feature_not_found() {
1045 feature=$1
1047 echo "ERROR"
1048 echo "ERROR: User requested feature $feature"
1049 echo "ERROR: configure was not able to find it"
1050 echo "ERROR"
1051 exit 1;
1054 if test -z "$cross_prefix" ; then
1056 # ---
1057 # big/little endian test
1058 cat > $TMPC << EOF
1059 #include <inttypes.h>
1060 int main(int argc, char ** argv){
1061 volatile uint32_t i=0x01234567;
1062 return (*((uint8_t*)(&i))) == 0x67;
1066 if compile_prog "" "" ; then
1067 $TMPE && bigendian="yes"
1068 else
1069 echo big/little test failed
1072 else
1074 # if cross compiling, cannot launch a program, so make a static guess
1075 case "$cpu" in
1076 armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
1077 bigendian=yes
1079 esac
1083 # host long bits test
1084 hostlongbits="32"
1085 case "$cpu" in
1086 x86_64|alpha|ia64|sparc64|ppc64|s390x)
1087 hostlongbits=64
1089 esac
1092 ##########################################
1093 # NPTL probe
1095 if test "$nptl" != "no" ; then
1096 cat > $TMPC <<EOF
1097 #include <sched.h>
1098 #include <linux/futex.h>
1099 void foo()
1101 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
1102 #error bork
1103 #endif
1107 if compile_object ; then
1108 nptl=yes
1109 else
1110 if test "$nptl" = "yes" ; then
1111 feature_not_found "nptl"
1113 nptl=no
1117 ##########################################
1118 # zlib check
1120 cat > $TMPC << EOF
1121 #include <zlib.h>
1122 int main(void) { zlibVersion(); return 0; }
1124 if compile_prog "" "-lz" ; then
1126 else
1127 echo
1128 echo "Error: zlib check failed"
1129 echo "Make sure to have the zlib libs and headers installed."
1130 echo
1131 exit 1
1134 ##########################################
1135 # xen probe
1137 if test "$xen" != "no" ; then
1138 xen_libs="-lxenstore -lxenctrl -lxenguest"
1139 cat > $TMPC <<EOF
1140 #include <xenctrl.h>
1141 #include <xs.h>
1142 int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
1144 if compile_prog "" "$xen_libs" ; then
1145 xen=yes
1146 libs_softmmu="$xen_libs $libs_softmmu"
1147 else
1148 if test "$xen" = "yes" ; then
1149 feature_not_found "xen"
1151 xen=no
1155 ##########################################
1156 # pkgconfig probe
1158 pkgconfig="${cross_prefix}pkg-config"
1159 if ! has $pkgconfig; then
1160 # likely not cross compiling, or hope for the best
1161 pkgconfig=pkg-config
1164 ##########################################
1165 # Sparse probe
1166 if test "$sparse" != "no" ; then
1167 if has cgcc; then
1168 sparse=yes
1169 else
1170 if test "$sparse" = "yes" ; then
1171 feature_not_found "sparse"
1173 sparse=no
1177 ##########################################
1178 # SDL probe
1180 # Look for sdl configuration program (pkg-config or sdl-config).
1181 # Prefer variant with cross prefix if cross compiling,
1182 # and favour pkg-config with sdl over sdl-config.
1183 if test -n "$cross_prefix" -a $pkgconfig != pkg-config && \
1184 $pkgconfig sdl --modversion >/dev/null 2>&1; then
1185 sdlconfig="$pkgconfig sdl"
1186 _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1187 elif test -n "$cross_prefix" && has ${cross_prefix}sdl-config; then
1188 sdlconfig="${cross_prefix}sdl-config"
1189 _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
1190 elif $pkgconfig sdl --modversion >/dev/null 2>&1; then
1191 sdlconfig="$pkgconfig sdl"
1192 _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1193 elif has sdl-config; then
1194 sdlconfig='sdl-config'
1195 _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
1196 else
1197 if test "$sdl" = "yes" ; then
1198 feature_not_found "sdl"
1200 sdl=no
1203 sdl_too_old=no
1204 if test "$sdl" != "no" ; then
1205 cat > $TMPC << EOF
1206 #include <SDL.h>
1207 #undef main /* We don't want SDL to override our main() */
1208 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1210 sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
1211 if test "$static" = "yes" ; then
1212 sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
1213 else
1214 sdl_libs=`$sdlconfig --libs 2> /dev/null`
1216 if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1217 if test "$_sdlversion" -lt 121 ; then
1218 sdl_too_old=yes
1219 else
1220 if test "$cocoa" = "no" ; then
1221 sdl=yes
1225 # static link with sdl ? (note: sdl.pc's --static --libs is broken)
1226 if test "$sdl" = "yes" -a "$static" = "yes" ; then
1227 if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then
1228 sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
1229 sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
1231 if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1233 else
1234 sdl=no
1236 fi # static link
1237 else # sdl not found
1238 if test "$sdl" = "yes" ; then
1239 feature_not_found "sdl"
1241 sdl=no
1242 fi # sdl compile test
1245 if test "$sdl" = "yes" ; then
1246 cat > $TMPC <<EOF
1247 #include <SDL.h>
1248 #if defined(SDL_VIDEO_DRIVER_X11)
1249 #include <X11/XKBlib.h>
1250 #else
1251 #error No x11 support
1252 #endif
1253 int main(void) { return 0; }
1255 if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1256 sdl_libs="$sdl_libs -lX11"
1258 if test "$mingw32" = "yes" ; then
1259 sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole"
1261 libs_softmmu="$sdl_libs $libs_softmmu"
1264 ##########################################
1265 # VNC TLS detection
1266 if test "$vnc_tls" != "no" ; then
1267 cat > $TMPC <<EOF
1268 #include <gnutls/gnutls.h>
1269 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1271 vnc_tls_cflags=`$pkgconfig --cflags gnutls 2> /dev/null`
1272 vnc_tls_libs=`$pkgconfig --libs gnutls 2> /dev/null`
1273 if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then
1274 vnc_tls=yes
1275 libs_softmmu="$vnc_tls_libs $libs_softmmu"
1276 else
1277 if test "$vnc_tls" = "yes" ; then
1278 feature_not_found "vnc-tls"
1280 vnc_tls=no
1284 ##########################################
1285 # VNC SASL detection
1286 if test "$vnc_sasl" != "no" ; then
1287 cat > $TMPC <<EOF
1288 #include <sasl/sasl.h>
1289 #include <stdio.h>
1290 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
1292 # Assuming Cyrus-SASL installed in /usr prefix
1293 vnc_sasl_cflags=""
1294 vnc_sasl_libs="-lsasl2"
1295 if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
1296 vnc_sasl=yes
1297 libs_softmmu="$vnc_sasl_libs $libs_softmmu"
1298 else
1299 if test "$vnc_sasl" = "yes" ; then
1300 feature_not_found "vnc-sasl"
1302 vnc_sasl=no
1306 ##########################################
1307 # VNC JPEG detection
1308 if test "$vnc_jpeg" != "no" ; then
1309 cat > $TMPC <<EOF
1310 #include <stdio.h>
1311 #include <jpeglib.h>
1312 int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; }
1314 vnc_jpeg_cflags=""
1315 vnc_jpeg_libs="-ljpeg"
1316 if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
1317 vnc_jpeg=yes
1318 libs_softmmu="$vnc_jpeg_libs $libs_softmmu"
1319 else
1320 if test "$vnc_jpeg" = "yes" ; then
1321 feature_not_found "vnc-jpeg"
1323 vnc_jpeg=no
1327 ##########################################
1328 # VNC PNG detection
1329 if test "$vnc_png" != "no" ; then
1330 cat > $TMPC <<EOF
1331 //#include <stdio.h>
1332 #include <png.h>
1333 int main(void) {
1334 png_structp png_ptr;
1335 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
1336 return 0;
1339 vnc_png_cflags=""
1340 vnc_png_libs="-lpng"
1341 if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
1342 vnc_png=yes
1343 libs_softmmu="$vnc_png_libs $libs_softmmu"
1344 else
1345 if test "$vnc_png" = "yes" ; then
1346 feature_not_found "vnc-png"
1348 vnc_png=no
1352 ##########################################
1353 # fnmatch() probe, used for ACL routines
1354 fnmatch="no"
1355 cat > $TMPC << EOF
1356 #include <fnmatch.h>
1357 int main(void)
1359 fnmatch("foo", "foo", 0);
1360 return 0;
1363 if compile_prog "" "" ; then
1364 fnmatch="yes"
1367 ##########################################
1368 # uuid_generate() probe, used for vdi block driver
1369 if test "$uuid" != "no" ; then
1370 uuid_libs="-luuid"
1371 cat > $TMPC << EOF
1372 #include <uuid/uuid.h>
1373 int main(void)
1375 uuid_t my_uuid;
1376 uuid_generate(my_uuid);
1377 return 0;
1380 if compile_prog "" "$uuid_libs" ; then
1381 uuid="yes"
1382 libs_softmmu="$uuid_libs $libs_softmmu"
1383 libs_tools="$uuid_libs $libs_tools"
1384 else
1385 if test "$uuid" = "yes" ; then
1386 feature_not_found "uuid"
1388 uuid=no
1392 ##########################################
1393 # vde libraries probe
1394 if test "$vde" != "no" ; then
1395 vde_libs="-lvdeplug"
1396 cat > $TMPC << EOF
1397 #include <libvdeplug.h>
1398 int main(void)
1400 struct vde_open_args a = {0, 0, 0};
1401 vde_open("", "", &a);
1402 return 0;
1405 if compile_prog "" "$vde_libs" ; then
1406 vde=yes
1407 libs_softmmu="$vde_libs $libs_softmmu"
1408 libs_tools="$vde_libs $libs_tools"
1409 else
1410 if test "$vde" = "yes" ; then
1411 feature_not_found "vde"
1413 vde=no
1417 ##########################################
1418 # Sound support libraries probe
1420 audio_drv_probe()
1422 drv=$1
1423 hdr=$2
1424 lib=$3
1425 exp=$4
1426 cfl=$5
1427 cat > $TMPC << EOF
1428 #include <$hdr>
1429 int main(void) { $exp }
1431 if compile_prog "$cfl" "$lib" ; then
1433 else
1434 echo
1435 echo "Error: $drv check failed"
1436 echo "Make sure to have the $drv libs and headers installed."
1437 echo
1438 exit 1
1442 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1443 for drv in $audio_drv_list; do
1444 case $drv in
1445 alsa)
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"
1451 fmod)
1452 if test -z $fmod_lib || test -z $fmod_inc; then
1453 echo
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"
1456 echo
1457 exit 1
1459 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1460 libs_softmmu="$fmod_lib $libs_softmmu"
1463 esd)
1464 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1465 libs_softmmu="-lesd $libs_softmmu"
1466 audio_pt_int="yes"
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"
1473 audio_pt_int="yes"
1476 coreaudio)
1477 libs_softmmu="-framework CoreAudio $libs_softmmu"
1480 dsound)
1481 libs_softmmu="-lole32 -ldxguid $libs_softmmu"
1482 audio_win_int="yes"
1485 oss)
1486 libs_softmmu="$oss_lib $libs_softmmu"
1489 sdl|wav)
1490 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1493 winwave)
1494 libs_softmmu="-lwinmm $libs_softmmu"
1495 audio_win_int="yes"
1499 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1500 echo
1501 echo "Error: Unknown driver '$drv' selected"
1502 echo "Possible drivers are: $audio_possible_drivers"
1503 echo
1504 exit 1
1507 esac
1508 done
1510 ##########################################
1511 # BrlAPI probe
1513 if test "$brlapi" != "no" ; then
1514 brlapi_libs="-lbrlapi"
1515 cat > $TMPC << EOF
1516 #include <brlapi.h>
1517 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1519 if compile_prog "" "$brlapi_libs" ; then
1520 brlapi=yes
1521 libs_softmmu="$brlapi_libs $libs_softmmu"
1522 else
1523 if test "$brlapi" = "yes" ; then
1524 feature_not_found "brlapi"
1526 brlapi=no
1530 ##########################################
1531 # curses probe
1532 curses_list="-lncurses -lcurses"
1534 if test "$curses" != "no" ; then
1535 curses_found=no
1536 cat > $TMPC << EOF
1537 #include <curses.h>
1538 #ifdef __OpenBSD__
1539 #define resize_term resizeterm
1540 #endif
1541 int main(void) { resize_term(0, 0); return curses_version(); }
1543 for curses_lib in $curses_list; do
1544 if compile_prog "" "$curses_lib" ; then
1545 curses_found=yes
1546 libs_softmmu="$curses_lib $libs_softmmu"
1547 break
1549 done
1550 if test "$curses_found" = "yes" ; then
1551 curses=yes
1552 else
1553 if test "$curses" = "yes" ; then
1554 feature_not_found "curses"
1556 curses=no
1560 ##########################################
1561 # curl probe
1563 if $pkgconfig libcurl --modversion >/dev/null 2>&1; then
1564 curlconfig="$pkgconfig libcurl"
1565 else
1566 curlconfig=curl-config
1569 if test "$curl" != "no" ; then
1570 cat > $TMPC << EOF
1571 #include <curl/curl.h>
1572 int main(void) { return curl_easy_init(); }
1574 curl_cflags=`$curlconfig --cflags 2>/dev/null`
1575 curl_libs=`$curlconfig --libs 2>/dev/null`
1576 if compile_prog "$curl_cflags" "$curl_libs" ; then
1577 curl=yes
1578 libs_tools="$curl_libs $libs_tools"
1579 libs_softmmu="$curl_libs $libs_softmmu"
1580 else
1581 if test "$curl" = "yes" ; then
1582 feature_not_found "curl"
1584 curl=no
1586 fi # test "$curl"
1588 ##########################################
1589 # check framework probe
1591 if test "$check_utests" != "no" ; then
1592 cat > $TMPC << EOF
1593 #include <check.h>
1594 int main(void) { suite_create("qemu test"); return 0; }
1596 check_libs=`$pkgconfig --libs check`
1597 if compile_prog "" $check_libs ; then
1598 check_utests=yes
1599 libs_tools="$check_libs $libs_tools"
1600 else
1601 if test "$check_utests" = "yes" ; then
1602 feature_not_found "check"
1604 check_utests=no
1606 fi # test "$check_utests"
1608 ##########################################
1609 # bluez support probe
1610 if test "$bluez" != "no" ; then
1611 cat > $TMPC << EOF
1612 #include <bluetooth/bluetooth.h>
1613 int main(void) { return bt_error(0); }
1615 bluez_cflags=`$pkgconfig --cflags bluez 2> /dev/null`
1616 bluez_libs=`$pkgconfig --libs bluez 2> /dev/null`
1617 if compile_prog "$bluez_cflags" "$bluez_libs" ; then
1618 bluez=yes
1619 libs_softmmu="$bluez_libs $libs_softmmu"
1620 else
1621 if test "$bluez" = "yes" ; then
1622 feature_not_found "bluez"
1624 bluez="no"
1628 ##########################################
1629 # kvm probe
1630 if test "$kvm" != "no" ; then
1631 cat > $TMPC <<EOF
1632 #include <linux/kvm.h>
1633 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1634 #error Invalid KVM version
1635 #endif
1636 #if !defined(KVM_CAP_USER_MEMORY)
1637 #error Missing KVM capability KVM_CAP_USER_MEMORY
1638 #endif
1639 #if !defined(KVM_CAP_SET_TSS_ADDR)
1640 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1641 #endif
1642 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1643 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1644 #endif
1645 int main(void) { return 0; }
1647 if test "$kerneldir" != "" ; then
1648 kvm_cflags=-I"$kerneldir"/include
1649 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1650 -a -d "$kerneldir/arch/x86/include" ; then
1651 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1652 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1653 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1654 elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
1655 kvm_cflags="$kvm_cflags -I$kerneldir/arch/s390/include"
1656 elif test -d "$kerneldir/arch/$cpu/include" ; then
1657 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1659 else
1660 kvm_cflags=`$pkgconfig --cflags kvm-kmod 2>/dev/null`
1661 if test "$kvm_cflags" = ""; then
1662 case "$cpu" in
1663 i386 | x86_64)
1664 kvm_arch="x86"
1666 ppc)
1667 kvm_arch="powerpc"
1670 kvm_arch="$cpu"
1672 esac
1673 kvm_cflags="-I$source_path/kvm/include"
1674 kvm_cflags="$kvm_cflags -include $source_path/kvm/include/linux/config.h"
1675 kvm_cflags="$kvm_cflags -I$source_path/kvm/include/$kvm_arch"
1678 kvm_cflags="$kvm_cflags -idirafter $source_path/compat"
1679 if compile_prog "$kvm_cflags" "" ; then
1680 kvm=yes
1681 cat > $TMPC <<EOF
1682 #include <linux/kvm_para.h>
1683 int main(void) { return 0; }
1685 if compile_prog "$kvm_cflags" "" ; then
1686 kvm_para=yes
1688 else
1689 if test "$kvm" = "yes" ; then
1690 if has awk && has grep; then
1691 kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
1692 | grep "error: " \
1693 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1694 if test "$kvmerr" != "" ; then
1695 echo -e "${kvmerr}\n\
1696 NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
1697 recent kvm-kmod from http://sourceforge.net/projects/kvm."
1700 feature_not_found "kvm"
1702 kvm=no
1706 ##########################################
1707 # test for KVM_CAP_PIT
1709 if test "$kvm_cap_pit" != "no" ; then
1710 if test "$kvm" = "no" -a "$kvm_cap_pit" = "yes" ; then
1711 feature_not_found "kvm_cap_pit (kvm is not enabled)"
1713 cat > $TMPC <<EOF
1714 #include <linux/kvm.h>
1715 #ifndef KVM_CAP_PIT
1716 #error "kvm no pit capability"
1717 #endif
1718 int main(void) { return 0; }
1720 if compile_prog "$kvm_cflags" ""; then
1721 kvm_cap_pit=yes
1722 else
1723 if test "$kvm_cap_pit" = "yes" ; then
1724 feature_not_found "kvm_cap_pit"
1726 kvm_cap_pit=no
1730 ##########################################
1731 # test for KVM_CAP_DEVICE_ASSIGNMENT
1733 if test "$kvm_cap_device_assignment" != "no" ; then
1734 if test "$kvm" = "no" -a "$kvm_cap_device_assignment" = "yes" ; then
1735 feature_not_found "kvm_cap_device_assignment (kvm is not enabled)"
1737 cat > $TMPC <<EOF
1738 #include <linux/kvm.h>
1739 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
1740 #error "kvm no device assignment capability"
1741 #endif
1742 int main(void) { return 0; }
1744 if compile_prog "$kvm_cflags" "" ; then
1745 kvm_cap_device_assignment=yes
1746 else
1747 if test "$kvm_cap_device_assignment" = "yes" ; then
1748 feature_not_found "kvm_cap_device_assigment"
1750 kvm_cap_device_assignment=no
1754 ##########################################
1755 # libpci header probe for kvm_cap_device_assignment
1756 if test $kvm_cap_device_assignment = "yes" ; then
1757 cat > $TMPC << EOF
1758 #include <pci/header.h>
1759 #ifndef PCI_VENDOR_ID
1760 #error NO LIBPCI HEADER
1761 #endif
1762 int main(void) { return 0; }
1764 if compile_prog "" "" ; then
1765 kvm_cap_device_assignment=yes
1766 else
1767 echo
1768 echo "Error: libpci header check failed"
1769 echo "Disable KVM Device Assignment capability."
1770 echo
1771 kvm_cap_device_assignment=no
1775 ##########################################
1776 # test for vhost net
1778 if test "$vhost_net" != "no"; then
1779 if test "$kvm" != "no"; then
1780 cat > $TMPC <<EOF
1781 #include <linux/vhost.h>
1782 int main(void) { return 0; }
1784 if compile_prog "$kvm_cflags" "" ; then
1785 vhost_net=yes
1786 else
1787 if test "$vhost_net" = "yes" ; then
1788 feature_not_found "vhost-net"
1790 vhost_net=no
1792 else
1793 if test "$vhost_net" = "yes" ; then
1794 echo "NOTE: vhost-net feature requires KVM (--enable-kvm)."
1795 feature_not_found "vhost-net"
1797 vhost_net=no
1801 ##########################################
1802 # pthread probe
1803 PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
1805 pthread=no
1806 cat > $TMPC << EOF
1807 #include <pthread.h>
1808 int main(void) { pthread_create(0,0,0,0); return 0; }
1810 for pthread_lib in $PTHREADLIBS_LIST; do
1811 if compile_prog "" "$pthread_lib" ; then
1812 pthread=yes
1813 LIBS="$pthread_lib $LIBS"
1814 break
1816 done
1818 if test "$mingw32" != yes -a "$pthread" = no; then
1819 echo
1820 echo "Error: pthread check failed"
1821 echo "Make sure to have the pthread libs and headers installed."
1822 echo
1823 exit 1
1826 ##########################################
1827 # linux-aio probe
1829 if test "$linux_aio" != "no" ; then
1830 cat > $TMPC <<EOF
1831 #include <libaio.h>
1832 #include <sys/eventfd.h>
1833 int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
1835 if compile_prog "" "-laio" ; then
1836 linux_aio=yes
1837 libs_softmmu="$libs_softmmu -laio"
1838 libs_tools="$libs_tools -laio"
1839 else
1840 if test "$linux_aio" = "yes" ; then
1841 feature_not_found "linux AIO"
1843 linux_aio=no
1847 ##########################################
1848 # attr probe
1850 if test "$attr" != "no" ; then
1851 cat > $TMPC <<EOF
1852 #include <stdio.h>
1853 #include <sys/types.h>
1854 #include <attr/xattr.h>
1855 int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }
1857 if compile_prog "" "-lattr" ; then
1858 attr=yes
1859 LIBS="-lattr $LIBS"
1860 else
1861 if test "$attr" = "yes" ; then
1862 feature_not_found "ATTR"
1864 attr=no
1868 ##########################################
1869 # iovec probe
1870 cat > $TMPC <<EOF
1871 #include <sys/types.h>
1872 #include <sys/uio.h>
1873 #include <unistd.h>
1874 int main(void) { struct iovec iov; return 0; }
1876 iovec=no
1877 if compile_prog "" "" ; then
1878 iovec=yes
1881 ##########################################
1882 # preadv probe
1883 cat > $TMPC <<EOF
1884 #include <sys/types.h>
1885 #include <sys/uio.h>
1886 #include <unistd.h>
1887 int main(void) { preadv; }
1889 preadv=no
1890 if compile_prog "" "" ; then
1891 preadv=yes
1894 ##########################################
1895 # fdt probe
1896 if test "$fdt" != "no" ; then
1897 fdt_libs="-lfdt"
1898 cat > $TMPC << EOF
1899 int main(void) { return 0; }
1901 if compile_prog "" "$fdt_libs" ; then
1902 fdt=yes
1903 libs_softmmu="$fdt_libs $libs_softmmu"
1904 else
1905 if test "$fdt" = "yes" ; then
1906 feature_not_found "fdt"
1908 fdt=no
1913 # Check for xxxat() functions when we are building linux-user
1914 # emulator. This is done because older glibc versions don't
1915 # have syscall stubs for these implemented.
1917 atfile=no
1918 cat > $TMPC << EOF
1919 #define _ATFILE_SOURCE
1920 #include <sys/types.h>
1921 #include <fcntl.h>
1922 #include <unistd.h>
1925 main(void)
1927 /* try to unlink nonexisting file */
1928 return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
1931 if compile_prog "" "" ; then
1932 atfile=yes
1935 # Check for inotify functions when we are building linux-user
1936 # emulator. This is done because older glibc versions don't
1937 # have syscall stubs for these implemented. In that case we
1938 # don't provide them even if kernel supports them.
1940 inotify=no
1941 cat > $TMPC << EOF
1942 #include <sys/inotify.h>
1945 main(void)
1947 /* try to start inotify */
1948 return inotify_init();
1951 if compile_prog "" "" ; then
1952 inotify=yes
1955 inotify1=no
1956 cat > $TMPC << EOF
1957 #include <sys/inotify.h>
1960 main(void)
1962 /* try to start inotify */
1963 return inotify_init1(0);
1966 if compile_prog "" "" ; then
1967 inotify1=yes
1970 # check if utimensat and futimens are supported
1971 utimens=no
1972 cat > $TMPC << EOF
1973 #define _ATFILE_SOURCE
1974 #define _GNU_SOURCE
1975 #include <stddef.h>
1976 #include <fcntl.h>
1978 int main(void)
1980 utimensat(AT_FDCWD, "foo", NULL, 0);
1981 futimens(0, NULL);
1982 return 0;
1985 if compile_prog "" "" ; then
1986 utimens=yes
1989 # check if pipe2 is there
1990 pipe2=no
1991 cat > $TMPC << EOF
1992 #define _GNU_SOURCE
1993 #include <unistd.h>
1994 #include <fcntl.h>
1996 int main(void)
1998 int pipefd[2];
1999 pipe2(pipefd, O_CLOEXEC);
2000 return 0;
2003 if compile_prog "" "" ; then
2004 pipe2=yes
2007 # check if accept4 is there
2008 accept4=no
2009 cat > $TMPC << EOF
2010 #define _GNU_SOURCE
2011 #include <sys/socket.h>
2012 #include <stddef.h>
2014 int main(void)
2016 accept4(0, NULL, NULL, SOCK_CLOEXEC);
2017 return 0;
2020 if compile_prog "" "" ; then
2021 accept4=yes
2024 # check if tee/splice is there. vmsplice was added same time.
2025 splice=no
2026 cat > $TMPC << EOF
2027 #define _GNU_SOURCE
2028 #include <unistd.h>
2029 #include <fcntl.h>
2030 #include <limits.h>
2032 int main(void)
2034 int len, fd;
2035 len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
2036 splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
2037 return 0;
2040 if compile_prog "" "" ; then
2041 splice=yes
2044 ##########################################
2045 # signalfd probe
2046 signalfd="no"
2047 cat > $TMPC << EOF
2048 #define _GNU_SOURCE
2049 #include <unistd.h>
2050 #include <sys/syscall.h>
2051 #include <signal.h>
2052 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
2055 if compile_prog "" "" ; then
2056 signalfd=yes
2059 # check if eventfd is supported
2060 eventfd=no
2061 cat > $TMPC << EOF
2062 #include <sys/eventfd.h>
2064 int main(void)
2066 int efd = eventfd(0, 0);
2067 return 0;
2070 if compile_prog "" "" ; then
2071 eventfd=yes
2074 # check for fallocate
2075 fallocate=no
2076 cat > $TMPC << EOF
2077 #include <fcntl.h>
2079 int main(void)
2081 fallocate(0, 0, 0, 0);
2082 return 0;
2085 if compile_prog "$ARCH_CFLAGS" "" ; then
2086 fallocate=yes
2089 # check for dup3
2090 dup3=no
2091 cat > $TMPC << EOF
2092 #include <unistd.h>
2094 int main(void)
2096 dup3(0, 0, 0);
2097 return 0;
2100 if compile_prog "" "" ; then
2101 dup3=yes
2104 # Check if tools are available to build documentation.
2105 if test "$docs" != "no" ; then
2106 if has makeinfo && has pod2man; then
2107 docs=yes
2108 else
2109 if test "$docs" = "yes" ; then
2110 feature_not_found "docs"
2112 docs=no
2116 # Search for bswap_32 function
2117 byteswap_h=no
2118 cat > $TMPC << EOF
2119 #include <byteswap.h>
2120 int main(void) { return bswap_32(0); }
2122 if compile_prog "" "" ; then
2123 byteswap_h=yes
2126 # Search for bswap_32 function
2127 bswap_h=no
2128 cat > $TMPC << EOF
2129 #include <sys/endian.h>
2130 #include <sys/types.h>
2131 #include <machine/bswap.h>
2132 int main(void) { return bswap32(0); }
2134 if compile_prog "" "" ; then
2135 bswap_h=yes
2138 ##########################################
2139 # Do we need librt
2140 cat > $TMPC <<EOF
2141 #include <signal.h>
2142 #include <time.h>
2143 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
2146 if compile_prog "" "" ; then
2148 elif compile_prog "" "-lrt" ; then
2149 LIBS="-lrt $LIBS"
2152 if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
2153 "$aix" != "yes" ; then
2154 libs_softmmu="-lutil $libs_softmmu"
2157 ##########################################
2158 # check if the compiler defines offsetof
2160 need_offsetof=yes
2161 cat > $TMPC << EOF
2162 #include <stddef.h>
2163 int main(void) { struct s { int f; }; return offsetof(struct s, f); }
2165 if compile_prog "" "" ; then
2166 need_offsetof=no
2169 ##########################################
2170 # check if the compiler understands attribute warn_unused_result
2172 # This could be smarter, but gcc -Werror does not error out even when warning
2173 # about attribute warn_unused_result
2175 gcc_attribute_warn_unused_result=no
2176 cat > $TMPC << EOF
2177 #if defined(__GNUC__) && (__GNUC__ < 4) && defined(__GNUC_MINOR__) && (__GNUC__ < 4)
2178 #error gcc 3.3 or older
2179 #endif
2180 int main(void) { return 0;}
2182 if compile_prog "" ""; then
2183 gcc_attribute_warn_unused_result=yes
2186 ##########################################
2187 # check if we have fdatasync
2189 fdatasync=no
2190 cat > $TMPC << EOF
2191 #include <unistd.h>
2192 int main(void) { return fdatasync(0); }
2194 if compile_prog "" "" ; then
2195 fdatasync=yes
2198 # End of CC checks
2199 # After here, no more $cc or $ld runs
2201 if test "$debug" = "no" ; then
2202 CFLAGS="-O2 $CFLAGS"
2205 # Consult white-list to determine whether to enable werror
2206 # by default. Only enable by default for git builds
2207 z_version=`cut -f3 -d. $source_path/VERSION`
2209 if test -z "$werror" ; then
2210 if test "$z_version" = "50" -a \
2211 "$linux" = "yes" ; then
2212 werror="yes"
2213 else
2214 werror="no"
2218 # Disable zero malloc errors for official releases unless explicitly told to
2219 # enable/disable
2220 if test -z "$zero_malloc" ; then
2221 if test "$z_version" = "50" ; then
2222 zero_malloc="no"
2223 else
2224 zero_malloc="yes"
2228 if test "$werror" = "yes" ; then
2229 QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
2232 if test "$solaris" = "no" ; then
2233 if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
2234 LDFLAGS="-Wl,--warn-common $LDFLAGS"
2238 confdir=$sysconfdir$confsuffix
2240 tools=
2241 if test "$softmmu" = yes ; then
2242 tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
2243 if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
2244 tools="qemu-nbd\$(EXESUF) $tools"
2245 if [ "$check_utests" = "yes" ]; then
2246 tools="check-qint check-qstring check-qdict check-qlist $tools"
2247 tools="check-qfloat check-qjson $tools"
2252 # Mac OS X ships with a broken assembler
2253 roms=
2254 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
2255 "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
2256 "$softmmu" = yes ; then
2257 roms="optionrom"
2261 echo "Install prefix $prefix"
2262 echo "BIOS directory `eval echo $datadir`"
2263 echo "binary directory `eval echo $bindir`"
2264 echo "config directory `eval echo $sysconfdir`"
2265 if test "$mingw32" = "no" ; then
2266 echo "Manual directory `eval echo $mandir`"
2267 echo "ELF interp prefix $interp_prefix"
2269 echo "Source path $source_path"
2270 echo "C compiler $cc"
2271 echo "Host C compiler $host_cc"
2272 echo "CFLAGS $CFLAGS"
2273 echo "QEMU_CFLAGS $QEMU_CFLAGS"
2274 echo "LDFLAGS $LDFLAGS"
2275 echo "make $make"
2276 echo "install $install"
2277 echo "host CPU $cpu"
2278 echo "host big endian $bigendian"
2279 echo "target list $target_list"
2280 echo "tcg debug enabled $debug_tcg"
2281 echo "Mon debug enabled $debug_mon"
2282 echo "gprof enabled $gprof"
2283 echo "sparse enabled $sparse"
2284 echo "strip binaries $strip_opt"
2285 echo "profiler $profiler"
2286 echo "static build $static"
2287 echo "-Werror enabled $werror"
2288 if test "$darwin" = "yes" ; then
2289 echo "Cocoa support $cocoa"
2291 echo "SDL support $sdl"
2292 echo "curses support $curses"
2293 echo "curl support $curl"
2294 echo "check support $check_utests"
2295 echo "mingw32 support $mingw32"
2296 echo "Audio drivers $audio_drv_list"
2297 echo "Extra audio cards $audio_card_list"
2298 echo "Block whitelist $block_drv_whitelist"
2299 echo "Mixer emulation $mixemu"
2300 echo "VNC TLS support $vnc_tls"
2301 echo "VNC SASL support $vnc_sasl"
2302 echo "VNC JPEG support $vnc_jpeg"
2303 echo "VNC PNG support $vnc_png"
2304 echo "VNC thread $vnc_thread"
2305 if test -n "$sparc_cpu"; then
2306 echo "Target Sparc Arch $sparc_cpu"
2308 echo "xen support $xen"
2309 echo "CPU emulation $cpu_emulation"
2310 echo "brlapi support $brlapi"
2311 echo "bluez support $bluez"
2312 echo "Documentation $docs"
2313 [ ! -z "$uname_release" ] && \
2314 echo "uname -r $uname_release"
2315 echo "NPTL support $nptl"
2316 echo "GUEST_BASE $guest_base"
2317 echo "PIE user targets $user_pie"
2318 echo "vde support $vde"
2319 echo "IO thread $io_thread"
2320 echo "Linux AIO support $linux_aio"
2321 echo "ATTR/XATTR support $attr"
2322 echo "Install blobs $blobs"
2323 echo "KVM support $kvm"
2324 echo "KVM PIT support $kvm_cap_pit"
2325 echo "KVM device assig. $kvm_cap_device_assignment"
2326 echo "fdt support $fdt"
2327 echo "preadv support $preadv"
2328 echo "fdatasync $fdatasync"
2329 echo "uuid support $uuid"
2330 echo "vhost-net support $vhost_net"
2332 if test $sdl_too_old = "yes"; then
2333 echo "-> Your SDL version is too old - please upgrade to have SDL support"
2336 config_host_mak="config-host.mak"
2337 config_host_ld="config-host.ld"
2339 echo "# Automatically generated by configure - do not modify" > $config_host_mak
2340 printf "# Configured with:" >> $config_host_mak
2341 printf " '%s'" "$0" "$@" >> $config_host_mak
2342 echo >> $config_host_mak
2344 echo "prefix=$prefix" >> $config_host_mak
2345 echo "bindir=$bindir" >> $config_host_mak
2346 echo "mandir=$mandir" >> $config_host_mak
2347 echo "datadir=$datadir" >> $config_host_mak
2348 echo "sysconfdir=$sysconfdir" >> $config_host_mak
2349 echo "docdir=$docdir" >> $config_host_mak
2350 echo "confdir=$confdir" >> $config_host_mak
2352 case "$cpu" in
2353 i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
2354 ARCH=$cpu
2356 armv4b|armv4l)
2357 ARCH=arm
2359 esac
2360 echo "ARCH=$ARCH" >> $config_host_mak
2361 if test "$debug_tcg" = "yes" ; then
2362 echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
2364 if test "$debug_mon" = "yes" ; then
2365 echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
2367 if test "$debug" = "yes" ; then
2368 echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
2370 if test "$strip_opt" = "yes" ; then
2371 echo "STRIP=${strip}" >> $config_host_mak
2373 if test "$bigendian" = "yes" ; then
2374 echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
2376 echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
2377 if test "$mingw32" = "yes" ; then
2378 echo "CONFIG_WIN32=y" >> $config_host_mak
2379 else
2380 echo "CONFIG_POSIX=y" >> $config_host_mak
2383 if test "$linux" = "yes" ; then
2384 echo "CONFIG_LINUX=y" >> $config_host_mak
2387 if test "$darwin" = "yes" ; then
2388 echo "CONFIG_DARWIN=y" >> $config_host_mak
2391 if test "$aix" = "yes" ; then
2392 echo "CONFIG_AIX=y" >> $config_host_mak
2395 if test "$solaris" = "yes" ; then
2396 echo "CONFIG_SOLARIS=y" >> $config_host_mak
2397 echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
2398 if test "$needs_libsunmath" = "yes" ; then
2399 echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
2402 if test "$static" = "yes" ; then
2403 echo "CONFIG_STATIC=y" >> $config_host_mak
2405 if test $profiler = "yes" ; then
2406 echo "CONFIG_PROFILER=y" >> $config_host_mak
2408 if test "$slirp" = "yes" ; then
2409 echo "CONFIG_SLIRP=y" >> $config_host_mak
2410 QEMU_CFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
2412 if test "$vde" = "yes" ; then
2413 echo "CONFIG_VDE=y" >> $config_host_mak
2415 for card in $audio_card_list; do
2416 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
2417 echo "$def=y" >> $config_host_mak
2418 done
2419 echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
2420 for drv in $audio_drv_list; do
2421 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
2422 echo "$def=y" >> $config_host_mak
2423 if test "$drv" = "fmod"; then
2424 echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
2426 done
2427 if test "$audio_pt_int" = "yes" ; then
2428 echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
2430 if test "$audio_win_int" = "yes" ; then
2431 echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
2433 echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
2434 if test "$mixemu" = "yes" ; then
2435 echo "CONFIG_MIXEMU=y" >> $config_host_mak
2437 if test "$vnc_tls" = "yes" ; then
2438 echo "CONFIG_VNC_TLS=y" >> $config_host_mak
2439 echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
2441 if test "$vnc_sasl" = "yes" ; then
2442 echo "CONFIG_VNC_SASL=y" >> $config_host_mak
2443 echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
2445 if test "$vnc_jpeg" != "no" ; then
2446 echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
2447 echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
2449 if test "$vnc_png" != "no" ; then
2450 echo "CONFIG_VNC_PNG=y" >> $config_host_mak
2451 echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
2453 if test "$vnc_thread" != "no" ; then
2454 echo "CONFIG_VNC_THREAD=y" >> $config_host_mak
2455 echo "CONFIG_THREAD=y" >> $config_host_mak
2457 if test "$fnmatch" = "yes" ; then
2458 echo "CONFIG_FNMATCH=y" >> $config_host_mak
2460 if test "$uuid" = "yes" ; then
2461 echo "CONFIG_UUID=y" >> $config_host_mak
2463 qemu_version=`head $source_path/VERSION`
2464 echo "VERSION=$qemu_version" >>$config_host_mak
2465 echo "PKGVERSION=$pkgversion" >>$config_host_mak
2466 echo "SRC_PATH=$source_path" >> $config_host_mak
2467 echo "TARGET_DIRS=$target_list" >> $config_host_mak
2468 if [ "$docs" = "yes" ] ; then
2469 echo "BUILD_DOCS=yes" >> $config_host_mak
2471 if test "$sdl" = "yes" ; then
2472 echo "CONFIG_SDL=y" >> $config_host_mak
2473 echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
2475 if test "$cocoa" = "yes" ; then
2476 echo "CONFIG_COCOA=y" >> $config_host_mak
2478 if test "$curses" = "yes" ; then
2479 echo "CONFIG_CURSES=y" >> $config_host_mak
2481 if test "$atfile" = "yes" ; then
2482 echo "CONFIG_ATFILE=y" >> $config_host_mak
2484 if test "$utimens" = "yes" ; then
2485 echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
2487 if test "$pipe2" = "yes" ; then
2488 echo "CONFIG_PIPE2=y" >> $config_host_mak
2490 if test "$accept4" = "yes" ; then
2491 echo "CONFIG_ACCEPT4=y" >> $config_host_mak
2493 if test "$splice" = "yes" ; then
2494 echo "CONFIG_SPLICE=y" >> $config_host_mak
2496 if test "$eventfd" = "yes" ; then
2497 echo "CONFIG_EVENTFD=y" >> $config_host_mak
2499 if test "$fallocate" = "yes" ; then
2500 echo "CONFIG_FALLOCATE=y" >> $config_host_mak
2502 if test "$dup3" = "yes" ; then
2503 echo "CONFIG_DUP3=y" >> $config_host_mak
2505 if test "$inotify" = "yes" ; then
2506 echo "CONFIG_INOTIFY=y" >> $config_host_mak
2508 if test "$inotify1" = "yes" ; then
2509 echo "CONFIG_INOTIFY1=y" >> $config_host_mak
2511 if test "$byteswap_h" = "yes" ; then
2512 echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
2514 if test "$bswap_h" = "yes" ; then
2515 echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
2517 if test "$curl" = "yes" ; then
2518 echo "CONFIG_CURL=y" >> $config_host_mak
2519 echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
2521 if test "$brlapi" = "yes" ; then
2522 echo "CONFIG_BRLAPI=y" >> $config_host_mak
2524 if test "$bluez" = "yes" ; then
2525 echo "CONFIG_BLUEZ=y" >> $config_host_mak
2526 echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
2528 if test "$xen" = "yes" ; then
2529 echo "CONFIG_XEN=y" >> $config_host_mak
2531 if test "$io_thread" = "yes" ; then
2532 echo "CONFIG_IOTHREAD=y" >> $config_host_mak
2533 echo "CONFIG_THREAD=y" >> $config_host_mak
2535 if test "$linux_aio" = "yes" ; then
2536 echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
2538 if test "$attr" = "yes" ; then
2539 echo "CONFIG_ATTR=y" >> $config_host_mak
2541 if test "$linux" = "yes" ; then
2542 if test "$attr" = "yes" ; then
2543 echo "CONFIG_VIRTFS=y" >> $config_host_mak
2546 if test "$blobs" = "yes" ; then
2547 echo "INSTALL_BLOBS=yes" >> $config_host_mak
2549 if test "$iovec" = "yes" ; then
2550 echo "CONFIG_IOVEC=y" >> $config_host_mak
2552 if test "$preadv" = "yes" ; then
2553 echo "CONFIG_PREADV=y" >> $config_host_mak
2555 if test "$fdt" = "yes" ; then
2556 echo "CONFIG_FDT=y" >> $config_host_mak
2558 if test "$signalfd" = "yes" ; then
2559 echo "CONFIG_SIGNALFD=y" >> $config_host_mak
2561 if test "$need_offsetof" = "yes" ; then
2562 echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
2564 if test "$gcc_attribute_warn_unused_result" = "yes" ; then
2565 echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
2567 if test "$fdatasync" = "yes" ; then
2568 echo "CONFIG_FDATASYNC=y" >> $config_host_mak
2570 if test $cpu_emulation = "yes"; then
2571 echo "CONFIG_CPU_EMULATION=y" >> $config_host_mak
2572 else
2573 echo "CONFIG_NO_CPU_EMULATION=y" >> $config_host_mak
2576 # XXX: suppress that
2577 if [ "$bsd" = "yes" ] ; then
2578 echo "CONFIG_BSD=y" >> $config_host_mak
2581 echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
2583 if test "$zero_malloc" = "yes" ; then
2584 echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
2587 # USB host support
2588 case "$usb" in
2589 linux)
2590 echo "HOST_USB=linux" >> $config_host_mak
2592 bsd)
2593 echo "HOST_USB=bsd" >> $config_host_mak
2596 echo "HOST_USB=stub" >> $config_host_mak
2598 esac
2600 echo "TOOLS=$tools" >> $config_host_mak
2601 echo "ROMS=$roms" >> $config_host_mak
2602 echo "MAKE=$make" >> $config_host_mak
2603 echo "INSTALL=$install" >> $config_host_mak
2604 echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
2605 echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
2606 echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
2607 echo "CC=$cc" >> $config_host_mak
2608 echo "HOST_CC=$host_cc" >> $config_host_mak
2609 if test "$sparse" = "yes" ; then
2610 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
2611 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
2612 echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
2614 echo "AR=$ar" >> $config_host_mak
2615 echo "OBJCOPY=$objcopy" >> $config_host_mak
2616 echo "LD=$ld" >> $config_host_mak
2617 echo "CFLAGS=$CFLAGS" >> $config_host_mak
2618 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
2619 echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
2620 echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
2621 echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
2622 echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
2623 echo "LIBS+=$LIBS" >> $config_host_mak
2624 echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
2625 echo "EXESUF=$EXESUF" >> $config_host_mak
2627 # generate list of library paths for linker script
2629 $ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld}
2631 if test -f ${config_host_ld}~ ; then
2632 if cmp -s $config_host_ld ${config_host_ld}~ ; then
2633 mv ${config_host_ld}~ $config_host_ld
2634 else
2635 rm ${config_host_ld}~
2639 for d in libdis libdis-user; do
2640 mkdir -p $d
2641 rm -f $d/Makefile
2642 ln -s $source_path/Makefile.dis $d/Makefile
2643 echo > $d/config.mak
2644 done
2645 if test "$static" = "no" -a "$user_pie" = "yes" ; then
2646 echo "QEMU_CFLAGS+=-fpie" > libdis-user/config.mak
2649 for target in $target_list; do
2650 target_dir="$target"
2651 config_target_mak=$target_dir/config-target.mak
2652 target_arch2=`echo $target | cut -d '-' -f 1`
2653 target_bigendian="no"
2655 case "$target_arch2" in
2656 armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus)
2657 target_bigendian=yes
2659 esac
2660 target_softmmu="no"
2661 target_user_only="no"
2662 target_linux_user="no"
2663 target_darwin_user="no"
2664 target_bsd_user="no"
2665 case "$target" in
2666 ${target_arch2}-softmmu)
2667 target_softmmu="yes"
2669 ${target_arch2}-linux-user)
2670 if test "$linux" != "yes" ; then
2671 echo "ERROR: Target '$target' is only available on a Linux host"
2672 exit 1
2674 target_user_only="yes"
2675 target_linux_user="yes"
2677 ${target_arch2}-darwin-user)
2678 if test "$darwin" != "yes" ; then
2679 echo "ERROR: Target '$target' is only available on a Darwin host"
2680 exit 1
2682 target_user_only="yes"
2683 target_darwin_user="yes"
2685 ${target_arch2}-bsd-user)
2686 if test "$bsd" != "yes" ; then
2687 echo "ERROR: Target '$target' is only available on a BSD host"
2688 exit 1
2690 target_user_only="yes"
2691 target_bsd_user="yes"
2694 echo "ERROR: Target '$target' not recognised"
2695 exit 1
2697 esac
2699 mkdir -p $target_dir
2700 mkdir -p $target_dir/fpu
2701 mkdir -p $target_dir/tcg
2702 mkdir -p $target_dir/ide
2703 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
2704 mkdir -p $target_dir/nwfpe
2708 # don't use ln -sf as not all "ln -sf" over write the file/link
2710 rm -f $target_dir/Makefile
2711 ln -s $source_path/Makefile.target $target_dir/Makefile
2714 echo "# Automatically generated by configure - do not modify" > $config_target_mak
2716 bflt="no"
2717 target_nptl="no"
2718 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
2719 echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
2720 gdb_xml_files=""
2722 TARGET_ARCH="$target_arch2"
2723 TARGET_BASE_ARCH=""
2724 TARGET_ABI_DIR=""
2726 case "$target_arch2" in
2727 i386)
2728 target_phys_bits=32
2730 x86_64)
2731 TARGET_BASE_ARCH=i386
2732 target_phys_bits=64
2734 ia64)
2735 target_phys_bits=64
2737 alpha)
2738 target_phys_bits=64
2739 target_nptl="yes"
2741 arm|armeb)
2742 TARGET_ARCH=arm
2743 bflt="yes"
2744 target_nptl="yes"
2745 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
2746 target_phys_bits=32
2748 cris)
2749 target_nptl="yes"
2750 target_phys_bits=32
2752 m68k)
2753 bflt="yes"
2754 gdb_xml_files="cf-core.xml cf-fp.xml"
2755 target_phys_bits=32
2757 microblaze)
2758 bflt="yes"
2759 target_nptl="yes"
2760 target_phys_bits=32
2762 mips|mipsel)
2763 TARGET_ARCH=mips
2764 echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
2765 target_nptl="yes"
2766 target_phys_bits=64
2768 mipsn32|mipsn32el)
2769 TARGET_ARCH=mipsn32
2770 TARGET_BASE_ARCH=mips
2771 echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
2772 target_phys_bits=64
2774 mips64|mips64el)
2775 TARGET_ARCH=mips64
2776 TARGET_BASE_ARCH=mips
2777 echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
2778 target_phys_bits=64
2780 ppc)
2781 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2782 target_phys_bits=32
2783 target_nptl="yes"
2785 ppcemb)
2786 TARGET_BASE_ARCH=ppc
2787 TARGET_ABI_DIR=ppc
2788 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2789 target_phys_bits=64
2790 target_nptl="yes"
2792 ppc64)
2793 TARGET_BASE_ARCH=ppc
2794 TARGET_ABI_DIR=ppc
2795 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2796 target_phys_bits=64
2798 ppc64abi32)
2799 TARGET_ARCH=ppc64
2800 TARGET_BASE_ARCH=ppc
2801 TARGET_ABI_DIR=ppc
2802 echo "TARGET_ABI32=y" >> $config_target_mak
2803 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2804 target_phys_bits=64
2806 sh4|sh4eb)
2807 TARGET_ARCH=sh4
2808 bflt="yes"
2809 target_nptl="yes"
2810 target_phys_bits=32
2812 sparc)
2813 target_phys_bits=64
2815 sparc64)
2816 TARGET_BASE_ARCH=sparc
2817 target_phys_bits=64
2819 sparc32plus)
2820 TARGET_ARCH=sparc64
2821 TARGET_BASE_ARCH=sparc
2822 TARGET_ABI_DIR=sparc
2823 echo "TARGET_ABI32=y" >> $config_target_mak
2824 target_phys_bits=64
2826 s390x)
2827 target_phys_bits=64
2830 echo "Unsupported target CPU"
2831 exit 1
2833 esac
2834 echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
2835 target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
2836 echo "TARGET_$target_arch_name=y" >> $config_target_mak
2837 echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
2838 # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
2839 if [ "$TARGET_BASE_ARCH" = "" ]; then
2840 TARGET_BASE_ARCH=$TARGET_ARCH
2842 echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
2843 if [ "$TARGET_ABI_DIR" = "" ]; then
2844 TARGET_ABI_DIR=$TARGET_ARCH
2846 echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
2847 case "$target_arch2" in
2848 i386|x86_64)
2849 if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
2850 echo "CONFIG_XEN=y" >> $config_target_mak
2852 esac
2853 case "$target_arch2" in
2854 i386|x86_64|ppcemb|ppc|ppc64|s390x)
2855 # Make sure the target and host cpus are compatible
2856 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
2857 \( "$target_arch2" = "$cpu" -o \
2858 \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
2859 \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \
2860 \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \
2861 \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then
2862 echo "CONFIG_KVM=y" >> $config_target_mak
2863 echo "KVM_CFLAGS=$kvm_cflags" >> $config_target_mak
2864 if test "$kvm_para" = "yes"; then
2865 echo "CONFIG_KVM_PARA=y" >> $config_target_mak
2867 if test $kvm_cap_pit = "yes" ; then
2868 echo "CONFIG_KVM_PIT=y" >> $config_target_mak
2870 if test $kvm_cap_device_assignment = "yes" ; then
2871 echo "CONFIG_KVM_DEVICE_ASSIGNMENT=y" >> $config_target_mak
2873 if test $vhost_net = "yes" ; then
2874 echo "CONFIG_VHOST_NET=y" >> $config_target_mak
2877 esac
2878 if test "$target_bigendian" = "yes" ; then
2879 echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
2881 if test "$target_softmmu" = "yes" ; then
2882 echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
2883 echo "CONFIG_SOFTMMU=y" >> $config_target_mak
2884 echo "LIBS+=$libs_softmmu" >> $config_target_mak
2885 echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
2886 echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
2888 if test "$target_user_only" = "yes" ; then
2889 echo "CONFIG_USER_ONLY=y" >> $config_target_mak
2891 if test "$target_linux_user" = "yes" ; then
2892 echo "CONFIG_LINUX_USER=y" >> $config_target_mak
2894 if test "$target_darwin_user" = "yes" ; then
2895 echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
2897 list=""
2898 if test ! -z "$gdb_xml_files" ; then
2899 for x in $gdb_xml_files; do
2900 list="$list $source_path/gdb-xml/$x"
2901 done
2902 echo "TARGET_XML_FILES=$list" >> $config_target_mak
2905 case "$target_arch2" in
2906 alpha|arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus)
2907 echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
2910 echo "CONFIG_NOSOFTFLOAT=y" >> $config_target_mak
2912 esac
2914 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2915 echo "TARGET_HAS_BFLT=y" >> $config_target_mak
2917 if test "$target_user_only" = "yes" \
2918 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2919 echo "CONFIG_USE_NPTL=y" >> $config_target_mak
2921 if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
2922 echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
2924 if test "$target_bsd_user" = "yes" ; then
2925 echo "CONFIG_BSD_USER=y" >> $config_target_mak
2928 # generate QEMU_CFLAGS/LDFLAGS for targets
2930 cflags=""
2931 ldflags=""
2933 if test "$ARCH" = "sparc64" ; then
2934 cflags="-I\$(SRC_PATH)/tcg/sparc $cflags"
2935 elif test "$ARCH" = "s390x" ; then
2936 cflags="-I\$(SRC_PATH)/tcg/s390 $cflags"
2937 elif test "$ARCH" = "x86_64" ; then
2938 cflags="-I\$(SRC_PATH)/tcg/i386 $cflags"
2939 else
2940 cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
2942 cflags="-I\$(SRC_PATH)/tcg $cflags"
2943 cflags="-I\$(SRC_PATH)/fpu $cflags"
2945 if test "$target_user_only" = "yes" ; then
2946 libdis_config_mak=libdis-user/config.mak
2947 else
2948 libdis_config_mak=libdis/config.mak
2951 for i in $ARCH $TARGET_BASE_ARCH ; do
2952 case "$i" in
2953 alpha)
2954 echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak
2955 echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak
2957 arm)
2958 echo "CONFIG_ARM_DIS=y" >> $config_target_mak
2959 echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak
2961 cris)
2962 echo "CONFIG_CRIS_DIS=y" >> $config_target_mak
2963 echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak
2965 hppa)
2966 echo "CONFIG_HPPA_DIS=y" >> $config_target_mak
2967 echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak
2969 i386|x86_64)
2970 echo "CONFIG_I386_DIS=y" >> $config_target_mak
2971 echo "CONFIG_I386_DIS=y" >> $libdis_config_mak
2973 ia64*)
2974 echo "CONFIG_IA64_DIS=y" >> $config_target_mak
2975 echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak
2977 m68k)
2978 echo "CONFIG_M68K_DIS=y" >> $config_target_mak
2979 echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak
2981 microblaze)
2982 echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak
2983 echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak
2985 mips*)
2986 echo "CONFIG_MIPS_DIS=y" >> $config_target_mak
2987 echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak
2989 ppc*)
2990 echo "CONFIG_PPC_DIS=y" >> $config_target_mak
2991 echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak
2993 s390*)
2994 echo "CONFIG_S390_DIS=y" >> $config_target_mak
2995 echo "CONFIG_S390_DIS=y" >> $libdis_config_mak
2997 sh4)
2998 echo "CONFIG_SH4_DIS=y" >> $config_target_mak
2999 echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak
3001 sparc*)
3002 echo "CONFIG_SPARC_DIS=y" >> $config_target_mak
3003 echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak
3005 esac
3006 done
3008 case "$ARCH" in
3009 alpha)
3010 # Ensure there's only a single GP
3011 cflags="-msmall-data $cflags"
3013 esac
3015 if test "$target_softmmu" = "yes" ; then
3016 case "$TARGET_BASE_ARCH" in
3017 arm)
3018 cflags="-DHAS_AUDIO $cflags"
3020 i386|mips|ppc)
3021 cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
3023 esac
3026 if test "$target_user_only" = "yes" -a "$static" = "no" -a \
3027 "$user_pie" = "yes" ; then
3028 cflags="-fpie $cflags"
3029 ldflags="-pie $ldflags"
3032 if test "$target_softmmu" = "yes" -a \( \
3033 "$TARGET_ARCH" = "microblaze" -o \
3034 "$TARGET_ARCH" = "cris" \) ; then
3035 echo "CONFIG_NEED_MMU=y" >> $config_target_mak
3038 if test "$gprof" = "yes" ; then
3039 echo "TARGET_GPROF=yes" >> $config_target_mak
3040 if test "$target_linux_user" = "yes" ; then
3041 cflags="-p $cflags"
3042 ldflags="-p $ldflags"
3044 if test "$target_softmmu" = "yes" ; then
3045 ldflags="-p $ldflags"
3046 echo "GPROF_CFLAGS=-p" >> $config_target_mak
3050 linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
3051 if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
3052 case "$ARCH" in
3053 sparc)
3054 # -static is used to avoid g1/g3 usage by the dynamic linker
3055 ldflags="$linker_script -static $ldflags"
3057 alpha | s390x)
3058 # The default placement of the application is fine.
3061 ldflags="$linker_script $ldflags"
3063 esac
3066 echo "LDFLAGS+=$ldflags" >> $config_target_mak
3067 echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
3069 done # for target in $targets
3071 # build tree in object directory if source path is different from current one
3072 if test "$source_path_used" = "yes" ; then
3073 DIRS="tests tests/cris slirp audio block net pc-bios/optionrom"
3074 DIRS="$DIRS roms/seabios roms/vgabios"
3075 DIRS="$DIRS fsdev ui"
3076 FILES="Makefile tests/Makefile"
3077 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
3078 FILES="$FILES tests/test-mmap.c"
3079 FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps pc-bios/video.x"
3080 FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
3081 for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do
3082 FILES="$FILES pc-bios/`basename $bios_file`"
3083 done
3084 for dir in $DIRS ; do
3085 mkdir -p $dir
3086 done
3087 # remove the link and recreate it, as not all "ln -sf" overwrite the link
3088 for f in $FILES ; do
3089 rm -f $f
3090 ln -s $source_path/$f $f
3091 done
3094 # temporary config to build submodules
3095 for rom in seabios vgabios; do
3096 config_mak=roms/$rom/config.mak
3097 echo "# Automatically generated by configure - do not modify" > $config_mak
3098 echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
3099 echo "CC=$cc" >> $config_mak
3100 echo "BCC=bcc" >> $config_mak
3101 echo "CPP=${cross_prefix}cpp" >> $config_mak
3102 echo "OBJCOPY=objcopy" >> $config_mak
3103 echo "IASL=iasl" >> $config_mak
3104 echo "HOST_CC=$host_cc" >> $config_mak
3105 echo "LD=$ld" >> $config_mak
3106 done
3108 for hwlib in 32 64; do
3109 d=libhw$hwlib
3110 mkdir -p $d
3111 mkdir -p $d/ide
3112 rm -f $d/Makefile
3113 ln -s $source_path/Makefile.hw $d/Makefile
3114 echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
3115 done
3117 d=libuser
3118 mkdir -p $d
3119 rm -f $d/Makefile
3120 ln -s $source_path/Makefile.user $d/Makefile
3121 if test "$static" = "no" -a "$user_pie" = "yes" ; then
3122 echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
3125 if test "$docs" = "yes" ; then
3126 mkdir -p QMP