Fix screendump with multiple consoles
[qemu-kvm/fedora.git] / configure
blob60e8493915bbcfb2f79bd2b6e7b4335d741411f5
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 audio_drv_list=""
28 audio_card_list=""
29 host_cc="gcc"
30 ar="ar"
31 make="make"
32 install="install"
33 strip="strip"
34 cpu=`uname -m`
35 target_list=""
36 case "$cpu" in
37 i386|i486|i586|i686|i86pc|BePC)
38 cpu="i386"
40 x86_64|amd64)
41 cpu="x86_64"
43 alpha)
44 cpu="alpha"
46 armv*b)
47 cpu="armv4b"
49 armv*l)
50 cpu="armv4l"
52 cris)
53 cpu="cris"
55 parisc|parisc64)
56 cpu="hppa"
58 ia64)
59 cpu="ia64"
61 m68k)
62 cpu="m68k"
64 mips)
65 cpu="mips"
67 mips64)
68 cpu="mips64"
70 "Power Macintosh"|ppc|ppc64)
71 cpu="powerpc"
73 s390*)
74 cpu="s390"
76 sparc|sun4[cdmuv])
77 cpu="sparc"
79 sparc64)
80 cpu="sparc64"
83 cpu="unknown"
85 esac
86 gprof="no"
87 bigendian="no"
88 mingw32="no"
89 EXESUF=""
90 gdbstub="yes"
91 slirp="yes"
92 fmod_lib=""
93 fmod_inc=""
94 vnc_tls="yes"
95 bsd="no"
96 linux="no"
97 kqemu="no"
98 kvm="no"
99 kvm_cap_pit="no"
100 profiler="no"
101 kernel_path=""
102 cocoa="no"
103 check_gfx="yes"
104 check_gcc="yes"
105 softmmu="yes"
106 linux_user="no"
107 darwin_user="no"
108 build_docs="no"
109 uname_release=""
110 curses="yes"
111 nptl="yes"
112 mixemu="no"
113 cpu_emulation="yes"
114 device_tree_support=""
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"
125 audio_possible_drivers="sdl"
127 MINGW32*)
128 mingw32="yes"
129 if [ "$cpu" = "i386" ] ; then
130 kqemu="yes"
132 audio_possible_drivers="dsound sdl fmod"
134 GNU/kFreeBSD)
135 audio_drv_list="oss"
136 audio_possible_drivers="oss sdl esd"
137 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
138 kqemu="yes"
141 FreeBSD)
142 bsd="yes"
143 audio_drv_list="oss"
144 audio_possible_drivers="oss sdl esd"
145 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
146 kqemu="yes"
147 kvm="yes"
150 NetBSD)
151 bsd="yes"
152 audio_drv_list="oss"
153 audio_possible_drivers="oss sdl esd"
155 OpenBSD)
156 bsd="yes"
157 audio_drv_list="oss"
158 audio_possible_drivers="oss sdl esd"
160 Darwin)
161 bsd="yes"
162 darwin="yes"
163 darwin_user="yes"
164 cocoa="yes"
165 audio_drv_list="coreaudio"
166 audio_possible_drivers="coreaudio sdl fmod"
167 OS_CFLAGS="-mdynamic-no-pic"
168 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
170 SunOS)
171 solaris="yes"
172 make="gmake"
173 install="ginstall"
174 needs_libsunmath="no"
175 solarisrev=`uname -r | cut -f2 -d.`
176 # have to select again, because `uname -m` returns i86pc
177 # even on an x86_64 box.
178 solariscpu=`isainfo -k`
179 if test "${solariscpu}" = "amd64" ; then
180 cpu="x86_64"
182 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
183 if test "$solarisrev" -le 9 ; then
184 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
185 needs_libsunmath="yes"
186 else
187 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
188 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
189 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
190 echo "Studio 11 can be downloaded from www.sun.com."
191 exit 1
194 if test "$solarisrev" -ge 9 ; then
195 kqemu="yes"
198 if test -f /usr/include/sys/soundcard.h ; then
199 audio_drv_list="oss"
201 audio_possible_drivers="oss sdl"
204 audio_drv_list="oss"
205 audio_possible_drivers="oss alsa sdl esd pa"
206 linux="yes"
207 linux_user="yes"
208 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
209 kqemu="yes"
210 audio_possible_drivers="$audio_possible_drivers fmod"
211 kvm="yes"
213 if [ "$cpu" = "ia64" ] ; then
214 kvm="yes"
215 cpu_emulation="no"
216 gdbstub="no"
217 slirp="no"
219 if [ "$cpu" = "powerpc" ]; then
220 kvm="yes"
223 esac
225 if [ "$bsd" = "yes" ] ; then
226 if [ "$darwin" != "yes" ] ; then
227 make="gmake"
231 # find source path
232 source_path=`dirname "$0"`
233 source_path_used="no"
234 workdir=`pwd`
235 if [ -z "$source_path" ]; then
236 source_path=$workdir
237 else
238 source_path=`cd "$source_path"; pwd`
240 [ -f "$workdir/vl.c" ] || source_path_used="yes"
242 werror="no"
243 # generate compile errors on warnings for development builds
244 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
245 #werror="yes";
248 for opt do
249 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
250 case "$opt" in
251 --help|-h) show_help=yes
253 --prefix=*) prefix="$optarg"
255 --interp-prefix=*) interp_prefix="$optarg"
257 --source-path=*) source_path="$optarg"
258 source_path_used="yes"
260 --cross-prefix=*) cross_prefix="$optarg"
262 --cc=*) cc="$optarg"
263 gcc3_search="no"
265 --host-cc=*) host_cc="$optarg"
267 --make=*) make="$optarg"
269 --install=*) install="$optarg"
271 --extra-cflags=*) CFLAGS="$optarg"
273 --extra-ldflags=*) LDFLAGS="$optarg"
275 --cpu=*) cpu="$optarg"
277 --target-list=*) target_list="$optarg"
279 --enable-gprof) gprof="yes"
281 --static) static="yes"
283 --disable-sdl) sdl="no"
285 --fmod-lib=*) fmod_lib="$optarg"
287 --fmod-inc=*) fmod_inc="$optarg"
289 --audio-card-list=*) audio_card_list="$optarg"
291 --audio-drv-list=*) audio_drv_list="$optarg"
293 --disable-vnc-tls) vnc_tls="no"
295 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
297 --disable-slirp) slirp="no"
299 --disable-kqemu) kqemu="no"
301 --disable-kvm) kvm="no"
303 --disable-brlapi) brlapi="no"
305 --enable-profiler) profiler="yes"
307 --kernel-path=*) kernel_path="$optarg"
309 --enable-cocoa)
310 cocoa="yes" ;
311 sdl="no" ;
312 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
314 --disable-gfx-check) check_gfx="no"
316 --disable-gcc-check) check_gcc="no"
318 --disable-system) softmmu="no"
320 --enable-system) softmmu="yes"
322 --disable-linux-user) linux_user="no"
324 --enable-linux-user) linux_user="yes"
326 --disable-darwin-user) darwin_user="no"
328 --enable-darwin-user) darwin_user="yes"
330 --enable-uname-release=*) uname_release="$optarg"
332 --sparc_cpu=*)
333 sparc_cpu="$optarg"
334 case $sparc_cpu in
335 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
336 target_cpu="sparc"; cpu="sparc" ;;
337 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
338 target_cpu="sparc"; cpu="sparc" ;;
339 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
340 target_cpu="sparc64"; cpu="sparc64" ;;
341 *) echo "undefined SPARC architecture. Exiting";exit 1;;
342 esac
344 --enable-werror) werror="yes"
346 --disable-werror) werror="no"
348 --disable-curses) curses="no"
350 --disable-nptl) nptl="no"
352 --enable-mixemu) mixemu="yes"
354 --disable-cpu-emulation) cpu_emulation="no"
356 --disable-libfdt) device_tree_support="no"
358 *) echo "ERROR: unknown option $opt"; exit 1
360 esac
361 done
363 if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
364 AIOLIBS=
365 else
366 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
367 AIOLIBS="-lrt -lpthread"
370 # default flags for all hosts
371 CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
372 LDFLAGS="$LDFLAGS -g"
373 if test "$werror" = "yes" ; then
374 CFLAGS="$CFLAGS -Werror"
378 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
379 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
381 case "$cpu" in
382 sparc) if test -z "$sparc_cpu" ; then
383 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
384 ARCH_LDFLAGS="-m32"
385 else
386 ARCH_CFLAGS="${SP_CFLAGS}"
387 ARCH_LDFLAGS="${SP_LDFLAGS}"
390 sparc64) if test -z "$sparc_cpu" ; then
391 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
392 ARCH_LDFLAGS="-m64"
393 else
394 ARCH_CFLAGS="${SP_CFLAGS}"
395 ARCH_LDFLAGS="${SP_LDFLAGS}"
398 s390)
399 ARCH_CFLAGS="-march=z900"
401 i386)
402 ARCH_CFLAGS="-m32"
403 ARCH_LDFLAGS="-m32"
405 x86_64)
406 ARCH_CFLAGS="-m64"
407 ARCH_LDFLAGS="-m64"
409 esac
411 if test x"$show_help" = x"yes" ; then
412 cat << EOF
414 Usage: configure [options]
415 Options: [defaults in brackets after descriptions]
418 echo "Standard options:"
419 echo " --help print this message"
420 echo " --prefix=PREFIX install in PREFIX [$prefix]"
421 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
422 echo " use %M for cpu name [$interp_prefix]"
423 echo " --target-list=LIST set target list [$target_list]"
424 echo ""
425 echo "kqemu kernel acceleration support:"
426 echo " --disable-kqemu disable kqemu support"
427 echo " --kernel-path=PATH set the kernel path (configure probes it)"
428 echo " --disable-kvm disable kernel virtual machine support"
429 echo ""
430 echo "Advanced options (experts only):"
431 echo " --source-path=PATH path of source code [$source_path]"
432 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
433 echo " --cc=CC use C compiler CC [$cc]"
434 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
435 echo " --make=MAKE use specified make [$make]"
436 echo " --install=INSTALL use specified install [$install]"
437 echo " --static enable static build [$static]"
438 echo " --disable-werror disable compilation abort on warning"
439 echo " --disable-sdl disable SDL"
440 echo " --enable-cocoa enable COCOA (Mac OS X only)"
441 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
442 echo " --audio-drv-list=LIST set audio drivers list:"
443 echo " Available drivers: $audio_possible_drivers"
444 echo " --audio-card-list=LIST set list of additional emulated audio cards"
445 echo " Available cards: ac97 adlib cs4231a gus"
446 echo " --enable-mixemu enable mixer emulation"
447 echo " --disable-brlapi disable BrlAPI"
448 echo " --disable-vnc-tls disable TLS encryption for VNC server"
449 echo " --disable-curses disable curses output"
450 echo " --disable-nptl disable usermode NPTL support"
451 echo " --enable-system enable all system emulation targets"
452 echo " --disable-system disable all system emulation targets"
453 echo " --enable-linux-user enable all linux usermode emulation targets"
454 echo " --disable-linux-user disable all linux usermode emulation targets"
455 echo " --enable-darwin-user enable all darwin usermode emulation targets"
456 echo " --disable-darwin-user disable all darwin usermode emulation targets"
457 echo " --fmod-lib path to FMOD library"
458 echo " --fmod-inc path to FMOD includes"
459 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
460 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
461 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
462 echo " --disable-libfdt disables use of libfdt support for device tree"
463 echo ""
464 echo "NOTE: The object files are built at the place where configure is launched"
465 exit 1
468 cc="${cross_prefix}${cc}"
469 ar="${cross_prefix}${ar}"
470 strip="${cross_prefix}${strip}"
472 # check that the C compiler works.
473 cat > $TMPC <<EOF
474 int main(void) {}
477 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
478 : C compiler works ok
479 else
480 echo "ERROR: \"$cc\" either does not exist or does not work"
481 exit 1
484 if test "$mingw32" = "yes" ; then
485 linux="no"
486 EXESUF=".exe"
487 oss="no"
490 # Check for gcc4, error if pre-gcc4
491 if test "$check_gcc" = "yes" ; then
492 cat > $TMPC <<EOF
493 #if __GNUC__ < 4
494 #error gcc3
495 #endif
496 int main(){return 0;}
498 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
499 echo "WARNING: \"$cc\" looks like gcc 4.x"
500 found_compat_cc="no"
501 if test "$gcc3_search" = "yes" ; then
502 echo "Looking for gcc 3.x"
503 for compat_cc in $gcc3_list ; do
504 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
505 echo "Found \"$compat_cc\""
506 cc="$cross_prefix$compat_cc"
507 found_compat_cc="yes"
508 break
510 done
511 if test "$found_compat_cc" = "no" ; then
512 echo "gcc 3.x not found!"
515 if test "$found_compat_cc" = "no" ; then
516 echo "QEMU is known to have problems when compiled with gcc 4.x"
517 echo "It is recommended that you use gcc 3.x to build QEMU"
518 echo "To use this compiler anyway, configure with --disable-gcc-check"
519 exit 1;
525 # Solaris specific configure tool chain decisions
527 if test "$solaris" = "yes" ; then
529 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
530 # override the check with --disable-gcc-check
532 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
533 solgcc=`which $cc`
534 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
535 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
536 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
537 echo "or get the latest patch from SunSolve for gcc"
538 exit 1
541 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
542 if test -z "$solinst" ; then
543 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
544 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
545 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
546 exit 1
548 if test "$solinst" = "/usr/sbin/install" ; then
549 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
550 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
551 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
552 exit 1
554 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
555 if test -z "$sol_ar" ; then
556 echo "Error: No path includes ar"
557 if test -f /usr/ccs/bin/ar ; then
558 echo "Add /usr/ccs/bin to your path and rerun configure"
560 exit 1
565 if test -z "$target_list" ; then
566 # these targets are portable
567 if [ "$softmmu" = "yes" ] ; then
568 target_list="\
569 i386-softmmu \
570 x86_64-softmmu \
571 arm-softmmu \
572 cris-softmmu \
573 m68k-softmmu \
574 mips-softmmu \
575 mipsel-softmmu \
576 mips64-softmmu \
577 mips64el-softmmu \
578 ppc-softmmu \
579 ppcemb-softmmu \
580 ppc64-softmmu \
581 sh4-softmmu \
582 sh4eb-softmmu \
583 sparc-softmmu \
586 # the following are Linux specific
587 if [ "$linux_user" = "yes" ] ; then
588 target_list="${target_list}\
589 i386-linux-user \
590 x86_64-linux-user \
591 alpha-linux-user \
592 arm-linux-user \
593 armeb-linux-user \
594 cris-linux-user \
595 m68k-linux-user \
596 mips-linux-user \
597 mipsel-linux-user \
598 ppc-linux-user \
599 ppc64-linux-user \
600 ppc64abi32-linux-user \
601 sh4-linux-user \
602 sh4eb-linux-user \
603 sparc-linux-user \
604 sparc64-linux-user \
605 sparc32plus-linux-user \
608 # the following are Darwin specific
609 if [ "$darwin_user" = "yes" ] ; then
610 target_list="$target_list i386-darwin-user ppc-darwin-user"
612 else
613 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
615 if test -z "$target_list" ; then
616 echo "No targets enabled"
617 exit 1
620 if test -z "$cross_prefix" ; then
622 # ---
623 # big/little endian test
624 cat > $TMPC << EOF
625 #include <inttypes.h>
626 int main(int argc, char ** argv){
627 volatile uint32_t i=0x01234567;
628 return (*((uint8_t*)(&i))) == 0x67;
632 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
633 $TMPE && bigendian="yes"
634 else
635 echo big/little test failed
638 else
640 # if cross compiling, cannot launch a program, so make a static guess
641 if test "$cpu" = "armv4b" \
642 -o "$cpu" = "hppa" \
643 -o "$cpu" = "m68k" \
644 -o "$cpu" = "mips" \
645 -o "$cpu" = "mips64" \
646 -o "$cpu" = "powerpc" \
647 -o "$cpu" = "s390" \
648 -o "$cpu" = "sparc" \
649 -o "$cpu" = "sparc64"; then
650 bigendian="yes"
655 # host long bits test
656 hostlongbits="32"
657 if test "$cpu" = "x86_64" \
658 -o "$cpu" = "alpha" \
659 -o "$cpu" = "ia64" \
660 -o "$cpu" = "sparc64"; then
661 hostlongbits="64"
664 # check gcc options support
665 cat > $TMPC <<EOF
666 int main(void) {
670 # Check host NPTL support
671 cat > $TMPC <<EOF
672 #include <sched.h>
673 #include <linux/futex.h>
674 void foo()
676 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
677 #error bork
678 #endif
682 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
684 else
685 nptl="no"
688 ##########################################
689 # KVM probe
691 if test "$kvm" = "yes" ; then
692 cat > $TMPC <<EOF
693 #include <libkvm.h>
694 #ifndef KVM_CAP_PIT
695 #error "kvm no pit capability"
696 #endif
697 int main(void) { return 0; }
699 if $cc $ARCH_CFLAGS $CFLAGS -I"$kernel_path"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
700 kvm_cap_pit="yes"
704 ##########################################
705 # SDL probe
707 sdl_too_old=no
709 if test -z "$sdl" ; then
710 sdl_config="sdl-config"
711 sdl=no
712 sdl_static=no
714 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
715 # win32 cross compilation case
716 sdl_config="i386-mingw32msvc-sdl-config"
717 sdl=yes
718 else
719 # normal SDL probe
720 cat > $TMPC << EOF
721 #include <SDL.h>
722 #undef main /* We don't want SDL to override our main() */
723 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
725 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
726 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
727 if test "$_sdlversion" -lt 121 ; then
728 sdl_too_old=yes
729 else
730 if test "$cocoa" = "no" ; then
731 sdl=yes
735 # static link with sdl ?
736 if test "$sdl" = "yes" ; then
737 aa="no"
738 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
739 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
740 if [ "$aa" = "yes" ] ; then
741 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
744 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
745 sdl_static=yes
747 fi # static link
748 fi # sdl compile test
749 fi # cross compilation
750 else
751 # Make sure to disable cocoa if sdl was set
752 if test "$sdl" = "yes" ; then
753 cocoa="no"
754 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
756 fi # -z $sdl
758 ##########################################
759 # VNC TLS detection
760 if test "$vnc_tls" = "yes" ; then
761 `pkg-config gnutls` || vnc_tls="no"
763 if test "$vnc_tls" = "yes" ; then
764 vnc_tls_cflags=`pkg-config --cflags gnutls`
765 vnc_tls_libs=`pkg-config --libs gnutls`
768 ##########################################
769 # Sound support libraries probe
771 audio_drv_probe()
773 drv=$1
774 hdr=$2
775 lib=$3
776 exp=$4
777 cfl=$5
778 cat > $TMPC << EOF
779 #include <$hdr>
780 int main(void) { $exp }
782 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then
784 else
785 echo
786 echo "Error: $drv check failed"
787 echo "Make sure to have the $drv libs and headers installed."
788 echo
789 exit 1
793 for drv in $audio_drv_list; do
794 case $drv in
795 alsa)
796 audio_drv_probe $drv alsa/asoundlib.h -lasound \
797 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
800 fmod)
801 if test -z $fmod_lib || test -z $fmod_inc; then
802 echo
803 echo "Error: You must specify path to FMOD library and headers"
804 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
805 echo
806 exit 1
808 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
811 esd)
812 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
816 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
817 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
820 esac
821 done
823 ##########################################
824 # BrlAPI probe
826 if test -z "$brlapi" ; then
827 brlapi=no
828 cat > $TMPC << EOF
829 #include <brlapi.h>
830 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
832 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
833 brlapi=yes
834 fi # brlapi compile test
835 fi # -z $brlapi
837 ##########################################
838 # curses probe
840 if test "$curses" = "yes" ; then
841 curses=no
842 cat > $TMPC << EOF
843 #include <curses.h>
844 int main(void) { return curses_version(); }
846 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
847 curses=yes
849 fi # test "$curses"
851 # Check if tools are available to build documentation.
852 if [ -x "`which texi2html 2>/dev/null`" ] && \
853 [ -x "`which pod2man 2>/dev/null`" ]; then
854 build_docs="yes"
857 if test "$mingw32" = "yes" ; then
858 if test -z "$prefix" ; then
859 prefix="/c/Program Files/Qemu"
861 mansuffix=""
862 datasuffix=""
863 docsuffix=""
864 binsuffix=""
865 else
866 if test -z "$prefix" ; then
867 prefix="/usr/local"
869 mansuffix="/share/man"
870 datasuffix="/share/qemu"
871 docsuffix="/share/doc/qemu"
872 binsuffix="/bin"
875 ######################################
876 # libfdt probe
878 if test -z "$device_tree_support" -a \
879 "$cpu" = "powerpc"; then
880 device_tree_support="no"
881 cat > $TMPC << EOF
882 #include <libfdt.h>
883 /* XXX uncomment later when libfdt is built before this test */
884 //int main(void) { void *fdt; return fdt_create(fdt, 1024); }
885 int main (void) {return 0;}
887 # XXX for now do not try to link to libfdt and just check for header */
888 # if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC -lfdt 2> /dev/null ; then
889 if $cc $ARCH_CFLAGS $CFLAGS $LDFLAGS -o $TMPE $TMPC 2> /dev/null; then
890 device_tree_support="yes"
891 else
892 echo
893 echo "Error: Could not find libfdt"
894 echo "Make sure to have the libfdt libs and headers installed."
895 echo
896 exit 1
900 echo "Install prefix $prefix"
901 echo "BIOS directory $prefix$datasuffix"
902 echo "binary directory $prefix$binsuffix"
903 if test "$mingw32" = "no" ; then
904 echo "Manual directory $prefix$mansuffix"
905 echo "ELF interp prefix $interp_prefix"
907 echo "Source path $source_path"
908 echo "C compiler $cc"
909 echo "Host C compiler $host_cc"
910 echo "ARCH_CFLAGS $ARCH_CFLAGS"
911 echo "make $make"
912 echo "install $install"
913 echo "host CPU $cpu"
914 echo "host big endian $bigendian"
915 echo "target list $target_list"
916 echo "gprof enabled $gprof"
917 echo "profiler $profiler"
918 echo "static build $static"
919 echo "-Werror enabled $werror"
920 if test "$darwin" = "yes" ; then
921 echo "Cocoa support $cocoa"
923 echo "SDL support $sdl"
924 if test "$sdl" != "no" ; then
925 echo "SDL static link $sdl_static"
927 echo "curses support $curses"
928 echo "mingw32 support $mingw32"
929 echo "Audio drivers $audio_drv_list"
930 echo "Extra audio cards $audio_card_list"
931 echo "Mixer emulation $mixemu"
932 echo "VNC TLS support $vnc_tls"
933 if test "$vnc_tls" = "yes" ; then
934 echo " TLS CFLAGS $vnc_tls_cflags"
935 echo " TLS LIBS $vnc_tls_libs"
937 if test -n "$sparc_cpu"; then
938 echo "Target Sparc Arch $sparc_cpu"
940 echo "kqemu support $kqemu"
941 echo "kvm support $kvm"
942 echo "CPU emulation $cpu_emulation"
943 if test $cpu = "powerpc"; then
944 echo "libfdt support $device_tree_support"
946 echo "brlapi support $brlapi"
947 echo "Documentation $build_docs"
948 [ ! -z "$uname_release" ] && \
949 echo "uname -r $uname_release"
950 echo "NPTL support $nptl"
952 if test $sdl_too_old = "yes"; then
953 echo "-> Your SDL version is too old - please upgrade to have SDL support"
955 if [ -s /tmp/qemu-$$-sdl-config.log ]; then
956 echo "The error log from compiling the libSDL test is: "
957 cat /tmp/qemu-$$-sdl-config.log
959 rm -f /tmp/qemu-$$-sdl-config.log
960 #if test "$sdl_static" = "no"; then
961 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
963 config_mak="config-host.mak"
964 config_h="config-host.h"
966 #echo "Creating $config_mak and $config_h"
968 test -f $config_h && mv $config_h ${config_h}~
970 echo "# Automatically generated by configure - do not modify" > $config_mak
971 echo "# Configured with: $0 $@" >> $config_mak
972 echo "/* Automatically generated by configure - do not modify */" > $config_h
974 echo "prefix=$prefix" >> $config_mak
975 echo "bindir=\${prefix}$binsuffix" >> $config_mak
976 echo "mandir=\${prefix}$mansuffix" >> $config_mak
977 echo "datadir=\${prefix}$datasuffix" >> $config_mak
978 echo "docdir=\${prefix}$docsuffix" >> $config_mak
979 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
980 echo "MAKE=$make" >> $config_mak
981 echo "INSTALL=$install" >> $config_mak
982 echo "CC=$cc" >> $config_mak
983 echo "HOST_CC=$host_cc" >> $config_mak
984 echo "AR=$ar" >> $config_mak
985 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
986 # XXX: only use CFLAGS and LDFLAGS ?
987 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
988 # compilation of dyngen tool (useful for win32 build on Linux host)
989 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
990 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
991 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
992 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
993 echo "CFLAGS=$CFLAGS" >> $config_mak
994 echo "LDFLAGS=$LDFLAGS" >> $config_mak
995 echo "EXESUF=$EXESUF" >> $config_mak
996 echo "AIOLIBS=$AIOLIBS" >> $config_mak
997 case "$cpu" in
998 i386)
999 echo "ARCH=i386" >> $config_mak
1000 echo "#define HOST_I386 1" >> $config_h
1002 x86_64)
1003 echo "ARCH=x86_64" >> $config_mak
1004 echo "#define HOST_X86_64 1" >> $config_h
1006 alpha)
1007 echo "ARCH=alpha" >> $config_mak
1008 echo "#define HOST_ALPHA 1" >> $config_h
1010 armv4b)
1011 echo "ARCH=arm" >> $config_mak
1012 echo "#define HOST_ARM 1" >> $config_h
1014 armv4l)
1015 echo "ARCH=arm" >> $config_mak
1016 echo "#define HOST_ARM 1" >> $config_h
1018 cris)
1019 echo "ARCH=cris" >> $config_mak
1020 echo "#define HOST_CRIS 1" >> $config_h
1022 hppa)
1023 echo "ARCH=hppa" >> $config_mak
1024 echo "#define HOST_HPPA 1" >> $config_h
1026 ia64)
1027 echo "ARCH=ia64" >> $config_mak
1028 echo "#define HOST_IA64 1" >> $config_h
1030 m68k)
1031 echo "ARCH=m68k" >> $config_mak
1032 echo "#define HOST_M68K 1" >> $config_h
1034 mips)
1035 echo "ARCH=mips" >> $config_mak
1036 echo "#define HOST_MIPS 1" >> $config_h
1038 mips64)
1039 echo "ARCH=mips64" >> $config_mak
1040 echo "#define HOST_MIPS64 1" >> $config_h
1042 powerpc)
1043 echo "ARCH=ppc" >> $config_mak
1044 echo "#define HOST_PPC 1" >> $config_h
1046 s390)
1047 echo "ARCH=s390" >> $config_mak
1048 echo "#define HOST_S390 1" >> $config_h
1050 sparc)
1051 echo "ARCH=sparc" >> $config_mak
1052 echo "#define HOST_SPARC 1" >> $config_h
1054 sparc64)
1055 echo "ARCH=sparc64" >> $config_mak
1056 echo "#define HOST_SPARC64 1" >> $config_h
1059 echo "Unsupported CPU = $cpu"
1060 exit 1
1062 esac
1063 if test "$bigendian" = "yes" ; then
1064 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1065 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1067 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1068 if test "$mingw32" = "yes" ; then
1069 echo "CONFIG_WIN32=yes" >> $config_mak
1070 echo "#define CONFIG_WIN32 1" >> $config_h
1071 else
1072 cat > $TMPC << EOF
1073 #include <byteswap.h>
1074 int main(void) { return bswap_32(0); }
1076 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1077 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1080 if test "$darwin" = "yes" ; then
1081 echo "CONFIG_DARWIN=yes" >> $config_mak
1082 echo "#define CONFIG_DARWIN 1" >> $config_h
1084 if test "$solaris" = "yes" ; then
1085 echo "CONFIG_SOLARIS=yes" >> $config_mak
1086 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1087 if test "$needs_libsunmath" = "yes" ; then
1088 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1089 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1092 if test -n "$sparc_cpu"; then
1093 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1094 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1096 if test "$gdbstub" = "yes" ; then
1097 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1098 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1100 if test "$gprof" = "yes" ; then
1101 echo "TARGET_GPROF=yes" >> $config_mak
1102 echo "#define HAVE_GPROF 1" >> $config_h
1104 if test "$static" = "yes" ; then
1105 echo "CONFIG_STATIC=yes" >> $config_mak
1106 echo "#define CONFIG_STATIC 1" >> $config_h
1108 if test $profiler = "yes" ; then
1109 echo "#define CONFIG_PROFILER 1" >> $config_h
1111 if test "$slirp" = "yes" ; then
1112 echo "CONFIG_SLIRP=yes" >> $config_mak
1113 echo "#define CONFIG_SLIRP 1" >> $config_h
1115 for card in $audio_card_list; do
1116 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1117 echo "$def=yes" >> $config_mak
1118 echo "#define $def 1" >> $config_h
1119 done
1120 echo "#define AUDIO_DRIVERS \\" >> $config_h
1121 for drv in $audio_drv_list; do
1122 echo " &${drv}_audio_driver, \\" >>$config_h
1123 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1124 echo "$def=yes" >> $config_mak
1125 if test "$drv" = "fmod"; then
1126 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1127 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1129 done
1130 echo "" >>$config_h
1131 if test "$mixemu" = "yes" ; then
1132 echo "CONFIG_MIXEMU=yes" >> $config_mak
1133 echo "#define CONFIG_MIXEMU 1" >> $config_h
1135 if test "$vnc_tls" = "yes" ; then
1136 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1137 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1138 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1139 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1141 qemu_version=`head $source_path/VERSION`
1142 echo "VERSION=$qemu_version" >>$config_mak
1143 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1144 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1146 echo "SRC_PATH=$source_path" >> $config_mak
1147 if [ "$source_path_used" = "yes" ]; then
1148 echo "VPATH=$source_path" >> $config_mak
1150 echo "TARGET_DIRS=$target_list" >> $config_mak
1151 if [ "$build_docs" = "yes" ] ; then
1152 echo "BUILD_DOCS=yes" >> $config_mak
1154 if test "$static" = "yes"; then
1155 sdl1=$sdl_static
1156 else
1157 sdl1=$sdl
1159 if test "$sdl1" = "yes" ; then
1160 echo "#define CONFIG_SDL 1" >> $config_h
1161 echo "CONFIG_SDL=yes" >> $config_mak
1162 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1163 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1164 else
1165 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1167 if [ "${aa}" = "yes" ] ; then
1168 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1169 else
1170 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1173 if test "$cocoa" = "yes" ; then
1174 echo "#define CONFIG_COCOA 1" >> $config_h
1175 echo "CONFIG_COCOA=yes" >> $config_mak
1177 if test "$curses" = "yes" ; then
1178 echo "#define CONFIG_CURSES 1" >> $config_h
1179 echo "CONFIG_CURSES=yes" >> $config_mak
1180 echo "CURSES_LIBS=-lcurses" >> $config_mak
1182 if test "$brlapi" = "yes" ; then
1183 echo "CONFIG_BRLAPI=yes" >> $config_mak
1184 echo "#define CONFIG_BRLAPI 1" >> $config_h
1185 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1188 # XXX: suppress that
1189 if [ "$bsd" = "yes" ] ; then
1190 echo "#define O_LARGEFILE 0" >> $config_h
1191 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1192 echo "#define _BSD 1" >> $config_h
1195 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1197 tools=
1198 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1199 tools="qemu-img\$(EXESUF) $tools"
1200 if [ "$linux" = "yes" ] ; then
1201 tools="qemu-nbd\$(EXESUF) $tools"
1204 echo "TOOLS=$tools" >> $config_mak
1206 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1208 for target in $target_list; do
1209 target_dir="$target"
1210 config_mak=$target_dir/config.mak
1211 config_h=$target_dir/config.h
1212 target_cpu=`echo $target | cut -d '-' -f 1`
1213 target_bigendian="no"
1214 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1215 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1216 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1217 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1218 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1219 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1220 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1221 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1222 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1223 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1224 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1225 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1226 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1227 target_softmmu="no"
1228 target_user_only="no"
1229 target_linux_user="no"
1230 target_darwin_user="no"
1231 case "$target" in
1232 ${target_cpu}-softmmu)
1233 target_softmmu="yes"
1235 ${target_cpu}-linux-user)
1236 target_user_only="yes"
1237 target_linux_user="yes"
1239 ${target_cpu}-darwin-user)
1240 target_user_only="yes"
1241 target_darwin_user="yes"
1244 echo "ERROR: Target '$target' not recognised"
1245 exit 1
1247 esac
1249 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1250 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1251 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1252 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1253 echo "Note that this will disable all output from the virtual graphics card"
1254 echo "except through VNC or curses."
1255 exit 1;
1258 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1260 test -f $config_h && mv $config_h ${config_h}~
1262 mkdir -p $target_dir
1263 mkdir -p $target_dir/fpu
1264 mkdir -p $target_dir/tcg
1265 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
1266 mkdir -p $target_dir/nwfpe
1270 # don't use ln -sf as not all "ln -sf" over write the file/link
1272 rm -f $target_dir/Makefile
1273 ln -s $source_path/Makefile.target $target_dir/Makefile
1276 echo "# Automatically generated by configure - do not modify" > $config_mak
1277 echo "/* Automatically generated by configure - do not modify */" > $config_h
1280 echo "include ../config-host.mak" >> $config_mak
1281 echo "#include \"../config-host.h\"" >> $config_h
1283 bflt="no"
1284 elfload32="no"
1285 target_nptl="no"
1286 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1287 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1289 disable_cpu_emulation() {
1290 if test $cpu_emulation = "no"; then
1291 echo "#define NO_CPU_EMULATION 1" >> $config_h
1292 echo "NO_CPU_EMULATION=1" >> $config_mak
1296 configure_kvm() {
1297 if test $kvm = "yes" -a "$target_softmmu" = "yes" -a \
1298 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1299 echo "#define USE_KVM 1" >> $config_h
1300 echo "USE_KVM=1" >> $config_mak
1301 echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak
1302 if test $kvm_cap_pit = "yes" ; then
1303 echo "USE_KVM_PIT=1" >> $config_mak
1304 echo "#define USE_KVM_PIT 1" >> $config_h
1306 disable_cpu_emulation
1310 case "$target_cpu" in
1311 i386)
1312 echo "TARGET_ARCH=i386" >> $config_mak
1313 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1314 echo "#define TARGET_I386 1" >> $config_h
1315 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1316 then
1317 echo "#define USE_KQEMU 1" >> $config_h
1319 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1320 if test -n "$gcc3minver" && test $gcc3minver -gt 3
1321 then
1322 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1323 else
1324 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1326 configure_kvm
1328 x86_64)
1329 echo "TARGET_ARCH=x86_64" >> $config_mak
1330 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1331 echo "#define TARGET_I386 1" >> $config_h
1332 echo "#define TARGET_X86_64 1" >> $config_h
1333 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1334 then
1335 echo "#define USE_KQEMU 1" >> $config_h
1337 configure_kvm
1339 ia64)
1340 echo "TARGET_ARCH=ia64" >> $config_mak
1341 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1342 echo "#define TARGET_IA64 1" >> $config_h
1343 configure_kvm
1345 alpha)
1346 echo "TARGET_ARCH=alpha" >> $config_mak
1347 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1348 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1349 echo "#define TARGET_ALPHA 1" >> $config_h
1350 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1352 arm|armeb)
1353 echo "TARGET_ARCH=arm" >> $config_mak
1354 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1355 echo "#define TARGET_ARM 1" >> $config_h
1356 bflt="yes"
1357 target_nptl="yes"
1359 cris)
1360 echo "TARGET_ARCH=cris" >> $config_mak
1361 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1362 echo "#define TARGET_CRIS 1" >> $config_h
1364 m68k)
1365 echo "TARGET_ARCH=m68k" >> $config_mak
1366 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1367 echo "#define TARGET_M68K 1" >> $config_h
1368 bflt="yes"
1370 mips|mipsel)
1371 echo "TARGET_ARCH=mips" >> $config_mak
1372 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1373 echo "#define TARGET_MIPS 1" >> $config_h
1374 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1376 mipsn32|mipsn32el)
1377 echo "TARGET_ARCH=mipsn32" >> $config_mak
1378 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1379 echo "#define TARGET_MIPS 1" >> $config_h
1380 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1382 mips64|mips64el)
1383 echo "TARGET_ARCH=mips64" >> $config_mak
1384 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1385 echo "#define TARGET_MIPS 1" >> $config_h
1386 echo "#define TARGET_MIPS64 1" >> $config_h
1387 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1389 ppc)
1390 echo "TARGET_ARCH=ppc" >> $config_mak
1391 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1392 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1393 echo "#define TARGET_PPC 1" >> $config_h
1394 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1396 ppcemb)
1397 echo "TARGET_ARCH=ppcemb" >> $config_mak
1398 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1399 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1400 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1401 echo "#define TARGET_PPC 1" >> $config_h
1402 echo "#define TARGET_PPCEMB 1" >> $config_h
1403 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1404 if test "$device_tree_support" = "yes" ; then
1405 echo "#define CONFIG_LIBFDT 1" >> $config_h
1406 echo "CONFIG_LIBFDT=1" >> $config_mak
1408 configure_kvm
1410 ppc64)
1411 echo "TARGET_ARCH=ppc64" >> $config_mak
1412 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1413 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1414 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1415 echo "#define TARGET_PPC 1" >> $config_h
1416 echo "#define TARGET_PPC64 1" >> $config_h
1417 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1419 ppc64abi32)
1420 echo "TARGET_ARCH=ppc64" >> $config_mak
1421 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1422 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1423 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1424 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1425 echo "#define TARGET_PPC 1" >> $config_h
1426 echo "#define TARGET_PPC64 1" >> $config_h
1427 echo "#define TARGET_ABI32 1" >> $config_h
1428 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1430 sh4|sh4eb)
1431 echo "TARGET_ARCH=sh4" >> $config_mak
1432 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1433 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1434 echo "#define TARGET_SH4 1" >> $config_h
1435 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1436 bflt="yes"
1438 sparc)
1439 echo "TARGET_ARCH=sparc" >> $config_mak
1440 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1441 echo "#define TARGET_SPARC 1" >> $config_h
1443 sparc64)
1444 echo "TARGET_ARCH=sparc64" >> $config_mak
1445 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1446 echo "#define TARGET_SPARC 1" >> $config_h
1447 echo "#define TARGET_SPARC64 1" >> $config_h
1448 elfload32="yes"
1450 sparc32plus)
1451 echo "TARGET_ARCH=sparc64" >> $config_mak
1452 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1453 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1454 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1455 echo "#define TARGET_SPARC 1" >> $config_h
1456 echo "#define TARGET_SPARC64 1" >> $config_h
1457 echo "#define TARGET_ABI32 1" >> $config_h
1460 echo "Unsupported target CPU"
1461 exit 1
1463 esac
1464 if test "$target_bigendian" = "yes" ; then
1465 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1466 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1468 if test "$target_softmmu" = "yes" ; then
1469 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1470 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1472 if test "$target_user_only" = "yes" ; then
1473 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1474 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1476 if test "$target_linux_user" = "yes" ; then
1477 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1478 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1480 if test "$target_darwin_user" = "yes" ; then
1481 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1482 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1485 if test "$target_cpu" = "arm" \
1486 -o "$target_cpu" = "armeb" \
1487 -o "$target_cpu" = "m68k" \
1488 -o "$target_cpu" = "mips" \
1489 -o "$target_cpu" = "mipsel" \
1490 -o "$target_cpu" = "mipsn32" \
1491 -o "$target_cpu" = "mipsn32el" \
1492 -o "$target_cpu" = "mips64" \
1493 -o "$target_cpu" = "mips64el" \
1494 -o "$target_cpu" = "sparc" \
1495 -o "$target_cpu" = "sparc64" \
1496 -o "$target_cpu" = "sparc32plus"; then
1497 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1498 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1500 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1501 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1502 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1504 if test "$target_user_only" = "yes" \
1505 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1506 echo "#define USE_NPTL 1" >> $config_h
1508 # 32 bit ELF loader in addition to native 64 bit loader?
1509 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1510 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1511 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1514 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1516 done # for target in $targets
1518 # build tree in object directory if source path is different from current one
1519 if test "$source_path_used" = "yes" ; then
1520 DIRS="tests tests/cris slirp audio"
1521 FILES="Makefile tests/Makefile"
1522 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1523 FILES="$FILES tests/test-mmap.c"
1524 for dir in $DIRS ; do
1525 mkdir -p $dir
1526 done
1527 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1528 for f in $FILES ; do
1529 rm -f $f
1530 ln -s $source_path/$f $f
1531 done
1534 rm -f $TMPO $TMPC $TMPE $TMPS