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
92 cpu
=`test $(uname -s) = AIX && uname -p || uname -m`
97 i386|i486|i586|i686|i86pc|BePC
)
130 "Power Macintosh"|ppc|ppc64|powerpc
)
178 kvm_cap_device_assignment
="no"
188 if check_define __linux__
; then
190 elif check_define _WIN32
; then
198 OS_CFLAGS
="-mno-cygwin"
199 if [ "$cpu" = "i386" ] ; then
202 audio_possible_drivers
="sdl"
206 if [ "$cpu" = "i386" ] ; then
209 audio_possible_drivers
="dsound sdl fmod"
213 audio_possible_drivers
="oss sdl esd pa"
214 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
221 audio_possible_drivers
="oss sdl esd pa"
222 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
230 audio_possible_drivers
="oss sdl esd"
237 audio_possible_drivers
="oss sdl esd"
245 audio_drv_list
="coreaudio"
246 audio_possible_drivers
="coreaudio sdl fmod"
247 OS_CFLAGS
="-mdynamic-no-pic"
248 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
254 needs_libsunmath
="no"
255 solarisrev
=`uname -r | cut -f2 -d.`
256 # have to select again, because `uname -m` returns i86pc
257 # even on an x86_64 box.
258 solariscpu
=`isainfo -k`
259 if test "${solariscpu}" = "amd64" ; then
262 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
263 if test "$solarisrev" -le 9 ; then
264 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
265 needs_libsunmath
="yes"
267 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
268 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
269 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
270 echo "Studio 11 can be downloaded from www.sun.com."
274 if test "$solarisrev" -ge 9 ; then
278 if test -f /usr
/include
/sys
/soundcard.h
; then
281 audio_possible_drivers
="oss sdl"
289 audio_possible_drivers
="oss alsa sdl esd pa"
293 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
295 audio_possible_drivers
="$audio_possible_drivers fmod"
298 if [ "$cpu" = "ia64" ] ; then
304 if [ "$cpu" = "powerpc" ]; then
310 if [ "$bsd" = "yes" ] ; then
311 if [ "$darwin" != "yes" ] ; then
319 source_path
=`dirname "$0"`
320 source_path_used
="no"
322 if [ -z "$source_path" ]; then
325 source_path
=`cd "$source_path"; pwd`
327 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
330 # generate compile errors on warnings for development builds
331 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
336 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
338 --help|
-h) show_help
=yes
340 --prefix=*) prefix
="$optarg"
342 --interp-prefix=*) interp_prefix
="$optarg"
344 --source-path=*) source_path
="$optarg"
345 source_path_used
="yes"
351 --host-cc=*) host_cc
="$optarg"
353 --make=*) make="$optarg"
355 --install=*) install="$optarg"
357 --extra-cflags=*) CFLAGS
="$optarg"
359 --extra-ldflags=*) LDFLAGS
="$optarg"
361 --cpu=*) cpu
="$optarg"
363 --target-list=*) target_list
="$optarg"
365 --enable-gprof) gprof
="yes"
367 --static) static
="yes"
369 --disable-sdl) sdl
="no"
371 --fmod-lib=*) fmod_lib
="$optarg"
373 --fmod-inc=*) fmod_inc
="$optarg"
375 --oss-lib=*) oss_lib
="$optarg"
377 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
379 --audio-drv-list=*) audio_drv_list
="$optarg"
381 --enable-sparse) sparse
="yes"
383 --disable-sparse) sparse
="no"
385 --disable-vnc-tls) vnc_tls
="no"
387 --disable-slirp) slirp
="no"
389 --disable-vde) vde
="no"
391 --disable-kqemu) kqemu
="no"
393 --disable-brlapi) brlapi
="no"
395 --disable-bluez) bluez
="no"
397 --disable-kvm) kvm
="no"
399 --enable-profiler) profiler
="yes"
404 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
406 --disable-gfx-check) check_gfx
="no"
408 --disable-system) softmmu
="no"
410 --enable-system) softmmu
="yes"
412 --disable-linux-user) linux_user
="no"
414 --enable-linux-user) linux_user
="yes"
416 --disable-darwin-user) darwin_user
="no"
418 --enable-darwin-user) darwin_user
="yes"
420 --disable-bsd-user) bsd_user
="no"
422 --enable-bsd-user) bsd_user
="yes"
424 --enable-uname-release=*) uname_release
="$optarg"
429 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
430 target_cpu
="sparc"; cpu
="sparc" ;;
431 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
432 target_cpu
="sparc"; cpu
="sparc" ;;
433 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
434 target_cpu
="sparc64"; cpu
="sparc64" ;;
435 *) echo "undefined SPARC architecture. Exiting";exit 1;;
438 --enable-werror) werror
="yes"
440 --disable-werror) werror
="no"
442 --disable-curses) curses
="no"
444 --disable-nptl) nptl
="no"
446 --enable-mixemu) mixemu
="yes"
448 --disable-aio) aio
="no"
450 --disable-blobs) blobs
="no"
452 --kerneldir=*) kerneldir
="$optarg"
454 --disable-cpu-emulation) cpu_emulation
="no"
456 *) echo "ERROR: unknown option $opt"; exit 1
461 # default flags for all hosts
462 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
463 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
464 LDFLAGS
="$LDFLAGS -g"
465 if test "$werror" = "yes" ; then
466 CFLAGS
="$CFLAGS -Werror"
469 if test "$solaris" = "no" ; then
470 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
471 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
476 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
477 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
480 sparc
) if test -z "$sparc_cpu" ; then
481 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
484 ARCH_CFLAGS
="${SP_CFLAGS}"
485 ARCH_LDFLAGS
="${SP_LDFLAGS}"
488 sparc64
) if test -z "$sparc_cpu" ; then
489 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
492 ARCH_CFLAGS
="${SP_CFLAGS}"
493 ARCH_LDFLAGS
="${SP_LDFLAGS}"
497 ARCH_CFLAGS
="-march=z900"
509 if test x
"$show_help" = x
"yes" ; then
512 Usage: configure [options]
513 Options: [defaults in brackets after descriptions]
516 echo "Standard options:"
517 echo " --help print this message"
518 echo " --prefix=PREFIX install in PREFIX [$prefix]"
519 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
520 echo " use %M for cpu name [$interp_prefix]"
521 echo " --target-list=LIST set target list [$target_list]"
523 echo "kqemu kernel acceleration support:"
524 echo " --disable-kqemu disable kqemu support"
526 echo "Advanced options (experts only):"
527 echo " --source-path=PATH path of source code [$source_path]"
528 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
529 echo " --cc=CC use C compiler CC [$cc]"
530 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
531 echo " --make=MAKE use specified make [$make]"
532 echo " --install=INSTALL use specified install [$install]"
533 echo " --static enable static build [$static]"
534 echo " --enable-sparse enable sparse checker"
535 echo " --disable-sparse disable sparse checker (default)"
536 echo " --disable-werror disable compilation abort on warning"
537 echo " --disable-sdl disable SDL"
538 echo " --enable-cocoa enable COCOA (Mac OS X only)"
539 echo " --audio-drv-list=LIST set audio drivers list:"
540 echo " Available drivers: $audio_possible_drivers"
541 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
542 echo " Available cards: $audio_possible_cards"
543 echo " --enable-mixemu enable mixer emulation"
544 echo " --disable-brlapi disable BrlAPI"
545 echo " --disable-vnc-tls disable TLS encryption for VNC server"
546 echo " --disable-curses disable curses output"
547 echo " --disable-bluez disable bluez stack connectivity"
548 echo " --disable-kvm disable KVM acceleration support"
549 echo " --disable-nptl disable usermode NPTL support"
550 echo " --enable-system enable all system emulation targets"
551 echo " --disable-system disable all system emulation targets"
552 echo " --enable-linux-user enable all linux usermode emulation targets"
553 echo " --disable-linux-user disable all linux usermode emulation targets"
554 echo " --enable-darwin-user enable all darwin usermode emulation targets"
555 echo " --disable-darwin-user disable all darwin usermode emulation targets"
556 echo " --enable-bsd-user enable all BSD usermode emulation targets"
557 echo " --disable-bsd-user disable all BSD usermode emulation targets"
558 echo " --fmod-lib path to FMOD library"
559 echo " --fmod-inc path to FMOD includes"
560 echo " --oss-lib path to OSS library"
561 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
562 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
563 echo " --disable-vde disable support for vde network"
564 echo " --disable-aio disable AIO support"
565 echo " --disable-blobs disable installing provided firmware blobs"
566 echo " --kerneldir=PATH look for kernel includes in PATH"
567 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
569 echo "NOTE: The object files are built at the place where configure is launched"
573 if test "$mingw32" = "yes" ; then
581 if test ! -x "$(which cgcc 2>/dev/null)"; then
586 # Solaris specific configure tool chain decisions
588 if test "$solaris" = "yes" ; then
589 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
590 if test -z "$solinst" ; then
591 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
592 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
593 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
596 if test "$solinst" = "/usr/sbin/install" ; then
597 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
598 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
599 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
602 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
603 if test -z "$sol_ar" ; then
604 echo "Error: No path includes ar"
605 if test -f /usr
/ccs
/bin
/ar ; then
606 echo "Add /usr/ccs/bin to your path and rerun configure"
613 if test -z "$target_list" ; then
614 # these targets are portable
615 if [ "$softmmu" = "yes" ] ; then
634 # the following are Linux specific
635 if [ "$linux_user" = "yes" ] ; then
636 target_list
="${target_list}\
648 ppc64abi32-linux-user \
653 sparc32plus-linux-user \
656 # the following are Darwin specific
657 if [ "$darwin_user" = "yes" ] ; then
658 target_list
="$target_list i386-darwin-user ppc-darwin-user "
660 # the following are BSD specific
661 if [ "$bsd_user" = "yes" ] ; then
662 target_list
="${target_list}\
667 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
669 if test -z "$target_list" ; then
670 echo "No targets enabled"
674 if test -z "$cross_prefix" ; then
677 # big/little endian test
679 #include <inttypes.h>
680 int main(int argc, char ** argv){
681 volatile uint32_t i=0x01234567;
682 return (*((uint8_t*)(&i))) == 0x67;
686 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
687 $TMPE && bigendian
="yes"
689 echo big
/little
test failed
694 # if cross compiling, cannot launch a program, so make a static guess
695 if test "$cpu" = "armv4b" \
699 -o "$cpu" = "mips64" \
700 -o "$cpu" = "powerpc" \
702 -o "$cpu" = "sparc" \
703 -o "$cpu" = "sparc64"; then
709 # host long bits test
711 if test "$cpu" = "x86_64" \
712 -o "$cpu" = "alpha" \
714 -o "$cpu" = "sparc64"; then
718 # ppc specific hostlongbits selection
719 if test "$cpu" = "powerpc" ; then
720 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
721 grep -q __powerpc64__
$TMPI && hostlongbits
=64
723 echo hostlongbits
test failed
728 # check gcc options support
734 # Check host NPTL support
737 #include <linux/futex.h>
740 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
746 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
752 ##########################################
755 if test "$kvm" = "yes" ; then
757 # test for KVM_CAP_PIT
762 #error "kvm no pit capability"
764 int main(void) { return 0; }
766 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
770 # test for KVM_CAP_DEVICE_ASSIGNMENT
774 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
775 #error "kvm no device assignment capability"
777 int main(void) { return 0; }
779 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
780 kvm_cap_device_assignment
="yes"
784 ##########################################
789 int main(void) { zlibVersion(); return 0; }
791 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
795 echo "Error: zlib check failed"
796 echo "Make sure to have the zlib libs and headers installed."
801 ##########################################
806 if test -z "$sdl" ; then
807 sdl_config
="sdl-config"
813 #undef main /* We don't want SDL to override our main() */
814 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
816 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
817 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
818 if test "$_sdlversion" -lt 121 ; then
821 if test "$cocoa" = "no" ; then
826 # static link with sdl ?
827 if test "$sdl" = "yes" ; then
829 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
830 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
831 if [ "$aa" = "yes" ] ; then
832 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
835 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
839 fi # sdl compile test
841 # Make sure to disable cocoa if sdl was set
842 if test "$sdl" = "yes" ; then
844 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
848 ##########################################
850 if test "$vnc_tls" = "yes" ; then
852 #include <gnutls/gnutls.h>
853 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
855 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
856 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
857 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
858 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
865 ##########################################
866 # vde libraries probe
867 if test "$vde" = "yes" ; then
869 #include <libvdeplug.h>
872 struct vde_open_args a = {0, 0, 0};
873 vde_open("", "", &a);
877 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
884 ##########################################
885 # Sound support libraries probe
896 int main(void) { $exp }
898 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
902 echo "Error: $drv check failed"
903 echo "Make sure to have the $drv libs and headers installed."
909 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
910 for drv
in $audio_drv_list; do
913 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
914 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
918 if test -z $fmod_lib ||
test -z $fmod_inc; then
920 echo "Error: You must specify path to FMOD library and headers"
921 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
925 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
929 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
933 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
934 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
937 oss|sdl|core|wav|dsound
)
938 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
942 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
944 echo "Error: Unknown driver '$drv' selected"
945 echo "Possible drivers are: $audio_possible_drivers"
953 ##########################################
956 if test -z "$brlapi" ; then
960 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
962 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
964 fi # brlapi compile test
967 ##########################################
970 if test "$curses" = "yes" ; then
974 int main(void) { return curses_version(); }
976 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
981 ##########################################
982 # bluez support probe
983 if test "$bluez" = "yes" ; then
984 `pkg-config bluez` || bluez
="no"
986 if test "$bluez" = "yes" ; then
988 #include <bluetooth/bluetooth.h>
989 int main(void) { return bt_error(0); }
991 bluez_cflags
=`pkg-config --cflags bluez`
992 bluez_libs
=`pkg-config --libs bluez`
993 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
994 $bluez_libs > /dev
/null
2> /dev
/null
; then
1001 ##########################################
1003 if test "$kvm" = "yes" ; then
1005 #include <linux/kvm.h>
1006 #if !defined(KVM_API_VERSION) || \
1007 KVM_API_VERSION < 12 || \
1008 KVM_API_VERSION > 12 || \
1009 !defined(KVM_CAP_USER_MEMORY) || \
1010 !defined(KVM_CAP_SET_TSS_ADDR) || \
1011 !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1012 #error Invalid KVM version
1014 int main(void) { return 0; }
1016 if test "$kerneldir" != "" ; then
1017 kvm_cflags
=-I"$kerneldir"/include
1018 if test \
( "$cpu" = "i386" -o "$cpu" = "x86_64" \
) \
1019 -a -d "$kerneldir/arch/x86/include" ; then
1020 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/x86/include"
1021 elif test -d "$kerneldir/arch/$cpu/include" ; then
1022 kvm_cflags
="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1027 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1028 > /dev
/null
2>/dev
/null
; then
1035 ##########################################
1039 if test "$aio" = "yes" ; then
1042 #include <pthread.h>
1043 int main(void) { pthread_mutex_t lock; return 0; }
1045 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1051 ##########################################
1054 #include <sys/uio.h>
1055 int main(void) { struct iovec iov; return 0; }
1058 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1062 ##########################################
1064 if test "$fdt" = "yes" ; then
1067 int main(void) { return 0; }
1069 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1074 ##########################################
1079 #include <sys/syscall.h>
1081 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1084 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1088 ##########################################
1093 #include <sys/syscall.h>
1094 int main(void) { return syscall(SYS_eventfd, 0); }
1097 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1101 # Check if tools are available to build documentation.
1102 if [ -x "`which texi2html 2>/dev/null`" ] && \
1103 [ -x "`which pod2man 2>/dev/null`" ]; then
1107 ##########################################
1112 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1116 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1118 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1122 if test "$rt" = "yes" ; then
1123 # Hack, we should have a general purpose LIBS for this sort of thing
1124 AIOLIBS
="$AIOLIBS -lrt"
1127 if test "$mingw32" = "yes" ; then
1128 if test -z "$prefix" ; then
1129 prefix
="c:\\\\Program Files\\\\Qemu"
1136 if test -z "$prefix" ; then
1139 mansuffix
="/share/man"
1140 datasuffix
="/share/qemu"
1141 docsuffix
="/share/doc/qemu"
1145 echo "Install prefix $prefix"
1146 echo "BIOS directory $prefix$datasuffix"
1147 echo "binary directory $prefix$binsuffix"
1148 if test "$mingw32" = "no" ; then
1149 echo "Manual directory $prefix$mansuffix"
1150 echo "ELF interp prefix $interp_prefix"
1152 echo "Source path $source_path"
1153 echo "C compiler $cc"
1154 echo "Host C compiler $host_cc"
1155 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1157 echo "install $install"
1158 echo "host CPU $cpu"
1159 echo "host big endian $bigendian"
1160 echo "target list $target_list"
1161 echo "gprof enabled $gprof"
1162 echo "sparse enabled $sparse"
1163 echo "profiler $profiler"
1164 echo "static build $static"
1165 echo "-Werror enabled $werror"
1166 if test "$darwin" = "yes" ; then
1167 echo "Cocoa support $cocoa"
1169 echo "SDL support $sdl"
1170 if test "$sdl" != "no" ; then
1171 echo "SDL static link $sdl_static"
1173 echo "curses support $curses"
1174 echo "mingw32 support $mingw32"
1175 echo "Audio drivers $audio_drv_list"
1176 echo "Extra audio cards $audio_card_list"
1177 echo "Mixer emulation $mixemu"
1178 echo "VNC TLS support $vnc_tls"
1179 if test "$vnc_tls" = "yes" ; then
1180 echo " TLS CFLAGS $vnc_tls_cflags"
1181 echo " TLS LIBS $vnc_tls_libs"
1183 if test -n "$sparc_cpu"; then
1184 echo "Target Sparc Arch $sparc_cpu"
1186 echo "kqemu support $kqemu"
1187 echo "kvm support $kvm"
1188 echo "CPU emulation $cpu_emulation"
1189 echo "brlapi support $brlapi"
1190 echo "Documentation $build_docs"
1191 [ ! -z "$uname_release" ] && \
1192 echo "uname -r $uname_release"
1193 echo "NPTL support $nptl"
1194 echo "vde support $vde"
1195 echo "AIO support $aio"
1196 echo "Install blobs $blobs"
1197 echo "KVM support $kvm"
1198 echo "fdt support $fdt"
1200 if test $sdl_too_old = "yes"; then
1201 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1203 if [ -s $TMPSDLLOG ]; then
1204 echo "The error log from compiling the libSDL test is: "
1207 #if test "$sdl_static" = "no"; then
1208 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1210 config_mak
="config-host.mak"
1211 config_h
="config-host.h"
1213 #echo "Creating $config_mak and $config_h"
1215 test -f $config_h && mv $config_h ${config_h}~
1217 echo "# Automatically generated by configure - do not modify" > $config_mak
1218 printf "# Configured with:" >> $config_mak
1219 printf " '%s'" "$0" "$@" >> $config_mak
1221 echo "/* Automatically generated by configure - do not modify */" > $config_h
1223 echo "prefix=$prefix" >> $config_mak
1224 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1225 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1226 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1227 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1228 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1229 echo "MAKE=$make" >> $config_mak
1230 echo "INSTALL=$install" >> $config_mak
1231 echo "CC=$cc" >> $config_mak
1232 echo "HOST_CC=$host_cc" >> $config_mak
1233 echo "AR=$ar" >> $config_mak
1234 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1235 # XXX: only use CFLAGS and LDFLAGS ?
1236 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1237 # compilation of dyngen tool (useful for win32 build on Linux host)
1238 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1239 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1240 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1241 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1242 echo "CFLAGS=$CFLAGS" >> $config_mak
1243 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1244 echo "EXESUF=$EXESUF" >> $config_mak
1245 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1248 echo "ARCH=i386" >> $config_mak
1249 echo "#define HOST_I386 1" >> $config_h
1252 echo "ARCH=x86_64" >> $config_mak
1253 echo "#define HOST_X86_64 1" >> $config_h
1256 echo "ARCH=alpha" >> $config_mak
1257 echo "#define HOST_ALPHA 1" >> $config_h
1260 echo "ARCH=arm" >> $config_mak
1261 echo "#define HOST_ARM 1" >> $config_h
1264 echo "ARCH=arm" >> $config_mak
1265 echo "#define HOST_ARM 1" >> $config_h
1268 echo "ARCH=cris" >> $config_mak
1269 echo "#define HOST_CRIS 1" >> $config_h
1272 echo "ARCH=hppa" >> $config_mak
1273 echo "#define HOST_HPPA 1" >> $config_h
1276 echo "ARCH=ia64" >> $config_mak
1277 echo "#define HOST_IA64 1" >> $config_h
1280 echo "ARCH=m68k" >> $config_mak
1281 echo "#define HOST_M68K 1" >> $config_h
1284 echo "ARCH=mips" >> $config_mak
1285 echo "#define HOST_MIPS 1" >> $config_h
1288 echo "ARCH=mips64" >> $config_mak
1289 echo "#define HOST_MIPS64 1" >> $config_h
1292 if test "$hostlongbits" = "32"; then
1293 echo "ARCH=ppc" >> $config_mak
1294 echo "#define HOST_PPC 1" >> $config_h
1296 echo "ARCH=ppc64" >> $config_mak
1297 echo "#define HOST_PPC64 1" >> $config_h
1301 echo "ARCH=s390" >> $config_mak
1302 echo "#define HOST_S390 1" >> $config_h
1305 echo "ARCH=sparc" >> $config_mak
1306 echo "#define HOST_SPARC 1" >> $config_h
1309 echo "ARCH=sparc64" >> $config_mak
1310 echo "#define HOST_SPARC64 1" >> $config_h
1313 echo "Unsupported CPU = $cpu"
1317 if test "$sparse" = "yes" ; then
1318 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1319 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1320 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1322 if test "$bigendian" = "yes" ; then
1323 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1324 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1326 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1327 if test "$mingw32" = "yes" ; then
1328 echo "CONFIG_WIN32=yes" >> $config_mak
1329 echo "#define CONFIG_WIN32 1" >> $config_h
1332 #include <byteswap.h>
1333 int main(void) { return bswap_32(0); }
1335 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1336 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1339 #include <sys/endian.h>
1340 #include <sys/types.h>
1341 #include <machine/bswap.h>
1342 int main(void) { return bswap32(0); }
1344 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1345 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1349 if [ "$openbsd" = "yes" ] ; then
1350 echo "#define ENOTSUP 4096" >> $config_h
1353 if test "$darwin" = "yes" ; then
1354 echo "CONFIG_DARWIN=yes" >> $config_mak
1355 echo "#define CONFIG_DARWIN 1" >> $config_h
1358 if test "$aix" = "yes" ; then
1359 echo "CONFIG_AIX=yes" >> $config_mak
1360 echo "#define CONFIG_AIX 1" >> $config_h
1363 if test "$solaris" = "yes" ; then
1364 echo "CONFIG_SOLARIS=yes" >> $config_mak
1365 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1366 if test "$needs_libsunmath" = "yes" ; then
1367 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1368 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1371 if test -n "$sparc_cpu"; then
1372 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1373 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1375 if test "$gdbstub" = "yes" ; then
1376 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1377 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1379 if test "$gprof" = "yes" ; then
1380 echo "TARGET_GPROF=yes" >> $config_mak
1381 echo "#define HAVE_GPROF 1" >> $config_h
1383 if test "$static" = "yes" ; then
1384 echo "CONFIG_STATIC=yes" >> $config_mak
1385 echo "#define CONFIG_STATIC 1" >> $config_h
1387 if test $profiler = "yes" ; then
1388 echo "#define CONFIG_PROFILER 1" >> $config_h
1390 if test "$slirp" = "yes" ; then
1391 echo "CONFIG_SLIRP=yes" >> $config_mak
1392 echo "#define CONFIG_SLIRP 1" >> $config_h
1394 if test "$vde" = "yes" ; then
1395 echo "CONFIG_VDE=yes" >> $config_mak
1396 echo "#define CONFIG_VDE 1" >> $config_h
1397 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1399 for card
in $audio_card_list; do
1400 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1401 echo "$def=yes" >> $config_mak
1402 echo "#define $def 1" >> $config_h
1404 echo "#define AUDIO_DRIVERS \\" >> $config_h
1405 for drv
in $audio_drv_list; do
1406 echo " &${drv}_audio_driver, \\" >>$config_h
1407 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1408 echo "$def=yes" >> $config_mak
1409 if test "$drv" = "fmod"; then
1410 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1411 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1412 elif test "$drv" = "oss"; then
1413 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1417 if test "$mixemu" = "yes" ; then
1418 echo "CONFIG_MIXEMU=yes" >> $config_mak
1419 echo "#define CONFIG_MIXEMU 1" >> $config_h
1421 if test "$vnc_tls" = "yes" ; then
1422 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1423 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1424 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1425 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1427 qemu_version
=`head $source_path/VERSION`
1428 echo "VERSION=$qemu_version" >>$config_mak
1429 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1430 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1432 echo "SRC_PATH=$source_path" >> $config_mak
1433 if [ "$source_path_used" = "yes" ]; then
1434 echo "VPATH=$source_path" >> $config_mak
1436 echo "TARGET_DIRS=$target_list" >> $config_mak
1437 if [ "$build_docs" = "yes" ] ; then
1438 echo "BUILD_DOCS=yes" >> $config_mak
1440 if test "$static" = "yes"; then
1445 if test "$sdl1" = "yes" ; then
1446 echo "#define CONFIG_SDL 1" >> $config_h
1447 echo "CONFIG_SDL=yes" >> $config_mak
1448 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1449 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1451 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1453 if [ "${aa}" = "yes" ] ; then
1454 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1456 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1459 if test "$cocoa" = "yes" ; then
1460 echo "#define CONFIG_COCOA 1" >> $config_h
1461 echo "CONFIG_COCOA=yes" >> $config_mak
1463 if test "$curses" = "yes" ; then
1464 echo "#define CONFIG_CURSES 1" >> $config_h
1465 echo "CONFIG_CURSES=yes" >> $config_mak
1466 echo "CURSES_LIBS=-lcurses" >> $config_mak
1468 if test "$brlapi" = "yes" ; then
1469 echo "CONFIG_BRLAPI=yes" >> $config_mak
1470 echo "#define CONFIG_BRLAPI 1" >> $config_h
1471 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1473 if test "$bluez" = "yes" ; then
1474 echo "CONFIG_BLUEZ=yes" >> $config_mak
1475 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1476 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1477 echo "#define CONFIG_BLUEZ 1" >> $config_h
1479 if test "$aio" = "yes" ; then
1480 echo "#define CONFIG_AIO 1" >> $config_h
1481 echo "CONFIG_AIO=yes" >> $config_mak
1483 if test "$blobs" = "yes" ; then
1484 echo "INSTALL_BLOBS=yes" >> $config_mak
1486 if test "$iovec" = "yes" ; then
1487 echo "#define HAVE_IOVEC 1" >> $config_h
1489 if test "$fdt" = "yes" ; then
1490 echo "#define HAVE_FDT 1" >> $config_h
1491 echo "FDT_LIBS=-lfdt" >> $config_mak
1493 if test "$signalfd" = "yes" ; then
1494 echo "#define CONFIG_signalfd 1" >> $config_h
1496 if test "$eventfd" = "yes" ; then
1497 echo "#define CONFIG_eventfd 1" >> $config_h
1500 # XXX: suppress that
1501 if [ "$bsd" = "yes" ] ; then
1502 echo "#define O_LARGEFILE 0" >> $config_h
1503 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1504 echo "#define _BSD 1" >> $config_h
1507 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1512 echo "HOST_USB=linux" >> $config_mak
1515 echo "HOST_USB=bsd" >> $config_mak
1518 echo "HOST_USB=stub" >> $config_mak
1523 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1524 tools
="qemu-img\$(EXESUF) $tools"
1525 if [ "$linux" = "yes" ] ; then
1526 tools
="qemu-nbd\$(EXESUF) $tools"
1529 echo "TOOLS=$tools" >> $config_mak
1531 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1533 for target
in $target_list; do
1534 target_dir
="$target"
1535 config_mak
=$target_dir/config.mak
1536 config_h
=$target_dir/config.h
1537 target_cpu
=`echo $target | cut -d '-' -f 1`
1538 target_bigendian
="no"
1539 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1540 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1541 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1542 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1543 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1544 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1545 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1546 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1547 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1548 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1549 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1550 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1551 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1553 target_user_only
="no"
1554 target_linux_user
="no"
1555 target_darwin_user
="no"
1556 target_bsd_user
="no"
1558 ${target_cpu}-softmmu)
1559 target_softmmu
="yes"
1561 ${target_cpu}-linux-user)
1562 target_user_only
="yes"
1563 target_linux_user
="yes"
1565 ${target_cpu}-darwin-user)
1566 target_user_only
="yes"
1567 target_darwin_user
="yes"
1569 ${target_cpu}-bsd-user)
1570 target_user_only
="yes"
1571 target_bsd_user
="yes"
1574 echo "ERROR: Target '$target' not recognised"
1579 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1580 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1581 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1582 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1583 echo "Note that this will disable all output from the virtual graphics card"
1584 echo "except through VNC or curses."
1588 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1590 test -f $config_h && mv $config_h ${config_h}~
1592 mkdir
-p $target_dir
1593 mkdir
-p $target_dir/fpu
1594 mkdir
-p $target_dir/tcg
1595 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1596 mkdir
-p $target_dir/nwfpe
1600 # don't use ln -sf as not all "ln -sf" over write the file/link
1602 rm -f $target_dir/Makefile
1603 ln -s $source_path/Makefile.target
$target_dir/Makefile
1606 echo "# Automatically generated by configure - do not modify" > $config_mak
1607 echo "/* Automatically generated by configure - do not modify */" > $config_h
1610 echo "include ../config-host.mak" >> $config_mak
1611 echo "#include \"../config-host.h\"" >> $config_h
1616 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1617 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1620 disable_cpu_emulation
() {
1621 if test $cpu_emulation = "no"; then
1622 echo "#define NO_CPU_EMULATION 1" >> $config_h
1623 echo "NO_CPU_EMULATION=1" >> $config_mak
1628 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1629 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1630 echo "#define USE_KVM 1" >> $config_h
1631 echo "USE_KVM=1" >> $config_mak
1632 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1633 if test $kvm_cap_pit = "yes" ; then
1634 echo "USE_KVM_PIT=1" >> $config_mak
1635 echo "#define USE_KVM_PIT 1" >> $config_h
1637 if test $kvm_cap_device_assignment = "yes" ; then
1638 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1639 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1641 disable_cpu_emulation
1645 if [ use_upstream_kvm
= yes ]; then
1647 # Make sure the target and host cpus are compatible
1648 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1649 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "powerpc" \
) -o \
1650 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1651 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1654 # Disable KVM for linux-user
1655 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1661 case "$target_cpu" in
1663 echo "TARGET_ARCH=i386" >> $config_mak
1664 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1665 echo "#define TARGET_I386 1" >> $config_h
1666 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1668 echo "#define USE_KQEMU 1" >> $config_h
1670 if test "$kvm" = "yes" ; then
1671 echo "CONFIG_KVM=yes" >> $config_mak
1672 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1673 echo "#define CONFIG_KVM 1" >> $config_h
1678 echo "TARGET_ARCH=x86_64" >> $config_mak
1679 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1680 echo "#define TARGET_I386 1" >> $config_h
1681 echo "#define TARGET_X86_64 1" >> $config_h
1682 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1684 echo "#define USE_KQEMU 1" >> $config_h
1689 echo "TARGET_ARCH=ia64" >> $config_mak
1690 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1691 echo "#define TARGET_IA64 1" >> $config_h
1693 if [ use_upstream_kvm
= yes ]; then
1694 if test "$kvm" = "yes" ; then
1695 echo "CONFIG_KVM=yes" >> $config_mak
1696 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1697 echo "#define CONFIG_KVM 1" >> $config_h
1702 echo "TARGET_ARCH=alpha" >> $config_mak
1703 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1704 echo "#define TARGET_ALPHA 1" >> $config_h
1707 echo "TARGET_ARCH=arm" >> $config_mak
1708 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1709 echo "#define TARGET_ARM 1" >> $config_h
1712 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1715 echo "TARGET_ARCH=cris" >> $config_mak
1716 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1717 echo "#define TARGET_CRIS 1" >> $config_h
1721 echo "TARGET_ARCH=m68k" >> $config_mak
1722 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1723 echo "#define TARGET_M68K 1" >> $config_h
1725 gdb_xml_files
="cf-core.xml cf-fp.xml"
1728 echo "TARGET_ARCH=mips" >> $config_mak
1729 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1730 echo "#define TARGET_MIPS 1" >> $config_h
1731 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1734 echo "TARGET_ARCH=mipsn32" >> $config_mak
1735 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1736 echo "#define TARGET_MIPS 1" >> $config_h
1737 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1740 echo "TARGET_ARCH=mips64" >> $config_mak
1741 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1742 echo "#define TARGET_MIPS 1" >> $config_h
1743 echo "#define TARGET_MIPS64 1" >> $config_h
1744 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1747 echo "TARGET_ARCH=ppc" >> $config_mak
1748 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1749 echo "#define TARGET_PPC 1" >> $config_h
1752 echo "TARGET_ARCH=ppcemb" >> $config_mak
1753 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1754 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1755 echo "#define TARGET_PPC 1" >> $config_h
1756 echo "#define TARGET_PPCEMB 1" >> $config_h
1757 if test "$kvm" = "yes" ; then
1758 echo "CONFIG_KVM=yes" >> $config_mak
1759 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1760 echo "#define CONFIG_KVM 1" >> $config_h
1764 echo "TARGET_ARCH=ppc64" >> $config_mak
1765 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1766 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1767 echo "#define TARGET_PPC 1" >> $config_h
1768 echo "#define TARGET_PPC64 1" >> $config_h
1771 echo "TARGET_ARCH=ppc64" >> $config_mak
1772 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1773 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1774 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1775 echo "#define TARGET_PPC 1" >> $config_h
1776 echo "#define TARGET_PPC64 1" >> $config_h
1777 echo "#define TARGET_ABI32 1" >> $config_h
1780 echo "TARGET_ARCH=sh4" >> $config_mak
1781 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1782 echo "#define TARGET_SH4 1" >> $config_h
1787 echo "TARGET_ARCH=sparc" >> $config_mak
1788 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1789 echo "#define TARGET_SPARC 1" >> $config_h
1792 echo "TARGET_ARCH=sparc64" >> $config_mak
1793 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1794 echo "#define TARGET_SPARC 1" >> $config_h
1795 echo "#define TARGET_SPARC64 1" >> $config_h
1799 echo "TARGET_ARCH=sparc64" >> $config_mak
1800 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1801 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1802 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1803 echo "#define TARGET_SPARC 1" >> $config_h
1804 echo "#define TARGET_SPARC64 1" >> $config_h
1805 echo "#define TARGET_ABI32 1" >> $config_h
1808 echo "Unsupported target CPU"
1812 if test "$target_bigendian" = "yes" ; then
1813 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1814 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1816 if test "$target_softmmu" = "yes" ; then
1817 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1818 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1820 if test "$target_user_only" = "yes" ; then
1821 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1822 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1824 if test "$target_linux_user" = "yes" ; then
1825 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1826 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1828 if test "$target_darwin_user" = "yes" ; then
1829 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1830 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1833 if test ! -z "$gdb_xml_files" ; then
1834 for x
in $gdb_xml_files; do
1835 list
="$list $source_path/gdb-xml/$x"
1838 echo "TARGET_XML_FILES=$list" >> $config_mak
1840 if test "$target_cpu" = "arm" \
1841 -o "$target_cpu" = "armeb" \
1842 -o "$target_cpu" = "m68k" \
1843 -o "$target_cpu" = "mips" \
1844 -o "$target_cpu" = "mipsel" \
1845 -o "$target_cpu" = "mipsn32" \
1846 -o "$target_cpu" = "mipsn32el" \
1847 -o "$target_cpu" = "mips64" \
1848 -o "$target_cpu" = "mips64el" \
1849 -o "$target_cpu" = "ppc" \
1850 -o "$target_cpu" = "ppc64" \
1851 -o "$target_cpu" = "ppc64abi32" \
1852 -o "$target_cpu" = "ppcemb" \
1853 -o "$target_cpu" = "sparc" \
1854 -o "$target_cpu" = "sparc64" \
1855 -o "$target_cpu" = "sparc32plus"; then
1856 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1857 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1859 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1860 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1861 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1863 if test "$target_user_only" = "yes" \
1864 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1865 echo "#define USE_NPTL 1" >> $config_h
1867 # 32 bit ELF loader in addition to native 64 bit loader?
1868 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1869 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1870 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1872 if test "$target_bsd_user" = "yes" ; then
1873 echo "CONFIG_BSD_USER=yes" >> $config_mak
1874 echo "#define CONFIG_BSD_USER 1" >> $config_h
1877 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1879 done # for target in $targets
1881 # build tree in object directory if source path is different from current one
1882 if test "$source_path_used" = "yes" ; then
1883 DIRS
="tests tests/cris slirp audio"
1884 FILES
="Makefile tests/Makefile"
1885 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1886 FILES
="$FILES tests/test-mmap.c"
1887 for dir
in $DIRS ; do
1890 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1891 for f
in $FILES ; do
1893 ln -s $source_path/$f $f