]>
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" | |
328a4240 | 25 | gcc3_search="yes" |
fe8f78e4 | 26 | gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32" |
0c58ac1c | 27 | audio_drv_list="" |
28 | audio_card_list="" | |
7d13299d FB |
29 | host_cc="gcc" |
30 | ar="ar" | |
31 | make="make" | |
6a882643 | 32 | install="install" |
7d13299d FB |
33 | strip="strip" |
34 | cpu=`uname -m` | |
5327cf48 | 35 | target_list="" |
7d13299d FB |
36 | case "$cpu" in |
37 | i386|i486|i586|i686|i86pc|BePC) | |
97a847bc | 38 | cpu="i386" |
7d13299d | 39 | ;; |
aaa5fa14 AJ |
40 | x86_64|amd64) |
41 | cpu="x86_64" | |
42 | ;; | |
43 | alpha) | |
44 | cpu="alpha" | |
45 | ;; | |
ba68055e | 46 | armv*b) |
808c4954 FB |
47 | cpu="armv4b" |
48 | ;; | |
ba68055e | 49 | armv*l) |
7d13299d FB |
50 | cpu="armv4l" |
51 | ;; | |
aaa5fa14 AJ |
52 | cris) |
53 | cpu="cris" | |
7d13299d | 54 | ;; |
f54b3f92 AJ |
55 | parisc|parisc64) |
56 | cpu="hppa" | |
57 | ;; | |
aaa5fa14 AJ |
58 | ia64) |
59 | cpu="ia64" | |
60 | ;; | |
61 | m68k) | |
62 | cpu="m68k" | |
7d13299d FB |
63 | ;; |
64 | mips) | |
65 | cpu="mips" | |
66 | ;; | |
fbe4f65b TS |
67 | mips64) |
68 | cpu="mips64" | |
69 | ;; | |
aaa5fa14 AJ |
70 | "Power Macintosh"|ppc|ppc64) |
71 | cpu="powerpc" | |
e7daa605 | 72 | ;; |
0e7b8a9f | 73 | s390*) |
fb3e5849 FB |
74 | cpu="s390" |
75 | ;; | |
3142255c | 76 | sparc|sun4[cdmuv]) |
ae228531 FB |
77 | cpu="sparc" |
78 | ;; | |
79 | sparc64) | |
80 | cpu="sparc64" | |
81 | ;; | |
7d13299d FB |
82 | *) |
83 | cpu="unknown" | |
84 | ;; | |
85 | esac | |
86 | gprof="no" | |
87 | bigendian="no" | |
67b915a5 FB |
88 | mingw32="no" |
89 | EXESUF="" | |
90 | gdbstub="yes" | |
443f1376 | 91 | slirp="yes" |
e0e6c8c0 | 92 | vde="yes" |
102a52e4 FB |
93 | fmod_lib="" |
94 | fmod_inc="" | |
2f6a1ab0 | 95 | oss_lib="" |
8d5d2d4c | 96 | vnc_tls="yes" |
b1a550a0 | 97 | bsd="no" |
5327cf48 | 98 | linux="no" |
c9ec1fe4 | 99 | kqemu="no" |
05c2a3e7 | 100 | profiler="no" |
5b0753e0 | 101 | cocoa="no" |
97ccc689 | 102 | check_gfx="yes" |
1aff381f | 103 | check_gcc="yes" |
0a8e90f4 | 104 | softmmu="yes" |
831b7825 TS |
105 | linux_user="no" |
106 | darwin_user="no" | |
cc8ae6de | 107 | build_docs="no" |
c5937220 | 108 | uname_release="" |
4d3b6f6e | 109 | curses="yes" |
414f0dab | 110 | aio="yes" |
bd0c5661 | 111 | nptl="yes" |
8ff9cbf7 | 112 | mixemu="no" |
27463101 AL |
113 | signalfd="no" |
114 | eventfd="no" | |
7d13299d FB |
115 | |
116 | # OS specific | |
117 | targetos=`uname -s` | |
118 | case $targetos in | |
c326e0af FB |
119 | CYGWIN*) |
120 | mingw32="yes" | |
6f30fa85 | 121 | OS_CFLAGS="-mno-cygwin" |
db8d7dd1 TS |
122 | if [ "$cpu" = "i386" ] ; then |
123 | kqemu="yes" | |
124 | fi | |
c2de5c91 | 125 | audio_possible_drivers="sdl" |
c326e0af | 126 | ;; |
67b915a5 FB |
127 | MINGW32*) |
128 | mingw32="yes" | |
db8d7dd1 TS |
129 | if [ "$cpu" = "i386" ] ; then |
130 | kqemu="yes" | |
131 | fi | |
c2de5c91 | 132 | audio_possible_drivers="dsound sdl fmod" |
67b915a5 | 133 | ;; |
5c40d2bd | 134 | GNU/kFreeBSD) |
0c58ac1c | 135 | audio_drv_list="oss" |
f34af52c | 136 | audio_possible_drivers="oss sdl esd pa" |
5c40d2bd TS |
137 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
138 | kqemu="yes" | |
139 | fi | |
140 | ;; | |
7d3505c5 FB |
141 | FreeBSD) |
142 | bsd="yes" | |
0c58ac1c | 143 | audio_drv_list="oss" |
f34af52c | 144 | audio_possible_drivers="oss sdl esd pa" |
e99f9060 | 145 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
07f4ddbf FB |
146 | kqemu="yes" |
147 | fi | |
7d3505c5 FB |
148 | ;; |
149 | NetBSD) | |
150 | bsd="yes" | |
0c58ac1c | 151 | audio_drv_list="oss" |
c2de5c91 | 152 | audio_possible_drivers="oss sdl esd" |
7d3505c5 FB |
153 | ;; |
154 | OpenBSD) | |
155 | bsd="yes" | |
128ab2ff | 156 | openbsd="yes" |
0c58ac1c | 157 | audio_drv_list="oss" |
c2de5c91 | 158 | audio_possible_drivers="oss sdl esd" |
2f6a1ab0 | 159 | oss_lib="-lossaudio" |
7d3505c5 | 160 | ;; |
83fb7adf FB |
161 | Darwin) |
162 | bsd="yes" | |
163 | darwin="yes" | |
831b7825 | 164 | darwin_user="yes" |
fd677642 | 165 | cocoa="yes" |
0c58ac1c | 166 | audio_drv_list="coreaudio" |
c2de5c91 | 167 | audio_possible_drivers="coreaudio sdl fmod" |
6f30fa85 | 168 | OS_CFLAGS="-mdynamic-no-pic" |
c2c59c3e | 169 | OS_LDFLAGS="-framework CoreFoundation -framework IOKit" |
83fb7adf | 170 | ;; |
ec530c81 | 171 | SunOS) |
c2b84fab TS |
172 | solaris="yes" |
173 | make="gmake" | |
174 | install="ginstall" | |
0475a5ca | 175 | needs_libsunmath="no" |
c2b84fab | 176 | solarisrev=`uname -r | cut -f2 -d.` |
ef18c883 TS |
177 | # have to select again, because `uname -m` returns i86pc |
178 | # even on an x86_64 box. | |
179 | solariscpu=`isainfo -k` | |
180 | if test "${solariscpu}" = "amd64" ; then | |
181 | cpu="x86_64" | |
182 | fi | |
c2b84fab | 183 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
0475a5ca TS |
184 | if test "$solarisrev" -le 9 ; then |
185 | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then | |
186 | needs_libsunmath="yes" | |
187 | else | |
188 | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" | |
189 | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" | |
190 | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" | |
191 | echo "Studio 11 can be downloaded from www.sun.com." | |
192 | exit 1 | |
193 | fi | |
194 | fi | |
195 | if test "$solarisrev" -ge 9 ; then | |
c2b84fab TS |
196 | kqemu="yes" |
197 | fi | |
86b2bd93 | 198 | fi |
6b4d2ba1 | 199 | if test -f /usr/include/sys/soundcard.h ; then |
0c58ac1c | 200 | audio_drv_list="oss" |
6b4d2ba1 | 201 | fi |
c2de5c91 | 202 | audio_possible_drivers="oss sdl" |
86b2bd93 | 203 | ;; |
1d14ffa9 | 204 | *) |
0c58ac1c | 205 | audio_drv_list="oss" |
b8e59f18 | 206 | audio_possible_drivers="oss alsa sdl esd pa" |
5327cf48 | 207 | linux="yes" |
831b7825 | 208 | linux_user="yes" |
07f4ddbf | 209 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
c9ec1fe4 | 210 | kqemu="yes" |
c2de5c91 | 211 | audio_possible_drivers="$audio_possible_drivers fmod" |
c9ec1fe4 | 212 | fi |
fb065187 | 213 | ;; |
7d13299d FB |
214 | esac |
215 | ||
7d3505c5 | 216 | if [ "$bsd" = "yes" ] ; then |
b1a550a0 | 217 | if [ "$darwin" != "yes" ] ; then |
83fb7adf FB |
218 | make="gmake" |
219 | fi | |
7d3505c5 FB |
220 | fi |
221 | ||
7d13299d | 222 | # find source path |
ad064840 | 223 | source_path=`dirname "$0"` |
59faef3a AZ |
224 | source_path_used="no" |
225 | workdir=`pwd` | |
ad064840 | 226 | if [ -z "$source_path" ]; then |
59faef3a | 227 | source_path=$workdir |
ad064840 PB |
228 | else |
229 | source_path=`cd "$source_path"; pwd` | |
7d13299d | 230 | fi |
724db118 | 231 | [ -f "$workdir/vl.c" ] || source_path_used="yes" |
7d13299d | 232 | |
85aa5189 | 233 | werror="no" |
0d1e2394 FB |
234 | # generate compile errors on warnings for development builds |
235 | #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then | |
236 | #werror="yes"; | |
237 | #fi | |
85aa5189 | 238 | |
7d13299d | 239 | for opt do |
a46e4035 | 240 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
7d13299d | 241 | case "$opt" in |
2efc3265 FB |
242 | --help|-h) show_help=yes |
243 | ;; | |
b1a550a0 | 244 | --prefix=*) prefix="$optarg" |
7d13299d | 245 | ;; |
b1a550a0 | 246 | --interp-prefix=*) interp_prefix="$optarg" |
32ce6337 | 247 | ;; |
b1a550a0 | 248 | --source-path=*) source_path="$optarg" |
ad064840 | 249 | source_path_used="yes" |
7d13299d | 250 | ;; |
b1a550a0 | 251 | --cross-prefix=*) cross_prefix="$optarg" |
7d13299d | 252 | ;; |
b1a550a0 | 253 | --cc=*) cc="$optarg" |
328a4240 | 254 | gcc3_search="no" |
7d13299d | 255 | ;; |
b1a550a0 | 256 | --host-cc=*) host_cc="$optarg" |
83469015 | 257 | ;; |
b1a550a0 | 258 | --make=*) make="$optarg" |
7d13299d | 259 | ;; |
6a882643 PB |
260 | --install=*) install="$optarg" |
261 | ;; | |
b1a550a0 | 262 | --extra-cflags=*) CFLAGS="$optarg" |
7d13299d | 263 | ;; |
b1a550a0 | 264 | --extra-ldflags=*) LDFLAGS="$optarg" |
7d13299d | 265 | ;; |
b1a550a0 | 266 | --cpu=*) cpu="$optarg" |
7d13299d | 267 | ;; |
b1a550a0 | 268 | --target-list=*) target_list="$optarg" |
de83cd02 | 269 | ;; |
7d13299d FB |
270 | --enable-gprof) gprof="yes" |
271 | ;; | |
43ce4dfe FB |
272 | --static) static="yes" |
273 | ;; | |
97a847bc FB |
274 | --disable-sdl) sdl="no" |
275 | ;; | |
0c58ac1c | 276 | --fmod-lib=*) fmod_lib="$optarg" |
1d14ffa9 | 277 | ;; |
c2de5c91 | 278 | --fmod-inc=*) fmod_inc="$optarg" |
279 | ;; | |
2f6a1ab0 BS |
280 | --oss-lib=*) oss_lib="$optarg" |
281 | ;; | |
2fa7d3bf | 282 | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
102a52e4 | 283 | ;; |
0c58ac1c | 284 | --audio-drv-list=*) audio_drv_list="$optarg" |
102a52e4 | 285 | ;; |
8d5d2d4c TS |
286 | --disable-vnc-tls) vnc_tls="no" |
287 | ;; | |
443f1376 | 288 | --disable-slirp) slirp="no" |
1d14ffa9 | 289 | ;; |
e0e6c8c0 | 290 | --disable-vde) vde="no" |
8a16d273 | 291 | ;; |
c9ec1fe4 | 292 | --disable-kqemu) kqemu="no" |
1d14ffa9 | 293 | ;; |
2e4d9fb1 AJ |
294 | --disable-brlapi) brlapi="no" |
295 | ;; | |
05c2a3e7 FB |
296 | --enable-profiler) profiler="yes" |
297 | ;; | |
c2de5c91 | 298 | --enable-cocoa) |
299 | cocoa="yes" ; | |
300 | sdl="no" ; | |
301 | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" | |
1d14ffa9 | 302 | ;; |
97ccc689 FB |
303 | --disable-gfx-check) check_gfx="no" |
304 | ;; | |
1aff381f FB |
305 | --disable-gcc-check) check_gcc="no" |
306 | ;; | |
cad25d69 | 307 | --disable-system) softmmu="no" |
0a8e90f4 | 308 | ;; |
cad25d69 | 309 | --enable-system) softmmu="yes" |
0a8e90f4 | 310 | ;; |
831b7825 | 311 | --disable-linux-user) linux_user="no" |
0a8e90f4 | 312 | ;; |
831b7825 TS |
313 | --enable-linux-user) linux_user="yes" |
314 | ;; | |
315 | --disable-darwin-user) darwin_user="no" | |
316 | ;; | |
317 | --enable-darwin-user) darwin_user="yes" | |
0a8e90f4 | 318 | ;; |
c5937220 PB |
319 | --enable-uname-release=*) uname_release="$optarg" |
320 | ;; | |
3142255c BS |
321 | --sparc_cpu=*) |
322 | sparc_cpu="$optarg" | |
323 | case $sparc_cpu in | |
324 | v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" | |
325 | target_cpu="sparc"; cpu="sparc" ;; | |
326 | v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" | |
327 | target_cpu="sparc"; cpu="sparc" ;; | |
328 | v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64" | |
329 | target_cpu="sparc64"; cpu="sparc64" ;; | |
330 | *) echo "undefined SPARC architecture. Exiting";exit 1;; | |
331 | esac | |
332 | ;; | |
85aa5189 FB |
333 | --enable-werror) werror="yes" |
334 | ;; | |
335 | --disable-werror) werror="no" | |
336 | ;; | |
4d3b6f6e AZ |
337 | --disable-curses) curses="no" |
338 | ;; | |
bd0c5661 PB |
339 | --disable-nptl) nptl="no" |
340 | ;; | |
8ff9cbf7 | 341 | --enable-mixemu) mixemu="yes" |
342 | ;; | |
414f0dab BS |
343 | --disable-aio) aio="no" |
344 | ;; | |
7f1559c6 AZ |
345 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
346 | ;; | |
7d13299d FB |
347 | esac |
348 | done | |
349 | ||
6f30fa85 | 350 | # default flags for all hosts |
ac41a620 BS |
351 | CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing" |
352 | CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings" | |
6f30fa85 | 353 | LDFLAGS="$LDFLAGS -g" |
85aa5189 FB |
354 | if test "$werror" = "yes" ; then |
355 | CFLAGS="$CFLAGS -Werror" | |
356 | fi | |
6f30fa85 | 357 | |
49237acd BS |
358 | if ld --version 2>/dev/null | grep -q "GNU ld" ; then |
359 | LDFLAGS="$LDFLAGS -Wl,--warn-common" | |
360 | fi | |
361 | ||
3142255c BS |
362 | # |
363 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right | |
364 | # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) | |
365 | # | |
40293e58 | 366 | case "$cpu" in |
3142255c BS |
367 | sparc) if test -z "$sparc_cpu" ; then |
368 | ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__" | |
369 | ARCH_LDFLAGS="-m32" | |
370 | else | |
371 | ARCH_CFLAGS="${SP_CFLAGS}" | |
372 | ARCH_LDFLAGS="${SP_LDFLAGS}" | |
373 | fi | |
374 | ;; | |
375 | sparc64) if test -z "$sparc_cpu" ; then | |
376 | ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__" | |
377 | ARCH_LDFLAGS="-m64" | |
378 | else | |
379 | ARCH_CFLAGS="${SP_CFLAGS}" | |
380 | ARCH_LDFLAGS="${SP_LDFLAGS}" | |
381 | fi | |
382 | ;; | |
76d83bde TS |
383 | s390) |
384 | ARCH_CFLAGS="-march=z900" | |
385 | ;; | |
40293e58 FB |
386 | i386) |
387 | ARCH_CFLAGS="-m32" | |
388 | ARCH_LDFLAGS="-m32" | |
389 | ;; | |
390 | x86_64) | |
391 | ARCH_CFLAGS="-m64" | |
392 | ARCH_LDFLAGS="-m64" | |
393 | ;; | |
3142255c BS |
394 | esac |
395 | ||
af5db58e PB |
396 | if test x"$show_help" = x"yes" ; then |
397 | cat << EOF | |
398 | ||
399 | Usage: configure [options] | |
400 | Options: [defaults in brackets after descriptions] | |
401 | ||
402 | EOF | |
403 | echo "Standard options:" | |
404 | echo " --help print this message" | |
405 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
406 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." | |
407 | echo " use %M for cpu name [$interp_prefix]" | |
408 | echo " --target-list=LIST set target list [$target_list]" | |
409 | echo "" | |
410 | echo "kqemu kernel acceleration support:" | |
411 | echo " --disable-kqemu disable kqemu support" | |
af5db58e PB |
412 | echo "" |
413 | echo "Advanced options (experts only):" | |
414 | echo " --source-path=PATH path of source code [$source_path]" | |
415 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
416 | echo " --cc=CC use C compiler CC [$cc]" | |
417 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." | |
418 | echo " --make=MAKE use specified make [$make]" | |
6a882643 | 419 | echo " --install=INSTALL use specified install [$install]" |
af5db58e | 420 | echo " --static enable static build [$static]" |
85aa5189 | 421 | echo " --disable-werror disable compilation abort on warning" |
fe8f78e4 | 422 | echo " --disable-sdl disable SDL" |
af5db58e | 423 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
c2de5c91 | 424 | echo " --audio-drv-list=LIST set audio drivers list:" |
425 | echo " Available drivers: $audio_possible_drivers" | |
426 | echo " --audio-card-list=LIST set list of additional emulated audio cards" | |
427 | echo " Available cards: ac97 adlib cs4231a gus" | |
8ff9cbf7 | 428 | echo " --enable-mixemu enable mixer emulation" |
2e4d9fb1 | 429 | echo " --disable-brlapi disable BrlAPI" |
8d5d2d4c | 430 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
af896aaa | 431 | echo " --disable-curses disable curses output" |
bd0c5661 | 432 | echo " --disable-nptl disable usermode NPTL support" |
af5db58e PB |
433 | echo " --enable-system enable all system emulation targets" |
434 | echo " --disable-system disable all system emulation targets" | |
831b7825 TS |
435 | echo " --enable-linux-user enable all linux usermode emulation targets" |
436 | echo " --disable-linux-user disable all linux usermode emulation targets" | |
437 | echo " --enable-darwin-user enable all darwin usermode emulation targets" | |
438 | echo " --disable-darwin-user disable all darwin usermode emulation targets" | |
af5db58e PB |
439 | echo " --fmod-lib path to FMOD library" |
440 | echo " --fmod-inc path to FMOD includes" | |
2f6a1ab0 | 441 | echo " --oss-lib path to OSS library" |
c5937220 | 442 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
3142255c | 443 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
e0e6c8c0 | 444 | echo " --disable-vde disable support for vde network" |
414f0dab | 445 | echo " --disable-aio disable AIO support" |
af5db58e | 446 | echo "" |
5bf08934 | 447 | echo "NOTE: The object files are built at the place where configure is launched" |
af5db58e PB |
448 | exit 1 |
449 | fi | |
450 | ||
7d13299d FB |
451 | cc="${cross_prefix}${cc}" |
452 | ar="${cross_prefix}${ar}" | |
453 | strip="${cross_prefix}${strip}" | |
454 | ||
064aae13 PB |
455 | # check that the C compiler works. |
456 | cat > $TMPC <<EOF | |
457 | int main(void) {} | |
458 | EOF | |
459 | ||
db7287ed | 460 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then |
064aae13 PB |
461 | : C compiler works ok |
462 | else | |
463 | echo "ERROR: \"$cc\" either does not exist or does not work" | |
464 | exit 1 | |
a7350fa1 FB |
465 | fi |
466 | ||
cd01b4a3 AL |
467 | # check compiler to see if we're on mingw32 |
468 | cat > $TMPC <<EOF | |
469 | #include <windows.h> | |
470 | #ifndef _WIN32 | |
471 | #error not windows | |
472 | #endif | |
473 | int main(void) {} | |
474 | EOF | |
475 | ||
476 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then | |
477 | mingw32="yes" | |
478 | fi | |
479 | ||
67b915a5 | 480 | if test "$mingw32" = "yes" ; then |
5327cf48 | 481 | linux="no" |
67b915a5 | 482 | EXESUF=".exe" |
9f059eca | 483 | oss="no" |
cd01b4a3 AL |
484 | linux_user="no" |
485 | fi | |
486 | ||
997306fc | 487 | if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then |
cd01b4a3 | 488 | AIOLIBS= |
997306fc AL |
489 | elif [ "$bsd" = "yes" ]; then |
490 | AIOLIBS="-lpthread" | |
cd01b4a3 AL |
491 | else |
492 | # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. | |
493 | AIOLIBS="-lrt -lpthread" | |
67b915a5 FB |
494 | fi |
495 | ||
5fafdf24 | 496 | # Check for gcc4, error if pre-gcc4 |
328a4240 PB |
497 | if test "$check_gcc" = "yes" ; then |
498 | cat > $TMPC <<EOF | |
499 | #if __GNUC__ < 4 | |
500 | #error gcc3 | |
501 | #endif | |
502 | int main(){return 0;} | |
503 | EOF | |
db7287ed | 504 | if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
328a4240 PB |
505 | echo "WARNING: \"$cc\" looks like gcc 4.x" |
506 | found_compat_cc="no" | |
507 | if test "$gcc3_search" = "yes" ; then | |
508 | echo "Looking for gcc 3.x" | |
509 | for compat_cc in $gcc3_list ; do | |
d4af3de2 | 510 | if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then |
328a4240 | 511 | echo "Found \"$compat_cc\"" |
1124426a | 512 | cc="$cross_prefix$compat_cc" |
328a4240 PB |
513 | found_compat_cc="yes" |
514 | break | |
515 | fi | |
516 | done | |
517 | if test "$found_compat_cc" = "no" ; then | |
518 | echo "gcc 3.x not found!" | |
519 | fi | |
520 | fi | |
521 | if test "$found_compat_cc" = "no" ; then | |
522 | echo "QEMU is known to have problems when compiled with gcc 4.x" | |
523 | echo "It is recommended that you use gcc 3.x to build QEMU" | |
524 | echo "To use this compiler anyway, configure with --disable-gcc-check" | |
525 | exit 1; | |
526 | fi | |
527 | fi | |
528 | fi | |
529 | ||
ec530c81 FB |
530 | # |
531 | # Solaris specific configure tool chain decisions | |
532 | # | |
533 | if test "$solaris" = "yes" ; then | |
534 | # | |
535 | # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly | |
536 | # override the check with --disable-gcc-check | |
5fafdf24 | 537 | # |
ec530c81 FB |
538 | if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then |
539 | solgcc=`which $cc` | |
540 | if test "$solgcc" = "/usr/sfw/bin/gcc" ; then | |
541 | echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly." | |
542 | echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3" | |
543 | echo "or get the latest patch from SunSolve for gcc" | |
544 | exit 1 | |
545 | fi | |
546 | fi | |
547 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` | |
548 | if test -z "$solinst" ; then | |
549 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" | |
550 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" | |
551 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" | |
552 | exit 1 | |
553 | fi | |
554 | if test "$solinst" = "/usr/sbin/install" ; then | |
555 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." | |
556 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" | |
557 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" | |
558 | exit 1 | |
559 | fi | |
ec530c81 FB |
560 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
561 | if test -z "$sol_ar" ; then | |
562 | echo "Error: No path includes ar" | |
563 | if test -f /usr/ccs/bin/ar ; then | |
564 | echo "Add /usr/ccs/bin to your path and rerun configure" | |
565 | fi | |
566 | exit 1 | |
567 | fi | |
5fafdf24 | 568 | fi |
ec530c81 FB |
569 | |
570 | ||
5327cf48 FB |
571 | if test -z "$target_list" ; then |
572 | # these targets are portable | |
0a8e90f4 | 573 | if [ "$softmmu" = "yes" ] ; then |
2408a527 AJ |
574 | target_list="\ |
575 | i386-softmmu \ | |
576 | x86_64-softmmu \ | |
577 | arm-softmmu \ | |
578 | cris-softmmu \ | |
579 | m68k-softmmu \ | |
580 | mips-softmmu \ | |
581 | mipsel-softmmu \ | |
582 | mips64-softmmu \ | |
583 | mips64el-softmmu \ | |
584 | ppc-softmmu \ | |
585 | ppcemb-softmmu \ | |
586 | ppc64-softmmu \ | |
587 | sh4-softmmu \ | |
588 | sh4eb-softmmu \ | |
589 | sparc-softmmu \ | |
590 | " | |
0a8e90f4 | 591 | fi |
5327cf48 | 592 | # the following are Linux specific |
831b7825 | 593 | if [ "$linux_user" = "yes" ] ; then |
2408a527 AJ |
594 | target_list="${target_list}\ |
595 | i386-linux-user \ | |
596 | x86_64-linux-user \ | |
597 | alpha-linux-user \ | |
598 | arm-linux-user \ | |
599 | armeb-linux-user \ | |
600 | cris-linux-user \ | |
601 | m68k-linux-user \ | |
602 | mips-linux-user \ | |
603 | mipsel-linux-user \ | |
604 | ppc-linux-user \ | |
605 | ppc64-linux-user \ | |
606 | ppc64abi32-linux-user \ | |
607 | sh4-linux-user \ | |
608 | sh4eb-linux-user \ | |
609 | sparc-linux-user \ | |
610 | sparc64-linux-user \ | |
611 | sparc32plus-linux-user \ | |
612 | " | |
831b7825 TS |
613 | fi |
614 | # the following are Darwin specific | |
615 | if [ "$darwin_user" = "yes" ] ; then | |
2408a527 | 616 | target_list="$target_list i386-darwin-user ppc-darwin-user" |
5327cf48 | 617 | fi |
6e20a45f | 618 | else |
b1a550a0 | 619 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
5327cf48 | 620 | fi |
0a8e90f4 PB |
621 | if test -z "$target_list" ; then |
622 | echo "No targets enabled" | |
623 | exit 1 | |
624 | fi | |
5327cf48 | 625 | |
7d13299d FB |
626 | if test -z "$cross_prefix" ; then |
627 | ||
628 | # --- | |
629 | # big/little endian test | |
630 | cat > $TMPC << EOF | |
631 | #include <inttypes.h> | |
632 | int main(int argc, char ** argv){ | |
1d14ffa9 FB |
633 | volatile uint32_t i=0x01234567; |
634 | return (*((uint8_t*)(&i))) == 0x67; | |
7d13299d FB |
635 | } |
636 | EOF | |
637 | ||
db7287ed | 638 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
7d13299d FB |
639 | $TMPE && bigendian="yes" |
640 | else | |
641 | echo big/little test failed | |
642 | fi | |
643 | ||
644 | else | |
645 | ||
646 | # if cross compiling, cannot launch a program, so make a static guess | |
0938cda5 | 647 | if test "$cpu" = "armv4b" \ |
f54b3f92 | 648 | -o "$cpu" = "hppa" \ |
0938cda5 AJ |
649 | -o "$cpu" = "m68k" \ |
650 | -o "$cpu" = "mips" \ | |
651 | -o "$cpu" = "mips64" \ | |
652 | -o "$cpu" = "powerpc" \ | |
653 | -o "$cpu" = "s390" \ | |
654 | -o "$cpu" = "sparc" \ | |
655 | -o "$cpu" = "sparc64"; then | |
7d13299d FB |
656 | bigendian="yes" |
657 | fi | |
658 | ||
659 | fi | |
660 | ||
b6853697 FB |
661 | # host long bits test |
662 | hostlongbits="32" | |
0938cda5 AJ |
663 | if test "$cpu" = "x86_64" \ |
664 | -o "$cpu" = "alpha" \ | |
665 | -o "$cpu" = "ia64" \ | |
666 | -o "$cpu" = "sparc64"; then | |
b6853697 FB |
667 | hostlongbits="64" |
668 | fi | |
669 | ||
810260a8 | 670 | # ppc specific hostlongbits selection |
671 | if test "$cpu" = "powerpc" ; then | |
672 | cat > $TMPC <<EOF | |
673 | int main(void){return sizeof(long);} | |
674 | EOF | |
675 | ||
676 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null; then | |
677 | $TMPE | |
678 | case $? in | |
679 | 4) hostlongbits="32";; | |
680 | 8) hostlongbits="64";; | |
ba69a08a | 681 | *) echo "Couldn't determine bits per long value"; exit 1;; |
810260a8 | 682 | esac |
683 | else | |
684 | echo hostlongbits test failed | |
ba69a08a | 685 | exit 1 |
810260a8 | 686 | fi |
687 | fi | |
688 | ||
e8cd23de | 689 | # check gcc options support |
04369ff2 FB |
690 | cat > $TMPC <<EOF |
691 | int main(void) { | |
04369ff2 FB |
692 | } |
693 | EOF | |
694 | ||
bd0c5661 PB |
695 | # Check host NPTL support |
696 | cat > $TMPC <<EOF | |
697 | #include <sched.h> | |
30813cea | 698 | #include <linux/futex.h> |
bd0c5661 PB |
699 | void foo() |
700 | { | |
701 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) | |
702 | #error bork | |
703 | #endif | |
704 | } | |
705 | EOF | |
706 | ||
707 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then | |
708 | : | |
709 | else | |
710 | nptl="no" | |
711 | fi | |
712 | ||
11d9f695 FB |
713 | ########################################## |
714 | # SDL probe | |
715 | ||
716 | sdl_too_old=no | |
717 | ||
718 | if test -z "$sdl" ; then | |
069b0bda TS |
719 | sdl_config="sdl-config" |
720 | sdl=no | |
721 | sdl_static=no | |
722 | ||
11d9f695 FB |
723 | cat > $TMPC << EOF |
724 | #include <SDL.h> | |
725 | #undef main /* We don't want SDL to override our main() */ | |
726 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
727 | EOF | |
cd01b4a3 AL |
728 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then |
729 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` | |
730 | if test "$_sdlversion" -lt 121 ; then | |
731 | sdl_too_old=yes | |
732 | else | |
733 | if test "$cocoa" = "no" ; then | |
734 | sdl=yes | |
069b0bda | 735 | fi |
cd01b4a3 | 736 | fi |
11d9f695 | 737 | |
cd01b4a3 AL |
738 | # static link with sdl ? |
739 | if test "$sdl" = "yes" ; then | |
740 | aa="no" | |
741 | `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes" | |
742 | sdl_static_libs=`$sdl_config --static-libs 2>/dev/null` | |
743 | if [ "$aa" = "yes" ] ; then | |
744 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" | |
745 | fi | |
746 | ||
747 | if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then | |
748 | sdl_static=yes | |
749 | fi | |
750 | fi # static link | |
751 | fi # sdl compile test | |
fd677642 | 752 | else |
069b0bda TS |
753 | # Make sure to disable cocoa if sdl was set |
754 | if test "$sdl" = "yes" ; then | |
755 | cocoa="no" | |
c2de5c91 | 756 | audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`" |
069b0bda | 757 | fi |
a6e022ad | 758 | fi # -z $sdl |
11d9f695 | 759 | |
8d5d2d4c TS |
760 | ########################################## |
761 | # VNC TLS detection | |
762 | if test "$vnc_tls" = "yes" ; then | |
ae6b5e5a AL |
763 | cat > $TMPC <<EOF |
764 | #include <gnutls/gnutls.h> | |
765 | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } | |
766 | EOF | |
767 | vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null` | |
768 | vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null` | |
769 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \ | |
770 | $vnc_tls_libs 2> /dev/null ; then | |
771 | : | |
772 | else | |
773 | vnc_tls="no" | |
774 | fi | |
8d5d2d4c TS |
775 | fi |
776 | ||
8a16d273 TS |
777 | ########################################## |
778 | # vde libraries probe | |
779 | if test "$vde" = "yes" ; then | |
780 | cat > $TMPC << EOF | |
781 | #include <libvdeplug.h> | |
4a7f0e06 PB |
782 | int main(void) |
783 | { | |
784 | struct vde_open_args a = {0, 0, 0}; | |
785 | vde_open("", "", &a); | |
786 | return 0; | |
787 | } | |
8a16d273 | 788 | EOF |
4a7f0e06 | 789 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then |
8a16d273 TS |
790 | : |
791 | else | |
e0e6c8c0 | 792 | vde="no" |
8a16d273 TS |
793 | fi |
794 | fi | |
795 | ||
8f28f3fb | 796 | ########################################## |
c2de5c91 | 797 | # Sound support libraries probe |
8f28f3fb | 798 | |
c2de5c91 | 799 | audio_drv_probe() |
800 | { | |
801 | drv=$1 | |
802 | hdr=$2 | |
803 | lib=$3 | |
804 | exp=$4 | |
805 | cfl=$5 | |
806 | cat > $TMPC << EOF | |
807 | #include <$hdr> | |
808 | int main(void) { $exp } | |
8f28f3fb | 809 | EOF |
c2de5c91 | 810 | if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then |
811 | : | |
812 | else | |
813 | echo | |
814 | echo "Error: $drv check failed" | |
815 | echo "Make sure to have the $drv libs and headers installed." | |
816 | echo | |
817 | exit 1 | |
818 | fi | |
819 | } | |
820 | ||
2fa7d3bf | 821 | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
c2de5c91 | 822 | for drv in $audio_drv_list; do |
823 | case $drv in | |
824 | alsa) | |
825 | audio_drv_probe $drv alsa/asoundlib.h -lasound \ | |
826 | "snd_pcm_t **handle; return snd_pcm_close(*handle);" | |
827 | ;; | |
828 | ||
829 | fmod) | |
830 | if test -z $fmod_lib || test -z $fmod_inc; then | |
831 | echo | |
832 | echo "Error: You must specify path to FMOD library and headers" | |
833 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
834 | echo | |
835 | exit 1 | |
836 | fi | |
837 | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" | |
838 | ;; | |
839 | ||
840 | esd) | |
841 | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' | |
842 | ;; | |
b8e59f18 | 843 | |
844 | pa) | |
845 | audio_drv_probe $drv pulse/simple.h -lpulse-simple \ | |
846 | "pa_simple *s = NULL; pa_simple_free(s); return 0;" | |
847 | ;; | |
848 | ||
2f6a1ab0 BS |
849 | oss|sdl|core|wav|dsound) |
850 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) | |
851 | ;; | |
852 | ||
e4c63a6a | 853 | *) |
1c9b2a52 | 854 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
e4c63a6a | 855 | echo |
856 | echo "Error: Unknown driver '$drv' selected" | |
857 | echo "Possible drivers are: $audio_possible_drivers" | |
858 | echo | |
859 | exit 1 | |
860 | } | |
861 | ;; | |
c2de5c91 | 862 | esac |
863 | done | |
8f28f3fb | 864 | |
2e4d9fb1 AJ |
865 | ########################################## |
866 | # BrlAPI probe | |
867 | ||
868 | if test -z "$brlapi" ; then | |
869 | brlapi=no | |
870 | cat > $TMPC << EOF | |
871 | #include <brlapi.h> | |
872 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } | |
873 | EOF | |
a40e56d5 | 874 | if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then |
2e4d9fb1 AJ |
875 | brlapi=yes |
876 | fi # brlapi compile test | |
877 | fi # -z $brlapi | |
878 | ||
4d3b6f6e AZ |
879 | ########################################## |
880 | # curses probe | |
881 | ||
882 | if test "$curses" = "yes" ; then | |
883 | curses=no | |
884 | cat > $TMPC << EOF | |
885 | #include <curses.h> | |
886 | int main(void) { return curses_version(); } | |
887 | EOF | |
af896aaa | 888 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then |
4d3b6f6e AZ |
889 | curses=yes |
890 | fi | |
891 | fi # test "$curses" | |
892 | ||
414f0dab BS |
893 | ########################################## |
894 | # AIO probe | |
895 | if test "$aio" = "yes" ; then | |
896 | aio=no | |
897 | cat > $TMPC << EOF | |
898 | #include <aio.h> | |
899 | int main(void) { return aio_write(NULL); } | |
900 | EOF | |
901 | if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then | |
902 | aio=yes | |
903 | fi | |
904 | fi | |
905 | ||
27463101 AL |
906 | ########################################## |
907 | # signalfd probe | |
908 | cat > $TMPC << EOF | |
909 | #define _GNU_SOURCE | |
910 | #include <unistd.h> | |
911 | #include <sys/syscall.h> | |
912 | #include <signal.h> | |
913 | int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } | |
914 | EOF | |
915 | ||
916 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then | |
917 | signalfd=yes | |
918 | fi | |
919 | ||
920 | ########################################## | |
921 | # eventfd probe | |
922 | cat > $TMPC << EOF | |
923 | #define _GNU_SOURCE | |
924 | #include <unistd.h> | |
925 | #include <sys/syscall.h> | |
926 | int main(void) { return syscall(SYS_eventfd, 0); } | |
927 | EOF | |
928 | ||
929 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then | |
930 | eventfd=yes | |
931 | fi | |
932 | ||
cc8ae6de | 933 | # Check if tools are available to build documentation. |
6c591867 TS |
934 | if [ -x "`which texi2html 2>/dev/null`" ] && \ |
935 | [ -x "`which pod2man 2>/dev/null`" ]; then | |
cc8ae6de PB |
936 | build_docs="yes" |
937 | fi | |
938 | ||
11d9f695 | 939 | if test "$mingw32" = "yes" ; then |
308c3593 PB |
940 | if test -z "$prefix" ; then |
941 | prefix="/c/Program Files/Qemu" | |
942 | fi | |
943 | mansuffix="" | |
944 | datasuffix="" | |
945 | docsuffix="" | |
946 | binsuffix="" | |
11d9f695 | 947 | else |
308c3593 PB |
948 | if test -z "$prefix" ; then |
949 | prefix="/usr/local" | |
950 | fi | |
951 | mansuffix="/share/man" | |
952 | datasuffix="/share/qemu" | |
953 | docsuffix="/share/doc/qemu" | |
954 | binsuffix="/bin" | |
11d9f695 | 955 | fi |
5a67135a | 956 | |
43ce4dfe | 957 | echo "Install prefix $prefix" |
308c3593 PB |
958 | echo "BIOS directory $prefix$datasuffix" |
959 | echo "binary directory $prefix$binsuffix" | |
11d9f695 | 960 | if test "$mingw32" = "no" ; then |
308c3593 | 961 | echo "Manual directory $prefix$mansuffix" |
43ce4dfe | 962 | echo "ELF interp prefix $interp_prefix" |
11d9f695 | 963 | fi |
5a67135a | 964 | echo "Source path $source_path" |
43ce4dfe | 965 | echo "C compiler $cc" |
83469015 | 966 | echo "Host C compiler $host_cc" |
db7287ed | 967 | echo "ARCH_CFLAGS $ARCH_CFLAGS" |
43ce4dfe | 968 | echo "make $make" |
6a882643 | 969 | echo "install $install" |
43ce4dfe | 970 | echo "host CPU $cpu" |
de83cd02 | 971 | echo "host big endian $bigendian" |
97a847bc | 972 | echo "target list $target_list" |
43ce4dfe | 973 | echo "gprof enabled $gprof" |
05c2a3e7 | 974 | echo "profiler $profiler" |
43ce4dfe | 975 | echo "static build $static" |
85aa5189 | 976 | echo "-Werror enabled $werror" |
5b0753e0 FB |
977 | if test "$darwin" = "yes" ; then |
978 | echo "Cocoa support $cocoa" | |
979 | fi | |
97a847bc | 980 | echo "SDL support $sdl" |
e4afee97 FB |
981 | if test "$sdl" != "no" ; then |
982 | echo "SDL static link $sdl_static" | |
983 | fi | |
4d3b6f6e | 984 | echo "curses support $curses" |
67b915a5 | 985 | echo "mingw32 support $mingw32" |
0c58ac1c | 986 | echo "Audio drivers $audio_drv_list" |
987 | echo "Extra audio cards $audio_card_list" | |
8ff9cbf7 | 988 | echo "Mixer emulation $mixemu" |
8d5d2d4c TS |
989 | echo "VNC TLS support $vnc_tls" |
990 | if test "$vnc_tls" = "yes" ; then | |
991 | echo " TLS CFLAGS $vnc_tls_cflags" | |
992 | echo " TLS LIBS $vnc_tls_libs" | |
993 | fi | |
3142255c BS |
994 | if test -n "$sparc_cpu"; then |
995 | echo "Target Sparc Arch $sparc_cpu" | |
996 | fi | |
07f4ddbf | 997 | echo "kqemu support $kqemu" |
2e4d9fb1 | 998 | echo "brlapi support $brlapi" |
cc8ae6de | 999 | echo "Documentation $build_docs" |
c5937220 PB |
1000 | [ ! -z "$uname_release" ] && \ |
1001 | echo "uname -r $uname_release" | |
bd0c5661 | 1002 | echo "NPTL support $nptl" |
8a16d273 | 1003 | echo "vde support $vde" |
414f0dab | 1004 | echo "AIO support $aio" |
67b915a5 | 1005 | |
97a847bc | 1006 | if test $sdl_too_old = "yes"; then |
24b55b96 | 1007 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
7c1f25b4 | 1008 | fi |
20b40c6a TS |
1009 | if [ -s /tmp/qemu-$$-sdl-config.log ]; then |
1010 | echo "The error log from compiling the libSDL test is: " | |
1011 | cat /tmp/qemu-$$-sdl-config.log | |
1012 | fi | |
1013 | rm -f /tmp/qemu-$$-sdl-config.log | |
24b55b96 FB |
1014 | #if test "$sdl_static" = "no"; then |
1015 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" | |
1016 | #fi | |
97a847bc FB |
1017 | config_mak="config-host.mak" |
1018 | config_h="config-host.h" | |
7d13299d | 1019 | |
7c1f25b4 | 1020 | #echo "Creating $config_mak and $config_h" |
7d13299d | 1021 | |
15d9ca0f TS |
1022 | test -f $config_h && mv $config_h ${config_h}~ |
1023 | ||
97a847bc | 1024 | echo "# Automatically generated by configure - do not modify" > $config_mak |
29517134 | 1025 | echo "# Configured with: $0 $@" >> $config_mak |
97a847bc | 1026 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
7d13299d | 1027 | |
97a847bc | 1028 | echo "prefix=$prefix" >> $config_mak |
308c3593 PB |
1029 | echo "bindir=\${prefix}$binsuffix" >> $config_mak |
1030 | echo "mandir=\${prefix}$mansuffix" >> $config_mak | |
1031 | echo "datadir=\${prefix}$datasuffix" >> $config_mak | |
4ad5b06d | 1032 | echo "docdir=\${prefix}$docsuffix" >> $config_mak |
308c3593 | 1033 | echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h |
97a847bc | 1034 | echo "MAKE=$make" >> $config_mak |
6a882643 | 1035 | echo "INSTALL=$install" >> $config_mak |
97a847bc | 1036 | echo "CC=$cc" >> $config_mak |
97a847bc FB |
1037 | echo "HOST_CC=$host_cc" >> $config_mak |
1038 | echo "AR=$ar" >> $config_mak | |
1039 | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak | |
40293e58 FB |
1040 | # XXX: only use CFLAGS and LDFLAGS ? |
1041 | # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross | |
1042 | # compilation of dyngen tool (useful for win32 build on Linux host) | |
6f30fa85 | 1043 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
3142255c BS |
1044 | echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak |
1045 | echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak | |
1046 | echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak | |
97a847bc FB |
1047 | echo "CFLAGS=$CFLAGS" >> $config_mak |
1048 | echo "LDFLAGS=$LDFLAGS" >> $config_mak | |
67b915a5 | 1049 | echo "EXESUF=$EXESUF" >> $config_mak |
70956b77 | 1050 | echo "AIOLIBS=$AIOLIBS" >> $config_mak |
2408a527 AJ |
1051 | case "$cpu" in |
1052 | i386) | |
1053 | echo "ARCH=i386" >> $config_mak | |
1054 | echo "#define HOST_I386 1" >> $config_h | |
1055 | ;; | |
1056 | x86_64) | |
1057 | echo "ARCH=x86_64" >> $config_mak | |
1058 | echo "#define HOST_X86_64 1" >> $config_h | |
1059 | ;; | |
1060 | alpha) | |
1061 | echo "ARCH=alpha" >> $config_mak | |
1062 | echo "#define HOST_ALPHA 1" >> $config_h | |
1063 | ;; | |
1064 | armv4b) | |
1065 | echo "ARCH=arm" >> $config_mak | |
1066 | echo "#define HOST_ARM 1" >> $config_h | |
1067 | ;; | |
1068 | armv4l) | |
1069 | echo "ARCH=arm" >> $config_mak | |
1070 | echo "#define HOST_ARM 1" >> $config_h | |
1071 | ;; | |
1072 | cris) | |
1073 | echo "ARCH=cris" >> $config_mak | |
1074 | echo "#define HOST_CRIS 1" >> $config_h | |
1075 | ;; | |
1076 | hppa) | |
1077 | echo "ARCH=hppa" >> $config_mak | |
1078 | echo "#define HOST_HPPA 1" >> $config_h | |
1079 | ;; | |
1080 | ia64) | |
1081 | echo "ARCH=ia64" >> $config_mak | |
1082 | echo "#define HOST_IA64 1" >> $config_h | |
1083 | ;; | |
1084 | m68k) | |
1085 | echo "ARCH=m68k" >> $config_mak | |
1086 | echo "#define HOST_M68K 1" >> $config_h | |
1087 | ;; | |
1088 | mips) | |
1089 | echo "ARCH=mips" >> $config_mak | |
1090 | echo "#define HOST_MIPS 1" >> $config_h | |
1091 | ;; | |
1092 | mips64) | |
1093 | echo "ARCH=mips64" >> $config_mak | |
1094 | echo "#define HOST_MIPS64 1" >> $config_h | |
1095 | ;; | |
1096 | powerpc) | |
810260a8 | 1097 | if test "$hostlongbits" = "32"; then |
1098 | echo "ARCH=ppc" >> $config_mak | |
1099 | echo "#define HOST_PPC 1" >> $config_h | |
1100 | else | |
1101 | echo "ARCH=ppc64" >> $config_mak | |
1102 | echo "#define HOST_PPC64 1" >> $config_h | |
1103 | fi | |
2408a527 AJ |
1104 | ;; |
1105 | s390) | |
1106 | echo "ARCH=s390" >> $config_mak | |
1107 | echo "#define HOST_S390 1" >> $config_h | |
1108 | ;; | |
1109 | sparc) | |
1110 | echo "ARCH=sparc" >> $config_mak | |
1111 | echo "#define HOST_SPARC 1" >> $config_h | |
1112 | ;; | |
1113 | sparc64) | |
1114 | echo "ARCH=sparc64" >> $config_mak | |
1115 | echo "#define HOST_SPARC64 1" >> $config_h | |
1116 | ;; | |
1117 | *) | |
1118 | echo "Unsupported CPU = $cpu" | |
1119 | exit 1 | |
1120 | ;; | |
1121 | esac | |
7d13299d | 1122 | if test "$bigendian" = "yes" ; then |
97a847bc FB |
1123 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
1124 | echo "#define WORDS_BIGENDIAN 1" >> $config_h | |
1125 | fi | |
b6853697 | 1126 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
67b915a5 FB |
1127 | if test "$mingw32" = "yes" ; then |
1128 | echo "CONFIG_WIN32=yes" >> $config_mak | |
11d9f695 | 1129 | echo "#define CONFIG_WIN32 1" >> $config_h |
210fa556 PB |
1130 | else |
1131 | cat > $TMPC << EOF | |
1132 | #include <byteswap.h> | |
1133 | int main(void) { return bswap_32(0); } | |
1134 | EOF | |
db7287ed | 1135 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
210fa556 PB |
1136 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
1137 | fi | |
67b915a5 | 1138 | fi |
128ab2ff BS |
1139 | |
1140 | if [ "$openbsd" = "yes" ] ; then | |
1141 | echo "#define ENOTSUP 4096" >> $config_h | |
1142 | fi | |
1143 | ||
83fb7adf FB |
1144 | if test "$darwin" = "yes" ; then |
1145 | echo "CONFIG_DARWIN=yes" >> $config_mak | |
1146 | echo "#define CONFIG_DARWIN 1" >> $config_h | |
1147 | fi | |
ec530c81 FB |
1148 | if test "$solaris" = "yes" ; then |
1149 | echo "CONFIG_SOLARIS=yes" >> $config_mak | |
38cfa06c | 1150 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
0475a5ca TS |
1151 | if test "$needs_libsunmath" = "yes" ; then |
1152 | echo "NEEDS_LIBSUNMATH=yes" >> $config_mak | |
1153 | echo "#define NEEDS_LIBSUNMATH 1" >> $config_h | |
1154 | fi | |
ec530c81 | 1155 | fi |
3142255c BS |
1156 | if test -n "$sparc_cpu"; then |
1157 | echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak | |
1158 | echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h | |
1159 | fi | |
67b915a5 FB |
1160 | if test "$gdbstub" = "yes" ; then |
1161 | echo "CONFIG_GDBSTUB=yes" >> $config_mak | |
1162 | echo "#define CONFIG_GDBSTUB 1" >> $config_h | |
1163 | fi | |
97a847bc FB |
1164 | if test "$gprof" = "yes" ; then |
1165 | echo "TARGET_GPROF=yes" >> $config_mak | |
1166 | echo "#define HAVE_GPROF 1" >> $config_h | |
1167 | fi | |
1168 | if test "$static" = "yes" ; then | |
1169 | echo "CONFIG_STATIC=yes" >> $config_mak | |
50863472 | 1170 | echo "#define CONFIG_STATIC 1" >> $config_h |
7d13299d | 1171 | fi |
05c2a3e7 FB |
1172 | if test $profiler = "yes" ; then |
1173 | echo "#define CONFIG_PROFILER 1" >> $config_h | |
1174 | fi | |
c20709aa FB |
1175 | if test "$slirp" = "yes" ; then |
1176 | echo "CONFIG_SLIRP=yes" >> $config_mak | |
1177 | echo "#define CONFIG_SLIRP 1" >> $config_h | |
1178 | fi | |
8a16d273 TS |
1179 | if test "$vde" = "yes" ; then |
1180 | echo "CONFIG_VDE=yes" >> $config_mak | |
1181 | echo "#define CONFIG_VDE 1" >> $config_h | |
1182 | echo "VDE_LIBS=-lvdeplug" >> $config_mak | |
1183 | fi | |
0c58ac1c | 1184 | for card in $audio_card_list; do |
f6e5889e | 1185 | def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` |
0c58ac1c | 1186 | echo "$def=yes" >> $config_mak |
1187 | echo "#define $def 1" >> $config_h | |
1188 | done | |
1189 | echo "#define AUDIO_DRIVERS \\" >> $config_h | |
1190 | for drv in $audio_drv_list; do | |
1191 | echo " &${drv}_audio_driver, \\" >>$config_h | |
f6e5889e | 1192 | def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` |
0c58ac1c | 1193 | echo "$def=yes" >> $config_mak |
923e4521 | 1194 | if test "$drv" = "fmod"; then |
0c58ac1c | 1195 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
1196 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak | |
2f6a1ab0 BS |
1197 | elif test "$drv" = "oss"; then |
1198 | echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak | |
0c58ac1c | 1199 | fi |
1200 | done | |
1201 | echo "" >>$config_h | |
8ff9cbf7 | 1202 | if test "$mixemu" = "yes" ; then |
1203 | echo "CONFIG_MIXEMU=yes" >> $config_mak | |
1204 | echo "#define CONFIG_MIXEMU 1" >> $config_h | |
1205 | fi | |
8d5d2d4c TS |
1206 | if test "$vnc_tls" = "yes" ; then |
1207 | echo "CONFIG_VNC_TLS=yes" >> $config_mak | |
1208 | echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak | |
1209 | echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak | |
1210 | echo "#define CONFIG_VNC_TLS 1" >> $config_h | |
1211 | fi | |
b1a550a0 PB |
1212 | qemu_version=`head $source_path/VERSION` |
1213 | echo "VERSION=$qemu_version" >>$config_mak | |
d4b8f039 | 1214 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
97a847bc FB |
1215 | |
1216 | echo "SRC_PATH=$source_path" >> $config_mak | |
ad064840 PB |
1217 | if [ "$source_path_used" = "yes" ]; then |
1218 | echo "VPATH=$source_path" >> $config_mak | |
1219 | fi | |
97a847bc | 1220 | echo "TARGET_DIRS=$target_list" >> $config_mak |
cc8ae6de PB |
1221 | if [ "$build_docs" = "yes" ] ; then |
1222 | echo "BUILD_DOCS=yes" >> $config_mak | |
1223 | fi | |
49ecc3fa FB |
1224 | if test "$static" = "yes"; then |
1225 | sdl1=$sdl_static | |
1226 | else | |
1227 | sdl1=$sdl | |
1228 | fi | |
1229 | if test "$sdl1" = "yes" ; then | |
1230 | echo "#define CONFIG_SDL 1" >> $config_h | |
1231 | echo "CONFIG_SDL=yes" >> $config_mak | |
1232 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then | |
1233 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak | |
1234 | else | |
1235 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak | |
1236 | fi | |
1237 | if [ "${aa}" = "yes" ] ; then | |
1238 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak | |
1239 | else | |
1240 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak | |
1241 | fi | |
1242 | fi | |
1243 | if test "$cocoa" = "yes" ; then | |
4d3b6f6e AZ |
1244 | echo "#define CONFIG_COCOA 1" >> $config_h |
1245 | echo "CONFIG_COCOA=yes" >> $config_mak | |
1246 | fi | |
1247 | if test "$curses" = "yes" ; then | |
1248 | echo "#define CONFIG_CURSES 1" >> $config_h | |
1249 | echo "CONFIG_CURSES=yes" >> $config_mak | |
1250 | echo "CURSES_LIBS=-lcurses" >> $config_mak | |
49ecc3fa | 1251 | fi |
2e4d9fb1 AJ |
1252 | if test "$brlapi" = "yes" ; then |
1253 | echo "CONFIG_BRLAPI=yes" >> $config_mak | |
1254 | echo "#define CONFIG_BRLAPI 1" >> $config_h | |
1255 | echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak | |
1256 | fi | |
414f0dab BS |
1257 | if test "$aio" = "yes" ; then |
1258 | echo "#define CONFIG_AIO 1" >> $config_h | |
a3392f9b | 1259 | echo "CONFIG_AIO=yes" >> $config_mak |
414f0dab | 1260 | fi |
27463101 AL |
1261 | if test "$signalfd" = "yes" ; then |
1262 | echo "#define CONFIG_signalfd 1" >> $config_h | |
1263 | fi | |
1264 | if test "$eventfd" = "yes" ; then | |
1265 | echo "#define CONFIG_eventfd 1" >> $config_h | |
1266 | fi | |
97a847bc | 1267 | |
83fb7adf | 1268 | # XXX: suppress that |
7d3505c5 | 1269 | if [ "$bsd" = "yes" ] ; then |
43003046 | 1270 | echo "#define O_LARGEFILE 0" >> $config_h |
43003046 | 1271 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
7d3505c5 FB |
1272 | echo "#define _BSD 1" >> $config_h |
1273 | fi | |
1274 | ||
c5937220 PB |
1275 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
1276 | ||
c39e3338 PB |
1277 | tools= |
1278 | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then | |
1279 | tools="qemu-img\$(EXESUF) $tools" | |
7a5ca864 FB |
1280 | if [ "$linux" = "yes" ] ; then |
1281 | tools="qemu-nbd\$(EXESUF) $tools" | |
1282 | fi | |
c39e3338 PB |
1283 | fi |
1284 | echo "TOOLS=$tools" >> $config_mak | |
1285 | ||
15d9ca0f TS |
1286 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
1287 | ||
1d14ffa9 | 1288 | for target in $target_list; do |
97a847bc FB |
1289 | target_dir="$target" |
1290 | config_mak=$target_dir/config.mak | |
1291 | config_h=$target_dir/config.h | |
1292 | target_cpu=`echo $target | cut -d '-' -f 1` | |
1293 | target_bigendian="no" | |
808c4954 | 1294 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
0938cda5 AJ |
1295 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
1296 | [ "$target_cpu" = "mips" ] && target_bigendian=yes | |
1297 | [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes | |
1298 | [ "$target_cpu" = "mips64" ] && target_bigendian=yes | |
67867308 | 1299 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
d4082e95 | 1300 | [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes |
22f8a8b3 | 1301 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
e85e7c6e | 1302 | [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes |
908f52b0 | 1303 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
0938cda5 AJ |
1304 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
1305 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes | |
1306 | [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes | |
97a847bc | 1307 | target_softmmu="no" |
997344f3 | 1308 | target_user_only="no" |
831b7825 | 1309 | target_linux_user="no" |
831b7825 | 1310 | target_darwin_user="no" |
9e407a85 PB |
1311 | case "$target" in |
1312 | ${target_cpu}-softmmu) | |
1313 | target_softmmu="yes" | |
1314 | ;; | |
1315 | ${target_cpu}-linux-user) | |
1316 | target_user_only="yes" | |
1317 | target_linux_user="yes" | |
1318 | ;; | |
1319 | ${target_cpu}-darwin-user) | |
1320 | target_user_only="yes" | |
1321 | target_darwin_user="yes" | |
1322 | ;; | |
1323 | *) | |
1324 | echo "ERROR: Target '$target' not recognised" | |
1325 | exit 1 | |
1326 | ;; | |
1327 | esac | |
831b7825 | 1328 | |
97ccc689 | 1329 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
1d14ffa9 | 1330 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
97ccc689 | 1331 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
9c038506 | 1332 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
4d3b6f6e AZ |
1333 | echo "Note that this will disable all output from the virtual graphics card" |
1334 | echo "except through VNC or curses." | |
97ccc689 FB |
1335 | exit 1; |
1336 | fi | |
1337 | ||
7c1f25b4 | 1338 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
97a847bc | 1339 | |
15d9ca0f TS |
1340 | test -f $config_h && mv $config_h ${config_h}~ |
1341 | ||
97a847bc | 1342 | mkdir -p $target_dir |
158142c2 | 1343 | mkdir -p $target_dir/fpu |
57fec1fe | 1344 | mkdir -p $target_dir/tcg |
831b7825 | 1345 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then |
69de927c FB |
1346 | mkdir -p $target_dir/nwfpe |
1347 | fi | |
1348 | ||
ec530c81 FB |
1349 | # |
1350 | # don't use ln -sf as not all "ln -sf" over write the file/link | |
1351 | # | |
1352 | rm -f $target_dir/Makefile | |
1353 | ln -s $source_path/Makefile.target $target_dir/Makefile | |
1354 | ||
97a847bc FB |
1355 | |
1356 | echo "# Automatically generated by configure - do not modify" > $config_mak | |
1357 | echo "/* Automatically generated by configure - do not modify */" > $config_h | |
1358 | ||
de83cd02 | 1359 | |
97a847bc FB |
1360 | echo "include ../config-host.mak" >> $config_mak |
1361 | echo "#include \"../config-host.h\"" >> $config_h | |
1e43adfc | 1362 | |
e5fe0c52 | 1363 | bflt="no" |
cb33da57 | 1364 | elfload32="no" |
bd0c5661 | 1365 | target_nptl="no" |
1e43adfc FB |
1366 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
1367 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h | |
97a847bc | 1368 | |
2408a527 AJ |
1369 | case "$target_cpu" in |
1370 | i386) | |
1371 | echo "TARGET_ARCH=i386" >> $config_mak | |
1372 | echo "#define TARGET_ARCH \"i386\"" >> $config_h | |
1373 | echo "#define TARGET_I386 1" >> $config_h | |
da260249 | 1374 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" |
2408a527 AJ |
1375 | then |
1376 | echo "#define USE_KQEMU 1" >> $config_h | |
1377 | fi | |
f2bf094e | 1378 | gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.` |
11d1fdb0 | 1379 | if test -n "$gcc3minver" && test $gcc3minver -gt 3 |
f2bf094e AJ |
1380 | then |
1381 | echo "HAVE_GT_GCC_3_3=true" >> $config_mak | |
1382 | else | |
1383 | echo "HAVE_GT_GCC_3_3=false" >> $config_mak | |
1384 | fi | |
2408a527 AJ |
1385 | ;; |
1386 | x86_64) | |
1387 | echo "TARGET_ARCH=x86_64" >> $config_mak | |
1388 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h | |
1389 | echo "#define TARGET_I386 1" >> $config_h | |
1390 | echo "#define TARGET_X86_64 1" >> $config_h | |
1391 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" | |
1392 | then | |
1393 | echo "#define USE_KQEMU 1" >> $config_h | |
1394 | fi | |
1395 | ;; | |
1396 | alpha) | |
1397 | echo "TARGET_ARCH=alpha" >> $config_mak | |
bf6247fb | 1398 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
2408a527 AJ |
1399 | echo "#define TARGET_ARCH \"alpha\"" >> $config_h |
1400 | echo "#define TARGET_ALPHA 1" >> $config_h | |
bf6247fb | 1401 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
2408a527 AJ |
1402 | ;; |
1403 | arm|armeb) | |
1404 | echo "TARGET_ARCH=arm" >> $config_mak | |
2408a527 AJ |
1405 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
1406 | echo "#define TARGET_ARM 1" >> $config_h | |
2408a527 | 1407 | bflt="yes" |
bd0c5661 | 1408 | target_nptl="yes" |
2408a527 AJ |
1409 | ;; |
1410 | cris) | |
1411 | echo "TARGET_ARCH=cris" >> $config_mak | |
1412 | echo "#define TARGET_ARCH \"cris\"" >> $config_h | |
1413 | echo "#define TARGET_CRIS 1" >> $config_h | |
2408a527 AJ |
1414 | ;; |
1415 | m68k) | |
1416 | echo "TARGET_ARCH=m68k" >> $config_mak | |
1417 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h | |
1418 | echo "#define TARGET_M68K 1" >> $config_h | |
1419 | bflt="yes" | |
1420 | ;; | |
1421 | mips|mipsel) | |
1422 | echo "TARGET_ARCH=mips" >> $config_mak | |
1423 | echo "#define TARGET_ARCH \"mips\"" >> $config_h | |
1424 | echo "#define TARGET_MIPS 1" >> $config_h | |
1425 | echo "#define TARGET_ABI_MIPSO32 1" >> $config_h | |
1426 | ;; | |
1427 | mipsn32|mipsn32el) | |
1428 | echo "TARGET_ARCH=mipsn32" >> $config_mak | |
1429 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h | |
1430 | echo "#define TARGET_MIPS 1" >> $config_h | |
1431 | echo "#define TARGET_ABI_MIPSN32 1" >> $config_h | |
1432 | ;; | |
1433 | mips64|mips64el) | |
1434 | echo "TARGET_ARCH=mips64" >> $config_mak | |
1435 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h | |
1436 | echo "#define TARGET_MIPS 1" >> $config_h | |
1437 | echo "#define TARGET_MIPS64 1" >> $config_h | |
1438 | echo "#define TARGET_ABI_MIPSN64 1" >> $config_h | |
1439 | ;; | |
1440 | ppc) | |
1441 | echo "TARGET_ARCH=ppc" >> $config_mak | |
bf6247fb | 1442 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
2408a527 AJ |
1443 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
1444 | echo "#define TARGET_PPC 1" >> $config_h | |
bf6247fb | 1445 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
2408a527 AJ |
1446 | ;; |
1447 | ppcemb) | |
1448 | echo "TARGET_ARCH=ppcemb" >> $config_mak | |
1449 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
bf6247fb | 1450 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
2408a527 AJ |
1451 | echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h |
1452 | echo "#define TARGET_PPC 1" >> $config_h | |
1453 | echo "#define TARGET_PPCEMB 1" >> $config_h | |
ec5b78cd | 1454 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
2408a527 AJ |
1455 | ;; |
1456 | ppc64) | |
1457 | echo "TARGET_ARCH=ppc64" >> $config_mak | |
1458 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
bf6247fb | 1459 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
2408a527 AJ |
1460 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
1461 | echo "#define TARGET_PPC 1" >> $config_h | |
1462 | echo "#define TARGET_PPC64 1" >> $config_h | |
bf6247fb | 1463 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
2408a527 AJ |
1464 | ;; |
1465 | ppc64abi32) | |
1466 | echo "TARGET_ARCH=ppc64" >> $config_mak | |
1467 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
1468 | echo "TARGET_ARCH2=ppc64abi32" >> $config_mak | |
bf6247fb | 1469 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
2408a527 AJ |
1470 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
1471 | echo "#define TARGET_PPC 1" >> $config_h | |
1472 | echo "#define TARGET_PPC64 1" >> $config_h | |
1473 | echo "#define TARGET_ABI32 1" >> $config_h | |
bf6247fb | 1474 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
2408a527 AJ |
1475 | ;; |
1476 | sh4|sh4eb) | |
1477 | echo "TARGET_ARCH=sh4" >> $config_mak | |
1478 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h | |
1479 | echo "#define TARGET_SH4 1" >> $config_h | |
1480 | bflt="yes" | |
0b6d3ae0 | 1481 | target_nptl="yes" |
2408a527 AJ |
1482 | ;; |
1483 | sparc) | |
1484 | echo "TARGET_ARCH=sparc" >> $config_mak | |
1485 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h | |
1486 | echo "#define TARGET_SPARC 1" >> $config_h | |
1487 | ;; | |
1488 | sparc64) | |
1489 | echo "TARGET_ARCH=sparc64" >> $config_mak | |
1490 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h | |
1491 | echo "#define TARGET_SPARC 1" >> $config_h | |
1492 | echo "#define TARGET_SPARC64 1" >> $config_h | |
1493 | elfload32="yes" | |
1494 | ;; | |
1495 | sparc32plus) | |
1496 | echo "TARGET_ARCH=sparc64" >> $config_mak | |
1497 | echo "TARGET_ABI_DIR=sparc" >> $config_mak | |
1498 | echo "TARGET_ARCH2=sparc32plus" >> $config_mak | |
1499 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h | |
1500 | echo "#define TARGET_SPARC 1" >> $config_h | |
1501 | echo "#define TARGET_SPARC64 1" >> $config_h | |
1502 | echo "#define TARGET_ABI32 1" >> $config_h | |
1503 | ;; | |
1504 | *) | |
1505 | echo "Unsupported target CPU" | |
1506 | exit 1 | |
1507 | ;; | |
1508 | esac | |
de83cd02 | 1509 | if test "$target_bigendian" = "yes" ; then |
97a847bc FB |
1510 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
1511 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h | |
de83cd02 | 1512 | fi |
97a847bc FB |
1513 | if test "$target_softmmu" = "yes" ; then |
1514 | echo "CONFIG_SOFTMMU=yes" >> $config_mak | |
1515 | echo "#define CONFIG_SOFTMMU 1" >> $config_h | |
43ce4dfe | 1516 | fi |
997344f3 FB |
1517 | if test "$target_user_only" = "yes" ; then |
1518 | echo "CONFIG_USER_ONLY=yes" >> $config_mak | |
1519 | echo "#define CONFIG_USER_ONLY 1" >> $config_h | |
1520 | fi | |
831b7825 TS |
1521 | if test "$target_linux_user" = "yes" ; then |
1522 | echo "CONFIG_LINUX_USER=yes" >> $config_mak | |
1523 | echo "#define CONFIG_LINUX_USER 1" >> $config_h | |
1524 | fi | |
1525 | if test "$target_darwin_user" = "yes" ; then | |
1526 | echo "CONFIG_DARWIN_USER=yes" >> $config_mak | |
1527 | echo "#define CONFIG_DARWIN_USER 1" >> $config_h | |
1528 | fi | |
97a847bc | 1529 | |
0938cda5 AJ |
1530 | if test "$target_cpu" = "arm" \ |
1531 | -o "$target_cpu" = "armeb" \ | |
1532 | -o "$target_cpu" = "m68k" \ | |
1533 | -o "$target_cpu" = "mips" \ | |
1534 | -o "$target_cpu" = "mipsel" \ | |
1535 | -o "$target_cpu" = "mipsn32" \ | |
1536 | -o "$target_cpu" = "mipsn32el" \ | |
1537 | -o "$target_cpu" = "mips64" \ | |
1538 | -o "$target_cpu" = "mips64el" \ | |
1539 | -o "$target_cpu" = "sparc" \ | |
1540 | -o "$target_cpu" = "sparc64" \ | |
1541 | -o "$target_cpu" = "sparc32plus"; then | |
158142c2 FB |
1542 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
1543 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h | |
1544 | fi | |
e5fe0c52 PB |
1545 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
1546 | echo "TARGET_HAS_BFLT=yes" >> $config_mak | |
1547 | echo "#define TARGET_HAS_BFLT 1" >> $config_h | |
1548 | fi | |
bd0c5661 PB |
1549 | if test "$target_user_only" = "yes" \ |
1550 | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then | |
1551 | echo "#define USE_NPTL 1" >> $config_h | |
1552 | fi | |
cb33da57 BS |
1553 | # 32 bit ELF loader in addition to native 64 bit loader? |
1554 | if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then | |
1555 | echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak | |
1556 | echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h | |
1557 | fi | |
5b0753e0 | 1558 | |
15d9ca0f TS |
1559 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
1560 | ||
97a847bc | 1561 | done # for target in $targets |
7d13299d FB |
1562 | |
1563 | # build tree in object directory if source path is different from current one | |
1564 | if test "$source_path_used" = "yes" ; then | |
49ecc3fa | 1565 | DIRS="tests tests/cris slirp audio" |
7d13299d | 1566 | FILES="Makefile tests/Makefile" |
e7daa605 | 1567 | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
e1ffb0f1 | 1568 | FILES="$FILES tests/test-mmap.c" |
7d13299d FB |
1569 | for dir in $DIRS ; do |
1570 | mkdir -p $dir | |
1571 | done | |
ec530c81 | 1572 | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
7d13299d | 1573 | for f in $FILES ; do |
ec530c81 FB |
1574 | rm -f $f |
1575 | ln -s $source_path/$f $f | |
7d13299d FB |
1576 | done |
1577 | fi | |
7d13299d | 1578 | |
97a847bc | 1579 | rm -f $TMPO $TMPC $TMPE $TMPS |