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 gcc3_list
="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
38 cpu
=`test $(uname -s) = AIX && uname -p || uname -m`
41 i386|i486|i586|i686|i86pc|BePC
)
74 "Power Macintosh"|ppc|ppc64|powerpc
)
123 kvm_cap_device_assignment
="no"
130 device_tree_support
=""
137 OS_CFLAGS
="-mno-cygwin"
138 if [ "$cpu" = "i386" ] ; then
141 audio_possible_drivers
="sdl"
145 if [ "$cpu" = "i386" ] ; then
148 audio_possible_drivers
="dsound sdl fmod"
152 audio_possible_drivers
="oss sdl esd pa"
153 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
160 audio_possible_drivers
="oss sdl esd pa"
162 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
170 audio_possible_drivers
="oss sdl esd"
172 aio_lib
="-lrt -lpthread"
178 audio_possible_drivers
="oss sdl esd"
187 audio_drv_list
="coreaudio"
188 audio_possible_drivers
="coreaudio sdl fmod"
189 OS_CFLAGS
="-mdynamic-no-pic"
190 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
197 needs_libsunmath
="no"
198 solarisrev
=`uname -r | cut -f2 -d.`
199 # have to select again, because `uname -m` returns i86pc
200 # even on an x86_64 box.
201 solariscpu
=`isainfo -k`
202 if test "${solariscpu}" = "amd64" ; then
205 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
206 if test "$solarisrev" -le 9 ; then
207 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
208 needs_libsunmath
="yes"
210 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
211 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
212 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
213 echo "Studio 11 can be downloaded from www.sun.com."
217 if test "$solarisrev" -ge 9 ; then
221 if test -f /usr
/include
/sys
/soundcard.h
; then
224 audio_possible_drivers
="oss sdl"
232 audio_possible_drivers
="oss alsa sdl esd pa"
236 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
238 audio_possible_drivers
="$audio_possible_drivers fmod"
241 if [ "$cpu" = "ia64" ] ; then
247 if [ "$cpu" = "powerpc" ]; then
253 if [ "$bsd" = "yes" ] ; then
254 if [ "$darwin" != "yes" ] ; then
262 source_path
=`dirname "$0"`
263 source_path_used
="no"
265 if [ -z "$source_path" ]; then
268 source_path
=`cd "$source_path"; pwd`
270 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
273 # generate compile errors on warnings for development builds
274 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
279 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
281 --help|
-h) show_help
=yes
283 --prefix=*) prefix
="$optarg"
285 --interp-prefix=*) interp_prefix
="$optarg"
287 --source-path=*) source_path
="$optarg"
288 source_path_used
="yes"
290 --cross-prefix=*) cross_prefix
="$optarg"
295 --host-cc=*) host_cc
="$optarg"
297 --make=*) make="$optarg"
299 --install=*) install="$optarg"
301 --extra-cflags=*) CFLAGS
="$optarg"
303 --extra-ldflags=*) LDFLAGS
="$optarg"
305 --cpu=*) cpu
="$optarg"
307 --target-list=*) target_list
="$optarg"
309 --enable-gprof) gprof
="yes"
311 --static) static
="yes"
313 --disable-sdl) sdl
="no"
315 --fmod-lib=*) fmod_lib
="$optarg"
317 --fmod-inc=*) fmod_inc
="$optarg"
319 --oss-lib=*) oss_lib
="$optarg"
321 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
323 --audio-drv-list=*) audio_drv_list
="$optarg"
325 --enable-sparse) sparse
="yes"
327 --disable-sparse) sparse
="no"
329 --disable-vnc-tls) vnc_tls
="no"
331 --disable-slirp) slirp
="no"
333 --disable-vde) vde
="no"
335 --disable-kqemu) kqemu
="no"
337 --disable-brlapi) brlapi
="no"
339 --disable-bluez) bluez
="no"
341 --disable-kvm) kvm
="no"
343 --enable-profiler) profiler
="yes"
348 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
350 --disable-gfx-check) check_gfx
="no"
352 --disable-gcc-check) check_gcc
="no"
354 --disable-system) softmmu
="no"
356 --enable-system) softmmu
="yes"
358 --disable-linux-user) linux_user
="no"
360 --enable-linux-user) linux_user
="yes"
362 --disable-darwin-user) darwin_user
="no"
364 --enable-darwin-user) darwin_user
="yes"
366 --disable-bsd-user) bsd_user
="no"
368 --enable-bsd-user) bsd_user
="yes"
370 --enable-uname-release=*) uname_release
="$optarg"
375 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
376 target_cpu
="sparc"; cpu
="sparc" ;;
377 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
378 target_cpu
="sparc"; cpu
="sparc" ;;
379 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
380 target_cpu
="sparc64"; cpu
="sparc64" ;;
381 *) echo "undefined SPARC architecture. Exiting";exit 1;;
384 --enable-werror) werror
="yes"
386 --disable-werror) werror
="no"
388 --disable-curses) curses
="no"
390 --disable-nptl) nptl
="no"
392 --enable-mixemu) mixemu
="yes"
394 --disable-aio) aio
="no"
396 --disable-blobs) blobs
="no"
398 --kerneldir=*) kerneldir
="$optarg"
400 --disable-cpu-emulation) cpu_emulation
="no"
402 --disable-libfdt) device_tree_support
="no"
404 *) echo "ERROR: unknown option $opt"; exit 1
409 # default flags for all hosts
410 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
411 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
412 LDFLAGS
="$LDFLAGS -g"
413 if test "$werror" = "yes" ; then
414 CFLAGS
="$CFLAGS -Werror"
417 if test "$solaris" = "no" ; then
418 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
419 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
424 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
425 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
428 sparc
) if test -z "$sparc_cpu" ; then
429 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
432 ARCH_CFLAGS
="${SP_CFLAGS}"
433 ARCH_LDFLAGS
="${SP_LDFLAGS}"
436 sparc64
) if test -z "$sparc_cpu" ; then
437 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
440 ARCH_CFLAGS
="${SP_CFLAGS}"
441 ARCH_LDFLAGS
="${SP_LDFLAGS}"
445 ARCH_CFLAGS
="-march=z900"
457 if test x
"$show_help" = x
"yes" ; then
460 Usage: configure [options]
461 Options: [defaults in brackets after descriptions]
464 echo "Standard options:"
465 echo " --help print this message"
466 echo " --prefix=PREFIX install in PREFIX [$prefix]"
467 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
468 echo " use %M for cpu name [$interp_prefix]"
469 echo " --target-list=LIST set target list [$target_list]"
471 echo "kqemu kernel acceleration support:"
472 echo " --disable-kqemu disable kqemu support"
474 echo "Advanced options (experts only):"
475 echo " --source-path=PATH path of source code [$source_path]"
476 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
477 echo " --cc=CC use C compiler CC [$cc]"
478 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
479 echo " --make=MAKE use specified make [$make]"
480 echo " --install=INSTALL use specified install [$install]"
481 echo " --static enable static build [$static]"
482 echo " --enable-sparse enable sparse checker"
483 echo " --disable-sparse disable sparse checker (default)"
484 echo " --disable-werror disable compilation abort on warning"
485 echo " --disable-sdl disable SDL"
486 echo " --enable-cocoa enable COCOA (Mac OS X only)"
487 echo " --audio-drv-list=LIST set audio drivers list:"
488 echo " Available drivers: $audio_possible_drivers"
489 echo " --audio-card-list=LIST set list of additional emulated audio cards"
490 echo " Available cards: ac97 adlib cs4231a gus"
491 echo " --enable-mixemu enable mixer emulation"
492 echo " --disable-brlapi disable BrlAPI"
493 echo " --disable-vnc-tls disable TLS encryption for VNC server"
494 echo " --disable-curses disable curses output"
495 echo " --disable-bluez disable bluez stack connectivity"
496 echo " --disable-kvm disable KVM acceleration support"
497 echo " --disable-nptl disable usermode NPTL support"
498 echo " --enable-system enable all system emulation targets"
499 echo " --disable-system disable all system emulation targets"
500 echo " --enable-linux-user enable all linux usermode emulation targets"
501 echo " --disable-linux-user disable all linux usermode emulation targets"
502 echo " --enable-darwin-user enable all darwin usermode emulation targets"
503 echo " --disable-darwin-user disable all darwin usermode emulation targets"
504 echo " --enable-bsd-user enable all BSD usermode emulation targets"
505 echo " --disable-bsd-user disable all BSD usermode emulation targets"
506 echo " --fmod-lib path to FMOD library"
507 echo " --fmod-inc path to FMOD includes"
508 echo " --oss-lib path to OSS library"
509 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
510 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
511 echo " --disable-vde disable support for vde network"
512 echo " --disable-aio disable AIO support"
513 echo " --disable-blobs disable installing provided firmware blobs"
514 echo " --kerneldir=PATH look for kernel includes in PATH"
515 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
516 echo " --disable-libfdt disables use of libfdt support for device tree"
518 echo "NOTE: The object files are built at the place where configure is launched"
522 cc
="${cross_prefix}${cc}"
523 ar="${cross_prefix}${ar}"
524 strip
="${cross_prefix}${strip}"
526 # check that the C compiler works.
531 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
532 : C compiler works ok
534 echo "ERROR: \"$cc\" either does not exist or does not work"
538 # check compiler to see if we're on mingw32
547 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
551 if test "$mingw32" = "yes" ; then
559 if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
561 elif [ "$bsd" = "yes" ]; then
564 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
565 AIOLIBS
="-lrt -lpthread"
568 # Check for gcc4, error if pre-gcc4
569 if test "$check_gcc" = "yes" ; then
574 int main(){return 0;}
576 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
577 echo "WARNING: \"$cc\" looks like gcc 4.x"
579 if test "$gcc3_search" = "yes" ; then
580 echo "Looking for gcc 3.x"
581 for compat_cc
in $gcc3_list ; do
582 if "$cross_prefix$compat_cc" --version 2> /dev
/null | fgrep
'(GCC) 3.' > /dev
/null
2>&1 ; then
583 echo "Found \"$compat_cc\""
584 cc
="$cross_prefix$compat_cc"
585 found_compat_cc
="yes"
589 if test "$found_compat_cc" = "no" ; then
590 echo "gcc 3.x not found!"
593 if test "$found_compat_cc" = "no" ; then
594 echo "QEMU is known to have problems when compiled with gcc 4.x"
595 echo "It is recommended that you use gcc 3.x to build QEMU"
596 echo "To use this compiler anyway, configure with --disable-gcc-check"
602 if test ! -x "$(which cgcc 2>/dev/null)"; then
607 # Solaris specific configure tool chain decisions
609 if test "$solaris" = "yes" ; then
611 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
612 # override the check with --disable-gcc-check
614 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
616 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
617 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
618 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
619 echo "or get the latest patch from SunSolve for gcc"
623 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
624 if test -z "$solinst" ; then
625 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
626 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
627 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
630 if test "$solinst" = "/usr/sbin/install" ; then
631 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
632 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
633 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
636 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
637 if test -z "$sol_ar" ; then
638 echo "Error: No path includes ar"
639 if test -f /usr
/ccs
/bin
/ar ; then
640 echo "Add /usr/ccs/bin to your path and rerun configure"
647 if test -z "$target_list" ; then
648 # these targets are portable
649 if [ "$softmmu" = "yes" ] ; then
668 # the following are Linux specific
669 if [ "$linux_user" = "yes" ] ; then
670 target_list
="${target_list}\
682 ppc64abi32-linux-user \
687 sparc32plus-linux-user \
690 # the following are Darwin specific
691 if [ "$darwin_user" = "yes" ] ; then
692 target_list
="$target_list i386-darwin-user ppc-darwin-user"
694 # the following are BSD specific
695 if [ "$bsd_user" = "yes" ] ; then
696 target_list
="${target_list}\
701 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
703 if test -z "$target_list" ; then
704 echo "No targets enabled"
708 if test -z "$cross_prefix" ; then
711 # big/little endian test
713 #include <inttypes.h>
714 int main(int argc, char ** argv){
715 volatile uint32_t i=0x01234567;
716 return (*((uint8_t*)(&i))) == 0x67;
720 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
721 $TMPE && bigendian
="yes"
723 echo big
/little
test failed
728 # if cross compiling, cannot launch a program, so make a static guess
729 if test "$cpu" = "armv4b" \
733 -o "$cpu" = "mips64" \
734 -o "$cpu" = "powerpc" \
736 -o "$cpu" = "sparc" \
737 -o "$cpu" = "sparc64"; then
743 # host long bits test
745 if test "$cpu" = "x86_64" \
746 -o "$cpu" = "alpha" \
748 -o "$cpu" = "sparc64"; then
752 # ppc specific hostlongbits selection
753 if test "$cpu" = "powerpc" ; then
754 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
755 grep -q __powerpc64__
$TMPI && hostlongbits
=64
757 echo hostlongbits
test failed
762 # check gcc options support
768 # Check host NPTL support
771 #include <linux/futex.h>
774 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
780 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
786 ##########################################
789 if test "$kvm" = "yes" ; then
791 # test for KVM_CAP_PIT
796 #error "kvm no pit capability"
798 int main(void) { return 0; }
800 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
804 # test for KVM_CAP_DEVICE_ASSIGNMENT
808 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
809 #error "kvm no device assignment capability"
811 int main(void) { return 0; }
813 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
814 kvm_cap_device_assignment
="yes"
818 ##########################################
823 int main(void) { zlibVersion(); return 0; }
825 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev
/null
; then
829 echo "Error: zlib check failed"
830 echo "Make sure to have the zlib libs and headers installed."
835 ##########################################
840 if test -z "$sdl" ; then
841 sdl_config
="sdl-config"
847 #undef main /* We don't want SDL to override our main() */
848 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
850 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> $TMPSDLLOG ; then
851 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
852 if test "$_sdlversion" -lt 121 ; then
855 if test "$cocoa" = "no" ; then
860 # static link with sdl ?
861 if test "$sdl" = "yes" ; then
863 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
864 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
865 if [ "$aa" = "yes" ] ; then
866 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
869 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
873 fi # sdl compile test
875 # Make sure to disable cocoa if sdl was set
876 if test "$sdl" = "yes" ; then
878 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
882 ##########################################
884 if test "$vnc_tls" = "yes" ; then
886 #include <gnutls/gnutls.h>
887 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
889 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
890 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
891 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
892 $vnc_tls_libs 2> /dev
/null
; then
899 ##########################################
900 # vde libraries probe
901 if test "$vde" = "yes" ; then
903 #include <libvdeplug.h>
906 struct vde_open_args a = {0, 0, 0};
907 vde_open("", "", &a);
911 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev
/null
; then
918 ##########################################
919 # Sound support libraries probe
930 int main(void) { $exp }
932 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev
/null
; then
936 echo "Error: $drv check failed"
937 echo "Make sure to have the $drv libs and headers installed."
943 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
944 for drv
in $audio_drv_list; do
947 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
948 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
952 if test -z $fmod_lib ||
test -z $fmod_inc; then
954 echo "Error: You must specify path to FMOD library and headers"
955 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
959 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
963 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
967 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
968 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
971 oss|sdl|core|wav|dsound
)
972 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
976 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
978 echo "Error: Unknown driver '$drv' selected"
979 echo "Possible drivers are: $audio_possible_drivers"
987 ##########################################
990 if test -z "$brlapi" ; then
994 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
996 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev
/null
; then
998 fi # brlapi compile test
1001 ##########################################
1004 if test "$curses" = "yes" ; then
1008 int main(void) { return curses_version(); }
1010 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev
/null
; then
1015 ##########################################
1016 # bluez support probe
1017 if test "$bluez" = "yes" ; then
1018 `pkg-config bluez` || bluez
="no"
1020 if test "$bluez" = "yes" ; then
1022 #include <bluetooth/bluetooth.h>
1023 int main(void) { return bt_error(0); }
1025 bluez_cflags
=`pkg-config --cflags bluez`
1026 bluez_libs
=`pkg-config --libs bluez`
1027 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1028 $bluez_libs 2> /dev
/null
; then
1035 ##########################################
1037 if test "$kvm" = "yes" ; then
1039 #include <linux/kvm.h>
1040 #if !defined(KVM_API_VERSION) || \
1041 KVM_API_VERSION < 12 || \
1042 KVM_API_VERSION > 12 || \
1043 !defined(KVM_CAP_USER_MEMORY) || \
1044 !defined(KVM_CAP_SET_TSS_ADDR)
1045 #error Invalid KVM version
1047 int main(void) { return 0; }
1049 if test "$kerneldir" != "" ; then
1050 kvm_cflags
=-I"$kerneldir"/include
1054 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1062 ##########################################
1064 if test "$aio" = "yes" ; then
1068 int main(void) { return aio_write(NULL); }
1070 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1075 ##########################################
1080 #include <sys/syscall.h>
1082 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1085 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1089 ##########################################
1094 #include <sys/syscall.h>
1095 int main(void) { return syscall(SYS_eventfd, 0); }
1098 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1102 # Check if tools are available to build documentation.
1103 if [ -x "`which texi2html 2>/dev/null`" ] && \
1104 [ -x "`which pod2man 2>/dev/null`" ]; then
1108 if test "$mingw32" = "yes" ; then
1109 if test -z "$prefix" ; then
1110 prefix
="c:\\\\Program Files\\\\Qemu"
1117 if test -z "$prefix" ; then
1120 mansuffix
="/share/man"
1121 datasuffix
="/share/qemu"
1122 docsuffix
="/share/doc/qemu"
1126 ######################################
1129 if test -z "$device_tree_support" -a \
1130 "$cpu" = "powerpc"; then
1131 device_tree_support
="no"
1134 /* XXX uncomment later when libfdt is built before this test */
1135 //int main(void) { void *fdt; return fdt_create(fdt, 1024); }
1136 int main (void) {return 0;}
1138 # XXX for now do not try to link to libfdt and just check for header */
1139 # if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC -lfdt 2> /dev/null ; then
1140 if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1141 device_tree_support
="yes"
1144 echo "Error: Could not find libfdt"
1145 echo "Make sure to have the libfdt libs and headers installed."
1151 echo "Install prefix $prefix"
1152 echo "BIOS directory $prefix$datasuffix"
1153 echo "binary directory $prefix$binsuffix"
1154 if test "$mingw32" = "no" ; then
1155 echo "Manual directory $prefix$mansuffix"
1156 echo "ELF interp prefix $interp_prefix"
1158 echo "Source path $source_path"
1159 echo "C compiler $cc"
1160 echo "Host C compiler $host_cc"
1161 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1163 echo "install $install"
1164 echo "host CPU $cpu"
1165 echo "host big endian $bigendian"
1166 echo "target list $target_list"
1167 echo "gprof enabled $gprof"
1168 echo "sparse enabled $sparse"
1169 echo "profiler $profiler"
1170 echo "static build $static"
1171 echo "-Werror enabled $werror"
1172 if test "$darwin" = "yes" ; then
1173 echo "Cocoa support $cocoa"
1175 echo "SDL support $sdl"
1176 if test "$sdl" != "no" ; then
1177 echo "SDL static link $sdl_static"
1179 echo "curses support $curses"
1180 echo "mingw32 support $mingw32"
1181 echo "Audio drivers $audio_drv_list"
1182 echo "Extra audio cards $audio_card_list"
1183 echo "Mixer emulation $mixemu"
1184 echo "VNC TLS support $vnc_tls"
1185 if test "$vnc_tls" = "yes" ; then
1186 echo " TLS CFLAGS $vnc_tls_cflags"
1187 echo " TLS LIBS $vnc_tls_libs"
1189 if test -n "$sparc_cpu"; then
1190 echo "Target Sparc Arch $sparc_cpu"
1192 echo "kqemu support $kqemu"
1193 echo "kvm support $kvm"
1194 echo "CPU emulation $cpu_emulation"
1195 if test $cpu = "powerpc"; then
1196 echo "libfdt support $device_tree_support"
1198 echo "brlapi support $brlapi"
1199 echo "Documentation $build_docs"
1200 [ ! -z "$uname_release" ] && \
1201 echo "uname -r $uname_release"
1202 echo "NPTL support $nptl"
1203 echo "vde support $vde"
1204 echo "AIO support $aio"
1205 echo "Install blobs $blobs"
1206 echo "KVM support $kvm"
1208 if test $sdl_too_old = "yes"; then
1209 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1211 if [ -s $TMPSDLLOG ]; then
1212 echo "The error log from compiling the libSDL test is: "
1215 #if test "$sdl_static" = "no"; then
1216 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1218 config_mak
="config-host.mak"
1219 config_h
="config-host.h"
1221 #echo "Creating $config_mak and $config_h"
1223 test -f $config_h && mv $config_h ${config_h}~
1225 echo "# Automatically generated by configure - do not modify" > $config_mak
1226 echo "# Configured with: $0 $@" >> $config_mak
1227 echo "/* Automatically generated by configure - do not modify */" > $config_h
1229 echo "prefix=$prefix" >> $config_mak
1230 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1231 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1232 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1233 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1234 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1235 echo "MAKE=$make" >> $config_mak
1236 echo "INSTALL=$install" >> $config_mak
1237 echo "CC=$cc" >> $config_mak
1238 echo "HOST_CC=$host_cc" >> $config_mak
1239 echo "AR=$ar" >> $config_mak
1240 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1241 # XXX: only use CFLAGS and LDFLAGS ?
1242 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1243 # compilation of dyngen tool (useful for win32 build on Linux host)
1244 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1245 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1246 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1247 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1248 echo "CFLAGS=$CFLAGS" >> $config_mak
1249 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1250 echo "EXESUF=$EXESUF" >> $config_mak
1251 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1254 echo "ARCH=i386" >> $config_mak
1255 echo "#define HOST_I386 1" >> $config_h
1258 echo "ARCH=x86_64" >> $config_mak
1259 echo "#define HOST_X86_64 1" >> $config_h
1262 echo "ARCH=alpha" >> $config_mak
1263 echo "#define HOST_ALPHA 1" >> $config_h
1266 echo "ARCH=arm" >> $config_mak
1267 echo "#define HOST_ARM 1" >> $config_h
1270 echo "ARCH=arm" >> $config_mak
1271 echo "#define HOST_ARM 1" >> $config_h
1274 echo "ARCH=cris" >> $config_mak
1275 echo "#define HOST_CRIS 1" >> $config_h
1278 echo "ARCH=hppa" >> $config_mak
1279 echo "#define HOST_HPPA 1" >> $config_h
1282 echo "ARCH=ia64" >> $config_mak
1283 echo "#define HOST_IA64 1" >> $config_h
1286 echo "ARCH=m68k" >> $config_mak
1287 echo "#define HOST_M68K 1" >> $config_h
1290 echo "ARCH=mips" >> $config_mak
1291 echo "#define HOST_MIPS 1" >> $config_h
1294 echo "ARCH=mips64" >> $config_mak
1295 echo "#define HOST_MIPS64 1" >> $config_h
1298 if test "$hostlongbits" = "32"; then
1299 echo "ARCH=ppc" >> $config_mak
1300 echo "#define HOST_PPC 1" >> $config_h
1302 echo "ARCH=ppc64" >> $config_mak
1303 echo "#define HOST_PPC64 1" >> $config_h
1307 echo "ARCH=s390" >> $config_mak
1308 echo "#define HOST_S390 1" >> $config_h
1311 echo "ARCH=sparc" >> $config_mak
1312 echo "#define HOST_SPARC 1" >> $config_h
1315 echo "ARCH=sparc64" >> $config_mak
1316 echo "#define HOST_SPARC64 1" >> $config_h
1319 echo "Unsupported CPU = $cpu"
1323 if test "$sparse" = "yes" ; then
1324 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1325 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1326 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1328 if test "$bigendian" = "yes" ; then
1329 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1330 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1332 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1333 if test "$mingw32" = "yes" ; then
1334 echo "CONFIG_WIN32=yes" >> $config_mak
1335 echo "#define CONFIG_WIN32 1" >> $config_h
1338 #include <byteswap.h>
1339 int main(void) { return bswap_32(0); }
1341 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1342 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1346 if [ "$openbsd" = "yes" ] ; then
1347 echo "#define ENOTSUP 4096" >> $config_h
1350 if test "$darwin" = "yes" ; then
1351 echo "CONFIG_DARWIN=yes" >> $config_mak
1352 echo "#define CONFIG_DARWIN 1" >> $config_h
1355 if test "$aix" = "yes" ; then
1356 echo "CONFIG_AIX=yes" >> $config_mak
1357 echo "#define CONFIG_AIX 1" >> $config_h
1360 if test "$solaris" = "yes" ; then
1361 echo "CONFIG_SOLARIS=yes" >> $config_mak
1362 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1363 if test "$needs_libsunmath" = "yes" ; then
1364 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1365 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1368 if test -n "$sparc_cpu"; then
1369 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1370 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1372 if test "$gdbstub" = "yes" ; then
1373 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1374 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1376 if test "$gprof" = "yes" ; then
1377 echo "TARGET_GPROF=yes" >> $config_mak
1378 echo "#define HAVE_GPROF 1" >> $config_h
1380 if test "$static" = "yes" ; then
1381 echo "CONFIG_STATIC=yes" >> $config_mak
1382 echo "#define CONFIG_STATIC 1" >> $config_h
1384 if test $profiler = "yes" ; then
1385 echo "#define CONFIG_PROFILER 1" >> $config_h
1387 if test "$slirp" = "yes" ; then
1388 echo "CONFIG_SLIRP=yes" >> $config_mak
1389 echo "#define CONFIG_SLIRP 1" >> $config_h
1391 if test "$vde" = "yes" ; then
1392 echo "CONFIG_VDE=yes" >> $config_mak
1393 echo "#define CONFIG_VDE 1" >> $config_h
1394 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1396 for card
in $audio_card_list; do
1397 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1398 echo "$def=yes" >> $config_mak
1399 echo "#define $def 1" >> $config_h
1401 echo "#define AUDIO_DRIVERS \\" >> $config_h
1402 for drv
in $audio_drv_list; do
1403 echo " &${drv}_audio_driver, \\" >>$config_h
1404 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1405 echo "$def=yes" >> $config_mak
1406 if test "$drv" = "fmod"; then
1407 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1408 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1409 elif test "$drv" = "oss"; then
1410 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1414 if test "$mixemu" = "yes" ; then
1415 echo "CONFIG_MIXEMU=yes" >> $config_mak
1416 echo "#define CONFIG_MIXEMU 1" >> $config_h
1418 if test "$vnc_tls" = "yes" ; then
1419 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1420 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1421 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1422 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1424 qemu_version
=`head $source_path/VERSION`
1425 echo "VERSION=$qemu_version" >>$config_mak
1426 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1427 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1429 echo "SRC_PATH=$source_path" >> $config_mak
1430 if [ "$source_path_used" = "yes" ]; then
1431 echo "VPATH=$source_path" >> $config_mak
1433 echo "TARGET_DIRS=$target_list" >> $config_mak
1434 if [ "$build_docs" = "yes" ] ; then
1435 echo "BUILD_DOCS=yes" >> $config_mak
1437 if test "$static" = "yes"; then
1442 if test "$sdl1" = "yes" ; then
1443 echo "#define CONFIG_SDL 1" >> $config_h
1444 echo "CONFIG_SDL=yes" >> $config_mak
1445 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1446 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1448 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1450 if [ "${aa}" = "yes" ] ; then
1451 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1453 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1456 if test "$cocoa" = "yes" ; then
1457 echo "#define CONFIG_COCOA 1" >> $config_h
1458 echo "CONFIG_COCOA=yes" >> $config_mak
1460 if test "$curses" = "yes" ; then
1461 echo "#define CONFIG_CURSES 1" >> $config_h
1462 echo "CONFIG_CURSES=yes" >> $config_mak
1463 echo "CURSES_LIBS=-lcurses" >> $config_mak
1465 if test "$brlapi" = "yes" ; then
1466 echo "CONFIG_BRLAPI=yes" >> $config_mak
1467 echo "#define CONFIG_BRLAPI 1" >> $config_h
1468 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1470 if test "$bluez" = "yes" ; then
1471 echo "CONFIG_BLUEZ=yes" >> $config_mak
1472 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1473 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1474 echo "#define CONFIG_BLUEZ 1" >> $config_h
1476 if test "$aio" = "yes" ; then
1477 echo "#define CONFIG_AIO 1" >> $config_h
1478 echo "CONFIG_AIO=yes" >> $config_mak
1480 if test "$blobs" = "yes" ; then
1481 echo "INSTALL_BLOBS=yes" >> $config_mak
1483 if test "$signalfd" = "yes" ; then
1484 echo "#define CONFIG_signalfd 1" >> $config_h
1486 if test "$eventfd" = "yes" ; then
1487 echo "#define CONFIG_eventfd 1" >> $config_h
1490 # XXX: suppress that
1491 if [ "$bsd" = "yes" ] ; then
1492 echo "#define O_LARGEFILE 0" >> $config_h
1493 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1494 echo "#define _BSD 1" >> $config_h
1497 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1502 echo "HOST_USB=linux" >> $config_mak
1505 echo "HOST_USB=bsd" >> $config_mak
1508 echo "HOST_USB=stub" >> $config_mak
1513 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1514 tools
="qemu-img\$(EXESUF) $tools"
1515 if [ "$linux" = "yes" ] ; then
1516 tools
="qemu-nbd\$(EXESUF) $tools"
1519 echo "TOOLS=$tools" >> $config_mak
1521 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1523 for target
in $target_list; do
1524 target_dir
="$target"
1525 config_mak
=$target_dir/config.mak
1526 config_h
=$target_dir/config.h
1527 target_cpu
=`echo $target | cut -d '-' -f 1`
1528 target_bigendian
="no"
1529 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1530 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1531 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1532 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1533 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1534 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1535 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1536 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1537 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1538 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1539 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1540 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1541 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1543 target_user_only
="no"
1544 target_linux_user
="no"
1545 target_darwin_user
="no"
1546 target_bsd_user
="no"
1548 ${target_cpu}-softmmu)
1549 target_softmmu
="yes"
1551 ${target_cpu}-linux-user)
1552 target_user_only
="yes"
1553 target_linux_user
="yes"
1555 ${target_cpu}-darwin-user)
1556 target_user_only
="yes"
1557 target_darwin_user
="yes"
1559 ${target_cpu}-bsd-user)
1560 target_user_only
="yes"
1561 target_bsd_user
="yes"
1564 echo "ERROR: Target '$target' not recognised"
1569 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1570 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1571 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1572 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1573 echo "Note that this will disable all output from the virtual graphics card"
1574 echo "except through VNC or curses."
1578 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1580 test -f $config_h && mv $config_h ${config_h}~
1582 mkdir
-p $target_dir
1583 mkdir
-p $target_dir/fpu
1584 mkdir
-p $target_dir/tcg
1585 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1586 mkdir
-p $target_dir/nwfpe
1590 # don't use ln -sf as not all "ln -sf" over write the file/link
1592 rm -f $target_dir/Makefile
1593 ln -s $source_path/Makefile.target
$target_dir/Makefile
1596 echo "# Automatically generated by configure - do not modify" > $config_mak
1597 echo "/* Automatically generated by configure - do not modify */" > $config_h
1600 echo "include ../config-host.mak" >> $config_mak
1601 echo "#include \"../config-host.h\"" >> $config_h
1606 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1607 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1610 disable_cpu_emulation
() {
1611 if test $cpu_emulation = "no"; then
1612 echo "#define NO_CPU_EMULATION 1" >> $config_h
1613 echo "NO_CPU_EMULATION=1" >> $config_mak
1618 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1619 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1620 echo "#define USE_KVM 1" >> $config_h
1621 echo "USE_KVM=1" >> $config_mak
1622 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1623 if test $kvm_cap_pit = "yes" ; then
1624 echo "USE_KVM_PIT=1" >> $config_mak
1625 echo "#define USE_KVM_PIT 1" >> $config_h
1627 if test $kvm_cap_device_assignment = "yes" ; then
1628 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1629 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1631 disable_cpu_emulation
1635 if [ use_upstream_kvm
= yes ]; then
1637 # Make sure the target and host cpus are compatible
1638 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1639 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1640 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1643 # Disable KVM for linux-user
1644 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1650 case "$target_cpu" in
1652 echo "TARGET_ARCH=i386" >> $config_mak
1653 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1654 echo "#define TARGET_I386 1" >> $config_h
1655 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1657 echo "#define USE_KQEMU 1" >> $config_h
1659 if test "$kvm" = "yes" ; then
1660 echo "CONFIG_KVM=yes" >> $config_mak
1661 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1662 echo "#define CONFIG_KVM 1" >> $config_h
1664 gcc3minver
=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1665 if test -n "$gcc3minver" && test $gcc3minver -gt 3
1667 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1669 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1674 echo "TARGET_ARCH=x86_64" >> $config_mak
1675 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1676 echo "#define TARGET_I386 1" >> $config_h
1677 echo "#define TARGET_X86_64 1" >> $config_h
1678 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1680 echo "#define USE_KQEMU 1" >> $config_h
1685 echo "TARGET_ARCH=ia64" >> $config_mak
1686 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1687 echo "#define TARGET_IA64 1" >> $config_h
1689 if [ use_upstream_kvm
= yes ]; then
1690 if test "$kvm" = "yes" ; then
1691 echo "CONFIG_KVM=yes" >> $config_mak
1692 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1693 echo "#define CONFIG_KVM 1" >> $config_h
1698 echo "TARGET_ARCH=alpha" >> $config_mak
1699 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1700 echo "#define TARGET_ALPHA 1" >> $config_h
1703 echo "TARGET_ARCH=arm" >> $config_mak
1704 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1705 echo "#define TARGET_ARM 1" >> $config_h
1708 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1711 echo "TARGET_ARCH=cris" >> $config_mak
1712 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1713 echo "#define TARGET_CRIS 1" >> $config_h
1716 echo "TARGET_ARCH=m68k" >> $config_mak
1717 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1718 echo "#define TARGET_M68K 1" >> $config_h
1720 gdb_xml_files
="cf-core.xml cf-fp.xml"
1723 echo "TARGET_ARCH=mips" >> $config_mak
1724 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1725 echo "#define TARGET_MIPS 1" >> $config_h
1726 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1729 echo "TARGET_ARCH=mipsn32" >> $config_mak
1730 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1731 echo "#define TARGET_MIPS 1" >> $config_h
1732 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1735 echo "TARGET_ARCH=mips64" >> $config_mak
1736 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1737 echo "#define TARGET_MIPS 1" >> $config_h
1738 echo "#define TARGET_MIPS64 1" >> $config_h
1739 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1742 echo "TARGET_ARCH=ppc" >> $config_mak
1743 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1744 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1745 echo "#define TARGET_PPC 1" >> $config_h
1746 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1749 echo "TARGET_ARCH=ppcemb" >> $config_mak
1750 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1751 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1752 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1753 echo "#define TARGET_PPC 1" >> $config_h
1754 echo "#define TARGET_PPCEMB 1" >> $config_h
1755 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1756 if test "$device_tree_support" = "yes" ; then
1757 echo "#define CONFIG_LIBFDT 1" >> $config_h
1758 echo "CONFIG_LIBFDT=1" >> $config_mak
1763 echo "TARGET_ARCH=ppc64" >> $config_mak
1764 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1765 echo "CONFIG_DYNGEN_OP=yes" >> $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
1769 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1772 echo "TARGET_ARCH=ppc64" >> $config_mak
1773 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1774 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1775 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1776 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1777 echo "#define TARGET_PPC 1" >> $config_h
1778 echo "#define TARGET_PPC64 1" >> $config_h
1779 echo "#define TARGET_ABI32 1" >> $config_h
1780 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1783 echo "TARGET_ARCH=sh4" >> $config_mak
1784 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1785 echo "#define TARGET_SH4 1" >> $config_h
1790 echo "TARGET_ARCH=sparc" >> $config_mak
1791 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1792 echo "#define TARGET_SPARC 1" >> $config_h
1795 echo "TARGET_ARCH=sparc64" >> $config_mak
1796 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1797 echo "#define TARGET_SPARC 1" >> $config_h
1798 echo "#define TARGET_SPARC64 1" >> $config_h
1802 echo "TARGET_ARCH=sparc64" >> $config_mak
1803 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1804 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1805 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1806 echo "#define TARGET_SPARC 1" >> $config_h
1807 echo "#define TARGET_SPARC64 1" >> $config_h
1808 echo "#define TARGET_ABI32 1" >> $config_h
1811 echo "Unsupported target CPU"
1815 if test "$target_bigendian" = "yes" ; then
1816 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1817 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1819 if test "$target_softmmu" = "yes" ; then
1820 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1821 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1823 if test "$target_user_only" = "yes" ; then
1824 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1825 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1827 if test "$target_linux_user" = "yes" ; then
1828 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1829 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1831 if test "$target_darwin_user" = "yes" ; then
1832 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1833 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1836 if test ! -z "$gdb_xml_files" ; then
1837 for x
in $gdb_xml_files; do
1838 list
="$list $source_path/gdb-xml/$x"
1841 echo "TARGET_XML_FILES=$list" >> $config_mak
1843 if test "$target_cpu" = "arm" \
1844 -o "$target_cpu" = "armeb" \
1845 -o "$target_cpu" = "m68k" \
1846 -o "$target_cpu" = "mips" \
1847 -o "$target_cpu" = "mipsel" \
1848 -o "$target_cpu" = "mipsn32" \
1849 -o "$target_cpu" = "mipsn32el" \
1850 -o "$target_cpu" = "mips64" \
1851 -o "$target_cpu" = "mips64el" \
1852 -o "$target_cpu" = "sparc" \
1853 -o "$target_cpu" = "sparc64" \
1854 -o "$target_cpu" = "sparc32plus"; then
1855 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1856 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1858 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1859 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1860 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1862 if test "$target_user_only" = "yes" \
1863 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1864 echo "#define USE_NPTL 1" >> $config_h
1866 # 32 bit ELF loader in addition to native 64 bit loader?
1867 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1868 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1869 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1871 if test "$target_bsd_user" = "yes" ; then
1872 echo "CONFIG_BSD_USER=yes" >> $config_mak
1873 echo "#define CONFIG_BSD_USER 1" >> $config_h
1876 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1878 done # for target in $targets
1880 # build tree in object directory if source path is different from current one
1881 if test "$source_path_used" = "yes" ; then
1882 DIRS
="tests tests/cris slirp audio"
1883 FILES
="Makefile tests/Makefile"
1884 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1885 FILES
="$FILES tests/test-mmap.c"
1886 for dir
in $DIRS ; do
1889 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1890 for f
in $FILES ; do
1892 ln -s $source_path/$f $f