3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
8 elif test ! -z "$TEMPDIR" ; then
14 TMPC
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPI
="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
19 TMPSDLLOG
="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log"
21 trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
25 interp_prefix
="/usr/gnemul/qemu-%M"
37 # parse CC options first
39 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
41 --cross-prefix=*) cross_prefix
="$optarg"
49 # Using uname is really, really broken. Once we have the right set of checks
50 # we can eliminate it's usage altogether
52 cc
="${cross_prefix}${cc}"
53 ar="${cross_prefix}${ar}"
54 strip
="${cross_prefix}${strip}"
56 # check that the C compiler works.
61 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
64 echo "ERROR: \"$cc\" either does not exist or does not work"
73 int main(void) { return 0; }
75 $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
78 if check_define __i386__
; then
80 elif check_define __x86_64__
; then
82 elif check_define __sparc__
; then
83 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
84 # They must be specified using --sparc_cpu
85 if check_define __arch64__
; then
91 cpu
=`test $(uname -s) = AIX && uname -p || uname -m`
96 i386|i486|i586|i686|i86pc|BePC
)
129 "Power Macintosh"|ppc|ppc64|powerpc
)
182 if check_define __linux__
; then
184 elif check_define _WIN32
; then
192 OS_CFLAGS
="-mno-cygwin"
193 if [ "$cpu" = "i386" ] ; then
196 audio_possible_drivers
="sdl"
200 if [ "$cpu" = "i386" ] ; then
203 audio_possible_drivers
="dsound sdl fmod"
207 audio_possible_drivers
="oss sdl esd pa"
208 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
215 audio_possible_drivers
="oss sdl esd pa"
216 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
223 audio_possible_drivers
="oss sdl esd"
230 audio_possible_drivers
="oss sdl esd"
238 audio_drv_list
="coreaudio"
239 audio_possible_drivers
="coreaudio sdl fmod"
240 OS_CFLAGS
="-mdynamic-no-pic"
241 OS_LDFLAGS
="-framework CoreFoundation -framework IOKit"
247 needs_libsunmath
="no"
248 solarisrev
=`uname -r | cut -f2 -d.`
249 # have to select again, because `uname -m` returns i86pc
250 # even on an x86_64 box.
251 solariscpu
=`isainfo -k`
252 if test "${solariscpu}" = "amd64" ; then
255 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
256 if test "$solarisrev" -le 9 ; then
257 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
258 needs_libsunmath
="yes"
260 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
261 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
262 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
263 echo "Studio 11 can be downloaded from www.sun.com."
267 if test "$solarisrev" -ge 9 ; then
271 if test -f /usr
/include
/sys
/soundcard.h
; then
274 audio_possible_drivers
="oss sdl"
282 audio_possible_drivers
="oss alsa sdl esd pa"
286 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
288 audio_possible_drivers
="$audio_possible_drivers fmod"
293 if [ "$bsd" = "yes" ] ; then
294 if [ "$darwin" != "yes" ] ; then
302 source_path
=`dirname "$0"`
303 source_path_used
="no"
305 if [ -z "$source_path" ]; then
308 source_path
=`cd "$source_path"; pwd`
310 [ -f "$workdir/vl.c" ] || source_path_used
="yes"
313 # generate compile errors on warnings for development builds
314 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
319 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
321 --help|
-h) show_help
=yes
323 --prefix=*) prefix
="$optarg"
325 --interp-prefix=*) interp_prefix
="$optarg"
327 --source-path=*) source_path
="$optarg"
328 source_path_used
="yes"
334 --host-cc=*) host_cc
="$optarg"
336 --make=*) make="$optarg"
338 --install=*) install="$optarg"
340 --extra-cflags=*) CFLAGS
="$optarg"
342 --extra-ldflags=*) LDFLAGS
="$optarg"
344 --cpu=*) cpu
="$optarg"
346 --target-list=*) target_list
="$optarg"
348 --enable-gprof) gprof
="yes"
350 --static) static
="yes"
352 --disable-sdl) sdl
="no"
354 --fmod-lib=*) fmod_lib
="$optarg"
356 --fmod-inc=*) fmod_inc
="$optarg"
358 --oss-lib=*) oss_lib
="$optarg"
360 --audio-card-list=*) audio_card_list
=`echo "$optarg" | sed -e 's/,/ /g'`
362 --audio-drv-list=*) audio_drv_list
="$optarg"
364 --enable-sparse) sparse
="yes"
366 --disable-sparse) sparse
="no"
368 --disable-vnc-tls) vnc_tls
="no"
370 --disable-slirp) slirp
="no"
372 --disable-vde) vde
="no"
374 --disable-kqemu) kqemu
="no"
376 --disable-brlapi) brlapi
="no"
378 --disable-bluez) bluez
="no"
380 --disable-kvm) kvm
="no"
382 --enable-profiler) profiler
="yes"
387 audio_drv_list
="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
389 --disable-gfx-check) check_gfx
="no"
391 --disable-system) softmmu
="no"
393 --enable-system) softmmu
="yes"
395 --disable-linux-user) linux_user
="no"
397 --enable-linux-user) linux_user
="yes"
399 --disable-darwin-user) darwin_user
="no"
401 --enable-darwin-user) darwin_user
="yes"
403 --disable-bsd-user) bsd_user
="no"
405 --enable-bsd-user) bsd_user
="yes"
407 --enable-uname-release=*) uname_release
="$optarg"
412 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
413 target_cpu
="sparc"; cpu
="sparc" ;;
414 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
415 target_cpu
="sparc"; cpu
="sparc" ;;
416 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
417 target_cpu
="sparc64"; cpu
="sparc64" ;;
418 *) echo "undefined SPARC architecture. Exiting";exit 1;;
421 --enable-werror) werror
="yes"
423 --disable-werror) werror
="no"
425 --disable-curses) curses
="no"
427 --disable-nptl) nptl
="no"
429 --enable-mixemu) mixemu
="yes"
431 --disable-aio) aio
="no"
433 --disable-blobs) blobs
="no"
435 --kerneldir=*) kerneldir
="$optarg"
437 *) echo "ERROR: unknown option $opt"; show_help
="yes"
442 # default flags for all hosts
443 CFLAGS
="$CFLAGS -O2 -g -fno-strict-aliasing"
444 CFLAGS
="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
445 LDFLAGS
="$LDFLAGS -g"
446 if test "$werror" = "yes" ; then
447 CFLAGS
="$CFLAGS -Werror"
450 if test "$solaris" = "no" ; then
451 if ld
--version 2>/dev
/null |
grep "GNU ld" >/dev
/null
2>/dev
/null
; then
452 LDFLAGS
="$LDFLAGS -Wl,--warn-common"
457 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
458 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
461 sparc
) if test -z "$sparc_cpu" ; then
462 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
465 ARCH_CFLAGS
="${SP_CFLAGS}"
466 ARCH_LDFLAGS
="${SP_LDFLAGS}"
469 sparc64
) if test -z "$sparc_cpu" ; then
470 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
473 ARCH_CFLAGS
="${SP_CFLAGS}"
474 ARCH_LDFLAGS
="${SP_LDFLAGS}"
478 ARCH_CFLAGS
="-march=z900"
490 if test x
"$show_help" = x
"yes" ; then
493 Usage: configure [options]
494 Options: [defaults in brackets after descriptions]
497 echo "Standard options:"
498 echo " --help print this message"
499 echo " --prefix=PREFIX install in PREFIX [$prefix]"
500 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
501 echo " use %M for cpu name [$interp_prefix]"
502 echo " --target-list=LIST set target list [$target_list]"
504 echo "kqemu kernel acceleration support:"
505 echo " --disable-kqemu disable kqemu support"
507 echo "Advanced options (experts only):"
508 echo " --source-path=PATH path of source code [$source_path]"
509 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
510 echo " --cc=CC use C compiler CC [$cc]"
511 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
512 echo " --make=MAKE use specified make [$make]"
513 echo " --install=INSTALL use specified install [$install]"
514 echo " --static enable static build [$static]"
515 echo " --enable-sparse enable sparse checker"
516 echo " --disable-sparse disable sparse checker (default)"
517 echo " --disable-werror disable compilation abort on warning"
518 echo " --disable-sdl disable SDL"
519 echo " --enable-cocoa enable COCOA (Mac OS X only)"
520 echo " --audio-drv-list=LIST set audio drivers list:"
521 echo " Available drivers: $audio_possible_drivers"
522 echo " --audio-card-list=LIST set list of additional emulated audio cards"
523 echo " Available cards: ac97 adlib cs4231a gus"
524 echo " --enable-mixemu enable mixer emulation"
525 echo " --disable-brlapi disable BrlAPI"
526 echo " --disable-vnc-tls disable TLS encryption for VNC server"
527 echo " --disable-curses disable curses output"
528 echo " --disable-bluez disable bluez stack connectivity"
529 echo " --disable-kvm disable KVM acceleration support"
530 echo " --disable-nptl disable usermode NPTL support"
531 echo " --enable-system enable all system emulation targets"
532 echo " --disable-system disable all system emulation targets"
533 echo " --enable-linux-user enable all linux usermode emulation targets"
534 echo " --disable-linux-user disable all linux usermode emulation targets"
535 echo " --enable-darwin-user enable all darwin usermode emulation targets"
536 echo " --disable-darwin-user disable all darwin usermode emulation targets"
537 echo " --enable-bsd-user enable all BSD usermode emulation targets"
538 echo " --disable-bsd-user disable all BSD usermode emulation targets"
539 echo " --fmod-lib path to FMOD library"
540 echo " --fmod-inc path to FMOD includes"
541 echo " --oss-lib path to OSS library"
542 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
543 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
544 echo " --disable-vde disable support for vde network"
545 echo " --disable-aio disable AIO support"
546 echo " --disable-blobs disable installing provided firmware blobs"
547 echo " --kerneldir=PATH look for kernel includes in PATH"
549 echo "NOTE: The object files are built at the place where configure is launched"
553 if test "$mingw32" = "yes" ; then
561 if test ! -x "$(which cgcc 2>/dev/null)"; then
566 # Solaris specific configure tool chain decisions
568 if test "$solaris" = "yes" ; then
569 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
570 if test -z "$solinst" ; then
571 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
572 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
573 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
576 if test "$solinst" = "/usr/sbin/install" ; then
577 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
578 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
579 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
582 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
583 if test -z "$sol_ar" ; then
584 echo "Error: No path includes ar"
585 if test -f /usr
/ccs
/bin
/ar ; then
586 echo "Add /usr/ccs/bin to your path and rerun configure"
593 if test -z "$target_list" ; then
594 # these targets are portable
595 if [ "$softmmu" = "yes" ] ; then
614 # the following are Linux specific
615 if [ "$linux_user" = "yes" ] ; then
616 target_list
="${target_list}\
628 ppc64abi32-linux-user \
633 sparc32plus-linux-user \
636 # the following are Darwin specific
637 if [ "$darwin_user" = "yes" ] ; then
638 target_list
="$target_list i386-darwin-user ppc-darwin-user "
640 # the following are BSD specific
641 if [ "$bsd_user" = "yes" ] ; then
642 target_list
="${target_list}\
647 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
649 if test -z "$target_list" ; then
650 echo "No targets enabled"
654 if test -z "$cross_prefix" ; then
657 # big/little endian test
659 #include <inttypes.h>
660 int main(int argc, char ** argv){
661 volatile uint32_t i=0x01234567;
662 return (*((uint8_t*)(&i))) == 0x67;
666 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
667 $TMPE && bigendian
="yes"
669 echo big
/little
test failed
674 # if cross compiling, cannot launch a program, so make a static guess
675 if test "$cpu" = "armv4b" \
679 -o "$cpu" = "mips64" \
680 -o "$cpu" = "powerpc" \
682 -o "$cpu" = "sparc" \
683 -o "$cpu" = "sparc64"; then
689 # host long bits test
691 if test "$cpu" = "x86_64" \
692 -o "$cpu" = "alpha" \
694 -o "$cpu" = "sparc64"; then
698 # ppc specific hostlongbits selection
699 if test "$cpu" = "powerpc" ; then
700 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev
/null
</dev
/null
; then
701 grep -q __powerpc64__
$TMPI && hostlongbits
=64
703 echo hostlongbits
test failed
708 # check gcc options support
714 # Check host NPTL support
717 #include <linux/futex.h>
720 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
726 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev
/null
2> /dev
/null
; then
732 ##########################################
737 int main(void) { zlibVersion(); return 0; }
739 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev
/null
2> /dev
/null
; then
743 echo "Error: zlib check failed"
744 echo "Make sure to have the zlib libs and headers installed."
749 ##########################################
754 if test -z "$sdl" ; then
755 sdl_config
="sdl-config"
761 #undef main /* We don't want SDL to override our main() */
762 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
764 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
765 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
766 if test "$_sdlversion" -lt 121 ; then
769 if test "$cocoa" = "no" ; then
774 # static link with sdl ?
775 if test "$sdl" = "yes" ; then
777 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
778 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
779 if [ "$aa" = "yes" ] ; then
780 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
783 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev
/null
2> /dev
/null
; then
787 fi # sdl compile test
789 # Make sure to disable cocoa if sdl was set
790 if test "$sdl" = "yes" ; then
792 audio_drv_list
="`echo $audio_drv_list | sed s,coreaudio,,g`"
796 ##########################################
798 if test "$vnc_tls" = "yes" ; then
800 #include <gnutls/gnutls.h>
801 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
803 vnc_tls_cflags
=`pkg-config --cflags gnutls 2> /dev/null`
804 vnc_tls_libs
=`pkg-config --libs gnutls 2> /dev/null`
805 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
806 $vnc_tls_libs > /dev
/null
2> /dev
/null
; then
813 ##########################################
814 # vde libraries probe
815 if test "$vde" = "yes" ; then
817 #include <libvdeplug.h>
820 struct vde_open_args a = {0, 0, 0};
821 vde_open("", "", &a);
825 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev
/null
2> /dev
/null
; then
832 ##########################################
833 # Sound support libraries probe
844 int main(void) { $exp }
846 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev
/null
2> /dev
/null
; then
850 echo "Error: $drv check failed"
851 echo "Make sure to have the $drv libs and headers installed."
857 audio_drv_list
=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
858 for drv
in $audio_drv_list; do
861 audio_drv_probe
$drv alsa
/asoundlib.h
-lasound \
862 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
866 if test -z $fmod_lib ||
test -z $fmod_inc; then
868 echo "Error: You must specify path to FMOD library and headers"
869 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
873 audio_drv_probe
$drv fmod.h
$fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
877 audio_drv_probe
$drv esd.h
-lesd 'return esd_play_stream(0, 0, "", 0);'
881 audio_drv_probe
$drv pulse
/simple.h
-lpulse-simple \
882 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
885 oss|sdl|core|wav|dsound
)
886 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
890 echo "$audio_possible_drivers" |
grep -q "\<$drv\>" ||
{
892 echo "Error: Unknown driver '$drv' selected"
893 echo "Possible drivers are: $audio_possible_drivers"
901 ##########################################
904 if test -z "$brlapi" ; then
908 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
910 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev
/null
2> /dev
/null
; then
912 fi # brlapi compile test
915 ##########################################
918 if test "$curses" = "yes" ; then
922 int main(void) { return curses_version(); }
924 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev
/null
2> /dev
/null
; then
929 ##########################################
930 # bluez support probe
931 if test "$bluez" = "yes" ; then
932 `pkg-config bluez` || bluez
="no"
934 if test "$bluez" = "yes" ; then
936 #include <bluetooth/bluetooth.h>
937 int main(void) { return bt_error(0); }
939 bluez_cflags
=`pkg-config --cflags bluez`
940 bluez_libs
=`pkg-config --libs bluez`
941 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
942 $bluez_libs > /dev
/null
2> /dev
/null
; then
949 ##########################################
951 if test "$kvm" = "yes" ; then
953 #include <linux/kvm.h>
954 #if !defined(KVM_API_VERSION) || \
955 KVM_API_VERSION < 12 || \
956 KVM_API_VERSION > 12 || \
957 !defined(KVM_CAP_USER_MEMORY) || \
958 !defined(KVM_CAP_SET_TSS_ADDR) || \
959 !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
960 #error Invalid KVM version
962 int main(void) { return 0; }
964 if test "$kerneldir" != "" ; then
965 kvm_cflags
=-I"$kerneldir"/include
969 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
970 > /dev
/null
2>/dev
/null
; then
977 ##########################################
981 if test "$aio" = "yes" ; then
985 int main(void) { pthread_mutex_t lock; return 0; }
987 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev
/null
; then
993 ##########################################
997 int main(void) { struct iovec iov; return 0; }
1000 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1004 ##########################################
1006 if test "$fdt" = "yes" ; then
1009 int main(void) { return 0; }
1011 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev
/null
; then
1016 # Check if tools are available to build documentation.
1017 if [ -x "`which texi2html 2>/dev/null`" ] && \
1018 [ -x "`which pod2man 2>/dev/null`" ]; then
1022 ##########################################
1027 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1031 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev
/null
2> /dev
/null
; then
1033 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev
/null
2> /dev
/null
; then
1037 if test "$rt" = "yes" ; then
1038 # Hack, we should have a general purpose LIBS for this sort of thing
1039 AIOLIBS
="$AIOLIBS -lrt"
1042 if test "$mingw32" = "yes" ; then
1043 if test -z "$prefix" ; then
1044 prefix
="c:\\\\Program Files\\\\Qemu"
1051 if test -z "$prefix" ; then
1054 mansuffix
="/share/man"
1055 datasuffix
="/share/qemu"
1056 docsuffix
="/share/doc/qemu"
1060 echo "Install prefix $prefix"
1061 echo "BIOS directory $prefix$datasuffix"
1062 echo "binary directory $prefix$binsuffix"
1063 if test "$mingw32" = "no" ; then
1064 echo "Manual directory $prefix$mansuffix"
1065 echo "ELF interp prefix $interp_prefix"
1067 echo "Source path $source_path"
1068 echo "C compiler $cc"
1069 echo "Host C compiler $host_cc"
1070 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1072 echo "install $install"
1073 echo "host CPU $cpu"
1074 echo "host big endian $bigendian"
1075 echo "target list $target_list"
1076 echo "gprof enabled $gprof"
1077 echo "sparse enabled $sparse"
1078 echo "profiler $profiler"
1079 echo "static build $static"
1080 echo "-Werror enabled $werror"
1081 if test "$darwin" = "yes" ; then
1082 echo "Cocoa support $cocoa"
1084 echo "SDL support $sdl"
1085 if test "$sdl" != "no" ; then
1086 echo "SDL static link $sdl_static"
1088 echo "curses support $curses"
1089 echo "mingw32 support $mingw32"
1090 echo "Audio drivers $audio_drv_list"
1091 echo "Extra audio cards $audio_card_list"
1092 echo "Mixer emulation $mixemu"
1093 echo "VNC TLS support $vnc_tls"
1094 if test "$vnc_tls" = "yes" ; then
1095 echo " TLS CFLAGS $vnc_tls_cflags"
1096 echo " TLS LIBS $vnc_tls_libs"
1098 if test -n "$sparc_cpu"; then
1099 echo "Target Sparc Arch $sparc_cpu"
1101 echo "kqemu support $kqemu"
1102 echo "brlapi support $brlapi"
1103 echo "Documentation $build_docs"
1104 [ ! -z "$uname_release" ] && \
1105 echo "uname -r $uname_release"
1106 echo "NPTL support $nptl"
1107 echo "vde support $vde"
1108 echo "AIO support $aio"
1109 echo "Install blobs $blobs"
1110 echo "KVM support $kvm"
1111 echo "fdt support $fdt"
1113 if test $sdl_too_old = "yes"; then
1114 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1116 if [ -s $TMPSDLLOG ]; then
1117 echo "The error log from compiling the libSDL test is: "
1120 #if test "$sdl_static" = "no"; then
1121 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1123 config_mak
="config-host.mak"
1124 config_h
="config-host.h"
1126 #echo "Creating $config_mak and $config_h"
1128 test -f $config_h && mv $config_h ${config_h}~
1130 echo "# Automatically generated by configure - do not modify" > $config_mak
1131 printf "# Configured with:" >> $config_mak
1132 printf " '%s'" "$0" "$@" >> $config_mak
1134 echo "/* Automatically generated by configure - do not modify */" > $config_h
1136 echo "prefix=$prefix" >> $config_mak
1137 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1138 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1139 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1140 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1141 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1142 echo "MAKE=$make" >> $config_mak
1143 echo "INSTALL=$install" >> $config_mak
1144 echo "CC=$cc" >> $config_mak
1145 echo "HOST_CC=$host_cc" >> $config_mak
1146 echo "AR=$ar" >> $config_mak
1147 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1148 # XXX: only use CFLAGS and LDFLAGS ?
1149 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1150 # compilation of dyngen tool (useful for win32 build on Linux host)
1151 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1152 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1153 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1154 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1155 echo "CFLAGS=$CFLAGS" >> $config_mak
1156 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1157 echo "EXESUF=$EXESUF" >> $config_mak
1158 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1161 echo "ARCH=i386" >> $config_mak
1162 echo "#define HOST_I386 1" >> $config_h
1165 echo "ARCH=x86_64" >> $config_mak
1166 echo "#define HOST_X86_64 1" >> $config_h
1169 echo "ARCH=alpha" >> $config_mak
1170 echo "#define HOST_ALPHA 1" >> $config_h
1173 echo "ARCH=arm" >> $config_mak
1174 echo "#define HOST_ARM 1" >> $config_h
1177 echo "ARCH=arm" >> $config_mak
1178 echo "#define HOST_ARM 1" >> $config_h
1181 echo "ARCH=cris" >> $config_mak
1182 echo "#define HOST_CRIS 1" >> $config_h
1185 echo "ARCH=hppa" >> $config_mak
1186 echo "#define HOST_HPPA 1" >> $config_h
1189 echo "ARCH=ia64" >> $config_mak
1190 echo "#define HOST_IA64 1" >> $config_h
1193 echo "ARCH=m68k" >> $config_mak
1194 echo "#define HOST_M68K 1" >> $config_h
1197 echo "ARCH=mips" >> $config_mak
1198 echo "#define HOST_MIPS 1" >> $config_h
1201 echo "ARCH=mips64" >> $config_mak
1202 echo "#define HOST_MIPS64 1" >> $config_h
1205 if test "$hostlongbits" = "32"; then
1206 echo "ARCH=ppc" >> $config_mak
1207 echo "#define HOST_PPC 1" >> $config_h
1209 echo "ARCH=ppc64" >> $config_mak
1210 echo "#define HOST_PPC64 1" >> $config_h
1214 echo "ARCH=s390" >> $config_mak
1215 echo "#define HOST_S390 1" >> $config_h
1218 echo "ARCH=sparc" >> $config_mak
1219 echo "#define HOST_SPARC 1" >> $config_h
1222 echo "ARCH=sparc64" >> $config_mak
1223 echo "#define HOST_SPARC64 1" >> $config_h
1226 echo "Unsupported CPU = $cpu"
1230 if test "$sparse" = "yes" ; then
1231 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1232 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1233 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1235 if test "$bigendian" = "yes" ; then
1236 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1237 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1239 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1240 if test "$mingw32" = "yes" ; then
1241 echo "CONFIG_WIN32=yes" >> $config_mak
1242 echo "#define CONFIG_WIN32 1" >> $config_h
1245 #include <byteswap.h>
1246 int main(void) { return bswap_32(0); }
1248 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1249 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1252 #include <sys/endian.h>
1253 #include <sys/types.h>
1254 #include <machine/bswap.h>
1255 int main(void) { return bswap32(0); }
1257 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev
/null
2> /dev
/null
; then
1258 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1262 if [ "$openbsd" = "yes" ] ; then
1263 echo "#define ENOTSUP 4096" >> $config_h
1266 if test "$darwin" = "yes" ; then
1267 echo "CONFIG_DARWIN=yes" >> $config_mak
1268 echo "#define CONFIG_DARWIN 1" >> $config_h
1271 if test "$aix" = "yes" ; then
1272 echo "CONFIG_AIX=yes" >> $config_mak
1273 echo "#define CONFIG_AIX 1" >> $config_h
1276 if test "$solaris" = "yes" ; then
1277 echo "CONFIG_SOLARIS=yes" >> $config_mak
1278 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1279 if test "$needs_libsunmath" = "yes" ; then
1280 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1281 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1284 if test -n "$sparc_cpu"; then
1285 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1286 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1288 if test "$gdbstub" = "yes" ; then
1289 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1290 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1292 if test "$gprof" = "yes" ; then
1293 echo "TARGET_GPROF=yes" >> $config_mak
1294 echo "#define HAVE_GPROF 1" >> $config_h
1296 if test "$static" = "yes" ; then
1297 echo "CONFIG_STATIC=yes" >> $config_mak
1298 echo "#define CONFIG_STATIC 1" >> $config_h
1300 if test $profiler = "yes" ; then
1301 echo "#define CONFIG_PROFILER 1" >> $config_h
1303 if test "$slirp" = "yes" ; then
1304 echo "CONFIG_SLIRP=yes" >> $config_mak
1305 echo "#define CONFIG_SLIRP 1" >> $config_h
1307 if test "$vde" = "yes" ; then
1308 echo "CONFIG_VDE=yes" >> $config_mak
1309 echo "#define CONFIG_VDE 1" >> $config_h
1310 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1312 for card
in $audio_card_list; do
1313 def
=CONFIG_
`echo $card | tr '[:lower:]' '[:upper:]'`
1314 echo "$def=yes" >> $config_mak
1315 echo "#define $def 1" >> $config_h
1317 echo "#define AUDIO_DRIVERS \\" >> $config_h
1318 for drv
in $audio_drv_list; do
1319 echo " &${drv}_audio_driver, \\" >>$config_h
1320 def
=CONFIG_
`echo $drv | tr '[:lower:]' '[:upper:]'`
1321 echo "$def=yes" >> $config_mak
1322 if test "$drv" = "fmod"; then
1323 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1324 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1325 elif test "$drv" = "oss"; then
1326 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1330 if test "$mixemu" = "yes" ; then
1331 echo "CONFIG_MIXEMU=yes" >> $config_mak
1332 echo "#define CONFIG_MIXEMU 1" >> $config_h
1334 if test "$vnc_tls" = "yes" ; then
1335 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1336 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1337 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1338 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1340 qemu_version
=`head $source_path/VERSION`
1341 echo "VERSION=$qemu_version" >>$config_mak
1342 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1344 echo "SRC_PATH=$source_path" >> $config_mak
1345 if [ "$source_path_used" = "yes" ]; then
1346 echo "VPATH=$source_path" >> $config_mak
1348 echo "TARGET_DIRS=$target_list" >> $config_mak
1349 if [ "$build_docs" = "yes" ] ; then
1350 echo "BUILD_DOCS=yes" >> $config_mak
1352 if test "$static" = "yes"; then
1357 if test "$sdl1" = "yes" ; then
1358 echo "#define CONFIG_SDL 1" >> $config_h
1359 echo "CONFIG_SDL=yes" >> $config_mak
1360 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1361 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1363 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1365 if [ "${aa}" = "yes" ] ; then
1366 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1368 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1371 if test "$cocoa" = "yes" ; then
1372 echo "#define CONFIG_COCOA 1" >> $config_h
1373 echo "CONFIG_COCOA=yes" >> $config_mak
1375 if test "$curses" = "yes" ; then
1376 echo "#define CONFIG_CURSES 1" >> $config_h
1377 echo "CONFIG_CURSES=yes" >> $config_mak
1378 echo "CURSES_LIBS=-lcurses" >> $config_mak
1380 if test "$brlapi" = "yes" ; then
1381 echo "CONFIG_BRLAPI=yes" >> $config_mak
1382 echo "#define CONFIG_BRLAPI 1" >> $config_h
1383 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1385 if test "$bluez" = "yes" ; then
1386 echo "CONFIG_BLUEZ=yes" >> $config_mak
1387 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1388 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1389 echo "#define CONFIG_BLUEZ 1" >> $config_h
1391 if test "$aio" = "yes" ; then
1392 echo "#define CONFIG_AIO 1" >> $config_h
1393 echo "CONFIG_AIO=yes" >> $config_mak
1395 if test "$blobs" = "yes" ; then
1396 echo "INSTALL_BLOBS=yes" >> $config_mak
1398 if test "$iovec" = "yes" ; then
1399 echo "#define HAVE_IOVEC 1" >> $config_h
1401 if test "$fdt" = "yes" ; then
1402 echo "#define HAVE_FDT 1" >> $config_h
1403 echo "FDT_LIBS=-lfdt" >> $config_mak
1406 # XXX: suppress that
1407 if [ "$bsd" = "yes" ] ; then
1408 echo "#define O_LARGEFILE 0" >> $config_h
1409 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1410 echo "#define _BSD 1" >> $config_h
1413 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1418 echo "HOST_USB=linux" >> $config_mak
1421 echo "HOST_USB=bsd" >> $config_mak
1424 echo "HOST_USB=stub" >> $config_mak
1429 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1430 tools
="qemu-img\$(EXESUF) $tools"
1431 if [ "$linux" = "yes" ] ; then
1432 tools
="qemu-nbd\$(EXESUF) $tools"
1435 echo "TOOLS=$tools" >> $config_mak
1437 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1439 for target
in $target_list; do
1440 target_dir
="$target"
1441 config_mak
=$target_dir/config.mak
1442 config_h
=$target_dir/config.h
1443 target_cpu
=`echo $target | cut -d '-' -f 1`
1444 target_bigendian
="no"
1445 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
1446 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
1447 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
1448 [ "$target_cpu" = "mipsn32" ] && target_bigendian
=yes
1449 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
1450 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
1451 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
1452 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
1453 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian
=yes
1454 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
1455 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
1456 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
1457 [ "$target_cpu" = "sparc32plus" ] && target_bigendian
=yes
1459 target_user_only
="no"
1460 target_linux_user
="no"
1461 target_darwin_user
="no"
1462 target_bsd_user
="no"
1464 ${target_cpu}-softmmu)
1465 target_softmmu
="yes"
1467 ${target_cpu}-linux-user)
1468 target_user_only
="yes"
1469 target_linux_user
="yes"
1471 ${target_cpu}-darwin-user)
1472 target_user_only
="yes"
1473 target_darwin_user
="yes"
1475 ${target_cpu}-bsd-user)
1476 target_user_only
="yes"
1477 target_bsd_user
="yes"
1480 echo "ERROR: Target '$target' not recognised"
1485 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1486 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1487 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1488 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1489 echo "Note that this will disable all output from the virtual graphics card"
1490 echo "except through VNC or curses."
1494 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1496 test -f $config_h && mv $config_h ${config_h}~
1498 mkdir
-p $target_dir
1499 mkdir
-p $target_dir/fpu
1500 mkdir
-p $target_dir/tcg
1501 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1502 mkdir
-p $target_dir/nwfpe
1506 # don't use ln -sf as not all "ln -sf" over write the file/link
1508 rm -f $target_dir/Makefile
1509 ln -s $source_path/Makefile.target
$target_dir/Makefile
1512 echo "# Automatically generated by configure - do not modify" > $config_mak
1513 echo "/* Automatically generated by configure - do not modify */" > $config_h
1516 echo "include ../config-host.mak" >> $config_mak
1517 echo "#include \"../config-host.h\"" >> $config_h
1522 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1523 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1526 # Make sure the target and host cpus are compatible
1527 if test "$kvm" = "yes" -a ! \
( "$target_cpu" = "$cpu" -o \
1528 \
( "$target_cpu" = "ppcemb" -a "$cpu" = "powerpc" \
) -o \
1529 \
( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \
) -o \
1530 \
( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \
) \
) ; then
1533 # Disable KVM for linux-user
1534 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1538 case "$target_cpu" in
1540 echo "TARGET_ARCH=i386" >> $config_mak
1541 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1542 echo "#define TARGET_I386 1" >> $config_h
1543 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1545 echo "#define USE_KQEMU 1" >> $config_h
1547 if test "$kvm" = "yes" ; then
1548 echo "CONFIG_KVM=yes" >> $config_mak
1549 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1550 echo "#define CONFIG_KVM 1" >> $config_h
1554 echo "TARGET_ARCH=x86_64" >> $config_mak
1555 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1556 echo "#define TARGET_I386 1" >> $config_h
1557 echo "#define TARGET_X86_64 1" >> $config_h
1558 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1560 echo "#define USE_KQEMU 1" >> $config_h
1562 if test "$kvm" = "yes" ; then
1563 echo "CONFIG_KVM=yes" >> $config_mak
1564 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1565 echo "#define CONFIG_KVM 1" >> $config_h
1569 echo "TARGET_ARCH=alpha" >> $config_mak
1570 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1571 echo "#define TARGET_ALPHA 1" >> $config_h
1574 echo "TARGET_ARCH=arm" >> $config_mak
1575 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1576 echo "#define TARGET_ARM 1" >> $config_h
1579 gdb_xml_files
="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1582 echo "TARGET_ARCH=cris" >> $config_mak
1583 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1584 echo "#define TARGET_CRIS 1" >> $config_h
1587 echo "TARGET_ARCH=m68k" >> $config_mak
1588 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1589 echo "#define TARGET_M68K 1" >> $config_h
1591 gdb_xml_files
="cf-core.xml cf-fp.xml"
1594 echo "TARGET_ARCH=mips" >> $config_mak
1595 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1596 echo "#define TARGET_MIPS 1" >> $config_h
1597 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1600 echo "TARGET_ARCH=mipsn32" >> $config_mak
1601 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1602 echo "#define TARGET_MIPS 1" >> $config_h
1603 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1606 echo "TARGET_ARCH=mips64" >> $config_mak
1607 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1608 echo "#define TARGET_MIPS 1" >> $config_h
1609 echo "#define TARGET_MIPS64 1" >> $config_h
1610 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1613 echo "TARGET_ARCH=ppc" >> $config_mak
1614 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1615 echo "#define TARGET_PPC 1" >> $config_h
1618 echo "TARGET_ARCH=ppcemb" >> $config_mak
1619 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1620 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1621 echo "#define TARGET_PPC 1" >> $config_h
1622 echo "#define TARGET_PPCEMB 1" >> $config_h
1623 if test "$kvm" = "yes" ; then
1624 echo "CONFIG_KVM=yes" >> $config_mak
1625 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1626 echo "#define CONFIG_KVM 1" >> $config_h
1630 echo "TARGET_ARCH=ppc64" >> $config_mak
1631 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1632 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1633 echo "#define TARGET_PPC 1" >> $config_h
1634 echo "#define TARGET_PPC64 1" >> $config_h
1637 echo "TARGET_ARCH=ppc64" >> $config_mak
1638 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1639 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1640 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1641 echo "#define TARGET_PPC 1" >> $config_h
1642 echo "#define TARGET_PPC64 1" >> $config_h
1643 echo "#define TARGET_ABI32 1" >> $config_h
1646 echo "TARGET_ARCH=sh4" >> $config_mak
1647 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1648 echo "#define TARGET_SH4 1" >> $config_h
1653 echo "TARGET_ARCH=sparc" >> $config_mak
1654 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1655 echo "#define TARGET_SPARC 1" >> $config_h
1658 echo "TARGET_ARCH=sparc64" >> $config_mak
1659 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1660 echo "#define TARGET_SPARC 1" >> $config_h
1661 echo "#define TARGET_SPARC64 1" >> $config_h
1665 echo "TARGET_ARCH=sparc64" >> $config_mak
1666 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1667 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1668 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1669 echo "#define TARGET_SPARC 1" >> $config_h
1670 echo "#define TARGET_SPARC64 1" >> $config_h
1671 echo "#define TARGET_ABI32 1" >> $config_h
1674 echo "Unsupported target CPU"
1678 if test "$target_bigendian" = "yes" ; then
1679 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1680 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1682 if test "$target_softmmu" = "yes" ; then
1683 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1684 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1686 if test "$target_user_only" = "yes" ; then
1687 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1688 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1690 if test "$target_linux_user" = "yes" ; then
1691 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1692 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1694 if test "$target_darwin_user" = "yes" ; then
1695 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1696 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1699 if test ! -z "$gdb_xml_files" ; then
1700 for x
in $gdb_xml_files; do
1701 list
="$list $source_path/gdb-xml/$x"
1704 echo "TARGET_XML_FILES=$list" >> $config_mak
1706 if test "$target_cpu" = "arm" \
1707 -o "$target_cpu" = "armeb" \
1708 -o "$target_cpu" = "m68k" \
1709 -o "$target_cpu" = "mips" \
1710 -o "$target_cpu" = "mipsel" \
1711 -o "$target_cpu" = "mipsn32" \
1712 -o "$target_cpu" = "mipsn32el" \
1713 -o "$target_cpu" = "mips64" \
1714 -o "$target_cpu" = "mips64el" \
1715 -o "$target_cpu" = "ppc" \
1716 -o "$target_cpu" = "ppc64" \
1717 -o "$target_cpu" = "ppc64abi32" \
1718 -o "$target_cpu" = "ppcemb" \
1719 -o "$target_cpu" = "sparc" \
1720 -o "$target_cpu" = "sparc64" \
1721 -o "$target_cpu" = "sparc32plus"; then
1722 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1723 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1725 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1726 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1727 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1729 if test "$target_user_only" = "yes" \
1730 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1731 echo "#define USE_NPTL 1" >> $config_h
1733 # 32 bit ELF loader in addition to native 64 bit loader?
1734 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1735 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1736 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1738 if test "$target_bsd_user" = "yes" ; then
1739 echo "CONFIG_BSD_USER=yes" >> $config_mak
1740 echo "#define CONFIG_BSD_USER 1" >> $config_h
1743 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~
$config_h
1745 done # for target in $targets
1747 # build tree in object directory if source path is different from current one
1748 if test "$source_path_used" = "yes" ; then
1749 DIRS
="tests tests/cris slirp audio"
1750 FILES
="Makefile tests/Makefile"
1751 FILES
="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1752 FILES
="$FILES tests/test-mmap.c"
1753 for dir
in $DIRS ; do
1756 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1757 for f
in $FILES ; do
1759 ln -s $source_path/$f $f