xen: add console backend driver. (Gerd Hoffmann)
[qemu/mmix.git] / configure
blobec761ff95c43e793adf65a571f2536315ed88388
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"
18 TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
19 TMPSDLLOG="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log"
21 trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
23 # default parameters
24 prefix=""
25 interp_prefix="/usr/gnemul/qemu-%M"
26 static="no"
27 cross_prefix=""
28 cc="gcc"
29 audio_drv_list=""
30 audio_card_list="ac97 es1370 sb16"
31 audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
32 host_cc="gcc"
33 ar="ar"
34 make="make"
35 install="install"
36 strip="strip"
38 # parse CC options first
39 for opt do
40 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
41 case "$opt" in
42 --cross-prefix=*) cross_prefix="$optarg"
44 --cc=*) cc="$optarg"
46 esac
47 done
49 # OS specific
50 # Using uname is really, really broken. Once we have the right set of checks
51 # we can eliminate it's usage altogether
53 cc="${cross_prefix}${cc}"
54 ar="${cross_prefix}${ar}"
55 strip="${cross_prefix}${strip}"
57 # check that the C compiler works.
58 cat > $TMPC <<EOF
59 int main(void) {}
60 EOF
62 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
63 : C compiler works ok
64 else
65 echo "ERROR: \"$cc\" either does not exist or does not work"
66 exit 1
69 check_define() {
70 cat > $TMPC <<EOF
71 #if !defined($1)
72 #error Not defined
73 #endif
74 int main(void) { return 0; }
75 EOF
76 $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
79 if check_define __i386__ ; then
80 cpu="i386"
81 elif check_define __x86_64__ ; then
82 cpu="x86_64"
83 elif check_define __sparc__ ; then
84 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
85 # They must be specified using --sparc_cpu
86 if check_define __arch64__ ; then
87 cpu="sparc64"
88 else
89 cpu="sparc"
91 elif check_define _ARCH_PPC ; then
92 if check_define _ARCH_PPC64 ; then
93 cpu="ppc64"
94 else
95 cpu="ppc"
97 else
98 cpu=`uname -m`
101 target_list=""
102 case "$cpu" in
103 i386|i486|i586|i686|i86pc|BePC)
104 cpu="i386"
106 x86_64|amd64)
107 cpu="x86_64"
109 alpha)
110 cpu="alpha"
112 armv*b)
113 cpu="armv4b"
115 armv*l)
116 cpu="armv4l"
118 cris)
119 cpu="cris"
121 parisc|parisc64)
122 cpu="hppa"
124 ia64)
125 cpu="ia64"
127 m68k)
128 cpu="m68k"
130 mips)
131 cpu="mips"
133 mips64)
134 cpu="mips64"
136 ppc)
137 cpu="ppc"
139 ppc64)
140 cpu="ppc64"
142 s390*)
143 cpu="s390"
145 sparc|sun4[cdmuv])
146 cpu="sparc"
148 sparc64)
149 cpu="sparc64"
152 cpu="unknown"
154 esac
155 gprof="no"
156 debug_tcg="no"
157 sparse="no"
158 strip_opt="yes"
159 bigendian="no"
160 mingw32="no"
161 EXESUF=""
162 gdbstub="yes"
163 slirp="yes"
164 vde="yes"
165 fmod_lib=""
166 fmod_inc=""
167 oss_lib=""
168 vnc_tls="yes"
169 vnc_sasl="yes"
170 bsd="no"
171 linux="no"
172 solaris="no"
173 kqemu="no"
174 profiler="no"
175 cocoa="no"
176 check_gfx="yes"
177 softmmu="yes"
178 linux_user="no"
179 darwin_user="no"
180 bsd_user="no"
181 build_docs="no"
182 uname_release=""
183 curses="yes"
184 aio="yes"
185 nptl="yes"
186 mixemu="no"
187 bluez="yes"
188 kvm="yes"
189 kerneldir=""
190 aix="no"
191 blobs="yes"
192 fdt="yes"
193 sdl_x11="no"
194 xen="yes"
195 pkgversion=""
197 # OS specific
198 if check_define __linux__ ; then
199 targetos="Linux"
200 elif check_define _WIN32 ; then
201 targetos='MINGW32'
202 elif check_define __OpenBSD__ ; then
203 targetos='OpenBSD'
204 elif check_define __sun__ ; then
205 targetos='SunOS'
206 else
207 targetos=`uname -s`
209 case $targetos in
210 CYGWIN*)
211 mingw32="yes"
212 OS_CFLAGS="-mno-cygwin"
213 if [ "$cpu" = "i386" ] ; then
214 kqemu="yes"
216 audio_possible_drivers="sdl"
218 MINGW32*)
219 mingw32="yes"
220 if [ "$cpu" = "i386" ] ; then
221 kqemu="yes"
223 audio_possible_drivers="dsound sdl fmod"
225 GNU/kFreeBSD)
226 audio_drv_list="oss"
227 audio_possible_drivers="oss sdl esd pa"
228 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
229 kqemu="yes"
232 FreeBSD)
233 bsd="yes"
234 audio_drv_list="oss"
235 audio_possible_drivers="oss sdl esd pa"
236 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
237 kqemu="yes"
240 DragonFly)
241 bsd="yes"
242 audio_drv_list="oss"
243 audio_possible_drivers="oss sdl esd pa"
244 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
245 kqemu="yes"
247 aio="no"
249 NetBSD)
250 bsd="yes"
251 audio_drv_list="oss"
252 audio_possible_drivers="oss sdl esd"
253 oss_lib="-lossaudio"
255 OpenBSD)
256 bsd="yes"
257 openbsd="yes"
258 audio_drv_list="oss"
259 audio_possible_drivers="oss sdl esd"
260 oss_lib="-lossaudio"
262 Darwin)
263 bsd="yes"
264 darwin="yes"
265 # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
266 if [ "$cpu" = "i386" ] ; then
267 is_x86_64=`sysctl -n hw.optional.x86_64`
268 [ "$is_x86_64" = "1" ] && cpu=x86_64
270 if [ "$cpu" = "x86_64" ] ; then
271 OS_CFLAGS="-arch x86_64"
272 LDFLAGS="-arch x86_64"
273 else
274 OS_CFLAGS="-mdynamic-no-pic"
276 darwin_user="yes"
277 cocoa="yes"
278 audio_drv_list="coreaudio"
279 audio_possible_drivers="coreaudio sdl fmod"
280 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
282 SunOS)
283 solaris="yes"
284 make="gmake"
285 install="ginstall"
286 needs_libsunmath="no"
287 kvm="no"
288 solarisrev=`uname -r | cut -f2 -d.`
289 # have to select again, because `uname -m` returns i86pc
290 # even on an x86_64 box.
291 solariscpu=`isainfo -k`
292 if test "${solariscpu}" = "amd64" ; then
293 cpu="x86_64"
295 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
296 if test "$solarisrev" -le 9 ; then
297 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
298 needs_libsunmath="yes"
299 else
300 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
301 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
302 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
303 echo "Studio 11 can be downloaded from www.sun.com."
304 exit 1
307 if test "$solarisrev" -ge 9 ; then
308 kqemu="yes"
311 if test -f /usr/include/sys/soundcard.h ; then
312 audio_drv_list="oss"
314 audio_possible_drivers="oss sdl"
315 OS_CFLAGS=-std=gnu99
317 AIX)
318 aix="yes"
319 make="gmake"
322 audio_drv_list="oss"
323 audio_possible_drivers="oss alsa sdl esd pa"
324 linux="yes"
325 linux_user="yes"
326 usb="linux"
327 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
328 kqemu="yes"
329 audio_possible_drivers="$audio_possible_drivers fmod"
332 esac
334 if [ "$bsd" = "yes" ] ; then
335 if [ "$darwin" != "yes" ] ; then
336 make="gmake"
337 usb="bsd"
339 bsd_user="yes"
342 # find source path
343 source_path=`dirname "$0"`
344 source_path_used="no"
345 workdir=`pwd`
346 if [ -z "$source_path" ]; then
347 source_path=$workdir
348 else
349 source_path=`cd "$source_path"; pwd`
351 [ -f "$workdir/vl.c" ] || source_path_used="yes"
353 werror="no"
354 # generate compile errors on warnings for development builds
355 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
356 #werror="yes";
359 for opt do
360 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
361 case "$opt" in
362 --help|-h) show_help=yes
364 --prefix=*) prefix="$optarg"
366 --interp-prefix=*) interp_prefix="$optarg"
368 --source-path=*) source_path="$optarg"
369 source_path_used="yes"
371 --cross-prefix=*)
373 --cc=*)
375 --host-cc=*) host_cc="$optarg"
377 --make=*) make="$optarg"
379 --install=*) install="$optarg"
381 --extra-cflags=*) CFLAGS="$optarg"
383 --extra-ldflags=*) LDFLAGS="$optarg"
385 --cpu=*) cpu="$optarg"
387 --target-list=*) target_list="$optarg"
389 --enable-gprof) gprof="yes"
391 --static) static="yes"
393 --disable-sdl) sdl="no"
395 --fmod-lib=*) fmod_lib="$optarg"
397 --fmod-inc=*) fmod_inc="$optarg"
399 --oss-lib=*) oss_lib="$optarg"
401 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
403 --audio-drv-list=*) audio_drv_list="$optarg"
405 --enable-debug-tcg) debug_tcg="yes"
407 --disable-debug-tcg) debug_tcg="no"
409 --enable-sparse) sparse="yes"
411 --disable-sparse) sparse="no"
413 --disable-strip) strip_opt="no"
415 --disable-vnc-tls) vnc_tls="no"
417 --disable-vnc-sasl) vnc_sasl="no"
419 --disable-slirp) slirp="no"
421 --disable-vde) vde="no"
423 --disable-kqemu) kqemu="no"
425 --disable-xen) xen="no"
427 --disable-brlapi) brlapi="no"
429 --disable-bluez) bluez="no"
431 --disable-kvm) kvm="no"
433 --enable-profiler) profiler="yes"
435 --enable-cocoa)
436 cocoa="yes" ;
437 sdl="no" ;
438 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
440 --disable-gfx-check) check_gfx="no"
442 --disable-system) softmmu="no"
444 --enable-system) softmmu="yes"
446 --disable-linux-user) linux_user="no"
448 --enable-linux-user) linux_user="yes"
450 --disable-darwin-user) darwin_user="no"
452 --enable-darwin-user) darwin_user="yes"
454 --disable-bsd-user) bsd_user="no"
456 --enable-bsd-user) bsd_user="yes"
458 --enable-uname-release=*) uname_release="$optarg"
460 --sparc_cpu=*)
461 sparc_cpu="$optarg"
462 case $sparc_cpu in
463 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
464 target_cpu="sparc"; cpu="sparc" ;;
465 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
466 target_cpu="sparc"; cpu="sparc" ;;
467 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
468 target_cpu="sparc64"; cpu="sparc64" ;;
469 *) echo "undefined SPARC architecture. Exiting";exit 1;;
470 esac
472 --enable-werror) werror="yes"
474 --disable-werror) werror="no"
476 --disable-curses) curses="no"
478 --disable-nptl) nptl="no"
480 --enable-mixemu) mixemu="yes"
482 --disable-aio) aio="no"
484 --disable-blobs) blobs="no"
486 --kerneldir=*) kerneldir="$optarg"
488 --with-pkgversion=*) pkgversion=" ($optarg)"
490 *) echo "ERROR: unknown option $opt"; show_help="yes"
492 esac
493 done
495 # default flags for all hosts
496 CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
497 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
498 LDFLAGS="$LDFLAGS -g"
499 if test "$werror" = "yes" ; then
500 CFLAGS="$CFLAGS -Werror"
503 if test "$solaris" = "no" ; then
504 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
505 LDFLAGS="$LDFLAGS -Wl,--warn-common"
510 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
511 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
513 case "$cpu" in
514 sparc) if test -z "$sparc_cpu" ; then
515 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
516 ARCH_LDFLAGS="-m32"
517 else
518 ARCH_CFLAGS="${SP_CFLAGS}"
519 ARCH_LDFLAGS="${SP_LDFLAGS}"
521 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
522 if test "$solaris" = "no" ; then
523 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6"
526 sparc64) if test -z "$sparc_cpu" ; then
527 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
528 ARCH_LDFLAGS="-m64"
529 else
530 ARCH_CFLAGS="${SP_CFLAGS}"
531 ARCH_LDFLAGS="${SP_LDFLAGS}"
533 if test "$solaris" = "no" ; then
534 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
535 else
536 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7"
539 s390)
540 ARCH_CFLAGS="-march=z900"
542 i386)
543 ARCH_CFLAGS="-m32"
544 ARCH_LDFLAGS="-m32"
546 x86_64)
547 ARCH_CFLAGS="-m64"
548 ARCH_LDFLAGS="-m64"
550 esac
552 if test x"$show_help" = x"yes" ; then
553 cat << EOF
555 Usage: configure [options]
556 Options: [defaults in brackets after descriptions]
559 echo "Standard options:"
560 echo " --help print this message"
561 echo " --prefix=PREFIX install in PREFIX [$prefix]"
562 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
563 echo " use %M for cpu name [$interp_prefix]"
564 echo " --target-list=LIST set target list [$target_list]"
565 echo ""
566 echo "kqemu kernel acceleration support:"
567 echo " --disable-kqemu disable kqemu support"
568 echo ""
569 echo "Advanced options (experts only):"
570 echo " --source-path=PATH path of source code [$source_path]"
571 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
572 echo " --cc=CC use C compiler CC [$cc]"
573 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
574 echo " --extra-cflags=CFLAGS add C compiler flags CFLAGS"
575 echo " --extra-ldflags=LDFLAGS add linker flags LDFLAGS"
576 echo " --make=MAKE use specified make [$make]"
577 echo " --install=INSTALL use specified install [$install]"
578 echo " --static enable static build [$static]"
579 echo " --enable-debug-tcg enable TCG debugging"
580 echo " --disable-debug-tcg disable TCG debugging (default)"
581 echo " --enable-sparse enable sparse checker"
582 echo " --disable-sparse disable sparse checker (default)"
583 echo " --disable-strip disable stripping binaries"
584 echo " --disable-werror disable compilation abort on warning"
585 echo " --disable-sdl disable SDL"
586 echo " --enable-cocoa enable COCOA (Mac OS X only)"
587 echo " --audio-drv-list=LIST set audio drivers list:"
588 echo " Available drivers: $audio_possible_drivers"
589 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
590 echo " Available cards: $audio_possible_cards"
591 echo " --enable-mixemu enable mixer emulation"
592 echo " --disable-xen disable xen backend driver support"
593 echo " --disable-brlapi disable BrlAPI"
594 echo " --disable-vnc-tls disable TLS encryption for VNC server"
595 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
596 echo " --disable-curses disable curses output"
597 echo " --disable-bluez disable bluez stack connectivity"
598 echo " --disable-kvm disable KVM acceleration support"
599 echo " --disable-nptl disable usermode NPTL support"
600 echo " --enable-system enable all system emulation targets"
601 echo " --disable-system disable all system emulation targets"
602 echo " --enable-linux-user enable all linux usermode emulation targets"
603 echo " --disable-linux-user disable all linux usermode emulation targets"
604 echo " --enable-darwin-user enable all darwin usermode emulation targets"
605 echo " --disable-darwin-user disable all darwin usermode emulation targets"
606 echo " --enable-bsd-user enable all BSD usermode emulation targets"
607 echo " --disable-bsd-user disable all BSD usermode emulation targets"
608 echo " --fmod-lib path to FMOD library"
609 echo " --fmod-inc path to FMOD includes"
610 echo " --oss-lib path to OSS library"
611 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
612 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
613 echo " --disable-vde disable support for vde network"
614 echo " --disable-aio disable AIO support"
615 echo " --disable-blobs disable installing provided firmware blobs"
616 echo " --kerneldir=PATH look for kernel includes in PATH"
617 echo ""
618 echo "NOTE: The object files are built at the place where configure is launched"
619 exit 1
622 if test "$mingw32" = "yes" ; then
623 linux="no"
624 EXESUF=".exe"
625 oss="no"
626 linux_user="no"
627 bsd_user="no"
628 OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
631 if test ! -x "$(which cgcc 2>/dev/null)"; then
632 sparse="no"
636 # Solaris specific configure tool chain decisions
638 if test "$solaris" = "yes" ; then
639 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
640 if test -z "$solinst" ; then
641 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
642 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
643 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
644 exit 1
646 if test "$solinst" = "/usr/sbin/install" ; then
647 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
648 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
649 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
650 exit 1
652 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
653 if test -z "$sol_ar" ; then
654 echo "Error: No path includes ar"
655 if test -f /usr/ccs/bin/ar ; then
656 echo "Add /usr/ccs/bin to your path and rerun configure"
658 exit 1
663 if test -z "$target_list" ; then
664 # these targets are portable
665 if [ "$softmmu" = "yes" ] ; then
666 target_list="\
667 i386-softmmu \
668 x86_64-softmmu \
669 arm-softmmu \
670 cris-softmmu \
671 m68k-softmmu \
672 mips-softmmu \
673 mipsel-softmmu \
674 mips64-softmmu \
675 mips64el-softmmu \
676 ppc-softmmu \
677 ppcemb-softmmu \
678 ppc64-softmmu \
679 sh4-softmmu \
680 sh4eb-softmmu \
681 sparc-softmmu \
684 # the following are Linux specific
685 if [ "$linux_user" = "yes" ] ; then
686 target_list="${target_list}\
687 i386-linux-user \
688 x86_64-linux-user \
689 alpha-linux-user \
690 arm-linux-user \
691 armeb-linux-user \
692 cris-linux-user \
693 m68k-linux-user \
694 mips-linux-user \
695 mipsel-linux-user \
696 ppc-linux-user \
697 ppc64-linux-user \
698 ppc64abi32-linux-user \
699 sh4-linux-user \
700 sh4eb-linux-user \
701 sparc-linux-user \
702 sparc64-linux-user \
703 sparc32plus-linux-user \
706 # the following are Darwin specific
707 if [ "$darwin_user" = "yes" ] ; then
708 target_list="$target_list i386-darwin-user ppc-darwin-user "
710 # the following are BSD specific
711 if [ "$bsd_user" = "yes" ] ; then
712 target_list="${target_list}\
713 i386-bsd-user \
714 x86_64-bsd-user \
715 sparc-bsd-user \
716 sparc64-bsd-user \
719 else
720 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
722 if test -z "$target_list" ; then
723 echo "No targets enabled"
724 exit 1
727 if test -z "$cross_prefix" ; then
729 # ---
730 # big/little endian test
731 cat > $TMPC << EOF
732 #include <inttypes.h>
733 int main(int argc, char ** argv){
734 volatile uint32_t i=0x01234567;
735 return (*((uint8_t*)(&i))) == 0x67;
739 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
740 $TMPE && bigendian="yes"
741 else
742 echo big/little test failed
745 else
747 # if cross compiling, cannot launch a program, so make a static guess
748 if test "$cpu" = "armv4b" \
749 -o "$cpu" = "hppa" \
750 -o "$cpu" = "m68k" \
751 -o "$cpu" = "mips" \
752 -o "$cpu" = "mips64" \
753 -o "$cpu" = "ppc" \
754 -o "$cpu" = "ppc64" \
755 -o "$cpu" = "s390" \
756 -o "$cpu" = "sparc" \
757 -o "$cpu" = "sparc64"; then
758 bigendian="yes"
763 # host long bits test
764 hostlongbits="32"
765 if test "$cpu" = "x86_64" \
766 -o "$cpu" = "alpha" \
767 -o "$cpu" = "ia64" \
768 -o "$cpu" = "sparc64" \
769 -o "$cpu" = "ppc64"; then
770 hostlongbits="64"
773 # Check host NPTL support
774 cat > $TMPC <<EOF
775 #include <sched.h>
776 #include <linux/futex.h>
777 void foo()
779 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
780 #error bork
781 #endif
785 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
787 else
788 nptl="no"
791 ##########################################
792 # zlib check
794 cat > $TMPC << EOF
795 #include <zlib.h>
796 int main(void) { zlibVersion(); return 0; }
798 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
800 else
801 echo
802 echo "Error: zlib check failed"
803 echo "Make sure to have the zlib libs and headers installed."
804 echo
805 exit 1
808 ##########################################
809 # xen probe
811 if test "$xen" = "yes" ; then
812 cat > $TMPC <<EOF
813 #include <xenctrl.h>
814 #include <xs.h>
815 int main(void) { xs_daemon_open; xc_interface_open; }
817 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC -lxenstore -lxenctrl 2> /dev/null ; then
819 else
820 xen="no"
824 ##########################################
825 # SDL probe
827 sdl_too_old=no
829 if test -z "$sdl" ; then
830 sdl_config="sdl-config"
831 sdl=no
832 sdl_static=no
834 cat > $TMPC << EOF
835 #include <SDL.h>
836 #undef main /* We don't want SDL to override our main() */
837 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
839 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then
840 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
841 if test "$_sdlversion" -lt 121 ; then
842 sdl_too_old=yes
843 else
844 if test "$cocoa" = "no" ; then
845 sdl=yes
849 # static link with sdl ?
850 if test "$sdl" = "yes" ; then
851 aa="no"
852 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
853 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
854 if [ "$aa" = "yes" ] ; then
855 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
858 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
859 sdl_static=yes
861 fi # static link
862 fi # sdl compile test
863 else
864 # Make sure to disable cocoa if sdl was set
865 if test "$sdl" = "yes" ; then
866 cocoa="no"
867 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
869 fi # -z $sdl
871 if test "$sdl" = "yes" ; then
872 cat > $TMPC <<EOF
873 #include <SDL.h>
874 #if defined(SDL_VIDEO_DRIVER_X11)
875 #include <X11/XKBlib.h>
876 #else
877 #error No x11 support
878 #endif
879 int main(void) { return 0; }
881 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then
882 sdl_x11="yes"
886 ##########################################
887 # VNC TLS detection
888 if test "$vnc_tls" = "yes" ; then
889 cat > $TMPC <<EOF
890 #include <gnutls/gnutls.h>
891 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
893 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
894 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
895 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
896 $vnc_tls_libs > /dev/null 2> /dev/null ; then
898 else
899 vnc_tls="no"
903 ##########################################
904 # VNC SASL detection
905 if test "$vnc_sasl" = "yes" ; then
906 cat > $TMPC <<EOF
907 #include <sasl/sasl.h>
908 #include <stdio.h>
909 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
911 # Assuming Cyrus-SASL installed in /usr prefix
912 vnc_sasl_cflags=""
913 vnc_sasl_libs="-lsasl2"
914 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
915 $vnc_sasl_libs 2> /dev/null ; then
917 else
918 vnc_sasl="no"
922 ##########################################
923 # fnmatch() probe, used for ACL routines
924 fnmatch="no"
925 cat > $TMPC << EOF
926 #include <fnmatch.h>
927 int main(void)
929 fnmatch("foo", "foo", 0);
930 return 0;
933 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
934 fnmatch="yes"
937 ##########################################
938 # vde libraries probe
939 if test "$vde" = "yes" ; then
940 cat > $TMPC << EOF
941 #include <libvdeplug.h>
942 int main(void)
944 struct vde_open_args a = {0, 0, 0};
945 vde_open("", "", &a);
946 return 0;
949 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
951 else
952 vde="no"
956 ##########################################
957 # Sound support libraries probe
959 audio_drv_probe()
961 drv=$1
962 hdr=$2
963 lib=$3
964 exp=$4
965 cfl=$5
966 cat > $TMPC << EOF
967 #include <$hdr>
968 int main(void) { $exp }
970 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
972 else
973 echo
974 echo "Error: $drv check failed"
975 echo "Make sure to have the $drv libs and headers installed."
976 echo
977 exit 1
981 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
982 for drv in $audio_drv_list; do
983 case $drv in
984 alsa)
985 audio_drv_probe $drv alsa/asoundlib.h -lasound \
986 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
989 fmod)
990 if test -z $fmod_lib || test -z $fmod_inc; then
991 echo
992 echo "Error: You must specify path to FMOD library and headers"
993 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
994 echo
995 exit 1
997 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1000 esd)
1001 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1005 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1006 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1009 oss|sdl|core|wav|dsound)
1010 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1014 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1015 echo
1016 echo "Error: Unknown driver '$drv' selected"
1017 echo "Possible drivers are: $audio_possible_drivers"
1018 echo
1019 exit 1
1022 esac
1023 done
1025 ##########################################
1026 # BrlAPI probe
1028 if test -z "$brlapi" ; then
1029 brlapi=no
1030 cat > $TMPC << EOF
1031 #include <brlapi.h>
1032 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1034 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1035 brlapi=yes
1036 fi # brlapi compile test
1037 fi # -z $brlapi
1039 ##########################################
1040 # curses probe
1042 if test "$curses" = "yes" ; then
1043 curses=no
1044 cat > $TMPC << EOF
1045 #include <curses.h>
1046 #ifdef __OpenBSD__
1047 #define resize_term resizeterm
1048 #endif
1049 int main(void) { resize_term(0, 0); return curses_version(); }
1051 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1052 curses=yes
1054 fi # test "$curses"
1056 ##########################################
1057 # bluez support probe
1058 if test "$bluez" = "yes" ; then
1059 `pkg-config bluez` || bluez="no"
1061 if test "$bluez" = "yes" ; then
1062 cat > $TMPC << EOF
1063 #include <bluetooth/bluetooth.h>
1064 int main(void) { return bt_error(0); }
1066 bluez_cflags=`pkg-config --cflags bluez`
1067 bluez_libs=`pkg-config --libs bluez`
1068 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1069 $bluez_libs > /dev/null 2> /dev/null ; then
1071 else
1072 bluez="no"
1076 ##########################################
1077 # kvm probe
1078 if test "$kvm" = "yes" ; then
1079 cat > $TMPC <<EOF
1080 #include <linux/kvm.h>
1081 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1082 #error Invalid KVM version
1083 #endif
1084 #if !defined(KVM_CAP_USER_MEMORY)
1085 #error Missing KVM capability KVM_CAP_USER_MEMORY
1086 #endif
1087 #if !defined(KVM_CAP_SET_TSS_ADDR)
1088 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1089 #endif
1090 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1091 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1092 #endif
1093 int main(void) { return 0; }
1095 if test "$kerneldir" != "" ; then
1096 kvm_cflags=-I"$kerneldir"/include
1097 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1098 -a -d "$kerneldir/arch/x86/include" ; then
1099 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1100 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1101 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1102 elif test -d "$kerneldir/arch/$cpu/include" ; then
1103 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1105 else
1106 kvm_cflags=""
1108 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1109 > /dev/null 2>/dev/null ; then
1111 else
1112 kvm="no";
1113 if [ -x "`which awk 2>/dev/null`" ] && \
1114 [ -x "`which grep 2>/dev/null`" ]; then
1115 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1116 | grep "error: " \
1117 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1118 if test "$kvmerr" != "" ; then
1119 kvm="no - (${kvmerr})"
1125 ##########################################
1126 # AIO probe
1127 AIOLIBS=""
1129 if test "$aio" = "yes" ; then
1130 aio=no
1131 cat > $TMPC << EOF
1132 #include <pthread.h>
1133 int main(void) { pthread_mutex_t lock; return 0; }
1135 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1136 aio=yes
1137 AIOLIBS="-lpthread"
1141 ##########################################
1142 # iovec probe
1143 cat > $TMPC <<EOF
1144 #include <sys/types.h>
1145 #include <sys/uio.h>
1146 #include <unistd.h>
1147 int main(void) { struct iovec iov; return 0; }
1149 iovec=no
1150 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1151 iovec=yes
1154 ##########################################
1155 # preadv probe
1156 cat > $TMPC <<EOF
1157 #include <sys/types.h>
1158 #include <sys/uio.h>
1159 #include <unistd.h>
1160 int main(void) { preadv; }
1162 preadv=no
1163 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1164 preadv=yes
1167 ##########################################
1168 # fdt probe
1169 if test "$fdt" = "yes" ; then
1170 fdt=no
1171 cat > $TMPC << EOF
1172 int main(void) { return 0; }
1174 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1175 fdt=yes
1180 # Check for xxxat() functions when we are building linux-user
1181 # emulator. This is done because older glibc versions don't
1182 # have syscall stubs for these implemented.
1184 atfile=no
1185 if [ "$linux_user" = "yes" ] ; then
1186 cat > $TMPC << EOF
1187 #define _ATFILE_SOURCE
1188 #include <sys/types.h>
1189 #include <fcntl.h>
1190 #include <unistd.h>
1193 main(void)
1195 /* try to unlink nonexisting file */
1196 return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
1199 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1200 atfile=yes
1204 # Check for inotify functions when we are building linux-user
1205 # emulator. This is done because older glibc versions don't
1206 # have syscall stubs for these implemented. In that case we
1207 # don't provide them even if kernel supports them.
1209 inotify=no
1210 if [ "$linux_user" = "yes" ] ; then
1211 cat > $TMPC << EOF
1212 #include <sys/inotify.h>
1215 main(void)
1217 /* try to start inotify */
1218 return inotify_init();
1221 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1222 inotify=yes
1226 # Check if tools are available to build documentation.
1227 if [ -x "`which texi2html 2>/dev/null`" ] && \
1228 [ -x "`which pod2man 2>/dev/null`" ]; then
1229 build_docs="yes"
1232 ##########################################
1233 # Do we need librt
1234 cat > $TMPC <<EOF
1235 #include <signal.h>
1236 #include <time.h>
1237 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1240 rt=no
1241 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1243 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1244 rt=yes
1247 if test "$rt" = "yes" ; then
1248 # Hack, we should have a general purpose LIBS for this sort of thing
1249 AIOLIBS="$AIOLIBS -lrt"
1252 if test "$mingw32" = "yes" ; then
1253 if test -z "$prefix" ; then
1254 prefix="c:\\\\Program Files\\\\Qemu"
1256 mansuffix=""
1257 datasuffix=""
1258 docsuffix=""
1259 binsuffix=""
1260 else
1261 if test -z "$prefix" ; then
1262 prefix="/usr/local"
1264 mansuffix="/share/man"
1265 datasuffix="/share/qemu"
1266 docsuffix="/share/doc/qemu"
1267 binsuffix="/bin"
1270 echo "Install prefix $prefix"
1271 echo "BIOS directory $prefix$datasuffix"
1272 echo "binary directory $prefix$binsuffix"
1273 if test "$mingw32" = "no" ; then
1274 echo "Manual directory $prefix$mansuffix"
1275 echo "ELF interp prefix $interp_prefix"
1277 echo "Source path $source_path"
1278 echo "C compiler $cc"
1279 echo "Host C compiler $host_cc"
1280 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1281 echo "make $make"
1282 echo "install $install"
1283 echo "host CPU $cpu"
1284 echo "host big endian $bigendian"
1285 echo "target list $target_list"
1286 echo "tcg debug enabled $debug_tcg"
1287 echo "gprof enabled $gprof"
1288 echo "sparse enabled $sparse"
1289 echo "strip binaries $strip_opt"
1290 echo "profiler $profiler"
1291 echo "static build $static"
1292 echo "-Werror enabled $werror"
1293 if test "$darwin" = "yes" ; then
1294 echo "Cocoa support $cocoa"
1296 echo "SDL support $sdl"
1297 if test "$sdl" != "no" ; then
1298 echo "SDL static link $sdl_static"
1300 echo "curses support $curses"
1301 echo "mingw32 support $mingw32"
1302 echo "Audio drivers $audio_drv_list"
1303 echo "Extra audio cards $audio_card_list"
1304 echo "Mixer emulation $mixemu"
1305 echo "VNC TLS support $vnc_tls"
1306 if test "$vnc_tls" = "yes" ; then
1307 echo " TLS CFLAGS $vnc_tls_cflags"
1308 echo " TLS LIBS $vnc_tls_libs"
1310 echo "VNC SASL support $vnc_sasl"
1311 if test "$vnc_sasl" = "yes" ; then
1312 echo " SASL CFLAGS $vnc_sasl_cflags"
1313 echo " SASL LIBS $vnc_sasl_libs"
1315 if test -n "$sparc_cpu"; then
1316 echo "Target Sparc Arch $sparc_cpu"
1318 echo "kqemu support $kqemu"
1319 echo "xen support $xen"
1320 echo "brlapi support $brlapi"
1321 echo "Documentation $build_docs"
1322 [ ! -z "$uname_release" ] && \
1323 echo "uname -r $uname_release"
1324 echo "NPTL support $nptl"
1325 echo "vde support $vde"
1326 echo "AIO support $aio"
1327 echo "Install blobs $blobs"
1328 echo "KVM support $kvm"
1329 echo "fdt support $fdt"
1330 echo "preadv support $preadv"
1332 if test $sdl_too_old = "yes"; then
1333 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1335 if [ -s $TMPSDLLOG ]; then
1336 echo "The error log from compiling the libSDL test is: "
1337 cat $TMPSDLLOG
1339 #if test "$sdl_static" = "no"; then
1340 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1342 config_mak="config-host.mak"
1343 config_h="config-host.h"
1345 #echo "Creating $config_mak and $config_h"
1347 test -f $config_h && mv $config_h ${config_h}~
1349 echo "# Automatically generated by configure - do not modify" > $config_mak
1350 printf "# Configured with:" >> $config_mak
1351 printf " '%s'" "$0" "$@" >> $config_mak
1352 echo >> $config_mak
1353 echo "/* Automatically generated by configure - do not modify */" > $config_h
1355 echo "prefix=$prefix" >> $config_mak
1356 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1357 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1358 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1359 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1360 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1361 echo "MAKE=$make" >> $config_mak
1362 echo "INSTALL=$install" >> $config_mak
1363 echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_mak
1364 echo "INSTALL_DATA=$install -m0644 -p" >> $config_mak
1365 echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak
1366 echo "CC=$cc" >> $config_mak
1367 echo "HOST_CC=$host_cc" >> $config_mak
1368 echo "AR=$ar" >> $config_mak
1369 # XXX: only use CFLAGS and LDFLAGS ?
1370 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1371 # compilation of dyngen tool (useful for win32 build on Linux host)
1372 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1373 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1374 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1375 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1376 echo "CFLAGS=$CFLAGS" >> $config_mak
1377 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1378 echo "EXESUF=$EXESUF" >> $config_mak
1379 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1380 case "$cpu" in
1381 i386)
1382 echo "ARCH=i386" >> $config_mak
1383 echo "#define HOST_I386 1" >> $config_h
1385 x86_64)
1386 echo "ARCH=x86_64" >> $config_mak
1387 echo "#define HOST_X86_64 1" >> $config_h
1389 alpha)
1390 echo "ARCH=alpha" >> $config_mak
1391 echo "#define HOST_ALPHA 1" >> $config_h
1393 armv4b)
1394 echo "ARCH=arm" >> $config_mak
1395 echo "#define HOST_ARM 1" >> $config_h
1397 armv4l)
1398 echo "ARCH=arm" >> $config_mak
1399 echo "#define HOST_ARM 1" >> $config_h
1401 cris)
1402 echo "ARCH=cris" >> $config_mak
1403 echo "#define HOST_CRIS 1" >> $config_h
1405 hppa)
1406 echo "ARCH=hppa" >> $config_mak
1407 echo "#define HOST_HPPA 1" >> $config_h
1409 ia64)
1410 echo "ARCH=ia64" >> $config_mak
1411 echo "#define HOST_IA64 1" >> $config_h
1413 m68k)
1414 echo "ARCH=m68k" >> $config_mak
1415 echo "#define HOST_M68K 1" >> $config_h
1417 mips)
1418 echo "ARCH=mips" >> $config_mak
1419 echo "#define HOST_MIPS 1" >> $config_h
1421 mips64)
1422 echo "ARCH=mips64" >> $config_mak
1423 echo "#define HOST_MIPS64 1" >> $config_h
1425 ppc)
1426 echo "ARCH=ppc" >> $config_mak
1427 echo "#define HOST_PPC 1" >> $config_h
1429 ppc64)
1430 echo "ARCH=ppc64" >> $config_mak
1431 echo "#define HOST_PPC64 1" >> $config_h
1433 s390)
1434 echo "ARCH=s390" >> $config_mak
1435 echo "#define HOST_S390 1" >> $config_h
1437 sparc)
1438 echo "ARCH=sparc" >> $config_mak
1439 echo "#define HOST_SPARC 1" >> $config_h
1441 sparc64)
1442 echo "ARCH=sparc64" >> $config_mak
1443 echo "#define HOST_SPARC64 1" >> $config_h
1446 echo "Unsupported CPU = $cpu"
1447 exit 1
1449 esac
1450 if test "$debug_tcg" = "yes" ; then
1451 echo "#define DEBUG_TCG 1" >> $config_h
1453 if test "$sparse" = "yes" ; then
1454 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1455 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1456 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1458 if test "$strip_opt" = "yes" ; then
1459 echo "STRIP_OPT=-s" >> $config_mak
1461 if test "$bigendian" = "yes" ; then
1462 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1463 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1465 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1466 if test "$mingw32" = "yes" ; then
1467 echo "CONFIG_WIN32=yes" >> $config_mak
1468 echo "#define CONFIG_WIN32 1" >> $config_h
1469 else
1470 cat > $TMPC << EOF
1471 #include <byteswap.h>
1472 int main(void) { return bswap_32(0); }
1474 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1475 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1477 cat > $TMPC << EOF
1478 #include <sys/endian.h>
1479 #include <sys/types.h>
1480 #include <machine/bswap.h>
1481 int main(void) { return bswap32(0); }
1483 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1484 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1488 if [ "$openbsd" = "yes" ] ; then
1489 echo "#define ENOTSUP 4096" >> $config_h
1492 if test "$darwin" = "yes" ; then
1493 echo "CONFIG_DARWIN=yes" >> $config_mak
1494 echo "#define CONFIG_DARWIN 1" >> $config_h
1497 if test "$aix" = "yes" ; then
1498 echo "CONFIG_AIX=yes" >> $config_mak
1499 echo "#define CONFIG_AIX 1" >> $config_h
1502 if test "$solaris" = "yes" ; then
1503 echo "CONFIG_SOLARIS=yes" >> $config_mak
1504 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1505 if test "$needs_libsunmath" = "yes" ; then
1506 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1507 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1510 if test -n "$sparc_cpu"; then
1511 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1512 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1514 if test "$gdbstub" = "yes" ; then
1515 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1516 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1518 if test "$gprof" = "yes" ; then
1519 echo "TARGET_GPROF=yes" >> $config_mak
1520 echo "#define HAVE_GPROF 1" >> $config_h
1522 if test "$static" = "yes" ; then
1523 echo "CONFIG_STATIC=yes" >> $config_mak
1524 echo "#define CONFIG_STATIC 1" >> $config_h
1526 if test $profiler = "yes" ; then
1527 echo "#define CONFIG_PROFILER 1" >> $config_h
1529 if test "$slirp" = "yes" ; then
1530 echo "CONFIG_SLIRP=yes" >> $config_mak
1531 echo "#define CONFIG_SLIRP 1" >> $config_h
1533 if test "$vde" = "yes" ; then
1534 echo "CONFIG_VDE=yes" >> $config_mak
1535 echo "#define CONFIG_VDE 1" >> $config_h
1536 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1538 for card in $audio_card_list; do
1539 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1540 echo "$def=yes" >> $config_mak
1541 echo "#define $def 1" >> $config_h
1542 done
1543 echo "#define AUDIO_DRIVERS \\" >> $config_h
1544 for drv in $audio_drv_list; do
1545 echo " &${drv}_audio_driver, \\" >>$config_h
1546 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1547 echo "$def=yes" >> $config_mak
1548 if test "$drv" = "fmod"; then
1549 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1550 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1551 elif test "$drv" = "oss"; then
1552 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1554 done
1555 echo "" >>$config_h
1556 if test "$mixemu" = "yes" ; then
1557 echo "CONFIG_MIXEMU=yes" >> $config_mak
1558 echo "#define CONFIG_MIXEMU 1" >> $config_h
1560 if test "$vnc_tls" = "yes" ; then
1561 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1562 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1563 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1564 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1566 if test "$vnc_sasl" = "yes" ; then
1567 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1568 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1569 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1570 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1572 if test "$fnmatch" = "yes" ; then
1573 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1575 qemu_version=`head $source_path/VERSION`
1576 echo "VERSION=$qemu_version" >>$config_mak
1577 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1579 echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h
1581 echo "SRC_PATH=$source_path" >> $config_mak
1582 if [ "$source_path_used" = "yes" ]; then
1583 echo "VPATH=$source_path" >> $config_mak
1585 echo "TARGET_DIRS=$target_list" >> $config_mak
1586 if [ "$build_docs" = "yes" ] ; then
1587 echo "BUILD_DOCS=yes" >> $config_mak
1589 if test "$static" = "yes"; then
1590 sdl1=$sdl_static
1591 else
1592 sdl1=$sdl
1594 if test "$sdl1" = "yes" ; then
1595 echo "#define CONFIG_SDL 1" >> $config_h
1596 echo "CONFIG_SDL=yes" >> $config_mak
1597 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1598 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1599 elif test "$sdl_x11" = "yes" ; then
1600 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1601 else
1602 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1604 if [ "${aa}" = "yes" ] ; then
1605 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1606 else
1607 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1610 if test "$cocoa" = "yes" ; then
1611 echo "#define CONFIG_COCOA 1" >> $config_h
1612 echo "CONFIG_COCOA=yes" >> $config_mak
1614 if test "$curses" = "yes" ; then
1615 echo "#define CONFIG_CURSES 1" >> $config_h
1616 echo "CONFIG_CURSES=yes" >> $config_mak
1617 echo "CURSES_LIBS=-lcurses" >> $config_mak
1619 if test "$atfile" = "yes" ; then
1620 echo "#define CONFIG_ATFILE 1" >> $config_h
1622 if test "$inotify" = "yes" ; then
1623 echo "#define CONFIG_INOTIFY 1" >> $config_h
1625 if test "$brlapi" = "yes" ; then
1626 echo "CONFIG_BRLAPI=yes" >> $config_mak
1627 echo "#define CONFIG_BRLAPI 1" >> $config_h
1628 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1630 if test "$bluez" = "yes" ; then
1631 echo "CONFIG_BLUEZ=yes" >> $config_mak
1632 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1633 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1634 echo "#define CONFIG_BLUEZ 1" >> $config_h
1636 if test "$xen" = "yes" ; then
1637 echo "XEN_LIBS=-lxenstore -lxenctrl" >> $config_mak
1639 if test "$aio" = "yes" ; then
1640 echo "#define CONFIG_AIO 1" >> $config_h
1641 echo "CONFIG_AIO=yes" >> $config_mak
1643 if test "$blobs" = "yes" ; then
1644 echo "INSTALL_BLOBS=yes" >> $config_mak
1646 if test "$iovec" = "yes" ; then
1647 echo "#define HAVE_IOVEC 1" >> $config_h
1649 if test "$preadv" = "yes" ; then
1650 echo "#define HAVE_PREADV 1" >> $config_h
1652 if test "$fdt" = "yes" ; then
1653 echo "#define HAVE_FDT 1" >> $config_h
1654 echo "FDT_LIBS=-lfdt" >> $config_mak
1657 # XXX: suppress that
1658 if [ "$bsd" = "yes" ] ; then
1659 echo "#define O_LARGEFILE 0" >> $config_h
1660 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1661 echo "#define HOST_BSD 1" >> $config_h
1664 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1666 # USB host support
1667 case "$usb" in
1668 linux)
1669 echo "HOST_USB=linux" >> $config_mak
1671 bsd)
1672 echo "HOST_USB=bsd" >> $config_mak
1675 echo "HOST_USB=stub" >> $config_mak
1677 esac
1679 tools=
1680 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1681 tools="qemu-img\$(EXESUF) $tools"
1682 if [ "$linux" = "yes" ] ; then
1683 tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
1686 echo "TOOLS=$tools" >> $config_mak
1688 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1690 for target in $target_list; do
1691 target_dir="$target"
1692 config_mak=$target_dir/config.mak
1693 config_h=$target_dir/config.h
1694 target_cpu=`echo $target | cut -d '-' -f 1`
1695 target_bigendian="no"
1696 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1697 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1698 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1699 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1700 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1701 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1702 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1703 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1704 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1705 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1706 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1707 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1708 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1709 target_softmmu="no"
1710 target_user_only="no"
1711 target_linux_user="no"
1712 target_darwin_user="no"
1713 target_bsd_user="no"
1714 case "$target" in
1715 ${target_cpu}-softmmu)
1716 target_softmmu="yes"
1718 ${target_cpu}-linux-user)
1719 target_user_only="yes"
1720 target_linux_user="yes"
1722 ${target_cpu}-darwin-user)
1723 target_user_only="yes"
1724 target_darwin_user="yes"
1726 ${target_cpu}-bsd-user)
1727 target_user_only="yes"
1728 target_bsd_user="yes"
1731 echo "ERROR: Target '$target' not recognised"
1732 exit 1
1734 esac
1736 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1737 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1738 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1739 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1740 echo "Note that this will disable all output from the virtual graphics card"
1741 echo "except through VNC or curses."
1742 exit 1;
1745 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1747 test -f $config_h && mv $config_h ${config_h}~
1749 mkdir -p $target_dir
1750 mkdir -p $target_dir/fpu
1751 mkdir -p $target_dir/tcg
1752 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1753 mkdir -p $target_dir/nwfpe
1757 # don't use ln -sf as not all "ln -sf" over write the file/link
1759 rm -f $target_dir/Makefile
1760 ln -s $source_path/Makefile.target $target_dir/Makefile
1763 echo "# Automatically generated by configure - do not modify" > $config_mak
1764 echo "/* Automatically generated by configure - do not modify */" > $config_h
1767 echo "include ../config-host.mak" >> $config_mak
1768 echo "#include \"../config-host.h\"" >> $config_h
1770 bflt="no"
1771 elfload32="no"
1772 target_nptl="no"
1773 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1774 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1775 gdb_xml_files=""
1777 # Make sure the target and host cpus are compatible
1778 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1779 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1780 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1781 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1782 kvm="no"
1784 # Disable KVM for linux-user
1785 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1786 kvm="no"
1789 case "$target_cpu" in
1790 i386)
1791 echo "TARGET_ARCH=i386" >> $config_mak
1792 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1793 echo "#define TARGET_I386 1" >> $config_h
1794 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1795 then
1796 echo "CONFIG_KQEMU=yes" >> $config_mak
1797 echo "#define CONFIG_KQEMU 1" >> $config_h
1799 if test "$kvm" = "yes" ; then
1800 echo "CONFIG_KVM=yes" >> $config_mak
1801 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1802 echo "#define CONFIG_KVM 1" >> $config_h
1804 if test "$xen" = "yes" -a "$target_softmmu" = "yes";
1805 then
1806 echo "CONFIG_XEN=yes" >> $config_mak
1807 echo "#define CONFIG_XEN 1" >> $config_h
1810 x86_64)
1811 echo "TARGET_ARCH=x86_64" >> $config_mak
1812 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1813 echo "#define TARGET_I386 1" >> $config_h
1814 echo "#define TARGET_X86_64 1" >> $config_h
1815 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1816 then
1817 echo "CONFIG_KQEMU=yes" >> $config_mak
1818 echo "#define CONFIG_KQEMU 1" >> $config_h
1820 if test "$kvm" = "yes" ; then
1821 echo "CONFIG_KVM=yes" >> $config_mak
1822 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1823 echo "#define CONFIG_KVM 1" >> $config_h
1825 if test "$xen" = "yes" -a "$target_softmmu" = "yes"
1826 then
1827 echo "CONFIG_XEN=yes" >> $config_mak
1828 echo "#define CONFIG_XEN 1" >> $config_h
1831 alpha)
1832 echo "TARGET_ARCH=alpha" >> $config_mak
1833 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1834 echo "#define TARGET_ALPHA 1" >> $config_h
1836 arm|armeb)
1837 echo "TARGET_ARCH=arm" >> $config_mak
1838 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1839 echo "#define TARGET_ARM 1" >> $config_h
1840 bflt="yes"
1841 target_nptl="yes"
1842 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1844 cris)
1845 echo "TARGET_ARCH=cris" >> $config_mak
1846 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1847 echo "#define TARGET_CRIS 1" >> $config_h
1848 target_nptl="yes"
1850 m68k)
1851 echo "TARGET_ARCH=m68k" >> $config_mak
1852 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1853 echo "#define TARGET_M68K 1" >> $config_h
1854 bflt="yes"
1855 gdb_xml_files="cf-core.xml cf-fp.xml"
1857 mips|mipsel)
1858 echo "TARGET_ARCH=mips" >> $config_mak
1859 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1860 echo "#define TARGET_MIPS 1" >> $config_h
1861 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1863 mipsn32|mipsn32el)
1864 echo "TARGET_ARCH=mipsn32" >> $config_mak
1865 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1866 echo "#define TARGET_MIPS 1" >> $config_h
1867 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1869 mips64|mips64el)
1870 echo "TARGET_ARCH=mips64" >> $config_mak
1871 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1872 echo "#define TARGET_MIPS 1" >> $config_h
1873 echo "#define TARGET_MIPS64 1" >> $config_h
1874 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1876 ppc)
1877 echo "TARGET_ARCH=ppc" >> $config_mak
1878 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1879 echo "#define TARGET_PPC 1" >> $config_h
1880 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1882 ppcemb)
1883 echo "TARGET_ARCH=ppcemb" >> $config_mak
1884 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1885 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1886 echo "#define TARGET_PPC 1" >> $config_h
1887 echo "#define TARGET_PPCEMB 1" >> $config_h
1888 if test "$kvm" = "yes" ; then
1889 echo "CONFIG_KVM=yes" >> $config_mak
1890 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1891 echo "#define CONFIG_KVM 1" >> $config_h
1893 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1895 ppc64)
1896 echo "TARGET_ARCH=ppc64" >> $config_mak
1897 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1898 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1899 echo "#define TARGET_PPC 1" >> $config_h
1900 echo "#define TARGET_PPC64 1" >> $config_h
1901 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1903 ppc64abi32)
1904 echo "TARGET_ARCH=ppc64" >> $config_mak
1905 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1906 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1907 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1908 echo "#define TARGET_PPC 1" >> $config_h
1909 echo "#define TARGET_PPC64 1" >> $config_h
1910 echo "#define TARGET_ABI32 1" >> $config_h
1911 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1913 sh4|sh4eb)
1914 echo "TARGET_ARCH=sh4" >> $config_mak
1915 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1916 echo "#define TARGET_SH4 1" >> $config_h
1917 bflt="yes"
1918 target_nptl="yes"
1920 sparc)
1921 echo "TARGET_ARCH=sparc" >> $config_mak
1922 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1923 echo "#define TARGET_SPARC 1" >> $config_h
1925 sparc64)
1926 echo "TARGET_ARCH=sparc64" >> $config_mak
1927 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1928 echo "#define TARGET_SPARC 1" >> $config_h
1929 echo "#define TARGET_SPARC64 1" >> $config_h
1930 elfload32="yes"
1932 sparc32plus)
1933 echo "TARGET_ARCH=sparc64" >> $config_mak
1934 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1935 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1936 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1937 echo "#define TARGET_SPARC 1" >> $config_h
1938 echo "#define TARGET_SPARC64 1" >> $config_h
1939 echo "#define TARGET_ABI32 1" >> $config_h
1942 echo "Unsupported target CPU"
1943 exit 1
1945 esac
1946 if test "$target_bigendian" = "yes" ; then
1947 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1948 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1950 if test "$target_softmmu" = "yes" ; then
1951 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1952 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1954 if test "$target_user_only" = "yes" ; then
1955 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1956 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1958 if test "$target_linux_user" = "yes" ; then
1959 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1960 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1962 if test "$target_darwin_user" = "yes" ; then
1963 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1964 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1966 list=""
1967 if test ! -z "$gdb_xml_files" ; then
1968 for x in $gdb_xml_files; do
1969 list="$list $source_path/gdb-xml/$x"
1970 done
1972 echo "TARGET_XML_FILES=$list" >> $config_mak
1974 if test "$target_cpu" = "arm" \
1975 -o "$target_cpu" = "armeb" \
1976 -o "$target_cpu" = "m68k" \
1977 -o "$target_cpu" = "mips" \
1978 -o "$target_cpu" = "mipsel" \
1979 -o "$target_cpu" = "mipsn32" \
1980 -o "$target_cpu" = "mipsn32el" \
1981 -o "$target_cpu" = "mips64" \
1982 -o "$target_cpu" = "mips64el" \
1983 -o "$target_cpu" = "ppc" \
1984 -o "$target_cpu" = "ppc64" \
1985 -o "$target_cpu" = "ppc64abi32" \
1986 -o "$target_cpu" = "ppcemb" \
1987 -o "$target_cpu" = "sparc" \
1988 -o "$target_cpu" = "sparc64" \
1989 -o "$target_cpu" = "sparc32plus"; then
1990 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1991 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1993 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1994 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1995 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1997 if test "$target_user_only" = "yes" \
1998 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1999 echo "#define USE_NPTL 1" >> $config_h
2001 # 32 bit ELF loader in addition to native 64 bit loader?
2002 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
2003 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
2004 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2006 if test "$target_bsd_user" = "yes" ; then
2007 echo "CONFIG_BSD_USER=yes" >> $config_mak
2008 echo "#define CONFIG_BSD_USER 1" >> $config_h
2011 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2013 done # for target in $targets
2015 # build tree in object directory if source path is different from current one
2016 if test "$source_path_used" = "yes" ; then
2017 DIRS="tests tests/cris slirp audio"
2018 FILES="Makefile tests/Makefile"
2019 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2020 FILES="$FILES tests/test-mmap.c"
2021 for dir in $DIRS ; do
2022 mkdir -p $dir
2023 done
2024 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2025 for f in $FILES ; do
2026 rm -f $f
2027 ln -s $source_path/$f $f
2028 done