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
101 target_list
="x86_64-softmmu"
103 i386|i486|i586|i686|i86pc|BePC
)
157 local fname
="$(dirname "$0")/KVM_VERSION"
159 if test -f "$fname"; then
199 kvm_cap_device_assignment
="no"
205 pkgversion
="$(kvm_version)"
211 if check_define __linux__
; then
213 elif check_define _WIN32
; then
221 OS_CFLAGS
="-mno-cygwin"
222 if [ "$cpu" = "i386" ] ; then
225 audio_possible_drivers
="sdl"
229 if [ "$cpu" = "i386" ] ; then
232 audio_possible_drivers
="dsound sdl fmod"
236 audio_possible_drivers
="oss sdl esd pa"
237 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
244 audio_possible_drivers
="oss sdl esd pa"
245 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
253 audio_possible_drivers
="oss sdl esd"
260 audio_possible_drivers
="oss sdl esd"
266 # 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
267 if [ "$cpu" = "i386" ] ; then
268 is_x86_64
=`sysctl -n hw.optional.x86_64`
269 [ "$is_x86_64" = "1" ] && cpu
=x86_64
271 if [ "$cpu" = "x86_64" ] ; then
272 OS_CFLAGS
="-arch x86_64"
273 LDFLAGS
="-arch x86_64"
275 OS_CFLAGS
="-mdynamic-no-pic"
279 audio_drv_list
="coreaudio"
280 audio_possible_drivers
="coreaudio sdl fmod"
281 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
287 needs_libsunmath
="no"
288 solarisrev
=`uname -r | cut -f2 -d.`
289 # have to select again, because `uname -m` returns i86pc
290 # even on an x86_64 box.
291 solariscpu
=`isainfo -k`
292 if test "${solariscpu}" = "amd64" ; then
295 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
296 if test "$solarisrev" -le 9 ; then
297 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
298 needs_libsunmath
="yes"
300 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
301 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
302 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
303 echo "Studio 11 can be downloaded from www.sun.com."
307 if test "$solarisrev" -ge 9 ; then
311 if test -f /usr
/include
/sys
/soundcard.h
; then
314 audio_possible_drivers
="oss sdl"
322 audio_possible_drivers
="oss alsa sdl esd pa"
326 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
328 audio_possible_drivers
="$audio_possible_drivers fmod"
332 if [ "$cpu" = "ia64" ] ; then
338 if [ "$cpu" = "powerpc" ]; then
344 if [ "$bsd" = "yes" ] ; then
345 if [ "$darwin" != "yes" ] ; then
353 source_path
=`dirname "$0"`
354 source_path_used
="no"
356 if [ -z "$source_path" ]; then
359 source_path
=`cd "$source_path"; pwd`
361 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
364 # generate compile errors on warnings for development builds
365 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
370 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
372 --help|
-h) show_help
=yes
374 --prefix=*) prefix
="$optarg"
376 --interp-prefix=*) interp_prefix
="$optarg"
378 --source-path=*) source_path
="$optarg"
379 source_path_used
="yes"
385 --host-cc=*) host_cc
="$optarg"
387 --make=*) make="$optarg"
389 --install=*) install="$optarg"
391 --extra-cflags=*) CFLAGS
="$optarg"
393 --extra-ldflags=*) LDFLAGS
="$optarg"
395 --cpu=*) cpu
="$optarg"
397 --target-list=*) target_list
="$optarg"
399 --enable-gprof) gprof
="yes"
401 --static) static
="yes"
403 --disable-sdl) sdl
="no"
405 --fmod-lib=*) fmod_lib
="$optarg"
407 --fmod-inc=*) fmod_inc
="$optarg"
409 --oss-lib=*) oss_lib
="$optarg"
411 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
413 --audio-drv-list=*) audio_drv_list
="$optarg"
415 --enable-sparse) sparse
="yes"
417 --disable-sparse) sparse
="no"
419 --disable-vnc-tls) vnc_tls
="no"
421 --disable-vnc-sasl) vnc_sasl
="no"
423 --disable-slirp) slirp
="no"
425 --disable-vde) vde
="no"
427 --disable-kqemu) kqemu
="no"
429 --disable-brlapi) brlapi
="no"
431 --disable-bluez) bluez
="no"
433 --disable-kvm) kvm
="no"
435 --enable-profiler) profiler
="yes"
440 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
442 --disable-gfx-check) check_gfx
="no"
444 --disable-system) softmmu
="no"
446 --enable-system) softmmu
="yes"
448 --disable-linux-user) linux_user
="no"
450 --enable-linux-user) linux_user
="yes"
452 --disable-darwin-user) darwin_user
="no"
454 --enable-darwin-user) darwin_user
="yes"
456 --disable-bsd-user) bsd_user
="no"
458 --enable-bsd-user) bsd_user
="yes"
460 --enable-uname-release=*) uname_release
="$optarg"
465 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
466 target_cpu
="sparc"; cpu
="sparc" ;;
467 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
468 target_cpu
="sparc"; cpu
="sparc" ;;
469 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
470 target_cpu
="sparc64"; cpu
="sparc64" ;;
471 *) echo "undefined SPARC architecture. Exiting";exit 1;;
474 --enable-werror) werror
="yes"
476 --disable-werror) werror
="no"
478 --disable-curses) curses
="no"
480 --disable-nptl) nptl
="no"
482 --enable-mixemu) mixemu
="yes"
484 --disable-aio) aio
="no"
486 --disable-blobs) blobs
="no"
488 --kerneldir=*) kerneldir
="$optarg"
490 --disable-cpu-emulation) cpu_emulation
="no"
492 *) echo "ERROR: unknown option $opt"; exit 1
497 # default flags for all hosts
498 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
499 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
500 LDFLAGS
="$LDFLAGS -g"
501 if test "$werror" = "yes" ; then
502 CFLAGS
="$CFLAGS -Werror"
505 CFLAGS
="$CFLAGS -I$(readlink -f "$source_path/kvm
/libkvm
")"
507 if test "$solaris" = "no" ; then
508 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
509 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
514 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
515 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
518 sparc
) if test -z "$sparc_cpu" ; then
519 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
522 ARCH_CFLAGS
="${SP_CFLAGS}"
523 ARCH_LDFLAGS
="${SP_LDFLAGS}"
526 sparc64
) if test -z "$sparc_cpu" ; then
527 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
530 ARCH_CFLAGS
="${SP_CFLAGS}"
531 ARCH_LDFLAGS
="${SP_LDFLAGS}"
535 ARCH_CFLAGS
="-march=z900"
547 if test x
"$show_help" = x
"yes" ; then
550 Usage: configure [options]
551 Options: [defaults in brackets after descriptions]
554 echo "Standard options:"
555 echo " --help print this message"
556 echo " --prefix=PREFIX install in PREFIX [$prefix]"
557 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
558 echo " use %M for cpu name [$interp_prefix]"
559 echo " --target-list=LIST set target list [$target_list]"
561 echo "kqemu kernel acceleration support:"
562 echo " --disable-kqemu disable kqemu support"
564 echo "Advanced options (experts only):"
565 echo " --source-path=PATH path of source code [$source_path]"
566 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
567 echo " --cc=CC use C compiler CC [$cc]"
568 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
569 echo " --make=MAKE use specified make [$make]"
570 echo " --install=INSTALL use specified install [$install]"
571 echo " --static enable static build [$static]"
572 echo " --enable-sparse enable sparse checker"
573 echo " --disable-sparse disable sparse checker (default)"
574 echo " --disable-werror disable compilation abort on warning"
575 echo " --disable-sdl disable SDL"
576 echo " --enable-cocoa enable COCOA (Mac OS X only)"
577 echo " --audio-drv-list=LIST set audio drivers list:"
578 echo " Available drivers: $audio_possible_drivers"
579 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
580 echo " Available cards: $audio_possible_cards"
581 echo " --enable-mixemu enable mixer emulation"
582 echo " --disable-brlapi disable BrlAPI"
583 echo " --disable-vnc-tls disable TLS encryption for VNC server"
584 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
585 echo " --disable-curses disable curses output"
586 echo " --disable-bluez disable bluez stack connectivity"
587 echo " --disable-kvm disable KVM acceleration support"
588 echo " --disable-nptl disable usermode NPTL support"
589 echo " --enable-system enable all system emulation targets"
590 echo " --disable-system disable all system emulation targets"
591 echo " --enable-linux-user enable all linux usermode emulation targets"
592 echo " --disable-linux-user disable all linux usermode emulation targets"
593 echo " --enable-darwin-user enable all darwin usermode emulation targets"
594 echo " --disable-darwin-user disable all darwin usermode emulation targets"
595 echo " --enable-bsd-user enable all BSD usermode emulation targets"
596 echo " --disable-bsd-user disable all BSD usermode emulation targets"
597 echo " --fmod-lib path to FMOD library"
598 echo " --fmod-inc path to FMOD includes"
599 echo " --oss-lib path to OSS library"
600 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
601 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
602 echo " --disable-vde disable support for vde network"
603 echo " --disable-aio disable AIO support"
604 echo " --disable-blobs disable installing provided firmware blobs"
605 echo " --kerneldir=PATH look for kernel includes in PATH"
606 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
608 echo "NOTE: The object files are built at the place where configure is launched"
612 if test "$mingw32" = "yes" ; then
620 if test ! -x "$(which cgcc 2>/dev/null)"; then
625 # Solaris specific configure tool chain decisions
627 if test "$solaris" = "yes" ; then
628 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
629 if test -z "$solinst" ; then
630 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
631 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
632 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
635 if test "$solinst" = "/usr/sbin/install" ; then
636 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
637 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
638 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
641 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
642 if test -z "$sol_ar" ; then
643 echo "Error: No path includes ar"
644 if test -f /usr
/ccs
/bin
/ar ; then
645 echo "Add /usr/ccs/bin to your path and rerun configure"
652 if test -z "$target_list" ; then
653 # these targets are portable
654 if [ "$softmmu" = "yes" ] ; then
673 # the following are Linux specific
674 if [ "$linux_user" = "yes" ] ; then
675 target_list
="${target_list}\
687 ppc64abi32-linux-user \
692 sparc32plus-linux-user \
695 # the following are Darwin specific
696 if [ "$darwin_user" = "yes" ] ; then
697 target_list
="$target_list i386-darwin-user ppc-darwin-user "
699 # the following are BSD specific
700 if [ "$bsd_user" = "yes" ] ; then
701 target_list
="${target_list}\
706 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
708 if test -z "$target_list" ; then
709 echo "No targets enabled"
713 if test -z "$cross_prefix" ; then
716 # big/little endian test
718 #include <inttypes.h>
719 int main(int argc, char ** argv){
720 volatile uint32_t i=0x01234567;
721 return (*((uint8_t*)(&i))) == 0x67;
725 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
726 $TMPE && bigendian
="yes"
728 echo big
/little
test failed
733 # if cross compiling, cannot launch a program, so make a static guess
734 if test "$cpu" = "armv4b" \
738 -o "$cpu" = "mips64" \
740 -o "$cpu" = "ppc64" \
742 -o "$cpu" = "sparc" \
743 -o "$cpu" = "sparc64"; then
749 # host long bits test
751 if test "$cpu" = "x86_64" \
752 -o "$cpu" = "alpha" \
754 -o "$cpu" = "sparc64" \
755 -o "$cpu" = "ppc64"; then
759 # check gcc options support
765 # Check host NPTL support
768 #include <linux/futex.h>
771 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
777 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
783 ##########################################
797 if test "$kvm" = "yes" ; then
799 kvm_cflags
="-I$source_path/kvm/kernel/include"
800 kvm_cflags
="$kvm_cflags -I$source_path/kvm/kernel/arch/$kvm_arch/include"
802 # test for KVM_CAP_PIT
807 #error "kvm no pit capability"
809 int main(void) { return 0; }
811 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
815 # test for KVM_CAP_DEVICE_ASSIGNMENT
819 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
820 #error "kvm no device assignment capability"
822 int main(void) { return 0; }
824 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
825 kvm_cap_device_assignment
="yes"
829 ##########################################
834 int main(void) { zlibVersion(); return 0; }
836 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
840 echo "Error: zlib check failed"
841 echo "Make sure to have the zlib libs and headers installed."
846 ##########################################
851 if test -z "$sdl" ; then
852 sdl_config
="sdl-config"
858 #undef main /* We don't want SDL to override our main() */
859 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
861 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
862 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
863 if test "$_sdlversion" -lt 121 ; then
866 if test "$cocoa" = "no" ; then
871 # static link with sdl ?
872 if test "$sdl" = "yes" ; then
874 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
875 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
876 if [ "$aa" = "yes" ] ; then
877 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
880 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
884 fi # sdl compile test
886 # Make sure to disable cocoa if sdl was set
887 if test "$sdl" = "yes" ; then
889 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
893 if test "$sdl" = "yes" ; then
896 #if defined(SDL_VIDEO_DRIVER_X11)
897 #include <X11/XKBlib.h>
899 #error No x11 support
901 int main(void) { return 0; }
903 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
908 ##########################################
910 if test "$vnc_tls" = "yes" ; then
912 #include <gnutls/gnutls.h>
913 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
915 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
916 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
917 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
918 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
925 ##########################################
927 if test "$vnc_sasl" = "yes" ; then
929 #include <sasl/sasl.h>
931 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
933 # Assuming Cyrus-SASL installed in /usr prefix
935 vnc_sasl_libs
="-lsasl2"
936 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
937 $vnc_sasl_libs 2> /dev
/null
; then
944 ##########################################
945 # vde libraries probe
946 if test "$vde" = "yes" ; then
948 #include <libvdeplug.h>
951 struct vde_open_args a = {0, 0, 0};
952 vde_open("", "", &a);
956 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
963 ##########################################
964 # Sound support libraries probe
975 int main(void) { $exp }
977 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
981 echo "Error: $drv check failed"
982 echo "Make sure to have the $drv libs and headers installed."
988 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
989 for drv
in $audio_drv_list; do
992 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
993 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
997 if test -z $fmod_lib ||
test -z $fmod_inc; then
999 echo "Error: You must specify path to FMOD library and headers"
1000 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1004 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1008 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
1012 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
1013 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1016 oss|sdl|core|wav|dsound
)
1017 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1021 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
1023 echo "Error: Unknown driver '$drv' selected"
1024 echo "Possible drivers are: $audio_possible_drivers"
1032 ##########################################
1035 if test -z "$brlapi" ; then
1039 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1041 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
1043 fi # brlapi compile test
1046 ##########################################
1049 if test "$curses" = "yes" ; then
1053 int main(void) { return curses_version(); }
1055 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
1060 ##########################################
1061 # bluez support probe
1062 if test "$bluez" = "yes" ; then
1063 `pkg-config bluez` || bluez
="no"
1065 if test "$bluez" = "yes" ; then
1067 #include <bluetooth/bluetooth.h>
1068 int main(void) { return bt_error(0); }
1070 bluez_cflags
=`pkg-config --cflags bluez`
1071 bluez_libs
=`pkg-config --libs bluez`
1072 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1073 $bluez_libs > /dev
/null
2> /dev
/null
; then
1080 ##########################################
1082 if test "$kvm" = "yes" ; then
1084 #include <linux/kvm.h>
1085 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1086 #error Invalid KVM version
1088 #if !defined(KVM_CAP_USER_MEMORY)
1089 #error Missing KVM capability KVM_CAP_USER_MEMORY
1091 #if !defined(KVM_CAP_SET_TSS_ADDR)
1092 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1094 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1095 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1097 int main(void) { return 0; }
1099 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1100 > /dev
/null
2>/dev
/null
; then
1104 if [ -x "`which awk 2>/dev/null`" ] && \
1105 [ -x "`which grep 2>/dev/null`" ]; then
1106 kvmerr
=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1108 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1109 if test "$kvmerr" != "" ; then
1110 kvm
="no - (${kvmerr})"
1116 ##########################################
1120 if test "$aio" = "yes" ; then
1123 #include <pthread.h>
1124 int main(void) { pthread_mutex_t lock; return 0; }
1126 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1132 ##########################################
1135 #include <sys/types.h>
1136 #include <sys/uio.h>
1138 int main(void) { struct iovec iov; return 0; }
1141 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1145 ##########################################
1147 if test "$fdt" = "yes" ; then
1150 int main(void) { return 0; }
1152 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1157 ##########################################
1162 #include <sys/syscall.h>
1164 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1167 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1171 ##########################################
1176 #include <sys/syscall.h>
1177 int main(void) { return syscall(SYS_eventfd, 0); }
1180 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1184 # Check if tools are available to build documentation.
1185 if [ -x "`which texi2html 2>/dev/null`" ] && \
1186 [ -x "`which pod2man 2>/dev/null`" ]; then
1190 ##########################################
1195 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1199 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1201 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1205 if test "$rt" = "yes" ; then
1206 # Hack, we should have a general purpose LIBS for this sort of thing
1207 AIOLIBS
="$AIOLIBS -lrt"
1210 if test "$mingw32" = "yes" ; then
1211 if test -z "$prefix" ; then
1212 prefix
="c:\\\\Program Files\\\\Qemu"
1219 if test -z "$prefix" ; then
1222 mansuffix
="/share/man"
1223 datasuffix
="/share/qemu"
1224 docsuffix
="/share/doc/qemu"
1228 echo "Install prefix $prefix"
1229 echo "BIOS directory $prefix$datasuffix"
1230 echo "binary directory $prefix$binsuffix"
1231 if test "$mingw32" = "no" ; then
1232 echo "Manual directory $prefix$mansuffix"
1233 echo "ELF interp prefix $interp_prefix"
1235 echo "Source path $source_path"
1236 echo "C compiler $cc"
1237 echo "Host C compiler $host_cc"
1238 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1240 echo "install $install"
1241 echo "host CPU $cpu"
1242 echo "host big endian $bigendian"
1243 echo "target list $target_list"
1244 echo "gprof enabled $gprof"
1245 echo "sparse enabled $sparse"
1246 echo "profiler $profiler"
1247 echo "static build $static"
1248 echo "-Werror enabled $werror"
1249 if test "$darwin" = "yes" ; then
1250 echo "Cocoa support $cocoa"
1252 echo "SDL support $sdl"
1253 if test "$sdl" != "no" ; then
1254 echo "SDL static link $sdl_static"
1256 echo "curses support $curses"
1257 echo "mingw32 support $mingw32"
1258 echo "Audio drivers $audio_drv_list"
1259 echo "Extra audio cards $audio_card_list"
1260 echo "Mixer emulation $mixemu"
1261 echo "VNC TLS support $vnc_tls"
1262 if test "$vnc_tls" = "yes" ; then
1263 echo " TLS CFLAGS $vnc_tls_cflags"
1264 echo " TLS LIBS $vnc_tls_libs"
1266 echo "VNC SASL support $vnc_sasl"
1267 if test "$vnc_sasl" = "yes" ; then
1268 echo " SASL CFLAGS $vnc_sasl_cflags"
1269 echo " SASL LIBS $vnc_sasl_libs"
1271 if test -n "$sparc_cpu"; then
1272 echo "Target Sparc Arch $sparc_cpu"
1274 echo "kqemu support $kqemu"
1275 echo "kvm support $kvm"
1276 echo "CPU emulation $cpu_emulation"
1277 echo "brlapi support $brlapi"
1278 echo "Documentation $build_docs"
1279 [ ! -z "$uname_release" ] && \
1280 echo "uname -r $uname_release"
1281 echo "NPTL support $nptl"
1282 echo "vde support $vde"
1283 echo "AIO support $aio"
1284 echo "Install blobs $blobs"
1285 echo "KVM support $kvm"
1286 echo "fdt support $fdt"
1288 if test $sdl_too_old = "yes"; then
1289 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1291 if [ -s $TMPSDLLOG ]; then
1292 echo "The error log from compiling the libSDL test is: "
1295 #if test "$sdl_static" = "no"; then
1296 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1298 config_mak
="config-host.mak"
1299 config_h
="config-host.h"
1301 #echo "Creating $config_mak and $config_h"
1303 test -f $config_h && mv $config_h ${config_h}~
1305 echo "# Automatically generated by configure - do not modify" > $config_mak
1306 printf "# Configured with:" >> $config_mak
1307 printf " '%s'" "$0" "$@" >> $config_mak
1309 echo "/* Automatically generated by configure - do not modify */" > $config_h
1311 echo "prefix=$prefix" >> $config_mak
1312 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1313 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1314 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1315 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1316 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1317 echo "MAKE=$make" >> $config_mak
1318 echo "INSTALL=$install" >> $config_mak
1319 echo "CC=$cc" >> $config_mak
1320 echo "HOST_CC=$host_cc" >> $config_mak
1321 echo "AR=$ar" >> $config_mak
1322 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1323 # XXX: only use CFLAGS and LDFLAGS ?
1324 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1325 # compilation of dyngen tool (useful for win32 build on Linux host)
1326 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1327 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1328 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1329 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1330 echo "CFLAGS=$CFLAGS" >> $config_mak
1331 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1332 echo "EXESUF=$EXESUF" >> $config_mak
1333 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1336 echo "ARCH=i386" >> $config_mak
1337 echo "#define HOST_I386 1" >> $config_h
1340 echo "ARCH=x86_64" >> $config_mak
1341 echo "#define HOST_X86_64 1" >> $config_h
1344 echo "ARCH=alpha" >> $config_mak
1345 echo "#define HOST_ALPHA 1" >> $config_h
1348 echo "ARCH=arm" >> $config_mak
1349 echo "#define HOST_ARM 1" >> $config_h
1352 echo "ARCH=arm" >> $config_mak
1353 echo "#define HOST_ARM 1" >> $config_h
1356 echo "ARCH=cris" >> $config_mak
1357 echo "#define HOST_CRIS 1" >> $config_h
1360 echo "ARCH=hppa" >> $config_mak
1361 echo "#define HOST_HPPA 1" >> $config_h
1364 echo "ARCH=ia64" >> $config_mak
1365 echo "#define HOST_IA64 1" >> $config_h
1368 echo "ARCH=m68k" >> $config_mak
1369 echo "#define HOST_M68K 1" >> $config_h
1372 echo "ARCH=mips" >> $config_mak
1373 echo "#define HOST_MIPS 1" >> $config_h
1376 echo "ARCH=mips64" >> $config_mak
1377 echo "#define HOST_MIPS64 1" >> $config_h
1380 echo "ARCH=ppc" >> $config_mak
1381 echo "#define HOST_PPC 1" >> $config_h
1384 echo "ARCH=ppc64" >> $config_mak
1385 echo "#define HOST_PPC64 1" >> $config_h
1388 echo "ARCH=s390" >> $config_mak
1389 echo "#define HOST_S390 1" >> $config_h
1392 echo "ARCH=sparc" >> $config_mak
1393 echo "#define HOST_SPARC 1" >> $config_h
1396 echo "ARCH=sparc64" >> $config_mak
1397 echo "#define HOST_SPARC64 1" >> $config_h
1400 echo "Unsupported CPU = $cpu"
1404 if test "$sparse" = "yes" ; then
1405 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1406 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1407 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1409 if test "$bigendian" = "yes" ; then
1410 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1411 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1413 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1414 if test "$mingw32" = "yes" ; then
1415 echo "CONFIG_WIN32=yes" >> $config_mak
1416 echo "#define CONFIG_WIN32 1" >> $config_h
1419 #include <byteswap.h>
1420 int main(void) { return bswap_32(0); }
1422 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1423 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1426 #include <sys/endian.h>
1427 #include <sys/types.h>
1428 #include <machine/bswap.h>
1429 int main(void) { return bswap32(0); }
1431 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1432 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1436 if [ "$openbsd" = "yes" ] ; then
1437 echo "#define ENOTSUP 4096" >> $config_h
1440 if test "$darwin" = "yes" ; then
1441 echo "CONFIG_DARWIN=yes" >> $config_mak
1442 echo "#define CONFIG_DARWIN 1" >> $config_h
1445 if test "$aix" = "yes" ; then
1446 echo "CONFIG_AIX=yes" >> $config_mak
1447 echo "#define CONFIG_AIX 1" >> $config_h
1450 if test "$solaris" = "yes" ; then
1451 echo "CONFIG_SOLARIS=yes" >> $config_mak
1452 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1453 if test "$needs_libsunmath" = "yes" ; then
1454 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1455 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1458 if test -n "$sparc_cpu"; then
1459 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1460 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1462 if test "$gdbstub" = "yes" ; then
1463 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1464 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1466 if test "$gprof" = "yes" ; then
1467 echo "TARGET_GPROF=yes" >> $config_mak
1468 echo "#define HAVE_GPROF 1" >> $config_h
1470 if test "$static" = "yes" ; then
1471 echo "CONFIG_STATIC=yes" >> $config_mak
1472 echo "#define CONFIG_STATIC 1" >> $config_h
1474 if test $profiler = "yes" ; then
1475 echo "#define CONFIG_PROFILER 1" >> $config_h
1477 if test "$slirp" = "yes" ; then
1478 echo "CONFIG_SLIRP=yes" >> $config_mak
1479 echo "#define CONFIG_SLIRP 1" >> $config_h
1481 if test "$vde" = "yes" ; then
1482 echo "CONFIG_VDE=yes" >> $config_mak
1483 echo "#define CONFIG_VDE 1" >> $config_h
1484 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1486 for card
in $audio_card_list; do
1487 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1488 echo "$def=yes" >> $config_mak
1489 echo "#define $def 1" >> $config_h
1491 echo "#define AUDIO_DRIVERS \\" >> $config_h
1492 for drv
in $audio_drv_list; do
1493 echo " &${drv}_audio_driver, \\" >>$config_h
1494 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1495 echo "$def=yes" >> $config_mak
1496 if test "$drv" = "fmod"; then
1497 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1498 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1499 elif test "$drv" = "oss"; then
1500 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1504 if test "$mixemu" = "yes" ; then
1505 echo "CONFIG_MIXEMU=yes" >> $config_mak
1506 echo "#define CONFIG_MIXEMU 1" >> $config_h
1508 if test "$vnc_tls" = "yes" ; then
1509 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1510 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1511 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1512 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1514 if test "$vnc_sasl" = "yes" ; then
1515 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1516 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1517 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1518 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1520 qemu_version
=`head $source_path/VERSION`
1521 echo "VERSION=$qemu_version" >>$config_mak
1522 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1523 echo "#define KVM_VERSION \"${pkgversion}\"" >> $config_h
1525 echo "SRC_PATH=$source_path" >> $config_mak
1526 if [ "$source_path_used" = "yes" ]; then
1527 echo "VPATH=$source_path" >> $config_mak
1529 echo "TARGET_DIRS=$target_list" >> $config_mak
1530 if [ "$build_docs" = "yes" ] ; then
1531 echo "BUILD_DOCS=yes" >> $config_mak
1533 if test "$static" = "yes"; then
1538 if test "$sdl1" = "yes" ; then
1539 echo "#define CONFIG_SDL 1" >> $config_h
1540 echo "CONFIG_SDL=yes" >> $config_mak
1541 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1542 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1543 elif test "$sdl_x11" = "yes" ; then
1544 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1546 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1548 if [ "${aa}" = "yes" ] ; then
1549 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1551 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1554 if test "$cocoa" = "yes" ; then
1555 echo "#define CONFIG_COCOA 1" >> $config_h
1556 echo "CONFIG_COCOA=yes" >> $config_mak
1558 if test "$curses" = "yes" ; then
1559 echo "#define CONFIG_CURSES 1" >> $config_h
1560 echo "CONFIG_CURSES=yes" >> $config_mak
1561 echo "CURSES_LIBS=-lcurses" >> $config_mak
1563 if test "$brlapi" = "yes" ; then
1564 echo "CONFIG_BRLAPI=yes" >> $config_mak
1565 echo "#define CONFIG_BRLAPI 1" >> $config_h
1566 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1568 if test "$bluez" = "yes" ; then
1569 echo "CONFIG_BLUEZ=yes" >> $config_mak
1570 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1571 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1572 echo "#define CONFIG_BLUEZ 1" >> $config_h
1574 if test "$aio" = "yes" ; then
1575 echo "#define CONFIG_AIO 1" >> $config_h
1576 echo "CONFIG_AIO=yes" >> $config_mak
1578 if test "$blobs" = "yes" ; then
1579 echo "INSTALL_BLOBS=yes" >> $config_mak
1581 if test "$iovec" = "yes" ; then
1582 echo "#define HAVE_IOVEC 1" >> $config_h
1584 if test "$fdt" = "yes" ; then
1585 echo "#define HAVE_FDT 1" >> $config_h
1586 echo "FDT_LIBS=-lfdt" >> $config_mak
1588 if test "$signalfd" = "yes" ; then
1589 echo "#define CONFIG_signalfd 1" >> $config_h
1591 if test "$eventfd" = "yes" ; then
1592 echo "#define CONFIG_eventfd 1" >> $config_h
1595 # XXX: suppress that
1596 if [ "$bsd" = "yes" ] ; then
1597 echo "#define O_LARGEFILE 0" >> $config_h
1598 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1599 echo "#define _BSD 1" >> $config_h
1602 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1607 echo "HOST_USB=linux" >> $config_mak
1610 echo "HOST_USB=bsd" >> $config_mak
1613 echo "HOST_USB=stub" >> $config_mak
1617 # this is a temp hack needed for libkvm
1618 if test "$kvm" = "yes" ; then
1619 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1623 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1624 tools
="qemu-img\$(EXESUF) $tools"
1625 if [ "$linux" = "yes" ] ; then
1626 tools
="qemu-nbd\$(EXESUF) $tools"
1629 echo "TOOLS=$tools" >> $config_mak
1631 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1633 for target
in $target_list; do
1634 target_dir
="$target"
1635 config_mak
=$target_dir/config.mak
1636 config_h
=$target_dir/config.h
1637 target_cpu
=`echo $target | cut -d '-' -f 1`
1638 target_bigendian
="no"
1639 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1640 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1641 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1642 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1643 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1644 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1645 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1646 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1647 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1648 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1649 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1650 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1651 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1653 target_user_only
="no"
1654 target_linux_user
="no"
1655 target_darwin_user
="no"
1656 target_bsd_user
="no"
1658 ${target_cpu}-softmmu)
1659 target_softmmu
="yes"
1661 ${target_cpu}-linux-user)
1662 target_user_only
="yes"
1663 target_linux_user
="yes"
1665 ${target_cpu}-darwin-user)
1666 target_user_only
="yes"
1667 target_darwin_user
="yes"
1669 ${target_cpu}-bsd-user)
1670 target_user_only
="yes"
1671 target_bsd_user
="yes"
1674 echo "ERROR: Target '$target' not recognised"
1679 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1680 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1681 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1682 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1683 echo "Note that this will disable all output from the virtual graphics card"
1684 echo "except through VNC or curses."
1688 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1690 test -f $config_h && mv $config_h ${config_h}~
1692 mkdir
-p $target_dir
1693 mkdir
-p $target_dir/fpu
1694 mkdir
-p $target_dir/tcg
1695 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1696 mkdir
-p $target_dir/nwfpe
1700 # don't use ln -sf as not all "ln -sf" over write the file/link
1702 rm -f $target_dir/Makefile
1703 ln -s $source_path/Makefile.target
$target_dir/Makefile
1706 echo "# Automatically generated by configure - do not modify" > $config_mak
1707 echo "/* Automatically generated by configure - do not modify */" > $config_h
1710 echo "include ../config-host.mak" >> $config_mak
1711 echo "#include \"../config-host.h\"" >> $config_h
1716 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1717 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1720 disable_cpu_emulation
() {
1721 if test $cpu_emulation = "no"; then
1722 echo "#define NO_CPU_EMULATION 1" >> $config_h
1723 echo "NO_CPU_EMULATION=1" >> $config_mak
1728 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1729 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1730 echo "#define USE_KVM 1" >> $config_h
1731 echo "USE_KVM=1" >> $config_mak
1732 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1733 if test $kvm_cap_pit = "yes" ; then
1734 echo "USE_KVM_PIT=1" >> $config_mak
1735 echo "#define USE_KVM_PIT 1" >> $config_h
1737 if test $kvm_cap_device_assignment = "yes" ; then
1738 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1739 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1741 disable_cpu_emulation
1745 if [ use_upstream_kvm
= yes ]; then
1747 # Make sure the target and host cpus are compatible
1748 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1749 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \
) -o \
1750 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1751 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1754 # Disable KVM for linux-user
1755 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1761 case "$target_cpu" in
1763 echo "TARGET_ARCH=i386" >> $config_mak
1764 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1765 echo "#define TARGET_I386 1" >> $config_h
1766 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1768 echo "#define USE_KQEMU 1" >> $config_h
1770 if test "$kvm" = "yes" ; then
1771 echo "USE_KVM=yes" >> $config_mak
1772 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1773 echo "#define USE_KVM 1" >> $config_h
1778 echo "TARGET_ARCH=x86_64" >> $config_mak
1779 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1780 echo "#define TARGET_I386 1" >> $config_h
1781 echo "#define TARGET_X86_64 1" >> $config_h
1782 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1784 echo "#define USE_KQEMU 1" >> $config_h
1789 echo "TARGET_ARCH=ia64" >> $config_mak
1790 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1791 echo "#define TARGET_IA64 1" >> $config_h
1793 if [ use_upstream_kvm
= yes ]; then
1794 if test "$kvm" = "yes" ; then
1795 echo "USE_KVM=yes" >> $config_mak
1796 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1797 echo "#define USE_KVM 1" >> $config_h
1802 echo "TARGET_ARCH=alpha" >> $config_mak
1803 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1804 echo "#define TARGET_ALPHA 1" >> $config_h
1807 echo "TARGET_ARCH=arm" >> $config_mak
1808 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1809 echo "#define TARGET_ARM 1" >> $config_h
1812 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1815 echo "TARGET_ARCH=cris" >> $config_mak
1816 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1817 echo "#define TARGET_CRIS 1" >> $config_h
1821 echo "TARGET_ARCH=m68k" >> $config_mak
1822 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1823 echo "#define TARGET_M68K 1" >> $config_h
1825 gdb_xml_files
="cf-core.xml cf-fp.xml"
1828 echo "TARGET_ARCH=mips" >> $config_mak
1829 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1830 echo "#define TARGET_MIPS 1" >> $config_h
1831 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1834 echo "TARGET_ARCH=mipsn32" >> $config_mak
1835 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1836 echo "#define TARGET_MIPS 1" >> $config_h
1837 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1840 echo "TARGET_ARCH=mips64" >> $config_mak
1841 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1842 echo "#define TARGET_MIPS 1" >> $config_h
1843 echo "#define TARGET_MIPS64 1" >> $config_h
1844 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1847 echo "TARGET_ARCH=ppc" >> $config_mak
1848 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1849 echo "#define TARGET_PPC 1" >> $config_h
1850 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1853 echo "TARGET_ARCH=ppcemb" >> $config_mak
1854 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1855 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1856 echo "#define TARGET_PPC 1" >> $config_h
1857 echo "#define TARGET_PPCEMB 1" >> $config_h
1858 if test "$kvm" = "yes" ; then
1859 echo "USE_KVM=yes" >> $config_mak
1860 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1861 echo "#define USE_KVM 1" >> $config_h
1863 gdb_xml_files
="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1866 echo "TARGET_ARCH=ppc64" >> $config_mak
1867 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1868 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1869 echo "#define TARGET_PPC 1" >> $config_h
1870 echo "#define TARGET_PPC64 1" >> $config_h
1871 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1874 echo "TARGET_ARCH=ppc64" >> $config_mak
1875 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1876 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1877 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1878 echo "#define TARGET_PPC 1" >> $config_h
1879 echo "#define TARGET_PPC64 1" >> $config_h
1880 echo "#define TARGET_ABI32 1" >> $config_h
1881 gdb_xml_files
="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1884 echo "TARGET_ARCH=sh4" >> $config_mak
1885 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1886 echo "#define TARGET_SH4 1" >> $config_h
1891 echo "TARGET_ARCH=sparc" >> $config_mak
1892 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1893 echo "#define TARGET_SPARC 1" >> $config_h
1896 echo "TARGET_ARCH=sparc64" >> $config_mak
1897 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1898 echo "#define TARGET_SPARC 1" >> $config_h
1899 echo "#define TARGET_SPARC64 1" >> $config_h
1903 echo "TARGET_ARCH=sparc64" >> $config_mak
1904 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1905 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1906 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1907 echo "#define TARGET_SPARC 1" >> $config_h
1908 echo "#define TARGET_SPARC64 1" >> $config_h
1909 echo "#define TARGET_ABI32 1" >> $config_h
1912 echo "Unsupported target CPU"
1916 if test "$target_bigendian" = "yes" ; then
1917 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1918 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1920 if test "$target_softmmu" = "yes" ; then
1921 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1922 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1924 if test "$target_user_only" = "yes" ; then
1925 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1926 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1928 if test "$target_linux_user" = "yes" ; then
1929 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1930 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1932 if test "$target_darwin_user" = "yes" ; then
1933 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1934 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1937 if test ! -z "$gdb_xml_files" ; then
1938 for x
in $gdb_xml_files; do
1939 list
="$list $source_path/gdb-xml/$x"
1942 echo "TARGET_XML_FILES=$list" >> $config_mak
1944 if test "$target_cpu" = "arm" \
1945 -o "$target_cpu" = "armeb" \
1946 -o "$target_cpu" = "m68k" \
1947 -o "$target_cpu" = "mips" \
1948 -o "$target_cpu" = "mipsel" \
1949 -o "$target_cpu" = "mipsn32" \
1950 -o "$target_cpu" = "mipsn32el" \
1951 -o "$target_cpu" = "mips64" \
1952 -o "$target_cpu" = "mips64el" \
1953 -o "$target_cpu" = "ppc" \
1954 -o "$target_cpu" = "ppc64" \
1955 -o "$target_cpu" = "ppc64abi32" \
1956 -o "$target_cpu" = "ppcemb" \
1957 -o "$target_cpu" = "sparc" \
1958 -o "$target_cpu" = "sparc64" \
1959 -o "$target_cpu" = "sparc32plus"; then
1960 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1961 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1963 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1964 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1965 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1967 if test "$target_user_only" = "yes" \
1968 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1969 echo "#define USE_NPTL 1" >> $config_h
1971 # 32 bit ELF loader in addition to native 64 bit loader?
1972 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1973 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1974 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1976 if test "$target_bsd_user" = "yes" ; then
1977 echo "CONFIG_BSD_USER=yes" >> $config_mak
1978 echo "#define CONFIG_BSD_USER 1" >> $config_h
1981 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1983 done # for target in $targets
1985 # build tree in object directory if source path is different from current one
1986 if test "$source_path_used" = "yes" ; then
1987 DIRS
="tests tests/cris slirp audio kvm/libkvm"
1988 FILES
="Makefile tests/Makefile"
1989 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1990 FILES
="$FILES tests/test-mmap.c"
1991 FILES
="$FILES kvm/libkvm/Makefile"
1992 for dir
in $DIRS ; do
1995 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1996 for f
in $FILES ; do
1998 ln -s $source_path/$f $f