bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 3 | # qemu configure script (c) 2003 Fabrice Bellard |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 4 | # |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 5 | |
Cornelia Huck | 99519e6 | 2014-05-28 12:39:17 +0200 | [diff] [blame] | 6 | # Unset some variables known to interfere with behavior of common tools, |
| 7 | # just as autoconf does. |
| 8 | CLICOLOR_FORCE= GREP_OPTIONS= |
| 9 | unset CLICOLOR_FORCE GREP_OPTIONS |
| 10 | |
John Snow | 5e4dfd3 | 2015-10-28 13:56:40 -0400 | [diff] [blame] | 11 | # Don't allow CCACHE, if present, to use cached results of compile tests! |
| 12 | export CCACHE_RECACHE=yes |
| 13 | |
Daniel P. Berrangé | dedad02 | 2020-08-21 12:22:04 +0200 | [diff] [blame] | 14 | # make source path absolute |
| 15 | source_path=$(cd "$(dirname -- "$0")"; pwd) |
| 16 | |
| 17 | if test "$PWD" = "$source_path" |
| 18 | then |
| 19 | echo "Using './build' as the directory for build output" |
| 20 | |
| 21 | MARKER=build/auto-created-by-configure |
| 22 | |
| 23 | if test -e build |
| 24 | then |
| 25 | if test -f $MARKER |
| 26 | then |
| 27 | rm -rf build |
| 28 | else |
| 29 | echo "ERROR: ./build dir already exists and was not previously created by configure" |
| 30 | exit 1 |
| 31 | fi |
| 32 | fi |
| 33 | |
| 34 | mkdir build |
| 35 | touch $MARKER |
| 36 | |
| 37 | cat > GNUmakefile <<'EOF' |
| 38 | # This file is auto-generated by configure to support in-source tree |
| 39 | # 'make' command invocation |
| 40 | |
| 41 | ifeq ($(MAKECMDGOALS),) |
| 42 | recurse: all |
| 43 | endif |
| 44 | |
| 45 | .NOTPARALLEL: % |
| 46 | %: force |
| 47 | @echo 'changing dir to build for $(MAKE) "$(MAKECMDGOALS)"...' |
| 48 | @$(MAKE) -C build -f Makefile $(MAKECMDGOALS) |
| 49 | @if test "$(MAKECMDGOALS)" = "distclean" && \ |
| 50 | test -e build/auto-created-by-configure ; \ |
| 51 | then \ |
| 52 | rm -rf build GNUmakefile ; \ |
| 53 | fi |
| 54 | force: ; |
| 55 | .PHONY: force |
| 56 | GNUmakefile: ; |
| 57 | |
| 58 | EOF |
| 59 | cd build |
| 60 | exec $source_path/configure "$@" |
| 61 | fi |
| 62 | |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 63 | # Temporary directory used for files created while |
| 64 | # configure runs. Since it is in the build directory |
| 65 | # we can safely blow away any previous version of it |
| 66 | # (and we need not jump through hoops to try to delete |
| 67 | # it when configure exits.) |
| 68 | TMPDIR1="config-temp" |
| 69 | rm -rf "${TMPDIR1}" |
| 70 | mkdir -p "${TMPDIR1}" |
| 71 | if [ $? -ne 0 ]; then |
| 72 | echo "ERROR: failed to create temporary directory" |
| 73 | exit 1 |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 74 | fi |
| 75 | |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 76 | TMPB="qemu-conf" |
| 77 | TMPC="${TMPDIR1}/${TMPB}.c" |
Don Slutz | 66518bf | 2014-01-02 21:12:46 -0500 | [diff] [blame] | 78 | TMPO="${TMPDIR1}/${TMPB}.o" |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 79 | TMPCXX="${TMPDIR1}/${TMPB}.cxx" |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 80 | TMPE="${TMPDIR1}/${TMPB}.exe" |
Emilio G. Cota | 26fffe2 | 2018-10-21 13:56:29 -0400 | [diff] [blame] | 81 | TMPTXT="${TMPDIR1}/${TMPB}.txt" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 82 | |
Gerd Hoffmann | da1d85e | 2010-04-23 13:44:10 +0200 | [diff] [blame] | 83 | rm -f config.log |
malc | 9ac81bb | 2008-11-29 20:09:56 +0000 | [diff] [blame] | 84 | |
Peter Maydell | b48e361 | 2011-11-23 17:26:44 +0000 | [diff] [blame] | 85 | # Print a helpful header at the top of config.log |
| 86 | echo "# QEMU configure log $(date)" >> config.log |
Peter Maydell | 979ae16 | 2012-03-07 12:16:29 +0000 | [diff] [blame] | 87 | printf "# Configured with:" >> config.log |
| 88 | printf " '%s'" "$0" "$@" >> config.log |
| 89 | echo >> config.log |
Peter Maydell | b48e361 | 2011-11-23 17:26:44 +0000 | [diff] [blame] | 90 | echo "#" >> config.log |
| 91 | |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 92 | print_error() { |
| 93 | (echo |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 94 | echo "ERROR: $1" |
| 95 | while test -n "$2"; do |
| 96 | echo " $2" |
| 97 | shift |
| 98 | done |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 99 | echo) >&2 |
| 100 | } |
| 101 | |
| 102 | error_exit() { |
| 103 | print_error "$@" |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 104 | exit 1 |
| 105 | } |
| 106 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 107 | do_compiler() { |
| 108 | # Run the compiler, capturing its output to the log. First argument |
| 109 | # is compiler binary to execute. |
| 110 | local compiler="$1" |
| 111 | shift |
Ian Jackson | 8bbe05d | 2017-09-25 16:41:03 +0100 | [diff] [blame] | 112 | if test -n "$BASH_VERSION"; then eval ' |
| 113 | echo >>config.log " |
| 114 | funcs: ${FUNCNAME[*]} |
| 115 | lines: ${BASH_LINENO[*]}" |
| 116 | '; fi |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 117 | echo $compiler "$@" >> config.log |
| 118 | $compiler "$@" >> config.log 2>&1 || return $? |
Peter Maydell | 8dc38a7 | 2012-07-18 15:10:28 +0100 | [diff] [blame] | 119 | # Test passed. If this is an --enable-werror build, rerun |
| 120 | # the test with -Werror and bail out if it fails. This |
| 121 | # makes warning-generating-errors in configure test code |
| 122 | # obvious to developers. |
| 123 | if test "$werror" != "yes"; then |
| 124 | return 0 |
| 125 | fi |
| 126 | # Don't bother rerunning the compile if we were already using -Werror |
| 127 | case "$*" in |
| 128 | *-Werror*) |
| 129 | return 0 |
| 130 | ;; |
| 131 | esac |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 132 | echo $compiler -Werror "$@" >> config.log |
| 133 | $compiler -Werror "$@" >> config.log 2>&1 && return $? |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 134 | error_exit "configure test passed without -Werror but failed with -Werror." \ |
| 135 | "This is probably a bug in the configure script. The failing command" \ |
| 136 | "will be at the bottom of config.log." \ |
| 137 | "You can run configure with --disable-werror to bypass this check." |
Peter Maydell | 8dc38a7 | 2012-07-18 15:10:28 +0100 | [diff] [blame] | 138 | } |
| 139 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 140 | do_cc() { |
| 141 | do_compiler "$cc" "$@" |
| 142 | } |
| 143 | |
| 144 | do_cxx() { |
| 145 | do_compiler "$cxx" "$@" |
| 146 | } |
| 147 | |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 148 | # Append $2 to the variable named $1, with space separation |
| 149 | add_to() { |
| 150 | eval $1=\${$1:+\"\$$1 \"}\$2 |
| 151 | } |
| 152 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 153 | update_cxxflags() { |
| 154 | # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those |
| 155 | # options which some versions of GCC's C++ compiler complain about |
| 156 | # because they only make sense for C programs. |
Paolo Bonzini | 5342204 | 2019-07-29 12:50:04 +0200 | [diff] [blame] | 157 | QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 158 | CXXFLAGS=$(echo "$CFLAGS" | sed s/-std=gnu99/-std=gnu++11/) |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 159 | for arg in $QEMU_CFLAGS; do |
| 160 | case $arg in |
| 161 | -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ |
| 162 | -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) |
| 163 | ;; |
| 164 | *) |
| 165 | QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg |
| 166 | ;; |
| 167 | esac |
| 168 | done |
| 169 | } |
| 170 | |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 171 | compile_object() { |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 172 | local_cflags="$1" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 173 | do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | compile_prog() { |
| 177 | local_cflags="$1" |
| 178 | local_ldflags="$2" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 179 | do_cc $CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $QEMU_LDFLAGS $local_ldflags |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 180 | } |
| 181 | |
Paolo Bonzini | 11568d6 | 2010-12-23 11:43:58 +0100 | [diff] [blame] | 182 | # symbolically link $1 to $2. Portable version of "ln -sf". |
| 183 | symlink() { |
Stefan Weil | 72b8b5a | 2012-03-19 13:20:47 +0100 | [diff] [blame] | 184 | rm -rf "$2" |
Anthony Liguori | ec5b06d | 2012-06-06 16:57:00 +0800 | [diff] [blame] | 185 | mkdir -p "$(dirname "$2")" |
Stefan Weil | 72b8b5a | 2012-03-19 13:20:47 +0100 | [diff] [blame] | 186 | ln -s "$1" "$2" |
Paolo Bonzini | 11568d6 | 2010-12-23 11:43:58 +0100 | [diff] [blame] | 187 | } |
| 188 | |
Loïc Minier | 0dba619 | 2010-01-28 21:26:51 +0000 | [diff] [blame] | 189 | # check whether a command is available to this shell (may be either an |
| 190 | # executable or a builtin) |
| 191 | has() { |
| 192 | type "$1" >/dev/null 2>&1 |
| 193 | } |
| 194 | |
| 195 | # search for an executable in PATH |
| 196 | path_of() { |
| 197 | local_command="$1" |
| 198 | local_ifs="$IFS" |
| 199 | local_dir="" |
| 200 | |
| 201 | # pathname has a dir component? |
| 202 | if [ "${local_command#*/}" != "$local_command" ]; then |
| 203 | if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then |
| 204 | echo "$local_command" |
| 205 | return 0 |
| 206 | fi |
| 207 | fi |
| 208 | if [ -z "$local_command" ]; then |
| 209 | return 1 |
| 210 | fi |
| 211 | |
| 212 | IFS=: |
| 213 | for local_dir in $PATH; do |
| 214 | if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then |
| 215 | echo "$local_dir/$local_command" |
| 216 | IFS="${local_ifs:-$(printf ' \t\n')}" |
| 217 | return 0 |
| 218 | fi |
| 219 | done |
| 220 | # not found |
| 221 | IFS="${local_ifs:-$(printf ' \t\n')}" |
| 222 | return 1 |
| 223 | } |
| 224 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 225 | version_ge () { |
| 226 | local_ver1=`echo $1 | tr . ' '` |
| 227 | local_ver2=`echo $2 | tr . ' '` |
| 228 | while true; do |
| 229 | set x $local_ver1 |
| 230 | local_first=${2-0} |
| 231 | # shift 2 does nothing if there are less than 2 arguments |
| 232 | shift; shift |
| 233 | local_ver1=$* |
| 234 | set x $local_ver2 |
| 235 | # the second argument finished, the first must be greater or equal |
| 236 | test $# = 1 && return 0 |
| 237 | test $local_first -lt $2 && return 1 |
| 238 | test $local_first -gt $2 && return 0 |
| 239 | shift; shift |
| 240 | local_ver2=$* |
| 241 | done |
| 242 | } |
| 243 | |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 244 | have_backend () { |
| 245 | echo "$trace_backends" | grep "$1" >/dev/null |
| 246 | } |
| 247 | |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 248 | glob() { |
| 249 | eval test -z '"${1#'"$2"'}"' |
| 250 | } |
| 251 | |
| 252 | supported_hax_target() { |
| 253 | test "$hax" = "yes" || return 1 |
| 254 | glob "$1" "*-softmmu" || return 1 |
| 255 | case "${1%-softmmu}" in |
| 256 | i386|x86_64) |
| 257 | return 0 |
| 258 | ;; |
| 259 | esac |
| 260 | return 1 |
| 261 | } |
| 262 | |
| 263 | supported_kvm_target() { |
| 264 | test "$kvm" = "yes" || return 1 |
| 265 | glob "$1" "*-softmmu" || return 1 |
| 266 | case "${1%-softmmu}:$cpu" in |
| 267 | arm:arm | aarch64:aarch64 | \ |
| 268 | i386:i386 | i386:x86_64 | i386:x32 | \ |
| 269 | x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ |
Huacai Chen | aa2953f | 2020-05-03 18:20:15 +0800 | [diff] [blame] | 270 | mips:mips | mipsel:mips | mips64:mips | mips64el:mips | \ |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 271 | ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \ |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 272 | s390x:s390x) |
| 273 | return 0 |
| 274 | ;; |
| 275 | esac |
| 276 | return 1 |
| 277 | } |
| 278 | |
| 279 | supported_xen_target() { |
| 280 | test "$xen" = "yes" || return 1 |
| 281 | glob "$1" "*-softmmu" || return 1 |
Paolo Bonzini | b5ed2e1 | 2017-07-11 12:00:49 +0200 | [diff] [blame] | 282 | # Only i386 and x86_64 provide the xenpv machine. |
| 283 | case "${1%-softmmu}" in |
| 284 | i386|x86_64) |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 285 | return 0 |
| 286 | ;; |
| 287 | esac |
| 288 | return 1 |
| 289 | } |
| 290 | |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 291 | supported_hvf_target() { |
| 292 | test "$hvf" = "yes" || return 1 |
| 293 | glob "$1" "*-softmmu" || return 1 |
| 294 | case "${1%-softmmu}" in |
| 295 | x86_64) |
| 296 | return 0 |
| 297 | ;; |
| 298 | esac |
| 299 | return 1 |
| 300 | } |
| 301 | |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 302 | supported_whpx_target() { |
| 303 | test "$whpx" = "yes" || return 1 |
| 304 | glob "$1" "*-softmmu" || return 1 |
| 305 | case "${1%-softmmu}" in |
| 306 | i386|x86_64) |
| 307 | return 0 |
| 308 | ;; |
| 309 | esac |
| 310 | return 1 |
| 311 | } |
| 312 | |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 313 | supported_target() { |
| 314 | case "$1" in |
| 315 | *-softmmu) |
| 316 | ;; |
| 317 | *-linux-user) |
| 318 | if test "$linux" != "yes"; then |
| 319 | print_error "Target '$target' is only available on a Linux host" |
| 320 | return 1 |
| 321 | fi |
| 322 | ;; |
| 323 | *-bsd-user) |
| 324 | if test "$bsd" != "yes"; then |
| 325 | print_error "Target '$target' is only available on a BSD host" |
| 326 | return 1 |
| 327 | fi |
| 328 | ;; |
| 329 | *) |
| 330 | print_error "Invalid target name '$target'" |
| 331 | return 1 |
| 332 | ;; |
| 333 | esac |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 334 | test "$tcg" = "yes" && return 0 |
| 335 | supported_kvm_target "$1" && return 0 |
| 336 | supported_xen_target "$1" && return 0 |
| 337 | supported_hax_target "$1" && return 0 |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 338 | supported_hvf_target "$1" && return 0 |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 339 | supported_whpx_target "$1" && return 0 |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 340 | print_error "TCG disabled, but hardware accelerator not available for '$target'" |
| 341 | return 1 |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 342 | } |
| 343 | |
Christian Borntraeger | e9a3591 | 2017-08-23 12:16:23 +0200 | [diff] [blame] | 344 | |
| 345 | ld_has() { |
| 346 | $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 |
| 347 | } |
| 348 | |
Antonio Ospite | 4ace32e | 2019-05-26 16:47:47 +0200 | [diff] [blame] | 349 | if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; |
| 350 | then |
| 351 | error_exit "main directory cannot contain spaces nor colons" |
| 352 | fi |
| 353 | |
Antonio Ospite | 1421182 | 2019-05-26 16:47:46 +0200 | [diff] [blame] | 354 | # default parameters |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 355 | cpu="" |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 356 | iasl="iasl" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 357 | interp_prefix="/usr/gnemul/qemu-%M" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 358 | static="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 359 | cross_prefix="" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 360 | audio_drv_list="" |
Fam Zheng | b64ec4e | 2013-05-29 19:35:40 +0800 | [diff] [blame] | 361 | block_drv_rw_whitelist="" |
| 362 | block_drv_ro_whitelist="" |
Peter Maydell | e49d021 | 2012-12-07 15:39:13 +0000 | [diff] [blame] | 363 | host_cc="cc" |
Juan Quintela | 3e2e0e6 | 2009-08-03 14:47:06 +0200 | [diff] [blame] | 364 | libs_tools="" |
malc | d563163 | 2009-10-10 01:13:41 +0400 | [diff] [blame] | 365 | audio_win_int="" |
Michael Roth | 957f1f9 | 2011-08-11 15:38:12 -0500 | [diff] [blame] | 366 | libs_qga="" |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 367 | debug_info="yes" |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 368 | stack_protector="" |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 369 | safe_stack="" |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 370 | use_containers="yes" |
Alex Bennée | f238539 | 2020-04-30 20:01:14 +0100 | [diff] [blame] | 371 | gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 372 | |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 373 | if test -e "$source_path/.git" |
| 374 | then |
Daniel P. Berrange | f62bbee | 2017-10-26 13:52:26 +0100 | [diff] [blame] | 375 | git_update=yes |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 376 | git_submodules="ui/keycodemapdb" |
Emilio G. Cota | 3ac1f81 | 2018-03-08 21:09:40 -0500 | [diff] [blame] | 377 | git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" |
| 378 | git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 379 | else |
Daniel P. Berrange | f62bbee | 2017-10-26 13:52:26 +0100 | [diff] [blame] | 380 | git_update=no |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 381 | git_submodules="" |
Daniel P. Berrangé | 5c0ef67 | 2018-04-18 18:11:51 +0100 | [diff] [blame] | 382 | |
| 383 | if ! test -f "$source_path/ui/keycodemapdb/README" |
| 384 | then |
| 385 | echo |
| 386 | echo "ERROR: missing file $source_path/ui/keycodemapdb/README" |
| 387 | echo |
| 388 | echo "This is not a GIT checkout but module content appears to" |
| 389 | echo "be missing. Do not use 'git archive' or GitHub download links" |
| 390 | echo "to acquire QEMU source archives. Non-GIT builds are only" |
| 391 | echo "supported with source archives linked from:" |
| 392 | echo |
Peter Maydell | a3e3b52 | 2019-07-22 14:07:39 +0100 | [diff] [blame] | 393 | echo " https://www.qemu.org/download/#source" |
Daniel P. Berrangé | 5c0ef67 | 2018-04-18 18:11:51 +0100 | [diff] [blame] | 394 | echo |
| 395 | echo "Developers working with GIT can use scripts/archive-source.sh" |
| 396 | echo "if they need to create valid source archives." |
| 397 | echo |
| 398 | exit 1 |
| 399 | fi |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 400 | fi |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 401 | git="git" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 402 | |
Stefan Weil | afb63eb | 2012-09-26 22:04:38 +0200 | [diff] [blame] | 403 | # Don't accept a target_list environment variable. |
| 404 | unset target_list |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 405 | unset target_list_exclude |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 406 | |
| 407 | # Default value for a variable defining feature "foo". |
| 408 | # * foo="no" feature will only be used if --enable-foo arg is given |
| 409 | # * foo="" feature will be searched for, and if found, will be used |
| 410 | # unless --disable-foo is given |
| 411 | # * foo="yes" this value will only be set by --enable-foo flag. |
| 412 | # feature will searched for, |
| 413 | # if not found, configure exits with error |
| 414 | # |
| 415 | # Always add --enable-foo and --disable-foo command line args. |
| 416 | # Distributions want to ensure that several features are compiled in, and it |
| 417 | # is impossible without a --enable-foo that exits if a feature is not found. |
| 418 | |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 419 | brlapi="" |
| 420 | curl="" |
| 421 | curses="" |
| 422 | docs="" |
| 423 | fdt="" |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 424 | netmap="no" |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 425 | sdl="auto" |
| 426 | sdl_image="auto" |
Meador Inge | 983eef5 | 2012-02-24 14:00:42 +0530 | [diff] [blame] | 427 | virtfs="" |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 428 | mpath="" |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 429 | vnc="enabled" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 430 | sparse="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 431 | vde="" |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 432 | vnc_sasl="auto" |
| 433 | vnc_jpeg="auto" |
| 434 | vnc_png="auto" |
Gerd Hoffmann | 6a02153 | 2017-10-05 17:33:28 +0200 | [diff] [blame] | 435 | xkbcommon="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 436 | xen="" |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 437 | xen_ctrl_version="" |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 438 | xen_pci_passthrough="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 439 | linux_aio="" |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 440 | linux_io_uring="" |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 441 | cap_ng="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 442 | attr="" |
Avi Kivity | 4f26f2b | 2011-11-09 14:44:52 +0200 | [diff] [blame] | 443 | libattr="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 444 | xfs="" |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 445 | tcg="yes" |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 446 | membarrier="" |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 447 | vhost_net="" |
| 448 | vhost_crypto="" |
| 449 | vhost_scsi="" |
| 450 | vhost_vsock="" |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 451 | vhost_user="" |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 452 | vhost_user_fs="" |
Brad | d41a75a | 2011-07-26 23:11:26 -0400 | [diff] [blame] | 453 | kvm="no" |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 454 | hax="no" |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 455 | hvf="no" |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 456 | whpx="no" |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 457 | rdma="" |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 458 | pvrdma="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 459 | gprof="no" |
| 460 | debug_tcg="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 461 | debug="no" |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 462 | sanitizers="no" |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 463 | tsan="no" |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 464 | fortify_source="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 465 | strip_opt="yes" |
Stefan Weil | 9195b2c | 2011-10-19 07:07:18 +0200 | [diff] [blame] | 466 | tcg_interpreter="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 467 | bigendian="no" |
| 468 | mingw32="no" |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 469 | gcov="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 470 | EXESUF="" |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 471 | HOST_DSOSUF=".so" |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 472 | LDFLAGS_SHARED="-shared" |
| 473 | modules="no" |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 474 | module_upgrades="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 475 | prefix="/usr/local" |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 476 | firmwarepath="\${prefix}/share/qemu-firmware" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 477 | confsuffix="/qemu" |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 478 | slirp="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 479 | oss_lib="" |
| 480 | bsd="no" |
| 481 | linux="no" |
| 482 | solaris="no" |
| 483 | profiler="no" |
| 484 | cocoa="no" |
| 485 | softmmu="yes" |
| 486 | linux_user="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 487 | bsd_user="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 488 | blobs="yes" |
Philippe Mathieu-Daudé | 05dfa22 | 2019-11-08 12:45:30 +0100 | [diff] [blame] | 489 | edk2_blobs="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 490 | pkgversion="" |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 491 | pie="" |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 492 | qom_cast_debug="yes" |
Paolo Bonzini | baf86d6 | 2016-01-07 16:55:31 +0300 | [diff] [blame] | 493 | trace_backends="log" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 494 | trace_file="trace" |
| 495 | spice="" |
| 496 | rbd="" |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 497 | smartcard="" |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 498 | libusb="" |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 499 | usb_redir="" |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 500 | opengl="" |
Gerd Hoffmann | 014cb15 | 2015-12-03 12:56:34 +0100 | [diff] [blame] | 501 | opengl_dmabuf="no" |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 502 | cpuid_h="no" |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 503 | avx2_opt="" |
Alon Levy | 1ece990 | 2011-07-26 12:30:40 +0300 | [diff] [blame] | 504 | zlib="yes" |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 505 | capstone="" |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 506 | lzo="" |
| 507 | snappy="" |
Peter Wu | 6b383c0 | 2015-01-06 18:48:14 +0100 | [diff] [blame] | 508 | bzip2="" |
Julio Faracco | 83bc1f9 | 2018-11-05 13:08:04 -0200 | [diff] [blame] | 509 | lzfse="" |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 510 | zstd="" |
Michael Tokarev | e8ef31a | 2013-07-31 14:22:07 +0400 | [diff] [blame] | 511 | guest_agent="" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 512 | guest_agent_with_vss="no" |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 513 | guest_agent_ntddscsi="no" |
Yossi Hindin | 9dacf32 | 2015-05-06 14:57:40 +0300 | [diff] [blame] | 514 | guest_agent_msi="" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 515 | vss_win32_sdk="" |
| 516 | win_sdk="no" |
Philippe Mathieu-Daudé | e10ee3f | 2020-02-17 14:33:27 +0100 | [diff] [blame] | 517 | want_tools="" |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 518 | libiscsi="" |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 519 | libnfs="" |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 520 | coroutine="" |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 521 | coroutine_pool="" |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 522 | debug_stack_usage="no" |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 523 | crypto_afalg="no" |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 524 | seccomp="" |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 525 | glusterfs="" |
Jeff Cody | d85fa9e | 2016-04-05 10:40:09 -0400 | [diff] [blame] | 526 | glusterfs_xlator_opt="no" |
Bharata B Rao | 0c14fb4 | 2013-07-16 21:47:42 +0530 | [diff] [blame] | 527 | glusterfs_discard="no" |
Niels de Vos | df3a429 | 2017-05-28 12:01:14 +0530 | [diff] [blame] | 528 | glusterfs_fallocate="no" |
Bharata B Rao | 7c81537 | 2013-12-21 14:51:25 +0530 | [diff] [blame] | 529 | glusterfs_zerofill="no" |
Prasanna Kumar Kalever | e014dbe | 2019-03-05 16:46:33 +0100 | [diff] [blame] | 530 | glusterfs_ftruncate_has_stat="no" |
Niels de Vos | 0e3b891 | 2019-03-05 16:46:34 +0100 | [diff] [blame] | 531 | glusterfs_iocb_has_stat="no" |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 532 | gtk="" |
Gerd Hoffmann | 925a040 | 2015-05-26 12:26:21 +0200 | [diff] [blame] | 533 | gtk_gl="no" |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 534 | tls_priority="NORMAL" |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 535 | gnutls="" |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 536 | nettle="" |
Daniel P. Berrangé | dc2207a | 2019-10-14 17:28:27 +0100 | [diff] [blame] | 537 | nettle_xts="no" |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 538 | gcrypt="" |
Longpeng(Mike) | 1f923c7 | 2016-12-13 18:42:55 +0800 | [diff] [blame] | 539 | gcrypt_hmac="no" |
Daniel P. Berrangé | e057694 | 2019-10-14 17:28:27 +0100 | [diff] [blame] | 540 | gcrypt_xts="no" |
| 541 | qemu_private_xts="yes" |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 542 | auth_pam="" |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 543 | vte="" |
Gerd Hoffmann | 9d9e152 | 2014-07-11 12:51:43 +0200 | [diff] [blame] | 544 | virglrenderer="" |
Paolo Bonzini | 7aaa6a1 | 2019-01-23 14:56:07 +0800 | [diff] [blame] | 545 | tpm="" |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 546 | libssh="" |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 547 | live_block_migration="yes" |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 548 | numa="" |
Fam Zheng | 2847b46 | 2015-03-26 11:03:12 +0800 | [diff] [blame] | 549 | tcmalloc="no" |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 550 | jemalloc="no" |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 551 | replication="yes" |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 552 | bochs="yes" |
| 553 | cloop="yes" |
| 554 | dmg="yes" |
| 555 | qcow1="yes" |
| 556 | vdi="yes" |
| 557 | vvfat="yes" |
| 558 | qed="yes" |
| 559 | parallels="yes" |
| 560 | sheepdog="yes" |
Klim Kireev | ed279a0 | 2018-01-12 12:01:19 +0300 | [diff] [blame] | 561 | libxml2="" |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 562 | debug_mutex="no" |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 563 | libpmem="" |
Paolo Bonzini | f349474 | 2019-01-23 14:56:17 +0800 | [diff] [blame] | 564 | default_devices="yes" |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 565 | plugins="no" |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 566 | fuzzing="no" |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 567 | rng_none="no" |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 568 | secret_keyring="" |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 569 | libdaxctl="" |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 570 | meson="" |
| 571 | skip_meson=no |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 572 | gettext="" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 573 | |
Peter Maydell | fb59dab | 2017-03-28 14:01:52 +0100 | [diff] [blame] | 574 | bogus_os="no" |
Yang Zhong | 5a22ab7 | 2017-12-20 21:16:46 +0800 | [diff] [blame] | 575 | malloc_trim="" |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 576 | |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 577 | # parse CC options first |
| 578 | for opt do |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 579 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 580 | case "$opt" in |
| 581 | --cross-prefix=*) cross_prefix="$optarg" |
| 582 | ;; |
Paolo Bonzini | 3d8df64 | 2010-12-23 11:43:48 +0100 | [diff] [blame] | 583 | --cc=*) CC="$optarg" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 584 | ;; |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 585 | --cxx=*) CXX="$optarg" |
| 586 | ;; |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 587 | --cpu=*) cpu="$optarg" |
| 588 | ;; |
Alex Bennée | de38528 | 2015-06-03 09:56:37 +0100 | [diff] [blame] | 589 | --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 590 | QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg" |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 591 | ;; |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 592 | --extra-cxxflags=*) QEMU_CXXFLAGS="$QEMU_CXXFLAGS $optarg" |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 593 | ;; |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 594 | --extra-ldflags=*) QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg" |
Gerd Hoffmann | f9943cd | 2013-01-04 10:15:53 +0100 | [diff] [blame] | 595 | EXTRA_LDFLAGS="$optarg" |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 596 | ;; |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 597 | --enable-debug-info) debug_info="yes" |
| 598 | ;; |
| 599 | --disable-debug-info) debug_info="no" |
| 600 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 601 | --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option" |
| 602 | ;; |
Alex Bennée | d422b2b | 2018-04-13 11:07:58 +0100 | [diff] [blame] | 603 | --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*} |
| 604 | eval "cross_cc_cflags_${cc_arch}=\$optarg" |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 605 | cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}" |
Alex Bennée | d422b2b | 2018-04-13 11:07:58 +0100 | [diff] [blame] | 606 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 607 | --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*} |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 608 | cc_archs="$cc_archs $cc_arch" |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 609 | eval "cross_cc_${cc_arch}=\$optarg" |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 610 | cross_cc_vars="$cross_cc_vars cross_cc_${cc_arch}" |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 611 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 612 | esac |
| 613 | done |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 614 | # OS specific |
| 615 | # Using uname is really, really broken. Once we have the right set of checks |
Stefan Weil | 93148aa | 2012-02-26 18:46:12 +0100 | [diff] [blame] | 616 | # we can eliminate its usage altogether. |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 617 | |
Peter Maydell | e49d021 | 2012-12-07 15:39:13 +0000 | [diff] [blame] | 618 | # Preferred compiler: |
| 619 | # ${CC} (if set) |
| 620 | # ${cross_prefix}gcc (if cross-prefix specified) |
| 621 | # system compiler |
| 622 | if test -z "${CC}${cross_prefix}"; then |
| 623 | cc="$host_cc" |
| 624 | else |
| 625 | cc="${CC-${cross_prefix}gcc}" |
| 626 | fi |
| 627 | |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 628 | if test -z "${CXX}${cross_prefix}"; then |
| 629 | cxx="c++" |
| 630 | else |
| 631 | cxx="${CXX-${cross_prefix}g++}" |
| 632 | fi |
| 633 | |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 634 | ar="${AR-${cross_prefix}ar}" |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 635 | as="${AS-${cross_prefix}as}" |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 636 | ccas="${CCAS-$cc}" |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 637 | cpp="${CPP-$cc -E}" |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 638 | objcopy="${OBJCOPY-${cross_prefix}objcopy}" |
| 639 | ld="${LD-${cross_prefix}ld}" |
Alistair Francis | 9f81aeb | 2017-11-07 17:10:46 -0800 | [diff] [blame] | 640 | ranlib="${RANLIB-${cross_prefix}ranlib}" |
Stefan Weil | 4852ee9 | 2014-09-18 21:55:08 +0200 | [diff] [blame] | 641 | nm="${NM-${cross_prefix}nm}" |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 642 | strip="${STRIP-${cross_prefix}strip}" |
| 643 | windres="${WINDRES-${cross_prefix}windres}" |
Sergei Trofimovich | 17884d7 | 2012-01-31 22:03:45 +0300 | [diff] [blame] | 644 | pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" |
| 645 | query_pkg_config() { |
| 646 | "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" |
| 647 | } |
| 648 | pkg_config=query_pkg_config |
Dave Airlie | 47c0374 | 2013-12-10 14:05:51 +1000 | [diff] [blame] | 649 | sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 650 | |
Peter Maydell | 45d285a | 2013-10-21 21:03:06 +0100 | [diff] [blame] | 651 | # If the user hasn't specified ARFLAGS, default to 'rv', just as make does. |
| 652 | ARFLAGS="${ARFLAGS-rv}" |
| 653 | |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 654 | # default flags for all hosts |
Peter Maydell | 2d31515 | 2016-09-12 14:10:08 +0100 | [diff] [blame] | 655 | # We use -fwrapv to tell the compiler that we require a C dialect where |
| 656 | # left shift of signed integers is well defined and has the expected |
| 657 | # 2s-complement style results. (Both clang and gcc agree that it |
| 658 | # provides these semantics.) |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 659 | QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv $QEMU_CFLAGS" |
| 660 | QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
Kevin Wolf | c95e308 | 2013-02-22 21:08:51 +0100 | [diff] [blame] | 661 | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 662 | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 663 | QEMU_INCLUDES="-iquote . -iquote ${source_path} -iquote ${source_path}/accel/tcg -iquote ${source_path}/include" |
| 664 | QEMU_INCLUDES="$QEMU_INCLUDES -iquote ${source_path}/disas/libvixl" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 665 | CFLAGS="-std=gnu99 -Wall" |
| 666 | |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 667 | |
Michael S. Tsirkin | cab00a5 | 2014-04-28 15:09:01 +0300 | [diff] [blame] | 668 | # running configure in the source tree? |
| 669 | # we know that's the case if configure is there. |
| 670 | if test -f "./configure"; then |
| 671 | pwd_is_source_path="y" |
| 672 | else |
| 673 | pwd_is_source_path="n" |
| 674 | fi |
| 675 | |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 676 | check_define() { |
| 677 | cat > $TMPC <<EOF |
| 678 | #if !defined($1) |
Peter Maydell | fd786e1 | 2011-11-23 17:26:43 +0000 | [diff] [blame] | 679 | #error $1 not defined |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 680 | #endif |
| 681 | int main(void) { return 0; } |
| 682 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 683 | compile_object |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 684 | } |
| 685 | |
Gerd Hoffmann | 307119e | 2015-06-10 09:07:35 +0200 | [diff] [blame] | 686 | check_include() { |
| 687 | cat > $TMPC <<EOF |
| 688 | #include <$1> |
| 689 | int main(void) { return 0; } |
| 690 | EOF |
| 691 | compile_object |
| 692 | } |
| 693 | |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 694 | write_c_skeleton() { |
| 695 | cat > $TMPC <<EOF |
| 696 | int main(void) { return 0; } |
| 697 | EOF |
| 698 | } |
| 699 | |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 700 | write_c_fuzzer_skeleton() { |
| 701 | cat > $TMPC <<EOF |
| 702 | #include <stdint.h> |
| 703 | #include <sys/types.h> |
| 704 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); |
| 705 | int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } |
| 706 | EOF |
| 707 | } |
| 708 | |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 709 | if check_define __linux__ ; then |
| 710 | targetos="Linux" |
| 711 | elif check_define _WIN32 ; then |
| 712 | targetos='MINGW32' |
| 713 | elif check_define __OpenBSD__ ; then |
| 714 | targetos='OpenBSD' |
| 715 | elif check_define __sun__ ; then |
| 716 | targetos='SunOS' |
| 717 | elif check_define __HAIKU__ ; then |
| 718 | targetos='Haiku' |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 719 | elif check_define __FreeBSD__ ; then |
| 720 | targetos='FreeBSD' |
| 721 | elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then |
| 722 | targetos='GNU/kFreeBSD' |
| 723 | elif check_define __DragonFly__ ; then |
| 724 | targetos='DragonFly' |
| 725 | elif check_define __NetBSD__; then |
| 726 | targetos='NetBSD' |
| 727 | elif check_define __APPLE__; then |
| 728 | targetos='Darwin' |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 729 | else |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 730 | # This is a fatal error, but don't report it yet, because we |
| 731 | # might be going to just print the --help text, or it might |
| 732 | # be the result of a missing compiler. |
| 733 | targetos='bogus' |
| 734 | bogus_os='yes' |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 735 | fi |
| 736 | |
| 737 | # Some host OSes need non-standard checks for which CPU to use. |
| 738 | # Note that these checks are broken for cross-compilation: if you're |
| 739 | # cross-compiling to one of these OSes then you'll need to specify |
| 740 | # the correct CPU with the --cpu option. |
| 741 | case $targetos in |
| 742 | Darwin) |
| 743 | # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can |
| 744 | # run 64-bit userspace code. |
| 745 | # If the user didn't specify a CPU explicitly and the kernel says this is |
| 746 | # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. |
| 747 | if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then |
| 748 | cpu="x86_64" |
| 749 | fi |
| 750 | ;; |
| 751 | SunOS) |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 752 | # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 753 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
| 754 | cpu="x86_64" |
| 755 | fi |
| 756 | esac |
| 757 | |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 758 | if test ! -z "$cpu" ; then |
| 759 | # command line argument |
| 760 | : |
| 761 | elif check_define __i386__ ; then |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 762 | cpu="i386" |
| 763 | elif check_define __x86_64__ ; then |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 764 | if check_define __ILP32__ ; then |
| 765 | cpu="x32" |
| 766 | else |
| 767 | cpu="x86_64" |
| 768 | fi |
blueswir1 | 3aa9bd6 | 2008-12-31 16:55:26 +0000 | [diff] [blame] | 769 | elif check_define __sparc__ ; then |
blueswir1 | 3aa9bd6 | 2008-12-31 16:55:26 +0000 | [diff] [blame] | 770 | if check_define __arch64__ ; then |
| 771 | cpu="sparc64" |
| 772 | else |
| 773 | cpu="sparc" |
| 774 | fi |
malc | fdf7ed9 | 2009-01-14 18:39:52 +0000 | [diff] [blame] | 775 | elif check_define _ARCH_PPC ; then |
| 776 | if check_define _ARCH_PPC64 ; then |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 777 | if check_define _LITTLE_ENDIAN ; then |
| 778 | cpu="ppc64le" |
| 779 | else |
| 780 | cpu="ppc64" |
| 781 | fi |
malc | fdf7ed9 | 2009-01-14 18:39:52 +0000 | [diff] [blame] | 782 | else |
| 783 | cpu="ppc" |
| 784 | fi |
Aurelien Jarno | afa0523 | 2009-10-17 14:17:47 +0200 | [diff] [blame] | 785 | elif check_define __mips__ ; then |
| 786 | cpu="mips" |
Aurelien Jarno | d66ed0e | 2010-06-13 12:28:21 +0200 | [diff] [blame] | 787 | elif check_define __s390__ ; then |
| 788 | if check_define __s390x__ ; then |
| 789 | cpu="s390x" |
| 790 | else |
| 791 | cpu="s390" |
| 792 | fi |
Alistair Francis | c4f8054 | 2018-12-19 19:20:19 +0000 | [diff] [blame] | 793 | elif check_define __riscv ; then |
| 794 | if check_define _LP64 ; then |
| 795 | cpu="riscv64" |
| 796 | else |
| 797 | cpu="riscv32" |
| 798 | fi |
Peter Maydell | 21d89f8 | 2011-11-30 10:57:48 +0100 | [diff] [blame] | 799 | elif check_define __arm__ ; then |
| 800 | cpu="arm" |
Claudio Fontana | 1f08031 | 2013-06-12 16:20:23 +0100 | [diff] [blame] | 801 | elif check_define __aarch64__ ; then |
| 802 | cpu="aarch64" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 803 | else |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 804 | cpu=$(uname -m) |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 805 | fi |
| 806 | |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 807 | ARCH= |
| 808 | # Normalise host CPU name and set ARCH. |
| 809 | # Note that this case should only have supported host CPUs, not guests. |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 810 | case "$cpu" in |
Thomas Huth | ee35e96 | 2019-09-28 21:03:34 +0200 | [diff] [blame] | 811 | ppc|ppc64|s390x|sparc64|x32|riscv32|riscv64) |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 812 | ;; |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 813 | ppc64le) |
| 814 | ARCH="ppc64" |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 815 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 816 | i386|i486|i586|i686|i86pc|BePC) |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 817 | cpu="i386" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 818 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 819 | x86_64|amd64) |
| 820 | cpu="x86_64" |
| 821 | ;; |
Peter Maydell | 21d89f8 | 2011-11-30 10:57:48 +0100 | [diff] [blame] | 822 | armv*b|armv*l|arm) |
| 823 | cpu="arm" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 824 | ;; |
Claudio Fontana | 1f08031 | 2013-06-12 16:20:23 +0100 | [diff] [blame] | 825 | aarch64) |
| 826 | cpu="aarch64" |
| 827 | ;; |
Aurelien Jarno | afa0523 | 2009-10-17 14:17:47 +0200 | [diff] [blame] | 828 | mips*) |
| 829 | cpu="mips" |
| 830 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 831 | sparc|sun4[cdmuv]) |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 832 | cpu="sparc" |
| 833 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 834 | *) |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 835 | # This will result in either an error or falling back to TCI later |
| 836 | ARCH=unknown |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 837 | ;; |
| 838 | esac |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 839 | if test -z "$ARCH"; then |
| 840 | ARCH="$cpu" |
| 841 | fi |
Juan Quintela | e2d52ad | 2009-08-12 18:20:24 +0200 | [diff] [blame] | 842 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 843 | # OS specific |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 844 | |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 845 | # host *BSD for user mode |
| 846 | HOST_VARIANT_DIR="" |
| 847 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 848 | case $targetos in |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 849 | MINGW32*) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 850 | mingw32="yes" |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 851 | hax="yes" |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 852 | vhost_user="no" |
Kővágó, Zoltán | 3cec7cc | 2015-06-03 23:03:46 +0200 | [diff] [blame] | 853 | audio_possible_drivers="dsound sdl" |
Gerd Hoffmann | 307119e | 2015-06-10 09:07:35 +0200 | [diff] [blame] | 854 | if check_include dsound.h; then |
| 855 | audio_drv_list="dsound" |
| 856 | else |
| 857 | audio_drv_list="" |
| 858 | fi |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 859 | supported_os="yes" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 860 | ;; |
ths | 5c40d2b | 2007-06-23 16:03:36 +0000 | [diff] [blame] | 861 | GNU/kFreeBSD) |
Aurelien Jarno | a167ba5 | 2009-11-29 18:00:41 +0100 | [diff] [blame] | 862 | bsd="yes" |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 863 | audio_drv_list="oss try-sdl" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 864 | audio_possible_drivers="oss sdl pa" |
ths | 5c40d2b | 2007-06-23 16:03:36 +0000 | [diff] [blame] | 865 | ;; |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 866 | FreeBSD) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 867 | bsd="yes" |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 868 | make="${MAKE-gmake}" |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 869 | audio_drv_list="oss try-sdl" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 870 | audio_possible_drivers="oss sdl pa" |
Juergen Lock | f01576f | 2010-03-25 22:32:16 +0100 | [diff] [blame] | 871 | # needed for kinfo_getvmmap(3) in libutil.h |
| 872 | LIBS="-lutil $LIBS" |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 873 | netmap="" # enable netmap autodetect |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 874 | HOST_VARIANT_DIR="freebsd" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 875 | ;; |
blueswir1 | c5e9723 | 2009-03-07 20:06:23 +0000 | [diff] [blame] | 876 | DragonFly) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 877 | bsd="yes" |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 878 | make="${MAKE-gmake}" |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 879 | audio_drv_list="oss try-sdl" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 880 | audio_possible_drivers="oss sdl pa" |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 881 | HOST_VARIANT_DIR="dragonfly" |
blueswir1 | c5e9723 | 2009-03-07 20:06:23 +0000 | [diff] [blame] | 882 | ;; |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 883 | NetBSD) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 884 | bsd="yes" |
Kamil Rytarowski | 604a5b9 | 2019-02-08 00:37:04 +0100 | [diff] [blame] | 885 | hax="yes" |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 886 | make="${MAKE-gmake}" |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 887 | audio_drv_list="oss try-sdl" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 888 | audio_possible_drivers="oss sdl" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 889 | oss_lib="-lossaudio" |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 890 | HOST_VARIANT_DIR="netbsd" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 891 | ;; |
| 892 | OpenBSD) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 893 | bsd="yes" |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 894 | make="${MAKE-gmake}" |
Gerd Hoffmann | f92c716 | 2019-01-24 12:20:52 +0100 | [diff] [blame] | 895 | audio_drv_list="try-sdl" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 896 | audio_possible_drivers="sdl" |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 897 | HOST_VARIANT_DIR="openbsd" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 898 | ;; |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 899 | Darwin) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 900 | bsd="yes" |
| 901 | darwin="yes" |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 902 | hax="yes" |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 903 | hvf="yes" |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 904 | LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 905 | if [ "$cpu" = "x86_64" ] ; then |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame] | 906 | QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 907 | QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 908 | fi |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 909 | cocoa="yes" |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 910 | audio_drv_list="coreaudio try-sdl" |
Kővágó, Zoltán | 1438260 | 2015-06-03 23:03:45 +0200 | [diff] [blame] | 911 | audio_possible_drivers="coreaudio sdl" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 912 | QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS" |
Peter Maydell | a0b7cf6 | 2012-08-11 22:34:39 +0100 | [diff] [blame] | 913 | # Disable attempts to use ObjectiveC features in os/object.h since they |
| 914 | # won't work when we're compiling with gcc as a C compiler. |
| 915 | QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 916 | HOST_VARIANT_DIR="darwin" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 917 | ;; |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 918 | SunOS) |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 919 | solaris="yes" |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 920 | make="${MAKE-gmake}" |
| 921 | install="${INSTALL-ginstall}" |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 922 | smbd="${SMBD-/usr/sfw/sbin/smbd}" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 923 | if test -f /usr/include/sys/soundcard.h ; then |
Gerd Hoffmann | 6a48541 | 2019-01-24 12:20:55 +0100 | [diff] [blame] | 924 | audio_drv_list="oss try-sdl" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 925 | fi |
| 926 | audio_possible_drivers="oss sdl" |
Blue Swirl | d741429 | 2009-09-12 12:36:04 +0000 | [diff] [blame] | 927 | # needed for CMSG_ macros in sys/socket.h |
| 928 | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" |
| 929 | # needed for TIOCWIN* defines in termios.h |
| 930 | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" |
Andreas Färber | 560d375 | 2012-04-30 18:00:55 +0200 | [diff] [blame] | 931 | solarisnetlibs="-lsocket -lnsl -lresolv" |
| 932 | LIBS="$solarisnetlibs $LIBS" |
ths | 86b2bd9 | 2007-02-11 00:31:33 +0000 | [diff] [blame] | 933 | ;; |
Andreas Färber | 179cf40 | 2010-09-20 00:50:43 +0200 | [diff] [blame] | 934 | Haiku) |
| 935 | haiku="yes" |
David CARLIER | fc43343 | 2020-07-13 14:36:08 +0100 | [diff] [blame] | 936 | QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -DBSD_SOURCE $QEMU_CFLAGS" |
| 937 | LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS" |
Andreas Färber | 179cf40 | 2010-09-20 00:50:43 +0200 | [diff] [blame] | 938 | ;; |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 939 | Linux) |
Gerd Hoffmann | 7183834 | 2019-02-19 13:42:57 +0100 | [diff] [blame] | 940 | audio_drv_list="try-pa oss" |
Kővágó, Zoltán | 0bac111 | 2015-06-03 23:03:44 +0200 | [diff] [blame] | 941 | audio_possible_drivers="oss alsa sdl pa" |
Juan Quintela | 0dbfc67 | 2009-08-03 14:46:13 +0200 | [diff] [blame] | 942 | linux="yes" |
| 943 | linux_user="yes" |
Jan Kiszka | af2be20 | 2011-06-23 10:05:12 +0200 | [diff] [blame] | 944 | kvm="yes" |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 945 | QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES" |
Tomáš Golembiovský | 3efac6e | 2018-10-23 13:23:10 +0200 | [diff] [blame] | 946 | libudev="yes" |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 947 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 948 | esac |
| 949 | |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 950 | if [ "$bsd" = "yes" ] ; then |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 951 | if [ "$darwin" != "yes" ] ; then |
Andreas Färber | 08de394 | 2012-04-26 11:57:39 +0200 | [diff] [blame] | 952 | bsd_user="yes" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 953 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 954 | fi |
| 955 | |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 956 | : ${make=${MAKE-make}} |
| 957 | : ${install=${INSTALL-install}} |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 958 | # We prefer python 3.x. A bare 'python' is traditionally |
| 959 | # python 2.x, but some distros have it as python 3.x, so |
Eduardo Habkost | ddf9069 | 2019-10-16 19:42:37 -0300 | [diff] [blame] | 960 | # we check that too |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 961 | python= |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 962 | explicit_python=no |
Eduardo Habkost | ddf9069 | 2019-10-16 19:42:37 -0300 | [diff] [blame] | 963 | for binary in "${PYTHON-python3}" python |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 964 | do |
| 965 | if has "$binary" |
| 966 | then |
Paolo Bonzini | 95c5f2d | 2019-06-10 12:03:44 +0200 | [diff] [blame] | 967 | python=$(command -v "$binary") |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 968 | break |
| 969 | fi |
| 970 | done |
Markus Armbruster | 903458c | 2020-02-14 18:18:41 +0100 | [diff] [blame] | 971 | |
| 972 | sphinx_build= |
| 973 | for binary in sphinx-build-3 sphinx-build |
| 974 | do |
| 975 | if has "$binary" |
| 976 | then |
| 977 | sphinx_build=$(command -v "$binary") |
| 978 | break |
| 979 | fi |
| 980 | done |
| 981 | |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 982 | # Check for ancillary tools used in testing |
| 983 | genisoimage= |
Alex Bennée | 3df437c | 2020-05-19 09:22:48 -0400 | [diff] [blame] | 984 | for binary in genisoimage mkisofs |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 985 | do |
| 986 | if has $binary |
| 987 | then |
| 988 | genisoimage=$(command -v "$binary") |
| 989 | break |
| 990 | fi |
| 991 | done |
| 992 | |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 993 | : ${smbd=${SMBD-/usr/sbin/smbd}} |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 994 | |
Peter Maydell | 3c4a4d0 | 2012-08-11 22:34:40 +0100 | [diff] [blame] | 995 | # Default objcc to clang if available, otherwise use CC |
| 996 | if has clang; then |
| 997 | objcc=clang |
| 998 | else |
| 999 | objcc="$cc" |
| 1000 | fi |
| 1001 | |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 1002 | if test "$mingw32" = "yes" ; then |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 1003 | EXESUF=".exe" |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 1004 | HOST_DSOSUF=".dll" |
Stefan Weil | 78e9d4a | 2015-11-26 12:13:12 +0100 | [diff] [blame] | 1005 | # MinGW needs -mthreads for TLS and macro _MT. |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 1006 | CFLAGS="-mthreads $CFLAGS" |
Paolo Bonzini | b965e8c | 2019-12-11 14:41:51 +0100 | [diff] [blame] | 1007 | LIBS="-lwinmm -lws2_32 $LIBS" |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 1008 | write_c_skeleton; |
Stefan Weil | f7cf5d5 | 2012-03-10 11:14:32 +0100 | [diff] [blame] | 1009 | if compile_prog "" "-liberty" ; then |
| 1010 | LIBS="-liberty $LIBS" |
| 1011 | fi |
Stefan Weil | c5ec15e | 2012-04-07 09:23:38 +0200 | [diff] [blame] | 1012 | prefix="c:/Program Files/QEMU" |
Paolo Bonzini | 683035d | 2010-05-26 16:08:28 +0200 | [diff] [blame] | 1013 | confsuffix="" |
Bishara AbuHattoum | 105fad6 | 2017-08-22 16:55:04 +0300 | [diff] [blame] | 1014 | libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga" |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 1015 | fi |
| 1016 | |
Anthony Liguori | 487fefd | 2009-06-11 13:28:25 -0500 | [diff] [blame] | 1017 | werror="" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 1018 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1019 | for opt do |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 1020 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1021 | case "$opt" in |
bellard | 2efc326 | 2005-12-18 19:14:49 +0000 | [diff] [blame] | 1022 | --help|-h) show_help=yes |
| 1023 | ;; |
Mike Frysinger | 99123e1 | 2011-04-07 01:12:28 -0400 | [diff] [blame] | 1024 | --version|-V) exec cat $source_path/VERSION |
| 1025 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1026 | --prefix=*) prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1027 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1028 | --interp-prefix=*) interp_prefix="$optarg" |
bellard | 32ce633 | 2003-04-11 00:16:16 +0000 | [diff] [blame] | 1029 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 1030 | --cross-prefix=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1031 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 1032 | --cc=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1033 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1034 | --host-cc=*) host_cc="$optarg" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 1035 | ;; |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 1036 | --cxx=*) |
| 1037 | ;; |
Michael S. Tsirkin | e007dbe | 2013-11-24 11:38:05 +0200 | [diff] [blame] | 1038 | --iasl=*) iasl="$optarg" |
| 1039 | ;; |
Peter Maydell | 3c4a4d0 | 2012-08-11 22:34:40 +0100 | [diff] [blame] | 1040 | --objcc=*) objcc="$optarg" |
| 1041 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1042 | --make=*) make="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1043 | ;; |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 1044 | --install=*) install="$optarg" |
| 1045 | ;; |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1046 | --python=*) python="$optarg" ; explicit_python=yes |
Blue Swirl | c886edf | 2011-07-22 21:08:09 +0000 | [diff] [blame] | 1047 | ;; |
Peter Maydell | 2eb054c | 2020-02-13 17:56:18 +0000 | [diff] [blame] | 1048 | --sphinx-build=*) sphinx_build="$optarg" |
| 1049 | ;; |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1050 | --skip-meson) skip_meson=yes |
| 1051 | ;; |
| 1052 | --meson=*) meson="$optarg" |
| 1053 | ;; |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 1054 | --smbd=*) smbd="$optarg" |
| 1055 | ;; |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 1056 | --extra-cflags=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1057 | ;; |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 1058 | --extra-cxxflags=*) |
| 1059 | ;; |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 1060 | --extra-ldflags=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1061 | ;; |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 1062 | --enable-debug-info) |
| 1063 | ;; |
| 1064 | --disable-debug-info) |
| 1065 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 1066 | --cross-cc-*) |
| 1067 | ;; |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 1068 | --enable-modules) |
| 1069 | modules="yes" |
| 1070 | ;; |
Stefan Hajnoczi | 3aa88b3 | 2015-11-02 14:06:23 +0000 | [diff] [blame] | 1071 | --disable-modules) |
| 1072 | modules="no" |
| 1073 | ;; |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 1074 | --disable-module-upgrades) module_upgrades="no" |
| 1075 | ;; |
| 1076 | --enable-module-upgrades) module_upgrades="yes" |
| 1077 | ;; |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 1078 | --cpu=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1079 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1080 | --target-list=*) target_list="$optarg" |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 1081 | if test "$target_list_exclude"; then |
| 1082 | error_exit "Can't mix --target-list with --target-list-exclude" |
| 1083 | fi |
| 1084 | ;; |
| 1085 | --target-list-exclude=*) target_list_exclude="$optarg" |
| 1086 | if test "$target_list"; then |
| 1087 | error_exit "Can't mix --target-list-exclude with --target-list" |
| 1088 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1089 | ;; |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 1090 | --enable-trace-backends=*) trace_backends="$optarg" |
| 1091 | ;; |
| 1092 | # XXX: backwards compatibility |
| 1093 | --enable-trace-backend=*) trace_backends="$optarg" |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 1094 | ;; |
Paolo Bonzini | 74242e0 | 2010-12-23 11:44:02 +0100 | [diff] [blame] | 1095 | --with-trace-file=*) trace_file="$optarg" |
Prerna Saxena | 9410b56 | 2010-07-13 09:26:32 +0100 | [diff] [blame] | 1096 | ;; |
Paolo Bonzini | f349474 | 2019-01-23 14:56:17 +0800 | [diff] [blame] | 1097 | --with-default-devices) default_devices="yes" |
| 1098 | ;; |
| 1099 | --without-default-devices) default_devices="no" |
| 1100 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1101 | --enable-gprof) gprof="yes" |
| 1102 | ;; |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 1103 | --enable-gcov) gcov="yes" |
| 1104 | ;; |
Loïc Minier | 7942769 | 2010-01-31 12:23:45 +0100 | [diff] [blame] | 1105 | --static) |
| 1106 | static="yes" |
Sergei Trofimovich | 17884d7 | 2012-01-31 22:03:45 +0300 | [diff] [blame] | 1107 | QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1108 | ;; |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 1109 | --mandir=*) mandir="$optarg" |
| 1110 | ;; |
| 1111 | --bindir=*) bindir="$optarg" |
| 1112 | ;; |
Alon Levy | 3aa5d2b | 2011-05-15 12:08:59 +0300 | [diff] [blame] | 1113 | --libdir=*) libdir="$optarg" |
| 1114 | ;; |
Michael Tokarev | 8bf188a | 2012-06-07 01:11:00 +0400 | [diff] [blame] | 1115 | --libexecdir=*) libexecdir="$optarg" |
| 1116 | ;; |
Alon Levy | 0f94d6d | 2011-06-27 11:58:20 +0200 | [diff] [blame] | 1117 | --includedir=*) includedir="$optarg" |
| 1118 | ;; |
Eduardo Habkost | 528ae5b | 2012-04-18 16:55:49 -0300 | [diff] [blame] | 1119 | --datadir=*) datadir="$optarg" |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 1120 | ;; |
Eduardo Habkost | 023d3d6 | 2012-04-18 16:55:50 -0300 | [diff] [blame] | 1121 | --with-confsuffix=*) confsuffix="$optarg" |
| 1122 | ;; |
Eduardo Habkost | 850da18 | 2012-04-18 16:55:38 -0300 | [diff] [blame] | 1123 | --docdir=*) qemu_docdir="$optarg" |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 1124 | ;; |
Andre Przywara | ca2fb93 | 2010-03-08 14:09:48 +0100 | [diff] [blame] | 1125 | --sysconfdir=*) sysconfdir="$optarg" |
Anthony Liguori | 07381cc | 2010-01-21 10:30:29 -0600 | [diff] [blame] | 1126 | ;; |
Luiz Capitulino | 785c23a | 2012-10-03 18:35:57 -0300 | [diff] [blame] | 1127 | --localstatedir=*) local_statedir="$optarg" |
| 1128 | ;; |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 1129 | --firmwarepath=*) firmwarepath="$optarg" |
| 1130 | ;; |
Olaf Hering | 181ce1d | 2018-04-18 09:50:44 +0200 | [diff] [blame] | 1131 | --host=*|--build=*|\ |
| 1132 | --disable-dependency-tracking|\ |
Luiz Capitulino | 785c23a | 2012-10-03 18:35:57 -0300 | [diff] [blame] | 1133 | --sbindir=*|--sharedstatedir=*|\ |
Max Filippov | 023ddd7 | 2011-11-24 16:11:31 +0400 | [diff] [blame] | 1134 | --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ |
| 1135 | --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) |
| 1136 | # These switches are silently ignored, for compatibility with |
| 1137 | # autoconf-generated configure scripts. This allows QEMU's |
| 1138 | # configure to be used by RPM and similar macros that set |
| 1139 | # lots of directory switches by default. |
| 1140 | ;; |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1141 | --disable-sdl) sdl="disabled" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1142 | ;; |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1143 | --enable-sdl) sdl="enabled" |
Juan Quintela | c419815 | 2009-08-12 18:29:53 +0200 | [diff] [blame] | 1144 | ;; |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1145 | --disable-sdl-image) sdl_image="disabled" |
Daniel P. Berrangé | a442fe2 | 2019-01-10 12:00:47 +0000 | [diff] [blame] | 1146 | ;; |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 1147 | --enable-sdl-image) sdl_image="enabled" |
Daniel P. Berrangé | a442fe2 | 2019-01-10 12:00:47 +0000 | [diff] [blame] | 1148 | ;; |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 1149 | --disable-qom-cast-debug) qom_cast_debug="no" |
| 1150 | ;; |
| 1151 | --enable-qom-cast-debug) qom_cast_debug="yes" |
| 1152 | ;; |
Meador Inge | 983eef5 | 2012-02-24 14:00:42 +0530 | [diff] [blame] | 1153 | --disable-virtfs) virtfs="no" |
| 1154 | ;; |
| 1155 | --enable-virtfs) virtfs="yes" |
| 1156 | ;; |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 1157 | --disable-mpath) mpath="no" |
| 1158 | ;; |
| 1159 | --enable-mpath) mpath="yes" |
| 1160 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1161 | --disable-vnc) vnc="disabled" |
Jes Sorensen | 821601e | 2011-03-16 13:33:36 +0100 | [diff] [blame] | 1162 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1163 | --enable-vnc) vnc="enabled" |
Jes Sorensen | 821601e | 2011-03-16 13:33:36 +0100 | [diff] [blame] | 1164 | ;; |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 1165 | --disable-gettext) gettext="false" |
| 1166 | ;; |
| 1167 | --enable-gettext) gettext="true" |
| 1168 | ;; |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 1169 | --oss-lib=*) oss_lib="$optarg" |
| 1170 | ;; |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1171 | --audio-drv-list=*) audio_drv_list="$optarg" |
| 1172 | ;; |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 1173 | --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') |
Fam Zheng | b64ec4e | 2013-05-29 19:35:40 +0800 | [diff] [blame] | 1174 | ;; |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 1175 | --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') |
Markus Armbruster | eb85201 | 2009-10-27 18:41:44 +0100 | [diff] [blame] | 1176 | ;; |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 1177 | --enable-debug-tcg) debug_tcg="yes" |
| 1178 | ;; |
| 1179 | --disable-debug-tcg) debug_tcg="no" |
| 1180 | ;; |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 1181 | --enable-debug) |
| 1182 | # Enable debugging options that aren't excessively noisy |
| 1183 | debug_tcg="yes" |
Peter Xu | 1fcc6d4 | 2018-04-25 10:54:59 +0800 | [diff] [blame] | 1184 | debug_mutex="yes" |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 1185 | debug="yes" |
| 1186 | strip_opt="no" |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 1187 | fortify_source="no" |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 1188 | ;; |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 1189 | --enable-sanitizers) sanitizers="yes" |
| 1190 | ;; |
| 1191 | --disable-sanitizers) sanitizers="no" |
| 1192 | ;; |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 1193 | --enable-tsan) tsan="yes" |
| 1194 | ;; |
| 1195 | --disable-tsan) tsan="no" |
| 1196 | ;; |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 1197 | --enable-sparse) sparse="yes" |
| 1198 | ;; |
| 1199 | --disable-sparse) sparse="no" |
| 1200 | ;; |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 1201 | --disable-strip) strip_opt="no" |
| 1202 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1203 | --disable-vnc-sasl) vnc_sasl="disabled" |
aliguori | 2f9606b | 2009-03-06 20:27:28 +0000 | [diff] [blame] | 1204 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1205 | --enable-vnc-sasl) vnc_sasl="enabled" |
Juan Quintela | ea784e3 | 2009-08-12 18:20:29 +0200 | [diff] [blame] | 1206 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1207 | --disable-vnc-jpeg) vnc_jpeg="disabled" |
Corentin Chary | 2f6f5c7 | 2010-07-07 20:57:49 +0200 | [diff] [blame] | 1208 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1209 | --enable-vnc-jpeg) vnc_jpeg="enabled" |
Corentin Chary | 2f6f5c7 | 2010-07-07 20:57:49 +0200 | [diff] [blame] | 1210 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1211 | --disable-vnc-png) vnc_png="disabled" |
Corentin Chary | efe556a | 2010-07-07 20:57:56 +0200 | [diff] [blame] | 1212 | ;; |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 1213 | --enable-vnc-png) vnc_png="enabled" |
Corentin Chary | efe556a | 2010-07-07 20:57:56 +0200 | [diff] [blame] | 1214 | ;; |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 1215 | --disable-slirp) slirp="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1216 | ;; |
Marc-André Lureau | 7c57bdd8 | 2019-04-24 13:00:41 +0200 | [diff] [blame] | 1217 | --enable-slirp=git) slirp="git" |
| 1218 | ;; |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 1219 | --enable-slirp=system) slirp="system" |
| 1220 | ;; |
aliguori | e0e6c8c0 | 2008-07-23 18:14:33 +0000 | [diff] [blame] | 1221 | --disable-vde) vde="no" |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 1222 | ;; |
Juan Quintela | dfb278b | 2009-08-12 18:20:27 +0200 | [diff] [blame] | 1223 | --enable-vde) vde="yes" |
| 1224 | ;; |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 1225 | --disable-netmap) netmap="no" |
| 1226 | ;; |
| 1227 | --enable-netmap) netmap="yes" |
| 1228 | ;; |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 1229 | --disable-xen) xen="no" |
| 1230 | ;; |
Juan Quintela | fc321b4 | 2009-08-12 18:29:55 +0200 | [diff] [blame] | 1231 | --enable-xen) xen="yes" |
| 1232 | ;; |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 1233 | --disable-xen-pci-passthrough) xen_pci_passthrough="no" |
| 1234 | ;; |
| 1235 | --enable-xen-pci-passthrough) xen_pci_passthrough="yes" |
| 1236 | ;; |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 1237 | --disable-brlapi) brlapi="no" |
| 1238 | ;; |
Juan Quintela | 4ffcedb | 2009-08-12 18:20:26 +0200 | [diff] [blame] | 1239 | --enable-brlapi) brlapi="yes" |
| 1240 | ;; |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1241 | --disable-kvm) kvm="no" |
| 1242 | ;; |
Juan Quintela | b31a027 | 2009-08-12 18:29:56 +0200 | [diff] [blame] | 1243 | --enable-kvm) kvm="yes" |
| 1244 | ;; |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 1245 | --disable-hax) hax="no" |
zhanghailiang | 180fb75 | 2016-10-27 14:43:08 +0800 | [diff] [blame] | 1246 | ;; |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 1247 | --enable-hax) hax="yes" |
zhanghailiang | 180fb75 | 2016-10-27 14:43:08 +0800 | [diff] [blame] | 1248 | ;; |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 1249 | --disable-hvf) hvf="no" |
| 1250 | ;; |
| 1251 | --enable-hvf) hvf="yes" |
| 1252 | ;; |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 1253 | --disable-whpx) whpx="no" |
| 1254 | ;; |
| 1255 | --enable-whpx) whpx="yes" |
| 1256 | ;; |
Stefan Weil | 9195b2c | 2011-10-19 07:07:18 +0200 | [diff] [blame] | 1257 | --disable-tcg-interpreter) tcg_interpreter="no" |
| 1258 | ;; |
| 1259 | --enable-tcg-interpreter) tcg_interpreter="yes" |
| 1260 | ;; |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 1261 | --disable-cap-ng) cap_ng="no" |
| 1262 | ;; |
| 1263 | --enable-cap-ng) cap_ng="yes" |
| 1264 | ;; |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 1265 | --disable-tcg) tcg="no" |
| 1266 | ;; |
| 1267 | --enable-tcg) tcg="yes" |
| 1268 | ;; |
Yang Zhong | 5a22ab7 | 2017-12-20 21:16:46 +0800 | [diff] [blame] | 1269 | --disable-malloc-trim) malloc_trim="no" |
| 1270 | ;; |
| 1271 | --enable-malloc-trim) malloc_trim="yes" |
| 1272 | ;; |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 1273 | --disable-spice) spice="no" |
| 1274 | ;; |
| 1275 | --enable-spice) spice="yes" |
| 1276 | ;; |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 1277 | --disable-libiscsi) libiscsi="no" |
| 1278 | ;; |
| 1279 | --enable-libiscsi) libiscsi="yes" |
| 1280 | ;; |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 1281 | --disable-libnfs) libnfs="no" |
| 1282 | ;; |
| 1283 | --enable-libnfs) libnfs="yes" |
| 1284 | ;; |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 1285 | --enable-profiler) profiler="yes" |
| 1286 | ;; |
Pavel Borzenkov | 1482103 | 2011-11-10 22:40:07 +0400 | [diff] [blame] | 1287 | --disable-cocoa) cocoa="no" |
| 1288 | ;; |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 1289 | --enable-cocoa) |
| 1290 | cocoa="yes" ; |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 1291 | audio_drv_list="coreaudio $(echo $audio_drv_list | sed s,coreaudio,,g)" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1292 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 1293 | --disable-system) softmmu="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 1294 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 1295 | --enable-system) softmmu="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 1296 | ;; |
Zachary Amsden | 0953a80 | 2009-07-30 00:14:59 -1000 | [diff] [blame] | 1297 | --disable-user) |
| 1298 | linux_user="no" ; |
| 1299 | bsd_user="no" ; |
Zachary Amsden | 0953a80 | 2009-07-30 00:14:59 -1000 | [diff] [blame] | 1300 | ;; |
| 1301 | --enable-user) ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1302 | --disable-linux-user) linux_user="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 1303 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1304 | --enable-linux-user) linux_user="yes" |
| 1305 | ;; |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 1306 | --disable-bsd-user) bsd_user="no" |
| 1307 | ;; |
| 1308 | --enable-bsd-user) bsd_user="yes" |
| 1309 | ;; |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1310 | --enable-pie) pie="yes" |
Kirill A. Shutemov | 34005a0 | 2009-09-12 02:17:55 +0300 | [diff] [blame] | 1311 | ;; |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1312 | --disable-pie) pie="no" |
Kirill A. Shutemov | 34005a0 | 2009-09-12 02:17:55 +0300 | [diff] [blame] | 1313 | ;; |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 1314 | --enable-werror) werror="yes" |
| 1315 | ;; |
| 1316 | --disable-werror) werror="no" |
| 1317 | ;; |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1318 | --enable-stack-protector) stack_protector="yes" |
| 1319 | ;; |
| 1320 | --disable-stack-protector) stack_protector="no" |
| 1321 | ;; |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 1322 | --enable-safe-stack) safe_stack="yes" |
| 1323 | ;; |
| 1324 | --disable-safe-stack) safe_stack="no" |
| 1325 | ;; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1326 | --disable-curses) curses="no" |
| 1327 | ;; |
Juan Quintela | c584a6d | 2009-08-12 18:20:30 +0200 | [diff] [blame] | 1328 | --enable-curses) curses="yes" |
| 1329 | ;; |
Samuel Thibault | e08bb30 | 2019-03-11 14:51:26 +0100 | [diff] [blame] | 1330 | --disable-iconv) iconv="no" |
| 1331 | ;; |
| 1332 | --enable-iconv) iconv="yes" |
| 1333 | ;; |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 1334 | --disable-curl) curl="no" |
| 1335 | ;; |
Juan Quintela | 788c819 | 2009-08-12 18:29:47 +0200 | [diff] [blame] | 1336 | --enable-curl) curl="yes" |
| 1337 | ;; |
Juan Quintela | 2df87df | 2009-08-12 18:29:54 +0200 | [diff] [blame] | 1338 | --disable-fdt) fdt="no" |
| 1339 | ;; |
| 1340 | --enable-fdt) fdt="yes" |
| 1341 | ;; |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 1342 | --disable-linux-aio) linux_aio="no" |
| 1343 | ;; |
| 1344 | --enable-linux-aio) linux_aio="yes" |
| 1345 | ;; |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 1346 | --disable-linux-io-uring) linux_io_uring="no" |
| 1347 | ;; |
| 1348 | --enable-linux-io-uring) linux_io_uring="yes" |
| 1349 | ;; |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 1350 | --disable-attr) attr="no" |
| 1351 | ;; |
| 1352 | --enable-attr) attr="yes" |
| 1353 | ;; |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 1354 | --disable-membarrier) membarrier="no" |
| 1355 | ;; |
| 1356 | --enable-membarrier) membarrier="yes" |
| 1357 | ;; |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 1358 | --disable-blobs) blobs="no" |
| 1359 | ;; |
Thomas Huth | 7e563bf | 2018-02-15 12:06:47 +0100 | [diff] [blame] | 1360 | --with-pkgversion=*) pkgversion="$optarg" |
pbrook | 4a19f1e | 2009-04-07 23:17:49 +0000 | [diff] [blame] | 1361 | ;; |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 1362 | --with-coroutine=*) coroutine="$optarg" |
| 1363 | ;; |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 1364 | --disable-coroutine-pool) coroutine_pool="no" |
| 1365 | ;; |
| 1366 | --enable-coroutine-pool) coroutine_pool="yes" |
| 1367 | ;; |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 1368 | --enable-debug-stack-usage) debug_stack_usage="yes" |
| 1369 | ;; |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 1370 | --enable-crypto-afalg) crypto_afalg="yes" |
| 1371 | ;; |
| 1372 | --disable-crypto-afalg) crypto_afalg="no" |
| 1373 | ;; |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 1374 | --disable-docs) docs="no" |
Anthony Liguori | 70ec5dc | 2009-05-14 08:25:04 -0500 | [diff] [blame] | 1375 | ;; |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 1376 | --enable-docs) docs="yes" |
Juan Quintela | 83a3ab8 | 2009-08-12 18:29:51 +0200 | [diff] [blame] | 1377 | ;; |
Michael S. Tsirkin | d597005 | 2010-03-17 13:08:17 +0200 | [diff] [blame] | 1378 | --disable-vhost-net) vhost_net="no" |
| 1379 | ;; |
| 1380 | --enable-vhost-net) vhost_net="yes" |
| 1381 | ;; |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 1382 | --disable-vhost-crypto) vhost_crypto="no" |
| 1383 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1384 | --enable-vhost-crypto) vhost_crypto="yes" |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 1385 | ;; |
Nicholas Bellinger | 5e9be92 | 2013-03-29 01:08:16 +0000 | [diff] [blame] | 1386 | --disable-vhost-scsi) vhost_scsi="no" |
| 1387 | ;; |
| 1388 | --enable-vhost-scsi) vhost_scsi="yes" |
| 1389 | ;; |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 1390 | --disable-vhost-vsock) vhost_vsock="no" |
| 1391 | ;; |
| 1392 | --enable-vhost-vsock) vhost_vsock="yes" |
| 1393 | ;; |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 1394 | --disable-vhost-user-fs) vhost_user_fs="no" |
| 1395 | ;; |
| 1396 | --enable-vhost-user-fs) vhost_user_fs="yes" |
| 1397 | ;; |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 1398 | --disable-opengl) opengl="no" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 1399 | ;; |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 1400 | --enable-opengl) opengl="yes" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 1401 | ;; |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 1402 | --disable-rbd) rbd="no" |
| 1403 | ;; |
| 1404 | --enable-rbd) rbd="yes" |
| 1405 | ;; |
Sergei Trofimovich | 8c84cf1 | 2012-01-24 20:42:40 +0300 | [diff] [blame] | 1406 | --disable-xfsctl) xfs="no" |
| 1407 | ;; |
| 1408 | --enable-xfsctl) xfs="yes" |
| 1409 | ;; |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 1410 | --disable-smartcard) smartcard="no" |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 1411 | ;; |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 1412 | --enable-smartcard) smartcard="yes" |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 1413 | ;; |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 1414 | --disable-libusb) libusb="no" |
| 1415 | ;; |
| 1416 | --enable-libusb) libusb="yes" |
| 1417 | ;; |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 1418 | --disable-usb-redir) usb_redir="no" |
| 1419 | ;; |
| 1420 | --enable-usb-redir) usb_redir="yes" |
| 1421 | ;; |
Alon Levy | 1ece990 | 2011-07-26 12:30:40 +0300 | [diff] [blame] | 1422 | --disable-zlib-test) zlib="no" |
| 1423 | ;; |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 1424 | --disable-lzo) lzo="no" |
| 1425 | ;; |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 1426 | --enable-lzo) lzo="yes" |
| 1427 | ;; |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 1428 | --disable-snappy) snappy="no" |
| 1429 | ;; |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 1430 | --enable-snappy) snappy="yes" |
| 1431 | ;; |
Peter Wu | 6b383c0 | 2015-01-06 18:48:14 +0100 | [diff] [blame] | 1432 | --disable-bzip2) bzip2="no" |
| 1433 | ;; |
| 1434 | --enable-bzip2) bzip2="yes" |
| 1435 | ;; |
Julio Faracco | 83bc1f9 | 2018-11-05 13:08:04 -0200 | [diff] [blame] | 1436 | --enable-lzfse) lzfse="yes" |
| 1437 | ;; |
| 1438 | --disable-lzfse) lzfse="no" |
| 1439 | ;; |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 1440 | --disable-zstd) zstd="no" |
| 1441 | ;; |
| 1442 | --enable-zstd) zstd="yes" |
| 1443 | ;; |
Michael Roth | d138cee | 2011-08-01 14:52:57 -0500 | [diff] [blame] | 1444 | --enable-guest-agent) guest_agent="yes" |
| 1445 | ;; |
| 1446 | --disable-guest-agent) guest_agent="no" |
| 1447 | ;; |
Yossi Hindin | 9dacf32 | 2015-05-06 14:57:40 +0300 | [diff] [blame] | 1448 | --enable-guest-agent-msi) guest_agent_msi="yes" |
| 1449 | ;; |
| 1450 | --disable-guest-agent-msi) guest_agent_msi="no" |
| 1451 | ;; |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 1452 | --with-vss-sdk) vss_win32_sdk="" |
| 1453 | ;; |
| 1454 | --with-vss-sdk=*) vss_win32_sdk="$optarg" |
| 1455 | ;; |
| 1456 | --without-vss-sdk) vss_win32_sdk="no" |
| 1457 | ;; |
| 1458 | --with-win-sdk) win_sdk="" |
| 1459 | ;; |
| 1460 | --with-win-sdk=*) win_sdk="$optarg" |
| 1461 | ;; |
| 1462 | --without-win-sdk) win_sdk="no" |
| 1463 | ;; |
Daniel P. Berrange | 4b1c11f | 2012-09-10 12:26:29 +0100 | [diff] [blame] | 1464 | --enable-tools) want_tools="yes" |
| 1465 | ;; |
| 1466 | --disable-tools) want_tools="no" |
| 1467 | ;; |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 1468 | --enable-seccomp) seccomp="yes" |
| 1469 | ;; |
| 1470 | --disable-seccomp) seccomp="no" |
| 1471 | ;; |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 1472 | --disable-glusterfs) glusterfs="no" |
| 1473 | ;; |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 1474 | --disable-avx2) avx2_opt="no" |
| 1475 | ;; |
| 1476 | --enable-avx2) avx2_opt="yes" |
| 1477 | ;; |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 1478 | --disable-avx512f) avx512f_opt="no" |
| 1479 | ;; |
| 1480 | --enable-avx512f) avx512f_opt="yes" |
| 1481 | ;; |
| 1482 | |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 1483 | --enable-glusterfs) glusterfs="yes" |
| 1484 | ;; |
Fam Zheng | 52b53c0 | 2014-09-10 14:17:51 +0800 | [diff] [blame] | 1485 | --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) |
| 1486 | echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 |
Stefan Hajnoczi | 583f6e7 | 2012-11-14 15:04:15 +0100 | [diff] [blame] | 1487 | ;; |
Fam Zheng | cb6414d | 2016-09-21 12:27:16 +0800 | [diff] [blame] | 1488 | --enable-vhdx|--disable-vhdx) |
| 1489 | echo "$0: $opt is obsolete, VHDX driver is always built" >&2 |
| 1490 | ;; |
Fam Zheng | 315d318 | 2016-09-21 12:27:21 +0800 | [diff] [blame] | 1491 | --enable-uuid|--disable-uuid) |
| 1492 | echo "$0: $opt is obsolete, UUID support is always built" >&2 |
| 1493 | ;; |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 1494 | --disable-gtk) gtk="no" |
| 1495 | ;; |
| 1496 | --enable-gtk) gtk="yes" |
| 1497 | ;; |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 1498 | --tls-priority=*) tls_priority="$optarg" |
| 1499 | ;; |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 1500 | --disable-gnutls) gnutls="no" |
| 1501 | ;; |
| 1502 | --enable-gnutls) gnutls="yes" |
| 1503 | ;; |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 1504 | --disable-nettle) nettle="no" |
| 1505 | ;; |
| 1506 | --enable-nettle) nettle="yes" |
| 1507 | ;; |
| 1508 | --disable-gcrypt) gcrypt="no" |
| 1509 | ;; |
| 1510 | --enable-gcrypt) gcrypt="yes" |
| 1511 | ;; |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 1512 | --disable-auth-pam) auth_pam="no" |
| 1513 | ;; |
| 1514 | --enable-auth-pam) auth_pam="yes" |
| 1515 | ;; |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 1516 | --enable-rdma) rdma="yes" |
| 1517 | ;; |
| 1518 | --disable-rdma) rdma="no" |
| 1519 | ;; |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 1520 | --enable-pvrdma) pvrdma="yes" |
| 1521 | ;; |
| 1522 | --disable-pvrdma) pvrdma="no" |
| 1523 | ;; |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 1524 | --disable-vte) vte="no" |
| 1525 | ;; |
| 1526 | --enable-vte) vte="yes" |
| 1527 | ;; |
Gerd Hoffmann | 9d9e152 | 2014-07-11 12:51:43 +0200 | [diff] [blame] | 1528 | --disable-virglrenderer) virglrenderer="no" |
| 1529 | ;; |
| 1530 | --enable-virglrenderer) virglrenderer="yes" |
| 1531 | ;; |
Cole Robinson | e91c793 | 2014-06-16 15:32:47 -0400 | [diff] [blame] | 1532 | --disable-tpm) tpm="no" |
| 1533 | ;; |
Stefan Berger | ab214c2 | 2013-02-27 12:47:52 -0500 | [diff] [blame] | 1534 | --enable-tpm) tpm="yes" |
| 1535 | ;; |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 1536 | --disable-libssh) libssh="no" |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 1537 | ;; |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 1538 | --enable-libssh) libssh="yes" |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 1539 | ;; |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 1540 | --disable-live-block-migration) live_block_migration="no" |
| 1541 | ;; |
| 1542 | --enable-live-block-migration) live_block_migration="yes" |
| 1543 | ;; |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 1544 | --disable-numa) numa="no" |
| 1545 | ;; |
| 1546 | --enable-numa) numa="yes" |
| 1547 | ;; |
Klim Kireev | ed279a0 | 2018-01-12 12:01:19 +0300 | [diff] [blame] | 1548 | --disable-libxml2) libxml2="no" |
| 1549 | ;; |
| 1550 | --enable-libxml2) libxml2="yes" |
| 1551 | ;; |
Fam Zheng | 2847b46 | 2015-03-26 11:03:12 +0800 | [diff] [blame] | 1552 | --disable-tcmalloc) tcmalloc="no" |
| 1553 | ;; |
| 1554 | --enable-tcmalloc) tcmalloc="yes" |
| 1555 | ;; |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 1556 | --disable-jemalloc) jemalloc="no" |
| 1557 | ;; |
| 1558 | --enable-jemalloc) jemalloc="yes" |
| 1559 | ;; |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 1560 | --disable-replication) replication="no" |
| 1561 | ;; |
| 1562 | --enable-replication) replication="yes" |
| 1563 | ;; |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 1564 | --disable-bochs) bochs="no" |
| 1565 | ;; |
| 1566 | --enable-bochs) bochs="yes" |
| 1567 | ;; |
| 1568 | --disable-cloop) cloop="no" |
| 1569 | ;; |
| 1570 | --enable-cloop) cloop="yes" |
| 1571 | ;; |
| 1572 | --disable-dmg) dmg="no" |
| 1573 | ;; |
| 1574 | --enable-dmg) dmg="yes" |
| 1575 | ;; |
| 1576 | --disable-qcow1) qcow1="no" |
| 1577 | ;; |
| 1578 | --enable-qcow1) qcow1="yes" |
| 1579 | ;; |
| 1580 | --disable-vdi) vdi="no" |
| 1581 | ;; |
| 1582 | --enable-vdi) vdi="yes" |
| 1583 | ;; |
| 1584 | --disable-vvfat) vvfat="no" |
| 1585 | ;; |
| 1586 | --enable-vvfat) vvfat="yes" |
| 1587 | ;; |
| 1588 | --disable-qed) qed="no" |
| 1589 | ;; |
| 1590 | --enable-qed) qed="yes" |
| 1591 | ;; |
| 1592 | --disable-parallels) parallels="no" |
| 1593 | ;; |
| 1594 | --enable-parallels) parallels="yes" |
| 1595 | ;; |
| 1596 | --disable-sheepdog) sheepdog="no" |
| 1597 | ;; |
| 1598 | --enable-sheepdog) sheepdog="yes" |
| 1599 | ;; |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 1600 | --disable-vhost-user) vhost_user="no" |
| 1601 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1602 | --enable-vhost-user) vhost_user="yes" |
| 1603 | ;; |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1604 | --disable-vhost-vdpa) vhost_vdpa="no" |
| 1605 | ;; |
| 1606 | --enable-vhost-vdpa) vhost_vdpa="yes" |
| 1607 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1608 | --disable-vhost-kernel) vhost_kernel="no" |
| 1609 | ;; |
| 1610 | --enable-vhost-kernel) vhost_kernel="yes" |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 1611 | ;; |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 1612 | --disable-capstone) capstone="no" |
| 1613 | ;; |
| 1614 | --enable-capstone) capstone="yes" |
| 1615 | ;; |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 1616 | --enable-capstone=git) capstone="git" |
| 1617 | ;; |
| 1618 | --enable-capstone=system) capstone="system" |
| 1619 | ;; |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 1620 | --with-git=*) git="$optarg" |
| 1621 | ;; |
Daniel P. Berrange | f62bbee | 2017-10-26 13:52:26 +0100 | [diff] [blame] | 1622 | --enable-git-update) git_update=yes |
| 1623 | ;; |
| 1624 | --disable-git-update) git_update=no |
| 1625 | ;; |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 1626 | --enable-debug-mutex) debug_mutex=yes |
| 1627 | ;; |
| 1628 | --disable-debug-mutex) debug_mutex=no |
| 1629 | ;; |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 1630 | --enable-libpmem) libpmem=yes |
| 1631 | ;; |
| 1632 | --disable-libpmem) libpmem=no |
| 1633 | ;; |
James Le Cuirot | 7541191 | 2019-09-14 15:51:55 +0100 | [diff] [blame] | 1634 | --enable-xkbcommon) xkbcommon=yes |
| 1635 | ;; |
| 1636 | --disable-xkbcommon) xkbcommon=no |
| 1637 | ;; |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 1638 | --enable-plugins) plugins="yes" |
| 1639 | ;; |
| 1640 | --disable-plugins) plugins="no" |
| 1641 | ;; |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 1642 | --enable-containers) use_containers="yes" |
| 1643 | ;; |
| 1644 | --disable-containers) use_containers="no" |
| 1645 | ;; |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 1646 | --enable-fuzzing) fuzzing=yes |
| 1647 | ;; |
| 1648 | --disable-fuzzing) fuzzing=no |
| 1649 | ;; |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 1650 | --gdb=*) gdb_bin="$optarg" |
| 1651 | ;; |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 1652 | --enable-rng-none) rng_none=yes |
| 1653 | ;; |
| 1654 | --disable-rng-none) rng_none=no |
| 1655 | ;; |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 1656 | --enable-keyring) secret_keyring="yes" |
| 1657 | ;; |
| 1658 | --disable-keyring) secret_keyring="no" |
| 1659 | ;; |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 1660 | --enable-libdaxctl) libdaxctl=yes |
| 1661 | ;; |
| 1662 | --disable-libdaxctl) libdaxctl=no |
| 1663 | ;; |
Fam Zheng | 2d2ad6d | 2014-04-18 14:55:36 +0800 | [diff] [blame] | 1664 | *) |
| 1665 | echo "ERROR: unknown option $opt" |
| 1666 | echo "Try '$0 --help' for more information" |
| 1667 | exit 1 |
balrog | 7f1559c | 2007-11-17 10:24:32 +0000 | [diff] [blame] | 1668 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1669 | esac |
| 1670 | done |
| 1671 | |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1672 | libdir="${libdir:-$prefix/lib}" |
| 1673 | libexecdir="${libexecdir:-$prefix/libexec}" |
| 1674 | includedir="${includedir:-$prefix/include}" |
| 1675 | |
| 1676 | if test "$mingw32" = "yes" ; then |
| 1677 | mandir="$prefix" |
| 1678 | datadir="$prefix" |
| 1679 | qemu_docdir="$prefix" |
| 1680 | bindir="$prefix" |
| 1681 | sysconfdir="$prefix" |
| 1682 | local_statedir= |
| 1683 | else |
| 1684 | mandir="${mandir:-$prefix/share/man}" |
| 1685 | datadir="${datadir:-$prefix/share}" |
| 1686 | qemu_docdir="${qemu_docdir:-$prefix/share/doc/qemu}" |
| 1687 | bindir="${bindir:-$prefix/bin}" |
| 1688 | sysconfdir="${sysconfdir:-$prefix/etc}" |
| 1689 | local_statedir="${local_statedir:-$prefix/var}" |
| 1690 | fi |
| 1691 | |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 1692 | case "$cpu" in |
Richard Henderson | e3608d6 | 2013-08-28 15:48:21 -0700 | [diff] [blame] | 1693 | ppc) |
| 1694 | CPU_CFLAGS="-m32" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1695 | QEMU_LDFLAGS="-m32 $QEMU_LDFLAGS" |
Richard Henderson | e3608d6 | 2013-08-28 15:48:21 -0700 | [diff] [blame] | 1696 | ;; |
| 1697 | ppc64) |
| 1698 | CPU_CFLAGS="-m64" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1699 | QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" |
Richard Henderson | e3608d6 | 2013-08-28 15:48:21 -0700 | [diff] [blame] | 1700 | ;; |
Richard Henderson | 9b9c37c | 2012-09-21 10:34:21 -0700 | [diff] [blame] | 1701 | sparc) |
Richard Henderson | f1079bb | 2017-04-26 10:39:08 -0700 | [diff] [blame] | 1702 | CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1703 | QEMU_LDFLAGS="-m32 -mv8plus $QEMU_LDFLAGS" |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1704 | ;; |
Juan Quintela | ed968ff | 2009-08-03 14:46:11 +0200 | [diff] [blame] | 1705 | sparc64) |
Peter Crosthwaite | 79f3b12 | 2013-04-18 14:46:14 +1000 | [diff] [blame] | 1706 | CPU_CFLAGS="-m64 -mcpu=ultrasparc" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1707 | QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1708 | ;; |
ths | 76d83bd | 2007-11-18 21:22:10 +0000 | [diff] [blame] | 1709 | s390) |
Richard Henderson | 061cdd8 | 2014-03-31 13:40:49 -0400 | [diff] [blame] | 1710 | CPU_CFLAGS="-m31" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1711 | QEMU_LDFLAGS="-m31 $QEMU_LDFLAGS" |
Richard Henderson | 28d7cc4 | 2010-06-04 12:14:09 -0700 | [diff] [blame] | 1712 | ;; |
| 1713 | s390x) |
Richard Henderson | 061cdd8 | 2014-03-31 13:40:49 -0400 | [diff] [blame] | 1714 | CPU_CFLAGS="-m64" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1715 | QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" |
ths | 76d83bd | 2007-11-18 21:22:10 +0000 | [diff] [blame] | 1716 | ;; |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 1717 | i386) |
Peter Crosthwaite | 79f3b12 | 2013-04-18 14:46:14 +1000 | [diff] [blame] | 1718 | CPU_CFLAGS="-m32" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1719 | QEMU_LDFLAGS="-m32 $QEMU_LDFLAGS" |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 1720 | ;; |
| 1721 | x86_64) |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 1722 | # ??? Only extremely old AMD cpus do not have cmpxchg16b. |
| 1723 | # If we truly care, we should simply detect this case at |
| 1724 | # runtime and generate the fallback to serial emulation. |
| 1725 | CPU_CFLAGS="-m64 -mcx16" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1726 | QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" |
Paul Brook | 379f669 | 2009-07-17 12:48:08 +0100 | [diff] [blame] | 1727 | ;; |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 1728 | x32) |
| 1729 | CPU_CFLAGS="-mx32" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1730 | QEMU_LDFLAGS="-mx32 $QEMU_LDFLAGS" |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 1731 | ;; |
Peter Maydell | 30163d8 | 2012-10-09 03:16:49 +0000 | [diff] [blame] | 1732 | # No special flags required for other host CPUs |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1733 | esac |
| 1734 | |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 1735 | eval "cross_cc_${cpu}=\$host_cc" |
| 1736 | cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" |
Peter Crosthwaite | 79f3b12 | 2013-04-18 14:46:14 +1000 | [diff] [blame] | 1737 | QEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" |
Peter Crosthwaite | 79f3b12 | 2013-04-18 14:46:14 +1000 | [diff] [blame] | 1738 | |
Peter Maydell | affc88c | 2016-06-13 11:32:24 +0100 | [diff] [blame] | 1739 | # For user-mode emulation the host arch has to be one we explicitly |
| 1740 | # support, even if we're using TCI. |
| 1741 | if [ "$ARCH" = "unknown" ]; then |
| 1742 | bsd_user="no" |
| 1743 | linux_user="no" |
| 1744 | fi |
| 1745 | |
Philippe Mathieu-Daudé | 1cf295b | 2020-05-22 19:24:59 +0200 | [diff] [blame] | 1746 | if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then |
| 1747 | tcg="no" |
| 1748 | fi |
| 1749 | |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1750 | default_target_list="" |
| 1751 | |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1752 | mak_wilds="" |
| 1753 | |
| 1754 | if [ "$softmmu" = "yes" ]; then |
| 1755 | mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1756 | fi |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1757 | if [ "$linux_user" = "yes" ]; then |
| 1758 | mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1759 | fi |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1760 | if [ "$bsd_user" = "yes" ]; then |
| 1761 | mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1762 | fi |
| 1763 | |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 1764 | if test -z "$target_list_exclude"; then |
| 1765 | for config in $mak_wilds; do |
| 1766 | default_target_list="${default_target_list} $(basename "$config" .mak)" |
| 1767 | done |
| 1768 | else |
| 1769 | exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g') |
| 1770 | for config in $mak_wilds; do |
| 1771 | target="$(basename "$config" .mak)" |
| 1772 | exclude="no" |
| 1773 | for excl in $exclude_list; do |
| 1774 | if test "$excl" = "$target"; then |
| 1775 | exclude="yes" |
| 1776 | break; |
| 1777 | fi |
| 1778 | done |
| 1779 | if test "$exclude" = "no"; then |
| 1780 | default_target_list="${default_target_list} $target" |
| 1781 | fi |
| 1782 | done |
| 1783 | fi |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1784 | |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1785 | # Enumerate public trace backends for --help output |
Greg Kurz | 64a6047 | 2017-04-26 15:36:07 +0200 | [diff] [blame] | 1786 | trace_backend_list=$(echo $(grep -le '^PUBLIC = True$' "$source_path"/scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/')) |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1787 | |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1788 | if test x"$show_help" = x"yes" ; then |
| 1789 | cat << EOF |
| 1790 | |
| 1791 | Usage: configure [options] |
| 1792 | Options: [defaults in brackets after descriptions] |
| 1793 | |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1794 | Standard options: |
| 1795 | --help print this message |
| 1796 | --prefix=PREFIX install in PREFIX [$prefix] |
| 1797 | --interp-prefix=PREFIX where to find shared libraries, etc. |
| 1798 | use %M for cpu name [$interp_prefix] |
| 1799 | --target-list=LIST set target list (default: build everything) |
| 1800 | $(echo Available targets: $default_target_list | \ |
| 1801 | fold -s -w 53 | sed -e 's/^/ /') |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 1802 | --target-list-exclude=LIST exclude a set of targets from the default target-list |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1803 | |
| 1804 | Advanced options (experts only): |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1805 | --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] |
| 1806 | --cc=CC use C compiler CC [$cc] |
| 1807 | --iasl=IASL use ACPI compiler IASL [$iasl] |
| 1808 | --host-cc=CC use C compiler CC [$host_cc] for code run at |
| 1809 | build time |
| 1810 | --cxx=CXX use C++ compiler CXX [$cxx] |
| 1811 | --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] |
| 1812 | --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 1813 | --extra-cxxflags=CXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1814 | --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 1815 | --cross-cc-ARCH=CC use compiler when building ARCH guest test cases |
Alex Bennée | d422b2b | 2018-04-13 11:07:58 +0100 | [diff] [blame] | 1816 | --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1817 | --make=MAKE use specified make [$make] |
| 1818 | --install=INSTALL use specified install [$install] |
| 1819 | --python=PYTHON use specified python [$python] |
Peter Maydell | 2eb054c | 2020-02-13 17:56:18 +0000 | [diff] [blame] | 1820 | --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1821 | --meson=MESON use specified meson [$meson] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1822 | --smbd=SMBD use specified smbd [$smbd] |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1823 | --with-git=GIT use specified git [$git] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1824 | --static enable static build [$static] |
| 1825 | --mandir=PATH install man pages in PATH |
| 1826 | --datadir=PATH install firmware in PATH$confsuffix |
| 1827 | --docdir=PATH install documentation in PATH$confsuffix |
| 1828 | --bindir=PATH install binaries in PATH |
| 1829 | --libdir=PATH install libraries in PATH |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1830 | --libexecdir=PATH install helper binaries in PATH |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1831 | --sysconfdir=PATH install config in PATH$confsuffix |
| 1832 | --localstatedir=PATH install local state in PATH (set at runtime on win32) |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 1833 | --firmwarepath=PATH search PATH for firmware files |
Robert Foley | 1333660 | 2020-07-01 14:56:21 +0100 | [diff] [blame] | 1834 | --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 1835 | --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1836 | --with-pkgversion=VERS use specified string as sub-version of the package |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1837 | --enable-debug enable common debug build options |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 1838 | --enable-sanitizers enable default sanitizers |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 1839 | --enable-tsan enable thread sanitizer |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1840 | --disable-strip disable stripping binaries |
| 1841 | --disable-werror disable compilation abort on warning |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1842 | --disable-stack-protector disable compiler-provided stack protection |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1843 | --audio-drv-list=LIST set audio drivers list: |
| 1844 | Available drivers: $audio_possible_drivers |
| 1845 | --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L |
| 1846 | --block-drv-rw-whitelist=L |
| 1847 | set block driver read-write whitelist |
| 1848 | (affects only QEMU, not qemu-img) |
| 1849 | --block-drv-ro-whitelist=L |
| 1850 | set block driver read-only whitelist |
| 1851 | (affects only QEMU, not qemu-img) |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 1852 | --enable-trace-backends=B Set trace backend |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1853 | Available backends: $trace_backend_list |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1854 | --with-trace-file=NAME Full PATH,NAME of file to store traces |
| 1855 | Default:trace-<pid> |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1856 | --disable-slirp disable SLIRP userspace network connectivity |
| 1857 | --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) |
Yang Zhong | 5a22ab7 | 2017-12-20 21:16:46 +0800 | [diff] [blame] | 1858 | --enable-malloc-trim enable libc malloc_trim() for memory optimization |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1859 | --oss-lib path to OSS library |
| 1860 | --cpu=CPU Build for host CPU [$cpu] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1861 | --with-coroutine=BACKEND coroutine backend. Supported options: |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 1862 | ucontext, sigaltstack, windows |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1863 | --enable-gcov enable test coverage analysis with gcov |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1864 | --disable-blobs disable installing provided firmware blobs |
| 1865 | --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent |
| 1866 | --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 1867 | --tls-priority default TLS protocol/cipher priority string |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1868 | --enable-gprof QEMU profiling with gprof |
| 1869 | --enable-profiler profiler support |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1870 | --enable-debug-stack-usage |
| 1871 | track the maximum stack usage of stacks created by qemu_alloc_stack |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 1872 | --enable-plugins |
| 1873 | enable plugins via shared library loading |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 1874 | --disable-containers don't use containers for cross-building |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 1875 | --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1876 | |
| 1877 | Optional features, enabled with --enable-FEATURE and |
| 1878 | disabled with --disable-FEATURE, default is enabled if available: |
| 1879 | |
| 1880 | system all system emulation targets |
| 1881 | user supported user emulation targets |
| 1882 | linux-user all linux usermode emulation targets |
| 1883 | bsd-user all BSD usermode emulation targets |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1884 | docs build documentation |
| 1885 | guest-agent build the QEMU Guest Agent |
| 1886 | guest-agent-msi build guest agent Windows MSI installation package |
| 1887 | pie Position Independent Executables |
Marc-André Lureau | 21e709a | 2019-07-18 16:04:13 +0400 | [diff] [blame] | 1888 | modules modules support (non-Windows) |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 1889 | module-upgrades try to load modules from alternate paths for upgrades |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1890 | debug-tcg TCG debugging (default is disabled) |
| 1891 | debug-info debugging information |
| 1892 | sparse sparse checker |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 1893 | safe-stack SafeStack Stack Smash Protection. Depends on |
| 1894 | clang/llvm >= 3.7 and requires coroutine backend ucontext. |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1895 | |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 1896 | gnutls GNUTLS cryptography support |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 1897 | nettle nettle cryptography support |
| 1898 | gcrypt libgcrypt cryptography support |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 1899 | auth-pam PAM access control |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1900 | sdl SDL UI |
Markus Armbruster | 04c6e16 | 2019-05-17 20:32:46 +0200 | [diff] [blame] | 1901 | sdl-image SDL Image support for icons |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1902 | gtk gtk UI |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1903 | vte vte support for the gtk UI |
| 1904 | curses curses UI |
Samuel Thibault | e08bb30 | 2019-03-11 14:51:26 +0100 | [diff] [blame] | 1905 | iconv font glyph conversion support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1906 | vnc VNC UI support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1907 | vnc-sasl SASL encryption for VNC server |
| 1908 | vnc-jpeg JPEG lossy compression for VNC server |
| 1909 | vnc-png PNG compression for VNC server |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1910 | cocoa Cocoa UI (Mac OS X only) |
| 1911 | virtfs VirtFS |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 1912 | mpath Multipath persistent reservation passthrough |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1913 | xen xen backend driver support |
Anthony PERARD | 70c292a | 2018-05-04 10:17:56 +0100 | [diff] [blame] | 1914 | xen-pci-passthrough PCI passthrough support for Xen |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1915 | brlapi BrlAPI (Braile) |
| 1916 | curl curl connectivity |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 1917 | membarrier membarrier system call (for Linux 4.14+ or Windows) |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1918 | fdt fdt device tree |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1919 | kvm KVM acceleration support |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 1920 | hax HAX acceleration support |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 1921 | hvf Hypervisor.framework acceleration support |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 1922 | whpx Windows Hypervisor Platform acceleration support |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 1923 | rdma Enable RDMA-based migration |
| 1924 | pvrdma Enable PVRDMA support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1925 | vde support for vde network |
| 1926 | netmap support for netmap network |
| 1927 | linux-aio Linux AIO support |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 1928 | linux-io-uring Linux io_uring support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1929 | cap-ng libcap-ng support |
| 1930 | attr attr and xattr support |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1931 | vhost-net vhost-net kernel acceleration support |
| 1932 | vhost-vsock virtio sockets device support |
| 1933 | vhost-scsi vhost-scsi kernel target support |
| 1934 | vhost-crypto vhost-user-crypto backend support |
| 1935 | vhost-kernel vhost kernel backend support |
| 1936 | vhost-user vhost-user backend support |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1937 | vhost-vdpa vhost-vdpa kernel backend support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1938 | spice spice |
| 1939 | rbd rados block device (rbd) |
| 1940 | libiscsi iscsi support |
| 1941 | libnfs nfs support |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 1942 | smartcard smartcard support (libcacard) |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1943 | libusb libusb (for usb passthrough) |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 1944 | live-block-migration Block migration in the main migration stream |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1945 | usb-redir usb network redirection support |
| 1946 | lzo support of lzo compression library |
| 1947 | snappy support of snappy compression library |
| 1948 | bzip2 support of bzip2 compression library |
| 1949 | (for reading bzip2-compressed dmg images) |
Julio Faracco | 83bc1f9 | 2018-11-05 13:08:04 -0200 | [diff] [blame] | 1950 | lzfse support of lzfse compression library |
| 1951 | (for reading lzfse-compressed dmg images) |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 1952 | zstd support for zstd compression library |
Denis Plotnikov | d298ac1 | 2020-05-07 11:25:20 +0300 | [diff] [blame] | 1953 | (for migration compression and qcow2 cluster compression) |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1954 | seccomp seccomp support |
| 1955 | coroutine-pool coroutine freelist (better performance) |
| 1956 | glusterfs GlusterFS backend |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1957 | tpm TPM support |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 1958 | libssh ssh block device support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1959 | numa libnuma support |
Klim Kireev | ed279a0 | 2018-01-12 12:01:19 +0300 | [diff] [blame] | 1960 | libxml2 for Parallels image format |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1961 | tcmalloc tcmalloc support |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 1962 | jemalloc jemalloc support |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 1963 | avx2 AVX2 optimization support |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 1964 | avx512f AVX512F optimization support |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 1965 | replication replication support |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1966 | opengl opengl support |
| 1967 | virglrenderer virgl rendering support |
| 1968 | xfsctl xfsctl support |
| 1969 | qom-cast-debug cast debugging support |
Cleber Rosa | 8de73fa | 2019-02-07 14:36:03 -0500 | [diff] [blame] | 1970 | tools build qemu-io, qemu-nbd and qemu-img tools |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 1971 | bochs bochs image format support |
| 1972 | cloop cloop image format support |
| 1973 | dmg dmg image format support |
| 1974 | qcow1 qcow v1 image format support |
| 1975 | vdi vdi image format support |
| 1976 | vvfat vvfat image format support |
| 1977 | qed qed image format support |
| 1978 | parallels parallels image format support |
| 1979 | sheepdog sheepdog block driver support |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 1980 | crypto-afalg Linux AF_ALG crypto backend driver |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 1981 | capstone capstone disassembler support |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 1982 | debug-mutex mutex debugging support |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 1983 | libpmem libpmem support |
James Le Cuirot | 7541191 | 2019-09-14 15:51:55 +0100 | [diff] [blame] | 1984 | xkbcommon xkbcommon support |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 1985 | rng-none dummy RNG, avoid using /dev/(u)random and getrandom() |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 1986 | libdaxctl libdaxctl support |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1987 | |
| 1988 | NOTE: The object files are built at the place where configure is launched |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1989 | EOF |
Fam Zheng | 2d2ad6d | 2014-04-18 14:55:36 +0800 | [diff] [blame] | 1990 | exit 0 |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1991 | fi |
| 1992 | |
Thomas Huth | 9c79024 | 2019-03-11 11:20:34 +0100 | [diff] [blame] | 1993 | # Remove old dependency files to make sure that they get properly regenerated |
Thomas Huth | bb768f7 | 2019-05-10 10:11:59 +0200 | [diff] [blame] | 1994 | rm -f */config-devices.mak.d |
Thomas Huth | 9c79024 | 2019-03-11 11:20:34 +0100 | [diff] [blame] | 1995 | |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 1996 | if test -z "$python" |
| 1997 | then |
| 1998 | error_exit "Python not found. Use --python=/path/to/python" |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1999 | fi |
| 2000 | |
| 2001 | # Note that if the Python conditional here evaluates True we will exit |
| 2002 | # with status 1 which is a shell 'false' value. |
Eduardo Habkost | ddf9069 | 2019-10-16 19:42:37 -0300 | [diff] [blame] | 2003 | if ! $python -c 'import sys; sys.exit(sys.version_info < (3,5))'; then |
| 2004 | error_exit "Cannot use '$python', Python >= 3.5 is required." \ |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 2005 | "Use --python=/path/to/python to specify a supported Python." |
| 2006 | fi |
| 2007 | |
Cleber Rosa | 755ee70 | 2018-11-09 10:07:07 -0500 | [diff] [blame] | 2008 | # Preserve python version since some functionality is dependent on it |
Cleber Rosa | 406ab2f | 2019-08-26 11:58:32 -0400 | [diff] [blame] | 2009 | python_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) |
Cleber Rosa | 755ee70 | 2018-11-09 10:07:07 -0500 | [diff] [blame] | 2010 | |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 2011 | # Suppress writing compiled files |
| 2012 | python="$python -B" |
| 2013 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 2014 | if test -z "$meson"; then |
| 2015 | if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.55.0; then |
| 2016 | meson=meson |
| 2017 | elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then |
| 2018 | meson=git |
| 2019 | elif test -e "${source_path}/meson/meson.py" ; then |
| 2020 | meson=internal |
| 2021 | else |
| 2022 | if test "$explicit_python" = yes; then |
| 2023 | error_exit "--python requires using QEMU's embedded Meson distribution, but it was not found." |
| 2024 | else |
| 2025 | error_exit "Meson not found. Use --meson=/path/to/meson" |
| 2026 | fi |
| 2027 | fi |
| 2028 | else |
| 2029 | # Meson uses its own Python interpreter to invoke other Python scripts, |
| 2030 | # but the user wants to use the one they specified with --python. |
| 2031 | # |
| 2032 | # We do not want to override the distro Python interpreter (and sometimes |
| 2033 | # cannot: for example in Homebrew /usr/bin/meson is a bash script), so |
| 2034 | # just require --meson=git|internal together with --python. |
| 2035 | if test "$explicit_python" = yes; then |
| 2036 | case "$meson" in |
| 2037 | git | internal) ;; |
| 2038 | *) error_exit "--python requires using QEMU's embedded Meson distribution." ;; |
| 2039 | esac |
| 2040 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 2041 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 2042 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 2043 | if test "$meson" = git; then |
| 2044 | git_submodules="${git_submodules} meson" |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 2045 | fi |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 2046 | if test "$git_update" = yes; then |
| 2047 | (cd "${source_path}" && GIT="$git" "./scripts/git-submodule.sh" update "$git_submodules") |
| 2048 | fi |
| 2049 | |
| 2050 | case "$meson" in |
| 2051 | git | internal) |
| 2052 | if ! $python -c 'import pkg_resources' > /dev/null 2>&1; then |
| 2053 | error_exit "Python setuptools not found" |
| 2054 | fi |
| 2055 | meson="$python ${source_path}/meson/meson.py" |
| 2056 | ;; |
| 2057 | *) meson=$(command -v meson) ;; |
| 2058 | esac |
| 2059 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 2060 | |
Daniel Henrique Barboza | 9aae6e5 | 2017-11-02 07:09:06 -0200 | [diff] [blame] | 2061 | # Check that the C compiler works. Doing this here before testing |
| 2062 | # the host CPU ensures that we had a valid CC to autodetect the |
| 2063 | # $cpu var (and we should bail right here if that's not the case). |
| 2064 | # It also allows the help message to be printed without a CC. |
| 2065 | write_c_skeleton; |
| 2066 | if compile_object ; then |
| 2067 | : C compiler works ok |
| 2068 | else |
| 2069 | error_exit "\"$cc\" either does not exist or does not work" |
| 2070 | fi |
| 2071 | if ! compile_prog ; then |
| 2072 | error_exit "\"$cc\" cannot build an executable (is your linker broken?)" |
| 2073 | fi |
| 2074 | |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 2075 | # Now we have handled --enable-tcg-interpreter and know we're not just |
| 2076 | # printing the help message, bail out if the host CPU isn't supported. |
| 2077 | if test "$ARCH" = "unknown"; then |
| 2078 | if test "$tcg_interpreter" = "yes" ; then |
| 2079 | echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 2080 | else |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2081 | error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 2082 | fi |
| 2083 | fi |
| 2084 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 2085 | # Consult white-list to determine whether to enable werror |
| 2086 | # by default. Only enable by default for git builds |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 2087 | if test -z "$werror" ; then |
Alexey Kardashevskiy | fd73745 | 2019-02-28 15:35:03 +1100 | [diff] [blame] | 2088 | if test -e "$source_path/.git" && \ |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2089 | { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 2090 | werror="yes" |
| 2091 | else |
| 2092 | werror="no" |
| 2093 | fi |
| 2094 | fi |
| 2095 | |
Peter Maydell | fb59dab | 2017-03-28 14:01:52 +0100 | [diff] [blame] | 2096 | if test "$bogus_os" = "yes"; then |
| 2097 | # Now that we know that we're not printing the help and that |
| 2098 | # the compiler works (so the results of the check_defines we used |
| 2099 | # to identify the OS are reliable), if we didn't recognize the |
| 2100 | # host OS we should stop now. |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 2101 | error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" |
Peter Maydell | fb59dab | 2017-03-28 14:01:52 +0100 | [diff] [blame] | 2102 | fi |
| 2103 | |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 2104 | # Check whether the compiler matches our minimum requirements: |
| 2105 | cat > $TMPC << EOF |
| 2106 | #if defined(__clang_major__) && defined(__clang_minor__) |
| 2107 | # ifdef __apple_build_version__ |
| 2108 | # if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) |
| 2109 | # error You need at least XCode Clang v5.1 to compile QEMU |
| 2110 | # endif |
| 2111 | # else |
| 2112 | # if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) |
| 2113 | # error You need at least Clang v3.4 to compile QEMU |
| 2114 | # endif |
| 2115 | # endif |
| 2116 | #elif defined(__GNUC__) && defined(__GNUC_MINOR__) |
| 2117 | # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) |
| 2118 | # error You need at least GCC v4.8 to compile QEMU |
| 2119 | # endif |
| 2120 | #else |
| 2121 | # error You either need GCC or Clang to compiler QEMU |
| 2122 | #endif |
| 2123 | int main (void) { return 0; } |
| 2124 | EOF |
| 2125 | if ! compile_prog "" "" ; then |
| 2126 | error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)" |
| 2127 | fi |
| 2128 | |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 2129 | # Accumulate -Wfoo and -Wno-bar separately. |
| 2130 | # We will list all of the enable flags first, and the disable flags second. |
| 2131 | # Note that we do not add -Werror, because that would enable it for all |
| 2132 | # configure tests. If a configure test failed due to -Werror this would |
| 2133 | # just silently disable some features, so it's too error prone. |
| 2134 | |
| 2135 | warn_flags= |
| 2136 | add_to warn_flags -Wold-style-declaration |
| 2137 | add_to warn_flags -Wold-style-definition |
| 2138 | add_to warn_flags -Wtype-limits |
| 2139 | add_to warn_flags -Wformat-security |
| 2140 | add_to warn_flags -Wformat-y2k |
| 2141 | add_to warn_flags -Winit-self |
| 2142 | add_to warn_flags -Wignored-qualifiers |
| 2143 | add_to warn_flags -Wempty-body |
| 2144 | add_to warn_flags -Wnested-externs |
| 2145 | add_to warn_flags -Wendif-labels |
| 2146 | add_to warn_flags -Wexpansion-to-defined |
| 2147 | |
| 2148 | nowarn_flags= |
| 2149 | add_to nowarn_flags -Wno-initializer-overrides |
| 2150 | add_to nowarn_flags -Wno-missing-include-dirs |
| 2151 | add_to nowarn_flags -Wno-shift-negative-value |
| 2152 | add_to nowarn_flags -Wno-string-plus-int |
| 2153 | add_to nowarn_flags -Wno-typedef-redefinition |
Richard Henderson | aabab96 | 2020-06-17 13:13:07 -0700 | [diff] [blame] | 2154 | add_to nowarn_flags -Wno-tautological-type-limit-compare |
Richard Henderson | bac8d22 | 2020-06-17 13:13:08 -0700 | [diff] [blame] | 2155 | add_to nowarn_flags -Wno-psabi |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 2156 | |
| 2157 | gcc_flags="$warn_flags $nowarn_flags" |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 2158 | |
| 2159 | cc_has_warning_flag() { |
| 2160 | write_c_skeleton; |
| 2161 | |
Peter Maydell | a1d29d6 | 2012-10-27 22:19:07 +0100 | [diff] [blame] | 2162 | # Use the positive sense of the flag when testing for -Wno-wombat |
| 2163 | # support (gcc will happily accept the -Wno- form of unknown |
| 2164 | # warning options). |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 2165 | optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')" |
| 2166 | compile_prog "-Werror $optflag" "" |
| 2167 | } |
| 2168 | |
| 2169 | for flag in $gcc_flags; do |
| 2170 | if cc_has_warning_flag $flag ; then |
| 2171 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
Paolo Bonzini | 8d05095 | 2010-12-23 11:43:52 +0100 | [diff] [blame] | 2172 | fi |
| 2173 | done |
| 2174 | |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 2175 | if test "$stack_protector" != "no"; then |
Rodrigo Rebello | fccd35a | 2015-11-12 12:04:28 -0200 | [diff] [blame] | 2176 | cat > $TMPC << EOF |
| 2177 | int main(int argc, char *argv[]) |
| 2178 | { |
| 2179 | char arr[64], *p = arr, *c = argv[0]; |
| 2180 | while (*c) { |
| 2181 | *p++ = *c++; |
| 2182 | } |
| 2183 | return 0; |
| 2184 | } |
| 2185 | EOF |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 2186 | gcc_flags="-fstack-protector-strong -fstack-protector-all" |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 2187 | sp_on=0 |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 2188 | for flag in $gcc_flags; do |
Peter Maydell | 590e5dd | 2014-04-11 17:13:52 +0100 | [diff] [blame] | 2189 | # We need to check both a compile and a link, since some compiler |
| 2190 | # setups fail only on a .c->.o compile and some only at link time |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 2191 | if compile_object "-Werror $flag" && |
Peter Maydell | 590e5dd | 2014-04-11 17:13:52 +0100 | [diff] [blame] | 2192 | compile_prog "-Werror $flag" ""; then |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 2193 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 2194 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 2195 | sp_on=1 |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 2196 | break |
| 2197 | fi |
| 2198 | done |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 2199 | if test "$stack_protector" = yes; then |
| 2200 | if test $sp_on = 0; then |
| 2201 | error_exit "Stack protector not supported" |
| 2202 | fi |
| 2203 | fi |
Marc-André Lureau | 37746c5 | 2013-02-25 23:31:12 +0100 | [diff] [blame] | 2204 | fi |
| 2205 | |
Paolo Bonzini | 20bc94a | 2017-10-20 12:11:32 +0200 | [diff] [blame] | 2206 | # Disable -Wmissing-braces on older compilers that warn even for |
| 2207 | # the "universal" C zero initializer {0}. |
| 2208 | cat > $TMPC << EOF |
| 2209 | struct { |
| 2210 | int a[2]; |
| 2211 | } x = {0}; |
| 2212 | EOF |
| 2213 | if compile_object "-Werror" "" ; then |
| 2214 | : |
| 2215 | else |
| 2216 | QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces" |
| 2217 | fi |
| 2218 | |
Marc-André Lureau | 21e709a | 2019-07-18 16:04:13 +0400 | [diff] [blame] | 2219 | # Our module code doesn't support Windows |
| 2220 | if test "$modules" = "yes" && test "$mingw32" = "yes" ; then |
| 2221 | error_exit "Modules are not available for Windows" |
| 2222 | fi |
| 2223 | |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 2224 | # module_upgrades is only reasonable if modules are enabled |
| 2225 | if test "$modules" = "no" && test "$module_upgrades" = "yes" ; then |
| 2226 | error_exit "Can't enable module-upgrades as Modules are not enabled" |
| 2227 | fi |
| 2228 | |
Thomas Huth | d376e9d | 2018-12-03 11:41:38 +0100 | [diff] [blame] | 2229 | # Static linking is not possible with modules or PIE |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 2230 | if test "$static" = "yes" ; then |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 2231 | if test "$modules" = "yes" ; then |
| 2232 | error_exit "static and modules are mutually incompatible" |
| 2233 | fi |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 2234 | fi |
| 2235 | |
Emilio G. Cota | 768b785 | 2015-04-29 13:09:02 +0200 | [diff] [blame] | 2236 | # Unconditional check for compiler __thread support |
| 2237 | cat > $TMPC << EOF |
| 2238 | static __thread int tls_var; |
| 2239 | int main(void) { return tls_var; } |
| 2240 | EOF |
| 2241 | |
| 2242 | if ! compile_prog "-Werror" "" ; then |
| 2243 | error_exit "Your compiler does not support the __thread specifier for " \ |
| 2244 | "Thread-Local Storage (TLS). Please upgrade to a version that does." |
| 2245 | fi |
| 2246 | |
Richard Henderson | b263412 | 2019-12-17 13:54:56 -1000 | [diff] [blame] | 2247 | cat > $TMPC << EOF |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 2248 | |
| 2249 | #ifdef __linux__ |
| 2250 | # define THREAD __thread |
| 2251 | #else |
| 2252 | # define THREAD |
| 2253 | #endif |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 2254 | static THREAD int tls_var; |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 2255 | int main(void) { return tls_var; } |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 2256 | EOF |
Alex Bennée | 412aeac | 2019-08-15 19:41:51 +0000 | [diff] [blame] | 2257 | |
Richard Henderson | b263412 | 2019-12-17 13:54:56 -1000 | [diff] [blame] | 2258 | # Check we support --no-pie first; we will need this for building ROMs. |
| 2259 | if compile_prog "-Werror -fno-pie" "-no-pie"; then |
| 2260 | CFLAGS_NOPIE="-fno-pie" |
| 2261 | LDFLAGS_NOPIE="-no-pie" |
| 2262 | fi |
| 2263 | |
Richard Henderson | 1278146 | 2019-12-17 15:30:14 -1000 | [diff] [blame] | 2264 | if test "$static" = "yes"; then |
Richard Henderson | eca7a8e | 2020-04-03 20:11:50 +0100 | [diff] [blame] | 2265 | if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 2266 | CFLAGS="-fPIE -DPIE $CFLAGS" |
Richard Henderson | 1278146 | 2019-12-17 15:30:14 -1000 | [diff] [blame] | 2267 | QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS" |
| 2268 | pie="yes" |
| 2269 | elif test "$pie" = "yes"; then |
| 2270 | error_exit "-static-pie not available due to missing toolchain support" |
| 2271 | else |
| 2272 | QEMU_LDFLAGS="-static $QEMU_LDFLAGS" |
| 2273 | pie="no" |
| 2274 | fi |
| 2275 | elif test "$pie" = "no"; then |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 2276 | CFLAGS="$CFLAGS_NOPIE $CFLAGS" |
| 2277 | LDFLAGS="$LDFLAGS_NOPIE $LDFLAGS" |
Richard Henderson | eca7a8e | 2020-04-03 20:11:50 +0100 | [diff] [blame] | 2278 | elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 2279 | CFLAGS="-fPIE -DPIE $CFLAGS" |
| 2280 | LDFLAGS="-pie $LDFLAGS" |
Richard Henderson | 2c67410 | 2019-12-17 15:15:01 -1000 | [diff] [blame] | 2281 | pie="yes" |
| 2282 | elif test "$pie" = "yes"; then |
| 2283 | error_exit "PIE not available due to missing toolchain support" |
| 2284 | else |
| 2285 | echo "Disabling PIE due to missing toolchain support" |
| 2286 | pie="no" |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 2287 | fi |
| 2288 | |
Richard Henderson | e6cbd75 | 2019-12-17 14:00:39 -1000 | [diff] [blame] | 2289 | # Detect support for PT_GNU_RELRO + DT_BIND_NOW. |
| 2290 | # The combination is known as "full relro", because .got.plt is read-only too. |
| 2291 | if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then |
| 2292 | QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" |
| 2293 | fi |
| 2294 | |
Paolo Bonzini | 09dada4 | 2013-04-17 16:26:47 +0200 | [diff] [blame] | 2295 | ########################################## |
| 2296 | # __sync_fetch_and_and requires at least -march=i486. Many toolchains |
| 2297 | # use i686 as default anyway, but for those that don't, an explicit |
| 2298 | # specification is necessary |
| 2299 | |
| 2300 | if test "$cpu" = "i386"; then |
| 2301 | cat > $TMPC << EOF |
| 2302 | static int sfaa(int *ptr) |
| 2303 | { |
| 2304 | return __sync_fetch_and_and(ptr, 0); |
| 2305 | } |
| 2306 | |
| 2307 | int main(void) |
| 2308 | { |
| 2309 | int val = 42; |
Stefan Weil | 1405b62 | 2013-05-11 21:46:58 +0200 | [diff] [blame] | 2310 | val = __sync_val_compare_and_swap(&val, 0, 1); |
Paolo Bonzini | 09dada4 | 2013-04-17 16:26:47 +0200 | [diff] [blame] | 2311 | sfaa(&val); |
| 2312 | return val; |
| 2313 | } |
| 2314 | EOF |
| 2315 | if ! compile_prog "" "" ; then |
| 2316 | QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" |
| 2317 | fi |
| 2318 | fi |
| 2319 | |
| 2320 | ######################################### |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2321 | # Solaris specific configure tool chain decisions |
Paolo Bonzini | 09dada4 | 2013-04-17 16:26:47 +0200 | [diff] [blame] | 2322 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2323 | if test "$solaris" = "yes" ; then |
Loïc Minier | 6792aa1 | 2010-01-20 11:35:54 +0100 | [diff] [blame] | 2324 | if has $install; then |
| 2325 | : |
| 2326 | else |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2327 | error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ |
| 2328 | "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ |
| 2329 | "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2330 | fi |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 2331 | if test "$(path_of $install)" = "/usr/sbin/install" ; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2332 | error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ |
| 2333 | "try ginstall from the GNU fileutils available from www.blastwave.org" \ |
| 2334 | "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2335 | fi |
Loïc Minier | 6792aa1 | 2010-01-20 11:35:54 +0100 | [diff] [blame] | 2336 | if has ar; then |
| 2337 | : |
| 2338 | else |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2339 | if test -f /usr/ccs/bin/ar ; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2340 | error_exit "No path includes ar" \ |
| 2341 | "Add /usr/ccs/bin to your path and rerun configure" |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2342 | fi |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2343 | error_exit "No path includes ar" |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2344 | fi |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 2345 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 2346 | |
Stefan Weil | afb63eb | 2012-09-26 22:04:38 +0200 | [diff] [blame] | 2347 | if test -z "${target_list+xxx}" ; then |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 2348 | for target in $default_target_list; do |
| 2349 | supported_target $target 2>/dev/null && \ |
| 2350 | target_list="$target_list $target" |
| 2351 | done |
| 2352 | target_list="${target_list# }" |
Anthony Liguori | 121afa9 | 2012-09-14 08:17:03 -0500 | [diff] [blame] | 2353 | else |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 2354 | target_list=$(echo "$target_list" | sed -e 's/,/ /g') |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 2355 | for target in $target_list; do |
| 2356 | # Check that we recognised the target name; this allows a more |
| 2357 | # friendly error message than if we let it fall through. |
| 2358 | case " $default_target_list " in |
| 2359 | *" $target "*) |
| 2360 | ;; |
| 2361 | *) |
| 2362 | error_exit "Unknown target name '$target'" |
| 2363 | ;; |
| 2364 | esac |
| 2365 | supported_target $target || exit 1 |
| 2366 | done |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 2367 | fi |
Peter Maydell | 25b4833 | 2013-05-20 16:16:16 +0100 | [diff] [blame] | 2368 | |
Paolo Bonzini | f55fe27 | 2010-05-26 16:08:17 +0200 | [diff] [blame] | 2369 | # see if system emulation was really requested |
| 2370 | case " $target_list " in |
| 2371 | *"-softmmu "*) softmmu=yes |
| 2372 | ;; |
| 2373 | *) softmmu=no |
| 2374 | ;; |
| 2375 | esac |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 2376 | |
Philippe Mathieu-Daudé | 05dfa22 | 2019-11-08 12:45:30 +0100 | [diff] [blame] | 2377 | for target in $target_list; do |
| 2378 | case "$target" in |
| 2379 | arm-softmmu | aarch64-softmmu | i386-softmmu | x86_64-softmmu) |
| 2380 | edk2_blobs="yes" |
| 2381 | ;; |
| 2382 | esac |
| 2383 | done |
Philippe Mathieu-Daudé | 623ef63 | 2019-11-08 12:45:31 +0100 | [diff] [blame] | 2384 | # The EDK2 binaries are compressed with bzip2 |
| 2385 | if test "$edk2_blobs" = "yes" && ! has bzip2; then |
| 2386 | error_exit "The bzip2 program is required for building QEMU" |
| 2387 | fi |
Philippe Mathieu-Daudé | 05dfa22 | 2019-11-08 12:45:30 +0100 | [diff] [blame] | 2388 | |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 2389 | feature_not_found() { |
| 2390 | feature=$1 |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 2391 | remedy=$2 |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 2392 | |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2393 | error_exit "User requested feature $feature" \ |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 2394 | "configure was not able to find it." \ |
| 2395 | "$remedy" |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 2396 | } |
| 2397 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 2398 | # --- |
| 2399 | # big/little endian test |
| 2400 | cat > $TMPC << EOF |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 2401 | short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; |
| 2402 | short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; |
| 2403 | extern int foo(short *, short *); |
| 2404 | int main(int argc, char *argv[]) { |
| 2405 | return foo(big_endian, little_endian); |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 2406 | } |
| 2407 | EOF |
| 2408 | |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 2409 | if compile_object ; then |
Alice Frosi | 12f15c9 | 2018-01-30 14:38:28 +0100 | [diff] [blame] | 2410 | if strings -a $TMPO | grep -q BiGeNdIaN ; then |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 2411 | bigendian="yes" |
Alice Frosi | 12f15c9 | 2018-01-30 14:38:28 +0100 | [diff] [blame] | 2412 | elif strings -a $TMPO | grep -q LiTtLeEnDiAn ; then |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 2413 | bigendian="no" |
| 2414 | else |
| 2415 | echo big/little test failed |
Peter Maydell | 21d89f8 | 2011-11-30 10:57:48 +0100 | [diff] [blame] | 2416 | fi |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 2417 | else |
| 2418 | echo big/little test failed |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 2419 | fi |
| 2420 | |
Juan Quintela | b0a47e7 | 2009-08-12 18:29:49 +0200 | [diff] [blame] | 2421 | ########################################## |
Philippe Mathieu-Daudé | e10ee3f | 2020-02-17 14:33:27 +0100 | [diff] [blame] | 2422 | # system tools |
| 2423 | if test -z "$want_tools"; then |
| 2424 | if test "$softmmu" = "no"; then |
| 2425 | want_tools=no |
| 2426 | else |
| 2427 | want_tools=yes |
| 2428 | fi |
| 2429 | fi |
| 2430 | |
| 2431 | ########################################## |
Peter Maydell | a30878e | 2015-08-14 16:10:52 +0100 | [diff] [blame] | 2432 | # cocoa implies not SDL or GTK |
| 2433 | # (the cocoa UI code currently assumes it is always the active UI |
| 2434 | # and doesn't interact well with other UI frontend code) |
| 2435 | if test "$cocoa" = "yes"; then |
| 2436 | if test "$sdl" = "yes"; then |
| 2437 | error_exit "Cocoa and SDL UIs cannot both be enabled at once" |
| 2438 | fi |
| 2439 | if test "$gtk" = "yes"; then |
| 2440 | error_exit "Cocoa and GTK UIs cannot both be enabled at once" |
| 2441 | fi |
| 2442 | gtk=no |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 2443 | sdl=disabled |
Peter Maydell | a30878e | 2015-08-14 16:10:52 +0100 | [diff] [blame] | 2444 | fi |
| 2445 | |
Eric Blake | 6b39b06 | 2016-10-11 10:46:23 -0500 | [diff] [blame] | 2446 | # Some versions of Mac OS X incorrectly define SIZE_MAX |
| 2447 | cat > $TMPC << EOF |
| 2448 | #include <stdint.h> |
| 2449 | #include <stdio.h> |
| 2450 | int main(int argc, char *argv[]) { |
| 2451 | return printf("%zu", SIZE_MAX); |
| 2452 | } |
| 2453 | EOF |
| 2454 | have_broken_size_max=no |
| 2455 | if ! compile_object -Werror ; then |
| 2456 | have_broken_size_max=yes |
| 2457 | fi |
| 2458 | |
Peter Maydell | a30878e | 2015-08-14 16:10:52 +0100 | [diff] [blame] | 2459 | ########################################## |
Gonglei | 015a33b | 2014-07-01 20:58:08 +0800 | [diff] [blame] | 2460 | # L2TPV3 probe |
| 2461 | |
| 2462 | cat > $TMPC <<EOF |
| 2463 | #include <sys/socket.h> |
Michael Tokarev | bff6cb7 | 2014-08-01 23:20:24 +0400 | [diff] [blame] | 2464 | #include <linux/ip.h> |
Gonglei | 015a33b | 2014-07-01 20:58:08 +0800 | [diff] [blame] | 2465 | int main(void) { return sizeof(struct mmsghdr); } |
| 2466 | EOF |
| 2467 | if compile_prog "" "" ; then |
| 2468 | l2tpv3=yes |
| 2469 | else |
| 2470 | l2tpv3=no |
| 2471 | fi |
| 2472 | |
David CARLIER | c9c8b88 | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 2473 | if check_include "pty.h" ; then |
| 2474 | pty_h=yes |
| 2475 | else |
| 2476 | pty_h=no |
| 2477 | fi |
| 2478 | |
David CARLIER | 195588c | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 2479 | cat > $TMPC <<EOF |
| 2480 | #include <sys/mman.h> |
| 2481 | int main(int argc, char *argv[]) { |
| 2482 | return mlockall(MCL_FUTURE); |
| 2483 | } |
| 2484 | EOF |
| 2485 | if compile_prog "" "" ; then |
| 2486 | have_mlockall=yes |
| 2487 | else |
| 2488 | have_mlockall=no |
| 2489 | fi |
| 2490 | |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 2491 | ######################################### |
| 2492 | # vhost interdependencies and host support |
| 2493 | |
| 2494 | # vhost backends |
| 2495 | test "$vhost_user" = "" && vhost_user=yes |
| 2496 | if test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then |
| 2497 | error_exit "vhost-user isn't available on win32" |
| 2498 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 2499 | test "$vhost_vdpa" = "" && vhost_vdpa=$linux |
| 2500 | if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then |
| 2501 | error_exit "vhost-vdpa is only available on Linux" |
| 2502 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 2503 | test "$vhost_kernel" = "" && vhost_kernel=$linux |
| 2504 | if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then |
| 2505 | error_exit "vhost-kernel is only available on Linux" |
| 2506 | fi |
| 2507 | |
| 2508 | # vhost-kernel devices |
| 2509 | test "$vhost_scsi" = "" && vhost_scsi=$vhost_kernel |
| 2510 | if test "$vhost_scsi" = "yes" && test "$vhost_kernel" != "yes"; then |
| 2511 | error_exit "--enable-vhost-scsi requires --enable-vhost-kernel" |
| 2512 | fi |
| 2513 | test "$vhost_vsock" = "" && vhost_vsock=$vhost_kernel |
| 2514 | if test "$vhost_vsock" = "yes" && test "$vhost_kernel" != "yes"; then |
| 2515 | error_exit "--enable-vhost-vsock requires --enable-vhost-kernel" |
| 2516 | fi |
| 2517 | |
| 2518 | # vhost-user backends |
| 2519 | test "$vhost_net_user" = "" && vhost_net_user=$vhost_user |
| 2520 | if test "$vhost_net_user" = "yes" && test "$vhost_user" = "no"; then |
| 2521 | error_exit "--enable-vhost-net-user requires --enable-vhost-user" |
| 2522 | fi |
| 2523 | test "$vhost_crypto" = "" && vhost_crypto=$vhost_user |
| 2524 | if test "$vhost_crypto" = "yes" && test "$vhost_user" = "no"; then |
| 2525 | error_exit "--enable-vhost-crypto requires --enable-vhost-user" |
| 2526 | fi |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 2527 | test "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user |
| 2528 | if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then |
| 2529 | error_exit "--enable-vhost-user-fs requires --enable-vhost-user" |
| 2530 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 2531 | #vhost-vdpa backends |
| 2532 | test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa |
| 2533 | if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then |
| 2534 | error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa" |
| 2535 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 2536 | |
| 2537 | # OR the vhost-kernel and vhost-user values for simplicity |
| 2538 | if test "$vhost_net" = ""; then |
| 2539 | test "$vhost_net_user" = "yes" && vhost_net=yes |
| 2540 | test "$vhost_kernel" = "yes" && vhost_net=yes |
| 2541 | fi |
| 2542 | |
Gonglei | 015a33b | 2014-07-01 20:58:08 +0800 | [diff] [blame] | 2543 | ########################################## |
Daniel P. Berrange | 4d9310f | 2015-09-22 15:13:26 +0100 | [diff] [blame] | 2544 | # MinGW / Mingw-w64 localtime_r/gmtime_r check |
| 2545 | |
| 2546 | if test "$mingw32" = "yes"; then |
| 2547 | # Some versions of MinGW / Mingw-w64 lack localtime_r |
| 2548 | # and gmtime_r entirely. |
| 2549 | # |
| 2550 | # Some versions of Mingw-w64 define a macro for |
| 2551 | # localtime_r/gmtime_r. |
| 2552 | # |
| 2553 | # Some versions of Mingw-w64 will define functions |
| 2554 | # for localtime_r/gmtime_r, but only if you have |
| 2555 | # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun |
| 2556 | # though, unistd.h and pthread.h both define |
| 2557 | # that for you. |
| 2558 | # |
| 2559 | # So this #undef localtime_r and #include <unistd.h> |
| 2560 | # are not in fact redundant. |
| 2561 | cat > $TMPC << EOF |
| 2562 | #include <unistd.h> |
| 2563 | #include <time.h> |
| 2564 | #undef localtime_r |
| 2565 | int main(void) { localtime_r(NULL, NULL); return 0; } |
| 2566 | EOF |
| 2567 | if compile_prog "" "" ; then |
| 2568 | localtime_r="yes" |
| 2569 | else |
| 2570 | localtime_r="no" |
| 2571 | fi |
| 2572 | fi |
| 2573 | |
| 2574 | ########################################## |
Stefan Weil | 779ab5e | 2012-12-16 11:29:45 +0100 | [diff] [blame] | 2575 | # pkg-config probe |
| 2576 | |
| 2577 | if ! has "$pkg_config_exe"; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 2578 | error_exit "pkg-config binary '$pkg_config_exe' not found" |
Stefan Weil | 779ab5e | 2012-12-16 11:29:45 +0100 | [diff] [blame] | 2579 | fi |
| 2580 | |
| 2581 | ########################################## |
Juan Quintela | b0a47e7 | 2009-08-12 18:29:49 +0200 | [diff] [blame] | 2582 | # NPTL probe |
| 2583 | |
Peter Maydell | 24cb36a | 2013-07-16 18:45:00 +0100 | [diff] [blame] | 2584 | if test "$linux_user" = "yes"; then |
Juan Quintela | b0a47e7 | 2009-08-12 18:29:49 +0200 | [diff] [blame] | 2585 | cat > $TMPC <<EOF |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 2586 | #include <sched.h> |
pbrook | 30813ce | 2008-06-02 15:45:44 +0000 | [diff] [blame] | 2587 | #include <linux/futex.h> |
Stefan Weil | 182eacc | 2011-12-17 09:27:30 +0100 | [diff] [blame] | 2588 | int main(void) { |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 2589 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
| 2590 | #error bork |
| 2591 | #endif |
Stefan Weil | 182eacc | 2011-12-17 09:27:30 +0100 | [diff] [blame] | 2592 | return 0; |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 2593 | } |
| 2594 | EOF |
Peter Maydell | 24cb36a | 2013-07-16 18:45:00 +0100 | [diff] [blame] | 2595 | if ! compile_object ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 2596 | feature_not_found "nptl" "Install glibc and linux kernel headers." |
Juan Quintela | b0a47e7 | 2009-08-12 18:29:49 +0200 | [diff] [blame] | 2597 | fi |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 2598 | fi |
| 2599 | |
balrog | ac62922 | 2008-10-11 09:56:04 +0000 | [diff] [blame] | 2600 | ########################################## |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2601 | # lzo check |
| 2602 | |
| 2603 | if test "$lzo" != "no" ; then |
| 2604 | cat > $TMPC << EOF |
| 2605 | #include <lzo/lzo1x.h> |
| 2606 | int main(void) { lzo_version(); return 0; } |
| 2607 | EOF |
| 2608 | if compile_prog "" "-llzo2" ; then |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 2609 | lzo_libs="-llzo2" |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 2610 | lzo="yes" |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2611 | else |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 2612 | if test "$lzo" = "yes"; then |
| 2613 | feature_not_found "liblzo2" "Install liblzo2 devel" |
| 2614 | fi |
| 2615 | lzo="no" |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2616 | fi |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2617 | fi |
| 2618 | |
| 2619 | ########################################## |
| 2620 | # snappy check |
| 2621 | |
| 2622 | if test "$snappy" != "no" ; then |
| 2623 | cat > $TMPC << EOF |
| 2624 | #include <snappy-c.h> |
| 2625 | int main(void) { snappy_max_compressed_length(4096); return 0; } |
| 2626 | EOF |
| 2627 | if compile_prog "" "-lsnappy" ; then |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 2628 | snappy_libs='-lsnappy' |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 2629 | snappy="yes" |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2630 | else |
Stefan Weil | b25c9df | 2014-04-29 08:21:16 +0200 | [diff] [blame] | 2631 | if test "$snappy" = "yes"; then |
| 2632 | feature_not_found "libsnappy" "Install libsnappy devel" |
| 2633 | fi |
| 2634 | snappy="no" |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2635 | fi |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 2636 | fi |
| 2637 | |
| 2638 | ########################################## |
Peter Wu | 6b383c0 | 2015-01-06 18:48:14 +0100 | [diff] [blame] | 2639 | # bzip2 check |
| 2640 | |
| 2641 | if test "$bzip2" != "no" ; then |
| 2642 | cat > $TMPC << EOF |
| 2643 | #include <bzlib.h> |
| 2644 | int main(void) { BZ2_bzlibVersion(); return 0; } |
| 2645 | EOF |
| 2646 | if compile_prog "" "-lbz2" ; then |
| 2647 | bzip2="yes" |
| 2648 | else |
| 2649 | if test "$bzip2" = "yes"; then |
| 2650 | feature_not_found "libbzip2" "Install libbzip2 devel" |
| 2651 | fi |
| 2652 | bzip2="no" |
| 2653 | fi |
| 2654 | fi |
| 2655 | |
| 2656 | ########################################## |
Julio Faracco | 83bc1f9 | 2018-11-05 13:08:04 -0200 | [diff] [blame] | 2657 | # lzfse check |
| 2658 | |
| 2659 | if test "$lzfse" != "no" ; then |
| 2660 | cat > $TMPC << EOF |
| 2661 | #include <lzfse.h> |
| 2662 | int main(void) { lzfse_decode_scratch_size(); return 0; } |
| 2663 | EOF |
| 2664 | if compile_prog "" "-llzfse" ; then |
| 2665 | lzfse="yes" |
| 2666 | else |
| 2667 | if test "$lzfse" = "yes"; then |
| 2668 | feature_not_found "lzfse" "Install lzfse devel" |
| 2669 | fi |
| 2670 | lzfse="no" |
| 2671 | fi |
| 2672 | fi |
| 2673 | |
| 2674 | ########################################## |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 2675 | # zstd check |
| 2676 | |
| 2677 | if test "$zstd" != "no" ; then |
Juan Quintela | 297254c | 2020-03-10 12:14:31 +0100 | [diff] [blame] | 2678 | libzstd_minver="1.4.0" |
| 2679 | if $pkg_config --atleast-version=$libzstd_minver libzstd ; then |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 2680 | zstd_cflags="$($pkg_config --cflags libzstd)" |
| 2681 | zstd_libs="$($pkg_config --libs libzstd)" |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 2682 | zstd="yes" |
| 2683 | else |
| 2684 | if test "$zstd" = "yes" ; then |
| 2685 | feature_not_found "libzstd" "Install libzstd devel" |
| 2686 | fi |
| 2687 | zstd="no" |
| 2688 | fi |
| 2689 | fi |
| 2690 | |
| 2691 | ########################################## |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 2692 | # libseccomp check |
| 2693 | |
| 2694 | if test "$seccomp" != "no" ; then |
Helge Deller | 25ed0ec | 2019-04-04 20:39:23 +0200 | [diff] [blame] | 2695 | libseccomp_minver="2.3.0" |
| 2696 | if $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then |
Fam Zheng | c3883e1 | 2017-09-07 16:53:16 +0800 | [diff] [blame] | 2697 | seccomp_cflags="$($pkg_config --cflags libseccomp)" |
| 2698 | seccomp_libs="$($pkg_config --libs libseccomp)" |
Andrew Jones | 693e591 | 2015-09-30 11:59:18 -0400 | [diff] [blame] | 2699 | seccomp="yes" |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 2700 | else |
Andrew Jones | 693e591 | 2015-09-30 11:59:18 -0400 | [diff] [blame] | 2701 | if test "$seccomp" = "yes" ; then |
Helge Deller | 25ed0ec | 2019-04-04 20:39:23 +0200 | [diff] [blame] | 2702 | feature_not_found "libseccomp" \ |
| 2703 | "Install libseccomp devel >= $libseccomp_minver" |
Andrew Jones | 693e591 | 2015-09-30 11:59:18 -0400 | [diff] [blame] | 2704 | fi |
| 2705 | seccomp="no" |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 2706 | fi |
| 2707 | fi |
| 2708 | ########################################## |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 2709 | # xen probe |
| 2710 | |
Juan Quintela | fc321b4 | 2009-08-12 18:29:55 +0200 | [diff] [blame] | 2711 | if test "$xen" != "no" ; then |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2712 | # Check whether Xen library path is specified via --extra-ldflags to avoid |
| 2713 | # overriding this setting with pkg-config output. If not, try pkg-config |
| 2714 | # to obtain all needed flags. |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 2715 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2716 | if ! echo $EXTRA_LDFLAGS | grep tools/libxc > /dev/null && \ |
| 2717 | $pkg_config --exists xencontrol ; then |
| 2718 | xen_ctrl_version="$(printf '%d%02d%02d' \ |
| 2719 | $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" |
| 2720 | xen=yes |
| 2721 | xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab" |
| 2722 | xen_pc="$xen_pc xenevtchn xendevicemodel" |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2723 | if $pkg_config --exists xentoolcore; then |
| 2724 | xen_pc="$xen_pc xentoolcore" |
| 2725 | fi |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2726 | QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 2727 | xen_cflags="$($pkg_config --cflags $xen_pc)" |
| 2728 | xen_libs="$($pkg_config --libs $xen_pc)" |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2729 | else |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 2730 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2731 | xen_libs="-lxenstore -lxenctrl -lxenguest" |
Anthony PERARD | d9506ca | 2017-05-11 12:35:42 +0100 | [diff] [blame] | 2732 | xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn" |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2733 | |
| 2734 | # First we test whether Xen headers and libraries are available. |
| 2735 | # If no, we are done and there is no Xen support. |
| 2736 | # If yes, more tests are run to detect the Xen version. |
| 2737 | |
| 2738 | # Xen (any) |
| 2739 | cat > $TMPC <<EOF |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 2740 | #include <xenctrl.h> |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 2741 | int main(void) { |
| 2742 | return 0; |
| 2743 | } |
| 2744 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2745 | if ! compile_prog "" "$xen_libs" ; then |
| 2746 | # Xen not found |
| 2747 | if test "$xen" = "yes" ; then |
| 2748 | feature_not_found "xen" "Install xen devel" |
| 2749 | fi |
| 2750 | xen=no |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 2751 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2752 | # Xen unstable |
| 2753 | elif |
| 2754 | cat > $TMPC <<EOF && |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 2755 | #undef XC_WANT_COMPAT_DEVICEMODEL_API |
| 2756 | #define __XEN_TOOLS__ |
| 2757 | #include <xendevicemodel.h> |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 2758 | #include <xenforeignmemory.h> |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 2759 | int main(void) { |
| 2760 | xendevicemodel_handle *xd; |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 2761 | xenforeignmemory_handle *xfmem; |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 2762 | |
| 2763 | xd = xendevicemodel_open(0, 0); |
| 2764 | xendevicemodel_pin_memory_cacheattr(xd, 0, 0, 0, 0); |
| 2765 | |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 2766 | xfmem = xenforeignmemory_open(0, 0); |
| 2767 | xenforeignmemory_map_resource(xfmem, 0, 0, 0, 0, 0, NULL, 0, 0); |
| 2768 | |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 2769 | return 0; |
| 2770 | } |
| 2771 | EOF |
| 2772 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" |
| 2773 | then |
| 2774 | xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" |
| 2775 | xen_ctrl_version=41100 |
| 2776 | xen=yes |
| 2777 | elif |
| 2778 | cat > $TMPC <<EOF && |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2779 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 2780 | #include <xenforeignmemory.h> |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2781 | #include <xentoolcore.h> |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2782 | int main(void) { |
| 2783 | xenforeignmemory_handle *xfmem; |
| 2784 | |
| 2785 | xfmem = xenforeignmemory_open(0, 0); |
| 2786 | xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0); |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2787 | xentoolcore_restrict_all(0); |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2788 | |
| 2789 | return 0; |
| 2790 | } |
| 2791 | EOF |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2792 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2793 | then |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2794 | xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2795 | xen_ctrl_version=41000 |
| 2796 | xen=yes |
| 2797 | elif |
| 2798 | cat > $TMPC <<EOF && |
Paul Durrant | da8090c | 2017-03-07 10:55:33 +0000 | [diff] [blame] | 2799 | #undef XC_WANT_COMPAT_DEVICEMODEL_API |
| 2800 | #define __XEN_TOOLS__ |
| 2801 | #include <xendevicemodel.h> |
| 2802 | int main(void) { |
| 2803 | xendevicemodel_handle *xd; |
| 2804 | |
| 2805 | xd = xendevicemodel_open(0, 0); |
| 2806 | xendevicemodel_close(xd); |
| 2807 | |
| 2808 | return 0; |
| 2809 | } |
| 2810 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2811 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs" |
| 2812 | then |
| 2813 | xen_stable_libs="-lxendevicemodel $xen_stable_libs" |
| 2814 | xen_ctrl_version=40900 |
| 2815 | xen=yes |
| 2816 | elif |
| 2817 | cat > $TMPC <<EOF && |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2818 | /* |
| 2819 | * If we have stable libs the we don't want the libxc compat |
| 2820 | * layers, regardless of what CFLAGS we may have been given. |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2821 | * |
| 2822 | * Also, check if xengnttab_grant_copy_segment_t is defined and |
| 2823 | * grant copy operation is implemented. |
| 2824 | */ |
| 2825 | #undef XC_WANT_COMPAT_EVTCHN_API |
| 2826 | #undef XC_WANT_COMPAT_GNTTAB_API |
| 2827 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 2828 | #include <xenctrl.h> |
| 2829 | #include <xenstore.h> |
| 2830 | #include <xenevtchn.h> |
| 2831 | #include <xengnttab.h> |
| 2832 | #include <xenforeignmemory.h> |
| 2833 | #include <stdint.h> |
| 2834 | #include <xen/hvm/hvm_info_table.h> |
| 2835 | #if !defined(HVM_MAX_VCPUS) |
| 2836 | # error HVM_MAX_VCPUS not defined |
| 2837 | #endif |
| 2838 | int main(void) { |
| 2839 | xc_interface *xc = NULL; |
| 2840 | xenforeignmemory_handle *xfmem; |
| 2841 | xenevtchn_handle *xe; |
| 2842 | xengnttab_handle *xg; |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2843 | xengnttab_grant_copy_segment_t* seg = NULL; |
| 2844 | |
| 2845 | xs_daemon_open(); |
| 2846 | |
| 2847 | xc = xc_interface_open(0, 0, 0); |
| 2848 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2849 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2850 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
| 2851 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2852 | |
| 2853 | xfmem = xenforeignmemory_open(0, 0); |
| 2854 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); |
| 2855 | |
| 2856 | xe = xenevtchn_open(0, 0); |
| 2857 | xenevtchn_fd(xe); |
| 2858 | |
| 2859 | xg = xengnttab_open(0, 0); |
| 2860 | xengnttab_grant_copy(xg, 0, seg); |
| 2861 | |
| 2862 | return 0; |
| 2863 | } |
| 2864 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2865 | compile_prog "" "$xen_libs $xen_stable_libs" |
| 2866 | then |
| 2867 | xen_ctrl_version=40800 |
| 2868 | xen=yes |
| 2869 | elif |
| 2870 | cat > $TMPC <<EOF && |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2871 | /* |
| 2872 | * If we have stable libs the we don't want the libxc compat |
| 2873 | * layers, regardless of what CFLAGS we may have been given. |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2874 | */ |
| 2875 | #undef XC_WANT_COMPAT_EVTCHN_API |
| 2876 | #undef XC_WANT_COMPAT_GNTTAB_API |
| 2877 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 2878 | #include <xenctrl.h> |
| 2879 | #include <xenstore.h> |
| 2880 | #include <xenevtchn.h> |
| 2881 | #include <xengnttab.h> |
| 2882 | #include <xenforeignmemory.h> |
| 2883 | #include <stdint.h> |
| 2884 | #include <xen/hvm/hvm_info_table.h> |
| 2885 | #if !defined(HVM_MAX_VCPUS) |
| 2886 | # error HVM_MAX_VCPUS not defined |
| 2887 | #endif |
| 2888 | int main(void) { |
| 2889 | xc_interface *xc = NULL; |
| 2890 | xenforeignmemory_handle *xfmem; |
| 2891 | xenevtchn_handle *xe; |
| 2892 | xengnttab_handle *xg; |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2893 | |
| 2894 | xs_daemon_open(); |
| 2895 | |
| 2896 | xc = xc_interface_open(0, 0, 0); |
| 2897 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2898 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2899 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
| 2900 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2901 | |
| 2902 | xfmem = xenforeignmemory_open(0, 0); |
| 2903 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); |
| 2904 | |
| 2905 | xe = xenevtchn_open(0, 0); |
| 2906 | xenevtchn_fd(xe); |
| 2907 | |
| 2908 | xg = xengnttab_open(0, 0); |
| 2909 | xengnttab_map_grant_ref(xg, 0, 0, 0); |
| 2910 | |
| 2911 | return 0; |
| 2912 | } |
| 2913 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2914 | compile_prog "" "$xen_libs $xen_stable_libs" |
| 2915 | then |
| 2916 | xen_ctrl_version=40701 |
| 2917 | xen=yes |
Roger Pau Monne | cdadde3 | 2015-11-13 17:38:06 +0000 | [diff] [blame] | 2918 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2919 | # Xen 4.6 |
| 2920 | elif |
| 2921 | cat > $TMPC <<EOF && |
Roger Pau Monne | cdadde3 | 2015-11-13 17:38:06 +0000 | [diff] [blame] | 2922 | #include <xenctrl.h> |
Anthony PERARD | e108a3c | 2012-06-21 11:44:35 +0000 | [diff] [blame] | 2923 | #include <xenstore.h> |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 2924 | #include <stdint.h> |
| 2925 | #include <xen/hvm/hvm_info_table.h> |
| 2926 | #if !defined(HVM_MAX_VCPUS) |
| 2927 | # error HVM_MAX_VCPUS not defined |
| 2928 | #endif |
| 2929 | int main(void) { |
| 2930 | xc_interface *xc; |
| 2931 | xs_daemon_open(); |
| 2932 | xc = xc_interface_open(0, 0, 0); |
| 2933 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2934 | xc_gnttab_open(NULL, 0); |
Anthony PERARD | b87de24 | 2011-05-24 14:34:20 +0100 | [diff] [blame] | 2935 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2936 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2937 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); |
Konrad Rzeszutek Wilk | 20a544c | 2015-06-29 12:51:05 -0400 | [diff] [blame] | 2938 | xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0); |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2939 | return 0; |
| 2940 | } |
| 2941 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2942 | compile_prog "" "$xen_libs" |
| 2943 | then |
| 2944 | xen_ctrl_version=40600 |
| 2945 | xen=yes |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2946 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2947 | # Xen 4.5 |
| 2948 | elif |
| 2949 | cat > $TMPC <<EOF && |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2950 | #include <xenctrl.h> |
| 2951 | #include <xenstore.h> |
| 2952 | #include <stdint.h> |
| 2953 | #include <xen/hvm/hvm_info_table.h> |
| 2954 | #if !defined(HVM_MAX_VCPUS) |
| 2955 | # error HVM_MAX_VCPUS not defined |
| 2956 | #endif |
| 2957 | int main(void) { |
| 2958 | xc_interface *xc; |
| 2959 | xs_daemon_open(); |
| 2960 | xc = xc_interface_open(0, 0, 0); |
| 2961 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2962 | xc_gnttab_open(NULL, 0); |
| 2963 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2964 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2965 | xc_hvm_create_ioreq_server(xc, 0, 0, NULL); |
| 2966 | return 0; |
| 2967 | } |
| 2968 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2969 | compile_prog "" "$xen_libs" |
| 2970 | then |
| 2971 | xen_ctrl_version=40500 |
| 2972 | xen=yes |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2973 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2974 | elif |
| 2975 | cat > $TMPC <<EOF && |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2976 | #include <xenctrl.h> |
| 2977 | #include <xenstore.h> |
| 2978 | #include <stdint.h> |
| 2979 | #include <xen/hvm/hvm_info_table.h> |
| 2980 | #if !defined(HVM_MAX_VCPUS) |
| 2981 | # error HVM_MAX_VCPUS not defined |
| 2982 | #endif |
| 2983 | int main(void) { |
| 2984 | xc_interface *xc; |
| 2985 | xs_daemon_open(); |
| 2986 | xc = xc_interface_open(0, 0, 0); |
| 2987 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2988 | xc_gnttab_open(NULL, 0); |
| 2989 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2990 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2991 | return 0; |
| 2992 | } |
| 2993 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2994 | compile_prog "" "$xen_libs" |
| 2995 | then |
| 2996 | xen_ctrl_version=40200 |
| 2997 | xen=yes |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2998 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2999 | else |
| 3000 | if test "$xen" = "yes" ; then |
| 3001 | feature_not_found "xen (unsupported version)" \ |
| 3002 | "Install a supported xen (xen 4.2 or newer)" |
| 3003 | fi |
| 3004 | xen=no |
Juan Quintela | fc321b4 | 2009-08-12 18:29:55 +0200 | [diff] [blame] | 3005 | fi |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 3006 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 3007 | if test "$xen" = yes; then |
| 3008 | if test $xen_ctrl_version -ge 40701 ; then |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 3009 | xen_libs="$xen_libs $xen_stable_libs " |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 3010 | fi |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 3011 | fi |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 3012 | fi |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 3013 | fi |
| 3014 | |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 3015 | if test "$xen_pci_passthrough" != "no"; then |
Ian Campbell | edfb07e | 2016-02-10 11:07:01 +0000 | [diff] [blame] | 3016 | if test "$xen" = "yes" && test "$linux" = "yes"; then |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 3017 | xen_pci_passthrough=yes |
| 3018 | else |
| 3019 | if test "$xen_pci_passthrough" = "yes"; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 3020 | error_exit "User requested feature Xen PCI Passthrough" \ |
| 3021 | " but this feature requires /sys from Linux" |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 3022 | fi |
| 3023 | xen_pci_passthrough=no |
| 3024 | fi |
| 3025 | fi |
| 3026 | |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 3027 | ########################################## |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 3028 | # Windows Hypervisor Platform accelerator (WHPX) check |
| 3029 | if test "$whpx" != "no" ; then |
Lucian Petrut | 327fccb | 2018-05-15 20:35:21 +0300 | [diff] [blame] | 3030 | if check_include "WinHvPlatform.h" && check_include "WinHvEmulation.h"; then |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 3031 | whpx="yes" |
| 3032 | else |
| 3033 | if test "$whpx" = "yes"; then |
Justin Terry (VM) via Qemu-devel | 53537bb | 2018-02-26 09:13:29 -0800 | [diff] [blame] | 3034 | feature_not_found "WinHvPlatform" "WinHvEmulation is not installed" |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 3035 | fi |
| 3036 | whpx="no" |
| 3037 | fi |
| 3038 | fi |
| 3039 | |
| 3040 | ########################################## |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 3041 | # gettext probe |
| 3042 | if test "$gettext" != "false" ; then |
| 3043 | if has xgettext; then |
| 3044 | gettext=true |
| 3045 | else |
| 3046 | if test "$gettext" = "true" ; then |
| 3047 | feature_not_found "gettext" "Install xgettext binary" |
| 3048 | fi |
| 3049 | gettext=false |
| 3050 | fi |
| 3051 | fi |
| 3052 | |
| 3053 | ########################################## |
Juan Quintela | dfffc65 | 2009-08-12 18:29:57 +0200 | [diff] [blame] | 3054 | # Sparse probe |
| 3055 | if test "$sparse" != "no" ; then |
Paolo Bonzini | 968b4db | 2020-02-03 14:45:33 +0100 | [diff] [blame] | 3056 | if has sparse; then |
Juan Quintela | dfffc65 | 2009-08-12 18:29:57 +0200 | [diff] [blame] | 3057 | sparse=yes |
| 3058 | else |
| 3059 | if test "$sparse" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3060 | feature_not_found "sparse" "Install sparse binary" |
Juan Quintela | dfffc65 | 2009-08-12 18:29:57 +0200 | [diff] [blame] | 3061 | fi |
| 3062 | sparse=no |
| 3063 | fi |
| 3064 | fi |
| 3065 | |
| 3066 | ########################################## |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 3067 | # X11 probe |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 3068 | if $pkg_config --exists "x11"; then |
Gerd Hoffmann | 8781595 | 2018-03-01 11:05:42 +0100 | [diff] [blame] | 3069 | have_x11=yes |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3070 | x11_cflags=$($pkg_config --cflags x11) |
| 3071 | x11_libs=$($pkg_config --libs x11) |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 3072 | fi |
| 3073 | |
| 3074 | ########################################## |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 3075 | # GTK probe |
| 3076 | |
| 3077 | if test "$gtk" != "no"; then |
Daniel P. Berrangé | 89d85cd | 2018-08-22 14:15:52 +0100 | [diff] [blame] | 3078 | gtkpackage="gtk+-3.0" |
| 3079 | gtkx11package="gtk+-x11-3.0" |
Volker Rümelin | 7b23d12 | 2020-05-16 09:20:14 +0200 | [diff] [blame] | 3080 | gtkversion="3.22.0" |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3081 | if $pkg_config --exists "$gtkpackage >= $gtkversion"; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3082 | gtk_cflags=$($pkg_config --cflags $gtkpackage) |
| 3083 | gtk_libs=$($pkg_config --libs $gtkpackage) |
| 3084 | gtk_version=$($pkg_config --modversion $gtkpackage) |
Gerd Hoffmann | 0a337ed | 2014-05-28 22:33:06 +0200 | [diff] [blame] | 3085 | if $pkg_config --exists "$gtkx11package >= $gtkversion"; then |
Gerd Hoffmann | 8781595 | 2018-03-01 11:05:42 +0100 | [diff] [blame] | 3086 | need_x11=yes |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 3087 | gtk_cflags="$gtk_cflags $x11_cflags" |
| 3088 | gtk_libs="$gtk_libs $x11_libs" |
Gerd Hoffmann | 0a337ed | 2014-05-28 22:33:06 +0200 | [diff] [blame] | 3089 | fi |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3090 | gtk="yes" |
| 3091 | elif test "$gtk" = "yes"; then |
Gerd Hoffmann | 5fe309f | 2017-06-06 12:53:36 +0200 | [diff] [blame] | 3092 | feature_not_found "gtk" "Install gtk3-devel" |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3093 | else |
| 3094 | gtk="no" |
| 3095 | fi |
| 3096 | fi |
| 3097 | |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 3098 | |
| 3099 | ########################################## |
| 3100 | # GNUTLS probe |
| 3101 | |
| 3102 | if test "$gnutls" != "no"; then |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3103 | pass="no" |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3104 | if $pkg_config --exists "gnutls >= 3.1.18"; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3105 | gnutls_cflags=$($pkg_config --cflags gnutls) |
| 3106 | gnutls_libs=$($pkg_config --libs gnutls) |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3107 | # Packaging for the static libraries is not always correct. |
| 3108 | # At least ubuntu 18.04 ships only shared libraries. |
| 3109 | write_c_skeleton |
| 3110 | if compile_prog "" "$gnutls_libs" ; then |
Richard Henderson | 243dc2c | 2019-05-16 15:29:06 -0700 | [diff] [blame] | 3111 | LIBS="$gnutls_libs $LIBS" |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3112 | QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags" |
| 3113 | pass="yes" |
| 3114 | fi |
| 3115 | fi |
| 3116 | if test "$pass" = "no" && test "$gnutls" = "yes"; then |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3117 | feature_not_found "gnutls" "Install gnutls devel >= 3.1.18" |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 3118 | else |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3119 | gnutls="$pass" |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 3120 | fi |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 3121 | fi |
| 3122 | |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3123 | |
| 3124 | # If user didn't give a --disable/enable-gcrypt flag, |
| 3125 | # then mark as disabled if user requested nettle |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3126 | # explicitly |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3127 | if test -z "$gcrypt" |
| 3128 | then |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3129 | if test "$nettle" = "yes" |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3130 | then |
| 3131 | gcrypt="no" |
| 3132 | fi |
| 3133 | fi |
| 3134 | |
| 3135 | # If user didn't give a --disable/enable-nettle flag, |
| 3136 | # then mark as disabled if user requested gcrypt |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3137 | # explicitly |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3138 | if test -z "$nettle" |
| 3139 | then |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3140 | if test "$gcrypt" = "yes" |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3141 | then |
| 3142 | nettle="no" |
| 3143 | fi |
| 3144 | fi |
| 3145 | |
Daniel P. Berrangé | dea7a64 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3146 | has_libgcrypt() { |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3147 | if ! has "libgcrypt-config" |
| 3148 | then |
| 3149 | return 1 |
| 3150 | fi |
| 3151 | |
| 3152 | if test -n "$cross_prefix" |
| 3153 | then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3154 | host=$(libgcrypt-config --host) |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3155 | if test "$host-" != $cross_prefix |
| 3156 | then |
| 3157 | return 1 |
| 3158 | fi |
| 3159 | fi |
| 3160 | |
Daniel P. Berrangé | dea7a64 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3161 | maj=`libgcrypt-config --version | awk -F . '{print $1}'` |
| 3162 | min=`libgcrypt-config --version | awk -F . '{print $2}'` |
| 3163 | |
| 3164 | if test $maj != 1 || test $min -lt 5 |
| 3165 | then |
| 3166 | return 1 |
| 3167 | fi |
| 3168 | |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3169 | return 0 |
| 3170 | } |
| 3171 | |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3172 | |
| 3173 | if test "$nettle" != "no"; then |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3174 | pass="no" |
Daniel P. Berrangé | 64dd2f3 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3175 | if $pkg_config --exists "nettle >= 2.7.1"; then |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3176 | nettle_cflags=$($pkg_config --cflags nettle) |
| 3177 | nettle_libs=$($pkg_config --libs nettle) |
| 3178 | nettle_version=$($pkg_config --modversion nettle) |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3179 | # Link test to make sure the given libraries work (e.g for static). |
| 3180 | write_c_skeleton |
| 3181 | if compile_prog "" "$nettle_libs" ; then |
Richard Henderson | 243dc2c | 2019-05-16 15:29:06 -0700 | [diff] [blame] | 3182 | LIBS="$nettle_libs $LIBS" |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3183 | QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" |
| 3184 | if test -z "$gcrypt"; then |
| 3185 | gcrypt="no" |
| 3186 | fi |
| 3187 | pass="yes" |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3188 | fi |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3189 | fi |
Daniel P. Berrangé | dc2207a | 2019-10-14 17:28:27 +0100 | [diff] [blame] | 3190 | if test "$pass" = "yes" |
| 3191 | then |
| 3192 | cat > $TMPC << EOF |
| 3193 | #include <nettle/xts.h> |
| 3194 | int main(void) { |
| 3195 | return 0; |
| 3196 | } |
| 3197 | EOF |
| 3198 | if compile_prog "$nettle_cflags" "$nettle_libs" ; then |
| 3199 | nettle_xts=yes |
| 3200 | qemu_private_xts=no |
| 3201 | fi |
| 3202 | fi |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3203 | if test "$pass" = "no" && test "$nettle" = "yes"; then |
| 3204 | feature_not_found "nettle" "Install nettle devel >= 2.7.1" |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3205 | else |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3206 | nettle="$pass" |
Daniel P. Berrangé | a072240 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3207 | fi |
| 3208 | fi |
| 3209 | |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3210 | if test "$gcrypt" != "no"; then |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3211 | pass="no" |
Daniel P. Berrangé | dea7a64 | 2018-07-18 11:55:05 +0100 | [diff] [blame] | 3212 | if has_libgcrypt; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3213 | gcrypt_cflags=$(libgcrypt-config --cflags) |
| 3214 | gcrypt_libs=$(libgcrypt-config --libs) |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3215 | # Debian has removed -lgpg-error from libgcrypt-config |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3216 | # as it "spreads unnecessary dependencies" which in |
| 3217 | # turn breaks static builds... |
| 3218 | if test "$static" = "yes" |
| 3219 | then |
| 3220 | gcrypt_libs="$gcrypt_libs -lgpg-error" |
| 3221 | fi |
Longpeng(Mike) | 1f923c7 | 2016-12-13 18:42:55 +0800 | [diff] [blame] | 3222 | |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3223 | # Link test to make sure the given libraries work (e.g for static). |
| 3224 | write_c_skeleton |
| 3225 | if compile_prog "" "$gcrypt_libs" ; then |
Richard Henderson | 243dc2c | 2019-05-16 15:29:06 -0700 | [diff] [blame] | 3226 | LIBS="$gcrypt_libs $LIBS" |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3227 | QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" |
| 3228 | pass="yes" |
| 3229 | fi |
| 3230 | fi |
| 3231 | if test "$pass" = "yes"; then |
| 3232 | gcrypt="yes" |
Longpeng(Mike) | 1f923c7 | 2016-12-13 18:42:55 +0800 | [diff] [blame] | 3233 | cat > $TMPC << EOF |
| 3234 | #include <gcrypt.h> |
| 3235 | int main(void) { |
| 3236 | gcry_mac_hd_t handle; |
| 3237 | gcry_mac_open(&handle, GCRY_MAC_HMAC_MD5, |
| 3238 | GCRY_MAC_FLAG_SECURE, NULL); |
| 3239 | return 0; |
| 3240 | } |
| 3241 | EOF |
| 3242 | if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then |
| 3243 | gcrypt_hmac=yes |
| 3244 | fi |
Daniel P. Berrangé | e057694 | 2019-10-14 17:28:27 +0100 | [diff] [blame] | 3245 | cat > $TMPC << EOF |
| 3246 | #include <gcrypt.h> |
| 3247 | int main(void) { |
| 3248 | gcry_cipher_hd_t handle; |
| 3249 | gcry_cipher_open(&handle, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_XTS, 0); |
| 3250 | return 0; |
| 3251 | } |
| 3252 | EOF |
| 3253 | if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then |
| 3254 | gcrypt_xts=yes |
| 3255 | qemu_private_xts=no |
| 3256 | fi |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3257 | elif test "$gcrypt" = "yes"; then |
| 3258 | feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0" |
Daniel P. Berrange | 62893b6 | 2015-07-01 18:10:33 +0100 | [diff] [blame] | 3259 | else |
Richard Henderson | a73e82e | 2019-05-09 18:24:35 -0700 | [diff] [blame] | 3260 | gcrypt="no" |
Daniel P. Berrange | 62893b6 | 2015-07-01 18:10:33 +0100 | [diff] [blame] | 3261 | fi |
| 3262 | fi |
| 3263 | |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 3264 | |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 3265 | if test "$gcrypt" = "yes" && test "$nettle" = "yes" |
| 3266 | then |
| 3267 | error_exit "Only one of gcrypt & nettle can be enabled" |
| 3268 | fi |
| 3269 | |
Daniel P. Berrange | 9a2fd43 | 2015-04-13 14:01:39 +0100 | [diff] [blame] | 3270 | ########################################## |
| 3271 | # libtasn1 - only for the TLS creds/session test suite |
| 3272 | |
| 3273 | tasn1=yes |
Daniel P. Berrange | 9024603 | 2015-09-21 17:25:34 +0100 | [diff] [blame] | 3274 | tasn1_cflags="" |
| 3275 | tasn1_libs="" |
Daniel P. Berrange | 9a2fd43 | 2015-04-13 14:01:39 +0100 | [diff] [blame] | 3276 | if $pkg_config --exists "libtasn1"; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3277 | tasn1_cflags=$($pkg_config --cflags libtasn1) |
| 3278 | tasn1_libs=$($pkg_config --libs libtasn1) |
Daniel P. Berrange | 9a2fd43 | 2015-04-13 14:01:39 +0100 | [diff] [blame] | 3279 | else |
| 3280 | tasn1=no |
| 3281 | fi |
| 3282 | |
Daniel P. Berrange | ed75474 | 2015-07-01 18:10:34 +0100 | [diff] [blame] | 3283 | |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3284 | ########################################## |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 3285 | # PAM probe |
| 3286 | |
| 3287 | if test "$auth_pam" != "no"; then |
| 3288 | cat > $TMPC <<EOF |
| 3289 | #include <security/pam_appl.h> |
| 3290 | #include <stdio.h> |
| 3291 | int main(void) { |
| 3292 | const char *service_name = "qemu"; |
| 3293 | const char *user = "frank"; |
Dr. David Alan Gilbert | 9c9642d | 2019-04-04 10:17:25 +0100 | [diff] [blame] | 3294 | const struct pam_conv pam_conv = { 0 }; |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 3295 | pam_handle_t *pamh = NULL; |
Dr. David Alan Gilbert | 9c9642d | 2019-04-04 10:17:25 +0100 | [diff] [blame] | 3296 | pam_start(service_name, user, &pam_conv, &pamh); |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 3297 | return 0; |
| 3298 | } |
| 3299 | EOF |
| 3300 | if compile_prog "" "-lpam" ; then |
| 3301 | auth_pam=yes |
| 3302 | else |
| 3303 | if test "$auth_pam" = "yes"; then |
| 3304 | feature_not_found "PAM" "Install PAM development package" |
| 3305 | else |
| 3306 | auth_pam=no |
| 3307 | fi |
| 3308 | fi |
| 3309 | fi |
| 3310 | |
| 3311 | ########################################## |
Daniel P. Berrange | 559607e | 2015-02-27 16:19:33 +0000 | [diff] [blame] | 3312 | # getifaddrs (for tests/test-io-channel-socket ) |
| 3313 | |
| 3314 | have_ifaddrs_h=yes |
| 3315 | if ! check_include "ifaddrs.h" ; then |
| 3316 | have_ifaddrs_h=no |
| 3317 | fi |
| 3318 | |
Chen Gang | e865b97 | 2020-06-05 09:32:21 +0800 | [diff] [blame] | 3319 | ######################################### |
| 3320 | # libdrm check |
| 3321 | have_drm_h=no |
| 3322 | if check_include "libdrm/drm.h" ; then |
| 3323 | have_drm_h=yes |
| 3324 | fi |
| 3325 | |
David CARLIER | 2a4b472 | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 3326 | ######################################### |
| 3327 | # sys/signal.h check |
| 3328 | have_sys_signal_h=no |
| 3329 | if check_include "sys/signal.h" ; then |
| 3330 | have_sys_signal_h=yes |
| 3331 | fi |
| 3332 | |
Daniel P. Berrange | 559607e | 2015-02-27 16:19:33 +0000 | [diff] [blame] | 3333 | ########################################## |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3334 | # VTE probe |
| 3335 | |
| 3336 | if test "$vte" != "no"; then |
Daniel P. Berrangé | 89d85cd | 2018-08-22 14:15:52 +0100 | [diff] [blame] | 3337 | vteminversion="0.32.0" |
| 3338 | if $pkg_config --exists "vte-2.91"; then |
| 3339 | vtepackage="vte-2.91" |
Daniel P. Berrange | 528de90 | 2013-02-25 15:20:44 +0000 | [diff] [blame] | 3340 | else |
Daniel P. Berrangé | 89d85cd | 2018-08-22 14:15:52 +0100 | [diff] [blame] | 3341 | vtepackage="vte-2.90" |
Daniel P. Berrange | 528de90 | 2013-02-25 15:20:44 +0000 | [diff] [blame] | 3342 | fi |
Cole Robinson | c6feff9 | 2016-05-06 14:03:12 -0400 | [diff] [blame] | 3343 | if $pkg_config --exists "$vtepackage >= $vteminversion"; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3344 | vte_cflags=$($pkg_config --cflags $vtepackage) |
| 3345 | vte_libs=$($pkg_config --libs $vtepackage) |
| 3346 | vteversion=$($pkg_config --modversion $vtepackage) |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3347 | vte="yes" |
| 3348 | elif test "$vte" = "yes"; then |
Daniel P. Berrangé | 89d85cd | 2018-08-22 14:15:52 +0100 | [diff] [blame] | 3349 | feature_not_found "vte" "Install libvte-2.90/2.91 devel" |
Peter Maydell | 0d185e6 | 2013-07-18 16:42:01 +0100 | [diff] [blame] | 3350 | else |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 3351 | vte="no" |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 3352 | fi |
| 3353 | fi |
| 3354 | |
| 3355 | ########################################## |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3356 | # RDMA needs OpenFabrics libraries |
| 3357 | if test "$rdma" != "no" ; then |
| 3358 | cat > $TMPC <<EOF |
| 3359 | #include <rdma/rdma_cma.h> |
| 3360 | int main(void) { return 0; } |
| 3361 | EOF |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 3362 | rdma_libs="-lrdmacm -libverbs -libumad" |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3363 | if compile_prog "" "$rdma_libs" ; then |
| 3364 | rdma="yes" |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3365 | else |
| 3366 | if test "$rdma" = "yes" ; then |
| 3367 | error_exit \ |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 3368 | " OpenFabrics librdmacm/libibverbs/libibumad not present." \ |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3369 | " Your options:" \ |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 3370 | " (1) Fast: Install infiniband packages (devel) from your distro." \ |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3371 | " (2) Cleanest: Install libraries from www.openfabrics.org" \ |
| 3372 | " (3) Also: Install softiwarp if you don't have RDMA hardware" |
| 3373 | fi |
| 3374 | rdma="no" |
| 3375 | fi |
| 3376 | fi |
| 3377 | |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 3378 | ########################################## |
| 3379 | # PVRDMA detection |
| 3380 | |
| 3381 | cat > $TMPC <<EOF && |
| 3382 | #include <sys/mman.h> |
| 3383 | |
| 3384 | int |
| 3385 | main(void) |
| 3386 | { |
| 3387 | char buf = 0; |
| 3388 | void *addr = &buf; |
| 3389 | addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED); |
| 3390 | |
| 3391 | return 0; |
| 3392 | } |
| 3393 | EOF |
| 3394 | |
| 3395 | if test "$rdma" = "yes" ; then |
| 3396 | case "$pvrdma" in |
| 3397 | "") |
| 3398 | if compile_prog "" ""; then |
| 3399 | pvrdma="yes" |
| 3400 | else |
| 3401 | pvrdma="no" |
| 3402 | fi |
| 3403 | ;; |
| 3404 | "yes") |
| 3405 | if ! compile_prog "" ""; then |
| 3406 | error_exit "PVRDMA is not supported since mremap is not implemented" |
| 3407 | fi |
| 3408 | pvrdma="yes" |
| 3409 | ;; |
| 3410 | "no") |
| 3411 | pvrdma="no" |
| 3412 | ;; |
| 3413 | esac |
| 3414 | else |
| 3415 | if test "$pvrdma" = "yes" ; then |
| 3416 | error_exit "PVRDMA requires rdma suppport" |
| 3417 | fi |
| 3418 | pvrdma="no" |
| 3419 | fi |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 3420 | |
Yuval Shaia | ee10858 | 2019-08-18 16:21:06 +0300 | [diff] [blame] | 3421 | # Let's see if enhanced reg_mr is supported |
| 3422 | if test "$pvrdma" = "yes" ; then |
| 3423 | |
| 3424 | cat > $TMPC <<EOF && |
| 3425 | #include <infiniband/verbs.h> |
| 3426 | |
| 3427 | int |
| 3428 | main(void) |
| 3429 | { |
| 3430 | struct ibv_mr *mr; |
| 3431 | struct ibv_pd *pd = NULL; |
| 3432 | size_t length = 10; |
| 3433 | uint64_t iova = 0; |
| 3434 | int access = 0; |
| 3435 | void *addr = NULL; |
| 3436 | |
| 3437 | mr = ibv_reg_mr_iova(pd, addr, length, iova, access); |
| 3438 | |
| 3439 | ibv_dereg_mr(mr); |
| 3440 | |
| 3441 | return 0; |
| 3442 | } |
| 3443 | EOF |
| 3444 | if ! compile_prog "" "-libverbs"; then |
| 3445 | QEMU_CFLAGS="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR" |
| 3446 | fi |
| 3447 | fi |
| 3448 | |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 3449 | ########################################## |
Gerd Hoffmann | 6a02153 | 2017-10-05 17:33:28 +0200 | [diff] [blame] | 3450 | # xkbcommon probe |
| 3451 | if test "$xkbcommon" != "no" ; then |
| 3452 | if $pkg_config xkbcommon --exists; then |
| 3453 | xkbcommon_cflags=$($pkg_config xkbcommon --cflags) |
| 3454 | xkbcommon_libs=$($pkg_config xkbcommon --libs) |
| 3455 | xkbcommon=yes |
| 3456 | else |
| 3457 | if test "$xkbcommon" = "yes" ; then |
| 3458 | feature_not_found "xkbcommon" "Install libxkbcommon-devel" |
| 3459 | fi |
| 3460 | xkbcommon=no |
| 3461 | fi |
| 3462 | fi |
| 3463 | |
aliguori | 76655d6 | 2009-03-06 20:27:37 +0000 | [diff] [blame] | 3464 | |
| 3465 | ########################################## |
Eric Blake | c1bb86c | 2016-12-02 13:48:54 -0600 | [diff] [blame] | 3466 | # xfsctl() probe, used for file-posix.c |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 3467 | if test "$xfs" != "no" ; then |
| 3468 | cat > $TMPC << EOF |
Stefan Weil | ffc41d1 | 2011-12-17 09:27:36 +0100 | [diff] [blame] | 3469 | #include <stddef.h> /* NULL */ |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 3470 | #include <xfs/xfs.h> |
| 3471 | int main(void) |
| 3472 | { |
| 3473 | xfsctl(NULL, 0, 0, NULL); |
| 3474 | return 0; |
| 3475 | } |
| 3476 | EOF |
| 3477 | if compile_prog "" "" ; then |
| 3478 | xfs="yes" |
| 3479 | else |
| 3480 | if test "$xfs" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3481 | feature_not_found "xfs" "Instal xfsprogs/xfslibs devel" |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 3482 | fi |
| 3483 | xfs=no |
| 3484 | fi |
| 3485 | fi |
| 3486 | |
| 3487 | ########################################## |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 3488 | # vde libraries probe |
Juan Quintela | dfb278b | 2009-08-12 18:20:27 +0200 | [diff] [blame] | 3489 | if test "$vde" != "no" ; then |
Juan Quintela | 4baae0a | 2009-07-27 16:13:19 +0200 | [diff] [blame] | 3490 | vde_libs="-lvdeplug" |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 3491 | cat > $TMPC << EOF |
| 3492 | #include <libvdeplug.h> |
pbrook | 4a7f0e0 | 2008-09-07 16:42:53 +0000 | [diff] [blame] | 3493 | int main(void) |
| 3494 | { |
| 3495 | struct vde_open_args a = {0, 0, 0}; |
Peter Maydell | fea08e0 | 2012-07-18 15:10:25 +0100 | [diff] [blame] | 3496 | char s[] = ""; |
| 3497 | vde_open(s, s, &a); |
pbrook | 4a7f0e0 | 2008-09-07 16:42:53 +0000 | [diff] [blame] | 3498 | return 0; |
| 3499 | } |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 3500 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 3501 | if compile_prog "" "$vde_libs" ; then |
Juan Quintela | 4baae0a | 2009-07-27 16:13:19 +0200 | [diff] [blame] | 3502 | vde=yes |
Juan Quintela | dfb278b | 2009-08-12 18:20:27 +0200 | [diff] [blame] | 3503 | else |
| 3504 | if test "$vde" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3505 | feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" |
Juan Quintela | dfb278b | 2009-08-12 18:20:27 +0200 | [diff] [blame] | 3506 | fi |
| 3507 | vde=no |
Juan Quintela | 4baae0a | 2009-07-27 16:13:19 +0200 | [diff] [blame] | 3508 | fi |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 3509 | fi |
| 3510 | |
| 3511 | ########################################## |
Vincenzo Maffione | 0a985b3 | 2014-02-20 15:40:43 +0100 | [diff] [blame] | 3512 | # netmap support probe |
| 3513 | # Apart from looking for netmap headers, we make sure that the host API version |
| 3514 | # supports the netmap backend (>=11). The upper bound (15) is meant to simulate |
| 3515 | # a minor/major version number. Minor new features will be marked with values up |
| 3516 | # to 15, and if something happens that requires a change to the backend we will |
| 3517 | # move above 15, submit the backend fixes and modify this two bounds. |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 3518 | if test "$netmap" != "no" ; then |
| 3519 | cat > $TMPC << EOF |
| 3520 | #include <inttypes.h> |
| 3521 | #include <net/if.h> |
| 3522 | #include <net/netmap.h> |
| 3523 | #include <net/netmap_user.h> |
Vincenzo Maffione | 0a985b3 | 2014-02-20 15:40:43 +0100 | [diff] [blame] | 3524 | #if (NETMAP_API < 11) || (NETMAP_API > 15) |
| 3525 | #error |
| 3526 | #endif |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 3527 | int main(void) { return 0; } |
| 3528 | EOF |
| 3529 | if compile_prog "" "" ; then |
| 3530 | netmap=yes |
| 3531 | else |
| 3532 | if test "$netmap" = "yes" ; then |
| 3533 | feature_not_found "netmap" |
| 3534 | fi |
| 3535 | netmap=no |
| 3536 | fi |
| 3537 | fi |
| 3538 | |
| 3539 | ########################################## |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 3540 | # libcap-ng library probe |
| 3541 | if test "$cap_ng" != "no" ; then |
| 3542 | cap_libs="-lcap-ng" |
| 3543 | cat > $TMPC << EOF |
| 3544 | #include <cap-ng.h> |
| 3545 | int main(void) |
| 3546 | { |
| 3547 | capng_capability_to_name(CAPNG_EFFECTIVE); |
| 3548 | return 0; |
| 3549 | } |
| 3550 | EOF |
| 3551 | if compile_prog "" "$cap_libs" ; then |
| 3552 | cap_ng=yes |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 3553 | else |
| 3554 | if test "$cap_ng" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3555 | feature_not_found "cap_ng" "Install libcap-ng devel" |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 3556 | fi |
| 3557 | cap_ng=no |
| 3558 | fi |
| 3559 | fi |
| 3560 | |
| 3561 | ########################################## |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 3562 | # Sound support libraries probe |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 3563 | |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3564 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g') |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 3565 | for drv in $audio_drv_list; do |
| 3566 | case $drv in |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3567 | alsa | try-alsa) |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3568 | if $pkg_config alsa --exists; then |
| 3569 | alsa_libs=$($pkg_config alsa --libs) |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 3570 | alsa_cflags=$($pkg_config alsa --cflags) |
| 3571 | alsa=yes |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3572 | if test "$drv" = "try-alsa"; then |
| 3573 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa/alsa/') |
| 3574 | fi |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3575 | else |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3576 | if test "$drv" = "try-alsa"; then |
| 3577 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa//') |
| 3578 | else |
| 3579 | error_exit "$drv check failed" \ |
| 3580 | "Make sure to have the $drv libs and headers installed." |
| 3581 | fi |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3582 | fi |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 3583 | ;; |
| 3584 | |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3585 | pa | try-pa) |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3586 | if $pkg_config libpulse --exists; then |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 3587 | libpulse=yes |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3588 | pulse_libs=$($pkg_config libpulse --libs) |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 3589 | pulse_cflags=$($pkg_config libpulse --cflags) |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3590 | if test "$drv" = "try-pa"; then |
| 3591 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/') |
| 3592 | fi |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3593 | else |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3594 | if test "$drv" = "try-pa"; then |
| 3595 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa//') |
| 3596 | else |
| 3597 | error_exit "$drv check failed" \ |
| 3598 | "Make sure to have the $drv libs and headers installed." |
| 3599 | fi |
Gerd Hoffmann | c80a867 | 2019-01-24 12:20:50 +0100 | [diff] [blame] | 3600 | fi |
malc | b8e59f1 | 2008-07-02 21:03:08 +0000 | [diff] [blame] | 3601 | ;; |
| 3602 | |
Gerd Hoffmann | 373967b | 2017-03-20 10:05:43 +0100 | [diff] [blame] | 3603 | sdl) |
| 3604 | if test "$sdl" = "no"; then |
| 3605 | error_exit "sdl not found or disabled, can not use sdl audio driver" |
| 3606 | fi |
| 3607 | ;; |
| 3608 | |
Gerd Hoffmann | e42975a | 2019-01-24 12:20:51 +0100 | [diff] [blame] | 3609 | try-sdl) |
| 3610 | if test "$sdl" = "no"; then |
| 3611 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl//') |
| 3612 | else |
| 3613 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl/sdl/') |
| 3614 | fi |
| 3615 | ;; |
| 3616 | |
Juan Quintela | 997e690 | 2009-08-03 14:46:29 +0200 | [diff] [blame] | 3617 | coreaudio) |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 3618 | coreaudio_libs="-framework CoreAudio" |
Juan Quintela | 997e690 | 2009-08-03 14:46:29 +0200 | [diff] [blame] | 3619 | ;; |
| 3620 | |
Juan Quintela | a4bf678 | 2009-08-03 14:46:30 +0200 | [diff] [blame] | 3621 | dsound) |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 3622 | dsound_libs="-lole32 -ldxguid" |
malc | d563163 | 2009-10-10 01:13:41 +0400 | [diff] [blame] | 3623 | audio_win_int="yes" |
Juan Quintela | a4bf678 | 2009-08-03 14:46:30 +0200 | [diff] [blame] | 3624 | ;; |
| 3625 | |
| 3626 | oss) |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 3627 | oss_libs="$oss_lib" |
Juan Quintela | a4bf678 | 2009-08-03 14:46:30 +0200 | [diff] [blame] | 3628 | ;; |
| 3629 | |
Geoffrey McRae | 2e44570 | 2020-04-29 15:53:58 +1000 | [diff] [blame] | 3630 | jack | try-jack) |
| 3631 | if $pkg_config jack --exists; then |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 3632 | libjack=yes |
Geoffrey McRae | 2e44570 | 2020-04-29 15:53:58 +1000 | [diff] [blame] | 3633 | jack_libs=$($pkg_config jack --libs) |
| 3634 | if test "$drv" = "try-jack"; then |
| 3635 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack/jack/') |
| 3636 | fi |
| 3637 | else |
| 3638 | if test "$drv" = "try-jack"; then |
| 3639 | audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack//') |
| 3640 | else |
| 3641 | error_exit "$drv check failed" \ |
| 3642 | "Make sure to have the $drv libs and headers installed." |
| 3643 | fi |
| 3644 | fi |
| 3645 | ;; |
| 3646 | |
malc | e4c63a6 | 2008-07-19 16:15:16 +0000 | [diff] [blame] | 3647 | *) |
malc | 1c9b2a5 | 2008-07-19 16:57:30 +0000 | [diff] [blame] | 3648 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 3649 | error_exit "Unknown driver '$drv' selected" \ |
| 3650 | "Possible drivers are: $audio_possible_drivers" |
malc | e4c63a6 | 2008-07-19 16:15:16 +0000 | [diff] [blame] | 3651 | } |
| 3652 | ;; |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 3653 | esac |
| 3654 | done |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 3655 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3656 | ########################################## |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 3657 | # BrlAPI probe |
| 3658 | |
Juan Quintela | 4ffcedb | 2009-08-12 18:20:26 +0200 | [diff] [blame] | 3659 | if test "$brlapi" != "no" ; then |
Juan Quintela | eb82284 | 2009-07-27 16:13:18 +0200 | [diff] [blame] | 3660 | brlapi_libs="-lbrlapi" |
| 3661 | cat > $TMPC << EOF |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 3662 | #include <brlapi.h> |
Scott Wood | 832ce9c | 2010-10-05 14:28:17 -0500 | [diff] [blame] | 3663 | #include <stddef.h> |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 3664 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
| 3665 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 3666 | if compile_prog "" "$brlapi_libs" ; then |
Juan Quintela | eb82284 | 2009-07-27 16:13:18 +0200 | [diff] [blame] | 3667 | brlapi=yes |
Juan Quintela | 4ffcedb | 2009-08-12 18:20:26 +0200 | [diff] [blame] | 3668 | else |
| 3669 | if test "$brlapi" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3670 | feature_not_found "brlapi" "Install brlapi devel" |
Juan Quintela | 4ffcedb | 2009-08-12 18:20:26 +0200 | [diff] [blame] | 3671 | fi |
| 3672 | brlapi=no |
Juan Quintela | eb82284 | 2009-07-27 16:13:18 +0200 | [diff] [blame] | 3673 | fi |
| 3674 | fi |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 3675 | |
| 3676 | ########################################## |
Samuel Thibault | e08bb30 | 2019-03-11 14:51:26 +0100 | [diff] [blame] | 3677 | # iconv probe |
| 3678 | if test "$iconv" != "no" ; then |
| 3679 | cat > $TMPC << EOF |
| 3680 | #include <iconv.h> |
| 3681 | int main(void) { |
| 3682 | iconv_t conv = iconv_open("WCHAR_T", "UCS-2"); |
| 3683 | return conv != (iconv_t) -1; |
| 3684 | } |
| 3685 | EOF |
| 3686 | iconv_prefix_list="/usr/local:/usr" |
| 3687 | iconv_lib_list=":-liconv" |
| 3688 | IFS=: |
| 3689 | for iconv_prefix in $iconv_prefix_list; do |
| 3690 | IFS=: |
| 3691 | iconv_cflags="-I$iconv_prefix/include" |
| 3692 | iconv_ldflags="-L$iconv_prefix/lib" |
| 3693 | for iconv_link in $iconv_lib_list; do |
| 3694 | unset IFS |
| 3695 | iconv_lib="$iconv_ldflags $iconv_link" |
| 3696 | echo "looking at iconv in '$iconv_cflags' '$iconv_lib'" >> config.log |
| 3697 | if compile_prog "$iconv_cflags" "$iconv_lib" ; then |
| 3698 | iconv_found=yes |
| 3699 | break |
| 3700 | fi |
| 3701 | done |
| 3702 | if test "$iconv_found" = yes ; then |
| 3703 | break |
| 3704 | fi |
| 3705 | done |
| 3706 | if test "$iconv_found" = "yes" ; then |
| 3707 | iconv=yes |
| 3708 | else |
| 3709 | if test "$iconv" = "yes" ; then |
| 3710 | feature_not_found "iconv" "Install iconv devel" |
| 3711 | fi |
| 3712 | iconv=no |
| 3713 | fi |
| 3714 | fi |
| 3715 | |
| 3716 | ########################################## |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3717 | # curses probe |
Samuel Thibault | e08bb30 | 2019-03-11 14:51:26 +0100 | [diff] [blame] | 3718 | if test "$iconv" = "no" ; then |
| 3719 | # curses will need iconv |
| 3720 | curses=no |
| 3721 | fi |
Juan Quintela | c584a6d | 2009-08-12 18:20:30 +0200 | [diff] [blame] | 3722 | if test "$curses" != "no" ; then |
Michael Tokarev | a3605bf | 2013-05-25 13:17:21 +0400 | [diff] [blame] | 3723 | if test "$mingw32" = "yes" ; then |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3724 | curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" |
| 3725 | curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses" |
Michael Tokarev | a3605bf | 2013-05-25 13:17:21 +0400 | [diff] [blame] | 3726 | else |
Samuel Thibault | 7c70300 | 2016-11-09 11:27:52 +0100 | [diff] [blame] | 3727 | curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:" |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3728 | curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw" |
Michael Tokarev | a3605bf | 2013-05-25 13:17:21 +0400 | [diff] [blame] | 3729 | fi |
Juan Quintela | c584a6d | 2009-08-12 18:20:30 +0200 | [diff] [blame] | 3730 | curses_found=no |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3731 | cat > $TMPC << EOF |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3732 | #include <locale.h> |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3733 | #include <curses.h> |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3734 | #include <wchar.h> |
Samuel Thibault | 2f8b7cd | 2019-03-11 14:51:27 +0100 | [diff] [blame] | 3735 | #include <langinfo.h> |
Stefan Weil | ef9a252 | 2011-12-17 17:46:02 +0100 | [diff] [blame] | 3736 | int main(void) { |
Samuel Thibault | 2f8b7cd | 2019-03-11 14:51:27 +0100 | [diff] [blame] | 3737 | const char *codeset; |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3738 | wchar_t wch = L'w'; |
| 3739 | setlocale(LC_ALL, ""); |
Stefan Weil | ef9a252 | 2011-12-17 17:46:02 +0100 | [diff] [blame] | 3740 | resize_term(0, 0); |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3741 | addwstr(L"wide chars\n"); |
| 3742 | addnwstr(&wch, 1); |
Samuel Thibault | 7c70300 | 2016-11-09 11:27:52 +0100 | [diff] [blame] | 3743 | add_wch(WACS_DEGREE); |
Samuel Thibault | 2f8b7cd | 2019-03-11 14:51:27 +0100 | [diff] [blame] | 3744 | codeset = nl_langinfo(CODESET); |
| 3745 | return codeset != 0; |
Stefan Weil | ef9a252 | 2011-12-17 17:46:02 +0100 | [diff] [blame] | 3746 | } |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3747 | EOF |
Vadim Evard | ecbe251 | 2013-01-15 16:17:24 +0400 | [diff] [blame] | 3748 | IFS=: |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3749 | for curses_inc in $curses_inc_list; do |
Peter Maydell | b01a4fd | 2017-06-02 15:35:38 +0100 | [diff] [blame] | 3750 | # Make sure we get the wide character prototypes |
| 3751 | curses_inc="-DNCURSES_WIDECHAR $curses_inc" |
Samuel Thibault | 7c70300 | 2016-11-09 11:27:52 +0100 | [diff] [blame] | 3752 | IFS=: |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3753 | for curses_lib in $curses_lib_list; do |
| 3754 | unset IFS |
| 3755 | if compile_prog "$curses_inc" "$curses_lib" ; then |
| 3756 | curses_found=yes |
Samuel Thibault | 8ddc5bf | 2016-10-15 21:53:05 +0200 | [diff] [blame] | 3757 | break |
| 3758 | fi |
| 3759 | done |
Samuel Thibault | 7c70300 | 2016-11-09 11:27:52 +0100 | [diff] [blame] | 3760 | if test "$curses_found" = yes ; then |
| 3761 | break |
| 3762 | fi |
Juan Quintela | 4f78ef9 | 2009-08-12 18:20:23 +0200 | [diff] [blame] | 3763 | done |
Vadim Evard | ecbe251 | 2013-01-15 16:17:24 +0400 | [diff] [blame] | 3764 | unset IFS |
Juan Quintela | c584a6d | 2009-08-12 18:20:30 +0200 | [diff] [blame] | 3765 | if test "$curses_found" = "yes" ; then |
| 3766 | curses=yes |
| 3767 | else |
| 3768 | if test "$curses" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3769 | feature_not_found "curses" "Install ncurses devel" |
Juan Quintela | c584a6d | 2009-08-12 18:20:30 +0200 | [diff] [blame] | 3770 | fi |
| 3771 | curses=no |
| 3772 | fi |
Juan Quintela | 4f78ef9 | 2009-08-12 18:20:23 +0200 | [diff] [blame] | 3773 | fi |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 3774 | |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 3775 | ########################################## |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 3776 | # curl probe |
Juan Quintela | 788c819 | 2009-08-12 18:29:47 +0200 | [diff] [blame] | 3777 | if test "$curl" != "no" ; then |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 3778 | if $pkg_config libcurl --exists; then |
Michael Tokarev | a3605bf | 2013-05-25 13:17:21 +0400 | [diff] [blame] | 3779 | curlconfig="$pkg_config libcurl" |
| 3780 | else |
| 3781 | curlconfig=curl-config |
| 3782 | fi |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 3783 | cat > $TMPC << EOF |
| 3784 | #include <curl/curl.h> |
Peter Maydell | 0b862ce | 2011-06-09 22:54:29 +0100 | [diff] [blame] | 3785 | int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 3786 | EOF |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3787 | curl_cflags=$($curlconfig --cflags 2>/dev/null) |
| 3788 | curl_libs=$($curlconfig --libs 2>/dev/null) |
Juan Quintela | b1d5a27 | 2009-08-03 14:46:05 +0200 | [diff] [blame] | 3789 | if compile_prog "$curl_cflags" "$curl_libs" ; then |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 3790 | curl=yes |
Juan Quintela | 788c819 | 2009-08-12 18:29:47 +0200 | [diff] [blame] | 3791 | else |
| 3792 | if test "$curl" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 3793 | feature_not_found "curl" "Install libcurl devel" |
Juan Quintela | 788c819 | 2009-08-12 18:29:47 +0200 | [diff] [blame] | 3794 | fi |
| 3795 | curl=no |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 3796 | fi |
| 3797 | fi # test "$curl" |
| 3798 | |
| 3799 | ########################################## |
Anthony Liguori | e18df14 | 2011-07-19 14:50:29 -0500 | [diff] [blame] | 3800 | # glib support probe |
Paolo Bonzini | a52d28a | 2012-04-05 13:01:54 +0200 | [diff] [blame] | 3801 | |
Daniel P. Berrangé | 00f2cfb | 2018-05-04 15:34:46 +0100 | [diff] [blame] | 3802 | glib_req_ver=2.48 |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 3803 | glib_modules=gthread-2.0 |
| 3804 | if test "$modules" = yes; then |
Gerd Hoffmann | a88afc6 | 2018-03-08 09:53:00 +0100 | [diff] [blame] | 3805 | glib_modules="$glib_modules gmodule-export-2.0" |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 3806 | fi |
Emilio G. Cota | 54cb65d | 2017-08-30 18:39:53 -0400 | [diff] [blame] | 3807 | if test "$plugins" = yes; then |
| 3808 | glib_modules="$glib_modules gmodule-2.0" |
| 3809 | fi |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3810 | |
Sameeh Jubran | 4eaf720 | 2017-03-26 12:56:22 +0300 | [diff] [blame] | 3811 | # This workaround is required due to a bug in pkg-config file for glib as it |
| 3812 | # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static |
| 3813 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 3814 | if test "$static" = yes && test "$mingw32" = yes; then |
Sameeh Jubran | 4eaf720 | 2017-03-26 12:56:22 +0300 | [diff] [blame] | 3815 | QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" |
| 3816 | fi |
| 3817 | |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 3818 | for i in $glib_modules; do |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3819 | if $pkg_config --atleast-version=$glib_req_ver $i; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3820 | glib_cflags=$($pkg_config --cflags $i) |
| 3821 | glib_libs=$($pkg_config --libs $i) |
Marc-André Lureau | 4a05889 | 2016-09-26 00:57:48 +0400 | [diff] [blame] | 3822 | QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3823 | LIBS="$glib_libs $LIBS" |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3824 | else |
| 3825 | error_exit "glib-$glib_req_ver $i is required to compile QEMU" |
| 3826 | fi |
| 3827 | done |
| 3828 | |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 3829 | if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then |
| 3830 | gio=yes |
| 3831 | gio_cflags=$($pkg_config --cflags gio-2.0) |
| 3832 | gio_libs=$($pkg_config --libs gio-2.0) |
Marc-André Lureau | 25a97a5 | 2019-09-27 11:34:42 +0400 | [diff] [blame] | 3833 | gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0) |
Marc-André Lureau | 0dba489 | 2020-01-10 15:27:25 +0400 | [diff] [blame] | 3834 | if [ ! -x "$gdbus_codegen" ]; then |
| 3835 | gdbus_codegen= |
| 3836 | fi |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 3837 | else |
| 3838 | gio=no |
| 3839 | fi |
| 3840 | |
Marc-André Lureau | 25a97a5 | 2019-09-27 11:34:42 +0400 | [diff] [blame] | 3841 | if $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then |
| 3842 | gio_cflags="$gio_cflags $($pkg_config --cflags gio-unix-2.0)" |
| 3843 | gio_libs="$gio_libs $($pkg_config --libs gio-unix-2.0)" |
| 3844 | fi |
| 3845 | |
Daniel P. Berrange | 977a82a | 2016-01-27 09:00:45 +0000 | [diff] [blame] | 3846 | # Sanity check that the current size_t matches the |
| 3847 | # size that glib thinks it should be. This catches |
| 3848 | # problems on multi-arch where people try to build |
| 3849 | # 32-bit QEMU while pointing at 64-bit glib headers |
| 3850 | cat > $TMPC <<EOF |
| 3851 | #include <glib.h> |
| 3852 | #include <unistd.h> |
| 3853 | |
| 3854 | #define QEMU_BUILD_BUG_ON(x) \ |
| 3855 | typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused)); |
| 3856 | |
| 3857 | int main(void) { |
| 3858 | QEMU_BUILD_BUG_ON(sizeof(size_t) != GLIB_SIZEOF_SIZE_T); |
| 3859 | return 0; |
| 3860 | } |
| 3861 | EOF |
| 3862 | |
Stefan Weil | 5919e03 | 2016-04-28 23:33:41 +0200 | [diff] [blame] | 3863 | if ! compile_prog "$CFLAGS" "$LIBS" ; then |
Daniel P. Berrange | 977a82a | 2016-01-27 09:00:45 +0000 | [diff] [blame] | 3864 | error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ |
| 3865 | "You probably need to set PKG_CONFIG_LIBDIR"\ |
| 3866 | "to point to the right pkg-config files for your"\ |
| 3867 | "build target" |
| 3868 | fi |
| 3869 | |
John Snow | bbbf2e0 | 2015-03-25 18:57:38 -0400 | [diff] [blame] | 3870 | # Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage |
| 3871 | cat > $TMPC << EOF |
| 3872 | #include <glib.h> |
| 3873 | int main(void) { return 0; } |
| 3874 | EOF |
| 3875 | if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then |
| 3876 | if cc_has_warning_flag "-Wno-unknown-attributes"; then |
| 3877 | glib_cflags="-Wno-unknown-attributes $glib_cflags" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 3878 | QEMU_CFLAGS="-Wno-unknown-attributes $CFLAGS" |
John Snow | bbbf2e0 | 2015-03-25 18:57:38 -0400 | [diff] [blame] | 3879 | fi |
| 3880 | fi |
| 3881 | |
Eric Blake | 9bda600 | 2020-03-17 12:55:34 -0500 | [diff] [blame] | 3882 | # Silence clang warnings triggered by glib < 2.57.2 |
| 3883 | cat > $TMPC << EOF |
| 3884 | #include <glib.h> |
| 3885 | typedef struct Foo { |
| 3886 | int i; |
| 3887 | } Foo; |
| 3888 | static void foo_free(Foo *f) |
| 3889 | { |
| 3890 | g_free(f); |
| 3891 | } |
| 3892 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free); |
| 3893 | int main(void) { return 0; } |
| 3894 | EOF |
| 3895 | if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then |
| 3896 | if cc_has_warning_flag "-Wno-unused-function"; then |
| 3897 | glib_cflags="$glib_cflags -Wno-unused-function" |
| 3898 | CFLAGS="$CFLAGS -Wno-unused-function" |
| 3899 | fi |
| 3900 | fi |
| 3901 | |
Stefan Weil | 6a1f42b | 2018-07-12 21:26:03 +0200 | [diff] [blame] | 3902 | ######################################### |
| 3903 | # zlib check |
| 3904 | |
| 3905 | if test "$zlib" != "no" ; then |
| 3906 | if $pkg_config --exists zlib; then |
| 3907 | zlib_cflags=$($pkg_config --cflags zlib) |
| 3908 | zlib_libs=$($pkg_config --libs zlib) |
| 3909 | QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS" |
| 3910 | LIBS="$zlib_libs $LIBS" |
| 3911 | else |
| 3912 | cat > $TMPC << EOF |
| 3913 | #include <zlib.h> |
| 3914 | int main(void) { zlibVersion(); return 0; } |
| 3915 | EOF |
| 3916 | if compile_prog "" "-lz" ; then |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 3917 | zlib_libs=-lz |
| 3918 | LIBS="$LIBS $zlib_libs" |
Stefan Weil | 6a1f42b | 2018-07-12 21:26:03 +0200 | [diff] [blame] | 3919 | else |
| 3920 | error_exit "zlib check failed" \ |
| 3921 | "Make sure to have the zlib libs and headers installed." |
| 3922 | fi |
| 3923 | fi |
| 3924 | fi |
| 3925 | |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3926 | ########################################## |
| 3927 | # SHA command probe for modules |
| 3928 | if test "$modules" = yes; then |
| 3929 | shacmd_probe="sha1sum sha1 shasum" |
| 3930 | for c in $shacmd_probe; do |
Fam Zheng | 8ccefb9 | 2014-12-04 14:18:16 +0800 | [diff] [blame] | 3931 | if has $c; then |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3932 | shacmd="$c" |
| 3933 | break |
| 3934 | fi |
| 3935 | done |
| 3936 | if test "$shacmd" = ""; then |
| 3937 | error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" |
| 3938 | fi |
Anthony Liguori | e18df14 | 2011-07-19 14:50:29 -0500 | [diff] [blame] | 3939 | fi |
| 3940 | |
| 3941 | ########################################## |
Gerd Hoffmann | e2134eb | 2012-09-25 16:04:58 +0200 | [diff] [blame] | 3942 | # pixman support probe |
| 3943 | |
Thomas Huth | 9b52b17 | 2020-07-23 16:11:23 +0200 | [diff] [blame] | 3944 | if test "$softmmu" = "no"; then |
Robert Schiele | 74880fe | 2012-12-04 16:58:08 +0100 | [diff] [blame] | 3945 | pixman_cflags= |
| 3946 | pixman_libs= |
Gerd Hoffmann | 35c4e86 | 2017-09-05 16:01:16 +0200 | [diff] [blame] | 3947 | elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3948 | pixman_cflags=$($pkg_config --cflags pixman-1) |
| 3949 | pixman_libs=$($pkg_config --libs pixman-1) |
Gerd Hoffmann | e2134eb | 2012-09-25 16:04:58 +0200 | [diff] [blame] | 3950 | else |
Gerd Hoffmann | c12b6d7 | 2017-09-05 16:01:15 +0200 | [diff] [blame] | 3951 | error_exit "pixman >= 0.21.8 not present." \ |
| 3952 | "Please install the pixman devel package." |
Gerd Hoffmann | e2134eb | 2012-09-25 16:04:58 +0200 | [diff] [blame] | 3953 | fi |
Gerd Hoffmann | e2134eb | 2012-09-25 16:04:58 +0200 | [diff] [blame] | 3954 | |
| 3955 | ########################################## |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 3956 | # libmpathpersist probe |
| 3957 | |
| 3958 | if test "$mpath" != "no" ; then |
Murilo Opsfelder Araujo | 1b0578f | 2018-08-10 11:11:16 -0300 | [diff] [blame] | 3959 | # probe for the new API |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 3960 | cat > $TMPC <<EOF |
| 3961 | #include <libudev.h> |
| 3962 | #include <mpath_persist.h> |
| 3963 | unsigned mpath_mx_alloc_len = 1024; |
| 3964 | int logsink; |
Paolo Bonzini | b3f1c8c | 2017-10-17 20:11:58 +0200 | [diff] [blame] | 3965 | static struct config *multipath_conf; |
| 3966 | extern struct udev *udev; |
| 3967 | extern struct config *get_multipath_config(void); |
| 3968 | extern void put_multipath_config(struct config *conf); |
| 3969 | struct udev *udev; |
| 3970 | struct config *get_multipath_config(void) { return multipath_conf; } |
| 3971 | void put_multipath_config(struct config *conf) { } |
| 3972 | |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 3973 | int main(void) { |
Paolo Bonzini | b3f1c8c | 2017-10-17 20:11:58 +0200 | [diff] [blame] | 3974 | udev = udev_new(); |
| 3975 | multipath_conf = mpath_lib_init(); |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 3976 | return 0; |
| 3977 | } |
| 3978 | EOF |
| 3979 | if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then |
| 3980 | mpathpersist=yes |
Murilo Opsfelder Araujo | 1b0578f | 2018-08-10 11:11:16 -0300 | [diff] [blame] | 3981 | mpathpersist_new_api=yes |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 3982 | else |
Murilo Opsfelder Araujo | 1b0578f | 2018-08-10 11:11:16 -0300 | [diff] [blame] | 3983 | # probe for the old API |
| 3984 | cat > $TMPC <<EOF |
| 3985 | #include <libudev.h> |
| 3986 | #include <mpath_persist.h> |
| 3987 | unsigned mpath_mx_alloc_len = 1024; |
| 3988 | int logsink; |
| 3989 | int main(void) { |
| 3990 | struct udev *udev = udev_new(); |
| 3991 | mpath_lib_init(udev); |
| 3992 | return 0; |
| 3993 | } |
| 3994 | EOF |
| 3995 | if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then |
| 3996 | mpathpersist=yes |
| 3997 | mpathpersist_new_api=no |
| 3998 | else |
| 3999 | mpathpersist=no |
| 4000 | fi |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 4001 | fi |
| 4002 | else |
| 4003 | mpathpersist=no |
| 4004 | fi |
| 4005 | |
| 4006 | ########################################## |
aliguori | e5d355d | 2009-04-24 18:03:15 +0000 | [diff] [blame] | 4007 | # pthread probe |
Brad | 4b29ec4 | 2011-08-07 20:02:11 -0400 | [diff] [blame] | 4008 | PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" |
aliguori | 3c529d9 | 2008-12-12 16:41:40 +0000 | [diff] [blame] | 4009 | |
Christoph Hellwig | 4dd75c7 | 2009-08-10 23:39:39 +0200 | [diff] [blame] | 4010 | pthread=no |
aliguori | e5d355d | 2009-04-24 18:03:15 +0000 | [diff] [blame] | 4011 | cat > $TMPC << EOF |
aliguori | 3c529d9 | 2008-12-12 16:41:40 +0000 | [diff] [blame] | 4012 | #include <pthread.h> |
Stefan Weil | 7a42bbe | 2011-12-17 09:27:32 +0100 | [diff] [blame] | 4013 | static void *f(void *p) { return NULL; } |
| 4014 | int main(void) { |
| 4015 | pthread_t thread; |
| 4016 | pthread_create(&thread, 0, f, 0); |
| 4017 | return 0; |
| 4018 | } |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 4019 | EOF |
Andreas Färber | bd00d53 | 2010-09-20 00:50:44 +0200 | [diff] [blame] | 4020 | if compile_prog "" "" ; then |
| 4021 | pthread=yes |
| 4022 | else |
| 4023 | for pthread_lib in $PTHREADLIBS_LIST; do |
| 4024 | if compile_prog "" "$pthread_lib" ; then |
| 4025 | pthread=yes |
Peter Portante | e3c5676 | 2012-04-20 10:36:12 -0400 | [diff] [blame] | 4026 | found=no |
| 4027 | for lib_entry in $LIBS; do |
| 4028 | if test "$lib_entry" = "$pthread_lib"; then |
| 4029 | found=yes |
| 4030 | break |
| 4031 | fi |
| 4032 | done |
| 4033 | if test "$found" = "no"; then |
| 4034 | LIBS="$pthread_lib $LIBS" |
| 4035 | fi |
Daniel P. Berrange | 409437e | 2016-07-20 14:23:13 +0100 | [diff] [blame] | 4036 | PTHREAD_LIB="$pthread_lib" |
Andreas Färber | bd00d53 | 2010-09-20 00:50:44 +0200 | [diff] [blame] | 4037 | break |
| 4038 | fi |
| 4039 | done |
| 4040 | fi |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 4041 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 4042 | if test "$mingw32" != yes && test "$pthread" = no; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 4043 | error_exit "pthread check failed" \ |
| 4044 | "Make sure to have the pthread libs and headers installed." |
aliguori | e5d355d | 2009-04-24 18:03:15 +0000 | [diff] [blame] | 4045 | fi |
| 4046 | |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 4047 | # check for pthread_setname_np with thread id |
| 4048 | pthread_setname_np_w_tid=no |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 4049 | cat > $TMPC << EOF |
| 4050 | #include <pthread.h> |
| 4051 | |
| 4052 | static void *f(void *p) { return NULL; } |
| 4053 | int main(void) |
| 4054 | { |
| 4055 | pthread_t thread; |
| 4056 | pthread_create(&thread, 0, f, 0); |
| 4057 | pthread_setname_np(thread, "QEMU"); |
| 4058 | return 0; |
| 4059 | } |
| 4060 | EOF |
| 4061 | if compile_prog "" "$pthread_lib" ; then |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 4062 | pthread_setname_np_w_tid=yes |
| 4063 | fi |
| 4064 | |
| 4065 | # check for pthread_setname_np without thread id |
| 4066 | pthread_setname_np_wo_tid=no |
| 4067 | cat > $TMPC << EOF |
| 4068 | #include <pthread.h> |
| 4069 | |
Thomas Huth | 12a9b8d | 2020-07-16 07:12:22 +0200 | [diff] [blame] | 4070 | static void *f(void *p) { pthread_setname_np("QEMU"); return NULL; } |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 4071 | int main(void) |
| 4072 | { |
| 4073 | pthread_t thread; |
| 4074 | pthread_create(&thread, 0, f, 0); |
| 4075 | return 0; |
| 4076 | } |
| 4077 | EOF |
| 4078 | if compile_prog "" "$pthread_lib" ; then |
| 4079 | pthread_setname_np_wo_tid=yes |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 4080 | fi |
| 4081 | |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 4082 | ########################################## |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4083 | # rbd probe |
| 4084 | if test "$rbd" != "no" ; then |
| 4085 | cat > $TMPC <<EOF |
| 4086 | #include <stdio.h> |
Josh Durgin | ad32e9c | 2011-05-26 16:07:31 -0700 | [diff] [blame] | 4087 | #include <rbd/librbd.h> |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4088 | int main(void) { |
Josh Durgin | ad32e9c | 2011-05-26 16:07:31 -0700 | [diff] [blame] | 4089 | rados_t cluster; |
| 4090 | rados_create(&cluster, NULL); |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4091 | return 0; |
| 4092 | } |
| 4093 | EOF |
Josh Durgin | ad32e9c | 2011-05-26 16:07:31 -0700 | [diff] [blame] | 4094 | rbd_libs="-lrbd -lrados" |
| 4095 | if compile_prog "" "$rbd_libs" ; then |
| 4096 | rbd=yes |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4097 | else |
| 4098 | if test "$rbd" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 4099 | feature_not_found "rados block device" "Install librbd/ceph devel" |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4100 | fi |
| 4101 | rbd=no |
| 4102 | fi |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 4103 | fi |
| 4104 | |
| 4105 | ########################################## |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4106 | # libssh probe |
| 4107 | if test "$libssh" != "no" ; then |
| 4108 | if $pkg_config --exists libssh; then |
| 4109 | libssh_cflags=$($pkg_config libssh --cflags) |
| 4110 | libssh_libs=$($pkg_config libssh --libs) |
| 4111 | libssh=yes |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 4112 | else |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4113 | if test "$libssh" = "yes" ; then |
| 4114 | error_exit "libssh required for --enable-libssh" |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 4115 | fi |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4116 | libssh=no |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 4117 | fi |
| 4118 | fi |
| 4119 | |
| 4120 | ########################################## |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4121 | # Check for libssh 0.8 |
| 4122 | # This is done like this instead of using the LIBSSH_VERSION_* and |
| 4123 | # SSH_VERSION_* macros because some distributions in the past shipped |
| 4124 | # snapshots of the future 0.8 from Git, and those snapshots did not |
| 4125 | # have updated version numbers (still referring to 0.7.0). |
Richard W.M. Jones | 9a2d462 | 2013-04-09 15:30:54 +0100 | [diff] [blame] | 4126 | |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4127 | if test "$libssh" = "yes"; then |
Richard W.M. Jones | 9a2d462 | 2013-04-09 15:30:54 +0100 | [diff] [blame] | 4128 | cat > $TMPC <<EOF |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4129 | #include <libssh/libssh.h> |
| 4130 | int main(void) { return ssh_get_server_publickey(NULL, NULL); } |
Richard W.M. Jones | 9a2d462 | 2013-04-09 15:30:54 +0100 | [diff] [blame] | 4131 | EOF |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 4132 | if compile_prog "$libssh_cflags" "$libssh_libs"; then |
| 4133 | libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags" |
Richard W.M. Jones | 9a2d462 | 2013-04-09 15:30:54 +0100 | [diff] [blame] | 4134 | fi |
| 4135 | fi |
| 4136 | |
| 4137 | ########################################## |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4138 | # linux-aio probe |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4139 | |
| 4140 | if test "$linux_aio" != "no" ; then |
| 4141 | cat > $TMPC <<EOF |
| 4142 | #include <libaio.h> |
| 4143 | #include <sys/eventfd.h> |
Scott Wood | 832ce9c | 2010-10-05 14:28:17 -0500 | [diff] [blame] | 4144 | #include <stddef.h> |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4145 | int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } |
| 4146 | EOF |
| 4147 | if compile_prog "" "-laio" ; then |
| 4148 | linux_aio=yes |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4149 | else |
| 4150 | if test "$linux_aio" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 4151 | feature_not_found "linux AIO" "Install libaio devel" |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4152 | fi |
Luiz Capitulino | 3cfcae3 | 2009-08-31 13:18:12 -0300 | [diff] [blame] | 4153 | linux_aio=no |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4154 | fi |
| 4155 | fi |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 4156 | ########################################## |
| 4157 | # linux-io-uring probe |
| 4158 | |
| 4159 | if test "$linux_io_uring" != "no" ; then |
| 4160 | if $pkg_config liburing; then |
| 4161 | linux_io_uring_cflags=$($pkg_config --cflags liburing) |
| 4162 | linux_io_uring_libs=$($pkg_config --libs liburing) |
| 4163 | linux_io_uring=yes |
Stefan Hajnoczi | 73fd282 | 2020-03-05 17:08:04 +0000 | [diff] [blame] | 4164 | |
| 4165 | # io_uring is used in libqemuutil.a where per-file -libs variables are not |
| 4166 | # seen by programs linking the archive. It's not ideal, but just add the |
| 4167 | # library dependency globally. |
| 4168 | LIBS="$linux_io_uring_libs $LIBS" |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 4169 | else |
| 4170 | if test "$linux_io_uring" = "yes" ; then |
| 4171 | feature_not_found "linux io_uring" "Install liburing devel" |
| 4172 | fi |
| 4173 | linux_io_uring=no |
| 4174 | fi |
| 4175 | fi |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 4176 | |
| 4177 | ########################################## |
Paolo Bonzini | 7aaa6a1 | 2019-01-23 14:56:07 +0800 | [diff] [blame] | 4178 | # TPM emulation is only on POSIX |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 4179 | |
Paolo Bonzini | 7aaa6a1 | 2019-01-23 14:56:07 +0800 | [diff] [blame] | 4180 | if test "$tpm" = ""; then |
| 4181 | if test "$mingw32" = "yes"; then |
| 4182 | tpm=no |
| 4183 | else |
| 4184 | tpm=yes |
| 4185 | fi |
| 4186 | elif test "$tpm" = "yes"; then |
| 4187 | if test "$mingw32" = "yes" ; then |
| 4188 | error_exit "TPM emulation only available on POSIX systems" |
| 4189 | fi |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 4190 | fi |
| 4191 | |
| 4192 | ########################################## |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4193 | # attr probe |
| 4194 | |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 4195 | libattr_libs= |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4196 | if test "$attr" != "no" ; then |
| 4197 | cat > $TMPC <<EOF |
| 4198 | #include <stdio.h> |
| 4199 | #include <sys/types.h> |
Pavel Borzenkov | f2338fb | 2011-11-11 00:26:59 +0400 | [diff] [blame] | 4200 | #ifdef CONFIG_LIBATTR |
| 4201 | #include <attr/xattr.h> |
| 4202 | #else |
Avi Kivity | 4f26f2b | 2011-11-09 14:44:52 +0200 | [diff] [blame] | 4203 | #include <sys/xattr.h> |
Pavel Borzenkov | f2338fb | 2011-11-11 00:26:59 +0400 | [diff] [blame] | 4204 | #endif |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4205 | int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } |
| 4206 | EOF |
Avi Kivity | 4f26f2b | 2011-11-09 14:44:52 +0200 | [diff] [blame] | 4207 | if compile_prog "" "" ; then |
| 4208 | attr=yes |
| 4209 | # Older distros have <attr/xattr.h>, and need -lattr: |
Pavel Borzenkov | f2338fb | 2011-11-11 00:26:59 +0400 | [diff] [blame] | 4210 | elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4211 | attr=yes |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 4212 | libattr_libs="-lattr" |
| 4213 | LIBS="$libattr_libs $LIBS" |
Avi Kivity | 4f26f2b | 2011-11-09 14:44:52 +0200 | [diff] [blame] | 4214 | libattr=yes |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4215 | else |
| 4216 | if test "$attr" = "yes" ; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 4217 | feature_not_found "ATTR" "Install libc6 or libattr devel" |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 4218 | fi |
| 4219 | attr=no |
| 4220 | fi |
| 4221 | fi |
| 4222 | |
| 4223 | ########################################## |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 4224 | # iovec probe |
| 4225 | cat > $TMPC <<EOF |
blueswir1 | db34f0b | 2009-01-14 18:03:53 +0000 | [diff] [blame] | 4226 | #include <sys/types.h> |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 4227 | #include <sys/uio.h> |
blueswir1 | db34f0b | 2009-01-14 18:03:53 +0000 | [diff] [blame] | 4228 | #include <unistd.h> |
Stefan Weil | f91f9be | 2011-12-17 09:27:33 +0100 | [diff] [blame] | 4229 | int main(void) { return sizeof(struct iovec); } |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 4230 | EOF |
| 4231 | iovec=no |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4232 | if compile_prog "" "" ; then |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 4233 | iovec=yes |
| 4234 | fi |
| 4235 | |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 4236 | ########################################## |
aliguori | ceb42de | 2009-04-07 18:43:28 +0000 | [diff] [blame] | 4237 | # preadv probe |
| 4238 | cat > $TMPC <<EOF |
| 4239 | #include <sys/types.h> |
| 4240 | #include <sys/uio.h> |
| 4241 | #include <unistd.h> |
Blue Swirl | c075a72 | 2012-08-09 20:21:25 +0000 | [diff] [blame] | 4242 | int main(void) { return preadv(0, 0, 0, 0); } |
aliguori | ceb42de | 2009-04-07 18:43:28 +0000 | [diff] [blame] | 4243 | EOF |
| 4244 | preadv=no |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4245 | if compile_prog "" "" ; then |
aliguori | ceb42de | 2009-04-07 18:43:28 +0000 | [diff] [blame] | 4246 | preadv=yes |
| 4247 | fi |
| 4248 | |
| 4249 | ########################################## |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 4250 | # fdt probe |
Peter Maydell | e169e1e | 2013-05-24 16:26:54 +0100 | [diff] [blame] | 4251 | # fdt support is mandatory for at least some target architectures, |
| 4252 | # so insist on it if we're building those system emulators. |
| 4253 | fdt_required=no |
| 4254 | for target in $target_list; do |
| 4255 | case $target in |
Yoshinori Sato | c8c35e5 | 2019-01-21 05:18:59 -0800 | [diff] [blame] | 4256 | aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu|rx-softmmu) |
Peter Maydell | e169e1e | 2013-05-24 16:26:54 +0100 | [diff] [blame] | 4257 | fdt_required=yes |
| 4258 | ;; |
| 4259 | esac |
| 4260 | done |
| 4261 | |
| 4262 | if test "$fdt_required" = "yes"; then |
| 4263 | if test "$fdt" = "no"; then |
| 4264 | error_exit "fdt disabled but some requested targets require it." \ |
| 4265 | "You can turn off fdt only if you also disable all the system emulation" \ |
| 4266 | "targets which need it (by specifying a cut down --target-list)." |
| 4267 | fi |
| 4268 | fdt=yes |
Philippe Mathieu-Daudé | 7ba4a4d | 2020-01-18 15:06:14 +0100 | [diff] [blame] | 4269 | elif test "$fdt" != "yes" ; then |
| 4270 | fdt=no |
Peter Maydell | e169e1e | 2013-05-24 16:26:54 +0100 | [diff] [blame] | 4271 | fi |
| 4272 | |
Laurent Vivier | d599938 | 2019-06-21 15:05:44 +0200 | [diff] [blame] | 4273 | # fdt is only required when building softmmu targets |
| 4274 | if test -z "$fdt" -a "$softmmu" != "yes" ; then |
| 4275 | fdt="no" |
| 4276 | fi |
| 4277 | |
Juan Quintela | 2df87df | 2009-08-12 18:29:54 +0200 | [diff] [blame] | 4278 | if test "$fdt" != "no" ; then |
Juan Quintela | b41af4b | 2009-07-27 16:13:20 +0200 | [diff] [blame] | 4279 | fdt_libs="-lfdt" |
Peter Crosthwaite | 96ce654 | 2013-05-27 14:20:57 +1000 | [diff] [blame] | 4280 | # explicitly check for libfdt_env.h as it is missing in some stable installs |
Paul Burton | 6e85fce | 2016-09-08 15:51:55 +0100 | [diff] [blame] | 4281 | # and test for required functions to make sure we are on a version >= 1.4.2 |
Juan Quintela | b41af4b | 2009-07-27 16:13:20 +0200 | [diff] [blame] | 4282 | cat > $TMPC << EOF |
Thomas Huth | 31ce0ad | 2015-05-18 12:59:49 +0200 | [diff] [blame] | 4283 | #include <libfdt.h> |
Peter Crosthwaite | 96ce654 | 2013-05-27 14:20:57 +1000 | [diff] [blame] | 4284 | #include <libfdt_env.h> |
Alexey Kardashevskiy | fea35ca | 2018-12-21 01:34:48 +0100 | [diff] [blame] | 4285 | int main(void) { fdt_check_full(NULL, 0); return 0; } |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 4286 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4287 | if compile_prog "" "$fdt_libs" ; then |
Peter Crosthwaite | a540f15 | 2013-04-18 14:47:31 +1000 | [diff] [blame] | 4288 | # system DTC is good - use it |
Philippe Mathieu-Daudé | e3971d6 | 2018-04-15 20:05:20 -0300 | [diff] [blame] | 4289 | fdt=system |
Peter Crosthwaite | a540f15 | 2013-04-18 14:47:31 +1000 | [diff] [blame] | 4290 | else |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 4291 | # have GIT checkout, so activate dtc submodule |
| 4292 | if test -e "${source_path}/.git" ; then |
| 4293 | git_submodules="${git_submodules} dtc" |
| 4294 | fi |
| 4295 | if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then |
Philippe Mathieu-Daudé | e3971d6 | 2018-04-15 20:05:20 -0300 | [diff] [blame] | 4296 | fdt=git |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 4297 | mkdir -p dtc |
| 4298 | if [ "$pwd_is_source_path" != "y" ] ; then |
| 4299 | symlink "$source_path/dtc/Makefile" "dtc/Makefile" |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 4300 | fi |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 4301 | fdt_cflags="-I${source_path}/dtc/libfdt" |
| 4302 | fdt_ldflags="-L$PWD/dtc/libfdt" |
Philippe Mathieu-Daudé | 8a99e9a | 2018-04-15 20:05:19 -0300 | [diff] [blame] | 4303 | fdt_libs="$fdt_libs" |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 4304 | elif test "$fdt" = "yes" ; then |
| 4305 | # Not a git build & no libfdt found, prompt for system install |
| 4306 | error_exit "DTC (libfdt) version >= 1.4.2 not present." \ |
| 4307 | "Please install the DTC (libfdt) devel package" |
| 4308 | else |
| 4309 | # don't have and don't want |
| 4310 | fdt_libs= |
| 4311 | fdt=no |
| 4312 | fi |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 4313 | fi |
| 4314 | fi |
| 4315 | |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 4316 | ########################################## |
OGAWA Hirofumi | fb71956 | 2015-10-27 02:45:48 +0900 | [diff] [blame] | 4317 | # opengl probe (for sdl2, gtk, milkymist-tmu2) |
Gerd Hoffmann | b1546f3 | 2015-03-16 10:03:53 +0100 | [diff] [blame] | 4318 | |
Marc-André Lureau | d52c454 | 2019-05-24 15:09:42 +0200 | [diff] [blame] | 4319 | gbm="no" |
| 4320 | if $pkg_config gbm; then |
| 4321 | gbm_cflags="$($pkg_config --cflags gbm)" |
| 4322 | gbm_libs="$($pkg_config --libs gbm)" |
| 4323 | gbm="yes" |
| 4324 | fi |
| 4325 | |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 4326 | if test "$opengl" != "no" ; then |
Michael Tokarev | 4939a1d | 2018-06-30 19:54:48 +0300 | [diff] [blame] | 4327 | opengl_pkgs="epoxy gbm" |
Gerd Hoffmann | 5f9b1e3 | 2018-03-01 11:05:43 +0100 | [diff] [blame] | 4328 | if $pkg_config $opengl_pkgs; then |
| 4329 | opengl_cflags="$($pkg_config --cflags $opengl_pkgs)" |
| 4330 | opengl_libs="$($pkg_config --libs $opengl_pkgs)" |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 4331 | opengl=yes |
Gerd Hoffmann | 925a040 | 2015-05-26 12:26:21 +0200 | [diff] [blame] | 4332 | if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then |
| 4333 | gtk_gl="yes" |
| 4334 | fi |
Gerd Hoffmann | cc720a5 | 2017-03-21 08:04:48 +0100 | [diff] [blame] | 4335 | QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 4336 | else |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 4337 | if test "$opengl" = "yes" ; then |
Gerd Hoffmann | dcf3002 | 2015-05-11 12:24:43 +0200 | [diff] [blame] | 4338 | feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 4339 | fi |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 4340 | opengl_cflags="" |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 4341 | opengl_libs="" |
| 4342 | opengl=no |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 4343 | fi |
| 4344 | fi |
| 4345 | |
Gerd Hoffmann | 014cb15 | 2015-12-03 12:56:34 +0100 | [diff] [blame] | 4346 | if test "$opengl" = "yes"; then |
| 4347 | cat > $TMPC << EOF |
| 4348 | #include <epoxy/egl.h> |
| 4349 | #ifndef EGL_MESA_image_dma_buf_export |
| 4350 | # error mesa/epoxy lacks support for dmabufs (mesa 10.6+) |
| 4351 | #endif |
| 4352 | int main(void) { return 0; } |
| 4353 | EOF |
| 4354 | if compile_prog "" "" ; then |
| 4355 | opengl_dmabuf=yes |
| 4356 | fi |
| 4357 | fi |
Chrysostomos Nanakos | c9a12e7 | 2014-08-04 17:35:32 +0300 | [diff] [blame] | 4358 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 4359 | if test "$opengl" = "yes" && test "$have_x11" = "yes"; then |
Philippe Mathieu-Daudé | 99e1a93 | 2019-01-30 13:00:03 +0100 | [diff] [blame] | 4360 | for target in $target_list; do |
| 4361 | case $target in |
| 4362 | lm32-softmmu) # milkymist-tmu2 requires X11 and OpenGL |
| 4363 | need_x11=yes |
| 4364 | ;; |
| 4365 | esac |
| 4366 | done |
| 4367 | fi |
| 4368 | |
Klim Kireev | ed279a0 | 2018-01-12 12:01:19 +0300 | [diff] [blame] | 4369 | ########################################## |
| 4370 | # libxml2 probe |
| 4371 | if test "$libxml2" != "no" ; then |
| 4372 | if $pkg_config --exists libxml-2.0; then |
| 4373 | libxml2="yes" |
| 4374 | libxml2_cflags=$($pkg_config --cflags libxml-2.0) |
| 4375 | libxml2_libs=$($pkg_config --libs libxml-2.0) |
| 4376 | else |
| 4377 | if test "$libxml2" = "yes"; then |
| 4378 | feature_not_found "libxml2" "Install libxml2 devel" |
| 4379 | fi |
| 4380 | libxml2="no" |
| 4381 | fi |
| 4382 | fi |
Chrysostomos Nanakos | c9a12e7 | 2014-08-04 17:35:32 +0300 | [diff] [blame] | 4383 | |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 4384 | ########################################## |
| 4385 | # glusterfs probe |
| 4386 | if test "$glusterfs" != "no" ; then |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 4387 | if $pkg_config --atleast-version=3 glusterfs-api; then |
Bharata B Rao | e01bee0 | 2013-07-16 21:47:41 +0530 | [diff] [blame] | 4388 | glusterfs="yes" |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 4389 | glusterfs_cflags=$($pkg_config --cflags glusterfs-api) |
| 4390 | glusterfs_libs=$($pkg_config --libs glusterfs-api) |
Jeff Cody | d85fa9e | 2016-04-05 10:40:09 -0400 | [diff] [blame] | 4391 | if $pkg_config --atleast-version=4 glusterfs-api; then |
| 4392 | glusterfs_xlator_opt="yes" |
| 4393 | fi |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 4394 | if $pkg_config --atleast-version=5 glusterfs-api; then |
Bharata B Rao | 0c14fb4 | 2013-07-16 21:47:42 +0530 | [diff] [blame] | 4395 | glusterfs_discard="yes" |
| 4396 | fi |
Bharata B Rao | 7c81537 | 2013-12-21 14:51:25 +0530 | [diff] [blame] | 4397 | if $pkg_config --atleast-version=6 glusterfs-api; then |
Niels de Vos | df3a429 | 2017-05-28 12:01:14 +0530 | [diff] [blame] | 4398 | glusterfs_fallocate="yes" |
Bharata B Rao | 7c81537 | 2013-12-21 14:51:25 +0530 | [diff] [blame] | 4399 | glusterfs_zerofill="yes" |
| 4400 | fi |
Prasanna Kumar Kalever | e014dbe | 2019-03-05 16:46:33 +0100 | [diff] [blame] | 4401 | cat > $TMPC << EOF |
| 4402 | #include <glusterfs/api/glfs.h> |
| 4403 | |
| 4404 | int |
| 4405 | main(void) |
| 4406 | { |
| 4407 | /* new glfs_ftruncate() passes two additional args */ |
| 4408 | return glfs_ftruncate(NULL, 0, NULL, NULL); |
| 4409 | } |
| 4410 | EOF |
| 4411 | if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then |
| 4412 | glusterfs_ftruncate_has_stat="yes" |
| 4413 | fi |
Niels de Vos | 0e3b891 | 2019-03-05 16:46:34 +0100 | [diff] [blame] | 4414 | cat > $TMPC << EOF |
| 4415 | #include <glusterfs/api/glfs.h> |
| 4416 | |
| 4417 | /* new glfs_io_cbk() passes two additional glfs_stat structs */ |
| 4418 | static void |
| 4419 | glusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data) |
| 4420 | {} |
| 4421 | |
| 4422 | int |
| 4423 | main(void) |
| 4424 | { |
| 4425 | glfs_io_cbk iocb = &glusterfs_iocb; |
| 4426 | iocb(NULL, 0 , NULL, NULL, NULL); |
| 4427 | return 0; |
| 4428 | } |
| 4429 | EOF |
| 4430 | if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then |
| 4431 | glusterfs_iocb_has_stat="yes" |
| 4432 | fi |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 4433 | else |
| 4434 | if test "$glusterfs" = "yes" ; then |
Hu Tao | 8efc936 | 2014-06-26 17:34:50 +0800 | [diff] [blame] | 4435 | feature_not_found "GlusterFS backend support" \ |
| 4436 | "Install glusterfs-api devel >= 3" |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 4437 | fi |
Bharata B Rao | e01bee0 | 2013-07-16 21:47:41 +0530 | [diff] [blame] | 4438 | glusterfs="no" |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 4439 | fi |
| 4440 | fi |
| 4441 | |
aurel32 | 39386ac | 2009-04-15 19:48:17 +0000 | [diff] [blame] | 4442 | # Check for inotify functions when we are building linux-user |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 4443 | # emulator. This is done because older glibc versions don't |
| 4444 | # have syscall stubs for these implemented. In that case we |
| 4445 | # don't provide them even if kernel supports them. |
| 4446 | # |
| 4447 | inotify=no |
Riku Voipio | 67ba57f | 2009-06-29 17:26:11 +0300 | [diff] [blame] | 4448 | cat > $TMPC << EOF |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 4449 | #include <sys/inotify.h> |
| 4450 | |
| 4451 | int |
| 4452 | main(void) |
| 4453 | { |
| 4454 | /* try to start inotify */ |
aurel32 | 8690e42 | 2009-04-17 13:50:32 +0000 | [diff] [blame] | 4455 | return inotify_init(); |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 4456 | } |
| 4457 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4458 | if compile_prog "" "" ; then |
Riku Voipio | 67ba57f | 2009-06-29 17:26:11 +0300 | [diff] [blame] | 4459 | inotify=yes |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 4460 | fi |
| 4461 | |
Riku Voipio | c05c7a7 | 2010-03-26 15:25:11 +0000 | [diff] [blame] | 4462 | inotify1=no |
| 4463 | cat > $TMPC << EOF |
| 4464 | #include <sys/inotify.h> |
| 4465 | |
| 4466 | int |
| 4467 | main(void) |
| 4468 | { |
| 4469 | /* try to start inotify */ |
| 4470 | return inotify_init1(0); |
| 4471 | } |
| 4472 | EOF |
| 4473 | if compile_prog "" "" ; then |
| 4474 | inotify1=yes |
| 4475 | fi |
| 4476 | |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 4477 | # check if pipe2 is there |
| 4478 | pipe2=no |
| 4479 | cat > $TMPC << EOF |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 4480 | #include <unistd.h> |
| 4481 | #include <fcntl.h> |
| 4482 | |
| 4483 | int main(void) |
| 4484 | { |
| 4485 | int pipefd[2]; |
Bruce Rogers | 9bca816 | 2012-08-20 12:45:08 -0600 | [diff] [blame] | 4486 | return pipe2(pipefd, O_CLOEXEC); |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 4487 | } |
| 4488 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4489 | if compile_prog "" "" ; then |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 4490 | pipe2=yes |
| 4491 | fi |
| 4492 | |
Kevin Wolf | 40ff6d7 | 2009-12-02 12:24:42 +0100 | [diff] [blame] | 4493 | # check if accept4 is there |
| 4494 | accept4=no |
| 4495 | cat > $TMPC << EOF |
Kevin Wolf | 40ff6d7 | 2009-12-02 12:24:42 +0100 | [diff] [blame] | 4496 | #include <sys/socket.h> |
| 4497 | #include <stddef.h> |
| 4498 | |
| 4499 | int main(void) |
| 4500 | { |
| 4501 | accept4(0, NULL, NULL, SOCK_CLOEXEC); |
| 4502 | return 0; |
| 4503 | } |
| 4504 | EOF |
| 4505 | if compile_prog "" "" ; then |
| 4506 | accept4=yes |
| 4507 | fi |
| 4508 | |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 4509 | # check if tee/splice is there. vmsplice was added same time. |
| 4510 | splice=no |
| 4511 | cat > $TMPC << EOF |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 4512 | #include <unistd.h> |
| 4513 | #include <fcntl.h> |
| 4514 | #include <limits.h> |
| 4515 | |
| 4516 | int main(void) |
| 4517 | { |
Stefan Weil | 66ea0f2 | 2011-12-17 09:27:35 +0100 | [diff] [blame] | 4518 | int len, fd = 0; |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 4519 | len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); |
| 4520 | splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); |
| 4521 | return 0; |
| 4522 | } |
| 4523 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 4524 | if compile_prog "" "" ; then |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 4525 | splice=yes |
| 4526 | fi |
| 4527 | |
Marcelo Tosatti | dcc38d1 | 2010-10-11 15:31:15 -0300 | [diff] [blame] | 4528 | ########################################## |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 4529 | # libnuma probe |
| 4530 | |
| 4531 | if test "$numa" != "no" ; then |
| 4532 | cat > $TMPC << EOF |
| 4533 | #include <numa.h> |
| 4534 | int main(void) { return numa_available(); } |
| 4535 | EOF |
| 4536 | |
| 4537 | if compile_prog "" "-lnuma" ; then |
| 4538 | numa=yes |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 4539 | numa_libs="-lnuma" |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 4540 | else |
| 4541 | if test "$numa" = "yes" ; then |
| 4542 | feature_not_found "numa" "install numactl devel" |
| 4543 | fi |
| 4544 | numa=no |
| 4545 | fi |
| 4546 | fi |
| 4547 | |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 4548 | if test "$tcmalloc" = "yes" && test "$jemalloc" = "yes" ; then |
| 4549 | echo "ERROR: tcmalloc && jemalloc can't be used at the same time" |
| 4550 | exit 1 |
| 4551 | fi |
| 4552 | |
Yang Zhong | 5a22ab7 | 2017-12-20 21:16:46 +0800 | [diff] [blame] | 4553 | # Even if malloc_trim() is available, these non-libc memory allocators |
| 4554 | # do not support it. |
| 4555 | if test "$tcmalloc" = "yes" || test "$jemalloc" = "yes" ; then |
| 4556 | if test "$malloc_trim" = "yes" ; then |
| 4557 | echo "Disabling malloc_trim with non-libc memory allocator" |
| 4558 | fi |
| 4559 | malloc_trim="no" |
| 4560 | fi |
| 4561 | |
| 4562 | ####################################### |
| 4563 | # malloc_trim |
| 4564 | |
| 4565 | if test "$malloc_trim" != "no" ; then |
| 4566 | cat > $TMPC << EOF |
| 4567 | #include <malloc.h> |
| 4568 | int main(void) { malloc_trim(0); return 0; } |
| 4569 | EOF |
| 4570 | if compile_prog "" "" ; then |
| 4571 | malloc_trim="yes" |
| 4572 | else |
| 4573 | malloc_trim="no" |
| 4574 | fi |
| 4575 | fi |
| 4576 | |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 4577 | ########################################## |
Fam Zheng | 2847b46 | 2015-03-26 11:03:12 +0800 | [diff] [blame] | 4578 | # tcmalloc probe |
| 4579 | |
| 4580 | if test "$tcmalloc" = "yes" ; then |
| 4581 | cat > $TMPC << EOF |
| 4582 | #include <stdlib.h> |
Leonid Bloch | f2dfe54 | 2020-05-25 01:12:04 +0300 | [diff] [blame] | 4583 | int main(void) { |
| 4584 | void *tmp = malloc(1); |
| 4585 | if (tmp != NULL) { |
| 4586 | return 0; |
| 4587 | } |
| 4588 | return 1; |
| 4589 | } |
Fam Zheng | 2847b46 | 2015-03-26 11:03:12 +0800 | [diff] [blame] | 4590 | EOF |
| 4591 | |
| 4592 | if compile_prog "" "-ltcmalloc" ; then |
| 4593 | LIBS="-ltcmalloc $LIBS" |
| 4594 | else |
| 4595 | feature_not_found "tcmalloc" "install gperftools devel" |
| 4596 | fi |
| 4597 | fi |
| 4598 | |
| 4599 | ########################################## |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 4600 | # jemalloc probe |
| 4601 | |
| 4602 | if test "$jemalloc" = "yes" ; then |
| 4603 | cat > $TMPC << EOF |
| 4604 | #include <stdlib.h> |
Leonid Bloch | f2dfe54 | 2020-05-25 01:12:04 +0300 | [diff] [blame] | 4605 | int main(void) { |
| 4606 | void *tmp = malloc(1); |
| 4607 | if (tmp != NULL) { |
| 4608 | return 0; |
| 4609 | } |
| 4610 | return 1; |
| 4611 | } |
Alexandre Derumier | 7b01cb9 | 2015-06-19 12:56:58 +0200 | [diff] [blame] | 4612 | EOF |
| 4613 | |
| 4614 | if compile_prog "" "-ljemalloc" ; then |
| 4615 | LIBS="-ljemalloc $LIBS" |
| 4616 | else |
| 4617 | feature_not_found "jemalloc" "install jemalloc devel" |
| 4618 | fi |
| 4619 | fi |
| 4620 | |
| 4621 | ########################################## |
Marcelo Tosatti | dcc38d1 | 2010-10-11 15:31:15 -0300 | [diff] [blame] | 4622 | # signalfd probe |
| 4623 | signalfd="no" |
| 4624 | cat > $TMPC << EOF |
Marcelo Tosatti | dcc38d1 | 2010-10-11 15:31:15 -0300 | [diff] [blame] | 4625 | #include <unistd.h> |
| 4626 | #include <sys/syscall.h> |
| 4627 | #include <signal.h> |
| 4628 | int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } |
| 4629 | EOF |
| 4630 | |
| 4631 | if compile_prog "" "" ; then |
| 4632 | signalfd=yes |
| 4633 | fi |
| 4634 | |
Richard W.M. Jones | d339d76 | 2019-01-18 10:11:14 +0000 | [diff] [blame] | 4635 | # check if optreset global is declared by <getopt.h> |
| 4636 | optreset="no" |
| 4637 | cat > $TMPC << EOF |
| 4638 | #include <getopt.h> |
| 4639 | int main(void) { return optreset; } |
| 4640 | EOF |
| 4641 | |
| 4642 | if compile_prog "" "" ; then |
| 4643 | optreset=yes |
| 4644 | fi |
| 4645 | |
Riku Voipio | c2882b9 | 2009-08-12 15:08:24 +0300 | [diff] [blame] | 4646 | # check if eventfd is supported |
| 4647 | eventfd=no |
| 4648 | cat > $TMPC << EOF |
| 4649 | #include <sys/eventfd.h> |
| 4650 | |
| 4651 | int main(void) |
| 4652 | { |
Stefan Weil | 55cc7f3 | 2011-12-17 09:27:37 +0100 | [diff] [blame] | 4653 | return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); |
Riku Voipio | c2882b9 | 2009-08-12 15:08:24 +0300 | [diff] [blame] | 4654 | } |
| 4655 | EOF |
| 4656 | if compile_prog "" "" ; then |
| 4657 | eventfd=yes |
| 4658 | fi |
| 4659 | |
Marc-André Lureau | 751bcc3 | 2015-10-09 17:17:16 +0200 | [diff] [blame] | 4660 | # check if memfd is supported |
| 4661 | memfd=no |
| 4662 | cat > $TMPC << EOF |
Paolo Bonzini | 75e5b70 | 2017-11-28 11:51:27 +0100 | [diff] [blame] | 4663 | #include <sys/mman.h> |
Marc-André Lureau | 751bcc3 | 2015-10-09 17:17:16 +0200 | [diff] [blame] | 4664 | |
| 4665 | int main(void) |
| 4666 | { |
| 4667 | return memfd_create("foo", MFD_ALLOW_SEALING); |
| 4668 | } |
| 4669 | EOF |
| 4670 | if compile_prog "" "" ; then |
| 4671 | memfd=yes |
| 4672 | fi |
| 4673 | |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 4674 | # check for usbfs |
| 4675 | have_usbfs=no |
| 4676 | if test "$linux_user" = "yes"; then |
Thomas Petazzoni | 96566d0 | 2019-02-13 22:18:27 +0100 | [diff] [blame] | 4677 | cat > $TMPC << EOF |
| 4678 | #include <linux/usbdevice_fs.h> |
| 4679 | |
| 4680 | #ifndef USBDEVFS_GET_CAPABILITIES |
| 4681 | #error "USBDEVFS_GET_CAPABILITIES undefined" |
| 4682 | #endif |
| 4683 | |
| 4684 | #ifndef USBDEVFS_DISCONNECT_CLAIM |
| 4685 | #error "USBDEVFS_DISCONNECT_CLAIM undefined" |
| 4686 | #endif |
| 4687 | |
| 4688 | int main(void) |
| 4689 | { |
| 4690 | return 0; |
| 4691 | } |
| 4692 | EOF |
| 4693 | if compile_prog "" ""; then |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 4694 | have_usbfs=yes |
| 4695 | fi |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 4696 | fi |
Marc-André Lureau | 751bcc3 | 2015-10-09 17:17:16 +0200 | [diff] [blame] | 4697 | |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 4698 | # check for fallocate |
| 4699 | fallocate=no |
| 4700 | cat > $TMPC << EOF |
| 4701 | #include <fcntl.h> |
| 4702 | |
| 4703 | int main(void) |
| 4704 | { |
| 4705 | fallocate(0, 0, 0, 0); |
| 4706 | return 0; |
| 4707 | } |
| 4708 | EOF |
Peter Maydell | 8fb0315 | 2012-04-04 17:03:15 +0100 | [diff] [blame] | 4709 | if compile_prog "" "" ; then |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 4710 | fallocate=yes |
| 4711 | fi |
| 4712 | |
Kusanagi Kouichi | 3d4fa43 | 2013-01-14 16:26:52 +0100 | [diff] [blame] | 4713 | # check for fallocate hole punching |
| 4714 | fallocate_punch_hole=no |
| 4715 | cat > $TMPC << EOF |
| 4716 | #include <fcntl.h> |
| 4717 | #include <linux/falloc.h> |
| 4718 | |
| 4719 | int main(void) |
| 4720 | { |
| 4721 | fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); |
| 4722 | return 0; |
| 4723 | } |
| 4724 | EOF |
| 4725 | if compile_prog "" "" ; then |
| 4726 | fallocate_punch_hole=yes |
| 4727 | fi |
| 4728 | |
Denis V. Lunev | b953f07 | 2015-01-30 11:42:14 +0300 | [diff] [blame] | 4729 | # check that fallocate supports range zeroing inside the file |
| 4730 | fallocate_zero_range=no |
| 4731 | cat > $TMPC << EOF |
| 4732 | #include <fcntl.h> |
| 4733 | #include <linux/falloc.h> |
| 4734 | |
| 4735 | int main(void) |
| 4736 | { |
| 4737 | fallocate(0, FALLOC_FL_ZERO_RANGE, 0, 0); |
| 4738 | return 0; |
| 4739 | } |
| 4740 | EOF |
| 4741 | if compile_prog "" "" ; then |
| 4742 | fallocate_zero_range=yes |
| 4743 | fi |
| 4744 | |
Kevin Wolf | ed91143 | 2014-09-29 17:12:59 +0200 | [diff] [blame] | 4745 | # check for posix_fallocate |
| 4746 | posix_fallocate=no |
| 4747 | cat > $TMPC << EOF |
| 4748 | #include <fcntl.h> |
| 4749 | |
| 4750 | int main(void) |
| 4751 | { |
| 4752 | posix_fallocate(0, 0, 0); |
| 4753 | return 0; |
| 4754 | } |
| 4755 | EOF |
| 4756 | if compile_prog "" "" ; then |
| 4757 | posix_fallocate=yes |
| 4758 | fi |
| 4759 | |
Peter Maydell | c727f47 | 2011-01-06 11:05:10 +0000 | [diff] [blame] | 4760 | # check for sync_file_range |
| 4761 | sync_file_range=no |
| 4762 | cat > $TMPC << EOF |
| 4763 | #include <fcntl.h> |
| 4764 | |
| 4765 | int main(void) |
| 4766 | { |
| 4767 | sync_file_range(0, 0, 0, 0); |
| 4768 | return 0; |
| 4769 | } |
| 4770 | EOF |
Peter Maydell | 8fb0315 | 2012-04-04 17:03:15 +0100 | [diff] [blame] | 4771 | if compile_prog "" "" ; then |
Peter Maydell | c727f47 | 2011-01-06 11:05:10 +0000 | [diff] [blame] | 4772 | sync_file_range=yes |
| 4773 | fi |
| 4774 | |
Peter Maydell | dace20d | 2011-01-10 13:11:24 +0000 | [diff] [blame] | 4775 | # check for linux/fiemap.h and FS_IOC_FIEMAP |
| 4776 | fiemap=no |
| 4777 | cat > $TMPC << EOF |
| 4778 | #include <sys/ioctl.h> |
| 4779 | #include <linux/fs.h> |
| 4780 | #include <linux/fiemap.h> |
| 4781 | |
| 4782 | int main(void) |
| 4783 | { |
| 4784 | ioctl(0, FS_IOC_FIEMAP, 0); |
| 4785 | return 0; |
| 4786 | } |
| 4787 | EOF |
Peter Maydell | 8fb0315 | 2012-04-04 17:03:15 +0100 | [diff] [blame] | 4788 | if compile_prog "" "" ; then |
Peter Maydell | dace20d | 2011-01-10 13:11:24 +0000 | [diff] [blame] | 4789 | fiemap=yes |
| 4790 | fi |
| 4791 | |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 4792 | # check for dup3 |
| 4793 | dup3=no |
| 4794 | cat > $TMPC << EOF |
| 4795 | #include <unistd.h> |
| 4796 | |
| 4797 | int main(void) |
| 4798 | { |
| 4799 | dup3(0, 0, 0); |
| 4800 | return 0; |
| 4801 | } |
| 4802 | EOF |
Jan Kiszka | 78f5d72 | 2009-11-03 10:54:44 +0100 | [diff] [blame] | 4803 | if compile_prog "" "" ; then |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 4804 | dup3=yes |
| 4805 | fi |
| 4806 | |
Alex Bligh | 4e0c652 | 2013-08-21 16:02:43 +0100 | [diff] [blame] | 4807 | # check for ppoll support |
| 4808 | ppoll=no |
| 4809 | cat > $TMPC << EOF |
| 4810 | #include <poll.h> |
| 4811 | |
| 4812 | int main(void) |
| 4813 | { |
| 4814 | struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; |
| 4815 | ppoll(&pfd, 1, 0, 0); |
| 4816 | return 0; |
| 4817 | } |
| 4818 | EOF |
| 4819 | if compile_prog "" "" ; then |
| 4820 | ppoll=yes |
| 4821 | fi |
| 4822 | |
Alex Bligh | cd758dd | 2013-08-21 16:02:44 +0100 | [diff] [blame] | 4823 | # check for prctl(PR_SET_TIMERSLACK , ... ) support |
| 4824 | prctl_pr_set_timerslack=no |
| 4825 | cat > $TMPC << EOF |
| 4826 | #include <sys/prctl.h> |
| 4827 | |
| 4828 | int main(void) |
| 4829 | { |
| 4830 | prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); |
| 4831 | return 0; |
| 4832 | } |
| 4833 | EOF |
| 4834 | if compile_prog "" "" ; then |
| 4835 | prctl_pr_set_timerslack=yes |
| 4836 | fi |
| 4837 | |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 4838 | # check for epoll support |
| 4839 | epoll=no |
| 4840 | cat > $TMPC << EOF |
| 4841 | #include <sys/epoll.h> |
| 4842 | |
| 4843 | int main(void) |
| 4844 | { |
| 4845 | epoll_create(0); |
| 4846 | return 0; |
| 4847 | } |
| 4848 | EOF |
Peter Maydell | 8fb0315 | 2012-04-04 17:03:15 +0100 | [diff] [blame] | 4849 | if compile_prog "" "" ; then |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 4850 | epoll=yes |
| 4851 | fi |
| 4852 | |
Peter Maydell | 227f021 | 2016-06-06 19:58:11 +0100 | [diff] [blame] | 4853 | # epoll_create1 is a later addition |
| 4854 | # so we must check separately for its presence |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 4855 | epoll_create1=no |
| 4856 | cat > $TMPC << EOF |
| 4857 | #include <sys/epoll.h> |
| 4858 | |
| 4859 | int main(void) |
| 4860 | { |
Peter Maydell | 19e83f6 | 2011-04-26 16:56:40 +0100 | [diff] [blame] | 4861 | /* Note that we use epoll_create1 as a value, not as |
| 4862 | * a function being called. This is necessary so that on |
| 4863 | * old SPARC glibc versions where the function was present in |
| 4864 | * the library but not declared in the header file we will |
| 4865 | * fail the configure check. (Otherwise we will get a compiler |
| 4866 | * warning but not an error, and will proceed to fail the |
| 4867 | * qemu compile where we compile with -Werror.) |
| 4868 | */ |
Blue Swirl | c075a72 | 2012-08-09 20:21:25 +0000 | [diff] [blame] | 4869 | return (int)(uintptr_t)&epoll_create1; |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 4870 | } |
| 4871 | EOF |
Peter Maydell | 8fb0315 | 2012-04-04 17:03:15 +0100 | [diff] [blame] | 4872 | if compile_prog "" "" ; then |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 4873 | epoll_create1=yes |
| 4874 | fi |
| 4875 | |
Peter Maydell | a8fd1ab | 2013-02-08 07:31:55 +0000 | [diff] [blame] | 4876 | # check for sendfile support |
| 4877 | sendfile=no |
| 4878 | cat > $TMPC << EOF |
| 4879 | #include <sys/sendfile.h> |
| 4880 | |
| 4881 | int main(void) |
| 4882 | { |
| 4883 | return sendfile(0, 0, 0, 0); |
| 4884 | } |
| 4885 | EOF |
| 4886 | if compile_prog "" "" ; then |
| 4887 | sendfile=yes |
| 4888 | fi |
| 4889 | |
Riku Voipio | 5183434 | 2014-06-22 11:25:42 +0100 | [diff] [blame] | 4890 | # check for timerfd support (glibc 2.8 and newer) |
| 4891 | timerfd=no |
| 4892 | cat > $TMPC << EOF |
| 4893 | #include <sys/timerfd.h> |
| 4894 | |
| 4895 | int main(void) |
| 4896 | { |
| 4897 | return(timerfd_create(CLOCK_REALTIME, 0)); |
| 4898 | } |
| 4899 | EOF |
| 4900 | if compile_prog "" "" ; then |
| 4901 | timerfd=yes |
| 4902 | fi |
| 4903 | |
Riku Voipio | 9af5c90 | 2014-08-12 15:58:57 +0300 | [diff] [blame] | 4904 | # check for setns and unshare support |
| 4905 | setns=no |
| 4906 | cat > $TMPC << EOF |
| 4907 | #include <sched.h> |
| 4908 | |
| 4909 | int main(void) |
| 4910 | { |
| 4911 | int ret; |
| 4912 | ret = setns(0, 0); |
| 4913 | ret = unshare(0); |
| 4914 | return ret; |
| 4915 | } |
| 4916 | EOF |
| 4917 | if compile_prog "" "" ; then |
| 4918 | setns=yes |
| 4919 | fi |
| 4920 | |
Aleksandar Markovic | 38860a0 | 2016-10-10 13:23:29 +0200 | [diff] [blame] | 4921 | # clock_adjtime probe |
| 4922 | clock_adjtime=no |
| 4923 | cat > $TMPC <<EOF |
| 4924 | #include <time.h> |
| 4925 | |
| 4926 | int main(void) |
| 4927 | { |
| 4928 | return clock_adjtime(0, 0); |
| 4929 | } |
| 4930 | EOF |
| 4931 | clock_adjtime=no |
| 4932 | if compile_prog "" "" ; then |
| 4933 | clock_adjtime=yes |
| 4934 | fi |
| 4935 | |
Aleksandar Markovic | 5a03cd0 | 2016-10-10 13:23:30 +0200 | [diff] [blame] | 4936 | # syncfs probe |
| 4937 | syncfs=no |
| 4938 | cat > $TMPC <<EOF |
| 4939 | #include <unistd.h> |
| 4940 | |
| 4941 | int main(void) |
| 4942 | { |
| 4943 | return syncfs(0); |
| 4944 | } |
| 4945 | EOF |
| 4946 | syncfs=no |
| 4947 | if compile_prog "" "" ; then |
| 4948 | syncfs=yes |
| 4949 | fi |
| 4950 | |
Aleksandar Markovic | db37dd8 | 2020-01-16 23:49:49 +0100 | [diff] [blame] | 4951 | # check for kcov support (kernel must be 4.4+, compiled with certain options) |
| 4952 | kcov=no |
| 4953 | if check_include sys/kcov.h ; then |
| 4954 | kcov=yes |
| 4955 | fi |
| 4956 | |
Peter Maydell | 516e8b7 | 2020-04-11 19:29:32 +0100 | [diff] [blame] | 4957 | # If we're making warnings fatal, apply this to Sphinx runs as well |
| 4958 | sphinx_werror="" |
| 4959 | if test "$werror" = "yes"; then |
| 4960 | sphinx_werror="-W" |
| 4961 | fi |
| 4962 | |
Peter Maydell | 5f71eac | 2019-03-07 14:26:46 +0000 | [diff] [blame] | 4963 | # Check we have a new enough version of sphinx-build |
| 4964 | has_sphinx_build() { |
| 4965 | # This is a bit awkward but works: create a trivial document and |
| 4966 | # try to run it with our configuration file (which enforces a |
| 4967 | # version requirement). This will fail if either |
| 4968 | # sphinx-build doesn't exist at all or if it is too old. |
| 4969 | mkdir -p "$TMPDIR1/sphinx" |
| 4970 | touch "$TMPDIR1/sphinx/index.rst" |
Alex Bennée | 988ae6c | 2020-04-14 21:06:21 +0100 | [diff] [blame] | 4971 | "$sphinx_build" $sphinx_werror -c "$source_path/docs" \ |
| 4972 | -b html "$TMPDIR1/sphinx" \ |
| 4973 | "$TMPDIR1/sphinx/out" >> config.log 2>&1 |
Peter Maydell | 5f71eac | 2019-03-07 14:26:46 +0000 | [diff] [blame] | 4974 | } |
| 4975 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 4976 | # Check if tools are available to build documentation. |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 4977 | if test "$docs" != "no" ; then |
Peter Maydell | 758b617 | 2020-02-13 17:56:19 +0000 | [diff] [blame] | 4978 | if has_sphinx_build; then |
| 4979 | sphinx_ok=yes |
| 4980 | else |
| 4981 | sphinx_ok=no |
| 4982 | fi |
| 4983 | if has makeinfo && has pod2man && test "$sphinx_ok" = "yes"; then |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 4984 | docs=yes |
Juan Quintela | 83a3ab8 | 2009-08-12 18:29:51 +0200 | [diff] [blame] | 4985 | else |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 4986 | if test "$docs" = "yes" ; then |
Peter Maydell | 758b617 | 2020-02-13 17:56:19 +0000 | [diff] [blame] | 4987 | if has $sphinx_build && test "$sphinx_ok" != "yes"; then |
| 4988 | echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2 |
| 4989 | fi |
| 4990 | feature_not_found "docs" "Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx" |
Juan Quintela | 83a3ab8 | 2009-08-12 18:29:51 +0200 | [diff] [blame] | 4991 | fi |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 4992 | docs=no |
Juan Quintela | 83a3ab8 | 2009-08-12 18:29:51 +0200 | [diff] [blame] | 4993 | fi |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 4994 | fi |
| 4995 | |
Stefan Weil | f514f41 | 2009-10-11 12:44:07 +0200 | [diff] [blame] | 4996 | # Search for bswap_32 function |
Juan Quintela | 6ae9a1f | 2009-08-03 14:45:58 +0200 | [diff] [blame] | 4997 | byteswap_h=no |
| 4998 | cat > $TMPC << EOF |
| 4999 | #include <byteswap.h> |
| 5000 | int main(void) { return bswap_32(0); } |
| 5001 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 5002 | if compile_prog "" "" ; then |
Juan Quintela | 6ae9a1f | 2009-08-03 14:45:58 +0200 | [diff] [blame] | 5003 | byteswap_h=yes |
| 5004 | fi |
| 5005 | |
Stefan Weil | 75f1359 | 2013-01-05 12:17:38 +0100 | [diff] [blame] | 5006 | # Search for bswap32 function |
Juan Quintela | 6ae9a1f | 2009-08-03 14:45:58 +0200 | [diff] [blame] | 5007 | bswap_h=no |
| 5008 | cat > $TMPC << EOF |
| 5009 | #include <sys/endian.h> |
| 5010 | #include <sys/types.h> |
| 5011 | #include <machine/bswap.h> |
| 5012 | int main(void) { return bswap32(0); } |
| 5013 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 5014 | if compile_prog "" "" ; then |
Juan Quintela | 6ae9a1f | 2009-08-03 14:45:58 +0200 | [diff] [blame] | 5015 | bswap_h=yes |
| 5016 | fi |
| 5017 | |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 5018 | ########################################## |
Peter Lieven | e49ab19 | 2014-06-04 14:33:26 +0200 | [diff] [blame] | 5019 | # Do we have libiscsi >= 1.9.0 |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 5020 | if test "$libiscsi" != "no" ; then |
Peter Lieven | e49ab19 | 2014-06-04 14:33:26 +0200 | [diff] [blame] | 5021 | if $pkg_config --atleast-version=1.9.0 libiscsi; then |
Paolo Bonzini | 3c33ea9 | 2013-02-22 18:14:28 +0100 | [diff] [blame] | 5022 | libiscsi="yes" |
Stefan Weil | ca871ec | 2013-08-27 21:09:12 +0200 | [diff] [blame] | 5023 | libiscsi_cflags=$($pkg_config --cflags libiscsi) |
| 5024 | libiscsi_libs=$($pkg_config --libs libiscsi) |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 5025 | else |
| 5026 | if test "$libiscsi" = "yes" ; then |
Peter Lieven | e49ab19 | 2014-06-04 14:33:26 +0200 | [diff] [blame] | 5027 | feature_not_found "libiscsi" "Install libiscsi >= 1.9.0" |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 5028 | fi |
| 5029 | libiscsi="no" |
| 5030 | fi |
| 5031 | fi |
| 5032 | |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 5033 | ########################################## |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5034 | # Do we need libm |
| 5035 | cat > $TMPC << EOF |
| 5036 | #include <math.h> |
Alexey Kardashevskiy | f80ea98 | 2014-07-01 17:30:27 +1000 | [diff] [blame] | 5037 | int main(int argc, char **argv) { return isnan(sin((double)argc)); } |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5038 | EOF |
| 5039 | if compile_prog "" "" ; then |
| 5040 | : |
| 5041 | elif compile_prog "" "-lm" ; then |
| 5042 | LIBS="-lm $LIBS" |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5043 | else |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 5044 | error_exit "libm check failed" |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5045 | fi |
| 5046 | |
| 5047 | ########################################## |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 5048 | # Do we need librt |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5049 | # uClibc provides 2 versions of clock_gettime(), one with realtime |
| 5050 | # support and one without. This means that the clock_gettime() don't |
| 5051 | # need -lrt. We still need it for timer_create() so we check for this |
| 5052 | # function in addition. |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 5053 | cat > $TMPC <<EOF |
| 5054 | #include <signal.h> |
| 5055 | #include <time.h> |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5056 | int main(void) { |
| 5057 | timer_create(CLOCK_REALTIME, NULL, NULL); |
| 5058 | return clock_gettime(CLOCK_REALTIME, NULL); |
| 5059 | } |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 5060 | EOF |
| 5061 | |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 5062 | if compile_prog "" "" ; then |
Juan Quintela | 07ffa4b | 2009-08-03 14:46:17 +0200 | [diff] [blame] | 5063 | : |
Natanael Copa | 8bacde8 | 2012-09-12 09:06:51 +0000 | [diff] [blame] | 5064 | # we need pthread for static linking. use previous pthread test result |
Rick Liu | 18e588b | 2014-05-30 14:10:20 -0700 | [diff] [blame] | 5065 | elif compile_prog "" "$pthread_lib -lrt" ; then |
| 5066 | LIBS="$LIBS -lrt" |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 5067 | fi |
| 5068 | |
Thomas Huth | d99e97e | 2019-01-17 18:14:08 +0100 | [diff] [blame] | 5069 | # Check whether we need to link libutil for openpty() |
| 5070 | cat > $TMPC << EOF |
| 5071 | extern int openpty(int *am, int *as, char *name, void *termp, void *winp); |
| 5072 | int main(void) { return openpty(0, 0, 0, 0, 0); } |
| 5073 | EOF |
| 5074 | |
Thomas Huth | 9df8b20 | 2020-06-29 14:13:24 +0200 | [diff] [blame] | 5075 | have_openpty="no" |
| 5076 | if compile_prog "" "" ; then |
| 5077 | have_openpty="yes" |
| 5078 | else |
Thomas Huth | d99e97e | 2019-01-17 18:14:08 +0100 | [diff] [blame] | 5079 | if compile_prog "" "-lutil" ; then |
Thomas Huth | d99e97e | 2019-01-17 18:14:08 +0100 | [diff] [blame] | 5080 | libs_tools="-lutil $libs_tools" |
Thomas Huth | 9df8b20 | 2020-06-29 14:13:24 +0200 | [diff] [blame] | 5081 | have_openpty="yes" |
Thomas Huth | d99e97e | 2019-01-17 18:14:08 +0100 | [diff] [blame] | 5082 | fi |
Juan Quintela | 6362a53 | 2009-08-03 14:46:32 +0200 | [diff] [blame] | 5083 | fi |
| 5084 | |
Blue Swirl | de5071c | 2009-09-12 09:58:46 +0000 | [diff] [blame] | 5085 | ########################################## |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 5086 | # spice probe |
| 5087 | if test "$spice" != "no" ; then |
| 5088 | cat > $TMPC << EOF |
| 5089 | #include <spice.h> |
| 5090 | int main(void) { spice_server_new(); return 0; } |
| 5091 | EOF |
Jiri Denemark | 710fc4f | 2011-01-24 13:20:29 +0100 | [diff] [blame] | 5092 | spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) |
| 5093 | spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) |
Marc-André Lureau | 1b63665 | 2018-11-28 19:59:32 +0400 | [diff] [blame] | 5094 | if $pkg_config --atleast-version=0.12.5 spice-server && \ |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 5095 | $pkg_config --atleast-version=0.12.3 spice-protocol && \ |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 5096 | compile_prog "$spice_cflags" "$spice_libs" ; then |
| 5097 | spice="yes" |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 5098 | QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" |
| 5099 | else |
| 5100 | if test "$spice" = "yes" ; then |
Hu Tao | 8efc936 | 2014-06-26 17:34:50 +0800 | [diff] [blame] | 5101 | feature_not_found "spice" \ |
Marc-André Lureau | 1b63665 | 2018-11-28 19:59:32 +0400 | [diff] [blame] | 5102 | "Install spice-server(>=0.12.5) and spice-protocol(>=0.12.3) devel" |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 5103 | fi |
| 5104 | spice="no" |
| 5105 | fi |
| 5106 | fi |
| 5107 | |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5108 | # check for smartcard support |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5109 | if test "$smartcard" != "no"; then |
Michal Privoznik | 0f5c642 | 2018-04-03 12:34:37 +0200 | [diff] [blame] | 5110 | if $pkg_config --atleast-version=2.5.1 libcacard; then |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5111 | libcacard_cflags=$($pkg_config --cflags libcacard) |
| 5112 | libcacard_libs=$($pkg_config --libs libcacard) |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5113 | smartcard="yes" |
Paolo Bonzini | afd347a | 2012-12-20 20:39:36 +0100 | [diff] [blame] | 5114 | else |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5115 | if test "$smartcard" = "yes"; then |
| 5116 | feature_not_found "smartcard" "Install libcacard devel" |
Paolo Bonzini | afd347a | 2012-12-20 20:39:36 +0100 | [diff] [blame] | 5117 | fi |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 5118 | smartcard="no" |
Paolo Bonzini | afd347a | 2012-12-20 20:39:36 +0100 | [diff] [blame] | 5119 | fi |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 5120 | fi |
| 5121 | |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 5122 | # check for libusb |
| 5123 | if test "$libusb" != "no" ; then |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 5124 | if $pkg_config --atleast-version=1.0.13 libusb-1.0; then |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 5125 | libusb="yes" |
Stefan Weil | ca871ec | 2013-08-27 21:09:12 +0200 | [diff] [blame] | 5126 | libusb_cflags=$($pkg_config --cflags libusb-1.0) |
| 5127 | libusb_libs=$($pkg_config --libs libusb-1.0) |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 5128 | else |
| 5129 | if test "$libusb" = "yes"; then |
Hu Tao | 8efc936 | 2014-06-26 17:34:50 +0800 | [diff] [blame] | 5130 | feature_not_found "libusb" "Install libusb devel >= 1.0.13" |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 5131 | fi |
| 5132 | libusb="no" |
| 5133 | fi |
| 5134 | fi |
| 5135 | |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 5136 | # check for usbredirparser for usb network redirection support |
| 5137 | if test "$usb_redir" != "no" ; then |
Stefan Weil | 65d5d3f | 2013-08-27 21:09:13 +0200 | [diff] [blame] | 5138 | if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 5139 | usb_redir="yes" |
Stefan Weil | ca871ec | 2013-08-27 21:09:12 +0200 | [diff] [blame] | 5140 | usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) |
| 5141 | usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 5142 | else |
| 5143 | if test "$usb_redir" = "yes"; then |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 5144 | feature_not_found "usb-redir" "Install usbredir devel" |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 5145 | fi |
| 5146 | usb_redir="no" |
| 5147 | fi |
| 5148 | fi |
| 5149 | |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 5150 | ########################################## |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5151 | # check if we have VSS SDK headers for win |
| 5152 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5153 | if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ |
| 5154 | test "$vss_win32_sdk" != "no" ; then |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5155 | case "$vss_win32_sdk" in |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 5156 | "") vss_win32_include="-isystem $source_path" ;; |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5157 | *\ *) # The SDK is installed in "Program Files" by default, but we cannot |
| 5158 | # handle path with spaces. So we symlink the headers into ".sdk/vss". |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 5159 | vss_win32_include="-isystem $source_path/.sdk/vss" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5160 | symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" |
| 5161 | ;; |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 5162 | *) vss_win32_include="-isystem $vss_win32_sdk" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5163 | esac |
| 5164 | cat > $TMPC << EOF |
| 5165 | #define __MIDL_user_allocate_free_DEFINED__ |
| 5166 | #include <inc/win2003/vss.h> |
| 5167 | int main(void) { return VSS_CTX_BACKUP; } |
| 5168 | EOF |
| 5169 | if compile_prog "$vss_win32_include" "" ; then |
| 5170 | guest_agent_with_vss="yes" |
| 5171 | QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" |
Fam Zheng | 315d318 | 2016-09-21 12:27:21 +0800 | [diff] [blame] | 5172 | libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" |
Michael Roth | f33ca81 | 2015-08-26 16:19:41 -0500 | [diff] [blame] | 5173 | qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5174 | else |
| 5175 | if test "$vss_win32_sdk" != "" ; then |
| 5176 | echo "ERROR: Please download and install Microsoft VSS SDK:" |
| 5177 | echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" |
| 5178 | echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" |
| 5179 | echo "ERROR: scripts/extract-vsssdk-headers setup.exe" |
| 5180 | echo "ERROR: The headers are extracted in the directory \`inc'." |
| 5181 | feature_not_found "VSS support" |
| 5182 | fi |
| 5183 | guest_agent_with_vss="no" |
| 5184 | fi |
| 5185 | fi |
| 5186 | |
| 5187 | ########################################## |
| 5188 | # lookup Windows platform SDK (if not specified) |
| 5189 | # The SDK is needed only to build .tlb (type library) file of guest agent |
| 5190 | # VSS provider from the source. It is usually unnecessary because the |
| 5191 | # pre-compiled .tlb file is included. |
| 5192 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5193 | if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ |
| 5194 | test "$guest_agent_with_vss" = "yes" ; then |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 5195 | if test -z "$win_sdk"; then |
| 5196 | programfiles="$PROGRAMFILES" |
| 5197 | test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" |
| 5198 | if test -n "$programfiles"; then |
| 5199 | win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null |
| 5200 | else |
| 5201 | feature_not_found "Windows SDK" |
| 5202 | fi |
| 5203 | elif test "$win_sdk" = "no"; then |
| 5204 | win_sdk="" |
| 5205 | fi |
| 5206 | fi |
| 5207 | |
| 5208 | ########################################## |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 5209 | # check if mingw environment provides a recent ntddscsi.h |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5210 | if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 5211 | cat > $TMPC << EOF |
| 5212 | #include <windows.h> |
| 5213 | #include <ntddscsi.h> |
| 5214 | int main(void) { |
| 5215 | #if !defined(IOCTL_SCSI_GET_ADDRESS) |
| 5216 | #error Missing required ioctl definitions |
| 5217 | #endif |
| 5218 | SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 }; |
| 5219 | return addr.Lun; |
| 5220 | } |
| 5221 | EOF |
| 5222 | if compile_prog "" "" ; then |
| 5223 | guest_agent_ntddscsi=yes |
Matt Hines | 996b9cd | 2019-01-28 14:30:56 -0800 | [diff] [blame] | 5224 | libs_qga="-lsetupapi -lcfgmgr32 $libs_qga" |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 5225 | fi |
| 5226 | fi |
| 5227 | |
| 5228 | ########################################## |
Gerd Hoffmann | 9d9e152 | 2014-07-11 12:51:43 +0200 | [diff] [blame] | 5229 | # virgl renderer probe |
| 5230 | |
| 5231 | if test "$virglrenderer" != "no" ; then |
| 5232 | cat > $TMPC << EOF |
| 5233 | #include <virglrenderer.h> |
| 5234 | int main(void) { virgl_renderer_poll(); return 0; } |
| 5235 | EOF |
| 5236 | virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null) |
| 5237 | virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null) |
Marc-André Lureau | 47479c5 | 2018-05-25 17:36:09 +0200 | [diff] [blame] | 5238 | virgl_version=$($pkg_config --modversion virglrenderer 2>/dev/null) |
Gerd Hoffmann | 9d9e152 | 2014-07-11 12:51:43 +0200 | [diff] [blame] | 5239 | if $pkg_config virglrenderer >/dev/null 2>&1 && \ |
| 5240 | compile_prog "$virgl_cflags" "$virgl_libs" ; then |
| 5241 | virglrenderer="yes" |
| 5242 | else |
| 5243 | if test "$virglrenderer" = "yes" ; then |
| 5244 | feature_not_found "virglrenderer" |
| 5245 | fi |
| 5246 | virglrenderer="no" |
| 5247 | fi |
| 5248 | fi |
| 5249 | |
| 5250 | ########################################## |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 5251 | # capstone |
| 5252 | |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 5253 | case "$capstone" in |
| 5254 | "" | yes) |
| 5255 | if $pkg_config capstone; then |
| 5256 | capstone=system |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5257 | elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 5258 | capstone=git |
| 5259 | elif test -e "${source_path}/capstone/Makefile" ; then |
| 5260 | capstone=internal |
| 5261 | elif test -z "$capstone" ; then |
| 5262 | capstone=no |
| 5263 | else |
| 5264 | feature_not_found "capstone" "Install capstone devel or git submodule" |
| 5265 | fi |
| 5266 | ;; |
| 5267 | |
| 5268 | system) |
| 5269 | if ! $pkg_config capstone; then |
| 5270 | feature_not_found "capstone" "Install capstone devel" |
| 5271 | fi |
| 5272 | ;; |
| 5273 | esac |
| 5274 | |
| 5275 | case "$capstone" in |
| 5276 | git | internal) |
| 5277 | if test "$capstone" = git; then |
| 5278 | git_submodules="${git_submodules} capstone" |
| 5279 | fi |
| 5280 | mkdir -p capstone |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 5281 | QEMU_CFLAGS="$QEMU_CFLAGS -I${source_path}/capstone/include" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 5282 | if test "$mingw32" = "yes"; then |
| 5283 | LIBCAPSTONE=capstone.lib |
| 5284 | else |
| 5285 | LIBCAPSTONE=libcapstone.a |
| 5286 | fi |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 5287 | capstone_libs="-L$PWD/capstone -lcapstone" |
| 5288 | capstone_cflags="-I${source_path}/capstone/include" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 5289 | ;; |
| 5290 | |
| 5291 | system) |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 5292 | capstone_libs="$($pkg_config --libs capstone)" |
| 5293 | capstone_cflags="$($pkg_config --cflags capstone)" |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 5294 | QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 5295 | ;; |
| 5296 | |
| 5297 | no) |
| 5298 | ;; |
| 5299 | *) |
| 5300 | error_exit "Unknown state for capstone: $capstone" |
| 5301 | ;; |
| 5302 | esac |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 5303 | |
| 5304 | ########################################## |
Blue Swirl | 5f6b9e8 | 2009-09-20 06:56:26 +0000 | [diff] [blame] | 5305 | # check if we have fdatasync |
| 5306 | |
| 5307 | fdatasync=no |
| 5308 | cat > $TMPC << EOF |
| 5309 | #include <unistd.h> |
Alexandre Raymond | d1722a2 | 2011-05-29 18:22:48 -0400 | [diff] [blame] | 5310 | int main(void) { |
| 5311 | #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 |
| 5312 | return fdatasync(0); |
| 5313 | #else |
Stefan Weil | e172fe1 | 2012-04-06 21:33:20 +0200 | [diff] [blame] | 5314 | #error Not supported |
Alexandre Raymond | d1722a2 | 2011-05-29 18:22:48 -0400 | [diff] [blame] | 5315 | #endif |
| 5316 | } |
Blue Swirl | 5f6b9e8 | 2009-09-20 06:56:26 +0000 | [diff] [blame] | 5317 | EOF |
| 5318 | if compile_prog "" "" ; then |
| 5319 | fdatasync=yes |
| 5320 | fi |
| 5321 | |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 5322 | ########################################## |
Andreas Färber | e78815a | 2010-09-25 11:26:05 +0000 | [diff] [blame] | 5323 | # check if we have madvise |
| 5324 | |
| 5325 | madvise=no |
| 5326 | cat > $TMPC << EOF |
| 5327 | #include <sys/types.h> |
| 5328 | #include <sys/mman.h> |
Scott Wood | 832ce9c | 2010-10-05 14:28:17 -0500 | [diff] [blame] | 5329 | #include <stddef.h> |
Andreas Färber | e78815a | 2010-09-25 11:26:05 +0000 | [diff] [blame] | 5330 | int main(void) { return madvise(NULL, 0, MADV_DONTNEED); } |
| 5331 | EOF |
| 5332 | if compile_prog "" "" ; then |
| 5333 | madvise=yes |
| 5334 | fi |
| 5335 | |
| 5336 | ########################################## |
| 5337 | # check if we have posix_madvise |
| 5338 | |
| 5339 | posix_madvise=no |
| 5340 | cat > $TMPC << EOF |
| 5341 | #include <sys/mman.h> |
Scott Wood | 832ce9c | 2010-10-05 14:28:17 -0500 | [diff] [blame] | 5342 | #include <stddef.h> |
Andreas Färber | e78815a | 2010-09-25 11:26:05 +0000 | [diff] [blame] | 5343 | int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } |
| 5344 | EOF |
| 5345 | if compile_prog "" "" ; then |
| 5346 | posix_madvise=yes |
| 5347 | fi |
| 5348 | |
| 5349 | ########################################## |
Andreas Gustafsson | 9bc5a71 | 2018-01-04 19:39:36 +0200 | [diff] [blame] | 5350 | # check if we have posix_memalign() |
| 5351 | |
| 5352 | posix_memalign=no |
| 5353 | cat > $TMPC << EOF |
| 5354 | #include <stdlib.h> |
| 5355 | int main(void) { |
| 5356 | void *p; |
| 5357 | return posix_memalign(&p, 8, 8); |
| 5358 | } |
| 5359 | EOF |
| 5360 | if compile_prog "" "" ; then |
| 5361 | posix_memalign=yes |
| 5362 | fi |
| 5363 | |
| 5364 | ########################################## |
Paul Durrant | 0a85241 | 2016-08-04 14:44:14 +0100 | [diff] [blame] | 5365 | # check if we have posix_syslog |
| 5366 | |
| 5367 | posix_syslog=no |
| 5368 | cat > $TMPC << EOF |
| 5369 | #include <syslog.h> |
| 5370 | int main(void) { openlog("qemu", LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "configure"); return 0; } |
| 5371 | EOF |
| 5372 | if compile_prog "" "" ; then |
| 5373 | posix_syslog=yes |
| 5374 | fi |
| 5375 | |
| 5376 | ########################################## |
Peter Maydell | 401bc05 | 2017-09-05 13:19:32 +0100 | [diff] [blame] | 5377 | # check if we have sem_timedwait |
| 5378 | |
| 5379 | sem_timedwait=no |
| 5380 | cat > $TMPC << EOF |
| 5381 | #include <semaphore.h> |
Daniel P. Berrangé | 811294b | 2019-06-17 12:41:14 +0100 | [diff] [blame] | 5382 | int main(void) { sem_t s; struct timespec t = {0}; return sem_timedwait(&s, &t); } |
Peter Maydell | 401bc05 | 2017-09-05 13:19:32 +0100 | [diff] [blame] | 5383 | EOF |
| 5384 | if compile_prog "" "" ; then |
| 5385 | sem_timedwait=yes |
| 5386 | fi |
| 5387 | |
| 5388 | ########################################## |
Keno Fischer | 5c99fa3 | 2018-06-29 12:32:10 +0200 | [diff] [blame] | 5389 | # check if we have strchrnul |
| 5390 | |
| 5391 | strchrnul=no |
| 5392 | cat > $TMPC << EOF |
| 5393 | #include <string.h> |
| 5394 | int main(void); |
| 5395 | // Use a haystack that the compiler shouldn't be able to constant fold |
| 5396 | char *haystack = (char*)&main; |
| 5397 | int main(void) { return strchrnul(haystack, 'x') != &haystack[6]; } |
| 5398 | EOF |
| 5399 | if compile_prog "" "" ; then |
| 5400 | strchrnul=yes |
| 5401 | fi |
| 5402 | |
Jiufei Xue | 8a792b0 | 2019-04-17 03:08:56 +0800 | [diff] [blame] | 5403 | ######################################### |
| 5404 | # check if we have st_atim |
| 5405 | |
| 5406 | st_atim=no |
| 5407 | cat > $TMPC << EOF |
| 5408 | #include <sys/stat.h> |
| 5409 | #include <stddef.h> |
| 5410 | int main(void) { return offsetof(struct stat, st_atim); } |
| 5411 | EOF |
| 5412 | if compile_prog "" "" ; then |
| 5413 | st_atim=yes |
| 5414 | fi |
| 5415 | |
Keno Fischer | 5c99fa3 | 2018-06-29 12:32:10 +0200 | [diff] [blame] | 5416 | ########################################## |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 5417 | # check if trace backend exists |
| 5418 | |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 5419 | $python "$source_path/scripts/tracetool.py" "--backends=$trace_backends" --check-backends > /dev/null 2> /dev/null |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 5420 | if test "$?" -ne 0 ; then |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 5421 | error_exit "invalid trace backends" \ |
| 5422 | "Please choose supported trace backends." |
Stefan Hajnoczi | 94a420b | 2010-05-22 17:52:39 +0100 | [diff] [blame] | 5423 | fi |
| 5424 | |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5425 | ########################################## |
| 5426 | # For 'ust' backend, test if ust headers are present |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 5427 | if have_backend "ust"; then |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5428 | cat > $TMPC << EOF |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5429 | #include <lttng/tracepoint.h> |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5430 | int main(void) { return 0; } |
| 5431 | EOF |
Francis Deslauriers | c79ed23 | 2016-11-28 10:52:17 -0500 | [diff] [blame] | 5432 | if compile_prog "" "-Wl,--no-as-needed -ldl" ; then |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5433 | if $pkg_config lttng-ust --exists; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 5434 | lttng_ust_libs=$($pkg_config --libs lttng-ust) |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5435 | else |
Francis Deslauriers | c79ed23 | 2016-11-28 10:52:17 -0500 | [diff] [blame] | 5436 | lttng_ust_libs="-llttng-ust -ldl" |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5437 | fi |
| 5438 | if $pkg_config liburcu-bp --exists; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 5439 | urcu_bp_libs=$($pkg_config --libs liburcu-bp) |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5440 | else |
| 5441 | urcu_bp_libs="-lurcu-bp" |
| 5442 | fi |
| 5443 | |
| 5444 | LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5445 | else |
Mohamad Gebai | bf15f63 | 2014-01-29 22:47:54 -0500 | [diff] [blame] | 5446 | error_exit "Trace backend 'ust' missing lttng-ust header files" |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5447 | fi |
| 5448 | fi |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 5449 | |
| 5450 | ########################################## |
| 5451 | # For 'dtrace' backend, test if 'dtrace' command is present |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 5452 | if have_backend "dtrace"; then |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 5453 | if ! has 'dtrace' ; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 5454 | error_exit "dtrace command is not found in PATH $PATH" |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 5455 | fi |
Daniel P. Berrange | c276b17 | 2010-11-12 13:20:25 +0000 | [diff] [blame] | 5456 | trace_backend_stap="no" |
| 5457 | if has 'stap' ; then |
| 5458 | trace_backend_stap="yes" |
| 5459 | fi |
Daniel P. Berrange | b3d08c0 | 2010-11-12 13:20:24 +0000 | [diff] [blame] | 5460 | fi |
| 5461 | |
Stefan Hajnoczi | 7e24e92 | 2010-05-22 21:11:33 +0100 | [diff] [blame] | 5462 | ########################################## |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 5463 | # check and set a backend for coroutine |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5464 | |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5465 | # We prefer ucontext, but it's not always possible. The fallback |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 5466 | # is sigcontext. On Windows the only valid backend is the Windows |
| 5467 | # specific one. |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5468 | |
| 5469 | ucontext_works=no |
| 5470 | if test "$darwin" != "yes"; then |
| 5471 | cat > $TMPC << EOF |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5472 | #include <ucontext.h> |
Peter Maydell | cdf8480 | 2012-02-23 16:20:05 +0000 | [diff] [blame] | 5473 | #ifdef __stub_makecontext |
| 5474 | #error Ignoring glibc stub makecontext which will always fail |
| 5475 | #endif |
Stefan Weil | 75cafad | 2011-12-17 09:27:29 +0100 | [diff] [blame] | 5476 | int main(void) { makecontext(0, 0, 0); return 0; } |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5477 | EOF |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5478 | if compile_prog "" "" ; then |
| 5479 | ucontext_works=yes |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5480 | fi |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5481 | fi |
| 5482 | |
| 5483 | if test "$coroutine" = ""; then |
| 5484 | if test "$mingw32" = "yes"; then |
| 5485 | coroutine=win32 |
| 5486 | elif test "$ucontext_works" = "yes"; then |
| 5487 | coroutine=ucontext |
| 5488 | else |
| 5489 | coroutine=sigaltstack |
| 5490 | fi |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 5491 | else |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5492 | case $coroutine in |
| 5493 | windows) |
| 5494 | if test "$mingw32" != "yes"; then |
| 5495 | error_exit "'windows' coroutine backend only valid for Windows" |
| 5496 | fi |
| 5497 | # Unfortunately the user visible backend name doesn't match the |
| 5498 | # coroutine-*.c filename for this case, so we have to adjust it here. |
| 5499 | coroutine=win32 |
| 5500 | ;; |
| 5501 | ucontext) |
| 5502 | if test "$ucontext_works" != "yes"; then |
| 5503 | feature_not_found "ucontext" |
| 5504 | fi |
| 5505 | ;; |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 5506 | sigaltstack) |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 5507 | if test "$mingw32" = "yes"; then |
| 5508 | error_exit "only the 'windows' coroutine backend is valid for Windows" |
| 5509 | fi |
| 5510 | ;; |
| 5511 | *) |
| 5512 | error_exit "unknown coroutine backend $coroutine" |
| 5513 | ;; |
| 5514 | esac |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5515 | fi |
| 5516 | |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 5517 | if test "$coroutine_pool" = ""; then |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 5518 | coroutine_pool=yes |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 5519 | fi |
| 5520 | |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 5521 | if test "$debug_stack_usage" = "yes"; then |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 5522 | if test "$coroutine_pool" = "yes"; then |
| 5523 | echo "WARN: disabling coroutine pool for stack usage debugging" |
| 5524 | coroutine_pool=no |
| 5525 | fi |
| 5526 | fi |
| 5527 | |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 5528 | ################################################## |
| 5529 | # SafeStack |
| 5530 | |
| 5531 | |
| 5532 | if test "$safe_stack" = "yes"; then |
| 5533 | cat > $TMPC << EOF |
| 5534 | int main(int argc, char *argv[]) |
| 5535 | { |
| 5536 | #if ! __has_feature(safe_stack) |
| 5537 | #error SafeStack Disabled |
| 5538 | #endif |
| 5539 | return 0; |
| 5540 | } |
| 5541 | EOF |
| 5542 | flag="-fsanitize=safe-stack" |
| 5543 | # Check that safe-stack is supported and enabled. |
| 5544 | if compile_prog "-Werror $flag" "$flag"; then |
| 5545 | # Flag needed both at compilation and at linking |
| 5546 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
| 5547 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
| 5548 | else |
| 5549 | error_exit "SafeStack not supported by your compiler" |
| 5550 | fi |
| 5551 | if test "$coroutine" != "ucontext"; then |
| 5552 | error_exit "SafeStack is only supported by the coroutine backend ucontext" |
| 5553 | fi |
| 5554 | else |
| 5555 | cat > $TMPC << EOF |
| 5556 | int main(int argc, char *argv[]) |
| 5557 | { |
| 5558 | #if defined(__has_feature) |
| 5559 | #if __has_feature(safe_stack) |
| 5560 | #error SafeStack Enabled |
| 5561 | #endif |
| 5562 | #endif |
| 5563 | return 0; |
| 5564 | } |
| 5565 | EOF |
| 5566 | if test "$safe_stack" = "no"; then |
| 5567 | # Make sure that safe-stack is disabled |
| 5568 | if ! compile_prog "-Werror" ""; then |
| 5569 | # SafeStack was already enabled, try to explicitly remove the feature |
| 5570 | flag="-fno-sanitize=safe-stack" |
| 5571 | if ! compile_prog "-Werror $flag" "$flag"; then |
| 5572 | error_exit "Configure cannot disable SafeStack" |
| 5573 | fi |
| 5574 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
| 5575 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
| 5576 | fi |
| 5577 | else # "$safe_stack" = "" |
| 5578 | # Set safe_stack to yes or no based on pre-existing flags |
| 5579 | if compile_prog "-Werror" ""; then |
| 5580 | safe_stack="no" |
| 5581 | else |
| 5582 | safe_stack="yes" |
| 5583 | if test "$coroutine" != "ucontext"; then |
| 5584 | error_exit "SafeStack is only supported by the coroutine backend ucontext" |
| 5585 | fi |
| 5586 | fi |
| 5587 | fi |
| 5588 | fi |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 5589 | |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 5590 | ########################################## |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 5591 | # check if we have open_by_handle_at |
| 5592 | |
Stefan Weil | 4e1797f | 2012-06-18 22:11:06 +0200 | [diff] [blame] | 5593 | open_by_handle_at=no |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 5594 | cat > $TMPC << EOF |
| 5595 | #include <fcntl.h> |
Stefan Weil | acc55ba | 2012-06-06 19:35:57 +0000 | [diff] [blame] | 5596 | #if !defined(AT_EMPTY_PATH) |
| 5597 | # error missing definition |
| 5598 | #else |
Stefan Weil | 75cafad | 2011-12-17 09:27:29 +0100 | [diff] [blame] | 5599 | int main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } |
Stefan Weil | acc55ba | 2012-06-06 19:35:57 +0000 | [diff] [blame] | 5600 | #endif |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 5601 | EOF |
| 5602 | if compile_prog "" "" ; then |
| 5603 | open_by_handle_at=yes |
| 5604 | fi |
| 5605 | |
Harsh Prateek Bora | e06a765 | 2011-10-12 19:11:25 +0530 | [diff] [blame] | 5606 | ######################################## |
| 5607 | # check if we have linux/magic.h |
| 5608 | |
| 5609 | linux_magic_h=no |
| 5610 | cat > $TMPC << EOF |
| 5611 | #include <linux/magic.h> |
| 5612 | int main(void) { |
Stefan Weil | 75cafad | 2011-12-17 09:27:29 +0100 | [diff] [blame] | 5613 | return 0; |
Harsh Prateek Bora | e06a765 | 2011-10-12 19:11:25 +0530 | [diff] [blame] | 5614 | } |
| 5615 | EOF |
| 5616 | if compile_prog "" "" ; then |
| 5617 | linux_magic_h=yes |
| 5618 | fi |
| 5619 | |
Luiz Capitulino | 8ab1bf1 | 2012-05-23 15:48:04 -0300 | [diff] [blame] | 5620 | ######################################## |
Christian Borntraeger | 541be92 | 2014-09-25 21:07:54 +0200 | [diff] [blame] | 5621 | # check if we have valgrind/valgrind.h |
Kevin Wolf | 3f4349d | 2012-06-29 13:40:27 +0200 | [diff] [blame] | 5622 | |
| 5623 | valgrind_h=no |
| 5624 | cat > $TMPC << EOF |
| 5625 | #include <valgrind/valgrind.h> |
Kevin Wolf | 3f4349d | 2012-06-29 13:40:27 +0200 | [diff] [blame] | 5626 | int main(void) { |
Kevin Wolf | 3f4349d | 2012-06-29 13:40:27 +0200 | [diff] [blame] | 5627 | return 0; |
| 5628 | } |
| 5629 | EOF |
| 5630 | if compile_prog "" "" ; then |
| 5631 | valgrind_h=yes |
| 5632 | fi |
| 5633 | |
| 5634 | ######################################## |
Luiz Capitulino | 8ab1bf1 | 2012-05-23 15:48:04 -0300 | [diff] [blame] | 5635 | # check if environ is declared |
| 5636 | |
| 5637 | has_environ=no |
| 5638 | cat > $TMPC << EOF |
| 5639 | #include <unistd.h> |
| 5640 | int main(void) { |
Blue Swirl | c075a72 | 2012-08-09 20:21:25 +0000 | [diff] [blame] | 5641 | environ = 0; |
Luiz Capitulino | 8ab1bf1 | 2012-05-23 15:48:04 -0300 | [diff] [blame] | 5642 | return 0; |
| 5643 | } |
| 5644 | EOF |
| 5645 | if compile_prog "" "" ; then |
| 5646 | has_environ=yes |
| 5647 | fi |
| 5648 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 5649 | ######################################## |
| 5650 | # check if cpuid.h is usable. |
| 5651 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 5652 | cat > $TMPC << EOF |
| 5653 | #include <cpuid.h> |
| 5654 | int main(void) { |
Peter Maydell | 774d566 | 2014-02-20 19:42:53 +0000 | [diff] [blame] | 5655 | unsigned a, b, c, d; |
| 5656 | int max = __get_cpuid_max(0, 0); |
| 5657 | |
| 5658 | if (max >= 1) { |
| 5659 | __cpuid(1, a, b, c, d); |
| 5660 | } |
| 5661 | |
| 5662 | if (max >= 7) { |
| 5663 | __cpuid_count(7, 0, a, b, c, d); |
| 5664 | } |
| 5665 | |
| 5666 | return 0; |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 5667 | } |
| 5668 | EOF |
| 5669 | if compile_prog "" "" ; then |
| 5670 | cpuid_h=yes |
| 5671 | fi |
| 5672 | |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 5673 | ########################################## |
| 5674 | # avx2 optimization requirement check |
| 5675 | # |
| 5676 | # There is no point enabling this if cpuid.h is not usable, |
| 5677 | # since we won't be able to select the new routines. |
| 5678 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5679 | if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 5680 | cat > $TMPC << EOF |
| 5681 | #pragma GCC push_options |
| 5682 | #pragma GCC target("avx2") |
| 5683 | #include <cpuid.h> |
| 5684 | #include <immintrin.h> |
| 5685 | static int bar(void *a) { |
| 5686 | __m256i x = *(__m256i *)a; |
| 5687 | return _mm256_testz_si256(x, x); |
| 5688 | } |
| 5689 | int main(int argc, char *argv[]) { return bar(argv[0]); } |
| 5690 | EOF |
| 5691 | if compile_object "" ; then |
| 5692 | avx2_opt="yes" |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 5693 | else |
| 5694 | avx2_opt="no" |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 5695 | fi |
| 5696 | fi |
| 5697 | |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 5698 | ########################################## |
| 5699 | # avx512f optimization requirement check |
| 5700 | # |
| 5701 | # There is no point enabling this if cpuid.h is not usable, |
| 5702 | # since we won't be able to select the new routines. |
| 5703 | # by default, it is turned off. |
| 5704 | # if user explicitly want to enable it, check environment |
| 5705 | |
| 5706 | if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then |
| 5707 | cat > $TMPC << EOF |
| 5708 | #pragma GCC push_options |
| 5709 | #pragma GCC target("avx512f") |
| 5710 | #include <cpuid.h> |
| 5711 | #include <immintrin.h> |
| 5712 | static int bar(void *a) { |
| 5713 | __m512i x = *(__m512i *)a; |
| 5714 | return _mm512_test_epi64_mask(x, x); |
| 5715 | } |
| 5716 | int main(int argc, char *argv[]) |
| 5717 | { |
| 5718 | return bar(argv[0]); |
| 5719 | } |
| 5720 | EOF |
| 5721 | if ! compile_object "" ; then |
| 5722 | avx512f_opt="no" |
| 5723 | fi |
| 5724 | else |
| 5725 | avx512f_opt="no" |
| 5726 | fi |
| 5727 | |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 5728 | ######################################## |
| 5729 | # check if __[u]int128_t is usable. |
| 5730 | |
| 5731 | int128=no |
| 5732 | cat > $TMPC << EOF |
| 5733 | __int128_t a; |
| 5734 | __uint128_t b; |
| 5735 | int main (void) { |
| 5736 | a = a + b; |
| 5737 | b = a * b; |
Peter Maydell | 464e367 | 2013-06-21 14:01:31 +0100 | [diff] [blame] | 5738 | a = a * a; |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 5739 | return 0; |
| 5740 | } |
| 5741 | EOF |
| 5742 | if compile_prog "" "" ; then |
| 5743 | int128=yes |
| 5744 | fi |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 5745 | |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 5746 | ######################################### |
| 5747 | # See if 128-bit atomic operations are supported. |
| 5748 | |
| 5749 | atomic128=no |
| 5750 | if test "$int128" = "yes"; then |
| 5751 | cat > $TMPC << EOF |
| 5752 | int main(void) |
| 5753 | { |
| 5754 | unsigned __int128 x = 0, y = 0; |
| 5755 | y = __atomic_load_16(&x, 0); |
| 5756 | __atomic_store_16(&x, y, 0); |
| 5757 | __atomic_compare_exchange_16(&x, &y, x, 0, 0, 0); |
| 5758 | return 0; |
| 5759 | } |
| 5760 | EOF |
| 5761 | if compile_prog "" "" ; then |
| 5762 | atomic128=yes |
| 5763 | fi |
| 5764 | fi |
| 5765 | |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 5766 | cmpxchg128=no |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 5767 | if test "$int128" = yes && test "$atomic128" = no; then |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 5768 | cat > $TMPC << EOF |
| 5769 | int main(void) |
| 5770 | { |
| 5771 | unsigned __int128 x = 0, y = 0; |
| 5772 | __sync_val_compare_and_swap_16(&x, y, x); |
| 5773 | return 0; |
| 5774 | } |
| 5775 | EOF |
| 5776 | if compile_prog "" "" ; then |
| 5777 | cmpxchg128=yes |
| 5778 | fi |
| 5779 | fi |
| 5780 | |
Richard Henderson | df79b99 | 2016-09-02 12:23:57 -0700 | [diff] [blame] | 5781 | ######################################### |
| 5782 | # See if 64-bit atomic operations are supported. |
| 5783 | # Note that without __atomic builtins, we can only |
| 5784 | # assume atomic loads/stores max at pointer size. |
| 5785 | |
| 5786 | cat > $TMPC << EOF |
| 5787 | #include <stdint.h> |
| 5788 | int main(void) |
| 5789 | { |
| 5790 | uint64_t x = 0, y = 0; |
| 5791 | #ifdef __ATOMIC_RELAXED |
| 5792 | y = __atomic_load_8(&x, 0); |
| 5793 | __atomic_store_8(&x, y, 0); |
| 5794 | __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0); |
| 5795 | __atomic_exchange_8(&x, y, 0); |
| 5796 | __atomic_fetch_add_8(&x, y, 0); |
| 5797 | #else |
| 5798 | typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1]; |
| 5799 | __sync_lock_test_and_set(&x, y); |
| 5800 | __sync_val_compare_and_swap(&x, y, 0); |
| 5801 | __sync_fetch_and_add(&x, y); |
| 5802 | #endif |
| 5803 | return 0; |
| 5804 | } |
| 5805 | EOF |
| 5806 | if compile_prog "" "" ; then |
| 5807 | atomic64=yes |
| 5808 | fi |
| 5809 | |
Emilio G. Cota | 26fffe2 | 2018-10-21 13:56:29 -0400 | [diff] [blame] | 5810 | ######################################### |
| 5811 | # See if --dynamic-list is supported by the linker |
| 5812 | ld_dynamic_list="no" |
| 5813 | if test "$static" = "no" ; then |
| 5814 | cat > $TMPTXT <<EOF |
| 5815 | { |
| 5816 | foo; |
| 5817 | }; |
| 5818 | EOF |
| 5819 | |
| 5820 | cat > $TMPC <<EOF |
| 5821 | #include <stdio.h> |
| 5822 | void foo(void); |
| 5823 | |
| 5824 | void foo(void) |
| 5825 | { |
| 5826 | printf("foo\n"); |
| 5827 | } |
| 5828 | |
| 5829 | int main(void) |
| 5830 | { |
| 5831 | foo(); |
| 5832 | return 0; |
| 5833 | } |
| 5834 | EOF |
| 5835 | |
| 5836 | if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then |
| 5837 | ld_dynamic_list="yes" |
| 5838 | fi |
| 5839 | fi |
| 5840 | |
| 5841 | ######################################### |
| 5842 | # See if -exported_symbols_list is supported by the linker |
| 5843 | |
| 5844 | ld_exported_symbols_list="no" |
| 5845 | if test "$static" = "no" ; then |
| 5846 | cat > $TMPTXT <<EOF |
| 5847 | _foo |
| 5848 | EOF |
| 5849 | |
| 5850 | if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then |
| 5851 | ld_exported_symbols_list="yes" |
| 5852 | fi |
| 5853 | fi |
| 5854 | |
| 5855 | if test "$plugins" = "yes" && |
| 5856 | test "$ld_dynamic_list" = "no" && |
| 5857 | test "$ld_exported_symbols_list" = "no" ; then |
| 5858 | error_exit \ |
| 5859 | "Plugin support requires dynamic linking and specifying a set of symbols " \ |
| 5860 | "that are exported to plugins. Unfortunately your linker doesn't " \ |
| 5861 | "support the flag (--dynamic-list or -exported_symbols_list) used " \ |
| 5862 | "for this purpose. You can't build with --static." |
| 5863 | fi |
| 5864 | |
Richard Henderson | 1e6e9ac | 2013-02-18 09:11:15 -0800 | [diff] [blame] | 5865 | ######################################## |
Richard Henderson | db8aaae | 2019-10-13 16:12:19 -0700 | [diff] [blame] | 5866 | # See if __attribute__((alias)) is supported. |
| 5867 | # This false for Xcode 9, but has been remedied for Xcode 10. |
| 5868 | # Unfortunately, travis uses Xcode 9 by default. |
| 5869 | |
| 5870 | attralias=no |
| 5871 | cat > $TMPC << EOF |
| 5872 | int x = 1; |
| 5873 | extern const int y __attribute__((alias("x"))); |
| 5874 | int main(void) { return 0; } |
| 5875 | EOF |
| 5876 | if compile_prog "" "" ; then |
| 5877 | attralias=yes |
| 5878 | fi |
| 5879 | |
| 5880 | ######################################## |
Richard Henderson | 1e6e9ac | 2013-02-18 09:11:15 -0800 | [diff] [blame] | 5881 | # check if getauxval is available. |
| 5882 | |
| 5883 | getauxval=no |
| 5884 | cat > $TMPC << EOF |
| 5885 | #include <sys/auxv.h> |
| 5886 | int main(void) { |
| 5887 | return getauxval(AT_HWCAP) == 0; |
| 5888 | } |
| 5889 | EOF |
| 5890 | if compile_prog "" "" ; then |
| 5891 | getauxval=yes |
| 5892 | fi |
| 5893 | |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 5894 | ######################################## |
| 5895 | # check if ccache is interfering with |
| 5896 | # semantic analysis of macros |
| 5897 | |
John Snow | 5e4dfd3 | 2015-10-28 13:56:40 -0400 | [diff] [blame] | 5898 | unset CCACHE_CPP2 |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 5899 | ccache_cpp2=no |
| 5900 | cat > $TMPC << EOF |
| 5901 | static const int Z = 1; |
| 5902 | #define fn() ({ Z; }) |
| 5903 | #define TAUT(X) ((X) == Z) |
| 5904 | #define PAREN(X, Y) (X == Y) |
| 5905 | #define ID(X) (X) |
| 5906 | int main(int argc, char *argv[]) |
| 5907 | { |
| 5908 | int x = 0, y = 0; |
| 5909 | x = ID(x); |
| 5910 | x = fn(); |
| 5911 | fn(); |
| 5912 | if (PAREN(x, y)) return 0; |
| 5913 | if (TAUT(Z)) return 0; |
| 5914 | return 0; |
| 5915 | } |
| 5916 | EOF |
| 5917 | |
| 5918 | if ! compile_object "-Werror"; then |
| 5919 | ccache_cpp2=yes |
| 5920 | fi |
| 5921 | |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 5922 | ################################################# |
| 5923 | # clang does not support glibc + FORTIFY_SOURCE. |
| 5924 | |
| 5925 | if test "$fortify_source" != "no"; then |
| 5926 | if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then |
| 5927 | fortify_source="no"; |
Peter Maydell | e189091 | 2017-06-26 16:25:24 +0100 | [diff] [blame] | 5928 | elif test -n "$cxx" && has $cxx && |
John Snow | cfcc7c1 | 2015-11-12 11:29:49 -0500 | [diff] [blame] | 5929 | echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 5930 | fortify_source="no"; |
| 5931 | else |
| 5932 | fortify_source="yes" |
| 5933 | fi |
| 5934 | fi |
| 5935 | |
Fam Zheng | 1efad06 | 2018-06-01 17:26:43 +0800 | [diff] [blame] | 5936 | ############################################### |
| 5937 | # Check if copy_file_range is provided by glibc |
| 5938 | have_copy_file_range=no |
| 5939 | cat > $TMPC << EOF |
| 5940 | #include <unistd.h> |
| 5941 | int main(void) { |
| 5942 | copy_file_range(0, NULL, 0, NULL, 0, 0); |
| 5943 | return 0; |
| 5944 | } |
| 5945 | EOF |
| 5946 | if compile_prog "" "" ; then |
| 5947 | have_copy_file_range=yes |
| 5948 | fi |
| 5949 | |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 5950 | ########################################## |
Jan Vesely | 277abf1 | 2016-04-29 13:15:23 -0400 | [diff] [blame] | 5951 | # check if struct fsxattr is available via linux/fs.h |
| 5952 | |
| 5953 | have_fsxattr=no |
| 5954 | cat > $TMPC << EOF |
| 5955 | #include <linux/fs.h> |
| 5956 | struct fsxattr foo; |
| 5957 | int main(void) { |
| 5958 | return 0; |
| 5959 | } |
| 5960 | EOF |
| 5961 | if compile_prog "" "" ; then |
| 5962 | have_fsxattr=yes |
| 5963 | fi |
| 5964 | |
Peter Maydell | b66e10e | 2016-06-08 18:34:32 +0100 | [diff] [blame] | 5965 | ########################################## |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 5966 | # check for usable membarrier system call |
| 5967 | if test "$membarrier" = "yes"; then |
| 5968 | have_membarrier=no |
| 5969 | if test "$mingw32" = "yes" ; then |
| 5970 | have_membarrier=yes |
| 5971 | elif test "$linux" = "yes" ; then |
| 5972 | cat > $TMPC << EOF |
| 5973 | #include <linux/membarrier.h> |
| 5974 | #include <sys/syscall.h> |
| 5975 | #include <unistd.h> |
| 5976 | #include <stdlib.h> |
| 5977 | int main(void) { |
| 5978 | syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0); |
| 5979 | syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0); |
| 5980 | exit(0); |
| 5981 | } |
| 5982 | EOF |
| 5983 | if compile_prog "" "" ; then |
| 5984 | have_membarrier=yes |
| 5985 | fi |
| 5986 | fi |
| 5987 | if test "$have_membarrier" = "no"; then |
| 5988 | feature_not_found "membarrier" "membarrier system call not available" |
| 5989 | fi |
| 5990 | else |
| 5991 | # Do not enable it by default even for Mingw32, because it doesn't |
| 5992 | # work on Wine. |
| 5993 | membarrier=no |
| 5994 | fi |
| 5995 | |
| 5996 | ########################################## |
Peter Maydell | b66e10e | 2016-06-08 18:34:32 +0100 | [diff] [blame] | 5997 | # check if rtnetlink.h exists and is useful |
Laurent Vivier | 575b22b | 2016-06-02 22:14:15 +0200 | [diff] [blame] | 5998 | have_rtnetlink=no |
| 5999 | cat > $TMPC << EOF |
| 6000 | #include <linux/rtnetlink.h> |
| 6001 | int main(void) { |
| 6002 | return IFLA_PROTO_DOWN; |
| 6003 | } |
| 6004 | EOF |
| 6005 | if compile_prog "" "" ; then |
| 6006 | have_rtnetlink=yes |
| 6007 | fi |
| 6008 | |
Stefan Hajnoczi | 6a02c80 | 2016-10-14 10:00:55 +0100 | [diff] [blame] | 6009 | ########################################## |
| 6010 | # check for usable AF_VSOCK environment |
| 6011 | have_af_vsock=no |
| 6012 | cat > $TMPC << EOF |
| 6013 | #include <errno.h> |
| 6014 | #include <sys/types.h> |
| 6015 | #include <sys/socket.h> |
| 6016 | #if !defined(AF_VSOCK) |
| 6017 | # error missing AF_VSOCK flag |
| 6018 | #endif |
| 6019 | #include <linux/vm_sockets.h> |
| 6020 | int main(void) { |
| 6021 | int sock, ret; |
| 6022 | struct sockaddr_vm svm; |
| 6023 | socklen_t len = sizeof(svm); |
| 6024 | sock = socket(AF_VSOCK, SOCK_STREAM, 0); |
| 6025 | ret = getpeername(sock, (struct sockaddr *)&svm, &len); |
| 6026 | if ((ret == -1) && (errno == ENOTCONN)) { |
| 6027 | return 0; |
| 6028 | } |
| 6029 | return -1; |
| 6030 | } |
| 6031 | EOF |
| 6032 | if compile_prog "" "" ; then |
| 6033 | have_af_vsock=yes |
| 6034 | fi |
| 6035 | |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 6036 | ########################################## |
| 6037 | # check for usable AF_ALG environment |
Thomas Huth | 4f67366 | 2020-02-03 16:55:34 +0100 | [diff] [blame] | 6038 | have_afalg=no |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 6039 | cat > $TMPC << EOF |
| 6040 | #include <errno.h> |
| 6041 | #include <sys/types.h> |
| 6042 | #include <sys/socket.h> |
| 6043 | #include <linux/if_alg.h> |
| 6044 | int main(void) { |
| 6045 | int sock; |
| 6046 | sock = socket(AF_ALG, SOCK_SEQPACKET, 0); |
| 6047 | return sock; |
| 6048 | } |
| 6049 | EOF |
| 6050 | if compile_prog "" "" ; then |
| 6051 | have_afalg=yes |
| 6052 | fi |
| 6053 | if test "$crypto_afalg" = "yes" |
| 6054 | then |
| 6055 | if test "$have_afalg" != "yes" |
| 6056 | then |
| 6057 | error_exit "AF_ALG requested but could not be detected" |
| 6058 | fi |
| 6059 | fi |
| 6060 | |
| 6061 | |
James Clarke | 6969ec6 | 2016-06-06 12:02:50 +0100 | [diff] [blame] | 6062 | ################################################# |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 6063 | # Check to see if we have the Hypervisor framework |
Peter Maydell | d2d0852 | 2018-01-08 17:10:42 +0000 | [diff] [blame] | 6064 | if [ "$darwin" = "yes" ] ; then |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 6065 | cat > $TMPC << EOF |
| 6066 | #include <Hypervisor/hv.h> |
| 6067 | int main() { return 0;} |
| 6068 | EOF |
| 6069 | if ! compile_object ""; then |
| 6070 | hvf='no' |
| 6071 | else |
| 6072 | hvf='yes' |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 6073 | QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS" |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 6074 | fi |
| 6075 | fi |
| 6076 | |
Jan Vesely | 277abf1 | 2016-04-29 13:15:23 -0400 | [diff] [blame] | 6077 | ########################################## |
Christopher Covington | 4d04351 | 2016-12-28 15:04:33 -0500 | [diff] [blame] | 6078 | # check for sysmacros.h |
| 6079 | |
| 6080 | have_sysmacros=no |
| 6081 | cat > $TMPC << EOF |
| 6082 | #include <sys/sysmacros.h> |
| 6083 | int main(void) { |
| 6084 | return makedev(0, 0); |
| 6085 | } |
| 6086 | EOF |
| 6087 | if compile_prog "" "" ; then |
| 6088 | have_sysmacros=yes |
| 6089 | fi |
| 6090 | |
| 6091 | ########################################## |
Andreas Grapentin | 49e00a1 | 2017-03-14 17:59:53 +0100 | [diff] [blame] | 6092 | # check for _Static_assert() |
| 6093 | |
| 6094 | have_static_assert=no |
| 6095 | cat > $TMPC << EOF |
| 6096 | _Static_assert(1, "success"); |
| 6097 | int main(void) { |
| 6098 | return 0; |
| 6099 | } |
| 6100 | EOF |
| 6101 | if compile_prog "" "" ; then |
| 6102 | have_static_assert=yes |
| 6103 | fi |
| 6104 | |
| 6105 | ########################################## |
Tomáš Golembiovský | e674605 | 2017-07-17 15:58:33 +0200 | [diff] [blame] | 6106 | # check for utmpx.h, it is missing e.g. on OpenBSD |
| 6107 | |
| 6108 | have_utmpx=no |
| 6109 | cat > $TMPC << EOF |
| 6110 | #include <utmpx.h> |
| 6111 | struct utmpx user_info; |
| 6112 | int main(void) { |
| 6113 | return 0; |
| 6114 | } |
| 6115 | EOF |
| 6116 | if compile_prog "" "" ; then |
| 6117 | have_utmpx=yes |
| 6118 | fi |
| 6119 | |
| 6120 | ########################################## |
Richard Henderson | db1ed1a | 2019-03-13 20:57:28 -0700 | [diff] [blame] | 6121 | # check for getrandom() |
| 6122 | |
| 6123 | have_getrandom=no |
| 6124 | cat > $TMPC << EOF |
| 6125 | #include <sys/random.h> |
| 6126 | int main(void) { |
| 6127 | return getrandom(0, 0, GRND_NONBLOCK); |
| 6128 | } |
| 6129 | EOF |
| 6130 | if compile_prog "" "" ; then |
| 6131 | have_getrandom=yes |
| 6132 | fi |
| 6133 | |
| 6134 | ########################################## |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6135 | # checks for sanitizers |
| 6136 | |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6137 | have_asan=no |
| 6138 | have_ubsan=no |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 6139 | have_asan_iface_h=no |
| 6140 | have_asan_iface_fiber=no |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6141 | |
| 6142 | if test "$sanitizers" = "yes" ; then |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 6143 | write_c_skeleton |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6144 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" ""; then |
| 6145 | have_asan=yes |
| 6146 | fi |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 6147 | |
| 6148 | # we could use a simple skeleton for flags checks, but this also |
| 6149 | # detect the static linking issue of ubsan, see also: |
| 6150 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 |
| 6151 | cat > $TMPC << EOF |
| 6152 | #include <stdlib.h> |
| 6153 | int main(void) { |
| 6154 | void *tmp = malloc(10); |
Leonid Bloch | f2dfe54 | 2020-05-25 01:12:04 +0300 | [diff] [blame] | 6155 | if (tmp != NULL) { |
| 6156 | return *(int *)(tmp + 2); |
| 6157 | } |
Olaf Hering | d1abf3f | 2020-07-07 19:13:25 +0200 | [diff] [blame] | 6158 | return 1; |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 6159 | } |
| 6160 | EOF |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6161 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then |
| 6162 | have_ubsan=yes |
| 6163 | fi |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 6164 | |
| 6165 | if check_include "sanitizer/asan_interface.h" ; then |
| 6166 | have_asan_iface_h=yes |
| 6167 | fi |
| 6168 | |
| 6169 | cat > $TMPC << EOF |
| 6170 | #include <sanitizer/asan_interface.h> |
| 6171 | int main(void) { |
| 6172 | __sanitizer_start_switch_fiber(0, 0, 0); |
| 6173 | return 0; |
| 6174 | } |
| 6175 | EOF |
| 6176 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" "" ; then |
| 6177 | have_asan_iface_fiber=yes |
| 6178 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6179 | fi |
| 6180 | |
| 6181 | ########################################## |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 6182 | # checks for fuzzer |
| 6183 | if test "$fuzzing" = "yes" ; then |
| 6184 | write_c_fuzzer_skeleton |
Alexander Bulekov | dd01626 | 2020-07-06 15:55:31 -0400 | [diff] [blame] | 6185 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=fuzzer" ""; then |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 6186 | have_fuzzer=yes |
| 6187 | else |
| 6188 | error_exit "Your compiler doesn't support -fsanitize=fuzzer" |
| 6189 | exit 1 |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 6190 | fi |
| 6191 | fi |
| 6192 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 6193 | # Thread sanitizer is, for now, much noisier than the other sanitizers; |
| 6194 | # keep it separate until that is not the case. |
| 6195 | if test "$tsan" = "yes" && test "$sanitizers" = "yes"; then |
| 6196 | error_exit "TSAN is not supported with other sanitiziers." |
| 6197 | fi |
| 6198 | have_tsan=no |
| 6199 | have_tsan_iface_fiber=no |
| 6200 | if test "$tsan" = "yes" ; then |
| 6201 | write_c_skeleton |
| 6202 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then |
| 6203 | have_tsan=yes |
| 6204 | fi |
| 6205 | cat > $TMPC << EOF |
| 6206 | #include <sanitizer/tsan_interface.h> |
| 6207 | int main(void) { |
| 6208 | __tsan_create_fiber(0); |
| 6209 | return 0; |
| 6210 | } |
| 6211 | EOF |
| 6212 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then |
| 6213 | have_tsan_iface_fiber=yes |
| 6214 | fi |
| 6215 | fi |
| 6216 | |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 6217 | ########################################## |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 6218 | # check for libpmem |
| 6219 | |
| 6220 | if test "$libpmem" != "no"; then |
| 6221 | if $pkg_config --exists "libpmem"; then |
| 6222 | libpmem="yes" |
| 6223 | libpmem_libs=$($pkg_config --libs libpmem) |
| 6224 | libpmem_cflags=$($pkg_config --cflags libpmem) |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 6225 | QEMU_CFLAGS="$QEMU_CFLAGS $libpmem_cflags" |
| 6226 | else |
| 6227 | if test "$libpmem" = "yes" ; then |
| 6228 | feature_not_found "libpmem" "Install nvml or pmdk" |
| 6229 | fi |
| 6230 | libpmem="no" |
| 6231 | fi |
| 6232 | fi |
| 6233 | |
| 6234 | ########################################## |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 6235 | # check for libdaxctl |
| 6236 | |
| 6237 | if test "$libdaxctl" != "no"; then |
| 6238 | if $pkg_config --atleast-version=57 "libdaxctl"; then |
| 6239 | libdaxctl="yes" |
| 6240 | libdaxctl_libs=$($pkg_config --libs libdaxctl) |
| 6241 | libdaxctl_cflags=$($pkg_config --cflags libdaxctl) |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 6242 | QEMU_CFLAGS="$QEMU_CFLAGS $libdaxctl_cflags" |
| 6243 | else |
| 6244 | if test "$libdaxctl" = "yes" ; then |
| 6245 | feature_not_found "libdaxctl" "Install libdaxctl" |
| 6246 | fi |
| 6247 | libdaxctl="no" |
| 6248 | fi |
| 6249 | fi |
| 6250 | |
| 6251 | ########################################## |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6252 | # check for slirp |
| 6253 | |
Laurent Vivier | d599938 | 2019-06-21 15:05:44 +0200 | [diff] [blame] | 6254 | # slirp is only required when building softmmu targets |
| 6255 | if test -z "$slirp" -a "$softmmu" != "yes" ; then |
| 6256 | slirp="no" |
| 6257 | fi |
| 6258 | |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6259 | case "$slirp" in |
| 6260 | "" | yes) |
| 6261 | if $pkg_config slirp; then |
| 6262 | slirp=system |
Marc-André Lureau | 7c57bdd8 | 2019-04-24 13:00:41 +0200 | [diff] [blame] | 6263 | elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then |
| 6264 | slirp=git |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6265 | elif test -e "${source_path}/slirp/Makefile" ; then |
| 6266 | slirp=internal |
| 6267 | elif test -z "$slirp" ; then |
| 6268 | slirp=no |
| 6269 | else |
| 6270 | feature_not_found "slirp" "Install slirp devel or git submodule" |
| 6271 | fi |
| 6272 | ;; |
| 6273 | |
| 6274 | system) |
| 6275 | if ! $pkg_config slirp; then |
| 6276 | feature_not_found "slirp" "Install slirp devel" |
| 6277 | fi |
| 6278 | ;; |
| 6279 | esac |
| 6280 | |
| 6281 | case "$slirp" in |
Marc-André Lureau | 7c57bdd8 | 2019-04-24 13:00:41 +0200 | [diff] [blame] | 6282 | git | internal) |
| 6283 | if test "$slirp" = git; then |
| 6284 | git_submodules="${git_submodules} slirp" |
| 6285 | fi |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6286 | mkdir -p slirp |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 6287 | slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src" |
| 6288 | slirp_libs="-L$PWD/slirp -lslirp" |
Paolo Bonzini | b965e8c | 2019-12-11 14:41:51 +0100 | [diff] [blame] | 6289 | if test "$mingw32" = "yes" ; then |
| 6290 | slirp_libs="$slirp_libs -lws2_32 -liphlpapi" |
| 6291 | fi |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6292 | ;; |
| 6293 | |
| 6294 | system) |
| 6295 | slirp_version=$($pkg_config --modversion slirp 2>/dev/null) |
| 6296 | slirp_cflags=$($pkg_config --cflags slirp 2>/dev/null) |
| 6297 | slirp_libs=$($pkg_config --libs slirp 2>/dev/null) |
| 6298 | ;; |
| 6299 | |
| 6300 | no) |
| 6301 | ;; |
| 6302 | *) |
| 6303 | error_exit "Unknown state for slirp: $slirp" |
| 6304 | ;; |
| 6305 | esac |
| 6306 | |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 6307 | ########################################## |
| 6308 | # check for usable __NR_keyctl syscall |
| 6309 | |
| 6310 | if test "$linux" = "yes" ; then |
| 6311 | |
| 6312 | have_keyring=no |
| 6313 | cat > $TMPC << EOF |
| 6314 | #include <errno.h> |
| 6315 | #include <asm/unistd.h> |
| 6316 | #include <linux/keyctl.h> |
| 6317 | #include <unistd.h> |
| 6318 | int main(void) { |
| 6319 | return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0); |
| 6320 | } |
| 6321 | EOF |
| 6322 | if compile_prog "" "" ; then |
| 6323 | have_keyring=yes |
| 6324 | fi |
| 6325 | fi |
| 6326 | if test "$secret_keyring" != "no" |
| 6327 | then |
David Edmondson | b418d26 | 2020-07-01 14:56:15 +0100 | [diff] [blame] | 6328 | if test "$have_keyring" = "yes" |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 6329 | then |
| 6330 | secret_keyring=yes |
| 6331 | else |
| 6332 | if test "$secret_keyring" = "yes" |
| 6333 | then |
| 6334 | error_exit "syscall __NR_keyctl requested, \ |
| 6335 | but not implemented on your system" |
| 6336 | else |
| 6337 | secret_keyring=no |
| 6338 | fi |
| 6339 | fi |
| 6340 | fi |
| 6341 | |
Alexey Krasikov | 9250036 | 2020-05-25 14:19:13 +0300 | [diff] [blame] | 6342 | ########################################## |
| 6343 | # check for usable keyutils.h |
| 6344 | |
| 6345 | if test "$linux" = "yes" ; then |
| 6346 | |
| 6347 | have_keyutils=no |
| 6348 | cat > $TMPC << EOF |
| 6349 | #include <errno.h> |
| 6350 | #include <asm/unistd.h> |
| 6351 | #include <unistd.h> |
| 6352 | #include <sys/types.h> |
| 6353 | #include <keyutils.h> |
| 6354 | int main(void) { |
| 6355 | return request_key("user", NULL, NULL, 0); |
| 6356 | } |
| 6357 | EOF |
| 6358 | if compile_prog "" "-lkeyutils"; then |
| 6359 | have_keyutils=yes |
| 6360 | fi |
| 6361 | fi |
| 6362 | |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6363 | |
| 6364 | ########################################## |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 6365 | # End of CC checks |
| 6366 | # After here, no more $cc or $ld runs |
| 6367 | |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 6368 | write_c_skeleton |
| 6369 | |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 6370 | if test "$gcov" = "yes" ; then |
Marc-André Lureau | bf0e56a | 2019-10-04 17:35:16 +0400 | [diff] [blame] | 6371 | : |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 6372 | elif test "$fortify_source" = "yes" ; then |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 6373 | QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" |
| 6374 | debug=no |
| 6375 | fi |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 6376 | if test "$debug_info" = "yes"; then |
| 6377 | CFLAGS="-g $CFLAGS" |
| 6378 | LDFLAGS="-g $LDFLAGS" |
| 6379 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 6380 | if test "$debug" = "no"; then |
| 6381 | CFLAGS="-O2 $CFLAGS" |
| 6382 | fi |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 6383 | |
| 6384 | case "$ARCH" in |
| 6385 | alpha) |
| 6386 | # Ensure there's only a single GP |
| 6387 | QEMU_CFLAGS="-msmall-data $QEMU_CFLAGS" |
| 6388 | ;; |
| 6389 | esac |
| 6390 | |
| 6391 | if test "$gprof" = "yes" ; then |
| 6392 | QEMU_CFLAGS="-p $QEMU_CFLAGS" |
| 6393 | QEMU_LDFLAGS="-p $QEMU_LDFLAGS" |
| 6394 | fi |
Juan Quintela | a316e37 | 2009-09-30 01:10:55 +0200 | [diff] [blame] | 6395 | |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6396 | if test "$have_asan" = "yes"; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 6397 | QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS" |
| 6398 | QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS" |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 6399 | if test "$have_asan_iface_h" = "no" ; then |
| 6400 | echo "ASAN build enabled, but ASAN header missing." \ |
| 6401 | "Without code annotation, the report may be inferior." |
| 6402 | elif test "$have_asan_iface_fiber" = "no" ; then |
| 6403 | echo "ASAN build enabled, but ASAN header is too old." \ |
| 6404 | "Without code annotation, the report may be inferior." |
| 6405 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6406 | fi |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 6407 | if test "$have_tsan" = "yes" ; then |
| 6408 | if test "$have_tsan_iface_fiber" = "yes" ; then |
| 6409 | QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS" |
| 6410 | QEMU_LDFLAGS="-fsanitize=thread $QEMU_LDFLAGS" |
| 6411 | else |
| 6412 | error_exit "Cannot enable TSAN due to missing fiber annotation interface." |
| 6413 | fi |
| 6414 | elif test "$tsan" = "yes" ; then |
| 6415 | error_exit "Cannot enable TSAN due to missing sanitize thread interface." |
| 6416 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6417 | if test "$have_ubsan" = "yes"; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 6418 | QEMU_CFLAGS="-fsanitize=undefined $QEMU_CFLAGS" |
| 6419 | QEMU_LDFLAGS="-fsanitize=undefined $QEMU_LDFLAGS" |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 6420 | fi |
| 6421 | |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 6422 | ########################################## |
| 6423 | # Do we have libnfs |
| 6424 | if test "$libnfs" != "no" ; then |
Peter Lieven | b7d769c | 2014-03-17 09:37:33 +0100 | [diff] [blame] | 6425 | if $pkg_config --atleast-version=1.9.3 libnfs; then |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 6426 | libnfs="yes" |
| 6427 | libnfs_libs=$($pkg_config --libs libnfs) |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 6428 | else |
| 6429 | if test "$libnfs" = "yes" ; then |
Hu Tao | 8efc936 | 2014-06-26 17:34:50 +0800 | [diff] [blame] | 6430 | feature_not_found "libnfs" "Install libnfs devel >= 1.9.3" |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 6431 | fi |
| 6432 | libnfs="no" |
| 6433 | fi |
| 6434 | fi |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 6435 | |
Tomáš Golembiovský | 3efac6e | 2018-10-23 13:23:10 +0200 | [diff] [blame] | 6436 | ########################################## |
| 6437 | # Do we have libudev |
| 6438 | if test "$libudev" != "no" ; then |
| 6439 | if $pkg_config libudev && test "$static" != "yes"; then |
| 6440 | libudev="yes" |
| 6441 | libudev_libs=$($pkg_config --libs libudev) |
| 6442 | else |
| 6443 | libudev="no" |
| 6444 | fi |
| 6445 | fi |
| 6446 | |
Peter Maydell | 6ca026c | 2012-07-18 15:10:18 +0100 | [diff] [blame] | 6447 | # Now we've finished running tests it's OK to add -Werror to the compiler flags |
| 6448 | if test "$werror" = "yes"; then |
| 6449 | QEMU_CFLAGS="-Werror $QEMU_CFLAGS" |
| 6450 | fi |
| 6451 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 6452 | # Exclude --warn-common with TSan to suppress warnings from the TSan libraries. |
| 6453 | if test "$solaris" = "no" && test "$tsan" = "no"; then |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 6454 | if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 6455 | QEMU_LDFLAGS="-Wl,--warn-common $QEMU_LDFLAGS" |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 6456 | fi |
| 6457 | fi |
| 6458 | |
Gerd Hoffmann | 94dd53c | 2012-03-29 10:55:18 +0200 | [diff] [blame] | 6459 | # test if pod2man has --utf8 option |
| 6460 | if pod2man --help | grep -q utf8; then |
| 6461 | POD2MAN="pod2man --utf8" |
| 6462 | else |
| 6463 | POD2MAN="pod2man" |
| 6464 | fi |
| 6465 | |
Blue Swirl | 952afb7 | 2010-09-19 08:36:34 +0000 | [diff] [blame] | 6466 | # Use ASLR, no-SEH and DEP if available |
| 6467 | if test "$mingw32" = "yes" ; then |
| 6468 | for flag in --dynamicbase --no-seh --nxcompat; do |
Christian Borntraeger | e9a3591 | 2017-08-23 12:16:23 +0200 | [diff] [blame] | 6469 | if ld_has $flag ; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 6470 | QEMU_LDFLAGS="-Wl,$flag $QEMU_LDFLAGS" |
Blue Swirl | 952afb7 | 2010-09-19 08:36:34 +0000 | [diff] [blame] | 6471 | fi |
| 6472 | done |
| 6473 | fi |
| 6474 | |
Philippe Mathieu-Daudé | 7776ea6 | 2019-03-07 15:28:22 +0100 | [diff] [blame] | 6475 | # Disable OpenBSD W^X if available |
| 6476 | if test "$tcg" = "yes" && test "$targetos" = "OpenBSD"; then |
| 6477 | cat > $TMPC <<EOF |
| 6478 | int main(void) { return 0; } |
| 6479 | EOF |
| 6480 | wx_ldflags="-Wl,-z,wxneeded" |
| 6481 | if compile_prog "" "$wx_ldflags"; then |
| 6482 | QEMU_LDFLAGS="$QEMU_LDFLAGS $wx_ldflags" |
| 6483 | fi |
| 6484 | fi |
| 6485 | |
Eduardo Habkost | 10ea68b | 2012-04-18 16:55:39 -0300 | [diff] [blame] | 6486 | qemu_confdir=$sysconfdir$confsuffix |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 6487 | qemu_moddir=$libdir$confsuffix |
Eduardo Habkost | 528ae5b | 2012-04-18 16:55:49 -0300 | [diff] [blame] | 6488 | qemu_datadir=$datadir$confsuffix |
Anthony Liguori | 834574e | 2013-02-20 07:43:24 -0600 | [diff] [blame] | 6489 | qemu_localedir="$datadir/locale" |
Daniel P. Berrangé | a8260d3 | 2019-01-10 12:00:45 +0000 | [diff] [blame] | 6490 | qemu_icondir="$datadir/icons" |
Daniel P. Berrangé | 67ea954 | 2019-01-10 12:00:46 +0000 | [diff] [blame] | 6491 | qemu_desktopdir="$datadir/applications" |
Paolo Bonzini | e7b45cc | 2010-05-26 16:08:20 +0200 | [diff] [blame] | 6492 | |
Kamil Rytarowski | e058034 | 2017-07-14 09:33:44 +0100 | [diff] [blame] | 6493 | # We can only support ivshmem if we have eventfd |
| 6494 | if [ "$eventfd" = "yes" ]; then |
| 6495 | ivshmem=yes |
| 6496 | fi |
| 6497 | |
Daniel P. Berrange | 4b1c11f | 2012-09-10 12:26:29 +0100 | [diff] [blame] | 6498 | if test "$softmmu" = yes ; then |
Paolo Bonzini | b855f8d | 2017-08-22 06:50:18 +0200 | [diff] [blame] | 6499 | if test "$linux" = yes; then |
Paolo Bonzini | 7e46261 | 2019-11-29 12:16:32 +0100 | [diff] [blame] | 6500 | if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then |
Andreas Färber | aabfd88 | 2012-05-01 01:12:02 +0200 | [diff] [blame] | 6501 | virtfs=yes |
Andreas Färber | aabfd88 | 2012-05-01 01:12:02 +0200 | [diff] [blame] | 6502 | else |
| 6503 | if test "$virtfs" = yes; then |
Paolo Bonzini | 7e46261 | 2019-11-29 12:16:32 +0100 | [diff] [blame] | 6504 | error_exit "VirtFS requires libcap-ng devel and libattr devel" |
Meador Inge | 983eef5 | 2012-02-24 14:00:42 +0530 | [diff] [blame] | 6505 | fi |
Andreas Färber | 1750037 | 2012-05-01 01:12:03 +0200 | [diff] [blame] | 6506 | virtfs=no |
Andreas Färber | aabfd88 | 2012-05-01 01:12:02 +0200 | [diff] [blame] | 6507 | fi |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 6508 | if test "$mpath" != no && test "$mpathpersist" = yes ; then |
| 6509 | mpath=yes |
| 6510 | else |
| 6511 | if test "$mpath" = yes; then |
| 6512 | error_exit "Multipath requires libmpathpersist devel" |
| 6513 | fi |
| 6514 | mpath=no |
| 6515 | fi |
Paolo Bonzini | b855f8d | 2017-08-22 06:50:18 +0200 | [diff] [blame] | 6516 | else |
| 6517 | if test "$virtfs" = yes; then |
| 6518 | error_exit "VirtFS is supported only on Linux" |
| 6519 | fi |
| 6520 | virtfs=no |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 6521 | if test "$mpath" = yes; then |
| 6522 | error_exit "Multipath is supported only on Linux" |
| 6523 | fi |
| 6524 | mpath=no |
M. Mohan Kumar | 17bff52 | 2011-12-14 13:58:42 +0530 | [diff] [blame] | 6525 | fi |
Gerd Hoffmann | 6a02153 | 2017-10-05 17:33:28 +0200 | [diff] [blame] | 6526 | fi |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6527 | |
| 6528 | # Probe for guest agent support/options |
| 6529 | |
Michael Tokarev | e8ef31a | 2013-07-31 14:22:07 +0400 | [diff] [blame] | 6530 | if [ "$guest_agent" != "no" ]; then |
Laurent Vivier | a512590 | 2019-04-01 16:12:20 +0200 | [diff] [blame] | 6531 | if [ "$softmmu" = no -a "$want_tools" = no ] ; then |
| 6532 | guest_agent=no |
| 6533 | elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then |
Michael Tokarev | e8ef31a | 2013-07-31 14:22:07 +0400 | [diff] [blame] | 6534 | guest_agent=yes |
| 6535 | elif [ "$guest_agent" != yes ]; then |
| 6536 | guest_agent=no |
| 6537 | else |
| 6538 | error_exit "Guest agent is not supported on this platform" |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 6539 | fi |
Paolo Bonzini | 00c705f | 2012-05-29 11:40:24 +0200 | [diff] [blame] | 6540 | fi |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 6541 | |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6542 | # Guest agent Window MSI package |
| 6543 | |
| 6544 | if test "$guest_agent" != yes; then |
| 6545 | if test "$guest_agent_msi" = yes; then |
| 6546 | error_exit "MSI guest agent package requires guest agent enabled" |
| 6547 | fi |
| 6548 | guest_agent_msi=no |
| 6549 | elif test "$mingw32" != "yes"; then |
| 6550 | if test "$guest_agent_msi" = "yes"; then |
| 6551 | error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation" |
| 6552 | fi |
| 6553 | guest_agent_msi=no |
| 6554 | elif ! has wixl; then |
| 6555 | if test "$guest_agent_msi" = "yes"; then |
| 6556 | error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )" |
| 6557 | fi |
| 6558 | guest_agent_msi=no |
Michael Roth | 1a34904 | 2015-08-26 11:14:31 -0500 | [diff] [blame] | 6559 | else |
| 6560 | # we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wasn't |
| 6561 | # disabled explicitly |
| 6562 | if test "$guest_agent_msi" != "no"; then |
| 6563 | guest_agent_msi=yes |
| 6564 | fi |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6565 | fi |
| 6566 | |
Michael Roth | 1a34904 | 2015-08-26 11:14:31 -0500 | [diff] [blame] | 6567 | if test "$guest_agent_msi" = "yes"; then |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6568 | if test "$guest_agent_with_vss" = "yes"; then |
| 6569 | QEMU_GA_MSI_WITH_VSS="-D InstallVss" |
| 6570 | fi |
| 6571 | |
| 6572 | if test "$QEMU_GA_MANUFACTURER" = ""; then |
| 6573 | QEMU_GA_MANUFACTURER=QEMU |
| 6574 | fi |
| 6575 | |
| 6576 | if test "$QEMU_GA_DISTRO" = ""; then |
| 6577 | QEMU_GA_DISTRO=Linux |
| 6578 | fi |
| 6579 | |
| 6580 | if test "$QEMU_GA_VERSION" = ""; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 6581 | QEMU_GA_VERSION=$(cat $source_path/VERSION) |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6582 | fi |
| 6583 | |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 6584 | QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=$($pkg_config --variable=prefix glib-2.0)/bin" |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 6585 | |
| 6586 | case "$cpu" in |
| 6587 | x86_64) |
| 6588 | QEMU_GA_MSI_ARCH="-a x64 -D Arch=64" |
| 6589 | ;; |
| 6590 | i386) |
| 6591 | QEMU_GA_MSI_ARCH="-D Arch=32" |
| 6592 | ;; |
| 6593 | *) |
| 6594 | error_exit "CPU $cpu not supported for building installation package" |
| 6595 | ;; |
| 6596 | esac |
| 6597 | fi |
| 6598 | |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 6599 | # Mac OS X ships with a broken assembler |
| 6600 | roms= |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 6601 | if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ |
| 6602 | test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \ |
| 6603 | test "$softmmu" = yes ; then |
Peter Maydell | e57218b | 2016-08-08 17:11:28 +0100 | [diff] [blame] | 6604 | # Different host OS linkers have different ideas about the name of the ELF |
Brad Smith | c65d5e4 | 2017-11-07 18:46:11 -0500 | [diff] [blame] | 6605 | # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd |
| 6606 | # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. |
| 6607 | for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do |
Peter Maydell | e57218b | 2016-08-08 17:11:28 +0100 | [diff] [blame] | 6608 | if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then |
| 6609 | ld_i386_emulation="$emu" |
| 6610 | roms="optionrom" |
| 6611 | break |
| 6612 | fi |
| 6613 | done |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 6614 | fi |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 6615 | |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 6616 | # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 |
Christian Borntraeger | 9933c30 | 2013-04-23 01:23:03 +0000 | [diff] [blame] | 6617 | if test "$cpu" = "s390x" ; then |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 6618 | write_c_skeleton |
| 6619 | if compile_prog "-march=z900" ""; then |
| 6620 | roms="$roms s390-ccw" |
Philippe Mathieu-Daudé | 1ef6bfc | 2020-06-15 09:49:19 +0200 | [diff] [blame] | 6621 | # SLOF is required for building the s390-ccw firmware on s390x, |
| 6622 | # since it is using the libnet code from SLOF for network booting. |
| 6623 | if test -e "${source_path}/.git" ; then |
| 6624 | git_submodules="${git_submodules} roms/SLOF" |
| 6625 | fi |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 6626 | fi |
Christian Borntraeger | 9933c30 | 2013-04-23 01:23:03 +0000 | [diff] [blame] | 6627 | fi |
| 6628 | |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 6629 | # Check that the C++ compiler exists and works with the C compiler. |
| 6630 | # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. |
| 6631 | if has $cxx; then |
| 6632 | cat > $TMPC <<EOF |
| 6633 | int c_function(void); |
| 6634 | int main(void) { return c_function(); } |
| 6635 | EOF |
| 6636 | |
| 6637 | compile_object |
| 6638 | |
| 6639 | cat > $TMPCXX <<EOF |
| 6640 | extern "C" { |
| 6641 | int c_function(void); |
| 6642 | } |
| 6643 | int c_function(void) { return 42; } |
| 6644 | EOF |
| 6645 | |
| 6646 | update_cxxflags |
| 6647 | |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 6648 | if do_cxx $CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 6649 | # C++ compiler $cxx works ok with C compiler $cc |
| 6650 | : |
| 6651 | else |
| 6652 | echo "C++ compiler $cxx does not work with C compiler $cc" |
| 6653 | echo "Disabling C++ specific optional code" |
| 6654 | cxx= |
| 6655 | fi |
| 6656 | else |
| 6657 | echo "No C++ compiler available; disabling C++ specific optional code" |
| 6658 | cxx= |
| 6659 | fi |
| 6660 | |
Cole Robinson | 02d34f6 | 2016-05-06 14:03:09 -0400 | [diff] [blame] | 6661 | echo_version() { |
| 6662 | if test "$1" = "yes" ; then |
| 6663 | echo "($2)" |
| 6664 | fi |
| 6665 | } |
| 6666 | |
Jan Kiszka | 50e1206 | 2014-10-02 10:03:55 +0200 | [diff] [blame] | 6667 | # prepend pixman and ftd flags after all config tests are done |
| 6668 | QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS" |
Philippe Mathieu-Daudé | 8a99e9a | 2018-04-15 20:05:19 -0300 | [diff] [blame] | 6669 | QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS" |
Gerd Hoffmann | 5ca9388 | 2012-11-07 11:06:23 +0100 | [diff] [blame] | 6670 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6671 | config_host_mak="config-host.mak" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 6672 | |
Stefan Weil | dbd99ae | 2013-01-01 18:33:44 +0100 | [diff] [blame] | 6673 | echo "# Automatically generated by configure - do not modify" >config-all-disas.mak |
| 6674 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6675 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6676 | echo >> $config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6677 | |
Paolo Bonzini | e6c3b0f | 2010-10-21 10:18:35 +0200 | [diff] [blame] | 6678 | echo all: >> $config_host_mak |
Paolo Bonzini | 99d7cc7 | 2010-05-26 16:08:24 +0200 | [diff] [blame] | 6679 | echo "prefix=$prefix" >> $config_host_mak |
| 6680 | echo "bindir=$bindir" >> $config_host_mak |
Alon Levy | 3aa5d2b | 2011-05-15 12:08:59 +0300 | [diff] [blame] | 6681 | echo "libdir=$libdir" >> $config_host_mak |
Michael Tokarev | 8bf188a | 2012-06-07 01:11:00 +0400 | [diff] [blame] | 6682 | echo "libexecdir=$libexecdir" >> $config_host_mak |
Alon Levy | 0f94d6d | 2011-06-27 11:58:20 +0200 | [diff] [blame] | 6683 | echo "includedir=$includedir" >> $config_host_mak |
Paolo Bonzini | 99d7cc7 | 2010-05-26 16:08:24 +0200 | [diff] [blame] | 6684 | echo "mandir=$mandir" >> $config_host_mak |
Paolo Bonzini | 99d7cc7 | 2010-05-26 16:08:24 +0200 | [diff] [blame] | 6685 | echo "sysconfdir=$sysconfdir" >> $config_host_mak |
Eduardo Habkost | 22d0703 | 2012-04-18 16:55:42 -0300 | [diff] [blame] | 6686 | echo "qemu_confdir=$qemu_confdir" >> $config_host_mak |
Eduardo Habkost | 9afa52c | 2012-04-18 16:55:46 -0300 | [diff] [blame] | 6687 | echo "qemu_datadir=$qemu_datadir" >> $config_host_mak |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 6688 | echo "qemu_firmwarepath=$firmwarepath" >> $config_host_mak |
Eduardo Habkost | 9afa52c | 2012-04-18 16:55:46 -0300 | [diff] [blame] | 6689 | echo "qemu_docdir=$qemu_docdir" >> $config_host_mak |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 6690 | echo "qemu_moddir=$qemu_moddir" >> $config_host_mak |
Laszlo Ersek | 5a699bb | 2013-05-18 06:31:50 +0200 | [diff] [blame] | 6691 | if test "$mingw32" = "no" ; then |
| 6692 | echo "qemu_localstatedir=$local_statedir" >> $config_host_mak |
| 6693 | fi |
Michael Tokarev | f354b1a | 2012-10-21 22:52:54 +0400 | [diff] [blame] | 6694 | echo "qemu_helperdir=$libexecdir" >> $config_host_mak |
Anthony Liguori | 834574e | 2013-02-20 07:43:24 -0600 | [diff] [blame] | 6695 | echo "qemu_localedir=$qemu_localedir" >> $config_host_mak |
Daniel P. Berrangé | a8260d3 | 2019-01-10 12:00:45 +0000 | [diff] [blame] | 6696 | echo "qemu_icondir=$qemu_icondir" >> $config_host_mak |
Daniel P. Berrangé | 67ea954 | 2019-01-10 12:00:46 +0000 | [diff] [blame] | 6697 | echo "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 6698 | echo "GIT=$git" >> $config_host_mak |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 6699 | echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak |
Daniel P. Berrange | f62bbee | 2017-10-26 13:52:26 +0100 | [diff] [blame] | 6700 | echo "GIT_UPDATE=$git_update" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 6701 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6702 | echo "ARCH=$ARCH" >> $config_host_mak |
Paolo Bonzini | 727e528 | 2013-04-17 16:26:43 +0200 | [diff] [blame] | 6703 | |
Paolo Bonzini | f349474 | 2019-01-23 14:56:17 +0800 | [diff] [blame] | 6704 | if test "$default_devices" = "yes" ; then |
| 6705 | echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak |
| 6706 | else |
| 6707 | echo "CONFIG_MINIKCONF_MODE=--allnoconfig" >> $config_host_mak |
| 6708 | fi |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 6709 | if test "$debug_tcg" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6710 | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 6711 | fi |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 6712 | if test "$strip_opt" = "yes" ; then |
Hollis Blanchard | 52ba784 | 2010-08-04 17:21:34 -0700 | [diff] [blame] | 6713 | echo "STRIP=${strip}" >> $config_host_mak |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 6714 | fi |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 6715 | if test "$bigendian" = "yes" ; then |
Juan Quintela | e2542fe | 2009-07-27 16:13:06 +0200 | [diff] [blame] | 6716 | echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 6717 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 6718 | if test "$mingw32" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6719 | echo "CONFIG_WIN32=y" >> $config_host_mak |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 6720 | rc_version=$(cat $source_path/VERSION) |
Blue Swirl | 9fe6de9 | 2010-09-26 16:07:57 +0000 | [diff] [blame] | 6721 | version_major=${rc_version%%.*} |
| 6722 | rc_version=${rc_version#*.} |
| 6723 | version_minor=${rc_version%%.*} |
| 6724 | rc_version=${rc_version#*.} |
| 6725 | version_subminor=${rc_version%%.*} |
| 6726 | version_micro=0 |
| 6727 | echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak |
| 6728 | echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 6729 | if test "$guest_agent_with_vss" = "yes" ; then |
| 6730 | echo "CONFIG_QGA_VSS=y" >> $config_host_mak |
Michael Roth | f33ca81 | 2015-08-26 16:19:41 -0500 | [diff] [blame] | 6731 | echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 6732 | echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak |
| 6733 | fi |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 6734 | if test "$guest_agent_ntddscsi" = "yes" ; then |
Tomáš Golembiovský | 76dc75c | 2018-10-23 13:23:16 +0200 | [diff] [blame] | 6735 | echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 6736 | fi |
Michael Roth | 1a34904 | 2015-08-26 11:14:31 -0500 | [diff] [blame] | 6737 | if test "$guest_agent_msi" = "yes"; then |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 6738 | echo "QEMU_GA_MSI_ENABLED=yes" >> $config_host_mak |
Yossi Hindin | 9dacf32 | 2015-05-06 14:57:40 +0300 | [diff] [blame] | 6739 | echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak |
| 6740 | echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak |
| 6741 | echo "QEMU_GA_MSI_ARCH=${QEMU_GA_MSI_ARCH}" >> $config_host_mak |
| 6742 | echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak |
| 6743 | echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak |
| 6744 | echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak |
| 6745 | fi |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 6746 | else |
Juan Quintela | 35f4df2 | 2009-07-27 16:13:07 +0200 | [diff] [blame] | 6747 | echo "CONFIG_POSIX=y" >> $config_host_mak |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 6748 | fi |
blueswir1 | 128ab2f | 2008-08-15 18:33:42 +0000 | [diff] [blame] | 6749 | |
Mark McLoughlin | dffcb71 | 2009-10-22 17:49:11 +0100 | [diff] [blame] | 6750 | if test "$linux" = "yes" ; then |
| 6751 | echo "CONFIG_LINUX=y" >> $config_host_mak |
| 6752 | fi |
| 6753 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 6754 | if test "$darwin" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6755 | echo "CONFIG_DARWIN=y" >> $config_host_mak |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 6756 | fi |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 6757 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 6758 | if test "$solaris" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6759 | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 6760 | fi |
Andreas Färber | 179cf40 | 2010-09-20 00:50:43 +0200 | [diff] [blame] | 6761 | if test "$haiku" = "yes" ; then |
| 6762 | echo "CONFIG_HAIKU=y" >> $config_host_mak |
| 6763 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 6764 | if test "$static" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6765 | echo "CONFIG_STATIC=y" >> $config_host_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 6766 | fi |
Stefan Weil | 1ba1696 | 2011-07-29 22:40:45 +0200 | [diff] [blame] | 6767 | if test "$profiler" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6768 | echo "CONFIG_PROFILER=y" >> $config_host_mak |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 6769 | fi |
Paolo Bonzini | c932ce3 | 2019-07-18 12:24:29 +0200 | [diff] [blame] | 6770 | if test "$want_tools" = "yes" ; then |
| 6771 | echo "CONFIG_TOOLS=y" >> $config_host_mak |
| 6772 | fi |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 6773 | if test "$guest_agent" = "yes" ; then |
| 6774 | echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak |
| 6775 | fi |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6776 | if test "$slirp" != "no"; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6777 | echo "CONFIG_SLIRP=y" >> $config_host_mak |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 6778 | echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 6779 | echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak |
| 6780 | echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak |
| 6781 | fi |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 6782 | subdirs= |
Marc-André Lureau | 7c57bdd8 | 2019-04-24 13:00:41 +0200 | [diff] [blame] | 6783 | if [ "$slirp" = "git" -o "$slirp" = "internal" ]; then |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 6784 | subdirs="$subdirs slirp" |
bellard | c20709a | 2004-04-21 23:27:19 +0000 | [diff] [blame] | 6785 | fi |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 6786 | if test "$vde" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6787 | echo "CONFIG_VDE=y" >> $config_host_mak |
Fam Zheng | e2ad6f1 | 2017-09-07 16:35:52 +0800 | [diff] [blame] | 6788 | echo "VDE_LIBS=$vde_libs" >> $config_host_mak |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 6789 | fi |
Vincenzo Maffione | 5895213 | 2013-11-06 11:44:06 +0100 | [diff] [blame] | 6790 | if test "$netmap" = "yes" ; then |
| 6791 | echo "CONFIG_NETMAP=y" >> $config_host_mak |
| 6792 | fi |
Gonglei | 015a33b | 2014-07-01 20:58:08 +0800 | [diff] [blame] | 6793 | if test "$l2tpv3" = "yes" ; then |
| 6794 | echo "CONFIG_L2TPV3=y" >> $config_host_mak |
| 6795 | fi |
Paolo Bonzini | 4cc600d | 2020-02-04 17:11:04 +0100 | [diff] [blame] | 6796 | if test "$gprof" = "yes" ; then |
| 6797 | echo "CONFIG_GPROF=y" >> $config_host_mak |
| 6798 | fi |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 6799 | if test "$cap_ng" = "yes" ; then |
Paolo Bonzini | a358bca | 2019-11-29 11:42:53 +0100 | [diff] [blame] | 6800 | echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak |
Paolo Bonzini | 3f99cf5 | 2020-02-05 09:45:39 +0100 | [diff] [blame] | 6801 | echo "LIBCAP_NG_LIBS=$cap_libs" >> $config_host_mak |
Corey Bryant | 47e9865 | 2012-01-26 09:42:26 -0500 | [diff] [blame] | 6802 | fi |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6803 | echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 6804 | for drv in $audio_drv_list; do |
Gerd Hoffmann | 1ef1ec2 | 2018-03-01 11:05:46 +0100 | [diff] [blame] | 6805 | def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]') |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 6806 | echo "$def=y" >> $config_host_mak |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 6807 | done |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 6808 | if test "$alsa" = "yes" ; then |
| 6809 | echo "CONFIG_ALSA=y" >> $config_host_mak |
| 6810 | fi |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 6811 | echo "ALSA_LIBS=$alsa_libs" >> $config_host_mak |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 6812 | echo "ALSA_CFLAGS=$alsa_cflags" >> $config_host_mak |
| 6813 | if test "$libpulse" = "yes" ; then |
| 6814 | echo "CONFIG_LIBPULSE=y" >> $config_host_mak |
| 6815 | fi |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 6816 | echo "PULSE_LIBS=$pulse_libs" >> $config_host_mak |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 6817 | echo "PULSE_CFLAGS=$pulse_cflags" >> $config_host_mak |
Fam Zheng | b114991 | 2017-09-07 16:29:13 +0800 | [diff] [blame] | 6818 | echo "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak |
| 6819 | echo "DSOUND_LIBS=$dsound_libs" >> $config_host_mak |
| 6820 | echo "OSS_LIBS=$oss_libs" >> $config_host_mak |
Paolo Bonzini | 478e943 | 2020-08-17 12:47:55 +0200 | [diff] [blame] | 6821 | if test "$libjack" = "yes" ; then |
| 6822 | echo "CONFIG_LIBJACK=y" >> $config_host_mak |
| 6823 | fi |
Geoffrey McRae | 2e44570 | 2020-04-29 15:53:58 +1000 | [diff] [blame] | 6824 | echo "JACK_LIBS=$jack_libs" >> $config_host_mak |
malc | d563163 | 2009-10-10 01:13:41 +0400 | [diff] [blame] | 6825 | if test "$audio_win_int" = "yes" ; then |
| 6826 | echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak |
| 6827 | fi |
Fam Zheng | b64ec4e | 2013-05-29 19:35:40 +0800 | [diff] [blame] | 6828 | echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak |
| 6829 | echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak |
Gerd Hoffmann | 6a02153 | 2017-10-05 17:33:28 +0200 | [diff] [blame] | 6830 | if test "$xkbcommon" = "yes" ; then |
Marc-André Lureau | ade60d4 | 2019-07-15 14:48:31 +0400 | [diff] [blame] | 6831 | echo "CONFIG_XKBCOMMON=y" >> $config_host_mak |
Gerd Hoffmann | 6a02153 | 2017-10-05 17:33:28 +0200 | [diff] [blame] | 6832 | echo "XKBCOMMON_CFLAGS=$xkbcommon_cflags" >> $config_host_mak |
| 6833 | echo "XKBCOMMON_LIBS=$xkbcommon_libs" >> $config_host_mak |
| 6834 | fi |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 6835 | if test "$xfs" = "yes" ; then |
| 6836 | echo "CONFIG_XFS=y" >> $config_host_mak |
| 6837 | fi |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 6838 | qemu_version=$(head $source_path/VERSION) |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6839 | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6840 | echo "SRC_PATH=$source_path" >> $config_host_mak |
Alex Bennée | 2b1f35b | 2018-07-04 07:30:11 +0100 | [diff] [blame] | 6841 | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
Juan Quintela | a25dba1 | 2009-08-12 18:29:52 +0200 | [diff] [blame] | 6842 | if [ "$docs" = "yes" ] ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6843 | echo "BUILD_DOCS=yes" >> $config_host_mak |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 6844 | fi |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 6845 | if test "$modules" = "yes"; then |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 6846 | # $shacmd can generate a hash started with digit, which the compiler doesn't |
| 6847 | # like as an symbol. So prefix it with an underscore |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 6848 | echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 6849 | echo "CONFIG_MODULES=y" >> $config_host_mak |
| 6850 | fi |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 6851 | if test "$module_upgrades" = "yes"; then |
| 6852 | echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak |
| 6853 | fi |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 6854 | if test "$have_x11" = "yes" && test "$need_x11" = "yes"; then |
Gerd Hoffmann | 8781595 | 2018-03-01 11:05:42 +0100 | [diff] [blame] | 6855 | echo "CONFIG_X11=y" >> $config_host_mak |
| 6856 | echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak |
| 6857 | echo "X11_LIBS=$x11_libs" >> $config_host_mak |
| 6858 | fi |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 6859 | if test "$cocoa" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6860 | echo "CONFIG_COCOA=y" >> $config_host_mak |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 6861 | fi |
Samuel Thibault | e08bb30 | 2019-03-11 14:51:26 +0100 | [diff] [blame] | 6862 | if test "$iconv" = "yes" ; then |
| 6863 | echo "CONFIG_ICONV=y" >> $config_host_mak |
| 6864 | echo "ICONV_CFLAGS=$iconv_cflags" >> $config_host_mak |
| 6865 | echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak |
| 6866 | fi |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 6867 | if test "$curses" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 6868 | echo "CONFIG_CURSES=y" >> $config_host_mak |
Gerd Hoffmann | 2373f7d | 2018-03-01 11:05:45 +0100 | [diff] [blame] | 6869 | echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak |
| 6870 | echo "CURSES_LIBS=$curses_lib" >> $config_host_mak |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 6871 | fi |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 6872 | if test "$pipe2" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6873 | echo "CONFIG_PIPE2=y" >> $config_host_mak |
Riku Voipio | 099d6b0 | 2009-05-05 12:10:04 +0300 | [diff] [blame] | 6874 | fi |
Kevin Wolf | 40ff6d7 | 2009-12-02 12:24:42 +0100 | [diff] [blame] | 6875 | if test "$accept4" = "yes" ; then |
| 6876 | echo "CONFIG_ACCEPT4=y" >> $config_host_mak |
| 6877 | fi |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 6878 | if test "$splice" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6879 | echo "CONFIG_SPLICE=y" >> $config_host_mak |
vibisreenivasan | 3ce34df | 2009-05-16 18:32:41 +0530 | [diff] [blame] | 6880 | fi |
Riku Voipio | c2882b9 | 2009-08-12 15:08:24 +0300 | [diff] [blame] | 6881 | if test "$eventfd" = "yes" ; then |
| 6882 | echo "CONFIG_EVENTFD=y" >> $config_host_mak |
| 6883 | fi |
Marc-André Lureau | 751bcc3 | 2015-10-09 17:17:16 +0200 | [diff] [blame] | 6884 | if test "$memfd" = "yes" ; then |
| 6885 | echo "CONFIG_MEMFD=y" >> $config_host_mak |
| 6886 | fi |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 6887 | if test "$have_usbfs" = "yes" ; then |
| 6888 | echo "CONFIG_USBFS=y" >> $config_host_mak |
| 6889 | fi |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 6890 | if test "$fallocate" = "yes" ; then |
| 6891 | echo "CONFIG_FALLOCATE=y" >> $config_host_mak |
| 6892 | fi |
Kusanagi Kouichi | 3d4fa43 | 2013-01-14 16:26:52 +0100 | [diff] [blame] | 6893 | if test "$fallocate_punch_hole" = "yes" ; then |
| 6894 | echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak |
| 6895 | fi |
Denis V. Lunev | b953f07 | 2015-01-30 11:42:14 +0300 | [diff] [blame] | 6896 | if test "$fallocate_zero_range" = "yes" ; then |
| 6897 | echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak |
| 6898 | fi |
Kevin Wolf | ed91143 | 2014-09-29 17:12:59 +0200 | [diff] [blame] | 6899 | if test "$posix_fallocate" = "yes" ; then |
| 6900 | echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak |
| 6901 | fi |
Peter Maydell | c727f47 | 2011-01-06 11:05:10 +0000 | [diff] [blame] | 6902 | if test "$sync_file_range" = "yes" ; then |
| 6903 | echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak |
| 6904 | fi |
Peter Maydell | dace20d | 2011-01-10 13:11:24 +0000 | [diff] [blame] | 6905 | if test "$fiemap" = "yes" ; then |
| 6906 | echo "CONFIG_FIEMAP=y" >> $config_host_mak |
| 6907 | fi |
Ulrich Hecht | d092793 | 2009-09-17 20:22:14 +0300 | [diff] [blame] | 6908 | if test "$dup3" = "yes" ; then |
| 6909 | echo "CONFIG_DUP3=y" >> $config_host_mak |
| 6910 | fi |
Alex Bligh | 4e0c652 | 2013-08-21 16:02:43 +0100 | [diff] [blame] | 6911 | if test "$ppoll" = "yes" ; then |
| 6912 | echo "CONFIG_PPOLL=y" >> $config_host_mak |
| 6913 | fi |
Alex Bligh | cd758dd | 2013-08-21 16:02:44 +0100 | [diff] [blame] | 6914 | if test "$prctl_pr_set_timerslack" = "yes" ; then |
| 6915 | echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak |
| 6916 | fi |
Peter Maydell | 3b6edd1 | 2011-02-15 18:35:05 +0000 | [diff] [blame] | 6917 | if test "$epoll" = "yes" ; then |
| 6918 | echo "CONFIG_EPOLL=y" >> $config_host_mak |
| 6919 | fi |
| 6920 | if test "$epoll_create1" = "yes" ; then |
| 6921 | echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak |
| 6922 | fi |
Peter Maydell | a8fd1ab | 2013-02-08 07:31:55 +0000 | [diff] [blame] | 6923 | if test "$sendfile" = "yes" ; then |
| 6924 | echo "CONFIG_SENDFILE=y" >> $config_host_mak |
| 6925 | fi |
Riku Voipio | 5183434 | 2014-06-22 11:25:42 +0100 | [diff] [blame] | 6926 | if test "$timerfd" = "yes" ; then |
| 6927 | echo "CONFIG_TIMERFD=y" >> $config_host_mak |
| 6928 | fi |
Riku Voipio | 9af5c90 | 2014-08-12 15:58:57 +0300 | [diff] [blame] | 6929 | if test "$setns" = "yes" ; then |
| 6930 | echo "CONFIG_SETNS=y" >> $config_host_mak |
| 6931 | fi |
Aleksandar Markovic | 38860a0 | 2016-10-10 13:23:29 +0200 | [diff] [blame] | 6932 | if test "$clock_adjtime" = "yes" ; then |
| 6933 | echo "CONFIG_CLOCK_ADJTIME=y" >> $config_host_mak |
| 6934 | fi |
Aleksandar Markovic | 5a03cd0 | 2016-10-10 13:23:30 +0200 | [diff] [blame] | 6935 | if test "$syncfs" = "yes" ; then |
| 6936 | echo "CONFIG_SYNCFS=y" >> $config_host_mak |
| 6937 | fi |
Aleksandar Markovic | db37dd8 | 2020-01-16 23:49:49 +0100 | [diff] [blame] | 6938 | if test "$kcov" = "yes" ; then |
| 6939 | echo "CONFIG_KCOV=y" >> $config_host_mak |
| 6940 | fi |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 6941 | if test "$inotify" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 6942 | echo "CONFIG_INOTIFY=y" >> $config_host_mak |
aurel32 | 3b3f24a | 2009-04-15 16:12:13 +0000 | [diff] [blame] | 6943 | fi |
Riku Voipio | c05c7a7 | 2010-03-26 15:25:11 +0000 | [diff] [blame] | 6944 | if test "$inotify1" = "yes" ; then |
| 6945 | echo "CONFIG_INOTIFY1=y" >> $config_host_mak |
| 6946 | fi |
Peter Maydell | 401bc05 | 2017-09-05 13:19:32 +0100 | [diff] [blame] | 6947 | if test "$sem_timedwait" = "yes" ; then |
| 6948 | echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak |
| 6949 | fi |
Keno Fischer | 5c99fa3 | 2018-06-29 12:32:10 +0200 | [diff] [blame] | 6950 | if test "$strchrnul" = "yes" ; then |
| 6951 | echo "HAVE_STRCHRNUL=y" >> $config_host_mak |
| 6952 | fi |
Jiufei Xue | 8a792b0 | 2019-04-17 03:08:56 +0800 | [diff] [blame] | 6953 | if test "$st_atim" = "yes" ; then |
| 6954 | echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak |
| 6955 | fi |
Juan Quintela | 6ae9a1f | 2009-08-03 14:45:58 +0200 | [diff] [blame] | 6956 | if test "$byteswap_h" = "yes" ; then |
| 6957 | echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak |
| 6958 | fi |
| 6959 | if test "$bswap_h" = "yes" ; then |
| 6960 | echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak |
| 6961 | fi |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 6962 | if test "$curl" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 6963 | echo "CONFIG_CURL=y" >> $config_host_mak |
Juan Quintela | b1d5a27 | 2009-08-03 14:46:05 +0200 | [diff] [blame] | 6964 | echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak |
Fam Zheng | 6ebc91e | 2014-02-10 14:48:54 +0800 | [diff] [blame] | 6965 | echo "CURL_LIBS=$curl_libs" >> $config_host_mak |
Alexander Graf | 769ce76 | 2009-05-11 17:41:42 +0200 | [diff] [blame] | 6966 | fi |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 6967 | if test "$brlapi" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 6968 | echo "CONFIG_BRLAPI=y" >> $config_host_mak |
Fam Zheng | 8eca288 | 2017-09-07 16:47:00 +0800 | [diff] [blame] | 6969 | echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 6970 | fi |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 6971 | if test "$gtk" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 6972 | echo "CONFIG_GTK=y" >> $config_host_mak |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 6973 | echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak |
Gerd Hoffmann | 014cb15 | 2015-12-03 12:56:34 +0100 | [diff] [blame] | 6974 | echo "GTK_LIBS=$gtk_libs" >> $config_host_mak |
Gerd Hoffmann | 925a040 | 2015-05-26 12:26:21 +0200 | [diff] [blame] | 6975 | if test "$gtk_gl" = "yes" ; then |
| 6976 | echo "CONFIG_GTK_GL=y" >> $config_host_mak |
| 6977 | fi |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 6978 | fi |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 6979 | if test "$gio" = "yes" ; then |
| 6980 | echo "CONFIG_GIO=y" >> $config_host_mak |
| 6981 | echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak |
| 6982 | echo "GIO_LIBS=$gio_libs" >> $config_host_mak |
Marc-André Lureau | 25a97a5 | 2019-09-27 11:34:42 +0400 | [diff] [blame] | 6983 | echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 6984 | fi |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 6985 | echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 6986 | if test "$gnutls" = "yes" ; then |
| 6987 | echo "CONFIG_GNUTLS=y" >> $config_host_mak |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 6988 | echo "GNUTLS_CFLAGS=$gnutls_cflags" >> $config_host_mak |
| 6989 | echo "GNUTLS_LIBS=$gnutls_libs" >> $config_host_mak |
Daniel P. Berrange | ddbb0d0 | 2015-07-01 18:10:29 +0100 | [diff] [blame] | 6990 | fi |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 6991 | if test "$gcrypt" = "yes" ; then |
| 6992 | echo "CONFIG_GCRYPT=y" >> $config_host_mak |
Longpeng(Mike) | 1f923c7 | 2016-12-13 18:42:55 +0800 | [diff] [blame] | 6993 | if test "$gcrypt_hmac" = "yes" ; then |
| 6994 | echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak |
| 6995 | fi |
Daniel P. Berrange | 62893b6 | 2015-07-01 18:10:33 +0100 | [diff] [blame] | 6996 | fi |
Daniel P. Berrange | 91bfcdb | 2015-10-16 16:36:53 +0100 | [diff] [blame] | 6997 | if test "$nettle" = "yes" ; then |
| 6998 | echo "CONFIG_NETTLE=y" >> $config_host_mak |
Radim Krčmář | becaeb7 | 2015-07-10 19:18:00 +0200 | [diff] [blame] | 6999 | echo "CONFIG_NETTLE_VERSION_MAJOR=${nettle_version%%.*}" >> $config_host_mak |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 7000 | echo "NETTLE_CFLAGS=$nettle_cflags" >> $config_host_mak |
| 7001 | echo "NETTLE_LIBS=$nettle_libs" >> $config_host_mak |
Daniel P. Berrange | ed75474 | 2015-07-01 18:10:34 +0100 | [diff] [blame] | 7002 | fi |
Daniel P. Berrangé | e057694 | 2019-10-14 17:28:27 +0100 | [diff] [blame] | 7003 | if test "$qemu_private_xts" = "yes" ; then |
| 7004 | echo "CONFIG_QEMU_PRIVATE_XTS=y" >> $config_host_mak |
| 7005 | fi |
Daniel P. Berrange | 9a2fd43 | 2015-04-13 14:01:39 +0100 | [diff] [blame] | 7006 | if test "$tasn1" = "yes" ; then |
| 7007 | echo "CONFIG_TASN1=y" >> $config_host_mak |
| 7008 | fi |
Daniel P. Berrange | 8953caf | 2016-07-27 14:13:56 +0100 | [diff] [blame] | 7009 | if test "$auth_pam" = "yes" ; then |
| 7010 | echo "CONFIG_AUTH_PAM=y" >> $config_host_mak |
| 7011 | fi |
Daniel P. Berrange | 559607e | 2015-02-27 16:19:33 +0000 | [diff] [blame] | 7012 | if test "$have_ifaddrs_h" = "yes" ; then |
| 7013 | echo "HAVE_IFADDRS_H=y" >> $config_host_mak |
| 7014 | fi |
Chen Gang | e865b97 | 2020-06-05 09:32:21 +0800 | [diff] [blame] | 7015 | if test "$have_drm_h" = "yes" ; then |
| 7016 | echo "HAVE_DRM_H=y" >> $config_host_mak |
| 7017 | fi |
Eric Blake | 6b39b06 | 2016-10-11 10:46:23 -0500 | [diff] [blame] | 7018 | if test "$have_broken_size_max" = "yes" ; then |
| 7019 | echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak |
| 7020 | fi |
Thomas Huth | 9df8b20 | 2020-06-29 14:13:24 +0200 | [diff] [blame] | 7021 | if test "$have_openpty" = "yes" ; then |
| 7022 | echo "HAVE_OPENPTY=y" >> $config_host_mak |
| 7023 | fi |
David CARLIER | 2a4b472 | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 7024 | if test "$have_sys_signal_h" = "yes" ; then |
| 7025 | echo "HAVE_SYS_SIGNAL_H=y" >> $config_host_mak |
| 7026 | fi |
Jan Vesely | 277abf1 | 2016-04-29 13:15:23 -0400 | [diff] [blame] | 7027 | |
| 7028 | # Work around a system header bug with some kernel/XFS header |
| 7029 | # versions where they both try to define 'struct fsxattr': |
| 7030 | # xfs headers will not try to redefine structs from linux headers |
| 7031 | # if this macro is set. |
| 7032 | if test "$have_fsxattr" = "yes" ; then |
| 7033 | echo "HAVE_FSXATTR=y" >> $config_host_mak |
| 7034 | fi |
Fam Zheng | 1efad06 | 2018-06-01 17:26:43 +0800 | [diff] [blame] | 7035 | if test "$have_copy_file_range" = "yes" ; then |
| 7036 | echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak |
| 7037 | fi |
Stefan Weil | bbbf9bf | 2014-02-19 07:04:34 +0100 | [diff] [blame] | 7038 | if test "$vte" = "yes" ; then |
| 7039 | echo "CONFIG_VTE=y" >> $config_host_mak |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 7040 | echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak |
Gerd Hoffmann | e0fb129 | 2018-03-01 11:05:44 +0100 | [diff] [blame] | 7041 | echo "VTE_LIBS=$vte_libs" >> $config_host_mak |
Anthony Liguori | a4ccabc | 2013-02-20 07:43:20 -0600 | [diff] [blame] | 7042 | fi |
Gerd Hoffmann | 9d9e152 | 2014-07-11 12:51:43 +0200 | [diff] [blame] | 7043 | if test "$virglrenderer" = "yes" ; then |
| 7044 | echo "CONFIG_VIRGL=y" >> $config_host_mak |
| 7045 | echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak |
| 7046 | echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak |
| 7047 | fi |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 7048 | if test "$xen" = "yes" ; then |
Jan Kiszka | 6dbd588 | 2011-06-21 22:59:07 +0200 | [diff] [blame] | 7049 | echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 7050 | echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 7051 | echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak |
| 7052 | echo "XEN_LIBS=$xen_libs" >> $config_host_mak |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 7053 | fi |
Christoph Hellwig | 5c6c3a6 | 2009-08-20 16:58:35 +0200 | [diff] [blame] | 7054 | if test "$linux_aio" = "yes" ; then |
| 7055 | echo "CONFIG_LINUX_AIO=y" >> $config_host_mak |
| 7056 | fi |
Aarushi Mehta | c10dd85 | 2020-01-20 14:18:44 +0000 | [diff] [blame] | 7057 | if test "$linux_io_uring" = "yes" ; then |
| 7058 | echo "CONFIG_LINUX_IO_URING=y" >> $config_host_mak |
| 7059 | echo "LINUX_IO_URING_CFLAGS=$linux_io_uring_cflags" >> $config_host_mak |
| 7060 | echo "LINUX_IO_URING_LIBS=$linux_io_uring_libs" >> $config_host_mak |
| 7061 | fi |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 7062 | if test "$attr" = "yes" ; then |
| 7063 | echo "CONFIG_ATTR=y" >> $config_host_mak |
Marc-André Lureau | ec0d589 | 2019-07-15 15:04:49 +0400 | [diff] [blame] | 7064 | echo "LIBATTR_LIBS=$libattr_libs" >> $config_host_mak |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 7065 | fi |
Avi Kivity | 4f26f2b | 2011-11-09 14:44:52 +0200 | [diff] [blame] | 7066 | if test "$libattr" = "yes" ; then |
| 7067 | echo "CONFIG_LIBATTR=y" >> $config_host_mak |
| 7068 | fi |
Meador Inge | 983eef5 | 2012-02-24 14:00:42 +0530 | [diff] [blame] | 7069 | if test "$virtfs" = "yes" ; then |
| 7070 | echo "CONFIG_VIRTFS=y" >> $config_host_mak |
Venkateswararao Jujjuri (JV) | 758e8e3 | 2010-06-14 13:34:41 -0700 | [diff] [blame] | 7071 | fi |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 7072 | if test "$mpath" = "yes" ; then |
| 7073 | echo "CONFIG_MPATH=y" >> $config_host_mak |
Murilo Opsfelder Araujo | 1b0578f | 2018-08-10 11:11:16 -0300 | [diff] [blame] | 7074 | if test "$mpathpersist_new_api" = "yes"; then |
| 7075 | echo "CONFIG_MPATH_NEW_API=y" >> $config_host_mak |
| 7076 | fi |
Paolo Bonzini | fe8fc5a | 2017-08-22 06:50:55 +0200 | [diff] [blame] | 7077 | fi |
Nicholas Bellinger | 5e9be92 | 2013-03-29 01:08:16 +0000 | [diff] [blame] | 7078 | if test "$vhost_scsi" = "yes" ; then |
| 7079 | echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak |
| 7080 | fi |
Paolo Bonzini | af3bba7 | 2019-02-14 18:35:52 +0100 | [diff] [blame] | 7081 | if test "$vhost_net" = "yes" ; then |
| 7082 | echo "CONFIG_VHOST_NET=y" >> $config_host_mak |
| 7083 | fi |
| 7084 | if test "$vhost_net_user" = "yes" ; then |
Paolo Bonzini | 56f41de | 2019-02-14 18:35:49 +0100 | [diff] [blame] | 7085 | echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak |
Nikolay Nikolaev | 03ce574 | 2014-06-10 13:02:16 +0300 | [diff] [blame] | 7086 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 7087 | if test "$vhost_net_vdpa" = "yes" ; then |
| 7088 | echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak |
| 7089 | fi |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 7090 | if test "$vhost_crypto" = "yes" ; then |
| 7091 | echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak |
| 7092 | fi |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 7093 | if test "$vhost_vsock" = "yes" ; then |
| 7094 | echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak |
Stefano Garzarella | 5fe97d8 | 2020-05-22 14:25:11 +0200 | [diff] [blame] | 7095 | if test "$vhost_user" = "yes" ; then |
| 7096 | echo "CONFIG_VHOST_USER_VSOCK=y" >> $config_host_mak |
| 7097 | fi |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 7098 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 7099 | if test "$vhost_kernel" = "yes" ; then |
| 7100 | echo "CONFIG_VHOST_KERNEL=y" >> $config_host_mak |
| 7101 | fi |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 7102 | if test "$vhost_user" = "yes" ; then |
| 7103 | echo "CONFIG_VHOST_USER=y" >> $config_host_mak |
| 7104 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 7105 | if test "$vhost_vdpa" = "yes" ; then |
| 7106 | echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak |
| 7107 | fi |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 7108 | if test "$vhost_user_fs" = "yes" ; then |
| 7109 | echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak |
| 7110 | fi |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 7111 | if test "$blobs" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 7112 | echo "INSTALL_BLOBS=yes" >> $config_host_mak |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 7113 | fi |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 7114 | if test "$iovec" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 7115 | echo "CONFIG_IOVEC=y" >> $config_host_mak |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 7116 | fi |
aliguori | ceb42de | 2009-04-07 18:43:28 +0000 | [diff] [blame] | 7117 | if test "$preadv" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 7118 | echo "CONFIG_PREADV=y" >> $config_host_mak |
aliguori | ceb42de | 2009-04-07 18:43:28 +0000 | [diff] [blame] | 7119 | fi |
Philippe Mathieu-Daudé | e3971d6 | 2018-04-15 20:05:20 -0300 | [diff] [blame] | 7120 | if test "$fdt" != "no" ; then |
Juan Quintela | 3f0855b | 2009-07-27 16:12:52 +0200 | [diff] [blame] | 7121 | echo "CONFIG_FDT=y" >> $config_host_mak |
Paolo Bonzini | 4a96337 | 2020-08-03 16:22:28 +0200 | [diff] [blame] | 7122 | echo "FDT_CFLAGS=$fdt_cflags" >> $config_host_mak |
| 7123 | echo "FDT_LIBS=$fdt_ldflags $fdt_libs" >> $config_host_mak |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 7124 | fi |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 7125 | if test "$membarrier" = "yes" ; then |
| 7126 | echo "CONFIG_MEMBARRIER=y" >> $config_host_mak |
| 7127 | fi |
Marcelo Tosatti | dcc38d1 | 2010-10-11 15:31:15 -0300 | [diff] [blame] | 7128 | if test "$signalfd" = "yes" ; then |
| 7129 | echo "CONFIG_SIGNALFD=y" >> $config_host_mak |
| 7130 | fi |
Richard W.M. Jones | d339d76 | 2019-01-18 10:11:14 +0000 | [diff] [blame] | 7131 | if test "$optreset" = "yes" ; then |
| 7132 | echo "HAVE_OPTRESET=y" >> $config_host_mak |
| 7133 | fi |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 7134 | if test "$tcg" = "yes"; then |
| 7135 | echo "CONFIG_TCG=y" >> $config_host_mak |
| 7136 | if test "$tcg_interpreter" = "yes" ; then |
| 7137 | echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak |
| 7138 | fi |
Stefan Weil | 9195b2c | 2011-10-19 07:07:18 +0200 | [diff] [blame] | 7139 | fi |
Blue Swirl | 5f6b9e8 | 2009-09-20 06:56:26 +0000 | [diff] [blame] | 7140 | if test "$fdatasync" = "yes" ; then |
| 7141 | echo "CONFIG_FDATASYNC=y" >> $config_host_mak |
| 7142 | fi |
Andreas Färber | e78815a | 2010-09-25 11:26:05 +0000 | [diff] [blame] | 7143 | if test "$madvise" = "yes" ; then |
| 7144 | echo "CONFIG_MADVISE=y" >> $config_host_mak |
| 7145 | fi |
| 7146 | if test "$posix_madvise" = "yes" ; then |
| 7147 | echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak |
| 7148 | fi |
Andreas Gustafsson | 9bc5a71 | 2018-01-04 19:39:36 +0200 | [diff] [blame] | 7149 | if test "$posix_memalign" = "yes" ; then |
| 7150 | echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak |
| 7151 | fi |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 7152 | if test "$zlib" != "no" ; then |
| 7153 | echo "CONFIG_ZLIB=y" >> $config_host_mak |
| 7154 | echo "ZLIB_CFLAGS=$zlib_cflags" >> $config_host_mak |
| 7155 | echo "ZLIB_LIBS=$zlib_libs" >> $config_host_mak |
| 7156 | fi |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 7157 | if test "$spice" = "yes" ; then |
| 7158 | echo "CONFIG_SPICE=y" >> $config_host_mak |
Paolo Bonzini | 2634733 | 2019-07-29 15:40:07 +0200 | [diff] [blame] | 7159 | echo "SPICE_CFLAGS=$spice_cflags" >> $config_host_mak |
| 7160 | echo "SPICE_LIBS=$spice_libs" >> $config_host_mak |
Gerd Hoffmann | cd4ec0b | 2010-03-24 10:26:51 +0100 | [diff] [blame] | 7161 | fi |
| 7162 | |
Marc-André Lureau | 7b02f54 | 2015-08-30 11:48:40 +0200 | [diff] [blame] | 7163 | if test "$smartcard" = "yes" ; then |
| 7164 | echo "CONFIG_SMARTCARD=y" >> $config_host_mak |
Fam Zheng | 7b62bf5 | 2017-09-07 16:29:16 +0800 | [diff] [blame] | 7165 | echo "SMARTCARD_CFLAGS=$libcacard_cflags" >> $config_host_mak |
| 7166 | echo "SMARTCARD_LIBS=$libcacard_libs" >> $config_host_mak |
Robert Relyea | 111a38b | 2010-11-28 16:36:38 +0200 | [diff] [blame] | 7167 | fi |
| 7168 | |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 7169 | if test "$libusb" = "yes" ; then |
| 7170 | echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak |
Fam Zheng | b878b65 | 2017-09-07 16:29:17 +0800 | [diff] [blame] | 7171 | echo "LIBUSB_CFLAGS=$libusb_cflags" >> $config_host_mak |
| 7172 | echo "LIBUSB_LIBS=$libusb_libs" >> $config_host_mak |
Gerd Hoffmann | 2b2325f | 2012-11-30 16:02:11 +0100 | [diff] [blame] | 7173 | fi |
| 7174 | |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 7175 | if test "$usb_redir" = "yes" ; then |
| 7176 | echo "CONFIG_USB_REDIR=y" >> $config_host_mak |
Fam Zheng | cc7923f | 2017-09-07 16:29:18 +0800 | [diff] [blame] | 7177 | echo "USB_REDIR_CFLAGS=$usb_redir_cflags" >> $config_host_mak |
| 7178 | echo "USB_REDIR_LIBS=$usb_redir_libs" >> $config_host_mak |
Hans de Goede | 69354a8 | 2011-07-19 11:04:10 +0200 | [diff] [blame] | 7179 | fi |
| 7180 | |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 7181 | if test "$opengl" = "yes" ; then |
| 7182 | echo "CONFIG_OPENGL=y" >> $config_host_mak |
| 7183 | echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak |
Gerd Hoffmann | 014cb15 | 2015-12-03 12:56:34 +0100 | [diff] [blame] | 7184 | if test "$opengl_dmabuf" = "yes" ; then |
| 7185 | echo "CONFIG_OPENGL_DMABUF=y" >> $config_host_mak |
| 7186 | fi |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 7187 | fi |
| 7188 | |
Marc-André Lureau | d52c454 | 2019-05-24 15:09:42 +0200 | [diff] [blame] | 7189 | if test "$gbm" = "yes" ; then |
| 7190 | echo "CONFIG_GBM=y" >> $config_host_mak |
| 7191 | echo "GBM_LIBS=$gbm_libs" >> $config_host_mak |
| 7192 | echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak |
| 7193 | fi |
| 7194 | |
| 7195 | |
Yang Zhong | 5a22ab7 | 2017-12-20 21:16:46 +0800 | [diff] [blame] | 7196 | if test "$malloc_trim" = "yes" ; then |
| 7197 | echo "CONFIG_MALLOC_TRIM=y" >> $config_host_mak |
| 7198 | fi |
| 7199 | |
Liang Li | 99f2dbd | 2016-03-08 13:53:16 +0800 | [diff] [blame] | 7200 | if test "$avx2_opt" = "yes" ; then |
| 7201 | echo "CONFIG_AVX2_OPT=y" >> $config_host_mak |
| 7202 | fi |
| 7203 | |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 7204 | if test "$avx512f_opt" = "yes" ; then |
| 7205 | echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak |
| 7206 | fi |
| 7207 | |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 7208 | if test "$lzo" = "yes" ; then |
| 7209 | echo "CONFIG_LZO=y" >> $config_host_mak |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 7210 | echo "LZO_LIBS=$lzo_libs" >> $config_host_mak |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 7211 | fi |
| 7212 | |
| 7213 | if test "$snappy" = "yes" ; then |
| 7214 | echo "CONFIG_SNAPPY=y" >> $config_host_mak |
Marc-André Lureau | 708eab4 | 2019-09-03 16:59:33 +0400 | [diff] [blame] | 7215 | echo "SNAPPY_LIBS=$snappy_libs" >> $config_host_mak |
qiaonuohan | 607dacd | 2014-02-18 14:11:30 +0800 | [diff] [blame] | 7216 | fi |
| 7217 | |
Peter Wu | 6b383c0 | 2015-01-06 18:48:14 +0100 | [diff] [blame] | 7218 | if test "$bzip2" = "yes" ; then |
| 7219 | echo "CONFIG_BZIP2=y" >> $config_host_mak |
| 7220 | echo "BZIP2_LIBS=-lbz2" >> $config_host_mak |
| 7221 | fi |
| 7222 | |
Julio Faracco | 83bc1f9 | 2018-11-05 13:08:04 -0200 | [diff] [blame] | 7223 | if test "$lzfse" = "yes" ; then |
| 7224 | echo "CONFIG_LZFSE=y" >> $config_host_mak |
| 7225 | echo "LZFSE_LIBS=-llzfse" >> $config_host_mak |
| 7226 | fi |
| 7227 | |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 7228 | if test "$zstd" = "yes" ; then |
| 7229 | echo "CONFIG_ZSTD=y" >> $config_host_mak |
Marc-André Lureau | 5e5733e | 2019-08-29 22:34:43 +0400 | [diff] [blame] | 7230 | echo "ZSTD_CFLAGS=$zstd_cflags" >> $config_host_mak |
| 7231 | echo "ZSTD_LIBS=$zstd_libs" >> $config_host_mak |
Juan Quintela | 3a67848 | 2019-12-17 21:15:24 +0100 | [diff] [blame] | 7232 | fi |
| 7233 | |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 7234 | if test "$libiscsi" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7235 | echo "CONFIG_LIBISCSI=y" >> $config_host_mak |
Fam Zheng | 6ebc91e | 2014-02-10 14:48:54 +0800 | [diff] [blame] | 7236 | echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak |
| 7237 | echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak |
Ronnie Sahlberg | c589b24 | 2011-10-25 19:24:24 +1100 | [diff] [blame] | 7238 | fi |
| 7239 | |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 7240 | if test "$libnfs" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7241 | echo "CONFIG_LIBNFS=y" >> $config_host_mak |
Colin Lord | 4be4879 | 2016-08-12 09:27:04 -0400 | [diff] [blame] | 7242 | echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 7243 | fi |
| 7244 | |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 7245 | if test "$seccomp" = "yes"; then |
| 7246 | echo "CONFIG_SECCOMP=y" >> $config_host_mak |
Fam Zheng | c3883e1 | 2017-09-07 16:53:16 +0800 | [diff] [blame] | 7247 | echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak |
| 7248 | echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak |
Eduardo Otubo | f794573 | 2012-08-14 18:44:05 -0300 | [diff] [blame] | 7249 | fi |
| 7250 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 7251 | # XXX: suppress that |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 7252 | if [ "$bsd" = "yes" ] ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 7253 | echo "CONFIG_BSD=y" >> $config_host_mak |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 7254 | fi |
| 7255 | |
Daniel P. Berrange | 4d9310f | 2015-09-22 15:13:26 +0100 | [diff] [blame] | 7256 | if test "$localtime_r" = "yes" ; then |
| 7257 | echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak |
| 7258 | fi |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 7259 | if test "$qom_cast_debug" = "yes" ; then |
| 7260 | echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak |
| 7261 | fi |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 7262 | if test "$rbd" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7263 | echo "CONFIG_RBD=y" >> $config_host_mak |
Fam Zheng | 6ebc91e | 2014-02-10 14:48:54 +0800 | [diff] [blame] | 7264 | echo "RBD_LIBS=$rbd_libs" >> $config_host_mak |
Christian Brunner | f27aaf4 | 2010-12-06 20:53:01 +0100 | [diff] [blame] | 7265 | fi |
Anthony Liguori | 20ff6c8 | 2009-12-09 12:59:36 -0600 | [diff] [blame] | 7266 | |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 7267 | echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 7268 | if test "$coroutine_pool" = "yes" ; then |
| 7269 | echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak |
| 7270 | else |
| 7271 | echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak |
| 7272 | fi |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 7273 | |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 7274 | if test "$debug_stack_usage" = "yes" ; then |
| 7275 | echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak |
| 7276 | fi |
| 7277 | |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 7278 | if test "$crypto_afalg" = "yes" ; then |
| 7279 | echo "CONFIG_AF_ALG=y" >> $config_host_mak |
| 7280 | fi |
| 7281 | |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 7282 | if test "$open_by_handle_at" = "yes" ; then |
| 7283 | echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak |
| 7284 | fi |
| 7285 | |
Harsh Prateek Bora | e06a765 | 2011-10-12 19:11:25 +0530 | [diff] [blame] | 7286 | if test "$linux_magic_h" = "yes" ; then |
| 7287 | echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak |
| 7288 | fi |
| 7289 | |
Kevin Wolf | 3f4349d | 2012-06-29 13:40:27 +0200 | [diff] [blame] | 7290 | if test "$valgrind_h" = "yes" ; then |
| 7291 | echo "CONFIG_VALGRIND_H=y" >> $config_host_mak |
| 7292 | fi |
| 7293 | |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 7294 | if test "$have_asan_iface_fiber" = "yes" ; then |
| 7295 | echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak |
| 7296 | fi |
| 7297 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 7298 | if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then |
| 7299 | echo "CONFIG_TSAN=y" >> $config_host_mak |
| 7300 | fi |
| 7301 | |
Luiz Capitulino | 8ab1bf1 | 2012-05-23 15:48:04 -0300 | [diff] [blame] | 7302 | if test "$has_environ" = "yes" ; then |
| 7303 | echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak |
| 7304 | fi |
| 7305 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 7306 | if test "$cpuid_h" = "yes" ; then |
| 7307 | echo "CONFIG_CPUID_H=y" >> $config_host_mak |
| 7308 | fi |
| 7309 | |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 7310 | if test "$int128" = "yes" ; then |
| 7311 | echo "CONFIG_INT128=y" >> $config_host_mak |
| 7312 | fi |
| 7313 | |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 7314 | if test "$atomic128" = "yes" ; then |
| 7315 | echo "CONFIG_ATOMIC128=y" >> $config_host_mak |
| 7316 | fi |
| 7317 | |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 7318 | if test "$cmpxchg128" = "yes" ; then |
| 7319 | echo "CONFIG_CMPXCHG128=y" >> $config_host_mak |
| 7320 | fi |
| 7321 | |
Richard Henderson | df79b99 | 2016-09-02 12:23:57 -0700 | [diff] [blame] | 7322 | if test "$atomic64" = "yes" ; then |
| 7323 | echo "CONFIG_ATOMIC64=y" >> $config_host_mak |
| 7324 | fi |
| 7325 | |
Richard Henderson | db8aaae | 2019-10-13 16:12:19 -0700 | [diff] [blame] | 7326 | if test "$attralias" = "yes" ; then |
| 7327 | echo "CONFIG_ATTRIBUTE_ALIAS=y" >> $config_host_mak |
| 7328 | fi |
| 7329 | |
Richard Henderson | 1e6e9ac | 2013-02-18 09:11:15 -0800 | [diff] [blame] | 7330 | if test "$getauxval" = "yes" ; then |
| 7331 | echo "CONFIG_GETAUXVAL=y" >> $config_host_mak |
| 7332 | fi |
| 7333 | |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 7334 | if test "$glusterfs" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7335 | echo "CONFIG_GLUSTERFS=y" >> $config_host_mak |
Fam Zheng | 6ebc91e | 2014-02-10 14:48:54 +0800 | [diff] [blame] | 7336 | echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak |
| 7337 | echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak |
Bharata B Rao | eb10039 | 2012-09-24 14:42:45 +0530 | [diff] [blame] | 7338 | fi |
| 7339 | |
Jeff Cody | d85fa9e | 2016-04-05 10:40:09 -0400 | [diff] [blame] | 7340 | if test "$glusterfs_xlator_opt" = "yes" ; then |
| 7341 | echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak |
| 7342 | fi |
| 7343 | |
Bharata B Rao | 0c14fb4 | 2013-07-16 21:47:42 +0530 | [diff] [blame] | 7344 | if test "$glusterfs_discard" = "yes" ; then |
| 7345 | echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak |
| 7346 | fi |
| 7347 | |
Niels de Vos | df3a429 | 2017-05-28 12:01:14 +0530 | [diff] [blame] | 7348 | if test "$glusterfs_fallocate" = "yes" ; then |
| 7349 | echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak |
| 7350 | fi |
| 7351 | |
Bharata B Rao | 7c81537 | 2013-12-21 14:51:25 +0530 | [diff] [blame] | 7352 | if test "$glusterfs_zerofill" = "yes" ; then |
| 7353 | echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak |
| 7354 | fi |
| 7355 | |
Prasanna Kumar Kalever | e014dbe | 2019-03-05 16:46:33 +0100 | [diff] [blame] | 7356 | if test "$glusterfs_ftruncate_has_stat" = "yes" ; then |
| 7357 | echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak |
| 7358 | fi |
| 7359 | |
Niels de Vos | 0e3b891 | 2019-03-05 16:46:34 +0100 | [diff] [blame] | 7360 | if test "$glusterfs_iocb_has_stat" = "yes" ; then |
| 7361 | echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak |
| 7362 | fi |
| 7363 | |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 7364 | if test "$libssh" = "yes" ; then |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7365 | echo "CONFIG_LIBSSH=y" >> $config_host_mak |
Pino Toscano | b10d49d | 2019-06-20 22:08:40 +0200 | [diff] [blame] | 7366 | echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak |
| 7367 | echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak |
Richard W.M. Jones | 0a12ec8 | 2013-04-09 15:30:53 +0100 | [diff] [blame] | 7368 | fi |
| 7369 | |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 7370 | if test "$live_block_migration" = "yes" ; then |
| 7371 | echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak |
| 7372 | fi |
| 7373 | |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 7374 | if test "$tpm" = "yes"; then |
Paolo Bonzini | 3cae16d | 2019-07-11 19:08:36 +0200 | [diff] [blame] | 7375 | echo 'CONFIG_TPM=y' >> $config_host_mak |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 7376 | fi |
| 7377 | |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 7378 | echo "TRACE_BACKENDS=$trace_backends" >> $config_host_mak |
| 7379 | if have_backend "nop"; then |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7380 | echo "CONFIG_TRACE_NOP=y" >> $config_host_mak |
Prerna Saxena | 22890ab | 2010-06-24 17:04:53 +0530 | [diff] [blame] | 7381 | fi |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 7382 | if have_backend "simple"; then |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7383 | echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak |
| 7384 | # Set the appropriate trace file. |
Andreas Färber | 953ffe0 | 2011-06-02 19:58:06 +0200 | [diff] [blame] | 7385 | trace_file="\"$trace_file-\" FMT_pid" |
Prerna Saxena | 9410b56 | 2010-07-13 09:26:32 +0100 | [diff] [blame] | 7386 | fi |
Paolo Bonzini | ed7f5f1 | 2016-01-07 16:55:30 +0300 | [diff] [blame] | 7387 | if have_backend "log"; then |
| 7388 | echo "CONFIG_TRACE_LOG=y" >> $config_host_mak |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7389 | fi |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 7390 | if have_backend "ust"; then |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7391 | echo "CONFIG_TRACE_UST=y" >> $config_host_mak |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 7392 | echo "LTTNG_UST_LIBS=$lttng_ust_libs" >> $config_host_mak |
| 7393 | echo "URCU_BP_LIBS=$urcu_bp_libs" >> $config_host_mak |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7394 | fi |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 7395 | if have_backend "dtrace"; then |
Lluís | 6d8a764 | 2011-08-31 20:30:43 +0200 | [diff] [blame] | 7396 | echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak |
| 7397 | if test "$trace_backend_stap" = "yes" ; then |
| 7398 | echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak |
| 7399 | fi |
Daniel P. Berrange | c276b17 | 2010-11-12 13:20:25 +0000 | [diff] [blame] | 7400 | fi |
Lluís Vilanova | 5b80827 | 2014-05-27 15:02:14 +0200 | [diff] [blame] | 7401 | if have_backend "ftrace"; then |
Eiichi Tsukata | 781e954 | 2013-04-11 20:25:15 +0900 | [diff] [blame] | 7402 | if test "$linux" = "yes" ; then |
| 7403 | echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak |
Eiichi Tsukata | 781e954 | 2013-04-11 20:25:15 +0900 | [diff] [blame] | 7404 | else |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 7405 | feature_not_found "ftrace(trace backend)" "ftrace requires Linux" |
Eiichi Tsukata | 781e954 | 2013-04-11 20:25:15 +0900 | [diff] [blame] | 7406 | fi |
| 7407 | fi |
Paul Durrant | 0a85241 | 2016-08-04 14:44:14 +0100 | [diff] [blame] | 7408 | if have_backend "syslog"; then |
| 7409 | if test "$posix_syslog" = "yes" ; then |
| 7410 | echo "CONFIG_TRACE_SYSLOG=y" >> $config_host_mak |
| 7411 | else |
| 7412 | feature_not_found "syslog(trace backend)" "syslog not available" |
| 7413 | fi |
| 7414 | fi |
Prerna Saxena | 9410b56 | 2010-07-13 09:26:32 +0100 | [diff] [blame] | 7415 | echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak |
| 7416 | |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 7417 | if test "$rdma" = "yes" ; then |
| 7418 | echo "CONFIG_RDMA=y" >> $config_host_mak |
Fam Zheng | 392fb64 | 2017-09-07 16:42:30 +0800 | [diff] [blame] | 7419 | echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 7420 | fi |
| 7421 | |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 7422 | if test "$pvrdma" = "yes" ; then |
| 7423 | echo "CONFIG_PVRDMA=y" >> $config_host_mak |
| 7424 | fi |
| 7425 | |
Laurent Vivier | 575b22b | 2016-06-02 22:14:15 +0200 | [diff] [blame] | 7426 | if test "$have_rtnetlink" = "yes" ; then |
| 7427 | echo "CONFIG_RTNETLINK=y" >> $config_host_mak |
| 7428 | fi |
| 7429 | |
Klim Kireev | ed279a0 | 2018-01-12 12:01:19 +0300 | [diff] [blame] | 7430 | if test "$libxml2" = "yes" ; then |
| 7431 | echo "CONFIG_LIBXML2=y" >> $config_host_mak |
| 7432 | echo "LIBXML2_CFLAGS=$libxml2_cflags" >> $config_host_mak |
| 7433 | echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak |
| 7434 | fi |
| 7435 | |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 7436 | if test "$replication" = "yes" ; then |
| 7437 | echo "CONFIG_REPLICATION=y" >> $config_host_mak |
| 7438 | fi |
| 7439 | |
Stefan Hajnoczi | 6a02c80 | 2016-10-14 10:00:55 +0100 | [diff] [blame] | 7440 | if test "$have_af_vsock" = "yes" ; then |
| 7441 | echo "CONFIG_AF_VSOCK=y" >> $config_host_mak |
| 7442 | fi |
| 7443 | |
Christopher Covington | 4d04351 | 2016-12-28 15:04:33 -0500 | [diff] [blame] | 7444 | if test "$have_sysmacros" = "yes" ; then |
| 7445 | echo "CONFIG_SYSMACROS=y" >> $config_host_mak |
| 7446 | fi |
| 7447 | |
Andreas Grapentin | 49e00a1 | 2017-03-14 17:59:53 +0100 | [diff] [blame] | 7448 | if test "$have_static_assert" = "yes" ; then |
| 7449 | echo "CONFIG_STATIC_ASSERT=y" >> $config_host_mak |
| 7450 | fi |
| 7451 | |
Tomáš Golembiovský | e674605 | 2017-07-17 15:58:33 +0200 | [diff] [blame] | 7452 | if test "$have_utmpx" = "yes" ; then |
| 7453 | echo "HAVE_UTMPX=y" >> $config_host_mak |
| 7454 | fi |
Richard Henderson | db1ed1a | 2019-03-13 20:57:28 -0700 | [diff] [blame] | 7455 | if test "$have_getrandom" = "yes" ; then |
| 7456 | echo "CONFIG_GETRANDOM=y" >> $config_host_mak |
| 7457 | fi |
Kamil Rytarowski | e058034 | 2017-07-14 09:33:44 +0100 | [diff] [blame] | 7458 | if test "$ivshmem" = "yes" ; then |
| 7459 | echo "CONFIG_IVSHMEM=y" >> $config_host_mak |
| 7460 | fi |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 7461 | if test "$capstone" != "no" ; then |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 7462 | echo "CONFIG_CAPSTONE=y" >> $config_host_mak |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 7463 | echo "CAPSTONE_CFLAGS=$capstone_cflags" >> $config_host_mak |
| 7464 | echo "CAPSTONE_LIBS=$capstone_libs" >> $config_host_mak |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 7465 | fi |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 7466 | if test "$debug_mutex" = "yes" ; then |
| 7467 | echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak |
| 7468 | fi |
Kamil Rytarowski | e058034 | 2017-07-14 09:33:44 +0100 | [diff] [blame] | 7469 | |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 7470 | # Hold two types of flag: |
| 7471 | # CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on |
| 7472 | # a thread we have a handle to |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 7473 | # CONFIG_PTHREAD_SETNAME_NP_W_TID - A way of doing it on a particular |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 7474 | # platform |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 7475 | if test "$pthread_setname_np_w_tid" = "yes" ; then |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 7476 | echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak |
Roman Bolshakov | 479a574 | 2018-12-17 23:26:01 +0300 | [diff] [blame] | 7477 | echo "CONFIG_PTHREAD_SETNAME_NP_W_TID=y" >> $config_host_mak |
| 7478 | elif test "$pthread_setname_np_wo_tid" = "yes" ; then |
| 7479 | echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak |
| 7480 | echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak |
Dr. David Alan Gilbert | 5c31207 | 2014-03-12 11:48:18 +0000 | [diff] [blame] | 7481 | fi |
| 7482 | |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 7483 | if test "$libpmem" = "yes" ; then |
| 7484 | echo "CONFIG_LIBPMEM=y" >> $config_host_mak |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 7485 | echo "LIBPMEM_LIBS=$libpmem_libs" >> $config_host_mak |
| 7486 | echo "LIBPMEM_CFLAGS=$libpmem_cflags" >> $config_host_mak |
Junyan He | 1782440 | 2018-07-18 15:47:59 +0800 | [diff] [blame] | 7487 | fi |
| 7488 | |
Jingqi Liu | 21b2eca | 2020-04-29 16:50:11 +0800 | [diff] [blame] | 7489 | if test "$libdaxctl" = "yes" ; then |
| 7490 | echo "CONFIG_LIBDAXCTL=y" >> $config_host_mak |
| 7491 | fi |
| 7492 | |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 7493 | if test "$bochs" = "yes" ; then |
| 7494 | echo "CONFIG_BOCHS=y" >> $config_host_mak |
| 7495 | fi |
| 7496 | if test "$cloop" = "yes" ; then |
| 7497 | echo "CONFIG_CLOOP=y" >> $config_host_mak |
| 7498 | fi |
| 7499 | if test "$dmg" = "yes" ; then |
| 7500 | echo "CONFIG_DMG=y" >> $config_host_mak |
| 7501 | fi |
| 7502 | if test "$qcow1" = "yes" ; then |
| 7503 | echo "CONFIG_QCOW1=y" >> $config_host_mak |
| 7504 | fi |
| 7505 | if test "$vdi" = "yes" ; then |
| 7506 | echo "CONFIG_VDI=y" >> $config_host_mak |
| 7507 | fi |
| 7508 | if test "$vvfat" = "yes" ; then |
| 7509 | echo "CONFIG_VVFAT=y" >> $config_host_mak |
| 7510 | fi |
| 7511 | if test "$qed" = "yes" ; then |
| 7512 | echo "CONFIG_QED=y" >> $config_host_mak |
| 7513 | fi |
| 7514 | if test "$parallels" = "yes" ; then |
| 7515 | echo "CONFIG_PARALLELS=y" >> $config_host_mak |
| 7516 | fi |
| 7517 | if test "$sheepdog" = "yes" ; then |
| 7518 | echo "CONFIG_SHEEPDOG=y" >> $config_host_mak |
| 7519 | fi |
David CARLIER | c9c8b88 | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 7520 | if test "$pty_h" = "yes" ; then |
| 7521 | echo "HAVE_PTY_H=y" >> $config_host_mak |
| 7522 | fi |
David CARLIER | 195588c | 2020-07-13 14:36:09 +0100 | [diff] [blame] | 7523 | if test "$have_mlockall" = "yes" ; then |
| 7524 | echo "HAVE_MLOCKALL=y" >> $config_host_mak |
| 7525 | fi |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 7526 | if test "$fuzzing" = "yes" ; then |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 7527 | QEMU_CFLAGS="$QEMU_CFLAGS -fsanitize=fuzzer-no-link" |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 7528 | fi |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 7529 | |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 7530 | if test "$plugins" = "yes" ; then |
| 7531 | echo "CONFIG_PLUGIN=y" >> $config_host_mak |
| 7532 | LIBS="-ldl $LIBS" |
Emilio G. Cota | 26fffe2 | 2018-10-21 13:56:29 -0400 | [diff] [blame] | 7533 | # Copy the export object list to the build dir |
| 7534 | if test "$ld_dynamic_list" = "yes" ; then |
| 7535 | echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak |
| 7536 | ld_symbols=qemu-plugins-ld.symbols |
| 7537 | cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols |
| 7538 | elif test "$ld_exported_symbols_list" = "yes" ; then |
| 7539 | echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak |
| 7540 | ld64_symbols=qemu-plugins-ld64.symbols |
| 7541 | echo "# Automatically generated by configure - do not modify" > $ld64_symbols |
| 7542 | grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' | \ |
| 7543 | sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols |
| 7544 | else |
| 7545 | error_exit \ |
| 7546 | "If \$plugins=yes, either \$ld_dynamic_list or " \ |
| 7547 | "\$ld_exported_symbols_list should have been set to 'yes'." |
| 7548 | fi |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 7549 | fi |
| 7550 | |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 7551 | if test -n "$gdb_bin" ; then |
| 7552 | echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak |
| 7553 | fi |
| 7554 | |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 7555 | if test "$secret_keyring" = "yes" ; then |
| 7556 | echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak |
Alexey Krasikov | 9250036 | 2020-05-25 14:19:13 +0300 | [diff] [blame] | 7557 | if test "$have_keyutils" = "yes" ; then |
| 7558 | echo "CONFIG_TEST_SECRET_KEYRING=y" >> $config_host_mak |
| 7559 | fi |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 7560 | fi |
| 7561 | |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7562 | if test "$tcg_interpreter" = "yes"; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7563 | QEMU_INCLUDES="-iquote ${source_path}/tcg/tci $QEMU_INCLUDES" |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7564 | elif test "$ARCH" = "sparc64" ; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7565 | QEMU_INCLUDES="-iquote ${source_path}/tcg/sparc $QEMU_INCLUDES" |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7566 | elif test "$ARCH" = "s390x" ; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7567 | QEMU_INCLUDES="-iquote ${source_path}/tcg/s390 $QEMU_INCLUDES" |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 7568 | elif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7569 | QEMU_INCLUDES="-iquote ${source_path}/tcg/i386 $QEMU_INCLUDES" |
Richard Henderson | 40d964b | 2014-04-30 14:07:47 -0700 | [diff] [blame] | 7570 | elif test "$ARCH" = "ppc64" ; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7571 | QEMU_INCLUDES="-iquote ${source_path}/tcg/ppc $QEMU_INCLUDES" |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 7572 | elif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7573 | QEMU_INCLUDES="-I${source_path}/tcg/riscv $QEMU_INCLUDES" |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7574 | else |
Paolo Bonzini | 2521144 | 2019-06-10 12:03:04 +0200 | [diff] [blame] | 7575 | QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES" |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7576 | fi |
Paolo Bonzini | 5b5e303 | 2013-04-17 16:26:35 +0200 | [diff] [blame] | 7577 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 7578 | echo "ROMS=$roms" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7579 | echo "MAKE=$make" >> $config_host_mak |
| 7580 | echo "INSTALL=$install" >> $config_host_mak |
Brad | 1901cb1 | 2011-08-28 04:01:33 -0400 | [diff] [blame] | 7581 | echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak |
| 7582 | echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak |
Michael Tokarev | e999ee4 | 2016-01-27 14:36:43 +0300 | [diff] [blame] | 7583 | echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak |
| 7584 | echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak |
Blue Swirl | c886edf | 2011-07-22 21:08:09 +0000 | [diff] [blame] | 7585 | echo "PYTHON=$python" >> $config_host_mak |
Peter Maydell | 2eb054c | 2020-02-13 17:56:18 +0000 | [diff] [blame] | 7586 | echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 7587 | echo "GENISOIMAGE=$genisoimage" >> $config_host_mak |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 7588 | echo "MESON=$meson" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7589 | echo "CC=$cc" >> $config_host_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 7590 | if $iasl -h > /dev/null 2>&1; then |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 7591 | echo "CONFIG_IASL=$iasl" >> $config_host_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 7592 | fi |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 7593 | echo "CXX=$cxx" >> $config_host_mak |
Peter Maydell | 3c4a4d0 | 2012-08-11 22:34:40 +0100 | [diff] [blame] | 7594 | echo "OBJCC=$objcc" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7595 | echo "AR=$ar" >> $config_host_mak |
Peter Maydell | 45d285a | 2013-10-21 21:03:06 +0100 | [diff] [blame] | 7596 | echo "ARFLAGS=$ARFLAGS" >> $config_host_mak |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 7597 | echo "AS=$as" >> $config_host_mak |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 7598 | echo "CCAS=$ccas" >> $config_host_mak |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 7599 | echo "CPP=$cpp" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7600 | echo "OBJCOPY=$objcopy" >> $config_host_mak |
| 7601 | echo "LD=$ld" >> $config_host_mak |
Alistair Francis | 9f81aeb | 2017-11-07 17:10:46 -0800 | [diff] [blame] | 7602 | echo "RANLIB=$ranlib" >> $config_host_mak |
Stefan Weil | 4852ee9 | 2014-09-18 21:55:08 +0200 | [diff] [blame] | 7603 | echo "NM=$nm" >> $config_host_mak |
Alex Bennée | daa79d9 | 2019-09-19 14:07:36 +0100 | [diff] [blame] | 7604 | echo "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak |
Blue Swirl | 9fe6de9 | 2010-09-26 16:07:57 +0000 | [diff] [blame] | 7605 | echo "WINDRES=$windres" >> $config_host_mak |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 7606 | echo "CFLAGS=$CFLAGS" >> $config_host_mak |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 7607 | echo "CXXFLAGS=$CXXFLAGS" >> $config_host_mak |
Brad | 46eef33 | 2013-12-10 19:49:08 -0500 | [diff] [blame] | 7608 | echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame] | 7609 | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 7610 | echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak |
Paolo Bonzini | f972894 | 2010-12-23 11:43:53 +0100 | [diff] [blame] | 7611 | echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 7612 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
| 7613 | echo "GLIB_LIBS=$glib_libs" >> $config_host_mak |
Paolo Bonzini | e39f006 | 2010-12-23 11:43:51 +0100 | [diff] [blame] | 7614 | if test "$sparse" = "yes" ; then |
Paolo Bonzini | 968b4db | 2020-02-03 14:45:33 +0100 | [diff] [blame] | 7615 | echo "SPARSE_CFLAGS = -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak |
Paolo Bonzini | e39f006 | 2010-12-23 11:43:51 +0100 | [diff] [blame] | 7616 | fi |
Philippe Mathieu-Daudé | 8a99e9a | 2018-04-15 20:05:19 -0300 | [diff] [blame] | 7617 | echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 7618 | echo "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak |
James Clarke | 6969ec6 | 2016-06-06 12:02:50 +0100 | [diff] [blame] | 7619 | echo "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak |
Peter Maydell | e57218b | 2016-08-08 17:11:28 +0100 | [diff] [blame] | 7620 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak |
Juan Quintela | 73da375 | 2009-08-03 14:46:26 +0200 | [diff] [blame] | 7621 | echo "LIBS+=$LIBS" >> $config_host_mak |
Juan Quintela | 3e2e0e6 | 2009-08-03 14:47:06 +0200 | [diff] [blame] | 7622 | echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak |
Daniel P. Berrange | 409437e | 2016-07-20 14:23:13 +0100 | [diff] [blame] | 7623 | echo "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7624 | echo "EXESUF=$EXESUF" >> $config_host_mak |
Paolo Bonzini | 484e2cc | 2019-12-12 13:30:36 +0100 | [diff] [blame] | 7625 | echo "HOST_DSOSUF=$HOST_DSOSUF" >> $config_host_mak |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 7626 | echo "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 7627 | echo "LIBS_QGA=$libs_qga" >> $config_host_mak |
Daniel P. Berrange | 9024603 | 2015-09-21 17:25:34 +0100 | [diff] [blame] | 7628 | echo "TASN1_LIBS=$tasn1_libs" >> $config_host_mak |
| 7629 | echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak |
Gerd Hoffmann | 94dd53c | 2012-03-29 10:55:18 +0200 | [diff] [blame] | 7630 | echo "POD2MAN=$POD2MAN" >> $config_host_mak |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 7631 | if test "$gcov" = "yes" ; then |
| 7632 | echo "CONFIG_GCOV=y" >> $config_host_mak |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 7633 | fi |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 7634 | |
Tomáš Golembiovský | 3efac6e | 2018-10-23 13:23:10 +0200 | [diff] [blame] | 7635 | if test "$libudev" != "no"; then |
| 7636 | echo "CONFIG_LIBUDEV=y" >> $config_host_mak |
| 7637 | echo "LIBUDEV_LIBS=$libudev_libs" >> $config_host_mak |
| 7638 | fi |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 7639 | if test "$fuzzing" != "no"; then |
| 7640 | echo "CONFIG_FUZZ=y" >> $config_host_mak |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 7641 | fi |
Tomáš Golembiovský | 3efac6e | 2018-10-23 13:23:10 +0200 | [diff] [blame] | 7642 | |
Philippe Mathieu-Daudé | 05dfa22 | 2019-11-08 12:45:30 +0100 | [diff] [blame] | 7643 | if test "$edk2_blobs" = "yes" ; then |
| 7644 | echo "DECOMPRESS_EDK2_BLOBS=y" >> $config_host_mak |
| 7645 | fi |
| 7646 | |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 7647 | if test "$rng_none" = "yes"; then |
| 7648 | echo "CONFIG_RNG_NONE=y" >> $config_host_mak |
| 7649 | fi |
| 7650 | |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7651 | # use included Linux headers |
| 7652 | if test "$linux" = "yes" ; then |
Andreas Färber | a307beb | 2012-06-14 15:14:33 +0000 | [diff] [blame] | 7653 | mkdir -p linux-headers |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7654 | case "$cpu" in |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 7655 | i386|x86_64|x32) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 7656 | linux_arch=x86 |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7657 | ;; |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 7658 | ppc|ppc64|ppc64le) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 7659 | linux_arch=powerpc |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7660 | ;; |
| 7661 | s390x) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 7662 | linux_arch=s390 |
| 7663 | ;; |
Claudio Fontana | 1f08031 | 2013-06-12 16:20:23 +0100 | [diff] [blame] | 7664 | aarch64) |
| 7665 | linux_arch=arm64 |
| 7666 | ;; |
Sanjay Lal | 222e7d1 | 2014-06-17 23:10:36 +0100 | [diff] [blame] | 7667 | mips64) |
| 7668 | linux_arch=mips |
| 7669 | ;; |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 7670 | *) |
| 7671 | # For most CPUs the kernel architecture name and QEMU CPU name match. |
| 7672 | linux_arch="$cpu" |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7673 | ;; |
| 7674 | esac |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 7675 | # For non-KVM architectures we will not have asm headers |
| 7676 | if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then |
| 7677 | symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm |
| 7678 | fi |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 7679 | fi |
| 7680 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 7681 | for target in $target_list; do |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7682 | target_dir="$target" |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7683 | config_target_mak=$target_dir/config-target.mak |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 7684 | target_name=$(echo $target | cut -d '-' -f 1) |
tony.nguyen@bt.com | 52bf977 | 2019-07-18 06:01:31 +0000 | [diff] [blame] | 7685 | target_aligned_only="no" |
| 7686 | case "$target_name" in |
| 7687 | alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) |
| 7688 | target_aligned_only="yes" |
| 7689 | ;; |
| 7690 | esac |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7691 | target_bigendian="no" |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7692 | case "$target_name" in |
Thomas Huth | a69dc53 | 2018-08-21 13:27:48 +0200 | [diff] [blame] | 7693 | armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) |
tony.nguyen@bt.com | 52bf977 | 2019-07-18 06:01:31 +0000 | [diff] [blame] | 7694 | target_bigendian="yes" |
Juan Quintela | ea2d6a3 | 2009-07-16 18:34:10 +0200 | [diff] [blame] | 7695 | ;; |
| 7696 | esac |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7697 | target_softmmu="no" |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 7698 | target_user_only="no" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 7699 | target_linux_user="no" |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 7700 | target_bsd_user="no" |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 7701 | case "$target" in |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7702 | ${target_name}-softmmu) |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 7703 | target_softmmu="yes" |
| 7704 | ;; |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7705 | ${target_name}-linux-user) |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 7706 | target_user_only="yes" |
| 7707 | target_linux_user="yes" |
| 7708 | ;; |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7709 | ${target_name}-bsd-user) |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 7710 | target_user_only="yes" |
| 7711 | target_bsd_user="yes" |
| 7712 | ;; |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 7713 | *) |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 7714 | error_exit "Target '$target' not recognised" |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 7715 | exit 1 |
| 7716 | ;; |
| 7717 | esac |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 7718 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7719 | mkdir -p $target_dir |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7720 | echo "# Automatically generated by configure - do not modify" > $config_target_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7721 | |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 7722 | bflt="no" |
Alex Bennée | ca759f9 | 2017-02-23 18:29:27 +0000 | [diff] [blame] | 7723 | mttcg="no" |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 7724 | interp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g") |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 7725 | gdb_xml_files="" |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 7726 | |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7727 | TARGET_ARCH="$target_name" |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7728 | TARGET_BASE_ARCH="" |
Juan Quintela | e6e91b9 | 2009-07-16 18:34:17 +0200 | [diff] [blame] | 7729 | TARGET_ABI_DIR="" |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7730 | TARGET_SYSTBL_ABI="" |
| 7731 | TARGET_SYSTBL="" |
Juan Quintela | e73aae6 | 2009-07-16 18:34:14 +0200 | [diff] [blame] | 7732 | |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7733 | case "$target_name" in |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7734 | i386) |
Emilio G. Cota | 0a7fa00 | 2018-08-13 20:52:26 -0400 | [diff] [blame] | 7735 | mttcg="yes" |
Doug Gale | 7b0f97b | 2019-01-24 00:34:57 -0330 | [diff] [blame] | 7736 | gdb_xml_files="i386-32bit.xml" |
Laurent Vivier | 2898811 | 2020-03-10 11:33:56 +0100 | [diff] [blame] | 7737 | TARGET_SYSTBL_ABI=i386 |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7738 | TARGET_SYSTBL=syscall_32.tbl |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7739 | ;; |
| 7740 | x86_64) |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7741 | TARGET_BASE_ARCH=i386 |
Laurent Vivier | 8d62f35 | 2020-03-10 11:33:57 +0100 | [diff] [blame] | 7742 | TARGET_SYSTBL_ABI=common,64 |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7743 | TARGET_SYSTBL=syscall_64.tbl |
Emilio G. Cota | 0a7fa00 | 2018-08-13 20:52:26 -0400 | [diff] [blame] | 7744 | mttcg="yes" |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7745 | gdb_xml_files="i386-64bit.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7746 | ;; |
| 7747 | alpha) |
Richard Henderson | 5ee4f3c | 2017-02-24 09:12:43 +1100 | [diff] [blame] | 7748 | mttcg="yes" |
Laurent Vivier | 6116aea | 2020-03-10 11:33:44 +0100 | [diff] [blame] | 7749 | TARGET_SYSTBL_ABI=common |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7750 | ;; |
| 7751 | arm|armeb) |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7752 | TARGET_ARCH=arm |
Laurent Vivier | 5bcb498 | 2020-03-10 11:33:50 +0100 | [diff] [blame] | 7753 | TARGET_SYSTBL_ABI=common,oabi |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7754 | bflt="yes" |
Alex Bennée | ca759f9 | 2017-02-23 18:29:27 +0000 | [diff] [blame] | 7755 | mttcg="yes" |
Peter Maydell | c888f7e | 2020-05-07 14:47:55 +0100 | [diff] [blame] | 7756 | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7757 | ;; |
Michael Weiser | 722dd7b | 2018-01-11 13:25:32 +0000 | [diff] [blame] | 7758 | aarch64|aarch64_be) |
| 7759 | TARGET_ARCH=aarch64 |
Alexander Graf | 6a49fa9 | 2013-09-03 20:12:22 +0100 | [diff] [blame] | 7760 | TARGET_BASE_ARCH=arm |
| 7761 | bflt="yes" |
Alex Bennée | ca759f9 | 2017-02-23 18:29:27 +0000 | [diff] [blame] | 7762 | mttcg="yes" |
Peter Maydell | c888f7e | 2020-05-07 14:47:55 +0100 | [diff] [blame] | 7763 | gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" |
Alexander Graf | 6a49fa9 | 2013-09-03 20:12:22 +0100 | [diff] [blame] | 7764 | ;; |
Michael Rolnik | 42f3ff0 | 2020-01-24 01:51:21 +0100 | [diff] [blame] | 7765 | avr) |
| 7766 | gdb_xml_files="avr-cpu.xml" |
| 7767 | target_compiler=$cross_cc_avr |
| 7768 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7769 | cris) |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7770 | ;; |
Richard Henderson | 61766fe | 2016-12-15 11:26:14 -0800 | [diff] [blame] | 7771 | hppa) |
Richard Henderson | 7b93dab | 2018-01-06 16:02:27 -0800 | [diff] [blame] | 7772 | mttcg="yes" |
Laurent Vivier | 9566f4c | 2020-03-10 11:33:45 +0100 | [diff] [blame] | 7773 | TARGET_SYSTBL_ABI=common,32 |
Richard Henderson | 61766fe | 2016-12-15 11:26:14 -0800 | [diff] [blame] | 7774 | ;; |
Michael Walle | 613a22c | 2011-02-17 23:45:17 +0100 | [diff] [blame] | 7775 | lm32) |
Michael Walle | 613a22c | 2011-02-17 23:45:17 +0100 | [diff] [blame] | 7776 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7777 | m68k) |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7778 | bflt="yes" |
KONRAD Frederic | a976ed3 | 2020-04-30 20:01:22 +0100 | [diff] [blame] | 7779 | gdb_xml_files="cf-core.xml cf-fp.xml m68k-core.xml m68k-fp.xml" |
Laurent Vivier | 5b85cae | 2020-03-10 11:33:46 +0100 | [diff] [blame] | 7780 | TARGET_SYSTBL_ABI=common |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7781 | ;; |
Edgar E. Iglesias | 877fdc1 | 2011-02-21 12:42:20 +0100 | [diff] [blame] | 7782 | microblaze|microblazeel) |
| 7783 | TARGET_ARCH=microblaze |
Laurent Vivier | ddf0c4c | 2020-03-10 11:33:49 +0100 | [diff] [blame] | 7784 | TARGET_SYSTBL_ABI=common |
Edgar E. Iglesias | 72b675c | 2009-05-20 21:17:31 +0200 | [diff] [blame] | 7785 | bflt="yes" |
Edgar E. Iglesias | be73ef6 | 2018-04-13 18:10:00 +0200 | [diff] [blame] | 7786 | echo "TARGET_ABI32=y" >> $config_target_mak |
Edgar E. Iglesias | 72b675c | 2009-05-20 21:17:31 +0200 | [diff] [blame] | 7787 | ;; |
Juan Quintela | 0adcffb | 2009-07-16 18:34:16 +0200 | [diff] [blame] | 7788 | mips|mipsel) |
Aleksandar Markovic | 0454728 | 2019-02-11 17:09:29 +0100 | [diff] [blame] | 7789 | mttcg="yes" |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7790 | TARGET_ARCH=mips |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7791 | echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak |
Laurent Vivier | c59716f | 2020-03-10 11:33:58 +0100 | [diff] [blame] | 7792 | TARGET_SYSTBL_ABI=o32 |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7793 | TARGET_SYSTBL=syscall_o32.tbl |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7794 | ;; |
| 7795 | mipsn32|mipsn32el) |
Aleksandar Markovic | 0454728 | 2019-02-11 17:09:29 +0100 | [diff] [blame] | 7796 | mttcg="yes" |
Richard Henderson | 597e2ce | 2013-02-10 10:30:50 -0800 | [diff] [blame] | 7797 | TARGET_ARCH=mips64 |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7798 | TARGET_BASE_ARCH=mips |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7799 | echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak |
Richard Henderson | 597e2ce | 2013-02-10 10:30:50 -0800 | [diff] [blame] | 7800 | echo "TARGET_ABI32=y" >> $config_target_mak |
Laurent Vivier | 686a0fe | 2020-03-10 11:33:59 +0100 | [diff] [blame] | 7801 | TARGET_SYSTBL_ABI=n32 |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7802 | TARGET_SYSTBL=syscall_n32.tbl |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7803 | ;; |
| 7804 | mips64|mips64el) |
Alex Bennée | a092a95 | 2020-03-23 16:15:09 +0000 | [diff] [blame] | 7805 | mttcg="no" |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7806 | TARGET_ARCH=mips64 |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7807 | TARGET_BASE_ARCH=mips |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7808 | echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak |
Laurent Vivier | 686a0fe | 2020-03-10 11:33:59 +0100 | [diff] [blame] | 7809 | TARGET_SYSTBL_ABI=n64 |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7810 | TARGET_SYSTBL=syscall_n64.tbl |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7811 | ;; |
Anthony Green | d15a9c2 | 2013-03-18 15:49:25 -0400 | [diff] [blame] | 7812 | moxie) |
| 7813 | ;; |
Marek Vasut | e671711 | 2017-01-18 23:01:46 +0100 | [diff] [blame] | 7814 | nios2) |
| 7815 | ;; |
Richard Henderson | 4a09d0b | 2017-02-08 15:06:54 -0800 | [diff] [blame] | 7816 | or1k) |
Jia Liu | e67db06 | 2012-07-20 15:50:39 +0800 | [diff] [blame] | 7817 | TARGET_ARCH=openrisc |
| 7818 | TARGET_BASE_ARCH=openrisc |
Jia Liu | e67db06 | 2012-07-20 15:50:39 +0800 | [diff] [blame] | 7819 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7820 | ppc) |
aurel32 | c8b3532 | 2009-01-24 15:07:34 +0000 | [diff] [blame] | 7821 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
Laurent Vivier | 76a691f | 2020-03-10 11:33:51 +0100 | [diff] [blame] | 7822 | TARGET_SYSTBL_ABI=common,nospu,32 |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7823 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7824 | ppc64) |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7825 | TARGET_BASE_ARCH=ppc |
Juan Quintela | e6e91b9 | 2009-07-16 18:34:17 +0200 | [diff] [blame] | 7826 | TARGET_ABI_DIR=ppc |
Laurent Vivier | 76a691f | 2020-03-10 11:33:51 +0100 | [diff] [blame] | 7827 | TARGET_SYSTBL_ABI=common,nospu,64 |
Nikunj A Dadhania | f0b0685 | 2017-04-27 10:48:23 +0530 | [diff] [blame] | 7828 | mttcg=yes |
Anton Blanchard | 1438eff | 2016-01-15 16:00:51 +0100 | [diff] [blame] | 7829 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7830 | ;; |
Doug Kwan | 9c35126 | 2014-05-29 09:12:21 -0500 | [diff] [blame] | 7831 | ppc64le) |
| 7832 | TARGET_ARCH=ppc64 |
| 7833 | TARGET_BASE_ARCH=ppc |
| 7834 | TARGET_ABI_DIR=ppc |
Laurent Vivier | 76a691f | 2020-03-10 11:33:51 +0100 | [diff] [blame] | 7835 | TARGET_SYSTBL_ABI=common,nospu,64 |
Nikunj A Dadhania | f0b0685 | 2017-04-27 10:48:23 +0530 | [diff] [blame] | 7836 | mttcg=yes |
Anton Blanchard | 1438eff | 2016-01-15 16:00:51 +0100 | [diff] [blame] | 7837 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
Doug Kwan | 9c35126 | 2014-05-29 09:12:21 -0500 | [diff] [blame] | 7838 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7839 | ppc64abi32) |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7840 | TARGET_ARCH=ppc64 |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7841 | TARGET_BASE_ARCH=ppc |
Juan Quintela | e6e91b9 | 2009-07-16 18:34:17 +0200 | [diff] [blame] | 7842 | TARGET_ABI_DIR=ppc |
Laurent Vivier | 76a691f | 2020-03-10 11:33:51 +0100 | [diff] [blame] | 7843 | TARGET_SYSTBL_ABI=common,nospu,32 |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7844 | echo "TARGET_ABI32=y" >> $config_target_mak |
Anton Blanchard | 1438eff | 2016-01-15 16:00:51 +0100 | [diff] [blame] | 7845 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7846 | ;; |
Michael Clark | 25fa194 | 2018-03-03 01:32:59 +1300 | [diff] [blame] | 7847 | riscv32) |
| 7848 | TARGET_BASE_ARCH=riscv |
| 7849 | TARGET_ABI_DIR=riscv |
| 7850 | mttcg=yes |
Keith Packard | ae4a70c | 2020-01-28 15:32:16 -0800 | [diff] [blame] | 7851 | gdb_xml_files="riscv-32bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-32bit-csr.xml riscv-32bit-virtual.xml" |
Michael Clark | 25fa194 | 2018-03-03 01:32:59 +1300 | [diff] [blame] | 7852 | ;; |
| 7853 | riscv64) |
| 7854 | TARGET_BASE_ARCH=riscv |
| 7855 | TARGET_ABI_DIR=riscv |
| 7856 | mttcg=yes |
Keith Packard | ae4a70c | 2020-01-28 15:32:16 -0800 | [diff] [blame] | 7857 | gdb_xml_files="riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-csr.xml riscv-64bit-virtual.xml" |
Michael Clark | 25fa194 | 2018-03-03 01:32:59 +1300 | [diff] [blame] | 7858 | ;; |
Yoshinori Sato | c8c35e5 | 2019-01-21 05:18:59 -0800 | [diff] [blame] | 7859 | rx) |
| 7860 | TARGET_ARCH=rx |
| 7861 | bflt="yes" |
| 7862 | target_compiler=$cross_cc_rx |
| 7863 | gdb_xml_files="rx-core.xml" |
| 7864 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7865 | sh4|sh4eb) |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7866 | TARGET_ARCH=sh4 |
Laurent Vivier | d0c832f | 2020-03-10 11:33:48 +0100 | [diff] [blame] | 7867 | TARGET_SYSTBL_ABI=common |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7868 | bflt="yes" |
| 7869 | ;; |
| 7870 | sparc) |
Laurent Vivier | bb0cdc0 | 2020-03-10 11:33:54 +0100 | [diff] [blame] | 7871 | TARGET_SYSTBL_ABI=common,32 |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7872 | ;; |
| 7873 | sparc64) |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7874 | TARGET_BASE_ARCH=sparc |
Laurent Vivier | bb0cdc0 | 2020-03-10 11:33:54 +0100 | [diff] [blame] | 7875 | TARGET_SYSTBL_ABI=common,64 |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7876 | ;; |
| 7877 | sparc32plus) |
Juan Quintela | b498c8a | 2009-07-16 18:34:11 +0200 | [diff] [blame] | 7878 | TARGET_ARCH=sparc64 |
Juan Quintela | 6acff7d | 2009-07-16 18:34:15 +0200 | [diff] [blame] | 7879 | TARGET_BASE_ARCH=sparc |
Juan Quintela | e6e91b9 | 2009-07-16 18:34:17 +0200 | [diff] [blame] | 7880 | TARGET_ABI_DIR=sparc |
Laurent Vivier | bb0cdc0 | 2020-03-10 11:33:54 +0100 | [diff] [blame] | 7881 | TARGET_SYSTBL_ABI=common,32 |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7882 | echo "TARGET_ABI32=y" >> $config_target_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7883 | ;; |
Alexander Graf | 24e804ec | 2009-12-05 12:44:22 +0100 | [diff] [blame] | 7884 | s390x) |
Laurent Vivier | 318f371 | 2020-03-10 11:33:53 +0100 | [diff] [blame] | 7885 | TARGET_SYSTBL_ABI=common,64 |
David Hildenbrand | 63685bc | 2018-01-29 13:56:20 +0100 | [diff] [blame] | 7886 | mttcg=yes |
Christian Borntraeger | 86158a2 | 2017-03-08 12:41:14 +0100 | [diff] [blame] | 7887 | gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-gs.xml" |
Alexander Graf | 24e804ec | 2009-12-05 12:44:22 +0100 | [diff] [blame] | 7888 | ;; |
Chen Gang | 444e06b | 2015-08-21 05:43:37 +0800 | [diff] [blame] | 7889 | tilegx) |
| 7890 | ;; |
Peter Crosthwaite | 5ecaa4e | 2015-04-26 19:14:26 -0700 | [diff] [blame] | 7891 | tricore) |
| 7892 | ;; |
Guan Xuetao | d2fbca9 | 2011-04-12 16:27:03 +0800 | [diff] [blame] | 7893 | unicore32) |
Guan Xuetao | d2fbca9 | 2011-04-12 16:27:03 +0800 | [diff] [blame] | 7894 | ;; |
Max Filippov | cfa550c | 2011-09-06 03:55:26 +0400 | [diff] [blame] | 7895 | xtensa|xtensaeb) |
| 7896 | TARGET_ARCH=xtensa |
Laurent Vivier | a4a9359 | 2020-03-10 11:33:47 +0100 | [diff] [blame] | 7897 | TARGET_SYSTBL_ABI=common |
Max Filippov | 02e33e9 | 2018-10-19 18:40:20 -0700 | [diff] [blame] | 7898 | bflt="yes" |
Max Filippov | 9fb4034 | 2017-03-06 17:17:43 -0800 | [diff] [blame] | 7899 | mttcg="yes" |
Max Filippov | cfa550c | 2011-09-06 03:55:26 +0400 | [diff] [blame] | 7900 | ;; |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7901 | *) |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 7902 | error_exit "Unsupported target CPU" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 7903 | ;; |
| 7904 | esac |
Paolo Bonzini | 5e8861a | 2012-05-29 10:23:15 +0200 | [diff] [blame] | 7905 | # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH |
| 7906 | if [ "$TARGET_BASE_ARCH" = "" ]; then |
| 7907 | TARGET_BASE_ARCH=$TARGET_ARCH |
| 7908 | fi |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7909 | if [ "$TARGET_SYSTBL_ABI" != "" ] && [ "$TARGET_SYSTBL" = "" ]; then |
| 7910 | TARGET_SYSTBL=syscall.tbl |
| 7911 | fi |
Paolo Bonzini | 5e8861a | 2012-05-29 10:23:15 +0200 | [diff] [blame] | 7912 | |
Daniel P. Berrange | 99afc91 | 2012-08-20 15:31:38 +0100 | [diff] [blame] | 7913 | upper() { |
| 7914 | echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' |
| 7915 | } |
| 7916 | |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 7917 | target_arch_name="$(upper $TARGET_ARCH)" |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7918 | echo "TARGET_$target_arch_name=y" >> $config_target_mak |
Paolo Bonzini | c1799a8 | 2013-06-14 15:19:07 +0100 | [diff] [blame] | 7919 | echo "TARGET_NAME=$target_name" >> $config_target_mak |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7920 | echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak |
Juan Quintela | e6e91b9 | 2009-07-16 18:34:17 +0200 | [diff] [blame] | 7921 | if [ "$TARGET_ABI_DIR" = "" ]; then |
| 7922 | TARGET_ABI_DIR=$TARGET_ARCH |
| 7923 | fi |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7924 | echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak |
Stacey Son | adfc3e9 | 2014-06-08 09:57:22 -0700 | [diff] [blame] | 7925 | if [ "$HOST_VARIANT_DIR" != "" ]; then |
| 7926 | echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak |
| 7927 | fi |
Laurent Vivier | 4d6a835 | 2020-03-10 11:33:43 +0100 | [diff] [blame] | 7928 | if [ "$TARGET_SYSTBL_ABI" != "" ]; then |
| 7929 | echo "TARGET_SYSTBL_ABI=$TARGET_SYSTBL_ABI" >> $config_target_mak |
Marc-André Lureau | 3a30446 | 2019-08-18 16:13:08 +0400 | [diff] [blame] | 7930 | echo "TARGET_SYSTBL=$TARGET_SYSTBL" >> $config_target_mak |
Laurent Vivier | 4d6a835 | 2020-03-10 11:33:43 +0100 | [diff] [blame] | 7931 | fi |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 7932 | |
| 7933 | if supported_xen_target $target; then |
| 7934 | echo "CONFIG_XEN=y" >> $config_target_mak |
| 7935 | if test "$xen_pci_passthrough" = yes; then |
Anthony PERARD | eb6fda0 | 2012-06-21 15:32:59 +0000 | [diff] [blame] | 7936 | echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" |
Juan Quintela | 1b0c87f | 2009-07-16 18:33:59 +0200 | [diff] [blame] | 7937 | fi |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 7938 | fi |
| 7939 | if supported_kvm_target $target; then |
| 7940 | echo "CONFIG_KVM=y" >> $config_target_mak |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 7941 | fi |
| 7942 | if supported_hax_target $target; then |
| 7943 | echo "CONFIG_HAX=y" >> $config_target_mak |
Vincent Palatin | b0cb0a6 | 2017-01-10 11:59:57 +0100 | [diff] [blame] | 7944 | fi |
Sergio Andres Gomez Del Real | c97d6d2 | 2017-09-13 04:05:09 -0500 | [diff] [blame] | 7945 | if supported_hvf_target $target; then |
| 7946 | echo "CONFIG_HVF=y" >> $config_target_mak |
| 7947 | fi |
Justin Terry (VM) | d661d9a | 2018-01-22 13:07:46 -0800 | [diff] [blame] | 7948 | if supported_whpx_target $target; then |
| 7949 | echo "CONFIG_WHPX=y" >> $config_target_mak |
| 7950 | fi |
tony.nguyen@bt.com | 52bf977 | 2019-07-18 06:01:31 +0000 | [diff] [blame] | 7951 | if test "$target_aligned_only" = "yes" ; then |
| 7952 | echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak |
| 7953 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 7954 | if test "$target_bigendian" = "yes" ; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7955 | echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 7956 | fi |
| 7957 | if test "$target_softmmu" = "yes" ; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7958 | echo "CONFIG_SOFTMMU=y" >> $config_target_mak |
Alex Bennée | ca759f9 | 2017-02-23 18:29:27 +0000 | [diff] [blame] | 7959 | if test "$mttcg" = "yes" ; then |
| 7960 | echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak |
| 7961 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 7962 | fi |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 7963 | if test "$target_user_only" = "yes" ; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7964 | echo "CONFIG_USER_ONLY=y" >> $config_target_mak |
Stefan Weil | a2c80be | 2011-12-22 11:26:10 +0100 | [diff] [blame] | 7965 | echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak |
Paolo Bonzini | 2898503 | 2020-08-19 15:36:59 -0400 | [diff] [blame] | 7966 | symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" |
| 7967 | else |
| 7968 | symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 7969 | fi |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 7970 | if test "$target_linux_user" = "yes" ; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7971 | echo "CONFIG_LINUX_USER=y" >> $config_target_mak |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 7972 | fi |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 7973 | list="" |
| 7974 | if test ! -z "$gdb_xml_files" ; then |
| 7975 | for x in $gdb_xml_files; do |
Marc-André Lureau | c9322ab | 2019-08-18 19:51:17 +0400 | [diff] [blame] | 7976 | list="$list gdb-xml/$x" |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 7977 | done |
Juan Quintela | 3d0f151 | 2009-10-07 02:41:04 +0200 | [diff] [blame] | 7978 | echo "TARGET_XML_FILES=$list" >> $config_target_mak |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 7979 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 7980 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 7981 | if test "$target_user_only" = "yes" && test "$bflt" = "yes"; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7982 | echo "TARGET_HAS_BFLT=y" >> $config_target_mak |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 7983 | fi |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 7984 | if test "$target_bsd_user" = "yes" ; then |
Juan Quintela | 25be210f | 2009-10-07 02:41:00 +0200 | [diff] [blame] | 7985 | echo "CONFIG_BSD_USER=y" >> $config_target_mak |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 7986 | fi |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 7987 | |
Alex Bennée | 716a507 | 2018-04-10 12:19:40 +0100 | [diff] [blame] | 7988 | |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 7989 | # generate QEMU_CFLAGS/QEMU_LDFLAGS for targets |
Juan Quintela | fa28248 | 2009-07-22 22:37:39 +0200 | [diff] [blame] | 7990 | |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 7991 | disas_config() { |
| 7992 | echo "CONFIG_${1}_DIS=y" >> $config_target_mak |
| 7993 | echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak |
| 7994 | } |
| 7995 | |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 7996 | for i in $ARCH $TARGET_BASE_ARCH ; do |
| 7997 | case "$i" in |
| 7998 | alpha) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 7999 | disas_config "ALPHA" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8000 | ;; |
Richard Henderson | 82295d8 | 2014-03-03 22:53:27 -0500 | [diff] [blame] | 8001 | aarch64) |
| 8002 | if test -n "${cxx}"; then |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8003 | disas_config "ARM_A64" |
Richard Henderson | 82295d8 | 2014-03-03 22:53:27 -0500 | [diff] [blame] | 8004 | fi |
| 8005 | ;; |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8006 | arm) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8007 | disas_config "ARM" |
Claudio Fontana | 999b53e | 2014-02-05 17:27:28 +0000 | [diff] [blame] | 8008 | if test -n "${cxx}"; then |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8009 | disas_config "ARM_A64" |
Claudio Fontana | 999b53e | 2014-02-05 17:27:28 +0000 | [diff] [blame] | 8010 | fi |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8011 | ;; |
Michael Rolnik | 42f3ff0 | 2020-01-24 01:51:21 +0100 | [diff] [blame] | 8012 | avr) |
| 8013 | disas_config "AVR" |
| 8014 | ;; |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8015 | cris) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8016 | disas_config "CRIS" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8017 | ;; |
Richard Henderson | 429b31a | 2016-09-29 10:55:53 -0700 | [diff] [blame] | 8018 | hppa) |
| 8019 | disas_config "HPPA" |
| 8020 | ;; |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 8021 | i386|x86_64|x32) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8022 | disas_config "I386" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8023 | ;; |
Michael Walle | 79368f4 | 2012-03-31 19:54:20 +0200 | [diff] [blame] | 8024 | lm32) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8025 | disas_config "LM32" |
Michael Walle | 79368f4 | 2012-03-31 19:54:20 +0200 | [diff] [blame] | 8026 | ;; |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8027 | m68k) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8028 | disas_config "M68K" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8029 | ;; |
Edgar E. Iglesias | 877fdc1 | 2011-02-21 12:42:20 +0100 | [diff] [blame] | 8030 | microblaze*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8031 | disas_config "MICROBLAZE" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8032 | ;; |
| 8033 | mips*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8034 | disas_config "MIPS" |
Aleksandar Markovic | 89a955e | 2018-10-24 17:41:49 +0200 | [diff] [blame] | 8035 | if test -n "${cxx}"; then |
| 8036 | disas_config "NANOMIPS" |
| 8037 | fi |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8038 | ;; |
Anthony Green | d15a9c2 | 2013-03-18 15:49:25 -0400 | [diff] [blame] | 8039 | moxie*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8040 | disas_config "MOXIE" |
Anthony Green | d15a9c2 | 2013-03-18 15:49:25 -0400 | [diff] [blame] | 8041 | ;; |
Marek Vasut | e671711 | 2017-01-18 23:01:46 +0100 | [diff] [blame] | 8042 | nios2) |
| 8043 | disas_config "NIOS2" |
| 8044 | ;; |
Richard Henderson | 4a09d0b | 2017-02-08 15:06:54 -0800 | [diff] [blame] | 8045 | or1k) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8046 | disas_config "OPENRISC" |
Jia Liu | e67db06 | 2012-07-20 15:50:39 +0800 | [diff] [blame] | 8047 | ;; |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8048 | ppc*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8049 | disas_config "PPC" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8050 | ;; |
Alistair Francis | c4f8054 | 2018-12-19 19:20:19 +0000 | [diff] [blame] | 8051 | riscv*) |
Michael Clark | 25fa194 | 2018-03-03 01:32:59 +1300 | [diff] [blame] | 8052 | disas_config "RISCV" |
| 8053 | ;; |
Yoshinori Sato | c8c35e5 | 2019-01-21 05:18:59 -0800 | [diff] [blame] | 8054 | rx) |
| 8055 | disas_config "RX" |
| 8056 | ;; |
Alexander Graf | 24e804ec | 2009-12-05 12:44:22 +0100 | [diff] [blame] | 8057 | s390*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8058 | disas_config "S390" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8059 | ;; |
| 8060 | sh4) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8061 | disas_config "SH4" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8062 | ;; |
| 8063 | sparc*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8064 | disas_config "SPARC" |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8065 | ;; |
Max Filippov | cfa550c | 2011-09-06 03:55:26 +0400 | [diff] [blame] | 8066 | xtensa*) |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8067 | disas_config "XTENSA" |
Max Filippov | cfa550c | 2011-09-06 03:55:26 +0400 | [diff] [blame] | 8068 | ;; |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8069 | esac |
| 8070 | done |
Stefan Weil | 9195b2c | 2011-10-19 07:07:18 +0200 | [diff] [blame] | 8071 | if test "$tcg_interpreter" = "yes" ; then |
Peter Crosthwaite | c765fca | 2015-08-29 03:33:59 -0700 | [diff] [blame] | 8072 | disas_config "TCI" |
Stefan Weil | 9195b2c | 2011-10-19 07:07:18 +0200 | [diff] [blame] | 8073 | fi |
Juan Quintela | 6465602 | 2009-08-03 14:46:53 +0200 | [diff] [blame] | 8074 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 8075 | done # for target in $targets |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 8076 | |
Marc-André Lureau | d52c454 | 2019-05-24 15:09:42 +0200 | [diff] [blame] | 8077 | echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak |
| 8078 | echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak |
| 8079 | |
Philippe Mathieu-Daudé | e3971d6 | 2018-04-15 20:05:20 -0300 | [diff] [blame] | 8080 | if [ "$fdt" = "git" ]; then |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 8081 | subdirs="$subdirs dtc" |
Peter Crosthwaite | a540f15 | 2013-04-18 14:47:31 +1000 | [diff] [blame] | 8082 | fi |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 8083 | if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 8084 | subdirs="$subdirs capstone" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 8085 | fi |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 8086 | echo "SUBDIRS=$subdirs" >> $config_host_mak |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 8087 | if test -n "$LIBCAPSTONE"; then |
| 8088 | echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak |
| 8089 | fi |
Peter Crosthwaite | a540f15 | 2013-04-18 14:47:31 +1000 | [diff] [blame] | 8090 | |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 8091 | if test "$numa" = "yes"; then |
| 8092 | echo "CONFIG_NUMA=y" >> $config_host_mak |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 8093 | echo "NUMA_LIBS=$numa_libs" >> $config_host_mak |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 8094 | fi |
| 8095 | |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 8096 | if test "$ccache_cpp2" = "yes"; then |
| 8097 | echo "export CCACHE_CPP2=y" >> $config_host_mak |
| 8098 | fi |
| 8099 | |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 8100 | if test "$safe_stack" = "yes"; then |
| 8101 | echo "CONFIG_SAFESTACK=y" >> $config_host_mak |
| 8102 | fi |
| 8103 | |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8104 | # If we're using a separate build tree, set it up now. |
| 8105 | # DIRS are directories which we simply mkdir in the build tree; |
| 8106 | # LINKS are things to symlink back into the source tree |
| 8107 | # (these can be both files and directories). |
| 8108 | # Caution: do not add files or directories here using wildcards. This |
| 8109 | # will result in problems later if a new file matching the wildcard is |
| 8110 | # added to the source tree -- nothing will cause configure to be rerun |
| 8111 | # so the build tree will be missing the link back to the new file, and |
| 8112 | # tests might fail. Prefer to keep the relevant files in their own |
| 8113 | # directory and symlink the directory instead. |
Thomas Huth | 1cf4323 | 2019-09-10 16:41:20 +0200 | [diff] [blame] | 8114 | DIRS="tests tests/tcg tests/tcg/lm32 tests/qapi-schema tests/qtest/libqos" |
| 8115 | DIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph" |
Paolo Bonzini | b855f8d | 2017-08-22 06:50:18 +0200 | [diff] [blame] | 8116 | DIRS="$DIRS docs docs/interop fsdev scsi" |
Alexey Kardashevskiy | 744a928 | 2019-07-16 15:27:43 +1000 | [diff] [blame] | 8117 | DIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw" |
Gerd Hoffmann | 8db2a4f | 2020-06-22 15:12:40 +0200 | [diff] [blame] | 8118 | DIRS="$DIRS roms/seabios" |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 8119 | LINKS="Makefile" |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 8120 | LINKS="$LINKS tests/tcg/lm32/Makefile" |
Paolo Bonzini | 3941996 | 2020-08-06 14:08:31 +0200 | [diff] [blame] | 8121 | LINKS="$LINKS tests/tcg/Makefile.target" |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8122 | LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8123 | LINKS="$LINKS pc-bios/s390-ccw/Makefile" |
Gerd Hoffmann | 8db2a4f | 2020-06-22 15:12:40 +0200 | [diff] [blame] | 8124 | LINKS="$LINKS roms/seabios/Makefile" |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8125 | LINKS="$LINKS pc-bios/qemu-icon.bmp" |
| 8126 | LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit |
Peter Maydell | 3995035 | 2018-11-02 11:52:39 +0000 | [diff] [blame] | 8127 | LINKS="$LINKS tests/acceptance tests/data" |
| 8128 | LINKS="$LINKS tests/qemu-iotests/check" |
Cleber Rosa | 8f8fd9e | 2019-02-06 11:29:01 -0500 | [diff] [blame] | 8129 | LINKS="$LINKS python" |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 8130 | for bios_file in \ |
| 8131 | $source_path/pc-bios/*.bin \ |
Alexey Kardashevskiy | 225a9ab | 2016-10-26 13:18:03 +1100 | [diff] [blame] | 8132 | $source_path/pc-bios/*.lid \ |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 8133 | $source_path/pc-bios/*.rom \ |
| 8134 | $source_path/pc-bios/*.dtb \ |
Dominik Dingel | e89e33e | 2013-04-29 04:52:06 +0000 | [diff] [blame] | 8135 | $source_path/pc-bios/*.img \ |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 8136 | $source_path/pc-bios/openbios-* \ |
Alexander Graf | 4e73c78 | 2014-01-20 00:25:40 +0100 | [diff] [blame] | 8137 | $source_path/pc-bios/u-boot.* \ |
Laszlo Ersek | 26ce90f | 2019-03-08 01:19:35 +0100 | [diff] [blame] | 8138 | $source_path/pc-bios/edk2-*.fd.bz2 \ |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 8139 | $source_path/pc-bios/palcode-* |
| 8140 | do |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8141 | LINKS="$LINKS pc-bios/$(basename $bios_file)" |
Paolo Bonzini | d1807a4 | 2010-12-23 11:43:59 +0100 | [diff] [blame] | 8142 | done |
| 8143 | mkdir -p $DIRS |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 8144 | for f in $LINKS ; do |
Michael S. Tsirkin | cab00a5 | 2014-04-28 15:09:01 +0300 | [diff] [blame] | 8145 | if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then |
Peter Maydell | f9245e1 | 2011-06-03 17:10:40 +0100 | [diff] [blame] | 8146 | symlink "$source_path/$f" "$f" |
| 8147 | fi |
Paolo Bonzini | d1807a4 | 2010-12-23 11:43:59 +0100 | [diff] [blame] | 8148 | done |
Paul Brook | 1ad2134 | 2009-05-19 16:17:58 +0100 | [diff] [blame] | 8149 | |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 8150 | (for i in $cross_cc_vars; do |
| 8151 | export $i |
| 8152 | done |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 8153 | export target_list source_path use_containers |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 8154 | $source_path/tests/tcg/configure.sh) |
| 8155 | |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8156 | # temporary config to build submodules |
Gerd Hoffmann | 8db2a4f | 2020-06-22 15:12:40 +0200 | [diff] [blame] | 8157 | for rom in seabios; do |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8158 | config_mak=roms/$rom/config.mak |
Stefan Weil | 37116c8 | 2010-03-01 22:20:29 +0100 | [diff] [blame] | 8159 | echo "# Automatically generated by configure - do not modify" > $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8160 | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 8161 | echo "AS=$as" >> $config_mak |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 8162 | echo "CCAS=$ccas" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8163 | echo "CC=$cc" >> $config_mak |
| 8164 | echo "BCC=bcc" >> $config_mak |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 8165 | echo "CPP=$cpp" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8166 | echo "OBJCOPY=objcopy" >> $config_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 8167 | echo "IASL=$iasl" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8168 | echo "LD=$ld" >> $config_mak |
Alistair Francis | 9f81aeb | 2017-11-07 17:10:46 -0800 | [diff] [blame] | 8169 | echo "RANLIB=$ranlib" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 8170 | done |
| 8171 | |
Max Reitz | 76c7560 | 2014-05-24 23:24:56 +0200 | [diff] [blame] | 8172 | # set up qemu-iotests in this build directory |
| 8173 | iotests_common_env="tests/qemu-iotests/common.env" |
Max Reitz | 76c7560 | 2014-05-24 23:24:56 +0200 | [diff] [blame] | 8174 | |
| 8175 | echo "# Automatically generated by configure - do not modify" > "$iotests_common_env" |
| 8176 | echo >> "$iotests_common_env" |
| 8177 | echo "export PYTHON='$python'" >> "$iotests_common_env" |
| 8178 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 8179 | if test "$skip_meson" = no; then |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 8180 | cross="config-meson.cross.new" |
| 8181 | meson_quote() { |
| 8182 | echo "['$(echo $* | sed "s/ /','/g")']" |
| 8183 | } |
| 8184 | |
| 8185 | echo "# Automatically generated by configure - do not modify" > $cross |
| 8186 | echo "[properties]" >> $cross |
| 8187 | test -z "$cxx" && echo "link_language = 'c'" >> $cross |
| 8188 | echo "[binaries]" >> $cross |
| 8189 | echo "c = $(meson_quote $cc)" >> $cross |
| 8190 | test -n "$cxx" && echo "cpp = $(meson_quote $cxx)" >> $cross |
| 8191 | echo "ar = $(meson_quote $ar)" >> $cross |
| 8192 | echo "nm = $(meson_quote $nm)" >> $cross |
| 8193 | echo "pkgconfig = $(meson_quote $pkg_config_exe)" >> $cross |
| 8194 | echo "ranlib = $(meson_quote $ranlib)" >> $cross |
| 8195 | echo "strip = $(meson_quote $strip)" >> $cross |
| 8196 | echo "windres = $(meson_quote $windres)" >> $cross |
| 8197 | if test -n "$cross_prefix"; then |
| 8198 | cross_arg="--cross-file config-meson.cross" |
| 8199 | # Hack: Meson expects an absolute path for the *build* machine |
| 8200 | # for the prefix, so add a slash in front of a Windows path that |
| 8201 | # includes a drive letter. |
| 8202 | # |
| 8203 | # See https://github.com/mesonbuild/meson/issues/7577. |
| 8204 | echo "[host_machine]" >> $cross |
| 8205 | if test "$mingw32" = "yes" ; then |
| 8206 | echo "system = 'windows'" >> $cross |
| 8207 | case $prefix in |
| 8208 | ?:*) pre_prefix=/ ;; |
| 8209 | esac |
| 8210 | fi |
| 8211 | case "$ARCH" in |
| 8212 | i386|x86_64) |
| 8213 | echo "cpu_family = 'x86'" >> $cross |
| 8214 | ;; |
| 8215 | ppc64le) |
| 8216 | echo "cpu_family = 'ppc64'" >> $cross |
| 8217 | ;; |
| 8218 | *) |
| 8219 | echo "cpu_family = '$ARCH'" >> $cross |
| 8220 | ;; |
| 8221 | esac |
| 8222 | echo "cpu = '$cpu'" >> $cross |
| 8223 | if test "$bigendian" = "yes" ; then |
| 8224 | echo "endian = 'big'" >> $cross |
| 8225 | else |
| 8226 | echo "endian = 'little'" >> $cross |
| 8227 | fi |
| 8228 | else |
| 8229 | cross_arg="--native-file config-meson.cross" |
| 8230 | fi |
| 8231 | mv $cross config-meson.cross |
| 8232 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 8233 | rm -rf meson-private meson-info meson-logs |
| 8234 | NINJA=$PWD/ninjatool $meson setup \ |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 8235 | --prefix "${pre_prefix}$prefix" \ |
| 8236 | --libdir "${pre_prefix}$libdir" \ |
| 8237 | --libexecdir "${pre_prefix}$libexecdir" \ |
| 8238 | --bindir "${pre_prefix}$bindir" \ |
| 8239 | --includedir "${pre_prefix}$includedir" \ |
| 8240 | --datadir "${pre_prefix}$datadir" \ |
| 8241 | --mandir "${pre_prefix}$mandir" \ |
| 8242 | --sysconfdir "${pre_prefix}$sysconfdir" \ |
| 8243 | --localstatedir "${pre_prefix}$local_statedir" \ |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 8244 | -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ |
| 8245 | -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ |
| 8246 | -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ |
| 8247 | -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ |
Marc-André Lureau | da6d48b | 2019-09-17 15:39:36 +0400 | [diff] [blame] | 8248 | -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ |
Marc-André Lureau | bf0e56a | 2019-10-04 17:35:16 +0400 | [diff] [blame] | 8249 | -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ |
Paolo Bonzini | 35be72b | 2020-02-06 14:17:15 +0100 | [diff] [blame] | 8250 | -Dsdl=$sdl -Dsdl_image=$sdl_image \ |
Paolo Bonzini | a0b9323 | 2020-02-06 15:48:52 +0100 | [diff] [blame] | 8251 | -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \ |
Marc-André Lureau | e8f3bd7 | 2019-09-19 21:02:09 +0400 | [diff] [blame] | 8252 | -Dgettext=$gettext \ |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 8253 | $cross_arg \ |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 8254 | "$PWD" "$source_path" |
| 8255 | |
| 8256 | if test "$?" -ne 0 ; then |
| 8257 | error_exit "meson setup failed" |
| 8258 | fi |
| 8259 | touch ninjatool.stamp |
| 8260 | fi |
| 8261 | |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 8262 | # Save the configure command line for later reuse. |
| 8263 | cat <<EOD >config.status |
| 8264 | #!/bin/sh |
| 8265 | # Generated by configure. |
| 8266 | # Run this file to recreate the current configuration. |
| 8267 | # Compiler output produced by configure, useful for debugging |
| 8268 | # configure, is in config.log if it exists. |
| 8269 | EOD |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 8270 | |
| 8271 | preserve_env() { |
| 8272 | envname=$1 |
| 8273 | |
| 8274 | eval envval=\$$envname |
| 8275 | |
| 8276 | if test -n "$envval" |
| 8277 | then |
| 8278 | echo "$envname='$envval'" >> config.status |
| 8279 | echo "export $envname" >> config.status |
| 8280 | else |
| 8281 | echo "unset $envname" >> config.status |
| 8282 | fi |
| 8283 | } |
| 8284 | |
| 8285 | # Preserve various env variables that influence what |
| 8286 | # features/build target configure will detect |
| 8287 | preserve_env AR |
| 8288 | preserve_env AS |
| 8289 | preserve_env CC |
| 8290 | preserve_env CPP |
| 8291 | preserve_env CXX |
| 8292 | preserve_env INSTALL |
| 8293 | preserve_env LD |
| 8294 | preserve_env LD_LIBRARY_PATH |
| 8295 | preserve_env LIBTOOL |
| 8296 | preserve_env MAKE |
| 8297 | preserve_env NM |
| 8298 | preserve_env OBJCOPY |
| 8299 | preserve_env PATH |
| 8300 | preserve_env PKG_CONFIG |
| 8301 | preserve_env PKG_CONFIG_LIBDIR |
| 8302 | preserve_env PKG_CONFIG_PATH |
| 8303 | preserve_env PYTHON |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 8304 | preserve_env SDL2_CONFIG |
| 8305 | preserve_env SMBD |
| 8306 | preserve_env STRIP |
| 8307 | preserve_env WINDRES |
| 8308 | |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 8309 | printf "exec" >>config.status |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 8310 | for i in "$0" "$@"; do |
| 8311 | test "$i" = --skip-meson || printf " '%s'" "$i" >>config.status |
| 8312 | done |
Dr. David Alan Gilbert | cf7cc92 | 2016-01-12 11:58:48 +0000 | [diff] [blame] | 8313 | echo ' "$@"' >>config.status |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 8314 | chmod +x config.status |
| 8315 | |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 8316 | rm -r "$TMPDIR1" |