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
)
188 kvm_cap_device_assignment
="no"
199 if check_define __linux__
; then
201 elif check_define _WIN32
; then
209 OS_CFLAGS
="-mno-cygwin"
210 if [ "$cpu" = "i386" ] ; then
213 audio_possible_drivers
="sdl"
217 if [ "$cpu" = "i386" ] ; then
220 audio_possible_drivers
="dsound sdl fmod"
224 audio_possible_drivers
="oss sdl esd pa"
225 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
232 audio_possible_drivers
="oss sdl esd pa"
233 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
241 audio_possible_drivers
="oss sdl esd pa"
242 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
250 audio_possible_drivers
="oss sdl esd"
257 audio_possible_drivers
="oss sdl esd"
263 # 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
264 if [ "$cpu" = "i386" ] ; then
265 is_x86_64
=`sysctl -n hw.optional.x86_64`
266 [ "$is_x86_64" = "1" ] && cpu
=x86_64
268 if [ "$cpu" = "x86_64" ] ; then
269 OS_CFLAGS
="-arch x86_64"
270 LDFLAGS
="-arch x86_64"
272 OS_CFLAGS
="-mdynamic-no-pic"
276 audio_drv_list
="coreaudio"
277 audio_possible_drivers
="coreaudio sdl fmod"
278 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
284 needs_libsunmath
="no"
285 solarisrev
=`uname -r | cut -f2 -d.`
286 # have to select again, because `uname -m` returns i86pc
287 # even on an x86_64 box.
288 solariscpu
=`isainfo -k`
289 if test "${solariscpu}" = "amd64" ; then
292 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
293 if test "$solarisrev" -le 9 ; then
294 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
295 needs_libsunmath
="yes"
297 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
298 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
299 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
300 echo "Studio 11 can be downloaded from www.sun.com."
304 if test "$solarisrev" -ge 9 ; then
308 if test -f /usr
/include
/sys
/soundcard.h
; then
311 audio_possible_drivers
="oss sdl"
319 audio_possible_drivers
="oss alsa sdl esd pa"
323 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
325 audio_possible_drivers
="$audio_possible_drivers fmod"
328 if [ "$cpu" = "ia64" ] ; then
334 if [ "$cpu" = "powerpc" ]; then
340 if [ "$bsd" = "yes" ] ; then
341 if [ "$darwin" != "yes" ] ; then
349 source_path
=`dirname "$0"`
350 source_path_used
="no"
352 if [ -z "$source_path" ]; then
355 source_path
=`cd "$source_path"; pwd`
357 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
360 # generate compile errors on warnings for development builds
361 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
366 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
368 --help|
-h) show_help
=yes
370 --prefix=*) prefix
="$optarg"
372 --interp-prefix=*) interp_prefix
="$optarg"
374 --source-path=*) source_path
="$optarg"
375 source_path_used
="yes"
381 --host-cc=*) host_cc
="$optarg"
383 --make=*) make="$optarg"
385 --install=*) install="$optarg"
387 --extra-cflags=*) CFLAGS
="$optarg"
389 --extra-ldflags=*) LDFLAGS
="$optarg"
391 --cpu=*) cpu
="$optarg"
393 --target-list=*) target_list
="$optarg"
395 --enable-gprof) gprof
="yes"
397 --static) static
="yes"
399 --disable-sdl) sdl
="no"
401 --fmod-lib=*) fmod_lib
="$optarg"
403 --fmod-inc=*) fmod_inc
="$optarg"
405 --oss-lib=*) oss_lib
="$optarg"
407 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
409 --audio-drv-list=*) audio_drv_list
="$optarg"
411 --enable-sparse) sparse
="yes"
413 --disable-sparse) sparse
="no"
415 --disable-vnc-tls) vnc_tls
="no"
417 --disable-vnc-sasl) vnc_sasl
="no"
419 --disable-slirp) slirp
="no"
421 --disable-vde) vde
="no"
423 --disable-kqemu) kqemu
="no"
425 --disable-brlapi) brlapi
="no"
427 --disable-bluez) bluez
="no"
429 --disable-kvm) kvm
="no"
431 --enable-profiler) profiler
="yes"
436 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
438 --disable-gfx-check) check_gfx
="no"
440 --disable-system) softmmu
="no"
442 --enable-system) softmmu
="yes"
444 --disable-linux-user) linux_user
="no"
446 --enable-linux-user) linux_user
="yes"
448 --disable-darwin-user) darwin_user
="no"
450 --enable-darwin-user) darwin_user
="yes"
452 --disable-bsd-user) bsd_user
="no"
454 --enable-bsd-user) bsd_user
="yes"
456 --enable-uname-release=*) uname_release
="$optarg"
461 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
462 target_cpu
="sparc"; cpu
="sparc" ;;
463 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
464 target_cpu
="sparc"; cpu
="sparc" ;;
465 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
466 target_cpu
="sparc64"; cpu
="sparc64" ;;
467 *) echo "undefined SPARC architecture. Exiting";exit 1;;
470 --enable-werror) werror
="yes"
472 --disable-werror) werror
="no"
474 --disable-curses) curses
="no"
476 --disable-nptl) nptl
="no"
478 --enable-mixemu) mixemu
="yes"
480 --disable-aio) aio
="no"
482 --disable-blobs) blobs
="no"
484 --kerneldir=*) kerneldir
="$optarg"
486 --disable-cpu-emulation) cpu_emulation
="no"
488 *) echo "ERROR: unknown option $opt"; exit 1
493 # default flags for all hosts
494 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
495 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
496 LDFLAGS
="$LDFLAGS -g"
497 if test "$werror" = "yes" ; then
498 CFLAGS
="$CFLAGS -Werror"
501 if test "$solaris" = "no" ; then
502 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
503 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
508 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
509 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
512 sparc
) if test -z "$sparc_cpu" ; then
513 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
516 ARCH_CFLAGS
="${SP_CFLAGS}"
517 ARCH_LDFLAGS
="${SP_LDFLAGS}"
520 sparc64
) if test -z "$sparc_cpu" ; then
521 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
524 ARCH_CFLAGS
="${SP_CFLAGS}"
525 ARCH_LDFLAGS
="${SP_LDFLAGS}"
529 ARCH_CFLAGS
="-march=z900"
541 if test x
"$show_help" = x
"yes" ; then
544 Usage: configure [options]
545 Options: [defaults in brackets after descriptions]
548 echo "Standard options:"
549 echo " --help print this message"
550 echo " --prefix=PREFIX install in PREFIX [$prefix]"
551 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
552 echo " use %M for cpu name [$interp_prefix]"
553 echo " --target-list=LIST set target list [$target_list]"
555 echo "kqemu kernel acceleration support:"
556 echo " --disable-kqemu disable kqemu support"
558 echo "Advanced options (experts only):"
559 echo " --source-path=PATH path of source code [$source_path]"
560 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
561 echo " --cc=CC use C compiler CC [$cc]"
562 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
563 echo " --make=MAKE use specified make [$make]"
564 echo " --install=INSTALL use specified install [$install]"
565 echo " --static enable static build [$static]"
566 echo " --enable-sparse enable sparse checker"
567 echo " --disable-sparse disable sparse checker (default)"
568 echo " --disable-werror disable compilation abort on warning"
569 echo " --disable-sdl disable SDL"
570 echo " --enable-cocoa enable COCOA (Mac OS X only)"
571 echo " --audio-drv-list=LIST set audio drivers list:"
572 echo " Available drivers: $audio_possible_drivers"
573 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
574 echo " Available cards: $audio_possible_cards"
575 echo " --enable-mixemu enable mixer emulation"
576 echo " --disable-brlapi disable BrlAPI"
577 echo " --disable-vnc-tls disable TLS encryption for VNC server"
578 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
579 echo " --disable-curses disable curses output"
580 echo " --disable-bluez disable bluez stack connectivity"
581 echo " --disable-kvm disable KVM acceleration support"
582 echo " --disable-nptl disable usermode NPTL support"
583 echo " --enable-system enable all system emulation targets"
584 echo " --disable-system disable all system emulation targets"
585 echo " --enable-linux-user enable all linux usermode emulation targets"
586 echo " --disable-linux-user disable all linux usermode emulation targets"
587 echo " --enable-darwin-user enable all darwin usermode emulation targets"
588 echo " --disable-darwin-user disable all darwin usermode emulation targets"
589 echo " --enable-bsd-user enable all BSD usermode emulation targets"
590 echo " --disable-bsd-user disable all BSD usermode emulation targets"
591 echo " --fmod-lib path to FMOD library"
592 echo " --fmod-inc path to FMOD includes"
593 echo " --oss-lib path to OSS library"
594 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
595 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
596 echo " --disable-vde disable support for vde network"
597 echo " --disable-aio disable AIO support"
598 echo " --disable-blobs disable installing provided firmware blobs"
599 echo " --kerneldir=PATH look for kernel includes in PATH"
600 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
602 echo "NOTE: The object files are built at the place where configure is launched"
606 if test "$mingw32" = "yes" ; then
612 OS_CFLAGS
="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
615 if test ! -x "$(which cgcc 2>/dev/null)"; then
620 # Solaris specific configure tool chain decisions
622 if test "$solaris" = "yes" ; then
623 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
624 if test -z "$solinst" ; then
625 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
626 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
627 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
630 if test "$solinst" = "/usr/sbin/install" ; then
631 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
632 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
633 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
636 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
637 if test -z "$sol_ar" ; then
638 echo "Error: No path includes ar"
639 if test -f /usr
/ccs
/bin
/ar ; then
640 echo "Add /usr/ccs/bin to your path and rerun configure"
647 if test -z "$target_list" ; then
648 # these targets are portable
649 if [ "$softmmu" = "yes" ] ; then
668 # the following are Linux specific
669 if [ "$linux_user" = "yes" ] ; then
670 target_list
="${target_list}\
682 ppc64abi32-linux-user \
687 sparc32plus-linux-user \
690 # the following are Darwin specific
691 if [ "$darwin_user" = "yes" ] ; then
692 target_list
="$target_list i386-darwin-user ppc-darwin-user "
694 # the following are BSD specific
695 if [ "$bsd_user" = "yes" ] ; then
696 target_list
="${target_list}\
701 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
703 if test -z "$target_list" ; then
704 echo "No targets enabled"
708 if test -z "$cross_prefix" ; then
711 # big/little endian test
713 #include <inttypes.h>
714 int main(int argc, char ** argv){
715 volatile uint32_t i=0x01234567;
716 return (*((uint8_t*)(&i))) == 0x67;
720 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
721 $TMPE && bigendian
="yes"
723 echo big
/little
test failed
728 # if cross compiling, cannot launch a program, so make a static guess
729 if test "$cpu" = "armv4b" \
733 -o "$cpu" = "mips64" \
735 -o "$cpu" = "ppc64" \
737 -o "$cpu" = "sparc" \
738 -o "$cpu" = "sparc64"; then
744 # host long bits test
746 if test "$cpu" = "x86_64" \
747 -o "$cpu" = "alpha" \
749 -o "$cpu" = "sparc64" \
750 -o "$cpu" = "ppc64"; then
754 # Check host NPTL support
757 #include <linux/futex.h>
760 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
766 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
772 ##########################################
775 if test "$kvm" = "yes" ; then
777 # test for KVM_CAP_PIT
782 #error "kvm no pit capability"
784 int main(void) { return 0; }
786 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
790 # test for KVM_CAP_DEVICE_ASSIGNMENT
794 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
795 #error "kvm no device assignment 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
800 kvm_cap_device_assignment
="yes"
804 # libpci probe for kvm_cap_device_assignment
805 if test $kvm_cap_device_assignment = "yes" ; then
808 #ifndef PCI_VENDOR_ID
811 int main(void) { return 0; }
813 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2>/dev
/null
; then
817 echo "Error: libpci check failed"
818 echo "Disable KVM Device Assignment capability."
820 kvm_cap_device_assignment
="no"
824 ##########################################
829 int main(void) { zlibVersion(); return 0; }
831 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
835 echo "Error: zlib check failed"
836 echo "Make sure to have the zlib libs and headers installed."
841 ##########################################
846 if test -z "$sdl" ; then
847 sdl_config
="sdl-config"
853 #undef main /* We don't want SDL to override our main() */
854 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
856 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
857 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
858 if test "$_sdlversion" -lt 121 ; then
861 if test "$cocoa" = "no" ; then
866 # static link with sdl ?
867 if test "$sdl" = "yes" ; then
869 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
870 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
871 if [ "$aa" = "yes" ] ; then
872 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
875 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
879 fi # sdl compile test
881 # Make sure to disable cocoa if sdl was set
882 if test "$sdl" = "yes" ; then
884 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
888 if test "$sdl" = "yes" ; then
891 #if defined(SDL_VIDEO_DRIVER_X11)
892 #include <X11/XKBlib.h>
894 #error No x11 support
896 int main(void) { return 0; }
898 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
903 ##########################################
905 if test "$vnc_tls" = "yes" ; then
907 #include <gnutls/gnutls.h>
908 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
910 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
911 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
912 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
913 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
920 ##########################################
922 if test "$vnc_sasl" = "yes" ; then
924 #include <sasl/sasl.h>
926 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
928 # Assuming Cyrus-SASL installed in /usr prefix
930 vnc_sasl_libs
="-lsasl2"
931 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
932 $vnc_sasl_libs 2> /dev
/null
; then
939 ##########################################
940 # fnmatch() probe, used for ACL routines
946 fnmatch("foo", "foo", 0);
950 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
954 ##########################################
955 # vde libraries probe
956 if test "$vde" = "yes" ; then
958 #include <libvdeplug.h>
961 struct vde_open_args a = {0, 0, 0};
962 vde_open("", "", &a);
966 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
973 ##########################################
974 # Sound support libraries probe
985 int main(void) { $exp }
987 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
991 echo "Error: $drv check failed"
992 echo "Make sure to have the $drv libs and headers installed."
998 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
999 for drv
in $audio_drv_list; do
1002 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
1003 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1007 if test -z $fmod_lib ||
test -z $fmod_inc; then
1009 echo "Error: You must specify path to FMOD library and headers"
1010 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1014 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1018 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
1022 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
1023 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1026 oss|sdl|core|wav|dsound
)
1027 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1031 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
1033 echo "Error: Unknown driver '$drv' selected"
1034 echo "Possible drivers are: $audio_possible_drivers"
1042 ##########################################
1045 if test -z "$brlapi" ; then
1049 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1051 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
1053 fi # brlapi compile test
1056 ##########################################
1059 if test "$curses" = "yes" ; then
1063 int main(void) { return curses_version(); }
1065 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
1070 ##########################################
1071 # bluez support probe
1072 if test "$bluez" = "yes" ; then
1073 `pkg-config bluez` || bluez
="no"
1075 if test "$bluez" = "yes" ; then
1077 #include <bluetooth/bluetooth.h>
1078 int main(void) { return bt_error(0); }
1080 bluez_cflags
=`pkg-config --cflags bluez`
1081 bluez_libs
=`pkg-config --libs bluez`
1082 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1083 $bluez_libs > /dev
/null
2> /dev
/null
; then
1090 ##########################################
1092 if test "$kvm" = "yes" ; then
1094 #include <linux/kvm.h>
1095 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1096 #error Invalid KVM version
1098 #if !defined(KVM_CAP_USER_MEMORY)
1099 #error Missing KVM capability KVM_CAP_USER_MEMORY
1101 #if !defined(KVM_CAP_SET_TSS_ADDR)
1102 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1104 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1105 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1107 int main(void) { return 0; }
1109 if test "$kerneldir" != "" ; then
1110 kvm_cflags
=-I"$kerneldir"/include
1111 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) \
1112 -a -d "$kerneldir/arch/x86/include" ; then
1113 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/x86/include"
1114 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1115 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1116 elif test -d "$kerneldir/arch/$cpu/include" ; then
1117 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1122 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1123 > /dev
/null
2>/dev
/null
; then
1127 if [ -x "`which awk 2>/dev/null`" ] && \
1128 [ -x "`which grep 2>/dev/null`" ]; then
1129 kvmerr
=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1131 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1132 if test "$kvmerr" != "" ; then
1133 kvm
="no - (${kvmerr})"
1139 ##########################################
1143 if test "$aio" = "yes" ; then
1146 #include <pthread.h>
1147 int main(void) { pthread_mutex_t lock; return 0; }
1149 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1155 ##########################################
1158 #include <sys/types.h>
1159 #include <sys/uio.h>
1161 int main(void) { struct iovec iov; return 0; }
1164 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1168 ##########################################
1170 if test "$fdt" = "yes" ; then
1173 int main(void) { return 0; }
1175 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1180 ##########################################
1185 #include <sys/syscall.h>
1187 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1190 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1194 ##########################################
1199 #include <sys/syscall.h>
1200 int main(void) { return syscall(SYS_eventfd, 0); }
1203 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1207 # Check if tools are available to build documentation.
1208 if [ -x "`which texi2html 2>/dev/null`" ] && \
1209 [ -x "`which pod2man 2>/dev/null`" ]; then
1213 ##########################################
1218 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1222 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1224 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1228 if test "$rt" = "yes" ; then
1229 # Hack, we should have a general purpose LIBS for this sort of thing
1230 AIOLIBS
="$AIOLIBS -lrt"
1233 if test "$mingw32" = "yes" ; then
1234 if test -z "$prefix" ; then
1235 prefix
="c:\\\\Program Files\\\\Qemu"
1242 if test -z "$prefix" ; then
1245 mansuffix
="/share/man"
1246 datasuffix
="/share/qemu"
1247 docsuffix
="/share/doc/qemu"
1251 echo "Install prefix $prefix"
1252 echo "BIOS directory $prefix$datasuffix"
1253 echo "binary directory $prefix$binsuffix"
1254 if test "$mingw32" = "no" ; then
1255 echo "Manual directory $prefix$mansuffix"
1256 echo "ELF interp prefix $interp_prefix"
1258 echo "Source path $source_path"
1259 echo "C compiler $cc"
1260 echo "Host C compiler $host_cc"
1261 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1263 echo "install $install"
1264 echo "host CPU $cpu"
1265 echo "host big endian $bigendian"
1266 echo "target list $target_list"
1267 echo "gprof enabled $gprof"
1268 echo "sparse enabled $sparse"
1269 echo "profiler $profiler"
1270 echo "static build $static"
1271 echo "-Werror enabled $werror"
1272 if test "$darwin" = "yes" ; then
1273 echo "Cocoa support $cocoa"
1275 echo "SDL support $sdl"
1276 if test "$sdl" != "no" ; then
1277 echo "SDL static link $sdl_static"
1279 echo "curses support $curses"
1280 echo "mingw32 support $mingw32"
1281 echo "Audio drivers $audio_drv_list"
1282 echo "Extra audio cards $audio_card_list"
1283 echo "Mixer emulation $mixemu"
1284 echo "VNC TLS support $vnc_tls"
1285 if test "$vnc_tls" = "yes" ; then
1286 echo " TLS CFLAGS $vnc_tls_cflags"
1287 echo " TLS LIBS $vnc_tls_libs"
1289 echo "VNC SASL support $vnc_sasl"
1290 if test "$vnc_sasl" = "yes" ; then
1291 echo " SASL CFLAGS $vnc_sasl_cflags"
1292 echo " SASL LIBS $vnc_sasl_libs"
1294 if test -n "$sparc_cpu"; then
1295 echo "Target Sparc Arch $sparc_cpu"
1297 echo "kqemu support $kqemu"
1298 echo "kvm support $kvm"
1299 echo "CPU emulation $cpu_emulation"
1300 echo "brlapi support $brlapi"
1301 echo "Documentation $build_docs"
1302 [ ! -z "$uname_release" ] && \
1303 echo "uname -r $uname_release"
1304 echo "NPTL support $nptl"
1305 echo "vde support $vde"
1306 echo "AIO support $aio"
1307 echo "Install blobs $blobs"
1308 echo "KVM support $kvm"
1309 echo "fdt support $fdt"
1311 if test $sdl_too_old = "yes"; then
1312 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1314 if [ -s $TMPSDLLOG ]; then
1315 echo "The error log from compiling the libSDL test is: "
1318 #if test "$sdl_static" = "no"; then
1319 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1321 config_mak
="config-host.mak"
1322 config_h
="config-host.h"
1324 #echo "Creating $config_mak and $config_h"
1326 test -f $config_h && mv $config_h ${config_h}~
1328 echo "# Automatically generated by configure - do not modify" > $config_mak
1329 printf "# Configured with:" >> $config_mak
1330 printf " '%s'" "$0" "$@" >> $config_mak
1332 echo "/* Automatically generated by configure - do not modify */" > $config_h
1334 echo "prefix=$prefix" >> $config_mak
1335 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1336 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1337 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1338 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1339 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1340 echo "MAKE=$make" >> $config_mak
1341 echo "INSTALL=$install" >> $config_mak
1342 echo "CC=$cc" >> $config_mak
1343 echo "HOST_CC=$host_cc" >> $config_mak
1344 echo "AR=$ar" >> $config_mak
1345 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1346 # XXX: only use CFLAGS and LDFLAGS ?
1347 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1348 # compilation of dyngen tool (useful for win32 build on Linux host)
1349 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1350 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1351 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1352 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1353 echo "CFLAGS=$CFLAGS" >> $config_mak
1354 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1355 echo "EXESUF=$EXESUF" >> $config_mak
1356 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1359 echo "ARCH=i386" >> $config_mak
1360 echo "#define HOST_I386 1" >> $config_h
1363 echo "ARCH=x86_64" >> $config_mak
1364 echo "#define HOST_X86_64 1" >> $config_h
1367 echo "ARCH=alpha" >> $config_mak
1368 echo "#define HOST_ALPHA 1" >> $config_h
1371 echo "ARCH=arm" >> $config_mak
1372 echo "#define HOST_ARM 1" >> $config_h
1375 echo "ARCH=arm" >> $config_mak
1376 echo "#define HOST_ARM 1" >> $config_h
1379 echo "ARCH=cris" >> $config_mak
1380 echo "#define HOST_CRIS 1" >> $config_h
1383 echo "ARCH=hppa" >> $config_mak
1384 echo "#define HOST_HPPA 1" >> $config_h
1387 echo "ARCH=ia64" >> $config_mak
1388 echo "#define HOST_IA64 1" >> $config_h
1391 echo "ARCH=m68k" >> $config_mak
1392 echo "#define HOST_M68K 1" >> $config_h
1395 echo "ARCH=mips" >> $config_mak
1396 echo "#define HOST_MIPS 1" >> $config_h
1399 echo "ARCH=mips64" >> $config_mak
1400 echo "#define HOST_MIPS64 1" >> $config_h
1403 echo "ARCH=ppc" >> $config_mak
1404 echo "#define HOST_PPC 1" >> $config_h
1407 echo "ARCH=ppc64" >> $config_mak
1408 echo "#define HOST_PPC64 1" >> $config_h
1411 echo "ARCH=s390" >> $config_mak
1412 echo "#define HOST_S390 1" >> $config_h
1415 echo "ARCH=sparc" >> $config_mak
1416 echo "#define HOST_SPARC 1" >> $config_h
1419 echo "ARCH=sparc64" >> $config_mak
1420 echo "#define HOST_SPARC64 1" >> $config_h
1423 echo "Unsupported CPU = $cpu"
1427 if test "$sparse" = "yes" ; then
1428 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1429 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1430 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1432 if test "$bigendian" = "yes" ; then
1433 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1434 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1436 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1437 if test "$mingw32" = "yes" ; then
1438 echo "CONFIG_WIN32=yes" >> $config_mak
1439 echo "#define CONFIG_WIN32 1" >> $config_h
1442 #include <byteswap.h>
1443 int main(void) { return bswap_32(0); }
1445 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1446 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1449 #include <sys/endian.h>
1450 #include <sys/types.h>
1451 #include <machine/bswap.h>
1452 int main(void) { return bswap32(0); }
1454 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1455 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1459 if [ "$openbsd" = "yes" ] ; then
1460 echo "#define ENOTSUP 4096" >> $config_h
1463 if test "$darwin" = "yes" ; then
1464 echo "CONFIG_DARWIN=yes" >> $config_mak
1465 echo "#define CONFIG_DARWIN 1" >> $config_h
1468 if test "$aix" = "yes" ; then
1469 echo "CONFIG_AIX=yes" >> $config_mak
1470 echo "#define CONFIG_AIX 1" >> $config_h
1473 if test "$solaris" = "yes" ; then
1474 echo "CONFIG_SOLARIS=yes" >> $config_mak
1475 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1476 if test "$needs_libsunmath" = "yes" ; then
1477 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1478 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1481 if test -n "$sparc_cpu"; then
1482 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1483 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1485 if test "$gdbstub" = "yes" ; then
1486 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1487 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1489 if test "$gprof" = "yes" ; then
1490 echo "TARGET_GPROF=yes" >> $config_mak
1491 echo "#define HAVE_GPROF 1" >> $config_h
1493 if test "$static" = "yes" ; then
1494 echo "CONFIG_STATIC=yes" >> $config_mak
1495 echo "#define CONFIG_STATIC 1" >> $config_h
1497 if test $profiler = "yes" ; then
1498 echo "#define CONFIG_PROFILER 1" >> $config_h
1500 if test "$slirp" = "yes" ; then
1501 echo "CONFIG_SLIRP=yes" >> $config_mak
1502 echo "#define CONFIG_SLIRP 1" >> $config_h
1504 if test "$vde" = "yes" ; then
1505 echo "CONFIG_VDE=yes" >> $config_mak
1506 echo "#define CONFIG_VDE 1" >> $config_h
1507 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1509 for card
in $audio_card_list; do
1510 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1511 echo "$def=yes" >> $config_mak
1512 echo "#define $def 1" >> $config_h
1514 echo "#define AUDIO_DRIVERS \\" >> $config_h
1515 for drv
in $audio_drv_list; do
1516 echo " &${drv}_audio_driver, \\" >>$config_h
1517 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1518 echo "$def=yes" >> $config_mak
1519 if test "$drv" = "fmod"; then
1520 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1521 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1522 elif test "$drv" = "oss"; then
1523 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1527 if test "$mixemu" = "yes" ; then
1528 echo "CONFIG_MIXEMU=yes" >> $config_mak
1529 echo "#define CONFIG_MIXEMU 1" >> $config_h
1531 if test "$vnc_tls" = "yes" ; then
1532 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1533 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1534 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1535 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1537 if test "$vnc_sasl" = "yes" ; then
1538 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1539 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1540 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1541 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1543 if test "$fnmatch" = "yes" ; then
1544 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1546 qemu_version
=`head $source_path/VERSION`
1547 echo "VERSION=$qemu_version" >>$config_mak
1548 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1549 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1551 echo "SRC_PATH=$source_path" >> $config_mak
1552 if [ "$source_path_used" = "yes" ]; then
1553 echo "VPATH=$source_path" >> $config_mak
1555 echo "TARGET_DIRS=$target_list" >> $config_mak
1556 if [ "$build_docs" = "yes" ] ; then
1557 echo "BUILD_DOCS=yes" >> $config_mak
1559 if test "$static" = "yes"; then
1564 if test "$sdl1" = "yes" ; then
1565 echo "#define CONFIG_SDL 1" >> $config_h
1566 echo "CONFIG_SDL=yes" >> $config_mak
1567 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1568 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1569 elif test "$sdl_x11" = "yes" ; then
1570 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1572 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1574 if [ "${aa}" = "yes" ] ; then
1575 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1577 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1580 if test "$cocoa" = "yes" ; then
1581 echo "#define CONFIG_COCOA 1" >> $config_h
1582 echo "CONFIG_COCOA=yes" >> $config_mak
1584 if test "$curses" = "yes" ; then
1585 echo "#define CONFIG_CURSES 1" >> $config_h
1586 echo "CONFIG_CURSES=yes" >> $config_mak
1587 echo "CURSES_LIBS=-lcurses" >> $config_mak
1589 if test "$brlapi" = "yes" ; then
1590 echo "CONFIG_BRLAPI=yes" >> $config_mak
1591 echo "#define CONFIG_BRLAPI 1" >> $config_h
1592 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1594 if test "$bluez" = "yes" ; then
1595 echo "CONFIG_BLUEZ=yes" >> $config_mak
1596 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1597 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1598 echo "#define CONFIG_BLUEZ 1" >> $config_h
1600 if test "$aio" = "yes" ; then
1601 echo "#define CONFIG_AIO 1" >> $config_h
1602 echo "CONFIG_AIO=yes" >> $config_mak
1604 if test "$blobs" = "yes" ; then
1605 echo "INSTALL_BLOBS=yes" >> $config_mak
1607 if test "$iovec" = "yes" ; then
1608 echo "#define HAVE_IOVEC 1" >> $config_h
1610 if test "$fdt" = "yes" ; then
1611 echo "#define HAVE_FDT 1" >> $config_h
1612 echo "FDT_LIBS=-lfdt" >> $config_mak
1614 if test "$signalfd" = "yes" ; then
1615 echo "#define CONFIG_signalfd 1" >> $config_h
1617 if test "$eventfd" = "yes" ; then
1618 echo "#define CONFIG_eventfd 1" >> $config_h
1621 # XXX: suppress that
1622 if [ "$bsd" = "yes" ] ; then
1623 echo "#define O_LARGEFILE 0" >> $config_h
1624 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1625 echo "#define HOST_BSD 1" >> $config_h
1628 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1633 echo "HOST_USB=linux" >> $config_mak
1636 echo "HOST_USB=bsd" >> $config_mak
1639 echo "HOST_USB=stub" >> $config_mak
1644 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1645 tools
="qemu-img\$(EXESUF) $tools"
1646 if [ "$linux" = "yes" ] ; then
1647 tools
="qemu-nbd\$(EXESUF) $tools"
1650 echo "TOOLS=$tools" >> $config_mak
1652 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1654 for target
in $target_list; do
1655 target_dir
="$target"
1656 config_mak
=$target_dir/config.mak
1657 config_h
=$target_dir/config.h
1658 target_cpu
=`echo $target | cut -d '-' -f 1`
1659 target_bigendian
="no"
1660 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1661 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1662 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1663 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1664 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1665 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1666 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1667 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1668 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1669 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1670 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1671 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1672 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1674 target_user_only
="no"
1675 target_linux_user
="no"
1676 target_darwin_user
="no"
1677 target_bsd_user
="no"
1679 ${target_cpu}-softmmu)
1680 target_softmmu
="yes"
1682 ${target_cpu}-linux-user)
1683 target_user_only
="yes"
1684 target_linux_user
="yes"
1686 ${target_cpu}-darwin-user)
1687 target_user_only
="yes"
1688 target_darwin_user
="yes"
1690 ${target_cpu}-bsd-user)
1691 target_user_only
="yes"
1692 target_bsd_user
="yes"
1695 echo "ERROR: Target '$target' not recognised"
1700 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1701 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1702 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1703 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1704 echo "Note that this will disable all output from the virtual graphics card"
1705 echo "except through VNC or curses."
1709 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1711 test -f $config_h && mv $config_h ${config_h}~
1713 mkdir
-p $target_dir
1714 mkdir
-p $target_dir/fpu
1715 mkdir
-p $target_dir/tcg
1716 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1717 mkdir
-p $target_dir/nwfpe
1721 # don't use ln -sf as not all "ln -sf" over write the file/link
1723 rm -f $target_dir/Makefile
1724 ln -s $source_path/Makefile.target
$target_dir/Makefile
1727 echo "# Automatically generated by configure - do not modify" > $config_mak
1728 echo "/* Automatically generated by configure - do not modify */" > $config_h
1731 echo "include ../config-host.mak" >> $config_mak
1732 echo "#include \"../config-host.h\"" >> $config_h
1737 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1738 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1741 disable_cpu_emulation
() {
1742 if test $cpu_emulation = "no"; then
1743 echo "#define NO_CPU_EMULATION 1" >> $config_h
1744 echo "NO_CPU_EMULATION=1" >> $config_mak
1749 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1750 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1751 echo "#define USE_KVM 1" >> $config_h
1752 echo "USE_KVM=1" >> $config_mak
1753 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1754 if test $kvm_cap_pit = "yes" ; then
1755 echo "USE_KVM_PIT=1" >> $config_mak
1756 echo "#define USE_KVM_PIT 1" >> $config_h
1758 if test $kvm_cap_device_assignment = "yes" ; then
1759 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1760 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1762 disable_cpu_emulation
1766 if [ use_upstream_kvm
= yes ]; then
1768 # Make sure the target and host cpus are compatible
1769 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1770 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \
) -o \
1771 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1772 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1775 # Disable KVM for linux-user
1776 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1782 case "$target_cpu" in
1784 echo "TARGET_ARCH=i386" >> $config_mak
1785 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1786 echo "#define TARGET_I386 1" >> $config_h
1787 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1789 echo "#define USE_KQEMU 1" >> $config_h
1791 if test "$kvm" = "yes" ; then
1792 echo "CONFIG_KVM=yes" >> $config_mak
1793 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1794 echo "#define CONFIG_KVM 1" >> $config_h
1799 echo "TARGET_ARCH=x86_64" >> $config_mak
1800 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1801 echo "#define TARGET_I386 1" >> $config_h
1802 echo "#define TARGET_X86_64 1" >> $config_h
1803 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1805 echo "#define USE_KQEMU 1" >> $config_h
1810 echo "TARGET_ARCH=ia64" >> $config_mak
1811 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1812 echo "#define TARGET_IA64 1" >> $config_h
1814 if [ use_upstream_kvm
= yes ]; then
1815 if test "$kvm" = "yes" ; then
1816 echo "CONFIG_KVM=yes" >> $config_mak
1817 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1818 echo "#define CONFIG_KVM 1" >> $config_h
1823 echo "TARGET_ARCH=alpha" >> $config_mak
1824 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1825 echo "#define TARGET_ALPHA 1" >> $config_h
1828 echo "TARGET_ARCH=arm" >> $config_mak
1829 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1830 echo "#define TARGET_ARM 1" >> $config_h
1833 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1836 echo "TARGET_ARCH=cris" >> $config_mak
1837 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1838 echo "#define TARGET_CRIS 1" >> $config_h
1842 echo "TARGET_ARCH=m68k" >> $config_mak
1843 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1844 echo "#define TARGET_M68K 1" >> $config_h
1846 gdb_xml_files
="cf-core.xml cf-fp.xml"
1849 echo "TARGET_ARCH=mips" >> $config_mak
1850 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1851 echo "#define TARGET_MIPS 1" >> $config_h
1852 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1855 echo "TARGET_ARCH=mipsn32" >> $config_mak
1856 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1857 echo "#define TARGET_MIPS 1" >> $config_h
1858 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1861 echo "TARGET_ARCH=mips64" >> $config_mak
1862 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1863 echo "#define TARGET_MIPS 1" >> $config_h
1864 echo "#define TARGET_MIPS64 1" >> $config_h
1865 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1868 echo "TARGET_ARCH=ppc" >> $config_mak
1869 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1870 echo "#define TARGET_PPC 1" >> $config_h
1871 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1874 echo "TARGET_ARCH=ppcemb" >> $config_mak
1875 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1876 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1877 echo "#define TARGET_PPC 1" >> $config_h
1878 echo "#define TARGET_PPCEMB 1" >> $config_h
1879 if test "$kvm" = "yes" ; then
1880 echo "CONFIG_KVM=yes" >> $config_mak
1881 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1882 echo "#define CONFIG_KVM 1" >> $config_h
1884 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1887 echo "TARGET_ARCH=ppc64" >> $config_mak
1888 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1889 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1890 echo "#define TARGET_PPC 1" >> $config_h
1891 echo "#define TARGET_PPC64 1" >> $config_h
1892 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1895 echo "TARGET_ARCH=ppc64" >> $config_mak
1896 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1897 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1898 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1899 echo "#define TARGET_PPC 1" >> $config_h
1900 echo "#define TARGET_PPC64 1" >> $config_h
1901 echo "#define TARGET_ABI32 1" >> $config_h
1902 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1905 echo "TARGET_ARCH=sh4" >> $config_mak
1906 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1907 echo "#define TARGET_SH4 1" >> $config_h
1912 echo "TARGET_ARCH=sparc" >> $config_mak
1913 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1914 echo "#define TARGET_SPARC 1" >> $config_h
1917 echo "TARGET_ARCH=sparc64" >> $config_mak
1918 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1919 echo "#define TARGET_SPARC 1" >> $config_h
1920 echo "#define TARGET_SPARC64 1" >> $config_h
1924 echo "TARGET_ARCH=sparc64" >> $config_mak
1925 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1926 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1927 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1928 echo "#define TARGET_SPARC 1" >> $config_h
1929 echo "#define TARGET_SPARC64 1" >> $config_h
1930 echo "#define TARGET_ABI32 1" >> $config_h
1933 echo "Unsupported target CPU"
1937 if test "$target_bigendian" = "yes" ; then
1938 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1939 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1941 if test "$target_softmmu" = "yes" ; then
1942 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1943 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1945 if test "$target_user_only" = "yes" ; then
1946 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1947 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1949 if test "$target_linux_user" = "yes" ; then
1950 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1951 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1953 if test "$target_darwin_user" = "yes" ; then
1954 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1955 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1958 if test ! -z "$gdb_xml_files" ; then
1959 for x
in $gdb_xml_files; do
1960 list
="$list $source_path/gdb-xml/$x"
1963 echo "TARGET_XML_FILES=$list" >> $config_mak
1965 if test "$target_cpu" = "arm" \
1966 -o "$target_cpu" = "armeb" \
1967 -o "$target_cpu" = "m68k" \
1968 -o "$target_cpu" = "mips" \
1969 -o "$target_cpu" = "mipsel" \
1970 -o "$target_cpu" = "mipsn32" \
1971 -o "$target_cpu" = "mipsn32el" \
1972 -o "$target_cpu" = "mips64" \
1973 -o "$target_cpu" = "mips64el" \
1974 -o "$target_cpu" = "ppc" \
1975 -o "$target_cpu" = "ppc64" \
1976 -o "$target_cpu" = "ppc64abi32" \
1977 -o "$target_cpu" = "ppcemb" \
1978 -o "$target_cpu" = "sparc" \
1979 -o "$target_cpu" = "sparc64" \
1980 -o "$target_cpu" = "sparc32plus"; then
1981 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1982 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1984 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1985 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1986 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1988 if test "$target_user_only" = "yes" \
1989 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1990 echo "#define USE_NPTL 1" >> $config_h
1992 # 32 bit ELF loader in addition to native 64 bit loader?
1993 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1994 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1995 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1997 if test "$target_bsd_user" = "yes" ; then
1998 echo "CONFIG_BSD_USER=yes" >> $config_mak
1999 echo "#define CONFIG_BSD_USER 1" >> $config_h
2002 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
2004 done # for target in $targets
2006 # build tree in object directory if source path is different from current one
2007 if test "$source_path_used" = "yes" ; then
2008 DIRS
="tests tests/cris slirp audio"
2009 FILES
="Makefile tests/Makefile"
2010 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2011 FILES
="$FILES tests/test-mmap.c"
2012 for dir
in $DIRS ; do
2015 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2016 for f
in $FILES ; do
2018 ln -s $source_path/$f $f