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