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