ia64/xen-unstable

view tools/ioemu/configure @ 15841:c5f735271e22

[IA64] Foreign p2m: Fix vti domain builder.

It should set arch_domain::convmem_end.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Sep 06 13:48:43 2007 -0600 (2007-09-06)
parents 00618037d37d
children f7026f931e60
line source
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
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"
19 # default parameters
20 prefix=""
21 static="no"
22 libdir="lib"
23 cross_prefix=""
24 cc="gcc"
25 gcc3_search="yes"
26 gcc3_list="gcc-3.4 gcc34 gcc-3.3 gcc33 gcc-3.2 gcc32"
27 host_cc="gcc"
28 ar="ar"
29 make="make"
30 install="install"
31 strip="strip"
32 cpu=`uname -m`
33 target_list=""
34 case "$cpu" in
35 i386|i486|i586|i686|i86pc|BePC)
36 cpu="i386"
37 ;;
38 armv*b)
39 cpu="armv4b"
40 ;;
41 armv*l)
42 cpu="armv4l"
43 ;;
44 alpha)
45 cpu="alpha"
46 ;;
47 "Power Macintosh"|ppc|ppc64)
48 cpu="powerpc"
49 ;;
50 mips)
51 cpu="mips"
52 ;;
53 s390)
54 cpu="s390"
55 ;;
56 sparc|sun4[muv])
57 cpu="sparc"
58 ;;
59 sparc64)
60 cpu="sparc64"
61 ;;
62 ia64)
63 cpu="ia64"
64 ;;
65 m68k)
66 cpu="m68k"
67 ;;
68 x86_64|amd64)
69 cpu="x86_64"
70 libdir="lib64"
71 ;;
72 *)
73 cpu="unknown"
74 ;;
75 esac
76 gprof="no"
77 bigendian="no"
78 mingw32="no"
79 EXESUF=""
80 gdbstub="no"
81 slirp="no"
82 adlib="no"
83 oss="no"
84 dsound="no"
85 coreaudio="no"
86 alsa="no"
87 fmod="no"
88 fmod_lib=""
89 fmod_inc=""
90 bsd="no"
91 linux="no"
92 kqemu="no"
93 profiler="no"
94 cocoa="no"
95 check_gfx="yes"
96 check_gcc="no"
97 softmmu="yes"
98 linux_user="no"
99 darwin_user="no"
100 build_docs="no"
101 uname_release=""
103 # OS specific
104 targetos=`uname -s`
105 case $targetos in
106 CYGWIN*)
107 mingw32="yes"
108 OS_CFLAGS="-mno-cygwin"
109 ;;
110 MINGW32*)
111 mingw32="yes"
112 ;;
113 FreeBSD)
114 bsd="yes"
115 oss="yes"
116 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
117 kqemu="yes"
118 fi
119 ;;
120 NetBSD)
121 bsd="yes"
122 oss="yes"
123 ;;
124 OpenBSD)
125 bsd="yes"
126 oss="yes"
127 ;;
128 Darwin)
129 bsd="yes"
130 darwin="yes"
131 darwin_user="yes"
132 cocoa="yes"
133 coreaudio="yes"
134 OS_CFLAGS="-mdynamic-no-pic"
135 ;;
136 SunOS)
137 solaris="yes"
138 ;;
139 *)
140 oss="yes"
141 linux="yes"
142 linux_user="yes"
143 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
144 kqemu="yes"
145 fi
146 ;;
147 esac
149 if [ "$bsd" = "yes" ] ; then
150 if [ "$darwin" != "yes" ] ; then
151 make="gmake"
152 fi
153 fi
155 if [ "$solaris" = "yes" ] ; then
156 make="gmake"
157 install="ginstall"
158 solarisrev=`uname -r | cut -f2 -d.`
159 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
160 if test "$solarisrev" -gt 10 ; then
161 kqemu="yes"
162 fi
163 fi
164 fi
166 # find source path
167 source_path=`dirname "$0"`
168 if [ -z "$source_path" ]; then
169 source_path=`pwd`
170 else
171 source_path=`cd "$source_path"; pwd`
172 fi
173 if test "$source_path" = `pwd` ; then
174 source_path_used="no"
175 else
176 source_path_used="yes"
177 fi
179 for opt do
180 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
181 case "$opt" in
182 --help|-h) show_help=yes
183 ;;
184 --prefix=*) prefix="$optarg"
185 ;;
186 --interp-prefix=*) interp_prefix="$optarg"
187 ;;
188 --source-path=*) source_path="$optarg"
189 source_path_used="yes"
190 ;;
191 --cross-prefix=*) cross_prefix="$optarg"
192 ;;
193 --cc=*) cc="$optarg"
194 gcc3_search="no"
195 ;;
196 --host-cc=*) host_cc="$optarg"
197 ;;
198 --make=*) make="$optarg"
199 ;;
200 --install=*) install="$optarg"
201 ;;
202 --extra-cflags=*) CFLAGS="$optarg"
203 ;;
204 --extra-ldflags=*) LDFLAGS="$optarg"
205 ;;
206 --cpu=*) cpu="$optarg"
207 ;;
208 --target-list=*) target_list="$optarg"
209 ;;
210 --enable-gprof) gprof="yes"
211 ;;
212 --static) static="yes"
213 ;;
214 --disable-sdl) sdl="no"
215 ;;
216 --enable-coreaudio) coreaudio="yes"
217 ;;
218 --enable-alsa) alsa="yes"
219 ;;
220 --enable-dsound) dsound="yes"
221 ;;
222 --enable-fmod) fmod="yes"
223 ;;
224 --fmod-lib=*) fmod_lib="$optarg"
225 ;;
226 --fmod-inc=*) fmod_inc="$optarg"
227 ;;
228 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no"
229 ;;
230 --disable-slirp) slirp="no"
231 ;;
232 --enable-adlib) adlib="yes"
233 ;;
234 --disable-kqemu) kqemu="no"
235 ;;
236 --enable-profiler) profiler="yes"
237 ;;
238 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
239 ;;
240 --disable-gcc-check) check_gcc="no"
241 ;;
242 --disable-system) softmmu="no"
243 ;;
244 --enable-system) softmmu="yes"
245 ;;
246 --disable-linux-user) linux_user="no"
247 ;;
248 --enable-linux-user) linux_user="yes"
249 ;;
250 --disable-darwin-user) darwin_user="no"
251 ;;
252 --enable-darwin-user) darwin_user="yes"
253 ;;
254 --enable-uname-release=*) uname_release="$optarg"
255 ;;
256 esac
257 done
259 # default flags for all hosts
260 CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
261 LDFLAGS="$LDFLAGS -g"
263 if test x"$show_help" = x"yes" ; then
264 cat << EOF
266 Usage: configure [options]
267 Options: [defaults in brackets after descriptions]
269 EOF
270 echo "Standard options:"
271 echo " --help print this message"
272 echo " --prefix=PREFIX install in PREFIX [$prefix]"
273 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
274 echo " use %M for cpu name [$interp_prefix]"
275 echo " --target-list=LIST set target list [$target_list]"
276 echo ""
277 echo "kqemu kernel acceleration support:"
278 echo " --disable-kqemu disable kqemu support"
279 echo ""
280 echo "Advanced options (experts only):"
281 echo " --source-path=PATH path of source code [$source_path]"
282 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
283 echo " --cc=CC use C compiler CC [$cc]"
284 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
285 echo " --make=MAKE use specified make [$make]"
286 echo " --install=INSTALL use specified install [$install]"
287 echo " --static enable static build [$static]"
288 echo " --enable-cocoa enable COCOA (Mac OS X only)"
289 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
290 echo " --enable-adlib enable Adlib emulation"
291 echo " --enable-coreaudio enable Coreaudio audio driver"
292 echo " --enable-alsa enable ALSA audio driver"
293 echo " --enable-fmod enable FMOD audio driver"
294 echo " --enabled-dsound enable DirectSound audio driver"
295 echo " --enable-system enable all system emulation targets"
296 echo " --disable-system disable all system emulation targets"
297 echo " --enable-linux-user enable all linux usermode emulation targets"
298 echo " --disable-linux-user disable all linux usermode emulation targets"
299 echo " --enable-darwin-user enable all darwin usermode emulation targets"
300 echo " --disable-darwin-user disable all darwin usermode emulation targets"
301 echo " --fmod-lib path to FMOD library"
302 echo " --fmod-inc path to FMOD includes"
303 echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
304 echo ""
305 echo "NOTE: The object files are built at the place where configure is launched"
306 exit 1
307 fi
309 cc="${cross_prefix}${cc}"
310 ar="${cross_prefix}${ar}"
311 strip="${cross_prefix}${strip}"
313 # check that the C compiler works.
314 cat > $TMPC <<EOF
315 int main(void) {}
316 EOF
318 if $cc -c -o $TMPO $TMPC 2>/dev/null ; then
319 : C compiler works ok
320 else
321 echo "ERROR: \"$cc\" either does not exist or does not work"
322 exit 1
323 fi
325 if test "$mingw32" = "yes" ; then
326 linux="no"
327 EXESUF=".exe"
328 oss="no"
329 if [ "$cpu" = "i386" ] ; then
330 kqemu="yes"
331 fi
332 fi
334 # Check for gcc4, error if pre-gcc4
335 if test "$check_gcc" = "yes" ; then
336 cat > $TMPC <<EOF
337 #if __GNUC__ < 4
338 #error gcc3
339 #endif
340 int main(){return 0;}
341 EOF
342 check_cc() {
343 which "$1" >&/dev/null
344 return $?
345 }
347 if "$cc" -o $TMPE $TMPC 2>/dev/null ; then
348 echo "WARNING: \"$cc\" looks like gcc 4.x"
349 found_compat_cc="no"
350 if test "$gcc3_search" = "yes" ; then
351 echo "Looking for gcc 3.x"
352 for compat_cc in $gcc3_list ; do
353 if check_cc "$compat_cc" ; then
354 echo "Found \"$compat_cc\""
355 cc="$compat_cc"
356 found_compat_cc="yes"
357 break
358 fi
359 done
360 if test "$found_compat_cc" = "no" ; then
361 echo "gcc 3.x not found!"
362 fi
363 fi
364 if test "$found_compat_cc" = "no" ; then
365 echo "QEMU is known to have problems when compiled with gcc 4.x"
366 echo "It is recommended that you use gcc 3.x to build QEMU"
367 echo "To use this compiler anyway, configure with --disable-gcc-check"
368 exit 1;
369 fi
370 fi
371 fi
373 #
374 # Solaris specific configure tool chain decisions
375 #
376 if test "$solaris" = "yes" ; then
377 #
378 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
379 # override the check with --disable-gcc-check
380 #
381 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
382 solgcc=`which $cc`
383 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
384 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
385 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
386 echo "or get the latest patch from SunSolve for gcc"
387 exit 1
388 fi
389 fi
390 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
391 if test -z "$solinst" ; then
392 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
393 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
394 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
395 exit 1
396 fi
397 if test "$solinst" = "/usr/sbin/install" ; then
398 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
399 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
400 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
401 exit 1
402 fi
403 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
404 if test -z "$sol_ar" ; then
405 echo "Error: No path includes ar"
406 if test -f /usr/ccs/bin/ar ; then
407 echo "Add /usr/ccs/bin to your path and rerun configure"
408 fi
409 exit 1
410 fi
411 fi
414 if test -z "$target_list" ; then
415 # these targets are portable
416 if [ "$softmmu" = "yes" ] ; then
417 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
418 fi
419 # the following are Linux specific
420 if [ "$linux_user" = "yes" ] ; then
421 target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user $target_list"
422 fi
423 # the following are Darwin specific
424 if [ "$darwin_user" = "yes" ] ; then
425 target_list="i386-darwin-user ppc-darwin-user $target_list"
426 fi
427 # the i386-dm target
428 target_list="i386-dm"
429 else
430 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
431 fi
432 if test -z "$target_list" ; then
433 echo "No targets enabled"
434 exit 1
435 fi
437 kqemu="no"
439 if test -z "$cross_prefix" ; then
441 # ---
442 # big/little endian test
443 cat > $TMPC << EOF
444 #include <inttypes.h>
445 int main(int argc, char ** argv){
446 volatile uint32_t i=0x01234567;
447 return (*((uint8_t*)(&i))) == 0x67;
448 }
449 EOF
451 if $cc -o $TMPE $TMPC 2>/dev/null ; then
452 $TMPE && bigendian="yes"
453 else
454 echo big/little test failed
455 fi
457 else
459 # if cross compiling, cannot launch a program, so make a static guess
460 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
461 bigendian="yes"
462 fi
464 fi
466 # host long bits test
467 hostlongbits="32"
468 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
469 hostlongbits="64"
470 fi
472 # check gcc options support
473 cat > $TMPC <<EOF
474 int main(void) {
475 }
476 EOF
478 have_gcc3_options="no"
479 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
480 have_gcc3_options="yes"
481 fi
483 ##########################################
484 # SDL probe
486 sdl_too_old=no
488 if test -z "$sdl" ; then
490 sdl_config="sdl-config"
491 sdl=no
492 sdl_static=no
494 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
495 # win32 cross compilation case
496 sdl_config="i386-mingw32msvc-sdl-config"
497 sdl=yes
498 else
499 # normal SDL probe
500 cat > $TMPC << EOF
501 #include <SDL.h>
502 #undef main /* We don't want SDL to override our main() */
503 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
504 EOF
506 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
507 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
508 if test "$_sdlversion" -lt 121 ; then
509 sdl_too_old=yes
510 else
511 if test "$cocoa" = "no" ; then
512 sdl=yes
513 fi
514 fi
516 # static link with sdl ?
517 if test "$sdl" = "yes" ; then
518 aa="no"
519 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
520 sdl_static_libs=`$sdl_config --static-libs`
521 if [ "$aa" = "yes" ] ; then
522 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
523 fi
525 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
526 sdl_static=yes
527 fi
529 fi # static link
531 fi # sdl compile test
533 fi # cross compilation
535 else
536 # Make sure to disable cocoa if sdl was set
537 if test "$sdl" = "yes" ; then
538 cocoa="no"
539 coreaudio="no"
540 fi
541 fi # -z $sdl
543 ##########################################
544 # alsa sound support libraries
546 if test "$alsa" = "yes" ; then
547 cat > $TMPC << EOF
548 #include <alsa/asoundlib.h>
549 int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
550 EOF
551 if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then
552 :
553 else
554 echo
555 echo "Error: Could not find alsa"
556 echo "Make sure to have the alsa libs and headers installed."
557 echo
558 exit 1
559 fi
560 fi
562 # Check if tools are available to build documentation.
563 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
564 build_docs="yes"
565 fi
567 if test "$mingw32" = "yes" ; then
568 if test -z "$prefix" ; then
569 prefix="/c/Program Files/Qemu"
570 fi
571 mandir="$prefix"
572 datadir="$prefix"
573 docdir="$prefix"
574 bindir="$prefix"
575 configdir=""
576 else
577 if test -z "$prefix" ; then
578 prefix="/usr/local"
579 fi
580 mandir="$prefix/share/man"
581 datadir="$prefix/share/xen/qemu"
582 docdir="$prefix/share/doc/qemu"
583 bindir="$prefix/$libdir/xen/bin"
584 configdir="/etc/xen"
585 fi
587 echo "Install prefix $prefix"
588 echo "BIOS directory $datadir"
589 echo "binary directory $bindir"
590 if test "$mingw32" = "no" ; then
591 echo "Manual directory $mandir"
592 echo "ELF interp prefix $interp_prefix"
593 fi
594 echo "Source path $source_path"
595 echo "C compiler $cc"
596 echo "Host C compiler $host_cc"
597 echo "make $make"
598 echo "install $install"
599 echo "host CPU $cpu"
600 echo "host big endian $bigendian"
601 echo "target list $target_list"
602 echo "gprof enabled $gprof"
603 echo "profiler $profiler"
604 echo "static build $static"
605 if test "$darwin" = "yes" ; then
606 echo "Cocoa support $cocoa"
607 fi
608 echo "SDL support $sdl"
609 if test "$sdl" != "no" ; then
610 echo "SDL static link $sdl_static"
611 fi
612 echo "mingw32 support $mingw32"
613 echo "Adlib support $adlib"
614 echo "CoreAudio support $coreaudio"
615 echo "ALSA support $alsa"
616 echo "DSound support $dsound"
617 if test "$fmod" = "yes"; then
618 if test -z $fmod_lib || test -z $fmod_inc; then
619 echo
620 echo "Error: You must specify path to FMOD library and headers"
621 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
622 echo
623 exit 1
624 fi
625 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
626 else
627 fmod_support=""
628 fi
629 echo "FMOD support $fmod $fmod_support"
630 echo "kqemu support $kqemu"
631 echo "Documentation $build_docs"
632 [ ! -z "$uname_release" ] && \
633 echo "uname -r $uname_release"
635 if test $sdl_too_old = "yes"; then
636 echo "-> Your SDL version is too old - please upgrade to have SDL support"
637 fi
638 #if test "$sdl_static" = "no"; then
639 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
640 #fi
641 config_mak="config-host.mak"
642 config_h="config-host.h"
644 #echo "Creating $config_mak and $config_h"
646 echo "# Automatically generated by configure - do not modify" > $config_mak
647 echo "# Configured with: $0 $@" >> $config_mak
648 echo "/* Automatically generated by configure - do not modify */" > $config_h
650 echo "prefix=$prefix" >> $config_mak
651 echo "bindir=$bindir" >> $config_mak
652 echo "mandir=$mandir" >> $config_mak
653 echo "datadir=$datadir" >> $config_mak
654 echo "docdir=$docdir" >> $config_mak
655 echo "configdir=$configdir" >> $config_mak
656 echo "LIBDIR=$libdir" >> $config_mak
657 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
658 echo "MAKE=$make" >> $config_mak
659 echo "INSTALL=$install" >> $config_mak
660 echo "CC=$cc" >> $config_mak
661 if test "$have_gcc3_options" = "yes" ; then
662 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
663 fi
664 echo "HOST_CC=$host_cc" >> $config_mak
665 echo "AR=$ar" >> $config_mak
666 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
667 echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
668 echo "CFLAGS=$CFLAGS" >> $config_mak
669 echo "LDFLAGS=$LDFLAGS" >> $config_mak
670 echo "EXESUF=$EXESUF" >> $config_mak
671 if test "$cpu" = "i386" ; then
672 echo "ARCH=i386" >> $config_mak
673 echo "#define HOST_I386 1" >> $config_h
674 elif test "$cpu" = "x86_64" ; then
675 echo "ARCH=x86_64" >> $config_mak
676 echo "#define HOST_X86_64 1" >> $config_h
677 elif test "$cpu" = "armv4b" ; then
678 echo "ARCH=arm" >> $config_mak
679 echo "#define HOST_ARM 1" >> $config_h
680 elif test "$cpu" = "armv4l" ; then
681 echo "ARCH=arm" >> $config_mak
682 echo "#define HOST_ARM 1" >> $config_h
683 elif test "$cpu" = "powerpc" ; then
684 echo "ARCH=ppc" >> $config_mak
685 echo "#define HOST_PPC 1" >> $config_h
686 elif test "$cpu" = "mips" ; then
687 echo "ARCH=mips" >> $config_mak
688 echo "#define HOST_MIPS 1" >> $config_h
689 elif test "$cpu" = "s390" ; then
690 echo "ARCH=s390" >> $config_mak
691 echo "#define HOST_S390 1" >> $config_h
692 elif test "$cpu" = "alpha" ; then
693 echo "ARCH=alpha" >> $config_mak
694 echo "#define HOST_ALPHA 1" >> $config_h
695 elif test "$cpu" = "sparc" ; then
696 echo "ARCH=sparc" >> $config_mak
697 echo "#define HOST_SPARC 1" >> $config_h
698 elif test "$cpu" = "sparc64" ; then
699 echo "ARCH=sparc64" >> $config_mak
700 echo "#define HOST_SPARC64 1" >> $config_h
701 elif test "$cpu" = "ia64" ; then
702 echo "ARCH=ia64" >> $config_mak
703 echo "#define HOST_IA64 1" >> $config_h
704 elif test "$cpu" = "m68k" ; then
705 echo "ARCH=m68k" >> $config_mak
706 echo "#define HOST_M68K 1" >> $config_h
707 else
708 echo "Unsupported CPU"
709 exit 1
710 fi
711 if test "$bigendian" = "yes" ; then
712 echo "WORDS_BIGENDIAN=yes" >> $config_mak
713 echo "#define WORDS_BIGENDIAN 1" >> $config_h
714 fi
715 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
716 if test "$mingw32" = "yes" ; then
717 echo "CONFIG_WIN32=yes" >> $config_mak
718 echo "#define CONFIG_WIN32 1" >> $config_h
719 elif test -f "/usr/include/byteswap.h" ; then
720 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
721 fi
722 if test "$darwin" = "yes" ; then
723 echo "CONFIG_DARWIN=yes" >> $config_mak
724 echo "#define CONFIG_DARWIN 1" >> $config_h
725 fi
726 if test "$solaris" = "yes" ; then
727 echo "CONFIG_SOLARIS=yes" >> $config_mak
728 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
729 fi
730 if test "$gdbstub" = "yes" ; then
731 echo "CONFIG_GDBSTUB=yes" >> $config_mak
732 echo "#define CONFIG_GDBSTUB 1" >> $config_h
733 fi
734 if test "$gprof" = "yes" ; then
735 echo "TARGET_GPROF=yes" >> $config_mak
736 echo "#define HAVE_GPROF 1" >> $config_h
737 fi
738 if test "$static" = "yes" ; then
739 echo "CONFIG_STATIC=yes" >> $config_mak
740 echo "#define CONFIG_STATIC 1" >> $config_h
741 fi
742 if test $profiler = "yes" ; then
743 echo "#define CONFIG_PROFILER 1" >> $config_h
744 fi
745 if test "$slirp" = "yes" ; then
746 echo "CONFIG_SLIRP=yes" >> $config_mak
747 echo "#define CONFIG_SLIRP 1" >> $config_h
748 fi
749 if test "$adlib" = "yes" ; then
750 echo "CONFIG_ADLIB=yes" >> $config_mak
751 echo "#define CONFIG_ADLIB 1" >> $config_h
752 fi
753 if test "$oss" = "yes" ; then
754 echo "CONFIG_OSS=yes" >> $config_mak
755 echo "#define CONFIG_OSS 1" >> $config_h
756 fi
757 if test "$coreaudio" = "yes" ; then
758 echo "CONFIG_COREAUDIO=yes" >> $config_mak
759 echo "#define CONFIG_COREAUDIO 1" >> $config_h
760 fi
761 if test "$alsa" = "yes" ; then
762 echo "CONFIG_ALSA=yes" >> $config_mak
763 echo "#define CONFIG_ALSA 1" >> $config_h
764 fi
765 if test "$dsound" = "yes" ; then
766 echo "CONFIG_DSOUND=yes" >> $config_mak
767 echo "#define CONFIG_DSOUND 1" >> $config_h
768 fi
769 if test "$fmod" = "yes" ; then
770 echo "CONFIG_FMOD=yes" >> $config_mak
771 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
772 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
773 echo "#define CONFIG_FMOD 1" >> $config_h
774 fi
775 qemu_version=`head $source_path/VERSION`
776 echo "VERSION=$qemu_version" >>$config_mak
777 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
779 echo "SRC_PATH=$source_path" >> $config_mak
780 if [ "$source_path_used" = "yes" ]; then
781 echo "VPATH=$source_path" >> $config_mak
782 fi
783 echo "TARGET_DIRS=$target_list" >> $config_mak
784 if [ "$build_docs" = "yes" ] ; then
785 echo "BUILD_DOCS=yes" >> $config_mak
786 fi
788 # XXX: suppress that
789 if [ "$bsd" = "yes" ] ; then
790 echo "#define O_LARGEFILE 0" >> $config_h
791 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
792 echo "#define _BSD 1" >> $config_h
793 fi
795 echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
797 for target in $target_list; do
798 target_dir="$target"
799 config_mak=$target_dir/config.mak
800 config_h=$target_dir/config.h
801 target_cpu=`echo $target | cut -d '-' -f 1`
802 target_bigendian="no"
803 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
804 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
805 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
806 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
807 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
808 [ "$target_cpu" = "mips" ] && target_bigendian=yes
809 [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
810 [ "$target_cpu" = "m68k" ] && target_bigendian=yes
811 target_softmmu="no"
812 if expr $target : '.*-softmmu' > /dev/null ; then
813 target_softmmu="yes"
814 fi
815 #for support 256M guest
816 target_softmmu="yes"
817 target_user_only="no"
818 if expr $target : '.*-user' > /dev/null ; then
819 target_user_only="yes"
820 fi
822 target_linux_user="no"
823 if expr $target : '.*-linux-user' > /dev/null ; then
824 target_linux_user="yes"
825 fi
827 target_darwin_user="no"
828 if expr $target : '.*-darwin-user' > /dev/null ; then
829 target_darwin_user="yes"
830 fi
832 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
834 mkdir -p $target_dir
835 mkdir -p $target_dir/fpu
836 if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
837 mkdir -p $target_dir/nwfpe
838 fi
839 if test "$target_user_only" = "no" ; then
840 mkdir -p $target_dir/slirp
841 fi
843 #
844 # don't use ln -sf as not all "ln -sf" over write the file/link
845 #
846 rm -f $target_dir/Makefile
847 ln -s ../Makefile.target $target_dir/Makefile
850 echo "# Automatically generated by configure - do not modify" > $config_mak
851 echo "/* Automatically generated by configure - do not modify */" > $config_h
854 echo "include ../config-host.mak" >> $config_mak
855 echo "#include \"../config-host.h\"" >> $config_h
857 bflt="no"
858 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
859 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
861 target_sub=
862 if expr $target : '.*-dm' > /dev/null ; then
863 target_sub=-dm
864 fi
865 echo "TARGET_SUB=${target_sub}" >> $config_mak
867 if test "$target_cpu" = "i386" ; then
868 echo "TARGET_ARCH=i386" >> $config_mak
869 echo "#define TARGET_ARCH \"i386\"" >> $config_h
870 echo "#define TARGET_I386 1" >> $config_h
871 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
872 echo "#define USE_KQEMU 1" >> $config_h
873 fi
874 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
875 echo "TARGET_ARCH=arm" >> $config_mak
876 echo "#define TARGET_ARCH \"arm\"" >> $config_h
877 echo "#define TARGET_ARM 1" >> $config_h
878 bflt="yes"
879 elif test "$target_cpu" = "sparc" ; then
880 echo "TARGET_ARCH=sparc" >> $config_mak
881 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
882 echo "#define TARGET_SPARC 1" >> $config_h
883 elif test "$target_cpu" = "sparc64" ; then
884 echo "TARGET_ARCH=sparc64" >> $config_mak
885 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
886 echo "#define TARGET_SPARC 1" >> $config_h
887 echo "#define TARGET_SPARC64 1" >> $config_h
888 elif test "$target_cpu" = "ppc" ; then
889 echo "TARGET_ARCH=ppc" >> $config_mak
890 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
891 echo "#define TARGET_PPC 1" >> $config_h
892 elif test "$target_cpu" = "ppc64" ; then
893 echo "TARGET_ARCH=ppc64" >> $config_mak
894 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
895 echo "#define TARGET_PPC 1" >> $config_h
896 echo "#define TARGET_PPC64 1" >> $config_h
897 elif test "$target_cpu" = "x86_64" ; then
898 echo "TARGET_ARCH=x86_64" >> $config_mak
899 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
900 echo "#define TARGET_I386 1" >> $config_h
901 echo "#define TARGET_X86_64 1" >> $config_h
902 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
903 echo "#define USE_KQEMU 1" >> $config_h
904 fi
905 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
906 echo "TARGET_ARCH=mips" >> $config_mak
907 echo "#define TARGET_ARCH \"mips\"" >> $config_h
908 echo "#define TARGET_MIPS 1" >> $config_h
909 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
910 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
911 elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then
912 echo "TARGET_ARCH=sh4" >> $config_mak
913 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
914 echo "#define TARGET_SH4 1" >> $config_h
915 bflt="yes"
916 elif test "$target_cpu" = "m68k" ; then
917 echo "TARGET_ARCH=m68k" >> $config_mak
918 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
919 echo "#define TARGET_M68K 1" >> $config_h
920 bflt="yes"
921 else
922 echo "Unsupported target CPU"
923 exit 1
924 fi
925 if test "$target_bigendian" = "yes" ; then
926 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
927 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
928 fi
929 if test "$target_softmmu" = "yes" ; then
930 echo "CONFIG_SOFTMMU=yes" >> $config_mak
931 echo "#define CONFIG_SOFTMMU 1" >> $config_h
932 fi
933 if test "$target_user_only" = "yes" ; then
934 echo "CONFIG_USER_ONLY=yes" >> $config_mak
935 echo "#define CONFIG_USER_ONLY 1" >> $config_h
936 fi
937 if test "$target_linux_user" = "yes" ; then
938 echo "CONFIG_LINUX_USER=yes" >> $config_mak
939 echo "#define CONFIG_LINUX_USER 1" >> $config_h
940 fi
941 if test "$target_darwin_user" = "yes" ; then
942 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
943 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
944 fi
945 if expr $target : '.*-dm' > /dev/null ; then
946 echo "#define CONFIG_DM 1" >> $config_h
947 fi
949 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then
950 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
951 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
952 fi
953 if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
954 echo "TARGET_HAS_BFLT=yes" >> $config_mak
955 echo "#define TARGET_HAS_BFLT 1" >> $config_h
956 fi
957 # sdl defines
959 if test "$target_user_only" = "no"; then
960 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
961 sdl1=$sdl_static
962 else
963 sdl1=$sdl
964 fi
965 if test "$sdl1" = "yes" ; then
966 echo "#define CONFIG_SDL 1" >> $config_h
967 echo "CONFIG_SDL=yes" >> $config_mak
968 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
969 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
970 else
971 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
972 fi
973 if [ "${aa}" = "yes" ] ; then
974 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
975 else
976 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
977 fi
978 fi
979 fi
981 if test "$cocoa" = "yes" ; then
982 echo "#define CONFIG_COCOA 1" >> $config_h
983 echo "CONFIG_COCOA=yes" >> $config_mak
984 fi
986 done # for target in $targets
988 # build tree in object directory if source path is different from current one
989 if test "$source_path_used" = "yes" ; then
990 DIRS="tests"
991 FILES="Makefile tests/Makefile"
992 for dir in $DIRS ; do
993 mkdir -p $dir
994 done
995 # remove the link and recreate it, as not all "ln -sf" overwrite the link
996 for f in $FILES ; do
997 rm -f $f
998 ln -s $source_path/$f $f
999 done
1000 fi
1002 rm -f $TMPO $TMPC $TMPE $TMPS