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 OS_CFLAGS="-mno-cygwin"
114 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
129 OS_CFLAGS="-mdynamic-no-pic"
138 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
144 if [ "$bsd" = "yes" ] ; then
145 if [ "$darwin" != "yes" ] ; then
150 if [ "$solaris" = "yes" ] ; then
153 solarisrev=`uname -r | cut -f2 -d.`
157 source_path=`dirname "$0"`
158 if [ -z "$source_path" ]; then
161 source_path=`cd "$source_path"; pwd`
163 if test "$source_path" = `pwd` ; then
164 source_path_used="no"
166 source_path_used="yes"
170 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
172 --help|-h) show_help=yes
174 --prefix=*) prefix="$optarg"
176 --interp-prefix=*) interp_prefix="$optarg"
178 --source-path=*) source_path="$optarg"
179 source_path_used="yes"
181 --cross-prefix=*) cross_prefix="$optarg"
186 --host-cc=*) host_cc="$optarg"
188 --make=*) make="$optarg"
190 --install=*) install="$optarg"
192 --extra-cflags=*) CFLAGS="$optarg"
194 --extra-ldflags=*) LDFLAGS="$optarg"
196 --cpu=*) cpu="$optarg"
198 --target-list=*) target_list="$optarg"
200 --enable-gprof) gprof="yes"
202 --static) static="yes"
204 --disable-sdl) sdl="no"
206 --enable-coreaudio) coreaudio="yes"
208 --enable-alsa) alsa="yes"
210 --enable-dsound) dsound="yes"
212 --enable-fmod) fmod="yes"
214 --fmod-lib=*) fmod_lib="$optarg"
216 --fmod-inc=*) fmod_inc="$optarg"
218 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no"
220 --disable-slirp) slirp="no"
222 --enable-adlib) adlib="yes"
224 --disable-kqemu) kqemu="no"
226 --enable-profiler) profiler="yes"
228 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
230 --disable-gfx-check) check_gfx="no"
232 --disable-gcc-check) check_gcc="no"
234 --disable-system) softmmu="no"
236 --enable-system) softmmu="yes"
238 --disable-user) user="no"
240 --enable-user) user="yes"
242 --enable-uname-release=*) uname_release="$optarg"
247 # default flags for all hosts
248 CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
249 LDFLAGS="$LDFLAGS -g"
251 if test x"$show_help" = x"yes" ; then
254 Usage: configure [options]
255 Options: [defaults in brackets after descriptions]
258 echo "Standard options:"
259 echo " --help print this message"
260 echo " --prefix=PREFIX install in PREFIX [$prefix]"
261 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
262 echo " use %M for cpu name [$interp_prefix]"
263 echo " --target-list=LIST set target list [$target_list]"
265 echo "kqemu kernel acceleration support:"
266 echo " --disable-kqemu disable kqemu support"
268 echo "Advanced options (experts only):"
269 echo " --source-path=PATH path of source code [$source_path]"
270 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
271 echo " --cc=CC use C compiler CC [$cc]"
272 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
273 echo " --make=MAKE use specified make [$make]"
274 echo " --install=INSTALL use specified install [$install]"
275 echo " --static enable static build [$static]"
276 echo " --enable-cocoa enable COCOA (Mac OS X only)"
277 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
278 echo " --enable-adlib enable Adlib emulation"
279 echo " --enable-coreaudio enable Coreaudio audio driver"
280 echo " --enable-alsa enable ALSA audio driver"
281 echo " --enable-fmod enable FMOD audio driver"
282 echo " --enabled-dsound enable DirectSound audio driver"
283 echo " --enable-system enable all system emulation targets"
284 echo " --disable-system disable all system emulation targets"
285 echo " --enable-user enable all linux usermode emulation targets"
286 echo " --disable-user disable all linux usermode emulation targets"
287 echo " --fmod-lib path to FMOD library"
288 echo " --fmod-inc path to FMOD includes"
289 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
291 echo "NOTE: The object files are built at the place where configure is launched"
295 cc="${cross_prefix}${cc}"
296 ar="${cross_prefix}${ar}"
297 strip="${cross_prefix}${strip}"
299 # check that the C compiler works.
304 if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
305 : C compiler works ok
307 echo "ERROR: \"$cc\" either does not exist or does not work"
311 if test "$mingw32" = "yes" ; then
315 if [ "$cpu" = "i386" ] ; then
320 # Check for gcc4, error if pre-gcc4
321 if test "$check_gcc" = "yes" ; then
326 int main(){return 0;}
329 which "$1" >&/dev/null
333 if "$cc" -o $TMPE $TMPC 2>/dev/null ; then
334 echo "WARNING: \"$cc\" looks like gcc 4.x"
336 if test "$gcc3_search" = "yes" ; then
337 echo "Looking for gcc 3.x"
338 for compat_cc in $gcc3_list ; do
339 if check_cc "$compat_cc" ; then
340 echo "Found \"$compat_cc\""
342 found_compat_cc="yes"
346 if test "$found_compat_cc" = "no" ; then
347 echo "gcc 3.x not found!"
350 if test "$found_compat_cc" = "no" ; then
351 echo "QEMU is known to have problems when compiled with gcc 4.x"
352 echo "It is recommended that you use gcc 3.x to build QEMU"
353 echo "To use this compiler anyway, configure with --disable-gcc-check"
360 # Solaris specific configure tool chain decisions
362 if test "$solaris" = "yes" ; then
364 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
365 # override the check with --disable-gcc-check
367 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
369 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
370 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
371 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
372 echo "or get the latest patch from SunSolve for gcc"
376 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
377 if test -z "$solinst" ; then
378 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
379 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
380 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
383 if test "$solinst" = "/usr/sbin/install" ; then
384 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
385 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
386 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
389 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
390 if test -z "$sol_ar" ; then
391 echo "Error: No path includes ar"
392 if test -f /usr/ccs/bin/ar ; then
393 echo "Add /usr/ccs/bin to your path and rerun configure"
400 if test -z "$target_list" ; then
401 # these targets are portable
402 if [ "$softmmu" = "yes" ] ; then
403 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
405 # the following are Linux specific
406 if [ "$user" = "yes" ] ; then
407 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user m68k-user $target_list"
410 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
412 if test -z "$target_list" ; then
413 echo "No targets enabled"
417 if test -z "$cross_prefix" ; then
420 # big/little endian test
422 #include <inttypes.h>
423 int main(int argc, char ** argv){
424 volatile uint32_t i=0x01234567;
425 return (*((uint8_t*)(&i))) == 0x67;
429 if $cc -o $TMPE $TMPC 2>/dev/null ; then
430 $TMPE && bigendian="yes"
432 echo big/little test failed
437 # if cross compiling, cannot launch a program, so make a static guess
438 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
444 # host long bits test
446 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
450 # check gcc options support
456 have_gcc3_options="no"
457 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
458 have_gcc3_options="yes"
461 ##########################################
466 if test -z "$sdl" ; then
468 sdl_config="sdl-config"
472 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
473 # win32 cross compilation case
474 sdl_config="i386-mingw32msvc-sdl-config"
480 #undef main /* We don't want SDL to override our main() */
481 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
484 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
485 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
486 if test "$_sdlversion" -lt 121 ; then
492 # static link with sdl ?
493 if test "$sdl" = "yes" ; then
495 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
496 sdl_static_libs=`$sdl_config --static-libs`
497 if [ "$aa" = "yes" ] ; then
498 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
501 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
507 fi # sdl compile test
509 fi # cross compilation
512 ##########################################
513 # alsa sound support libraries
515 if test "$alsa" = "yes" ; then
517 #include <alsa/asoundlib.h>
518 int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
520 if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then
524 echo "Error: Could not find alsa"
525 echo "Make sure to have the alsa libs and headers installed."
531 # Check if tools are available to build documentation.
532 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
536 if test "$mingw32" = "yes" ; then
537 if test -z "$prefix" ; then
538 prefix="/c/Program Files/Qemu"
545 if test -z "$prefix" ; then
548 mandir="$prefix/share/man"
549 datadir="$prefix/share/qemu"
550 docdir="$prefix/share/doc/qemu"
554 echo "Install prefix $prefix"
555 echo "BIOS directory $datadir"
556 echo "binary directory $bindir"
557 if test "$mingw32" = "no" ; then
558 echo "Manual directory $mandir"
559 echo "ELF interp prefix $interp_prefix"
561 echo "Source path $source_path"
562 echo "C compiler $cc"
563 echo "Host C compiler $host_cc"
565 echo "install $install"
567 echo "host big endian $bigendian"
568 echo "target list $target_list"
569 echo "gprof enabled $gprof"
570 echo "profiler $profiler"
571 echo "static build $static"
572 if test "$darwin" = "yes" ; then
573 echo "Cocoa support $cocoa"
575 echo "SDL support $sdl"
576 if test "$sdl" != "no" ; then
577 echo "SDL static link $sdl_static"
579 echo "mingw32 support $mingw32"
580 echo "Adlib support $adlib"
581 echo "CoreAudio support $coreaudio"
582 echo "ALSA support $alsa"
583 echo "DSound support $dsound"
584 if test "$fmod" = "yes"; then
585 if test -z $fmod_lib || test -z $fmod_inc; then
587 echo "Error: You must specify path to FMOD library and headers"
588 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
592 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
596 echo "FMOD support $fmod $fmod_support"
597 echo "kqemu support $kqemu"
598 echo "Documentation $build_docs"
599 [ ! -z "$uname_release" ] && \
600 echo "uname -r $uname_release"
602 if test $sdl_too_old = "yes"; then
603 echo "-> Your SDL version is too old - please upgrade to have SDL support"
605 #if test "$sdl_static" = "no"; then
606 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
608 config_mak="config-host.mak"
609 config_h="config-host.h"
611 #echo "Creating $config_mak and $config_h"
613 echo "# Automatically generated by configure - do not modify" > $config_mak
614 echo "# Configured with: $0 $@" >> $config_mak
615 echo "/* Automatically generated by configure - do not modify */" > $config_h
617 echo "prefix=$prefix" >> $config_mak
618 echo "bindir=$bindir" >> $config_mak
619 echo "mandir=$mandir" >> $config_mak
620 echo "datadir=$datadir" >> $config_mak
621 echo "docdir=$docdir" >> $config_mak
622 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
623 echo "MAKE=$make" >> $config_mak
624 echo "INSTALL=$install" >> $config_mak
625 echo "CC=$cc" >> $config_mak
626 if test "$have_gcc3_options" = "yes" ; then
627 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
629 echo "HOST_CC=$host_cc" >> $config_mak
630 echo "AR=$ar" >> $config_mak
631 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
632 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
633 echo "CFLAGS=$CFLAGS" >> $config_mak
634 echo "LDFLAGS=$LDFLAGS" >> $config_mak
635 echo "EXESUF=$EXESUF" >> $config_mak
636 if test "$cpu" = "i386" ; then
637 echo "ARCH=i386" >> $config_mak
638 echo "#define HOST_I386 1" >> $config_h
639 elif test "$cpu" = "x86_64" ; then
640 echo "ARCH=x86_64" >> $config_mak
641 echo "#define HOST_X86_64 1" >> $config_h
642 elif test "$cpu" = "armv4b" ; then
643 echo "ARCH=arm" >> $config_mak
644 echo "#define HOST_ARM 1" >> $config_h
645 elif test "$cpu" = "armv4l" ; then
646 echo "ARCH=arm" >> $config_mak
647 echo "#define HOST_ARM 1" >> $config_h
648 elif test "$cpu" = "powerpc" ; then
649 echo "ARCH=ppc" >> $config_mak
650 echo "#define HOST_PPC 1" >> $config_h
651 elif test "$cpu" = "mips" ; then
652 echo "ARCH=mips" >> $config_mak
653 echo "#define HOST_MIPS 1" >> $config_h
654 elif test "$cpu" = "s390" ; then
655 echo "ARCH=s390" >> $config_mak
656 echo "#define HOST_S390 1" >> $config_h
657 elif test "$cpu" = "alpha" ; then
658 echo "ARCH=alpha" >> $config_mak
659 echo "#define HOST_ALPHA 1" >> $config_h
660 elif test "$cpu" = "sparc" ; then
661 echo "ARCH=sparc" >> $config_mak
662 echo "#define HOST_SPARC 1" >> $config_h
663 elif test "$cpu" = "sparc64" ; then
664 echo "ARCH=sparc64" >> $config_mak
665 echo "#define HOST_SPARC64 1" >> $config_h
666 elif test "$cpu" = "ia64" ; then
667 echo "ARCH=ia64" >> $config_mak
668 echo "#define HOST_IA64 1" >> $config_h
669 elif test "$cpu" = "m68k" ; then
670 echo "ARCH=m68k" >> $config_mak
671 echo "#define HOST_M68K 1" >> $config_h
673 echo "Unsupported CPU"
676 if test "$bigendian" = "yes" ; then
677 echo "WORDS_BIGENDIAN=yes" >> $config_mak
678 echo "#define WORDS_BIGENDIAN 1" >> $config_h
680 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
681 if test "$mingw32" = "yes" ; then
682 echo "CONFIG_WIN32=yes" >> $config_mak
683 echo "#define CONFIG_WIN32 1" >> $config_h
684 elif test -f "/usr/include/byteswap.h" ; then
685 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
687 if test "$darwin" = "yes" ; then
688 echo "CONFIG_DARWIN=yes" >> $config_mak
689 echo "#define CONFIG_DARWIN 1" >> $config_h
691 if test "$solaris" = "yes" ; then
692 echo "CONFIG_SOLARIS=yes" >> $config_mak
693 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
695 if test "$gdbstub" = "yes" ; then
696 echo "CONFIG_GDBSTUB=yes" >> $config_mak
697 echo "#define CONFIG_GDBSTUB 1" >> $config_h
699 if test "$gprof" = "yes" ; then
700 echo "TARGET_GPROF=yes" >> $config_mak
701 echo "#define HAVE_GPROF 1" >> $config_h
703 if test "$static" = "yes" ; then
704 echo "CONFIG_STATIC=yes" >> $config_mak
705 echo "#define CONFIG_STATIC 1" >> $config_h
707 if test $profiler = "yes" ; then
708 echo "#define CONFIG_PROFILER 1" >> $config_h
710 if test "$slirp" = "yes" ; then
711 echo "CONFIG_SLIRP=yes" >> $config_mak
712 echo "#define CONFIG_SLIRP 1" >> $config_h
714 if test "$adlib" = "yes" ; then
715 echo "CONFIG_ADLIB=yes" >> $config_mak
716 echo "#define CONFIG_ADLIB 1" >> $config_h
718 if test "$oss" = "yes" ; then
719 echo "CONFIG_OSS=yes" >> $config_mak
720 echo "#define CONFIG_OSS 1" >> $config_h
722 if test "$coreaudio" = "yes" ; then
723 echo "CONFIG_COREAUDIO=yes" >> $config_mak
724 echo "#define CONFIG_COREAUDIO 1" >> $config_h
726 if test "$alsa" = "yes" ; then
727 echo "CONFIG_ALSA=yes" >> $config_mak
728 echo "#define CONFIG_ALSA 1" >> $config_h
730 if test "$dsound" = "yes" ; then
731 echo "CONFIG_DSOUND=yes" >> $config_mak
732 echo "#define CONFIG_DSOUND 1" >> $config_h
734 if test "$fmod" = "yes" ; then
735 echo "CONFIG_FMOD=yes" >> $config_mak
736 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
737 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
738 echo "#define CONFIG_FMOD 1" >> $config_h
740 qemu_version=`head $source_path/VERSION`
741 echo "VERSION=$qemu_version" >>$config_mak
742 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
744 echo "SRC_PATH=$source_path" >> $config_mak
745 if [ "$source_path_used" = "yes" ]; then
746 echo "VPATH=$source_path" >> $config_mak
748 echo "TARGET_DIRS=$target_list" >> $config_mak
749 if [ "$build_docs" = "yes" ] ; then
750 echo "BUILD_DOCS=yes" >> $config_mak
754 if [ "$bsd" = "yes" ] ; then
755 echo "#define O_LARGEFILE 0" >> $config_h
756 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
757 echo "#define _BSD 1" >> $config_h
760 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
762 for target in $target_list; do
764 config_mak=$target_dir/config.mak
765 config_h=$target_dir/config.h
766 target_cpu=`echo $target | cut -d '-' -f 1`
767 target_bigendian="no"
768 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
769 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
770 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
771 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
772 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
773 [ "$target_cpu" = "mips" ] && target_bigendian=yes
774 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
775 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
777 if expr $target : '.*-softmmu' > /dev/null ; then
780 target_user_only="no"
781 if expr $target : '.*-user' > /dev/null ; then
782 target_user_only="yes"
785 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
786 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
787 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
788 echo "To build QEMU without graphical output configure with --disable-gfx-check"
789 echo "Note that this will disable all output from the virtual graphics card."
793 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
796 mkdir -p $target_dir/fpu
797 if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
798 mkdir -p $target_dir/nwfpe
800 if test "$target_user_only" = "no" ; then
801 mkdir -p $target_dir/slirp
805 # don't use ln -sf as not all "ln -sf" over write the file/link
807 rm -f $target_dir/Makefile
808 ln -s $source_path/Makefile.target $target_dir/Makefile
811 echo "# Automatically generated by configure - do not modify" > $config_mak
812 echo "/* Automatically generated by configure - do not modify */" > $config_h
815 echo "include ../config-host.mak" >> $config_mak
816 echo "#include \"../config-host.h\"" >> $config_h
819 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
820 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
822 if test "$target_cpu" = "i386" ; then
823 echo "TARGET_ARCH=i386" >> $config_mak
824 echo "#define TARGET_ARCH \"i386\"" >> $config_h
825 echo "#define TARGET_I386 1" >> $config_h
826 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
827 echo "#define USE_KQEMU 1" >> $config_h
829 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
830 echo "TARGET_ARCH=arm" >> $config_mak
831 echo "#define TARGET_ARCH \"arm\"" >> $config_h
832 echo "#define TARGET_ARM 1" >> $config_h
834 elif test "$target_cpu" = "sparc" ; then
835 echo "TARGET_ARCH=sparc" >> $config_mak
836 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
837 echo "#define TARGET_SPARC 1" >> $config_h
838 elif test "$target_cpu" = "sparc64" ; then
839 echo "TARGET_ARCH=sparc64" >> $config_mak
840 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
841 echo "#define TARGET_SPARC 1" >> $config_h
842 echo "#define TARGET_SPARC64 1" >> $config_h
843 elif test "$target_cpu" = "ppc" ; then
844 echo "TARGET_ARCH=ppc" >> $config_mak
845 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
846 echo "#define TARGET_PPC 1" >> $config_h
847 elif test "$target_cpu" = "ppc64" ; then
848 echo "TARGET_ARCH=ppc64" >> $config_mak
849 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
850 echo "#define TARGET_PPC 1" >> $config_h
851 echo "#define TARGET_PPC64 1" >> $config_h
852 elif test "$target_cpu" = "x86_64" ; then
853 echo "TARGET_ARCH=x86_64" >> $config_mak
854 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
855 echo "#define TARGET_I386 1" >> $config_h
856 echo "#define TARGET_X86_64 1" >> $config_h
857 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
858 echo "#define USE_KQEMU 1" >> $config_h
860 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
861 echo "TARGET_ARCH=mips" >> $config_mak
862 echo "#define TARGET_ARCH \"mips\"" >> $config_h
863 echo "#define TARGET_MIPS 1" >> $config_h
864 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
865 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
866 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
867 echo "TARGET_ARCH=sh4" >> $config_mak
868 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
869 echo "#define TARGET_SH4 1" >> $config_h
871 elif test "$target_cpu" = "m68k" ; then
872 echo "TARGET_ARCH=m68k" >> $config_mak
873 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
874 echo "#define TARGET_M68K 1" >> $config_h
877 echo "Unsupported target CPU"
880 if test "$target_bigendian" = "yes" ; then
881 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
882 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
884 if test "$target_softmmu" = "yes" ; then
885 echo "CONFIG_SOFTMMU=yes" >> $config_mak
886 echo "#define CONFIG_SOFTMMU 1" >> $config_h
888 if test "$target_user_only" = "yes" ; then
889 echo "CONFIG_USER_ONLY=yes" >> $config_mak
890 echo "#define CONFIG_USER_ONLY 1" >> $config_h
893 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
894 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
895 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
897 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
898 echo "TARGET_HAS_BFLT=yes" >> $config_mak
899 echo "#define TARGET_HAS_BFLT 1" >> $config_h
903 if test "$target_user_only" = "no"; then
904 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
909 if test "$sdl1" = "yes" ; then
910 echo "#define CONFIG_SDL 1" >> $config_h
911 echo "CONFIG_SDL=yes" >> $config_mak
912 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
913 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
915 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
917 if [ "${aa}" = "yes" ] ; then
918 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
920 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
925 if test "$cocoa" = "yes" ; then
926 echo "#define CONFIG_COCOA 1" >> $config_h
927 echo "CONFIG_COCOA=yes" >> $config_mak
930 done # for target in $targets
932 # build tree in object directory if source path is different from current one
933 if test "$source_path_used" = "yes" ; then
935 FILES="Makefile tests/Makefile"
936 for dir in $DIRS ; do
939 # remove the link and recreate it, as not all "ln -sf" overwrite the link
942 ln -s $source_path/$f $f
946 rm -f $TMPO $TMPC $TMPE $TMPS