Make binary stripping conditional (Riku Voipio)
[qemu-kvm/fedora.git] / configure
blob2fed69242a32cd2249f686b8c426a94766edf542
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 strip_opt="yes"
169 bigendian="no"
170 mingw32="no"
171 EXESUF=""
172 gdbstub="yes"
173 slirp="yes"
174 vde="yes"
175 fmod_lib=""
176 fmod_inc=""
177 oss_lib=""
178 vnc_tls="yes"
179 vnc_sasl="yes"
180 bsd="no"
181 linux="no"
182 solaris="no"
183 kqemu="no"
184 profiler="no"
185 cocoa="no"
186 check_gfx="yes"
187 softmmu="yes"
188 linux_user="no"
189 darwin_user="no"
190 bsd_user="no"
191 build_docs="no"
192 uname_release=""
193 curses="yes"
194 aio="yes"
195 nptl="yes"
196 mixemu="no"
197 bluez="yes"
198 kvm="yes"
199 kvm_cap_pit="no"
200 kvm_cap_device_assignment="no"
201 kerneldir=""
202 aix="no"
203 blobs="yes"
204 fdt="yes"
205 sdl_x11="no"
206 pkgversion="$(kvm_version)"
207 signalfd="no"
208 eventfd="no"
209 cpu_emulation="yes"
211 # OS specific
212 if check_define __linux__ ; then
213 targetos="Linux"
214 elif check_define _WIN32 ; then
215 targetos='MINGW32'
216 else
217 targetos=`uname -s`
219 case $targetos in
220 CYGWIN*)
221 mingw32="yes"
222 OS_CFLAGS="-mno-cygwin"
223 if [ "$cpu" = "i386" ] ; then
224 kqemu="yes"
226 audio_possible_drivers="sdl"
228 MINGW32*)
229 mingw32="yes"
230 if [ "$cpu" = "i386" ] ; then
231 kqemu="yes"
233 audio_possible_drivers="dsound sdl fmod"
235 GNU/kFreeBSD)
236 audio_drv_list="oss"
237 audio_possible_drivers="oss sdl esd pa"
238 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
239 kqemu="yes"
242 FreeBSD)
243 bsd="yes"
244 audio_drv_list="oss"
245 audio_possible_drivers="oss sdl esd pa"
246 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
247 kqemu="yes"
248 kvm="yes"
251 NetBSD)
252 bsd="yes"
253 audio_drv_list="oss"
254 audio_possible_drivers="oss sdl esd"
255 oss_lib="-lossaudio"
257 OpenBSD)
258 bsd="yes"
259 openbsd="yes"
260 audio_drv_list="oss"
261 audio_possible_drivers="oss sdl esd"
262 oss_lib="-lossaudio"
264 Darwin)
265 bsd="yes"
266 darwin="yes"
267 # 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
268 if [ "$cpu" = "i386" ] ; then
269 is_x86_64=`sysctl -n hw.optional.x86_64`
270 [ "$is_x86_64" = "1" ] && cpu=x86_64
272 if [ "$cpu" = "x86_64" ] ; then
273 OS_CFLAGS="-arch x86_64"
274 LDFLAGS="-arch x86_64"
275 else
276 OS_CFLAGS="-mdynamic-no-pic"
278 darwin_user="yes"
279 cocoa="yes"
280 audio_drv_list="coreaudio"
281 audio_possible_drivers="coreaudio sdl fmod"
282 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
284 SunOS)
285 solaris="yes"
286 make="gmake"
287 install="ginstall"
288 needs_libsunmath="no"
289 solarisrev=`uname -r | cut -f2 -d.`
290 # have to select again, because `uname -m` returns i86pc
291 # even on an x86_64 box.
292 solariscpu=`isainfo -k`
293 if test "${solariscpu}" = "amd64" ; then
294 cpu="x86_64"
296 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
297 if test "$solarisrev" -le 9 ; then
298 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
299 needs_libsunmath="yes"
300 else
301 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
302 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
303 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
304 echo "Studio 11 can be downloaded from www.sun.com."
305 exit 1
308 if test "$solarisrev" -ge 9 ; then
309 kqemu="yes"
312 if test -f /usr/include/sys/soundcard.h ; then
313 audio_drv_list="oss"
315 audio_possible_drivers="oss sdl"
317 AIX)
318 aix="yes"
319 make="gmake"
322 audio_drv_list="oss"
323 audio_possible_drivers="oss alsa sdl esd pa"
324 linux="yes"
325 linux_user="yes"
326 usb="linux"
327 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
328 kqemu="yes"
329 audio_possible_drivers="$audio_possible_drivers fmod"
330 kvm="yes"
331 kqemu="no"
333 if [ "$cpu" = "ia64" ] ; then
334 kvm="yes"
335 cpu_emulation="no"
336 gdbstub="no"
337 slirp="no"
339 if [ "$cpu" = "powerpc" ]; then
340 kvm="yes"
343 esac
345 if [ "$bsd" = "yes" ] ; then
346 if [ "$darwin" != "yes" ] ; then
347 make="gmake"
348 usb="bsd"
350 bsd_user="yes"
353 # find source path
354 source_path=`dirname "$0"`
355 source_path_used="no"
356 workdir=`pwd`
357 if [ -z "$source_path" ]; then
358 source_path=$workdir
359 else
360 source_path=`cd "$source_path"; pwd`
362 [ -f "$workdir/vl.c" ] || source_path_used="yes"
364 werror="no"
365 # generate compile errors on warnings for development builds
366 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
367 #werror="yes";
370 for opt do
371 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
372 case "$opt" in
373 --help|-h) show_help=yes
375 --prefix=*) prefix="$optarg"
377 --interp-prefix=*) interp_prefix="$optarg"
379 --source-path=*) source_path="$optarg"
380 source_path_used="yes"
382 --cross-prefix=*)
384 --cc=*)
386 --host-cc=*) host_cc="$optarg"
388 --make=*) make="$optarg"
390 --install=*) install="$optarg"
392 --extra-cflags=*) CFLAGS="$optarg"
394 --extra-ldflags=*) LDFLAGS="$optarg"
396 --cpu=*) cpu="$optarg"
398 --target-list=*) target_list="$optarg"
400 --enable-gprof) gprof="yes"
402 --static) static="yes"
404 --disable-sdl) sdl="no"
406 --fmod-lib=*) fmod_lib="$optarg"
408 --fmod-inc=*) fmod_inc="$optarg"
410 --oss-lib=*) oss_lib="$optarg"
412 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
414 --audio-drv-list=*) audio_drv_list="$optarg"
416 --enable-sparse) sparse="yes"
418 --disable-sparse) sparse="no"
420 --disable-strip) strip_opt="no"
422 --disable-vnc-tls) vnc_tls="no"
424 --disable-vnc-sasl) vnc_sasl="no"
426 --disable-slirp) slirp="no"
428 --disable-vde) vde="no"
430 --disable-kqemu) kqemu="no"
432 --disable-brlapi) brlapi="no"
434 --disable-bluez) bluez="no"
436 --disable-kvm) kvm="no"
438 --enable-profiler) profiler="yes"
440 --enable-cocoa)
441 cocoa="yes" ;
442 sdl="no" ;
443 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
445 --disable-gfx-check) check_gfx="no"
447 --disable-system) softmmu="no"
449 --enable-system) softmmu="yes"
451 --disable-linux-user) linux_user="no"
453 --enable-linux-user) linux_user="yes"
455 --disable-darwin-user) darwin_user="no"
457 --enable-darwin-user) darwin_user="yes"
459 --disable-bsd-user) bsd_user="no"
461 --enable-bsd-user) bsd_user="yes"
463 --enable-uname-release=*) uname_release="$optarg"
465 --sparc_cpu=*)
466 sparc_cpu="$optarg"
467 case $sparc_cpu in
468 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
469 target_cpu="sparc"; cpu="sparc" ;;
470 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
471 target_cpu="sparc"; cpu="sparc" ;;
472 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
473 target_cpu="sparc64"; cpu="sparc64" ;;
474 *) echo "undefined SPARC architecture. Exiting";exit 1;;
475 esac
477 --enable-werror) werror="yes"
479 --disable-werror) werror="no"
481 --disable-curses) curses="no"
483 --disable-nptl) nptl="no"
485 --enable-mixemu) mixemu="yes"
487 --disable-aio) aio="no"
489 --disable-blobs) blobs="no"
491 --kerneldir=*) kerneldir="$optarg"
493 --disable-cpu-emulation) cpu_emulation="no"
495 *) echo "ERROR: unknown option $opt"; exit 1
497 esac
498 done
500 # default flags for all hosts
501 CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
502 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
503 LDFLAGS="$LDFLAGS -g"
504 if test "$werror" = "yes" ; then
505 CFLAGS="$CFLAGS -Werror"
508 CFLAGS="$CFLAGS -I$(readlink -f "$source_path/kvm/libkvm")"
510 if test "$solaris" = "no" ; then
511 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
512 LDFLAGS="$LDFLAGS -Wl,--warn-common"
517 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
518 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
520 case "$cpu" in
521 sparc) if test -z "$sparc_cpu" ; then
522 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
523 ARCH_LDFLAGS="-m32"
524 else
525 ARCH_CFLAGS="${SP_CFLAGS}"
526 ARCH_LDFLAGS="${SP_LDFLAGS}"
529 sparc64) if test -z "$sparc_cpu" ; then
530 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
531 ARCH_LDFLAGS="-m64"
532 else
533 ARCH_CFLAGS="${SP_CFLAGS}"
534 ARCH_LDFLAGS="${SP_LDFLAGS}"
537 s390)
538 ARCH_CFLAGS="-march=z900"
540 i386)
541 ARCH_CFLAGS="-m32"
542 ARCH_LDFLAGS="-m32"
544 x86_64)
545 ARCH_CFLAGS="-m64"
546 ARCH_LDFLAGS="-m64"
548 esac
550 if test x"$show_help" = x"yes" ; then
551 cat << EOF
553 Usage: configure [options]
554 Options: [defaults in brackets after descriptions]
557 echo "Standard options:"
558 echo " --help print this message"
559 echo " --prefix=PREFIX install in PREFIX [$prefix]"
560 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
561 echo " use %M for cpu name [$interp_prefix]"
562 echo " --target-list=LIST set target list [$target_list]"
563 echo ""
564 echo "kqemu kernel acceleration support:"
565 echo " --disable-kqemu disable kqemu support"
566 echo ""
567 echo "Advanced options (experts only):"
568 echo " --source-path=PATH path of source code [$source_path]"
569 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
570 echo " --cc=CC use C compiler CC [$cc]"
571 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
572 echo " --make=MAKE use specified make [$make]"
573 echo " --install=INSTALL use specified install [$install]"
574 echo " --static enable static build [$static]"
575 echo " --enable-sparse enable sparse checker"
576 echo " --disable-sparse disable sparse checker (default)"
577 echo " --disable-strip disable stripping binaries"
578 echo " --disable-werror disable compilation abort on warning"
579 echo " --disable-sdl disable SDL"
580 echo " --enable-cocoa enable COCOA (Mac OS X only)"
581 echo " --audio-drv-list=LIST set audio drivers list:"
582 echo " Available drivers: $audio_possible_drivers"
583 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
584 echo " Available cards: $audio_possible_cards"
585 echo " --enable-mixemu enable mixer emulation"
586 echo " --disable-brlapi disable BrlAPI"
587 echo " --disable-vnc-tls disable TLS encryption for VNC server"
588 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
589 echo " --disable-curses disable curses output"
590 echo " --disable-bluez disable bluez stack connectivity"
591 echo " --disable-kvm disable KVM acceleration support"
592 echo " --disable-nptl disable usermode NPTL support"
593 echo " --enable-system enable all system emulation targets"
594 echo " --disable-system disable all system emulation targets"
595 echo " --enable-linux-user enable all linux usermode emulation targets"
596 echo " --disable-linux-user disable all linux usermode emulation targets"
597 echo " --enable-darwin-user enable all darwin usermode emulation targets"
598 echo " --disable-darwin-user disable all darwin usermode emulation targets"
599 echo " --enable-bsd-user enable all BSD usermode emulation targets"
600 echo " --disable-bsd-user disable all BSD usermode emulation targets"
601 echo " --fmod-lib path to FMOD library"
602 echo " --fmod-inc path to FMOD includes"
603 echo " --oss-lib path to OSS library"
604 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
605 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
606 echo " --disable-vde disable support for vde network"
607 echo " --disable-aio disable AIO support"
608 echo " --disable-blobs disable installing provided firmware blobs"
609 echo " --kerneldir=PATH look for kernel includes in PATH"
610 echo " --disable-cpu-emulation disables use of qemu cpu emulation code"
611 echo ""
612 echo "NOTE: The object files are built at the place where configure is launched"
613 exit 1
616 if test "$mingw32" = "yes" ; then
617 linux="no"
618 EXESUF=".exe"
619 oss="no"
620 linux_user="no"
621 bsd_user="no"
624 if test ! -x "$(which cgcc 2>/dev/null)"; then
625 sparse="no"
629 # Solaris specific configure tool chain decisions
631 if test "$solaris" = "yes" ; then
632 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
633 if test -z "$solinst" ; then
634 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
635 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
636 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
637 exit 1
639 if test "$solinst" = "/usr/sbin/install" ; then
640 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
641 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
642 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
643 exit 1
645 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
646 if test -z "$sol_ar" ; then
647 echo "Error: No path includes ar"
648 if test -f /usr/ccs/bin/ar ; then
649 echo "Add /usr/ccs/bin to your path and rerun configure"
651 exit 1
656 if test -z "$target_list" ; then
657 # these targets are portable
658 if [ "$softmmu" = "yes" ] ; then
659 target_list="\
660 i386-softmmu \
661 x86_64-softmmu \
662 arm-softmmu \
663 cris-softmmu \
664 m68k-softmmu \
665 mips-softmmu \
666 mipsel-softmmu \
667 mips64-softmmu \
668 mips64el-softmmu \
669 ppc-softmmu \
670 ppcemb-softmmu \
671 ppc64-softmmu \
672 sh4-softmmu \
673 sh4eb-softmmu \
674 sparc-softmmu \
677 # the following are Linux specific
678 if [ "$linux_user" = "yes" ] ; then
679 target_list="${target_list}\
680 i386-linux-user \
681 x86_64-linux-user \
682 alpha-linux-user \
683 arm-linux-user \
684 armeb-linux-user \
685 cris-linux-user \
686 m68k-linux-user \
687 mips-linux-user \
688 mipsel-linux-user \
689 ppc-linux-user \
690 ppc64-linux-user \
691 ppc64abi32-linux-user \
692 sh4-linux-user \
693 sh4eb-linux-user \
694 sparc-linux-user \
695 sparc64-linux-user \
696 sparc32plus-linux-user \
699 # the following are Darwin specific
700 if [ "$darwin_user" = "yes" ] ; then
701 target_list="$target_list i386-darwin-user ppc-darwin-user "
703 # the following are BSD specific
704 if [ "$bsd_user" = "yes" ] ; then
705 target_list="${target_list}\
706 sparc64-bsd-user \
709 else
710 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
712 if test -z "$target_list" ; then
713 echo "No targets enabled"
714 exit 1
717 if test -z "$cross_prefix" ; then
719 # ---
720 # big/little endian test
721 cat > $TMPC << EOF
722 #include <inttypes.h>
723 int main(int argc, char ** argv){
724 volatile uint32_t i=0x01234567;
725 return (*((uint8_t*)(&i))) == 0x67;
729 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
730 $TMPE && bigendian="yes"
731 else
732 echo big/little test failed
735 else
737 # if cross compiling, cannot launch a program, so make a static guess
738 if test "$cpu" = "armv4b" \
739 -o "$cpu" = "hppa" \
740 -o "$cpu" = "m68k" \
741 -o "$cpu" = "mips" \
742 -o "$cpu" = "mips64" \
743 -o "$cpu" = "ppc" \
744 -o "$cpu" = "ppc64" \
745 -o "$cpu" = "s390" \
746 -o "$cpu" = "sparc" \
747 -o "$cpu" = "sparc64"; then
748 bigendian="yes"
753 # host long bits test
754 hostlongbits="32"
755 if test "$cpu" = "x86_64" \
756 -o "$cpu" = "alpha" \
757 -o "$cpu" = "ia64" \
758 -o "$cpu" = "sparc64" \
759 -o "$cpu" = "ppc64"; then
760 hostlongbits="64"
763 # check gcc options support
764 cat > $TMPC <<EOF
765 int main(void) {
769 # Check host NPTL support
770 cat > $TMPC <<EOF
771 #include <sched.h>
772 #include <linux/futex.h>
773 void foo()
775 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
776 #error bork
777 #endif
781 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
783 else
784 nptl="no"
787 ##########################################
788 # KVM probe
790 case "$cpu" in
791 i386 | x86_64)
792 kvm_arch="x86"
795 kvm_arch="$cpu"
797 esac
799 kvm_cflags=""
801 if test "$kvm" = "yes" ; then
803 kvm_cflags="-I$source_path/kvm/kernel/include"
804 kvm_cflags="$kvm_cflags -I$source_path/kvm/kernel/arch/$kvm_arch/include"
806 # test for KVM_CAP_PIT
808 cat > $TMPC <<EOF
809 #include <libkvm.h>
810 #ifndef KVM_CAP_PIT
811 #error "kvm no pit capability"
812 #endif
813 int main(void) { return 0; }
815 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
816 kvm_cap_pit="yes"
819 # test for KVM_CAP_DEVICE_ASSIGNMENT
821 cat > $TMPC <<EOF
822 #include <libkvm.h>
823 #ifndef KVM_CAP_DEVICE_ASSIGNMENT
824 #error "kvm no device assignment capability"
825 #endif
826 int main(void) { return 0; }
828 if $cc $ARCH_CFLAGS $CFLAGS $kvm_cflags -o $TMPE ${OS_CFLAGS} $TMPC 2> /dev/null ; then
829 kvm_cap_device_assignment="yes"
833 ##########################################
834 # zlib check
836 cat > $TMPC << EOF
837 #include <zlib.h>
838 int main(void) { zlibVersion(); return 0; }
840 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
842 else
843 echo
844 echo "Error: zlib check failed"
845 echo "Make sure to have the zlib libs and headers installed."
846 echo
847 exit 1
850 ##########################################
851 # SDL probe
853 sdl_too_old=no
855 if test -z "$sdl" ; then
856 sdl_config="sdl-config"
857 sdl=no
858 sdl_static=no
860 cat > $TMPC << EOF
861 #include <SDL.h>
862 #undef main /* We don't want SDL to override our main() */
863 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
865 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
866 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
867 if test "$_sdlversion" -lt 121 ; then
868 sdl_too_old=yes
869 else
870 if test "$cocoa" = "no" ; then
871 sdl=yes
875 # static link with sdl ?
876 if test "$sdl" = "yes" ; then
877 aa="no"
878 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
879 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
880 if [ "$aa" = "yes" ] ; then
881 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
884 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
885 sdl_static=yes
887 fi # static link
888 fi # sdl compile test
889 else
890 # Make sure to disable cocoa if sdl was set
891 if test "$sdl" = "yes" ; then
892 cocoa="no"
893 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
895 fi # -z $sdl
897 if test "$sdl" = "yes" ; then
898 cat > $TMPC <<EOF
899 #include <SDL.h>
900 #if defined(SDL_VIDEO_DRIVER_X11)
901 #include <X11/XKBlib.h>
902 #else
903 #error No x11 support
904 #endif
905 int main(void) { return 0; }
907 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
908 sdl_x11="yes"
912 ##########################################
913 # VNC TLS detection
914 if test "$vnc_tls" = "yes" ; then
915 cat > $TMPC <<EOF
916 #include <gnutls/gnutls.h>
917 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
919 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
920 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
921 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
922 $vnc_tls_libs > /dev/null 2> /dev/null ; then
924 else
925 vnc_tls="no"
929 ##########################################
930 # VNC SASL detection
931 if test "$vnc_sasl" = "yes" ; then
932 cat > $TMPC <<EOF
933 #include <sasl/sasl.h>
934 #include <stdio.h>
935 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
937 # Assuming Cyrus-SASL installed in /usr prefix
938 vnc_sasl_cflags=""
939 vnc_sasl_libs="-lsasl2"
940 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
941 $vnc_sasl_libs 2> /dev/null ; then
943 else
944 vnc_sasl="no"
948 ##########################################
949 # fnmatch() probe, used for ACL routines
950 fnmatch="no"
951 cat > $TMPC << EOF
952 #include <fnmatch.h>
953 int main(void)
955 fnmatch("foo", "foo", 0);
956 return 0;
959 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
960 fnmatch="yes"
963 ##########################################
964 # vde libraries probe
965 if test "$vde" = "yes" ; then
966 cat > $TMPC << EOF
967 #include <libvdeplug.h>
968 int main(void)
970 struct vde_open_args a = {0, 0, 0};
971 vde_open("", "", &a);
972 return 0;
975 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
977 else
978 vde="no"
982 ##########################################
983 # Sound support libraries probe
985 audio_drv_probe()
987 drv=$1
988 hdr=$2
989 lib=$3
990 exp=$4
991 cfl=$5
992 cat > $TMPC << EOF
993 #include <$hdr>
994 int main(void) { $exp }
996 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
998 else
999 echo
1000 echo "Error: $drv check failed"
1001 echo "Make sure to have the $drv libs and headers installed."
1002 echo
1003 exit 1
1007 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1008 for drv in $audio_drv_list; do
1009 case $drv in
1010 alsa)
1011 audio_drv_probe $drv alsa/asoundlib.h -lasound \
1012 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1015 fmod)
1016 if test -z $fmod_lib || test -z $fmod_inc; then
1017 echo
1018 echo "Error: You must specify path to FMOD library and headers"
1019 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1020 echo
1021 exit 1
1023 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1026 esd)
1027 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1031 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1032 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1035 oss|sdl|core|wav|dsound)
1036 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1040 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1041 echo
1042 echo "Error: Unknown driver '$drv' selected"
1043 echo "Possible drivers are: $audio_possible_drivers"
1044 echo
1045 exit 1
1048 esac
1049 done
1051 ##########################################
1052 # BrlAPI probe
1054 if test -z "$brlapi" ; then
1055 brlapi=no
1056 cat > $TMPC << EOF
1057 #include <brlapi.h>
1058 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1060 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1061 brlapi=yes
1062 fi # brlapi compile test
1063 fi # -z $brlapi
1065 ##########################################
1066 # curses probe
1068 if test "$curses" = "yes" ; then
1069 curses=no
1070 cat > $TMPC << EOF
1071 #include <curses.h>
1072 int main(void) { return curses_version(); }
1074 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1075 curses=yes
1077 fi # test "$curses"
1079 ##########################################
1080 # bluez support probe
1081 if test "$bluez" = "yes" ; then
1082 `pkg-config bluez` || bluez="no"
1084 if test "$bluez" = "yes" ; then
1085 cat > $TMPC << EOF
1086 #include <bluetooth/bluetooth.h>
1087 int main(void) { return bt_error(0); }
1089 bluez_cflags=`pkg-config --cflags bluez`
1090 bluez_libs=`pkg-config --libs bluez`
1091 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1092 $bluez_libs > /dev/null 2> /dev/null ; then
1094 else
1095 bluez="no"
1099 ##########################################
1100 # kvm probe
1101 if test "$kvm" = "yes" ; then
1102 cat > $TMPC <<EOF
1103 #include <linux/kvm.h>
1104 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1105 #error Invalid KVM version
1106 #endif
1107 #if !defined(KVM_CAP_USER_MEMORY)
1108 #error Missing KVM capability KVM_CAP_USER_MEMORY
1109 #endif
1110 #if !defined(KVM_CAP_SET_TSS_ADDR)
1111 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1112 #endif
1113 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1114 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1115 #endif
1116 int main(void) { return 0; }
1118 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1119 > /dev/null 2>/dev/null ; then
1121 else
1122 kvm="no";
1123 if [ -x "`which awk 2>/dev/null`" ] && \
1124 [ -x "`which grep 2>/dev/null`" ]; then
1125 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1126 | grep "error: " \
1127 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1128 if test "$kvmerr" != "" ; then
1129 kvm="no - (${kvmerr})"
1135 ##########################################
1136 # AIO probe
1137 AIOLIBS=""
1139 if test "$aio" = "yes" ; then
1140 aio=no
1141 cat > $TMPC << EOF
1142 #include <pthread.h>
1143 int main(void) { pthread_mutex_t lock; return 0; }
1145 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1146 aio=yes
1147 AIOLIBS="-lpthread"
1151 ##########################################
1152 # iovec probe
1153 cat > $TMPC <<EOF
1154 #include <sys/types.h>
1155 #include <sys/uio.h>
1156 #include <unistd.h>
1157 int main(void) { struct iovec iov; return 0; }
1159 iovec=no
1160 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1161 iovec=yes
1164 ##########################################
1165 # fdt probe
1166 if test "$fdt" = "yes" ; then
1167 fdt=no
1168 cat > $TMPC << EOF
1169 int main(void) { return 0; }
1171 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1172 fdt=yes
1176 ##########################################
1177 # signalfd probe
1178 cat > $TMPC << EOF
1179 #define _GNU_SOURCE
1180 #include <unistd.h>
1181 #include <sys/syscall.h>
1182 #include <signal.h>
1183 int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
1186 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1187 signalfd=yes
1190 ##########################################
1191 # eventfd probe
1192 cat > $TMPC << EOF
1193 #define _GNU_SOURCE
1194 #include <unistd.h>
1195 #include <sys/syscall.h>
1196 int main(void) { return syscall(SYS_eventfd, 0); }
1199 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1200 eventfd=yes
1203 # Check if tools are available to build documentation.
1204 if [ -x "`which texi2html 2>/dev/null`" ] && \
1205 [ -x "`which pod2man 2>/dev/null`" ]; then
1206 build_docs="yes"
1209 ##########################################
1210 # Do we need librt
1211 cat > $TMPC <<EOF
1212 #include <signal.h>
1213 #include <time.h>
1214 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1217 rt=no
1218 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1220 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1221 rt=yes
1224 if test "$rt" = "yes" ; then
1225 # Hack, we should have a general purpose LIBS for this sort of thing
1226 AIOLIBS="$AIOLIBS -lrt"
1229 if test "$mingw32" = "yes" ; then
1230 if test -z "$prefix" ; then
1231 prefix="c:\\\\Program Files\\\\Qemu"
1233 mansuffix=""
1234 datasuffix=""
1235 docsuffix=""
1236 binsuffix=""
1237 else
1238 if test -z "$prefix" ; then
1239 prefix="/usr/local"
1241 mansuffix="/share/man"
1242 datasuffix="/share/qemu"
1243 docsuffix="/share/doc/qemu"
1244 binsuffix="/bin"
1247 echo "Install prefix $prefix"
1248 echo "BIOS directory $prefix$datasuffix"
1249 echo "binary directory $prefix$binsuffix"
1250 if test "$mingw32" = "no" ; then
1251 echo "Manual directory $prefix$mansuffix"
1252 echo "ELF interp prefix $interp_prefix"
1254 echo "Source path $source_path"
1255 echo "C compiler $cc"
1256 echo "Host C compiler $host_cc"
1257 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1258 echo "make $make"
1259 echo "install $install"
1260 echo "host CPU $cpu"
1261 echo "host big endian $bigendian"
1262 echo "target list $target_list"
1263 echo "gprof enabled $gprof"
1264 echo "sparse enabled $sparse"
1265 echo "strip binaries $strip_opt"
1266 echo "profiler $profiler"
1267 echo "static build $static"
1268 echo "-Werror enabled $werror"
1269 if test "$darwin" = "yes" ; then
1270 echo "Cocoa support $cocoa"
1272 echo "SDL support $sdl"
1273 if test "$sdl" != "no" ; then
1274 echo "SDL static link $sdl_static"
1276 echo "curses support $curses"
1277 echo "mingw32 support $mingw32"
1278 echo "Audio drivers $audio_drv_list"
1279 echo "Extra audio cards $audio_card_list"
1280 echo "Mixer emulation $mixemu"
1281 echo "VNC TLS support $vnc_tls"
1282 if test "$vnc_tls" = "yes" ; then
1283 echo " TLS CFLAGS $vnc_tls_cflags"
1284 echo " TLS LIBS $vnc_tls_libs"
1286 echo "VNC SASL support $vnc_sasl"
1287 if test "$vnc_sasl" = "yes" ; then
1288 echo " SASL CFLAGS $vnc_sasl_cflags"
1289 echo " SASL LIBS $vnc_sasl_libs"
1291 if test -n "$sparc_cpu"; then
1292 echo "Target Sparc Arch $sparc_cpu"
1294 echo "kqemu support $kqemu"
1295 echo "kvm support $kvm"
1296 echo "CPU emulation $cpu_emulation"
1297 echo "brlapi support $brlapi"
1298 echo "Documentation $build_docs"
1299 [ ! -z "$uname_release" ] && \
1300 echo "uname -r $uname_release"
1301 echo "NPTL support $nptl"
1302 echo "vde support $vde"
1303 echo "AIO support $aio"
1304 echo "Install blobs $blobs"
1305 echo "KVM support $kvm"
1306 echo "fdt support $fdt"
1308 if test $sdl_too_old = "yes"; then
1309 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1311 if [ -s $TMPSDLLOG ]; then
1312 echo "The error log from compiling the libSDL test is: "
1313 cat $TMPSDLLOG
1315 #if test "$sdl_static" = "no"; then
1316 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1318 config_mak="config-host.mak"
1319 config_h="config-host.h"
1321 #echo "Creating $config_mak and $config_h"
1323 test -f $config_h && mv $config_h ${config_h}~
1325 echo "# Automatically generated by configure - do not modify" > $config_mak
1326 printf "# Configured with:" >> $config_mak
1327 printf " '%s'" "$0" "$@" >> $config_mak
1328 echo >> $config_mak
1329 echo "/* Automatically generated by configure - do not modify */" > $config_h
1331 echo "prefix=$prefix" >> $config_mak
1332 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1333 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1334 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1335 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1336 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1337 echo "MAKE=$make" >> $config_mak
1338 echo "INSTALL=$install" >> $config_mak
1339 echo "CC=$cc" >> $config_mak
1340 echo "HOST_CC=$host_cc" >> $config_mak
1341 echo "AR=$ar" >> $config_mak
1342 # XXX: only use CFLAGS and LDFLAGS ?
1343 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1344 # compilation of dyngen tool (useful for win32 build on Linux host)
1345 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1346 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1347 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1348 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1349 echo "CFLAGS=$CFLAGS" >> $config_mak
1350 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1351 echo "EXESUF=$EXESUF" >> $config_mak
1352 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1353 case "$cpu" in
1354 i386)
1355 echo "ARCH=i386" >> $config_mak
1356 echo "#define HOST_I386 1" >> $config_h
1358 x86_64)
1359 echo "ARCH=x86_64" >> $config_mak
1360 echo "#define HOST_X86_64 1" >> $config_h
1362 alpha)
1363 echo "ARCH=alpha" >> $config_mak
1364 echo "#define HOST_ALPHA 1" >> $config_h
1366 armv4b)
1367 echo "ARCH=arm" >> $config_mak
1368 echo "#define HOST_ARM 1" >> $config_h
1370 armv4l)
1371 echo "ARCH=arm" >> $config_mak
1372 echo "#define HOST_ARM 1" >> $config_h
1374 cris)
1375 echo "ARCH=cris" >> $config_mak
1376 echo "#define HOST_CRIS 1" >> $config_h
1378 hppa)
1379 echo "ARCH=hppa" >> $config_mak
1380 echo "#define HOST_HPPA 1" >> $config_h
1382 ia64)
1383 echo "ARCH=ia64" >> $config_mak
1384 echo "#define HOST_IA64 1" >> $config_h
1386 m68k)
1387 echo "ARCH=m68k" >> $config_mak
1388 echo "#define HOST_M68K 1" >> $config_h
1390 mips)
1391 echo "ARCH=mips" >> $config_mak
1392 echo "#define HOST_MIPS 1" >> $config_h
1394 mips64)
1395 echo "ARCH=mips64" >> $config_mak
1396 echo "#define HOST_MIPS64 1" >> $config_h
1398 ppc)
1399 echo "ARCH=ppc" >> $config_mak
1400 echo "#define HOST_PPC 1" >> $config_h
1402 ppc64)
1403 echo "ARCH=ppc64" >> $config_mak
1404 echo "#define HOST_PPC64 1" >> $config_h
1406 s390)
1407 echo "ARCH=s390" >> $config_mak
1408 echo "#define HOST_S390 1" >> $config_h
1410 sparc)
1411 echo "ARCH=sparc" >> $config_mak
1412 echo "#define HOST_SPARC 1" >> $config_h
1414 sparc64)
1415 echo "ARCH=sparc64" >> $config_mak
1416 echo "#define HOST_SPARC64 1" >> $config_h
1419 echo "Unsupported CPU = $cpu"
1420 exit 1
1422 esac
1423 if test "$sparse" = "yes" ; then
1424 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1425 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1426 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1428 if test "$strip_opt" = "yes" ; then
1429 echo "STRIP_OPT=-s" >> $config_mak
1431 if test "$bigendian" = "yes" ; then
1432 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1433 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1435 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1436 if test "$mingw32" = "yes" ; then
1437 echo "CONFIG_WIN32=yes" >> $config_mak
1438 echo "#define CONFIG_WIN32 1" >> $config_h
1439 else
1440 cat > $TMPC << EOF
1441 #include <byteswap.h>
1442 int main(void) { return bswap_32(0); }
1444 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1445 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1447 cat > $TMPC << EOF
1448 #include <sys/endian.h>
1449 #include <sys/types.h>
1450 #include <machine/bswap.h>
1451 int main(void) { return bswap32(0); }
1453 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1454 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1458 if [ "$openbsd" = "yes" ] ; then
1459 echo "#define ENOTSUP 4096" >> $config_h
1462 if test "$darwin" = "yes" ; then
1463 echo "CONFIG_DARWIN=yes" >> $config_mak
1464 echo "#define CONFIG_DARWIN 1" >> $config_h
1467 if test "$aix" = "yes" ; then
1468 echo "CONFIG_AIX=yes" >> $config_mak
1469 echo "#define CONFIG_AIX 1" >> $config_h
1472 if test "$solaris" = "yes" ; then
1473 echo "CONFIG_SOLARIS=yes" >> $config_mak
1474 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1475 if test "$needs_libsunmath" = "yes" ; then
1476 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1477 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1480 if test -n "$sparc_cpu"; then
1481 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1482 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1484 if test "$gdbstub" = "yes" ; then
1485 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1486 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1488 if test "$gprof" = "yes" ; then
1489 echo "TARGET_GPROF=yes" >> $config_mak
1490 echo "#define HAVE_GPROF 1" >> $config_h
1492 if test "$static" = "yes" ; then
1493 echo "CONFIG_STATIC=yes" >> $config_mak
1494 echo "#define CONFIG_STATIC 1" >> $config_h
1496 if test $profiler = "yes" ; then
1497 echo "#define CONFIG_PROFILER 1" >> $config_h
1499 if test "$slirp" = "yes" ; then
1500 echo "CONFIG_SLIRP=yes" >> $config_mak
1501 echo "#define CONFIG_SLIRP 1" >> $config_h
1503 if test "$vde" = "yes" ; then
1504 echo "CONFIG_VDE=yes" >> $config_mak
1505 echo "#define CONFIG_VDE 1" >> $config_h
1506 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1508 for card in $audio_card_list; do
1509 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1510 echo "$def=yes" >> $config_mak
1511 echo "#define $def 1" >> $config_h
1512 done
1513 echo "#define AUDIO_DRIVERS \\" >> $config_h
1514 for drv in $audio_drv_list; do
1515 echo " &${drv}_audio_driver, \\" >>$config_h
1516 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1517 echo "$def=yes" >> $config_mak
1518 if test "$drv" = "fmod"; then
1519 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1520 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1521 elif test "$drv" = "oss"; then
1522 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1524 done
1525 echo "" >>$config_h
1526 if test "$mixemu" = "yes" ; then
1527 echo "CONFIG_MIXEMU=yes" >> $config_mak
1528 echo "#define CONFIG_MIXEMU 1" >> $config_h
1530 if test "$vnc_tls" = "yes" ; then
1531 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1532 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1533 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1534 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1536 if test "$vnc_sasl" = "yes" ; then
1537 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1538 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1539 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1540 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1542 if test "$fnmatch" = "yes" ; then
1543 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1545 qemu_version=`head $source_path/VERSION`
1546 echo "VERSION=$qemu_version" >>$config_mak
1547 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1548 echo "#define KVM_VERSION \"${pkgversion}\"" >> $config_h
1550 echo "SRC_PATH=$source_path" >> $config_mak
1551 if [ "$source_path_used" = "yes" ]; then
1552 echo "VPATH=$source_path" >> $config_mak
1554 echo "TARGET_DIRS=$target_list" >> $config_mak
1555 if [ "$build_docs" = "yes" ] ; then
1556 echo "BUILD_DOCS=yes" >> $config_mak
1558 if test "$static" = "yes"; then
1559 sdl1=$sdl_static
1560 else
1561 sdl1=$sdl
1563 if test "$sdl1" = "yes" ; then
1564 echo "#define CONFIG_SDL 1" >> $config_h
1565 echo "CONFIG_SDL=yes" >> $config_mak
1566 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1567 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1568 elif test "$sdl_x11" = "yes" ; then
1569 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1570 else
1571 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1573 if [ "${aa}" = "yes" ] ; then
1574 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1575 else
1576 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1579 if test "$cocoa" = "yes" ; then
1580 echo "#define CONFIG_COCOA 1" >> $config_h
1581 echo "CONFIG_COCOA=yes" >> $config_mak
1583 if test "$curses" = "yes" ; then
1584 echo "#define CONFIG_CURSES 1" >> $config_h
1585 echo "CONFIG_CURSES=yes" >> $config_mak
1586 echo "CURSES_LIBS=-lcurses" >> $config_mak
1588 if test "$brlapi" = "yes" ; then
1589 echo "CONFIG_BRLAPI=yes" >> $config_mak
1590 echo "#define CONFIG_BRLAPI 1" >> $config_h
1591 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1593 if test "$bluez" = "yes" ; then
1594 echo "CONFIG_BLUEZ=yes" >> $config_mak
1595 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1596 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1597 echo "#define CONFIG_BLUEZ 1" >> $config_h
1599 if test "$aio" = "yes" ; then
1600 echo "#define CONFIG_AIO 1" >> $config_h
1601 echo "CONFIG_AIO=yes" >> $config_mak
1603 if test "$blobs" = "yes" ; then
1604 echo "INSTALL_BLOBS=yes" >> $config_mak
1606 if test "$iovec" = "yes" ; then
1607 echo "#define HAVE_IOVEC 1" >> $config_h
1609 if test "$fdt" = "yes" ; then
1610 echo "#define HAVE_FDT 1" >> $config_h
1611 echo "FDT_LIBS=-lfdt" >> $config_mak
1613 if test "$signalfd" = "yes" ; then
1614 echo "#define CONFIG_signalfd 1" >> $config_h
1616 if test "$eventfd" = "yes" ; then
1617 echo "#define CONFIG_eventfd 1" >> $config_h
1620 # XXX: suppress that
1621 if [ "$bsd" = "yes" ] ; then
1622 echo "#define O_LARGEFILE 0" >> $config_h
1623 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1624 echo "#define _BSD 1" >> $config_h
1627 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1629 # USB host support
1630 case "$usb" in
1631 linux)
1632 echo "HOST_USB=linux" >> $config_mak
1634 bsd)
1635 echo "HOST_USB=bsd" >> $config_mak
1638 echo "HOST_USB=stub" >> $config_mak
1640 esac
1642 # this is a temp hack needed for libkvm
1643 if test "$kvm" = "yes" ; then
1644 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1647 tools=
1648 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1649 tools="qemu-img\$(EXESUF) $tools"
1650 if [ "$linux" = "yes" ] ; then
1651 tools="qemu-nbd\$(EXESUF) $tools"
1654 echo "TOOLS=$tools" >> $config_mak
1656 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1658 for target in $target_list; do
1659 target_dir="$target"
1660 config_mak=$target_dir/config.mak
1661 config_h=$target_dir/config.h
1662 target_cpu=`echo $target | cut -d '-' -f 1`
1663 target_bigendian="no"
1664 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1665 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1666 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1667 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1668 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1669 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1670 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1671 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1672 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1673 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1674 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1675 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1676 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1677 target_softmmu="no"
1678 target_user_only="no"
1679 target_linux_user="no"
1680 target_darwin_user="no"
1681 target_bsd_user="no"
1682 case "$target" in
1683 ${target_cpu}-softmmu)
1684 target_softmmu="yes"
1686 ${target_cpu}-linux-user)
1687 target_user_only="yes"
1688 target_linux_user="yes"
1690 ${target_cpu}-darwin-user)
1691 target_user_only="yes"
1692 target_darwin_user="yes"
1694 ${target_cpu}-bsd-user)
1695 target_user_only="yes"
1696 target_bsd_user="yes"
1699 echo "ERROR: Target '$target' not recognised"
1700 exit 1
1702 esac
1704 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1705 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1706 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1707 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1708 echo "Note that this will disable all output from the virtual graphics card"
1709 echo "except through VNC or curses."
1710 exit 1;
1713 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1715 test -f $config_h && mv $config_h ${config_h}~
1717 mkdir -p $target_dir
1718 mkdir -p $target_dir/fpu
1719 mkdir -p $target_dir/tcg
1720 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1721 mkdir -p $target_dir/nwfpe
1725 # don't use ln -sf as not all "ln -sf" over write the file/link
1727 rm -f $target_dir/Makefile
1728 ln -s $source_path/Makefile.target $target_dir/Makefile
1731 echo "# Automatically generated by configure - do not modify" > $config_mak
1732 echo "/* Automatically generated by configure - do not modify */" > $config_h
1735 echo "include ../config-host.mak" >> $config_mak
1736 echo "#include \"../config-host.h\"" >> $config_h
1738 bflt="no"
1739 elfload32="no"
1740 target_nptl="no"
1741 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1742 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1743 gdb_xml_files=""
1745 disable_cpu_emulation() {
1746 if test $cpu_emulation = "no"; then
1747 echo "#define NO_CPU_EMULATION 1" >> $config_h
1748 echo "NO_CPU_EMULATION=1" >> $config_mak
1752 configure_kvm() {
1753 if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
1754 \( "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "powerpc" \); then
1755 echo "#define USE_KVM 1" >> $config_h
1756 echo "USE_KVM=1" >> $config_mak
1757 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1758 if test $kvm_cap_pit = "yes" ; then
1759 echo "USE_KVM_PIT=1" >> $config_mak
1760 echo "#define USE_KVM_PIT 1" >> $config_h
1762 if test $kvm_cap_device_assignment = "yes" ; then
1763 echo "USE_KVM_DEVICE_ASSIGNMENT=1" >> $config_mak
1764 echo "#define USE_KVM_DEVICE_ASSIGNMENT 1" >> $config_h
1766 disable_cpu_emulation
1770 if [ use_upstream_kvm = yes ]; then
1772 # Make sure the target and host cpus are compatible
1773 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1774 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1775 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1776 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1777 kvm="no"
1779 # Disable KVM for linux-user
1780 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1781 kvm="no"
1786 case "$target_cpu" in
1787 i386)
1788 echo "TARGET_ARCH=i386" >> $config_mak
1789 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1790 echo "#define TARGET_I386 1" >> $config_h
1791 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1792 then
1793 echo "#define USE_KQEMU 1" >> $config_h
1795 if test "$kvm" = "yes" ; then
1796 echo "USE_KVM=yes" >> $config_mak
1797 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1798 echo "#define USE_KVM 1" >> $config_h
1800 configure_kvm
1802 x86_64)
1803 echo "TARGET_ARCH=x86_64" >> $config_mak
1804 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1805 echo "#define TARGET_I386 1" >> $config_h
1806 echo "#define TARGET_X86_64 1" >> $config_h
1807 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1808 then
1809 echo "#define USE_KQEMU 1" >> $config_h
1811 configure_kvm
1813 ia64)
1814 echo "TARGET_ARCH=ia64" >> $config_mak
1815 echo "#define TARGET_ARCH \"ia64\"" >> $config_h
1816 echo "#define TARGET_IA64 1" >> $config_h
1817 configure_kvm
1818 if [ use_upstream_kvm = yes ]; then
1819 if test "$kvm" = "yes" ; then
1820 echo "USE_KVM=yes" >> $config_mak
1821 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1822 echo "#define USE_KVM 1" >> $config_h
1826 alpha)
1827 echo "TARGET_ARCH=alpha" >> $config_mak
1828 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1829 echo "#define TARGET_ALPHA 1" >> $config_h
1831 arm|armeb)
1832 echo "TARGET_ARCH=arm" >> $config_mak
1833 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1834 echo "#define TARGET_ARM 1" >> $config_h
1835 bflt="yes"
1836 target_nptl="yes"
1837 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1839 cris)
1840 echo "TARGET_ARCH=cris" >> $config_mak
1841 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1842 echo "#define TARGET_CRIS 1" >> $config_h
1843 target_nptl="yes"
1845 m68k)
1846 echo "TARGET_ARCH=m68k" >> $config_mak
1847 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1848 echo "#define TARGET_M68K 1" >> $config_h
1849 bflt="yes"
1850 gdb_xml_files="cf-core.xml cf-fp.xml"
1852 mips|mipsel)
1853 echo "TARGET_ARCH=mips" >> $config_mak
1854 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1855 echo "#define TARGET_MIPS 1" >> $config_h
1856 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1858 mipsn32|mipsn32el)
1859 echo "TARGET_ARCH=mipsn32" >> $config_mak
1860 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1861 echo "#define TARGET_MIPS 1" >> $config_h
1862 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1864 mips64|mips64el)
1865 echo "TARGET_ARCH=mips64" >> $config_mak
1866 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1867 echo "#define TARGET_MIPS 1" >> $config_h
1868 echo "#define TARGET_MIPS64 1" >> $config_h
1869 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1871 ppc)
1872 echo "TARGET_ARCH=ppc" >> $config_mak
1873 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1874 echo "#define TARGET_PPC 1" >> $config_h
1875 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1877 ppcemb)
1878 echo "TARGET_ARCH=ppcemb" >> $config_mak
1879 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1880 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1881 echo "#define TARGET_PPC 1" >> $config_h
1882 echo "#define TARGET_PPCEMB 1" >> $config_h
1883 if test "$kvm" = "yes" ; then
1884 echo "USE_KVM=yes" >> $config_mak
1885 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1886 echo "#define USE_KVM 1" >> $config_h
1888 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1890 ppc64)
1891 echo "TARGET_ARCH=ppc64" >> $config_mak
1892 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1893 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1894 echo "#define TARGET_PPC 1" >> $config_h
1895 echo "#define TARGET_PPC64 1" >> $config_h
1896 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1898 ppc64abi32)
1899 echo "TARGET_ARCH=ppc64" >> $config_mak
1900 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1901 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1902 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1903 echo "#define TARGET_PPC 1" >> $config_h
1904 echo "#define TARGET_PPC64 1" >> $config_h
1905 echo "#define TARGET_ABI32 1" >> $config_h
1906 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1908 sh4|sh4eb)
1909 echo "TARGET_ARCH=sh4" >> $config_mak
1910 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1911 echo "#define TARGET_SH4 1" >> $config_h
1912 bflt="yes"
1913 target_nptl="yes"
1915 sparc)
1916 echo "TARGET_ARCH=sparc" >> $config_mak
1917 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1918 echo "#define TARGET_SPARC 1" >> $config_h
1920 sparc64)
1921 echo "TARGET_ARCH=sparc64" >> $config_mak
1922 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1923 echo "#define TARGET_SPARC 1" >> $config_h
1924 echo "#define TARGET_SPARC64 1" >> $config_h
1925 elfload32="yes"
1927 sparc32plus)
1928 echo "TARGET_ARCH=sparc64" >> $config_mak
1929 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1930 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1931 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1932 echo "#define TARGET_SPARC 1" >> $config_h
1933 echo "#define TARGET_SPARC64 1" >> $config_h
1934 echo "#define TARGET_ABI32 1" >> $config_h
1937 echo "Unsupported target CPU"
1938 exit 1
1940 esac
1941 if test "$target_bigendian" = "yes" ; then
1942 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1943 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1945 if test "$target_softmmu" = "yes" ; then
1946 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1947 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1949 if test "$target_user_only" = "yes" ; then
1950 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1951 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1953 if test "$target_linux_user" = "yes" ; then
1954 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1955 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1957 if test "$target_darwin_user" = "yes" ; then
1958 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1959 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1961 list=""
1962 if test ! -z "$gdb_xml_files" ; then
1963 for x in $gdb_xml_files; do
1964 list="$list $source_path/gdb-xml/$x"
1965 done
1967 echo "TARGET_XML_FILES=$list" >> $config_mak
1969 if test "$target_cpu" = "arm" \
1970 -o "$target_cpu" = "armeb" \
1971 -o "$target_cpu" = "m68k" \
1972 -o "$target_cpu" = "mips" \
1973 -o "$target_cpu" = "mipsel" \
1974 -o "$target_cpu" = "mipsn32" \
1975 -o "$target_cpu" = "mipsn32el" \
1976 -o "$target_cpu" = "mips64" \
1977 -o "$target_cpu" = "mips64el" \
1978 -o "$target_cpu" = "ppc" \
1979 -o "$target_cpu" = "ppc64" \
1980 -o "$target_cpu" = "ppc64abi32" \
1981 -o "$target_cpu" = "ppcemb" \
1982 -o "$target_cpu" = "sparc" \
1983 -o "$target_cpu" = "sparc64" \
1984 -o "$target_cpu" = "sparc32plus"; then
1985 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1986 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1988 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1989 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1990 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1992 if test "$target_user_only" = "yes" \
1993 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1994 echo "#define USE_NPTL 1" >> $config_h
1996 # 32 bit ELF loader in addition to native 64 bit loader?
1997 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1998 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1999 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2001 if test "$target_bsd_user" = "yes" ; then
2002 echo "CONFIG_BSD_USER=yes" >> $config_mak
2003 echo "#define CONFIG_BSD_USER 1" >> $config_h
2006 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2008 done # for target in $targets
2010 # build tree in object directory if source path is different from current one
2011 if test "$source_path_used" = "yes" ; then
2012 DIRS="tests tests/cris slirp audio kvm/libkvm"
2013 FILES="Makefile tests/Makefile"
2014 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2015 FILES="$FILES tests/test-mmap.c"
2016 FILES="$FILES kvm/libkvm/Makefile"
2017 for dir in $DIRS ; do
2018 mkdir -p $dir
2019 done
2020 # remove the link and recreate it, as not all "ln -sf" overwrite the link
2021 for f in $FILES ; do
2022 rm -f $f
2023 ln -s $source_path/$f $f
2024 done