3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPI
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
22 interp_prefix
="/usr/gnemul/qemu-%M"
27 gcc3_list
="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
38 i386|i486|i586|i686|i86pc|BePC
)
71 "Power Macintosh"|ppc|ppc64
)
122 device_tree_support
=""
129 OS_CFLAGS
="-mno-cygwin"
130 if [ "$cpu" = "i386" ] ; then
133 audio_possible_drivers
="sdl"
137 if [ "$cpu" = "i386" ] ; then
140 audio_possible_drivers
="dsound sdl fmod"
144 audio_possible_drivers
="oss sdl esd pa"
145 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
152 audio_possible_drivers
="oss sdl esd pa"
153 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
161 audio_possible_drivers
="oss sdl esd"
167 audio_possible_drivers
="oss sdl esd"
175 audio_drv_list
="coreaudio"
176 audio_possible_drivers
="coreaudio sdl fmod"
177 OS_CFLAGS
="-mdynamic-no-pic"
178 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
184 needs_libsunmath
="no"
185 solarisrev
=`uname -r | cut -f2 -d.`
186 # have to select again, because `uname -m` returns i86pc
187 # even on an x86_64 box.
188 solariscpu
=`isainfo -k`
189 if test "${solariscpu}" = "amd64" ; then
192 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
193 if test "$solarisrev" -le 9 ; then
194 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
195 needs_libsunmath
="yes"
197 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
198 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
199 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
200 echo "Studio 11 can be downloaded from www.sun.com."
204 if test "$solarisrev" -ge 9 ; then
208 if test -f /usr
/include
/sys
/soundcard.h
; then
211 audio_possible_drivers
="oss sdl"
215 audio_possible_drivers
="oss alsa sdl esd pa"
218 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
220 audio_possible_drivers
="$audio_possible_drivers fmod"
223 if [ "$cpu" = "ia64" ] ; then
229 if [ "$cpu" = "powerpc" ]; then
235 if [ "$bsd" = "yes" ] ; then
236 if [ "$darwin" != "yes" ] ; then
242 source_path
=`dirname "$0"`
243 source_path_used
="no"
245 if [ -z "$source_path" ]; then
248 source_path
=`cd "$source_path"; pwd`
250 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
253 # generate compile errors on warnings for development builds
254 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
259 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
261 --help|
-h) show_help
=yes
263 --prefix=*) prefix
="$optarg"
265 --interp-prefix=*) interp_prefix
="$optarg"
267 --source-path=*) source_path
="$optarg"
268 source_path_used
="yes"
270 --cross-prefix=*) cross_prefix
="$optarg"
275 --host-cc=*) host_cc
="$optarg"
277 --make=*) make="$optarg"
279 --install=*) install="$optarg"
281 --extra-cflags=*) CFLAGS
="$optarg"
283 --extra-ldflags=*) LDFLAGS
="$optarg"
285 --cpu=*) cpu
="$optarg"
287 --target-list=*) target_list
="$optarg"
289 --enable-gprof) gprof
="yes"
291 --static) static
="yes"
293 --disable-sdl) sdl
="no"
295 --fmod-lib=*) fmod_lib
="$optarg"
297 --fmod-inc=*) fmod_inc
="$optarg"
299 --oss-lib=*) oss_lib
="$optarg"
301 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
303 --audio-drv-list=*) audio_drv_list
="$optarg"
305 --enable-sparse) sparse
="yes"
307 --disable-sparse) sparse
="no"
309 --disable-vnc-tls) vnc_tls
="no"
311 --disable-slirp) slirp
="no"
313 --disable-vde) vde
="no"
315 --disable-kqemu) kqemu
="no"
317 --disable-kvm) kvm
="no"
319 --disable-brlapi) brlapi
="no"
321 --disable-bluez) bluez
="no"
323 --enable-profiler) profiler
="yes"
325 --kernel-path=*) kernel_path
="$optarg"
330 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
332 --disable-gfx-check) check_gfx
="no"
334 --disable-gcc-check) check_gcc
="no"
336 --disable-system) softmmu
="no"
338 --enable-system) softmmu
="yes"
340 --disable-linux-user) linux_user
="no"
342 --enable-linux-user) linux_user
="yes"
344 --disable-darwin-user) darwin_user
="no"
346 --enable-darwin-user) darwin_user
="yes"
348 --enable-uname-release=*) uname_release
="$optarg"
353 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
354 target_cpu
="sparc"; cpu
="sparc" ;;
355 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
356 target_cpu
="sparc"; cpu
="sparc" ;;
357 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
358 target_cpu
="sparc64"; cpu
="sparc64" ;;
359 *) echo "undefined SPARC architecture. Exiting";exit 1;;
362 --enable-werror) werror
="yes"
364 --disable-werror) werror
="no"
366 --disable-curses) curses
="no"
368 --disable-nptl) nptl
="no"
370 --enable-mixemu) mixemu
="yes"
372 --disable-aio) aio
="no"
374 --disable-cpu-emulation) cpu_emulation
="no"
376 --disable-libfdt) device_tree_support
="no"
378 *) echo "ERROR: unknown option $opt"; exit 1
383 # default flags for all hosts
384 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
385 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
386 LDFLAGS
="$LDFLAGS -g"
387 if test "$werror" = "yes" ; then
388 CFLAGS
="$CFLAGS -Werror"
391 if ld
--version 2>/dev
/null |
grep -q "GNU ld" ; then
392 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
396 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
397 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
400 sparc
) if test -z "$sparc_cpu" ; then
401 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
404 ARCH_CFLAGS
="${SP_CFLAGS}"
405 ARCH_LDFLAGS
="${SP_LDFLAGS}"
408 sparc64
) if test -z "$sparc_cpu" ; then
409 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
412 ARCH_CFLAGS
="${SP_CFLAGS}"
413 ARCH_LDFLAGS
="${SP_LDFLAGS}"
417 ARCH_CFLAGS
="-march=z900"
429 if test x
"$show_help" = x
"yes" ; then
432 Usage: configure [options]
433 Options: [defaults in brackets after descriptions]
436 echo "Standard options:"
437 echo " --help print this message"
438 echo " --prefix=PREFIX install in PREFIX [$prefix]"
439 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
440 echo " use %M for cpu name [$interp_prefix]"
441 echo " --target-list=LIST set target list [$target_list]"
443 echo "kqemu kernel acceleration support:"
444 echo " --disable-kqemu disable kqemu support"
445 echo " --kernel-path=PATH set the kernel path (configure probes it)"
446 echo " --disable-kvm disable kernel virtual machine support"
448 echo "Advanced options (experts only):"
449 echo " --source-path=PATH path of source code [$source_path]"
450 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
451 echo " --cc=CC use C compiler CC [$cc]"
452 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
453 echo " --make=MAKE use specified make [$make]"
454 echo " --install=INSTALL use specified install [$install]"
455 echo " --static enable static build [$static]"
456 echo " --enable-sparse enable sparse checker"
457 echo " --disable-sparse disable sparse checker (default)"
458 echo " --disable-werror disable compilation abort on warning"
459 echo " --disable-sdl disable SDL"
460 echo " --enable-cocoa enable COCOA (Mac OS X only)"
461 echo " --audio-drv-list=LIST set audio drivers list:"
462 echo " Available drivers: $audio_possible_drivers"
463 echo " --audio-card-list=LIST set list of additional emulated audio cards"
464 echo " Available cards: ac97 adlib cs4231a gus"
465 echo " --enable-mixemu enable mixer emulation"
466 echo " --disable-brlapi disable BrlAPI"
467 echo " --disable-vnc-tls disable TLS encryption for VNC server"
468 echo " --disable-curses disable curses output"
469 echo " --disable-bluez disable bluez stack connectivity"
470 echo " --disable-nptl disable usermode NPTL support"
471 echo " --enable-system enable all system emulation targets"
472 echo " --disable-system disable all system emulation targets"
473 echo " --enable-linux-user enable all linux usermode emulation targets"
474 echo " --disable-linux-user disable all linux usermode emulation targets"
475 echo " --enable-darwin-user enable all darwin usermode emulation targets"
476 echo " --disable-darwin-user disable all darwin usermode emulation targets"
477 echo " --fmod-lib path to FMOD library"
478 echo " --fmod-inc path to FMOD includes"
479 echo " --oss-lib path to OSS library"
480 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
481 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
482 echo " --disable-vde disable support for vde network"
483 echo " --disable-aio disable AIO support"
484 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
485 echo " --disable-libfdt disables use of libfdt support for device tree"
487 echo "NOTE: The object files are built at the place where configure is launched"
491 cc
="${cross_prefix}${cc}"
492 ar="${cross_prefix}${ar}"
493 strip
="${cross_prefix}${strip}"
495 # check that the C compiler works.
500 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
501 : C compiler works ok
503 echo "ERROR: \"$cc\" either does not exist or does not work"
507 # check compiler to see if we're on mingw32
516 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
520 if test "$mingw32" = "yes" ; then
527 if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
529 elif [ "$bsd" = "yes" ]; then
532 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
533 AIOLIBS
="-lrt -lpthread"
536 # Check for gcc4, error if pre-gcc4
537 if test "$check_gcc" = "yes" ; then
542 int main(){return 0;}
544 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
545 echo "WARNING: \"$cc\" looks like gcc 4.x"
547 if test "$gcc3_search" = "yes" ; then
548 echo "Looking for gcc 3.x"
549 for compat_cc
in $gcc3_list ; do
550 if "$cross_prefix$compat_cc" --version 2> /dev
/null | fgrep
'(GCC) 3.' > /dev
/null
2>&1 ; then
551 echo "Found \"$compat_cc\""
552 cc
="$cross_prefix$compat_cc"
553 found_compat_cc
="yes"
557 if test "$found_compat_cc" = "no" ; then
558 echo "gcc 3.x not found!"
561 if test "$found_compat_cc" = "no" ; then
562 echo "QEMU is known to have problems when compiled with gcc 4.x"
563 echo "It is recommended that you use gcc 3.x to build QEMU"
564 echo "To use this compiler anyway, configure with --disable-gcc-check"
570 if test ! -x "$(which cgcc 2>/dev/null)"; then
575 # Solaris specific configure tool chain decisions
577 if test "$solaris" = "yes" ; then
579 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
580 # override the check with --disable-gcc-check
582 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
584 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
585 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
586 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
587 echo "or get the latest patch from SunSolve for gcc"
591 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
592 if test -z "$solinst" ; then
593 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
594 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
595 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
598 if test "$solinst" = "/usr/sbin/install" ; then
599 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
600 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
601 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
604 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
605 if test -z "$sol_ar" ; then
606 echo "Error: No path includes ar"
607 if test -f /usr
/ccs
/bin
/ar ; then
608 echo "Add /usr/ccs/bin to your path and rerun configure"
615 if test -z "$target_list" ; then
616 # these targets are portable
617 if [ "$softmmu" = "yes" ] ; then
636 # the following are Linux specific
637 if [ "$linux_user" = "yes" ] ; then
638 target_list
="${target_list}\
650 ppc64abi32-linux-user \
655 sparc32plus-linux-user \
658 # the following are Darwin specific
659 if [ "$darwin_user" = "yes" ] ; then
660 target_list
="$target_list i386-darwin-user ppc-darwin-user"
663 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
665 if test -z "$target_list" ; then
666 echo "No targets enabled"
670 if test -z "$cross_prefix" ; then
673 # big/little endian test
675 #include <inttypes.h>
676 int main(int argc, char ** argv){
677 volatile uint32_t i=0x01234567;
678 return (*((uint8_t*)(&i))) == 0x67;
682 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
683 $TMPE && bigendian
="yes"
685 echo big
/little
test failed
690 # if cross compiling, cannot launch a program, so make a static guess
691 if test "$cpu" = "armv4b" \
695 -o "$cpu" = "mips64" \
696 -o "$cpu" = "powerpc" \
698 -o "$cpu" = "sparc" \
699 -o "$cpu" = "sparc64"; then
705 # host long bits test
707 if test "$cpu" = "x86_64" \
708 -o "$cpu" = "alpha" \
710 -o "$cpu" = "sparc64"; then
714 # ppc specific hostlongbits selection
715 if test "$cpu" = "powerpc" ; then
716 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
717 grep -q __powerpc64__
$TMPI && hostlongbits
=64
719 echo hostlongbits
test failed
724 # check gcc options support
730 # Check host NPTL support
733 #include <linux/futex.h>
736 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
742 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev
/null
; then
748 ##########################################
751 if test "$kvm" = "yes" ; then
755 #error "kvm no pit capability"
757 int main(void) { return 0; }
759 if $cc $ARCH_CFLAGS $CFLAGS -I"$kernel_path"/include
-o $TMPE ${OS_CFLAGS} $TMPC 2> /dev
/null
; then
764 ##########################################
769 int main(void) { zlibVersion(); return 0; }
771 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev
/null
; then
775 echo "Error: zlib check failed"
776 echo "Make sure to have the zlib libs and headers installed."
781 ##########################################
786 if test -z "$sdl" ; then
787 sdl_config
="sdl-config"
793 #undef main /* We don't want SDL to override our main() */
794 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
796 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp
/qemu-$$
-sdl-config.log
; then
797 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
798 if test "$_sdlversion" -lt 121 ; then
801 if test "$cocoa" = "no" ; then
806 # static link with sdl ?
807 if test "$sdl" = "yes" ; then
809 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
810 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
811 if [ "$aa" = "yes" ] ; then
812 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
815 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
819 fi # sdl compile test
821 # Make sure to disable cocoa if sdl was set
822 if test "$sdl" = "yes" ; then
824 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
828 ##########################################
830 if test "$vnc_tls" = "yes" ; then
832 #include <gnutls/gnutls.h>
833 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
835 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
836 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
837 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
838 $vnc_tls_libs 2> /dev
/null
; then
845 ##########################################
846 # vde libraries probe
847 if test "$vde" = "yes" ; then
849 #include <libvdeplug.h>
852 struct vde_open_args a = {0, 0, 0};
853 vde_open("", "", &a);
857 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev
/null
; then
864 ##########################################
865 # Sound support libraries probe
876 int main(void) { $exp }
878 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev
/null
; then
882 echo "Error: $drv check failed"
883 echo "Make sure to have the $drv libs and headers installed."
889 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
890 for drv
in $audio_drv_list; do
893 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
894 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
898 if test -z $fmod_lib ||
test -z $fmod_inc; then
900 echo "Error: You must specify path to FMOD library and headers"
901 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
905 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
909 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
913 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
914 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
917 oss|sdl|core|wav|dsound
)
918 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
922 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
924 echo "Error: Unknown driver '$drv' selected"
925 echo "Possible drivers are: $audio_possible_drivers"
933 ##########################################
936 if test -z "$brlapi" ; then
940 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
942 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev
/null
; then
944 fi # brlapi compile test
947 ##########################################
950 if test "$curses" = "yes" ; then
954 int main(void) { return curses_version(); }
956 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev
/null
; then
961 ##########################################
962 # bluez support probe
963 if test "$bluez" = "yes" ; then
964 `pkg-config bluez` || bluez
="no"
966 if test "$bluez" = "yes" ; then
968 #include <bluetooth/bluetooth.h>
969 int main(void) { return bt_error(0); }
971 bluez_cflags
=`pkg-config --cflags bluez`
972 bluez_libs
=`pkg-config --libs bluez`
973 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
974 $bluez_libs 2> /dev
/null
; then
981 ##########################################
983 if test "$aio" = "yes" ; then
987 int main(void) { return aio_write(NULL); }
989 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
994 ##########################################
999 #include <sys/syscall.h>
1001 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1004 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1008 ##########################################
1013 #include <sys/syscall.h>
1014 int main(void) { return syscall(SYS_eventfd, 0); }
1017 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1021 # Check if tools are available to build documentation.
1022 if [ -x "`which texi2html 2>/dev/null`" ] && \
1023 [ -x "`which pod2man 2>/dev/null`" ]; then
1027 if test "$mingw32" = "yes" ; then
1028 if test -z "$prefix" ; then
1029 prefix
="/c/Program Files/Qemu"
1036 if test -z "$prefix" ; then
1039 mansuffix
="/share/man"
1040 datasuffix
="/share/qemu"
1041 docsuffix
="/share/doc/qemu"
1045 ######################################
1048 if test -z "$device_tree_support" -a \
1049 "$cpu" = "powerpc"; then
1050 device_tree_support
="no"
1053 /* XXX uncomment later when libfdt is built before this test */
1054 //int main(void) { void *fdt; return fdt_create(fdt, 1024); }
1055 int main (void) {return 0;}
1057 # XXX for now do not try to link to libfdt and just check for header */
1058 # if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC -lfdt 2> /dev/null ; then
1059 if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1060 device_tree_support
="yes"
1063 echo "Error: Could not find libfdt"
1064 echo "Make sure to have the libfdt libs and headers installed."
1070 echo "Install prefix $prefix"
1071 echo "BIOS directory $prefix$datasuffix"
1072 echo "binary directory $prefix$binsuffix"
1073 if test "$mingw32" = "no" ; then
1074 echo "Manual directory $prefix$mansuffix"
1075 echo "ELF interp prefix $interp_prefix"
1077 echo "Source path $source_path"
1078 echo "C compiler $cc"
1079 echo "Host C compiler $host_cc"
1080 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1082 echo "install $install"
1083 echo "host CPU $cpu"
1084 echo "host big endian $bigendian"
1085 echo "target list $target_list"
1086 echo "gprof enabled $gprof"
1087 echo "sparse enabled $sparse"
1088 echo "profiler $profiler"
1089 echo "static build $static"
1090 echo "-Werror enabled $werror"
1091 if test "$darwin" = "yes" ; then
1092 echo "Cocoa support $cocoa"
1094 echo "SDL support $sdl"
1095 if test "$sdl" != "no" ; then
1096 echo "SDL static link $sdl_static"
1098 echo "curses support $curses"
1099 echo "mingw32 support $mingw32"
1100 echo "Audio drivers $audio_drv_list"
1101 echo "Extra audio cards $audio_card_list"
1102 echo "Mixer emulation $mixemu"
1103 echo "VNC TLS support $vnc_tls"
1104 if test "$vnc_tls" = "yes" ; then
1105 echo " TLS CFLAGS $vnc_tls_cflags"
1106 echo " TLS LIBS $vnc_tls_libs"
1108 if test -n "$sparc_cpu"; then
1109 echo "Target Sparc Arch $sparc_cpu"
1111 echo "kqemu support $kqemu"
1112 echo "kvm support $kvm"
1113 echo "CPU emulation $cpu_emulation"
1114 if test $cpu = "powerpc"; then
1115 echo "libfdt support $device_tree_support"
1117 echo "brlapi support $brlapi"
1118 echo "Documentation $build_docs"
1119 [ ! -z "$uname_release" ] && \
1120 echo "uname -r $uname_release"
1121 echo "NPTL support $nptl"
1122 echo "vde support $vde"
1123 echo "AIO support $aio"
1125 if test $sdl_too_old = "yes"; then
1126 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1128 if [ -s /tmp
/qemu-$$
-sdl-config.log
]; then
1129 echo "The error log from compiling the libSDL test is: "
1130 cat /tmp
/qemu-$$
-sdl-config.log
1132 rm -f /tmp
/qemu-$$
-sdl-config.log
1133 #if test "$sdl_static" = "no"; then
1134 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1136 config_mak
="config-host.mak"
1137 config_h
="config-host.h"
1139 #echo "Creating $config_mak and $config_h"
1141 test -f $config_h && mv $config_h ${config_h}~
1143 echo "# Automatically generated by configure - do not modify" > $config_mak
1144 echo "# Configured with: $0 $@" >> $config_mak
1145 echo "/* Automatically generated by configure - do not modify */" > $config_h
1147 echo "prefix=$prefix" >> $config_mak
1148 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1149 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1150 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1151 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1152 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1153 echo "MAKE=$make" >> $config_mak
1154 echo "INSTALL=$install" >> $config_mak
1155 echo "CC=$cc" >> $config_mak
1156 echo "HOST_CC=$host_cc" >> $config_mak
1157 echo "AR=$ar" >> $config_mak
1158 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1159 # XXX: only use CFLAGS and LDFLAGS ?
1160 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1161 # compilation of dyngen tool (useful for win32 build on Linux host)
1162 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1163 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1164 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1165 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1166 echo "CFLAGS=$CFLAGS" >> $config_mak
1167 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1168 echo "EXESUF=$EXESUF" >> $config_mak
1169 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1172 echo "ARCH=i386" >> $config_mak
1173 echo "#define HOST_I386 1" >> $config_h
1176 echo "ARCH=x86_64" >> $config_mak
1177 echo "#define HOST_X86_64 1" >> $config_h
1180 echo "ARCH=alpha" >> $config_mak
1181 echo "#define HOST_ALPHA 1" >> $config_h
1184 echo "ARCH=arm" >> $config_mak
1185 echo "#define HOST_ARM 1" >> $config_h
1188 echo "ARCH=arm" >> $config_mak
1189 echo "#define HOST_ARM 1" >> $config_h
1192 echo "ARCH=cris" >> $config_mak
1193 echo "#define HOST_CRIS 1" >> $config_h
1196 echo "ARCH=hppa" >> $config_mak
1197 echo "#define HOST_HPPA 1" >> $config_h
1200 echo "ARCH=ia64" >> $config_mak
1201 echo "#define HOST_IA64 1" >> $config_h
1204 echo "ARCH=m68k" >> $config_mak
1205 echo "#define HOST_M68K 1" >> $config_h
1208 echo "ARCH=mips" >> $config_mak
1209 echo "#define HOST_MIPS 1" >> $config_h
1212 echo "ARCH=mips64" >> $config_mak
1213 echo "#define HOST_MIPS64 1" >> $config_h
1216 if test "$hostlongbits" = "32"; then
1217 echo "ARCH=ppc" >> $config_mak
1218 echo "#define HOST_PPC 1" >> $config_h
1220 echo "ARCH=ppc64" >> $config_mak
1221 echo "#define HOST_PPC64 1" >> $config_h
1225 echo "ARCH=s390" >> $config_mak
1226 echo "#define HOST_S390 1" >> $config_h
1229 echo "ARCH=sparc" >> $config_mak
1230 echo "#define HOST_SPARC 1" >> $config_h
1233 echo "ARCH=sparc64" >> $config_mak
1234 echo "#define HOST_SPARC64 1" >> $config_h
1237 echo "Unsupported CPU = $cpu"
1241 if test "$sparse" = "yes" ; then
1242 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1243 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1244 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1246 if test "$bigendian" = "yes" ; then
1247 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1248 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1250 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1251 if test "$mingw32" = "yes" ; then
1252 echo "CONFIG_WIN32=yes" >> $config_mak
1253 echo "#define CONFIG_WIN32 1" >> $config_h
1256 #include <byteswap.h>
1257 int main(void) { return bswap_32(0); }
1259 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev
/null
; then
1260 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1264 if [ "$openbsd" = "yes" ] ; then
1265 echo "#define ENOTSUP 4096" >> $config_h
1268 if test "$darwin" = "yes" ; then
1269 echo "CONFIG_DARWIN=yes" >> $config_mak
1270 echo "#define CONFIG_DARWIN 1" >> $config_h
1272 if test "$solaris" = "yes" ; then
1273 echo "CONFIG_SOLARIS=yes" >> $config_mak
1274 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1275 if test "$needs_libsunmath" = "yes" ; then
1276 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1277 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1280 if test -n "$sparc_cpu"; then
1281 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1282 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1284 if test "$gdbstub" = "yes" ; then
1285 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1286 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1288 if test "$gprof" = "yes" ; then
1289 echo "TARGET_GPROF=yes" >> $config_mak
1290 echo "#define HAVE_GPROF 1" >> $config_h
1292 if test "$static" = "yes" ; then
1293 echo "CONFIG_STATIC=yes" >> $config_mak
1294 echo "#define CONFIG_STATIC 1" >> $config_h
1296 if test $profiler = "yes" ; then
1297 echo "#define CONFIG_PROFILER 1" >> $config_h
1299 if test "$slirp" = "yes" ; then
1300 echo "CONFIG_SLIRP=yes" >> $config_mak
1301 echo "#define CONFIG_SLIRP 1" >> $config_h
1303 if test "$vde" = "yes" ; then
1304 echo "CONFIG_VDE=yes" >> $config_mak
1305 echo "#define CONFIG_VDE 1" >> $config_h
1306 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1308 for card
in $audio_card_list; do
1309 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1310 echo "$def=yes" >> $config_mak
1311 echo "#define $def 1" >> $config_h
1313 echo "#define AUDIO_DRIVERS \\" >> $config_h
1314 for drv
in $audio_drv_list; do
1315 echo " &${drv}_audio_driver, \\" >>$config_h
1316 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1317 echo "$def=yes" >> $config_mak
1318 if test "$drv" = "fmod"; then
1319 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1320 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1321 elif test "$drv" = "oss"; then
1322 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1326 if test "$mixemu" = "yes" ; then
1327 echo "CONFIG_MIXEMU=yes" >> $config_mak
1328 echo "#define CONFIG_MIXEMU 1" >> $config_h
1330 if test "$vnc_tls" = "yes" ; then
1331 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1332 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1333 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1334 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1336 qemu_version
=`head $source_path/VERSION`
1337 echo "VERSION=$qemu_version" >>$config_mak
1338 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1339 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1341 echo "SRC_PATH=$source_path" >> $config_mak
1342 if [ "$source_path_used" = "yes" ]; then
1343 echo "VPATH=$source_path" >> $config_mak
1345 echo "TARGET_DIRS=$target_list" >> $config_mak
1346 if [ "$build_docs" = "yes" ] ; then
1347 echo "BUILD_DOCS=yes" >> $config_mak
1349 if test "$static" = "yes"; then
1354 if test "$sdl1" = "yes" ; then
1355 echo "#define CONFIG_SDL 1" >> $config_h
1356 echo "CONFIG_SDL=yes" >> $config_mak
1357 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1358 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1360 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1362 if [ "${aa}" = "yes" ] ; then
1363 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1365 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1368 if test "$cocoa" = "yes" ; then
1369 echo "#define CONFIG_COCOA 1" >> $config_h
1370 echo "CONFIG_COCOA=yes" >> $config_mak
1372 if test "$curses" = "yes" ; then
1373 echo "#define CONFIG_CURSES 1" >> $config_h
1374 echo "CONFIG_CURSES=yes" >> $config_mak
1375 echo "CURSES_LIBS=-lcurses" >> $config_mak
1377 if test "$brlapi" = "yes" ; then
1378 echo "CONFIG_BRLAPI=yes" >> $config_mak
1379 echo "#define CONFIG_BRLAPI 1" >> $config_h
1380 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1382 if test "$bluez" = "yes" ; then
1383 echo "CONFIG_BLUEZ=yes" >> $config_mak
1384 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1385 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1386 echo "#define CONFIG_BLUEZ 1" >> $config_h
1388 if test "$aio" = "yes" ; then
1389 echo "#define CONFIG_AIO 1" >> $config_h
1390 echo "CONFIG_AIO=yes" >> $config_mak
1392 if test "$signalfd" = "yes" ; then
1393 echo "#define CONFIG_signalfd 1" >> $config_h
1395 if test "$eventfd" = "yes" ; then
1396 echo "#define CONFIG_eventfd 1" >> $config_h
1399 # XXX: suppress that
1400 if [ "$bsd" = "yes" ] ; then
1401 echo "#define O_LARGEFILE 0" >> $config_h
1402 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1403 echo "#define _BSD 1" >> $config_h
1406 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1409 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1410 tools
="qemu-img\$(EXESUF) $tools"
1411 if [ "$linux" = "yes" ] ; then
1412 tools
="qemu-nbd\$(EXESUF) $tools"
1415 echo "TOOLS=$tools" >> $config_mak
1417 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1419 for target
in $target_list; do
1420 target_dir
="$target"
1421 config_mak
=$target_dir/config.mak
1422 config_h
=$target_dir/config.h
1423 target_cpu
=`echo $target | cut -d '-' -f 1`
1424 target_bigendian
="no"
1425 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1426 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1427 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1428 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1429 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1430 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1431 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1432 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1433 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1434 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1435 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1436 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1437 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1439 target_user_only
="no"
1440 target_linux_user
="no"
1441 target_darwin_user
="no"
1443 ${target_cpu}-softmmu)
1444 target_softmmu
="yes"
1446 ${target_cpu}-linux-user)
1447 target_user_only
="yes"
1448 target_linux_user
="yes"
1450 ${target_cpu}-darwin-user)
1451 target_user_only
="yes"
1452 target_darwin_user
="yes"
1455 echo "ERROR: Target '$target' not recognised"
1460 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1461 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1462 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1463 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1464 echo "Note that this will disable all output from the virtual graphics card"
1465 echo "except through VNC or curses."
1469 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1471 test -f $config_h && mv $config_h ${config_h}~
1473 mkdir
-p $target_dir
1474 mkdir
-p $target_dir/fpu
1475 mkdir
-p $target_dir/tcg
1476 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
1477 mkdir
-p $target_dir/nwfpe
1481 # don't use ln -sf as not all "ln -sf" over write the file/link
1483 rm -f $target_dir/Makefile
1484 ln -s $source_path/Makefile.target
$target_dir/Makefile
1487 echo "# Automatically generated by configure - do not modify" > $config_mak
1488 echo "/* Automatically generated by configure - do not modify */" > $config_h
1491 echo "include ../config-host.mak" >> $config_mak
1492 echo "#include \"../config-host.h\"" >> $config_h
1497 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1498 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1501 disable_cpu_emulation
() {
1502 if test $cpu_emulation = "no"; then
1503 echo "#define NO_CPU_EMULATION 1" >> $config_h
1504 echo "NO_CPU_EMULATION=1" >> $config_mak
1509 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1510 \
( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \
); then
1511 echo "#define USE_KVM 1" >> $config_h
1512 echo "USE_KVM=1" >> $config_mak
1513 echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak
1514 if test $kvm_cap_pit = "yes" ; then
1515 echo "USE_KVM_PIT=1" >> $config_mak
1516 echo "#define USE_KVM_PIT 1" >> $config_h
1518 disable_cpu_emulation
1522 case "$target_cpu" in
1524 echo "TARGET_ARCH=i386" >> $config_mak
1525 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1526 echo "#define TARGET_I386 1" >> $config_h
1527 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1529 echo "#define USE_KQEMU 1" >> $config_h
1531 gcc3minver
=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1532 if test -n "$gcc3minver" && test $gcc3minver -gt 3
1534 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1536 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1541 echo "TARGET_ARCH=x86_64" >> $config_mak
1542 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1543 echo "#define TARGET_I386 1" >> $config_h
1544 echo "#define TARGET_X86_64 1" >> $config_h
1545 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1547 echo "#define USE_KQEMU 1" >> $config_h
1552 echo "TARGET_ARCH=ia64" >> $config_mak
1553 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1554 echo "#define TARGET_IA64 1" >> $config_h
1558 echo "TARGET_ARCH=alpha" >> $config_mak
1559 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1560 echo "#define TARGET_ALPHA 1" >> $config_h
1563 echo "TARGET_ARCH=arm" >> $config_mak
1564 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1565 echo "#define TARGET_ARM 1" >> $config_h
1568 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1571 echo "TARGET_ARCH=cris" >> $config_mak
1572 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1573 echo "#define TARGET_CRIS 1" >> $config_h
1576 echo "TARGET_ARCH=m68k" >> $config_mak
1577 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1578 echo "#define TARGET_M68K 1" >> $config_h
1580 gdb_xml_files
="cf-core.xml cf-fp.xml"
1583 echo "TARGET_ARCH=mips" >> $config_mak
1584 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1585 echo "#define TARGET_MIPS 1" >> $config_h
1586 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1589 echo "TARGET_ARCH=mipsn32" >> $config_mak
1590 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1591 echo "#define TARGET_MIPS 1" >> $config_h
1592 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1595 echo "TARGET_ARCH=mips64" >> $config_mak
1596 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1597 echo "#define TARGET_MIPS 1" >> $config_h
1598 echo "#define TARGET_MIPS64 1" >> $config_h
1599 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1602 echo "TARGET_ARCH=ppc" >> $config_mak
1603 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1604 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1605 echo "#define TARGET_PPC 1" >> $config_h
1606 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1609 echo "TARGET_ARCH=ppcemb" >> $config_mak
1610 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1611 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1612 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1613 echo "#define TARGET_PPC 1" >> $config_h
1614 echo "#define TARGET_PPCEMB 1" >> $config_h
1615 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1616 if test "$device_tree_support" = "yes" ; then
1617 echo "#define CONFIG_LIBFDT 1" >> $config_h
1618 echo "CONFIG_LIBFDT=1" >> $config_mak
1623 echo "TARGET_ARCH=ppc64" >> $config_mak
1624 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1625 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1626 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1627 echo "#define TARGET_PPC 1" >> $config_h
1628 echo "#define TARGET_PPC64 1" >> $config_h
1629 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1632 echo "TARGET_ARCH=ppc64" >> $config_mak
1633 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1634 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1635 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1636 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1637 echo "#define TARGET_PPC 1" >> $config_h
1638 echo "#define TARGET_PPC64 1" >> $config_h
1639 echo "#define TARGET_ABI32 1" >> $config_h
1640 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1643 echo "TARGET_ARCH=sh4" >> $config_mak
1644 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1645 echo "#define TARGET_SH4 1" >> $config_h
1650 echo "TARGET_ARCH=sparc" >> $config_mak
1651 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1652 echo "#define TARGET_SPARC 1" >> $config_h
1655 echo "TARGET_ARCH=sparc64" >> $config_mak
1656 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1657 echo "#define TARGET_SPARC 1" >> $config_h
1658 echo "#define TARGET_SPARC64 1" >> $config_h
1662 echo "TARGET_ARCH=sparc64" >> $config_mak
1663 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1664 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1665 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1666 echo "#define TARGET_SPARC 1" >> $config_h
1667 echo "#define TARGET_SPARC64 1" >> $config_h
1668 echo "#define TARGET_ABI32 1" >> $config_h
1671 echo "Unsupported target CPU"
1675 if test "$target_bigendian" = "yes" ; then
1676 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1677 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1679 if test "$target_softmmu" = "yes" ; then
1680 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1681 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1683 if test "$target_user_only" = "yes" ; then
1684 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1685 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1687 if test "$target_linux_user" = "yes" ; then
1688 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1689 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1691 if test "$target_darwin_user" = "yes" ; then
1692 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1693 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1696 if test ! -z "$gdb_xml_files" ; then
1697 for x
in $gdb_xml_files; do
1698 list
="$list $source_path/gdb-xml/$x"
1701 echo "TARGET_XML_FILES=$list" >> $config_mak
1703 if test "$target_cpu" = "arm" \
1704 -o "$target_cpu" = "armeb" \
1705 -o "$target_cpu" = "m68k" \
1706 -o "$target_cpu" = "mips" \
1707 -o "$target_cpu" = "mipsel" \
1708 -o "$target_cpu" = "mipsn32" \
1709 -o "$target_cpu" = "mipsn32el" \
1710 -o "$target_cpu" = "mips64" \
1711 -o "$target_cpu" = "mips64el" \
1712 -o "$target_cpu" = "sparc" \
1713 -o "$target_cpu" = "sparc64" \
1714 -o "$target_cpu" = "sparc32plus"; then
1715 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1716 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1718 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1719 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1720 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1722 if test "$target_user_only" = "yes" \
1723 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1724 echo "#define USE_NPTL 1" >> $config_h
1726 # 32 bit ELF loader in addition to native 64 bit loader?
1727 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1728 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1729 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1732 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1734 done # for target in $targets
1736 # build tree in object directory if source path is different from current one
1737 if test "$source_path_used" = "yes" ; then
1738 DIRS
="tests tests/cris slirp audio"
1739 FILES
="Makefile tests/Makefile"
1740 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1741 FILES
="$FILES tests/test-mmap.c"
1742 for dir
in $DIRS ; do
1745 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1746 for f
in $FILES ; do
1748 ln -s $source_path/$f $f
1752 rm -f $TMPO $TMPC $TMPE $TMPS $TMPI