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"
37 # parse CC options first
39 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
41 --cross-prefix=*) cross_prefix
="$optarg"
49 # Using uname is really, really broken. Once we have the right set of checks
50 # we can eliminate it's usage altogether
52 cc
="${cross_prefix}${cc}"
53 ar="${cross_prefix}${ar}"
54 strip
="${cross_prefix}${strip}"
56 # check that the C compiler works.
61 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
64 echo "ERROR: \"$cc\" either does not exist or does not work"
73 int main(void) { return 0; }
75 $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
78 if check_define __i386__
; then
80 elif check_define __x86_64__
; then
82 elif check_define __sparc__
; then
83 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
84 # They must be specified using --sparc_cpu
85 if check_define __arch64__
; then
91 cpu
=`test $(uname -s) = AIX && uname -p || uname -m`
96 i386|i486|i586|i686|i86pc|BePC
)
129 "Power Macintosh"|ppc|ppc64|powerpc
)
177 kvm_cap_device_assignment
="no"
187 if check_define __linux__
; then
189 elif check_define _WIN32
; then
197 OS_CFLAGS
="-mno-cygwin"
198 if [ "$cpu" = "i386" ] ; then
201 audio_possible_drivers
="sdl"
205 if [ "$cpu" = "i386" ] ; then
208 audio_possible_drivers
="dsound sdl fmod"
212 audio_possible_drivers
="oss sdl esd pa"
213 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
220 audio_possible_drivers
="oss sdl esd pa"
221 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
229 audio_possible_drivers
="oss sdl esd"
236 audio_possible_drivers
="oss sdl esd"
244 audio_drv_list
="coreaudio"
245 audio_possible_drivers
="coreaudio sdl fmod"
246 OS_CFLAGS
="-mdynamic-no-pic"
247 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
253 needs_libsunmath
="no"
254 solarisrev
=`uname -r | cut -f2 -d.`
255 # have to select again, because `uname -m` returns i86pc
256 # even on an x86_64 box.
257 solariscpu
=`isainfo -k`
258 if test "${solariscpu}" = "amd64" ; then
261 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
262 if test "$solarisrev" -le 9 ; then
263 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
264 needs_libsunmath
="yes"
266 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
267 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
268 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
269 echo "Studio 11 can be downloaded from www.sun.com."
273 if test "$solarisrev" -ge 9 ; then
277 if test -f /usr
/include
/sys
/soundcard.h
; then
280 audio_possible_drivers
="oss sdl"
288 audio_possible_drivers
="oss alsa sdl esd pa"
292 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
294 audio_possible_drivers
="$audio_possible_drivers fmod"
297 if [ "$cpu" = "ia64" ] ; then
303 if [ "$cpu" = "powerpc" ]; then
309 if [ "$bsd" = "yes" ] ; then
310 if [ "$darwin" != "yes" ] ; then
318 source_path
=`dirname "$0"`
319 source_path_used
="no"
321 if [ -z "$source_path" ]; then
324 source_path
=`cd "$source_path"; pwd`
326 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
329 # generate compile errors on warnings for development builds
330 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
335 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
337 --help|
-h) show_help
=yes
339 --prefix=*) prefix
="$optarg"
341 --interp-prefix=*) interp_prefix
="$optarg"
343 --source-path=*) source_path
="$optarg"
344 source_path_used
="yes"
350 --host-cc=*) host_cc
="$optarg"
352 --make=*) make="$optarg"
354 --install=*) install="$optarg"
356 --extra-cflags=*) CFLAGS
="$optarg"
358 --extra-ldflags=*) LDFLAGS
="$optarg"
360 --cpu=*) cpu
="$optarg"
362 --target-list=*) target_list
="$optarg"
364 --enable-gprof) gprof
="yes"
366 --static) static
="yes"
368 --disable-sdl) sdl
="no"
370 --fmod-lib=*) fmod_lib
="$optarg"
372 --fmod-inc=*) fmod_inc
="$optarg"
374 --oss-lib=*) oss_lib
="$optarg"
376 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
378 --audio-drv-list=*) audio_drv_list
="$optarg"
380 --enable-sparse) sparse
="yes"
382 --disable-sparse) sparse
="no"
384 --disable-vnc-tls) vnc_tls
="no"
386 --disable-slirp) slirp
="no"
388 --disable-vde) vde
="no"
390 --disable-kqemu) kqemu
="no"
392 --disable-brlapi) brlapi
="no"
394 --disable-bluez) bluez
="no"
396 --disable-kvm) kvm
="no"
398 --enable-profiler) profiler
="yes"
403 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
405 --disable-gfx-check) check_gfx
="no"
407 --disable-system) softmmu
="no"
409 --enable-system) softmmu
="yes"
411 --disable-linux-user) linux_user
="no"
413 --enable-linux-user) linux_user
="yes"
415 --disable-darwin-user) darwin_user
="no"
417 --enable-darwin-user) darwin_user
="yes"
419 --disable-bsd-user) bsd_user
="no"
421 --enable-bsd-user) bsd_user
="yes"
423 --enable-uname-release=*) uname_release
="$optarg"
428 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
429 target_cpu
="sparc"; cpu
="sparc" ;;
430 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
431 target_cpu
="sparc"; cpu
="sparc" ;;
432 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
433 target_cpu
="sparc64"; cpu
="sparc64" ;;
434 *) echo "undefined SPARC architecture. Exiting";exit 1;;
437 --enable-werror) werror
="yes"
439 --disable-werror) werror
="no"
441 --disable-curses) curses
="no"
443 --disable-nptl) nptl
="no"
445 --enable-mixemu) mixemu
="yes"
447 --disable-aio) aio
="no"
449 --disable-blobs) blobs
="no"
451 --kerneldir=*) kerneldir
="$optarg"
453 --disable-cpu-emulation) cpu_emulation
="no"
455 *) echo "ERROR: unknown option $opt"; exit 1
460 # default flags for all hosts
461 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
462 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
463 LDFLAGS
="$LDFLAGS -g"
464 if test "$werror" = "yes" ; then
465 CFLAGS
="$CFLAGS -Werror"
468 if test "$solaris" = "no" ; then
469 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
470 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
475 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
476 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
479 sparc
) if test -z "$sparc_cpu" ; then
480 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
483 ARCH_CFLAGS
="${SP_CFLAGS}"
484 ARCH_LDFLAGS
="${SP_LDFLAGS}"
487 sparc64
) if test -z "$sparc_cpu" ; then
488 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
491 ARCH_CFLAGS
="${SP_CFLAGS}"
492 ARCH_LDFLAGS
="${SP_LDFLAGS}"
496 ARCH_CFLAGS
="-march=z900"
508 if test x
"$show_help" = x
"yes" ; then
511 Usage: configure [options]
512 Options: [defaults in brackets after descriptions]
515 echo "Standard options:"
516 echo " --help print this message"
517 echo " --prefix=PREFIX install in PREFIX [$prefix]"
518 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
519 echo " use %M for cpu name [$interp_prefix]"
520 echo " --target-list=LIST set target list [$target_list]"
522 echo "kqemu kernel acceleration support:"
523 echo " --disable-kqemu disable kqemu support"
525 echo "Advanced options (experts only):"
526 echo " --source-path=PATH path of source code [$source_path]"
527 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
528 echo " --cc=CC use C compiler CC [$cc]"
529 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
530 echo " --make=MAKE use specified make [$make]"
531 echo " --install=INSTALL use specified install [$install]"
532 echo " --static enable static build [$static]"
533 echo " --enable-sparse enable sparse checker"
534 echo " --disable-sparse disable sparse checker (default)"
535 echo " --disable-werror disable compilation abort on warning"
536 echo " --disable-sdl disable SDL"
537 echo " --enable-cocoa enable COCOA (Mac OS X only)"
538 echo " --audio-drv-list=LIST set audio drivers list:"
539 echo " Available drivers: $audio_possible_drivers"
540 echo " --audio-card-list=LIST set list of additional emulated audio cards"
541 echo " Available cards: ac97 adlib cs4231a gus"
542 echo " --enable-mixemu enable mixer emulation"
543 echo " --disable-brlapi disable BrlAPI"
544 echo " --disable-vnc-tls disable TLS encryption for VNC server"
545 echo " --disable-curses disable curses output"
546 echo " --disable-bluez disable bluez stack connectivity"
547 echo " --disable-kvm disable KVM acceleration support"
548 echo " --disable-nptl disable usermode NPTL support"
549 echo " --enable-system enable all system emulation targets"
550 echo " --disable-system disable all system emulation targets"
551 echo " --enable-linux-user enable all linux usermode emulation targets"
552 echo " --disable-linux-user disable all linux usermode emulation targets"
553 echo " --enable-darwin-user enable all darwin usermode emulation targets"
554 echo " --disable-darwin-user disable all darwin usermode emulation targets"
555 echo " --enable-bsd-user enable all BSD usermode emulation targets"
556 echo " --disable-bsd-user disable all BSD usermode emulation targets"
557 echo " --fmod-lib path to FMOD library"
558 echo " --fmod-inc path to FMOD includes"
559 echo " --oss-lib path to OSS library"
560 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
561 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
562 echo " --disable-vde disable support for vde network"
563 echo " --disable-aio disable AIO support"
564 echo " --disable-blobs disable installing provided firmware blobs"
565 echo " --kerneldir=PATH look for kernel includes in PATH"
566 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
568 echo "NOTE: The object files are built at the place where configure is launched"
572 if test "$mingw32" = "yes" ; then
580 if test ! -x "$(which cgcc 2>/dev/null)"; then
585 # Solaris specific configure tool chain decisions
587 if test "$solaris" = "yes" ; then
588 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
589 if test -z "$solinst" ; then
590 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
591 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
592 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
595 if test "$solinst" = "/usr/sbin/install" ; then
596 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
597 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
598 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
601 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
602 if test -z "$sol_ar" ; then
603 echo "Error: No path includes ar"
604 if test -f /usr
/ccs
/bin
/ar ; then
605 echo "Add /usr/ccs/bin to your path and rerun configure"
612 if test -z "$target_list" ; then
613 # these targets are portable
614 if [ "$softmmu" = "yes" ] ; then
633 # the following are Linux specific
634 if [ "$linux_user" = "yes" ] ; then
635 target_list
="${target_list}\
647 ppc64abi32-linux-user \
652 sparc32plus-linux-user \
655 # the following are Darwin specific
656 if [ "$darwin_user" = "yes" ] ; then
657 target_list
="$target_list i386-darwin-user ppc-darwin-user "
659 # the following are BSD specific
660 if [ "$bsd_user" = "yes" ] ; then
661 target_list
="${target_list}\
666 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
668 if test -z "$target_list" ; then
669 echo "No targets enabled"
673 if test -z "$cross_prefix" ; then
676 # big/little endian test
678 #include <inttypes.h>
679 int main(int argc, char ** argv){
680 volatile uint32_t i=0x01234567;
681 return (*((uint8_t*)(&i))) == 0x67;
685 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
686 $TMPE && bigendian
="yes"
688 echo big
/little
test failed
693 # if cross compiling, cannot launch a program, so make a static guess
694 if test "$cpu" = "armv4b" \
698 -o "$cpu" = "mips64" \
699 -o "$cpu" = "powerpc" \
701 -o "$cpu" = "sparc" \
702 -o "$cpu" = "sparc64"; then
708 # host long bits test
710 if test "$cpu" = "x86_64" \
711 -o "$cpu" = "alpha" \
713 -o "$cpu" = "sparc64"; then
717 # ppc specific hostlongbits selection
718 if test "$cpu" = "powerpc" ; then
719 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
720 grep -q __powerpc64__
$TMPI && hostlongbits
=64
722 echo hostlongbits
test failed
727 # check gcc options support
733 # Check host NPTL support
736 #include <linux/futex.h>
739 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
745 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
751 ##########################################
754 if test "$kvm" = "yes" ; then
756 # test for KVM_CAP_PIT
761 #error "kvm no pit capability"
763 int main(void) { return 0; }
765 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
769 # test for KVM_CAP_DEVICE_ASSIGNMENT
773 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
774 #error "kvm no device assignment capability"
776 int main(void) { return 0; }
778 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
779 kvm_cap_device_assignment
="yes"
783 ##########################################
788 int main(void) { zlibVersion(); return 0; }
790 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
794 echo "Error: zlib check failed"
795 echo "Make sure to have the zlib libs and headers installed."
800 ##########################################
805 if test -z "$sdl" ; then
806 sdl_config
="sdl-config"
812 #undef main /* We don't want SDL to override our main() */
813 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
815 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
816 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
817 if test "$_sdlversion" -lt 121 ; then
820 if test "$cocoa" = "no" ; then
825 # static link with sdl ?
826 if test "$sdl" = "yes" ; then
828 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
829 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
830 if [ "$aa" = "yes" ] ; then
831 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
834 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
838 fi # sdl compile test
840 # Make sure to disable cocoa if sdl was set
841 if test "$sdl" = "yes" ; then
843 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
847 ##########################################
849 if test "$vnc_tls" = "yes" ; then
851 #include <gnutls/gnutls.h>
852 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
854 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
855 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
856 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
857 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
864 ##########################################
865 # vde libraries probe
866 if test "$vde" = "yes" ; then
868 #include <libvdeplug.h>
871 struct vde_open_args a = {0, 0, 0};
872 vde_open("", "", &a);
876 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
883 ##########################################
884 # Sound support libraries probe
895 int main(void) { $exp }
897 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
901 echo "Error: $drv check failed"
902 echo "Make sure to have the $drv libs and headers installed."
908 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
909 for drv
in $audio_drv_list; do
912 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
913 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
917 if test -z $fmod_lib ||
test -z $fmod_inc; then
919 echo "Error: You must specify path to FMOD library and headers"
920 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
924 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
928 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
932 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
933 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
936 oss|sdl|core|wav|dsound
)
937 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
941 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
943 echo "Error: Unknown driver '$drv' selected"
944 echo "Possible drivers are: $audio_possible_drivers"
952 ##########################################
955 if test -z "$brlapi" ; then
959 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
961 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
963 fi # brlapi compile test
966 ##########################################
969 if test "$curses" = "yes" ; then
973 int main(void) { return curses_version(); }
975 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
980 ##########################################
981 # bluez support probe
982 if test "$bluez" = "yes" ; then
983 `pkg-config bluez` || bluez
="no"
985 if test "$bluez" = "yes" ; then
987 #include <bluetooth/bluetooth.h>
988 int main(void) { return bt_error(0); }
990 bluez_cflags
=`pkg-config --cflags bluez`
991 bluez_libs
=`pkg-config --libs bluez`
992 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
993 $bluez_libs > /dev
/null
2> /dev
/null
; then
1000 ##########################################
1002 if test "$kvm" = "yes" ; then
1004 #include <linux/kvm.h>
1005 #if !defined(KVM_API_VERSION) || \
1006 KVM_API_VERSION < 12 || \
1007 KVM_API_VERSION > 12 || \
1008 !defined(KVM_CAP_USER_MEMORY) || \
1009 !defined(KVM_CAP_SET_TSS_ADDR) || \
1010 !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1011 #error Invalid KVM version
1013 int main(void) { return 0; }
1015 if test "$kerneldir" != "" ; then
1016 kvm_cflags
=-I"$kerneldir"/include
1020 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1021 > /dev
/null
2>/dev
/null
; then
1028 ##########################################
1032 if test "$aio" = "yes" ; then
1035 #include <pthread.h>
1036 int main(void) { pthread_mutex_t lock; return 0; }
1038 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1044 ##########################################
1047 #include <sys/uio.h>
1048 int main(void) { struct iovec iov; return 0; }
1051 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1055 ##########################################
1057 if test "$fdt" = "yes" ; then
1060 int main(void) { return 0; }
1062 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1067 ##########################################
1072 #include <sys/syscall.h>
1074 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1077 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1081 ##########################################
1086 #include <sys/syscall.h>
1087 int main(void) { return syscall(SYS_eventfd, 0); }
1090 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1094 # Check if tools are available to build documentation.
1095 if [ -x "`which texi2html 2>/dev/null`" ] && \
1096 [ -x "`which pod2man 2>/dev/null`" ]; then
1100 ##########################################
1105 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1109 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1111 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1115 if test "$rt" = "yes" ; then
1116 # Hack, we should have a general purpose LIBS for this sort of thing
1117 AIOLIBS
="$AIOLIBS -lrt"
1120 if test "$mingw32" = "yes" ; then
1121 if test -z "$prefix" ; then
1122 prefix
="c:\\\\Program Files\\\\Qemu"
1129 if test -z "$prefix" ; then
1132 mansuffix
="/share/man"
1133 datasuffix
="/share/qemu"
1134 docsuffix
="/share/doc/qemu"
1138 echo "Install prefix $prefix"
1139 echo "BIOS directory $prefix$datasuffix"
1140 echo "binary directory $prefix$binsuffix"
1141 if test "$mingw32" = "no" ; then
1142 echo "Manual directory $prefix$mansuffix"
1143 echo "ELF interp prefix $interp_prefix"
1145 echo "Source path $source_path"
1146 echo "C compiler $cc"
1147 echo "Host C compiler $host_cc"
1148 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1150 echo "install $install"
1151 echo "host CPU $cpu"
1152 echo "host big endian $bigendian"
1153 echo "target list $target_list"
1154 echo "gprof enabled $gprof"
1155 echo "sparse enabled $sparse"
1156 echo "profiler $profiler"
1157 echo "static build $static"
1158 echo "-Werror enabled $werror"
1159 if test "$darwin" = "yes" ; then
1160 echo "Cocoa support $cocoa"
1162 echo "SDL support $sdl"
1163 if test "$sdl" != "no" ; then
1164 echo "SDL static link $sdl_static"
1166 echo "curses support $curses"
1167 echo "mingw32 support $mingw32"
1168 echo "Audio drivers $audio_drv_list"
1169 echo "Extra audio cards $audio_card_list"
1170 echo "Mixer emulation $mixemu"
1171 echo "VNC TLS support $vnc_tls"
1172 if test "$vnc_tls" = "yes" ; then
1173 echo " TLS CFLAGS $vnc_tls_cflags"
1174 echo " TLS LIBS $vnc_tls_libs"
1176 if test -n "$sparc_cpu"; then
1177 echo "Target Sparc Arch $sparc_cpu"
1179 echo "kqemu support $kqemu"
1180 echo "kvm support $kvm"
1181 echo "CPU emulation $cpu_emulation"
1182 echo "brlapi support $brlapi"
1183 echo "Documentation $build_docs"
1184 [ ! -z "$uname_release" ] && \
1185 echo "uname -r $uname_release"
1186 echo "NPTL support $nptl"
1187 echo "vde support $vde"
1188 echo "AIO support $aio"
1189 echo "Install blobs $blobs"
1190 echo "KVM support $kvm"
1191 echo "fdt support $fdt"
1193 if test $sdl_too_old = "yes"; then
1194 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1196 if [ -s $TMPSDLLOG ]; then
1197 echo "The error log from compiling the libSDL test is: "
1200 #if test "$sdl_static" = "no"; then
1201 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1203 config_mak
="config-host.mak"
1204 config_h
="config-host.h"
1206 #echo "Creating $config_mak and $config_h"
1208 test -f $config_h && mv $config_h ${config_h}~
1210 echo "# Automatically generated by configure - do not modify" > $config_mak
1211 printf "# Configured with:" >> $config_mak
1212 printf " '%s'" "$0" "$@" >> $config_mak
1214 echo "/* Automatically generated by configure - do not modify */" > $config_h
1216 echo "prefix=$prefix" >> $config_mak
1217 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1218 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1219 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1220 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1221 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1222 echo "MAKE=$make" >> $config_mak
1223 echo "INSTALL=$install" >> $config_mak
1224 echo "CC=$cc" >> $config_mak
1225 echo "HOST_CC=$host_cc" >> $config_mak
1226 echo "AR=$ar" >> $config_mak
1227 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1228 # XXX: only use CFLAGS and LDFLAGS ?
1229 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1230 # compilation of dyngen tool (useful for win32 build on Linux host)
1231 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1232 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1233 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1234 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1235 echo "CFLAGS=$CFLAGS" >> $config_mak
1236 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1237 echo "EXESUF=$EXESUF" >> $config_mak
1238 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1241 echo "ARCH=i386" >> $config_mak
1242 echo "#define HOST_I386 1" >> $config_h
1245 echo "ARCH=x86_64" >> $config_mak
1246 echo "#define HOST_X86_64 1" >> $config_h
1249 echo "ARCH=alpha" >> $config_mak
1250 echo "#define HOST_ALPHA 1" >> $config_h
1253 echo "ARCH=arm" >> $config_mak
1254 echo "#define HOST_ARM 1" >> $config_h
1257 echo "ARCH=arm" >> $config_mak
1258 echo "#define HOST_ARM 1" >> $config_h
1261 echo "ARCH=cris" >> $config_mak
1262 echo "#define HOST_CRIS 1" >> $config_h
1265 echo "ARCH=hppa" >> $config_mak
1266 echo "#define HOST_HPPA 1" >> $config_h
1269 echo "ARCH=ia64" >> $config_mak
1270 echo "#define HOST_IA64 1" >> $config_h
1273 echo "ARCH=m68k" >> $config_mak
1274 echo "#define HOST_M68K 1" >> $config_h
1277 echo "ARCH=mips" >> $config_mak
1278 echo "#define HOST_MIPS 1" >> $config_h
1281 echo "ARCH=mips64" >> $config_mak
1282 echo "#define HOST_MIPS64 1" >> $config_h
1285 if test "$hostlongbits" = "32"; then
1286 echo "ARCH=ppc" >> $config_mak
1287 echo "#define HOST_PPC 1" >> $config_h
1289 echo "ARCH=ppc64" >> $config_mak
1290 echo "#define HOST_PPC64 1" >> $config_h
1294 echo "ARCH=s390" >> $config_mak
1295 echo "#define HOST_S390 1" >> $config_h
1298 echo "ARCH=sparc" >> $config_mak
1299 echo "#define HOST_SPARC 1" >> $config_h
1302 echo "ARCH=sparc64" >> $config_mak
1303 echo "#define HOST_SPARC64 1" >> $config_h
1306 echo "Unsupported CPU = $cpu"
1310 if test "$sparse" = "yes" ; then
1311 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1312 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1313 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1315 if test "$bigendian" = "yes" ; then
1316 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1317 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1319 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1320 if test "$mingw32" = "yes" ; then
1321 echo "CONFIG_WIN32=yes" >> $config_mak
1322 echo "#define CONFIG_WIN32 1" >> $config_h
1325 #include <byteswap.h>
1326 int main(void) { return bswap_32(0); }
1328 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1329 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1332 #include <sys/endian.h>
1333 #include <sys/types.h>
1334 #include <machine/bswap.h>
1335 int main(void) { return bswap32(0); }
1337 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1338 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1342 if [ "$openbsd" = "yes" ] ; then
1343 echo "#define ENOTSUP 4096" >> $config_h
1346 if test "$darwin" = "yes" ; then
1347 echo "CONFIG_DARWIN=yes" >> $config_mak
1348 echo "#define CONFIG_DARWIN 1" >> $config_h
1351 if test "$aix" = "yes" ; then
1352 echo "CONFIG_AIX=yes" >> $config_mak
1353 echo "#define CONFIG_AIX 1" >> $config_h
1356 if test "$solaris" = "yes" ; then
1357 echo "CONFIG_SOLARIS=yes" >> $config_mak
1358 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1359 if test "$needs_libsunmath" = "yes" ; then
1360 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1361 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1364 if test -n "$sparc_cpu"; then
1365 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1366 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1368 if test "$gdbstub" = "yes" ; then
1369 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1370 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1372 if test "$gprof" = "yes" ; then
1373 echo "TARGET_GPROF=yes" >> $config_mak
1374 echo "#define HAVE_GPROF 1" >> $config_h
1376 if test "$static" = "yes" ; then
1377 echo "CONFIG_STATIC=yes" >> $config_mak
1378 echo "#define CONFIG_STATIC 1" >> $config_h
1380 if test $profiler = "yes" ; then
1381 echo "#define CONFIG_PROFILER 1" >> $config_h
1383 if test "$slirp" = "yes" ; then
1384 echo "CONFIG_SLIRP=yes" >> $config_mak
1385 echo "#define CONFIG_SLIRP 1" >> $config_h
1387 if test "$vde" = "yes" ; then
1388 echo "CONFIG_VDE=yes" >> $config_mak
1389 echo "#define CONFIG_VDE 1" >> $config_h
1390 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1392 for card
in $audio_card_list; do
1393 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1394 echo "$def=yes" >> $config_mak
1395 echo "#define $def 1" >> $config_h
1397 echo "#define AUDIO_DRIVERS \\" >> $config_h
1398 for drv
in $audio_drv_list; do
1399 echo " &${drv}_audio_driver, \\" >>$config_h
1400 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1401 echo "$def=yes" >> $config_mak
1402 if test "$drv" = "fmod"; then
1403 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1404 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1405 elif test "$drv" = "oss"; then
1406 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1410 if test "$mixemu" = "yes" ; then
1411 echo "CONFIG_MIXEMU=yes" >> $config_mak
1412 echo "#define CONFIG_MIXEMU 1" >> $config_h
1414 if test "$vnc_tls" = "yes" ; then
1415 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1416 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1417 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1418 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1420 qemu_version
=`head $source_path/VERSION`
1421 echo "VERSION=$qemu_version" >>$config_mak
1422 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1423 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1425 echo "SRC_PATH=$source_path" >> $config_mak
1426 if [ "$source_path_used" = "yes" ]; then
1427 echo "VPATH=$source_path" >> $config_mak
1429 echo "TARGET_DIRS=$target_list" >> $config_mak
1430 if [ "$build_docs" = "yes" ] ; then
1431 echo "BUILD_DOCS=yes" >> $config_mak
1433 if test "$static" = "yes"; then
1438 if test "$sdl1" = "yes" ; then
1439 echo "#define CONFIG_SDL 1" >> $config_h
1440 echo "CONFIG_SDL=yes" >> $config_mak
1441 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1442 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1444 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1446 if [ "${aa}" = "yes" ] ; then
1447 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1449 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1452 if test "$cocoa" = "yes" ; then
1453 echo "#define CONFIG_COCOA 1" >> $config_h
1454 echo "CONFIG_COCOA=yes" >> $config_mak
1456 if test "$curses" = "yes" ; then
1457 echo "#define CONFIG_CURSES 1" >> $config_h
1458 echo "CONFIG_CURSES=yes" >> $config_mak
1459 echo "CURSES_LIBS=-lcurses" >> $config_mak
1461 if test "$brlapi" = "yes" ; then
1462 echo "CONFIG_BRLAPI=yes" >> $config_mak
1463 echo "#define CONFIG_BRLAPI 1" >> $config_h
1464 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1466 if test "$bluez" = "yes" ; then
1467 echo "CONFIG_BLUEZ=yes" >> $config_mak
1468 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1469 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1470 echo "#define CONFIG_BLUEZ 1" >> $config_h
1472 if test "$aio" = "yes" ; then
1473 echo "#define CONFIG_AIO 1" >> $config_h
1474 echo "CONFIG_AIO=yes" >> $config_mak
1476 if test "$blobs" = "yes" ; then
1477 echo "INSTALL_BLOBS=yes" >> $config_mak
1479 if test "$iovec" = "yes" ; then
1480 echo "#define HAVE_IOVEC 1" >> $config_h
1482 if test "$fdt" = "yes" ; then
1483 echo "#define HAVE_FDT 1" >> $config_h
1484 echo "FDT_LIBS=-lfdt" >> $config_mak
1486 if test "$signalfd" = "yes" ; then
1487 echo "#define CONFIG_signalfd 1" >> $config_h
1489 if test "$eventfd" = "yes" ; then
1490 echo "#define CONFIG_eventfd 1" >> $config_h
1493 # XXX: suppress that
1494 if [ "$bsd" = "yes" ] ; then
1495 echo "#define O_LARGEFILE 0" >> $config_h
1496 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1497 echo "#define _BSD 1" >> $config_h
1500 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1505 echo "HOST_USB=linux" >> $config_mak
1508 echo "HOST_USB=bsd" >> $config_mak
1511 echo "HOST_USB=stub" >> $config_mak
1516 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1517 tools
="qemu-img\$(EXESUF) $tools"
1518 if [ "$linux" = "yes" ] ; then
1519 tools
="qemu-nbd\$(EXESUF) $tools"
1522 echo "TOOLS=$tools" >> $config_mak
1524 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1526 for target
in $target_list; do
1527 target_dir
="$target"
1528 config_mak
=$target_dir/config.mak
1529 config_h
=$target_dir/config.h
1530 target_cpu
=`echo $target | cut -d '-' -f 1`
1531 target_bigendian
="no"
1532 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1533 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1534 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1535 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1536 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1537 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1538 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1539 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1540 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1541 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1542 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1543 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1544 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1546 target_user_only
="no"
1547 target_linux_user
="no"
1548 target_darwin_user
="no"
1549 target_bsd_user
="no"
1551 ${target_cpu}-softmmu)
1552 target_softmmu
="yes"
1554 ${target_cpu}-linux-user)
1555 target_user_only
="yes"
1556 target_linux_user
="yes"
1558 ${target_cpu}-darwin-user)
1559 target_user_only
="yes"
1560 target_darwin_user
="yes"
1562 ${target_cpu}-bsd-user)
1563 target_user_only
="yes"
1564 target_bsd_user
="yes"
1567 echo "ERROR: Target '$target' not recognised"
1572 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1573 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1574 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1575 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1576 echo "Note that this will disable all output from the virtual graphics card"
1577 echo "except through VNC or curses."
1581 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1583 test -f $config_h && mv $config_h ${config_h}~
1585 mkdir
-p $target_dir
1586 mkdir
-p $target_dir/fpu
1587 mkdir
-p $target_dir/tcg
1588 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1589 mkdir
-p $target_dir/nwfpe
1593 # don't use ln -sf as not all "ln -sf" over write the file/link
1595 rm -f $target_dir/Makefile
1596 ln -s $source_path/Makefile.target
$target_dir/Makefile
1599 echo "# Automatically generated by configure - do not modify" > $config_mak
1600 echo "/* Automatically generated by configure - do not modify */" > $config_h
1603 echo "include ../config-host.mak" >> $config_mak
1604 echo "#include \"../config-host.h\"" >> $config_h
1609 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1610 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1613 disable_cpu_emulation
() {
1614 if test $cpu_emulation = "no"; then
1615 echo "#define NO_CPU_EMULATION 1" >> $config_h
1616 echo "NO_CPU_EMULATION=1" >> $config_mak
1621 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1622 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1623 echo "#define USE_KVM 1" >> $config_h
1624 echo "USE_KVM=1" >> $config_mak
1625 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1626 if test $kvm_cap_pit = "yes" ; then
1627 echo "USE_KVM_PIT=1" >> $config_mak
1628 echo "#define USE_KVM_PIT 1" >> $config_h
1630 if test $kvm_cap_device_assignment = "yes" ; then
1631 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1632 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1634 disable_cpu_emulation
1638 if [ use_upstream_kvm
= yes ]; then
1640 # Make sure the target and host cpus are compatible
1641 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1642 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "powerpc" \
) -o \
1643 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1644 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1647 # Disable KVM for linux-user
1648 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1654 case "$target_cpu" in
1656 echo "TARGET_ARCH=i386" >> $config_mak
1657 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1658 echo "#define TARGET_I386 1" >> $config_h
1659 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1661 echo "#define USE_KQEMU 1" >> $config_h
1663 if test "$kvm" = "yes" ; then
1664 echo "CONFIG_KVM=yes" >> $config_mak
1665 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1666 echo "#define CONFIG_KVM 1" >> $config_h
1671 echo "TARGET_ARCH=x86_64" >> $config_mak
1672 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1673 echo "#define TARGET_I386 1" >> $config_h
1674 echo "#define TARGET_X86_64 1" >> $config_h
1675 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1677 echo "#define USE_KQEMU 1" >> $config_h
1682 echo "TARGET_ARCH=ia64" >> $config_mak
1683 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1684 echo "#define TARGET_IA64 1" >> $config_h
1686 if [ use_upstream_kvm
= yes ]; then
1687 if test "$kvm" = "yes" ; then
1688 echo "CONFIG_KVM=yes" >> $config_mak
1689 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1690 echo "#define CONFIG_KVM 1" >> $config_h
1695 echo "TARGET_ARCH=alpha" >> $config_mak
1696 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1697 echo "#define TARGET_ALPHA 1" >> $config_h
1700 echo "TARGET_ARCH=arm" >> $config_mak
1701 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1702 echo "#define TARGET_ARM 1" >> $config_h
1705 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1708 echo "TARGET_ARCH=cris" >> $config_mak
1709 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1710 echo "#define TARGET_CRIS 1" >> $config_h
1714 echo "TARGET_ARCH=m68k" >> $config_mak
1715 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1716 echo "#define TARGET_M68K 1" >> $config_h
1718 gdb_xml_files
="cf-core.xml cf-fp.xml"
1721 echo "TARGET_ARCH=mips" >> $config_mak
1722 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1723 echo "#define TARGET_MIPS 1" >> $config_h
1724 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1727 echo "TARGET_ARCH=mipsn32" >> $config_mak
1728 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1729 echo "#define TARGET_MIPS 1" >> $config_h
1730 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1733 echo "TARGET_ARCH=mips64" >> $config_mak
1734 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1735 echo "#define TARGET_MIPS 1" >> $config_h
1736 echo "#define TARGET_MIPS64 1" >> $config_h
1737 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1740 echo "TARGET_ARCH=ppc" >> $config_mak
1741 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1742 echo "#define TARGET_PPC 1" >> $config_h
1745 echo "TARGET_ARCH=ppcemb" >> $config_mak
1746 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1747 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1748 echo "#define TARGET_PPC 1" >> $config_h
1749 echo "#define TARGET_PPCEMB 1" >> $config_h
1750 if test "$kvm" = "yes" ; then
1751 echo "CONFIG_KVM=yes" >> $config_mak
1752 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1753 echo "#define CONFIG_KVM 1" >> $config_h
1757 echo "TARGET_ARCH=ppc64" >> $config_mak
1758 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1759 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1760 echo "#define TARGET_PPC 1" >> $config_h
1761 echo "#define TARGET_PPC64 1" >> $config_h
1764 echo "TARGET_ARCH=ppc64" >> $config_mak
1765 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1766 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1767 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1768 echo "#define TARGET_PPC 1" >> $config_h
1769 echo "#define TARGET_PPC64 1" >> $config_h
1770 echo "#define TARGET_ABI32 1" >> $config_h
1773 echo "TARGET_ARCH=sh4" >> $config_mak
1774 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1775 echo "#define TARGET_SH4 1" >> $config_h
1780 echo "TARGET_ARCH=sparc" >> $config_mak
1781 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1782 echo "#define TARGET_SPARC 1" >> $config_h
1785 echo "TARGET_ARCH=sparc64" >> $config_mak
1786 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1787 echo "#define TARGET_SPARC 1" >> $config_h
1788 echo "#define TARGET_SPARC64 1" >> $config_h
1792 echo "TARGET_ARCH=sparc64" >> $config_mak
1793 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1794 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1795 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1796 echo "#define TARGET_SPARC 1" >> $config_h
1797 echo "#define TARGET_SPARC64 1" >> $config_h
1798 echo "#define TARGET_ABI32 1" >> $config_h
1801 echo "Unsupported target CPU"
1805 if test "$target_bigendian" = "yes" ; then
1806 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1807 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1809 if test "$target_softmmu" = "yes" ; then
1810 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1811 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1813 if test "$target_user_only" = "yes" ; then
1814 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1815 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1817 if test "$target_linux_user" = "yes" ; then
1818 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1819 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1821 if test "$target_darwin_user" = "yes" ; then
1822 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1823 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1826 if test ! -z "$gdb_xml_files" ; then
1827 for x
in $gdb_xml_files; do
1828 list
="$list $source_path/gdb-xml/$x"
1831 echo "TARGET_XML_FILES=$list" >> $config_mak
1833 if test "$target_cpu" = "arm" \
1834 -o "$target_cpu" = "armeb" \
1835 -o "$target_cpu" = "m68k" \
1836 -o "$target_cpu" = "mips" \
1837 -o "$target_cpu" = "mipsel" \
1838 -o "$target_cpu" = "mipsn32" \
1839 -o "$target_cpu" = "mipsn32el" \
1840 -o "$target_cpu" = "mips64" \
1841 -o "$target_cpu" = "mips64el" \
1842 -o "$target_cpu" = "ppc" \
1843 -o "$target_cpu" = "ppc64" \
1844 -o "$target_cpu" = "ppc64abi32" \
1845 -o "$target_cpu" = "ppcemb" \
1846 -o "$target_cpu" = "sparc" \
1847 -o "$target_cpu" = "sparc64" \
1848 -o "$target_cpu" = "sparc32plus"; then
1849 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1850 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1852 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1853 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1854 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1856 if test "$target_user_only" = "yes" \
1857 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1858 echo "#define USE_NPTL 1" >> $config_h
1860 # 32 bit ELF loader in addition to native 64 bit loader?
1861 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1862 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1863 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1865 if test "$target_bsd_user" = "yes" ; then
1866 echo "CONFIG_BSD_USER=yes" >> $config_mak
1867 echo "#define CONFIG_BSD_USER 1" >> $config_h
1870 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1872 done # for target in $targets
1874 # build tree in object directory if source path is different from current one
1875 if test "$source_path_used" = "yes" ; then
1876 DIRS
="tests tests/cris slirp audio"
1877 FILES
="Makefile tests/Makefile"
1878 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1879 FILES
="$FILES tests/test-mmap.c"
1880 for dir
in $DIRS ; do
1883 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1884 for f
in $FILES ; do
1886 ln -s $source_path/$f $f