]>
Commit | Line | Data |
---|---|---|
7d13299d FB |
1 | #!/bin/sh |
2 | # | |
3ef693a0 | 3 | # qemu configure script (c) 2003 Fabrice Bellard |
7d13299d | 4 | # |
8cd05ab6 | 5 | |
99519e67 CH |
6 | # Unset some variables known to interfere with behavior of common tools, |
7 | # just as autoconf does. | |
8 | CLICOLOR_FORCE= GREP_OPTIONS= | |
9 | unset CLICOLOR_FORCE GREP_OPTIONS | |
10 | ||
5e4dfd3d JS |
11 | # Don't allow CCACHE, if present, to use cached results of compile tests! |
12 | export CCACHE_RECACHE=yes | |
13 | ||
8cd05ab6 PM |
14 | # Temporary directory used for files created while |
15 | # configure runs. Since it is in the build directory | |
16 | # we can safely blow away any previous version of it | |
17 | # (and we need not jump through hoops to try to delete | |
18 | # it when configure exits.) | |
19 | TMPDIR1="config-temp" | |
20 | rm -rf "${TMPDIR1}" | |
21 | mkdir -p "${TMPDIR1}" | |
22 | if [ $? -ne 0 ]; then | |
23 | echo "ERROR: failed to create temporary directory" | |
24 | exit 1 | |
7d13299d FB |
25 | fi |
26 | ||
8cd05ab6 PM |
27 | TMPB="qemu-conf" |
28 | TMPC="${TMPDIR1}/${TMPB}.c" | |
66518bf6 | 29 | TMPO="${TMPDIR1}/${TMPB}.o" |
9c83ffd8 | 30 | TMPCXX="${TMPDIR1}/${TMPB}.cxx" |
8cd05ab6 | 31 | TMPE="${TMPDIR1}/${TMPB}.exe" |
6969ec6c | 32 | TMPMO="${TMPDIR1}/${TMPB}.mo" |
7d13299d | 33 | |
da1d85e3 | 34 | rm -f config.log |
9ac81bbb | 35 | |
b48e3611 PM |
36 | # Print a helpful header at the top of config.log |
37 | echo "# QEMU configure log $(date)" >> config.log | |
979ae168 PM |
38 | printf "# Configured with:" >> config.log |
39 | printf " '%s'" "$0" "$@" >> config.log | |
40 | echo >> config.log | |
b48e3611 PM |
41 | echo "#" >> config.log |
42 | ||
d880a3ba PB |
43 | print_error() { |
44 | (echo | |
76ad07a4 PM |
45 | echo "ERROR: $1" |
46 | while test -n "$2"; do | |
47 | echo " $2" | |
48 | shift | |
49 | done | |
d880a3ba PB |
50 | echo) >&2 |
51 | } | |
52 | ||
53 | error_exit() { | |
54 | print_error "$@" | |
76ad07a4 PM |
55 | exit 1 |
56 | } | |
57 | ||
9c83ffd8 PM |
58 | do_compiler() { |
59 | # Run the compiler, capturing its output to the log. First argument | |
60 | # is compiler binary to execute. | |
61 | local compiler="$1" | |
62 | shift | |
63 | echo $compiler "$@" >> config.log | |
64 | $compiler "$@" >> config.log 2>&1 || return $? | |
8dc38a78 PM |
65 | # Test passed. If this is an --enable-werror build, rerun |
66 | # the test with -Werror and bail out if it fails. This | |
67 | # makes warning-generating-errors in configure test code | |
68 | # obvious to developers. | |
69 | if test "$werror" != "yes"; then | |
70 | return 0 | |
71 | fi | |
72 | # Don't bother rerunning the compile if we were already using -Werror | |
73 | case "$*" in | |
74 | *-Werror*) | |
75 | return 0 | |
76 | ;; | |
77 | esac | |
9c83ffd8 PM |
78 | echo $compiler -Werror "$@" >> config.log |
79 | $compiler -Werror "$@" >> config.log 2>&1 && return $? | |
76ad07a4 PM |
80 | error_exit "configure test passed without -Werror but failed with -Werror." \ |
81 | "This is probably a bug in the configure script. The failing command" \ | |
82 | "will be at the bottom of config.log." \ | |
83 | "You can run configure with --disable-werror to bypass this check." | |
8dc38a78 PM |
84 | } |
85 | ||
9c83ffd8 PM |
86 | do_cc() { |
87 | do_compiler "$cc" "$@" | |
88 | } | |
89 | ||
90 | do_cxx() { | |
91 | do_compiler "$cxx" "$@" | |
92 | } | |
93 | ||
94 | update_cxxflags() { | |
95 | # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those | |
96 | # options which some versions of GCC's C++ compiler complain about | |
97 | # because they only make sense for C programs. | |
11cde1c8 BD |
98 | QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS" |
99 | ||
9c83ffd8 PM |
100 | for arg in $QEMU_CFLAGS; do |
101 | case $arg in | |
102 | -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ | |
103 | -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) | |
104 | ;; | |
105 | *) | |
106 | QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg | |
107 | ;; | |
108 | esac | |
109 | done | |
110 | } | |
111 | ||
52166aa0 | 112 | compile_object() { |
fd0e6053 JS |
113 | local_cflags="$1" |
114 | do_cc $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC | |
52166aa0 JQ |
115 | } |
116 | ||
117 | compile_prog() { | |
118 | local_cflags="$1" | |
119 | local_ldflags="$2" | |
8dc38a78 | 120 | do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags |
52166aa0 JQ |
121 | } |
122 | ||
11568d6d PB |
123 | # symbolically link $1 to $2. Portable version of "ln -sf". |
124 | symlink() { | |
72b8b5a1 | 125 | rm -rf "$2" |
ec5b06d7 | 126 | mkdir -p "$(dirname "$2")" |
72b8b5a1 | 127 | ln -s "$1" "$2" |
11568d6d PB |
128 | } |
129 | ||
0dba6195 LM |
130 | # check whether a command is available to this shell (may be either an |
131 | # executable or a builtin) | |
132 | has() { | |
133 | type "$1" >/dev/null 2>&1 | |
134 | } | |
135 | ||
136 | # search for an executable in PATH | |
137 | path_of() { | |
138 | local_command="$1" | |
139 | local_ifs="$IFS" | |
140 | local_dir="" | |
141 | ||
142 | # pathname has a dir component? | |
143 | if [ "${local_command#*/}" != "$local_command" ]; then | |
144 | if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then | |
145 | echo "$local_command" | |
146 | return 0 | |
147 | fi | |
148 | fi | |
149 | if [ -z "$local_command" ]; then | |
150 | return 1 | |
151 | fi | |
152 | ||
153 | IFS=: | |
154 | for local_dir in $PATH; do | |
155 | if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then | |
156 | echo "$local_dir/$local_command" | |
157 | IFS="${local_ifs:-$(printf ' \t\n')}" | |
158 | return 0 | |
159 | fi | |
160 | done | |
161 | # not found | |
162 | IFS="${local_ifs:-$(printf ' \t\n')}" | |
163 | return 1 | |
164 | } | |
165 | ||
5b808275 LV |
166 | have_backend () { |
167 | echo "$trace_backends" | grep "$1" >/dev/null | |
168 | } | |
169 | ||
3b6b7550 PB |
170 | glob() { |
171 | eval test -z '"${1#'"$2"'}"' | |
172 | } | |
173 | ||
174 | supported_hax_target() { | |
175 | test "$hax" = "yes" || return 1 | |
176 | glob "$1" "*-softmmu" || return 1 | |
177 | case "${1%-softmmu}" in | |
178 | i386|x86_64) | |
179 | return 0 | |
180 | ;; | |
181 | esac | |
182 | return 1 | |
183 | } | |
184 | ||
185 | supported_kvm_target() { | |
186 | test "$kvm" = "yes" || return 1 | |
187 | glob "$1" "*-softmmu" || return 1 | |
188 | case "${1%-softmmu}:$cpu" in | |
189 | arm:arm | aarch64:aarch64 | \ | |
190 | i386:i386 | i386:x86_64 | i386:x32 | \ | |
191 | x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ | |
192 | mips:mips | mipsel:mips | \ | |
193 | ppc:ppc | ppcemb:ppc | ppc64:ppc | \ | |
194 | ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ | |
195 | s390x:s390x) | |
196 | return 0 | |
197 | ;; | |
198 | esac | |
199 | return 1 | |
200 | } | |
201 | ||
202 | supported_xen_target() { | |
203 | test "$xen" = "yes" || return 1 | |
204 | glob "$1" "*-softmmu" || return 1 | |
b5ed2e11 PB |
205 | # Only i386 and x86_64 provide the xenpv machine. |
206 | case "${1%-softmmu}" in | |
207 | i386|x86_64) | |
3b6b7550 PB |
208 | return 0 |
209 | ;; | |
210 | esac | |
211 | return 1 | |
212 | } | |
213 | ||
d880a3ba PB |
214 | supported_target() { |
215 | case "$1" in | |
216 | *-softmmu) | |
217 | ;; | |
218 | *-linux-user) | |
219 | if test "$linux" != "yes"; then | |
220 | print_error "Target '$target' is only available on a Linux host" | |
221 | return 1 | |
222 | fi | |
223 | ;; | |
224 | *-bsd-user) | |
225 | if test "$bsd" != "yes"; then | |
226 | print_error "Target '$target' is only available on a BSD host" | |
227 | return 1 | |
228 | fi | |
229 | ;; | |
230 | *) | |
231 | print_error "Invalid target name '$target'" | |
232 | return 1 | |
233 | ;; | |
234 | esac | |
b3f6ea7e PB |
235 | test "$tcg" = "yes" && return 0 |
236 | supported_kvm_target "$1" && return 0 | |
237 | supported_xen_target "$1" && return 0 | |
238 | supported_hax_target "$1" && return 0 | |
239 | print_error "TCG disabled, but hardware accelerator not available for '$target'" | |
240 | return 1 | |
d880a3ba PB |
241 | } |
242 | ||
e9a3591f CB |
243 | |
244 | ld_has() { | |
245 | $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 | |
246 | } | |
247 | ||
7d13299d | 248 | # default parameters |
89138857 | 249 | source_path=$(dirname "$0") |
2ff6b91e | 250 | cpu="" |
a31a8642 | 251 | iasl="iasl" |
1e43adfc | 252 | interp_prefix="/usr/gnemul/qemu-%M" |
43ce4dfe | 253 | static="no" |
7d13299d | 254 | cross_prefix="" |
0c58ac1c | 255 | audio_drv_list="" |
b64ec4e4 FZ |
256 | block_drv_rw_whitelist="" |
257 | block_drv_ro_whitelist="" | |
e49d021e | 258 | host_cc="cc" |
73da375e | 259 | libs_softmmu="" |
3e2e0e6b | 260 | libs_tools="" |
67f86e8e | 261 | audio_pt_int="" |
d5631638 | 262 | audio_win_int="" |
2b2e59e6 | 263 | cc_i386=i386-pc-linux-gnu-gcc |
957f1f99 | 264 | libs_qga="" |
5bc62e01 | 265 | debug_info="yes" |
63678e17 | 266 | stack_protector="" |
92712822 DB |
267 | |
268 | if test -e "$source_path/.git" | |
269 | then | |
270 | git_submodules="ui/keycodemapdb" | |
271 | else | |
272 | git_submodules="" | |
273 | fi | |
ac0df51d | 274 | |
afb63ebd SW |
275 | # Don't accept a target_list environment variable. |
276 | unset target_list | |
377529c0 PB |
277 | |
278 | # Default value for a variable defining feature "foo". | |
279 | # * foo="no" feature will only be used if --enable-foo arg is given | |
280 | # * foo="" feature will be searched for, and if found, will be used | |
281 | # unless --disable-foo is given | |
282 | # * foo="yes" this value will only be set by --enable-foo flag. | |
283 | # feature will searched for, | |
284 | # if not found, configure exits with error | |
285 | # | |
286 | # Always add --enable-foo and --disable-foo command line args. | |
287 | # Distributions want to ensure that several features are compiled in, and it | |
288 | # is impossible without a --enable-foo that exits if a feature is not found. | |
289 | ||
290 | bluez="" | |
291 | brlapi="" | |
292 | curl="" | |
293 | curses="" | |
294 | docs="" | |
295 | fdt="" | |
58952137 | 296 | netmap="no" |
377529c0 | 297 | sdl="" |
ee8466d0 | 298 | sdlabi="" |
983eef5a | 299 | virtfs="" |
fe8fc5ae | 300 | mpath="" |
821601ea | 301 | vnc="yes" |
377529c0 | 302 | sparse="no" |
377529c0 | 303 | vde="" |
377529c0 PB |
304 | vnc_sasl="" |
305 | vnc_jpeg="" | |
306 | vnc_png="" | |
377529c0 | 307 | xen="" |
d5b93ddf | 308 | xen_ctrl_version="" |
64a7ad6f | 309 | xen_pv_domain_build="no" |
eb6fda0f | 310 | xen_pci_passthrough="" |
377529c0 | 311 | linux_aio="" |
47e98658 | 312 | cap_ng="" |
377529c0 | 313 | attr="" |
4f26f2b6 | 314 | libattr="" |
377529c0 | 315 | xfs="" |
b3f6ea7e | 316 | tcg="yes" |
377529c0 | 317 | |
d41a75a2 | 318 | vhost_net="no" |
5e9be92d | 319 | vhost_scsi="no" |
fc0b9b0e | 320 | vhost_vsock="no" |
e6a74868 | 321 | vhost_user="" |
d41a75a2 | 322 | kvm="no" |
b0cb0a66 | 323 | hax="no" |
2da776db | 324 | rdma="" |
377529c0 PB |
325 | gprof="no" |
326 | debug_tcg="no" | |
377529c0 | 327 | debug="no" |
b553a042 | 328 | fortify_source="" |
377529c0 | 329 | strip_opt="yes" |
9195b2c2 | 330 | tcg_interpreter="no" |
377529c0 PB |
331 | bigendian="no" |
332 | mingw32="no" | |
1d728c39 BS |
333 | gcov="no" |
334 | gcov_tool="gcov" | |
377529c0 | 335 | EXESUF="" |
17969268 FZ |
336 | DSOSUF=".so" |
337 | LDFLAGS_SHARED="-shared" | |
338 | modules="no" | |
377529c0 PB |
339 | prefix="/usr/local" |
340 | mandir="\${prefix}/share/man" | |
528ae5b8 | 341 | datadir="\${prefix}/share" |
3d5eecab | 342 | firmwarepath="\${prefix}/share/qemu-firmware" |
850da188 | 343 | qemu_docdir="\${prefix}/share/doc/qemu" |
377529c0 | 344 | bindir="\${prefix}/bin" |
3aa5d2be | 345 | libdir="\${prefix}/lib" |
8bf188aa | 346 | libexecdir="\${prefix}/libexec" |
0f94d6da | 347 | includedir="\${prefix}/include" |
377529c0 | 348 | sysconfdir="\${prefix}/etc" |
785c23ae | 349 | local_statedir="\${prefix}/var" |
377529c0 PB |
350 | confsuffix="/qemu" |
351 | slirp="yes" | |
377529c0 PB |
352 | oss_lib="" |
353 | bsd="no" | |
354 | linux="no" | |
355 | solaris="no" | |
356 | profiler="no" | |
357 | cocoa="no" | |
358 | softmmu="yes" | |
359 | linux_user="no" | |
377529c0 | 360 | bsd_user="no" |
377529c0 PB |
361 | blobs="yes" |
362 | pkgversion="" | |
40d6444e | 363 | pie="" |
3556c233 | 364 | qom_cast_debug="yes" |
baf86d6b | 365 | trace_backends="log" |
377529c0 PB |
366 | trace_file="trace" |
367 | spice="" | |
368 | rbd="" | |
7b02f544 | 369 | smartcard="" |
2b2325ff | 370 | libusb="" |
69354a83 | 371 | usb_redir="" |
da076ffe | 372 | opengl="" |
014cb152 | 373 | opengl_dmabuf="no" |
5dd89908 | 374 | cpuid_h="no" |
99f2dbd3 | 375 | avx2_opt="no" |
1ece9905 | 376 | zlib="yes" |
b25c9dff SW |
377 | lzo="" |
378 | snappy="" | |
6b383c08 | 379 | bzip2="" |
e8ef31a3 | 380 | guest_agent="" |
d9840e25 | 381 | guest_agent_with_vss="no" |
50cbebb9 | 382 | guest_agent_ntddscsi="no" |
9dacf32d | 383 | guest_agent_msi="" |
d9840e25 TS |
384 | vss_win32_sdk="" |
385 | win_sdk="no" | |
4b1c11fd | 386 | want_tools="yes" |
c589b249 | 387 | libiscsi="" |
6542aa9c | 388 | libnfs="" |
519175a2 | 389 | coroutine="" |
70c60c08 | 390 | coroutine_pool="" |
7d992e4d | 391 | debug_stack_usage="no" |
f0d92b56 | 392 | crypto_afalg="no" |
f794573e | 393 | seccomp="" |
eb100396 | 394 | glusterfs="" |
d85fa9eb | 395 | glusterfs_xlator_opt="no" |
0c14fb47 | 396 | glusterfs_discard="no" |
df3a429a | 397 | glusterfs_fallocate="no" |
7c815372 | 398 | glusterfs_zerofill="no" |
a4ccabcf | 399 | gtk="" |
9e04c683 | 400 | gtkabi="" |
925a0400 | 401 | gtk_gl="no" |
a1c5e949 | 402 | tls_priority="NORMAL" |
ddbb0d09 | 403 | gnutls="" |
b917da4c | 404 | gnutls_rnd="" |
91bfcdb0 | 405 | nettle="" |
fff2f982 | 406 | nettle_kdf="no" |
91bfcdb0 | 407 | gcrypt="" |
1f923c70 | 408 | gcrypt_hmac="no" |
37788f25 | 409 | gcrypt_kdf="no" |
bbbf9bfb | 410 | vte="" |
9d9e1521 | 411 | virglrenderer="" |
e91c793c | 412 | tpm="yes" |
0a12ec87 | 413 | libssh2="" |
ed1701c6 | 414 | live_block_migration="yes" |
a99d57bb | 415 | numa="" |
2847b469 | 416 | tcmalloc="no" |
7b01cb97 | 417 | jemalloc="no" |
a6b1d4c0 | 418 | replication="yes" |
da92c3ff | 419 | vxhs="" |
377529c0 | 420 | |
898be3e0 PM |
421 | supported_cpu="no" |
422 | supported_os="no" | |
fb59dabd | 423 | bogus_os="no" |
898be3e0 | 424 | |
ac0df51d AL |
425 | # parse CC options first |
426 | for opt do | |
89138857 | 427 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
ac0df51d AL |
428 | case "$opt" in |
429 | --cross-prefix=*) cross_prefix="$optarg" | |
430 | ;; | |
3d8df640 | 431 | --cc=*) CC="$optarg" |
ac0df51d | 432 | ;; |
83f73fce TS |
433 | --cxx=*) CXX="$optarg" |
434 | ;; | |
ca4deeb1 PB |
435 | --source-path=*) source_path="$optarg" |
436 | ;; | |
2ff6b91e JQ |
437 | --cpu=*) cpu="$optarg" |
438 | ;; | |
de385287 | 439 | --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg" |
f9943cd5 | 440 | EXTRA_CFLAGS="$optarg" |
e2a2ed06 | 441 | ;; |
11cde1c8 BD |
442 | --extra-cxxflags=*) QEMU_CXXFLAGS="$QEMU_CXXFLAGS $optarg" |
443 | EXTRA_CXXFLAGS="$optarg" | |
444 | ;; | |
a4969e90 | 445 | --extra-ldflags=*) LDFLAGS="$LDFLAGS $optarg" |
f9943cd5 | 446 | EXTRA_LDFLAGS="$optarg" |
e2a2ed06 | 447 | ;; |
5bc62e01 GH |
448 | --enable-debug-info) debug_info="yes" |
449 | ;; | |
450 | --disable-debug-info) debug_info="no" | |
451 | ;; | |
ac0df51d AL |
452 | esac |
453 | done | |
ac0df51d AL |
454 | # OS specific |
455 | # Using uname is really, really broken. Once we have the right set of checks | |
93148aa5 | 456 | # we can eliminate its usage altogether. |
ac0df51d | 457 | |
e49d021e PM |
458 | # Preferred compiler: |
459 | # ${CC} (if set) | |
460 | # ${cross_prefix}gcc (if cross-prefix specified) | |
461 | # system compiler | |
462 | if test -z "${CC}${cross_prefix}"; then | |
463 | cc="$host_cc" | |
464 | else | |
465 | cc="${CC-${cross_prefix}gcc}" | |
466 | fi | |
467 | ||
83f73fce TS |
468 | if test -z "${CXX}${cross_prefix}"; then |
469 | cxx="c++" | |
470 | else | |
471 | cxx="${CXX-${cross_prefix}g++}" | |
472 | fi | |
473 | ||
b3198cc2 | 474 | ar="${AR-${cross_prefix}ar}" |
cdbd727c | 475 | as="${AS-${cross_prefix}as}" |
5f6f0e27 | 476 | ccas="${CCAS-$cc}" |
3dd46c78 | 477 | cpp="${CPP-$cc -E}" |
b3198cc2 SY |
478 | objcopy="${OBJCOPY-${cross_prefix}objcopy}" |
479 | ld="${LD-${cross_prefix}ld}" | |
4852ee95 | 480 | nm="${NM-${cross_prefix}nm}" |
b3198cc2 SY |
481 | strip="${STRIP-${cross_prefix}strip}" |
482 | windres="${WINDRES-${cross_prefix}windres}" | |
17884d7b ST |
483 | pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" |
484 | query_pkg_config() { | |
485 | "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" | |
486 | } | |
487 | pkg_config=query_pkg_config | |
b3198cc2 | 488 | sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" |
47c03744 | 489 | sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" |
ac0df51d | 490 | |
45d285ab PM |
491 | # If the user hasn't specified ARFLAGS, default to 'rv', just as make does. |
492 | ARFLAGS="${ARFLAGS-rv}" | |
493 | ||
be17dc90 | 494 | # default flags for all hosts |
2d31515b PM |
495 | # We use -fwrapv to tell the compiler that we require a C dialect where |
496 | # left shift of signed integers is well defined and has the expected | |
497 | # 2s-complement style results. (Both clang and gcc agree that it | |
498 | # provides these semantics.) | |
499 | QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" | |
f9188227 | 500 | QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
c95e3080 | 501 | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
be17dc90 | 502 | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" |
244f1441 | 503 | QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/accel/tcg -I\$(SRC_PATH)/include" |
5bc62e01 GH |
504 | if test "$debug_info" = "yes"; then |
505 | CFLAGS="-g $CFLAGS" | |
506 | LDFLAGS="-g $LDFLAGS" | |
507 | fi | |
be17dc90 | 508 | |
ca4deeb1 | 509 | # make source path absolute |
89138857 | 510 | source_path=$(cd "$source_path"; pwd) |
ca4deeb1 | 511 | |
cab00a5a MT |
512 | # running configure in the source tree? |
513 | # we know that's the case if configure is there. | |
514 | if test -f "./configure"; then | |
515 | pwd_is_source_path="y" | |
516 | else | |
517 | pwd_is_source_path="n" | |
518 | fi | |
519 | ||
ac0df51d AL |
520 | check_define() { |
521 | cat > $TMPC <<EOF | |
522 | #if !defined($1) | |
fd786e1a | 523 | #error $1 not defined |
ac0df51d AL |
524 | #endif |
525 | int main(void) { return 0; } | |
526 | EOF | |
52166aa0 | 527 | compile_object |
ac0df51d AL |
528 | } |
529 | ||
307119e7 GH |
530 | check_include() { |
531 | cat > $TMPC <<EOF | |
532 | #include <$1> | |
533 | int main(void) { return 0; } | |
534 | EOF | |
535 | compile_object | |
536 | } | |
537 | ||
93b25869 JS |
538 | write_c_skeleton() { |
539 | cat > $TMPC <<EOF | |
540 | int main(void) { return 0; } | |
541 | EOF | |
542 | } | |
543 | ||
bbea4050 PM |
544 | if check_define __linux__ ; then |
545 | targetos="Linux" | |
546 | elif check_define _WIN32 ; then | |
547 | targetos='MINGW32' | |
548 | elif check_define __OpenBSD__ ; then | |
549 | targetos='OpenBSD' | |
550 | elif check_define __sun__ ; then | |
551 | targetos='SunOS' | |
552 | elif check_define __HAIKU__ ; then | |
553 | targetos='Haiku' | |
951fedfc PM |
554 | elif check_define __FreeBSD__ ; then |
555 | targetos='FreeBSD' | |
556 | elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then | |
557 | targetos='GNU/kFreeBSD' | |
558 | elif check_define __DragonFly__ ; then | |
559 | targetos='DragonFly' | |
560 | elif check_define __NetBSD__; then | |
561 | targetos='NetBSD' | |
562 | elif check_define __APPLE__; then | |
563 | targetos='Darwin' | |
bbea4050 | 564 | else |
951fedfc PM |
565 | # This is a fatal error, but don't report it yet, because we |
566 | # might be going to just print the --help text, or it might | |
567 | # be the result of a missing compiler. | |
568 | targetos='bogus' | |
569 | bogus_os='yes' | |
bbea4050 PM |
570 | fi |
571 | ||
572 | # Some host OSes need non-standard checks for which CPU to use. | |
573 | # Note that these checks are broken for cross-compilation: if you're | |
574 | # cross-compiling to one of these OSes then you'll need to specify | |
575 | # the correct CPU with the --cpu option. | |
576 | case $targetos in | |
577 | Darwin) | |
578 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can | |
579 | # run 64-bit userspace code. | |
580 | # If the user didn't specify a CPU explicitly and the kernel says this is | |
581 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. | |
582 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then | |
583 | cpu="x86_64" | |
584 | fi | |
585 | ;; | |
586 | SunOS) | |
89138857 | 587 | # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo |
bbea4050 PM |
588 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
589 | cpu="x86_64" | |
590 | fi | |
591 | esac | |
592 | ||
2ff6b91e JQ |
593 | if test ! -z "$cpu" ; then |
594 | # command line argument | |
595 | : | |
596 | elif check_define __i386__ ; then | |
ac0df51d AL |
597 | cpu="i386" |
598 | elif check_define __x86_64__ ; then | |
c72b26ec RH |
599 | if check_define __ILP32__ ; then |
600 | cpu="x32" | |
601 | else | |
602 | cpu="x86_64" | |
603 | fi | |
3aa9bd6c | 604 | elif check_define __sparc__ ; then |
3aa9bd6c BS |
605 | if check_define __arch64__ ; then |
606 | cpu="sparc64" | |
607 | else | |
608 | cpu="sparc" | |
609 | fi | |
fdf7ed96 | 610 | elif check_define _ARCH_PPC ; then |
611 | if check_define _ARCH_PPC64 ; then | |
612 | cpu="ppc64" | |
613 | else | |
614 | cpu="ppc" | |
615 | fi | |
afa05235 AJ |
616 | elif check_define __mips__ ; then |
617 | cpu="mips" | |
477ba620 AJ |
618 | elif check_define __ia64__ ; then |
619 | cpu="ia64" | |
d66ed0ea AJ |
620 | elif check_define __s390__ ; then |
621 | if check_define __s390x__ ; then | |
622 | cpu="s390x" | |
623 | else | |
624 | cpu="s390" | |
625 | fi | |
21d89f84 PM |
626 | elif check_define __arm__ ; then |
627 | cpu="arm" | |
1f080313 CF |
628 | elif check_define __aarch64__ ; then |
629 | cpu="aarch64" | |
ac0df51d | 630 | else |
89138857 | 631 | cpu=$(uname -m) |
ac0df51d AL |
632 | fi |
633 | ||
359bc95d PM |
634 | ARCH= |
635 | # Normalise host CPU name and set ARCH. | |
636 | # Note that this case should only have supported host CPUs, not guests. | |
7d13299d | 637 | case "$cpu" in |
6499fd15 | 638 | ppc|ppc64|s390|s390x|sparc64|x32) |
898be3e0 PM |
639 | cpu="$cpu" |
640 | supported_cpu="yes" | |
641 | ;; | |
7d13299d | 642 | i386|i486|i586|i686|i86pc|BePC) |
97a847bc | 643 | cpu="i386" |
898be3e0 | 644 | supported_cpu="yes" |
7d13299d | 645 | ;; |
aaa5fa14 AJ |
646 | x86_64|amd64) |
647 | cpu="x86_64" | |
898be3e0 | 648 | supported_cpu="yes" |
aaa5fa14 | 649 | ;; |
21d89f84 PM |
650 | armv*b|armv*l|arm) |
651 | cpu="arm" | |
898be3e0 | 652 | supported_cpu="yes" |
7d13299d | 653 | ;; |
1f080313 CF |
654 | aarch64) |
655 | cpu="aarch64" | |
898be3e0 | 656 | supported_cpu="yes" |
1f080313 | 657 | ;; |
afa05235 AJ |
658 | mips*) |
659 | cpu="mips" | |
898be3e0 | 660 | supported_cpu="yes" |
afa05235 | 661 | ;; |
3142255c | 662 | sparc|sun4[cdmuv]) |
ae228531 | 663 | cpu="sparc" |
6499fd15 | 664 | supported_cpu="yes" |
ae228531 | 665 | ;; |
7d13299d | 666 | *) |
359bc95d PM |
667 | # This will result in either an error or falling back to TCI later |
668 | ARCH=unknown | |
7d13299d FB |
669 | ;; |
670 | esac | |
359bc95d PM |
671 | if test -z "$ARCH"; then |
672 | ARCH="$cpu" | |
673 | fi | |
e2d52ad3 | 674 | |
7d13299d | 675 | # OS specific |
0dbfc675 | 676 | |
adfc3e91 SS |
677 | # host *BSD for user mode |
678 | HOST_VARIANT_DIR="" | |
679 | ||
7d13299d | 680 | case $targetos in |
67b915a5 | 681 | MINGW32*) |
0dbfc675 | 682 | mingw32="yes" |
b0cb0a66 | 683 | hax="yes" |
3cec7cc2 | 684 | audio_possible_drivers="dsound sdl" |
307119e7 GH |
685 | if check_include dsound.h; then |
686 | audio_drv_list="dsound" | |
687 | else | |
688 | audio_drv_list="" | |
689 | fi | |
898be3e0 | 690 | supported_os="yes" |
67b915a5 | 691 | ;; |
5c40d2bd | 692 | GNU/kFreeBSD) |
a167ba50 | 693 | bsd="yes" |
0dbfc675 | 694 | audio_drv_list="oss" |
0bac1111 | 695 | audio_possible_drivers="oss sdl pa" |
5c40d2bd | 696 | ;; |
7d3505c5 | 697 | FreeBSD) |
0dbfc675 | 698 | bsd="yes" |
0db4a067 | 699 | make="${MAKE-gmake}" |
0dbfc675 | 700 | audio_drv_list="oss" |
0bac1111 | 701 | audio_possible_drivers="oss sdl pa" |
f01576f1 JL |
702 | # needed for kinfo_getvmmap(3) in libutil.h |
703 | LIBS="-lutil $LIBS" | |
a7764f15 EM |
704 | # needed for kinfo_getproc |
705 | libs_qga="-lutil $libs_qga" | |
58952137 | 706 | netmap="" # enable netmap autodetect |
adfc3e91 | 707 | HOST_VARIANT_DIR="freebsd" |
898be3e0 | 708 | supported_os="yes" |
7d3505c5 | 709 | ;; |
c5e97233 | 710 | DragonFly) |
0dbfc675 | 711 | bsd="yes" |
0db4a067 | 712 | make="${MAKE-gmake}" |
0dbfc675 | 713 | audio_drv_list="oss" |
0bac1111 | 714 | audio_possible_drivers="oss sdl pa" |
adfc3e91 | 715 | HOST_VARIANT_DIR="dragonfly" |
c5e97233 | 716 | ;; |
7d3505c5 | 717 | NetBSD) |
0dbfc675 | 718 | bsd="yes" |
0db4a067 | 719 | make="${MAKE-gmake}" |
0dbfc675 | 720 | audio_drv_list="oss" |
0bac1111 | 721 | audio_possible_drivers="oss sdl" |
0dbfc675 | 722 | oss_lib="-lossaudio" |
adfc3e91 | 723 | HOST_VARIANT_DIR="netbsd" |
3c2bdbc1 | 724 | supported_os="yes" |
7d3505c5 FB |
725 | ;; |
726 | OpenBSD) | |
0dbfc675 | 727 | bsd="yes" |
0db4a067 | 728 | make="${MAKE-gmake}" |
4f6ab397 | 729 | audio_drv_list="sdl" |
0bac1111 | 730 | audio_possible_drivers="sdl" |
adfc3e91 | 731 | HOST_VARIANT_DIR="openbsd" |
7d3505c5 | 732 | ;; |
83fb7adf | 733 | Darwin) |
0dbfc675 JQ |
734 | bsd="yes" |
735 | darwin="yes" | |
b0cb0a66 | 736 | hax="yes" |
17969268 | 737 | LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" |
0dbfc675 | 738 | if [ "$cpu" = "x86_64" ] ; then |
a558ee17 | 739 | QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" |
0c439cbf | 740 | LDFLAGS="-arch x86_64 $LDFLAGS" |
0dbfc675 | 741 | fi |
0dbfc675 JQ |
742 | cocoa="yes" |
743 | audio_drv_list="coreaudio" | |
14382605 | 744 | audio_possible_drivers="coreaudio sdl" |
0dbfc675 | 745 | LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" |
7973f21c | 746 | libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" |
a0b7cf6b PM |
747 | # Disable attempts to use ObjectiveC features in os/object.h since they |
748 | # won't work when we're compiling with gcc as a C compiler. | |
749 | QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" | |
adfc3e91 | 750 | HOST_VARIANT_DIR="darwin" |
898be3e0 | 751 | supported_os="yes" |
83fb7adf | 752 | ;; |
ec530c81 | 753 | SunOS) |
0dbfc675 | 754 | solaris="yes" |
0db4a067 PB |
755 | make="${MAKE-gmake}" |
756 | install="${INSTALL-ginstall}" | |
e2d8830e | 757 | smbd="${SMBD-/usr/sfw/sbin/smbd}" |
0dbfc675 JQ |
758 | if test -f /usr/include/sys/soundcard.h ; then |
759 | audio_drv_list="oss" | |
760 | fi | |
761 | audio_possible_drivers="oss sdl" | |
d741429a BS |
762 | # needed for CMSG_ macros in sys/socket.h |
763 | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" | |
764 | # needed for TIOCWIN* defines in termios.h | |
765 | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" | |
a558ee17 | 766 | QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" |
560d375f AF |
767 | solarisnetlibs="-lsocket -lnsl -lresolv" |
768 | LIBS="$solarisnetlibs $LIBS" | |
769 | libs_qga="$solarisnetlibs $libs_qga" | |
86b2bd93 | 770 | ;; |
179cf400 AF |
771 | Haiku) |
772 | haiku="yes" | |
773 | QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" | |
774 | LIBS="-lposix_error_mapper -lnetwork $LIBS" | |
775 | ;; | |
898be3e0 | 776 | Linux) |
0dbfc675 | 777 | audio_drv_list="oss" |
0bac1111 | 778 | audio_possible_drivers="oss alsa sdl pa" |
0dbfc675 JQ |
779 | linux="yes" |
780 | linux_user="yes" | |
af2be207 JK |
781 | kvm="yes" |
782 | vhost_net="yes" | |
5e9be92d | 783 | vhost_scsi="yes" |
fc0b9b0e | 784 | vhost_vsock="yes" |
a585140d | 785 | QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES" |
898be3e0 PM |
786 | supported_os="yes" |
787 | ;; | |
7d13299d FB |
788 | esac |
789 | ||
7d3505c5 | 790 | if [ "$bsd" = "yes" ] ; then |
b1a550a0 | 791 | if [ "$darwin" != "yes" ] ; then |
08de3949 | 792 | bsd_user="yes" |
83fb7adf | 793 | fi |
7d3505c5 FB |
794 | fi |
795 | ||
0db4a067 PB |
796 | : ${make=${MAKE-make}} |
797 | : ${install=${INSTALL-install}} | |
52510f8b | 798 | : ${python=${PYTHON-python}} |
e2d8830e | 799 | : ${smbd=${SMBD-/usr/sbin/smbd}} |
0db4a067 | 800 | |
3c4a4d0d PM |
801 | # Default objcc to clang if available, otherwise use CC |
802 | if has clang; then | |
803 | objcc=clang | |
804 | else | |
805 | objcc="$cc" | |
806 | fi | |
807 | ||
3457a3f8 | 808 | if test "$mingw32" = "yes" ; then |
3457a3f8 | 809 | EXESUF=".exe" |
17969268 | 810 | DSOSUF=".dll" |
a558ee17 | 811 | QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" |
e94a7936 SW |
812 | # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) |
813 | QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" | |
78e9d4ad SW |
814 | # MinGW needs -mthreads for TLS and macro _MT. |
815 | QEMU_CFLAGS="-mthreads $QEMU_CFLAGS" | |
f7cf5d5b | 816 | LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" |
93b25869 | 817 | write_c_skeleton; |
f7cf5d5b SW |
818 | if compile_prog "" "-liberty" ; then |
819 | LIBS="-liberty $LIBS" | |
820 | fi | |
c5ec15ea | 821 | prefix="c:/Program Files/QEMU" |
683035de | 822 | mandir="\${prefix}" |
528ae5b8 | 823 | datadir="\${prefix}" |
850da188 | 824 | qemu_docdir="\${prefix}" |
683035de PB |
825 | bindir="\${prefix}" |
826 | sysconfdir="\${prefix}" | |
5a699bbb | 827 | local_statedir= |
683035de | 828 | confsuffix="" |
161a56a9 | 829 | libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -liphlpapi -lnetapi32 $libs_qga" |
3457a3f8 JQ |
830 | fi |
831 | ||
487fefdb | 832 | werror="" |
85aa5189 | 833 | |
7d13299d | 834 | for opt do |
89138857 | 835 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
7d13299d | 836 | case "$opt" in |
2efc3265 FB |
837 | --help|-h) show_help=yes |
838 | ;; | |
99123e13 MF |
839 | --version|-V) exec cat $source_path/VERSION |
840 | ;; | |
b1a550a0 | 841 | --prefix=*) prefix="$optarg" |
7d13299d | 842 | ;; |
b1a550a0 | 843 | --interp-prefix=*) interp_prefix="$optarg" |
32ce6337 | 844 | ;; |
ca4deeb1 | 845 | --source-path=*) |
7d13299d | 846 | ;; |
ac0df51d | 847 | --cross-prefix=*) |
7d13299d | 848 | ;; |
ac0df51d | 849 | --cc=*) |
7d13299d | 850 | ;; |
b1a550a0 | 851 | --host-cc=*) host_cc="$optarg" |
83469015 | 852 | ;; |
83f73fce TS |
853 | --cxx=*) |
854 | ;; | |
e007dbec MT |
855 | --iasl=*) iasl="$optarg" |
856 | ;; | |
3c4a4d0d PM |
857 | --objcc=*) objcc="$optarg" |
858 | ;; | |
b1a550a0 | 859 | --make=*) make="$optarg" |
7d13299d | 860 | ;; |
6a882643 PB |
861 | --install=*) install="$optarg" |
862 | ;; | |
c886edfb BS |
863 | --python=*) python="$optarg" |
864 | ;; | |
1d728c39 BS |
865 | --gcov=*) gcov_tool="$optarg" |
866 | ;; | |
e2d8830e BS |
867 | --smbd=*) smbd="$optarg" |
868 | ;; | |
e2a2ed06 | 869 | --extra-cflags=*) |
7d13299d | 870 | ;; |
11cde1c8 BD |
871 | --extra-cxxflags=*) |
872 | ;; | |
e2a2ed06 | 873 | --extra-ldflags=*) |
7d13299d | 874 | ;; |
5bc62e01 GH |
875 | --enable-debug-info) |
876 | ;; | |
877 | --disable-debug-info) | |
878 | ;; | |
17969268 FZ |
879 | --enable-modules) |
880 | modules="yes" | |
3aa88b31 SH |
881 | ;; |
882 | --disable-modules) | |
883 | modules="no" | |
17969268 | 884 | ;; |
2ff6b91e | 885 | --cpu=*) |
7d13299d | 886 | ;; |
b1a550a0 | 887 | --target-list=*) target_list="$optarg" |
de83cd02 | 888 | ;; |
5b808275 LV |
889 | --enable-trace-backends=*) trace_backends="$optarg" |
890 | ;; | |
891 | # XXX: backwards compatibility | |
892 | --enable-trace-backend=*) trace_backends="$optarg" | |
94a420b1 | 893 | ;; |
74242e0f | 894 | --with-trace-file=*) trace_file="$optarg" |
9410b56c | 895 | ;; |
7d13299d FB |
896 | --enable-gprof) gprof="yes" |
897 | ;; | |
1d728c39 BS |
898 | --enable-gcov) gcov="yes" |
899 | ;; | |
79427693 LM |
900 | --static) |
901 | static="yes" | |
902 | LDFLAGS="-static $LDFLAGS" | |
17884d7b | 903 | QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" |
43ce4dfe | 904 | ;; |
0b24e75f PB |
905 | --mandir=*) mandir="$optarg" |
906 | ;; | |
907 | --bindir=*) bindir="$optarg" | |
908 | ;; | |
3aa5d2be AL |
909 | --libdir=*) libdir="$optarg" |
910 | ;; | |
8bf188aa MT |
911 | --libexecdir=*) libexecdir="$optarg" |
912 | ;; | |
0f94d6da AL |
913 | --includedir=*) includedir="$optarg" |
914 | ;; | |
528ae5b8 | 915 | --datadir=*) datadir="$optarg" |
0b24e75f | 916 | ;; |
023d3d67 EH |
917 | --with-confsuffix=*) confsuffix="$optarg" |
918 | ;; | |
850da188 | 919 | --docdir=*) qemu_docdir="$optarg" |
0b24e75f | 920 | ;; |
ca2fb938 | 921 | --sysconfdir=*) sysconfdir="$optarg" |
07381cc1 | 922 | ;; |
785c23ae LC |
923 | --localstatedir=*) local_statedir="$optarg" |
924 | ;; | |
3d5eecab GH |
925 | --firmwarepath=*) firmwarepath="$optarg" |
926 | ;; | |
785c23ae | 927 | --sbindir=*|--sharedstatedir=*|\ |
023ddd74 MF |
928 | --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ |
929 | --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) | |
930 | # These switches are silently ignored, for compatibility with | |
931 | # autoconf-generated configure scripts. This allows QEMU's | |
932 | # configure to be used by RPM and similar macros that set | |
933 | # lots of directory switches by default. | |
934 | ;; | |
97a847bc FB |
935 | --disable-sdl) sdl="no" |
936 | ;; | |
c4198157 JQ |
937 | --enable-sdl) sdl="yes" |
938 | ;; | |
47c03744 DA |
939 | --with-sdlabi=*) sdlabi="$optarg" |
940 | ;; | |
3556c233 PB |
941 | --disable-qom-cast-debug) qom_cast_debug="no" |
942 | ;; | |
943 | --enable-qom-cast-debug) qom_cast_debug="yes" | |
944 | ;; | |
983eef5a MI |
945 | --disable-virtfs) virtfs="no" |
946 | ;; | |
947 | --enable-virtfs) virtfs="yes" | |
948 | ;; | |
fe8fc5ae PB |
949 | --disable-mpath) mpath="no" |
950 | ;; | |
951 | --enable-mpath) mpath="yes" | |
952 | ;; | |
821601ea JS |
953 | --disable-vnc) vnc="no" |
954 | ;; | |
955 | --enable-vnc) vnc="yes" | |
956 | ;; | |
2f6a1ab0 BS |
957 | --oss-lib=*) oss_lib="$optarg" |
958 | ;; | |
0c58ac1c | 959 | --audio-drv-list=*) audio_drv_list="$optarg" |
102a52e4 | 960 | ;; |
89138857 | 961 | --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') |
b64ec4e4 | 962 | ;; |
89138857 | 963 | --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') |
eb852011 | 964 | ;; |
f8393946 AJ |
965 | --enable-debug-tcg) debug_tcg="yes" |
966 | ;; | |
967 | --disable-debug-tcg) debug_tcg="no" | |
968 | ;; | |
f3d08ee6 PB |
969 | --enable-debug) |
970 | # Enable debugging options that aren't excessively noisy | |
971 | debug_tcg="yes" | |
972 | debug="yes" | |
973 | strip_opt="no" | |
b553a042 | 974 | fortify_source="no" |
f3d08ee6 | 975 | ;; |
03b4fe7d AL |
976 | --enable-sparse) sparse="yes" |
977 | ;; | |
978 | --disable-sparse) sparse="no" | |
979 | ;; | |
1625af87 AL |
980 | --disable-strip) strip_opt="no" |
981 | ;; | |
2f9606b3 AL |
982 | --disable-vnc-sasl) vnc_sasl="no" |
983 | ;; | |
ea784e3b JQ |
984 | --enable-vnc-sasl) vnc_sasl="yes" |
985 | ;; | |
2f6f5c7a CC |
986 | --disable-vnc-jpeg) vnc_jpeg="no" |
987 | ;; | |
988 | --enable-vnc-jpeg) vnc_jpeg="yes" | |
989 | ;; | |
efe556ad CC |
990 | --disable-vnc-png) vnc_png="no" |
991 | ;; | |
992 | --enable-vnc-png) vnc_png="yes" | |
993 | ;; | |
443f1376 | 994 | --disable-slirp) slirp="no" |
1d14ffa9 | 995 | ;; |
e0e6c8c0 | 996 | --disable-vde) vde="no" |
8a16d273 | 997 | ;; |
dfb278bd JQ |
998 | --enable-vde) vde="yes" |
999 | ;; | |
58952137 VM |
1000 | --disable-netmap) netmap="no" |
1001 | ;; | |
1002 | --enable-netmap) netmap="yes" | |
1003 | ;; | |
e37630ca AL |
1004 | --disable-xen) xen="no" |
1005 | ;; | |
fc321b4b JQ |
1006 | --enable-xen) xen="yes" |
1007 | ;; | |
eb6fda0f AP |
1008 | --disable-xen-pci-passthrough) xen_pci_passthrough="no" |
1009 | ;; | |
1010 | --enable-xen-pci-passthrough) xen_pci_passthrough="yes" | |
1011 | ;; | |
64a7ad6f IC |
1012 | --disable-xen-pv-domain-build) xen_pv_domain_build="no" |
1013 | ;; | |
1014 | --enable-xen-pv-domain-build) xen_pv_domain_build="yes" | |
1015 | ;; | |
2e4d9fb1 AJ |
1016 | --disable-brlapi) brlapi="no" |
1017 | ;; | |
4ffcedb6 JQ |
1018 | --enable-brlapi) brlapi="yes" |
1019 | ;; | |
fb599c9a AZ |
1020 | --disable-bluez) bluez="no" |
1021 | ;; | |
a20a6f46 JQ |
1022 | --enable-bluez) bluez="yes" |
1023 | ;; | |
7ba1e619 AL |
1024 | --disable-kvm) kvm="no" |
1025 | ;; | |
b31a0277 JQ |
1026 | --enable-kvm) kvm="yes" |
1027 | ;; | |
b0cb0a66 | 1028 | --disable-hax) hax="no" |
180fb750 | 1029 | ;; |
b0cb0a66 | 1030 | --enable-hax) hax="yes" |
180fb750 | 1031 | ;; |
9195b2c2 SW |
1032 | --disable-tcg-interpreter) tcg_interpreter="no" |
1033 | ;; | |
1034 | --enable-tcg-interpreter) tcg_interpreter="yes" | |
1035 | ;; | |
47e98658 CB |
1036 | --disable-cap-ng) cap_ng="no" |
1037 | ;; | |
1038 | --enable-cap-ng) cap_ng="yes" | |
1039 | ;; | |
b3f6ea7e PB |
1040 | --disable-tcg) tcg="no" |
1041 | ;; | |
1042 | --enable-tcg) tcg="yes" | |
1043 | ;; | |
cd4ec0b4 GH |
1044 | --disable-spice) spice="no" |
1045 | ;; | |
1046 | --enable-spice) spice="yes" | |
1047 | ;; | |
c589b249 RS |
1048 | --disable-libiscsi) libiscsi="no" |
1049 | ;; | |
1050 | --enable-libiscsi) libiscsi="yes" | |
1051 | ;; | |
6542aa9c PL |
1052 | --disable-libnfs) libnfs="no" |
1053 | ;; | |
1054 | --enable-libnfs) libnfs="yes" | |
1055 | ;; | |
05c2a3e7 FB |
1056 | --enable-profiler) profiler="yes" |
1057 | ;; | |
14821030 PB |
1058 | --disable-cocoa) cocoa="no" |
1059 | ;; | |
c2de5c91 | 1060 | --enable-cocoa) |
1061 | cocoa="yes" ; | |
89138857 | 1062 | audio_drv_list="coreaudio $(echo $audio_drv_list | sed s,coreaudio,,g)" |
1d14ffa9 | 1063 | ;; |
cad25d69 | 1064 | --disable-system) softmmu="no" |
0a8e90f4 | 1065 | ;; |
cad25d69 | 1066 | --enable-system) softmmu="yes" |
0a8e90f4 | 1067 | ;; |
0953a80f ZA |
1068 | --disable-user) |
1069 | linux_user="no" ; | |
1070 | bsd_user="no" ; | |
0953a80f ZA |
1071 | ;; |
1072 | --enable-user) ;; | |
831b7825 | 1073 | --disable-linux-user) linux_user="no" |
0a8e90f4 | 1074 | ;; |
831b7825 TS |
1075 | --enable-linux-user) linux_user="yes" |
1076 | ;; | |
84778508 BS |
1077 | --disable-bsd-user) bsd_user="no" |
1078 | ;; | |
1079 | --enable-bsd-user) bsd_user="yes" | |
1080 | ;; | |
40d6444e | 1081 | --enable-pie) pie="yes" |
34005a00 | 1082 | ;; |
40d6444e | 1083 | --disable-pie) pie="no" |
34005a00 | 1084 | ;; |
85aa5189 FB |
1085 | --enable-werror) werror="yes" |
1086 | ;; | |
1087 | --disable-werror) werror="no" | |
1088 | ;; | |
63678e17 SN |
1089 | --enable-stack-protector) stack_protector="yes" |
1090 | ;; | |
1091 | --disable-stack-protector) stack_protector="no" | |
1092 | ;; | |
4d3b6f6e AZ |
1093 | --disable-curses) curses="no" |
1094 | ;; | |
c584a6d0 JQ |
1095 | --enable-curses) curses="yes" |
1096 | ;; | |
769ce76d AG |
1097 | --disable-curl) curl="no" |
1098 | ;; | |
788c8196 JQ |
1099 | --enable-curl) curl="yes" |
1100 | ;; | |
2df87df7 JQ |
1101 | --disable-fdt) fdt="no" |
1102 | ;; | |
1103 | --enable-fdt) fdt="yes" | |
1104 | ;; | |
5c6c3a6c CH |
1105 | --disable-linux-aio) linux_aio="no" |
1106 | ;; | |
1107 | --enable-linux-aio) linux_aio="yes" | |
1108 | ;; | |
758e8e38 VJ |
1109 | --disable-attr) attr="no" |
1110 | ;; | |
1111 | --enable-attr) attr="yes" | |
1112 | ;; | |
77755340 TS |
1113 | --disable-blobs) blobs="no" |
1114 | ;; | |
4a19f1ec PB |
1115 | --with-pkgversion=*) pkgversion=" ($optarg)" |
1116 | ;; | |
519175a2 AB |
1117 | --with-coroutine=*) coroutine="$optarg" |
1118 | ;; | |
70c60c08 SH |
1119 | --disable-coroutine-pool) coroutine_pool="no" |
1120 | ;; | |
1121 | --enable-coroutine-pool) coroutine_pool="yes" | |
1122 | ;; | |
7d992e4d PL |
1123 | --enable-debug-stack-usage) debug_stack_usage="yes" |
1124 | ;; | |
f0d92b56 LM |
1125 | --enable-crypto-afalg) crypto_afalg="yes" |
1126 | ;; | |
1127 | --disable-crypto-afalg) crypto_afalg="no" | |
1128 | ;; | |
a25dba17 | 1129 | --disable-docs) docs="no" |
70ec5dc0 | 1130 | ;; |
a25dba17 | 1131 | --enable-docs) docs="yes" |
83a3ab8b | 1132 | ;; |
d5970055 MT |
1133 | --disable-vhost-net) vhost_net="no" |
1134 | ;; | |
1135 | --enable-vhost-net) vhost_net="yes" | |
1136 | ;; | |
5e9be92d NB |
1137 | --disable-vhost-scsi) vhost_scsi="no" |
1138 | ;; | |
1139 | --enable-vhost-scsi) vhost_scsi="yes" | |
1140 | ;; | |
fc0b9b0e SH |
1141 | --disable-vhost-vsock) vhost_vsock="no" |
1142 | ;; | |
1143 | --enable-vhost-vsock) vhost_vsock="yes" | |
1144 | ;; | |
da076ffe | 1145 | --disable-opengl) opengl="no" |
20ff075b | 1146 | ;; |
da076ffe | 1147 | --enable-opengl) opengl="yes" |
20ff075b | 1148 | ;; |
f27aaf4b CB |
1149 | --disable-rbd) rbd="no" |
1150 | ;; | |
1151 | --enable-rbd) rbd="yes" | |
1152 | ;; | |
8c84cf11 ST |
1153 | --disable-xfsctl) xfs="no" |
1154 | ;; | |
1155 | --enable-xfsctl) xfs="yes" | |
1156 | ;; | |
7b02f544 | 1157 | --disable-smartcard) smartcard="no" |
111a38b0 | 1158 | ;; |
7b02f544 | 1159 | --enable-smartcard) smartcard="yes" |
111a38b0 | 1160 | ;; |
2b2325ff GH |
1161 | --disable-libusb) libusb="no" |
1162 | ;; | |
1163 | --enable-libusb) libusb="yes" | |
1164 | ;; | |
69354a83 HG |
1165 | --disable-usb-redir) usb_redir="no" |
1166 | ;; | |
1167 | --enable-usb-redir) usb_redir="yes" | |
1168 | ;; | |
1ece9905 AL |
1169 | --disable-zlib-test) zlib="no" |
1170 | ;; | |
b25c9dff SW |
1171 | --disable-lzo) lzo="no" |
1172 | ;; | |
607dacd0 QN |
1173 | --enable-lzo) lzo="yes" |
1174 | ;; | |
b25c9dff SW |
1175 | --disable-snappy) snappy="no" |
1176 | ;; | |
607dacd0 QN |
1177 | --enable-snappy) snappy="yes" |
1178 | ;; | |
6b383c08 PW |
1179 | --disable-bzip2) bzip2="no" |
1180 | ;; | |
1181 | --enable-bzip2) bzip2="yes" | |
1182 | ;; | |
d138cee9 MR |
1183 | --enable-guest-agent) guest_agent="yes" |
1184 | ;; | |
1185 | --disable-guest-agent) guest_agent="no" | |
1186 | ;; | |
9dacf32d YH |
1187 | --enable-guest-agent-msi) guest_agent_msi="yes" |
1188 | ;; | |
1189 | --disable-guest-agent-msi) guest_agent_msi="no" | |
1190 | ;; | |
d9840e25 TS |
1191 | --with-vss-sdk) vss_win32_sdk="" |
1192 | ;; | |
1193 | --with-vss-sdk=*) vss_win32_sdk="$optarg" | |
1194 | ;; | |
1195 | --without-vss-sdk) vss_win32_sdk="no" | |
1196 | ;; | |
1197 | --with-win-sdk) win_sdk="" | |
1198 | ;; | |
1199 | --with-win-sdk=*) win_sdk="$optarg" | |
1200 | ;; | |
1201 | --without-win-sdk) win_sdk="no" | |
1202 | ;; | |
4b1c11fd DB |
1203 | --enable-tools) want_tools="yes" |
1204 | ;; | |
1205 | --disable-tools) want_tools="no" | |
1206 | ;; | |
f794573e EO |
1207 | --enable-seccomp) seccomp="yes" |
1208 | ;; | |
1209 | --disable-seccomp) seccomp="no" | |
1210 | ;; | |
eb100396 BR |
1211 | --disable-glusterfs) glusterfs="no" |
1212 | ;; | |
1213 | --enable-glusterfs) glusterfs="yes" | |
1214 | ;; | |
52b53c04 FZ |
1215 | --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) |
1216 | echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 | |
583f6e7b | 1217 | ;; |
cb6414df FZ |
1218 | --enable-vhdx|--disable-vhdx) |
1219 | echo "$0: $opt is obsolete, VHDX driver is always built" >&2 | |
1220 | ;; | |
315d3184 FZ |
1221 | --enable-uuid|--disable-uuid) |
1222 | echo "$0: $opt is obsolete, UUID support is always built" >&2 | |
1223 | ;; | |
a4ccabcf AL |
1224 | --disable-gtk) gtk="no" |
1225 | ;; | |
1226 | --enable-gtk) gtk="yes" | |
1227 | ;; | |
a1c5e949 DB |
1228 | --tls-priority=*) tls_priority="$optarg" |
1229 | ;; | |
ddbb0d09 DB |
1230 | --disable-gnutls) gnutls="no" |
1231 | ;; | |
1232 | --enable-gnutls) gnutls="yes" | |
1233 | ;; | |
91bfcdb0 DB |
1234 | --disable-nettle) nettle="no" |
1235 | ;; | |
1236 | --enable-nettle) nettle="yes" | |
1237 | ;; | |
1238 | --disable-gcrypt) gcrypt="no" | |
1239 | ;; | |
1240 | --enable-gcrypt) gcrypt="yes" | |
1241 | ;; | |
2da776db MH |
1242 | --enable-rdma) rdma="yes" |
1243 | ;; | |
1244 | --disable-rdma) rdma="no" | |
1245 | ;; | |
528de90a DB |
1246 | --with-gtkabi=*) gtkabi="$optarg" |
1247 | ;; | |
bbbf9bfb SW |
1248 | --disable-vte) vte="no" |
1249 | ;; | |
1250 | --enable-vte) vte="yes" | |
1251 | ;; | |
9d9e1521 GH |
1252 | --disable-virglrenderer) virglrenderer="no" |
1253 | ;; | |
1254 | --enable-virglrenderer) virglrenderer="yes" | |
1255 | ;; | |
e91c793c CR |
1256 | --disable-tpm) tpm="no" |
1257 | ;; | |
ab214c29 SB |
1258 | --enable-tpm) tpm="yes" |
1259 | ;; | |
0a12ec87 RJ |
1260 | --disable-libssh2) libssh2="no" |
1261 | ;; | |
1262 | --enable-libssh2) libssh2="yes" | |
1263 | ;; | |
ed1701c6 DDAG |
1264 | --disable-live-block-migration) live_block_migration="no" |
1265 | ;; | |
1266 | --enable-live-block-migration) live_block_migration="yes" | |
1267 | ;; | |
a99d57bb WG |
1268 | --disable-numa) numa="no" |
1269 | ;; | |
1270 | --enable-numa) numa="yes" | |
1271 | ;; | |
2847b469 FZ |
1272 | --disable-tcmalloc) tcmalloc="no" |
1273 | ;; | |
1274 | --enable-tcmalloc) tcmalloc="yes" | |
1275 | ;; | |
7b01cb97 AD |
1276 | --disable-jemalloc) jemalloc="no" |
1277 | ;; | |
1278 | --enable-jemalloc) jemalloc="yes" | |
1279 | ;; | |
a6b1d4c0 CX |
1280 | --disable-replication) replication="no" |
1281 | ;; | |
1282 | --enable-replication) replication="yes" | |
1283 | ;; | |
da92c3ff AM |
1284 | --disable-vxhs) vxhs="no" |
1285 | ;; | |
1286 | --enable-vxhs) vxhs="yes" | |
1287 | ;; | |
e6a74868 MAL |
1288 | --disable-vhost-user) vhost_user="no" |
1289 | ;; | |
1290 | --enable-vhost-user) | |
1291 | vhost_user="yes" | |
1292 | if test "$mingw32" = "yes"; then | |
1293 | error_exit "vhost-user isn't available on win32" | |
1294 | fi | |
1295 | ;; | |
2d2ad6d0 FZ |
1296 | *) |
1297 | echo "ERROR: unknown option $opt" | |
1298 | echo "Try '$0 --help' for more information" | |
1299 | exit 1 | |
7f1559c6 | 1300 | ;; |
7d13299d FB |
1301 | esac |
1302 | done | |
1303 | ||
e6a74868 MAL |
1304 | if test "$vhost_user" = ""; then |
1305 | if test "$mingw32" = "yes"; then | |
1306 | vhost_user="no" | |
1307 | else | |
1308 | vhost_user="yes" | |
1309 | fi | |
1310 | fi | |
1311 | ||
40293e58 | 1312 | case "$cpu" in |
e3608d66 RH |
1313 | ppc) |
1314 | CPU_CFLAGS="-m32" | |
1315 | LDFLAGS="-m32 $LDFLAGS" | |
1316 | ;; | |
1317 | ppc64) | |
1318 | CPU_CFLAGS="-m64" | |
1319 | LDFLAGS="-m64 $LDFLAGS" | |
1320 | ;; | |
9b9c37c3 | 1321 | sparc) |
f1079bb8 RH |
1322 | CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" |
1323 | LDFLAGS="-m32 -mv8plus $LDFLAGS" | |
3142255c | 1324 | ;; |
ed968ff1 | 1325 | sparc64) |
79f3b12f | 1326 | CPU_CFLAGS="-m64 -mcpu=ultrasparc" |
f1079bb8 | 1327 | LDFLAGS="-m64 $LDFLAGS" |
3142255c | 1328 | ;; |
76d83bde | 1329 | s390) |
061cdd81 | 1330 | CPU_CFLAGS="-m31" |
28d7cc49 RH |
1331 | LDFLAGS="-m31 $LDFLAGS" |
1332 | ;; | |
1333 | s390x) | |
061cdd81 | 1334 | CPU_CFLAGS="-m64" |
28d7cc49 | 1335 | LDFLAGS="-m64 $LDFLAGS" |
76d83bde | 1336 | ;; |
40293e58 | 1337 | i386) |
79f3b12f | 1338 | CPU_CFLAGS="-m32" |
0c439cbf | 1339 | LDFLAGS="-m32 $LDFLAGS" |
2b2e59e6 | 1340 | cc_i386='$(CC) -m32' |
40293e58 FB |
1341 | ;; |
1342 | x86_64) | |
7ebee43e RH |
1343 | # ??? Only extremely old AMD cpus do not have cmpxchg16b. |
1344 | # If we truly care, we should simply detect this case at | |
1345 | # runtime and generate the fallback to serial emulation. | |
1346 | CPU_CFLAGS="-m64 -mcx16" | |
0c439cbf | 1347 | LDFLAGS="-m64 $LDFLAGS" |
2b2e59e6 | 1348 | cc_i386='$(CC) -m32' |
d2fbca94 | 1349 | ;; |
c72b26ec RH |
1350 | x32) |
1351 | CPU_CFLAGS="-mx32" | |
1352 | LDFLAGS="-mx32 $LDFLAGS" | |
1353 | cc_i386='$(CC) -m32' | |
1354 | ;; | |
30163d89 | 1355 | # No special flags required for other host CPUs |
3142255c BS |
1356 | esac |
1357 | ||
79f3b12f PC |
1358 | QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" |
1359 | EXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS" | |
1360 | ||
affc88cc PM |
1361 | # For user-mode emulation the host arch has to be one we explicitly |
1362 | # support, even if we're using TCI. | |
1363 | if [ "$ARCH" = "unknown" ]; then | |
1364 | bsd_user="no" | |
1365 | linux_user="no" | |
1366 | fi | |
1367 | ||
60e0df25 PM |
1368 | default_target_list="" |
1369 | ||
6e92f823 PM |
1370 | mak_wilds="" |
1371 | ||
1372 | if [ "$softmmu" = "yes" ]; then | |
1373 | mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" | |
60e0df25 | 1374 | fi |
6e92f823 PM |
1375 | if [ "$linux_user" = "yes" ]; then |
1376 | mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" | |
60e0df25 | 1377 | fi |
6e92f823 PM |
1378 | if [ "$bsd_user" = "yes" ]; then |
1379 | mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" | |
60e0df25 PM |
1380 | fi |
1381 | ||
6e92f823 PM |
1382 | for config in $mak_wilds; do |
1383 | default_target_list="${default_target_list} $(basename "$config" .mak)" | |
1384 | done | |
1385 | ||
c53eeaf7 | 1386 | # Enumerate public trace backends for --help output |
64a6047d | 1387 | trace_backend_list=$(echo $(grep -le '^PUBLIC = True$' "$source_path"/scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/')) |
c53eeaf7 | 1388 | |
af5db58e PB |
1389 | if test x"$show_help" = x"yes" ; then |
1390 | cat << EOF | |
1391 | ||
1392 | Usage: configure [options] | |
1393 | Options: [defaults in brackets after descriptions] | |
1394 | ||
08fb77ed SW |
1395 | Standard options: |
1396 | --help print this message | |
1397 | --prefix=PREFIX install in PREFIX [$prefix] | |
1398 | --interp-prefix=PREFIX where to find shared libraries, etc. | |
1399 | use %M for cpu name [$interp_prefix] | |
1400 | --target-list=LIST set target list (default: build everything) | |
1401 | $(echo Available targets: $default_target_list | \ | |
1402 | fold -s -w 53 | sed -e 's/^/ /') | |
1403 | ||
1404 | Advanced options (experts only): | |
1405 | --source-path=PATH path of source code [$source_path] | |
1406 | --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] | |
1407 | --cc=CC use C compiler CC [$cc] | |
1408 | --iasl=IASL use ACPI compiler IASL [$iasl] | |
1409 | --host-cc=CC use C compiler CC [$host_cc] for code run at | |
1410 | build time | |
1411 | --cxx=CXX use C++ compiler CXX [$cxx] | |
1412 | --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] | |
1413 | --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS | |
11cde1c8 | 1414 | --extra-cxxflags=CXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS |
08fb77ed SW |
1415 | --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS |
1416 | --make=MAKE use specified make [$make] | |
1417 | --install=INSTALL use specified install [$install] | |
1418 | --python=PYTHON use specified python [$python] | |
1419 | --smbd=SMBD use specified smbd [$smbd] | |
1420 | --static enable static build [$static] | |
1421 | --mandir=PATH install man pages in PATH | |
1422 | --datadir=PATH install firmware in PATH$confsuffix | |
1423 | --docdir=PATH install documentation in PATH$confsuffix | |
1424 | --bindir=PATH install binaries in PATH | |
1425 | --libdir=PATH install libraries in PATH | |
1426 | --sysconfdir=PATH install config in PATH$confsuffix | |
1427 | --localstatedir=PATH install local state in PATH (set at runtime on win32) | |
3d5eecab | 1428 | --firmwarepath=PATH search PATH for firmware files |
e26110cf | 1429 | --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] |
08fb77ed | 1430 | --enable-debug enable common debug build options |
08fb77ed SW |
1431 | --disable-strip disable stripping binaries |
1432 | --disable-werror disable compilation abort on warning | |
63678e17 | 1433 | --disable-stack-protector disable compiler-provided stack protection |
08fb77ed SW |
1434 | --audio-drv-list=LIST set audio drivers list: |
1435 | Available drivers: $audio_possible_drivers | |
1436 | --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L | |
1437 | --block-drv-rw-whitelist=L | |
1438 | set block driver read-write whitelist | |
1439 | (affects only QEMU, not qemu-img) | |
1440 | --block-drv-ro-whitelist=L | |
1441 | set block driver read-only whitelist | |
1442 | (affects only QEMU, not qemu-img) | |
5b808275 | 1443 | --enable-trace-backends=B Set trace backend |
c53eeaf7 | 1444 | Available backends: $trace_backend_list |
08fb77ed SW |
1445 | --with-trace-file=NAME Full PATH,NAME of file to store traces |
1446 | Default:trace-<pid> | |
c23f23b9 MT |
1447 | --disable-slirp disable SLIRP userspace network connectivity |
1448 | --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) | |
1449 | --oss-lib path to OSS library | |
1450 | --cpu=CPU Build for host CPU [$cpu] | |
08fb77ed | 1451 | --with-coroutine=BACKEND coroutine backend. Supported options: |
33c53c54 | 1452 | ucontext, sigaltstack, windows |
08fb77ed SW |
1453 | --enable-gcov enable test coverage analysis with gcov |
1454 | --gcov=GCOV use specified gcov [$gcov_tool] | |
c23f23b9 MT |
1455 | --disable-blobs disable installing provided firmware blobs |
1456 | --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent | |
1457 | --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) | |
a1c5e949 | 1458 | --tls-priority default TLS protocol/cipher priority string |
c12d66aa LM |
1459 | --enable-gprof QEMU profiling with gprof |
1460 | --enable-profiler profiler support | |
1461 | --enable-xen-pv-domain-build | |
1462 | xen pv domain builder | |
1463 | --enable-debug-stack-usage | |
1464 | track the maximum stack usage of stacks created by qemu_alloc_stack | |
c23f23b9 MT |
1465 | |
1466 | Optional features, enabled with --enable-FEATURE and | |
1467 | disabled with --disable-FEATURE, default is enabled if available: | |
1468 | ||
1469 | system all system emulation targets | |
1470 | user supported user emulation targets | |
1471 | linux-user all linux usermode emulation targets | |
1472 | bsd-user all BSD usermode emulation targets | |
c23f23b9 MT |
1473 | docs build documentation |
1474 | guest-agent build the QEMU Guest Agent | |
1475 | guest-agent-msi build guest agent Windows MSI installation package | |
1476 | pie Position Independent Executables | |
1477 | modules modules support | |
1478 | debug-tcg TCG debugging (default is disabled) | |
1479 | debug-info debugging information | |
1480 | sparse sparse checker | |
1481 | ||
ddbb0d09 | 1482 | gnutls GNUTLS cryptography support |
91bfcdb0 DB |
1483 | nettle nettle cryptography support |
1484 | gcrypt libgcrypt cryptography support | |
c23f23b9 MT |
1485 | sdl SDL UI |
1486 | --with-sdlabi select preferred SDL ABI 1.2 or 2.0 | |
1487 | gtk gtk UI | |
1488 | --with-gtkabi select preferred GTK ABI 2.0 or 3.0 | |
1489 | vte vte support for the gtk UI | |
1490 | curses curses UI | |
1491 | vnc VNC UI support | |
c23f23b9 MT |
1492 | vnc-sasl SASL encryption for VNC server |
1493 | vnc-jpeg JPEG lossy compression for VNC server | |
1494 | vnc-png PNG compression for VNC server | |
c23f23b9 MT |
1495 | cocoa Cocoa UI (Mac OS X only) |
1496 | virtfs VirtFS | |
fe8fc5ae | 1497 | mpath Multipath persistent reservation passthrough |
c23f23b9 MT |
1498 | xen xen backend driver support |
1499 | xen-pci-passthrough | |
1500 | brlapi BrlAPI (Braile) | |
1501 | curl curl connectivity | |
1502 | fdt fdt device tree | |
1503 | bluez bluez stack connectivity | |
1504 | kvm KVM acceleration support | |
b0cb0a66 | 1505 | hax HAX acceleration support |
c23f23b9 | 1506 | rdma RDMA-based migration support |
c23f23b9 MT |
1507 | vde support for vde network |
1508 | netmap support for netmap network | |
1509 | linux-aio Linux AIO support | |
1510 | cap-ng libcap-ng support | |
1511 | attr attr and xattr support | |
1512 | vhost-net vhost-net acceleration support | |
1513 | spice spice | |
1514 | rbd rados block device (rbd) | |
1515 | libiscsi iscsi support | |
1516 | libnfs nfs support | |
7b02f544 | 1517 | smartcard smartcard support (libcacard) |
c23f23b9 | 1518 | libusb libusb (for usb passthrough) |
ed1701c6 | 1519 | live-block-migration Block migration in the main migration stream |
c23f23b9 MT |
1520 | usb-redir usb network redirection support |
1521 | lzo support of lzo compression library | |
1522 | snappy support of snappy compression library | |
1523 | bzip2 support of bzip2 compression library | |
1524 | (for reading bzip2-compressed dmg images) | |
1525 | seccomp seccomp support | |
1526 | coroutine-pool coroutine freelist (better performance) | |
1527 | glusterfs GlusterFS backend | |
c23f23b9 MT |
1528 | tpm TPM support |
1529 | libssh2 ssh block device support | |
c23f23b9 MT |
1530 | numa libnuma support |
1531 | tcmalloc tcmalloc support | |
7b01cb97 | 1532 | jemalloc jemalloc support |
a6b1d4c0 | 1533 | replication replication support |
c12d66aa LM |
1534 | vhost-vsock virtio sockets device support |
1535 | opengl opengl support | |
1536 | virglrenderer virgl rendering support | |
1537 | xfsctl xfsctl support | |
1538 | qom-cast-debug cast debugging support | |
1539 | tools build qemu-io, qemu-nbd and qemu-image tools | |
da92c3ff | 1540 | vxhs Veritas HyperScale vDisk backend support |
f0d92b56 | 1541 | crypto-afalg Linux AF_ALG crypto backend driver |
e6a74868 | 1542 | vhost-user vhost-user support |
08fb77ed SW |
1543 | |
1544 | NOTE: The object files are built at the place where configure is launched | |
af5db58e | 1545 | EOF |
2d2ad6d0 | 1546 | exit 0 |
af5db58e PB |
1547 | fi |
1548 | ||
c53eeaf7 SH |
1549 | if ! has $python; then |
1550 | error_exit "Python not found. Use --python=/path/to/python" | |
1551 | fi | |
1552 | ||
1553 | # Note that if the Python conditional here evaluates True we will exit | |
1554 | # with status 1 which is a shell 'false' value. | |
1555 | if ! $python -c 'import sys; sys.exit(sys.version_info < (2,6) or sys.version_info >= (3,))'; then | |
1556 | error_exit "Cannot use '$python', Python 2.6 or later is required." \ | |
1557 | "Note that Python 3 or later is not yet supported." \ | |
1558 | "Use --python=/path/to/python to specify a supported Python." | |
1559 | fi | |
1560 | ||
1561 | # Suppress writing compiled files | |
1562 | python="$python -B" | |
1563 | ||
359bc95d PM |
1564 | # Now we have handled --enable-tcg-interpreter and know we're not just |
1565 | # printing the help message, bail out if the host CPU isn't supported. | |
1566 | if test "$ARCH" = "unknown"; then | |
1567 | if test "$tcg_interpreter" = "yes" ; then | |
1568 | echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" | |
359bc95d | 1569 | else |
76ad07a4 | 1570 | error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" |
359bc95d PM |
1571 | fi |
1572 | fi | |
1573 | ||
9c83ffd8 PM |
1574 | # Consult white-list to determine whether to enable werror |
1575 | # by default. Only enable by default for git builds | |
9c83ffd8 PM |
1576 | if test -z "$werror" ; then |
1577 | if test -d "$source_path/.git" -a \ | |
e4650c81 | 1578 | \( "$linux" = "yes" -o "$mingw32" = "yes" \) ; then |
9c83ffd8 PM |
1579 | werror="yes" |
1580 | else | |
1581 | werror="no" | |
1582 | fi | |
1583 | fi | |
1584 | ||
8d05095c | 1585 | # check that the C compiler works. |
93b25869 | 1586 | write_c_skeleton; |
8d05095c PB |
1587 | if compile_object ; then |
1588 | : C compiler works ok | |
1589 | else | |
76ad07a4 | 1590 | error_exit "\"$cc\" either does not exist or does not work" |
8d05095c | 1591 | fi |
0ef74c74 PM |
1592 | if ! compile_prog ; then |
1593 | error_exit "\"$cc\" cannot build an executable (is your linker broken?)" | |
1594 | fi | |
8d05095c | 1595 | |
fb59dabd PM |
1596 | if test "$bogus_os" = "yes"; then |
1597 | # Now that we know that we're not printing the help and that | |
1598 | # the compiler works (so the results of the check_defines we used | |
1599 | # to identify the OS are reliable), if we didn't recognize the | |
1600 | # host OS we should stop now. | |
951fedfc | 1601 | error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" |
fb59dabd PM |
1602 | fi |
1603 | ||
8d05095c PB |
1604 | gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" |
1605 | gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" | |
ac7568bd | 1606 | gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" |
435405ac | 1607 | gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags" |
b98fcfd8 | 1608 | gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags" |
71429097 | 1609 | gcc_flags="-Wno-string-plus-int $gcc_flags" |
6ca026cb PM |
1610 | # Note that we do not add -Werror to gcc_flags here, because that would |
1611 | # enable it for all configure tests. If a configure test failed due | |
1612 | # to -Werror this would just silently disable some features, | |
1613 | # so it's too error prone. | |
93b25869 JS |
1614 | |
1615 | cc_has_warning_flag() { | |
1616 | write_c_skeleton; | |
1617 | ||
a1d29d6c PM |
1618 | # Use the positive sense of the flag when testing for -Wno-wombat |
1619 | # support (gcc will happily accept the -Wno- form of unknown | |
1620 | # warning options). | |
93b25869 JS |
1621 | optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')" |
1622 | compile_prog "-Werror $optflag" "" | |
1623 | } | |
1624 | ||
1625 | for flag in $gcc_flags; do | |
1626 | if cc_has_warning_flag $flag ; then | |
1627 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" | |
8d05095c PB |
1628 | fi |
1629 | done | |
1630 | ||
3b463a3f | 1631 | if test "$stack_protector" != "no"; then |
fccd35a0 RR |
1632 | cat > $TMPC << EOF |
1633 | int main(int argc, char *argv[]) | |
1634 | { | |
1635 | char arr[64], *p = arr, *c = argv[0]; | |
1636 | while (*c) { | |
1637 | *p++ = *c++; | |
1638 | } | |
1639 | return 0; | |
1640 | } | |
1641 | EOF | |
63678e17 | 1642 | gcc_flags="-fstack-protector-strong -fstack-protector-all" |
3b463a3f | 1643 | sp_on=0 |
63678e17 | 1644 | for flag in $gcc_flags; do |
590e5dd9 PM |
1645 | # We need to check both a compile and a link, since some compiler |
1646 | # setups fail only on a .c->.o compile and some only at link time | |
1647 | if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && | |
1648 | compile_prog "-Werror $flag" ""; then | |
63678e17 | 1649 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
3b463a3f | 1650 | sp_on=1 |
63678e17 SN |
1651 | break |
1652 | fi | |
1653 | done | |
3b463a3f MR |
1654 | if test "$stack_protector" = yes; then |
1655 | if test $sp_on = 0; then | |
1656 | error_exit "Stack protector not supported" | |
1657 | fi | |
1658 | fi | |
37746c5e MAL |
1659 | fi |
1660 | ||
cbdd1999 PB |
1661 | # Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and |
1662 | # large functions that use global variables. The bug is in all releases of | |
1663 | # GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in | |
1664 | # 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. | |
1665 | cat > $TMPC << EOF | |
1666 | #if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) | |
1667 | int main(void) { return 0; } | |
1668 | #else | |
1669 | #error No bug in this compiler. | |
1670 | #endif | |
1671 | EOF | |
1672 | if compile_prog "-Werror -fno-gcse" "" ; then | |
1673 | TRANSLATE_OPT_CFLAGS=-fno-gcse | |
1674 | fi | |
1675 | ||
40d6444e | 1676 | if test "$static" = "yes" ; then |
aa0d1f44 PB |
1677 | if test "$modules" = "yes" ; then |
1678 | error_exit "static and modules are mutually incompatible" | |
1679 | fi | |
40d6444e | 1680 | if test "$pie" = "yes" ; then |
76ad07a4 | 1681 | error_exit "static and pie are mutually incompatible" |
40d6444e AK |
1682 | else |
1683 | pie="no" | |
1684 | fi | |
1685 | fi | |
1686 | ||
768b7855 EC |
1687 | # Unconditional check for compiler __thread support |
1688 | cat > $TMPC << EOF | |
1689 | static __thread int tls_var; | |
1690 | int main(void) { return tls_var; } | |
1691 | EOF | |
1692 | ||
1693 | if ! compile_prog "-Werror" "" ; then | |
1694 | error_exit "Your compiler does not support the __thread specifier for " \ | |
1695 | "Thread-Local Storage (TLS). Please upgrade to a version that does." | |
1696 | fi | |
1697 | ||
40d6444e AK |
1698 | if test "$pie" = ""; then |
1699 | case "$cpu-$targetos" in | |
c72b26ec | 1700 | i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) |
40d6444e AK |
1701 | ;; |
1702 | *) | |
1703 | pie="no" | |
1704 | ;; | |
1705 | esac | |
1706 | fi | |
1707 | ||
1708 | if test "$pie" != "no" ; then | |
1709 | cat > $TMPC << EOF | |
21d4a791 AK |
1710 | |
1711 | #ifdef __linux__ | |
1712 | # define THREAD __thread | |
1713 | #else | |
1714 | # define THREAD | |
1715 | #endif | |
1716 | ||
1717 | static THREAD int tls_var; | |
1718 | ||
1719 | int main(void) { return tls_var; } | |
1720 | ||
40d6444e AK |
1721 | EOF |
1722 | if compile_prog "-fPIE -DPIE" "-pie"; then | |
1723 | QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" | |
1724 | LDFLAGS="-pie $LDFLAGS" | |
1725 | pie="yes" | |
1726 | if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then | |
1727 | LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" | |
1728 | fi | |
1729 | else | |
1730 | if test "$pie" = "yes"; then | |
76ad07a4 | 1731 | error_exit "PIE not available due to missing toolchain support" |
40d6444e AK |
1732 | else |
1733 | echo "Disabling PIE due to missing toolchain support" | |
1734 | pie="no" | |
1735 | fi | |
1736 | fi | |
46eef33b | 1737 | |
e4a7b344 | 1738 | if compile_prog "-Werror -fno-pie" "-nopie"; then |
46eef33b BS |
1739 | CFLAGS_NOPIE="-fno-pie" |
1740 | LDFLAGS_NOPIE="-nopie" | |
1741 | fi | |
40d6444e AK |
1742 | fi |
1743 | ||
09dada40 PB |
1744 | ########################################## |
1745 | # __sync_fetch_and_and requires at least -march=i486. Many toolchains | |
1746 | # use i686 as default anyway, but for those that don't, an explicit | |
1747 | # specification is necessary | |
1748 | ||
1749 | if test "$cpu" = "i386"; then | |
1750 | cat > $TMPC << EOF | |
1751 | static int sfaa(int *ptr) | |
1752 | { | |
1753 | return __sync_fetch_and_and(ptr, 0); | |
1754 | } | |
1755 | ||
1756 | int main(void) | |
1757 | { | |
1758 | int val = 42; | |
1405b629 | 1759 | val = __sync_val_compare_and_swap(&val, 0, 1); |
09dada40 PB |
1760 | sfaa(&val); |
1761 | return val; | |
1762 | } | |
1763 | EOF | |
1764 | if ! compile_prog "" "" ; then | |
1765 | QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" | |
1766 | fi | |
1767 | fi | |
1768 | ||
1769 | ######################################### | |
ec530c81 | 1770 | # Solaris specific configure tool chain decisions |
09dada40 | 1771 | |
ec530c81 | 1772 | if test "$solaris" = "yes" ; then |
6792aa11 LM |
1773 | if has $install; then |
1774 | : | |
1775 | else | |
76ad07a4 PM |
1776 | error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ |
1777 | "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ | |
1778 | "to get ginstall which is used by default (which lives in /opt/csw/bin)" | |
ec530c81 | 1779 | fi |
89138857 | 1780 | if test "$(path_of $install)" = "/usr/sbin/install" ; then |
76ad07a4 PM |
1781 | error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ |
1782 | "try ginstall from the GNU fileutils available from www.blastwave.org" \ | |
1783 | "using pkg-get -i fileutils, or use --install=/usr/ucb/install" | |
ec530c81 | 1784 | fi |
6792aa11 LM |
1785 | if has ar; then |
1786 | : | |
1787 | else | |
ec530c81 | 1788 | if test -f /usr/ccs/bin/ar ; then |
76ad07a4 PM |
1789 | error_exit "No path includes ar" \ |
1790 | "Add /usr/ccs/bin to your path and rerun configure" | |
ec530c81 | 1791 | fi |
76ad07a4 | 1792 | error_exit "No path includes ar" |
ec530c81 | 1793 | fi |
5fafdf24 | 1794 | fi |
ec530c81 | 1795 | |
afb63ebd | 1796 | if test -z "${target_list+xxx}" ; then |
d880a3ba PB |
1797 | for target in $default_target_list; do |
1798 | supported_target $target 2>/dev/null && \ | |
1799 | target_list="$target_list $target" | |
1800 | done | |
1801 | target_list="${target_list# }" | |
121afa9e | 1802 | else |
89138857 | 1803 | target_list=$(echo "$target_list" | sed -e 's/,/ /g') |
d880a3ba PB |
1804 | for target in $target_list; do |
1805 | # Check that we recognised the target name; this allows a more | |
1806 | # friendly error message than if we let it fall through. | |
1807 | case " $default_target_list " in | |
1808 | *" $target "*) | |
1809 | ;; | |
1810 | *) | |
1811 | error_exit "Unknown target name '$target'" | |
1812 | ;; | |
1813 | esac | |
1814 | supported_target $target || exit 1 | |
1815 | done | |
121afa9e | 1816 | fi |
25b48338 | 1817 | |
f55fe278 PB |
1818 | # see if system emulation was really requested |
1819 | case " $target_list " in | |
1820 | *"-softmmu "*) softmmu=yes | |
1821 | ;; | |
1822 | *) softmmu=no | |
1823 | ;; | |
1824 | esac | |
5327cf48 | 1825 | |
249247c9 JQ |
1826 | feature_not_found() { |
1827 | feature=$1 | |
21684af0 | 1828 | remedy=$2 |
249247c9 | 1829 | |
76ad07a4 | 1830 | error_exit "User requested feature $feature" \ |
21684af0 SS |
1831 | "configure was not able to find it." \ |
1832 | "$remedy" | |
249247c9 JQ |
1833 | } |
1834 | ||
7d13299d FB |
1835 | # --- |
1836 | # big/little endian test | |
1837 | cat > $TMPC << EOF | |
61cc919f MF |
1838 | short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; |
1839 | short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; | |
1840 | extern int foo(short *, short *); | |
1841 | int main(int argc, char *argv[]) { | |
1842 | return foo(big_endian, little_endian); | |
7d13299d FB |
1843 | } |
1844 | EOF | |
1845 | ||
61cc919f MF |
1846 | if compile_object ; then |
1847 | if grep -q BiGeNdIaN $TMPO ; then | |
1848 | bigendian="yes" | |
1849 | elif grep -q LiTtLeEnDiAn $TMPO ; then | |
1850 | bigendian="no" | |
1851 | else | |
1852 | echo big/little test failed | |
21d89f84 | 1853 | fi |
61cc919f MF |
1854 | else |
1855 | echo big/little test failed | |
7d13299d FB |
1856 | fi |
1857 | ||
a30878e7 PM |
1858 | ########################################## |
1859 | # cocoa implies not SDL or GTK | |
1860 | # (the cocoa UI code currently assumes it is always the active UI | |
1861 | # and doesn't interact well with other UI frontend code) | |
1862 | if test "$cocoa" = "yes"; then | |
1863 | if test "$sdl" = "yes"; then | |
1864 | error_exit "Cocoa and SDL UIs cannot both be enabled at once" | |
1865 | fi | |
1866 | if test "$gtk" = "yes"; then | |
1867 | error_exit "Cocoa and GTK UIs cannot both be enabled at once" | |
1868 | fi | |
1869 | gtk=no | |
1870 | sdl=no | |
1871 | fi | |
1872 | ||
6b39b063 EB |
1873 | # Some versions of Mac OS X incorrectly define SIZE_MAX |
1874 | cat > $TMPC << EOF | |
1875 | #include <stdint.h> | |
1876 | #include <stdio.h> | |
1877 | int main(int argc, char *argv[]) { | |
1878 | return printf("%zu", SIZE_MAX); | |
1879 | } | |
1880 | EOF | |
1881 | have_broken_size_max=no | |
1882 | if ! compile_object -Werror ; then | |
1883 | have_broken_size_max=yes | |
1884 | fi | |
1885 | ||
015a33bd GA |
1886 | ########################################## |
1887 | # L2TPV3 probe | |
1888 | ||
1889 | cat > $TMPC <<EOF | |
1890 | #include <sys/socket.h> | |
bff6cb72 | 1891 | #include <linux/ip.h> |
015a33bd GA |
1892 | int main(void) { return sizeof(struct mmsghdr); } |
1893 | EOF | |
1894 | if compile_prog "" "" ; then | |
1895 | l2tpv3=yes | |
1896 | else | |
1897 | l2tpv3=no | |
1898 | fi | |
1899 | ||
4d9310f4 DB |
1900 | ########################################## |
1901 | # MinGW / Mingw-w64 localtime_r/gmtime_r check | |
1902 | ||
1903 | if test "$mingw32" = "yes"; then | |
1904 | # Some versions of MinGW / Mingw-w64 lack localtime_r | |
1905 | # and gmtime_r entirely. | |
1906 | # | |
1907 | # Some versions of Mingw-w64 define a macro for | |
1908 | # localtime_r/gmtime_r. | |
1909 | # | |
1910 | # Some versions of Mingw-w64 will define functions | |
1911 | # for localtime_r/gmtime_r, but only if you have | |
1912 | # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun | |
1913 | # though, unistd.h and pthread.h both define | |
1914 | # that for you. | |
1915 | # | |
1916 | # So this #undef localtime_r and #include <unistd.h> | |
1917 | # are not in fact redundant. | |
1918 | cat > $TMPC << EOF | |
1919 | #include <unistd.h> | |
1920 | #include <time.h> | |
1921 | #undef localtime_r | |
1922 | int main(void) { localtime_r(NULL, NULL); return 0; } | |
1923 | EOF | |
1924 | if compile_prog "" "" ; then | |
1925 | localtime_r="yes" | |
1926 | else | |
1927 | localtime_r="no" | |
1928 | fi | |
1929 | fi | |
1930 | ||
779ab5e3 SW |
1931 | ########################################## |
1932 | # pkg-config probe | |
1933 | ||
1934 | if ! has "$pkg_config_exe"; then | |
76ad07a4 | 1935 | error_exit "pkg-config binary '$pkg_config_exe' not found" |
779ab5e3 SW |
1936 | fi |
1937 | ||
b0a47e79 JQ |
1938 | ########################################## |
1939 | # NPTL probe | |
1940 | ||
24cb36a6 | 1941 | if test "$linux_user" = "yes"; then |
b0a47e79 | 1942 | cat > $TMPC <<EOF |
bd0c5661 | 1943 | #include <sched.h> |
30813cea | 1944 | #include <linux/futex.h> |
182eacc0 | 1945 | int main(void) { |
bd0c5661 PB |
1946 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
1947 | #error bork | |
1948 | #endif | |
182eacc0 | 1949 | return 0; |
bd0c5661 PB |
1950 | } |
1951 | EOF | |
24cb36a6 | 1952 | if ! compile_object ; then |
21684af0 | 1953 | feature_not_found "nptl" "Install glibc and linux kernel headers." |
b0a47e79 | 1954 | fi |
bd0c5661 PB |
1955 | fi |
1956 | ||
99f2dbd3 | 1957 | ######################################### |
ac62922e AZ |
1958 | # zlib check |
1959 | ||
1ece9905 AL |
1960 | if test "$zlib" != "no" ; then |
1961 | cat > $TMPC << EOF | |
ac62922e AZ |
1962 | #include <zlib.h> |
1963 | int main(void) { zlibVersion(); return 0; } | |
1964 | EOF | |
1ece9905 AL |
1965 | if compile_prog "" "-lz" ; then |
1966 | : | |
1967 | else | |
76ad07a4 PM |
1968 | error_exit "zlib check failed" \ |
1969 | "Make sure to have the zlib libs and headers installed." | |
1ece9905 | 1970 | fi |
ac62922e | 1971 | fi |
eb0ecd5a | 1972 | LIBS="$LIBS -lz" |
ac62922e | 1973 | |
607dacd0 QN |
1974 | ########################################## |
1975 | # lzo check | |
1976 | ||
1977 | if test "$lzo" != "no" ; then | |
1978 | cat > $TMPC << EOF | |
1979 | #include <lzo/lzo1x.h> | |
1980 | int main(void) { lzo_version(); return 0; } | |
1981 | EOF | |
1982 | if compile_prog "" "-llzo2" ; then | |
b25c9dff SW |
1983 | libs_softmmu="$libs_softmmu -llzo2" |
1984 | lzo="yes" | |
607dacd0 | 1985 | else |
b25c9dff SW |
1986 | if test "$lzo" = "yes"; then |
1987 | feature_not_found "liblzo2" "Install liblzo2 devel" | |
1988 | fi | |
1989 | lzo="no" | |
607dacd0 | 1990 | fi |
607dacd0 QN |
1991 | fi |
1992 | ||
1993 | ########################################## | |
1994 | # snappy check | |
1995 | ||
1996 | if test "$snappy" != "no" ; then | |
1997 | cat > $TMPC << EOF | |
1998 | #include <snappy-c.h> | |
1999 | int main(void) { snappy_max_compressed_length(4096); return 0; } | |
2000 | EOF | |
2001 | if compile_prog "" "-lsnappy" ; then | |
b25c9dff SW |
2002 | libs_softmmu="$libs_softmmu -lsnappy" |
2003 | snappy="yes" | |
607dacd0 | 2004 | else |
b25c9dff SW |
2005 | if test "$snappy" = "yes"; then |
2006 | feature_not_found "libsnappy" "Install libsnappy devel" | |
2007 | fi | |
2008 | snappy="no" | |
607dacd0 | 2009 | fi |
607dacd0 QN |
2010 | fi |
2011 | ||
6b383c08 PW |
2012 | ########################################## |
2013 | # bzip2 check | |
2014 | ||
2015 | if test "$bzip2" != "no" ; then | |
2016 | cat > $TMPC << EOF | |
2017 | #include <bzlib.h> | |
2018 | int main(void) { BZ2_bzlibVersion(); return 0; } | |
2019 | EOF | |
2020 | if compile_prog "" "-lbz2" ; then | |
2021 | bzip2="yes" | |
2022 | else | |
2023 | if test "$bzip2" = "yes"; then | |
2024 | feature_not_found "libbzip2" "Install libbzip2 devel" | |
2025 | fi | |
2026 | bzip2="no" | |
2027 | fi | |
2028 | fi | |
2029 | ||
f794573e EO |
2030 | ########################################## |
2031 | # libseccomp check | |
2032 | ||
2033 | if test "$seccomp" != "no" ; then | |
693e5910 AJ |
2034 | case "$cpu" in |
2035 | i386|x86_64) | |
ba060c53 | 2036 | libseccomp_minver="2.1.0" |
693e5910 | 2037 | ;; |
5ce43972 JH |
2038 | mips) |
2039 | libseccomp_minver="2.2.0" | |
2040 | ;; | |
693e5910 AJ |
2041 | arm|aarch64) |
2042 | libseccomp_minver="2.2.3" | |
2043 | ;; | |
3aa35fcf | 2044 | ppc|ppc64|s390x) |
3e684455 MS |
2045 | libseccomp_minver="2.3.0" |
2046 | ;; | |
693e5910 AJ |
2047 | *) |
2048 | libseccomp_minver="" | |
2049 | ;; | |
2050 | esac | |
2051 | ||
2052 | if test "$libseccomp_minver" != "" && | |
2053 | $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then | |
c3883e1f FZ |
2054 | seccomp_cflags="$($pkg_config --cflags libseccomp)" |
2055 | seccomp_libs="$($pkg_config --libs libseccomp)" | |
693e5910 | 2056 | seccomp="yes" |
f794573e | 2057 | else |
693e5910 AJ |
2058 | if test "$seccomp" = "yes" ; then |
2059 | if test "$libseccomp_minver" != "" ; then | |
2060 | feature_not_found "libseccomp" \ | |
2061 | "Install libseccomp devel >= $libseccomp_minver" | |
2062 | else | |
2063 | feature_not_found "libseccomp" \ | |
2064 | "libseccomp is not supported for host cpu $cpu" | |
2065 | fi | |
2066 | fi | |
2067 | seccomp="no" | |
f794573e EO |
2068 | fi |
2069 | fi | |
e37630ca AL |
2070 | ########################################## |
2071 | # xen probe | |
2072 | ||
fc321b4b | 2073 | if test "$xen" != "no" ; then |
c1cdd9d5 JG |
2074 | # Check whether Xen library path is specified via --extra-ldflags to avoid |
2075 | # overriding this setting with pkg-config output. If not, try pkg-config | |
2076 | # to obtain all needed flags. | |
2077 | ||
2078 | if ! echo $EXTRA_LDFLAGS | grep tools/libxc > /dev/null && \ | |
2079 | $pkg_config --exists xencontrol ; then | |
2080 | xen_ctrl_version="$(printf '%d%02d%02d' \ | |
2081 | $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" | |
2082 | xen=yes | |
2083 | xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab" | |
2084 | xen_pc="$xen_pc xenevtchn xendevicemodel" | |
2085 | QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" | |
2086 | libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu" | |
2087 | LDFLAGS="$($pkg_config --libs $xen_pc) $LDFLAGS" | |
2088 | else | |
d5b93ddf | 2089 | |
c1cdd9d5 | 2090 | xen_libs="-lxenstore -lxenctrl -lxenguest" |
d9506cab | 2091 | xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn" |
50ced5b3 | 2092 | |
c1cdd9d5 JG |
2093 | # First we test whether Xen headers and libraries are available. |
2094 | # If no, we are done and there is no Xen support. | |
2095 | # If yes, more tests are run to detect the Xen version. | |
2096 | ||
2097 | # Xen (any) | |
2098 | cat > $TMPC <<EOF | |
e37630ca | 2099 | #include <xenctrl.h> |
50ced5b3 SW |
2100 | int main(void) { |
2101 | return 0; | |
2102 | } | |
2103 | EOF | |
c1cdd9d5 JG |
2104 | if ! compile_prog "" "$xen_libs" ; then |
2105 | # Xen not found | |
2106 | if test "$xen" = "yes" ; then | |
2107 | feature_not_found "xen" "Install xen devel" | |
2108 | fi | |
2109 | xen=no | |
50ced5b3 | 2110 | |
c1cdd9d5 JG |
2111 | # Xen unstable |
2112 | elif | |
2113 | cat > $TMPC <<EOF && | |
5ba3d756 ID |
2114 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
2115 | #include <xenforeignmemory.h> | |
2116 | int main(void) { | |
2117 | xenforeignmemory_handle *xfmem; | |
2118 | ||
2119 | xfmem = xenforeignmemory_open(0, 0); | |
2120 | xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0); | |
2121 | ||
2122 | return 0; | |
2123 | } | |
2124 | EOF | |
2125 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs" | |
2126 | then | |
2127 | xen_stable_libs="-lxendevicemodel $xen_stable_libs" | |
2128 | xen_ctrl_version=41000 | |
2129 | xen=yes | |
2130 | elif | |
2131 | cat > $TMPC <<EOF && | |
da8090cc PD |
2132 | #undef XC_WANT_COMPAT_DEVICEMODEL_API |
2133 | #define __XEN_TOOLS__ | |
2134 | #include <xendevicemodel.h> | |
2135 | int main(void) { | |
2136 | xendevicemodel_handle *xd; | |
2137 | ||
2138 | xd = xendevicemodel_open(0, 0); | |
2139 | xendevicemodel_close(xd); | |
50ced5b3 | 2140 | |
da8090cc PD |
2141 | return 0; |
2142 | } | |
2143 | EOF | |
c1cdd9d5 JG |
2144 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs" |
2145 | then | |
2146 | xen_stable_libs="-lxendevicemodel $xen_stable_libs" | |
2147 | xen_ctrl_version=40900 | |
2148 | xen=yes | |
2149 | elif | |
2150 | cat > $TMPC <<EOF && | |
b6eb9b45 PS |
2151 | /* |
2152 | * If we have stable libs the we don't want the libxc compat | |
2153 | * layers, regardless of what CFLAGS we may have been given. | |
2154 | * | |
2155 | * Also, check if xengnttab_grant_copy_segment_t is defined and | |
2156 | * grant copy operation is implemented. | |
2157 | */ | |
2158 | #undef XC_WANT_COMPAT_EVTCHN_API | |
2159 | #undef XC_WANT_COMPAT_GNTTAB_API | |
2160 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API | |
2161 | #include <xenctrl.h> | |
2162 | #include <xenstore.h> | |
2163 | #include <xenevtchn.h> | |
2164 | #include <xengnttab.h> | |
2165 | #include <xenforeignmemory.h> | |
2166 | #include <stdint.h> | |
2167 | #include <xen/hvm/hvm_info_table.h> | |
2168 | #if !defined(HVM_MAX_VCPUS) | |
2169 | # error HVM_MAX_VCPUS not defined | |
2170 | #endif | |
2171 | int main(void) { | |
2172 | xc_interface *xc = NULL; | |
2173 | xenforeignmemory_handle *xfmem; | |
2174 | xenevtchn_handle *xe; | |
2175 | xengnttab_handle *xg; | |
2176 | xen_domain_handle_t handle; | |
2177 | xengnttab_grant_copy_segment_t* seg = NULL; | |
2178 | ||
2179 | xs_daemon_open(); | |
2180 | ||
2181 | xc = xc_interface_open(0, 0, 0); | |
2182 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
2183 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
2184 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
2185 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); | |
2186 | xc_domain_create(xc, 0, handle, 0, NULL, NULL); | |
2187 | ||
2188 | xfmem = xenforeignmemory_open(0, 0); | |
2189 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); | |
2190 | ||
2191 | xe = xenevtchn_open(0, 0); | |
2192 | xenevtchn_fd(xe); | |
2193 | ||
2194 | xg = xengnttab_open(0, 0); | |
2195 | xengnttab_grant_copy(xg, 0, seg); | |
2196 | ||
2197 | return 0; | |
2198 | } | |
2199 | EOF | |
c1cdd9d5 JG |
2200 | compile_prog "" "$xen_libs $xen_stable_libs" |
2201 | then | |
2202 | xen_ctrl_version=40800 | |
2203 | xen=yes | |
2204 | elif | |
2205 | cat > $TMPC <<EOF && | |
5eeb39c2 IC |
2206 | /* |
2207 | * If we have stable libs the we don't want the libxc compat | |
2208 | * layers, regardless of what CFLAGS we may have been given. | |
2209 | */ | |
2210 | #undef XC_WANT_COMPAT_EVTCHN_API | |
2211 | #undef XC_WANT_COMPAT_GNTTAB_API | |
2212 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API | |
2213 | #include <xenctrl.h> | |
2214 | #include <xenstore.h> | |
2215 | #include <xenevtchn.h> | |
2216 | #include <xengnttab.h> | |
2217 | #include <xenforeignmemory.h> | |
2218 | #include <stdint.h> | |
2219 | #include <xen/hvm/hvm_info_table.h> | |
2220 | #if !defined(HVM_MAX_VCPUS) | |
2221 | # error HVM_MAX_VCPUS not defined | |
2222 | #endif | |
2223 | int main(void) { | |
2224 | xc_interface *xc = NULL; | |
2225 | xenforeignmemory_handle *xfmem; | |
2226 | xenevtchn_handle *xe; | |
2227 | xengnttab_handle *xg; | |
2228 | xen_domain_handle_t handle; | |
2229 | ||
2230 | xs_daemon_open(); | |
2231 | ||
2232 | xc = xc_interface_open(0, 0, 0); | |
2233 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
2234 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
2235 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
2236 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); | |
2237 | xc_domain_create(xc, 0, handle, 0, NULL, NULL); | |
2238 | ||
2239 | xfmem = xenforeignmemory_open(0, 0); | |
2240 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); | |
2241 | ||
2242 | xe = xenevtchn_open(0, 0); | |
2243 | xenevtchn_fd(xe); | |
2244 | ||
2245 | xg = xengnttab_open(0, 0); | |
2246 | xengnttab_map_grant_ref(xg, 0, 0, 0); | |
2247 | ||
2248 | return 0; | |
2249 | } | |
2250 | EOF | |
c1cdd9d5 JG |
2251 | compile_prog "" "$xen_libs $xen_stable_libs" |
2252 | then | |
2253 | xen_ctrl_version=40701 | |
2254 | xen=yes | |
2255 | elif | |
2256 | cat > $TMPC <<EOF && | |
50ced5b3 | 2257 | #include <xenctrl.h> |
cdadde39 RPM |
2258 | #include <stdint.h> |
2259 | int main(void) { | |
2260 | xc_interface *xc = NULL; | |
2261 | xen_domain_handle_t handle; | |
2262 | xc_domain_create(xc, 0, handle, 0, NULL, NULL); | |
2263 | return 0; | |
2264 | } | |
2265 | EOF | |
c1cdd9d5 JG |
2266 | compile_prog "" "$xen_libs" |
2267 | then | |
2268 | xen_ctrl_version=40700 | |
2269 | xen=yes | |
2270 | ||
2271 | # Xen 4.6 | |
2272 | elif | |
2273 | cat > $TMPC <<EOF && | |
cdadde39 | 2274 | #include <xenctrl.h> |
e108a3c1 | 2275 | #include <xenstore.h> |
d5b93ddf AP |
2276 | #include <stdint.h> |
2277 | #include <xen/hvm/hvm_info_table.h> | |
2278 | #if !defined(HVM_MAX_VCPUS) | |
2279 | # error HVM_MAX_VCPUS not defined | |
2280 | #endif | |
d8b441a3 JB |
2281 | int main(void) { |
2282 | xc_interface *xc; | |
2283 | xs_daemon_open(); | |
2284 | xc = xc_interface_open(0, 0, 0); | |
2285 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
2286 | xc_gnttab_open(NULL, 0); | |
2287 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
2288 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
2289 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); | |
20a544c7 | 2290 | xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0); |
d8b441a3 JB |
2291 | return 0; |
2292 | } | |
2293 | EOF | |
c1cdd9d5 JG |
2294 | compile_prog "" "$xen_libs" |
2295 | then | |
2296 | xen_ctrl_version=40600 | |
2297 | xen=yes | |
2298 | ||
2299 | # Xen 4.5 | |
2300 | elif | |
2301 | cat > $TMPC <<EOF && | |
d8b441a3 JB |
2302 | #include <xenctrl.h> |
2303 | #include <xenstore.h> | |
2304 | #include <stdint.h> | |
2305 | #include <xen/hvm/hvm_info_table.h> | |
2306 | #if !defined(HVM_MAX_VCPUS) | |
2307 | # error HVM_MAX_VCPUS not defined | |
2308 | #endif | |
3996e85c PD |
2309 | int main(void) { |
2310 | xc_interface *xc; | |
2311 | xs_daemon_open(); | |
2312 | xc = xc_interface_open(0, 0, 0); | |
2313 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
2314 | xc_gnttab_open(NULL, 0); | |
2315 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
2316 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
2317 | xc_hvm_create_ioreq_server(xc, 0, 0, NULL); | |
2318 | return 0; | |
2319 | } | |
2320 | EOF | |
c1cdd9d5 JG |
2321 | compile_prog "" "$xen_libs" |
2322 | then | |
2323 | xen_ctrl_version=40500 | |
2324 | xen=yes | |
3996e85c | 2325 | |
c1cdd9d5 JG |
2326 | elif |
2327 | cat > $TMPC <<EOF && | |
3996e85c PD |
2328 | #include <xenctrl.h> |
2329 | #include <xenstore.h> | |
2330 | #include <stdint.h> | |
2331 | #include <xen/hvm/hvm_info_table.h> | |
2332 | #if !defined(HVM_MAX_VCPUS) | |
2333 | # error HVM_MAX_VCPUS not defined | |
2334 | #endif | |
8688e065 SS |
2335 | int main(void) { |
2336 | xc_interface *xc; | |
2337 | xs_daemon_open(); | |
2338 | xc = xc_interface_open(0, 0, 0); | |
2339 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); | |
2340 | xc_gnttab_open(NULL, 0); | |
2341 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); | |
2342 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); | |
2343 | return 0; | |
2344 | } | |
2345 | EOF | |
c1cdd9d5 JG |
2346 | compile_prog "" "$xen_libs" |
2347 | then | |
2348 | xen_ctrl_version=40200 | |
2349 | xen=yes | |
8688e065 | 2350 | |
c1cdd9d5 JG |
2351 | else |
2352 | if test "$xen" = "yes" ; then | |
2353 | feature_not_found "xen (unsupported version)" \ | |
2354 | "Install a supported xen (xen 4.2 or newer)" | |
2355 | fi | |
2356 | xen=no | |
fc321b4b | 2357 | fi |
d5b93ddf | 2358 | |
c1cdd9d5 JG |
2359 | if test "$xen" = yes; then |
2360 | if test $xen_ctrl_version -ge 40701 ; then | |
2361 | libs_softmmu="$xen_stable_libs $libs_softmmu" | |
2362 | fi | |
2363 | libs_softmmu="$xen_libs $libs_softmmu" | |
5eeb39c2 | 2364 | fi |
d5b93ddf | 2365 | fi |
e37630ca AL |
2366 | fi |
2367 | ||
eb6fda0f | 2368 | if test "$xen_pci_passthrough" != "no"; then |
edfb07ed | 2369 | if test "$xen" = "yes" && test "$linux" = "yes"; then |
eb6fda0f AP |
2370 | xen_pci_passthrough=yes |
2371 | else | |
2372 | if test "$xen_pci_passthrough" = "yes"; then | |
76ad07a4 PM |
2373 | error_exit "User requested feature Xen PCI Passthrough" \ |
2374 | " but this feature requires /sys from Linux" | |
eb6fda0f AP |
2375 | fi |
2376 | xen_pci_passthrough=no | |
2377 | fi | |
2378 | fi | |
2379 | ||
64a7ad6f IC |
2380 | if test "$xen_pv_domain_build" = "yes" && |
2381 | test "$xen" != "yes"; then | |
2382 | error_exit "User requested Xen PV domain builder support" \ | |
2383 | "which requires Xen support." | |
2384 | fi | |
2385 | ||
dfffc653 JQ |
2386 | ########################################## |
2387 | # Sparse probe | |
2388 | if test "$sparse" != "no" ; then | |
0dba6195 | 2389 | if has cgcc; then |
dfffc653 JQ |
2390 | sparse=yes |
2391 | else | |
2392 | if test "$sparse" = "yes" ; then | |
21684af0 | 2393 | feature_not_found "sparse" "Install sparse binary" |
dfffc653 JQ |
2394 | fi |
2395 | sparse=no | |
2396 | fi | |
2397 | fi | |
2398 | ||
f676c67e JW |
2399 | ########################################## |
2400 | # X11 probe | |
2401 | x11_cflags= | |
2402 | x11_libs=-lX11 | |
2403 | if $pkg_config --exists "x11"; then | |
89138857 SW |
2404 | x11_cflags=$($pkg_config --cflags x11) |
2405 | x11_libs=$($pkg_config --libs x11) | |
f676c67e JW |
2406 | fi |
2407 | ||
a4ccabcf AL |
2408 | ########################################## |
2409 | # GTK probe | |
2410 | ||
9e04c683 | 2411 | if test "$gtkabi" = ""; then |
5fe309ff GH |
2412 | # The GTK ABI was not specified explicitly, so try whether 3.0 is available. |
2413 | # Use 2.0 as a fallback if that is available. | |
2414 | if $pkg_config --exists "gtk+-3.0 >= 3.0.0"; then | |
9e04c683 | 2415 | gtkabi=3.0 |
5fe309ff | 2416 | elif $pkg_config --exists "gtk+-2.0 >= 2.18.0"; then |
9e04c683 | 2417 | gtkabi=2.0 |
5fe309ff GH |
2418 | else |
2419 | gtkabi=3.0 | |
9e04c683 SW |
2420 | fi |
2421 | fi | |
2422 | ||
a4ccabcf | 2423 | if test "$gtk" != "no"; then |
528de90a | 2424 | gtkpackage="gtk+-$gtkabi" |
0a337ed0 | 2425 | gtkx11package="gtk+-x11-$gtkabi" |
528de90a DB |
2426 | if test "$gtkabi" = "3.0" ; then |
2427 | gtkversion="3.0.0" | |
bbbf9bfb SW |
2428 | else |
2429 | gtkversion="2.18.0" | |
2430 | fi | |
2431 | if $pkg_config --exists "$gtkpackage >= $gtkversion"; then | |
89138857 SW |
2432 | gtk_cflags=$($pkg_config --cflags $gtkpackage) |
2433 | gtk_libs=$($pkg_config --libs $gtkpackage) | |
2434 | gtk_version=$($pkg_config --modversion $gtkpackage) | |
0a337ed0 | 2435 | if $pkg_config --exists "$gtkx11package >= $gtkversion"; then |
f676c67e JW |
2436 | gtk_cflags="$gtk_cflags $x11_cflags" |
2437 | gtk_libs="$gtk_libs $x11_libs" | |
0a337ed0 | 2438 | fi |
bbbf9bfb SW |
2439 | libs_softmmu="$gtk_libs $libs_softmmu" |
2440 | gtk="yes" | |
2441 | elif test "$gtk" = "yes"; then | |
5fe309ff | 2442 | feature_not_found "gtk" "Install gtk3-devel" |
bbbf9bfb SW |
2443 | else |
2444 | gtk="no" | |
2445 | fi | |
2446 | fi | |
2447 | ||
ddbb0d09 DB |
2448 | |
2449 | ########################################## | |
2450 | # GNUTLS probe | |
2451 | ||
37371299 PM |
2452 | gnutls_works() { |
2453 | # Unfortunately some distros have bad pkg-config information for gnutls | |
2454 | # such that it claims to exist but you get a compiler error if you try | |
2455 | # to use the options returned by --libs. Specifically, Ubuntu for --static | |
2456 | # builds doesn't work: | |
2457 | # https://bugs.launchpad.net/ubuntu/+source/gnutls26/+bug/1478035 | |
2458 | # | |
2459 | # So sanity check the cflags/libs before assuming gnutls can be used. | |
2460 | if ! $pkg_config --exists "gnutls"; then | |
2461 | return 1 | |
2462 | fi | |
2463 | ||
2464 | write_c_skeleton | |
2465 | compile_prog "$($pkg_config --cflags gnutls)" "$($pkg_config --libs gnutls)" | |
2466 | } | |
2467 | ||
62893b67 | 2468 | gnutls_gcrypt=no |
ed754746 | 2469 | gnutls_nettle=no |
ddbb0d09 | 2470 | if test "$gnutls" != "no"; then |
37371299 | 2471 | if gnutls_works; then |
89138857 SW |
2472 | gnutls_cflags=$($pkg_config --cflags gnutls) |
2473 | gnutls_libs=$($pkg_config --libs gnutls) | |
ddbb0d09 DB |
2474 | libs_softmmu="$gnutls_libs $libs_softmmu" |
2475 | libs_tools="$gnutls_libs $libs_tools" | |
2476 | QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags" | |
2477 | gnutls="yes" | |
2478 | ||
b917da4c DB |
2479 | # gnutls_rnd requires >= 2.11.0 |
2480 | if $pkg_config --exists "gnutls >= 2.11.0"; then | |
2481 | gnutls_rnd="yes" | |
2482 | else | |
2483 | gnutls_rnd="no" | |
2484 | fi | |
2485 | ||
62893b67 DB |
2486 | if $pkg_config --exists 'gnutls >= 3.0'; then |
2487 | gnutls_gcrypt=no | |
ed754746 | 2488 | gnutls_nettle=yes |
62893b67 | 2489 | elif $pkg_config --exists 'gnutls >= 2.12'; then |
89138857 | 2490 | case $($pkg_config --libs --static gnutls) in |
ed754746 DB |
2491 | *gcrypt*) |
2492 | gnutls_gcrypt=yes | |
2493 | gnutls_nettle=no | |
2494 | ;; | |
2495 | *nettle*) | |
2496 | gnutls_gcrypt=no | |
2497 | gnutls_nettle=yes | |
2498 | ;; | |
2499 | *) | |
2500 | gnutls_gcrypt=yes | |
2501 | gnutls_nettle=no | |
2502 | ;; | |
62893b67 DB |
2503 | esac |
2504 | else | |
2505 | gnutls_gcrypt=yes | |
ed754746 | 2506 | gnutls_nettle=no |
62893b67 | 2507 | fi |
ddbb0d09 DB |
2508 | elif test "$gnutls" = "yes"; then |
2509 | feature_not_found "gnutls" "Install gnutls devel" | |
2510 | else | |
2511 | gnutls="no" | |
b917da4c | 2512 | gnutls_rnd="no" |
ddbb0d09 DB |
2513 | fi |
2514 | else | |
b917da4c | 2515 | gnutls_rnd="no" |
ddbb0d09 DB |
2516 | fi |
2517 | ||
91bfcdb0 DB |
2518 | |
2519 | # If user didn't give a --disable/enable-gcrypt flag, | |
2520 | # then mark as disabled if user requested nettle | |
2521 | # explicitly, or if gnutls links to nettle | |
2522 | if test -z "$gcrypt" | |
2523 | then | |
2524 | if test "$nettle" = "yes" || test "$gnutls_nettle" = "yes" | |
2525 | then | |
2526 | gcrypt="no" | |
2527 | fi | |
2528 | fi | |
2529 | ||
2530 | # If user didn't give a --disable/enable-nettle flag, | |
2531 | # then mark as disabled if user requested gcrypt | |
2532 | # explicitly, or if gnutls links to gcrypt | |
2533 | if test -z "$nettle" | |
2534 | then | |
2535 | if test "$gcrypt" = "yes" || test "$gnutls_gcrypt" = "yes" | |
2536 | then | |
2537 | nettle="no" | |
2538 | fi | |
2539 | fi | |
2540 | ||
2541 | has_libgcrypt_config() { | |
2542 | if ! has "libgcrypt-config" | |
2543 | then | |
2544 | return 1 | |
2545 | fi | |
2546 | ||
2547 | if test -n "$cross_prefix" | |
2548 | then | |
89138857 | 2549 | host=$(libgcrypt-config --host) |
91bfcdb0 DB |
2550 | if test "$host-" != $cross_prefix |
2551 | then | |
2552 | return 1 | |
2553 | fi | |
2554 | fi | |
2555 | ||
2556 | return 0 | |
2557 | } | |
2558 | ||
2559 | if test "$gcrypt" != "no"; then | |
2560 | if has_libgcrypt_config; then | |
89138857 SW |
2561 | gcrypt_cflags=$(libgcrypt-config --cflags) |
2562 | gcrypt_libs=$(libgcrypt-config --libs) | |
91bfcdb0 DB |
2563 | # Debian has remove -lgpg-error from libgcrypt-config |
2564 | # as it "spreads unnecessary dependencies" which in | |
2565 | # turn breaks static builds... | |
2566 | if test "$static" = "yes" | |
2567 | then | |
2568 | gcrypt_libs="$gcrypt_libs -lgpg-error" | |
2569 | fi | |
62893b67 DB |
2570 | libs_softmmu="$gcrypt_libs $libs_softmmu" |
2571 | libs_tools="$gcrypt_libs $libs_tools" | |
2572 | QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" | |
91bfcdb0 DB |
2573 | gcrypt="yes" |
2574 | if test -z "$nettle"; then | |
2575 | nettle="no" | |
2576 | fi | |
37788f25 DB |
2577 | |
2578 | cat > $TMPC << EOF | |
2579 | #include <gcrypt.h> | |
2580 | int main(void) { | |
2581 | gcry_kdf_derive(NULL, 0, GCRY_KDF_PBKDF2, | |
2582 | GCRY_MD_SHA256, | |
2583 | NULL, 0, 0, 0, NULL); | |
2584 | return 0; | |
2585 | } | |
2586 | EOF | |
2587 | if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then | |
2588 | gcrypt_kdf=yes | |
2589 | fi | |
1f923c70 LM |
2590 | |
2591 | cat > $TMPC << EOF | |
2592 | #include <gcrypt.h> | |
2593 | int main(void) { | |
2594 | gcry_mac_hd_t handle; | |
2595 | gcry_mac_open(&handle, GCRY_MAC_HMAC_MD5, | |
2596 | GCRY_MAC_FLAG_SECURE, NULL); | |
2597 | return 0; | |
2598 | } | |
2599 | EOF | |
2600 | if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then | |
2601 | gcrypt_hmac=yes | |
2602 | fi | |
62893b67 | 2603 | else |
91bfcdb0 DB |
2604 | if test "$gcrypt" = "yes"; then |
2605 | feature_not_found "gcrypt" "Install gcrypt devel" | |
2606 | else | |
2607 | gcrypt="no" | |
2608 | fi | |
62893b67 DB |
2609 | fi |
2610 | fi | |
2611 | ||
ddbb0d09 | 2612 | |
91bfcdb0 | 2613 | if test "$nettle" != "no"; then |
ed754746 | 2614 | if $pkg_config --exists "nettle"; then |
89138857 SW |
2615 | nettle_cflags=$($pkg_config --cflags nettle) |
2616 | nettle_libs=$($pkg_config --libs nettle) | |
2617 | nettle_version=$($pkg_config --modversion nettle) | |
ed754746 DB |
2618 | libs_softmmu="$nettle_libs $libs_softmmu" |
2619 | libs_tools="$nettle_libs $libs_tools" | |
2620 | QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" | |
91bfcdb0 | 2621 | nettle="yes" |
fff2f982 DB |
2622 | |
2623 | cat > $TMPC << EOF | |
9e87a691 | 2624 | #include <stddef.h> |
fff2f982 DB |
2625 | #include <nettle/pbkdf2.h> |
2626 | int main(void) { | |
2627 | pbkdf2_hmac_sha256(8, NULL, 1000, 8, NULL, 8, NULL); | |
2628 | return 0; | |
2629 | } | |
2630 | EOF | |
2631 | if compile_prog "$nettle_cflags" "$nettle_libs" ; then | |
2632 | nettle_kdf=yes | |
2633 | fi | |
ed754746 | 2634 | else |
91bfcdb0 DB |
2635 | if test "$nettle" = "yes"; then |
2636 | feature_not_found "nettle" "Install nettle devel" | |
2637 | else | |
2638 | nettle="no" | |
2639 | fi | |
ed754746 DB |
2640 | fi |
2641 | fi | |
2642 | ||
91bfcdb0 DB |
2643 | if test "$gcrypt" = "yes" && test "$nettle" = "yes" |
2644 | then | |
2645 | error_exit "Only one of gcrypt & nettle can be enabled" | |
2646 | fi | |
2647 | ||
9a2fd434 DB |
2648 | ########################################## |
2649 | # libtasn1 - only for the TLS creds/session test suite | |
2650 | ||
2651 | tasn1=yes | |
90246037 DB |
2652 | tasn1_cflags="" |
2653 | tasn1_libs="" | |
9a2fd434 | 2654 | if $pkg_config --exists "libtasn1"; then |
89138857 SW |
2655 | tasn1_cflags=$($pkg_config --cflags libtasn1) |
2656 | tasn1_libs=$($pkg_config --libs libtasn1) | |
9a2fd434 DB |
2657 | else |
2658 | tasn1=no | |
2659 | fi | |
2660 | ||
ed754746 | 2661 | |
559607ea DB |
2662 | ########################################## |
2663 | # getifaddrs (for tests/test-io-channel-socket ) | |
2664 | ||
2665 | have_ifaddrs_h=yes | |
2666 | if ! check_include "ifaddrs.h" ; then | |
2667 | have_ifaddrs_h=no | |
2668 | fi | |
2669 | ||
bbbf9bfb SW |
2670 | ########################################## |
2671 | # VTE probe | |
2672 | ||
2673 | if test "$vte" != "no"; then | |
2674 | if test "$gtkabi" = "3.0"; then | |
c6feff9e CR |
2675 | vteminversion="0.32.0" |
2676 | if $pkg_config --exists "vte-2.91"; then | |
2677 | vtepackage="vte-2.91" | |
2678 | else | |
2679 | vtepackage="vte-2.90" | |
2680 | fi | |
528de90a | 2681 | else |
528de90a | 2682 | vtepackage="vte" |
c6feff9e | 2683 | vteminversion="0.24.0" |
528de90a | 2684 | fi |
c6feff9e | 2685 | if $pkg_config --exists "$vtepackage >= $vteminversion"; then |
89138857 SW |
2686 | vte_cflags=$($pkg_config --cflags $vtepackage) |
2687 | vte_libs=$($pkg_config --libs $vtepackage) | |
2688 | vteversion=$($pkg_config --modversion $vtepackage) | |
bbbf9bfb SW |
2689 | libs_softmmu="$vte_libs $libs_softmmu" |
2690 | vte="yes" | |
2691 | elif test "$vte" = "yes"; then | |
9e04c683 | 2692 | if test "$gtkabi" = "3.0"; then |
c6feff9e | 2693 | feature_not_found "vte" "Install libvte-2.90/2.91 devel" |
9e04c683 SW |
2694 | else |
2695 | feature_not_found "vte" "Install libvte devel" | |
2696 | fi | |
0d185e63 | 2697 | else |
bbbf9bfb | 2698 | vte="no" |
a4ccabcf AL |
2699 | fi |
2700 | fi | |
2701 | ||
11d9f695 FB |
2702 | ########################################## |
2703 | # SDL probe | |
2704 | ||
3ec87ffe PB |
2705 | # Look for sdl configuration program (pkg-config or sdl-config). Try |
2706 | # sdl-config even without cross prefix, and favour pkg-config over sdl-config. | |
47c03744 | 2707 | |
ee8466d0 | 2708 | if test "$sdlabi" = ""; then |
8f4ea9cd | 2709 | if $pkg_config --exists "sdl2"; then |
ee8466d0 | 2710 | sdlabi=2.0 |
8f4ea9cd | 2711 | elif $pkg_config --exists "sdl"; then |
ee8466d0 | 2712 | sdlabi=1.2 |
8f4ea9cd GH |
2713 | else |
2714 | sdlabi=2.0 | |
ee8466d0 CR |
2715 | fi |
2716 | fi | |
2717 | ||
47c03744 DA |
2718 | if test $sdlabi = "2.0"; then |
2719 | sdl_config=$sdl2_config | |
2720 | sdlname=sdl2 | |
2721 | sdlconfigname=sdl2_config | |
e07047cf | 2722 | elif test $sdlabi = "1.2"; then |
47c03744 DA |
2723 | sdlname=sdl |
2724 | sdlconfigname=sdl_config | |
e07047cf CR |
2725 | else |
2726 | error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" | |
47c03744 DA |
2727 | fi |
2728 | ||
89138857 | 2729 | if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then |
47c03744 | 2730 | sdl_config=$sdlconfigname |
3ec87ffe PB |
2731 | fi |
2732 | ||
47c03744 DA |
2733 | if $pkg_config $sdlname --exists; then |
2734 | sdlconfig="$pkg_config $sdlname" | |
89138857 | 2735 | sdlversion=$($sdlconfig --modversion 2>/dev/null) |
3ec87ffe PB |
2736 | elif has ${sdl_config}; then |
2737 | sdlconfig="$sdl_config" | |
89138857 | 2738 | sdlversion=$($sdlconfig --version) |
a0dfd8a4 LM |
2739 | else |
2740 | if test "$sdl" = "yes" ; then | |
8f4ea9cd | 2741 | feature_not_found "sdl" "Install SDL2-devel" |
a0dfd8a4 LM |
2742 | fi |
2743 | sdl=no | |
9316f803 | 2744 | fi |
29e5bada | 2745 | if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then |
3ec87ffe PB |
2746 | echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 |
2747 | fi | |
11d9f695 | 2748 | |
9316f803 | 2749 | sdl_too_old=no |
c4198157 | 2750 | if test "$sdl" != "no" ; then |
ac119f9d | 2751 | cat > $TMPC << EOF |
11d9f695 FB |
2752 | #include <SDL.h> |
2753 | #undef main /* We don't want SDL to override our main() */ | |
2754 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
2755 | EOF | |
89138857 | 2756 | sdl_cflags=$($sdlconfig --cflags 2>/dev/null) |
74f42e18 | 2757 | if test "$static" = "yes" ; then |
5f37e6d4 TH |
2758 | if $pkg_config $sdlname --exists; then |
2759 | sdl_libs=$($pkg_config $sdlname --static --libs 2>/dev/null) | |
2760 | else | |
2761 | sdl_libs=$($sdlconfig --static-libs 2>/dev/null) | |
2762 | fi | |
74f42e18 | 2763 | else |
89138857 | 2764 | sdl_libs=$($sdlconfig --libs 2>/dev/null) |
74f42e18 | 2765 | fi |
52166aa0 | 2766 | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
89138857 | 2767 | if test $(echo $sdlversion | sed 's/[^0-9]//g') -lt 121 ; then |
ac119f9d JQ |
2768 | sdl_too_old=yes |
2769 | else | |
a30878e7 | 2770 | sdl=yes |
ac119f9d | 2771 | fi |
cd01b4a3 | 2772 | |
67c274d3 | 2773 | # static link with sdl ? (note: sdl.pc's --static --libs is broken) |
ac119f9d | 2774 | if test "$sdl" = "yes" -a "$static" = "yes" ; then |
67c274d3 | 2775 | if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then |
89138857 SW |
2776 | sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)" |
2777 | sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)" | |
ac119f9d | 2778 | fi |
52166aa0 | 2779 | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
ac119f9d JQ |
2780 | : |
2781 | else | |
2782 | sdl=no | |
2783 | fi | |
2784 | fi # static link | |
c4198157 JQ |
2785 | else # sdl not found |
2786 | if test "$sdl" = "yes" ; then | |
21684af0 | 2787 | feature_not_found "sdl" "Install SDL devel" |
c4198157 JQ |
2788 | fi |
2789 | sdl=no | |
ac119f9d | 2790 | fi # sdl compile test |
a68551bc | 2791 | fi |
11d9f695 | 2792 | |
5368a422 | 2793 | if test "$sdl" = "yes" ; then |
ac119f9d | 2794 | cat > $TMPC <<EOF |
5368a422 AL |
2795 | #include <SDL.h> |
2796 | #if defined(SDL_VIDEO_DRIVER_X11) | |
2797 | #include <X11/XKBlib.h> | |
2798 | #else | |
2799 | #error No x11 support | |
2800 | #endif | |
2801 | int main(void) { return 0; } | |
2802 | EOF | |
f676c67e JW |
2803 | if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then |
2804 | sdl_cflags="$sdl_cflags $x11_cflags" | |
2805 | sdl_libs="$sdl_libs $x11_libs" | |
ac119f9d | 2806 | fi |
5368a422 AL |
2807 | fi |
2808 | ||
2da776db MH |
2809 | ########################################## |
2810 | # RDMA needs OpenFabrics libraries | |
2811 | if test "$rdma" != "no" ; then | |
2812 | cat > $TMPC <<EOF | |
2813 | #include <rdma/rdma_cma.h> | |
2814 | int main(void) { return 0; } | |
2815 | EOF | |
2816 | rdma_libs="-lrdmacm -libverbs" | |
2817 | if compile_prog "" "$rdma_libs" ; then | |
2818 | rdma="yes" | |
2da776db MH |
2819 | else |
2820 | if test "$rdma" = "yes" ; then | |
2821 | error_exit \ | |
2822 | " OpenFabrics librdmacm/libibverbs not present." \ | |
2823 | " Your options:" \ | |
2824 | " (1) Fast: Install infiniband packages from your distro." \ | |
2825 | " (2) Cleanest: Install libraries from www.openfabrics.org" \ | |
2826 | " (3) Also: Install softiwarp if you don't have RDMA hardware" | |
2827 | fi | |
2828 | rdma="no" | |
2829 | fi | |
2830 | fi | |
2831 | ||
95c6bff3 | 2832 | |
2f9606b3 AL |
2833 | ########################################## |
2834 | # VNC SASL detection | |
821601ea | 2835 | if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then |
ea784e3b | 2836 | cat > $TMPC <<EOF |
2f9606b3 AL |
2837 | #include <sasl/sasl.h> |
2838 | #include <stdio.h> | |
2839 | int main(void) { sasl_server_init(NULL, "qemu"); return 0; } | |
2840 | EOF | |
ea784e3b JQ |
2841 | # Assuming Cyrus-SASL installed in /usr prefix |
2842 | vnc_sasl_cflags="" | |
2843 | vnc_sasl_libs="-lsasl2" | |
2844 | if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then | |
2845 | vnc_sasl=yes | |
2846 | libs_softmmu="$vnc_sasl_libs $libs_softmmu" | |
ca273d58 | 2847 | QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" |
ea784e3b JQ |
2848 | else |
2849 | if test "$vnc_sasl" = "yes" ; then | |
21684af0 | 2850 | feature_not_found "vnc-sasl" "Install Cyrus SASL devel" |
2f9606b3 | 2851 | fi |
ea784e3b JQ |
2852 | vnc_sasl=no |
2853 | fi | |
2f9606b3 AL |
2854 | fi |
2855 | ||
2f6f5c7a CC |
2856 | ########################################## |
2857 | # VNC JPEG detection | |
821601ea | 2858 | if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then |
2f6f5c7a CC |
2859 | cat > $TMPC <<EOF |
2860 | #include <stdio.h> | |
2861 | #include <jpeglib.h> | |
2862 | int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } | |
2863 | EOF | |
2864 | vnc_jpeg_cflags="" | |
2865 | vnc_jpeg_libs="-ljpeg" | |
2866 | if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then | |
2867 | vnc_jpeg=yes | |
2868 | libs_softmmu="$vnc_jpeg_libs $libs_softmmu" | |
ca273d58 | 2869 | QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" |
2f6f5c7a CC |
2870 | else |
2871 | if test "$vnc_jpeg" = "yes" ; then | |
21684af0 | 2872 | feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" |
2f6f5c7a CC |
2873 | fi |
2874 | vnc_jpeg=no | |
2875 | fi | |
2876 | fi | |
2877 | ||
efe556ad CC |
2878 | ########################################## |
2879 | # VNC PNG detection | |
821601ea | 2880 | if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then |
efe556ad CC |
2881 | cat > $TMPC <<EOF |
2882 | //#include <stdio.h> | |
2883 | #include <png.h> | |
832ce9c2 | 2884 | #include <stddef.h> |
efe556ad CC |
2885 | int main(void) { |
2886 | png_structp png_ptr; | |
2887 | png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); | |
7edc3fed | 2888 | return png_ptr != 0; |
efe556ad CC |
2889 | } |
2890 | EOF | |
65d5d3f9 | 2891 | if $pkg_config libpng --exists; then |
89138857 SW |
2892 | vnc_png_cflags=$($pkg_config libpng --cflags) |
2893 | vnc_png_libs=$($pkg_config libpng --libs) | |
9af8025e | 2894 | else |
efe556ad CC |
2895 | vnc_png_cflags="" |
2896 | vnc_png_libs="-lpng" | |
9af8025e | 2897 | fi |
efe556ad CC |
2898 | if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then |
2899 | vnc_png=yes | |
2900 | libs_softmmu="$vnc_png_libs $libs_softmmu" | |
9af8025e | 2901 | QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" |
efe556ad CC |
2902 | else |
2903 | if test "$vnc_png" = "yes" ; then | |
21684af0 | 2904 | feature_not_found "vnc-png" "Install libpng devel" |
efe556ad CC |
2905 | fi |
2906 | vnc_png=no | |
2907 | fi | |
2908 | fi | |
2909 | ||
76655d6d AL |
2910 | ########################################## |
2911 | # fnmatch() probe, used for ACL routines | |
2912 | fnmatch="no" | |
2913 | cat > $TMPC << EOF | |
2914 | #include <fnmatch.h> | |
2915 | int main(void) | |
2916 | { | |
2917 | fnmatch("foo", "foo", 0); | |
2918 | return 0; | |
2919 | } | |
2920 | EOF | |
52166aa0 | 2921 | if compile_prog "" "" ; then |
76655d6d AL |
2922 | fnmatch="yes" |
2923 | fi | |
2924 | ||
ee682d27 | 2925 | ########################################## |
c1bb86cd | 2926 | # xfsctl() probe, used for file-posix.c |
dce512de CH |
2927 | if test "$xfs" != "no" ; then |
2928 | cat > $TMPC << EOF | |
ffc41d10 | 2929 | #include <stddef.h> /* NULL */ |
dce512de CH |
2930 | #include <xfs/xfs.h> |
2931 | int main(void) | |
2932 | { | |
2933 | xfsctl(NULL, 0, 0, NULL); | |
2934 | return 0; | |
2935 | } | |
2936 | EOF | |
2937 | if compile_prog "" "" ; then | |
2938 | xfs="yes" | |
2939 | else | |
2940 | if test "$xfs" = "yes" ; then | |
21684af0 | 2941 | feature_not_found "xfs" "Instal xfsprogs/xfslibs devel" |
dce512de CH |
2942 | fi |
2943 | xfs=no | |
2944 | fi | |
2945 | fi | |
2946 | ||
8a16d273 TS |
2947 | ########################################## |
2948 | # vde libraries probe | |
dfb278bd | 2949 | if test "$vde" != "no" ; then |
4baae0ac | 2950 | vde_libs="-lvdeplug" |
8a16d273 TS |
2951 | cat > $TMPC << EOF |
2952 | #include <libvdeplug.h> | |
4a7f0e06 PB |
2953 | int main(void) |
2954 | { | |
2955 | struct vde_open_args a = {0, 0, 0}; | |
fea08e08 PM |
2956 | char s[] = ""; |
2957 | vde_open(s, s, &a); | |
4a7f0e06 PB |
2958 | return 0; |
2959 | } | |
8a16d273 | 2960 | EOF |
52166aa0 | 2961 | if compile_prog "" "$vde_libs" ; then |
4baae0ac | 2962 | vde=yes |
dfb278bd JQ |
2963 | else |
2964 | if test "$vde" = "yes" ; then | |
21684af0 | 2965 | feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" |
dfb278bd JQ |
2966 | fi |
2967 | vde=no | |
4baae0ac | 2968 | fi |
8a16d273 TS |
2969 | fi |
2970 | ||
58952137 | 2971 | ########################################## |
0a985b37 VM |
2972 | # netmap support probe |
2973 | # Apart from looking for netmap headers, we make sure that the host API version | |
2974 | # supports the netmap backend (>=11). The upper bound (15) is meant to simulate | |
2975 | # a minor/major version number. Minor new features will be marked with values up | |
2976 | # to 15, and if something happens that requires a change to the backend we will | |
2977 | # move above 15, submit the backend fixes and modify this two bounds. | |
58952137 VM |
2978 | if test "$netmap" != "no" ; then |
2979 | cat > $TMPC << EOF | |
2980 | #include <inttypes.h> | |
2981 | #include <net/if.h> | |
2982 | #include <net/netmap.h> | |
2983 | #include <net/netmap_user.h> | |
0a985b37 VM |
2984 | #if (NETMAP_API < 11) || (NETMAP_API > 15) |
2985 | #error | |
2986 | #endif | |
58952137 VM |
2987 | int main(void) { return 0; } |
2988 | EOF | |
2989 | if compile_prog "" "" ; then | |
2990 | netmap=yes | |
2991 | else | |
2992 | if test "$netmap" = "yes" ; then | |
2993 | feature_not_found "netmap" | |
2994 | fi | |
2995 | netmap=no | |
2996 | fi | |
2997 | fi | |
2998 | ||
47e98658 CB |
2999 | ########################################## |
3000 | # libcap-ng library probe | |
3001 | if test "$cap_ng" != "no" ; then | |
3002 | cap_libs="-lcap-ng" | |
3003 | cat > $TMPC << EOF | |
3004 | #include <cap-ng.h> | |
3005 | int main(void) | |
3006 | { | |
3007 | capng_capability_to_name(CAPNG_EFFECTIVE); | |
3008 | return 0; | |
3009 | } | |
3010 | EOF | |
3011 | if compile_prog "" "$cap_libs" ; then | |
3012 | cap_ng=yes | |
3013 | libs_tools="$cap_libs $libs_tools" | |
3014 | else | |
3015 | if test "$cap_ng" = "yes" ; then | |
21684af0 | 3016 | feature_not_found "cap_ng" "Install libcap-ng devel" |
47e98658 CB |
3017 | fi |
3018 | cap_ng=no | |
3019 | fi | |
3020 | fi | |
3021 | ||
8f28f3fb | 3022 | ########################################## |
c2de5c91 | 3023 | # Sound support libraries probe |
8f28f3fb | 3024 | |
c2de5c91 | 3025 | audio_drv_probe() |
3026 | { | |
3027 | drv=$1 | |
3028 | hdr=$2 | |
3029 | lib=$3 | |
3030 | exp=$4 | |
3031 | cfl=$5 | |
3032 | cat > $TMPC << EOF | |
3033 | #include <$hdr> | |
3034 | int main(void) { $exp } | |
8f28f3fb | 3035 | EOF |
52166aa0 | 3036 | if compile_prog "$cfl" "$lib" ; then |
c2de5c91 | 3037 | : |
3038 | else | |
76ad07a4 PM |
3039 | error_exit "$drv check failed" \ |
3040 | "Make sure to have the $drv libs and headers installed." | |
c2de5c91 | 3041 | fi |
3042 | } | |
3043 | ||
89138857 | 3044 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g') |
c2de5c91 | 3045 | for drv in $audio_drv_list; do |
3046 | case $drv in | |
3047 | alsa) | |
3048 | audio_drv_probe $drv alsa/asoundlib.h -lasound \ | |
e35bcb0c | 3049 | "return snd_pcm_close((snd_pcm_t *)0);" |
b1149911 | 3050 | alsa_libs="-lasound" |
c2de5c91 | 3051 | ;; |
3052 | ||
b8e59f18 | 3053 | pa) |
e58ff62d PK |
3054 | audio_drv_probe $drv pulse/pulseaudio.h "-lpulse" \ |
3055 | "pa_context_set_source_output_volume(NULL, 0, NULL, NULL, NULL); return 0;" | |
b1149911 | 3056 | pulse_libs="-lpulse" |
67f86e8e | 3057 | audio_pt_int="yes" |
b8e59f18 | 3058 | ;; |
3059 | ||
373967b2 GH |
3060 | sdl) |
3061 | if test "$sdl" = "no"; then | |
3062 | error_exit "sdl not found or disabled, can not use sdl audio driver" | |
3063 | fi | |
3064 | ;; | |
3065 | ||
997e690a | 3066 | coreaudio) |
b1149911 | 3067 | coreaudio_libs="-framework CoreAudio" |
997e690a JQ |
3068 | ;; |
3069 | ||
a4bf6780 | 3070 | dsound) |
b1149911 | 3071 | dsound_libs="-lole32 -ldxguid" |
d5631638 | 3072 | audio_win_int="yes" |
a4bf6780 JQ |
3073 | ;; |
3074 | ||
3075 | oss) | |
b1149911 | 3076 | oss_libs="$oss_lib" |
a4bf6780 JQ |
3077 | ;; |
3078 | ||
373967b2 GH |
3079 | wav) |
3080 | # XXX: Probes for CoreAudio, DirectSound | |
2f6a1ab0 BS |
3081 | ;; |
3082 | ||
e4c63a6a | 3083 | *) |
1c9b2a52 | 3084 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
76ad07a4 PM |
3085 | error_exit "Unknown driver '$drv' selected" \ |
3086 | "Possible drivers are: $audio_possible_drivers" | |
e4c63a6a | 3087 | } |
3088 | ;; | |
c2de5c91 | 3089 | esac |
3090 | done | |
8f28f3fb | 3091 | |
2e4d9fb1 AJ |
3092 | ########################################## |
3093 | # BrlAPI probe | |
3094 | ||
4ffcedb6 | 3095 | if test "$brlapi" != "no" ; then |
eb82284f JQ |
3096 | brlapi_libs="-lbrlapi" |
3097 | cat > $TMPC << EOF | |
2e4d9fb1 | 3098 | #include <brlapi.h> |
832ce9c2 | 3099 | #include <stddef.h> |
2e4d9fb1 AJ |
3100 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
3101 | EOF | |
52166aa0 | 3102 | if compile_prog "" "$brlapi_libs" ; then |
eb82284f | 3103 | brlapi=yes |
4ffcedb6 JQ |
3104 | else |
3105 | if test "$brlapi" = "yes" ; then | |
21684af0 | 3106 | feature_not_found "brlapi" "Install brlapi devel" |
4ffcedb6 JQ |
3107 | fi |
3108 | brlapi=no | |
eb82284f JQ |
3109 | fi |
3110 | fi | |
2e4d9fb1 | 3111 | |
4d3b6f6e AZ |
3112 | ########################################## |
3113 | # curses probe | |
a3605bf6 MT |
3114 | if test "$curses" != "no" ; then |
3115 | if test "$mingw32" = "yes" ; then | |
8ddc5bf9 ST |
3116 | curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" |
3117 | curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses" | |
a3605bf6 | 3118 | else |
7c703002 | 3119 | curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:" |
8ddc5bf9 | 3120 | curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw" |
a3605bf6 | 3121 | fi |
c584a6d0 | 3122 | curses_found=no |
4d3b6f6e | 3123 | cat > $TMPC << EOF |
8ddc5bf9 | 3124 | #include <locale.h> |
4d3b6f6e | 3125 | #include <curses.h> |
8ddc5bf9 | 3126 | #include <wchar.h> |
ef9a2524 | 3127 | int main(void) { |
8ddc5bf9 ST |
3128 | wchar_t wch = L'w'; |
3129 | setlocale(LC_ALL, ""); | |
ef9a2524 | 3130 | resize_term(0, 0); |
8ddc5bf9 ST |
3131 | addwstr(L"wide chars\n"); |
3132 | addnwstr(&wch, 1); | |
7c703002 | 3133 | add_wch(WACS_DEGREE); |
271f37ab | 3134 | return 0; |
ef9a2524 | 3135 | } |
4d3b6f6e | 3136 | EOF |
ecbe251f | 3137 | IFS=: |
8ddc5bf9 | 3138 | for curses_inc in $curses_inc_list; do |
b01a4fd3 PM |
3139 | # Make sure we get the wide character prototypes |
3140 | curses_inc="-DNCURSES_WIDECHAR $curses_inc" | |
7c703002 | 3141 | IFS=: |
8ddc5bf9 ST |
3142 | for curses_lib in $curses_lib_list; do |
3143 | unset IFS | |
3144 | if compile_prog "$curses_inc" "$curses_lib" ; then | |
3145 | curses_found=yes | |
3146 | QEMU_CFLAGS="$curses_inc $QEMU_CFLAGS" | |
3147 | libs_softmmu="$curses_lib $libs_softmmu" | |
3148 | break | |
3149 | fi | |
3150 | done | |
7c703002 ST |
3151 | if test "$curses_found" = yes ; then |
3152 | break | |
3153 | fi | |
4f78ef9a | 3154 | done |
ecbe251f | 3155 | unset IFS |
c584a6d0 JQ |
3156 | if test "$curses_found" = "yes" ; then |
3157 | curses=yes | |
3158 | else | |
3159 | if test "$curses" = "yes" ; then | |
21684af0 | 3160 | feature_not_found "curses" "Install ncurses devel" |
c584a6d0 JQ |
3161 | fi |
3162 | curses=no | |
3163 | fi | |
4f78ef9a | 3164 | fi |
4d3b6f6e | 3165 | |
769ce76d AG |
3166 | ########################################## |
3167 | # curl probe | |
788c8196 | 3168 | if test "$curl" != "no" ; then |
65d5d3f9 | 3169 | if $pkg_config libcurl --exists; then |
a3605bf6 MT |
3170 | curlconfig="$pkg_config libcurl" |
3171 | else | |
3172 | curlconfig=curl-config | |
3173 | fi | |
769ce76d AG |
3174 | cat > $TMPC << EOF |
3175 | #include <curl/curl.h> | |
0b862ced | 3176 | int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } |
769ce76d | 3177 | EOF |
89138857 SW |
3178 | curl_cflags=$($curlconfig --cflags 2>/dev/null) |
3179 | curl_libs=$($curlconfig --libs 2>/dev/null) | |
b1d5a277 | 3180 | if compile_prog "$curl_cflags" "$curl_libs" ; then |
769ce76d | 3181 | curl=yes |
788c8196 JQ |
3182 | else |
3183 | if test "$curl" = "yes" ; then | |
21684af0 | 3184 | feature_not_found "curl" "Install libcurl devel" |
788c8196 JQ |
3185 | fi |
3186 | curl=no | |
769ce76d AG |
3187 | fi |
3188 | fi # test "$curl" | |
3189 | ||
fb599c9a AZ |
3190 | ########################################## |
3191 | # bluez support probe | |
a20a6f46 | 3192 | if test "$bluez" != "no" ; then |
e820e3f4 AZ |
3193 | cat > $TMPC << EOF |
3194 | #include <bluetooth/bluetooth.h> | |
3195 | int main(void) { return bt_error(0); } | |
3196 | EOF | |
89138857 SW |
3197 | bluez_cflags=$($pkg_config --cflags bluez 2>/dev/null) |
3198 | bluez_libs=$($pkg_config --libs bluez 2>/dev/null) | |
52166aa0 | 3199 | if compile_prog "$bluez_cflags" "$bluez_libs" ; then |
a20a6f46 | 3200 | bluez=yes |
e482d56a | 3201 | libs_softmmu="$bluez_libs $libs_softmmu" |
e820e3f4 | 3202 | else |
a20a6f46 | 3203 | if test "$bluez" = "yes" ; then |
21684af0 | 3204 | feature_not_found "bluez" "Install bluez-libs/libbluetooth devel" |
a20a6f46 | 3205 | fi |
e820e3f4 AZ |
3206 | bluez="no" |
3207 | fi | |
fb599c9a AZ |
3208 | fi |
3209 | ||
e18df141 AL |
3210 | ########################################## |
3211 | # glib support probe | |
a52d28af | 3212 | |
ad04d8cb PM |
3213 | if test "$mingw32" = yes; then |
3214 | glib_req_ver=2.30 | |
3215 | else | |
3216 | glib_req_ver=2.22 | |
3217 | fi | |
aa0d1f44 PB |
3218 | glib_modules=gthread-2.0 |
3219 | if test "$modules" = yes; then | |
3220 | glib_modules="$glib_modules gmodule-2.0" | |
3221 | fi | |
e26110cf | 3222 | |
4eaf7202 SJ |
3223 | # This workaround is required due to a bug in pkg-config file for glib as it |
3224 | # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static | |
3225 | ||
3226 | if test "$static" = yes -a "$mingw32" = yes; then | |
3227 | QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" | |
3228 | fi | |
3229 | ||
aa0d1f44 | 3230 | for i in $glib_modules; do |
e26110cf | 3231 | if $pkg_config --atleast-version=$glib_req_ver $i; then |
89138857 SW |
3232 | glib_cflags=$($pkg_config --cflags $i) |
3233 | glib_libs=$($pkg_config --libs $i) | |
4a058899 | 3234 | QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" |
e26110cf FZ |
3235 | LIBS="$glib_libs $LIBS" |
3236 | libs_qga="$glib_libs $libs_qga" | |
3237 | else | |
3238 | error_exit "glib-$glib_req_ver $i is required to compile QEMU" | |
3239 | fi | |
3240 | done | |
3241 | ||
977a82ab DB |
3242 | # Sanity check that the current size_t matches the |
3243 | # size that glib thinks it should be. This catches | |
3244 | # problems on multi-arch where people try to build | |
3245 | # 32-bit QEMU while pointing at 64-bit glib headers | |
3246 | cat > $TMPC <<EOF | |
3247 | #include <glib.h> | |
3248 | #include <unistd.h> | |
3249 | ||
3250 | #define QEMU_BUILD_BUG_ON(x) \ | |
3251 | typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused)); | |
3252 | ||
3253 | int main(void) { | |
3254 | QEMU_BUILD_BUG_ON(sizeof(size_t) != GLIB_SIZEOF_SIZE_T); | |
3255 | return 0; | |
3256 | } | |
3257 | EOF | |
3258 | ||
5919e032 | 3259 | if ! compile_prog "$CFLAGS" "$LIBS" ; then |
977a82ab DB |
3260 | error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ |
3261 | "You probably need to set PKG_CONFIG_LIBDIR"\ | |
3262 | "to point to the right pkg-config files for your"\ | |
3263 | "build target" | |
3264 | fi | |
3265 | ||
9d41401b MT |
3266 | # g_test_trap_subprocess added in 2.38. Used by some tests. |
3267 | glib_subprocess=yes | |
a049223a | 3268 | if ! $pkg_config --atleast-version=2.38 glib-2.0; then |
9d41401b MT |
3269 | glib_subprocess=no |
3270 | fi | |
3271 | ||
bbbf2e04 JS |
3272 | # Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage |
3273 | cat > $TMPC << EOF | |
3274 | #include <glib.h> | |
3275 | int main(void) { return 0; } | |
3276 | EOF | |
3277 | if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then | |
3278 | if cc_has_warning_flag "-Wno-unknown-attributes"; then | |
3279 | glib_cflags="-Wno-unknown-attributes $glib_cflags" | |
3280 | CFLAGS="-Wno-unknown-attributes $CFLAGS" | |
3281 | fi | |
3282 | fi | |
3283 | ||
e26110cf FZ |
3284 | ########################################## |
3285 | # SHA command probe for modules | |
3286 | if test "$modules" = yes; then | |
3287 | shacmd_probe="sha1sum sha1 shasum" | |
3288 | for c in $shacmd_probe; do | |
8ccefb91 | 3289 | if has $c; then |
e26110cf FZ |
3290 | shacmd="$c" |
3291 | break | |
3292 | fi | |
3293 | done | |
3294 | if test "$shacmd" = ""; then | |
3295 | error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" | |
3296 | fi | |
e18df141 AL |
3297 | fi |
3298 | ||
e2134eb9 GH |
3299 | ########################################## |
3300 | # pixman support probe | |
3301 | ||
35c4e86c | 3302 | if test "$want_tools" = "no" -a "$softmmu" = "no"; then |
74880fe2 RS |
3303 | pixman_cflags= |
3304 | pixman_libs= | |
35c4e86c | 3305 | elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then |
89138857 SW |
3306 | pixman_cflags=$($pkg_config --cflags pixman-1) |
3307 | pixman_libs=$($pkg_config --libs pixman-1) | |
e2134eb9 | 3308 | else |
c12b6d70 GH |
3309 | error_exit "pixman >= 0.21.8 not present." \ |
3310 | "Please install the pixman devel package." | |
e2134eb9 | 3311 | fi |
e2134eb9 | 3312 | |
fe8fc5ae PB |
3313 | ########################################## |
3314 | # libmpathpersist probe | |
3315 | ||
3316 | if test "$mpath" != "no" ; then | |
3317 | cat > $TMPC <<EOF | |
3318 | #include <libudev.h> | |
3319 | #include <mpath_persist.h> | |
3320 | unsigned mpath_mx_alloc_len = 1024; | |
3321 | int logsink; | |
3322 | int main(void) { | |
3323 | struct udev *udev = udev_new(); | |
3324 | mpath_lib_init(udev); | |
3325 | return 0; | |
3326 | } | |
3327 | EOF | |
3328 | if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then | |
3329 | mpathpersist=yes | |
3330 | else | |
3331 | mpathpersist=no | |
3332 | fi | |
3333 | else | |
3334 | mpathpersist=no | |
3335 | fi | |
3336 | ||
17bff52b MK |
3337 | ########################################## |
3338 | # libcap probe | |
3339 | ||
3340 | if test "$cap" != "no" ; then | |
3341 | cat > $TMPC <<EOF | |
3342 | #include <stdio.h> | |
3343 | #include <sys/capability.h> | |
cc939743 | 3344 | int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } |
17bff52b MK |
3345 | EOF |
3346 | if compile_prog "" "-lcap" ; then | |
3347 | cap=yes | |
3348 | else | |
3349 | cap=no | |
3350 | fi | |
3351 | fi | |
3352 | ||
414f0dab | 3353 | ########################################## |
e5d355d1 | 3354 | # pthread probe |
4b29ec41 | 3355 | PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" |
3c529d93 | 3356 | |
4dd75c70 | 3357 | pthread=no |
e5d355d1 | 3358 | cat > $TMPC << EOF |
3c529d93 | 3359 | #include <pthread.h> |
7a42bbe4 SW |
3360 | static void *f(void *p) { return NULL; } |
3361 | int main(void) { | |
3362 | pthread_t thread; | |
3363 | pthread_create(&thread, 0, f, 0); | |
3364 | return 0; | |
3365 | } | |
414f0dab | 3366 | EOF |
bd00d539 AF |
3367 | if compile_prog "" "" ; then |
3368 | pthread=yes | |
3369 | else | |
3370 | for pthread_lib in $PTHREADLIBS_LIST; do | |
3371 | if compile_prog "" "$pthread_lib" ; then | |
3372 | pthread=yes | |
e3c56761 PP |
3373 | found=no |
3374 | for lib_entry in $LIBS; do | |
3375 | if test "$lib_entry" = "$pthread_lib"; then | |
3376 | found=yes | |
3377 | break | |
3378 | fi | |
3379 | done | |
3380 | if test "$found" = "no"; then | |
3381 | LIBS="$pthread_lib $LIBS" | |
3382 | fi | |
409437e1 | 3383 | PTHREAD_LIB="$pthread_lib" |
bd00d539 AF |
3384 | break |
3385 | fi | |
3386 | done | |
3387 | fi | |
414f0dab | 3388 | |
4617e593 | 3389 | if test "$mingw32" != yes -a "$pthread" = no; then |
76ad07a4 PM |
3390 | error_exit "pthread check failed" \ |
3391 | "Make sure to have the pthread libs and headers installed." | |
e5d355d1 AL |
3392 | fi |
3393 | ||
5c312079 DDAG |
3394 | # check for pthread_setname_np |
3395 | pthread_setname_np=no | |
3396 | cat > $TMPC << EOF | |
3397 | #include <pthread.h> | |
3398 | ||
3399 | static void *f(void *p) { return NULL; } | |
3400 | int main(void) | |
3401 | { | |
3402 | pthread_t thread; | |
3403 | pthread_create(&thread, 0, f, 0); | |
3404 | pthread_setname_np(thread, "QEMU"); | |
3405 | return 0; | |
3406 | } | |
3407 | EOF | |
3408 | if compile_prog "" "$pthread_lib" ; then | |
3409 | pthread_setname_np=yes | |
3410 | fi | |
3411 | ||
f27aaf4b CB |
3412 | ########################################## |
3413 | # rbd probe | |
3414 | if test "$rbd" != "no" ; then | |
3415 | cat > $TMPC <<EOF | |
3416 | #include <stdio.h> | |
ad32e9c0 | 3417 | #include <rbd/librbd.h> |
f27aaf4b | 3418 | int main(void) { |
ad32e9c0 JD |
3419 | rados_t cluster; |
3420 | rados_create(&cluster, NULL); | |
f27aaf4b CB |
3421 | return 0; |
3422 | } | |
3423 | EOF | |
ad32e9c0 JD |
3424 | rbd_libs="-lrbd -lrados" |
3425 | if compile_prog "" "$rbd_libs" ; then | |
3426 | rbd=yes | |
f27aaf4b CB |
3427 | else |
3428 | if test "$rbd" = "yes" ; then | |
21684af0 | 3429 | feature_not_found "rados block device" "Install librbd/ceph devel" |
f27aaf4b CB |
3430 | fi |
3431 | rbd=no | |
3432 | fi | |
f27aaf4b CB |
3433 | fi |
3434 | ||
0a12ec87 RJ |
3435 | ########################################## |
3436 | # libssh2 probe | |
4fc16838 | 3437 | min_libssh2_version=1.2.8 |
0a12ec87 | 3438 | if test "$libssh2" != "no" ; then |
65d5d3f9 | 3439 | if $pkg_config --atleast-version=$min_libssh2_version libssh2; then |
89138857 SW |
3440 | libssh2_cflags=$($pkg_config libssh2 --cflags) |
3441 | libssh2_libs=$($pkg_config libssh2 --libs) | |
0a12ec87 | 3442 | libssh2=yes |
0a12ec87 RJ |
3443 | else |
3444 | if test "$libssh2" = "yes" ; then | |
4fc16838 | 3445 | error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2" |
0a12ec87 RJ |
3446 | fi |
3447 | libssh2=no | |
3448 | fi | |
3449 | fi | |
3450 | ||
9a2d462e RJ |
3451 | ########################################## |
3452 | # libssh2_sftp_fsync probe | |
3453 | ||
3454 | if test "$libssh2" = "yes"; then | |
3455 | cat > $TMPC <<EOF | |
3456 | #include <stdio.h> | |
3457 | #include <libssh2.h> | |
3458 | #include <libssh2_sftp.h> | |
3459 | int main(void) { | |
3460 | LIBSSH2_SESSION *session; | |
3461 | LIBSSH2_SFTP *sftp; | |
3462 | LIBSSH2_SFTP_HANDLE *sftp_handle; | |
3463 | session = libssh2_session_init (); | |
3464 | sftp = libssh2_sftp_init (session); | |
3465 | sftp_handle = libssh2_sftp_open (sftp, "/", 0, 0); | |
3466 | libssh2_sftp_fsync (sftp_handle); | |
3467 | return 0; | |
3468 | } | |
3469 | EOF | |
3470 | # libssh2_cflags/libssh2_libs defined in previous test. | |
3471 | if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then | |
3472 | QEMU_CFLAGS="-DHAS_LIBSSH2_SFTP_FSYNC $QEMU_CFLAGS" | |
3473 | fi | |
3474 | fi | |
3475 | ||
5c6c3a6c CH |
3476 | ########################################## |
3477 | # linux-aio probe | |
5c6c3a6c CH |
3478 | |
3479 | if test "$linux_aio" != "no" ; then | |
3480 | cat > $TMPC <<EOF | |
3481 | #include <libaio.h> | |
3482 | #include <sys/eventfd.h> | |
832ce9c2 | 3483 | #include <stddef.h> |
5c6c3a6c CH |
3484 | int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } |
3485 | EOF | |
3486 | if compile_prog "" "-laio" ; then | |
3487 | linux_aio=yes | |
5c6c3a6c CH |
3488 | else |
3489 | if test "$linux_aio" = "yes" ; then | |
21684af0 | 3490 | feature_not_found "linux AIO" "Install libaio devel" |
5c6c3a6c | 3491 | fi |
3cfcae3c | 3492 | linux_aio=no |
5c6c3a6c CH |
3493 | fi |
3494 | fi | |
3495 | ||
3b8acc11 PB |
3496 | ########################################## |
3497 | # TPM passthrough is only on x86 Linux | |
3498 | ||
3499 | if test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then | |
3500 | tpm_passthrough=$tpm | |
3501 | else | |
3502 | tpm_passthrough=no | |
3503 | fi | |
3504 | ||
758e8e38 VJ |
3505 | ########################################## |
3506 | # attr probe | |
3507 | ||
3508 | if test "$attr" != "no" ; then | |
3509 | cat > $TMPC <<EOF | |
3510 | #include <stdio.h> | |
3511 | #include <sys/types.h> | |
f2338fb4 PB |
3512 | #ifdef CONFIG_LIBATTR |
3513 | #include <attr/xattr.h> | |
3514 | #else | |
4f26f2b6 | 3515 | #include <sys/xattr.h> |
f2338fb4 | 3516 | #endif |
758e8e38 VJ |
3517 | int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } |
3518 | EOF | |
4f26f2b6 AK |
3519 | if compile_prog "" "" ; then |
3520 | attr=yes | |
3521 | # Older distros have <attr/xattr.h>, and need -lattr: | |
f2338fb4 | 3522 | elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then |
758e8e38 VJ |
3523 | attr=yes |
3524 | LIBS="-lattr $LIBS" | |
4f26f2b6 | 3525 | libattr=yes |
758e8e38 VJ |
3526 | else |
3527 | if test "$attr" = "yes" ; then | |
21684af0 | 3528 | feature_not_found "ATTR" "Install libc6 or libattr devel" |
758e8e38 VJ |
3529 | fi |
3530 | attr=no | |
3531 | fi | |
3532 | fi | |
3533 | ||
bf9298b9 AL |
3534 | ########################################## |
3535 | # iovec probe | |
3536 | cat > $TMPC <<EOF | |
db34f0b3 | 3537 | #include <sys/types.h> |
bf9298b9 | 3538 | #include <sys/uio.h> |
db34f0b3 | 3539 | #include <unistd.h> |
f91f9bee | 3540 | int main(void) { return sizeof(struct iovec); } |
bf9298b9 AL |
3541 | EOF |
3542 | iovec=no | |
52166aa0 | 3543 | if compile_prog "" "" ; then |
bf9298b9 AL |
3544 | iovec=yes |
3545 | fi | |
3546 | ||
ceb42de8 AL |
3547 | ########################################## |
3548 | # preadv probe | |
3549 | cat > $TMPC <<EOF | |
3550 | #include <sys/types.h> | |
3551 | #include <sys/uio.h> | |
3552 | #include <unistd.h> | |
c075a723 | 3553 | int main(void) { return preadv(0, 0, 0, 0); } |
ceb42de8 AL |
3554 | EOF |
3555 | preadv=no | |
52166aa0 | 3556 | if compile_prog "" "" ; then |
ceb42de8 AL |
3557 | preadv=yes |
3558 | fi | |
3559 | ||
f652e6af AJ |
3560 | ########################################## |
3561 | # fdt probe | |
e169e1e1 PM |
3562 | # fdt support is mandatory for at least some target architectures, |
3563 | # so insist on it if we're building those system emulators. | |
3564 | fdt_required=no | |
3565 | for target in $target_list; do | |
3566 | case $target in | |
df1d8a1f | 3567 | aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu) |
e169e1e1 PM |
3568 | fdt_required=yes |
3569 | ;; | |
3570 | esac | |
3571 | done | |
3572 | ||
3573 | if test "$fdt_required" = "yes"; then | |
3574 | if test "$fdt" = "no"; then | |
3575 | error_exit "fdt disabled but some requested targets require it." \ | |
3576 | "You can turn off fdt only if you also disable all the system emulation" \ | |
3577 | "targets which need it (by specifying a cut down --target-list)." | |
3578 | fi | |
3579 | fdt=yes | |
3580 | fi | |
3581 | ||
2df87df7 | 3582 | if test "$fdt" != "no" ; then |
b41af4ba | 3583 | fdt_libs="-lfdt" |
96ce6545 | 3584 | # explicitly check for libfdt_env.h as it is missing in some stable installs |
6e85fce0 | 3585 | # and test for required functions to make sure we are on a version >= 1.4.2 |
b41af4ba | 3586 | cat > $TMPC << EOF |
31ce0adb | 3587 | #include <libfdt.h> |
96ce6545 | 3588 | #include <libfdt_env.h> |
6e85fce0 | 3589 | int main(void) { fdt_first_subnode(0, 0); return 0; } |
f652e6af | 3590 | EOF |
52166aa0 | 3591 | if compile_prog "" "$fdt_libs" ; then |
a540f158 | 3592 | # system DTC is good - use it |
f652e6af | 3593 | fdt=yes |
a540f158 | 3594 | else |
aef45d51 DB |
3595 | # have GIT checkout, so activate dtc submodule |
3596 | if test -e "${source_path}/.git" ; then | |
3597 | git_submodules="${git_submodules} dtc" | |
3598 | fi | |
3599 | if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then | |
3600 | fdt=yes | |
3601 | dtc_internal="yes" | |
3602 | mkdir -p dtc | |
3603 | if [ "$pwd_is_source_path" != "y" ] ; then | |
3604 | symlink "$source_path/dtc/Makefile" "dtc/Makefile" | |
3605 | symlink "$source_path/dtc/scripts" "dtc/scripts" | |
3606 | fi | |
3607 | fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" | |
3608 | fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs" | |
3609 | elif test "$fdt" = "yes" ; then | |
3610 | # Not a git build & no libfdt found, prompt for system install | |
3611 | error_exit "DTC (libfdt) version >= 1.4.2 not present." \ | |
3612 | "Please install the DTC (libfdt) devel package" | |
3613 | else | |
3614 | # don't have and don't want | |
3615 | fdt_libs= | |
3616 | fdt=no | |
3617 | fi | |
f652e6af AJ |
3618 | fi |
3619 | fi | |
3620 | ||
a540f158 PC |
3621 | libs_softmmu="$libs_softmmu $fdt_libs" |
3622 | ||
20ff075b | 3623 | ########################################## |
fb719563 | 3624 | # opengl probe (for sdl2, gtk, milkymist-tmu2) |
b1546f32 | 3625 | |
da076ffe | 3626 | if test "$opengl" != "no" ; then |
014cb152 | 3627 | opengl_pkgs="epoxy libdrm gbm" |
fb719563 | 3628 | if $pkg_config $opengl_pkgs x11; then |
f676c67e JW |
3629 | opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags" |
3630 | opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs" | |
da076ffe | 3631 | opengl=yes |
925a0400 GH |
3632 | if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then |
3633 | gtk_gl="yes" | |
3634 | fi | |
cc720a5d | 3635 | QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags" |
20ff075b | 3636 | else |
da076ffe | 3637 | if test "$opengl" = "yes" ; then |
dcf30025 | 3638 | feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs" |
20ff075b | 3639 | fi |
f676c67e | 3640 | opengl_cflags="" |
da076ffe GH |
3641 | opengl_libs="" |
3642 | opengl=no | |
20ff075b MW |
3643 | fi |
3644 | fi | |
3645 | ||
014cb152 GH |
3646 | if test "$opengl" = "yes"; then |
3647 | cat > $TMPC << EOF | |
3648 | #include <epoxy/egl.h> | |
3649 | #ifndef EGL_MESA_image_dma_buf_export | |
3650 | # error mesa/epoxy lacks support for dmabufs (mesa 10.6+) | |
3651 | #endif | |
3652 | int main(void) { return 0; } | |
3653 | EOF | |
3654 | if compile_prog "" "" ; then | |
3655 | opengl_dmabuf=yes | |
3656 | fi | |
3657 | fi | |
c9a12e75 | 3658 | |
c9a12e75 | 3659 | |
eb100396 BR |
3660 | ########################################## |
3661 | # glusterfs probe | |
3662 | if test "$glusterfs" != "no" ; then | |
65d5d3f9 | 3663 | if $pkg_config --atleast-version=3 glusterfs-api; then |
e01bee08 | 3664 | glusterfs="yes" |
89138857 SW |
3665 | glusterfs_cflags=$($pkg_config --cflags glusterfs-api) |
3666 | glusterfs_libs=$($pkg_config --libs glusterfs-api) | |
d85fa9eb JC |
3667 | if $pkg_config --atleast-version=4 glusterfs-api; then |
3668 | glusterfs_xlator_opt="yes" | |
3669 | fi | |
65d5d3f9 | 3670 | if $pkg_config --atleast-version=5 glusterfs-api; then |
0c14fb47 BR |
3671 | glusterfs_discard="yes" |
3672 | fi | |
7c815372 | 3673 | if $pkg_config --atleast-version=6 glusterfs-api; then |
df3a429a | 3674 | glusterfs_fallocate="yes" |
7c815372 BR |
3675 | glusterfs_zerofill="yes" |
3676 | fi | |
eb100396 BR |
3677 | else |
3678 | if test "$glusterfs" = "yes" ; then | |
8efc9363 HT |
3679 | feature_not_found "GlusterFS backend support" \ |
3680 | "Install glusterfs-api devel >= 3" | |
eb100396 | 3681 | fi |
e01bee08 | 3682 | glusterfs="no" |
eb100396 BR |
3683 | fi |
3684 | fi | |
3685 | ||
39386ac7 | 3686 | # Check for inotify functions when we are building linux-user |
3b3f24ad AJ |
3687 | # emulator. This is done because older glibc versions don't |
3688 | # have syscall stubs for these implemented. In that case we | |
3689 | # don't provide them even if kernel supports them. | |
3690 | # | |
3691 | inotify=no | |
67ba57f6 | 3692 | cat > $TMPC << EOF |
3b3f24ad AJ |
3693 | #include <sys/inotify.h> |
3694 | ||
3695 | int | |
3696 | main(void) | |
3697 | { | |
3698 | /* try to start inotify */ | |
8690e420 | 3699 | return inotify_init(); |
3b3f24ad AJ |
3700 | } |
3701 | EOF | |
52166aa0 | 3702 | if compile_prog "" "" ; then |
67ba57f6 | 3703 | inotify=yes |
3b3f24ad AJ |
3704 | fi |
3705 | ||
c05c7a73 RV |
3706 | inotify1=no |
3707 | cat > $TMPC << EOF | |
3708 | #include <sys/inotify.h> | |
3709 | ||
3710 | int | |
3711 | main(void) | |
3712 | { | |
3713 | /* try to start inotify */ | |
3714 | return inotify_init1(0); | |
3715 | } | |
3716 | EOF | |
3717 | if compile_prog "" "" ; then | |
3718 | inotify1=yes | |
3719 | fi | |
3720 | ||
099d6b0f RV |
3721 | # check if pipe2 is there |
3722 | pipe2=no | |
3723 | cat > $TMPC << EOF | |
099d6b0f RV |
3724 | #include <unistd.h> |
3725 | #include <fcntl.h> | |
3726 | ||
3727 | int main(void) | |
3728 | { | |
3729 | int pipefd[2]; | |
9bca8162 | 3730 | return pipe2(pipefd, O_CLOEXEC); |
099d6b0f RV |
3731 | } |
3732 | EOF | |
52166aa0 | 3733 | if compile_prog "" "" ; then |
099d6b0f RV |
3734 | pipe2=yes |
3735 | fi | |
3736 | ||
40ff6d7e KW |
3737 | # check if accept4 is there |
3738 | accept4=no | |
3739 | cat > $TMPC << EOF | |
40ff6d7e KW |
3740 | #include <sys/socket.h> |
3741 | #include <stddef.h> | |
3742 | ||
3743 | int main(void) | |
3744 | { | |
3745 | accept4(0, NULL, NULL, SOCK_CLOEXEC); | |
3746 | return 0; | |
3747 | } | |
3748 | EOF | |
3749 | if compile_prog "" "" ; then | |
3750 | accept4=yes | |
3751 | fi | |
3752 | ||
3ce34dfb VS |
3753 | # check if tee/splice is there. vmsplice was added same time. |
3754 | splice=no | |
3755 | cat > $TMPC << EOF | |
3ce34dfb VS |
3756 | #include <unistd.h> |
3757 | #include <fcntl.h> | |
3758 | #include <limits.h> | |
3759 | ||
3760 | int main(void) | |
3761 | { | |
66ea0f22 | 3762 | int len, fd = 0; |
3ce34dfb VS |
3763 | len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); |
3764 | splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); | |
3765 | return 0; | |
3766 | } | |
3767 | EOF | |
52166aa0 | 3768 | if compile_prog "" "" ; then |
3ce34dfb VS |
3769 | splice=yes |
3770 | fi | |
3771 | ||
a99d57bb WG |
3772 | ########################################## |
3773 | # libnuma probe | |
3774 | ||
3775 | if test "$numa" != "no" ; then | |
3776 | cat > $TMPC << EOF | |
3777 | #include <numa.h> | |
3778 | int main(void) { return numa_available(); } | |
3779 | EOF | |
3780 | ||
3781 | if compile_prog "" "-lnuma" ; then | |
3782 | numa=yes | |
3783 | libs_softmmu="-lnuma $libs_softmmu" | |
3784 | else | |
3785 | if test "$numa" = "yes" ; then | |
3786 | feature_not_found "numa" "install numactl devel" | |
3787 | fi | |
3788 | numa=no | |
3789 | fi | |
3790 | fi | |
3791 | ||
7b01cb97 AD |
3792 | if test "$tcmalloc" = "yes" && test "$jemalloc" = "yes" ; then |
3793 | echo "ERROR: tcmalloc && jemalloc can't be used at the same time" | |
3794 | exit 1 | |
3795 | fi | |
3796 | ||
2847b469 FZ |
3797 | ########################################## |
3798 | # tcmalloc probe | |
3799 | ||
3800 | if test "$tcmalloc" = "yes" ; then | |
3801 | cat > $TMPC << EOF | |
3802 | #include <stdlib.h> | |
3803 | int main(void) { malloc(1); return 0; } | |
3804 | EOF | |
3805 | ||
3806 | if compile_prog "" "-ltcmalloc" ; then | |
3807 | LIBS="-ltcmalloc $LIBS" | |
3808 | else | |
3809 | feature_not_found "tcmalloc" "install gperftools devel" | |
3810 | fi | |
3811 | fi | |
3812 | ||
7b01cb97 AD |
3813 | ########################################## |
3814 | # jemalloc probe | |
3815 | ||
3816 | if test "$jemalloc" = "yes" ; then | |
3817 | cat > $TMPC << EOF | |
3818 | #include <stdlib.h> | |
3819 | int main(void) { malloc(1); return 0; } | |
3820 | EOF | |
3821 | ||
3822 | if compile_prog "" "-ljemalloc" ; then | |
3823 | LIBS="-ljemalloc $LIBS" | |
3824 | else | |
3825 | feature_not_found "jemalloc" "install jemalloc devel" | |
3826 | fi | |
3827 | fi | |
3828 | ||
dcc38d1c MT |
3829 | ########################################## |
3830 | # signalfd probe | |
3831 | signalfd="no" | |
3832 | cat > $TMPC << EOF | |
dcc38d1c MT |
3833 | #include <unistd.h> |
3834 | #include <sys/syscall.h> | |
3835 | #include <signal.h> | |
3836 | int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } | |
3837 | EOF | |
3838 | ||
3839 | if compile_prog "" "" ; then | |
3840 | signalfd=yes | |
3841 | fi | |
3842 | ||
c2882b96 RV |
3843 | # check if eventfd is supported |
3844 | eventfd=no | |
3845 | cat > $TMPC << EOF | |
3846 | #include <sys/eventfd.h> | |
3847 | ||
3848 | int main(void) | |
3849 | { | |
55cc7f3e | 3850 | return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); |
c2882b96 RV |
3851 | } |
3852 | EOF | |
3853 | if compile_prog "" "" ; then | |
3854 | eventfd=yes | |
3855 | fi | |
3856 | ||
751bcc39 MAL |
3857 | # check if memfd is supported |
3858 | memfd=no | |
3859 | cat > $TMPC << EOF | |
3860 | #include <sys/memfd.h> | |
3861 | ||
3862 | int main(void) | |
3863 | { | |
3864 | return memfd_create("foo", MFD_ALLOW_SEALING); | |
3865 | } | |
3866 | EOF | |
3867 | if compile_prog "" "" ; then | |
3868 | memfd=yes | |
3869 | fi | |
3870 | ||
3871 | ||
3872 | ||
d0927938 UH |
3873 | # check for fallocate |
3874 | fallocate=no | |
3875 | cat > $TMPC << EOF | |
3876 | #include <fcntl.h> | |
3877 | ||
3878 | int main(void) | |
3879 | { | |
3880 | fallocate(0, 0, 0, 0); | |
3881 | return 0; | |
3882 | } | |
3883 | EOF | |
8fb03151 | 3884 | if compile_prog "" "" ; then |
d0927938 UH |
3885 | fallocate=yes |
3886 | fi | |
3887 | ||
3d4fa43e KK |
3888 | # check for fallocate hole punching |
3889 | fallocate_punch_hole=no | |
3890 | cat > $TMPC << EOF | |
3891 | #include <fcntl.h> | |
3892 | #include <linux/falloc.h> | |
3893 | ||
3894 | int main(void) | |
3895 | { | |
3896 | fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); | |
3897 | return 0; | |
3898 | } | |
3899 | EOF | |
3900 | if compile_prog "" "" ; then | |
3901 | fallocate_punch_hole=yes | |
3902 | fi | |
3903 | ||
b953f075 DL |
3904 | # check that fallocate supports range zeroing inside the file |
3905 | fallocate_zero_range=no | |
3906 | cat > $TMPC << EOF | |
3907 | #include <fcntl.h> | |
3908 | #include <linux/falloc.h> | |
3909 | ||
3910 | int main(void) | |
3911 | { | |
3912 | fallocate(0, FALLOC_FL_ZERO_RANGE, 0, 0); | |
3913 | return 0; | |
3914 | } | |
3915 | EOF | |
3916 | if compile_prog "" "" ; then | |
3917 | fallocate_zero_range=yes | |
3918 | fi | |
3919 | ||
ed911435 KW |
3920 | # check for posix_fallocate |
3921 | posix_fallocate=no | |
3922 | cat > $TMPC << EOF | |
3923 | #include <fcntl.h> | |
3924 | ||
3925 | int main(void) | |
3926 | { | |
3927 | posix_fallocate(0, 0, 0); | |
3928 | return 0; | |
3929 | } | |
3930 | EOF | |
3931 | if compile_prog "" "" ; then | |
3932 | posix_fallocate=yes | |
3933 | fi | |
3934 | ||
c727f47d PM |
3935 | # check for sync_file_range |
3936 | sync_file_range=no | |
3937 | cat > $TMPC << EOF | |
3938 | #include <fcntl.h> | |
3939 | ||
3940 | int main(void) | |
3941 | { | |
3942 | sync_file_range(0, 0, 0, 0); | |
3943 | return 0; | |
3944 | } | |
3945 | EOF | |
8fb03151 | 3946 | if compile_prog "" "" ; then |
c727f47d PM |
3947 | sync_file_range=yes |
3948 | fi | |
3949 | ||
dace20dc PM |
3950 | # check for linux/fiemap.h and FS_IOC_FIEMAP |
3951 | fiemap=no | |
3952 | cat > $TMPC << EOF | |
3953 | #include <sys/ioctl.h> | |
3954 | #include <linux/fs.h> | |
3955 | #include <linux/fiemap.h> | |
3956 | ||
3957 | int main(void) | |
3958 | { | |
3959 | ioctl(0, FS_IOC_FIEMAP, 0); | |
3960 | return 0; | |
3961 | } | |
3962 | EOF | |
8fb03151 | 3963 | if compile_prog "" "" ; then |
dace20dc PM |
3964 | fiemap=yes |
3965 | fi | |
3966 | ||
d0927938 UH |
3967 | # check for dup3 |
3968 | dup3=no | |
3969 | cat > $TMPC << EOF | |
3970 | #include <unistd.h> | |
3971 | ||
3972 | int main(void) | |
3973 | { | |
3974 | dup3(0, 0, 0); | |
3975 | return 0; | |
3976 | } | |
3977 | EOF | |
78f5d726 | 3978 | if compile_prog "" "" ; then |
d0927938 UH |
3979 | dup3=yes |
3980 | fi | |
3981 | ||
4e0c6529 AB |
3982 | # check for ppoll support |
3983 | ppoll=no | |
3984 | cat > $TMPC << EOF | |
3985 | #include <poll.h> | |
3986 | ||
3987 | int main(void) | |
3988 | { | |
3989 | struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; | |
3990 | ppoll(&pfd, 1, 0, 0); | |
3991 | return 0; | |
3992 | } | |
3993 | EOF | |
3994 | if compile_prog "" "" ; then | |
3995 | ppoll=yes | |
3996 | fi | |
3997 | ||
cd758dd0 AB |
3998 | # check for prctl(PR_SET_TIMERSLACK , ... ) support |
3999 | prctl_pr_set_timerslack=no | |
4000 | cat > $TMPC << EOF | |
4001 | #include <sys/prctl.h> | |
4002 | ||
4003 | int main(void) | |
4004 | { | |
4005 | prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); | |
4006 | return 0; | |
4007 | } | |
4008 | EOF | |
4009 | if compile_prog "" "" ; then | |
4010 | prctl_pr_set_timerslack=yes | |
4011 | fi | |
4012 | ||
3b6edd16 PM |
4013 | # check for epoll support |
4014 | epoll=no | |
4015 | cat > $TMPC << EOF | |
4016 | #include <sys/epoll.h> | |
4017 | ||
4018 | int main(void) | |
4019 | { | |
4020 | epoll_create(0); | |
4021 | return 0; | |
4022 | } | |
4023 | EOF | |
8fb03151 | 4024 | if compile_prog "" "" ; then |
3b6edd16 PM |
4025 | epoll=yes |
4026 | fi | |
4027 | ||
227f0214 PM |
4028 | # epoll_create1 is a later addition |
4029 | # so we must check separately for its presence | |
3b6edd16 PM |
4030 | epoll_create1=no |
4031 | cat > $TMPC << EOF | |
4032 | #include <sys/epoll.h> | |
4033 | ||
4034 | int main(void) | |
4035 | { | |
19e83f6b PM |
4036 | /* Note that we use epoll_create1 as a value, not as |
4037 | * a function being called. This is necessary so that on | |
4038 | * old SPARC glibc versions where the function was present in | |
4039 | * the library but not declared in the header file we will | |
4040 | * fail the configure check. (Otherwise we will get a compiler | |
4041 | * warning but not an error, and will proceed to fail the | |
4042 | * qemu compile where we compile with -Werror.) | |
4043 | */ | |
c075a723 | 4044 | return (int)(uintptr_t)&epoll_create1; |
3b6edd16 PM |
4045 | } |
4046 | EOF | |
8fb03151 | 4047 | if compile_prog "" "" ; then |
3b6edd16 PM |
4048 | epoll_create1=yes |
4049 | fi | |
4050 | ||
a8fd1aba PM |
4051 | # check for sendfile support |
4052 | sendfile=no | |
4053 | cat > $TMPC << EOF | |
4054 | #include <sys/sendfile.h> | |
4055 | ||
4056 | int main(void) | |
4057 | { | |
4058 | return sendfile(0, 0, 0, 0); | |
4059 | } | |
4060 | EOF | |
4061 | if compile_prog "" "" ; then | |
4062 | sendfile=yes | |
4063 | fi | |
4064 | ||
51834341 RV |
4065 | # check for timerfd support (glibc 2.8 and newer) |
4066 | timerfd=no | |
4067 | cat > $TMPC << EOF | |
4068 | #include <sys/timerfd.h> | |
4069 | ||
4070 | int main(void) | |
4071 | { | |
4072 | return(timerfd_create(CLOCK_REALTIME, 0)); | |
4073 | } | |
4074 | EOF | |
4075 | if compile_prog "" "" ; then | |
4076 | timerfd=yes | |
4077 | fi | |
4078 | ||
9af5c906 RV |
4079 | # check for setns and unshare support |
4080 | setns=no | |
4081 | cat > $TMPC << EOF | |
4082 | #include <sched.h> | |
4083 | ||
4084 | int main(void) | |
4085 | { | |
4086 | int ret; | |
4087 | ret = setns(0, 0); | |
4088 | ret = unshare(0); | |
4089 | return ret; | |
4090 | } | |
4091 | EOF | |
4092 | if compile_prog "" "" ; then | |
4093 | setns=yes | |
4094 | fi | |
4095 | ||
38860a03 AM |
4096 | # clock_adjtime probe |
4097 | clock_adjtime=no | |
4098 | cat > $TMPC <<EOF | |
4099 | #include <time.h> | |
4100 | ||
4101 | int main(void) | |
4102 | { | |
4103 | return clock_adjtime(0, 0); | |
4104 | } | |
4105 | EOF | |
4106 | clock_adjtime=no | |
4107 | if compile_prog "" "" ; then | |
4108 | clock_adjtime=yes | |
4109 | fi | |
4110 | ||
5a03cd00 AM |
4111 | # syncfs probe |
4112 | syncfs=no | |
4113 | cat > $TMPC <<EOF | |
4114 | #include <unistd.h> | |
4115 | ||
4116 | int main(void) | |
4117 | { | |
4118 | return syncfs(0); | |
4119 | } | |
4120 | EOF | |
4121 | syncfs=no | |
4122 | if compile_prog "" "" ; then | |
4123 | syncfs=yes | |
4124 | fi | |
4125 | ||
cc8ae6de | 4126 | # Check if tools are available to build documentation. |
a25dba17 | 4127 | if test "$docs" != "no" ; then |
01668d98 | 4128 | if has makeinfo && has pod2man; then |
a25dba17 | 4129 | docs=yes |
83a3ab8b | 4130 | else |
a25dba17 | 4131 | if test "$docs" = "yes" ; then |
21684af0 | 4132 | feature_not_found "docs" "Install texinfo and Perl/perl-podlators" |
83a3ab8b | 4133 | fi |
a25dba17 | 4134 | docs=no |
83a3ab8b | 4135 | fi |
cc8ae6de PB |
4136 | fi |
4137 | ||
f514f41c | 4138 | # Search for bswap_32 function |
6ae9a1f4 JQ |
4139 | byteswap_h=no |
4140 | cat > $TMPC << EOF | |
4141 | #include <byteswap.h> | |
4142 | int main(void) { return bswap_32(0); } | |
4143 | EOF | |
52166aa0 | 4144 | if compile_prog "" "" ; then |
6ae9a1f4 JQ |
4145 | byteswap_h=yes |
4146 | fi | |
4147 | ||
75f13596 | 4148 | # Search for bswap32 function |
6ae9a1f4 JQ |
4149 | bswap_h=no |
4150 | cat > $TMPC << EOF | |
4151 | #include <sys/endian.h> | |
4152 | #include <sys/types.h> | |
4153 | #include <machine/bswap.h> | |
4154 | int main(void) { return bswap32(0); } | |
4155 | EOF | |
52166aa0 | 4156 | if compile_prog "" "" ; then |
6ae9a1f4 JQ |
4157 | bswap_h=yes |
4158 | fi | |
4159 | ||
c589b249 | 4160 | ########################################## |
e49ab19f | 4161 | # Do we have libiscsi >= 1.9.0 |
c589b249 | 4162 | if test "$libiscsi" != "no" ; then |
e49ab19f | 4163 | if $pkg_config --atleast-version=1.9.0 libiscsi; then |
3c33ea96 | 4164 | libiscsi="yes" |
ca871ec8 SW |
4165 | libiscsi_cflags=$($pkg_config --cflags libiscsi) |
4166 | libiscsi_libs=$($pkg_config --libs libiscsi) | |
c589b249 RS |
4167 | else |
4168 | if test "$libiscsi" = "yes" ; then | |
e49ab19f | 4169 | feature_not_found "libiscsi" "Install libiscsi >= 1.9.0" |
c589b249 RS |
4170 | fi |
4171 | libiscsi="no" | |
4172 | fi | |
4173 | fi | |
4174 | ||
8bacde8d NC |
4175 | ########################################## |
4176 | # Do we need libm | |
4177 | cat > $TMPC << EOF | |
4178 | #include <math.h> | |
f80ea986 | 4179 | int main(int argc, char **argv) { return isnan(sin((double)argc)); } |
8bacde8d NC |
4180 | EOF |
4181 | if compile_prog "" "" ; then | |
4182 | : | |
4183 | elif compile_prog "" "-lm" ; then | |
4184 | LIBS="-lm $LIBS" | |
4185 | libs_qga="-lm $libs_qga" | |
4186 | else | |
76ad07a4 | 4187 | error_exit "libm check failed" |
8bacde8d NC |
4188 | fi |
4189 | ||
da93a1fd AL |
4190 | ########################################## |
4191 | # Do we need librt | |
8bacde8d NC |
4192 | # uClibc provides 2 versions of clock_gettime(), one with realtime |
4193 | # support and one without. This means that the clock_gettime() don't | |
4194 | # need -lrt. We still need it for timer_create() so we check for this | |
4195 | # function in addition. | |
da93a1fd AL |
4196 | cat > $TMPC <<EOF |
4197 | #include <signal.h> | |
4198 | #include <time.h> | |
8bacde8d NC |
4199 | int main(void) { |
4200 | timer_create(CLOCK_REALTIME, NULL, NULL); | |
4201 | return clock_gettime(CLOCK_REALTIME, NULL); | |
4202 | } | |
da93a1fd AL |
4203 | EOF |
4204 | ||
52166aa0 | 4205 | if compile_prog "" "" ; then |
07ffa4bd | 4206 | : |
8bacde8d | 4207 | # we need pthread for static linking. use previous pthread test result |
18e588b1 RL |
4208 | elif compile_prog "" "$pthread_lib -lrt" ; then |
4209 | LIBS="$LIBS -lrt" | |
4210 | libs_qga="$libs_qga -lrt" | |
da93a1fd AL |
4211 | fi |
4212 | ||
31ff504d | 4213 | if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ |
78723752 | 4214 | "$haiku" != "yes" ; then |
6362a53f JQ |
4215 | libs_softmmu="-lutil $libs_softmmu" |
4216 | fi | |
4217 | ||
de5071c5 | 4218 | ########################################## |
cd4ec0b4 GH |
4219 | # spice probe |
4220 | if test "$spice" != "no" ; then | |
4221 | cat > $TMPC << EOF | |
4222 | #include <spice.h> | |
4223 | int main(void) { spice_server_new(); return 0; } | |
4224 | EOF | |
710fc4f5 JD |
4225 | spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) |
4226 | spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) | |
65d5d3f9 SW |
4227 | if $pkg_config --atleast-version=0.12.0 spice-server && \ |
4228 | $pkg_config --atleast-version=0.12.3 spice-protocol && \ | |
cd4ec0b4 GH |
4229 | compile_prog "$spice_cflags" "$spice_libs" ; then |
4230 | spice="yes" | |
4231 | libs_softmmu="$libs_softmmu $spice_libs" | |
4232 | QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" | |
2e0e3c39 AL |
4233 | spice_protocol_version=$($pkg_config --modversion spice-protocol) |
4234 | spice_server_version=$($pkg_config --modversion spice-server) | |
cd4ec0b4 GH |
4235 | else |
4236 | if test "$spice" = "yes" ; then | |
8efc9363 HT |
4237 | feature_not_found "spice" \ |
4238 | "Install spice-server(>=0.12.0) and spice-protocol(>=0.12.3) devel" | |
cd4ec0b4 GH |
4239 | fi |
4240 | spice="no" | |
4241 | fi | |
4242 | fi | |
4243 | ||
7b02f544 | 4244 | # check for smartcard support |
7b02f544 MAL |
4245 | if test "$smartcard" != "no"; then |
4246 | if $pkg_config libcacard; then | |
4247 | libcacard_cflags=$($pkg_config --cflags libcacard) | |
4248 | libcacard_libs=$($pkg_config --libs libcacard) | |
7b02f544 | 4249 | smartcard="yes" |
afd347ab | 4250 | else |
7b02f544 MAL |
4251 | if test "$smartcard" = "yes"; then |
4252 | feature_not_found "smartcard" "Install libcacard devel" | |
111a38b0 | 4253 | fi |
7b02f544 | 4254 | smartcard="no" |
111a38b0 RR |
4255 | fi |
4256 | fi | |
111a38b0 | 4257 | |
2b2325ff GH |
4258 | # check for libusb |
4259 | if test "$libusb" != "no" ; then | |
65d5d3f9 | 4260 | if $pkg_config --atleast-version=1.0.13 libusb-1.0; then |
2b2325ff | 4261 | libusb="yes" |
ca871ec8 SW |
4262 | libusb_cflags=$($pkg_config --cflags libusb-1.0) |
4263 | libusb_libs=$($pkg_config --libs libusb-1.0) | |
2b2325ff GH |
4264 | else |
4265 | if test "$libusb" = "yes"; then | |
8efc9363 | 4266 | feature_not_found "libusb" "Install libusb devel >= 1.0.13" |
2b2325ff GH |
4267 | fi |
4268 | libusb="no" | |
4269 | fi | |
4270 | fi | |
4271 | ||
69354a83 HG |
4272 | # check for usbredirparser for usb network redirection support |
4273 | if test "$usb_redir" != "no" ; then | |
65d5d3f9 | 4274 | if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then |
69354a83 | 4275 | usb_redir="yes" |
ca871ec8 SW |
4276 | usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) |
4277 | usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) | |
69354a83 HG |
4278 | else |
4279 | if test "$usb_redir" = "yes"; then | |
21684af0 | 4280 | feature_not_found "usb-redir" "Install usbredir devel" |
69354a83 HG |
4281 | fi |
4282 | usb_redir="no" | |
4283 | fi | |
4284 | fi | |
4285 | ||
d9840e25 TS |
4286 | ########################################## |
4287 | # check if we have VSS SDK headers for win | |
4288 | ||
4289 | if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then | |
4290 | case "$vss_win32_sdk" in | |
690604f6 | 4291 | "") vss_win32_include="-isystem $source_path" ;; |
d9840e25 TS |
4292 | *\ *) # The SDK is installed in "Program Files" by default, but we cannot |
4293 | # handle path with spaces. So we symlink the headers into ".sdk/vss". | |
690604f6 | 4294 | vss_win32_include="-isystem $source_path/.sdk/vss" |
d9840e25 TS |
4295 | symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" |
4296 | ;; | |
690604f6 | 4297 | *) vss_win32_include="-isystem $vss_win32_sdk" |
d9840e25 TS |
4298 | esac |
4299 | cat > $TMPC << EOF | |
4300 | #define __MIDL_user_allocate_free_DEFINED__ | |
4301 | #include <inc/win2003/vss.h> | |
4302 | int main(void) { return VSS_CTX_BACKUP; } | |
4303 | EOF | |
4304 | if compile_prog "$vss_win32_include" "" ; then | |
4305 | guest_agent_with_vss="yes" | |
4306 | QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" | |
315d3184 | 4307 | libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" |
f33ca81f | 4308 | qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb" |
d9840e25 TS |
4309 | else |
4310 | if test "$vss_win32_sdk" != "" ; then | |
4311 | echo "ERROR: Please download and install Microsoft VSS SDK:" | |
4312 | echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" | |
4313 | echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" | |
4314 | echo "ERROR: scripts/extract-vsssdk-headers setup.exe" | |
4315 | echo "ERROR: The headers are extracted in the directory \`inc'." | |
4316 | feature_not_found "VSS support" | |
4317 | fi | |
4318 | guest_agent_with_vss="no" | |
4319 | fi | |
4320 | fi | |
4321 | ||
4322 | ########################################## | |
4323 | # lookup Windows platform SDK (if not specified) | |
4324 | # The SDK is needed only to build .tlb (type library) file of guest agent | |
4325 | # VSS provider from the source. It is usually unnecessary because the | |
4326 | # pre-compiled .tlb file is included. | |
4327 | ||
4328 | if test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then | |
4329 | if test -z "$win_sdk"; then | |
4330 | programfiles="$PROGRAMFILES" | |
4331 | test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" | |
4332 | if test -n "$programfiles"; then | |
4333 | win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null | |
4334 | else | |
4335 | feature_not_found "Windows SDK" | |
4336 | fi | |
4337 | elif test "$win_sdk" = "no"; then | |
4338 | win_sdk="" | |
4339 | fi | |
4340 | fi | |
4341 | ||
50cbebb9 MR |
4342 | ########################################## |
4343 | # check if mingw environment provides a recent ntddscsi.h | |
4344 | if test "$mingw32" = "yes" -a "$guest_agent" != "no"; then | |
4345 | cat > $TMPC << EOF | |
4346 | #include <windows.h> | |
4347 | #include <ntddscsi.h> | |
4348 | int main(void) { | |
4349 | #if !defined(IOCTL_SCSI_GET_ADDRESS) | |
4350 | #error Missing required ioctl definitions | |
4351 | #endif | |
4352 | SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 }; | |
4353 | return addr.Lun; | |
4354 | } | |
4355 | EOF | |
4356 | if compile_prog "" "" ; then | |
4357 | guest_agent_ntddscsi=yes | |
c54e1eb4 | 4358 | libs_qga="-lsetupapi $libs_qga" |
50cbebb9 MR |
4359 | fi |
4360 | fi | |
4361 | ||
9d9e1521 GH |
4362 | ########################################## |
4363 | # virgl renderer probe | |
4364 | ||
4365 | if test "$virglrenderer" != "no" ; then | |
4366 | cat > $TMPC << EOF | |
4367 | #include <virglrenderer.h> | |
4368 | int main(void) { virgl_renderer_poll(); return 0; } | |
4369 | EOF | |
4370 | virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null) | |
4371 | virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null) | |
4372 | if $pkg_config virglrenderer >/dev/null 2>&1 && \ | |
4373 | compile_prog "$virgl_cflags" "$virgl_libs" ; then | |
4374 | virglrenderer="yes" | |
4375 | else | |
4376 | if test "$virglrenderer" = "yes" ; then | |
4377 | feature_not_found "virglrenderer" | |
4378 | fi | |
4379 | virglrenderer="no" | |
4380 | fi | |
4381 | fi | |
4382 | ||
5f6b9e8f BS |
4383 | ########################################## |
4384 | # check if we have fdatasync | |
4385 | ||
4386 | fdatasync=no | |
4387 | cat > $TMPC << EOF | |
4388 | #include <unistd.h> | |
d1722a27 AR |
4389 | int main(void) { |
4390 | #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 | |
4391 | return fdatasync(0); | |
4392 | #else | |
e172fe11 | 4393 | #error Not supported |
d1722a27 AR |
4394 | #endif |
4395 | } | |
5f6b9e8f BS |
4396 | EOF |
4397 | if compile_prog "" "" ; then | |
4398 | fdatasync=yes | |
4399 | fi | |
4400 | ||
e78815a5 AF |
4401 | ########################################## |
4402 | # check if we have madvise | |
4403 | ||
4404 | madvise=no | |
4405 | cat > $TMPC << EOF | |
4406 | #include <sys/types.h> | |
4407 | #include <sys/mman.h> | |
832ce9c2 | 4408 | #include <stddef.h> |
e78815a5 AF |
4409 | int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } |
4410 | EOF | |
4411 | if compile_prog "" "" ; then | |
4412 | madvise=yes | |
4413 | fi | |
4414 | ||
4415 | ########################################## | |
4416 | # check if we have posix_madvise | |
4417 | ||
4418 | posix_madvise=no | |
4419 | cat > $TMPC << EOF | |
4420 | #include <sys/mman.h> | |
832ce9c2 | 4421 | #include <stddef.h> |
e78815a5 AF |
4422 | int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } |
4423 | EOF | |
4424 | if compile_prog "" "" ; then | |
4425 | posix_madvise=yes | |
4426 | fi | |
4427 | ||
0a852417 PD |
4428 | ########################################## |
4429 | # check if we have posix_syslog | |
4430 | ||
4431 | posix_syslog=no | |
4432 | cat > $TMPC << EOF | |
4433 | #include <syslog.h> | |
4434 | int main(void) { openlog("qemu", LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "configure"); return 0; } | |
4435 | EOF | |
4436 | if compile_prog "" "" ; then | |
4437 | posix_syslog=yes | |
4438 | fi | |
4439 | ||
401bc051 PM |
4440 | ########################################## |
4441 | # check if we have sem_timedwait | |
4442 | ||
4443 | sem_timedwait=no | |
4444 | cat > $TMPC << EOF | |
4445 | #include <semaphore.h> | |
4446 | int main(void) { return sem_timedwait(0, 0); } | |
4447 | EOF | |
4448 | if compile_prog "" "" ; then | |
4449 | sem_timedwait=yes | |
4450 | fi | |
4451 | ||
94a420b1 SH |
4452 | ########################################## |
4453 | # check if trace backend exists | |
4454 | ||
5b808275 | 4455 | $python "$source_path/scripts/tracetool.py" "--backends=$trace_backends" --check-backends > /dev/null 2> /dev/null |
94a420b1 | 4456 | if test "$?" -ne 0 ; then |
5b808275 LV |
4457 | error_exit "invalid trace backends" \ |
4458 | "Please choose supported trace backends." | |
94a420b1 SH |
4459 | fi |
4460 | ||
7e24e92a SH |
4461 | ########################################## |
4462 | # For 'ust' backend, test if ust headers are present | |
5b808275 | 4463 | if have_backend "ust"; then |
7e24e92a | 4464 | cat > $TMPC << EOF |
bf15f63c | 4465 | #include <lttng/tracepoint.h> |
7e24e92a SH |
4466 | int main(void) { return 0; } |
4467 | EOF | |
c79ed23d | 4468 | if compile_prog "" "-Wl,--no-as-needed -ldl" ; then |
bf15f63c | 4469 | if $pkg_config lttng-ust --exists; then |
89138857 | 4470 | lttng_ust_libs=$($pkg_config --libs lttng-ust) |
bf15f63c | 4471 | else |
c79ed23d | 4472 | lttng_ust_libs="-llttng-ust -ldl" |
bf15f63c MG |
4473 | fi |
4474 | if $pkg_config liburcu-bp --exists; then | |
89138857 | 4475 | urcu_bp_libs=$($pkg_config --libs liburcu-bp) |
bf15f63c MG |
4476 | else |
4477 | urcu_bp_libs="-lurcu-bp" | |
4478 | fi | |
4479 | ||
4480 | LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" | |
4481 | libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga" | |
7e24e92a | 4482 | else |
bf15f63c | 4483 | error_exit "Trace backend 'ust' missing lttng-ust header files" |
7e24e92a SH |
4484 | fi |
4485 | fi | |
b3d08c02 DB |
4486 | |
4487 | ########################################## | |
4488 | # For 'dtrace' backend, test if 'dtrace' command is present | |
5b808275 | 4489 | if have_backend "dtrace"; then |
b3d08c02 | 4490 | if ! has 'dtrace' ; then |
76ad07a4 | 4491 | error_exit "dtrace command is not found in PATH $PATH" |
b3d08c02 | 4492 | fi |
c276b17d DB |
4493 | trace_backend_stap="no" |
4494 | if has 'stap' ; then | |
4495 | trace_backend_stap="yes" | |
4496 | fi | |
b3d08c02 DB |
4497 | fi |
4498 | ||
023367e6 | 4499 | ########################################## |
519175a2 | 4500 | # check and set a backend for coroutine |
d0e2fce5 | 4501 | |
7c2acc70 | 4502 | # We prefer ucontext, but it's not always possible. The fallback |
33c53c54 DB |
4503 | # is sigcontext. On Windows the only valid backend is the Windows |
4504 | # specific one. | |
7c2acc70 PM |
4505 | |
4506 | ucontext_works=no | |
4507 | if test "$darwin" != "yes"; then | |
4508 | cat > $TMPC << EOF | |
d0e2fce5 | 4509 | #include <ucontext.h> |
cdf84806 PM |
4510 | #ifdef __stub_makecontext |
4511 | #error Ignoring glibc stub makecontext which will always fail | |
4512 | #endif | |
75cafad7 | 4513 | int main(void) { makecontext(0, 0, 0); return 0; } |
d0e2fce5 | 4514 | EOF |
7c2acc70 PM |
4515 | if compile_prog "" "" ; then |
4516 | ucontext_works=yes | |
4517 | fi | |
4518 | fi | |
4519 | ||
4520 | if test "$coroutine" = ""; then | |
4521 | if test "$mingw32" = "yes"; then | |
4522 | coroutine=win32 | |
4523 | elif test "$ucontext_works" = "yes"; then | |
4524 | coroutine=ucontext | |
4525 | else | |
4526 | coroutine=sigaltstack | |
d0e2fce5 | 4527 | fi |
519175a2 | 4528 | else |
7c2acc70 PM |
4529 | case $coroutine in |
4530 | windows) | |
4531 | if test "$mingw32" != "yes"; then | |
4532 | error_exit "'windows' coroutine backend only valid for Windows" | |
4533 | fi | |
4534 | # Unfortunately the user visible backend name doesn't match the | |
4535 | # coroutine-*.c filename for this case, so we have to adjust it here. | |
4536 | coroutine=win32 | |
4537 | ;; | |
4538 | ucontext) | |
4539 | if test "$ucontext_works" != "yes"; then | |
4540 | feature_not_found "ucontext" | |
4541 | fi | |
4542 | ;; | |
33c53c54 | 4543 | sigaltstack) |
7c2acc70 PM |
4544 | if test "$mingw32" = "yes"; then |
4545 | error_exit "only the 'windows' coroutine backend is valid for Windows" | |
4546 | fi | |
4547 | ;; | |
4548 | *) | |
4549 | error_exit "unknown coroutine backend $coroutine" | |
4550 | ;; | |
4551 | esac | |
d0e2fce5 AK |
4552 | fi |
4553 | ||
70c60c08 | 4554 | if test "$coroutine_pool" = ""; then |
33c53c54 | 4555 | coroutine_pool=yes |
70c60c08 SH |
4556 | fi |
4557 | ||
7d992e4d PL |
4558 | if test "$debug_stack_usage" = "yes"; then |
4559 | if test "$cpu" = "ia64" -o "$cpu" = "hppa"; then | |
4560 | error_exit "stack usage debugging is not supported for $cpu" | |
4561 | fi | |
4562 | if test "$coroutine_pool" = "yes"; then | |
4563 | echo "WARN: disabling coroutine pool for stack usage debugging" | |
4564 | coroutine_pool=no | |
4565 | fi | |
4566 | fi | |
4567 | ||
4568 | ||
d2042378 AK |
4569 | ########################################## |
4570 | # check if we have open_by_handle_at | |
4571 | ||
4e1797f9 | 4572 | open_by_handle_at=no |
d2042378 AK |
4573 | cat > $TMPC << EOF |
4574 | #include <fcntl.h> | |
acc55ba8 SW |
4575 | #if !defined(AT_EMPTY_PATH) |
4576 | # error missing definition | |
4577 | #else | |
75cafad7 | 4578 | int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } |
acc55ba8 | 4579 | #endif |
d2042378 AK |
4580 | EOF |
4581 | if compile_prog "" "" ; then | |
4582 | open_by_handle_at=yes | |
4583 | fi | |
4584 | ||
e06a765e HPB |
4585 | ######################################## |
4586 | # check if we have linux/magic.h | |
4587 | ||
4588 | linux_magic_h=no | |
4589 | cat > $TMPC << EOF | |
4590 | #include <linux/magic.h> | |
4591 | int main(void) { | |
75cafad7 | 4592 | return 0; |
e06a765e HPB |
4593 | } |
4594 | EOF | |
4595 | if compile_prog "" "" ; then | |
4596 | linux_magic_h=yes | |
4597 | fi | |
4598 | ||
06d71fa1 | 4599 | ######################################## |
c95e3080 KW |
4600 | # check whether we can disable warning option with a pragma (this is needed |
4601 | # to silence warnings in the headers of some versions of external libraries). | |
4602 | # This test has to be compiled with -Werror as otherwise an unknown pragma is | |
4603 | # only a warning. | |
4604 | # | |
4605 | # If we can't selectively disable warning in the code, disable -Werror so that | |
4606 | # the build doesn't fail anyway. | |
4607 | ||
06d71fa1 PM |
4608 | pragma_disable_unused_but_set=no |
4609 | cat > $TMPC << EOF | |
e6f53fd5 | 4610 | #pragma GCC diagnostic push |
06d71fa1 | 4611 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable" |
c95e3080 | 4612 | #pragma GCC diagnostic ignored "-Wstrict-prototypes" |
e6f53fd5 | 4613 | #pragma GCC diagnostic pop |
c95e3080 | 4614 | |
06d71fa1 PM |
4615 | int main(void) { |
4616 | return 0; | |
4617 | } | |
4618 | EOF | |
4619 | if compile_prog "-Werror" "" ; then | |
cc6e3ca9 | 4620 | pragma_diagnostic_available=yes |
c95e3080 KW |
4621 | else |
4622 | werror=no | |
06d71fa1 PM |
4623 | fi |
4624 | ||
3f4349dc | 4625 | ######################################## |
541be927 | 4626 | # check if we have valgrind/valgrind.h |
3f4349dc KW |
4627 | |
4628 | valgrind_h=no | |
4629 | cat > $TMPC << EOF | |
4630 | #include <valgrind/valgrind.h> | |
3f4349dc | 4631 | int main(void) { |
3f4349dc KW |
4632 | return 0; |
4633 | } | |
4634 | EOF | |
4635 | if compile_prog "" "" ; then | |
4636 | valgrind_h=yes | |
4637 | fi | |
4638 | ||
8ab1bf12 LC |
4639 | ######################################## |
4640 | # check if environ is declared | |
4641 | ||
4642 | has_environ=no | |
4643 | cat > $TMPC << EOF | |
4644 | #include <unistd.h> | |
4645 | int main(void) { | |
c075a723 | 4646 | environ = 0; |
8ab1bf12 LC |
4647 | return 0; |
4648 | } | |
4649 | EOF | |
4650 | if compile_prog "" "" ; then | |
4651 | has_environ=yes | |
4652 | fi | |
4653 | ||
76a347e1 RH |
4654 | ######################################## |
4655 | # check if cpuid.h is usable. | |
4656 | ||
76a347e1 RH |
4657 | cat > $TMPC << EOF |
4658 | #include <cpuid.h> | |
4659 | int main(void) { | |
774d566c PM |
4660 | unsigned a, b, c, d; |
4661 | int max = __get_cpuid_max(0, 0); | |
4662 | ||
4663 | if (max >= 1) { | |
4664 | __cpuid(1, a, b, c, d); | |
4665 | } | |
4666 | ||
4667 | if (max >= 7) { | |
4668 | __cpuid_count(7, 0, a, b, c, d); | |
4669 | } | |
4670 | ||
4671 | return 0; | |
76a347e1 RH |
4672 | } |
4673 | EOF | |
4674 | if compile_prog "" "" ; then | |
4675 | cpuid_h=yes | |
4676 | fi | |
4677 | ||
5dd89908 RH |
4678 | ########################################## |
4679 | # avx2 optimization requirement check | |
4680 | # | |
4681 | # There is no point enabling this if cpuid.h is not usable, | |
4682 | # since we won't be able to select the new routines. | |
4683 | ||
4684 | if test $cpuid_h = yes; then | |
4685 | cat > $TMPC << EOF | |
4686 | #pragma GCC push_options | |
4687 | #pragma GCC target("avx2") | |
4688 | #include <cpuid.h> | |
4689 | #include <immintrin.h> | |
4690 | static int bar(void *a) { | |
4691 | __m256i x = *(__m256i *)a; | |
4692 | return _mm256_testz_si256(x, x); | |
4693 | } | |
4694 | int main(int argc, char *argv[]) { return bar(argv[0]); } | |
4695 | EOF | |
4696 | if compile_object "" ; then | |
4697 | avx2_opt="yes" | |
4698 | fi | |
4699 | fi | |
4700 | ||
f540166b RH |
4701 | ######################################## |
4702 | # check if __[u]int128_t is usable. | |
4703 | ||
4704 | int128=no | |
4705 | cat > $TMPC << EOF | |
a00f66ab SW |
4706 | #if defined(__clang_major__) && defined(__clang_minor__) |
4707 | # if ((__clang_major__ < 3) || (__clang_major__ == 3) && (__clang_minor__ < 2)) | |
4708 | # error __int128_t does not work in CLANG before 3.2 | |
4709 | # endif | |
4710 | #endif | |
f540166b RH |
4711 | __int128_t a; |
4712 | __uint128_t b; | |
4713 | int main (void) { | |
4714 | a = a + b; | |
4715 | b = a * b; | |
464e3671 | 4716 | a = a * a; |
f540166b RH |
4717 | return 0; |
4718 | } | |
4719 | EOF | |
4720 | if compile_prog "" "" ; then | |
4721 | int128=yes | |
4722 | fi | |
76a347e1 | 4723 | |
7ebee43e RH |
4724 | ######################################### |
4725 | # See if 128-bit atomic operations are supported. | |
4726 | ||
4727 | atomic128=no | |
4728 | if test "$int128" = "yes"; then | |
4729 | cat > $TMPC << EOF | |
4730 | int main(void) | |
4731 | { | |
4732 | unsigned __int128 x = 0, y = 0; | |
4733 | y = __atomic_load_16(&x, 0); | |
4734 | __atomic_store_16(&x, y, 0); | |
4735 | __atomic_compare_exchange_16(&x, &y, x, 0, 0, 0); | |
4736 | return 0; | |
4737 | } | |
4738 | EOF | |
4739 | if compile_prog "" "" ; then | |
4740 | atomic128=yes | |
4741 | fi | |
4742 | fi | |
4743 | ||
df79b996 RH |
4744 | ######################################### |
4745 | # See if 64-bit atomic operations are supported. | |
4746 | # Note that without __atomic builtins, we can only | |
4747 | # assume atomic loads/stores max at pointer size. | |
4748 | ||
4749 | cat > $TMPC << EOF | |
4750 | #include <stdint.h> | |
4751 | int main(void) | |
4752 | { | |
4753 | uint64_t x = 0, y = 0; | |
4754 | #ifdef __ATOMIC_RELAXED | |
4755 | y = __atomic_load_8(&x, 0); | |
4756 | __atomic_store_8(&x, y, 0); | |
4757 | __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0); | |
4758 | __atomic_exchange_8(&x, y, 0); | |
4759 | __atomic_fetch_add_8(&x, y, 0); | |
4760 | #else | |
4761 | typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1]; | |
4762 | __sync_lock_test_and_set(&x, y); | |
4763 | __sync_val_compare_and_swap(&x, y, 0); | |
4764 | __sync_fetch_and_add(&x, y); | |
4765 | #endif | |
4766 | return 0; | |
4767 | } | |
4768 | EOF | |
4769 | if compile_prog "" "" ; then | |
4770 | atomic64=yes | |
4771 | fi | |
4772 | ||
1e6e9aca RH |
4773 | ######################################## |
4774 | # check if getauxval is available. | |
4775 | ||
4776 | getauxval=no | |
4777 | cat > $TMPC << EOF | |
4778 | #include <sys/auxv.h> | |
4779 | int main(void) { | |
4780 | return getauxval(AT_HWCAP) == 0; | |
4781 | } | |
4782 | EOF | |
4783 | if compile_prog "" "" ; then | |
4784 | getauxval=yes | |
4785 | fi | |
4786 | ||
fd0e6053 JS |
4787 | ######################################## |
4788 | # check if ccache is interfering with | |
4789 | # semantic analysis of macros | |
4790 | ||
5e4dfd3d | 4791 | unset CCACHE_CPP2 |
fd0e6053 JS |
4792 | ccache_cpp2=no |
4793 | cat > $TMPC << EOF | |
4794 | static const int Z = 1; | |
4795 | #define fn() ({ Z; }) | |
4796 | #define TAUT(X) ((X) == Z) | |
4797 | #define PAREN(X, Y) (X == Y) | |
4798 | #define ID(X) (X) | |
4799 | int main(int argc, char *argv[]) | |
4800 | { | |
4801 | int x = 0, y = 0; | |
4802 | x = ID(x); | |
4803 | x = fn(); | |
4804 | fn(); | |
4805 | if (PAREN(x, y)) return 0; | |
4806 | if (TAUT(Z)) return 0; | |
4807 | return 0; | |
4808 | } | |
4809 | EOF | |
4810 | ||
4811 | if ! compile_object "-Werror"; then | |
4812 | ccache_cpp2=yes | |
4813 | fi | |
4814 | ||
b553a042 JS |
4815 | ################################################# |
4816 | # clang does not support glibc + FORTIFY_SOURCE. | |
4817 | ||
4818 | if test "$fortify_source" != "no"; then | |
4819 | if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then | |
4820 | fortify_source="no"; | |
e189091f | 4821 | elif test -n "$cxx" && has $cxx && |
cfcc7c14 | 4822 | echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then |
b553a042 JS |
4823 | fortify_source="no"; |
4824 | else | |
4825 | fortify_source="yes" | |
4826 | fi | |
4827 | fi | |
4828 | ||
277abf15 JV |
4829 | ########################################## |
4830 | # check if struct fsxattr is available via linux/fs.h | |
4831 | ||
4832 | have_fsxattr=no | |
4833 | cat > $TMPC << EOF | |
4834 | #include <linux/fs.h> | |
4835 | struct fsxattr foo; | |
4836 | int main(void) { | |
4837 | return 0; | |
4838 | } | |
4839 | EOF | |
4840 | if compile_prog "" "" ; then | |
4841 | have_fsxattr=yes | |
4842 | fi | |
4843 | ||
b66e10e4 PM |
4844 | ########################################## |
4845 | # check if rtnetlink.h exists and is useful | |
575b22b1 LV |
4846 | have_rtnetlink=no |
4847 | cat > $TMPC << EOF | |
4848 | #include <linux/rtnetlink.h> | |
4849 | int main(void) { | |
4850 | return IFLA_PROTO_DOWN; | |
4851 | } | |
4852 | EOF | |
4853 | if compile_prog "" "" ; then | |
4854 | have_rtnetlink=yes | |
4855 | fi | |
4856 | ||
6a02c806 SH |
4857 | ########################################## |
4858 | # check for usable AF_VSOCK environment | |
4859 | have_af_vsock=no | |
4860 | cat > $TMPC << EOF | |
4861 | #include <errno.h> | |
4862 | #include <sys/types.h> | |
4863 | #include <sys/socket.h> | |
4864 | #if !defined(AF_VSOCK) | |
4865 | # error missing AF_VSOCK flag | |
4866 | #endif | |
4867 | #include <linux/vm_sockets.h> | |
4868 | int main(void) { | |
4869 | int sock, ret; | |
4870 | struct sockaddr_vm svm; | |
4871 | socklen_t len = sizeof(svm); | |
4872 | sock = socket(AF_VSOCK, SOCK_STREAM, 0); | |
4873 | ret = getpeername(sock, (struct sockaddr *)&svm, &len); | |
4874 | if ((ret == -1) && (errno == ENOTCONN)) { | |
4875 | return 0; | |
4876 | } | |
4877 | return -1; | |
4878 | } | |
4879 | EOF | |
4880 | if compile_prog "" "" ; then | |
4881 | have_af_vsock=yes | |
4882 | fi | |
4883 | ||
f0d92b56 LM |
4884 | ########################################## |
4885 | # check for usable AF_ALG environment | |
4886 | hava_afalg=no | |
4887 | cat > $TMPC << EOF | |
4888 | #include <errno.h> | |
4889 | #include <sys/types.h> | |
4890 | #include <sys/socket.h> | |
4891 | #include <linux/if_alg.h> | |
4892 | int main(void) { | |
4893 | int sock; | |
4894 | sock = socket(AF_ALG, SOCK_SEQPACKET, 0); | |
4895 | return sock; | |
4896 | } | |
4897 | EOF | |
4898 | if compile_prog "" "" ; then | |
4899 | have_afalg=yes | |
4900 | fi | |
4901 | if test "$crypto_afalg" = "yes" | |
4902 | then | |
4903 | if test "$have_afalg" != "yes" | |
4904 | then | |
4905 | error_exit "AF_ALG requested but could not be detected" | |
4906 | fi | |
4907 | fi | |
4908 | ||
4909 | ||
6969ec6c JC |
4910 | ################################################# |
4911 | # Sparc implicitly links with --relax, which is | |
4912 | # incompatible with -r, so --no-relax should be | |
4913 | # given. It does no harm to give it on other | |
4914 | # platforms too. | |
4915 | ||
4916 | # Note: the prototype is needed since QEMU_CFLAGS | |
4917 | # contains -Wmissing-prototypes | |
4918 | cat > $TMPC << EOF | |
4919 | extern int foo(void); | |
4920 | int foo(void) { return 0; } | |
4921 | EOF | |
4922 | if ! compile_object ""; then | |
4923 | error_exit "Failed to compile object file for LD_REL_FLAGS test" | |
4924 | fi | |
7ecf44a5 PB |
4925 | for i in '-Wl,-r -Wl,--no-relax' -Wl,-r -r; do |
4926 | if do_cc -nostdlib $i -o $TMPMO $TMPO; then | |
4927 | LD_REL_FLAGS=$i | |
4928 | break | |
4929 | fi | |
4930 | done | |
4931 | if test "$modules" = "yes" && test "$LD_REL_FLAGS" = ""; then | |
4932 | feature_not_found "modules" "Cannot find how to build relocatable objects" | |
6969ec6c JC |
4933 | fi |
4934 | ||
4d04351f CC |
4935 | ########################################## |
4936 | # check for sysmacros.h | |
4937 | ||
4938 | have_sysmacros=no | |
4939 | cat > $TMPC << EOF | |
4940 | #include <sys/sysmacros.h> | |
4941 | int main(void) { | |
4942 | return makedev(0, 0); | |
4943 | } | |
4944 | EOF | |
4945 | if compile_prog "" "" ; then | |
4946 | have_sysmacros=yes | |
4947 | fi | |
4948 | ||
da92c3ff AM |
4949 | ########################################## |
4950 | # Veritas HyperScale block driver VxHS | |
4951 | # Check if libvxhs is installed | |
4952 | ||
4953 | if test "$vxhs" != "no" ; then | |
4954 | cat > $TMPC <<EOF | |
4955 | #include <stdint.h> | |
4956 | #include <qnio/qnio_api.h> | |
4957 | ||
4958 | void *vxhs_callback; | |
4959 | ||
4960 | int main(void) { | |
4961 | iio_init(QNIO_VERSION, vxhs_callback); | |
4962 | return 0; | |
4963 | } | |
4964 | EOF | |
4965 | vxhs_libs="-lvxhs -lssl" | |
4966 | if compile_prog "" "$vxhs_libs" ; then | |
4967 | vxhs=yes | |
4968 | else | |
4969 | if test "$vxhs" = "yes" ; then | |
4970 | feature_not_found "vxhs block device" "Install libvxhs See github" | |
4971 | fi | |
4972 | vxhs=no | |
4973 | fi | |
4974 | fi | |
4975 | ||
49e00a18 AG |
4976 | ########################################## |
4977 | # check for _Static_assert() | |
4978 | ||
4979 | have_static_assert=no | |
4980 | cat > $TMPC << EOF | |
4981 | _Static_assert(1, "success"); | |
4982 | int main(void) { | |
4983 | return 0; | |
4984 | } | |
4985 | EOF | |
4986 | if compile_prog "" "" ; then | |
4987 | have_static_assert=yes | |
4988 | fi | |
4989 | ||
e674605f TG |
4990 | ########################################## |
4991 | # check for utmpx.h, it is missing e.g. on OpenBSD | |
4992 | ||
4993 | have_utmpx=no | |
4994 | cat > $TMPC << EOF | |
4995 | #include <utmpx.h> | |
4996 | struct utmpx user_info; | |
4997 | int main(void) { | |
4998 | return 0; | |
4999 | } | |
5000 | EOF | |
5001 | if compile_prog "" "" ; then | |
5002 | have_utmpx=yes | |
5003 | fi | |
5004 | ||
7e24e92a | 5005 | ########################################## |
e86ecd4b JQ |
5006 | # End of CC checks |
5007 | # After here, no more $cc or $ld runs | |
5008 | ||
1d728c39 BS |
5009 | if test "$gcov" = "yes" ; then |
5010 | CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" | |
5011 | LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" | |
b553a042 | 5012 | elif test "$fortify_source" = "yes" ; then |
e600cdf3 | 5013 | CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" |
ce278618 PM |
5014 | elif test "$debug" = "no"; then |
5015 | CFLAGS="-O2 $CFLAGS" | |
e86ecd4b | 5016 | fi |
a316e378 | 5017 | |
6542aa9c PL |
5018 | ########################################## |
5019 | # Do we have libnfs | |
5020 | if test "$libnfs" != "no" ; then | |
b7d769c9 | 5021 | if $pkg_config --atleast-version=1.9.3 libnfs; then |
6542aa9c PL |
5022 | libnfs="yes" |
5023 | libnfs_libs=$($pkg_config --libs libnfs) | |
6542aa9c PL |
5024 | else |
5025 | if test "$libnfs" = "yes" ; then | |
8efc9363 | 5026 | feature_not_found "libnfs" "Install libnfs devel >= 1.9.3" |
6542aa9c PL |
5027 | fi |
5028 | libnfs="no" | |
5029 | fi | |
5030 | fi | |
1d728c39 | 5031 | |
6ca026cb PM |
5032 | # Now we've finished running tests it's OK to add -Werror to the compiler flags |
5033 | if test "$werror" = "yes"; then | |
5034 | QEMU_CFLAGS="-Werror $QEMU_CFLAGS" | |
5035 | fi | |
5036 | ||
e86ecd4b JQ |
5037 | if test "$solaris" = "no" ; then |
5038 | if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then | |
1156c669 | 5039 | LDFLAGS="-Wl,--warn-common $LDFLAGS" |
e86ecd4b JQ |
5040 | fi |
5041 | fi | |
5042 | ||
94dd53c5 GH |
5043 | # test if pod2man has --utf8 option |
5044 | if pod2man --help | grep -q utf8; then | |
5045 | POD2MAN="pod2man --utf8" | |
5046 | else | |
5047 | POD2MAN="pod2man" | |
5048 | fi | |
5049 | ||
952afb71 BS |
5050 | # Use ASLR, no-SEH and DEP if available |
5051 | if test "$mingw32" = "yes" ; then | |
5052 | for flag in --dynamicbase --no-seh --nxcompat; do | |
e9a3591f | 5053 | if ld_has $flag ; then |
952afb71 BS |
5054 | LDFLAGS="-Wl,$flag $LDFLAGS" |
5055 | fi | |
5056 | done | |
5057 | fi | |
5058 | ||
10ea68b3 | 5059 | qemu_confdir=$sysconfdir$confsuffix |
e26110cf | 5060 | qemu_moddir=$libdir$confsuffix |
528ae5b8 | 5061 | qemu_datadir=$datadir$confsuffix |
834574ea | 5062 | qemu_localedir="$datadir/locale" |
e7b45cc4 | 5063 | |
e0580342 KR |
5064 | # We can only support ivshmem if we have eventfd |
5065 | if [ "$eventfd" = "yes" ]; then | |
5066 | ivshmem=yes | |
5067 | fi | |
5068 | ||
4b1c11fd DB |
5069 | tools="" |
5070 | if test "$want_tools" = "yes" ; then | |
ca35f780 | 5071 | tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" |
4b1c11fd DB |
5072 | if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then |
5073 | tools="qemu-nbd\$(EXESUF) $tools" | |
b1449edb KR |
5074 | fi |
5075 | if [ "$ivshmem" = "yes" ]; then | |
a75eb03b | 5076 | tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" |
4b1c11fd DB |
5077 | fi |
5078 | fi | |
5079 | if test "$softmmu" = yes ; then | |
b855f8d1 PB |
5080 | if test "$linux" = yes; then |
5081 | if test "$virtfs" != no && test "$cap" = yes && test "$attr" = yes ; then | |
aabfd88d AF |
5082 | virtfs=yes |
5083 | tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" | |
5084 | else | |
5085 | if test "$virtfs" = yes; then | |
b855f8d1 | 5086 | error_exit "VirtFS requires libcap devel and libattr devel" |
983eef5a | 5087 | fi |
17500370 | 5088 | virtfs=no |
aabfd88d | 5089 | fi |
fe8fc5ae PB |
5090 | if test "$mpath" != no && test "$mpathpersist" = yes ; then |
5091 | mpath=yes | |
5092 | else | |
5093 | if test "$mpath" = yes; then | |
5094 | error_exit "Multipath requires libmpathpersist devel" | |
5095 | fi | |
5096 | mpath=no | |
5097 | fi | |
b855f8d1 PB |
5098 | tools="$tools scsi/qemu-pr-helper\$(EXESUF)" |
5099 | else | |
5100 | if test "$virtfs" = yes; then | |
5101 | error_exit "VirtFS is supported only on Linux" | |
5102 | fi | |
5103 | virtfs=no | |
fe8fc5ae PB |
5104 | if test "$mpath" = yes; then |
5105 | error_exit "Multipath is supported only on Linux" | |
5106 | fi | |
5107 | mpath=no | |
17bff52b | 5108 | fi |
e8ef31a3 | 5109 | fi |
9d6bc27b MR |
5110 | |
5111 | # Probe for guest agent support/options | |
5112 | ||
e8ef31a3 | 5113 | if [ "$guest_agent" != "no" ]; then |
b39297ae | 5114 | if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then |
fafcaf1d | 5115 | tools="qemu-ga $tools" |
e8ef31a3 MT |
5116 | guest_agent=yes |
5117 | elif [ "$guest_agent" != yes ]; then | |
5118 | guest_agent=no | |
5119 | else | |
5120 | error_exit "Guest agent is not supported on this platform" | |
ca35f780 | 5121 | fi |
00c705fb | 5122 | fi |
ca35f780 | 5123 | |
9d6bc27b MR |
5124 | # Guest agent Window MSI package |
5125 | ||
5126 | if test "$guest_agent" != yes; then | |
5127 | if test "$guest_agent_msi" = yes; then | |
5128 | error_exit "MSI guest agent package requires guest agent enabled" | |
5129 | fi | |
5130 | guest_agent_msi=no | |
5131 | elif test "$mingw32" != "yes"; then | |
5132 | if test "$guest_agent_msi" = "yes"; then | |
5133 | error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation" | |
5134 | fi | |
5135 | guest_agent_msi=no | |
5136 | elif ! has wixl; then | |
5137 | if test "$guest_agent_msi" = "yes"; then | |
5138 | error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )" | |
5139 | fi | |
5140 | guest_agent_msi=no | |
1a34904e MR |
5141 | else |
5142 | # we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wasn't | |
5143 | # disabled explicitly | |
5144 | if test "$guest_agent_msi" != "no"; then | |
5145 | guest_agent_msi=yes | |
5146 | fi | |
9d6bc27b MR |
5147 | fi |
5148 | ||
1a34904e | 5149 | if test "$guest_agent_msi" = "yes"; then |
9d6bc27b MR |
5150 | if test "$guest_agent_with_vss" = "yes"; then |
5151 | QEMU_GA_MSI_WITH_VSS="-D InstallVss" | |
5152 | fi | |
5153 | ||
5154 | if test "$QEMU_GA_MANUFACTURER" = ""; then | |
5155 | QEMU_GA_MANUFACTURER=QEMU | |
5156 | fi | |
5157 | ||
5158 | if test "$QEMU_GA_DISTRO" = ""; then | |
5159 | QEMU_GA_DISTRO=Linux | |
5160 | fi | |
5161 | ||
5162 | if test "$QEMU_GA_VERSION" = ""; then | |
89138857 | 5163 | QEMU_GA_VERSION=$(cat $source_path/VERSION) |
9d6bc27b MR |
5164 | fi |
5165 | ||
89138857 | 5166 | QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=$($pkg_config --variable=prefix glib-2.0)/bin" |
9d6bc27b MR |
5167 | |
5168 | case "$cpu" in | |
5169 | x86_64) | |
5170 | QEMU_GA_MSI_ARCH="-a x64 -D Arch=64" | |
5171 | ;; | |
5172 | i386) | |
5173 | QEMU_GA_MSI_ARCH="-D Arch=32" | |
5174 | ;; | |
5175 | *) | |
5176 | error_exit "CPU $cpu not supported for building installation package" | |
5177 | ;; | |
5178 | esac | |
5179 | fi | |
5180 | ||
ca35f780 PB |
5181 | # Mac OS X ships with a broken assembler |
5182 | roms= | |
5183 | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ | |
5184 | "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ | |
5185 | "$softmmu" = yes ; then | |
e57218b6 PM |
5186 | # Different host OS linkers have different ideas about the name of the ELF |
5187 | # emulation. Linux and OpenBSD use 'elf_i386'; FreeBSD uses the _fbsd | |
5188 | # variant; and Windows uses i386pe. | |
5189 | for emu in elf_i386 elf_i386_fbsd i386pe; do | |
5190 | if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then | |
5191 | ld_i386_emulation="$emu" | |
5192 | roms="optionrom" | |
5193 | break | |
5194 | fi | |
5195 | done | |
ca35f780 | 5196 | fi |
d0384d1d | 5197 | if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then |
39ac8455 DG |
5198 | roms="$roms spapr-rtas" |
5199 | fi | |
ca35f780 | 5200 | |
9933c305 CB |
5201 | if test "$cpu" = "s390x" ; then |
5202 | roms="$roms s390-ccw" | |
5203 | fi | |
5204 | ||
964c6fa1 | 5205 | # Probe for the need for relocating the user-only binary. |
92fe2ba8 | 5206 | if ( [ "$linux_user" = yes ] || [ "$bsd_user" = yes ] ) && [ "$pie" = no ]; then |
964c6fa1 RH |
5207 | textseg_addr= |
5208 | case "$cpu" in | |
479eb121 RH |
5209 | arm | i386 | ppc* | s390* | sparc* | x86_64 | x32) |
5210 | # ??? Rationale for choosing this address | |
964c6fa1 RH |
5211 | textseg_addr=0x60000000 |
5212 | ;; | |
5213 | mips) | |
479eb121 RH |
5214 | # A 256M aligned address, high in the address space, with enough |
5215 | # room for the code_gen_buffer above it before the stack. | |
5216 | textseg_addr=0x60000000 | |
964c6fa1 RH |
5217 | ;; |
5218 | esac | |
5219 | if [ -n "$textseg_addr" ]; then | |
5220 | cat > $TMPC <<EOF | |
5221 | int main(void) { return 0; } | |
5222 | EOF | |
5223 | textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" | |
5224 | if ! compile_prog "" "$textseg_ldflags"; then | |
5225 | # In case ld does not support -Ttext-segment, edit the default linker | |
5226 | # script via sed to set the .text start addr. This is needed on FreeBSD | |
5227 | # at least. | |
92fe2ba8 PM |
5228 | if ! $ld --verbose >/dev/null 2>&1; then |
5229 | error_exit \ | |
5230 | "We need to link the QEMU user mode binaries at a" \ | |
5231 | "specific text address. Unfortunately your linker" \ | |
5232 | "doesn't support either the -Ttext-segment option or" \ | |
5233 | "printing the default linker script with --verbose." \ | |
5234 | "If you don't want the user mode binaries, pass the" \ | |
5235 | "--disable-user option to configure." | |
5236 | fi | |
5237 | ||
964c6fa1 RH |
5238 | $ld --verbose | sed \ |
5239 | -e '1,/==================================================/d' \ | |
5240 | -e '/==================================================/,$d' \ | |
5241 | -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ | |
5242 | -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld | |
5243 | textseg_ldflags="-Wl,-T../config-host.ld" | |
5244 | fi | |
5245 | fi | |
5246 | fi | |
5247 | ||
11cde1c8 BD |
5248 | # Check that the C++ compiler exists and works with the C compiler. |
5249 | # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. | |
5250 | if has $cxx; then | |
5251 | cat > $TMPC <<EOF | |
5252 | int c_function(void); | |
5253 | int main(void) { return c_function(); } | |
5254 | EOF | |
5255 | ||
5256 | compile_object | |
5257 | ||
5258 | cat > $TMPCXX <<EOF | |
5259 | extern "C" { | |
5260 | int c_function(void); | |
5261 | } | |
5262 | int c_function(void) { return 42; } | |
5263 | EOF | |
5264 | ||
5265 | update_cxxflags | |
5266 | ||
5267 | if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $LDFLAGS; then | |
5268 | # C++ compiler $cxx works ok with C compiler $cc | |
5269 | : | |
5270 | else | |
5271 | echo "C++ compiler $cxx does not work with C compiler $cc" | |
5272 | echo "Disabling C++ specific optional code" | |
5273 | cxx= | |
5274 | fi | |
5275 | else | |
5276 | echo "No C++ compiler available; disabling C++ specific optional code" | |
5277 | cxx= | |
5278 | fi | |
5279 | ||
02d34f62 CR |
5280 | echo_version() { |
5281 | if test "$1" = "yes" ; then | |
5282 | echo "($2)" | |
5283 | fi | |
5284 | } | |
5285 | ||
50e12060 JK |
5286 | # prepend pixman and ftd flags after all config tests are done |
5287 | QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS" | |
5288 | libs_softmmu="$pixman_libs $libs_softmmu" | |
5ca9388a | 5289 | |
43ce4dfe | 5290 | echo "Install prefix $prefix" |
89138857 | 5291 | echo "BIOS directory $(eval echo $qemu_datadir)" |
3d5eecab | 5292 | echo "firmware path $(eval echo $firmwarepath)" |
89138857 SW |
5293 | echo "binary directory $(eval echo $bindir)" |
5294 | echo "library directory $(eval echo $libdir)" | |
5295 | echo "module directory $(eval echo $qemu_moddir)" | |
5296 | echo "libexec directory $(eval echo $libexecdir)" | |
5297 | echo "include directory $(eval echo $includedir)" | |
5298 | echo "config directory $(eval echo $sysconfdir)" | |
11d9f695 | 5299 | if test "$mingw32" = "no" ; then |
89138857 SW |
5300 | echo "local state directory $(eval echo $local_statedir)" |
5301 | echo "Manual directory $(eval echo $mandir)" | |
43ce4dfe | 5302 | echo "ELF interp prefix $interp_prefix" |
5a699bbb LE |
5303 | else |
5304 | echo "local state directory queried at runtime" | |
d9840e25 | 5305 | echo "Windows SDK $win_sdk" |
11d9f695 | 5306 | fi |
5a67135a | 5307 | echo "Source path $source_path" |
aef45d51 | 5308 | echo "GIT submodules $git_submodules" |
43ce4dfe | 5309 | echo "C compiler $cc" |
83469015 | 5310 | echo "Host C compiler $host_cc" |
83f73fce | 5311 | echo "C++ compiler $cxx" |
3c4a4d0d | 5312 | echo "Objective-C compiler $objcc" |
45d285ab | 5313 | echo "ARFLAGS $ARFLAGS" |
0c439cbf | 5314 | echo "CFLAGS $CFLAGS" |
a558ee17 | 5315 | echo "QEMU_CFLAGS $QEMU_CFLAGS" |
0c439cbf | 5316 | echo "LDFLAGS $LDFLAGS" |
43ce4dfe | 5317 | echo "make $make" |
6a882643 | 5318 | echo "install $install" |
c886edfb | 5319 | echo "python $python" |
e2d8830e BS |
5320 | if test "$slirp" = "yes" ; then |
5321 | echo "smbd $smbd" | |
5322 | fi | |
17969268 | 5323 | echo "module support $modules" |
43ce4dfe | 5324 | echo "host CPU $cpu" |
de83cd02 | 5325 | echo "host big endian $bigendian" |
97a847bc | 5326 | echo "target list $target_list" |
43ce4dfe | 5327 | echo "gprof enabled $gprof" |
03b4fe7d | 5328 | echo "sparse enabled $sparse" |
1625af87 | 5329 | echo "strip binaries $strip_opt" |
05c2a3e7 | 5330 | echo "profiler $profiler" |
43ce4dfe | 5331 | echo "static build $static" |
5b0753e0 FB |
5332 | if test "$darwin" = "yes" ; then |
5333 | echo "Cocoa support $cocoa" | |
5334 | fi | |
89138857 SW |
5335 | echo "SDL support $sdl $(echo_version $sdl $sdlversion)" |
5336 | echo "GTK support $gtk $(echo_version $gtk $gtk_version)" | |
925a0400 | 5337 | echo "GTK GL support $gtk_gl" |
89138857 | 5338 | echo "VTE support $vte $(echo_version $vte $vteversion)" |
a1c5e949 | 5339 | echo "TLS priority $tls_priority" |
ddbb0d09 | 5340 | echo "GNUTLS support $gnutls" |
b917da4c | 5341 | echo "GNUTLS rnd $gnutls_rnd" |
91bfcdb0 | 5342 | echo "libgcrypt $gcrypt" |
37788f25 | 5343 | echo "libgcrypt kdf $gcrypt_kdf" |
89138857 | 5344 | echo "nettle $nettle $(echo_version $nettle $nettle_version)" |
fff2f982 | 5345 | echo "nettle kdf $nettle_kdf" |
9a2fd434 | 5346 | echo "libtasn1 $tasn1" |
4d3b6f6e | 5347 | echo "curses support $curses" |
9d9e1521 | 5348 | echo "virgl support $virglrenderer" |
769ce76d | 5349 | echo "curl support $curl" |
67b915a5 | 5350 | echo "mingw32 support $mingw32" |
0c58ac1c | 5351 | echo "Audio drivers $audio_drv_list" |
b64ec4e4 FZ |
5352 | echo "Block whitelist (rw) $block_drv_rw_whitelist" |
5353 | echo "Block whitelist (ro) $block_drv_ro_whitelist" | |
983eef5a | 5354 | echo "VirtFS support $virtfs" |
fe8fc5ae | 5355 | echo "Multipath support $mpath" |
821601ea JS |
5356 | echo "VNC support $vnc" |
5357 | if test "$vnc" = "yes" ; then | |
821601ea JS |
5358 | echo "VNC SASL support $vnc_sasl" |
5359 | echo "VNC JPEG support $vnc_jpeg" | |
5360 | echo "VNC PNG support $vnc_png" | |
821601ea | 5361 | fi |
3142255c BS |
5362 | if test -n "$sparc_cpu"; then |
5363 | echo "Target Sparc Arch $sparc_cpu" | |
5364 | fi | |
e37630ca | 5365 | echo "xen support $xen" |
3996e85c PD |
5366 | if test "$xen" = "yes" ; then |
5367 | echo "xen ctrl version $xen_ctrl_version" | |
64a7ad6f | 5368 | echo "pv dom build $xen_pv_domain_build" |
3996e85c | 5369 | fi |
2e4d9fb1 | 5370 | echo "brlapi support $brlapi" |
a20a6f46 | 5371 | echo "bluez support $bluez" |
a25dba17 | 5372 | echo "Documentation $docs" |
40d6444e | 5373 | echo "PIE $pie" |
8a16d273 | 5374 | echo "vde support $vde" |
58952137 | 5375 | echo "netmap support $netmap" |
5c6c3a6c | 5376 | echo "Linux AIO support $linux_aio" |
758e8e38 | 5377 | echo "ATTR/XATTR support $attr" |
77755340 | 5378 | echo "Install blobs $blobs" |
b31a0277 | 5379 | echo "KVM support $kvm" |
b0cb0a66 | 5380 | echo "HAX support $hax" |
b3f6ea7e PB |
5381 | echo "TCG support $tcg" |
5382 | if test "$tcg" = "yes" ; then | |
5383 | echo "TCG debug enabled $debug_tcg" | |
5384 | echo "TCG interpreter $tcg_interpreter" | |
5385 | fi | |
2da776db | 5386 | echo "RDMA support $rdma" |
f652e6af | 5387 | echo "fdt support $fdt" |
ceb42de8 | 5388 | echo "preadv support $preadv" |
5f6b9e8f | 5389 | echo "fdatasync $fdatasync" |
e78815a5 AF |
5390 | echo "madvise $madvise" |
5391 | echo "posix_madvise $posix_madvise" | |
47e98658 | 5392 | echo "libcap-ng support $cap_ng" |
d5970055 | 5393 | echo "vhost-net support $vhost_net" |
5e9be92d | 5394 | echo "vhost-scsi support $vhost_scsi" |
fc0b9b0e | 5395 | echo "vhost-vsock support $vhost_vsock" |
e6a74868 | 5396 | echo "vhost-user support $vhost_user" |
5b808275 | 5397 | echo "Trace backends $trace_backends" |
713572a7 | 5398 | if have_backend "simple"; then |
9410b56c | 5399 | echo "Trace output file $trace_file-<pid>" |
e00e36fb | 5400 | fi |
89138857 | 5401 | echo "spice support $spice $(echo_version $spice $spice_protocol_version/$spice_server_version)" |
f27aaf4b | 5402 | echo "rbd support $rbd" |
dce512de | 5403 | echo "xfsctl support $xfs" |
7b02f544 | 5404 | echo "smartcard support $smartcard" |
2b2325ff | 5405 | echo "libusb $libusb" |
69354a83 | 5406 | echo "usb net redir $usb_redir" |
da076ffe | 5407 | echo "OpenGL support $opengl" |
014cb152 | 5408 | echo "OpenGL dmabufs $opengl_dmabuf" |
c589b249 | 5409 | echo "libiscsi support $libiscsi" |
6542aa9c | 5410 | echo "libnfs support $libnfs" |
d138cee9 | 5411 | echo "build guest agent $guest_agent" |
d9840e25 | 5412 | echo "QGA VSS support $guest_agent_with_vss" |
50cbebb9 | 5413 | echo "QGA w32 disk info $guest_agent_ntddscsi" |
4c875d89 | 5414 | echo "QGA MSI support $guest_agent_msi" |
f794573e | 5415 | echo "seccomp support $seccomp" |
7c2acc70 | 5416 | echo "coroutine backend $coroutine" |
70c60c08 | 5417 | echo "coroutine pool $coroutine_pool" |
7d992e4d | 5418 | echo "debug stack usage $debug_stack_usage" |
f0d92b56 | 5419 | echo "crypto afalg $crypto_afalg" |
eb100396 | 5420 | echo "GlusterFS support $glusterfs" |
1d728c39 BS |
5421 | echo "gcov $gcov_tool" |
5422 | echo "gcov enabled $gcov" | |
ab214c29 | 5423 | echo "TPM support $tpm" |
0a12ec87 | 5424 | echo "libssh2 support $libssh2" |
3b8acc11 | 5425 | echo "TPM passthrough $tpm_passthrough" |
3556c233 | 5426 | echo "QOM debugging $qom_cast_debug" |
ed1701c6 | 5427 | echo "Live block migration $live_block_migration" |
607dacd0 QN |
5428 | echo "lzo support $lzo" |
5429 | echo "snappy support $snappy" | |
6b383c08 | 5430 | echo "bzip2 support $bzip2" |
a99d57bb | 5431 | echo "NUMA host support $numa" |
2847b469 | 5432 | echo "tcmalloc support $tcmalloc" |
7b01cb97 | 5433 | echo "jemalloc support $jemalloc" |
99f2dbd3 | 5434 | echo "avx2 optimization $avx2_opt" |
a6b1d4c0 | 5435 | echo "replication support $replication" |
da92c3ff | 5436 | echo "VxHS block device $vxhs" |
67b915a5 | 5437 | |
1ba16968 | 5438 | if test "$sdl_too_old" = "yes"; then |
24b55b96 | 5439 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
7c1f25b4 | 5440 | fi |
7d13299d | 5441 | |
898be3e0 PM |
5442 | if test "$supported_cpu" = "no"; then |
5443 | echo | |
5444 | echo "WARNING: SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!" | |
5445 | echo | |
5446 | echo "CPU host architecture $cpu support is not currently maintained." | |
5447 | echo "The QEMU project intends to remove support for this host CPU in" | |
5448 | echo "a future release if nobody volunteers to maintain it and to" | |
5449 | echo "provide a build host for our continuous integration setup." | |
5450 | echo "configure has succeeded and you can continue to build, but" | |
5451 | echo "if you care about QEMU on this platform you should contact" | |
5452 | echo "us upstream at qemu-devel@nongnu.org." | |
5453 | fi | |
5454 | ||
5455 | if test "$supported_os" = "no"; then | |
5456 | echo | |
5457 | echo "WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!" | |
5458 | echo | |
c50126aa PM |
5459 | echo "Host OS $targetos support is not currently maintained." |
5460 | echo "The QEMU project intends to remove support for this host OS in" | |
898be3e0 PM |
5461 | echo "a future release if nobody volunteers to maintain it and to" |
5462 | echo "provide a build host for our continuous integration setup." | |
5463 | echo "configure has succeeded and you can continue to build, but" | |
5464 | echo "if you care about QEMU on this platform you should contact" | |
5465 | echo "us upstream at qemu-devel@nongnu.org." | |
5466 | fi | |
5467 | ||
98ec69ac | 5468 | config_host_mak="config-host.mak" |
98ec69ac | 5469 | |
dbd99ae3 SW |
5470 | echo "# Automatically generated by configure - do not modify" >config-all-disas.mak |
5471 | ||
98ec69ac | 5472 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
98ec69ac | 5473 | echo >> $config_host_mak |
98ec69ac | 5474 | |
e6c3b0f7 | 5475 | echo all: >> $config_host_mak |
99d7cc75 PB |
5476 | echo "prefix=$prefix" >> $config_host_mak |
5477 | echo "bindir=$bindir" >> $config_host_mak | |
3aa5d2be | 5478 | echo "libdir=$libdir" >> $config_host_mak |
8bf188aa | 5479 | echo "libexecdir=$libexecdir" >> $config_host_mak |
0f94d6da | 5480 | echo "includedir=$includedir" >> $config_host_mak |
99d7cc75 | 5481 | echo "mandir=$mandir" >> $config_host_mak |
99d7cc75 | 5482 | echo "sysconfdir=$sysconfdir" >> $config_host_mak |
22d07038 | 5483 | echo "qemu_confdir=$qemu_confdir" >> $config_host_mak |
9afa52ce | 5484 | echo "qemu_datadir=$qemu_datadir" >> $config_host_mak |
3d5eecab | 5485 | echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak |
9afa52ce | 5486 | echo "qemu_docdir=$qemu_docdir" >> $config_host_mak |
e26110cf | 5487 | echo "qemu_moddir=$qemu_moddir" >> $config_host_mak |
5a699bbb LE |
5488 | if test "$mingw32" = "no" ; then |
5489 | echo "qemu_localstatedir=$local_statedir" >> $config_host_mak | |
5490 | fi | |
f354b1a1 | 5491 | echo "qemu_helperdir=$libexecdir" >> $config_host_mak |
f9943cd5 | 5492 | echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak |
11cde1c8 | 5493 | echo "extra_cxxflags=$EXTRA_CXXFLAGS" >> $config_host_mak |
f9943cd5 | 5494 | echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak |
834574ea | 5495 | echo "qemu_localedir=$qemu_localedir" >> $config_host_mak |
f544a488 | 5496 | echo "libs_softmmu=$libs_softmmu" >> $config_host_mak |
aef45d51 | 5497 | echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak |
804edf29 | 5498 | |
98ec69ac | 5499 | echo "ARCH=$ARCH" >> $config_host_mak |
727e5283 | 5500 | |
f8393946 | 5501 | if test "$debug_tcg" = "yes" ; then |
2358a494 | 5502 | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
f8393946 | 5503 | fi |
1625af87 | 5504 | if test "$strip_opt" = "yes" ; then |
52ba784d | 5505 | echo "STRIP=${strip}" >> $config_host_mak |
1625af87 | 5506 | fi |
7d13299d | 5507 | if test "$bigendian" = "yes" ; then |
e2542fe2 | 5508 | echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak |
97a847bc | 5509 | fi |
67b915a5 | 5510 | if test "$mingw32" = "yes" ; then |
98ec69ac | 5511 | echo "CONFIG_WIN32=y" >> $config_host_mak |
89138857 | 5512 | rc_version=$(cat $source_path/VERSION) |
9fe6de94 BS |
5513 | version_major=${rc_version%%.*} |
5514 | rc_version=${rc_version#*.} | |
5515 | version_minor=${rc_version%%.*} | |
5516 | rc_version=${rc_version#*.} | |
5517 | version_subminor=${rc_version%%.*} | |
5518 | version_micro=0 | |
5519 | echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak | |
5520 | echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak | |
d9840e25 TS |
5521 | if test "$guest_agent_with_vss" = "yes" ; then |
5522 | echo "CONFIG_QGA_VSS=y" >> $config_host_mak | |
f33ca81f | 5523 | echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak |
d9840e25 TS |
5524 | echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak |
5525 | fi | |
50cbebb9 MR |
5526 | if test "$guest_agent_ntddscsi" = "yes" ; then |
5527 | echo "CONFIG_QGA_NTDDDISK=y" >> $config_host_mak | |
5528 | fi | |
1a34904e | 5529 | if test "$guest_agent_msi" = "yes"; then |
9dacf32d YH |
5530 | echo "QEMU_GA_MSI_ENABLED=yes" >> $config_host_mak |
5531 | echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak | |
5532 | echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak | |
5533 | echo "QEMU_GA_MSI_ARCH=${QEMU_GA_MSI_ARCH}" >> $config_host_mak | |
5534 | echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak | |
5535 | echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak | |
5536 | echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak | |
5537 | fi | |
210fa556 | 5538 | else |
35f4df27 | 5539 | echo "CONFIG_POSIX=y" >> $config_host_mak |
dffcb71c MM |
5540 | fi |
5541 | ||
5542 | if test "$linux" = "yes" ; then | |
5543 | echo "CONFIG_LINUX=y" >> $config_host_mak | |
67b915a5 | 5544 | fi |
128ab2ff | 5545 | |
83fb7adf | 5546 | if test "$darwin" = "yes" ; then |
98ec69ac | 5547 | echo "CONFIG_DARWIN=y" >> $config_host_mak |
83fb7adf | 5548 | fi |
b29fe3ed | 5549 | |
ec530c81 | 5550 | if test "$solaris" = "yes" ; then |
98ec69ac | 5551 | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
ec530c81 | 5552 | fi |
179cf400 AF |
5553 | if test "$haiku" = "yes" ; then |
5554 | echo "CONFIG_HAIKU=y" >> $config_host_mak | |
5555 | fi | |
97a847bc | 5556 | if test "$static" = "yes" ; then |
98ec69ac | 5557 | echo "CONFIG_STATIC=y" >> $config_host_mak |
7d13299d | 5558 | fi |
1ba16968 | 5559 | if test "$profiler" = "yes" ; then |
2358a494 | 5560 | echo "CONFIG_PROFILER=y" >> $config_host_mak |
05c2a3e7 | 5561 | fi |
c20709aa | 5562 | if test "$slirp" = "yes" ; then |
98ec69ac | 5563 | echo "CONFIG_SLIRP=y" >> $config_host_mak |
e2d8830e | 5564 | echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak |
c20709aa | 5565 | fi |
8a16d273 | 5566 | if test "$vde" = "yes" ; then |
98ec69ac | 5567 | echo "CONFIG_VDE=y" >> $config_host_mak |
e2ad6f16 | 5568 | echo "VDE_LIBS=$vde_libs" >> $config_host_mak |
8a16d273 | 5569 | fi |
58952137 VM |
5570 | if test "$netmap" = "yes" ; then |
5571 | echo "CONFIG_NETMAP=y" >> $config_host_mak | |
5572 | fi | |
015a33bd GA |
5573 | if test "$l2tpv3" = "yes" ; then |
5574 | echo "CONFIG_L2TPV3=y" >> $config_host_mak | |
5575 | fi | |
47e98658 CB |
5576 | if test "$cap_ng" = "yes" ; then |
5577 | echo "CONFIG_LIBCAP=y" >> $config_host_mak | |
5578 | fi | |
2358a494 | 5579 | echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak |
0c58ac1c | 5580 | for drv in $audio_drv_list; do |
89138857 | 5581 | def=CONFIG_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]') |
98ec69ac | 5582 | echo "$def=y" >> $config_host_mak |
0c58ac1c | 5583 | done |
b1149911 FZ |
5584 | echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak |
5585 | echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak | |
5586 | echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak | |
5587 | echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak | |
5588 | echo "OSS_LIBS=$oss_libs" >> $config_host_mak | |
67f86e8e JQ |
5589 | if test "$audio_pt_int" = "yes" ; then |
5590 | echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak | |
5591 | fi | |
d5631638 | 5592 | if test "$audio_win_int" = "yes" ; then |
5593 | echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak | |
5594 | fi | |
b64ec4e4 FZ |
5595 | echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak |
5596 | echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak | |
821601ea JS |
5597 | if test "$vnc" = "yes" ; then |
5598 | echo "CONFIG_VNC=y" >> $config_host_mak | |
5599 | fi | |
2f9606b3 | 5600 | if test "$vnc_sasl" = "yes" ; then |
98ec69ac | 5601 | echo "CONFIG_VNC_SASL=y" >> $config_host_mak |
2f9606b3 | 5602 | fi |
821601ea | 5603 | if test "$vnc_jpeg" = "yes" ; then |
2f6f5c7a | 5604 | echo "CONFIG_VNC_JPEG=y" >> $config_host_mak |
2f6f5c7a | 5605 | fi |
821601ea | 5606 | if test "$vnc_png" = "yes" ; then |
efe556ad | 5607 | echo "CONFIG_VNC_PNG=y" >> $config_host_mak |
efe556ad | 5608 | fi |
76655d6d | 5609 | if test "$fnmatch" = "yes" ; then |
2358a494 | 5610 | echo "CONFIG_FNMATCH=y" >> $config_host_mak |
76655d6d | 5611 | fi |
dce512de CH |
5612 | if test "$xfs" = "yes" ; then |
5613 | echo "CONFIG_XFS=y" >> $config_host_mak | |
5614 | fi | |
89138857 | 5615 | qemu_version=$(head $source_path/VERSION) |
98ec69ac | 5616 | echo "VERSION=$qemu_version" >>$config_host_mak |
2358a494 | 5617 | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
98ec69ac | 5618 | echo "SRC_PATH=$source_path" >> $config_host_mak |
98ec69ac | 5619 | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
a25dba17 | 5620 | if [ "$docs" = "yes" ] ; then |
98ec69ac | 5621 | echo "BUILD_DOCS=yes" >> $config_host_mak |
cc8ae6de | 5622 | fi |
17969268 | 5623 | if test "$modules" = "yes"; then |
e26110cf FZ |
5624 | # $shacmd can generate a hash started with digit, which the compiler doesn't |
5625 | # like as an symbol. So prefix it with an underscore | |
89138857 | 5626 | echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak |
17969268 FZ |
5627 | echo "CONFIG_MODULES=y" >> $config_host_mak |
5628 | fi | |
1ac88f28 | 5629 | if test "$sdl" = "yes" ; then |
98ec69ac | 5630 | echo "CONFIG_SDL=y" >> $config_host_mak |
a3f4d63d | 5631 | echo "CONFIG_SDLABI=$sdlabi" >> $config_host_mak |
1ac88f28 | 5632 | echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak |
8ecc89f6 | 5633 | echo "SDL_LIBS=$sdl_libs" >> $config_host_mak |
49ecc3fa FB |
5634 | fi |
5635 | if test "$cocoa" = "yes" ; then | |
98ec69ac | 5636 | echo "CONFIG_COCOA=y" >> $config_host_mak |
4d3b6f6e AZ |
5637 | fi |
5638 | if test "$curses" = "yes" ; then | |
98ec69ac | 5639 | echo "CONFIG_CURSES=y" >> $config_host_mak |
49ecc3fa | 5640 | fi |
099d6b0f | 5641 | if test "$pipe2" = "yes" ; then |
2358a494 | 5642 | echo "CONFIG_PIPE2=y" >> $config_host_mak |
099d6b0f | 5643 | fi |
40ff6d7e KW |
5644 | if test "$accept4" = "yes" ; then |
5645 | echo "CONFIG_ACCEPT4=y" >> $config_host_mak | |
5646 | fi | |
3ce34dfb | 5647 | if test "$splice" = "yes" ; then |
2358a494 | 5648 | echo "CONFIG_SPLICE=y" >> $config_host_mak |
3ce34dfb | 5649 | fi |
c2882b96 RV |
5650 | if test "$eventfd" = "yes" ; then |
5651 | echo "CONFIG_EVENTFD=y" >> $config_host_mak | |
5652 | fi | |
751bcc39 MAL |
5653 | if test "$memfd" = "yes" ; then |
5654 | echo "CONFIG_MEMFD=y" >> $config_host_mak | |
5655 | fi | |
d0927938 UH |
5656 | if test "$fallocate" = "yes" ; then |
5657 | echo "CONFIG_FALLOCATE=y" >> $config_host_mak | |
5658 | fi | |
3d4fa43e KK |
5659 | if test "$fallocate_punch_hole" = "yes" ; then |
5660 | echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak | |
5661 | fi | |
b953f075 DL |
5662 | if test "$fallocate_zero_range" = "yes" ; then |
5663 | echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak | |
5664 | fi | |
ed911435 KW |
5665 | if test "$posix_fallocate" = "yes" ; then |
5666 | echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak | |
5667 | fi | |
c727f47d PM |
5668 | if test "$sync_file_range" = "yes" ; then |
5669 | echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak | |
5670 | fi | |
dace20dc PM |
5671 | if test "$fiemap" = "yes" ; then |
5672 | echo "CONFIG_FIEMAP=y" >> $config_host_mak | |
5673 | fi | |
d0927938 UH |
5674 | if test "$dup3" = "yes" ; then |
5675 | echo "CONFIG_DUP3=y" >> $config_host_mak | |
5676 | fi | |
4e0c6529 AB |
5677 | if test "$ppoll" = "yes" ; then |
5678 | echo "CONFIG_PPOLL=y" >> $config_host_mak | |
5679 | fi | |
cd758dd0 AB |
5680 | if test "$prctl_pr_set_timerslack" = "yes" ; then |
5681 | echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak | |
5682 | fi | |
3b6edd16 PM |
5683 | if test "$epoll" = "yes" ; then |
5684 | echo "CONFIG_EPOLL=y" >> $config_host_mak | |
5685 | fi | |
5686 | if test "$epoll_create1" = "yes" ; then | |
5687 | echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak | |
5688 | fi | |
a8fd1aba PM |
5689 | if test "$sendfile" = "yes" ; then |
5690 | echo "CONFIG_SENDFILE=y" >> $config_host_mak | |
5691 | fi | |
51834341 RV |
5692 | if test "$timerfd" = "yes" ; then |
5693 | echo "CONFIG_TIMERFD=y" >> $config_host_mak | |
5694 | fi | |
9af5c906 RV |
5695 | if test "$setns" = "yes" ; then |
5696 | echo "CONFIG_SETNS=y" >> $config_host_mak | |
5697 | fi | |
38860a03 AM |
5698 | if test "$clock_adjtime" = "yes" ; then |
5699 | echo "CONFIG_CLOCK_ADJTIME=y" >> $config_host_mak | |
5700 | fi | |
5a03cd00 AM |
5701 | if test "$syncfs" = "yes" ; then |
5702 | echo "CONFIG_SYNCFS=y" >> $config_host_mak | |
5703 | fi | |
3b3f24ad | 5704 | if test "$inotify" = "yes" ; then |
2358a494 | 5705 | echo "CONFIG_INOTIFY=y" >> $config_host_mak |
3b3f24ad | 5706 | fi |
c05c7a73 RV |
5707 | if test "$inotify1" = "yes" ; then |
5708 | echo "CONFIG_INOTIFY1=y" >> $config_host_mak | |
5709 | fi | |
401bc051 PM |
5710 | if test "$sem_timedwait" = "yes" ; then |
5711 | echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak | |
5712 | fi | |
6ae9a1f4 JQ |
5713 | if test "$byteswap_h" = "yes" ; then |
5714 | echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak | |
5715 | fi | |
5716 | if test "$bswap_h" = "yes" ; then | |
5717 | echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak | |
5718 | fi | |
769ce76d | 5719 | if test "$curl" = "yes" ; then |
d3399d7c | 5720 | echo "CONFIG_CURL=m" >> $config_host_mak |
b1d5a277 | 5721 | echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak |
6ebc91e5 | 5722 | echo "CURL_LIBS=$curl_libs" >> $config_host_mak |
769ce76d | 5723 | fi |
2e4d9fb1 | 5724 | if test "$brlapi" = "yes" ; then |
98ec69ac | 5725 | echo "CONFIG_BRLAPI=y" >> $config_host_mak |
8eca2889 | 5726 | echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak |
2e4d9fb1 | 5727 | fi |
fb599c9a | 5728 | if test "$bluez" = "yes" ; then |
98ec69ac | 5729 | echo "CONFIG_BLUEZ=y" >> $config_host_mak |
ef7635ec | 5730 | echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak |
fb599c9a | 5731 | fi |
d46f7c9e | 5732 | if test "$glib_subprocess" = "yes" ; then |
9d41401b MT |
5733 | echo "CONFIG_HAS_GLIB_SUBPROCESS_TESTS=y" >> $config_host_mak |
5734 | fi | |
a4ccabcf AL |
5735 | if test "$gtk" = "yes" ; then |
5736 | echo "CONFIG_GTK=y" >> $config_host_mak | |
a3f4d63d | 5737 | echo "CONFIG_GTKABI=$gtkabi" >> $config_host_mak |
a4ccabcf | 5738 | echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak |
014cb152 | 5739 | echo "GTK_LIBS=$gtk_libs" >> $config_host_mak |
925a0400 GH |
5740 | if test "$gtk_gl" = "yes" ; then |
5741 | echo "CONFIG_GTK_GL=y" >> $config_host_mak | |
5742 | fi | |
bbbf9bfb | 5743 | fi |
a1c5e949 | 5744 | echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak |
ddbb0d09 DB |
5745 | if test "$gnutls" = "yes" ; then |
5746 | echo "CONFIG_GNUTLS=y" >> $config_host_mak | |
5747 | fi | |
b917da4c DB |
5748 | if test "$gnutls_rnd" = "yes" ; then |
5749 | echo "CONFIG_GNUTLS_RND=y" >> $config_host_mak | |
5750 | fi | |
91bfcdb0 DB |
5751 | if test "$gcrypt" = "yes" ; then |
5752 | echo "CONFIG_GCRYPT=y" >> $config_host_mak | |
1f923c70 LM |
5753 | if test "$gcrypt_hmac" = "yes" ; then |
5754 | echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak | |
5755 | fi | |
37788f25 DB |
5756 | if test "$gcrypt_kdf" = "yes" ; then |
5757 | echo "CONFIG_GCRYPT_KDF=y" >> $config_host_mak | |
5758 | fi | |
62893b67 | 5759 | fi |
91bfcdb0 DB |
5760 | if test "$nettle" = "yes" ; then |
5761 | echo "CONFIG_NETTLE=y" >> $config_host_mak | |
becaeb72 | 5762 | echo "CONFIG_NETTLE_VERSION_MAJOR=${nettle_version%%.*}" >> $config_host_mak |
fff2f982 DB |
5763 | if test "$nettle_kdf" = "yes" ; then |
5764 | echo "CONFIG_NETTLE_KDF=y" >> $config_host_mak | |
5765 | fi | |
ed754746 | 5766 | fi |
9a2fd434 DB |
5767 | if test "$tasn1" = "yes" ; then |
5768 | echo "CONFIG_TASN1=y" >> $config_host_mak | |
5769 | fi | |
559607ea DB |
5770 | if test "$have_ifaddrs_h" = "yes" ; then |
5771 | echo "HAVE_IFADDRS_H=y" >> $config_host_mak | |
5772 | fi | |
6b39b063 EB |
5773 | if test "$have_broken_size_max" = "yes" ; then |
5774 | echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak | |
5775 | fi | |
277abf15 JV |
5776 | |
5777 | # Work around a system header bug with some kernel/XFS header | |
5778 | # versions where they both try to define 'struct fsxattr': | |
5779 | # xfs headers will not try to redefine structs from linux headers | |
5780 | # if this macro is set. | |
5781 | if test "$have_fsxattr" = "yes" ; then | |
5782 | echo "HAVE_FSXATTR=y" >> $config_host_mak | |
5783 | fi | |
bbbf9bfb SW |
5784 | if test "$vte" = "yes" ; then |
5785 | echo "CONFIG_VTE=y" >> $config_host_mak | |
a4ccabcf AL |
5786 | echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak |
5787 | fi | |
9d9e1521 GH |
5788 | if test "$virglrenderer" = "yes" ; then |
5789 | echo "CONFIG_VIRGL=y" >> $config_host_mak | |
5790 | echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak | |
5791 | echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak | |
5792 | fi | |
e37630ca | 5793 | if test "$xen" = "yes" ; then |
6dbd588a | 5794 | echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak |
d5b93ddf | 5795 | echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak |
64a7ad6f IC |
5796 | if test "$xen_pv_domain_build" = "yes" ; then |
5797 | echo "CONFIG_XEN_PV_DOMAIN_BUILD=y" >> $config_host_mak | |
5798 | fi | |
e37630ca | 5799 | fi |
5c6c3a6c CH |
5800 | if test "$linux_aio" = "yes" ; then |
5801 | echo "CONFIG_LINUX_AIO=y" >> $config_host_mak | |
5802 | fi | |
758e8e38 VJ |
5803 | if test "$attr" = "yes" ; then |
5804 | echo "CONFIG_ATTR=y" >> $config_host_mak | |
5805 | fi | |
4f26f2b6 AK |
5806 | if test "$libattr" = "yes" ; then |
5807 | echo "CONFIG_LIBATTR=y" >> $config_host_mak | |
5808 | fi | |
983eef5a MI |
5809 | if test "$virtfs" = "yes" ; then |
5810 | echo "CONFIG_VIRTFS=y" >> $config_host_mak | |
758e8e38 | 5811 | fi |
fe8fc5ae PB |
5812 | if test "$mpath" = "yes" ; then |
5813 | echo "CONFIG_MPATH=y" >> $config_host_mak | |
5814 | fi | |
5e9be92d NB |
5815 | if test "$vhost_scsi" = "yes" ; then |
5816 | echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak | |
5817 | fi | |
e6a74868 | 5818 | if test "$vhost_net" = "yes" -a "$vhost_user" = "yes"; then |
03ce5744 NN |
5819 | echo "CONFIG_VHOST_NET_USED=y" >> $config_host_mak |
5820 | fi | |
fc0b9b0e SH |
5821 | if test "$vhost_vsock" = "yes" ; then |
5822 | echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak | |
5823 | fi | |
e6a74868 MAL |
5824 | if test "$vhost_user" = "yes" ; then |
5825 | echo "CONFIG_VHOST_USER=y" >> $config_host_mak | |
5826 | fi | |
77755340 | 5827 | if test "$blobs" = "yes" ; then |
98ec69ac | 5828 | echo "INSTALL_BLOBS=yes" >> $config_host_mak |
77755340 | 5829 | fi |
bf9298b9 | 5830 | if test "$iovec" = "yes" ; then |
2358a494 | 5831 | echo "CONFIG_IOVEC=y" >> $config_host_mak |
bf9298b9 | 5832 | fi |
ceb42de8 | 5833 | if test "$preadv" = "yes" ; then |
2358a494 | 5834 | echo "CONFIG_PREADV=y" >> $config_host_mak |
ceb42de8 | 5835 | fi |
f652e6af | 5836 | if test "$fdt" = "yes" ; then |
3f0855b1 | 5837 | echo "CONFIG_FDT=y" >> $config_host_mak |
f652e6af | 5838 | fi |
dcc38d1c MT |
5839 | if test "$signalfd" = "yes" ; then |
5840 | echo "CONFIG_SIGNALFD=y" >> $config_host_mak | |
5841 | fi | |
b3f6ea7e PB |
5842 | if test "$tcg" = "yes"; then |
5843 | echo "CONFIG_TCG=y" >> $config_host_mak | |
5844 | if test "$tcg_interpreter" = "yes" ; then | |
5845 | echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak | |
5846 | fi | |
9195b2c2 | 5847 | fi |
5f6b9e8f BS |
5848 | if test "$fdatasync" = "yes" ; then |
5849 | echo "CONFIG_FDATASYNC=y" >> $config_host_mak | |
5850 | fi | |
e78815a5 AF |
5851 | if test "$madvise" = "yes" ; then |
5852 | echo "CONFIG_MADVISE=y" >> $config_host_mak | |
5853 | fi | |
5854 | if test "$posix_madvise" = "yes" ; then | |
5855 | echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak | |
5856 | fi | |
97a847bc | 5857 | |
cd4ec0b4 GH |
5858 | if test "$spice" = "yes" ; then |
5859 | echo "CONFIG_SPICE=y" >> $config_host_mak | |
5860 | fi | |
36707144 | 5861 | |
7b02f544 MAL |
5862 | if test "$smartcard" = "yes" ; then |
5863 | echo "CONFIG_SMARTCARD=y" >> $config_host_mak | |
7b62bf5a FZ |
5864 | echo "SMARTCARD_CFLAGS=$libcacard_cflags" >> $config_host_mak |
5865 | echo "SMARTCARD_LIBS=$libcacard_libs" >> $config_host_mak | |
111a38b0 RR |
5866 | fi |
5867 | ||
2b2325ff GH |
5868 | if test "$libusb" = "yes" ; then |
5869 | echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak | |
b878b652 FZ |
5870 | echo "LIBUSB_CFLAGS=$libusb_cflags" >> $config_host_mak |
5871 | echo "LIBUSB_LIBS=$libusb_libs" >> $config_host_mak | |
2b2325ff GH |
5872 | fi |
5873 | ||
69354a83 HG |
5874 | if test "$usb_redir" = "yes" ; then |
5875 | echo "CONFIG_USB_REDIR=y" >> $config_host_mak | |
cc7923fc FZ |
5876 | echo "USB_REDIR_CFLAGS=$usb_redir_cflags" >> $config_host_mak |
5877 | echo "USB_REDIR_LIBS=$usb_redir_libs" >> $config_host_mak | |
69354a83 HG |
5878 | fi |
5879 | ||
da076ffe GH |
5880 | if test "$opengl" = "yes" ; then |
5881 | echo "CONFIG_OPENGL=y" >> $config_host_mak | |
5882 | echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak | |
014cb152 GH |
5883 | if test "$opengl_dmabuf" = "yes" ; then |
5884 | echo "CONFIG_OPENGL_DMABUF=y" >> $config_host_mak | |
5885 | fi | |
20ff075b MW |
5886 | fi |
5887 | ||
99f2dbd3 LL |
5888 | if test "$avx2_opt" = "yes" ; then |
5889 | echo "CONFIG_AVX2_OPT=y" >> $config_host_mak | |
5890 | fi | |
5891 | ||
607dacd0 QN |
5892 | if test "$lzo" = "yes" ; then |
5893 | echo "CONFIG_LZO=y" >> $config_host_mak | |
5894 | fi | |
5895 | ||
5896 | if test "$snappy" = "yes" ; then | |
5897 | echo "CONFIG_SNAPPY=y" >> $config_host_mak | |
5898 | fi | |
5899 | ||
6b383c08 PW |
5900 | if test "$bzip2" = "yes" ; then |
5901 | echo "CONFIG_BZIP2=y" >> $config_host_mak | |
5902 | echo "BZIP2_LIBS=-lbz2" >> $config_host_mak | |
5903 | fi | |
5904 | ||
c589b249 | 5905 | if test "$libiscsi" = "yes" ; then |
d3399d7c | 5906 | echo "CONFIG_LIBISCSI=m" >> $config_host_mak |
6ebc91e5 FZ |
5907 | echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak |
5908 | echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak | |
c589b249 RS |
5909 | fi |
5910 | ||
6542aa9c | 5911 | if test "$libnfs" = "yes" ; then |
4be4879f CL |
5912 | echo "CONFIG_LIBNFS=m" >> $config_host_mak |
5913 | echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak | |
6542aa9c PL |
5914 | fi |
5915 | ||
f794573e EO |
5916 | if test "$seccomp" = "yes"; then |
5917 | echo "CONFIG_SECCOMP=y" >> $config_host_mak | |
c3883e1f FZ |
5918 | echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak |
5919 | echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak | |
f794573e EO |
5920 | fi |
5921 | ||
83fb7adf | 5922 | # XXX: suppress that |
7d3505c5 | 5923 | if [ "$bsd" = "yes" ] ; then |
2358a494 | 5924 | echo "CONFIG_BSD=y" >> $config_host_mak |
7d3505c5 FB |
5925 | fi |
5926 | ||
4d9310f4 DB |
5927 | if test "$localtime_r" = "yes" ; then |
5928 | echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak | |
5929 | fi | |
3556c233 PB |
5930 | if test "$qom_cast_debug" = "yes" ; then |
5931 | echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak | |
5932 | fi | |
f27aaf4b | 5933 | if test "$rbd" = "yes" ; then |
d3399d7c | 5934 | echo "CONFIG_RBD=m" >> $config_host_mak |
6ebc91e5 FZ |
5935 | echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak |
5936 | echo "RBD_LIBS=$rbd_libs" >> $config_host_mak | |
d0e2fce5 AK |
5937 | fi |
5938 | ||
7c2acc70 | 5939 | echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak |
70c60c08 SH |
5940 | if test "$coroutine_pool" = "yes" ; then |
5941 | echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak | |
5942 | else | |
5943 | echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak | |
5944 | fi | |
20ff6c80 | 5945 | |
7d992e4d PL |
5946 | if test "$debug_stack_usage" = "yes" ; then |
5947 | echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak | |
5948 | fi | |
5949 | ||
f0d92b56 LM |
5950 | if test "$crypto_afalg" = "yes" ; then |
5951 | echo "CONFIG_AF_ALG=y" >> $config_host_mak | |
5952 | fi | |
5953 | ||
d2042378 AK |
5954 | if test "$open_by_handle_at" = "yes" ; then |
5955 | echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak | |
5956 | fi | |
5957 | ||
e06a765e HPB |
5958 | if test "$linux_magic_h" = "yes" ; then |
5959 | echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak | |
8ab1bf12 LC |
5960 | fi |
5961 | ||
cc6e3ca9 GH |
5962 | if test "$pragma_diagnostic_available" = "yes" ; then |
5963 | echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak | |
06d71fa1 PM |
5964 | fi |
5965 | ||
3f4349dc KW |
5966 | if test "$valgrind_h" = "yes" ; then |
5967 | echo "CONFIG_VALGRIND_H=y" >> $config_host_mak | |
5968 | fi | |
5969 | ||
8ab1bf12 LC |
5970 | if test "$has_environ" = "yes" ; then |
5971 | echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak | |
e06a765e HPB |
5972 | fi |
5973 | ||
76a347e1 RH |
5974 | if test "$cpuid_h" = "yes" ; then |
5975 | echo "CONFIG_CPUID_H=y" >> $config_host_mak | |
5976 | fi | |
5977 | ||
f540166b RH |
5978 | if test "$int128" = "yes" ; then |
5979 | echo "CONFIG_INT128=y" >> $config_host_mak | |
5980 | fi | |
5981 | ||
7ebee43e RH |
5982 | if test "$atomic128" = "yes" ; then |
5983 | echo "CONFIG_ATOMIC128=y" >> $config_host_mak | |
5984 | fi | |
5985 | ||
df79b996 RH |
5986 | if test "$atomic64" = "yes" ; then |
5987 | echo "CONFIG_ATOMIC64=y" >> $config_host_mak | |
5988 | fi | |
5989 | ||
1e6e9aca RH |
5990 | if test "$getauxval" = "yes" ; then |
5991 | echo "CONFIG_GETAUXVAL=y" >> $config_host_mak | |
5992 | fi | |
5993 | ||
eb100396 | 5994 | if test "$glusterfs" = "yes" ; then |
d3399d7c | 5995 | echo "CONFIG_GLUSTERFS=m" >> $config_host_mak |
6ebc91e5 FZ |
5996 | echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak |
5997 | echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak | |
0c14fb47 BR |
5998 | fi |
5999 | ||
d85fa9eb JC |
6000 | if test "$glusterfs_xlator_opt" = "yes" ; then |
6001 | echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak | |
6002 | fi | |
6003 | ||
0c14fb47 BR |
6004 | if test "$glusterfs_discard" = "yes" ; then |
6005 | echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak | |
eb100396 | 6006 | fi |
e06a765e | 6007 | |
df3a429a NV |
6008 | if test "$glusterfs_fallocate" = "yes" ; then |
6009 | echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak | |
6010 | fi | |
6011 | ||
7c815372 BR |
6012 | if test "$glusterfs_zerofill" = "yes" ; then |
6013 | echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak | |
6014 | fi | |
6015 | ||
0a12ec87 | 6016 | if test "$libssh2" = "yes" ; then |
d3399d7c | 6017 | echo "CONFIG_LIBSSH2=m" >> $config_host_mak |
6ebc91e5 FZ |
6018 | echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak |
6019 | echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak | |
0a12ec87 RJ |
6020 | fi |
6021 | ||
ed1701c6 DDAG |
6022 | if test "$live_block_migration" = "yes" ; then |
6023 | echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak | |
6024 | fi | |
6025 | ||
3b8acc11 PB |
6026 | # TPM passthrough support? |
6027 | if test "$tpm" = "yes"; then | |
6028 | echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak | |
6029 | if test "$tpm_passthrough" = "yes"; then | |
6030 | echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak | |
6031 | fi | |
6032 | fi | |
6033 | ||
5b808275 LV |
6034 | echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak |
6035 | if have_backend "nop"; then | |
6d8a764e | 6036 | echo "CONFIG_TRACE_NOP=y" >> $config_host_mak |
22890ab5 | 6037 | fi |
5b808275 | 6038 | if have_backend "simple"; then |
6d8a764e LV |
6039 | echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak |
6040 | # Set the appropriate trace file. | |
953ffe0f | 6041 | trace_file="\"$trace_file-\" FMT_pid" |
9410b56c | 6042 | fi |
ed7f5f1d PB |
6043 | if have_backend "log"; then |
6044 | echo "CONFIG_TRACE_LOG=y" >> $config_host_mak | |
6d8a764e | 6045 | fi |
5b808275 | 6046 | if have_backend "ust"; then |
6d8a764e LV |
6047 | echo "CONFIG_TRACE_UST=y" >> $config_host_mak |
6048 | fi | |
5b808275 | 6049 | if have_backend "dtrace"; then |
6d8a764e LV |
6050 | echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak |
6051 | if test "$trace_backend_stap" = "yes" ; then | |
6052 | echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak | |
6053 | fi | |
c276b17d | 6054 | fi |
5b808275 | 6055 | if have_backend "ftrace"; then |
781e9545 ET |
6056 | if test "$linux" = "yes" ; then |
6057 | echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak | |
781e9545 | 6058 | else |
21684af0 | 6059 | feature_not_found "ftrace(trace backend)" "ftrace requires Linux" |
781e9545 ET |
6060 | fi |
6061 | fi | |
0a852417 PD |
6062 | if have_backend "syslog"; then |
6063 | if test "$posix_syslog" = "yes" ; then | |
6064 | echo "CONFIG_TRACE_SYSLOG=y" >> $config_host_mak | |
6065 | else | |
6066 | feature_not_found "syslog(trace backend)" "syslog not available" | |
6067 | fi | |
6068 | fi | |
9410b56c PS |
6069 | echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak |
6070 | ||
2da776db MH |
6071 | if test "$rdma" = "yes" ; then |
6072 | echo "CONFIG_RDMA=y" >> $config_host_mak | |
392fb643 | 6073 | echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak |
2da776db MH |
6074 | fi |
6075 | ||
575b22b1 LV |
6076 | if test "$have_rtnetlink" = "yes" ; then |
6077 | echo "CONFIG_RTNETLINK=y" >> $config_host_mak | |
6078 | fi | |
6079 | ||
a6b1d4c0 CX |
6080 | if test "$replication" = "yes" ; then |
6081 | echo "CONFIG_REPLICATION=y" >> $config_host_mak | |
6082 | fi | |
6083 | ||
6a02c806 SH |
6084 | if test "$have_af_vsock" = "yes" ; then |
6085 | echo "CONFIG_AF_VSOCK=y" >> $config_host_mak | |
6086 | fi | |
6087 | ||
4d04351f CC |
6088 | if test "$have_sysmacros" = "yes" ; then |
6089 | echo "CONFIG_SYSMACROS=y" >> $config_host_mak | |
6090 | fi | |
6091 | ||
49e00a18 AG |
6092 | if test "$have_static_assert" = "yes" ; then |
6093 | echo "CONFIG_STATIC_ASSERT=y" >> $config_host_mak | |
6094 | fi | |
6095 | ||
e674605f TG |
6096 | if test "$have_utmpx" = "yes" ; then |
6097 | echo "HAVE_UTMPX=y" >> $config_host_mak | |
6098 | fi | |
6099 | ||
e0580342 KR |
6100 | if test "$ivshmem" = "yes" ; then |
6101 | echo "CONFIG_IVSHMEM=y" >> $config_host_mak | |
6102 | fi | |
6103 | ||
5c312079 DDAG |
6104 | # Hold two types of flag: |
6105 | # CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on | |
6106 | # a thread we have a handle to | |
6107 | # CONFIG_PTHREAD_SETNAME_NP - A way of doing it on a particular | |
6108 | # platform | |
6109 | if test "$pthread_setname_np" = "yes" ; then | |
6110 | echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak | |
6111 | echo "CONFIG_PTHREAD_SETNAME_NP=y" >> $config_host_mak | |
6112 | fi | |
6113 | ||
da92c3ff AM |
6114 | if test "$vxhs" = "yes" ; then |
6115 | echo "CONFIG_VXHS=y" >> $config_host_mak | |
6116 | echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak | |
6117 | fi | |
6118 | ||
5b5e3037 PB |
6119 | if test "$tcg_interpreter" = "yes"; then |
6120 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" | |
6121 | elif test "$ARCH" = "sparc64" ; then | |
6122 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" | |
6123 | elif test "$ARCH" = "s390x" ; then | |
6124 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" | |
c72b26ec | 6125 | elif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then |
5b5e3037 | 6126 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" |
40d964b5 RH |
6127 | elif test "$ARCH" = "ppc64" ; then |
6128 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" | |
5b5e3037 PB |
6129 | else |
6130 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" | |
6131 | fi | |
6132 | QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" | |
6133 | ||
98ec69ac | 6134 | echo "TOOLS=$tools" >> $config_host_mak |
98ec69ac | 6135 | echo "ROMS=$roms" >> $config_host_mak |
804edf29 JQ |
6136 | echo "MAKE=$make" >> $config_host_mak |
6137 | echo "INSTALL=$install" >> $config_host_mak | |
1901cb14 BS |
6138 | echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak |
6139 | echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak | |
e999ee44 MT |
6140 | echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak |
6141 | echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak | |
c886edfb | 6142 | echo "PYTHON=$python" >> $config_host_mak |
804edf29 | 6143 | echo "CC=$cc" >> $config_host_mak |
a31a8642 MT |
6144 | if $iasl -h > /dev/null 2>&1; then |
6145 | echo "IASL=$iasl" >> $config_host_mak | |
6146 | fi | |
2b2e59e6 | 6147 | echo "CC_I386=$cc_i386" >> $config_host_mak |
804edf29 | 6148 | echo "HOST_CC=$host_cc" >> $config_host_mak |
83f73fce | 6149 | echo "CXX=$cxx" >> $config_host_mak |
3c4a4d0d | 6150 | echo "OBJCC=$objcc" >> $config_host_mak |
804edf29 | 6151 | echo "AR=$ar" >> $config_host_mak |
45d285ab | 6152 | echo "ARFLAGS=$ARFLAGS" >> $config_host_mak |
cdbd727c | 6153 | echo "AS=$as" >> $config_host_mak |
5f6f0e27 | 6154 | echo "CCAS=$ccas" >> $config_host_mak |
3dd46c78 | 6155 | echo "CPP=$cpp" >> $config_host_mak |
804edf29 JQ |
6156 | echo "OBJCOPY=$objcopy" >> $config_host_mak |
6157 | echo "LD=$ld" >> $config_host_mak | |
4852ee95 | 6158 | echo "NM=$nm" >> $config_host_mak |
9fe6de94 | 6159 | echo "WINDRES=$windres" >> $config_host_mak |
e2a2ed06 | 6160 | echo "CFLAGS=$CFLAGS" >> $config_host_mak |
46eef33b | 6161 | echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak |
a558ee17 | 6162 | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
11cde1c8 | 6163 | echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak |
f9728943 | 6164 | echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak |
e39f0062 PB |
6165 | if test "$sparse" = "yes" ; then |
6166 | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak | |
80fd48df | 6167 | echo "CPP := REAL_CC=\"\$(CPP)\" cgcc" >> $config_host_mak |
2944d742 | 6168 | echo "CXX := REAL_CC=\"\$(CXX)\" cgcc" >> $config_host_mak |
e39f0062 PB |
6169 | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak |
6170 | echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak | |
6171 | fi | |
42da6041 GH |
6172 | if test "$cross_prefix" != ""; then |
6173 | echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak | |
6174 | else | |
6175 | echo "AUTOCONF_HOST := " >> $config_host_mak | |
6176 | fi | |
e2a2ed06 | 6177 | echo "LDFLAGS=$LDFLAGS" >> $config_host_mak |
46eef33b | 6178 | echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak |
6969ec6c | 6179 | echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak |
e57218b6 | 6180 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak |
73da375e | 6181 | echo "LIBS+=$LIBS" >> $config_host_mak |
3e2e0e6b | 6182 | echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak |
409437e1 | 6183 | echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak |
804edf29 | 6184 | echo "EXESUF=$EXESUF" >> $config_host_mak |
17969268 FZ |
6185 | echo "DSOSUF=$DSOSUF" >> $config_host_mak |
6186 | echo "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak | |
957f1f99 | 6187 | echo "LIBS_QGA+=$libs_qga" >> $config_host_mak |
90246037 DB |
6188 | echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak |
6189 | echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak | |
94dd53c5 | 6190 | echo "POD2MAN=$POD2MAN" >> $config_host_mak |
cbdd1999 | 6191 | echo "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak |
1d728c39 BS |
6192 | if test "$gcov" = "yes" ; then |
6193 | echo "CONFIG_GCOV=y" >> $config_host_mak | |
6194 | echo "GCOV=$gcov_tool" >> $config_host_mak | |
6195 | fi | |
804edf29 | 6196 | |
6efd7517 PM |
6197 | # use included Linux headers |
6198 | if test "$linux" = "yes" ; then | |
a307beb6 | 6199 | mkdir -p linux-headers |
6efd7517 | 6200 | case "$cpu" in |
c72b26ec | 6201 | i386|x86_64|x32) |
08312a63 | 6202 | linux_arch=x86 |
6efd7517 PM |
6203 | ;; |
6204 | ppcemb|ppc|ppc64) | |
08312a63 | 6205 | linux_arch=powerpc |
6efd7517 PM |
6206 | ;; |
6207 | s390x) | |
08312a63 PM |
6208 | linux_arch=s390 |
6209 | ;; | |
1f080313 CF |
6210 | aarch64) |
6211 | linux_arch=arm64 | |
6212 | ;; | |
222e7d11 SL |
6213 | mips64) |
6214 | linux_arch=mips | |
6215 | ;; | |
08312a63 PM |
6216 | *) |
6217 | # For most CPUs the kernel architecture name and QEMU CPU name match. | |
6218 | linux_arch="$cpu" | |
6efd7517 PM |
6219 | ;; |
6220 | esac | |
08312a63 PM |
6221 | # For non-KVM architectures we will not have asm headers |
6222 | if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then | |
6223 | symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm | |
6224 | fi | |
6efd7517 PM |
6225 | fi |
6226 | ||
1d14ffa9 | 6227 | for target in $target_list; do |
97a847bc | 6228 | target_dir="$target" |
25be210f | 6229 | config_target_mak=$target_dir/config-target.mak |
89138857 | 6230 | target_name=$(echo $target | cut -d '-' -f 1) |
97a847bc | 6231 | target_bigendian="no" |
1f3d3c8f | 6232 | |
c1799a84 | 6233 | case "$target_name" in |
4a09d0bb | 6234 | armeb|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) |
ea2d6a39 JQ |
6235 | target_bigendian=yes |
6236 | ;; | |
6237 | esac | |
97a847bc | 6238 | target_softmmu="no" |
997344f3 | 6239 | target_user_only="no" |
831b7825 | 6240 | target_linux_user="no" |
84778508 | 6241 | target_bsd_user="no" |
9e407a85 | 6242 | case "$target" in |
c1799a84 | 6243 | ${target_name}-softmmu) |
9e407a85 PB |
6244 | target_softmmu="yes" |
6245 | ;; | |
c1799a84 | 6246 | ${target_name}-linux-user) |
9e407a85 PB |
6247 | target_user_only="yes" |
6248 | target_linux_user="yes" | |
6249 | ;; | |
c1799a84 | 6250 | ${target_name}-bsd-user) |
84778508 BS |
6251 | target_user_only="yes" |
6252 | target_bsd_user="yes" | |
6253 | ;; | |
9e407a85 | 6254 | *) |
76ad07a4 | 6255 | error_exit "Target '$target' not recognised" |
9e407a85 PB |
6256 | exit 1 |
6257 | ;; | |
6258 | esac | |
831b7825 | 6259 | |
97a847bc | 6260 | mkdir -p $target_dir |
25be210f | 6261 | echo "# Automatically generated by configure - do not modify" > $config_target_mak |
de83cd02 | 6262 | |
e5fe0c52 | 6263 | bflt="no" |
ca759f9e | 6264 | mttcg="no" |
89138857 | 6265 | interp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g") |
56aebc89 | 6266 | gdb_xml_files="" |
7ba1e619 | 6267 | |
c1799a84 | 6268 | TARGET_ARCH="$target_name" |
6acff7da | 6269 | TARGET_BASE_ARCH="" |
e6e91b9c | 6270 | TARGET_ABI_DIR="" |
e73aae67 | 6271 | |
c1799a84 | 6272 | case "$target_name" in |
2408a527 | 6273 | i386) |
b8158192 | 6274 | gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml" |
2408a527 AJ |
6275 | ;; |
6276 | x86_64) | |
6acff7da | 6277 | TARGET_BASE_ARCH=i386 |
b8158192 | 6278 | gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml" |
2408a527 AJ |
6279 | ;; |
6280 | alpha) | |
5ee4f3c2 | 6281 | mttcg="yes" |
2408a527 AJ |
6282 | ;; |
6283 | arm|armeb) | |
b498c8a0 | 6284 | TARGET_ARCH=arm |
2408a527 | 6285 | bflt="yes" |
ca759f9e | 6286 | mttcg="yes" |
56aebc89 | 6287 | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
2408a527 | 6288 | ;; |
6a49fa95 AG |
6289 | aarch64) |
6290 | TARGET_BASE_ARCH=arm | |
6291 | bflt="yes" | |
ca759f9e | 6292 | mttcg="yes" |
8f95ce2e | 6293 | gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
6a49fa95 | 6294 | ;; |
2408a527 | 6295 | cris) |
2408a527 | 6296 | ;; |
61766fe9 RH |
6297 | hppa) |
6298 | ;; | |
613a22c9 | 6299 | lm32) |
613a22c9 | 6300 | ;; |
2408a527 | 6301 | m68k) |
2408a527 | 6302 | bflt="yes" |
5a4526b2 | 6303 | gdb_xml_files="cf-core.xml cf-fp.xml m68k-fp.xml" |
2408a527 | 6304 | ;; |
877fdc12 EI |
6305 | microblaze|microblazeel) |
6306 | TARGET_ARCH=microblaze | |
72b675ca | 6307 | bflt="yes" |
72b675ca | 6308 | ;; |
0adcffb1 | 6309 | mips|mipsel) |
b498c8a0 | 6310 | TARGET_ARCH=mips |
25be210f | 6311 | echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak |
2408a527 AJ |
6312 | ;; |
6313 | mipsn32|mipsn32el) | |
597e2cec | 6314 | TARGET_ARCH=mips64 |
6acff7da | 6315 | TARGET_BASE_ARCH=mips |
25be210f | 6316 | echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak |
597e2cec | 6317 | echo "TARGET_ABI32=y" >> $config_target_mak |
2408a527 AJ |
6318 | ;; |
6319 | mips64|mips64el) | |
b498c8a0 | 6320 | TARGET_ARCH=mips64 |
6acff7da | 6321 | TARGET_BASE_ARCH=mips |
25be210f | 6322 | echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak |
2408a527 | 6323 | ;; |
d15a9c23 AG |
6324 | moxie) |
6325 | ;; | |
e671711c MV |
6326 | nios2) |
6327 | ;; | |
4a09d0bb | 6328 | or1k) |
e67db06e JL |
6329 | TARGET_ARCH=openrisc |
6330 | TARGET_BASE_ARCH=openrisc | |
e67db06e | 6331 | ;; |
2408a527 | 6332 | ppc) |
c8b3532d | 6333 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
6334 | ;; |
6335 | ppcemb) | |
6acff7da | 6336 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 6337 | TARGET_ABI_DIR=ppc |
c8b3532d | 6338 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2408a527 AJ |
6339 | ;; |
6340 | ppc64) | |
6acff7da | 6341 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 6342 | TARGET_ABI_DIR=ppc |
f0b0685d | 6343 | mttcg=yes |
1438eff3 | 6344 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
2408a527 | 6345 | ;; |
9c35126c DK |
6346 | ppc64le) |
6347 | TARGET_ARCH=ppc64 | |
6348 | TARGET_BASE_ARCH=ppc | |
6349 | TARGET_ABI_DIR=ppc | |
f0b0685d | 6350 | mttcg=yes |
1438eff3 | 6351 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
9c35126c | 6352 | ;; |
2408a527 | 6353 | ppc64abi32) |
b498c8a0 | 6354 | TARGET_ARCH=ppc64 |
6acff7da | 6355 | TARGET_BASE_ARCH=ppc |
e6e91b9c | 6356 | TARGET_ABI_DIR=ppc |
25be210f | 6357 | echo "TARGET_ABI32=y" >> $config_target_mak |
1438eff3 | 6358 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
2408a527 AJ |
6359 | ;; |
6360 | sh4|sh4eb) | |
b498c8a0 | 6361 | TARGET_ARCH=sh4 |
2408a527 AJ |
6362 | bflt="yes" |
6363 | ;; | |
6364 | sparc) | |
2408a527 AJ |
6365 | ;; |
6366 | sparc64) | |
6acff7da | 6367 | TARGET_BASE_ARCH=sparc |
2408a527 AJ |
6368 | ;; |
6369 | sparc32plus) | |
b498c8a0 | 6370 | TARGET_ARCH=sparc64 |
6acff7da | 6371 | TARGET_BASE_ARCH=sparc |
e6e91b9c | 6372 | TARGET_ABI_DIR=sparc |
25be210f | 6373 | echo "TARGET_ABI32=y" >> $config_target_mak |
2408a527 | 6374 | ;; |
24e804ec | 6375 | s390x) |
86158a2a | 6376 | gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-gs.xml" |
24e804ec | 6377 | ;; |
444e06b1 CG |
6378 | tilegx) |
6379 | ;; | |
5ecaa4ed PC |
6380 | tricore) |
6381 | ;; | |
d2fbca94 | 6382 | unicore32) |
d2fbca94 | 6383 | ;; |
cfa550c6 MF |
6384 | xtensa|xtensaeb) |
6385 | TARGET_ARCH=xtensa | |
cfa550c6 | 6386 | ;; |
2408a527 | 6387 | *) |
76ad07a4 | 6388 | error_exit "Unsupported target CPU" |
2408a527 AJ |
6389 | ;; |
6390 | esac | |
5e8861a0 PB |
6391 | # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH |
6392 | if [ "$TARGET_BASE_ARCH" = "" ]; then | |
6393 | TARGET_BASE_ARCH=$TARGET_ARCH | |
6394 | fi | |
6395 | ||
5e8861a0 PB |
6396 | symlink "$source_path/Makefile.target" "$target_dir/Makefile" |
6397 | ||
99afc91d DB |
6398 | upper() { |
6399 | echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' | |
6400 | } | |
6401 | ||
89138857 | 6402 | target_arch_name="$(upper $TARGET_ARCH)" |
25be210f | 6403 | echo "TARGET_$target_arch_name=y" >> $config_target_mak |
c1799a84 | 6404 | echo "TARGET_NAME=$target_name" >> $config_target_mak |
25be210f | 6405 | echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak |
e6e91b9c JQ |
6406 | if [ "$TARGET_ABI_DIR" = "" ]; then |
6407 | TARGET_ABI_DIR=$TARGET_ARCH | |
6408 | fi | |
25be210f | 6409 | echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak |
adfc3e91 SS |
6410 | if [ "$HOST_VARIANT_DIR" != "" ]; then |
6411 | echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak | |
6412 | fi | |
3b6b7550 PB |
6413 | |
6414 | if supported_xen_target $target; then | |
6415 | echo "CONFIG_XEN=y" >> $config_target_mak | |
6416 | if test "$xen_pci_passthrough" = yes; then | |
eb6fda0f | 6417 | echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" |
1b0c87fc | 6418 | fi |
3b6b7550 PB |
6419 | fi |
6420 | if supported_kvm_target $target; then | |
6421 | echo "CONFIG_KVM=y" >> $config_target_mak | |
6422 | if test "$vhost_net" = "yes" ; then | |
d5970055 | 6423 | echo "CONFIG_VHOST_NET=y" >> $config_target_mak |
e6a74868 MAL |
6424 | if test "$vhost_user" = "yes" ; then |
6425 | echo "CONFIG_VHOST_USER_NET_TEST_$target_name=y" >> $config_host_mak | |
6426 | fi | |
c59249f9 | 6427 | fi |
3b6b7550 PB |
6428 | fi |
6429 | if supported_hax_target $target; then | |
6430 | echo "CONFIG_HAX=y" >> $config_target_mak | |
b0cb0a66 | 6431 | fi |
de83cd02 | 6432 | if test "$target_bigendian" = "yes" ; then |
25be210f | 6433 | echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak |
de83cd02 | 6434 | fi |
97a847bc | 6435 | if test "$target_softmmu" = "yes" ; then |
25be210f | 6436 | echo "CONFIG_SOFTMMU=y" >> $config_target_mak |
ca759f9e AB |
6437 | if test "$mttcg" = "yes" ; then |
6438 | echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak | |
6439 | fi | |
43ce4dfe | 6440 | fi |
997344f3 | 6441 | if test "$target_user_only" = "yes" ; then |
25be210f | 6442 | echo "CONFIG_USER_ONLY=y" >> $config_target_mak |
a2c80be9 | 6443 | echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak |
997344f3 | 6444 | fi |
831b7825 | 6445 | if test "$target_linux_user" = "yes" ; then |
25be210f | 6446 | echo "CONFIG_LINUX_USER=y" >> $config_target_mak |
831b7825 | 6447 | fi |
56aebc89 PB |
6448 | list="" |
6449 | if test ! -z "$gdb_xml_files" ; then | |
6450 | for x in $gdb_xml_files; do | |
6451 | list="$list $source_path/gdb-xml/$x" | |
6452 | done | |
3d0f1517 | 6453 | echo "TARGET_XML_FILES=$list" >> $config_target_mak |
56aebc89 | 6454 | fi |
97a847bc | 6455 | |
e5fe0c52 | 6456 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
25be210f | 6457 | echo "TARGET_HAS_BFLT=y" >> $config_target_mak |
e5fe0c52 | 6458 | fi |
84778508 | 6459 | if test "$target_bsd_user" = "yes" ; then |
25be210f | 6460 | echo "CONFIG_BSD_USER=y" >> $config_target_mak |
84778508 | 6461 | fi |
5b0753e0 | 6462 | |
4afddb55 | 6463 | # generate QEMU_CFLAGS/LDFLAGS for targets |
fa282484 | 6464 | |
4afddb55 | 6465 | cflags="" |
fa282484 | 6466 | ldflags="" |
9b8e111f | 6467 | |
c765fcac PC |
6468 | disas_config() { |
6469 | echo "CONFIG_${1}_DIS=y" >> $config_target_mak | |
6470 | echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak | |
6471 | } | |
6472 | ||
64656024 JQ |
6473 | for i in $ARCH $TARGET_BASE_ARCH ; do |
6474 | case "$i" in | |
6475 | alpha) | |
c765fcac | 6476 | disas_config "ALPHA" |
64656024 | 6477 | ;; |
82295d8a RH |
6478 | aarch64) |
6479 | if test -n "${cxx}"; then | |
c765fcac | 6480 | disas_config "ARM_A64" |
82295d8a RH |
6481 | fi |
6482 | ;; | |
64656024 | 6483 | arm) |
c765fcac | 6484 | disas_config "ARM" |
999b53ec | 6485 | if test -n "${cxx}"; then |
c765fcac | 6486 | disas_config "ARM_A64" |
999b53ec | 6487 | fi |
64656024 JQ |
6488 | ;; |
6489 | cris) | |
c765fcac | 6490 | disas_config "CRIS" |
64656024 | 6491 | ;; |
429b31a2 RH |
6492 | hppa) |
6493 | disas_config "HPPA" | |
6494 | ;; | |
c72b26ec | 6495 | i386|x86_64|x32) |
c765fcac | 6496 | disas_config "I386" |
64656024 | 6497 | ;; |
79368f49 | 6498 | lm32) |
c765fcac | 6499 | disas_config "LM32" |
79368f49 | 6500 | ;; |
64656024 | 6501 | m68k) |
c765fcac | 6502 | disas_config "M68K" |
64656024 | 6503 | ;; |
877fdc12 | 6504 | microblaze*) |
c765fcac | 6505 | disas_config "MICROBLAZE" |
64656024 JQ |
6506 | ;; |
6507 | mips*) | |
c765fcac | 6508 | disas_config "MIPS" |
64656024 | 6509 | ;; |
d15a9c23 | 6510 | moxie*) |
c765fcac | 6511 | disas_config "MOXIE" |
d15a9c23 | 6512 | ;; |
e671711c MV |
6513 | nios2) |
6514 | disas_config "NIOS2" | |
6515 | ;; | |
4a09d0bb | 6516 | or1k) |
c765fcac | 6517 | disas_config "OPENRISC" |
e67db06e | 6518 | ;; |
64656024 | 6519 | ppc*) |
c765fcac | 6520 | disas_config "PPC" |
64656024 | 6521 | ;; |
24e804ec | 6522 | s390*) |
c765fcac | 6523 | disas_config "S390" |
64656024 JQ |
6524 | ;; |
6525 | sh4) | |
c765fcac | 6526 | disas_config "SH4" |
64656024 JQ |
6527 | ;; |
6528 | sparc*) | |
c765fcac | 6529 | disas_config "SPARC" |
64656024 | 6530 | ;; |
cfa550c6 | 6531 | xtensa*) |
c765fcac | 6532 | disas_config "XTENSA" |
cfa550c6 | 6533 | ;; |
64656024 JQ |
6534 | esac |
6535 | done | |
9195b2c2 | 6536 | if test "$tcg_interpreter" = "yes" ; then |
c765fcac | 6537 | disas_config "TCI" |
9195b2c2 | 6538 | fi |
64656024 | 6539 | |
6ee7126f JQ |
6540 | case "$ARCH" in |
6541 | alpha) | |
6542 | # Ensure there's only a single GP | |
6543 | cflags="-msmall-data $cflags" | |
6544 | ;; | |
6545 | esac | |
6546 | ||
d02c1db3 | 6547 | if test "$gprof" = "yes" ; then |
25be210f | 6548 | echo "TARGET_GPROF=yes" >> $config_target_mak |
d02c1db3 JQ |
6549 | if test "$target_linux_user" = "yes" ; then |
6550 | cflags="-p $cflags" | |
6551 | ldflags="-p $ldflags" | |
6552 | fi | |
6553 | if test "$target_softmmu" = "yes" ; then | |
6554 | ldflags="-p $ldflags" | |
25be210f | 6555 | echo "GPROF_CFLAGS=-p" >> $config_target_mak |
d02c1db3 JQ |
6556 | fi |
6557 | fi | |
6558 | ||
9b8e111f | 6559 | if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then |
964c6fa1 | 6560 | ldflags="$ldflags $textseg_ldflags" |
fa282484 | 6561 | fi |
fa282484 | 6562 | |
e9a3591f CB |
6563 | # Newer kernels on s390 check for an S390_PGSTE program header and |
6564 | # enable the pgste page table extensions in that case. This makes | |
6565 | # the vm.allocate_pgste sysctl unnecessary. We enable this program | |
6566 | # header if | |
6567 | # - we build on s390x | |
6568 | # - we build the system emulation for s390x (qemu-system-s390x) | |
6569 | # - KVM is enabled | |
6570 | # - the linker supports --s390-pgste | |
6571 | if test "$TARGET_ARCH" = "s390x" -a "$target_softmmu" = "yes" -a "$ARCH" = "s390x" -a "$kvm" = "yes"; then | |
6572 | if ld_has --s390-pgste ; then | |
6573 | ldflags="-Wl,--s390-pgste $ldflags" | |
6574 | fi | |
6575 | fi | |
6576 | ||
25be210f JQ |
6577 | echo "LDFLAGS+=$ldflags" >> $config_target_mak |
6578 | echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak | |
fa282484 | 6579 | |
97a847bc | 6580 | done # for target in $targets |
7d13299d | 6581 | |
a540f158 PC |
6582 | if [ "$dtc_internal" = "yes" ]; then |
6583 | echo "config-host.h: subdir-dtc" >> $config_host_mak | |
6584 | fi | |
6585 | ||
a99d57bb WG |
6586 | if test "$numa" = "yes"; then |
6587 | echo "CONFIG_NUMA=y" >> $config_host_mak | |
6588 | fi | |
6589 | ||
fd0e6053 JS |
6590 | if test "$ccache_cpp2" = "yes"; then |
6591 | echo "export CCACHE_CPP2=y" >> $config_host_mak | |
6592 | fi | |
6593 | ||
d1807a4f | 6594 | # build tree in object directory in case the source is not in the current directory |
b1fb9a63 | 6595 | DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" |
b855f8d1 | 6596 | DIRS="$DIRS docs docs/interop fsdev scsi" |
9933c305 | 6597 | DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" |
d1807a4f | 6598 | DIRS="$DIRS roms/seabios roms/vgabios" |
2dee8d54 | 6599 | DIRS="$DIRS qapi-generated" |
c09015dd AL |
6600 | FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" |
6601 | FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" | |
aaa2ebc5 | 6602 | FILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" |
d1807a4f | 6603 | FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" |
446b9165 | 6604 | FILES="$FILES pc-bios/spapr-rtas/Makefile" |
9933c305 | 6605 | FILES="$FILES pc-bios/s390-ccw/Makefile" |
d1807a4f | 6606 | FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" |
4652b792 | 6607 | FILES="$FILES pc-bios/qemu-icon.bmp" |
3a586d2f | 6608 | FILES="$FILES .gdbinit scripts" # scripts needed by relative path in .gdbinit |
753d11f2 RH |
6609 | for bios_file in \ |
6610 | $source_path/pc-bios/*.bin \ | |
225a9ab8 | 6611 | $source_path/pc-bios/*.lid \ |
5acc2ec0 | 6612 | $source_path/pc-bios/*.aml \ |
753d11f2 RH |
6613 | $source_path/pc-bios/*.rom \ |
6614 | $source_path/pc-bios/*.dtb \ | |
e89e33e1 | 6615 | $source_path/pc-bios/*.img \ |
753d11f2 | 6616 | $source_path/pc-bios/openbios-* \ |
4e73c781 | 6617 | $source_path/pc-bios/u-boot.* \ |
753d11f2 RH |
6618 | $source_path/pc-bios/palcode-* |
6619 | do | |
89138857 | 6620 | FILES="$FILES pc-bios/$(basename $bios_file)" |
d1807a4f | 6621 | done |
89138857 | 6622 | for test_file in $(find $source_path/tests/acpi-test-data -type f) |
c2304b52 | 6623 | do |
89138857 | 6624 | FILES="$FILES tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')" |
c2304b52 | 6625 | done |
d1807a4f PB |
6626 | mkdir -p $DIRS |
6627 | for f in $FILES ; do | |
cab00a5a | 6628 | if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then |
f9245e10 PM |
6629 | symlink "$source_path/$f" "$f" |
6630 | fi | |
d1807a4f | 6631 | done |
1ad2134f | 6632 | |
c34ebfdc | 6633 | # temporary config to build submodules |
2d9f27d2 | 6634 | for rom in seabios vgabios ; do |
c34ebfdc | 6635 | config_mak=roms/$rom/config.mak |
37116c89 | 6636 | echo "# Automatically generated by configure - do not modify" > $config_mak |
c34ebfdc | 6637 | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
cdbd727c | 6638 | echo "AS=$as" >> $config_mak |
5f6f0e27 | 6639 | echo "CCAS=$ccas" >> $config_mak |
c34ebfdc AL |
6640 | echo "CC=$cc" >> $config_mak |
6641 | echo "BCC=bcc" >> $config_mak | |
3dd46c78 | 6642 | echo "CPP=$cpp" >> $config_mak |
c34ebfdc | 6643 | echo "OBJCOPY=objcopy" >> $config_mak |
a31a8642 | 6644 | echo "IASL=$iasl" >> $config_mak |
c34ebfdc AL |
6645 | echo "LD=$ld" >> $config_mak |
6646 | done | |
6647 | ||
fe31017f MAL |
6648 | # set up tests data directory |
6649 | if [ ! -e tests/data ]; then | |
6650 | symlink "$source_path/tests/data" tests/data | |
6651 | fi | |
6652 | ||
76c7560a HR |
6653 | # set up qemu-iotests in this build directory |
6654 | iotests_common_env="tests/qemu-iotests/common.env" | |
6655 | iotests_check="tests/qemu-iotests/check" | |
6656 | ||
6657 | echo "# Automatically generated by configure - do not modify" > "$iotests_common_env" | |
6658 | echo >> "$iotests_common_env" | |
6659 | echo "export PYTHON='$python'" >> "$iotests_common_env" | |
6660 | ||
6661 | if [ ! -e "$iotests_check" ]; then | |
6662 | symlink "$source_path/$iotests_check" "$iotests_check" | |
6663 | fi | |
6664 | ||
dc655404 MT |
6665 | # Save the configure command line for later reuse. |
6666 | cat <<EOD >config.status | |
6667 | #!/bin/sh | |
6668 | # Generated by configure. | |
6669 | # Run this file to recreate the current configuration. | |
6670 | # Compiler output produced by configure, useful for debugging | |
6671 | # configure, is in config.log if it exists. | |
6672 | EOD | |
6673 | printf "exec" >>config.status | |
6674 | printf " '%s'" "$0" "$@" >>config.status | |
cf7cc929 | 6675 | echo ' "$@"' >>config.status |
dc655404 MT |
6676 | chmod +x config.status |
6677 | ||
8cd05ab6 | 6678 | rm -r "$TMPDIR1" |