kvm: configure: run kernel configure even with --with-patched-kernel
[qemu-kvm/fedora.git] / configure
blob2170d00606999c122bf4d8b0491d468bc4783139
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 host NPTL support
755 cat > $TMPC <<EOF
756 #include <sched.h>
757 #include <linux/futex.h>
758 void foo()
760 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
761 #error bork
762 #endif
766 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
768 else
769 nptl="no"
772 ##########################################
773 # KVM probe
775 if test "$kvm" = "yes" ; then
777 # test for KVM_CAP_PIT
779 cat > $TMPC <<EOF
780 #include <libkvm.h>
781 #ifndef KVM_CAP_PIT
782 #error "kvm no pit capability"
783 #endif
784 int main(void) { return 0; }
786 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
787 kvm_cap_pit="yes"
790 # test for KVM_CAP_DEVICE_ASSIGNMENT
792 cat > $TMPC <<EOF
793 #include <libkvm.h>
794 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
795 #error "kvm no device assignment capability"
796 #endif
797 int main(void) { return 0; }
799 if $cc $ARCH_CFLAGS $CFLAGS -I"$kerneldir"/include -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
800 kvm_cap_device_assignment="yes"
804 # libpci probe for kvm_cap_device_assignment
805 if test $kvm_cap_device_assignment = "yes" ; then
806 cat > $TMPC << EOF
807 #include <pci/pci.h>
808 #ifndef PCI_VENDOR_ID
809 #error NO LIBPCI
810 #endif
811 int main(void) { return 0; }
813 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2>/dev/null ; then
815 else
816 echo
817 echo "Error: libpci check failed"
818 echo "Disable KVM Device Assignment capability."
819 echo
820 kvm_cap_device_assignment="no"
824 ##########################################
825 # zlib check
827 cat > $TMPC << EOF
828 #include <zlib.h>
829 int main(void) { zlibVersion(); return 0; }
831 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
833 else
834 echo
835 echo "Error: zlib check failed"
836 echo "Make sure to have the zlib libs and headers installed."
837 echo
838 exit 1
841 ##########################################
842 # SDL probe
844 sdl_too_old=no
846 if test -z "$sdl" ; then
847 sdl_config="sdl-config"
848 sdl=no
849 sdl_static=no
851 cat > $TMPC << EOF
852 #include <SDL.h>
853 #undef main /* We don't want SDL to override our main() */
854 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
856 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
857 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
858 if test "$_sdlversion" -lt 121 ; then
859 sdl_too_old=yes
860 else
861 if test "$cocoa" = "no" ; then
862 sdl=yes
866 # static link with sdl ?
867 if test "$sdl" = "yes" ; then
868 aa="no"
869 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
870 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
871 if [ "$aa" = "yes" ] ; then
872 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
875 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
876 sdl_static=yes
878 fi # static link
879 fi # sdl compile test
880 else
881 # Make sure to disable cocoa if sdl was set
882 if test "$sdl" = "yes" ; then
883 cocoa="no"
884 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
886 fi # -z $sdl
888 if test "$sdl" = "yes" ; then
889 cat > $TMPC <<EOF
890 #include <SDL.h>
891 #if defined(SDL_VIDEO_DRIVER_X11)
892 #include <X11/XKBlib.h>
893 #else
894 #error No x11 support
895 #endif
896 int main(void) { return 0; }
898 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
899 sdl_x11="yes"
903 ##########################################
904 # VNC TLS detection
905 if test "$vnc_tls" = "yes" ; then
906 cat > $TMPC <<EOF
907 #include <gnutls/gnutls.h>
908 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
910 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
911 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
912 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
913 $vnc_tls_libs > /dev/null 2> /dev/null ; then
915 else
916 vnc_tls="no"
920 ##########################################
921 # VNC SASL detection
922 if test "$vnc_sasl" = "yes" ; then
923 cat > $TMPC <<EOF
924 #include <sasl/sasl.h>
925 #include <stdio.h>
926 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
928 # Assuming Cyrus-SASL installed in /usr prefix
929 vnc_sasl_cflags=""
930 vnc_sasl_libs="-lsasl2"
931 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
932 $vnc_sasl_libs 2> /dev/null ; then
934 else
935 vnc_sasl="no"
939 ##########################################
940 # fnmatch() probe, used for ACL routines
941 fnmatch="no"
942 cat > $TMPC << EOF
943 #include <fnmatch.h>
944 int main(void)
946 fnmatch("foo", "foo", 0);
947 return 0;
950 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
951 fnmatch="yes"
954 ##########################################
955 # vde libraries probe
956 if test "$vde" = "yes" ; then
957 cat > $TMPC << EOF
958 #include <libvdeplug.h>
959 int main(void)
961 struct vde_open_args a = {0, 0, 0};
962 vde_open("", "", &a);
963 return 0;
966 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
968 else
969 vde="no"
973 ##########################################
974 # Sound support libraries probe
976 audio_drv_probe()
978 drv=$1
979 hdr=$2
980 lib=$3
981 exp=$4
982 cfl=$5
983 cat > $TMPC << EOF
984 #include <$hdr>
985 int main(void) { $exp }
987 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
989 else
990 echo
991 echo "Error: $drv check failed"
992 echo "Make sure to have the $drv libs and headers installed."
993 echo
994 exit 1
998 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
999 for drv in $audio_drv_list; do
1000 case $drv in
1001 alsa)
1002 audio_drv_probe $drv alsa/asoundlib.h -lasound \
1003 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1006 fmod)
1007 if test -z $fmod_lib || test -z $fmod_inc; then
1008 echo
1009 echo "Error: You must specify path to FMOD library and headers"
1010 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1011 echo
1012 exit 1
1014 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1017 esd)
1018 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1022 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1023 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1026 oss|sdl|core|wav|dsound)
1027 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1031 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1032 echo
1033 echo "Error: Unknown driver '$drv' selected"
1034 echo "Possible drivers are: $audio_possible_drivers"
1035 echo
1036 exit 1
1039 esac
1040 done
1042 ##########################################
1043 # BrlAPI probe
1045 if test -z "$brlapi" ; then
1046 brlapi=no
1047 cat > $TMPC << EOF
1048 #include <brlapi.h>
1049 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1051 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1052 brlapi=yes
1053 fi # brlapi compile test
1054 fi # -z $brlapi
1056 ##########################################
1057 # curses probe
1059 if test "$curses" = "yes" ; then
1060 curses=no
1061 cat > $TMPC << EOF
1062 #include <curses.h>
1063 int main(void) { return curses_version(); }
1065 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1066 curses=yes
1068 fi # test "$curses"
1070 ##########################################
1071 # bluez support probe
1072 if test "$bluez" = "yes" ; then
1073 `pkg-config bluez` || bluez="no"
1075 if test "$bluez" = "yes" ; then
1076 cat > $TMPC << EOF
1077 #include <bluetooth/bluetooth.h>
1078 int main(void) { return bt_error(0); }
1080 bluez_cflags=`pkg-config --cflags bluez`
1081 bluez_libs=`pkg-config --libs bluez`
1082 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1083 $bluez_libs > /dev/null 2> /dev/null ; then
1085 else
1086 bluez="no"
1090 ##########################################
1091 # kvm probe
1092 if test "$kvm" = "yes" ; then
1093 cat > $TMPC <<EOF
1094 #include <linux/kvm.h>
1095 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1096 #error Invalid KVM version
1097 #endif
1098 #if !defined(KVM_CAP_USER_MEMORY)
1099 #error Missing KVM capability KVM_CAP_USER_MEMORY
1100 #endif
1101 #if !defined(KVM_CAP_SET_TSS_ADDR)
1102 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1103 #endif
1104 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1105 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1106 #endif
1107 int main(void) { return 0; }
1109 if test "$kerneldir" != "" ; then
1110 kvm_cflags=-I"$kerneldir"/include
1111 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1112 -a -d "$kerneldir/arch/x86/include" ; then
1113 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1114 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1115 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1116 elif test -d "$kerneldir/arch/$cpu/include" ; then
1117 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1119 else
1120 kvm_cflags=""
1122 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1123 > /dev/null 2>/dev/null ; then
1125 else
1126 kvm="no";
1127 if [ -x "`which awk 2>/dev/null`" ] && \
1128 [ -x "`which grep 2>/dev/null`" ]; then
1129 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1130 | grep "error: " \
1131 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1132 if test "$kvmerr" != "" ; then
1133 kvm="no - (${kvmerr})"
1139 ##########################################
1140 # AIO probe
1141 AIOLIBS=""
1143 if test "$aio" = "yes" ; then
1144 aio=no
1145 cat > $TMPC << EOF
1146 #include <pthread.h>
1147 int main(void) { pthread_mutex_t lock; return 0; }
1149 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1150 aio=yes
1151 AIOLIBS="-lpthread"
1155 ##########################################
1156 # iovec probe
1157 cat > $TMPC <<EOF
1158 #include <sys/types.h>
1159 #include <sys/uio.h>
1160 #include <unistd.h>
1161 int main(void) { struct iovec iov; return 0; }
1163 iovec=no
1164 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1165 iovec=yes
1168 ##########################################
1169 # fdt probe
1170 if test "$fdt" = "yes" ; then
1171 fdt=no
1172 cat > $TMPC << EOF
1173 int main(void) { return 0; }
1175 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1176 fdt=yes
1180 ##########################################
1181 # signalfd probe
1182 cat > $TMPC << EOF
1183 #define _GNU_SOURCE
1184 #include <unistd.h>
1185 #include <sys/syscall.h>
1186 #include <signal.h>
1187 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1190 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1191 signalfd=yes
1194 ##########################################
1195 # eventfd probe
1196 cat > $TMPC << EOF
1197 #define _GNU_SOURCE
1198 #include <unistd.h>
1199 #include <sys/syscall.h>
1200 int main(void) { return syscall(SYS_eventfd, 0); }
1203 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1204 eventfd=yes
1207 # Check if tools are available to build documentation.
1208 if [ -x "`which texi2html 2>/dev/null`" ] && \
1209 [ -x "`which pod2man 2>/dev/null`" ]; then
1210 build_docs="yes"
1213 ##########################################
1214 # Do we need librt
1215 cat > $TMPC <<EOF
1216 #include <signal.h>
1217 #include <time.h>
1218 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1221 rt=no
1222 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1224 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1225 rt=yes
1228 if test "$rt" = "yes" ; then
1229 # Hack, we should have a general purpose LIBS for this sort of thing
1230 AIOLIBS="$AIOLIBS -lrt"
1233 if test "$mingw32" = "yes" ; then
1234 if test -z "$prefix" ; then
1235 prefix="c:\\\\Program Files\\\\Qemu"
1237 mansuffix=""
1238 datasuffix=""
1239 docsuffix=""
1240 binsuffix=""
1241 else
1242 if test -z "$prefix" ; then
1243 prefix="/usr/local"
1245 mansuffix="/share/man"
1246 datasuffix="/share/qemu"
1247 docsuffix="/share/doc/qemu"
1248 binsuffix="/bin"
1251 echo "Install prefix $prefix"
1252 echo "BIOS directory $prefix$datasuffix"
1253 echo "binary directory $prefix$binsuffix"
1254 if test "$mingw32" = "no" ; then
1255 echo "Manual directory $prefix$mansuffix"
1256 echo "ELF interp prefix $interp_prefix"
1258 echo "Source path $source_path"
1259 echo "C compiler $cc"
1260 echo "Host C compiler $host_cc"
1261 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1262 echo "make $make"
1263 echo "install $install"
1264 echo "host CPU $cpu"
1265 echo "host big endian $bigendian"
1266 echo "target list $target_list"
1267 echo "gprof enabled $gprof"
1268 echo "sparse enabled $sparse"
1269 echo "profiler $profiler"
1270 echo "static build $static"
1271 echo "-Werror enabled $werror"
1272 if test "$darwin" = "yes" ; then
1273 echo "Cocoa support $cocoa"
1275 echo "SDL support $sdl"
1276 if test "$sdl" != "no" ; then
1277 echo "SDL static link $sdl_static"
1279 echo "curses support $curses"
1280 echo "mingw32 support $mingw32"
1281 echo "Audio drivers $audio_drv_list"
1282 echo "Extra audio cards $audio_card_list"
1283 echo "Mixer emulation $mixemu"
1284 echo "VNC TLS support $vnc_tls"
1285 if test "$vnc_tls" = "yes" ; then
1286 echo " TLS CFLAGS $vnc_tls_cflags"
1287 echo " TLS LIBS $vnc_tls_libs"
1289 echo "VNC SASL support $vnc_sasl"
1290 if test "$vnc_sasl" = "yes" ; then
1291 echo " SASL CFLAGS $vnc_sasl_cflags"
1292 echo " SASL LIBS $vnc_sasl_libs"
1294 if test -n "$sparc_cpu"; then
1295 echo "Target Sparc Arch $sparc_cpu"
1297 echo "kqemu support $kqemu"
1298 echo "kvm support $kvm"
1299 echo "CPU emulation $cpu_emulation"
1300 echo "brlapi support $brlapi"
1301 echo "Documentation $build_docs"
1302 [ ! -z "$uname_release" ] && \
1303 echo "uname -r $uname_release"
1304 echo "NPTL support $nptl"
1305 echo "vde support $vde"
1306 echo "AIO support $aio"
1307 echo "Install blobs $blobs"
1308 echo "KVM support $kvm"
1309 echo "fdt support $fdt"
1311 if test $sdl_too_old = "yes"; then
1312 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1314 if [ -s $TMPSDLLOG ]; then
1315 echo "The error log from compiling the libSDL test is: "
1316 cat $TMPSDLLOG
1318 #if test "$sdl_static" = "no"; then
1319 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1321 config_mak="config-host.mak"
1322 config_h="config-host.h"
1324 #echo "Creating $config_mak and $config_h"
1326 test -f $config_h && mv $config_h ${config_h}~
1328 echo "# Automatically generated by configure - do not modify" > $config_mak
1329 printf "# Configured with:" >> $config_mak
1330 printf " '%s'" "$0" "$@" >> $config_mak
1331 echo >> $config_mak
1332 echo "/* Automatically generated by configure - do not modify */" > $config_h
1334 echo "prefix=$prefix" >> $config_mak
1335 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1336 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1337 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1338 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1339 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1340 echo "MAKE=$make" >> $config_mak
1341 echo "INSTALL=$install" >> $config_mak
1342 echo "CC=$cc" >> $config_mak
1343 echo "HOST_CC=$host_cc" >> $config_mak
1344 echo "AR=$ar" >> $config_mak
1345 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1346 # XXX: only use CFLAGS and LDFLAGS ?
1347 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1348 # compilation of dyngen tool (useful for win32 build on Linux host)
1349 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1350 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1351 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1352 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1353 echo "CFLAGS=$CFLAGS" >> $config_mak
1354 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1355 echo "EXESUF=$EXESUF" >> $config_mak
1356 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1357 case "$cpu" in
1358 i386)
1359 echo "ARCH=i386" >> $config_mak
1360 echo "#define HOST_I386 1" >> $config_h
1362 x86_64)
1363 echo "ARCH=x86_64" >> $config_mak
1364 echo "#define HOST_X86_64 1" >> $config_h
1366 alpha)
1367 echo "ARCH=alpha" >> $config_mak
1368 echo "#define HOST_ALPHA 1" >> $config_h
1370 armv4b)
1371 echo "ARCH=arm" >> $config_mak
1372 echo "#define HOST_ARM 1" >> $config_h
1374 armv4l)
1375 echo "ARCH=arm" >> $config_mak
1376 echo "#define HOST_ARM 1" >> $config_h
1378 cris)
1379 echo "ARCH=cris" >> $config_mak
1380 echo "#define HOST_CRIS 1" >> $config_h
1382 hppa)
1383 echo "ARCH=hppa" >> $config_mak
1384 echo "#define HOST_HPPA 1" >> $config_h
1386 ia64)
1387 echo "ARCH=ia64" >> $config_mak
1388 echo "#define HOST_IA64 1" >> $config_h
1390 m68k)
1391 echo "ARCH=m68k" >> $config_mak
1392 echo "#define HOST_M68K 1" >> $config_h
1394 mips)
1395 echo "ARCH=mips" >> $config_mak
1396 echo "#define HOST_MIPS 1" >> $config_h
1398 mips64)
1399 echo "ARCH=mips64" >> $config_mak
1400 echo "#define HOST_MIPS64 1" >> $config_h
1402 ppc)
1403 echo "ARCH=ppc" >> $config_mak
1404 echo "#define HOST_PPC 1" >> $config_h
1406 ppc64)
1407 echo "ARCH=ppc64" >> $config_mak
1408 echo "#define HOST_PPC64 1" >> $config_h
1410 s390)
1411 echo "ARCH=s390" >> $config_mak
1412 echo "#define HOST_S390 1" >> $config_h
1414 sparc)
1415 echo "ARCH=sparc" >> $config_mak
1416 echo "#define HOST_SPARC 1" >> $config_h
1418 sparc64)
1419 echo "ARCH=sparc64" >> $config_mak
1420 echo "#define HOST_SPARC64 1" >> $config_h
1423 echo "Unsupported CPU = $cpu"
1424 exit 1
1426 esac
1427 if test "$sparse" = "yes" ; then
1428 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1429 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1430 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1432 if test "$bigendian" = "yes" ; then
1433 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1434 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1436 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1437 if test "$mingw32" = "yes" ; then
1438 echo "CONFIG_WIN32=yes" >> $config_mak
1439 echo "#define CONFIG_WIN32 1" >> $config_h
1440 else
1441 cat > $TMPC << EOF
1442 #include <byteswap.h>
1443 int main(void) { return bswap_32(0); }
1445 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1446 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1448 cat > $TMPC << EOF
1449 #include <sys/endian.h>
1450 #include <sys/types.h>
1451 #include <machine/bswap.h>
1452 int main(void) { return bswap32(0); }
1454 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1455 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1459 if [ "$openbsd" = "yes" ] ; then
1460 echo "#define ENOTSUP 4096" >> $config_h
1463 if test "$darwin" = "yes" ; then
1464 echo "CONFIG_DARWIN=yes" >> $config_mak
1465 echo "#define CONFIG_DARWIN 1" >> $config_h
1468 if test "$aix" = "yes" ; then
1469 echo "CONFIG_AIX=yes" >> $config_mak
1470 echo "#define CONFIG_AIX 1" >> $config_h
1473 if test "$solaris" = "yes" ; then
1474 echo "CONFIG_SOLARIS=yes" >> $config_mak
1475 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1476 if test "$needs_libsunmath" = "yes" ; then
1477 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1478 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1481 if test -n "$sparc_cpu"; then
1482 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1483 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1485 if test "$gdbstub" = "yes" ; then
1486 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1487 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1489 if test "$gprof" = "yes" ; then
1490 echo "TARGET_GPROF=yes" >> $config_mak
1491 echo "#define HAVE_GPROF 1" >> $config_h
1493 if test "$static" = "yes" ; then
1494 echo "CONFIG_STATIC=yes" >> $config_mak
1495 echo "#define CONFIG_STATIC 1" >> $config_h
1497 if test $profiler = "yes" ; then
1498 echo "#define CONFIG_PROFILER 1" >> $config_h
1500 if test "$slirp" = "yes" ; then
1501 echo "CONFIG_SLIRP=yes" >> $config_mak
1502 echo "#define CONFIG_SLIRP 1" >> $config_h
1504 if test "$vde" = "yes" ; then
1505 echo "CONFIG_VDE=yes" >> $config_mak
1506 echo "#define CONFIG_VDE 1" >> $config_h
1507 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1509 for card in $audio_card_list; do
1510 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1511 echo "$def=yes" >> $config_mak
1512 echo "#define $def 1" >> $config_h
1513 done
1514 echo "#define AUDIO_DRIVERS \\" >> $config_h
1515 for drv in $audio_drv_list; do
1516 echo " &${drv}_audio_driver, \\" >>$config_h
1517 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1518 echo "$def=yes" >> $config_mak
1519 if test "$drv" = "fmod"; then
1520 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1521 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1522 elif test "$drv" = "oss"; then
1523 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1525 done
1526 echo "" >>$config_h
1527 if test "$mixemu" = "yes" ; then
1528 echo "CONFIG_MIXEMU=yes" >> $config_mak
1529 echo "#define CONFIG_MIXEMU 1" >> $config_h
1531 if test "$vnc_tls" = "yes" ; then
1532 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1533 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1534 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1535 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1537 if test "$vnc_sasl" = "yes" ; then
1538 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1539 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1540 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1541 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1543 if test "$fnmatch" = "yes" ; then
1544 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1546 qemu_version=`head $source_path/VERSION`
1547 echo "VERSION=$qemu_version" >>$config_mak
1548 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1549 echo "#define KVM_VERSION \"kvm-devel\"" >> $config_h
1551 echo "SRC_PATH=$source_path" >> $config_mak
1552 if [ "$source_path_used" = "yes" ]; then
1553 echo "VPATH=$source_path" >> $config_mak
1555 echo "TARGET_DIRS=$target_list" >> $config_mak
1556 if [ "$build_docs" = "yes" ] ; then
1557 echo "BUILD_DOCS=yes" >> $config_mak
1559 if test "$static" = "yes"; then
1560 sdl1=$sdl_static
1561 else
1562 sdl1=$sdl
1564 if test "$sdl1" = "yes" ; then
1565 echo "#define CONFIG_SDL 1" >> $config_h
1566 echo "CONFIG_SDL=yes" >> $config_mak
1567 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1568 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1569 elif test "$sdl_x11" = "yes" ; then
1570 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1571 else
1572 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1574 if [ "${aa}" = "yes" ] ; then
1575 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1576 else
1577 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1580 if test "$cocoa" = "yes" ; then
1581 echo "#define CONFIG_COCOA 1" >> $config_h
1582 echo "CONFIG_COCOA=yes" >> $config_mak
1584 if test "$curses" = "yes" ; then
1585 echo "#define CONFIG_CURSES 1" >> $config_h
1586 echo "CONFIG_CURSES=yes" >> $config_mak
1587 echo "CURSES_LIBS=-lcurses" >> $config_mak
1589 if test "$brlapi" = "yes" ; then
1590 echo "CONFIG_BRLAPI=yes" >> $config_mak
1591 echo "#define CONFIG_BRLAPI 1" >> $config_h
1592 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1594 if test "$bluez" = "yes" ; then
1595 echo "CONFIG_BLUEZ=yes" >> $config_mak
1596 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1597 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1598 echo "#define CONFIG_BLUEZ 1" >> $config_h
1600 if test "$aio" = "yes" ; then
1601 echo "#define CONFIG_AIO 1" >> $config_h
1602 echo "CONFIG_AIO=yes" >> $config_mak
1604 if test "$blobs" = "yes" ; then
1605 echo "INSTALL_BLOBS=yes" >> $config_mak
1607 if test "$iovec" = "yes" ; then
1608 echo "#define HAVE_IOVEC 1" >> $config_h
1610 if test "$fdt" = "yes" ; then
1611 echo "#define HAVE_FDT 1" >> $config_h
1612 echo "FDT_LIBS=-lfdt" >> $config_mak
1614 if test "$signalfd" = "yes" ; then
1615 echo "#define CONFIG_signalfd 1" >> $config_h
1617 if test "$eventfd" = "yes" ; then
1618 echo "#define CONFIG_eventfd 1" >> $config_h
1621 # XXX: suppress that
1622 if [ "$bsd" = "yes" ] ; then
1623 echo "#define O_LARGEFILE 0" >> $config_h
1624 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1625 echo "#define HOST_BSD 1" >> $config_h
1628 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1630 # USB host support
1631 case "$usb" in
1632 linux)
1633 echo "HOST_USB=linux" >> $config_mak
1635 bsd)
1636 echo "HOST_USB=bsd" >> $config_mak
1639 echo "HOST_USB=stub" >> $config_mak
1641 esac
1643 tools=
1644 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1645 tools="qemu-img\$(EXESUF) $tools"
1646 if [ "$linux" = "yes" ] ; then
1647 tools="qemu-nbd\$(EXESUF) $tools"
1650 echo "TOOLS=$tools" >> $config_mak
1652 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1654 for target in $target_list; do
1655 target_dir="$target"
1656 config_mak=$target_dir/config.mak
1657 config_h=$target_dir/config.h
1658 target_cpu=`echo $target | cut -d '-' -f 1`
1659 target_bigendian="no"
1660 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1661 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1662 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1663 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1664 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1665 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1666 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1667 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1668 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1669 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1670 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1671 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1672 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1673 target_softmmu="no"
1674 target_user_only="no"
1675 target_linux_user="no"
1676 target_darwin_user="no"
1677 target_bsd_user="no"
1678 case "$target" in
1679 ${target_cpu}-softmmu)
1680 target_softmmu="yes"
1682 ${target_cpu}-linux-user)
1683 target_user_only="yes"
1684 target_linux_user="yes"
1686 ${target_cpu}-darwin-user)
1687 target_user_only="yes"
1688 target_darwin_user="yes"
1690 ${target_cpu}-bsd-user)
1691 target_user_only="yes"
1692 target_bsd_user="yes"
1695 echo "ERROR: Target '$target' not recognised"
1696 exit 1
1698 esac
1700 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1701 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1702 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1703 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1704 echo "Note that this will disable all output from the virtual graphics card"
1705 echo "except through VNC or curses."
1706 exit 1;
1709 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1711 test -f $config_h && mv $config_h ${config_h}~
1713 mkdir -p $target_dir
1714 mkdir -p $target_dir/fpu
1715 mkdir -p $target_dir/tcg
1716 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1717 mkdir -p $target_dir/nwfpe
1721 # don't use ln -sf as not all "ln -sf" over write the file/link
1723 rm -f $target_dir/Makefile
1724 ln -s $source_path/Makefile.target $target_dir/Makefile
1727 echo "# Automatically generated by configure - do not modify" > $config_mak
1728 echo "/* Automatically generated by configure - do not modify */" > $config_h
1731 echo "include ../config-host.mak" >> $config_mak
1732 echo "#include \"../config-host.h\"" >> $config_h
1734 bflt="no"
1735 elfload32="no"
1736 target_nptl="no"
1737 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1738 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1739 gdb_xml_files=""
1741 disable_cpu_emulation() {
1742 if test $cpu_emulation = "no"; then
1743 echo "#define NO_CPU_EMULATION 1" >> $config_h
1744 echo "NO_CPU_EMULATION=1" >> $config_mak
1748 configure_kvm() {
1749 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1750 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1751 echo "#define USE_KVM 1" >> $config_h
1752 echo "USE_KVM=1" >> $config_mak
1753 echo "CONFIG_KVM_KERNEL_INC=$kerneldir/include" >> $config_mak
1754 if test $kvm_cap_pit = "yes" ; then
1755 echo "USE_KVM_PIT=1" >> $config_mak
1756 echo "#define USE_KVM_PIT 1" >> $config_h
1758 if test $kvm_cap_device_assignment = "yes" ; then
1759 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1760 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1762 disable_cpu_emulation
1766 if [ use_upstream_kvm = yes ]; then
1768 # Make sure the target and host cpus are compatible
1769 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1770 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1771 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1772 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1773 kvm="no"
1775 # Disable KVM for linux-user
1776 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1777 kvm="no"
1782 case "$target_cpu" in
1783 i386)
1784 echo "TARGET_ARCH=i386" >> $config_mak
1785 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1786 echo "#define TARGET_I386 1" >> $config_h
1787 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1788 then
1789 echo "#define USE_KQEMU 1" >> $config_h
1791 if test "$kvm" = "yes" ; then
1792 echo "CONFIG_KVM=yes" >> $config_mak
1793 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1794 echo "#define CONFIG_KVM 1" >> $config_h
1796 configure_kvm
1798 x86_64)
1799 echo "TARGET_ARCH=x86_64" >> $config_mak
1800 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1801 echo "#define TARGET_I386 1" >> $config_h
1802 echo "#define TARGET_X86_64 1" >> $config_h
1803 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1804 then
1805 echo "#define USE_KQEMU 1" >> $config_h
1807 configure_kvm
1809 ia64)
1810 echo "TARGET_ARCH=ia64" >> $config_mak
1811 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1812 echo "#define TARGET_IA64 1" >> $config_h
1813 configure_kvm
1814 if [ use_upstream_kvm = yes ]; then
1815 if test "$kvm" = "yes" ; then
1816 echo "CONFIG_KVM=yes" >> $config_mak
1817 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1818 echo "#define CONFIG_KVM 1" >> $config_h
1822 alpha)
1823 echo "TARGET_ARCH=alpha" >> $config_mak
1824 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1825 echo "#define TARGET_ALPHA 1" >> $config_h
1827 arm|armeb)
1828 echo "TARGET_ARCH=arm" >> $config_mak
1829 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1830 echo "#define TARGET_ARM 1" >> $config_h
1831 bflt="yes"
1832 target_nptl="yes"
1833 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1835 cris)
1836 echo "TARGET_ARCH=cris" >> $config_mak
1837 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1838 echo "#define TARGET_CRIS 1" >> $config_h
1839 target_nptl="yes"
1841 m68k)
1842 echo "TARGET_ARCH=m68k" >> $config_mak
1843 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1844 echo "#define TARGET_M68K 1" >> $config_h
1845 bflt="yes"
1846 gdb_xml_files="cf-core.xml cf-fp.xml"
1848 mips|mipsel)
1849 echo "TARGET_ARCH=mips" >> $config_mak
1850 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1851 echo "#define TARGET_MIPS 1" >> $config_h
1852 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1854 mipsn32|mipsn32el)
1855 echo "TARGET_ARCH=mipsn32" >> $config_mak
1856 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1857 echo "#define TARGET_MIPS 1" >> $config_h
1858 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1860 mips64|mips64el)
1861 echo "TARGET_ARCH=mips64" >> $config_mak
1862 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1863 echo "#define TARGET_MIPS 1" >> $config_h
1864 echo "#define TARGET_MIPS64 1" >> $config_h
1865 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1867 ppc)
1868 echo "TARGET_ARCH=ppc" >> $config_mak
1869 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1870 echo "#define TARGET_PPC 1" >> $config_h
1871 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1873 ppcemb)
1874 echo "TARGET_ARCH=ppcemb" >> $config_mak
1875 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1876 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1877 echo "#define TARGET_PPC 1" >> $config_h
1878 echo "#define TARGET_PPCEMB 1" >> $config_h
1879 if test "$kvm" = "yes" ; then
1880 echo "CONFIG_KVM=yes" >> $config_mak
1881 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1882 echo "#define CONFIG_KVM 1" >> $config_h
1884 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1886 ppc64)
1887 echo "TARGET_ARCH=ppc64" >> $config_mak
1888 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1889 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1890 echo "#define TARGET_PPC 1" >> $config_h
1891 echo "#define TARGET_PPC64 1" >> $config_h
1892 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1894 ppc64abi32)
1895 echo "TARGET_ARCH=ppc64" >> $config_mak
1896 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1897 echo "TARGET_ARCH2=ppc64abi32" >> $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 echo "#define TARGET_ABI32 1" >> $config_h
1902 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1904 sh4|sh4eb)
1905 echo "TARGET_ARCH=sh4" >> $config_mak
1906 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1907 echo "#define TARGET_SH4 1" >> $config_h
1908 bflt="yes"
1909 target_nptl="yes"
1911 sparc)
1912 echo "TARGET_ARCH=sparc" >> $config_mak
1913 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1914 echo "#define TARGET_SPARC 1" >> $config_h
1916 sparc64)
1917 echo "TARGET_ARCH=sparc64" >> $config_mak
1918 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1919 echo "#define TARGET_SPARC 1" >> $config_h
1920 echo "#define TARGET_SPARC64 1" >> $config_h
1921 elfload32="yes"
1923 sparc32plus)
1924 echo "TARGET_ARCH=sparc64" >> $config_mak
1925 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1926 echo "TARGET_ARCH2=sparc32plus" >> $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 echo "#define TARGET_ABI32 1" >> $config_h
1933 echo "Unsupported target CPU"
1934 exit 1
1936 esac
1937 if test "$target_bigendian" = "yes" ; then
1938 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1939 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1941 if test "$target_softmmu" = "yes" ; then
1942 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1943 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1945 if test "$target_user_only" = "yes" ; then
1946 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1947 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1949 if test "$target_linux_user" = "yes" ; then
1950 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1951 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1953 if test "$target_darwin_user" = "yes" ; then
1954 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1955 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1957 list=""
1958 if test ! -z "$gdb_xml_files" ; then
1959 for x in $gdb_xml_files; do
1960 list="$list $source_path/gdb-xml/$x"
1961 done
1963 echo "TARGET_XML_FILES=$list" >> $config_mak
1965 if test "$target_cpu" = "arm" \
1966 -o "$target_cpu" = "armeb" \
1967 -o "$target_cpu" = "m68k" \
1968 -o "$target_cpu" = "mips" \
1969 -o "$target_cpu" = "mipsel" \
1970 -o "$target_cpu" = "mipsn32" \
1971 -o "$target_cpu" = "mipsn32el" \
1972 -o "$target_cpu" = "mips64" \
1973 -o "$target_cpu" = "mips64el" \
1974 -o "$target_cpu" = "ppc" \
1975 -o "$target_cpu" = "ppc64" \
1976 -o "$target_cpu" = "ppc64abi32" \
1977 -o "$target_cpu" = "ppcemb" \
1978 -o "$target_cpu" = "sparc" \
1979 -o "$target_cpu" = "sparc64" \
1980 -o "$target_cpu" = "sparc32plus"; then
1981 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1982 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1984 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1985 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1986 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1988 if test "$target_user_only" = "yes" \
1989 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1990 echo "#define USE_NPTL 1" >> $config_h
1992 # 32 bit ELF loader in addition to native 64 bit loader?
1993 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1994 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1995 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1997 if test "$target_bsd_user" = "yes" ; then
1998 echo "CONFIG_BSD_USER=yes" >> $config_mak
1999 echo "#define CONFIG_BSD_USER 1" >> $config_h
2002 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2004 done # for target in $targets
2006 # build tree in object directory if source path is different from current one
2007 if test "$source_path_used" = "yes" ; then
2008 DIRS="tests tests/cris slirp audio"
2009 FILES="Makefile tests/Makefile"
2010 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2011 FILES="$FILES tests/test-mmap.c"
2012 for dir in $DIRS ; do
2013 mkdir -p $dir
2014 done
2015 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2016 for f in $FILES ; do
2017 rm -f $f
2018 ln -s $source_path/$f $f
2019 done