ia64/xen-unstable

view tools/ioemu/configure @ 16871:5e60a38ffcf2

ioemu: 'lib64' is Linux-specific

Only use libdir == 'lib64' on Linux.

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