]>
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" | |
a91b857c | 16 | TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe" |
7d13299d | 17 | |
0ba8681e LM |
18 | # NB: do not call "exit" in the trap handler; this is buggy with some shells; |
19 | # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> | |
20 | trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM | |
da1d85e3 | 21 | rm -f config.log |
9ac81bbb | 22 | |
b48e3611 PM |
23 | # Print a helpful header at the top of config.log |
24 | echo "# QEMU configure log $(date)" >> config.log | |
979ae168 PM |
25 | printf "# Configured with:" >> config.log |
26 | printf " '%s'" "$0" "$@" >> config.log | |
27 | echo >> config.log | |
b48e3611 PM |
28 | echo "#" >> config.log |
29 | ||
8dc38a78 PM |
30 | do_cc() { |
31 | # Run the compiler, capturing its output to the log. | |
32 | echo $cc "$@" >> config.log | |
33 | $cc "$@" >> config.log 2>&1 || return $? | |
34 | # Test passed. If this is an --enable-werror build, rerun | |
35 | # the test with -Werror and bail out if it fails. This | |
36 | # makes warning-generating-errors in configure test code | |
37 | # obvious to developers. | |
38 | if test "$werror" != "yes"; then | |
39 | return 0 | |
40 | fi | |
41 | # Don't bother rerunning the compile if we were already using -Werror | |
42 | case "$*" in | |
43 | *-Werror*) | |
44 | return 0 | |
45 | ;; | |
46 | esac | |
47 | echo $cc -Werror "$@" >> config.log | |
48 | $cc -Werror "$@" >> config.log 2>&1 && return $? | |
49 | echo "ERROR: configure test passed without -Werror but failed with -Werror." | |
50 | echo "This is probably a bug in the configure script. The failing command" | |
51 | echo "will be at the bottom of config.log." | |
52 | echo "You can run configure with --disable-werror to bypass this check." | |
53 | exit 1 | |
54 | } | |
55 | ||
52166aa0 | 56 | compile_object() { |
8dc38a78 | 57 | do_cc $QEMU_CFLAGS -c -o $TMPO $TMPC |
52166aa0 JQ |
58 | } |
59 | ||
60 | compile_prog() { | |
61 | local_cflags="$1" | |
62 | local_ldflags="$2" | |
8dc38a78 | 63 | do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags |
52166aa0 JQ |
64 | } |
65 | ||
11568d6d PB |
66 | # symbolically link $1 to $2. Portable version of "ln -sf". |
67 | symlink() { | |
72b8b5a1 | 68 | rm -rf "$2" |
ec5b06d7 | 69 | mkdir -p "$(dirname "$2")" |
72b8b5a1 | 70 | ln -s "$1" "$2" |
11568d6d PB |
71 | } |
72 | ||
0dba6195 LM |
73 | # check whether a command is available to this shell (may be either an |
74 | # executable or a builtin) | |
75 | has() { | |
76 | type "$1" >/dev/null 2>&1 | |
77 | } | |
78 | ||
79 | # search for an executable in PATH | |
80 | path_of() { | |
81 | local_command="$1" | |
82 | local_ifs="$IFS" | |
83 | local_dir="" | |
84 | ||
85 | # pathname has a dir component? | |
86 | if [ "${local_command#*/}" != "$local_command" ]; then | |
87 | if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then | |
88 | echo "$local_command" | |
89 | return 0 | |
90 | fi | |
91 | fi | |
92 | if [ -z "$local_command" ]; then | |
93 | return 1 | |
94 | fi | |
95 | ||
96 | IFS=: | |
97 | for local_dir in $PATH; do | |
98 | if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then | |
99 | echo "$local_dir/$local_command" | |
100 | IFS="${local_ifs:-$(printf ' \t\n')}" | |
101 | return 0 | |
102 | fi | |
103 | done | |
104 | # not found | |
105 | IFS="${local_ifs:-$(printf ' \t\n')}" | |
106 | return 1 | |
107 | } | |
108 | ||
7d13299d | 109 | # default parameters |
ca4deeb1 | 110 | source_path=`dirname "$0"` |
2ff6b91e | 111 | cpu="" |
1e43adfc | 112 | interp_prefix="/usr/gnemul/qemu-%M" |
43ce4dfe | 113 | static="no" |
ed968ff1 | 114 | sparc_cpu="" |
7d13299d | 115 | cross_prefix="" |
0c58ac1c | 116 | audio_drv_list="" |
61dc008f AL |
117 | audio_card_list="ac97 es1370 sb16 hda" |
118 | audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda" | |
eb852011 | 119 | block_drv_whitelist="" |
7d13299d | 120 | host_cc="gcc" |
73da375e | 121 | libs_softmmu="" |
3e2e0e6b | 122 | libs_tools="" |
67f86e8e | 123 | audio_pt_int="" |
d5631638 | 124 | audio_win_int="" |
2b2e59e6 | 125 | cc_i386=i386-pc-linux-gnu-gcc |
957f1f99 | 126 | libs_qga="" |
5bc62e01 | 127 | debug_info="yes" |
ac0df51d | 128 | |
377529c0 PB |
129 | target_list="" |
130 | ||
131 | # Default value for a variable defining feature "foo". | |
132 | # * foo="no" feature will only be used if --enable-foo arg is given | |
133 | # * foo="" feature will be searched for, and if found, will be used | |
134 | # unless --disable-foo is given | |
135 | # * foo="yes" this value will only be set by --enable-foo flag. | |
136 | # feature will searched for, | |
137 | # if not found, configure exits with error | |
138 | # | |
139 | # Always add --enable-foo and --disable-foo command line args. | |
140 | # Distributions want to ensure that several features are compiled in, and it | |
141 | # is impossible without a --enable-foo that exits if a feature is not found. | |
142 | ||
143 | bluez="" | |
144 | brlapi="" | |
145 | curl="" | |
146 | curses="" | |
147 | docs="" | |
148 | fdt="" | |
377529c0 PB |
149 | nptl="" |
150 | sdl="" | |
983eef5a | 151 | virtfs="" |
821601ea | 152 | vnc="yes" |
377529c0 PB |
153 | sparse="no" |
154 | uuid="" | |
155 | vde="" | |
156 | vnc_tls="" | |
157 | vnc_sasl="" | |
158 | vnc_jpeg="" | |
159 | vnc_png="" | |
377529c0 | 160 | xen="" |
d5b93ddf | 161 | xen_ctrl_version="" |
eb6fda0f | 162 | xen_pci_passthrough="" |
377529c0 | 163 | linux_aio="" |
47e98658 | 164 | cap_ng="" |
377529c0 | 165 | attr="" |
4f26f2b6 | 166 | libattr="" |
377529c0 PB |
167 | xfs="" |
168 | ||
d41a75a2 B |
169 | vhost_net="no" |
170 | kvm="no" | |
377529c0 PB |
171 | gprof="no" |
172 | debug_tcg="no" | |
377529c0 PB |
173 | debug="no" |
174 | strip_opt="yes" | |
9195b2c2 | 175 | tcg_interpreter="no" |
377529c0 PB |
176 | bigendian="no" |
177 | mingw32="no" | |
178 | EXESUF="" | |
179 | prefix="/usr/local" | |
180 | mandir="\${prefix}/share/man" | |
528ae5b8 | 181 | datadir="\${prefix}/share" |
850da188 | 182 | qemu_docdir="\${prefix}/share/doc/qemu" |
377529c0 | 183 | bindir="\${prefix}/bin" |
3aa5d2be | 184 | libdir="\${prefix}/lib" |
0f94d6da | 185 | includedir="\${prefix}/include" |
377529c0 PB |
186 | sysconfdir="\${prefix}/etc" |
187 | confsuffix="/qemu" | |
188 | slirp="yes" | |
189 | fmod_lib="" | |
190 | fmod_inc="" | |
191 | oss_lib="" | |
192 | bsd="no" | |
193 | linux="no" | |
194 | solaris="no" | |
195 | profiler="no" | |
196 | cocoa="no" | |
197 | softmmu="yes" | |
198 | linux_user="no" | |
377529c0 PB |
199 | bsd_user="no" |
200 | guest_base="" | |
201 | uname_release="" | |
377529c0 | 202 | mixemu="no" |
377529c0 PB |
203 | aix="no" |
204 | blobs="yes" | |
205 | pkgversion="" | |
40d6444e | 206 | pie="" |
377529c0 PB |
207 | zero_malloc="" |
208 | trace_backend="nop" | |
209 | trace_file="trace" | |
210 | spice="" | |
211 | rbd="" | |
36707144 | 212 | smartcard="" |
111a38b0 | 213 | smartcard_nss="" |
69354a83 | 214 | usb_redir="" |
430a3c18 | 215 | opengl="" |
1ece9905 | 216 | zlib="yes" |
d138cee9 | 217 | guest_agent="yes" |
c589b249 | 218 | libiscsi="" |
519175a2 | 219 | coroutine="" |
f794573e | 220 | seccomp="" |
377529c0 | 221 | |
ac0df51d AL |
222 | # parse CC options first |
223 | for opt do | |
224 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` | |
225 | case "$opt" in | |
226 | --cross-prefix=*) cross_prefix="$optarg" | |
227 | ;; | |
3d8df640 | 228 | --cc=*) CC="$optarg" |
ac0df51d | 229 | ;; |
ca4deeb1 PB |
230 | --source-path=*) source_path="$optarg" |
231 | ;; | |
2ff6b91e JQ |
232 | --cpu=*) cpu="$optarg" |
233 | ;; | |
a558ee17 | 234 | --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" |
e2a2ed06 JQ |
235 | ;; |
236 | --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" | |
237 | ;; | |
5bc62e01 GH |
238 | --enable-debug-info) debug_info="yes" |
239 | ;; | |
240 | --disable-debug-info) debug_info="no" | |
241 | ;; | |
50e7b1a0 JQ |
242 | --sparc_cpu=*) |
243 | sparc_cpu="$optarg" | |
244 | case $sparc_cpu in | |
ed968ff1 | 245 | v7|v8|v8plus|v8plusa) |
50e7b1a0 JQ |
246 | cpu="sparc" |
247 | ;; | |
248 | v9) | |
50e7b1a0 JQ |
249 | cpu="sparc64" |
250 | ;; | |
251 | *) | |
252 | echo "undefined SPARC architecture. Exiting"; | |
253 | exit 1 | |
254 | ;; | |
255 | esac | |
256 | ;; | |
ac0df51d AL |
257 | esac |
258 | done | |
ac0df51d AL |
259 | # OS specific |
260 | # Using uname is really, really broken. Once we have the right set of checks | |
93148aa5 | 261 | # we can eliminate its usage altogether. |
ac0df51d | 262 | |
b3198cc2 SY |
263 | cc="${CC-${cross_prefix}gcc}" |
264 | ar="${AR-${cross_prefix}ar}" | |
265 | objcopy="${OBJCOPY-${cross_prefix}objcopy}" | |
266 | ld="${LD-${cross_prefix}ld}" | |
3f534581 | 267 | libtool="${LIBTOOL-${cross_prefix}libtool}" |
b3198cc2 SY |
268 | strip="${STRIP-${cross_prefix}strip}" |
269 | windres="${WINDRES-${cross_prefix}windres}" | |
17884d7b ST |
270 | pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" |
271 | query_pkg_config() { | |
272 | "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" | |
273 | } | |
274 | pkg_config=query_pkg_config | |
b3198cc2 | 275 | sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" |
ac0df51d | 276 | |
be17dc90 MT |
277 | # default flags for all hosts |
278 | QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" | |
f9188227 | 279 | QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
be17dc90 MT |
280 | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
281 | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" | |
cbbab922 | 282 | QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" |
5bc62e01 GH |
283 | if test "$debug_info" = "yes"; then |
284 | CFLAGS="-g $CFLAGS" | |
285 | LDFLAGS="-g $LDFLAGS" | |
286 | fi | |
be17dc90 | 287 | |
ca4deeb1 PB |
288 | # make source path absolute |
289 | source_path=`cd "$source_path"; pwd` | |
290 | ||
ac0df51d AL |
291 | check_define() { |
292 | cat > $TMPC <<EOF | |
293 | #if !defined($1) | |
fd786e1a | 294 | #error $1 not defined |
ac0df51d AL |
295 | #endif |
296 | int main(void) { return 0; } | |
297 | EOF | |
52166aa0 | 298 | compile_object |
ac0df51d AL |
299 | } |
300 | ||
bbea4050 PM |
301 | if check_define __linux__ ; then |
302 | targetos="Linux" | |
303 | elif check_define _WIN32 ; then | |
304 | targetos='MINGW32' | |
305 | elif check_define __OpenBSD__ ; then | |
306 | targetos='OpenBSD' | |
307 | elif check_define __sun__ ; then | |
308 | targetos='SunOS' | |
309 | elif check_define __HAIKU__ ; then | |
310 | targetos='Haiku' | |
311 | else | |
312 | targetos=`uname -s` | |
313 | fi | |
314 | ||
315 | # Some host OSes need non-standard checks for which CPU to use. | |
316 | # Note that these checks are broken for cross-compilation: if you're | |
317 | # cross-compiling to one of these OSes then you'll need to specify | |
318 | # the correct CPU with the --cpu option. | |
319 | case $targetos in | |
320 | Darwin) | |
321 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can | |
322 | # run 64-bit userspace code. | |
323 | # If the user didn't specify a CPU explicitly and the kernel says this is | |
324 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. | |
325 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then | |
326 | cpu="x86_64" | |
327 | fi | |
328 | ;; | |
329 | SunOS) | |
330 | # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo | |
331 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then | |
332 | cpu="x86_64" | |
333 | fi | |
334 | esac | |
335 | ||
2ff6b91e JQ |
336 | if test ! -z "$cpu" ; then |
337 | # command line argument | |
338 | : | |
339 | elif check_define __i386__ ; then | |
ac0df51d AL |
340 | cpu="i386" |
341 | elif check_define __x86_64__ ; then | |
342 | cpu="x86_64" | |
3aa9bd6c BS |
343 | elif check_define __sparc__ ; then |
344 | # We can't check for 64 bit (when gcc is biarch) or V8PLUSA | |
345 | # They must be specified using --sparc_cpu | |
346 | if check_define __arch64__ ; then | |
347 | cpu="sparc64" | |
348 | else | |
349 | cpu="sparc" | |
350 | fi | |
fdf7ed96 | 351 | elif check_define _ARCH_PPC ; then |
352 | if check_define _ARCH_PPC64 ; then | |
353 | cpu="ppc64" | |
354 | else | |
355 | cpu="ppc" | |
356 | fi | |
afa05235 AJ |
357 | elif check_define __mips__ ; then |
358 | cpu="mips" | |
477ba620 AJ |
359 | elif check_define __ia64__ ; then |
360 | cpu="ia64" | |
d66ed0ea AJ |
361 | elif check_define __s390__ ; then |
362 | if check_define __s390x__ ; then | |
363 | cpu="s390x" | |
364 | else | |
365 | cpu="s390" | |
366 | fi | |
21d89f84 PM |
367 | elif check_define __arm__ ; then |
368 | cpu="arm" | |
f28ffed5 B |
369 | elif check_define __hppa__ ; then |
370 | cpu="hppa" | |
ac0df51d | 371 | else |
fdf7ed96 | 372 | cpu=`uname -m` |
ac0df51d AL |
373 | fi |
374 | ||
359bc95d PM |
375 | ARCH= |
376 | # Normalise host CPU name and set ARCH. | |
377 | # Note that this case should only have supported host CPUs, not guests. | |
7d13299d | 378 | case "$cpu" in |
359bc95d | 379 | ia64|ppc|ppc64|s390|s390x|sparc64) |
ea8f20f8 JQ |
380 | cpu="$cpu" |
381 | ;; | |
7d13299d | 382 | i386|i486|i586|i686|i86pc|BePC) |
97a847bc | 383 | cpu="i386" |
7d13299d | 384 | ;; |
aaa5fa14 AJ |
385 | x86_64|amd64) |
386 | cpu="x86_64" | |
387 | ;; | |
21d89f84 PM |
388 | armv*b|armv*l|arm) |
389 | cpu="arm" | |
7d13299d | 390 | ;; |
f28ffed5 | 391 | hppa|parisc|parisc64) |
f54b3f92 AJ |
392 | cpu="hppa" |
393 | ;; | |
afa05235 AJ |
394 | mips*) |
395 | cpu="mips" | |
396 | ;; | |
3142255c | 397 | sparc|sun4[cdmuv]) |
ae228531 FB |
398 | cpu="sparc" |
399 | ;; | |
7d13299d | 400 | *) |
359bc95d PM |
401 | # This will result in either an error or falling back to TCI later |
402 | ARCH=unknown | |
7d13299d FB |
403 | ;; |
404 | esac | |
359bc95d PM |
405 | if test -z "$ARCH"; then |
406 | ARCH="$cpu" | |
407 | fi | |
e2d52ad3 | 408 | |
7d13299d | 409 | # OS specific |
0dbfc675 | 410 | |
7d13299d | 411 | case $targetos in |
c326e0af | 412 | CYGWIN*) |
0dbfc675 | 413 | mingw32="yes" |
a558ee17 | 414 | QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" |
d5631638 | 415 | audio_possible_drivers="winwave sdl" |
416 | audio_drv_list="winwave" | |
c326e0af | 417 | ;; |
67b915a5 | 418 | MINGW32*) |
0dbfc675 | 419 | mingw32="yes" |
d5631638 | 420 | audio_possible_drivers="winwave dsound sdl fmod" |
421 | audio_drv_list="winwave" | |
67b915a5 | 422 | ;; |
5c40d2bd | 423 | GNU/kFreeBSD) |
a167ba50 | 424 | bsd="yes" |
0dbfc675 JQ |
425 | audio_drv_list="oss" |
426 | audio_possible_drivers="oss sdl esd pa" | |
5c40d2bd | 427 | ;; |
7d3505c5 | 428 | FreeBSD) |
0dbfc675 | 429 | bsd="yes" |
0db4a067 | 430 | make="${MAKE-gmake}" |
0dbfc675 JQ |
431 | audio_drv_list="oss" |
432 | audio_possible_drivers="oss sdl esd pa" | |
f01576f1 JL |
433 | # needed for kinfo_getvmmap(3) in libutil.h |
434 | LIBS="-lutil $LIBS" | |
7d3505c5 | 435 | ;; |
c5e97233 | 436 | DragonFly) |
0dbfc675 | 437 | bsd="yes" |
0db4a067 | 438 | make="${MAKE-gmake}" |
0dbfc675 JQ |
439 | audio_drv_list="oss" |
440 | audio_possible_drivers="oss sdl esd pa" | |
c5e97233 | 441 | ;; |
7d3505c5 | 442 | NetBSD) |
0dbfc675 | 443 | bsd="yes" |
0db4a067 | 444 | make="${MAKE-gmake}" |
0dbfc675 JQ |
445 | audio_drv_list="oss" |
446 | audio_possible_drivers="oss sdl esd" | |
447 | oss_lib="-lossaudio" | |
7d3505c5 FB |
448 | ;; |
449 | OpenBSD) | |
0dbfc675 | 450 | bsd="yes" |
0db4a067 | 451 | make="${MAKE-gmake}" |
0dbfc675 JQ |
452 | audio_drv_list="oss" |
453 | audio_possible_drivers="oss sdl esd" | |
454 | oss_lib="-lossaudio" | |
7d3505c5 | 455 | ;; |
83fb7adf | 456 | Darwin) |
0dbfc675 JQ |
457 | bsd="yes" |
458 | darwin="yes" | |
0dbfc675 | 459 | if [ "$cpu" = "x86_64" ] ; then |
a558ee17 | 460 | QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" |
0c439cbf | 461 | LDFLAGS="-arch x86_64 $LDFLAGS" |
0dbfc675 | 462 | else |
a558ee17 | 463 | QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" |
0dbfc675 | 464 | fi |
0dbfc675 JQ |
465 | cocoa="yes" |
466 | audio_drv_list="coreaudio" | |
467 | audio_possible_drivers="coreaudio sdl fmod" | |
468 | LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" | |
7973f21c | 469 | libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" |
a0b7cf6b PM |
470 | # Disable attempts to use ObjectiveC features in os/object.h since they |
471 | # won't work when we're compiling with gcc as a C compiler. | |
472 | QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" | |
83fb7adf | 473 | ;; |
ec530c81 | 474 | SunOS) |
0dbfc675 | 475 | solaris="yes" |
0db4a067 PB |
476 | make="${MAKE-gmake}" |
477 | install="${INSTALL-ginstall}" | |
fa58948d | 478 | ld="gld" |
e2d8830e | 479 | smbd="${SMBD-/usr/sfw/sbin/smbd}" |
0dbfc675 JQ |
480 | needs_libsunmath="no" |
481 | solarisrev=`uname -r | cut -f2 -d.` | |
0dbfc675 JQ |
482 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
483 | if test "$solarisrev" -le 9 ; then | |
484 | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then | |
485 | needs_libsunmath="yes" | |
f14bfdf9 JQ |
486 | QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" |
487 | LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" | |
488 | LIBS="-lsunmath $LIBS" | |
0dbfc675 JQ |
489 | else |
490 | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" | |
491 | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" | |
492 | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" | |
493 | echo "Studio 11 can be downloaded from www.sun.com." | |
494 | exit 1 | |
495 | fi | |
86b2bd93 | 496 | fi |
0dbfc675 JQ |
497 | fi |
498 | if test -f /usr/include/sys/soundcard.h ; then | |
499 | audio_drv_list="oss" | |
500 | fi | |
501 | audio_possible_drivers="oss sdl" | |
d741429a BS |
502 | # needed for CMSG_ macros in sys/socket.h |
503 | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" | |
504 | # needed for TIOCWIN* defines in termios.h | |
505 | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" | |
a558ee17 | 506 | QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" |
560d375f AF |
507 | solarisnetlibs="-lsocket -lnsl -lresolv" |
508 | LIBS="$solarisnetlibs $LIBS" | |
509 | libs_qga="$solarisnetlibs $libs_qga" | |
86b2bd93 | 510 | ;; |
b29fe3ed | 511 | AIX) |
0dbfc675 | 512 | aix="yes" |
0db4a067 | 513 | make="${MAKE-gmake}" |
b29fe3ed | 514 | ;; |
179cf400 AF |
515 | Haiku) |
516 | haiku="yes" | |
517 | QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" | |
518 | LIBS="-lposix_error_mapper -lnetwork $LIBS" | |
519 | ;; | |
1d14ffa9 | 520 | *) |
0dbfc675 JQ |
521 | audio_drv_list="oss" |
522 | audio_possible_drivers="oss alsa sdl esd pa" | |
523 | linux="yes" | |
524 | linux_user="yes" | |
525 | usb="linux" | |
af2be207 JK |
526 | kvm="yes" |
527 | vhost_net="yes" | |
0dbfc675 | 528 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
c2de5c91 | 529 | audio_possible_drivers="$audio_possible_drivers fmod" |
0dbfc675 | 530 | fi |
fb065187 | 531 | ;; |
7d13299d FB |
532 | esac |
533 | ||
7d3505c5 | 534 | if [ "$bsd" = "yes" ] ; then |
b1a550a0 | 535 | if [ "$darwin" != "yes" ] ; then |
68063649 | 536 | usb="bsd" |
08de3949 | 537 | bsd_user="yes" |
83fb7adf | 538 | fi |
7d3505c5 FB |
539 | fi |
540 | ||
0db4a067 PB |
541 | : ${make=${MAKE-make}} |
542 | : ${install=${INSTALL-install}} | |
c886edfb | 543 | : ${python=${PYTHON-python}} |
e2d8830e | 544 | : ${smbd=${SMBD-/usr/sbin/smbd}} |
0db4a067 | 545 | |
3c4a4d0d PM |
546 | # Default objcc to clang if available, otherwise use CC |
547 | if has clang; then | |
548 | objcc=clang | |
549 | else | |
550 | objcc="$cc" | |
551 | fi | |
552 | ||
3457a3f8 | 553 | if test "$mingw32" = "yes" ; then |
3457a3f8 | 554 | EXESUF=".exe" |
a558ee17 | 555 | QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" |
e94a7936 SW |
556 | # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) |
557 | QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" | |
f7cf5d5b SW |
558 | LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" |
559 | cat > $TMPC << EOF | |
560 | int main(void) { return 0; } | |
561 | EOF | |
562 | if compile_prog "" "-liberty" ; then | |
563 | LIBS="-liberty $LIBS" | |
564 | fi | |
c5ec15ea | 565 | prefix="c:/Program Files/QEMU" |
683035de | 566 | mandir="\${prefix}" |
528ae5b8 | 567 | datadir="\${prefix}" |
850da188 | 568 | qemu_docdir="\${prefix}" |
683035de PB |
569 | bindir="\${prefix}" |
570 | sysconfdir="\${prefix}" | |
571 | confsuffix="" | |
368542b8 | 572 | libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" |
3457a3f8 JQ |
573 | fi |
574 | ||
487fefdb | 575 | werror="" |
85aa5189 | 576 | |
7d13299d | 577 | for opt do |
a46e4035 | 578 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
7d13299d | 579 | case "$opt" in |
2efc3265 FB |
580 | --help|-h) show_help=yes |
581 | ;; | |
99123e13 MF |
582 | --version|-V) exec cat $source_path/VERSION |
583 | ;; | |
b1a550a0 | 584 | --prefix=*) prefix="$optarg" |
7d13299d | 585 | ;; |
b1a550a0 | 586 | --interp-prefix=*) interp_prefix="$optarg" |
32ce6337 | 587 | ;; |
ca4deeb1 | 588 | --source-path=*) |
7d13299d | 589 | ;; |
ac0df51d | 590 | --cross-prefix=*) |
7d13299d | 591 | ;; |
ac0df51d | 592 | --cc=*) |
7d13299d | 593 | ;; |
b1a550a0 | 594 | --host-cc=*) host_cc="$optarg" |
83469015 | 595 | ;; |
3c4a4d0d PM |
596 | --objcc=*) objcc="$optarg" |
597 | ;; | |
b1a550a0 | 598 | --make=*) make="$optarg" |
7d13299d | 599 | ;; |
6a882643 PB |
600 | --install=*) install="$optarg" |
601 | ;; | |
c886edfb BS |
602 | --python=*) python="$optarg" |
603 | ;; | |
e2d8830e B |
604 | --smbd=*) smbd="$optarg" |
605 | ;; | |
e2a2ed06 | 606 | --extra-cflags=*) |
7d13299d | 607 | ;; |
e2a2ed06 | 608 | --extra-ldflags=*) |
7d13299d | 609 | ;; |
5bc62e01 GH |
610 | --enable-debug-info) |
611 | ;; | |
612 | --disable-debug-info) | |
613 | ;; | |
2ff6b91e | 614 | --cpu=*) |
7d13299d | 615 | ;; |
b1a550a0 | 616 | --target-list=*) target_list="$optarg" |
de83cd02 | 617 | ;; |
74242e0f | 618 | --enable-trace-backend=*) trace_backend="$optarg" |
94a420b1 | 619 | ;; |
74242e0f | 620 | --with-trace-file=*) trace_file="$optarg" |
9410b56c | 621 | ;; |
7d13299d FB |
622 | --enable-gprof) gprof="yes" |
623 | ;; | |
79427693 LM |
624 | --static) |
625 | static="yes" | |
626 | LDFLAGS="-static $LDFLAGS" | |
17884d7b | 627 | QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" |
43ce4dfe | 628 | ;; |
0b24e75f PB |
629 | --mandir=*) mandir="$optarg" |
630 | ;; | |
631 | --bindir=*) bindir="$optarg" | |
632 | ;; | |
3aa5d2be AL |
633 | --libdir=*) libdir="$optarg" |
634 | ;; | |
0f94d6da AL |
635 | --includedir=*) includedir="$optarg" |
636 | ;; | |
528ae5b8 | 637 | --datadir=*) datadir="$optarg" |
0b24e75f | 638 | ;; |
023d3d67 EH |
639 | --with-confsuffix=*) confsuffix="$optarg" |
640 | ;; | |
850da188 | 641 | --docdir=*) qemu_docdir="$optarg" |
0b24e75f | 642 | ;; |
ca2fb938 | 643 | --sysconfdir=*) sysconfdir="$optarg" |
07381cc1 | 644 | ;; |
023ddd74 MF |
645 | --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\ |
646 | --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ | |
647 | --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) | |
648 | # These switches are silently ignored, for compatibility with | |
649 | # autoconf-generated configure scripts. This allows QEMU's | |
650 | # configure to be used by RPM and similar macros that set | |
651 | # lots of directory switches by default. | |
652 | ;; | |
97a847bc FB |
653 | --disable-sdl) sdl="no" |
654 | ;; | |
c4198157 JQ |
655 | --enable-sdl) sdl="yes" |
656 | ;; | |
983eef5a MI |
657 | --disable-virtfs) virtfs="no" |
658 | ;; | |
659 | --enable-virtfs) virtfs="yes" | |
660 | ;; | |
821601ea JS |
661 | --disable-vnc) vnc="no" |
662 | ;; | |
663 | --enable-vnc) vnc="yes" | |
664 | ;; | |
0c58ac1c | 665 | --fmod-lib=*) fmod_lib="$optarg" |
1d14ffa9 | 666 | ;; |
c2de5c91 | 667 | --fmod-inc=*) fmod_inc="$optarg" |
668 | ;; | |
2f6a1ab0 BS |
669 | --oss-lib=*) oss_lib="$optarg" |
670 | ;; | |
2fa7d3bf | 671 | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
102a52e4 | 672 | ;; |
0c58ac1c | 673 | --audio-drv-list=*) audio_drv_list="$optarg" |
102a52e4 | 674 | ;; |
eb852011 MA |
675 | --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` |
676 | ;; | |
f8393946 AJ |
677 | --enable-debug-tcg) debug_tcg="yes" |
678 | ;; | |
679 | --disable-debug-tcg) debug_tcg="no" | |
680 | ;; | |
f3d08ee6 PB |
681 | --enable-debug) |
682 | # Enable debugging options that aren't excessively noisy | |
683 | debug_tcg="yes" | |
684 | debug="yes" | |
685 | strip_opt="no" | |
686 | ;; | |
03b4fe7d AL |
687 | --enable-sparse) sparse="yes" |
688 | ;; | |
689 | --disable-sparse) sparse="no" | |
690 | ;; | |
1625af87 AL |
691 | --disable-strip) strip_opt="no" |
692 | ;; | |
8d5d2d4c TS |
693 | --disable-vnc-tls) vnc_tls="no" |
694 | ;; | |
1be10ad2 JQ |
695 | --enable-vnc-tls) vnc_tls="yes" |
696 | ;; | |
2f9606b3 AL |
697 | --disable-vnc-sasl) vnc_sasl="no" |
698 | ;; | |
ea784e3b JQ |
699 | --enable-vnc-sasl) vnc_sasl="yes" |
700 | ;; | |
2f6f5c7a CC |
701 | --disable-vnc-jpeg) vnc_jpeg="no" |
702 | ;; | |
703 | --enable-vnc-jpeg) vnc_jpeg="yes" | |
704 | ;; | |
efe556ad CC |
705 | --disable-vnc-png) vnc_png="no" |
706 | ;; | |
707 | --enable-vnc-png) vnc_png="yes" | |
708 | ;; | |
443f1376 | 709 | --disable-slirp) slirp="no" |
1d14ffa9 | 710 | ;; |
ee682d27 SW |
711 | --disable-uuid) uuid="no" |
712 | ;; | |
713 | --enable-uuid) uuid="yes" | |
714 | ;; | |
e0e6c8c0 | 715 | --disable-vde) vde="no" |
8a16d273 | 716 | ;; |
dfb278bd JQ |
717 | --enable-vde) vde="yes" |
718 | ;; | |
e37630ca AL |
719 | --disable-xen) xen="no" |
720 | ;; | |
fc321b4b JQ |
721 | --enable-xen) xen="yes" |
722 | ;; | |
eb6fda0f AP |
723 | --disable-xen-pci-passthrough) xen_pci_passthrough="no" |
724 | ;; | |
725 | --enable-xen-pci-passthrough) xen_pci_passthrough="yes" | |
726 | ;; | |
2e4d9fb1 AJ |
727 | --disable-brlapi) brlapi="no" |
728 | ;; | |
4ffcedb6 JQ |
729 | --enable-brlapi) brlapi="yes" |
730 | ;; | |
fb599c9a AZ |
731 | --disable-bluez) bluez="no" |
732 | ;; | |
a20a6f46 JQ |
733 | --enable-bluez) bluez="yes" |
734 | ;; | |
7ba1e619 AL |
735 | --disable-kvm) kvm="no" |
736 | ;; | |
b31a0277 JQ |
737 | --enable-kvm) kvm="yes" |
738 | ;; | |
9195b2c2 SW |
739 | --disable-tcg-interpreter) tcg_interpreter="no" |
740 | ;; | |
741 | --enable-tcg-interpreter) tcg_interpreter="yes" | |
742 | ;; | |
47e98658 CB |
743 | --disable-cap-ng) cap_ng="no" |
744 | ;; | |
745 | --enable-cap-ng) cap_ng="yes" | |
746 | ;; | |
cd4ec0b4 GH |
747 | --disable-spice) spice="no" |
748 | ;; | |
749 | --enable-spice) spice="yes" | |
750 | ;; | |
c589b249 RS |
751 | --disable-libiscsi) libiscsi="no" |
752 | ;; | |
753 | --enable-libiscsi) libiscsi="yes" | |
754 | ;; | |
05c2a3e7 FB |
755 | --enable-profiler) profiler="yes" |
756 | ;; | |
14821030 PB |
757 | --disable-cocoa) cocoa="no" |
758 | ;; | |
c2de5c91 | 759 | --enable-cocoa) |
760 | cocoa="yes" ; | |
761 | sdl="no" ; | |
762 | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" | |
1d14ffa9 | 763 | ;; |
cad25d69 | 764 | --disable-system) softmmu="no" |
0a8e90f4 | 765 | ;; |
cad25d69 | 766 | --enable-system) softmmu="yes" |
0a8e90f4 | 767 | ;; |
0953a80f ZA |
768 | --disable-user) |
769 | linux_user="no" ; | |
770 | bsd_user="no" ; | |
0953a80f ZA |
771 | ;; |
772 | --enable-user) ;; | |
831b7825 | 773 | --disable-linux-user) linux_user="no" |
0a8e90f4 | 774 | ;; |
831b7825 TS |
775 | --enable-linux-user) linux_user="yes" |
776 | ;; | |
84778508 BS |
777 | --disable-bsd-user) bsd_user="no" |
778 | ;; | |
779 | --enable-bsd-user) bsd_user="yes" | |
780 | ;; | |
379f6698 PB |
781 | --enable-guest-base) guest_base="yes" |
782 | ;; | |
783 | --disable-guest-base) guest_base="no" | |
784 | ;; | |
40d6444e | 785 | --enable-pie) pie="yes" |
34005a00 | 786 | ;; |
40d6444e | 787 | --disable-pie) pie="no" |
34005a00 | 788 | ;; |
c5937220 PB |
789 | --enable-uname-release=*) uname_release="$optarg" |
790 | ;; | |
3142255c | 791 | --sparc_cpu=*) |
3142255c | 792 | ;; |
85aa5189 FB |
793 | --enable-werror) werror="yes" |
794 | ;; | |
795 | --disable-werror) werror="no" | |
796 | ;; | |
4d3b6f6e AZ |
797 | --disable-curses) curses="no" |
798 | ;; | |
c584a6d0 JQ |
799 | --enable-curses) curses="yes" |
800 | ;; | |
769ce76d AG |
801 | --disable-curl) curl="no" |
802 | ;; | |
788c8196 JQ |
803 | --enable-curl) curl="yes" |
804 | ;; | |
2df87df7 JQ |
805 | --disable-fdt) fdt="no" |
806 | ;; | |
807 | --enable-fdt) fdt="yes" | |
808 | ;; | |
bd0c5661 PB |
809 | --disable-nptl) nptl="no" |
810 | ;; | |
b0a47e79 JQ |
811 | --enable-nptl) nptl="yes" |
812 | ;; | |
8ff9cbf7 | 813 | --enable-mixemu) mixemu="yes" |
814 | ;; | |
5c6c3a6c CH |
815 | --disable-linux-aio) linux_aio="no" |
816 | ;; | |
817 | --enable-linux-aio) linux_aio="yes" | |
818 | ;; | |
758e8e38 VJJ |
819 | --disable-attr) attr="no" |
820 | ;; | |
821 | --enable-attr) attr="yes" | |
822 | ;; | |
77755340 TS |
823 | --disable-blobs) blobs="no" |
824 | ;; | |
4a19f1ec PB |
825 | --with-pkgversion=*) pkgversion=" ($optarg)" |
826 | ;; | |
519175a2 AB |
827 | --with-coroutine=*) coroutine="$optarg" |
828 | ;; | |
a25dba17 | 829 | --disable-docs) docs="no" |
70ec5dc0 | 830 | ;; |
a25dba17 | 831 | --enable-docs) docs="yes" |
83a3ab8b | 832 | ;; |
d5970055 MT |
833 | --disable-vhost-net) vhost_net="no" |
834 | ;; | |
835 | --enable-vhost-net) vhost_net="yes" | |
836 | ;; | |
20ff075b MW |
837 | --disable-opengl) opengl="no" |
838 | ;; | |
839 | --enable-opengl) opengl="yes" | |
840 | ;; | |
f27aaf4b CB |
841 | --disable-rbd) rbd="no" |
842 | ;; | |
843 | --enable-rbd) rbd="yes" | |
844 | ;; | |
8c84cf11 ST |
845 | --disable-xfsctl) xfs="no" |
846 | ;; | |
847 | --enable-xfsctl) xfs="yes" | |
848 | ;; | |
36707144 AL |
849 | --disable-smartcard) smartcard="no" |
850 | ;; | |
851 | --enable-smartcard) smartcard="yes" | |
852 | ;; | |
111a38b0 RR |
853 | --disable-smartcard-nss) smartcard_nss="no" |
854 | ;; | |
855 | --enable-smartcard-nss) smartcard_nss="yes" | |
856 | ;; | |
69354a83 HG |
857 | --disable-usb-redir) usb_redir="no" |
858 | ;; | |
859 | --enable-usb-redir) usb_redir="yes" | |
860 | ;; | |
1ece9905 AL |
861 | --disable-zlib-test) zlib="no" |
862 | ;; | |
d138cee9 MR |
863 | --enable-guest-agent) guest_agent="yes" |
864 | ;; | |
865 | --disable-guest-agent) guest_agent="no" | |
866 | ;; | |
f794573e EO |
867 | --enable-seccomp) seccomp="yes" |
868 | ;; | |
869 | --disable-seccomp) seccomp="no" | |
870 | ;; | |
7f1559c6 AZ |
871 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
872 | ;; | |
7d13299d FB |
873 | esac |
874 | done | |
875 | ||
3142255c BS |
876 | # |
877 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right | |
a558ee17 | 878 | # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
3142255c | 879 | # |
379f6698 | 880 | host_guest_base="no" |
40293e58 | 881 | case "$cpu" in |
ed968ff1 JQ |
882 | sparc) case $sparc_cpu in |
883 | v7|v8) | |
a558ee17 | 884 | QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
ed968ff1 JQ |
885 | ;; |
886 | v8plus|v8plusa) | |
a558ee17 | 887 | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
ed968ff1 JQ |
888 | ;; |
889 | *) # sparc_cpu not defined in the command line | |
a558ee17 | 890 | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" |
ed968ff1 JQ |
891 | esac |
892 | LDFLAGS="-m32 $LDFLAGS" | |
a558ee17 | 893 | QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS" |
762e8230 | 894 | if test "$solaris" = "no" ; then |
a558ee17 | 895 | QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS" |
762e8230 | 896 | fi |
3142255c | 897 | ;; |
ed968ff1 | 898 | sparc64) |
a558ee17 | 899 | QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" |
ed968ff1 | 900 | LDFLAGS="-m64 $LDFLAGS" |
a558ee17 | 901 | QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" |
ed968ff1 | 902 | if test "$solaris" != "no" ; then |
a558ee17 | 903 | QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS" |
762e8230 | 904 | fi |
3142255c | 905 | ;; |
76d83bde | 906 | s390) |
28d7cc49 RH |
907 | QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS" |
908 | LDFLAGS="-m31 $LDFLAGS" | |
48bb3750 | 909 | host_guest_base="yes" |
28d7cc49 RH |
910 | ;; |
911 | s390x) | |
912 | QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS" | |
913 | LDFLAGS="-m64 $LDFLAGS" | |
48bb3750 | 914 | host_guest_base="yes" |
76d83bde | 915 | ;; |
40293e58 | 916 | i386) |
a558ee17 | 917 | QEMU_CFLAGS="-m32 $QEMU_CFLAGS" |
0c439cbf | 918 | LDFLAGS="-m32 $LDFLAGS" |
2b2e59e6 | 919 | cc_i386='$(CC) -m32' |
379f6698 | 920 | host_guest_base="yes" |
40293e58 FB |
921 | ;; |
922 | x86_64) | |
a558ee17 | 923 | QEMU_CFLAGS="-m64 $QEMU_CFLAGS" |
0c439cbf | 924 | LDFLAGS="-m64 $LDFLAGS" |
2b2e59e6 | 925 | cc_i386='$(CC) -m32' |
379f6698 PB |
926 | host_guest_base="yes" |
927 | ;; | |
928 | arm*) | |
929 | host_guest_base="yes" | |
40293e58 | 930 | ;; |
f6548c0a | 931 | ppc*) |
932 | host_guest_base="yes" | |
933 | ;; | |
cc01cc8e AJ |
934 | mips*) |
935 | host_guest_base="yes" | |
936 | ;; | |
477ba620 AJ |
937 | ia64*) |
938 | host_guest_base="yes" | |
939 | ;; | |
fd76e73a RH |
940 | hppa*) |
941 | host_guest_base="yes" | |
942 | ;; | |
d2fbca94 GX |
943 | unicore32*) |
944 | host_guest_base="yes" | |
945 | ;; | |
3142255c BS |
946 | esac |
947 | ||
379f6698 PB |
948 | [ -z "$guest_base" ] && guest_base="$host_guest_base" |
949 | ||
60e0df25 PM |
950 | |
951 | default_target_list="" | |
952 | ||
953 | # these targets are portable | |
954 | if [ "$softmmu" = "yes" ] ; then | |
955 | default_target_list="\ | |
956 | i386-softmmu \ | |
957 | x86_64-softmmu \ | |
27cdad67 | 958 | alpha-softmmu \ |
60e0df25 PM |
959 | arm-softmmu \ |
960 | cris-softmmu \ | |
961 | lm32-softmmu \ | |
962 | m68k-softmmu \ | |
963 | microblaze-softmmu \ | |
964 | microblazeel-softmmu \ | |
965 | mips-softmmu \ | |
966 | mipsel-softmmu \ | |
967 | mips64-softmmu \ | |
968 | mips64el-softmmu \ | |
e67db06e | 969 | or32-softmmu \ |
60e0df25 PM |
970 | ppc-softmmu \ |
971 | ppcemb-softmmu \ | |
972 | ppc64-softmmu \ | |
973 | sh4-softmmu \ | |
974 | sh4eb-softmmu \ | |
975 | sparc-softmmu \ | |
976 | sparc64-softmmu \ | |
0f3301d4 | 977 | s390x-softmmu \ |
cfa550c6 MF |
978 | xtensa-softmmu \ |
979 | xtensaeb-softmmu \ | |
4f23a1e6 | 980 | unicore32-softmmu \ |
60e0df25 PM |
981 | " |
982 | fi | |
983 | # the following are Linux specific | |
984 | if [ "$linux_user" = "yes" ] ; then | |
985 | default_target_list="${default_target_list}\ | |
986 | i386-linux-user \ | |
987 | x86_64-linux-user \ | |
988 | alpha-linux-user \ | |
989 | arm-linux-user \ | |
990 | armeb-linux-user \ | |
991 | cris-linux-user \ | |
992 | m68k-linux-user \ | |
993 | microblaze-linux-user \ | |
994 | microblazeel-linux-user \ | |
995 | mips-linux-user \ | |
996 | mipsel-linux-user \ | |
d962783e | 997 | or32-linux-user \ |
60e0df25 PM |
998 | ppc-linux-user \ |
999 | ppc64-linux-user \ | |
1000 | ppc64abi32-linux-user \ | |
1001 | sh4-linux-user \ | |
1002 | sh4eb-linux-user \ | |
1003 | sparc-linux-user \ | |
1004 | sparc64-linux-user \ | |
1005 | sparc32plus-linux-user \ | |
1006 | unicore32-linux-user \ | |
0f3301d4 | 1007 | s390x-linux-user \ |
60e0df25 PM |
1008 | " |
1009 | fi | |
60e0df25 PM |
1010 | # the following are BSD specific |
1011 | if [ "$bsd_user" = "yes" ] ; then | |
1012 | default_target_list="${default_target_list}\ | |
1013 | i386-bsd-user \ | |
1014 | x86_64-bsd-user \ | |
1015 | sparc-bsd-user \ | |
1016 | sparc64-bsd-user \ | |
1017 | " | |
1018 | fi | |
1019 | ||
af5db58e PB |
1020 | if test x"$show_help" = x"yes" ; then |
1021 | cat << EOF | |
1022 | ||
1023 | Usage: configure [options] | |
1024 | Options: [defaults in brackets after descriptions] | |
1025 | ||
1026 | EOF | |
1027 | echo "Standard options:" | |
1028 | echo " --help print this message" | |
1029 | echo " --prefix=PREFIX install in PREFIX [$prefix]" | |
1030 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." | |
1031 | echo " use %M for cpu name [$interp_prefix]" | |
60e0df25 PM |
1032 | echo " --target-list=LIST set target list (default: build everything)" |
1033 | echo "Available targets: $default_target_list" | \ | |
1034 | fold -s -w 53 | sed -e 's/^/ /' | |
af5db58e | 1035 | echo "" |
af5db58e PB |
1036 | echo "Advanced options (experts only):" |
1037 | echo " --source-path=PATH path of source code [$source_path]" | |
1038 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" | |
1039 | echo " --cc=CC use C compiler CC [$cc]" | |
0bfe8cc0 PB |
1040 | echo " --host-cc=CC use C compiler CC [$host_cc] for code run at" |
1041 | echo " build time" | |
3c4a4d0d | 1042 | echo " --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]" |
a558ee17 | 1043 | echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" |
e3fc14c3 | 1044 | echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" |
af5db58e | 1045 | echo " --make=MAKE use specified make [$make]" |
6a882643 | 1046 | echo " --install=INSTALL use specified install [$install]" |
c886edfb | 1047 | echo " --python=PYTHON use specified python [$python]" |
e2d8830e | 1048 | echo " --smbd=SMBD use specified smbd [$smbd]" |
af5db58e | 1049 | echo " --static enable static build [$static]" |
0b24e75f | 1050 | echo " --mandir=PATH install man pages in PATH" |
023d3d67 EH |
1051 | echo " --datadir=PATH install firmware in PATH$confsuffix" |
1052 | echo " --docdir=PATH install documentation in PATH$confsuffix" | |
0b24e75f | 1053 | echo " --bindir=PATH install binaries in PATH" |
023d3d67 | 1054 | echo " --sysconfdir=PATH install config in PATH$confsuffix" |
2ae4748f | 1055 | echo " --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]" |
f8393946 AJ |
1056 | echo " --enable-debug-tcg enable TCG debugging" |
1057 | echo " --disable-debug-tcg disable TCG debugging (default)" | |
09695a4a | 1058 | echo " --enable-debug enable common debug build options" |
890b1658 AL |
1059 | echo " --enable-sparse enable sparse checker" |
1060 | echo " --disable-sparse disable sparse checker (default)" | |
1625af87 | 1061 | echo " --disable-strip disable stripping binaries" |
85aa5189 | 1062 | echo " --disable-werror disable compilation abort on warning" |
fe8f78e4 | 1063 | echo " --disable-sdl disable SDL" |
c4198157 | 1064 | echo " --enable-sdl enable SDL" |
983eef5a MI |
1065 | echo " --disable-virtfs disable VirtFS" |
1066 | echo " --enable-virtfs enable VirtFS" | |
821601ea JS |
1067 | echo " --disable-vnc disable VNC" |
1068 | echo " --enable-vnc enable VNC" | |
14821030 PB |
1069 | echo " --disable-cocoa disable Cocoa (Mac OS X only)" |
1070 | echo " --enable-cocoa enable Cocoa (default on Mac OS X)" | |
c2de5c91 | 1071 | echo " --audio-drv-list=LIST set audio drivers list:" |
1072 | echo " Available drivers: $audio_possible_drivers" | |
4c9b53e3 | 1073 | echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" |
1074 | echo " Available cards: $audio_possible_cards" | |
eb852011 MA |
1075 | echo " --block-drv-whitelist=L set block driver whitelist" |
1076 | echo " (affects only QEMU, not qemu-img)" | |
8ff9cbf7 | 1077 | echo " --enable-mixemu enable mixer emulation" |
e37630ca | 1078 | echo " --disable-xen disable xen backend driver support" |
fc321b4b | 1079 | echo " --enable-xen enable xen backend driver support" |
eb6fda0f AP |
1080 | echo " --disable-xen-pci-passthrough" |
1081 | echo " --enable-xen-pci-passthrough" | |
2e4d9fb1 | 1082 | echo " --disable-brlapi disable BrlAPI" |
4ffcedb6 | 1083 | echo " --enable-brlapi enable BrlAPI" |
8d5d2d4c | 1084 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
1be10ad2 | 1085 | echo " --enable-vnc-tls enable TLS encryption for VNC server" |
2f9606b3 | 1086 | echo " --disable-vnc-sasl disable SASL encryption for VNC server" |
ea784e3b | 1087 | echo " --enable-vnc-sasl enable SASL encryption for VNC server" |
2f6f5c7a CC |
1088 | echo " --disable-vnc-jpeg disable JPEG lossy compression for VNC server" |
1089 | echo " --enable-vnc-jpeg enable JPEG lossy compression for VNC server" | |
96763cf9 | 1090 | echo " --disable-vnc-png disable PNG compression for VNC server (default)" |
efe556ad | 1091 | echo " --enable-vnc-png enable PNG compression for VNC server" |
af896aaa | 1092 | echo " --disable-curses disable curses output" |
c584a6d0 | 1093 | echo " --enable-curses enable curses output" |
769ce76d | 1094 | echo " --disable-curl disable curl connectivity" |
788c8196 | 1095 | echo " --enable-curl enable curl connectivity" |
2df87df7 JQ |
1096 | echo " --disable-fdt disable fdt device tree" |
1097 | echo " --enable-fdt enable fdt device tree" | |
fb599c9a | 1098 | echo " --disable-bluez disable bluez stack connectivity" |
a20a6f46 | 1099 | echo " --enable-bluez enable bluez stack connectivity" |
6093d3d4 | 1100 | echo " --disable-slirp disable SLIRP userspace network connectivity" |
7ba1e619 | 1101 | echo " --disable-kvm disable KVM acceleration support" |
b31a0277 | 1102 | echo " --enable-kvm enable KVM acceleration support" |
9195b2c2 | 1103 | echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" |
bd0c5661 | 1104 | echo " --disable-nptl disable usermode NPTL support" |
e5934d33 | 1105 | echo " --enable-nptl enable usermode NPTL support" |
af5db58e PB |
1106 | echo " --enable-system enable all system emulation targets" |
1107 | echo " --disable-system disable all system emulation targets" | |
0953a80f ZA |
1108 | echo " --enable-user enable supported user emulation targets" |
1109 | echo " --disable-user disable all user emulation targets" | |
831b7825 TS |
1110 | echo " --enable-linux-user enable all linux usermode emulation targets" |
1111 | echo " --disable-linux-user disable all linux usermode emulation targets" | |
84778508 BS |
1112 | echo " --enable-bsd-user enable all BSD usermode emulation targets" |
1113 | echo " --disable-bsd-user disable all BSD usermode emulation targets" | |
379f6698 PB |
1114 | echo " --enable-guest-base enable GUEST_BASE support for usermode" |
1115 | echo " emulation targets" | |
1116 | echo " --disable-guest-base disable GUEST_BASE support" | |
40d6444e AK |
1117 | echo " --enable-pie build Position Independent Executables" |
1118 | echo " --disable-pie do not build Position Independent Executables" | |
af5db58e PB |
1119 | echo " --fmod-lib path to FMOD library" |
1120 | echo " --fmod-inc path to FMOD includes" | |
2f6a1ab0 | 1121 | echo " --oss-lib path to OSS library" |
c5937220 | 1122 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
235e510c | 1123 | echo " --cpu=CPU Build for host CPU [$cpu]" |
3142255c | 1124 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
ee682d27 SW |
1125 | echo " --disable-uuid disable uuid support" |
1126 | echo " --enable-uuid enable uuid support" | |
e0e6c8c0 | 1127 | echo " --disable-vde disable support for vde network" |
dfb278bd | 1128 | echo " --enable-vde enable support for vde network" |
5c6c3a6c CH |
1129 | echo " --disable-linux-aio disable Linux AIO support" |
1130 | echo " --enable-linux-aio enable Linux AIO support" | |
47e98658 CB |
1131 | echo " --disable-cap-ng disable libcap-ng support" |
1132 | echo " --enable-cap-ng enable libcap-ng support" | |
758e8e38 VJJ |
1133 | echo " --disable-attr disables attr and xattr support" |
1134 | echo " --enable-attr enable attr and xattr support" | |
77755340 | 1135 | echo " --disable-blobs disable installing provided firmware blobs" |
d2807bc9 DU |
1136 | echo " --enable-docs enable documentation build" |
1137 | echo " --disable-docs disable documentation build" | |
d5970055 MT |
1138 | echo " --disable-vhost-net disable vhost-net acceleration support" |
1139 | echo " --enable-vhost-net enable vhost-net acceleration support" | |
320fba2a | 1140 | echo " --enable-trace-backend=B Set trace backend" |
650ab98d | 1141 | echo " Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends) |
74242e0f | 1142 | echo " --with-trace-file=NAME Full PATH,NAME of file to store traces" |
9410b56c | 1143 | echo " Default:trace-<pid>" |
cd4ec0b4 GH |
1144 | echo " --disable-spice disable spice" |
1145 | echo " --enable-spice enable spice" | |
f27aaf4b | 1146 | echo " --enable-rbd enable building the rados block device (rbd)" |
c589b249 RS |
1147 | echo " --disable-libiscsi disable iscsi support" |
1148 | echo " --enable-libiscsi enable iscsi support" | |
36707144 AL |
1149 | echo " --disable-smartcard disable smartcard support" |
1150 | echo " --enable-smartcard enable smartcard support" | |
111a38b0 RR |
1151 | echo " --disable-smartcard-nss disable smartcard nss support" |
1152 | echo " --enable-smartcard-nss enable smartcard nss support" | |
69354a83 HG |
1153 | echo " --disable-usb-redir disable usb network redirection support" |
1154 | echo " --enable-usb-redir enable usb network redirection support" | |
d138cee9 MR |
1155 | echo " --disable-guest-agent disable building of the QEMU Guest Agent" |
1156 | echo " --enable-guest-agent enable building of the QEMU Guest Agent" | |
f794573e EO |
1157 | echo " --disable-seccomp disable seccomp support" |
1158 | echo " --enable-seccomp enables seccomp support" | |
519175a2 | 1159 | echo " --with-coroutine=BACKEND coroutine backend. Supported options:" |
fe91bfa8 | 1160 | echo " gthread, ucontext, sigaltstack, windows" |
af5db58e | 1161 | echo "" |
5bf08934 | 1162 | echo "NOTE: The object files are built at the place where configure is launched" |
af5db58e PB |
1163 | exit 1 |
1164 | fi | |
1165 | ||
359bc95d PM |
1166 | # Now we have handled --enable-tcg-interpreter and know we're not just |
1167 | # printing the help message, bail out if the host CPU isn't supported. | |
1168 | if test "$ARCH" = "unknown"; then | |
1169 | if test "$tcg_interpreter" = "yes" ; then | |
1170 | echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" | |
1171 | ARCH=tci | |
1172 | else | |
1173 | echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter" | |
1174 | exit 1 | |
1175 | fi | |
1176 | fi | |
1177 | ||
8d05095c PB |
1178 | # check that the C compiler works. |
1179 | cat > $TMPC <<EOF | |
75cafad7 | 1180 | int main(void) { return 0; } |
8d05095c PB |
1181 | EOF |
1182 | ||
1183 | if compile_object ; then | |
1184 | : C compiler works ok | |
1185 | else | |
1186 | echo "ERROR: \"$cc\" either does not exist or does not work" | |
1187 | exit 1 | |
1188 | fi | |
1189 | ||
417c9d72 AG |
1190 | # Consult white-list to determine whether to enable werror |
1191 | # by default. Only enable by default for git builds | |
1192 | z_version=`cut -f3 -d. $source_path/VERSION` | |
1193 | ||
1194 | if test -z "$werror" ; then | |
1195 | if test "$z_version" = "50" -a \ | |
1196 | "$linux" = "yes" ; then | |
1197 | werror="yes" | |
1198 | else | |
1199 | werror="no" | |
1200 | fi | |
1201 | fi | |
1202 | ||
8d05095c PB |
1203 | gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" |
1204 | gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" | |
1205 | gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" | |
f9188227 | 1206 | gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags" |
6ca026cb PM |
1207 | # Note that we do not add -Werror to gcc_flags here, because that would |
1208 | # enable it for all configure tests. If a configure test failed due | |
1209 | # to -Werror this would just silently disable some features, | |
1210 | # so it's too error prone. | |
8d05095c PB |
1211 | cat > $TMPC << EOF |
1212 | int main(void) { return 0; } | |
1213 | EOF | |
1214 | for flag in $gcc_flags; do | |
bd947d30 | 1215 | if compile_prog "-Werror $flag" "" ; then |
8d05095c PB |
1216 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
1217 | fi | |
1218 | done | |
1219 | ||
40d6444e AK |
1220 | if test "$static" = "yes" ; then |
1221 | if test "$pie" = "yes" ; then | |
1222 | echo "static and pie are mutually incompatible" | |
1223 | exit 1 | |
1224 | else | |
1225 | pie="no" | |
1226 | fi | |
1227 | fi | |
1228 | ||
1229 | if test "$pie" = ""; then | |
1230 | case "$cpu-$targetos" in | |
f9db31a2 | 1231 | i386-Linux|x86_64-Linux|i386-OpenBSD|x86_64-OpenBSD) |
40d6444e AK |
1232 | ;; |
1233 | *) | |
1234 | pie="no" | |
1235 | ;; | |
1236 | esac | |
1237 | fi | |
1238 | ||
1239 | if test "$pie" != "no" ; then | |
1240 | cat > $TMPC << EOF | |
21d4a791 AK |
1241 | |
1242 | #ifdef __linux__ | |
1243 | # define THREAD __thread | |
1244 | #else | |
1245 | # define THREAD | |
1246 | #endif | |
1247 | ||
1248 | static THREAD int tls_var; | |
1249 | ||
1250 | int main(void) { return tls_var; } | |
1251 | ||
40d6444e AK |
1252 | EOF |
1253 | if compile_prog "-fPIE -DPIE" "-pie"; then | |
1254 | QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" | |
1255 | LDFLAGS="-pie $LDFLAGS" | |
1256 | pie="yes" | |
1257 | if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then | |
1258 | LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" | |
1259 | fi | |
1260 | else | |
1261 | if test "$pie" = "yes"; then | |
1262 | echo "PIE not available due to missing toolchain support" | |
1263 | exit 1 | |
1264 | else | |
1265 | echo "Disabling PIE due to missing toolchain support" | |
1266 | pie="no" | |
1267 | fi | |
1268 | fi | |
1269 | fi | |
1270 | ||
ec530c81 FB |
1271 | # |
1272 | # Solaris specific configure tool chain decisions | |
1273 | # | |
1274 | if test "$solaris" = "yes" ; then | |
6792aa11 LM |
1275 | if has $install; then |
1276 | : | |
1277 | else | |
ec530c81 FB |
1278 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
1279 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" | |
1280 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" | |
1281 | exit 1 | |
1282 | fi | |
6792aa11 | 1283 | if test "`path_of $install`" = "/usr/sbin/install" ; then |
ec530c81 FB |
1284 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
1285 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" | |
1286 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" | |
1287 | exit 1 | |
1288 | fi | |
6792aa11 LM |
1289 | if has ar; then |
1290 | : | |
1291 | else | |
ec530c81 FB |
1292 | echo "Error: No path includes ar" |
1293 | if test -f /usr/ccs/bin/ar ; then | |
1294 | echo "Add /usr/ccs/bin to your path and rerun configure" | |
1295 | fi | |
1296 | exit 1 | |
1297 | fi | |
5fafdf24 | 1298 | fi |
ec530c81 | 1299 | |
7a3fc891 SH |
1300 | if ! has $python; then |
1301 | echo "Python not found. Use --python=/path/to/python" | |
1302 | exit 1 | |
c886edfb BS |
1303 | fi |
1304 | ||
6ccea1e4 PM |
1305 | # Note that if the Python conditional here evaluates True we will exit |
1306 | # with status 1 which is a shell 'false' value. | |
e120d449 SH |
1307 | if ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then |
1308 | echo "Cannot use '$python', Python 2.4 or later is required." | |
1309 | echo "Note that Python 3 or later is not yet supported." | |
1310 | echo "Use --python=/path/to/python to specify a supported Python." | |
6ccea1e4 PM |
1311 | exit 1 |
1312 | fi | |
1313 | ||
5327cf48 | 1314 | if test -z "$target_list" ; then |
60e0df25 | 1315 | target_list="$default_target_list" |
6e20a45f | 1316 | else |
b1a550a0 | 1317 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
5327cf48 | 1318 | fi |
0a8e90f4 PB |
1319 | if test -z "$target_list" ; then |
1320 | echo "No targets enabled" | |
1321 | exit 1 | |
1322 | fi | |
f55fe278 PB |
1323 | # see if system emulation was really requested |
1324 | case " $target_list " in | |
1325 | *"-softmmu "*) softmmu=yes | |
1326 | ;; | |
1327 | *) softmmu=no | |
1328 | ;; | |
1329 | esac | |
5327cf48 | 1330 | |
249247c9 JQ |
1331 | feature_not_found() { |
1332 | feature=$1 | |
1333 | ||
1334 | echo "ERROR" | |
1335 | echo "ERROR: User requested feature $feature" | |
9332f6a2 | 1336 | echo "ERROR: configure was not able to find it" |
249247c9 JQ |
1337 | echo "ERROR" |
1338 | exit 1; | |
1339 | } | |
1340 | ||
7d13299d FB |
1341 | if test -z "$cross_prefix" ; then |
1342 | ||
1343 | # --- | |
1344 | # big/little endian test | |
1345 | cat > $TMPC << EOF | |
1346 | #include <inttypes.h> | |
1347 | int main(int argc, char ** argv){ | |
1d14ffa9 FB |
1348 | volatile uint32_t i=0x01234567; |
1349 | return (*((uint8_t*)(&i))) == 0x67; | |
7d13299d FB |
1350 | } |
1351 | EOF | |
1352 | ||
52166aa0 | 1353 | if compile_prog "" "" ; then |
7d13299d FB |
1354 | $TMPE && bigendian="yes" |
1355 | else | |
1356 | echo big/little test failed | |
1357 | fi | |
1358 | ||
1359 | else | |
1360 | ||
1361 | # if cross compiling, cannot launch a program, so make a static guess | |
ea8f20f8 | 1362 | case "$cpu" in |
21d89f84 PM |
1363 | arm) |
1364 | # ARM can be either way; ask the compiler which one we are | |
1365 | if check_define __ARMEB__; then | |
1366 | bigendian=yes | |
1367 | fi | |
1368 | ;; | |
1369 | hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) | |
ea8f20f8 JQ |
1370 | bigendian=yes |
1371 | ;; | |
1372 | esac | |
7d13299d FB |
1373 | |
1374 | fi | |
1375 | ||
b0a47e79 JQ |
1376 | ########################################## |
1377 | # NPTL probe | |
1378 | ||
1379 | if test "$nptl" != "no" ; then | |
1380 | cat > $TMPC <<EOF | |
bd0c5661 | 1381 | #include <sched.h> |
30813cea | 1382 | #include <linux/futex.h> |
182eacc0 | 1383 | int main(void) { |
bd0c5661 PB |
1384 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
1385 | #error bork | |
1386 | #endif | |
182eacc0 | 1387 | return 0; |
bd0c5661 PB |
1388 | } |
1389 | EOF | |
1390 | ||
b0a47e79 JQ |
1391 | if compile_object ; then |
1392 | nptl=yes | |
1393 | else | |
1394 | if test "$nptl" = "yes" ; then | |
1395 | feature_not_found "nptl" | |
1396 | fi | |
1397 | nptl=no | |
1398 | fi | |
bd0c5661 PB |
1399 | fi |
1400 | ||
ac62922e AZ |
1401 | ########################################## |
1402 | # zlib check | |
1403 | ||
1ece9905 AL |
1404 | if test "$zlib" != "no" ; then |
1405 | cat > $TMPC << EOF | |
ac62922e AZ |
1406 | #include <zlib.h> |
1407 | int main(void) { zlibVersion(); return 0; } | |
1408 | EOF | |
1ece9905 AL |
1409 | if compile_prog "" "-lz" ; then |
1410 | : | |
1411 | else | |
1412 | echo | |
1413 | echo "Error: zlib check failed" | |
1414 | echo "Make sure to have the zlib libs and headers installed." | |
1415 | echo | |
1416 | exit 1 | |
1417 | fi | |
ac62922e AZ |
1418 | fi |
1419 | ||
f794573e EO |
1420 | ########################################## |
1421 | # libseccomp check | |
1422 | ||
1423 | if test "$seccomp" != "no" ; then | |
1424 | if $pkg_config libseccomp --modversion >/dev/null 2>&1; then | |
1425 | LIBS=`$pkg_config --libs libseccomp` | |
1426 | seccomp="yes" | |
1427 | else | |
1428 | seccomp="no" | |
1429 | if test "$seccomp" = "yes"; then | |
1430 | feature_not_found "libseccomp" | |
1431 | fi | |
1432 | fi | |
1433 | fi | |
e37630ca AL |
1434 | ########################################## |
1435 | # xen probe | |
1436 | ||
fc321b4b | 1437 | if test "$xen" != "no" ; then |
b2266bee | 1438 | xen_libs="-lxenstore -lxenctrl -lxenguest" |
d5b93ddf | 1439 | |
50ced5b3 SW |
1440 | # First we test whether Xen headers and libraries are available. |
1441 | # If no, we are done and there is no Xen support. | |
1442 | # If yes, more tests are run to detect the Xen version. | |
1443 | ||
1444 | # Xen (any) | |
b2266bee | 1445 | cat > $TMPC <<EOF |
e37630ca | 1446 | #include <xenctrl.h> |
50ced5b3 SW |
1447 | int main(void) { |
1448 | return 0; | |
1449 | } | |
1450 | EOF | |
1451 | if ! compile_prog "" "$xen_libs" ; then | |
1452 | # Xen not found | |
1453 | if test "$xen" = "yes" ; then | |
1454 | feature_not_found "xen" | |
1455 | fi | |
1456 | xen=no | |
1457 | ||
1458 | # Xen unstable | |
69deef08 PM |
1459 | elif |
1460 | cat > $TMPC <<EOF && | |
50ced5b3 | 1461 | #include <xenctrl.h> |
e108a3c1 | 1462 | #include <xenstore.h> |
d5b93ddf AP |
1463 | #include <stdint.h> |
1464 | #include <xen/hvm/hvm_info_table.h> | |
1465 | #if !defined(HVM_MAX_VCPUS) | |
1466 | # error HVM_MAX_VCPUS not defined | |
1467 | #endif | |
8688e065 SS |
1468 | int main(void) { |
1469 | xc_interface *xc; | |
1470 | xs_daemon_open(); | |
1471 | xc = xc_interface_open(0, 0, 0); | |
1472 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
1473 | xc_gnttab_open(NULL, 0); | |
1474 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
1475 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
1476 | return 0; | |
1477 | } | |
1478 | EOF | |
1479 | compile_prog "" "$xen_libs" | |
69deef08 | 1480 | then |
8688e065 SS |
1481 | xen_ctrl_version=420 |
1482 | xen=yes | |
1483 | ||
69deef08 PM |
1484 | elif |
1485 | cat > $TMPC <<EOF && | |
8688e065 SS |
1486 | #include <xenctrl.h> |
1487 | #include <xs.h> | |
1488 | #include <stdint.h> | |
1489 | #include <xen/hvm/hvm_info_table.h> | |
1490 | #if !defined(HVM_MAX_VCPUS) | |
1491 | # error HVM_MAX_VCPUS not defined | |
1492 | #endif | |
d5b93ddf | 1493 | int main(void) { |
d5b93ddf | 1494 | xs_daemon_open(); |
9b4c0b56 | 1495 | xc_interface_open(0, 0, 0); |
d5b93ddf AP |
1496 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
1497 | xc_gnttab_open(NULL, 0); | |
b87de24e | 1498 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
d5b93ddf AP |
1499 | return 0; |
1500 | } | |
e37630ca | 1501 | EOF |
50ced5b3 | 1502 | compile_prog "" "$xen_libs" |
69deef08 | 1503 | then |
d5b93ddf | 1504 | xen_ctrl_version=410 |
fc321b4b | 1505 | xen=yes |
d5b93ddf AP |
1506 | |
1507 | # Xen 4.0.0 | |
69deef08 PM |
1508 | elif |
1509 | cat > $TMPC <<EOF && | |
d5b93ddf AP |
1510 | #include <xenctrl.h> |
1511 | #include <xs.h> | |
1512 | #include <stdint.h> | |
1513 | #include <xen/hvm/hvm_info_table.h> | |
1514 | #if !defined(HVM_MAX_VCPUS) | |
1515 | # error HVM_MAX_VCPUS not defined | |
1516 | #endif | |
1517 | int main(void) { | |
b87de24e AP |
1518 | struct xen_add_to_physmap xatp = { |
1519 | .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, | |
1520 | }; | |
d5b93ddf AP |
1521 | xs_daemon_open(); |
1522 | xc_interface_open(); | |
1523 | xc_gnttab_open(); | |
1524 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
b87de24e | 1525 | xc_memory_op(0, XENMEM_add_to_physmap, &xatp); |
d5b93ddf AP |
1526 | return 0; |
1527 | } | |
1528 | EOF | |
1529 | compile_prog "" "$xen_libs" | |
69deef08 | 1530 | then |
d5b93ddf AP |
1531 | xen_ctrl_version=400 |
1532 | xen=yes | |
1533 | ||
b87de24e | 1534 | # Xen 3.4.0 |
69deef08 PM |
1535 | elif |
1536 | cat > $TMPC <<EOF && | |
b87de24e AP |
1537 | #include <xenctrl.h> |
1538 | #include <xs.h> | |
1539 | int main(void) { | |
1540 | struct xen_add_to_physmap xatp = { | |
1541 | .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, | |
1542 | }; | |
1543 | xs_daemon_open(); | |
1544 | xc_interface_open(); | |
1545 | xc_gnttab_open(); | |
1546 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
1547 | xc_memory_op(0, XENMEM_add_to_physmap, &xatp); | |
1548 | return 0; | |
1549 | } | |
1550 | EOF | |
1551 | compile_prog "" "$xen_libs" | |
69deef08 | 1552 | then |
b87de24e AP |
1553 | xen_ctrl_version=340 |
1554 | xen=yes | |
1555 | ||
1556 | # Xen 3.3.0 | |
69deef08 PM |
1557 | elif |
1558 | cat > $TMPC <<EOF && | |
d5b93ddf AP |
1559 | #include <xenctrl.h> |
1560 | #include <xs.h> | |
1561 | int main(void) { | |
1562 | xs_daemon_open(); | |
1563 | xc_interface_open(); | |
1564 | xc_gnttab_open(); | |
1565 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
1566 | return 0; | |
1567 | } | |
1568 | EOF | |
1569 | compile_prog "" "$xen_libs" | |
69deef08 | 1570 | then |
d5b93ddf AP |
1571 | xen_ctrl_version=330 |
1572 | xen=yes | |
1573 | ||
50ced5b3 | 1574 | # Xen version unsupported |
b2266bee | 1575 | else |
fc321b4b | 1576 | if test "$xen" = "yes" ; then |
50ced5b3 | 1577 | feature_not_found "xen (unsupported version)" |
fc321b4b JQ |
1578 | fi |
1579 | xen=no | |
b2266bee | 1580 | fi |
d5b93ddf AP |
1581 | |
1582 | if test "$xen" = yes; then | |
1583 | libs_softmmu="$xen_libs $libs_softmmu" | |
1584 | fi | |
e37630ca AL |
1585 | fi |
1586 | ||
eb6fda0f AP |
1587 | if test "$xen_pci_passthrough" != "no"; then |
1588 | if test "$xen" = "yes" && test "$linux" = "yes" && | |
1589 | test "$xen_ctrl_version" -ge 340; then | |
1590 | xen_pci_passthrough=yes | |
1591 | else | |
1592 | if test "$xen_pci_passthrough" = "yes"; then | |
1593 | echo "ERROR" | |
1594 | echo "ERROR: User requested feature Xen PCI Passthrough" | |
1595 | echo "ERROR: but this feature require /sys from Linux" | |
1596 | if test "$xen_ctrl_version" -lt 340; then | |
1597 | echo "ERROR: This feature does not work with Xen 3.3" | |
1598 | fi | |
1599 | echo "ERROR" | |
1600 | exit 1; | |
1601 | fi | |
1602 | xen_pci_passthrough=no | |
1603 | fi | |
1604 | fi | |
1605 | ||
f91672e5 | 1606 | ########################################## |
a8bd70ad | 1607 | # pkg-config probe |
f91672e5 | 1608 | |
17884d7b ST |
1609 | if ! has "$pkg_config_exe"; then |
1610 | echo "Error: pkg-config binary '$pkg_config_exe' not found" | |
a213fcb2 | 1611 | exit 1 |
f91672e5 PB |
1612 | fi |
1613 | ||
44dc0ca3 AL |
1614 | ########################################## |
1615 | # libtool probe | |
1616 | ||
3f534581 | 1617 | if ! has $libtool; then |
44dc0ca3 | 1618 | libtool= |
44dc0ca3 AL |
1619 | fi |
1620 | ||
dfffc653 JQ |
1621 | ########################################## |
1622 | # Sparse probe | |
1623 | if test "$sparse" != "no" ; then | |
0dba6195 | 1624 | if has cgcc; then |
dfffc653 JQ |
1625 | sparse=yes |
1626 | else | |
1627 | if test "$sparse" = "yes" ; then | |
1628 | feature_not_found "sparse" | |
1629 | fi | |
1630 | sparse=no | |
1631 | fi | |
1632 | fi | |
1633 | ||
11d9f695 FB |
1634 | ########################################## |
1635 | # SDL probe | |
1636 | ||
3ec87ffe PB |
1637 | # Look for sdl configuration program (pkg-config or sdl-config). Try |
1638 | # sdl-config even without cross prefix, and favour pkg-config over sdl-config. | |
1639 | if test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then | |
1640 | sdl_config=sdl-config | |
1641 | fi | |
1642 | ||
1643 | if $pkg_config sdl --modversion >/dev/null 2>&1; then | |
a8bd70ad | 1644 | sdlconfig="$pkg_config sdl" |
9316f803 | 1645 | _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` |
3ec87ffe PB |
1646 | elif has ${sdl_config}; then |
1647 | sdlconfig="$sdl_config" | |
9316f803 | 1648 | _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` |
a0dfd8a4 LM |
1649 | else |
1650 | if test "$sdl" = "yes" ; then | |
1651 | feature_not_found "sdl" | |
1652 | fi | |
1653 | sdl=no | |
9316f803 | 1654 | fi |
29e5bada | 1655 | if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then |
3ec87ffe PB |
1656 | echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 |
1657 | fi | |
11d9f695 | 1658 | |
9316f803 | 1659 | sdl_too_old=no |
c4198157 | 1660 | if test "$sdl" != "no" ; then |
ac119f9d | 1661 | cat > $TMPC << EOF |
11d9f695 FB |
1662 | #include <SDL.h> |
1663 | #undef main /* We don't want SDL to override our main() */ | |
1664 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
1665 | EOF | |
9316f803 | 1666 | sdl_cflags=`$sdlconfig --cflags 2> /dev/null` |
74f42e18 T |
1667 | if test "$static" = "yes" ; then |
1668 | sdl_libs=`$sdlconfig --static-libs 2>/dev/null` | |
1669 | else | |
1670 | sdl_libs=`$sdlconfig --libs 2> /dev/null` | |
1671 | fi | |
52166aa0 | 1672 | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
ac119f9d JQ |
1673 | if test "$_sdlversion" -lt 121 ; then |
1674 | sdl_too_old=yes | |
1675 | else | |
1676 | if test "$cocoa" = "no" ; then | |
1677 | sdl=yes | |
1678 | fi | |
1679 | fi | |
cd01b4a3 | 1680 | |
67c274d3 | 1681 | # static link with sdl ? (note: sdl.pc's --static --libs is broken) |
ac119f9d | 1682 | if test "$sdl" = "yes" -a "$static" = "yes" ; then |
67c274d3 | 1683 | if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then |
f8aa6c7b SW |
1684 | sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" |
1685 | sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" | |
ac119f9d | 1686 | fi |
52166aa0 | 1687 | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
ac119f9d JQ |
1688 | : |
1689 | else | |
1690 | sdl=no | |
1691 | fi | |
1692 | fi # static link | |
c4198157 JQ |
1693 | else # sdl not found |
1694 | if test "$sdl" = "yes" ; then | |
1695 | feature_not_found "sdl" | |
1696 | fi | |
1697 | sdl=no | |
ac119f9d | 1698 | fi # sdl compile test |
a68551bc | 1699 | fi |
11d9f695 | 1700 | |
5368a422 | 1701 | if test "$sdl" = "yes" ; then |
ac119f9d | 1702 | cat > $TMPC <<EOF |
5368a422 AL |
1703 | #include <SDL.h> |
1704 | #if defined(SDL_VIDEO_DRIVER_X11) | |
1705 | #include <X11/XKBlib.h> | |
1706 | #else | |
1707 | #error No x11 support | |
1708 | #endif | |
1709 | int main(void) { return 0; } | |
1710 | EOF | |
52166aa0 | 1711 | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
ac119f9d JQ |
1712 | sdl_libs="$sdl_libs -lX11" |
1713 | fi | |
0705667e | 1714 | libs_softmmu="$sdl_libs $libs_softmmu" |
5368a422 AL |
1715 | fi |
1716 | ||
8d5d2d4c TS |
1717 | ########################################## |
1718 | # VNC TLS detection | |
821601ea | 1719 | if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then |
1be10ad2 | 1720 | cat > $TMPC <<EOF |
ae6b5e5a AL |
1721 | #include <gnutls/gnutls.h> |
1722 | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } | |
1723 | EOF | |
a8bd70ad PB |
1724 | vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` |
1725 | vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` | |
1be10ad2 JQ |
1726 | if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then |
1727 | vnc_tls=yes | |
1728 | libs_softmmu="$vnc_tls_libs $libs_softmmu" | |
1729 | else | |
1730 | if test "$vnc_tls" = "yes" ; then | |
1731 | feature_not_found "vnc-tls" | |
ae6b5e5a | 1732 | fi |
1be10ad2 JQ |
1733 | vnc_tls=no |
1734 | fi | |
8d5d2d4c TS |
1735 | fi |
1736 | ||
2f9606b3 AL |
1737 | ########################################## |
1738 | # VNC SASL detection | |
821601ea | 1739 | if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then |
ea784e3b | 1740 | cat > $TMPC <<EOF |
2f9606b3 AL |
1741 | #include <sasl/sasl.h> |
1742 | #include <stdio.h> | |
1743 | int main(void) { sasl_server_init(NULL, "qemu"); return 0; } | |
1744 | EOF | |
ea784e3b JQ |
1745 | # Assuming Cyrus-SASL installed in /usr prefix |
1746 | vnc_sasl_cflags="" | |
1747 | vnc_sasl_libs="-lsasl2" | |
1748 | if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then | |
1749 | vnc_sasl=yes | |
1750 | libs_softmmu="$vnc_sasl_libs $libs_softmmu" | |
1751 | else | |
1752 | if test "$vnc_sasl" = "yes" ; then | |
1753 | feature_not_found "vnc-sasl" | |
2f9606b3 | 1754 | fi |
ea784e3b JQ |
1755 | vnc_sasl=no |
1756 | fi | |
2f9606b3 AL |
1757 | fi |
1758 | ||
2f6f5c7a CC |
1759 | ########################################## |
1760 | # VNC JPEG detection | |
821601ea | 1761 | if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then |
2f6f5c7a CC |
1762 | cat > $TMPC <<EOF |
1763 | #include <stdio.h> | |
1764 | #include <jpeglib.h> | |
1765 | int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } | |
1766 | EOF | |
1767 | vnc_jpeg_cflags="" | |
1768 | vnc_jpeg_libs="-ljpeg" | |
1769 | if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then | |
1770 | vnc_jpeg=yes | |
1771 | libs_softmmu="$vnc_jpeg_libs $libs_softmmu" | |
1772 | else | |
1773 | if test "$vnc_jpeg" = "yes" ; then | |
1774 | feature_not_found "vnc-jpeg" | |
1775 | fi | |
1776 | vnc_jpeg=no | |
1777 | fi | |
1778 | fi | |
1779 | ||
efe556ad CC |
1780 | ########################################## |
1781 | # VNC PNG detection | |
821601ea | 1782 | if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then |
efe556ad CC |
1783 | cat > $TMPC <<EOF |
1784 | //#include <stdio.h> | |
1785 | #include <png.h> | |
832ce9c2 | 1786 | #include <stddef.h> |
efe556ad CC |
1787 | int main(void) { |
1788 | png_structp png_ptr; | |
1789 | png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); | |
7edc3fed | 1790 | return png_ptr != 0; |
efe556ad CC |
1791 | } |
1792 | EOF | |
9af8025e B |
1793 | if $pkg_config libpng --modversion >/dev/null 2>&1; then |
1794 | vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` | |
1795 | vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` | |
1796 | else | |
efe556ad CC |
1797 | vnc_png_cflags="" |
1798 | vnc_png_libs="-lpng" | |
9af8025e | 1799 | fi |
efe556ad CC |
1800 | if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then |
1801 | vnc_png=yes | |
1802 | libs_softmmu="$vnc_png_libs $libs_softmmu" | |
9af8025e | 1803 | QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" |
efe556ad CC |
1804 | else |
1805 | if test "$vnc_png" = "yes" ; then | |
1806 | feature_not_found "vnc-png" | |
1807 | fi | |
1808 | vnc_png=no | |
1809 | fi | |
1810 | fi | |
1811 | ||
76655d6d AL |
1812 | ########################################## |
1813 | # fnmatch() probe, used for ACL routines | |
1814 | fnmatch="no" | |
1815 | cat > $TMPC << EOF | |
1816 | #include <fnmatch.h> | |
1817 | int main(void) | |
1818 | { | |
1819 | fnmatch("foo", "foo", 0); | |
1820 | return 0; | |
1821 | } | |
1822 | EOF | |
52166aa0 | 1823 | if compile_prog "" "" ; then |
76655d6d AL |
1824 | fnmatch="yes" |
1825 | fi | |
1826 | ||
ee682d27 SW |
1827 | ########################################## |
1828 | # uuid_generate() probe, used for vdi block driver | |
1829 | if test "$uuid" != "no" ; then | |
1830 | uuid_libs="-luuid" | |
1831 | cat > $TMPC << EOF | |
1832 | #include <uuid/uuid.h> | |
1833 | int main(void) | |
1834 | { | |
1835 | uuid_t my_uuid; | |
1836 | uuid_generate(my_uuid); | |
1837 | return 0; | |
1838 | } | |
1839 | EOF | |
1840 | if compile_prog "" "$uuid_libs" ; then | |
1841 | uuid="yes" | |
1842 | libs_softmmu="$uuid_libs $libs_softmmu" | |
1843 | libs_tools="$uuid_libs $libs_tools" | |
1844 | else | |
1845 | if test "$uuid" = "yes" ; then | |
1846 | feature_not_found "uuid" | |
1847 | fi | |
1848 | uuid=no | |
1849 | fi | |
1850 | fi | |
1851 | ||
dce512de CH |
1852 | ########################################## |
1853 | # xfsctl() probe, used for raw-posix | |
1854 | if test "$xfs" != "no" ; then | |
1855 | cat > $TMPC << EOF | |
ffc41d10 | 1856 | #include <stddef.h> /* NULL */ |
dce512de CH |
1857 | #include <xfs/xfs.h> |
1858 | int main(void) | |
1859 | { | |
1860 | xfsctl(NULL, 0, 0, NULL); | |
1861 | return 0; | |
1862 | } | |
1863 | EOF | |
1864 | if compile_prog "" "" ; then | |
1865 | xfs="yes" | |
1866 | else | |
1867 | if test "$xfs" = "yes" ; then | |
1868 | feature_not_found "xfs" | |
1869 | fi | |
1870 | xfs=no | |
1871 | fi | |
1872 | fi | |
1873 | ||
8a16d273 TS |
1874 | ########################################## |
1875 | # vde libraries probe | |
dfb278bd | 1876 | if test "$vde" != "no" ; then |
4baae0ac | 1877 | vde_libs="-lvdeplug" |
8a16d273 TS |
1878 | cat > $TMPC << EOF |
1879 | #include <libvdeplug.h> | |
4a7f0e06 PB |
1880 | int main(void) |
1881 | { | |
1882 | struct vde_open_args a = {0, 0, 0}; | |
fea08e08 PM |
1883 | char s[] = ""; |
1884 | vde_open(s, s, &a); | |
4a7f0e06 PB |
1885 | return 0; |
1886 | } | |
8a16d273 | 1887 | EOF |
52166aa0 | 1888 | if compile_prog "" "$vde_libs" ; then |
4baae0ac | 1889 | vde=yes |
8e02e54c JQ |
1890 | libs_softmmu="$vde_libs $libs_softmmu" |
1891 | libs_tools="$vde_libs $libs_tools" | |
dfb278bd JQ |
1892 | else |
1893 | if test "$vde" = "yes" ; then | |
1894 | feature_not_found "vde" | |
1895 | fi | |
1896 | vde=no | |
4baae0ac | 1897 | fi |
8a16d273 TS |
1898 | fi |
1899 | ||
47e98658 CB |
1900 | ########################################## |
1901 | # libcap-ng library probe | |
1902 | if test "$cap_ng" != "no" ; then | |
1903 | cap_libs="-lcap-ng" | |
1904 | cat > $TMPC << EOF | |
1905 | #include <cap-ng.h> | |
1906 | int main(void) | |
1907 | { | |
1908 | capng_capability_to_name(CAPNG_EFFECTIVE); | |
1909 | return 0; | |
1910 | } | |
1911 | EOF | |
1912 | if compile_prog "" "$cap_libs" ; then | |
1913 | cap_ng=yes | |
1914 | libs_tools="$cap_libs $libs_tools" | |
1915 | else | |
1916 | if test "$cap_ng" = "yes" ; then | |
1917 | feature_not_found "cap_ng" | |
1918 | fi | |
1919 | cap_ng=no | |
1920 | fi | |
1921 | fi | |
1922 | ||
8f28f3fb | 1923 | ########################################## |
c2de5c91 | 1924 | # Sound support libraries probe |
8f28f3fb | 1925 | |
c2de5c91 | 1926 | audio_drv_probe() |
1927 | { | |
1928 | drv=$1 | |
1929 | hdr=$2 | |
1930 | lib=$3 | |
1931 | exp=$4 | |
1932 | cfl=$5 | |
1933 | cat > $TMPC << EOF | |
1934 | #include <$hdr> | |
1935 | int main(void) { $exp } | |
8f28f3fb | 1936 | EOF |
52166aa0 | 1937 | if compile_prog "$cfl" "$lib" ; then |
c2de5c91 | 1938 | : |
1939 | else | |
1940 | echo | |
1941 | echo "Error: $drv check failed" | |
1942 | echo "Make sure to have the $drv libs and headers installed." | |
1943 | echo | |
1944 | exit 1 | |
1945 | fi | |
1946 | } | |
1947 | ||
2fa7d3bf | 1948 | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
c2de5c91 | 1949 | for drv in $audio_drv_list; do |
1950 | case $drv in | |
1951 | alsa) | |
1952 | audio_drv_probe $drv alsa/asoundlib.h -lasound \ | |
e35bcb0c | 1953 | "return snd_pcm_close((snd_pcm_t *)0);" |
a4bf6780 | 1954 | libs_softmmu="-lasound $libs_softmmu" |
c2de5c91 | 1955 | ;; |
1956 | ||
1957 | fmod) | |
1958 | if test -z $fmod_lib || test -z $fmod_inc; then | |
1959 | echo | |
1960 | echo "Error: You must specify path to FMOD library and headers" | |
1961 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" | |
1962 | echo | |
1963 | exit 1 | |
1964 | fi | |
1965 | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" | |
a4bf6780 | 1966 | libs_softmmu="$fmod_lib $libs_softmmu" |
c2de5c91 | 1967 | ;; |
1968 | ||
1969 | esd) | |
1970 | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' | |
a4bf6780 | 1971 | libs_softmmu="-lesd $libs_softmmu" |
67f86e8e | 1972 | audio_pt_int="yes" |
c2de5c91 | 1973 | ;; |
b8e59f18 | 1974 | |
1975 | pa) | |
a394aed2 MAL |
1976 | audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ |
1977 | "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" | |
1978 | libs_softmmu="-lpulse $libs_softmmu" | |
67f86e8e | 1979 | audio_pt_int="yes" |
b8e59f18 | 1980 | ;; |
1981 | ||
997e690a JQ |
1982 | coreaudio) |
1983 | libs_softmmu="-framework CoreAudio $libs_softmmu" | |
1984 | ;; | |
1985 | ||
a4bf6780 JQ |
1986 | dsound) |
1987 | libs_softmmu="-lole32 -ldxguid $libs_softmmu" | |
d5631638 | 1988 | audio_win_int="yes" |
a4bf6780 JQ |
1989 | ;; |
1990 | ||
1991 | oss) | |
1992 | libs_softmmu="$oss_lib $libs_softmmu" | |
1993 | ;; | |
1994 | ||
1995 | sdl|wav) | |
2f6a1ab0 BS |
1996 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) |
1997 | ;; | |
1998 | ||
d5631638 | 1999 | winwave) |
2000 | libs_softmmu="-lwinmm $libs_softmmu" | |
2001 | audio_win_int="yes" | |
2002 | ;; | |
2003 | ||
e4c63a6a | 2004 | *) |
1c9b2a52 | 2005 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
e4c63a6a | 2006 | echo |
2007 | echo "Error: Unknown driver '$drv' selected" | |
2008 | echo "Possible drivers are: $audio_possible_drivers" | |
2009 | echo | |
2010 | exit 1 | |
2011 | } | |
2012 | ;; | |
c2de5c91 | 2013 | esac |
2014 | done | |
8f28f3fb | 2015 | |
2e4d9fb1 AJ |
2016 | ########################################## |
2017 | # BrlAPI probe | |
2018 | ||
4ffcedb6 | 2019 | if test "$brlapi" != "no" ; then |
eb82284f JQ |
2020 | brlapi_libs="-lbrlapi" |
2021 | cat > $TMPC << EOF | |
2e4d9fb1 | 2022 | #include <brlapi.h> |
832ce9c2 | 2023 | #include <stddef.h> |
2e4d9fb1 AJ |
2024 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
2025 | EOF | |
52166aa0 | 2026 | if compile_prog "" "$brlapi_libs" ; then |
eb82284f | 2027 | brlapi=yes |
264606b3 | 2028 | libs_softmmu="$brlapi_libs $libs_softmmu" |
4ffcedb6 JQ |
2029 | else |
2030 | if test "$brlapi" = "yes" ; then | |
2031 | feature_not_found "brlapi" | |
2032 | fi | |
2033 | brlapi=no | |
eb82284f JQ |
2034 | fi |
2035 | fi | |
2e4d9fb1 | 2036 | |
4d3b6f6e AZ |
2037 | ########################################## |
2038 | # curses probe | |
e095e2f3 SW |
2039 | if test "$mingw32" = "yes" ; then |
2040 | curses_list="-lpdcurses" | |
2041 | else | |
2042 | curses_list="-lncurses -lcurses" | |
2043 | fi | |
4d3b6f6e | 2044 | |
c584a6d0 JQ |
2045 | if test "$curses" != "no" ; then |
2046 | curses_found=no | |
4d3b6f6e AZ |
2047 | cat > $TMPC << EOF |
2048 | #include <curses.h> | |
ef9a2524 SW |
2049 | int main(void) { |
2050 | const char *s = curses_version(); | |
2051 | resize_term(0, 0); | |
2052 | return s != 0; | |
2053 | } | |
4d3b6f6e | 2054 | EOF |
4f78ef9a JQ |
2055 | for curses_lib in $curses_list; do |
2056 | if compile_prog "" "$curses_lib" ; then | |
c584a6d0 | 2057 | curses_found=yes |
4f78ef9a JQ |
2058 | libs_softmmu="$curses_lib $libs_softmmu" |
2059 | break | |
2060 | fi | |
2061 | done | |
c584a6d0 JQ |
2062 | if test "$curses_found" = "yes" ; then |
2063 | curses=yes | |
2064 | else | |
2065 | if test "$curses" = "yes" ; then | |
2066 | feature_not_found "curses" | |
2067 | fi | |
2068 | curses=no | |
2069 | fi | |
4f78ef9a | 2070 | fi |
4d3b6f6e | 2071 | |
769ce76d AG |
2072 | ########################################## |
2073 | # curl probe | |
2074 | ||
a8bd70ad PB |
2075 | if $pkg_config libcurl --modversion >/dev/null 2>&1; then |
2076 | curlconfig="$pkg_config libcurl" | |
4e2b0658 PB |
2077 | else |
2078 | curlconfig=curl-config | |
2079 | fi | |
2080 | ||
788c8196 | 2081 | if test "$curl" != "no" ; then |
769ce76d AG |
2082 | cat > $TMPC << EOF |
2083 | #include <curl/curl.h> | |
0b862ced | 2084 | int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } |
769ce76d | 2085 | EOF |
4e2b0658 PB |
2086 | curl_cflags=`$curlconfig --cflags 2>/dev/null` |
2087 | curl_libs=`$curlconfig --libs 2>/dev/null` | |
b1d5a277 | 2088 | if compile_prog "$curl_cflags" "$curl_libs" ; then |
769ce76d | 2089 | curl=yes |
f0302935 JQ |
2090 | libs_tools="$curl_libs $libs_tools" |
2091 | libs_softmmu="$curl_libs $libs_softmmu" | |
788c8196 JQ |
2092 | else |
2093 | if test "$curl" = "yes" ; then | |
2094 | feature_not_found "curl" | |
2095 | fi | |
2096 | curl=no | |
769ce76d AG |
2097 | fi |
2098 | fi # test "$curl" | |
2099 | ||
fb599c9a AZ |
2100 | ########################################## |
2101 | # bluez support probe | |
a20a6f46 | 2102 | if test "$bluez" != "no" ; then |
e820e3f4 AZ |
2103 | cat > $TMPC << EOF |
2104 | #include <bluetooth/bluetooth.h> | |
2105 | int main(void) { return bt_error(0); } | |
2106 | EOF | |
a8bd70ad PB |
2107 | bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` |
2108 | bluez_libs=`$pkg_config --libs bluez 2> /dev/null` | |
52166aa0 | 2109 | if compile_prog "$bluez_cflags" "$bluez_libs" ; then |
a20a6f46 | 2110 | bluez=yes |
e482d56a | 2111 | libs_softmmu="$bluez_libs $libs_softmmu" |
e820e3f4 | 2112 | else |
a20a6f46 JQ |
2113 | if test "$bluez" = "yes" ; then |
2114 | feature_not_found "bluez" | |
2115 | fi | |
e820e3f4 AZ |
2116 | bluez="no" |
2117 | fi | |
fb599c9a AZ |
2118 | fi |
2119 | ||
e18df141 AL |
2120 | ########################################## |
2121 | # glib support probe | |
a52d28af PB |
2122 | |
2123 | if test "$mingw32" = yes; then | |
2124 | # g_poll is required in order to integrate with the glib main loop. | |
2125 | glib_req_ver=2.20 | |
2126 | else | |
2127 | glib_req_ver=2.12 | |
2128 | fi | |
2129 | if $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 | |
2130 | then | |
4b76a481 SH |
2131 | glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` |
2132 | glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` | |
14015304 | 2133 | LIBS="$glib_libs $LIBS" |
957f1f99 | 2134 | libs_qga="$glib_libs $libs_qga" |
4b76a481 | 2135 | else |
a52d28af | 2136 | echo "glib-$glib_req_ver required to compile QEMU" |
4b76a481 | 2137 | exit 1 |
e18df141 AL |
2138 | fi |
2139 | ||
17bff52b MK |
2140 | ########################################## |
2141 | # libcap probe | |
2142 | ||
2143 | if test "$cap" != "no" ; then | |
2144 | cat > $TMPC <<EOF | |
2145 | #include <stdio.h> | |
2146 | #include <sys/capability.h> | |
cc939743 | 2147 | int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } |
17bff52b MK |
2148 | EOF |
2149 | if compile_prog "" "-lcap" ; then | |
2150 | cap=yes | |
2151 | else | |
2152 | cap=no | |
2153 | fi | |
2154 | fi | |
2155 | ||
414f0dab | 2156 | ########################################## |
e5d355d1 | 2157 | # pthread probe |
4b29ec41 | 2158 | PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" |
3c529d93 | 2159 | |
4dd75c70 | 2160 | pthread=no |
e5d355d1 | 2161 | cat > $TMPC << EOF |
3c529d93 | 2162 | #include <pthread.h> |
7a42bbe4 SW |
2163 | static void *f(void *p) { return NULL; } |
2164 | int main(void) { | |
2165 | pthread_t thread; | |
2166 | pthread_create(&thread, 0, f, 0); | |
2167 | return 0; | |
2168 | } | |
414f0dab | 2169 | EOF |
bd00d539 AF |
2170 | if compile_prog "" "" ; then |
2171 | pthread=yes | |
2172 | else | |
2173 | for pthread_lib in $PTHREADLIBS_LIST; do | |
2174 | if compile_prog "" "$pthread_lib" ; then | |
2175 | pthread=yes | |
e3c56761 PP |
2176 | found=no |
2177 | for lib_entry in $LIBS; do | |
2178 | if test "$lib_entry" = "$pthread_lib"; then | |
2179 | found=yes | |
2180 | break | |
2181 | fi | |
2182 | done | |
2183 | if test "$found" = "no"; then | |
2184 | LIBS="$pthread_lib $LIBS" | |
2185 | fi | |
bd00d539 AF |
2186 | break |
2187 | fi | |
2188 | done | |
2189 | fi | |
414f0dab | 2190 | |
4617e593 | 2191 | if test "$mingw32" != yes -a "$pthread" = no; then |
4dd75c70 CH |
2192 | echo |
2193 | echo "Error: pthread check failed" | |
2194 | echo "Make sure to have the pthread libs and headers installed." | |
2195 | echo | |
2196 | exit 1 | |
e5d355d1 AL |
2197 | fi |
2198 | ||
f27aaf4b CB |
2199 | ########################################## |
2200 | # rbd probe | |
2201 | if test "$rbd" != "no" ; then | |
2202 | cat > $TMPC <<EOF | |
2203 | #include <stdio.h> | |
ad32e9c0 | 2204 | #include <rbd/librbd.h> |
f27aaf4b | 2205 | int main(void) { |
ad32e9c0 JD |
2206 | rados_t cluster; |
2207 | rados_create(&cluster, NULL); | |
f27aaf4b CB |
2208 | return 0; |
2209 | } | |
2210 | EOF | |
ad32e9c0 JD |
2211 | rbd_libs="-lrbd -lrados" |
2212 | if compile_prog "" "$rbd_libs" ; then | |
2213 | rbd=yes | |
2214 | libs_tools="$rbd_libs $libs_tools" | |
2215 | libs_softmmu="$rbd_libs $libs_softmmu" | |
f27aaf4b CB |
2216 | else |
2217 | if test "$rbd" = "yes" ; then | |
2218 | feature_not_found "rados block device" | |
2219 | fi | |
2220 | rbd=no | |
2221 | fi | |
f27aaf4b CB |
2222 | fi |
2223 | ||
5c6c3a6c CH |
2224 | ########################################## |
2225 | # linux-aio probe | |
5c6c3a6c CH |
2226 | |
2227 | if test "$linux_aio" != "no" ; then | |
2228 | cat > $TMPC <<EOF | |
2229 | #include <libaio.h> | |
2230 | #include <sys/eventfd.h> | |
832ce9c2 | 2231 | #include <stddef.h> |
5c6c3a6c CH |
2232 | int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } |
2233 | EOF | |
2234 | if compile_prog "" "-laio" ; then | |
2235 | linux_aio=yes | |
048d179f PB |
2236 | libs_softmmu="$libs_softmmu -laio" |
2237 | libs_tools="$libs_tools -laio" | |
5c6c3a6c CH |
2238 | else |
2239 | if test "$linux_aio" = "yes" ; then | |
2240 | feature_not_found "linux AIO" | |
2241 | fi | |
3cfcae3c | 2242 | linux_aio=no |
5c6c3a6c CH |
2243 | fi |
2244 | fi | |
2245 | ||
758e8e38 VJJ |
2246 | ########################################## |
2247 | # attr probe | |
2248 | ||
2249 | if test "$attr" != "no" ; then | |
2250 | cat > $TMPC <<EOF | |
2251 | #include <stdio.h> | |
2252 | #include <sys/types.h> | |
f2338fb4 PB |
2253 | #ifdef CONFIG_LIBATTR |
2254 | #include <attr/xattr.h> | |
2255 | #else | |
4f26f2b6 | 2256 | #include <sys/xattr.h> |
f2338fb4 | 2257 | #endif |
758e8e38 VJJ |
2258 | int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } |
2259 | EOF | |
4f26f2b6 AK |
2260 | if compile_prog "" "" ; then |
2261 | attr=yes | |
2262 | # Older distros have <attr/xattr.h>, and need -lattr: | |
f2338fb4 | 2263 | elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then |
758e8e38 VJJ |
2264 | attr=yes |
2265 | LIBS="-lattr $LIBS" | |
4f26f2b6 | 2266 | libattr=yes |
758e8e38 VJJ |
2267 | else |
2268 | if test "$attr" = "yes" ; then | |
2269 | feature_not_found "ATTR" | |
2270 | fi | |
2271 | attr=no | |
2272 | fi | |
2273 | fi | |
2274 | ||
bf9298b9 AL |
2275 | ########################################## |
2276 | # iovec probe | |
2277 | cat > $TMPC <<EOF | |
db34f0b3 | 2278 | #include <sys/types.h> |
bf9298b9 | 2279 | #include <sys/uio.h> |
db34f0b3 | 2280 | #include <unistd.h> |
f91f9bee | 2281 | int main(void) { return sizeof(struct iovec); } |
bf9298b9 AL |
2282 | EOF |
2283 | iovec=no | |
52166aa0 | 2284 | if compile_prog "" "" ; then |
bf9298b9 AL |
2285 | iovec=yes |
2286 | fi | |
2287 | ||
ceb42de8 AL |
2288 | ########################################## |
2289 | # preadv probe | |
2290 | cat > $TMPC <<EOF | |
2291 | #include <sys/types.h> | |
2292 | #include <sys/uio.h> | |
2293 | #include <unistd.h> | |
c075a723 | 2294 | int main(void) { return preadv(0, 0, 0, 0); } |
ceb42de8 AL |
2295 | EOF |
2296 | preadv=no | |
52166aa0 | 2297 | if compile_prog "" "" ; then |
ceb42de8 AL |
2298 | preadv=yes |
2299 | fi | |
2300 | ||
f652e6af AJ |
2301 | ########################################## |
2302 | # fdt probe | |
2df87df7 | 2303 | if test "$fdt" != "no" ; then |
b41af4ba JQ |
2304 | fdt_libs="-lfdt" |
2305 | cat > $TMPC << EOF | |
f652e6af AJ |
2306 | int main(void) { return 0; } |
2307 | EOF | |
52166aa0 | 2308 | if compile_prog "" "$fdt_libs" ; then |
f652e6af | 2309 | fdt=yes |
2df87df7 JQ |
2310 | else |
2311 | if test "$fdt" = "yes" ; then | |
2312 | feature_not_found "fdt" | |
2313 | fi | |
de3a354a | 2314 | fdt_libs= |
2df87df7 | 2315 | fdt=no |
f652e6af AJ |
2316 | fi |
2317 | fi | |
2318 | ||
20ff075b MW |
2319 | ########################################## |
2320 | # opengl probe, used by milkymist-tmu2 | |
2321 | if test "$opengl" != "no" ; then | |
2322 | opengl_libs="-lGL" | |
2323 | cat > $TMPC << EOF | |
2324 | #include <X11/Xlib.h> | |
2325 | #include <GL/gl.h> | |
2326 | #include <GL/glx.h> | |
84972cbb | 2327 | int main(void) { return GL_VERSION != 0; } |
20ff075b MW |
2328 | EOF |
2329 | if compile_prog "" "-lGL" ; then | |
2330 | opengl=yes | |
20ff075b MW |
2331 | else |
2332 | if test "$opengl" = "yes" ; then | |
2333 | feature_not_found "opengl" | |
2334 | fi | |
de3a354a | 2335 | opengl_libs= |
20ff075b MW |
2336 | opengl=no |
2337 | fi | |
2338 | fi | |
2339 | ||
3b3f24ad AJ |
2340 | # |
2341 | # Check for xxxat() functions when we are building linux-user | |
2342 | # emulator. This is done because older glibc versions don't | |
2343 | # have syscall stubs for these implemented. | |
2344 | # | |
2345 | atfile=no | |
67ba57f6 | 2346 | cat > $TMPC << EOF |
3b3f24ad AJ |
2347 | #define _ATFILE_SOURCE |
2348 | #include <sys/types.h> | |
2349 | #include <fcntl.h> | |
2350 | #include <unistd.h> | |
2351 | ||
2352 | int | |
2353 | main(void) | |
2354 | { | |
2355 | /* try to unlink nonexisting file */ | |
2356 | return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); | |
2357 | } | |
2358 | EOF | |
52166aa0 | 2359 | if compile_prog "" "" ; then |
67ba57f6 | 2360 | atfile=yes |
3b3f24ad AJ |
2361 | fi |
2362 | ||
39386ac7 | 2363 | # Check for inotify functions when we are building linux-user |
3b3f24ad AJ |
2364 | # emulator. This is done because older glibc versions don't |
2365 | # have syscall stubs for these implemented. In that case we | |
2366 | # don't provide them even if kernel supports them. | |
2367 | # | |
2368 | inotify=no | |
67ba57f6 | 2369 | cat > $TMPC << EOF |
3b3f24ad AJ |
2370 | #include <sys/inotify.h> |
2371 | ||
2372 | int | |
2373 | main(void) | |
2374 | { | |
2375 | /* try to start inotify */ | |
8690e420 | 2376 | return inotify_init(); |
3b3f24ad AJ |
2377 | } |
2378 | EOF | |
52166aa0 | 2379 | if compile_prog "" "" ; then |
67ba57f6 | 2380 | inotify=yes |
3b3f24ad AJ |
2381 | fi |
2382 | ||
c05c7a73 RV |
2383 | inotify1=no |
2384 | cat > $TMPC << EOF | |
2385 | #include <sys/inotify.h> | |
2386 | ||
2387 | int | |
2388 | main(void) | |
2389 | { | |
2390 | /* try to start inotify */ | |
2391 | return inotify_init1(0); | |
2392 | } | |
2393 | EOF | |
2394 | if compile_prog "" "" ; then | |
2395 | inotify1=yes | |
2396 | fi | |
2397 | ||
ebc996f3 RV |
2398 | # check if utimensat and futimens are supported |
2399 | utimens=no | |
2400 | cat > $TMPC << EOF | |
2401 | #define _ATFILE_SOURCE | |
ebc996f3 RV |
2402 | #include <stddef.h> |
2403 | #include <fcntl.h> | |
3014ee00 | 2404 | #include <sys/stat.h> |
ebc996f3 RV |
2405 | |
2406 | int main(void) | |
2407 | { | |
2408 | utimensat(AT_FDCWD, "foo", NULL, 0); | |
2409 | futimens(0, NULL); | |
2410 | return 0; | |
2411 | } | |
2412 | EOF | |
52166aa0 | 2413 | if compile_prog "" "" ; then |
ebc996f3 RV |
2414 | utimens=yes |
2415 | fi | |
2416 | ||
099d6b0f RV |
2417 | # check if pipe2 is there |
2418 | pipe2=no | |
2419 | cat > $TMPC << EOF | |
099d6b0f RV |
2420 | #include <unistd.h> |
2421 | #include <fcntl.h> | |
2422 | ||
2423 | int main(void) | |
2424 | { | |
2425 | int pipefd[2]; | |
2426 | pipe2(pipefd, O_CLOEXEC); | |
2427 | return 0; | |
2428 | } | |
2429 | EOF | |
52166aa0 | 2430 | if compile_prog "" "" ; then |
099d6b0f RV |
2431 | pipe2=yes |
2432 | fi | |
2433 | ||
40ff6d7e KW |
2434 | # check if accept4 is there |
2435 | accept4=no | |
2436 | cat > $TMPC << EOF | |
40ff6d7e KW |
2437 | #include <sys/socket.h> |
2438 | #include <stddef.h> | |
2439 | ||
2440 | int main(void) | |
2441 | { | |
2442 | accept4(0, NULL, NULL, SOCK_CLOEXEC); | |
2443 | return 0; | |
2444 | } | |
2445 | EOF | |
2446 | if compile_prog "" "" ; then | |
2447 | accept4=yes | |
2448 | fi | |
2449 | ||
3ce34dfb | 2450 | # check if tee/splice is there. vmsplice was added same time. |
2451 | splice=no | |
2452 | cat > $TMPC << EOF | |
3ce34dfb | 2453 | #include <unistd.h> |
2454 | #include <fcntl.h> | |
2455 | #include <limits.h> | |
2456 | ||
2457 | int main(void) | |
2458 | { | |
66ea0f22 | 2459 | int len, fd = 0; |
3ce34dfb | 2460 | len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); |
2461 | splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); | |
2462 | return 0; | |
2463 | } | |
2464 | EOF | |
52166aa0 | 2465 | if compile_prog "" "" ; then |
3ce34dfb | 2466 | splice=yes |
2467 | fi | |
2468 | ||
dcc38d1c MT |
2469 | ########################################## |
2470 | # signalfd probe | |
2471 | signalfd="no" | |
2472 | cat > $TMPC << EOF | |
dcc38d1c MT |
2473 | #include <unistd.h> |
2474 | #include <sys/syscall.h> | |
2475 | #include <signal.h> | |
2476 | int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } | |
2477 | EOF | |
2478 | ||
2479 | if compile_prog "" "" ; then | |
2480 | signalfd=yes | |
2481 | fi | |
2482 | ||
c2882b96 RV |
2483 | # check if eventfd is supported |
2484 | eventfd=no | |
2485 | cat > $TMPC << EOF | |
2486 | #include <sys/eventfd.h> | |
2487 | ||
2488 | int main(void) | |
2489 | { | |
55cc7f3e | 2490 | return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); |
c2882b96 RV |
2491 | } |
2492 | EOF | |
2493 | if compile_prog "" "" ; then | |
2494 | eventfd=yes | |
2495 | fi | |
2496 | ||
d0927938 UH |
2497 | # check for fallocate |
2498 | fallocate=no | |
2499 | cat > $TMPC << EOF | |
2500 | #include <fcntl.h> | |
2501 | ||
2502 | int main(void) | |
2503 | { | |
2504 | fallocate(0, 0, 0, 0); | |
2505 | return 0; | |
2506 | } | |
2507 | EOF | |
8fb03151 | 2508 | if compile_prog "" "" ; then |
d0927938 UH |
2509 | fallocate=yes |
2510 | fi | |
2511 | ||
c727f47d PM |
2512 | # check for sync_file_range |
2513 | sync_file_range=no | |
2514 | cat > $TMPC << EOF | |
2515 | #include <fcntl.h> | |
2516 | ||
2517 | int main(void) | |
2518 | { | |
2519 | sync_file_range(0, 0, 0, 0); | |
2520 | return 0; | |
2521 | } | |
2522 | EOF | |
8fb03151 | 2523 | if compile_prog "" "" ; then |
c727f47d PM |
2524 | sync_file_range=yes |
2525 | fi | |
2526 | ||
dace20dc PM |
2527 | # check for linux/fiemap.h and FS_IOC_FIEMAP |
2528 | fiemap=no | |
2529 | cat > $TMPC << EOF | |
2530 | #include <sys/ioctl.h> | |
2531 | #include <linux/fs.h> | |
2532 | #include <linux/fiemap.h> | |
2533 | ||
2534 | int main(void) | |
2535 | { | |
2536 | ioctl(0, FS_IOC_FIEMAP, 0); | |
2537 | return 0; | |
2538 | } | |
2539 | EOF | |
8fb03151 | 2540 | if compile_prog "" "" ; then |
dace20dc PM |
2541 | fiemap=yes |
2542 | fi | |
2543 | ||
d0927938 UH |
2544 | # check for dup3 |
2545 | dup3=no | |
2546 | cat > $TMPC << EOF | |
2547 | #include <unistd.h> | |
2548 | ||
2549 | int main(void) | |
2550 | { | |
2551 | dup3(0, 0, 0); | |
2552 | return 0; | |
2553 | } | |
2554 | EOF | |
78f5d726 | 2555 | if compile_prog "" "" ; then |
d0927938 UH |
2556 | dup3=yes |
2557 | fi | |
2558 | ||
3b6edd16 PM |
2559 | # check for epoll support |
2560 | epoll=no | |
2561 | cat > $TMPC << EOF | |
2562 | #include <sys/epoll.h> | |
2563 | ||
2564 | int main(void) | |
2565 | { | |
2566 | epoll_create(0); | |
2567 | return 0; | |
2568 | } | |
2569 | EOF | |
8fb03151 | 2570 | if compile_prog "" "" ; then |
3b6edd16 PM |
2571 | epoll=yes |
2572 | fi | |
2573 | ||
2574 | # epoll_create1 and epoll_pwait are later additions | |
2575 | # so we must check separately for their presence | |
2576 | epoll_create1=no | |
2577 | cat > $TMPC << EOF | |
2578 | #include <sys/epoll.h> | |
2579 | ||
2580 | int main(void) | |
2581 | { | |
19e83f6b PM |
2582 | /* Note that we use epoll_create1 as a value, not as |
2583 | * a function being called. This is necessary so that on | |
2584 | * old SPARC glibc versions where the function was present in | |
2585 | * the library but not declared in the header file we will | |
2586 | * fail the configure check. (Otherwise we will get a compiler | |
2587 | * warning but not an error, and will proceed to fail the | |
2588 | * qemu compile where we compile with -Werror.) | |
2589 | */ | |
c075a723 | 2590 | return (int)(uintptr_t)&epoll_create1; |
3b6edd16 PM |
2591 | } |
2592 | EOF | |
8fb03151 | 2593 | if compile_prog "" "" ; then |
3b6edd16 PM |
2594 | epoll_create1=yes |
2595 | fi | |
2596 | ||
2597 | epoll_pwait=no | |
2598 | cat > $TMPC << EOF | |
2599 | #include <sys/epoll.h> | |
2600 | ||
2601 | int main(void) | |
2602 | { | |
2603 | epoll_pwait(0, 0, 0, 0, 0); | |
2604 | return 0; | |
2605 | } | |
2606 | EOF | |
8fb03151 | 2607 | if compile_prog "" "" ; then |
3b6edd16 PM |
2608 | epoll_pwait=yes |
2609 | fi | |
2610 | ||
cc8ae6de | 2611 | # Check if tools are available to build documentation. |
a25dba17 | 2612 | if test "$docs" != "no" ; then |
01668d98 | 2613 | if has makeinfo && has pod2man; then |
a25dba17 | 2614 | docs=yes |
83a3ab8b | 2615 | else |
a25dba17 JQ |
2616 | if test "$docs" = "yes" ; then |
2617 | feature_not_found "docs" | |
83a3ab8b | 2618 | fi |
a25dba17 | 2619 | docs=no |
83a3ab8b | 2620 | fi |
cc8ae6de PB |
2621 | fi |
2622 | ||
f514f41c | 2623 | # Search for bswap_32 function |
6ae9a1f4 JQ |
2624 | byteswap_h=no |
2625 | cat > $TMPC << EOF | |
2626 | #include <byteswap.h> | |
2627 | int main(void) { return bswap_32(0); } | |
2628 | EOF | |
52166aa0 | 2629 | if compile_prog "" "" ; then |
6ae9a1f4 JQ |
2630 | byteswap_h=yes |
2631 | fi | |
2632 | ||
f514f41c | 2633 | # Search for bswap_32 function |
6ae9a1f4 JQ |
2634 | bswap_h=no |
2635 | cat > $TMPC << EOF | |
2636 | #include <sys/endian.h> | |
2637 | #include <sys/types.h> | |
2638 | #include <machine/bswap.h> | |
2639 | int main(void) { return bswap32(0); } | |
2640 | EOF | |
52166aa0 | 2641 | if compile_prog "" "" ; then |
6ae9a1f4 JQ |
2642 | bswap_h=yes |
2643 | fi | |
2644 | ||
c589b249 RS |
2645 | ########################################## |
2646 | # Do we have libiscsi | |
fa6acb0c RS |
2647 | # We check for iscsi_unmap_sync() to make sure we have a |
2648 | # recent enough version of libiscsi. | |
c589b249 RS |
2649 | if test "$libiscsi" != "no" ; then |
2650 | cat > $TMPC << EOF | |
fa6acb0c | 2651 | #include <stdio.h> |
c589b249 | 2652 | #include <iscsi/iscsi.h> |
fa6acb0c | 2653 | int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } |
c589b249 | 2654 | EOF |
417c9d72 | 2655 | if compile_prog "" "-liscsi" ; then |
c589b249 RS |
2656 | libiscsi="yes" |
2657 | LIBS="$LIBS -liscsi" | |
2658 | else | |
2659 | if test "$libiscsi" = "yes" ; then | |
2660 | feature_not_found "libiscsi" | |
2661 | fi | |
2662 | libiscsi="no" | |
2663 | fi | |
2664 | fi | |
2665 | ||
2666 | ||
da93a1fd AL |
2667 | ########################################## |
2668 | # Do we need librt | |
2669 | cat > $TMPC <<EOF | |
2670 | #include <signal.h> | |
2671 | #include <time.h> | |
66ea0f22 | 2672 | int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } |
da93a1fd AL |
2673 | EOF |
2674 | ||
52166aa0 | 2675 | if compile_prog "" "" ; then |
07ffa4bd | 2676 | : |
52166aa0 | 2677 | elif compile_prog "" "-lrt" ; then |
07ffa4bd | 2678 | LIBS="-lrt $LIBS" |
da93a1fd AL |
2679 | fi |
2680 | ||
31ff504d | 2681 | if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ |
179cf400 | 2682 | "$aix" != "yes" -a "$haiku" != "yes" ; then |
6362a53f JQ |
2683 | libs_softmmu="-lutil $libs_softmmu" |
2684 | fi | |
2685 | ||
de5071c5 | 2686 | ########################################## |
cd4ec0b4 GH |
2687 | # spice probe |
2688 | if test "$spice" != "no" ; then | |
2689 | cat > $TMPC << EOF | |
2690 | #include <spice.h> | |
2691 | int main(void) { spice_server_new(); return 0; } | |
2692 | EOF | |
710fc4f5 JD |
2693 | spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) |
2694 | spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) | |
4295e15a | 2695 | if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ |
7e3efdac | 2696 | $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ |
cd4ec0b4 GH |
2697 | compile_prog "$spice_cflags" "$spice_libs" ; then |
2698 | spice="yes" | |
2699 | libs_softmmu="$libs_softmmu $spice_libs" | |
2700 | QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" | |
2701 | else | |
2702 | if test "$spice" = "yes" ; then | |
2703 | feature_not_found "spice" | |
2704 | fi | |
2705 | spice="no" | |
2706 | fi | |
2707 | fi | |
2708 | ||
111a38b0 RR |
2709 | # check for libcacard for smartcard support |
2710 | if test "$smartcard" != "no" ; then | |
2711 | smartcard="yes" | |
2712 | smartcard_cflags="" | |
2713 | # TODO - what's the minimal nss version we support? | |
2714 | if test "$smartcard_nss" != "no"; then | |
5f01e06f ST |
2715 | cat > $TMPC << EOF |
2716 | #include <pk11pub.h> | |
2717 | int main(void) { PK11_FreeSlot(0); return 0; } | |
2718 | EOF | |
0b22ef0f | 2719 | smartcard_includes="-I\$(SRC_PATH)/libcacard" |
8c741c22 AL |
2720 | libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" |
2721 | libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" | |
6ca026cb PM |
2722 | test_cflags="$libcacard_cflags" |
2723 | # The header files in nss < 3.13.3 have a bug which causes them to | |
2724 | # emit a warning. If we're going to compile QEMU with -Werror, then | |
2725 | # test that the headers don't have this bug. Otherwise we would pass | |
2726 | # the configure test but fail to compile QEMU later. | |
2727 | if test "$werror" = "yes"; then | |
2728 | test_cflags="-Werror $test_cflags" | |
2729 | fi | |
5f01e06f | 2730 | if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ |
6ca026cb | 2731 | compile_prog "$test_cflags" "$libcacard_libs"; then |
111a38b0 | 2732 | smartcard_nss="yes" |
0b22ef0f PM |
2733 | QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" |
2734 | QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" | |
ad4cf3f6 | 2735 | libs_softmmu="$libcacard_libs $libs_softmmu" |
111a38b0 RR |
2736 | else |
2737 | if test "$smartcard_nss" = "yes"; then | |
2738 | feature_not_found "nss" | |
2739 | fi | |
2740 | smartcard_nss="no" | |
2741 | fi | |
2742 | fi | |
2743 | fi | |
2744 | if test "$smartcard" = "no" ; then | |
2745 | smartcard_nss="no" | |
2746 | fi | |
2747 | ||
69354a83 HG |
2748 | # check for usbredirparser for usb network redirection support |
2749 | if test "$usb_redir" != "no" ; then | |
097a66ef | 2750 | if $pkg_config --atleast-version=0.3.4 libusbredirparser >/dev/null 2>&1 ; then |
69354a83 HG |
2751 | usb_redir="yes" |
2752 | usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null) | |
2753 | usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null) | |
2754 | QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" | |
2755 | LIBS="$LIBS $usb_redir_libs" | |
2756 | else | |
2757 | if test "$usb_redir" = "yes"; then | |
2758 | feature_not_found "usb-redir" | |
2759 | fi | |
2760 | usb_redir="no" | |
2761 | fi | |
2762 | fi | |
2763 | ||
cd4ec0b4 GH |
2764 | ########################################## |
2765 | ||
5f6b9e8f BS |
2766 | ########################################## |
2767 | # check if we have fdatasync | |
2768 | ||
2769 | fdatasync=no | |
2770 | cat > $TMPC << EOF | |
2771 | #include <unistd.h> | |
d1722a27 AR |
2772 | int main(void) { |
2773 | #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 | |
2774 | return fdatasync(0); | |
2775 | #else | |
e172fe11 | 2776 | #error Not supported |
d1722a27 AR |
2777 | #endif |
2778 | } | |
5f6b9e8f BS |
2779 | EOF |
2780 | if compile_prog "" "" ; then | |
2781 | fdatasync=yes | |
2782 | fi | |
2783 | ||
e78815a5 AF |
2784 | ########################################## |
2785 | # check if we have madvise | |
2786 | ||
2787 | madvise=no | |
2788 | cat > $TMPC << EOF | |
2789 | #include <sys/types.h> | |
2790 | #include <sys/mman.h> | |
832ce9c2 | 2791 | #include <stddef.h> |
e78815a5 AF |
2792 | int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } |
2793 | EOF | |
2794 | if compile_prog "" "" ; then | |
2795 | madvise=yes | |
2796 | fi | |
2797 | ||
2798 | ########################################## | |
2799 | # check if we have posix_madvise | |
2800 | ||
2801 | posix_madvise=no | |
2802 | cat > $TMPC << EOF | |
2803 | #include <sys/mman.h> | |
832ce9c2 | 2804 | #include <stddef.h> |
e78815a5 AF |
2805 | int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } |
2806 | EOF | |
2807 | if compile_prog "" "" ; then | |
2808 | posix_madvise=yes | |
2809 | fi | |
2810 | ||
94a420b1 SH |
2811 | ########################################## |
2812 | # check if trace backend exists | |
2813 | ||
650ab98d | 2814 | $python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null |
94a420b1 SH |
2815 | if test "$?" -ne 0 ; then |
2816 | echo | |
2817 | echo "Error: invalid trace backend" | |
2818 | echo "Please choose a supported trace backend." | |
2819 | echo | |
2820 | exit 1 | |
2821 | fi | |
2822 | ||
7e24e92a SH |
2823 | ########################################## |
2824 | # For 'ust' backend, test if ust headers are present | |
2825 | if test "$trace_backend" = "ust"; then | |
2826 | cat > $TMPC << EOF | |
2827 | #include <ust/tracepoint.h> | |
2828 | #include <ust/marker.h> | |
2829 | int main(void) { return 0; } | |
2830 | EOF | |
2831 | if compile_prog "" "" ; then | |
94b4fefa | 2832 | LIBS="-lust -lurcu-bp $LIBS" |
c9a2e37c | 2833 | libs_qga="-lust -lurcu-bp $libs_qga" |
7e24e92a SH |
2834 | else |
2835 | echo | |
2836 | echo "Error: Trace backend 'ust' missing libust header files" | |
2837 | echo | |
2838 | exit 1 | |
2839 | fi | |
2840 | fi | |
b3d08c02 DB |
2841 | |
2842 | ########################################## | |
2843 | # For 'dtrace' backend, test if 'dtrace' command is present | |
2844 | if test "$trace_backend" = "dtrace"; then | |
2845 | if ! has 'dtrace' ; then | |
2846 | echo | |
2847 | echo "Error: dtrace command is not found in PATH $PATH" | |
2848 | echo | |
2849 | exit 1 | |
2850 | fi | |
c276b17d DB |
2851 | trace_backend_stap="no" |
2852 | if has 'stap' ; then | |
2853 | trace_backend_stap="yes" | |
2854 | fi | |
b3d08c02 DB |
2855 | fi |
2856 | ||
023367e6 WM |
2857 | ########################################## |
2858 | # __sync_fetch_and_and requires at least -march=i486. Many toolchains | |
2859 | # use i686 as default anyway, but for those that don't, an explicit | |
2860 | # specification is necessary | |
1ba16968 | 2861 | if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then |
023367e6 | 2862 | cat > $TMPC << EOF |
7ace252a | 2863 | static int sfaa(int *ptr) |
023367e6 WM |
2864 | { |
2865 | return __sync_fetch_and_and(ptr, 0); | |
2866 | } | |
2867 | ||
2868 | int main(int argc, char **argv) | |
2869 | { | |
2870 | int val = 42; | |
2871 | sfaa(&val); | |
2872 | return val; | |
2873 | } | |
2874 | EOF | |
2875 | if ! compile_prog "" "" ; then | |
caa50971 | 2876 | QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" |
023367e6 WM |
2877 | fi |
2878 | fi | |
2879 | ||
d0e2fce5 | 2880 | ########################################## |
519175a2 | 2881 | # check and set a backend for coroutine |
d0e2fce5 | 2882 | |
519175a2 AB |
2883 | # default is ucontext, but always fallback to gthread |
2884 | # windows autodetected by make | |
2885 | if test "$coroutine" = "" -o "$coroutine" = "ucontext"; then | |
2886 | if test "$darwin" != "yes"; then | |
2887 | cat > $TMPC << EOF | |
d0e2fce5 | 2888 | #include <ucontext.h> |
cdf84806 PM |
2889 | #ifdef __stub_makecontext |
2890 | #error Ignoring glibc stub makecontext which will always fail | |
2891 | #endif | |
75cafad7 | 2892 | int main(void) { makecontext(0, 0, 0); return 0; } |
d0e2fce5 | 2893 | EOF |
519175a2 AB |
2894 | if compile_prog "" "" ; then |
2895 | coroutine_backend=ucontext | |
2896 | else | |
2897 | coroutine_backend=gthread | |
2898 | fi | |
2899 | else | |
2900 | echo "Silently falling back into gthread backend under darwin" | |
d0e2fce5 | 2901 | fi |
519175a2 AB |
2902 | elif test "$coroutine" = "gthread" ; then |
2903 | coroutine_backend=gthread | |
2904 | elif test "$coroutine" = "windows" ; then | |
2905 | coroutine_backend=windows | |
fe91bfa8 AB |
2906 | elif test "$coroutine" = "sigaltstack" ; then |
2907 | coroutine_backend=sigaltstack | |
519175a2 AB |
2908 | else |
2909 | echo | |
2910 | echo "Error: unknown coroutine backend $coroutine" | |
2911 | echo | |
2912 | exit 1 | |
d0e2fce5 AK |
2913 | fi |
2914 | ||
d2042378 AK |
2915 | ########################################## |
2916 | # check if we have open_by_handle_at | |
2917 | ||
4e1797f9 | 2918 | open_by_handle_at=no |
d2042378 AK |
2919 | cat > $TMPC << EOF |
2920 | #include <fcntl.h> | |
acc55ba8 SW |
2921 | #if !defined(AT_EMPTY_PATH) |
2922 | # error missing definition | |
2923 | #else | |
75cafad7 | 2924 | int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } |
acc55ba8 | 2925 | #endif |
d2042378 AK |
2926 | EOF |
2927 | if compile_prog "" "" ; then | |
2928 | open_by_handle_at=yes | |
2929 | fi | |
2930 | ||
e06a765e HPB |
2931 | ######################################## |
2932 | # check if we have linux/magic.h | |
2933 | ||
2934 | linux_magic_h=no | |
2935 | cat > $TMPC << EOF | |
2936 | #include <linux/magic.h> | |
2937 | int main(void) { | |
75cafad7 | 2938 | return 0; |
e06a765e HPB |
2939 | } |
2940 | EOF | |
2941 | if compile_prog "" "" ; then | |
2942 | linux_magic_h=yes | |
2943 | fi | |
2944 | ||
06d71fa1 PM |
2945 | ######################################## |
2946 | # check whether we can disable the -Wunused-but-set-variable | |
2947 | # option with a pragma (this is needed to silence a warning in | |
2948 | # some versions of the valgrind VALGRIND_STACK_DEREGISTER macro.) | |
2949 | # This test has to be compiled with -Werror as otherwise an | |
2950 | # unknown pragma is only a warning. | |
2951 | pragma_disable_unused_but_set=no | |
2952 | cat > $TMPC << EOF | |
2953 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable" | |
2954 | int main(void) { | |
2955 | return 0; | |
2956 | } | |
2957 | EOF | |
2958 | if compile_prog "-Werror" "" ; then | |
2959 | pragma_disable_unused_but_set=yes | |
2960 | fi | |
2961 | ||
3f4349dc KW |
2962 | ######################################## |
2963 | # check if we have valgrind/valgrind.h | |
2964 | ||
2965 | valgrind_h=no | |
2966 | cat > $TMPC << EOF | |
2967 | #include <valgrind/valgrind.h> | |
3f4349dc | 2968 | int main(void) { |
3f4349dc KW |
2969 | return 0; |
2970 | } | |
2971 | EOF | |
2972 | if compile_prog "" "" ; then | |
2973 | valgrind_h=yes | |
2974 | fi | |
2975 | ||
8ab1bf12 LC |
2976 | ######################################## |
2977 | # check if environ is declared | |
2978 | ||
2979 | has_environ=no | |
2980 | cat > $TMPC << EOF | |
2981 | #include <unistd.h> | |
2982 | int main(void) { | |
c075a723 | 2983 | environ = 0; |
8ab1bf12 LC |
2984 | return 0; |
2985 | } | |
2986 | EOF | |
2987 | if compile_prog "" "" ; then | |
2988 | has_environ=yes | |
2989 | fi | |
2990 | ||
7e24e92a | 2991 | ########################################## |
e86ecd4b JQ |
2992 | # End of CC checks |
2993 | # After here, no more $cc or $ld runs | |
2994 | ||
e86ecd4b | 2995 | if test "$debug" = "no" ; then |
8be74dc0 | 2996 | CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS" |
e86ecd4b | 2997 | fi |
a316e378 | 2998 | |
20ff6c80 AL |
2999 | # Disable zero malloc errors for official releases unless explicitly told to |
3000 | # enable/disable | |
3001 | if test -z "$zero_malloc" ; then | |
3002 | if test "$z_version" = "50" ; then | |
3003 | zero_malloc="no" | |
3004 | else | |
3005 | zero_malloc="yes" | |
3006 | fi | |
3007 | fi | |
3008 | ||
6ca026cb PM |
3009 | # Now we've finished running tests it's OK to add -Werror to the compiler flags |
3010 | if test "$werror" = "yes"; then | |
3011 | QEMU_CFLAGS="-Werror $QEMU_CFLAGS" | |
3012 | fi | |
3013 | ||
e86ecd4b JQ |
3014 | if test "$solaris" = "no" ; then |
3015 | if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then | |
1156c669 | 3016 | LDFLAGS="-Wl,--warn-common $LDFLAGS" |
e86ecd4b JQ |
3017 | fi |
3018 | fi | |
3019 | ||
94dd53c5 GH |
3020 | # test if pod2man has --utf8 option |
3021 | if pod2man --help | grep -q utf8; then | |
3022 | POD2MAN="pod2man --utf8" | |
3023 | else | |
3024 | POD2MAN="pod2man" | |
3025 | fi | |
3026 | ||
952afb71 BS |
3027 | # Use ASLR, no-SEH and DEP if available |
3028 | if test "$mingw32" = "yes" ; then | |
3029 | for flag in --dynamicbase --no-seh --nxcompat; do | |
3030 | if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then | |
3031 | LDFLAGS="-Wl,$flag $LDFLAGS" | |
3032 | fi | |
3033 | done | |
3034 | fi | |
3035 | ||
10ea68b3 | 3036 | qemu_confdir=$sysconfdir$confsuffix |
528ae5b8 | 3037 | qemu_datadir=$datadir$confsuffix |
e7b45cc4 | 3038 | |
ca35f780 PB |
3039 | tools= |
3040 | if test "$softmmu" = yes ; then | |
3041 | tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" | |
983eef5a | 3042 | if test "$virtfs" != no ; then |
aabfd88d AF |
3043 | if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then |
3044 | virtfs=yes | |
3045 | tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" | |
3046 | else | |
3047 | if test "$virtfs" = yes; then | |
263ddcc8 HPB |
3048 | echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" |
3049 | exit 1 | |
983eef5a | 3050 | fi |
17500370 | 3051 | virtfs=no |
aabfd88d | 3052 | fi |
17bff52b | 3053 | fi |
ca35f780 PB |
3054 | if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then |
3055 | tools="qemu-nbd\$(EXESUF) $tools" | |
d138cee9 | 3056 | if [ "$guest_agent" = "yes" ]; then |
48ff7a62 | 3057 | tools="qemu-ga\$(EXESUF) $tools" |
d138cee9 | 3058 | fi |
ca35f780 PB |
3059 | fi |
3060 | fi | |
00c705fb PB |
3061 | if test "$smartcard_nss" = "yes" ; then |
3062 | tools="vscclient\$(EXESUF) $tools" | |
3063 | fi | |
ca35f780 PB |
3064 | |
3065 | # Mac OS X ships with a broken assembler | |
3066 | roms= | |
3067 | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ | |
3068 | "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ | |
3069 | "$softmmu" = yes ; then | |
3070 | roms="optionrom" | |
3071 | fi | |
d0384d1d | 3072 | if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then |
39ac8455 DG |
3073 | roms="$roms spapr-rtas" |
3074 | fi | |
ca35f780 | 3075 | |
43ce4dfe | 3076 | echo "Install prefix $prefix" |
c00b2808 | 3077 | echo "BIOS directory `eval echo $qemu_datadir`" |
f2b9e1e3 | 3078 | echo "binary directory `eval echo $bindir`" |
3aa5d2be | 3079 | echo "library directory `eval echo $libdir`" |
0f94d6da | 3080 | echo "include directory `eval echo $includedir`" |
1c0fd160 | 3081 | echo "config directory `eval echo $sysconfdir`" |
11d9f695 | 3082 | if test "$mingw32" = "no" ; then |
f2b9e1e3 | 3083 | echo "Manual directory `eval echo $mandir`" |
43ce4dfe | 3084 | echo "ELF interp prefix $interp_prefix" |
11d9f695 | 3085 | fi |
5a67135a | 3086 | echo "Source path $source_path" |
43ce4dfe | 3087 | echo "C compiler $cc" |
83469015 | 3088 | echo "Host C compiler $host_cc" |
3c4a4d0d | 3089 | echo "Objective-C compiler $objcc" |
0c439cbf | 3090 | echo "CFLAGS $CFLAGS" |
a558ee17 | 3091 | echo "QEMU_CFLAGS $QEMU_CFLAGS" |
0c439cbf | 3092 | echo "LDFLAGS $LDFLAGS" |
43ce4dfe | 3093 | echo "make $make" |
6a882643 | 3094 | echo "install $install" |
c886edfb | 3095 | echo "python $python" |
e2d8830e B |
3096 | if test "$slirp" = "yes" ; then |
3097 | echo "smbd $smbd" | |
3098 | fi | |
43ce4dfe | 3099 | echo "host CPU $cpu" |
de83cd02 | 3100 | echo "host big endian $bigendian" |
97a847bc | 3101 | echo "target list $target_list" |
ade25b0d | 3102 | echo "tcg debug enabled $debug_tcg" |
43ce4dfe | 3103 | echo "gprof enabled $gprof" |
03b4fe7d | 3104 | echo "sparse enabled $sparse" |
1625af87 | 3105 | echo "strip binaries $strip_opt" |
05c2a3e7 | 3106 | echo "profiler $profiler" |
43ce4dfe | 3107 | echo "static build $static" |
85aa5189 | 3108 | echo "-Werror enabled $werror" |
5b0753e0 FB |
3109 | if test "$darwin" = "yes" ; then |
3110 | echo "Cocoa support $cocoa" | |
3111 | fi | |
97a847bc | 3112 | echo "SDL support $sdl" |
4d3b6f6e | 3113 | echo "curses support $curses" |
769ce76d | 3114 | echo "curl support $curl" |
67b915a5 | 3115 | echo "mingw32 support $mingw32" |
0c58ac1c | 3116 | echo "Audio drivers $audio_drv_list" |
3117 | echo "Extra audio cards $audio_card_list" | |
eb852011 | 3118 | echo "Block whitelist $block_drv_whitelist" |
8ff9cbf7 | 3119 | echo "Mixer emulation $mixemu" |
983eef5a | 3120 | echo "VirtFS support $virtfs" |
821601ea JS |
3121 | echo "VNC support $vnc" |
3122 | if test "$vnc" = "yes" ; then | |
3123 | echo "VNC TLS support $vnc_tls" | |
3124 | echo "VNC SASL support $vnc_sasl" | |
3125 | echo "VNC JPEG support $vnc_jpeg" | |
3126 | echo "VNC PNG support $vnc_png" | |
821601ea | 3127 | fi |
3142255c BS |
3128 | if test -n "$sparc_cpu"; then |
3129 | echo "Target Sparc Arch $sparc_cpu" | |
3130 | fi | |
e37630ca | 3131 | echo "xen support $xen" |
2e4d9fb1 | 3132 | echo "brlapi support $brlapi" |
a20a6f46 | 3133 | echo "bluez support $bluez" |
a25dba17 | 3134 | echo "Documentation $docs" |
c5937220 PB |
3135 | [ ! -z "$uname_release" ] && \ |
3136 | echo "uname -r $uname_release" | |
bd0c5661 | 3137 | echo "NPTL support $nptl" |
379f6698 | 3138 | echo "GUEST_BASE $guest_base" |
40d6444e | 3139 | echo "PIE $pie" |
8a16d273 | 3140 | echo "vde support $vde" |
5c6c3a6c | 3141 | echo "Linux AIO support $linux_aio" |
758e8e38 | 3142 | echo "ATTR/XATTR support $attr" |
77755340 | 3143 | echo "Install blobs $blobs" |
b31a0277 | 3144 | echo "KVM support $kvm" |
9195b2c2 | 3145 | echo "TCG interpreter $tcg_interpreter" |
f652e6af | 3146 | echo "fdt support $fdt" |
ceb42de8 | 3147 | echo "preadv support $preadv" |
5f6b9e8f | 3148 | echo "fdatasync $fdatasync" |
e78815a5 AF |
3149 | echo "madvise $madvise" |
3150 | echo "posix_madvise $posix_madvise" | |
ee682d27 | 3151 | echo "uuid support $uuid" |
47e98658 | 3152 | echo "libcap-ng support $cap_ng" |
d5970055 | 3153 | echo "vhost-net support $vhost_net" |
94a420b1 | 3154 | echo "Trace backend $trace_backend" |
9410b56c | 3155 | echo "Trace output file $trace_file-<pid>" |
cd4ec0b4 | 3156 | echo "spice support $spice" |
f27aaf4b | 3157 | echo "rbd support $rbd" |
dce512de | 3158 | echo "xfsctl support $xfs" |
111a38b0 | 3159 | echo "nss used $smartcard_nss" |
69354a83 | 3160 | echo "usb net redir $usb_redir" |
20ff075b | 3161 | echo "OpenGL support $opengl" |
c589b249 | 3162 | echo "libiscsi support $libiscsi" |
d138cee9 | 3163 | echo "build guest agent $guest_agent" |
f794573e | 3164 | echo "seccomp support $seccomp" |
519175a2 | 3165 | echo "coroutine backend $coroutine_backend" |
67b915a5 | 3166 | |
1ba16968 | 3167 | if test "$sdl_too_old" = "yes"; then |
24b55b96 | 3168 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
7c1f25b4 | 3169 | fi |
7d13299d | 3170 | |
98ec69ac | 3171 | config_host_mak="config-host.mak" |
4bf6b55b | 3172 | config_host_ld="config-host.ld" |
98ec69ac | 3173 | |
98ec69ac JQ |
3174 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
3175 | printf "# Configured with:" >> $config_host_mak | |
3176 | printf " '%s'" "$0" "$@" >> $config_host_mak | |
3177 | echo >> $config_host_mak | |
98ec69ac | 3178 | |
e6c3b0f7 | 3179 | echo all: >> $config_host_mak |
99d7cc75 PB |
3180 | echo "prefix=$prefix" >> $config_host_mak |
3181 | echo "bindir=$bindir" >> $config_host_mak | |
3aa5d2be | 3182 | echo "libdir=$libdir" >> $config_host_mak |
0f94d6da | 3183 | echo "includedir=$includedir" >> $config_host_mak |
99d7cc75 | 3184 | echo "mandir=$mandir" >> $config_host_mak |
99d7cc75 | 3185 | echo "sysconfdir=$sysconfdir" >> $config_host_mak |
22d07038 | 3186 | echo "qemu_confdir=$qemu_confdir" >> $config_host_mak |
9afa52ce EH |
3187 | echo "qemu_datadir=$qemu_datadir" >> $config_host_mak |
3188 | echo "qemu_docdir=$qemu_docdir" >> $config_host_mak | |
7b93fadf | 3189 | echo "libexecdir=\${prefix}/libexec" >> $config_host_mak |
a7c36ee4 | 3190 | echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak |
804edf29 | 3191 | |
98ec69ac | 3192 | echo "ARCH=$ARCH" >> $config_host_mak |
f8393946 | 3193 | if test "$debug_tcg" = "yes" ; then |
2358a494 | 3194 | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
f8393946 | 3195 | fi |
f3d08ee6 | 3196 | if test "$debug" = "yes" ; then |
2358a494 | 3197 | echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak |
f3d08ee6 | 3198 | fi |
1625af87 | 3199 | if test "$strip_opt" = "yes" ; then |
52ba784d | 3200 | echo "STRIP=${strip}" >> $config_host_mak |
1625af87 | 3201 | fi |
7d13299d | 3202 | if test "$bigendian" = "yes" ; then |
e2542fe2 | 3203 | echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak |
97a847bc | 3204 | fi |
67b915a5 | 3205 | if test "$mingw32" = "yes" ; then |
98ec69ac | 3206 | echo "CONFIG_WIN32=y" >> $config_host_mak |
9fe6de94 BS |
3207 | rc_version=`cat $source_path/VERSION` |
3208 | version_major=${rc_version%%.*} | |
3209 | rc_version=${rc_version#*.} | |
3210 | version_minor=${rc_version%%.*} | |
3211 | rc_version=${rc_version#*.} | |
3212 | version_subminor=${rc_version%%.*} | |
3213 | version_micro=0 | |
3214 | echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak | |
3215 | echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak | |
210fa556 | 3216 | else |
35f4df27 | 3217 | echo "CONFIG_POSIX=y" >> $config_host_mak |
dffcb71c MM |
3218 | fi |
3219 | ||
3220 | if test "$linux" = "yes" ; then | |
3221 | echo "CONFIG_LINUX=y" >> $config_host_mak | |
67b915a5 | 3222 | fi |
128ab2ff | 3223 | |
83fb7adf | 3224 | if test "$darwin" = "yes" ; then |
98ec69ac | 3225 | echo "CONFIG_DARWIN=y" >> $config_host_mak |
83fb7adf | 3226 | fi |
b29fe3ed | 3227 | |
3228 | if test "$aix" = "yes" ; then | |
98ec69ac | 3229 | echo "CONFIG_AIX=y" >> $config_host_mak |
b29fe3ed | 3230 | fi |
3231 | ||
ec530c81 | 3232 | if test "$solaris" = "yes" ; then |
98ec69ac | 3233 | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
2358a494 | 3234 | echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak |
0475a5ca | 3235 | if test "$needs_libsunmath" = "yes" ; then |
75b5a697 | 3236 | echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak |
0475a5ca | 3237 | fi |
ec530c81 | 3238 | fi |
179cf400 AF |
3239 | if test "$haiku" = "yes" ; then |
3240 | echo "CONFIG_HAIKU=y" >> $config_host_mak | |
3241 | fi | |
97a847bc | 3242 | if test "$static" = "yes" ; then |
98ec69ac | 3243 | echo "CONFIG_STATIC=y" >> $config_host_mak |
7d13299d | 3244 | fi |
1ba16968 | 3245 | if test "$profiler" = "yes" ; then |
2358a494 | 3246 | echo "CONFIG_PROFILER=y" >> $config_host_mak |
05c2a3e7 | 3247 | fi |
c20709aa | 3248 | if test "$slirp" = "yes" ; then |
98ec69ac | 3249 | echo "CONFIG_SLIRP=y" >> $config_host_mak |
e2d8830e | 3250 | echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak |
f9728943 | 3251 | QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" |
c20709aa | 3252 | fi |
8a16d273 | 3253 | if test "$vde" = "yes" ; then |
98ec69ac | 3254 | echo "CONFIG_VDE=y" >> $config_host_mak |
8a16d273 | 3255 | fi |
47e98658 CB |
3256 | if test "$cap_ng" = "yes" ; then |
3257 | echo "CONFIG_LIBCAP=y" >> $config_host_mak | |
3258 | fi | |
0c58ac1c | 3259 | for card in $audio_card_list; do |
bb55b712 | 3260 | def=CONFIG_`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'` |
98ec69ac | 3261 | echo "$def=y" >> $config_host_mak |
0c58ac1c | 3262 | done |
2358a494 | 3263 | echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak |
0c58ac1c | 3264 | for drv in $audio_drv_list; do |
bb55b712 | 3265 | def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` |
98ec69ac | 3266 | echo "$def=y" >> $config_host_mak |
923e4521 | 3267 | if test "$drv" = "fmod"; then |
7aac6cb1 | 3268 | echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak |
0c58ac1c | 3269 | fi |
3270 | done | |
67f86e8e JQ |
3271 | if test "$audio_pt_int" = "yes" ; then |
3272 | echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak | |
3273 | fi | |
d5631638 | 3274 | if test "$audio_win_int" = "yes" ; then |
3275 | echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak | |
3276 | fi | |
eb852011 | 3277 | echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak |
8ff9cbf7 | 3278 | if test "$mixemu" = "yes" ; then |
98ec69ac | 3279 | echo "CONFIG_MIXEMU=y" >> $config_host_mak |
8ff9cbf7 | 3280 | fi |
821601ea JS |
3281 | if test "$vnc" = "yes" ; then |
3282 | echo "CONFIG_VNC=y" >> $config_host_mak | |
3283 | fi | |
8d5d2d4c | 3284 | if test "$vnc_tls" = "yes" ; then |
98ec69ac | 3285 | echo "CONFIG_VNC_TLS=y" >> $config_host_mak |
525061bf | 3286 | echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak |
8d5d2d4c | 3287 | fi |
2f9606b3 | 3288 | if test "$vnc_sasl" = "yes" ; then |
98ec69ac | 3289 | echo "CONFIG_VNC_SASL=y" >> $config_host_mak |
60ddf533 | 3290 | echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak |
2f9606b3 | 3291 | fi |
821601ea | 3292 | if test "$vnc_jpeg" = "yes" ; then |
2f6f5c7a CC |
3293 | echo "CONFIG_VNC_JPEG=y" >> $config_host_mak |
3294 | echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak | |
3295 | fi | |
821601ea | 3296 | if test "$vnc_png" = "yes" ; then |
efe556ad CC |
3297 | echo "CONFIG_VNC_PNG=y" >> $config_host_mak |
3298 | echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak | |
3299 | fi | |
76655d6d | 3300 | if test "$fnmatch" = "yes" ; then |
2358a494 | 3301 | echo "CONFIG_FNMATCH=y" >> $config_host_mak |
76655d6d | 3302 | fi |
ee682d27 SW |
3303 | if test "$uuid" = "yes" ; then |
3304 | echo "CONFIG_UUID=y" >> $config_host_mak | |
3305 | fi | |
dce512de CH |
3306 | if test "$xfs" = "yes" ; then |
3307 | echo "CONFIG_XFS=y" >> $config_host_mak | |
3308 | fi | |
b1a550a0 | 3309 | qemu_version=`head $source_path/VERSION` |
98ec69ac | 3310 | echo "VERSION=$qemu_version" >>$config_host_mak |
2358a494 | 3311 | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
98ec69ac | 3312 | echo "SRC_PATH=$source_path" >> $config_host_mak |
98ec69ac | 3313 | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
a25dba17 | 3314 | if [ "$docs" = "yes" ] ; then |
98ec69ac | 3315 | echo "BUILD_DOCS=yes" >> $config_host_mak |
cc8ae6de | 3316 | fi |
1ac88f28 | 3317 | if test "$sdl" = "yes" ; then |
98ec69ac | 3318 | echo "CONFIG_SDL=y" >> $config_host_mak |
1ac88f28 | 3319 | echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak |
49ecc3fa FB |
3320 | fi |
3321 | if test "$cocoa" = "yes" ; then | |
98ec69ac | 3322 | echo "CONFIG_COCOA=y" >> $config_host_mak |
4d3b6f6e AZ |
3323 | fi |
3324 | if test "$curses" = "yes" ; then | |
98ec69ac | 3325 | echo "CONFIG_CURSES=y" >> $config_host_mak |
49ecc3fa | 3326 | fi |
3b3f24ad | 3327 | if test "$atfile" = "yes" ; then |
2358a494 | 3328 | echo "CONFIG_ATFILE=y" >> $config_host_mak |
3b3f24ad | 3329 | fi |
ebc996f3 | 3330 | if test "$utimens" = "yes" ; then |
2358a494 | 3331 | echo "CONFIG_UTIMENSAT=y" >> $config_host_mak |
ebc996f3 | 3332 | fi |
099d6b0f | 3333 | if test "$pipe2" = "yes" ; then |
2358a494 | 3334 | echo "CONFIG_PIPE2=y" >> $config_host_mak |
099d6b0f | 3335 | fi |
40ff6d7e KW |
3336 | if test "$accept4" = "yes" ; then |
3337 | echo "CONFIG_ACCEPT4=y" >> $config_host_mak | |
3338 | fi | |
3ce34dfb | 3339 | if test "$splice" = "yes" ; then |
2358a494 | 3340 | echo "CONFIG_SPLICE=y" >> $config_host_mak |
3ce34dfb | 3341 | fi |
c2882b96 RV |
3342 | if test "$eventfd" = "yes" ; then |
3343 | echo "CONFIG_EVENTFD=y" >> $config_host_mak | |
3344 | fi | |
d0927938 UH |
3345 | if test "$fallocate" = "yes" ; then |
3346 | echo "CONFIG_FALLOCATE=y" >> $config_host_mak | |
3347 | fi | |
c727f47d PM |
3348 | if test "$sync_file_range" = "yes" ; then |
3349 | echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak | |
3350 | fi | |
dace20dc PM |
3351 | if test "$fiemap" = "yes" ; then |
3352 | echo "CONFIG_FIEMAP=y" >> $config_host_mak | |
3353 | fi | |
d0927938 UH |
3354 | if test "$dup3" = "yes" ; then |
3355 | echo "CONFIG_DUP3=y" >> $config_host_mak | |
3356 | fi | |
3b6edd16 PM |
3357 | if test "$epoll" = "yes" ; then |
3358 | echo "CONFIG_EPOLL=y" >> $config_host_mak | |
3359 | fi | |
3360 | if test "$epoll_create1" = "yes" ; then | |
3361 | echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak | |
3362 | fi | |
3363 | if test "$epoll_pwait" = "yes" ; then | |
3364 | echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak | |
3365 | fi | |
3b3f24ad | 3366 | if test "$inotify" = "yes" ; then |
2358a494 | 3367 | echo "CONFIG_INOTIFY=y" >> $config_host_mak |
3b3f24ad | 3368 | fi |
c05c7a73 RV |
3369 | if test "$inotify1" = "yes" ; then |
3370 | echo "CONFIG_INOTIFY1=y" >> $config_host_mak | |
3371 | fi | |
6ae9a1f4 JQ |
3372 | if test "$byteswap_h" = "yes" ; then |
3373 | echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak | |
3374 | fi | |
3375 | if test "$bswap_h" = "yes" ; then | |
3376 | echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak | |
3377 | fi | |
769ce76d | 3378 | if test "$curl" = "yes" ; then |
98ec69ac | 3379 | echo "CONFIG_CURL=y" >> $config_host_mak |
b1d5a277 | 3380 | echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak |
769ce76d | 3381 | fi |
2e4d9fb1 | 3382 | if test "$brlapi" = "yes" ; then |
98ec69ac | 3383 | echo "CONFIG_BRLAPI=y" >> $config_host_mak |
2e4d9fb1 | 3384 | fi |
fb599c9a | 3385 | if test "$bluez" = "yes" ; then |
98ec69ac | 3386 | echo "CONFIG_BLUEZ=y" >> $config_host_mak |
ef7635ec | 3387 | echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak |
fb599c9a | 3388 | fi |
e18df141 | 3389 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
e37630ca | 3390 | if test "$xen" = "yes" ; then |
6dbd588a | 3391 | echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak |
d5b93ddf | 3392 | echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak |
e37630ca | 3393 | fi |
5c6c3a6c CH |
3394 | if test "$linux_aio" = "yes" ; then |
3395 | echo "CONFIG_LINUX_AIO=y" >> $config_host_mak | |
3396 | fi | |
758e8e38 VJJ |
3397 | if test "$attr" = "yes" ; then |
3398 | echo "CONFIG_ATTR=y" >> $config_host_mak | |
3399 | fi | |
4f26f2b6 AK |
3400 | if test "$libattr" = "yes" ; then |
3401 | echo "CONFIG_LIBATTR=y" >> $config_host_mak | |
3402 | fi | |
983eef5a MI |
3403 | if test "$virtfs" = "yes" ; then |
3404 | echo "CONFIG_VIRTFS=y" >> $config_host_mak | |
758e8e38 | 3405 | fi |
77755340 | 3406 | if test "$blobs" = "yes" ; then |
98ec69ac | 3407 | echo "INSTALL_BLOBS=yes" >> $config_host_mak |
77755340 | 3408 | fi |
bf9298b9 | 3409 | if test "$iovec" = "yes" ; then |
2358a494 | 3410 | echo "CONFIG_IOVEC=y" >> $config_host_mak |
bf9298b9 | 3411 | fi |
ceb42de8 | 3412 | if test "$preadv" = "yes" ; then |
2358a494 | 3413 | echo "CONFIG_PREADV=y" >> $config_host_mak |
ceb42de8 | 3414 | fi |
f652e6af | 3415 | if test "$fdt" = "yes" ; then |
3f0855b1 | 3416 | echo "CONFIG_FDT=y" >> $config_host_mak |
f652e6af | 3417 | fi |
dcc38d1c MT |
3418 | if test "$signalfd" = "yes" ; then |
3419 | echo "CONFIG_SIGNALFD=y" >> $config_host_mak | |
3420 | fi | |
9195b2c2 SW |
3421 | if test "$tcg_interpreter" = "yes" ; then |
3422 | echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak | |
3423 | fi | |
5f6b9e8f BS |
3424 | if test "$fdatasync" = "yes" ; then |
3425 | echo "CONFIG_FDATASYNC=y" >> $config_host_mak | |
3426 | fi | |
e78815a5 AF |
3427 | if test "$madvise" = "yes" ; then |
3428 | echo "CONFIG_MADVISE=y" >> $config_host_mak | |
3429 | fi | |
3430 | if test "$posix_madvise" = "yes" ; then | |
3431 | echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak | |
3432 | fi | |
97a847bc | 3433 | |
cd4ec0b4 GH |
3434 | if test "$spice" = "yes" ; then |
3435 | echo "CONFIG_SPICE=y" >> $config_host_mak | |
3436 | fi | |
36707144 AL |
3437 | |
3438 | if test "$smartcard" = "yes" ; then | |
3439 | echo "CONFIG_SMARTCARD=y" >> $config_host_mak | |
3440 | fi | |
cd4ec0b4 | 3441 | |
111a38b0 RR |
3442 | if test "$smartcard_nss" = "yes" ; then |
3443 | echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak | |
ad4cf3f6 PB |
3444 | echo "libcacard_libs=$libcacard_libs" >> $config_host_mak |
3445 | echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak | |
111a38b0 RR |
3446 | fi |
3447 | ||
69354a83 HG |
3448 | if test "$usb_redir" = "yes" ; then |
3449 | echo "CONFIG_USB_REDIR=y" >> $config_host_mak | |
3450 | fi | |
3451 | ||
20ff075b MW |
3452 | if test "$opengl" = "yes" ; then |
3453 | echo "CONFIG_OPENGL=y" >> $config_host_mak | |
3454 | fi | |
3455 | ||
c589b249 RS |
3456 | if test "$libiscsi" = "yes" ; then |
3457 | echo "CONFIG_LIBISCSI=y" >> $config_host_mak | |
3458 | fi | |
3459 | ||
f794573e EO |
3460 | if test "$seccomp" = "yes"; then |
3461 | echo "CONFIG_SECCOMP=y" >> $config_host_mak | |
3462 | fi | |
3463 | ||
83fb7adf | 3464 | # XXX: suppress that |
7d3505c5 | 3465 | if [ "$bsd" = "yes" ] ; then |
2358a494 | 3466 | echo "CONFIG_BSD=y" >> $config_host_mak |
7d3505c5 FB |
3467 | fi |
3468 | ||
2358a494 | 3469 | echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak |
c5937220 | 3470 | |
20ff6c80 AL |
3471 | if test "$zero_malloc" = "yes" ; then |
3472 | echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak | |
3473 | fi | |
f27aaf4b CB |
3474 | if test "$rbd" = "yes" ; then |
3475 | echo "CONFIG_RBD=y" >> $config_host_mak | |
d0e2fce5 AK |
3476 | fi |
3477 | ||
519175a2 | 3478 | if test "$coroutine_backend" = "ucontext" ; then |
d0e2fce5 | 3479 | echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak |
fe91bfa8 AB |
3480 | elif test "$coroutine_backend" = "sigaltstack" ; then |
3481 | echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak | |
f27aaf4b | 3482 | fi |
20ff6c80 | 3483 | |
d2042378 AK |
3484 | if test "$open_by_handle_at" = "yes" ; then |
3485 | echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak | |
3486 | fi | |
3487 | ||
e06a765e HPB |
3488 | if test "$linux_magic_h" = "yes" ; then |
3489 | echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak | |
8ab1bf12 LC |
3490 | fi |
3491 | ||
06d71fa1 PM |
3492 | if test "$pragma_disable_unused_but_set" = "yes" ; then |
3493 | echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak | |
3494 | fi | |
3495 | ||
3f4349dc KW |
3496 | if test "$valgrind_h" = "yes" ; then |
3497 | echo "CONFIG_VALGRIND_H=y" >> $config_host_mak | |
3498 | fi | |
3499 | ||
8ab1bf12 LC |
3500 | if test "$has_environ" = "yes" ; then |
3501 | echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak | |
e06a765e HPB |
3502 | fi |
3503 | ||
68063649 BS |
3504 | # USB host support |
3505 | case "$usb" in | |
3506 | linux) | |
98ec69ac | 3507 | echo "HOST_USB=linux" >> $config_host_mak |
68063649 BS |
3508 | ;; |
3509 | bsd) | |
98ec69ac | 3510 | echo "HOST_USB=bsd" >> $config_host_mak |
68063649 BS |
3511 | ;; |
3512 | *) | |
98ec69ac | 3513 | echo "HOST_USB=stub" >> $config_host_mak |
68063649 BS |
3514 | ;; |
3515 | esac | |
3516 | ||
e4858974 L |
3517 | # use default implementation for tracing backend-specific routines |
3518 | trace_default=yes | |
94a420b1 | 3519 | echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak |
6d8a764e L |
3520 | if test "$trace_backend" = "nop"; then |
3521 | echo "CONFIG_TRACE_NOP=y" >> $config_host_mak | |
22890ab5 | 3522 | fi |
9410b56c | 3523 | if test "$trace_backend" = "simple"; then |
6d8a764e | 3524 | echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak |
e4858974 | 3525 | trace_default=no |
6d8a764e | 3526 | # Set the appropriate trace file. |
953ffe0f | 3527 | trace_file="\"$trace_file-\" FMT_pid" |
9410b56c | 3528 | fi |
6d8a764e L |
3529 | if test "$trace_backend" = "stderr"; then |
3530 | echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak | |
9a82b6a5 | 3531 | trace_default=no |
6d8a764e L |
3532 | fi |
3533 | if test "$trace_backend" = "ust"; then | |
3534 | echo "CONFIG_TRACE_UST=y" >> $config_host_mak | |
3535 | fi | |
3536 | if test "$trace_backend" = "dtrace"; then | |
3537 | echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak | |
3538 | if test "$trace_backend_stap" = "yes" ; then | |
3539 | echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak | |
3540 | fi | |
c276b17d | 3541 | fi |
9410b56c | 3542 | echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak |
e4858974 L |
3543 | if test "$trace_default" = "yes"; then |
3544 | echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak | |
3545 | fi | |
9410b56c | 3546 | |
98ec69ac | 3547 | echo "TOOLS=$tools" >> $config_host_mak |
98ec69ac | 3548 | echo "ROMS=$roms" >> $config_host_mak |
804edf29 JQ |
3549 | echo "MAKE=$make" >> $config_host_mak |
3550 | echo "INSTALL=$install" >> $config_host_mak | |
1901cb14 B |
3551 | echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak |
3552 | echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak | |
3553 | echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak | |
c886edfb | 3554 | echo "PYTHON=$python" >> $config_host_mak |
804edf29 | 3555 | echo "CC=$cc" >> $config_host_mak |
2b2e59e6 | 3556 | echo "CC_I386=$cc_i386" >> $config_host_mak |
804edf29 | 3557 | echo "HOST_CC=$host_cc" >> $config_host_mak |
3c4a4d0d | 3558 | echo "OBJCC=$objcc" >> $config_host_mak |
804edf29 JQ |
3559 | echo "AR=$ar" >> $config_host_mak |
3560 | echo "OBJCOPY=$objcopy" >> $config_host_mak | |
3561 | echo "LD=$ld" >> $config_host_mak | |
9fe6de94 | 3562 | echo "WINDRES=$windres" >> $config_host_mak |
44dc0ca3 | 3563 | echo "LIBTOOL=$libtool" >> $config_host_mak |
e2a2ed06 | 3564 | echo "CFLAGS=$CFLAGS" >> $config_host_mak |
a558ee17 | 3565 | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
f9728943 | 3566 | echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak |
e39f0062 PB |
3567 | if test "$sparse" = "yes" ; then |
3568 | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak | |
3569 | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak | |
3570 | echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak | |
3571 | fi | |
e2a2ed06 | 3572 | echo "LDFLAGS=$LDFLAGS" >> $config_host_mak |
a36abbbb JQ |
3573 | echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak |
3574 | echo "ARLIBS_END=$arlibs_end" >> $config_host_mak | |
73da375e | 3575 | echo "LIBS+=$LIBS" >> $config_host_mak |
3e2e0e6b | 3576 | echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak |
804edf29 | 3577 | echo "EXESUF=$EXESUF" >> $config_host_mak |
957f1f99 | 3578 | echo "LIBS_QGA+=$libs_qga" >> $config_host_mak |
94dd53c5 | 3579 | echo "POD2MAN=$POD2MAN" >> $config_host_mak |
804edf29 | 3580 | |
4bf6b55b JQ |
3581 | # generate list of library paths for linker script |
3582 | ||
3583 | $ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld} | |
3584 | ||
3585 | if test -f ${config_host_ld}~ ; then | |
3586 | if cmp -s $config_host_ld ${config_host_ld}~ ; then | |
3587 | mv ${config_host_ld}~ $config_host_ld | |
3588 | else | |
3589 | rm ${config_host_ld}~ | |
3590 | fi | |
3591 | fi | |
3592 | ||
4d904533 | 3593 | for d in libdis libdis-user; do |
72b8b5a1 | 3594 | symlink "$source_path/Makefile.dis" "$d/Makefile" |
4d904533 BS |
3595 | echo > $d/config.mak |
3596 | done | |
3597 | ||
6efd7517 PM |
3598 | # use included Linux headers |
3599 | if test "$linux" = "yes" ; then | |
a307beb6 | 3600 | mkdir -p linux-headers |
6efd7517 PM |
3601 | case "$cpu" in |
3602 | i386|x86_64) | |
08312a63 | 3603 | linux_arch=x86 |
6efd7517 PM |
3604 | ;; |
3605 | ppcemb|ppc|ppc64) | |
08312a63 | 3606 | linux_arch=powerpc |
6efd7517 PM |
3607 | ;; |
3608 | s390x) | |
08312a63 PM |
3609 | linux_arch=s390 |
3610 | ;; | |
3611 | *) | |
3612 | # For most CPUs the kernel architecture name and QEMU CPU name match. | |
3613 | linux_arch="$cpu" | |
6efd7517 PM |
3614 | ;; |
3615 | esac | |
08312a63 PM |
3616 | # For non-KVM architectures we will not have asm headers |
3617 | if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then | |
3618 | symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm | |
3619 | fi | |
6efd7517 PM |
3620 | fi |
3621 | ||
1d14ffa9 | 3622 | for target in $target_list; do |
97a847bc | 3623 | target_dir="$target" |
25be210f | 3624 | config_target_mak=$target_dir/config-target.mak |
600309b6 | 3625 | target_arch2=`echo $target | cut -d '-' -f 1` |
97a847bc | 3626 | target_bigendian="no" |
1f3d3c8f | 3627 | |
ea2d6a39 | 3628 | case "$target_arch2" in |
e67db06e | 3629 | armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) |
ea2d6a39 JQ |
3630 | target_bigendian=yes |
3631 | ;; | |
3632 | esac | |
97a847bc | 3633 | target_softmmu="no" |
997344f3 | 3634 | target_user_only="no" |
831b7825 | 3635 | target_linux_user="no" |
84778508 | 3636 | target_bsd_user="no" |
9e407a85 | 3637 | case "$target" in |
600309b6 | 3638 | ${target_arch2}-softmmu) |
9e407a85 PB |
3639 | target_softmmu="yes" |
3640 | ;; | |
600309b6 | 3641 | ${target_arch2}-linux-user) |
9c7a4202 BS |
3642 | if test "$linux" != "yes" ; then |
3643 | echo "ERROR: Target '$target' is only available on a Linux host" | |
3644 | exit 1 | |
3645 | fi | |
9e407a85 PB |
3646 | target_user_only="yes" |
3647 | target_linux_user="yes" | |
3648 | ;; | |
600309b6 | 3649 | ${target_arch2}-bsd-user) |
9cf55765 | 3650 | if test "$bsd" != "yes" ; then |
9c7a4202 BS |
3651 | echo "ERROR: Target '$target' is only available on a BSD host" |
3652 | exit 1 | |
3653 | fi | |
84778508 BS |
3654 | target_user_only="yes" |
3655 | target_bsd_user="yes" | |
3656 | ;; | |
9e407a85 PB |
3657 | *) |
3658 | echo "ERROR: Target '$target' not recognised" | |
3659 | exit 1 | |
3660 | ;; | |
3661 | esac | |
831b7825 | 3662 | |
97a847bc | 3663 | mkdir -p $target_dir |
25be210f | 3664 | echo "# Automatically generated by configure - do not modify" > $config_target_mak |
de83cd02 | 3665 | |
e5fe0c52 | 3666 | bflt="no" |
bd0c5661 | 3667 | target_nptl="no" |
600309b6 | 3668 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` |
56aebc89 | 3669 | gdb_xml_files="" |
c2e3dee6 LV |
3670 | target_short_alignment=2 |
3671 | target_int_alignment=4 | |
3672 | target_long_alignment=4 | |
3673 | target_llong_alignment=8 | |
de3a354a | 3674 | target_libs_softmmu= |
7ba1e619 | 3675 | |
938b1edd | 3676 | TARGET_ARCH="$target_arch2" |
6acff7da | 3677 | TARGET_BASE_ARCH="" |
e6e91b9c | 3678 | TARGET_ABI_DIR="" |
e73aae67 | 3679 | |
600309b6 | 3680 | case "$target_arch2" in |
2408a527 | 3681 | i386) |
71deff27 | 3682 | target_phys_bits=64 |
2408a527 AJ |
3683 | ;; |
3684 | x86_64) | |
6acff7da | 3685 | TARGET_BASE_ARCH=i386 |
1ad2134f | 3686 | target_phys_bits=64 |
c2e3dee6 | 3687 | target_long_alignment=8 |
2408a527 AJ |
3688 | ;; |
3689 | alpha) | |
1ad2134f | 3690 | target_phys_bits=64 |
c2e3dee6 | 3691 | target_long_alignment=8 |
a4b388ff | 3692 | target_nptl="yes" |
2408a527 AJ |
3693 | ;; |
3694 | arm|armeb) | |
b498c8a0 | 3695 | TARGET_ARCH=arm |
2408a527 | 3696 | bflt="yes" |
bd0c5661 | 3697 | target_nptl="yes" |
56aebc89 | 3698 | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
3cc0cd61 | 3699 | target_phys_bits=64 |
c2e3dee6 | 3700 | target_llong_alignment=4 |
412beee6 | 3701 | target_libs_softmmu="$fdt_libs" |
2408a527 AJ |
3702 | ;; |
3703 | cris) | |
253bd7f8 | 3704 | target_nptl="yes" |
1ad2134f | 3705 | target_phys_bits=32 |
2408a527 | 3706 | ;; |
613a22c9 MW |
3707 | lm32) |
3708 | target_phys_bits=32 | |
de3a354a | 3709 | target_libs_softmmu="$opengl_libs" |
613a22c9 | 3710 | ;; |
2408a527 | 3711 | m68k) |
2408a527 | 3712 | bflt="yes" |
56aebc89 | 3713 | gdb_xml_files="cf-core.xml cf-fp.xml" |
1ad2134f | 3714 | target_phys_bits=32 |
c2e3dee6 LV |
3715 | target_int_alignment=2 |
3716 | target_long_alignment=2 | |
3717 | target_llong_alignment=2 | |
2408a527 | 3718 | ;; |
877fdc12 EI |
3719 | microblaze|microblazeel) |
3720 | TARGET_ARCH=microblaze | |
72b675ca EI |
3721 | bflt="yes" |
3722 | target_nptl="yes" | |
3723 | target_phys_bits=32 | |
de3a354a | 3724 | target_libs_softmmu="$fdt_libs" |
72b675ca | 3725 | ;; |
0adcffb1 | 3726 | mips|mipsel) |
b498c8a0 | 3727 | TARGET_ARCH=mips |
25be210f | 3728 | echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak |
f04dc72f | 3729 | target_nptl="yes" |
1ad2134f | 3730 | target_phys_bits=64 |
2408a527 AJ |
3731 | ;; |
3732 | mipsn32|mipsn32el) | |
b498c8a0 | 3733 | TARGET_ARCH=mipsn32 |
6acff7da | 3734 | TARGET_BASE_ARCH=mips |
25be210f | 3735 | echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak |
1ad2134f | 3736 | target_phys_bits=64 |
2408a527 AJ |
3737 | ;; |
3738 | mips64|mips64el) | |
b498c8a0 | 3739 | TARGET_ARCH=mips64 |
6acff7da | 3740 | TARGET_BASE_ARCH=mips |
25be210f | 3741 | echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak |
1ad2134f | 3742 | target_phys_bits=64 |
c2e3dee6 | 3743 | target_long_alignment=8 |
2408a527 | 3744 | ;; |
e67db06e JL |
3745 | or32) |
3746 | TARGET_ARCH=openrisc | |
3747 | TARGET_BASE_ARCH=openrisc | |
3748 | target_phys_bits=32 | |
3749 | ;; | |
2408a527 | 3750 | ppc) |
c8b3532d | 3751 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
8b242eba | 3752 | target_phys_bits=64 |
d6630708 | 3753 | target_nptl="yes" |
de3a354a | 3754 | target_libs_softmmu="$fdt_libs" |
2408a527 AJ |
3755 | ;; |
3756 | ppcemb) | |
6acff7da | 3757 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 3758 | TARGET_ABI_DIR=ppc |
c8b3532d | 3759 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
1ad2134f | 3760 | target_phys_bits=64 |
d6630708 | 3761 | target_nptl="yes" |
de3a354a | 3762 | target_libs_softmmu="$fdt_libs" |
2408a527 AJ |
3763 | ;; |
3764 | ppc64) | |
6acff7da | 3765 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 3766 | TARGET_ABI_DIR=ppc |
c8b3532d | 3767 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
1ad2134f | 3768 | target_phys_bits=64 |
c2e3dee6 | 3769 | target_long_alignment=8 |
de3a354a | 3770 | target_libs_softmmu="$fdt_libs" |
2408a527 AJ |
3771 | ;; |
3772 | ppc64abi32) | |
b498c8a0 | 3773 | TARGET_ARCH=ppc64 |
6acff7da | 3774 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 3775 | TARGET_ABI_DIR=ppc |
25be210f | 3776 | echo "TARGET_ABI32=y" >> $config_target_mak |
c8b3532d | 3777 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
1ad2134f | 3778 | target_phys_bits=64 |
de3a354a | 3779 | target_libs_softmmu="$fdt_libs" |
2408a527 AJ |
3780 | ;; |
3781 | sh4|sh4eb) | |
b498c8a0 | 3782 | TARGET_ARCH=sh4 |
2408a527 | 3783 | bflt="yes" |
0b6d3ae0 | 3784 | target_nptl="yes" |
1ad2134f | 3785 | target_phys_bits=32 |
2408a527 AJ |
3786 | ;; |
3787 | sparc) | |
1ad2134f | 3788 | target_phys_bits=64 |
2408a527 AJ |
3789 | ;; |
3790 | sparc64) | |
6acff7da | 3791 | TARGET_BASE_ARCH=sparc |
1ad2134f | 3792 | target_phys_bits=64 |
c2e3dee6 | 3793 | target_long_alignment=8 |
2408a527 AJ |
3794 | ;; |
3795 | sparc32plus) | |
b498c8a0 | 3796 | TARGET_ARCH=sparc64 |
6acff7da | 3797 | TARGET_BASE_ARCH=sparc |
e6e91b9c | 3798 | TARGET_ABI_DIR=sparc |
25be210f | 3799 | echo "TARGET_ABI32=y" >> $config_target_mak |
1ad2134f | 3800 | target_phys_bits=64 |
2408a527 | 3801 | ;; |
24e804ec | 3802 | s390x) |
bc434676 | 3803 | target_nptl="yes" |
24e804ec | 3804 | target_phys_bits=64 |
7b3da903 | 3805 | target_long_alignment=8 |
24e804ec | 3806 | ;; |
d2fbca94 GX |
3807 | unicore32) |
3808 | target_phys_bits=32 | |
3809 | ;; | |
cfa550c6 MF |
3810 | xtensa|xtensaeb) |
3811 | TARGET_ARCH=xtensa | |
3812 | target_phys_bits=32 | |
3813 | ;; | |
2408a527 AJ |
3814 | *) |
3815 | echo "Unsupported target CPU" | |
3816 | exit 1 | |
3817 | ;; | |
3818 | esac | |
5e8861a0 PB |
3819 | # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH |
3820 | if [ "$TARGET_BASE_ARCH" = "" ]; then | |
3821 | TARGET_BASE_ARCH=$TARGET_ARCH | |
3822 | fi | |
3823 | ||
5e8861a0 PB |
3824 | symlink "$source_path/Makefile.target" "$target_dir/Makefile" |
3825 | ||
99afc91d DB |
3826 | upper() { |
3827 | echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' | |
3828 | } | |
3829 | ||
c2e3dee6 LV |
3830 | echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak |
3831 | echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak | |
3832 | echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak | |
3833 | echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak | |
25be210f | 3834 | echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak |
99afc91d | 3835 | target_arch_name="`upper $TARGET_ARCH`" |
25be210f JQ |
3836 | echo "TARGET_$target_arch_name=y" >> $config_target_mak |
3837 | echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak | |
99afc91d | 3838 | echo "TARGET_TYPE=TARGET_TYPE_`upper $target_arch2`" >> $config_target_mak |
25be210f | 3839 | echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak |
e6e91b9c JQ |
3840 | if [ "$TARGET_ABI_DIR" = "" ]; then |
3841 | TARGET_ABI_DIR=$TARGET_ARCH | |
3842 | fi | |
25be210f | 3843 | echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak |
1b0c87fc JQ |
3844 | case "$target_arch2" in |
3845 | i386|x86_64) | |
3846 | if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then | |
64b3cfdb | 3847 | target_phys_bits=64 |
25be210f | 3848 | echo "CONFIG_XEN=y" >> $config_target_mak |
eb6fda0f AP |
3849 | if test "$xen_pci_passthrough" = yes; then |
3850 | echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" | |
3851 | fi | |
59d21e53 AG |
3852 | else |
3853 | echo "CONFIG_NO_XEN=y" >> $config_target_mak | |
1b0c87fc | 3854 | fi |
59d21e53 AG |
3855 | ;; |
3856 | *) | |
3857 | echo "CONFIG_NO_XEN=y" >> $config_target_mak | |
1b0c87fc | 3858 | esac |
c59249f9 | 3859 | case "$target_arch2" in |
0e60a699 | 3860 | i386|x86_64|ppcemb|ppc|ppc64|s390x) |
c59249f9 JQ |
3861 | # Make sure the target and host cpus are compatible |
3862 | if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ | |
3863 | \( "$target_arch2" = "$cpu" -o \ | |
3864 | \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ | |
5f114bc6 | 3865 | \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ |
adf82011 RR |
3866 | \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \ |
3867 | \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ | |
c59249f9 JQ |
3868 | \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ |
3869 | \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then | |
25be210f | 3870 | echo "CONFIG_KVM=y" >> $config_target_mak |
1ba16968 | 3871 | if test "$vhost_net" = "yes" ; then |
d5970055 MT |
3872 | echo "CONFIG_VHOST_NET=y" >> $config_target_mak |
3873 | fi | |
c59249f9 JQ |
3874 | fi |
3875 | esac | |
fae001f5 WC |
3876 | case "$target_arch2" in |
3877 | i386|x86_64) | |
3878 | echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak | |
3879 | esac | |
7f762366 | 3880 | if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then |
0a6b8dde AG |
3881 | echo "CONFIG_PSERIES=y" >> $config_target_mak |
3882 | fi | |
de83cd02 | 3883 | if test "$target_bigendian" = "yes" ; then |
25be210f | 3884 | echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak |
de83cd02 | 3885 | fi |
97a847bc | 3886 | if test "$target_softmmu" = "yes" ; then |
b1aa27c4 | 3887 | echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak |
25be210f | 3888 | echo "CONFIG_SOFTMMU=y" >> $config_target_mak |
de3a354a | 3889 | echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak |
0e8c9214 | 3890 | echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak |
5791f45b | 3891 | echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak |
ad4cf3f6 PB |
3892 | if test "$smartcard_nss" = "yes" ; then |
3893 | echo "subdir-$target: subdir-libcacard" >> $config_host_mak | |
3894 | fi | |
9fecbed0 WC |
3895 | case "$target_arch2" in |
3896 | i386|x86_64) | |
3897 | echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak | |
3898 | esac | |
43ce4dfe | 3899 | fi |
997344f3 | 3900 | if test "$target_user_only" = "yes" ; then |
25be210f | 3901 | echo "CONFIG_USER_ONLY=y" >> $config_target_mak |
a2c80be9 | 3902 | echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak |
997344f3 | 3903 | fi |
831b7825 | 3904 | if test "$target_linux_user" = "yes" ; then |
25be210f | 3905 | echo "CONFIG_LINUX_USER=y" >> $config_target_mak |
831b7825 | 3906 | fi |
56aebc89 PB |
3907 | list="" |
3908 | if test ! -z "$gdb_xml_files" ; then | |
3909 | for x in $gdb_xml_files; do | |
3910 | list="$list $source_path/gdb-xml/$x" | |
3911 | done | |
3d0f1517 | 3912 | echo "TARGET_XML_FILES=$list" >> $config_target_mak |
56aebc89 | 3913 | fi |
97a847bc | 3914 | |
e5fe0c52 | 3915 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
25be210f | 3916 | echo "TARGET_HAS_BFLT=y" >> $config_target_mak |
e5fe0c52 | 3917 | fi |
bd0c5661 PB |
3918 | if test "$target_user_only" = "yes" \ |
3919 | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then | |
25be210f | 3920 | echo "CONFIG_USE_NPTL=y" >> $config_target_mak |
bd0c5661 | 3921 | fi |
379f6698 | 3922 | if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then |
25be210f | 3923 | echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak |
379f6698 | 3924 | fi |
84778508 | 3925 | if test "$target_bsd_user" = "yes" ; then |
25be210f | 3926 | echo "CONFIG_BSD_USER=y" >> $config_target_mak |
84778508 | 3927 | fi |
5b0753e0 | 3928 | |
5a4d701a JK |
3929 | # the static way of configuring available audio cards requires this workaround |
3930 | if test "$target_user_only" != "yes" && grep -q CONFIG_PCSPK $source_path/default-configs/$target.mak; then | |
3931 | echo "CONFIG_PCSPK=y" >> $config_target_mak | |
3932 | fi | |
3933 | ||
4afddb55 | 3934 | # generate QEMU_CFLAGS/LDFLAGS for targets |
fa282484 | 3935 | |
4afddb55 | 3936 | cflags="" |
f9728943 | 3937 | includes="" |
fa282484 | 3938 | ldflags="" |
9b8e111f | 3939 | |
9195b2c2 SW |
3940 | if test "$tcg_interpreter" = "yes"; then |
3941 | includes="-I\$(SRC_PATH)/tcg/tci $includes" | |
3942 | elif test "$ARCH" = "sparc64" ; then | |
f9728943 | 3943 | includes="-I\$(SRC_PATH)/tcg/sparc $includes" |
24e804ec | 3944 | elif test "$ARCH" = "s390x" ; then |
f9728943 | 3945 | includes="-I\$(SRC_PATH)/tcg/s390 $includes" |
5d8a4f8f | 3946 | elif test "$ARCH" = "x86_64" ; then |
f9728943 | 3947 | includes="-I\$(SRC_PATH)/tcg/i386 $includes" |
57ddfbf7 | 3948 | else |
f9728943 | 3949 | includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes" |
57ddfbf7 | 3950 | fi |
f9728943 | 3951 | includes="-I\$(SRC_PATH)/tcg $includes" |
57ddfbf7 | 3952 | |
6efd7517 PM |
3953 | if test "$linux" = "yes" ; then |
3954 | includes="-I\$(SRC_PATH)/linux-headers $includes" | |
3955 | fi | |
3956 | ||
4d904533 BS |
3957 | if test "$target_user_only" = "yes" ; then |
3958 | libdis_config_mak=libdis-user/config.mak | |
3959 | else | |
3960 | libdis_config_mak=libdis/config.mak | |
3961 | fi | |
3962 | ||
64656024 JQ |
3963 | for i in $ARCH $TARGET_BASE_ARCH ; do |
3964 | case "$i" in | |
3965 | alpha) | |
25be210f | 3966 | echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak |
4d904533 | 3967 | echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak |
64656024 JQ |
3968 | ;; |
3969 | arm) | |
25be210f | 3970 | echo "CONFIG_ARM_DIS=y" >> $config_target_mak |
4d904533 | 3971 | echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak |
64656024 JQ |
3972 | ;; |
3973 | cris) | |
25be210f | 3974 | echo "CONFIG_CRIS_DIS=y" >> $config_target_mak |
4d904533 | 3975 | echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak |
64656024 JQ |
3976 | ;; |
3977 | hppa) | |
25be210f | 3978 | echo "CONFIG_HPPA_DIS=y" >> $config_target_mak |
4d904533 | 3979 | echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak |
64656024 JQ |
3980 | ;; |
3981 | i386|x86_64) | |
25be210f | 3982 | echo "CONFIG_I386_DIS=y" >> $config_target_mak |
4d904533 | 3983 | echo "CONFIG_I386_DIS=y" >> $libdis_config_mak |
64656024 | 3984 | ;; |
903ec55c AJ |
3985 | ia64*) |
3986 | echo "CONFIG_IA64_DIS=y" >> $config_target_mak | |
3987 | echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak | |
3988 | ;; | |
79368f49 MW |
3989 | lm32) |
3990 | echo "CONFIG_LM32_DIS=y" >> $config_target_mak | |
3991 | echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak | |
3992 | ;; | |
64656024 | 3993 | m68k) |
25be210f | 3994 | echo "CONFIG_M68K_DIS=y" >> $config_target_mak |
4d904533 | 3995 | echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak |
64656024 | 3996 | ;; |
877fdc12 | 3997 | microblaze*) |
25be210f | 3998 | echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak |
4d904533 | 3999 | echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak |
64656024 JQ |
4000 | ;; |
4001 | mips*) | |
25be210f | 4002 | echo "CONFIG_MIPS_DIS=y" >> $config_target_mak |
4d904533 | 4003 | echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak |
64656024 | 4004 | ;; |
e67db06e JL |
4005 | or32) |
4006 | echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak | |
4007 | echo "CONFIG_OPENRISC_DIS=y" >> $libdis_config_mak | |
4008 | ;; | |
64656024 | 4009 | ppc*) |
25be210f | 4010 | echo "CONFIG_PPC_DIS=y" >> $config_target_mak |
4d904533 | 4011 | echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak |
64656024 | 4012 | ;; |
24e804ec | 4013 | s390*) |
25be210f | 4014 | echo "CONFIG_S390_DIS=y" >> $config_target_mak |
4d904533 | 4015 | echo "CONFIG_S390_DIS=y" >> $libdis_config_mak |
64656024 JQ |
4016 | ;; |
4017 | sh4) | |
25be210f | 4018 | echo "CONFIG_SH4_DIS=y" >> $config_target_mak |
4d904533 | 4019 | echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak |
64656024 JQ |
4020 | ;; |
4021 | sparc*) | |
25be210f | 4022 | echo "CONFIG_SPARC_DIS=y" >> $config_target_mak |
4d904533 | 4023 | echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak |
64656024 | 4024 | ;; |
cfa550c6 MF |
4025 | xtensa*) |
4026 | echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak | |
4027 | echo "CONFIG_XTENSA_DIS=y" >> $libdis_config_mak | |
4028 | ;; | |
64656024 JQ |
4029 | esac |
4030 | done | |
9195b2c2 SW |
4031 | if test "$tcg_interpreter" = "yes" ; then |
4032 | echo "CONFIG_TCI_DIS=y" >> $config_target_mak | |
4033 | echo "CONFIG_TCI_DIS=y" >> $libdis_config_mak | |
4034 | fi | |
64656024 | 4035 | |
6ee7126f JQ |
4036 | case "$ARCH" in |
4037 | alpha) | |
4038 | # Ensure there's only a single GP | |
4039 | cflags="-msmall-data $cflags" | |
4040 | ;; | |
4041 | esac | |
4042 | ||
55d9c04b JQ |
4043 | if test "$target_softmmu" = "yes" ; then |
4044 | case "$TARGET_BASE_ARCH" in | |
4045 | arm) | |
4046 | cflags="-DHAS_AUDIO $cflags" | |
25a8bb96 MW |
4047 | ;; |
4048 | lm32) | |
4049 | cflags="-DHAS_AUDIO $cflags" | |
55d9c04b JQ |
4050 | ;; |
4051 | i386|mips|ppc) | |
4052 | cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" | |
4053 | ;; | |
4054 | esac | |
4055 | fi | |
4056 | ||
d02c1db3 | 4057 | if test "$gprof" = "yes" ; then |
25be210f | 4058 | echo "TARGET_GPROF=yes" >> $config_target_mak |
d02c1db3 JQ |
4059 | if test "$target_linux_user" = "yes" ; then |
4060 | cflags="-p $cflags" | |
4061 | ldflags="-p $ldflags" | |
4062 | fi | |
4063 | if test "$target_softmmu" = "yes" ; then | |
4064 | ldflags="-p $ldflags" | |
25be210f | 4065 | echo "GPROF_CFLAGS=-p" >> $config_target_mak |
d02c1db3 JQ |
4066 | fi |
4067 | fi | |
4068 | ||
9195b2c2 SW |
4069 | if test "$ARCH" = "tci"; then |
4070 | linker_script="" | |
4071 | else | |
4072 | linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld" | |
4073 | fi | |
4074 | ||
9b8e111f | 4075 | if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then |
fa282484 | 4076 | case "$ARCH" in |
fa282484 JQ |
4077 | sparc) |
4078 | # -static is used to avoid g1/g3 usage by the dynamic linker | |
322e5878 | 4079 | ldflags="$linker_script -static $ldflags" |
fa282484 | 4080 | ;; |
4d58be06 RH |
4081 | alpha | s390x) |
4082 | # The default placement of the application is fine. | |
4083 | ;; | |
fd76e73a | 4084 | *) |
322e5878 | 4085 | ldflags="$linker_script $ldflags" |
fa282484 JQ |
4086 | ;; |
4087 | esac | |
4088 | fi | |
fa282484 | 4089 | |
25be210f JQ |
4090 | echo "LDFLAGS+=$ldflags" >> $config_target_mak |
4091 | echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak | |
f9728943 | 4092 | echo "QEMU_INCLUDES+=$includes" >> $config_target_mak |
fa282484 | 4093 | |
97a847bc | 4094 | done # for target in $targets |
7d13299d | 4095 | |
d1807a4f | 4096 | # build tree in object directory in case the source is not in the current directory |
927b241d | 4097 | DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" |
2dee8d54 | 4098 | DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas" |
d1807a4f | 4099 | DIRS="$DIRS roms/seabios roms/vgabios" |
2dee8d54 | 4100 | DIRS="$DIRS qapi-generated" |
00c705fb | 4101 | DIRS="$DIRS libcacard libcacard/libcacard libcacard/trace" |
c09015dd AL |
4102 | FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" |
4103 | FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" | |
00c705fb | 4104 | FILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile" |
d1807a4f | 4105 | FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" |
446b9165 | 4106 | FILES="$FILES pc-bios/spapr-rtas/Makefile" |
d1807a4f | 4107 | FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" |
753d11f2 RH |
4108 | for bios_file in \ |
4109 | $source_path/pc-bios/*.bin \ | |
4110 | $source_path/pc-bios/*.rom \ | |
4111 | $source_path/pc-bios/*.dtb \ | |
4112 | $source_path/pc-bios/openbios-* \ | |
4113 | $source_path/pc-bios/palcode-* | |
4114 | do | |
d1807a4f PB |
4115 | FILES="$FILES pc-bios/`basename $bios_file`" |
4116 | done | |
4117 | mkdir -p $DIRS | |
4118 | for f in $FILES ; do | |
72b8b5a1 | 4119 | if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then |
f9245e10 PM |
4120 | symlink "$source_path/$f" "$f" |
4121 | fi | |
d1807a4f | 4122 | done |
1ad2134f | 4123 | |
c34ebfdc | 4124 | # temporary config to build submodules |
2d9f27d2 | 4125 | for rom in seabios vgabios ; do |
c34ebfdc | 4126 | config_mak=roms/$rom/config.mak |
37116c89 | 4127 | echo "# Automatically generated by configure - do not modify" > $config_mak |
c34ebfdc AL |
4128 | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
4129 | echo "CC=$cc" >> $config_mak | |
4130 | echo "BCC=bcc" >> $config_mak | |
4131 | echo "CPP=${cross_prefix}cpp" >> $config_mak | |
4132 | echo "OBJCOPY=objcopy" >> $config_mak | |
4133 | echo "IASL=iasl" >> $config_mak | |
c34ebfdc AL |
4134 | echo "LD=$ld" >> $config_mak |
4135 | done | |
4136 | ||
1ad2134f PB |
4137 | for hwlib in 32 64; do |
4138 | d=libhw$hwlib | |
72b8b5a1 | 4139 | symlink "$source_path/Makefile.hw" "$d/Makefile" |
37116c89 | 4140 | echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak |
1ad2134f | 4141 | done |
add16157 BS |
4142 | |
4143 | d=libuser | |
72b8b5a1 | 4144 | symlink "$source_path/Makefile.user" "$d/Makefile" |
b40292e7 JK |
4145 | |
4146 | if test "$docs" = "yes" ; then | |
4147 | mkdir -p QMP | |
4148 | fi |