Support MSI convert to INTx in device assignment
[qemu-kvm/fedora.git] / configure
blob35b7b842dd6352fcc90d98df7dfc47f4df5f6e6a
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 sparse="no"
157 bigendian="no"
158 mingw32="no"
159 EXESUF=""
160 gdbstub="yes"
161 slirp="yes"
162 vde="yes"
163 fmod_lib=""
164 fmod_inc=""
165 oss_lib=""
166 vnc_tls="yes"
167 vnc_sasl="yes"
168 bsd="no"
169 linux="no"
170 solaris="no"
171 kqemu="no"
172 profiler="no"
173 cocoa="no"
174 check_gfx="yes"
175 softmmu="yes"
176 linux_user="no"
177 darwin_user="no"
178 bsd_user="no"
179 build_docs="no"
180 uname_release=""
181 curses="yes"
182 aio="yes"
183 nptl="yes"
184 mixemu="no"
185 bluez="yes"
186 kvm="yes"
187 kvm_cap_pit="no"
188 kvm_cap_device_assignment="no"
189 kerneldir=""
190 aix="no"
191 blobs="yes"
192 fdt="yes"
193 sdl_x11="no"
194 signalfd="no"
195 eventfd="no"
196 cpu_emulation="yes"
198 # OS specific
199 if check_define __linux__ ; then
200 targetos="Linux"
201 elif check_define _WIN32 ; then
202 targetos='MINGW32'
203 else
204 targetos=`uname -s`
206 case $targetos in
207 CYGWIN*)
208 mingw32="yes"
209 OS_CFLAGS="-mno-cygwin"
210 if [ "$cpu" = "i386" ] ; then
211 kqemu="yes"
213 audio_possible_drivers="sdl"
215 MINGW32*)
216 mingw32="yes"
217 if [ "$cpu" = "i386" ] ; then
218 kqemu="yes"
220 audio_possible_drivers="dsound sdl fmod"
222 GNU/kFreeBSD)
223 audio_drv_list="oss"
224 audio_possible_drivers="oss sdl esd pa"
225 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
226 kqemu="yes"
229 FreeBSD)
230 bsd="yes"
231 audio_drv_list="oss"
232 audio_possible_drivers="oss sdl esd pa"
233 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
234 kqemu="yes"
235 kvm="yes"
238 DragonFly)
239 bsd="yes"
240 audio_drv_list="oss"
241 audio_possible_drivers="oss sdl esd pa"
242 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
243 kqemu="yes"
245 aio="no"
247 NetBSD)
248 bsd="yes"
249 audio_drv_list="oss"
250 audio_possible_drivers="oss sdl esd"
251 oss_lib="-lossaudio"
253 OpenBSD)
254 bsd="yes"
255 openbsd="yes"
256 audio_drv_list="oss"
257 audio_possible_drivers="oss sdl esd"
258 oss_lib="-lossaudio"
260 Darwin)
261 bsd="yes"
262 darwin="yes"
263 # 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
264 if [ "$cpu" = "i386" ] ; then
265 is_x86_64=`sysctl -n hw.optional.x86_64`
266 [ "$is_x86_64" = "1" ] && cpu=x86_64
268 if [ "$cpu" = "x86_64" ] ; then
269 OS_CFLAGS="-arch x86_64"
270 LDFLAGS="-arch x86_64"
271 else
272 OS_CFLAGS="-mdynamic-no-pic"
274 darwin_user="yes"
275 cocoa="yes"
276 audio_drv_list="coreaudio"
277 audio_possible_drivers="coreaudio sdl fmod"
278 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
280 SunOS)
281 solaris="yes"
282 make="gmake"
283 install="ginstall"
284 needs_libsunmath="no"
285 solarisrev=`uname -r | cut -f2 -d.`
286 # have to select again, because `uname -m` returns i86pc
287 # even on an x86_64 box.
288 solariscpu=`isainfo -k`
289 if test "${solariscpu}" = "amd64" ; then
290 cpu="x86_64"
292 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
293 if test "$solarisrev" -le 9 ; then
294 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
295 needs_libsunmath="yes"
296 else
297 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
298 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
299 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
300 echo "Studio 11 can be downloaded from www.sun.com."
301 exit 1
304 if test "$solarisrev" -ge 9 ; then
305 kqemu="yes"
308 if test -f /usr/include/sys/soundcard.h ; then
309 audio_drv_list="oss"
311 audio_possible_drivers="oss sdl"
313 AIX)
314 aix="yes"
315 make="gmake"
318 audio_drv_list="oss"
319 audio_possible_drivers="oss alsa sdl esd pa"
320 linux="yes"
321 linux_user="yes"
322 usb="linux"
323 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
324 kqemu="yes"
325 audio_possible_drivers="$audio_possible_drivers fmod"
326 kvm="yes"
328 if [ "$cpu" = "ia64" ] ; then
329 kvm="yes"
330 cpu_emulation="no"
331 gdbstub="no"
332 slirp="no"
334 if [ "$cpu" = "powerpc" ]; then
335 kvm="yes"
338 esac
340 if [ "$bsd" = "yes" ] ; then
341 if [ "$darwin" != "yes" ] ; then
342 make="gmake"
343 usb="bsd"
345 bsd_user="yes"
348 # find source path
349 source_path=`dirname "$0"`
350 source_path_used="no"
351 workdir=`pwd`
352 if [ -z "$source_path" ]; then
353 source_path=$workdir
354 else
355 source_path=`cd "$source_path"; pwd`
357 [ -f "$workdir/vl.c" ] || source_path_used="yes"
359 werror="no"
360 # generate compile errors on warnings for development builds
361 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
362 #werror="yes";
365 for opt do
366 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
367 case "$opt" in
368 --help|-h) show_help=yes
370 --prefix=*) prefix="$optarg"
372 --interp-prefix=*) interp_prefix="$optarg"
374 --source-path=*) source_path="$optarg"
375 source_path_used="yes"
377 --cross-prefix=*)
379 --cc=*)
381 --host-cc=*) host_cc="$optarg"
383 --make=*) make="$optarg"
385 --install=*) install="$optarg"
387 --extra-cflags=*) CFLAGS="$optarg"
389 --extra-ldflags=*) LDFLAGS="$optarg"
391 --cpu=*) cpu="$optarg"
393 --target-list=*) target_list="$optarg"
395 --enable-gprof) gprof="yes"
397 --static) static="yes"
399 --disable-sdl) sdl="no"
401 --fmod-lib=*) fmod_lib="$optarg"
403 --fmod-inc=*) fmod_inc="$optarg"
405 --oss-lib=*) oss_lib="$optarg"
407 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
409 --audio-drv-list=*) audio_drv_list="$optarg"
411 --enable-sparse) sparse="yes"
413 --disable-sparse) sparse="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-brlapi) brlapi="no"
427 --disable-bluez) bluez="no"
429 --disable-kvm) kvm="no"
431 --enable-profiler) profiler="yes"
433 --enable-cocoa)
434 cocoa="yes" ;
435 sdl="no" ;
436 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
438 --disable-gfx-check) check_gfx="no"
440 --disable-system) softmmu="no"
442 --enable-system) softmmu="yes"
444 --disable-linux-user) linux_user="no"
446 --enable-linux-user) linux_user="yes"
448 --disable-darwin-user) darwin_user="no"
450 --enable-darwin-user) darwin_user="yes"
452 --disable-bsd-user) bsd_user="no"
454 --enable-bsd-user) bsd_user="yes"
456 --enable-uname-release=*) uname_release="$optarg"
458 --sparc_cpu=*)
459 sparc_cpu="$optarg"
460 case $sparc_cpu in
461 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
462 target_cpu="sparc"; cpu="sparc" ;;
463 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
464 target_cpu="sparc"; cpu="sparc" ;;
465 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
466 target_cpu="sparc64"; cpu="sparc64" ;;
467 *) echo "undefined SPARC architecture. Exiting";exit 1;;
468 esac
470 --enable-werror) werror="yes"
472 --disable-werror) werror="no"
474 --disable-curses) curses="no"
476 --disable-nptl) nptl="no"
478 --enable-mixemu) mixemu="yes"
480 --disable-aio) aio="no"
482 --disable-blobs) blobs="no"
484 --kerneldir=*) kerneldir="$optarg"
486 --disable-cpu-emulation) cpu_emulation="no"
488 *) echo "ERROR: unknown option $opt"; exit 1
490 esac
491 done
493 # default flags for all hosts
494 CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
495 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
496 LDFLAGS="$LDFLAGS -g"
497 if test "$werror" = "yes" ; then
498 CFLAGS="$CFLAGS -Werror"
501 if test "$solaris" = "no" ; then
502 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
503 LDFLAGS="$LDFLAGS -Wl,--warn-common"
508 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
509 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
511 case "$cpu" in
512 sparc) if test -z "$sparc_cpu" ; then
513 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
514 ARCH_LDFLAGS="-m32"
515 else
516 ARCH_CFLAGS="${SP_CFLAGS}"
517 ARCH_LDFLAGS="${SP_LDFLAGS}"
520 sparc64) if test -z "$sparc_cpu" ; then
521 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
522 ARCH_LDFLAGS="-m64"
523 else
524 ARCH_CFLAGS="${SP_CFLAGS}"
525 ARCH_LDFLAGS="${SP_LDFLAGS}"
528 s390)
529 ARCH_CFLAGS="-march=z900"
531 i386)
532 ARCH_CFLAGS="-m32"
533 ARCH_LDFLAGS="-m32"
535 x86_64)
536 ARCH_CFLAGS="-m64"
537 ARCH_LDFLAGS="-m64"
539 esac
541 if test x"$show_help" = x"yes" ; then
542 cat << EOF
544 Usage: configure [options]
545 Options: [defaults in brackets after descriptions]
548 echo "Standard options:"
549 echo " --help print this message"
550 echo " --prefix=PREFIX install in PREFIX [$prefix]"
551 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
552 echo " use %M for cpu name [$interp_prefix]"
553 echo " --target-list=LIST set target list [$target_list]"
554 echo ""
555 echo "kqemu kernel acceleration support:"
556 echo " --disable-kqemu disable kqemu support"
557 echo ""
558 echo "Advanced options (experts only):"
559 echo " --source-path=PATH path of source code [$source_path]"
560 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
561 echo " --cc=CC use C compiler CC [$cc]"
562 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
563 echo " --make=MAKE use specified make [$make]"
564 echo " --install=INSTALL use specified install [$install]"
565 echo " --static enable static build [$static]"
566 echo " --enable-sparse enable sparse checker"
567 echo " --disable-sparse disable sparse checker (default)"
568 echo " --disable-werror disable compilation abort on warning"
569 echo " --disable-sdl disable SDL"
570 echo " --enable-cocoa enable COCOA (Mac OS X only)"
571 echo " --audio-drv-list=LIST set audio drivers list:"
572 echo " Available drivers: $audio_possible_drivers"
573 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
574 echo " Available cards: $audio_possible_cards"
575 echo " --enable-mixemu enable mixer emulation"
576 echo " --disable-brlapi disable BrlAPI"
577 echo " --disable-vnc-tls disable TLS encryption for VNC server"
578 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
579 echo " --disable-curses disable curses output"
580 echo " --disable-bluez disable bluez stack connectivity"
581 echo " --disable-kvm disable KVM acceleration support"
582 echo " --disable-nptl disable usermode NPTL support"
583 echo " --enable-system enable all system emulation targets"
584 echo " --disable-system disable all system emulation targets"
585 echo " --enable-linux-user enable all linux usermode emulation targets"
586 echo " --disable-linux-user disable all linux usermode emulation targets"
587 echo " --enable-darwin-user enable all darwin usermode emulation targets"
588 echo " --disable-darwin-user disable all darwin usermode emulation targets"
589 echo " --enable-bsd-user enable all BSD usermode emulation targets"
590 echo " --disable-bsd-user disable all BSD usermode emulation targets"
591 echo " --fmod-lib path to FMOD library"
592 echo " --fmod-inc path to FMOD includes"
593 echo " --oss-lib path to OSS library"
594 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
595 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
596 echo " --disable-vde disable support for vde network"
597 echo " --disable-aio disable AIO support"
598 echo " --disable-blobs disable installing provided firmware blobs"
599 echo " --kerneldir=PATH look for kernel includes in PATH"
600 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
601 echo ""
602 echo "NOTE: The object files are built at the place where configure is launched"
603 exit 1
606 if test "$mingw32" = "yes" ; then
607 linux="no"
608 EXESUF=".exe"
609 oss="no"
610 linux_user="no"
611 bsd_user="no"
612 OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
615 if test ! -x "$(which cgcc 2>/dev/null)"; then
616 sparse="no"
620 # Solaris specific configure tool chain decisions
622 if test "$solaris" = "yes" ; then
623 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
624 if test -z "$solinst" ; then
625 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
626 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
627 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
628 exit 1
630 if test "$solinst" = "/usr/sbin/install" ; then
631 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
632 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
633 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
634 exit 1
636 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
637 if test -z "$sol_ar" ; then
638 echo "Error: No path includes ar"
639 if test -f /usr/ccs/bin/ar ; then
640 echo "Add /usr/ccs/bin to your path and rerun configure"
642 exit 1
647 if test -z "$target_list" ; then
648 # these targets are portable
649 if [ "$softmmu" = "yes" ] ; then
650 target_list="\
651 i386-softmmu \
652 x86_64-softmmu \
653 arm-softmmu \
654 cris-softmmu \
655 m68k-softmmu \
656 mips-softmmu \
657 mipsel-softmmu \
658 mips64-softmmu \
659 mips64el-softmmu \
660 ppc-softmmu \
661 ppcemb-softmmu \
662 ppc64-softmmu \
663 sh4-softmmu \
664 sh4eb-softmmu \
665 sparc-softmmu \
668 # the following are Linux specific
669 if [ "$linux_user" = "yes" ] ; then
670 target_list="${target_list}\
671 i386-linux-user \
672 x86_64-linux-user \
673 alpha-linux-user \
674 arm-linux-user \
675 armeb-linux-user \
676 cris-linux-user \
677 m68k-linux-user \
678 mips-linux-user \
679 mipsel-linux-user \
680 ppc-linux-user \
681 ppc64-linux-user \
682 ppc64abi32-linux-user \
683 sh4-linux-user \
684 sh4eb-linux-user \
685 sparc-linux-user \
686 sparc64-linux-user \
687 sparc32plus-linux-user \
690 # the following are Darwin specific
691 if [ "$darwin_user" = "yes" ] ; then
692 target_list="$target_list i386-darwin-user ppc-darwin-user "
694 # the following are BSD specific
695 if [ "$bsd_user" = "yes" ] ; then
696 target_list="${target_list}\
697 sparc64-bsd-user \
700 else
701 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
703 if test -z "$target_list" ; then
704 echo "No targets enabled"
705 exit 1
708 if test -z "$cross_prefix" ; then
710 # ---
711 # big/little endian test
712 cat > $TMPC << EOF
713 #include <inttypes.h>
714 int main(int argc, char ** argv){
715 volatile uint32_t i=0x01234567;
716 return (*((uint8_t*)(&i))) == 0x67;
720 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
721 $TMPE && bigendian="yes"
722 else
723 echo big/little test failed
726 else
728 # if cross compiling, cannot launch a program, so make a static guess
729 if test "$cpu" = "armv4b" \
730 -o "$cpu" = "hppa" \
731 -o "$cpu" = "m68k" \
732 -o "$cpu" = "mips" \
733 -o "$cpu" = "mips64" \
734 -o "$cpu" = "ppc" \
735 -o "$cpu" = "ppc64" \
736 -o "$cpu" = "s390" \
737 -o "$cpu" = "sparc" \
738 -o "$cpu" = "sparc64"; then
739 bigendian="yes"
744 # host long bits test
745 hostlongbits="32"
746 if test "$cpu" = "x86_64" \
747 -o "$cpu" = "alpha" \
748 -o "$cpu" = "ia64" \
749 -o "$cpu" = "sparc64" \
750 -o "$cpu" = "ppc64"; then
751 hostlongbits="64"
754 # check gcc options support
755 cat > $TMPC <<EOF
756 int main(void) {
760 # Check host NPTL support
761 cat > $TMPC <<EOF
762 #include <sched.h>
763 #include <linux/futex.h>
764 void foo()
766 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
767 #error bork
768 #endif
772 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
774 else
775 nptl="no"
778 ##########################################
779 # KVM probe
781 if test "$kvm" = "yes" ; then
783 # test for KVM_CAP_PIT
785 cat > $TMPC <<EOF
786 #include <libkvm.h>
787 #ifndef KVM_CAP_PIT
788 #error "kvm no pit capability"
789 #endif
790 int main(void) { return 0; }
792 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
793 kvm_cap_pit="yes"
796 # test for KVM_CAP_DEVICE_ASSIGNMENT
798 cat > $TMPC <<EOF
799 #include <libkvm.h>
800 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
801 #error "kvm no device assignment capability"
802 #endif
803 int main(void) { return 0; }
805 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
806 kvm_cap_device_assignment="yes"
810 # libpci probe for kvm_cap_device_assignment
811 if test $kvm_cap_device_assignment = "yes" ; then
812 cat > $TMPC << EOF
813 #include <pci/pci.h>
814 #ifndef PCI_VENDOR_ID
815 #error NO LIBPCI
816 #endif
817 int main(void) { return 0; }
819 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2>/dev/null ; then
821 else
822 echo
823 echo "Error: libpci check failed"
824 echo "Disable KVM Device Assignment capability."
825 echo
826 kvm_cap_device_assignment="no"
830 ##########################################
831 # zlib check
833 cat > $TMPC << EOF
834 #include <zlib.h>
835 int main(void) { zlibVersion(); return 0; }
837 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
839 else
840 echo
841 echo "Error: zlib check failed"
842 echo "Make sure to have the zlib libs and headers installed."
843 echo
844 exit 1
847 ##########################################
848 # SDL probe
850 sdl_too_old=no
852 if test -z "$sdl" ; then
853 sdl_config="sdl-config"
854 sdl=no
855 sdl_static=no
857 cat > $TMPC << EOF
858 #include <SDL.h>
859 #undef main /* We don't want SDL to override our main() */
860 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
862 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
863 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
864 if test "$_sdlversion" -lt 121 ; then
865 sdl_too_old=yes
866 else
867 if test "$cocoa" = "no" ; then
868 sdl=yes
872 # static link with sdl ?
873 if test "$sdl" = "yes" ; then
874 aa="no"
875 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
876 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
877 if [ "$aa" = "yes" ] ; then
878 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
881 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
882 sdl_static=yes
884 fi # static link
885 fi # sdl compile test
886 else
887 # Make sure to disable cocoa if sdl was set
888 if test "$sdl" = "yes" ; then
889 cocoa="no"
890 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
892 fi # -z $sdl
894 if test "$sdl" = "yes" ; then
895 cat > $TMPC <<EOF
896 #include <SDL.h>
897 #if defined(SDL_VIDEO_DRIVER_X11)
898 #include <X11/XKBlib.h>
899 #else
900 #error No x11 support
901 #endif
902 int main(void) { return 0; }
904 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
905 sdl_x11="yes"
909 ##########################################
910 # VNC TLS detection
911 if test "$vnc_tls" = "yes" ; then
912 cat > $TMPC <<EOF
913 #include <gnutls/gnutls.h>
914 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
916 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
917 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
918 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
919 $vnc_tls_libs > /dev/null 2> /dev/null ; then
921 else
922 vnc_tls="no"
926 ##########################################
927 # VNC SASL detection
928 if test "$vnc_sasl" = "yes" ; then
929 cat > $TMPC <<EOF
930 #include <sasl/sasl.h>
931 #include <stdio.h>
932 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
934 # Assuming Cyrus-SASL installed in /usr prefix
935 vnc_sasl_cflags=""
936 vnc_sasl_libs="-lsasl2"
937 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
938 $vnc_sasl_libs 2> /dev/null ; then
940 else
941 vnc_sasl="no"
945 ##########################################
946 # fnmatch() probe, used for ACL routines
947 fnmatch="no"
948 cat > $TMPC << EOF
949 #include <fnmatch.h>
950 int main(void)
952 fnmatch("foo", "foo", 0);
953 return 0;
956 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
957 fnmatch="yes"
960 ##########################################
961 # vde libraries probe
962 if test "$vde" = "yes" ; then
963 cat > $TMPC << EOF
964 #include <libvdeplug.h>
965 int main(void)
967 struct vde_open_args a = {0, 0, 0};
968 vde_open("", "", &a);
969 return 0;
972 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
974 else
975 vde="no"
979 ##########################################
980 # Sound support libraries probe
982 audio_drv_probe()
984 drv=$1
985 hdr=$2
986 lib=$3
987 exp=$4
988 cfl=$5
989 cat > $TMPC << EOF
990 #include <$hdr>
991 int main(void) { $exp }
993 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
995 else
996 echo
997 echo "Error: $drv check failed"
998 echo "Make sure to have the $drv libs and headers installed."
999 echo
1000 exit 1
1004 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1005 for drv in $audio_drv_list; do
1006 case $drv in
1007 alsa)
1008 audio_drv_probe $drv alsa/asoundlib.h -lasound \
1009 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1012 fmod)
1013 if test -z $fmod_lib || test -z $fmod_inc; then
1014 echo
1015 echo "Error: You must specify path to FMOD library and headers"
1016 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1017 echo
1018 exit 1
1020 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1023 esd)
1024 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1028 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1029 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1032 oss|sdl|core|wav|dsound)
1033 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1037 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1038 echo
1039 echo "Error: Unknown driver '$drv' selected"
1040 echo "Possible drivers are: $audio_possible_drivers"
1041 echo
1042 exit 1
1045 esac
1046 done
1048 ##########################################
1049 # BrlAPI probe
1051 if test -z "$brlapi" ; then
1052 brlapi=no
1053 cat > $TMPC << EOF
1054 #include <brlapi.h>
1055 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1057 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1058 brlapi=yes
1059 fi # brlapi compile test
1060 fi # -z $brlapi
1062 ##########################################
1063 # curses probe
1065 if test "$curses" = "yes" ; then
1066 curses=no
1067 cat > $TMPC << EOF
1068 #include <curses.h>
1069 int main(void) { return curses_version(); }
1071 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1072 curses=yes
1074 fi # test "$curses"
1076 ##########################################
1077 # bluez support probe
1078 if test "$bluez" = "yes" ; then
1079 `pkg-config bluez` || bluez="no"
1081 if test "$bluez" = "yes" ; then
1082 cat > $TMPC << EOF
1083 #include <bluetooth/bluetooth.h>
1084 int main(void) { return bt_error(0); }
1086 bluez_cflags=`pkg-config --cflags bluez`
1087 bluez_libs=`pkg-config --libs bluez`
1088 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1089 $bluez_libs > /dev/null 2> /dev/null ; then
1091 else
1092 bluez="no"
1096 ##########################################
1097 # kvm probe
1098 if test "$kvm" = "yes" ; then
1099 cat > $TMPC <<EOF
1100 #include <linux/kvm.h>
1101 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1102 #error Invalid KVM version
1103 #endif
1104 #if !defined(KVM_CAP_USER_MEMORY)
1105 #error Missing KVM capability KVM_CAP_USER_MEMORY
1106 #endif
1107 #if !defined(KVM_CAP_SET_TSS_ADDR)
1108 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1109 #endif
1110 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1111 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1112 #endif
1113 int main(void) { return 0; }
1115 if test "$kerneldir" != "" ; then
1116 kvm_cflags=-I"$kerneldir"/include
1117 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1118 -a -d "$kerneldir/arch/x86/include" ; then
1119 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1120 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1121 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1122 elif test -d "$kerneldir/arch/$cpu/include" ; then
1123 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1125 else
1126 kvm_cflags=""
1128 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1129 > /dev/null 2>/dev/null ; then
1131 else
1132 kvm="no";
1133 if [ -x "`which awk 2>/dev/null`" ] && \
1134 [ -x "`which grep 2>/dev/null`" ]; then
1135 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1136 | grep "error: " \
1137 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1138 if test "$kvmerr" != "" ; then
1139 kvm="no - (${kvmerr})"
1145 ##########################################
1146 # AIO probe
1147 AIOLIBS=""
1149 if test "$aio" = "yes" ; then
1150 aio=no
1151 cat > $TMPC << EOF
1152 #include <pthread.h>
1153 int main(void) { pthread_mutex_t lock; return 0; }
1155 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1156 aio=yes
1157 AIOLIBS="-lpthread"
1161 ##########################################
1162 # iovec probe
1163 cat > $TMPC <<EOF
1164 #include <sys/types.h>
1165 #include <sys/uio.h>
1166 #include <unistd.h>
1167 int main(void) { struct iovec iov; return 0; }
1169 iovec=no
1170 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1171 iovec=yes
1174 ##########################################
1175 # fdt probe
1176 if test "$fdt" = "yes" ; then
1177 fdt=no
1178 cat > $TMPC << EOF
1179 int main(void) { return 0; }
1181 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1182 fdt=yes
1186 ##########################################
1187 # signalfd probe
1188 cat > $TMPC << EOF
1189 #define _GNU_SOURCE
1190 #include <unistd.h>
1191 #include <sys/syscall.h>
1192 #include <signal.h>
1193 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1196 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1197 signalfd=yes
1200 ##########################################
1201 # eventfd probe
1202 cat > $TMPC << EOF
1203 #define _GNU_SOURCE
1204 #include <unistd.h>
1205 #include <sys/syscall.h>
1206 int main(void) { return syscall(SYS_eventfd, 0); }
1209 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1210 eventfd=yes
1213 # Check if tools are available to build documentation.
1214 if [ -x "`which texi2html 2>/dev/null`" ] && \
1215 [ -x "`which pod2man 2>/dev/null`" ]; then
1216 build_docs="yes"
1219 ##########################################
1220 # Do we need librt
1221 cat > $TMPC <<EOF
1222 #include <signal.h>
1223 #include <time.h>
1224 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1227 rt=no
1228 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1230 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1231 rt=yes
1234 if test "$rt" = "yes" ; then
1235 # Hack, we should have a general purpose LIBS for this sort of thing
1236 AIOLIBS="$AIOLIBS -lrt"
1239 if test "$mingw32" = "yes" ; then
1240 if test -z "$prefix" ; then
1241 prefix="c:\\\\Program Files\\\\Qemu"
1243 mansuffix=""
1244 datasuffix=""
1245 docsuffix=""
1246 binsuffix=""
1247 else
1248 if test -z "$prefix" ; then
1249 prefix="/usr/local"
1251 mansuffix="/share/man"
1252 datasuffix="/share/qemu"
1253 docsuffix="/share/doc/qemu"
1254 binsuffix="/bin"
1257 echo "Install prefix $prefix"
1258 echo "BIOS directory $prefix$datasuffix"
1259 echo "binary directory $prefix$binsuffix"
1260 if test "$mingw32" = "no" ; then
1261 echo "Manual directory $prefix$mansuffix"
1262 echo "ELF interp prefix $interp_prefix"
1264 echo "Source path $source_path"
1265 echo "C compiler $cc"
1266 echo "Host C compiler $host_cc"
1267 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1268 echo "make $make"
1269 echo "install $install"
1270 echo "host CPU $cpu"
1271 echo "host big endian $bigendian"
1272 echo "target list $target_list"
1273 echo "gprof enabled $gprof"
1274 echo "sparse enabled $sparse"
1275 echo "profiler $profiler"
1276 echo "static build $static"
1277 echo "-Werror enabled $werror"
1278 if test "$darwin" = "yes" ; then
1279 echo "Cocoa support $cocoa"
1281 echo "SDL support $sdl"
1282 if test "$sdl" != "no" ; then
1283 echo "SDL static link $sdl_static"
1285 echo "curses support $curses"
1286 echo "mingw32 support $mingw32"
1287 echo "Audio drivers $audio_drv_list"
1288 echo "Extra audio cards $audio_card_list"
1289 echo "Mixer emulation $mixemu"
1290 echo "VNC TLS support $vnc_tls"
1291 if test "$vnc_tls" = "yes" ; then
1292 echo " TLS CFLAGS $vnc_tls_cflags"
1293 echo " TLS LIBS $vnc_tls_libs"
1295 echo "VNC SASL support $vnc_sasl"
1296 if test "$vnc_sasl" = "yes" ; then
1297 echo " SASL CFLAGS $vnc_sasl_cflags"
1298 echo " SASL LIBS $vnc_sasl_libs"
1300 if test -n "$sparc_cpu"; then
1301 echo "Target Sparc Arch $sparc_cpu"
1303 echo "kqemu support $kqemu"
1304 echo "kvm support $kvm"
1305 echo "CPU emulation $cpu_emulation"
1306 echo "brlapi support $brlapi"
1307 echo "Documentation $build_docs"
1308 [ ! -z "$uname_release" ] && \
1309 echo "uname -r $uname_release"
1310 echo "NPTL support $nptl"
1311 echo "vde support $vde"
1312 echo "AIO support $aio"
1313 echo "Install blobs $blobs"
1314 echo "KVM support $kvm"
1315 echo "fdt support $fdt"
1317 if test $sdl_too_old = "yes"; then
1318 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1320 if [ -s $TMPSDLLOG ]; then
1321 echo "The error log from compiling the libSDL test is: "
1322 cat $TMPSDLLOG
1324 #if test "$sdl_static" = "no"; then
1325 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1327 config_mak="config-host.mak"
1328 config_h="config-host.h"
1330 #echo "Creating $config_mak and $config_h"
1332 test -f $config_h && mv $config_h ${config_h}~
1334 echo "# Automatically generated by configure - do not modify" > $config_mak
1335 printf "# Configured with:" >> $config_mak
1336 printf " '%s'" "$0" "$@" >> $config_mak
1337 echo >> $config_mak
1338 echo "/* Automatically generated by configure - do not modify */" > $config_h
1340 echo "prefix=$prefix" >> $config_mak
1341 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1342 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1343 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1344 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1345 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1346 echo "MAKE=$make" >> $config_mak
1347 echo "INSTALL=$install" >> $config_mak
1348 echo "CC=$cc" >> $config_mak
1349 echo "HOST_CC=$host_cc" >> $config_mak
1350 echo "AR=$ar" >> $config_mak
1351 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1352 # XXX: only use CFLAGS and LDFLAGS ?
1353 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1354 # compilation of dyngen tool (useful for win32 build on Linux host)
1355 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1356 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1357 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1358 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1359 echo "CFLAGS=$CFLAGS" >> $config_mak
1360 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1361 echo "EXESUF=$EXESUF" >> $config_mak
1362 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1363 case "$cpu" in
1364 i386)
1365 echo "ARCH=i386" >> $config_mak
1366 echo "#define HOST_I386 1" >> $config_h
1368 x86_64)
1369 echo "ARCH=x86_64" >> $config_mak
1370 echo "#define HOST_X86_64 1" >> $config_h
1372 alpha)
1373 echo "ARCH=alpha" >> $config_mak
1374 echo "#define HOST_ALPHA 1" >> $config_h
1376 armv4b)
1377 echo "ARCH=arm" >> $config_mak
1378 echo "#define HOST_ARM 1" >> $config_h
1380 armv4l)
1381 echo "ARCH=arm" >> $config_mak
1382 echo "#define HOST_ARM 1" >> $config_h
1384 cris)
1385 echo "ARCH=cris" >> $config_mak
1386 echo "#define HOST_CRIS 1" >> $config_h
1388 hppa)
1389 echo "ARCH=hppa" >> $config_mak
1390 echo "#define HOST_HPPA 1" >> $config_h
1392 ia64)
1393 echo "ARCH=ia64" >> $config_mak
1394 echo "#define HOST_IA64 1" >> $config_h
1396 m68k)
1397 echo "ARCH=m68k" >> $config_mak
1398 echo "#define HOST_M68K 1" >> $config_h
1400 mips)
1401 echo "ARCH=mips" >> $config_mak
1402 echo "#define HOST_MIPS 1" >> $config_h
1404 mips64)
1405 echo "ARCH=mips64" >> $config_mak
1406 echo "#define HOST_MIPS64 1" >> $config_h
1408 ppc)
1409 echo "ARCH=ppc" >> $config_mak
1410 echo "#define HOST_PPC 1" >> $config_h
1412 ppc64)
1413 echo "ARCH=ppc64" >> $config_mak
1414 echo "#define HOST_PPC64 1" >> $config_h
1416 s390)
1417 echo "ARCH=s390" >> $config_mak
1418 echo "#define HOST_S390 1" >> $config_h
1420 sparc)
1421 echo "ARCH=sparc" >> $config_mak
1422 echo "#define HOST_SPARC 1" >> $config_h
1424 sparc64)
1425 echo "ARCH=sparc64" >> $config_mak
1426 echo "#define HOST_SPARC64 1" >> $config_h
1429 echo "Unsupported CPU = $cpu"
1430 exit 1
1432 esac
1433 if test "$sparse" = "yes" ; then
1434 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1435 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1436 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1438 if test "$bigendian" = "yes" ; then
1439 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1440 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1442 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1443 if test "$mingw32" = "yes" ; then
1444 echo "CONFIG_WIN32=yes" >> $config_mak
1445 echo "#define CONFIG_WIN32 1" >> $config_h
1446 else
1447 cat > $TMPC << EOF
1448 #include <byteswap.h>
1449 int main(void) { return bswap_32(0); }
1451 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1452 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1454 cat > $TMPC << EOF
1455 #include <sys/endian.h>
1456 #include <sys/types.h>
1457 #include <machine/bswap.h>
1458 int main(void) { return bswap32(0); }
1460 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1461 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1465 if [ "$openbsd" = "yes" ] ; then
1466 echo "#define ENOTSUP 4096" >> $config_h
1469 if test "$darwin" = "yes" ; then
1470 echo "CONFIG_DARWIN=yes" >> $config_mak
1471 echo "#define CONFIG_DARWIN 1" >> $config_h
1474 if test "$aix" = "yes" ; then
1475 echo "CONFIG_AIX=yes" >> $config_mak
1476 echo "#define CONFIG_AIX 1" >> $config_h
1479 if test "$solaris" = "yes" ; then
1480 echo "CONFIG_SOLARIS=yes" >> $config_mak
1481 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1482 if test "$needs_libsunmath" = "yes" ; then
1483 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1484 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1487 if test -n "$sparc_cpu"; then
1488 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1489 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1491 if test "$gdbstub" = "yes" ; then
1492 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1493 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1495 if test "$gprof" = "yes" ; then
1496 echo "TARGET_GPROF=yes" >> $config_mak
1497 echo "#define HAVE_GPROF 1" >> $config_h
1499 if test "$static" = "yes" ; then
1500 echo "CONFIG_STATIC=yes" >> $config_mak
1501 echo "#define CONFIG_STATIC 1" >> $config_h
1503 if test $profiler = "yes" ; then
1504 echo "#define CONFIG_PROFILER 1" >> $config_h
1506 if test "$slirp" = "yes" ; then
1507 echo "CONFIG_SLIRP=yes" >> $config_mak
1508 echo "#define CONFIG_SLIRP 1" >> $config_h
1510 if test "$vde" = "yes" ; then
1511 echo "CONFIG_VDE=yes" >> $config_mak
1512 echo "#define CONFIG_VDE 1" >> $config_h
1513 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1515 for card in $audio_card_list; do
1516 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1517 echo "$def=yes" >> $config_mak
1518 echo "#define $def 1" >> $config_h
1519 done
1520 echo "#define AUDIO_DRIVERS \\" >> $config_h
1521 for drv in $audio_drv_list; do
1522 echo " &${drv}_audio_driver, \\" >>$config_h
1523 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1524 echo "$def=yes" >> $config_mak
1525 if test "$drv" = "fmod"; then
1526 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1527 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1528 elif test "$drv" = "oss"; then
1529 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1531 done
1532 echo "" >>$config_h
1533 if test "$mixemu" = "yes" ; then
1534 echo "CONFIG_MIXEMU=yes" >> $config_mak
1535 echo "#define CONFIG_MIXEMU 1" >> $config_h
1537 if test "$vnc_tls" = "yes" ; then
1538 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1539 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1540 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1541 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1543 if test "$vnc_sasl" = "yes" ; then
1544 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1545 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1546 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1547 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1549 if test "$fnmatch" = "yes" ; then
1550 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1552 qemu_version=`head $source_path/VERSION`
1553 echo "VERSION=$qemu_version" >>$config_mak
1554 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1555 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1557 echo "SRC_PATH=$source_path" >> $config_mak
1558 if [ "$source_path_used" = "yes" ]; then
1559 echo "VPATH=$source_path" >> $config_mak
1561 echo "TARGET_DIRS=$target_list" >> $config_mak
1562 if [ "$build_docs" = "yes" ] ; then
1563 echo "BUILD_DOCS=yes" >> $config_mak
1565 if test "$static" = "yes"; then
1566 sdl1=$sdl_static
1567 else
1568 sdl1=$sdl
1570 if test "$sdl1" = "yes" ; then
1571 echo "#define CONFIG_SDL 1" >> $config_h
1572 echo "CONFIG_SDL=yes" >> $config_mak
1573 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1574 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1575 elif test "$sdl_x11" = "yes" ; then
1576 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1577 else
1578 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1580 if [ "${aa}" = "yes" ] ; then
1581 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1582 else
1583 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1586 if test "$cocoa" = "yes" ; then
1587 echo "#define CONFIG_COCOA 1" >> $config_h
1588 echo "CONFIG_COCOA=yes" >> $config_mak
1590 if test "$curses" = "yes" ; then
1591 echo "#define CONFIG_CURSES 1" >> $config_h
1592 echo "CONFIG_CURSES=yes" >> $config_mak
1593 echo "CURSES_LIBS=-lcurses" >> $config_mak
1595 if test "$brlapi" = "yes" ; then
1596 echo "CONFIG_BRLAPI=yes" >> $config_mak
1597 echo "#define CONFIG_BRLAPI 1" >> $config_h
1598 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1600 if test "$bluez" = "yes" ; then
1601 echo "CONFIG_BLUEZ=yes" >> $config_mak
1602 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1603 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1604 echo "#define CONFIG_BLUEZ 1" >> $config_h
1606 if test "$aio" = "yes" ; then
1607 echo "#define CONFIG_AIO 1" >> $config_h
1608 echo "CONFIG_AIO=yes" >> $config_mak
1610 if test "$blobs" = "yes" ; then
1611 echo "INSTALL_BLOBS=yes" >> $config_mak
1613 if test "$iovec" = "yes" ; then
1614 echo "#define HAVE_IOVEC 1" >> $config_h
1616 if test "$fdt" = "yes" ; then
1617 echo "#define HAVE_FDT 1" >> $config_h
1618 echo "FDT_LIBS=-lfdt" >> $config_mak
1620 if test "$signalfd" = "yes" ; then
1621 echo "#define CONFIG_signalfd 1" >> $config_h
1623 if test "$eventfd" = "yes" ; then
1624 echo "#define CONFIG_eventfd 1" >> $config_h
1627 # XXX: suppress that
1628 if [ "$bsd" = "yes" ] ; then
1629 echo "#define O_LARGEFILE 0" >> $config_h
1630 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1631 echo "#define HOST_BSD 1" >> $config_h
1634 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1636 # USB host support
1637 case "$usb" in
1638 linux)
1639 echo "HOST_USB=linux" >> $config_mak
1641 bsd)
1642 echo "HOST_USB=bsd" >> $config_mak
1645 echo "HOST_USB=stub" >> $config_mak
1647 esac
1649 tools=
1650 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1651 tools="qemu-img\$(EXESUF) $tools"
1652 if [ "$linux" = "yes" ] ; then
1653 tools="qemu-nbd\$(EXESUF) $tools"
1656 echo "TOOLS=$tools" >> $config_mak
1658 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1660 for target in $target_list; do
1661 target_dir="$target"
1662 config_mak=$target_dir/config.mak
1663 config_h=$target_dir/config.h
1664 target_cpu=`echo $target | cut -d '-' -f 1`
1665 target_bigendian="no"
1666 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1667 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1668 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1669 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1670 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1671 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1672 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1673 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1674 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1675 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1676 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1677 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1678 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1679 target_softmmu="no"
1680 target_user_only="no"
1681 target_linux_user="no"
1682 target_darwin_user="no"
1683 target_bsd_user="no"
1684 case "$target" in
1685 ${target_cpu}-softmmu)
1686 target_softmmu="yes"
1688 ${target_cpu}-linux-user)
1689 target_user_only="yes"
1690 target_linux_user="yes"
1692 ${target_cpu}-darwin-user)
1693 target_user_only="yes"
1694 target_darwin_user="yes"
1696 ${target_cpu}-bsd-user)
1697 target_user_only="yes"
1698 target_bsd_user="yes"
1701 echo "ERROR: Target '$target' not recognised"
1702 exit 1
1704 esac
1706 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1707 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1708 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1709 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1710 echo "Note that this will disable all output from the virtual graphics card"
1711 echo "except through VNC or curses."
1712 exit 1;
1715 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1717 test -f $config_h && mv $config_h ${config_h}~
1719 mkdir -p $target_dir
1720 mkdir -p $target_dir/fpu
1721 mkdir -p $target_dir/tcg
1722 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1723 mkdir -p $target_dir/nwfpe
1727 # don't use ln -sf as not all "ln -sf" over write the file/link
1729 rm -f $target_dir/Makefile
1730 ln -s $source_path/Makefile.target $target_dir/Makefile
1733 echo "# Automatically generated by configure - do not modify" > $config_mak
1734 echo "/* Automatically generated by configure - do not modify */" > $config_h
1737 echo "include ../config-host.mak" >> $config_mak
1738 echo "#include \"../config-host.h\"" >> $config_h
1740 bflt="no"
1741 elfload32="no"
1742 target_nptl="no"
1743 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1744 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1745 gdb_xml_files=""
1747 disable_cpu_emulation() {
1748 if test $cpu_emulation = "no"; then
1749 echo "#define NO_CPU_EMULATION 1" >> $config_h
1750 echo "NO_CPU_EMULATION=1" >> $config_mak
1754 configure_kvm() {
1755 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1756 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1757 echo "#define USE_KVM 1" >> $config_h
1758 echo "USE_KVM=1" >> $config_mak
1759 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1760 if test $kvm_cap_pit = "yes" ; then
1761 echo "USE_KVM_PIT=1" >> $config_mak
1762 echo "#define USE_KVM_PIT 1" >> $config_h
1764 if test $kvm_cap_device_assignment = "yes" ; then
1765 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1766 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1768 disable_cpu_emulation
1772 if [ use_upstream_kvm = yes ]; then
1774 # Make sure the target and host cpus are compatible
1775 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1776 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1777 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1778 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1779 kvm="no"
1781 # Disable KVM for linux-user
1782 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1783 kvm="no"
1788 case "$target_cpu" in
1789 i386)
1790 echo "TARGET_ARCH=i386" >> $config_mak
1791 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1792 echo "#define TARGET_I386 1" >> $config_h
1793 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1794 then
1795 echo "#define USE_KQEMU 1" >> $config_h
1797 if test "$kvm" = "yes" ; then
1798 echo "CONFIG_KVM=yes" >> $config_mak
1799 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1800 echo "#define CONFIG_KVM 1" >> $config_h
1802 configure_kvm
1804 x86_64)
1805 echo "TARGET_ARCH=x86_64" >> $config_mak
1806 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1807 echo "#define TARGET_I386 1" >> $config_h
1808 echo "#define TARGET_X86_64 1" >> $config_h
1809 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1810 then
1811 echo "#define USE_KQEMU 1" >> $config_h
1813 configure_kvm
1815 ia64)
1816 echo "TARGET_ARCH=ia64" >> $config_mak
1817 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1818 echo "#define TARGET_IA64 1" >> $config_h
1819 configure_kvm
1820 if [ use_upstream_kvm = yes ]; then
1821 if test "$kvm" = "yes" ; then
1822 echo "CONFIG_KVM=yes" >> $config_mak
1823 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1824 echo "#define CONFIG_KVM 1" >> $config_h
1828 alpha)
1829 echo "TARGET_ARCH=alpha" >> $config_mak
1830 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1831 echo "#define TARGET_ALPHA 1" >> $config_h
1833 arm|armeb)
1834 echo "TARGET_ARCH=arm" >> $config_mak
1835 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1836 echo "#define TARGET_ARM 1" >> $config_h
1837 bflt="yes"
1838 target_nptl="yes"
1839 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1841 cris)
1842 echo "TARGET_ARCH=cris" >> $config_mak
1843 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1844 echo "#define TARGET_CRIS 1" >> $config_h
1845 target_nptl="yes"
1847 m68k)
1848 echo "TARGET_ARCH=m68k" >> $config_mak
1849 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1850 echo "#define TARGET_M68K 1" >> $config_h
1851 bflt="yes"
1852 gdb_xml_files="cf-core.xml cf-fp.xml"
1854 mips|mipsel)
1855 echo "TARGET_ARCH=mips" >> $config_mak
1856 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1857 echo "#define TARGET_MIPS 1" >> $config_h
1858 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1860 mipsn32|mipsn32el)
1861 echo "TARGET_ARCH=mipsn32" >> $config_mak
1862 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1863 echo "#define TARGET_MIPS 1" >> $config_h
1864 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1866 mips64|mips64el)
1867 echo "TARGET_ARCH=mips64" >> $config_mak
1868 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1869 echo "#define TARGET_MIPS 1" >> $config_h
1870 echo "#define TARGET_MIPS64 1" >> $config_h
1871 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1873 ppc)
1874 echo "TARGET_ARCH=ppc" >> $config_mak
1875 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1876 echo "#define TARGET_PPC 1" >> $config_h
1877 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1879 ppcemb)
1880 echo "TARGET_ARCH=ppcemb" >> $config_mak
1881 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1882 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1883 echo "#define TARGET_PPC 1" >> $config_h
1884 echo "#define TARGET_PPCEMB 1" >> $config_h
1885 if test "$kvm" = "yes" ; then
1886 echo "CONFIG_KVM=yes" >> $config_mak
1887 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1888 echo "#define CONFIG_KVM 1" >> $config_h
1890 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1892 ppc64)
1893 echo "TARGET_ARCH=ppc64" >> $config_mak
1894 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1895 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1896 echo "#define TARGET_PPC 1" >> $config_h
1897 echo "#define TARGET_PPC64 1" >> $config_h
1898 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1900 ppc64abi32)
1901 echo "TARGET_ARCH=ppc64" >> $config_mak
1902 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1903 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1904 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1905 echo "#define TARGET_PPC 1" >> $config_h
1906 echo "#define TARGET_PPC64 1" >> $config_h
1907 echo "#define TARGET_ABI32 1" >> $config_h
1908 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1910 sh4|sh4eb)
1911 echo "TARGET_ARCH=sh4" >> $config_mak
1912 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1913 echo "#define TARGET_SH4 1" >> $config_h
1914 bflt="yes"
1915 target_nptl="yes"
1917 sparc)
1918 echo "TARGET_ARCH=sparc" >> $config_mak
1919 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1920 echo "#define TARGET_SPARC 1" >> $config_h
1922 sparc64)
1923 echo "TARGET_ARCH=sparc64" >> $config_mak
1924 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1925 echo "#define TARGET_SPARC 1" >> $config_h
1926 echo "#define TARGET_SPARC64 1" >> $config_h
1927 elfload32="yes"
1929 sparc32plus)
1930 echo "TARGET_ARCH=sparc64" >> $config_mak
1931 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1932 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1933 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1934 echo "#define TARGET_SPARC 1" >> $config_h
1935 echo "#define TARGET_SPARC64 1" >> $config_h
1936 echo "#define TARGET_ABI32 1" >> $config_h
1939 echo "Unsupported target CPU"
1940 exit 1
1942 esac
1943 if test "$target_bigendian" = "yes" ; then
1944 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1945 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1947 if test "$target_softmmu" = "yes" ; then
1948 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1949 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1951 if test "$target_user_only" = "yes" ; then
1952 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1953 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1955 if test "$target_linux_user" = "yes" ; then
1956 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1957 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1959 if test "$target_darwin_user" = "yes" ; then
1960 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1961 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1963 list=""
1964 if test ! -z "$gdb_xml_files" ; then
1965 for x in $gdb_xml_files; do
1966 list="$list $source_path/gdb-xml/$x"
1967 done
1969 echo "TARGET_XML_FILES=$list" >> $config_mak
1971 if test "$target_cpu" = "arm" \
1972 -o "$target_cpu" = "armeb" \
1973 -o "$target_cpu" = "m68k" \
1974 -o "$target_cpu" = "mips" \
1975 -o "$target_cpu" = "mipsel" \
1976 -o "$target_cpu" = "mipsn32" \
1977 -o "$target_cpu" = "mipsn32el" \
1978 -o "$target_cpu" = "mips64" \
1979 -o "$target_cpu" = "mips64el" \
1980 -o "$target_cpu" = "ppc" \
1981 -o "$target_cpu" = "ppc64" \
1982 -o "$target_cpu" = "ppc64abi32" \
1983 -o "$target_cpu" = "ppcemb" \
1984 -o "$target_cpu" = "sparc" \
1985 -o "$target_cpu" = "sparc64" \
1986 -o "$target_cpu" = "sparc32plus"; then
1987 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1988 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1990 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1991 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1992 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1994 if test "$target_user_only" = "yes" \
1995 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1996 echo "#define USE_NPTL 1" >> $config_h
1998 # 32 bit ELF loader in addition to native 64 bit loader?
1999 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
2000 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
2001 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2003 if test "$target_bsd_user" = "yes" ; then
2004 echo "CONFIG_BSD_USER=yes" >> $config_mak
2005 echo "#define CONFIG_BSD_USER 1" >> $config_h
2008 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2010 done # for target in $targets
2012 # build tree in object directory if source path is different from current one
2013 if test "$source_path_used" = "yes" ; then
2014 DIRS="tests tests/cris slirp audio"
2015 FILES="Makefile tests/Makefile"
2016 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2017 FILES="$FILES tests/test-mmap.c"
2018 for dir in $DIRS ; do
2019 mkdir -p $dir
2020 done
2021 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2022 for f in $FILES ; do
2023 rm -f $f
2024 ln -s $source_path/$f $f
2025 done