397
533
echo " --make=MAKE use specified make [$make]"
398
534
echo " --install=INSTALL use specified install [$install]"
399
535
echo " --static enable static build [$static]"
536
echo " --enable-sparse enable sparse checker"
537
echo " --disable-sparse disable sparse checker (default)"
400
538
echo " --disable-werror disable compilation abort on warning"
401
539
echo " --disable-sdl disable SDL"
402
540
echo " --enable-cocoa enable COCOA (Mac OS X only)"
403
echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
404
echo " --enable-adlib enable Adlib emulation"
405
echo " --enable-coreaudio enable Coreaudio audio driver"
406
echo " --enable-alsa enable ALSA audio driver"
407
echo " --enable-fmod enable FMOD audio driver"
408
echo " --enable-dsound enable DirectSound audio driver"
541
echo " --audio-drv-list=LIST set audio drivers list:"
542
echo " Available drivers: $audio_possible_drivers"
543
echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
544
echo " Available cards: $audio_possible_cards"
545
echo " --enable-mixemu enable mixer emulation"
546
echo " --disable-brlapi disable BrlAPI"
409
547
echo " --disable-vnc-tls disable TLS encryption for VNC server"
548
echo " --disable-curses disable curses output"
549
echo " --disable-bluez disable bluez stack connectivity"
550
echo " --disable-kvm disable KVM acceleration support"
551
echo " --disable-nptl disable usermode NPTL support"
410
552
echo " --enable-system enable all system emulation targets"
411
553
echo " --disable-system disable all system emulation targets"
412
554
echo " --enable-linux-user enable all linux usermode emulation targets"
413
555
echo " --disable-linux-user disable all linux usermode emulation targets"
414
556
echo " --enable-darwin-user enable all darwin usermode emulation targets"
415
557
echo " --disable-darwin-user disable all darwin usermode emulation targets"
558
echo " --enable-bsd-user enable all BSD usermode emulation targets"
559
echo " --disable-bsd-user disable all BSD usermode emulation targets"
416
560
echo " --fmod-lib path to FMOD library"
417
561
echo " --fmod-inc path to FMOD includes"
562
echo " --oss-lib path to OSS library"
418
563
echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
419
564
echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
565
echo " --disable-vde disable support for vde network"
566
echo " --disable-aio disable AIO support"
567
echo " --disable-blobs disable installing provided firmware blobs"
568
echo " --kerneldir=PATH look for kernel includes in PATH"
421
570
echo "NOTE: The object files are built at the place where configure is launched"
425
cc="${cross_prefix}${cc}"
426
ar="${cross_prefix}${ar}"
427
strip="${cross_prefix}${strip}"
429
# check that the C compiler works.
434
if $cc -c -o $TMPO $TMPC 2> /dev/null ; then
435
: C compiler works ok
437
echo "ERROR: \"$cc\" either does not exist or does not work"
441
574
if test "$mingw32" = "yes" ; then
447
# Check for gcc4, error if pre-gcc4
448
if test "$check_gcc" = "yes" ; then
453
int main(){return 0;}
455
if "$cc" -o $TMPE $TMPC 2> /dev/null ; then
456
echo "WARNING: \"$cc\" looks like gcc 4.x"
458
if test "$gcc3_search" = "yes" ; then
459
echo "Looking for gcc 3.x"
460
for compat_cc in $gcc3_list ; do
461
if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
462
echo "Found \"$compat_cc\""
463
cc="$cross_prefix$compat_cc"
464
found_compat_cc="yes"
468
if test "$found_compat_cc" = "no" ; then
469
echo "gcc 3.x not found!"
472
if test "$found_compat_cc" = "no" ; then
473
echo "QEMU is known to have problems when compiled with gcc 4.x"
474
echo "It is recommended that you use gcc 3.x to build QEMU"
475
echo "To use this compiler anyway, configure with --disable-gcc-check"
582
if test ! -x "$(which cgcc 2>/dev/null)"; then
482
587
# Solaris specific configure tool chain decisions
484
589
if test "$solaris" = "yes" ; then
486
# gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
487
# override the check with --disable-gcc-check
489
if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
491
if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
492
echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
493
echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
494
echo "or get the latest patch from SunSolve for gcc"
498
590
solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
499
591
if test -z "$solinst" ; then
500
592
echo "Solaris install program not found. Use --install=/usr/ucb/install or"
592
if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
593
# win32 cross compilation case
594
sdl_config="i386-mingw32msvc-sdl-config"
598
772
cat > $TMPC << EOF
600
774
#undef main /* We don't want SDL to override our main() */
601
775
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
603
if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
604
_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
605
if test "$_sdlversion" -lt 121 ; then
608
if test "$cocoa" = "no" ; then
613
# static link with sdl ?
614
if test "$sdl" = "yes" ; then
616
`$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
617
sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
618
if [ "$aa" = "yes" ] ; then
619
sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
622
if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
626
fi # sdl compile test
627
fi # cross compilation
777
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
778
_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
779
if test "$_sdlversion" -lt 121 ; then
782
if test "$cocoa" = "no" ; then
787
# static link with sdl ?
788
if test "$sdl" = "yes" ; then
790
`$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
791
sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
792
if [ "$aa" = "yes" ] ; then
793
sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
796
if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
800
fi # sdl compile test
629
802
# Make sure to disable cocoa if sdl was set
630
803
if test "$sdl" = "yes" ; then
805
audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
809
if test "$sdl" = "yes" ; then
812
#if defined(SDL_VIDEO_DRIVER_X11)
813
#include <X11/XKBlib.h>
815
#error No x11 support
817
int main(void) { return 0; }
819
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then
636
824
##########################################
637
825
# VNC TLS detection
638
826
if test "$vnc_tls" = "yes" ; then
639
`pkg-config gnutls` || vnc_tls="no"
641
if test "$vnc_tls" = "yes" ; then
642
vnc_tls_cflags=`pkg-config --cflags gnutls`
643
vnc_tls_libs=`pkg-config --libs gnutls`
646
##########################################
647
# alsa sound support libraries
649
if test "$alsa" = "yes" ; then
651
#include <alsa/asoundlib.h>
652
int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
654
if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then
658
echo "Error: Could not find alsa"
659
echo "Make sure to have the alsa libs and headers installed."
828
#include <gnutls/gnutls.h>
829
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
831
vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
832
vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
833
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
834
$vnc_tls_libs > /dev/null 2> /dev/null ; then
841
##########################################
842
# vde libraries probe
843
if test "$vde" = "yes" ; then
845
#include <libvdeplug.h>
848
struct vde_open_args a = {0, 0, 0};
849
vde_open("", "", &a);
853
if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
860
##########################################
861
# Sound support libraries probe
872
int main(void) { $exp }
874
if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
878
echo "Error: $drv check failed"
879
echo "Make sure to have the $drv libs and headers installed."
885
audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
886
for drv in $audio_drv_list; do
889
audio_drv_probe $drv alsa/asoundlib.h -lasound \
890
"snd_pcm_t **handle; return snd_pcm_close(*handle);"
894
if test -z $fmod_lib || test -z $fmod_inc; then
896
echo "Error: You must specify path to FMOD library and headers"
897
echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
901
audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
905
audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
909
audio_drv_probe $drv pulse/simple.h -lpulse-simple \
910
"pa_simple *s = NULL; pa_simple_free(s); return 0;"
913
oss|sdl|core|wav|dsound)
914
# XXX: Probes for CoreAudio, DirectSound, SDL(?)
918
echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
920
echo "Error: Unknown driver '$drv' selected"
921
echo "Possible drivers are: $audio_possible_drivers"
929
##########################################
932
if test -z "$brlapi" ; then
936
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
938
if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
940
fi # brlapi compile test
943
##########################################
946
if test "$curses" = "yes" ; then
950
int main(void) { return curses_version(); }
952
if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
957
##########################################
958
# bluez support probe
959
if test "$bluez" = "yes" ; then
960
`pkg-config bluez` || bluez="no"
962
if test "$bluez" = "yes" ; then
964
#include <bluetooth/bluetooth.h>
965
int main(void) { return bt_error(0); }
967
bluez_cflags=`pkg-config --cflags bluez`
968
bluez_libs=`pkg-config --libs bluez`
969
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
970
$bluez_libs > /dev/null 2> /dev/null ; then
977
##########################################
979
if test "$kvm" = "yes" ; then
981
#include <linux/kvm.h>
982
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
983
#error Invalid KVM version
985
#if !defined(KVM_CAP_USER_MEMORY)
986
#error Missing KVM capability KVM_CAP_USER_MEMORY
988
#if !defined(KVM_CAP_SET_TSS_ADDR)
989
#error Missing KVM capability KVM_CAP_SET_TSS_ADDR
991
#if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
992
#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
994
int main(void) { return 0; }
996
if test "$kerneldir" != "" ; then
997
kvm_cflags=-I"$kerneldir"/include
998
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
999
-a -d "$kerneldir/arch/x86/include" ; then
1000
kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1001
elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1002
kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1003
elif test -d "$kerneldir/arch/$cpu/include" ; then
1004
kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1009
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1010
> /dev/null 2>/dev/null ; then
1014
if [ -x "`which awk 2>/dev/null`" ] && \
1015
[ -x "`which grep 2>/dev/null`" ]; then
1016
kvmerr=`$cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1018
| awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1019
if test "$kvmerr" != "" ; then
1020
kvm="no - (${kvmerr})"
1026
##########################################
1030
if test "$aio" = "yes" ; then
1033
#include <pthread.h>
1034
int main(void) { pthread_mutex_t lock; return 0; }
1036
if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1042
##########################################
1045
#include <sys/types.h>
1046
#include <sys/uio.h>
1048
int main(void) { struct iovec iov; return 0; }
1051
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1055
##########################################
1057
if test "$fdt" = "yes" ; then
1060
int main(void) { return 0; }
1062
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
778
1196
echo "HOST_CC=$host_cc" >> $config_mak
779
1197
echo "AR=$ar" >> $config_mak
780
1198
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1199
# XXX: only use CFLAGS and LDFLAGS ?
1200
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1201
# compilation of dyngen tool (useful for win32 build on Linux host)
781
1202
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
782
1203
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
783
echo "VL_OS_LDFLAGS=$VL_OS_LDFLAGS" >> $config_mak
784
1204
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
785
1205
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
786
1206
echo "CFLAGS=$CFLAGS" >> $config_mak
787
1207
echo "LDFLAGS=$LDFLAGS" >> $config_mak
788
1208
echo "EXESUF=$EXESUF" >> $config_mak
789
1209
echo "AIOLIBS=$AIOLIBS" >> $config_mak
790
if test "$cpu" = "i386" ; then
791
echo "ARCH=i386" >> $config_mak
792
echo "#define HOST_I386 1" >> $config_h
793
elif test "$cpu" = "x86_64" ; then
794
echo "ARCH=x86_64" >> $config_mak
795
echo "#define HOST_X86_64 1" >> $config_h
796
elif test "$cpu" = "armv4b" ; then
797
echo "ARCH=arm" >> $config_mak
798
echo "#define HOST_ARM 1" >> $config_h
799
elif test "$cpu" = "armv4l" ; then
800
echo "ARCH=arm" >> $config_mak
801
echo "#define HOST_ARM 1" >> $config_h
802
elif test "$cpu" = "powerpc" ; then
803
echo "ARCH=ppc" >> $config_mak
804
echo "#define HOST_PPC 1" >> $config_h
805
elif test "$cpu" = "mips" ; then
806
echo "ARCH=mips" >> $config_mak
807
echo "#define HOST_MIPS 1" >> $config_h
808
elif test "$cpu" = "mips64" ; then
809
echo "ARCH=mips64" >> $config_mak
810
echo "#define HOST_MIPS64 1" >> $config_h
811
elif test "$cpu" = "cris" ; then
812
echo "ARCH=cris" >> $config_mak
813
echo "#define HOST_CRIS 1" >> $config_h
814
elif test "$cpu" = "s390" ; then
815
echo "ARCH=s390" >> $config_mak
816
echo "#define HOST_S390 1" >> $config_h
817
elif test "$cpu" = "alpha" ; then
818
echo "ARCH=alpha" >> $config_mak
819
echo "#define HOST_ALPHA 1" >> $config_h
820
elif test "$cpu" = "sparc" ; then
821
echo "ARCH=sparc" >> $config_mak
822
echo "#define HOST_SPARC 1" >> $config_h
823
elif test "$cpu" = "sparc64" ; then
824
echo "ARCH=sparc64" >> $config_mak
825
echo "#define HOST_SPARC64 1" >> $config_h
826
elif test "$cpu" = "ia64" ; then
827
echo "ARCH=ia64" >> $config_mak
828
echo "#define HOST_IA64 1" >> $config_h
829
elif test "$cpu" = "m68k" ; then
830
echo "ARCH=m68k" >> $config_mak
831
echo "#define HOST_M68K 1" >> $config_h
833
echo "Unsupported CPU = $cpu"
1212
echo "ARCH=i386" >> $config_mak
1213
echo "#define HOST_I386 1" >> $config_h
1216
echo "ARCH=x86_64" >> $config_mak
1217
echo "#define HOST_X86_64 1" >> $config_h
1220
echo "ARCH=alpha" >> $config_mak
1221
echo "#define HOST_ALPHA 1" >> $config_h
1224
echo "ARCH=arm" >> $config_mak
1225
echo "#define HOST_ARM 1" >> $config_h
1228
echo "ARCH=arm" >> $config_mak
1229
echo "#define HOST_ARM 1" >> $config_h
1232
echo "ARCH=cris" >> $config_mak
1233
echo "#define HOST_CRIS 1" >> $config_h
1236
echo "ARCH=hppa" >> $config_mak
1237
echo "#define HOST_HPPA 1" >> $config_h
1240
echo "ARCH=ia64" >> $config_mak
1241
echo "#define HOST_IA64 1" >> $config_h
1244
echo "ARCH=m68k" >> $config_mak
1245
echo "#define HOST_M68K 1" >> $config_h
1248
echo "ARCH=mips" >> $config_mak
1249
echo "#define HOST_MIPS 1" >> $config_h
1252
echo "ARCH=mips64" >> $config_mak
1253
echo "#define HOST_MIPS64 1" >> $config_h
1256
echo "ARCH=ppc" >> $config_mak
1257
echo "#define HOST_PPC 1" >> $config_h
1260
echo "ARCH=ppc64" >> $config_mak
1261
echo "#define HOST_PPC64 1" >> $config_h
1264
echo "ARCH=s390" >> $config_mak
1265
echo "#define HOST_S390 1" >> $config_h
1268
echo "ARCH=sparc" >> $config_mak
1269
echo "#define HOST_SPARC 1" >> $config_h
1272
echo "ARCH=sparc64" >> $config_mak
1273
echo "#define HOST_SPARC64 1" >> $config_h
1276
echo "Unsupported CPU = $cpu"
1280
if test "$sparse" = "yes" ; then
1281
echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1282
echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1283
echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
836
1285
if test "$bigendian" = "yes" ; then
837
1286
echo "WORDS_BIGENDIAN=yes" >> $config_mak
885
1354
echo "CONFIG_SLIRP=yes" >> $config_mak
886
1355
echo "#define CONFIG_SLIRP 1" >> $config_h
888
if test "$adlib" = "yes" ; then
889
echo "CONFIG_ADLIB=yes" >> $config_mak
890
echo "#define CONFIG_ADLIB 1" >> $config_h
892
if test "$oss" = "yes" ; then
893
echo "CONFIG_OSS=yes" >> $config_mak
894
echo "#define CONFIG_OSS 1" >> $config_h
896
if test "$coreaudio" = "yes" ; then
897
echo "CONFIG_COREAUDIO=yes" >> $config_mak
898
echo "#define CONFIG_COREAUDIO 1" >> $config_h
900
if test "$alsa" = "yes" ; then
901
echo "CONFIG_ALSA=yes" >> $config_mak
902
echo "#define CONFIG_ALSA 1" >> $config_h
904
if test "$dsound" = "yes" ; then
905
echo "CONFIG_DSOUND=yes" >> $config_mak
906
echo "#define CONFIG_DSOUND 1" >> $config_h
908
if test "$fmod" = "yes" ; then
909
echo "CONFIG_FMOD=yes" >> $config_mak
910
echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
911
echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
912
echo "#define CONFIG_FMOD 1" >> $config_h
1357
if test "$vde" = "yes" ; then
1358
echo "CONFIG_VDE=yes" >> $config_mak
1359
echo "#define CONFIG_VDE 1" >> $config_h
1360
echo "VDE_LIBS=-lvdeplug" >> $config_mak
1362
for card in $audio_card_list; do
1363
def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1364
echo "$def=yes" >> $config_mak
1365
echo "#define $def 1" >> $config_h
1367
echo "#define AUDIO_DRIVERS \\" >> $config_h
1368
for drv in $audio_drv_list; do
1369
echo " &${drv}_audio_driver, \\" >>$config_h
1370
def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1371
echo "$def=yes" >> $config_mak
1372
if test "$drv" = "fmod"; then
1373
echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1374
echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1375
elif test "$drv" = "oss"; then
1376
echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1380
if test "$mixemu" = "yes" ; then
1381
echo "CONFIG_MIXEMU=yes" >> $config_mak
1382
echo "#define CONFIG_MIXEMU 1" >> $config_h
914
1384
if test "$vnc_tls" = "yes" ; then
915
1385
echo "CONFIG_VNC_TLS=yes" >> $config_mak
1048
1574
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1049
1575
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1051
if test "$target_cpu" = "i386" ; then
1052
echo "TARGET_ARCH=i386" >> $config_mak
1053
echo "#define TARGET_ARCH \"i386\"" >> $config_h
1054
echo "#define TARGET_I386 1" >> $config_h
1055
if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
1056
echo "#define USE_KQEMU 1" >> $config_h
1058
elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
1059
echo "TARGET_ARCH=arm" >> $config_mak
1060
echo "#define TARGET_ARCH \"arm\"" >> $config_h
1061
echo "#define TARGET_ARM 1" >> $config_h
1063
elif test "$target_cpu" = "sparc" ; then
1064
echo "TARGET_ARCH=sparc" >> $config_mak
1065
echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1066
echo "#define TARGET_SPARC 1" >> $config_h
1067
elif test "$target_cpu" = "sparc64" ; then
1068
echo "TARGET_ARCH=sparc64" >> $config_mak
1069
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1070
echo "#define TARGET_SPARC 1" >> $config_h
1071
echo "#define TARGET_SPARC64 1" >> $config_h
1073
elif test "$target_cpu" = "sparc32plus" ; then
1074
echo "TARGET_ARCH=sparc64" >> $config_mak
1075
echo "TARGET_ABI_DIR=sparc" >> $config_mak
1076
echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1077
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1078
echo "#define TARGET_SPARC 1" >> $config_h
1079
echo "#define TARGET_SPARC64 1" >> $config_h
1080
echo "#define TARGET_ABI32 1" >> $config_h
1081
elif test "$target_cpu" = "ppc" ; then
1082
echo "TARGET_ARCH=ppc" >> $config_mak
1083
echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1084
echo "#define TARGET_PPC 1" >> $config_h
1085
elif test "$target_cpu" = "ppcemb" ; then
1086
echo "TARGET_ARCH=ppcemb" >> $config_mak
1087
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1088
echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1089
echo "#define TARGET_PPC 1" >> $config_h
1090
echo "#define TARGET_PPCEMB 1" >> $config_h
1091
elif test "$target_cpu" = "ppc64" ; then
1092
echo "TARGET_ARCH=ppc64" >> $config_mak
1093
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1094
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1095
echo "#define TARGET_PPC 1" >> $config_h
1096
echo "#define TARGET_PPC64 1" >> $config_h
1097
elif test "$target_cpu" = "ppc64abi32" ; then
1098
echo "TARGET_ARCH=ppc64" >> $config_mak
1099
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1100
echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1101
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1102
echo "#define TARGET_PPC 1" >> $config_h
1103
echo "#define TARGET_PPC64 1" >> $config_h
1104
echo "#define TARGET_ABI32 1" >> $config_h
1105
elif test "$target_cpu" = "x86_64" ; then
1106
echo "TARGET_ARCH=x86_64" >> $config_mak
1107
echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1108
echo "#define TARGET_I386 1" >> $config_h
1109
echo "#define TARGET_X86_64 1" >> $config_h
1110
if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
1111
echo "#define USE_KQEMU 1" >> $config_h
1113
elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
1114
echo "TARGET_ARCH=mips" >> $config_mak
1115
echo "#define TARGET_ARCH \"mips\"" >> $config_h
1116
echo "#define TARGET_MIPS 1" >> $config_h
1117
echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1118
elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
1119
echo "TARGET_ARCH=mipsn32" >> $config_mak
1120
echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1121
echo "#define TARGET_MIPS 1" >> $config_h
1122
echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1123
elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
1124
echo "TARGET_ARCH=mips64" >> $config_mak
1125
echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1126
echo "#define TARGET_MIPS 1" >> $config_h
1127
echo "#define TARGET_MIPS64 1" >> $config_h
1128
echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1129
elif test "$target_cpu" = "cris" ; then
1130
echo "TARGET_ARCH=cris" >> $config_mak
1131
echo "#define TARGET_ARCH \"cris\"" >> $config_h
1132
echo "#define TARGET_CRIS 1" >> $config_h
1133
echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1134
echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1135
elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
1136
echo "TARGET_ARCH=sh4" >> $config_mak
1137
echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1138
echo "#define TARGET_SH4 1" >> $config_h
1140
elif test "$target_cpu" = "m68k" ; then
1141
echo "TARGET_ARCH=m68k" >> $config_mak
1142
echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1143
echo "#define TARGET_M68K 1" >> $config_h
1145
elif test "$target_cpu" = "alpha" ; then
1146
echo "TARGET_ARCH=alpha" >> $config_mak
1147
echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1148
echo "#define TARGET_ALPHA 1" >> $config_h
1150
echo "Unsupported target CPU"
1578
# Make sure the target and host cpus are compatible
1579
if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1580
\( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1581
\( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1582
\( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1585
# Disable KVM for linux-user
1586
if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1590
case "$target_cpu" in
1592
echo "TARGET_ARCH=i386" >> $config_mak
1593
echo "#define TARGET_ARCH \"i386\"" >> $config_h
1594
echo "#define TARGET_I386 1" >> $config_h
1595
if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1597
echo "#define USE_KQEMU 1" >> $config_h
1599
if test "$kvm" = "yes" ; then
1600
echo "CONFIG_KVM=yes" >> $config_mak
1601
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1602
echo "#define CONFIG_KVM 1" >> $config_h
1606
echo "TARGET_ARCH=x86_64" >> $config_mak
1607
echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1608
echo "#define TARGET_I386 1" >> $config_h
1609
echo "#define TARGET_X86_64 1" >> $config_h
1610
if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1612
echo "#define USE_KQEMU 1" >> $config_h
1614
if test "$kvm" = "yes" ; then
1615
echo "CONFIG_KVM=yes" >> $config_mak
1616
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1617
echo "#define CONFIG_KVM 1" >> $config_h
1621
echo "TARGET_ARCH=alpha" >> $config_mak
1622
echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1623
echo "#define TARGET_ALPHA 1" >> $config_h
1626
echo "TARGET_ARCH=arm" >> $config_mak
1627
echo "#define TARGET_ARCH \"arm\"" >> $config_h
1628
echo "#define TARGET_ARM 1" >> $config_h
1631
gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1634
echo "TARGET_ARCH=cris" >> $config_mak
1635
echo "#define TARGET_ARCH \"cris\"" >> $config_h
1636
echo "#define TARGET_CRIS 1" >> $config_h
1640
echo "TARGET_ARCH=m68k" >> $config_mak
1641
echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1642
echo "#define TARGET_M68K 1" >> $config_h
1644
gdb_xml_files="cf-core.xml cf-fp.xml"
1647
echo "TARGET_ARCH=mips" >> $config_mak
1648
echo "#define TARGET_ARCH \"mips\"" >> $config_h
1649
echo "#define TARGET_MIPS 1" >> $config_h
1650
echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1653
echo "TARGET_ARCH=mipsn32" >> $config_mak
1654
echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1655
echo "#define TARGET_MIPS 1" >> $config_h
1656
echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1659
echo "TARGET_ARCH=mips64" >> $config_mak
1660
echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1661
echo "#define TARGET_MIPS 1" >> $config_h
1662
echo "#define TARGET_MIPS64 1" >> $config_h
1663
echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1666
echo "TARGET_ARCH=ppc" >> $config_mak
1667
echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1668
echo "#define TARGET_PPC 1" >> $config_h
1669
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1672
echo "TARGET_ARCH=ppcemb" >> $config_mak
1673
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1674
echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1675
echo "#define TARGET_PPC 1" >> $config_h
1676
echo "#define TARGET_PPCEMB 1" >> $config_h
1677
if test "$kvm" = "yes" ; then
1678
echo "CONFIG_KVM=yes" >> $config_mak
1679
echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1680
echo "#define CONFIG_KVM 1" >> $config_h
1682
gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1685
echo "TARGET_ARCH=ppc64" >> $config_mak
1686
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1687
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1688
echo "#define TARGET_PPC 1" >> $config_h
1689
echo "#define TARGET_PPC64 1" >> $config_h
1690
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1693
echo "TARGET_ARCH=ppc64" >> $config_mak
1694
echo "TARGET_ABI_DIR=ppc" >> $config_mak
1695
echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1696
echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1697
echo "#define TARGET_PPC 1" >> $config_h
1698
echo "#define TARGET_PPC64 1" >> $config_h
1699
echo "#define TARGET_ABI32 1" >> $config_h
1700
gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1703
echo "TARGET_ARCH=sh4" >> $config_mak
1704
echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1705
echo "#define TARGET_SH4 1" >> $config_h
1710
echo "TARGET_ARCH=sparc" >> $config_mak
1711
echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1712
echo "#define TARGET_SPARC 1" >> $config_h
1715
echo "TARGET_ARCH=sparc64" >> $config_mak
1716
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1717
echo "#define TARGET_SPARC 1" >> $config_h
1718
echo "#define TARGET_SPARC64 1" >> $config_h
1722
echo "TARGET_ARCH=sparc64" >> $config_mak
1723
echo "TARGET_ABI_DIR=sparc" >> $config_mak
1724
echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1725
echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1726
echo "#define TARGET_SPARC 1" >> $config_h
1727
echo "#define TARGET_SPARC64 1" >> $config_h
1728
echo "#define TARGET_ABI32 1" >> $config_h
1731
echo "Unsupported target CPU"
1153
1735
if test "$target_bigendian" = "yes" ; then
1154
1736
echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1155
1737
echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h