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