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.`
151 if test $solarisrev -lt 10 ; then
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"
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-"
219 --disable-slirp) slirp="no"
221 --enable-adlib) adlib="yes"
223 --disable-kqemu) kqemu="no"
225 --enable-profiler) profiler="yes"
227 --kernel-path=*) kernel_path="$optarg"
229 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
231 --disable-gfx-check) check_gfx="no"
233 --disable-gcc-check) check_gcc="no"
235 --disable-system) softmmu="no"
237 --enable-system) softmmu="yes"
239 --disable-user) user="no"
241 --enable-user) user="yes"
246 # Checking for CFLAGS
247 if test -z "$CFLAGS"; then
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"
267 echo " --kernel-path=PATH set the kernel path (configure probes it)"
269 echo "Advanced options (experts only):"
270 echo " --source-path=PATH path of source code [$source_path]"
271 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
272 echo " --cc=CC use C compiler CC [$cc]"
273 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
274 echo " --make=MAKE use specified make [$make]"
275 echo " --install=INSTALL use specified install [$install]"
276 echo " --static enable static build [$static]"
277 echo " --enable-cocoa enable COCOA (Mac OS X only)"
278 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
279 echo " --enable-adlib enable Adlib emulation"
280 echo " --enable-coreaudio enable Coreaudio audio driver"
281 echo " --enable-alsa enable ALSA audio driver"
282 echo " --enable-fmod enable FMOD audio driver"
283 echo " --enabled-dsound enable DirectSound audio driver"
284 echo " --enable-system enable all system emulation targets"
285 echo " --disable-system disable all system emulation targets"
286 echo " --enable-user enable all linux usermode emulation targets"
287 echo " --disable-user disable all linux usermode emulation targets"
288 echo " --fmod-lib path to FMOD library"
289 echo " --fmod-inc path to FMOD includes"
291 echo "NOTE: The object files are build at the place where configure is launched"
295 cc="${cross_prefix}${cc}"
296 ar="${cross_prefix}${ar}"
297 strip="${cross_prefix}${strip}"
299 if [ ! -x "`which $cc`" ] ; then
300 echo "Compiler $cc could not be found"
304 if test "$mingw32" = "yes" ; then
309 if [ "$cpu" = "i386" ] ; then
315 # Solaris specific configure tool chain decisions
317 if test "$solaris" = "yes" ; then
319 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
320 # override the check with --disable-gcc-check
322 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
324 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
325 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
326 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
327 echo "or get the latest patch from SunSolve for gcc"
331 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
332 if test -z "$solinst" ; then
333 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
334 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
335 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
338 if test "$solinst" = "/usr/sbin/install" ; then
339 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
340 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
341 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
344 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
345 if test -z "$sol_ar" ; then
346 echo "Error: No path includes ar"
347 if test -f /usr/ccs/bin/ar ; then
348 echo "Add /usr/ccs/bin to your path and rerun configure"
355 if test -z "$target_list" ; then
356 # these targets are portable
357 if [ "$softmmu" = "yes" ] ; then
358 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
360 # the following are Linux specific
361 if [ "$user" = "yes" ] ; then
362 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user sh4-user $target_list"
365 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
367 if test -z "$target_list" ; then
368 echo "No targets enabled"
372 if test -z "$cross_prefix" ; then
375 # big/little endian test
377 #include <inttypes.h>
378 int main(int argc, char ** argv){
379 volatile uint32_t i=0x01234567;
380 return (*((uint8_t*)(&i))) == 0x67;
384 if $cc -o $TMPE $TMPC 2>/dev/null ; then
385 $TMPE && bigendian="yes"
387 echo big/little test failed
392 # if cross compiling, cannot launch a program, so make a static guess
393 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
399 # host long bits test
401 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
405 # check gcc options support
411 have_gcc3_options="no"
412 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
413 have_gcc3_options="yes"
416 # Check for gcc4, error if pre-gcc4
417 if test "$check_gcc" = "yes" ; then
422 int main(){return 0;}
424 if $cc -o $TMPO $TMPC 2>/dev/null ; then
425 echo "ERROR: \"$cc\" looks like gcc 4.x"
426 echo "QEMU is known to have problems when compiled with gcc 4.x"
427 echo "It is recommended that you use gcc 3.x to build QEMU"
428 echo "To use this compiler anyway, configure with --disable-gcc-check"
433 ##########################################
438 if test -z "$sdl" ; then
440 sdl_config="sdl-config"
444 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
445 # win32 cross compilation case
446 sdl_config="i386-mingw32msvc-sdl-config"
452 #undef main /* We don't want SDL to override our main() */
453 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
456 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
457 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
458 if test "$_sdlversion" -lt 121 ; then
464 # static link with sdl ?
465 if test "$sdl" = "yes" ; then
467 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
468 sdl_static_libs=`$sdl_config --static-libs`
469 if [ "$aa" = "yes" ] ; then
470 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
473 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
479 fi # sdl compile test
481 fi # cross compilation
484 # Check if tools are available to build documentation.
485 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
489 if test "$mingw32" = "yes" ; then
490 if test -z "$prefix" ; then
491 prefix="/c/Program Files/Qemu"
498 if test -z "$prefix" ; then
501 mandir="$prefix/share/man"
502 datadir="$prefix/share/qemu"
503 docdir="$prefix/share/doc/qemu"
507 echo "Install prefix $prefix"
508 echo "BIOS directory $datadir"
509 echo "binary directory $bindir"
510 if test "$mingw32" = "no" ; then
511 echo "Manual directory $mandir"
512 echo "ELF interp prefix $interp_prefix"
514 echo "Source path $source_path"
515 echo "C compiler $cc"
516 echo "Host C compiler $host_cc"
518 echo "install $install"
520 echo "host big endian $bigendian"
521 echo "target list $target_list"
522 echo "gprof enabled $gprof"
523 echo "profiler $profiler"
524 echo "static build $static"
525 if test "$darwin" = "yes" ; then
526 echo "Cocoa support $cocoa"
528 echo "SDL support $sdl"
529 if test "$sdl" != "no" ; then
530 echo "SDL static link $sdl_static"
532 echo "mingw32 support $mingw32"
533 echo "Adlib support $adlib"
534 echo "CoreAudio support $coreaudio"
535 echo "ALSA support $alsa"
536 echo "DSound support $dsound"
537 if test "$fmod" = "yes"; then
538 if test -z $fmod_lib || test -z $fmod_inc; then
540 echo "Error: You must specify path to FMOD library and headers"
541 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
545 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
549 echo "FMOD support $fmod $fmod_support"
550 echo "kqemu support $kqemu"
551 echo "Documentation $build_docs"
553 if test $sdl_too_old = "yes"; then
554 echo "-> Your SDL version is too old - please upgrade to have SDL support"
556 #if test "$sdl_static" = "no"; then
557 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
559 config_mak="config-host.mak"
560 config_h="config-host.h"
562 #echo "Creating $config_mak and $config_h"
564 echo "# Automatically generated by configure - do not modify" > $config_mak
565 echo "# Configured with: $0 $@" >> $config_mak
566 echo "/* Automatically generated by configure - do not modify */" > $config_h
568 echo "prefix=$prefix" >> $config_mak
569 echo "bindir=$bindir" >> $config_mak
570 echo "mandir=$mandir" >> $config_mak
571 echo "datadir=$datadir" >> $config_mak
572 echo "docdir=$docdir" >> $config_mak
573 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
574 echo "MAKE=$make" >> $config_mak
575 echo "INSTALL=$install" >> $config_mak
576 echo "CC=$cc" >> $config_mak
577 if test "$have_gcc3_options" = "yes" ; then
578 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
580 echo "HOST_CC=$host_cc" >> $config_mak
581 echo "AR=$ar" >> $config_mak
582 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
583 echo "CFLAGS=$CFLAGS" >> $config_mak
584 echo "LDFLAGS=$LDFLAGS" >> $config_mak
585 echo "EXESUF=$EXESUF" >> $config_mak
586 if test "$cpu" = "i386" ; then
587 echo "ARCH=i386" >> $config_mak
588 echo "#define HOST_I386 1" >> $config_h
589 elif test "$cpu" = "x86_64" ; then
590 echo "ARCH=x86_64" >> $config_mak
591 echo "#define HOST_X86_64 1" >> $config_h
592 elif test "$cpu" = "armv4b" ; then
593 echo "ARCH=arm" >> $config_mak
594 echo "#define HOST_ARM 1" >> $config_h
595 elif test "$cpu" = "armv4l" ; then
596 echo "ARCH=arm" >> $config_mak
597 echo "#define HOST_ARM 1" >> $config_h
598 elif test "$cpu" = "powerpc" ; then
599 echo "ARCH=ppc" >> $config_mak
600 echo "#define HOST_PPC 1" >> $config_h
601 elif test "$cpu" = "mips" ; then
602 echo "ARCH=mips" >> $config_mak
603 echo "#define HOST_MIPS 1" >> $config_h
604 elif test "$cpu" = "s390" ; then
605 echo "ARCH=s390" >> $config_mak
606 echo "#define HOST_S390 1" >> $config_h
607 elif test "$cpu" = "alpha" ; then
608 echo "ARCH=alpha" >> $config_mak
609 echo "#define HOST_ALPHA 1" >> $config_h
610 elif test "$cpu" = "sparc" ; then
611 echo "ARCH=sparc" >> $config_mak
612 echo "#define HOST_SPARC 1" >> $config_h
613 elif test "$cpu" = "sparc64" ; then
614 echo "ARCH=sparc64" >> $config_mak
615 echo "#define HOST_SPARC64 1" >> $config_h
616 elif test "$cpu" = "ia64" ; then
617 echo "ARCH=ia64" >> $config_mak
618 echo "#define HOST_IA64 1" >> $config_h
619 elif test "$cpu" = "m68k" ; then
620 echo "ARCH=m68k" >> $config_mak
621 echo "#define HOST_M68K 1" >> $config_h
623 echo "Unsupported CPU"
626 if test "$bigendian" = "yes" ; then
627 echo "WORDS_BIGENDIAN=yes" >> $config_mak
628 echo "#define WORDS_BIGENDIAN 1" >> $config_h
630 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
631 if test "$mingw32" = "yes" ; then
632 echo "CONFIG_WIN32=yes" >> $config_mak
633 echo "#define CONFIG_WIN32 1" >> $config_h
634 elif test -f "/usr/include/byteswap.h" ; then
635 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
637 if test "$darwin" = "yes" ; then
638 echo "CONFIG_DARWIN=yes" >> $config_mak
639 echo "#define CONFIG_DARWIN 1" >> $config_h
641 if test "$solaris" = "yes" ; then
642 echo "CONFIG_SOLARIS=yes" >> $config_mak
643 if test "$presolaris10" = "yes" ; then
644 echo "#define _PRESOLARIS10 1" >> $config_h
647 if test "$gdbstub" = "yes" ; then
648 echo "CONFIG_GDBSTUB=yes" >> $config_mak
649 echo "#define CONFIG_GDBSTUB 1" >> $config_h
651 if test "$gprof" = "yes" ; then
652 echo "TARGET_GPROF=yes" >> $config_mak
653 echo "#define HAVE_GPROF 1" >> $config_h
655 if test "$static" = "yes" ; then
656 echo "CONFIG_STATIC=yes" >> $config_mak
657 echo "#define CONFIG_STATIC 1" >> $config_h
659 if test $profiler = "yes" ; then
660 echo "#define CONFIG_PROFILER 1" >> $config_h
662 if test "$slirp" = "yes" ; then
663 echo "CONFIG_SLIRP=yes" >> $config_mak
664 echo "#define CONFIG_SLIRP 1" >> $config_h
666 if test "$adlib" = "yes" ; then
667 echo "CONFIG_ADLIB=yes" >> $config_mak
668 echo "#define CONFIG_ADLIB 1" >> $config_h
670 if test "$oss" = "yes" ; then
671 echo "CONFIG_OSS=yes" >> $config_mak
672 echo "#define CONFIG_OSS 1" >> $config_h
674 if test "$coreaudio" = "yes" ; then
675 echo "CONFIG_COREAUDIO=yes" >> $config_mak
676 echo "#define CONFIG_COREAUDIO 1" >> $config_h
678 if test "$alsa" = "yes" ; then
679 echo "CONFIG_ALSA=yes" >> $config_mak
680 echo "#define CONFIG_ALSA 1" >> $config_h
682 if test "$dsound" = "yes" ; then
683 echo "CONFIG_DSOUND=yes" >> $config_mak
684 echo "#define CONFIG_DSOUND 1" >> $config_h
686 if test "$fmod" = "yes" ; then
687 echo "CONFIG_FMOD=yes" >> $config_mak
688 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
689 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
690 echo "#define CONFIG_FMOD 1" >> $config_h
692 qemu_version=`head $source_path/VERSION`
693 echo "VERSION=$qemu_version" >>$config_mak
694 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
696 echo "SRC_PATH=$source_path" >> $config_mak
697 if [ "$source_path_used" = "yes" ]; then
698 echo "VPATH=$source_path" >> $config_mak
700 echo "TARGET_DIRS=$target_list" >> $config_mak
701 if [ "$build_docs" = "yes" ] ; then
702 echo "BUILD_DOCS=yes" >> $config_mak
706 if [ "$bsd" = "yes" ] ; then
707 echo "#define O_LARGEFILE 0" >> $config_h
708 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
709 echo "#define _BSD 1" >> $config_h
712 for target in $target_list; do
714 config_mak=$target_dir/config.mak
715 config_h=$target_dir/config.h
716 target_cpu=`echo $target | cut -d '-' -f 1`
717 target_bigendian="no"
718 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
719 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
720 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
721 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
722 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
723 [ "$target_cpu" = "mips" ] && target_bigendian=yes
725 if expr $target : '.*-softmmu' > /dev/null ; then
728 target_user_only="no"
729 if expr $target : '.*-user' > /dev/null ; then
730 target_user_only="yes"
733 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
734 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
735 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
736 echo "To build QEMU without graphical output configure with --disable-gfx-check"
737 echo "Note that this will disable all output from the virtual graphics card."
741 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
744 mkdir -p $target_dir/fpu
745 if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
746 mkdir -p $target_dir/nwfpe
748 if test "$target_user_only" = "no" ; then
749 mkdir -p $target_dir/slirp
753 # don't use ln -sf as not all "ln -sf" over write the file/link
755 rm -f $target_dir/Makefile
756 ln -s $source_path/Makefile.target $target_dir/Makefile
759 echo "# Automatically generated by configure - do not modify" > $config_mak
760 echo "/* Automatically generated by configure - do not modify */" > $config_h
763 echo "include ../config-host.mak" >> $config_mak
764 echo "#include \"../config-host.h\"" >> $config_h
766 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
767 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
769 if test "$target_cpu" = "i386" ; then
770 echo "TARGET_ARCH=i386" >> $config_mak
771 echo "#define TARGET_ARCH \"i386\"" >> $config_h
772 echo "#define TARGET_I386 1" >> $config_h
773 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
774 echo "#define USE_KQEMU 1" >> $config_h
776 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
777 echo "TARGET_ARCH=arm" >> $config_mak
778 echo "#define TARGET_ARCH \"arm\"" >> $config_h
779 echo "#define TARGET_ARM 1" >> $config_h
780 elif test "$target_cpu" = "sparc" ; then
781 echo "TARGET_ARCH=sparc" >> $config_mak
782 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
783 echo "#define TARGET_SPARC 1" >> $config_h
784 elif test "$target_cpu" = "sparc64" ; then
785 echo "TARGET_ARCH=sparc64" >> $config_mak
786 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
787 echo "#define TARGET_SPARC 1" >> $config_h
788 echo "#define TARGET_SPARC64 1" >> $config_h
789 elif test "$target_cpu" = "ppc" ; then
790 echo "TARGET_ARCH=ppc" >> $config_mak
791 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
792 echo "#define TARGET_PPC 1" >> $config_h
793 elif test "$target_cpu" = "ppc64" ; then
794 echo "TARGET_ARCH=ppc64" >> $config_mak
795 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
796 echo "#define TARGET_PPC 1" >> $config_h
797 echo "#define TARGET_PPC64 1" >> $config_h
798 elif test "$target_cpu" = "x86_64" ; then
799 echo "TARGET_ARCH=x86_64" >> $config_mak
800 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
801 echo "#define TARGET_I386 1" >> $config_h
802 echo "#define TARGET_X86_64 1" >> $config_h
803 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
804 echo "#define USE_KQEMU 1" >> $config_h
806 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
807 echo "TARGET_ARCH=mips" >> $config_mak
808 echo "#define TARGET_ARCH \"mips\"" >> $config_h
809 echo "#define TARGET_MIPS 1" >> $config_h
810 elif test "$target_cpu" = "sh4" ; then
811 echo "TARGET_ARCH=sh4" >> $config_mak
812 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
813 echo "#define TARGET_SH4 1" >> $config_h
815 echo "Unsupported target CPU"
818 if test "$target_bigendian" = "yes" ; then
819 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
820 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
822 if test "$target_softmmu" = "yes" ; then
823 echo "CONFIG_SOFTMMU=yes" >> $config_mak
824 echo "#define CONFIG_SOFTMMU 1" >> $config_h
826 if test "$target_user_only" = "yes" ; then
827 echo "CONFIG_USER_ONLY=yes" >> $config_mak
828 echo "#define CONFIG_USER_ONLY 1" >> $config_h
831 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
832 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
833 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
837 if test "$target_user_only" = "no"; then
838 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
843 if test "$sdl1" = "yes" ; then
844 echo "#define CONFIG_SDL 1" >> $config_h
845 echo "CONFIG_SDL=yes" >> $config_mak
846 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
847 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
849 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
851 if [ "${aa}" = "yes" ] ; then
852 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
854 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
859 if test "$cocoa" = "yes" ; then
860 echo "#define CONFIG_COCOA 1" >> $config_h
861 echo "CONFIG_COCOA=yes" >> $config_mak
864 done # for target in $targets
866 # build tree in object directory if source path is different from current one
867 if test "$source_path_used" = "yes" ; then
869 FILES="Makefile tests/Makefile"
870 for dir in $DIRS ; do
873 # remove the link and recreate it, as not all "ln -sf" overwrite the link
876 ln -s $source_path/$f $f
880 rm -f $TMPO $TMPC $TMPE $TMPS