Add SASL authentication support ("Daniel P. Berrange")
[qemu-kvm/fedora.git] / configure
blobe3522f22c2f5e397352ed628e6c2d201bcd89428
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="x86_64-softmmu"
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
156 kvm_version() {
157 local fname="$(dirname "$0")/KVM_VERSION"
159 if test -f "$fname"; then
160 cat "$fname"
161 else
162 echo "kvm-devel"
166 gprof="no"
167 sparse="no"
168 bigendian="no"
169 mingw32="no"
170 EXESUF=""
171 gdbstub="yes"
172 slirp="yes"
173 vde="yes"
174 fmod_lib=""
175 fmod_inc=""
176 oss_lib=""
177 vnc_tls="yes"
178 vnc_sasl="yes"
179 bsd="no"
180 linux="no"
181 solaris="no"
182 kqemu="no"
183 profiler="no"
184 cocoa="no"
185 check_gfx="yes"
186 softmmu="yes"
187 linux_user="no"
188 darwin_user="no"
189 bsd_user="no"
190 build_docs="no"
191 uname_release=""
192 curses="yes"
193 aio="yes"
194 nptl="yes"
195 mixemu="no"
196 bluez="yes"
197 kvm="yes"
198 kvm_cap_pit="no"
199 kvm_cap_device_assignment="no"
200 kerneldir=""
201 aix="no"
202 blobs="yes"
203 fdt="yes"
204 sdl_x11="no"
205 pkgversion="$(kvm_version)"
206 signalfd="no"
207 eventfd="no"
208 cpu_emulation="yes"
210 # OS specific
211 if check_define __linux__ ; then
212 targetos="Linux"
213 elif check_define _WIN32 ; then
214 targetos='MINGW32'
215 else
216 targetos=`uname -s`
218 case $targetos in
219 CYGWIN*)
220 mingw32="yes"
221 OS_CFLAGS="-mno-cygwin"
222 if [ "$cpu" = "i386" ] ; then
223 kqemu="yes"
225 audio_possible_drivers="sdl"
227 MINGW32*)
228 mingw32="yes"
229 if [ "$cpu" = "i386" ] ; then
230 kqemu="yes"
232 audio_possible_drivers="dsound sdl fmod"
234 GNU/kFreeBSD)
235 audio_drv_list="oss"
236 audio_possible_drivers="oss sdl esd pa"
237 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
238 kqemu="yes"
241 FreeBSD)
242 bsd="yes"
243 audio_drv_list="oss"
244 audio_possible_drivers="oss sdl esd pa"
245 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
246 kqemu="yes"
247 kvm="yes"
250 NetBSD)
251 bsd="yes"
252 audio_drv_list="oss"
253 audio_possible_drivers="oss sdl esd"
254 oss_lib="-lossaudio"
256 OpenBSD)
257 bsd="yes"
258 openbsd="yes"
259 audio_drv_list="oss"
260 audio_possible_drivers="oss sdl esd"
261 oss_lib="-lossaudio"
263 Darwin)
264 bsd="yes"
265 darwin="yes"
266 # 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
267 if [ "$cpu" = "i386" ] ; then
268 is_x86_64=`sysctl -n hw.optional.x86_64`
269 [ "$is_x86_64" = "1" ] && cpu=x86_64
271 if [ "$cpu" = "x86_64" ] ; then
272 OS_CFLAGS="-arch x86_64"
273 LDFLAGS="-arch x86_64"
274 else
275 OS_CFLAGS="-mdynamic-no-pic"
277 darwin_user="yes"
278 cocoa="yes"
279 audio_drv_list="coreaudio"
280 audio_possible_drivers="coreaudio sdl fmod"
281 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
283 SunOS)
284 solaris="yes"
285 make="gmake"
286 install="ginstall"
287 needs_libsunmath="no"
288 solarisrev=`uname -r | cut -f2 -d.`
289 # have to select again, because `uname -m` returns i86pc
290 # even on an x86_64 box.
291 solariscpu=`isainfo -k`
292 if test "${solariscpu}" = "amd64" ; then
293 cpu="x86_64"
295 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
296 if test "$solarisrev" -le 9 ; then
297 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
298 needs_libsunmath="yes"
299 else
300 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
301 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
302 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
303 echo "Studio 11 can be downloaded from www.sun.com."
304 exit 1
307 if test "$solarisrev" -ge 9 ; then
308 kqemu="yes"
311 if test -f /usr/include/sys/soundcard.h ; then
312 audio_drv_list="oss"
314 audio_possible_drivers="oss sdl"
316 AIX)
317 aix="yes"
318 make="gmake"
321 audio_drv_list="oss"
322 audio_possible_drivers="oss alsa sdl esd pa"
323 linux="yes"
324 linux_user="yes"
325 usb="linux"
326 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
327 kqemu="yes"
328 audio_possible_drivers="$audio_possible_drivers fmod"
329 kvm="yes"
330 kqemu="no"
332 if [ "$cpu" = "ia64" ] ; then
333 kvm="yes"
334 cpu_emulation="no"
335 gdbstub="no"
336 slirp="no"
338 if [ "$cpu" = "powerpc" ]; then
339 kvm="yes"
342 esac
344 if [ "$bsd" = "yes" ] ; then
345 if [ "$darwin" != "yes" ] ; then
346 make="gmake"
347 usb="bsd"
349 bsd_user="yes"
352 # find source path
353 source_path=`dirname "$0"`
354 source_path_used="no"
355 workdir=`pwd`
356 if [ -z "$source_path" ]; then
357 source_path=$workdir
358 else
359 source_path=`cd "$source_path"; pwd`
361 [ -f "$workdir/vl.c" ] || source_path_used="yes"
363 werror="no"
364 # generate compile errors on warnings for development builds
365 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
366 #werror="yes";
369 for opt do
370 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
371 case "$opt" in
372 --help|-h) show_help=yes
374 --prefix=*) prefix="$optarg"
376 --interp-prefix=*) interp_prefix="$optarg"
378 --source-path=*) source_path="$optarg"
379 source_path_used="yes"
381 --cross-prefix=*)
383 --cc=*)
385 --host-cc=*) host_cc="$optarg"
387 --make=*) make="$optarg"
389 --install=*) install="$optarg"
391 --extra-cflags=*) CFLAGS="$optarg"
393 --extra-ldflags=*) LDFLAGS="$optarg"
395 --cpu=*) cpu="$optarg"
397 --target-list=*) target_list="$optarg"
399 --enable-gprof) gprof="yes"
401 --static) static="yes"
403 --disable-sdl) sdl="no"
405 --fmod-lib=*) fmod_lib="$optarg"
407 --fmod-inc=*) fmod_inc="$optarg"
409 --oss-lib=*) oss_lib="$optarg"
411 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
413 --audio-drv-list=*) audio_drv_list="$optarg"
415 --enable-sparse) sparse="yes"
417 --disable-sparse) sparse="no"
419 --disable-vnc-tls) vnc_tls="no"
421 --disable-vnc-sasl) vnc_sasl="no"
423 --disable-slirp) slirp="no"
425 --disable-vde) vde="no"
427 --disable-kqemu) kqemu="no"
429 --disable-brlapi) brlapi="no"
431 --disable-bluez) bluez="no"
433 --disable-kvm) kvm="no"
435 --enable-profiler) profiler="yes"
437 --enable-cocoa)
438 cocoa="yes" ;
439 sdl="no" ;
440 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
442 --disable-gfx-check) check_gfx="no"
444 --disable-system) softmmu="no"
446 --enable-system) softmmu="yes"
448 --disable-linux-user) linux_user="no"
450 --enable-linux-user) linux_user="yes"
452 --disable-darwin-user) darwin_user="no"
454 --enable-darwin-user) darwin_user="yes"
456 --disable-bsd-user) bsd_user="no"
458 --enable-bsd-user) bsd_user="yes"
460 --enable-uname-release=*) uname_release="$optarg"
462 --sparc_cpu=*)
463 sparc_cpu="$optarg"
464 case $sparc_cpu in
465 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
466 target_cpu="sparc"; cpu="sparc" ;;
467 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
468 target_cpu="sparc"; cpu="sparc" ;;
469 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
470 target_cpu="sparc64"; cpu="sparc64" ;;
471 *) echo "undefined SPARC architecture. Exiting";exit 1;;
472 esac
474 --enable-werror) werror="yes"
476 --disable-werror) werror="no"
478 --disable-curses) curses="no"
480 --disable-nptl) nptl="no"
482 --enable-mixemu) mixemu="yes"
484 --disable-aio) aio="no"
486 --disable-blobs) blobs="no"
488 --kerneldir=*) kerneldir="$optarg"
490 --disable-cpu-emulation) cpu_emulation="no"
492 *) echo "ERROR: unknown option $opt"; exit 1
494 esac
495 done
497 # default flags for all hosts
498 CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
499 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
500 LDFLAGS="$LDFLAGS -g"
501 if test "$werror" = "yes" ; then
502 CFLAGS="$CFLAGS -Werror"
505 CFLAGS="$CFLAGS -I$(readlink -f "$source_path/kvm/libkvm")"
507 if test "$solaris" = "no" ; then
508 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
509 LDFLAGS="$LDFLAGS -Wl,--warn-common"
514 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
515 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
517 case "$cpu" in
518 sparc) if test -z "$sparc_cpu" ; then
519 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
520 ARCH_LDFLAGS="-m32"
521 else
522 ARCH_CFLAGS="${SP_CFLAGS}"
523 ARCH_LDFLAGS="${SP_LDFLAGS}"
526 sparc64) if test -z "$sparc_cpu" ; then
527 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
528 ARCH_LDFLAGS="-m64"
529 else
530 ARCH_CFLAGS="${SP_CFLAGS}"
531 ARCH_LDFLAGS="${SP_LDFLAGS}"
534 s390)
535 ARCH_CFLAGS="-march=z900"
537 i386)
538 ARCH_CFLAGS="-m32"
539 ARCH_LDFLAGS="-m32"
541 x86_64)
542 ARCH_CFLAGS="-m64"
543 ARCH_LDFLAGS="-m64"
545 esac
547 if test x"$show_help" = x"yes" ; then
548 cat << EOF
550 Usage: configure [options]
551 Options: [defaults in brackets after descriptions]
554 echo "Standard options:"
555 echo " --help print this message"
556 echo " --prefix=PREFIX install in PREFIX [$prefix]"
557 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
558 echo " use %M for cpu name [$interp_prefix]"
559 echo " --target-list=LIST set target list [$target_list]"
560 echo ""
561 echo "kqemu kernel acceleration support:"
562 echo " --disable-kqemu disable kqemu support"
563 echo ""
564 echo "Advanced options (experts only):"
565 echo " --source-path=PATH path of source code [$source_path]"
566 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
567 echo " --cc=CC use C compiler CC [$cc]"
568 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
569 echo " --make=MAKE use specified make [$make]"
570 echo " --install=INSTALL use specified install [$install]"
571 echo " --static enable static build [$static]"
572 echo " --enable-sparse enable sparse checker"
573 echo " --disable-sparse disable sparse checker (default)"
574 echo " --disable-werror disable compilation abort on warning"
575 echo " --disable-sdl disable SDL"
576 echo " --enable-cocoa enable COCOA (Mac OS X only)"
577 echo " --audio-drv-list=LIST set audio drivers list:"
578 echo " Available drivers: $audio_possible_drivers"
579 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
580 echo " Available cards: $audio_possible_cards"
581 echo " --enable-mixemu enable mixer emulation"
582 echo " --disable-brlapi disable BrlAPI"
583 echo " --disable-vnc-tls disable TLS encryption for VNC server"
584 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
585 echo " --disable-curses disable curses output"
586 echo " --disable-bluez disable bluez stack connectivity"
587 echo " --disable-kvm disable KVM acceleration support"
588 echo " --disable-nptl disable usermode NPTL support"
589 echo " --enable-system enable all system emulation targets"
590 echo " --disable-system disable all system emulation targets"
591 echo " --enable-linux-user enable all linux usermode emulation targets"
592 echo " --disable-linux-user disable all linux usermode emulation targets"
593 echo " --enable-darwin-user enable all darwin usermode emulation targets"
594 echo " --disable-darwin-user disable all darwin usermode emulation targets"
595 echo " --enable-bsd-user enable all BSD usermode emulation targets"
596 echo " --disable-bsd-user disable all BSD usermode emulation targets"
597 echo " --fmod-lib path to FMOD library"
598 echo " --fmod-inc path to FMOD includes"
599 echo " --oss-lib path to OSS library"
600 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
601 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
602 echo " --disable-vde disable support for vde network"
603 echo " --disable-aio disable AIO support"
604 echo " --disable-blobs disable installing provided firmware blobs"
605 echo " --kerneldir=PATH look for kernel includes in PATH"
606 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
607 echo ""
608 echo "NOTE: The object files are built at the place where configure is launched"
609 exit 1
612 if test "$mingw32" = "yes" ; then
613 linux="no"
614 EXESUF=".exe"
615 oss="no"
616 linux_user="no"
617 bsd_user="no"
620 if test ! -x "$(which cgcc 2>/dev/null)"; then
621 sparse="no"
625 # Solaris specific configure tool chain decisions
627 if test "$solaris" = "yes" ; then
628 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
629 if test -z "$solinst" ; then
630 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
631 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
632 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
633 exit 1
635 if test "$solinst" = "/usr/sbin/install" ; then
636 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
637 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
638 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
639 exit 1
641 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
642 if test -z "$sol_ar" ; then
643 echo "Error: No path includes ar"
644 if test -f /usr/ccs/bin/ar ; then
645 echo "Add /usr/ccs/bin to your path and rerun configure"
647 exit 1
652 if test -z "$target_list" ; then
653 # these targets are portable
654 if [ "$softmmu" = "yes" ] ; then
655 target_list="\
656 i386-softmmu \
657 x86_64-softmmu \
658 arm-softmmu \
659 cris-softmmu \
660 m68k-softmmu \
661 mips-softmmu \
662 mipsel-softmmu \
663 mips64-softmmu \
664 mips64el-softmmu \
665 ppc-softmmu \
666 ppcemb-softmmu \
667 ppc64-softmmu \
668 sh4-softmmu \
669 sh4eb-softmmu \
670 sparc-softmmu \
673 # the following are Linux specific
674 if [ "$linux_user" = "yes" ] ; then
675 target_list="${target_list}\
676 i386-linux-user \
677 x86_64-linux-user \
678 alpha-linux-user \
679 arm-linux-user \
680 armeb-linux-user \
681 cris-linux-user \
682 m68k-linux-user \
683 mips-linux-user \
684 mipsel-linux-user \
685 ppc-linux-user \
686 ppc64-linux-user \
687 ppc64abi32-linux-user \
688 sh4-linux-user \
689 sh4eb-linux-user \
690 sparc-linux-user \
691 sparc64-linux-user \
692 sparc32plus-linux-user \
695 # the following are Darwin specific
696 if [ "$darwin_user" = "yes" ] ; then
697 target_list="$target_list i386-darwin-user ppc-darwin-user "
699 # the following are BSD specific
700 if [ "$bsd_user" = "yes" ] ; then
701 target_list="${target_list}\
702 sparc64-bsd-user \
705 else
706 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
708 if test -z "$target_list" ; then
709 echo "No targets enabled"
710 exit 1
713 if test -z "$cross_prefix" ; then
715 # ---
716 # big/little endian test
717 cat > $TMPC << EOF
718 #include <inttypes.h>
719 int main(int argc, char ** argv){
720 volatile uint32_t i=0x01234567;
721 return (*((uint8_t*)(&i))) == 0x67;
725 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
726 $TMPE && bigendian="yes"
727 else
728 echo big/little test failed
731 else
733 # if cross compiling, cannot launch a program, so make a static guess
734 if test "$cpu" = "armv4b" \
735 -o "$cpu" = "hppa" \
736 -o "$cpu" = "m68k" \
737 -o "$cpu" = "mips" \
738 -o "$cpu" = "mips64" \
739 -o "$cpu" = "ppc" \
740 -o "$cpu" = "ppc64" \
741 -o "$cpu" = "s390" \
742 -o "$cpu" = "sparc" \
743 -o "$cpu" = "sparc64"; then
744 bigendian="yes"
749 # host long bits test
750 hostlongbits="32"
751 if test "$cpu" = "x86_64" \
752 -o "$cpu" = "alpha" \
753 -o "$cpu" = "ia64" \
754 -o "$cpu" = "sparc64" \
755 -o "$cpu" = "ppc64"; then
756 hostlongbits="64"
759 # check gcc options support
760 cat > $TMPC <<EOF
761 int main(void) {
765 # Check host NPTL support
766 cat > $TMPC <<EOF
767 #include <sched.h>
768 #include <linux/futex.h>
769 void foo()
771 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
772 #error bork
773 #endif
777 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
779 else
780 nptl="no"
783 ##########################################
784 # KVM probe
786 case "$cpu" in
787 i386 | x86_64)
788 kvm_arch="x86"
791 kvm_arch="$cpu"
793 esac
795 kvm_cflags=""
797 if test "$kvm" = "yes" ; then
799 kvm_cflags="-I$source_path/kvm/kernel/include"
800 kvm_cflags="$kvm_cflags -I$source_path/kvm/kernel/arch/$kvm_arch/include"
802 # test for KVM_CAP_PIT
804 cat > $TMPC <<EOF
805 #include <libkvm.h>
806 #ifndef KVM_CAP_PIT
807 #error "kvm no pit capability"
808 #endif
809 int main(void) { return 0; }
811 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
812 kvm_cap_pit="yes"
815 # test for KVM_CAP_DEVICE_ASSIGNMENT
817 cat > $TMPC <<EOF
818 #include <libkvm.h>
819 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
820 #error "kvm no device assignment capability"
821 #endif
822 int main(void) { return 0; }
824 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
825 kvm_cap_device_assignment="yes"
829 ##########################################
830 # zlib check
832 cat > $TMPC << EOF
833 #include <zlib.h>
834 int main(void) { zlibVersion(); return 0; }
836 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
838 else
839 echo
840 echo "Error: zlib check failed"
841 echo "Make sure to have the zlib libs and headers installed."
842 echo
843 exit 1
846 ##########################################
847 # SDL probe
849 sdl_too_old=no
851 if test -z "$sdl" ; then
852 sdl_config="sdl-config"
853 sdl=no
854 sdl_static=no
856 cat > $TMPC << EOF
857 #include <SDL.h>
858 #undef main /* We don't want SDL to override our main() */
859 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
861 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
862 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
863 if test "$_sdlversion" -lt 121 ; then
864 sdl_too_old=yes
865 else
866 if test "$cocoa" = "no" ; then
867 sdl=yes
871 # static link with sdl ?
872 if test "$sdl" = "yes" ; then
873 aa="no"
874 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
875 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
876 if [ "$aa" = "yes" ] ; then
877 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
880 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
881 sdl_static=yes
883 fi # static link
884 fi # sdl compile test
885 else
886 # Make sure to disable cocoa if sdl was set
887 if test "$sdl" = "yes" ; then
888 cocoa="no"
889 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
891 fi # -z $sdl
893 if test "$sdl" = "yes" ; then
894 cat > $TMPC <<EOF
895 #include <SDL.h>
896 #if defined(SDL_VIDEO_DRIVER_X11)
897 #include <X11/XKBlib.h>
898 #else
899 #error No x11 support
900 #endif
901 int main(void) { return 0; }
903 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
904 sdl_x11="yes"
908 ##########################################
909 # VNC TLS detection
910 if test "$vnc_tls" = "yes" ; then
911 cat > $TMPC <<EOF
912 #include <gnutls/gnutls.h>
913 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
915 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
916 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
917 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
918 $vnc_tls_libs > /dev/null 2> /dev/null ; then
920 else
921 vnc_tls="no"
925 ##########################################
926 # VNC SASL detection
927 if test "$vnc_sasl" = "yes" ; then
928 cat > $TMPC <<EOF
929 #include <sasl/sasl.h>
930 #include <stdio.h>
931 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
933 # Assuming Cyrus-SASL installed in /usr prefix
934 vnc_sasl_cflags=""
935 vnc_sasl_libs="-lsasl2"
936 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
937 $vnc_sasl_libs 2> /dev/null ; then
939 else
940 vnc_sasl="no"
944 ##########################################
945 # vde libraries probe
946 if test "$vde" = "yes" ; then
947 cat > $TMPC << EOF
948 #include <libvdeplug.h>
949 int main(void)
951 struct vde_open_args a = {0, 0, 0};
952 vde_open("", "", &a);
953 return 0;
956 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
958 else
959 vde="no"
963 ##########################################
964 # Sound support libraries probe
966 audio_drv_probe()
968 drv=$1
969 hdr=$2
970 lib=$3
971 exp=$4
972 cfl=$5
973 cat > $TMPC << EOF
974 #include <$hdr>
975 int main(void) { $exp }
977 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
979 else
980 echo
981 echo "Error: $drv check failed"
982 echo "Make sure to have the $drv libs and headers installed."
983 echo
984 exit 1
988 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
989 for drv in $audio_drv_list; do
990 case $drv in
991 alsa)
992 audio_drv_probe $drv alsa/asoundlib.h -lasound \
993 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
996 fmod)
997 if test -z $fmod_lib || test -z $fmod_inc; then
998 echo
999 echo "Error: You must specify path to FMOD library and headers"
1000 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1001 echo
1002 exit 1
1004 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1007 esd)
1008 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1012 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1013 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1016 oss|sdl|core|wav|dsound)
1017 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1021 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1022 echo
1023 echo "Error: Unknown driver '$drv' selected"
1024 echo "Possible drivers are: $audio_possible_drivers"
1025 echo
1026 exit 1
1029 esac
1030 done
1032 ##########################################
1033 # BrlAPI probe
1035 if test -z "$brlapi" ; then
1036 brlapi=no
1037 cat > $TMPC << EOF
1038 #include <brlapi.h>
1039 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1041 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1042 brlapi=yes
1043 fi # brlapi compile test
1044 fi # -z $brlapi
1046 ##########################################
1047 # curses probe
1049 if test "$curses" = "yes" ; then
1050 curses=no
1051 cat > $TMPC << EOF
1052 #include <curses.h>
1053 int main(void) { return curses_version(); }
1055 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1056 curses=yes
1058 fi # test "$curses"
1060 ##########################################
1061 # bluez support probe
1062 if test "$bluez" = "yes" ; then
1063 `pkg-config bluez` || bluez="no"
1065 if test "$bluez" = "yes" ; then
1066 cat > $TMPC << EOF
1067 #include <bluetooth/bluetooth.h>
1068 int main(void) { return bt_error(0); }
1070 bluez_cflags=`pkg-config --cflags bluez`
1071 bluez_libs=`pkg-config --libs bluez`
1072 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1073 $bluez_libs > /dev/null 2> /dev/null ; then
1075 else
1076 bluez="no"
1080 ##########################################
1081 # kvm probe
1082 if test "$kvm" = "yes" ; then
1083 cat > $TMPC <<EOF
1084 #include <linux/kvm.h>
1085 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1086 #error Invalid KVM version
1087 #endif
1088 #if !defined(KVM_CAP_USER_MEMORY)
1089 #error Missing KVM capability KVM_CAP_USER_MEMORY
1090 #endif
1091 #if !defined(KVM_CAP_SET_TSS_ADDR)
1092 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1093 #endif
1094 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1095 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1096 #endif
1097 int main(void) { return 0; }
1099 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1100 > /dev/null 2>/dev/null ; then
1102 else
1103 kvm="no";
1104 if [ -x "`which awk 2>/dev/null`" ] && \
1105 [ -x "`which grep 2>/dev/null`" ]; then
1106 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1107 | grep "error: " \
1108 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1109 if test "$kvmerr" != "" ; then
1110 kvm="no - (${kvmerr})"
1116 ##########################################
1117 # AIO probe
1118 AIOLIBS=""
1120 if test "$aio" = "yes" ; then
1121 aio=no
1122 cat > $TMPC << EOF
1123 #include <pthread.h>
1124 int main(void) { pthread_mutex_t lock; return 0; }
1126 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1127 aio=yes
1128 AIOLIBS="-lpthread"
1132 ##########################################
1133 # iovec probe
1134 cat > $TMPC <<EOF
1135 #include <sys/types.h>
1136 #include <sys/uio.h>
1137 #include <unistd.h>
1138 int main(void) { struct iovec iov; return 0; }
1140 iovec=no
1141 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1142 iovec=yes
1145 ##########################################
1146 # fdt probe
1147 if test "$fdt" = "yes" ; then
1148 fdt=no
1149 cat > $TMPC << EOF
1150 int main(void) { return 0; }
1152 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1153 fdt=yes
1157 ##########################################
1158 # signalfd probe
1159 cat > $TMPC << EOF
1160 #define _GNU_SOURCE
1161 #include <unistd.h>
1162 #include <sys/syscall.h>
1163 #include <signal.h>
1164 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1167 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1168 signalfd=yes
1171 ##########################################
1172 # eventfd probe
1173 cat > $TMPC << EOF
1174 #define _GNU_SOURCE
1175 #include <unistd.h>
1176 #include <sys/syscall.h>
1177 int main(void) { return syscall(SYS_eventfd, 0); }
1180 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1181 eventfd=yes
1184 # Check if tools are available to build documentation.
1185 if [ -x "`which texi2html 2>/dev/null`" ] && \
1186 [ -x "`which pod2man 2>/dev/null`" ]; then
1187 build_docs="yes"
1190 ##########################################
1191 # Do we need librt
1192 cat > $TMPC <<EOF
1193 #include <signal.h>
1194 #include <time.h>
1195 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1198 rt=no
1199 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1201 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1202 rt=yes
1205 if test "$rt" = "yes" ; then
1206 # Hack, we should have a general purpose LIBS for this sort of thing
1207 AIOLIBS="$AIOLIBS -lrt"
1210 if test "$mingw32" = "yes" ; then
1211 if test -z "$prefix" ; then
1212 prefix="c:\\\\Program Files\\\\Qemu"
1214 mansuffix=""
1215 datasuffix=""
1216 docsuffix=""
1217 binsuffix=""
1218 else
1219 if test -z "$prefix" ; then
1220 prefix="/usr/local"
1222 mansuffix="/share/man"
1223 datasuffix="/share/qemu"
1224 docsuffix="/share/doc/qemu"
1225 binsuffix="/bin"
1228 echo "Install prefix $prefix"
1229 echo "BIOS directory $prefix$datasuffix"
1230 echo "binary directory $prefix$binsuffix"
1231 if test "$mingw32" = "no" ; then
1232 echo "Manual directory $prefix$mansuffix"
1233 echo "ELF interp prefix $interp_prefix"
1235 echo "Source path $source_path"
1236 echo "C compiler $cc"
1237 echo "Host C compiler $host_cc"
1238 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1239 echo "make $make"
1240 echo "install $install"
1241 echo "host CPU $cpu"
1242 echo "host big endian $bigendian"
1243 echo "target list $target_list"
1244 echo "gprof enabled $gprof"
1245 echo "sparse enabled $sparse"
1246 echo "profiler $profiler"
1247 echo "static build $static"
1248 echo "-Werror enabled $werror"
1249 if test "$darwin" = "yes" ; then
1250 echo "Cocoa support $cocoa"
1252 echo "SDL support $sdl"
1253 if test "$sdl" != "no" ; then
1254 echo "SDL static link $sdl_static"
1256 echo "curses support $curses"
1257 echo "mingw32 support $mingw32"
1258 echo "Audio drivers $audio_drv_list"
1259 echo "Extra audio cards $audio_card_list"
1260 echo "Mixer emulation $mixemu"
1261 echo "VNC TLS support $vnc_tls"
1262 if test "$vnc_tls" = "yes" ; then
1263 echo " TLS CFLAGS $vnc_tls_cflags"
1264 echo " TLS LIBS $vnc_tls_libs"
1266 echo "VNC SASL support $vnc_sasl"
1267 if test "$vnc_sasl" = "yes" ; then
1268 echo " SASL CFLAGS $vnc_sasl_cflags"
1269 echo " SASL LIBS $vnc_sasl_libs"
1271 if test -n "$sparc_cpu"; then
1272 echo "Target Sparc Arch $sparc_cpu"
1274 echo "kqemu support $kqemu"
1275 echo "kvm support $kvm"
1276 echo "CPU emulation $cpu_emulation"
1277 echo "brlapi support $brlapi"
1278 echo "Documentation $build_docs"
1279 [ ! -z "$uname_release" ] && \
1280 echo "uname -r $uname_release"
1281 echo "NPTL support $nptl"
1282 echo "vde support $vde"
1283 echo "AIO support $aio"
1284 echo "Install blobs $blobs"
1285 echo "KVM support $kvm"
1286 echo "fdt support $fdt"
1288 if test $sdl_too_old = "yes"; then
1289 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1291 if [ -s $TMPSDLLOG ]; then
1292 echo "The error log from compiling the libSDL test is: "
1293 cat $TMPSDLLOG
1295 #if test "$sdl_static" = "no"; then
1296 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1298 config_mak="config-host.mak"
1299 config_h="config-host.h"
1301 #echo "Creating $config_mak and $config_h"
1303 test -f $config_h && mv $config_h ${config_h}~
1305 echo "# Automatically generated by configure - do not modify" > $config_mak
1306 printf "# Configured with:" >> $config_mak
1307 printf " '%s'" "$0" "$@" >> $config_mak
1308 echo >> $config_mak
1309 echo "/* Automatically generated by configure - do not modify */" > $config_h
1311 echo "prefix=$prefix" >> $config_mak
1312 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1313 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1314 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1315 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1316 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1317 echo "MAKE=$make" >> $config_mak
1318 echo "INSTALL=$install" >> $config_mak
1319 echo "CC=$cc" >> $config_mak
1320 echo "HOST_CC=$host_cc" >> $config_mak
1321 echo "AR=$ar" >> $config_mak
1322 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1323 # XXX: only use CFLAGS and LDFLAGS ?
1324 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1325 # compilation of dyngen tool (useful for win32 build on Linux host)
1326 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1327 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1328 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1329 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1330 echo "CFLAGS=$CFLAGS" >> $config_mak
1331 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1332 echo "EXESUF=$EXESUF" >> $config_mak
1333 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1334 case "$cpu" in
1335 i386)
1336 echo "ARCH=i386" >> $config_mak
1337 echo "#define HOST_I386 1" >> $config_h
1339 x86_64)
1340 echo "ARCH=x86_64" >> $config_mak
1341 echo "#define HOST_X86_64 1" >> $config_h
1343 alpha)
1344 echo "ARCH=alpha" >> $config_mak
1345 echo "#define HOST_ALPHA 1" >> $config_h
1347 armv4b)
1348 echo "ARCH=arm" >> $config_mak
1349 echo "#define HOST_ARM 1" >> $config_h
1351 armv4l)
1352 echo "ARCH=arm" >> $config_mak
1353 echo "#define HOST_ARM 1" >> $config_h
1355 cris)
1356 echo "ARCH=cris" >> $config_mak
1357 echo "#define HOST_CRIS 1" >> $config_h
1359 hppa)
1360 echo "ARCH=hppa" >> $config_mak
1361 echo "#define HOST_HPPA 1" >> $config_h
1363 ia64)
1364 echo "ARCH=ia64" >> $config_mak
1365 echo "#define HOST_IA64 1" >> $config_h
1367 m68k)
1368 echo "ARCH=m68k" >> $config_mak
1369 echo "#define HOST_M68K 1" >> $config_h
1371 mips)
1372 echo "ARCH=mips" >> $config_mak
1373 echo "#define HOST_MIPS 1" >> $config_h
1375 mips64)
1376 echo "ARCH=mips64" >> $config_mak
1377 echo "#define HOST_MIPS64 1" >> $config_h
1379 ppc)
1380 echo "ARCH=ppc" >> $config_mak
1381 echo "#define HOST_PPC 1" >> $config_h
1383 ppc64)
1384 echo "ARCH=ppc64" >> $config_mak
1385 echo "#define HOST_PPC64 1" >> $config_h
1387 s390)
1388 echo "ARCH=s390" >> $config_mak
1389 echo "#define HOST_S390 1" >> $config_h
1391 sparc)
1392 echo "ARCH=sparc" >> $config_mak
1393 echo "#define HOST_SPARC 1" >> $config_h
1395 sparc64)
1396 echo "ARCH=sparc64" >> $config_mak
1397 echo "#define HOST_SPARC64 1" >> $config_h
1400 echo "Unsupported CPU = $cpu"
1401 exit 1
1403 esac
1404 if test "$sparse" = "yes" ; then
1405 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1406 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1407 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1409 if test "$bigendian" = "yes" ; then
1410 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1411 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1413 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1414 if test "$mingw32" = "yes" ; then
1415 echo "CONFIG_WIN32=yes" >> $config_mak
1416 echo "#define CONFIG_WIN32 1" >> $config_h
1417 else
1418 cat > $TMPC << EOF
1419 #include <byteswap.h>
1420 int main(void) { return bswap_32(0); }
1422 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1423 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1425 cat > $TMPC << EOF
1426 #include <sys/endian.h>
1427 #include <sys/types.h>
1428 #include <machine/bswap.h>
1429 int main(void) { return bswap32(0); }
1431 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1432 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1436 if [ "$openbsd" = "yes" ] ; then
1437 echo "#define ENOTSUP 4096" >> $config_h
1440 if test "$darwin" = "yes" ; then
1441 echo "CONFIG_DARWIN=yes" >> $config_mak
1442 echo "#define CONFIG_DARWIN 1" >> $config_h
1445 if test "$aix" = "yes" ; then
1446 echo "CONFIG_AIX=yes" >> $config_mak
1447 echo "#define CONFIG_AIX 1" >> $config_h
1450 if test "$solaris" = "yes" ; then
1451 echo "CONFIG_SOLARIS=yes" >> $config_mak
1452 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1453 if test "$needs_libsunmath" = "yes" ; then
1454 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1455 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1458 if test -n "$sparc_cpu"; then
1459 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1460 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1462 if test "$gdbstub" = "yes" ; then
1463 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1464 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1466 if test "$gprof" = "yes" ; then
1467 echo "TARGET_GPROF=yes" >> $config_mak
1468 echo "#define HAVE_GPROF 1" >> $config_h
1470 if test "$static" = "yes" ; then
1471 echo "CONFIG_STATIC=yes" >> $config_mak
1472 echo "#define CONFIG_STATIC 1" >> $config_h
1474 if test $profiler = "yes" ; then
1475 echo "#define CONFIG_PROFILER 1" >> $config_h
1477 if test "$slirp" = "yes" ; then
1478 echo "CONFIG_SLIRP=yes" >> $config_mak
1479 echo "#define CONFIG_SLIRP 1" >> $config_h
1481 if test "$vde" = "yes" ; then
1482 echo "CONFIG_VDE=yes" >> $config_mak
1483 echo "#define CONFIG_VDE 1" >> $config_h
1484 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1486 for card in $audio_card_list; do
1487 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1488 echo "$def=yes" >> $config_mak
1489 echo "#define $def 1" >> $config_h
1490 done
1491 echo "#define AUDIO_DRIVERS \\" >> $config_h
1492 for drv in $audio_drv_list; do
1493 echo " &${drv}_audio_driver, \\" >>$config_h
1494 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1495 echo "$def=yes" >> $config_mak
1496 if test "$drv" = "fmod"; then
1497 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1498 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1499 elif test "$drv" = "oss"; then
1500 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1502 done
1503 echo "" >>$config_h
1504 if test "$mixemu" = "yes" ; then
1505 echo "CONFIG_MIXEMU=yes" >> $config_mak
1506 echo "#define CONFIG_MIXEMU 1" >> $config_h
1508 if test "$vnc_tls" = "yes" ; then
1509 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1510 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1511 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1512 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1514 if test "$vnc_sasl" = "yes" ; then
1515 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1516 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1517 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1518 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1520 qemu_version=`head $source_path/VERSION`
1521 echo "VERSION=$qemu_version" >>$config_mak
1522 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1523 echo "#define KVM_VERSION \"${pkgversion}\"" >> $config_h
1525 echo "SRC_PATH=$source_path" >> $config_mak
1526 if [ "$source_path_used" = "yes" ]; then
1527 echo "VPATH=$source_path" >> $config_mak
1529 echo "TARGET_DIRS=$target_list" >> $config_mak
1530 if [ "$build_docs" = "yes" ] ; then
1531 echo "BUILD_DOCS=yes" >> $config_mak
1533 if test "$static" = "yes"; then
1534 sdl1=$sdl_static
1535 else
1536 sdl1=$sdl
1538 if test "$sdl1" = "yes" ; then
1539 echo "#define CONFIG_SDL 1" >> $config_h
1540 echo "CONFIG_SDL=yes" >> $config_mak
1541 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1542 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1543 elif test "$sdl_x11" = "yes" ; then
1544 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1545 else
1546 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1548 if [ "${aa}" = "yes" ] ; then
1549 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1550 else
1551 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1554 if test "$cocoa" = "yes" ; then
1555 echo "#define CONFIG_COCOA 1" >> $config_h
1556 echo "CONFIG_COCOA=yes" >> $config_mak
1558 if test "$curses" = "yes" ; then
1559 echo "#define CONFIG_CURSES 1" >> $config_h
1560 echo "CONFIG_CURSES=yes" >> $config_mak
1561 echo "CURSES_LIBS=-lcurses" >> $config_mak
1563 if test "$brlapi" = "yes" ; then
1564 echo "CONFIG_BRLAPI=yes" >> $config_mak
1565 echo "#define CONFIG_BRLAPI 1" >> $config_h
1566 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1568 if test "$bluez" = "yes" ; then
1569 echo "CONFIG_BLUEZ=yes" >> $config_mak
1570 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1571 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1572 echo "#define CONFIG_BLUEZ 1" >> $config_h
1574 if test "$aio" = "yes" ; then
1575 echo "#define CONFIG_AIO 1" >> $config_h
1576 echo "CONFIG_AIO=yes" >> $config_mak
1578 if test "$blobs" = "yes" ; then
1579 echo "INSTALL_BLOBS=yes" >> $config_mak
1581 if test "$iovec" = "yes" ; then
1582 echo "#define HAVE_IOVEC 1" >> $config_h
1584 if test "$fdt" = "yes" ; then
1585 echo "#define HAVE_FDT 1" >> $config_h
1586 echo "FDT_LIBS=-lfdt" >> $config_mak
1588 if test "$signalfd" = "yes" ; then
1589 echo "#define CONFIG_signalfd 1" >> $config_h
1591 if test "$eventfd" = "yes" ; then
1592 echo "#define CONFIG_eventfd 1" >> $config_h
1595 # XXX: suppress that
1596 if [ "$bsd" = "yes" ] ; then
1597 echo "#define O_LARGEFILE 0" >> $config_h
1598 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1599 echo "#define _BSD 1" >> $config_h
1602 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1604 # USB host support
1605 case "$usb" in
1606 linux)
1607 echo "HOST_USB=linux" >> $config_mak
1609 bsd)
1610 echo "HOST_USB=bsd" >> $config_mak
1613 echo "HOST_USB=stub" >> $config_mak
1615 esac
1617 # this is a temp hack needed for libkvm
1618 if test "$kvm" = "yes" ; then
1619 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1622 tools=
1623 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1624 tools="qemu-img\$(EXESUF) $tools"
1625 if [ "$linux" = "yes" ] ; then
1626 tools="qemu-nbd\$(EXESUF) $tools"
1629 echo "TOOLS=$tools" >> $config_mak
1631 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1633 for target in $target_list; do
1634 target_dir="$target"
1635 config_mak=$target_dir/config.mak
1636 config_h=$target_dir/config.h
1637 target_cpu=`echo $target | cut -d '-' -f 1`
1638 target_bigendian="no"
1639 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1640 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1641 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1642 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1643 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1644 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1645 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1646 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1647 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1648 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1649 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1650 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1651 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1652 target_softmmu="no"
1653 target_user_only="no"
1654 target_linux_user="no"
1655 target_darwin_user="no"
1656 target_bsd_user="no"
1657 case "$target" in
1658 ${target_cpu}-softmmu)
1659 target_softmmu="yes"
1661 ${target_cpu}-linux-user)
1662 target_user_only="yes"
1663 target_linux_user="yes"
1665 ${target_cpu}-darwin-user)
1666 target_user_only="yes"
1667 target_darwin_user="yes"
1669 ${target_cpu}-bsd-user)
1670 target_user_only="yes"
1671 target_bsd_user="yes"
1674 echo "ERROR: Target '$target' not recognised"
1675 exit 1
1677 esac
1679 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1680 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1681 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1682 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1683 echo "Note that this will disable all output from the virtual graphics card"
1684 echo "except through VNC or curses."
1685 exit 1;
1688 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1690 test -f $config_h && mv $config_h ${config_h}~
1692 mkdir -p $target_dir
1693 mkdir -p $target_dir/fpu
1694 mkdir -p $target_dir/tcg
1695 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1696 mkdir -p $target_dir/nwfpe
1700 # don't use ln -sf as not all "ln -sf" over write the file/link
1702 rm -f $target_dir/Makefile
1703 ln -s $source_path/Makefile.target $target_dir/Makefile
1706 echo "# Automatically generated by configure - do not modify" > $config_mak
1707 echo "/* Automatically generated by configure - do not modify */" > $config_h
1710 echo "include ../config-host.mak" >> $config_mak
1711 echo "#include \"../config-host.h\"" >> $config_h
1713 bflt="no"
1714 elfload32="no"
1715 target_nptl="no"
1716 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1717 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1718 gdb_xml_files=""
1720 disable_cpu_emulation() {
1721 if test $cpu_emulation = "no"; then
1722 echo "#define NO_CPU_EMULATION 1" >> $config_h
1723 echo "NO_CPU_EMULATION=1" >> $config_mak
1727 configure_kvm() {
1728 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1729 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1730 echo "#define USE_KVM 1" >> $config_h
1731 echo "USE_KVM=1" >> $config_mak
1732 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1733 if test $kvm_cap_pit = "yes" ; then
1734 echo "USE_KVM_PIT=1" >> $config_mak
1735 echo "#define USE_KVM_PIT 1" >> $config_h
1737 if test $kvm_cap_device_assignment = "yes" ; then
1738 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1739 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1741 disable_cpu_emulation
1745 if [ use_upstream_kvm = yes ]; then
1747 # Make sure the target and host cpus are compatible
1748 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1749 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1750 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1751 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1752 kvm="no"
1754 # Disable KVM for linux-user
1755 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1756 kvm="no"
1761 case "$target_cpu" in
1762 i386)
1763 echo "TARGET_ARCH=i386" >> $config_mak
1764 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1765 echo "#define TARGET_I386 1" >> $config_h
1766 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1767 then
1768 echo "#define USE_KQEMU 1" >> $config_h
1770 if test "$kvm" = "yes" ; then
1771 echo "USE_KVM=yes" >> $config_mak
1772 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1773 echo "#define USE_KVM 1" >> $config_h
1775 configure_kvm
1777 x86_64)
1778 echo "TARGET_ARCH=x86_64" >> $config_mak
1779 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1780 echo "#define TARGET_I386 1" >> $config_h
1781 echo "#define TARGET_X86_64 1" >> $config_h
1782 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1783 then
1784 echo "#define USE_KQEMU 1" >> $config_h
1786 configure_kvm
1788 ia64)
1789 echo "TARGET_ARCH=ia64" >> $config_mak
1790 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1791 echo "#define TARGET_IA64 1" >> $config_h
1792 configure_kvm
1793 if [ use_upstream_kvm = yes ]; then
1794 if test "$kvm" = "yes" ; then
1795 echo "USE_KVM=yes" >> $config_mak
1796 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1797 echo "#define USE_KVM 1" >> $config_h
1801 alpha)
1802 echo "TARGET_ARCH=alpha" >> $config_mak
1803 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1804 echo "#define TARGET_ALPHA 1" >> $config_h
1806 arm|armeb)
1807 echo "TARGET_ARCH=arm" >> $config_mak
1808 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1809 echo "#define TARGET_ARM 1" >> $config_h
1810 bflt="yes"
1811 target_nptl="yes"
1812 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1814 cris)
1815 echo "TARGET_ARCH=cris" >> $config_mak
1816 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1817 echo "#define TARGET_CRIS 1" >> $config_h
1818 target_nptl="yes"
1820 m68k)
1821 echo "TARGET_ARCH=m68k" >> $config_mak
1822 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1823 echo "#define TARGET_M68K 1" >> $config_h
1824 bflt="yes"
1825 gdb_xml_files="cf-core.xml cf-fp.xml"
1827 mips|mipsel)
1828 echo "TARGET_ARCH=mips" >> $config_mak
1829 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1830 echo "#define TARGET_MIPS 1" >> $config_h
1831 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1833 mipsn32|mipsn32el)
1834 echo "TARGET_ARCH=mipsn32" >> $config_mak
1835 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1836 echo "#define TARGET_MIPS 1" >> $config_h
1837 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1839 mips64|mips64el)
1840 echo "TARGET_ARCH=mips64" >> $config_mak
1841 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1842 echo "#define TARGET_MIPS 1" >> $config_h
1843 echo "#define TARGET_MIPS64 1" >> $config_h
1844 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1846 ppc)
1847 echo "TARGET_ARCH=ppc" >> $config_mak
1848 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1849 echo "#define TARGET_PPC 1" >> $config_h
1850 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1852 ppcemb)
1853 echo "TARGET_ARCH=ppcemb" >> $config_mak
1854 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1855 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1856 echo "#define TARGET_PPC 1" >> $config_h
1857 echo "#define TARGET_PPCEMB 1" >> $config_h
1858 if test "$kvm" = "yes" ; then
1859 echo "USE_KVM=yes" >> $config_mak
1860 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1861 echo "#define USE_KVM 1" >> $config_h
1863 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1865 ppc64)
1866 echo "TARGET_ARCH=ppc64" >> $config_mak
1867 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1868 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1869 echo "#define TARGET_PPC 1" >> $config_h
1870 echo "#define TARGET_PPC64 1" >> $config_h
1871 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1873 ppc64abi32)
1874 echo "TARGET_ARCH=ppc64" >> $config_mak
1875 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1876 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1877 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1878 echo "#define TARGET_PPC 1" >> $config_h
1879 echo "#define TARGET_PPC64 1" >> $config_h
1880 echo "#define TARGET_ABI32 1" >> $config_h
1881 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1883 sh4|sh4eb)
1884 echo "TARGET_ARCH=sh4" >> $config_mak
1885 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1886 echo "#define TARGET_SH4 1" >> $config_h
1887 bflt="yes"
1888 target_nptl="yes"
1890 sparc)
1891 echo "TARGET_ARCH=sparc" >> $config_mak
1892 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1893 echo "#define TARGET_SPARC 1" >> $config_h
1895 sparc64)
1896 echo "TARGET_ARCH=sparc64" >> $config_mak
1897 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1898 echo "#define TARGET_SPARC 1" >> $config_h
1899 echo "#define TARGET_SPARC64 1" >> $config_h
1900 elfload32="yes"
1902 sparc32plus)
1903 echo "TARGET_ARCH=sparc64" >> $config_mak
1904 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1905 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1906 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1907 echo "#define TARGET_SPARC 1" >> $config_h
1908 echo "#define TARGET_SPARC64 1" >> $config_h
1909 echo "#define TARGET_ABI32 1" >> $config_h
1912 echo "Unsupported target CPU"
1913 exit 1
1915 esac
1916 if test "$target_bigendian" = "yes" ; then
1917 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1918 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1920 if test "$target_softmmu" = "yes" ; then
1921 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1922 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1924 if test "$target_user_only" = "yes" ; then
1925 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1926 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1928 if test "$target_linux_user" = "yes" ; then
1929 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1930 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1932 if test "$target_darwin_user" = "yes" ; then
1933 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1934 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1936 list=""
1937 if test ! -z "$gdb_xml_files" ; then
1938 for x in $gdb_xml_files; do
1939 list="$list $source_path/gdb-xml/$x"
1940 done
1942 echo "TARGET_XML_FILES=$list" >> $config_mak
1944 if test "$target_cpu" = "arm" \
1945 -o "$target_cpu" = "armeb" \
1946 -o "$target_cpu" = "m68k" \
1947 -o "$target_cpu" = "mips" \
1948 -o "$target_cpu" = "mipsel" \
1949 -o "$target_cpu" = "mipsn32" \
1950 -o "$target_cpu" = "mipsn32el" \
1951 -o "$target_cpu" = "mips64" \
1952 -o "$target_cpu" = "mips64el" \
1953 -o "$target_cpu" = "ppc" \
1954 -o "$target_cpu" = "ppc64" \
1955 -o "$target_cpu" = "ppc64abi32" \
1956 -o "$target_cpu" = "ppcemb" \
1957 -o "$target_cpu" = "sparc" \
1958 -o "$target_cpu" = "sparc64" \
1959 -o "$target_cpu" = "sparc32plus"; then
1960 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1961 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1963 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1964 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1965 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1967 if test "$target_user_only" = "yes" \
1968 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1969 echo "#define USE_NPTL 1" >> $config_h
1971 # 32 bit ELF loader in addition to native 64 bit loader?
1972 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1973 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1974 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1976 if test "$target_bsd_user" = "yes" ; then
1977 echo "CONFIG_BSD_USER=yes" >> $config_mak
1978 echo "#define CONFIG_BSD_USER 1" >> $config_h
1981 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1983 done # for target in $targets
1985 # build tree in object directory if source path is different from current one
1986 if test "$source_path_used" = "yes" ; then
1987 DIRS="tests tests/cris slirp audio kvm/libkvm"
1988 FILES="Makefile tests/Makefile"
1989 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1990 FILES="$FILES tests/test-mmap.c"
1991 FILES="$FILES kvm/libkvm/Makefile"
1992 for dir in $DIRS ; do
1993 mkdir -p $dir
1994 done
1995 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1996 for f in $FILES ; do
1997 rm -f $f
1998 ln -s $source_path/$f $f
1999 done