]>
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 PB |
25 | gcc3_search="yes" |
26 | gcc3_list="gcc-3.4 gcc34 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 | ;; |
ba68055e | 38 | armv*b) |
808c4954 FB |
39 | cpu="armv4b" |
40 | ;; | |
ba68055e | 41 | armv*l) |
7d13299d FB |
42 | cpu="armv4l" |
43 | ;; | |
44 | alpha) | |
45 | cpu="alpha" | |
46 | ;; | |
295defa5 | 47 | "Power Macintosh"|ppc|ppc64) |
7d13299d FB |
48 | cpu="powerpc" |
49 | ;; | |
50 | mips) | |
51 | cpu="mips" | |
52 | ;; | |
fb3e5849 FB |
53 | s390) |
54 | cpu="s390" | |
55 | ;; | |
94ac5158 | 56 | sparc|sun4[muv]) |
ae228531 FB |
57 | cpu="sparc" |
58 | ;; | |
59 | sparc64) | |
60 | cpu="sparc64" | |
61 | ;; | |
a8baa8c5 FB |
62 | ia64) |
63 | cpu="ia64" | |
64 | ;; | |
38e584a0 FB |
65 | m68k) |
66 | cpu="m68k" | |
67 | ;; | |
bc51c5c9 | 68 | x86_64|amd64) |
0b0babc6 | 69 | cpu="x86_64" |
bc51c5c9 | 70 | ;; |
7d13299d FB |
71 | *) |
72 | cpu="unknown" | |
73 | ;; | |
74 | esac | |
75 | gprof="no" | |
76 | bigendian="no" | |
67b915a5 FB |
77 | mingw32="no" |
78 | EXESUF="" | |
79 | gdbstub="yes" | |
443f1376 | 80 | slirp="yes" |
fb065187 FB |
81 | adlib="no" |
82 | oss="no" | |
1d14ffa9 FB |
83 | dsound="no" |
84 | coreaudio="no" | |
85 | alsa="no" | |
102a52e4 FB |
86 | fmod="no" |
87 | fmod_lib="" | |
88 | fmod_inc="" | |
b1a550a0 | 89 | bsd="no" |
5327cf48 | 90 | linux="no" |
c9ec1fe4 | 91 | kqemu="no" |
05c2a3e7 | 92 | profiler="no" |
5b0753e0 | 93 | cocoa="no" |
97ccc689 | 94 | check_gfx="yes" |
1aff381f | 95 | check_gcc="yes" |
0a8e90f4 PB |
96 | softmmu="yes" |
97 | user="no" | |
cc8ae6de | 98 | build_docs="no" |
c5937220 | 99 | uname_release="" |
7d13299d FB |
100 | |
101 | # OS specific | |
102 | targetos=`uname -s` | |
103 | case $targetos in | |
c326e0af FB |
104 | CYGWIN*) |
105 | mingw32="yes" | |
6f30fa85 | 106 | OS_CFLAGS="-mno-cygwin" |
c326e0af | 107 | ;; |
67b915a5 FB |
108 | MINGW32*) |
109 | mingw32="yes" | |
110 | ;; | |
7d3505c5 FB |
111 | FreeBSD) |
112 | bsd="yes" | |
fb065187 | 113 | oss="yes" |
e99f9060 | 114 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
07f4ddbf FB |
115 | kqemu="yes" |
116 | fi | |
7d3505c5 FB |
117 | ;; |
118 | NetBSD) | |
119 | bsd="yes" | |
fb065187 | 120 | oss="yes" |
7d3505c5 FB |
121 | ;; |
122 | OpenBSD) | |
123 | bsd="yes" | |
fb065187 | 124 | oss="yes" |
7d3505c5 | 125 | ;; |
83fb7adf FB |
126 | Darwin) |
127 | bsd="yes" | |
128 | darwin="yes" | |
6f30fa85 | 129 | OS_CFLAGS="-mdynamic-no-pic" |
83fb7adf | 130 | ;; |
ec530c81 FB |
131 | SunOS) |
132 | solaris="yes" | |
133 | ;; | |
1d14ffa9 | 134 | *) |
fb065187 | 135 | oss="yes" |
5327cf48 | 136 | linux="yes" |
0a8e90f4 | 137 | user="yes" |
07f4ddbf | 138 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
c9ec1fe4 FB |
139 | kqemu="yes" |
140 | fi | |
fb065187 | 141 | ;; |
7d13299d FB |
142 | esac |
143 | ||
7d3505c5 | 144 | if [ "$bsd" = "yes" ] ; then |
b1a550a0 | 145 | if [ "$darwin" != "yes" ] ; then |
83fb7adf FB |
146 | make="gmake" |
147 | fi | |
7d3505c5 FB |
148 | fi |
149 | ||
ec530c81 FB |
150 | if [ "$solaris" = "yes" ] ; then |
151 | make="gmake" | |
152 | install="ginstall" | |
153 | solarisrev=`uname -r | cut -f2 -d.` | |
605686cd TS |
154 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
155 | if test "$solarisrev" -gt 10 ; then | |
156 | kqemu="yes" | |
157 | fi | |
158 | fi | |
ec530c81 FB |
159 | fi |
160 | ||
7d13299d | 161 | # find source path |
ad064840 PB |
162 | source_path=`dirname "$0"` |
163 | if [ -z "$source_path" ]; then | |
7d13299d | 164 | source_path=`pwd` |
ad064840 PB |
165 | else |
166 | source_path=`cd "$source_path"; pwd` | |
167 | fi | |
168 | if test "$source_path" = `pwd` ; then | |
7d13299d | 169 | source_path_used="no" |
ad064840 PB |
170 | else |
171 | source_path_used="yes" | |
7d13299d FB |
172 | fi |
173 | ||
174 | for opt do | |
a46e4035 | 175 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
7d13299d | 176 | case "$opt" in |
2efc3265 FB |
177 | --help|-h) show_help=yes |
178 | ;; | |
b1a550a0 | 179 | --prefix=*) prefix="$optarg" |
7d13299d | 180 | ;; |
b1a550a0 | 181 | --interp-prefix=*) interp_prefix="$optarg" |
32ce6337 | 182 | ;; |
b1a550a0 | 183 | --source-path=*) source_path="$optarg" |
ad064840 | 184 | source_path_used="yes" |
7d13299d | 185 | ;; |
b1a550a0 | 186 | --cross-prefix=*) cross_prefix="$optarg" |
7d13299d | 187 | ;; |
b1a550a0 | 188 | --cc=*) cc="$optarg" |
328a4240 | 189 | gcc3_search="no" |
7d13299d | 190 | ;; |
b1a550a0 | 191 | --host-cc=*) host_cc="$optarg" |
83469015 | 192 | ;; |
b1a550a0 | 193 | --make=*) make="$optarg" |
7d13299d | 194 | ;; |
6a882643 PB |
195 | --install=*) install="$optarg" |
196 | ;; | |
b1a550a0 | 197 | --extra-cflags=*) CFLAGS="$optarg" |
7d13299d | 198 | ;; |
b1a550a0 | 199 | --extra-ldflags=*) LDFLAGS="$optarg" |
7d13299d | 200 | ;; |
b1a550a0 | 201 | --cpu=*) cpu="$optarg" |
7d13299d | 202 | ;; |
b1a550a0 | 203 | --target-list=*) target_list="$optarg" |
de83cd02 | 204 | ;; |
7d13299d FB |
205 | --enable-gprof) gprof="yes" |
206 | ;; | |
43ce4dfe FB |
207 | --static) static="yes" |
208 | ;; | |
97a847bc FB |
209 | --disable-sdl) sdl="no" |
210 | ;; | |
1d14ffa9 FB |
211 | --enable-coreaudio) coreaudio="yes" |
212 | ;; | |
213 | --enable-alsa) alsa="yes" | |
214 | ;; | |
215 | --enable-dsound) dsound="yes" | |
216 | ;; | |
102a52e4 FB |
217 | --enable-fmod) fmod="yes" |
218 | ;; | |
b1a550a0 | 219 | --fmod-lib=*) fmod_lib="$optarg" |
102a52e4 | 220 | ;; |
b1a550a0 | 221 | --fmod-inc=*) fmod_inc="$optarg" |
102a52e4 | 222 | ;; |
87ac5427 | 223 | --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no" |
1d14ffa9 | 224 | ;; |
443f1376 | 225 | --disable-slirp) slirp="no" |
1d14ffa9 | 226 | ;; |
fb065187 | 227 | --enable-adlib) adlib="yes" |
1d14ffa9 | 228 | ;; |
c9ec1fe4 | 229 | --disable-kqemu) kqemu="no" |
1d14ffa9 | 230 | ;; |
05c2a3e7 FB |
231 | --enable-profiler) profiler="yes" |
232 | ;; | |
1d14ffa9 FB |
233 | --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" |
234 | ;; | |
97ccc689 FB |
235 | --disable-gfx-check) check_gfx="no" |
236 | ;; | |
1aff381f FB |
237 | --disable-gcc-check) check_gcc="no" |
238 | ;; | |
cad25d69 | 239 | --disable-system) softmmu="no" |
0a8e90f4 | 240 | ;; |
cad25d69 | 241 | --enable-system) softmmu="yes" |
0a8e90f4 PB |
242 | ;; |
243 | --disable-user) user="no" | |
244 | ;; | |
245 | --enable-user) user="yes" | |
246 | ;; | |
c5937220 PB |
247 | --enable-uname-release=*) uname_release="$optarg" |
248 | ;; | |
7d13299d FB |
249 | esac |
250 | done | |
251 | ||
6f30fa85 TS |
252 | # default flags for all hosts |
253 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" | |
254 | LDFLAGS="$LDFLAGS -g" | |
255 | ||
af5db58e PB |
256 | if test x"$show_help" = x"yes" ; then |
257 | cat << EOF | |
258 | ||
259 | Usage: configure [options] | |
260 | Options: [defaults in brackets after descriptions] | |
261 | ||
262 | EOF | |
263 | echo "Standard options:" | |
264 | echo " --help print this message" | |
265 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
266 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." | |
267 | echo " use %M for cpu name [$interp_prefix]" | |
268 | echo " --target-list=LIST set target list [$target_list]" | |
269 | echo "" | |
270 | echo "kqemu kernel acceleration support:" | |
271 | echo " --disable-kqemu disable kqemu support" | |
af5db58e PB |
272 | echo "" |
273 | echo "Advanced options (experts only):" | |
274 | echo " --source-path=PATH path of source code [$source_path]" | |
275 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
276 | echo " --cc=CC use C compiler CC [$cc]" | |
277 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." | |
278 | echo " --make=MAKE use specified make [$make]" | |
6a882643 | 279 | echo " --install=INSTALL use specified install [$install]" |
af5db58e PB |
280 | echo " --static enable static build [$static]" |
281 | echo " --enable-cocoa enable COCOA (Mac OS X only)" | |
282 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" | |
283 | echo " --enable-adlib enable Adlib emulation" | |
284 | echo " --enable-coreaudio enable Coreaudio audio driver" | |
285 | echo " --enable-alsa enable ALSA audio driver" | |
286 | echo " --enable-fmod enable FMOD audio driver" | |
287 | echo " --enabled-dsound enable DirectSound audio driver" | |
288 | echo " --enable-system enable all system emulation targets" | |
289 | echo " --disable-system disable all system emulation targets" | |
290 | echo " --enable-user enable all linux usermode emulation targets" | |
291 | echo " --disable-user disable all linux usermode emulation targets" | |
292 | echo " --fmod-lib path to FMOD library" | |
293 | echo " --fmod-inc path to FMOD includes" | |
c5937220 | 294 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
af5db58e | 295 | echo "" |
5bf08934 | 296 | echo "NOTE: The object files are built at the place where configure is launched" |
af5db58e PB |
297 | exit 1 |
298 | fi | |
299 | ||
7d13299d FB |
300 | cc="${cross_prefix}${cc}" |
301 | ar="${cross_prefix}${ar}" | |
302 | strip="${cross_prefix}${strip}" | |
303 | ||
064aae13 PB |
304 | # check that the C compiler works. |
305 | cat > $TMPC <<EOF | |
306 | int main(void) {} | |
307 | EOF | |
308 | ||
309 | if $cc -c -o $TMPO $TMPC 2>/dev/null ; then | |
310 | : C compiler works ok | |
311 | else | |
312 | echo "ERROR: \"$cc\" either does not exist or does not work" | |
313 | exit 1 | |
a7350fa1 FB |
314 | fi |
315 | ||
67b915a5 | 316 | if test "$mingw32" = "yes" ; then |
5327cf48 | 317 | linux="no" |
67b915a5 | 318 | EXESUF=".exe" |
9f059eca | 319 | oss="no" |
07f4ddbf FB |
320 | if [ "$cpu" = "i386" ] ; then |
321 | kqemu="yes" | |
322 | fi | |
67b915a5 FB |
323 | fi |
324 | ||
328a4240 PB |
325 | # Check for gcc4, error if pre-gcc4 |
326 | if test "$check_gcc" = "yes" ; then | |
327 | cat > $TMPC <<EOF | |
328 | #if __GNUC__ < 4 | |
329 | #error gcc3 | |
330 | #endif | |
331 | int main(){return 0;} | |
332 | EOF | |
333 | check_cc() { | |
334 | which "$1" >&/dev/null | |
335 | return $? | |
336 | } | |
337 | ||
338 | if "$cc" -o $TMPE $TMPC 2>/dev/null ; then | |
339 | echo "WARNING: \"$cc\" looks like gcc 4.x" | |
340 | found_compat_cc="no" | |
341 | if test "$gcc3_search" = "yes" ; then | |
342 | echo "Looking for gcc 3.x" | |
343 | for compat_cc in $gcc3_list ; do | |
344 | if check_cc "$compat_cc" ; then | |
345 | echo "Found \"$compat_cc\"" | |
346 | cc="$compat_cc" | |
347 | found_compat_cc="yes" | |
348 | break | |
349 | fi | |
350 | done | |
351 | if test "$found_compat_cc" = "no" ; then | |
352 | echo "gcc 3.x not found!" | |
353 | fi | |
354 | fi | |
355 | if test "$found_compat_cc" = "no" ; then | |
356 | echo "QEMU is known to have problems when compiled with gcc 4.x" | |
357 | echo "It is recommended that you use gcc 3.x to build QEMU" | |
358 | echo "To use this compiler anyway, configure with --disable-gcc-check" | |
359 | exit 1; | |
360 | fi | |
361 | fi | |
362 | fi | |
363 | ||
ec530c81 FB |
364 | # |
365 | # Solaris specific configure tool chain decisions | |
366 | # | |
367 | if test "$solaris" = "yes" ; then | |
368 | # | |
369 | # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly | |
370 | # override the check with --disable-gcc-check | |
371 | # | |
372 | if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then | |
373 | solgcc=`which $cc` | |
374 | if test "$solgcc" = "/usr/sfw/bin/gcc" ; then | |
375 | echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly." | |
376 | echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3" | |
377 | echo "or get the latest patch from SunSolve for gcc" | |
378 | exit 1 | |
379 | fi | |
380 | fi | |
381 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` | |
382 | if test -z "$solinst" ; then | |
383 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" | |
384 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" | |
385 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" | |
386 | exit 1 | |
387 | fi | |
388 | if test "$solinst" = "/usr/sbin/install" ; then | |
389 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." | |
390 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" | |
391 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" | |
392 | exit 1 | |
393 | fi | |
ec530c81 FB |
394 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
395 | if test -z "$sol_ar" ; then | |
396 | echo "Error: No path includes ar" | |
397 | if test -f /usr/ccs/bin/ar ; then | |
398 | echo "Add /usr/ccs/bin to your path and rerun configure" | |
399 | fi | |
400 | exit 1 | |
401 | fi | |
402 | fi | |
403 | ||
404 | ||
5327cf48 FB |
405 | if test -z "$target_list" ; then |
406 | # these targets are portable | |
0a8e90f4 PB |
407 | if [ "$softmmu" = "yes" ] ; then |
408 | target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu" | |
409 | fi | |
5327cf48 | 410 | # the following are Linux specific |
0a8e90f4 | 411 | if [ "$user" = "yes" ] ; then |
e6e5906b | 412 | target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user m68k-user $target_list" |
5327cf48 | 413 | fi |
6e20a45f | 414 | else |
b1a550a0 | 415 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
5327cf48 | 416 | fi |
0a8e90f4 PB |
417 | if test -z "$target_list" ; then |
418 | echo "No targets enabled" | |
419 | exit 1 | |
420 | fi | |
5327cf48 | 421 | |
7d13299d FB |
422 | if test -z "$cross_prefix" ; then |
423 | ||
424 | # --- | |
425 | # big/little endian test | |
426 | cat > $TMPC << EOF | |
427 | #include <inttypes.h> | |
428 | int main(int argc, char ** argv){ | |
1d14ffa9 FB |
429 | volatile uint32_t i=0x01234567; |
430 | return (*((uint8_t*)(&i))) == 0x67; | |
7d13299d FB |
431 | } |
432 | EOF | |
433 | ||
434 | if $cc -o $TMPE $TMPC 2>/dev/null ; then | |
435 | $TMPE && bigendian="yes" | |
436 | else | |
437 | echo big/little test failed | |
438 | fi | |
439 | ||
440 | else | |
441 | ||
442 | # if cross compiling, cannot launch a program, so make a static guess | |
808c4954 | 443 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then |
7d13299d FB |
444 | bigendian="yes" |
445 | fi | |
446 | ||
447 | fi | |
448 | ||
b6853697 FB |
449 | # host long bits test |
450 | hostlongbits="32" | |
451 | if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then | |
452 | hostlongbits="64" | |
453 | fi | |
454 | ||
e8cd23de | 455 | # check gcc options support |
04369ff2 FB |
456 | cat > $TMPC <<EOF |
457 | int main(void) { | |
04369ff2 FB |
458 | } |
459 | EOF | |
460 | ||
e8cd23de FB |
461 | have_gcc3_options="no" |
462 | if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then | |
463 | have_gcc3_options="yes" | |
04369ff2 | 464 | fi |
ca735206 | 465 | |
11d9f695 FB |
466 | ########################################## |
467 | # SDL probe | |
468 | ||
469 | sdl_too_old=no | |
470 | ||
471 | if test -z "$sdl" ; then | |
472 | ||
a6e022ad FB |
473 | sdl_config="sdl-config" |
474 | sdl=no | |
7c1f25b4 | 475 | sdl_static=no |
a6e022ad FB |
476 | |
477 | if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then | |
478 | # win32 cross compilation case | |
479 | sdl_config="i386-mingw32msvc-sdl-config" | |
480 | sdl=yes | |
481 | else | |
482 | # normal SDL probe | |
11d9f695 FB |
483 | cat > $TMPC << EOF |
484 | #include <SDL.h> | |
485 | #undef main /* We don't want SDL to override our main() */ | |
486 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
487 | EOF | |
488 | ||
a6e022ad FB |
489 | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then |
490 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` | |
11d9f695 FB |
491 | if test "$_sdlversion" -lt 121 ; then |
492 | sdl_too_old=yes | |
493 | else | |
494 | sdl=yes | |
495 | fi | |
7c1f25b4 FB |
496 | |
497 | # static link with sdl ? | |
498 | if test "$sdl" = "yes" ; then | |
499 | aa="no" | |
500 | `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes" | |
501 | sdl_static_libs=`$sdl_config --static-libs` | |
502 | if [ "$aa" = "yes" ] ; then | |
d8d8aa4e | 503 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" |
7c1f25b4 FB |
504 | fi |
505 | ||
506 | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then | |
507 | sdl_static=yes | |
11d9f695 FB |
508 | fi |
509 | ||
7c1f25b4 FB |
510 | fi # static link |
511 | ||
512 | fi # sdl compile test | |
513 | ||
a6e022ad FB |
514 | fi # cross compilation |
515 | fi # -z $sdl | |
11d9f695 | 516 | |
8f28f3fb TS |
517 | ########################################## |
518 | # alsa sound support libraries | |
519 | ||
520 | if test "$alsa" = "yes" ; then | |
521 | cat > $TMPC << EOF | |
522 | #include <alsa/asoundlib.h> | |
523 | int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); } | |
524 | EOF | |
525 | if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then | |
526 | : | |
527 | else | |
528 | echo | |
529 | echo "Error: Could not find alsa" | |
530 | echo "Make sure to have the alsa libs and headers installed." | |
531 | echo | |
532 | exit 1 | |
533 | fi | |
534 | fi | |
535 | ||
cc8ae6de | 536 | # Check if tools are available to build documentation. |
94ac5158 | 537 | if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then |
cc8ae6de PB |
538 | build_docs="yes" |
539 | fi | |
540 | ||
11d9f695 FB |
541 | if test "$mingw32" = "yes" ; then |
542 | if test -z "$prefix" ; then | |
543 | prefix="/c/Program Files/Qemu" | |
544 | fi | |
545 | mandir="$prefix" | |
7efa4387 | 546 | datadir="$prefix" |
1f50f8d1 | 547 | docdir="$prefix" |
11d9f695 FB |
548 | bindir="$prefix" |
549 | else | |
550 | if test -z "$prefix" ; then | |
551 | prefix="/usr/local" | |
552 | fi | |
5a67135a | 553 | mandir="$prefix/share/man" |
7efa4387 | 554 | datadir="$prefix/share/qemu" |
1f50f8d1 | 555 | docdir="$prefix/share/doc/qemu" |
11d9f695 FB |
556 | bindir="$prefix/bin" |
557 | fi | |
5a67135a | 558 | |
43ce4dfe | 559 | echo "Install prefix $prefix" |
7efa4387 | 560 | echo "BIOS directory $datadir" |
11d9f695 FB |
561 | echo "binary directory $bindir" |
562 | if test "$mingw32" = "no" ; then | |
563 | echo "Manual directory $mandir" | |
43ce4dfe | 564 | echo "ELF interp prefix $interp_prefix" |
11d9f695 | 565 | fi |
5a67135a | 566 | echo "Source path $source_path" |
43ce4dfe | 567 | echo "C compiler $cc" |
83469015 | 568 | echo "Host C compiler $host_cc" |
43ce4dfe | 569 | echo "make $make" |
6a882643 | 570 | echo "install $install" |
43ce4dfe | 571 | echo "host CPU $cpu" |
de83cd02 | 572 | echo "host big endian $bigendian" |
97a847bc | 573 | echo "target list $target_list" |
43ce4dfe | 574 | echo "gprof enabled $gprof" |
05c2a3e7 | 575 | echo "profiler $profiler" |
43ce4dfe | 576 | echo "static build $static" |
5b0753e0 FB |
577 | if test "$darwin" = "yes" ; then |
578 | echo "Cocoa support $cocoa" | |
579 | fi | |
97a847bc | 580 | echo "SDL support $sdl" |
e4afee97 FB |
581 | if test "$sdl" != "no" ; then |
582 | echo "SDL static link $sdl_static" | |
583 | fi | |
67b915a5 | 584 | echo "mingw32 support $mingw32" |
fb065187 | 585 | echo "Adlib support $adlib" |
1d14ffa9 FB |
586 | echo "CoreAudio support $coreaudio" |
587 | echo "ALSA support $alsa" | |
588 | echo "DSound support $dsound" | |
1d14ffa9 FB |
589 | if test "$fmod" = "yes"; then |
590 | if test -z $fmod_lib || test -z $fmod_inc; then | |
591 | echo | |
592 | echo "Error: You must specify path to FMOD library and headers" | |
593 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
594 | echo | |
595 | exit 1 | |
596 | fi | |
b1a550a0 PB |
597 | fmod_support=" (lib='$fmod_lib' include='$fmod_inc')" |
598 | else | |
599 | fmod_support="" | |
102a52e4 | 600 | fi |
b1a550a0 | 601 | echo "FMOD support $fmod $fmod_support" |
07f4ddbf | 602 | echo "kqemu support $kqemu" |
cc8ae6de | 603 | echo "Documentation $build_docs" |
c5937220 PB |
604 | [ ! -z "$uname_release" ] && \ |
605 | echo "uname -r $uname_release" | |
67b915a5 | 606 | |
97a847bc | 607 | if test $sdl_too_old = "yes"; then |
24b55b96 | 608 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
7c1f25b4 | 609 | fi |
24b55b96 FB |
610 | #if test "$sdl_static" = "no"; then |
611 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" | |
612 | #fi | |
97a847bc FB |
613 | config_mak="config-host.mak" |
614 | config_h="config-host.h" | |
7d13299d | 615 | |
7c1f25b4 | 616 | #echo "Creating $config_mak and $config_h" |
7d13299d | 617 | |
97a847bc | 618 | echo "# Automatically generated by configure - do not modify" > $config_mak |
29517134 | 619 | echo "# Configured with: $0 $@" >> $config_mak |
97a847bc | 620 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
7d13299d | 621 | |
97a847bc | 622 | echo "prefix=$prefix" >> $config_mak |
11d9f695 | 623 | echo "bindir=$bindir" >> $config_mak |
5a67135a | 624 | echo "mandir=$mandir" >> $config_mak |
7efa4387 | 625 | echo "datadir=$datadir" >> $config_mak |
1f50f8d1 | 626 | echo "docdir=$docdir" >> $config_mak |
7efa4387 | 627 | echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h |
97a847bc | 628 | echo "MAKE=$make" >> $config_mak |
6a882643 | 629 | echo "INSTALL=$install" >> $config_mak |
97a847bc | 630 | echo "CC=$cc" >> $config_mak |
e8cd23de | 631 | if test "$have_gcc3_options" = "yes" ; then |
97a847bc | 632 | echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak |
e8cd23de | 633 | fi |
97a847bc FB |
634 | echo "HOST_CC=$host_cc" >> $config_mak |
635 | echo "AR=$ar" >> $config_mak | |
636 | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak | |
6f30fa85 | 637 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
97a847bc FB |
638 | echo "CFLAGS=$CFLAGS" >> $config_mak |
639 | echo "LDFLAGS=$LDFLAGS" >> $config_mak | |
67b915a5 | 640 | echo "EXESUF=$EXESUF" >> $config_mak |
97a847bc FB |
641 | if test "$cpu" = "i386" ; then |
642 | echo "ARCH=i386" >> $config_mak | |
643 | echo "#define HOST_I386 1" >> $config_h | |
0b0babc6 FB |
644 | elif test "$cpu" = "x86_64" ; then |
645 | echo "ARCH=x86_64" >> $config_mak | |
646 | echo "#define HOST_X86_64 1" >> $config_h | |
808c4954 FB |
647 | elif test "$cpu" = "armv4b" ; then |
648 | echo "ARCH=arm" >> $config_mak | |
649 | echo "#define HOST_ARM 1" >> $config_h | |
7d13299d | 650 | elif test "$cpu" = "armv4l" ; then |
97a847bc FB |
651 | echo "ARCH=arm" >> $config_mak |
652 | echo "#define HOST_ARM 1" >> $config_h | |
7d13299d | 653 | elif test "$cpu" = "powerpc" ; then |
97a847bc FB |
654 | echo "ARCH=ppc" >> $config_mak |
655 | echo "#define HOST_PPC 1" >> $config_h | |
7d13299d | 656 | elif test "$cpu" = "mips" ; then |
97a847bc FB |
657 | echo "ARCH=mips" >> $config_mak |
658 | echo "#define HOST_MIPS 1" >> $config_h | |
fb3e5849 | 659 | elif test "$cpu" = "s390" ; then |
97a847bc FB |
660 | echo "ARCH=s390" >> $config_mak |
661 | echo "#define HOST_S390 1" >> $config_h | |
295defa5 | 662 | elif test "$cpu" = "alpha" ; then |
97a847bc FB |
663 | echo "ARCH=alpha" >> $config_mak |
664 | echo "#define HOST_ALPHA 1" >> $config_h | |
ae228531 | 665 | elif test "$cpu" = "sparc" ; then |
97a847bc FB |
666 | echo "ARCH=sparc" >> $config_mak |
667 | echo "#define HOST_SPARC 1" >> $config_h | |
ae228531 | 668 | elif test "$cpu" = "sparc64" ; then |
97a847bc FB |
669 | echo "ARCH=sparc64" >> $config_mak |
670 | echo "#define HOST_SPARC64 1" >> $config_h | |
a8baa8c5 | 671 | elif test "$cpu" = "ia64" ; then |
97a847bc FB |
672 | echo "ARCH=ia64" >> $config_mak |
673 | echo "#define HOST_IA64 1" >> $config_h | |
38e584a0 | 674 | elif test "$cpu" = "m68k" ; then |
38ca2abc FB |
675 | echo "ARCH=m68k" >> $config_mak |
676 | echo "#define HOST_M68K 1" >> $config_h | |
7d13299d FB |
677 | else |
678 | echo "Unsupported CPU" | |
679 | exit 1 | |
680 | fi | |
681 | if test "$bigendian" = "yes" ; then | |
97a847bc FB |
682 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
683 | echo "#define WORDS_BIGENDIAN 1" >> $config_h | |
684 | fi | |
b6853697 | 685 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
67b915a5 FB |
686 | if test "$mingw32" = "yes" ; then |
687 | echo "CONFIG_WIN32=yes" >> $config_mak | |
11d9f695 | 688 | echo "#define CONFIG_WIN32 1" >> $config_h |
7d3505c5 | 689 | elif test -f "/usr/include/byteswap.h" ; then |
67b915a5 FB |
690 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
691 | fi | |
83fb7adf FB |
692 | if test "$darwin" = "yes" ; then |
693 | echo "CONFIG_DARWIN=yes" >> $config_mak | |
694 | echo "#define CONFIG_DARWIN 1" >> $config_h | |
695 | fi | |
ec530c81 FB |
696 | if test "$solaris" = "yes" ; then |
697 | echo "CONFIG_SOLARIS=yes" >> $config_mak | |
38cfa06c | 698 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
ec530c81 | 699 | fi |
67b915a5 FB |
700 | if test "$gdbstub" = "yes" ; then |
701 | echo "CONFIG_GDBSTUB=yes" >> $config_mak | |
702 | echo "#define CONFIG_GDBSTUB 1" >> $config_h | |
703 | fi | |
97a847bc FB |
704 | if test "$gprof" = "yes" ; then |
705 | echo "TARGET_GPROF=yes" >> $config_mak | |
706 | echo "#define HAVE_GPROF 1" >> $config_h | |
707 | fi | |
708 | if test "$static" = "yes" ; then | |
709 | echo "CONFIG_STATIC=yes" >> $config_mak | |
50863472 | 710 | echo "#define CONFIG_STATIC 1" >> $config_h |
7d13299d | 711 | fi |
05c2a3e7 FB |
712 | if test $profiler = "yes" ; then |
713 | echo "#define CONFIG_PROFILER 1" >> $config_h | |
714 | fi | |
c20709aa FB |
715 | if test "$slirp" = "yes" ; then |
716 | echo "CONFIG_SLIRP=yes" >> $config_mak | |
717 | echo "#define CONFIG_SLIRP 1" >> $config_h | |
718 | fi | |
fb065187 FB |
719 | if test "$adlib" = "yes" ; then |
720 | echo "CONFIG_ADLIB=yes" >> $config_mak | |
721 | echo "#define CONFIG_ADLIB 1" >> $config_h | |
722 | fi | |
723 | if test "$oss" = "yes" ; then | |
724 | echo "CONFIG_OSS=yes" >> $config_mak | |
725 | echo "#define CONFIG_OSS 1" >> $config_h | |
726 | fi | |
1d14ffa9 FB |
727 | if test "$coreaudio" = "yes" ; then |
728 | echo "CONFIG_COREAUDIO=yes" >> $config_mak | |
729 | echo "#define CONFIG_COREAUDIO 1" >> $config_h | |
730 | fi | |
731 | if test "$alsa" = "yes" ; then | |
732 | echo "CONFIG_ALSA=yes" >> $config_mak | |
733 | echo "#define CONFIG_ALSA 1" >> $config_h | |
734 | fi | |
735 | if test "$dsound" = "yes" ; then | |
736 | echo "CONFIG_DSOUND=yes" >> $config_mak | |
737 | echo "#define CONFIG_DSOUND 1" >> $config_h | |
738 | fi | |
102a52e4 FB |
739 | if test "$fmod" = "yes" ; then |
740 | echo "CONFIG_FMOD=yes" >> $config_mak | |
741 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak | |
742 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak | |
743 | echo "#define CONFIG_FMOD 1" >> $config_h | |
744 | fi | |
b1a550a0 PB |
745 | qemu_version=`head $source_path/VERSION` |
746 | echo "VERSION=$qemu_version" >>$config_mak | |
d4b8f039 | 747 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
97a847bc FB |
748 | |
749 | echo "SRC_PATH=$source_path" >> $config_mak | |
ad064840 PB |
750 | if [ "$source_path_used" = "yes" ]; then |
751 | echo "VPATH=$source_path" >> $config_mak | |
752 | fi | |
97a847bc | 753 | echo "TARGET_DIRS=$target_list" >> $config_mak |
cc8ae6de PB |
754 | if [ "$build_docs" = "yes" ] ; then |
755 | echo "BUILD_DOCS=yes" >> $config_mak | |
756 | fi | |
97a847bc | 757 | |
83fb7adf | 758 | # XXX: suppress that |
7d3505c5 | 759 | if [ "$bsd" = "yes" ] ; then |
43003046 | 760 | echo "#define O_LARGEFILE 0" >> $config_h |
43003046 | 761 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
7d3505c5 FB |
762 | echo "#define _BSD 1" >> $config_h |
763 | fi | |
764 | ||
c5937220 PB |
765 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
766 | ||
1d14ffa9 | 767 | for target in $target_list; do |
97a847bc FB |
768 | target_dir="$target" |
769 | config_mak=$target_dir/config.mak | |
770 | config_h=$target_dir/config.h | |
771 | target_cpu=`echo $target | cut -d '-' -f 1` | |
772 | target_bigendian="no" | |
808c4954 | 773 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
1e43adfc | 774 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
64b3ab24 | 775 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes |
67867308 | 776 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
a2458627 | 777 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
d3258560 | 778 | [ "$target_cpu" = "mips" ] && target_bigendian=yes |
908f52b0 | 779 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
e6e5906b | 780 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
97a847bc FB |
781 | target_softmmu="no" |
782 | if expr $target : '.*-softmmu' > /dev/null ; then | |
783 | target_softmmu="yes" | |
784 | fi | |
997344f3 FB |
785 | target_user_only="no" |
786 | if expr $target : '.*-user' > /dev/null ; then | |
787 | target_user_only="yes" | |
788 | fi | |
97a847bc | 789 | |
97ccc689 | 790 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
1d14ffa9 | 791 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
97ccc689 | 792 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
9c038506 | 793 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
97ccc689 FB |
794 | echo "Note that this will disable all output from the virtual graphics card." |
795 | exit 1; | |
796 | fi | |
797 | ||
7c1f25b4 | 798 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
97a847bc FB |
799 | |
800 | mkdir -p $target_dir | |
158142c2 | 801 | mkdir -p $target_dir/fpu |
808c4954 | 802 | if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then |
69de927c FB |
803 | mkdir -p $target_dir/nwfpe |
804 | fi | |
a7e61ed4 FB |
805 | if test "$target_user_only" = "no" ; then |
806 | mkdir -p $target_dir/slirp | |
807 | fi | |
69de927c | 808 | |
ec530c81 FB |
809 | # |
810 | # don't use ln -sf as not all "ln -sf" over write the file/link | |
811 | # | |
812 | rm -f $target_dir/Makefile | |
813 | ln -s $source_path/Makefile.target $target_dir/Makefile | |
814 | ||
97a847bc FB |
815 | |
816 | echo "# Automatically generated by configure - do not modify" > $config_mak | |
817 | echo "/* Automatically generated by configure - do not modify */" > $config_h | |
818 | ||
de83cd02 | 819 | |
97a847bc FB |
820 | echo "include ../config-host.mak" >> $config_mak |
821 | echo "#include \"../config-host.h\"" >> $config_h | |
1e43adfc | 822 | |
e5fe0c52 | 823 | bflt="no" |
1e43adfc FB |
824 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
825 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h | |
97a847bc FB |
826 | |
827 | if test "$target_cpu" = "i386" ; then | |
828 | echo "TARGET_ARCH=i386" >> $config_mak | |
829 | echo "#define TARGET_ARCH \"i386\"" >> $config_h | |
830 | echo "#define TARGET_I386 1" >> $config_h | |
07f4ddbf | 831 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then |
824d560f FB |
832 | echo "#define USE_KQEMU 1" >> $config_h |
833 | fi | |
808c4954 | 834 | elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then |
97a847bc FB |
835 | echo "TARGET_ARCH=arm" >> $config_mak |
836 | echo "#define TARGET_ARCH \"arm\"" >> $config_h | |
837 | echo "#define TARGET_ARM 1" >> $config_h | |
e5fe0c52 | 838 | bflt="yes" |
1e43adfc FB |
839 | elif test "$target_cpu" = "sparc" ; then |
840 | echo "TARGET_ARCH=sparc" >> $config_mak | |
841 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h | |
842 | echo "#define TARGET_SPARC 1" >> $config_h | |
64b3ab24 FB |
843 | elif test "$target_cpu" = "sparc64" ; then |
844 | echo "TARGET_ARCH=sparc64" >> $config_mak | |
845 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h | |
846 | echo "#define TARGET_SPARC 1" >> $config_h | |
847 | echo "#define TARGET_SPARC64 1" >> $config_h | |
67867308 FB |
848 | elif test "$target_cpu" = "ppc" ; then |
849 | echo "TARGET_ARCH=ppc" >> $config_mak | |
850 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h | |
851 | echo "#define TARGET_PPC 1" >> $config_h | |
a2458627 FB |
852 | elif test "$target_cpu" = "ppc64" ; then |
853 | echo "TARGET_ARCH=ppc64" >> $config_mak | |
854 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h | |
855 | echo "#define TARGET_PPC 1" >> $config_h | |
856 | echo "#define TARGET_PPC64 1" >> $config_h | |
0b0babc6 FB |
857 | elif test "$target_cpu" = "x86_64" ; then |
858 | echo "TARGET_ARCH=x86_64" >> $config_mak | |
859 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h | |
860 | echo "#define TARGET_I386 1" >> $config_h | |
861 | echo "#define TARGET_X86_64 1" >> $config_h | |
07f4ddbf FB |
862 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then |
863 | echo "#define USE_KQEMU 1" >> $config_h | |
864 | fi | |
c20eb473 | 865 | elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then |
d3258560 FB |
866 | echo "TARGET_ARCH=mips" >> $config_mak |
867 | echo "#define TARGET_ARCH \"mips\"" >> $config_h | |
868 | echo "#define TARGET_MIPS 1" >> $config_h | |
6ea83fed FB |
869 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
870 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h | |
908f52b0 | 871 | elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then |
fdf9b3e8 FB |
872 | echo "TARGET_ARCH=sh4" >> $config_mak |
873 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h | |
874 | echo "#define TARGET_SH4 1" >> $config_h | |
4dbed897 | 875 | bflt="yes" |
e6e5906b PB |
876 | elif test "$target_cpu" = "m68k" ; then |
877 | echo "TARGET_ARCH=m68k" >> $config_mak | |
878 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h | |
879 | echo "#define TARGET_M68K 1" >> $config_h | |
880 | bflt="yes" | |
de83cd02 FB |
881 | else |
882 | echo "Unsupported target CPU" | |
883 | exit 1 | |
884 | fi | |
885 | if test "$target_bigendian" = "yes" ; then | |
97a847bc FB |
886 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
887 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h | |
de83cd02 | 888 | fi |
97a847bc FB |
889 | if test "$target_softmmu" = "yes" ; then |
890 | echo "CONFIG_SOFTMMU=yes" >> $config_mak | |
891 | echo "#define CONFIG_SOFTMMU 1" >> $config_h | |
43ce4dfe | 892 | fi |
997344f3 FB |
893 | if test "$target_user_only" = "yes" ; then |
894 | echo "CONFIG_USER_ONLY=yes" >> $config_mak | |
895 | echo "#define CONFIG_USER_ONLY 1" >> $config_h | |
896 | fi | |
97a847bc | 897 | |
e6e5906b | 898 | if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then |
158142c2 FB |
899 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
900 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h | |
901 | fi | |
e5fe0c52 PB |
902 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
903 | echo "TARGET_HAS_BFLT=yes" >> $config_mak | |
904 | echo "#define TARGET_HAS_BFLT 1" >> $config_h | |
905 | fi | |
7c1f25b4 FB |
906 | # sdl defines |
907 | ||
908 | if test "$target_user_only" = "no"; then | |
909 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then | |
dbb2c921 | 910 | sdl1=$sdl_static |
7c1f25b4 | 911 | else |
dbb2c921 FB |
912 | sdl1=$sdl |
913 | fi | |
914 | if test "$sdl1" = "yes" ; then | |
915 | echo "#define CONFIG_SDL 1" >> $config_h | |
916 | echo "CONFIG_SDL=yes" >> $config_mak | |
917 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then | |
918 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak | |
919 | else | |
7c1f25b4 FB |
920 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak |
921 | fi | |
dbb2c921 | 922 | if [ "${aa}" = "yes" ] ; then |
b1a550a0 PB |
923 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak |
924 | else | |
925 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak | |
dbb2c921 | 926 | fi |
7c1f25b4 | 927 | fi |
7c1f25b4 FB |
928 | fi |
929 | ||
5b0753e0 FB |
930 | if test "$cocoa" = "yes" ; then |
931 | echo "#define CONFIG_COCOA 1" >> $config_h | |
932 | echo "CONFIG_COCOA=yes" >> $config_mak | |
933 | fi | |
934 | ||
97a847bc | 935 | done # for target in $targets |
7d13299d FB |
936 | |
937 | # build tree in object directory if source path is different from current one | |
938 | if test "$source_path_used" = "yes" ; then | |
939 | DIRS="tests" | |
940 | FILES="Makefile tests/Makefile" | |
941 | for dir in $DIRS ; do | |
942 | mkdir -p $dir | |
943 | done | |
ec530c81 | 944 | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
7d13299d | 945 | for f in $FILES ; do |
ec530c81 FB |
946 | rm -f $f |
947 | ln -s $source_path/$f $f | |
7d13299d FB |
948 | done |
949 | fi | |
7d13299d | 950 | |
97a847bc | 951 | rm -f $TMPO $TMPC $TMPE $TMPS |