]> git.proxmox.com Git - mirror_qemu.git/blob - configure
Skip KVM probe for OpenSolaris
[mirror_qemu.git] / configure
1 #!/bin/sh
2 #
3 # qemu configure script (c) 2003 Fabrice Bellard
4 #
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"
12 fi
13
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"
20
21 trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
22
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"
37
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"
43 ;;
44 --cc=*) cc="$optarg"
45 ;;
46 esac
47 done
48
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
52
53 cc="${cross_prefix}${cc}"
54 ar="${cross_prefix}${ar}"
55 strip="${cross_prefix}${strip}"
56
57 # check that the C compiler works.
58 cat > $TMPC <<EOF
59 int main(void) {}
60 EOF
61
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
67 fi
68
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
77 }
78
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"
90 fi
91 elif check_define _ARCH_PPC ; then
92 if check_define _ARCH_PPC64 ; then
93 cpu="ppc64"
94 else
95 cpu="ppc"
96 fi
97 else
98 cpu=`uname -m`
99 fi
100
101 target_list=""
102 case "$cpu" in
103 i386|i486|i586|i686|i86pc|BePC)
104 cpu="i386"
105 ;;
106 x86_64|amd64)
107 cpu="x86_64"
108 ;;
109 alpha)
110 cpu="alpha"
111 ;;
112 armv*b)
113 cpu="armv4b"
114 ;;
115 armv*l)
116 cpu="armv4l"
117 ;;
118 cris)
119 cpu="cris"
120 ;;
121 parisc|parisc64)
122 cpu="hppa"
123 ;;
124 ia64)
125 cpu="ia64"
126 ;;
127 m68k)
128 cpu="m68k"
129 ;;
130 mips)
131 cpu="mips"
132 ;;
133 mips64)
134 cpu="mips64"
135 ;;
136 ppc)
137 cpu="ppc"
138 ;;
139 ppc64)
140 cpu="ppc64"
141 ;;
142 s390*)
143 cpu="s390"
144 ;;
145 sparc|sun4[cdmuv])
146 cpu="sparc"
147 ;;
148 sparc64)
149 cpu="sparc64"
150 ;;
151 *)
152 cpu="unknown"
153 ;;
154 esac
155 gprof="no"
156 sparse="no"
157 strip_opt="yes"
158 bigendian="no"
159 mingw32="no"
160 EXESUF=""
161 gdbstub="yes"
162 slirp="yes"
163 vde="yes"
164 fmod_lib=""
165 fmod_inc=""
166 oss_lib=""
167 vnc_tls="yes"
168 vnc_sasl="yes"
169 bsd="no"
170 linux="no"
171 solaris="no"
172 kqemu="no"
173 profiler="no"
174 cocoa="no"
175 check_gfx="yes"
176 softmmu="yes"
177 linux_user="no"
178 darwin_user="no"
179 bsd_user="no"
180 build_docs="no"
181 uname_release=""
182 curses="yes"
183 aio="yes"
184 nptl="yes"
185 mixemu="no"
186 bluez="yes"
187 kvm="yes"
188 kerneldir=""
189 aix="no"
190 blobs="yes"
191 fdt="yes"
192 sdl_x11="no"
193 pkgversion=""
194
195 # OS specific
196 if check_define __linux__ ; then
197 targetos="Linux"
198 elif check_define _WIN32 ; then
199 targetos='MINGW32'
200 else
201 targetos=`uname -s`
202 fi
203 case $targetos in
204 CYGWIN*)
205 mingw32="yes"
206 OS_CFLAGS="-mno-cygwin"
207 if [ "$cpu" = "i386" ] ; then
208 kqemu="yes"
209 fi
210 audio_possible_drivers="sdl"
211 ;;
212 MINGW32*)
213 mingw32="yes"
214 if [ "$cpu" = "i386" ] ; then
215 kqemu="yes"
216 fi
217 audio_possible_drivers="dsound sdl fmod"
218 ;;
219 GNU/kFreeBSD)
220 audio_drv_list="oss"
221 audio_possible_drivers="oss sdl esd pa"
222 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
223 kqemu="yes"
224 fi
225 ;;
226 FreeBSD)
227 bsd="yes"
228 audio_drv_list="oss"
229 audio_possible_drivers="oss sdl esd pa"
230 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
231 kqemu="yes"
232 fi
233 ;;
234 DragonFly)
235 bsd="yes"
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"
240 fi
241 aio="no"
242 ;;
243 NetBSD)
244 bsd="yes"
245 audio_drv_list="oss"
246 audio_possible_drivers="oss sdl esd"
247 oss_lib="-lossaudio"
248 ;;
249 OpenBSD)
250 bsd="yes"
251 openbsd="yes"
252 audio_drv_list="oss"
253 audio_possible_drivers="oss sdl esd"
254 oss_lib="-lossaudio"
255 ;;
256 Darwin)
257 bsd="yes"
258 darwin="yes"
259 # 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
260 if [ "$cpu" = "i386" ] ; then
261 is_x86_64=`sysctl -n hw.optional.x86_64`
262 [ "$is_x86_64" = "1" ] && cpu=x86_64
263 fi
264 if [ "$cpu" = "x86_64" ] ; then
265 OS_CFLAGS="-arch x86_64"
266 LDFLAGS="-arch x86_64"
267 else
268 OS_CFLAGS="-mdynamic-no-pic"
269 fi
270 darwin_user="yes"
271 cocoa="yes"
272 audio_drv_list="coreaudio"
273 audio_possible_drivers="coreaudio sdl fmod"
274 OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
275 ;;
276 SunOS)
277 solaris="yes"
278 make="gmake"
279 install="ginstall"
280 needs_libsunmath="no"
281 kvm="no"
282 solarisrev=`uname -r | cut -f2 -d.`
283 # have to select again, because `uname -m` returns i86pc
284 # even on an x86_64 box.
285 solariscpu=`isainfo -k`
286 if test "${solariscpu}" = "amd64" ; then
287 cpu="x86_64"
288 fi
289 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
290 if test "$solarisrev" -le 9 ; then
291 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
292 needs_libsunmath="yes"
293 else
294 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
295 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
296 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
297 echo "Studio 11 can be downloaded from www.sun.com."
298 exit 1
299 fi
300 fi
301 if test "$solarisrev" -ge 9 ; then
302 kqemu="yes"
303 fi
304 fi
305 if test -f /usr/include/sys/soundcard.h ; then
306 audio_drv_list="oss"
307 fi
308 audio_possible_drivers="oss sdl"
309 ;;
310 AIX)
311 aix="yes"
312 make="gmake"
313 ;;
314 *)
315 audio_drv_list="oss"
316 audio_possible_drivers="oss alsa sdl esd pa"
317 linux="yes"
318 linux_user="yes"
319 usb="linux"
320 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
321 kqemu="yes"
322 audio_possible_drivers="$audio_possible_drivers fmod"
323 fi
324 ;;
325 esac
326
327 if [ "$bsd" = "yes" ] ; then
328 if [ "$darwin" != "yes" ] ; then
329 make="gmake"
330 usb="bsd"
331 fi
332 bsd_user="yes"
333 fi
334
335 # find source path
336 source_path=`dirname "$0"`
337 source_path_used="no"
338 workdir=`pwd`
339 if [ -z "$source_path" ]; then
340 source_path=$workdir
341 else
342 source_path=`cd "$source_path"; pwd`
343 fi
344 [ -f "$workdir/vl.c" ] || source_path_used="yes"
345
346 werror="no"
347 # generate compile errors on warnings for development builds
348 #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
349 #werror="yes";
350 #fi
351
352 for opt do
353 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
354 case "$opt" in
355 --help|-h) show_help=yes
356 ;;
357 --prefix=*) prefix="$optarg"
358 ;;
359 --interp-prefix=*) interp_prefix="$optarg"
360 ;;
361 --source-path=*) source_path="$optarg"
362 source_path_used="yes"
363 ;;
364 --cross-prefix=*)
365 ;;
366 --cc=*)
367 ;;
368 --host-cc=*) host_cc="$optarg"
369 ;;
370 --make=*) make="$optarg"
371 ;;
372 --install=*) install="$optarg"
373 ;;
374 --extra-cflags=*) CFLAGS="$optarg"
375 ;;
376 --extra-ldflags=*) LDFLAGS="$optarg"
377 ;;
378 --cpu=*) cpu="$optarg"
379 ;;
380 --target-list=*) target_list="$optarg"
381 ;;
382 --enable-gprof) gprof="yes"
383 ;;
384 --static) static="yes"
385 ;;
386 --disable-sdl) sdl="no"
387 ;;
388 --fmod-lib=*) fmod_lib="$optarg"
389 ;;
390 --fmod-inc=*) fmod_inc="$optarg"
391 ;;
392 --oss-lib=*) oss_lib="$optarg"
393 ;;
394 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
395 ;;
396 --audio-drv-list=*) audio_drv_list="$optarg"
397 ;;
398 --enable-sparse) sparse="yes"
399 ;;
400 --disable-sparse) sparse="no"
401 ;;
402 --disable-strip) strip_opt="no"
403 ;;
404 --disable-vnc-tls) vnc_tls="no"
405 ;;
406 --disable-vnc-sasl) vnc_sasl="no"
407 ;;
408 --disable-slirp) slirp="no"
409 ;;
410 --disable-vde) vde="no"
411 ;;
412 --disable-kqemu) kqemu="no"
413 ;;
414 --disable-brlapi) brlapi="no"
415 ;;
416 --disable-bluez) bluez="no"
417 ;;
418 --disable-kvm) kvm="no"
419 ;;
420 --enable-profiler) profiler="yes"
421 ;;
422 --enable-cocoa)
423 cocoa="yes" ;
424 sdl="no" ;
425 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
426 ;;
427 --disable-gfx-check) check_gfx="no"
428 ;;
429 --disable-system) softmmu="no"
430 ;;
431 --enable-system) softmmu="yes"
432 ;;
433 --disable-linux-user) linux_user="no"
434 ;;
435 --enable-linux-user) linux_user="yes"
436 ;;
437 --disable-darwin-user) darwin_user="no"
438 ;;
439 --enable-darwin-user) darwin_user="yes"
440 ;;
441 --disable-bsd-user) bsd_user="no"
442 ;;
443 --enable-bsd-user) bsd_user="yes"
444 ;;
445 --enable-uname-release=*) uname_release="$optarg"
446 ;;
447 --sparc_cpu=*)
448 sparc_cpu="$optarg"
449 case $sparc_cpu in
450 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
451 target_cpu="sparc"; cpu="sparc" ;;
452 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
453 target_cpu="sparc"; cpu="sparc" ;;
454 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
455 target_cpu="sparc64"; cpu="sparc64" ;;
456 *) echo "undefined SPARC architecture. Exiting";exit 1;;
457 esac
458 ;;
459 --enable-werror) werror="yes"
460 ;;
461 --disable-werror) werror="no"
462 ;;
463 --disable-curses) curses="no"
464 ;;
465 --disable-nptl) nptl="no"
466 ;;
467 --enable-mixemu) mixemu="yes"
468 ;;
469 --disable-aio) aio="no"
470 ;;
471 --disable-blobs) blobs="no"
472 ;;
473 --kerneldir=*) kerneldir="$optarg"
474 ;;
475 --with-pkgversion=*) pkgversion=" ($optarg)"
476 ;;
477 *) echo "ERROR: unknown option $opt"; show_help="yes"
478 ;;
479 esac
480 done
481
482 # default flags for all hosts
483 CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
484 CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
485 LDFLAGS="$LDFLAGS -g"
486 if test "$werror" = "yes" ; then
487 CFLAGS="$CFLAGS -Werror"
488 fi
489
490 if test "$solaris" = "no" ; then
491 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
492 LDFLAGS="$LDFLAGS -Wl,--warn-common"
493 fi
494 fi
495
496 #
497 # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
498 # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
499 #
500 case "$cpu" in
501 sparc) if test -z "$sparc_cpu" ; then
502 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
503 ARCH_LDFLAGS="-m32"
504 else
505 ARCH_CFLAGS="${SP_CFLAGS}"
506 ARCH_LDFLAGS="${SP_LDFLAGS}"
507 fi
508 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
509 if test "$solaris" = "no" ; then
510 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6"
511 fi
512 ;;
513 sparc64) if test -z "$sparc_cpu" ; then
514 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
515 ARCH_LDFLAGS="-m64"
516 else
517 ARCH_CFLAGS="${SP_CFLAGS}"
518 ARCH_LDFLAGS="${SP_LDFLAGS}"
519 fi
520 if test "$solaris" = "no" ; then
521 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
522 else
523 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7"
524 fi
525 ;;
526 s390)
527 ARCH_CFLAGS="-march=z900"
528 ;;
529 i386)
530 ARCH_CFLAGS="-m32"
531 ARCH_LDFLAGS="-m32"
532 ;;
533 x86_64)
534 ARCH_CFLAGS="-m64"
535 ARCH_LDFLAGS="-m64"
536 ;;
537 esac
538
539 if test x"$show_help" = x"yes" ; then
540 cat << EOF
541
542 Usage: configure [options]
543 Options: [defaults in brackets after descriptions]
544
545 EOF
546 echo "Standard options:"
547 echo " --help print this message"
548 echo " --prefix=PREFIX install in PREFIX [$prefix]"
549 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
550 echo " use %M for cpu name [$interp_prefix]"
551 echo " --target-list=LIST set target list [$target_list]"
552 echo ""
553 echo "kqemu kernel acceleration support:"
554 echo " --disable-kqemu disable kqemu support"
555 echo ""
556 echo "Advanced options (experts only):"
557 echo " --source-path=PATH path of source code [$source_path]"
558 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
559 echo " --cc=CC use C compiler CC [$cc]"
560 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
561 echo " --extra-cflags=CFLAGS add C compiler flags CFLAGS"
562 echo " --extra-ldflags=LDFLAGS add linker flags LDFLAGS"
563 echo " --make=MAKE use specified make [$make]"
564 echo " --install=INSTALL use specified install [$install]"
565 echo " --static enable static build [$static]"
566 echo " --enable-sparse enable sparse checker"
567 echo " --disable-sparse disable sparse checker (default)"
568 echo " --disable-strip disable stripping binaries"
569 echo " --disable-werror disable compilation abort on warning"
570 echo " --disable-sdl disable SDL"
571 echo " --enable-cocoa enable COCOA (Mac OS X only)"
572 echo " --audio-drv-list=LIST set audio drivers list:"
573 echo " Available drivers: $audio_possible_drivers"
574 echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
575 echo " Available cards: $audio_possible_cards"
576 echo " --enable-mixemu enable mixer emulation"
577 echo " --disable-brlapi disable BrlAPI"
578 echo " --disable-vnc-tls disable TLS encryption for VNC server"
579 echo " --disable-vnc-sasl disable SASL encryption for VNC server"
580 echo " --disable-curses disable curses output"
581 echo " --disable-bluez disable bluez stack connectivity"
582 echo " --disable-kvm disable KVM acceleration support"
583 echo " --disable-nptl disable usermode NPTL support"
584 echo " --enable-system enable all system emulation targets"
585 echo " --disable-system disable all system emulation targets"
586 echo " --enable-linux-user enable all linux usermode emulation targets"
587 echo " --disable-linux-user disable all linux usermode emulation targets"
588 echo " --enable-darwin-user enable all darwin usermode emulation targets"
589 echo " --disable-darwin-user disable all darwin usermode emulation targets"
590 echo " --enable-bsd-user enable all BSD usermode emulation targets"
591 echo " --disable-bsd-user disable all BSD usermode emulation targets"
592 echo " --fmod-lib path to FMOD library"
593 echo " --fmod-inc path to FMOD includes"
594 echo " --oss-lib path to OSS library"
595 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
596 echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
597 echo " --disable-vde disable support for vde network"
598 echo " --disable-aio disable AIO support"
599 echo " --disable-blobs disable installing provided firmware blobs"
600 echo " --kerneldir=PATH look for kernel includes in PATH"
601 echo ""
602 echo "NOTE: The object files are built at the place where configure is launched"
603 exit 1
604 fi
605
606 if test "$mingw32" = "yes" ; then
607 linux="no"
608 EXESUF=".exe"
609 oss="no"
610 linux_user="no"
611 bsd_user="no"
612 OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
613 fi
614
615 if test ! -x "$(which cgcc 2>/dev/null)"; then
616 sparse="no"
617 fi
618
619 #
620 # Solaris specific configure tool chain decisions
621 #
622 if test "$solaris" = "yes" ; then
623 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
624 if test -z "$solinst" ; then
625 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
626 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
627 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
628 exit 1
629 fi
630 if test "$solinst" = "/usr/sbin/install" ; then
631 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
632 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
633 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
634 exit 1
635 fi
636 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
637 if test -z "$sol_ar" ; then
638 echo "Error: No path includes ar"
639 if test -f /usr/ccs/bin/ar ; then
640 echo "Add /usr/ccs/bin to your path and rerun configure"
641 fi
642 exit 1
643 fi
644 fi
645
646
647 if test -z "$target_list" ; then
648 # these targets are portable
649 if [ "$softmmu" = "yes" ] ; then
650 target_list="\
651 i386-softmmu \
652 x86_64-softmmu \
653 arm-softmmu \
654 cris-softmmu \
655 m68k-softmmu \
656 mips-softmmu \
657 mipsel-softmmu \
658 mips64-softmmu \
659 mips64el-softmmu \
660 ppc-softmmu \
661 ppcemb-softmmu \
662 ppc64-softmmu \
663 sh4-softmmu \
664 sh4eb-softmmu \
665 sparc-softmmu \
666 "
667 fi
668 # the following are Linux specific
669 if [ "$linux_user" = "yes" ] ; then
670 target_list="${target_list}\
671 i386-linux-user \
672 x86_64-linux-user \
673 alpha-linux-user \
674 arm-linux-user \
675 armeb-linux-user \
676 cris-linux-user \
677 m68k-linux-user \
678 mips-linux-user \
679 mipsel-linux-user \
680 ppc-linux-user \
681 ppc64-linux-user \
682 ppc64abi32-linux-user \
683 sh4-linux-user \
684 sh4eb-linux-user \
685 sparc-linux-user \
686 sparc64-linux-user \
687 sparc32plus-linux-user \
688 "
689 fi
690 # the following are Darwin specific
691 if [ "$darwin_user" = "yes" ] ; then
692 target_list="$target_list i386-darwin-user ppc-darwin-user "
693 fi
694 # the following are BSD specific
695 if [ "$bsd_user" = "yes" ] ; then
696 target_list="${target_list}\
697 i386-bsd-user \
698 x86_64-bsd-user \
699 sparc-bsd-user \
700 sparc64-bsd-user \
701 "
702 fi
703 else
704 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
705 fi
706 if test -z "$target_list" ; then
707 echo "No targets enabled"
708 exit 1
709 fi
710
711 if test -z "$cross_prefix" ; then
712
713 # ---
714 # big/little endian test
715 cat > $TMPC << EOF
716 #include <inttypes.h>
717 int main(int argc, char ** argv){
718 volatile uint32_t i=0x01234567;
719 return (*((uint8_t*)(&i))) == 0x67;
720 }
721 EOF
722
723 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
724 $TMPE && bigendian="yes"
725 else
726 echo big/little test failed
727 fi
728
729 else
730
731 # if cross compiling, cannot launch a program, so make a static guess
732 if test "$cpu" = "armv4b" \
733 -o "$cpu" = "hppa" \
734 -o "$cpu" = "m68k" \
735 -o "$cpu" = "mips" \
736 -o "$cpu" = "mips64" \
737 -o "$cpu" = "ppc" \
738 -o "$cpu" = "ppc64" \
739 -o "$cpu" = "s390" \
740 -o "$cpu" = "sparc" \
741 -o "$cpu" = "sparc64"; then
742 bigendian="yes"
743 fi
744
745 fi
746
747 # host long bits test
748 hostlongbits="32"
749 if test "$cpu" = "x86_64" \
750 -o "$cpu" = "alpha" \
751 -o "$cpu" = "ia64" \
752 -o "$cpu" = "sparc64" \
753 -o "$cpu" = "ppc64"; then
754 hostlongbits="64"
755 fi
756
757 # Check host NPTL support
758 cat > $TMPC <<EOF
759 #include <sched.h>
760 #include <linux/futex.h>
761 void foo()
762 {
763 #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
764 #error bork
765 #endif
766 }
767 EOF
768
769 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
770 :
771 else
772 nptl="no"
773 fi
774
775 ##########################################
776 # zlib check
777
778 cat > $TMPC << EOF
779 #include <zlib.h>
780 int main(void) { zlibVersion(); return 0; }
781 EOF
782 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
783 :
784 else
785 echo
786 echo "Error: zlib check failed"
787 echo "Make sure to have the zlib libs and headers installed."
788 echo
789 exit 1
790 fi
791
792 ##########################################
793 # SDL probe
794
795 sdl_too_old=no
796
797 if test -z "$sdl" ; then
798 sdl_config="sdl-config"
799 sdl=no
800 sdl_static=no
801
802 cat > $TMPC << EOF
803 #include <SDL.h>
804 #undef main /* We don't want SDL to override our main() */
805 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
806 EOF
807 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
808 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
809 if test "$_sdlversion" -lt 121 ; then
810 sdl_too_old=yes
811 else
812 if test "$cocoa" = "no" ; then
813 sdl=yes
814 fi
815 fi
816
817 # static link with sdl ?
818 if test "$sdl" = "yes" ; then
819 aa="no"
820 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
821 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
822 if [ "$aa" = "yes" ] ; then
823 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
824 fi
825
826 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
827 sdl_static=yes
828 fi
829 fi # static link
830 fi # sdl compile test
831 else
832 # Make sure to disable cocoa if sdl was set
833 if test "$sdl" = "yes" ; then
834 cocoa="no"
835 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
836 fi
837 fi # -z $sdl
838
839 if test "$sdl" = "yes" ; then
840 cat > $TMPC <<EOF
841 #include <SDL.h>
842 #if defined(SDL_VIDEO_DRIVER_X11)
843 #include <X11/XKBlib.h>
844 #else
845 #error No x11 support
846 #endif
847 int main(void) { return 0; }
848 EOF
849 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
850 sdl_x11="yes"
851 fi
852 fi
853
854 ##########################################
855 # VNC TLS detection
856 if test "$vnc_tls" = "yes" ; then
857 cat > $TMPC <<EOF
858 #include <gnutls/gnutls.h>
859 int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
860 EOF
861 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
862 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
863 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
864 $vnc_tls_libs > /dev/null 2> /dev/null ; then
865 :
866 else
867 vnc_tls="no"
868 fi
869 fi
870
871 ##########################################
872 # VNC SASL detection
873 if test "$vnc_sasl" = "yes" ; then
874 cat > $TMPC <<EOF
875 #include <sasl/sasl.h>
876 #include <stdio.h>
877 int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
878 EOF
879 # Assuming Cyrus-SASL installed in /usr prefix
880 vnc_sasl_cflags=""
881 vnc_sasl_libs="-lsasl2"
882 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
883 $vnc_sasl_libs 2> /dev/null ; then
884 :
885 else
886 vnc_sasl="no"
887 fi
888 fi
889
890 ##########################################
891 # fnmatch() probe, used for ACL routines
892 fnmatch="no"
893 cat > $TMPC << EOF
894 #include <fnmatch.h>
895 int main(void)
896 {
897 fnmatch("foo", "foo", 0);
898 return 0;
899 }
900 EOF
901 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
902 fnmatch="yes"
903 fi
904
905 ##########################################
906 # vde libraries probe
907 if test "$vde" = "yes" ; then
908 cat > $TMPC << EOF
909 #include <libvdeplug.h>
910 int main(void)
911 {
912 struct vde_open_args a = {0, 0, 0};
913 vde_open("", "", &a);
914 return 0;
915 }
916 EOF
917 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
918 :
919 else
920 vde="no"
921 fi
922 fi
923
924 ##########################################
925 # Sound support libraries probe
926
927 audio_drv_probe()
928 {
929 drv=$1
930 hdr=$2
931 lib=$3
932 exp=$4
933 cfl=$5
934 cat > $TMPC << EOF
935 #include <$hdr>
936 int main(void) { $exp }
937 EOF
938 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
939 :
940 else
941 echo
942 echo "Error: $drv check failed"
943 echo "Make sure to have the $drv libs and headers installed."
944 echo
945 exit 1
946 fi
947 }
948
949 audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
950 for drv in $audio_drv_list; do
951 case $drv in
952 alsa)
953 audio_drv_probe $drv alsa/asoundlib.h -lasound \
954 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
955 ;;
956
957 fmod)
958 if test -z $fmod_lib || test -z $fmod_inc; then
959 echo
960 echo "Error: You must specify path to FMOD library and headers"
961 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
962 echo
963 exit 1
964 fi
965 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
966 ;;
967
968 esd)
969 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
970 ;;
971
972 pa)
973 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
974 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
975 ;;
976
977 oss|sdl|core|wav|dsound)
978 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
979 ;;
980
981 *)
982 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
983 echo
984 echo "Error: Unknown driver '$drv' selected"
985 echo "Possible drivers are: $audio_possible_drivers"
986 echo
987 exit 1
988 }
989 ;;
990 esac
991 done
992
993 ##########################################
994 # BrlAPI probe
995
996 if test -z "$brlapi" ; then
997 brlapi=no
998 cat > $TMPC << EOF
999 #include <brlapi.h>
1000 int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1001 EOF
1002 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1003 brlapi=yes
1004 fi # brlapi compile test
1005 fi # -z $brlapi
1006
1007 ##########################################
1008 # curses probe
1009
1010 if test "$curses" = "yes" ; then
1011 curses=no
1012 cat > $TMPC << EOF
1013 #include <curses.h>
1014 #ifdef __OpenBSD__
1015 #define resize_term resizeterm
1016 #endif
1017 int main(void) { resize_term(0, 0); return curses_version(); }
1018 EOF
1019 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1020 curses=yes
1021 fi
1022 fi # test "$curses"
1023
1024 ##########################################
1025 # bluez support probe
1026 if test "$bluez" = "yes" ; then
1027 `pkg-config bluez` || bluez="no"
1028 fi
1029 if test "$bluez" = "yes" ; then
1030 cat > $TMPC << EOF
1031 #include <bluetooth/bluetooth.h>
1032 int main(void) { return bt_error(0); }
1033 EOF
1034 bluez_cflags=`pkg-config --cflags bluez`
1035 bluez_libs=`pkg-config --libs bluez`
1036 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1037 $bluez_libs > /dev/null 2> /dev/null ; then
1038 :
1039 else
1040 bluez="no"
1041 fi
1042 fi
1043
1044 ##########################################
1045 # kvm probe
1046 if test "$kvm" = "yes" ; then
1047 cat > $TMPC <<EOF
1048 #include <linux/kvm.h>
1049 #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1050 #error Invalid KVM version
1051 #endif
1052 #if !defined(KVM_CAP_USER_MEMORY)
1053 #error Missing KVM capability KVM_CAP_USER_MEMORY
1054 #endif
1055 #if !defined(KVM_CAP_SET_TSS_ADDR)
1056 #error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1057 #endif
1058 #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1059 #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1060 #endif
1061 int main(void) { return 0; }
1062 EOF
1063 if test "$kerneldir" != "" ; then
1064 kvm_cflags=-I"$kerneldir"/include
1065 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1066 -a -d "$kerneldir/arch/x86/include" ; then
1067 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1068 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1069 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1070 elif test -d "$kerneldir/arch/$cpu/include" ; then
1071 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1072 fi
1073 else
1074 kvm_cflags=""
1075 fi
1076 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1077 > /dev/null 2>/dev/null ; then
1078 :
1079 else
1080 kvm="no";
1081 if [ -x "`which awk 2>/dev/null`" ] && \
1082 [ -x "`which grep 2>/dev/null`" ]; then
1083 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1084 | grep "error: " \
1085 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1086 if test "$kvmerr" != "" ; then
1087 kvm="no - (${kvmerr})"
1088 fi
1089 fi
1090 fi
1091 fi
1092
1093 ##########################################
1094 # AIO probe
1095 AIOLIBS=""
1096
1097 if test "$aio" = "yes" ; then
1098 aio=no
1099 cat > $TMPC << EOF
1100 #include <pthread.h>
1101 int main(void) { pthread_mutex_t lock; return 0; }
1102 EOF
1103 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1104 aio=yes
1105 AIOLIBS="-lpthread"
1106 fi
1107 fi
1108
1109 ##########################################
1110 # iovec probe
1111 cat > $TMPC <<EOF
1112 #include <sys/types.h>
1113 #include <sys/uio.h>
1114 #include <unistd.h>
1115 int main(void) { struct iovec iov; return 0; }
1116 EOF
1117 iovec=no
1118 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1119 iovec=yes
1120 fi
1121
1122 ##########################################
1123 # preadv probe
1124 cat > $TMPC <<EOF
1125 #include <sys/types.h>
1126 #include <sys/uio.h>
1127 #include <unistd.h>
1128 int main(void) { preadv; }
1129 EOF
1130 preadv=no
1131 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1132 preadv=yes
1133 fi
1134
1135 ##########################################
1136 # fdt probe
1137 if test "$fdt" = "yes" ; then
1138 fdt=no
1139 cat > $TMPC << EOF
1140 int main(void) { return 0; }
1141 EOF
1142 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1143 fdt=yes
1144 fi
1145 fi
1146
1147 # Check if tools are available to build documentation.
1148 if [ -x "`which texi2html 2>/dev/null`" ] && \
1149 [ -x "`which pod2man 2>/dev/null`" ]; then
1150 build_docs="yes"
1151 fi
1152
1153 ##########################################
1154 # Do we need librt
1155 cat > $TMPC <<EOF
1156 #include <signal.h>
1157 #include <time.h>
1158 int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1159 EOF
1160
1161 rt=no
1162 if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1163 :
1164 elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1165 rt=yes
1166 fi
1167
1168 if test "$rt" = "yes" ; then
1169 # Hack, we should have a general purpose LIBS for this sort of thing
1170 AIOLIBS="$AIOLIBS -lrt"
1171 fi
1172
1173 if test "$mingw32" = "yes" ; then
1174 if test -z "$prefix" ; then
1175 prefix="c:\\\\Program Files\\\\Qemu"
1176 fi
1177 mansuffix=""
1178 datasuffix=""
1179 docsuffix=""
1180 binsuffix=""
1181 else
1182 if test -z "$prefix" ; then
1183 prefix="/usr/local"
1184 fi
1185 mansuffix="/share/man"
1186 datasuffix="/share/qemu"
1187 docsuffix="/share/doc/qemu"
1188 binsuffix="/bin"
1189 fi
1190
1191 echo "Install prefix $prefix"
1192 echo "BIOS directory $prefix$datasuffix"
1193 echo "binary directory $prefix$binsuffix"
1194 if test "$mingw32" = "no" ; then
1195 echo "Manual directory $prefix$mansuffix"
1196 echo "ELF interp prefix $interp_prefix"
1197 fi
1198 echo "Source path $source_path"
1199 echo "C compiler $cc"
1200 echo "Host C compiler $host_cc"
1201 echo "ARCH_CFLAGS $ARCH_CFLAGS"
1202 echo "make $make"
1203 echo "install $install"
1204 echo "host CPU $cpu"
1205 echo "host big endian $bigendian"
1206 echo "target list $target_list"
1207 echo "gprof enabled $gprof"
1208 echo "sparse enabled $sparse"
1209 echo "strip binaries $strip_opt"
1210 echo "profiler $profiler"
1211 echo "static build $static"
1212 echo "-Werror enabled $werror"
1213 if test "$darwin" = "yes" ; then
1214 echo "Cocoa support $cocoa"
1215 fi
1216 echo "SDL support $sdl"
1217 if test "$sdl" != "no" ; then
1218 echo "SDL static link $sdl_static"
1219 fi
1220 echo "curses support $curses"
1221 echo "mingw32 support $mingw32"
1222 echo "Audio drivers $audio_drv_list"
1223 echo "Extra audio cards $audio_card_list"
1224 echo "Mixer emulation $mixemu"
1225 echo "VNC TLS support $vnc_tls"
1226 if test "$vnc_tls" = "yes" ; then
1227 echo " TLS CFLAGS $vnc_tls_cflags"
1228 echo " TLS LIBS $vnc_tls_libs"
1229 fi
1230 echo "VNC SASL support $vnc_sasl"
1231 if test "$vnc_sasl" = "yes" ; then
1232 echo " SASL CFLAGS $vnc_sasl_cflags"
1233 echo " SASL LIBS $vnc_sasl_libs"
1234 fi
1235 if test -n "$sparc_cpu"; then
1236 echo "Target Sparc Arch $sparc_cpu"
1237 fi
1238 echo "kqemu support $kqemu"
1239 echo "brlapi support $brlapi"
1240 echo "Documentation $build_docs"
1241 [ ! -z "$uname_release" ] && \
1242 echo "uname -r $uname_release"
1243 echo "NPTL support $nptl"
1244 echo "vde support $vde"
1245 echo "AIO support $aio"
1246 echo "Install blobs $blobs"
1247 echo "KVM support $kvm"
1248 echo "fdt support $fdt"
1249 echo "preadv support $preadv"
1250
1251 if test $sdl_too_old = "yes"; then
1252 echo "-> Your SDL version is too old - please upgrade to have SDL support"
1253 fi
1254 if [ -s $TMPSDLLOG ]; then
1255 echo "The error log from compiling the libSDL test is: "
1256 cat $TMPSDLLOG
1257 fi
1258 #if test "$sdl_static" = "no"; then
1259 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1260 #fi
1261 config_mak="config-host.mak"
1262 config_h="config-host.h"
1263
1264 #echo "Creating $config_mak and $config_h"
1265
1266 test -f $config_h && mv $config_h ${config_h}~
1267
1268 echo "# Automatically generated by configure - do not modify" > $config_mak
1269 printf "# Configured with:" >> $config_mak
1270 printf " '%s'" "$0" "$@" >> $config_mak
1271 echo >> $config_mak
1272 echo "/* Automatically generated by configure - do not modify */" > $config_h
1273
1274 echo "prefix=$prefix" >> $config_mak
1275 echo "bindir=\${prefix}$binsuffix" >> $config_mak
1276 echo "mandir=\${prefix}$mansuffix" >> $config_mak
1277 echo "datadir=\${prefix}$datasuffix" >> $config_mak
1278 echo "docdir=\${prefix}$docsuffix" >> $config_mak
1279 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1280 echo "MAKE=$make" >> $config_mak
1281 echo "INSTALL=$install" >> $config_mak
1282 echo "CC=$cc" >> $config_mak
1283 echo "HOST_CC=$host_cc" >> $config_mak
1284 echo "AR=$ar" >> $config_mak
1285 # XXX: only use CFLAGS and LDFLAGS ?
1286 # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1287 # compilation of dyngen tool (useful for win32 build on Linux host)
1288 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1289 echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1290 echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1291 echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1292 echo "CFLAGS=$CFLAGS" >> $config_mak
1293 echo "LDFLAGS=$LDFLAGS" >> $config_mak
1294 echo "EXESUF=$EXESUF" >> $config_mak
1295 echo "AIOLIBS=$AIOLIBS" >> $config_mak
1296 case "$cpu" in
1297 i386)
1298 echo "ARCH=i386" >> $config_mak
1299 echo "#define HOST_I386 1" >> $config_h
1300 ;;
1301 x86_64)
1302 echo "ARCH=x86_64" >> $config_mak
1303 echo "#define HOST_X86_64 1" >> $config_h
1304 ;;
1305 alpha)
1306 echo "ARCH=alpha" >> $config_mak
1307 echo "#define HOST_ALPHA 1" >> $config_h
1308 ;;
1309 armv4b)
1310 echo "ARCH=arm" >> $config_mak
1311 echo "#define HOST_ARM 1" >> $config_h
1312 ;;
1313 armv4l)
1314 echo "ARCH=arm" >> $config_mak
1315 echo "#define HOST_ARM 1" >> $config_h
1316 ;;
1317 cris)
1318 echo "ARCH=cris" >> $config_mak
1319 echo "#define HOST_CRIS 1" >> $config_h
1320 ;;
1321 hppa)
1322 echo "ARCH=hppa" >> $config_mak
1323 echo "#define HOST_HPPA 1" >> $config_h
1324 ;;
1325 ia64)
1326 echo "ARCH=ia64" >> $config_mak
1327 echo "#define HOST_IA64 1" >> $config_h
1328 ;;
1329 m68k)
1330 echo "ARCH=m68k" >> $config_mak
1331 echo "#define HOST_M68K 1" >> $config_h
1332 ;;
1333 mips)
1334 echo "ARCH=mips" >> $config_mak
1335 echo "#define HOST_MIPS 1" >> $config_h
1336 ;;
1337 mips64)
1338 echo "ARCH=mips64" >> $config_mak
1339 echo "#define HOST_MIPS64 1" >> $config_h
1340 ;;
1341 ppc)
1342 echo "ARCH=ppc" >> $config_mak
1343 echo "#define HOST_PPC 1" >> $config_h
1344 ;;
1345 ppc64)
1346 echo "ARCH=ppc64" >> $config_mak
1347 echo "#define HOST_PPC64 1" >> $config_h
1348 ;;
1349 s390)
1350 echo "ARCH=s390" >> $config_mak
1351 echo "#define HOST_S390 1" >> $config_h
1352 ;;
1353 sparc)
1354 echo "ARCH=sparc" >> $config_mak
1355 echo "#define HOST_SPARC 1" >> $config_h
1356 ;;
1357 sparc64)
1358 echo "ARCH=sparc64" >> $config_mak
1359 echo "#define HOST_SPARC64 1" >> $config_h
1360 ;;
1361 *)
1362 echo "Unsupported CPU = $cpu"
1363 exit 1
1364 ;;
1365 esac
1366 if test "$sparse" = "yes" ; then
1367 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1368 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1369 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1370 fi
1371 if test "$strip_opt" = "yes" ; then
1372 echo "STRIP_OPT=-s" >> $config_mak
1373 fi
1374 if test "$bigendian" = "yes" ; then
1375 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1376 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1377 fi
1378 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1379 if test "$mingw32" = "yes" ; then
1380 echo "CONFIG_WIN32=yes" >> $config_mak
1381 echo "#define CONFIG_WIN32 1" >> $config_h
1382 else
1383 cat > $TMPC << EOF
1384 #include <byteswap.h>
1385 int main(void) { return bswap_32(0); }
1386 EOF
1387 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1388 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1389 fi
1390 cat > $TMPC << EOF
1391 #include <sys/endian.h>
1392 #include <sys/types.h>
1393 #include <machine/bswap.h>
1394 int main(void) { return bswap32(0); }
1395 EOF
1396 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1397 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1398 fi
1399 fi
1400
1401 if [ "$openbsd" = "yes" ] ; then
1402 echo "#define ENOTSUP 4096" >> $config_h
1403 fi
1404
1405 if test "$darwin" = "yes" ; then
1406 echo "CONFIG_DARWIN=yes" >> $config_mak
1407 echo "#define CONFIG_DARWIN 1" >> $config_h
1408 fi
1409
1410 if test "$aix" = "yes" ; then
1411 echo "CONFIG_AIX=yes" >> $config_mak
1412 echo "#define CONFIG_AIX 1" >> $config_h
1413 fi
1414
1415 if test "$solaris" = "yes" ; then
1416 echo "CONFIG_SOLARIS=yes" >> $config_mak
1417 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1418 if test "$needs_libsunmath" = "yes" ; then
1419 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1420 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1421 fi
1422 fi
1423 if test -n "$sparc_cpu"; then
1424 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1425 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1426 fi
1427 if test "$gdbstub" = "yes" ; then
1428 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1429 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1430 fi
1431 if test "$gprof" = "yes" ; then
1432 echo "TARGET_GPROF=yes" >> $config_mak
1433 echo "#define HAVE_GPROF 1" >> $config_h
1434 fi
1435 if test "$static" = "yes" ; then
1436 echo "CONFIG_STATIC=yes" >> $config_mak
1437 echo "#define CONFIG_STATIC 1" >> $config_h
1438 fi
1439 if test $profiler = "yes" ; then
1440 echo "#define CONFIG_PROFILER 1" >> $config_h
1441 fi
1442 if test "$slirp" = "yes" ; then
1443 echo "CONFIG_SLIRP=yes" >> $config_mak
1444 echo "#define CONFIG_SLIRP 1" >> $config_h
1445 fi
1446 if test "$vde" = "yes" ; then
1447 echo "CONFIG_VDE=yes" >> $config_mak
1448 echo "#define CONFIG_VDE 1" >> $config_h
1449 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1450 fi
1451 for card in $audio_card_list; do
1452 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1453 echo "$def=yes" >> $config_mak
1454 echo "#define $def 1" >> $config_h
1455 done
1456 echo "#define AUDIO_DRIVERS \\" >> $config_h
1457 for drv in $audio_drv_list; do
1458 echo " &${drv}_audio_driver, \\" >>$config_h
1459 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1460 echo "$def=yes" >> $config_mak
1461 if test "$drv" = "fmod"; then
1462 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1463 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1464 elif test "$drv" = "oss"; then
1465 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1466 fi
1467 done
1468 echo "" >>$config_h
1469 if test "$mixemu" = "yes" ; then
1470 echo "CONFIG_MIXEMU=yes" >> $config_mak
1471 echo "#define CONFIG_MIXEMU 1" >> $config_h
1472 fi
1473 if test "$vnc_tls" = "yes" ; then
1474 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1475 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1476 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1477 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1478 fi
1479 if test "$vnc_sasl" = "yes" ; then
1480 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1481 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1482 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1483 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1484 fi
1485 if test "$fnmatch" = "yes" ; then
1486 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1487 fi
1488 qemu_version=`head $source_path/VERSION`
1489 echo "VERSION=$qemu_version" >>$config_mak
1490 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1491
1492 echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h
1493
1494 echo "SRC_PATH=$source_path" >> $config_mak
1495 if [ "$source_path_used" = "yes" ]; then
1496 echo "VPATH=$source_path" >> $config_mak
1497 fi
1498 echo "TARGET_DIRS=$target_list" >> $config_mak
1499 if [ "$build_docs" = "yes" ] ; then
1500 echo "BUILD_DOCS=yes" >> $config_mak
1501 fi
1502 if test "$static" = "yes"; then
1503 sdl1=$sdl_static
1504 else
1505 sdl1=$sdl
1506 fi
1507 if test "$sdl1" = "yes" ; then
1508 echo "#define CONFIG_SDL 1" >> $config_h
1509 echo "CONFIG_SDL=yes" >> $config_mak
1510 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1511 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1512 elif test "$sdl_x11" = "yes" ; then
1513 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1514 else
1515 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1516 fi
1517 if [ "${aa}" = "yes" ] ; then
1518 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1519 else
1520 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1521 fi
1522 fi
1523 if test "$cocoa" = "yes" ; then
1524 echo "#define CONFIG_COCOA 1" >> $config_h
1525 echo "CONFIG_COCOA=yes" >> $config_mak
1526 fi
1527 if test "$curses" = "yes" ; then
1528 echo "#define CONFIG_CURSES 1" >> $config_h
1529 echo "CONFIG_CURSES=yes" >> $config_mak
1530 echo "CURSES_LIBS=-lcurses" >> $config_mak
1531 fi
1532 if test "$brlapi" = "yes" ; then
1533 echo "CONFIG_BRLAPI=yes" >> $config_mak
1534 echo "#define CONFIG_BRLAPI 1" >> $config_h
1535 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1536 fi
1537 if test "$bluez" = "yes" ; then
1538 echo "CONFIG_BLUEZ=yes" >> $config_mak
1539 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1540 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1541 echo "#define CONFIG_BLUEZ 1" >> $config_h
1542 fi
1543 if test "$aio" = "yes" ; then
1544 echo "#define CONFIG_AIO 1" >> $config_h
1545 echo "CONFIG_AIO=yes" >> $config_mak
1546 fi
1547 if test "$blobs" = "yes" ; then
1548 echo "INSTALL_BLOBS=yes" >> $config_mak
1549 fi
1550 if test "$iovec" = "yes" ; then
1551 echo "#define HAVE_IOVEC 1" >> $config_h
1552 fi
1553 if test "$preadv" = "yes" ; then
1554 echo "#define HAVE_PREADV 1" >> $config_h
1555 fi
1556 if test "$fdt" = "yes" ; then
1557 echo "#define HAVE_FDT 1" >> $config_h
1558 echo "FDT_LIBS=-lfdt" >> $config_mak
1559 fi
1560
1561 # XXX: suppress that
1562 if [ "$bsd" = "yes" ] ; then
1563 echo "#define O_LARGEFILE 0" >> $config_h
1564 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1565 echo "#define HOST_BSD 1" >> $config_h
1566 fi
1567
1568 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1569
1570 # USB host support
1571 case "$usb" in
1572 linux)
1573 echo "HOST_USB=linux" >> $config_mak
1574 ;;
1575 bsd)
1576 echo "HOST_USB=bsd" >> $config_mak
1577 ;;
1578 *)
1579 echo "HOST_USB=stub" >> $config_mak
1580 ;;
1581 esac
1582
1583 tools=
1584 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1585 tools="qemu-img\$(EXESUF) $tools"
1586 if [ "$linux" = "yes" ] ; then
1587 tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
1588 fi
1589 fi
1590 echo "TOOLS=$tools" >> $config_mak
1591
1592 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1593
1594 for target in $target_list; do
1595 target_dir="$target"
1596 config_mak=$target_dir/config.mak
1597 config_h=$target_dir/config.h
1598 target_cpu=`echo $target | cut -d '-' -f 1`
1599 target_bigendian="no"
1600 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
1601 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
1602 [ "$target_cpu" = "mips" ] && target_bigendian=yes
1603 [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1604 [ "$target_cpu" = "mips64" ] && target_bigendian=yes
1605 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
1606 [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1607 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1608 [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1609 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1610 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
1611 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1612 [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1613 target_softmmu="no"
1614 target_user_only="no"
1615 target_linux_user="no"
1616 target_darwin_user="no"
1617 target_bsd_user="no"
1618 case "$target" in
1619 ${target_cpu}-softmmu)
1620 target_softmmu="yes"
1621 ;;
1622 ${target_cpu}-linux-user)
1623 target_user_only="yes"
1624 target_linux_user="yes"
1625 ;;
1626 ${target_cpu}-darwin-user)
1627 target_user_only="yes"
1628 target_darwin_user="yes"
1629 ;;
1630 ${target_cpu}-bsd-user)
1631 target_user_only="yes"
1632 target_bsd_user="yes"
1633 ;;
1634 *)
1635 echo "ERROR: Target '$target' not recognised"
1636 exit 1
1637 ;;
1638 esac
1639
1640 if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1641 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1642 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1643 echo "To build QEMU without graphical output configure with --disable-gfx-check"
1644 echo "Note that this will disable all output from the virtual graphics card"
1645 echo "except through VNC or curses."
1646 exit 1;
1647 fi
1648
1649 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1650
1651 test -f $config_h && mv $config_h ${config_h}~
1652
1653 mkdir -p $target_dir
1654 mkdir -p $target_dir/fpu
1655 mkdir -p $target_dir/tcg
1656 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1657 mkdir -p $target_dir/nwfpe
1658 fi
1659
1660 #
1661 # don't use ln -sf as not all "ln -sf" over write the file/link
1662 #
1663 rm -f $target_dir/Makefile
1664 ln -s $source_path/Makefile.target $target_dir/Makefile
1665
1666
1667 echo "# Automatically generated by configure - do not modify" > $config_mak
1668 echo "/* Automatically generated by configure - do not modify */" > $config_h
1669
1670
1671 echo "include ../config-host.mak" >> $config_mak
1672 echo "#include \"../config-host.h\"" >> $config_h
1673
1674 bflt="no"
1675 elfload32="no"
1676 target_nptl="no"
1677 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1678 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1679 gdb_xml_files=""
1680
1681 # Make sure the target and host cpus are compatible
1682 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1683 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1684 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1685 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
1686 kvm="no"
1687 fi
1688 # Disable KVM for linux-user
1689 if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1690 kvm="no"
1691 fi
1692
1693 case "$target_cpu" in
1694 i386)
1695 echo "TARGET_ARCH=i386" >> $config_mak
1696 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1697 echo "#define TARGET_I386 1" >> $config_h
1698 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1699 then
1700 echo "#define USE_KQEMU 1" >> $config_h
1701 fi
1702 if test "$kvm" = "yes" ; then
1703 echo "CONFIG_KVM=yes" >> $config_mak
1704 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1705 echo "#define CONFIG_KVM 1" >> $config_h
1706 fi
1707 ;;
1708 x86_64)
1709 echo "TARGET_ARCH=x86_64" >> $config_mak
1710 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1711 echo "#define TARGET_I386 1" >> $config_h
1712 echo "#define TARGET_X86_64 1" >> $config_h
1713 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1714 then
1715 echo "#define USE_KQEMU 1" >> $config_h
1716 fi
1717 if test "$kvm" = "yes" ; then
1718 echo "CONFIG_KVM=yes" >> $config_mak
1719 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1720 echo "#define CONFIG_KVM 1" >> $config_h
1721 fi
1722 ;;
1723 alpha)
1724 echo "TARGET_ARCH=alpha" >> $config_mak
1725 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1726 echo "#define TARGET_ALPHA 1" >> $config_h
1727 ;;
1728 arm|armeb)
1729 echo "TARGET_ARCH=arm" >> $config_mak
1730 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1731 echo "#define TARGET_ARM 1" >> $config_h
1732 bflt="yes"
1733 target_nptl="yes"
1734 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1735 ;;
1736 cris)
1737 echo "TARGET_ARCH=cris" >> $config_mak
1738 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1739 echo "#define TARGET_CRIS 1" >> $config_h
1740 target_nptl="yes"
1741 ;;
1742 m68k)
1743 echo "TARGET_ARCH=m68k" >> $config_mak
1744 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1745 echo "#define TARGET_M68K 1" >> $config_h
1746 bflt="yes"
1747 gdb_xml_files="cf-core.xml cf-fp.xml"
1748 ;;
1749 mips|mipsel)
1750 echo "TARGET_ARCH=mips" >> $config_mak
1751 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1752 echo "#define TARGET_MIPS 1" >> $config_h
1753 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1754 ;;
1755 mipsn32|mipsn32el)
1756 echo "TARGET_ARCH=mipsn32" >> $config_mak
1757 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1758 echo "#define TARGET_MIPS 1" >> $config_h
1759 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1760 ;;
1761 mips64|mips64el)
1762 echo "TARGET_ARCH=mips64" >> $config_mak
1763 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1764 echo "#define TARGET_MIPS 1" >> $config_h
1765 echo "#define TARGET_MIPS64 1" >> $config_h
1766 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1767 ;;
1768 ppc)
1769 echo "TARGET_ARCH=ppc" >> $config_mak
1770 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1771 echo "#define TARGET_PPC 1" >> $config_h
1772 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1773 ;;
1774 ppcemb)
1775 echo "TARGET_ARCH=ppcemb" >> $config_mak
1776 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1777 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1778 echo "#define TARGET_PPC 1" >> $config_h
1779 echo "#define TARGET_PPCEMB 1" >> $config_h
1780 if test "$kvm" = "yes" ; then
1781 echo "CONFIG_KVM=yes" >> $config_mak
1782 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1783 echo "#define CONFIG_KVM 1" >> $config_h
1784 fi
1785 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1786 ;;
1787 ppc64)
1788 echo "TARGET_ARCH=ppc64" >> $config_mak
1789 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1790 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1791 echo "#define TARGET_PPC 1" >> $config_h
1792 echo "#define TARGET_PPC64 1" >> $config_h
1793 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1794 ;;
1795 ppc64abi32)
1796 echo "TARGET_ARCH=ppc64" >> $config_mak
1797 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1798 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1799 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1800 echo "#define TARGET_PPC 1" >> $config_h
1801 echo "#define TARGET_PPC64 1" >> $config_h
1802 echo "#define TARGET_ABI32 1" >> $config_h
1803 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1804 ;;
1805 sh4|sh4eb)
1806 echo "TARGET_ARCH=sh4" >> $config_mak
1807 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1808 echo "#define TARGET_SH4 1" >> $config_h
1809 bflt="yes"
1810 target_nptl="yes"
1811 ;;
1812 sparc)
1813 echo "TARGET_ARCH=sparc" >> $config_mak
1814 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1815 echo "#define TARGET_SPARC 1" >> $config_h
1816 ;;
1817 sparc64)
1818 echo "TARGET_ARCH=sparc64" >> $config_mak
1819 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1820 echo "#define TARGET_SPARC 1" >> $config_h
1821 echo "#define TARGET_SPARC64 1" >> $config_h
1822 elfload32="yes"
1823 ;;
1824 sparc32plus)
1825 echo "TARGET_ARCH=sparc64" >> $config_mak
1826 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1827 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1828 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1829 echo "#define TARGET_SPARC 1" >> $config_h
1830 echo "#define TARGET_SPARC64 1" >> $config_h
1831 echo "#define TARGET_ABI32 1" >> $config_h
1832 ;;
1833 *)
1834 echo "Unsupported target CPU"
1835 exit 1
1836 ;;
1837 esac
1838 if test "$target_bigendian" = "yes" ; then
1839 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1840 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1841 fi
1842 if test "$target_softmmu" = "yes" ; then
1843 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1844 echo "#define CONFIG_SOFTMMU 1" >> $config_h
1845 fi
1846 if test "$target_user_only" = "yes" ; then
1847 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1848 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1849 fi
1850 if test "$target_linux_user" = "yes" ; then
1851 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1852 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1853 fi
1854 if test "$target_darwin_user" = "yes" ; then
1855 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1856 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1857 fi
1858 list=""
1859 if test ! -z "$gdb_xml_files" ; then
1860 for x in $gdb_xml_files; do
1861 list="$list $source_path/gdb-xml/$x"
1862 done
1863 fi
1864 echo "TARGET_XML_FILES=$list" >> $config_mak
1865
1866 if test "$target_cpu" = "arm" \
1867 -o "$target_cpu" = "armeb" \
1868 -o "$target_cpu" = "m68k" \
1869 -o "$target_cpu" = "mips" \
1870 -o "$target_cpu" = "mipsel" \
1871 -o "$target_cpu" = "mipsn32" \
1872 -o "$target_cpu" = "mipsn32el" \
1873 -o "$target_cpu" = "mips64" \
1874 -o "$target_cpu" = "mips64el" \
1875 -o "$target_cpu" = "ppc" \
1876 -o "$target_cpu" = "ppc64" \
1877 -o "$target_cpu" = "ppc64abi32" \
1878 -o "$target_cpu" = "ppcemb" \
1879 -o "$target_cpu" = "sparc" \
1880 -o "$target_cpu" = "sparc64" \
1881 -o "$target_cpu" = "sparc32plus"; then
1882 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1883 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1884 fi
1885 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1886 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1887 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1888 fi
1889 if test "$target_user_only" = "yes" \
1890 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1891 echo "#define USE_NPTL 1" >> $config_h
1892 fi
1893 # 32 bit ELF loader in addition to native 64 bit loader?
1894 if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1895 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1896 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1897 fi
1898 if test "$target_bsd_user" = "yes" ; then
1899 echo "CONFIG_BSD_USER=yes" >> $config_mak
1900 echo "#define CONFIG_BSD_USER 1" >> $config_h
1901 fi
1902
1903 test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1904
1905 done # for target in $targets
1906
1907 # build tree in object directory if source path is different from current one
1908 if test "$source_path_used" = "yes" ; then
1909 DIRS="tests tests/cris slirp audio"
1910 FILES="Makefile tests/Makefile"
1911 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1912 FILES="$FILES tests/test-mmap.c"
1913 for dir in $DIRS ; do
1914 mkdir -p $dir
1915 done
1916 # remove the link and recreate it, as not all "ln -sf" overwrite the link
1917 for f in $FILES ; do
1918 rm -f $f
1919 ln -s $source_path/$f $f
1920 done
1921 fi