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 | 835af89 | 2020-09-08 13:20:45 +0200 | [diff] [blame] | 92 | quote_sh() { |
| 93 | printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&'," |
| 94 | } |
| 95 | |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 96 | print_error() { |
| 97 | (echo |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 98 | echo "ERROR: $1" |
| 99 | while test -n "$2"; do |
| 100 | echo " $2" |
| 101 | shift |
| 102 | done |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 103 | echo) >&2 |
| 104 | } |
| 105 | |
| 106 | error_exit() { |
| 107 | print_error "$@" |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 108 | exit 1 |
| 109 | } |
| 110 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 111 | do_compiler() { |
| 112 | # Run the compiler, capturing its output to the log. First argument |
| 113 | # is compiler binary to execute. |
David CARLIER | 630d86b | 2020-07-18 14:19:10 +0100 | [diff] [blame] | 114 | compiler="$1" |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 115 | shift |
Ian Jackson | 8bbe05d | 2017-09-25 16:41:03 +0100 | [diff] [blame] | 116 | if test -n "$BASH_VERSION"; then eval ' |
| 117 | echo >>config.log " |
| 118 | funcs: ${FUNCNAME[*]} |
| 119 | lines: ${BASH_LINENO[*]}" |
| 120 | '; fi |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 121 | echo $compiler "$@" >> config.log |
| 122 | $compiler "$@" >> config.log 2>&1 || return $? |
Peter Maydell | 8dc38a7 | 2012-07-18 15:10:28 +0100 | [diff] [blame] | 123 | # Test passed. If this is an --enable-werror build, rerun |
| 124 | # the test with -Werror and bail out if it fails. This |
| 125 | # makes warning-generating-errors in configure test code |
| 126 | # obvious to developers. |
| 127 | if test "$werror" != "yes"; then |
| 128 | return 0 |
| 129 | fi |
| 130 | # Don't bother rerunning the compile if we were already using -Werror |
| 131 | case "$*" in |
| 132 | *-Werror*) |
| 133 | return 0 |
| 134 | ;; |
| 135 | esac |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 136 | echo $compiler -Werror "$@" >> config.log |
| 137 | $compiler -Werror "$@" >> config.log 2>&1 && return $? |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 138 | error_exit "configure test passed without -Werror but failed with -Werror." \ |
| 139 | "This is probably a bug in the configure script. The failing command" \ |
| 140 | "will be at the bottom of config.log." \ |
| 141 | "You can run configure with --disable-werror to bypass this check." |
Peter Maydell | 8dc38a7 | 2012-07-18 15:10:28 +0100 | [diff] [blame] | 142 | } |
| 143 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 144 | do_cc() { |
Paolo Bonzini | 4dba278 | 2021-09-29 17:14:43 +0200 | [diff] [blame] | 145 | do_compiler "$cc" $CPU_CFLAGS "$@" |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 146 | } |
| 147 | |
| 148 | do_cxx() { |
Paolo Bonzini | 4dba278 | 2021-09-29 17:14:43 +0200 | [diff] [blame] | 149 | do_compiler "$cxx" $CPU_CFLAGS "$@" |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 150 | } |
| 151 | |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 152 | # Append $2 to the variable named $1, with space separation |
| 153 | add_to() { |
| 154 | eval $1=\${$1:+\"\$$1 \"}\$2 |
| 155 | } |
| 156 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 157 | update_cxxflags() { |
| 158 | # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those |
| 159 | # options which some versions of GCC's C++ compiler complain about |
| 160 | # because they only make sense for C programs. |
Paolo Bonzini | de38c0c | 2021-11-08 08:58:23 +0100 | [diff] [blame] | 161 | QEMU_CXXFLAGS="-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" |
Richard Henderson | 8a9d3d5 | 2021-06-14 16:31:36 -0700 | [diff] [blame] | 162 | CONFIGURE_CXXFLAGS=$(echo "$CONFIGURE_CFLAGS" | sed s/-std=gnu11/-std=gnu++11/) |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 163 | for arg in $QEMU_CFLAGS; do |
| 164 | case $arg in |
| 165 | -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ |
| 166 | -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) |
| 167 | ;; |
| 168 | *) |
| 169 | QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg |
| 170 | ;; |
| 171 | esac |
| 172 | done |
| 173 | } |
| 174 | |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 175 | compile_object() { |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 176 | local_cflags="$1" |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 177 | do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | compile_prog() { |
| 181 | local_cflags="$1" |
| 182 | local_ldflags="$2" |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 183 | do_cc $CFLAGS $EXTRA_CFLAGS $CONFIGURE_CFLAGS $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC \ |
| 184 | $LDFLAGS $EXTRA_LDFLAGS $CONFIGURE_LDFLAGS $QEMU_LDFLAGS $local_ldflags |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 185 | } |
| 186 | |
Paolo Bonzini | 11568d6 | 2010-12-23 11:43:58 +0100 | [diff] [blame] | 187 | # symbolically link $1 to $2. Portable version of "ln -sf". |
| 188 | symlink() { |
Stefan Weil | 72b8b5a | 2012-03-19 13:20:47 +0100 | [diff] [blame] | 189 | rm -rf "$2" |
Anthony Liguori | ec5b06d | 2012-06-06 16:57:00 +0800 | [diff] [blame] | 190 | mkdir -p "$(dirname "$2")" |
Stefan Weil | 72b8b5a | 2012-03-19 13:20:47 +0100 | [diff] [blame] | 191 | ln -s "$1" "$2" |
Paolo Bonzini | 11568d6 | 2010-12-23 11:43:58 +0100 | [diff] [blame] | 192 | } |
| 193 | |
Loïc Minier | 0dba619 | 2010-01-28 21:26:51 +0000 | [diff] [blame] | 194 | # check whether a command is available to this shell (may be either an |
| 195 | # executable or a builtin) |
| 196 | has() { |
| 197 | type "$1" >/dev/null 2>&1 |
| 198 | } |
| 199 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 200 | version_ge () { |
Alex Bennée | 2df52b9 | 2021-02-02 13:39:52 +0000 | [diff] [blame] | 201 | local_ver1=$(expr "$1" : '\([0-9.]*\)' | tr . ' ') |
| 202 | local_ver2=$(echo "$2" | tr . ' ') |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 203 | while true; do |
| 204 | set x $local_ver1 |
| 205 | local_first=${2-0} |
Stefano Garzarella | c44a33e | 2020-08-21 22:35:58 +0200 | [diff] [blame] | 206 | # 'shift 2' if $2 is set, or 'shift' if $2 is not set |
| 207 | shift ${2:+2} |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 208 | local_ver1=$* |
| 209 | set x $local_ver2 |
| 210 | # the second argument finished, the first must be greater or equal |
| 211 | test $# = 1 && return 0 |
| 212 | test $local_first -lt $2 && return 1 |
| 213 | test $local_first -gt $2 && return 0 |
Stefano Garzarella | c44a33e | 2020-08-21 22:35:58 +0200 | [diff] [blame] | 214 | shift ${2:+2} |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 215 | local_ver2=$* |
| 216 | done |
| 217 | } |
| 218 | |
Paolo Bonzini | 3b6b755 | 2012-09-17 11:59:41 +0200 | [diff] [blame] | 219 | glob() { |
| 220 | eval test -z '"${1#'"$2"'}"' |
| 221 | } |
| 222 | |
Christian Borntraeger | e9a3591 | 2017-08-23 12:16:23 +0200 | [diff] [blame] | 223 | ld_has() { |
| 224 | $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 |
| 225 | } |
| 226 | |
Antonio Ospite | 4ace32e | 2019-05-26 16:47:47 +0200 | [diff] [blame] | 227 | if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; |
| 228 | then |
| 229 | error_exit "main directory cannot contain spaces nor colons" |
| 230 | fi |
| 231 | |
Antonio Ospite | 1421182 | 2019-05-26 16:47:46 +0200 | [diff] [blame] | 232 | # default parameters |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 233 | cpu="" |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 234 | iasl="iasl" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 235 | interp_prefix="/usr/gnemul/qemu-%M" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 236 | static="no" |
Joelle van Dyne | 3812c0c | 2021-01-25 17:24:48 -0800 | [diff] [blame] | 237 | cross_compile="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 238 | cross_prefix="" |
Paolo Bonzini | 87430d5 | 2021-10-07 15:06:09 +0200 | [diff] [blame] | 239 | audio_drv_list="default" |
Fam Zheng | b64ec4e | 2013-05-29 19:35:40 +0800 | [diff] [blame] | 240 | block_drv_rw_whitelist="" |
| 241 | block_drv_ro_whitelist="" |
Kevin Wolf | e5f05f8 | 2021-07-09 18:41:41 +0200 | [diff] [blame] | 242 | block_drv_whitelist_tools="no" |
Peter Maydell | e49d021 | 2012-12-07 15:39:13 +0000 | [diff] [blame] | 243 | host_cc="cc" |
Michael Roth | 957f1f9 | 2011-08-11 15:38:12 -0500 | [diff] [blame] | 244 | libs_qga="" |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 245 | debug_info="yes" |
Daniele Buono | cdad781 | 2020-12-04 18:06:11 -0500 | [diff] [blame] | 246 | lto="false" |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 247 | stack_protector="" |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 248 | safe_stack="" |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 249 | use_containers="yes" |
Alex Bennée | f238539 | 2020-04-30 20:01:14 +0100 | [diff] [blame] | 250 | gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 251 | |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 252 | if test -e "$source_path/.git" |
| 253 | then |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 254 | git_submodules_action="update" |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 255 | else |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 256 | git_submodules_action="ignore" |
Daniel P. Berrange | 9271282 | 2017-09-29 11:11:58 +0100 | [diff] [blame] | 257 | fi |
Paolo Bonzini | 2d652f2 | 2021-05-12 09:21:56 +0200 | [diff] [blame] | 258 | |
| 259 | git_submodules="ui/keycodemapdb" |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 260 | git="git" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 261 | |
Stefan Weil | afb63eb | 2012-09-26 22:04:38 +0200 | [diff] [blame] | 262 | # Don't accept a target_list environment variable. |
| 263 | unset target_list |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 264 | unset target_list_exclude |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 265 | |
| 266 | # Default value for a variable defining feature "foo". |
| 267 | # * foo="no" feature will only be used if --enable-foo arg is given |
| 268 | # * foo="" feature will be searched for, and if found, will be used |
| 269 | # unless --disable-foo is given |
| 270 | # * foo="yes" this value will only be set by --enable-foo flag. |
| 271 | # feature will searched for, |
| 272 | # if not found, configure exits with error |
| 273 | # |
| 274 | # Always add --enable-foo and --disable-foo command line args. |
| 275 | # Distributions want to ensure that several features are compiled in, and it |
| 276 | # is impossible without a --enable-foo that exits if a feature is not found. |
| 277 | |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 278 | default_feature="" |
| 279 | # parse CC options second |
| 280 | for opt do |
| 281 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
| 282 | case "$opt" in |
| 283 | --without-default-features) |
| 284 | default_feature="no" |
| 285 | ;; |
| 286 | esac |
| 287 | done |
| 288 | |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 289 | EXTRA_CFLAGS="" |
| 290 | EXTRA_CXXFLAGS="" |
| 291 | EXTRA_LDFLAGS="" |
| 292 | |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 293 | xen_ctrl_version="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 294 | xfs="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 295 | membarrier="$default_feature" |
Thomas Huth | 0848f8a | 2021-07-13 11:31:55 +0200 | [diff] [blame] | 296 | vhost_kernel="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 297 | vhost_net="$default_feature" |
| 298 | vhost_crypto="$default_feature" |
| 299 | vhost_scsi="$default_feature" |
| 300 | vhost_vsock="$default_feature" |
Stefan Hajnoczi | d88618f | 2020-11-10 17:11:21 +0000 | [diff] [blame] | 301 | vhost_user="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 302 | vhost_user_fs="$default_feature" |
Thomas Huth | 0848f8a | 2021-07-13 11:31:55 +0200 | [diff] [blame] | 303 | vhost_vdpa="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 304 | rdma="$default_feature" |
| 305 | pvrdma="$default_feature" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 306 | gprof="no" |
| 307 | debug_tcg="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 308 | debug="no" |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 309 | sanitizers="no" |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 310 | tsan="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 311 | fortify_source="$default_feature" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 312 | strip_opt="yes" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 313 | mingw32="no" |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 314 | gcov="no" |
Miroslav Rezanina | c732827 | 2021-03-31 10:18:45 +0200 | [diff] [blame] | 315 | EXESUF="" |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 316 | modules="no" |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 317 | module_upgrades="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 318 | prefix="/usr/local" |
Marc-André Lureau | 10ff82d | 2020-08-26 15:04:13 +0400 | [diff] [blame] | 319 | qemu_suffix="qemu" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 320 | bsd="no" |
| 321 | linux="no" |
| 322 | solaris="no" |
| 323 | profiler="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 324 | softmmu="yes" |
| 325 | linux_user="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 326 | bsd_user="no" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 327 | pkgversion="" |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 328 | pie="" |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 329 | qom_cast_debug="yes" |
Paolo Bonzini | baf86d6 | 2016-01-07 16:55:31 +0300 | [diff] [blame] | 330 | trace_backends="log" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 331 | trace_file="trace" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 332 | opengl="$default_feature" |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 333 | cpuid_h="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 334 | avx2_opt="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 335 | guest_agent="$default_feature" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 336 | guest_agent_with_vss="no" |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 337 | guest_agent_ntddscsi="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 338 | vss_win32_sdk="$default_feature" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 339 | win_sdk="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 340 | want_tools="$default_feature" |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 341 | coroutine="" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 342 | coroutine_pool="$default_feature" |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 343 | debug_stack_usage="no" |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 344 | crypto_afalg="no" |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 345 | tls_priority="NORMAL" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 346 | tpm="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 347 | live_block_migration=${default_feature:-yes} |
| 348 | numa="$default_feature" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 349 | replication=${default_feature:-yes} |
| 350 | bochs=${default_feature:-yes} |
| 351 | cloop=${default_feature:-yes} |
| 352 | dmg=${default_feature:-yes} |
| 353 | qcow1=${default_feature:-yes} |
| 354 | vdi=${default_feature:-yes} |
| 355 | vvfat=${default_feature:-yes} |
| 356 | qed=${default_feature:-yes} |
| 357 | parallels=${default_feature:-yes} |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 358 | debug_mutex="no" |
Alex Bennée | ba4dd2a | 2021-07-09 15:29:57 +0100 | [diff] [blame] | 359 | plugins="$default_feature" |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 360 | rng_none="no" |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 361 | secret_keyring="$default_feature" |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 362 | meson="" |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 363 | meson_args="" |
Paolo Bonzini | 4832888 | 2020-08-26 08:04:15 +0200 | [diff] [blame] | 364 | ninja="" |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 365 | gio="$default_feature" |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 366 | skip_meson=no |
Joelle van Dyne | b8e0c49 | 2021-03-15 11:03:41 -0700 | [diff] [blame] | 367 | slirp_smbd="$default_feature" |
Paolo Bonzini | 377529c | 2010-12-23 11:43:50 +0100 | [diff] [blame] | 368 | |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 369 | # The following Meson options are handled manually (still they |
| 370 | # are included in the automatically generated help message) |
| 371 | |
| 372 | # 1. Track which submodules are needed |
| 373 | capstone="auto" |
| 374 | fdt="auto" |
| 375 | slirp="auto" |
| 376 | |
| 377 | # 2. Support --with/--without option |
| 378 | default_devices="true" |
| 379 | |
| 380 | # 3. Automatically enable/disable other options |
| 381 | tcg="enabled" |
| 382 | cfi="false" |
| 383 | |
| 384 | # 4. Detection partly done in configure |
| 385 | xen=${default_feature:+disabled} |
Peter Maydell | 898be3e | 2017-03-21 14:31:57 +0000 | [diff] [blame] | 386 | |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 387 | # parse CC options second |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 388 | for opt do |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 389 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 390 | case "$opt" in |
| 391 | --cross-prefix=*) cross_prefix="$optarg" |
Joelle van Dyne | 3812c0c | 2021-01-25 17:24:48 -0800 | [diff] [blame] | 392 | cross_compile="yes" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 393 | ;; |
Paolo Bonzini | 3d8df64 | 2010-12-23 11:43:48 +0100 | [diff] [blame] | 394 | --cc=*) CC="$optarg" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 395 | ;; |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 396 | --cxx=*) CXX="$optarg" |
| 397 | ;; |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 398 | --cpu=*) cpu="$optarg" |
| 399 | ;; |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 400 | --extra-cflags=*) |
| 401 | EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg" |
| 402 | EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" |
| 403 | ;; |
| 404 | --extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 405 | ;; |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 406 | --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg" |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 407 | ;; |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 408 | --enable-debug-info) debug_info="yes" |
| 409 | ;; |
| 410 | --disable-debug-info) debug_info="no" |
| 411 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 412 | --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option" |
| 413 | ;; |
Alex Bennée | d422b2b | 2018-04-13 11:07:58 +0100 | [diff] [blame] | 414 | --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*} |
| 415 | eval "cross_cc_cflags_${cc_arch}=\$optarg" |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 416 | cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}" |
Alex Bennée | d422b2b | 2018-04-13 11:07:58 +0100 | [diff] [blame] | 417 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 418 | --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*} |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 419 | cc_archs="$cc_archs $cc_arch" |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 420 | eval "cross_cc_${cc_arch}=\$optarg" |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 421 | cross_cc_vars="$cross_cc_vars cross_cc_${cc_arch}" |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 422 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 423 | esac |
| 424 | done |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 425 | # OS specific |
| 426 | # 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] | 427 | # we can eliminate its usage altogether. |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 428 | |
Peter Maydell | e49d021 | 2012-12-07 15:39:13 +0000 | [diff] [blame] | 429 | # Preferred compiler: |
| 430 | # ${CC} (if set) |
| 431 | # ${cross_prefix}gcc (if cross-prefix specified) |
| 432 | # system compiler |
| 433 | if test -z "${CC}${cross_prefix}"; then |
| 434 | cc="$host_cc" |
| 435 | else |
| 436 | cc="${CC-${cross_prefix}gcc}" |
| 437 | fi |
| 438 | |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 439 | if test -z "${CXX}${cross_prefix}"; then |
| 440 | cxx="c++" |
| 441 | else |
| 442 | cxx="${CXX-${cross_prefix}g++}" |
| 443 | fi |
| 444 | |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 445 | ar="${AR-${cross_prefix}ar}" |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 446 | as="${AS-${cross_prefix}as}" |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 447 | ccas="${CCAS-$cc}" |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 448 | cpp="${CPP-$cc -E}" |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 449 | objcopy="${OBJCOPY-${cross_prefix}objcopy}" |
| 450 | ld="${LD-${cross_prefix}ld}" |
Alistair Francis | 9f81aeb | 2017-11-07 17:10:46 -0800 | [diff] [blame] | 451 | ranlib="${RANLIB-${cross_prefix}ranlib}" |
Stefan Weil | 4852ee9 | 2014-09-18 21:55:08 +0200 | [diff] [blame] | 452 | nm="${NM-${cross_prefix}nm}" |
Stuart Yoder | b3198cc | 2011-08-04 17:10:08 -0500 | [diff] [blame] | 453 | strip="${STRIP-${cross_prefix}strip}" |
| 454 | windres="${WINDRES-${cross_prefix}windres}" |
Sergei Trofimovich | 17884d7 | 2012-01-31 22:03:45 +0300 | [diff] [blame] | 455 | pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" |
| 456 | query_pkg_config() { |
| 457 | "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" |
| 458 | } |
| 459 | pkg_config=query_pkg_config |
Dave Airlie | 47c0374 | 2013-12-10 14:05:51 +1000 | [diff] [blame] | 460 | sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 461 | |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 462 | # default flags for all hosts |
Peter Maydell | 2d31515 | 2016-09-12 14:10:08 +0100 | [diff] [blame] | 463 | # We use -fwrapv to tell the compiler that we require a C dialect where |
| 464 | # left shift of signed integers is well defined and has the expected |
| 465 | # 2s-complement style results. (Both clang and gcc agree that it |
| 466 | # provides these semantics.) |
Paolo Bonzini | de38c0c | 2021-11-08 08:58:23 +0100 | [diff] [blame] | 467 | QEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv" |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 468 | QEMU_CFLAGS="-Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
Kevin Wolf | c95e308 | 2013-02-22 21:08:51 +0100 | [diff] [blame] | 469 | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 470 | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 471 | |
Paolo Bonzini | de38c0c | 2021-11-08 08:58:23 +0100 | [diff] [blame] | 472 | QEMU_LDFLAGS= |
| 473 | |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 474 | # Flags that are needed during configure but later taken care of by Meson |
Richard Henderson | 8a9d3d5 | 2021-06-14 16:31:36 -0700 | [diff] [blame] | 475 | CONFIGURE_CFLAGS="-std=gnu11 -Wall" |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 476 | CONFIGURE_LDFLAGS= |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 477 | |
Michael S. Tsirkin | be17dc9 | 2009-11-11 13:50:09 +0200 | [diff] [blame] | 478 | |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 479 | check_define() { |
| 480 | cat > $TMPC <<EOF |
| 481 | #if !defined($1) |
Peter Maydell | fd786e1 | 2011-11-23 17:26:43 +0000 | [diff] [blame] | 482 | #error $1 not defined |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 483 | #endif |
| 484 | int main(void) { return 0; } |
| 485 | EOF |
Juan Quintela | 52166aa | 2009-08-03 14:46:03 +0200 | [diff] [blame] | 486 | compile_object |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 487 | } |
| 488 | |
Gerd Hoffmann | 307119e | 2015-06-10 09:07:35 +0200 | [diff] [blame] | 489 | check_include() { |
| 490 | cat > $TMPC <<EOF |
| 491 | #include <$1> |
| 492 | int main(void) { return 0; } |
| 493 | EOF |
| 494 | compile_object |
| 495 | } |
| 496 | |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 497 | write_c_skeleton() { |
| 498 | cat > $TMPC <<EOF |
| 499 | int main(void) { return 0; } |
| 500 | EOF |
| 501 | } |
| 502 | |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 503 | if check_define __linux__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 504 | targetos=linux |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 505 | elif check_define _WIN32 ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 506 | targetos=windows |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 507 | elif check_define __OpenBSD__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 508 | targetos=openbsd |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 509 | elif check_define __sun__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 510 | targetos=sunos |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 511 | elif check_define __HAIKU__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 512 | targetos=haiku |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 513 | elif check_define __FreeBSD__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 514 | targetos=freebsd |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 515 | elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 516 | targetos=gnu/kfreebsd |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 517 | elif check_define __DragonFly__ ; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 518 | targetos=dragonfly |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 519 | elif check_define __NetBSD__; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 520 | targetos=netbsd |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 521 | elif check_define __APPLE__; then |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 522 | targetos=darwin |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 523 | else |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 524 | # This is a fatal error, but don't report it yet, because we |
| 525 | # might be going to just print the --help text, or it might |
| 526 | # be the result of a missing compiler. |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 527 | targetos=bogus |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 528 | fi |
| 529 | |
Paolo Bonzini | 65eff01 | 2021-11-08 22:52:35 +0100 | [diff] [blame] | 530 | # OS specific |
| 531 | |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 532 | case $targetos in |
Paolo Bonzini | 65eff01 | 2021-11-08 22:52:35 +0100 | [diff] [blame] | 533 | windows) |
| 534 | mingw32="yes" |
| 535 | plugins="no" |
| 536 | pie="no" |
| 537 | ;; |
| 538 | gnu/kfreebsd) |
| 539 | bsd="yes" |
| 540 | ;; |
| 541 | freebsd) |
| 542 | bsd="yes" |
| 543 | bsd_user="yes" |
| 544 | make="${MAKE-gmake}" |
| 545 | # needed for kinfo_getvmmap(3) in libutil.h |
| 546 | ;; |
| 547 | dragonfly) |
| 548 | bsd="yes" |
| 549 | make="${MAKE-gmake}" |
| 550 | ;; |
| 551 | netbsd) |
| 552 | bsd="yes" |
| 553 | make="${MAKE-gmake}" |
| 554 | ;; |
| 555 | openbsd) |
| 556 | bsd="yes" |
| 557 | make="${MAKE-gmake}" |
| 558 | ;; |
| 559 | darwin) |
| 560 | bsd="yes" |
| 561 | darwin="yes" |
| 562 | # Disable attempts to use ObjectiveC features in os/object.h since they |
| 563 | # won't work when we're compiling with gcc as a C compiler. |
| 564 | QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" |
| 565 | ;; |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 566 | sunos) |
Paolo Bonzini | 65eff01 | 2021-11-08 22:52:35 +0100 | [diff] [blame] | 567 | solaris="yes" |
| 568 | make="${MAKE-gmake}" |
| 569 | smbd="${SMBD-/usr/sfw/sbin/smbd}" |
| 570 | # needed for CMSG_ macros in sys/socket.h |
| 571 | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" |
| 572 | # needed for TIOCWIN* defines in termios.h |
| 573 | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 574 | # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo |
Paolo Bonzini | 65eff01 | 2021-11-08 22:52:35 +0100 | [diff] [blame] | 575 | # Note that this check is broken for cross-compilation: if you're |
| 576 | # cross-compiling to one of these OSes then you'll need to specify |
| 577 | # the correct CPU with the --cpu option. |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 578 | if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then |
| 579 | cpu="x86_64" |
| 580 | fi |
Paolo Bonzini | 65eff01 | 2021-11-08 22:52:35 +0100 | [diff] [blame] | 581 | ;; |
| 582 | haiku) |
| 583 | pie="no" |
| 584 | QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS" |
| 585 | ;; |
| 586 | linux) |
| 587 | linux="yes" |
| 588 | linux_user="yes" |
| 589 | vhost_user=${default_feature:-yes} |
| 590 | ;; |
Peter Maydell | bbea405 | 2012-08-14 15:35:34 +0100 | [diff] [blame] | 591 | esac |
| 592 | |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 593 | if test ! -z "$cpu" ; then |
| 594 | # command line argument |
| 595 | : |
| 596 | elif check_define __i386__ ; then |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 597 | cpu="i386" |
| 598 | elif check_define __x86_64__ ; then |
Richard Henderson | c72b26e | 2013-08-20 12:20:05 -0700 | [diff] [blame] | 599 | if check_define __ILP32__ ; then |
| 600 | cpu="x32" |
| 601 | else |
| 602 | cpu="x86_64" |
| 603 | fi |
blueswir1 | 3aa9bd6 | 2008-12-31 16:55:26 +0000 | [diff] [blame] | 604 | elif check_define __sparc__ ; then |
blueswir1 | 3aa9bd6 | 2008-12-31 16:55:26 +0000 | [diff] [blame] | 605 | if check_define __arch64__ ; then |
| 606 | cpu="sparc64" |
| 607 | else |
| 608 | cpu="sparc" |
| 609 | fi |
malc | fdf7ed9 | 2009-01-14 18:39:52 +0000 | [diff] [blame] | 610 | elif check_define _ARCH_PPC ; then |
| 611 | if check_define _ARCH_PPC64 ; then |
Richard Henderson | f8378ac | 2019-05-01 15:38:18 -0700 | [diff] [blame] | 612 | if check_define _LITTLE_ENDIAN ; then |
| 613 | cpu="ppc64le" |
| 614 | else |
| 615 | cpu="ppc64" |
| 616 | fi |
malc | fdf7ed9 | 2009-01-14 18:39:52 +0000 | [diff] [blame] | 617 | else |
| 618 | cpu="ppc" |
| 619 | fi |
Aurelien Jarno | afa0523 | 2009-10-17 14:17:47 +0200 | [diff] [blame] | 620 | elif check_define __mips__ ; then |
| 621 | cpu="mips" |
Aurelien Jarno | d66ed0e | 2010-06-13 12:28:21 +0200 | [diff] [blame] | 622 | elif check_define __s390__ ; then |
| 623 | if check_define __s390x__ ; then |
| 624 | cpu="s390x" |
| 625 | else |
| 626 | cpu="s390" |
| 627 | fi |
Alistair Francis | c4f8054 | 2018-12-19 19:20:19 +0000 | [diff] [blame] | 628 | elif check_define __riscv ; then |
Richard Henderson | ba0e733 | 2021-09-17 11:08:09 -0700 | [diff] [blame] | 629 | cpu="riscv" |
Peter Maydell | 21d89f8 | 2011-11-30 10:57:48 +0100 | [diff] [blame] | 630 | elif check_define __arm__ ; then |
| 631 | cpu="arm" |
Claudio Fontana | 1f08031 | 2013-06-12 16:20:23 +0100 | [diff] [blame] | 632 | elif check_define __aarch64__ ; then |
| 633 | cpu="aarch64" |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 634 | else |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 635 | cpu=$(uname -m) |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 636 | fi |
| 637 | |
Paolo Bonzini | 823eb01 | 2021-11-08 14:18:17 +0100 | [diff] [blame] | 638 | # Normalise host CPU name, set multilib cflags |
Peter Maydell | 359bc95 | 2011-12-24 13:07:25 +0000 | [diff] [blame] | 639 | # Note that this case should only have supported host CPUs, not guests. |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 640 | case "$cpu" in |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 641 | armv*b|armv*l|arm) |
| 642 | cpu="arm" ;; |
| 643 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 644 | i386|i486|i586|i686|i86pc|BePC) |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 645 | cpu="i386" |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 646 | CPU_CFLAGS="-m32" ;; |
| 647 | x32) |
Paolo Bonzini | 4da270b | 2021-11-09 09:36:10 +0100 | [diff] [blame] | 648 | cpu="x86_64" |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 649 | CPU_CFLAGS="-mx32" ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 650 | x86_64|amd64) |
| 651 | cpu="x86_64" |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 652 | # ??? Only extremely old AMD cpus do not have cmpxchg16b. |
| 653 | # If we truly care, we should simply detect this case at |
| 654 | # runtime and generate the fallback to serial emulation. |
| 655 | CPU_CFLAGS="-m64 -mcx16" ;; |
| 656 | |
Aurelien Jarno | afa0523 | 2009-10-17 14:17:47 +0200 | [diff] [blame] | 657 | mips*) |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 658 | cpu="mips" ;; |
| 659 | |
| 660 | ppc) |
| 661 | CPU_CFLAGS="-m32" ;; |
| 662 | ppc64) |
Paolo Bonzini | d8ff892 | 2021-11-09 09:18:20 +0100 | [diff] [blame] | 663 | CPU_CFLAGS="-m64 -mbig" ;; |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 664 | ppc64le) |
Paolo Bonzini | d8ff892 | 2021-11-09 09:18:20 +0100 | [diff] [blame] | 665 | cpu="ppc64" |
| 666 | CPU_CFLAGS="-m64 -mlittle" ;; |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 667 | |
| 668 | s390) |
Paolo Bonzini | 823eb01 | 2021-11-08 14:18:17 +0100 | [diff] [blame] | 669 | CPU_CFLAGS="-m31" ;; |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 670 | s390x) |
| 671 | CPU_CFLAGS="-m64" ;; |
| 672 | |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 673 | sparc|sun4[cdmuv]) |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 674 | cpu="sparc" |
Paolo Bonzini | e4da0e3 | 2021-11-09 09:23:56 +0100 | [diff] [blame] | 675 | CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" ;; |
| 676 | sparc64) |
| 677 | CPU_CFLAGS="-m64 -mcpu=ultrasparc" ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 678 | esac |
Juan Quintela | e2d52ad | 2009-08-12 18:20:24 +0200 | [diff] [blame] | 679 | |
Paolo Bonzini | 0db4a06 | 2010-12-23 11:43:49 +0100 | [diff] [blame] | 680 | : ${make=${MAKE-make}} |
Paolo Bonzini | b6daf4d | 2020-09-01 06:38:04 -0400 | [diff] [blame] | 681 | |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 682 | # We prefer python 3.x. A bare 'python' is traditionally |
| 683 | # 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] | 684 | # we check that too |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 685 | python= |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 686 | explicit_python=no |
Eduardo Habkost | ddf9069 | 2019-10-16 19:42:37 -0300 | [diff] [blame] | 687 | for binary in "${PYTHON-python3}" python |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 688 | do |
| 689 | if has "$binary" |
| 690 | then |
Paolo Bonzini | 95c5f2d | 2019-06-10 12:03:44 +0200 | [diff] [blame] | 691 | python=$(command -v "$binary") |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 692 | break |
| 693 | fi |
| 694 | done |
Markus Armbruster | 903458c | 2020-02-14 18:18:41 +0100 | [diff] [blame] | 695 | |
Markus Armbruster | 903458c | 2020-02-14 18:18:41 +0100 | [diff] [blame] | 696 | |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 697 | # Check for ancillary tools used in testing |
| 698 | genisoimage= |
Alex Bennée | 3df437c | 2020-05-19 09:22:48 -0400 | [diff] [blame] | 699 | for binary in genisoimage mkisofs |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 700 | do |
| 701 | if has $binary |
| 702 | then |
| 703 | genisoimage=$(command -v "$binary") |
| 704 | break |
| 705 | fi |
| 706 | done |
| 707 | |
Peter Maydell | 3c4a4d0 | 2012-08-11 22:34:40 +0100 | [diff] [blame] | 708 | # Default objcc to clang if available, otherwise use CC |
| 709 | if has clang; then |
| 710 | objcc=clang |
| 711 | else |
| 712 | objcc="$cc" |
| 713 | fi |
| 714 | |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 715 | if test "$mingw32" = "yes" ; then |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 716 | EXESUF=".exe" |
Stefan Weil | 78e9d4a | 2015-11-26 12:13:12 +0100 | [diff] [blame] | 717 | # MinGW needs -mthreads for TLS and macro _MT. |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 718 | CONFIGURE_CFLAGS="-mthreads $CONFIGURE_CFLAGS" |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 719 | write_c_skeleton; |
Paolo Bonzini | d17f305 | 2020-08-18 12:17:01 +0200 | [diff] [blame] | 720 | prefix="/qemu" |
Marc-André Lureau | 77433a5 | 2020-08-26 15:04:12 +0400 | [diff] [blame] | 721 | qemu_suffix="" |
Bishara AbuHattoum | 105fad6 | 2017-08-22 16:55:04 +0300 | [diff] [blame] | 722 | libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga" |
Juan Quintela | 3457a3f | 2009-08-03 14:46:07 +0200 | [diff] [blame] | 723 | fi |
| 724 | |
Anthony Liguori | 487fefd | 2009-06-11 13:28:25 -0500 | [diff] [blame] | 725 | werror="" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 726 | |
Paolo Bonzini | 61d6309 | 2021-10-07 15:08:28 +0200 | [diff] [blame] | 727 | . $source_path/scripts/meson-buildoptions.sh |
| 728 | |
| 729 | meson_options= |
| 730 | meson_option_parse() { |
| 731 | meson_options="$meson_options $(_meson_option_parse "$@")" |
| 732 | if test $? -eq 1; then |
| 733 | echo "ERROR: unknown option $1" |
| 734 | echo "Try '$0 --help' for more information" |
| 735 | exit 1 |
| 736 | fi |
| 737 | } |
| 738 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 739 | for opt do |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 740 | optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 741 | case "$opt" in |
bellard | 2efc326 | 2005-12-18 19:14:49 +0000 | [diff] [blame] | 742 | --help|-h) show_help=yes |
| 743 | ;; |
Mike Frysinger | 99123e1 | 2011-04-07 01:12:28 -0400 | [diff] [blame] | 744 | --version|-V) exec cat $source_path/VERSION |
| 745 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 746 | --prefix=*) prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 747 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 748 | --interp-prefix=*) interp_prefix="$optarg" |
bellard | 32ce633 | 2003-04-11 00:16:16 +0000 | [diff] [blame] | 749 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 750 | --cross-prefix=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 751 | ;; |
aliguori | ac0df51 | 2008-12-29 17:14:15 +0000 | [diff] [blame] | 752 | --cc=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 753 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 754 | --host-cc=*) host_cc="$optarg" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 755 | ;; |
Tomoki Sekiyama | 83f73fc | 2013-08-07 11:39:36 -0400 | [diff] [blame] | 756 | --cxx=*) |
| 757 | ;; |
Michael S. Tsirkin | e007dbe | 2013-11-24 11:38:05 +0200 | [diff] [blame] | 758 | --iasl=*) iasl="$optarg" |
| 759 | ;; |
Peter Maydell | 3c4a4d0 | 2012-08-11 22:34:40 +0100 | [diff] [blame] | 760 | --objcc=*) objcc="$optarg" |
| 761 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 762 | --make=*) make="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 763 | ;; |
Paolo Bonzini | b6daf4d | 2020-09-01 06:38:04 -0400 | [diff] [blame] | 764 | --install=*) |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 765 | ;; |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 766 | --python=*) python="$optarg" ; explicit_python=yes |
Blue Swirl | c886edf | 2011-07-22 21:08:09 +0000 | [diff] [blame] | 767 | ;; |
Peter Maydell | 2eb054c | 2020-02-13 17:56:18 +0000 | [diff] [blame] | 768 | --sphinx-build=*) sphinx_build="$optarg" |
| 769 | ;; |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 770 | --skip-meson) skip_meson=yes |
| 771 | ;; |
| 772 | --meson=*) meson="$optarg" |
| 773 | ;; |
Paolo Bonzini | 4832888 | 2020-08-26 08:04:15 +0200 | [diff] [blame] | 774 | --ninja=*) ninja="$optarg" |
| 775 | ;; |
Brad | e2d8830 | 2011-09-02 16:53:28 -0400 | [diff] [blame] | 776 | --smbd=*) smbd="$optarg" |
| 777 | ;; |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 778 | --extra-cflags=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 779 | ;; |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 780 | --extra-cxxflags=*) |
| 781 | ;; |
Juan Quintela | e2a2ed0 | 2009-08-03 14:46:02 +0200 | [diff] [blame] | 782 | --extra-ldflags=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 783 | ;; |
Gerd Hoffmann | 5bc62e0 | 2012-02-08 13:54:13 +0100 | [diff] [blame] | 784 | --enable-debug-info) |
| 785 | ;; |
| 786 | --disable-debug-info) |
| 787 | ;; |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 788 | --cross-cc-*) |
| 789 | ;; |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 790 | --enable-modules) |
| 791 | modules="yes" |
| 792 | ;; |
Stefan Hajnoczi | 3aa88b3 | 2015-11-02 14:06:23 +0000 | [diff] [blame] | 793 | --disable-modules) |
| 794 | modules="no" |
| 795 | ;; |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 796 | --disable-module-upgrades) module_upgrades="no" |
| 797 | ;; |
| 798 | --enable-module-upgrades) module_upgrades="yes" |
| 799 | ;; |
Juan Quintela | 2ff6b91 | 2009-08-03 14:45:55 +0200 | [diff] [blame] | 800 | --cpu=*) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 801 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 802 | --target-list=*) target_list="$optarg" |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 803 | if test "$target_list_exclude"; then |
| 804 | error_exit "Can't mix --target-list with --target-list-exclude" |
| 805 | fi |
| 806 | ;; |
| 807 | --target-list-exclude=*) target_list_exclude="$optarg" |
| 808 | if test "$target_list"; then |
| 809 | error_exit "Can't mix --target-list-exclude with --target-list" |
| 810 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 811 | ;; |
Paolo Bonzini | 74242e0 | 2010-12-23 11:44:02 +0100 | [diff] [blame] | 812 | --with-trace-file=*) trace_file="$optarg" |
Prerna Saxena | 9410b56 | 2010-07-13 09:26:32 +0100 | [diff] [blame] | 813 | ;; |
Paolo Bonzini | 7bc3ca7 | 2020-11-20 08:38:22 +0100 | [diff] [blame] | 814 | --with-default-devices) default_devices="true" |
Paolo Bonzini | f349474 | 2019-01-23 14:56:17 +0800 | [diff] [blame] | 815 | ;; |
Paolo Bonzini | 7bc3ca7 | 2020-11-20 08:38:22 +0100 | [diff] [blame] | 816 | --without-default-devices) default_devices="false" |
Paolo Bonzini | f349474 | 2019-01-23 14:56:17 +0800 | [diff] [blame] | 817 | ;; |
Alex Bennée | d1d5e9e | 2021-07-07 14:17:44 +0100 | [diff] [blame] | 818 | --with-devices-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --with-devices-FOO option" |
| 819 | ;; |
| 820 | --with-devices-*) device_arch=${opt#--with-devices-}; |
| 821 | device_arch=${device_arch%%=*} |
| 822 | cf=$source_path/configs/devices/$device_arch-softmmu/$optarg.mak |
| 823 | if test -f "$cf"; then |
| 824 | device_archs="$device_archs $device_arch" |
| 825 | eval "devices_${device_arch}=\$optarg" |
| 826 | else |
| 827 | error_exit "File $cf does not exist" |
| 828 | fi |
| 829 | ;; |
Alex Bennée | c87ea11 | 2020-12-10 19:04:13 +0000 | [diff] [blame] | 830 | --without-default-features) # processed above |
| 831 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 832 | --enable-gprof) gprof="yes" |
| 833 | ;; |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 834 | --enable-gcov) gcov="yes" |
| 835 | ;; |
Loïc Minier | 7942769 | 2010-01-31 12:23:45 +0100 | [diff] [blame] | 836 | --static) |
| 837 | static="yes" |
Sergei Trofimovich | 17884d7 | 2012-01-31 22:03:45 +0300 | [diff] [blame] | 838 | QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 839 | ;; |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 840 | --mandir=*) mandir="$optarg" |
| 841 | ;; |
| 842 | --bindir=*) bindir="$optarg" |
| 843 | ;; |
Alon Levy | 3aa5d2b | 2011-05-15 12:08:59 +0300 | [diff] [blame] | 844 | --libdir=*) libdir="$optarg" |
| 845 | ;; |
Michael Tokarev | 8bf188a | 2012-06-07 01:11:00 +0400 | [diff] [blame] | 846 | --libexecdir=*) libexecdir="$optarg" |
| 847 | ;; |
Alon Levy | 0f94d6d | 2011-06-27 11:58:20 +0200 | [diff] [blame] | 848 | --includedir=*) includedir="$optarg" |
| 849 | ;; |
Eduardo Habkost | 528ae5b | 2012-04-18 16:55:49 -0300 | [diff] [blame] | 850 | --datadir=*) datadir="$optarg" |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 851 | ;; |
Marc-André Lureau | 77433a5 | 2020-08-26 15:04:12 +0400 | [diff] [blame] | 852 | --with-suffix=*) qemu_suffix="$optarg" |
Eduardo Habkost | 023d3d6 | 2012-04-18 16:55:50 -0300 | [diff] [blame] | 853 | ;; |
Bruce Rogers | c650263 | 2020-10-15 13:07:42 -0600 | [diff] [blame] | 854 | --docdir=*) docdir="$optarg" |
Paolo Bonzini | 0b24e75 | 2010-05-26 16:08:26 +0200 | [diff] [blame] | 855 | ;; |
Paolo Bonzini | fe0038b | 2020-10-16 04:35:10 -0400 | [diff] [blame] | 856 | --localedir=*) localedir="$optarg" |
| 857 | ;; |
Andre Przywara | ca2fb93 | 2010-03-08 14:09:48 +0100 | [diff] [blame] | 858 | --sysconfdir=*) sysconfdir="$optarg" |
Anthony Liguori | 07381cc | 2010-01-21 10:30:29 -0600 | [diff] [blame] | 859 | ;; |
Luiz Capitulino | 785c23a | 2012-10-03 18:35:57 -0300 | [diff] [blame] | 860 | --localstatedir=*) local_statedir="$optarg" |
| 861 | ;; |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 862 | --firmwarepath=*) firmwarepath="$optarg" |
| 863 | ;; |
Olaf Hering | 181ce1d | 2018-04-18 09:50:44 +0200 | [diff] [blame] | 864 | --host=*|--build=*|\ |
| 865 | --disable-dependency-tracking|\ |
Luiz Capitulino | 785c23a | 2012-10-03 18:35:57 -0300 | [diff] [blame] | 866 | --sbindir=*|--sharedstatedir=*|\ |
Paolo Bonzini | fe0038b | 2020-10-16 04:35:10 -0400 | [diff] [blame] | 867 | --oldincludedir=*|--datarootdir=*|--infodir=*|\ |
Max Filippov | 023ddd7 | 2011-11-24 16:11:31 +0400 | [diff] [blame] | 868 | --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) |
| 869 | # These switches are silently ignored, for compatibility with |
| 870 | # autoconf-generated configure scripts. This allows QEMU's |
| 871 | # configure to be used by RPM and similar macros that set |
| 872 | # lots of directory switches by default. |
| 873 | ;; |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 874 | --disable-qom-cast-debug) qom_cast_debug="no" |
| 875 | ;; |
| 876 | --enable-qom-cast-debug) qom_cast_debug="yes" |
| 877 | ;; |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 878 | --audio-drv-list=*) audio_drv_list="$optarg" |
| 879 | ;; |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 880 | --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] | 881 | ;; |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 882 | --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] | 883 | ;; |
Kevin Wolf | e5f05f8 | 2021-07-09 18:41:41 +0200 | [diff] [blame] | 884 | --enable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="yes" |
| 885 | ;; |
| 886 | --disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="no" |
| 887 | ;; |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 888 | --enable-debug-tcg) debug_tcg="yes" |
| 889 | ;; |
| 890 | --disable-debug-tcg) debug_tcg="no" |
| 891 | ;; |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 892 | --enable-debug) |
| 893 | # Enable debugging options that aren't excessively noisy |
| 894 | debug_tcg="yes" |
Peter Xu | 1fcc6d4 | 2018-04-25 10:54:59 +0800 | [diff] [blame] | 895 | debug_mutex="yes" |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 896 | debug="yes" |
| 897 | strip_opt="no" |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 898 | fortify_source="no" |
Paul Brook | f3d08ee | 2009-06-04 11:39:04 +0100 | [diff] [blame] | 899 | ;; |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 900 | --enable-sanitizers) sanitizers="yes" |
| 901 | ;; |
| 902 | --disable-sanitizers) sanitizers="no" |
| 903 | ;; |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 904 | --enable-tsan) tsan="yes" |
| 905 | ;; |
| 906 | --disable-tsan) tsan="no" |
| 907 | ;; |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 908 | --disable-strip) strip_opt="no" |
| 909 | ;; |
Paolo Bonzini | 4d34a86 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 910 | --disable-slirp) slirp="disabled" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 911 | ;; |
Paolo Bonzini | fd6fc21 | 2020-11-20 11:19:38 +0100 | [diff] [blame] | 912 | --enable-slirp) slirp="enabled" |
| 913 | ;; |
Paolo Bonzini | 4d34a86 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 914 | --enable-slirp=git) slirp="internal" |
Marc-André Lureau | 7c57bdd | 2019-04-24 13:00:41 +0200 | [diff] [blame] | 915 | ;; |
Paolo Bonzini | 03a3c0b | 2021-10-07 15:08:27 +0200 | [diff] [blame] | 916 | --enable-slirp=*) slirp="$optarg" |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 917 | ;; |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 918 | --disable-xen) xen="disabled" |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 919 | ;; |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 920 | --enable-xen) xen="enabled" |
Juan Quintela | fc321b4 | 2009-08-12 18:29:55 +0200 | [diff] [blame] | 921 | ;; |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 922 | --disable-tcg) tcg="disabled" |
Alex Bennée | d1a1425 | 2021-07-09 15:29:54 +0100 | [diff] [blame] | 923 | plugins="no" |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 924 | ;; |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 925 | --enable-tcg) tcg="enabled" |
Paolo Bonzini | b3f6ea7 | 2017-07-03 16:59:07 +0200 | [diff] [blame] | 926 | ;; |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 927 | --enable-profiler) profiler="yes" |
| 928 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 929 | --disable-system) softmmu="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 930 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 931 | --enable-system) softmmu="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 932 | ;; |
Zachary Amsden | 0953a80 | 2009-07-30 00:14:59 -1000 | [diff] [blame] | 933 | --disable-user) |
| 934 | linux_user="no" ; |
| 935 | bsd_user="no" ; |
Zachary Amsden | 0953a80 | 2009-07-30 00:14:59 -1000 | [diff] [blame] | 936 | ;; |
| 937 | --enable-user) ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 938 | --disable-linux-user) linux_user="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 939 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 940 | --enable-linux-user) linux_user="yes" |
| 941 | ;; |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 942 | --disable-bsd-user) bsd_user="no" |
| 943 | ;; |
| 944 | --enable-bsd-user) bsd_user="yes" |
| 945 | ;; |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 946 | --enable-pie) pie="yes" |
Kirill A. Shutemov | 34005a0 | 2009-09-12 02:17:55 +0300 | [diff] [blame] | 947 | ;; |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 948 | --disable-pie) pie="no" |
Kirill A. Shutemov | 34005a0 | 2009-09-12 02:17:55 +0300 | [diff] [blame] | 949 | ;; |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 950 | --enable-werror) werror="yes" |
| 951 | ;; |
| 952 | --disable-werror) werror="no" |
| 953 | ;; |
Daniele Buono | cdad781 | 2020-12-04 18:06:11 -0500 | [diff] [blame] | 954 | --enable-lto) lto="true" |
| 955 | ;; |
| 956 | --disable-lto) lto="false" |
| 957 | ;; |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 958 | --enable-stack-protector) stack_protector="yes" |
| 959 | ;; |
| 960 | --disable-stack-protector) stack_protector="no" |
| 961 | ;; |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 962 | --enable-safe-stack) safe_stack="yes" |
| 963 | ;; |
| 964 | --disable-safe-stack) safe_stack="no" |
| 965 | ;; |
Daniele Buono | 9e62ba4 | 2020-12-04 18:06:14 -0500 | [diff] [blame] | 966 | --enable-cfi) |
| 967 | cfi="true"; |
| 968 | lto="true"; |
| 969 | ;; |
| 970 | --disable-cfi) cfi="false" |
| 971 | ;; |
Paolo Bonzini | fbb4121 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 972 | --disable-fdt) fdt="disabled" |
Juan Quintela | 2df87df | 2009-08-12 18:29:54 +0200 | [diff] [blame] | 973 | ;; |
Paolo Bonzini | fbb4121 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 974 | --enable-fdt) fdt="enabled" |
| 975 | ;; |
| 976 | --enable-fdt=git) fdt="internal" |
| 977 | ;; |
Paolo Bonzini | 03a3c0b | 2021-10-07 15:08:27 +0200 | [diff] [blame] | 978 | --enable-fdt=*) fdt="$optarg" |
Juan Quintela | 2df87df | 2009-08-12 18:29:54 +0200 | [diff] [blame] | 979 | ;; |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 980 | --disable-membarrier) membarrier="no" |
| 981 | ;; |
| 982 | --enable-membarrier) membarrier="yes" |
| 983 | ;; |
Thomas Huth | 7e563bf | 2018-02-15 12:06:47 +0100 | [diff] [blame] | 984 | --with-pkgversion=*) pkgversion="$optarg" |
pbrook | 4a19f1e | 2009-04-07 23:17:49 +0000 | [diff] [blame] | 985 | ;; |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 986 | --with-coroutine=*) coroutine="$optarg" |
| 987 | ;; |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 988 | --disable-coroutine-pool) coroutine_pool="no" |
| 989 | ;; |
| 990 | --enable-coroutine-pool) coroutine_pool="yes" |
| 991 | ;; |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 992 | --enable-debug-stack-usage) debug_stack_usage="yes" |
| 993 | ;; |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 994 | --enable-crypto-afalg) crypto_afalg="yes" |
| 995 | ;; |
| 996 | --disable-crypto-afalg) crypto_afalg="no" |
| 997 | ;; |
Michael S. Tsirkin | d597005 | 2010-03-17 13:08:17 +0200 | [diff] [blame] | 998 | --disable-vhost-net) vhost_net="no" |
| 999 | ;; |
| 1000 | --enable-vhost-net) vhost_net="yes" |
| 1001 | ;; |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 1002 | --disable-vhost-crypto) vhost_crypto="no" |
| 1003 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1004 | --enable-vhost-crypto) vhost_crypto="yes" |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 1005 | ;; |
Nicholas Bellinger | 5e9be92 | 2013-03-29 01:08:16 +0000 | [diff] [blame] | 1006 | --disable-vhost-scsi) vhost_scsi="no" |
| 1007 | ;; |
| 1008 | --enable-vhost-scsi) vhost_scsi="yes" |
| 1009 | ;; |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 1010 | --disable-vhost-vsock) vhost_vsock="no" |
| 1011 | ;; |
| 1012 | --enable-vhost-vsock) vhost_vsock="yes" |
| 1013 | ;; |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 1014 | --disable-vhost-user-fs) vhost_user_fs="no" |
| 1015 | ;; |
| 1016 | --enable-vhost-user-fs) vhost_user_fs="yes" |
| 1017 | ;; |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 1018 | --disable-opengl) opengl="no" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 1019 | ;; |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 1020 | --enable-opengl) opengl="yes" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 1021 | ;; |
Sergei Trofimovich | 8c84cf1 | 2012-01-24 20:42:40 +0300 | [diff] [blame] | 1022 | --disable-xfsctl) xfs="no" |
| 1023 | ;; |
| 1024 | --enable-xfsctl) xfs="yes" |
| 1025 | ;; |
Paolo Bonzini | 1ffb3bb | 2020-08-28 19:33:54 +0200 | [diff] [blame] | 1026 | --disable-zlib-test) |
Alon Levy | 1ece990 | 2011-07-26 12:30:40 +0300 | [diff] [blame] | 1027 | ;; |
Michael Roth | d138cee | 2011-08-01 14:52:57 -0500 | [diff] [blame] | 1028 | --enable-guest-agent) guest_agent="yes" |
| 1029 | ;; |
| 1030 | --disable-guest-agent) guest_agent="no" |
| 1031 | ;; |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 1032 | --with-vss-sdk) vss_win32_sdk="" |
| 1033 | ;; |
| 1034 | --with-vss-sdk=*) vss_win32_sdk="$optarg" |
| 1035 | ;; |
| 1036 | --without-vss-sdk) vss_win32_sdk="no" |
| 1037 | ;; |
| 1038 | --with-win-sdk) win_sdk="" |
| 1039 | ;; |
| 1040 | --with-win-sdk=*) win_sdk="$optarg" |
| 1041 | ;; |
| 1042 | --without-win-sdk) win_sdk="no" |
| 1043 | ;; |
Daniel P. Berrange | 4b1c11f | 2012-09-10 12:26:29 +0100 | [diff] [blame] | 1044 | --enable-tools) want_tools="yes" |
| 1045 | ;; |
| 1046 | --disable-tools) want_tools="no" |
| 1047 | ;; |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 1048 | --disable-avx2) avx2_opt="no" |
| 1049 | ;; |
| 1050 | --enable-avx2) avx2_opt="yes" |
| 1051 | ;; |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 1052 | --disable-avx512f) avx512f_opt="no" |
| 1053 | ;; |
| 1054 | --enable-avx512f) avx512f_opt="yes" |
| 1055 | ;; |
Fam Zheng | 52b53c0 | 2014-09-10 14:17:51 +0800 | [diff] [blame] | 1056 | --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) |
| 1057 | 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] | 1058 | ;; |
Fam Zheng | cb6414d | 2016-09-21 12:27:16 +0800 | [diff] [blame] | 1059 | --enable-vhdx|--disable-vhdx) |
| 1060 | echo "$0: $opt is obsolete, VHDX driver is always built" >&2 |
| 1061 | ;; |
Fam Zheng | 315d318 | 2016-09-21 12:27:21 +0800 | [diff] [blame] | 1062 | --enable-uuid|--disable-uuid) |
| 1063 | echo "$0: $opt is obsolete, UUID support is always built" >&2 |
| 1064 | ;; |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 1065 | --tls-priority=*) tls_priority="$optarg" |
| 1066 | ;; |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 1067 | --enable-rdma) rdma="yes" |
| 1068 | ;; |
| 1069 | --disable-rdma) rdma="no" |
| 1070 | ;; |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 1071 | --enable-pvrdma) pvrdma="yes" |
| 1072 | ;; |
| 1073 | --disable-pvrdma) pvrdma="no" |
| 1074 | ;; |
Cole Robinson | e91c793 | 2014-06-16 15:32:47 -0400 | [diff] [blame] | 1075 | --disable-tpm) tpm="no" |
| 1076 | ;; |
Stefan Berger | ab214c2 | 2013-02-27 12:47:52 -0500 | [diff] [blame] | 1077 | --enable-tpm) tpm="yes" |
| 1078 | ;; |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 1079 | --disable-live-block-migration) live_block_migration="no" |
| 1080 | ;; |
| 1081 | --enable-live-block-migration) live_block_migration="yes" |
| 1082 | ;; |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 1083 | --disable-numa) numa="no" |
| 1084 | ;; |
| 1085 | --enable-numa) numa="yes" |
| 1086 | ;; |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 1087 | --disable-replication) replication="no" |
| 1088 | ;; |
| 1089 | --enable-replication) replication="yes" |
| 1090 | ;; |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 1091 | --disable-bochs) bochs="no" |
| 1092 | ;; |
| 1093 | --enable-bochs) bochs="yes" |
| 1094 | ;; |
| 1095 | --disable-cloop) cloop="no" |
| 1096 | ;; |
| 1097 | --enable-cloop) cloop="yes" |
| 1098 | ;; |
| 1099 | --disable-dmg) dmg="no" |
| 1100 | ;; |
| 1101 | --enable-dmg) dmg="yes" |
| 1102 | ;; |
| 1103 | --disable-qcow1) qcow1="no" |
| 1104 | ;; |
| 1105 | --enable-qcow1) qcow1="yes" |
| 1106 | ;; |
| 1107 | --disable-vdi) vdi="no" |
| 1108 | ;; |
| 1109 | --enable-vdi) vdi="yes" |
| 1110 | ;; |
| 1111 | --disable-vvfat) vvfat="no" |
| 1112 | ;; |
| 1113 | --enable-vvfat) vvfat="yes" |
| 1114 | ;; |
| 1115 | --disable-qed) qed="no" |
| 1116 | ;; |
| 1117 | --enable-qed) qed="yes" |
| 1118 | ;; |
| 1119 | --disable-parallels) parallels="no" |
| 1120 | ;; |
| 1121 | --enable-parallels) parallels="yes" |
| 1122 | ;; |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 1123 | --disable-vhost-user) vhost_user="no" |
| 1124 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1125 | --enable-vhost-user) vhost_user="yes" |
| 1126 | ;; |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1127 | --disable-vhost-vdpa) vhost_vdpa="no" |
| 1128 | ;; |
| 1129 | --enable-vhost-vdpa) vhost_vdpa="yes" |
| 1130 | ;; |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1131 | --disable-vhost-kernel) vhost_kernel="no" |
| 1132 | ;; |
| 1133 | --enable-vhost-kernel) vhost_kernel="yes" |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 1134 | ;; |
Richard Henderson | 8b18cdb | 2020-09-13 12:19:25 -0700 | [diff] [blame] | 1135 | --disable-capstone) capstone="disabled" |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 1136 | ;; |
Richard Henderson | 8b18cdb | 2020-09-13 12:19:25 -0700 | [diff] [blame] | 1137 | --enable-capstone) capstone="enabled" |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 1138 | ;; |
Richard Henderson | 8b18cdb | 2020-09-13 12:19:25 -0700 | [diff] [blame] | 1139 | --enable-capstone=git) capstone="internal" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 1140 | ;; |
Paolo Bonzini | 03a3c0b | 2021-10-07 15:08:27 +0200 | [diff] [blame] | 1141 | --enable-capstone=*) capstone="$optarg" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 1142 | ;; |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 1143 | --with-git=*) git="$optarg" |
| 1144 | ;; |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1145 | --with-git-submodules=*) |
| 1146 | git_submodules_action="$optarg" |
Daniel P. Berrange | f62bbee | 2017-10-26 13:52:26 +0100 | [diff] [blame] | 1147 | ;; |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 1148 | --enable-debug-mutex) debug_mutex=yes |
| 1149 | ;; |
| 1150 | --disable-debug-mutex) debug_mutex=no |
| 1151 | ;; |
Alex Bennée | 9b8e429 | 2021-07-09 15:29:56 +0100 | [diff] [blame] | 1152 | --enable-plugins) if test "$mingw32" = "yes"; then |
| 1153 | error_exit "TCG plugins not currently supported on Windows platforms" |
| 1154 | else |
| 1155 | plugins="yes" |
| 1156 | fi |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 1157 | ;; |
| 1158 | --disable-plugins) plugins="no" |
| 1159 | ;; |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 1160 | --enable-containers) use_containers="yes" |
| 1161 | ;; |
| 1162 | --disable-containers) use_containers="no" |
| 1163 | ;; |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 1164 | --gdb=*) gdb_bin="$optarg" |
| 1165 | ;; |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 1166 | --enable-rng-none) rng_none=yes |
| 1167 | ;; |
| 1168 | --disable-rng-none) rng_none=no |
| 1169 | ;; |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 1170 | --enable-keyring) secret_keyring="yes" |
| 1171 | ;; |
| 1172 | --disable-keyring) secret_keyring="no" |
| 1173 | ;; |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 1174 | --enable-gio) gio=yes |
| 1175 | ;; |
| 1176 | --disable-gio) gio=no |
| 1177 | ;; |
Joelle van Dyne | b8e0c49 | 2021-03-15 11:03:41 -0700 | [diff] [blame] | 1178 | --enable-slirp-smbd) slirp_smbd=yes |
| 1179 | ;; |
| 1180 | --disable-slirp-smbd) slirp_smbd=no |
| 1181 | ;; |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 1182 | # backwards compatibility options |
| 1183 | --enable-trace-backend=*) meson_option_parse "--enable-trace-backends=$optarg" "$optarg" |
| 1184 | ;; |
| 1185 | --disable-blobs) meson_option_parse --disable-install-blobs "" |
| 1186 | ;; |
| 1187 | --enable-tcmalloc) meson_option_parse --enable-malloc=tcmalloc tcmalloc |
| 1188 | ;; |
| 1189 | --enable-jemalloc) meson_option_parse --enable-malloc=jemalloc jemalloc |
| 1190 | ;; |
| 1191 | # everything else has the same name in configure and meson |
Paolo Bonzini | 61d6309 | 2021-10-07 15:08:28 +0200 | [diff] [blame] | 1192 | --enable-* | --disable-*) meson_option_parse "$opt" "$optarg" |
| 1193 | ;; |
Fam Zheng | 2d2ad6d | 2014-04-18 14:55:36 +0800 | [diff] [blame] | 1194 | *) |
| 1195 | echo "ERROR: unknown option $opt" |
| 1196 | echo "Try '$0 --help' for more information" |
| 1197 | exit 1 |
balrog | 7f1559c | 2007-11-17 10:24:32 +0000 | [diff] [blame] | 1198 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1199 | esac |
| 1200 | done |
| 1201 | |
Alex Bennée | d1a1425 | 2021-07-09 15:29:54 +0100 | [diff] [blame] | 1202 | # test for any invalid configuration combinations |
| 1203 | if test "$plugins" = "yes" -a "$tcg" = "disabled"; then |
| 1204 | error_exit "Can't enable plugins on non-TCG builds" |
| 1205 | fi |
| 1206 | |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1207 | case $git_submodules_action in |
| 1208 | update|validate) |
| 1209 | if test ! -e "$source_path/.git"; then |
| 1210 | echo "ERROR: cannot $git_submodules_action git submodules without .git" |
| 1211 | exit 1 |
| 1212 | fi |
| 1213 | ;; |
| 1214 | ignore) |
Paolo Bonzini | b80fd28 | 2021-05-12 09:18:55 +0200 | [diff] [blame] | 1215 | if ! test -f "$source_path/ui/keycodemapdb/README" |
| 1216 | then |
| 1217 | echo |
| 1218 | echo "ERROR: missing GIT submodules" |
| 1219 | echo |
| 1220 | if test -e "$source_path/.git"; then |
| 1221 | echo "--with-git-submodules=ignore specified but submodules were not" |
| 1222 | echo "checked out. Please initialize and update submodules." |
| 1223 | else |
| 1224 | echo "This is not a GIT checkout but module content appears to" |
| 1225 | echo "be missing. Do not use 'git archive' or GitHub download links" |
| 1226 | echo "to acquire QEMU source archives. Non-GIT builds are only" |
| 1227 | echo "supported with source archives linked from:" |
| 1228 | echo |
| 1229 | echo " https://www.qemu.org/download/#source" |
| 1230 | echo |
| 1231 | echo "Developers working with GIT can use scripts/archive-source.sh" |
| 1232 | echo "if they need to create valid source archives." |
| 1233 | fi |
| 1234 | echo |
| 1235 | exit 1 |
| 1236 | fi |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1237 | ;; |
| 1238 | *) |
| 1239 | echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'" |
| 1240 | exit 1 |
| 1241 | ;; |
| 1242 | esac |
| 1243 | |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1244 | libdir="${libdir:-$prefix/lib}" |
| 1245 | libexecdir="${libexecdir:-$prefix/libexec}" |
| 1246 | includedir="${includedir:-$prefix/include}" |
| 1247 | |
| 1248 | if test "$mingw32" = "yes" ; then |
Joshua Watt | 15588a6 | 2021-01-12 15:02:39 -0600 | [diff] [blame] | 1249 | bindir="${bindir:-$prefix}" |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1250 | else |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1251 | bindir="${bindir:-$prefix/bin}" |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1252 | fi |
Joshua Watt | 15588a6 | 2021-01-12 15:02:39 -0600 | [diff] [blame] | 1253 | mandir="${mandir:-$prefix/share/man}" |
| 1254 | datadir="${datadir:-$prefix/share}" |
| 1255 | docdir="${docdir:-$prefix/share/doc}" |
| 1256 | sysconfdir="${sysconfdir:-$prefix/etc}" |
| 1257 | local_statedir="${local_statedir:-$prefix/var}" |
Paolo Bonzini | 16bf7a3 | 2020-10-16 03:19:14 -0400 | [diff] [blame] | 1258 | firmwarepath="${firmwarepath:-$datadir/qemu-firmware}" |
| 1259 | localedir="${localedir:-$datadir/locale}" |
Marc-André Lureau | 22a8780 | 2019-07-11 19:13:39 +0400 | [diff] [blame] | 1260 | |
Alex Bennée | 9557af9 | 2021-09-17 17:23:22 +0100 | [diff] [blame] | 1261 | if eval test -z "\${cross_cc_$cpu}"; then |
| 1262 | eval "cross_cc_${cpu}=\$cc" |
| 1263 | cross_cc_vars="$cross_cc_vars cross_cc_${cpu}" |
| 1264 | fi |
Peter Crosthwaite | 79f3b12 | 2013-04-18 14:46:14 +1000 | [diff] [blame] | 1265 | |
Peter Maydell | affc88c | 2016-06-13 11:32:24 +0100 | [diff] [blame] | 1266 | # For user-mode emulation the host arch has to be one we explicitly |
| 1267 | # support, even if we're using TCI. |
| 1268 | if [ "$ARCH" = "unknown" ]; then |
| 1269 | bsd_user="no" |
| 1270 | linux_user="no" |
| 1271 | fi |
| 1272 | |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1273 | default_target_list="" |
Markus Armbruster | 4369223 | 2021-05-03 10:40:34 +0200 | [diff] [blame] | 1274 | deprecated_targets_list=ppc64abi32-linux-user |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 1275 | deprecated_features="" |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1276 | mak_wilds="" |
| 1277 | |
| 1278 | if [ "$softmmu" = "yes" ]; then |
Alex Bennée | 812b31d | 2021-07-07 14:17:43 +0100 | [diff] [blame] | 1279 | mak_wilds="${mak_wilds} $source_path/configs/targets/*-softmmu.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1280 | fi |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1281 | if [ "$linux_user" = "yes" ]; then |
Alex Bennée | 812b31d | 2021-07-07 14:17:43 +0100 | [diff] [blame] | 1282 | mak_wilds="${mak_wilds} $source_path/configs/targets/*-linux-user.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1283 | fi |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1284 | if [ "$bsd_user" = "yes" ]; then |
Alex Bennée | 812b31d | 2021-07-07 14:17:43 +0100 | [diff] [blame] | 1285 | mak_wilds="${mak_wilds} $source_path/configs/targets/*-bsd-user.mak" |
Peter Maydell | 60e0df2 | 2011-05-03 14:50:13 +0100 | [diff] [blame] | 1286 | fi |
| 1287 | |
Alex Bennée | 3a5ae4a | 2020-09-15 14:43:13 +0100 | [diff] [blame] | 1288 | # If the user doesn't explicitly specify a deprecated target we will |
| 1289 | # skip it. |
| 1290 | if test -z "$target_list"; then |
| 1291 | if test -z "$target_list_exclude"; then |
| 1292 | target_list_exclude="$deprecated_targets_list" |
| 1293 | else |
| 1294 | target_list_exclude="$target_list_exclude,$deprecated_targets_list" |
| 1295 | fi |
Alex Bennée | 2d838d9 | 2020-09-09 12:27:37 +0100 | [diff] [blame] | 1296 | fi |
| 1297 | |
Alex Bennée | 2d838d9 | 2020-09-09 12:27:37 +0100 | [diff] [blame] | 1298 | for config in $mak_wilds; do |
| 1299 | target="$(basename "$config" .mak)" |
Alex Bennée | 98db9a0 | 2020-09-15 14:43:14 +0100 | [diff] [blame] | 1300 | if echo "$target_list_exclude" | grep -vq "$target"; then |
Alex Bennée | 2d838d9 | 2020-09-09 12:27:37 +0100 | [diff] [blame] | 1301 | default_target_list="${default_target_list} $target" |
| 1302 | fi |
| 1303 | done |
Peter Maydell | 6e92f82 | 2013-05-20 16:16:15 +0100 | [diff] [blame] | 1304 | |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1305 | if test x"$show_help" = x"yes" ; then |
| 1306 | cat << EOF |
| 1307 | |
| 1308 | Usage: configure [options] |
| 1309 | Options: [defaults in brackets after descriptions] |
| 1310 | |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1311 | Standard options: |
| 1312 | --help print this message |
| 1313 | --prefix=PREFIX install in PREFIX [$prefix] |
| 1314 | --interp-prefix=PREFIX where to find shared libraries, etc. |
| 1315 | use %M for cpu name [$interp_prefix] |
Alex Bennée | 2deca81 | 2020-10-29 20:14:49 +0000 | [diff] [blame] | 1316 | --target-list=LIST set target list (default: build all non-deprecated) |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1317 | $(echo Available targets: $default_target_list | \ |
| 1318 | fold -s -w 53 | sed -e 's/^/ /') |
Alex Bennée | 2deca81 | 2020-10-29 20:14:49 +0000 | [diff] [blame] | 1319 | $(echo Deprecated targets: $deprecated_targets_list | \ |
| 1320 | fold -s -w 53 | sed -e 's/^/ /') |
Alex Bennée | 447e133 | 2019-03-19 11:59:12 +0000 | [diff] [blame] | 1321 | --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] | 1322 | |
| 1323 | Advanced options (experts only): |
Joelle van Dyne | 3812c0c | 2021-01-25 17:24:48 -0800 | [diff] [blame] | 1324 | --cross-prefix=PREFIX use PREFIX for compile tools, PREFIX can be blank [$cross_prefix] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1325 | --cc=CC use C compiler CC [$cc] |
| 1326 | --iasl=IASL use ACPI compiler IASL [$iasl] |
| 1327 | --host-cc=CC use C compiler CC [$host_cc] for code run at |
| 1328 | build time |
| 1329 | --cxx=CXX use C++ compiler CXX [$cxx] |
| 1330 | --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 1331 | --extra-cflags=CFLAGS append extra C compiler flags CFLAGS |
| 1332 | --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1333 | --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS |
Alex Bennée | d75402b | 2018-04-04 20:27:05 +0100 | [diff] [blame] | 1334 | --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] | 1335 | --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1336 | --make=MAKE use specified make [$make] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1337 | --python=PYTHON use specified python [$python] |
Peter Maydell | 2eb054c | 2020-02-13 17:56:18 +0000 | [diff] [blame] | 1338 | --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1339 | --meson=MESON use specified meson [$meson] |
Paolo Bonzini | 4832888 | 2020-08-26 08:04:15 +0200 | [diff] [blame] | 1340 | --ninja=NINJA use specified ninja [$ninja] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1341 | --smbd=SMBD use specified smbd [$smbd] |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1342 | --with-git=GIT use specified git [$git] |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1343 | --with-git-submodules=update update git submodules (default if .git dir exists) |
| 1344 | --with-git-submodules=validate fail if git submodules are not up to date |
| 1345 | --with-git-submodules=ignore do not update or check git submodules (default if no .git dir) |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1346 | --static enable static build [$static] |
| 1347 | --mandir=PATH install man pages in PATH |
Marc-André Lureau | 10ff82d | 2020-08-26 15:04:13 +0400 | [diff] [blame] | 1348 | --datadir=PATH install firmware in PATH/$qemu_suffix |
Paolo Bonzini | fe0038b | 2020-10-16 04:35:10 -0400 | [diff] [blame] | 1349 | --localedir=PATH install translation in PATH/$qemu_suffix |
Marc-André Lureau | 10ff82d | 2020-08-26 15:04:13 +0400 | [diff] [blame] | 1350 | --docdir=PATH install documentation in PATH/$qemu_suffix |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1351 | --bindir=PATH install binaries in PATH |
| 1352 | --libdir=PATH install libraries in PATH |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1353 | --libexecdir=PATH install helper binaries in PATH |
Marc-André Lureau | 10ff82d | 2020-08-26 15:04:13 +0400 | [diff] [blame] | 1354 | --sysconfdir=PATH install config in PATH/$qemu_suffix |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1355 | --localstatedir=PATH install local state in PATH (set at runtime on win32) |
Gerd Hoffmann | 3d5eeca | 2017-09-14 13:42:36 +0200 | [diff] [blame] | 1356 | --firmwarepath=PATH search PATH for firmware files |
Robert Foley | 1333660 | 2020-07-01 14:56:21 +0100 | [diff] [blame] | 1357 | --efi-aarch64=PATH PATH of efi file to use for aarch64 VMs. |
Marc-André Lureau | ca8c090 | 2020-08-26 15:04:14 +0400 | [diff] [blame] | 1358 | --with-suffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix] |
Thomas Huth | db1b5f1 | 2018-03-27 17:09:30 +0200 | [diff] [blame] | 1359 | --with-pkgversion=VERS use specified string as sub-version of the package |
Paolo Bonzini | c035c8d | 2020-12-14 11:34:47 +0100 | [diff] [blame] | 1360 | --without-default-features default all --enable-* options to "disabled" |
| 1361 | --without-default-devices do not include any device that is not needed to |
| 1362 | start the emulator (only use if you are including |
Alex Bennée | d1d5e9e | 2021-07-07 14:17:44 +0100 | [diff] [blame] | 1363 | desired devices in configs/devices/) |
| 1364 | --with-devices-ARCH=NAME override default configs/devices |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1365 | --enable-debug enable common debug build options |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 1366 | --enable-sanitizers enable default sanitizers |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 1367 | --enable-tsan enable thread sanitizer |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1368 | --disable-strip disable stripping binaries |
| 1369 | --disable-werror disable compilation abort on warning |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1370 | --disable-stack-protector disable compiler-provided stack protection |
Paolo Bonzini | 16bfbc7 | 2021-11-02 14:56:22 +0100 | [diff] [blame] | 1371 | --audio-drv-list=LIST set audio drivers to try if -audiodev is not used |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1372 | --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L |
| 1373 | --block-drv-rw-whitelist=L |
| 1374 | set block driver read-write whitelist |
Kevin Wolf | e5f05f8 | 2021-07-09 18:41:41 +0200 | [diff] [blame] | 1375 | (by default affects only QEMU, not tools like qemu-img) |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1376 | --block-drv-ro-whitelist=L |
| 1377 | set block driver read-only whitelist |
Kevin Wolf | e5f05f8 | 2021-07-09 18:41:41 +0200 | [diff] [blame] | 1378 | (by default affects only QEMU, not tools like qemu-img) |
| 1379 | --enable-block-drv-whitelist-in-tools |
| 1380 | use block whitelist also in tools instead of only QEMU |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1381 | --with-trace-file=NAME Full PATH,NAME of file to store traces |
| 1382 | Default:trace-<pid> |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1383 | --cpu=CPU Build for host CPU [$cpu] |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1384 | --with-coroutine=BACKEND coroutine backend. Supported options: |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 1385 | ucontext, sigaltstack, windows |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1386 | --enable-gcov enable test coverage analysis with gcov |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1387 | --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent |
| 1388 | --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] | 1389 | --tls-priority default TLS protocol/cipher priority string |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1390 | --enable-gprof QEMU profiling with gprof |
| 1391 | --enable-profiler profiler support |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1392 | --enable-debug-stack-usage |
| 1393 | 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] | 1394 | --enable-plugins |
| 1395 | enable plugins via shared library loading |
Alex Bennée | afc3a8f | 2019-11-28 16:35:24 +0100 | [diff] [blame] | 1396 | --disable-containers don't use containers for cross-building |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 1397 | --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] |
Paolo Bonzini | 61d6309 | 2021-10-07 15:08:28 +0200 | [diff] [blame] | 1398 | EOF |
| 1399 | meson_options_help |
| 1400 | cat << EOF |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1401 | system all system emulation targets |
| 1402 | user supported user emulation targets |
| 1403 | linux-user all linux usermode emulation targets |
| 1404 | bsd-user all BSD usermode emulation targets |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1405 | guest-agent build the QEMU Guest Agent |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1406 | pie Position Independent Executables |
Marc-André Lureau | 21e709a | 2019-07-18 16:04:13 +0400 | [diff] [blame] | 1407 | modules modules support (non-Windows) |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 1408 | module-upgrades try to load modules from alternate paths for upgrades |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1409 | debug-tcg TCG debugging (default is disabled) |
| 1410 | debug-info debugging information |
Daniele Buono | cdad781 | 2020-12-04 18:06:11 -0500 | [diff] [blame] | 1411 | lto Enable Link-Time Optimization. |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 1412 | safe-stack SafeStack Stack Smash Protection. Depends on |
| 1413 | clang/llvm >= 3.7 and requires coroutine backend ucontext. |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 1414 | membarrier membarrier system call (for Linux 4.14+ or Windows) |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 1415 | rdma Enable RDMA-based migration |
| 1416 | pvrdma Enable PVRDMA support |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1417 | vhost-net vhost-net kernel acceleration support |
| 1418 | vhost-vsock virtio sockets device support |
| 1419 | vhost-scsi vhost-scsi kernel target support |
| 1420 | vhost-crypto vhost-user-crypto backend support |
| 1421 | vhost-kernel vhost kernel backend support |
| 1422 | vhost-user vhost-user backend support |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1423 | vhost-vdpa vhost-vdpa kernel backend support |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 1424 | live-block-migration Block migration in the main migration stream |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1425 | coroutine-pool coroutine freelist (better performance) |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1426 | tpm TPM support |
Michael Tokarev | c23f23b | 2015-06-17 22:19:26 +0300 | [diff] [blame] | 1427 | numa libnuma support |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 1428 | avx2 AVX2 optimization support |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 1429 | avx512f AVX512F optimization support |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 1430 | replication replication support |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1431 | opengl opengl support |
Lin Ma | c12d66a | 2017-03-10 18:14:05 +0800 | [diff] [blame] | 1432 | xfsctl xfsctl support |
| 1433 | qom-cast-debug cast debugging support |
Cleber Rosa | 8de73fa | 2019-02-07 14:36:03 -0500 | [diff] [blame] | 1434 | tools build qemu-io, qemu-nbd and qemu-img tools |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 1435 | bochs bochs image format support |
| 1436 | cloop cloop image format support |
| 1437 | dmg dmg image format support |
| 1438 | qcow1 qcow v1 image format support |
| 1439 | vdi vdi image format support |
| 1440 | vvfat vvfat image format support |
| 1441 | qed qed image format support |
| 1442 | parallels parallels image format support |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 1443 | crypto-afalg Linux AF_ALG crypto backend driver |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 1444 | debug-mutex mutex debugging support |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 1445 | rng-none dummy RNG, avoid using /dev/(u)random and getrandom() |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 1446 | gio libgio support |
Joelle van Dyne | b8e0c49 | 2021-03-15 11:03:41 -0700 | [diff] [blame] | 1447 | slirp-smbd use smbd (at path --smbd=*) in slirp networking |
Stefan Weil | 08fb77e | 2013-12-18 22:09:39 +0100 | [diff] [blame] | 1448 | |
| 1449 | NOTE: The object files are built at the place where configure is launched |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1450 | EOF |
Fam Zheng | 2d2ad6d | 2014-04-18 14:55:36 +0800 | [diff] [blame] | 1451 | exit 0 |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 1452 | fi |
| 1453 | |
Thomas Huth | 9c79024 | 2019-03-11 11:20:34 +0100 | [diff] [blame] | 1454 | # Remove old dependency files to make sure that they get properly regenerated |
Thomas Huth | bb768f7 | 2019-05-10 10:11:59 +0200 | [diff] [blame] | 1455 | rm -f */config-devices.mak.d |
Thomas Huth | 9c79024 | 2019-03-11 11:20:34 +0100 | [diff] [blame] | 1456 | |
Daniel P. Berrangé | faf4414 | 2019-03-27 17:07:01 +0000 | [diff] [blame] | 1457 | if test -z "$python" |
| 1458 | then |
| 1459 | error_exit "Python not found. Use --python=/path/to/python" |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1460 | fi |
Roman Bolshakov | 8e2c76b | 2020-08-25 23:27:55 +0300 | [diff] [blame] | 1461 | if ! has "$make" |
| 1462 | then |
| 1463 | error_exit "GNU make ($make) not found" |
| 1464 | fi |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1465 | |
| 1466 | # Note that if the Python conditional here evaluates True we will exit |
| 1467 | # with status 1 which is a shell 'false' value. |
Thomas Huth | 1b11f28 | 2020-09-25 16:40:27 +0100 | [diff] [blame] | 1468 | if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then |
| 1469 | error_exit "Cannot use '$python', Python >= 3.6 is required." \ |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1470 | "Use --python=/path/to/python to specify a supported Python." |
| 1471 | fi |
| 1472 | |
Cleber Rosa | 755ee70 | 2018-11-09 10:07:07 -0500 | [diff] [blame] | 1473 | # Preserve python version since some functionality is dependent on it |
Cleber Rosa | 406ab2f | 2019-08-26 11:58:32 -0400 | [diff] [blame] | 1474 | 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] | 1475 | |
Stefan Hajnoczi | c53eeaf | 2017-03-28 14:44:18 +0100 | [diff] [blame] | 1476 | # Suppress writing compiled files |
| 1477 | python="$python -B" |
| 1478 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1479 | if test -z "$meson"; then |
Paolo Bonzini | 6638cae | 2021-10-27 15:18:48 +0200 | [diff] [blame] | 1480 | if test "$explicit_python" = no && has meson && version_ge "$(meson --version)" 0.59.3; then |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1481 | meson=meson |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1482 | elif test $git_submodules_action != 'ignore' ; then |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1483 | meson=git |
| 1484 | elif test -e "${source_path}/meson/meson.py" ; then |
| 1485 | meson=internal |
| 1486 | else |
| 1487 | if test "$explicit_python" = yes; then |
| 1488 | error_exit "--python requires using QEMU's embedded Meson distribution, but it was not found." |
| 1489 | else |
| 1490 | error_exit "Meson not found. Use --meson=/path/to/meson" |
| 1491 | fi |
| 1492 | fi |
| 1493 | else |
| 1494 | # Meson uses its own Python interpreter to invoke other Python scripts, |
| 1495 | # but the user wants to use the one they specified with --python. |
| 1496 | # |
| 1497 | # We do not want to override the distro Python interpreter (and sometimes |
| 1498 | # cannot: for example in Homebrew /usr/bin/meson is a bash script), so |
| 1499 | # just require --meson=git|internal together with --python. |
| 1500 | if test "$explicit_python" = yes; then |
| 1501 | case "$meson" in |
| 1502 | git | internal) ;; |
| 1503 | *) error_exit "--python requires using QEMU's embedded Meson distribution." ;; |
| 1504 | esac |
| 1505 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1506 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1507 | |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1508 | if test "$meson" = git; then |
| 1509 | git_submodules="${git_submodules} meson" |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1510 | fi |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1511 | |
| 1512 | case "$meson" in |
| 1513 | git | internal) |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1514 | meson="$python ${source_path}/meson/meson.py" |
| 1515 | ;; |
Paolo Bonzini | 84ec0c2 | 2020-09-04 10:00:26 -0400 | [diff] [blame] | 1516 | *) meson=$(command -v "$meson") ;; |
Marc-André Lureau | 0a01d76 | 2019-08-21 11:21:16 +0400 | [diff] [blame] | 1517 | esac |
| 1518 | |
Paolo Bonzini | 09e9332 | 2020-08-13 09:28:11 -0400 | [diff] [blame] | 1519 | # Probe for ninja |
Paolo Bonzini | 4832888 | 2020-08-26 08:04:15 +0200 | [diff] [blame] | 1520 | |
| 1521 | if test -z "$ninja"; then |
| 1522 | for c in ninja ninja-build samu; do |
| 1523 | if has $c; then |
| 1524 | ninja=$(command -v "$c") |
| 1525 | break |
| 1526 | fi |
| 1527 | done |
Paolo Bonzini | 09e9332 | 2020-08-13 09:28:11 -0400 | [diff] [blame] | 1528 | if test -z "$ninja"; then |
| 1529 | error_exit "Cannot find Ninja" |
| 1530 | fi |
Paolo Bonzini | 4832888 | 2020-08-26 08:04:15 +0200 | [diff] [blame] | 1531 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 1532 | |
Daniel Henrique Barboza | 9aae6e5 | 2017-11-02 07:09:06 -0200 | [diff] [blame] | 1533 | # Check that the C compiler works. Doing this here before testing |
| 1534 | # the host CPU ensures that we had a valid CC to autodetect the |
| 1535 | # $cpu var (and we should bail right here if that's not the case). |
| 1536 | # It also allows the help message to be printed without a CC. |
| 1537 | write_c_skeleton; |
| 1538 | if compile_object ; then |
| 1539 | : C compiler works ok |
| 1540 | else |
| 1541 | error_exit "\"$cc\" either does not exist or does not work" |
| 1542 | fi |
| 1543 | if ! compile_prog ; then |
| 1544 | error_exit "\"$cc\" cannot build an executable (is your linker broken?)" |
| 1545 | fi |
| 1546 | |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 1547 | # Consult white-list to determine whether to enable werror |
| 1548 | # by default. Only enable by default for git builds |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 1549 | if test -z "$werror" ; then |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 1550 | if test "$git_submodules_action" != "ignore" && \ |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 1551 | { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then |
Peter Maydell | 9c83ffd | 2014-02-25 18:27:49 +0000 | [diff] [blame] | 1552 | werror="yes" |
| 1553 | else |
| 1554 | werror="no" |
| 1555 | fi |
| 1556 | fi |
| 1557 | |
Paolo Bonzini | 975ff03 | 2020-11-20 10:34:10 +0100 | [diff] [blame] | 1558 | if test "$targetos" = "bogus"; then |
Peter Maydell | fb59dab | 2017-03-28 14:01:52 +0100 | [diff] [blame] | 1559 | # Now that we know that we're not printing the help and that |
| 1560 | # the compiler works (so the results of the check_defines we used |
| 1561 | # to identify the OS are reliable), if we didn't recognize the |
| 1562 | # host OS we should stop now. |
Peter Maydell | 951fedf | 2017-07-13 16:15:32 +0100 | [diff] [blame] | 1563 | error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" |
Peter Maydell | fb59dab | 2017-03-28 14:01:52 +0100 | [diff] [blame] | 1564 | fi |
| 1565 | |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 1566 | # Check whether the compiler matches our minimum requirements: |
| 1567 | cat > $TMPC << EOF |
| 1568 | #if defined(__clang_major__) && defined(__clang_minor__) |
| 1569 | # ifdef __apple_build_version__ |
Daniel P. Berrangé | 2a85a08 | 2021-05-14 13:04:15 +0100 | [diff] [blame] | 1570 | # if __clang_major__ < 10 || (__clang_major__ == 10 && __clang_minor__ < 0) |
| 1571 | # error You need at least XCode Clang v10.0 to compile QEMU |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 1572 | # endif |
| 1573 | # else |
Daniel P. Berrangé | 2a85a08 | 2021-05-14 13:04:15 +0100 | [diff] [blame] | 1574 | # if __clang_major__ < 6 || (__clang_major__ == 6 && __clang_minor__ < 0) |
| 1575 | # error You need at least Clang v6.0 to compile QEMU |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 1576 | # endif |
| 1577 | # endif |
| 1578 | #elif defined(__GNUC__) && defined(__GNUC_MINOR__) |
nia | 3830df5 | 2021-10-01 15:30:03 +0000 | [diff] [blame] | 1579 | # if __GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ < 4) |
| 1580 | # error You need at least GCC v7.4.0 to compile QEMU |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 1581 | # endif |
| 1582 | #else |
| 1583 | # error You either need GCC or Clang to compiler QEMU |
| 1584 | #endif |
| 1585 | int main (void) { return 0; } |
| 1586 | EOF |
| 1587 | if ! compile_prog "" "" ; then |
nia | 3830df5 | 2021-10-01 15:30:03 +0000 | [diff] [blame] | 1588 | error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v10.0)" |
Thomas Huth | efc6c07 | 2018-12-03 10:12:32 +0100 | [diff] [blame] | 1589 | fi |
| 1590 | |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 1591 | # Accumulate -Wfoo and -Wno-bar separately. |
| 1592 | # We will list all of the enable flags first, and the disable flags second. |
| 1593 | # Note that we do not add -Werror, because that would enable it for all |
| 1594 | # configure tests. If a configure test failed due to -Werror this would |
| 1595 | # just silently disable some features, so it's too error prone. |
| 1596 | |
| 1597 | warn_flags= |
| 1598 | add_to warn_flags -Wold-style-declaration |
| 1599 | add_to warn_flags -Wold-style-definition |
| 1600 | add_to warn_flags -Wtype-limits |
| 1601 | add_to warn_flags -Wformat-security |
| 1602 | add_to warn_flags -Wformat-y2k |
| 1603 | add_to warn_flags -Winit-self |
| 1604 | add_to warn_flags -Wignored-qualifiers |
| 1605 | add_to warn_flags -Wempty-body |
| 1606 | add_to warn_flags -Wnested-externs |
| 1607 | add_to warn_flags -Wendif-labels |
| 1608 | add_to warn_flags -Wexpansion-to-defined |
Thomas Huth | 0a2ebce | 2020-12-11 16:24:26 +0100 | [diff] [blame] | 1609 | add_to warn_flags -Wimplicit-fallthrough=2 |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 1610 | |
| 1611 | nowarn_flags= |
| 1612 | add_to nowarn_flags -Wno-initializer-overrides |
| 1613 | add_to nowarn_flags -Wno-missing-include-dirs |
| 1614 | add_to nowarn_flags -Wno-shift-negative-value |
| 1615 | add_to nowarn_flags -Wno-string-plus-int |
| 1616 | add_to nowarn_flags -Wno-typedef-redefinition |
Richard Henderson | aabab96 | 2020-06-17 13:13:07 -0700 | [diff] [blame] | 1617 | add_to nowarn_flags -Wno-tautological-type-limit-compare |
Richard Henderson | bac8d22 | 2020-06-17 13:13:08 -0700 | [diff] [blame] | 1618 | add_to nowarn_flags -Wno-psabi |
Richard Henderson | 00849b9 | 2020-06-17 13:13:06 -0700 | [diff] [blame] | 1619 | |
| 1620 | gcc_flags="$warn_flags $nowarn_flags" |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 1621 | |
| 1622 | cc_has_warning_flag() { |
| 1623 | write_c_skeleton; |
| 1624 | |
Peter Maydell | a1d29d6 | 2012-10-27 22:19:07 +0100 | [diff] [blame] | 1625 | # Use the positive sense of the flag when testing for -Wno-wombat |
| 1626 | # support (gcc will happily accept the -Wno- form of unknown |
| 1627 | # warning options). |
John Snow | 93b2586 | 2015-03-25 18:57:37 -0400 | [diff] [blame] | 1628 | optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')" |
| 1629 | compile_prog "-Werror $optflag" "" |
| 1630 | } |
| 1631 | |
| 1632 | for flag in $gcc_flags; do |
| 1633 | if cc_has_warning_flag $flag ; then |
| 1634 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
Paolo Bonzini | 8d05095 | 2010-12-23 11:43:52 +0100 | [diff] [blame] | 1635 | fi |
| 1636 | done |
| 1637 | |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 1638 | if test "$stack_protector" != "no"; then |
Rodrigo Rebello | fccd35a | 2015-11-12 12:04:28 -0200 | [diff] [blame] | 1639 | cat > $TMPC << EOF |
| 1640 | int main(int argc, char *argv[]) |
| 1641 | { |
| 1642 | char arr[64], *p = arr, *c = argv[0]; |
| 1643 | while (*c) { |
| 1644 | *p++ = *c++; |
| 1645 | } |
| 1646 | return 0; |
| 1647 | } |
| 1648 | EOF |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1649 | gcc_flags="-fstack-protector-strong -fstack-protector-all" |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 1650 | sp_on=0 |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1651 | for flag in $gcc_flags; do |
Peter Maydell | 590e5dd | 2014-04-11 17:13:52 +0100 | [diff] [blame] | 1652 | # We need to check both a compile and a link, since some compiler |
| 1653 | # 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] | 1654 | if compile_object "-Werror $flag" && |
Peter Maydell | 590e5dd | 2014-04-11 17:13:52 +0100 | [diff] [blame] | 1655 | compile_prog "-Werror $flag" ""; then |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1656 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 1657 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 1658 | sp_on=1 |
Steven Noonan | 63678e1 | 2014-03-28 17:19:02 +0100 | [diff] [blame] | 1659 | break |
| 1660 | fi |
| 1661 | done |
Miroslav Rezanina | 3b463a3 | 2014-07-02 10:05:24 +0200 | [diff] [blame] | 1662 | if test "$stack_protector" = yes; then |
| 1663 | if test $sp_on = 0; then |
| 1664 | error_exit "Stack protector not supported" |
| 1665 | fi |
| 1666 | fi |
Marc-André Lureau | 37746c5 | 2013-02-25 23:31:12 +0100 | [diff] [blame] | 1667 | fi |
| 1668 | |
Paolo Bonzini | 20bc94a | 2017-10-20 12:11:32 +0200 | [diff] [blame] | 1669 | # Disable -Wmissing-braces on older compilers that warn even for |
| 1670 | # the "universal" C zero initializer {0}. |
| 1671 | cat > $TMPC << EOF |
| 1672 | struct { |
| 1673 | int a[2]; |
| 1674 | } x = {0}; |
| 1675 | EOF |
| 1676 | if compile_object "-Werror" "" ; then |
| 1677 | : |
| 1678 | else |
| 1679 | QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces" |
| 1680 | fi |
| 1681 | |
Marc-André Lureau | 21e709a | 2019-07-18 16:04:13 +0400 | [diff] [blame] | 1682 | # Our module code doesn't support Windows |
| 1683 | if test "$modules" = "yes" && test "$mingw32" = "yes" ; then |
| 1684 | error_exit "Modules are not available for Windows" |
| 1685 | fi |
| 1686 | |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 1687 | # module_upgrades is only reasonable if modules are enabled |
| 1688 | if test "$modules" = "no" && test "$module_upgrades" = "yes" ; then |
| 1689 | error_exit "Can't enable module-upgrades as Modules are not enabled" |
| 1690 | fi |
| 1691 | |
Alex Bennée | 5f2453a | 2021-07-09 15:29:55 +0100 | [diff] [blame] | 1692 | # Static linking is not possible with plugins, modules or PIE |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1693 | if test "$static" = "yes" ; then |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 1694 | if test "$modules" = "yes" ; then |
| 1695 | error_exit "static and modules are mutually incompatible" |
| 1696 | fi |
Alex Bennée | 5f2453a | 2021-07-09 15:29:55 +0100 | [diff] [blame] | 1697 | if test "$plugins" = "yes"; then |
| 1698 | error_exit "static and plugins are mutually incompatible" |
Alex Bennée | ba4dd2a | 2021-07-09 15:29:57 +0100 | [diff] [blame] | 1699 | else |
| 1700 | plugins="no" |
Alex Bennée | 5f2453a | 2021-07-09 15:29:55 +0100 | [diff] [blame] | 1701 | fi |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1702 | fi |
| 1703 | |
Richard Henderson | b263412 | 2019-12-17 13:54:56 -1000 | [diff] [blame] | 1704 | cat > $TMPC << EOF |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 1705 | |
| 1706 | #ifdef __linux__ |
| 1707 | # define THREAD __thread |
| 1708 | #else |
| 1709 | # define THREAD |
| 1710 | #endif |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 1711 | static THREAD int tls_var; |
Avi Kivity | 21d4a79 | 2011-11-23 11:24:25 +0200 | [diff] [blame] | 1712 | int main(void) { return tls_var; } |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1713 | EOF |
Alex Bennée | 412aeac | 2019-08-15 19:41:51 +0000 | [diff] [blame] | 1714 | |
Jessica Clarke | ffd205e | 2021-08-05 20:25:45 +0100 | [diff] [blame] | 1715 | # Check we support -fno-pie and -no-pie first; we will need the former for |
| 1716 | # building ROMs, and both for everything if --disable-pie is passed. |
Richard Henderson | b263412 | 2019-12-17 13:54:56 -1000 | [diff] [blame] | 1717 | if compile_prog "-Werror -fno-pie" "-no-pie"; then |
| 1718 | CFLAGS_NOPIE="-fno-pie" |
Jessica Clarke | ffd205e | 2021-08-05 20:25:45 +0100 | [diff] [blame] | 1719 | LDFLAGS_NOPIE="-no-pie" |
Richard Henderson | b263412 | 2019-12-17 13:54:56 -1000 | [diff] [blame] | 1720 | fi |
| 1721 | |
Richard Henderson | 1278146 | 2019-12-17 15:30:14 -1000 | [diff] [blame] | 1722 | if test "$static" = "yes"; then |
Richard Henderson | eca7a8e | 2020-04-03 20:11:50 +0100 | [diff] [blame] | 1723 | if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 1724 | CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS" |
Richard Henderson | 1278146 | 2019-12-17 15:30:14 -1000 | [diff] [blame] | 1725 | QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS" |
| 1726 | pie="yes" |
| 1727 | elif test "$pie" = "yes"; then |
| 1728 | error_exit "-static-pie not available due to missing toolchain support" |
| 1729 | else |
| 1730 | QEMU_LDFLAGS="-static $QEMU_LDFLAGS" |
| 1731 | pie="no" |
| 1732 | fi |
| 1733 | elif test "$pie" = "no"; then |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 1734 | CONFIGURE_CFLAGS="$CFLAGS_NOPIE $CONFIGURE_CFLAGS" |
Jessica Clarke | ffd205e | 2021-08-05 20:25:45 +0100 | [diff] [blame] | 1735 | CONFIGURE_LDFLAGS="$LDFLAGS_NOPIE $CONFIGURE_LDFLAGS" |
Richard Henderson | eca7a8e | 2020-04-03 20:11:50 +0100 | [diff] [blame] | 1736 | elif compile_prog "-Werror -fPIE -DPIE" "-pie"; then |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 1737 | CONFIGURE_CFLAGS="-fPIE -DPIE $CONFIGURE_CFLAGS" |
| 1738 | CONFIGURE_LDFLAGS="-pie $CONFIGURE_LDFLAGS" |
Richard Henderson | 2c67410 | 2019-12-17 15:15:01 -1000 | [diff] [blame] | 1739 | pie="yes" |
| 1740 | elif test "$pie" = "yes"; then |
| 1741 | error_exit "PIE not available due to missing toolchain support" |
| 1742 | else |
| 1743 | echo "Disabling PIE due to missing toolchain support" |
| 1744 | pie="no" |
Avi Kivity | 40d6444 | 2011-11-15 20:12:17 +0200 | [diff] [blame] | 1745 | fi |
| 1746 | |
Richard Henderson | e6cbd75 | 2019-12-17 14:00:39 -1000 | [diff] [blame] | 1747 | # Detect support for PT_GNU_RELRO + DT_BIND_NOW. |
| 1748 | # The combination is known as "full relro", because .got.plt is read-only too. |
| 1749 | if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then |
| 1750 | QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" |
| 1751 | fi |
| 1752 | |
Paolo Bonzini | 09dada4 | 2013-04-17 16:26:47 +0200 | [diff] [blame] | 1753 | ########################################## |
| 1754 | # __sync_fetch_and_and requires at least -march=i486. Many toolchains |
| 1755 | # use i686 as default anyway, but for those that don't, an explicit |
| 1756 | # specification is necessary |
| 1757 | |
| 1758 | if test "$cpu" = "i386"; then |
| 1759 | cat > $TMPC << EOF |
| 1760 | static int sfaa(int *ptr) |
| 1761 | { |
| 1762 | return __sync_fetch_and_and(ptr, 0); |
| 1763 | } |
| 1764 | |
| 1765 | int main(void) |
| 1766 | { |
| 1767 | int val = 42; |
Stefan Weil | 1405b62 | 2013-05-11 21:46:58 +0200 | [diff] [blame] | 1768 | val = __sync_val_compare_and_swap(&val, 0, 1); |
Paolo Bonzini | 09dada4 | 2013-04-17 16:26:47 +0200 | [diff] [blame] | 1769 | sfaa(&val); |
| 1770 | return val; |
| 1771 | } |
| 1772 | EOF |
| 1773 | if ! compile_prog "" "" ; then |
| 1774 | QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" |
| 1775 | fi |
| 1776 | fi |
| 1777 | |
Philippe Mathieu-Daudé | 56267b6 | 2021-05-12 06:58:21 +0200 | [diff] [blame] | 1778 | if test "$tcg" = "enabled"; then |
| 1779 | git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" |
| 1780 | git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" |
| 1781 | fi |
| 1782 | |
Stefan Weil | afb63eb | 2012-09-26 22:04:38 +0200 | [diff] [blame] | 1783 | if test -z "${target_list+xxx}" ; then |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 1784 | default_targets=yes |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 1785 | for target in $default_target_list; do |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 1786 | target_list="$target_list $target" |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 1787 | done |
| 1788 | target_list="${target_list# }" |
Anthony Liguori | 121afa9 | 2012-09-14 08:17:03 -0500 | [diff] [blame] | 1789 | else |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 1790 | default_targets=no |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 1791 | target_list=$(echo "$target_list" | sed -e 's/,/ /g') |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 1792 | for target in $target_list; do |
| 1793 | # Check that we recognised the target name; this allows a more |
| 1794 | # friendly error message than if we let it fall through. |
| 1795 | case " $default_target_list " in |
| 1796 | *" $target "*) |
| 1797 | ;; |
| 1798 | *) |
| 1799 | error_exit "Unknown target name '$target'" |
| 1800 | ;; |
| 1801 | esac |
Paolo Bonzini | d880a3b | 2017-07-03 16:58:28 +0200 | [diff] [blame] | 1802 | done |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 1803 | fi |
Peter Maydell | 25b4833 | 2013-05-20 16:16:16 +0100 | [diff] [blame] | 1804 | |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 1805 | for target in $target_list; do |
| 1806 | # if a deprecated target is enabled we note it here |
| 1807 | if echo "$deprecated_targets_list" | grep -q "$target"; then |
| 1808 | add_to deprecated_features $target |
| 1809 | fi |
| 1810 | done |
| 1811 | |
Paolo Bonzini | f55fe27 | 2010-05-26 16:08:17 +0200 | [diff] [blame] | 1812 | # see if system emulation was really requested |
| 1813 | case " $target_list " in |
| 1814 | *"-softmmu "*) softmmu=yes |
| 1815 | ;; |
| 1816 | *) softmmu=no |
| 1817 | ;; |
| 1818 | esac |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 1819 | |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 1820 | feature_not_found() { |
| 1821 | feature=$1 |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 1822 | remedy=$2 |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 1823 | |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 1824 | error_exit "User requested feature $feature" \ |
Stewart Smith | 21684af | 2014-01-24 12:39:10 +1100 | [diff] [blame] | 1825 | "configure was not able to find it." \ |
| 1826 | "$remedy" |
Juan Quintela | 249247c | 2009-08-12 18:20:25 +0200 | [diff] [blame] | 1827 | } |
| 1828 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1829 | # --- |
| 1830 | # big/little endian test |
| 1831 | cat > $TMPC << EOF |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1832 | #include <stdio.h> |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 1833 | short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; |
| 1834 | short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1835 | int main(int argc, char *argv[]) |
| 1836 | { |
| 1837 | return printf("%s %s\n", (char *)big_endian, (char *)little_endian); |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1838 | } |
| 1839 | EOF |
| 1840 | |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1841 | if compile_prog ; then |
| 1842 | if strings -a $TMPE | grep -q BiGeNdIaN ; then |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 1843 | bigendian="yes" |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1844 | elif strings -a $TMPE | grep -q LiTtLeEnDiAn ; then |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 1845 | bigendian="no" |
| 1846 | else |
| 1847 | echo big/little test failed |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1848 | exit 1 |
Peter Maydell | 21d89f8 | 2011-11-30 10:57:48 +0100 | [diff] [blame] | 1849 | fi |
Mike Frysinger | 61cc919 | 2013-06-30 23:30:18 -0400 | [diff] [blame] | 1850 | else |
| 1851 | echo big/little test failed |
Thomas Huth | 659eb15 | 2021-07-15 10:39:28 +0200 | [diff] [blame] | 1852 | exit 1 |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1853 | fi |
| 1854 | |
Juan Quintela | b0a47e7 | 2009-08-12 18:29:49 +0200 | [diff] [blame] | 1855 | ########################################## |
Philippe Mathieu-Daudé | e10ee3f | 2020-02-17 14:33:27 +0100 | [diff] [blame] | 1856 | # system tools |
| 1857 | if test -z "$want_tools"; then |
| 1858 | if test "$softmmu" = "no"; then |
| 1859 | want_tools=no |
| 1860 | else |
| 1861 | want_tools=yes |
| 1862 | fi |
| 1863 | fi |
| 1864 | |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1865 | ######################################### |
| 1866 | # vhost interdependencies and host support |
| 1867 | |
| 1868 | # vhost backends |
Stefan Hajnoczi | d88618f | 2020-11-10 17:11:21 +0000 | [diff] [blame] | 1869 | if test "$vhost_user" = "yes" && test "$linux" != "yes"; then |
| 1870 | error_exit "vhost-user is only available on Linux" |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1871 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1872 | test "$vhost_vdpa" = "" && vhost_vdpa=$linux |
| 1873 | if test "$vhost_vdpa" = "yes" && test "$linux" != "yes"; then |
| 1874 | error_exit "vhost-vdpa is only available on Linux" |
| 1875 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1876 | test "$vhost_kernel" = "" && vhost_kernel=$linux |
| 1877 | if test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then |
| 1878 | error_exit "vhost-kernel is only available on Linux" |
| 1879 | fi |
| 1880 | |
| 1881 | # vhost-kernel devices |
| 1882 | test "$vhost_scsi" = "" && vhost_scsi=$vhost_kernel |
| 1883 | if test "$vhost_scsi" = "yes" && test "$vhost_kernel" != "yes"; then |
| 1884 | error_exit "--enable-vhost-scsi requires --enable-vhost-kernel" |
| 1885 | fi |
| 1886 | test "$vhost_vsock" = "" && vhost_vsock=$vhost_kernel |
| 1887 | if test "$vhost_vsock" = "yes" && test "$vhost_kernel" != "yes"; then |
| 1888 | error_exit "--enable-vhost-vsock requires --enable-vhost-kernel" |
| 1889 | fi |
| 1890 | |
| 1891 | # vhost-user backends |
| 1892 | test "$vhost_net_user" = "" && vhost_net_user=$vhost_user |
| 1893 | if test "$vhost_net_user" = "yes" && test "$vhost_user" = "no"; then |
| 1894 | error_exit "--enable-vhost-net-user requires --enable-vhost-user" |
| 1895 | fi |
| 1896 | test "$vhost_crypto" = "" && vhost_crypto=$vhost_user |
| 1897 | if test "$vhost_crypto" = "yes" && test "$vhost_user" = "no"; then |
| 1898 | error_exit "--enable-vhost-crypto requires --enable-vhost-user" |
| 1899 | fi |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 1900 | test "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user |
| 1901 | if test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then |
| 1902 | error_exit "--enable-vhost-user-fs requires --enable-vhost-user" |
| 1903 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 1904 | #vhost-vdpa backends |
| 1905 | test "$vhost_net_vdpa" = "" && vhost_net_vdpa=$vhost_vdpa |
| 1906 | if test "$vhost_net_vdpa" = "yes" && test "$vhost_vdpa" = "no"; then |
| 1907 | error_exit "--enable-vhost-net-vdpa requires --enable-vhost-vdpa" |
| 1908 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1909 | |
Laurent Vivier | 40bc0ca | 2020-09-24 23:00:23 +0200 | [diff] [blame] | 1910 | # OR the vhost-kernel, vhost-vdpa and vhost-user values for simplicity |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1911 | if test "$vhost_net" = ""; then |
| 1912 | test "$vhost_net_user" = "yes" && vhost_net=yes |
Laurent Vivier | 40bc0ca | 2020-09-24 23:00:23 +0200 | [diff] [blame] | 1913 | test "$vhost_net_vdpa" = "yes" && vhost_net=yes |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 1914 | test "$vhost_kernel" = "yes" && vhost_net=yes |
| 1915 | fi |
| 1916 | |
Gonglei | 015a33b | 2014-07-01 20:58:08 +0800 | [diff] [blame] | 1917 | ########################################## |
Stefan Weil | 779ab5e | 2012-12-16 11:29:45 +0100 | [diff] [blame] | 1918 | # pkg-config probe |
| 1919 | |
| 1920 | if ! has "$pkg_config_exe"; then |
Peter Maydell | 76ad07a | 2013-04-08 12:11:26 +0100 | [diff] [blame] | 1921 | error_exit "pkg-config binary '$pkg_config_exe' not found" |
Stefan Weil | 779ab5e | 2012-12-16 11:29:45 +0100 | [diff] [blame] | 1922 | fi |
| 1923 | |
| 1924 | ########################################## |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 1925 | # xen probe |
| 1926 | |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 1927 | if test "$xen" != "disabled" ; then |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1928 | # Check whether Xen library path is specified via --extra-ldflags to avoid |
| 1929 | # overriding this setting with pkg-config output. If not, try pkg-config |
| 1930 | # to obtain all needed flags. |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 1931 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1932 | if ! echo $EXTRA_LDFLAGS | grep tools/libxc > /dev/null && \ |
| 1933 | $pkg_config --exists xencontrol ; then |
| 1934 | xen_ctrl_version="$(printf '%d%02d%02d' \ |
| 1935 | $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 1936 | xen=enabled |
Michael Tokarev | 5b6a8f4 | 2020-07-27 17:00:48 +0300 | [diff] [blame] | 1937 | xen_pc="xencontrol xenstore xenforeignmemory xengnttab" |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1938 | xen_pc="$xen_pc xenevtchn xendevicemodel" |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 1939 | if $pkg_config --exists xentoolcore; then |
| 1940 | xen_pc="$xen_pc xentoolcore" |
| 1941 | fi |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 1942 | xen_cflags="$($pkg_config --cflags $xen_pc)" |
| 1943 | xen_libs="$($pkg_config --libs $xen_pc)" |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1944 | else |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 1945 | |
Michael Tokarev | 5b6a8f4 | 2020-07-27 17:00:48 +0300 | [diff] [blame] | 1946 | xen_libs="-lxenstore -lxenctrl" |
Anthony PERARD | d9506ca | 2017-05-11 12:35:42 +0100 | [diff] [blame] | 1947 | xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn" |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1948 | |
| 1949 | # First we test whether Xen headers and libraries are available. |
| 1950 | # If no, we are done and there is no Xen support. |
| 1951 | # If yes, more tests are run to detect the Xen version. |
| 1952 | |
| 1953 | # Xen (any) |
| 1954 | cat > $TMPC <<EOF |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 1955 | #include <xenctrl.h> |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 1956 | int main(void) { |
| 1957 | return 0; |
| 1958 | } |
| 1959 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1960 | if ! compile_prog "" "$xen_libs" ; then |
| 1961 | # Xen not found |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 1962 | if test "$xen" = "enabled" ; then |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1963 | feature_not_found "xen" "Install xen devel" |
| 1964 | fi |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 1965 | xen=disabled |
Stefan Weil | 50ced5b | 2011-12-17 09:27:39 +0100 | [diff] [blame] | 1966 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 1967 | # Xen unstable |
| 1968 | elif |
| 1969 | cat > $TMPC <<EOF && |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 1970 | #undef XC_WANT_COMPAT_DEVICEMODEL_API |
| 1971 | #define __XEN_TOOLS__ |
| 1972 | #include <xendevicemodel.h> |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 1973 | #include <xenforeignmemory.h> |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 1974 | int main(void) { |
| 1975 | xendevicemodel_handle *xd; |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 1976 | xenforeignmemory_handle *xfmem; |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 1977 | |
| 1978 | xd = xendevicemodel_open(0, 0); |
| 1979 | xendevicemodel_pin_memory_cacheattr(xd, 0, 0, 0, 0); |
| 1980 | |
Paul Durrant | d3c49eb | 2018-05-15 17:40:53 +0100 | [diff] [blame] | 1981 | xfmem = xenforeignmemory_open(0, 0); |
| 1982 | xenforeignmemory_map_resource(xfmem, 0, 0, 0, 0, 0, NULL, 0, 0); |
| 1983 | |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 1984 | return 0; |
| 1985 | } |
| 1986 | EOF |
| 1987 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" |
| 1988 | then |
| 1989 | xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" |
| 1990 | xen_ctrl_version=41100 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 1991 | xen=enabled |
Ross Lagerwall | 2cbf890 | 2017-10-23 10:27:27 +0100 | [diff] [blame] | 1992 | elif |
| 1993 | cat > $TMPC <<EOF && |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 1994 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 1995 | #include <xenforeignmemory.h> |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 1996 | #include <xentoolcore.h> |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 1997 | int main(void) { |
| 1998 | xenforeignmemory_handle *xfmem; |
| 1999 | |
| 2000 | xfmem = xenforeignmemory_open(0, 0); |
| 2001 | xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0); |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2002 | xentoolcore_restrict_all(0); |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2003 | |
| 2004 | return 0; |
| 2005 | } |
| 2006 | EOF |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2007 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2008 | then |
Anthony PERARD | 58ea9a7 | 2017-09-25 16:01:48 +0100 | [diff] [blame] | 2009 | xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2010 | xen_ctrl_version=41000 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2011 | xen=enabled |
Igor Druzhinin | 5ba3d75 | 2017-07-10 23:40:02 +0100 | [diff] [blame] | 2012 | elif |
| 2013 | cat > $TMPC <<EOF && |
Paul Durrant | da8090c | 2017-03-07 10:55:33 +0000 | [diff] [blame] | 2014 | #undef XC_WANT_COMPAT_DEVICEMODEL_API |
| 2015 | #define __XEN_TOOLS__ |
| 2016 | #include <xendevicemodel.h> |
| 2017 | int main(void) { |
| 2018 | xendevicemodel_handle *xd; |
| 2019 | |
| 2020 | xd = xendevicemodel_open(0, 0); |
| 2021 | xendevicemodel_close(xd); |
| 2022 | |
| 2023 | return 0; |
| 2024 | } |
| 2025 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2026 | compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs" |
| 2027 | then |
| 2028 | xen_stable_libs="-lxendevicemodel $xen_stable_libs" |
| 2029 | xen_ctrl_version=40900 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2030 | xen=enabled |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2031 | elif |
| 2032 | cat > $TMPC <<EOF && |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2033 | /* |
| 2034 | * If we have stable libs the we don't want the libxc compat |
| 2035 | * layers, regardless of what CFLAGS we may have been given. |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2036 | * |
| 2037 | * Also, check if xengnttab_grant_copy_segment_t is defined and |
| 2038 | * grant copy operation is implemented. |
| 2039 | */ |
| 2040 | #undef XC_WANT_COMPAT_EVTCHN_API |
| 2041 | #undef XC_WANT_COMPAT_GNTTAB_API |
| 2042 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 2043 | #include <xenctrl.h> |
| 2044 | #include <xenstore.h> |
| 2045 | #include <xenevtchn.h> |
| 2046 | #include <xengnttab.h> |
| 2047 | #include <xenforeignmemory.h> |
| 2048 | #include <stdint.h> |
| 2049 | #include <xen/hvm/hvm_info_table.h> |
| 2050 | #if !defined(HVM_MAX_VCPUS) |
| 2051 | # error HVM_MAX_VCPUS not defined |
| 2052 | #endif |
| 2053 | int main(void) { |
| 2054 | xc_interface *xc = NULL; |
| 2055 | xenforeignmemory_handle *xfmem; |
| 2056 | xenevtchn_handle *xe; |
| 2057 | xengnttab_handle *xg; |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2058 | xengnttab_grant_copy_segment_t* seg = NULL; |
| 2059 | |
| 2060 | xs_daemon_open(); |
| 2061 | |
| 2062 | xc = xc_interface_open(0, 0, 0); |
| 2063 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2064 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2065 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
| 2066 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2067 | |
| 2068 | xfmem = xenforeignmemory_open(0, 0); |
| 2069 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); |
| 2070 | |
| 2071 | xe = xenevtchn_open(0, 0); |
| 2072 | xenevtchn_fd(xe); |
| 2073 | |
| 2074 | xg = xengnttab_open(0, 0); |
| 2075 | xengnttab_grant_copy(xg, 0, seg); |
| 2076 | |
| 2077 | return 0; |
| 2078 | } |
| 2079 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2080 | compile_prog "" "$xen_libs $xen_stable_libs" |
| 2081 | then |
| 2082 | xen_ctrl_version=40800 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2083 | xen=enabled |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2084 | elif |
| 2085 | cat > $TMPC <<EOF && |
Paulina Szubarczyk | b6eb9b4 | 2016-09-14 21:10:03 +0200 | [diff] [blame] | 2086 | /* |
| 2087 | * If we have stable libs the we don't want the libxc compat |
| 2088 | * layers, regardless of what CFLAGS we may have been given. |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2089 | */ |
| 2090 | #undef XC_WANT_COMPAT_EVTCHN_API |
| 2091 | #undef XC_WANT_COMPAT_GNTTAB_API |
| 2092 | #undef XC_WANT_COMPAT_MAP_FOREIGN_API |
| 2093 | #include <xenctrl.h> |
| 2094 | #include <xenstore.h> |
| 2095 | #include <xenevtchn.h> |
| 2096 | #include <xengnttab.h> |
| 2097 | #include <xenforeignmemory.h> |
| 2098 | #include <stdint.h> |
| 2099 | #include <xen/hvm/hvm_info_table.h> |
| 2100 | #if !defined(HVM_MAX_VCPUS) |
| 2101 | # error HVM_MAX_VCPUS not defined |
| 2102 | #endif |
| 2103 | int main(void) { |
| 2104 | xc_interface *xc = NULL; |
| 2105 | xenforeignmemory_handle *xfmem; |
| 2106 | xenevtchn_handle *xe; |
| 2107 | xengnttab_handle *xg; |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2108 | |
| 2109 | xs_daemon_open(); |
| 2110 | |
| 2111 | xc = xc_interface_open(0, 0, 0); |
| 2112 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2113 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2114 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
| 2115 | xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2116 | |
| 2117 | xfmem = xenforeignmemory_open(0, 0); |
| 2118 | xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); |
| 2119 | |
| 2120 | xe = xenevtchn_open(0, 0); |
| 2121 | xenevtchn_fd(xe); |
| 2122 | |
| 2123 | xg = xengnttab_open(0, 0); |
| 2124 | xengnttab_map_grant_ref(xg, 0, 0, 0); |
| 2125 | |
| 2126 | return 0; |
| 2127 | } |
| 2128 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2129 | compile_prog "" "$xen_libs $xen_stable_libs" |
| 2130 | then |
| 2131 | xen_ctrl_version=40701 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2132 | xen=enabled |
Roger Pau Monne | cdadde3 | 2015-11-13 17:38:06 +0000 | [diff] [blame] | 2133 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2134 | # Xen 4.6 |
| 2135 | elif |
| 2136 | cat > $TMPC <<EOF && |
Roger Pau Monne | cdadde3 | 2015-11-13 17:38:06 +0000 | [diff] [blame] | 2137 | #include <xenctrl.h> |
Anthony PERARD | e108a3c | 2012-06-21 11:44:35 +0000 | [diff] [blame] | 2138 | #include <xenstore.h> |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 2139 | #include <stdint.h> |
| 2140 | #include <xen/hvm/hvm_info_table.h> |
| 2141 | #if !defined(HVM_MAX_VCPUS) |
| 2142 | # error HVM_MAX_VCPUS not defined |
| 2143 | #endif |
| 2144 | int main(void) { |
| 2145 | xc_interface *xc; |
| 2146 | xs_daemon_open(); |
| 2147 | xc = xc_interface_open(0, 0, 0); |
| 2148 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2149 | xc_gnttab_open(NULL, 0); |
Anthony PERARD | b87de24 | 2011-05-24 14:34:20 +0100 | [diff] [blame] | 2150 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2151 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2152 | 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] | 2153 | xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0); |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2154 | return 0; |
| 2155 | } |
| 2156 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2157 | compile_prog "" "$xen_libs" |
| 2158 | then |
| 2159 | xen_ctrl_version=40600 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2160 | xen=enabled |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2161 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2162 | # Xen 4.5 |
| 2163 | elif |
| 2164 | cat > $TMPC <<EOF && |
Jan Beulich | d8b441a | 2015-07-24 03:38:28 -0600 | [diff] [blame] | 2165 | #include <xenctrl.h> |
| 2166 | #include <xenstore.h> |
| 2167 | #include <stdint.h> |
| 2168 | #include <xen/hvm/hvm_info_table.h> |
| 2169 | #if !defined(HVM_MAX_VCPUS) |
| 2170 | # error HVM_MAX_VCPUS not defined |
| 2171 | #endif |
| 2172 | int main(void) { |
| 2173 | xc_interface *xc; |
| 2174 | xs_daemon_open(); |
| 2175 | xc = xc_interface_open(0, 0, 0); |
| 2176 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2177 | xc_gnttab_open(NULL, 0); |
| 2178 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2179 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2180 | xc_hvm_create_ioreq_server(xc, 0, 0, NULL); |
| 2181 | return 0; |
| 2182 | } |
| 2183 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2184 | compile_prog "" "$xen_libs" |
| 2185 | then |
| 2186 | xen_ctrl_version=40500 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2187 | xen=enabled |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2188 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2189 | elif |
| 2190 | cat > $TMPC <<EOF && |
Paul Durrant | 3996e85 | 2015-01-20 11:06:19 +0000 | [diff] [blame] | 2191 | #include <xenctrl.h> |
| 2192 | #include <xenstore.h> |
| 2193 | #include <stdint.h> |
| 2194 | #include <xen/hvm/hvm_info_table.h> |
| 2195 | #if !defined(HVM_MAX_VCPUS) |
| 2196 | # error HVM_MAX_VCPUS not defined |
| 2197 | #endif |
| 2198 | int main(void) { |
| 2199 | xc_interface *xc; |
| 2200 | xs_daemon_open(); |
| 2201 | xc = xc_interface_open(0, 0, 0); |
| 2202 | xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); |
| 2203 | xc_gnttab_open(NULL, 0); |
| 2204 | xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); |
| 2205 | xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2206 | return 0; |
| 2207 | } |
| 2208 | EOF |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2209 | compile_prog "" "$xen_libs" |
| 2210 | then |
| 2211 | xen_ctrl_version=40200 |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2212 | xen=enabled |
Stefano Stabellini | 8688e06 | 2012-04-17 17:04:18 +0000 | [diff] [blame] | 2213 | |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2214 | else |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2215 | if test "$xen" = "enabled" ; then |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2216 | feature_not_found "xen (unsupported version)" \ |
| 2217 | "Install a supported xen (xen 4.2 or newer)" |
| 2218 | fi |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2219 | xen=disabled |
Juan Quintela | fc321b4 | 2009-08-12 18:29:55 +0200 | [diff] [blame] | 2220 | fi |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 2221 | |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 2222 | if test "$xen" = enabled; then |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2223 | if test $xen_ctrl_version -ge 40701 ; then |
Marc-André Lureau | 582ea95 | 2019-08-15 15:15:32 +0400 | [diff] [blame] | 2224 | xen_libs="$xen_libs $xen_stable_libs " |
Juergen Gross | c1cdd9d | 2017-03-27 09:42:45 +0200 | [diff] [blame] | 2225 | fi |
Ian Campbell | 5eeb39c | 2016-01-15 13:23:42 +0000 | [diff] [blame] | 2226 | fi |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 2227 | fi |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 2228 | fi |
| 2229 | |
| 2230 | ########################################## |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 2231 | # RDMA needs OpenFabrics libraries |
| 2232 | if test "$rdma" != "no" ; then |
| 2233 | cat > $TMPC <<EOF |
| 2234 | #include <rdma/rdma_cma.h> |
| 2235 | int main(void) { return 0; } |
| 2236 | EOF |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 2237 | rdma_libs="-lrdmacm -libverbs -libumad" |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 2238 | if compile_prog "" "$rdma_libs" ; then |
| 2239 | rdma="yes" |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 2240 | else |
| 2241 | if test "$rdma" = "yes" ; then |
| 2242 | error_exit \ |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 2243 | " OpenFabrics librdmacm/libibverbs/libibumad not present." \ |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 2244 | " Your options:" \ |
Yuval Shaia | ef6d4cc | 2018-02-09 15:23:18 +0200 | [diff] [blame] | 2245 | " (1) Fast: Install infiniband packages (devel) from your distro." \ |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 2246 | " (2) Cleanest: Install libraries from www.openfabrics.org" \ |
| 2247 | " (3) Also: Install softiwarp if you don't have RDMA hardware" |
| 2248 | fi |
| 2249 | rdma="no" |
| 2250 | fi |
| 2251 | fi |
| 2252 | |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 2253 | ########################################## |
| 2254 | # PVRDMA detection |
| 2255 | |
| 2256 | cat > $TMPC <<EOF && |
| 2257 | #include <sys/mman.h> |
| 2258 | |
| 2259 | int |
| 2260 | main(void) |
| 2261 | { |
| 2262 | char buf = 0; |
| 2263 | void *addr = &buf; |
| 2264 | addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED); |
| 2265 | |
| 2266 | return 0; |
| 2267 | } |
| 2268 | EOF |
| 2269 | |
| 2270 | if test "$rdma" = "yes" ; then |
| 2271 | case "$pvrdma" in |
| 2272 | "") |
| 2273 | if compile_prog "" ""; then |
| 2274 | pvrdma="yes" |
| 2275 | else |
| 2276 | pvrdma="no" |
| 2277 | fi |
| 2278 | ;; |
| 2279 | "yes") |
| 2280 | if ! compile_prog "" ""; then |
| 2281 | error_exit "PVRDMA is not supported since mremap is not implemented" |
| 2282 | fi |
| 2283 | pvrdma="yes" |
| 2284 | ;; |
| 2285 | "no") |
| 2286 | pvrdma="no" |
| 2287 | ;; |
| 2288 | esac |
| 2289 | else |
| 2290 | if test "$pvrdma" = "yes" ; then |
| 2291 | error_exit "PVRDMA requires rdma suppport" |
| 2292 | fi |
| 2293 | pvrdma="no" |
| 2294 | fi |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 2295 | |
Yuval Shaia | ee10858 | 2019-08-18 16:21:06 +0300 | [diff] [blame] | 2296 | # Let's see if enhanced reg_mr is supported |
| 2297 | if test "$pvrdma" = "yes" ; then |
| 2298 | |
| 2299 | cat > $TMPC <<EOF && |
| 2300 | #include <infiniband/verbs.h> |
| 2301 | |
| 2302 | int |
| 2303 | main(void) |
| 2304 | { |
| 2305 | struct ibv_mr *mr; |
| 2306 | struct ibv_pd *pd = NULL; |
| 2307 | size_t length = 10; |
| 2308 | uint64_t iova = 0; |
| 2309 | int access = 0; |
| 2310 | void *addr = NULL; |
| 2311 | |
| 2312 | mr = ibv_reg_mr_iova(pd, addr, length, iova, access); |
| 2313 | |
| 2314 | ibv_dereg_mr(mr); |
| 2315 | |
| 2316 | return 0; |
| 2317 | } |
| 2318 | EOF |
| 2319 | if ! compile_prog "" "-libverbs"; then |
| 2320 | QEMU_CFLAGS="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR" |
| 2321 | fi |
| 2322 | fi |
| 2323 | |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 2324 | ########################################## |
Eric Blake | c1bb86c | 2016-12-02 13:48:54 -0600 | [diff] [blame] | 2325 | # xfsctl() probe, used for file-posix.c |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 2326 | if test "$xfs" != "no" ; then |
| 2327 | cat > $TMPC << EOF |
Stefan Weil | ffc41d1 | 2011-12-17 09:27:36 +0100 | [diff] [blame] | 2328 | #include <stddef.h> /* NULL */ |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 2329 | #include <xfs/xfs.h> |
| 2330 | int main(void) |
| 2331 | { |
| 2332 | xfsctl(NULL, 0, 0, NULL); |
| 2333 | return 0; |
| 2334 | } |
| 2335 | EOF |
| 2336 | if compile_prog "" "" ; then |
| 2337 | xfs="yes" |
| 2338 | else |
| 2339 | if test "$xfs" = "yes" ; then |
zhaolichang | e3a6e0d | 2020-09-17 15:50:20 +0800 | [diff] [blame] | 2340 | feature_not_found "xfs" "Install xfsprogs/xfslibs devel" |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 2341 | fi |
| 2342 | xfs=no |
| 2343 | fi |
| 2344 | fi |
| 2345 | |
| 2346 | ########################################## |
Alex Bennée | ba4dd2a | 2021-07-09 15:29:57 +0100 | [diff] [blame] | 2347 | # plugin linker support probe |
| 2348 | |
| 2349 | if test "$plugins" != "no"; then |
| 2350 | |
| 2351 | ######################################### |
| 2352 | # See if --dynamic-list is supported by the linker |
| 2353 | |
| 2354 | ld_dynamic_list="no" |
| 2355 | cat > $TMPTXT <<EOF |
| 2356 | { |
| 2357 | foo; |
| 2358 | }; |
| 2359 | EOF |
| 2360 | |
| 2361 | cat > $TMPC <<EOF |
| 2362 | #include <stdio.h> |
| 2363 | void foo(void); |
| 2364 | |
| 2365 | void foo(void) |
| 2366 | { |
| 2367 | printf("foo\n"); |
| 2368 | } |
| 2369 | |
| 2370 | int main(void) |
| 2371 | { |
| 2372 | foo(); |
| 2373 | return 0; |
| 2374 | } |
| 2375 | EOF |
| 2376 | |
| 2377 | if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then |
| 2378 | ld_dynamic_list="yes" |
| 2379 | fi |
| 2380 | |
| 2381 | ######################################### |
| 2382 | # See if -exported_symbols_list is supported by the linker |
| 2383 | |
| 2384 | ld_exported_symbols_list="no" |
| 2385 | cat > $TMPTXT <<EOF |
| 2386 | _foo |
| 2387 | EOF |
| 2388 | |
| 2389 | if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then |
| 2390 | ld_exported_symbols_list="yes" |
| 2391 | fi |
| 2392 | |
| 2393 | if test "$ld_dynamic_list" = "no" && |
| 2394 | test "$ld_exported_symbols_list" = "no" ; then |
| 2395 | if test "$plugins" = "yes"; then |
| 2396 | error_exit \ |
| 2397 | "Plugin support requires dynamic linking and specifying a set of symbols " \ |
| 2398 | "that are exported to plugins. Unfortunately your linker doesn't " \ |
| 2399 | "support the flag (--dynamic-list or -exported_symbols_list) used " \ |
| 2400 | "for this purpose." |
| 2401 | else |
| 2402 | plugins="no" |
| 2403 | fi |
| 2404 | else |
| 2405 | plugins="yes" |
| 2406 | fi |
| 2407 | fi |
| 2408 | |
| 2409 | ########################################## |
Anthony Liguori | e18df14 | 2011-07-19 14:50:29 -0500 | [diff] [blame] | 2410 | # glib support probe |
Paolo Bonzini | a52d28a | 2012-04-05 13:01:54 +0200 | [diff] [blame] | 2411 | |
Daniel P. Berrangé | b4c6036 | 2021-05-14 13:04:13 +0100 | [diff] [blame] | 2412 | glib_req_ver=2.56 |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 2413 | glib_modules=gthread-2.0 |
| 2414 | if test "$modules" = yes; then |
Gerd Hoffmann | a88afc6 | 2018-03-08 09:53:00 +0100 | [diff] [blame] | 2415 | glib_modules="$glib_modules gmodule-export-2.0" |
Paolo Bonzini | b906aca | 2021-08-11 12:05:50 +0200 | [diff] [blame] | 2416 | elif test "$plugins" = "yes"; then |
| 2417 | glib_modules="$glib_modules gmodule-no-export-2.0" |
Emilio G. Cota | 54cb65d | 2017-08-30 18:39:53 -0400 | [diff] [blame] | 2418 | fi |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 2419 | |
Paolo Bonzini | aa0d1f4 | 2014-02-25 17:36:55 +0100 | [diff] [blame] | 2420 | for i in $glib_modules; do |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 2421 | if $pkg_config --atleast-version=$glib_req_ver $i; then |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 2422 | glib_cflags=$($pkg_config --cflags $i) |
| 2423 | glib_libs=$($pkg_config --libs $i) |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 2424 | else |
| 2425 | error_exit "glib-$glib_req_ver $i is required to compile QEMU" |
| 2426 | fi |
| 2427 | done |
| 2428 | |
Paolo Bonzini | 215b0c2 | 2020-09-01 08:41:17 -0400 | [diff] [blame] | 2429 | # This workaround is required due to a bug in pkg-config file for glib as it |
| 2430 | # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static |
| 2431 | |
| 2432 | if test "$static" = yes && test "$mingw32" = yes; then |
| 2433 | glib_cflags="-DGLIB_STATIC_COMPILATION $glib_cflags" |
| 2434 | fi |
| 2435 | |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 2436 | if ! test "$gio" = "no"; then |
| 2437 | pass=no |
| 2438 | if $pkg_config --atleast-version=$glib_req_ver gio-2.0; then |
| 2439 | gio_cflags=$($pkg_config --cflags gio-2.0) |
| 2440 | gio_libs=$($pkg_config --libs gio-2.0) |
| 2441 | gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0) |
Paolo Bonzini | 5ecfb76 | 2021-05-05 10:15:34 -0400 | [diff] [blame] | 2442 | if ! has "$gdbus_codegen"; then |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 2443 | gdbus_codegen= |
| 2444 | fi |
| 2445 | # Check that the libraries actually work -- Ubuntu 18.04 ships |
| 2446 | # with pkg-config --static --libs data for gio-2.0 that is missing |
| 2447 | # -lblkid and will give a link error. |
| 2448 | cat > $TMPC <<EOF |
Peter Maydell | 13ceae6 | 2020-11-17 12:56:33 +0000 | [diff] [blame] | 2449 | #include <gio/gio.h> |
| 2450 | int main(void) |
| 2451 | { |
| 2452 | g_dbus_proxy_new_sync(0, 0, 0, 0, 0, 0, 0, 0); |
| 2453 | return 0; |
| 2454 | } |
| 2455 | EOF |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 2456 | if compile_prog "$gio_cflags" "$gio_libs" ; then |
| 2457 | pass=yes |
| 2458 | else |
| 2459 | pass=no |
| 2460 | fi |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 2461 | |
Denis Plotnikov | 20cf7b8 | 2021-03-12 18:14:40 +0300 | [diff] [blame] | 2462 | if test "$pass" = "yes" && |
| 2463 | $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then |
| 2464 | gio_cflags="$gio_cflags $($pkg_config --cflags gio-unix-2.0)" |
| 2465 | gio_libs="$gio_libs $($pkg_config --libs gio-unix-2.0)" |
| 2466 | fi |
| 2467 | fi |
| 2468 | |
| 2469 | if test "$pass" = "no"; then |
| 2470 | if test "$gio" = "yes"; then |
| 2471 | feature_not_found "gio" "Install libgio >= 2.0" |
| 2472 | else |
| 2473 | gio=no |
| 2474 | fi |
| 2475 | else |
| 2476 | gio=yes |
| 2477 | fi |
Marc-André Lureau | 25a97a5 | 2019-09-27 11:34:42 +0400 | [diff] [blame] | 2478 | fi |
| 2479 | |
Daniel P. Berrange | 977a82a | 2016-01-27 09:00:45 +0000 | [diff] [blame] | 2480 | # Sanity check that the current size_t matches the |
| 2481 | # size that glib thinks it should be. This catches |
| 2482 | # problems on multi-arch where people try to build |
| 2483 | # 32-bit QEMU while pointing at 64-bit glib headers |
| 2484 | cat > $TMPC <<EOF |
| 2485 | #include <glib.h> |
| 2486 | #include <unistd.h> |
| 2487 | |
| 2488 | #define QEMU_BUILD_BUG_ON(x) \ |
| 2489 | typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused)); |
| 2490 | |
| 2491 | int main(void) { |
| 2492 | QEMU_BUILD_BUG_ON(sizeof(size_t) != GLIB_SIZEOF_SIZE_T); |
| 2493 | return 0; |
| 2494 | } |
| 2495 | EOF |
| 2496 | |
Paolo Bonzini | 215b0c2 | 2020-09-01 08:41:17 -0400 | [diff] [blame] | 2497 | if ! compile_prog "$glib_cflags" "$glib_libs" ; then |
Daniel P. Berrange | 977a82a | 2016-01-27 09:00:45 +0000 | [diff] [blame] | 2498 | error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ |
| 2499 | "You probably need to set PKG_CONFIG_LIBDIR"\ |
| 2500 | "to point to the right pkg-config files for your"\ |
| 2501 | "build target" |
| 2502 | fi |
| 2503 | |
Eric Blake | 9bda600 | 2020-03-17 12:55:34 -0500 | [diff] [blame] | 2504 | # Silence clang warnings triggered by glib < 2.57.2 |
| 2505 | cat > $TMPC << EOF |
| 2506 | #include <glib.h> |
| 2507 | typedef struct Foo { |
| 2508 | int i; |
| 2509 | } Foo; |
| 2510 | static void foo_free(Foo *f) |
| 2511 | { |
| 2512 | g_free(f); |
| 2513 | } |
| 2514 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free); |
| 2515 | int main(void) { return 0; } |
| 2516 | EOF |
| 2517 | if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then |
| 2518 | if cc_has_warning_flag "-Wno-unused-function"; then |
| 2519 | glib_cflags="$glib_cflags -Wno-unused-function" |
Paolo Bonzini | 5770e8a | 2020-09-23 05:26:15 -0400 | [diff] [blame] | 2520 | CONFIGURE_CFLAGS="$CONFIGURE_CFLAGS -Wno-unused-function" |
Eric Blake | 9bda600 | 2020-03-17 12:55:34 -0500 | [diff] [blame] | 2521 | fi |
| 2522 | fi |
| 2523 | |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 2524 | ########################################## |
| 2525 | # SHA command probe for modules |
| 2526 | if test "$modules" = yes; then |
| 2527 | shacmd_probe="sha1sum sha1 shasum" |
| 2528 | for c in $shacmd_probe; do |
Fam Zheng | 8ccefb9 | 2014-12-04 14:18:16 +0800 | [diff] [blame] | 2529 | if has $c; then |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 2530 | shacmd="$c" |
| 2531 | break |
| 2532 | fi |
| 2533 | done |
| 2534 | if test "$shacmd" = ""; then |
| 2535 | error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" |
| 2536 | fi |
Anthony Liguori | e18df14 | 2011-07-19 14:50:29 -0500 | [diff] [blame] | 2537 | fi |
| 2538 | |
| 2539 | ########################################## |
Paolo Bonzini | 7aaa6a1 | 2019-01-23 14:56:07 +0800 | [diff] [blame] | 2540 | # TPM emulation is only on POSIX |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 2541 | |
Paolo Bonzini | 7aaa6a1 | 2019-01-23 14:56:07 +0800 | [diff] [blame] | 2542 | if test "$tpm" = ""; then |
| 2543 | if test "$mingw32" = "yes"; then |
| 2544 | tpm=no |
| 2545 | else |
| 2546 | tpm=yes |
| 2547 | fi |
| 2548 | elif test "$tpm" = "yes"; then |
| 2549 | if test "$mingw32" = "yes" ; then |
| 2550 | error_exit "TPM emulation only available on POSIX systems" |
| 2551 | fi |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 2552 | fi |
| 2553 | |
| 2554 | ########################################## |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 2555 | # fdt probe |
Paolo Bonzini | fbb4121 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 2556 | |
| 2557 | case "$fdt" in |
| 2558 | auto | enabled | internal) |
| 2559 | # Simpler to always update submodule, even if not needed. |
Paolo Bonzini | 2d652f2 | 2021-05-12 09:21:56 +0200 | [diff] [blame] | 2560 | git_submodules="${git_submodules} dtc" |
Peter Maydell | e169e1e | 2013-05-24 16:26:54 +0100 | [diff] [blame] | 2561 | ;; |
Paolo Bonzini | fbb4121 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 2562 | esac |
aurel32 | f652e6a | 2008-12-16 10:43:48 +0000 | [diff] [blame] | 2563 | |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 2564 | ########################################## |
Markus Armbruster | 9d49bcf | 2021-05-03 10:40:33 +0200 | [diff] [blame] | 2565 | # opengl probe (for sdl2, gtk) |
Gerd Hoffmann | b1546f3 | 2015-03-16 10:03:53 +0100 | [diff] [blame] | 2566 | |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 2567 | if test "$opengl" != "no" ; then |
Akihiko Odaki | bc6a356 | 2021-02-23 15:03:07 +0900 | [diff] [blame] | 2568 | epoxy=no |
| 2569 | if $pkg_config epoxy; then |
| 2570 | cat > $TMPC << EOF |
| 2571 | #include <epoxy/egl.h> |
| 2572 | int main(void) { return 0; } |
| 2573 | EOF |
| 2574 | if compile_prog "" "" ; then |
| 2575 | epoxy=yes |
| 2576 | fi |
| 2577 | fi |
| 2578 | |
| 2579 | if test "$epoxy" = "yes" ; then |
| 2580 | opengl_cflags="$($pkg_config --cflags epoxy)" |
| 2581 | opengl_libs="$($pkg_config --libs epoxy)" |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 2582 | opengl=yes |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 2583 | else |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 2584 | if test "$opengl" = "yes" ; then |
Akihiko Odaki | bc6a356 | 2021-02-23 15:03:07 +0900 | [diff] [blame] | 2585 | feature_not_found "opengl" "Please install epoxy with EGL" |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 2586 | fi |
Jeremy White | f676c67 | 2015-01-09 13:08:49 -0600 | [diff] [blame] | 2587 | opengl_cflags="" |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 2588 | opengl_libs="" |
| 2589 | opengl=no |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 2590 | fi |
| 2591 | fi |
| 2592 | |
Marcelo Tosatti | dcc38d1 | 2010-10-11 15:31:15 -0300 | [diff] [blame] | 2593 | ########################################## |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 2594 | # libnuma probe |
| 2595 | |
| 2596 | if test "$numa" != "no" ; then |
| 2597 | cat > $TMPC << EOF |
| 2598 | #include <numa.h> |
| 2599 | int main(void) { return numa_available(); } |
| 2600 | EOF |
| 2601 | |
| 2602 | if compile_prog "" "-lnuma" ; then |
| 2603 | numa=yes |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 2604 | numa_libs="-lnuma" |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 2605 | else |
| 2606 | if test "$numa" = "yes" ; then |
| 2607 | feature_not_found "numa" "install numactl devel" |
| 2608 | fi |
| 2609 | numa=no |
| 2610 | fi |
| 2611 | fi |
| 2612 | |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 2613 | # check for usbfs |
| 2614 | have_usbfs=no |
| 2615 | if test "$linux_user" = "yes"; then |
Thomas Petazzoni | 96566d0 | 2019-02-13 22:18:27 +0100 | [diff] [blame] | 2616 | cat > $TMPC << EOF |
| 2617 | #include <linux/usbdevice_fs.h> |
| 2618 | |
| 2619 | #ifndef USBDEVFS_GET_CAPABILITIES |
| 2620 | #error "USBDEVFS_GET_CAPABILITIES undefined" |
| 2621 | #endif |
| 2622 | |
| 2623 | #ifndef USBDEVFS_DISCONNECT_CLAIM |
| 2624 | #error "USBDEVFS_DISCONNECT_CLAIM undefined" |
| 2625 | #endif |
| 2626 | |
| 2627 | int main(void) |
| 2628 | { |
| 2629 | return 0; |
| 2630 | } |
| 2631 | EOF |
| 2632 | if compile_prog "" ""; then |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 2633 | have_usbfs=yes |
| 2634 | fi |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 2635 | fi |
Marc-André Lureau | 751bcc3 | 2015-10-09 17:17:16 +0200 | [diff] [blame] | 2636 | |
Blue Swirl | de5071c | 2009-09-12 09:58:46 +0000 | [diff] [blame] | 2637 | ########################################## |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2638 | # check if we have VSS SDK headers for win |
| 2639 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2640 | if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ |
| 2641 | test "$vss_win32_sdk" != "no" ; then |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2642 | case "$vss_win32_sdk" in |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 2643 | "") vss_win32_include="-isystem $source_path" ;; |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2644 | *\ *) # The SDK is installed in "Program Files" by default, but we cannot |
| 2645 | # handle path with spaces. So we symlink the headers into ".sdk/vss". |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 2646 | vss_win32_include="-isystem $source_path/.sdk/vss" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2647 | symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" |
| 2648 | ;; |
Michael Roth | 690604f | 2016-06-28 17:31:49 -0500 | [diff] [blame] | 2649 | *) vss_win32_include="-isystem $vss_win32_sdk" |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2650 | esac |
| 2651 | cat > $TMPC << EOF |
| 2652 | #define __MIDL_user_allocate_free_DEFINED__ |
| 2653 | #include <inc/win2003/vss.h> |
| 2654 | int main(void) { return VSS_CTX_BACKUP; } |
| 2655 | EOF |
| 2656 | if compile_prog "$vss_win32_include" "" ; then |
| 2657 | guest_agent_with_vss="yes" |
| 2658 | QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" |
Fam Zheng | 315d318 | 2016-09-21 12:27:21 +0800 | [diff] [blame] | 2659 | libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" |
Michael Roth | f33ca81 | 2015-08-26 16:19:41 -0500 | [diff] [blame] | 2660 | 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] | 2661 | else |
| 2662 | if test "$vss_win32_sdk" != "" ; then |
| 2663 | echo "ERROR: Please download and install Microsoft VSS SDK:" |
| 2664 | echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" |
| 2665 | echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" |
| 2666 | echo "ERROR: scripts/extract-vsssdk-headers setup.exe" |
| 2667 | echo "ERROR: The headers are extracted in the directory \`inc'." |
| 2668 | feature_not_found "VSS support" |
| 2669 | fi |
| 2670 | guest_agent_with_vss="no" |
| 2671 | fi |
| 2672 | fi |
| 2673 | |
| 2674 | ########################################## |
| 2675 | # lookup Windows platform SDK (if not specified) |
| 2676 | # The SDK is needed only to build .tlb (type library) file of guest agent |
| 2677 | # VSS provider from the source. It is usually unnecessary because the |
| 2678 | # pre-compiled .tlb file is included. |
| 2679 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2680 | if test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ |
| 2681 | test "$guest_agent_with_vss" = "yes" ; then |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 2682 | if test -z "$win_sdk"; then |
| 2683 | programfiles="$PROGRAMFILES" |
| 2684 | test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" |
| 2685 | if test -n "$programfiles"; then |
| 2686 | win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null |
| 2687 | else |
| 2688 | feature_not_found "Windows SDK" |
| 2689 | fi |
| 2690 | elif test "$win_sdk" = "no"; then |
| 2691 | win_sdk="" |
| 2692 | fi |
| 2693 | fi |
| 2694 | |
| 2695 | ########################################## |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 2696 | # check if mingw environment provides a recent ntddscsi.h |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2697 | if test "$mingw32" = "yes" && test "$guest_agent" != "no"; then |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 2698 | cat > $TMPC << EOF |
| 2699 | #include <windows.h> |
| 2700 | #include <ntddscsi.h> |
| 2701 | int main(void) { |
| 2702 | #if !defined(IOCTL_SCSI_GET_ADDRESS) |
| 2703 | #error Missing required ioctl definitions |
| 2704 | #endif |
| 2705 | SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 }; |
| 2706 | return addr.Lun; |
| 2707 | } |
| 2708 | EOF |
| 2709 | if compile_prog "" "" ; then |
| 2710 | guest_agent_ntddscsi=yes |
Matt Hines | 996b9cd | 2019-01-28 14:30:56 -0800 | [diff] [blame] | 2711 | libs_qga="-lsetupapi -lcfgmgr32 $libs_qga" |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 2712 | fi |
| 2713 | fi |
| 2714 | |
| 2715 | ########################################## |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 2716 | # capstone |
| 2717 | |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 2718 | case "$capstone" in |
Richard Henderson | 8b18cdb | 2020-09-13 12:19:25 -0700 | [diff] [blame] | 2719 | auto | enabled | internal) |
| 2720 | # Simpler to always update submodule, even if not needed. |
Paolo Bonzini | 2d652f2 | 2021-05-12 09:21:56 +0200 | [diff] [blame] | 2721 | git_submodules="${git_submodules} capstone" |
Richard Henderson | e219c49 | 2017-09-28 09:01:23 -0700 | [diff] [blame] | 2722 | ;; |
| 2723 | esac |
Richard Henderson | 8ca8076 | 2017-09-14 09:41:12 -0700 | [diff] [blame] | 2724 | |
| 2725 | ########################################## |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 2726 | # check and set a backend for coroutine |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 2727 | |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2728 | # We prefer ucontext, but it's not always possible. The fallback |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 2729 | # is sigcontext. On Windows the only valid backend is the Windows |
| 2730 | # specific one. |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2731 | |
| 2732 | ucontext_works=no |
| 2733 | if test "$darwin" != "yes"; then |
| 2734 | cat > $TMPC << EOF |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 2735 | #include <ucontext.h> |
Peter Maydell | cdf8480 | 2012-02-23 16:20:05 +0000 | [diff] [blame] | 2736 | #ifdef __stub_makecontext |
| 2737 | #error Ignoring glibc stub makecontext which will always fail |
| 2738 | #endif |
Stefan Weil | 75cafad | 2011-12-17 09:27:29 +0100 | [diff] [blame] | 2739 | int main(void) { makecontext(0, 0, 0); return 0; } |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 2740 | EOF |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2741 | if compile_prog "" "" ; then |
| 2742 | ucontext_works=yes |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 2743 | fi |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2744 | fi |
| 2745 | |
| 2746 | if test "$coroutine" = ""; then |
| 2747 | if test "$mingw32" = "yes"; then |
| 2748 | coroutine=win32 |
| 2749 | elif test "$ucontext_works" = "yes"; then |
| 2750 | coroutine=ucontext |
| 2751 | else |
| 2752 | coroutine=sigaltstack |
| 2753 | fi |
Alex Barcelo | 519175a | 2012-02-28 12:25:50 +0100 | [diff] [blame] | 2754 | else |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2755 | case $coroutine in |
| 2756 | windows) |
| 2757 | if test "$mingw32" != "yes"; then |
| 2758 | error_exit "'windows' coroutine backend only valid for Windows" |
| 2759 | fi |
| 2760 | # Unfortunately the user visible backend name doesn't match the |
| 2761 | # coroutine-*.c filename for this case, so we have to adjust it here. |
| 2762 | coroutine=win32 |
| 2763 | ;; |
| 2764 | ucontext) |
| 2765 | if test "$ucontext_works" != "yes"; then |
| 2766 | feature_not_found "ucontext" |
| 2767 | fi |
| 2768 | ;; |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 2769 | sigaltstack) |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 2770 | if test "$mingw32" = "yes"; then |
| 2771 | error_exit "only the 'windows' coroutine backend is valid for Windows" |
| 2772 | fi |
| 2773 | ;; |
| 2774 | *) |
| 2775 | error_exit "unknown coroutine backend $coroutine" |
| 2776 | ;; |
| 2777 | esac |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 2778 | fi |
| 2779 | |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 2780 | if test "$coroutine_pool" = ""; then |
Daniel P. Berrange | 33c53c5 | 2017-04-28 13:24:44 +0100 | [diff] [blame] | 2781 | coroutine_pool=yes |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 2782 | fi |
| 2783 | |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 2784 | if test "$debug_stack_usage" = "yes"; then |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 2785 | if test "$coroutine_pool" = "yes"; then |
| 2786 | echo "WARN: disabling coroutine pool for stack usage debugging" |
| 2787 | coroutine_pool=no |
| 2788 | fi |
| 2789 | fi |
| 2790 | |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 2791 | ################################################## |
| 2792 | # SafeStack |
| 2793 | |
| 2794 | |
| 2795 | if test "$safe_stack" = "yes"; then |
| 2796 | cat > $TMPC << EOF |
| 2797 | int main(int argc, char *argv[]) |
| 2798 | { |
| 2799 | #if ! __has_feature(safe_stack) |
| 2800 | #error SafeStack Disabled |
| 2801 | #endif |
| 2802 | return 0; |
| 2803 | } |
| 2804 | EOF |
| 2805 | flag="-fsanitize=safe-stack" |
| 2806 | # Check that safe-stack is supported and enabled. |
| 2807 | if compile_prog "-Werror $flag" "$flag"; then |
| 2808 | # Flag needed both at compilation and at linking |
| 2809 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
| 2810 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
| 2811 | else |
| 2812 | error_exit "SafeStack not supported by your compiler" |
| 2813 | fi |
| 2814 | if test "$coroutine" != "ucontext"; then |
| 2815 | error_exit "SafeStack is only supported by the coroutine backend ucontext" |
| 2816 | fi |
| 2817 | else |
| 2818 | cat > $TMPC << EOF |
| 2819 | int main(int argc, char *argv[]) |
| 2820 | { |
| 2821 | #if defined(__has_feature) |
| 2822 | #if __has_feature(safe_stack) |
| 2823 | #error SafeStack Enabled |
| 2824 | #endif |
| 2825 | #endif |
| 2826 | return 0; |
| 2827 | } |
| 2828 | EOF |
| 2829 | if test "$safe_stack" = "no"; then |
| 2830 | # Make sure that safe-stack is disabled |
| 2831 | if ! compile_prog "-Werror" ""; then |
| 2832 | # SafeStack was already enabled, try to explicitly remove the feature |
| 2833 | flag="-fno-sanitize=safe-stack" |
| 2834 | if ! compile_prog "-Werror $flag" "$flag"; then |
| 2835 | error_exit "Configure cannot disable SafeStack" |
| 2836 | fi |
| 2837 | QEMU_CFLAGS="$QEMU_CFLAGS $flag" |
| 2838 | QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" |
| 2839 | fi |
| 2840 | else # "$safe_stack" = "" |
| 2841 | # Set safe_stack to yes or no based on pre-existing flags |
| 2842 | if compile_prog "-Werror" ""; then |
| 2843 | safe_stack="no" |
| 2844 | else |
| 2845 | safe_stack="yes" |
| 2846 | if test "$coroutine" != "ucontext"; then |
| 2847 | error_exit "SafeStack is only supported by the coroutine backend ucontext" |
| 2848 | fi |
| 2849 | fi |
| 2850 | fi |
| 2851 | fi |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 2852 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 2853 | ######################################## |
| 2854 | # check if cpuid.h is usable. |
| 2855 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 2856 | cat > $TMPC << EOF |
| 2857 | #include <cpuid.h> |
| 2858 | int main(void) { |
Peter Maydell | 774d566 | 2014-02-20 19:42:53 +0000 | [diff] [blame] | 2859 | unsigned a, b, c, d; |
| 2860 | int max = __get_cpuid_max(0, 0); |
| 2861 | |
| 2862 | if (max >= 1) { |
| 2863 | __cpuid(1, a, b, c, d); |
| 2864 | } |
| 2865 | |
| 2866 | if (max >= 7) { |
| 2867 | __cpuid_count(7, 0, a, b, c, d); |
| 2868 | } |
| 2869 | |
| 2870 | return 0; |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 2871 | } |
| 2872 | EOF |
| 2873 | if compile_prog "" "" ; then |
| 2874 | cpuid_h=yes |
| 2875 | fi |
| 2876 | |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 2877 | ########################################## |
| 2878 | # avx2 optimization requirement check |
| 2879 | # |
| 2880 | # There is no point enabling this if cpuid.h is not usable, |
| 2881 | # since we won't be able to select the new routines. |
| 2882 | |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2883 | if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 2884 | cat > $TMPC << EOF |
| 2885 | #pragma GCC push_options |
| 2886 | #pragma GCC target("avx2") |
| 2887 | #include <cpuid.h> |
| 2888 | #include <immintrin.h> |
| 2889 | static int bar(void *a) { |
| 2890 | __m256i x = *(__m256i *)a; |
| 2891 | return _mm256_testz_si256(x, x); |
| 2892 | } |
| 2893 | int main(int argc, char *argv[]) { return bar(argv[0]); } |
| 2894 | EOF |
Richard Henderson | 5b945f2 | 2021-07-19 10:01:12 -1000 | [diff] [blame] | 2895 | if compile_object "-Werror" ; then |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 2896 | avx2_opt="yes" |
Liam Merwick | 86583a0 | 2018-10-19 21:38:59 +0100 | [diff] [blame] | 2897 | else |
| 2898 | avx2_opt="no" |
Richard Henderson | 5dd8990 | 2017-07-18 18:40:18 -1000 | [diff] [blame] | 2899 | fi |
| 2900 | fi |
| 2901 | |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 2902 | ########################################## |
| 2903 | # avx512f optimization requirement check |
| 2904 | # |
| 2905 | # There is no point enabling this if cpuid.h is not usable, |
| 2906 | # since we won't be able to select the new routines. |
| 2907 | # by default, it is turned off. |
| 2908 | # if user explicitly want to enable it, check environment |
| 2909 | |
| 2910 | if test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then |
| 2911 | cat > $TMPC << EOF |
| 2912 | #pragma GCC push_options |
| 2913 | #pragma GCC target("avx512f") |
| 2914 | #include <cpuid.h> |
| 2915 | #include <immintrin.h> |
| 2916 | static int bar(void *a) { |
| 2917 | __m512i x = *(__m512i *)a; |
| 2918 | return _mm512_test_epi64_mask(x, x); |
| 2919 | } |
| 2920 | int main(int argc, char *argv[]) |
| 2921 | { |
| 2922 | return bar(argv[0]); |
| 2923 | } |
| 2924 | EOF |
Richard Henderson | 5b945f2 | 2021-07-19 10:01:12 -1000 | [diff] [blame] | 2925 | if ! compile_object "-Werror" ; then |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 2926 | avx512f_opt="no" |
| 2927 | fi |
| 2928 | else |
| 2929 | avx512f_opt="no" |
| 2930 | fi |
| 2931 | |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 2932 | ######################################## |
| 2933 | # check if __[u]int128_t is usable. |
| 2934 | |
| 2935 | int128=no |
| 2936 | cat > $TMPC << EOF |
| 2937 | __int128_t a; |
| 2938 | __uint128_t b; |
| 2939 | int main (void) { |
| 2940 | a = a + b; |
| 2941 | b = a * b; |
Peter Maydell | 464e367 | 2013-06-21 14:01:31 +0100 | [diff] [blame] | 2942 | a = a * a; |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 2943 | return 0; |
| 2944 | } |
| 2945 | EOF |
| 2946 | if compile_prog "" "" ; then |
| 2947 | int128=yes |
| 2948 | fi |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 2949 | |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 2950 | ######################################### |
| 2951 | # See if 128-bit atomic operations are supported. |
| 2952 | |
| 2953 | atomic128=no |
| 2954 | if test "$int128" = "yes"; then |
| 2955 | cat > $TMPC << EOF |
| 2956 | int main(void) |
| 2957 | { |
| 2958 | unsigned __int128 x = 0, y = 0; |
Thomas Huth | bceac54 | 2021-03-23 16:52:57 +0000 | [diff] [blame] | 2959 | y = __atomic_load(&x, 0); |
| 2960 | __atomic_store(&x, y, 0); |
| 2961 | __atomic_compare_exchange(&x, &y, x, 0, 0, 0); |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 2962 | return 0; |
| 2963 | } |
| 2964 | EOF |
| 2965 | if compile_prog "" "" ; then |
| 2966 | atomic128=yes |
| 2967 | fi |
| 2968 | fi |
| 2969 | |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 2970 | cmpxchg128=no |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 2971 | if test "$int128" = yes && test "$atomic128" = no; then |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 2972 | cat > $TMPC << EOF |
| 2973 | int main(void) |
| 2974 | { |
| 2975 | unsigned __int128 x = 0, y = 0; |
| 2976 | __sync_val_compare_and_swap_16(&x, y, x); |
| 2977 | return 0; |
| 2978 | } |
| 2979 | EOF |
| 2980 | if compile_prog "" "" ; then |
| 2981 | cmpxchg128=yes |
| 2982 | fi |
| 2983 | fi |
| 2984 | |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 2985 | ######################################## |
| 2986 | # check if ccache is interfering with |
| 2987 | # semantic analysis of macros |
| 2988 | |
John Snow | 5e4dfd3 | 2015-10-28 13:56:40 -0400 | [diff] [blame] | 2989 | unset CCACHE_CPP2 |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 2990 | ccache_cpp2=no |
| 2991 | cat > $TMPC << EOF |
| 2992 | static const int Z = 1; |
| 2993 | #define fn() ({ Z; }) |
| 2994 | #define TAUT(X) ((X) == Z) |
| 2995 | #define PAREN(X, Y) (X == Y) |
| 2996 | #define ID(X) (X) |
| 2997 | int main(int argc, char *argv[]) |
| 2998 | { |
| 2999 | int x = 0, y = 0; |
| 3000 | x = ID(x); |
| 3001 | x = fn(); |
| 3002 | fn(); |
| 3003 | if (PAREN(x, y)) return 0; |
| 3004 | if (TAUT(Z)) return 0; |
| 3005 | return 0; |
| 3006 | } |
| 3007 | EOF |
| 3008 | |
| 3009 | if ! compile_object "-Werror"; then |
| 3010 | ccache_cpp2=yes |
| 3011 | fi |
| 3012 | |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 3013 | ################################################# |
| 3014 | # clang does not support glibc + FORTIFY_SOURCE. |
| 3015 | |
| 3016 | if test "$fortify_source" != "no"; then |
| 3017 | if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then |
| 3018 | fortify_source="no"; |
Peter Maydell | e189091 | 2017-06-26 16:25:24 +0100 | [diff] [blame] | 3019 | elif test -n "$cxx" && has $cxx && |
John Snow | cfcc7c1 | 2015-11-12 11:29:49 -0500 | [diff] [blame] | 3020 | echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 3021 | fortify_source="no"; |
| 3022 | else |
| 3023 | fortify_source="yes" |
| 3024 | fi |
| 3025 | fi |
| 3026 | |
Aneesh Kumar K.V | d204237 | 2011-10-12 19:11:24 +0530 | [diff] [blame] | 3027 | ########################################## |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 3028 | # check for usable membarrier system call |
| 3029 | if test "$membarrier" = "yes"; then |
| 3030 | have_membarrier=no |
| 3031 | if test "$mingw32" = "yes" ; then |
| 3032 | have_membarrier=yes |
| 3033 | elif test "$linux" = "yes" ; then |
| 3034 | cat > $TMPC << EOF |
| 3035 | #include <linux/membarrier.h> |
| 3036 | #include <sys/syscall.h> |
| 3037 | #include <unistd.h> |
| 3038 | #include <stdlib.h> |
| 3039 | int main(void) { |
| 3040 | syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0); |
| 3041 | syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0); |
| 3042 | exit(0); |
| 3043 | } |
| 3044 | EOF |
| 3045 | if compile_prog "" "" ; then |
| 3046 | have_membarrier=yes |
| 3047 | fi |
| 3048 | fi |
| 3049 | if test "$have_membarrier" = "no"; then |
| 3050 | feature_not_found "membarrier" "membarrier system call not available" |
| 3051 | fi |
| 3052 | else |
| 3053 | # Do not enable it by default even for Mingw32, because it doesn't |
| 3054 | # work on Wine. |
| 3055 | membarrier=no |
| 3056 | fi |
| 3057 | |
| 3058 | ########################################## |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 3059 | # check for usable AF_ALG environment |
Thomas Huth | 4f67366 | 2020-02-03 16:55:34 +0100 | [diff] [blame] | 3060 | have_afalg=no |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 3061 | cat > $TMPC << EOF |
| 3062 | #include <errno.h> |
| 3063 | #include <sys/types.h> |
| 3064 | #include <sys/socket.h> |
| 3065 | #include <linux/if_alg.h> |
| 3066 | int main(void) { |
| 3067 | int sock; |
| 3068 | sock = socket(AF_ALG, SOCK_SEQPACKET, 0); |
| 3069 | return sock; |
| 3070 | } |
| 3071 | EOF |
| 3072 | if compile_prog "" "" ; then |
| 3073 | have_afalg=yes |
| 3074 | fi |
| 3075 | if test "$crypto_afalg" = "yes" |
| 3076 | then |
| 3077 | if test "$have_afalg" != "yes" |
| 3078 | then |
| 3079 | error_exit "AF_ALG requested but could not be detected" |
| 3080 | fi |
| 3081 | fi |
| 3082 | |
| 3083 | |
Richard Henderson | db1ed1a | 2019-03-13 20:57:28 -0700 | [diff] [blame] | 3084 | ########################################## |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3085 | # checks for sanitizers |
| 3086 | |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3087 | have_asan=no |
| 3088 | have_ubsan=no |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 3089 | have_asan_iface_h=no |
| 3090 | have_asan_iface_fiber=no |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3091 | |
| 3092 | if test "$sanitizers" = "yes" ; then |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 3093 | write_c_skeleton |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3094 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" ""; then |
| 3095 | have_asan=yes |
| 3096 | fi |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 3097 | |
| 3098 | # we could use a simple skeleton for flags checks, but this also |
| 3099 | # detect the static linking issue of ubsan, see also: |
| 3100 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 |
| 3101 | cat > $TMPC << EOF |
| 3102 | #include <stdlib.h> |
| 3103 | int main(void) { |
| 3104 | void *tmp = malloc(10); |
Leonid Bloch | f2dfe54 | 2020-05-25 01:12:04 +0300 | [diff] [blame] | 3105 | if (tmp != NULL) { |
| 3106 | return *(int *)(tmp + 2); |
| 3107 | } |
Olaf Hering | d1abf3f | 2020-07-07 19:13:25 +0200 | [diff] [blame] | 3108 | return 1; |
Marc-André Lureau | b9f44da | 2018-02-15 22:25:47 +0100 | [diff] [blame] | 3109 | } |
| 3110 | EOF |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3111 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then |
| 3112 | have_ubsan=yes |
| 3113 | fi |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 3114 | |
| 3115 | if check_include "sanitizer/asan_interface.h" ; then |
| 3116 | have_asan_iface_h=yes |
| 3117 | fi |
| 3118 | |
| 3119 | cat > $TMPC << EOF |
| 3120 | #include <sanitizer/asan_interface.h> |
| 3121 | int main(void) { |
| 3122 | __sanitizer_start_switch_fiber(0, 0, 0); |
| 3123 | return 0; |
| 3124 | } |
| 3125 | EOF |
| 3126 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" "" ; then |
| 3127 | have_asan_iface_fiber=yes |
| 3128 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3129 | fi |
| 3130 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 3131 | # Thread sanitizer is, for now, much noisier than the other sanitizers; |
| 3132 | # keep it separate until that is not the case. |
| 3133 | if test "$tsan" = "yes" && test "$sanitizers" = "yes"; then |
| 3134 | error_exit "TSAN is not supported with other sanitiziers." |
| 3135 | fi |
| 3136 | have_tsan=no |
| 3137 | have_tsan_iface_fiber=no |
| 3138 | if test "$tsan" = "yes" ; then |
| 3139 | write_c_skeleton |
| 3140 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then |
| 3141 | have_tsan=yes |
| 3142 | fi |
| 3143 | cat > $TMPC << EOF |
| 3144 | #include <sanitizer/tsan_interface.h> |
| 3145 | int main(void) { |
| 3146 | __tsan_create_fiber(0); |
| 3147 | return 0; |
| 3148 | } |
| 3149 | EOF |
| 3150 | if compile_prog "$CPU_CFLAGS -Werror -fsanitize=thread" "" ; then |
| 3151 | have_tsan_iface_fiber=yes |
| 3152 | fi |
| 3153 | fi |
| 3154 | |
Alexander Bulekov | adc2802 | 2020-02-19 23:11:14 -0500 | [diff] [blame] | 3155 | ########################################## |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 3156 | # check for slirp |
| 3157 | |
| 3158 | case "$slirp" in |
Paolo Bonzini | 4d34a86 | 2020-10-05 11:31:15 +0200 | [diff] [blame] | 3159 | auto | enabled | internal) |
| 3160 | # Simpler to always update submodule, even if not needed. |
Paolo Bonzini | 2d652f2 | 2021-05-12 09:21:56 +0200 | [diff] [blame] | 3161 | git_submodules="${git_submodules} slirp" |
Marc-André Lureau | 675b9b5 | 2019-02-12 17:25:23 +0100 | [diff] [blame] | 3162 | ;; |
| 3163 | esac |
| 3164 | |
Joelle van Dyne | b8e0c49 | 2021-03-15 11:03:41 -0700 | [diff] [blame] | 3165 | # Check for slirp smbd dupport |
| 3166 | : ${smbd=${SMBD-/usr/sbin/smbd}} |
| 3167 | if test "$slirp_smbd" != "no" ; then |
| 3168 | if test "$mingw32" = "yes" ; then |
| 3169 | if test "$slirp_smbd" = "yes" ; then |
| 3170 | error_exit "Host smbd not supported on this platform." |
| 3171 | fi |
| 3172 | slirp_smbd=no |
| 3173 | else |
| 3174 | slirp_smbd=yes |
| 3175 | fi |
| 3176 | fi |
| 3177 | |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 3178 | ########################################## |
| 3179 | # check for usable __NR_keyctl syscall |
| 3180 | |
| 3181 | if test "$linux" = "yes" ; then |
| 3182 | |
| 3183 | have_keyring=no |
| 3184 | cat > $TMPC << EOF |
| 3185 | #include <errno.h> |
| 3186 | #include <asm/unistd.h> |
| 3187 | #include <linux/keyctl.h> |
| 3188 | #include <unistd.h> |
| 3189 | int main(void) { |
| 3190 | return syscall(__NR_keyctl, KEYCTL_READ, 0, NULL, NULL, 0); |
| 3191 | } |
| 3192 | EOF |
| 3193 | if compile_prog "" "" ; then |
| 3194 | have_keyring=yes |
| 3195 | fi |
| 3196 | fi |
| 3197 | if test "$secret_keyring" != "no" |
| 3198 | then |
David Edmondson | b418d26 | 2020-07-01 14:56:15 +0100 | [diff] [blame] | 3199 | if test "$have_keyring" = "yes" |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 3200 | then |
| 3201 | secret_keyring=yes |
| 3202 | else |
| 3203 | if test "$secret_keyring" = "yes" |
| 3204 | then |
| 3205 | error_exit "syscall __NR_keyctl requested, \ |
| 3206 | but not implemented on your system" |
| 3207 | else |
| 3208 | secret_keyring=no |
| 3209 | fi |
| 3210 | fi |
| 3211 | fi |
| 3212 | |
Alexey Krasikov | 9250036 | 2020-05-25 14:19:13 +0300 | [diff] [blame] | 3213 | ########################################## |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 3214 | # End of CC checks |
| 3215 | # After here, no more $cc or $ld runs |
| 3216 | |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 3217 | write_c_skeleton |
| 3218 | |
Blue Swirl | 1d728c3 | 2012-05-01 18:45:39 +0000 | [diff] [blame] | 3219 | if test "$gcov" = "yes" ; then |
Marc-André Lureau | bf0e56a | 2019-10-04 17:35:16 +0400 | [diff] [blame] | 3220 | : |
John Snow | b553a04 | 2015-11-03 15:43:42 -0500 | [diff] [blame] | 3221 | elif test "$fortify_source" = "yes" ; then |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 3222 | QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" |
| 3223 | debug=no |
| 3224 | fi |
Paolo Bonzini | 086d5f7 | 2020-02-03 15:22:17 +0100 | [diff] [blame] | 3225 | |
| 3226 | case "$ARCH" in |
| 3227 | alpha) |
| 3228 | # Ensure there's only a single GP |
| 3229 | QEMU_CFLAGS="-msmall-data $QEMU_CFLAGS" |
| 3230 | ;; |
| 3231 | esac |
| 3232 | |
| 3233 | if test "$gprof" = "yes" ; then |
| 3234 | QEMU_CFLAGS="-p $QEMU_CFLAGS" |
| 3235 | QEMU_LDFLAGS="-p $QEMU_LDFLAGS" |
| 3236 | fi |
Juan Quintela | a316e37 | 2009-09-30 01:10:55 +0200 | [diff] [blame] | 3237 | |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3238 | if test "$have_asan" = "yes"; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 3239 | QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS" |
| 3240 | QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS" |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 3241 | if test "$have_asan_iface_h" = "no" ; then |
| 3242 | echo "ASAN build enabled, but ASAN header missing." \ |
| 3243 | "Without code annotation, the report may be inferior." |
| 3244 | elif test "$have_asan_iface_fiber" = "no" ; then |
| 3245 | echo "ASAN build enabled, but ASAN header is too old." \ |
| 3246 | "Without code annotation, the report may be inferior." |
| 3247 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3248 | fi |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 3249 | if test "$have_tsan" = "yes" ; then |
| 3250 | if test "$have_tsan_iface_fiber" = "yes" ; then |
| 3251 | QEMU_CFLAGS="-fsanitize=thread $QEMU_CFLAGS" |
| 3252 | QEMU_LDFLAGS="-fsanitize=thread $QEMU_LDFLAGS" |
| 3253 | else |
| 3254 | error_exit "Cannot enable TSAN due to missing fiber annotation interface." |
| 3255 | fi |
| 3256 | elif test "$tsan" = "yes" ; then |
| 3257 | error_exit "Cannot enable TSAN due to missing sanitize thread interface." |
| 3258 | fi |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3259 | if test "$have_ubsan" = "yes"; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 3260 | QEMU_CFLAGS="-fsanitize=undefined $QEMU_CFLAGS" |
| 3261 | QEMU_LDFLAGS="-fsanitize=undefined $QEMU_LDFLAGS" |
Marc-André Lureau | 247724c | 2018-01-16 16:11:51 +0100 | [diff] [blame] | 3262 | fi |
| 3263 | |
Peter Lieven | 6542aa9 | 2014-02-03 10:26:13 +0100 | [diff] [blame] | 3264 | ########################################## |
Tomáš Golembiovský | 3efac6e | 2018-10-23 13:23:10 +0200 | [diff] [blame] | 3265 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 3266 | # Exclude --warn-common with TSan to suppress warnings from the TSan libraries. |
| 3267 | if test "$solaris" = "no" && test "$tsan" = "no"; then |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 3268 | 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] | 3269 | QEMU_LDFLAGS="-Wl,--warn-common $QEMU_LDFLAGS" |
Juan Quintela | e86ecd4 | 2009-08-03 14:45:59 +0200 | [diff] [blame] | 3270 | fi |
| 3271 | fi |
| 3272 | |
Blue Swirl | 952afb7 | 2010-09-19 08:36:34 +0000 | [diff] [blame] | 3273 | # Use ASLR, no-SEH and DEP if available |
| 3274 | if test "$mingw32" = "yes" ; then |
Mark Cave-Ayland | cb8baa7 | 2020-10-05 14:34:34 +0100 | [diff] [blame] | 3275 | flags="--no-seh --nxcompat" |
| 3276 | |
| 3277 | # Disable ASLR for debug builds to allow debugging with gdb |
| 3278 | if test "$debug" = "no" ; then |
| 3279 | flags="--dynamicbase $flags" |
| 3280 | fi |
| 3281 | |
| 3282 | for flag in $flags; do |
Christian Borntraeger | e9a3591 | 2017-08-23 12:16:23 +0200 | [diff] [blame] | 3283 | if ld_has $flag ; then |
Paolo Bonzini | db5adea | 2019-12-11 15:34:27 +0100 | [diff] [blame] | 3284 | QEMU_LDFLAGS="-Wl,$flag $QEMU_LDFLAGS" |
Blue Swirl | 952afb7 | 2010-09-19 08:36:34 +0000 | [diff] [blame] | 3285 | fi |
| 3286 | done |
| 3287 | fi |
| 3288 | |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 3289 | # Probe for guest agent support/options |
| 3290 | |
Michael Tokarev | e8ef31a | 2013-07-31 14:22:07 +0400 | [diff] [blame] | 3291 | if [ "$guest_agent" != "no" ]; then |
Laurent Vivier | a512590 | 2019-04-01 16:12:20 +0200 | [diff] [blame] | 3292 | if [ "$softmmu" = no -a "$want_tools" = no ] ; then |
| 3293 | guest_agent=no |
| 3294 | 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] | 3295 | guest_agent=yes |
| 3296 | elif [ "$guest_agent" != yes ]; then |
| 3297 | guest_agent=no |
| 3298 | else |
| 3299 | error_exit "Guest agent is not supported on this platform" |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 3300 | fi |
Paolo Bonzini | 00c705f | 2012-05-29 11:40:24 +0200 | [diff] [blame] | 3301 | fi |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 3302 | |
Paolo Bonzini | b846ab7 | 2021-01-21 11:49:04 +0100 | [diff] [blame] | 3303 | # Guest agent Windows MSI package |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 3304 | |
Paolo Bonzini | b846ab7 | 2021-01-21 11:49:04 +0100 | [diff] [blame] | 3305 | if test "$QEMU_GA_MANUFACTURER" = ""; then |
| 3306 | QEMU_GA_MANUFACTURER=QEMU |
| 3307 | fi |
| 3308 | if test "$QEMU_GA_DISTRO" = ""; then |
| 3309 | QEMU_GA_DISTRO=Linux |
| 3310 | fi |
| 3311 | if test "$QEMU_GA_VERSION" = ""; then |
| 3312 | QEMU_GA_VERSION=$(cat $source_path/VERSION) |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 3313 | fi |
| 3314 | |
Paolo Bonzini | b846ab7 | 2021-01-21 11:49:04 +0100 | [diff] [blame] | 3315 | QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin" |
Michael Roth | 9d6bc27 | 2015-08-26 10:49:13 -0500 | [diff] [blame] | 3316 | |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 3317 | # Mac OS X ships with a broken assembler |
| 3318 | roms= |
Eric Blake | e633a5c | 2019-02-04 20:39:37 -0600 | [diff] [blame] | 3319 | if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 3320 | test "$targetos" != "darwin" && test "$targetos" != "sunos" && \ |
| 3321 | test "$targetos" != "haiku" && test "$softmmu" = yes ; then |
Peter Maydell | e57218b | 2016-08-08 17:11:28 +0100 | [diff] [blame] | 3322 | # 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] | 3323 | # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd |
| 3324 | # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. |
| 3325 | 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] | 3326 | if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then |
| 3327 | ld_i386_emulation="$emu" |
| 3328 | roms="optionrom" |
| 3329 | break |
| 3330 | fi |
| 3331 | done |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 3332 | fi |
Paolo Bonzini | ca35f78 | 2010-05-26 16:08:29 +0200 | [diff] [blame] | 3333 | |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 3334 | # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 |
Thomas Huth | a5b2afd | 2021-05-02 13:22:21 +0200 | [diff] [blame] | 3335 | # or -march=z10 (which is the lowest architecture level that Clang supports) |
Christian Borntraeger | 9933c30 | 2013-04-23 01:23:03 +0000 | [diff] [blame] | 3336 | if test "$cpu" = "s390x" ; then |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 3337 | write_c_skeleton |
Thomas Huth | a5b2afd | 2021-05-02 13:22:21 +0200 | [diff] [blame] | 3338 | compile_prog "-march=z900" "" |
| 3339 | has_z900=$? |
Thomas Huth | 3af448b | 2021-05-25 16:20:32 +0200 | [diff] [blame] | 3340 | if [ $has_z900 = 0 ] || compile_object "-march=z10 -msoft-float -Werror"; then |
Thomas Huth | a5b2afd | 2021-05-02 13:22:21 +0200 | [diff] [blame] | 3341 | if [ $has_z900 != 0 ]; then |
| 3342 | echo "WARNING: Your compiler does not support the z900!" |
| 3343 | echo " The s390-ccw bios will only work with guest CPUs >= z10." |
| 3344 | fi |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 3345 | roms="$roms s390-ccw" |
Philippe Mathieu-Daudé | 1ef6bfc | 2020-06-15 09:49:19 +0200 | [diff] [blame] | 3346 | # SLOF is required for building the s390-ccw firmware on s390x, |
| 3347 | # since it is using the libnet code from SLOF for network booting. |
Paolo Bonzini | 2d652f2 | 2021-05-12 09:21:56 +0200 | [diff] [blame] | 3348 | git_submodules="${git_submodules} roms/SLOF" |
Thomas Huth | 2e33c3f | 2019-01-14 13:52:26 +0100 | [diff] [blame] | 3349 | fi |
Christian Borntraeger | 9933c30 | 2013-04-23 01:23:03 +0000 | [diff] [blame] | 3350 | fi |
| 3351 | |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 3352 | # Check that the C++ compiler exists and works with the C compiler. |
| 3353 | # All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. |
| 3354 | if has $cxx; then |
| 3355 | cat > $TMPC <<EOF |
| 3356 | int c_function(void); |
| 3357 | int main(void) { return c_function(); } |
| 3358 | EOF |
| 3359 | |
| 3360 | compile_object |
| 3361 | |
| 3362 | cat > $TMPCXX <<EOF |
| 3363 | extern "C" { |
| 3364 | int c_function(void); |
| 3365 | } |
| 3366 | int c_function(void) { return 42; } |
| 3367 | EOF |
| 3368 | |
| 3369 | update_cxxflags |
| 3370 | |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 3371 | if do_cxx $CXXFLAGS $EXTRA_CXXFLAGS $CONFIGURE_CXXFLAGS $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 3372 | # C++ compiler $cxx works ok with C compiler $cc |
| 3373 | : |
| 3374 | else |
| 3375 | echo "C++ compiler $cxx does not work with C compiler $cc" |
| 3376 | echo "Disabling C++ specific optional code" |
| 3377 | cxx= |
| 3378 | fi |
| 3379 | else |
| 3380 | echo "No C++ compiler available; disabling C++ specific optional code" |
| 3381 | cxx= |
| 3382 | fi |
| 3383 | |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 3384 | if !(GIT="$git" "$source_path/scripts/git-submodule.sh" "$git_submodules_action" "$git_submodules"); then |
| 3385 | exit 1 |
Yonggang Luo | 5d91a2e | 2020-09-03 01:00:49 +0800 | [diff] [blame] | 3386 | fi |
Yonggang Luo | 5d91a2e | 2020-09-03 01:00:49 +0800 | [diff] [blame] | 3387 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3388 | config_host_mak="config-host.mak" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 3389 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3390 | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3391 | echo >> $config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3392 | |
Paolo Bonzini | e6c3b0f | 2010-10-21 10:18:35 +0200 | [diff] [blame] | 3393 | echo all: >> $config_host_mak |
Daniel P. Berrange | cc84d63 | 2017-10-20 15:02:43 +0100 | [diff] [blame] | 3394 | echo "GIT=$git" >> $config_host_mak |
Daniel P. Berrange | aef45d5 | 2017-09-29 11:11:56 +0100 | [diff] [blame] | 3395 | echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak |
Dan Streetman | 7d7dbf9 | 2021-01-19 12:20:46 -0500 | [diff] [blame] | 3396 | echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3397 | |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 3398 | if test "$debug_tcg" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 3399 | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
aurel32 | f839394 | 2009-04-13 18:45:38 +0000 | [diff] [blame] | 3400 | fi |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 3401 | if test "$strip_opt" = "yes" ; then |
Hollis Blanchard | 52ba784 | 2010-08-04 17:21:34 -0700 | [diff] [blame] | 3402 | echo "STRIP=${strip}" >> $config_host_mak |
aliguori | 1625af8 | 2009-04-05 17:41:02 +0000 | [diff] [blame] | 3403 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 3404 | if test "$mingw32" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3405 | echo "CONFIG_WIN32=y" >> $config_host_mak |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 3406 | if test "$guest_agent_with_vss" = "yes" ; then |
| 3407 | echo "CONFIG_QGA_VSS=y" >> $config_host_mak |
Michael Roth | f33ca81 | 2015-08-26 16:19:41 -0500 | [diff] [blame] | 3408 | echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak |
Tomoki Sekiyama | d9840e2 | 2013-08-07 11:40:03 -0400 | [diff] [blame] | 3409 | echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak |
| 3410 | fi |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 3411 | if test "$guest_agent_ntddscsi" = "yes" ; then |
Tomáš Golembiovský | 76dc75c | 2018-10-23 13:23:16 +0200 | [diff] [blame] | 3412 | echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak |
Michael Roth | 50cbebb | 2015-07-07 18:10:09 -0500 | [diff] [blame] | 3413 | fi |
Paolo Bonzini | b846ab7 | 2021-01-21 11:49:04 +0100 | [diff] [blame] | 3414 | echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak |
| 3415 | echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak |
| 3416 | echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak |
| 3417 | echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 3418 | else |
Juan Quintela | 35f4df2 | 2009-07-27 16:13:07 +0200 | [diff] [blame] | 3419 | echo "CONFIG_POSIX=y" >> $config_host_mak |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 3420 | fi |
blueswir1 | 128ab2f | 2008-08-15 18:33:42 +0000 | [diff] [blame] | 3421 | |
Mark McLoughlin | dffcb71 | 2009-10-22 17:49:11 +0100 | [diff] [blame] | 3422 | if test "$linux" = "yes" ; then |
| 3423 | echo "CONFIG_LINUX=y" >> $config_host_mak |
| 3424 | fi |
| 3425 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 3426 | if test "$darwin" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3427 | echo "CONFIG_DARWIN=y" >> $config_host_mak |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 3428 | fi |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 3429 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 3430 | if test "$solaris" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3431 | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 3432 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 3433 | if test "$static" = "yes" ; then |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3434 | echo "CONFIG_STATIC=y" >> $config_host_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 3435 | fi |
Stefan Weil | 1ba1696 | 2011-07-29 22:40:45 +0200 | [diff] [blame] | 3436 | if test "$profiler" = "yes" ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 3437 | echo "CONFIG_PROFILER=y" >> $config_host_mak |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 3438 | fi |
Paolo Bonzini | c932ce3 | 2019-07-18 12:24:29 +0200 | [diff] [blame] | 3439 | if test "$want_tools" = "yes" ; then |
| 3440 | echo "CONFIG_TOOLS=y" >> $config_host_mak |
| 3441 | fi |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 3442 | if test "$guest_agent" = "yes" ; then |
| 3443 | echo "CONFIG_GUEST_AGENT=y" >> $config_host_mak |
| 3444 | fi |
Joelle van Dyne | b8e0c49 | 2021-03-15 11:03:41 -0700 | [diff] [blame] | 3445 | if test "$slirp_smbd" = "yes" ; then |
| 3446 | echo "CONFIG_SLIRP_SMBD=y" >> $config_host_mak |
| 3447 | echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak |
| 3448 | fi |
Paolo Bonzini | 4cc600d | 2020-02-04 17:11:04 +0100 | [diff] [blame] | 3449 | if test "$gprof" = "yes" ; then |
| 3450 | echo "CONFIG_GPROF=y" >> $config_host_mak |
| 3451 | fi |
Fam Zheng | b64ec4e | 2013-05-29 19:35:40 +0800 | [diff] [blame] | 3452 | echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak |
| 3453 | echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak |
Kevin Wolf | e5f05f8 | 2021-07-09 18:41:41 +0200 | [diff] [blame] | 3454 | if test "$block_drv_whitelist_tools" = "yes" ; then |
| 3455 | echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak |
| 3456 | fi |
Christoph Hellwig | dce512d | 2010-12-17 11:41:15 +0100 | [diff] [blame] | 3457 | if test "$xfs" = "yes" ; then |
| 3458 | echo "CONFIG_XFS=y" >> $config_host_mak |
| 3459 | fi |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3460 | qemu_version=$(head $source_path/VERSION) |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 3461 | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3462 | echo "SRC_PATH=$source_path" >> $config_host_mak |
Alex Bennée | 2b1f35b | 2018-07-04 07:30:11 +0100 | [diff] [blame] | 3463 | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
Fam Zheng | 1796926 | 2014-02-10 14:48:56 +0800 | [diff] [blame] | 3464 | if test "$modules" = "yes"; then |
Fam Zheng | e26110c | 2014-02-10 14:48:57 +0800 | [diff] [blame] | 3465 | # $shacmd can generate a hash started with digit, which the compiler doesn't |
| 3466 | # like as an symbol. So prefix it with an underscore |
Stefan Weil | 8913885 | 2016-05-16 15:10:20 +0200 | [diff] [blame] | 3467 | 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] | 3468 | echo "CONFIG_MODULES=y" >> $config_host_mak |
| 3469 | fi |
Christian Ehrhardt | bd83c86 | 2020-03-10 15:58:06 +0100 | [diff] [blame] | 3470 | if test "$module_upgrades" = "yes"; then |
| 3471 | echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak |
| 3472 | fi |
Cortland Tölva | 955727d | 2018-10-08 09:35:19 -0700 | [diff] [blame] | 3473 | if test "$have_usbfs" = "yes" ; then |
| 3474 | echo "CONFIG_USBFS=y" >> $config_host_mak |
| 3475 | fi |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 3476 | if test "$gio" = "yes" ; then |
| 3477 | echo "CONFIG_GIO=y" >> $config_host_mak |
| 3478 | echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak |
| 3479 | echo "GIO_LIBS=$gio_libs" >> $config_host_mak |
Paolo Bonzini | 5ecfb76 | 2021-05-05 10:15:34 -0400 | [diff] [blame] | 3480 | fi |
| 3481 | if test "$gdbus_codegen" != "" ; then |
Marc-André Lureau | 25a97a5 | 2019-09-27 11:34:42 +0400 | [diff] [blame] | 3482 | echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak |
Marc-André Lureau | f876b76 | 2019-02-21 12:07:00 +0100 | [diff] [blame] | 3483 | fi |
Daniel P. Berrange | a1c5e94 | 2016-06-06 10:05:06 +0100 | [diff] [blame] | 3484 | echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak |
Jan Vesely | 277abf1 | 2016-04-29 13:15:23 -0400 | [diff] [blame] | 3485 | |
Paolo Bonzini | 1badb70 | 2020-09-18 04:57:25 -0400 | [diff] [blame] | 3486 | if test "$xen" = "enabled" ; then |
Jan Kiszka | 6dbd588 | 2011-06-21 22:59:07 +0200 | [diff] [blame] | 3487 | echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak |
Anthony PERARD | d5b93dd | 2011-02-25 16:20:34 +0000 | [diff] [blame] | 3488 | 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] | 3489 | echo "XEN_CFLAGS=$xen_cflags" >> $config_host_mak |
| 3490 | echo "XEN_LIBS=$xen_libs" >> $config_host_mak |
aliguori | e37630c | 2009-04-22 15:19:10 +0000 | [diff] [blame] | 3491 | fi |
Nicholas Bellinger | 5e9be92 | 2013-03-29 01:08:16 +0000 | [diff] [blame] | 3492 | if test "$vhost_scsi" = "yes" ; then |
| 3493 | echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak |
| 3494 | fi |
Paolo Bonzini | af3bba7 | 2019-02-14 18:35:52 +0100 | [diff] [blame] | 3495 | if test "$vhost_net" = "yes" ; then |
| 3496 | echo "CONFIG_VHOST_NET=y" >> $config_host_mak |
| 3497 | fi |
| 3498 | if test "$vhost_net_user" = "yes" ; then |
Paolo Bonzini | 56f41de | 2019-02-14 18:35:49 +0100 | [diff] [blame] | 3499 | echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak |
Nikolay Nikolaev | 03ce574 | 2014-06-10 13:02:16 +0300 | [diff] [blame] | 3500 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 3501 | if test "$vhost_net_vdpa" = "yes" ; then |
| 3502 | echo "CONFIG_VHOST_NET_VDPA=y" >> $config_host_mak |
| 3503 | fi |
Gonglei | 042cea2 | 2018-03-01 21:46:28 +0800 | [diff] [blame] | 3504 | if test "$vhost_crypto" = "yes" ; then |
| 3505 | echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak |
| 3506 | fi |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 3507 | if test "$vhost_vsock" = "yes" ; then |
| 3508 | echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak |
Stefano Garzarella | 5fe97d8 | 2020-05-22 14:25:11 +0200 | [diff] [blame] | 3509 | if test "$vhost_user" = "yes" ; then |
| 3510 | echo "CONFIG_VHOST_USER_VSOCK=y" >> $config_host_mak |
| 3511 | fi |
Stefan Hajnoczi | fc0b9b0 | 2016-08-16 13:27:22 +0100 | [diff] [blame] | 3512 | fi |
Paolo Bonzini | 299e6f1 | 2019-02-14 18:35:53 +0100 | [diff] [blame] | 3513 | if test "$vhost_kernel" = "yes" ; then |
| 3514 | echo "CONFIG_VHOST_KERNEL=y" >> $config_host_mak |
| 3515 | fi |
Marc-André Lureau | e6a7486 | 2017-08-03 11:07:46 +0200 | [diff] [blame] | 3516 | if test "$vhost_user" = "yes" ; then |
| 3517 | echo "CONFIG_VHOST_USER=y" >> $config_host_mak |
| 3518 | fi |
Cindy Lu | 108a648 | 2020-07-01 22:55:37 +0800 | [diff] [blame] | 3519 | if test "$vhost_vdpa" = "yes" ; then |
| 3520 | echo "CONFIG_VHOST_VDPA=y" >> $config_host_mak |
| 3521 | fi |
Dr. David Alan Gilbert | 98fc1ad | 2019-09-30 11:51:34 +0100 | [diff] [blame] | 3522 | if test "$vhost_user_fs" = "yes" ; then |
| 3523 | echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak |
| 3524 | fi |
Paolo Bonzini | a40161c | 2018-02-16 10:05:23 +0100 | [diff] [blame] | 3525 | if test "$membarrier" = "yes" ; then |
| 3526 | echo "CONFIG_MEMBARRIER=y" >> $config_host_mak |
| 3527 | fi |
Richard Henderson | e5b4654 | 2021-02-07 18:15:04 -0800 | [diff] [blame] | 3528 | if test "$tcg" = "enabled" -a "$tcg_interpreter" = "true" ; then |
| 3529 | echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak |
| 3530 | fi |
Gerd Hoffmann | 58d3f3f | 2021-05-19 07:39:32 +0200 | [diff] [blame] | 3531 | |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 3532 | if test "$opengl" = "yes" ; then |
| 3533 | echo "CONFIG_OPENGL=y" >> $config_host_mak |
Paolo Bonzini | de2d300 | 2020-09-01 08:41:17 -0400 | [diff] [blame] | 3534 | echo "OPENGL_CFLAGS=$opengl_cflags" >> $config_host_mak |
Gerd Hoffmann | da076ff | 2014-11-20 09:49:44 +0100 | [diff] [blame] | 3535 | echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak |
Michael Walle | 20ff075 | 2011-03-07 23:32:39 +0100 | [diff] [blame] | 3536 | fi |
| 3537 | |
Liang Li | 99f2dbd | 2016-03-08 13:53:16 +0800 | [diff] [blame] | 3538 | if test "$avx2_opt" = "yes" ; then |
| 3539 | echo "CONFIG_AVX2_OPT=y" >> $config_host_mak |
| 3540 | fi |
| 3541 | |
Robert Hoo | 6b8cd44 | 2020-02-29 20:34:34 +0800 | [diff] [blame] | 3542 | if test "$avx512f_opt" = "yes" ; then |
| 3543 | echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak |
| 3544 | fi |
| 3545 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 3546 | # XXX: suppress that |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 3547 | if [ "$bsd" = "yes" ] ; then |
Juan Quintela | 2358a49 | 2009-07-27 16:13:25 +0200 | [diff] [blame] | 3548 | echo "CONFIG_BSD=y" >> $config_host_mak |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 3549 | fi |
| 3550 | |
Paolo Bonzini | 3556c23 | 2013-05-10 14:16:40 +0200 | [diff] [blame] | 3551 | if test "$qom_cast_debug" = "yes" ; then |
| 3552 | echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak |
| 3553 | fi |
Anthony Liguori | 20ff6c8 | 2009-12-09 12:59:36 -0600 | [diff] [blame] | 3554 | |
Peter Maydell | 7c2acc7 | 2013-04-08 12:11:27 +0100 | [diff] [blame] | 3555 | echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak |
Stefan Hajnoczi | 70c60c0 | 2013-09-11 16:42:35 +0200 | [diff] [blame] | 3556 | if test "$coroutine_pool" = "yes" ; then |
| 3557 | echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak |
| 3558 | else |
| 3559 | echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak |
| 3560 | fi |
Aneesh Kumar K.V | d0e2fce | 2011-06-09 23:11:06 +0530 | [diff] [blame] | 3561 | |
Peter Lieven | 7d992e4 | 2016-09-27 11:58:45 +0200 | [diff] [blame] | 3562 | if test "$debug_stack_usage" = "yes" ; then |
| 3563 | echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak |
| 3564 | fi |
| 3565 | |
Longpeng(Mike) | f0d92b5 | 2017-07-14 14:04:05 -0400 | [diff] [blame] | 3566 | if test "$crypto_afalg" = "yes" ; then |
| 3567 | echo "CONFIG_AF_ALG=y" >> $config_host_mak |
| 3568 | fi |
| 3569 | |
Marc-André Lureau | d83414e | 2018-01-16 16:11:52 +0100 | [diff] [blame] | 3570 | if test "$have_asan_iface_fiber" = "yes" ; then |
| 3571 | echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak |
| 3572 | fi |
| 3573 | |
Lingfeng Yang | 0aebab0 | 2020-06-12 20:02:23 +0100 | [diff] [blame] | 3574 | if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then |
| 3575 | echo "CONFIG_TSAN=y" >> $config_host_mak |
| 3576 | fi |
| 3577 | |
Richard Henderson | 76a347e | 2012-12-28 14:17:02 -0800 | [diff] [blame] | 3578 | if test "$cpuid_h" = "yes" ; then |
| 3579 | echo "CONFIG_CPUID_H=y" >> $config_host_mak |
| 3580 | fi |
| 3581 | |
Richard Henderson | f540166 | 2013-02-16 12:46:59 -0800 | [diff] [blame] | 3582 | if test "$int128" = "yes" ; then |
| 3583 | echo "CONFIG_INT128=y" >> $config_host_mak |
| 3584 | fi |
| 3585 | |
Richard Henderson | 7ebee43 | 2016-06-29 21:10:59 -0700 | [diff] [blame] | 3586 | if test "$atomic128" = "yes" ; then |
| 3587 | echo "CONFIG_ATOMIC128=y" >> $config_host_mak |
| 3588 | fi |
| 3589 | |
Richard Henderson | e6cd4bb | 2018-08-15 16:31:47 -0700 | [diff] [blame] | 3590 | if test "$cmpxchg128" = "yes" ; then |
| 3591 | echo "CONFIG_CMPXCHG128=y" >> $config_host_mak |
| 3592 | fi |
| 3593 | |
Dr. David Alan Gilbert | ed1701c | 2017-05-15 15:05:29 +0100 | [diff] [blame] | 3594 | if test "$live_block_migration" = "yes" ; then |
| 3595 | echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak |
| 3596 | fi |
| 3597 | |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 3598 | if test "$tpm" = "yes"; then |
Paolo Bonzini | 3cae16d | 2019-07-11 19:08:36 +0200 | [diff] [blame] | 3599 | echo 'CONFIG_TPM=y' >> $config_host_mak |
Paolo Bonzini | 3b8acc1 | 2013-03-18 16:37:50 +0100 | [diff] [blame] | 3600 | fi |
| 3601 | |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3602 | if test "$rdma" = "yes" ; then |
| 3603 | echo "CONFIG_RDMA=y" >> $config_host_mak |
Fam Zheng | 392fb64 | 2017-09-07 16:42:30 +0800 | [diff] [blame] | 3604 | echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak |
Michael R. Hines | 2da776d | 2013-07-22 10:01:54 -0400 | [diff] [blame] | 3605 | fi |
| 3606 | |
Marcel Apfelbaum | 21ab34c | 2018-08-16 18:16:37 +0300 | [diff] [blame] | 3607 | if test "$pvrdma" = "yes" ; then |
| 3608 | echo "CONFIG_PVRDMA=y" >> $config_host_mak |
| 3609 | fi |
| 3610 | |
Changlong Xie | a6b1d4c | 2016-07-27 15:01:48 +0800 | [diff] [blame] | 3611 | if test "$replication" = "yes" ; then |
| 3612 | echo "CONFIG_REPLICATION=y" >> $config_host_mak |
| 3613 | fi |
| 3614 | |
Paolo Bonzini | ba59fb7 | 2018-06-13 14:23:08 +0200 | [diff] [blame] | 3615 | if test "$debug_mutex" = "yes" ; then |
| 3616 | echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak |
| 3617 | fi |
Kamil Rytarowski | e058034 | 2017-07-14 09:33:44 +0100 | [diff] [blame] | 3618 | |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 3619 | if test "$bochs" = "yes" ; then |
| 3620 | echo "CONFIG_BOCHS=y" >> $config_host_mak |
| 3621 | fi |
| 3622 | if test "$cloop" = "yes" ; then |
| 3623 | echo "CONFIG_CLOOP=y" >> $config_host_mak |
| 3624 | fi |
| 3625 | if test "$dmg" = "yes" ; then |
| 3626 | echo "CONFIG_DMG=y" >> $config_host_mak |
| 3627 | fi |
| 3628 | if test "$qcow1" = "yes" ; then |
| 3629 | echo "CONFIG_QCOW1=y" >> $config_host_mak |
| 3630 | fi |
| 3631 | if test "$vdi" = "yes" ; then |
| 3632 | echo "CONFIG_VDI=y" >> $config_host_mak |
| 3633 | fi |
| 3634 | if test "$vvfat" = "yes" ; then |
| 3635 | echo "CONFIG_VVFAT=y" >> $config_host_mak |
| 3636 | fi |
| 3637 | if test "$qed" = "yes" ; then |
| 3638 | echo "CONFIG_QED=y" >> $config_host_mak |
| 3639 | fi |
| 3640 | if test "$parallels" = "yes" ; then |
| 3641 | echo "CONFIG_PARALLELS=y" >> $config_host_mak |
| 3642 | fi |
Jeff Cody | 2f74013 | 2018-11-07 07:36:44 +0100 | [diff] [blame] | 3643 | |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 3644 | if test "$plugins" = "yes" ; then |
| 3645 | echo "CONFIG_PLUGIN=y" >> $config_host_mak |
Emilio G. Cota | 26fffe2 | 2018-10-21 13:56:29 -0400 | [diff] [blame] | 3646 | # Copy the export object list to the build dir |
| 3647 | if test "$ld_dynamic_list" = "yes" ; then |
| 3648 | echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak |
| 3649 | ld_symbols=qemu-plugins-ld.symbols |
| 3650 | cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols |
| 3651 | elif test "$ld_exported_symbols_list" = "yes" ; then |
| 3652 | echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak |
| 3653 | ld64_symbols=qemu-plugins-ld64.symbols |
| 3654 | echo "# Automatically generated by configure - do not modify" > $ld64_symbols |
| 3655 | grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' | \ |
| 3656 | sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols |
| 3657 | else |
| 3658 | error_exit \ |
| 3659 | "If \$plugins=yes, either \$ld_dynamic_list or " \ |
| 3660 | "\$ld_exported_symbols_list should have been set to 'yes'." |
| 3661 | fi |
Alex Bennée | 40e8c6f | 2019-06-13 14:52:25 +0100 | [diff] [blame] | 3662 | fi |
| 3663 | |
Alex Bennée | b1863cc | 2021-01-08 22:42:39 +0000 | [diff] [blame] | 3664 | if test -n "$gdb_bin"; then |
| 3665 | gdb_version=$($gdb_bin --version | head -n 1) |
Alex Bennée | d6a66c8 | 2021-02-02 13:39:53 +0000 | [diff] [blame] | 3666 | if version_ge ${gdb_version##* } 9.1; then |
Alex Bennée | b1863cc | 2021-01-08 22:42:39 +0000 | [diff] [blame] | 3667 | echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak |
| 3668 | fi |
Alex Bennée | f48e590 | 2020-03-16 17:21:48 +0000 | [diff] [blame] | 3669 | fi |
| 3670 | |
Alexey Krasikov | 54e7aac | 2020-05-25 14:19:12 +0300 | [diff] [blame] | 3671 | if test "$secret_keyring" = "yes" ; then |
| 3672 | echo "CONFIG_SECRET_KEYRING=y" >> $config_host_mak |
| 3673 | fi |
| 3674 | |
Juan Quintela | 98ec69a | 2009-07-16 18:34:18 +0200 | [diff] [blame] | 3675 | echo "ROMS=$roms" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3676 | echo "MAKE=$make" >> $config_host_mak |
Blue Swirl | c886edf | 2011-07-22 21:08:09 +0000 | [diff] [blame] | 3677 | echo "PYTHON=$python" >> $config_host_mak |
Alex Bennée | 39d87c8 | 2020-03-03 15:06:20 +0000 | [diff] [blame] | 3678 | echo "GENISOIMAGE=$genisoimage" >> $config_host_mak |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 3679 | echo "MESON=$meson" >> $config_host_mak |
Paolo Bonzini | 09e9332 | 2020-08-13 09:28:11 -0400 | [diff] [blame] | 3680 | echo "NINJA=$ninja" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3681 | echo "CC=$cc" >> $config_host_mak |
Bastian Koppelmann | 433de74 | 2021-05-12 11:20:35 +0100 | [diff] [blame] | 3682 | echo "HOST_CC=$host_cc" >> $config_host_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 3683 | if $iasl -h > /dev/null 2>&1; then |
Paolo Bonzini | 859aef0 | 2020-08-04 18:14:26 +0200 | [diff] [blame] | 3684 | echo "CONFIG_IASL=$iasl" >> $config_host_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 3685 | fi |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3686 | echo "AR=$ar" >> $config_host_mak |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 3687 | echo "AS=$as" >> $config_host_mak |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 3688 | echo "CCAS=$ccas" >> $config_host_mak |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 3689 | echo "CPP=$cpp" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3690 | echo "OBJCOPY=$objcopy" >> $config_host_mak |
| 3691 | echo "LD=$ld" >> $config_host_mak |
Brad | 46eef33 | 2013-12-10 19:49:08 -0500 | [diff] [blame] | 3692 | echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak |
Juan Quintela | a558ee1 | 2009-08-03 14:46:21 +0200 | [diff] [blame] | 3693 | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
Bruno Dominguez | 11cde1c | 2017-06-06 14:07:47 +0100 | [diff] [blame] | 3694 | echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 3695 | echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak |
| 3696 | echo "GLIB_LIBS=$glib_libs" >> $config_host_mak |
Marc-André Lureau | d83acfd | 2021-10-09 17:37:40 +0400 | [diff] [blame] | 3697 | echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak |
Philippe Mathieu-Daudé | 8a99e9a | 2018-04-15 20:05:19 -0300 | [diff] [blame] | 3698 | echo "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak |
Peter Maydell | e57218b | 2016-08-08 17:11:28 +0100 | [diff] [blame] | 3699 | echo "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3700 | echo "EXESUF=$EXESUF" >> $config_host_mak |
Paolo Bonzini | f15bff2 | 2019-07-18 13:19:02 +0200 | [diff] [blame] | 3701 | echo "LIBS_QGA=$libs_qga" >> $config_host_mak |
Juan Quintela | 804edf2 | 2009-07-27 16:12:49 +0200 | [diff] [blame] | 3702 | |
Marek Marczykowski-Górecki | b767d25 | 2020-05-20 15:20:23 +0200 | [diff] [blame] | 3703 | if test "$rng_none" = "yes"; then |
| 3704 | echo "CONFIG_RNG_NONE=y" >> $config_host_mak |
| 3705 | fi |
| 3706 | |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3707 | # use included Linux headers |
| 3708 | if test "$linux" = "yes" ; then |
Andreas Färber | a307beb | 2012-06-14 15:14:33 +0000 | [diff] [blame] | 3709 | mkdir -p linux-headers |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3710 | case "$cpu" in |
Paolo Bonzini | 4da270b | 2021-11-09 09:36:10 +0100 | [diff] [blame] | 3711 | i386|x86_64) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 3712 | linux_arch=x86 |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3713 | ;; |
Paolo Bonzini | d8ff892 | 2021-11-09 09:18:20 +0100 | [diff] [blame] | 3714 | ppc|ppc64) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 3715 | linux_arch=powerpc |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3716 | ;; |
| 3717 | s390x) |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 3718 | linux_arch=s390 |
| 3719 | ;; |
Claudio Fontana | 1f08031 | 2013-06-12 16:20:23 +0100 | [diff] [blame] | 3720 | aarch64) |
| 3721 | linux_arch=arm64 |
| 3722 | ;; |
Sanjay Lal | 222e7d1 | 2014-06-17 23:10:36 +0100 | [diff] [blame] | 3723 | mips64) |
| 3724 | linux_arch=mips |
| 3725 | ;; |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 3726 | *) |
| 3727 | # For most CPUs the kernel architecture name and QEMU CPU name match. |
| 3728 | linux_arch="$cpu" |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3729 | ;; |
| 3730 | esac |
Peter Maydell | 08312a6 | 2012-08-03 13:51:25 +0100 | [diff] [blame] | 3731 | # For non-KVM architectures we will not have asm headers |
| 3732 | if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then |
| 3733 | symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm |
| 3734 | fi |
Peter Maydell | 6efd751 | 2011-11-30 11:59:04 +0000 | [diff] [blame] | 3735 | fi |
| 3736 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 3737 | for target in $target_list; do |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 3738 | target_dir="$target" |
Philippe Mathieu-Daudé | 57a93f1 | 2021-11-09 15:45:04 +0100 | [diff] [blame] | 3739 | target_name=$(echo $target | cut -d '-' -f 1)$EXESUF |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 3740 | mkdir -p $target_dir |
| 3741 | case $target in |
| 3742 | *-user) symlink "../qemu-$target_name" "$target_dir/qemu-$target_name" ;; |
| 3743 | *) symlink "../qemu-system-$target_name" "$target_dir/qemu-system-$target_name" ;; |
| 3744 | esac |
| 3745 | done |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 3746 | |
Paolo Bonzini | 765686d | 2020-09-18 06:37:21 -0400 | [diff] [blame] | 3747 | echo "CONFIG_QEMU_INTERP_PREFIX=$interp_prefix" | sed 's/%M/@0@/' >> $config_host_mak |
Paolo Bonzini | fdb75ae | 2020-09-21 04:37:49 -0400 | [diff] [blame] | 3748 | if test "$default_targets" = "yes"; then |
| 3749 | echo "CONFIG_DEFAULT_TARGETS=y" >> $config_host_mak |
| 3750 | fi |
Peter Crosthwaite | a540f15 | 2013-04-18 14:47:31 +1000 | [diff] [blame] | 3751 | |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 3752 | if test "$numa" = "yes"; then |
| 3753 | echo "CONFIG_NUMA=y" >> $config_host_mak |
Marc-André Lureau | ab31805 | 2019-07-24 19:23:16 +0400 | [diff] [blame] | 3754 | echo "NUMA_LIBS=$numa_libs" >> $config_host_mak |
Wanlong Gao | a99d57b | 2014-05-14 17:43:28 +0800 | [diff] [blame] | 3755 | fi |
| 3756 | |
John Snow | fd0e605 | 2015-03-25 18:57:39 -0400 | [diff] [blame] | 3757 | if test "$ccache_cpp2" = "yes"; then |
| 3758 | echo "export CCACHE_CPP2=y" >> $config_host_mak |
| 3759 | fi |
| 3760 | |
Daniele Buono | 1e4f606 | 2020-05-29 16:51:21 -0400 | [diff] [blame] | 3761 | if test "$safe_stack" = "yes"; then |
| 3762 | echo "CONFIG_SAFESTACK=y" >> $config_host_mak |
| 3763 | fi |
| 3764 | |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3765 | # If we're using a separate build tree, set it up now. |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3766 | # LINKS are things to symlink back into the source tree |
| 3767 | # (these can be both files and directories). |
| 3768 | # Caution: do not add files or directories here using wildcards. This |
| 3769 | # will result in problems later if a new file matching the wildcard is |
| 3770 | # added to the source tree -- nothing will cause configure to be rerun |
| 3771 | # so the build tree will be missing the link back to the new file, and |
| 3772 | # tests might fail. Prefer to keep the relevant files in their own |
| 3773 | # directory and symlink the directory instead. |
Gerd Hoffmann | 09db9b9 | 2020-08-27 12:26:17 +0200 | [diff] [blame] | 3774 | # UNLINK is used to remove symlinks from older development versions |
| 3775 | # that might get into the way when doing "git update" without doing |
| 3776 | # a "make distclean" in between. |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 3777 | LINKS="Makefile" |
Paolo Bonzini | 3941996 | 2020-08-06 14:08:31 +0200 | [diff] [blame] | 3778 | LINKS="$LINKS tests/tcg/Makefile.target" |
Gerd Hoffmann | ddcf607 | 2020-08-24 09:40:57 +0200 | [diff] [blame] | 3779 | LINKS="$LINKS pc-bios/optionrom/Makefile" |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3780 | LINKS="$LINKS pc-bios/s390-ccw/Makefile" |
Gerd Hoffmann | 8db2a4f | 2020-06-22 15:12:40 +0200 | [diff] [blame] | 3781 | LINKS="$LINKS roms/seabios/Makefile" |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3782 | LINKS="$LINKS pc-bios/qemu-icon.bmp" |
| 3783 | LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit |
Willian Rampazzo | bbbd9b6 | 2021-11-05 12:53:54 -0300 | [diff] [blame] | 3784 | LINKS="$LINKS tests/avocado tests/data" |
Peter Maydell | 3995035 | 2018-11-02 11:52:39 +0000 | [diff] [blame] | 3785 | LINKS="$LINKS tests/qemu-iotests/check" |
Cleber Rosa | 8f8fd9e | 2019-02-06 11:29:01 -0500 | [diff] [blame] | 3786 | LINKS="$LINKS python" |
Alex Bennée | c17a386 | 2020-09-09 12:27:41 +0100 | [diff] [blame] | 3787 | LINKS="$LINKS contrib/plugins/Makefile " |
Gerd Hoffmann | 09db9b9 | 2020-08-27 12:26:17 +0200 | [diff] [blame] | 3788 | UNLINK="pc-bios/keymaps" |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 3789 | for bios_file in \ |
| 3790 | $source_path/pc-bios/*.bin \ |
Bin Meng | 3a631b8 | 2020-06-22 13:09:32 +0800 | [diff] [blame] | 3791 | $source_path/pc-bios/*.elf \ |
Alexey Kardashevskiy | 225a9ab | 2016-10-26 13:18:03 +1100 | [diff] [blame] | 3792 | $source_path/pc-bios/*.lid \ |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 3793 | $source_path/pc-bios/*.rom \ |
| 3794 | $source_path/pc-bios/*.dtb \ |
Dominik Dingel | e89e33e | 2013-04-29 04:52:06 +0000 | [diff] [blame] | 3795 | $source_path/pc-bios/*.img \ |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 3796 | $source_path/pc-bios/openbios-* \ |
Alexander Graf | 4e73c78 | 2014-01-20 00:25:40 +0100 | [diff] [blame] | 3797 | $source_path/pc-bios/u-boot.* \ |
John Arbuckle | cd946e5 | 2021-08-31 12:50:20 -0400 | [diff] [blame] | 3798 | $source_path/pc-bios/palcode-* \ |
| 3799 | $source_path/pc-bios/qemu_vga.ndrv |
| 3800 | |
Richard Henderson | 753d11f | 2011-06-24 11:58:37 -0700 | [diff] [blame] | 3801 | do |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3802 | LINKS="$LINKS pc-bios/$(basename $bios_file)" |
Paolo Bonzini | d1807a4 | 2010-12-23 11:43:59 +0100 | [diff] [blame] | 3803 | done |
Peter Maydell | e29e5c6 | 2018-11-02 11:52:38 +0000 | [diff] [blame] | 3804 | for f in $LINKS ; do |
Paolo Bonzini | 0f4d889 | 2020-09-01 03:23:47 -0400 | [diff] [blame] | 3805 | if [ -e "$source_path/$f" ]; then |
Paolo Bonzini | 5dce7b8 | 2021-10-13 13:56:24 +0200 | [diff] [blame] | 3806 | mkdir -p `dirname ./$f` |
Peter Maydell | f9245e1 | 2011-06-03 17:10:40 +0100 | [diff] [blame] | 3807 | symlink "$source_path/$f" "$f" |
| 3808 | fi |
Paolo Bonzini | d1807a4 | 2010-12-23 11:43:59 +0100 | [diff] [blame] | 3809 | done |
Gerd Hoffmann | 09db9b9 | 2020-08-27 12:26:17 +0200 | [diff] [blame] | 3810 | for f in $UNLINK ; do |
| 3811 | if [ -L "$f" ]; then |
| 3812 | rm -f "$f" |
| 3813 | fi |
| 3814 | done |
Paul Brook | 1ad2134 | 2009-05-19 16:17:58 +0100 | [diff] [blame] | 3815 | |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 3816 | (for i in $cross_cc_vars; do |
| 3817 | export $i |
| 3818 | done |
Alex Bennée | de6d7e6 | 2021-04-01 11:25:22 +0100 | [diff] [blame] | 3819 | export target_list source_path use_containers ARCH |
Paolo Bonzini | 2038f8c | 2019-08-07 16:35:23 +0200 | [diff] [blame] | 3820 | $source_path/tests/tcg/configure.sh) |
| 3821 | |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3822 | # temporary config to build submodules |
Gerd Hoffmann | 8db2a4f | 2020-06-22 15:12:40 +0200 | [diff] [blame] | 3823 | for rom in seabios; do |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3824 | config_mak=roms/$rom/config.mak |
Stefan Weil | 37116c8 | 2010-03-01 22:20:29 +0100 | [diff] [blame] | 3825 | echo "# Automatically generated by configure - do not modify" > $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3826 | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
Richard Henderson | cdbd727 | 2016-07-07 21:49:36 -0700 | [diff] [blame] | 3827 | echo "AS=$as" >> $config_mak |
Richard Henderson | 5f6f0e2 | 2016-06-23 10:39:18 -0700 | [diff] [blame] | 3828 | echo "CCAS=$ccas" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3829 | echo "CC=$cc" >> $config_mak |
| 3830 | echo "BCC=bcc" >> $config_mak |
Blue Swirl | 3dd46c7 | 2013-01-05 10:10:27 +0000 | [diff] [blame] | 3831 | echo "CPP=$cpp" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3832 | echo "OBJCOPY=objcopy" >> $config_mak |
Michael S. Tsirkin | a31a864 | 2013-07-24 18:56:03 +0300 | [diff] [blame] | 3833 | echo "IASL=$iasl" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3834 | echo "LD=$ld" >> $config_mak |
Alistair Francis | 9f81aeb | 2017-11-07 17:10:46 -0800 | [diff] [blame] | 3835 | echo "RANLIB=$ranlib" >> $config_mak |
Anthony Liguori | c34ebfd | 2009-09-04 10:13:29 -0500 | [diff] [blame] | 3836 | done |
| 3837 | |
Helge Konetzka | 9840999 | 2021-09-15 12:56:34 +0200 | [diff] [blame] | 3838 | config_mak=pc-bios/optionrom/config.mak |
| 3839 | echo "# Automatically generated by configure - do not modify" > $config_mak |
| 3840 | echo "TOPSRC_DIR=$source_path" >> $config_mak |
| 3841 | |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 3842 | if test "$skip_meson" = no; then |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3843 | cross="config-meson.cross.new" |
| 3844 | meson_quote() { |
Paolo Bonzini | ac7ebcc | 2021-11-05 10:07:37 +0100 | [diff] [blame] | 3845 | test $# = 0 && return |
Paolo Bonzini | 47b3083 | 2020-09-23 05:26:17 -0400 | [diff] [blame] | 3846 | echo "'$(echo $* | sed "s/ /','/g")'" |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3847 | } |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3848 | |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3849 | echo "# Automatically generated by configure - do not modify" > $cross |
| 3850 | echo "[properties]" >> $cross |
Alex Bennée | d1d5e9e | 2021-07-07 14:17:44 +0100 | [diff] [blame] | 3851 | |
| 3852 | # unroll any custom device configs |
Alex Bennée | 11bdcfc | 2021-07-21 00:26:38 +0100 | [diff] [blame] | 3853 | for a in $device_archs; do |
| 3854 | eval "c=\$devices_${a}" |
| 3855 | echo "${a}-softmmu = '$c'" >> $cross |
| 3856 | done |
Alex Bennée | d1d5e9e | 2021-07-07 14:17:44 +0100 | [diff] [blame] | 3857 | |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3858 | test -z "$cxx" && echo "link_language = 'c'" >> $cross |
| 3859 | echo "[built-in options]" >> $cross |
Paolo Bonzini | a286666 | 2021-11-05 10:09:26 +0100 | [diff] [blame] | 3860 | echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross |
| 3861 | echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross |
| 3862 | echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross |
| 3863 | echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3864 | echo "[binaries]" >> $cross |
Paolo Bonzini | 4dba278 | 2021-09-29 17:14:43 +0200 | [diff] [blame] | 3865 | echo "c = [$(meson_quote $cc $CPU_CFLAGS)]" >> $cross |
| 3866 | test -n "$cxx" && echo "cpp = [$(meson_quote $cxx $CPU_CFLAGS)]" >> $cross |
| 3867 | test -n "$objcc" && echo "objc = [$(meson_quote $objcc $CPU_CFLAGS)]" >> $cross |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3868 | echo "ar = [$(meson_quote $ar)]" >> $cross |
| 3869 | echo "nm = [$(meson_quote $nm)]" >> $cross |
| 3870 | echo "pkgconfig = [$(meson_quote $pkg_config_exe)]" >> $cross |
| 3871 | echo "ranlib = [$(meson_quote $ranlib)]" >> $cross |
| 3872 | if has $sdl2_config; then |
| 3873 | echo "sdl2-config = [$(meson_quote $sdl2_config)]" >> $cross |
| 3874 | fi |
| 3875 | echo "strip = [$(meson_quote $strip)]" >> $cross |
| 3876 | echo "windres = [$(meson_quote $windres)]" >> $cross |
| 3877 | if test "$cross_compile" = "yes"; then |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3878 | cross_arg="--cross-file config-meson.cross" |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3879 | echo "[host_machine]" >> $cross |
Paolo Bonzini | ba7c60c | 2021-11-08 14:47:54 +0100 | [diff] [blame] | 3880 | echo "system = '$targetos'" >> $cross |
Paolo Bonzini | 823eb01 | 2021-11-08 14:18:17 +0100 | [diff] [blame] | 3881 | case "$cpu" in |
Joelle van Dyne | f6bca9d | 2021-01-25 17:24:54 -0800 | [diff] [blame] | 3882 | i386) |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3883 | echo "cpu_family = 'x86'" >> $cross |
| 3884 | ;; |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3885 | *) |
Paolo Bonzini | 823eb01 | 2021-11-08 14:18:17 +0100 | [diff] [blame] | 3886 | echo "cpu_family = '$cpu'" >> $cross |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3887 | ;; |
| 3888 | esac |
| 3889 | echo "cpu = '$cpu'" >> $cross |
| 3890 | if test "$bigendian" = "yes" ; then |
| 3891 | echo "endian = 'big'" >> $cross |
| 3892 | else |
| 3893 | echo "endian = 'little'" >> $cross |
| 3894 | fi |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3895 | else |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3896 | cross_arg="--native-file config-meson.cross" |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3897 | fi |
| 3898 | mv $cross config-meson.cross |
Marc-André Lureau | fc92989 | 2019-07-13 01:47:54 +0400 | [diff] [blame] | 3899 | |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3900 | rm -rf meson-private meson-info meson-logs |
Paolo Bonzini | 61d6309 | 2021-10-07 15:08:28 +0200 | [diff] [blame] | 3901 | run_meson() { |
| 3902 | NINJA=$ninja $meson setup \ |
Paolo Bonzini | d17f305 | 2020-08-18 12:17:01 +0200 | [diff] [blame] | 3903 | --prefix "$prefix" \ |
| 3904 | --libdir "$libdir" \ |
| 3905 | --libexecdir "$libexecdir" \ |
| 3906 | --bindir "$bindir" \ |
| 3907 | --includedir "$includedir" \ |
| 3908 | --datadir "$datadir" \ |
| 3909 | --mandir "$mandir" \ |
| 3910 | --sysconfdir "$sysconfdir" \ |
Paolo Bonzini | 16bf7a3 | 2020-10-16 03:19:14 -0400 | [diff] [blame] | 3911 | --localedir "$localedir" \ |
Paolo Bonzini | d17f305 | 2020-08-18 12:17:01 +0200 | [diff] [blame] | 3912 | --localstatedir "$local_statedir" \ |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 3913 | -Daudio_drv_list=$audio_drv_list \ |
| 3914 | -Ddefault_devices=$default_devices \ |
Paolo Bonzini | d17f305 | 2020-08-18 12:17:01 +0200 | [diff] [blame] | 3915 | -Ddocdir="$docdir" \ |
Paolo Bonzini | 16bf7a3 | 2020-10-16 03:19:14 -0400 | [diff] [blame] | 3916 | -Dqemu_firmwarepath="$firmwarepath" \ |
Marc-André Lureau | 73f3aa3 | 2020-08-26 15:04:15 +0400 | [diff] [blame] | 3917 | -Dqemu_suffix="$qemu_suffix" \ |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 3918 | -Dsphinx_build="$sphinx_build" \ |
| 3919 | -Dtrace_file="$trace_file" \ |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 3920 | -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \ |
| 3921 | -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \ |
| 3922 | -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ |
| 3923 | -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] | 3924 | -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] | 3925 | -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ |
Paolo Bonzini | 3b4da13 | 2021-10-07 15:08:29 +0200 | [diff] [blame] | 3926 | -Db_lto=$lto -Dcfi=$cfi -Dtcg=$tcg -Dxen=$xen \ |
| 3927 | -Dcapstone=$capstone -Dfdt=$fdt -Dslirp=$slirp \ |
Paolo Bonzini | 537b724 | 2021-10-07 15:08:12 +0200 | [diff] [blame] | 3928 | $(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=$LIB_FUZZING_ENGINE") \ |
Thomas Huth | 332008e | 2021-07-13 11:31:52 +0200 | [diff] [blame] | 3929 | $(if test "$default_feature" = no; then echo "-Dauto_features=disabled"; fi) \ |
Paolo Bonzini | 61d6309 | 2021-10-07 15:08:28 +0200 | [diff] [blame] | 3930 | "$@" $cross_arg "$PWD" "$source_path" |
| 3931 | } |
| 3932 | eval run_meson $meson_options |
Paolo Bonzini | d77e90f | 2021-03-16 08:19:34 +0100 | [diff] [blame] | 3933 | if test "$?" -ne 0 ; then |
| 3934 | error_exit "meson setup failed" |
| 3935 | fi |
Paolo Bonzini | 699d388 | 2021-03-16 08:27:40 +0100 | [diff] [blame] | 3936 | else |
| 3937 | if test -f meson-private/cmd_line.txt; then |
| 3938 | # Adjust old command line options whose type was changed |
| 3939 | # Avoids having to use "setup --wipe" when Meson is upgraded |
| 3940 | perl -i -ne ' |
| 3941 | s/^gettext = true$/gettext = auto/; |
| 3942 | s/^gettext = false$/gettext = disabled/; |
Paolo Bonzini | 654d6b0 | 2021-02-09 14:59:26 +0100 | [diff] [blame] | 3943 | /^b_staticpic/ && next; |
Paolo Bonzini | 699d388 | 2021-03-16 08:27:40 +0100 | [diff] [blame] | 3944 | print;' meson-private/cmd_line.txt |
| 3945 | fi |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 3946 | fi |
| 3947 | |
Alex Bennée | 2d838d9 | 2020-09-09 12:27:37 +0100 | [diff] [blame] | 3948 | if test -n "${deprecated_features}"; then |
| 3949 | echo "Warning, deprecated features enabled." |
Mao Zhongyi | a476b21 | 2021-07-23 14:58:28 +0800 | [diff] [blame] | 3950 | echo "Please see docs/about/deprecated.rst" |
Alex Bennée | 2d838d9 | 2020-09-09 12:27:37 +0100 | [diff] [blame] | 3951 | echo " features: ${deprecated_features}" |
| 3952 | fi |
| 3953 | |
Thomas Huth | e0447a8 | 2021-04-14 13:20:04 +0200 | [diff] [blame] | 3954 | # Create list of config switches that should be poisoned in common code... |
| 3955 | # but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special. |
Thomas Huth | 54b0306 | 2021-05-19 13:38:40 +0200 | [diff] [blame] | 3956 | target_configs_h=$(ls *-config-devices.h *-config-target.h 2>/dev/null) |
| 3957 | if test -n "$target_configs_h" ; then |
| 3958 | sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \ |
| 3959 | -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \ |
| 3960 | $target_configs_h | sort -u > config-poison.h |
| 3961 | else |
| 3962 | :> config-poison.h |
| 3963 | fi |
Thomas Huth | e0447a8 | 2021-04-14 13:20:04 +0200 | [diff] [blame] | 3964 | |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 3965 | # Save the configure command line for later reuse. |
| 3966 | cat <<EOD >config.status |
| 3967 | #!/bin/sh |
| 3968 | # Generated by configure. |
| 3969 | # Run this file to recreate the current configuration. |
| 3970 | # Compiler output produced by configure, useful for debugging |
| 3971 | # configure, is in config.log if it exists. |
| 3972 | EOD |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 3973 | |
| 3974 | preserve_env() { |
| 3975 | envname=$1 |
| 3976 | |
| 3977 | eval envval=\$$envname |
| 3978 | |
| 3979 | if test -n "$envval" |
| 3980 | then |
| 3981 | echo "$envname='$envval'" >> config.status |
| 3982 | echo "export $envname" >> config.status |
| 3983 | else |
| 3984 | echo "unset $envname" >> config.status |
| 3985 | fi |
| 3986 | } |
| 3987 | |
| 3988 | # Preserve various env variables that influence what |
| 3989 | # features/build target configure will detect |
| 3990 | preserve_env AR |
| 3991 | preserve_env AS |
| 3992 | preserve_env CC |
| 3993 | preserve_env CPP |
Paolo Bonzini | 8009da0 | 2021-11-05 10:08:43 +0100 | [diff] [blame] | 3994 | preserve_env CFLAGS |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 3995 | preserve_env CXX |
Paolo Bonzini | 8009da0 | 2021-11-05 10:08:43 +0100 | [diff] [blame] | 3996 | preserve_env CXXFLAGS |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 3997 | preserve_env INSTALL |
| 3998 | preserve_env LD |
Paolo Bonzini | 8009da0 | 2021-11-05 10:08:43 +0100 | [diff] [blame] | 3999 | preserve_env LDFLAGS |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 4000 | preserve_env LD_LIBRARY_PATH |
| 4001 | preserve_env LIBTOOL |
| 4002 | preserve_env MAKE |
| 4003 | preserve_env NM |
| 4004 | preserve_env OBJCOPY |
| 4005 | preserve_env PATH |
| 4006 | preserve_env PKG_CONFIG |
| 4007 | preserve_env PKG_CONFIG_LIBDIR |
| 4008 | preserve_env PKG_CONFIG_PATH |
| 4009 | preserve_env PYTHON |
Daniel P. Berrangé | e811da7 | 2018-09-04 13:36:03 +0100 | [diff] [blame] | 4010 | preserve_env SDL2_CONFIG |
| 4011 | preserve_env SMBD |
| 4012 | preserve_env STRIP |
| 4013 | preserve_env WINDRES |
| 4014 | |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 4015 | printf "exec" >>config.status |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 4016 | for i in "$0" "$@"; do |
Paolo Bonzini | 835af89 | 2020-09-08 13:20:45 +0200 | [diff] [blame] | 4017 | test "$i" = --skip-meson || printf " %s" "$(quote_sh "$i")" >>config.status |
Paolo Bonzini | a566505 | 2019-06-10 12:05:14 +0200 | [diff] [blame] | 4018 | done |
Dr. David Alan Gilbert | cf7cc92 | 2016-01-12 11:58:48 +0000 | [diff] [blame] | 4019 | echo ' "$@"' >>config.status |
Michael S. Tsirkin | dc65540 | 2014-03-09 17:37:49 +0200 | [diff] [blame] | 4020 | chmod +x config.status |
| 4021 | |
Peter Maydell | 8cd05ab | 2014-05-23 17:07:24 +0100 | [diff] [blame] | 4022 | rm -r "$TMPDIR1" |