kvm: qemu: LSI SCSI and e1000 unregister callbacks
[kvm-userspace.git] / qemu / configure
blobbbedddceb4e57fe16436b4fbdb69f47881093490
1 #!/bin/sh
3 # qemu configure script (c) 2003 Fabrice Bellard
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8 elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10 else
11 TMPDIR1="/tmp"
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"
19 # default parameters
20 prefix=""
21 interp_prefix="/usr/gnemul/qemu-%M"
22 static="no"
23 cross_prefix=""
24 cc="gcc"
25 gcc3_search="yes"
26 gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
27 host_cc="gcc"
28 ar="ar"
29 make="make"
30 install="install"
31 strip="strip"
32 cpu=`uname -m`
33 target_list=""
34 case "$cpu" in
35 i386|i486|i586|i686|i86pc|BePC)
36 cpu="i386"
38 armv*b)
39 cpu="armv4b"
41 armv*l)
42 cpu="armv4l"
44 alpha)
45 cpu="alpha"
47 "Power Macintosh"|ppc|ppc64)
48 cpu="powerpc"
50 mips)
51 cpu="mips"
53 mips64)
54 cpu="mips64"
56 cris)
57 cpu="cris"
59 s390*)
60 cpu="s390"
62 sparc|sun4[cdmuv])
63 cpu="sparc"
65 sparc64)
66 cpu="sparc64"
68 ia64)
69 cpu="ia64"
71 m68k)
72 cpu="m68k"
74 x86_64|amd64)
75 cpu="x86_64"
78 cpu="unknown"
80 esac
81 gprof="no"
82 bigendian="no"
83 mingw32="no"
84 EXESUF=""
85 gdbstub="yes"
86 slirp="yes"
87 adlib="no"
88 ac97="no"
89 gus="no"
90 oss="no"
91 dsound="no"
92 coreaudio="no"
93 alsa="no"
94 esd="no"
95 fmod="no"
96 fmod_lib=""
97 fmod_inc=""
98 vnc_tls="yes"
99 bsd="no"
100 linux="no"
101 kqemu="no"
102 kvm="no"
103 profiler="no"
104 kernel_path=""
105 cocoa="no"
106 check_gfx="yes"
107 check_gcc="yes"
108 softmmu="yes"
109 linux_user="no"
110 darwin_user="no"
111 build_docs="no"
112 uname_release=""
113 curses="yes"
114 cpu_emulation="yes"
116 # OS specific
117 targetos=`uname -s`
118 case $targetos in
119 CYGWIN*)
120 mingw32="yes"
121 OS_CFLAGS="-mno-cygwin"
122 if [ "$cpu" = "i386" ] ; then
123 kqemu="yes"
126 MINGW32*)
127 mingw32="yes"
128 if [ "$cpu" = "i386" ] ; then
129 kqemu="yes"
132 GNU/kFreeBSD)
133 oss="yes"
134 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
135 kqemu="yes"
138 FreeBSD)
139 bsd="yes"
140 oss="yes"
141 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
142 kqemu="yes"
143 kvm="yes"
146 NetBSD)
147 bsd="yes"
148 oss="yes"
150 OpenBSD)
151 bsd="yes"
152 oss="yes"
154 Darwin)
155 bsd="yes"
156 darwin="yes"
157 darwin_user="yes"
158 cocoa="yes"
159 coreaudio="yes"
160 OS_CFLAGS="-mdynamic-no-pic"
161 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
163 SunOS)
164 solaris="yes"
165 make="gmake"
166 install="ginstall"
167 needs_libsunmath="no"
168 solarisrev=`uname -r | cut -f2 -d.`
169 # have to select again, because `uname -m` returns i86pc
170 # even on an x86_64 box.
171 solariscpu=`isainfo -k`
172 if test "${solariscpu}" = "amd64" ; then
173 cpu="x86_64"
175 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
176 if test "$solarisrev" -le 9 ; then
177 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
178 needs_libsunmath="yes"
179 else
180 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
181 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
182 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
183 echo "Studio 11 can be downloaded from www.sun.com."
184 exit 1
187 if test "$solarisrev" -ge 9 ; then
188 kqemu="yes"
191 if test -f /usr/include/sys/soundcard.h ; then
192 oss=yes
196 oss="yes"
197 linux="yes"
198 linux_user="yes"
199 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
200 kqemu="yes"
201 kvm="yes"
203 if [ "$cpu" = "ia64" ] ; then
204 kvm="yes"
205 gdbstub="no"
206 slirp="no"
208 if [ "$cpu" = "powerpc" ]; then
209 kvm="yes"
212 esac
214 if [ "$bsd" = "yes" ] ; then
215 if [ "$darwin" != "yes" ] ; then
216 make="gmake"
220 # find source path
221 source_path=`dirname "$0"`
222 source_path_used="no"
223 workdir=`pwd`
224 if [ -z "$source_path" ]; then
225 source_path=$workdir
226 else
227 source_path=`cd "$source_path"; pwd`
229 [ -f "$workdir/vl.c" ] || source_path_used="yes"
231 werror="no"
232 # generate compile errors on warnings for development builds
233 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
234 #werror="yes";
237 for opt do
238 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
239 case "$opt" in
240 --help|-h) show_help=yes
242 --prefix=*) prefix="$optarg"
244 --interp-prefix=*) interp_prefix="$optarg"
246 --source-path=*) source_path="$optarg"
247 source_path_used="yes"
249 --cross-prefix=*) cross_prefix="$optarg"
251 --cc=*) cc="$optarg"
252 gcc3_search="no"
254 --host-cc=*) host_cc="$optarg"
256 --make=*) make="$optarg"
258 --install=*) install="$optarg"
260 --extra-cflags=*) CFLAGS="$optarg"
262 --extra-ldflags=*) LDFLAGS="$optarg"
264 --cpu=*) cpu="$optarg"
266 --target-list=*) target_list="$optarg"
268 --enable-gprof) gprof="yes"
270 --static) static="yes"
272 --disable-sdl) sdl="no"
274 --enable-coreaudio) coreaudio="yes"
276 --enable-alsa) alsa="yes"
278 --enable-esd) esd="yes"
280 --enable-dsound) dsound="yes"
282 --enable-fmod) fmod="yes"
284 --fmod-lib=*) fmod_lib="$optarg"
286 --fmod-inc=*) fmod_inc="$optarg"
288 --disable-vnc-tls) vnc_tls="no"
290 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
292 --disable-slirp) slirp="no"
294 --enable-adlib) adlib="yes"
296 --enable-ac97) ac97="yes"
298 --enable-gus) gus="yes"
300 --disable-kqemu) kqemu="no"
302 --disable-kvm) kvm="no"
304 --enable-profiler) profiler="yes"
306 --kernel-path=*) kernel_path="$optarg"
308 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
310 --disable-gfx-check) check_gfx="no"
312 --disable-gcc-check) check_gcc="no"
314 --disable-system) softmmu="no"
316 --enable-system) softmmu="yes"
318 --disable-linux-user) linux_user="no"
320 --enable-linux-user) linux_user="yes"
322 --disable-darwin-user) darwin_user="no"
324 --enable-darwin-user) darwin_user="yes"
326 --enable-uname-release=*) uname_release="$optarg"
328 --sparc_cpu=*)
329 sparc_cpu="$optarg"
330 case $sparc_cpu in
331 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
332 target_cpu="sparc"; cpu="sparc" ;;
333 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
334 target_cpu="sparc"; cpu="sparc" ;;
335 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
336 target_cpu="sparc64"; cpu="sparc64" ;;
337 *) echo "undefined SPARC architecture. Exiting";exit 1;;
338 esac
340 --enable-werror) werror="yes"
342 --disable-werror) werror="no"
344 --disable-curses) curses="no"
346 --disable-cpu-emulation) cpu_emulation="no"
348 *) echo "ERROR: unknown option $opt"; exit 1
350 esac
351 done
353 if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
354 AIOLIBS=
355 else
356 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
357 AIOLIBS="-lrt -lpthread"
360 # default flags for all hosts
361 CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
362 LDFLAGS="$LDFLAGS -g"
363 if test "$werror" = "yes" ; then
364 CFLAGS="$CFLAGS -Werror"
368 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
369 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
371 case "$cpu" in
372 sparc) if test -z "$sparc_cpu" ; then
373 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
374 ARCH_LDFLAGS="-m32"
375 else
376 ARCH_CFLAGS="${SP_CFLAGS}"
377 ARCH_LDFLAGS="${SP_LDFLAGS}"
380 sparc64) if test -z "$sparc_cpu" ; then
381 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
382 ARCH_LDFLAGS="-m64"
383 else
384 ARCH_CFLAGS="${SP_CFLAGS}"
385 ARCH_LDFLAGS="${SP_LDFLAGS}"
388 s390)
389 ARCH_CFLAGS="-march=z900"
391 i386)
392 ARCH_CFLAGS="-m32"
393 ARCH_LDFLAGS="-m32"
395 x86_64)
396 ARCH_CFLAGS="-m64"
397 ARCH_LDFLAGS="-m64"
399 esac
401 if test x"$show_help" = x"yes" ; then
402 cat << EOF
404 Usage: configure [options]
405 Options: [defaults in brackets after descriptions]
408 echo "Standard options:"
409 echo " --help print this message"
410 echo " --prefix=PREFIX install in PREFIX [$prefix]"
411 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
412 echo " use %M for cpu name [$interp_prefix]"
413 echo " --target-list=LIST set target list [$target_list]"
414 echo ""
415 echo "kqemu kernel acceleration support:"
416 echo " --disable-kqemu disable kqemu support"
417 echo " --kernel-path=PATH set the kernel path (configure probes it)"
418 echo " --disable-kvm disable kernel virtual machine support"
419 echo ""
420 echo "Advanced options (experts only):"
421 echo " --source-path=PATH path of source code [$source_path]"
422 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
423 echo " --cc=CC use C compiler CC [$cc]"
424 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
425 echo " --make=MAKE use specified make [$make]"
426 echo " --install=INSTALL use specified install [$install]"
427 echo " --static enable static build [$static]"
428 echo " --disable-werror disable compilation abort on warning"
429 echo " --disable-sdl disable SDL"
430 echo " --enable-cocoa enable COCOA (Mac OS X only)"
431 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
432 echo " --enable-adlib enable Adlib emulation"
433 echo " --enable-ac97 enable AC97 emulation"
434 echo " --enable-gus enable Gravis Ultrasound emulation"
435 echo " --enable-coreaudio enable Coreaudio audio driver"
436 echo " --enable-alsa enable ALSA audio driver"
437 echo " --enable-esd enable EsoundD audio driver"
438 echo " --enable-fmod enable FMOD audio driver"
439 echo " --enable-dsound enable DirectSound audio driver"
440 echo " --disable-vnc-tls disable TLS encryption for VNC server"
441 echo " --enable-system enable all system emulation targets"
442 echo " --disable-system disable all system emulation targets"
443 echo " --enable-linux-user enable all linux usermode emulation targets"
444 echo " --disable-linux-user disable all linux usermode emulation targets"
445 echo " --enable-darwin-user enable all darwin usermode emulation targets"
446 echo " --disable-darwin-user disable all darwin usermode emulation targets"
447 echo " --fmod-lib path to FMOD library"
448 echo " --fmod-inc path to FMOD includes"
449 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
450 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
451 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
452 echo ""
453 echo "NOTE: The object files are built at the place where configure is launched"
454 exit 1
457 cc="${cross_prefix}${cc}"
458 ar="${cross_prefix}${ar}"
459 strip="${cross_prefix}${strip}"
461 # check that the C compiler works.
462 cat > $TMPC <<EOF
463 int main(void) {}
466 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
467 : C compiler works ok
468 else
469 echo "ERROR: \"$cc\" either does not exist or does not work"
470 exit 1
473 if test "$mingw32" = "yes" ; then
474 linux="no"
475 EXESUF=".exe"
476 oss="no"
479 # Check for gcc4, error if pre-gcc4
480 if test "$check_gcc" = "yes" ; then
481 cat > $TMPC <<EOF
482 #if __GNUC__ < 4
483 #error gcc3
484 #endif
485 int main(){return 0;}
487 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
488 echo "WARNING: \"$cc\" looks like gcc 4.x"
489 found_compat_cc="no"
490 if test "$gcc3_search" = "yes" ; then
491 echo "Looking for gcc 3.x"
492 for compat_cc in $gcc3_list ; do
493 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
494 echo "Found \"$compat_cc\""
495 cc="$cross_prefix$compat_cc"
496 found_compat_cc="yes"
497 break
499 done
500 if test "$found_compat_cc" = "no" ; then
501 echo "gcc 3.x not found!"
504 if test "$found_compat_cc" = "no" ; then
505 echo "QEMU is known to have problems when compiled with gcc 4.x"
506 echo "It is recommended that you use gcc 3.x to build QEMU"
507 echo "To use this compiler anyway, configure with --disable-gcc-check"
508 exit 1;
514 # Solaris specific configure tool chain decisions
516 if test "$solaris" = "yes" ; then
518 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
519 # override the check with --disable-gcc-check
521 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
522 solgcc=`which $cc`
523 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
524 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
525 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
526 echo "or get the latest patch from SunSolve for gcc"
527 exit 1
530 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
531 if test -z "$solinst" ; then
532 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
533 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
534 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
535 exit 1
537 if test "$solinst" = "/usr/sbin/install" ; then
538 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
539 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
540 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
541 exit 1
543 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
544 if test -z "$sol_ar" ; then
545 echo "Error: No path includes ar"
546 if test -f /usr/ccs/bin/ar ; then
547 echo "Add /usr/ccs/bin to your path and rerun configure"
549 exit 1
554 if test -z "$target_list" ; then
555 # these targets are portable
556 if [ "$softmmu" = "yes" ] ; then
557 target_list="i386-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu m68k-softmmu sh4-softmmu sh4eb-softmmu cris-softmmu"
559 # the following are Linux specific
560 if [ "$linux_user" = "yes" ] ; then
561 target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user sparc64-linux-user sparc32plus-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user sh4-linux-user sh4eb-linux-user ppc-linux-user ppc64-linux-user ppc64abi32-linux-user x86_64-linux-user cris-linux-user $target_list"
563 # the following are Darwin specific
564 if [ "$darwin_user" = "yes" ] ; then
565 target_list="i386-darwin-user ppc-darwin-user $target_list"
567 else
568 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
570 if test -z "$target_list" ; then
571 echo "No targets enabled"
572 exit 1
575 if test -z "$cross_prefix" ; then
577 # ---
578 # big/little endian test
579 cat > $TMPC << EOF
580 #include <inttypes.h>
581 int main(int argc, char ** argv){
582 volatile uint32_t i=0x01234567;
583 return (*((uint8_t*)(&i))) == 0x67;
587 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
588 $TMPE && bigendian="yes"
589 else
590 echo big/little test failed
593 else
595 # if cross compiling, cannot launch a program, so make a static guess
596 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
597 bigendian="yes"
602 # host long bits test
603 hostlongbits="32"
604 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
605 hostlongbits="64"
608 # check gcc options support
609 cat > $TMPC <<EOF
610 int main(void) {
614 ##########################################
615 # SDL probe
617 sdl_too_old=no
619 if test -z "$sdl" ; then
620 sdl_config="sdl-config"
621 sdl=no
622 sdl_static=no
624 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
625 # win32 cross compilation case
626 sdl_config="i386-mingw32msvc-sdl-config"
627 sdl=yes
628 else
629 # normal SDL probe
630 cat > $TMPC << EOF
631 #include <SDL.h>
632 #undef main /* We don't want SDL to override our main() */
633 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
635 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
636 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
637 if test "$_sdlversion" -lt 121 ; then
638 sdl_too_old=yes
639 else
640 if test "$cocoa" = "no" ; then
641 sdl=yes
645 # static link with sdl ?
646 if test "$sdl" = "yes" ; then
647 aa="no"
648 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
649 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
650 if [ "$aa" = "yes" ] ; then
651 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
654 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
655 sdl_static=yes
657 fi # static link
658 fi # sdl compile test
659 fi # cross compilation
660 else
661 # Make sure to disable cocoa if sdl was set
662 if test "$sdl" = "yes" ; then
663 cocoa="no"
664 coreaudio="no"
666 fi # -z $sdl
668 ##########################################
669 # VNC TLS detection
670 if test "$vnc_tls" = "yes" ; then
671 `pkg-config gnutls` || vnc_tls="no"
673 if test "$vnc_tls" = "yes" ; then
674 vnc_tls_cflags=`pkg-config --cflags gnutls`
675 vnc_tls_libs=`pkg-config --libs gnutls`
678 ##########################################
679 # alsa sound support libraries
681 if test "$alsa" = "yes" ; then
682 cat > $TMPC << EOF
683 #include <alsa/asoundlib.h>
684 int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
686 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then
688 else
689 echo
690 echo "Error: Could not find alsa"
691 echo "Make sure to have the alsa libs and headers installed."
692 echo
693 exit 1
697 ##########################################
698 # curses probe
700 if test "$curses" = "yes" ; then
701 curses=no
702 cat > $TMPC << EOF
703 #include <curses.h>
704 int main(void) { return curses_version(); }
706 if $cc -o $TMPE $TMPC -lcurses 2> /dev/null ; then
707 curses=yes
709 fi # test "$curses"
711 # Check if tools are available to build documentation.
712 if [ -x "`which texi2html 2>/dev/null`" ] && \
713 [ -x "`which pod2man 2>/dev/null`" ]; then
714 build_docs="yes"
717 if test "$mingw32" = "yes" ; then
718 if test -z "$prefix" ; then
719 prefix="/c/Program Files/Qemu"
721 mansuffix=""
722 datasuffix=""
723 docsuffix=""
724 binsuffix=""
725 else
726 if test -z "$prefix" ; then
727 prefix="/usr/local"
729 mansuffix="/share/man"
730 datasuffix="/share/qemu"
731 docsuffix="/share/doc/qemu"
732 binsuffix="/bin"
735 echo "Install prefix $prefix"
736 echo "BIOS directory $prefix$datasuffix"
737 echo "binary directory $prefix$binsuffix"
738 if test "$mingw32" = "no" ; then
739 echo "Manual directory $prefix$mansuffix"
740 echo "ELF interp prefix $interp_prefix"
742 echo "Source path $source_path"
743 echo "C compiler $cc"
744 echo "Host C compiler $host_cc"
745 echo "ARCH_CFLAGS $ARCH_CFLAGS"
746 echo "make $make"
747 echo "install $install"
748 echo "host CPU $cpu"
749 echo "host big endian $bigendian"
750 echo "target list $target_list"
751 echo "gprof enabled $gprof"
752 echo "profiler $profiler"
753 echo "static build $static"
754 echo "-Werror enabled $werror"
755 if test "$darwin" = "yes" ; then
756 echo "Cocoa support $cocoa"
758 echo "SDL support $sdl"
759 if test "$sdl" != "no" ; then
760 echo "SDL static link $sdl_static"
762 echo "curses support $curses"
763 echo "mingw32 support $mingw32"
764 echo "Adlib support $adlib"
765 echo "AC97 support $ac97"
766 echo "GUS support $gus"
767 echo "CoreAudio support $coreaudio"
768 echo "ALSA support $alsa"
769 echo "EsounD support $esd"
770 echo "DSound support $dsound"
771 if test "$fmod" = "yes"; then
772 if test -z $fmod_lib || test -z $fmod_inc; then
773 echo
774 echo "Error: You must specify path to FMOD library and headers"
775 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
776 echo
777 exit 1
779 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
780 else
781 fmod_support=""
783 echo "FMOD support $fmod $fmod_support"
784 echo "OSS support $oss"
785 echo "VNC TLS support $vnc_tls"
786 if test "$vnc_tls" = "yes" ; then
787 echo " TLS CFLAGS $vnc_tls_cflags"
788 echo " TLS LIBS $vnc_tls_libs"
790 if test -n "$sparc_cpu"; then
791 echo "Target Sparc Arch $sparc_cpu"
793 echo "kqemu support $kqemu"
794 echo "kvm support $kvm"
795 echo "CPU emulation $cpu_emulation"
796 echo "Documentation $build_docs"
797 [ ! -z "$uname_release" ] && \
798 echo "uname -r $uname_release"
800 if test $sdl_too_old = "yes"; then
801 echo "-> Your SDL version is too old - please upgrade to have SDL support"
803 if [ -s /tmp/qemu-$$-sdl-config.log ]; then
804 echo "The error log from compiling the libSDL test is: "
805 cat /tmp/qemu-$$-sdl-config.log
807 rm -f /tmp/qemu-$$-sdl-config.log
808 #if test "$sdl_static" = "no"; then
809 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
811 config_mak="config-host.mak"
812 config_h="config-host.h"
814 #echo "Creating $config_mak and $config_h"
816 test -f $config_h && mv $config_h ${config_h}~
818 echo "# Automatically generated by configure - do not modify" > $config_mak
819 echo "# Configured with: $0 $@" >> $config_mak
820 echo "/* Automatically generated by configure - do not modify */" > $config_h
822 echo "prefix=$prefix" >> $config_mak
823 echo "bindir=\${prefix}$binsuffix" >> $config_mak
824 echo "mandir=\${prefix}$mansuffix" >> $config_mak
825 echo "datadir=\${prefix}$datasuffix" >> $config_mak
826 echo "docdir=\${prefix}$docsuffix" >> $config_mak
827 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
828 echo "MAKE=$make" >> $config_mak
829 echo "INSTALL=$install" >> $config_mak
830 echo "CC=$cc" >> $config_mak
831 echo "HOST_CC=$host_cc" >> $config_mak
832 echo "AR=$ar" >> $config_mak
833 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
834 # XXX: only use CFLAGS and LDFLAGS ?
835 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
836 # compilation of dyngen tool (useful for win32 build on Linux host)
837 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
838 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
839 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
840 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
841 echo "CFLAGS=$CFLAGS" >> $config_mak
842 echo "LDFLAGS=$LDFLAGS" >> $config_mak
843 echo "EXESUF=$EXESUF" >> $config_mak
844 echo "AIOLIBS=$AIOLIBS" >> $config_mak
845 if test "$cpu" = "i386" ; then
846 echo "ARCH=i386" >> $config_mak
847 echo "#define HOST_I386 1" >> $config_h
848 elif test "$cpu" = "x86_64" ; then
849 echo "ARCH=x86_64" >> $config_mak
850 echo "#define HOST_X86_64 1" >> $config_h
851 elif test "$cpu" = "armv4b" ; then
852 echo "ARCH=arm" >> $config_mak
853 echo "#define HOST_ARM 1" >> $config_h
854 elif test "$cpu" = "armv4l" ; then
855 echo "ARCH=arm" >> $config_mak
856 echo "#define HOST_ARM 1" >> $config_h
857 elif test "$cpu" = "powerpc" ; then
858 echo "ARCH=ppc" >> $config_mak
859 echo "#define HOST_PPC 1" >> $config_h
860 elif test "$cpu" = "mips" ; then
861 echo "ARCH=mips" >> $config_mak
862 echo "#define HOST_MIPS 1" >> $config_h
863 elif test "$cpu" = "mips64" ; then
864 echo "ARCH=mips64" >> $config_mak
865 echo "#define HOST_MIPS64 1" >> $config_h
866 elif test "$cpu" = "cris" ; then
867 echo "ARCH=cris" >> $config_mak
868 echo "#define HOST_CRIS 1" >> $config_h
869 elif test "$cpu" = "s390" ; then
870 echo "ARCH=s390" >> $config_mak
871 echo "#define HOST_S390 1" >> $config_h
872 elif test "$cpu" = "alpha" ; then
873 echo "ARCH=alpha" >> $config_mak
874 echo "#define HOST_ALPHA 1" >> $config_h
875 elif test "$cpu" = "sparc" ; then
876 echo "ARCH=sparc" >> $config_mak
877 echo "#define HOST_SPARC 1" >> $config_h
878 elif test "$cpu" = "sparc64" ; then
879 echo "ARCH=sparc64" >> $config_mak
880 echo "#define HOST_SPARC64 1" >> $config_h
881 elif test "$cpu" = "ia64" ; then
882 echo "ARCH=ia64" >> $config_mak
883 echo "#define HOST_IA64 1" >> $config_h
884 elif test "$cpu" = "m68k" ; then
885 echo "ARCH=m68k" >> $config_mak
886 echo "#define HOST_M68K 1" >> $config_h
887 else
888 echo "Unsupported CPU = $cpu"
889 exit 1
891 if test "$bigendian" = "yes" ; then
892 echo "WORDS_BIGENDIAN=yes" >> $config_mak
893 echo "#define WORDS_BIGENDIAN 1" >> $config_h
895 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
896 if test "$mingw32" = "yes" ; then
897 echo "CONFIG_WIN32=yes" >> $config_mak
898 echo "#define CONFIG_WIN32 1" >> $config_h
899 else
900 cat > $TMPC << EOF
901 #include <byteswap.h>
902 int main(void) { return bswap_32(0); }
904 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
905 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
908 if test "$darwin" = "yes" ; then
909 echo "CONFIG_DARWIN=yes" >> $config_mak
910 echo "#define CONFIG_DARWIN 1" >> $config_h
912 if test "$solaris" = "yes" ; then
913 echo "CONFIG_SOLARIS=yes" >> $config_mak
914 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
915 if test "$needs_libsunmath" = "yes" ; then
916 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
917 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
920 if test -n "$sparc_cpu"; then
921 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
922 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
924 if test "$gdbstub" = "yes" ; then
925 echo "CONFIG_GDBSTUB=yes" >> $config_mak
926 echo "#define CONFIG_GDBSTUB 1" >> $config_h
928 if test "$gprof" = "yes" ; then
929 echo "TARGET_GPROF=yes" >> $config_mak
930 echo "#define HAVE_GPROF 1" >> $config_h
932 if test "$static" = "yes" ; then
933 echo "CONFIG_STATIC=yes" >> $config_mak
934 echo "#define CONFIG_STATIC 1" >> $config_h
936 if test $profiler = "yes" ; then
937 echo "#define CONFIG_PROFILER 1" >> $config_h
939 if test "$slirp" = "yes" ; then
940 echo "CONFIG_SLIRP=yes" >> $config_mak
941 echo "#define CONFIG_SLIRP 1" >> $config_h
943 if test "$adlib" = "yes" ; then
944 echo "CONFIG_ADLIB=yes" >> $config_mak
945 echo "#define CONFIG_ADLIB 1" >> $config_h
947 if test "$ac97" = "yes" ; then
948 echo "CONFIG_AC97=yes" >> $config_mak
949 echo "#define CONFIG_AC97 1" >> $config_h
951 if test "$gus" = "yes" ; then
952 echo "CONFIG_GUS=yes" >> $config_mak
953 echo "#define CONFIG_GUS 1" >> $config_h
955 if test "$oss" = "yes" ; then
956 echo "CONFIG_OSS=yes" >> $config_mak
957 echo "#define CONFIG_OSS 1" >> $config_h
959 if test "$coreaudio" = "yes" ; then
960 echo "CONFIG_COREAUDIO=yes" >> $config_mak
961 echo "#define CONFIG_COREAUDIO 1" >> $config_h
963 if test "$alsa" = "yes" ; then
964 echo "CONFIG_ALSA=yes" >> $config_mak
965 echo "#define CONFIG_ALSA 1" >> $config_h
967 if test "$esd" = "yes" ; then
968 echo "CONFIG_ESD=yes" >> $config_mak
969 echo "#define CONFIG_ESD 1" >> $config_h
971 if test "$dsound" = "yes" ; then
972 echo "CONFIG_DSOUND=yes" >> $config_mak
973 echo "#define CONFIG_DSOUND 1" >> $config_h
975 if test "$fmod" = "yes" ; then
976 echo "CONFIG_FMOD=yes" >> $config_mak
977 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
978 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
979 echo "#define CONFIG_FMOD 1" >> $config_h
981 if test "$vnc_tls" = "yes" ; then
982 echo "CONFIG_VNC_TLS=yes" >> $config_mak
983 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
984 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
985 echo "#define CONFIG_VNC_TLS 1" >> $config_h
987 qemu_version=`head $source_path/VERSION`
988 echo "VERSION=$qemu_version" >>$config_mak
989 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
990 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
992 echo "SRC_PATH=$source_path" >> $config_mak
993 if [ "$source_path_used" = "yes" ]; then
994 echo "VPATH=$source_path" >> $config_mak
996 echo "TARGET_DIRS=$target_list" >> $config_mak
997 if [ "$build_docs" = "yes" ] ; then
998 echo "BUILD_DOCS=yes" >> $config_mak
1000 if test "$static" = "yes"; then
1001 sdl1=$sdl_static
1002 else
1003 sdl1=$sdl
1005 if test "$sdl1" = "yes" ; then
1006 echo "#define CONFIG_SDL 1" >> $config_h
1007 echo "CONFIG_SDL=yes" >> $config_mak
1008 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1009 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1010 else
1011 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1013 if [ "${aa}" = "yes" ] ; then
1014 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1015 else
1016 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1019 if test "$cocoa" = "yes" ; then
1020 echo "#define CONFIG_COCOA 1" >> $config_h
1021 echo "CONFIG_COCOA=yes" >> $config_mak
1023 if test "$curses" = "yes" ; then
1024 echo "#define CONFIG_CURSES 1" >> $config_h
1025 echo "CONFIG_CURSES=yes" >> $config_mak
1026 echo "CURSES_LIBS=-lcurses" >> $config_mak
1029 # XXX: suppress that
1030 if [ "$bsd" = "yes" ] ; then
1031 echo "#define O_LARGEFILE 0" >> $config_h
1032 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1033 echo "#define _BSD 1" >> $config_h
1036 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1038 tools=
1039 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1040 tools="qemu-img\$(EXESUF) $tools"
1042 echo "TOOLS=$tools" >> $config_mak
1044 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1046 for target in $target_list; do
1047 target_dir="$target"
1048 config_mak=$target_dir/config.mak
1049 config_h=$target_dir/config.h
1050 target_cpu=`echo $target | cut -d '-' -f 1`
1051 target_bigendian="no"
1052 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1053 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1054 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1055 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1056 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1057 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1058 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1059 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1060 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1061 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1062 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1063 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1064 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1065 target_softmmu="no"
1066 target_user_only="no"
1067 target_linux_user="no"
1068 target_darwin_user="no"
1069 case "$target" in
1070 ${target_cpu}-softmmu)
1071 target_softmmu="yes"
1073 ${target_cpu}-linux-user)
1074 target_user_only="yes"
1075 target_linux_user="yes"
1077 ${target_cpu}-darwin-user)
1078 target_user_only="yes"
1079 target_darwin_user="yes"
1082 echo "ERROR: Target '$target' not recognised"
1083 exit 1
1085 esac
1087 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1088 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1089 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1090 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1091 echo "Note that this will disable all output from the virtual graphics card"
1092 echo "except through VNC or curses."
1093 exit 1;
1096 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1098 test -f $config_h && mv $config_h ${config_h}~
1100 mkdir -p $target_dir
1101 mkdir -p $target_dir/fpu
1102 mkdir -p $target_dir/tcg
1103 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
1104 mkdir -p $target_dir/nwfpe
1108 # don't use ln -sf as not all "ln -sf" over write the file/link
1110 rm -f $target_dir/Makefile
1111 ln -s $source_path/Makefile.target $target_dir/Makefile
1114 echo "# Automatically generated by configure - do not modify" > $config_mak
1115 echo "/* Automatically generated by configure - do not modify */" > $config_h
1118 echo "include ../config-host.mak" >> $config_mak
1119 echo "#include \"../config-host.h\"" >> $config_h
1121 bflt="no"
1122 elfload32="no"
1123 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1124 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1126 disable_cpu_emulation() {
1127 if test $cpu_emulation = "no"; then
1128 echo "#define NO_CPU_EMULATION 1" >> $config_h
1129 echo "NO_CPU_EMULATION=1" >> $config_mak
1133 configure_kvm() {
1134 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1135 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1136 echo "#define USE_KVM 1" >> $config_h
1137 echo "USE_KVM=1" >> $config_mak
1138 echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak
1139 disable_cpu_emulation
1143 if test "$target_cpu" = "i386" ; then
1144 echo "TARGET_ARCH=i386" >> $config_mak
1145 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1146 echo "#define TARGET_I386 1" >> $config_h
1147 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
1148 echo "#define USE_KQEMU 1" >> $config_h
1150 configure_kvm
1151 elif test "$target_cpu" = "ia64" ; then
1152 echo "TARGET_ARCH=ia64" >> $config_mak
1153 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1154 echo "#define TARGET_IA64 1" >> $config_h
1155 configure_kvm
1156 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
1157 echo "TARGET_ARCH=arm" >> $config_mak
1158 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1159 echo "#define TARGET_ARM 1" >> $config_h
1160 bflt="yes"
1161 elif test "$target_cpu" = "sparc" ; then
1162 echo "TARGET_ARCH=sparc" >> $config_mak
1163 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1164 echo "#define TARGET_SPARC 1" >> $config_h
1165 elif test "$target_cpu" = "sparc64" ; then
1166 echo "TARGET_ARCH=sparc64" >> $config_mak
1167 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1168 echo "#define TARGET_SPARC 1" >> $config_h
1169 echo "#define TARGET_SPARC64 1" >> $config_h
1170 elfload32="yes"
1171 elif test "$target_cpu" = "sparc32plus" ; then
1172 echo "TARGET_ARCH=sparc64" >> $config_mak
1173 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1174 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1175 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1176 echo "#define TARGET_SPARC 1" >> $config_h
1177 echo "#define TARGET_SPARC64 1" >> $config_h
1178 echo "#define TARGET_ABI32 1" >> $config_h
1179 elif test "$target_cpu" = "ppc" ; then
1180 echo "TARGET_ARCH=ppc" >> $config_mak
1181 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1182 echo "#define TARGET_PPC 1" >> $config_h
1183 elif test "$target_cpu" = "ppcemb" ; then
1184 echo "TARGET_ARCH=ppcemb" >> $config_mak
1185 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1186 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1187 echo "#define TARGET_PPC 1" >> $config_h
1188 echo "#define TARGET_PPCEMB 1" >> $config_h
1189 configure_kvm
1190 elif test "$target_cpu" = "ppc64" ; then
1191 echo "TARGET_ARCH=ppc64" >> $config_mak
1192 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1193 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1194 echo "#define TARGET_PPC 1" >> $config_h
1195 echo "#define TARGET_PPC64 1" >> $config_h
1196 elif test "$target_cpu" = "ppc64abi32" ; then
1197 echo "TARGET_ARCH=ppc64" >> $config_mak
1198 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1199 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1200 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1201 echo "#define TARGET_PPC 1" >> $config_h
1202 echo "#define TARGET_PPC64 1" >> $config_h
1203 echo "#define TARGET_ABI32 1" >> $config_h
1204 elif test "$target_cpu" = "x86_64" ; then
1205 echo "TARGET_ARCH=x86_64" >> $config_mak
1206 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1207 echo "#define TARGET_I386 1" >> $config_h
1208 echo "#define TARGET_X86_64 1" >> $config_h
1209 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
1210 echo "#define USE_KQEMU 1" >> $config_h
1212 configure_kvm
1213 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
1214 echo "TARGET_ARCH=mips" >> $config_mak
1215 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1216 echo "#define TARGET_MIPS 1" >> $config_h
1217 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1218 elif test "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" ; then
1219 echo "TARGET_ARCH=mipsn32" >> $config_mak
1220 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1221 echo "#define TARGET_MIPS 1" >> $config_h
1222 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1223 elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then
1224 echo "TARGET_ARCH=mips64" >> $config_mak
1225 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1226 echo "#define TARGET_MIPS 1" >> $config_h
1227 echo "#define TARGET_MIPS64 1" >> $config_h
1228 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1229 elif test "$target_cpu" = "cris" ; then
1230 echo "TARGET_ARCH=cris" >> $config_mak
1231 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1232 echo "#define TARGET_CRIS 1" >> $config_h
1233 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1234 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1235 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
1236 echo "TARGET_ARCH=sh4" >> $config_mak
1237 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1238 echo "#define TARGET_SH4 1" >> $config_h
1239 bflt="yes"
1240 elif test "$target_cpu" = "m68k" ; then
1241 echo "TARGET_ARCH=m68k" >> $config_mak
1242 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1243 echo "#define TARGET_M68K 1" >> $config_h
1244 bflt="yes"
1245 elif test "$target_cpu" = "alpha" ; then
1246 echo "TARGET_ARCH=alpha" >> $config_mak
1247 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1248 echo "#define TARGET_ALPHA 1" >> $config_h
1249 else
1250 echo "Unsupported target CPU"
1251 exit 1
1253 if test "$target_bigendian" = "yes" ; then
1254 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1255 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1257 if test "$target_softmmu" = "yes" ; then
1258 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1259 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1261 if test "$target_user_only" = "yes" ; then
1262 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1263 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1265 if test "$target_linux_user" = "yes" ; then
1266 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1267 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1269 if test "$target_darwin_user" = "yes" ; then
1270 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1271 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1274 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "sparc32plus" -o "$target_cpu" = "m68k" -o "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" -o "$target_cpu" = "mipsn32" -o "$target_cpu" = "mipsn32el" -o "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el"; then
1275 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1276 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1278 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1279 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1280 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1282 # 32 bit ELF loader in addition to native 64 bit loader?
1283 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1284 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1285 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1288 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1290 done # for target in $targets
1292 # build tree in object directory if source path is different from current one
1293 if test "$source_path_used" = "yes" ; then
1294 DIRS="tests tests/cris slirp audio"
1295 FILES="Makefile tests/Makefile"
1296 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1297 FILES="$FILES tests/test-mmap.c"
1298 for dir in $DIRS ; do
1299 mkdir -p $dir
1300 done
1301 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1302 for f in $FILES ; do
1303 rm -f $f
1304 ln -s $source_path/$f $f
1305 done
1308 rm -f $TMPO $TMPC $TMPE $TMPS