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"
22 interp_prefix
="/usr/gnemul/qemu-%M"
27 gcc3_list
="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
38 i386|i486|i586|i686|i86pc|BePC
)
71 "Power Macintosh"|ppc|ppc64
)
120 kvm_cap_device_assignment
="no"
125 device_tree_support
=""
132 OS_CFLAGS
="-mno-cygwin"
133 if [ "$cpu" = "i386" ] ; then
136 audio_possible_drivers
="sdl"
140 if [ "$cpu" = "i386" ] ; then
143 audio_possible_drivers
="dsound sdl fmod"
147 audio_possible_drivers
="oss sdl esd pa"
148 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
155 audio_possible_drivers
="oss sdl esd pa"
156 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
164 audio_possible_drivers
="oss sdl esd"
170 audio_possible_drivers
="oss sdl esd"
178 audio_drv_list
="coreaudio"
179 audio_possible_drivers
="coreaudio sdl fmod"
180 OS_CFLAGS
="-mdynamic-no-pic"
181 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
187 needs_libsunmath
="no"
188 solarisrev
=`uname -r | cut -f2 -d.`
189 # have to select again, because `uname -m` returns i86pc
190 # even on an x86_64 box.
191 solariscpu
=`isainfo -k`
192 if test "${solariscpu}" = "amd64" ; then
195 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
196 if test "$solarisrev" -le 9 ; then
197 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
198 needs_libsunmath
="yes"
200 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
201 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
202 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
203 echo "Studio 11 can be downloaded from www.sun.com."
207 if test "$solarisrev" -ge 9 ; then
211 if test -f /usr
/include
/sys
/soundcard.h
; then
214 audio_possible_drivers
="oss sdl"
218 audio_possible_drivers
="oss alsa sdl esd pa"
221 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
223 audio_possible_drivers
="$audio_possible_drivers fmod"
226 if [ "$cpu" = "ia64" ] ; then
232 if [ "$cpu" = "powerpc" ]; then
238 if [ "$bsd" = "yes" ] ; then
239 if [ "$darwin" != "yes" ] ; then
246 source_path
=`dirname "$0"`
247 source_path_used
="no"
249 if [ -z "$source_path" ]; then
252 source_path
=`cd "$source_path"; pwd`
254 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
257 # generate compile errors on warnings for development builds
258 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
263 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
265 --help|
-h) show_help
=yes
267 --prefix=*) prefix
="$optarg"
269 --interp-prefix=*) interp_prefix
="$optarg"
271 --source-path=*) source_path
="$optarg"
272 source_path_used
="yes"
274 --cross-prefix=*) cross_prefix
="$optarg"
279 --host-cc=*) host_cc
="$optarg"
281 --make=*) make="$optarg"
283 --install=*) install="$optarg"
285 --extra-cflags=*) CFLAGS
="$optarg"
287 --extra-ldflags=*) LDFLAGS
="$optarg"
289 --cpu=*) cpu
="$optarg"
291 --target-list=*) target_list
="$optarg"
293 --enable-gprof) gprof
="yes"
295 --static) static
="yes"
297 --disable-sdl) sdl
="no"
299 --fmod-lib=*) fmod_lib
="$optarg"
301 --fmod-inc=*) fmod_inc
="$optarg"
303 --oss-lib=*) oss_lib
="$optarg"
305 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
307 --audio-drv-list=*) audio_drv_list
="$optarg"
309 --enable-sparse) sparse
="yes"
311 --disable-sparse) sparse
="no"
313 --disable-vnc-tls) vnc_tls
="no"
315 --disable-slirp) slirp
="no"
317 --disable-vde) vde
="no"
319 --disable-kqemu) kqemu
="no"
321 --disable-brlapi) brlapi
="no"
323 --disable-bluez) bluez
="no"
325 --disable-kvm) kvm
="no"
327 --enable-profiler) profiler
="yes"
332 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
334 --disable-gfx-check) check_gfx
="no"
336 --disable-gcc-check) check_gcc
="no"
338 --disable-system) softmmu
="no"
340 --enable-system) softmmu
="yes"
342 --disable-linux-user) linux_user
="no"
344 --enable-linux-user) linux_user
="yes"
346 --disable-darwin-user) darwin_user
="no"
348 --enable-darwin-user) darwin_user
="yes"
350 --disable-bsd-user) bsd_user
="no"
352 --enable-bsd-user) bsd_user
="yes"
354 --enable-uname-release=*) uname_release
="$optarg"
359 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
360 target_cpu
="sparc"; cpu
="sparc" ;;
361 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
362 target_cpu
="sparc"; cpu
="sparc" ;;
363 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
364 target_cpu
="sparc64"; cpu
="sparc64" ;;
365 *) echo "undefined SPARC architecture. Exiting";exit 1;;
368 --enable-werror) werror
="yes"
370 --disable-werror) werror
="no"
372 --disable-curses) curses
="no"
374 --disable-nptl) nptl
="no"
376 --enable-mixemu) mixemu
="yes"
378 --disable-aio) aio
="no"
380 --kerneldir=*) kerneldir
="$optarg"
382 --disable-cpu-emulation) cpu_emulation
="no"
384 --disable-libfdt) device_tree_support
="no"
386 *) echo "ERROR: unknown option $opt"; exit 1
391 # default flags for all hosts
392 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
393 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
394 LDFLAGS
="$LDFLAGS -g"
395 if test "$werror" = "yes" ; then
396 CFLAGS
="$CFLAGS -Werror"
399 if test "$solaris" = "no" ; then
400 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
401 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
406 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
407 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
410 sparc
) if test -z "$sparc_cpu" ; then
411 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
414 ARCH_CFLAGS
="${SP_CFLAGS}"
415 ARCH_LDFLAGS
="${SP_LDFLAGS}"
418 sparc64
) if test -z "$sparc_cpu" ; then
419 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
422 ARCH_CFLAGS
="${SP_CFLAGS}"
423 ARCH_LDFLAGS
="${SP_LDFLAGS}"
427 ARCH_CFLAGS
="-march=z900"
439 if test x
"$show_help" = x
"yes" ; then
442 Usage: configure [options]
443 Options: [defaults in brackets after descriptions]
446 echo "Standard options:"
447 echo " --help print this message"
448 echo " --prefix=PREFIX install in PREFIX [$prefix]"
449 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
450 echo " use %M for cpu name [$interp_prefix]"
451 echo " --target-list=LIST set target list [$target_list]"
453 echo "kqemu kernel acceleration support:"
454 echo " --disable-kqemu disable kqemu support"
456 echo "Advanced options (experts only):"
457 echo " --source-path=PATH path of source code [$source_path]"
458 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
459 echo " --cc=CC use C compiler CC [$cc]"
460 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
461 echo " --make=MAKE use specified make [$make]"
462 echo " --install=INSTALL use specified install [$install]"
463 echo " --static enable static build [$static]"
464 echo " --enable-sparse enable sparse checker"
465 echo " --disable-sparse disable sparse checker (default)"
466 echo " --disable-werror disable compilation abort on warning"
467 echo " --disable-sdl disable SDL"
468 echo " --enable-cocoa enable COCOA (Mac OS X only)"
469 echo " --audio-drv-list=LIST set audio drivers list:"
470 echo " Available drivers: $audio_possible_drivers"
471 echo " --audio-card-list=LIST set list of additional emulated audio cards"
472 echo " Available cards: ac97 adlib cs4231a gus"
473 echo " --enable-mixemu enable mixer emulation"
474 echo " --disable-brlapi disable BrlAPI"
475 echo " --disable-vnc-tls disable TLS encryption for VNC server"
476 echo " --disable-curses disable curses output"
477 echo " --disable-bluez disable bluez stack connectivity"
478 echo " --disable-kvm disable KVM acceleration support"
479 echo " --disable-nptl disable usermode NPTL support"
480 echo " --enable-system enable all system emulation targets"
481 echo " --disable-system disable all system emulation targets"
482 echo " --enable-linux-user enable all linux usermode emulation targets"
483 echo " --disable-linux-user disable all linux usermode emulation targets"
484 echo " --enable-darwin-user enable all darwin usermode emulation targets"
485 echo " --disable-darwin-user disable all darwin usermode emulation targets"
486 echo " --enable-bsd-user enable all BSD usermode emulation targets"
487 echo " --disable-bsd-user disable all BSD usermode emulation targets"
488 echo " --fmod-lib path to FMOD library"
489 echo " --fmod-inc path to FMOD includes"
490 echo " --oss-lib path to OSS library"
491 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
492 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
493 echo " --disable-vde disable support for vde network"
494 echo " --disable-aio disable AIO support"
495 echo " --kerneldir=PATH look for kernel includes in PATH"
496 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
497 echo " --disable-libfdt disables use of libfdt support for device tree"
499 echo "NOTE: The object files are built at the place where configure is launched"
503 cc
="${cross_prefix}${cc}"
504 ar="${cross_prefix}${ar}"
505 strip
="${cross_prefix}${strip}"
507 # check that the C compiler works.
512 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
513 : C compiler works ok
515 echo "ERROR: \"$cc\" either does not exist or does not work"
519 # check compiler to see if we're on mingw32
528 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
532 if test "$mingw32" = "yes" ; then
540 if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
542 elif [ "$bsd" = "yes" ]; then
545 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
546 AIOLIBS
="-lrt -lpthread"
549 # Check for gcc4, error if pre-gcc4
550 if test "$check_gcc" = "yes" ; then
555 int main(){return 0;}
557 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
558 echo "WARNING: \"$cc\" looks like gcc 4.x"
560 if test "$gcc3_search" = "yes" ; then
561 echo "Looking for gcc 3.x"
562 for compat_cc
in $gcc3_list ; do
563 if "$cross_prefix$compat_cc" --version 2> /dev
/null | fgrep
'(GCC) 3.' > /dev
/null
2>&1 ; then
564 echo "Found \"$compat_cc\""
565 cc
="$cross_prefix$compat_cc"
566 found_compat_cc
="yes"
570 if test "$found_compat_cc" = "no" ; then
571 echo "gcc 3.x not found!"
574 if test "$found_compat_cc" = "no" ; then
575 echo "QEMU is known to have problems when compiled with gcc 4.x"
576 echo "It is recommended that you use gcc 3.x to build QEMU"
577 echo "To use this compiler anyway, configure with --disable-gcc-check"
583 if test ! -x "$(which cgcc 2>/dev/null)"; then
588 # Solaris specific configure tool chain decisions
590 if test "$solaris" = "yes" ; then
592 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
593 # override the check with --disable-gcc-check
595 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
597 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
598 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
599 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
600 echo "or get the latest patch from SunSolve for gcc"
604 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
605 if test -z "$solinst" ; then
606 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
607 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
608 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
611 if test "$solinst" = "/usr/sbin/install" ; then
612 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
613 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
614 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
617 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
618 if test -z "$sol_ar" ; then
619 echo "Error: No path includes ar"
620 if test -f /usr
/ccs
/bin
/ar ; then
621 echo "Add /usr/ccs/bin to your path and rerun configure"
628 if test -z "$target_list" ; then
629 # these targets are portable
630 if [ "$softmmu" = "yes" ] ; then
649 # the following are Linux specific
650 if [ "$linux_user" = "yes" ] ; then
651 target_list
="${target_list}\
663 ppc64abi32-linux-user \
668 sparc32plus-linux-user \
671 # the following are Darwin specific
672 if [ "$darwin_user" = "yes" ] ; then
673 target_list
="$target_list i386-darwin-user ppc-darwin-user"
675 # the following are BSD specific
676 if [ "$bsd_user" = "yes" ] ; then
677 target_list
="${target_list}\
682 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
684 if test -z "$target_list" ; then
685 echo "No targets enabled"
689 if test -z "$cross_prefix" ; then
692 # big/little endian test
694 #include <inttypes.h>
695 int main(int argc, char ** argv){
696 volatile uint32_t i=0x01234567;
697 return (*((uint8_t*)(&i))) == 0x67;
701 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
702 $TMPE && bigendian
="yes"
704 echo big
/little
test failed
709 # if cross compiling, cannot launch a program, so make a static guess
710 if test "$cpu" = "armv4b" \
714 -o "$cpu" = "mips64" \
715 -o "$cpu" = "powerpc" \
717 -o "$cpu" = "sparc" \
718 -o "$cpu" = "sparc64"; then
724 # host long bits test
726 if test "$cpu" = "x86_64" \
727 -o "$cpu" = "alpha" \
729 -o "$cpu" = "sparc64"; then
733 # ppc specific hostlongbits selection
734 if test "$cpu" = "powerpc" ; then
735 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
736 grep -q __powerpc64__
$TMPI && hostlongbits
=64
738 echo hostlongbits
test failed
743 # check gcc options support
749 # Check host NPTL support
752 #include <linux/futex.h>
755 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
761 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
767 ##########################################
770 if test "$kvm" = "yes" ; then
772 # test for KVM_CAP_PIT
777 #error "kvm no pit capability"
779 int main(void) { return 0; }
781 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
785 # test for KVM_CAP_DEVICE_ASSIGNMENT
789 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
790 #error "kvm no device assignment capability"
792 int main(void) { return 0; }
794 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
795 kvm_cap_device_assignment
="yes"
799 ##########################################
804 int main(void) { zlibVersion(); return 0; }
806 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev
/null
; then
810 echo "Error: zlib check failed"
811 echo "Make sure to have the zlib libs and headers installed."
816 ##########################################
821 if test -z "$sdl" ; then
822 sdl_config
="sdl-config"
828 #undef main /* We don't want SDL to override our main() */
829 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
831 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp
/qemu-$$
-sdl-config.log
; then
832 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
833 if test "$_sdlversion" -lt 121 ; then
836 if test "$cocoa" = "no" ; then
841 # static link with sdl ?
842 if test "$sdl" = "yes" ; then
844 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
845 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
846 if [ "$aa" = "yes" ] ; then
847 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
850 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
854 fi # sdl compile test
856 # Make sure to disable cocoa if sdl was set
857 if test "$sdl" = "yes" ; then
859 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
863 ##########################################
865 if test "$vnc_tls" = "yes" ; then
867 #include <gnutls/gnutls.h>
868 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
870 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
871 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
872 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
873 $vnc_tls_libs 2> /dev
/null
; then
880 ##########################################
881 # vde libraries probe
882 if test "$vde" = "yes" ; then
884 #include <libvdeplug.h>
887 struct vde_open_args a = {0, 0, 0};
888 vde_open("", "", &a);
892 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev
/null
; then
899 ##########################################
900 # Sound support libraries probe
911 int main(void) { $exp }
913 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev
/null
; then
917 echo "Error: $drv check failed"
918 echo "Make sure to have the $drv libs and headers installed."
924 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
925 for drv
in $audio_drv_list; do
928 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
929 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
933 if test -z $fmod_lib ||
test -z $fmod_inc; then
935 echo "Error: You must specify path to FMOD library and headers"
936 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
940 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
944 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
948 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
949 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
952 oss|sdl|core|wav|dsound
)
953 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
957 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
959 echo "Error: Unknown driver '$drv' selected"
960 echo "Possible drivers are: $audio_possible_drivers"
968 ##########################################
971 if test -z "$brlapi" ; then
975 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
977 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev
/null
; then
979 fi # brlapi compile test
982 ##########################################
985 if test "$curses" = "yes" ; then
989 int main(void) { return curses_version(); }
991 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev
/null
; then
996 ##########################################
997 # bluez support probe
998 if test "$bluez" = "yes" ; then
999 `pkg-config bluez` || bluez
="no"
1001 if test "$bluez" = "yes" ; then
1003 #include <bluetooth/bluetooth.h>
1004 int main(void) { return bt_error(0); }
1006 bluez_cflags
=`pkg-config --cflags bluez`
1007 bluez_libs
=`pkg-config --libs bluez`
1008 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1009 $bluez_libs 2> /dev
/null
; then
1016 ##########################################
1018 if test "$kvm" = "yes" ; then
1020 #include <linux/kvm.h>
1021 #if !defined(KVM_API_VERSION) || \
1022 KVM_API_VERSION < 12 || \
1023 KVM_API_VERSION > 12 || \
1024 !defined(KVM_CAP_USER_MEMORY) || \
1025 !defined(KVM_CAP_SET_TSS_ADDR)
1026 #error Invalid KVM version
1028 int main(void) { return 0; }
1030 if test "$kerneldir" != "" ; then
1031 kvm_cflags
=-I"$kerneldir"/include
1035 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1043 ##########################################
1045 if test "$aio" = "yes" ; then
1049 int main(void) { return aio_write(NULL); }
1051 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1056 ##########################################
1061 #include <sys/syscall.h>
1063 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1066 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1070 ##########################################
1075 #include <sys/syscall.h>
1076 int main(void) { return syscall(SYS_eventfd, 0); }
1079 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1083 # Check if tools are available to build documentation.
1084 if [ -x "`which texi2html 2>/dev/null`" ] && \
1085 [ -x "`which pod2man 2>/dev/null`" ]; then
1089 if test "$mingw32" = "yes" ; then
1090 if test -z "$prefix" ; then
1091 prefix
="c:\\\\Program Files\\\\Qemu"
1098 if test -z "$prefix" ; then
1101 mansuffix
="/share/man"
1102 datasuffix
="/share/qemu"
1103 docsuffix
="/share/doc/qemu"
1107 ######################################
1110 if test -z "$device_tree_support" -a \
1111 "$cpu" = "powerpc"; then
1112 device_tree_support
="no"
1115 /* XXX uncomment later when libfdt is built before this test */
1116 //int main(void) { void *fdt; return fdt_create(fdt, 1024); }
1117 int main (void) {return 0;}
1119 # XXX for now do not try to link to libfdt and just check for header */
1120 # if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC -lfdt 2> /dev/null ; then
1121 if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1122 device_tree_support
="yes"
1125 echo "Error: Could not find libfdt"
1126 echo "Make sure to have the libfdt libs and headers installed."
1132 echo "Install prefix $prefix"
1133 echo "BIOS directory $prefix$datasuffix"
1134 echo "binary directory $prefix$binsuffix"
1135 if test "$mingw32" = "no" ; then
1136 echo "Manual directory $prefix$mansuffix"
1137 echo "ELF interp prefix $interp_prefix"
1139 echo "Source path $source_path"
1140 echo "C compiler $cc"
1141 echo "Host C compiler $host_cc"
1142 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1144 echo "install $install"
1145 echo "host CPU $cpu"
1146 echo "host big endian $bigendian"
1147 echo "target list $target_list"
1148 echo "gprof enabled $gprof"
1149 echo "sparse enabled $sparse"
1150 echo "profiler $profiler"
1151 echo "static build $static"
1152 echo "-Werror enabled $werror"
1153 if test "$darwin" = "yes" ; then
1154 echo "Cocoa support $cocoa"
1156 echo "SDL support $sdl"
1157 if test "$sdl" != "no" ; then
1158 echo "SDL static link $sdl_static"
1160 echo "curses support $curses"
1161 echo "mingw32 support $mingw32"
1162 echo "Audio drivers $audio_drv_list"
1163 echo "Extra audio cards $audio_card_list"
1164 echo "Mixer emulation $mixemu"
1165 echo "VNC TLS support $vnc_tls"
1166 if test "$vnc_tls" = "yes" ; then
1167 echo " TLS CFLAGS $vnc_tls_cflags"
1168 echo " TLS LIBS $vnc_tls_libs"
1170 if test -n "$sparc_cpu"; then
1171 echo "Target Sparc Arch $sparc_cpu"
1173 echo "kqemu support $kqemu"
1174 echo "kvm support $kvm"
1175 echo "CPU emulation $cpu_emulation"
1176 if test $cpu = "powerpc"; then
1177 echo "libfdt support $device_tree_support"
1179 echo "brlapi support $brlapi"
1180 echo "Documentation $build_docs"
1181 [ ! -z "$uname_release" ] && \
1182 echo "uname -r $uname_release"
1183 echo "NPTL support $nptl"
1184 echo "vde support $vde"
1185 echo "AIO support $aio"
1186 echo "KVM support $kvm"
1188 if test $sdl_too_old = "yes"; then
1189 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1191 if [ -s /tmp
/qemu-$$
-sdl-config.log
]; then
1192 echo "The error log from compiling the libSDL test is: "
1193 cat /tmp
/qemu-$$
-sdl-config.log
1195 rm -f /tmp
/qemu-$$
-sdl-config.log
1196 #if test "$sdl_static" = "no"; then
1197 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1199 config_mak
="config-host.mak"
1200 config_h
="config-host.h"
1202 #echo "Creating $config_mak and $config_h"
1204 test -f $config_h && mv $config_h ${config_h}~
1206 echo "# Automatically generated by configure - do not modify" > $config_mak
1207 echo "# Configured with: $0 $@" >> $config_mak
1208 echo "/* Automatically generated by configure - do not modify */" > $config_h
1210 echo "prefix=$prefix" >> $config_mak
1211 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1212 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1213 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1214 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1215 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1216 echo "MAKE=$make" >> $config_mak
1217 echo "INSTALL=$install" >> $config_mak
1218 echo "CC=$cc" >> $config_mak
1219 echo "HOST_CC=$host_cc" >> $config_mak
1220 echo "AR=$ar" >> $config_mak
1221 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1222 # XXX: only use CFLAGS and LDFLAGS ?
1223 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1224 # compilation of dyngen tool (useful for win32 build on Linux host)
1225 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1226 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1227 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1228 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1229 echo "CFLAGS=$CFLAGS" >> $config_mak
1230 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1231 echo "EXESUF=$EXESUF" >> $config_mak
1232 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1235 echo "ARCH=i386" >> $config_mak
1236 echo "#define HOST_I386 1" >> $config_h
1239 echo "ARCH=x86_64" >> $config_mak
1240 echo "#define HOST_X86_64 1" >> $config_h
1243 echo "ARCH=alpha" >> $config_mak
1244 echo "#define HOST_ALPHA 1" >> $config_h
1247 echo "ARCH=arm" >> $config_mak
1248 echo "#define HOST_ARM 1" >> $config_h
1251 echo "ARCH=arm" >> $config_mak
1252 echo "#define HOST_ARM 1" >> $config_h
1255 echo "ARCH=cris" >> $config_mak
1256 echo "#define HOST_CRIS 1" >> $config_h
1259 echo "ARCH=hppa" >> $config_mak
1260 echo "#define HOST_HPPA 1" >> $config_h
1263 echo "ARCH=ia64" >> $config_mak
1264 echo "#define HOST_IA64 1" >> $config_h
1267 echo "ARCH=m68k" >> $config_mak
1268 echo "#define HOST_M68K 1" >> $config_h
1271 echo "ARCH=mips" >> $config_mak
1272 echo "#define HOST_MIPS 1" >> $config_h
1275 echo "ARCH=mips64" >> $config_mak
1276 echo "#define HOST_MIPS64 1" >> $config_h
1279 if test "$hostlongbits" = "32"; then
1280 echo "ARCH=ppc" >> $config_mak
1281 echo "#define HOST_PPC 1" >> $config_h
1283 echo "ARCH=ppc64" >> $config_mak
1284 echo "#define HOST_PPC64 1" >> $config_h
1288 echo "ARCH=s390" >> $config_mak
1289 echo "#define HOST_S390 1" >> $config_h
1292 echo "ARCH=sparc" >> $config_mak
1293 echo "#define HOST_SPARC 1" >> $config_h
1296 echo "ARCH=sparc64" >> $config_mak
1297 echo "#define HOST_SPARC64 1" >> $config_h
1300 echo "Unsupported CPU = $cpu"
1304 if test "$sparse" = "yes" ; then
1305 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1306 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1307 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1309 if test "$bigendian" = "yes" ; then
1310 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1311 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1313 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1314 if test "$mingw32" = "yes" ; then
1315 echo "CONFIG_WIN32=yes" >> $config_mak
1316 echo "#define CONFIG_WIN32 1" >> $config_h
1319 #include <byteswap.h>
1320 int main(void) { return bswap_32(0); }
1322 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1323 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1327 if [ "$openbsd" = "yes" ] ; then
1328 echo "#define ENOTSUP 4096" >> $config_h
1331 if test "$darwin" = "yes" ; then
1332 echo "CONFIG_DARWIN=yes" >> $config_mak
1333 echo "#define CONFIG_DARWIN 1" >> $config_h
1335 if test "$solaris" = "yes" ; then
1336 echo "CONFIG_SOLARIS=yes" >> $config_mak
1337 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1338 if test "$needs_libsunmath" = "yes" ; then
1339 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1340 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1343 if test -n "$sparc_cpu"; then
1344 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1345 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1347 if test "$gdbstub" = "yes" ; then
1348 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1349 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1351 if test "$gprof" = "yes" ; then
1352 echo "TARGET_GPROF=yes" >> $config_mak
1353 echo "#define HAVE_GPROF 1" >> $config_h
1355 if test "$static" = "yes" ; then
1356 echo "CONFIG_STATIC=yes" >> $config_mak
1357 echo "#define CONFIG_STATIC 1" >> $config_h
1359 if test $profiler = "yes" ; then
1360 echo "#define CONFIG_PROFILER 1" >> $config_h
1362 if test "$slirp" = "yes" ; then
1363 echo "CONFIG_SLIRP=yes" >> $config_mak
1364 echo "#define CONFIG_SLIRP 1" >> $config_h
1366 if test "$vde" = "yes" ; then
1367 echo "CONFIG_VDE=yes" >> $config_mak
1368 echo "#define CONFIG_VDE 1" >> $config_h
1369 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1371 for card
in $audio_card_list; do
1372 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1373 echo "$def=yes" >> $config_mak
1374 echo "#define $def 1" >> $config_h
1376 echo "#define AUDIO_DRIVERS \\" >> $config_h
1377 for drv
in $audio_drv_list; do
1378 echo " &${drv}_audio_driver, \\" >>$config_h
1379 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1380 echo "$def=yes" >> $config_mak
1381 if test "$drv" = "fmod"; then
1382 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1383 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1384 elif test "$drv" = "oss"; then
1385 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1389 if test "$mixemu" = "yes" ; then
1390 echo "CONFIG_MIXEMU=yes" >> $config_mak
1391 echo "#define CONFIG_MIXEMU 1" >> $config_h
1393 if test "$vnc_tls" = "yes" ; then
1394 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1395 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1396 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1397 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1399 qemu_version
=`head $source_path/VERSION`
1400 echo "VERSION=$qemu_version" >>$config_mak
1401 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1402 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1404 echo "SRC_PATH=$source_path" >> $config_mak
1405 if [ "$source_path_used" = "yes" ]; then
1406 echo "VPATH=$source_path" >> $config_mak
1408 echo "TARGET_DIRS=$target_list" >> $config_mak
1409 if [ "$build_docs" = "yes" ] ; then
1410 echo "BUILD_DOCS=yes" >> $config_mak
1412 if test "$static" = "yes"; then
1417 if test "$sdl1" = "yes" ; then
1418 echo "#define CONFIG_SDL 1" >> $config_h
1419 echo "CONFIG_SDL=yes" >> $config_mak
1420 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1421 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1423 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1425 if [ "${aa}" = "yes" ] ; then
1426 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1428 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1431 if test "$cocoa" = "yes" ; then
1432 echo "#define CONFIG_COCOA 1" >> $config_h
1433 echo "CONFIG_COCOA=yes" >> $config_mak
1435 if test "$curses" = "yes" ; then
1436 echo "#define CONFIG_CURSES 1" >> $config_h
1437 echo "CONFIG_CURSES=yes" >> $config_mak
1438 echo "CURSES_LIBS=-lcurses" >> $config_mak
1440 if test "$brlapi" = "yes" ; then
1441 echo "CONFIG_BRLAPI=yes" >> $config_mak
1442 echo "#define CONFIG_BRLAPI 1" >> $config_h
1443 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1445 if test "$bluez" = "yes" ; then
1446 echo "CONFIG_BLUEZ=yes" >> $config_mak
1447 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1448 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1449 echo "#define CONFIG_BLUEZ 1" >> $config_h
1451 if test "$aio" = "yes" ; then
1452 echo "#define CONFIG_AIO 1" >> $config_h
1453 echo "CONFIG_AIO=yes" >> $config_mak
1455 if test "$signalfd" = "yes" ; then
1456 echo "#define CONFIG_signalfd 1" >> $config_h
1458 if test "$eventfd" = "yes" ; then
1459 echo "#define CONFIG_eventfd 1" >> $config_h
1462 # XXX: suppress that
1463 if [ "$bsd" = "yes" ] ; then
1464 echo "#define O_LARGEFILE 0" >> $config_h
1465 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1466 echo "#define _BSD 1" >> $config_h
1469 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1472 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1473 tools
="qemu-img\$(EXESUF) $tools"
1474 if [ "$linux" = "yes" ] ; then
1475 tools
="qemu-nbd\$(EXESUF) $tools"
1478 echo "TOOLS=$tools" >> $config_mak
1480 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1482 for target
in $target_list; do
1483 target_dir
="$target"
1484 config_mak
=$target_dir/config.mak
1485 config_h
=$target_dir/config.h
1486 target_cpu
=`echo $target | cut -d '-' -f 1`
1487 target_bigendian
="no"
1488 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1489 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1490 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1491 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1492 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1493 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1494 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1495 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1496 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1497 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1498 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1499 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1500 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1502 target_user_only
="no"
1503 target_linux_user
="no"
1504 target_darwin_user
="no"
1505 target_bsd_user
="no"
1507 ${target_cpu}-softmmu)
1508 target_softmmu
="yes"
1510 ${target_cpu}-linux-user)
1511 target_user_only
="yes"
1512 target_linux_user
="yes"
1514 ${target_cpu}-darwin-user)
1515 target_user_only
="yes"
1516 target_darwin_user
="yes"
1518 ${target_cpu}-bsd-user)
1519 target_user_only
="yes"
1520 target_bsd_user
="yes"
1523 echo "ERROR: Target '$target' not recognised"
1528 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1529 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1530 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1531 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1532 echo "Note that this will disable all output from the virtual graphics card"
1533 echo "except through VNC or curses."
1537 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1539 test -f $config_h && mv $config_h ${config_h}~
1541 mkdir
-p $target_dir
1542 mkdir
-p $target_dir/fpu
1543 mkdir
-p $target_dir/tcg
1544 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1545 mkdir
-p $target_dir/nwfpe
1549 # don't use ln -sf as not all "ln -sf" over write the file/link
1551 rm -f $target_dir/Makefile
1552 ln -s $source_path/Makefile.target
$target_dir/Makefile
1555 echo "# Automatically generated by configure - do not modify" > $config_mak
1556 echo "/* Automatically generated by configure - do not modify */" > $config_h
1559 echo "include ../config-host.mak" >> $config_mak
1560 echo "#include \"../config-host.h\"" >> $config_h
1565 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1566 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1569 disable_cpu_emulation
() {
1570 if test $cpu_emulation = "no"; then
1571 echo "#define NO_CPU_EMULATION 1" >> $config_h
1572 echo "NO_CPU_EMULATION=1" >> $config_mak
1577 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1578 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1579 echo "#define USE_KVM 1" >> $config_h
1580 echo "USE_KVM=1" >> $config_mak
1581 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1582 if test $kvm_cap_pit = "yes" ; then
1583 echo "USE_KVM_PIT=1" >> $config_mak
1584 echo "#define USE_KVM_PIT 1" >> $config_h
1586 if test $kvm_cap_device_assignment = "yes" ; then
1587 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1588 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1590 disable_cpu_emulation
1594 if [ use_upstream_kvm
= yes ]; then
1596 # Make sure the target and host cpus are compatible
1597 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1598 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1599 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1602 # Disable KVM for linux-user
1603 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1609 case "$target_cpu" in
1611 echo "TARGET_ARCH=i386" >> $config_mak
1612 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1613 echo "#define TARGET_I386 1" >> $config_h
1614 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1616 echo "#define USE_KQEMU 1" >> $config_h
1618 if test "$kvm" = "yes" ; then
1619 echo "CONFIG_KVM=yes" >> $config_mak
1620 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1621 echo "#define CONFIG_KVM 1" >> $config_h
1623 gcc3minver
=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1624 if test -n "$gcc3minver" && test $gcc3minver -gt 3
1626 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1628 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1633 echo "TARGET_ARCH=x86_64" >> $config_mak
1634 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1635 echo "#define TARGET_I386 1" >> $config_h
1636 echo "#define TARGET_X86_64 1" >> $config_h
1637 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1639 echo "#define USE_KQEMU 1" >> $config_h
1644 echo "TARGET_ARCH=ia64" >> $config_mak
1645 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1646 echo "#define TARGET_IA64 1" >> $config_h
1648 if [ use_upstream_kvm
= yes ]; then
1649 if test "$kvm" = "yes" ; then
1650 echo "CONFIG_KVM=yes" >> $config_mak
1651 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1652 echo "#define CONFIG_KVM 1" >> $config_h
1657 echo "TARGET_ARCH=alpha" >> $config_mak
1658 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1659 echo "#define TARGET_ALPHA 1" >> $config_h
1662 echo "TARGET_ARCH=arm" >> $config_mak
1663 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1664 echo "#define TARGET_ARM 1" >> $config_h
1667 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1670 echo "TARGET_ARCH=cris" >> $config_mak
1671 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1672 echo "#define TARGET_CRIS 1" >> $config_h
1675 echo "TARGET_ARCH=m68k" >> $config_mak
1676 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1677 echo "#define TARGET_M68K 1" >> $config_h
1679 gdb_xml_files
="cf-core.xml cf-fp.xml"
1682 echo "TARGET_ARCH=mips" >> $config_mak
1683 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1684 echo "#define TARGET_MIPS 1" >> $config_h
1685 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1688 echo "TARGET_ARCH=mipsn32" >> $config_mak
1689 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1690 echo "#define TARGET_MIPS 1" >> $config_h
1691 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1694 echo "TARGET_ARCH=mips64" >> $config_mak
1695 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1696 echo "#define TARGET_MIPS 1" >> $config_h
1697 echo "#define TARGET_MIPS64 1" >> $config_h
1698 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1701 echo "TARGET_ARCH=ppc" >> $config_mak
1702 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1703 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1704 echo "#define TARGET_PPC 1" >> $config_h
1705 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1708 echo "TARGET_ARCH=ppcemb" >> $config_mak
1709 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1710 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1711 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1712 echo "#define TARGET_PPC 1" >> $config_h
1713 echo "#define TARGET_PPCEMB 1" >> $config_h
1714 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1715 if test "$device_tree_support" = "yes" ; then
1716 echo "#define CONFIG_LIBFDT 1" >> $config_h
1717 echo "CONFIG_LIBFDT=1" >> $config_mak
1722 echo "TARGET_ARCH=ppc64" >> $config_mak
1723 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1724 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1725 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1726 echo "#define TARGET_PPC 1" >> $config_h
1727 echo "#define TARGET_PPC64 1" >> $config_h
1728 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1731 echo "TARGET_ARCH=ppc64" >> $config_mak
1732 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1733 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1734 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1735 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1736 echo "#define TARGET_PPC 1" >> $config_h
1737 echo "#define TARGET_PPC64 1" >> $config_h
1738 echo "#define TARGET_ABI32 1" >> $config_h
1739 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1742 echo "TARGET_ARCH=sh4" >> $config_mak
1743 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1744 echo "#define TARGET_SH4 1" >> $config_h
1749 echo "TARGET_ARCH=sparc" >> $config_mak
1750 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1751 echo "#define TARGET_SPARC 1" >> $config_h
1754 echo "TARGET_ARCH=sparc64" >> $config_mak
1755 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1756 echo "#define TARGET_SPARC 1" >> $config_h
1757 echo "#define TARGET_SPARC64 1" >> $config_h
1761 echo "TARGET_ARCH=sparc64" >> $config_mak
1762 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1763 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1764 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1765 echo "#define TARGET_SPARC 1" >> $config_h
1766 echo "#define TARGET_SPARC64 1" >> $config_h
1767 echo "#define TARGET_ABI32 1" >> $config_h
1770 echo "Unsupported target CPU"
1774 if test "$target_bigendian" = "yes" ; then
1775 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1776 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1778 if test "$target_softmmu" = "yes" ; then
1779 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1780 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1782 if test "$target_user_only" = "yes" ; then
1783 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1784 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1786 if test "$target_linux_user" = "yes" ; then
1787 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1788 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1790 if test "$target_darwin_user" = "yes" ; then
1791 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1792 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1795 if test ! -z "$gdb_xml_files" ; then
1796 for x
in $gdb_xml_files; do
1797 list
="$list $source_path/gdb-xml/$x"
1800 echo "TARGET_XML_FILES=$list" >> $config_mak
1802 if test "$target_cpu" = "arm" \
1803 -o "$target_cpu" = "armeb" \
1804 -o "$target_cpu" = "m68k" \
1805 -o "$target_cpu" = "mips" \
1806 -o "$target_cpu" = "mipsel" \
1807 -o "$target_cpu" = "mipsn32" \
1808 -o "$target_cpu" = "mipsn32el" \
1809 -o "$target_cpu" = "mips64" \
1810 -o "$target_cpu" = "mips64el" \
1811 -o "$target_cpu" = "sparc" \
1812 -o "$target_cpu" = "sparc64" \
1813 -o "$target_cpu" = "sparc32plus"; then
1814 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1815 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1817 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1818 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1819 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1821 if test "$target_user_only" = "yes" \
1822 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1823 echo "#define USE_NPTL 1" >> $config_h
1825 # 32 bit ELF loader in addition to native 64 bit loader?
1826 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1827 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1828 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1830 if test "$target_bsd_user" = "yes" ; then
1831 echo "CONFIG_BSD_USER=yes" >> $config_mak
1832 echo "#define CONFIG_BSD_USER 1" >> $config_h
1835 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1837 done # for target in $targets
1839 # build tree in object directory if source path is different from current one
1840 if test "$source_path_used" = "yes" ; then
1841 DIRS
="tests tests/cris slirp audio"
1842 FILES
="Makefile tests/Makefile"
1843 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1844 FILES
="$FILES tests/test-mmap.c"
1845 for dir
in $DIRS ; do
1848 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1849 for f
in $FILES ; do
1851 ln -s $source_path/$f $f
1855 rm -f $TMPO $TMPC $TMPE $TMPS $TMPI