]>
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" | |
9d56d2dc | 18 | TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i" |
d4742de8 | 19 | TMPSDLLOG="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log" |
7d13299d | 20 | |
d4742de8 | 21 | trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15 |
9ac81bbb | 22 | |
7d13299d | 23 | # default parameters |
11d9f695 | 24 | prefix="" |
1e43adfc | 25 | interp_prefix="/usr/gnemul/qemu-%M" |
43ce4dfe | 26 | static="no" |
7d13299d FB |
27 | cross_prefix="" |
28 | cc="gcc" | |
0c58ac1c | 29 | audio_drv_list="" |
4c9b53e3 | 30 | audio_card_list="ac97 es1370 sb16" |
31 | audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus" | |
7d13299d FB |
32 | host_cc="gcc" |
33 | ar="ar" | |
34 | make="make" | |
6a882643 | 35 | install="install" |
7d13299d | 36 | strip="strip" |
ac0df51d AL |
37 | |
38 | # parse CC options first | |
39 | for opt do | |
40 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | |
41 | case "$opt" in | |
42 | --cross-prefix=*) cross_prefix="$optarg" | |
43 | ;; | |
44 | --cc=*) cc="$optarg" | |
45 | ;; | |
46 | esac | |
47 | done | |
48 | ||
49 | # OS specific | |
50 | # Using uname is really, really broken. Once we have the right set of checks | |
51 | # we can eliminate it's usage altogether | |
52 | ||
53 | cc="${cross_prefix}${cc}" | |
54 | ar="${cross_prefix}${ar}" | |
55 | strip="${cross_prefix}${strip}" | |
56 | ||
57 | # check that the C compiler works. | |
58 | cat > $TMPC <<EOF | |
59 | int main(void) {} | |
60 | EOF | |
61 | ||
62 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then | |
63 | : C compiler works ok | |
64 | else | |
65 | echo "ERROR: \"$cc\" either does not exist or does not work" | |
66 | exit 1 | |
67 | fi | |
68 | ||
69 | check_define() { | |
70 | cat > $TMPC <<EOF | |
71 | #if !defined($1) | |
72 | #error Not defined | |
73 | #endif | |
74 | int main(void) { return 0; } | |
75 | EOF | |
76 | $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null | |
77 | } | |
78 | ||
79 | if check_define __i386__ ; then | |
80 | cpu="i386" | |
81 | elif check_define __x86_64__ ; then | |
82 | cpu="x86_64" | |
3aa9bd6c BS |
83 | elif check_define __sparc__ ; then |
84 | # We can't check for 64 bit (when gcc is biarch) or V8PLUSA | |
85 | # They must be specified using --sparc_cpu | |
86 | if check_define __arch64__ ; then | |
87 | cpu="sparc64" | |
88 | else | |
89 | cpu="sparc" | |
90 | fi | |
fdf7ed96 | 91 | elif check_define _ARCH_PPC ; then |
92 | if check_define _ARCH_PPC64 ; then | |
93 | cpu="ppc64" | |
94 | else | |
95 | cpu="ppc" | |
96 | fi | |
ac0df51d | 97 | else |
fdf7ed96 | 98 | cpu=`uname -m` |
ac0df51d AL |
99 | fi |
100 | ||
5327cf48 | 101 | target_list="" |
7d13299d FB |
102 | case "$cpu" in |
103 | i386|i486|i586|i686|i86pc|BePC) | |
97a847bc | 104 | cpu="i386" |
7d13299d | 105 | ;; |
aaa5fa14 AJ |
106 | x86_64|amd64) |
107 | cpu="x86_64" | |
108 | ;; | |
109 | alpha) | |
110 | cpu="alpha" | |
111 | ;; | |
ba68055e | 112 | armv*b) |
808c4954 FB |
113 | cpu="armv4b" |
114 | ;; | |
ba68055e | 115 | armv*l) |
7d13299d FB |
116 | cpu="armv4l" |
117 | ;; | |
aaa5fa14 AJ |
118 | cris) |
119 | cpu="cris" | |
7d13299d | 120 | ;; |
f54b3f92 AJ |
121 | parisc|parisc64) |
122 | cpu="hppa" | |
123 | ;; | |
aaa5fa14 AJ |
124 | ia64) |
125 | cpu="ia64" | |
126 | ;; | |
127 | m68k) | |
128 | cpu="m68k" | |
7d13299d FB |
129 | ;; |
130 | mips) | |
131 | cpu="mips" | |
132 | ;; | |
fbe4f65b TS |
133 | mips64) |
134 | cpu="mips64" | |
135 | ;; | |
fdf7ed96 | 136 | ppc) |
137 | cpu="ppc" | |
138 | ;; | |
139 | ppc64) | |
140 | cpu="ppc64" | |
e7daa605 | 141 | ;; |
0e7b8a9f | 142 | s390*) |
fb3e5849 FB |
143 | cpu="s390" |
144 | ;; | |
3142255c | 145 | sparc|sun4[cdmuv]) |
ae228531 FB |
146 | cpu="sparc" |
147 | ;; | |
148 | sparc64) | |
149 | cpu="sparc64" | |
150 | ;; | |
7d13299d FB |
151 | *) |
152 | cpu="unknown" | |
153 | ;; | |
154 | esac | |
155 | gprof="no" | |
03b4fe7d | 156 | sparse="no" |
1625af87 | 157 | strip_opt="yes" |
7d13299d | 158 | bigendian="no" |
67b915a5 FB |
159 | mingw32="no" |
160 | EXESUF="" | |
161 | gdbstub="yes" | |
443f1376 | 162 | slirp="yes" |
e0e6c8c0 | 163 | vde="yes" |
102a52e4 FB |
164 | fmod_lib="" |
165 | fmod_inc="" | |
2f6a1ab0 | 166 | oss_lib="" |
8d5d2d4c | 167 | vnc_tls="yes" |
2f9606b3 | 168 | vnc_sasl="yes" |
b1a550a0 | 169 | bsd="no" |
5327cf48 | 170 | linux="no" |
d2c7c9b8 | 171 | solaris="no" |
c9ec1fe4 | 172 | kqemu="no" |
05c2a3e7 | 173 | profiler="no" |
5b0753e0 | 174 | cocoa="no" |
97ccc689 | 175 | check_gfx="yes" |
0a8e90f4 | 176 | softmmu="yes" |
831b7825 TS |
177 | linux_user="no" |
178 | darwin_user="no" | |
84778508 | 179 | bsd_user="no" |
cc8ae6de | 180 | build_docs="no" |
c5937220 | 181 | uname_release="" |
4d3b6f6e | 182 | curses="yes" |
414f0dab | 183 | aio="yes" |
bd0c5661 | 184 | nptl="yes" |
8ff9cbf7 | 185 | mixemu="no" |
fb599c9a | 186 | bluez="yes" |
7ba1e619 | 187 | kvm="yes" |
eac30262 | 188 | kerneldir="" |
b29fe3ed | 189 | aix="no" |
77755340 | 190 | blobs="yes" |
f652e6af | 191 | fdt="yes" |
5368a422 | 192 | sdl_x11="no" |
4a19f1ec | 193 | pkgversion="" |
7d13299d FB |
194 | |
195 | # OS specific | |
ac0df51d AL |
196 | if check_define __linux__ ; then |
197 | targetos="Linux" | |
198 | elif check_define _WIN32 ; then | |
199 | targetos='MINGW32' | |
200 | else | |
201 | targetos=`uname -s` | |
202 | fi | |
7d13299d | 203 | case $targetos in |
c326e0af FB |
204 | CYGWIN*) |
205 | mingw32="yes" | |
6f30fa85 | 206 | OS_CFLAGS="-mno-cygwin" |
db8d7dd1 TS |
207 | if [ "$cpu" = "i386" ] ; then |
208 | kqemu="yes" | |
209 | fi | |
c2de5c91 | 210 | audio_possible_drivers="sdl" |
c326e0af | 211 | ;; |
67b915a5 FB |
212 | MINGW32*) |
213 | mingw32="yes" | |
db8d7dd1 TS |
214 | if [ "$cpu" = "i386" ] ; then |
215 | kqemu="yes" | |
216 | fi | |
c2de5c91 | 217 | audio_possible_drivers="dsound sdl fmod" |
67b915a5 | 218 | ;; |
5c40d2bd | 219 | GNU/kFreeBSD) |
0c58ac1c | 220 | audio_drv_list="oss" |
f34af52c | 221 | audio_possible_drivers="oss sdl esd pa" |
5c40d2bd TS |
222 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
223 | kqemu="yes" | |
224 | fi | |
225 | ;; | |
7d3505c5 FB |
226 | FreeBSD) |
227 | bsd="yes" | |
0c58ac1c | 228 | audio_drv_list="oss" |
f34af52c | 229 | audio_possible_drivers="oss sdl esd pa" |
e99f9060 | 230 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
07f4ddbf FB |
231 | kqemu="yes" |
232 | fi | |
7d3505c5 | 233 | ;; |
c5e97233 BS |
234 | DragonFly) |
235 | bsd="yes" | |
236 | audio_drv_list="oss" | |
237 | audio_possible_drivers="oss sdl esd pa" | |
238 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then | |
239 | kqemu="yes" | |
240 | fi | |
241 | aio="no" | |
242 | ;; | |
7d3505c5 FB |
243 | NetBSD) |
244 | bsd="yes" | |
0c58ac1c | 245 | audio_drv_list="oss" |
c2de5c91 | 246 | audio_possible_drivers="oss sdl esd" |
8ef92a88 | 247 | oss_lib="-lossaudio" |
7d3505c5 FB |
248 | ;; |
249 | OpenBSD) | |
250 | bsd="yes" | |
128ab2ff | 251 | openbsd="yes" |
0c58ac1c | 252 | audio_drv_list="oss" |
c2de5c91 | 253 | audio_possible_drivers="oss sdl esd" |
2f6a1ab0 | 254 | oss_lib="-lossaudio" |
7d3505c5 | 255 | ;; |
83fb7adf FB |
256 | Darwin) |
257 | bsd="yes" | |
258 | darwin="yes" | |
1b0f9cc2 | 259 | # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code |
aab8588a | 260 | if [ "$cpu" = "i386" ] ; then |
261 | is_x86_64=`sysctl -n hw.optional.x86_64` | |
262 | [ "$is_x86_64" = "1" ] && cpu=x86_64 | |
1b0f9cc2 AL |
263 | fi |
264 | if [ "$cpu" = "x86_64" ] ; then | |
265 | OS_CFLAGS="-arch x86_64" | |
266 | LDFLAGS="-arch x86_64" | |
267 | else | |
268 | OS_CFLAGS="-mdynamic-no-pic" | |
269 | fi | |
831b7825 | 270 | darwin_user="yes" |
fd677642 | 271 | cocoa="yes" |
0c58ac1c | 272 | audio_drv_list="coreaudio" |
c2de5c91 | 273 | audio_possible_drivers="coreaudio sdl fmod" |
c2c59c3e | 274 | OS_LDFLAGS="-framework CoreFoundation -framework IOKit" |
83fb7adf | 275 | ;; |
ec530c81 | 276 | SunOS) |
c2b84fab TS |
277 | solaris="yes" |
278 | make="gmake" | |
279 | install="ginstall" | |
0475a5ca | 280 | needs_libsunmath="no" |
acda94b1 | 281 | kvm="no" |
c2b84fab | 282 | solarisrev=`uname -r | cut -f2 -d.` |
ef18c883 TS |
283 | # have to select again, because `uname -m` returns i86pc |
284 | # even on an x86_64 box. | |
285 | solariscpu=`isainfo -k` | |
286 | if test "${solariscpu}" = "amd64" ; then | |
287 | cpu="x86_64" | |
288 | fi | |
c2b84fab | 289 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
0475a5ca TS |
290 | if test "$solarisrev" -le 9 ; then |
291 | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then | |
292 | needs_libsunmath="yes" | |
293 | else | |
294 | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" | |
295 | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" | |
296 | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" | |
297 | echo "Studio 11 can be downloaded from www.sun.com." | |
298 | exit 1 | |
299 | fi | |
300 | fi | |
301 | if test "$solarisrev" -ge 9 ; then | |
c2b84fab TS |
302 | kqemu="yes" |
303 | fi | |
86b2bd93 | 304 | fi |
6b4d2ba1 | 305 | if test -f /usr/include/sys/soundcard.h ; then |
0c58ac1c | 306 | audio_drv_list="oss" |
6b4d2ba1 | 307 | fi |
c2de5c91 | 308 | audio_possible_drivers="oss sdl" |
86b2bd93 | 309 | ;; |
b29fe3ed | 310 | AIX) |
311 | aix="yes" | |
312 | make="gmake" | |
313 | ;; | |
1d14ffa9 | 314 | *) |
0c58ac1c | 315 | audio_drv_list="oss" |
b8e59f18 | 316 | audio_possible_drivers="oss alsa sdl esd pa" |
5327cf48 | 317 | linux="yes" |
831b7825 | 318 | linux_user="yes" |
68063649 | 319 | usb="linux" |
07f4ddbf | 320 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
c9ec1fe4 | 321 | kqemu="yes" |
c2de5c91 | 322 | audio_possible_drivers="$audio_possible_drivers fmod" |
c9ec1fe4 | 323 | fi |
fb065187 | 324 | ;; |
7d13299d FB |
325 | esac |
326 | ||
7d3505c5 | 327 | if [ "$bsd" = "yes" ] ; then |
b1a550a0 | 328 | if [ "$darwin" != "yes" ] ; then |
83fb7adf | 329 | make="gmake" |
68063649 | 330 | usb="bsd" |
83fb7adf | 331 | fi |
84778508 | 332 | bsd_user="yes" |
7d3505c5 FB |
333 | fi |
334 | ||
7d13299d | 335 | # find source path |
ad064840 | 336 | source_path=`dirname "$0"` |
59faef3a AZ |
337 | source_path_used="no" |
338 | workdir=`pwd` | |
ad064840 | 339 | if [ -z "$source_path" ]; then |
59faef3a | 340 | source_path=$workdir |
ad064840 PB |
341 | else |
342 | source_path=`cd "$source_path"; pwd` | |
7d13299d | 343 | fi |
724db118 | 344 | [ -f "$workdir/vl.c" ] || source_path_used="yes" |
7d13299d | 345 | |
85aa5189 | 346 | werror="no" |
0d1e2394 FB |
347 | # generate compile errors on warnings for development builds |
348 | #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then | |
349 | #werror="yes"; | |
350 | #fi | |
85aa5189 | 351 | |
7d13299d | 352 | for opt do |
a46e4035 | 353 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
7d13299d | 354 | case "$opt" in |
2efc3265 FB |
355 | --help|-h) show_help=yes |
356 | ;; | |
b1a550a0 | 357 | --prefix=*) prefix="$optarg" |
7d13299d | 358 | ;; |
b1a550a0 | 359 | --interp-prefix=*) interp_prefix="$optarg" |
32ce6337 | 360 | ;; |
b1a550a0 | 361 | --source-path=*) source_path="$optarg" |
ad064840 | 362 | source_path_used="yes" |
7d13299d | 363 | ;; |
ac0df51d | 364 | --cross-prefix=*) |
7d13299d | 365 | ;; |
ac0df51d | 366 | --cc=*) |
7d13299d | 367 | ;; |
b1a550a0 | 368 | --host-cc=*) host_cc="$optarg" |
83469015 | 369 | ;; |
b1a550a0 | 370 | --make=*) make="$optarg" |
7d13299d | 371 | ;; |
6a882643 PB |
372 | --install=*) install="$optarg" |
373 | ;; | |
b1a550a0 | 374 | --extra-cflags=*) CFLAGS="$optarg" |
7d13299d | 375 | ;; |
b1a550a0 | 376 | --extra-ldflags=*) LDFLAGS="$optarg" |
7d13299d | 377 | ;; |
b1a550a0 | 378 | --cpu=*) cpu="$optarg" |
7d13299d | 379 | ;; |
b1a550a0 | 380 | --target-list=*) target_list="$optarg" |
de83cd02 | 381 | ;; |
7d13299d FB |
382 | --enable-gprof) gprof="yes" |
383 | ;; | |
43ce4dfe FB |
384 | --static) static="yes" |
385 | ;; | |
97a847bc FB |
386 | --disable-sdl) sdl="no" |
387 | ;; | |
0c58ac1c | 388 | --fmod-lib=*) fmod_lib="$optarg" |
1d14ffa9 | 389 | ;; |
c2de5c91 | 390 | --fmod-inc=*) fmod_inc="$optarg" |
391 | ;; | |
2f6a1ab0 BS |
392 | --oss-lib=*) oss_lib="$optarg" |
393 | ;; | |
2fa7d3bf | 394 | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
102a52e4 | 395 | ;; |
0c58ac1c | 396 | --audio-drv-list=*) audio_drv_list="$optarg" |
102a52e4 | 397 | ;; |
03b4fe7d AL |
398 | --enable-sparse) sparse="yes" |
399 | ;; | |
400 | --disable-sparse) sparse="no" | |
401 | ;; | |
1625af87 AL |
402 | --disable-strip) strip_opt="no" |
403 | ;; | |
8d5d2d4c TS |
404 | --disable-vnc-tls) vnc_tls="no" |
405 | ;; | |
2f9606b3 AL |
406 | --disable-vnc-sasl) vnc_sasl="no" |
407 | ;; | |
443f1376 | 408 | --disable-slirp) slirp="no" |
1d14ffa9 | 409 | ;; |
e0e6c8c0 | 410 | --disable-vde) vde="no" |
8a16d273 | 411 | ;; |
c9ec1fe4 | 412 | --disable-kqemu) kqemu="no" |
1d14ffa9 | 413 | ;; |
2e4d9fb1 AJ |
414 | --disable-brlapi) brlapi="no" |
415 | ;; | |
fb599c9a AZ |
416 | --disable-bluez) bluez="no" |
417 | ;; | |
7ba1e619 AL |
418 | --disable-kvm) kvm="no" |
419 | ;; | |
05c2a3e7 FB |
420 | --enable-profiler) profiler="yes" |
421 | ;; | |
c2de5c91 | 422 | --enable-cocoa) |
423 | cocoa="yes" ; | |
424 | sdl="no" ; | |
425 | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" | |
1d14ffa9 | 426 | ;; |
97ccc689 FB |
427 | --disable-gfx-check) check_gfx="no" |
428 | ;; | |
cad25d69 | 429 | --disable-system) softmmu="no" |
0a8e90f4 | 430 | ;; |
cad25d69 | 431 | --enable-system) softmmu="yes" |
0a8e90f4 | 432 | ;; |
831b7825 | 433 | --disable-linux-user) linux_user="no" |
0a8e90f4 | 434 | ;; |
831b7825 TS |
435 | --enable-linux-user) linux_user="yes" |
436 | ;; | |
437 | --disable-darwin-user) darwin_user="no" | |
438 | ;; | |
439 | --enable-darwin-user) darwin_user="yes" | |
0a8e90f4 | 440 | ;; |
84778508 BS |
441 | --disable-bsd-user) bsd_user="no" |
442 | ;; | |
443 | --enable-bsd-user) bsd_user="yes" | |
444 | ;; | |
c5937220 PB |
445 | --enable-uname-release=*) uname_release="$optarg" |
446 | ;; | |
3142255c BS |
447 | --sparc_cpu=*) |
448 | sparc_cpu="$optarg" | |
449 | case $sparc_cpu in | |
450 | v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" | |
451 | target_cpu="sparc"; cpu="sparc" ;; | |
452 | v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" | |
453 | target_cpu="sparc"; cpu="sparc" ;; | |
454 | v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64" | |
455 | target_cpu="sparc64"; cpu="sparc64" ;; | |
456 | *) echo "undefined SPARC architecture. Exiting";exit 1;; | |
457 | esac | |
458 | ;; | |
85aa5189 FB |
459 | --enable-werror) werror="yes" |
460 | ;; | |
461 | --disable-werror) werror="no" | |
462 | ;; | |
4d3b6f6e AZ |
463 | --disable-curses) curses="no" |
464 | ;; | |
bd0c5661 PB |
465 | --disable-nptl) nptl="no" |
466 | ;; | |
8ff9cbf7 | 467 | --enable-mixemu) mixemu="yes" |
468 | ;; | |
414f0dab BS |
469 | --disable-aio) aio="no" |
470 | ;; | |
77755340 TS |
471 | --disable-blobs) blobs="no" |
472 | ;; | |
eac30262 AL |
473 | --kerneldir=*) kerneldir="$optarg" |
474 | ;; | |
4a19f1ec PB |
475 | --with-pkgversion=*) pkgversion=" ($optarg)" |
476 | ;; | |
7f1559c6 AZ |
477 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
478 | ;; | |
7d13299d FB |
479 | esac |
480 | done | |
481 | ||
6f30fa85 | 482 | # default flags for all hosts |
ac41a620 | 483 | CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing" |
e0e36fe9 | 484 | CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls" |
6f30fa85 | 485 | LDFLAGS="$LDFLAGS -g" |
85aa5189 FB |
486 | if test "$werror" = "yes" ; then |
487 | CFLAGS="$CFLAGS -Werror" | |
488 | fi | |
6f30fa85 | 489 | |
d2c7c9b8 BS |
490 | if test "$solaris" = "no" ; then |
491 | if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then | |
492 | LDFLAGS="$LDFLAGS -Wl,--warn-common" | |
493 | fi | |
49237acd BS |
494 | fi |
495 | ||
3142255c BS |
496 | # |
497 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right | |
498 | # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) | |
499 | # | |
40293e58 | 500 | case "$cpu" in |
3142255c BS |
501 | sparc) if test -z "$sparc_cpu" ; then |
502 | ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__" | |
503 | ARCH_LDFLAGS="-m32" | |
504 | else | |
505 | ARCH_CFLAGS="${SP_CFLAGS}" | |
506 | ARCH_LDFLAGS="${SP_LDFLAGS}" | |
507 | fi | |
762e8230 BS |
508 | ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3" |
509 | if test "$solaris" = "no" ; then | |
510 | ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6" | |
511 | fi | |
3142255c BS |
512 | ;; |
513 | sparc64) if test -z "$sparc_cpu" ; then | |
514 | ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__" | |
515 | ARCH_LDFLAGS="-m64" | |
516 | else | |
517 | ARCH_CFLAGS="${SP_CFLAGS}" | |
518 | ARCH_LDFLAGS="${SP_LDFLAGS}" | |
519 | fi | |
762e8230 BS |
520 | if test "$solaris" = "no" ; then |
521 | ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7" | |
522 | else | |
523 | ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7" | |
524 | fi | |
3142255c | 525 | ;; |
76d83bde TS |
526 | s390) |
527 | ARCH_CFLAGS="-march=z900" | |
528 | ;; | |
40293e58 FB |
529 | i386) |
530 | ARCH_CFLAGS="-m32" | |
531 | ARCH_LDFLAGS="-m32" | |
532 | ;; | |
533 | x86_64) | |
534 | ARCH_CFLAGS="-m64" | |
535 | ARCH_LDFLAGS="-m64" | |
536 | ;; | |
3142255c BS |
537 | esac |
538 | ||
af5db58e PB |
539 | if test x"$show_help" = x"yes" ; then |
540 | cat << EOF | |
541 | ||
542 | Usage: configure [options] | |
543 | Options: [defaults in brackets after descriptions] | |
544 | ||
545 | EOF | |
546 | echo "Standard options:" | |
547 | echo " --help print this message" | |
548 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
549 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." | |
550 | echo " use %M for cpu name [$interp_prefix]" | |
551 | echo " --target-list=LIST set target list [$target_list]" | |
552 | echo "" | |
553 | echo "kqemu kernel acceleration support:" | |
554 | echo " --disable-kqemu disable kqemu support" | |
af5db58e PB |
555 | echo "" |
556 | echo "Advanced options (experts only):" | |
557 | echo " --source-path=PATH path of source code [$source_path]" | |
558 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
559 | echo " --cc=CC use C compiler CC [$cc]" | |
560 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." | |
2981fa96 AJ |
561 | echo " --extra-cflags=CFLAGS add C compiler flags CFLAGS" |
562 | echo " --extra-ldflags=LDFLAGS add linker flags LDFLAGS" | |
af5db58e | 563 | echo " --make=MAKE use specified make [$make]" |
6a882643 | 564 | echo " --install=INSTALL use specified install [$install]" |
af5db58e | 565 | echo " --static enable static build [$static]" |
890b1658 AL |
566 | echo " --enable-sparse enable sparse checker" |
567 | echo " --disable-sparse disable sparse checker (default)" | |
1625af87 | 568 | echo " --disable-strip disable stripping binaries" |
85aa5189 | 569 | echo " --disable-werror disable compilation abort on warning" |
fe8f78e4 | 570 | echo " --disable-sdl disable SDL" |
af5db58e | 571 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
c2de5c91 | 572 | echo " --audio-drv-list=LIST set audio drivers list:" |
573 | echo " Available drivers: $audio_possible_drivers" | |
4c9b53e3 | 574 | echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" |
575 | echo " Available cards: $audio_possible_cards" | |
8ff9cbf7 | 576 | echo " --enable-mixemu enable mixer emulation" |
2e4d9fb1 | 577 | echo " --disable-brlapi disable BrlAPI" |
8d5d2d4c | 578 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
2f9606b3 | 579 | echo " --disable-vnc-sasl disable SASL encryption for VNC server" |
af896aaa | 580 | echo " --disable-curses disable curses output" |
fb599c9a | 581 | echo " --disable-bluez disable bluez stack connectivity" |
7ba1e619 | 582 | echo " --disable-kvm disable KVM acceleration support" |
bd0c5661 | 583 | echo " --disable-nptl disable usermode NPTL support" |
af5db58e PB |
584 | echo " --enable-system enable all system emulation targets" |
585 | echo " --disable-system disable all system emulation targets" | |
831b7825 TS |
586 | echo " --enable-linux-user enable all linux usermode emulation targets" |
587 | echo " --disable-linux-user disable all linux usermode emulation targets" | |
588 | echo " --enable-darwin-user enable all darwin usermode emulation targets" | |
589 | echo " --disable-darwin-user disable all darwin usermode emulation targets" | |
84778508 BS |
590 | echo " --enable-bsd-user enable all BSD usermode emulation targets" |
591 | echo " --disable-bsd-user disable all BSD usermode emulation targets" | |
af5db58e PB |
592 | echo " --fmod-lib path to FMOD library" |
593 | echo " --fmod-inc path to FMOD includes" | |
2f6a1ab0 | 594 | echo " --oss-lib path to OSS library" |
c5937220 | 595 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
3142255c | 596 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
e0e6c8c0 | 597 | echo " --disable-vde disable support for vde network" |
414f0dab | 598 | echo " --disable-aio disable AIO support" |
77755340 | 599 | echo " --disable-blobs disable installing provided firmware blobs" |
eac30262 | 600 | echo " --kerneldir=PATH look for kernel includes in PATH" |
af5db58e | 601 | echo "" |
5bf08934 | 602 | echo "NOTE: The object files are built at the place where configure is launched" |
af5db58e PB |
603 | exit 1 |
604 | fi | |
605 | ||
67b915a5 | 606 | if test "$mingw32" = "yes" ; then |
5327cf48 | 607 | linux="no" |
67b915a5 | 608 | EXESUF=".exe" |
9f059eca | 609 | oss="no" |
cd01b4a3 | 610 | linux_user="no" |
84778508 | 611 | bsd_user="no" |
49dc768d | 612 | OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501" |
cd01b4a3 AL |
613 | fi |
614 | ||
03b4fe7d AL |
615 | if test ! -x "$(which cgcc 2>/dev/null)"; then |
616 | sparse="no" | |
617 | fi | |
618 | ||
ec530c81 FB |
619 | # |
620 | # Solaris specific configure tool chain decisions | |
621 | # | |
622 | if test "$solaris" = "yes" ; then | |
ec530c81 FB |
623 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
624 | if test -z "$solinst" ; then | |
625 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" | |
626 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" | |
627 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" | |
628 | exit 1 | |
629 | fi | |
630 | if test "$solinst" = "/usr/sbin/install" ; then | |
631 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." | |
632 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" | |
633 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" | |
634 | exit 1 | |
635 | fi | |
ec530c81 FB |
636 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
637 | if test -z "$sol_ar" ; then | |
638 | echo "Error: No path includes ar" | |
639 | if test -f /usr/ccs/bin/ar ; then | |
640 | echo "Add /usr/ccs/bin to your path and rerun configure" | |
641 | fi | |
642 | exit 1 | |
643 | fi | |
5fafdf24 | 644 | fi |
ec530c81 FB |
645 | |
646 | ||
5327cf48 FB |
647 | if test -z "$target_list" ; then |
648 | # these targets are portable | |
0a8e90f4 | 649 | if [ "$softmmu" = "yes" ] ; then |
2408a527 AJ |
650 | target_list="\ |
651 | i386-softmmu \ | |
652 | x86_64-softmmu \ | |
653 | arm-softmmu \ | |
654 | cris-softmmu \ | |
655 | m68k-softmmu \ | |
656 | mips-softmmu \ | |
657 | mipsel-softmmu \ | |
658 | mips64-softmmu \ | |
659 | mips64el-softmmu \ | |
660 | ppc-softmmu \ | |
661 | ppcemb-softmmu \ | |
662 | ppc64-softmmu \ | |
663 | sh4-softmmu \ | |
664 | sh4eb-softmmu \ | |
665 | sparc-softmmu \ | |
666 | " | |
0a8e90f4 | 667 | fi |
5327cf48 | 668 | # the following are Linux specific |
831b7825 | 669 | if [ "$linux_user" = "yes" ] ; then |
2408a527 AJ |
670 | target_list="${target_list}\ |
671 | i386-linux-user \ | |
672 | x86_64-linux-user \ | |
673 | alpha-linux-user \ | |
674 | arm-linux-user \ | |
675 | armeb-linux-user \ | |
676 | cris-linux-user \ | |
677 | m68k-linux-user \ | |
678 | mips-linux-user \ | |
679 | mipsel-linux-user \ | |
680 | ppc-linux-user \ | |
681 | ppc64-linux-user \ | |
682 | ppc64abi32-linux-user \ | |
683 | sh4-linux-user \ | |
684 | sh4eb-linux-user \ | |
685 | sparc-linux-user \ | |
686 | sparc64-linux-user \ | |
687 | sparc32plus-linux-user \ | |
688 | " | |
831b7825 TS |
689 | fi |
690 | # the following are Darwin specific | |
691 | if [ "$darwin_user" = "yes" ] ; then | |
6cdc7375 | 692 | target_list="$target_list i386-darwin-user ppc-darwin-user " |
5327cf48 | 693 | fi |
84778508 BS |
694 | # the following are BSD specific |
695 | if [ "$bsd_user" = "yes" ] ; then | |
696 | target_list="${target_list}\ | |
31fc12df BS |
697 | i386-bsd-user \ |
698 | x86_64-bsd-user \ | |
699 | sparc-bsd-user \ | |
84778508 BS |
700 | sparc64-bsd-user \ |
701 | " | |
702 | fi | |
6e20a45f | 703 | else |
b1a550a0 | 704 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
5327cf48 | 705 | fi |
0a8e90f4 PB |
706 | if test -z "$target_list" ; then |
707 | echo "No targets enabled" | |
708 | exit 1 | |
709 | fi | |
5327cf48 | 710 | |
7d13299d FB |
711 | if test -z "$cross_prefix" ; then |
712 | ||
713 | # --- | |
714 | # big/little endian test | |
715 | cat > $TMPC << EOF | |
716 | #include <inttypes.h> | |
717 | int main(int argc, char ** argv){ | |
1d14ffa9 FB |
718 | volatile uint32_t i=0x01234567; |
719 | return (*((uint8_t*)(&i))) == 0x67; | |
7d13299d FB |
720 | } |
721 | EOF | |
722 | ||
178baee6 | 723 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then |
7d13299d FB |
724 | $TMPE && bigendian="yes" |
725 | else | |
726 | echo big/little test failed | |
727 | fi | |
728 | ||
729 | else | |
730 | ||
731 | # if cross compiling, cannot launch a program, so make a static guess | |
0938cda5 | 732 | if test "$cpu" = "armv4b" \ |
f54b3f92 | 733 | -o "$cpu" = "hppa" \ |
0938cda5 AJ |
734 | -o "$cpu" = "m68k" \ |
735 | -o "$cpu" = "mips" \ | |
736 | -o "$cpu" = "mips64" \ | |
fdf7ed96 | 737 | -o "$cpu" = "ppc" \ |
738 | -o "$cpu" = "ppc64" \ | |
0938cda5 AJ |
739 | -o "$cpu" = "s390" \ |
740 | -o "$cpu" = "sparc" \ | |
741 | -o "$cpu" = "sparc64"; then | |
7d13299d FB |
742 | bigendian="yes" |
743 | fi | |
744 | ||
745 | fi | |
746 | ||
b6853697 FB |
747 | # host long bits test |
748 | hostlongbits="32" | |
0938cda5 AJ |
749 | if test "$cpu" = "x86_64" \ |
750 | -o "$cpu" = "alpha" \ | |
751 | -o "$cpu" = "ia64" \ | |
fdf7ed96 | 752 | -o "$cpu" = "sparc64" \ |
753 | -o "$cpu" = "ppc64"; then | |
b6853697 FB |
754 | hostlongbits="64" |
755 | fi | |
756 | ||
bd0c5661 PB |
757 | # Check host NPTL support |
758 | cat > $TMPC <<EOF | |
759 | #include <sched.h> | |
30813cea | 760 | #include <linux/futex.h> |
bd0c5661 PB |
761 | void foo() |
762 | { | |
763 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) | |
764 | #error bork | |
765 | #endif | |
766 | } | |
767 | EOF | |
768 | ||
8c7f7574 | 769 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then |
bd0c5661 PB |
770 | : |
771 | else | |
772 | nptl="no" | |
773 | fi | |
774 | ||
ac62922e AZ |
775 | ########################################## |
776 | # zlib check | |
777 | ||
778 | cat > $TMPC << EOF | |
779 | #include <zlib.h> | |
780 | int main(void) { zlibVersion(); return 0; } | |
781 | EOF | |
8c7f7574 | 782 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then |
ac62922e AZ |
783 | : |
784 | else | |
785 | echo | |
786 | echo "Error: zlib check failed" | |
787 | echo "Make sure to have the zlib libs and headers installed." | |
788 | echo | |
789 | exit 1 | |
790 | fi | |
791 | ||
11d9f695 FB |
792 | ########################################## |
793 | # SDL probe | |
794 | ||
795 | sdl_too_old=no | |
796 | ||
797 | if test -z "$sdl" ; then | |
069b0bda TS |
798 | sdl_config="sdl-config" |
799 | sdl=no | |
800 | sdl_static=no | |
801 | ||
11d9f695 FB |
802 | cat > $TMPC << EOF |
803 | #include <SDL.h> | |
804 | #undef main /* We don't want SDL to override our main() */ | |
805 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
806 | EOF | |
8c7f7574 | 807 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then |
cd01b4a3 AL |
808 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` |
809 | if test "$_sdlversion" -lt 121 ; then | |
810 | sdl_too_old=yes | |
811 | else | |
812 | if test "$cocoa" = "no" ; then | |
813 | sdl=yes | |
069b0bda | 814 | fi |
cd01b4a3 | 815 | fi |
11d9f695 | 816 | |
cd01b4a3 AL |
817 | # static link with sdl ? |
818 | if test "$sdl" = "yes" ; then | |
819 | aa="no" | |
820 | `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes" | |
821 | sdl_static_libs=`$sdl_config --static-libs 2>/dev/null` | |
822 | if [ "$aa" = "yes" ] ; then | |
823 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" | |
824 | fi | |
825 | ||
8c7f7574 | 826 | if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then |
cd01b4a3 AL |
827 | sdl_static=yes |
828 | fi | |
829 | fi # static link | |
830 | fi # sdl compile test | |
fd677642 | 831 | else |
069b0bda TS |
832 | # Make sure to disable cocoa if sdl was set |
833 | if test "$sdl" = "yes" ; then | |
834 | cocoa="no" | |
c2de5c91 | 835 | audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`" |
069b0bda | 836 | fi |
a6e022ad | 837 | fi # -z $sdl |
11d9f695 | 838 | |
5368a422 AL |
839 | if test "$sdl" = "yes" ; then |
840 | cat > $TMPC <<EOF | |
841 | #include <SDL.h> | |
842 | #if defined(SDL_VIDEO_DRIVER_X11) | |
843 | #include <X11/XKBlib.h> | |
844 | #else | |
845 | #error No x11 support | |
846 | #endif | |
847 | int main(void) { return 0; } | |
848 | EOF | |
849 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then | |
850 | sdl_x11="yes" | |
851 | fi | |
852 | fi | |
853 | ||
8d5d2d4c TS |
854 | ########################################## |
855 | # VNC TLS detection | |
856 | if test "$vnc_tls" = "yes" ; then | |
ae6b5e5a AL |
857 | cat > $TMPC <<EOF |
858 | #include <gnutls/gnutls.h> | |
859 | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } | |
860 | EOF | |
861 | vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null` | |
862 | vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null` | |
863 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \ | |
8c7f7574 | 864 | $vnc_tls_libs > /dev/null 2> /dev/null ; then |
ae6b5e5a AL |
865 | : |
866 | else | |
867 | vnc_tls="no" | |
868 | fi | |
8d5d2d4c TS |
869 | fi |
870 | ||
2f9606b3 AL |
871 | ########################################## |
872 | # VNC SASL detection | |
873 | if test "$vnc_sasl" = "yes" ; then | |
874 | cat > $TMPC <<EOF | |
875 | #include <sasl/sasl.h> | |
876 | #include <stdio.h> | |
877 | int main(void) { sasl_server_init(NULL, "qemu"); return 0; } | |
878 | EOF | |
879 | # Assuming Cyrus-SASL installed in /usr prefix | |
880 | vnc_sasl_cflags="" | |
881 | vnc_sasl_libs="-lsasl2" | |
882 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \ | |
883 | $vnc_sasl_libs 2> /dev/null ; then | |
884 | : | |
885 | else | |
886 | vnc_sasl="no" | |
887 | fi | |
888 | fi | |
889 | ||
76655d6d AL |
890 | ########################################## |
891 | # fnmatch() probe, used for ACL routines | |
892 | fnmatch="no" | |
893 | cat > $TMPC << EOF | |
894 | #include <fnmatch.h> | |
895 | int main(void) | |
896 | { | |
897 | fnmatch("foo", "foo", 0); | |
898 | return 0; | |
899 | } | |
900 | EOF | |
901 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then | |
902 | fnmatch="yes" | |
903 | fi | |
904 | ||
8a16d273 TS |
905 | ########################################## |
906 | # vde libraries probe | |
907 | if test "$vde" = "yes" ; then | |
908 | cat > $TMPC << EOF | |
909 | #include <libvdeplug.h> | |
4a7f0e06 PB |
910 | int main(void) |
911 | { | |
912 | struct vde_open_args a = {0, 0, 0}; | |
913 | vde_open("", "", &a); | |
914 | return 0; | |
915 | } | |
8a16d273 | 916 | EOF |
8c7f7574 | 917 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then |
8a16d273 TS |
918 | : |
919 | else | |
e0e6c8c0 | 920 | vde="no" |
8a16d273 TS |
921 | fi |
922 | fi | |
923 | ||
8f28f3fb | 924 | ########################################## |
c2de5c91 | 925 | # Sound support libraries probe |
8f28f3fb | 926 | |
c2de5c91 | 927 | audio_drv_probe() |
928 | { | |
929 | drv=$1 | |
930 | hdr=$2 | |
931 | lib=$3 | |
932 | exp=$4 | |
933 | cfl=$5 | |
934 | cat > $TMPC << EOF | |
935 | #include <$hdr> | |
936 | int main(void) { $exp } | |
8f28f3fb | 937 | EOF |
8c7f7574 | 938 | if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then |
c2de5c91 | 939 | : |
940 | else | |
941 | echo | |
942 | echo "Error: $drv check failed" | |
943 | echo "Make sure to have the $drv libs and headers installed." | |
944 | echo | |
945 | exit 1 | |
946 | fi | |
947 | } | |
948 | ||
2fa7d3bf | 949 | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
c2de5c91 | 950 | for drv in $audio_drv_list; do |
951 | case $drv in | |
952 | alsa) | |
953 | audio_drv_probe $drv alsa/asoundlib.h -lasound \ | |
954 | "snd_pcm_t **handle; return snd_pcm_close(*handle);" | |
955 | ;; | |
956 | ||
957 | fmod) | |
958 | if test -z $fmod_lib || test -z $fmod_inc; then | |
959 | echo | |
960 | echo "Error: You must specify path to FMOD library and headers" | |
961 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
962 | echo | |
963 | exit 1 | |
964 | fi | |
965 | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" | |
966 | ;; | |
967 | ||
968 | esd) | |
969 | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' | |
970 | ;; | |
b8e59f18 | 971 | |
972 | pa) | |
973 | audio_drv_probe $drv pulse/simple.h -lpulse-simple \ | |
974 | "pa_simple *s = NULL; pa_simple_free(s); return 0;" | |
975 | ;; | |
976 | ||
2f6a1ab0 BS |
977 | oss|sdl|core|wav|dsound) |
978 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) | |
979 | ;; | |
980 | ||
e4c63a6a | 981 | *) |
1c9b2a52 | 982 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
e4c63a6a | 983 | echo |
984 | echo "Error: Unknown driver '$drv' selected" | |
985 | echo "Possible drivers are: $audio_possible_drivers" | |
986 | echo | |
987 | exit 1 | |
988 | } | |
989 | ;; | |
c2de5c91 | 990 | esac |
991 | done | |
8f28f3fb | 992 | |
2e4d9fb1 AJ |
993 | ########################################## |
994 | # BrlAPI probe | |
995 | ||
996 | if test -z "$brlapi" ; then | |
997 | brlapi=no | |
998 | cat > $TMPC << EOF | |
999 | #include <brlapi.h> | |
1000 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } | |
1001 | EOF | |
178baee6 | 1002 | if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then |
2e4d9fb1 AJ |
1003 | brlapi=yes |
1004 | fi # brlapi compile test | |
1005 | fi # -z $brlapi | |
1006 | ||
4d3b6f6e AZ |
1007 | ########################################## |
1008 | # curses probe | |
1009 | ||
1010 | if test "$curses" = "yes" ; then | |
1011 | curses=no | |
1012 | cat > $TMPC << EOF | |
1013 | #include <curses.h> | |
5a8ff3aa BS |
1014 | #ifdef __OpenBSD__ |
1015 | #define resize_term resizeterm | |
1016 | #endif | |
1017 | int main(void) { resize_term(0, 0); return curses_version(); } | |
4d3b6f6e | 1018 | EOF |
178baee6 | 1019 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then |
4d3b6f6e AZ |
1020 | curses=yes |
1021 | fi | |
1022 | fi # test "$curses" | |
1023 | ||
fb599c9a AZ |
1024 | ########################################## |
1025 | # bluez support probe | |
1026 | if test "$bluez" = "yes" ; then | |
1027 | `pkg-config bluez` || bluez="no" | |
1028 | fi | |
1029 | if test "$bluez" = "yes" ; then | |
e820e3f4 AZ |
1030 | cat > $TMPC << EOF |
1031 | #include <bluetooth/bluetooth.h> | |
1032 | int main(void) { return bt_error(0); } | |
1033 | EOF | |
fb599c9a AZ |
1034 | bluez_cflags=`pkg-config --cflags bluez` |
1035 | bluez_libs=`pkg-config --libs bluez` | |
17e1592d | 1036 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \ |
8c7f7574 | 1037 | $bluez_libs > /dev/null 2> /dev/null ; then |
e820e3f4 AZ |
1038 | : |
1039 | else | |
1040 | bluez="no" | |
1041 | fi | |
fb599c9a AZ |
1042 | fi |
1043 | ||
7ba1e619 AL |
1044 | ########################################## |
1045 | # kvm probe | |
1046 | if test "$kvm" = "yes" ; then | |
1047 | cat > $TMPC <<EOF | |
1048 | #include <linux/kvm.h> | |
9fd8d8d7 | 1049 | #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12 |
7ba1e619 AL |
1050 | #error Invalid KVM version |
1051 | #endif | |
9fd8d8d7 AL |
1052 | #if !defined(KVM_CAP_USER_MEMORY) |
1053 | #error Missing KVM capability KVM_CAP_USER_MEMORY | |
1054 | #endif | |
1055 | #if !defined(KVM_CAP_SET_TSS_ADDR) | |
1056 | #error Missing KVM capability KVM_CAP_SET_TSS_ADDR | |
1057 | #endif | |
1058 | #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) | |
1059 | #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS | |
1060 | #endif | |
7ba1e619 AL |
1061 | int main(void) { return 0; } |
1062 | EOF | |
eac30262 AL |
1063 | if test "$kerneldir" != "" ; then |
1064 | kvm_cflags=-I"$kerneldir"/include | |
8444eb6e AL |
1065 | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \ |
1066 | -a -d "$kerneldir/arch/x86/include" ; then | |
1067 | kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include" | |
406b430d AL |
1068 | elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then |
1069 | kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include" | |
8444eb6e AL |
1070 | elif test -d "$kerneldir/arch/$cpu/include" ; then |
1071 | kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include" | |
1072 | fi | |
eac30262 AL |
1073 | else |
1074 | kvm_cflags="" | |
1075 | fi | |
7ba1e619 | 1076 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \ |
8c7f7574 | 1077 | > /dev/null 2>/dev/null ; then |
7ba1e619 AL |
1078 | : |
1079 | else | |
9fd8d8d7 AL |
1080 | kvm="no"; |
1081 | if [ -x "`which awk 2>/dev/null`" ] && \ | |
1082 | [ -x "`which grep 2>/dev/null`" ]; then | |
e4f5100c | 1083 | kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \ |
9fd8d8d7 AL |
1084 | | grep "error: " \ |
1085 | | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'` | |
1086 | if test "$kvmerr" != "" ; then | |
1087 | kvm="no - (${kvmerr})" | |
1088 | fi | |
1089 | fi | |
7ba1e619 AL |
1090 | fi |
1091 | fi | |
1092 | ||
414f0dab BS |
1093 | ########################################## |
1094 | # AIO probe | |
3c529d93 AL |
1095 | AIOLIBS="" |
1096 | ||
414f0dab BS |
1097 | if test "$aio" = "yes" ; then |
1098 | aio=no | |
1099 | cat > $TMPC << EOF | |
3c529d93 | 1100 | #include <pthread.h> |
c9db92fc | 1101 | int main(void) { pthread_mutex_t lock; return 0; } |
414f0dab BS |
1102 | EOF |
1103 | if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then | |
1104 | aio=yes | |
3c529d93 | 1105 | AIOLIBS="-lpthread" |
414f0dab BS |
1106 | fi |
1107 | fi | |
1108 | ||
bf9298b9 AL |
1109 | ########################################## |
1110 | # iovec probe | |
1111 | cat > $TMPC <<EOF | |
db34f0b3 | 1112 | #include <sys/types.h> |
bf9298b9 | 1113 | #include <sys/uio.h> |
db34f0b3 | 1114 | #include <unistd.h> |
bf9298b9 AL |
1115 | int main(void) { struct iovec iov; return 0; } |
1116 | EOF | |
1117 | iovec=no | |
8c7f7574 | 1118 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then |
bf9298b9 AL |
1119 | iovec=yes |
1120 | fi | |
1121 | ||
ceb42de8 AL |
1122 | ########################################## |
1123 | # preadv probe | |
1124 | cat > $TMPC <<EOF | |
1125 | #include <sys/types.h> | |
1126 | #include <sys/uio.h> | |
1127 | #include <unistd.h> | |
1128 | int main(void) { preadv; } | |
1129 | EOF | |
1130 | preadv=no | |
1131 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then | |
1132 | preadv=yes | |
1133 | fi | |
1134 | ||
f652e6af AJ |
1135 | ########################################## |
1136 | # fdt probe | |
1137 | if test "$fdt" = "yes" ; then | |
1138 | fdt=no | |
1139 | cat > $TMPC << EOF | |
1140 | int main(void) { return 0; } | |
1141 | EOF | |
1142 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then | |
1143 | fdt=yes | |
1144 | fi | |
1145 | fi | |
1146 | ||
cc8ae6de | 1147 | # Check if tools are available to build documentation. |
6c591867 TS |
1148 | if [ -x "`which texi2html 2>/dev/null`" ] && \ |
1149 | [ -x "`which pod2man 2>/dev/null`" ]; then | |
cc8ae6de PB |
1150 | build_docs="yes" |
1151 | fi | |
1152 | ||
da93a1fd AL |
1153 | ########################################## |
1154 | # Do we need librt | |
1155 | cat > $TMPC <<EOF | |
1156 | #include <signal.h> | |
1157 | #include <time.h> | |
1158 | int main(void) { clockid_t id; return clock_gettime(id, NULL); } | |
1159 | EOF | |
1160 | ||
1161 | rt=no | |
8c7f7574 | 1162 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then |
da93a1fd | 1163 | : |
8c7f7574 | 1164 | elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then |
da93a1fd AL |
1165 | rt=yes |
1166 | fi | |
1167 | ||
1168 | if test "$rt" = "yes" ; then | |
1169 | # Hack, we should have a general purpose LIBS for this sort of thing | |
1170 | AIOLIBS="$AIOLIBS -lrt" | |
1171 | fi | |
1172 | ||
11d9f695 | 1173 | if test "$mingw32" = "yes" ; then |
308c3593 | 1174 | if test -z "$prefix" ; then |
17e90973 | 1175 | prefix="c:\\\\Program Files\\\\Qemu" |
308c3593 PB |
1176 | fi |
1177 | mansuffix="" | |
1178 | datasuffix="" | |
1179 | docsuffix="" | |
1180 | binsuffix="" | |
11d9f695 | 1181 | else |
308c3593 PB |
1182 | if test -z "$prefix" ; then |
1183 | prefix="/usr/local" | |
1184 | fi | |
1185 | mansuffix="/share/man" | |
1186 | datasuffix="/share/qemu" | |
1187 | docsuffix="/share/doc/qemu" | |
1188 | binsuffix="/bin" | |
11d9f695 | 1189 | fi |
5a67135a | 1190 | |
43ce4dfe | 1191 | echo "Install prefix $prefix" |
308c3593 PB |
1192 | echo "BIOS directory $prefix$datasuffix" |
1193 | echo "binary directory $prefix$binsuffix" | |
11d9f695 | 1194 | if test "$mingw32" = "no" ; then |
308c3593 | 1195 | echo "Manual directory $prefix$mansuffix" |
43ce4dfe | 1196 | echo "ELF interp prefix $interp_prefix" |
11d9f695 | 1197 | fi |
5a67135a | 1198 | echo "Source path $source_path" |
43ce4dfe | 1199 | echo "C compiler $cc" |
83469015 | 1200 | echo "Host C compiler $host_cc" |
db7287ed | 1201 | echo "ARCH_CFLAGS $ARCH_CFLAGS" |
43ce4dfe | 1202 | echo "make $make" |
6a882643 | 1203 | echo "install $install" |
43ce4dfe | 1204 | echo "host CPU $cpu" |
de83cd02 | 1205 | echo "host big endian $bigendian" |
97a847bc | 1206 | echo "target list $target_list" |
43ce4dfe | 1207 | echo "gprof enabled $gprof" |
03b4fe7d | 1208 | echo "sparse enabled $sparse" |
1625af87 | 1209 | echo "strip binaries $strip_opt" |
05c2a3e7 | 1210 | echo "profiler $profiler" |
43ce4dfe | 1211 | echo "static build $static" |
85aa5189 | 1212 | echo "-Werror enabled $werror" |
5b0753e0 FB |
1213 | if test "$darwin" = "yes" ; then |
1214 | echo "Cocoa support $cocoa" | |
1215 | fi | |
97a847bc | 1216 | echo "SDL support $sdl" |
e4afee97 FB |
1217 | if test "$sdl" != "no" ; then |
1218 | echo "SDL static link $sdl_static" | |
1219 | fi | |
4d3b6f6e | 1220 | echo "curses support $curses" |
67b915a5 | 1221 | echo "mingw32 support $mingw32" |
0c58ac1c | 1222 | echo "Audio drivers $audio_drv_list" |
1223 | echo "Extra audio cards $audio_card_list" | |
8ff9cbf7 | 1224 | echo "Mixer emulation $mixemu" |
8d5d2d4c TS |
1225 | echo "VNC TLS support $vnc_tls" |
1226 | if test "$vnc_tls" = "yes" ; then | |
1227 | echo " TLS CFLAGS $vnc_tls_cflags" | |
1228 | echo " TLS LIBS $vnc_tls_libs" | |
1229 | fi | |
2f9606b3 AL |
1230 | echo "VNC SASL support $vnc_sasl" |
1231 | if test "$vnc_sasl" = "yes" ; then | |
1232 | echo " SASL CFLAGS $vnc_sasl_cflags" | |
1233 | echo " SASL LIBS $vnc_sasl_libs" | |
1234 | fi | |
3142255c BS |
1235 | if test -n "$sparc_cpu"; then |
1236 | echo "Target Sparc Arch $sparc_cpu" | |
1237 | fi | |
07f4ddbf | 1238 | echo "kqemu support $kqemu" |
2e4d9fb1 | 1239 | echo "brlapi support $brlapi" |
cc8ae6de | 1240 | echo "Documentation $build_docs" |
c5937220 PB |
1241 | [ ! -z "$uname_release" ] && \ |
1242 | echo "uname -r $uname_release" | |
bd0c5661 | 1243 | echo "NPTL support $nptl" |
8a16d273 | 1244 | echo "vde support $vde" |
414f0dab | 1245 | echo "AIO support $aio" |
77755340 | 1246 | echo "Install blobs $blobs" |
7ba1e619 | 1247 | echo "KVM support $kvm" |
f652e6af | 1248 | echo "fdt support $fdt" |
ceb42de8 | 1249 | echo "preadv support $preadv" |
67b915a5 | 1250 | |
97a847bc | 1251 | if test $sdl_too_old = "yes"; then |
24b55b96 | 1252 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
7c1f25b4 | 1253 | fi |
d4742de8 | 1254 | if [ -s $TMPSDLLOG ]; then |
20b40c6a | 1255 | echo "The error log from compiling the libSDL test is: " |
d4742de8 | 1256 | cat $TMPSDLLOG |
20b40c6a | 1257 | fi |
24b55b96 FB |
1258 | #if test "$sdl_static" = "no"; then |
1259 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" | |
1260 | #fi | |
97a847bc FB |
1261 | config_mak="config-host.mak" |
1262 | config_h="config-host.h" | |
7d13299d | 1263 | |
7c1f25b4 | 1264 | #echo "Creating $config_mak and $config_h" |
7d13299d | 1265 | |
15d9ca0f TS |
1266 | test -f $config_h && mv $config_h ${config_h}~ |
1267 | ||
97a847bc | 1268 | echo "# Automatically generated by configure - do not modify" > $config_mak |
fc9902d9 | 1269 | printf "# Configured with:" >> $config_mak |
fd69fe2b | 1270 | printf " '%s'" "$0" "$@" >> $config_mak |
1271 | echo >> $config_mak | |
97a847bc | 1272 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
7d13299d | 1273 | |
97a847bc | 1274 | echo "prefix=$prefix" >> $config_mak |
308c3593 PB |
1275 | echo "bindir=\${prefix}$binsuffix" >> $config_mak |
1276 | echo "mandir=\${prefix}$mansuffix" >> $config_mak | |
1277 | echo "datadir=\${prefix}$datasuffix" >> $config_mak | |
4ad5b06d | 1278 | echo "docdir=\${prefix}$docsuffix" >> $config_mak |
308c3593 | 1279 | echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h |
97a847bc | 1280 | echo "MAKE=$make" >> $config_mak |
6a882643 | 1281 | echo "INSTALL=$install" >> $config_mak |
97a847bc | 1282 | echo "CC=$cc" >> $config_mak |
97a847bc FB |
1283 | echo "HOST_CC=$host_cc" >> $config_mak |
1284 | echo "AR=$ar" >> $config_mak | |
40293e58 FB |
1285 | # XXX: only use CFLAGS and LDFLAGS ? |
1286 | # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross | |
1287 | # compilation of dyngen tool (useful for win32 build on Linux host) | |
6f30fa85 | 1288 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
3142255c BS |
1289 | echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak |
1290 | echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak | |
1291 | echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak | |
97a847bc FB |
1292 | echo "CFLAGS=$CFLAGS" >> $config_mak |
1293 | echo "LDFLAGS=$LDFLAGS" >> $config_mak | |
67b915a5 | 1294 | echo "EXESUF=$EXESUF" >> $config_mak |
70956b77 | 1295 | echo "AIOLIBS=$AIOLIBS" >> $config_mak |
2408a527 AJ |
1296 | case "$cpu" in |
1297 | i386) | |
1298 | echo "ARCH=i386" >> $config_mak | |
1299 | echo "#define HOST_I386 1" >> $config_h | |
1300 | ;; | |
1301 | x86_64) | |
1302 | echo "ARCH=x86_64" >> $config_mak | |
1303 | echo "#define HOST_X86_64 1" >> $config_h | |
1304 | ;; | |
1305 | alpha) | |
1306 | echo "ARCH=alpha" >> $config_mak | |
1307 | echo "#define HOST_ALPHA 1" >> $config_h | |
1308 | ;; | |
1309 | armv4b) | |
1310 | echo "ARCH=arm" >> $config_mak | |
1311 | echo "#define HOST_ARM 1" >> $config_h | |
1312 | ;; | |
1313 | armv4l) | |
1314 | echo "ARCH=arm" >> $config_mak | |
1315 | echo "#define HOST_ARM 1" >> $config_h | |
1316 | ;; | |
1317 | cris) | |
1318 | echo "ARCH=cris" >> $config_mak | |
1319 | echo "#define HOST_CRIS 1" >> $config_h | |
1320 | ;; | |
1321 | hppa) | |
1322 | echo "ARCH=hppa" >> $config_mak | |
1323 | echo "#define HOST_HPPA 1" >> $config_h | |
1324 | ;; | |
1325 | ia64) | |
1326 | echo "ARCH=ia64" >> $config_mak | |
1327 | echo "#define HOST_IA64 1" >> $config_h | |
1328 | ;; | |
1329 | m68k) | |
1330 | echo "ARCH=m68k" >> $config_mak | |
1331 | echo "#define HOST_M68K 1" >> $config_h | |
1332 | ;; | |
1333 | mips) | |
1334 | echo "ARCH=mips" >> $config_mak | |
1335 | echo "#define HOST_MIPS 1" >> $config_h | |
1336 | ;; | |
1337 | mips64) | |
1338 | echo "ARCH=mips64" >> $config_mak | |
1339 | echo "#define HOST_MIPS64 1" >> $config_h | |
1340 | ;; | |
fdf7ed96 | 1341 | ppc) |
1342 | echo "ARCH=ppc" >> $config_mak | |
1343 | echo "#define HOST_PPC 1" >> $config_h | |
1344 | ;; | |
1345 | ppc64) | |
1346 | echo "ARCH=ppc64" >> $config_mak | |
1347 | echo "#define HOST_PPC64 1" >> $config_h | |
2408a527 AJ |
1348 | ;; |
1349 | s390) | |
1350 | echo "ARCH=s390" >> $config_mak | |
1351 | echo "#define HOST_S390 1" >> $config_h | |
1352 | ;; | |
1353 | sparc) | |
1354 | echo "ARCH=sparc" >> $config_mak | |
1355 | echo "#define HOST_SPARC 1" >> $config_h | |
1356 | ;; | |
1357 | sparc64) | |
1358 | echo "ARCH=sparc64" >> $config_mak | |
1359 | echo "#define HOST_SPARC64 1" >> $config_h | |
1360 | ;; | |
1361 | *) | |
1362 | echo "Unsupported CPU = $cpu" | |
1363 | exit 1 | |
1364 | ;; | |
1365 | esac | |
03b4fe7d AL |
1366 | if test "$sparse" = "yes" ; then |
1367 | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak | |
1368 | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak | |
1369 | echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak | |
1370 | fi | |
1625af87 AL |
1371 | if test "$strip_opt" = "yes" ; then |
1372 | echo "STRIP_OPT=-s" >> $config_mak | |
1373 | fi | |
7d13299d | 1374 | if test "$bigendian" = "yes" ; then |
97a847bc FB |
1375 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
1376 | echo "#define WORDS_BIGENDIAN 1" >> $config_h | |
1377 | fi | |
b6853697 | 1378 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
67b915a5 FB |
1379 | if test "$mingw32" = "yes" ; then |
1380 | echo "CONFIG_WIN32=yes" >> $config_mak | |
11d9f695 | 1381 | echo "#define CONFIG_WIN32 1" >> $config_h |
210fa556 PB |
1382 | else |
1383 | cat > $TMPC << EOF | |
1384 | #include <byteswap.h> | |
1385 | int main(void) { return bswap_32(0); } | |
1386 | EOF | |
178baee6 | 1387 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then |
210fa556 PB |
1388 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
1389 | fi | |
1360677c BS |
1390 | cat > $TMPC << EOF |
1391 | #include <sys/endian.h> | |
1392 | #include <sys/types.h> | |
1393 | #include <machine/bswap.h> | |
1394 | int main(void) { return bswap32(0); } | |
1395 | EOF | |
178baee6 | 1396 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then |
1360677c BS |
1397 | echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h |
1398 | fi | |
67b915a5 | 1399 | fi |
128ab2ff BS |
1400 | |
1401 | if [ "$openbsd" = "yes" ] ; then | |
1402 | echo "#define ENOTSUP 4096" >> $config_h | |
1403 | fi | |
1404 | ||
83fb7adf FB |
1405 | if test "$darwin" = "yes" ; then |
1406 | echo "CONFIG_DARWIN=yes" >> $config_mak | |
1407 | echo "#define CONFIG_DARWIN 1" >> $config_h | |
1408 | fi | |
b29fe3ed | 1409 | |
1410 | if test "$aix" = "yes" ; then | |
1411 | echo "CONFIG_AIX=yes" >> $config_mak | |
1412 | echo "#define CONFIG_AIX 1" >> $config_h | |
1413 | fi | |
1414 | ||
ec530c81 FB |
1415 | if test "$solaris" = "yes" ; then |
1416 | echo "CONFIG_SOLARIS=yes" >> $config_mak | |
38cfa06c | 1417 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
0475a5ca TS |
1418 | if test "$needs_libsunmath" = "yes" ; then |
1419 | echo "NEEDS_LIBSUNMATH=yes" >> $config_mak | |
1420 | echo "#define NEEDS_LIBSUNMATH 1" >> $config_h | |
1421 | fi | |
ec530c81 | 1422 | fi |
3142255c BS |
1423 | if test -n "$sparc_cpu"; then |
1424 | echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak | |
1425 | echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h | |
1426 | fi | |
67b915a5 FB |
1427 | if test "$gdbstub" = "yes" ; then |
1428 | echo "CONFIG_GDBSTUB=yes" >> $config_mak | |
1429 | echo "#define CONFIG_GDBSTUB 1" >> $config_h | |
1430 | fi | |
97a847bc FB |
1431 | if test "$gprof" = "yes" ; then |
1432 | echo "TARGET_GPROF=yes" >> $config_mak | |
1433 | echo "#define HAVE_GPROF 1" >> $config_h | |
1434 | fi | |
1435 | if test "$static" = "yes" ; then | |
1436 | echo "CONFIG_STATIC=yes" >> $config_mak | |
50863472 | 1437 | echo "#define CONFIG_STATIC 1" >> $config_h |
7d13299d | 1438 | fi |
05c2a3e7 FB |
1439 | if test $profiler = "yes" ; then |
1440 | echo "#define CONFIG_PROFILER 1" >> $config_h | |
1441 | fi | |
c20709aa FB |
1442 | if test "$slirp" = "yes" ; then |
1443 | echo "CONFIG_SLIRP=yes" >> $config_mak | |
1444 | echo "#define CONFIG_SLIRP 1" >> $config_h | |
1445 | fi | |
8a16d273 TS |
1446 | if test "$vde" = "yes" ; then |
1447 | echo "CONFIG_VDE=yes" >> $config_mak | |
1448 | echo "#define CONFIG_VDE 1" >> $config_h | |
1449 | echo "VDE_LIBS=-lvdeplug" >> $config_mak | |
1450 | fi | |
0c58ac1c | 1451 | for card in $audio_card_list; do |
f6e5889e | 1452 | def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` |
0c58ac1c | 1453 | echo "$def=yes" >> $config_mak |
1454 | echo "#define $def 1" >> $config_h | |
1455 | done | |
1456 | echo "#define AUDIO_DRIVERS \\" >> $config_h | |
1457 | for drv in $audio_drv_list; do | |
1458 | echo " &${drv}_audio_driver, \\" >>$config_h | |
f6e5889e | 1459 | def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` |
0c58ac1c | 1460 | echo "$def=yes" >> $config_mak |
923e4521 | 1461 | if test "$drv" = "fmod"; then |
0c58ac1c | 1462 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
1463 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak | |
2f6a1ab0 BS |
1464 | elif test "$drv" = "oss"; then |
1465 | echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak | |
0c58ac1c | 1466 | fi |
1467 | done | |
1468 | echo "" >>$config_h | |
8ff9cbf7 | 1469 | if test "$mixemu" = "yes" ; then |
1470 | echo "CONFIG_MIXEMU=yes" >> $config_mak | |
1471 | echo "#define CONFIG_MIXEMU 1" >> $config_h | |
1472 | fi | |
8d5d2d4c TS |
1473 | if test "$vnc_tls" = "yes" ; then |
1474 | echo "CONFIG_VNC_TLS=yes" >> $config_mak | |
1475 | echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak | |
1476 | echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak | |
1477 | echo "#define CONFIG_VNC_TLS 1" >> $config_h | |
1478 | fi | |
2f9606b3 AL |
1479 | if test "$vnc_sasl" = "yes" ; then |
1480 | echo "CONFIG_VNC_SASL=yes" >> $config_mak | |
1481 | echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak | |
1482 | echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak | |
1483 | echo "#define CONFIG_VNC_SASL 1" >> $config_h | |
1484 | fi | |
76655d6d AL |
1485 | if test "$fnmatch" = "yes" ; then |
1486 | echo "#define HAVE_FNMATCH_H 1" >> $config_h | |
1487 | fi | |
b1a550a0 PB |
1488 | qemu_version=`head $source_path/VERSION` |
1489 | echo "VERSION=$qemu_version" >>$config_mak | |
d4b8f039 | 1490 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
97a847bc | 1491 | |
4a19f1ec PB |
1492 | echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h |
1493 | ||
97a847bc | 1494 | echo "SRC_PATH=$source_path" >> $config_mak |
ad064840 PB |
1495 | if [ "$source_path_used" = "yes" ]; then |
1496 | echo "VPATH=$source_path" >> $config_mak | |
1497 | fi | |
97a847bc | 1498 | echo "TARGET_DIRS=$target_list" >> $config_mak |
cc8ae6de PB |
1499 | if [ "$build_docs" = "yes" ] ; then |
1500 | echo "BUILD_DOCS=yes" >> $config_mak | |
1501 | fi | |
49ecc3fa FB |
1502 | if test "$static" = "yes"; then |
1503 | sdl1=$sdl_static | |
1504 | else | |
1505 | sdl1=$sdl | |
1506 | fi | |
1507 | if test "$sdl1" = "yes" ; then | |
1508 | echo "#define CONFIG_SDL 1" >> $config_h | |
1509 | echo "CONFIG_SDL=yes" >> $config_mak | |
1510 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then | |
1511 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak | |
5368a422 AL |
1512 | elif test "$sdl_x11" = "yes" ; then |
1513 | echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak | |
49ecc3fa FB |
1514 | else |
1515 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak | |
1516 | fi | |
1517 | if [ "${aa}" = "yes" ] ; then | |
1518 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak | |
1519 | else | |
1520 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak | |
1521 | fi | |
1522 | fi | |
1523 | if test "$cocoa" = "yes" ; then | |
4d3b6f6e AZ |
1524 | echo "#define CONFIG_COCOA 1" >> $config_h |
1525 | echo "CONFIG_COCOA=yes" >> $config_mak | |
1526 | fi | |
1527 | if test "$curses" = "yes" ; then | |
1528 | echo "#define CONFIG_CURSES 1" >> $config_h | |
1529 | echo "CONFIG_CURSES=yes" >> $config_mak | |
1530 | echo "CURSES_LIBS=-lcurses" >> $config_mak | |
49ecc3fa | 1531 | fi |
2e4d9fb1 AJ |
1532 | if test "$brlapi" = "yes" ; then |
1533 | echo "CONFIG_BRLAPI=yes" >> $config_mak | |
1534 | echo "#define CONFIG_BRLAPI 1" >> $config_h | |
1535 | echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak | |
1536 | fi | |
fb599c9a AZ |
1537 | if test "$bluez" = "yes" ; then |
1538 | echo "CONFIG_BLUEZ=yes" >> $config_mak | |
1539 | echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak | |
1540 | echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak | |
1541 | echo "#define CONFIG_BLUEZ 1" >> $config_h | |
1542 | fi | |
414f0dab BS |
1543 | if test "$aio" = "yes" ; then |
1544 | echo "#define CONFIG_AIO 1" >> $config_h | |
a3392f9b | 1545 | echo "CONFIG_AIO=yes" >> $config_mak |
414f0dab | 1546 | fi |
77755340 TS |
1547 | if test "$blobs" = "yes" ; then |
1548 | echo "INSTALL_BLOBS=yes" >> $config_mak | |
1549 | fi | |
bf9298b9 AL |
1550 | if test "$iovec" = "yes" ; then |
1551 | echo "#define HAVE_IOVEC 1" >> $config_h | |
1552 | fi | |
ceb42de8 AL |
1553 | if test "$preadv" = "yes" ; then |
1554 | echo "#define HAVE_PREADV 1" >> $config_h | |
1555 | fi | |
f652e6af AJ |
1556 | if test "$fdt" = "yes" ; then |
1557 | echo "#define HAVE_FDT 1" >> $config_h | |
1558 | echo "FDT_LIBS=-lfdt" >> $config_mak | |
1559 | fi | |
97a847bc | 1560 | |
83fb7adf | 1561 | # XXX: suppress that |
7d3505c5 | 1562 | if [ "$bsd" = "yes" ] ; then |
43003046 | 1563 | echo "#define O_LARGEFILE 0" >> $config_h |
43003046 | 1564 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
179a2c19 | 1565 | echo "#define HOST_BSD 1" >> $config_h |
7d3505c5 FB |
1566 | fi |
1567 | ||
c5937220 PB |
1568 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
1569 | ||
68063649 BS |
1570 | # USB host support |
1571 | case "$usb" in | |
1572 | linux) | |
1573 | echo "HOST_USB=linux" >> $config_mak | |
1574 | ;; | |
1575 | bsd) | |
1576 | echo "HOST_USB=bsd" >> $config_mak | |
1577 | ;; | |
1578 | *) | |
1579 | echo "HOST_USB=stub" >> $config_mak | |
1580 | ;; | |
1581 | esac | |
1582 | ||
c39e3338 PB |
1583 | tools= |
1584 | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then | |
3dd1f8ef | 1585 | tools="qemu-img\$(EXESUF) $tools" |
7a5ca864 | 1586 | if [ "$linux" = "yes" ] ; then |
3dd1f8ef | 1587 | tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools" |
7a5ca864 | 1588 | fi |
c39e3338 PB |
1589 | fi |
1590 | echo "TOOLS=$tools" >> $config_mak | |
1591 | ||
15d9ca0f TS |
1592 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
1593 | ||
1d14ffa9 | 1594 | for target in $target_list; do |
97a847bc FB |
1595 | target_dir="$target" |
1596 | config_mak=$target_dir/config.mak | |
1597 | config_h=$target_dir/config.h | |
1598 | target_cpu=`echo $target | cut -d '-' -f 1` | |
1599 | target_bigendian="no" | |
808c4954 | 1600 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
0938cda5 AJ |
1601 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
1602 | [ "$target_cpu" = "mips" ] && target_bigendian=yes | |
1603 | [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes | |
1604 | [ "$target_cpu" = "mips64" ] && target_bigendian=yes | |
67867308 | 1605 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
d4082e95 | 1606 | [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes |
22f8a8b3 | 1607 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
e85e7c6e | 1608 | [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes |
908f52b0 | 1609 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
0938cda5 AJ |
1610 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
1611 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes | |
1612 | [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes | |
97a847bc | 1613 | target_softmmu="no" |
997344f3 | 1614 | target_user_only="no" |
831b7825 | 1615 | target_linux_user="no" |
831b7825 | 1616 | target_darwin_user="no" |
84778508 | 1617 | target_bsd_user="no" |
9e407a85 PB |
1618 | case "$target" in |
1619 | ${target_cpu}-softmmu) | |
1620 | target_softmmu="yes" | |
1621 | ;; | |
1622 | ${target_cpu}-linux-user) | |
1623 | target_user_only="yes" | |
1624 | target_linux_user="yes" | |
1625 | ;; | |
1626 | ${target_cpu}-darwin-user) | |
1627 | target_user_only="yes" | |
1628 | target_darwin_user="yes" | |
1629 | ;; | |
84778508 BS |
1630 | ${target_cpu}-bsd-user) |
1631 | target_user_only="yes" | |
1632 | target_bsd_user="yes" | |
1633 | ;; | |
9e407a85 PB |
1634 | *) |
1635 | echo "ERROR: Target '$target' not recognised" | |
1636 | exit 1 | |
1637 | ;; | |
1638 | esac | |
831b7825 | 1639 | |
97ccc689 | 1640 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
1d14ffa9 | 1641 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
97ccc689 | 1642 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
9c038506 | 1643 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
4d3b6f6e AZ |
1644 | echo "Note that this will disable all output from the virtual graphics card" |
1645 | echo "except through VNC or curses." | |
97ccc689 FB |
1646 | exit 1; |
1647 | fi | |
1648 | ||
7c1f25b4 | 1649 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
97a847bc | 1650 | |
15d9ca0f TS |
1651 | test -f $config_h && mv $config_h ${config_h}~ |
1652 | ||
97a847bc | 1653 | mkdir -p $target_dir |
158142c2 | 1654 | mkdir -p $target_dir/fpu |
57fec1fe | 1655 | mkdir -p $target_dir/tcg |
84778508 | 1656 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then |
69de927c FB |
1657 | mkdir -p $target_dir/nwfpe |
1658 | fi | |
1659 | ||
ec530c81 FB |
1660 | # |
1661 | # don't use ln -sf as not all "ln -sf" over write the file/link | |
1662 | # | |
1663 | rm -f $target_dir/Makefile | |
1664 | ln -s $source_path/Makefile.target $target_dir/Makefile | |
1665 | ||
97a847bc FB |
1666 | |
1667 | echo "# Automatically generated by configure - do not modify" > $config_mak | |
1668 | echo "/* Automatically generated by configure - do not modify */" > $config_h | |
1669 | ||
de83cd02 | 1670 | |
97a847bc FB |
1671 | echo "include ../config-host.mak" >> $config_mak |
1672 | echo "#include \"../config-host.h\"" >> $config_h | |
1e43adfc | 1673 | |
e5fe0c52 | 1674 | bflt="no" |
cb33da57 | 1675 | elfload32="no" |
bd0c5661 | 1676 | target_nptl="no" |
1e43adfc FB |
1677 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
1678 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h | |
56aebc89 | 1679 | gdb_xml_files="" |
97a847bc | 1680 | |
5985ecee AL |
1681 | # Make sure the target and host cpus are compatible |
1682 | if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \ | |
fdf7ed96 | 1683 | \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \ |
5985ecee AL |
1684 | \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \ |
1685 | \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then | |
7ba1e619 AL |
1686 | kvm="no" |
1687 | fi | |
1688 | # Disable KVM for linux-user | |
1689 | if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then | |
1690 | kvm="no" | |
1691 | fi | |
1692 | ||
2408a527 AJ |
1693 | case "$target_cpu" in |
1694 | i386) | |
1695 | echo "TARGET_ARCH=i386" >> $config_mak | |
1696 | echo "#define TARGET_ARCH \"i386\"" >> $config_h | |
1697 | echo "#define TARGET_I386 1" >> $config_h | |
da260249 | 1698 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" |
2408a527 AJ |
1699 | then |
1700 | echo "#define USE_KQEMU 1" >> $config_h | |
1701 | fi | |
7ba1e619 AL |
1702 | if test "$kvm" = "yes" ; then |
1703 | echo "CONFIG_KVM=yes" >> $config_mak | |
1704 | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak | |
5985ecee | 1705 | echo "#define CONFIG_KVM 1" >> $config_h |
7ba1e619 | 1706 | fi |
2408a527 AJ |
1707 | ;; |
1708 | x86_64) | |
1709 | echo "TARGET_ARCH=x86_64" >> $config_mak | |
1710 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h | |
1711 | echo "#define TARGET_I386 1" >> $config_h | |
1712 | echo "#define TARGET_X86_64 1" >> $config_h | |
1713 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" | |
1714 | then | |
1715 | echo "#define USE_KQEMU 1" >> $config_h | |
1716 | fi | |
7ba1e619 AL |
1717 | if test "$kvm" = "yes" ; then |
1718 | echo "CONFIG_KVM=yes" >> $config_mak | |
1719 | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak | |
1720 | echo "#define CONFIG_KVM 1" >> $config_h | |
1721 | fi | |
2408a527 AJ |
1722 | ;; |
1723 | alpha) | |
1724 | echo "TARGET_ARCH=alpha" >> $config_mak | |
1725 | echo "#define TARGET_ARCH \"alpha\"" >> $config_h | |
1726 | echo "#define TARGET_ALPHA 1" >> $config_h | |
1727 | ;; | |
1728 | arm|armeb) | |
1729 | echo "TARGET_ARCH=arm" >> $config_mak | |
2408a527 AJ |
1730 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
1731 | echo "#define TARGET_ARM 1" >> $config_h | |
2408a527 | 1732 | bflt="yes" |
bd0c5661 | 1733 | target_nptl="yes" |
56aebc89 | 1734 | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
2408a527 AJ |
1735 | ;; |
1736 | cris) | |
1737 | echo "TARGET_ARCH=cris" >> $config_mak | |
1738 | echo "#define TARGET_ARCH \"cris\"" >> $config_h | |
1739 | echo "#define TARGET_CRIS 1" >> $config_h | |
253bd7f8 | 1740 | target_nptl="yes" |
2408a527 AJ |
1741 | ;; |
1742 | m68k) | |
1743 | echo "TARGET_ARCH=m68k" >> $config_mak | |
1744 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h | |
1745 | echo "#define TARGET_M68K 1" >> $config_h | |
1746 | bflt="yes" | |
56aebc89 | 1747 | gdb_xml_files="cf-core.xml cf-fp.xml" |
2408a527 AJ |
1748 | ;; |
1749 | mips|mipsel) | |
1750 | echo "TARGET_ARCH=mips" >> $config_mak | |
1751 | echo "#define TARGET_ARCH \"mips\"" >> $config_h | |
1752 | echo "#define TARGET_MIPS 1" >> $config_h | |
1753 | echo "#define TARGET_ABI_MIPSO32 1" >> $config_h | |
1754 | ;; | |
1755 | mipsn32|mipsn32el) | |
1756 | echo "TARGET_ARCH=mipsn32" >> $config_mak | |
1757 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h | |
1758 | echo "#define TARGET_MIPS 1" >> $config_h | |
1759 | echo "#define TARGET_ABI_MIPSN32 1" >> $config_h | |
1760 | ;; | |
1761 | mips64|mips64el) | |
1762 | echo "TARGET_ARCH=mips64" >> $config_mak | |
1763 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h | |
1764 | echo "#define TARGET_MIPS 1" >> $config_h | |
1765 | echo "#define TARGET_MIPS64 1" >> $config_h | |
1766 | echo "#define TARGET_ABI_MIPSN64 1" >> $config_h | |
1767 | ;; | |
1768 | ppc) | |
1769 | echo "TARGET_ARCH=ppc" >> $config_mak | |
1770 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h | |
1771 | echo "#define TARGET_PPC 1" >> $config_h | |
c8b3532d | 1772 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
1773 | ;; |
1774 | ppcemb) | |
1775 | echo "TARGET_ARCH=ppcemb" >> $config_mak | |
1776 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
1777 | echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h | |
1778 | echo "#define TARGET_PPC 1" >> $config_h | |
1779 | echo "#define TARGET_PPCEMB 1" >> $config_h | |
d76d1650 AJ |
1780 | if test "$kvm" = "yes" ; then |
1781 | echo "CONFIG_KVM=yes" >> $config_mak | |
1782 | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak | |
1783 | echo "#define CONFIG_KVM 1" >> $config_h | |
1784 | fi | |
c8b3532d | 1785 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
1786 | ;; |
1787 | ppc64) | |
1788 | echo "TARGET_ARCH=ppc64" >> $config_mak | |
1789 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
1790 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h | |
1791 | echo "#define TARGET_PPC 1" >> $config_h | |
1792 | echo "#define TARGET_PPC64 1" >> $config_h | |
c8b3532d | 1793 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
1794 | ;; |
1795 | ppc64abi32) | |
1796 | echo "TARGET_ARCH=ppc64" >> $config_mak | |
1797 | echo "TARGET_ABI_DIR=ppc" >> $config_mak | |
1798 | echo "TARGET_ARCH2=ppc64abi32" >> $config_mak | |
1799 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h | |
1800 | echo "#define TARGET_PPC 1" >> $config_h | |
1801 | echo "#define TARGET_PPC64 1" >> $config_h | |
1802 | echo "#define TARGET_ABI32 1" >> $config_h | |
c8b3532d | 1803 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
1804 | ;; |
1805 | sh4|sh4eb) | |
1806 | echo "TARGET_ARCH=sh4" >> $config_mak | |
1807 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h | |
1808 | echo "#define TARGET_SH4 1" >> $config_h | |
1809 | bflt="yes" | |
0b6d3ae0 | 1810 | target_nptl="yes" |
2408a527 AJ |
1811 | ;; |
1812 | sparc) | |
1813 | echo "TARGET_ARCH=sparc" >> $config_mak | |
1814 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h | |
1815 | echo "#define TARGET_SPARC 1" >> $config_h | |
1816 | ;; | |
1817 | sparc64) | |
1818 | echo "TARGET_ARCH=sparc64" >> $config_mak | |
1819 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h | |
1820 | echo "#define TARGET_SPARC 1" >> $config_h | |
1821 | echo "#define TARGET_SPARC64 1" >> $config_h | |
1822 | elfload32="yes" | |
1823 | ;; | |
1824 | sparc32plus) | |
1825 | echo "TARGET_ARCH=sparc64" >> $config_mak | |
1826 | echo "TARGET_ABI_DIR=sparc" >> $config_mak | |
1827 | echo "TARGET_ARCH2=sparc32plus" >> $config_mak | |
1828 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h | |
1829 | echo "#define TARGET_SPARC 1" >> $config_h | |
1830 | echo "#define TARGET_SPARC64 1" >> $config_h | |
1831 | echo "#define TARGET_ABI32 1" >> $config_h | |
1832 | ;; | |
1833 | *) | |
1834 | echo "Unsupported target CPU" | |
1835 | exit 1 | |
1836 | ;; | |
1837 | esac | |
de83cd02 | 1838 | if test "$target_bigendian" = "yes" ; then |
97a847bc FB |
1839 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
1840 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h | |
de83cd02 | 1841 | fi |
97a847bc FB |
1842 | if test "$target_softmmu" = "yes" ; then |
1843 | echo "CONFIG_SOFTMMU=yes" >> $config_mak | |
1844 | echo "#define CONFIG_SOFTMMU 1" >> $config_h | |
43ce4dfe | 1845 | fi |
997344f3 FB |
1846 | if test "$target_user_only" = "yes" ; then |
1847 | echo "CONFIG_USER_ONLY=yes" >> $config_mak | |
1848 | echo "#define CONFIG_USER_ONLY 1" >> $config_h | |
1849 | fi | |
831b7825 TS |
1850 | if test "$target_linux_user" = "yes" ; then |
1851 | echo "CONFIG_LINUX_USER=yes" >> $config_mak | |
1852 | echo "#define CONFIG_LINUX_USER 1" >> $config_h | |
1853 | fi | |
1854 | if test "$target_darwin_user" = "yes" ; then | |
1855 | echo "CONFIG_DARWIN_USER=yes" >> $config_mak | |
1856 | echo "#define CONFIG_DARWIN_USER 1" >> $config_h | |
1857 | fi | |
56aebc89 PB |
1858 | list="" |
1859 | if test ! -z "$gdb_xml_files" ; then | |
1860 | for x in $gdb_xml_files; do | |
1861 | list="$list $source_path/gdb-xml/$x" | |
1862 | done | |
1863 | fi | |
1864 | echo "TARGET_XML_FILES=$list" >> $config_mak | |
97a847bc | 1865 | |
0938cda5 AJ |
1866 | if test "$target_cpu" = "arm" \ |
1867 | -o "$target_cpu" = "armeb" \ | |
1868 | -o "$target_cpu" = "m68k" \ | |
1869 | -o "$target_cpu" = "mips" \ | |
1870 | -o "$target_cpu" = "mipsel" \ | |
1871 | -o "$target_cpu" = "mipsn32" \ | |
1872 | -o "$target_cpu" = "mipsn32el" \ | |
1873 | -o "$target_cpu" = "mips64" \ | |
1874 | -o "$target_cpu" = "mips64el" \ | |
3147d1e8 AJ |
1875 | -o "$target_cpu" = "ppc" \ |
1876 | -o "$target_cpu" = "ppc64" \ | |
71e991fd AJ |
1877 | -o "$target_cpu" = "ppc64abi32" \ |
1878 | -o "$target_cpu" = "ppcemb" \ | |
0938cda5 AJ |
1879 | -o "$target_cpu" = "sparc" \ |
1880 | -o "$target_cpu" = "sparc64" \ | |
1881 | -o "$target_cpu" = "sparc32plus"; then | |
158142c2 FB |
1882 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
1883 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h | |
1884 | fi | |
e5fe0c52 PB |
1885 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
1886 | echo "TARGET_HAS_BFLT=yes" >> $config_mak | |
1887 | echo "#define TARGET_HAS_BFLT 1" >> $config_h | |
1888 | fi | |
bd0c5661 PB |
1889 | if test "$target_user_only" = "yes" \ |
1890 | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then | |
1891 | echo "#define USE_NPTL 1" >> $config_h | |
1892 | fi | |
cb33da57 BS |
1893 | # 32 bit ELF loader in addition to native 64 bit loader? |
1894 | if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then | |
1895 | echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak | |
1896 | echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h | |
1897 | fi | |
84778508 BS |
1898 | if test "$target_bsd_user" = "yes" ; then |
1899 | echo "CONFIG_BSD_USER=yes" >> $config_mak | |
1900 | echo "#define CONFIG_BSD_USER 1" >> $config_h | |
1901 | fi | |
5b0753e0 | 1902 | |
15d9ca0f TS |
1903 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
1904 | ||
97a847bc | 1905 | done # for target in $targets |
7d13299d FB |
1906 | |
1907 | # build tree in object directory if source path is different from current one | |
1908 | if test "$source_path_used" = "yes" ; then | |
49ecc3fa | 1909 | DIRS="tests tests/cris slirp audio" |
7d13299d | 1910 | FILES="Makefile tests/Makefile" |
e7daa605 | 1911 | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
e1ffb0f1 | 1912 | FILES="$FILES tests/test-mmap.c" |
7d13299d FB |
1913 | for dir in $DIRS ; do |
1914 | mkdir -p $dir | |
1915 | done | |
ec530c81 | 1916 | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
7d13299d | 1917 | for f in $FILES ; do |
ec530c81 FB |
1918 | rm -f $f |
1919 | ln -s $source_path/$f $f | |
7d13299d FB |
1920 | done |
1921 | fi |