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}"
17 TMPS
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPI
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
19 TMPSDLLOG
="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log"
21 trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
25 interp_prefix
="/usr/gnemul/qemu-%M"
30 audio_card_list
="ac97 es1370 sb16"
31 audio_possible_cards
="ac97 es1370 sb16 cs4231a adlib gus"
38 # parse CC options first
40 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
42 --cross-prefix=*) cross_prefix
="$optarg"
50 # Using uname is really, really broken. Once we have the right set of checks
51 # we can eliminate it's usage altogether
53 cc
="${cross_prefix}${cc}"
54 ar="${cross_prefix}${ar}"
55 strip
="${cross_prefix}${strip}"
57 # check that the C compiler works.
62 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
65 echo "ERROR: \"$cc\" either does not exist or does not work"
74 int main(void) { return 0; }
76 $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
79 if check_define __i386__
; then
81 elif check_define __x86_64__
; then
83 elif check_define __sparc__
; then
84 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
85 # They must be specified using --sparc_cpu
86 if check_define __arch64__
; then
91 elif check_define _ARCH_PPC
; then
92 if check_define _ARCH_PPC64
; then
103 i386|i486|i586|i686|i86pc|BePC
)
189 kvm_cap_device_assignment
="no"
200 if check_define __linux__
; then
202 elif check_define _WIN32
; then
210 OS_CFLAGS
="-mno-cygwin"
211 if [ "$cpu" = "i386" ] ; then
214 audio_possible_drivers
="sdl"
218 if [ "$cpu" = "i386" ] ; then
221 audio_possible_drivers
="dsound sdl fmod"
225 audio_possible_drivers
="oss sdl esd pa"
226 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
233 audio_possible_drivers
="oss sdl esd pa"
234 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
242 audio_possible_drivers
="oss sdl esd pa"
243 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
251 audio_possible_drivers
="oss sdl esd"
258 audio_possible_drivers
="oss sdl esd"
264 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
265 if [ "$cpu" = "i386" ] ; then
266 is_x86_64
=`sysctl -n hw.optional.x86_64`
267 [ "$is_x86_64" = "1" ] && cpu
=x86_64
269 if [ "$cpu" = "x86_64" ] ; then
270 OS_CFLAGS
="-arch x86_64"
271 LDFLAGS
="-arch x86_64"
273 OS_CFLAGS
="-mdynamic-no-pic"
277 audio_drv_list
="coreaudio"
278 audio_possible_drivers
="coreaudio sdl fmod"
279 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
285 needs_libsunmath
="no"
286 solarisrev
=`uname -r | cut -f2 -d.`
287 # have to select again, because `uname -m` returns i86pc
288 # even on an x86_64 box.
289 solariscpu
=`isainfo -k`
290 if test "${solariscpu}" = "amd64" ; then
293 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
294 if test "$solarisrev" -le 9 ; then
295 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
296 needs_libsunmath
="yes"
298 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
299 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
300 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
301 echo "Studio 11 can be downloaded from www.sun.com."
305 if test "$solarisrev" -ge 9 ; then
309 if test -f /usr
/include
/sys
/soundcard.h
; then
312 audio_possible_drivers
="oss sdl"
320 audio_possible_drivers
="oss alsa sdl esd pa"
324 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
326 audio_possible_drivers
="$audio_possible_drivers fmod"
329 if [ "$cpu" = "ia64" ] ; then
335 if [ "$cpu" = "powerpc" ]; then
341 if [ "$bsd" = "yes" ] ; then
342 if [ "$darwin" != "yes" ] ; then
350 source_path
=`dirname "$0"`
351 source_path_used
="no"
353 if [ -z "$source_path" ]; then
356 source_path
=`cd "$source_path"; pwd`
358 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
361 # generate compile errors on warnings for development builds
362 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
367 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
369 --help|
-h) show_help
=yes
371 --prefix=*) prefix
="$optarg"
373 --interp-prefix=*) interp_prefix
="$optarg"
375 --source-path=*) source_path
="$optarg"
376 source_path_used
="yes"
382 --host-cc=*) host_cc
="$optarg"
384 --make=*) make="$optarg"
386 --install=*) install="$optarg"
388 --extra-cflags=*) CFLAGS
="$optarg"
390 --extra-ldflags=*) LDFLAGS
="$optarg"
392 --cpu=*) cpu
="$optarg"
394 --target-list=*) target_list
="$optarg"
396 --enable-gprof) gprof
="yes"
398 --static) static
="yes"
400 --disable-sdl) sdl
="no"
402 --fmod-lib=*) fmod_lib
="$optarg"
404 --fmod-inc=*) fmod_inc
="$optarg"
406 --oss-lib=*) oss_lib
="$optarg"
408 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
410 --audio-drv-list=*) audio_drv_list
="$optarg"
412 --enable-sparse) sparse
="yes"
414 --disable-sparse) sparse
="no"
416 --disable-strip) strip_opt
="no"
418 --disable-vnc-tls) vnc_tls
="no"
420 --disable-vnc-sasl) vnc_sasl
="no"
422 --disable-slirp) slirp
="no"
424 --disable-vde) vde
="no"
426 --disable-kqemu) kqemu
="no"
428 --disable-brlapi) brlapi
="no"
430 --disable-bluez) bluez
="no"
432 --disable-kvm) kvm
="no"
434 --enable-profiler) profiler
="yes"
439 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
441 --disable-gfx-check) check_gfx
="no"
443 --disable-system) softmmu
="no"
445 --enable-system) softmmu
="yes"
447 --disable-linux-user) linux_user
="no"
449 --enable-linux-user) linux_user
="yes"
451 --disable-darwin-user) darwin_user
="no"
453 --enable-darwin-user) darwin_user
="yes"
455 --disable-bsd-user) bsd_user
="no"
457 --enable-bsd-user) bsd_user
="yes"
459 --enable-uname-release=*) uname_release
="$optarg"
464 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
465 target_cpu
="sparc"; cpu
="sparc" ;;
466 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
467 target_cpu
="sparc"; cpu
="sparc" ;;
468 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
469 target_cpu
="sparc64"; cpu
="sparc64" ;;
470 *) echo "undefined SPARC architecture. Exiting";exit 1;;
473 --enable-werror) werror
="yes"
475 --disable-werror) werror
="no"
477 --disable-curses) curses
="no"
479 --disable-nptl) nptl
="no"
481 --enable-mixemu) mixemu
="yes"
483 --disable-aio) aio
="no"
485 --disable-blobs) blobs
="no"
487 --kerneldir=*) kerneldir
="$optarg"
489 --disable-cpu-emulation) cpu_emulation
="no"
491 *) echo "ERROR: unknown option $opt"; exit 1
496 # default flags for all hosts
497 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
498 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
499 LDFLAGS
="$LDFLAGS -g"
500 if test "$werror" = "yes" ; then
501 CFLAGS
="$CFLAGS -Werror"
504 if test "$solaris" = "no" ; then
505 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
506 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
511 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
512 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
515 sparc
) if test -z "$sparc_cpu" ; then
516 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
519 ARCH_CFLAGS
="${SP_CFLAGS}"
520 ARCH_LDFLAGS
="${SP_LDFLAGS}"
522 ARCH_CFLAGS
="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
523 if test "$solaris" = "no" ; then
524 ARCH_CFLAGS
="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6"
527 sparc64
) if test -z "$sparc_cpu" ; then
528 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
531 ARCH_CFLAGS
="${SP_CFLAGS}"
532 ARCH_LDFLAGS
="${SP_LDFLAGS}"
534 if test "$solaris" = "no" ; then
535 ARCH_CFLAGS
="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
537 ARCH_CFLAGS
="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7"
541 ARCH_CFLAGS
="-march=z900"
553 if test x
"$show_help" = x
"yes" ; then
556 Usage: configure [options]
557 Options: [defaults in brackets after descriptions]
560 echo "Standard options:"
561 echo " --help print this message"
562 echo " --prefix=PREFIX install in PREFIX [$prefix]"
563 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
564 echo " use %M for cpu name [$interp_prefix]"
565 echo " --target-list=LIST set target list [$target_list]"
567 echo "kqemu kernel acceleration support:"
568 echo " --disable-kqemu disable kqemu support"
570 echo "Advanced options (experts only):"
571 echo " --source-path=PATH path of source code [$source_path]"
572 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
573 echo " --cc=CC use C compiler CC [$cc]"
574 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
575 echo " --make=MAKE use specified make [$make]"
576 echo " --install=INSTALL use specified install [$install]"
577 echo " --static enable static build [$static]"
578 echo " --enable-sparse enable sparse checker"
579 echo " --disable-sparse disable sparse checker (default)"
580 echo " --disable-strip disable stripping binaries"
581 echo " --disable-werror disable compilation abort on warning"
582 echo " --disable-sdl disable SDL"
583 echo " --enable-cocoa enable COCOA (Mac OS X only)"
584 echo " --audio-drv-list=LIST set audio drivers list:"
585 echo " Available drivers: $audio_possible_drivers"
586 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
587 echo " Available cards: $audio_possible_cards"
588 echo " --enable-mixemu enable mixer emulation"
589 echo " --disable-brlapi disable BrlAPI"
590 echo " --disable-vnc-tls disable TLS encryption for VNC server"
591 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
592 echo " --disable-curses disable curses output"
593 echo " --disable-bluez disable bluez stack connectivity"
594 echo " --disable-kvm disable KVM acceleration support"
595 echo " --disable-nptl disable usermode NPTL support"
596 echo " --enable-system enable all system emulation targets"
597 echo " --disable-system disable all system emulation targets"
598 echo " --enable-linux-user enable all linux usermode emulation targets"
599 echo " --disable-linux-user disable all linux usermode emulation targets"
600 echo " --enable-darwin-user enable all darwin usermode emulation targets"
601 echo " --disable-darwin-user disable all darwin usermode emulation targets"
602 echo " --enable-bsd-user enable all BSD usermode emulation targets"
603 echo " --disable-bsd-user disable all BSD usermode emulation targets"
604 echo " --fmod-lib path to FMOD library"
605 echo " --fmod-inc path to FMOD includes"
606 echo " --oss-lib path to OSS library"
607 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
608 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
609 echo " --disable-vde disable support for vde network"
610 echo " --disable-aio disable AIO support"
611 echo " --disable-blobs disable installing provided firmware blobs"
612 echo " --kerneldir=PATH look for kernel includes in PATH"
613 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
615 echo "NOTE: The object files are built at the place where configure is launched"
619 if test "$mingw32" = "yes" ; then
625 OS_CFLAGS
="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
628 if test ! -x "$(which cgcc 2>/dev/null)"; then
633 # Solaris specific configure tool chain decisions
635 if test "$solaris" = "yes" ; then
636 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
637 if test -z "$solinst" ; then
638 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
639 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
640 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
643 if test "$solinst" = "/usr/sbin/install" ; then
644 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
645 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
646 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
649 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
650 if test -z "$sol_ar" ; then
651 echo "Error: No path includes ar"
652 if test -f /usr
/ccs
/bin
/ar ; then
653 echo "Add /usr/ccs/bin to your path and rerun configure"
660 if test -z "$target_list" ; then
661 # these targets are portable
662 if [ "$softmmu" = "yes" ] ; then
681 # the following are Linux specific
682 if [ "$linux_user" = "yes" ] ; then
683 target_list
="${target_list}\
695 ppc64abi32-linux-user \
700 sparc32plus-linux-user \
703 # the following are Darwin specific
704 if [ "$darwin_user" = "yes" ] ; then
705 target_list
="$target_list i386-darwin-user ppc-darwin-user "
707 # the following are BSD specific
708 if [ "$bsd_user" = "yes" ] ; then
709 target_list
="${target_list}\
714 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
716 if test -z "$target_list" ; then
717 echo "No targets enabled"
721 if test -z "$cross_prefix" ; then
724 # big/little endian test
726 #include <inttypes.h>
727 int main(int argc, char ** argv){
728 volatile uint32_t i=0x01234567;
729 return (*((uint8_t*)(&i))) == 0x67;
733 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
734 $TMPE && bigendian
="yes"
736 echo big
/little
test failed
741 # if cross compiling, cannot launch a program, so make a static guess
742 if test "$cpu" = "armv4b" \
746 -o "$cpu" = "mips64" \
748 -o "$cpu" = "ppc64" \
750 -o "$cpu" = "sparc" \
751 -o "$cpu" = "sparc64"; then
757 # host long bits test
759 if test "$cpu" = "x86_64" \
760 -o "$cpu" = "alpha" \
762 -o "$cpu" = "sparc64" \
763 -o "$cpu" = "ppc64"; then
767 # Check host NPTL support
770 #include <linux/futex.h>
773 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
779 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
785 ##########################################
788 if test "$kvm" = "yes" ; then
790 # test for KVM_CAP_PIT
795 #error "kvm no pit capability"
797 int main(void) { return 0; }
799 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
803 # test for KVM_CAP_DEVICE_ASSIGNMENT
807 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
808 #error "kvm no device assignment capability"
810 int main(void) { return 0; }
812 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
813 kvm_cap_device_assignment
="yes"
817 # libpci probe for kvm_cap_device_assignment
818 if test $kvm_cap_device_assignment = "yes" ; then
821 #ifndef PCI_VENDOR_ID
824 int main(void) { return 0; }
826 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2>/dev
/null
; then
830 echo "Error: libpci check failed"
831 echo "Disable KVM Device Assignment capability."
833 kvm_cap_device_assignment
="no"
837 ##########################################
842 int main(void) { zlibVersion(); return 0; }
844 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
848 echo "Error: zlib check failed"
849 echo "Make sure to have the zlib libs and headers installed."
854 ##########################################
859 if test -z "$sdl" ; then
860 sdl_config
="sdl-config"
866 #undef main /* We don't want SDL to override our main() */
867 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
869 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then
870 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
871 if test "$_sdlversion" -lt 121 ; then
874 if test "$cocoa" = "no" ; then
879 # static link with sdl ?
880 if test "$sdl" = "yes" ; then
882 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
883 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
884 if [ "$aa" = "yes" ] ; then
885 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
888 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
892 fi # sdl compile test
894 # Make sure to disable cocoa if sdl was set
895 if test "$sdl" = "yes" ; then
897 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
901 if test "$sdl" = "yes" ; then
904 #if defined(SDL_VIDEO_DRIVER_X11)
905 #include <X11/XKBlib.h>
907 #error No x11 support
909 int main(void) { return 0; }
911 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev
/null
2>&1 ; then
916 ##########################################
918 if test "$vnc_tls" = "yes" ; then
920 #include <gnutls/gnutls.h>
921 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
923 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
924 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
925 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
926 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
933 ##########################################
935 if test "$vnc_sasl" = "yes" ; then
937 #include <sasl/sasl.h>
939 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
941 # Assuming Cyrus-SASL installed in /usr prefix
943 vnc_sasl_libs
="-lsasl2"
944 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
945 $vnc_sasl_libs 2> /dev
/null
; then
952 ##########################################
953 # fnmatch() probe, used for ACL routines
959 fnmatch("foo", "foo", 0);
963 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
967 ##########################################
968 # vde libraries probe
969 if test "$vde" = "yes" ; then
971 #include <libvdeplug.h>
974 struct vde_open_args a = {0, 0, 0};
975 vde_open("", "", &a);
979 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
986 ##########################################
987 # Sound support libraries probe
998 int main(void) { $exp }
1000 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
1004 echo "Error: $drv check failed"
1005 echo "Make sure to have the $drv libs and headers installed."
1011 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1012 for drv
in $audio_drv_list; do
1015 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
1016 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1020 if test -z $fmod_lib ||
test -z $fmod_inc; then
1022 echo "Error: You must specify path to FMOD library and headers"
1023 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1027 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1031 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
1035 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
1036 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1039 oss|sdl|core|wav|dsound
)
1040 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1044 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
1046 echo "Error: Unknown driver '$drv' selected"
1047 echo "Possible drivers are: $audio_possible_drivers"
1055 ##########################################
1058 if test -z "$brlapi" ; then
1062 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1064 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
1066 fi # brlapi compile test
1069 ##########################################
1072 if test "$curses" = "yes" ; then
1076 int main(void) { return curses_version(); }
1078 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
1083 ##########################################
1084 # bluez support probe
1085 if test "$bluez" = "yes" ; then
1086 `pkg-config bluez` || bluez
="no"
1088 if test "$bluez" = "yes" ; then
1090 #include <bluetooth/bluetooth.h>
1091 int main(void) { return bt_error(0); }
1093 bluez_cflags
=`pkg-config --cflags bluez`
1094 bluez_libs
=`pkg-config --libs bluez`
1095 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1096 $bluez_libs > /dev
/null
2> /dev
/null
; then
1103 ##########################################
1105 if test "$kvm" = "yes" ; then
1107 #include <linux/kvm.h>
1108 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1109 #error Invalid KVM version
1111 #if !defined(KVM_CAP_USER_MEMORY)
1112 #error Missing KVM capability KVM_CAP_USER_MEMORY
1114 #if !defined(KVM_CAP_SET_TSS_ADDR)
1115 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1117 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1118 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1120 int main(void) { return 0; }
1122 if test "$kerneldir" != "" ; then
1123 kvm_cflags
=-I"$kerneldir"/include
1124 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) \
1125 -a -d "$kerneldir/arch/x86/include" ; then
1126 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/x86/include"
1127 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1128 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1129 elif test -d "$kerneldir/arch/$cpu/include" ; then
1130 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1135 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1136 > /dev
/null
2>/dev
/null
; then
1140 if [ -x "`which awk 2>/dev/null`" ] && \
1141 [ -x "`which grep 2>/dev/null`" ]; then
1142 kvmerr
=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1144 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1145 if test "$kvmerr" != "" ; then
1146 kvm
="no - (${kvmerr})"
1152 ##########################################
1156 if test "$aio" = "yes" ; then
1159 #include <pthread.h>
1160 int main(void) { pthread_mutex_t lock; return 0; }
1162 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1168 ##########################################
1171 #include <sys/types.h>
1172 #include <sys/uio.h>
1174 int main(void) { struct iovec iov; return 0; }
1177 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1181 ##########################################
1183 if test "$fdt" = "yes" ; then
1186 int main(void) { return 0; }
1188 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1193 ##########################################
1198 #include <sys/syscall.h>
1200 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1203 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1207 ##########################################
1212 #include <sys/syscall.h>
1213 int main(void) { return syscall(SYS_eventfd, 0); }
1216 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1220 # Check if tools are available to build documentation.
1221 if [ -x "`which texi2html 2>/dev/null`" ] && \
1222 [ -x "`which pod2man 2>/dev/null`" ]; then
1226 ##########################################
1231 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1235 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1237 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1241 if test "$rt" = "yes" ; then
1242 # Hack, we should have a general purpose LIBS for this sort of thing
1243 AIOLIBS
="$AIOLIBS -lrt"
1246 if test "$mingw32" = "yes" ; then
1247 if test -z "$prefix" ; then
1248 prefix
="c:\\\\Program Files\\\\Qemu"
1255 if test -z "$prefix" ; then
1258 mansuffix
="/share/man"
1259 datasuffix
="/share/qemu"
1260 docsuffix
="/share/doc/qemu"
1264 echo "Install prefix $prefix"
1265 echo "BIOS directory $prefix$datasuffix"
1266 echo "binary directory $prefix$binsuffix"
1267 if test "$mingw32" = "no" ; then
1268 echo "Manual directory $prefix$mansuffix"
1269 echo "ELF interp prefix $interp_prefix"
1271 echo "Source path $source_path"
1272 echo "C compiler $cc"
1273 echo "Host C compiler $host_cc"
1274 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1276 echo "install $install"
1277 echo "host CPU $cpu"
1278 echo "host big endian $bigendian"
1279 echo "target list $target_list"
1280 echo "gprof enabled $gprof"
1281 echo "sparse enabled $sparse"
1282 echo "strip binaries $strip_opt"
1283 echo "profiler $profiler"
1284 echo "static build $static"
1285 echo "-Werror enabled $werror"
1286 if test "$darwin" = "yes" ; then
1287 echo "Cocoa support $cocoa"
1289 echo "SDL support $sdl"
1290 if test "$sdl" != "no" ; then
1291 echo "SDL static link $sdl_static"
1293 echo "curses support $curses"
1294 echo "mingw32 support $mingw32"
1295 echo "Audio drivers $audio_drv_list"
1296 echo "Extra audio cards $audio_card_list"
1297 echo "Mixer emulation $mixemu"
1298 echo "VNC TLS support $vnc_tls"
1299 if test "$vnc_tls" = "yes" ; then
1300 echo " TLS CFLAGS $vnc_tls_cflags"
1301 echo " TLS LIBS $vnc_tls_libs"
1303 echo "VNC SASL support $vnc_sasl"
1304 if test "$vnc_sasl" = "yes" ; then
1305 echo " SASL CFLAGS $vnc_sasl_cflags"
1306 echo " SASL LIBS $vnc_sasl_libs"
1308 if test -n "$sparc_cpu"; then
1309 echo "Target Sparc Arch $sparc_cpu"
1311 echo "kqemu support $kqemu"
1312 echo "kvm support $kvm"
1313 echo "CPU emulation $cpu_emulation"
1314 echo "brlapi support $brlapi"
1315 echo "Documentation $build_docs"
1316 [ ! -z "$uname_release" ] && \
1317 echo "uname -r $uname_release"
1318 echo "NPTL support $nptl"
1319 echo "vde support $vde"
1320 echo "AIO support $aio"
1321 echo "Install blobs $blobs"
1322 echo "KVM support $kvm"
1323 echo "fdt support $fdt"
1325 if test $sdl_too_old = "yes"; then
1326 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1328 if [ -s $TMPSDLLOG ]; then
1329 echo "The error log from compiling the libSDL test is: "
1332 #if test "$sdl_static" = "no"; then
1333 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1335 config_mak
="config-host.mak"
1336 config_h
="config-host.h"
1338 #echo "Creating $config_mak and $config_h"
1340 test -f $config_h && mv $config_h ${config_h}~
1342 echo "# Automatically generated by configure - do not modify" > $config_mak
1343 printf "# Configured with:" >> $config_mak
1344 printf " '%s'" "$0" "$@" >> $config_mak
1346 echo "/* Automatically generated by configure - do not modify */" > $config_h
1348 echo "prefix=$prefix" >> $config_mak
1349 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1350 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1351 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1352 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1353 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1354 echo "MAKE=$make" >> $config_mak
1355 echo "INSTALL=$install" >> $config_mak
1356 echo "CC=$cc" >> $config_mak
1357 echo "HOST_CC=$host_cc" >> $config_mak
1358 echo "AR=$ar" >> $config_mak
1359 # XXX: only use CFLAGS and LDFLAGS ?
1360 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1361 # compilation of dyngen tool (useful for win32 build on Linux host)
1362 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1363 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1364 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1365 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1366 echo "CFLAGS=$CFLAGS" >> $config_mak
1367 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1368 echo "EXESUF=$EXESUF" >> $config_mak
1369 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1372 echo "ARCH=i386" >> $config_mak
1373 echo "#define HOST_I386 1" >> $config_h
1376 echo "ARCH=x86_64" >> $config_mak
1377 echo "#define HOST_X86_64 1" >> $config_h
1380 echo "ARCH=alpha" >> $config_mak
1381 echo "#define HOST_ALPHA 1" >> $config_h
1384 echo "ARCH=arm" >> $config_mak
1385 echo "#define HOST_ARM 1" >> $config_h
1388 echo "ARCH=arm" >> $config_mak
1389 echo "#define HOST_ARM 1" >> $config_h
1392 echo "ARCH=cris" >> $config_mak
1393 echo "#define HOST_CRIS 1" >> $config_h
1396 echo "ARCH=hppa" >> $config_mak
1397 echo "#define HOST_HPPA 1" >> $config_h
1400 echo "ARCH=ia64" >> $config_mak
1401 echo "#define HOST_IA64 1" >> $config_h
1404 echo "ARCH=m68k" >> $config_mak
1405 echo "#define HOST_M68K 1" >> $config_h
1408 echo "ARCH=mips" >> $config_mak
1409 echo "#define HOST_MIPS 1" >> $config_h
1412 echo "ARCH=mips64" >> $config_mak
1413 echo "#define HOST_MIPS64 1" >> $config_h
1416 echo "ARCH=ppc" >> $config_mak
1417 echo "#define HOST_PPC 1" >> $config_h
1420 echo "ARCH=ppc64" >> $config_mak
1421 echo "#define HOST_PPC64 1" >> $config_h
1424 echo "ARCH=s390" >> $config_mak
1425 echo "#define HOST_S390 1" >> $config_h
1428 echo "ARCH=sparc" >> $config_mak
1429 echo "#define HOST_SPARC 1" >> $config_h
1432 echo "ARCH=sparc64" >> $config_mak
1433 echo "#define HOST_SPARC64 1" >> $config_h
1436 echo "Unsupported CPU = $cpu"
1440 if test "$sparse" = "yes" ; then
1441 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1442 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1443 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1445 if test "$strip_opt" = "yes" ; then
1446 echo "STRIP_OPT=-s" >> $config_mak
1448 if test "$bigendian" = "yes" ; then
1449 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1450 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1452 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1453 if test "$mingw32" = "yes" ; then
1454 echo "CONFIG_WIN32=yes" >> $config_mak
1455 echo "#define CONFIG_WIN32 1" >> $config_h
1458 #include <byteswap.h>
1459 int main(void) { return bswap_32(0); }
1461 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1462 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1465 #include <sys/endian.h>
1466 #include <sys/types.h>
1467 #include <machine/bswap.h>
1468 int main(void) { return bswap32(0); }
1470 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1471 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1475 if [ "$openbsd" = "yes" ] ; then
1476 echo "#define ENOTSUP 4096" >> $config_h
1479 if test "$darwin" = "yes" ; then
1480 echo "CONFIG_DARWIN=yes" >> $config_mak
1481 echo "#define CONFIG_DARWIN 1" >> $config_h
1484 if test "$aix" = "yes" ; then
1485 echo "CONFIG_AIX=yes" >> $config_mak
1486 echo "#define CONFIG_AIX 1" >> $config_h
1489 if test "$solaris" = "yes" ; then
1490 echo "CONFIG_SOLARIS=yes" >> $config_mak
1491 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1492 if test "$needs_libsunmath" = "yes" ; then
1493 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1494 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1497 if test -n "$sparc_cpu"; then
1498 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1499 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1501 if test "$gdbstub" = "yes" ; then
1502 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1503 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1505 if test "$gprof" = "yes" ; then
1506 echo "TARGET_GPROF=yes" >> $config_mak
1507 echo "#define HAVE_GPROF 1" >> $config_h
1509 if test "$static" = "yes" ; then
1510 echo "CONFIG_STATIC=yes" >> $config_mak
1511 echo "#define CONFIG_STATIC 1" >> $config_h
1513 if test $profiler = "yes" ; then
1514 echo "#define CONFIG_PROFILER 1" >> $config_h
1516 if test "$slirp" = "yes" ; then
1517 echo "CONFIG_SLIRP=yes" >> $config_mak
1518 echo "#define CONFIG_SLIRP 1" >> $config_h
1520 if test "$vde" = "yes" ; then
1521 echo "CONFIG_VDE=yes" >> $config_mak
1522 echo "#define CONFIG_VDE 1" >> $config_h
1523 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1525 for card
in $audio_card_list; do
1526 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1527 echo "$def=yes" >> $config_mak
1528 echo "#define $def 1" >> $config_h
1530 echo "#define AUDIO_DRIVERS \\" >> $config_h
1531 for drv
in $audio_drv_list; do
1532 echo " &${drv}_audio_driver, \\" >>$config_h
1533 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1534 echo "$def=yes" >> $config_mak
1535 if test "$drv" = "fmod"; then
1536 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1537 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1538 elif test "$drv" = "oss"; then
1539 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1543 if test "$mixemu" = "yes" ; then
1544 echo "CONFIG_MIXEMU=yes" >> $config_mak
1545 echo "#define CONFIG_MIXEMU 1" >> $config_h
1547 if test "$vnc_tls" = "yes" ; then
1548 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1549 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1550 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1551 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1553 if test "$vnc_sasl" = "yes" ; then
1554 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1555 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1556 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1557 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1559 if test "$fnmatch" = "yes" ; then
1560 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1562 qemu_version
=`head $source_path/VERSION`
1563 echo "VERSION=$qemu_version" >>$config_mak
1564 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1565 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1567 echo "SRC_PATH=$source_path" >> $config_mak
1568 if [ "$source_path_used" = "yes" ]; then
1569 echo "VPATH=$source_path" >> $config_mak
1571 echo "TARGET_DIRS=$target_list" >> $config_mak
1572 if [ "$build_docs" = "yes" ] ; then
1573 echo "BUILD_DOCS=yes" >> $config_mak
1575 if test "$static" = "yes"; then
1580 if test "$sdl1" = "yes" ; then
1581 echo "#define CONFIG_SDL 1" >> $config_h
1582 echo "CONFIG_SDL=yes" >> $config_mak
1583 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1584 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1585 elif test "$sdl_x11" = "yes" ; then
1586 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1588 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1590 if [ "${aa}" = "yes" ] ; then
1591 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1593 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1596 if test "$cocoa" = "yes" ; then
1597 echo "#define CONFIG_COCOA 1" >> $config_h
1598 echo "CONFIG_COCOA=yes" >> $config_mak
1600 if test "$curses" = "yes" ; then
1601 echo "#define CONFIG_CURSES 1" >> $config_h
1602 echo "CONFIG_CURSES=yes" >> $config_mak
1603 echo "CURSES_LIBS=-lcurses" >> $config_mak
1605 if test "$brlapi" = "yes" ; then
1606 echo "CONFIG_BRLAPI=yes" >> $config_mak
1607 echo "#define CONFIG_BRLAPI 1" >> $config_h
1608 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1610 if test "$bluez" = "yes" ; then
1611 echo "CONFIG_BLUEZ=yes" >> $config_mak
1612 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1613 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1614 echo "#define CONFIG_BLUEZ 1" >> $config_h
1616 if test "$aio" = "yes" ; then
1617 echo "#define CONFIG_AIO 1" >> $config_h
1618 echo "CONFIG_AIO=yes" >> $config_mak
1620 if test "$blobs" = "yes" ; then
1621 echo "INSTALL_BLOBS=yes" >> $config_mak
1623 if test "$iovec" = "yes" ; then
1624 echo "#define HAVE_IOVEC 1" >> $config_h
1626 if test "$fdt" = "yes" ; then
1627 echo "#define HAVE_FDT 1" >> $config_h
1628 echo "FDT_LIBS=-lfdt" >> $config_mak
1630 if test "$signalfd" = "yes" ; then
1631 echo "#define CONFIG_signalfd 1" >> $config_h
1633 if test "$eventfd" = "yes" ; then
1634 echo "#define CONFIG_eventfd 1" >> $config_h
1637 # XXX: suppress that
1638 if [ "$bsd" = "yes" ] ; then
1639 echo "#define O_LARGEFILE 0" >> $config_h
1640 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1641 echo "#define HOST_BSD 1" >> $config_h
1644 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1649 echo "HOST_USB=linux" >> $config_mak
1652 echo "HOST_USB=bsd" >> $config_mak
1655 echo "HOST_USB=stub" >> $config_mak
1660 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1661 tools
="qemu-img\$(EXESUF) $tools"
1662 if [ "$linux" = "yes" ] ; then
1663 tools
="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
1666 echo "TOOLS=$tools" >> $config_mak
1668 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1670 for target
in $target_list; do
1671 target_dir
="$target"
1672 config_mak
=$target_dir/config.mak
1673 config_h
=$target_dir/config.h
1674 target_cpu
=`echo $target | cut -d '-' -f 1`
1675 target_bigendian
="no"
1676 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1677 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1678 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1679 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1680 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1681 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1682 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1683 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1684 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1685 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1686 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1687 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1688 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1690 target_user_only
="no"
1691 target_linux_user
="no"
1692 target_darwin_user
="no"
1693 target_bsd_user
="no"
1695 ${target_cpu}-softmmu)
1696 target_softmmu
="yes"
1698 ${target_cpu}-linux-user)
1699 target_user_only
="yes"
1700 target_linux_user
="yes"
1702 ${target_cpu}-darwin-user)
1703 target_user_only
="yes"
1704 target_darwin_user
="yes"
1706 ${target_cpu}-bsd-user)
1707 target_user_only
="yes"
1708 target_bsd_user
="yes"
1711 echo "ERROR: Target '$target' not recognised"
1716 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1717 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1718 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1719 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1720 echo "Note that this will disable all output from the virtual graphics card"
1721 echo "except through VNC or curses."
1725 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1727 test -f $config_h && mv $config_h ${config_h}~
1729 mkdir
-p $target_dir
1730 mkdir
-p $target_dir/fpu
1731 mkdir
-p $target_dir/tcg
1732 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1733 mkdir
-p $target_dir/nwfpe
1737 # don't use ln -sf as not all "ln -sf" over write the file/link
1739 rm -f $target_dir/Makefile
1740 ln -s $source_path/Makefile.target
$target_dir/Makefile
1743 echo "# Automatically generated by configure - do not modify" > $config_mak
1744 echo "/* Automatically generated by configure - do not modify */" > $config_h
1747 echo "include ../config-host.mak" >> $config_mak
1748 echo "#include \"../config-host.h\"" >> $config_h
1753 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1754 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1757 disable_cpu_emulation
() {
1758 if test $cpu_emulation = "no"; then
1759 echo "#define NO_CPU_EMULATION 1" >> $config_h
1760 echo "NO_CPU_EMULATION=1" >> $config_mak
1765 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1766 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1767 echo "#define USE_KVM 1" >> $config_h
1768 echo "USE_KVM=1" >> $config_mak
1769 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1770 if test $kvm_cap_pit = "yes" ; then
1771 echo "USE_KVM_PIT=1" >> $config_mak
1772 echo "#define USE_KVM_PIT 1" >> $config_h
1774 if test $kvm_cap_device_assignment = "yes" ; then
1775 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1776 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1778 disable_cpu_emulation
1782 if [ use_upstream_kvm
= yes ]; then
1784 # Make sure the target and host cpus are compatible
1785 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1786 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \
) -o \
1787 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1788 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1791 # Disable KVM for linux-user
1792 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1798 case "$target_cpu" in
1800 echo "TARGET_ARCH=i386" >> $config_mak
1801 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1802 echo "#define TARGET_I386 1" >> $config_h
1803 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1805 echo "#define USE_KQEMU 1" >> $config_h
1807 if test "$kvm" = "yes" ; then
1808 echo "CONFIG_KVM=yes" >> $config_mak
1809 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1810 echo "#define CONFIG_KVM 1" >> $config_h
1815 echo "TARGET_ARCH=x86_64" >> $config_mak
1816 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1817 echo "#define TARGET_I386 1" >> $config_h
1818 echo "#define TARGET_X86_64 1" >> $config_h
1819 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1821 echo "#define USE_KQEMU 1" >> $config_h
1826 echo "TARGET_ARCH=ia64" >> $config_mak
1827 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1828 echo "#define TARGET_IA64 1" >> $config_h
1830 if [ use_upstream_kvm
= yes ]; then
1831 if test "$kvm" = "yes" ; then
1832 echo "CONFIG_KVM=yes" >> $config_mak
1833 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1834 echo "#define CONFIG_KVM 1" >> $config_h
1839 echo "TARGET_ARCH=alpha" >> $config_mak
1840 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1841 echo "#define TARGET_ALPHA 1" >> $config_h
1844 echo "TARGET_ARCH=arm" >> $config_mak
1845 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1846 echo "#define TARGET_ARM 1" >> $config_h
1849 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1852 echo "TARGET_ARCH=cris" >> $config_mak
1853 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1854 echo "#define TARGET_CRIS 1" >> $config_h
1858 echo "TARGET_ARCH=m68k" >> $config_mak
1859 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1860 echo "#define TARGET_M68K 1" >> $config_h
1862 gdb_xml_files
="cf-core.xml cf-fp.xml"
1865 echo "TARGET_ARCH=mips" >> $config_mak
1866 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1867 echo "#define TARGET_MIPS 1" >> $config_h
1868 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1871 echo "TARGET_ARCH=mipsn32" >> $config_mak
1872 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1873 echo "#define TARGET_MIPS 1" >> $config_h
1874 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1877 echo "TARGET_ARCH=mips64" >> $config_mak
1878 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1879 echo "#define TARGET_MIPS 1" >> $config_h
1880 echo "#define TARGET_MIPS64 1" >> $config_h
1881 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1884 echo "TARGET_ARCH=ppc" >> $config_mak
1885 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1886 echo "#define TARGET_PPC 1" >> $config_h
1887 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1890 echo "TARGET_ARCH=ppcemb" >> $config_mak
1891 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1892 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1893 echo "#define TARGET_PPC 1" >> $config_h
1894 echo "#define TARGET_PPCEMB 1" >> $config_h
1895 if test "$kvm" = "yes" ; then
1896 echo "CONFIG_KVM=yes" >> $config_mak
1897 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1898 echo "#define CONFIG_KVM 1" >> $config_h
1900 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1903 echo "TARGET_ARCH=ppc64" >> $config_mak
1904 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1905 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1906 echo "#define TARGET_PPC 1" >> $config_h
1907 echo "#define TARGET_PPC64 1" >> $config_h
1908 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1911 echo "TARGET_ARCH=ppc64" >> $config_mak
1912 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1913 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1914 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1915 echo "#define TARGET_PPC 1" >> $config_h
1916 echo "#define TARGET_PPC64 1" >> $config_h
1917 echo "#define TARGET_ABI32 1" >> $config_h
1918 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1921 echo "TARGET_ARCH=sh4" >> $config_mak
1922 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1923 echo "#define TARGET_SH4 1" >> $config_h
1928 echo "TARGET_ARCH=sparc" >> $config_mak
1929 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1930 echo "#define TARGET_SPARC 1" >> $config_h
1933 echo "TARGET_ARCH=sparc64" >> $config_mak
1934 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1935 echo "#define TARGET_SPARC 1" >> $config_h
1936 echo "#define TARGET_SPARC64 1" >> $config_h
1940 echo "TARGET_ARCH=sparc64" >> $config_mak
1941 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1942 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1943 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1944 echo "#define TARGET_SPARC 1" >> $config_h
1945 echo "#define TARGET_SPARC64 1" >> $config_h
1946 echo "#define TARGET_ABI32 1" >> $config_h
1949 echo "Unsupported target CPU"
1953 if test "$target_bigendian" = "yes" ; then
1954 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1955 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1957 if test "$target_softmmu" = "yes" ; then
1958 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1959 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1961 if test "$target_user_only" = "yes" ; then
1962 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1963 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1965 if test "$target_linux_user" = "yes" ; then
1966 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1967 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1969 if test "$target_darwin_user" = "yes" ; then
1970 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1971 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1974 if test ! -z "$gdb_xml_files" ; then
1975 for x
in $gdb_xml_files; do
1976 list
="$list $source_path/gdb-xml/$x"
1979 echo "TARGET_XML_FILES=$list" >> $config_mak
1981 if test "$target_cpu" = "arm" \
1982 -o "$target_cpu" = "armeb" \
1983 -o "$target_cpu" = "m68k" \
1984 -o "$target_cpu" = "mips" \
1985 -o "$target_cpu" = "mipsel" \
1986 -o "$target_cpu" = "mipsn32" \
1987 -o "$target_cpu" = "mipsn32el" \
1988 -o "$target_cpu" = "mips64" \
1989 -o "$target_cpu" = "mips64el" \
1990 -o "$target_cpu" = "ppc" \
1991 -o "$target_cpu" = "ppc64" \
1992 -o "$target_cpu" = "ppc64abi32" \
1993 -o "$target_cpu" = "ppcemb" \
1994 -o "$target_cpu" = "sparc" \
1995 -o "$target_cpu" = "sparc64" \
1996 -o "$target_cpu" = "sparc32plus"; then
1997 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1998 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
2000 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2001 echo "TARGET_HAS_BFLT=yes" >> $config_mak
2002 echo "#define TARGET_HAS_BFLT 1" >> $config_h
2004 if test "$target_user_only" = "yes" \
2005 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2006 echo "#define USE_NPTL 1" >> $config_h
2008 # 32 bit ELF loader in addition to native 64 bit loader?
2009 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
2010 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
2011 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2013 if test "$target_bsd_user" = "yes" ; then
2014 echo "CONFIG_BSD_USER=yes" >> $config_mak
2015 echo "#define CONFIG_BSD_USER 1" >> $config_h
2018 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
2020 done # for target in $targets
2022 # build tree in object directory if source path is different from current one
2023 if test "$source_path_used" = "yes" ; then
2024 DIRS
="tests tests/cris slirp audio"
2025 FILES
="Makefile tests/Makefile"
2026 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2027 FILES
="$FILES tests/test-mmap.c"
2028 for dir
in $DIRS ; do
2031 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2032 for f
in $FILES ; do
2034 ln -s $source_path/$f $f