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"
21 interp_prefix="/usr/gnemul/qemu-%M"
26 gcc3_list="gcc-3.4 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32"
35 i386|i486|i586|i686|i86pc|BePC)
47 "Power Macintosh"|ppc|ppc64)
106 CFLAGS="-O2 -mno-cygwin"
114 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
137 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
143 if [ "$bsd" = "yes" ] ; then
144 if [ "$darwin" != "yes" ] ; then
149 if [ "$solaris" = "yes" ] ; then
152 solarisrev=`uname -r | cut -f2 -d.`
156 source_path=`dirname "$0"`
157 if [ -z "$source_path" ]; then
160 source_path=`cd "$source_path"; pwd`
162 if test "$source_path" = `pwd` ; then
163 source_path_used="no"
165 source_path_used="yes"
169 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
171 --help|-h) show_help=yes
173 --prefix=*) prefix="$optarg"
175 --interp-prefix=*) interp_prefix="$optarg"
177 --source-path=*) source_path="$optarg"
178 source_path_used="yes"
180 --cross-prefix=*) cross_prefix="$optarg"
185 --host-cc=*) host_cc="$optarg"
187 --make=*) make="$optarg"
189 --install=*) install="$optarg"
191 --extra-cflags=*) CFLAGS="$optarg"
193 --extra-ldflags=*) LDFLAGS="$optarg"
195 --cpu=*) cpu="$optarg"
197 --target-list=*) target_list="$optarg"
199 --enable-gprof) gprof="yes"
201 --static) static="yes"
203 --disable-sdl) sdl="no"
205 --enable-coreaudio) coreaudio="yes"
207 --enable-alsa) alsa="yes"
209 --enable-dsound) dsound="yes"
211 --enable-fmod) fmod="yes"
213 --fmod-lib=*) fmod_lib="$optarg"
215 --fmod-inc=*) fmod_inc="$optarg"
217 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no"
219 --disable-slirp) slirp="no"
221 --enable-adlib) adlib="yes"
223 --disable-kqemu) kqemu="no"
225 --enable-profiler) profiler="yes"
227 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
229 --disable-gfx-check) check_gfx="no"
231 --disable-gcc-check) check_gcc="no"
233 --disable-system) softmmu="no"
235 --enable-system) softmmu="yes"
237 --disable-user) user="no"
239 --enable-user) user="yes"
241 --enable-uname-release=*) uname_release="$optarg"
246 if test x"$show_help" = x"yes" ; then
249 Usage: configure [options]
250 Options: [defaults in brackets after descriptions]
253 echo "Standard options:"
254 echo " --help print this message"
255 echo " --prefix=PREFIX install in PREFIX [$prefix]"
256 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
257 echo " use %M for cpu name [$interp_prefix]"
258 echo " --target-list=LIST set target list [$target_list]"
260 echo "kqemu kernel acceleration support:"
261 echo " --disable-kqemu disable kqemu support"
263 echo "Advanced options (experts only):"
264 echo " --source-path=PATH path of source code [$source_path]"
265 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
266 echo " --cc=CC use C compiler CC [$cc]"
267 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
268 echo " --make=MAKE use specified make [$make]"
269 echo " --install=INSTALL use specified install [$install]"
270 echo " --static enable static build [$static]"
271 echo " --enable-cocoa enable COCOA (Mac OS X only)"
272 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
273 echo " --enable-adlib enable Adlib emulation"
274 echo " --enable-coreaudio enable Coreaudio audio driver"
275 echo " --enable-alsa enable ALSA audio driver"
276 echo " --enable-fmod enable FMOD audio driver"
277 echo " --enabled-dsound enable DirectSound audio driver"
278 echo " --enable-system enable all system emulation targets"
279 echo " --disable-system disable all system emulation targets"
280 echo " --enable-user enable all linux usermode emulation targets"
281 echo " --disable-user disable all linux usermode emulation targets"
282 echo " --fmod-lib path to FMOD library"
283 echo " --fmod-inc path to FMOD includes"
284 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
286 echo "NOTE: The object files are built at the place where configure is launched"
290 cc="${cross_prefix}${cc}"
291 ar="${cross_prefix}${ar}"
292 strip="${cross_prefix}${strip}"
294 # check that the C compiler works.
299 if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
300 : C compiler works ok
302 echo "ERROR: \"$cc\" either does not exist or does not work"
306 if test "$mingw32" = "yes" ; then
310 if [ "$cpu" = "i386" ] ; then
315 # Check for gcc4, error if pre-gcc4
316 if test "$check_gcc" = "yes" ; then
321 int main(){return 0;}
324 which "$1" >&/dev/null
328 if "$cc" -o $TMPE $TMPC 2>/dev/null ; then
329 echo "WARNING: \"$cc\" looks like gcc 4.x"
331 if test "$gcc3_search" = "yes" ; then
332 echo "Looking for gcc 3.x"
333 for compat_cc in $gcc3_list ; do
334 if check_cc "$compat_cc" ; then
335 echo "Found \"$compat_cc\""
337 found_compat_cc="yes"
341 if test "$found_compat_cc" = "no" ; then
342 echo "gcc 3.x not found!"
345 if test "$found_compat_cc" = "no" ; then
346 echo "QEMU is known to have problems when compiled with gcc 4.x"
347 echo "It is recommended that you use gcc 3.x to build QEMU"
348 echo "To use this compiler anyway, configure with --disable-gcc-check"
355 # Solaris specific configure tool chain decisions
357 if test "$solaris" = "yes" ; then
359 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
360 # override the check with --disable-gcc-check
362 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
364 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
365 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
366 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
367 echo "or get the latest patch from SunSolve for gcc"
371 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
372 if test -z "$solinst" ; then
373 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
374 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
375 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
378 if test "$solinst" = "/usr/sbin/install" ; then
379 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
380 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
381 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
384 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
385 if test -z "$sol_ar" ; then
386 echo "Error: No path includes ar"
387 if test -f /usr/ccs/bin/ar ; then
388 echo "Add /usr/ccs/bin to your path and rerun configure"
395 if test -z "$target_list" ; then
396 # these targets are portable
397 if [ "$softmmu" = "yes" ] ; then
398 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
400 # the following are Linux specific
401 if [ "$user" = "yes" ] ; then
402 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user m68k-user $target_list"
405 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
407 if test -z "$target_list" ; then
408 echo "No targets enabled"
412 if test -z "$cross_prefix" ; then
415 # big/little endian test
417 #include <inttypes.h>
418 int main(int argc, char ** argv){
419 volatile uint32_t i=0x01234567;
420 return (*((uint8_t*)(&i))) == 0x67;
424 if $cc -o $TMPE $TMPC 2>/dev/null ; then
425 $TMPE && bigendian="yes"
427 echo big/little test failed
432 # if cross compiling, cannot launch a program, so make a static guess
433 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
439 # host long bits test
441 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
445 # check gcc options support
451 have_gcc3_options="no"
452 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
453 have_gcc3_options="yes"
456 ##########################################
461 if test -z "$sdl" ; then
463 sdl_config="sdl-config"
467 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
468 # win32 cross compilation case
469 sdl_config="i386-mingw32msvc-sdl-config"
475 #undef main /* We don't want SDL to override our main() */
476 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
479 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
480 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
481 if test "$_sdlversion" -lt 121 ; then
487 # static link with sdl ?
488 if test "$sdl" = "yes" ; then
490 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
491 sdl_static_libs=`$sdl_config --static-libs`
492 if [ "$aa" = "yes" ] ; then
493 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
496 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
502 fi # sdl compile test
504 fi # cross compilation
507 # Check if tools are available to build documentation.
508 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
512 if test "$mingw32" = "yes" ; then
513 if test -z "$prefix" ; then
514 prefix="/c/Program Files/Qemu"
521 if test -z "$prefix" ; then
524 mandir="$prefix/share/man"
525 datadir="$prefix/share/qemu"
526 docdir="$prefix/share/doc/qemu"
530 echo "Install prefix $prefix"
531 echo "BIOS directory $datadir"
532 echo "binary directory $bindir"
533 if test "$mingw32" = "no" ; then
534 echo "Manual directory $mandir"
535 echo "ELF interp prefix $interp_prefix"
537 echo "Source path $source_path"
538 echo "C compiler $cc"
539 echo "Host C compiler $host_cc"
541 echo "install $install"
543 echo "host big endian $bigendian"
544 echo "target list $target_list"
545 echo "gprof enabled $gprof"
546 echo "profiler $profiler"
547 echo "static build $static"
548 if test "$darwin" = "yes" ; then
549 echo "Cocoa support $cocoa"
551 echo "SDL support $sdl"
552 if test "$sdl" != "no" ; then
553 echo "SDL static link $sdl_static"
555 echo "mingw32 support $mingw32"
556 echo "Adlib support $adlib"
557 echo "CoreAudio support $coreaudio"
558 echo "ALSA support $alsa"
559 echo "DSound support $dsound"
560 if test "$fmod" = "yes"; then
561 if test -z $fmod_lib || test -z $fmod_inc; then
563 echo "Error: You must specify path to FMOD library and headers"
564 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
568 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
572 echo "FMOD support $fmod $fmod_support"
573 echo "kqemu support $kqemu"
574 echo "Documentation $build_docs"
575 [ ! -z "$uname_release" ] && \
576 echo "uname -r $uname_release"
578 if test $sdl_too_old = "yes"; then
579 echo "-> Your SDL version is too old - please upgrade to have SDL support"
581 #if test "$sdl_static" = "no"; then
582 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
584 config_mak="config-host.mak"
585 config_h="config-host.h"
587 #echo "Creating $config_mak and $config_h"
589 echo "# Automatically generated by configure - do not modify" > $config_mak
590 echo "# Configured with: $0 $@" >> $config_mak
591 echo "/* Automatically generated by configure - do not modify */" > $config_h
593 echo "prefix=$prefix" >> $config_mak
594 echo "bindir=$bindir" >> $config_mak
595 echo "mandir=$mandir" >> $config_mak
596 echo "datadir=$datadir" >> $config_mak
597 echo "docdir=$docdir" >> $config_mak
598 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
599 echo "MAKE=$make" >> $config_mak
600 echo "INSTALL=$install" >> $config_mak
601 echo "CC=$cc" >> $config_mak
602 if test "$have_gcc3_options" = "yes" ; then
603 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
605 echo "HOST_CC=$host_cc" >> $config_mak
606 echo "AR=$ar" >> $config_mak
607 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
608 echo "CFLAGS=$CFLAGS" >> $config_mak
609 echo "LDFLAGS=$LDFLAGS" >> $config_mak
610 echo "EXESUF=$EXESUF" >> $config_mak
611 if test "$cpu" = "i386" ; then
612 echo "ARCH=i386" >> $config_mak
613 echo "#define HOST_I386 1" >> $config_h
614 elif test "$cpu" = "x86_64" ; then
615 echo "ARCH=x86_64" >> $config_mak
616 echo "#define HOST_X86_64 1" >> $config_h
617 elif test "$cpu" = "armv4b" ; then
618 echo "ARCH=arm" >> $config_mak
619 echo "#define HOST_ARM 1" >> $config_h
620 elif test "$cpu" = "armv4l" ; then
621 echo "ARCH=arm" >> $config_mak
622 echo "#define HOST_ARM 1" >> $config_h
623 elif test "$cpu" = "powerpc" ; then
624 echo "ARCH=ppc" >> $config_mak
625 echo "#define HOST_PPC 1" >> $config_h
626 elif test "$cpu" = "mips" ; then
627 echo "ARCH=mips" >> $config_mak
628 echo "#define HOST_MIPS 1" >> $config_h
629 elif test "$cpu" = "s390" ; then
630 echo "ARCH=s390" >> $config_mak
631 echo "#define HOST_S390 1" >> $config_h
632 elif test "$cpu" = "alpha" ; then
633 echo "ARCH=alpha" >> $config_mak
634 echo "#define HOST_ALPHA 1" >> $config_h
635 elif test "$cpu" = "sparc" ; then
636 echo "ARCH=sparc" >> $config_mak
637 echo "#define HOST_SPARC 1" >> $config_h
638 elif test "$cpu" = "sparc64" ; then
639 echo "ARCH=sparc64" >> $config_mak
640 echo "#define HOST_SPARC64 1" >> $config_h
641 elif test "$cpu" = "ia64" ; then
642 echo "ARCH=ia64" >> $config_mak
643 echo "#define HOST_IA64 1" >> $config_h
644 elif test "$cpu" = "m68k" ; then
645 echo "ARCH=m68k" >> $config_mak
646 echo "#define HOST_M68K 1" >> $config_h
648 echo "Unsupported CPU"
651 if test "$bigendian" = "yes" ; then
652 echo "WORDS_BIGENDIAN=yes" >> $config_mak
653 echo "#define WORDS_BIGENDIAN 1" >> $config_h
655 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
656 if test "$mingw32" = "yes" ; then
657 echo "CONFIG_WIN32=yes" >> $config_mak
658 echo "#define CONFIG_WIN32 1" >> $config_h
659 elif test -f "/usr/include/byteswap.h" ; then
660 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
662 if test "$darwin" = "yes" ; then
663 echo "CONFIG_DARWIN=yes" >> $config_mak
664 echo "#define CONFIG_DARWIN 1" >> $config_h
666 if test "$solaris" = "yes" ; then
667 echo "CONFIG_SOLARIS=yes" >> $config_mak
668 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
670 if test "$gdbstub" = "yes" ; then
671 echo "CONFIG_GDBSTUB=yes" >> $config_mak
672 echo "#define CONFIG_GDBSTUB 1" >> $config_h
674 if test "$gprof" = "yes" ; then
675 echo "TARGET_GPROF=yes" >> $config_mak
676 echo "#define HAVE_GPROF 1" >> $config_h
678 if test "$static" = "yes" ; then
679 echo "CONFIG_STATIC=yes" >> $config_mak
680 echo "#define CONFIG_STATIC 1" >> $config_h
682 if test $profiler = "yes" ; then
683 echo "#define CONFIG_PROFILER 1" >> $config_h
685 if test "$slirp" = "yes" ; then
686 echo "CONFIG_SLIRP=yes" >> $config_mak
687 echo "#define CONFIG_SLIRP 1" >> $config_h
689 if test "$adlib" = "yes" ; then
690 echo "CONFIG_ADLIB=yes" >> $config_mak
691 echo "#define CONFIG_ADLIB 1" >> $config_h
693 if test "$oss" = "yes" ; then
694 echo "CONFIG_OSS=yes" >> $config_mak
695 echo "#define CONFIG_OSS 1" >> $config_h
697 if test "$coreaudio" = "yes" ; then
698 echo "CONFIG_COREAUDIO=yes" >> $config_mak
699 echo "#define CONFIG_COREAUDIO 1" >> $config_h
701 if test "$alsa" = "yes" ; then
702 echo "CONFIG_ALSA=yes" >> $config_mak
703 echo "#define CONFIG_ALSA 1" >> $config_h
705 if test "$dsound" = "yes" ; then
706 echo "CONFIG_DSOUND=yes" >> $config_mak
707 echo "#define CONFIG_DSOUND 1" >> $config_h
709 if test "$fmod" = "yes" ; then
710 echo "CONFIG_FMOD=yes" >> $config_mak
711 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
712 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
713 echo "#define CONFIG_FMOD 1" >> $config_h
715 qemu_version=`head $source_path/VERSION`
716 echo "VERSION=$qemu_version" >>$config_mak
717 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
719 echo "SRC_PATH=$source_path" >> $config_mak
720 if [ "$source_path_used" = "yes" ]; then
721 echo "VPATH=$source_path" >> $config_mak
723 echo "TARGET_DIRS=$target_list" >> $config_mak
724 if [ "$build_docs" = "yes" ] ; then
725 echo "BUILD_DOCS=yes" >> $config_mak
729 if [ "$bsd" = "yes" ] ; then
730 echo "#define O_LARGEFILE 0" >> $config_h
731 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
732 echo "#define _BSD 1" >> $config_h
735 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
737 for target in $target_list; do
739 config_mak=$target_dir/config.mak
740 config_h=$target_dir/config.h
741 target_cpu=`echo $target | cut -d '-' -f 1`
742 target_bigendian="no"
743 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
744 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
745 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
746 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
747 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
748 [ "$target_cpu" = "mips" ] && target_bigendian=yes
749 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
750 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
752 if expr $target : '.*-softmmu' > /dev/null ; then
755 target_user_only="no"
756 if expr $target : '.*-user' > /dev/null ; then
757 target_user_only="yes"
760 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
761 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
762 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
763 echo "To build QEMU without graphical output configure with --disable-gfx-check"
764 echo "Note that this will disable all output from the virtual graphics card."
768 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
771 mkdir -p $target_dir/fpu
772 if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
773 mkdir -p $target_dir/nwfpe
775 if test "$target_user_only" = "no" ; then
776 mkdir -p $target_dir/slirp
780 # don't use ln -sf as not all "ln -sf" over write the file/link
782 rm -f $target_dir/Makefile
783 ln -s $source_path/Makefile.target $target_dir/Makefile
786 echo "# Automatically generated by configure - do not modify" > $config_mak
787 echo "/* Automatically generated by configure - do not modify */" > $config_h
790 echo "include ../config-host.mak" >> $config_mak
791 echo "#include \"../config-host.h\"" >> $config_h
794 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
795 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
797 if test "$target_cpu" = "i386" ; then
798 echo "TARGET_ARCH=i386" >> $config_mak
799 echo "#define TARGET_ARCH \"i386\"" >> $config_h
800 echo "#define TARGET_I386 1" >> $config_h
801 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
802 echo "#define USE_KQEMU 1" >> $config_h
804 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
805 echo "TARGET_ARCH=arm" >> $config_mak
806 echo "#define TARGET_ARCH \"arm\"" >> $config_h
807 echo "#define TARGET_ARM 1" >> $config_h
809 elif test "$target_cpu" = "sparc" ; then
810 echo "TARGET_ARCH=sparc" >> $config_mak
811 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
812 echo "#define TARGET_SPARC 1" >> $config_h
813 elif test "$target_cpu" = "sparc64" ; then
814 echo "TARGET_ARCH=sparc64" >> $config_mak
815 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
816 echo "#define TARGET_SPARC 1" >> $config_h
817 echo "#define TARGET_SPARC64 1" >> $config_h
818 elif test "$target_cpu" = "ppc" ; then
819 echo "TARGET_ARCH=ppc" >> $config_mak
820 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
821 echo "#define TARGET_PPC 1" >> $config_h
822 elif test "$target_cpu" = "ppc64" ; then
823 echo "TARGET_ARCH=ppc64" >> $config_mak
824 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
825 echo "#define TARGET_PPC 1" >> $config_h
826 echo "#define TARGET_PPC64 1" >> $config_h
827 elif test "$target_cpu" = "x86_64" ; then
828 echo "TARGET_ARCH=x86_64" >> $config_mak
829 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
830 echo "#define TARGET_I386 1" >> $config_h
831 echo "#define TARGET_X86_64 1" >> $config_h
832 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
833 echo "#define USE_KQEMU 1" >> $config_h
835 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
836 echo "TARGET_ARCH=mips" >> $config_mak
837 echo "#define TARGET_ARCH \"mips\"" >> $config_h
838 echo "#define TARGET_MIPS 1" >> $config_h
839 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
840 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
841 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
842 echo "TARGET_ARCH=sh4" >> $config_mak
843 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
844 echo "#define TARGET_SH4 1" >> $config_h
846 elif test "$target_cpu" = "m68k" ; then
847 echo "TARGET_ARCH=m68k" >> $config_mak
848 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
849 echo "#define TARGET_M68K 1" >> $config_h
852 echo "Unsupported target CPU"
855 if test "$target_bigendian" = "yes" ; then
856 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
857 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
859 if test "$target_softmmu" = "yes" ; then
860 echo "CONFIG_SOFTMMU=yes" >> $config_mak
861 echo "#define CONFIG_SOFTMMU 1" >> $config_h
863 if test "$target_user_only" = "yes" ; then
864 echo "CONFIG_USER_ONLY=yes" >> $config_mak
865 echo "#define CONFIG_USER_ONLY 1" >> $config_h
868 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
869 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
870 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
872 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
873 echo "TARGET_HAS_BFLT=yes" >> $config_mak
874 echo "#define TARGET_HAS_BFLT 1" >> $config_h
878 if test "$target_user_only" = "no"; then
879 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
884 if test "$sdl1" = "yes" ; then
885 echo "#define CONFIG_SDL 1" >> $config_h
886 echo "CONFIG_SDL=yes" >> $config_mak
887 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
888 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
890 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
892 if [ "${aa}" = "yes" ] ; then
893 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
895 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
900 if test "$cocoa" = "yes" ; then
901 echo "#define CONFIG_COCOA 1" >> $config_h
902 echo "CONFIG_COCOA=yes" >> $config_mak
905 done # for target in $targets
907 # build tree in object directory if source path is different from current one
908 if test "$source_path_used" = "yes" ; then
910 FILES="Makefile tests/Makefile"
911 for dir in $DIRS ; do
914 # remove the link and recreate it, as not all "ln -sf" overwrite the link
917 ln -s $source_path/$f $f
921 rm -f $TMPO $TMPC $TMPE $TMPS