debuggers.hg

view tools/ioemu/configure @ 10964:e47aad0605a3

[qemu] Always allow --disable-sdl since there's always vnc support.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Fri Aug 04 09:27:52 2006 +0100 (2006-08-04)
parents b450f21472a0
children 08a11694b109
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 host_cc="gcc"
26 ar="ar"
27 make="make"
28 install="install"
29 strip="strip"
30 cpu=`uname -m`
31 target_list=""
32 case "$cpu" in
33 i386|i486|i586|i686|i86pc|BePC)
34 cpu="i386"
35 ;;
36 armv*b)
37 cpu="armv4b"
38 ;;
39 armv*l)
40 cpu="armv4l"
41 ;;
42 alpha)
43 cpu="alpha"
44 ;;
45 "Power Macintosh"|ppc|ppc64)
46 cpu="powerpc"
47 ;;
48 mips)
49 cpu="mips"
50 ;;
51 s390)
52 cpu="s390"
53 ;;
54 sparc|sun4[muv])
55 cpu="sparc"
56 ;;
57 sparc64)
58 cpu="sparc64"
59 ;;
60 ia64)
61 cpu="ia64"
62 ;;
63 m68k)
64 cpu="m68k"
65 ;;
66 x86_64|amd64)
67 cpu="x86_64"
68 libdir="lib64"
69 ;;
70 *)
71 cpu="unknown"
72 ;;
73 esac
74 gprof="no"
75 bigendian="no"
76 mingw32="no"
77 EXESUF=""
78 gdbstub="no"
79 slirp="no"
80 adlib="no"
81 oss="no"
82 dsound="no"
83 coreaudio="no"
84 alsa="no"
85 fmod="no"
86 fmod_lib=""
87 fmod_inc=""
88 bsd="no"
89 linux="no"
90 kqemu="no"
91 profiler="no"
92 kernel_path=""
93 cocoa="no"
94 check_gfx="yes"
95 check_gcc="no"
96 softmmu="yes"
97 user="no"
98 build_docs="no"
100 # OS specific
101 targetos=`uname -s`
102 case $targetos in
103 CYGWIN*)
104 mingw32="yes"
105 CFLAGS="-O2 -mno-cygwin"
106 ;;
107 MINGW32*)
108 mingw32="yes"
109 ;;
110 FreeBSD)
111 bsd="yes"
112 oss="yes"
113 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
114 kqemu="yes"
115 fi
116 ;;
117 NetBSD)
118 bsd="yes"
119 oss="yes"
120 ;;
121 OpenBSD)
122 bsd="yes"
123 oss="yes"
124 ;;
125 Darwin)
126 bsd="yes"
127 darwin="yes"
128 ;;
129 SunOS)
130 solaris="yes"
131 ;;
132 *)
133 oss="yes"
134 linux="yes"
135 user="yes"
136 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
137 kqemu="yes"
138 fi
139 ;;
140 esac
142 if [ "$bsd" = "yes" ] ; then
143 if [ "$darwin" != "yes" ] ; then
144 make="gmake"
145 fi
146 fi
148 if [ "$solaris" = "yes" ] ; then
149 make="gmake"
150 install="ginstall"
151 solarisrev=`uname -r | cut -f2 -d.`
152 fi
154 # find source path
155 source_path=`dirname "$0"`
156 if [ -z "$source_path" ]; then
157 source_path=`pwd`
158 else
159 source_path=`cd "$source_path"; pwd`
160 fi
161 if test "$source_path" = `pwd` ; then
162 source_path_used="no"
163 else
164 source_path_used="yes"
165 fi
167 for opt do
168 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
169 case "$opt" in
170 --help|-h) show_help=yes
171 ;;
172 --prefix=*) prefix="$optarg"
173 ;;
174 --interp-prefix=*) interp_prefix="$optarg"
175 ;;
176 --source-path=*) source_path="$optarg"
177 source_path_used="yes"
178 ;;
179 --cross-prefix=*) cross_prefix="$optarg"
180 ;;
181 --cc=*) cc="$optarg"
182 ;;
183 --host-cc=*) host_cc="$optarg"
184 ;;
185 --make=*) make="$optarg"
186 ;;
187 --install=*) install="$optarg"
188 ;;
189 --extra-cflags=*) CFLAGS="$optarg"
190 ;;
191 --extra-ldflags=*) LDFLAGS="$optarg"
192 ;;
193 --cpu=*) cpu="$optarg"
194 ;;
195 --target-list=*) target_list="$optarg"
196 ;;
197 --enable-gprof) gprof="yes"
198 ;;
199 --static) static="yes"
200 ;;
201 --disable-sdl) sdl="no"
202 ;;
203 --enable-coreaudio) coreaudio="yes"
204 ;;
205 --enable-alsa) alsa="yes"
206 ;;
207 --enable-dsound) dsound="yes"
208 ;;
209 --enable-fmod) fmod="yes"
210 ;;
211 --fmod-lib=*) fmod_lib="$optarg"
212 ;;
213 --fmod-inc=*) fmod_inc="$optarg"
214 ;;
215 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
216 ;;
217 --disable-slirp) slirp="no"
218 ;;
219 --enable-adlib) adlib="yes"
220 ;;
221 --disable-kqemu) kqemu="no"
222 ;;
223 --enable-profiler) profiler="yes"
224 ;;
225 --kernel-path=*) kernel_path="$optarg"
226 ;;
227 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
228 ;;
229 --disable-gcc-check) check_gcc="no"
230 ;;
231 --disable-system) softmmu="no"
232 ;;
233 --enable-system) softmmu="yes"
234 ;;
235 --disable-user) user="no"
236 ;;
237 --enable-user) user="yes"
238 ;;
239 esac
240 done
242 # Checking for CFLAGS
243 if test -z "$CFLAGS"; then
244 CFLAGS="-O2"
245 fi
247 if test x"$show_help" = x"yes" ; then
248 cat << EOF
250 Usage: configure [options]
251 Options: [defaults in brackets after descriptions]
253 EOF
254 echo "Standard options:"
255 echo " --help print this message"
256 echo " --prefix=PREFIX install in PREFIX [$prefix]"
257 echo " --interp-prefix=PREFIX where to find shared libraries, etc."
258 echo " use %M for cpu name [$interp_prefix]"
259 echo " --target-list=LIST set target list [$target_list]"
260 echo ""
261 echo "kqemu kernel acceleration support:"
262 echo " --disable-kqemu disable kqemu support"
263 echo " --kernel-path=PATH set the kernel path (configure probes it)"
264 echo ""
265 echo "Advanced options (experts only):"
266 echo " --source-path=PATH path of source code [$source_path]"
267 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
268 echo " --cc=CC use C compiler CC [$cc]"
269 echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
270 echo " --make=MAKE use specified make [$make]"
271 echo " --install=INSTALL use specified install [$install]"
272 echo " --static enable static build [$static]"
273 echo " --enable-cocoa enable COCOA (Mac OS X only)"
274 echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
275 echo " --enable-adlib enable Adlib emulation"
276 echo " --enable-coreaudio enable Coreaudio audio driver"
277 echo " --enable-alsa enable ALSA audio driver"
278 echo " --enable-fmod enable FMOD audio driver"
279 echo " --enabled-dsound enable DirectSound audio driver"
280 echo " --enable-system enable all system emulation targets"
281 echo " --disable-system disable all system emulation targets"
282 echo " --enable-user enable all linux usermode emulation targets"
283 echo " --disable-user disable all linux usermode emulation targets"
284 echo " --fmod-lib path to FMOD library"
285 echo " --fmod-inc path to FMOD includes"
286 echo ""
287 echo "NOTE: The object files are build at the place where configure is launched"
288 exit 1
289 fi
291 cc="${cross_prefix}${cc}"
292 ar="${cross_prefix}${ar}"
293 strip="${cross_prefix}${strip}"
295 if [ ! -x "`which $cc`" ] ; then
296 echo "Compiler $cc could not be found"
297 exit
298 fi
300 if test "$mingw32" = "yes" ; then
301 linux="no"
302 EXESUF=".exe"
303 gdbstub="no"
304 oss="no"
305 if [ "$cpu" = "i386" ] ; then
306 kqemu="yes"
307 fi
308 fi
310 #
311 # Solaris specific configure tool chain decisions
312 #
313 if test "$solaris" = "yes" ; then
314 #
315 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
316 # override the check with --disable-gcc-check
317 #
318 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
319 solgcc=`which $cc`
320 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
321 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
322 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
323 echo "or get the latest patch from SunSolve for gcc"
324 exit 1
325 fi
326 fi
327 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
328 if test -z "$solinst" ; then
329 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
330 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
331 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
332 exit 1
333 fi
334 if test "$solinst" = "/usr/sbin/install" ; then
335 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
336 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
337 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
338 exit 1
339 fi
340 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
341 if test -z "$sol_ar" ; then
342 echo "Error: No path includes ar"
343 if test -f /usr/ccs/bin/ar ; then
344 echo "Add /usr/ccs/bin to your path and rerun configure"
345 fi
346 exit 1
347 fi
348 fi
351 if test -z "$target_list" ; then
352 # these targets are portable
353 if [ "$softmmu" = "yes" ] ; then
354 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
355 fi
356 # the following are Linux specific
357 if [ "$user" = "yes" ] ; then
358 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user $target_list"
359 fi
360 # the i386-dm target
361 target_list="i386-dm"
362 else
363 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
364 fi
365 if test -z "$target_list" ; then
366 echo "No targets enabled"
367 exit 1
368 fi
370 kqemu="no"
372 if test -z "$cross_prefix" ; then
374 # ---
375 # big/little endian test
376 cat > $TMPC << EOF
377 #include <inttypes.h>
378 int main(int argc, char ** argv){
379 volatile uint32_t i=0x01234567;
380 return (*((uint8_t*)(&i))) == 0x67;
381 }
382 EOF
384 if $cc -o $TMPE $TMPC 2>/dev/null ; then
385 $TMPE && bigendian="yes"
386 else
387 echo big/little test failed
388 fi
390 else
392 # if cross compiling, cannot launch a program, so make a static guess
393 if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
394 bigendian="yes"
395 fi
397 fi
399 # host long bits test
400 hostlongbits="32"
401 if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
402 hostlongbits="64"
403 fi
405 # check gcc options support
406 cat > $TMPC <<EOF
407 int main(void) {
408 }
409 EOF
411 have_gcc3_options="no"
412 if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
413 have_gcc3_options="yes"
414 fi
416 # Check for gcc4, error if pre-gcc4
417 if test "$check_gcc" = "yes" ; then
418 cat > $TMPC <<EOF
419 #if __GNUC__ < 4
420 #error gcc3
421 #endif
422 int main(){return 0;}
423 EOF
424 if $cc -o $TMPO $TMPC 2>/dev/null ; then
425 echo "ERROR: \"$cc\" looks like gcc 4.x"
426 echo "QEMU is known to have problems when compiled with gcc 4.x"
427 echo "It is recommended that you use gcc 3.x to build QEMU"
428 echo "To use this compiler anyway, configure with --disable-gcc-check"
429 exit 1;
430 fi
431 fi
433 ##########################################
434 # SDL probe
436 sdl_too_old=no
438 if test -z "$sdl" ; then
440 sdl_config="sdl-config"
441 sdl=no
442 sdl_static=no
444 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
445 # win32 cross compilation case
446 sdl_config="i386-mingw32msvc-sdl-config"
447 sdl=yes
448 else
449 # normal SDL probe
450 cat > $TMPC << EOF
451 #include <SDL.h>
452 #undef main /* We don't want SDL to override our main() */
453 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
454 EOF
456 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
457 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
458 if test "$_sdlversion" -lt 121 ; then
459 sdl_too_old=yes
460 else
461 sdl=yes
462 fi
464 # static link with sdl ?
465 if test "$sdl" = "yes" ; then
466 aa="no"
467 `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
468 sdl_static_libs=`$sdl_config --static-libs`
469 if [ "$aa" = "yes" ] ; then
470 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
471 fi
473 if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
474 sdl_static=yes
475 fi
477 fi # static link
479 fi # sdl compile test
481 fi # cross compilation
482 fi # -z $sdl
484 # Check if tools are available to build documentation.
485 if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
486 build_docs="yes"
487 fi
489 if test "$mingw32" = "yes" ; then
490 if test -z "$prefix" ; then
491 prefix="/c/Program Files/Qemu"
492 fi
493 mandir="$prefix"
494 datadir="$prefix"
495 docdir="$prefix"
496 bindir="$prefix"
497 configdir=""
498 else
499 if test -z "$prefix" ; then
500 prefix="/usr/local"
501 fi
502 mandir="$prefix/share/man"
503 datadir="$prefix/share/xen/qemu"
504 docdir="$prefix/share/doc/qemu"
505 bindir="$prefix/$libdir/xen/bin"
506 configdir="/etc/xen"
507 fi
509 echo "Install prefix $prefix"
510 echo "BIOS directory $datadir"
511 echo "binary directory $bindir"
512 if test "$mingw32" = "no" ; then
513 echo "Manual directory $mandir"
514 echo "ELF interp prefix $interp_prefix"
515 fi
516 echo "Source path $source_path"
517 echo "C compiler $cc"
518 echo "Host C compiler $host_cc"
519 echo "make $make"
520 echo "install $install"
521 echo "host CPU $cpu"
522 echo "host big endian $bigendian"
523 echo "target list $target_list"
524 echo "gprof enabled $gprof"
525 echo "profiler $profiler"
526 echo "static build $static"
527 if test "$darwin" = "yes" ; then
528 echo "Cocoa support $cocoa"
529 fi
530 echo "SDL support $sdl"
531 if test "$sdl" != "no" ; then
532 echo "SDL static link $sdl_static"
533 fi
534 echo "mingw32 support $mingw32"
535 echo "Adlib support $adlib"
536 echo "CoreAudio support $coreaudio"
537 echo "ALSA support $alsa"
538 echo "DSound support $dsound"
539 if test "$fmod" = "yes"; then
540 if test -z $fmod_lib || test -z $fmod_inc; then
541 echo
542 echo "Error: You must specify path to FMOD library and headers"
543 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
544 echo
545 exit 1
546 fi
547 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
548 else
549 fmod_support=""
550 fi
551 echo "FMOD support $fmod $fmod_support"
552 echo "kqemu support $kqemu"
553 echo "Documentation $build_docs"
555 if test $sdl_too_old = "yes"; then
556 echo "-> Your SDL version is too old - please upgrade to have SDL support"
557 fi
558 #if test "$sdl_static" = "no"; then
559 # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
560 #fi
561 config_mak="config-host.mak"
562 config_h="config-host.h"
564 #echo "Creating $config_mak and $config_h"
566 echo "# Automatically generated by configure - do not modify" > $config_mak
567 echo "# Configured with: $0 $@" >> $config_mak
568 echo "/* Automatically generated by configure - do not modify */" > $config_h
570 echo "prefix=$prefix" >> $config_mak
571 echo "bindir=$bindir" >> $config_mak
572 echo "mandir=$mandir" >> $config_mak
573 echo "datadir=$datadir" >> $config_mak
574 echo "docdir=$docdir" >> $config_mak
575 echo "configdir=$configdir" >> $config_mak
576 echo "LIBDIR=$libdir" >> $config_mak
577 echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
578 echo "MAKE=$make" >> $config_mak
579 echo "INSTALL=$install" >> $config_mak
580 echo "CC=$cc" >> $config_mak
581 if test "$have_gcc3_options" = "yes" ; then
582 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
583 fi
584 echo "HOST_CC=$host_cc" >> $config_mak
585 echo "AR=$ar" >> $config_mak
586 echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
587 echo "CFLAGS=$CFLAGS" >> $config_mak
588 echo "LDFLAGS=$LDFLAGS" >> $config_mak
589 echo "EXESUF=$EXESUF" >> $config_mak
590 if test "$cpu" = "i386" ; then
591 echo "ARCH=i386" >> $config_mak
592 echo "#define HOST_I386 1" >> $config_h
593 elif test "$cpu" = "x86_64" ; then
594 echo "ARCH=x86_64" >> $config_mak
595 echo "#define HOST_X86_64 1" >> $config_h
596 elif test "$cpu" = "armv4b" ; then
597 echo "ARCH=arm" >> $config_mak
598 echo "#define HOST_ARM 1" >> $config_h
599 elif test "$cpu" = "armv4l" ; then
600 echo "ARCH=arm" >> $config_mak
601 echo "#define HOST_ARM 1" >> $config_h
602 elif test "$cpu" = "powerpc" ; then
603 echo "ARCH=ppc" >> $config_mak
604 echo "#define HOST_PPC 1" >> $config_h
605 elif test "$cpu" = "mips" ; then
606 echo "ARCH=mips" >> $config_mak
607 echo "#define HOST_MIPS 1" >> $config_h
608 elif test "$cpu" = "s390" ; then
609 echo "ARCH=s390" >> $config_mak
610 echo "#define HOST_S390 1" >> $config_h
611 elif test "$cpu" = "alpha" ; then
612 echo "ARCH=alpha" >> $config_mak
613 echo "#define HOST_ALPHA 1" >> $config_h
614 elif test "$cpu" = "sparc" ; then
615 echo "ARCH=sparc" >> $config_mak
616 echo "#define HOST_SPARC 1" >> $config_h
617 elif test "$cpu" = "sparc64" ; then
618 echo "ARCH=sparc64" >> $config_mak
619 echo "#define HOST_SPARC64 1" >> $config_h
620 elif test "$cpu" = "ia64" ; then
621 echo "ARCH=ia64" >> $config_mak
622 echo "#define HOST_IA64 1" >> $config_h
623 elif test "$cpu" = "m68k" ; then
624 echo "ARCH=m68k" >> $config_mak
625 echo "#define HOST_M68K 1" >> $config_h
626 else
627 echo "Unsupported CPU"
628 exit 1
629 fi
630 if test "$bigendian" = "yes" ; then
631 echo "WORDS_BIGENDIAN=yes" >> $config_mak
632 echo "#define WORDS_BIGENDIAN 1" >> $config_h
633 fi
634 echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
635 if test "$mingw32" = "yes" ; then
636 echo "CONFIG_WIN32=yes" >> $config_mak
637 echo "#define CONFIG_WIN32 1" >> $config_h
638 elif test -f "/usr/include/byteswap.h" ; then
639 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
640 fi
641 if test "$darwin" = "yes" ; then
642 echo "CONFIG_DARWIN=yes" >> $config_mak
643 echo "#define CONFIG_DARWIN 1" >> $config_h
644 fi
645 if test "$solaris" = "yes" ; then
646 echo "CONFIG_SOLARIS=yes" >> $config_mak
647 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
648 fi
649 if test "$gdbstub" = "yes" ; then
650 echo "CONFIG_GDBSTUB=yes" >> $config_mak
651 echo "#define CONFIG_GDBSTUB 1" >> $config_h
652 fi
653 if test "$gprof" = "yes" ; then
654 echo "TARGET_GPROF=yes" >> $config_mak
655 echo "#define HAVE_GPROF 1" >> $config_h
656 fi
657 if test "$static" = "yes" ; then
658 echo "CONFIG_STATIC=yes" >> $config_mak
659 echo "#define CONFIG_STATIC 1" >> $config_h
660 fi
661 if test $profiler = "yes" ; then
662 echo "#define CONFIG_PROFILER 1" >> $config_h
663 fi
664 if test "$slirp" = "yes" ; then
665 echo "CONFIG_SLIRP=yes" >> $config_mak
666 echo "#define CONFIG_SLIRP 1" >> $config_h
667 fi
668 if test "$adlib" = "yes" ; then
669 echo "CONFIG_ADLIB=yes" >> $config_mak
670 echo "#define CONFIG_ADLIB 1" >> $config_h
671 fi
672 if test "$oss" = "yes" ; then
673 echo "CONFIG_OSS=yes" >> $config_mak
674 echo "#define CONFIG_OSS 1" >> $config_h
675 fi
676 if test "$coreaudio" = "yes" ; then
677 echo "CONFIG_COREAUDIO=yes" >> $config_mak
678 echo "#define CONFIG_COREAUDIO 1" >> $config_h
679 fi
680 if test "$alsa" = "yes" ; then
681 echo "CONFIG_ALSA=yes" >> $config_mak
682 echo "#define CONFIG_ALSA 1" >> $config_h
683 fi
684 if test "$dsound" = "yes" ; then
685 echo "CONFIG_DSOUND=yes" >> $config_mak
686 echo "#define CONFIG_DSOUND 1" >> $config_h
687 fi
688 if test "$fmod" = "yes" ; then
689 echo "CONFIG_FMOD=yes" >> $config_mak
690 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
691 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
692 echo "#define CONFIG_FMOD 1" >> $config_h
693 fi
694 qemu_version=`head $source_path/VERSION`
695 echo "VERSION=$qemu_version" >>$config_mak
696 echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
698 echo "SRC_PATH=$source_path" >> $config_mak
699 if [ "$source_path_used" = "yes" ]; then
700 echo "VPATH=$source_path" >> $config_mak
701 fi
702 echo "TARGET_DIRS=$target_list" >> $config_mak
703 if [ "$build_docs" = "yes" ] ; then
704 echo "BUILD_DOCS=yes" >> $config_mak
705 fi
707 # XXX: suppress that
708 if [ "$bsd" = "yes" ] ; then
709 echo "#define O_LARGEFILE 0" >> $config_h
710 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
711 echo "#define _BSD 1" >> $config_h
712 fi
714 for target in $target_list; do
715 target_dir="$target"
716 config_mak=$target_dir/config.mak
717 config_h=$target_dir/config.h
718 target_cpu=`echo $target | cut -d '-' -f 1`
719 target_bigendian="no"
720 [ "$target_cpu" = "armeb" ] && target_bigendian=yes
721 [ "$target_cpu" = "sparc" ] && target_bigendian=yes
722 [ "$target_cpu" = "sparc64" ] && target_bigendian=yes
723 [ "$target_cpu" = "ppc" ] && target_bigendian=yes
724 [ "$target_cpu" = "ppc64" ] && target_bigendian=yes
725 [ "$target_cpu" = "mips" ] && target_bigendian=yes
726 target_softmmu="no"
727 if expr $target : '.*-softmmu' > /dev/null ; then
728 target_softmmu="yes"
729 fi
730 #for support 256M guest
731 target_softmmu="yes"
732 target_user_only="no"
733 if expr $target : '.*-user' > /dev/null ; then
734 target_user_only="yes"
735 fi
737 #echo "Creating $config_mak, $config_h and $target_dir/Makefile"
739 mkdir -p $target_dir
740 mkdir -p $target_dir/fpu
741 if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
742 mkdir -p $target_dir/nwfpe
743 fi
744 if test "$target_user_only" = "no" ; then
745 mkdir -p $target_dir/slirp
746 fi
748 #
749 # don't use ln -sf as not all "ln -sf" over write the file/link
750 #
751 rm -f $target_dir/Makefile
752 ln -s ../Makefile.target $target_dir/Makefile
755 echo "# Automatically generated by configure - do not modify" > $config_mak
756 echo "/* Automatically generated by configure - do not modify */" > $config_h
759 echo "include ../config-host.mak" >> $config_mak
760 echo "#include \"../config-host.h\"" >> $config_h
762 interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
763 echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
765 target_sub=
766 if expr $target : '.*-dm' > /dev/null ; then
767 target_sub=-dm
768 fi
769 echo "TARGET_SUB=${target_sub}" >> $config_mak
771 if test "$target_cpu" = "i386" ; then
772 echo "TARGET_ARCH=i386" >> $config_mak
773 echo "#define TARGET_ARCH \"i386\"" >> $config_h
774 echo "#define TARGET_I386 1" >> $config_h
775 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
776 echo "#define USE_KQEMU 1" >> $config_h
777 fi
778 elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
779 echo "TARGET_ARCH=arm" >> $config_mak
780 echo "#define TARGET_ARCH \"arm\"" >> $config_h
781 echo "#define TARGET_ARM 1" >> $config_h
782 elif test "$target_cpu" = "sparc" ; then
783 echo "TARGET_ARCH=sparc" >> $config_mak
784 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
785 echo "#define TARGET_SPARC 1" >> $config_h
786 elif test "$target_cpu" = "sparc64" ; then
787 echo "TARGET_ARCH=sparc64" >> $config_mak
788 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
789 echo "#define TARGET_SPARC 1" >> $config_h
790 echo "#define TARGET_SPARC64 1" >> $config_h
791 elif test "$target_cpu" = "ppc" ; then
792 echo "TARGET_ARCH=ppc" >> $config_mak
793 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
794 echo "#define TARGET_PPC 1" >> $config_h
795 elif test "$target_cpu" = "ppc64" ; then
796 echo "TARGET_ARCH=ppc64" >> $config_mak
797 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
798 echo "#define TARGET_PPC 1" >> $config_h
799 echo "#define TARGET_PPC64 1" >> $config_h
800 elif test "$target_cpu" = "x86_64" ; then
801 echo "TARGET_ARCH=x86_64" >> $config_mak
802 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
803 echo "#define TARGET_I386 1" >> $config_h
804 echo "#define TARGET_X86_64 1" >> $config_h
805 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
806 echo "#define USE_KQEMU 1" >> $config_h
807 fi
808 elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
809 echo "TARGET_ARCH=mips" >> $config_mak
810 echo "#define TARGET_ARCH \"mips\"" >> $config_h
811 echo "#define TARGET_MIPS 1" >> $config_h
812 elif test "$target_cpu" = "sh4" ; then
813 echo "TARGET_ARCH=sh4" >> $config_mak
814 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
815 echo "#define TARGET_SH4 1" >> $config_h
816 else
817 echo "Unsupported target CPU"
818 exit 1
819 fi
820 if test "$target_bigendian" = "yes" ; then
821 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
822 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
823 fi
824 if test "$target_softmmu" = "yes" ; then
825 echo "CONFIG_SOFTMMU=yes" >> $config_mak
826 echo "#define CONFIG_SOFTMMU 1" >> $config_h
827 fi
828 if test "$target_user_only" = "yes" ; then
829 echo "CONFIG_USER_ONLY=yes" >> $config_mak
830 echo "#define CONFIG_USER_ONLY 1" >> $config_h
831 fi
833 if expr $target : '.*-dm' > /dev/null ; then
834 echo "#define CONFIG_DM 1" >> $config_h
835 fi
837 if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
838 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
839 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
840 fi
841 # sdl defines
843 if test "$target_user_only" = "no"; then
844 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
845 sdl1=$sdl_static
846 else
847 sdl1=$sdl
848 fi
849 if test "$sdl1" = "yes" ; then
850 echo "#define CONFIG_SDL 1" >> $config_h
851 echo "CONFIG_SDL=yes" >> $config_mak
852 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
853 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
854 else
855 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
856 fi
857 if [ "${aa}" = "yes" ] ; then
858 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
859 else
860 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
861 fi
862 fi
863 fi
865 if test "$cocoa" = "yes" ; then
866 echo "#define CONFIG_COCOA 1" >> $config_h
867 echo "CONFIG_COCOA=yes" >> $config_mak
868 fi
870 done # for target in $targets
872 # build tree in object directory if source path is different from current one
873 if test "$source_path_used" = "yes" ; then
874 DIRS="tests"
875 FILES="Makefile tests/Makefile"
876 for dir in $DIRS ; do
877 mkdir -p $dir
878 done
879 # remove the link and recreate it, as not all "ln -sf" overwrite the link
880 for f in $FILES ; do
881 rm -f $f
882 ln -s $source_path/$f $f
883 done
884 fi
886 rm -f $TMPO $TMPC $TMPE $TMPS