17d13299dSbellard#!/bin/sh 27d13299dSbellard# 33ef693a0Sbellard# qemu configure script (c) 2003 Fabrice Bellard 47d13299dSbellard# 58cd05ab6SPeter Maydell 699519e67SCornelia Huck# Unset some variables known to interfere with behavior of common tools, 799519e67SCornelia Huck# just as autoconf does. 899519e67SCornelia HuckCLICOLOR_FORCE= GREP_OPTIONS= 999519e67SCornelia Huckunset CLICOLOR_FORCE GREP_OPTIONS 1099519e67SCornelia Huck 115e4dfd3dSJohn Snow# Don't allow CCACHE, if present, to use cached results of compile tests! 125e4dfd3dSJohn Snowexport CCACHE_RECACHE=yes 135e4dfd3dSJohn Snow 148cd05ab6SPeter Maydell# Temporary directory used for files created while 158cd05ab6SPeter Maydell# configure runs. Since it is in the build directory 168cd05ab6SPeter Maydell# we can safely blow away any previous version of it 178cd05ab6SPeter Maydell# (and we need not jump through hoops to try to delete 188cd05ab6SPeter Maydell# it when configure exits.) 198cd05ab6SPeter MaydellTMPDIR1="config-temp" 208cd05ab6SPeter Maydellrm -rf "${TMPDIR1}" 218cd05ab6SPeter Maydellmkdir -p "${TMPDIR1}" 228cd05ab6SPeter Maydellif [ $? -ne 0 ]; then 238cd05ab6SPeter Maydell echo "ERROR: failed to create temporary directory" 248cd05ab6SPeter Maydell exit 1 257d13299dSbellardfi 267d13299dSbellard 278cd05ab6SPeter MaydellTMPB="qemu-conf" 288cd05ab6SPeter MaydellTMPC="${TMPDIR1}/${TMPB}.c" 2966518bf6SDon SlutzTMPO="${TMPDIR1}/${TMPB}.o" 309c83ffd8SPeter MaydellTMPCXX="${TMPDIR1}/${TMPB}.cxx" 318cd05ab6SPeter MaydellTMPE="${TMPDIR1}/${TMPB}.exe" 326969ec6cSJames ClarkeTMPMO="${TMPDIR1}/${TMPB}.mo" 3326fffe29SEmilio G. CotaTMPTXT="${TMPDIR1}/${TMPB}.txt" 347d13299dSbellard 35da1d85e3SGerd Hoffmannrm -f config.log 369ac81bbbSmalc 37b48e3611SPeter Maydell# Print a helpful header at the top of config.log 38b48e3611SPeter Maydellecho "# QEMU configure log $(date)" >> config.log 39979ae168SPeter Maydellprintf "# Configured with:" >> config.log 40979ae168SPeter Maydellprintf " '%s'" "$0" "$@" >> config.log 41979ae168SPeter Maydellecho >> config.log 42b48e3611SPeter Maydellecho "#" >> config.log 43b48e3611SPeter Maydell 44d880a3baSPaolo Bonziniprint_error() { 45d880a3baSPaolo Bonzini (echo 4676ad07a4SPeter Maydell echo "ERROR: $1" 4776ad07a4SPeter Maydell while test -n "$2"; do 4876ad07a4SPeter Maydell echo " $2" 4976ad07a4SPeter Maydell shift 5076ad07a4SPeter Maydell done 51d880a3baSPaolo Bonzini echo) >&2 52d880a3baSPaolo Bonzini} 53d880a3baSPaolo Bonzini 54d880a3baSPaolo Bonzinierror_exit() { 55d880a3baSPaolo Bonzini print_error "$@" 5676ad07a4SPeter Maydell exit 1 5776ad07a4SPeter Maydell} 5876ad07a4SPeter Maydell 599c83ffd8SPeter Maydelldo_compiler() { 609c83ffd8SPeter Maydell # Run the compiler, capturing its output to the log. First argument 619c83ffd8SPeter Maydell # is compiler binary to execute. 629c83ffd8SPeter Maydell local compiler="$1" 639c83ffd8SPeter Maydell shift 648bbe05d7SIan Jackson if test -n "$BASH_VERSION"; then eval ' 658bbe05d7SIan Jackson echo >>config.log " 668bbe05d7SIan Jacksonfuncs: ${FUNCNAME[*]} 678bbe05d7SIan Jacksonlines: ${BASH_LINENO[*]}" 688bbe05d7SIan Jackson '; fi 699c83ffd8SPeter Maydell echo $compiler "$@" >> config.log 709c83ffd8SPeter Maydell $compiler "$@" >> config.log 2>&1 || return $? 718dc38a78SPeter Maydell # Test passed. If this is an --enable-werror build, rerun 728dc38a78SPeter Maydell # the test with -Werror and bail out if it fails. This 738dc38a78SPeter Maydell # makes warning-generating-errors in configure test code 748dc38a78SPeter Maydell # obvious to developers. 758dc38a78SPeter Maydell if test "$werror" != "yes"; then 768dc38a78SPeter Maydell return 0 778dc38a78SPeter Maydell fi 788dc38a78SPeter Maydell # Don't bother rerunning the compile if we were already using -Werror 798dc38a78SPeter Maydell case "$*" in 808dc38a78SPeter Maydell *-Werror*) 818dc38a78SPeter Maydell return 0 828dc38a78SPeter Maydell ;; 838dc38a78SPeter Maydell esac 849c83ffd8SPeter Maydell echo $compiler -Werror "$@" >> config.log 859c83ffd8SPeter Maydell $compiler -Werror "$@" >> config.log 2>&1 && return $? 8676ad07a4SPeter Maydell error_exit "configure test passed without -Werror but failed with -Werror." \ 8776ad07a4SPeter Maydell "This is probably a bug in the configure script. The failing command" \ 8876ad07a4SPeter Maydell "will be at the bottom of config.log." \ 8976ad07a4SPeter Maydell "You can run configure with --disable-werror to bypass this check." 908dc38a78SPeter Maydell} 918dc38a78SPeter Maydell 929c83ffd8SPeter Maydelldo_cc() { 939c83ffd8SPeter Maydell do_compiler "$cc" "$@" 949c83ffd8SPeter Maydell} 959c83ffd8SPeter Maydell 969c83ffd8SPeter Maydelldo_cxx() { 979c83ffd8SPeter Maydell do_compiler "$cxx" "$@" 989c83ffd8SPeter Maydell} 999c83ffd8SPeter Maydell 1009c83ffd8SPeter Maydellupdate_cxxflags() { 1019c83ffd8SPeter Maydell # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those 1029c83ffd8SPeter Maydell # options which some versions of GCC's C++ compiler complain about 1039c83ffd8SPeter Maydell # because they only make sense for C programs. 10453422040SPaolo Bonzini QEMU_CXXFLAGS="$QEMU_CXXFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS" 10511cde1c8SBruno Dominguez 1069c83ffd8SPeter Maydell for arg in $QEMU_CFLAGS; do 1079c83ffd8SPeter Maydell case $arg in 1089c83ffd8SPeter Maydell -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ 1099c83ffd8SPeter Maydell -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) 1109c83ffd8SPeter Maydell ;; 1117be41675SThomas Huth -std=gnu99) 1127be41675SThomas Huth QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }"-std=gnu++98" 1137be41675SThomas Huth ;; 1149c83ffd8SPeter Maydell *) 1159c83ffd8SPeter Maydell QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg 1169c83ffd8SPeter Maydell ;; 1179c83ffd8SPeter Maydell esac 1189c83ffd8SPeter Maydell done 1199c83ffd8SPeter Maydell} 1209c83ffd8SPeter Maydell 12152166aa0SJuan Quintelacompile_object() { 122fd0e6053SJohn Snow local_cflags="$1" 123fd0e6053SJohn Snow do_cc $QEMU_CFLAGS $local_cflags -c -o $TMPO $TMPC 12452166aa0SJuan Quintela} 12552166aa0SJuan Quintela 12652166aa0SJuan Quintelacompile_prog() { 12752166aa0SJuan Quintela local_cflags="$1" 12852166aa0SJuan Quintela local_ldflags="$2" 129db5adeaaSPaolo Bonzini do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $QEMU_LDFLAGS $local_ldflags 13052166aa0SJuan Quintela} 13152166aa0SJuan Quintela 13211568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 13311568d6dSPaolo Bonzinisymlink() { 13472b8b5a1SStefan Weil rm -rf "$2" 135ec5b06d7SAnthony Liguori mkdir -p "$(dirname "$2")" 13672b8b5a1SStefan Weil ln -s "$1" "$2" 13711568d6dSPaolo Bonzini} 13811568d6dSPaolo Bonzini 1390dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 1400dba6195SLoïc Minier# executable or a builtin) 1410dba6195SLoïc Minierhas() { 1420dba6195SLoïc Minier type "$1" >/dev/null 2>&1 1430dba6195SLoïc Minier} 1440dba6195SLoïc Minier 1450dba6195SLoïc Minier# search for an executable in PATH 1460dba6195SLoïc Minierpath_of() { 1470dba6195SLoïc Minier local_command="$1" 1480dba6195SLoïc Minier local_ifs="$IFS" 1490dba6195SLoïc Minier local_dir="" 1500dba6195SLoïc Minier 1510dba6195SLoïc Minier # pathname has a dir component? 1520dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 1530dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 1540dba6195SLoïc Minier echo "$local_command" 1550dba6195SLoïc Minier return 0 1560dba6195SLoïc Minier fi 1570dba6195SLoïc Minier fi 1580dba6195SLoïc Minier if [ -z "$local_command" ]; then 1590dba6195SLoïc Minier return 1 1600dba6195SLoïc Minier fi 1610dba6195SLoïc Minier 1620dba6195SLoïc Minier IFS=: 1630dba6195SLoïc Minier for local_dir in $PATH; do 1640dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 1650dba6195SLoïc Minier echo "$local_dir/$local_command" 1660dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1670dba6195SLoïc Minier return 0 1680dba6195SLoïc Minier fi 1690dba6195SLoïc Minier done 1700dba6195SLoïc Minier # not found 1710dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1720dba6195SLoïc Minier return 1 1730dba6195SLoïc Minier} 1740dba6195SLoïc Minier 1755b808275SLluís Vilanovahave_backend () { 1765b808275SLluís Vilanova echo "$trace_backends" | grep "$1" >/dev/null 1775b808275SLluís Vilanova} 1785b808275SLluís Vilanova 1793b6b7550SPaolo Bonziniglob() { 1803b6b7550SPaolo Bonzini eval test -z '"${1#'"$2"'}"' 1813b6b7550SPaolo Bonzini} 1823b6b7550SPaolo Bonzini 1833b6b7550SPaolo Bonzinisupported_hax_target() { 1843b6b7550SPaolo Bonzini test "$hax" = "yes" || return 1 1853b6b7550SPaolo Bonzini glob "$1" "*-softmmu" || return 1 1863b6b7550SPaolo Bonzini case "${1%-softmmu}" in 1873b6b7550SPaolo Bonzini i386|x86_64) 1883b6b7550SPaolo Bonzini return 0 1893b6b7550SPaolo Bonzini ;; 1903b6b7550SPaolo Bonzini esac 1913b6b7550SPaolo Bonzini return 1 1923b6b7550SPaolo Bonzini} 1933b6b7550SPaolo Bonzini 1943b6b7550SPaolo Bonzinisupported_kvm_target() { 1953b6b7550SPaolo Bonzini test "$kvm" = "yes" || return 1 1963b6b7550SPaolo Bonzini glob "$1" "*-softmmu" || return 1 1973b6b7550SPaolo Bonzini case "${1%-softmmu}:$cpu" in 1983b6b7550SPaolo Bonzini arm:arm | aarch64:aarch64 | \ 1993b6b7550SPaolo Bonzini i386:i386 | i386:x86_64 | i386:x32 | \ 2003b6b7550SPaolo Bonzini x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ 2013b6b7550SPaolo Bonzini mips:mips | mipsel:mips | \ 202f8378accSRichard Henderson ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \ 2033b6b7550SPaolo Bonzini s390x:s390x) 2043b6b7550SPaolo Bonzini return 0 2053b6b7550SPaolo Bonzini ;; 2063b6b7550SPaolo Bonzini esac 2073b6b7550SPaolo Bonzini return 1 2083b6b7550SPaolo Bonzini} 2093b6b7550SPaolo Bonzini 2103b6b7550SPaolo Bonzinisupported_xen_target() { 2113b6b7550SPaolo Bonzini test "$xen" = "yes" || return 1 2123b6b7550SPaolo Bonzini glob "$1" "*-softmmu" || return 1 213b5ed2e11SPaolo Bonzini # Only i386 and x86_64 provide the xenpv machine. 214b5ed2e11SPaolo Bonzini case "${1%-softmmu}" in 215b5ed2e11SPaolo Bonzini i386|x86_64) 2163b6b7550SPaolo Bonzini return 0 2173b6b7550SPaolo Bonzini ;; 2183b6b7550SPaolo Bonzini esac 2193b6b7550SPaolo Bonzini return 1 2203b6b7550SPaolo Bonzini} 2213b6b7550SPaolo Bonzini 222c97d6d2cSSergio Andres Gomez Del Realsupported_hvf_target() { 223c97d6d2cSSergio Andres Gomez Del Real test "$hvf" = "yes" || return 1 224c97d6d2cSSergio Andres Gomez Del Real glob "$1" "*-softmmu" || return 1 225c97d6d2cSSergio Andres Gomez Del Real case "${1%-softmmu}" in 226c97d6d2cSSergio Andres Gomez Del Real x86_64) 227c97d6d2cSSergio Andres Gomez Del Real return 0 228c97d6d2cSSergio Andres Gomez Del Real ;; 229c97d6d2cSSergio Andres Gomez Del Real esac 230c97d6d2cSSergio Andres Gomez Del Real return 1 231c97d6d2cSSergio Andres Gomez Del Real} 232c97d6d2cSSergio Andres Gomez Del Real 233d661d9a4SJustin Terry (VM)supported_whpx_target() { 234d661d9a4SJustin Terry (VM) test "$whpx" = "yes" || return 1 235d661d9a4SJustin Terry (VM) glob "$1" "*-softmmu" || return 1 236d661d9a4SJustin Terry (VM) case "${1%-softmmu}" in 237d661d9a4SJustin Terry (VM) i386|x86_64) 238d661d9a4SJustin Terry (VM) return 0 239d661d9a4SJustin Terry (VM) ;; 240d661d9a4SJustin Terry (VM) esac 241d661d9a4SJustin Terry (VM) return 1 242d661d9a4SJustin Terry (VM)} 243d661d9a4SJustin Terry (VM) 244d880a3baSPaolo Bonzinisupported_target() { 245d880a3baSPaolo Bonzini case "$1" in 246d880a3baSPaolo Bonzini *-softmmu) 247d880a3baSPaolo Bonzini ;; 248d880a3baSPaolo Bonzini *-linux-user) 249d880a3baSPaolo Bonzini if test "$linux" != "yes"; then 250d880a3baSPaolo Bonzini print_error "Target '$target' is only available on a Linux host" 251d880a3baSPaolo Bonzini return 1 252d880a3baSPaolo Bonzini fi 253d880a3baSPaolo Bonzini ;; 254d880a3baSPaolo Bonzini *-bsd-user) 255d880a3baSPaolo Bonzini if test "$bsd" != "yes"; then 256d880a3baSPaolo Bonzini print_error "Target '$target' is only available on a BSD host" 257d880a3baSPaolo Bonzini return 1 258d880a3baSPaolo Bonzini fi 259d880a3baSPaolo Bonzini ;; 260d880a3baSPaolo Bonzini *) 261d880a3baSPaolo Bonzini print_error "Invalid target name '$target'" 262d880a3baSPaolo Bonzini return 1 263d880a3baSPaolo Bonzini ;; 264d880a3baSPaolo Bonzini esac 265b3f6ea7eSPaolo Bonzini test "$tcg" = "yes" && return 0 266b3f6ea7eSPaolo Bonzini supported_kvm_target "$1" && return 0 267b3f6ea7eSPaolo Bonzini supported_xen_target "$1" && return 0 268b3f6ea7eSPaolo Bonzini supported_hax_target "$1" && return 0 269c97d6d2cSSergio Andres Gomez Del Real supported_hvf_target "$1" && return 0 270d661d9a4SJustin Terry (VM) supported_whpx_target "$1" && return 0 271b3f6ea7eSPaolo Bonzini print_error "TCG disabled, but hardware accelerator not available for '$target'" 272b3f6ea7eSPaolo Bonzini return 1 273d880a3baSPaolo Bonzini} 274d880a3baSPaolo Bonzini 275e9a3591fSChristian Borntraeger 276e9a3591fSChristian Borntraegerld_has() { 277e9a3591fSChristian Borntraeger $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1 278e9a3591fSChristian Borntraeger} 279e9a3591fSChristian Borntraeger 28079d77bcdSPeter Maydell# make source path absolute 28114211825SAntonio Ospitesource_path=$(cd "$(dirname -- "$0")"; pwd) 28214211825SAntonio Ospite 2834ace32e2SAntonio Ospiteif printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]"; 2844ace32e2SAntonio Ospitethen 2854ace32e2SAntonio Ospite error_exit "main directory cannot contain spaces nor colons" 2864ace32e2SAntonio Ospitefi 2874ace32e2SAntonio Ospite 28814211825SAntonio Ospite# default parameters 2892ff6b91eSJuan Quintelacpu="" 290a31a8642SMichael S. Tsirkiniasl="iasl" 2911e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 29243ce4dfeSbellardstatic="no" 2937d13299dSbellardcross_prefix="" 2940c58ac1cSmalcaudio_drv_list="" 295b64ec4e4SFam Zhengblock_drv_rw_whitelist="" 296b64ec4e4SFam Zhengblock_drv_ro_whitelist="" 297e49d021eSPeter Maydellhost_cc="cc" 29802f9135bSDaniel P. Berrangélibs_cpu="" 29973da375eSJuan Quintelalibs_softmmu="" 3003e2e0e6bSJuan Quintelalibs_tools="" 301d5631638Smalcaudio_win_int="" 302957f1f99SMichael Rothlibs_qga="" 3035bc62e01SGerd Hoffmanndebug_info="yes" 30463678e17SSteven Noonanstack_protector="" 305afc3a8f9SAlex Bennéeuse_containers="yes" 306f2385398SAlex Bennéegdb_bin=$(command -v "gdb-multiarch" || command -v "gdb") 307ac0df51dSaliguori 30892712822SDaniel P. Berrangeif test -e "$source_path/.git" 30992712822SDaniel P. Berrangethen 310f62bbee5SDaniel P. Berrange git_update=yes 31192712822SDaniel P. Berrange git_submodules="ui/keycodemapdb" 3123ac1f813SEmilio G. Cota git_submodules="$git_submodules tests/fp/berkeley-testfloat-3" 3133ac1f813SEmilio G. Cota git_submodules="$git_submodules tests/fp/berkeley-softfloat-3" 31492712822SDaniel P. Berrangeelse 315f62bbee5SDaniel P. Berrange git_update=no 316aef45d51SDaniel P. Berrange git_submodules="" 3175c0ef67aSDaniel P. Berrangé 3185c0ef67aSDaniel P. Berrangé if ! test -f "$source_path/ui/keycodemapdb/README" 3195c0ef67aSDaniel P. Berrangé then 3205c0ef67aSDaniel P. Berrangé echo 3215c0ef67aSDaniel P. Berrangé echo "ERROR: missing file $source_path/ui/keycodemapdb/README" 3225c0ef67aSDaniel P. Berrangé echo 3235c0ef67aSDaniel P. Berrangé echo "This is not a GIT checkout but module content appears to" 3245c0ef67aSDaniel P. Berrangé echo "be missing. Do not use 'git archive' or GitHub download links" 3255c0ef67aSDaniel P. Berrangé echo "to acquire QEMU source archives. Non-GIT builds are only" 3265c0ef67aSDaniel P. Berrangé echo "supported with source archives linked from:" 3275c0ef67aSDaniel P. Berrangé echo 328a3e3b521SPeter Maydell echo " https://www.qemu.org/download/#source" 3295c0ef67aSDaniel P. Berrangé echo 3305c0ef67aSDaniel P. Berrangé echo "Developers working with GIT can use scripts/archive-source.sh" 3315c0ef67aSDaniel P. Berrangé echo "if they need to create valid source archives." 3325c0ef67aSDaniel P. Berrangé echo 3335c0ef67aSDaniel P. Berrangé exit 1 3345c0ef67aSDaniel P. Berrangé fi 33592712822SDaniel P. Berrangefi 336cc84d63aSDaniel P. Berrangegit="git" 337ac0df51dSaliguori 338afb63ebdSStefan Weil# Don't accept a target_list environment variable. 339afb63ebdSStefan Weilunset target_list 340447e133fSAlex Bennéeunset target_list_exclude 341377529c0SPaolo Bonzini 342377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 343377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 344377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 345377529c0SPaolo Bonzini# unless --disable-foo is given 346377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 347377529c0SPaolo Bonzini# feature will searched for, 348377529c0SPaolo Bonzini# if not found, configure exits with error 349377529c0SPaolo Bonzini# 350377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 351377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 352377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 353377529c0SPaolo Bonzini 354377529c0SPaolo Bonzinibrlapi="" 355377529c0SPaolo Bonzinicurl="" 356377529c0SPaolo Bonzinicurses="" 357377529c0SPaolo Bonzinidocs="" 358377529c0SPaolo Bonzinifdt="" 35958952137SVincenzo Maffionenetmap="no" 360377529c0SPaolo Bonzinisdl="" 361a442fe2fSDaniel P. Berrangésdl_image="" 362983eef5aSMeador Ingevirtfs="" 363fe8fc5aeSPaolo Bonzinimpath="" 364821601eaSJes Sorensenvnc="yes" 365377529c0SPaolo Bonzinisparse="no" 366377529c0SPaolo Bonzinivde="" 367377529c0SPaolo Bonzinivnc_sasl="" 368377529c0SPaolo Bonzinivnc_jpeg="" 369377529c0SPaolo Bonzinivnc_png="" 3706a021536SGerd Hoffmannxkbcommon="" 371377529c0SPaolo Bonzinixen="" 372d5b93ddfSAnthony PERARDxen_ctrl_version="" 373eb6fda0fSAnthony PERARDxen_pci_passthrough="" 374377529c0SPaolo Bonzinilinux_aio="" 375c10dd856SAarushi Mehtalinux_io_uring="" 37647e98658SCorey Bryantcap_ng="" 377377529c0SPaolo Bonziniattr="" 3784f26f2b6SAvi Kivitylibattr="" 379377529c0SPaolo Bonzinixfs="" 380b3f6ea7eSPaolo Bonzinitcg="yes" 381a40161cbSPaolo Bonzinimembarrier="" 382299e6f19SPaolo Bonzinivhost_net="" 383299e6f19SPaolo Bonzinivhost_crypto="" 384299e6f19SPaolo Bonzinivhost_scsi="" 385299e6f19SPaolo Bonzinivhost_vsock="" 386e6a74868SMarc-André Lureauvhost_user="" 38798fc1adaSDr. David Alan Gilbertvhost_user_fs="" 388d41a75a2SBradkvm="no" 389b0cb0a66SVincent Palatinhax="no" 390c97d6d2cSSergio Andres Gomez Del Realhvf="no" 391d661d9a4SJustin Terry (VM)whpx="no" 3922da776dbSMichael R. Hinesrdma="" 39321ab34c9SMarcel Apfelbaumpvrdma="" 394377529c0SPaolo Bonzinigprof="no" 395377529c0SPaolo Bonzinidebug_tcg="no" 396377529c0SPaolo Bonzinidebug="no" 397247724cbSMarc-André Lureausanitizers="no" 398b553a042SJohn Snowfortify_source="" 399377529c0SPaolo Bonzinistrip_opt="yes" 4009195b2c2SStefan Weiltcg_interpreter="no" 401377529c0SPaolo Bonzinibigendian="no" 402377529c0SPaolo Bonzinimingw32="no" 4031d728c39SBlue Swirlgcov="no" 4041d728c39SBlue Swirlgcov_tool="gcov" 405377529c0SPaolo BonziniEXESUF="" 40617969268SFam ZhengDSOSUF=".so" 40717969268SFam ZhengLDFLAGS_SHARED="-shared" 40817969268SFam Zhengmodules="no" 409bd83c861SChristian Ehrhardtmodule_upgrades="no" 410377529c0SPaolo Bonziniprefix="/usr/local" 411377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 412528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 4133d5eecabSGerd Hoffmannfirmwarepath="\${prefix}/share/qemu-firmware" 414850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 415377529c0SPaolo Bonzinibindir="\${prefix}/bin" 4163aa5d2beSAlon Levylibdir="\${prefix}/lib" 4178bf188aaSMichael Tokarevlibexecdir="\${prefix}/libexec" 4180f94d6daSAlon Levyincludedir="\${prefix}/include" 419377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 420785c23aeSLuiz Capitulinolocal_statedir="\${prefix}/var" 421377529c0SPaolo Bonziniconfsuffix="/qemu" 422675b9b53SMarc-André Lureauslirp="" 423377529c0SPaolo Bonzinioss_lib="" 424377529c0SPaolo Bonzinibsd="no" 425377529c0SPaolo Bonzinilinux="no" 426377529c0SPaolo Bonzinisolaris="no" 427377529c0SPaolo Bonziniprofiler="no" 428377529c0SPaolo Bonzinicocoa="no" 429377529c0SPaolo Bonzinisoftmmu="yes" 430377529c0SPaolo Bonzinilinux_user="no" 431377529c0SPaolo Bonzinibsd_user="no" 432377529c0SPaolo Bonziniblobs="yes" 43305dfa22bSPhilippe Mathieu-Daudéedk2_blobs="no" 434377529c0SPaolo Bonzinipkgversion="" 43540d6444eSAvi Kivitypie="" 4363556c233SPaolo Bonziniqom_cast_debug="yes" 437baf86d6bSPaolo Bonzinitrace_backends="log" 438377529c0SPaolo Bonzinitrace_file="trace" 439377529c0SPaolo Bonzinispice="" 440377529c0SPaolo Bonzinirbd="" 4417b02f544SMarc-André Lureausmartcard="" 4422b2325ffSGerd Hoffmannlibusb="" 44369354a83SHans de Goedeusb_redir="" 444da076ffeSGerd Hoffmannopengl="" 445014cb152SGerd Hoffmannopengl_dmabuf="no" 4465dd89908SRichard Hendersoncpuid_h="no" 44786583a07SLiam Merwickavx2_opt="" 4481ece9905SAlon Levyzlib="yes" 4498ca80760SRichard Hendersoncapstone="" 450b25c9dffSStefan Weillzo="" 451b25c9dffSStefan Weilsnappy="" 4526b383c08SPeter Wubzip2="" 45383bc1f97SJulio Faraccolzfse="" 4543a678481SJuan Quintelazstd="" 455e8ef31a3SMichael Tokarevguest_agent="" 456d9840e25STomoki Sekiyamaguest_agent_with_vss="no" 45750cbebb9SMichael Rothguest_agent_ntddscsi="no" 4589dacf32dSYossi Hindinguest_agent_msi="" 459d9840e25STomoki Sekiyamavss_win32_sdk="" 460d9840e25STomoki Sekiyamawin_sdk="no" 461e10ee3f5SPhilippe Mathieu-Daudéwant_tools="" 462c589b249SRonnie Sahlberglibiscsi="" 4636542aa9cSPeter Lievenlibnfs="" 464519175a2SAlex Barcelocoroutine="" 46570c60c08SStefan Hajnoczicoroutine_pool="" 4667d992e4dSPeter Lievendebug_stack_usage="no" 467f0d92b56SLongpeng(Mike)crypto_afalg="no" 468f794573eSEduardo Otuboseccomp="" 469eb100396SBharata B Raoglusterfs="" 470d85fa9ebSJeff Codyglusterfs_xlator_opt="no" 4710c14fb47SBharata B Raoglusterfs_discard="no" 472df3a429aSNiels de Vosglusterfs_fallocate="no" 4737c815372SBharata B Raoglusterfs_zerofill="no" 474e014dbe7SPrasanna Kumar Kaleverglusterfs_ftruncate_has_stat="no" 4750e3b891fSNiels de Vosglusterfs_iocb_has_stat="no" 476a4ccabcfSAnthony Liguorigtk="" 477925a0400SGerd Hoffmanngtk_gl="no" 478a1c5e949SDaniel P. Berrangetls_priority="NORMAL" 479ddbb0d09SDaniel P. Berrangegnutls="" 48091bfcdb0SDaniel P. Berrangenettle="" 481dc2207afSDaniel P. Berrangénettle_xts="no" 48291bfcdb0SDaniel P. Berrangegcrypt="" 4831f923c70SLongpeng(Mike)gcrypt_hmac="no" 484e0576942SDaniel P. Berrangégcrypt_xts="no" 485e0576942SDaniel P. Berrangéqemu_private_xts="yes" 4868953caf3SDaniel P. Berrangeauth_pam="" 487bbbf9bfbSStefan Weilvte="" 4889d9e1521SGerd Hoffmannvirglrenderer="" 4897aaa6a16SPaolo Bonzinitpm="" 490b10d49d7SPino Toscanolibssh="" 491ed1701c6SDr. David Alan Gilbertlive_block_migration="yes" 492a99d57bbSWanlong Gaonuma="" 4932847b469SFam Zhengtcmalloc="no" 4947b01cb97SAlexandre Derumierjemalloc="no" 495a6b1d4c0SChanglong Xiereplication="yes" 496da92c3ffSAshish Mittalvxhs="" 4972f740136SJeff Codybochs="yes" 4982f740136SJeff Codycloop="yes" 4992f740136SJeff Codydmg="yes" 5002f740136SJeff Codyqcow1="yes" 5012f740136SJeff Codyvdi="yes" 5022f740136SJeff Codyvvfat="yes" 5032f740136SJeff Codyqed="yes" 5042f740136SJeff Codyparallels="yes" 5052f740136SJeff Codysheepdog="yes" 506ed279a06SKlim Kireevlibxml2="" 507ba59fb77SPaolo Bonzinidebug_mutex="no" 50817824406SJunyan Helibpmem="" 509f3494749SPaolo Bonzinidefault_devices="yes" 51040e8c6f4SAlex Bennéeplugins="no" 511adc28027SAlexander Bulekovfuzzing="no" 512377529c0SPaolo Bonzini 513898be3e0SPeter Maydellsupported_cpu="no" 514898be3e0SPeter Maydellsupported_os="no" 515fb59dabdSPeter Maydellbogus_os="no" 5165a22ab71SYang Zhongmalloc_trim="" 517898be3e0SPeter Maydell 518ac0df51dSaliguori# parse CC options first 519ac0df51dSaliguorifor opt do 52089138857SStefan Weil optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') 521ac0df51dSaliguori case "$opt" in 522ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 523ac0df51dSaliguori ;; 5243d8df640SPaolo Bonzini --cc=*) CC="$optarg" 525ac0df51dSaliguori ;; 52683f73fceSTomoki Sekiyama --cxx=*) CXX="$optarg" 52783f73fceSTomoki Sekiyama ;; 5282ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 5292ff6b91eSJuan Quintela ;; 530de385287SAlex Bennée --extra-cflags=*) QEMU_CFLAGS="$QEMU_CFLAGS $optarg" 531db5adeaaSPaolo Bonzini QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg" 532e2a2ed06SJuan Quintela ;; 53311cde1c8SBruno Dominguez --extra-cxxflags=*) QEMU_CXXFLAGS="$QEMU_CXXFLAGS $optarg" 53411cde1c8SBruno Dominguez ;; 535db5adeaaSPaolo Bonzini --extra-ldflags=*) QEMU_LDFLAGS="$QEMU_LDFLAGS $optarg" 536f9943cd5SGerd Hoffmann EXTRA_LDFLAGS="$optarg" 537e2a2ed06SJuan Quintela ;; 5385bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 5395bc62e01SGerd Hoffmann ;; 5405bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 5415bc62e01SGerd Hoffmann ;; 542d75402b5SAlex Bennée --cross-cc-*[!a-zA-Z0-9_-]*=*) error_exit "Passed bad --cross-cc-FOO option" 543d75402b5SAlex Bennée ;; 544d422b2bcSAlex Bennée --cross-cc-cflags-*) cc_arch=${opt#--cross-cc-flags-}; cc_arch=${cc_arch%%=*} 545d422b2bcSAlex Bennée eval "cross_cc_cflags_${cc_arch}=\$optarg" 5462038f8c8SPaolo Bonzini cross_cc_vars="$cross_cc_vars cross_cc_cflags_${cc_arch}" 547d422b2bcSAlex Bennée ;; 548d75402b5SAlex Bennée --cross-cc-*) cc_arch=${opt#--cross-cc-}; cc_arch=${cc_arch%%=*} 5492038f8c8SPaolo Bonzini cc_archs="$cc_archs $cc_arch" 550d75402b5SAlex Bennée eval "cross_cc_${cc_arch}=\$optarg" 5512038f8c8SPaolo Bonzini cross_cc_vars="$cross_cc_vars cross_cc_${cc_arch}" 552d75402b5SAlex Bennée ;; 553ac0df51dSaliguori esac 554ac0df51dSaliguoridone 555ac0df51dSaliguori# OS specific 556ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 55793148aa5SStefan Weil# we can eliminate its usage altogether. 558ac0df51dSaliguori 559e49d021eSPeter Maydell# Preferred compiler: 560e49d021eSPeter Maydell# ${CC} (if set) 561e49d021eSPeter Maydell# ${cross_prefix}gcc (if cross-prefix specified) 562e49d021eSPeter Maydell# system compiler 563e49d021eSPeter Maydellif test -z "${CC}${cross_prefix}"; then 564e49d021eSPeter Maydell cc="$host_cc" 565e49d021eSPeter Maydellelse 566b3198cc2SStuart Yoder cc="${CC-${cross_prefix}gcc}" 567e49d021eSPeter Maydellfi 568e49d021eSPeter Maydell 56983f73fceSTomoki Sekiyamaif test -z "${CXX}${cross_prefix}"; then 57083f73fceSTomoki Sekiyama cxx="c++" 57183f73fceSTomoki Sekiyamaelse 57283f73fceSTomoki Sekiyama cxx="${CXX-${cross_prefix}g++}" 57383f73fceSTomoki Sekiyamafi 57483f73fceSTomoki Sekiyama 575b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 576cdbd727cSRichard Hendersonas="${AS-${cross_prefix}as}" 5775f6f0e27SRichard Hendersonccas="${CCAS-$cc}" 5783dd46c78SBlue Swirlcpp="${CPP-$cc -E}" 579b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 580b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 5819f81aeb5SAlistair Francisranlib="${RANLIB-${cross_prefix}ranlib}" 5824852ee95SStefan Weilnm="${NM-${cross_prefix}nm}" 583b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 584b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 58517884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 58617884d7bSSergei Trofimovichquery_pkg_config() { 58717884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 58817884d7bSSergei Trofimovich} 58917884d7bSSergei Trofimovichpkg_config=query_pkg_config 59047c03744SDave Airliesdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" 591ac0df51dSaliguori 59245d285abSPeter Maydell# If the user hasn't specified ARFLAGS, default to 'rv', just as make does. 59345d285abSPeter MaydellARFLAGS="${ARFLAGS-rv}" 59445d285abSPeter Maydell 595be17dc90SMichael S. Tsirkin# default flags for all hosts 5962d31515bSPeter Maydell# We use -fwrapv to tell the compiler that we require a C dialect where 5972d31515bSPeter Maydell# left shift of signed integers is well defined and has the expected 5982d31515bSPeter Maydell# 2s-complement style results. (Both clang and gcc agree that it 5992d31515bSPeter Maydell# provides these semantics.) 6007be41675SThomas HuthQEMU_CFLAGS="-fno-strict-aliasing -fno-common -fwrapv -std=gnu99 $QEMU_CFLAGS" 601f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 602c95e3080SKevin WolfQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 603be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 6049edc19c9SMichael S. TsirkinQEMU_INCLUDES="-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel/tcg -iquote \$(SRC_PATH)/include" 60553422040SPaolo BonziniQEMU_INCLUDES="$QEMU_INCLUDES -iquote \$(SRC_PATH)/disas/libvixl" 6065bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 6075bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 6085bc62e01SGerd Hoffmannfi 609be17dc90SMichael S. Tsirkin 610cab00a5aSMichael S. Tsirkin# running configure in the source tree? 611cab00a5aSMichael S. Tsirkin# we know that's the case if configure is there. 612cab00a5aSMichael S. Tsirkinif test -f "./configure"; then 613cab00a5aSMichael S. Tsirkin pwd_is_source_path="y" 614cab00a5aSMichael S. Tsirkinelse 615cab00a5aSMichael S. Tsirkin pwd_is_source_path="n" 616cab00a5aSMichael S. Tsirkinfi 617cab00a5aSMichael S. Tsirkin 618ac0df51dSaliguoricheck_define() { 619ac0df51dSaliguoricat > $TMPC <<EOF 620ac0df51dSaliguori#if !defined($1) 621fd786e1aSPeter Maydell#error $1 not defined 622ac0df51dSaliguori#endif 623ac0df51dSaliguoriint main(void) { return 0; } 624ac0df51dSaliguoriEOF 62552166aa0SJuan Quintela compile_object 626ac0df51dSaliguori} 627ac0df51dSaliguori 628307119e7SGerd Hoffmanncheck_include() { 629307119e7SGerd Hoffmanncat > $TMPC <<EOF 630307119e7SGerd Hoffmann#include <$1> 631307119e7SGerd Hoffmannint main(void) { return 0; } 632307119e7SGerd HoffmannEOF 633307119e7SGerd Hoffmann compile_object 634307119e7SGerd Hoffmann} 635307119e7SGerd Hoffmann 63693b25869SJohn Snowwrite_c_skeleton() { 63793b25869SJohn Snow cat > $TMPC <<EOF 63893b25869SJohn Snowint main(void) { return 0; } 63993b25869SJohn SnowEOF 64093b25869SJohn Snow} 64193b25869SJohn Snow 642adc28027SAlexander Bulekovwrite_c_fuzzer_skeleton() { 643adc28027SAlexander Bulekov cat > $TMPC <<EOF 644adc28027SAlexander Bulekov#include <stdint.h> 645adc28027SAlexander Bulekov#include <sys/types.h> 646adc28027SAlexander Bulekovint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); 647adc28027SAlexander Bulekovint LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { return 0; } 648adc28027SAlexander BulekovEOF 649adc28027SAlexander Bulekov} 650adc28027SAlexander Bulekov 651bbea4050SPeter Maydellif check_define __linux__ ; then 652bbea4050SPeter Maydell targetos="Linux" 653bbea4050SPeter Maydellelif check_define _WIN32 ; then 654bbea4050SPeter Maydell targetos='MINGW32' 655bbea4050SPeter Maydellelif check_define __OpenBSD__ ; then 656bbea4050SPeter Maydell targetos='OpenBSD' 657bbea4050SPeter Maydellelif check_define __sun__ ; then 658bbea4050SPeter Maydell targetos='SunOS' 659bbea4050SPeter Maydellelif check_define __HAIKU__ ; then 660bbea4050SPeter Maydell targetos='Haiku' 661951fedfcSPeter Maydellelif check_define __FreeBSD__ ; then 662951fedfcSPeter Maydell targetos='FreeBSD' 663951fedfcSPeter Maydellelif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then 664951fedfcSPeter Maydell targetos='GNU/kFreeBSD' 665951fedfcSPeter Maydellelif check_define __DragonFly__ ; then 666951fedfcSPeter Maydell targetos='DragonFly' 667951fedfcSPeter Maydellelif check_define __NetBSD__; then 668951fedfcSPeter Maydell targetos='NetBSD' 669951fedfcSPeter Maydellelif check_define __APPLE__; then 670951fedfcSPeter Maydell targetos='Darwin' 671bbea4050SPeter Maydellelse 672951fedfcSPeter Maydell # This is a fatal error, but don't report it yet, because we 673951fedfcSPeter Maydell # might be going to just print the --help text, or it might 674951fedfcSPeter Maydell # be the result of a missing compiler. 675951fedfcSPeter Maydell targetos='bogus' 676951fedfcSPeter Maydell bogus_os='yes' 677bbea4050SPeter Maydellfi 678bbea4050SPeter Maydell 679bbea4050SPeter Maydell# Some host OSes need non-standard checks for which CPU to use. 680bbea4050SPeter Maydell# Note that these checks are broken for cross-compilation: if you're 681bbea4050SPeter Maydell# cross-compiling to one of these OSes then you'll need to specify 682bbea4050SPeter Maydell# the correct CPU with the --cpu option. 683bbea4050SPeter Maydellcase $targetos in 684bbea4050SPeter MaydellDarwin) 685bbea4050SPeter Maydell # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can 686bbea4050SPeter Maydell # run 64-bit userspace code. 687bbea4050SPeter Maydell # If the user didn't specify a CPU explicitly and the kernel says this is 688bbea4050SPeter Maydell # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. 689bbea4050SPeter Maydell if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then 690bbea4050SPeter Maydell cpu="x86_64" 691bbea4050SPeter Maydell fi 692bbea4050SPeter Maydell ;; 693bbea4050SPeter MaydellSunOS) 69489138857SStefan Weil # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo 695bbea4050SPeter Maydell if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then 696bbea4050SPeter Maydell cpu="x86_64" 697bbea4050SPeter Maydell fi 698bbea4050SPeter Maydellesac 699bbea4050SPeter Maydell 7002ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 7012ff6b91eSJuan Quintela # command line argument 7022ff6b91eSJuan Quintela : 7032ff6b91eSJuan Quintelaelif check_define __i386__ ; then 704ac0df51dSaliguori cpu="i386" 705ac0df51dSaliguorielif check_define __x86_64__ ; then 706c72b26ecSRichard Henderson if check_define __ILP32__ ; then 707c72b26ecSRichard Henderson cpu="x32" 708c72b26ecSRichard Henderson else 709ac0df51dSaliguori cpu="x86_64" 710c72b26ecSRichard Henderson fi 7113aa9bd6cSblueswir1elif check_define __sparc__ ; then 7123aa9bd6cSblueswir1 if check_define __arch64__ ; then 7133aa9bd6cSblueswir1 cpu="sparc64" 7143aa9bd6cSblueswir1 else 7153aa9bd6cSblueswir1 cpu="sparc" 7163aa9bd6cSblueswir1 fi 717fdf7ed96Smalcelif check_define _ARCH_PPC ; then 718fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 719f8378accSRichard Henderson if check_define _LITTLE_ENDIAN ; then 720f8378accSRichard Henderson cpu="ppc64le" 721f8378accSRichard Henderson else 722fdf7ed96Smalc cpu="ppc64" 723f8378accSRichard Henderson fi 724ac0df51dSaliguori else 725fdf7ed96Smalc cpu="ppc" 726fdf7ed96Smalc fi 727afa05235SAurelien Jarnoelif check_define __mips__ ; then 728afa05235SAurelien Jarno cpu="mips" 729d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 730d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 731d66ed0eaSAurelien Jarno cpu="s390x" 732d66ed0eaSAurelien Jarno else 733d66ed0eaSAurelien Jarno cpu="s390" 734d66ed0eaSAurelien Jarno fi 735c4f80543SAlistair Franciselif check_define __riscv ; then 736c4f80543SAlistair Francis if check_define _LP64 ; then 737c4f80543SAlistair Francis cpu="riscv64" 738c4f80543SAlistair Francis else 739c4f80543SAlistair Francis cpu="riscv32" 740c4f80543SAlistair Francis fi 74121d89f84SPeter Maydellelif check_define __arm__ ; then 74221d89f84SPeter Maydell cpu="arm" 7431f080313SClaudio Fontanaelif check_define __aarch64__ ; then 7441f080313SClaudio Fontana cpu="aarch64" 745fdf7ed96Smalcelse 74689138857SStefan Weil cpu=$(uname -m) 747ac0df51dSaliguorifi 748ac0df51dSaliguori 749359bc95dSPeter MaydellARCH= 750359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 751359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 7527d13299dSbellardcase "$cpu" in 753ee35e968SThomas Huth ppc|ppc64|s390x|sparc64|x32|riscv32|riscv64) 754898be3e0SPeter Maydell supported_cpu="yes" 755898be3e0SPeter Maydell ;; 756f8378accSRichard Henderson ppc64le) 757f8378accSRichard Henderson ARCH="ppc64" 758f8378accSRichard Henderson supported_cpu="yes" 759f8378accSRichard Henderson ;; 7607d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 76197a847bcSbellard cpu="i386" 762898be3e0SPeter Maydell supported_cpu="yes" 7637d13299dSbellard ;; 764aaa5fa14Saurel32 x86_64|amd64) 765aaa5fa14Saurel32 cpu="x86_64" 766898be3e0SPeter Maydell supported_cpu="yes" 767aaa5fa14Saurel32 ;; 76821d89f84SPeter Maydell armv*b|armv*l|arm) 76921d89f84SPeter Maydell cpu="arm" 770898be3e0SPeter Maydell supported_cpu="yes" 7717d13299dSbellard ;; 7721f080313SClaudio Fontana aarch64) 7731f080313SClaudio Fontana cpu="aarch64" 774898be3e0SPeter Maydell supported_cpu="yes" 7751f080313SClaudio Fontana ;; 776afa05235SAurelien Jarno mips*) 777afa05235SAurelien Jarno cpu="mips" 778898be3e0SPeter Maydell supported_cpu="yes" 779afa05235SAurelien Jarno ;; 7803142255cSblueswir1 sparc|sun4[cdmuv]) 781ae228531Sbellard cpu="sparc" 7826499fd15SPeter Maydell supported_cpu="yes" 783ae228531Sbellard ;; 7847d13299dSbellard *) 785359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 786359bc95dSPeter Maydell ARCH=unknown 7877d13299dSbellard ;; 7887d13299dSbellardesac 789359bc95dSPeter Maydellif test -z "$ARCH"; then 790359bc95dSPeter Maydell ARCH="$cpu" 791359bc95dSPeter Maydellfi 792e2d52ad3SJuan Quintela 7937d13299dSbellard# OS specific 7940dbfc675SJuan Quintela 795adfc3e91SStacey Son# host *BSD for user mode 796adfc3e91SStacey SonHOST_VARIANT_DIR="" 797adfc3e91SStacey Son 7987d13299dSbellardcase $targetos in 79967b915a5SbellardMINGW32*) 80067b915a5Sbellard mingw32="yes" 801b0cb0a66SVincent Palatin hax="yes" 802299e6f19SPaolo Bonzini vhost_user="no" 8033cec7cc2SKővágó, Zoltán audio_possible_drivers="dsound sdl" 804307119e7SGerd Hoffmann if check_include dsound.h; then 8053cec7cc2SKővágó, Zoltán audio_drv_list="dsound" 806307119e7SGerd Hoffmann else 807307119e7SGerd Hoffmann audio_drv_list="" 808307119e7SGerd Hoffmann fi 809898be3e0SPeter Maydell supported_os="yes" 810469a788cSAlex Bennée pie="no" 81167b915a5Sbellard;; 8125c40d2bdSthsGNU/kFreeBSD) 813a167ba50SAurelien Jarno bsd="yes" 8146a485418SGerd Hoffmann audio_drv_list="oss try-sdl" 8150bac1111SKővágó, Zoltán audio_possible_drivers="oss sdl pa" 8165c40d2bdSths;; 8177d3505c5SbellardFreeBSD) 8187d3505c5Sbellard bsd="yes" 8190db4a067SPaolo Bonzini make="${MAKE-gmake}" 8206a485418SGerd Hoffmann audio_drv_list="oss try-sdl" 8210bac1111SKővágó, Zoltán audio_possible_drivers="oss sdl pa" 822f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 823f01576f1SJuergen Lock LIBS="-lutil $LIBS" 824a7764f15SEd Maste # needed for kinfo_getproc 825a7764f15SEd Maste libs_qga="-lutil $libs_qga" 82658952137SVincenzo Maffione netmap="" # enable netmap autodetect 827adfc3e91SStacey Son HOST_VARIANT_DIR="freebsd" 828898be3e0SPeter Maydell supported_os="yes" 8297d3505c5Sbellard;; 830c5e97233Sblueswir1DragonFly) 831c5e97233Sblueswir1 bsd="yes" 8320db4a067SPaolo Bonzini make="${MAKE-gmake}" 8336a485418SGerd Hoffmann audio_drv_list="oss try-sdl" 8340bac1111SKővágó, Zoltán audio_possible_drivers="oss sdl pa" 835adfc3e91SStacey Son HOST_VARIANT_DIR="dragonfly" 836c5e97233Sblueswir1;; 8377d3505c5SbellardNetBSD) 8387d3505c5Sbellard bsd="yes" 839604a5b99SKamil Rytarowski hax="yes" 8400db4a067SPaolo Bonzini make="${MAKE-gmake}" 8416a485418SGerd Hoffmann audio_drv_list="oss try-sdl" 8420bac1111SKővágó, Zoltán audio_possible_drivers="oss sdl" 8438ef92a88Sblueswir1 oss_lib="-lossaudio" 844adfc3e91SStacey Son HOST_VARIANT_DIR="netbsd" 8453c2bdbc1SKamil Rytarowski supported_os="yes" 8467d3505c5Sbellard;; 8477d3505c5SbellardOpenBSD) 8487d3505c5Sbellard bsd="yes" 8490db4a067SPaolo Bonzini make="${MAKE-gmake}" 850f92c7168SGerd Hoffmann audio_drv_list="try-sdl" 8510bac1111SKővágó, Zoltán audio_possible_drivers="sdl" 852adfc3e91SStacey Son HOST_VARIANT_DIR="openbsd" 8530a773d55SBrad Smith supported_os="yes" 8547d3505c5Sbellard;; 85583fb7adfSbellardDarwin) 85683fb7adfSbellard bsd="yes" 85783fb7adfSbellard darwin="yes" 858b0cb0a66SVincent Palatin hax="yes" 859c97d6d2cSSergio Andres Gomez Del Real hvf="yes" 86017969268SFam Zheng LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" 8611b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 862a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 863db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-arch x86_64 $QEMU_LDFLAGS" 8641b0f9cc2Saliguori fi 865fd677642Sths cocoa="yes" 8666a485418SGerd Hoffmann audio_drv_list="coreaudio try-sdl" 86714382605SKővágó, Zoltán audio_possible_drivers="coreaudio sdl" 868db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-framework CoreFoundation -framework IOKit $QEMU_LDFLAGS" 8697973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 870a0b7cf6bSPeter Maydell # Disable attempts to use ObjectiveC features in os/object.h since they 871a0b7cf6bSPeter Maydell # won't work when we're compiling with gcc as a C compiler. 872a0b7cf6bSPeter Maydell QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" 873adfc3e91SStacey Son HOST_VARIANT_DIR="darwin" 874898be3e0SPeter Maydell supported_os="yes" 87583fb7adfSbellard;; 876ec530c81SbellardSunOS) 877ec530c81Sbellard solaris="yes" 8780db4a067SPaolo Bonzini make="${MAKE-gmake}" 8790db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 880e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 8816b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 8826a485418SGerd Hoffmann audio_drv_list="oss try-sdl" 8836b4d2ba1Sths fi 884c2de5c91Smalc audio_possible_drivers="oss sdl" 885d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 886d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 887d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 888d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 889a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 890560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 891560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 892560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 893ec530c81Sbellard;; 894179cf400SAndreas FärberHaiku) 895179cf400SAndreas Färber haiku="yes" 896179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 897179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 898179cf400SAndreas Färber;; 899898be3e0SPeter MaydellLinux) 9007183834aSGerd Hoffmann audio_drv_list="try-pa oss" 9010bac1111SKővágó, Zoltán audio_possible_drivers="oss alsa sdl pa" 9025327cf48Sbellard linux="yes" 903831b7825Sths linux_user="yes" 904af2be207SJan Kiszka kvm="yes" 90567cf3f5cSEduardo Habkost QEMU_INCLUDES="-isystem \$(SRC_PATH)/linux-headers -isystem $PWD/linux-headers $QEMU_INCLUDES" 906898be3e0SPeter Maydell supported_os="yes" 9073efac6ebSTomáš Golembiovský libudev="yes" 908898be3e0SPeter Maydell;; 9097d13299dSbellardesac 9107d13299dSbellard 9117d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 912b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 91384778508Sblueswir1 bsd_user="yes" 9147d3505c5Sbellard fi 91508de3949SAndreas Färberfi 9167d3505c5Sbellard 9170db4a067SPaolo Bonzini: ${make=${MAKE-make}} 9180db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 919faf44142SDaniel P. Berrangé# We prefer python 3.x. A bare 'python' is traditionally 920faf44142SDaniel P. Berrangé# python 2.x, but some distros have it as python 3.x, so 921ddf90699SEduardo Habkost# we check that too 922faf44142SDaniel P. Berrangépython= 923ddf90699SEduardo Habkostfor binary in "${PYTHON-python3}" python 924faf44142SDaniel P. Berrangédo 925faf44142SDaniel P. Berrangé if has "$binary" 926faf44142SDaniel P. Berrangé then 92795c5f2deSPaolo Bonzini python=$(command -v "$binary") 928faf44142SDaniel P. Berrangé break 929faf44142SDaniel P. Berrangé fi 930faf44142SDaniel P. Berrangédone 931903458c8SMarkus Armbruster 932903458c8SMarkus Armbrustersphinx_build= 933903458c8SMarkus Armbrusterfor binary in sphinx-build-3 sphinx-build 934903458c8SMarkus Armbrusterdo 935903458c8SMarkus Armbruster if has "$binary" 936903458c8SMarkus Armbruster then 937903458c8SMarkus Armbruster sphinx_build=$(command -v "$binary") 938903458c8SMarkus Armbruster break 939903458c8SMarkus Armbruster fi 940903458c8SMarkus Armbrusterdone 941903458c8SMarkus Armbruster 94239d87c8cSAlex Bennée# Check for ancillary tools used in testing 94339d87c8cSAlex Bennéegenisoimage= 94439d87c8cSAlex Bennéefor binary in genisoimage 94539d87c8cSAlex Bennéedo 94639d87c8cSAlex Bennée if has $binary 94739d87c8cSAlex Bennée then 94839d87c8cSAlex Bennée genisoimage=$(command -v "$binary") 94939d87c8cSAlex Bennée break 95039d87c8cSAlex Bennée fi 95139d87c8cSAlex Bennéedone 95239d87c8cSAlex Bennée 953e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 9540db4a067SPaolo Bonzini 9553c4a4d0dSPeter Maydell# Default objcc to clang if available, otherwise use CC 9563c4a4d0dSPeter Maydellif has clang; then 9573c4a4d0dSPeter Maydell objcc=clang 9583c4a4d0dSPeter Maydellelse 9593c4a4d0dSPeter Maydell objcc="$cc" 9603c4a4d0dSPeter Maydellfi 9613c4a4d0dSPeter Maydell 9623457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 9633457a3f8SJuan Quintela EXESUF=".exe" 96417969268SFam Zheng DSOSUF=".dll" 96578e9d4adSStefan Weil # MinGW needs -mthreads for TLS and macro _MT. 96678e9d4adSStefan Weil QEMU_CFLAGS="-mthreads $QEMU_CFLAGS" 967b965e8c5SPaolo Bonzini LIBS="-lwinmm -lws2_32 $LIBS" 96893b25869SJohn Snow write_c_skeleton; 969f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 970f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 971f7cf5d5bSStefan Weil fi 972c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 973683035deSPaolo Bonzini mandir="\${prefix}" 974528ae5b8SEduardo Habkost datadir="\${prefix}" 975850da188SEduardo Habkost qemu_docdir="\${prefix}" 976683035deSPaolo Bonzini bindir="\${prefix}" 977683035deSPaolo Bonzini sysconfdir="\${prefix}" 9785a699bbbSLaszlo Ersek local_statedir= 979683035deSPaolo Bonzini confsuffix="" 980105fad6bSBishara AbuHattoum libs_qga="-lws2_32 -lwinmm -lpowrprof -lwtsapi32 -lwininet -liphlpapi -lnetapi32 $libs_qga" 9813457a3f8SJuan Quintelafi 9823457a3f8SJuan Quintela 983487fefdbSAnthony Liguoriwerror="" 98485aa5189Sbellard 9857d13299dSbellardfor opt do 98689138857SStefan Weil optarg=$(expr "x$opt" : 'x[^=]*=\(.*\)') 9877d13299dSbellard case "$opt" in 9882efc3265Sbellard --help|-h) show_help=yes 9892efc3265Sbellard ;; 99099123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 99199123e13SMike Frysinger ;; 992b1a550a0Spbrook --prefix=*) prefix="$optarg" 9937d13299dSbellard ;; 994b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 99532ce6337Sbellard ;; 996ac0df51dSaliguori --cross-prefix=*) 9977d13299dSbellard ;; 998ac0df51dSaliguori --cc=*) 9997d13299dSbellard ;; 1000b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 100183469015Sbellard ;; 100283f73fceSTomoki Sekiyama --cxx=*) 100383f73fceSTomoki Sekiyama ;; 1004e007dbecSMichael S. Tsirkin --iasl=*) iasl="$optarg" 1005e007dbecSMichael S. Tsirkin ;; 10063c4a4d0dSPeter Maydell --objcc=*) objcc="$optarg" 10073c4a4d0dSPeter Maydell ;; 1008b1a550a0Spbrook --make=*) make="$optarg" 10097d13299dSbellard ;; 10106a882643Spbrook --install=*) install="$optarg" 10116a882643Spbrook ;; 1012c886edfbSBlue Swirl --python=*) python="$optarg" 1013c886edfbSBlue Swirl ;; 10142eb054c2SPeter Maydell --sphinx-build=*) sphinx_build="$optarg" 10152eb054c2SPeter Maydell ;; 10161d728c39SBlue Swirl --gcov=*) gcov_tool="$optarg" 10171d728c39SBlue Swirl ;; 1018e2d8830eSBrad --smbd=*) smbd="$optarg" 1019e2d8830eSBrad ;; 1020e2a2ed06SJuan Quintela --extra-cflags=*) 10217d13299dSbellard ;; 102211cde1c8SBruno Dominguez --extra-cxxflags=*) 102311cde1c8SBruno Dominguez ;; 1024e2a2ed06SJuan Quintela --extra-ldflags=*) 10257d13299dSbellard ;; 10265bc62e01SGerd Hoffmann --enable-debug-info) 10275bc62e01SGerd Hoffmann ;; 10285bc62e01SGerd Hoffmann --disable-debug-info) 10295bc62e01SGerd Hoffmann ;; 1030d75402b5SAlex Bennée --cross-cc-*) 1031d75402b5SAlex Bennée ;; 103217969268SFam Zheng --enable-modules) 103317969268SFam Zheng modules="yes" 103417969268SFam Zheng ;; 10353aa88b31SStefan Hajnoczi --disable-modules) 10363aa88b31SStefan Hajnoczi modules="no" 10373aa88b31SStefan Hajnoczi ;; 1038bd83c861SChristian Ehrhardt --disable-module-upgrades) module_upgrades="no" 1039bd83c861SChristian Ehrhardt ;; 1040bd83c861SChristian Ehrhardt --enable-module-upgrades) module_upgrades="yes" 1041bd83c861SChristian Ehrhardt ;; 10422ff6b91eSJuan Quintela --cpu=*) 10437d13299dSbellard ;; 1044b1a550a0Spbrook --target-list=*) target_list="$optarg" 1045447e133fSAlex Bennée if test "$target_list_exclude"; then 1046447e133fSAlex Bennée error_exit "Can't mix --target-list with --target-list-exclude" 1047447e133fSAlex Bennée fi 1048447e133fSAlex Bennée ;; 1049447e133fSAlex Bennée --target-list-exclude=*) target_list_exclude="$optarg" 1050447e133fSAlex Bennée if test "$target_list"; then 1051447e133fSAlex Bennée error_exit "Can't mix --target-list-exclude with --target-list" 1052447e133fSAlex Bennée fi 1053de83cd02Sbellard ;; 10545b808275SLluís Vilanova --enable-trace-backends=*) trace_backends="$optarg" 10555b808275SLluís Vilanova ;; 10565b808275SLluís Vilanova # XXX: backwards compatibility 10575b808275SLluís Vilanova --enable-trace-backend=*) trace_backends="$optarg" 105894a420b1SStefan Hajnoczi ;; 105974242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 10609410b56cSPrerna Saxena ;; 1061f3494749SPaolo Bonzini --with-default-devices) default_devices="yes" 1062f3494749SPaolo Bonzini ;; 1063f3494749SPaolo Bonzini --without-default-devices) default_devices="no" 1064f3494749SPaolo Bonzini ;; 10657d13299dSbellard --enable-gprof) gprof="yes" 10667d13299dSbellard ;; 10671d728c39SBlue Swirl --enable-gcov) gcov="yes" 10681d728c39SBlue Swirl ;; 106979427693SLoïc Minier --static) 107079427693SLoïc Minier static="yes" 107117884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 107243ce4dfeSbellard ;; 10730b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 10740b24e75fSPaolo Bonzini ;; 10750b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 10760b24e75fSPaolo Bonzini ;; 10773aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 10783aa5d2beSAlon Levy ;; 10798bf188aaSMichael Tokarev --libexecdir=*) libexecdir="$optarg" 10808bf188aaSMichael Tokarev ;; 10810f94d6daSAlon Levy --includedir=*) includedir="$optarg" 10820f94d6daSAlon Levy ;; 1083528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 10840b24e75fSPaolo Bonzini ;; 1085023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 1086023d3d67SEduardo Habkost ;; 1087850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 10880b24e75fSPaolo Bonzini ;; 1089ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 109007381cc1SAnthony Liguori ;; 1091785c23aeSLuiz Capitulino --localstatedir=*) local_statedir="$optarg" 1092785c23aeSLuiz Capitulino ;; 10933d5eecabSGerd Hoffmann --firmwarepath=*) firmwarepath="$optarg" 10943d5eecabSGerd Hoffmann ;; 1095181ce1d0SOlaf Hering --host=*|--build=*|\ 1096181ce1d0SOlaf Hering --disable-dependency-tracking|\ 1097785c23aeSLuiz Capitulino --sbindir=*|--sharedstatedir=*|\ 1098023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 1099023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 1100023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 1101023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 1102023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 1103023ddd74SMax Filippov # lots of directory switches by default. 1104023ddd74SMax Filippov ;; 110597a847bcSbellard --disable-sdl) sdl="no" 110697a847bcSbellard ;; 1107c4198157SJuan Quintela --enable-sdl) sdl="yes" 1108c4198157SJuan Quintela ;; 1109a442fe2fSDaniel P. Berrangé --disable-sdl-image) sdl_image="no" 1110a442fe2fSDaniel P. Berrangé ;; 1111a442fe2fSDaniel P. Berrangé --enable-sdl-image) sdl_image="yes" 1112a442fe2fSDaniel P. Berrangé ;; 11133556c233SPaolo Bonzini --disable-qom-cast-debug) qom_cast_debug="no" 11143556c233SPaolo Bonzini ;; 11153556c233SPaolo Bonzini --enable-qom-cast-debug) qom_cast_debug="yes" 11163556c233SPaolo Bonzini ;; 1117983eef5aSMeador Inge --disable-virtfs) virtfs="no" 1118983eef5aSMeador Inge ;; 1119983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 1120983eef5aSMeador Inge ;; 1121fe8fc5aeSPaolo Bonzini --disable-mpath) mpath="no" 1122fe8fc5aeSPaolo Bonzini ;; 1123fe8fc5aeSPaolo Bonzini --enable-mpath) mpath="yes" 1124fe8fc5aeSPaolo Bonzini ;; 1125821601eaSJes Sorensen --disable-vnc) vnc="no" 1126821601eaSJes Sorensen ;; 1127821601eaSJes Sorensen --enable-vnc) vnc="yes" 1128821601eaSJes Sorensen ;; 11292f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 11302f6a1ab0Sblueswir1 ;; 11310c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 11320c58ac1cSmalc ;; 113389138857SStefan Weil --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') 1134b64ec4e4SFam Zheng ;; 113589138857SStefan Weil --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') 1136eb852011SMarkus Armbruster ;; 1137f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 1138f8393946Saurel32 ;; 1139f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 1140f8393946Saurel32 ;; 1141f3d08ee6SPaul Brook --enable-debug) 1142f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 1143f3d08ee6SPaul Brook debug_tcg="yes" 11441fcc6d42SPeter Xu debug_mutex="yes" 1145f3d08ee6SPaul Brook debug="yes" 1146f3d08ee6SPaul Brook strip_opt="no" 1147b553a042SJohn Snow fortify_source="no" 1148f3d08ee6SPaul Brook ;; 1149247724cbSMarc-André Lureau --enable-sanitizers) sanitizers="yes" 1150247724cbSMarc-André Lureau ;; 1151247724cbSMarc-André Lureau --disable-sanitizers) sanitizers="no" 1152247724cbSMarc-André Lureau ;; 115303b4fe7dSaliguori --enable-sparse) sparse="yes" 115403b4fe7dSaliguori ;; 115503b4fe7dSaliguori --disable-sparse) sparse="no" 115603b4fe7dSaliguori ;; 11571625af87Saliguori --disable-strip) strip_opt="no" 11581625af87Saliguori ;; 11592f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 11602f9606b3Saliguori ;; 1161ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 1162ea784e3bSJuan Quintela ;; 11632f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 11642f6f5c7aSCorentin Chary ;; 11652f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 11662f6f5c7aSCorentin Chary ;; 1167efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 1168efe556adSCorentin Chary ;; 1169efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 1170efe556adSCorentin Chary ;; 1171443f1376Sbellard --disable-slirp) slirp="no" 1172c20709aaSbellard ;; 11737c57bdd8SMarc-André Lureau --enable-slirp=git) slirp="git" 11747c57bdd8SMarc-André Lureau ;; 1175675b9b53SMarc-André Lureau --enable-slirp=system) slirp="system" 1176675b9b53SMarc-André Lureau ;; 1177e0e6c8c0Saliguori --disable-vde) vde="no" 11788a16d273Sths ;; 1179dfb278bdSJuan Quintela --enable-vde) vde="yes" 1180dfb278bdSJuan Quintela ;; 118158952137SVincenzo Maffione --disable-netmap) netmap="no" 118258952137SVincenzo Maffione ;; 118358952137SVincenzo Maffione --enable-netmap) netmap="yes" 118458952137SVincenzo Maffione ;; 1185e37630caSaliguori --disable-xen) xen="no" 1186e37630caSaliguori ;; 1187fc321b4bSJuan Quintela --enable-xen) xen="yes" 1188fc321b4bSJuan Quintela ;; 1189eb6fda0fSAnthony PERARD --disable-xen-pci-passthrough) xen_pci_passthrough="no" 1190eb6fda0fSAnthony PERARD ;; 1191eb6fda0fSAnthony PERARD --enable-xen-pci-passthrough) xen_pci_passthrough="yes" 1192eb6fda0fSAnthony PERARD ;; 11932e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 11942e4d9fb1Saurel32 ;; 11954ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 11964ffcedb6SJuan Quintela ;; 11977ba1e619Saliguori --disable-kvm) kvm="no" 11987ba1e619Saliguori ;; 1199b31a0277SJuan Quintela --enable-kvm) kvm="yes" 1200b31a0277SJuan Quintela ;; 1201b0cb0a66SVincent Palatin --disable-hax) hax="no" 1202180fb750Szhanghailiang ;; 1203b0cb0a66SVincent Palatin --enable-hax) hax="yes" 1204180fb750Szhanghailiang ;; 1205c97d6d2cSSergio Andres Gomez Del Real --disable-hvf) hvf="no" 1206c97d6d2cSSergio Andres Gomez Del Real ;; 1207c97d6d2cSSergio Andres Gomez Del Real --enable-hvf) hvf="yes" 1208c97d6d2cSSergio Andres Gomez Del Real ;; 1209d661d9a4SJustin Terry (VM) --disable-whpx) whpx="no" 1210d661d9a4SJustin Terry (VM) ;; 1211d661d9a4SJustin Terry (VM) --enable-whpx) whpx="yes" 1212d661d9a4SJustin Terry (VM) ;; 12139195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 12149195b2c2SStefan Weil ;; 12159195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 12169195b2c2SStefan Weil ;; 121747e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 121847e98658SCorey Bryant ;; 121947e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 122047e98658SCorey Bryant ;; 1221b3f6ea7eSPaolo Bonzini --disable-tcg) tcg="no" 1222b3f6ea7eSPaolo Bonzini ;; 1223b3f6ea7eSPaolo Bonzini --enable-tcg) tcg="yes" 1224b3f6ea7eSPaolo Bonzini ;; 12255a22ab71SYang Zhong --disable-malloc-trim) malloc_trim="no" 12265a22ab71SYang Zhong ;; 12275a22ab71SYang Zhong --enable-malloc-trim) malloc_trim="yes" 12285a22ab71SYang Zhong ;; 1229cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 1230cd4ec0b4SGerd Hoffmann ;; 1231cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 1232cd4ec0b4SGerd Hoffmann ;; 1233c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 1234c589b249SRonnie Sahlberg ;; 1235c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 1236c589b249SRonnie Sahlberg ;; 12376542aa9cSPeter Lieven --disable-libnfs) libnfs="no" 12386542aa9cSPeter Lieven ;; 12396542aa9cSPeter Lieven --enable-libnfs) libnfs="yes" 12406542aa9cSPeter Lieven ;; 124105c2a3e7Sbellard --enable-profiler) profiler="yes" 124205c2a3e7Sbellard ;; 124314821030SPavel Borzenkov --disable-cocoa) cocoa="no" 124414821030SPavel Borzenkov ;; 1245c2de5c91Smalc --enable-cocoa) 1246c2de5c91Smalc cocoa="yes" ; 124789138857SStefan Weil audio_drv_list="coreaudio $(echo $audio_drv_list | sed s,coreaudio,,g)" 12485b0753e0Sbellard ;; 1249cad25d69Spbrook --disable-system) softmmu="no" 12500a8e90f4Spbrook ;; 1251cad25d69Spbrook --enable-system) softmmu="yes" 12520a8e90f4Spbrook ;; 12530953a80fSZachary Amsden --disable-user) 12540953a80fSZachary Amsden linux_user="no" ; 12550953a80fSZachary Amsden bsd_user="no" ; 12560953a80fSZachary Amsden ;; 12570953a80fSZachary Amsden --enable-user) ;; 1258831b7825Sths --disable-linux-user) linux_user="no" 12590a8e90f4Spbrook ;; 1260831b7825Sths --enable-linux-user) linux_user="yes" 1261831b7825Sths ;; 126284778508Sblueswir1 --disable-bsd-user) bsd_user="no" 126384778508Sblueswir1 ;; 126484778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 126584778508Sblueswir1 ;; 126640d6444eSAvi Kivity --enable-pie) pie="yes" 126734005a00SKirill A. Shutemov ;; 126840d6444eSAvi Kivity --disable-pie) pie="no" 126934005a00SKirill A. Shutemov ;; 127085aa5189Sbellard --enable-werror) werror="yes" 127185aa5189Sbellard ;; 127285aa5189Sbellard --disable-werror) werror="no" 127385aa5189Sbellard ;; 127463678e17SSteven Noonan --enable-stack-protector) stack_protector="yes" 127563678e17SSteven Noonan ;; 127663678e17SSteven Noonan --disable-stack-protector) stack_protector="no" 127763678e17SSteven Noonan ;; 12784d3b6f6eSbalrog --disable-curses) curses="no" 12794d3b6f6eSbalrog ;; 1280c584a6d0SJuan Quintela --enable-curses) curses="yes" 1281c584a6d0SJuan Quintela ;; 1282e08bb301SSamuel Thibault --disable-iconv) iconv="no" 1283e08bb301SSamuel Thibault ;; 1284e08bb301SSamuel Thibault --enable-iconv) iconv="yes" 1285e08bb301SSamuel Thibault ;; 1286769ce76dSAlexander Graf --disable-curl) curl="no" 1287769ce76dSAlexander Graf ;; 1288788c8196SJuan Quintela --enable-curl) curl="yes" 1289788c8196SJuan Quintela ;; 12902df87df7SJuan Quintela --disable-fdt) fdt="no" 12912df87df7SJuan Quintela ;; 12922df87df7SJuan Quintela --enable-fdt) fdt="yes" 12932df87df7SJuan Quintela ;; 12945c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 12955c6c3a6cSChristoph Hellwig ;; 12965c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 12975c6c3a6cSChristoph Hellwig ;; 1298c10dd856SAarushi Mehta --disable-linux-io-uring) linux_io_uring="no" 1299c10dd856SAarushi Mehta ;; 1300c10dd856SAarushi Mehta --enable-linux-io-uring) linux_io_uring="yes" 1301c10dd856SAarushi Mehta ;; 1302758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 1303758e8e38SVenkateswararao Jujjuri (JV) ;; 1304758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 1305758e8e38SVenkateswararao Jujjuri (JV) ;; 1306a40161cbSPaolo Bonzini --disable-membarrier) membarrier="no" 1307a40161cbSPaolo Bonzini ;; 1308a40161cbSPaolo Bonzini --enable-membarrier) membarrier="yes" 1309a40161cbSPaolo Bonzini ;; 131077755340Sths --disable-blobs) blobs="no" 131177755340Sths ;; 13127e563bfbSThomas Huth --with-pkgversion=*) pkgversion="$optarg" 13134a19f1ecSpbrook ;; 1314519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 1315519175a2SAlex Barcelo ;; 131670c60c08SStefan Hajnoczi --disable-coroutine-pool) coroutine_pool="no" 131770c60c08SStefan Hajnoczi ;; 131870c60c08SStefan Hajnoczi --enable-coroutine-pool) coroutine_pool="yes" 131970c60c08SStefan Hajnoczi ;; 13207d992e4dSPeter Lieven --enable-debug-stack-usage) debug_stack_usage="yes" 13217d992e4dSPeter Lieven ;; 1322f0d92b56SLongpeng(Mike) --enable-crypto-afalg) crypto_afalg="yes" 1323f0d92b56SLongpeng(Mike) ;; 1324f0d92b56SLongpeng(Mike) --disable-crypto-afalg) crypto_afalg="no" 1325f0d92b56SLongpeng(Mike) ;; 1326a25dba17SJuan Quintela --disable-docs) docs="no" 132770ec5dc0SAnthony Liguori ;; 1328a25dba17SJuan Quintela --enable-docs) docs="yes" 132983a3ab8bSJuan Quintela ;; 1330d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 1331d5970055SMichael S. Tsirkin ;; 1332d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 1333d5970055SMichael S. Tsirkin ;; 1334042cea27SGonglei --disable-vhost-crypto) vhost_crypto="no" 1335042cea27SGonglei ;; 1336299e6f19SPaolo Bonzini --enable-vhost-crypto) vhost_crypto="yes" 1337042cea27SGonglei ;; 13385e9be92dSNicholas Bellinger --disable-vhost-scsi) vhost_scsi="no" 13395e9be92dSNicholas Bellinger ;; 13405e9be92dSNicholas Bellinger --enable-vhost-scsi) vhost_scsi="yes" 13415e9be92dSNicholas Bellinger ;; 1342fc0b9b0eSStefan Hajnoczi --disable-vhost-vsock) vhost_vsock="no" 1343fc0b9b0eSStefan Hajnoczi ;; 1344fc0b9b0eSStefan Hajnoczi --enable-vhost-vsock) vhost_vsock="yes" 1345fc0b9b0eSStefan Hajnoczi ;; 134698fc1adaSDr. David Alan Gilbert --disable-vhost-user-fs) vhost_user_fs="no" 134798fc1adaSDr. David Alan Gilbert ;; 134898fc1adaSDr. David Alan Gilbert --enable-vhost-user-fs) vhost_user_fs="yes" 134998fc1adaSDr. David Alan Gilbert ;; 1350da076ffeSGerd Hoffmann --disable-opengl) opengl="no" 135120ff075bSMichael Walle ;; 1352da076ffeSGerd Hoffmann --enable-opengl) opengl="yes" 135320ff075bSMichael Walle ;; 1354f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 1355f27aaf4bSChristian Brunner ;; 1356f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 1357f27aaf4bSChristian Brunner ;; 13588c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 13598c84cf11SSergei Trofimovich ;; 13608c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 13618c84cf11SSergei Trofimovich ;; 13627b02f544SMarc-André Lureau --disable-smartcard) smartcard="no" 1363111a38b0SRobert Relyea ;; 13647b02f544SMarc-André Lureau --enable-smartcard) smartcard="yes" 1365111a38b0SRobert Relyea ;; 13662b2325ffSGerd Hoffmann --disable-libusb) libusb="no" 13672b2325ffSGerd Hoffmann ;; 13682b2325ffSGerd Hoffmann --enable-libusb) libusb="yes" 13692b2325ffSGerd Hoffmann ;; 137069354a83SHans de Goede --disable-usb-redir) usb_redir="no" 137169354a83SHans de Goede ;; 137269354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 137369354a83SHans de Goede ;; 13741ece9905SAlon Levy --disable-zlib-test) zlib="no" 13751ece9905SAlon Levy ;; 1376b25c9dffSStefan Weil --disable-lzo) lzo="no" 1377b25c9dffSStefan Weil ;; 1378607dacd0Sqiaonuohan --enable-lzo) lzo="yes" 1379607dacd0Sqiaonuohan ;; 1380b25c9dffSStefan Weil --disable-snappy) snappy="no" 1381b25c9dffSStefan Weil ;; 1382607dacd0Sqiaonuohan --enable-snappy) snappy="yes" 1383607dacd0Sqiaonuohan ;; 13846b383c08SPeter Wu --disable-bzip2) bzip2="no" 13856b383c08SPeter Wu ;; 13866b383c08SPeter Wu --enable-bzip2) bzip2="yes" 13876b383c08SPeter Wu ;; 138883bc1f97SJulio Faracco --enable-lzfse) lzfse="yes" 138983bc1f97SJulio Faracco ;; 139083bc1f97SJulio Faracco --disable-lzfse) lzfse="no" 139183bc1f97SJulio Faracco ;; 13923a678481SJuan Quintela --disable-zstd) zstd="no" 13933a678481SJuan Quintela ;; 13943a678481SJuan Quintela --enable-zstd) zstd="yes" 13953a678481SJuan Quintela ;; 1396d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 1397d138cee9SMichael Roth ;; 1398d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 1399d138cee9SMichael Roth ;; 14009dacf32dSYossi Hindin --enable-guest-agent-msi) guest_agent_msi="yes" 14019dacf32dSYossi Hindin ;; 14029dacf32dSYossi Hindin --disable-guest-agent-msi) guest_agent_msi="no" 14039dacf32dSYossi Hindin ;; 1404d9840e25STomoki Sekiyama --with-vss-sdk) vss_win32_sdk="" 1405d9840e25STomoki Sekiyama ;; 1406d9840e25STomoki Sekiyama --with-vss-sdk=*) vss_win32_sdk="$optarg" 1407d9840e25STomoki Sekiyama ;; 1408d9840e25STomoki Sekiyama --without-vss-sdk) vss_win32_sdk="no" 1409d9840e25STomoki Sekiyama ;; 1410d9840e25STomoki Sekiyama --with-win-sdk) win_sdk="" 1411d9840e25STomoki Sekiyama ;; 1412d9840e25STomoki Sekiyama --with-win-sdk=*) win_sdk="$optarg" 1413d9840e25STomoki Sekiyama ;; 1414d9840e25STomoki Sekiyama --without-win-sdk) win_sdk="no" 1415d9840e25STomoki Sekiyama ;; 14164b1c11fdSDaniel P. Berrange --enable-tools) want_tools="yes" 14174b1c11fdSDaniel P. Berrange ;; 14184b1c11fdSDaniel P. Berrange --disable-tools) want_tools="no" 14194b1c11fdSDaniel P. Berrange ;; 1420f794573eSEduardo Otubo --enable-seccomp) seccomp="yes" 1421f794573eSEduardo Otubo ;; 1422f794573eSEduardo Otubo --disable-seccomp) seccomp="no" 1423f794573eSEduardo Otubo ;; 1424eb100396SBharata B Rao --disable-glusterfs) glusterfs="no" 1425eb100396SBharata B Rao ;; 142686583a07SLiam Merwick --disable-avx2) avx2_opt="no" 142786583a07SLiam Merwick ;; 142886583a07SLiam Merwick --enable-avx2) avx2_opt="yes" 142986583a07SLiam Merwick ;; 14306b8cd447SRobert Hoo --disable-avx512f) avx512f_opt="no" 14316b8cd447SRobert Hoo ;; 14326b8cd447SRobert Hoo --enable-avx512f) avx512f_opt="yes" 14336b8cd447SRobert Hoo ;; 14346b8cd447SRobert Hoo 1435eb100396SBharata B Rao --enable-glusterfs) glusterfs="yes" 1436eb100396SBharata B Rao ;; 143752b53c04SFam Zheng --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) 143852b53c04SFam Zheng echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 1439583f6e7bSStefan Hajnoczi ;; 1440cb6414dfSFam Zheng --enable-vhdx|--disable-vhdx) 1441cb6414dfSFam Zheng echo "$0: $opt is obsolete, VHDX driver is always built" >&2 1442cb6414dfSFam Zheng ;; 1443315d3184SFam Zheng --enable-uuid|--disable-uuid) 1444315d3184SFam Zheng echo "$0: $opt is obsolete, UUID support is always built" >&2 1445315d3184SFam Zheng ;; 1446a4ccabcfSAnthony Liguori --disable-gtk) gtk="no" 1447a4ccabcfSAnthony Liguori ;; 1448a4ccabcfSAnthony Liguori --enable-gtk) gtk="yes" 1449a4ccabcfSAnthony Liguori ;; 1450a1c5e949SDaniel P. Berrange --tls-priority=*) tls_priority="$optarg" 1451a1c5e949SDaniel P. Berrange ;; 1452ddbb0d09SDaniel P. Berrange --disable-gnutls) gnutls="no" 1453ddbb0d09SDaniel P. Berrange ;; 1454ddbb0d09SDaniel P. Berrange --enable-gnutls) gnutls="yes" 1455ddbb0d09SDaniel P. Berrange ;; 145691bfcdb0SDaniel P. Berrange --disable-nettle) nettle="no" 145791bfcdb0SDaniel P. Berrange ;; 145891bfcdb0SDaniel P. Berrange --enable-nettle) nettle="yes" 145991bfcdb0SDaniel P. Berrange ;; 146091bfcdb0SDaniel P. Berrange --disable-gcrypt) gcrypt="no" 146191bfcdb0SDaniel P. Berrange ;; 146291bfcdb0SDaniel P. Berrange --enable-gcrypt) gcrypt="yes" 146391bfcdb0SDaniel P. Berrange ;; 14648953caf3SDaniel P. Berrange --disable-auth-pam) auth_pam="no" 14658953caf3SDaniel P. Berrange ;; 14668953caf3SDaniel P. Berrange --enable-auth-pam) auth_pam="yes" 14678953caf3SDaniel P. Berrange ;; 14682da776dbSMichael R. Hines --enable-rdma) rdma="yes" 14692da776dbSMichael R. Hines ;; 14702da776dbSMichael R. Hines --disable-rdma) rdma="no" 14712da776dbSMichael R. Hines ;; 147221ab34c9SMarcel Apfelbaum --enable-pvrdma) pvrdma="yes" 147321ab34c9SMarcel Apfelbaum ;; 147421ab34c9SMarcel Apfelbaum --disable-pvrdma) pvrdma="no" 147521ab34c9SMarcel Apfelbaum ;; 1476bbbf9bfbSStefan Weil --disable-vte) vte="no" 1477bbbf9bfbSStefan Weil ;; 1478bbbf9bfbSStefan Weil --enable-vte) vte="yes" 1479bbbf9bfbSStefan Weil ;; 14809d9e1521SGerd Hoffmann --disable-virglrenderer) virglrenderer="no" 14819d9e1521SGerd Hoffmann ;; 14829d9e1521SGerd Hoffmann --enable-virglrenderer) virglrenderer="yes" 14839d9e1521SGerd Hoffmann ;; 1484e91c793cSCole Robinson --disable-tpm) tpm="no" 1485e91c793cSCole Robinson ;; 1486ab214c29SStefan Berger --enable-tpm) tpm="yes" 1487ab214c29SStefan Berger ;; 1488b10d49d7SPino Toscano --disable-libssh) libssh="no" 14890a12ec87SRichard W.M. Jones ;; 1490b10d49d7SPino Toscano --enable-libssh) libssh="yes" 14910a12ec87SRichard W.M. Jones ;; 1492ed1701c6SDr. David Alan Gilbert --disable-live-block-migration) live_block_migration="no" 1493ed1701c6SDr. David Alan Gilbert ;; 1494ed1701c6SDr. David Alan Gilbert --enable-live-block-migration) live_block_migration="yes" 1495ed1701c6SDr. David Alan Gilbert ;; 1496a99d57bbSWanlong Gao --disable-numa) numa="no" 1497a99d57bbSWanlong Gao ;; 1498a99d57bbSWanlong Gao --enable-numa) numa="yes" 1499a99d57bbSWanlong Gao ;; 1500ed279a06SKlim Kireev --disable-libxml2) libxml2="no" 1501ed279a06SKlim Kireev ;; 1502ed279a06SKlim Kireev --enable-libxml2) libxml2="yes" 1503ed279a06SKlim Kireev ;; 15042847b469SFam Zheng --disable-tcmalloc) tcmalloc="no" 15052847b469SFam Zheng ;; 15062847b469SFam Zheng --enable-tcmalloc) tcmalloc="yes" 15072847b469SFam Zheng ;; 15087b01cb97SAlexandre Derumier --disable-jemalloc) jemalloc="no" 15097b01cb97SAlexandre Derumier ;; 15107b01cb97SAlexandre Derumier --enable-jemalloc) jemalloc="yes" 15117b01cb97SAlexandre Derumier ;; 1512a6b1d4c0SChanglong Xie --disable-replication) replication="no" 1513a6b1d4c0SChanglong Xie ;; 1514a6b1d4c0SChanglong Xie --enable-replication) replication="yes" 1515a6b1d4c0SChanglong Xie ;; 1516da92c3ffSAshish Mittal --disable-vxhs) vxhs="no" 1517da92c3ffSAshish Mittal ;; 1518da92c3ffSAshish Mittal --enable-vxhs) vxhs="yes" 1519da92c3ffSAshish Mittal ;; 15202f740136SJeff Cody --disable-bochs) bochs="no" 15212f740136SJeff Cody ;; 15222f740136SJeff Cody --enable-bochs) bochs="yes" 15232f740136SJeff Cody ;; 15242f740136SJeff Cody --disable-cloop) cloop="no" 15252f740136SJeff Cody ;; 15262f740136SJeff Cody --enable-cloop) cloop="yes" 15272f740136SJeff Cody ;; 15282f740136SJeff Cody --disable-dmg) dmg="no" 15292f740136SJeff Cody ;; 15302f740136SJeff Cody --enable-dmg) dmg="yes" 15312f740136SJeff Cody ;; 15322f740136SJeff Cody --disable-qcow1) qcow1="no" 15332f740136SJeff Cody ;; 15342f740136SJeff Cody --enable-qcow1) qcow1="yes" 15352f740136SJeff Cody ;; 15362f740136SJeff Cody --disable-vdi) vdi="no" 15372f740136SJeff Cody ;; 15382f740136SJeff Cody --enable-vdi) vdi="yes" 15392f740136SJeff Cody ;; 15402f740136SJeff Cody --disable-vvfat) vvfat="no" 15412f740136SJeff Cody ;; 15422f740136SJeff Cody --enable-vvfat) vvfat="yes" 15432f740136SJeff Cody ;; 15442f740136SJeff Cody --disable-qed) qed="no" 15452f740136SJeff Cody ;; 15462f740136SJeff Cody --enable-qed) qed="yes" 15472f740136SJeff Cody ;; 15482f740136SJeff Cody --disable-parallels) parallels="no" 15492f740136SJeff Cody ;; 15502f740136SJeff Cody --enable-parallels) parallels="yes" 15512f740136SJeff Cody ;; 15522f740136SJeff Cody --disable-sheepdog) sheepdog="no" 15532f740136SJeff Cody ;; 15542f740136SJeff Cody --enable-sheepdog) sheepdog="yes" 15552f740136SJeff Cody ;; 1556e6a74868SMarc-André Lureau --disable-vhost-user) vhost_user="no" 1557e6a74868SMarc-André Lureau ;; 1558299e6f19SPaolo Bonzini --enable-vhost-user) vhost_user="yes" 1559299e6f19SPaolo Bonzini ;; 1560299e6f19SPaolo Bonzini --disable-vhost-kernel) vhost_kernel="no" 1561299e6f19SPaolo Bonzini ;; 1562299e6f19SPaolo Bonzini --enable-vhost-kernel) vhost_kernel="yes" 1563e6a74868SMarc-André Lureau ;; 15648ca80760SRichard Henderson --disable-capstone) capstone="no" 15658ca80760SRichard Henderson ;; 15668ca80760SRichard Henderson --enable-capstone) capstone="yes" 15678ca80760SRichard Henderson ;; 1568e219c499SRichard Henderson --enable-capstone=git) capstone="git" 1569e219c499SRichard Henderson ;; 1570e219c499SRichard Henderson --enable-capstone=system) capstone="system" 1571e219c499SRichard Henderson ;; 1572cc84d63aSDaniel P. Berrange --with-git=*) git="$optarg" 1573cc84d63aSDaniel P. Berrange ;; 1574f62bbee5SDaniel P. Berrange --enable-git-update) git_update=yes 1575f62bbee5SDaniel P. Berrange ;; 1576f62bbee5SDaniel P. Berrange --disable-git-update) git_update=no 1577f62bbee5SDaniel P. Berrange ;; 1578ba59fb77SPaolo Bonzini --enable-debug-mutex) debug_mutex=yes 1579ba59fb77SPaolo Bonzini ;; 1580ba59fb77SPaolo Bonzini --disable-debug-mutex) debug_mutex=no 1581ba59fb77SPaolo Bonzini ;; 158217824406SJunyan He --enable-libpmem) libpmem=yes 158317824406SJunyan He ;; 158417824406SJunyan He --disable-libpmem) libpmem=no 158517824406SJunyan He ;; 158675411919SJames Le Cuirot --enable-xkbcommon) xkbcommon=yes 158775411919SJames Le Cuirot ;; 158875411919SJames Le Cuirot --disable-xkbcommon) xkbcommon=no 158975411919SJames Le Cuirot ;; 159040e8c6f4SAlex Bennée --enable-plugins) plugins="yes" 159140e8c6f4SAlex Bennée ;; 159240e8c6f4SAlex Bennée --disable-plugins) plugins="no" 159340e8c6f4SAlex Bennée ;; 1594afc3a8f9SAlex Bennée --enable-containers) use_containers="yes" 1595afc3a8f9SAlex Bennée ;; 1596afc3a8f9SAlex Bennée --disable-containers) use_containers="no" 1597afc3a8f9SAlex Bennée ;; 1598adc28027SAlexander Bulekov --enable-fuzzing) fuzzing=yes 1599adc28027SAlexander Bulekov ;; 1600adc28027SAlexander Bulekov --disable-fuzzing) fuzzing=no 1601adc28027SAlexander Bulekov ;; 1602f48e590aSAlex Bennée --gdb=*) gdb_bin="$optarg" 1603f48e590aSAlex Bennée ;; 16042d2ad6d0SFam Zheng *) 16052d2ad6d0SFam Zheng echo "ERROR: unknown option $opt" 16062d2ad6d0SFam Zheng echo "Try '$0 --help' for more information" 16072d2ad6d0SFam Zheng exit 1 16087f1559c6Sbalrog ;; 16097d13299dSbellard esac 16107d13299dSbellarddone 16117d13299dSbellard 161240293e58Sbellardcase "$cpu" in 1613e3608d66SRichard Henderson ppc) 1614e3608d66SRichard Henderson CPU_CFLAGS="-m32" 1615db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m32 $QEMU_LDFLAGS" 1616e3608d66SRichard Henderson ;; 1617e3608d66SRichard Henderson ppc64) 1618e3608d66SRichard Henderson CPU_CFLAGS="-m64" 1619db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" 1620e3608d66SRichard Henderson ;; 16219b9c37c3SRichard Henderson sparc) 1622f1079bb8SRichard Henderson CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" 1623db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m32 -mv8plus $QEMU_LDFLAGS" 16243142255cSblueswir1 ;; 1625ed968ff1SJuan Quintela sparc64) 162679f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -mcpu=ultrasparc" 1627db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" 16283142255cSblueswir1 ;; 162976d83bdeSths s390) 1630061cdd81SRichard Henderson CPU_CFLAGS="-m31" 1631db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m31 $QEMU_LDFLAGS" 163228d7cc49SRichard Henderson ;; 163328d7cc49SRichard Henderson s390x) 1634061cdd81SRichard Henderson CPU_CFLAGS="-m64" 1635db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" 163676d83bdeSths ;; 163740293e58Sbellard i386) 163879f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32" 1639db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m32 $QEMU_LDFLAGS" 164040293e58Sbellard ;; 164140293e58Sbellard x86_64) 16427ebee43eSRichard Henderson # ??? Only extremely old AMD cpus do not have cmpxchg16b. 16437ebee43eSRichard Henderson # If we truly care, we should simply detect this case at 16447ebee43eSRichard Henderson # runtime and generate the fallback to serial emulation. 16457ebee43eSRichard Henderson CPU_CFLAGS="-m64 -mcx16" 1646db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-m64 $QEMU_LDFLAGS" 1647379f6698SPaul Brook ;; 1648c72b26ecSRichard Henderson x32) 1649c72b26ecSRichard Henderson CPU_CFLAGS="-mx32" 1650db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-mx32 $QEMU_LDFLAGS" 1651c72b26ecSRichard Henderson ;; 165230163d89SPeter Maydell # No special flags required for other host CPUs 16533142255cSblueswir1esac 16543142255cSblueswir1 16552038f8c8SPaolo Bonzinieval "cross_cc_${cpu}=\$host_cc" 16562038f8c8SPaolo Bonzinicross_cc_vars="$cross_cc_vars cross_cc_${cpu}" 165779f3b12fSPeter CrosthwaiteQEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" 165879f3b12fSPeter Crosthwaite 1659affc88ccSPeter Maydell# For user-mode emulation the host arch has to be one we explicitly 1660affc88ccSPeter Maydell# support, even if we're using TCI. 1661affc88ccSPeter Maydellif [ "$ARCH" = "unknown" ]; then 1662affc88ccSPeter Maydell bsd_user="no" 1663affc88ccSPeter Maydell linux_user="no" 1664affc88ccSPeter Maydellfi 1665affc88ccSPeter Maydell 1666*1cf295beSPhilippe Mathieu-Daudéif [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then 1667*1cf295beSPhilippe Mathieu-Daudé tcg="no" 1668*1cf295beSPhilippe Mathieu-Daudéfi 1669*1cf295beSPhilippe Mathieu-Daudé 167060e0df25SPeter Maydelldefault_target_list="" 167160e0df25SPeter Maydell 16726e92f823SPeter Maydellmak_wilds="" 16736e92f823SPeter Maydell 167460e0df25SPeter Maydellif [ "$softmmu" = "yes" ]; then 16756e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" 167660e0df25SPeter Maydellfi 167760e0df25SPeter Maydellif [ "$linux_user" = "yes" ]; then 16786e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" 167960e0df25SPeter Maydellfi 168060e0df25SPeter Maydellif [ "$bsd_user" = "yes" ]; then 16816e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" 168260e0df25SPeter Maydellfi 168360e0df25SPeter Maydell 1684447e133fSAlex Bennéeif test -z "$target_list_exclude"; then 16856e92f823SPeter Maydell for config in $mak_wilds; do 16866e92f823SPeter Maydell default_target_list="${default_target_list} $(basename "$config" .mak)" 16876e92f823SPeter Maydell done 1688447e133fSAlex Bennéeelse 1689447e133fSAlex Bennée exclude_list=$(echo "$target_list_exclude" | sed -e 's/,/ /g') 1690447e133fSAlex Bennée for config in $mak_wilds; do 1691447e133fSAlex Bennée target="$(basename "$config" .mak)" 1692447e133fSAlex Bennée exclude="no" 1693447e133fSAlex Bennée for excl in $exclude_list; do 1694447e133fSAlex Bennée if test "$excl" = "$target"; then 1695447e133fSAlex Bennée exclude="yes" 1696447e133fSAlex Bennée break; 1697447e133fSAlex Bennée fi 1698447e133fSAlex Bennée done 1699447e133fSAlex Bennée if test "$exclude" = "no"; then 1700447e133fSAlex Bennée default_target_list="${default_target_list} $target" 1701447e133fSAlex Bennée fi 1702447e133fSAlex Bennée done 1703447e133fSAlex Bennéefi 17046e92f823SPeter Maydell 1705c53eeaf7SStefan Hajnoczi# Enumerate public trace backends for --help output 170664a6047dSGreg Kurztrace_backend_list=$(echo $(grep -le '^PUBLIC = True$' "$source_path"/scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/')) 1707c53eeaf7SStefan Hajnoczi 1708af5db58eSpbrookif test x"$show_help" = x"yes" ; then 1709af5db58eSpbrookcat << EOF 1710af5db58eSpbrook 1711af5db58eSpbrookUsage: configure [options] 1712af5db58eSpbrookOptions: [defaults in brackets after descriptions] 1713af5db58eSpbrook 171408fb77edSStefan WeilStandard options: 171508fb77edSStefan Weil --help print this message 171608fb77edSStefan Weil --prefix=PREFIX install in PREFIX [$prefix] 171708fb77edSStefan Weil --interp-prefix=PREFIX where to find shared libraries, etc. 171808fb77edSStefan Weil use %M for cpu name [$interp_prefix] 171908fb77edSStefan Weil --target-list=LIST set target list (default: build everything) 172008fb77edSStefan Weil$(echo Available targets: $default_target_list | \ 172108fb77edSStefan Weil fold -s -w 53 | sed -e 's/^/ /') 1722447e133fSAlex Bennée --target-list-exclude=LIST exclude a set of targets from the default target-list 172308fb77edSStefan Weil 172408fb77edSStefan WeilAdvanced options (experts only): 172508fb77edSStefan Weil --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] 172608fb77edSStefan Weil --cc=CC use C compiler CC [$cc] 172708fb77edSStefan Weil --iasl=IASL use ACPI compiler IASL [$iasl] 172808fb77edSStefan Weil --host-cc=CC use C compiler CC [$host_cc] for code run at 172908fb77edSStefan Weil build time 173008fb77edSStefan Weil --cxx=CXX use C++ compiler CXX [$cxx] 173108fb77edSStefan Weil --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] 173208fb77edSStefan Weil --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS 173311cde1c8SBruno Dominguez --extra-cxxflags=CXXFLAGS append extra C++ compiler flags QEMU_CXXFLAGS 173408fb77edSStefan Weil --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS 1735d75402b5SAlex Bennée --cross-cc-ARCH=CC use compiler when building ARCH guest test cases 1736d422b2bcSAlex Bennée --cross-cc-flags-ARCH= use compiler flags when building ARCH guest tests 173708fb77edSStefan Weil --make=MAKE use specified make [$make] 173808fb77edSStefan Weil --install=INSTALL use specified install [$install] 173908fb77edSStefan Weil --python=PYTHON use specified python [$python] 17402eb054c2SPeter Maydell --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build] 174108fb77edSStefan Weil --smbd=SMBD use specified smbd [$smbd] 1742db1b5f13SThomas Huth --with-git=GIT use specified git [$git] 174308fb77edSStefan Weil --static enable static build [$static] 174408fb77edSStefan Weil --mandir=PATH install man pages in PATH 174508fb77edSStefan Weil --datadir=PATH install firmware in PATH$confsuffix 174608fb77edSStefan Weil --docdir=PATH install documentation in PATH$confsuffix 174708fb77edSStefan Weil --bindir=PATH install binaries in PATH 174808fb77edSStefan Weil --libdir=PATH install libraries in PATH 1749db1b5f13SThomas Huth --libexecdir=PATH install helper binaries in PATH 175008fb77edSStefan Weil --sysconfdir=PATH install config in PATH$confsuffix 175108fb77edSStefan Weil --localstatedir=PATH install local state in PATH (set at runtime on win32) 17523d5eecabSGerd Hoffmann --firmwarepath=PATH search PATH for firmware files 1753e26110cfSFam Zheng --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] 1754db1b5f13SThomas Huth --with-pkgversion=VERS use specified string as sub-version of the package 175508fb77edSStefan Weil --enable-debug enable common debug build options 1756247724cbSMarc-André Lureau --enable-sanitizers enable default sanitizers 175708fb77edSStefan Weil --disable-strip disable stripping binaries 175808fb77edSStefan Weil --disable-werror disable compilation abort on warning 175963678e17SSteven Noonan --disable-stack-protector disable compiler-provided stack protection 176008fb77edSStefan Weil --audio-drv-list=LIST set audio drivers list: 176108fb77edSStefan Weil Available drivers: $audio_possible_drivers 176208fb77edSStefan Weil --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L 176308fb77edSStefan Weil --block-drv-rw-whitelist=L 176408fb77edSStefan Weil set block driver read-write whitelist 176508fb77edSStefan Weil (affects only QEMU, not qemu-img) 176608fb77edSStefan Weil --block-drv-ro-whitelist=L 176708fb77edSStefan Weil set block driver read-only whitelist 176808fb77edSStefan Weil (affects only QEMU, not qemu-img) 17695b808275SLluís Vilanova --enable-trace-backends=B Set trace backend 1770c53eeaf7SStefan Hajnoczi Available backends: $trace_backend_list 177108fb77edSStefan Weil --with-trace-file=NAME Full PATH,NAME of file to store traces 177208fb77edSStefan Weil Default:trace-<pid> 1773c23f23b9SMichael Tokarev --disable-slirp disable SLIRP userspace network connectivity 1774c23f23b9SMichael Tokarev --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) 17755a22ab71SYang Zhong --enable-malloc-trim enable libc malloc_trim() for memory optimization 1776c23f23b9SMichael Tokarev --oss-lib path to OSS library 1777c23f23b9SMichael Tokarev --cpu=CPU Build for host CPU [$cpu] 177808fb77edSStefan Weil --with-coroutine=BACKEND coroutine backend. Supported options: 177933c53c54SDaniel P. Berrange ucontext, sigaltstack, windows 178008fb77edSStefan Weil --enable-gcov enable test coverage analysis with gcov 178108fb77edSStefan Weil --gcov=GCOV use specified gcov [$gcov_tool] 1782c23f23b9SMichael Tokarev --disable-blobs disable installing provided firmware blobs 1783c23f23b9SMichael Tokarev --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent 1784c23f23b9SMichael Tokarev --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) 1785a1c5e949SDaniel P. Berrange --tls-priority default TLS protocol/cipher priority string 1786c12d66aaSLin Ma --enable-gprof QEMU profiling with gprof 1787c12d66aaSLin Ma --enable-profiler profiler support 1788c12d66aaSLin Ma --enable-debug-stack-usage 1789c12d66aaSLin Ma track the maximum stack usage of stacks created by qemu_alloc_stack 179040e8c6f4SAlex Bennée --enable-plugins 179140e8c6f4SAlex Bennée enable plugins via shared library loading 1792afc3a8f9SAlex Bennée --disable-containers don't use containers for cross-building 1793f48e590aSAlex Bennée --gdb=GDB-path gdb to use for gdbstub tests [$gdb_bin] 1794c23f23b9SMichael Tokarev 1795c23f23b9SMichael TokarevOptional features, enabled with --enable-FEATURE and 1796c23f23b9SMichael Tokarevdisabled with --disable-FEATURE, default is enabled if available: 1797c23f23b9SMichael Tokarev 1798c23f23b9SMichael Tokarev system all system emulation targets 1799c23f23b9SMichael Tokarev user supported user emulation targets 1800c23f23b9SMichael Tokarev linux-user all linux usermode emulation targets 1801c23f23b9SMichael Tokarev bsd-user all BSD usermode emulation targets 1802c23f23b9SMichael Tokarev docs build documentation 1803c23f23b9SMichael Tokarev guest-agent build the QEMU Guest Agent 1804c23f23b9SMichael Tokarev guest-agent-msi build guest agent Windows MSI installation package 1805c23f23b9SMichael Tokarev pie Position Independent Executables 180621e709aaSMarc-André Lureau modules modules support (non-Windows) 1807bd83c861SChristian Ehrhardt module-upgrades try to load modules from alternate paths for upgrades 1808c23f23b9SMichael Tokarev debug-tcg TCG debugging (default is disabled) 1809c23f23b9SMichael Tokarev debug-info debugging information 1810c23f23b9SMichael Tokarev sparse sparse checker 1811c23f23b9SMichael Tokarev 1812ddbb0d09SDaniel P. Berrange gnutls GNUTLS cryptography support 181391bfcdb0SDaniel P. Berrange nettle nettle cryptography support 181491bfcdb0SDaniel P. Berrange gcrypt libgcrypt cryptography support 18158953caf3SDaniel P. Berrange auth-pam PAM access control 1816c23f23b9SMichael Tokarev sdl SDL UI 181704c6e16fSMarkus Armbruster sdl-image SDL Image support for icons 1818c23f23b9SMichael Tokarev gtk gtk UI 1819c23f23b9SMichael Tokarev vte vte support for the gtk UI 1820c23f23b9SMichael Tokarev curses curses UI 1821e08bb301SSamuel Thibault iconv font glyph conversion support 1822c23f23b9SMichael Tokarev vnc VNC UI support 1823c23f23b9SMichael Tokarev vnc-sasl SASL encryption for VNC server 1824c23f23b9SMichael Tokarev vnc-jpeg JPEG lossy compression for VNC server 1825c23f23b9SMichael Tokarev vnc-png PNG compression for VNC server 1826c23f23b9SMichael Tokarev cocoa Cocoa UI (Mac OS X only) 1827c23f23b9SMichael Tokarev virtfs VirtFS 1828fe8fc5aeSPaolo Bonzini mpath Multipath persistent reservation passthrough 1829c23f23b9SMichael Tokarev xen xen backend driver support 183070c292afSAnthony PERARD xen-pci-passthrough PCI passthrough support for Xen 1831c23f23b9SMichael Tokarev brlapi BrlAPI (Braile) 1832c23f23b9SMichael Tokarev curl curl connectivity 1833a40161cbSPaolo Bonzini membarrier membarrier system call (for Linux 4.14+ or Windows) 1834c23f23b9SMichael Tokarev fdt fdt device tree 1835c23f23b9SMichael Tokarev kvm KVM acceleration support 1836b0cb0a66SVincent Palatin hax HAX acceleration support 1837c97d6d2cSSergio Andres Gomez Del Real hvf Hypervisor.framework acceleration support 1838d661d9a4SJustin Terry (VM) whpx Windows Hypervisor Platform acceleration support 183921ab34c9SMarcel Apfelbaum rdma Enable RDMA-based migration 184021ab34c9SMarcel Apfelbaum pvrdma Enable PVRDMA support 1841c23f23b9SMichael Tokarev vde support for vde network 1842c23f23b9SMichael Tokarev netmap support for netmap network 1843c23f23b9SMichael Tokarev linux-aio Linux AIO support 1844c10dd856SAarushi Mehta linux-io-uring Linux io_uring support 1845c23f23b9SMichael Tokarev cap-ng libcap-ng support 1846c23f23b9SMichael Tokarev attr attr and xattr support 1847299e6f19SPaolo Bonzini vhost-net vhost-net kernel acceleration support 1848299e6f19SPaolo Bonzini vhost-vsock virtio sockets device support 1849299e6f19SPaolo Bonzini vhost-scsi vhost-scsi kernel target support 1850299e6f19SPaolo Bonzini vhost-crypto vhost-user-crypto backend support 1851299e6f19SPaolo Bonzini vhost-kernel vhost kernel backend support 1852299e6f19SPaolo Bonzini vhost-user vhost-user backend support 1853c23f23b9SMichael Tokarev spice spice 1854c23f23b9SMichael Tokarev rbd rados block device (rbd) 1855c23f23b9SMichael Tokarev libiscsi iscsi support 1856c23f23b9SMichael Tokarev libnfs nfs support 18577b02f544SMarc-André Lureau smartcard smartcard support (libcacard) 1858c23f23b9SMichael Tokarev libusb libusb (for usb passthrough) 1859ed1701c6SDr. David Alan Gilbert live-block-migration Block migration in the main migration stream 1860c23f23b9SMichael Tokarev usb-redir usb network redirection support 1861c23f23b9SMichael Tokarev lzo support of lzo compression library 1862c23f23b9SMichael Tokarev snappy support of snappy compression library 1863c23f23b9SMichael Tokarev bzip2 support of bzip2 compression library 1864c23f23b9SMichael Tokarev (for reading bzip2-compressed dmg images) 186583bc1f97SJulio Faracco lzfse support of lzfse compression library 186683bc1f97SJulio Faracco (for reading lzfse-compressed dmg images) 18673a678481SJuan Quintela zstd support for zstd compression library 1868d298ac10SDenis Plotnikov (for migration compression and qcow2 cluster compression) 1869c23f23b9SMichael Tokarev seccomp seccomp support 1870c23f23b9SMichael Tokarev coroutine-pool coroutine freelist (better performance) 1871c23f23b9SMichael Tokarev glusterfs GlusterFS backend 1872c23f23b9SMichael Tokarev tpm TPM support 1873b10d49d7SPino Toscano libssh ssh block device support 1874c23f23b9SMichael Tokarev numa libnuma support 1875ed279a06SKlim Kireev libxml2 for Parallels image format 1876c23f23b9SMichael Tokarev tcmalloc tcmalloc support 18777b01cb97SAlexandre Derumier jemalloc jemalloc support 187886583a07SLiam Merwick avx2 AVX2 optimization support 18796b8cd447SRobert Hoo avx512f AVX512F optimization support 1880a6b1d4c0SChanglong Xie replication replication support 1881c12d66aaSLin Ma opengl opengl support 1882c12d66aaSLin Ma virglrenderer virgl rendering support 1883c12d66aaSLin Ma xfsctl xfsctl support 1884c12d66aaSLin Ma qom-cast-debug cast debugging support 18858de73fa8SCleber Rosa tools build qemu-io, qemu-nbd and qemu-img tools 1886da92c3ffSAshish Mittal vxhs Veritas HyperScale vDisk backend support 18872f740136SJeff Cody bochs bochs image format support 18882f740136SJeff Cody cloop cloop image format support 18892f740136SJeff Cody dmg dmg image format support 18902f740136SJeff Cody qcow1 qcow v1 image format support 18912f740136SJeff Cody vdi vdi image format support 18922f740136SJeff Cody vvfat vvfat image format support 18932f740136SJeff Cody qed qed image format support 18942f740136SJeff Cody parallels parallels image format support 18952f740136SJeff Cody sheepdog sheepdog block driver support 1896f0d92b56SLongpeng(Mike) crypto-afalg Linux AF_ALG crypto backend driver 18978ca80760SRichard Henderson capstone capstone disassembler support 1898ba59fb77SPaolo Bonzini debug-mutex mutex debugging support 189917824406SJunyan He libpmem libpmem support 190075411919SJames Le Cuirot xkbcommon xkbcommon support 190108fb77edSStefan Weil 190208fb77edSStefan WeilNOTE: The object files are built at the place where configure is launched 1903af5db58eSpbrookEOF 19042d2ad6d0SFam Zhengexit 0 1905af5db58eSpbrookfi 1906af5db58eSpbrook 19079c790242SThomas Huth# Remove old dependency files to make sure that they get properly regenerated 1908bb768f71SThomas Huthrm -f */config-devices.mak.d 19099c790242SThomas Huth 19104d6a835dSLaurent Vivier# Remove syscall_nr.h to be sure they will be regenerated in the build 19114d6a835dSLaurent Vivier# directory, not in the source directory 1912bb0cdc03SLaurent Vivierfor arch in alpha hppa m68k xtensa sh4 microblaze arm ppc s390x sparc sparc64 \ 1913686a0fe4SLaurent Vivier i386 x86_64 mips mips64 ; do 19144d6a835dSLaurent Vivier # remove the file if it has been generated in the source directory 19154d6a835dSLaurent Vivier rm -f "${source_path}/linux-user/${arch}/syscall_nr.h" 19164d6a835dSLaurent Vivier # remove the dependency files 191791e5998fSLaurent Vivier for target in ${arch}*-linux-user ; do 191891e5998fSLaurent Vivier test -d "${target}" && find "${target}" -type f -name "*.d" \ 19194d6a835dSLaurent Vivier -exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \ 192091e5998fSLaurent Vivier -print | while read file ; do rm "${file}" "${file%.d}.o" ; done 192191e5998fSLaurent Vivier done 19224d6a835dSLaurent Vivierdone 19234d6a835dSLaurent Vivier 1924faf44142SDaniel P. Berrangéif test -z "$python" 1925faf44142SDaniel P. Berrangéthen 1926c53eeaf7SStefan Hajnoczi error_exit "Python not found. Use --python=/path/to/python" 1927c53eeaf7SStefan Hajnoczifi 1928c53eeaf7SStefan Hajnoczi 1929c53eeaf7SStefan Hajnoczi# Note that if the Python conditional here evaluates True we will exit 1930c53eeaf7SStefan Hajnoczi# with status 1 which is a shell 'false' value. 1931ddf90699SEduardo Habkostif ! $python -c 'import sys; sys.exit(sys.version_info < (3,5))'; then 1932ddf90699SEduardo Habkost error_exit "Cannot use '$python', Python >= 3.5 is required." \ 1933c53eeaf7SStefan Hajnoczi "Use --python=/path/to/python to specify a supported Python." 1934c53eeaf7SStefan Hajnoczifi 1935c53eeaf7SStefan Hajnoczi 1936755ee70fSCleber Rosa# Preserve python version since some functionality is dependent on it 1937406ab2f3SCleber Rosapython_version=$($python -c 'import sys; print("%d.%d.%d" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))' 2>/dev/null) 1938755ee70fSCleber Rosa 1939c53eeaf7SStefan Hajnoczi# Suppress writing compiled files 1940c53eeaf7SStefan Hajnoczipython="$python -B" 1941c53eeaf7SStefan Hajnoczi 19429aae6e54SDaniel Henrique Barboza# Check that the C compiler works. Doing this here before testing 19439aae6e54SDaniel Henrique Barboza# the host CPU ensures that we had a valid CC to autodetect the 19449aae6e54SDaniel Henrique Barboza# $cpu var (and we should bail right here if that's not the case). 19459aae6e54SDaniel Henrique Barboza# It also allows the help message to be printed without a CC. 19469aae6e54SDaniel Henrique Barbozawrite_c_skeleton; 19479aae6e54SDaniel Henrique Barbozaif compile_object ; then 19489aae6e54SDaniel Henrique Barboza : C compiler works ok 19499aae6e54SDaniel Henrique Barbozaelse 19509aae6e54SDaniel Henrique Barboza error_exit "\"$cc\" either does not exist or does not work" 19519aae6e54SDaniel Henrique Barbozafi 19529aae6e54SDaniel Henrique Barbozaif ! compile_prog ; then 19539aae6e54SDaniel Henrique Barboza error_exit "\"$cc\" cannot build an executable (is your linker broken?)" 19549aae6e54SDaniel Henrique Barbozafi 19559aae6e54SDaniel Henrique Barboza 1956359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1957359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1958359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1959359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1960359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1961359bc95dSPeter Maydell else 196276ad07a4SPeter Maydell error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1963359bc95dSPeter Maydell fi 1964359bc95dSPeter Maydellfi 1965359bc95dSPeter Maydell 19669c83ffd8SPeter Maydell# Consult white-list to determine whether to enable werror 19679c83ffd8SPeter Maydell# by default. Only enable by default for git builds 19689c83ffd8SPeter Maydellif test -z "$werror" ; then 1969fd73745dSAlexey Kardashevskiy if test -e "$source_path/.git" && \ 1970e633a5c6SEric Blake { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then 19719c83ffd8SPeter Maydell werror="yes" 19729c83ffd8SPeter Maydell else 19739c83ffd8SPeter Maydell werror="no" 19749c83ffd8SPeter Maydell fi 19759c83ffd8SPeter Maydellfi 19769c83ffd8SPeter Maydell 1977fb59dabdSPeter Maydellif test "$bogus_os" = "yes"; then 1978fb59dabdSPeter Maydell # Now that we know that we're not printing the help and that 1979fb59dabdSPeter Maydell # the compiler works (so the results of the check_defines we used 1980fb59dabdSPeter Maydell # to identify the OS are reliable), if we didn't recognize the 1981fb59dabdSPeter Maydell # host OS we should stop now. 1982951fedfcSPeter Maydell error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" 1983fb59dabdSPeter Maydellfi 1984fb59dabdSPeter Maydell 1985efc6c070SThomas Huth# Check whether the compiler matches our minimum requirements: 1986efc6c070SThomas Huthcat > $TMPC << EOF 1987efc6c070SThomas Huth#if defined(__clang_major__) && defined(__clang_minor__) 1988efc6c070SThomas Huth# ifdef __apple_build_version__ 1989efc6c070SThomas Huth# if __clang_major__ < 5 || (__clang_major__ == 5 && __clang_minor__ < 1) 1990efc6c070SThomas Huth# error You need at least XCode Clang v5.1 to compile QEMU 1991efc6c070SThomas Huth# endif 1992efc6c070SThomas Huth# else 1993efc6c070SThomas Huth# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 4) 1994efc6c070SThomas Huth# error You need at least Clang v3.4 to compile QEMU 1995efc6c070SThomas Huth# endif 1996efc6c070SThomas Huth# endif 1997efc6c070SThomas Huth#elif defined(__GNUC__) && defined(__GNUC_MINOR__) 1998efc6c070SThomas Huth# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) 1999efc6c070SThomas Huth# error You need at least GCC v4.8 to compile QEMU 2000efc6c070SThomas Huth# endif 2001efc6c070SThomas Huth#else 2002efc6c070SThomas Huth# error You either need GCC or Clang to compiler QEMU 2003efc6c070SThomas Huth#endif 2004efc6c070SThomas Huthint main (void) { return 0; } 2005efc6c070SThomas HuthEOF 2006efc6c070SThomas Huthif ! compile_prog "" "" ; then 2007efc6c070SThomas Huth error_exit "You need at least GCC v4.8 or Clang v3.4 (or XCode Clang v5.1)" 2008efc6c070SThomas Huthfi 2009efc6c070SThomas Huth 20108d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 20118d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 2012ac7568bdSDaniel P. Berrangegcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 2013435405acSPranith Kumargcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags" 2014b98fcfd8SPaolo Bonzinigcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags" 2015e6e90feeSThomas Huthgcc_flags="-Wno-string-plus-int -Wno-typedef-redefinition $gcc_flags" 20166ca026cbSPeter Maydell# Note that we do not add -Werror to gcc_flags here, because that would 20176ca026cbSPeter Maydell# enable it for all configure tests. If a configure test failed due 20186ca026cbSPeter Maydell# to -Werror this would just silently disable some features, 20196ca026cbSPeter Maydell# so it's too error prone. 202093b25869SJohn Snow 202193b25869SJohn Snowcc_has_warning_flag() { 202293b25869SJohn Snow write_c_skeleton; 202393b25869SJohn Snow 2024a1d29d6cSPeter Maydell # Use the positive sense of the flag when testing for -Wno-wombat 2025a1d29d6cSPeter Maydell # support (gcc will happily accept the -Wno- form of unknown 2026a1d29d6cSPeter Maydell # warning options). 202793b25869SJohn Snow optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')" 202893b25869SJohn Snow compile_prog "-Werror $optflag" "" 202993b25869SJohn Snow} 203093b25869SJohn Snow 203193b25869SJohn Snowfor flag in $gcc_flags; do 203293b25869SJohn Snow if cc_has_warning_flag $flag ; then 20338d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 20348d05095cSPaolo Bonzini fi 20358d05095cSPaolo Bonzinidone 20368d05095cSPaolo Bonzini 203763678e17SSteven Noonanif test "$stack_protector" != "no"; then 2038fccd35a0SRodrigo Rebello cat > $TMPC << EOF 2039fccd35a0SRodrigo Rebelloint main(int argc, char *argv[]) 2040fccd35a0SRodrigo Rebello{ 2041fccd35a0SRodrigo Rebello char arr[64], *p = arr, *c = argv[0]; 2042fccd35a0SRodrigo Rebello while (*c) { 2043fccd35a0SRodrigo Rebello *p++ = *c++; 2044fccd35a0SRodrigo Rebello } 2045fccd35a0SRodrigo Rebello return 0; 2046fccd35a0SRodrigo Rebello} 2047fccd35a0SRodrigo RebelloEOF 204863678e17SSteven Noonan gcc_flags="-fstack-protector-strong -fstack-protector-all" 20493b463a3fSMiroslav Rezanina sp_on=0 205063678e17SSteven Noonan for flag in $gcc_flags; do 2051590e5dd9SPeter Maydell # We need to check both a compile and a link, since some compiler 2052590e5dd9SPeter Maydell # setups fail only on a .c->.o compile and some only at link time 2053590e5dd9SPeter Maydell if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC && 2054590e5dd9SPeter Maydell compile_prog "-Werror $flag" ""; then 205563678e17SSteven Noonan QEMU_CFLAGS="$QEMU_CFLAGS $flag" 2056db5adeaaSPaolo Bonzini QEMU_LDFLAGS="$QEMU_LDFLAGS $flag" 20573b463a3fSMiroslav Rezanina sp_on=1 205863678e17SSteven Noonan break 205963678e17SSteven Noonan fi 206063678e17SSteven Noonan done 20613b463a3fSMiroslav Rezanina if test "$stack_protector" = yes; then 20623b463a3fSMiroslav Rezanina if test $sp_on = 0; then 20633b463a3fSMiroslav Rezanina error_exit "Stack protector not supported" 20643b463a3fSMiroslav Rezanina fi 20653b463a3fSMiroslav Rezanina fi 206637746c5eSMarc-André Lureaufi 206737746c5eSMarc-André Lureau 206820bc94a2SPaolo Bonzini# Disable -Wmissing-braces on older compilers that warn even for 206920bc94a2SPaolo Bonzini# the "universal" C zero initializer {0}. 207020bc94a2SPaolo Bonzinicat > $TMPC << EOF 207120bc94a2SPaolo Bonzinistruct { 207220bc94a2SPaolo Bonzini int a[2]; 207320bc94a2SPaolo Bonzini} x = {0}; 207420bc94a2SPaolo BonziniEOF 207520bc94a2SPaolo Bonziniif compile_object "-Werror" "" ; then 207620bc94a2SPaolo Bonzini : 207720bc94a2SPaolo Bonzinielse 207820bc94a2SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS -Wno-missing-braces" 207920bc94a2SPaolo Bonzinifi 208020bc94a2SPaolo Bonzini 208121e709aaSMarc-André Lureau# Our module code doesn't support Windows 208221e709aaSMarc-André Lureauif test "$modules" = "yes" && test "$mingw32" = "yes" ; then 208321e709aaSMarc-André Lureau error_exit "Modules are not available for Windows" 208421e709aaSMarc-André Lureaufi 208521e709aaSMarc-André Lureau 2086bd83c861SChristian Ehrhardt# module_upgrades is only reasonable if modules are enabled 2087bd83c861SChristian Ehrhardtif test "$modules" = "no" && test "$module_upgrades" = "yes" ; then 2088bd83c861SChristian Ehrhardt error_exit "Can't enable module-upgrades as Modules are not enabled" 2089bd83c861SChristian Ehrhardtfi 2090bd83c861SChristian Ehrhardt 2091d376e9deSThomas Huth# Static linking is not possible with modules or PIE 209240d6444eSAvi Kivityif test "$static" = "yes" ; then 2093aa0d1f44SPaolo Bonzini if test "$modules" = "yes" ; then 2094aa0d1f44SPaolo Bonzini error_exit "static and modules are mutually incompatible" 2095aa0d1f44SPaolo Bonzini fi 209640d6444eSAvi Kivityfi 209740d6444eSAvi Kivity 2098768b7855SEmilio G. Cota# Unconditional check for compiler __thread support 2099768b7855SEmilio G. Cota cat > $TMPC << EOF 2100768b7855SEmilio G. Cotastatic __thread int tls_var; 2101768b7855SEmilio G. Cotaint main(void) { return tls_var; } 2102768b7855SEmilio G. CotaEOF 2103768b7855SEmilio G. Cota 2104768b7855SEmilio G. Cotaif ! compile_prog "-Werror" "" ; then 2105768b7855SEmilio G. Cota error_exit "Your compiler does not support the __thread specifier for " \ 2106768b7855SEmilio G. Cota "Thread-Local Storage (TLS). Please upgrade to a version that does." 2107768b7855SEmilio G. Cotafi 2108768b7855SEmilio G. Cota 210940d6444eSAvi Kivitycat > $TMPC << EOF 211021d4a791SAvi Kivity 211121d4a791SAvi Kivity#ifdef __linux__ 211221d4a791SAvi Kivity# define THREAD __thread 211321d4a791SAvi Kivity#else 211421d4a791SAvi Kivity# define THREAD 211521d4a791SAvi Kivity#endif 211621d4a791SAvi Kivitystatic THREAD int tls_var; 211721d4a791SAvi Kivityint main(void) { return tls_var; } 211840d6444eSAvi KivityEOF 2119b2634124SRichard Henderson 2120b2634124SRichard Henderson# Check we support --no-pie first; we will need this for building ROMs. 2121412aeacdSAlex Bennéeif compile_prog "-Werror -fno-pie" "-no-pie"; then 2122412aeacdSAlex Bennée CFLAGS_NOPIE="-fno-pie" 2123b2634124SRichard Henderson LDFLAGS_NOPIE="-no-pie" 2124412aeacdSAlex Bennéefi 2125412aeacdSAlex Bennée 212612781462SRichard Hendersonif test "$static" = "yes"; then 2127eca7a8e6SRichard Henderson if test "$pie" != "no" && compile_prog "-Werror -fPIE -DPIE" "-static-pie"; then 212812781462SRichard Henderson QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 212912781462SRichard Henderson QEMU_LDFLAGS="-static-pie $QEMU_LDFLAGS" 213012781462SRichard Henderson pie="yes" 213112781462SRichard Henderson elif test "$pie" = "yes"; then 213212781462SRichard Henderson error_exit "-static-pie not available due to missing toolchain support" 213312781462SRichard Henderson else 213412781462SRichard Henderson QEMU_LDFLAGS="-static $QEMU_LDFLAGS" 213512781462SRichard Henderson pie="no" 213612781462SRichard Henderson fi 213712781462SRichard Hendersonelif test "$pie" = "no"; then 21382c674109SRichard Henderson QEMU_CFLAGS="$CFLAGS_NOPIE $QEMU_CFLAGS" 21392c674109SRichard Henderson QEMU_LDFLAGS="$LDFLAGS_NOPIE $QEMU_LDFLAGS" 2140eca7a8e6SRichard Hendersonelif compile_prog "-Werror -fPIE -DPIE" "-pie"; then 214140d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 2142db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-pie $QEMU_LDFLAGS" 214340d6444eSAvi Kivity pie="yes" 21442c674109SRichard Hendersonelif test "$pie" = "yes"; then 214576ad07a4SPeter Maydell error_exit "PIE not available due to missing toolchain support" 214640d6444eSAvi Kivityelse 214740d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 214840d6444eSAvi Kivity pie="no" 214940d6444eSAvi Kivityfi 215040d6444eSAvi Kivity 2151e6cbd751SRichard Henderson# Detect support for PT_GNU_RELRO + DT_BIND_NOW. 2152e6cbd751SRichard Henderson# The combination is known as "full relro", because .got.plt is read-only too. 2153e6cbd751SRichard Hendersonif compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 2154e6cbd751SRichard Henderson QEMU_LDFLAGS="-Wl,-z,relro -Wl,-z,now $QEMU_LDFLAGS" 2155e6cbd751SRichard Hendersonfi 2156e6cbd751SRichard Henderson 215709dada40SPaolo Bonzini########################################## 215809dada40SPaolo Bonzini# __sync_fetch_and_and requires at least -march=i486. Many toolchains 215909dada40SPaolo Bonzini# use i686 as default anyway, but for those that don't, an explicit 216009dada40SPaolo Bonzini# specification is necessary 216109dada40SPaolo Bonzini 216209dada40SPaolo Bonziniif test "$cpu" = "i386"; then 216309dada40SPaolo Bonzini cat > $TMPC << EOF 216409dada40SPaolo Bonzinistatic int sfaa(int *ptr) 216509dada40SPaolo Bonzini{ 216609dada40SPaolo Bonzini return __sync_fetch_and_and(ptr, 0); 216709dada40SPaolo Bonzini} 216809dada40SPaolo Bonzini 216909dada40SPaolo Bonziniint main(void) 217009dada40SPaolo Bonzini{ 217109dada40SPaolo Bonzini int val = 42; 21721405b629SStefan Weil val = __sync_val_compare_and_swap(&val, 0, 1); 217309dada40SPaolo Bonzini sfaa(&val); 217409dada40SPaolo Bonzini return val; 217509dada40SPaolo Bonzini} 217609dada40SPaolo BonziniEOF 217709dada40SPaolo Bonzini if ! compile_prog "" "" ; then 217809dada40SPaolo Bonzini QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" 217909dada40SPaolo Bonzini fi 218009dada40SPaolo Bonzinifi 218109dada40SPaolo Bonzini 218209dada40SPaolo Bonzini######################################### 2183ec530c81Sbellard# Solaris specific configure tool chain decisions 218409dada40SPaolo Bonzini 2185ec530c81Sbellardif test "$solaris" = "yes" ; then 21866792aa11SLoïc Minier if has $install; then 21876792aa11SLoïc Minier : 21886792aa11SLoïc Minier else 218976ad07a4SPeter Maydell error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ 219076ad07a4SPeter Maydell "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ 219176ad07a4SPeter Maydell "to get ginstall which is used by default (which lives in /opt/csw/bin)" 2192ec530c81Sbellard fi 219389138857SStefan Weil if test "$(path_of $install)" = "/usr/sbin/install" ; then 219476ad07a4SPeter Maydell error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ 219576ad07a4SPeter Maydell "try ginstall from the GNU fileutils available from www.blastwave.org" \ 219676ad07a4SPeter Maydell "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 2197ec530c81Sbellard fi 21986792aa11SLoïc Minier if has ar; then 21996792aa11SLoïc Minier : 22006792aa11SLoïc Minier else 2201ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 220276ad07a4SPeter Maydell error_exit "No path includes ar" \ 220376ad07a4SPeter Maydell "Add /usr/ccs/bin to your path and rerun configure" 2204ec530c81Sbellard fi 220576ad07a4SPeter Maydell error_exit "No path includes ar" 2206ec530c81Sbellard fi 2207ec530c81Sbellardfi 2208ec530c81Sbellard 2209afb63ebdSStefan Weilif test -z "${target_list+xxx}" ; then 2210d880a3baSPaolo Bonzini for target in $default_target_list; do 2211d880a3baSPaolo Bonzini supported_target $target 2>/dev/null && \ 2212d880a3baSPaolo Bonzini target_list="$target_list $target" 2213d880a3baSPaolo Bonzini done 2214d880a3baSPaolo Bonzini target_list="${target_list# }" 2215121afa9eSAnthony Liguorielse 221689138857SStefan Weil target_list=$(echo "$target_list" | sed -e 's/,/ /g') 2217d880a3baSPaolo Bonzini for target in $target_list; do 221825b48338SPeter Maydell # Check that we recognised the target name; this allows a more 221925b48338SPeter Maydell # friendly error message than if we let it fall through. 222025b48338SPeter Maydell case " $default_target_list " in 222125b48338SPeter Maydell *" $target "*) 222225b48338SPeter Maydell ;; 222325b48338SPeter Maydell *) 222425b48338SPeter Maydell error_exit "Unknown target name '$target'" 222525b48338SPeter Maydell ;; 222625b48338SPeter Maydell esac 2227d880a3baSPaolo Bonzini supported_target $target || exit 1 222825b48338SPeter Maydell done 2229d880a3baSPaolo Bonzinifi 223025b48338SPeter Maydell 2231f55fe278SPaolo Bonzini# see if system emulation was really requested 2232f55fe278SPaolo Bonzinicase " $target_list " in 2233f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 2234f55fe278SPaolo Bonzini ;; 2235f55fe278SPaolo Bonzini *) softmmu=no 2236f55fe278SPaolo Bonzini ;; 2237f55fe278SPaolo Bonziniesac 22385327cf48Sbellard 223905dfa22bSPhilippe Mathieu-Daudéfor target in $target_list; do 224005dfa22bSPhilippe Mathieu-Daudé case "$target" in 224105dfa22bSPhilippe Mathieu-Daudé arm-softmmu | aarch64-softmmu | i386-softmmu | x86_64-softmmu) 224205dfa22bSPhilippe Mathieu-Daudé edk2_blobs="yes" 224305dfa22bSPhilippe Mathieu-Daudé ;; 224405dfa22bSPhilippe Mathieu-Daudé esac 224505dfa22bSPhilippe Mathieu-Daudédone 2246623ef637SPhilippe Mathieu-Daudé# The EDK2 binaries are compressed with bzip2 2247623ef637SPhilippe Mathieu-Daudéif test "$edk2_blobs" = "yes" && ! has bzip2; then 2248623ef637SPhilippe Mathieu-Daudé error_exit "The bzip2 program is required for building QEMU" 2249623ef637SPhilippe Mathieu-Daudéfi 225005dfa22bSPhilippe Mathieu-Daudé 2251249247c9SJuan Quintelafeature_not_found() { 2252249247c9SJuan Quintela feature=$1 225321684af0SStewart Smith remedy=$2 2254249247c9SJuan Quintela 225576ad07a4SPeter Maydell error_exit "User requested feature $feature" \ 225621684af0SStewart Smith "configure was not able to find it." \ 225721684af0SStewart Smith "$remedy" 2258249247c9SJuan Quintela} 2259249247c9SJuan Quintela 22607d13299dSbellard# --- 22617d13299dSbellard# big/little endian test 22627d13299dSbellardcat > $TMPC << EOF 226361cc919fSMike Frysingershort big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; 226461cc919fSMike Frysingershort little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; 226561cc919fSMike Frysingerextern int foo(short *, short *); 226661cc919fSMike Frysingerint main(int argc, char *argv[]) { 226761cc919fSMike Frysinger return foo(big_endian, little_endian); 22687d13299dSbellard} 22697d13299dSbellardEOF 22707d13299dSbellard 227161cc919fSMike Frysingerif compile_object ; then 227212f15c91SAlice Frosi if strings -a $TMPO | grep -q BiGeNdIaN ; then 227361cc919fSMike Frysinger bigendian="yes" 227412f15c91SAlice Frosi elif strings -a $TMPO | grep -q LiTtLeEnDiAn ; then 227561cc919fSMike Frysinger bigendian="no" 22767d13299dSbellard else 22777d13299dSbellard echo big/little test failed 22787d13299dSbellard fi 22797d13299dSbellardelse 228061cc919fSMike Frysinger echo big/little test failed 22817d13299dSbellardfi 22827d13299dSbellard 2283b0a47e79SJuan Quintela########################################## 2284e10ee3f5SPhilippe Mathieu-Daudé# system tools 2285e10ee3f5SPhilippe Mathieu-Daudéif test -z "$want_tools"; then 2286e10ee3f5SPhilippe Mathieu-Daudé if test "$softmmu" = "no"; then 2287e10ee3f5SPhilippe Mathieu-Daudé want_tools=no 2288e10ee3f5SPhilippe Mathieu-Daudé else 2289e10ee3f5SPhilippe Mathieu-Daudé want_tools=yes 2290e10ee3f5SPhilippe Mathieu-Daudé fi 2291e10ee3f5SPhilippe Mathieu-Daudéfi 2292e10ee3f5SPhilippe Mathieu-Daudé 2293e10ee3f5SPhilippe Mathieu-Daudé########################################## 2294a30878e7SPeter Maydell# cocoa implies not SDL or GTK 2295a30878e7SPeter Maydell# (the cocoa UI code currently assumes it is always the active UI 2296a30878e7SPeter Maydell# and doesn't interact well with other UI frontend code) 2297a30878e7SPeter Maydellif test "$cocoa" = "yes"; then 2298a30878e7SPeter Maydell if test "$sdl" = "yes"; then 2299a30878e7SPeter Maydell error_exit "Cocoa and SDL UIs cannot both be enabled at once" 2300a30878e7SPeter Maydell fi 2301a30878e7SPeter Maydell if test "$gtk" = "yes"; then 2302a30878e7SPeter Maydell error_exit "Cocoa and GTK UIs cannot both be enabled at once" 2303a30878e7SPeter Maydell fi 2304a30878e7SPeter Maydell gtk=no 2305a30878e7SPeter Maydell sdl=no 2306a30878e7SPeter Maydellfi 2307a30878e7SPeter Maydell 23086b39b063SEric Blake# Some versions of Mac OS X incorrectly define SIZE_MAX 23096b39b063SEric Blakecat > $TMPC << EOF 23106b39b063SEric Blake#include <stdint.h> 23116b39b063SEric Blake#include <stdio.h> 23126b39b063SEric Blakeint main(int argc, char *argv[]) { 23136b39b063SEric Blake return printf("%zu", SIZE_MAX); 23146b39b063SEric Blake} 23156b39b063SEric BlakeEOF 23166b39b063SEric Blakehave_broken_size_max=no 23176b39b063SEric Blakeif ! compile_object -Werror ; then 23186b39b063SEric Blake have_broken_size_max=yes 23196b39b063SEric Blakefi 23206b39b063SEric Blake 2321a30878e7SPeter Maydell########################################## 2322015a33bdSGonglei# L2TPV3 probe 2323015a33bdSGonglei 2324015a33bdSGongleicat > $TMPC <<EOF 2325015a33bdSGonglei#include <sys/socket.h> 2326bff6cb72SMichael Tokarev#include <linux/ip.h> 2327015a33bdSGongleiint main(void) { return sizeof(struct mmsghdr); } 2328015a33bdSGongleiEOF 2329015a33bdSGongleiif compile_prog "" "" ; then 2330015a33bdSGonglei l2tpv3=yes 2331015a33bdSGongleielse 2332015a33bdSGonglei l2tpv3=no 2333015a33bdSGongleifi 2334015a33bdSGonglei 2335299e6f19SPaolo Bonzini######################################### 2336299e6f19SPaolo Bonzini# vhost interdependencies and host support 2337299e6f19SPaolo Bonzini 2338299e6f19SPaolo Bonzini# vhost backends 2339299e6f19SPaolo Bonzinitest "$vhost_user" = "" && vhost_user=yes 2340299e6f19SPaolo Bonziniif test "$vhost_user" = "yes" && test "$mingw32" = "yes"; then 2341299e6f19SPaolo Bonzini error_exit "vhost-user isn't available on win32" 2342299e6f19SPaolo Bonzinifi 2343299e6f19SPaolo Bonzinitest "$vhost_kernel" = "" && vhost_kernel=$linux 2344299e6f19SPaolo Bonziniif test "$vhost_kernel" = "yes" && test "$linux" != "yes"; then 2345299e6f19SPaolo Bonzini error_exit "vhost-kernel is only available on Linux" 2346299e6f19SPaolo Bonzinifi 2347299e6f19SPaolo Bonzini 2348299e6f19SPaolo Bonzini# vhost-kernel devices 2349299e6f19SPaolo Bonzinitest "$vhost_scsi" = "" && vhost_scsi=$vhost_kernel 2350299e6f19SPaolo Bonziniif test "$vhost_scsi" = "yes" && test "$vhost_kernel" != "yes"; then 2351299e6f19SPaolo Bonzini error_exit "--enable-vhost-scsi requires --enable-vhost-kernel" 2352299e6f19SPaolo Bonzinifi 2353299e6f19SPaolo Bonzinitest "$vhost_vsock" = "" && vhost_vsock=$vhost_kernel 2354299e6f19SPaolo Bonziniif test "$vhost_vsock" = "yes" && test "$vhost_kernel" != "yes"; then 2355299e6f19SPaolo Bonzini error_exit "--enable-vhost-vsock requires --enable-vhost-kernel" 2356299e6f19SPaolo Bonzinifi 2357299e6f19SPaolo Bonzini 2358299e6f19SPaolo Bonzini# vhost-user backends 2359299e6f19SPaolo Bonzinitest "$vhost_net_user" = "" && vhost_net_user=$vhost_user 2360299e6f19SPaolo Bonziniif test "$vhost_net_user" = "yes" && test "$vhost_user" = "no"; then 2361299e6f19SPaolo Bonzini error_exit "--enable-vhost-net-user requires --enable-vhost-user" 2362299e6f19SPaolo Bonzinifi 2363299e6f19SPaolo Bonzinitest "$vhost_crypto" = "" && vhost_crypto=$vhost_user 2364299e6f19SPaolo Bonziniif test "$vhost_crypto" = "yes" && test "$vhost_user" = "no"; then 2365299e6f19SPaolo Bonzini error_exit "--enable-vhost-crypto requires --enable-vhost-user" 2366299e6f19SPaolo Bonzinifi 236798fc1adaSDr. David Alan Gilberttest "$vhost_user_fs" = "" && vhost_user_fs=$vhost_user 236898fc1adaSDr. David Alan Gilbertif test "$vhost_user_fs" = "yes" && test "$vhost_user" = "no"; then 236998fc1adaSDr. David Alan Gilbert error_exit "--enable-vhost-user-fs requires --enable-vhost-user" 237098fc1adaSDr. David Alan Gilbertfi 2371299e6f19SPaolo Bonzini 2372299e6f19SPaolo Bonzini# OR the vhost-kernel and vhost-user values for simplicity 2373299e6f19SPaolo Bonziniif test "$vhost_net" = ""; then 2374299e6f19SPaolo Bonzini test "$vhost_net_user" = "yes" && vhost_net=yes 2375299e6f19SPaolo Bonzini test "$vhost_kernel" = "yes" && vhost_net=yes 2376299e6f19SPaolo Bonzinifi 2377299e6f19SPaolo Bonzini 2378015a33bdSGonglei########################################## 23794d9310f4SDaniel P. Berrange# MinGW / Mingw-w64 localtime_r/gmtime_r check 23804d9310f4SDaniel P. Berrange 23814d9310f4SDaniel P. Berrangeif test "$mingw32" = "yes"; then 23824d9310f4SDaniel P. Berrange # Some versions of MinGW / Mingw-w64 lack localtime_r 23834d9310f4SDaniel P. Berrange # and gmtime_r entirely. 23844d9310f4SDaniel P. Berrange # 23854d9310f4SDaniel P. Berrange # Some versions of Mingw-w64 define a macro for 23864d9310f4SDaniel P. Berrange # localtime_r/gmtime_r. 23874d9310f4SDaniel P. Berrange # 23884d9310f4SDaniel P. Berrange # Some versions of Mingw-w64 will define functions 23894d9310f4SDaniel P. Berrange # for localtime_r/gmtime_r, but only if you have 23904d9310f4SDaniel P. Berrange # _POSIX_THREAD_SAFE_FUNCTIONS defined. For fun 23914d9310f4SDaniel P. Berrange # though, unistd.h and pthread.h both define 23924d9310f4SDaniel P. Berrange # that for you. 23934d9310f4SDaniel P. Berrange # 23944d9310f4SDaniel P. Berrange # So this #undef localtime_r and #include <unistd.h> 23954d9310f4SDaniel P. Berrange # are not in fact redundant. 23964d9310f4SDaniel P. Berrangecat > $TMPC << EOF 23974d9310f4SDaniel P. Berrange#include <unistd.h> 23984d9310f4SDaniel P. Berrange#include <time.h> 23994d9310f4SDaniel P. Berrange#undef localtime_r 24004d9310f4SDaniel P. Berrangeint main(void) { localtime_r(NULL, NULL); return 0; } 24014d9310f4SDaniel P. BerrangeEOF 24024d9310f4SDaniel P. Berrange if compile_prog "" "" ; then 24034d9310f4SDaniel P. Berrange localtime_r="yes" 24044d9310f4SDaniel P. Berrange else 24054d9310f4SDaniel P. Berrange localtime_r="no" 24064d9310f4SDaniel P. Berrange fi 24074d9310f4SDaniel P. Berrangefi 24084d9310f4SDaniel P. Berrange 24094d9310f4SDaniel P. Berrange########################################## 2410779ab5e3SStefan Weil# pkg-config probe 2411779ab5e3SStefan Weil 2412779ab5e3SStefan Weilif ! has "$pkg_config_exe"; then 241376ad07a4SPeter Maydell error_exit "pkg-config binary '$pkg_config_exe' not found" 2414779ab5e3SStefan Weilfi 2415779ab5e3SStefan Weil 2416779ab5e3SStefan Weil########################################## 2417b0a47e79SJuan Quintela# NPTL probe 2418b0a47e79SJuan Quintela 241924cb36a6SPeter Maydellif test "$linux_user" = "yes"; then 2420bd0c5661Spbrook cat > $TMPC <<EOF 2421bd0c5661Spbrook#include <sched.h> 242230813ceaSpbrook#include <linux/futex.h> 2423182eacc0SStefan Weilint main(void) { 2424bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 2425bd0c5661Spbrook#error bork 2426bd0c5661Spbrook#endif 2427182eacc0SStefan Weil return 0; 2428bd0c5661Spbrook} 2429bd0c5661SpbrookEOF 243024cb36a6SPeter Maydell if ! compile_object ; then 243121684af0SStewart Smith feature_not_found "nptl" "Install glibc and linux kernel headers." 2432b0a47e79SJuan Quintela fi 2433bd0c5661Spbrookfi 2434bd0c5661Spbrook 2435ac62922eSbalrog########################################## 2436607dacd0Sqiaonuohan# lzo check 2437607dacd0Sqiaonuohan 2438607dacd0Sqiaonuohanif test "$lzo" != "no" ; then 2439607dacd0Sqiaonuohan cat > $TMPC << EOF 2440607dacd0Sqiaonuohan#include <lzo/lzo1x.h> 2441607dacd0Sqiaonuohanint main(void) { lzo_version(); return 0; } 2442607dacd0SqiaonuohanEOF 2443607dacd0Sqiaonuohan if compile_prog "" "-llzo2" ; then 2444607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -llzo2" 2445b25c9dffSStefan Weil lzo="yes" 2446b25c9dffSStefan Weil else 2447b25c9dffSStefan Weil if test "$lzo" = "yes"; then 2448b25c9dffSStefan Weil feature_not_found "liblzo2" "Install liblzo2 devel" 2449b25c9dffSStefan Weil fi 2450b25c9dffSStefan Weil lzo="no" 2451b25c9dffSStefan Weil fi 2452607dacd0Sqiaonuohanfi 2453607dacd0Sqiaonuohan 2454607dacd0Sqiaonuohan########################################## 2455607dacd0Sqiaonuohan# snappy check 2456607dacd0Sqiaonuohan 2457607dacd0Sqiaonuohanif test "$snappy" != "no" ; then 2458607dacd0Sqiaonuohan cat > $TMPC << EOF 2459607dacd0Sqiaonuohan#include <snappy-c.h> 2460607dacd0Sqiaonuohanint main(void) { snappy_max_compressed_length(4096); return 0; } 2461607dacd0SqiaonuohanEOF 2462607dacd0Sqiaonuohan if compile_prog "" "-lsnappy" ; then 2463607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -lsnappy" 2464b25c9dffSStefan Weil snappy="yes" 2465b25c9dffSStefan Weil else 2466b25c9dffSStefan Weil if test "$snappy" = "yes"; then 2467b25c9dffSStefan Weil feature_not_found "libsnappy" "Install libsnappy devel" 2468b25c9dffSStefan Weil fi 2469b25c9dffSStefan Weil snappy="no" 2470b25c9dffSStefan Weil fi 2471607dacd0Sqiaonuohanfi 2472607dacd0Sqiaonuohan 2473607dacd0Sqiaonuohan########################################## 24746b383c08SPeter Wu# bzip2 check 24756b383c08SPeter Wu 24766b383c08SPeter Wuif test "$bzip2" != "no" ; then 24776b383c08SPeter Wu cat > $TMPC << EOF 24786b383c08SPeter Wu#include <bzlib.h> 24796b383c08SPeter Wuint main(void) { BZ2_bzlibVersion(); return 0; } 24806b383c08SPeter WuEOF 24816b383c08SPeter Wu if compile_prog "" "-lbz2" ; then 24826b383c08SPeter Wu bzip2="yes" 24836b383c08SPeter Wu else 24846b383c08SPeter Wu if test "$bzip2" = "yes"; then 24856b383c08SPeter Wu feature_not_found "libbzip2" "Install libbzip2 devel" 24866b383c08SPeter Wu fi 24876b383c08SPeter Wu bzip2="no" 24886b383c08SPeter Wu fi 24896b383c08SPeter Wufi 24906b383c08SPeter Wu 24916b383c08SPeter Wu########################################## 249283bc1f97SJulio Faracco# lzfse check 249383bc1f97SJulio Faracco 249483bc1f97SJulio Faraccoif test "$lzfse" != "no" ; then 249583bc1f97SJulio Faracco cat > $TMPC << EOF 249683bc1f97SJulio Faracco#include <lzfse.h> 249783bc1f97SJulio Faraccoint main(void) { lzfse_decode_scratch_size(); return 0; } 249883bc1f97SJulio FaraccoEOF 249983bc1f97SJulio Faracco if compile_prog "" "-llzfse" ; then 250083bc1f97SJulio Faracco lzfse="yes" 250183bc1f97SJulio Faracco else 250283bc1f97SJulio Faracco if test "$lzfse" = "yes"; then 250383bc1f97SJulio Faracco feature_not_found "lzfse" "Install lzfse devel" 250483bc1f97SJulio Faracco fi 250583bc1f97SJulio Faracco lzfse="no" 250683bc1f97SJulio Faracco fi 250783bc1f97SJulio Faraccofi 250883bc1f97SJulio Faracco 250983bc1f97SJulio Faracco########################################## 25103a678481SJuan Quintela# zstd check 25113a678481SJuan Quintela 25123a678481SJuan Quintelaif test "$zstd" != "no" ; then 2513297254c7SJuan Quintela libzstd_minver="1.4.0" 2514297254c7SJuan Quintela if $pkg_config --atleast-version=$libzstd_minver libzstd ; then 25153a678481SJuan Quintela zstd_cflags="$($pkg_config --cflags libzstd)" 25163a678481SJuan Quintela zstd_libs="$($pkg_config --libs libzstd)" 25173a678481SJuan Quintela LIBS="$zstd_libs $LIBS" 25183a678481SJuan Quintela QEMU_CFLAGS="$QEMU_CFLAGS $zstd_cflags" 25193a678481SJuan Quintela zstd="yes" 25203a678481SJuan Quintela else 25213a678481SJuan Quintela if test "$zstd" = "yes" ; then 25223a678481SJuan Quintela feature_not_found "libzstd" "Install libzstd devel" 25233a678481SJuan Quintela fi 25243a678481SJuan Quintela zstd="no" 25253a678481SJuan Quintela fi 25263a678481SJuan Quintelafi 25273a678481SJuan Quintela 25283a678481SJuan Quintela########################################## 2529f794573eSEduardo Otubo# libseccomp check 2530f794573eSEduardo Otubo 2531f794573eSEduardo Otuboif test "$seccomp" != "no" ; then 25323e684455SMichael Strosaker libseccomp_minver="2.3.0" 253325ed0eccSHelge Deller if $pkg_config --atleast-version=$libseccomp_minver libseccomp ; then 2534c3883e1fSFam Zheng seccomp_cflags="$($pkg_config --cflags libseccomp)" 2535c3883e1fSFam Zheng seccomp_libs="$($pkg_config --libs libseccomp)" 2536f794573eSEduardo Otubo seccomp="yes" 2537f794573eSEduardo Otubo else 2538f794573eSEduardo Otubo if test "$seccomp" = "yes" ; then 2539693e5910SAndrew Jones feature_not_found "libseccomp" \ 2540693e5910SAndrew Jones "Install libseccomp devel >= $libseccomp_minver" 2541896848f0SEduardo Otubo fi 2542e84d5956SYann E. MORIN seccomp="no" 2543f794573eSEduardo Otubo fi 2544f794573eSEduardo Otubofi 2545f794573eSEduardo Otubo########################################## 2546e37630caSaliguori# xen probe 2547e37630caSaliguori 2548fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 2549c1cdd9d5SJuergen Gross # Check whether Xen library path is specified via --extra-ldflags to avoid 2550c1cdd9d5SJuergen Gross # overriding this setting with pkg-config output. If not, try pkg-config 2551c1cdd9d5SJuergen Gross # to obtain all needed flags. 2552c1cdd9d5SJuergen Gross 2553c1cdd9d5SJuergen Gross if ! echo $EXTRA_LDFLAGS | grep tools/libxc > /dev/null && \ 2554c1cdd9d5SJuergen Gross $pkg_config --exists xencontrol ; then 2555c1cdd9d5SJuergen Gross xen_ctrl_version="$(printf '%d%02d%02d' \ 2556c1cdd9d5SJuergen Gross $($pkg_config --modversion xencontrol | sed 's/\./ /g') )" 2557c1cdd9d5SJuergen Gross xen=yes 2558c1cdd9d5SJuergen Gross xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab" 2559c1cdd9d5SJuergen Gross xen_pc="$xen_pc xenevtchn xendevicemodel" 256058ea9a7aSAnthony PERARD if $pkg_config --exists xentoolcore; then 256158ea9a7aSAnthony PERARD xen_pc="$xen_pc xentoolcore" 256258ea9a7aSAnthony PERARD fi 2563c1cdd9d5SJuergen Gross QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)" 2564c1cdd9d5SJuergen Gross libs_softmmu="$($pkg_config --libs $xen_pc) $libs_softmmu" 2565c1cdd9d5SJuergen Gross else 2566c1cdd9d5SJuergen Gross 2567b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 2568d9506cabSAnthony PERARD xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn" 2569d5b93ddfSAnthony PERARD 257050ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 257150ced5b3SStefan Weil # If no, we are done and there is no Xen support. 257250ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 257350ced5b3SStefan Weil 257450ced5b3SStefan Weil # Xen (any) 257550ced5b3SStefan Weil cat > $TMPC <<EOF 257650ced5b3SStefan Weil#include <xenctrl.h> 257750ced5b3SStefan Weilint main(void) { 257850ced5b3SStefan Weil return 0; 257950ced5b3SStefan Weil} 258050ced5b3SStefan WeilEOF 258150ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 258250ced5b3SStefan Weil # Xen not found 258350ced5b3SStefan Weil if test "$xen" = "yes" ; then 258421684af0SStewart Smith feature_not_found "xen" "Install xen devel" 258550ced5b3SStefan Weil fi 258650ced5b3SStefan Weil xen=no 258750ced5b3SStefan Weil 2588d5b93ddfSAnthony PERARD # Xen unstable 258969deef08SPeter Maydell elif 259069deef08SPeter Maydell cat > $TMPC <<EOF && 25912cbf8903SRoss Lagerwall#undef XC_WANT_COMPAT_DEVICEMODEL_API 25922cbf8903SRoss Lagerwall#define __XEN_TOOLS__ 25932cbf8903SRoss Lagerwall#include <xendevicemodel.h> 2594d3c49ebbSPaul Durrant#include <xenforeignmemory.h> 25952cbf8903SRoss Lagerwallint main(void) { 25962cbf8903SRoss Lagerwall xendevicemodel_handle *xd; 2597d3c49ebbSPaul Durrant xenforeignmemory_handle *xfmem; 25982cbf8903SRoss Lagerwall 25992cbf8903SRoss Lagerwall xd = xendevicemodel_open(0, 0); 26002cbf8903SRoss Lagerwall xendevicemodel_pin_memory_cacheattr(xd, 0, 0, 0, 0); 26012cbf8903SRoss Lagerwall 2602d3c49ebbSPaul Durrant xfmem = xenforeignmemory_open(0, 0); 2603d3c49ebbSPaul Durrant xenforeignmemory_map_resource(xfmem, 0, 0, 0, 0, 0, NULL, 0, 0); 2604d3c49ebbSPaul Durrant 26052cbf8903SRoss Lagerwall return 0; 26062cbf8903SRoss Lagerwall} 26072cbf8903SRoss LagerwallEOF 26082cbf8903SRoss Lagerwall compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" 26092cbf8903SRoss Lagerwall then 26102cbf8903SRoss Lagerwall xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" 26112cbf8903SRoss Lagerwall xen_ctrl_version=41100 26122cbf8903SRoss Lagerwall xen=yes 26132cbf8903SRoss Lagerwall elif 26142cbf8903SRoss Lagerwall cat > $TMPC <<EOF && 26155ba3d756SIgor Druzhinin#undef XC_WANT_COMPAT_MAP_FOREIGN_API 26165ba3d756SIgor Druzhinin#include <xenforeignmemory.h> 261758ea9a7aSAnthony PERARD#include <xentoolcore.h> 26185ba3d756SIgor Druzhininint main(void) { 26195ba3d756SIgor Druzhinin xenforeignmemory_handle *xfmem; 26205ba3d756SIgor Druzhinin 26215ba3d756SIgor Druzhinin xfmem = xenforeignmemory_open(0, 0); 26225ba3d756SIgor Druzhinin xenforeignmemory_map2(xfmem, 0, 0, 0, 0, 0, 0, 0); 262358ea9a7aSAnthony PERARD xentoolcore_restrict_all(0); 26245ba3d756SIgor Druzhinin 26255ba3d756SIgor Druzhinin return 0; 26265ba3d756SIgor Druzhinin} 26275ba3d756SIgor DruzhininEOF 262858ea9a7aSAnthony PERARD compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs -lxentoolcore" 26295ba3d756SIgor Druzhinin then 263058ea9a7aSAnthony PERARD xen_stable_libs="-lxendevicemodel $xen_stable_libs -lxentoolcore" 26315ba3d756SIgor Druzhinin xen_ctrl_version=41000 26325ba3d756SIgor Druzhinin xen=yes 26335ba3d756SIgor Druzhinin elif 26345ba3d756SIgor Druzhinin cat > $TMPC <<EOF && 2635da8090ccSPaul Durrant#undef XC_WANT_COMPAT_DEVICEMODEL_API 2636da8090ccSPaul Durrant#define __XEN_TOOLS__ 2637da8090ccSPaul Durrant#include <xendevicemodel.h> 2638da8090ccSPaul Durrantint main(void) { 2639da8090ccSPaul Durrant xendevicemodel_handle *xd; 2640da8090ccSPaul Durrant 2641da8090ccSPaul Durrant xd = xendevicemodel_open(0, 0); 2642da8090ccSPaul Durrant xendevicemodel_close(xd); 2643da8090ccSPaul Durrant 2644da8090ccSPaul Durrant return 0; 2645da8090ccSPaul Durrant} 2646da8090ccSPaul DurrantEOF 2647da8090ccSPaul Durrant compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs" 2648da8090ccSPaul Durrant then 2649da8090ccSPaul Durrant xen_stable_libs="-lxendevicemodel $xen_stable_libs" 2650f1167ee6SJuergen Gross xen_ctrl_version=40900 2651da8090ccSPaul Durrant xen=yes 2652da8090ccSPaul Durrant elif 2653da8090ccSPaul Durrant cat > $TMPC <<EOF && 26545eeb39c2SIan Campbell/* 26555eeb39c2SIan Campbell * If we have stable libs the we don't want the libxc compat 26565eeb39c2SIan Campbell * layers, regardless of what CFLAGS we may have been given. 2657b6eb9b45SPaulina Szubarczyk * 2658b6eb9b45SPaulina Szubarczyk * Also, check if xengnttab_grant_copy_segment_t is defined and 2659b6eb9b45SPaulina Szubarczyk * grant copy operation is implemented. 2660b6eb9b45SPaulina Szubarczyk */ 2661b6eb9b45SPaulina Szubarczyk#undef XC_WANT_COMPAT_EVTCHN_API 2662b6eb9b45SPaulina Szubarczyk#undef XC_WANT_COMPAT_GNTTAB_API 2663b6eb9b45SPaulina Szubarczyk#undef XC_WANT_COMPAT_MAP_FOREIGN_API 2664b6eb9b45SPaulina Szubarczyk#include <xenctrl.h> 2665b6eb9b45SPaulina Szubarczyk#include <xenstore.h> 2666b6eb9b45SPaulina Szubarczyk#include <xenevtchn.h> 2667b6eb9b45SPaulina Szubarczyk#include <xengnttab.h> 2668b6eb9b45SPaulina Szubarczyk#include <xenforeignmemory.h> 2669b6eb9b45SPaulina Szubarczyk#include <stdint.h> 2670b6eb9b45SPaulina Szubarczyk#include <xen/hvm/hvm_info_table.h> 2671b6eb9b45SPaulina Szubarczyk#if !defined(HVM_MAX_VCPUS) 2672b6eb9b45SPaulina Szubarczyk# error HVM_MAX_VCPUS not defined 2673b6eb9b45SPaulina Szubarczyk#endif 2674b6eb9b45SPaulina Szubarczykint main(void) { 2675b6eb9b45SPaulina Szubarczyk xc_interface *xc = NULL; 2676b6eb9b45SPaulina Szubarczyk xenforeignmemory_handle *xfmem; 2677b6eb9b45SPaulina Szubarczyk xenevtchn_handle *xe; 2678b6eb9b45SPaulina Szubarczyk xengnttab_handle *xg; 2679b6eb9b45SPaulina Szubarczyk xengnttab_grant_copy_segment_t* seg = NULL; 2680b6eb9b45SPaulina Szubarczyk 2681b6eb9b45SPaulina Szubarczyk xs_daemon_open(); 2682b6eb9b45SPaulina Szubarczyk 2683b6eb9b45SPaulina Szubarczyk xc = xc_interface_open(0, 0, 0); 2684b6eb9b45SPaulina Szubarczyk xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 2685b6eb9b45SPaulina Szubarczyk xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 2686b6eb9b45SPaulina Szubarczyk xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 2687b6eb9b45SPaulina Szubarczyk xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); 2688b6eb9b45SPaulina Szubarczyk 2689b6eb9b45SPaulina Szubarczyk xfmem = xenforeignmemory_open(0, 0); 2690b6eb9b45SPaulina Szubarczyk xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); 2691b6eb9b45SPaulina Szubarczyk 2692b6eb9b45SPaulina Szubarczyk xe = xenevtchn_open(0, 0); 2693b6eb9b45SPaulina Szubarczyk xenevtchn_fd(xe); 2694b6eb9b45SPaulina Szubarczyk 2695b6eb9b45SPaulina Szubarczyk xg = xengnttab_open(0, 0); 2696b6eb9b45SPaulina Szubarczyk xengnttab_grant_copy(xg, 0, seg); 2697b6eb9b45SPaulina Szubarczyk 2698b6eb9b45SPaulina Szubarczyk return 0; 2699b6eb9b45SPaulina Szubarczyk} 2700b6eb9b45SPaulina SzubarczykEOF 2701b6eb9b45SPaulina Szubarczyk compile_prog "" "$xen_libs $xen_stable_libs" 2702b6eb9b45SPaulina Szubarczyk then 2703f1167ee6SJuergen Gross xen_ctrl_version=40800 2704b6eb9b45SPaulina Szubarczyk xen=yes 2705b6eb9b45SPaulina Szubarczyk elif 2706b6eb9b45SPaulina Szubarczyk cat > $TMPC <<EOF && 2707b6eb9b45SPaulina Szubarczyk/* 2708b6eb9b45SPaulina Szubarczyk * If we have stable libs the we don't want the libxc compat 2709b6eb9b45SPaulina Szubarczyk * layers, regardless of what CFLAGS we may have been given. 27105eeb39c2SIan Campbell */ 27115eeb39c2SIan Campbell#undef XC_WANT_COMPAT_EVTCHN_API 27125eeb39c2SIan Campbell#undef XC_WANT_COMPAT_GNTTAB_API 27135eeb39c2SIan Campbell#undef XC_WANT_COMPAT_MAP_FOREIGN_API 27145eeb39c2SIan Campbell#include <xenctrl.h> 27155eeb39c2SIan Campbell#include <xenstore.h> 27165eeb39c2SIan Campbell#include <xenevtchn.h> 27175eeb39c2SIan Campbell#include <xengnttab.h> 27185eeb39c2SIan Campbell#include <xenforeignmemory.h> 27195eeb39c2SIan Campbell#include <stdint.h> 27205eeb39c2SIan Campbell#include <xen/hvm/hvm_info_table.h> 27215eeb39c2SIan Campbell#if !defined(HVM_MAX_VCPUS) 27225eeb39c2SIan Campbell# error HVM_MAX_VCPUS not defined 27235eeb39c2SIan Campbell#endif 27245eeb39c2SIan Campbellint main(void) { 27255eeb39c2SIan Campbell xc_interface *xc = NULL; 27265eeb39c2SIan Campbell xenforeignmemory_handle *xfmem; 27275eeb39c2SIan Campbell xenevtchn_handle *xe; 27285eeb39c2SIan Campbell xengnttab_handle *xg; 27295eeb39c2SIan Campbell 27305eeb39c2SIan Campbell xs_daemon_open(); 27315eeb39c2SIan Campbell 27325eeb39c2SIan Campbell xc = xc_interface_open(0, 0, 0); 27335eeb39c2SIan Campbell xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 27345eeb39c2SIan Campbell xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 27355eeb39c2SIan Campbell xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 27365eeb39c2SIan Campbell xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); 27375eeb39c2SIan Campbell 27385eeb39c2SIan Campbell xfmem = xenforeignmemory_open(0, 0); 27395eeb39c2SIan Campbell xenforeignmemory_map(xfmem, 0, 0, 0, 0, 0); 27405eeb39c2SIan Campbell 27415eeb39c2SIan Campbell xe = xenevtchn_open(0, 0); 27425eeb39c2SIan Campbell xenevtchn_fd(xe); 27435eeb39c2SIan Campbell 27445eeb39c2SIan Campbell xg = xengnttab_open(0, 0); 27455eeb39c2SIan Campbell xengnttab_map_grant_ref(xg, 0, 0, 0); 27465eeb39c2SIan Campbell 27475eeb39c2SIan Campbell return 0; 27485eeb39c2SIan Campbell} 27495eeb39c2SIan CampbellEOF 27505eeb39c2SIan Campbell compile_prog "" "$xen_libs $xen_stable_libs" 27515eeb39c2SIan Campbell then 2752f1167ee6SJuergen Gross xen_ctrl_version=40701 27535eeb39c2SIan Campbell xen=yes 2754cdadde39SRoger Pau Monne 2755cdadde39SRoger Pau Monne # Xen 4.6 2756cdadde39SRoger Pau Monne elif 2757cdadde39SRoger Pau Monne cat > $TMPC <<EOF && 2758cdadde39SRoger Pau Monne#include <xenctrl.h> 2759e108a3c1SAnthony PERARD#include <xenstore.h> 2760d5b93ddfSAnthony PERARD#include <stdint.h> 2761d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 2762d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 2763d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 2764d5b93ddfSAnthony PERARD#endif 2765d5b93ddfSAnthony PERARDint main(void) { 2766d5b93ddfSAnthony PERARD xc_interface *xc; 2767d5b93ddfSAnthony PERARD xs_daemon_open(); 2768d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 2769d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 2770d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 2771b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 27728688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 2773d8b441a3SJan Beulich xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); 277420a544c7SKonrad Rzeszutek Wilk xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0); 2775d8b441a3SJan Beulich return 0; 2776d8b441a3SJan Beulich} 2777d8b441a3SJan BeulichEOF 2778d8b441a3SJan Beulich compile_prog "" "$xen_libs" 2779d8b441a3SJan Beulich then 2780f1167ee6SJuergen Gross xen_ctrl_version=40600 2781d8b441a3SJan Beulich xen=yes 2782d8b441a3SJan Beulich 2783d8b441a3SJan Beulich # Xen 4.5 2784d8b441a3SJan Beulich elif 2785d8b441a3SJan Beulich cat > $TMPC <<EOF && 2786d8b441a3SJan Beulich#include <xenctrl.h> 2787d8b441a3SJan Beulich#include <xenstore.h> 2788d8b441a3SJan Beulich#include <stdint.h> 2789d8b441a3SJan Beulich#include <xen/hvm/hvm_info_table.h> 2790d8b441a3SJan Beulich#if !defined(HVM_MAX_VCPUS) 2791d8b441a3SJan Beulich# error HVM_MAX_VCPUS not defined 2792d8b441a3SJan Beulich#endif 2793d8b441a3SJan Beulichint main(void) { 2794d8b441a3SJan Beulich xc_interface *xc; 2795d8b441a3SJan Beulich xs_daemon_open(); 2796d8b441a3SJan Beulich xc = xc_interface_open(0, 0, 0); 2797d8b441a3SJan Beulich xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 2798d8b441a3SJan Beulich xc_gnttab_open(NULL, 0); 2799d8b441a3SJan Beulich xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 2800d8b441a3SJan Beulich xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 28013996e85cSPaul Durrant xc_hvm_create_ioreq_server(xc, 0, 0, NULL); 28023996e85cSPaul Durrant return 0; 28033996e85cSPaul Durrant} 28043996e85cSPaul DurrantEOF 28053996e85cSPaul Durrant compile_prog "" "$xen_libs" 28063996e85cSPaul Durrant then 2807f1167ee6SJuergen Gross xen_ctrl_version=40500 28083996e85cSPaul Durrant xen=yes 28093996e85cSPaul Durrant 28103996e85cSPaul Durrant elif 28113996e85cSPaul Durrant cat > $TMPC <<EOF && 28123996e85cSPaul Durrant#include <xenctrl.h> 28133996e85cSPaul Durrant#include <xenstore.h> 28143996e85cSPaul Durrant#include <stdint.h> 28153996e85cSPaul Durrant#include <xen/hvm/hvm_info_table.h> 28163996e85cSPaul Durrant#if !defined(HVM_MAX_VCPUS) 28173996e85cSPaul Durrant# error HVM_MAX_VCPUS not defined 28183996e85cSPaul Durrant#endif 28193996e85cSPaul Durrantint main(void) { 28203996e85cSPaul Durrant xc_interface *xc; 28213996e85cSPaul Durrant xs_daemon_open(); 28223996e85cSPaul Durrant xc = xc_interface_open(0, 0, 0); 28233996e85cSPaul Durrant xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 28243996e85cSPaul Durrant xc_gnttab_open(NULL, 0); 28253996e85cSPaul Durrant xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 28263996e85cSPaul Durrant xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 28278688e065SStefano Stabellini return 0; 28288688e065SStefano Stabellini} 28298688e065SStefano StabelliniEOF 28308688e065SStefano Stabellini compile_prog "" "$xen_libs" 283169deef08SPeter Maydell then 2832f1167ee6SJuergen Gross xen_ctrl_version=40200 28338688e065SStefano Stabellini xen=yes 28348688e065SStefano Stabellini 2835e37630caSaliguori else 2836fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 2837edfb07edSIan Campbell feature_not_found "xen (unsupported version)" \ 2838edfb07edSIan Campbell "Install a supported xen (xen 4.2 or newer)" 2839fc321b4bSJuan Quintela fi 2840fc321b4bSJuan Quintela xen=no 2841e37630caSaliguori fi 2842d5b93ddfSAnthony PERARD 2843d5b93ddfSAnthony PERARD if test "$xen" = yes; then 2844f1167ee6SJuergen Gross if test $xen_ctrl_version -ge 40701 ; then 28455eeb39c2SIan Campbell libs_softmmu="$xen_stable_libs $libs_softmmu" 28465eeb39c2SIan Campbell fi 2847d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 2848d5b93ddfSAnthony PERARD fi 2849e37630caSaliguori fi 2850c1cdd9d5SJuergen Grossfi 2851e37630caSaliguori 2852eb6fda0fSAnthony PERARDif test "$xen_pci_passthrough" != "no"; then 2853edfb07edSIan Campbell if test "$xen" = "yes" && test "$linux" = "yes"; then 2854eb6fda0fSAnthony PERARD xen_pci_passthrough=yes 2855eb6fda0fSAnthony PERARD else 2856eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = "yes"; then 285776ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 285876ad07a4SPeter Maydell " but this feature requires /sys from Linux" 2859eb6fda0fSAnthony PERARD fi 2860eb6fda0fSAnthony PERARD xen_pci_passthrough=no 2861eb6fda0fSAnthony PERARD fi 2862eb6fda0fSAnthony PERARDfi 2863eb6fda0fSAnthony PERARD 2864e37630caSaliguori########################################## 2865d661d9a4SJustin Terry (VM)# Windows Hypervisor Platform accelerator (WHPX) check 2866d661d9a4SJustin Terry (VM)if test "$whpx" != "no" ; then 2867327fccb2SLucian Petrut if check_include "WinHvPlatform.h" && check_include "WinHvEmulation.h"; then 2868d661d9a4SJustin Terry (VM) whpx="yes" 2869d661d9a4SJustin Terry (VM) else 2870d661d9a4SJustin Terry (VM) if test "$whpx" = "yes"; then 287153537bb1SJustin Terry (VM) via Qemu-devel feature_not_found "WinHvPlatform" "WinHvEmulation is not installed" 2872d661d9a4SJustin Terry (VM) fi 2873d661d9a4SJustin Terry (VM) whpx="no" 2874d661d9a4SJustin Terry (VM) fi 2875d661d9a4SJustin Terry (VM)fi 2876d661d9a4SJustin Terry (VM) 2877d661d9a4SJustin Terry (VM)########################################## 2878dfffc653SJuan Quintela# Sparse probe 2879dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 28800dba6195SLoïc Minier if has cgcc; then 2881dfffc653SJuan Quintela sparse=yes 2882dfffc653SJuan Quintela else 2883dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 288421684af0SStewart Smith feature_not_found "sparse" "Install sparse binary" 2885dfffc653SJuan Quintela fi 2886dfffc653SJuan Quintela sparse=no 2887dfffc653SJuan Quintela fi 2888dfffc653SJuan Quintelafi 2889dfffc653SJuan Quintela 2890dfffc653SJuan Quintela########################################## 2891f676c67eSJeremy White# X11 probe 2892f676c67eSJeremy Whiteif $pkg_config --exists "x11"; then 28938781595bSGerd Hoffmann have_x11=yes 289489138857SStefan Weil x11_cflags=$($pkg_config --cflags x11) 289589138857SStefan Weil x11_libs=$($pkg_config --libs x11) 2896f676c67eSJeremy Whitefi 2897f676c67eSJeremy White 2898f676c67eSJeremy White########################################## 2899a4ccabcfSAnthony Liguori# GTK probe 2900a4ccabcfSAnthony Liguori 29015a464e6cSPeter Xuif test "$gtk" != "no"; then 290289d85cdeSDaniel P. Berrangé gtkpackage="gtk+-3.0" 290389d85cdeSDaniel P. Berrangé gtkx11package="gtk+-x11-3.0" 29047b23d121SVolker Rümelin gtkversion="3.22.0" 2905bbbf9bfbSStefan Weil if $pkg_config --exists "$gtkpackage >= $gtkversion"; then 290689138857SStefan Weil gtk_cflags=$($pkg_config --cflags $gtkpackage) 290789138857SStefan Weil gtk_libs=$($pkg_config --libs $gtkpackage) 290889138857SStefan Weil gtk_version=$($pkg_config --modversion $gtkpackage) 29090a337ed0SGerd Hoffmann if $pkg_config --exists "$gtkx11package >= $gtkversion"; then 29108781595bSGerd Hoffmann need_x11=yes 2911f676c67eSJeremy White gtk_cflags="$gtk_cflags $x11_cflags" 2912f676c67eSJeremy White gtk_libs="$gtk_libs $x11_libs" 29130a337ed0SGerd Hoffmann fi 2914bbbf9bfbSStefan Weil gtk="yes" 2915bbbf9bfbSStefan Weil elif test "$gtk" = "yes"; then 29165fe309ffSGerd Hoffmann feature_not_found "gtk" "Install gtk3-devel" 2917bbbf9bfbSStefan Weil else 2918bbbf9bfbSStefan Weil gtk="no" 2919bbbf9bfbSStefan Weil fi 2920bbbf9bfbSStefan Weilfi 2921bbbf9bfbSStefan Weil 2922ddbb0d09SDaniel P. Berrange 2923ddbb0d09SDaniel P. Berrange########################################## 2924ddbb0d09SDaniel P. Berrange# GNUTLS probe 2925ddbb0d09SDaniel P. Berrange 2926ddbb0d09SDaniel P. Berrangeif test "$gnutls" != "no"; then 2927a73e82efSRichard Henderson pass="no" 2928a0722409SDaniel P. Berrangé if $pkg_config --exists "gnutls >= 3.1.18"; then 292989138857SStefan Weil gnutls_cflags=$($pkg_config --cflags gnutls) 293089138857SStefan Weil gnutls_libs=$($pkg_config --libs gnutls) 2931a73e82efSRichard Henderson # Packaging for the static libraries is not always correct. 2932a73e82efSRichard Henderson # At least ubuntu 18.04 ships only shared libraries. 2933a73e82efSRichard Henderson write_c_skeleton 2934a73e82efSRichard Henderson if compile_prog "" "$gnutls_libs" ; then 2935243dc2cfSRichard Henderson LIBS="$gnutls_libs $LIBS" 2936ddbb0d09SDaniel P. Berrange QEMU_CFLAGS="$QEMU_CFLAGS $gnutls_cflags" 2937a73e82efSRichard Henderson pass="yes" 2938a73e82efSRichard Henderson fi 2939a73e82efSRichard Henderson fi 2940a73e82efSRichard Henderson if test "$pass" = "no" && test "$gnutls" = "yes"; then 2941a0722409SDaniel P. Berrangé feature_not_found "gnutls" "Install gnutls devel >= 3.1.18" 2942ddbb0d09SDaniel P. Berrange else 2943a73e82efSRichard Henderson gnutls="$pass" 2944ddbb0d09SDaniel P. Berrange fi 2945ddbb0d09SDaniel P. Berrangefi 2946ddbb0d09SDaniel P. Berrange 294791bfcdb0SDaniel P. Berrange 294891bfcdb0SDaniel P. Berrange# If user didn't give a --disable/enable-gcrypt flag, 294991bfcdb0SDaniel P. Berrange# then mark as disabled if user requested nettle 2950a0722409SDaniel P. Berrangé# explicitly 295191bfcdb0SDaniel P. Berrangeif test -z "$gcrypt" 295291bfcdb0SDaniel P. Berrangethen 2953a0722409SDaniel P. Berrangé if test "$nettle" = "yes" 295491bfcdb0SDaniel P. Berrange then 295591bfcdb0SDaniel P. Berrange gcrypt="no" 295691bfcdb0SDaniel P. Berrange fi 295791bfcdb0SDaniel P. Berrangefi 295891bfcdb0SDaniel P. Berrange 295991bfcdb0SDaniel P. Berrange# If user didn't give a --disable/enable-nettle flag, 296091bfcdb0SDaniel P. Berrange# then mark as disabled if user requested gcrypt 2961a0722409SDaniel P. Berrangé# explicitly 296291bfcdb0SDaniel P. Berrangeif test -z "$nettle" 296391bfcdb0SDaniel P. Berrangethen 2964a0722409SDaniel P. Berrangé if test "$gcrypt" = "yes" 296591bfcdb0SDaniel P. Berrange then 296691bfcdb0SDaniel P. Berrange nettle="no" 296791bfcdb0SDaniel P. Berrange fi 296891bfcdb0SDaniel P. Berrangefi 296991bfcdb0SDaniel P. Berrange 2970dea7a64eSDaniel P. Berrangéhas_libgcrypt() { 297191bfcdb0SDaniel P. Berrange if ! has "libgcrypt-config" 297291bfcdb0SDaniel P. Berrange then 297391bfcdb0SDaniel P. Berrange return 1 297491bfcdb0SDaniel P. Berrange fi 297591bfcdb0SDaniel P. Berrange 297691bfcdb0SDaniel P. Berrange if test -n "$cross_prefix" 297791bfcdb0SDaniel P. Berrange then 297889138857SStefan Weil host=$(libgcrypt-config --host) 297991bfcdb0SDaniel P. Berrange if test "$host-" != $cross_prefix 298091bfcdb0SDaniel P. Berrange then 298191bfcdb0SDaniel P. Berrange return 1 298291bfcdb0SDaniel P. Berrange fi 298391bfcdb0SDaniel P. Berrange fi 298491bfcdb0SDaniel P. Berrange 2985dea7a64eSDaniel P. Berrangé maj=`libgcrypt-config --version | awk -F . '{print $1}'` 2986dea7a64eSDaniel P. Berrangé min=`libgcrypt-config --version | awk -F . '{print $2}'` 2987dea7a64eSDaniel P. Berrangé 2988dea7a64eSDaniel P. Berrangé if test $maj != 1 || test $min -lt 5 2989dea7a64eSDaniel P. Berrangé then 2990dea7a64eSDaniel P. Berrangé return 1 2991dea7a64eSDaniel P. Berrangé fi 2992dea7a64eSDaniel P. Berrangé 299391bfcdb0SDaniel P. Berrange return 0 299491bfcdb0SDaniel P. Berrange} 299591bfcdb0SDaniel P. Berrange 2996a0722409SDaniel P. Berrangé 2997a0722409SDaniel P. Berrangéif test "$nettle" != "no"; then 2998a73e82efSRichard Henderson pass="no" 299964dd2f3bSDaniel P. Berrangé if $pkg_config --exists "nettle >= 2.7.1"; then 3000a0722409SDaniel P. Berrangé nettle_cflags=$($pkg_config --cflags nettle) 3001a0722409SDaniel P. Berrangé nettle_libs=$($pkg_config --libs nettle) 3002a0722409SDaniel P. Berrangé nettle_version=$($pkg_config --modversion nettle) 3003a73e82efSRichard Henderson # Link test to make sure the given libraries work (e.g for static). 3004a73e82efSRichard Henderson write_c_skeleton 3005a73e82efSRichard Henderson if compile_prog "" "$nettle_libs" ; then 3006243dc2cfSRichard Henderson LIBS="$nettle_libs $LIBS" 3007a0722409SDaniel P. Berrangé QEMU_CFLAGS="$QEMU_CFLAGS $nettle_cflags" 3008a0722409SDaniel P. Berrangé if test -z "$gcrypt"; then 3009a0722409SDaniel P. Berrangé gcrypt="no" 3010a0722409SDaniel P. Berrangé fi 3011a73e82efSRichard Henderson pass="yes" 3012a73e82efSRichard Henderson fi 3013a73e82efSRichard Henderson fi 3014dc2207afSDaniel P. Berrangé if test "$pass" = "yes" 3015dc2207afSDaniel P. Berrangé then 3016dc2207afSDaniel P. Berrangé cat > $TMPC << EOF 3017dc2207afSDaniel P. Berrangé#include <nettle/xts.h> 3018dc2207afSDaniel P. Berrangéint main(void) { 3019dc2207afSDaniel P. Berrangé return 0; 3020dc2207afSDaniel P. Berrangé} 3021dc2207afSDaniel P. BerrangéEOF 3022dc2207afSDaniel P. Berrangé if compile_prog "$nettle_cflags" "$nettle_libs" ; then 3023dc2207afSDaniel P. Berrangé nettle_xts=yes 3024dc2207afSDaniel P. Berrangé qemu_private_xts=no 3025dc2207afSDaniel P. Berrangé fi 3026dc2207afSDaniel P. Berrangé fi 3027a73e82efSRichard Henderson if test "$pass" = "no" && test "$nettle" = "yes"; then 302864dd2f3bSDaniel P. Berrangé feature_not_found "nettle" "Install nettle devel >= 2.7.1" 3029a0722409SDaniel P. Berrangé else 3030a73e82efSRichard Henderson nettle="$pass" 3031a0722409SDaniel P. Berrangé fi 3032a0722409SDaniel P. Berrangéfi 3033a0722409SDaniel P. Berrangé 303491bfcdb0SDaniel P. Berrangeif test "$gcrypt" != "no"; then 3035a73e82efSRichard Henderson pass="no" 3036dea7a64eSDaniel P. Berrangé if has_libgcrypt; then 303789138857SStefan Weil gcrypt_cflags=$(libgcrypt-config --cflags) 303889138857SStefan Weil gcrypt_libs=$(libgcrypt-config --libs) 3039a73e82efSRichard Henderson # Debian has removed -lgpg-error from libgcrypt-config 304091bfcdb0SDaniel P. Berrange # as it "spreads unnecessary dependencies" which in 304191bfcdb0SDaniel P. Berrange # turn breaks static builds... 304291bfcdb0SDaniel P. Berrange if test "$static" = "yes" 304391bfcdb0SDaniel P. Berrange then 304491bfcdb0SDaniel P. Berrange gcrypt_libs="$gcrypt_libs -lgpg-error" 304591bfcdb0SDaniel P. Berrange fi 30461f923c70SLongpeng(Mike) 3047a73e82efSRichard Henderson # Link test to make sure the given libraries work (e.g for static). 3048a73e82efSRichard Henderson write_c_skeleton 3049a73e82efSRichard Henderson if compile_prog "" "$gcrypt_libs" ; then 3050243dc2cfSRichard Henderson LIBS="$gcrypt_libs $LIBS" 305137788f25SDaniel P. Berrange QEMU_CFLAGS="$QEMU_CFLAGS $gcrypt_cflags" 3052a73e82efSRichard Henderson pass="yes" 3053a73e82efSRichard Henderson fi 3054a73e82efSRichard Henderson fi 3055a73e82efSRichard Henderson if test "$pass" = "yes"; then 305637788f25SDaniel P. Berrange gcrypt="yes" 30571f923c70SLongpeng(Mike) cat > $TMPC << EOF 30581f923c70SLongpeng(Mike)#include <gcrypt.h> 30591f923c70SLongpeng(Mike)int main(void) { 30601f923c70SLongpeng(Mike) gcry_mac_hd_t handle; 30611f923c70SLongpeng(Mike) gcry_mac_open(&handle, GCRY_MAC_HMAC_MD5, 30621f923c70SLongpeng(Mike) GCRY_MAC_FLAG_SECURE, NULL); 30631f923c70SLongpeng(Mike) return 0; 30641f923c70SLongpeng(Mike)} 30651f923c70SLongpeng(Mike)EOF 30661f923c70SLongpeng(Mike) if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then 30671f923c70SLongpeng(Mike) gcrypt_hmac=yes 30681f923c70SLongpeng(Mike) fi 3069e0576942SDaniel P. Berrangé cat > $TMPC << EOF 3070e0576942SDaniel P. Berrangé#include <gcrypt.h> 3071e0576942SDaniel P. Berrangéint main(void) { 3072e0576942SDaniel P. Berrangé gcry_cipher_hd_t handle; 3073e0576942SDaniel P. Berrangé gcry_cipher_open(&handle, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_XTS, 0); 3074e0576942SDaniel P. Berrangé return 0; 3075e0576942SDaniel P. Berrangé} 3076e0576942SDaniel P. BerrangéEOF 3077e0576942SDaniel P. Berrangé if compile_prog "$gcrypt_cflags" "$gcrypt_libs" ; then 3078e0576942SDaniel P. Berrangé gcrypt_xts=yes 3079e0576942SDaniel P. Berrangé qemu_private_xts=no 3080e0576942SDaniel P. Berrangé fi 3081a73e82efSRichard Henderson elif test "$gcrypt" = "yes"; then 3082dea7a64eSDaniel P. Berrangé feature_not_found "gcrypt" "Install gcrypt devel >= 1.5.0" 308391bfcdb0SDaniel P. Berrange else 308491bfcdb0SDaniel P. Berrange gcrypt="no" 308591bfcdb0SDaniel P. Berrange fi 308662893b67SDaniel P. Berrangefi 308762893b67SDaniel P. Berrange 3088ddbb0d09SDaniel P. Berrange 308991bfcdb0SDaniel P. Berrangeif test "$gcrypt" = "yes" && test "$nettle" = "yes" 309091bfcdb0SDaniel P. Berrangethen 309191bfcdb0SDaniel P. Berrange error_exit "Only one of gcrypt & nettle can be enabled" 309291bfcdb0SDaniel P. Berrangefi 3093ed754746SDaniel P. Berrange 30949a2fd434SDaniel P. Berrange########################################## 30959a2fd434SDaniel P. Berrange# libtasn1 - only for the TLS creds/session test suite 30969a2fd434SDaniel P. Berrange 30979a2fd434SDaniel P. Berrangetasn1=yes 309890246037SDaniel P. Berrangetasn1_cflags="" 309990246037SDaniel P. Berrangetasn1_libs="" 31009a2fd434SDaniel P. Berrangeif $pkg_config --exists "libtasn1"; then 310189138857SStefan Weil tasn1_cflags=$($pkg_config --cflags libtasn1) 310289138857SStefan Weil tasn1_libs=$($pkg_config --libs libtasn1) 31039a2fd434SDaniel P. Berrangeelse 31049a2fd434SDaniel P. Berrange tasn1=no 31059a2fd434SDaniel P. Berrangefi 31069a2fd434SDaniel P. Berrange 3107ed754746SDaniel P. Berrange 3108bbbf9bfbSStefan Weil########################################## 31098953caf3SDaniel P. Berrange# PAM probe 31108953caf3SDaniel P. Berrange 31118953caf3SDaniel P. Berrangeif test "$auth_pam" != "no"; then 31128953caf3SDaniel P. Berrange cat > $TMPC <<EOF 31138953caf3SDaniel P. Berrange#include <security/pam_appl.h> 31148953caf3SDaniel P. Berrange#include <stdio.h> 31158953caf3SDaniel P. Berrangeint main(void) { 31168953caf3SDaniel P. Berrange const char *service_name = "qemu"; 31178953caf3SDaniel P. Berrange const char *user = "frank"; 31189c9642d0SDr. David Alan Gilbert const struct pam_conv pam_conv = { 0 }; 31198953caf3SDaniel P. Berrange pam_handle_t *pamh = NULL; 31209c9642d0SDr. David Alan Gilbert pam_start(service_name, user, &pam_conv, &pamh); 31218953caf3SDaniel P. Berrange return 0; 31228953caf3SDaniel P. Berrange} 31238953caf3SDaniel P. BerrangeEOF 31248953caf3SDaniel P. Berrange if compile_prog "" "-lpam" ; then 31258953caf3SDaniel P. Berrange auth_pam=yes 31268953caf3SDaniel P. Berrange else 31278953caf3SDaniel P. Berrange if test "$auth_pam" = "yes"; then 31288953caf3SDaniel P. Berrange feature_not_found "PAM" "Install PAM development package" 31298953caf3SDaniel P. Berrange else 31308953caf3SDaniel P. Berrange auth_pam=no 31318953caf3SDaniel P. Berrange fi 31328953caf3SDaniel P. Berrange fi 31338953caf3SDaniel P. Berrangefi 31348953caf3SDaniel P. Berrange 31358953caf3SDaniel P. Berrange########################################## 3136559607eaSDaniel P. Berrange# getifaddrs (for tests/test-io-channel-socket ) 3137559607eaSDaniel P. Berrange 3138559607eaSDaniel P. Berrangehave_ifaddrs_h=yes 3139559607eaSDaniel P. Berrangeif ! check_include "ifaddrs.h" ; then 3140559607eaSDaniel P. Berrange have_ifaddrs_h=no 3141559607eaSDaniel P. Berrangefi 3142559607eaSDaniel P. Berrange 3143559607eaSDaniel P. Berrange########################################## 3144bbbf9bfbSStefan Weil# VTE probe 3145bbbf9bfbSStefan Weil 3146bbbf9bfbSStefan Weilif test "$vte" != "no"; then 3147c6feff9eSCole Robinson vteminversion="0.32.0" 3148c6feff9eSCole Robinson if $pkg_config --exists "vte-2.91"; then 3149c6feff9eSCole Robinson vtepackage="vte-2.91" 3150c6feff9eSCole Robinson else 3151528de90aSDaniel P. Berrange vtepackage="vte-2.90" 3152c6feff9eSCole Robinson fi 3153c6feff9eSCole Robinson if $pkg_config --exists "$vtepackage >= $vteminversion"; then 315489138857SStefan Weil vte_cflags=$($pkg_config --cflags $vtepackage) 315589138857SStefan Weil vte_libs=$($pkg_config --libs $vtepackage) 315689138857SStefan Weil vteversion=$($pkg_config --modversion $vtepackage) 3157bbbf9bfbSStefan Weil vte="yes" 3158bbbf9bfbSStefan Weil elif test "$vte" = "yes"; then 3159c6feff9eSCole Robinson feature_not_found "vte" "Install libvte-2.90/2.91 devel" 31609e04c683SStefan Weil else 3161bbbf9bfbSStefan Weil vte="no" 3162a4ccabcfSAnthony Liguori fi 3163a4ccabcfSAnthony Liguorifi 3164a4ccabcfSAnthony Liguori 3165a4ccabcfSAnthony Liguori########################################## 316611d9f695Sbellard# SDL probe 316711d9f695Sbellard 3168aee8a619SCarlo Marcelo Arenas Belón# Look for sdl configuration program (pkg-config or sdl2-config). Try 3169aee8a619SCarlo Marcelo Arenas Belón# sdl2-config even without cross prefix, and favour pkg-config over sdl2-config. 317047c03744SDave Airlie 3171c6093a05SPeter Xusdl_probe () 3172c6093a05SPeter Xu{ 31730015ca5cSDaniel P. Berrangé if $pkg_config sdl2 --exists; then 31740015ca5cSDaniel P. Berrangé sdlconfig="$pkg_config sdl2" 317589138857SStefan Weil sdlversion=$($sdlconfig --modversion 2>/dev/null) 3176aee8a619SCarlo Marcelo Arenas Belón elif has "$sdl2_config"; then 31770015ca5cSDaniel P. Berrangé sdlconfig="$sdl2_config" 317889138857SStefan Weil sdlversion=$($sdlconfig --version) 3179a0dfd8a4SLoïc Minier else 3180a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 31818f4ea9cdSGerd Hoffmann feature_not_found "sdl" "Install SDL2-devel" 3182a0dfd8a4SLoïc Minier fi 3183a0dfd8a4SLoïc Minier sdl=no 3184c6093a05SPeter Xu # no need to do the rest 3185c6093a05SPeter Xu return 31869316f803SPaolo Bonzini fi 3187aee8a619SCarlo Marcelo Arenas Belón if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl2-config; then 31883ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 31893ec87ffeSPaolo Bonzini fi 319011d9f695Sbellard 319111d9f695Sbellard cat > $TMPC << EOF 319211d9f695Sbellard#include <SDL.h> 319311d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 319411d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 319511d9f695SbellardEOF 319689138857SStefan Weil sdl_cflags=$($sdlconfig --cflags 2>/dev/null) 31972ca5c430SGerd Hoffmann sdl_cflags="$sdl_cflags -Wno-undef" # workaround 2.0.8 bug 319874f42e18STeLeMan if test "$static" = "yes" ; then 31990015ca5cSDaniel P. Berrangé if $pkg_config sdl2 --exists; then 32000015ca5cSDaniel P. Berrangé sdl_libs=$($pkg_config sdl2 --static --libs 2>/dev/null) 32015f37e6d4SThomas Huth else 320289138857SStefan Weil sdl_libs=$($sdlconfig --static-libs 2>/dev/null) 32035f37e6d4SThomas Huth fi 320474f42e18STeLeMan else 320589138857SStefan Weil sdl_libs=$($sdlconfig --libs 2>/dev/null) 320674f42e18STeLeMan fi 320752166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 320811d9f695Sbellard sdl=yes 32097c1f25b4Sbellard 321067c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 3211e633a5c6SEric Blake if test "$sdl" = "yes" && test "$static" = "yes" ; then 321267c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 321389138857SStefan Weil sdl_libs="$sdl_libs $(aalib-config --static-libs 2>/dev/null)" 321489138857SStefan Weil sdl_cflags="$sdl_cflags $(aalib-config --cflags 2>/dev/null)" 321511d9f695Sbellard fi 321652166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 32171ac88f28SJuan Quintela : 32181ac88f28SJuan Quintela else 32191ac88f28SJuan Quintela sdl=no 32207c1f25b4Sbellard fi 32217c1f25b4Sbellard fi # static link 3222c4198157SJuan Quintela else # sdl not found 3223c4198157SJuan Quintela if test "$sdl" = "yes" ; then 32240015ca5cSDaniel P. Berrangé feature_not_found "sdl" "Install SDL2 devel" 3225c4198157SJuan Quintela fi 3226c4198157SJuan Quintela sdl=no 32277c1f25b4Sbellard fi # sdl compile test 3228c6093a05SPeter Xu} 3229c6093a05SPeter Xu 3230a442fe2fSDaniel P. Berrangésdl_image_probe () 3231a442fe2fSDaniel P. Berrangé{ 3232a442fe2fSDaniel P. Berrangé if test "$sdl_image" != "no" ; then 3233a442fe2fSDaniel P. Berrangé if $pkg_config SDL2_image --exists; then 3234a442fe2fSDaniel P. Berrangé if test "$static" = "yes"; then 3235a442fe2fSDaniel P. Berrangé sdl_image_libs=$($pkg_config SDL2_image --libs --static 2>/dev/null) 3236a442fe2fSDaniel P. Berrangé else 3237a442fe2fSDaniel P. Berrangé sdl_image_libs=$($pkg_config SDL2_image --libs 2>/dev/null) 3238a442fe2fSDaniel P. Berrangé fi 3239a442fe2fSDaniel P. Berrangé sdl_image_cflags=$($pkg_config SDL2_image --cflags 2>/dev/null) 3240a442fe2fSDaniel P. Berrangé sdl_image=yes 3241a442fe2fSDaniel P. Berrangé 3242a442fe2fSDaniel P. Berrangé sdl_cflags="$sdl_cflags $sdl_image_cflags" 3243a442fe2fSDaniel P. Berrangé sdl_libs="$sdl_libs $sdl_image_libs" 3244a442fe2fSDaniel P. Berrangé else 3245a442fe2fSDaniel P. Berrangé if test "$sdl_image" = "yes" ; then 3246a442fe2fSDaniel P. Berrangé feature_not_found "sdl_image" "Install SDL Image devel" 3247a442fe2fSDaniel P. Berrangé else 3248a442fe2fSDaniel P. Berrangé sdl_image=no 3249a442fe2fSDaniel P. Berrangé fi 3250a442fe2fSDaniel P. Berrangé fi 3251a442fe2fSDaniel P. Berrangé fi 3252a442fe2fSDaniel P. Berrangé} 3253a442fe2fSDaniel P. Berrangé 3254c6093a05SPeter Xuif test "$sdl" != "no" ; then 3255c6093a05SPeter Xu sdl_probe 3256fd677642Sthsfi 325711d9f695Sbellard 32585368a422Saliguoriif test "$sdl" = "yes" ; then 3259a442fe2fSDaniel P. Berrangé sdl_image_probe 3260a442fe2fSDaniel P. Berrangéelse 3261a442fe2fSDaniel P. Berrangé if test "$sdl_image" = "yes"; then 3262a442fe2fSDaniel P. Berrangé echo "warning: SDL Image requested, but SDL is not available, disabling" 3263a442fe2fSDaniel P. Berrangé fi 3264a442fe2fSDaniel P. Berrangé sdl_image=no 3265a442fe2fSDaniel P. Berrangéfi 3266a442fe2fSDaniel P. Berrangé 3267a442fe2fSDaniel P. Berrangéif test "$sdl" = "yes" ; then 32685368a422Saliguori cat > $TMPC <<EOF 32695368a422Saliguori#include <SDL.h> 32705368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 32715368a422Saliguori#include <X11/XKBlib.h> 32725368a422Saliguori#else 32735368a422Saliguori#error No x11 support 32745368a422Saliguori#endif 32755368a422Saliguoriint main(void) { return 0; } 32765368a422SaliguoriEOF 3277f676c67eSJeremy White if compile_prog "$sdl_cflags $x11_cflags" "$sdl_libs $x11_libs" ; then 32788781595bSGerd Hoffmann need_x11=yes 3279f676c67eSJeremy White sdl_cflags="$sdl_cflags $x11_cflags" 3280f676c67eSJeremy White sdl_libs="$sdl_libs $x11_libs" 32815368a422Saliguori fi 32825368a422Saliguorifi 32835368a422Saliguori 32848f28f3fbSths########################################## 32852da776dbSMichael R. Hines# RDMA needs OpenFabrics libraries 32862da776dbSMichael R. Hinesif test "$rdma" != "no" ; then 32872da776dbSMichael R. Hines cat > $TMPC <<EOF 32882da776dbSMichael R. Hines#include <rdma/rdma_cma.h> 32892da776dbSMichael R. Hinesint main(void) { return 0; } 32902da776dbSMichael R. HinesEOF 3291ef6d4ccdSYuval Shaia rdma_libs="-lrdmacm -libverbs -libumad" 32922da776dbSMichael R. Hines if compile_prog "" "$rdma_libs" ; then 32932da776dbSMichael R. Hines rdma="yes" 3294ef6d4ccdSYuval Shaia libs_softmmu="$libs_softmmu $rdma_libs" 32952da776dbSMichael R. Hines else 32962da776dbSMichael R. Hines if test "$rdma" = "yes" ; then 32972da776dbSMichael R. Hines error_exit \ 3298ef6d4ccdSYuval Shaia " OpenFabrics librdmacm/libibverbs/libibumad not present." \ 32992da776dbSMichael R. Hines " Your options:" \ 3300ef6d4ccdSYuval Shaia " (1) Fast: Install infiniband packages (devel) from your distro." \ 33012da776dbSMichael R. Hines " (2) Cleanest: Install libraries from www.openfabrics.org" \ 33022da776dbSMichael R. Hines " (3) Also: Install softiwarp if you don't have RDMA hardware" 33032da776dbSMichael R. Hines fi 33042da776dbSMichael R. Hines rdma="no" 33052da776dbSMichael R. Hines fi 33062da776dbSMichael R. Hinesfi 33072da776dbSMichael R. Hines 330821ab34c9SMarcel Apfelbaum########################################## 330921ab34c9SMarcel Apfelbaum# PVRDMA detection 331021ab34c9SMarcel Apfelbaum 331121ab34c9SMarcel Apfelbaumcat > $TMPC <<EOF && 331221ab34c9SMarcel Apfelbaum#include <sys/mman.h> 331321ab34c9SMarcel Apfelbaum 331421ab34c9SMarcel Apfelbaumint 331521ab34c9SMarcel Apfelbaummain(void) 331621ab34c9SMarcel Apfelbaum{ 331721ab34c9SMarcel Apfelbaum char buf = 0; 331821ab34c9SMarcel Apfelbaum void *addr = &buf; 331921ab34c9SMarcel Apfelbaum addr = mremap(addr, 0, 1, MREMAP_MAYMOVE | MREMAP_FIXED); 332021ab34c9SMarcel Apfelbaum 332121ab34c9SMarcel Apfelbaum return 0; 332221ab34c9SMarcel Apfelbaum} 332321ab34c9SMarcel ApfelbaumEOF 332421ab34c9SMarcel Apfelbaum 332521ab34c9SMarcel Apfelbaumif test "$rdma" = "yes" ; then 332621ab34c9SMarcel Apfelbaum case "$pvrdma" in 332721ab34c9SMarcel Apfelbaum "") 332821ab34c9SMarcel Apfelbaum if compile_prog "" ""; then 332921ab34c9SMarcel Apfelbaum pvrdma="yes" 333021ab34c9SMarcel Apfelbaum else 333121ab34c9SMarcel Apfelbaum pvrdma="no" 333221ab34c9SMarcel Apfelbaum fi 333321ab34c9SMarcel Apfelbaum ;; 333421ab34c9SMarcel Apfelbaum "yes") 333521ab34c9SMarcel Apfelbaum if ! compile_prog "" ""; then 333621ab34c9SMarcel Apfelbaum error_exit "PVRDMA is not supported since mremap is not implemented" 333721ab34c9SMarcel Apfelbaum fi 333821ab34c9SMarcel Apfelbaum pvrdma="yes" 333921ab34c9SMarcel Apfelbaum ;; 334021ab34c9SMarcel Apfelbaum "no") 334121ab34c9SMarcel Apfelbaum pvrdma="no" 334221ab34c9SMarcel Apfelbaum ;; 334321ab34c9SMarcel Apfelbaum esac 334421ab34c9SMarcel Apfelbaumelse 334521ab34c9SMarcel Apfelbaum if test "$pvrdma" = "yes" ; then 334621ab34c9SMarcel Apfelbaum error_exit "PVRDMA requires rdma suppport" 334721ab34c9SMarcel Apfelbaum fi 334821ab34c9SMarcel Apfelbaum pvrdma="no" 334921ab34c9SMarcel Apfelbaumfi 335095c6bff3SBenoît Canet 3351ee108585SYuval Shaia# Let's see if enhanced reg_mr is supported 3352ee108585SYuval Shaiaif test "$pvrdma" = "yes" ; then 3353ee108585SYuval Shaia 3354ee108585SYuval Shaiacat > $TMPC <<EOF && 3355ee108585SYuval Shaia#include <infiniband/verbs.h> 3356ee108585SYuval Shaia 3357ee108585SYuval Shaiaint 3358ee108585SYuval Shaiamain(void) 3359ee108585SYuval Shaia{ 3360ee108585SYuval Shaia struct ibv_mr *mr; 3361ee108585SYuval Shaia struct ibv_pd *pd = NULL; 3362ee108585SYuval Shaia size_t length = 10; 3363ee108585SYuval Shaia uint64_t iova = 0; 3364ee108585SYuval Shaia int access = 0; 3365ee108585SYuval Shaia void *addr = NULL; 3366ee108585SYuval Shaia 3367ee108585SYuval Shaia mr = ibv_reg_mr_iova(pd, addr, length, iova, access); 3368ee108585SYuval Shaia 3369ee108585SYuval Shaia ibv_dereg_mr(mr); 3370ee108585SYuval Shaia 3371ee108585SYuval Shaia return 0; 3372ee108585SYuval Shaia} 3373ee108585SYuval ShaiaEOF 3374ee108585SYuval Shaia if ! compile_prog "" "-libverbs"; then 3375ee108585SYuval Shaia QEMU_CFLAGS="$QEMU_CFLAGS -DLEGACY_RDMA_REG_MR" 3376ee108585SYuval Shaia fi 3377ee108585SYuval Shaiafi 3378ee108585SYuval Shaia 337995c6bff3SBenoît Canet########################################## 33802f9606b3Saliguori# VNC SASL detection 3381e633a5c6SEric Blakeif test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then 33822f9606b3Saliguori cat > $TMPC <<EOF 33832f9606b3Saliguori#include <sasl/sasl.h> 33842f9606b3Saliguori#include <stdio.h> 33852f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 33862f9606b3SaliguoriEOF 33872f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 3388bd702ffcSPhilippe Mathieu-Daudé # QEMU defines struct iovec in "qemu/osdep.h", 3389bd702ffcSPhilippe Mathieu-Daudé # we don't want libsasl to redefine it in <sasl/sasl.h>. 3390bd702ffcSPhilippe Mathieu-Daudé vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED" 33912f9606b3Saliguori vnc_sasl_libs="-lsasl2" 339252166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 3393ea784e3bSJuan Quintela vnc_sasl=yes 3394fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 3395ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" 33962f9606b3Saliguori else 3397ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 339821684af0SStewart Smith feature_not_found "vnc-sasl" "Install Cyrus SASL devel" 3399ea784e3bSJuan Quintela fi 3400ea784e3bSJuan Quintela vnc_sasl=no 34012f9606b3Saliguori fi 34022f9606b3Saliguorifi 34032f9606b3Saliguori 34042f9606b3Saliguori########################################## 34052f6f5c7aSCorentin Chary# VNC JPEG detection 3406e633a5c6SEric Blakeif test "$vnc" = "yes" && test "$vnc_jpeg" != "no" ; then 34072f6f5c7aSCorentin Charycat > $TMPC <<EOF 34082f6f5c7aSCorentin Chary#include <stdio.h> 34092f6f5c7aSCorentin Chary#include <jpeglib.h> 34102f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 34112f6f5c7aSCorentin CharyEOF 34122f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 34132f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 34142f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 34152f6f5c7aSCorentin Chary vnc_jpeg=yes 34162f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 3417ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" 34182f6f5c7aSCorentin Chary else 34192f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 342021684af0SStewart Smith feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" 34212f6f5c7aSCorentin Chary fi 34222f6f5c7aSCorentin Chary vnc_jpeg=no 34232f6f5c7aSCorentin Chary fi 34242f6f5c7aSCorentin Charyfi 34252f6f5c7aSCorentin Chary 34262f6f5c7aSCorentin Chary########################################## 3427efe556adSCorentin Chary# VNC PNG detection 3428e633a5c6SEric Blakeif test "$vnc" = "yes" && test "$vnc_png" != "no" ; then 3429efe556adSCorentin Charycat > $TMPC <<EOF 3430efe556adSCorentin Chary//#include <stdio.h> 3431efe556adSCorentin Chary#include <png.h> 3432832ce9c2SScott Wood#include <stddef.h> 3433efe556adSCorentin Charyint main(void) { 3434efe556adSCorentin Chary png_structp png_ptr; 3435efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 34367edc3fedSPeter Maydell return png_ptr != 0; 3437efe556adSCorentin Chary} 3438efe556adSCorentin CharyEOF 343965d5d3f9SStefan Weil if $pkg_config libpng --exists; then 344089138857SStefan Weil vnc_png_cflags=$($pkg_config libpng --cflags) 344189138857SStefan Weil vnc_png_libs=$($pkg_config libpng --libs) 34429af8025eSBrad else 3443efe556adSCorentin Chary vnc_png_cflags="" 3444efe556adSCorentin Chary vnc_png_libs="-lpng" 34459af8025eSBrad fi 3446efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 3447efe556adSCorentin Chary vnc_png=yes 3448efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 34499af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 3450efe556adSCorentin Chary else 3451efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 345221684af0SStewart Smith feature_not_found "vnc-png" "Install libpng devel" 3453efe556adSCorentin Chary fi 3454efe556adSCorentin Chary vnc_png=no 3455efe556adSCorentin Chary fi 3456efe556adSCorentin Charyfi 3457efe556adSCorentin Chary 3458efe556adSCorentin Chary########################################## 34596a021536SGerd Hoffmann# xkbcommon probe 34606a021536SGerd Hoffmannif test "$xkbcommon" != "no" ; then 34616a021536SGerd Hoffmann if $pkg_config xkbcommon --exists; then 34626a021536SGerd Hoffmann xkbcommon_cflags=$($pkg_config xkbcommon --cflags) 34636a021536SGerd Hoffmann xkbcommon_libs=$($pkg_config xkbcommon --libs) 34646a021536SGerd Hoffmann xkbcommon=yes 34656a021536SGerd Hoffmann else 34666a021536SGerd Hoffmann if test "$xkbcommon" = "yes" ; then 34676a021536SGerd Hoffmann feature_not_found "xkbcommon" "Install libxkbcommon-devel" 34686a021536SGerd Hoffmann fi 34696a021536SGerd Hoffmann xkbcommon=no 34706a021536SGerd Hoffmann fi 34716a021536SGerd Hoffmannfi 34726a021536SGerd Hoffmann 347376655d6dSaliguori 347476655d6dSaliguori########################################## 3475c1bb86cdSEric Blake# xfsctl() probe, used for file-posix.c 3476dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 3477dce512deSChristoph Hellwig cat > $TMPC << EOF 3478ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 3479dce512deSChristoph Hellwig#include <xfs/xfs.h> 3480dce512deSChristoph Hellwigint main(void) 3481dce512deSChristoph Hellwig{ 3482dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 3483dce512deSChristoph Hellwig return 0; 3484dce512deSChristoph Hellwig} 3485dce512deSChristoph HellwigEOF 3486dce512deSChristoph Hellwig if compile_prog "" "" ; then 3487dce512deSChristoph Hellwig xfs="yes" 3488dce512deSChristoph Hellwig else 3489dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 349021684af0SStewart Smith feature_not_found "xfs" "Instal xfsprogs/xfslibs devel" 3491dce512deSChristoph Hellwig fi 3492dce512deSChristoph Hellwig xfs=no 3493dce512deSChristoph Hellwig fi 3494dce512deSChristoph Hellwigfi 3495dce512deSChristoph Hellwig 3496dce512deSChristoph Hellwig########################################## 34978a16d273Sths# vde libraries probe 3498dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 34994baae0acSJuan Quintela vde_libs="-lvdeplug" 35008a16d273Sths cat > $TMPC << EOF 35018a16d273Sths#include <libvdeplug.h> 35024a7f0e06Spbrookint main(void) 35034a7f0e06Spbrook{ 35044a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 3505fea08e08SPeter Maydell char s[] = ""; 3506fea08e08SPeter Maydell vde_open(s, s, &a); 35074a7f0e06Spbrook return 0; 35084a7f0e06Spbrook} 35098a16d273SthsEOF 351052166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 35114baae0acSJuan Quintela vde=yes 3512dfb278bdSJuan Quintela else 3513dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 351421684af0SStewart Smith feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" 3515dfb278bdSJuan Quintela fi 3516dfb278bdSJuan Quintela vde=no 35178a16d273Sths fi 35188a16d273Sthsfi 35198a16d273Sths 35208a16d273Sths########################################## 35210a985b37SVincenzo Maffione# netmap support probe 35220a985b37SVincenzo Maffione# Apart from looking for netmap headers, we make sure that the host API version 35230a985b37SVincenzo Maffione# supports the netmap backend (>=11). The upper bound (15) is meant to simulate 35240a985b37SVincenzo Maffione# a minor/major version number. Minor new features will be marked with values up 35250a985b37SVincenzo Maffione# to 15, and if something happens that requires a change to the backend we will 35260a985b37SVincenzo Maffione# move above 15, submit the backend fixes and modify this two bounds. 352758952137SVincenzo Maffioneif test "$netmap" != "no" ; then 352858952137SVincenzo Maffione cat > $TMPC << EOF 352958952137SVincenzo Maffione#include <inttypes.h> 353058952137SVincenzo Maffione#include <net/if.h> 353158952137SVincenzo Maffione#include <net/netmap.h> 353258952137SVincenzo Maffione#include <net/netmap_user.h> 35330a985b37SVincenzo Maffione#if (NETMAP_API < 11) || (NETMAP_API > 15) 35340a985b37SVincenzo Maffione#error 35350a985b37SVincenzo Maffione#endif 353658952137SVincenzo Maffioneint main(void) { return 0; } 353758952137SVincenzo MaffioneEOF 353858952137SVincenzo Maffione if compile_prog "" "" ; then 353958952137SVincenzo Maffione netmap=yes 354058952137SVincenzo Maffione else 354158952137SVincenzo Maffione if test "$netmap" = "yes" ; then 354258952137SVincenzo Maffione feature_not_found "netmap" 354358952137SVincenzo Maffione fi 354458952137SVincenzo Maffione netmap=no 354558952137SVincenzo Maffione fi 354658952137SVincenzo Maffionefi 354758952137SVincenzo Maffione 354858952137SVincenzo Maffione########################################## 354947e98658SCorey Bryant# libcap-ng library probe 355047e98658SCorey Bryantif test "$cap_ng" != "no" ; then 355147e98658SCorey Bryant cap_libs="-lcap-ng" 355247e98658SCorey Bryant cat > $TMPC << EOF 355347e98658SCorey Bryant#include <cap-ng.h> 355447e98658SCorey Bryantint main(void) 355547e98658SCorey Bryant{ 355647e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 355747e98658SCorey Bryant return 0; 355847e98658SCorey Bryant} 355947e98658SCorey BryantEOF 356047e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 356147e98658SCorey Bryant cap_ng=yes 356247e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 356347e98658SCorey Bryant else 356447e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 356521684af0SStewart Smith feature_not_found "cap_ng" "Install libcap-ng devel" 356647e98658SCorey Bryant fi 356747e98658SCorey Bryant cap_ng=no 356847e98658SCorey Bryant fi 356947e98658SCorey Bryantfi 357047e98658SCorey Bryant 357147e98658SCorey Bryant########################################## 3572c2de5c91Smalc# Sound support libraries probe 35738f28f3fbSths 357489138857SStefan Weilaudio_drv_list=$(echo "$audio_drv_list" | sed -e 's/,/ /g') 3575c2de5c91Smalcfor drv in $audio_drv_list; do 3576c2de5c91Smalc case $drv in 3577e42975a1SGerd Hoffmann alsa | try-alsa) 3578c80a867fSGerd Hoffmann if $pkg_config alsa --exists; then 3579c80a867fSGerd Hoffmann alsa_libs=$($pkg_config alsa --libs) 3580e42975a1SGerd Hoffmann if test "$drv" = "try-alsa"; then 3581e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa/alsa/') 3582e42975a1SGerd Hoffmann fi 3583e42975a1SGerd Hoffmann else 3584e42975a1SGerd Hoffmann if test "$drv" = "try-alsa"; then 3585e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-alsa//') 3586c80a867fSGerd Hoffmann else 3587c80a867fSGerd Hoffmann error_exit "$drv check failed" \ 3588c80a867fSGerd Hoffmann "Make sure to have the $drv libs and headers installed." 3589c80a867fSGerd Hoffmann fi 3590e42975a1SGerd Hoffmann fi 3591c2de5c91Smalc ;; 3592c2de5c91Smalc 3593e42975a1SGerd Hoffmann pa | try-pa) 3594c80a867fSGerd Hoffmann if $pkg_config libpulse --exists; then 3595c80a867fSGerd Hoffmann pulse_libs=$($pkg_config libpulse --libs) 3596e42975a1SGerd Hoffmann if test "$drv" = "try-pa"; then 3597e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa/pa/') 3598e42975a1SGerd Hoffmann fi 3599e42975a1SGerd Hoffmann else 3600e42975a1SGerd Hoffmann if test "$drv" = "try-pa"; then 3601e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-pa//') 3602c80a867fSGerd Hoffmann else 3603c80a867fSGerd Hoffmann error_exit "$drv check failed" \ 3604c80a867fSGerd Hoffmann "Make sure to have the $drv libs and headers installed." 3605c80a867fSGerd Hoffmann fi 3606e42975a1SGerd Hoffmann fi 3607b8e59f18Smalc ;; 3608b8e59f18Smalc 3609373967b2SGerd Hoffmann sdl) 3610373967b2SGerd Hoffmann if test "$sdl" = "no"; then 3611373967b2SGerd Hoffmann error_exit "sdl not found or disabled, can not use sdl audio driver" 3612373967b2SGerd Hoffmann fi 3613373967b2SGerd Hoffmann ;; 3614373967b2SGerd Hoffmann 3615e42975a1SGerd Hoffmann try-sdl) 3616e42975a1SGerd Hoffmann if test "$sdl" = "no"; then 3617e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl//') 3618e42975a1SGerd Hoffmann else 3619e42975a1SGerd Hoffmann audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-sdl/sdl/') 3620e42975a1SGerd Hoffmann fi 3621e42975a1SGerd Hoffmann ;; 3622e42975a1SGerd Hoffmann 3623997e690aSJuan Quintela coreaudio) 3624b1149911SFam Zheng coreaudio_libs="-framework CoreAudio" 3625997e690aSJuan Quintela ;; 3626997e690aSJuan Quintela 3627a4bf6780SJuan Quintela dsound) 3628b1149911SFam Zheng dsound_libs="-lole32 -ldxguid" 3629d5631638Smalc audio_win_int="yes" 3630a4bf6780SJuan Quintela ;; 3631a4bf6780SJuan Quintela 3632a4bf6780SJuan Quintela oss) 3633b1149911SFam Zheng oss_libs="$oss_lib" 3634a4bf6780SJuan Quintela ;; 3635a4bf6780SJuan Quintela 36362e445703SGeoffrey McRae jack | try-jack) 36372e445703SGeoffrey McRae if $pkg_config jack --exists; then 36382e445703SGeoffrey McRae jack_libs=$($pkg_config jack --libs) 36392e445703SGeoffrey McRae if test "$drv" = "try-jack"; then 36402e445703SGeoffrey McRae audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack/jack/') 36412e445703SGeoffrey McRae fi 36422e445703SGeoffrey McRae else 36432e445703SGeoffrey McRae if test "$drv" = "try-jack"; then 36442e445703SGeoffrey McRae audio_drv_list=$(echo "$audio_drv_list" | sed -e 's/try-jack//') 36452e445703SGeoffrey McRae else 36462e445703SGeoffrey McRae error_exit "$drv check failed" \ 36472e445703SGeoffrey McRae "Make sure to have the $drv libs and headers installed." 36482e445703SGeoffrey McRae fi 36492e445703SGeoffrey McRae fi 36502e445703SGeoffrey McRae ;; 36512e445703SGeoffrey McRae 3652e4c63a6aSmalc *) 36531c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 365476ad07a4SPeter Maydell error_exit "Unknown driver '$drv' selected" \ 365576ad07a4SPeter Maydell "Possible drivers are: $audio_possible_drivers" 3656e4c63a6aSmalc } 3657e4c63a6aSmalc ;; 3658c2de5c91Smalc esac 3659c2de5c91Smalcdone 36608f28f3fbSths 36614d3b6f6eSbalrog########################################## 36622e4d9fb1Saurel32# BrlAPI probe 36632e4d9fb1Saurel32 36644ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 3665eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 36662e4d9fb1Saurel32 cat > $TMPC << EOF 36672e4d9fb1Saurel32#include <brlapi.h> 3668832ce9c2SScott Wood#include <stddef.h> 36692e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 36702e4d9fb1Saurel32EOF 367152166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 36722e4d9fb1Saurel32 brlapi=yes 36734ffcedb6SJuan Quintela else 36744ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 367521684af0SStewart Smith feature_not_found "brlapi" "Install brlapi devel" 36764ffcedb6SJuan Quintela fi 36774ffcedb6SJuan Quintela brlapi=no 3678eb82284fSJuan Quintela fi 3679eb82284fSJuan Quintelafi 36802e4d9fb1Saurel32 36812e4d9fb1Saurel32########################################## 3682e08bb301SSamuel Thibault# iconv probe 3683e08bb301SSamuel Thibaultif test "$iconv" != "no" ; then 3684e08bb301SSamuel Thibault cat > $TMPC << EOF 3685e08bb301SSamuel Thibault#include <iconv.h> 3686e08bb301SSamuel Thibaultint main(void) { 3687e08bb301SSamuel Thibault iconv_t conv = iconv_open("WCHAR_T", "UCS-2"); 3688e08bb301SSamuel Thibault return conv != (iconv_t) -1; 3689e08bb301SSamuel Thibault} 3690e08bb301SSamuel ThibaultEOF 3691e08bb301SSamuel Thibault iconv_prefix_list="/usr/local:/usr" 3692e08bb301SSamuel Thibault iconv_lib_list=":-liconv" 3693e08bb301SSamuel Thibault IFS=: 3694e08bb301SSamuel Thibault for iconv_prefix in $iconv_prefix_list; do 3695e08bb301SSamuel Thibault IFS=: 3696e08bb301SSamuel Thibault iconv_cflags="-I$iconv_prefix/include" 3697e08bb301SSamuel Thibault iconv_ldflags="-L$iconv_prefix/lib" 3698e08bb301SSamuel Thibault for iconv_link in $iconv_lib_list; do 3699e08bb301SSamuel Thibault unset IFS 3700e08bb301SSamuel Thibault iconv_lib="$iconv_ldflags $iconv_link" 3701e08bb301SSamuel Thibault echo "looking at iconv in '$iconv_cflags' '$iconv_lib'" >> config.log 3702e08bb301SSamuel Thibault if compile_prog "$iconv_cflags" "$iconv_lib" ; then 3703e08bb301SSamuel Thibault iconv_found=yes 3704e08bb301SSamuel Thibault break 3705e08bb301SSamuel Thibault fi 3706e08bb301SSamuel Thibault done 3707e08bb301SSamuel Thibault if test "$iconv_found" = yes ; then 3708e08bb301SSamuel Thibault break 3709e08bb301SSamuel Thibault fi 3710e08bb301SSamuel Thibault done 3711e08bb301SSamuel Thibault if test "$iconv_found" = "yes" ; then 3712e08bb301SSamuel Thibault iconv=yes 3713e08bb301SSamuel Thibault else 3714e08bb301SSamuel Thibault if test "$iconv" = "yes" ; then 3715e08bb301SSamuel Thibault feature_not_found "iconv" "Install iconv devel" 3716e08bb301SSamuel Thibault fi 3717e08bb301SSamuel Thibault iconv=no 3718e08bb301SSamuel Thibault fi 3719e08bb301SSamuel Thibaultfi 3720e08bb301SSamuel Thibault 3721e08bb301SSamuel Thibault########################################## 37224d3b6f6eSbalrog# curses probe 3723e08bb301SSamuel Thibaultif test "$iconv" = "no" ; then 3724e08bb301SSamuel Thibault # curses will need iconv 3725e08bb301SSamuel Thibault curses=no 3726e08bb301SSamuel Thibaultfi 3727a3605bf6SMichael Tokarevif test "$curses" != "no" ; then 3728e095e2f3SStefan Weil if test "$mingw32" = "yes" ; then 37298ddc5bf9SSamuel Thibault curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):" 37308ddc5bf9SSamuel Thibault curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses" 3731e095e2f3SStefan Weil else 37327c703002SSamuel Thibault curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:" 37338ddc5bf9SSamuel Thibault curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw" 3734e095e2f3SStefan Weil fi 3735c584a6d0SJuan Quintela curses_found=no 37364d3b6f6eSbalrog cat > $TMPC << EOF 37378ddc5bf9SSamuel Thibault#include <locale.h> 37384d3b6f6eSbalrog#include <curses.h> 37398ddc5bf9SSamuel Thibault#include <wchar.h> 37402f8b7cd5SSamuel Thibault#include <langinfo.h> 3741ef9a2524SStefan Weilint main(void) { 37422f8b7cd5SSamuel Thibault const char *codeset; 37438ddc5bf9SSamuel Thibault wchar_t wch = L'w'; 37448ddc5bf9SSamuel Thibault setlocale(LC_ALL, ""); 3745ef9a2524SStefan Weil resize_term(0, 0); 37468ddc5bf9SSamuel Thibault addwstr(L"wide chars\n"); 37478ddc5bf9SSamuel Thibault addnwstr(&wch, 1); 37487c703002SSamuel Thibault add_wch(WACS_DEGREE); 37492f8b7cd5SSamuel Thibault codeset = nl_langinfo(CODESET); 37502f8b7cd5SSamuel Thibault return codeset != 0; 3751ef9a2524SStefan Weil} 37524d3b6f6eSbalrogEOF 3753ecbe251fSVadim Evard IFS=: 37548ddc5bf9SSamuel Thibault for curses_inc in $curses_inc_list; do 3755b01a4fd3SPeter Maydell # Make sure we get the wide character prototypes 3756b01a4fd3SPeter Maydell curses_inc="-DNCURSES_WIDECHAR $curses_inc" 37577c703002SSamuel Thibault IFS=: 37588ddc5bf9SSamuel Thibault for curses_lib in $curses_lib_list; do 3759ecbe251fSVadim Evard unset IFS 37608ddc5bf9SSamuel Thibault if compile_prog "$curses_inc" "$curses_lib" ; then 3761c584a6d0SJuan Quintela curses_found=yes 37624f78ef9aSJuan Quintela break 37634d3b6f6eSbalrog fi 37644f78ef9aSJuan Quintela done 37657c703002SSamuel Thibault if test "$curses_found" = yes ; then 37667c703002SSamuel Thibault break 37677c703002SSamuel Thibault fi 37688ddc5bf9SSamuel Thibault done 3769ecbe251fSVadim Evard unset IFS 3770c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 3771c584a6d0SJuan Quintela curses=yes 3772c584a6d0SJuan Quintela else 3773c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 377421684af0SStewart Smith feature_not_found "curses" "Install ncurses devel" 3775c584a6d0SJuan Quintela fi 3776c584a6d0SJuan Quintela curses=no 3777c584a6d0SJuan Quintela fi 37784f78ef9aSJuan Quintelafi 37794d3b6f6eSbalrog 3780414f0dabSblueswir1########################################## 3781769ce76dSAlexander Graf# curl probe 3782a3605bf6SMichael Tokarevif test "$curl" != "no" ; then 378365d5d3f9SStefan Weil if $pkg_config libcurl --exists; then 3784a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 37854e2b0658SPaolo Bonzini else 37864e2b0658SPaolo Bonzini curlconfig=curl-config 37874e2b0658SPaolo Bonzini fi 3788769ce76dSAlexander Graf cat > $TMPC << EOF 3789769ce76dSAlexander Graf#include <curl/curl.h> 37900b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 3791769ce76dSAlexander GrafEOF 379289138857SStefan Weil curl_cflags=$($curlconfig --cflags 2>/dev/null) 379389138857SStefan Weil curl_libs=$($curlconfig --libs 2>/dev/null) 3794b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 3795769ce76dSAlexander Graf curl=yes 3796788c8196SJuan Quintela else 3797788c8196SJuan Quintela if test "$curl" = "yes" ; then 379821684af0SStewart Smith feature_not_found "curl" "Install libcurl devel" 3799788c8196SJuan Quintela fi 3800788c8196SJuan Quintela curl=no 3801769ce76dSAlexander Graf fi 3802769ce76dSAlexander Graffi # test "$curl" 3803769ce76dSAlexander Graf 3804769ce76dSAlexander Graf########################################## 3805e18df141SAnthony Liguori# glib support probe 3806a52d28afSPaolo Bonzini 380700f2cfbbSDaniel P. Berrangéglib_req_ver=2.48 3808aa0d1f44SPaolo Bonziniglib_modules=gthread-2.0 3809aa0d1f44SPaolo Bonziniif test "$modules" = yes; then 3810a88afc64SGerd Hoffmann glib_modules="$glib_modules gmodule-export-2.0" 3811aa0d1f44SPaolo Bonzinifi 381254cb65d8SEmilio G. Cotaif test "$plugins" = yes; then 381354cb65d8SEmilio G. Cota glib_modules="$glib_modules gmodule-2.0" 381454cb65d8SEmilio G. Cotafi 3815e26110cfSFam Zheng 38164eaf7202SSameeh Jubran# This workaround is required due to a bug in pkg-config file for glib as it 38174eaf7202SSameeh Jubran# doesn't define GLIB_STATIC_COMPILATION for pkg-config --static 38184eaf7202SSameeh Jubran 3819e633a5c6SEric Blakeif test "$static" = yes && test "$mingw32" = yes; then 38204eaf7202SSameeh Jubran QEMU_CFLAGS="-DGLIB_STATIC_COMPILATION $QEMU_CFLAGS" 38214eaf7202SSameeh Jubranfi 38224eaf7202SSameeh Jubran 3823aa0d1f44SPaolo Bonzinifor i in $glib_modules; do 3824e26110cfSFam Zheng if $pkg_config --atleast-version=$glib_req_ver $i; then 382589138857SStefan Weil glib_cflags=$($pkg_config --cflags $i) 382689138857SStefan Weil glib_libs=$($pkg_config --libs $i) 38274a058899SMarc-André Lureau QEMU_CFLAGS="$glib_cflags $QEMU_CFLAGS" 382814015304SAnthony Liguori LIBS="$glib_libs $LIBS" 3829957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 3830e18df141SAnthony Liguori else 3831e26110cfSFam Zheng error_exit "glib-$glib_req_ver $i is required to compile QEMU" 3832e26110cfSFam Zheng fi 3833e26110cfSFam Zhengdone 3834e26110cfSFam Zheng 3835f876b765SMarc-André Lureauif $pkg_config --atleast-version=$glib_req_ver gio-2.0; then 3836f876b765SMarc-André Lureau gio=yes 3837f876b765SMarc-André Lureau gio_cflags=$($pkg_config --cflags gio-2.0) 3838f876b765SMarc-André Lureau gio_libs=$($pkg_config --libs gio-2.0) 383925a97a56SMarc-André Lureau gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0) 38400dba4897SMarc-André Lureau if [ ! -x "$gdbus_codegen" ]; then 38410dba4897SMarc-André Lureau gdbus_codegen= 38420dba4897SMarc-André Lureau fi 3843f876b765SMarc-André Lureauelse 3844f876b765SMarc-André Lureau gio=no 3845f876b765SMarc-André Lureaufi 3846f876b765SMarc-André Lureau 384725a97a56SMarc-André Lureauif $pkg_config --atleast-version=$glib_req_ver gio-unix-2.0; then 384825a97a56SMarc-André Lureau gio_cflags="$gio_cflags $($pkg_config --cflags gio-unix-2.0)" 384925a97a56SMarc-André Lureau gio_libs="$gio_libs $($pkg_config --libs gio-unix-2.0)" 385025a97a56SMarc-André Lureaufi 385125a97a56SMarc-André Lureau 3852977a82abSDaniel P. Berrange# Sanity check that the current size_t matches the 3853977a82abSDaniel P. Berrange# size that glib thinks it should be. This catches 3854977a82abSDaniel P. Berrange# problems on multi-arch where people try to build 3855977a82abSDaniel P. Berrange# 32-bit QEMU while pointing at 64-bit glib headers 3856977a82abSDaniel P. Berrangecat > $TMPC <<EOF 3857977a82abSDaniel P. Berrange#include <glib.h> 3858977a82abSDaniel P. Berrange#include <unistd.h> 3859977a82abSDaniel P. Berrange 3860977a82abSDaniel P. Berrange#define QEMU_BUILD_BUG_ON(x) \ 3861977a82abSDaniel P. Berrange typedef char qemu_build_bug_on[(x)?-1:1] __attribute__((unused)); 3862977a82abSDaniel P. Berrange 3863977a82abSDaniel P. Berrangeint main(void) { 3864977a82abSDaniel P. Berrange QEMU_BUILD_BUG_ON(sizeof(size_t) != GLIB_SIZEOF_SIZE_T); 3865977a82abSDaniel P. Berrange return 0; 3866977a82abSDaniel P. Berrange} 3867977a82abSDaniel P. BerrangeEOF 3868977a82abSDaniel P. Berrange 38695919e032SStefan Weilif ! compile_prog "$CFLAGS" "$LIBS" ; then 3870977a82abSDaniel P. Berrange error_exit "sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T."\ 3871977a82abSDaniel P. Berrange "You probably need to set PKG_CONFIG_LIBDIR"\ 3872977a82abSDaniel P. Berrange "to point to the right pkg-config files for your"\ 3873977a82abSDaniel P. Berrange "build target" 3874977a82abSDaniel P. Berrangefi 3875977a82abSDaniel P. Berrange 3876bbbf2e04SJohn Snow# Silence clang 3.5.0 warnings about glib attribute __alloc_size__ usage 3877bbbf2e04SJohn Snowcat > $TMPC << EOF 3878bbbf2e04SJohn Snow#include <glib.h> 3879bbbf2e04SJohn Snowint main(void) { return 0; } 3880bbbf2e04SJohn SnowEOF 3881bbbf2e04SJohn Snowif ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then 3882bbbf2e04SJohn Snow if cc_has_warning_flag "-Wno-unknown-attributes"; then 3883bbbf2e04SJohn Snow glib_cflags="-Wno-unknown-attributes $glib_cflags" 3884bbbf2e04SJohn Snow CFLAGS="-Wno-unknown-attributes $CFLAGS" 3885bbbf2e04SJohn Snow fi 3886bbbf2e04SJohn Snowfi 3887bbbf2e04SJohn Snow 38889bda600bSEric Blake# Silence clang warnings triggered by glib < 2.57.2 38899bda600bSEric Blakecat > $TMPC << EOF 38909bda600bSEric Blake#include <glib.h> 38919bda600bSEric Blaketypedef struct Foo { 38929bda600bSEric Blake int i; 38939bda600bSEric Blake} Foo; 38949bda600bSEric Blakestatic void foo_free(Foo *f) 38959bda600bSEric Blake{ 38969bda600bSEric Blake g_free(f); 38979bda600bSEric Blake} 38989bda600bSEric BlakeG_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free); 38999bda600bSEric Blakeint main(void) { return 0; } 39009bda600bSEric BlakeEOF 39019bda600bSEric Blakeif ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then 39029bda600bSEric Blake if cc_has_warning_flag "-Wno-unused-function"; then 39039bda600bSEric Blake glib_cflags="$glib_cflags -Wno-unused-function" 39049bda600bSEric Blake CFLAGS="$CFLAGS -Wno-unused-function" 39059bda600bSEric Blake fi 39069bda600bSEric Blakefi 39079bda600bSEric Blake 39086a1f42bdSStefan Weil######################################### 39096a1f42bdSStefan Weil# zlib check 39106a1f42bdSStefan Weil 39116a1f42bdSStefan Weilif test "$zlib" != "no" ; then 39126a1f42bdSStefan Weil if $pkg_config --exists zlib; then 39136a1f42bdSStefan Weil zlib_cflags=$($pkg_config --cflags zlib) 39146a1f42bdSStefan Weil zlib_libs=$($pkg_config --libs zlib) 39156a1f42bdSStefan Weil QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS" 39166a1f42bdSStefan Weil LIBS="$zlib_libs $LIBS" 39176a1f42bdSStefan Weil else 39186a1f42bdSStefan Weil cat > $TMPC << EOF 39196a1f42bdSStefan Weil#include <zlib.h> 39206a1f42bdSStefan Weilint main(void) { zlibVersion(); return 0; } 39216a1f42bdSStefan WeilEOF 39226a1f42bdSStefan Weil if compile_prog "" "-lz" ; then 39236a1f42bdSStefan Weil LIBS="$LIBS -lz" 39246a1f42bdSStefan Weil else 39256a1f42bdSStefan Weil error_exit "zlib check failed" \ 39266a1f42bdSStefan Weil "Make sure to have the zlib libs and headers installed." 39276a1f42bdSStefan Weil fi 39286a1f42bdSStefan Weil fi 39296a1f42bdSStefan Weilfi 39306a1f42bdSStefan Weil 3931e26110cfSFam Zheng########################################## 3932e26110cfSFam Zheng# SHA command probe for modules 3933e26110cfSFam Zhengif test "$modules" = yes; then 3934e26110cfSFam Zheng shacmd_probe="sha1sum sha1 shasum" 3935e26110cfSFam Zheng for c in $shacmd_probe; do 39368ccefb91SFam Zheng if has $c; then 3937e26110cfSFam Zheng shacmd="$c" 3938e26110cfSFam Zheng break 3939e26110cfSFam Zheng fi 3940e26110cfSFam Zheng done 3941e26110cfSFam Zheng if test "$shacmd" = ""; then 3942e26110cfSFam Zheng error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" 3943e26110cfSFam Zheng fi 3944e18df141SAnthony Liguorifi 3945e18df141SAnthony Liguori 3946e18df141SAnthony Liguori########################################## 3947e2134eb9SGerd Hoffmann# pixman support probe 3948e2134eb9SGerd Hoffmann 3949e633a5c6SEric Blakeif test "$want_tools" = "no" && test "$softmmu" = "no"; then 395074880fe2SRobert Schiele pixman_cflags= 395174880fe2SRobert Schiele pixman_libs= 395235c4e86cSGerd Hoffmannelif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then 395389138857SStefan Weil pixman_cflags=$($pkg_config --cflags pixman-1) 395489138857SStefan Weil pixman_libs=$($pkg_config --libs pixman-1) 3955e2134eb9SGerd Hoffmannelse 3956c12b6d70SGerd Hoffmann error_exit "pixman >= 0.21.8 not present." \ 3957c12b6d70SGerd Hoffmann "Please install the pixman devel package." 3958e2134eb9SGerd Hoffmannfi 3959e2134eb9SGerd Hoffmann 3960e2134eb9SGerd Hoffmann########################################## 3961fe8fc5aeSPaolo Bonzini# libmpathpersist probe 3962fe8fc5aeSPaolo Bonzini 3963fe8fc5aeSPaolo Bonziniif test "$mpath" != "no" ; then 39641b0578f5SMurilo Opsfelder Araujo # probe for the new API 3965fe8fc5aeSPaolo Bonzini cat > $TMPC <<EOF 3966fe8fc5aeSPaolo Bonzini#include <libudev.h> 3967fe8fc5aeSPaolo Bonzini#include <mpath_persist.h> 3968fe8fc5aeSPaolo Bonziniunsigned mpath_mx_alloc_len = 1024; 3969fe8fc5aeSPaolo Bonziniint logsink; 3970b3f1c8c4SPaolo Bonzinistatic struct config *multipath_conf; 3971b3f1c8c4SPaolo Bonziniextern struct udev *udev; 3972b3f1c8c4SPaolo Bonziniextern struct config *get_multipath_config(void); 3973b3f1c8c4SPaolo Bonziniextern void put_multipath_config(struct config *conf); 3974b3f1c8c4SPaolo Bonzinistruct udev *udev; 3975b3f1c8c4SPaolo Bonzinistruct config *get_multipath_config(void) { return multipath_conf; } 3976b3f1c8c4SPaolo Bonzinivoid put_multipath_config(struct config *conf) { } 3977b3f1c8c4SPaolo Bonzini 3978fe8fc5aeSPaolo Bonziniint main(void) { 3979b3f1c8c4SPaolo Bonzini udev = udev_new(); 3980b3f1c8c4SPaolo Bonzini multipath_conf = mpath_lib_init(); 3981fe8fc5aeSPaolo Bonzini return 0; 3982fe8fc5aeSPaolo Bonzini} 3983fe8fc5aeSPaolo BonziniEOF 3984fe8fc5aeSPaolo Bonzini if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then 3985fe8fc5aeSPaolo Bonzini mpathpersist=yes 39861b0578f5SMurilo Opsfelder Araujo mpathpersist_new_api=yes 39871b0578f5SMurilo Opsfelder Araujo else 39881b0578f5SMurilo Opsfelder Araujo # probe for the old API 39891b0578f5SMurilo Opsfelder Araujo cat > $TMPC <<EOF 39901b0578f5SMurilo Opsfelder Araujo#include <libudev.h> 39911b0578f5SMurilo Opsfelder Araujo#include <mpath_persist.h> 39921b0578f5SMurilo Opsfelder Araujounsigned mpath_mx_alloc_len = 1024; 39931b0578f5SMurilo Opsfelder Araujoint logsink; 39941b0578f5SMurilo Opsfelder Araujoint main(void) { 39951b0578f5SMurilo Opsfelder Araujo struct udev *udev = udev_new(); 39961b0578f5SMurilo Opsfelder Araujo mpath_lib_init(udev); 39971b0578f5SMurilo Opsfelder Araujo return 0; 39981b0578f5SMurilo Opsfelder Araujo} 39991b0578f5SMurilo Opsfelder AraujoEOF 40001b0578f5SMurilo Opsfelder Araujo if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then 40011b0578f5SMurilo Opsfelder Araujo mpathpersist=yes 40021b0578f5SMurilo Opsfelder Araujo mpathpersist_new_api=no 4003fe8fc5aeSPaolo Bonzini else 4004fe8fc5aeSPaolo Bonzini mpathpersist=no 4005fe8fc5aeSPaolo Bonzini fi 40061b0578f5SMurilo Opsfelder Araujo fi 4007fe8fc5aeSPaolo Bonzinielse 4008fe8fc5aeSPaolo Bonzini mpathpersist=no 4009fe8fc5aeSPaolo Bonzinifi 4010fe8fc5aeSPaolo Bonzini 4011fe8fc5aeSPaolo Bonzini########################################## 4012e5d355d1Saliguori# pthread probe 40134b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 40143c529d93Saliguori 4015e5d355d1Saliguoripthread=no 4016414f0dabSblueswir1cat > $TMPC << EOF 40173c529d93Saliguori#include <pthread.h> 40187a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 40197a42bbe4SStefan Weilint main(void) { 40207a42bbe4SStefan Weil pthread_t thread; 40217a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 40227a42bbe4SStefan Weil return 0; 40237a42bbe4SStefan Weil} 4024414f0dabSblueswir1EOF 4025bd00d539SAndreas Färberif compile_prog "" "" ; then 4026bd00d539SAndreas Färber pthread=yes 4027bd00d539SAndreas Färberelse 4028de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 402952166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 4030e5d355d1Saliguori pthread=yes 4031e3c56761SPeter Portante found=no 4032e3c56761SPeter Portante for lib_entry in $LIBS; do 4033e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 4034e3c56761SPeter Portante found=yes 4035e3c56761SPeter Portante break 4036e3c56761SPeter Portante fi 4037e3c56761SPeter Portante done 4038e3c56761SPeter Portante if test "$found" = "no"; then 40395572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 404014ab3aa7SMarc-André Lureau libs_qga="$pthread_lib $libs_qga" 4041e3c56761SPeter Portante fi 4042409437e1SDaniel P. Berrange PTHREAD_LIB="$pthread_lib" 4043de65fe0fSSebastian Herbszt break 4044414f0dabSblueswir1 fi 4045de65fe0fSSebastian Herbszt done 4046bd00d539SAndreas Färberfi 4047414f0dabSblueswir1 4048e633a5c6SEric Blakeif test "$mingw32" != yes && test "$pthread" = no; then 404976ad07a4SPeter Maydell error_exit "pthread check failed" \ 405076ad07a4SPeter Maydell "Make sure to have the pthread libs and headers installed." 4051e5d355d1Saliguorifi 4052e5d355d1Saliguori 4053479a5747SRoman Bolshakov# check for pthread_setname_np with thread id 4054479a5747SRoman Bolshakovpthread_setname_np_w_tid=no 40555c312079SDr. David Alan Gilbertcat > $TMPC << EOF 40565c312079SDr. David Alan Gilbert#include <pthread.h> 40575c312079SDr. David Alan Gilbert 40585c312079SDr. David Alan Gilbertstatic void *f(void *p) { return NULL; } 40595c312079SDr. David Alan Gilbertint main(void) 40605c312079SDr. David Alan Gilbert{ 40615c312079SDr. David Alan Gilbert pthread_t thread; 40625c312079SDr. David Alan Gilbert pthread_create(&thread, 0, f, 0); 40635c312079SDr. David Alan Gilbert pthread_setname_np(thread, "QEMU"); 40645c312079SDr. David Alan Gilbert return 0; 40655c312079SDr. David Alan Gilbert} 40665c312079SDr. David Alan GilbertEOF 40675c312079SDr. David Alan Gilbertif compile_prog "" "$pthread_lib" ; then 4068479a5747SRoman Bolshakov pthread_setname_np_w_tid=yes 4069479a5747SRoman Bolshakovfi 4070479a5747SRoman Bolshakov 4071479a5747SRoman Bolshakov# check for pthread_setname_np without thread id 4072479a5747SRoman Bolshakovpthread_setname_np_wo_tid=no 4073479a5747SRoman Bolshakovcat > $TMPC << EOF 4074479a5747SRoman Bolshakov#include <pthread.h> 4075479a5747SRoman Bolshakov 4076479a5747SRoman Bolshakovstatic void *f(void *p) { pthread_setname_np("QEMU"); } 4077479a5747SRoman Bolshakovint main(void) 4078479a5747SRoman Bolshakov{ 4079479a5747SRoman Bolshakov pthread_t thread; 4080479a5747SRoman Bolshakov pthread_create(&thread, 0, f, 0); 4081479a5747SRoman Bolshakov return 0; 4082479a5747SRoman Bolshakov} 4083479a5747SRoman BolshakovEOF 4084479a5747SRoman Bolshakovif compile_prog "" "$pthread_lib" ; then 4085479a5747SRoman Bolshakov pthread_setname_np_wo_tid=yes 40865c312079SDr. David Alan Gilbertfi 40875c312079SDr. David Alan Gilbert 4088bf9298b9Saliguori########################################## 4089f27aaf4bSChristian Brunner# rbd probe 4090f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 4091f27aaf4bSChristian Brunner cat > $TMPC <<EOF 4092f27aaf4bSChristian Brunner#include <stdio.h> 4093ad32e9c0SJosh Durgin#include <rbd/librbd.h> 4094f27aaf4bSChristian Brunnerint main(void) { 4095ad32e9c0SJosh Durgin rados_t cluster; 4096ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 4097f27aaf4bSChristian Brunner return 0; 4098f27aaf4bSChristian Brunner} 4099f27aaf4bSChristian BrunnerEOF 4100ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 4101f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 4102f27aaf4bSChristian Brunner rbd=yes 4103f27aaf4bSChristian Brunner else 4104f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 410521684af0SStewart Smith feature_not_found "rados block device" "Install librbd/ceph devel" 4106f27aaf4bSChristian Brunner fi 4107f27aaf4bSChristian Brunner rbd=no 4108f27aaf4bSChristian Brunner fi 4109f27aaf4bSChristian Brunnerfi 4110f27aaf4bSChristian Brunner 4111f27aaf4bSChristian Brunner########################################## 4112b10d49d7SPino Toscano# libssh probe 4113b10d49d7SPino Toscanoif test "$libssh" != "no" ; then 4114b10d49d7SPino Toscano if $pkg_config --exists libssh; then 4115b10d49d7SPino Toscano libssh_cflags=$($pkg_config libssh --cflags) 4116b10d49d7SPino Toscano libssh_libs=$($pkg_config libssh --libs) 4117b10d49d7SPino Toscano libssh=yes 41180a12ec87SRichard W.M. Jones else 4119b10d49d7SPino Toscano if test "$libssh" = "yes" ; then 4120b10d49d7SPino Toscano error_exit "libssh required for --enable-libssh" 41210a12ec87SRichard W.M. Jones fi 4122b10d49d7SPino Toscano libssh=no 41230a12ec87SRichard W.M. Jones fi 41240a12ec87SRichard W.M. Jonesfi 41250a12ec87SRichard W.M. Jones 41260a12ec87SRichard W.M. Jones########################################## 4127b10d49d7SPino Toscano# Check for libssh 0.8 4128b10d49d7SPino Toscano# This is done like this instead of using the LIBSSH_VERSION_* and 4129b10d49d7SPino Toscano# SSH_VERSION_* macros because some distributions in the past shipped 4130b10d49d7SPino Toscano# snapshots of the future 0.8 from Git, and those snapshots did not 4131b10d49d7SPino Toscano# have updated version numbers (still referring to 0.7.0). 41329a2d462eSRichard W.M. Jones 4133b10d49d7SPino Toscanoif test "$libssh" = "yes"; then 41349a2d462eSRichard W.M. Jones cat > $TMPC <<EOF 4135b10d49d7SPino Toscano#include <libssh/libssh.h> 4136b10d49d7SPino Toscanoint main(void) { return ssh_get_server_publickey(NULL, NULL); } 41379a2d462eSRichard W.M. JonesEOF 4138b10d49d7SPino Toscano if compile_prog "$libssh_cflags" "$libssh_libs"; then 4139b10d49d7SPino Toscano libssh_cflags="-DHAVE_LIBSSH_0_8 $libssh_cflags" 41409a2d462eSRichard W.M. Jones fi 41419a2d462eSRichard W.M. Jonesfi 41429a2d462eSRichard W.M. Jones 41439a2d462eSRichard W.M. Jones########################################## 41445c6c3a6cSChristoph Hellwig# linux-aio probe 41455c6c3a6cSChristoph Hellwig 41465c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 41475c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 41485c6c3a6cSChristoph Hellwig#include <libaio.h> 41495c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 4150832ce9c2SScott Wood#include <stddef.h> 41515c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 41525c6c3a6cSChristoph HellwigEOF 41535c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 41545c6c3a6cSChristoph Hellwig linux_aio=yes 41555c6c3a6cSChristoph Hellwig else 41565c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 415721684af0SStewart Smith feature_not_found "linux AIO" "Install libaio devel" 41585c6c3a6cSChristoph Hellwig fi 41593cfcae3cSLuiz Capitulino linux_aio=no 41605c6c3a6cSChristoph Hellwig fi 41615c6c3a6cSChristoph Hellwigfi 4162c10dd856SAarushi Mehta########################################## 4163c10dd856SAarushi Mehta# linux-io-uring probe 4164c10dd856SAarushi Mehta 4165c10dd856SAarushi Mehtaif test "$linux_io_uring" != "no" ; then 4166c10dd856SAarushi Mehta if $pkg_config liburing; then 4167c10dd856SAarushi Mehta linux_io_uring_cflags=$($pkg_config --cflags liburing) 4168c10dd856SAarushi Mehta linux_io_uring_libs=$($pkg_config --libs liburing) 4169c10dd856SAarushi Mehta linux_io_uring=yes 417073fd282eSStefan Hajnoczi 417173fd282eSStefan Hajnoczi # io_uring is used in libqemuutil.a where per-file -libs variables are not 417273fd282eSStefan Hajnoczi # seen by programs linking the archive. It's not ideal, but just add the 417373fd282eSStefan Hajnoczi # library dependency globally. 417473fd282eSStefan Hajnoczi LIBS="$linux_io_uring_libs $LIBS" 4175c10dd856SAarushi Mehta else 4176c10dd856SAarushi Mehta if test "$linux_io_uring" = "yes" ; then 4177c10dd856SAarushi Mehta feature_not_found "linux io_uring" "Install liburing devel" 4178c10dd856SAarushi Mehta fi 4179c10dd856SAarushi Mehta linux_io_uring=no 4180c10dd856SAarushi Mehta fi 4181c10dd856SAarushi Mehtafi 41825c6c3a6cSChristoph Hellwig 41835c6c3a6cSChristoph Hellwig########################################## 41847aaa6a16SPaolo Bonzini# TPM emulation is only on POSIX 41853b8acc11SPaolo Bonzini 41867aaa6a16SPaolo Bonziniif test "$tpm" = ""; then 41877aaa6a16SPaolo Bonzini if test "$mingw32" = "yes"; then 41887aaa6a16SPaolo Bonzini tpm=no 41893b8acc11SPaolo Bonzini else 41907aaa6a16SPaolo Bonzini tpm=yes 41917aaa6a16SPaolo Bonzini fi 41927aaa6a16SPaolo Bonzinielif test "$tpm" = "yes"; then 41937aaa6a16SPaolo Bonzini if test "$mingw32" = "yes" ; then 41947aaa6a16SPaolo Bonzini error_exit "TPM emulation only available on POSIX systems" 41957aaa6a16SPaolo Bonzini fi 41963b8acc11SPaolo Bonzinifi 41973b8acc11SPaolo Bonzini 41983b8acc11SPaolo Bonzini########################################## 4199758e8e38SVenkateswararao Jujjuri (JV)# attr probe 4200758e8e38SVenkateswararao Jujjuri (JV) 4201758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 4202758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 4203758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 4204758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 4205f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 4206f2338fb4SPavel Borzenkov#include <attr/xattr.h> 4207f2338fb4SPavel Borzenkov#else 42084f26f2b6SAvi Kivity#include <sys/xattr.h> 4209f2338fb4SPavel Borzenkov#endif 4210758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 4211758e8e38SVenkateswararao Jujjuri (JV)EOF 42124f26f2b6SAvi Kivity if compile_prog "" "" ; then 42134f26f2b6SAvi Kivity attr=yes 42144f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 4215f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 4216758e8e38SVenkateswararao Jujjuri (JV) attr=yes 4217758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 42184f26f2b6SAvi Kivity libattr=yes 4219758e8e38SVenkateswararao Jujjuri (JV) else 4220758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 422121684af0SStewart Smith feature_not_found "ATTR" "Install libc6 or libattr devel" 4222758e8e38SVenkateswararao Jujjuri (JV) fi 4223758e8e38SVenkateswararao Jujjuri (JV) attr=no 4224758e8e38SVenkateswararao Jujjuri (JV) fi 4225758e8e38SVenkateswararao Jujjuri (JV)fi 4226758e8e38SVenkateswararao Jujjuri (JV) 4227758e8e38SVenkateswararao Jujjuri (JV)########################################## 4228bf9298b9Saliguori# iovec probe 4229bf9298b9Saliguoricat > $TMPC <<EOF 4230db34f0b3Sblueswir1#include <sys/types.h> 4231bf9298b9Saliguori#include <sys/uio.h> 4232db34f0b3Sblueswir1#include <unistd.h> 4233f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 4234bf9298b9SaliguoriEOF 4235bf9298b9Saliguoriiovec=no 423652166aa0SJuan Quintelaif compile_prog "" "" ; then 4237bf9298b9Saliguori iovec=yes 4238bf9298b9Saliguorifi 4239bf9298b9Saliguori 4240f652e6afSaurel32########################################## 4241ceb42de8Saliguori# preadv probe 4242ceb42de8Saliguoricat > $TMPC <<EOF 4243ceb42de8Saliguori#include <sys/types.h> 4244ceb42de8Saliguori#include <sys/uio.h> 4245ceb42de8Saliguori#include <unistd.h> 4246c075a723SBlue Swirlint main(void) { return preadv(0, 0, 0, 0); } 4247ceb42de8SaliguoriEOF 4248ceb42de8Saliguoripreadv=no 424952166aa0SJuan Quintelaif compile_prog "" "" ; then 4250ceb42de8Saliguori preadv=yes 4251ceb42de8Saliguorifi 4252ceb42de8Saliguori 4253ceb42de8Saliguori########################################## 4254f652e6afSaurel32# fdt probe 4255e169e1e1SPeter Maydell# fdt support is mandatory for at least some target architectures, 4256e169e1e1SPeter Maydell# so insist on it if we're building those system emulators. 4257e169e1e1SPeter Maydellfdt_required=no 4258e169e1e1SPeter Maydellfor target in $target_list; do 4259e169e1e1SPeter Maydell case $target in 4260c8c35e5fSYoshinori Sato aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu|mips64el-softmmu|riscv*-softmmu|rx-softmmu) 4261e169e1e1SPeter Maydell fdt_required=yes 4262e169e1e1SPeter Maydell ;; 4263e169e1e1SPeter Maydell esac 4264e169e1e1SPeter Maydelldone 4265e169e1e1SPeter Maydell 4266e169e1e1SPeter Maydellif test "$fdt_required" = "yes"; then 4267e169e1e1SPeter Maydell if test "$fdt" = "no"; then 4268e169e1e1SPeter Maydell error_exit "fdt disabled but some requested targets require it." \ 4269e169e1e1SPeter Maydell "You can turn off fdt only if you also disable all the system emulation" \ 4270e169e1e1SPeter Maydell "targets which need it (by specifying a cut down --target-list)." 4271e169e1e1SPeter Maydell fi 4272e169e1e1SPeter Maydell fdt=yes 42737ba4a4d3SPhilippe Mathieu-Daudéelif test "$fdt" != "yes" ; then 42747ba4a4d3SPhilippe Mathieu-Daudé fdt=no 4275e169e1e1SPeter Maydellfi 4276e169e1e1SPeter Maydell 4277d599938aSLaurent Vivier# fdt is only required when building softmmu targets 4278d599938aSLaurent Vivierif test -z "$fdt" -a "$softmmu" != "yes" ; then 4279d599938aSLaurent Vivier fdt="no" 4280d599938aSLaurent Vivierfi 4281d599938aSLaurent Vivier 42822df87df7SJuan Quintelaif test "$fdt" != "no" ; then 4283b41af4baSJuan Quintela fdt_libs="-lfdt" 428496ce6545SPeter Crosthwaite # explicitly check for libfdt_env.h as it is missing in some stable installs 42856e85fce0SPaul Burton # and test for required functions to make sure we are on a version >= 1.4.2 4286f652e6afSaurel32 cat > $TMPC << EOF 428731ce0adbSThomas Huth#include <libfdt.h> 428896ce6545SPeter Crosthwaite#include <libfdt_env.h> 4289fea35ca4SAlexey Kardashevskiyint main(void) { fdt_check_full(NULL, 0); return 0; } 4290f652e6afSaurel32EOF 429152166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 4292a540f158SPeter Crosthwaite # system DTC is good - use it 4293e3971d61SPhilippe Mathieu-Daudé fdt=system 4294aef45d51SDaniel P. Berrange else 4295aef45d51SDaniel P. Berrange # have GIT checkout, so activate dtc submodule 4296aef45d51SDaniel P. Berrange if test -e "${source_path}/.git" ; then 4297aef45d51SDaniel P. Berrange git_submodules="${git_submodules} dtc" 4298aef45d51SDaniel P. Berrange fi 4299aef45d51SDaniel P. Berrange if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then 4300e3971d61SPhilippe Mathieu-Daudé fdt=git 4301a540f158SPeter Crosthwaite mkdir -p dtc 4302cab00a5aSMichael S. Tsirkin if [ "$pwd_is_source_path" != "y" ] ; then 4303a540f158SPeter Crosthwaite symlink "$source_path/dtc/Makefile" "dtc/Makefile" 4304a540f158SPeter Crosthwaite symlink "$source_path/dtc/scripts" "dtc/scripts" 43052df87df7SJuan Quintela fi 4306a540f158SPeter Crosthwaite fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" 43078a99e9a3SPhilippe Mathieu-Daudé fdt_ldflags="-L\$(BUILD_DIR)/dtc/libfdt" 43088a99e9a3SPhilippe Mathieu-Daudé fdt_libs="$fdt_libs" 4309a540f158SPeter Crosthwaite elif test "$fdt" = "yes" ; then 4310aef45d51SDaniel P. Berrange # Not a git build & no libfdt found, prompt for system install 4311aef45d51SDaniel P. Berrange error_exit "DTC (libfdt) version >= 1.4.2 not present." \ 4312aef45d51SDaniel P. Berrange "Please install the DTC (libfdt) devel package" 4313a540f158SPeter Crosthwaite else 4314a540f158SPeter Crosthwaite # don't have and don't want 4315de3a354aSMichael Walle fdt_libs= 43162df87df7SJuan Quintela fdt=no 4317f652e6afSaurel32 fi 4318f652e6afSaurel32 fi 4319aef45d51SDaniel P. Berrangefi 4320f652e6afSaurel32 4321a540f158SPeter Crosthwaitelibs_softmmu="$libs_softmmu $fdt_libs" 4322a540f158SPeter Crosthwaite 432320ff075bSMichael Walle########################################## 4324fb719563SOGAWA Hirofumi# opengl probe (for sdl2, gtk, milkymist-tmu2) 4325b1546f32SGerd Hoffmann 4326d52c454aSMarc-André Lureaugbm="no" 4327d52c454aSMarc-André Lureauif $pkg_config gbm; then 4328d52c454aSMarc-André Lureau gbm_cflags="$($pkg_config --cflags gbm)" 4329d52c454aSMarc-André Lureau gbm_libs="$($pkg_config --libs gbm)" 4330d52c454aSMarc-André Lureau gbm="yes" 4331d52c454aSMarc-André Lureaufi 4332d52c454aSMarc-André Lureau 4333da076ffeSGerd Hoffmannif test "$opengl" != "no" ; then 43344939a1dfSMichael Tokarev opengl_pkgs="epoxy gbm" 43355f9b1e35SGerd Hoffmann if $pkg_config $opengl_pkgs; then 43365f9b1e35SGerd Hoffmann opengl_cflags="$($pkg_config --cflags $opengl_pkgs)" 43375f9b1e35SGerd Hoffmann opengl_libs="$($pkg_config --libs $opengl_pkgs)" 4338da076ffeSGerd Hoffmann opengl=yes 4339925a0400SGerd Hoffmann if test "$gtk" = "yes" && $pkg_config --exists "$gtkpackage >= 3.16"; then 4340925a0400SGerd Hoffmann gtk_gl="yes" 4341925a0400SGerd Hoffmann fi 4342cc720a5dSGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags" 434320ff075bSMichael Walle else 4344da076ffeSGerd Hoffmann if test "$opengl" = "yes" ; then 4345dcf30025SGerd Hoffmann feature_not_found "opengl" "Please install opengl (mesa) devel pkgs: $opengl_pkgs" 434620ff075bSMichael Walle fi 4347f676c67eSJeremy White opengl_cflags="" 4348da076ffeSGerd Hoffmann opengl_libs="" 4349da076ffeSGerd Hoffmann opengl=no 435020ff075bSMichael Walle fi 435120ff075bSMichael Wallefi 435220ff075bSMichael Walle 4353014cb152SGerd Hoffmannif test "$opengl" = "yes"; then 4354014cb152SGerd Hoffmann cat > $TMPC << EOF 4355014cb152SGerd Hoffmann#include <epoxy/egl.h> 4356014cb152SGerd Hoffmann#ifndef EGL_MESA_image_dma_buf_export 4357014cb152SGerd Hoffmann# error mesa/epoxy lacks support for dmabufs (mesa 10.6+) 4358014cb152SGerd Hoffmann#endif 4359014cb152SGerd Hoffmannint main(void) { return 0; } 4360014cb152SGerd HoffmannEOF 4361014cb152SGerd Hoffmann if compile_prog "" "" ; then 4362014cb152SGerd Hoffmann opengl_dmabuf=yes 4363014cb152SGerd Hoffmann fi 4364014cb152SGerd Hoffmannfi 4365c9a12e75SChrysostomos Nanakos 4366e633a5c6SEric Blakeif test "$opengl" = "yes" && test "$have_x11" = "yes"; then 436799e1a93bSPhilippe Mathieu-Daudé for target in $target_list; do 436899e1a93bSPhilippe Mathieu-Daudé case $target in 436999e1a93bSPhilippe Mathieu-Daudé lm32-softmmu) # milkymist-tmu2 requires X11 and OpenGL 437099e1a93bSPhilippe Mathieu-Daudé need_x11=yes 437199e1a93bSPhilippe Mathieu-Daudé ;; 437299e1a93bSPhilippe Mathieu-Daudé esac 437399e1a93bSPhilippe Mathieu-Daudé done 437499e1a93bSPhilippe Mathieu-Daudéfi 437599e1a93bSPhilippe Mathieu-Daudé 4376ed279a06SKlim Kireev########################################## 4377ed279a06SKlim Kireev# libxml2 probe 4378ed279a06SKlim Kireevif test "$libxml2" != "no" ; then 4379ed279a06SKlim Kireev if $pkg_config --exists libxml-2.0; then 4380ed279a06SKlim Kireev libxml2="yes" 4381ed279a06SKlim Kireev libxml2_cflags=$($pkg_config --cflags libxml-2.0) 4382ed279a06SKlim Kireev libxml2_libs=$($pkg_config --libs libxml-2.0) 4383ed279a06SKlim Kireev else 4384ed279a06SKlim Kireev if test "$libxml2" = "yes"; then 4385ed279a06SKlim Kireev feature_not_found "libxml2" "Install libxml2 devel" 4386ed279a06SKlim Kireev fi 4387ed279a06SKlim Kireev libxml2="no" 4388ed279a06SKlim Kireev fi 4389ed279a06SKlim Kireevfi 4390c9a12e75SChrysostomos Nanakos 4391eb100396SBharata B Rao########################################## 4392eb100396SBharata B Rao# glusterfs probe 4393eb100396SBharata B Raoif test "$glusterfs" != "no" ; then 439465d5d3f9SStefan Weil if $pkg_config --atleast-version=3 glusterfs-api; then 4395e01bee08SBharata B Rao glusterfs="yes" 439689138857SStefan Weil glusterfs_cflags=$($pkg_config --cflags glusterfs-api) 439789138857SStefan Weil glusterfs_libs=$($pkg_config --libs glusterfs-api) 4398d85fa9ebSJeff Cody if $pkg_config --atleast-version=4 glusterfs-api; then 4399d85fa9ebSJeff Cody glusterfs_xlator_opt="yes" 4400d85fa9ebSJeff Cody fi 440165d5d3f9SStefan Weil if $pkg_config --atleast-version=5 glusterfs-api; then 44020c14fb47SBharata B Rao glusterfs_discard="yes" 44030c14fb47SBharata B Rao fi 44047c815372SBharata B Rao if $pkg_config --atleast-version=6 glusterfs-api; then 4405df3a429aSNiels de Vos glusterfs_fallocate="yes" 44067c815372SBharata B Rao glusterfs_zerofill="yes" 44077c815372SBharata B Rao fi 4408e014dbe7SPrasanna Kumar Kalever cat > $TMPC << EOF 4409e014dbe7SPrasanna Kumar Kalever#include <glusterfs/api/glfs.h> 4410e014dbe7SPrasanna Kumar Kalever 4411e014dbe7SPrasanna Kumar Kaleverint 4412e014dbe7SPrasanna Kumar Kalevermain(void) 4413e014dbe7SPrasanna Kumar Kalever{ 4414e014dbe7SPrasanna Kumar Kalever /* new glfs_ftruncate() passes two additional args */ 4415e014dbe7SPrasanna Kumar Kalever return glfs_ftruncate(NULL, 0, NULL, NULL); 4416e014dbe7SPrasanna Kumar Kalever} 4417e014dbe7SPrasanna Kumar KaleverEOF 4418e014dbe7SPrasanna Kumar Kalever if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then 4419e014dbe7SPrasanna Kumar Kalever glusterfs_ftruncate_has_stat="yes" 4420e014dbe7SPrasanna Kumar Kalever fi 44210e3b891fSNiels de Vos cat > $TMPC << EOF 44220e3b891fSNiels de Vos#include <glusterfs/api/glfs.h> 44230e3b891fSNiels de Vos 44240e3b891fSNiels de Vos/* new glfs_io_cbk() passes two additional glfs_stat structs */ 44250e3b891fSNiels de Vosstatic void 44260e3b891fSNiels de Vosglusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data) 44270e3b891fSNiels de Vos{} 44280e3b891fSNiels de Vos 44290e3b891fSNiels de Vosint 44300e3b891fSNiels de Vosmain(void) 44310e3b891fSNiels de Vos{ 44320e3b891fSNiels de Vos glfs_io_cbk iocb = &glusterfs_iocb; 44330e3b891fSNiels de Vos iocb(NULL, 0 , NULL, NULL, NULL); 44340e3b891fSNiels de Vos return 0; 44350e3b891fSNiels de Vos} 44360e3b891fSNiels de VosEOF 44370e3b891fSNiels de Vos if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then 44380e3b891fSNiels de Vos glusterfs_iocb_has_stat="yes" 44390e3b891fSNiels de Vos fi 4440eb100396SBharata B Rao else 4441eb100396SBharata B Rao if test "$glusterfs" = "yes" ; then 44428efc9363SHu Tao feature_not_found "GlusterFS backend support" \ 44438efc9363SHu Tao "Install glusterfs-api devel >= 3" 4444eb100396SBharata B Rao fi 4445e01bee08SBharata B Rao glusterfs="no" 4446eb100396SBharata B Rao fi 4447eb100396SBharata B Raofi 4448eb100396SBharata B Rao 444939386ac7Saurel32# Check for inotify functions when we are building linux-user 44503b3f24adSaurel32# emulator. This is done because older glibc versions don't 44513b3f24adSaurel32# have syscall stubs for these implemented. In that case we 44523b3f24adSaurel32# don't provide them even if kernel supports them. 44533b3f24adSaurel32# 44543b3f24adSaurel32inotify=no 44553b3f24adSaurel32cat > $TMPC << EOF 44563b3f24adSaurel32#include <sys/inotify.h> 44573b3f24adSaurel32 44583b3f24adSaurel32int 44593b3f24adSaurel32main(void) 44603b3f24adSaurel32{ 44613b3f24adSaurel32 /* try to start inotify */ 44628690e420Saurel32 return inotify_init(); 44633b3f24adSaurel32} 44643b3f24adSaurel32EOF 446552166aa0SJuan Quintelaif compile_prog "" "" ; then 44663b3f24adSaurel32 inotify=yes 44673b3f24adSaurel32fi 44683b3f24adSaurel32 4469c05c7a73SRiku Voipioinotify1=no 4470c05c7a73SRiku Voipiocat > $TMPC << EOF 4471c05c7a73SRiku Voipio#include <sys/inotify.h> 4472c05c7a73SRiku Voipio 4473c05c7a73SRiku Voipioint 4474c05c7a73SRiku Voipiomain(void) 4475c05c7a73SRiku Voipio{ 4476c05c7a73SRiku Voipio /* try to start inotify */ 4477c05c7a73SRiku Voipio return inotify_init1(0); 4478c05c7a73SRiku Voipio} 4479c05c7a73SRiku VoipioEOF 4480c05c7a73SRiku Voipioif compile_prog "" "" ; then 4481c05c7a73SRiku Voipio inotify1=yes 4482c05c7a73SRiku Voipiofi 4483c05c7a73SRiku Voipio 4484099d6b0fSRiku Voipio# check if pipe2 is there 4485099d6b0fSRiku Voipiopipe2=no 4486099d6b0fSRiku Voipiocat > $TMPC << EOF 4487099d6b0fSRiku Voipio#include <unistd.h> 4488099d6b0fSRiku Voipio#include <fcntl.h> 4489099d6b0fSRiku Voipio 4490099d6b0fSRiku Voipioint main(void) 4491099d6b0fSRiku Voipio{ 4492099d6b0fSRiku Voipio int pipefd[2]; 44939bca8162SBruce Rogers return pipe2(pipefd, O_CLOEXEC); 4494099d6b0fSRiku Voipio} 4495099d6b0fSRiku VoipioEOF 449652166aa0SJuan Quintelaif compile_prog "" "" ; then 4497099d6b0fSRiku Voipio pipe2=yes 4498099d6b0fSRiku Voipiofi 4499099d6b0fSRiku Voipio 450040ff6d7eSKevin Wolf# check if accept4 is there 450140ff6d7eSKevin Wolfaccept4=no 450240ff6d7eSKevin Wolfcat > $TMPC << EOF 450340ff6d7eSKevin Wolf#include <sys/socket.h> 450440ff6d7eSKevin Wolf#include <stddef.h> 450540ff6d7eSKevin Wolf 450640ff6d7eSKevin Wolfint main(void) 450740ff6d7eSKevin Wolf{ 450840ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 450940ff6d7eSKevin Wolf return 0; 451040ff6d7eSKevin Wolf} 451140ff6d7eSKevin WolfEOF 451240ff6d7eSKevin Wolfif compile_prog "" "" ; then 451340ff6d7eSKevin Wolf accept4=yes 451440ff6d7eSKevin Wolffi 451540ff6d7eSKevin Wolf 45163ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 45173ce34dfbSvibisreenivasansplice=no 45183ce34dfbSvibisreenivasancat > $TMPC << EOF 45193ce34dfbSvibisreenivasan#include <unistd.h> 45203ce34dfbSvibisreenivasan#include <fcntl.h> 45213ce34dfbSvibisreenivasan#include <limits.h> 45223ce34dfbSvibisreenivasan 45233ce34dfbSvibisreenivasanint main(void) 45243ce34dfbSvibisreenivasan{ 452566ea0f22SStefan Weil int len, fd = 0; 45263ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 45273ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 45283ce34dfbSvibisreenivasan return 0; 45293ce34dfbSvibisreenivasan} 45303ce34dfbSvibisreenivasanEOF 453152166aa0SJuan Quintelaif compile_prog "" "" ; then 45323ce34dfbSvibisreenivasan splice=yes 45333ce34dfbSvibisreenivasanfi 45343ce34dfbSvibisreenivasan 4535dcc38d1cSMarcelo Tosatti########################################## 4536a99d57bbSWanlong Gao# libnuma probe 4537a99d57bbSWanlong Gao 4538a99d57bbSWanlong Gaoif test "$numa" != "no" ; then 4539a99d57bbSWanlong Gao cat > $TMPC << EOF 4540a99d57bbSWanlong Gao#include <numa.h> 4541a99d57bbSWanlong Gaoint main(void) { return numa_available(); } 4542a99d57bbSWanlong GaoEOF 4543a99d57bbSWanlong Gao 4544a99d57bbSWanlong Gao if compile_prog "" "-lnuma" ; then 4545a99d57bbSWanlong Gao numa=yes 4546a99d57bbSWanlong Gao libs_softmmu="-lnuma $libs_softmmu" 4547a99d57bbSWanlong Gao else 4548a99d57bbSWanlong Gao if test "$numa" = "yes" ; then 4549a99d57bbSWanlong Gao feature_not_found "numa" "install numactl devel" 4550a99d57bbSWanlong Gao fi 4551a99d57bbSWanlong Gao numa=no 4552a99d57bbSWanlong Gao fi 4553a99d57bbSWanlong Gaofi 4554a99d57bbSWanlong Gao 45557b01cb97SAlexandre Derumierif test "$tcmalloc" = "yes" && test "$jemalloc" = "yes" ; then 45567b01cb97SAlexandre Derumier echo "ERROR: tcmalloc && jemalloc can't be used at the same time" 45577b01cb97SAlexandre Derumier exit 1 45587b01cb97SAlexandre Derumierfi 45597b01cb97SAlexandre Derumier 45605a22ab71SYang Zhong# Even if malloc_trim() is available, these non-libc memory allocators 45615a22ab71SYang Zhong# do not support it. 45625a22ab71SYang Zhongif test "$tcmalloc" = "yes" || test "$jemalloc" = "yes" ; then 45635a22ab71SYang Zhong if test "$malloc_trim" = "yes" ; then 45645a22ab71SYang Zhong echo "Disabling malloc_trim with non-libc memory allocator" 45655a22ab71SYang Zhong fi 45665a22ab71SYang Zhong malloc_trim="no" 45675a22ab71SYang Zhongfi 45685a22ab71SYang Zhong 45695a22ab71SYang Zhong####################################### 45705a22ab71SYang Zhong# malloc_trim 45715a22ab71SYang Zhong 45725a22ab71SYang Zhongif test "$malloc_trim" != "no" ; then 45735a22ab71SYang Zhong cat > $TMPC << EOF 45745a22ab71SYang Zhong#include <malloc.h> 45755a22ab71SYang Zhongint main(void) { malloc_trim(0); return 0; } 45765a22ab71SYang ZhongEOF 45775a22ab71SYang Zhong if compile_prog "" "" ; then 45785a22ab71SYang Zhong malloc_trim="yes" 45795a22ab71SYang Zhong else 45805a22ab71SYang Zhong malloc_trim="no" 45815a22ab71SYang Zhong fi 45825a22ab71SYang Zhongfi 45835a22ab71SYang Zhong 4584a99d57bbSWanlong Gao########################################## 45852847b469SFam Zheng# tcmalloc probe 45862847b469SFam Zheng 45872847b469SFam Zhengif test "$tcmalloc" = "yes" ; then 45882847b469SFam Zheng cat > $TMPC << EOF 45892847b469SFam Zheng#include <stdlib.h> 45902847b469SFam Zhengint main(void) { malloc(1); return 0; } 45912847b469SFam ZhengEOF 45922847b469SFam Zheng 45932847b469SFam Zheng if compile_prog "" "-ltcmalloc" ; then 45942847b469SFam Zheng LIBS="-ltcmalloc $LIBS" 45952847b469SFam Zheng else 45962847b469SFam Zheng feature_not_found "tcmalloc" "install gperftools devel" 45972847b469SFam Zheng fi 45982847b469SFam Zhengfi 45992847b469SFam Zheng 46002847b469SFam Zheng########################################## 46017b01cb97SAlexandre Derumier# jemalloc probe 46027b01cb97SAlexandre Derumier 46037b01cb97SAlexandre Derumierif test "$jemalloc" = "yes" ; then 46047b01cb97SAlexandre Derumier cat > $TMPC << EOF 46057b01cb97SAlexandre Derumier#include <stdlib.h> 46067b01cb97SAlexandre Derumierint main(void) { malloc(1); return 0; } 46077b01cb97SAlexandre DerumierEOF 46087b01cb97SAlexandre Derumier 46097b01cb97SAlexandre Derumier if compile_prog "" "-ljemalloc" ; then 46107b01cb97SAlexandre Derumier LIBS="-ljemalloc $LIBS" 46117b01cb97SAlexandre Derumier else 46127b01cb97SAlexandre Derumier feature_not_found "jemalloc" "install jemalloc devel" 46137b01cb97SAlexandre Derumier fi 46147b01cb97SAlexandre Derumierfi 46157b01cb97SAlexandre Derumier 46167b01cb97SAlexandre Derumier########################################## 4617dcc38d1cSMarcelo Tosatti# signalfd probe 4618dcc38d1cSMarcelo Tosattisignalfd="no" 4619dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 4620dcc38d1cSMarcelo Tosatti#include <unistd.h> 4621dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 4622dcc38d1cSMarcelo Tosatti#include <signal.h> 4623dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 4624dcc38d1cSMarcelo TosattiEOF 4625dcc38d1cSMarcelo Tosatti 4626dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 4627dcc38d1cSMarcelo Tosatti signalfd=yes 4628dcc38d1cSMarcelo Tosattifi 4629dcc38d1cSMarcelo Tosatti 4630d339d766SRichard W.M. Jones# check if optreset global is declared by <getopt.h> 4631d339d766SRichard W.M. Jonesoptreset="no" 4632d339d766SRichard W.M. Jonescat > $TMPC << EOF 4633d339d766SRichard W.M. Jones#include <getopt.h> 4634d339d766SRichard W.M. Jonesint main(void) { return optreset; } 4635d339d766SRichard W.M. JonesEOF 4636d339d766SRichard W.M. Jones 4637d339d766SRichard W.M. Jonesif compile_prog "" "" ; then 4638d339d766SRichard W.M. Jones optreset=yes 4639d339d766SRichard W.M. Jonesfi 4640d339d766SRichard W.M. Jones 4641c2882b96SRiku Voipio# check if eventfd is supported 4642c2882b96SRiku Voipioeventfd=no 4643c2882b96SRiku Voipiocat > $TMPC << EOF 4644c2882b96SRiku Voipio#include <sys/eventfd.h> 4645c2882b96SRiku Voipio 4646c2882b96SRiku Voipioint main(void) 4647c2882b96SRiku Voipio{ 464855cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 4649c2882b96SRiku Voipio} 4650c2882b96SRiku VoipioEOF 4651c2882b96SRiku Voipioif compile_prog "" "" ; then 4652c2882b96SRiku Voipio eventfd=yes 4653c2882b96SRiku Voipiofi 4654c2882b96SRiku Voipio 4655751bcc39SMarc-André Lureau# check if memfd is supported 4656751bcc39SMarc-André Lureaumemfd=no 4657751bcc39SMarc-André Lureaucat > $TMPC << EOF 465875e5b70eSPaolo Bonzini#include <sys/mman.h> 4659751bcc39SMarc-André Lureau 4660751bcc39SMarc-André Lureauint main(void) 4661751bcc39SMarc-André Lureau{ 4662751bcc39SMarc-André Lureau return memfd_create("foo", MFD_ALLOW_SEALING); 4663751bcc39SMarc-André Lureau} 4664751bcc39SMarc-André LureauEOF 4665751bcc39SMarc-André Lureauif compile_prog "" "" ; then 4666751bcc39SMarc-André Lureau memfd=yes 4667751bcc39SMarc-André Lureaufi 4668751bcc39SMarc-André Lureau 4669955727d2SCortland Tölva# check for usbfs 4670955727d2SCortland Tölvahave_usbfs=no 4671955727d2SCortland Tölvaif test "$linux_user" = "yes"; then 467296566d09SThomas Petazzoni cat > $TMPC << EOF 467396566d09SThomas Petazzoni#include <linux/usbdevice_fs.h> 467496566d09SThomas Petazzoni 467596566d09SThomas Petazzoni#ifndef USBDEVFS_GET_CAPABILITIES 467696566d09SThomas Petazzoni#error "USBDEVFS_GET_CAPABILITIES undefined" 467796566d09SThomas Petazzoni#endif 467896566d09SThomas Petazzoni 467996566d09SThomas Petazzoni#ifndef USBDEVFS_DISCONNECT_CLAIM 468096566d09SThomas Petazzoni#error "USBDEVFS_DISCONNECT_CLAIM undefined" 468196566d09SThomas Petazzoni#endif 468296566d09SThomas Petazzoni 468396566d09SThomas Petazzoniint main(void) 468496566d09SThomas Petazzoni{ 468596566d09SThomas Petazzoni return 0; 468696566d09SThomas Petazzoni} 468796566d09SThomas PetazzoniEOF 468896566d09SThomas Petazzoni if compile_prog "" ""; then 4689955727d2SCortland Tölva have_usbfs=yes 4690955727d2SCortland Tölva fi 4691955727d2SCortland Tölvafi 4692751bcc39SMarc-André Lureau 4693d0927938SUlrich Hecht# check for fallocate 4694d0927938SUlrich Hechtfallocate=no 4695d0927938SUlrich Hechtcat > $TMPC << EOF 4696d0927938SUlrich Hecht#include <fcntl.h> 4697d0927938SUlrich Hecht 4698d0927938SUlrich Hechtint main(void) 4699d0927938SUlrich Hecht{ 4700d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 4701d0927938SUlrich Hecht return 0; 4702d0927938SUlrich Hecht} 4703d0927938SUlrich HechtEOF 47048fb03151SPeter Maydellif compile_prog "" "" ; then 4705d0927938SUlrich Hecht fallocate=yes 4706d0927938SUlrich Hechtfi 4707d0927938SUlrich Hecht 47083d4fa43eSKusanagi Kouichi# check for fallocate hole punching 47093d4fa43eSKusanagi Kouichifallocate_punch_hole=no 47103d4fa43eSKusanagi Kouichicat > $TMPC << EOF 47113d4fa43eSKusanagi Kouichi#include <fcntl.h> 47123d4fa43eSKusanagi Kouichi#include <linux/falloc.h> 47133d4fa43eSKusanagi Kouichi 47143d4fa43eSKusanagi Kouichiint main(void) 47153d4fa43eSKusanagi Kouichi{ 47163d4fa43eSKusanagi Kouichi fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); 47173d4fa43eSKusanagi Kouichi return 0; 47183d4fa43eSKusanagi Kouichi} 47193d4fa43eSKusanagi KouichiEOF 47203d4fa43eSKusanagi Kouichiif compile_prog "" "" ; then 47213d4fa43eSKusanagi Kouichi fallocate_punch_hole=yes 47223d4fa43eSKusanagi Kouichifi 47233d4fa43eSKusanagi Kouichi 4724b953f075SDenis V. Lunev# check that fallocate supports range zeroing inside the file 4725b953f075SDenis V. Lunevfallocate_zero_range=no 4726b953f075SDenis V. Lunevcat > $TMPC << EOF 4727b953f075SDenis V. Lunev#include <fcntl.h> 4728b953f075SDenis V. Lunev#include <linux/falloc.h> 4729b953f075SDenis V. Lunev 4730b953f075SDenis V. Lunevint main(void) 4731b953f075SDenis V. Lunev{ 4732b953f075SDenis V. Lunev fallocate(0, FALLOC_FL_ZERO_RANGE, 0, 0); 4733b953f075SDenis V. Lunev return 0; 4734b953f075SDenis V. Lunev} 4735b953f075SDenis V. LunevEOF 4736b953f075SDenis V. Lunevif compile_prog "" "" ; then 4737b953f075SDenis V. Lunev fallocate_zero_range=yes 4738b953f075SDenis V. Lunevfi 4739b953f075SDenis V. Lunev 4740ed911435SKevin Wolf# check for posix_fallocate 4741ed911435SKevin Wolfposix_fallocate=no 4742ed911435SKevin Wolfcat > $TMPC << EOF 4743ed911435SKevin Wolf#include <fcntl.h> 4744ed911435SKevin Wolf 4745ed911435SKevin Wolfint main(void) 4746ed911435SKevin Wolf{ 4747ed911435SKevin Wolf posix_fallocate(0, 0, 0); 4748ed911435SKevin Wolf return 0; 4749ed911435SKevin Wolf} 4750ed911435SKevin WolfEOF 4751ed911435SKevin Wolfif compile_prog "" "" ; then 4752ed911435SKevin Wolf posix_fallocate=yes 4753ed911435SKevin Wolffi 4754ed911435SKevin Wolf 4755c727f47dSPeter Maydell# check for sync_file_range 4756c727f47dSPeter Maydellsync_file_range=no 4757c727f47dSPeter Maydellcat > $TMPC << EOF 4758c727f47dSPeter Maydell#include <fcntl.h> 4759c727f47dSPeter Maydell 4760c727f47dSPeter Maydellint main(void) 4761c727f47dSPeter Maydell{ 4762c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 4763c727f47dSPeter Maydell return 0; 4764c727f47dSPeter Maydell} 4765c727f47dSPeter MaydellEOF 47668fb03151SPeter Maydellif compile_prog "" "" ; then 4767c727f47dSPeter Maydell sync_file_range=yes 4768c727f47dSPeter Maydellfi 4769c727f47dSPeter Maydell 4770dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 4771dace20dcSPeter Maydellfiemap=no 4772dace20dcSPeter Maydellcat > $TMPC << EOF 4773dace20dcSPeter Maydell#include <sys/ioctl.h> 4774dace20dcSPeter Maydell#include <linux/fs.h> 4775dace20dcSPeter Maydell#include <linux/fiemap.h> 4776dace20dcSPeter Maydell 4777dace20dcSPeter Maydellint main(void) 4778dace20dcSPeter Maydell{ 4779dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 4780dace20dcSPeter Maydell return 0; 4781dace20dcSPeter Maydell} 4782dace20dcSPeter MaydellEOF 47838fb03151SPeter Maydellif compile_prog "" "" ; then 4784dace20dcSPeter Maydell fiemap=yes 4785dace20dcSPeter Maydellfi 4786dace20dcSPeter Maydell 4787d0927938SUlrich Hecht# check for dup3 4788d0927938SUlrich Hechtdup3=no 4789d0927938SUlrich Hechtcat > $TMPC << EOF 4790d0927938SUlrich Hecht#include <unistd.h> 4791d0927938SUlrich Hecht 4792d0927938SUlrich Hechtint main(void) 4793d0927938SUlrich Hecht{ 4794d0927938SUlrich Hecht dup3(0, 0, 0); 4795d0927938SUlrich Hecht return 0; 4796d0927938SUlrich Hecht} 4797d0927938SUlrich HechtEOF 479878f5d726SJan Kiszkaif compile_prog "" "" ; then 4799d0927938SUlrich Hecht dup3=yes 4800d0927938SUlrich Hechtfi 4801d0927938SUlrich Hecht 48024e0c6529SAlex Bligh# check for ppoll support 48034e0c6529SAlex Blighppoll=no 48044e0c6529SAlex Blighcat > $TMPC << EOF 48054e0c6529SAlex Bligh#include <poll.h> 48064e0c6529SAlex Bligh 48074e0c6529SAlex Blighint main(void) 48084e0c6529SAlex Bligh{ 48094e0c6529SAlex Bligh struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; 48104e0c6529SAlex Bligh ppoll(&pfd, 1, 0, 0); 48114e0c6529SAlex Bligh return 0; 48124e0c6529SAlex Bligh} 48134e0c6529SAlex BlighEOF 48144e0c6529SAlex Blighif compile_prog "" "" ; then 48154e0c6529SAlex Bligh ppoll=yes 48164e0c6529SAlex Blighfi 48174e0c6529SAlex Bligh 4818cd758dd0SAlex Bligh# check for prctl(PR_SET_TIMERSLACK , ... ) support 4819cd758dd0SAlex Blighprctl_pr_set_timerslack=no 4820cd758dd0SAlex Blighcat > $TMPC << EOF 4821cd758dd0SAlex Bligh#include <sys/prctl.h> 4822cd758dd0SAlex Bligh 4823cd758dd0SAlex Blighint main(void) 4824cd758dd0SAlex Bligh{ 4825cd758dd0SAlex Bligh prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); 4826cd758dd0SAlex Bligh return 0; 4827cd758dd0SAlex Bligh} 4828cd758dd0SAlex BlighEOF 4829cd758dd0SAlex Blighif compile_prog "" "" ; then 4830cd758dd0SAlex Bligh prctl_pr_set_timerslack=yes 4831cd758dd0SAlex Blighfi 4832cd758dd0SAlex Bligh 48333b6edd16SPeter Maydell# check for epoll support 48343b6edd16SPeter Maydellepoll=no 48353b6edd16SPeter Maydellcat > $TMPC << EOF 48363b6edd16SPeter Maydell#include <sys/epoll.h> 48373b6edd16SPeter Maydell 48383b6edd16SPeter Maydellint main(void) 48393b6edd16SPeter Maydell{ 48403b6edd16SPeter Maydell epoll_create(0); 48413b6edd16SPeter Maydell return 0; 48423b6edd16SPeter Maydell} 48433b6edd16SPeter MaydellEOF 48448fb03151SPeter Maydellif compile_prog "" "" ; then 48453b6edd16SPeter Maydell epoll=yes 48463b6edd16SPeter Maydellfi 48473b6edd16SPeter Maydell 4848227f0214SPeter Maydell# epoll_create1 is a later addition 4849227f0214SPeter Maydell# so we must check separately for its presence 48503b6edd16SPeter Maydellepoll_create1=no 48513b6edd16SPeter Maydellcat > $TMPC << EOF 48523b6edd16SPeter Maydell#include <sys/epoll.h> 48533b6edd16SPeter Maydell 48543b6edd16SPeter Maydellint main(void) 48553b6edd16SPeter Maydell{ 485619e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 485719e83f6bSPeter Maydell * a function being called. This is necessary so that on 485819e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 485919e83f6bSPeter Maydell * the library but not declared in the header file we will 486019e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 486119e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 486219e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 486319e83f6bSPeter Maydell */ 4864c075a723SBlue Swirl return (int)(uintptr_t)&epoll_create1; 48653b6edd16SPeter Maydell} 48663b6edd16SPeter MaydellEOF 48678fb03151SPeter Maydellif compile_prog "" "" ; then 48683b6edd16SPeter Maydell epoll_create1=yes 48693b6edd16SPeter Maydellfi 48703b6edd16SPeter Maydell 4871a8fd1abaSPeter Maydell# check for sendfile support 4872a8fd1abaSPeter Maydellsendfile=no 4873a8fd1abaSPeter Maydellcat > $TMPC << EOF 4874a8fd1abaSPeter Maydell#include <sys/sendfile.h> 4875a8fd1abaSPeter Maydell 4876a8fd1abaSPeter Maydellint main(void) 4877a8fd1abaSPeter Maydell{ 4878a8fd1abaSPeter Maydell return sendfile(0, 0, 0, 0); 4879a8fd1abaSPeter Maydell} 4880a8fd1abaSPeter MaydellEOF 4881a8fd1abaSPeter Maydellif compile_prog "" "" ; then 4882a8fd1abaSPeter Maydell sendfile=yes 4883a8fd1abaSPeter Maydellfi 4884a8fd1abaSPeter Maydell 488551834341SRiku Voipio# check for timerfd support (glibc 2.8 and newer) 488651834341SRiku Voipiotimerfd=no 488751834341SRiku Voipiocat > $TMPC << EOF 488851834341SRiku Voipio#include <sys/timerfd.h> 488951834341SRiku Voipio 489051834341SRiku Voipioint main(void) 489151834341SRiku Voipio{ 489251834341SRiku Voipio return(timerfd_create(CLOCK_REALTIME, 0)); 489351834341SRiku Voipio} 489451834341SRiku VoipioEOF 489551834341SRiku Voipioif compile_prog "" "" ; then 489651834341SRiku Voipio timerfd=yes 489751834341SRiku Voipiofi 489851834341SRiku Voipio 48999af5c906SRiku Voipio# check for setns and unshare support 49009af5c906SRiku Voipiosetns=no 49019af5c906SRiku Voipiocat > $TMPC << EOF 49029af5c906SRiku Voipio#include <sched.h> 49039af5c906SRiku Voipio 49049af5c906SRiku Voipioint main(void) 49059af5c906SRiku Voipio{ 49069af5c906SRiku Voipio int ret; 49079af5c906SRiku Voipio ret = setns(0, 0); 49089af5c906SRiku Voipio ret = unshare(0); 49099af5c906SRiku Voipio return ret; 49109af5c906SRiku Voipio} 49119af5c906SRiku VoipioEOF 49129af5c906SRiku Voipioif compile_prog "" "" ; then 49139af5c906SRiku Voipio setns=yes 49149af5c906SRiku Voipiofi 49159af5c906SRiku Voipio 491638860a03SAleksandar Markovic# clock_adjtime probe 491738860a03SAleksandar Markovicclock_adjtime=no 491838860a03SAleksandar Markoviccat > $TMPC <<EOF 491938860a03SAleksandar Markovic#include <time.h> 492038860a03SAleksandar Markovic 492138860a03SAleksandar Markovicint main(void) 492238860a03SAleksandar Markovic{ 492338860a03SAleksandar Markovic return clock_adjtime(0, 0); 492438860a03SAleksandar Markovic} 492538860a03SAleksandar MarkovicEOF 492638860a03SAleksandar Markovicclock_adjtime=no 492738860a03SAleksandar Markovicif compile_prog "" "" ; then 492838860a03SAleksandar Markovic clock_adjtime=yes 492938860a03SAleksandar Markovicfi 493038860a03SAleksandar Markovic 49315a03cd00SAleksandar Markovic# syncfs probe 49325a03cd00SAleksandar Markovicsyncfs=no 49335a03cd00SAleksandar Markoviccat > $TMPC <<EOF 49345a03cd00SAleksandar Markovic#include <unistd.h> 49355a03cd00SAleksandar Markovic 49365a03cd00SAleksandar Markovicint main(void) 49375a03cd00SAleksandar Markovic{ 49385a03cd00SAleksandar Markovic return syncfs(0); 49395a03cd00SAleksandar Markovic} 49405a03cd00SAleksandar MarkovicEOF 49415a03cd00SAleksandar Markovicsyncfs=no 49425a03cd00SAleksandar Markovicif compile_prog "" "" ; then 49435a03cd00SAleksandar Markovic syncfs=yes 49445a03cd00SAleksandar Markovicfi 49455a03cd00SAleksandar Markovic 4946db37dd89SAleksandar Markovic# check for kcov support (kernel must be 4.4+, compiled with certain options) 4947db37dd89SAleksandar Markovickcov=no 4948db37dd89SAleksandar Markovicif check_include sys/kcov.h ; then 4949db37dd89SAleksandar Markovic kcov=yes 4950db37dd89SAleksandar Markovicfi 4951db37dd89SAleksandar Markovic 4952516e8b7dSPeter Maydell# If we're making warnings fatal, apply this to Sphinx runs as well 4953516e8b7dSPeter Maydellsphinx_werror="" 4954516e8b7dSPeter Maydellif test "$werror" = "yes"; then 4955516e8b7dSPeter Maydell sphinx_werror="-W" 4956516e8b7dSPeter Maydellfi 4957516e8b7dSPeter Maydell 49585f71eac0SPeter Maydell# Check we have a new enough version of sphinx-build 49595f71eac0SPeter Maydellhas_sphinx_build() { 49605f71eac0SPeter Maydell # This is a bit awkward but works: create a trivial document and 49615f71eac0SPeter Maydell # try to run it with our configuration file (which enforces a 49625f71eac0SPeter Maydell # version requirement). This will fail if either 49635f71eac0SPeter Maydell # sphinx-build doesn't exist at all or if it is too old. 49645f71eac0SPeter Maydell mkdir -p "$TMPDIR1/sphinx" 49655f71eac0SPeter Maydell touch "$TMPDIR1/sphinx/index.rst" 4966988ae6c3SAlex Bennée "$sphinx_build" $sphinx_werror -c "$source_path/docs" \ 4967988ae6c3SAlex Bennée -b html "$TMPDIR1/sphinx" \ 4968988ae6c3SAlex Bennée "$TMPDIR1/sphinx/out" >> config.log 2>&1 49695f71eac0SPeter Maydell} 49705f71eac0SPeter Maydell 4971cc8ae6deSpbrook# Check if tools are available to build documentation. 4972a25dba17SJuan Quintelaif test "$docs" != "no" ; then 4973758b617aSPeter Maydell if has_sphinx_build; then 4974758b617aSPeter Maydell sphinx_ok=yes 4975758b617aSPeter Maydell else 4976758b617aSPeter Maydell sphinx_ok=no 4977758b617aSPeter Maydell fi 4978758b617aSPeter Maydell if has makeinfo && has pod2man && test "$sphinx_ok" = "yes"; then 4979a25dba17SJuan Quintela docs=yes 498083a3ab8bSJuan Quintela else 4981a25dba17SJuan Quintela if test "$docs" = "yes" ; then 4982758b617aSPeter Maydell if has $sphinx_build && test "$sphinx_ok" != "yes"; then 4983758b617aSPeter Maydell echo "Warning: $sphinx_build exists but it is either too old or uses too old a Python version" >&2 4984758b617aSPeter Maydell fi 4985758b617aSPeter Maydell feature_not_found "docs" "Install texinfo, Perl/perl-podlators and a Python 3 version of python-sphinx" 498683a3ab8bSJuan Quintela fi 4987a25dba17SJuan Quintela docs=no 498883a3ab8bSJuan Quintela fi 4989cc8ae6deSpbrookfi 4990cc8ae6deSpbrook 4991f514f41cSStefan Weil# Search for bswap_32 function 49926ae9a1f4SJuan Quintelabyteswap_h=no 49936ae9a1f4SJuan Quintelacat > $TMPC << EOF 49946ae9a1f4SJuan Quintela#include <byteswap.h> 49956ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 49966ae9a1f4SJuan QuintelaEOF 499752166aa0SJuan Quintelaif compile_prog "" "" ; then 49986ae9a1f4SJuan Quintela byteswap_h=yes 49996ae9a1f4SJuan Quintelafi 50006ae9a1f4SJuan Quintela 500175f13596SStefan Weil# Search for bswap32 function 50026ae9a1f4SJuan Quintelabswap_h=no 50036ae9a1f4SJuan Quintelacat > $TMPC << EOF 50046ae9a1f4SJuan Quintela#include <sys/endian.h> 50056ae9a1f4SJuan Quintela#include <sys/types.h> 50066ae9a1f4SJuan Quintela#include <machine/bswap.h> 50076ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 50086ae9a1f4SJuan QuintelaEOF 500952166aa0SJuan Quintelaif compile_prog "" "" ; then 50106ae9a1f4SJuan Quintela bswap_h=yes 50116ae9a1f4SJuan Quintelafi 50126ae9a1f4SJuan Quintela 5013da93a1fdSaliguori########################################## 5014e49ab19fSPeter Lieven# Do we have libiscsi >= 1.9.0 5015c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 5016e49ab19fSPeter Lieven if $pkg_config --atleast-version=1.9.0 libiscsi; then 50173c33ea96SPaolo Bonzini libiscsi="yes" 5018ca871ec8SStefan Weil libiscsi_cflags=$($pkg_config --cflags libiscsi) 5019ca871ec8SStefan Weil libiscsi_libs=$($pkg_config --libs libiscsi) 5020c589b249SRonnie Sahlberg else 5021c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 5022e49ab19fSPeter Lieven feature_not_found "libiscsi" "Install libiscsi >= 1.9.0" 5023c589b249SRonnie Sahlberg fi 5024c589b249SRonnie Sahlberg libiscsi="no" 5025c589b249SRonnie Sahlberg fi 5026c589b249SRonnie Sahlbergfi 5027c589b249SRonnie Sahlberg 5028c589b249SRonnie Sahlberg########################################## 50298bacde8dSNatanael Copa# Do we need libm 50308bacde8dSNatanael Copacat > $TMPC << EOF 50318bacde8dSNatanael Copa#include <math.h> 5032f80ea986SAlexey Kardashevskiyint main(int argc, char **argv) { return isnan(sin((double)argc)); } 50338bacde8dSNatanael CopaEOF 50348bacde8dSNatanael Copaif compile_prog "" "" ; then 50358bacde8dSNatanael Copa : 50368bacde8dSNatanael Copaelif compile_prog "" "-lm" ; then 50378bacde8dSNatanael Copa LIBS="-lm $LIBS" 50388bacde8dSNatanael Copa libs_qga="-lm $libs_qga" 50398bacde8dSNatanael Copaelse 504076ad07a4SPeter Maydell error_exit "libm check failed" 50418bacde8dSNatanael Copafi 50428bacde8dSNatanael Copa 50438bacde8dSNatanael Copa########################################## 5044da93a1fdSaliguori# Do we need librt 50458bacde8dSNatanael Copa# uClibc provides 2 versions of clock_gettime(), one with realtime 50468bacde8dSNatanael Copa# support and one without. This means that the clock_gettime() don't 50478bacde8dSNatanael Copa# need -lrt. We still need it for timer_create() so we check for this 50488bacde8dSNatanael Copa# function in addition. 5049da93a1fdSaliguoricat > $TMPC <<EOF 5050da93a1fdSaliguori#include <signal.h> 5051da93a1fdSaliguori#include <time.h> 50528bacde8dSNatanael Copaint main(void) { 50538bacde8dSNatanael Copa timer_create(CLOCK_REALTIME, NULL, NULL); 50548bacde8dSNatanael Copa return clock_gettime(CLOCK_REALTIME, NULL); 50558bacde8dSNatanael Copa} 5056da93a1fdSaliguoriEOF 5057da93a1fdSaliguori 505852166aa0SJuan Quintelaif compile_prog "" "" ; then 505907ffa4bdSJuan Quintela : 50608bacde8dSNatanael Copa# we need pthread for static linking. use previous pthread test result 506118e588b1SRick Liuelif compile_prog "" "$pthread_lib -lrt" ; then 506218e588b1SRick Liu LIBS="$LIBS -lrt" 506318e588b1SRick Liu libs_qga="$libs_qga -lrt" 5064da93a1fdSaliguorifi 5065da93a1fdSaliguori 5066d99e97e6SThomas Huth# Check whether we need to link libutil for openpty() 5067d99e97e6SThomas Huthcat > $TMPC << EOF 5068d99e97e6SThomas Huthextern int openpty(int *am, int *as, char *name, void *termp, void *winp); 5069d99e97e6SThomas Huthint main(void) { return openpty(0, 0, 0, 0, 0); } 5070d99e97e6SThomas HuthEOF 5071d99e97e6SThomas Huth 5072d99e97e6SThomas Huthif ! compile_prog "" "" ; then 5073d99e97e6SThomas Huth if compile_prog "" "-lutil" ; then 50746362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 5075d99e97e6SThomas Huth libs_tools="-lutil $libs_tools" 5076d99e97e6SThomas Huth fi 50776362a53fSJuan Quintelafi 50786362a53fSJuan Quintela 5079de5071c5SBlue Swirl########################################## 5080cd4ec0b4SGerd Hoffmann# spice probe 5081cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 5082cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 5083cd4ec0b4SGerd Hoffmann#include <spice.h> 5084cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 5085cd4ec0b4SGerd HoffmannEOF 5086710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 5087710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 50881b63665cSMarc-André Lureau if $pkg_config --atleast-version=0.12.5 spice-server && \ 508965d5d3f9SStefan Weil $pkg_config --atleast-version=0.12.3 spice-protocol && \ 5090cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 5091cd4ec0b4SGerd Hoffmann spice="yes" 5092cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 5093cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 50942e0e3c39SAlon Levy spice_protocol_version=$($pkg_config --modversion spice-protocol) 50952e0e3c39SAlon Levy spice_server_version=$($pkg_config --modversion spice-server) 5096cd4ec0b4SGerd Hoffmann else 5097cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 50988efc9363SHu Tao feature_not_found "spice" \ 50991b63665cSMarc-André Lureau "Install spice-server(>=0.12.5) and spice-protocol(>=0.12.3) devel" 5100cd4ec0b4SGerd Hoffmann fi 5101cd4ec0b4SGerd Hoffmann spice="no" 5102cd4ec0b4SGerd Hoffmann fi 5103cd4ec0b4SGerd Hoffmannfi 5104cd4ec0b4SGerd Hoffmann 51057b02f544SMarc-André Lureau# check for smartcard support 51067b02f544SMarc-André Lureauif test "$smartcard" != "no"; then 51070f5c642dSMichal Privoznik if $pkg_config --atleast-version=2.5.1 libcacard; then 51087b02f544SMarc-André Lureau libcacard_cflags=$($pkg_config --cflags libcacard) 51097b02f544SMarc-André Lureau libcacard_libs=$($pkg_config --libs libcacard) 51107b02f544SMarc-André Lureau smartcard="yes" 5111111a38b0SRobert Relyea else 51127b02f544SMarc-André Lureau if test "$smartcard" = "yes"; then 51137b02f544SMarc-André Lureau feature_not_found "smartcard" "Install libcacard devel" 5114111a38b0SRobert Relyea fi 51157b02f544SMarc-André Lureau smartcard="no" 5116111a38b0SRobert Relyea fi 5117111a38b0SRobert Relyeafi 5118111a38b0SRobert Relyea 51192b2325ffSGerd Hoffmann# check for libusb 51202b2325ffSGerd Hoffmannif test "$libusb" != "no" ; then 512165d5d3f9SStefan Weil if $pkg_config --atleast-version=1.0.13 libusb-1.0; then 51222b2325ffSGerd Hoffmann libusb="yes" 5123ca871ec8SStefan Weil libusb_cflags=$($pkg_config --cflags libusb-1.0) 5124ca871ec8SStefan Weil libusb_libs=$($pkg_config --libs libusb-1.0) 51252b2325ffSGerd Hoffmann else 51262b2325ffSGerd Hoffmann if test "$libusb" = "yes"; then 51278efc9363SHu Tao feature_not_found "libusb" "Install libusb devel >= 1.0.13" 51282b2325ffSGerd Hoffmann fi 51292b2325ffSGerd Hoffmann libusb="no" 51302b2325ffSGerd Hoffmann fi 51312b2325ffSGerd Hoffmannfi 51322b2325ffSGerd Hoffmann 513369354a83SHans de Goede# check for usbredirparser for usb network redirection support 513469354a83SHans de Goedeif test "$usb_redir" != "no" ; then 513565d5d3f9SStefan Weil if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then 513669354a83SHans de Goede usb_redir="yes" 5137ca871ec8SStefan Weil usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) 5138ca871ec8SStefan Weil usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) 513969354a83SHans de Goede else 514069354a83SHans de Goede if test "$usb_redir" = "yes"; then 514121684af0SStewart Smith feature_not_found "usb-redir" "Install usbredir devel" 514269354a83SHans de Goede fi 514369354a83SHans de Goede usb_redir="no" 514469354a83SHans de Goede fi 514569354a83SHans de Goedefi 514669354a83SHans de Goede 5147cd4ec0b4SGerd Hoffmann########################################## 5148d9840e25STomoki Sekiyama# check if we have VSS SDK headers for win 5149d9840e25STomoki Sekiyama 5150e633a5c6SEric Blakeif test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ 5151e633a5c6SEric Blake test "$vss_win32_sdk" != "no" ; then 5152d9840e25STomoki Sekiyama case "$vss_win32_sdk" in 5153690604f6SMichael Roth "") vss_win32_include="-isystem $source_path" ;; 5154d9840e25STomoki Sekiyama *\ *) # The SDK is installed in "Program Files" by default, but we cannot 5155d9840e25STomoki Sekiyama # handle path with spaces. So we symlink the headers into ".sdk/vss". 5156690604f6SMichael Roth vss_win32_include="-isystem $source_path/.sdk/vss" 5157d9840e25STomoki Sekiyama symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" 5158d9840e25STomoki Sekiyama ;; 5159690604f6SMichael Roth *) vss_win32_include="-isystem $vss_win32_sdk" 5160d9840e25STomoki Sekiyama esac 5161d9840e25STomoki Sekiyama cat > $TMPC << EOF 5162d9840e25STomoki Sekiyama#define __MIDL_user_allocate_free_DEFINED__ 5163d9840e25STomoki Sekiyama#include <inc/win2003/vss.h> 5164d9840e25STomoki Sekiyamaint main(void) { return VSS_CTX_BACKUP; } 5165d9840e25STomoki SekiyamaEOF 5166d9840e25STomoki Sekiyama if compile_prog "$vss_win32_include" "" ; then 5167d9840e25STomoki Sekiyama guest_agent_with_vss="yes" 5168d9840e25STomoki Sekiyama QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" 5169315d3184SFam Zheng libs_qga="-lole32 -loleaut32 -lshlwapi -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" 5170f33ca81fSMichael Roth qga_vss_provider="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb" 5171d9840e25STomoki Sekiyama else 5172d9840e25STomoki Sekiyama if test "$vss_win32_sdk" != "" ; then 5173d9840e25STomoki Sekiyama echo "ERROR: Please download and install Microsoft VSS SDK:" 5174d9840e25STomoki Sekiyama echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" 5175d9840e25STomoki Sekiyama echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" 5176d9840e25STomoki Sekiyama echo "ERROR: scripts/extract-vsssdk-headers setup.exe" 5177d9840e25STomoki Sekiyama echo "ERROR: The headers are extracted in the directory \`inc'." 5178d9840e25STomoki Sekiyama feature_not_found "VSS support" 5179d9840e25STomoki Sekiyama fi 5180d9840e25STomoki Sekiyama guest_agent_with_vss="no" 5181d9840e25STomoki Sekiyama fi 5182d9840e25STomoki Sekiyamafi 5183d9840e25STomoki Sekiyama 5184d9840e25STomoki Sekiyama########################################## 5185d9840e25STomoki Sekiyama# lookup Windows platform SDK (if not specified) 5186d9840e25STomoki Sekiyama# The SDK is needed only to build .tlb (type library) file of guest agent 5187d9840e25STomoki Sekiyama# VSS provider from the source. It is usually unnecessary because the 5188d9840e25STomoki Sekiyama# pre-compiled .tlb file is included. 5189d9840e25STomoki Sekiyama 5190e633a5c6SEric Blakeif test "$mingw32" = "yes" && test "$guest_agent" != "no" && \ 5191e633a5c6SEric Blake test "$guest_agent_with_vss" = "yes" ; then 5192d9840e25STomoki Sekiyama if test -z "$win_sdk"; then 5193d9840e25STomoki Sekiyama programfiles="$PROGRAMFILES" 5194d9840e25STomoki Sekiyama test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" 5195d9840e25STomoki Sekiyama if test -n "$programfiles"; then 5196d9840e25STomoki Sekiyama win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null 5197d9840e25STomoki Sekiyama else 5198d9840e25STomoki Sekiyama feature_not_found "Windows SDK" 5199d9840e25STomoki Sekiyama fi 5200d9840e25STomoki Sekiyama elif test "$win_sdk" = "no"; then 5201d9840e25STomoki Sekiyama win_sdk="" 5202d9840e25STomoki Sekiyama fi 5203d9840e25STomoki Sekiyamafi 5204d9840e25STomoki Sekiyama 5205d9840e25STomoki Sekiyama########################################## 520650cbebb9SMichael Roth# check if mingw environment provides a recent ntddscsi.h 5207e633a5c6SEric Blakeif test "$mingw32" = "yes" && test "$guest_agent" != "no"; then 520850cbebb9SMichael Roth cat > $TMPC << EOF 520950cbebb9SMichael Roth#include <windows.h> 521050cbebb9SMichael Roth#include <ntddscsi.h> 521150cbebb9SMichael Rothint main(void) { 521250cbebb9SMichael Roth#if !defined(IOCTL_SCSI_GET_ADDRESS) 521350cbebb9SMichael Roth#error Missing required ioctl definitions 521450cbebb9SMichael Roth#endif 521550cbebb9SMichael Roth SCSI_ADDRESS addr = { .Lun = 0, .TargetId = 0, .PathId = 0 }; 521650cbebb9SMichael Roth return addr.Lun; 521750cbebb9SMichael Roth} 521850cbebb9SMichael RothEOF 521950cbebb9SMichael Roth if compile_prog "" "" ; then 522050cbebb9SMichael Roth guest_agent_ntddscsi=yes 5221996b9cdcSMatt Hines libs_qga="-lsetupapi -lcfgmgr32 $libs_qga" 522250cbebb9SMichael Roth fi 522350cbebb9SMichael Rothfi 522450cbebb9SMichael Roth 522550cbebb9SMichael Roth########################################## 52269d9e1521SGerd Hoffmann# virgl renderer probe 52279d9e1521SGerd Hoffmann 52289d9e1521SGerd Hoffmannif test "$virglrenderer" != "no" ; then 52299d9e1521SGerd Hoffmann cat > $TMPC << EOF 52309d9e1521SGerd Hoffmann#include <virglrenderer.h> 52319d9e1521SGerd Hoffmannint main(void) { virgl_renderer_poll(); return 0; } 52329d9e1521SGerd HoffmannEOF 52339d9e1521SGerd Hoffmann virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null) 52349d9e1521SGerd Hoffmann virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null) 523547479c55SMarc-André Lureau virgl_version=$($pkg_config --modversion virglrenderer 2>/dev/null) 52369d9e1521SGerd Hoffmann if $pkg_config virglrenderer >/dev/null 2>&1 && \ 52379d9e1521SGerd Hoffmann compile_prog "$virgl_cflags" "$virgl_libs" ; then 52389d9e1521SGerd Hoffmann virglrenderer="yes" 52399d9e1521SGerd Hoffmann else 52409d9e1521SGerd Hoffmann if test "$virglrenderer" = "yes" ; then 52419d9e1521SGerd Hoffmann feature_not_found "virglrenderer" 52429d9e1521SGerd Hoffmann fi 52439d9e1521SGerd Hoffmann virglrenderer="no" 52449d9e1521SGerd Hoffmann fi 52459d9e1521SGerd Hoffmannfi 52469d9e1521SGerd Hoffmann 52479d9e1521SGerd Hoffmann########################################## 52488ca80760SRichard Henderson# capstone 52498ca80760SRichard Henderson 5250e219c499SRichard Hendersoncase "$capstone" in 5251e219c499SRichard Henderson "" | yes) 52528ca80760SRichard Henderson if $pkg_config capstone; then 5253e219c499SRichard Henderson capstone=system 5254e633a5c6SEric Blake elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then 5255e219c499SRichard Henderson capstone=git 5256e219c499SRichard Henderson elif test -e "${source_path}/capstone/Makefile" ; then 5257e219c499SRichard Henderson capstone=internal 5258e219c499SRichard Henderson elif test -z "$capstone" ; then 5259e219c499SRichard Henderson capstone=no 5260e219c499SRichard Henderson else 5261e219c499SRichard Henderson feature_not_found "capstone" "Install capstone devel or git submodule" 5262e219c499SRichard Henderson fi 5263e219c499SRichard Henderson ;; 5264e219c499SRichard Henderson 5265e219c499SRichard Henderson system) 5266e219c499SRichard Henderson if ! $pkg_config capstone; then 5267e219c499SRichard Henderson feature_not_found "capstone" "Install capstone devel" 5268e219c499SRichard Henderson fi 5269e219c499SRichard Henderson ;; 5270e219c499SRichard Hendersonesac 5271e219c499SRichard Henderson 5272e219c499SRichard Hendersoncase "$capstone" in 5273e219c499SRichard Henderson git | internal) 5274e219c499SRichard Henderson if test "$capstone" = git; then 5275e219c499SRichard Henderson git_submodules="${git_submodules} capstone" 5276e219c499SRichard Henderson fi 5277e219c499SRichard Henderson mkdir -p capstone 5278e219c499SRichard Henderson QEMU_CFLAGS="$QEMU_CFLAGS -I\$(SRC_PATH)/capstone/include" 5279e219c499SRichard Henderson if test "$mingw32" = "yes"; then 5280e219c499SRichard Henderson LIBCAPSTONE=capstone.lib 5281e219c499SRichard Henderson else 5282e219c499SRichard Henderson LIBCAPSTONE=libcapstone.a 5283e219c499SRichard Henderson fi 528402f9135bSDaniel P. Berrangé libs_cpu="-L\$(BUILD_DIR)/capstone -lcapstone $libs_cpu" 5285e219c499SRichard Henderson ;; 5286e219c499SRichard Henderson 5287e219c499SRichard Henderson system) 52888ca80760SRichard Henderson QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags capstone)" 528902f9135bSDaniel P. Berrangé libs_cpu="$($pkg_config --libs capstone) $libs_cpu" 5290e219c499SRichard Henderson ;; 5291e219c499SRichard Henderson 5292e219c499SRichard Henderson no) 5293e219c499SRichard Henderson ;; 5294e219c499SRichard Henderson *) 5295e219c499SRichard Henderson error_exit "Unknown state for capstone: $capstone" 5296e219c499SRichard Henderson ;; 5297e219c499SRichard Hendersonesac 52988ca80760SRichard Henderson 52998ca80760SRichard Henderson########################################## 53005f6b9e8fSBlue Swirl# check if we have fdatasync 53015f6b9e8fSBlue Swirl 53025f6b9e8fSBlue Swirlfdatasync=no 53035f6b9e8fSBlue Swirlcat > $TMPC << EOF 53045f6b9e8fSBlue Swirl#include <unistd.h> 5305d1722a27SAlexandre Raymondint main(void) { 5306d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 5307d1722a27SAlexandre Raymondreturn fdatasync(0); 5308d1722a27SAlexandre Raymond#else 5309e172fe11SStefan Weil#error Not supported 5310d1722a27SAlexandre Raymond#endif 5311d1722a27SAlexandre Raymond} 53125f6b9e8fSBlue SwirlEOF 53135f6b9e8fSBlue Swirlif compile_prog "" "" ; then 53145f6b9e8fSBlue Swirl fdatasync=yes 53155f6b9e8fSBlue Swirlfi 53165f6b9e8fSBlue Swirl 531794a420b1SStefan Hajnoczi########################################## 5318e78815a5SAndreas Färber# check if we have madvise 5319e78815a5SAndreas Färber 5320e78815a5SAndreas Färbermadvise=no 5321e78815a5SAndreas Färbercat > $TMPC << EOF 5322e78815a5SAndreas Färber#include <sys/types.h> 5323e78815a5SAndreas Färber#include <sys/mman.h> 5324832ce9c2SScott Wood#include <stddef.h> 5325e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 5326e78815a5SAndreas FärberEOF 5327e78815a5SAndreas Färberif compile_prog "" "" ; then 5328e78815a5SAndreas Färber madvise=yes 5329e78815a5SAndreas Färberfi 5330e78815a5SAndreas Färber 5331e78815a5SAndreas Färber########################################## 5332e78815a5SAndreas Färber# check if we have posix_madvise 5333e78815a5SAndreas Färber 5334e78815a5SAndreas Färberposix_madvise=no 5335e78815a5SAndreas Färbercat > $TMPC << EOF 5336e78815a5SAndreas Färber#include <sys/mman.h> 5337832ce9c2SScott Wood#include <stddef.h> 5338e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 5339e78815a5SAndreas FärberEOF 5340e78815a5SAndreas Färberif compile_prog "" "" ; then 5341e78815a5SAndreas Färber posix_madvise=yes 5342e78815a5SAndreas Färberfi 5343e78815a5SAndreas Färber 5344e78815a5SAndreas Färber########################################## 53459bc5a719SAndreas Gustafsson# check if we have posix_memalign() 53469bc5a719SAndreas Gustafsson 53479bc5a719SAndreas Gustafssonposix_memalign=no 53489bc5a719SAndreas Gustafssoncat > $TMPC << EOF 53499bc5a719SAndreas Gustafsson#include <stdlib.h> 53509bc5a719SAndreas Gustafssonint main(void) { 53519bc5a719SAndreas Gustafsson void *p; 53529bc5a719SAndreas Gustafsson return posix_memalign(&p, 8, 8); 53539bc5a719SAndreas Gustafsson} 53549bc5a719SAndreas GustafssonEOF 53559bc5a719SAndreas Gustafssonif compile_prog "" "" ; then 53569bc5a719SAndreas Gustafsson posix_memalign=yes 53579bc5a719SAndreas Gustafssonfi 53589bc5a719SAndreas Gustafsson 53599bc5a719SAndreas Gustafsson########################################## 53600a852417SPaul Durrant# check if we have posix_syslog 53610a852417SPaul Durrant 53620a852417SPaul Durrantposix_syslog=no 53630a852417SPaul Durrantcat > $TMPC << EOF 53640a852417SPaul Durrant#include <syslog.h> 53650a852417SPaul Durrantint main(void) { openlog("qemu", LOG_PID, LOG_DAEMON); syslog(LOG_INFO, "configure"); return 0; } 53660a852417SPaul DurrantEOF 53670a852417SPaul Durrantif compile_prog "" "" ; then 53680a852417SPaul Durrant posix_syslog=yes 53690a852417SPaul Durrantfi 53700a852417SPaul Durrant 53710a852417SPaul Durrant########################################## 5372401bc051SPeter Maydell# check if we have sem_timedwait 5373401bc051SPeter Maydell 5374401bc051SPeter Maydellsem_timedwait=no 5375401bc051SPeter Maydellcat > $TMPC << EOF 5376401bc051SPeter Maydell#include <semaphore.h> 5377811294b7SDaniel P. Berrangéint main(void) { sem_t s; struct timespec t = {0}; return sem_timedwait(&s, &t); } 5378401bc051SPeter MaydellEOF 5379401bc051SPeter Maydellif compile_prog "" "" ; then 5380401bc051SPeter Maydell sem_timedwait=yes 5381401bc051SPeter Maydellfi 5382401bc051SPeter Maydell 5383401bc051SPeter Maydell########################################## 53845c99fa37SKeno Fischer# check if we have strchrnul 53855c99fa37SKeno Fischer 53865c99fa37SKeno Fischerstrchrnul=no 53875c99fa37SKeno Fischercat > $TMPC << EOF 53885c99fa37SKeno Fischer#include <string.h> 53895c99fa37SKeno Fischerint main(void); 53905c99fa37SKeno Fischer// Use a haystack that the compiler shouldn't be able to constant fold 53915c99fa37SKeno Fischerchar *haystack = (char*)&main; 53925c99fa37SKeno Fischerint main(void) { return strchrnul(haystack, 'x') != &haystack[6]; } 53935c99fa37SKeno FischerEOF 53945c99fa37SKeno Fischerif compile_prog "" "" ; then 53955c99fa37SKeno Fischer strchrnul=yes 53965c99fa37SKeno Fischerfi 53975c99fa37SKeno Fischer 53988a792b03SJiufei Xue######################################### 53998a792b03SJiufei Xue# check if we have st_atim 54008a792b03SJiufei Xue 54018a792b03SJiufei Xuest_atim=no 54028a792b03SJiufei Xuecat > $TMPC << EOF 54038a792b03SJiufei Xue#include <sys/stat.h> 54048a792b03SJiufei Xue#include <stddef.h> 54058a792b03SJiufei Xueint main(void) { return offsetof(struct stat, st_atim); } 54068a792b03SJiufei XueEOF 54078a792b03SJiufei Xueif compile_prog "" "" ; then 54088a792b03SJiufei Xue st_atim=yes 54098a792b03SJiufei Xuefi 54108a792b03SJiufei Xue 54115c99fa37SKeno Fischer########################################## 541294a420b1SStefan Hajnoczi# check if trace backend exists 541394a420b1SStefan Hajnoczi 54145b808275SLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backends=$trace_backends" --check-backends > /dev/null 2> /dev/null 541594a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 54165b808275SLluís Vilanova error_exit "invalid trace backends" \ 54175b808275SLluís Vilanova "Please choose supported trace backends." 541894a420b1SStefan Hajnoczifi 541994a420b1SStefan Hajnoczi 54207e24e92aSStefan Hajnoczi########################################## 54217e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 54225b808275SLluís Vilanovaif have_backend "ust"; then 54237e24e92aSStefan Hajnoczi cat > $TMPC << EOF 5424bf15f63cSMohamad Gebai#include <lttng/tracepoint.h> 54257e24e92aSStefan Hajnocziint main(void) { return 0; } 54267e24e92aSStefan HajnocziEOF 5427c79ed23dSFrancis Deslauriers if compile_prog "" "-Wl,--no-as-needed -ldl" ; then 5428bf15f63cSMohamad Gebai if $pkg_config lttng-ust --exists; then 542989138857SStefan Weil lttng_ust_libs=$($pkg_config --libs lttng-ust) 54307e24e92aSStefan Hajnoczi else 5431c79ed23dSFrancis Deslauriers lttng_ust_libs="-llttng-ust -ldl" 5432bf15f63cSMohamad Gebai fi 5433bf15f63cSMohamad Gebai if $pkg_config liburcu-bp --exists; then 543489138857SStefan Weil urcu_bp_libs=$($pkg_config --libs liburcu-bp) 5435bf15f63cSMohamad Gebai else 5436bf15f63cSMohamad Gebai urcu_bp_libs="-lurcu-bp" 5437bf15f63cSMohamad Gebai fi 5438bf15f63cSMohamad Gebai 5439bf15f63cSMohamad Gebai LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" 5440bf15f63cSMohamad Gebai libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga" 5441bf15f63cSMohamad Gebai else 5442bf15f63cSMohamad Gebai error_exit "Trace backend 'ust' missing lttng-ust header files" 54437e24e92aSStefan Hajnoczi fi 54447e24e92aSStefan Hajnoczifi 5445b3d08c02SDaniel P. Berrange 5446b3d08c02SDaniel P. Berrange########################################## 5447b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 54485b808275SLluís Vilanovaif have_backend "dtrace"; then 5449b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 545076ad07a4SPeter Maydell error_exit "dtrace command is not found in PATH $PATH" 5451b3d08c02SDaniel P. Berrange fi 5452c276b17dSDaniel P. Berrange trace_backend_stap="no" 5453c276b17dSDaniel P. Berrange if has 'stap' ; then 5454c276b17dSDaniel P. Berrange trace_backend_stap="yes" 5455c276b17dSDaniel P. Berrange fi 5456b3d08c02SDaniel P. Berrangefi 5457b3d08c02SDaniel P. Berrange 54587e24e92aSStefan Hajnoczi########################################## 5459519175a2SAlex Barcelo# check and set a backend for coroutine 5460d0e2fce5SAneesh Kumar K.V 54617c2acc70SPeter Maydell# We prefer ucontext, but it's not always possible. The fallback 546233c53c54SDaniel P. Berrange# is sigcontext. On Windows the only valid backend is the Windows 546333c53c54SDaniel P. Berrange# specific one. 54647c2acc70SPeter Maydell 54657c2acc70SPeter Maydellucontext_works=no 5466d0e2fce5SAneesh Kumar K.Vif test "$darwin" != "yes"; then 5467d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 5468d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 5469cdf84806SPeter Maydell#ifdef __stub_makecontext 5470cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 5471cdf84806SPeter Maydell#endif 547275cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 5473d0e2fce5SAneesh Kumar K.VEOF 5474d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 54757c2acc70SPeter Maydell ucontext_works=yes 5476d0e2fce5SAneesh Kumar K.V fi 5477519175a2SAlex Barcelofi 54787c2acc70SPeter Maydell 54797c2acc70SPeter Maydellif test "$coroutine" = ""; then 54807c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 54817c2acc70SPeter Maydell coroutine=win32 54827c2acc70SPeter Maydell elif test "$ucontext_works" = "yes"; then 54837c2acc70SPeter Maydell coroutine=ucontext 5484519175a2SAlex Barcelo else 54857c2acc70SPeter Maydell coroutine=sigaltstack 54867c2acc70SPeter Maydell fi 54877c2acc70SPeter Maydellelse 54887c2acc70SPeter Maydell case $coroutine in 54897c2acc70SPeter Maydell windows) 54907c2acc70SPeter Maydell if test "$mingw32" != "yes"; then 54917c2acc70SPeter Maydell error_exit "'windows' coroutine backend only valid for Windows" 54927c2acc70SPeter Maydell fi 54937c2acc70SPeter Maydell # Unfortunately the user visible backend name doesn't match the 54947c2acc70SPeter Maydell # coroutine-*.c filename for this case, so we have to adjust it here. 54957c2acc70SPeter Maydell coroutine=win32 54967c2acc70SPeter Maydell ;; 54977c2acc70SPeter Maydell ucontext) 54987c2acc70SPeter Maydell if test "$ucontext_works" != "yes"; then 54997c2acc70SPeter Maydell feature_not_found "ucontext" 55007c2acc70SPeter Maydell fi 55017c2acc70SPeter Maydell ;; 550233c53c54SDaniel P. Berrange sigaltstack) 55037c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 55047c2acc70SPeter Maydell error_exit "only the 'windows' coroutine backend is valid for Windows" 55057c2acc70SPeter Maydell fi 55067c2acc70SPeter Maydell ;; 55077c2acc70SPeter Maydell *) 550876ad07a4SPeter Maydell error_exit "unknown coroutine backend $coroutine" 55097c2acc70SPeter Maydell ;; 55107c2acc70SPeter Maydell esac 5511d0e2fce5SAneesh Kumar K.Vfi 5512d0e2fce5SAneesh Kumar K.V 551370c60c08SStefan Hajnocziif test "$coroutine_pool" = ""; then 551470c60c08SStefan Hajnoczi coroutine_pool=yes 551570c60c08SStefan Hajnoczifi 551670c60c08SStefan Hajnoczi 55177d992e4dSPeter Lievenif test "$debug_stack_usage" = "yes"; then 55187d992e4dSPeter Lieven if test "$coroutine_pool" = "yes"; then 55197d992e4dSPeter Lieven echo "WARN: disabling coroutine pool for stack usage debugging" 55207d992e4dSPeter Lieven coroutine_pool=no 55217d992e4dSPeter Lieven fi 55227d992e4dSPeter Lievenfi 55237d992e4dSPeter Lieven 55247d992e4dSPeter Lieven 5525d0e2fce5SAneesh Kumar K.V########################################## 5526d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 5527d2042378SAneesh Kumar K.V 55284e1797f9SStefan Weilopen_by_handle_at=no 5529d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 5530d2042378SAneesh Kumar K.V#include <fcntl.h> 5531acc55ba8SStefan Weil#if !defined(AT_EMPTY_PATH) 5532acc55ba8SStefan Weil# error missing definition 5533acc55ba8SStefan Weil#else 553475cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 5535acc55ba8SStefan Weil#endif 5536d2042378SAneesh Kumar K.VEOF 5537d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 5538d2042378SAneesh Kumar K.V open_by_handle_at=yes 5539d2042378SAneesh Kumar K.Vfi 5540d2042378SAneesh Kumar K.V 5541e06a765eSHarsh Prateek Bora######################################## 5542e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 5543e06a765eSHarsh Prateek Bora 5544e06a765eSHarsh Prateek Boralinux_magic_h=no 5545e06a765eSHarsh Prateek Boracat > $TMPC << EOF 5546e06a765eSHarsh Prateek Bora#include <linux/magic.h> 5547e06a765eSHarsh Prateek Boraint main(void) { 554875cafad7SStefan Weil return 0; 5549e06a765eSHarsh Prateek Bora} 5550e06a765eSHarsh Prateek BoraEOF 5551e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 5552e06a765eSHarsh Prateek Bora linux_magic_h=yes 5553e06a765eSHarsh Prateek Borafi 5554e06a765eSHarsh Prateek Bora 55558ab1bf12SLuiz Capitulino######################################## 5556c95e3080SKevin Wolf# check whether we can disable warning option with a pragma (this is needed 5557c95e3080SKevin Wolf# to silence warnings in the headers of some versions of external libraries). 5558c95e3080SKevin Wolf# This test has to be compiled with -Werror as otherwise an unknown pragma is 5559c95e3080SKevin Wolf# only a warning. 5560c95e3080SKevin Wolf# 5561c95e3080SKevin Wolf# If we can't selectively disable warning in the code, disable -Werror so that 5562c95e3080SKevin Wolf# the build doesn't fail anyway. 5563c95e3080SKevin Wolf 556406d71fa1SPeter Maydellpragma_disable_unused_but_set=no 556506d71fa1SPeter Maydellcat > $TMPC << EOF 5566e6f53fd5SMarkus Armbruster#pragma GCC diagnostic push 5567c95e3080SKevin Wolf#pragma GCC diagnostic ignored "-Wstrict-prototypes" 5568e6f53fd5SMarkus Armbruster#pragma GCC diagnostic pop 5569c95e3080SKevin Wolf 557006d71fa1SPeter Maydellint main(void) { 557106d71fa1SPeter Maydell return 0; 557206d71fa1SPeter Maydell} 557306d71fa1SPeter MaydellEOF 557406d71fa1SPeter Maydellif compile_prog "-Werror" "" ; then 5575cc6e3ca9SGerd Hoffmann pragma_diagnostic_available=yes 5576c95e3080SKevin Wolfelse 5577c95e3080SKevin Wolf werror=no 557806d71fa1SPeter Maydellfi 557906d71fa1SPeter Maydell 558006d71fa1SPeter Maydell######################################## 5581541be927SChristian Borntraeger# check if we have valgrind/valgrind.h 55823f4349dcSKevin Wolf 55833f4349dcSKevin Wolfvalgrind_h=no 55843f4349dcSKevin Wolfcat > $TMPC << EOF 55853f4349dcSKevin Wolf#include <valgrind/valgrind.h> 55863f4349dcSKevin Wolfint main(void) { 55873f4349dcSKevin Wolf return 0; 55883f4349dcSKevin Wolf} 55893f4349dcSKevin WolfEOF 55903f4349dcSKevin Wolfif compile_prog "" "" ; then 55913f4349dcSKevin Wolf valgrind_h=yes 55923f4349dcSKevin Wolffi 55933f4349dcSKevin Wolf 55943f4349dcSKevin Wolf######################################## 55958ab1bf12SLuiz Capitulino# check if environ is declared 55968ab1bf12SLuiz Capitulino 55978ab1bf12SLuiz Capitulinohas_environ=no 55988ab1bf12SLuiz Capitulinocat > $TMPC << EOF 55998ab1bf12SLuiz Capitulino#include <unistd.h> 56008ab1bf12SLuiz Capitulinoint main(void) { 5601c075a723SBlue Swirl environ = 0; 56028ab1bf12SLuiz Capitulino return 0; 56038ab1bf12SLuiz Capitulino} 56048ab1bf12SLuiz CapitulinoEOF 56058ab1bf12SLuiz Capitulinoif compile_prog "" "" ; then 56068ab1bf12SLuiz Capitulino has_environ=yes 56078ab1bf12SLuiz Capitulinofi 56088ab1bf12SLuiz Capitulino 560976a347e1SRichard Henderson######################################## 561076a347e1SRichard Henderson# check if cpuid.h is usable. 561176a347e1SRichard Henderson 561276a347e1SRichard Hendersoncat > $TMPC << EOF 561376a347e1SRichard Henderson#include <cpuid.h> 561476a347e1SRichard Hendersonint main(void) { 5615774d566cSPeter Maydell unsigned a, b, c, d; 5616774d566cSPeter Maydell int max = __get_cpuid_max(0, 0); 5617774d566cSPeter Maydell 5618774d566cSPeter Maydell if (max >= 1) { 5619774d566cSPeter Maydell __cpuid(1, a, b, c, d); 5620774d566cSPeter Maydell } 5621774d566cSPeter Maydell 5622774d566cSPeter Maydell if (max >= 7) { 5623774d566cSPeter Maydell __cpuid_count(7, 0, a, b, c, d); 5624774d566cSPeter Maydell } 5625774d566cSPeter Maydell 562676a347e1SRichard Henderson return 0; 562776a347e1SRichard Henderson} 562876a347e1SRichard HendersonEOF 562976a347e1SRichard Hendersonif compile_prog "" "" ; then 563076a347e1SRichard Henderson cpuid_h=yes 563176a347e1SRichard Hendersonfi 563276a347e1SRichard Henderson 56335dd89908SRichard Henderson########################################## 56345dd89908SRichard Henderson# avx2 optimization requirement check 56355dd89908SRichard Henderson# 56365dd89908SRichard Henderson# There is no point enabling this if cpuid.h is not usable, 56375dd89908SRichard Henderson# since we won't be able to select the new routines. 56385dd89908SRichard Henderson 5639e633a5c6SEric Blakeif test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then 56405dd89908SRichard Henderson cat > $TMPC << EOF 56415dd89908SRichard Henderson#pragma GCC push_options 56425dd89908SRichard Henderson#pragma GCC target("avx2") 56435dd89908SRichard Henderson#include <cpuid.h> 56445dd89908SRichard Henderson#include <immintrin.h> 56455dd89908SRichard Hendersonstatic int bar(void *a) { 56465dd89908SRichard Henderson __m256i x = *(__m256i *)a; 56475dd89908SRichard Henderson return _mm256_testz_si256(x, x); 56485dd89908SRichard Henderson} 56495dd89908SRichard Hendersonint main(int argc, char *argv[]) { return bar(argv[0]); } 56505dd89908SRichard HendersonEOF 56515dd89908SRichard Henderson if compile_object "" ; then 56525dd89908SRichard Henderson avx2_opt="yes" 565386583a07SLiam Merwick else 565486583a07SLiam Merwick avx2_opt="no" 56555dd89908SRichard Henderson fi 56565dd89908SRichard Hendersonfi 56575dd89908SRichard Henderson 56586b8cd447SRobert Hoo########################################## 56596b8cd447SRobert Hoo# avx512f optimization requirement check 56606b8cd447SRobert Hoo# 56616b8cd447SRobert Hoo# There is no point enabling this if cpuid.h is not usable, 56626b8cd447SRobert Hoo# since we won't be able to select the new routines. 56636b8cd447SRobert Hoo# by default, it is turned off. 56646b8cd447SRobert Hoo# if user explicitly want to enable it, check environment 56656b8cd447SRobert Hoo 56666b8cd447SRobert Hooif test "$cpuid_h" = "yes" && test "$avx512f_opt" = "yes"; then 56676b8cd447SRobert Hoo cat > $TMPC << EOF 56686b8cd447SRobert Hoo#pragma GCC push_options 56696b8cd447SRobert Hoo#pragma GCC target("avx512f") 56706b8cd447SRobert Hoo#include <cpuid.h> 56716b8cd447SRobert Hoo#include <immintrin.h> 56726b8cd447SRobert Hoostatic int bar(void *a) { 56736b8cd447SRobert Hoo __m512i x = *(__m512i *)a; 56746b8cd447SRobert Hoo return _mm512_test_epi64_mask(x, x); 56756b8cd447SRobert Hoo} 56766b8cd447SRobert Hooint main(int argc, char *argv[]) 56776b8cd447SRobert Hoo{ 56786b8cd447SRobert Hoo return bar(argv[0]); 56796b8cd447SRobert Hoo} 56806b8cd447SRobert HooEOF 56816b8cd447SRobert Hoo if ! compile_object "" ; then 56826b8cd447SRobert Hoo avx512f_opt="no" 56836b8cd447SRobert Hoo fi 56846b8cd447SRobert Hooelse 56856b8cd447SRobert Hoo avx512f_opt="no" 56866b8cd447SRobert Hoofi 56876b8cd447SRobert Hoo 5688f540166bSRichard Henderson######################################## 5689f540166bSRichard Henderson# check if __[u]int128_t is usable. 5690f540166bSRichard Henderson 5691f540166bSRichard Hendersonint128=no 5692f540166bSRichard Hendersoncat > $TMPC << EOF 5693f540166bSRichard Henderson__int128_t a; 5694f540166bSRichard Henderson__uint128_t b; 5695f540166bSRichard Hendersonint main (void) { 5696f540166bSRichard Henderson a = a + b; 5697f540166bSRichard Henderson b = a * b; 5698464e3671SPeter Maydell a = a * a; 5699f540166bSRichard Henderson return 0; 5700f540166bSRichard Henderson} 5701f540166bSRichard HendersonEOF 5702f540166bSRichard Hendersonif compile_prog "" "" ; then 5703f540166bSRichard Henderson int128=yes 5704f540166bSRichard Hendersonfi 570576a347e1SRichard Henderson 57067ebee43eSRichard Henderson######################################### 57077ebee43eSRichard Henderson# See if 128-bit atomic operations are supported. 57087ebee43eSRichard Henderson 57097ebee43eSRichard Hendersonatomic128=no 57107ebee43eSRichard Hendersonif test "$int128" = "yes"; then 57117ebee43eSRichard Henderson cat > $TMPC << EOF 57127ebee43eSRichard Hendersonint main(void) 57137ebee43eSRichard Henderson{ 57147ebee43eSRichard Henderson unsigned __int128 x = 0, y = 0; 57157ebee43eSRichard Henderson y = __atomic_load_16(&x, 0); 57167ebee43eSRichard Henderson __atomic_store_16(&x, y, 0); 57177ebee43eSRichard Henderson __atomic_compare_exchange_16(&x, &y, x, 0, 0, 0); 57187ebee43eSRichard Henderson return 0; 57197ebee43eSRichard Henderson} 57207ebee43eSRichard HendersonEOF 57217ebee43eSRichard Henderson if compile_prog "" "" ; then 57227ebee43eSRichard Henderson atomic128=yes 57237ebee43eSRichard Henderson fi 57247ebee43eSRichard Hendersonfi 57257ebee43eSRichard Henderson 5726e6cd4bb5SRichard Hendersoncmpxchg128=no 5727e633a5c6SEric Blakeif test "$int128" = yes && test "$atomic128" = no; then 5728e6cd4bb5SRichard Henderson cat > $TMPC << EOF 5729e6cd4bb5SRichard Hendersonint main(void) 5730e6cd4bb5SRichard Henderson{ 5731e6cd4bb5SRichard Henderson unsigned __int128 x = 0, y = 0; 5732e6cd4bb5SRichard Henderson __sync_val_compare_and_swap_16(&x, y, x); 5733e6cd4bb5SRichard Henderson return 0; 5734e6cd4bb5SRichard Henderson} 5735e6cd4bb5SRichard HendersonEOF 5736e6cd4bb5SRichard Henderson if compile_prog "" "" ; then 5737e6cd4bb5SRichard Henderson cmpxchg128=yes 5738e6cd4bb5SRichard Henderson fi 5739e6cd4bb5SRichard Hendersonfi 5740e6cd4bb5SRichard Henderson 5741df79b996SRichard Henderson######################################### 5742df79b996SRichard Henderson# See if 64-bit atomic operations are supported. 5743df79b996SRichard Henderson# Note that without __atomic builtins, we can only 5744df79b996SRichard Henderson# assume atomic loads/stores max at pointer size. 5745df79b996SRichard Henderson 5746df79b996SRichard Hendersoncat > $TMPC << EOF 5747df79b996SRichard Henderson#include <stdint.h> 5748df79b996SRichard Hendersonint main(void) 5749df79b996SRichard Henderson{ 5750df79b996SRichard Henderson uint64_t x = 0, y = 0; 5751df79b996SRichard Henderson#ifdef __ATOMIC_RELAXED 5752df79b996SRichard Henderson y = __atomic_load_8(&x, 0); 5753df79b996SRichard Henderson __atomic_store_8(&x, y, 0); 5754df79b996SRichard Henderson __atomic_compare_exchange_8(&x, &y, x, 0, 0, 0); 5755df79b996SRichard Henderson __atomic_exchange_8(&x, y, 0); 5756df79b996SRichard Henderson __atomic_fetch_add_8(&x, y, 0); 5757df79b996SRichard Henderson#else 5758df79b996SRichard Henderson typedef char is_host64[sizeof(void *) >= sizeof(uint64_t) ? 1 : -1]; 5759df79b996SRichard Henderson __sync_lock_test_and_set(&x, y); 5760df79b996SRichard Henderson __sync_val_compare_and_swap(&x, y, 0); 5761df79b996SRichard Henderson __sync_fetch_and_add(&x, y); 5762df79b996SRichard Henderson#endif 5763df79b996SRichard Henderson return 0; 5764df79b996SRichard Henderson} 5765df79b996SRichard HendersonEOF 5766df79b996SRichard Hendersonif compile_prog "" "" ; then 5767df79b996SRichard Henderson atomic64=yes 5768df79b996SRichard Hendersonfi 5769df79b996SRichard Henderson 577026fffe29SEmilio G. Cota######################################### 577126fffe29SEmilio G. Cota# See if --dynamic-list is supported by the linker 577226fffe29SEmilio G. Cotald_dynamic_list="no" 577326fffe29SEmilio G. Cotaif test "$static" = "no" ; then 577426fffe29SEmilio G. Cota cat > $TMPTXT <<EOF 577526fffe29SEmilio G. Cota{ 577626fffe29SEmilio G. Cota foo; 577726fffe29SEmilio G. Cota}; 577826fffe29SEmilio G. CotaEOF 577926fffe29SEmilio G. Cota 578026fffe29SEmilio G. Cota cat > $TMPC <<EOF 578126fffe29SEmilio G. Cota#include <stdio.h> 578226fffe29SEmilio G. Cotavoid foo(void); 578326fffe29SEmilio G. Cota 578426fffe29SEmilio G. Cotavoid foo(void) 578526fffe29SEmilio G. Cota{ 578626fffe29SEmilio G. Cota printf("foo\n"); 578726fffe29SEmilio G. Cota} 578826fffe29SEmilio G. Cota 578926fffe29SEmilio G. Cotaint main(void) 579026fffe29SEmilio G. Cota{ 579126fffe29SEmilio G. Cota foo(); 579226fffe29SEmilio G. Cota return 0; 579326fffe29SEmilio G. Cota} 579426fffe29SEmilio G. CotaEOF 579526fffe29SEmilio G. Cota 579626fffe29SEmilio G. Cota if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then 579726fffe29SEmilio G. Cota ld_dynamic_list="yes" 579826fffe29SEmilio G. Cota fi 579926fffe29SEmilio G. Cotafi 580026fffe29SEmilio G. Cota 580126fffe29SEmilio G. Cota######################################### 580226fffe29SEmilio G. Cota# See if -exported_symbols_list is supported by the linker 580326fffe29SEmilio G. Cota 580426fffe29SEmilio G. Cotald_exported_symbols_list="no" 580526fffe29SEmilio G. Cotaif test "$static" = "no" ; then 580626fffe29SEmilio G. Cota cat > $TMPTXT <<EOF 580726fffe29SEmilio G. Cota _foo 580826fffe29SEmilio G. CotaEOF 580926fffe29SEmilio G. Cota 581026fffe29SEmilio G. Cota if compile_prog "" "-Wl,-exported_symbols_list,$TMPTXT" ; then 581126fffe29SEmilio G. Cota ld_exported_symbols_list="yes" 581226fffe29SEmilio G. Cota fi 581326fffe29SEmilio G. Cotafi 581426fffe29SEmilio G. Cota 581526fffe29SEmilio G. Cotaif test "$plugins" = "yes" && 581626fffe29SEmilio G. Cota test "$ld_dynamic_list" = "no" && 581726fffe29SEmilio G. Cota test "$ld_exported_symbols_list" = "no" ; then 581826fffe29SEmilio G. Cota error_exit \ 581926fffe29SEmilio G. Cota "Plugin support requires dynamic linking and specifying a set of symbols " \ 582026fffe29SEmilio G. Cota "that are exported to plugins. Unfortunately your linker doesn't " \ 582126fffe29SEmilio G. Cota "support the flag (--dynamic-list or -exported_symbols_list) used " \ 582226fffe29SEmilio G. Cota "for this purpose. You can't build with --static." 582326fffe29SEmilio G. Cotafi 582426fffe29SEmilio G. Cota 58251e6e9acaSRichard Henderson######################################## 5826db8aaae8SRichard Henderson# See if __attribute__((alias)) is supported. 5827db8aaae8SRichard Henderson# This false for Xcode 9, but has been remedied for Xcode 10. 5828db8aaae8SRichard Henderson# Unfortunately, travis uses Xcode 9 by default. 5829db8aaae8SRichard Henderson 5830db8aaae8SRichard Hendersonattralias=no 5831db8aaae8SRichard Hendersoncat > $TMPC << EOF 5832db8aaae8SRichard Hendersonint x = 1; 5833db8aaae8SRichard Hendersonextern const int y __attribute__((alias("x"))); 5834db8aaae8SRichard Hendersonint main(void) { return 0; } 5835db8aaae8SRichard HendersonEOF 5836db8aaae8SRichard Hendersonif compile_prog "" "" ; then 5837db8aaae8SRichard Henderson attralias=yes 5838db8aaae8SRichard Hendersonfi 5839db8aaae8SRichard Henderson 5840db8aaae8SRichard Henderson######################################## 58411e6e9acaSRichard Henderson# check if getauxval is available. 58421e6e9acaSRichard Henderson 58431e6e9acaSRichard Hendersongetauxval=no 58441e6e9acaSRichard Hendersoncat > $TMPC << EOF 58451e6e9acaSRichard Henderson#include <sys/auxv.h> 58461e6e9acaSRichard Hendersonint main(void) { 58471e6e9acaSRichard Henderson return getauxval(AT_HWCAP) == 0; 58481e6e9acaSRichard Henderson} 58491e6e9acaSRichard HendersonEOF 58501e6e9acaSRichard Hendersonif compile_prog "" "" ; then 58511e6e9acaSRichard Henderson getauxval=yes 58521e6e9acaSRichard Hendersonfi 58531e6e9acaSRichard Henderson 5854fd0e6053SJohn Snow######################################## 5855fd0e6053SJohn Snow# check if ccache is interfering with 5856fd0e6053SJohn Snow# semantic analysis of macros 5857fd0e6053SJohn Snow 58585e4dfd3dSJohn Snowunset CCACHE_CPP2 5859fd0e6053SJohn Snowccache_cpp2=no 5860fd0e6053SJohn Snowcat > $TMPC << EOF 5861fd0e6053SJohn Snowstatic const int Z = 1; 5862fd0e6053SJohn Snow#define fn() ({ Z; }) 5863fd0e6053SJohn Snow#define TAUT(X) ((X) == Z) 5864fd0e6053SJohn Snow#define PAREN(X, Y) (X == Y) 5865fd0e6053SJohn Snow#define ID(X) (X) 5866fd0e6053SJohn Snowint main(int argc, char *argv[]) 5867fd0e6053SJohn Snow{ 5868fd0e6053SJohn Snow int x = 0, y = 0; 5869fd0e6053SJohn Snow x = ID(x); 5870fd0e6053SJohn Snow x = fn(); 5871fd0e6053SJohn Snow fn(); 5872fd0e6053SJohn Snow if (PAREN(x, y)) return 0; 5873fd0e6053SJohn Snow if (TAUT(Z)) return 0; 5874fd0e6053SJohn Snow return 0; 5875fd0e6053SJohn Snow} 5876fd0e6053SJohn SnowEOF 5877fd0e6053SJohn Snow 5878fd0e6053SJohn Snowif ! compile_object "-Werror"; then 5879fd0e6053SJohn Snow ccache_cpp2=yes 5880fd0e6053SJohn Snowfi 5881fd0e6053SJohn Snow 5882b553a042SJohn Snow################################################# 5883b553a042SJohn Snow# clang does not support glibc + FORTIFY_SOURCE. 5884b553a042SJohn Snow 5885b553a042SJohn Snowif test "$fortify_source" != "no"; then 5886b553a042SJohn Snow if echo | $cc -dM -E - | grep __clang__ > /dev/null 2>&1 ; then 5887b553a042SJohn Snow fortify_source="no"; 5888e189091fSPeter Maydell elif test -n "$cxx" && has $cxx && 5889cfcc7c14SJohn Snow echo | $cxx -dM -E - | grep __clang__ >/dev/null 2>&1 ; then 5890b553a042SJohn Snow fortify_source="no"; 5891b553a042SJohn Snow else 5892b553a042SJohn Snow fortify_source="yes" 5893b553a042SJohn Snow fi 5894b553a042SJohn Snowfi 5895b553a042SJohn Snow 58961efad060SFam Zheng############################################### 58971efad060SFam Zheng# Check if copy_file_range is provided by glibc 58981efad060SFam Zhenghave_copy_file_range=no 58991efad060SFam Zhengcat > $TMPC << EOF 59001efad060SFam Zheng#include <unistd.h> 59011efad060SFam Zhengint main(void) { 59021efad060SFam Zheng copy_file_range(0, NULL, 0, NULL, 0, 0); 59031efad060SFam Zheng return 0; 59041efad060SFam Zheng} 59051efad060SFam ZhengEOF 59061efad060SFam Zhengif compile_prog "" "" ; then 59071efad060SFam Zheng have_copy_file_range=yes 59081efad060SFam Zhengfi 59091efad060SFam Zheng 5910d2042378SAneesh Kumar K.V########################################## 5911277abf15SJan Vesely# check if struct fsxattr is available via linux/fs.h 5912277abf15SJan Vesely 5913277abf15SJan Veselyhave_fsxattr=no 5914277abf15SJan Veselycat > $TMPC << EOF 5915277abf15SJan Vesely#include <linux/fs.h> 5916277abf15SJan Veselystruct fsxattr foo; 5917277abf15SJan Veselyint main(void) { 5918277abf15SJan Vesely return 0; 5919277abf15SJan Vesely} 5920277abf15SJan VeselyEOF 5921277abf15SJan Veselyif compile_prog "" "" ; then 5922277abf15SJan Vesely have_fsxattr=yes 5923277abf15SJan Veselyfi 5924277abf15SJan Vesely 5925b66e10e4SPeter Maydell########################################## 5926a40161cbSPaolo Bonzini# check for usable membarrier system call 5927a40161cbSPaolo Bonziniif test "$membarrier" = "yes"; then 5928a40161cbSPaolo Bonzini have_membarrier=no 5929a40161cbSPaolo Bonzini if test "$mingw32" = "yes" ; then 5930a40161cbSPaolo Bonzini have_membarrier=yes 5931a40161cbSPaolo Bonzini elif test "$linux" = "yes" ; then 5932a40161cbSPaolo Bonzini cat > $TMPC << EOF 5933a40161cbSPaolo Bonzini #include <linux/membarrier.h> 5934a40161cbSPaolo Bonzini #include <sys/syscall.h> 5935a40161cbSPaolo Bonzini #include <unistd.h> 5936a40161cbSPaolo Bonzini #include <stdlib.h> 5937a40161cbSPaolo Bonzini int main(void) { 5938a40161cbSPaolo Bonzini syscall(__NR_membarrier, MEMBARRIER_CMD_QUERY, 0); 5939a40161cbSPaolo Bonzini syscall(__NR_membarrier, MEMBARRIER_CMD_SHARED, 0); 5940a40161cbSPaolo Bonzini exit(0); 5941a40161cbSPaolo Bonzini } 5942a40161cbSPaolo BonziniEOF 5943a40161cbSPaolo Bonzini if compile_prog "" "" ; then 5944a40161cbSPaolo Bonzini have_membarrier=yes 5945a40161cbSPaolo Bonzini fi 5946a40161cbSPaolo Bonzini fi 5947a40161cbSPaolo Bonzini if test "$have_membarrier" = "no"; then 5948a40161cbSPaolo Bonzini feature_not_found "membarrier" "membarrier system call not available" 5949a40161cbSPaolo Bonzini fi 5950a40161cbSPaolo Bonzinielse 5951a40161cbSPaolo Bonzini # Do not enable it by default even for Mingw32, because it doesn't 5952a40161cbSPaolo Bonzini # work on Wine. 5953a40161cbSPaolo Bonzini membarrier=no 5954a40161cbSPaolo Bonzinifi 5955a40161cbSPaolo Bonzini 5956a40161cbSPaolo Bonzini########################################## 5957b66e10e4SPeter Maydell# check if rtnetlink.h exists and is useful 5958575b22b1SLaurent Vivierhave_rtnetlink=no 5959575b22b1SLaurent Viviercat > $TMPC << EOF 5960575b22b1SLaurent Vivier#include <linux/rtnetlink.h> 5961575b22b1SLaurent Vivierint main(void) { 5962575b22b1SLaurent Vivier return IFLA_PROTO_DOWN; 5963575b22b1SLaurent Vivier} 5964575b22b1SLaurent VivierEOF 5965575b22b1SLaurent Vivierif compile_prog "" "" ; then 5966575b22b1SLaurent Vivier have_rtnetlink=yes 5967575b22b1SLaurent Vivierfi 5968575b22b1SLaurent Vivier 59696a02c806SStefan Hajnoczi########################################## 59706a02c806SStefan Hajnoczi# check for usable AF_VSOCK environment 59716a02c806SStefan Hajnoczihave_af_vsock=no 59726a02c806SStefan Hajnoczicat > $TMPC << EOF 59736a02c806SStefan Hajnoczi#include <errno.h> 59746a02c806SStefan Hajnoczi#include <sys/types.h> 59756a02c806SStefan Hajnoczi#include <sys/socket.h> 59766a02c806SStefan Hajnoczi#if !defined(AF_VSOCK) 59776a02c806SStefan Hajnoczi# error missing AF_VSOCK flag 59786a02c806SStefan Hajnoczi#endif 59796a02c806SStefan Hajnoczi#include <linux/vm_sockets.h> 59806a02c806SStefan Hajnocziint main(void) { 59816a02c806SStefan Hajnoczi int sock, ret; 59826a02c806SStefan Hajnoczi struct sockaddr_vm svm; 59836a02c806SStefan Hajnoczi socklen_t len = sizeof(svm); 59846a02c806SStefan Hajnoczi sock = socket(AF_VSOCK, SOCK_STREAM, 0); 59856a02c806SStefan Hajnoczi ret = getpeername(sock, (struct sockaddr *)&svm, &len); 59866a02c806SStefan Hajnoczi if ((ret == -1) && (errno == ENOTCONN)) { 59876a02c806SStefan Hajnoczi return 0; 59886a02c806SStefan Hajnoczi } 59896a02c806SStefan Hajnoczi return -1; 59906a02c806SStefan Hajnoczi} 59916a02c806SStefan HajnocziEOF 59926a02c806SStefan Hajnocziif compile_prog "" "" ; then 59936a02c806SStefan Hajnoczi have_af_vsock=yes 59946a02c806SStefan Hajnoczifi 59956a02c806SStefan Hajnoczi 5996f0d92b56SLongpeng(Mike)########################################## 5997f0d92b56SLongpeng(Mike)# check for usable AF_ALG environment 59984f67366eSThomas Huthhave_afalg=no 5999f0d92b56SLongpeng(Mike)cat > $TMPC << EOF 6000f0d92b56SLongpeng(Mike)#include <errno.h> 6001f0d92b56SLongpeng(Mike)#include <sys/types.h> 6002f0d92b56SLongpeng(Mike)#include <sys/socket.h> 6003f0d92b56SLongpeng(Mike)#include <linux/if_alg.h> 6004f0d92b56SLongpeng(Mike)int main(void) { 6005f0d92b56SLongpeng(Mike) int sock; 6006f0d92b56SLongpeng(Mike) sock = socket(AF_ALG, SOCK_SEQPACKET, 0); 6007f0d92b56SLongpeng(Mike) return sock; 6008f0d92b56SLongpeng(Mike)} 6009f0d92b56SLongpeng(Mike)EOF 6010f0d92b56SLongpeng(Mike)if compile_prog "" "" ; then 6011f0d92b56SLongpeng(Mike) have_afalg=yes 6012f0d92b56SLongpeng(Mike)fi 6013f0d92b56SLongpeng(Mike)if test "$crypto_afalg" = "yes" 6014f0d92b56SLongpeng(Mike)then 6015f0d92b56SLongpeng(Mike) if test "$have_afalg" != "yes" 6016f0d92b56SLongpeng(Mike) then 6017f0d92b56SLongpeng(Mike) error_exit "AF_ALG requested but could not be detected" 6018f0d92b56SLongpeng(Mike) fi 6019f0d92b56SLongpeng(Mike)fi 6020f0d92b56SLongpeng(Mike) 6021f0d92b56SLongpeng(Mike) 60226969ec6cSJames Clarke################################################# 6023c97d6d2cSSergio Andres Gomez Del Real# Check to see if we have the Hypervisor framework 6024d2d08522SPeter Maydellif [ "$darwin" = "yes" ] ; then 6025c97d6d2cSSergio Andres Gomez Del Real cat > $TMPC << EOF 6026c97d6d2cSSergio Andres Gomez Del Real#include <Hypervisor/hv.h> 6027c97d6d2cSSergio Andres Gomez Del Realint main() { return 0;} 6028c97d6d2cSSergio Andres Gomez Del RealEOF 6029c97d6d2cSSergio Andres Gomez Del Real if ! compile_object ""; then 6030c97d6d2cSSergio Andres Gomez Del Real hvf='no' 6031c97d6d2cSSergio Andres Gomez Del Real else 6032c97d6d2cSSergio Andres Gomez Del Real hvf='yes' 6033db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-framework Hypervisor $QEMU_LDFLAGS" 6034c97d6d2cSSergio Andres Gomez Del Real fi 6035c97d6d2cSSergio Andres Gomez Del Realfi 6036c97d6d2cSSergio Andres Gomez Del Real 6037c97d6d2cSSergio Andres Gomez Del Real################################################# 60386969ec6cSJames Clarke# Sparc implicitly links with --relax, which is 60396969ec6cSJames Clarke# incompatible with -r, so --no-relax should be 60406969ec6cSJames Clarke# given. It does no harm to give it on other 60416969ec6cSJames Clarke# platforms too. 60426969ec6cSJames Clarke 60436969ec6cSJames Clarke# Note: the prototype is needed since QEMU_CFLAGS 60446969ec6cSJames Clarke# contains -Wmissing-prototypes 60456969ec6cSJames Clarkecat > $TMPC << EOF 60466969ec6cSJames Clarkeextern int foo(void); 60476969ec6cSJames Clarkeint foo(void) { return 0; } 60486969ec6cSJames ClarkeEOF 60496969ec6cSJames Clarkeif ! compile_object ""; then 60506969ec6cSJames Clarke error_exit "Failed to compile object file for LD_REL_FLAGS test" 60516969ec6cSJames Clarkefi 60527ecf44a5SPaolo Bonzinifor i in '-Wl,-r -Wl,--no-relax' -Wl,-r -r; do 60537ecf44a5SPaolo Bonzini if do_cc -nostdlib $i -o $TMPMO $TMPO; then 60547ecf44a5SPaolo Bonzini LD_REL_FLAGS=$i 60557ecf44a5SPaolo Bonzini break 60567ecf44a5SPaolo Bonzini fi 60577ecf44a5SPaolo Bonzinidone 60587ecf44a5SPaolo Bonziniif test "$modules" = "yes" && test "$LD_REL_FLAGS" = ""; then 60597ecf44a5SPaolo Bonzini feature_not_found "modules" "Cannot find how to build relocatable objects" 60606969ec6cSJames Clarkefi 60616969ec6cSJames Clarke 6062277abf15SJan Vesely########################################## 60634d04351fSChristopher Covington# check for sysmacros.h 60644d04351fSChristopher Covington 60654d04351fSChristopher Covingtonhave_sysmacros=no 60664d04351fSChristopher Covingtoncat > $TMPC << EOF 60674d04351fSChristopher Covington#include <sys/sysmacros.h> 60684d04351fSChristopher Covingtonint main(void) { 60694d04351fSChristopher Covington return makedev(0, 0); 60704d04351fSChristopher Covington} 60714d04351fSChristopher CovingtonEOF 60724d04351fSChristopher Covingtonif compile_prog "" "" ; then 60734d04351fSChristopher Covington have_sysmacros=yes 60744d04351fSChristopher Covingtonfi 60754d04351fSChristopher Covington 60764d04351fSChristopher Covington########################################## 6077da92c3ffSAshish Mittal# Veritas HyperScale block driver VxHS 6078da92c3ffSAshish Mittal# Check if libvxhs is installed 6079da92c3ffSAshish Mittal 6080da92c3ffSAshish Mittalif test "$vxhs" != "no" ; then 6081da92c3ffSAshish Mittal cat > $TMPC <<EOF 6082da92c3ffSAshish Mittal#include <stdint.h> 6083da92c3ffSAshish Mittal#include <qnio/qnio_api.h> 6084da92c3ffSAshish Mittal 6085da92c3ffSAshish Mittalvoid *vxhs_callback; 6086da92c3ffSAshish Mittal 6087da92c3ffSAshish Mittalint main(void) { 6088da92c3ffSAshish Mittal iio_init(QNIO_VERSION, vxhs_callback); 6089da92c3ffSAshish Mittal return 0; 6090da92c3ffSAshish Mittal} 6091da92c3ffSAshish MittalEOF 6092da92c3ffSAshish Mittal vxhs_libs="-lvxhs -lssl" 6093da92c3ffSAshish Mittal if compile_prog "" "$vxhs_libs" ; then 6094da92c3ffSAshish Mittal vxhs=yes 6095da92c3ffSAshish Mittal else 6096da92c3ffSAshish Mittal if test "$vxhs" = "yes" ; then 6097da92c3ffSAshish Mittal feature_not_found "vxhs block device" "Install libvxhs See github" 6098da92c3ffSAshish Mittal fi 6099da92c3ffSAshish Mittal vxhs=no 6100da92c3ffSAshish Mittal fi 6101da92c3ffSAshish Mittalfi 6102da92c3ffSAshish Mittal 6103da92c3ffSAshish Mittal########################################## 610449e00a18SAndreas Grapentin# check for _Static_assert() 610549e00a18SAndreas Grapentin 610649e00a18SAndreas Grapentinhave_static_assert=no 610749e00a18SAndreas Grapentincat > $TMPC << EOF 610849e00a18SAndreas Grapentin_Static_assert(1, "success"); 610949e00a18SAndreas Grapentinint main(void) { 611049e00a18SAndreas Grapentin return 0; 611149e00a18SAndreas Grapentin} 611249e00a18SAndreas GrapentinEOF 611349e00a18SAndreas Grapentinif compile_prog "" "" ; then 611449e00a18SAndreas Grapentin have_static_assert=yes 611549e00a18SAndreas Grapentinfi 611649e00a18SAndreas Grapentin 611749e00a18SAndreas Grapentin########################################## 6118e674605fSTomáš Golembiovský# check for utmpx.h, it is missing e.g. on OpenBSD 6119e674605fSTomáš Golembiovský 6120e674605fSTomáš Golembiovskýhave_utmpx=no 6121e674605fSTomáš Golembiovskýcat > $TMPC << EOF 6122e674605fSTomáš Golembiovský#include <utmpx.h> 6123e674605fSTomáš Golembiovskýstruct utmpx user_info; 6124e674605fSTomáš Golembiovskýint main(void) { 6125e674605fSTomáš Golembiovský return 0; 6126e674605fSTomáš Golembiovský} 6127e674605fSTomáš GolembiovskýEOF 6128e674605fSTomáš Golembiovskýif compile_prog "" "" ; then 6129e674605fSTomáš Golembiovský have_utmpx=yes 6130e674605fSTomáš Golembiovskýfi 6131e674605fSTomáš Golembiovský 6132e674605fSTomáš Golembiovský########################################## 6133db1ed1abSRichard Henderson# check for getrandom() 6134db1ed1abSRichard Henderson 6135db1ed1abSRichard Hendersonhave_getrandom=no 6136db1ed1abSRichard Hendersoncat > $TMPC << EOF 6137db1ed1abSRichard Henderson#include <sys/random.h> 6138db1ed1abSRichard Hendersonint main(void) { 6139db1ed1abSRichard Henderson return getrandom(0, 0, GRND_NONBLOCK); 6140db1ed1abSRichard Henderson} 6141db1ed1abSRichard HendersonEOF 6142db1ed1abSRichard Hendersonif compile_prog "" "" ; then 6143db1ed1abSRichard Henderson have_getrandom=yes 6144db1ed1abSRichard Hendersonfi 6145db1ed1abSRichard Henderson 6146db1ed1abSRichard Henderson########################################## 6147247724cbSMarc-André Lureau# checks for sanitizers 6148247724cbSMarc-André Lureau 6149247724cbSMarc-André Lureauhave_asan=no 6150247724cbSMarc-André Lureauhave_ubsan=no 6151d83414e1SMarc-André Lureauhave_asan_iface_h=no 6152d83414e1SMarc-André Lureauhave_asan_iface_fiber=no 6153247724cbSMarc-André Lureau 6154247724cbSMarc-André Lureauif test "$sanitizers" = "yes" ; then 6155b9f44da2SMarc-André Lureau write_c_skeleton 6156247724cbSMarc-André Lureau if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" ""; then 6157247724cbSMarc-André Lureau have_asan=yes 6158247724cbSMarc-André Lureau fi 6159b9f44da2SMarc-André Lureau 6160b9f44da2SMarc-André Lureau # we could use a simple skeleton for flags checks, but this also 6161b9f44da2SMarc-André Lureau # detect the static linking issue of ubsan, see also: 6162b9f44da2SMarc-André Lureau # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84285 6163b9f44da2SMarc-André Lureau cat > $TMPC << EOF 6164b9f44da2SMarc-André Lureau#include <stdlib.h> 6165b9f44da2SMarc-André Lureauint main(void) { 6166b9f44da2SMarc-André Lureau void *tmp = malloc(10); 6167b9f44da2SMarc-André Lureau return *(int *)(tmp + 2); 6168b9f44da2SMarc-André Lureau} 6169b9f44da2SMarc-André LureauEOF 6170247724cbSMarc-André Lureau if compile_prog "$CPU_CFLAGS -Werror -fsanitize=undefined" ""; then 6171247724cbSMarc-André Lureau have_ubsan=yes 6172247724cbSMarc-André Lureau fi 6173d83414e1SMarc-André Lureau 6174d83414e1SMarc-André Lureau if check_include "sanitizer/asan_interface.h" ; then 6175d83414e1SMarc-André Lureau have_asan_iface_h=yes 6176d83414e1SMarc-André Lureau fi 6177d83414e1SMarc-André Lureau 6178d83414e1SMarc-André Lureau cat > $TMPC << EOF 6179d83414e1SMarc-André Lureau#include <sanitizer/asan_interface.h> 6180d83414e1SMarc-André Lureauint main(void) { 6181d83414e1SMarc-André Lureau __sanitizer_start_switch_fiber(0, 0, 0); 6182d83414e1SMarc-André Lureau return 0; 6183d83414e1SMarc-André Lureau} 6184d83414e1SMarc-André LureauEOF 6185d83414e1SMarc-André Lureau if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address" "" ; then 6186d83414e1SMarc-André Lureau have_asan_iface_fiber=yes 6187d83414e1SMarc-André Lureau fi 6188247724cbSMarc-André Lureaufi 6189247724cbSMarc-André Lureau 6190247724cbSMarc-André Lureau########################################## 6191adc28027SAlexander Bulekov# checks for fuzzer 6192adc28027SAlexander Bulekovif test "$fuzzing" = "yes" ; then 6193adc28027SAlexander Bulekov write_c_fuzzer_skeleton 6194adc28027SAlexander Bulekov if compile_prog "$CPU_CFLAGS -Werror -fsanitize=address,fuzzer" ""; then 6195adc28027SAlexander Bulekov have_fuzzer=yes 6196adc28027SAlexander Bulekov fi 6197adc28027SAlexander Bulekovfi 6198adc28027SAlexander Bulekov 6199adc28027SAlexander Bulekov########################################## 620017824406SJunyan He# check for libpmem 620117824406SJunyan He 620217824406SJunyan Heif test "$libpmem" != "no"; then 620317824406SJunyan He if $pkg_config --exists "libpmem"; then 620417824406SJunyan He libpmem="yes" 620517824406SJunyan He libpmem_libs=$($pkg_config --libs libpmem) 620617824406SJunyan He libpmem_cflags=$($pkg_config --cflags libpmem) 620717824406SJunyan He libs_softmmu="$libs_softmmu $libpmem_libs" 620817824406SJunyan He QEMU_CFLAGS="$QEMU_CFLAGS $libpmem_cflags" 620917824406SJunyan He else 621017824406SJunyan He if test "$libpmem" = "yes" ; then 621117824406SJunyan He feature_not_found "libpmem" "Install nvml or pmdk" 621217824406SJunyan He fi 621317824406SJunyan He libpmem="no" 621417824406SJunyan He fi 621517824406SJunyan Hefi 621617824406SJunyan He 621717824406SJunyan He########################################## 6218675b9b53SMarc-André Lureau# check for slirp 6219675b9b53SMarc-André Lureau 6220d599938aSLaurent Vivier# slirp is only required when building softmmu targets 6221d599938aSLaurent Vivierif test -z "$slirp" -a "$softmmu" != "yes" ; then 6222d599938aSLaurent Vivier slirp="no" 6223d599938aSLaurent Vivierfi 6224d599938aSLaurent Vivier 6225675b9b53SMarc-André Lureaucase "$slirp" in 6226675b9b53SMarc-André Lureau "" | yes) 6227675b9b53SMarc-André Lureau if $pkg_config slirp; then 6228675b9b53SMarc-André Lureau slirp=system 62297c57bdd8SMarc-André Lureau elif test -e "${source_path}/.git" && test $git_update = 'yes' ; then 62307c57bdd8SMarc-André Lureau slirp=git 6231675b9b53SMarc-André Lureau elif test -e "${source_path}/slirp/Makefile" ; then 6232675b9b53SMarc-André Lureau slirp=internal 6233675b9b53SMarc-André Lureau elif test -z "$slirp" ; then 6234675b9b53SMarc-André Lureau slirp=no 6235675b9b53SMarc-André Lureau else 6236675b9b53SMarc-André Lureau feature_not_found "slirp" "Install slirp devel or git submodule" 6237675b9b53SMarc-André Lureau fi 6238675b9b53SMarc-André Lureau ;; 6239675b9b53SMarc-André Lureau 6240675b9b53SMarc-André Lureau system) 6241675b9b53SMarc-André Lureau if ! $pkg_config slirp; then 6242675b9b53SMarc-André Lureau feature_not_found "slirp" "Install slirp devel" 6243675b9b53SMarc-André Lureau fi 6244675b9b53SMarc-André Lureau ;; 6245675b9b53SMarc-André Lureauesac 6246675b9b53SMarc-André Lureau 6247675b9b53SMarc-André Lureaucase "$slirp" in 62487c57bdd8SMarc-André Lureau git | internal) 62497c57bdd8SMarc-André Lureau if test "$slirp" = git; then 62507c57bdd8SMarc-André Lureau git_submodules="${git_submodules} slirp" 62517c57bdd8SMarc-André Lureau fi 6252675b9b53SMarc-André Lureau mkdir -p slirp 6253675b9b53SMarc-André Lureau slirp_cflags="-I\$(SRC_PATH)/slirp/src -I\$(BUILD_DIR)/slirp/src" 6254675b9b53SMarc-André Lureau slirp_libs="-L\$(BUILD_DIR)/slirp -lslirp" 6255b965e8c5SPaolo Bonzini if test "$mingw32" = "yes" ; then 6256b965e8c5SPaolo Bonzini slirp_libs="$slirp_libs -lws2_32 -liphlpapi" 6257b965e8c5SPaolo Bonzini fi 6258675b9b53SMarc-André Lureau ;; 6259675b9b53SMarc-André Lureau 6260675b9b53SMarc-André Lureau system) 6261675b9b53SMarc-André Lureau slirp_version=$($pkg_config --modversion slirp 2>/dev/null) 6262675b9b53SMarc-André Lureau slirp_cflags=$($pkg_config --cflags slirp 2>/dev/null) 6263675b9b53SMarc-André Lureau slirp_libs=$($pkg_config --libs slirp 2>/dev/null) 6264675b9b53SMarc-André Lureau ;; 6265675b9b53SMarc-André Lureau 6266675b9b53SMarc-André Lureau no) 6267675b9b53SMarc-André Lureau ;; 6268675b9b53SMarc-André Lureau *) 6269675b9b53SMarc-André Lureau error_exit "Unknown state for slirp: $slirp" 6270675b9b53SMarc-André Lureau ;; 6271675b9b53SMarc-André Lureauesac 6272675b9b53SMarc-André Lureau 6273675b9b53SMarc-André Lureau 6274675b9b53SMarc-André Lureau########################################## 6275e86ecd4bSJuan Quintela# End of CC checks 6276e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 6277e86ecd4bSJuan Quintela 6278d83414e1SMarc-André Lureauwrite_c_skeleton 6279d83414e1SMarc-André Lureau 62801d728c39SBlue Swirlif test "$gcov" = "yes" ; then 6281db5adeaaSPaolo Bonzini QEMU_CFLAGS="-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS" 6282db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS" 6283b553a042SJohn Snowelif test "$fortify_source" = "yes" ; then 6284e600cdf3SMichal Privoznik CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" 628548e56d50SPaolo Bonzinielif test "$debug" = "no"; then 6286ce278618SPeter Maydell CFLAGS="-O2 $CFLAGS" 6287e86ecd4bSJuan Quintelafi 6288a316e378SJuan Quintela 6289247724cbSMarc-André Lureauif test "$have_asan" = "yes"; then 6290db5adeaaSPaolo Bonzini QEMU_CFLAGS="-fsanitize=address $QEMU_CFLAGS" 6291db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-fsanitize=address $QEMU_LDFLAGS" 6292d83414e1SMarc-André Lureau if test "$have_asan_iface_h" = "no" ; then 6293d83414e1SMarc-André Lureau echo "ASAN build enabled, but ASAN header missing." \ 6294d83414e1SMarc-André Lureau "Without code annotation, the report may be inferior." 6295d83414e1SMarc-André Lureau elif test "$have_asan_iface_fiber" = "no" ; then 6296d83414e1SMarc-André Lureau echo "ASAN build enabled, but ASAN header is too old." \ 6297d83414e1SMarc-André Lureau "Without code annotation, the report may be inferior." 6298d83414e1SMarc-André Lureau fi 6299247724cbSMarc-André Lureaufi 6300247724cbSMarc-André Lureauif test "$have_ubsan" = "yes"; then 6301db5adeaaSPaolo Bonzini QEMU_CFLAGS="-fsanitize=undefined $QEMU_CFLAGS" 6302db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-fsanitize=undefined $QEMU_LDFLAGS" 6303247724cbSMarc-André Lureaufi 6304247724cbSMarc-André Lureau 63056542aa9cSPeter Lieven########################################## 63066542aa9cSPeter Lieven# Do we have libnfs 63076542aa9cSPeter Lievenif test "$libnfs" != "no" ; then 6308b7d769c9SPeter Lieven if $pkg_config --atleast-version=1.9.3 libnfs; then 63096542aa9cSPeter Lieven libnfs="yes" 63106542aa9cSPeter Lieven libnfs_libs=$($pkg_config --libs libnfs) 63116542aa9cSPeter Lieven else 63126542aa9cSPeter Lieven if test "$libnfs" = "yes" ; then 63138efc9363SHu Tao feature_not_found "libnfs" "Install libnfs devel >= 1.9.3" 63146542aa9cSPeter Lieven fi 63156542aa9cSPeter Lieven libnfs="no" 63166542aa9cSPeter Lieven fi 63176542aa9cSPeter Lievenfi 63181d728c39SBlue Swirl 63193efac6ebSTomáš Golembiovský########################################## 63203efac6ebSTomáš Golembiovský# Do we have libudev 63213efac6ebSTomáš Golembiovskýif test "$libudev" != "no" ; then 63223efac6ebSTomáš Golembiovský if $pkg_config libudev && test "$static" != "yes"; then 63233efac6ebSTomáš Golembiovský libudev="yes" 63243efac6ebSTomáš Golembiovský libudev_libs=$($pkg_config --libs libudev) 63253efac6ebSTomáš Golembiovský else 63263efac6ebSTomáš Golembiovský libudev="no" 63273efac6ebSTomáš Golembiovský fi 63283efac6ebSTomáš Golembiovskýfi 63293efac6ebSTomáš Golembiovský 63306ca026cbSPeter Maydell# Now we've finished running tests it's OK to add -Werror to the compiler flags 63316ca026cbSPeter Maydellif test "$werror" = "yes"; then 63326ca026cbSPeter Maydell QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 63336ca026cbSPeter Maydellfi 63346ca026cbSPeter Maydell 6335e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 6336e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 6337db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-Wl,--warn-common $QEMU_LDFLAGS" 6338e86ecd4bSJuan Quintela fi 6339e86ecd4bSJuan Quintelafi 6340e86ecd4bSJuan Quintela 634194dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 634294dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 634394dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 634494dd53c5SGerd Hoffmannelse 634594dd53c5SGerd Hoffmann POD2MAN="pod2man" 634694dd53c5SGerd Hoffmannfi 634794dd53c5SGerd Hoffmann 6348952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 6349952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 6350952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 6351e9a3591fSChristian Borntraeger if ld_has $flag ; then 6352db5adeaaSPaolo Bonzini QEMU_LDFLAGS="-Wl,$flag $QEMU_LDFLAGS" 6353952afb71SBlue Swirl fi 6354952afb71SBlue Swirl done 6355952afb71SBlue Swirlfi 6356952afb71SBlue Swirl 63577776ea6bSPhilippe Mathieu-Daudé# Disable OpenBSD W^X if available 63587776ea6bSPhilippe Mathieu-Daudéif test "$tcg" = "yes" && test "$targetos" = "OpenBSD"; then 63597776ea6bSPhilippe Mathieu-Daudé cat > $TMPC <<EOF 63607776ea6bSPhilippe Mathieu-Daudé int main(void) { return 0; } 63617776ea6bSPhilippe Mathieu-DaudéEOF 63627776ea6bSPhilippe Mathieu-Daudé wx_ldflags="-Wl,-z,wxneeded" 63637776ea6bSPhilippe Mathieu-Daudé if compile_prog "" "$wx_ldflags"; then 63647776ea6bSPhilippe Mathieu-Daudé QEMU_LDFLAGS="$QEMU_LDFLAGS $wx_ldflags" 63657776ea6bSPhilippe Mathieu-Daudé fi 63667776ea6bSPhilippe Mathieu-Daudéfi 63677776ea6bSPhilippe Mathieu-Daudé 636810ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 6369e26110cfSFam Zhengqemu_moddir=$libdir$confsuffix 6370528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 6371834574eaSAnthony Liguoriqemu_localedir="$datadir/locale" 6372a8260d38SDaniel P. Berrangéqemu_icondir="$datadir/icons" 637367ea9546SDaniel P. Berrangéqemu_desktopdir="$datadir/applications" 63745a67135aSbellard 6375e0580342SKamil Rytarowski# We can only support ivshmem if we have eventfd 6376e0580342SKamil Rytarowskiif [ "$eventfd" = "yes" ]; then 6377e0580342SKamil Rytarowski ivshmem=yes 6378e0580342SKamil Rytarowskifi 6379e0580342SKamil Rytarowski 63804b1c11fdSDaniel P. Berrangetools="" 63814b1c11fdSDaniel P. Berrangeif test "$want_tools" = "yes" ; then 638272d277a7SGerd Hoffmann tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) qemu-edid\$(EXESUF) $tools" 63834b1c11fdSDaniel P. Berrange if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 6384f353415fSKevin Wolf tools="qemu-nbd\$(EXESUF) qemu-storage-daemon\$(EXESUF) $tools" 6385b1449edbSKamil Rytarowski fi 6386b1449edbSKamil Rytarowski if [ "$ivshmem" = "yes" ]; then 6387a75eb03bSDavid Marchand tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" 63884b1c11fdSDaniel P. Berrange fi 63891b9d35f3SViktor Prutyanov if [ "$curl" = "yes" ]; then 63901b9d35f3SViktor Prutyanov tools="elf2dmp\$(EXESUF) $tools" 63913fa2d384SViktor Prutyanov fi 63924b1c11fdSDaniel P. Berrangefi 63934b1c11fdSDaniel P. Berrangeif test "$softmmu" = yes ; then 6394b855f8d1SPaolo Bonzini if test "$linux" = yes; then 63957e462613SPaolo Bonzini if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then 6396983eef5aSMeador Inge virtfs=yes 639717bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 6398983eef5aSMeador Inge else 6399983eef5aSMeador Inge if test "$virtfs" = yes; then 64007e462613SPaolo Bonzini error_exit "VirtFS requires libcap-ng devel and libattr devel" 6401983eef5aSMeador Inge fi 640217500370SAndreas Färber virtfs=no 6403983eef5aSMeador Inge fi 6404fe8fc5aeSPaolo Bonzini if test "$mpath" != no && test "$mpathpersist" = yes ; then 6405fe8fc5aeSPaolo Bonzini mpath=yes 6406fe8fc5aeSPaolo Bonzini else 6407fe8fc5aeSPaolo Bonzini if test "$mpath" = yes; then 6408fe8fc5aeSPaolo Bonzini error_exit "Multipath requires libmpathpersist devel" 6409fe8fc5aeSPaolo Bonzini fi 6410fe8fc5aeSPaolo Bonzini mpath=no 6411fe8fc5aeSPaolo Bonzini fi 6412b855f8d1SPaolo Bonzini tools="$tools scsi/qemu-pr-helper\$(EXESUF)" 6413b855f8d1SPaolo Bonzini else 6414b855f8d1SPaolo Bonzini if test "$virtfs" = yes; then 6415b855f8d1SPaolo Bonzini error_exit "VirtFS is supported only on Linux" 6416b855f8d1SPaolo Bonzini fi 6417b855f8d1SPaolo Bonzini virtfs=no 6418fe8fc5aeSPaolo Bonzini if test "$mpath" = yes; then 6419fe8fc5aeSPaolo Bonzini error_exit "Multipath is supported only on Linux" 6420fe8fc5aeSPaolo Bonzini fi 6421fe8fc5aeSPaolo Bonzini mpath=no 642217bff52bSM. Mohan Kumar fi 64236a021536SGerd Hoffmann if test "$xkbcommon" = "yes"; then 64246a021536SGerd Hoffmann tools="qemu-keymap\$(EXESUF) $tools" 64256a021536SGerd Hoffmann fi 6426ff69fd8cSLaurent Vivierfi 64279d6bc27bSMichael Roth 64289d6bc27bSMichael Roth# Probe for guest agent support/options 64299d6bc27bSMichael Roth 6430e8ef31a3SMichael Tokarevif [ "$guest_agent" != "no" ]; then 6431a5125905SLaurent Vivier if [ "$softmmu" = no -a "$want_tools" = no ] ; then 6432a5125905SLaurent Vivier guest_agent=no 6433a5125905SLaurent Vivier elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then 64340814465aSPaolo Bonzini tools="qemu-ga\$(EXESUF) $tools" 6435e8ef31a3SMichael Tokarev guest_agent=yes 6436e8ef31a3SMichael Tokarev elif [ "$guest_agent" != yes ]; then 6437e8ef31a3SMichael Tokarev guest_agent=no 6438e8ef31a3SMichael Tokarev else 6439e8ef31a3SMichael Tokarev error_exit "Guest agent is not supported on this platform" 6440ca35f780SPaolo Bonzini fi 64414b1c11fdSDaniel P. Berrangefi 6442ca35f780SPaolo Bonzini 64439d6bc27bSMichael Roth# Guest agent Window MSI package 64449d6bc27bSMichael Roth 64459d6bc27bSMichael Rothif test "$guest_agent" != yes; then 64469d6bc27bSMichael Roth if test "$guest_agent_msi" = yes; then 64479d6bc27bSMichael Roth error_exit "MSI guest agent package requires guest agent enabled" 64489d6bc27bSMichael Roth fi 64499d6bc27bSMichael Roth guest_agent_msi=no 64509d6bc27bSMichael Rothelif test "$mingw32" != "yes"; then 64519d6bc27bSMichael Roth if test "$guest_agent_msi" = "yes"; then 64529d6bc27bSMichael Roth error_exit "MSI guest agent package is available only for MinGW Windows cross-compilation" 64539d6bc27bSMichael Roth fi 64549d6bc27bSMichael Roth guest_agent_msi=no 64559d6bc27bSMichael Rothelif ! has wixl; then 64569d6bc27bSMichael Roth if test "$guest_agent_msi" = "yes"; then 64579d6bc27bSMichael Roth error_exit "MSI guest agent package requires wixl tool installed ( usually from msitools package )" 64589d6bc27bSMichael Roth fi 64599d6bc27bSMichael Roth guest_agent_msi=no 64601a34904eSMichael Rothelse 64611a34904eSMichael Roth # we support qemu-ga, mingw32, and wixl: default to MSI enabled if it wasn't 64621a34904eSMichael Roth # disabled explicitly 64631a34904eSMichael Roth if test "$guest_agent_msi" != "no"; then 64641a34904eSMichael Roth guest_agent_msi=yes 64651a34904eSMichael Roth fi 64669d6bc27bSMichael Rothfi 64679d6bc27bSMichael Roth 64681a34904eSMichael Rothif test "$guest_agent_msi" = "yes"; then 64699d6bc27bSMichael Roth if test "$guest_agent_with_vss" = "yes"; then 64709d6bc27bSMichael Roth QEMU_GA_MSI_WITH_VSS="-D InstallVss" 64719d6bc27bSMichael Roth fi 64729d6bc27bSMichael Roth 64739d6bc27bSMichael Roth if test "$QEMU_GA_MANUFACTURER" = ""; then 64749d6bc27bSMichael Roth QEMU_GA_MANUFACTURER=QEMU 64759d6bc27bSMichael Roth fi 64769d6bc27bSMichael Roth 64779d6bc27bSMichael Roth if test "$QEMU_GA_DISTRO" = ""; then 64789d6bc27bSMichael Roth QEMU_GA_DISTRO=Linux 64799d6bc27bSMichael Roth fi 64809d6bc27bSMichael Roth 64819d6bc27bSMichael Roth if test "$QEMU_GA_VERSION" = ""; then 648289138857SStefan Weil QEMU_GA_VERSION=$(cat $source_path/VERSION) 64839d6bc27bSMichael Roth fi 64849d6bc27bSMichael Roth 648589138857SStefan Weil QEMU_GA_MSI_MINGW_DLL_PATH="-D Mingw_dlls=$($pkg_config --variable=prefix glib-2.0)/bin" 64869d6bc27bSMichael Roth 64879d6bc27bSMichael Roth case "$cpu" in 64889d6bc27bSMichael Roth x86_64) 64899d6bc27bSMichael Roth QEMU_GA_MSI_ARCH="-a x64 -D Arch=64" 64909d6bc27bSMichael Roth ;; 64919d6bc27bSMichael Roth i386) 64929d6bc27bSMichael Roth QEMU_GA_MSI_ARCH="-D Arch=32" 64939d6bc27bSMichael Roth ;; 64949d6bc27bSMichael Roth *) 64959d6bc27bSMichael Roth error_exit "CPU $cpu not supported for building installation package" 64969d6bc27bSMichael Roth ;; 64979d6bc27bSMichael Roth esac 64989d6bc27bSMichael Rothfi 64999d6bc27bSMichael Roth 6500ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 6501ca35f780SPaolo Bonziniroms= 6502e633a5c6SEric Blakeif { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ 6503e633a5c6SEric Blake test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \ 6504e633a5c6SEric Blake test "$softmmu" = yes ; then 6505e57218b6SPeter Maydell # Different host OS linkers have different ideas about the name of the ELF 6506c65d5e4eSBrad Smith # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd 6507c65d5e4eSBrad Smith # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. 6508c65d5e4eSBrad Smith for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do 6509e57218b6SPeter Maydell if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then 6510e57218b6SPeter Maydell ld_i386_emulation="$emu" 6511ca35f780SPaolo Bonzini roms="optionrom" 6512e57218b6SPeter Maydell break 6513e57218b6SPeter Maydell fi 6514e57218b6SPeter Maydell done 6515ca35f780SPaolo Bonzinifi 6516ca35f780SPaolo Bonzini 65172e33c3f8SThomas Huth# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 65189933c305SChristian Borntraegerif test "$cpu" = "s390x" ; then 65192e33c3f8SThomas Huth write_c_skeleton 65202e33c3f8SThomas Huth if compile_prog "-march=z900" ""; then 65219933c305SChristian Borntraeger roms="$roms s390-ccw" 65229933c305SChristian Borntraeger fi 65232e33c3f8SThomas Huthfi 65249933c305SChristian Borntraeger 652511cde1c8SBruno Dominguez# Check that the C++ compiler exists and works with the C compiler. 652611cde1c8SBruno Dominguez# All the QEMU_CXXFLAGS are based on QEMU_CFLAGS. Keep this at the end to don't miss any other that could be added. 652711cde1c8SBruno Dominguezif has $cxx; then 652811cde1c8SBruno Dominguez cat > $TMPC <<EOF 652911cde1c8SBruno Dominguezint c_function(void); 653011cde1c8SBruno Dominguezint main(void) { return c_function(); } 653111cde1c8SBruno DominguezEOF 653211cde1c8SBruno Dominguez 653311cde1c8SBruno Dominguez compile_object 653411cde1c8SBruno Dominguez 653511cde1c8SBruno Dominguez cat > $TMPCXX <<EOF 653611cde1c8SBruno Dominguezextern "C" { 653711cde1c8SBruno Dominguez int c_function(void); 653811cde1c8SBruno Dominguez} 653911cde1c8SBruno Dominguezint c_function(void) { return 42; } 654011cde1c8SBruno DominguezEOF 654111cde1c8SBruno Dominguez 654211cde1c8SBruno Dominguez update_cxxflags 654311cde1c8SBruno Dominguez 6544db5adeaaSPaolo Bonzini if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $QEMU_LDFLAGS; then 654511cde1c8SBruno Dominguez # C++ compiler $cxx works ok with C compiler $cc 654611cde1c8SBruno Dominguez : 654711cde1c8SBruno Dominguez else 654811cde1c8SBruno Dominguez echo "C++ compiler $cxx does not work with C compiler $cc" 654911cde1c8SBruno Dominguez echo "Disabling C++ specific optional code" 655011cde1c8SBruno Dominguez cxx= 655111cde1c8SBruno Dominguez fi 655211cde1c8SBruno Dominguezelse 655311cde1c8SBruno Dominguez echo "No C++ compiler available; disabling C++ specific optional code" 655411cde1c8SBruno Dominguez cxx= 655511cde1c8SBruno Dominguezfi 655611cde1c8SBruno Dominguez 655702d34f62SCole Robinsonecho_version() { 655802d34f62SCole Robinson if test "$1" = "yes" ; then 655902d34f62SCole Robinson echo "($2)" 656002d34f62SCole Robinson fi 656102d34f62SCole Robinson} 656202d34f62SCole Robinson 656350e12060SJan Kiszka# prepend pixman and ftd flags after all config tests are done 656450e12060SJan KiszkaQEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS" 65658a99e9a3SPhilippe Mathieu-DaudéQEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS" 656650e12060SJan Kiszkalibs_softmmu="$pixman_libs $libs_softmmu" 65675ca9388aSGerd Hoffmann 65687d13299dSbellardecho "Install prefix $prefix" 656989138857SStefan Weilecho "BIOS directory $(eval echo $qemu_datadir)" 65703d5eecabSGerd Hoffmannecho "firmware path $(eval echo $firmwarepath)" 657189138857SStefan Weilecho "binary directory $(eval echo $bindir)" 657289138857SStefan Weilecho "library directory $(eval echo $libdir)" 657389138857SStefan Weilecho "module directory $(eval echo $qemu_moddir)" 657489138857SStefan Weilecho "libexec directory $(eval echo $libexecdir)" 657589138857SStefan Weilecho "include directory $(eval echo $includedir)" 657689138857SStefan Weilecho "config directory $(eval echo $sysconfdir)" 657711d9f695Sbellardif test "$mingw32" = "no" ; then 657889138857SStefan Weilecho "local state directory $(eval echo $local_statedir)" 657989138857SStefan Weilecho "Manual directory $(eval echo $mandir)" 658043ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 65815a699bbbSLaszlo Ersekelse 65825a699bbbSLaszlo Ersekecho "local state directory queried at runtime" 6583d9840e25STomoki Sekiyamaecho "Windows SDK $win_sdk" 658411d9f695Sbellardfi 6585bc4486fbSPaolo Bonziniecho "Build directory $(pwd)" 65865a67135aSbellardecho "Source path $source_path" 6587cc84d63aSDaniel P. Berrangeecho "GIT binary $git" 6588aef45d51SDaniel P. Berrangeecho "GIT submodules $git_submodules" 65897d13299dSbellardecho "C compiler $cc" 659083469015Sbellardecho "Host C compiler $host_cc" 659183f73fceSTomoki Sekiyamaecho "C++ compiler $cxx" 65923c4a4d0dSPeter Maydellecho "Objective-C compiler $objcc" 659345d285abSPeter Maydellecho "ARFLAGS $ARFLAGS" 65940c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 6595a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 65968a99e9a3SPhilippe Mathieu-Daudéecho "QEMU_LDFLAGS $QEMU_LDFLAGS" 65977d13299dSbellardecho "make $make" 65986a882643Spbrookecho "install $install" 6599755ee70fSCleber Rosaecho "python $python ($python_version)" 66002eb054c2SPeter Maydellif test "$docs" != "no"; then 66012eb054c2SPeter Maydell echo "sphinx-build $sphinx_build" 66022eb054c2SPeter Maydellfi 660339d87c8cSAlex Bennéeecho "genisoimage $genisoimage" 6604675b9b53SMarc-André Lureauecho "slirp support $slirp $(echo_version $slirp $slirp_version)" 6605675b9b53SMarc-André Lureauif test "$slirp" != "no" ; then 6606e2d8830eSBrad echo "smbd $smbd" 6607e2d8830eSBradfi 660817969268SFam Zhengecho "module support $modules" 6609bd83c861SChristian Ehrhardtecho "alt path mod load $module_upgrades" 6610a98fd896Sbellardecho "host CPU $cpu" 6611de83cd02Sbellardecho "host big endian $bigendian" 661297a847bcSbellardecho "target list $target_list" 66137d13299dSbellardecho "gprof enabled $gprof" 661403b4fe7dSaliguoriecho "sparse enabled $sparse" 66151625af87Saliguoriecho "strip binaries $strip_opt" 661605c2a3e7Sbellardecho "profiler $profiler" 661743ce4dfeSbellardecho "static build $static" 66185b0753e0Sbellardif test "$darwin" = "yes" ; then 66195b0753e0Sbellard echo "Cocoa support $cocoa" 66205b0753e0Sbellardfi 662189138857SStefan Weilecho "SDL support $sdl $(echo_version $sdl $sdlversion)" 6622a442fe2fSDaniel P. Berrangéecho "SDL image support $sdl_image" 662389138857SStefan Weilecho "GTK support $gtk $(echo_version $gtk $gtk_version)" 6624925a0400SGerd Hoffmannecho "GTK GL support $gtk_gl" 662589138857SStefan Weilecho "VTE support $vte $(echo_version $vte $vteversion)" 6626a1c5e949SDaniel P. Berrangeecho "TLS priority $tls_priority" 6627ddbb0d09SDaniel P. Berrangeecho "GNUTLS support $gnutls" 662891bfcdb0SDaniel P. Berrangeecho "libgcrypt $gcrypt" 6629e0576942SDaniel P. Berrangéif test "$gcrypt" = "yes" 6630e0576942SDaniel P. Berrangéthen 6631e0576942SDaniel P. Berrangé echo " hmac $gcrypt_hmac" 6632e0576942SDaniel P. Berrangé echo " XTS $gcrypt_xts" 6633e0576942SDaniel P. Berrangéfi 663489138857SStefan Weilecho "nettle $nettle $(echo_version $nettle $nettle_version)" 6635dc2207afSDaniel P. Berrangéif test "$nettle" = "yes" 6636dc2207afSDaniel P. Berrangéthen 6637dc2207afSDaniel P. Berrangé echo " XTS $nettle_xts" 6638dc2207afSDaniel P. Berrangéfi 66399a2fd434SDaniel P. Berrangeecho "libtasn1 $tasn1" 66408953caf3SDaniel P. Berrangeecho "PAM $auth_pam" 6641e08bb301SSamuel Thibaultecho "iconv support $iconv" 66424d3b6f6eSbalrogecho "curses support $curses" 664347479c55SMarc-André Lureauecho "virgl support $virglrenderer $(echo_version $virglrenderer $virgl_version)" 6644769ce76dSAlexander Grafecho "curl support $curl" 664567b915a5Sbellardecho "mingw32 support $mingw32" 66460c58ac1cSmalcecho "Audio drivers $audio_drv_list" 6647b64ec4e4SFam Zhengecho "Block whitelist (rw) $block_drv_rw_whitelist" 6648b64ec4e4SFam Zhengecho "Block whitelist (ro) $block_drv_ro_whitelist" 6649983eef5aSMeador Ingeecho "VirtFS support $virtfs" 6650fe8fc5aeSPaolo Bonziniecho "Multipath support $mpath" 6651821601eaSJes Sorensenecho "VNC support $vnc" 6652821601eaSJes Sorensenif test "$vnc" = "yes" ; then 66532f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 66542f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 6655efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 6656821601eaSJes Sorensenfi 6657e37630caSaliguoriecho "xen support $xen" 66583996e85cSPaul Durrantif test "$xen" = "yes" ; then 66593996e85cSPaul Durrant echo "xen ctrl version $xen_ctrl_version" 66603996e85cSPaul Durrantfi 66612e4d9fb1Saurel32echo "brlapi support $brlapi" 6662a25dba17SJuan Quintelaecho "Documentation $docs" 666340d6444eSAvi Kivityecho "PIE $pie" 66648a16d273Sthsecho "vde support $vde" 666558952137SVincenzo Maffioneecho "netmap support $netmap" 66665c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 6667c10dd856SAarushi Mehtaecho "Linux io_uring support $linux_io_uring" 6668758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 666977755340Sthsecho "Install blobs $blobs" 6670b31a0277SJuan Quintelaecho "KVM support $kvm" 6671b0cb0a66SVincent Palatinecho "HAX support $hax" 6672c97d6d2cSSergio Andres Gomez Del Realecho "HVF support $hvf" 6673d661d9a4SJustin Terry (VM)echo "WHPX support $whpx" 6674b3f6ea7eSPaolo Bonziniecho "TCG support $tcg" 6675b3f6ea7eSPaolo Bonziniif test "$tcg" = "yes" ; then 6676b3f6ea7eSPaolo Bonzini echo "TCG debug enabled $debug_tcg" 66779195b2c2SStefan Weil echo "TCG interpreter $tcg_interpreter" 6678b3f6ea7eSPaolo Bonzinifi 66795a22ab71SYang Zhongecho "malloc trim support $malloc_trim" 6680b3f6ea7eSPaolo Bonziniecho "RDMA support $rdma" 668121ab34c9SMarcel Apfelbaumecho "PVRDMA support $pvrdma" 6682f652e6afSaurel32echo "fdt support $fdt" 6683a40161cbSPaolo Bonziniecho "membarrier $membarrier" 6684ceb42de8Saliguoriecho "preadv support $preadv" 66855f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 6686e78815a5SAndreas Färberecho "madvise $madvise" 6687e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 66889bc5a719SAndreas Gustafssonecho "posix_memalign $posix_memalign" 668947e98658SCorey Bryantecho "libcap-ng support $cap_ng" 6690d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 6691042cea27SGongleiecho "vhost-crypto support $vhost_crypto" 66925e9be92dSNicholas Bellingerecho "vhost-scsi support $vhost_scsi" 6693fc0b9b0eSStefan Hajnocziecho "vhost-vsock support $vhost_vsock" 6694e6a74868SMarc-André Lureauecho "vhost-user support $vhost_user" 669598fc1adaSDr. David Alan Gilbertecho "vhost-user-fs support $vhost_user_fs" 66965b808275SLluís Vilanovaecho "Trace backends $trace_backends" 6697713572a7SMarc-André Lureauif have_backend "simple"; then 66989410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 6699e00e36fbSStefan Weilfi 670089138857SStefan Weilecho "spice support $spice $(echo_version $spice $spice_protocol_version/$spice_server_version)" 6701f27aaf4bSChristian Brunnerecho "rbd support $rbd" 6702dce512deSChristoph Hellwigecho "xfsctl support $xfs" 67037b02f544SMarc-André Lureauecho "smartcard support $smartcard" 67042b2325ffSGerd Hoffmannecho "libusb $libusb" 670569354a83SHans de Goedeecho "usb net redir $usb_redir" 6706da076ffeSGerd Hoffmannecho "OpenGL support $opengl" 6707014cb152SGerd Hoffmannecho "OpenGL dmabufs $opengl_dmabuf" 6708c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 67096542aa9cSPeter Lievenecho "libnfs support $libnfs" 6710d138cee9SMichael Rothecho "build guest agent $guest_agent" 6711d9840e25STomoki Sekiyamaecho "QGA VSS support $guest_agent_with_vss" 671250cbebb9SMichael Rothecho "QGA w32 disk info $guest_agent_ntddscsi" 67134c875d89SMichael Rothecho "QGA MSI support $guest_agent_msi" 6714f794573eSEduardo Otuboecho "seccomp support $seccomp" 67157c2acc70SPeter Maydellecho "coroutine backend $coroutine" 671670c60c08SStefan Hajnocziecho "coroutine pool $coroutine_pool" 67177d992e4dSPeter Lievenecho "debug stack usage $debug_stack_usage" 6718ba59fb77SPaolo Bonziniecho "mutex debugging $debug_mutex" 6719f0d92b56SLongpeng(Mike)echo "crypto afalg $crypto_afalg" 6720eb100396SBharata B Raoecho "GlusterFS support $glusterfs" 67211d728c39SBlue Swirlecho "gcov $gcov_tool" 67221d728c39SBlue Swirlecho "gcov enabled $gcov" 6723ab214c29SStefan Bergerecho "TPM support $tpm" 6724b10d49d7SPino Toscanoecho "libssh support $libssh" 67253556c233SPaolo Bonziniecho "QOM debugging $qom_cast_debug" 6726ed1701c6SDr. David Alan Gilbertecho "Live block migration $live_block_migration" 6727607dacd0Sqiaonuohanecho "lzo support $lzo" 6728607dacd0Sqiaonuohanecho "snappy support $snappy" 67296b383c08SPeter Wuecho "bzip2 support $bzip2" 673083bc1f97SJulio Faraccoecho "lzfse support $lzfse" 67313a678481SJuan Quintelaecho "zstd support $zstd" 6732a99d57bbSWanlong Gaoecho "NUMA host support $numa" 6733ed279a06SKlim Kireevecho "libxml2 $libxml2" 67342847b469SFam Zhengecho "tcmalloc support $tcmalloc" 67357b01cb97SAlexandre Derumierecho "jemalloc support $jemalloc" 673699f2dbd3SLiang Liecho "avx2 optimization $avx2_opt" 67376b8cd447SRobert Hooecho "avx512f optimization $avx512f_opt" 6738a6b1d4c0SChanglong Xieecho "replication support $replication" 6739da92c3ffSAshish Mittalecho "VxHS block device $vxhs" 67402f740136SJeff Codyecho "bochs support $bochs" 67412f740136SJeff Codyecho "cloop support $cloop" 67422f740136SJeff Codyecho "dmg support $dmg" 67432f740136SJeff Codyecho "qcow v1 support $qcow1" 67442f740136SJeff Codyecho "vdi support $vdi" 67452f740136SJeff Codyecho "vvfat support $vvfat" 67462f740136SJeff Codyecho "qed support $qed" 67472f740136SJeff Codyecho "parallels support $parallels" 67482f740136SJeff Codyecho "sheepdog support $sheepdog" 67498ca80760SRichard Hendersonecho "capstone $capstone" 675017824406SJunyan Heecho "libpmem support $libpmem" 67513efac6ebSTomáš Golembiovskýecho "libudev $libudev" 6752f3494749SPaolo Bonziniecho "default devices $default_devices" 675340e8c6f4SAlex Bennéeecho "plugin support $plugins" 6754adc28027SAlexander Bulekovecho "fuzzing support $fuzzing" 6755f48e590aSAlex Bennéeecho "gdb $gdb_bin" 675667b915a5Sbellard 6757898be3e0SPeter Maydellif test "$supported_cpu" = "no"; then 6758898be3e0SPeter Maydell echo 6759898be3e0SPeter Maydell echo "WARNING: SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!" 6760898be3e0SPeter Maydell echo 6761898be3e0SPeter Maydell echo "CPU host architecture $cpu support is not currently maintained." 6762898be3e0SPeter Maydell echo "The QEMU project intends to remove support for this host CPU in" 6763898be3e0SPeter Maydell echo "a future release if nobody volunteers to maintain it and to" 6764898be3e0SPeter Maydell echo "provide a build host for our continuous integration setup." 6765898be3e0SPeter Maydell echo "configure has succeeded and you can continue to build, but" 6766898be3e0SPeter Maydell echo "if you care about QEMU on this platform you should contact" 6767898be3e0SPeter Maydell echo "us upstream at qemu-devel@nongnu.org." 6768898be3e0SPeter Maydellfi 6769898be3e0SPeter Maydell 6770898be3e0SPeter Maydellif test "$supported_os" = "no"; then 6771898be3e0SPeter Maydell echo 6772898be3e0SPeter Maydell echo "WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!" 6773898be3e0SPeter Maydell echo 6774c50126aaSPeter Maydell echo "Host OS $targetos support is not currently maintained." 6775c50126aaSPeter Maydell echo "The QEMU project intends to remove support for this host OS in" 6776898be3e0SPeter Maydell echo "a future release if nobody volunteers to maintain it and to" 6777898be3e0SPeter Maydell echo "provide a build host for our continuous integration setup." 6778898be3e0SPeter Maydell echo "configure has succeeded and you can continue to build, but" 6779898be3e0SPeter Maydell echo "if you care about QEMU on this platform you should contact" 6780898be3e0SPeter Maydell echo "us upstream at qemu-devel@nongnu.org." 6781898be3e0SPeter Maydellfi 6782898be3e0SPeter Maydell 678398ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 678497a847bcSbellard 6785dbd99ae3SStefan Weilecho "# Automatically generated by configure - do not modify" >config-all-disas.mak 6786dbd99ae3SStefan Weil 678798ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 678898ec69acSJuan Quintelaecho >> $config_host_mak 678998ec69acSJuan Quintela 6790e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 679199d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 679299d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 67933aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 67948bf188aaSMichael Tokarevecho "libexecdir=$libexecdir" >> $config_host_mak 67950f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 679699d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 679799d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 679822d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 67999afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 68003d5eecabSGerd Hoffmannecho "qemu_firmwarepath=$firmwarepath" >> $config_host_mak 68019afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 6802e26110cfSFam Zhengecho "qemu_moddir=$qemu_moddir" >> $config_host_mak 68035a699bbbSLaszlo Ersekif test "$mingw32" = "no" ; then 6804785c23aeSLuiz Capitulino echo "qemu_localstatedir=$local_statedir" >> $config_host_mak 68055a699bbbSLaszlo Ersekfi 6806f354b1a1SMichael Tokarevecho "qemu_helperdir=$libexecdir" >> $config_host_mak 6807834574eaSAnthony Liguoriecho "qemu_localedir=$qemu_localedir" >> $config_host_mak 6808a8260d38SDaniel P. Berrangéecho "qemu_icondir=$qemu_icondir" >> $config_host_mak 680967ea9546SDaniel P. Berrangéecho "qemu_desktopdir=$qemu_desktopdir" >> $config_host_mak 681002f9135bSDaniel P. Berrangéecho "libs_cpu=$libs_cpu" >> $config_host_mak 6811f544a488SPaolo Bonziniecho "libs_softmmu=$libs_softmmu" >> $config_host_mak 6812cc84d63aSDaniel P. Berrangeecho "GIT=$git" >> $config_host_mak 6813aef45d51SDaniel P. Berrangeecho "GIT_SUBMODULES=$git_submodules" >> $config_host_mak 6814f62bbee5SDaniel P. Berrangeecho "GIT_UPDATE=$git_update" >> $config_host_mak 6815804edf29SJuan Quintela 681698ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 6817727e5283SPaolo Bonzini 6818f3494749SPaolo Bonziniif test "$default_devices" = "yes" ; then 6819f3494749SPaolo Bonzini echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak 6820f3494749SPaolo Bonzinielse 6821f3494749SPaolo Bonzini echo "CONFIG_MINIKCONF_MODE=--allnoconfig" >> $config_host_mak 6822f3494749SPaolo Bonzinifi 6823f8393946Saurel32if test "$debug_tcg" = "yes" ; then 68242358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 6825f8393946Saurel32fi 68261625af87Saliguoriif test "$strip_opt" = "yes" ; then 682752ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 68281625af87Saliguorifi 68297d13299dSbellardif test "$bigendian" = "yes" ; then 6830e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 683197a847bcSbellardfi 683267b915a5Sbellardif test "$mingw32" = "yes" ; then 683398ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 683489138857SStefan Weil rc_version=$(cat $source_path/VERSION) 68359fe6de94SBlue Swirl version_major=${rc_version%%.*} 68369fe6de94SBlue Swirl rc_version=${rc_version#*.} 68379fe6de94SBlue Swirl version_minor=${rc_version%%.*} 68389fe6de94SBlue Swirl rc_version=${rc_version#*.} 68399fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 68409fe6de94SBlue Swirl version_micro=0 68419fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 68429fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 6843d9840e25STomoki Sekiyama if test "$guest_agent_with_vss" = "yes" ; then 6844d9840e25STomoki Sekiyama echo "CONFIG_QGA_VSS=y" >> $config_host_mak 6845f33ca81fSMichael Roth echo "QGA_VSS_PROVIDER=$qga_vss_provider" >> $config_host_mak 6846d9840e25STomoki Sekiyama echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak 6847d9840e25STomoki Sekiyama fi 684850cbebb9SMichael Roth if test "$guest_agent_ntddscsi" = "yes" ; then 684976dc75caSTomáš Golembiovský echo "CONFIG_QGA_NTDDSCSI=y" >> $config_host_mak 685050cbebb9SMichael Roth fi 68511a34904eSMichael Roth if test "$guest_agent_msi" = "yes"; then 68529dacf32dSYossi Hindin echo "QEMU_GA_MSI_ENABLED=yes" >> $config_host_mak 68539dacf32dSYossi Hindin echo "QEMU_GA_MSI_MINGW_DLL_PATH=${QEMU_GA_MSI_MINGW_DLL_PATH}" >> $config_host_mak 68549dacf32dSYossi Hindin echo "QEMU_GA_MSI_WITH_VSS=${QEMU_GA_MSI_WITH_VSS}" >> $config_host_mak 68559dacf32dSYossi Hindin echo "QEMU_GA_MSI_ARCH=${QEMU_GA_MSI_ARCH}" >> $config_host_mak 68569dacf32dSYossi Hindin echo "QEMU_GA_MANUFACTURER=${QEMU_GA_MANUFACTURER}" >> $config_host_mak 68579dacf32dSYossi Hindin echo "QEMU_GA_DISTRO=${QEMU_GA_DISTRO}" >> $config_host_mak 68589dacf32dSYossi Hindin echo "QEMU_GA_VERSION=${QEMU_GA_VERSION}" >> $config_host_mak 68599dacf32dSYossi Hindin fi 6860210fa556Spbrookelse 686135f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 6862210fa556Spbrookfi 6863128ab2ffSblueswir1 6864dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 6865dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 6866dffcb71cSMark McLoughlinfi 6867dffcb71cSMark McLoughlin 686883fb7adfSbellardif test "$darwin" = "yes" ; then 686998ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 687083fb7adfSbellardfi 6871b29fe3edSmalc 6872ec530c81Sbellardif test "$solaris" = "yes" ; then 687398ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 6874ec530c81Sbellardfi 6875179cf400SAndreas Färberif test "$haiku" = "yes" ; then 6876179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 6877179cf400SAndreas Färberfi 687897a847bcSbellardif test "$static" = "yes" ; then 687998ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 688097a847bcSbellardfi 68811ba16968SStefan Weilif test "$profiler" = "yes" ; then 68822358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 688305c2a3e7Sbellardfi 6884c932ce31SPaolo Bonziniif test "$want_tools" = "yes" ; then 6885c932ce31SPaolo Bonzini echo "CONFIG_TOOLS=y" >> $config_host_mak 6886c932ce31SPaolo Bonzinifi 6887675b9b53SMarc-André Lureauif test "$slirp" != "no"; then 688898ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 6889e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 6890675b9b53SMarc-André Lureau echo "SLIRP_CFLAGS=$slirp_cflags" >> $config_host_mak 6891675b9b53SMarc-André Lureau echo "SLIRP_LIBS=$slirp_libs" >> $config_host_mak 6892675b9b53SMarc-André Lureaufi 68937c57bdd8SMarc-André Lureauif [ "$slirp" = "git" -o "$slirp" = "internal" ]; then 68943b8593eeSMarkus Armbruster echo "config-host.h: slirp/all" >> $config_host_mak 6895c20709aaSbellardfi 68968a16d273Sthsif test "$vde" = "yes" ; then 689798ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 6898e2ad6f16SFam Zheng echo "VDE_LIBS=$vde_libs" >> $config_host_mak 68998a16d273Sthsfi 690058952137SVincenzo Maffioneif test "$netmap" = "yes" ; then 690158952137SVincenzo Maffione echo "CONFIG_NETMAP=y" >> $config_host_mak 690258952137SVincenzo Maffionefi 6903015a33bdSGongleiif test "$l2tpv3" = "yes" ; then 6904015a33bdSGonglei echo "CONFIG_L2TPV3=y" >> $config_host_mak 6905015a33bdSGongleifi 69064cc600d2SPaolo Bonziniif test "$gprof" = "yes" ; then 69074cc600d2SPaolo Bonzini echo "CONFIG_GPROF=y" >> $config_host_mak 69084cc600d2SPaolo Bonzinifi 690947e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 6910a358bca2SPaolo Bonzini echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak 691147e98658SCorey Bryantfi 69122358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 69130c58ac1cSmalcfor drv in $audio_drv_list; do 69141ef1ec2aSGerd Hoffmann def=CONFIG_AUDIO_$(echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]') 6915ce3dc033SGerd Hoffmann case "$drv" in 6916051c7d5cSGerd Hoffmann alsa | oss | pa | sdl) 6917ce3dc033SGerd Hoffmann echo "$def=m" >> $config_host_mak ;; 6918ce3dc033SGerd Hoffmann *) 6919ce3dc033SGerd Hoffmann echo "$def=y" >> $config_host_mak ;; 6920ce3dc033SGerd Hoffmann esac 69210c58ac1cSmalcdone 6922b1149911SFam Zhengecho "ALSA_LIBS=$alsa_libs" >> $config_host_mak 6923b1149911SFam Zhengecho "PULSE_LIBS=$pulse_libs" >> $config_host_mak 6924b1149911SFam Zhengecho "COREAUDIO_LIBS=$coreaudio_libs" >> $config_host_mak 6925b1149911SFam Zhengecho "DSOUND_LIBS=$dsound_libs" >> $config_host_mak 6926b1149911SFam Zhengecho "OSS_LIBS=$oss_libs" >> $config_host_mak 69272e445703SGeoffrey McRaeecho "JACK_LIBS=$jack_libs" >> $config_host_mak 6928d5631638Smalcif test "$audio_win_int" = "yes" ; then 6929d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 6930d5631638Smalcfi 6931b64ec4e4SFam Zhengecho "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak 6932b64ec4e4SFam Zhengecho "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak 6933821601eaSJes Sorensenif test "$vnc" = "yes" ; then 6934821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 6935821601eaSJes Sorensenfi 69362f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 693798ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 69382f9606b3Saliguorifi 6939821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 69402f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 69412f6f5c7aSCorentin Charyfi 6942821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 6943efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 6944efe556adSCorentin Charyfi 69456a021536SGerd Hoffmannif test "$xkbcommon" = "yes" ; then 69466a021536SGerd Hoffmann echo "XKBCOMMON_CFLAGS=$xkbcommon_cflags" >> $config_host_mak 69476a021536SGerd Hoffmann echo "XKBCOMMON_LIBS=$xkbcommon_libs" >> $config_host_mak 69486a021536SGerd Hoffmannfi 6949dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 6950dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 6951dce512deSChristoph Hellwigfi 695289138857SStefan Weilqemu_version=$(head $source_path/VERSION) 695398ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 69542358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 695598ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 69562b1f35b9SAlex Bennéeecho "TARGET_DIRS=$target_list" >> $config_host_mak 6957a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 695898ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 6959cc8ae6deSpbrookfi 696017969268SFam Zhengif test "$modules" = "yes"; then 6961e26110cfSFam Zheng # $shacmd can generate a hash started with digit, which the compiler doesn't 6962e26110cfSFam Zheng # like as an symbol. So prefix it with an underscore 696389138857SStefan Weil echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak 696417969268SFam Zheng echo "CONFIG_MODULES=y" >> $config_host_mak 696517969268SFam Zhengfi 6966bd83c861SChristian Ehrhardtif test "$module_upgrades" = "yes"; then 6967bd83c861SChristian Ehrhardt echo "CONFIG_MODULE_UPGRADES=y" >> $config_host_mak 6968bd83c861SChristian Ehrhardtfi 6969e633a5c6SEric Blakeif test "$have_x11" = "yes" && test "$need_x11" = "yes"; then 69708781595bSGerd Hoffmann echo "CONFIG_X11=y" >> $config_host_mak 69718781595bSGerd Hoffmann echo "X11_CFLAGS=$x11_cflags" >> $config_host_mak 69728781595bSGerd Hoffmann echo "X11_LIBS=$x11_libs" >> $config_host_mak 69738781595bSGerd Hoffmannfi 69741ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 697596400a14SGerd Hoffmann echo "CONFIG_SDL=m" >> $config_host_mak 69768ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 69778ecc89f6SFam Zheng echo "SDL_LIBS=$sdl_libs" >> $config_host_mak 6978a442fe2fSDaniel P. Berrangé if test "$sdl_image" = "yes" ; then 6979a442fe2fSDaniel P. Berrangé echo "CONFIG_SDL_IMAGE=y" >> $config_host_mak 6980a442fe2fSDaniel P. Berrangé fi 698149ecc3faSbellardfi 698249ecc3faSbellardif test "$cocoa" = "yes" ; then 698398ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 698449ecc3faSbellardfi 6985e08bb301SSamuel Thibaultif test "$iconv" = "yes" ; then 6986e08bb301SSamuel Thibault echo "CONFIG_ICONV=y" >> $config_host_mak 6987e08bb301SSamuel Thibault echo "ICONV_CFLAGS=$iconv_cflags" >> $config_host_mak 6988e08bb301SSamuel Thibault echo "ICONV_LIBS=$iconv_lib" >> $config_host_mak 6989e08bb301SSamuel Thibaultfi 69904d3b6f6eSbalrogif test "$curses" = "yes" ; then 69912373f7d5SGerd Hoffmann echo "CONFIG_CURSES=m" >> $config_host_mak 69922373f7d5SGerd Hoffmann echo "CURSES_CFLAGS=$curses_inc" >> $config_host_mak 69932373f7d5SGerd Hoffmann echo "CURSES_LIBS=$curses_lib" >> $config_host_mak 6994ab4e5602SJan Kiszkafi 6995099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 69962358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 6997099d6b0fSRiku Voipiofi 699840ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 699940ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 700040ff6d7eSKevin Wolffi 70013ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 70022358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 70033ce34dfbSvibisreenivasanfi 7004c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 7005c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 7006c2882b96SRiku Voipiofi 7007751bcc39SMarc-André Lureauif test "$memfd" = "yes" ; then 7008751bcc39SMarc-André Lureau echo "CONFIG_MEMFD=y" >> $config_host_mak 7009751bcc39SMarc-André Lureaufi 7010955727d2SCortland Tölvaif test "$have_usbfs" = "yes" ; then 7011955727d2SCortland Tölva echo "CONFIG_USBFS=y" >> $config_host_mak 7012955727d2SCortland Tölvafi 7013d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 7014d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 7015d0927938SUlrich Hechtfi 70163d4fa43eSKusanagi Kouichiif test "$fallocate_punch_hole" = "yes" ; then 70173d4fa43eSKusanagi Kouichi echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak 70183d4fa43eSKusanagi Kouichifi 7019b953f075SDenis V. Lunevif test "$fallocate_zero_range" = "yes" ; then 7020b953f075SDenis V. Lunev echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak 7021b953f075SDenis V. Lunevfi 7022ed911435SKevin Wolfif test "$posix_fallocate" = "yes" ; then 7023ed911435SKevin Wolf echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak 7024ed911435SKevin Wolffi 7025c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 7026c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 7027c727f47dSPeter Maydellfi 7028dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 7029dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 7030dace20dcSPeter Maydellfi 7031d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 7032d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 7033d0927938SUlrich Hechtfi 70344e0c6529SAlex Blighif test "$ppoll" = "yes" ; then 70354e0c6529SAlex Bligh echo "CONFIG_PPOLL=y" >> $config_host_mak 70364e0c6529SAlex Blighfi 7037cd758dd0SAlex Blighif test "$prctl_pr_set_timerslack" = "yes" ; then 7038cd758dd0SAlex Bligh echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak 7039cd758dd0SAlex Blighfi 70403b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 70413b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 70423b6edd16SPeter Maydellfi 70433b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 70443b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 70453b6edd16SPeter Maydellfi 7046a8fd1abaSPeter Maydellif test "$sendfile" = "yes" ; then 7047a8fd1abaSPeter Maydell echo "CONFIG_SENDFILE=y" >> $config_host_mak 7048a8fd1abaSPeter Maydellfi 704951834341SRiku Voipioif test "$timerfd" = "yes" ; then 705051834341SRiku Voipio echo "CONFIG_TIMERFD=y" >> $config_host_mak 705151834341SRiku Voipiofi 70529af5c906SRiku Voipioif test "$setns" = "yes" ; then 70539af5c906SRiku Voipio echo "CONFIG_SETNS=y" >> $config_host_mak 70549af5c906SRiku Voipiofi 705538860a03SAleksandar Markovicif test "$clock_adjtime" = "yes" ; then 705638860a03SAleksandar Markovic echo "CONFIG_CLOCK_ADJTIME=y" >> $config_host_mak 705738860a03SAleksandar Markovicfi 70585a03cd00SAleksandar Markovicif test "$syncfs" = "yes" ; then 70595a03cd00SAleksandar Markovic echo "CONFIG_SYNCFS=y" >> $config_host_mak 70605a03cd00SAleksandar Markovicfi 7061db37dd89SAleksandar Markovicif test "$kcov" = "yes" ; then 7062db37dd89SAleksandar Markovic echo "CONFIG_KCOV=y" >> $config_host_mak 7063db37dd89SAleksandar Markovicfi 70643b3f24adSaurel32if test "$inotify" = "yes" ; then 70652358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 70663b3f24adSaurel32fi 7067c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 7068c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 7069c05c7a73SRiku Voipiofi 7070401bc051SPeter Maydellif test "$sem_timedwait" = "yes" ; then 7071401bc051SPeter Maydell echo "CONFIG_SEM_TIMEDWAIT=y" >> $config_host_mak 7072401bc051SPeter Maydellfi 70735c99fa37SKeno Fischerif test "$strchrnul" = "yes" ; then 70745c99fa37SKeno Fischer echo "HAVE_STRCHRNUL=y" >> $config_host_mak 70755c99fa37SKeno Fischerfi 70768a792b03SJiufei Xueif test "$st_atim" = "yes" ; then 70778a792b03SJiufei Xue echo "HAVE_STRUCT_STAT_ST_ATIM=y" >> $config_host_mak 70788a792b03SJiufei Xuefi 70796ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 70806ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 70816ae9a1f4SJuan Quintelafi 70826ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 70836ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 70846ae9a1f4SJuan Quintelafi 7085769ce76dSAlexander Grafif test "$curl" = "yes" ; then 7086d3399d7cSFam Zheng echo "CONFIG_CURL=m" >> $config_host_mak 7087b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 70886ebc91e5SFam Zheng echo "CURL_LIBS=$curl_libs" >> $config_host_mak 7089769ce76dSAlexander Graffi 70902e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 709198ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 70928eca2889SFam Zheng echo "BRLAPI_LIBS=$brlapi_libs" >> $config_host_mak 70932e4d9fb1Saurel32fi 7094a4ccabcfSAnthony Liguoriif test "$gtk" = "yes" ; then 7095e0fb129cSGerd Hoffmann echo "CONFIG_GTK=m" >> $config_host_mak 7096a4ccabcfSAnthony Liguori echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak 7097014cb152SGerd Hoffmann echo "GTK_LIBS=$gtk_libs" >> $config_host_mak 7098925a0400SGerd Hoffmann if test "$gtk_gl" = "yes" ; then 7099925a0400SGerd Hoffmann echo "CONFIG_GTK_GL=y" >> $config_host_mak 7100925a0400SGerd Hoffmann fi 7101bbbf9bfbSStefan Weilfi 7102f876b765SMarc-André Lureauif test "$gio" = "yes" ; then 7103f876b765SMarc-André Lureau echo "CONFIG_GIO=y" >> $config_host_mak 7104f876b765SMarc-André Lureau echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak 7105f876b765SMarc-André Lureau echo "GIO_LIBS=$gio_libs" >> $config_host_mak 710625a97a56SMarc-André Lureau echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak 7107f876b765SMarc-André Lureaufi 7108a1c5e949SDaniel P. Berrangeecho "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak 7109ddbb0d09SDaniel P. Berrangeif test "$gnutls" = "yes" ; then 7110ddbb0d09SDaniel P. Berrange echo "CONFIG_GNUTLS=y" >> $config_host_mak 7111ddbb0d09SDaniel P. Berrangefi 711291bfcdb0SDaniel P. Berrangeif test "$gcrypt" = "yes" ; then 711391bfcdb0SDaniel P. Berrange echo "CONFIG_GCRYPT=y" >> $config_host_mak 71141f923c70SLongpeng(Mike) if test "$gcrypt_hmac" = "yes" ; then 71151f923c70SLongpeng(Mike) echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak 71161f923c70SLongpeng(Mike) fi 711762893b67SDaniel P. Berrangefi 711891bfcdb0SDaniel P. Berrangeif test "$nettle" = "yes" ; then 711991bfcdb0SDaniel P. Berrange echo "CONFIG_NETTLE=y" >> $config_host_mak 7120becaeb72SRadim Krčmář echo "CONFIG_NETTLE_VERSION_MAJOR=${nettle_version%%.*}" >> $config_host_mak 7121ed754746SDaniel P. Berrangefi 7122e0576942SDaniel P. Berrangéif test "$qemu_private_xts" = "yes" ; then 7123e0576942SDaniel P. Berrangé echo "CONFIG_QEMU_PRIVATE_XTS=y" >> $config_host_mak 7124e0576942SDaniel P. Berrangéfi 71259a2fd434SDaniel P. Berrangeif test "$tasn1" = "yes" ; then 71269a2fd434SDaniel P. Berrange echo "CONFIG_TASN1=y" >> $config_host_mak 71279a2fd434SDaniel P. Berrangefi 71288953caf3SDaniel P. Berrangeif test "$auth_pam" = "yes" ; then 71298953caf3SDaniel P. Berrange echo "CONFIG_AUTH_PAM=y" >> $config_host_mak 71308953caf3SDaniel P. Berrangefi 7131559607eaSDaniel P. Berrangeif test "$have_ifaddrs_h" = "yes" ; then 7132559607eaSDaniel P. Berrange echo "HAVE_IFADDRS_H=y" >> $config_host_mak 7133559607eaSDaniel P. Berrangefi 71346b39b063SEric Blakeif test "$have_broken_size_max" = "yes" ; then 71356b39b063SEric Blake echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak 71366b39b063SEric Blakefi 7137277abf15SJan Vesely 7138277abf15SJan Vesely# Work around a system header bug with some kernel/XFS header 7139277abf15SJan Vesely# versions where they both try to define 'struct fsxattr': 7140277abf15SJan Vesely# xfs headers will not try to redefine structs from linux headers 7141277abf15SJan Vesely# if this macro is set. 7142277abf15SJan Veselyif test "$have_fsxattr" = "yes" ; then 7143277abf15SJan Vesely echo "HAVE_FSXATTR=y" >> $config_host_mak 7144277abf15SJan Veselyfi 71451efad060SFam Zhengif test "$have_copy_file_range" = "yes" ; then 71461efad060SFam Zheng echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak 71471efad060SFam Zhengfi 7148bbbf9bfbSStefan Weilif test "$vte" = "yes" ; then 7149bbbf9bfbSStefan Weil echo "CONFIG_VTE=y" >> $config_host_mak 7150a4ccabcfSAnthony Liguori echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak 7151e0fb129cSGerd Hoffmann echo "VTE_LIBS=$vte_libs" >> $config_host_mak 7152a4ccabcfSAnthony Liguorifi 71539d9e1521SGerd Hoffmannif test "$virglrenderer" = "yes" ; then 71549d9e1521SGerd Hoffmann echo "CONFIG_VIRGL=y" >> $config_host_mak 71559d9e1521SGerd Hoffmann echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak 71569d9e1521SGerd Hoffmann echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak 71579d9e1521SGerd Hoffmannfi 7158e37630caSaliguoriif test "$xen" = "yes" ; then 71596dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 7160d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 7161e37630caSaliguorifi 71625c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 71635c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 71645c6c3a6cSChristoph Hellwigfi 7165c10dd856SAarushi Mehtaif test "$linux_io_uring" = "yes" ; then 7166c10dd856SAarushi Mehta echo "CONFIG_LINUX_IO_URING=y" >> $config_host_mak 7167c10dd856SAarushi Mehta echo "LINUX_IO_URING_CFLAGS=$linux_io_uring_cflags" >> $config_host_mak 7168c10dd856SAarushi Mehta echo "LINUX_IO_URING_LIBS=$linux_io_uring_libs" >> $config_host_mak 7169c10dd856SAarushi Mehtafi 7170758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 7171758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 7172758e8e38SVenkateswararao Jujjuri (JV)fi 71734f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 71744f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 71754f26f2b6SAvi Kivityfi 7176983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 7177758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 7178758e8e38SVenkateswararao Jujjuri (JV)fi 7179fe8fc5aeSPaolo Bonziniif test "$mpath" = "yes" ; then 7180fe8fc5aeSPaolo Bonzini echo "CONFIG_MPATH=y" >> $config_host_mak 71811b0578f5SMurilo Opsfelder Araujo if test "$mpathpersist_new_api" = "yes"; then 71821b0578f5SMurilo Opsfelder Araujo echo "CONFIG_MPATH_NEW_API=y" >> $config_host_mak 71831b0578f5SMurilo Opsfelder Araujo fi 7184fe8fc5aeSPaolo Bonzinifi 71855e9be92dSNicholas Bellingerif test "$vhost_scsi" = "yes" ; then 71865e9be92dSNicholas Bellinger echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak 71875e9be92dSNicholas Bellingerfi 7188af3bba76SPaolo Bonziniif test "$vhost_net" = "yes" ; then 7189af3bba76SPaolo Bonzini echo "CONFIG_VHOST_NET=y" >> $config_host_mak 7190af3bba76SPaolo Bonzinifi 7191af3bba76SPaolo Bonziniif test "$vhost_net_user" = "yes" ; then 719256f41de7SPaolo Bonzini echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak 719303ce5744SNikolay Nikolaevfi 7194042cea27SGongleiif test "$vhost_crypto" = "yes" ; then 7195042cea27SGonglei echo "CONFIG_VHOST_CRYPTO=y" >> $config_host_mak 7196042cea27SGongleifi 7197fc0b9b0eSStefan Hajnocziif test "$vhost_vsock" = "yes" ; then 7198fc0b9b0eSStefan Hajnoczi echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak 7199fc0b9b0eSStefan Hajnoczifi 7200299e6f19SPaolo Bonziniif test "$vhost_kernel" = "yes" ; then 7201299e6f19SPaolo Bonzini echo "CONFIG_VHOST_KERNEL=y" >> $config_host_mak 7202299e6f19SPaolo Bonzinifi 7203e6a74868SMarc-André Lureauif test "$vhost_user" = "yes" ; then 7204e6a74868SMarc-André Lureau echo "CONFIG_VHOST_USER=y" >> $config_host_mak 7205e6a74868SMarc-André Lureaufi 720698fc1adaSDr. David Alan Gilbertif test "$vhost_user_fs" = "yes" ; then 720798fc1adaSDr. David Alan Gilbert echo "CONFIG_VHOST_USER_FS=y" >> $config_host_mak 720898fc1adaSDr. David Alan Gilbertfi 720977755340Sthsif test "$blobs" = "yes" ; then 721098ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 721177755340Sthsfi 7212bf9298b9Saliguoriif test "$iovec" = "yes" ; then 72132358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 7214bf9298b9Saliguorifi 7215ceb42de8Saliguoriif test "$preadv" = "yes" ; then 72162358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 7217ceb42de8Saliguorifi 7218e3971d61SPhilippe Mathieu-Daudéif test "$fdt" != "no" ; then 72193f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 7220f652e6afSaurel32fi 7221a40161cbSPaolo Bonziniif test "$membarrier" = "yes" ; then 7222a40161cbSPaolo Bonzini echo "CONFIG_MEMBARRIER=y" >> $config_host_mak 7223a40161cbSPaolo Bonzinifi 7224dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 7225dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 7226dcc38d1cSMarcelo Tosattifi 7227d339d766SRichard W.M. Jonesif test "$optreset" = "yes" ; then 7228d339d766SRichard W.M. Jones echo "HAVE_OPTRESET=y" >> $config_host_mak 7229d339d766SRichard W.M. Jonesfi 7230b3f6ea7eSPaolo Bonziniif test "$tcg" = "yes"; then 7231b3f6ea7eSPaolo Bonzini echo "CONFIG_TCG=y" >> $config_host_mak 72329195b2c2SStefan Weil if test "$tcg_interpreter" = "yes" ; then 72339195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 72349195b2c2SStefan Weil fi 7235b3f6ea7eSPaolo Bonzinifi 72365f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 72375f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 72385f6b9e8fSBlue Swirlfi 7239e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 7240e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 7241e78815a5SAndreas Färberfi 7242e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 7243e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 7244e78815a5SAndreas Färberfi 72459bc5a719SAndreas Gustafssonif test "$posix_memalign" = "yes" ; then 72469bc5a719SAndreas Gustafsson echo "CONFIG_POSIX_MEMALIGN=y" >> $config_host_mak 72479bc5a719SAndreas Gustafssonfi 724897a847bcSbellard 7249cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 7250cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 7251cd4ec0b4SGerd Hoffmannfi 7252cd4ec0b4SGerd Hoffmann 72537b02f544SMarc-André Lureauif test "$smartcard" = "yes" ; then 72547b02f544SMarc-André Lureau echo "CONFIG_SMARTCARD=y" >> $config_host_mak 72557b62bf5aSFam Zheng echo "SMARTCARD_CFLAGS=$libcacard_cflags" >> $config_host_mak 72567b62bf5aSFam Zheng echo "SMARTCARD_LIBS=$libcacard_libs" >> $config_host_mak 7257111a38b0SRobert Relyeafi 7258111a38b0SRobert Relyea 72592b2325ffSGerd Hoffmannif test "$libusb" = "yes" ; then 72602b2325ffSGerd Hoffmann echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak 7261b878b652SFam Zheng echo "LIBUSB_CFLAGS=$libusb_cflags" >> $config_host_mak 7262b878b652SFam Zheng echo "LIBUSB_LIBS=$libusb_libs" >> $config_host_mak 72632b2325ffSGerd Hoffmannfi 72642b2325ffSGerd Hoffmann 726569354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 726669354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 7267cc7923fcSFam Zheng echo "USB_REDIR_CFLAGS=$usb_redir_cflags" >> $config_host_mak 7268cc7923fcSFam Zheng echo "USB_REDIR_LIBS=$usb_redir_libs" >> $config_host_mak 726969354a83SHans de Goedefi 727069354a83SHans de Goede 7271da076ffeSGerd Hoffmannif test "$opengl" = "yes" ; then 7272da076ffeSGerd Hoffmann echo "CONFIG_OPENGL=y" >> $config_host_mak 7273da076ffeSGerd Hoffmann echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak 7274014cb152SGerd Hoffmann if test "$opengl_dmabuf" = "yes" ; then 7275014cb152SGerd Hoffmann echo "CONFIG_OPENGL_DMABUF=y" >> $config_host_mak 7276014cb152SGerd Hoffmann fi 727720ff075bSMichael Wallefi 727820ff075bSMichael Walle 7279d52c454aSMarc-André Lureauif test "$gbm" = "yes" ; then 7280d52c454aSMarc-André Lureau echo "CONFIG_GBM=y" >> $config_host_mak 7281d52c454aSMarc-André Lureau echo "GBM_LIBS=$gbm_libs" >> $config_host_mak 7282d52c454aSMarc-André Lureau echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak 7283d52c454aSMarc-André Lureaufi 7284d52c454aSMarc-André Lureau 7285d52c454aSMarc-André Lureau 72865a22ab71SYang Zhongif test "$malloc_trim" = "yes" ; then 72875a22ab71SYang Zhong echo "CONFIG_MALLOC_TRIM=y" >> $config_host_mak 72885a22ab71SYang Zhongfi 72895a22ab71SYang Zhong 729099f2dbd3SLiang Liif test "$avx2_opt" = "yes" ; then 729199f2dbd3SLiang Li echo "CONFIG_AVX2_OPT=y" >> $config_host_mak 729299f2dbd3SLiang Lifi 729399f2dbd3SLiang Li 72946b8cd447SRobert Hooif test "$avx512f_opt" = "yes" ; then 72956b8cd447SRobert Hoo echo "CONFIG_AVX512F_OPT=y" >> $config_host_mak 72966b8cd447SRobert Hoofi 72976b8cd447SRobert Hoo 7298607dacd0Sqiaonuohanif test "$lzo" = "yes" ; then 7299607dacd0Sqiaonuohan echo "CONFIG_LZO=y" >> $config_host_mak 7300607dacd0Sqiaonuohanfi 7301607dacd0Sqiaonuohan 7302607dacd0Sqiaonuohanif test "$snappy" = "yes" ; then 7303607dacd0Sqiaonuohan echo "CONFIG_SNAPPY=y" >> $config_host_mak 7304607dacd0Sqiaonuohanfi 7305607dacd0Sqiaonuohan 73066b383c08SPeter Wuif test "$bzip2" = "yes" ; then 73076b383c08SPeter Wu echo "CONFIG_BZIP2=y" >> $config_host_mak 73086b383c08SPeter Wu echo "BZIP2_LIBS=-lbz2" >> $config_host_mak 73096b383c08SPeter Wufi 73106b383c08SPeter Wu 731183bc1f97SJulio Faraccoif test "$lzfse" = "yes" ; then 731283bc1f97SJulio Faracco echo "CONFIG_LZFSE=y" >> $config_host_mak 731383bc1f97SJulio Faracco echo "LZFSE_LIBS=-llzfse" >> $config_host_mak 731483bc1f97SJulio Faraccofi 731583bc1f97SJulio Faracco 73163a678481SJuan Quintelaif test "$zstd" = "yes" ; then 73173a678481SJuan Quintela echo "CONFIG_ZSTD=y" >> $config_host_mak 73183a678481SJuan Quintelafi 73193a678481SJuan Quintela 7320c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 7321d3399d7cSFam Zheng echo "CONFIG_LIBISCSI=m" >> $config_host_mak 73226ebc91e5SFam Zheng echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak 73236ebc91e5SFam Zheng echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak 7324c589b249SRonnie Sahlbergfi 7325c589b249SRonnie Sahlberg 73266542aa9cSPeter Lievenif test "$libnfs" = "yes" ; then 73274be4879fSColin Lord echo "CONFIG_LIBNFS=m" >> $config_host_mak 73284be4879fSColin Lord echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak 73296542aa9cSPeter Lievenfi 73306542aa9cSPeter Lieven 7331f794573eSEduardo Otuboif test "$seccomp" = "yes"; then 7332f794573eSEduardo Otubo echo "CONFIG_SECCOMP=y" >> $config_host_mak 7333c3883e1fSFam Zheng echo "SECCOMP_CFLAGS=$seccomp_cflags" >> $config_host_mak 7334c3883e1fSFam Zheng echo "SECCOMP_LIBS=$seccomp_libs" >> $config_host_mak 7335f794573eSEduardo Otubofi 7336f794573eSEduardo Otubo 733783fb7adfSbellard# XXX: suppress that 73387d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 73392358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 73407d3505c5Sbellardfi 73417d3505c5Sbellard 73424d9310f4SDaniel P. Berrangeif test "$localtime_r" = "yes" ; then 73434d9310f4SDaniel P. Berrange echo "CONFIG_LOCALTIME_R=y" >> $config_host_mak 73444d9310f4SDaniel P. Berrangefi 73453556c233SPaolo Bonziniif test "$qom_cast_debug" = "yes" ; then 73463556c233SPaolo Bonzini echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak 73473556c233SPaolo Bonzinifi 7348f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 7349d3399d7cSFam Zheng echo "CONFIG_RBD=m" >> $config_host_mak 73506ebc91e5SFam Zheng echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak 73516ebc91e5SFam Zheng echo "RBD_LIBS=$rbd_libs" >> $config_host_mak 7352f27aaf4bSChristian Brunnerfi 735320ff6c80SAnthony Liguori 73547c2acc70SPeter Maydellecho "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak 735570c60c08SStefan Hajnocziif test "$coroutine_pool" = "yes" ; then 735670c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak 735770c60c08SStefan Hajnoczielse 735870c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak 735970c60c08SStefan Hajnoczifi 7360d0e2fce5SAneesh Kumar K.V 73617d992e4dSPeter Lievenif test "$debug_stack_usage" = "yes" ; then 73627d992e4dSPeter Lieven echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak 73637d992e4dSPeter Lievenfi 73647d992e4dSPeter Lieven 7365f0d92b56SLongpeng(Mike)if test "$crypto_afalg" = "yes" ; then 7366f0d92b56SLongpeng(Mike) echo "CONFIG_AF_ALG=y" >> $config_host_mak 7367f0d92b56SLongpeng(Mike)fi 7368f0d92b56SLongpeng(Mike) 7369d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 7370d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 7371d2042378SAneesh Kumar K.Vfi 7372d2042378SAneesh Kumar K.V 7373e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 7374e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 7375e06a765eSHarsh Prateek Borafi 7376e06a765eSHarsh Prateek Bora 7377cc6e3ca9SGerd Hoffmannif test "$pragma_diagnostic_available" = "yes" ; then 7378cc6e3ca9SGerd Hoffmann echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak 737906d71fa1SPeter Maydellfi 738006d71fa1SPeter Maydell 73813f4349dcSKevin Wolfif test "$valgrind_h" = "yes" ; then 73823f4349dcSKevin Wolf echo "CONFIG_VALGRIND_H=y" >> $config_host_mak 73833f4349dcSKevin Wolffi 73843f4349dcSKevin Wolf 7385d83414e1SMarc-André Lureauif test "$have_asan_iface_fiber" = "yes" ; then 7386d83414e1SMarc-André Lureau echo "CONFIG_ASAN_IFACE_FIBER=y" >> $config_host_mak 7387d83414e1SMarc-André Lureaufi 7388d83414e1SMarc-André Lureau 73898ab1bf12SLuiz Capitulinoif test "$has_environ" = "yes" ; then 73908ab1bf12SLuiz Capitulino echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak 73918ab1bf12SLuiz Capitulinofi 73928ab1bf12SLuiz Capitulino 739376a347e1SRichard Hendersonif test "$cpuid_h" = "yes" ; then 739476a347e1SRichard Henderson echo "CONFIG_CPUID_H=y" >> $config_host_mak 739576a347e1SRichard Hendersonfi 739676a347e1SRichard Henderson 7397f540166bSRichard Hendersonif test "$int128" = "yes" ; then 7398f540166bSRichard Henderson echo "CONFIG_INT128=y" >> $config_host_mak 7399f540166bSRichard Hendersonfi 7400f540166bSRichard Henderson 74017ebee43eSRichard Hendersonif test "$atomic128" = "yes" ; then 74027ebee43eSRichard Henderson echo "CONFIG_ATOMIC128=y" >> $config_host_mak 74037ebee43eSRichard Hendersonfi 74047ebee43eSRichard Henderson 7405e6cd4bb5SRichard Hendersonif test "$cmpxchg128" = "yes" ; then 7406e6cd4bb5SRichard Henderson echo "CONFIG_CMPXCHG128=y" >> $config_host_mak 7407e6cd4bb5SRichard Hendersonfi 7408e6cd4bb5SRichard Henderson 7409df79b996SRichard Hendersonif test "$atomic64" = "yes" ; then 7410df79b996SRichard Henderson echo "CONFIG_ATOMIC64=y" >> $config_host_mak 7411df79b996SRichard Hendersonfi 7412df79b996SRichard Henderson 7413db8aaae8SRichard Hendersonif test "$attralias" = "yes" ; then 7414db8aaae8SRichard Henderson echo "CONFIG_ATTRIBUTE_ALIAS=y" >> $config_host_mak 7415db8aaae8SRichard Hendersonfi 7416db8aaae8SRichard Henderson 74171e6e9acaSRichard Hendersonif test "$getauxval" = "yes" ; then 74181e6e9acaSRichard Henderson echo "CONFIG_GETAUXVAL=y" >> $config_host_mak 74191e6e9acaSRichard Hendersonfi 74201e6e9acaSRichard Henderson 7421eb100396SBharata B Raoif test "$glusterfs" = "yes" ; then 7422d3399d7cSFam Zheng echo "CONFIG_GLUSTERFS=m" >> $config_host_mak 74236ebc91e5SFam Zheng echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak 74246ebc91e5SFam Zheng echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak 7425eb100396SBharata B Raofi 7426eb100396SBharata B Rao 7427d85fa9ebSJeff Codyif test "$glusterfs_xlator_opt" = "yes" ; then 7428d85fa9ebSJeff Cody echo "CONFIG_GLUSTERFS_XLATOR_OPT=y" >> $config_host_mak 7429d85fa9ebSJeff Codyfi 7430d85fa9ebSJeff Cody 74310c14fb47SBharata B Raoif test "$glusterfs_discard" = "yes" ; then 74320c14fb47SBharata B Rao echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak 74330c14fb47SBharata B Raofi 74340c14fb47SBharata B Rao 7435df3a429aSNiels de Vosif test "$glusterfs_fallocate" = "yes" ; then 7436df3a429aSNiels de Vos echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak 7437df3a429aSNiels de Vosfi 7438df3a429aSNiels de Vos 74397c815372SBharata B Raoif test "$glusterfs_zerofill" = "yes" ; then 74407c815372SBharata B Rao echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak 74417c815372SBharata B Raofi 74427c815372SBharata B Rao 7443e014dbe7SPrasanna Kumar Kaleverif test "$glusterfs_ftruncate_has_stat" = "yes" ; then 7444e014dbe7SPrasanna Kumar Kalever echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak 7445e014dbe7SPrasanna Kumar Kaleverfi 7446e014dbe7SPrasanna Kumar Kalever 74470e3b891fSNiels de Vosif test "$glusterfs_iocb_has_stat" = "yes" ; then 74480e3b891fSNiels de Vos echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak 74490e3b891fSNiels de Vosfi 74500e3b891fSNiels de Vos 7451b10d49d7SPino Toscanoif test "$libssh" = "yes" ; then 7452b10d49d7SPino Toscano echo "CONFIG_LIBSSH=m" >> $config_host_mak 7453b10d49d7SPino Toscano echo "LIBSSH_CFLAGS=$libssh_cflags" >> $config_host_mak 7454b10d49d7SPino Toscano echo "LIBSSH_LIBS=$libssh_libs" >> $config_host_mak 74550a12ec87SRichard W.M. Jonesfi 74560a12ec87SRichard W.M. Jones 7457ed1701c6SDr. David Alan Gilbertif test "$live_block_migration" = "yes" ; then 7458ed1701c6SDr. David Alan Gilbert echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak 7459ed1701c6SDr. David Alan Gilbertfi 7460ed1701c6SDr. David Alan Gilbert 74613b8acc11SPaolo Bonziniif test "$tpm" = "yes"; then 74623cae16dbSPaolo Bonzini echo 'CONFIG_TPM=y' >> $config_host_mak 74633b8acc11SPaolo Bonzinifi 74643b8acc11SPaolo Bonzini 74655b808275SLluís Vilanovaecho "TRACE_BACKENDS=$trace_backends" >> $config_host_mak 74665b808275SLluís Vilanovaif have_backend "nop"; then 74676d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 746822890ab5SPrerna Saxenafi 74695b808275SLluís Vilanovaif have_backend "simple"; then 74706d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 74716d8a764eSLluís # Set the appropriate trace file. 7472953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 74739410b56cSPrerna Saxenafi 7474ed7f5f1dSPaolo Bonziniif have_backend "log"; then 7475ed7f5f1dSPaolo Bonzini echo "CONFIG_TRACE_LOG=y" >> $config_host_mak 74766d8a764eSLluísfi 74775b808275SLluís Vilanovaif have_backend "ust"; then 74786d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 74796d8a764eSLluísfi 74805b808275SLluís Vilanovaif have_backend "dtrace"; then 74816d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 74826d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 74836d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 74846d8a764eSLluís fi 7485c276b17dSDaniel P. Berrangefi 74865b808275SLluís Vilanovaif have_backend "ftrace"; then 7487781e9545SEiichi Tsukata if test "$linux" = "yes" ; then 7488781e9545SEiichi Tsukata echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak 7489781e9545SEiichi Tsukata else 749021684af0SStewart Smith feature_not_found "ftrace(trace backend)" "ftrace requires Linux" 7491781e9545SEiichi Tsukata fi 7492781e9545SEiichi Tsukatafi 74930a852417SPaul Durrantif have_backend "syslog"; then 74940a852417SPaul Durrant if test "$posix_syslog" = "yes" ; then 74950a852417SPaul Durrant echo "CONFIG_TRACE_SYSLOG=y" >> $config_host_mak 74960a852417SPaul Durrant else 74970a852417SPaul Durrant feature_not_found "syslog(trace backend)" "syslog not available" 74980a852417SPaul Durrant fi 74990a852417SPaul Durrantfi 75009410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 75019410b56cSPrerna Saxena 75022da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 75032da776dbSMichael R. Hines echo "CONFIG_RDMA=y" >> $config_host_mak 7504392fb643SFam Zheng echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak 75052da776dbSMichael R. Hinesfi 75062da776dbSMichael R. Hines 750721ab34c9SMarcel Apfelbaumif test "$pvrdma" = "yes" ; then 750821ab34c9SMarcel Apfelbaum echo "CONFIG_PVRDMA=y" >> $config_host_mak 750921ab34c9SMarcel Apfelbaumfi 751021ab34c9SMarcel Apfelbaum 7511575b22b1SLaurent Vivierif test "$have_rtnetlink" = "yes" ; then 7512575b22b1SLaurent Vivier echo "CONFIG_RTNETLINK=y" >> $config_host_mak 7513575b22b1SLaurent Vivierfi 7514575b22b1SLaurent Vivier 7515ed279a06SKlim Kireevif test "$libxml2" = "yes" ; then 7516ed279a06SKlim Kireev echo "CONFIG_LIBXML2=y" >> $config_host_mak 7517ed279a06SKlim Kireev echo "LIBXML2_CFLAGS=$libxml2_cflags" >> $config_host_mak 7518ed279a06SKlim Kireev echo "LIBXML2_LIBS=$libxml2_libs" >> $config_host_mak 7519ed279a06SKlim Kireevfi 7520ed279a06SKlim Kireev 7521a6b1d4c0SChanglong Xieif test "$replication" = "yes" ; then 7522a6b1d4c0SChanglong Xie echo "CONFIG_REPLICATION=y" >> $config_host_mak 7523a6b1d4c0SChanglong Xiefi 7524a6b1d4c0SChanglong Xie 75256a02c806SStefan Hajnocziif test "$have_af_vsock" = "yes" ; then 75266a02c806SStefan Hajnoczi echo "CONFIG_AF_VSOCK=y" >> $config_host_mak 75276a02c806SStefan Hajnoczifi 75286a02c806SStefan Hajnoczi 75294d04351fSChristopher Covingtonif test "$have_sysmacros" = "yes" ; then 75304d04351fSChristopher Covington echo "CONFIG_SYSMACROS=y" >> $config_host_mak 75314d04351fSChristopher Covingtonfi 75324d04351fSChristopher Covington 753349e00a18SAndreas Grapentinif test "$have_static_assert" = "yes" ; then 753449e00a18SAndreas Grapentin echo "CONFIG_STATIC_ASSERT=y" >> $config_host_mak 753549e00a18SAndreas Grapentinfi 753649e00a18SAndreas Grapentin 7537e674605fSTomáš Golembiovskýif test "$have_utmpx" = "yes" ; then 7538e674605fSTomáš Golembiovský echo "HAVE_UTMPX=y" >> $config_host_mak 7539e674605fSTomáš Golembiovskýfi 7540db1ed1abSRichard Hendersonif test "$have_getrandom" = "yes" ; then 7541db1ed1abSRichard Henderson echo "CONFIG_GETRANDOM=y" >> $config_host_mak 7542db1ed1abSRichard Hendersonfi 7543e0580342SKamil Rytarowskiif test "$ivshmem" = "yes" ; then 7544e0580342SKamil Rytarowski echo "CONFIG_IVSHMEM=y" >> $config_host_mak 7545e0580342SKamil Rytarowskifi 7546e219c499SRichard Hendersonif test "$capstone" != "no" ; then 75478ca80760SRichard Henderson echo "CONFIG_CAPSTONE=y" >> $config_host_mak 75488ca80760SRichard Hendersonfi 7549ba59fb77SPaolo Bonziniif test "$debug_mutex" = "yes" ; then 7550ba59fb77SPaolo Bonzini echo "CONFIG_DEBUG_MUTEX=y" >> $config_host_mak 7551ba59fb77SPaolo Bonzinifi 7552e0580342SKamil Rytarowski 75535c312079SDr. David Alan Gilbert# Hold two types of flag: 75545c312079SDr. David Alan Gilbert# CONFIG_THREAD_SETNAME_BYTHREAD - we've got a way of setting the name on 75555c312079SDr. David Alan Gilbert# a thread we have a handle to 7556479a5747SRoman Bolshakov# CONFIG_PTHREAD_SETNAME_NP_W_TID - A way of doing it on a particular 75575c312079SDr. David Alan Gilbert# platform 7558479a5747SRoman Bolshakovif test "$pthread_setname_np_w_tid" = "yes" ; then 75595c312079SDr. David Alan Gilbert echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak 7560479a5747SRoman Bolshakov echo "CONFIG_PTHREAD_SETNAME_NP_W_TID=y" >> $config_host_mak 7561479a5747SRoman Bolshakovelif test "$pthread_setname_np_wo_tid" = "yes" ; then 7562479a5747SRoman Bolshakov echo "CONFIG_THREAD_SETNAME_BYTHREAD=y" >> $config_host_mak 7563479a5747SRoman Bolshakov echo "CONFIG_PTHREAD_SETNAME_NP_WO_TID=y" >> $config_host_mak 75645c312079SDr. David Alan Gilbertfi 75655c312079SDr. David Alan Gilbert 7566da92c3ffSAshish Mittalif test "$vxhs" = "yes" ; then 7567da92c3ffSAshish Mittal echo "CONFIG_VXHS=y" >> $config_host_mak 7568da92c3ffSAshish Mittal echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak 7569da92c3ffSAshish Mittalfi 7570da92c3ffSAshish Mittal 757117824406SJunyan Heif test "$libpmem" = "yes" ; then 757217824406SJunyan He echo "CONFIG_LIBPMEM=y" >> $config_host_mak 757317824406SJunyan Hefi 757417824406SJunyan He 75752f740136SJeff Codyif test "$bochs" = "yes" ; then 75762f740136SJeff Cody echo "CONFIG_BOCHS=y" >> $config_host_mak 75772f740136SJeff Codyfi 75782f740136SJeff Codyif test "$cloop" = "yes" ; then 75792f740136SJeff Cody echo "CONFIG_CLOOP=y" >> $config_host_mak 75802f740136SJeff Codyfi 75812f740136SJeff Codyif test "$dmg" = "yes" ; then 75822f740136SJeff Cody echo "CONFIG_DMG=y" >> $config_host_mak 75832f740136SJeff Codyfi 75842f740136SJeff Codyif test "$qcow1" = "yes" ; then 75852f740136SJeff Cody echo "CONFIG_QCOW1=y" >> $config_host_mak 75862f740136SJeff Codyfi 75872f740136SJeff Codyif test "$vdi" = "yes" ; then 75882f740136SJeff Cody echo "CONFIG_VDI=y" >> $config_host_mak 75892f740136SJeff Codyfi 75902f740136SJeff Codyif test "$vvfat" = "yes" ; then 75912f740136SJeff Cody echo "CONFIG_VVFAT=y" >> $config_host_mak 75922f740136SJeff Codyfi 75932f740136SJeff Codyif test "$qed" = "yes" ; then 75942f740136SJeff Cody echo "CONFIG_QED=y" >> $config_host_mak 75952f740136SJeff Codyfi 75962f740136SJeff Codyif test "$parallels" = "yes" ; then 75972f740136SJeff Cody echo "CONFIG_PARALLELS=y" >> $config_host_mak 75982f740136SJeff Codyfi 75992f740136SJeff Codyif test "$sheepdog" = "yes" ; then 76002f740136SJeff Cody echo "CONFIG_SHEEPDOG=y" >> $config_host_mak 76012f740136SJeff Codyfi 7602adc28027SAlexander Bulekovif test "$fuzzing" = "yes" ; then 7603adc28027SAlexander Bulekov if test "$have_fuzzer" = "yes"; then 7604adc28027SAlexander Bulekov FUZZ_LDFLAGS=" -fsanitize=address,fuzzer" 7605adc28027SAlexander Bulekov FUZZ_CFLAGS=" -fsanitize=address,fuzzer" 7606adc28027SAlexander Bulekov CFLAGS=" -fsanitize=address,fuzzer-no-link" 7607adc28027SAlexander Bulekov else 7608adc28027SAlexander Bulekov error_exit "Your compiler doesn't support -fsanitize=address,fuzzer" 7609adc28027SAlexander Bulekov exit 1 7610adc28027SAlexander Bulekov fi 7611adc28027SAlexander Bulekovfi 76122f740136SJeff Cody 761340e8c6f4SAlex Bennéeif test "$plugins" = "yes" ; then 761440e8c6f4SAlex Bennée echo "CONFIG_PLUGIN=y" >> $config_host_mak 761540e8c6f4SAlex Bennée LIBS="-ldl $LIBS" 761626fffe29SEmilio G. Cota # Copy the export object list to the build dir 761726fffe29SEmilio G. Cota if test "$ld_dynamic_list" = "yes" ; then 761826fffe29SEmilio G. Cota echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak 761926fffe29SEmilio G. Cota ld_symbols=qemu-plugins-ld.symbols 762026fffe29SEmilio G. Cota cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols 762126fffe29SEmilio G. Cota elif test "$ld_exported_symbols_list" = "yes" ; then 762226fffe29SEmilio G. Cota echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak 762326fffe29SEmilio G. Cota ld64_symbols=qemu-plugins-ld64.symbols 762426fffe29SEmilio G. Cota echo "# Automatically generated by configure - do not modify" > $ld64_symbols 762526fffe29SEmilio G. Cota grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' | \ 762626fffe29SEmilio G. Cota sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols 762726fffe29SEmilio G. Cota else 762826fffe29SEmilio G. Cota error_exit \ 762926fffe29SEmilio G. Cota "If \$plugins=yes, either \$ld_dynamic_list or " \ 763026fffe29SEmilio G. Cota "\$ld_exported_symbols_list should have been set to 'yes'." 763126fffe29SEmilio G. Cota fi 763240e8c6f4SAlex Bennéefi 763340e8c6f4SAlex Bennée 7634f48e590aSAlex Bennéeif test -n "$gdb_bin" ; then 7635f48e590aSAlex Bennée echo "HAVE_GDB_BIN=$gdb_bin" >> $config_host_mak 7636f48e590aSAlex Bennéefi 7637f48e590aSAlex Bennée 76385b5e3037SPaolo Bonziniif test "$tcg_interpreter" = "yes"; then 76399edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 76405b5e3037SPaolo Bonzinielif test "$ARCH" = "sparc64" ; then 76419edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 76425b5e3037SPaolo Bonzinielif test "$ARCH" = "s390x" ; then 76439edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 7644e633a5c6SEric Blakeelif test "$ARCH" = "x86_64" || test "$ARCH" = "x32" ; then 76459edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 764640d964b5SRichard Hendersonelif test "$ARCH" = "ppc64" ; then 76479edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" 7648e633a5c6SEric Blakeelif test "$ARCH" = "riscv32" || test "$ARCH" = "riscv64" ; then 7649c4f80543SAlistair Francis QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/riscv $QEMU_INCLUDES" 76505b5e3037SPaolo Bonzinielse 76519edc19c9SMichael S. Tsirkin QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 76525b5e3037SPaolo Bonzinifi 76535b5e3037SPaolo Bonzini 765498ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 765598ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 7656804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 7657804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 76581901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 76591901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 76601901cb14SBradecho "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 766121655882SPaolo Bonziniecho "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak 7662c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 76632eb054c2SPeter Maydellecho "SPHINX_BUILD=$sphinx_build" >> $config_host_mak 7664516e8b7dSPeter Maydellecho "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak 766539d87c8cSAlex Bennéeecho "GENISOIMAGE=$genisoimage" >> $config_host_mak 7666804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 7667a31a8642SMichael S. Tsirkinif $iasl -h > /dev/null 2>&1; then 7668a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_host_mak 7669a31a8642SMichael S. Tsirkinfi 7670804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 767183f73fceSTomoki Sekiyamaecho "CXX=$cxx" >> $config_host_mak 76723c4a4d0dSPeter Maydellecho "OBJCC=$objcc" >> $config_host_mak 7673804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 767445d285abSPeter Maydellecho "ARFLAGS=$ARFLAGS" >> $config_host_mak 7675cdbd727cSRichard Hendersonecho "AS=$as" >> $config_host_mak 76765f6f0e27SRichard Hendersonecho "CCAS=$ccas" >> $config_host_mak 76773dd46c78SBlue Swirlecho "CPP=$cpp" >> $config_host_mak 7678804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 7679804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 76809f81aeb5SAlistair Francisecho "RANLIB=$ranlib" >> $config_host_mak 76814852ee95SStefan Weilecho "NM=$nm" >> $config_host_mak 7682daa79d9aSAlex Bennéeecho "PKG_CONFIG=$pkg_config_exe" >> $config_host_mak 76839fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 7684e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 768546eef33bSBradecho "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak 7686a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 768711cde1c8SBruno Dominguezecho "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak 7688f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 7689e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 7690e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 769180fd48dfSChristian Borntraeger echo "CPP := REAL_CC=\"\$(CPP)\" cgcc" >> $config_host_mak 76922944d742SGerd Hoffmann echo "CXX := REAL_CC=\"\$(CXX)\" cgcc" >> $config_host_mak 7693e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 7694e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 7695e39f0062SPaolo Bonzinifi 76968a99e9a3SPhilippe Mathieu-Daudéecho "QEMU_LDFLAGS=$QEMU_LDFLAGS" >> $config_host_mak 7697db5adeaaSPaolo Bonziniecho "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak 76986969ec6cSJames Clarkeecho "LD_REL_FLAGS=$LD_REL_FLAGS" >> $config_host_mak 7699e57218b6SPeter Maydellecho "LD_I386_EMULATION=$ld_i386_emulation" >> $config_host_mak 770073da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 77013e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 7702409437e1SDaniel P. Berrangeecho "PTHREAD_LIB=$PTHREAD_LIB" >> $config_host_mak 7703804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 770417969268SFam Zhengecho "DSOSUF=$DSOSUF" >> $config_host_mak 770517969268SFam Zhengecho "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak 7706957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 770790246037SDaniel P. Berrangeecho "TASN1_LIBS=$tasn1_libs" >> $config_host_mak 770890246037SDaniel P. Berrangeecho "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak 770994dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 77101d728c39SBlue Swirlif test "$gcov" = "yes" ; then 77111d728c39SBlue Swirl echo "CONFIG_GCOV=y" >> $config_host_mak 77121d728c39SBlue Swirl echo "GCOV=$gcov_tool" >> $config_host_mak 77131d728c39SBlue Swirlfi 7714804edf29SJuan Quintela 77153efac6ebSTomáš Golembiovskýif test "$libudev" != "no"; then 77163efac6ebSTomáš Golembiovský echo "CONFIG_LIBUDEV=y" >> $config_host_mak 77173efac6ebSTomáš Golembiovský echo "LIBUDEV_LIBS=$libudev_libs" >> $config_host_mak 77183efac6ebSTomáš Golembiovskýfi 7719adc28027SAlexander Bulekovif test "$fuzzing" != "no"; then 7720adc28027SAlexander Bulekov echo "CONFIG_FUZZ=y" >> $config_host_mak 7721adc28027SAlexander Bulekov echo "FUZZ_CFLAGS=$FUZZ_CFLAGS" >> $config_host_mak 7722adc28027SAlexander Bulekov echo "FUZZ_LDFLAGS=$FUZZ_LDFLAGS" >> $config_host_mak 7723adc28027SAlexander Bulekovfi 77243efac6ebSTomáš Golembiovský 772505dfa22bSPhilippe Mathieu-Daudéif test "$edk2_blobs" = "yes" ; then 772605dfa22bSPhilippe Mathieu-Daudé echo "DECOMPRESS_EDK2_BLOBS=y" >> $config_host_mak 772705dfa22bSPhilippe Mathieu-Daudéfi 772805dfa22bSPhilippe Mathieu-Daudé 77296efd7517SPeter Maydell# use included Linux headers 77306efd7517SPeter Maydellif test "$linux" = "yes" ; then 7731a307beb6SAndreas Färber mkdir -p linux-headers 77326efd7517SPeter Maydell case "$cpu" in 7733c72b26ecSRichard Henderson i386|x86_64|x32) 773408312a63SPeter Maydell linux_arch=x86 77356efd7517SPeter Maydell ;; 7736f8378accSRichard Henderson ppc|ppc64|ppc64le) 773708312a63SPeter Maydell linux_arch=powerpc 77386efd7517SPeter Maydell ;; 77396efd7517SPeter Maydell s390x) 774008312a63SPeter Maydell linux_arch=s390 774108312a63SPeter Maydell ;; 77421f080313SClaudio Fontana aarch64) 77431f080313SClaudio Fontana linux_arch=arm64 77441f080313SClaudio Fontana ;; 7745222e7d11SSanjay Lal mips64) 7746222e7d11SSanjay Lal linux_arch=mips 7747222e7d11SSanjay Lal ;; 774808312a63SPeter Maydell *) 774908312a63SPeter Maydell # For most CPUs the kernel architecture name and QEMU CPU name match. 775008312a63SPeter Maydell linux_arch="$cpu" 77516efd7517SPeter Maydell ;; 77526efd7517SPeter Maydell esac 775308312a63SPeter Maydell # For non-KVM architectures we will not have asm headers 775408312a63SPeter Maydell if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then 775508312a63SPeter Maydell symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 775608312a63SPeter Maydell fi 77576efd7517SPeter Maydellfi 77586efd7517SPeter Maydell 775997a847bcSbellardfor target in $target_list; do 776097a847bcSbellardtarget_dir="$target" 776125be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 776289138857SStefan Weiltarget_name=$(echo $target | cut -d '-' -f 1) 776352bf9771Stony.nguyen@bt.comtarget_aligned_only="no" 776452bf9771Stony.nguyen@bt.comcase "$target_name" in 776552bf9771Stony.nguyen@bt.com alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) 776652bf9771Stony.nguyen@bt.com target_aligned_only="yes" 776752bf9771Stony.nguyen@bt.com ;; 776852bf9771Stony.nguyen@bt.comesac 776997a847bcSbellardtarget_bigendian="no" 7770c1799a84SPaolo Bonzinicase "$target_name" in 7771a69dc537SThomas Huth armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 777252bf9771Stony.nguyen@bt.com target_bigendian="yes" 7773ea2d6a39SJuan Quintela ;; 7774ea2d6a39SJuan Quintelaesac 777597a847bcSbellardtarget_softmmu="no" 7776997344f3Sbellardtarget_user_only="no" 7777831b7825Sthstarget_linux_user="no" 777884778508Sblueswir1target_bsd_user="no" 77799e407a85Spbrookcase "$target" in 7780c1799a84SPaolo Bonzini ${target_name}-softmmu) 77819e407a85Spbrook target_softmmu="yes" 77829e407a85Spbrook ;; 7783c1799a84SPaolo Bonzini ${target_name}-linux-user) 77849e407a85Spbrook target_user_only="yes" 77859e407a85Spbrook target_linux_user="yes" 77869e407a85Spbrook ;; 7787c1799a84SPaolo Bonzini ${target_name}-bsd-user) 778884778508Sblueswir1 target_user_only="yes" 778984778508Sblueswir1 target_bsd_user="yes" 779084778508Sblueswir1 ;; 77919e407a85Spbrook *) 779276ad07a4SPeter Maydell error_exit "Target '$target' not recognised" 77939e407a85Spbrook exit 1 77949e407a85Spbrook ;; 77959e407a85Spbrookesac 7796831b7825Sths 779797a847bcSbellardmkdir -p $target_dir 779825be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 779997a847bcSbellard 7800e5fe0c52Spbrookbflt="no" 7801ca759f9eSAlex Bennéemttcg="no" 780289138857SStefan Weilinterp_prefix1=$(echo "$interp_prefix" | sed "s/%M/$target_name/g") 780356aebc89Spbrookgdb_xml_files="" 78047ba1e619Saliguori 7805c1799a84SPaolo BonziniTARGET_ARCH="$target_name" 78066acff7daSJuan QuintelaTARGET_BASE_ARCH="" 7807e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 7808e73aae67SJuan Quintela 7809c1799a84SPaolo Bonzinicase "$target_name" in 78102408a527Saurel32 i386) 78110a7fa00aSEmilio G. Cota mttcg="yes" 78127b0f97baSDoug Gale gdb_xml_files="i386-32bit.xml" 781328988117SLaurent Vivier TARGET_SYSTBL_ABI=i386 78142408a527Saurel32 ;; 78152408a527Saurel32 x86_64) 78166acff7daSJuan Quintela TARGET_BASE_ARCH=i386 78178d62f35aSLaurent Vivier TARGET_SYSTBL_ABI=common,64 78180a7fa00aSEmilio G. Cota mttcg="yes" 78197b0f97baSDoug Gale gdb_xml_files="i386-64bit.xml" 78202408a527Saurel32 ;; 78212408a527Saurel32 alpha) 78225ee4f3c2SRichard Henderson mttcg="yes" 78236116aea9SLaurent Vivier TARGET_SYSTBL_ABI=common 78242408a527Saurel32 ;; 78252408a527Saurel32 arm|armeb) 7826b498c8a0SJuan Quintela TARGET_ARCH=arm 78275bcb4986SLaurent Vivier TARGET_SYSTBL_ABI=common,oabi 7828e5fe0c52Spbrook bflt="yes" 7829ca759f9eSAlex Bennée mttcg="yes" 7830c888f7e0SPeter Maydell gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" 78312408a527Saurel32 ;; 7832722dd7beSMichael Weiser aarch64|aarch64_be) 7833722dd7beSMichael Weiser TARGET_ARCH=aarch64 78346a49fa95SAlexander Graf TARGET_BASE_ARCH=arm 78356a49fa95SAlexander Graf bflt="yes" 7836ca759f9eSAlex Bennée mttcg="yes" 7837c888f7e0SPeter Maydell gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml arm-m-profile.xml" 78386a49fa95SAlexander Graf ;; 78392408a527Saurel32 cris) 78402408a527Saurel32 ;; 784161766fe9SRichard Henderson hppa) 78427b93dab5SRichard Henderson mttcg="yes" 78439566f4c6SLaurent Vivier TARGET_SYSTBL_ABI=common,32 784461766fe9SRichard Henderson ;; 7845613a22c9SMichael Walle lm32) 7846613a22c9SMichael Walle ;; 78472408a527Saurel32 m68k) 78480938cda5Saurel32 bflt="yes" 7849a976ed3fSKONRAD Frederic gdb_xml_files="cf-core.xml cf-fp.xml m68k-core.xml m68k-fp.xml" 78505b85cae9SLaurent Vivier TARGET_SYSTBL_ABI=common 78512408a527Saurel32 ;; 7852877fdc12SEdgar E. Iglesias microblaze|microblazeel) 7853877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 7854ddf0c4cdSLaurent Vivier TARGET_SYSTBL_ABI=common 785572b675caSEdgar E. Iglesias bflt="yes" 7856be73ef64SEdgar E. Iglesias echo "TARGET_ABI32=y" >> $config_target_mak 785772b675caSEdgar E. Iglesias ;; 78582408a527Saurel32 mips|mipsel) 78590454728cSAleksandar Markovic mttcg="yes" 7860b498c8a0SJuan Quintela TARGET_ARCH=mips 786125be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 7862c59716fcSLaurent Vivier TARGET_SYSTBL_ABI=o32 78632408a527Saurel32 ;; 78642408a527Saurel32 mipsn32|mipsn32el) 78650454728cSAleksandar Markovic mttcg="yes" 7866597e2cecSRichard Henderson TARGET_ARCH=mips64 78676acff7daSJuan Quintela TARGET_BASE_ARCH=mips 786825be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 7869597e2cecSRichard Henderson echo "TARGET_ABI32=y" >> $config_target_mak 7870686a0fe4SLaurent Vivier TARGET_SYSTBL_ABI=n32 78712408a527Saurel32 ;; 78722408a527Saurel32 mips64|mips64el) 7873a092a955SAlex Bennée mttcg="no" 7874b498c8a0SJuan Quintela TARGET_ARCH=mips64 78756acff7daSJuan Quintela TARGET_BASE_ARCH=mips 787625be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 7877686a0fe4SLaurent Vivier TARGET_SYSTBL_ABI=n64 78782408a527Saurel32 ;; 7879d15a9c23SAnthony Green moxie) 7880d15a9c23SAnthony Green ;; 7881e671711cSMarek Vasut nios2) 7882e671711cSMarek Vasut ;; 78834a09d0bbSRichard Henderson or1k) 7884e67db06eSJia Liu TARGET_ARCH=openrisc 7885e67db06eSJia Liu TARGET_BASE_ARCH=openrisc 7886e67db06eSJia Liu ;; 78872408a527Saurel32 ppc) 7888c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 788976a691f1SLaurent Vivier TARGET_SYSTBL_ABI=common,nospu,32 78902408a527Saurel32 ;; 78912408a527Saurel32 ppc64) 78926acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 7893e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 789476a691f1SLaurent Vivier TARGET_SYSTBL_ABI=common,nospu,64 7895f0b0685dSNikunj A Dadhania mttcg=yes 78961438eff3SAnton Blanchard gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" 78972408a527Saurel32 ;; 78989c35126cSDoug Kwan ppc64le) 78999c35126cSDoug Kwan TARGET_ARCH=ppc64 79009c35126cSDoug Kwan TARGET_BASE_ARCH=ppc 79019c35126cSDoug Kwan TARGET_ABI_DIR=ppc 790276a691f1SLaurent Vivier TARGET_SYSTBL_ABI=common,nospu,64 7903f0b0685dSNikunj A Dadhania mttcg=yes 79041438eff3SAnton Blanchard gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" 79059c35126cSDoug Kwan ;; 79062408a527Saurel32 ppc64abi32) 7907b498c8a0SJuan Quintela TARGET_ARCH=ppc64 79086acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 7909e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 791076a691f1SLaurent Vivier TARGET_SYSTBL_ABI=common,nospu,32 791125be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 79121438eff3SAnton Blanchard gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" 79132408a527Saurel32 ;; 791425fa194bSMichael Clark riscv32) 791525fa194bSMichael Clark TARGET_BASE_ARCH=riscv 791625fa194bSMichael Clark TARGET_ABI_DIR=riscv 791725fa194bSMichael Clark mttcg=yes 7918ae4a70c0SKeith Packard gdb_xml_files="riscv-32bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-32bit-csr.xml riscv-32bit-virtual.xml" 791925fa194bSMichael Clark ;; 792025fa194bSMichael Clark riscv64) 792125fa194bSMichael Clark TARGET_BASE_ARCH=riscv 792225fa194bSMichael Clark TARGET_ABI_DIR=riscv 792325fa194bSMichael Clark mttcg=yes 7924ae4a70c0SKeith Packard gdb_xml_files="riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-csr.xml riscv-64bit-virtual.xml" 792525fa194bSMichael Clark ;; 7926c8c35e5fSYoshinori Sato rx) 7927c8c35e5fSYoshinori Sato TARGET_ARCH=rx 7928c8c35e5fSYoshinori Sato bflt="yes" 7929c8c35e5fSYoshinori Sato target_compiler=$cross_cc_rx 7930c8c35e5fSYoshinori Sato gdb_xml_files="rx-core.xml" 7931c8c35e5fSYoshinori Sato ;; 79322408a527Saurel32 sh4|sh4eb) 7933b498c8a0SJuan Quintela TARGET_ARCH=sh4 7934d0c832f6SLaurent Vivier TARGET_SYSTBL_ABI=common 79354dbed897Spbrook bflt="yes" 79362408a527Saurel32 ;; 79372408a527Saurel32 sparc) 7938bb0cdc03SLaurent Vivier TARGET_SYSTBL_ABI=common,32 79392408a527Saurel32 ;; 79402408a527Saurel32 sparc64) 79416acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 7942bb0cdc03SLaurent Vivier TARGET_SYSTBL_ABI=common,64 79432408a527Saurel32 ;; 79442408a527Saurel32 sparc32plus) 7945b498c8a0SJuan Quintela TARGET_ARCH=sparc64 79466acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 7947e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 7948bb0cdc03SLaurent Vivier TARGET_SYSTBL_ABI=common,32 794925be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 79502408a527Saurel32 ;; 795124e804ecSAlexander Graf s390x) 7952318f371dSLaurent Vivier TARGET_SYSTBL_ABI=common,64 795363685bc4SDavid Hildenbrand mttcg=yes 795486158a2aSChristian Borntraeger gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-gs.xml" 795524e804ecSAlexander Graf ;; 7956444e06b1SChen Gang tilegx) 7957444e06b1SChen Gang ;; 79585ecaa4edSPeter Crosthwaite tricore) 79595ecaa4edSPeter Crosthwaite ;; 7960d2fbca94SGuan Xuetao unicore32) 7961d2fbca94SGuan Xuetao ;; 7962cfa550c6SMax Filippov xtensa|xtensaeb) 7963cfa550c6SMax Filippov TARGET_ARCH=xtensa 7964a4a93592SLaurent Vivier TARGET_SYSTBL_ABI=common 796502e33e9fSMax Filippov bflt="yes" 79669fb40342SMax Filippov mttcg="yes" 7967cfa550c6SMax Filippov ;; 79682408a527Saurel32 *) 796976ad07a4SPeter Maydell error_exit "Unsupported target CPU" 79702408a527Saurel32 ;; 79712408a527Saurel32esac 79725e8861a0SPaolo Bonzini# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 79735e8861a0SPaolo Bonziniif [ "$TARGET_BASE_ARCH" = "" ]; then 79745e8861a0SPaolo Bonzini TARGET_BASE_ARCH=$TARGET_ARCH 79755e8861a0SPaolo Bonzinifi 79765e8861a0SPaolo Bonzini 79775e8861a0SPaolo Bonzinisymlink "$source_path/Makefile.target" "$target_dir/Makefile" 79785e8861a0SPaolo Bonzini 797999afc91dSDaniel P. Berrangeupper() { 798099afc91dSDaniel P. Berrange echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' 798199afc91dSDaniel P. Berrange} 798299afc91dSDaniel P. Berrange 798389138857SStefan Weiltarget_arch_name="$(upper $TARGET_ARCH)" 798425be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 7985c1799a84SPaolo Bonziniecho "TARGET_NAME=$target_name" >> $config_target_mak 798625be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 7987e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 7988e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 7989e6e91b9cSJuan Quintelafi 799025be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 7991adfc3e91SStacey Sonif [ "$HOST_VARIANT_DIR" != "" ]; then 7992adfc3e91SStacey Son echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak 7993adfc3e91SStacey Sonfi 79944d6a835dSLaurent Vivierif [ "$TARGET_SYSTBL_ABI" != "" ]; then 79954d6a835dSLaurent Vivier echo "TARGET_SYSTBL_ABI=$TARGET_SYSTBL_ABI" >> $config_target_mak 79964d6a835dSLaurent Vivierfi 79973b6b7550SPaolo Bonzini 79983b6b7550SPaolo Bonziniif supported_xen_target $target; then 799925be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 8000e0e312f3SPaolo Bonzini echo "$target/config-devices.mak: CONFIG_XEN=y" >> $config_host_mak 8001eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = yes; then 8002eb6fda0fSAnthony PERARD echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" 8003eb6fda0fSAnthony PERARD fi 8004e0e312f3SPaolo Bonzinielse 8005e0e312f3SPaolo Bonzini echo "$target/config-devices.mak: CONFIG_XEN=n" >> $config_host_mak 8006432d268cSJun Nakajimafi 80073b6b7550SPaolo Bonziniif supported_kvm_target $target; then 800825be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 8009e0e312f3SPaolo Bonzini echo "$target/config-devices.mak: CONFIG_KVM=y" >> $config_host_mak 8010e0e312f3SPaolo Bonzinielse 8011e0e312f3SPaolo Bonzini echo "$target/config-devices.mak: CONFIG_KVM=n" >> $config_host_mak 8012c59249f9SJuan Quintelafi 80133b6b7550SPaolo Bonziniif supported_hax_target $target; then 8014b0cb0a66SVincent Palatin echo "CONFIG_HAX=y" >> $config_target_mak 8015b0cb0a66SVincent Palatinfi 8016c97d6d2cSSergio Andres Gomez Del Realif supported_hvf_target $target; then 8017c97d6d2cSSergio Andres Gomez Del Real echo "CONFIG_HVF=y" >> $config_target_mak 8018c97d6d2cSSergio Andres Gomez Del Realfi 8019d661d9a4SJustin Terry (VM)if supported_whpx_target $target; then 8020d661d9a4SJustin Terry (VM) echo "CONFIG_WHPX=y" >> $config_target_mak 8021d661d9a4SJustin Terry (VM)fi 802252bf9771Stony.nguyen@bt.comif test "$target_aligned_only" = "yes" ; then 802352bf9771Stony.nguyen@bt.com echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak 802452bf9771Stony.nguyen@bt.comfi 8025de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 802625be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 802797a847bcSbellardfi 802897a847bcSbellardif test "$target_softmmu" = "yes" ; then 802925be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 8030ca759f9eSAlex Bennée if test "$mttcg" = "yes" ; then 8031ca759f9eSAlex Bennée echo "TARGET_SUPPORTS_MTTCG=y" >> $config_target_mak 8032ca759f9eSAlex Bennée fi 8033de83cd02Sbellardfi 8034997344f3Sbellardif test "$target_user_only" = "yes" ; then 803525be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 8036a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 8037997344f3Sbellardfi 8038831b7825Sthsif test "$target_linux_user" = "yes" ; then 803925be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 8040831b7825Sthsfi 804156aebc89Spbrooklist="" 804256aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 804356aebc89Spbrook for x in $gdb_xml_files; do 804456aebc89Spbrook list="$list $source_path/gdb-xml/$x" 804556aebc89Spbrook done 804625be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 80473d0f1517SJuan Quintelafi 8048de83cd02Sbellard 8049e633a5c6SEric Blakeif test "$target_user_only" = "yes" && test "$bflt" = "yes"; then 805025be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 8051e5fe0c52Spbrookfi 805284778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 805325be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 805484778508Sblueswir1fi 80555b0753e0Sbellard 8056d75402b5SAlex Bennée 8057db5adeaaSPaolo Bonzini# generate QEMU_CFLAGS/QEMU_LDFLAGS for targets 8058fa282484SJuan Quintela 80594afddb55SJuan Quintelacflags="" 8060fa282484SJuan Quintelaldflags="" 80619b8e111fSJuan Quintela 8062c765fcacSPeter Crosthwaitedisas_config() { 8063c765fcacSPeter Crosthwaite echo "CONFIG_${1}_DIS=y" >> $config_target_mak 8064c765fcacSPeter Crosthwaite echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak 8065c765fcacSPeter Crosthwaite} 8066c765fcacSPeter Crosthwaite 806764656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 806864656024SJuan Quintela case "$i" in 806964656024SJuan Quintela alpha) 8070c765fcacSPeter Crosthwaite disas_config "ALPHA" 807164656024SJuan Quintela ;; 807282295d8aSRichard Henderson aarch64) 807382295d8aSRichard Henderson if test -n "${cxx}"; then 8074c765fcacSPeter Crosthwaite disas_config "ARM_A64" 807582295d8aSRichard Henderson fi 807682295d8aSRichard Henderson ;; 807764656024SJuan Quintela arm) 8078c765fcacSPeter Crosthwaite disas_config "ARM" 8079999b53ecSClaudio Fontana if test -n "${cxx}"; then 8080c765fcacSPeter Crosthwaite disas_config "ARM_A64" 8081999b53ecSClaudio Fontana fi 808264656024SJuan Quintela ;; 808364656024SJuan Quintela cris) 8084c765fcacSPeter Crosthwaite disas_config "CRIS" 808564656024SJuan Quintela ;; 8086429b31a2SRichard Henderson hppa) 8087429b31a2SRichard Henderson disas_config "HPPA" 8088429b31a2SRichard Henderson ;; 8089c72b26ecSRichard Henderson i386|x86_64|x32) 8090c765fcacSPeter Crosthwaite disas_config "I386" 809164656024SJuan Quintela ;; 809279368f49SMichael Walle lm32) 8093c765fcacSPeter Crosthwaite disas_config "LM32" 809479368f49SMichael Walle ;; 809564656024SJuan Quintela m68k) 8096c765fcacSPeter Crosthwaite disas_config "M68K" 809764656024SJuan Quintela ;; 8098877fdc12SEdgar E. Iglesias microblaze*) 8099c765fcacSPeter Crosthwaite disas_config "MICROBLAZE" 810064656024SJuan Quintela ;; 810164656024SJuan Quintela mips*) 8102c765fcacSPeter Crosthwaite disas_config "MIPS" 810389a955e8SAleksandar Markovic if test -n "${cxx}"; then 810489a955e8SAleksandar Markovic disas_config "NANOMIPS" 810589a955e8SAleksandar Markovic fi 810664656024SJuan Quintela ;; 8107d15a9c23SAnthony Green moxie*) 8108c765fcacSPeter Crosthwaite disas_config "MOXIE" 8109d15a9c23SAnthony Green ;; 8110e671711cSMarek Vasut nios2) 8111e671711cSMarek Vasut disas_config "NIOS2" 8112e671711cSMarek Vasut ;; 81134a09d0bbSRichard Henderson or1k) 8114c765fcacSPeter Crosthwaite disas_config "OPENRISC" 8115e67db06eSJia Liu ;; 811664656024SJuan Quintela ppc*) 8117c765fcacSPeter Crosthwaite disas_config "PPC" 811864656024SJuan Quintela ;; 8119c4f80543SAlistair Francis riscv*) 812025fa194bSMichael Clark disas_config "RISCV" 812125fa194bSMichael Clark ;; 8122c8c35e5fSYoshinori Sato rx) 8123c8c35e5fSYoshinori Sato disas_config "RX" 8124c8c35e5fSYoshinori Sato ;; 812524e804ecSAlexander Graf s390*) 8126c765fcacSPeter Crosthwaite disas_config "S390" 812764656024SJuan Quintela ;; 812864656024SJuan Quintela sh4) 8129c765fcacSPeter Crosthwaite disas_config "SH4" 813064656024SJuan Quintela ;; 813164656024SJuan Quintela sparc*) 8132c765fcacSPeter Crosthwaite disas_config "SPARC" 813364656024SJuan Quintela ;; 8134cfa550c6SMax Filippov xtensa*) 8135c765fcacSPeter Crosthwaite disas_config "XTENSA" 8136cfa550c6SMax Filippov ;; 813764656024SJuan Quintela esac 813864656024SJuan Quinteladone 81399195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 8140c765fcacSPeter Crosthwaite disas_config "TCI" 81419195b2c2SStefan Weilfi 814264656024SJuan Quintela 81436ee7126fSJuan Quintelacase "$ARCH" in 81446ee7126fSJuan Quintelaalpha) 81456ee7126fSJuan Quintela # Ensure there's only a single GP 81466ee7126fSJuan Quintela cflags="-msmall-data $cflags" 81476ee7126fSJuan Quintela;; 81486ee7126fSJuan Quintelaesac 81496ee7126fSJuan Quintela 8150d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 8151d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 8152d02c1db3SJuan Quintela cflags="-p $cflags" 8153d02c1db3SJuan Quintela ldflags="-p $ldflags" 8154d02c1db3SJuan Quintela fi 8155d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 8156d02c1db3SJuan Quintela ldflags="-p $ldflags" 815725be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 8158d02c1db3SJuan Quintela fi 8159d02c1db3SJuan Quintelafi 8160d02c1db3SJuan Quintela 8161e9a3591fSChristian Borntraeger# Newer kernels on s390 check for an S390_PGSTE program header and 8162e9a3591fSChristian Borntraeger# enable the pgste page table extensions in that case. This makes 8163e9a3591fSChristian Borntraeger# the vm.allocate_pgste sysctl unnecessary. We enable this program 8164e9a3591fSChristian Borntraeger# header if 8165e9a3591fSChristian Borntraeger# - we build on s390x 8166e9a3591fSChristian Borntraeger# - we build the system emulation for s390x (qemu-system-s390x) 8167e9a3591fSChristian Borntraeger# - KVM is enabled 8168e9a3591fSChristian Borntraeger# - the linker supports --s390-pgste 8169e633a5c6SEric Blakeif test "$TARGET_ARCH" = "s390x" && test "$target_softmmu" = "yes" && \ 8170e633a5c6SEric Blake test "$ARCH" = "s390x" && test "$kvm" = "yes"; then 8171e9a3591fSChristian Borntraeger if ld_has --s390-pgste ; then 8172e9a3591fSChristian Borntraeger ldflags="-Wl,--s390-pgste $ldflags" 8173e9a3591fSChristian Borntraeger fi 8174e9a3591fSChristian Borntraegerfi 8175e9a3591fSChristian Borntraeger 8176db5adeaaSPaolo Bonziniecho "QEMU_LDFLAGS+=$ldflags" >> $config_target_mak 817725be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 8178fa282484SJuan Quintela 817997a847bcSbellarddone # for target in $targets 81807d13299dSbellard 8181d52c454aSMarc-André Lureauecho "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak 8182d52c454aSMarc-André Lureauecho "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak 8183d52c454aSMarc-André Lureau 8184e3971d61SPhilippe Mathieu-Daudéif [ "$fdt" = "git" ]; then 81853b8593eeSMarkus Armbruster echo "config-host.h: dtc/all" >> $config_host_mak 8186a540f158SPeter Crosthwaitefi 8187e219c499SRichard Hendersonif [ "$capstone" = "git" -o "$capstone" = "internal" ]; then 81883b8593eeSMarkus Armbruster echo "config-host.h: capstone/all" >> $config_host_mak 8189e219c499SRichard Hendersonfi 8190e219c499SRichard Hendersonif test -n "$LIBCAPSTONE"; then 8191e219c499SRichard Henderson echo "LIBCAPSTONE=$LIBCAPSTONE" >> $config_host_mak 8192e219c499SRichard Hendersonfi 8193a540f158SPeter Crosthwaite 8194a99d57bbSWanlong Gaoif test "$numa" = "yes"; then 8195a99d57bbSWanlong Gao echo "CONFIG_NUMA=y" >> $config_host_mak 8196a99d57bbSWanlong Gaofi 8197a99d57bbSWanlong Gao 8198fd0e6053SJohn Snowif test "$ccache_cpp2" = "yes"; then 8199fd0e6053SJohn Snow echo "export CCACHE_CPP2=y" >> $config_host_mak 8200fd0e6053SJohn Snowfi 8201fd0e6053SJohn Snow 8202e29e5c6eSPeter Maydell# If we're using a separate build tree, set it up now. 8203e29e5c6eSPeter Maydell# DIRS are directories which we simply mkdir in the build tree; 8204e29e5c6eSPeter Maydell# LINKS are things to symlink back into the source tree 8205e29e5c6eSPeter Maydell# (these can be both files and directories). 8206e29e5c6eSPeter Maydell# Caution: do not add files or directories here using wildcards. This 8207e29e5c6eSPeter Maydell# will result in problems later if a new file matching the wildcard is 8208e29e5c6eSPeter Maydell# added to the source tree -- nothing will cause configure to be rerun 8209e29e5c6eSPeter Maydell# so the build tree will be missing the link back to the new file, and 8210e29e5c6eSPeter Maydell# tests might fail. Prefer to keep the relevant files in their own 8211e29e5c6eSPeter Maydell# directory and symlink the directory instead. 82121cf4323eSThomas HuthDIRS="tests tests/tcg tests/tcg/lm32 tests/qapi-schema tests/qtest/libqos" 82131cf4323eSThomas HuthDIRS="$DIRS tests/qtest tests/qemu-iotests tests/vm tests/fp tests/qgraph" 8214b855f8d1SPaolo BonziniDIRS="$DIRS docs docs/interop fsdev scsi" 8215744a928cSAlexey KardashevskiyDIRS="$DIRS pc-bios/optionrom pc-bios/s390-ccw" 82162d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 82172038f8c8SPaolo BonziniLINKS="Makefile" 82182038f8c8SPaolo BonziniLINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile" 82192038f8c8SPaolo BonziniLINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile" 8220671f760bSEmilio G. CotaLINKS="$LINKS tests/plugin/Makefile" 8221e29e5c6eSPeter MaydellLINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" 8222e29e5c6eSPeter MaydellLINKS="$LINKS pc-bios/s390-ccw/Makefile" 8223e29e5c6eSPeter MaydellLINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile" 8224e29e5c6eSPeter MaydellLINKS="$LINKS pc-bios/qemu-icon.bmp" 8225e29e5c6eSPeter MaydellLINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit 822639950353SPeter MaydellLINKS="$LINKS tests/acceptance tests/data" 822739950353SPeter MaydellLINKS="$LINKS tests/qemu-iotests/check" 82288f8fd9edSCleber RosaLINKS="$LINKS python" 8229753d11f2SRichard Hendersonfor bios_file in \ 8230753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 8231225a9ab8SAlexey Kardashevskiy $source_path/pc-bios/*.lid \ 8232753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 8233753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 8234e89e33e1SDominik Dingel $source_path/pc-bios/*.img \ 8235753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 82364e73c781SAlexander Graf $source_path/pc-bios/u-boot.* \ 823726ce90fdSLaszlo Ersek $source_path/pc-bios/edk2-*.fd.bz2 \ 8238753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 8239753d11f2SRichard Hendersondo 8240e29e5c6eSPeter Maydell LINKS="$LINKS pc-bios/$(basename $bios_file)" 82417ea78b74SJan Kiszkadone 8242d1807a4fSPaolo Bonzinimkdir -p $DIRS 8243e29e5c6eSPeter Maydellfor f in $LINKS ; do 8244cab00a5aSMichael S. Tsirkin if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" != "y" ]; then 8245f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 8246f9245e10SPeter Maydell fi 82477d13299dSbellarddone 82481ad2134fSPaul Brook 82492038f8c8SPaolo Bonzini(for i in $cross_cc_vars; do 82502038f8c8SPaolo Bonzini export $i 82512038f8c8SPaolo Bonzinidone 8252afc3a8f9SAlex Bennéeexport target_list source_path use_containers 82532038f8c8SPaolo Bonzini$source_path/tests/tcg/configure.sh) 82542038f8c8SPaolo Bonzini 8255c34ebfdcSAnthony Liguori# temporary config to build submodules 82562d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 8257c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 825837116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 8259c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 8260cdbd727cSRichard Henderson echo "AS=$as" >> $config_mak 82615f6f0e27SRichard Henderson echo "CCAS=$ccas" >> $config_mak 8262c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 8263c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 82643dd46c78SBlue Swirl echo "CPP=$cpp" >> $config_mak 8265c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 8266a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_mak 8267c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 82689f81aeb5SAlistair Francis echo "RANLIB=$ranlib" >> $config_mak 8269c34ebfdcSAnthony Liguoridone 8270c34ebfdcSAnthony Liguori 827176c7560aSMax Reitz# set up qemu-iotests in this build directory 827276c7560aSMax Reitziotests_common_env="tests/qemu-iotests/common.env" 827376c7560aSMax Reitz 827476c7560aSMax Reitzecho "# Automatically generated by configure - do not modify" > "$iotests_common_env" 827576c7560aSMax Reitzecho >> "$iotests_common_env" 827676c7560aSMax Reitzecho "export PYTHON='$python'" >> "$iotests_common_env" 827776c7560aSMax Reitz 8278dc655404SMichael S. Tsirkin# Save the configure command line for later reuse. 8279dc655404SMichael S. Tsirkincat <<EOD >config.status 8280dc655404SMichael S. Tsirkin#!/bin/sh 8281dc655404SMichael S. Tsirkin# Generated by configure. 8282dc655404SMichael S. Tsirkin# Run this file to recreate the current configuration. 8283dc655404SMichael S. Tsirkin# Compiler output produced by configure, useful for debugging 8284dc655404SMichael S. Tsirkin# configure, is in config.log if it exists. 8285dc655404SMichael S. TsirkinEOD 8286e811da7fSDaniel P. Berrangé 8287e811da7fSDaniel P. Berrangépreserve_env() { 8288e811da7fSDaniel P. Berrangé envname=$1 8289e811da7fSDaniel P. Berrangé 8290e811da7fSDaniel P. Berrangé eval envval=\$$envname 8291e811da7fSDaniel P. Berrangé 8292e811da7fSDaniel P. Berrangé if test -n "$envval" 8293e811da7fSDaniel P. Berrangé then 8294e811da7fSDaniel P. Berrangé echo "$envname='$envval'" >> config.status 8295e811da7fSDaniel P. Berrangé echo "export $envname" >> config.status 8296e811da7fSDaniel P. Berrangé else 8297e811da7fSDaniel P. Berrangé echo "unset $envname" >> config.status 8298e811da7fSDaniel P. Berrangé fi 8299e811da7fSDaniel P. Berrangé} 8300e811da7fSDaniel P. Berrangé 8301e811da7fSDaniel P. Berrangé# Preserve various env variables that influence what 8302e811da7fSDaniel P. Berrangé# features/build target configure will detect 8303e811da7fSDaniel P. Berrangépreserve_env AR 8304e811da7fSDaniel P. Berrangépreserve_env AS 8305e811da7fSDaniel P. Berrangépreserve_env CC 8306e811da7fSDaniel P. Berrangépreserve_env CPP 8307e811da7fSDaniel P. Berrangépreserve_env CXX 8308e811da7fSDaniel P. Berrangépreserve_env INSTALL 8309e811da7fSDaniel P. Berrangépreserve_env LD 8310e811da7fSDaniel P. Berrangépreserve_env LD_LIBRARY_PATH 8311e811da7fSDaniel P. Berrangépreserve_env LIBTOOL 8312e811da7fSDaniel P. Berrangépreserve_env MAKE 8313e811da7fSDaniel P. Berrangépreserve_env NM 8314e811da7fSDaniel P. Berrangépreserve_env OBJCOPY 8315e811da7fSDaniel P. Berrangépreserve_env PATH 8316e811da7fSDaniel P. Berrangépreserve_env PKG_CONFIG 8317e811da7fSDaniel P. Berrangépreserve_env PKG_CONFIG_LIBDIR 8318e811da7fSDaniel P. Berrangépreserve_env PKG_CONFIG_PATH 8319e811da7fSDaniel P. Berrangépreserve_env PYTHON 8320e811da7fSDaniel P. Berrangépreserve_env SDL2_CONFIG 8321e811da7fSDaniel P. Berrangépreserve_env SMBD 8322e811da7fSDaniel P. Berrangépreserve_env STRIP 8323e811da7fSDaniel P. Berrangépreserve_env WINDRES 8324e811da7fSDaniel P. Berrangé 8325dc655404SMichael S. Tsirkinprintf "exec" >>config.status 8326dc655404SMichael S. Tsirkinprintf " '%s'" "$0" "$@" >>config.status 8327cf7cc929SDr. David Alan Gilbertecho ' "$@"' >>config.status 8328dc655404SMichael S. Tsirkinchmod +x config.status 8329dc655404SMichael S. Tsirkin 83308cd05ab6SPeter Maydellrm -r "$TMPDIR1" 8331