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
)
110 OS_CFLAGS
="-mno-cygwin"
117 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
124 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
142 OS_CFLAGS
="-mdynamic-no-pic"
148 needs_libsunmath
="no"
149 solarisrev
=`uname -r | cut -f2 -d.`
150 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
151 if test "$solarisrev" -le 9 ; then
152 if test -f /opt
/SUNWspro
/prod
/lib
/libsunmath.so
.1; then
153 needs_libsunmath
="yes"
155 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
156 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
157 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
158 echo "Studio 11 can be downloaded from www.sun.com."
162 if test "$solarisrev" -ge 9 ; then
166 if test -f /usr
/include
/sys
/soundcard.h
; then
174 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
180 if [ "$bsd" = "yes" ] ; then
181 if [ "$darwin" != "yes" ] ; then
187 source_path
=`dirname "$0"`
188 if [ -z "$source_path" ]; then
191 source_path
=`cd "$source_path"; pwd`
193 if test "$source_path" = `pwd` ; then
194 source_path_used
="no"
196 source_path_used
="yes"
200 optarg
=`expr "x$opt" : 'x[^=]*=\(.*\)'`
202 --help|
-h) show_help
=yes
204 --prefix=*) prefix
="$optarg"
206 --interp-prefix=*) interp_prefix
="$optarg"
208 --source-path=*) source_path
="$optarg"
209 source_path_used
="yes"
211 --cross-prefix=*) cross_prefix
="$optarg"
216 --host-cc=*) host_cc
="$optarg"
218 --make=*) make="$optarg"
220 --install=*) install="$optarg"
222 --extra-cflags=*) CFLAGS
="$optarg"
224 --extra-ldflags=*) LDFLAGS
="$optarg"
226 --cpu=*) cpu
="$optarg"
228 --target-list=*) target_list
="$optarg"
230 --enable-gprof) gprof
="yes"
232 --static) static
="yes"
234 --disable-sdl) sdl
="no"
236 --enable-coreaudio) coreaudio
="yes"
238 --enable-alsa) alsa
="yes"
240 --enable-dsound) dsound
="yes"
242 --enable-fmod) fmod
="yes"
244 --fmod-lib=*) fmod_lib
="$optarg"
246 --fmod-inc=*) fmod_inc
="$optarg"
248 --enable-mingw32) mingw32
="yes" ; cross_prefix
="i386-mingw32-" ; linux_user
="no"
250 --disable-slirp) slirp
="no"
252 --enable-adlib) adlib
="yes"
254 --disable-kqemu) kqemu
="no"
256 --enable-profiler) profiler
="yes"
258 --enable-cocoa) cocoa
="yes" ; coreaudio
="yes" ; sdl
="no"
260 --disable-gfx-check) check_gfx
="no"
262 --disable-gcc-check) check_gcc
="no"
264 --disable-system) softmmu
="no"
266 --enable-system) softmmu
="yes"
268 --disable-linux-user) linux_user
="no"
270 --enable-linux-user) linux_user
="yes"
272 --disable-darwin-user) darwin_user
="no"
274 --enable-darwin-user) darwin_user
="yes"
276 --enable-uname-release=*) uname_release
="$optarg"
281 v7|v8
) SP_CFLAGS
="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
282 target_cpu
="sparc"; cpu
="sparc" ;;
283 v8plus|v8plusa
) SP_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m32"
284 target_cpu
="sparc"; cpu
="sparc" ;;
285 v9
) SP_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS
="-m64"
286 target_cpu
="sparc64"; cpu
="sparc64" ;;
287 *) echo "undefined SPARC architecture. Exiting";exit 1;;
293 if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
299 # default flags for all hosts
300 CFLAGS
="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
301 LDFLAGS
="$LDFLAGS -g"
304 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
305 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
308 sparc
) if test -z "$sparc_cpu" ; then
309 ARCH_CFLAGS
="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
312 ARCH_CFLAGS
="${SP_CFLAGS}"
313 ARCH_LDFLAGS
="${SP_LDFLAGS}"
316 sparc64
) if test -z "$sparc_cpu" ; then
317 ARCH_CFLAGS
="-m64 -mcpu=ultrasparc -D__sparc_v9__"
320 ARCH_CFLAGS
="${SP_CFLAGS}"
321 ARCH_LDFLAGS
="${SP_LDFLAGS}"
326 if test x
"$show_help" = x
"yes" ; then
329 Usage: configure [options]
330 Options: [defaults in brackets after descriptions]
333 echo "Standard options:"
334 echo " --help print this message"
335 echo " --prefix=PREFIX install in PREFIX [$prefix]"
336 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
337 echo " use %M for cpu name [$interp_prefix]"
338 echo " --target-list=LIST set target list [$target_list]"
340 echo "kqemu kernel acceleration support:"
341 echo " --disable-kqemu disable kqemu support"
343 echo "Advanced options (experts only):"
344 echo " --source-path=PATH path of source code [$source_path]"
345 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
346 echo " --cc=CC use C compiler CC [$cc]"
347 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
348 echo " --make=MAKE use specified make [$make]"
349 echo " --install=INSTALL use specified install [$install]"
350 echo " --static enable static build [$static]"
351 echo " --enable-cocoa enable COCOA (Mac OS X only)"
352 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
353 echo " --enable-adlib enable Adlib emulation"
354 echo " --enable-coreaudio enable Coreaudio audio driver"
355 echo " --enable-alsa enable ALSA audio driver"
356 echo " --enable-fmod enable FMOD audio driver"
357 echo " --enable-dsound enable DirectSound audio driver"
358 echo " --enable-system enable all system emulation targets"
359 echo " --disable-system disable all system emulation targets"
360 echo " --enable-linux-user enable all linux usermode emulation targets"
361 echo " --disable-linux-user disable all linux usermode emulation targets"
362 echo " --enable-darwin-user enable all darwin usermode emulation targets"
363 echo " --disable-darwin-user disable all darwin usermode emulation targets"
364 echo " --fmod-lib path to FMOD library"
365 echo " --fmod-inc path to FMOD includes"
366 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
367 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
369 echo "NOTE: The object files are built at the place where configure is launched"
373 cc
="${cross_prefix}${cc}"
374 ar="${cross_prefix}${ar}"
375 strip
="${cross_prefix}${strip}"
377 # check that the C compiler works.
382 if $cc -c -o $TMPO $TMPC 2> /dev
/null
; then
383 : C compiler works ok
385 echo "ERROR: \"$cc\" either does not exist or does not work"
389 if test "$mingw32" = "yes" ; then
393 if [ "$cpu" = "i386" ] ; then
398 # Check for gcc4, error if pre-gcc4
399 if test "$check_gcc" = "yes" ; then
404 int main(){return 0;}
406 if "$cc" -o $TMPE $TMPC 2> /dev
/null
; then
407 echo "WARNING: \"$cc\" looks like gcc 4.x"
409 if test "$gcc3_search" = "yes" ; then
410 echo "Looking for gcc 3.x"
411 for compat_cc
in $gcc3_list ; do
412 if "$cross_prefix$compat_cc" --version > /dev
/null
2>&1 ; then
413 echo "Found \"$compat_cc\""
414 cc
="$cross_prefix$compat_cc"
415 found_compat_cc
="yes"
419 if test "$found_compat_cc" = "no" ; then
420 echo "gcc 3.x not found!"
423 if test "$found_compat_cc" = "no" ; then
424 echo "QEMU is known to have problems when compiled with gcc 4.x"
425 echo "It is recommended that you use gcc 3.x to build QEMU"
426 echo "To use this compiler anyway, configure with --disable-gcc-check"
433 # Solaris specific configure tool chain decisions
435 if test "$solaris" = "yes" ; then
437 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
438 # override the check with --disable-gcc-check
440 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
442 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
443 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
444 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
445 echo "or get the latest patch from SunSolve for gcc"
449 solinst
=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
450 if test -z "$solinst" ; then
451 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
452 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
453 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
456 if test "$solinst" = "/usr/sbin/install" ; then
457 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
458 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
459 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
462 sol_ar
=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
463 if test -z "$sol_ar" ; then
464 echo "Error: No path includes ar"
465 if test -f /usr
/ccs
/bin
/ar ; then
466 echo "Add /usr/ccs/bin to your path and rerun configure"
473 if test -z "$target_list" ; then
474 # these targets are portable
475 if [ "$softmmu" = "yes" ] ; then
476 target_list
="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu ppcemb-softmmu m68k-softmmu"
478 # the following are Linux specific
479 if [ "$linux_user" = "yes" ] ; then
480 target_list
="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user $target_list"
482 # the following are Darwin specific
483 if [ "$darwin_user" = "yes" ] ; then
484 target_list
="i386-darwin-user ppc-darwin-user $target_list"
487 target_list
=`echo "$target_list" | sed -e 's/,/ /g'`
489 if test -z "$target_list" ; then
490 echo "No targets enabled"
494 if test -z "$cross_prefix" ; then
497 # big/little endian test
499 #include <inttypes.h>
500 int main(int argc, char ** argv){
501 volatile uint32_t i=0x01234567;
502 return (*((uint8_t*)(&i))) == 0x67;
506 if $cc -o $TMPE $TMPC 2> /dev
/null
; then
507 $TMPE && bigendian
="yes"
509 echo big
/little
test failed
514 # if cross compiling, cannot launch a program, so make a static guess
515 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "mips64" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
521 # host long bits test
523 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
527 # check gcc options support
533 ##########################################
538 if test -z "$sdl" ; then
540 sdl_config
="sdl-config"
544 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
545 # win32 cross compilation case
546 sdl_config
="i386-mingw32msvc-sdl-config"
552 #undef main /* We don't want SDL to override our main() */
553 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
556 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev
/null
; then
557 _sdlversion
=`$sdl_config --version | sed 's/[^0-9]//g'`
558 if test "$_sdlversion" -lt 121 ; then
561 if test "$cocoa" = "no" ; then
566 # static link with sdl ?
567 if test "$sdl" = "yes" ; then
569 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa
="yes"
570 sdl_static_libs
=`$sdl_config --static-libs 2>/dev/null`
571 if [ "$aa" = "yes" ] ; then
572 sdl_static_libs
="$sdl_static_libs `aalib-config --static-libs`"
575 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev
/null
; then
581 fi # sdl compile test
583 fi # cross compilation
586 # Make sure to disable cocoa if sdl was set
587 if test "$sdl" = "yes" ; then
593 ##########################################
594 # alsa sound support libraries
596 if test "$alsa" = "yes" ; then
598 #include <alsa/asoundlib.h>
599 int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
601 if $cc -o $TMPE $TMPC -lasound 2> /dev
/null
; then
605 echo "Error: Could not find alsa"
606 echo "Make sure to have the alsa libs and headers installed."
612 # Check if tools are available to build documentation.
613 if [ -x "`which texi2html 2>/dev/null`" ] && \
614 [ -x "`which pod2man 2>/dev/null`" ]; then
618 if test "$mingw32" = "yes" ; then
619 if test -z "$prefix" ; then
620 prefix
="/c/Program Files/Qemu"
627 if test -z "$prefix" ; then
630 mansuffix
="/share/man"
631 datasuffix
="/share/qemu"
632 docsuffix
="/share/doc/qemu"
636 echo "Install prefix $prefix"
637 echo "BIOS directory $prefix$datasuffix"
638 echo "binary directory $prefix$binsuffix"
639 if test "$mingw32" = "no" ; then
640 echo "Manual directory $prefix$mansuffix"
641 echo "ELF interp prefix $interp_prefix"
643 echo "Source path $source_path"
644 echo "C compiler $cc"
645 echo "Host C compiler $host_cc"
647 echo "install $install"
649 echo "host big endian $bigendian"
650 echo "target list $target_list"
651 echo "gprof enabled $gprof"
652 echo "profiler $profiler"
653 echo "static build $static"
654 if test "$darwin" = "yes" ; then
655 echo "Cocoa support $cocoa"
657 echo "SDL support $sdl"
658 if test "$sdl" != "no" ; then
659 echo "SDL static link $sdl_static"
661 echo "mingw32 support $mingw32"
662 echo "Adlib support $adlib"
663 echo "CoreAudio support $coreaudio"
664 echo "ALSA support $alsa"
665 echo "DSound support $dsound"
666 if test "$fmod" = "yes"; then
667 if test -z $fmod_lib ||
test -z $fmod_inc; then
669 echo "Error: You must specify path to FMOD library and headers"
670 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
674 fmod_support
=" (lib='$fmod_lib' include='$fmod_inc')"
678 echo "FMOD support $fmod $fmod_support"
679 echo "OSS support $oss"
680 if test -n "$sparc_cpu"; then
681 echo "Target Sparc Arch $sparc_cpu"
683 echo "kqemu support $kqemu"
684 echo "Documentation $build_docs"
685 [ ! -z "$uname_release" ] && \
686 echo "uname -r $uname_release"
688 if test $sdl_too_old = "yes"; then
689 echo "-> Your SDL version is too old - please upgrade to have SDL support"
691 #if test "$sdl_static" = "no"; then
692 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
694 config_mak
="config-host.mak"
695 config_h
="config-host.h"
697 #echo "Creating $config_mak and $config_h"
699 echo "# Automatically generated by configure - do not modify" > $config_mak
700 echo "# Configured with: $0 $@" >> $config_mak
701 echo "/* Automatically generated by configure - do not modify */" > $config_h
703 echo "prefix=$prefix" >> $config_mak
704 echo "bindir=\${prefix}$binsuffix" >> $config_mak
705 echo "mandir=\${prefix}$mansuffix" >> $config_mak
706 echo "datadir=\${prefix}$datasuffix" >> $config_mak
707 echo "docdir=\${prefix}$docsuffix" >> $config_mak
708 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
709 echo "MAKE=$make" >> $config_mak
710 echo "INSTALL=$install" >> $config_mak
711 echo "CC=$cc" >> $config_mak
712 echo "HOST_CC=$host_cc" >> $config_mak
713 echo "AR=$ar" >> $config_mak
714 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
715 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
716 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
717 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
718 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
719 echo "CFLAGS=$CFLAGS" >> $config_mak
720 echo "LDFLAGS=$LDFLAGS" >> $config_mak
721 echo "EXESUF=$EXESUF" >> $config_mak
722 echo "AIOLIBS=$AIOLIBS" >> $config_mak
723 if test "$cpu" = "i386" ; then
724 echo "ARCH=i386" >> $config_mak
725 echo "#define HOST_I386 1" >> $config_h
726 elif test "$cpu" = "x86_64" ; then
727 echo "ARCH=x86_64" >> $config_mak
728 echo "#define HOST_X86_64 1" >> $config_h
729 elif test "$cpu" = "armv4b" ; then
730 echo "ARCH=arm" >> $config_mak
731 echo "#define HOST_ARM 1" >> $config_h
732 elif test "$cpu" = "armv4l" ; then
733 echo "ARCH=arm" >> $config_mak
734 echo "#define HOST_ARM 1" >> $config_h
735 elif test "$cpu" = "powerpc" ; then
736 echo "ARCH=ppc" >> $config_mak
737 echo "#define HOST_PPC 1" >> $config_h
738 elif test "$cpu" = "mips" ; then
739 echo "ARCH=mips" >> $config_mak
740 echo "#define HOST_MIPS 1" >> $config_h
741 elif test "$cpu" = "mips64" ; then
742 echo "ARCH=mips64" >> $config_mak
743 echo "#define HOST_MIPS64 1" >> $config_h
744 elif test "$cpu" = "s390" ; then
745 echo "ARCH=s390" >> $config_mak
746 echo "#define HOST_S390 1" >> $config_h
747 elif test "$cpu" = "alpha" ; then
748 echo "ARCH=alpha" >> $config_mak
749 echo "#define HOST_ALPHA 1" >> $config_h
750 elif test "$cpu" = "sparc" ; then
751 echo "ARCH=sparc" >> $config_mak
752 echo "#define HOST_SPARC 1" >> $config_h
753 elif test "$cpu" = "sparc64" ; then
754 echo "ARCH=sparc64" >> $config_mak
755 echo "#define HOST_SPARC64 1" >> $config_h
756 elif test "$cpu" = "ia64" ; then
757 echo "ARCH=ia64" >> $config_mak
758 echo "#define HOST_IA64 1" >> $config_h
759 elif test "$cpu" = "m68k" ; then
760 echo "ARCH=m68k" >> $config_mak
761 echo "#define HOST_M68K 1" >> $config_h
763 echo "Unsupported CPU = $cpu"
766 if test "$bigendian" = "yes" ; then
767 echo "WORDS_BIGENDIAN=yes" >> $config_mak
768 echo "#define WORDS_BIGENDIAN 1" >> $config_h
770 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
771 if test "$mingw32" = "yes" ; then
772 echo "CONFIG_WIN32=yes" >> $config_mak
773 echo "#define CONFIG_WIN32 1" >> $config_h
776 #include <byteswap.h>
777 int main(void) { return bswap_32(0); }
779 if $cc -o $TMPE $TMPC 2> /dev
/null
; then
780 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
783 if test "$darwin" = "yes" ; then
784 echo "CONFIG_DARWIN=yes" >> $config_mak
785 echo "#define CONFIG_DARWIN 1" >> $config_h
787 if test "$solaris" = "yes" ; then
788 echo "CONFIG_SOLARIS=yes" >> $config_mak
789 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
790 if test "$needs_libsunmath" = "yes" ; then
791 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
792 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
795 if test -n "$sparc_cpu"; then
796 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
797 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
799 if test "$gdbstub" = "yes" ; then
800 echo "CONFIG_GDBSTUB=yes" >> $config_mak
801 echo "#define CONFIG_GDBSTUB 1" >> $config_h
803 if test "$gprof" = "yes" ; then
804 echo "TARGET_GPROF=yes" >> $config_mak
805 echo "#define HAVE_GPROF 1" >> $config_h
807 if test "$static" = "yes" ; then
808 echo "CONFIG_STATIC=yes" >> $config_mak
809 echo "#define CONFIG_STATIC 1" >> $config_h
811 if test $profiler = "yes" ; then
812 echo "#define CONFIG_PROFILER 1" >> $config_h
814 if test "$slirp" = "yes" ; then
815 echo "CONFIG_SLIRP=yes" >> $config_mak
816 echo "#define CONFIG_SLIRP 1" >> $config_h
818 if test "$adlib" = "yes" ; then
819 echo "CONFIG_ADLIB=yes" >> $config_mak
820 echo "#define CONFIG_ADLIB 1" >> $config_h
822 if test "$oss" = "yes" ; then
823 echo "CONFIG_OSS=yes" >> $config_mak
824 echo "#define CONFIG_OSS 1" >> $config_h
826 if test "$coreaudio" = "yes" ; then
827 echo "CONFIG_COREAUDIO=yes" >> $config_mak
828 echo "#define CONFIG_COREAUDIO 1" >> $config_h
830 if test "$alsa" = "yes" ; then
831 echo "CONFIG_ALSA=yes" >> $config_mak
832 echo "#define CONFIG_ALSA 1" >> $config_h
834 if test "$dsound" = "yes" ; then
835 echo "CONFIG_DSOUND=yes" >> $config_mak
836 echo "#define CONFIG_DSOUND 1" >> $config_h
838 if test "$fmod" = "yes" ; then
839 echo "CONFIG_FMOD=yes" >> $config_mak
840 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
841 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
842 echo "#define CONFIG_FMOD 1" >> $config_h
844 qemu_version
=`head $source_path/VERSION`
845 echo "VERSION=$qemu_version" >>$config_mak
846 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
848 echo "SRC_PATH=$source_path" >> $config_mak
849 if [ "$source_path_used" = "yes" ]; then
850 echo "VPATH=$source_path" >> $config_mak
852 echo "TARGET_DIRS=$target_list" >> $config_mak
853 if [ "$build_docs" = "yes" ] ; then
854 echo "BUILD_DOCS=yes" >> $config_mak
858 if [ "$bsd" = "yes" ] ; then
859 echo "#define O_LARGEFILE 0" >> $config_h
860 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
861 echo "#define _BSD 1" >> $config_h
864 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
866 for target
in $target_list; do
868 config_mak
=$target_dir/config.mak
869 config_h
=$target_dir/config.h
870 target_cpu
=`echo $target | cut -d '-' -f 1`
871 target_bigendian
="no"
872 [ "$target_cpu" = "armeb" ] && target_bigendian
=yes
873 [ "$target_cpu" = "sparc" ] && target_bigendian
=yes
874 [ "$target_cpu" = "sparc64" ] && target_bigendian
=yes
875 [ "$target_cpu" = "ppc" ] && target_bigendian
=yes
876 [ "$target_cpu" = "ppc64" ] && target_bigendian
=yes
877 [ "$target_cpu" = "ppcemb" ] && target_bigendian
=yes
878 [ "$target_cpu" = "mips" ] && target_bigendian
=yes
879 [ "$target_cpu" = "mips64" ] && target_bigendian
=yes
880 [ "$target_cpu" = "sh4eb" ] && target_bigendian
=yes
881 [ "$target_cpu" = "m68k" ] && target_bigendian
=yes
883 target_user_only
="no"
884 target_linux_user
="no"
885 target_darwin_user
="no"
887 ${target_cpu}-softmmu)
890 ${target_cpu}-linux-user)
891 target_user_only
="yes"
892 target_linux_user
="yes"
894 ${target_cpu}-darwin-user)
895 target_user_only
="yes"
896 target_darwin_user
="yes"
899 echo "ERROR: Target '$target' not recognised"
904 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
905 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
906 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
907 echo "To build QEMU without graphical output configure with --disable-gfx-check"
908 echo "Note that this will disable all output from the virtual graphics card."
912 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
915 mkdir
-p $target_dir/fpu
916 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
917 mkdir
-p $target_dir/nwfpe
919 if test "$target_user_only" = "no" ; then
920 mkdir
-p $target_dir/slirp
924 # don't use ln -sf as not all "ln -sf" over write the file/link
926 rm -f $target_dir/Makefile
927 ln -s $source_path/Makefile.target
$target_dir/Makefile
930 echo "# Automatically generated by configure - do not modify" > $config_mak
931 echo "/* Automatically generated by configure - do not modify */" > $config_h
934 echo "include ../config-host.mak" >> $config_mak
935 echo "#include \"../config-host.h\"" >> $config_h
938 interp_prefix1
=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
939 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
941 if test "$target_cpu" = "i386" ; then
942 echo "TARGET_ARCH=i386" >> $config_mak
943 echo "#define TARGET_ARCH \"i386\"" >> $config_h
944 echo "#define TARGET_I386 1" >> $config_h
945 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
946 echo "#define USE_KQEMU 1" >> $config_h
948 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
949 echo "TARGET_ARCH=arm" >> $config_mak
950 echo "#define TARGET_ARCH \"arm\"" >> $config_h
951 echo "#define TARGET_ARM 1" >> $config_h
953 elif test "$target_cpu" = "sparc" ; then
954 echo "TARGET_ARCH=sparc" >> $config_mak
955 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
956 echo "#define TARGET_SPARC 1" >> $config_h
957 elif test "$target_cpu" = "sparc64" ; then
958 echo "TARGET_ARCH=sparc64" >> $config_mak
959 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
960 echo "#define TARGET_SPARC 1" >> $config_h
961 echo "#define TARGET_SPARC64 1" >> $config_h
962 elif test "$target_cpu" = "ppc" ; then
963 echo "TARGET_ARCH=ppc" >> $config_mak
964 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
965 echo "#define TARGET_PPC 1" >> $config_h
966 elif test "$target_cpu" = "ppc64" ; then
967 echo "TARGET_ARCH=ppc64" >> $config_mak
968 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
969 echo "#define TARGET_PPC 1" >> $config_h
970 echo "#define TARGET_PPC64 1" >> $config_h
971 elif test "$target_cpu" = "ppcemb" ; then
972 echo "TARGET_ARCH=ppcemb" >> $config_mak
973 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
974 echo "#define TARGET_PPC 1" >> $config_h
975 echo "#define TARGET_PPCEMB 1" >> $config_h
976 elif test "$target_cpu" = "x86_64" ; then
977 echo "TARGET_ARCH=x86_64" >> $config_mak
978 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
979 echo "#define TARGET_I386 1" >> $config_h
980 echo "#define TARGET_X86_64 1" >> $config_h
981 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
982 echo "#define USE_KQEMU 1" >> $config_h
984 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
985 echo "TARGET_ARCH=mips" >> $config_mak
986 echo "#define TARGET_ARCH \"mips\"" >> $config_h
987 echo "#define TARGET_MIPS 1" >> $config_h
988 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
989 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
990 elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
991 echo "TARGET_ARCH=mips64" >> $config_mak
992 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
993 echo "#define TARGET_MIPS 1" >> $config_h
994 echo "#define TARGET_MIPS64 1" >> $config_h
995 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
996 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
997 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
998 echo "TARGET_ARCH=sh4" >> $config_mak
999 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1000 echo "#define TARGET_SH4 1" >> $config_h
1002 elif test "$target_cpu" = "m68k" ; then
1003 echo "TARGET_ARCH=m68k" >> $config_mak
1004 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1005 echo "#define TARGET_M68K 1" >> $config_h
1007 elif test "$target_cpu" = "alpha" ; then
1008 echo "TARGET_ARCH=alpha" >> $config_mak
1009 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1010 echo "#define TARGET_ALPHA 1" >> $config_h
1012 echo "Unsupported target CPU"
1015 if test "$target_bigendian" = "yes" ; then
1016 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1017 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1019 if test "$target_softmmu" = "yes" ; then
1020 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1021 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1023 if test "$target_user_only" = "yes" ; then
1024 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1025 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1027 if test "$target_linux_user" = "yes" ; then
1028 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1029 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1031 if test "$target_darwin_user" = "yes" ; then
1032 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1033 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1036 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
1037 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1038 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1040 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1041 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1042 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1046 if test "$target_user_only" = "no"; then
1047 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1052 if test "$sdl1" = "yes" ; then
1053 echo "#define CONFIG_SDL 1" >> $config_h
1054 echo "CONFIG_SDL=yes" >> $config_mak
1055 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1056 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1058 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1060 if [ "${aa}" = "yes" ] ; then
1061 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1063 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1068 if test "$cocoa" = "yes" ; then
1069 echo "#define CONFIG_COCOA 1" >> $config_h
1070 echo "CONFIG_COCOA=yes" >> $config_mak
1073 done # for target in $targets
1075 # build tree in object directory if source path is different from current one
1076 if test "$source_path_used" = "yes" ; then
1078 FILES
="Makefile tests/Makefile"
1079 for dir
in $DIRS ; do
1082 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1083 for f
in $FILES ; do
1085 ln -s $source_path/$f $f
1089 rm -f $TMPO $TMPC $TMPE $TMPS