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"
36 cpu
=`test $(uname -s) = AIX && uname -p || uname -m`
39 i386|i486|i586|i686|i86pc|BePC
)
72 "Power Macintosh"|ppc|ppc64|powerpc
)
120 kvm_cap_device_assignment
="no"
134 OS_CFLAGS
="-mno-cygwin"
135 if [ "$cpu" = "i386" ] ; then
138 audio_possible_drivers
="sdl"
142 if [ "$cpu" = "i386" ] ; then
145 audio_possible_drivers
="dsound sdl fmod"
149 audio_possible_drivers
="oss sdl esd pa"
150 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
157 audio_possible_drivers
="oss sdl esd pa"
158 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
166 audio_possible_drivers
="oss sdl esd"
173 audio_possible_drivers
="oss sdl esd"
181 audio_drv_list
="coreaudio"
182 audio_possible_drivers
="coreaudio sdl fmod"
183 OS_CFLAGS
="-mdynamic-no-pic"
184 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
190 needs_libsunmath
="no"
191 solarisrev
=`uname -r | cut -f2 -d.`
192 # have to select again, because `uname -m` returns i86pc
193 # even on an x86_64 box.
194 solariscpu
=`isainfo -k`
195 if test "${solariscpu}" = "amd64" ; then
198 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
199 if test "$solarisrev" -le 9 ; then
200 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
201 needs_libsunmath
="yes"
203 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
204 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
205 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
206 echo "Studio 11 can be downloaded from www.sun.com."
210 if test "$solarisrev" -ge 9 ; then
214 if test -f /usr
/include
/sys
/soundcard.h
; then
217 audio_possible_drivers
="oss sdl"
225 audio_possible_drivers
="oss alsa sdl esd pa"
229 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
231 audio_possible_drivers
="$audio_possible_drivers fmod"
234 if [ "$cpu" = "ia64" ] ; then
240 if [ "$cpu" = "powerpc" ]; then
246 if [ "$bsd" = "yes" ] ; then
247 if [ "$darwin" != "yes" ] ; then
255 source_path
=`dirname "$0"`
256 source_path_used
="no"
258 if [ -z "$source_path" ]; then
261 source_path
=`cd "$source_path"; pwd`
263 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
266 # generate compile errors on warnings for development builds
267 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
272 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
274 --help|
-h) show_help
=yes
276 --prefix=*) prefix
="$optarg"
278 --interp-prefix=*) interp_prefix
="$optarg"
280 --source-path=*) source_path
="$optarg"
281 source_path_used
="yes"
283 --cross-prefix=*) cross_prefix
="$optarg"
287 --host-cc=*) host_cc
="$optarg"
289 --make=*) make="$optarg"
291 --install=*) install="$optarg"
293 --extra-cflags=*) CFLAGS
="$optarg"
295 --extra-ldflags=*) LDFLAGS
="$optarg"
297 --cpu=*) cpu
="$optarg"
299 --target-list=*) target_list
="$optarg"
301 --enable-gprof) gprof
="yes"
303 --static) static
="yes"
305 --disable-sdl) sdl
="no"
307 --fmod-lib=*) fmod_lib
="$optarg"
309 --fmod-inc=*) fmod_inc
="$optarg"
311 --oss-lib=*) oss_lib
="$optarg"
313 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
315 --audio-drv-list=*) audio_drv_list
="$optarg"
317 --enable-sparse) sparse
="yes"
319 --disable-sparse) sparse
="no"
321 --disable-vnc-tls) vnc_tls
="no"
323 --disable-slirp) slirp
="no"
325 --disable-vde) vde
="no"
327 --disable-kqemu) kqemu
="no"
329 --disable-brlapi) brlapi
="no"
331 --disable-bluez) bluez
="no"
333 --disable-kvm) kvm
="no"
335 --enable-profiler) profiler
="yes"
340 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
342 --disable-gfx-check) check_gfx
="no"
344 --disable-system) softmmu
="no"
346 --enable-system) softmmu
="yes"
348 --disable-linux-user) linux_user
="no"
350 --enable-linux-user) linux_user
="yes"
352 --disable-darwin-user) darwin_user
="no"
354 --enable-darwin-user) darwin_user
="yes"
356 --disable-bsd-user) bsd_user
="no"
358 --enable-bsd-user) bsd_user
="yes"
360 --enable-uname-release=*) uname_release
="$optarg"
365 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
366 target_cpu
="sparc"; cpu
="sparc" ;;
367 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
368 target_cpu
="sparc"; cpu
="sparc" ;;
369 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
370 target_cpu
="sparc64"; cpu
="sparc64" ;;
371 *) echo "undefined SPARC architecture. Exiting";exit 1;;
374 --enable-werror) werror
="yes"
376 --disable-werror) werror
="no"
378 --disable-curses) curses
="no"
380 --disable-nptl) nptl
="no"
382 --enable-mixemu) mixemu
="yes"
384 --disable-aio) aio
="no"
386 --disable-blobs) blobs
="no"
388 --kerneldir=*) kerneldir
="$optarg"
390 --disable-cpu-emulation) cpu_emulation
="no"
392 *) echo "ERROR: unknown option $opt"; exit 1
397 # default flags for all hosts
398 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
399 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
400 LDFLAGS
="$LDFLAGS -g"
401 if test "$werror" = "yes" ; then
402 CFLAGS
="$CFLAGS -Werror"
405 if test "$solaris" = "no" ; then
406 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
407 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
412 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
413 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
416 sparc
) if test -z "$sparc_cpu" ; then
417 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
420 ARCH_CFLAGS
="${SP_CFLAGS}"
421 ARCH_LDFLAGS
="${SP_LDFLAGS}"
424 sparc64
) if test -z "$sparc_cpu" ; then
425 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
428 ARCH_CFLAGS
="${SP_CFLAGS}"
429 ARCH_LDFLAGS
="${SP_LDFLAGS}"
433 ARCH_CFLAGS
="-march=z900"
445 if test x
"$show_help" = x
"yes" ; then
448 Usage: configure [options]
449 Options: [defaults in brackets after descriptions]
452 echo "Standard options:"
453 echo " --help print this message"
454 echo " --prefix=PREFIX install in PREFIX [$prefix]"
455 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
456 echo " use %M for cpu name [$interp_prefix]"
457 echo " --target-list=LIST set target list [$target_list]"
459 echo "kqemu kernel acceleration support:"
460 echo " --disable-kqemu disable kqemu support"
462 echo "Advanced options (experts only):"
463 echo " --source-path=PATH path of source code [$source_path]"
464 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
465 echo " --cc=CC use C compiler CC [$cc]"
466 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
467 echo " --make=MAKE use specified make [$make]"
468 echo " --install=INSTALL use specified install [$install]"
469 echo " --static enable static build [$static]"
470 echo " --enable-sparse enable sparse checker"
471 echo " --disable-sparse disable sparse checker (default)"
472 echo " --disable-werror disable compilation abort on warning"
473 echo " --disable-sdl disable SDL"
474 echo " --enable-cocoa enable COCOA (Mac OS X only)"
475 echo " --audio-drv-list=LIST set audio drivers list:"
476 echo " Available drivers: $audio_possible_drivers"
477 echo " --audio-card-list=LIST set list of additional emulated audio cards"
478 echo " Available cards: ac97 adlib cs4231a gus"
479 echo " --enable-mixemu enable mixer emulation"
480 echo " --disable-brlapi disable BrlAPI"
481 echo " --disable-vnc-tls disable TLS encryption for VNC server"
482 echo " --disable-curses disable curses output"
483 echo " --disable-bluez disable bluez stack connectivity"
484 echo " --disable-kvm disable KVM acceleration support"
485 echo " --disable-nptl disable usermode NPTL support"
486 echo " --enable-system enable all system emulation targets"
487 echo " --disable-system disable all system emulation targets"
488 echo " --enable-linux-user enable all linux usermode emulation targets"
489 echo " --disable-linux-user disable all linux usermode emulation targets"
490 echo " --enable-darwin-user enable all darwin usermode emulation targets"
491 echo " --disable-darwin-user disable all darwin usermode emulation targets"
492 echo " --enable-bsd-user enable all BSD usermode emulation targets"
493 echo " --disable-bsd-user disable all BSD usermode emulation targets"
494 echo " --fmod-lib path to FMOD library"
495 echo " --fmod-inc path to FMOD includes"
496 echo " --oss-lib path to OSS library"
497 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
498 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
499 echo " --disable-vde disable support for vde network"
500 echo " --disable-aio disable AIO support"
501 echo " --disable-blobs disable installing provided firmware blobs"
502 echo " --kerneldir=PATH look for kernel includes in PATH"
503 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
505 echo "NOTE: The object files are built at the place where configure is launched"
509 cc
="${cross_prefix}${cc}"
510 ar="${cross_prefix}${ar}"
511 strip
="${cross_prefix}${strip}"
513 # check that the C compiler works.
518 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
519 : C compiler works ok
521 echo "ERROR: \"$cc\" either does not exist or does not work"
525 # check compiler to see if we're on mingw32
534 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
538 if test "$mingw32" = "yes" ; then
546 if test ! -x "$(which cgcc 2>/dev/null)"; then
551 # Solaris specific configure tool chain decisions
553 if test "$solaris" = "yes" ; then
554 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
555 if test -z "$solinst" ; then
556 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
557 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
558 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
561 if test "$solinst" = "/usr/sbin/install" ; then
562 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
563 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
564 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
567 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
568 if test -z "$sol_ar" ; then
569 echo "Error: No path includes ar"
570 if test -f /usr
/ccs
/bin
/ar ; then
571 echo "Add /usr/ccs/bin to your path and rerun configure"
578 if test -z "$target_list" ; then
579 # these targets are portable
580 if [ "$softmmu" = "yes" ] ; then
599 # the following are Linux specific
600 if [ "$linux_user" = "yes" ] ; then
601 target_list
="${target_list}\
613 ppc64abi32-linux-user \
618 sparc32plus-linux-user \
621 # the following are Darwin specific
622 if [ "$darwin_user" = "yes" ] ; then
623 target_list
="$target_list i386-darwin-user ppc-darwin-user"
625 # the following are BSD specific
626 if [ "$bsd_user" = "yes" ] ; then
627 target_list
="${target_list}\
632 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
634 if test -z "$target_list" ; then
635 echo "No targets enabled"
639 if test -z "$cross_prefix" ; then
642 # big/little endian test
644 #include <inttypes.h>
645 int main(int argc, char ** argv){
646 volatile uint32_t i=0x01234567;
647 return (*((uint8_t*)(&i))) == 0x67;
651 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
652 $TMPE && bigendian
="yes"
654 echo big
/little
test failed
659 # if cross compiling, cannot launch a program, so make a static guess
660 if test "$cpu" = "armv4b" \
664 -o "$cpu" = "mips64" \
665 -o "$cpu" = "powerpc" \
667 -o "$cpu" = "sparc" \
668 -o "$cpu" = "sparc64"; then
674 # host long bits test
676 if test "$cpu" = "x86_64" \
677 -o "$cpu" = "alpha" \
679 -o "$cpu" = "sparc64"; then
683 # ppc specific hostlongbits selection
684 if test "$cpu" = "powerpc" ; then
685 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
686 grep -q __powerpc64__
$TMPI && hostlongbits
=64
688 echo hostlongbits
test failed
693 # check gcc options support
699 # Check host NPTL support
702 #include <linux/futex.h>
705 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
711 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
717 ##########################################
720 if test "$kvm" = "yes" ; then
722 # test for KVM_CAP_PIT
727 #error "kvm no pit capability"
729 int main(void) { return 0; }
731 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
735 # test for KVM_CAP_DEVICE_ASSIGNMENT
739 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
740 #error "kvm no device assignment capability"
742 int main(void) { return 0; }
744 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
745 kvm_cap_device_assignment
="yes"
749 ##########################################
754 int main(void) { zlibVersion(); return 0; }
756 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
760 echo "Error: zlib check failed"
761 echo "Make sure to have the zlib libs and headers installed."
766 ##########################################
771 if test -z "$sdl" ; then
772 sdl_config
="sdl-config"
778 #undef main /* We don't want SDL to override our main() */
779 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
781 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
782 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
783 if test "$_sdlversion" -lt 121 ; then
786 if test "$cocoa" = "no" ; then
791 # static link with sdl ?
792 if test "$sdl" = "yes" ; then
794 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
795 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
796 if [ "$aa" = "yes" ] ; then
797 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
800 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
804 fi # sdl compile test
806 # Make sure to disable cocoa if sdl was set
807 if test "$sdl" = "yes" ; then
809 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
813 ##########################################
815 if test "$vnc_tls" = "yes" ; then
817 #include <gnutls/gnutls.h>
818 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
820 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
821 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
822 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
823 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
830 ##########################################
831 # vde libraries probe
832 if test "$vde" = "yes" ; then
834 #include <libvdeplug.h>
837 struct vde_open_args a = {0, 0, 0};
838 vde_open("", "", &a);
842 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
849 ##########################################
850 # Sound support libraries probe
861 int main(void) { $exp }
863 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
867 echo "Error: $drv check failed"
868 echo "Make sure to have the $drv libs and headers installed."
874 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
875 for drv
in $audio_drv_list; do
878 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
879 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
883 if test -z $fmod_lib ||
test -z $fmod_inc; then
885 echo "Error: You must specify path to FMOD library and headers"
886 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
890 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
894 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
898 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
899 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
902 oss|sdl|core|wav|dsound
)
903 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
907 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
909 echo "Error: Unknown driver '$drv' selected"
910 echo "Possible drivers are: $audio_possible_drivers"
918 ##########################################
921 if test -z "$brlapi" ; then
925 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
927 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
929 fi # brlapi compile test
932 ##########################################
935 if test "$curses" = "yes" ; then
939 int main(void) { return curses_version(); }
941 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
946 ##########################################
947 # bluez support probe
948 if test "$bluez" = "yes" ; then
949 `pkg-config bluez` || bluez
="no"
951 if test "$bluez" = "yes" ; then
953 #include <bluetooth/bluetooth.h>
954 int main(void) { return bt_error(0); }
956 bluez_cflags
=`pkg-config --cflags bluez`
957 bluez_libs
=`pkg-config --libs bluez`
958 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
959 $bluez_libs > /dev
/null
2> /dev
/null
; then
966 ##########################################
968 if test "$kvm" = "yes" ; then
970 #include <linux/kvm.h>
971 #if !defined(KVM_API_VERSION) || \
972 KVM_API_VERSION < 12 || \
973 KVM_API_VERSION > 12 || \
974 !defined(KVM_CAP_USER_MEMORY) || \
975 !defined(KVM_CAP_SET_TSS_ADDR) || \
976 !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
977 #error Invalid KVM version
979 int main(void) { return 0; }
981 if test "$kerneldir" != "" ; then
982 kvm_cflags
=-I"$kerneldir"/include
986 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
987 > /dev
/null
2>/dev
/null
; then
994 ##########################################
998 if test "$aio" = "yes" ; then
1001 #include <pthread.h>
1002 int main(void) { pthread_mutex_t lock; return 0; }
1004 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
1010 ##########################################
1013 #include <sys/uio.h>
1014 int main(void) { struct iovec iov; return 0; }
1017 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1021 ##########################################
1023 if test "$fdt" = "yes" ; then
1026 int main(void) { return 0; }
1028 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1033 ##########################################
1038 #include <sys/syscall.h>
1040 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1043 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1047 ##########################################
1052 #include <sys/syscall.h>
1053 int main(void) { return syscall(SYS_eventfd, 0); }
1056 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1060 # Check if tools are available to build documentation.
1061 if [ -x "`which texi2html 2>/dev/null`" ] && \
1062 [ -x "`which pod2man 2>/dev/null`" ]; then
1066 ##########################################
1071 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1075 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1077 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1081 if test "$rt" = "yes" ; then
1082 # Hack, we should have a general purpose LIBS for this sort of thing
1083 AIOLIBS
="$AIOLIBS -lrt"
1086 if test "$mingw32" = "yes" ; then
1087 if test -z "$prefix" ; then
1088 prefix
="c:\\\\Program Files\\\\Qemu"
1095 if test -z "$prefix" ; then
1098 mansuffix
="/share/man"
1099 datasuffix
="/share/qemu"
1100 docsuffix
="/share/doc/qemu"
1104 echo "Install prefix $prefix"
1105 echo "BIOS directory $prefix$datasuffix"
1106 echo "binary directory $prefix$binsuffix"
1107 if test "$mingw32" = "no" ; then
1108 echo "Manual directory $prefix$mansuffix"
1109 echo "ELF interp prefix $interp_prefix"
1111 echo "Source path $source_path"
1112 echo "C compiler $cc"
1113 echo "Host C compiler $host_cc"
1114 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1116 echo "install $install"
1117 echo "host CPU $cpu"
1118 echo "host big endian $bigendian"
1119 echo "target list $target_list"
1120 echo "gprof enabled $gprof"
1121 echo "sparse enabled $sparse"
1122 echo "profiler $profiler"
1123 echo "static build $static"
1124 echo "-Werror enabled $werror"
1125 if test "$darwin" = "yes" ; then
1126 echo "Cocoa support $cocoa"
1128 echo "SDL support $sdl"
1129 if test "$sdl" != "no" ; then
1130 echo "SDL static link $sdl_static"
1132 echo "curses support $curses"
1133 echo "mingw32 support $mingw32"
1134 echo "Audio drivers $audio_drv_list"
1135 echo "Extra audio cards $audio_card_list"
1136 echo "Mixer emulation $mixemu"
1137 echo "VNC TLS support $vnc_tls"
1138 if test "$vnc_tls" = "yes" ; then
1139 echo " TLS CFLAGS $vnc_tls_cflags"
1140 echo " TLS LIBS $vnc_tls_libs"
1142 if test -n "$sparc_cpu"; then
1143 echo "Target Sparc Arch $sparc_cpu"
1145 echo "kqemu support $kqemu"
1146 echo "kvm support $kvm"
1147 echo "CPU emulation $cpu_emulation"
1148 echo "brlapi support $brlapi"
1149 echo "Documentation $build_docs"
1150 [ ! -z "$uname_release" ] && \
1151 echo "uname -r $uname_release"
1152 echo "NPTL support $nptl"
1153 echo "vde support $vde"
1154 echo "AIO support $aio"
1155 echo "Install blobs $blobs"
1156 echo "KVM support $kvm"
1157 echo "fdt support $fdt"
1159 if test $sdl_too_old = "yes"; then
1160 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1162 if [ -s $TMPSDLLOG ]; then
1163 echo "The error log from compiling the libSDL test is: "
1166 #if test "$sdl_static" = "no"; then
1167 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1169 config_mak
="config-host.mak"
1170 config_h
="config-host.h"
1172 #echo "Creating $config_mak and $config_h"
1174 test -f $config_h && mv $config_h ${config_h}~
1176 echo "# Automatically generated by configure - do not modify" > $config_mak
1177 printf "# Configured with:" >> $config_mak
1178 printf " '%s'" "$0" "$@" >> $config_mak
1180 echo "/* Automatically generated by configure - do not modify */" > $config_h
1182 echo "prefix=$prefix" >> $config_mak
1183 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1184 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1185 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1186 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1187 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1188 echo "MAKE=$make" >> $config_mak
1189 echo "INSTALL=$install" >> $config_mak
1190 echo "CC=$cc" >> $config_mak
1191 echo "HOST_CC=$host_cc" >> $config_mak
1192 echo "AR=$ar" >> $config_mak
1193 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1194 # XXX: only use CFLAGS and LDFLAGS ?
1195 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1196 # compilation of dyngen tool (useful for win32 build on Linux host)
1197 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1198 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1199 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1200 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1201 echo "CFLAGS=$CFLAGS" >> $config_mak
1202 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1203 echo "EXESUF=$EXESUF" >> $config_mak
1204 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1207 echo "ARCH=i386" >> $config_mak
1208 echo "#define HOST_I386 1" >> $config_h
1211 echo "ARCH=x86_64" >> $config_mak
1212 echo "#define HOST_X86_64 1" >> $config_h
1215 echo "ARCH=alpha" >> $config_mak
1216 echo "#define HOST_ALPHA 1" >> $config_h
1219 echo "ARCH=arm" >> $config_mak
1220 echo "#define HOST_ARM 1" >> $config_h
1223 echo "ARCH=arm" >> $config_mak
1224 echo "#define HOST_ARM 1" >> $config_h
1227 echo "ARCH=cris" >> $config_mak
1228 echo "#define HOST_CRIS 1" >> $config_h
1231 echo "ARCH=hppa" >> $config_mak
1232 echo "#define HOST_HPPA 1" >> $config_h
1235 echo "ARCH=ia64" >> $config_mak
1236 echo "#define HOST_IA64 1" >> $config_h
1239 echo "ARCH=m68k" >> $config_mak
1240 echo "#define HOST_M68K 1" >> $config_h
1243 echo "ARCH=mips" >> $config_mak
1244 echo "#define HOST_MIPS 1" >> $config_h
1247 echo "ARCH=mips64" >> $config_mak
1248 echo "#define HOST_MIPS64 1" >> $config_h
1251 if test "$hostlongbits" = "32"; then
1252 echo "ARCH=ppc" >> $config_mak
1253 echo "#define HOST_PPC 1" >> $config_h
1255 echo "ARCH=ppc64" >> $config_mak
1256 echo "#define HOST_PPC64 1" >> $config_h
1260 echo "ARCH=s390" >> $config_mak
1261 echo "#define HOST_S390 1" >> $config_h
1264 echo "ARCH=sparc" >> $config_mak
1265 echo "#define HOST_SPARC 1" >> $config_h
1268 echo "ARCH=sparc64" >> $config_mak
1269 echo "#define HOST_SPARC64 1" >> $config_h
1272 echo "Unsupported CPU = $cpu"
1276 if test "$sparse" = "yes" ; then
1277 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1278 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1279 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1281 if test "$bigendian" = "yes" ; then
1282 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1283 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1285 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1286 if test "$mingw32" = "yes" ; then
1287 echo "CONFIG_WIN32=yes" >> $config_mak
1288 echo "#define CONFIG_WIN32 1" >> $config_h
1291 #include <byteswap.h>
1292 int main(void) { return bswap_32(0); }
1294 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1295 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1298 #include <sys/endian.h>
1299 #include <sys/types.h>
1300 #include <machine/bswap.h>
1301 int main(void) { return bswap32(0); }
1303 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1304 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1308 if [ "$openbsd" = "yes" ] ; then
1309 echo "#define ENOTSUP 4096" >> $config_h
1312 if test "$darwin" = "yes" ; then
1313 echo "CONFIG_DARWIN=yes" >> $config_mak
1314 echo "#define CONFIG_DARWIN 1" >> $config_h
1317 if test "$aix" = "yes" ; then
1318 echo "CONFIG_AIX=yes" >> $config_mak
1319 echo "#define CONFIG_AIX 1" >> $config_h
1322 if test "$solaris" = "yes" ; then
1323 echo "CONFIG_SOLARIS=yes" >> $config_mak
1324 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1325 if test "$needs_libsunmath" = "yes" ; then
1326 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1327 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1330 if test -n "$sparc_cpu"; then
1331 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1332 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1334 if test "$gdbstub" = "yes" ; then
1335 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1336 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1338 if test "$gprof" = "yes" ; then
1339 echo "TARGET_GPROF=yes" >> $config_mak
1340 echo "#define HAVE_GPROF 1" >> $config_h
1342 if test "$static" = "yes" ; then
1343 echo "CONFIG_STATIC=yes" >> $config_mak
1344 echo "#define CONFIG_STATIC 1" >> $config_h
1346 if test $profiler = "yes" ; then
1347 echo "#define CONFIG_PROFILER 1" >> $config_h
1349 if test "$slirp" = "yes" ; then
1350 echo "CONFIG_SLIRP=yes" >> $config_mak
1351 echo "#define CONFIG_SLIRP 1" >> $config_h
1353 if test "$vde" = "yes" ; then
1354 echo "CONFIG_VDE=yes" >> $config_mak
1355 echo "#define CONFIG_VDE 1" >> $config_h
1356 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1358 for card
in $audio_card_list; do
1359 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1360 echo "$def=yes" >> $config_mak
1361 echo "#define $def 1" >> $config_h
1363 echo "#define AUDIO_DRIVERS \\" >> $config_h
1364 for drv
in $audio_drv_list; do
1365 echo " &${drv}_audio_driver, \\" >>$config_h
1366 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1367 echo "$def=yes" >> $config_mak
1368 if test "$drv" = "fmod"; then
1369 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1370 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1371 elif test "$drv" = "oss"; then
1372 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1376 if test "$mixemu" = "yes" ; then
1377 echo "CONFIG_MIXEMU=yes" >> $config_mak
1378 echo "#define CONFIG_MIXEMU 1" >> $config_h
1380 if test "$vnc_tls" = "yes" ; then
1381 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1382 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1383 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1384 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1386 qemu_version
=`head $source_path/VERSION`
1387 echo "VERSION=$qemu_version" >>$config_mak
1388 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1389 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1391 echo "SRC_PATH=$source_path" >> $config_mak
1392 if [ "$source_path_used" = "yes" ]; then
1393 echo "VPATH=$source_path" >> $config_mak
1395 echo "TARGET_DIRS=$target_list" >> $config_mak
1396 if [ "$build_docs" = "yes" ] ; then
1397 echo "BUILD_DOCS=yes" >> $config_mak
1399 if test "$static" = "yes"; then
1404 if test "$sdl1" = "yes" ; then
1405 echo "#define CONFIG_SDL 1" >> $config_h
1406 echo "CONFIG_SDL=yes" >> $config_mak
1407 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1408 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1410 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1412 if [ "${aa}" = "yes" ] ; then
1413 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1415 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1418 if test "$cocoa" = "yes" ; then
1419 echo "#define CONFIG_COCOA 1" >> $config_h
1420 echo "CONFIG_COCOA=yes" >> $config_mak
1422 if test "$curses" = "yes" ; then
1423 echo "#define CONFIG_CURSES 1" >> $config_h
1424 echo "CONFIG_CURSES=yes" >> $config_mak
1425 echo "CURSES_LIBS=-lcurses" >> $config_mak
1427 if test "$brlapi" = "yes" ; then
1428 echo "CONFIG_BRLAPI=yes" >> $config_mak
1429 echo "#define CONFIG_BRLAPI 1" >> $config_h
1430 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1432 if test "$bluez" = "yes" ; then
1433 echo "CONFIG_BLUEZ=yes" >> $config_mak
1434 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1435 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1436 echo "#define CONFIG_BLUEZ 1" >> $config_h
1438 if test "$aio" = "yes" ; then
1439 echo "#define CONFIG_AIO 1" >> $config_h
1440 echo "CONFIG_AIO=yes" >> $config_mak
1442 if test "$blobs" = "yes" ; then
1443 echo "INSTALL_BLOBS=yes" >> $config_mak
1445 if test "$iovec" = "yes" ; then
1446 echo "#define HAVE_IOVEC 1" >> $config_h
1448 if test "$fdt" = "yes" ; then
1449 echo "#define HAVE_FDT 1" >> $config_h
1450 echo "FDT_LIBS=-lfdt" >> $config_mak
1452 if test "$signalfd" = "yes" ; then
1453 echo "#define CONFIG_signalfd 1" >> $config_h
1455 if test "$eventfd" = "yes" ; then
1456 echo "#define CONFIG_eventfd 1" >> $config_h
1459 # XXX: suppress that
1460 if [ "$bsd" = "yes" ] ; then
1461 echo "#define O_LARGEFILE 0" >> $config_h
1462 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1463 echo "#define _BSD 1" >> $config_h
1466 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1471 echo "HOST_USB=linux" >> $config_mak
1474 echo "HOST_USB=bsd" >> $config_mak
1477 echo "HOST_USB=stub" >> $config_mak
1482 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1483 tools
="qemu-img\$(EXESUF) $tools"
1484 if [ "$linux" = "yes" ] ; then
1485 tools
="qemu-nbd\$(EXESUF) $tools"
1488 echo "TOOLS=$tools" >> $config_mak
1490 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1492 for target
in $target_list; do
1493 target_dir
="$target"
1494 config_mak
=$target_dir/config.mak
1495 config_h
=$target_dir/config.h
1496 target_cpu
=`echo $target | cut -d '-' -f 1`
1497 target_bigendian
="no"
1498 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1499 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1500 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1501 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1502 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1503 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1504 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1505 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1506 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1507 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1508 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1509 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1510 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1512 target_user_only
="no"
1513 target_linux_user
="no"
1514 target_darwin_user
="no"
1515 target_bsd_user
="no"
1517 ${target_cpu}-softmmu)
1518 target_softmmu
="yes"
1520 ${target_cpu}-linux-user)
1521 target_user_only
="yes"
1522 target_linux_user
="yes"
1524 ${target_cpu}-darwin-user)
1525 target_user_only
="yes"
1526 target_darwin_user
="yes"
1528 ${target_cpu}-bsd-user)
1529 target_user_only
="yes"
1530 target_bsd_user
="yes"
1533 echo "ERROR: Target '$target' not recognised"
1538 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1539 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1540 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1541 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1542 echo "Note that this will disable all output from the virtual graphics card"
1543 echo "except through VNC or curses."
1547 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1549 test -f $config_h && mv $config_h ${config_h}~
1551 mkdir
-p $target_dir
1552 mkdir
-p $target_dir/fpu
1553 mkdir
-p $target_dir/tcg
1554 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1555 mkdir
-p $target_dir/nwfpe
1559 # don't use ln -sf as not all "ln -sf" over write the file/link
1561 rm -f $target_dir/Makefile
1562 ln -s $source_path/Makefile.target
$target_dir/Makefile
1565 echo "# Automatically generated by configure - do not modify" > $config_mak
1566 echo "/* Automatically generated by configure - do not modify */" > $config_h
1569 echo "include ../config-host.mak" >> $config_mak
1570 echo "#include \"../config-host.h\"" >> $config_h
1575 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1576 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1579 disable_cpu_emulation
() {
1580 if test $cpu_emulation = "no"; then
1581 echo "#define NO_CPU_EMULATION 1" >> $config_h
1582 echo "NO_CPU_EMULATION=1" >> $config_mak
1587 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1588 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1589 echo "#define USE_KVM 1" >> $config_h
1590 echo "USE_KVM=1" >> $config_mak
1591 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1592 if test $kvm_cap_pit = "yes" ; then
1593 echo "USE_KVM_PIT=1" >> $config_mak
1594 echo "#define USE_KVM_PIT 1" >> $config_h
1596 if test $kvm_cap_device_assignment = "yes" ; then
1597 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1598 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1600 disable_cpu_emulation
1604 if [ use_upstream_kvm
= yes ]; then
1606 # Make sure the target and host cpus are compatible
1607 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1608 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "powerpc" \
) -o \
1609 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1610 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1613 # Disable KVM for linux-user
1614 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1620 case "$target_cpu" in
1622 echo "TARGET_ARCH=i386" >> $config_mak
1623 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1624 echo "#define TARGET_I386 1" >> $config_h
1625 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1627 echo "#define USE_KQEMU 1" >> $config_h
1629 if test "$kvm" = "yes" ; then
1630 echo "CONFIG_KVM=yes" >> $config_mak
1631 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1632 echo "#define CONFIG_KVM 1" >> $config_h
1637 echo "TARGET_ARCH=x86_64" >> $config_mak
1638 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1639 echo "#define TARGET_I386 1" >> $config_h
1640 echo "#define TARGET_X86_64 1" >> $config_h
1641 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1643 echo "#define USE_KQEMU 1" >> $config_h
1648 echo "TARGET_ARCH=ia64" >> $config_mak
1649 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1650 echo "#define TARGET_IA64 1" >> $config_h
1652 if [ use_upstream_kvm
= yes ]; then
1653 if test "$kvm" = "yes" ; then
1654 echo "CONFIG_KVM=yes" >> $config_mak
1655 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1656 echo "#define CONFIG_KVM 1" >> $config_h
1661 echo "TARGET_ARCH=alpha" >> $config_mak
1662 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1663 echo "#define TARGET_ALPHA 1" >> $config_h
1666 echo "TARGET_ARCH=arm" >> $config_mak
1667 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1668 echo "#define TARGET_ARM 1" >> $config_h
1671 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1674 echo "TARGET_ARCH=cris" >> $config_mak
1675 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1676 echo "#define TARGET_CRIS 1" >> $config_h
1679 echo "TARGET_ARCH=m68k" >> $config_mak
1680 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1681 echo "#define TARGET_M68K 1" >> $config_h
1683 gdb_xml_files
="cf-core.xml cf-fp.xml"
1686 echo "TARGET_ARCH=mips" >> $config_mak
1687 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1688 echo "#define TARGET_MIPS 1" >> $config_h
1689 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1692 echo "TARGET_ARCH=mipsn32" >> $config_mak
1693 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1694 echo "#define TARGET_MIPS 1" >> $config_h
1695 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1698 echo "TARGET_ARCH=mips64" >> $config_mak
1699 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1700 echo "#define TARGET_MIPS 1" >> $config_h
1701 echo "#define TARGET_MIPS64 1" >> $config_h
1702 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1705 echo "TARGET_ARCH=ppc" >> $config_mak
1706 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1707 echo "#define TARGET_PPC 1" >> $config_h
1710 echo "TARGET_ARCH=ppcemb" >> $config_mak
1711 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1712 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1713 echo "#define TARGET_PPC 1" >> $config_h
1714 echo "#define TARGET_PPCEMB 1" >> $config_h
1715 if test "$kvm" = "yes" ; then
1716 echo "CONFIG_KVM=yes" >> $config_mak
1717 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1718 echo "#define CONFIG_KVM 1" >> $config_h
1722 echo "TARGET_ARCH=ppc64" >> $config_mak
1723 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1724 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1725 echo "#define TARGET_PPC 1" >> $config_h
1726 echo "#define TARGET_PPC64 1" >> $config_h
1729 echo "TARGET_ARCH=ppc64" >> $config_mak
1730 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1731 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1732 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1733 echo "#define TARGET_PPC 1" >> $config_h
1734 echo "#define TARGET_PPC64 1" >> $config_h
1735 echo "#define TARGET_ABI32 1" >> $config_h
1738 echo "TARGET_ARCH=sh4" >> $config_mak
1739 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1740 echo "#define TARGET_SH4 1" >> $config_h
1745 echo "TARGET_ARCH=sparc" >> $config_mak
1746 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1747 echo "#define TARGET_SPARC 1" >> $config_h
1750 echo "TARGET_ARCH=sparc64" >> $config_mak
1751 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1752 echo "#define TARGET_SPARC 1" >> $config_h
1753 echo "#define TARGET_SPARC64 1" >> $config_h
1757 echo "TARGET_ARCH=sparc64" >> $config_mak
1758 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1759 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1760 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1761 echo "#define TARGET_SPARC 1" >> $config_h
1762 echo "#define TARGET_SPARC64 1" >> $config_h
1763 echo "#define TARGET_ABI32 1" >> $config_h
1766 echo "Unsupported target CPU"
1770 if test "$target_bigendian" = "yes" ; then
1771 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1772 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1774 if test "$target_softmmu" = "yes" ; then
1775 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1776 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1778 if test "$target_user_only" = "yes" ; then
1779 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1780 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1782 if test "$target_linux_user" = "yes" ; then
1783 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1784 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1786 if test "$target_darwin_user" = "yes" ; then
1787 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1788 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1791 if test ! -z "$gdb_xml_files" ; then
1792 for x
in $gdb_xml_files; do
1793 list
="$list $source_path/gdb-xml/$x"
1796 echo "TARGET_XML_FILES=$list" >> $config_mak
1798 if test "$target_cpu" = "arm" \
1799 -o "$target_cpu" = "armeb" \
1800 -o "$target_cpu" = "m68k" \
1801 -o "$target_cpu" = "mips" \
1802 -o "$target_cpu" = "mipsel" \
1803 -o "$target_cpu" = "mipsn32" \
1804 -o "$target_cpu" = "mipsn32el" \
1805 -o "$target_cpu" = "mips64" \
1806 -o "$target_cpu" = "mips64el" \
1807 -o "$target_cpu" = "ppc" \
1808 -o "$target_cpu" = "ppc64" \
1809 -o "$target_cpu" = "ppc64abi32" \
1810 -o "$target_cpu" = "ppcemb" \
1811 -o "$target_cpu" = "sparc" \
1812 -o "$target_cpu" = "sparc64" \
1813 -o "$target_cpu" = "sparc32plus"; then
1814 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1815 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1817 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1818 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1819 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1821 if test "$target_user_only" = "yes" \
1822 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1823 echo "#define USE_NPTL 1" >> $config_h
1825 # 32 bit ELF loader in addition to native 64 bit loader?
1826 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1827 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1828 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1830 if test "$target_bsd_user" = "yes" ; then
1831 echo "CONFIG_BSD_USER=yes" >> $config_mak
1832 echo "#define CONFIG_BSD_USER 1" >> $config_h
1835 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1837 done # for target in $targets
1839 # build tree in object directory if source path is different from current one
1840 if test "$source_path_used" = "yes" ; then
1841 DIRS
="tests tests/cris slirp audio"
1842 FILES
="Makefile tests/Makefile"
1843 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1844 FILES
="$FILES tests/test-mmap.c"
1845 for dir
in $DIRS ; do
1848 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1849 for f
in $FILES ; do
1851 ln -s $source_path/$f $f