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"
33 i386|i486|i586|i686|i86pc|BePC)
45 "Power Macintosh"|ppc|ppc64)
104 CFLAGS="-O2 -mno-cygwin"
112 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
135 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
141 if [ "$bsd" = "yes" ] ; then
142 if [ "$darwin" != "yes" ] ; then
147 if [ "$solaris" = "yes" ] ; then
150 solarisrev=`uname -r | cut -f2 -d.`
154 source_path=`dirname "$0"`
155 if [ -z "$source_path" ]; then
158 source_path=`cd "$source_path"; pwd`
160 if test "$source_path" = `pwd` ; then
161 source_path_used="no"
163 source_path_used="yes"
167 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
169 --help|-h) show_help=yes
171 --prefix=*) prefix="$optarg"
173 --interp-prefix=*) interp_prefix="$optarg"
175 --source-path=*) source_path="$optarg"
176 source_path_used="yes"
178 --cross-prefix=*) cross_prefix="$optarg"
182 --host-cc=*) host_cc="$optarg"
184 --make=*) make="$optarg"
186 --install=*) install="$optarg"
188 --extra-cflags=*) CFLAGS="$optarg"
190 --extra-ldflags=*) LDFLAGS="$optarg"
192 --cpu=*) cpu="$optarg"
194 --target-list=*) target_list="$optarg"
196 --enable-gprof) gprof="yes"
198 --static) static="yes"
200 --disable-sdl) sdl="no"
202 --enable-coreaudio) coreaudio="yes"
204 --enable-alsa) alsa="yes"
206 --enable-dsound) dsound="yes"
208 --enable-fmod) fmod="yes"
210 --fmod-lib=*) fmod_lib="$optarg"
212 --fmod-inc=*) fmod_inc="$optarg"
214 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
216 --disable-slirp) slirp="no"
218 --enable-adlib) adlib="yes"
220 --disable-kqemu) kqemu="no"
222 --enable-profiler) profiler="yes"
224 --kernel-path=*) kernel_path="$optarg"
226 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
228 --disable-gfx-check) check_gfx="no"
230 --disable-gcc-check) check_gcc="no"
232 --disable-system) softmmu="no"
234 --enable-system) softmmu="yes"
236 --disable-user) user="no"
238 --enable-user) user="yes"
243 # Checking for CFLAGS
244 if test -z "$CFLAGS"; then
248 if test x"$show_help" = x"yes" ; then
251 Usage: configure [options]
252 Options: [defaults in brackets after descriptions]
255 echo "Standard options:"
256 echo " --help print this message"
257 echo " --prefix=PREFIX install in PREFIX [$prefix]"
258 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
259 echo " use %M for cpu name [$interp_prefix]"
260 echo " --target-list=LIST set target list [$target_list]"
262 echo "kqemu kernel acceleration support:"
263 echo " --disable-kqemu disable kqemu support"
264 echo " --kernel-path=PATH set the kernel path (configure probes it)"
266 echo "Advanced options (experts only):"
267 echo " --source-path=PATH path of source code [$source_path]"
268 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
269 echo " --cc=CC use C compiler CC [$cc]"
270 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
271 echo " --make=MAKE use specified make [$make]"
272 echo " --install=INSTALL use specified install [$install]"
273 echo " --static enable static build [$static]"
274 echo " --enable-cocoa enable COCOA (Mac OS X only)"
275 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
276 echo " --enable-adlib enable Adlib emulation"
277 echo " --enable-coreaudio enable Coreaudio audio driver"
278 echo " --enable-alsa enable ALSA audio driver"
279 echo " --enable-fmod enable FMOD audio driver"
280 echo " --enabled-dsound enable DirectSound audio driver"
281 echo " --enable-system enable all system emulation targets"
282 echo " --disable-system disable all system emulation targets"
283 echo " --enable-user enable all linux usermode emulation targets"
284 echo " --disable-user disable all linux usermode emulation targets"
285 echo " --fmod-lib path to FMOD library"
286 echo " --fmod-inc path to FMOD includes"
288 echo "NOTE: The object files are build at the place where configure is launched"
292 cc="${cross_prefix}${cc}"
293 ar="${cross_prefix}${ar}"
294 strip="${cross_prefix}${strip}"
296 # check that the C compiler works.
301 if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
302 : C compiler works ok
304 echo "ERROR: \"$cc\" either does not exist or does not work"
308 if test "$mingw32" = "yes" ; then
313 if [ "$cpu" = "i386" ] ; then
319 # Solaris specific configure tool chain decisions
321 if test "$solaris" = "yes" ; then
323 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
324 # override the check with --disable-gcc-check
326 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
328 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
329 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
330 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
331 echo "or get the latest patch from SunSolve for gcc"
335 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
336 if test -z "$solinst" ; then
337 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
338 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
339 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
342 if test "$solinst" = "/usr/sbin/install" ; then
343 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
344 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
345 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
348 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
349 if test -z "$sol_ar" ; then
350 echo "Error: No path includes ar"
351 if test -f /usr/ccs/bin/ar ; then
352 echo "Add /usr/ccs/bin to your path and rerun configure"
359 if test -z "$target_list" ; then
360 # these targets are portable
361 if [ "$softmmu" = "yes" ] ; then
362 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
364 # the following are Linux specific
365 if [ "$user" = "yes" ] ; then
366 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
369 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
371 if test -z "$target_list" ; then
372 echo "No targets enabled"
376 if test -z "$cross_prefix" ; then
379 # big/little endian test
381 #include <inttypes.h>
382 int main(int argc, char ** argv){
383 volatile uint32_t i=0x01234567;
384 return (*((uint8_t*)(&i))) == 0x67;
388 if $cc -o $TMPE $TMPC 2>/dev/null ; then
389 $TMPE && bigendian="yes"
391 echo big/little test failed
396 # if cross compiling, cannot launch a program, so make a static guess
397 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
403 # host long bits test
405 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
409 # check gcc options support
415 have_gcc3_options="no"
416 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
417 have_gcc3_options="yes"
420 # Check for gcc4, error if pre-gcc4
421 if test "$check_gcc" = "yes" ; then
426 int main(){return 0;}
428 if $cc -o $TMPO $TMPC 2>/dev/null ; then
429 echo "ERROR: \"$cc\" looks like gcc 4.x"
430 echo "QEMU is known to have problems when compiled with gcc 4.x"
431 echo "It is recommended that you use gcc 3.x to build QEMU"
432 echo "To use this compiler anyway, configure with --disable-gcc-check"
437 ##########################################
442 if test -z "$sdl" ; then
444 sdl_config="sdl-config"
448 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
449 # win32 cross compilation case
450 sdl_config="i386-mingw32msvc-sdl-config"
456 #undef main /* We don't want SDL to override our main() */
457 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
460 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
461 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
462 if test "$_sdlversion" -lt 121 ; then
468 # static link with sdl ?
469 if test "$sdl" = "yes" ; then
471 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
472 sdl_static_libs=`$sdl_config --static-libs`
473 if [ "$aa" = "yes" ] ; then
474 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
477 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
483 fi # sdl compile test
485 fi # cross compilation
488 # Check if tools are available to build documentation.
489 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
493 if test "$mingw32" = "yes" ; then
494 if test -z "$prefix" ; then
495 prefix="/c/Program Files/Qemu"
502 if test -z "$prefix" ; then
505 mandir="$prefix/share/man"
506 datadir="$prefix/share/qemu"
507 docdir="$prefix/share/doc/qemu"
511 echo "Install prefix $prefix"
512 echo "BIOS directory $datadir"
513 echo "binary directory $bindir"
514 if test "$mingw32" = "no" ; then
515 echo "Manual directory $mandir"
516 echo "ELF interp prefix $interp_prefix"
518 echo "Source path $source_path"
519 echo "C compiler $cc"
520 echo "Host C compiler $host_cc"
522 echo "install $install"
524 echo "host big endian $bigendian"
525 echo "target list $target_list"
526 echo "gprof enabled $gprof"
527 echo "profiler $profiler"
528 echo "static build $static"
529 if test "$darwin" = "yes" ; then
530 echo "Cocoa support $cocoa"
532 echo "SDL support $sdl"
533 if test "$sdl" != "no" ; then
534 echo "SDL static link $sdl_static"
536 echo "mingw32 support $mingw32"
537 echo "Adlib support $adlib"
538 echo "CoreAudio support $coreaudio"
539 echo "ALSA support $alsa"
540 echo "DSound support $dsound"
541 if test "$fmod" = "yes"; then
542 if test -z $fmod_lib || test -z $fmod_inc; then
544 echo "Error: You must specify path to FMOD library and headers"
545 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
549 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
553 echo "FMOD support $fmod $fmod_support"
554 echo "kqemu support $kqemu"
555 echo "Documentation $build_docs"
557 if test $sdl_too_old = "yes"; then
558 echo "-> Your SDL version is too old - please upgrade to have SDL support"
560 #if test "$sdl_static" = "no"; then
561 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
563 config_mak="config-host.mak"
564 config_h="config-host.h"
566 #echo "Creating $config_mak and $config_h"
568 echo "# Automatically generated by configure - do not modify" > $config_mak
569 echo "# Configured with: $0 $@" >> $config_mak
570 echo "/* Automatically generated by configure - do not modify */" > $config_h
572 echo "prefix=$prefix" >> $config_mak
573 echo "bindir=$bindir" >> $config_mak
574 echo "mandir=$mandir" >> $config_mak
575 echo "datadir=$datadir" >> $config_mak
576 echo "docdir=$docdir" >> $config_mak
577 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
578 echo "MAKE=$make" >> $config_mak
579 echo "INSTALL=$install" >> $config_mak
580 echo "CC=$cc" >> $config_mak
581 if test "$have_gcc3_options" = "yes" ; then
582 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
584 echo "HOST_CC=$host_cc" >> $config_mak
585 echo "AR=$ar" >> $config_mak
586 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
587 echo "CFLAGS=$CFLAGS" >> $config_mak
588 echo "LDFLAGS=$LDFLAGS" >> $config_mak
589 echo "EXESUF=$EXESUF" >> $config_mak
590 if test "$cpu" = "i386" ; then
591 echo "ARCH=i386" >> $config_mak
592 echo "#define HOST_I386 1" >> $config_h
593 elif test "$cpu" = "x86_64" ; then
594 echo "ARCH=x86_64" >> $config_mak
595 echo "#define HOST_X86_64 1" >> $config_h
596 elif test "$cpu" = "armv4b" ; then
597 echo "ARCH=arm" >> $config_mak
598 echo "#define HOST_ARM 1" >> $config_h
599 elif test "$cpu" = "armv4l" ; then
600 echo "ARCH=arm" >> $config_mak
601 echo "#define HOST_ARM 1" >> $config_h
602 elif test "$cpu" = "powerpc" ; then
603 echo "ARCH=ppc" >> $config_mak
604 echo "#define HOST_PPC 1" >> $config_h
605 elif test "$cpu" = "mips" ; then
606 echo "ARCH=mips" >> $config_mak
607 echo "#define HOST_MIPS 1" >> $config_h
608 elif test "$cpu" = "s390" ; then
609 echo "ARCH=s390" >> $config_mak
610 echo "#define HOST_S390 1" >> $config_h
611 elif test "$cpu" = "alpha" ; then
612 echo "ARCH=alpha" >> $config_mak
613 echo "#define HOST_ALPHA 1" >> $config_h
614 elif test "$cpu" = "sparc" ; then
615 echo "ARCH=sparc" >> $config_mak
616 echo "#define HOST_SPARC 1" >> $config_h
617 elif test "$cpu" = "sparc64" ; then
618 echo "ARCH=sparc64" >> $config_mak
619 echo "#define HOST_SPARC64 1" >> $config_h
620 elif test "$cpu" = "ia64" ; then
621 echo "ARCH=ia64" >> $config_mak
622 echo "#define HOST_IA64 1" >> $config_h
623 elif test "$cpu" = "m68k" ; then
624 echo "ARCH=m68k" >> $config_mak
625 echo "#define HOST_M68K 1" >> $config_h
627 echo "Unsupported CPU"
630 if test "$bigendian" = "yes" ; then
631 echo "WORDS_BIGENDIAN=yes" >> $config_mak
632 echo "#define WORDS_BIGENDIAN 1" >> $config_h
634 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
635 if test "$mingw32" = "yes" ; then
636 echo "CONFIG_WIN32=yes" >> $config_mak
637 echo "#define CONFIG_WIN32 1" >> $config_h
638 elif test -f "/usr/include/byteswap.h" ; then
639 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
641 if test "$darwin" = "yes" ; then
642 echo "CONFIG_DARWIN=yes" >> $config_mak
643 echo "#define CONFIG_DARWIN 1" >> $config_h
645 if test "$solaris" = "yes" ; then
646 echo "CONFIG_SOLARIS=yes" >> $config_mak
647 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
649 if test "$gdbstub" = "yes" ; then
650 echo "CONFIG_GDBSTUB=yes" >> $config_mak
651 echo "#define CONFIG_GDBSTUB 1" >> $config_h
653 if test "$gprof" = "yes" ; then
654 echo "TARGET_GPROF=yes" >> $config_mak
655 echo "#define HAVE_GPROF 1" >> $config_h
657 if test "$static" = "yes" ; then
658 echo "CONFIG_STATIC=yes" >> $config_mak
659 echo "#define CONFIG_STATIC 1" >> $config_h
661 if test $profiler = "yes" ; then
662 echo "#define CONFIG_PROFILER 1" >> $config_h
664 if test "$slirp" = "yes" ; then
665 echo "CONFIG_SLIRP=yes" >> $config_mak
666 echo "#define CONFIG_SLIRP 1" >> $config_h
668 if test "$adlib" = "yes" ; then
669 echo "CONFIG_ADLIB=yes" >> $config_mak
670 echo "#define CONFIG_ADLIB 1" >> $config_h
672 if test "$oss" = "yes" ; then
673 echo "CONFIG_OSS=yes" >> $config_mak
674 echo "#define CONFIG_OSS 1" >> $config_h
676 if test "$coreaudio" = "yes" ; then
677 echo "CONFIG_COREAUDIO=yes" >> $config_mak
678 echo "#define CONFIG_COREAUDIO 1" >> $config_h
680 if test "$alsa" = "yes" ; then
681 echo "CONFIG_ALSA=yes" >> $config_mak
682 echo "#define CONFIG_ALSA 1" >> $config_h
684 if test "$dsound" = "yes" ; then
685 echo "CONFIG_DSOUND=yes" >> $config_mak
686 echo "#define CONFIG_DSOUND 1" >> $config_h
688 if test "$fmod" = "yes" ; then
689 echo "CONFIG_FMOD=yes" >> $config_mak
690 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
691 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
692 echo "#define CONFIG_FMOD 1" >> $config_h
694 qemu_version=`head $source_path/VERSION`
695 echo "VERSION=$qemu_version" >>$config_mak
696 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
698 echo "SRC_PATH=$source_path" >> $config_mak
699 if [ "$source_path_used" = "yes" ]; then
700 echo "VPATH=$source_path" >> $config_mak
702 echo "TARGET_DIRS=$target_list" >> $config_mak
703 if [ "$build_docs" = "yes" ] ; then
704 echo "BUILD_DOCS=yes" >> $config_mak
708 if [ "$bsd" = "yes" ] ; then
709 echo "#define O_LARGEFILE 0" >> $config_h
710 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
711 echo "#define _BSD 1" >> $config_h
714 for target in $target_list; do
716 config_mak=$target_dir/config.mak
717 config_h=$target_dir/config.h
718 target_cpu=`echo $target | cut -d '-' -f 1`
719 target_bigendian="no"
720 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
721 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
722 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
723 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
724 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
725 [ "$target_cpu" = "mips" ] && target_bigendian=yes
727 if expr $target : '.*-softmmu' > /dev/null ; then
730 target_user_only="no"
731 if expr $target : '.*-user' > /dev/null ; then
732 target_user_only="yes"
735 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
736 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
737 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
738 echo "To build QEMU without graphical output configure with --disable-gfx-check"
739 echo "Note that this will disable all output from the virtual graphics card."
743 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
746 mkdir -p $target_dir/fpu
747 if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
748 mkdir -p $target_dir/nwfpe
750 if test "$target_user_only" = "no" ; then
751 mkdir -p $target_dir/slirp
755 # don't use ln -sf as not all "ln -sf" over write the file/link
757 rm -f $target_dir/Makefile
758 ln -s $source_path/Makefile.target $target_dir/Makefile
761 echo "# Automatically generated by configure - do not modify" > $config_mak
762 echo "/* Automatically generated by configure - do not modify */" > $config_h
765 echo "include ../config-host.mak" >> $config_mak
766 echo "#include \"../config-host.h\"" >> $config_h
768 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
769 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
771 if test "$target_cpu" = "i386" ; then
772 echo "TARGET_ARCH=i386" >> $config_mak
773 echo "#define TARGET_ARCH \"i386\"" >> $config_h
774 echo "#define TARGET_I386 1" >> $config_h
775 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
776 echo "#define USE_KQEMU 1" >> $config_h
778 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
779 echo "TARGET_ARCH=arm" >> $config_mak
780 echo "#define TARGET_ARCH \"arm\"" >> $config_h
781 echo "#define TARGET_ARM 1" >> $config_h
782 elif test "$target_cpu" = "sparc" ; then
783 echo "TARGET_ARCH=sparc" >> $config_mak
784 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
785 echo "#define TARGET_SPARC 1" >> $config_h
786 elif test "$target_cpu" = "sparc64" ; then
787 echo "TARGET_ARCH=sparc64" >> $config_mak
788 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
789 echo "#define TARGET_SPARC 1" >> $config_h
790 echo "#define TARGET_SPARC64 1" >> $config_h
791 elif test "$target_cpu" = "ppc" ; then
792 echo "TARGET_ARCH=ppc" >> $config_mak
793 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
794 echo "#define TARGET_PPC 1" >> $config_h
795 elif test "$target_cpu" = "ppc64" ; then
796 echo "TARGET_ARCH=ppc64" >> $config_mak
797 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
798 echo "#define TARGET_PPC 1" >> $config_h
799 echo "#define TARGET_PPC64 1" >> $config_h
800 elif test "$target_cpu" = "x86_64" ; then
801 echo "TARGET_ARCH=x86_64" >> $config_mak
802 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
803 echo "#define TARGET_I386 1" >> $config_h
804 echo "#define TARGET_X86_64 1" >> $config_h
805 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
806 echo "#define USE_KQEMU 1" >> $config_h
808 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
809 echo "TARGET_ARCH=mips" >> $config_mak
810 echo "#define TARGET_ARCH \"mips\"" >> $config_h
811 echo "#define TARGET_MIPS 1" >> $config_h
812 elif test "$target_cpu" = "sh4" ; then
813 echo "TARGET_ARCH=sh4" >> $config_mak
814 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
815 echo "#define TARGET_SH4 1" >> $config_h
817 echo "Unsupported target CPU"
820 if test "$target_bigendian" = "yes" ; then
821 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
822 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
824 if test "$target_softmmu" = "yes" ; then
825 echo "CONFIG_SOFTMMU=yes" >> $config_mak
826 echo "#define CONFIG_SOFTMMU 1" >> $config_h
828 if test "$target_user_only" = "yes" ; then
829 echo "CONFIG_USER_ONLY=yes" >> $config_mak
830 echo "#define CONFIG_USER_ONLY 1" >> $config_h
833 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
834 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
835 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
839 if test "$target_user_only" = "no"; then
840 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
845 if test "$sdl1" = "yes" ; then
846 echo "#define CONFIG_SDL 1" >> $config_h
847 echo "CONFIG_SDL=yes" >> $config_mak
848 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
849 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
851 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
853 if [ "${aa}" = "yes" ] ; then
854 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
856 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
861 if test "$cocoa" = "yes" ; then
862 echo "#define CONFIG_COCOA 1" >> $config_h
863 echo "CONFIG_COCOA=yes" >> $config_mak
866 done # for target in $targets
868 # build tree in object directory if source path is different from current one
869 if test "$source_path_used" = "yes" ; then
871 FILES="Makefile tests/Makefile"
872 for dir in $DIRS ; do
875 # remove the link and recreate it, as not all "ln -sf" overwrite the link
878 ln -s $source_path/$f $f
882 rm -f $TMPO $TMPC $TMPE $TMPS