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