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