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