17d13299dSbellard#!/bin/sh 27d13299dSbellard# 33ef693a0Sbellard# qemu configure script (c) 2003 Fabrice Bellard 47d13299dSbellard# 57d13299dSbellard# set temporary file name 67d13299dSbellardif test ! -z "$TMPDIR" ; then 77d13299dSbellard TMPDIR1="${TMPDIR}" 87d13299dSbellardelif test ! -z "$TEMPDIR" ; then 97d13299dSbellard TMPDIR1="${TEMPDIR}" 107d13299dSbellardelse 117d13299dSbellard TMPDIR1="/tmp" 127d13299dSbellardfi 137d13299dSbellard 143ef693a0SbellardTMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" 1566518bf6SDon SlutzTMPB="qemu-conf-${RANDOM}-$$-${RANDOM}" 1666518bf6SDon SlutzTMPO="${TMPDIR1}/${TMPB}.o" 179c83ffd8SPeter MaydellTMPCXX="${TMPDIR1}/${TMPB}.cxx" 1866518bf6SDon SlutzTMPL="${TMPDIR1}/${TMPB}.lo" 1966518bf6SDon SlutzTMPA="${TMPDIR1}/lib${TMPB}.la" 20a91b857cSmalcTMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe" 217d13299dSbellard 220ba8681eSLoïc Minier# NB: do not call "exit" in the trap handler; this is buggy with some shells; 230ba8681eSLoïc Minier# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> 249c83ffd8SPeter Maydelltrap "rm -f $TMPC $TMPO $TMPCXX $TMPE" EXIT INT QUIT TERM 25da1d85e3SGerd Hoffmannrm -f config.log 269ac81bbbSmalc 27b48e3611SPeter Maydell# Print a helpful header at the top of config.log 28b48e3611SPeter Maydellecho "# QEMU configure log $(date)" >> config.log 29979ae168SPeter Maydellprintf "# Configured with:" >> config.log 30979ae168SPeter Maydellprintf " '%s'" "$0" "$@" >> config.log 31979ae168SPeter Maydellecho >> config.log 32b48e3611SPeter Maydellecho "#" >> config.log 33b48e3611SPeter Maydell 34bdf523e6SStefan Weil# Save the configure command line for later reuse. 35bdf523e6SStefan Weilcat <<EOD >config.status 36bdf523e6SStefan Weil#!/bin/sh 37bdf523e6SStefan Weil# Generated by configure. 38bdf523e6SStefan Weil# Run this file to recreate the current configuration. 39bdf523e6SStefan Weil# Compiler output produced by configure, useful for debugging 40bdf523e6SStefan Weil# configure, is in config.log if it exists. 41bdf523e6SStefan WeilEOD 42bdf523e6SStefan Weilprintf "exec" >>config.status 43bdf523e6SStefan Weilprintf " '%s'" "$0" "$@" >>config.status 44bdf523e6SStefan Weilecho >>config.status 45bdf523e6SStefan Weilchmod +x config.status 46bdf523e6SStefan Weil 4776ad07a4SPeter Maydellerror_exit() { 4876ad07a4SPeter Maydell echo 4976ad07a4SPeter Maydell echo "ERROR: $1" 5076ad07a4SPeter Maydell while test -n "$2"; do 5176ad07a4SPeter Maydell echo " $2" 5276ad07a4SPeter Maydell shift 5376ad07a4SPeter Maydell done 5476ad07a4SPeter Maydell echo 5576ad07a4SPeter Maydell exit 1 5676ad07a4SPeter Maydell} 5776ad07a4SPeter Maydell 589c83ffd8SPeter Maydelldo_compiler() { 599c83ffd8SPeter Maydell # Run the compiler, capturing its output to the log. First argument 609c83ffd8SPeter Maydell # is compiler binary to execute. 619c83ffd8SPeter Maydell local compiler="$1" 629c83ffd8SPeter Maydell shift 639c83ffd8SPeter Maydell echo $compiler "$@" >> config.log 649c83ffd8SPeter Maydell $compiler "$@" >> config.log 2>&1 || return $? 658dc38a78SPeter Maydell # Test passed. If this is an --enable-werror build, rerun 668dc38a78SPeter Maydell # the test with -Werror and bail out if it fails. This 678dc38a78SPeter Maydell # makes warning-generating-errors in configure test code 688dc38a78SPeter Maydell # obvious to developers. 698dc38a78SPeter Maydell if test "$werror" != "yes"; then 708dc38a78SPeter Maydell return 0 718dc38a78SPeter Maydell fi 728dc38a78SPeter Maydell # Don't bother rerunning the compile if we were already using -Werror 738dc38a78SPeter Maydell case "$*" in 748dc38a78SPeter Maydell *-Werror*) 758dc38a78SPeter Maydell return 0 768dc38a78SPeter Maydell ;; 778dc38a78SPeter Maydell esac 789c83ffd8SPeter Maydell echo $compiler -Werror "$@" >> config.log 799c83ffd8SPeter Maydell $compiler -Werror "$@" >> config.log 2>&1 && return $? 8076ad07a4SPeter Maydell error_exit "configure test passed without -Werror but failed with -Werror." \ 8176ad07a4SPeter Maydell "This is probably a bug in the configure script. The failing command" \ 8276ad07a4SPeter Maydell "will be at the bottom of config.log." \ 8376ad07a4SPeter Maydell "You can run configure with --disable-werror to bypass this check." 848dc38a78SPeter Maydell} 858dc38a78SPeter Maydell 869c83ffd8SPeter Maydelldo_cc() { 879c83ffd8SPeter Maydell do_compiler "$cc" "$@" 889c83ffd8SPeter Maydell} 899c83ffd8SPeter Maydell 909c83ffd8SPeter Maydelldo_cxx() { 919c83ffd8SPeter Maydell do_compiler "$cxx" "$@" 929c83ffd8SPeter Maydell} 939c83ffd8SPeter Maydell 949c83ffd8SPeter Maydellupdate_cxxflags() { 959c83ffd8SPeter Maydell # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those 969c83ffd8SPeter Maydell # options which some versions of GCC's C++ compiler complain about 979c83ffd8SPeter Maydell # because they only make sense for C programs. 989c83ffd8SPeter Maydell QEMU_CXXFLAGS= 999c83ffd8SPeter Maydell for arg in $QEMU_CFLAGS; do 1009c83ffd8SPeter Maydell case $arg in 1019c83ffd8SPeter Maydell -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ 1029c83ffd8SPeter Maydell -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) 1039c83ffd8SPeter Maydell ;; 1049c83ffd8SPeter Maydell *) 1059c83ffd8SPeter Maydell QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg 1069c83ffd8SPeter Maydell ;; 1079c83ffd8SPeter Maydell esac 1089c83ffd8SPeter Maydell done 1099c83ffd8SPeter Maydell} 1109c83ffd8SPeter Maydell 11152166aa0SJuan Quintelacompile_object() { 1128dc38a78SPeter Maydell do_cc $QEMU_CFLAGS -c -o $TMPO $TMPC 11352166aa0SJuan Quintela} 11452166aa0SJuan Quintela 11552166aa0SJuan Quintelacompile_prog() { 11652166aa0SJuan Quintela local_cflags="$1" 11752166aa0SJuan Quintela local_ldflags="$2" 1188dc38a78SPeter Maydell do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags 11952166aa0SJuan Quintela} 12052166aa0SJuan Quintela 12166518bf6SDon Slutzdo_libtool() { 12266518bf6SDon Slutz local mode=$1 12366518bf6SDon Slutz shift 12466518bf6SDon Slutz # Run the compiler, capturing its output to the log. 12566518bf6SDon Slutz echo $libtool $mode --tag=CC $cc "$@" >> config.log 12666518bf6SDon Slutz $libtool $mode --tag=CC $cc "$@" >> config.log 2>&1 || return $? 12766518bf6SDon Slutz # Test passed. If this is an --enable-werror build, rerun 12866518bf6SDon Slutz # the test with -Werror and bail out if it fails. This 12966518bf6SDon Slutz # makes warning-generating-errors in configure test code 13066518bf6SDon Slutz # obvious to developers. 13166518bf6SDon Slutz if test "$werror" != "yes"; then 13266518bf6SDon Slutz return 0 13366518bf6SDon Slutz fi 13466518bf6SDon Slutz # Don't bother rerunning the compile if we were already using -Werror 13566518bf6SDon Slutz case "$*" in 13666518bf6SDon Slutz *-Werror*) 13766518bf6SDon Slutz return 0 13866518bf6SDon Slutz ;; 13966518bf6SDon Slutz esac 14066518bf6SDon Slutz echo $libtool $mode --tag=CC $cc -Werror "$@" >> config.log 14166518bf6SDon Slutz $libtool $mode --tag=CC $cc -Werror "$@" >> config.log 2>&1 && return $? 14266518bf6SDon Slutz error_exit "configure test passed without -Werror but failed with -Werror." \ 14366518bf6SDon Slutz "This is probably a bug in the configure script. The failing command" \ 14466518bf6SDon Slutz "will be at the bottom of config.log." \ 14566518bf6SDon Slutz "You can run configure with --disable-werror to bypass this check." 14666518bf6SDon Slutz} 14766518bf6SDon Slutz 14866518bf6SDon Slutzlibtool_prog() { 14966518bf6SDon Slutz do_libtool --mode=compile $QEMU_CFLAGS -c -fPIE -DPIE -o $TMPO $TMPC || return $? 15066518bf6SDon Slutz do_libtool --mode=link $LDFLAGS -o $TMPA $TMPL -rpath /usr/local/lib 15166518bf6SDon Slutz} 15266518bf6SDon Slutz 15311568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 15411568d6dSPaolo Bonzinisymlink() { 15572b8b5a1SStefan Weil rm -rf "$2" 156ec5b06d7SAnthony Liguori mkdir -p "$(dirname "$2")" 15772b8b5a1SStefan Weil ln -s "$1" "$2" 15811568d6dSPaolo Bonzini} 15911568d6dSPaolo Bonzini 1600dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 1610dba6195SLoïc Minier# executable or a builtin) 1620dba6195SLoïc Minierhas() { 1630dba6195SLoïc Minier type "$1" >/dev/null 2>&1 1640dba6195SLoïc Minier} 1650dba6195SLoïc Minier 1660dba6195SLoïc Minier# search for an executable in PATH 1670dba6195SLoïc Minierpath_of() { 1680dba6195SLoïc Minier local_command="$1" 1690dba6195SLoïc Minier local_ifs="$IFS" 1700dba6195SLoïc Minier local_dir="" 1710dba6195SLoïc Minier 1720dba6195SLoïc Minier # pathname has a dir component? 1730dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 1740dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 1750dba6195SLoïc Minier echo "$local_command" 1760dba6195SLoïc Minier return 0 1770dba6195SLoïc Minier fi 1780dba6195SLoïc Minier fi 1790dba6195SLoïc Minier if [ -z "$local_command" ]; then 1800dba6195SLoïc Minier return 1 1810dba6195SLoïc Minier fi 1820dba6195SLoïc Minier 1830dba6195SLoïc Minier IFS=: 1840dba6195SLoïc Minier for local_dir in $PATH; do 1850dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 1860dba6195SLoïc Minier echo "$local_dir/$local_command" 1870dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1880dba6195SLoïc Minier return 0 1890dba6195SLoïc Minier fi 1900dba6195SLoïc Minier done 1910dba6195SLoïc Minier # not found 1920dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1930dba6195SLoïc Minier return 1 1940dba6195SLoïc Minier} 1950dba6195SLoïc Minier 1967d13299dSbellard# default parameters 197ca4deeb1SPaolo Bonzinisource_path=`dirname "$0"` 1982ff6b91eSJuan Quintelacpu="" 199a31a8642SMichael S. Tsirkiniasl="iasl" 2001e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 20143ce4dfeSbellardstatic="no" 2027d13299dSbellardcross_prefix="" 2030c58ac1cSmalcaudio_drv_list="" 204b64ec4e4SFam Zhengblock_drv_rw_whitelist="" 205b64ec4e4SFam Zhengblock_drv_ro_whitelist="" 206e49d021eSPeter Maydellhost_cc="cc" 20773da375eSJuan Quintelalibs_softmmu="" 2083e2e0e6bSJuan Quintelalibs_tools="" 20967f86e8eSJuan Quintelaaudio_pt_int="" 210d5631638Smalcaudio_win_int="" 2112b2e59e6SPaolo Bonzinicc_i386=i386-pc-linux-gnu-gcc 212957f1f99SMichael Rothlibs_qga="" 2135bc62e01SGerd Hoffmanndebug_info="yes" 214ac0df51dSaliguori 215afb63ebdSStefan Weil# Don't accept a target_list environment variable. 216afb63ebdSStefan Weilunset target_list 217377529c0SPaolo Bonzini 218377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 219377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 220377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 221377529c0SPaolo Bonzini# unless --disable-foo is given 222377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 223377529c0SPaolo Bonzini# feature will searched for, 224377529c0SPaolo Bonzini# if not found, configure exits with error 225377529c0SPaolo Bonzini# 226377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 227377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 228377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 229377529c0SPaolo Bonzini 230377529c0SPaolo Bonzinibluez="" 231377529c0SPaolo Bonzinibrlapi="" 232377529c0SPaolo Bonzinicurl="" 233377529c0SPaolo Bonzinicurses="" 234377529c0SPaolo Bonzinidocs="" 235377529c0SPaolo Bonzinifdt="" 23658952137SVincenzo Maffionenetmap="no" 237e2134eb9SGerd Hoffmannpixman="" 238377529c0SPaolo Bonzinisdl="" 23947c03744SDave Airliesdlabi="1.2" 240983eef5aSMeador Ingevirtfs="" 241821601eaSJes Sorensenvnc="yes" 242377529c0SPaolo Bonzinisparse="no" 243377529c0SPaolo Bonziniuuid="" 244377529c0SPaolo Bonzinivde="" 245377529c0SPaolo Bonzinivnc_tls="" 246377529c0SPaolo Bonzinivnc_sasl="" 247377529c0SPaolo Bonzinivnc_jpeg="" 248377529c0SPaolo Bonzinivnc_png="" 2497536ee4bSTim Hardeckvnc_ws="" 250377529c0SPaolo Bonzinixen="" 251d5b93ddfSAnthony PERARDxen_ctrl_version="" 252eb6fda0fSAnthony PERARDxen_pci_passthrough="" 253377529c0SPaolo Bonzinilinux_aio="" 25447e98658SCorey Bryantcap_ng="" 255377529c0SPaolo Bonziniattr="" 2564f26f2b6SAvi Kivitylibattr="" 257377529c0SPaolo Bonzinixfs="" 258377529c0SPaolo Bonzini 259d41a75a2SBradvhost_net="no" 2605e9be92dSNicholas Bellingervhost_scsi="no" 261d41a75a2SBradkvm="no" 2622da776dbSMichael R. Hinesrdma="" 263377529c0SPaolo Bonzinigprof="no" 264377529c0SPaolo Bonzinidebug_tcg="no" 265377529c0SPaolo Bonzinidebug="no" 266377529c0SPaolo Bonzinistrip_opt="yes" 2679195b2c2SStefan Weiltcg_interpreter="no" 268377529c0SPaolo Bonzinibigendian="no" 269377529c0SPaolo Bonzinimingw32="no" 2701d728c39SBlue Swirlgcov="no" 2711d728c39SBlue Swirlgcov_tool="gcov" 272377529c0SPaolo BonziniEXESUF="" 27317969268SFam ZhengDSOSUF=".so" 27417969268SFam ZhengLDFLAGS_SHARED="-shared" 27517969268SFam Zhengmodules="no" 276377529c0SPaolo Bonziniprefix="/usr/local" 277377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 278528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 279850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 280377529c0SPaolo Bonzinibindir="\${prefix}/bin" 2813aa5d2beSAlon Levylibdir="\${prefix}/lib" 2828bf188aaSMichael Tokarevlibexecdir="\${prefix}/libexec" 2830f94d6daSAlon Levyincludedir="\${prefix}/include" 284377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 285785c23aeSLuiz Capitulinolocal_statedir="\${prefix}/var" 286377529c0SPaolo Bonziniconfsuffix="/qemu" 287377529c0SPaolo Bonzinislirp="yes" 288377529c0SPaolo Bonzinifmod_lib="" 289377529c0SPaolo Bonzinifmod_inc="" 290377529c0SPaolo Bonzinioss_lib="" 291377529c0SPaolo Bonzinibsd="no" 292377529c0SPaolo Bonzinilinux="no" 293377529c0SPaolo Bonzinisolaris="no" 294377529c0SPaolo Bonziniprofiler="no" 295377529c0SPaolo Bonzinicocoa="no" 296377529c0SPaolo Bonzinisoftmmu="yes" 297377529c0SPaolo Bonzinilinux_user="no" 298377529c0SPaolo Bonzinibsd_user="no" 29930163d89SPeter Maydellguest_base="yes" 300377529c0SPaolo Bonziniuname_release="" 301377529c0SPaolo Bonziniaix="no" 302377529c0SPaolo Bonziniblobs="yes" 303377529c0SPaolo Bonzinipkgversion="" 30440d6444eSAvi Kivitypie="" 305377529c0SPaolo Bonzinizero_malloc="" 3063556c233SPaolo Bonziniqom_cast_debug="yes" 307377529c0SPaolo Bonzinitrace_backend="nop" 308377529c0SPaolo Bonzinitrace_file="trace" 309377529c0SPaolo Bonzinispice="" 310377529c0SPaolo Bonzinirbd="" 311111a38b0SRobert Relyeasmartcard_nss="" 3122b2325ffSGerd Hoffmannlibusb="" 31369354a83SHans de Goedeusb_redir="" 314b1e5fff4SMichael Walleglx="" 3151ece9905SAlon Levyzlib="yes" 316607dacd0Sqiaonuohanlzo="no" 317607dacd0Sqiaonuohansnappy="no" 318e8ef31a3SMichael Tokarevguest_agent="" 319d9840e25STomoki Sekiyamaguest_agent_with_vss="no" 320d9840e25STomoki Sekiyamavss_win32_sdk="" 321d9840e25STomoki Sekiyamawin_sdk="no" 3224b1c11fdSDaniel P. Berrangewant_tools="yes" 323c589b249SRonnie Sahlberglibiscsi="" 3246542aa9cSPeter Lievenlibnfs="" 325519175a2SAlex Barcelocoroutine="" 32670c60c08SStefan Hajnoczicoroutine_pool="" 327f794573eSEduardo Otuboseccomp="" 328eb100396SBharata B Raoglusterfs="" 3290c14fb47SBharata B Raoglusterfs_discard="no" 3307c815372SBharata B Raoglusterfs_zerofill="no" 331583f6e7bSStefan Hajnoczivirtio_blk_data_plane="" 332a4ccabcfSAnthony Liguorigtk="" 333528de90aSDaniel P. Berrangegtkabi="2.0" 334ab214c29SStefan Bergertpm="no" 3350a12ec87SRichard W.M. Joneslibssh2="" 3364f18b782SJeff Codyvhdx="" 33795c6bff3SBenoît Canetquorum="no" 338377529c0SPaolo Bonzini 339ac0df51dSaliguori# parse CC options first 340ac0df51dSaliguorifor opt do 341ac0df51dSaliguori optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 342ac0df51dSaliguori case "$opt" in 343ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 344ac0df51dSaliguori ;; 3453d8df640SPaolo Bonzini --cc=*) CC="$optarg" 346ac0df51dSaliguori ;; 34783f73fceSTomoki Sekiyama --cxx=*) CXX="$optarg" 34883f73fceSTomoki Sekiyama ;; 349ca4deeb1SPaolo Bonzini --source-path=*) source_path="$optarg" 350ca4deeb1SPaolo Bonzini ;; 3512ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 3522ff6b91eSJuan Quintela ;; 353a558ee17SJuan Quintela --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" 354f9943cd5SGerd Hoffmann EXTRA_CFLAGS="$optarg" 355e2a2ed06SJuan Quintela ;; 356e2a2ed06SJuan Quintela --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" 357f9943cd5SGerd Hoffmann EXTRA_LDFLAGS="$optarg" 358e2a2ed06SJuan Quintela ;; 3595bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 3605bc62e01SGerd Hoffmann ;; 3615bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 3625bc62e01SGerd Hoffmann ;; 363ac0df51dSaliguori esac 364ac0df51dSaliguoridone 365ac0df51dSaliguori# OS specific 366ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 36793148aa5SStefan Weil# we can eliminate its usage altogether. 368ac0df51dSaliguori 369e49d021eSPeter Maydell# Preferred compiler: 370e49d021eSPeter Maydell# ${CC} (if set) 371e49d021eSPeter Maydell# ${cross_prefix}gcc (if cross-prefix specified) 372e49d021eSPeter Maydell# system compiler 373e49d021eSPeter Maydellif test -z "${CC}${cross_prefix}"; then 374e49d021eSPeter Maydell cc="$host_cc" 375e49d021eSPeter Maydellelse 376b3198cc2SStuart Yoder cc="${CC-${cross_prefix}gcc}" 377e49d021eSPeter Maydellfi 378e49d021eSPeter Maydell 37983f73fceSTomoki Sekiyamaif test -z "${CXX}${cross_prefix}"; then 38083f73fceSTomoki Sekiyama cxx="c++" 38183f73fceSTomoki Sekiyamaelse 38283f73fceSTomoki Sekiyama cxx="${CXX-${cross_prefix}g++}" 38383f73fceSTomoki Sekiyamafi 38483f73fceSTomoki Sekiyama 385b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 3863dd46c78SBlue Swirlas="${AS-${cross_prefix}as}" 3873dd46c78SBlue Swirlcpp="${CPP-$cc -E}" 388b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 389b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 3903f534581SBradlibtool="${LIBTOOL-${cross_prefix}libtool}" 391b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 392b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 39317884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 39417884d7bSSergei Trofimovichquery_pkg_config() { 39517884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 39617884d7bSSergei Trofimovich} 39717884d7bSSergei Trofimovichpkg_config=query_pkg_config 398b3198cc2SStuart Yodersdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" 39947c03744SDave Airliesdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" 400ac0df51dSaliguori 40145d285abSPeter Maydell# If the user hasn't specified ARFLAGS, default to 'rv', just as make does. 40245d285abSPeter MaydellARFLAGS="${ARFLAGS-rv}" 40345d285abSPeter Maydell 404be17dc90SMichael S. Tsirkin# default flags for all hosts 4054c288acbSPeter MaydellQEMU_CFLAGS="-fno-strict-aliasing -fno-common $QEMU_CFLAGS" 406f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 407c95e3080SKevin WolfQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 408be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 4096b4c305cSPaolo BonziniQEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include" 4105bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 4115bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 412be17dc90SMichael S. Tsirkin LDFLAGS="-g $LDFLAGS" 4135bc62e01SGerd Hoffmannfi 414be17dc90SMichael S. Tsirkin 415ca4deeb1SPaolo Bonzini# make source path absolute 416ca4deeb1SPaolo Bonzinisource_path=`cd "$source_path"; pwd` 417ca4deeb1SPaolo Bonzini 418ac0df51dSaliguoricheck_define() { 419ac0df51dSaliguoricat > $TMPC <<EOF 420ac0df51dSaliguori#if !defined($1) 421fd786e1aSPeter Maydell#error $1 not defined 422ac0df51dSaliguori#endif 423ac0df51dSaliguoriint main(void) { return 0; } 424ac0df51dSaliguoriEOF 42552166aa0SJuan Quintela compile_object 426ac0df51dSaliguori} 427ac0df51dSaliguori 428bbea4050SPeter Maydellif check_define __linux__ ; then 429bbea4050SPeter Maydell targetos="Linux" 430bbea4050SPeter Maydellelif check_define _WIN32 ; then 431bbea4050SPeter Maydell targetos='MINGW32' 432bbea4050SPeter Maydellelif check_define __OpenBSD__ ; then 433bbea4050SPeter Maydell targetos='OpenBSD' 434bbea4050SPeter Maydellelif check_define __sun__ ; then 435bbea4050SPeter Maydell targetos='SunOS' 436bbea4050SPeter Maydellelif check_define __HAIKU__ ; then 437bbea4050SPeter Maydell targetos='Haiku' 438bbea4050SPeter Maydellelse 439bbea4050SPeter Maydell targetos=`uname -s` 440bbea4050SPeter Maydellfi 441bbea4050SPeter Maydell 442bbea4050SPeter Maydell# Some host OSes need non-standard checks for which CPU to use. 443bbea4050SPeter Maydell# Note that these checks are broken for cross-compilation: if you're 444bbea4050SPeter Maydell# cross-compiling to one of these OSes then you'll need to specify 445bbea4050SPeter Maydell# the correct CPU with the --cpu option. 446bbea4050SPeter Maydellcase $targetos in 447bbea4050SPeter MaydellDarwin) 448bbea4050SPeter Maydell # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can 449bbea4050SPeter Maydell # run 64-bit userspace code. 450bbea4050SPeter Maydell # If the user didn't specify a CPU explicitly and the kernel says this is 451bbea4050SPeter Maydell # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. 452bbea4050SPeter Maydell if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then 453bbea4050SPeter Maydell cpu="x86_64" 454bbea4050SPeter Maydell fi 455bbea4050SPeter Maydell ;; 456bbea4050SPeter MaydellSunOS) 457bbea4050SPeter Maydell # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo 458bbea4050SPeter Maydell if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then 459bbea4050SPeter Maydell cpu="x86_64" 460bbea4050SPeter Maydell fi 461bbea4050SPeter Maydellesac 462bbea4050SPeter Maydell 4632ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 4642ff6b91eSJuan Quintela # command line argument 4652ff6b91eSJuan Quintela : 4662ff6b91eSJuan Quintelaelif check_define __i386__ ; then 467ac0df51dSaliguori cpu="i386" 468ac0df51dSaliguorielif check_define __x86_64__ ; then 469c72b26ecSRichard Henderson if check_define __ILP32__ ; then 470c72b26ecSRichard Henderson cpu="x32" 471c72b26ecSRichard Henderson else 472ac0df51dSaliguori cpu="x86_64" 473c72b26ecSRichard Henderson fi 4743aa9bd6cSblueswir1elif check_define __sparc__ ; then 4753aa9bd6cSblueswir1 if check_define __arch64__ ; then 4763aa9bd6cSblueswir1 cpu="sparc64" 4773aa9bd6cSblueswir1 else 4783aa9bd6cSblueswir1 cpu="sparc" 4793aa9bd6cSblueswir1 fi 480fdf7ed96Smalcelif check_define _ARCH_PPC ; then 481fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 482fdf7ed96Smalc cpu="ppc64" 483ac0df51dSaliguori else 484fdf7ed96Smalc cpu="ppc" 485fdf7ed96Smalc fi 486afa05235SAurelien Jarnoelif check_define __mips__ ; then 487afa05235SAurelien Jarno cpu="mips" 488477ba620SAurelien Jarnoelif check_define __ia64__ ; then 489477ba620SAurelien Jarno cpu="ia64" 490d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 491d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 492d66ed0eaSAurelien Jarno cpu="s390x" 493d66ed0eaSAurelien Jarno else 494d66ed0eaSAurelien Jarno cpu="s390" 495d66ed0eaSAurelien Jarno fi 49621d89f84SPeter Maydellelif check_define __arm__ ; then 49721d89f84SPeter Maydell cpu="arm" 4981f080313SClaudio Fontanaelif check_define __aarch64__ ; then 4991f080313SClaudio Fontana cpu="aarch64" 500f28ffed5SBradelif check_define __hppa__ ; then 501f28ffed5SBrad cpu="hppa" 502fdf7ed96Smalcelse 503fdf7ed96Smalc cpu=`uname -m` 504ac0df51dSaliguorifi 505ac0df51dSaliguori 506359bc95dSPeter MaydellARCH= 507359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 508359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 5097d13299dSbellardcase "$cpu" in 510c72b26ecSRichard Henderson ia64|ppc|ppc64|s390|s390x|sparc64|x32) 511ea8f20f8SJuan Quintela cpu="$cpu" 512ea8f20f8SJuan Quintela ;; 5137d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 51497a847bcSbellard cpu="i386" 5157d13299dSbellard ;; 516aaa5fa14Saurel32 x86_64|amd64) 517aaa5fa14Saurel32 cpu="x86_64" 518aaa5fa14Saurel32 ;; 51921d89f84SPeter Maydell armv*b|armv*l|arm) 52021d89f84SPeter Maydell cpu="arm" 5217d13299dSbellard ;; 5221f080313SClaudio Fontana aarch64) 5231f080313SClaudio Fontana cpu="aarch64" 5241f080313SClaudio Fontana ;; 525afa05235SAurelien Jarno mips*) 526afa05235SAurelien Jarno cpu="mips" 527afa05235SAurelien Jarno ;; 5283142255cSblueswir1 sparc|sun4[cdmuv]) 529ae228531Sbellard cpu="sparc" 530ae228531Sbellard ;; 5317d13299dSbellard *) 532359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 533359bc95dSPeter Maydell ARCH=unknown 5347d13299dSbellard ;; 5357d13299dSbellardesac 536359bc95dSPeter Maydellif test -z "$ARCH"; then 537359bc95dSPeter Maydell ARCH="$cpu" 538359bc95dSPeter Maydellfi 539e2d52ad3SJuan Quintela 5407d13299dSbellard# OS specific 5410dbfc675SJuan Quintela 5427d13299dSbellardcase $targetos in 543c326e0afSbellardCYGWIN*) 544c326e0afSbellard mingw32="yes" 545a558ee17SJuan Quintela QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" 546d5631638Smalc audio_possible_drivers="winwave sdl" 547d5631638Smalc audio_drv_list="winwave" 548c326e0afSbellard;; 54967b915a5SbellardMINGW32*) 55067b915a5Sbellard mingw32="yes" 551d5631638Smalc audio_possible_drivers="winwave dsound sdl fmod" 552d5631638Smalc audio_drv_list="winwave" 55367b915a5Sbellard;; 5545c40d2bdSthsGNU/kFreeBSD) 555a167ba50SAurelien Jarno bsd="yes" 5560c58ac1cSmalc audio_drv_list="oss" 557f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 5585c40d2bdSths;; 5597d3505c5SbellardFreeBSD) 5607d3505c5Sbellard bsd="yes" 5610db4a067SPaolo Bonzini make="${MAKE-gmake}" 5620c58ac1cSmalc audio_drv_list="oss" 563f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 564f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 565f01576f1SJuergen Lock LIBS="-lutil $LIBS" 56658952137SVincenzo Maffione netmap="" # enable netmap autodetect 5677d3505c5Sbellard;; 568c5e97233Sblueswir1DragonFly) 569c5e97233Sblueswir1 bsd="yes" 5700db4a067SPaolo Bonzini make="${MAKE-gmake}" 571c5e97233Sblueswir1 audio_drv_list="oss" 572c5e97233Sblueswir1 audio_possible_drivers="oss sdl esd pa" 573c5e97233Sblueswir1;; 5747d3505c5SbellardNetBSD) 5757d3505c5Sbellard bsd="yes" 5760db4a067SPaolo Bonzini make="${MAKE-gmake}" 5770c58ac1cSmalc audio_drv_list="oss" 578c2de5c91Smalc audio_possible_drivers="oss sdl esd" 5798ef92a88Sblueswir1 oss_lib="-lossaudio" 5807d3505c5Sbellard;; 5817d3505c5SbellardOpenBSD) 5827d3505c5Sbellard bsd="yes" 5830db4a067SPaolo Bonzini make="${MAKE-gmake}" 5844f6ab397SBrad Smith audio_drv_list="sdl" 5854f6ab397SBrad Smith audio_possible_drivers="sdl esd" 5867d3505c5Sbellard;; 58783fb7adfSbellardDarwin) 58883fb7adfSbellard bsd="yes" 58983fb7adfSbellard darwin="yes" 59017969268SFam Zheng LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" 5911b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 592a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 5930c439cbfSJuan Quintela LDFLAGS="-arch x86_64 $LDFLAGS" 5941b0f9cc2Saliguori fi 595fd677642Sths cocoa="yes" 5960c58ac1cSmalc audio_drv_list="coreaudio" 597c2de5c91Smalc audio_possible_drivers="coreaudio sdl fmod" 5980c439cbfSJuan Quintela LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" 5997973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 600a0b7cf6bSPeter Maydell # Disable attempts to use ObjectiveC features in os/object.h since they 601a0b7cf6bSPeter Maydell # won't work when we're compiling with gcc as a C compiler. 602a0b7cf6bSPeter Maydell QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" 60383fb7adfSbellard;; 604ec530c81SbellardSunOS) 605ec530c81Sbellard solaris="yes" 6060db4a067SPaolo Bonzini make="${MAKE-gmake}" 6070db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 608fa58948dSBlue Swirl ld="gld" 609e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 6100475a5caSths needs_libsunmath="no" 611c2b84fabSths solarisrev=`uname -r | cut -f2 -d.` 612c2b84fabSths if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 6130475a5caSths if test "$solarisrev" -le 9 ; then 6140475a5caSths if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then 6150475a5caSths needs_libsunmath="yes" 616f14bfdf9SJuan Quintela QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" 617f14bfdf9SJuan Quintela LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" 618f14bfdf9SJuan Quintela LIBS="-lsunmath $LIBS" 6190475a5caSths else 62076ad07a4SPeter Maydell error_exit "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" \ 62176ad07a4SPeter Maydell "libsunmath from the Sun Studio compilers tools, due to a lack of" \ 62276ad07a4SPeter Maydell "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" \ 62376ad07a4SPeter Maydell "Studio 11 can be downloaded from www.sun.com." 6240475a5caSths fi 6250475a5caSths fi 62686b2bd93Sths fi 6276b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 6280c58ac1cSmalc audio_drv_list="oss" 6296b4d2ba1Sths fi 630c2de5c91Smalc audio_possible_drivers="oss sdl" 631d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 632d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 633d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 634d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 635a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 636560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 637560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 638560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 639ec530c81Sbellard;; 640b29fe3edSmalcAIX) 641b29fe3edSmalc aix="yes" 6420db4a067SPaolo Bonzini make="${MAKE-gmake}" 643b29fe3edSmalc;; 644179cf400SAndreas FärberHaiku) 645179cf400SAndreas Färber haiku="yes" 646179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 647179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 648179cf400SAndreas Färber;; 649fb065187Sbellard*) 6500c58ac1cSmalc audio_drv_list="oss" 651b8e59f18Smalc audio_possible_drivers="oss alsa sdl esd pa" 6525327cf48Sbellard linux="yes" 653831b7825Sths linux_user="yes" 654af2be207SJan Kiszka kvm="yes" 655af2be207SJan Kiszka vhost_net="yes" 6565e9be92dSNicholas Bellinger vhost_scsi="yes" 657c72b26ecSRichard Henderson if [ "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "x32" ] ; then 658c2de5c91Smalc audio_possible_drivers="$audio_possible_drivers fmod" 659c9ec1fe4Sbellard fi 660a585140dSAlexey Kardashevskiy QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES" 661fb065187Sbellard;; 6627d13299dSbellardesac 6637d13299dSbellard 6647d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 665b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 66684778508Sblueswir1 bsd_user="yes" 6677d3505c5Sbellard fi 66808de3949SAndreas Färberfi 6697d3505c5Sbellard 6700db4a067SPaolo Bonzini: ${make=${MAKE-make}} 6710db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 67252510f8bSStefan Weil: ${python=${PYTHON-python}} 673e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 6740db4a067SPaolo Bonzini 6753c4a4d0dSPeter Maydell# Default objcc to clang if available, otherwise use CC 6763c4a4d0dSPeter Maydellif has clang; then 6773c4a4d0dSPeter Maydell objcc=clang 6783c4a4d0dSPeter Maydellelse 6793c4a4d0dSPeter Maydell objcc="$cc" 6803c4a4d0dSPeter Maydellfi 6813c4a4d0dSPeter Maydell 6823457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 6833457a3f8SJuan Quintela EXESUF=".exe" 68417969268SFam Zheng DSOSUF=".dll" 685a558ee17SJuan Quintela QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" 686e94a7936SStefan Weil # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) 687e94a7936SStefan Weil QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" 688f7cf5d5bSStefan Weil LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" 689f7cf5d5bSStefan Weilcat > $TMPC << EOF 690f7cf5d5bSStefan Weilint main(void) { return 0; } 691f7cf5d5bSStefan WeilEOF 692f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 693f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 694f7cf5d5bSStefan Weil fi 695c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 696683035deSPaolo Bonzini mandir="\${prefix}" 697528ae5b8SEduardo Habkost datadir="\${prefix}" 698850da188SEduardo Habkost qemu_docdir="\${prefix}" 699683035deSPaolo Bonzini bindir="\${prefix}" 700683035deSPaolo Bonzini sysconfdir="\${prefix}" 7015a699bbbSLaszlo Ersek local_statedir= 702683035deSPaolo Bonzini confsuffix="" 703368542b8SStefan Hajnoczi libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" 7043457a3f8SJuan Quintelafi 7053457a3f8SJuan Quintela 706487fefdbSAnthony Liguoriwerror="" 70785aa5189Sbellard 7087d13299dSbellardfor opt do 709a46e4035Spbrook optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 7107d13299dSbellard case "$opt" in 7112efc3265Sbellard --help|-h) show_help=yes 7122efc3265Sbellard ;; 71399123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 71499123e13SMike Frysinger ;; 715b1a550a0Spbrook --prefix=*) prefix="$optarg" 7167d13299dSbellard ;; 717b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 71832ce6337Sbellard ;; 719ca4deeb1SPaolo Bonzini --source-path=*) 7207d13299dSbellard ;; 721ac0df51dSaliguori --cross-prefix=*) 7227d13299dSbellard ;; 723ac0df51dSaliguori --cc=*) 7247d13299dSbellard ;; 725b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 72683469015Sbellard ;; 72783f73fceSTomoki Sekiyama --cxx=*) 72883f73fceSTomoki Sekiyama ;; 729e007dbecSMichael S. Tsirkin --iasl=*) iasl="$optarg" 730e007dbecSMichael S. Tsirkin ;; 7313c4a4d0dSPeter Maydell --objcc=*) objcc="$optarg" 7323c4a4d0dSPeter Maydell ;; 733b1a550a0Spbrook --make=*) make="$optarg" 7347d13299dSbellard ;; 7356a882643Spbrook --install=*) install="$optarg" 7366a882643Spbrook ;; 737c886edfbSBlue Swirl --python=*) python="$optarg" 738c886edfbSBlue Swirl ;; 7391d728c39SBlue Swirl --gcov=*) gcov_tool="$optarg" 7401d728c39SBlue Swirl ;; 741e2d8830eSBrad --smbd=*) smbd="$optarg" 742e2d8830eSBrad ;; 743e2a2ed06SJuan Quintela --extra-cflags=*) 7447d13299dSbellard ;; 745e2a2ed06SJuan Quintela --extra-ldflags=*) 7467d13299dSbellard ;; 7475bc62e01SGerd Hoffmann --enable-debug-info) 7485bc62e01SGerd Hoffmann ;; 7495bc62e01SGerd Hoffmann --disable-debug-info) 7505bc62e01SGerd Hoffmann ;; 75117969268SFam Zheng --enable-modules) 75217969268SFam Zheng modules="yes" 75317969268SFam Zheng ;; 7542ff6b91eSJuan Quintela --cpu=*) 7557d13299dSbellard ;; 756b1a550a0Spbrook --target-list=*) target_list="$optarg" 757de83cd02Sbellard ;; 75874242e0fSPaolo Bonzini --enable-trace-backend=*) trace_backend="$optarg" 75994a420b1SStefan Hajnoczi ;; 76074242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 7619410b56cSPrerna Saxena ;; 7627d13299dSbellard --enable-gprof) gprof="yes" 7637d13299dSbellard ;; 7641d728c39SBlue Swirl --enable-gcov) gcov="yes" 7651d728c39SBlue Swirl ;; 76679427693SLoïc Minier --static) 76779427693SLoïc Minier static="yes" 76879427693SLoïc Minier LDFLAGS="-static $LDFLAGS" 76917884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 77043ce4dfeSbellard ;; 7710b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 7720b24e75fSPaolo Bonzini ;; 7730b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 7740b24e75fSPaolo Bonzini ;; 7753aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 7763aa5d2beSAlon Levy ;; 7778bf188aaSMichael Tokarev --libexecdir=*) libexecdir="$optarg" 7788bf188aaSMichael Tokarev ;; 7790f94d6daSAlon Levy --includedir=*) includedir="$optarg" 7800f94d6daSAlon Levy ;; 781528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 7820b24e75fSPaolo Bonzini ;; 783023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 784023d3d67SEduardo Habkost ;; 785850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 7860b24e75fSPaolo Bonzini ;; 787ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 78807381cc1SAnthony Liguori ;; 789785c23aeSLuiz Capitulino --localstatedir=*) local_statedir="$optarg" 790785c23aeSLuiz Capitulino ;; 791785c23aeSLuiz Capitulino --sbindir=*|--sharedstatedir=*|\ 792023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 793023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 794023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 795023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 796023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 797023ddd74SMax Filippov # lots of directory switches by default. 798023ddd74SMax Filippov ;; 799e2134eb9SGerd Hoffmann --with-system-pixman) pixman="system" 800e2134eb9SGerd Hoffmann ;; 801e2134eb9SGerd Hoffmann --without-system-pixman) pixman="internal" 802e2134eb9SGerd Hoffmann ;; 80374880fe2SRobert Schiele --without-pixman) pixman="none" 80474880fe2SRobert Schiele ;; 80597a847bcSbellard --disable-sdl) sdl="no" 80697a847bcSbellard ;; 807c4198157SJuan Quintela --enable-sdl) sdl="yes" 808c4198157SJuan Quintela ;; 80947c03744SDave Airlie --with-sdlabi=*) sdlabi="$optarg" 81047c03744SDave Airlie ;; 8113556c233SPaolo Bonzini --disable-qom-cast-debug) qom_cast_debug="no" 8123556c233SPaolo Bonzini ;; 8133556c233SPaolo Bonzini --enable-qom-cast-debug) qom_cast_debug="yes" 8143556c233SPaolo Bonzini ;; 815983eef5aSMeador Inge --disable-virtfs) virtfs="no" 816983eef5aSMeador Inge ;; 817983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 818983eef5aSMeador Inge ;; 819821601eaSJes Sorensen --disable-vnc) vnc="no" 820821601eaSJes Sorensen ;; 821821601eaSJes Sorensen --enable-vnc) vnc="yes" 822821601eaSJes Sorensen ;; 823b1a550a0Spbrook --fmod-lib=*) fmod_lib="$optarg" 824102a52e4Sbellard ;; 825c2de5c91Smalc --fmod-inc=*) fmod_inc="$optarg" 826c2de5c91Smalc ;; 8272f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 8282f6a1ab0Sblueswir1 ;; 8290c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 8300c58ac1cSmalc ;; 831b64ec4e4SFam Zheng --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 832b64ec4e4SFam Zheng ;; 833b64ec4e4SFam Zheng --block-drv-ro-whitelist=*) block_drv_ro_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 834eb852011SMarkus Armbruster ;; 835f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 836f8393946Saurel32 ;; 837f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 838f8393946Saurel32 ;; 839f3d08ee6SPaul Brook --enable-debug) 840f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 841f3d08ee6SPaul Brook debug_tcg="yes" 842f3d08ee6SPaul Brook debug="yes" 843f3d08ee6SPaul Brook strip_opt="no" 844f3d08ee6SPaul Brook ;; 84503b4fe7dSaliguori --enable-sparse) sparse="yes" 84603b4fe7dSaliguori ;; 84703b4fe7dSaliguori --disable-sparse) sparse="no" 84803b4fe7dSaliguori ;; 8491625af87Saliguori --disable-strip) strip_opt="no" 8501625af87Saliguori ;; 8518d5d2d4cSths --disable-vnc-tls) vnc_tls="no" 8528d5d2d4cSths ;; 8531be10ad2SJuan Quintela --enable-vnc-tls) vnc_tls="yes" 8541be10ad2SJuan Quintela ;; 8552f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 8562f9606b3Saliguori ;; 857ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 858ea784e3bSJuan Quintela ;; 8592f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 8602f6f5c7aSCorentin Chary ;; 8612f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 8622f6f5c7aSCorentin Chary ;; 863efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 864efe556adSCorentin Chary ;; 865efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 866efe556adSCorentin Chary ;; 8677536ee4bSTim Hardeck --disable-vnc-ws) vnc_ws="no" 8687536ee4bSTim Hardeck ;; 8697536ee4bSTim Hardeck --enable-vnc-ws) vnc_ws="yes" 8707536ee4bSTim Hardeck ;; 871443f1376Sbellard --disable-slirp) slirp="no" 872c20709aaSbellard ;; 873ee682d27SStefan Weil --disable-uuid) uuid="no" 874ee682d27SStefan Weil ;; 875ee682d27SStefan Weil --enable-uuid) uuid="yes" 876ee682d27SStefan Weil ;; 877e0e6c8c0Saliguori --disable-vde) vde="no" 8788a16d273Sths ;; 879dfb278bdSJuan Quintela --enable-vde) vde="yes" 880dfb278bdSJuan Quintela ;; 88158952137SVincenzo Maffione --disable-netmap) netmap="no" 88258952137SVincenzo Maffione ;; 88358952137SVincenzo Maffione --enable-netmap) netmap="yes" 88458952137SVincenzo Maffione ;; 885e37630caSaliguori --disable-xen) xen="no" 886e37630caSaliguori ;; 887fc321b4bSJuan Quintela --enable-xen) xen="yes" 888fc321b4bSJuan Quintela ;; 889eb6fda0fSAnthony PERARD --disable-xen-pci-passthrough) xen_pci_passthrough="no" 890eb6fda0fSAnthony PERARD ;; 891eb6fda0fSAnthony PERARD --enable-xen-pci-passthrough) xen_pci_passthrough="yes" 892eb6fda0fSAnthony PERARD ;; 8932e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 8942e4d9fb1Saurel32 ;; 8954ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 8964ffcedb6SJuan Quintela ;; 897fb599c9aSbalrog --disable-bluez) bluez="no" 898fb599c9aSbalrog ;; 899a20a6f46SJuan Quintela --enable-bluez) bluez="yes" 900a20a6f46SJuan Quintela ;; 9017ba1e619Saliguori --disable-kvm) kvm="no" 9027ba1e619Saliguori ;; 903b31a0277SJuan Quintela --enable-kvm) kvm="yes" 904b31a0277SJuan Quintela ;; 9059195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 9069195b2c2SStefan Weil ;; 9079195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 9089195b2c2SStefan Weil ;; 90947e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 91047e98658SCorey Bryant ;; 91147e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 91247e98658SCorey Bryant ;; 913cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 914cd4ec0b4SGerd Hoffmann ;; 915cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 916cd4ec0b4SGerd Hoffmann ;; 917c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 918c589b249SRonnie Sahlberg ;; 919c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 920c589b249SRonnie Sahlberg ;; 9216542aa9cSPeter Lieven --disable-libnfs) libnfs="no" 9226542aa9cSPeter Lieven ;; 9236542aa9cSPeter Lieven --enable-libnfs) libnfs="yes" 9246542aa9cSPeter Lieven ;; 92505c2a3e7Sbellard --enable-profiler) profiler="yes" 92605c2a3e7Sbellard ;; 92714821030SPavel Borzenkov --disable-cocoa) cocoa="no" 92814821030SPavel Borzenkov ;; 929c2de5c91Smalc --enable-cocoa) 930c2de5c91Smalc cocoa="yes" ; 931c2de5c91Smalc sdl="no" ; 932c2de5c91Smalc audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" 9335b0753e0Sbellard ;; 934cad25d69Spbrook --disable-system) softmmu="no" 9350a8e90f4Spbrook ;; 936cad25d69Spbrook --enable-system) softmmu="yes" 9370a8e90f4Spbrook ;; 9380953a80fSZachary Amsden --disable-user) 9390953a80fSZachary Amsden linux_user="no" ; 9400953a80fSZachary Amsden bsd_user="no" ; 9410953a80fSZachary Amsden ;; 9420953a80fSZachary Amsden --enable-user) ;; 943831b7825Sths --disable-linux-user) linux_user="no" 9440a8e90f4Spbrook ;; 945831b7825Sths --enable-linux-user) linux_user="yes" 946831b7825Sths ;; 94784778508Sblueswir1 --disable-bsd-user) bsd_user="no" 94884778508Sblueswir1 ;; 94984778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 95084778508Sblueswir1 ;; 951379f6698SPaul Brook --enable-guest-base) guest_base="yes" 952379f6698SPaul Brook ;; 953379f6698SPaul Brook --disable-guest-base) guest_base="no" 954379f6698SPaul Brook ;; 95540d6444eSAvi Kivity --enable-pie) pie="yes" 95634005a00SKirill A. Shutemov ;; 95740d6444eSAvi Kivity --disable-pie) pie="no" 95834005a00SKirill A. Shutemov ;; 959c5937220Spbrook --enable-uname-release=*) uname_release="$optarg" 960c5937220Spbrook ;; 96185aa5189Sbellard --enable-werror) werror="yes" 96285aa5189Sbellard ;; 96385aa5189Sbellard --disable-werror) werror="no" 96485aa5189Sbellard ;; 9654d3b6f6eSbalrog --disable-curses) curses="no" 9664d3b6f6eSbalrog ;; 967c584a6d0SJuan Quintela --enable-curses) curses="yes" 968c584a6d0SJuan Quintela ;; 969769ce76dSAlexander Graf --disable-curl) curl="no" 970769ce76dSAlexander Graf ;; 971788c8196SJuan Quintela --enable-curl) curl="yes" 972788c8196SJuan Quintela ;; 9732df87df7SJuan Quintela --disable-fdt) fdt="no" 9742df87df7SJuan Quintela ;; 9752df87df7SJuan Quintela --enable-fdt) fdt="yes" 9762df87df7SJuan Quintela ;; 9775c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 9785c6c3a6cSChristoph Hellwig ;; 9795c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 9805c6c3a6cSChristoph Hellwig ;; 981758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 982758e8e38SVenkateswararao Jujjuri (JV) ;; 983758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 984758e8e38SVenkateswararao Jujjuri (JV) ;; 98577755340Sths --disable-blobs) blobs="no" 98677755340Sths ;; 9874a19f1ecSpbrook --with-pkgversion=*) pkgversion=" ($optarg)" 9884a19f1ecSpbrook ;; 989519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 990519175a2SAlex Barcelo ;; 99170c60c08SStefan Hajnoczi --disable-coroutine-pool) coroutine_pool="no" 99270c60c08SStefan Hajnoczi ;; 99370c60c08SStefan Hajnoczi --enable-coroutine-pool) coroutine_pool="yes" 99470c60c08SStefan Hajnoczi ;; 995a25dba17SJuan Quintela --disable-docs) docs="no" 99670ec5dc0SAnthony Liguori ;; 997a25dba17SJuan Quintela --enable-docs) docs="yes" 99883a3ab8bSJuan Quintela ;; 999d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 1000d5970055SMichael S. Tsirkin ;; 1001d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 1002d5970055SMichael S. Tsirkin ;; 10035e9be92dSNicholas Bellinger --disable-vhost-scsi) vhost_scsi="no" 10045e9be92dSNicholas Bellinger ;; 10055e9be92dSNicholas Bellinger --enable-vhost-scsi) vhost_scsi="yes" 10065e9be92dSNicholas Bellinger ;; 1007b1e5fff4SMichael Walle --disable-glx) glx="no" 100820ff075bSMichael Walle ;; 1009b1e5fff4SMichael Walle --enable-glx) glx="yes" 101020ff075bSMichael Walle ;; 1011f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 1012f27aaf4bSChristian Brunner ;; 1013f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 1014f27aaf4bSChristian Brunner ;; 10158c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 10168c84cf11SSergei Trofimovich ;; 10178c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 10188c84cf11SSergei Trofimovich ;; 1019111a38b0SRobert Relyea --disable-smartcard-nss) smartcard_nss="no" 1020111a38b0SRobert Relyea ;; 1021111a38b0SRobert Relyea --enable-smartcard-nss) smartcard_nss="yes" 1022111a38b0SRobert Relyea ;; 10232b2325ffSGerd Hoffmann --disable-libusb) libusb="no" 10242b2325ffSGerd Hoffmann ;; 10252b2325ffSGerd Hoffmann --enable-libusb) libusb="yes" 10262b2325ffSGerd Hoffmann ;; 102769354a83SHans de Goede --disable-usb-redir) usb_redir="no" 102869354a83SHans de Goede ;; 102969354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 103069354a83SHans de Goede ;; 10311ece9905SAlon Levy --disable-zlib-test) zlib="no" 10321ece9905SAlon Levy ;; 1033607dacd0Sqiaonuohan --enable-lzo) lzo="yes" 1034607dacd0Sqiaonuohan ;; 1035607dacd0Sqiaonuohan --enable-snappy) snappy="yes" 1036607dacd0Sqiaonuohan ;; 1037d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 1038d138cee9SMichael Roth ;; 1039d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 1040d138cee9SMichael Roth ;; 1041d9840e25STomoki Sekiyama --with-vss-sdk) vss_win32_sdk="" 1042d9840e25STomoki Sekiyama ;; 1043d9840e25STomoki Sekiyama --with-vss-sdk=*) vss_win32_sdk="$optarg" 1044d9840e25STomoki Sekiyama ;; 1045d9840e25STomoki Sekiyama --without-vss-sdk) vss_win32_sdk="no" 1046d9840e25STomoki Sekiyama ;; 1047d9840e25STomoki Sekiyama --with-win-sdk) win_sdk="" 1048d9840e25STomoki Sekiyama ;; 1049d9840e25STomoki Sekiyama --with-win-sdk=*) win_sdk="$optarg" 1050d9840e25STomoki Sekiyama ;; 1051d9840e25STomoki Sekiyama --without-win-sdk) win_sdk="no" 1052d9840e25STomoki Sekiyama ;; 10534b1c11fdSDaniel P. Berrange --enable-tools) want_tools="yes" 10544b1c11fdSDaniel P. Berrange ;; 10554b1c11fdSDaniel P. Berrange --disable-tools) want_tools="no" 10564b1c11fdSDaniel P. Berrange ;; 1057f794573eSEduardo Otubo --enable-seccomp) seccomp="yes" 1058f794573eSEduardo Otubo ;; 1059f794573eSEduardo Otubo --disable-seccomp) seccomp="no" 1060f794573eSEduardo Otubo ;; 1061eb100396SBharata B Rao --disable-glusterfs) glusterfs="no" 1062eb100396SBharata B Rao ;; 1063eb100396SBharata B Rao --enable-glusterfs) glusterfs="yes" 1064eb100396SBharata B Rao ;; 1065583f6e7bSStefan Hajnoczi --disable-virtio-blk-data-plane) virtio_blk_data_plane="no" 1066583f6e7bSStefan Hajnoczi ;; 1067583f6e7bSStefan Hajnoczi --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes" 1068583f6e7bSStefan Hajnoczi ;; 1069a4ccabcfSAnthony Liguori --disable-gtk) gtk="no" 1070a4ccabcfSAnthony Liguori ;; 1071a4ccabcfSAnthony Liguori --enable-gtk) gtk="yes" 1072a4ccabcfSAnthony Liguori ;; 10732da776dbSMichael R. Hines --enable-rdma) rdma="yes" 10742da776dbSMichael R. Hines ;; 10752da776dbSMichael R. Hines --disable-rdma) rdma="no" 10762da776dbSMichael R. Hines ;; 1077528de90aSDaniel P. Berrange --with-gtkabi=*) gtkabi="$optarg" 1078528de90aSDaniel P. Berrange ;; 1079ab214c29SStefan Berger --enable-tpm) tpm="yes" 1080ab214c29SStefan Berger ;; 10810a12ec87SRichard W.M. Jones --disable-libssh2) libssh2="no" 10820a12ec87SRichard W.M. Jones ;; 10830a12ec87SRichard W.M. Jones --enable-libssh2) libssh2="yes" 10840a12ec87SRichard W.M. Jones ;; 10854f18b782SJeff Cody --enable-vhdx) vhdx="yes" 10864f18b782SJeff Cody ;; 10874f18b782SJeff Cody --disable-vhdx) vhdx="no" 10884f18b782SJeff Cody ;; 108995c6bff3SBenoît Canet --disable-quorum) quorum="no" 109095c6bff3SBenoît Canet ;; 109195c6bff3SBenoît Canet --enable-quorum) quorum="yes" 109295c6bff3SBenoît Canet ;; 10937f1559c6Sbalrog *) echo "ERROR: unknown option $opt"; show_help="yes" 10947f1559c6Sbalrog ;; 10957d13299dSbellard esac 10967d13299dSbellarddone 10977d13299dSbellard 1098f6f0b7d9SStefan Weilif ! has $python; then 1099f6f0b7d9SStefan Weil error_exit "Python not found. Use --python=/path/to/python" 1100f6f0b7d9SStefan Weilfi 1101f6f0b7d9SStefan Weil 1102f6f0b7d9SStefan Weil# Note that if the Python conditional here evaluates True we will exit 1103f6f0b7d9SStefan Weil# with status 1 which is a shell 'false' value. 1104f6f0b7d9SStefan Weilif ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then 1105f6f0b7d9SStefan Weil error_exit "Cannot use '$python', Python 2.4 or later is required." \ 1106f6f0b7d9SStefan Weil "Note that Python 3 or later is not yet supported." \ 1107f6f0b7d9SStefan Weil "Use --python=/path/to/python to specify a supported Python." 1108f6f0b7d9SStefan Weilfi 1109f6f0b7d9SStefan Weil 1110f6f0b7d9SStefan Weil# The -B switch was added in Python 2.6. 1111f6f0b7d9SStefan Weil# If it is supplied, compiled files are not written. 1112f6f0b7d9SStefan Weil# Use it for Python versions which support it. 1113f6f0b7d9SStefan Weilif $python -B -c 'import sys; sys.exit(0)' 2>/dev/null; then 1114f6f0b7d9SStefan Weil python="$python -B" 1115f6f0b7d9SStefan Weilfi 1116f6f0b7d9SStefan Weil 111740293e58Sbellardcase "$cpu" in 1118e3608d66SRichard Henderson ppc) 1119e3608d66SRichard Henderson CPU_CFLAGS="-m32" 1120e3608d66SRichard Henderson LDFLAGS="-m32 $LDFLAGS" 1121e3608d66SRichard Henderson ;; 1122e3608d66SRichard Henderson ppc64) 1123e3608d66SRichard Henderson CPU_CFLAGS="-m64" 1124e3608d66SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 1125e3608d66SRichard Henderson ;; 11269b9c37c3SRichard Henderson sparc) 11270c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 112879f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32 -mcpu=ultrasparc" 11293142255cSblueswir1 ;; 1130ed968ff1SJuan Quintela sparc64) 11310c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 113279f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -mcpu=ultrasparc" 11333142255cSblueswir1 ;; 113476d83bdeSths s390) 113579f3b12fSPeter Crosthwaite CPU_CFLAGS="-m31 -march=z990" 113628d7cc49SRichard Henderson LDFLAGS="-m31 $LDFLAGS" 113728d7cc49SRichard Henderson ;; 113828d7cc49SRichard Henderson s390x) 113979f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -march=z990" 114028d7cc49SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 114176d83bdeSths ;; 114240293e58Sbellard i386) 114379f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32" 11440c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 11452b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 114640293e58Sbellard ;; 114740293e58Sbellard x86_64) 114879f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64" 11490c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 11502b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 1151379f6698SPaul Brook ;; 1152c72b26ecSRichard Henderson x32) 1153c72b26ecSRichard Henderson CPU_CFLAGS="-mx32" 1154c72b26ecSRichard Henderson LDFLAGS="-mx32 $LDFLAGS" 1155c72b26ecSRichard Henderson cc_i386='$(CC) -m32' 1156c72b26ecSRichard Henderson ;; 115730163d89SPeter Maydell # No special flags required for other host CPUs 11583142255cSblueswir1esac 11593142255cSblueswir1 116079f3b12fSPeter CrosthwaiteQEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" 116179f3b12fSPeter CrosthwaiteEXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS" 116279f3b12fSPeter Crosthwaite 116360e0df25SPeter Maydelldefault_target_list="" 116460e0df25SPeter Maydell 11656e92f823SPeter Maydellmak_wilds="" 11666e92f823SPeter Maydell 116760e0df25SPeter Maydellif [ "$softmmu" = "yes" ]; then 11686e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" 116960e0df25SPeter Maydellfi 117060e0df25SPeter Maydellif [ "$linux_user" = "yes" ]; then 11716e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" 117260e0df25SPeter Maydellfi 117360e0df25SPeter Maydellif [ "$bsd_user" = "yes" ]; then 11746e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" 117560e0df25SPeter Maydellfi 117660e0df25SPeter Maydell 11776e92f823SPeter Maydellfor config in $mak_wilds; do 11786e92f823SPeter Maydell default_target_list="${default_target_list} $(basename "$config" .mak)" 11796e92f823SPeter Maydelldone 11806e92f823SPeter Maydell 1181af5db58eSpbrookif test x"$show_help" = x"yes" ; then 1182af5db58eSpbrookcat << EOF 1183af5db58eSpbrook 1184af5db58eSpbrookUsage: configure [options] 1185af5db58eSpbrookOptions: [defaults in brackets after descriptions] 1186af5db58eSpbrook 118708fb77edSStefan WeilStandard options: 118808fb77edSStefan Weil --help print this message 118908fb77edSStefan Weil --prefix=PREFIX install in PREFIX [$prefix] 119008fb77edSStefan Weil --interp-prefix=PREFIX where to find shared libraries, etc. 119108fb77edSStefan Weil use %M for cpu name [$interp_prefix] 119208fb77edSStefan Weil --target-list=LIST set target list (default: build everything) 119308fb77edSStefan Weil$(echo Available targets: $default_target_list | \ 119408fb77edSStefan Weil fold -s -w 53 | sed -e 's/^/ /') 119508fb77edSStefan Weil 119608fb77edSStefan WeilAdvanced options (experts only): 119708fb77edSStefan Weil --source-path=PATH path of source code [$source_path] 119808fb77edSStefan Weil --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] 119908fb77edSStefan Weil --cc=CC use C compiler CC [$cc] 120008fb77edSStefan Weil --iasl=IASL use ACPI compiler IASL [$iasl] 120108fb77edSStefan Weil --host-cc=CC use C compiler CC [$host_cc] for code run at 120208fb77edSStefan Weil build time 120308fb77edSStefan Weil --cxx=CXX use C++ compiler CXX [$cxx] 120408fb77edSStefan Weil --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] 120508fb77edSStefan Weil --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS 120608fb77edSStefan Weil --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS 120708fb77edSStefan Weil --make=MAKE use specified make [$make] 120808fb77edSStefan Weil --install=INSTALL use specified install [$install] 120908fb77edSStefan Weil --python=PYTHON use specified python [$python] 121008fb77edSStefan Weil --smbd=SMBD use specified smbd [$smbd] 121108fb77edSStefan Weil --static enable static build [$static] 121208fb77edSStefan Weil --mandir=PATH install man pages in PATH 121308fb77edSStefan Weil --datadir=PATH install firmware in PATH$confsuffix 121408fb77edSStefan Weil --docdir=PATH install documentation in PATH$confsuffix 121508fb77edSStefan Weil --bindir=PATH install binaries in PATH 121608fb77edSStefan Weil --libdir=PATH install libraries in PATH 121708fb77edSStefan Weil --sysconfdir=PATH install config in PATH$confsuffix 121808fb77edSStefan Weil --localstatedir=PATH install local state in PATH (set at runtime on win32) 1219e26110cfSFam Zheng --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] 122017969268SFam Zheng --enable-modules enable modules support 122108fb77edSStefan Weil --enable-debug-tcg enable TCG debugging 122208fb77edSStefan Weil --disable-debug-tcg disable TCG debugging (default) 122308fb77edSStefan Weil --enable-debug-info enable debugging information (default) 122408fb77edSStefan Weil --disable-debug-info disable debugging information 122508fb77edSStefan Weil --enable-debug enable common debug build options 122608fb77edSStefan Weil --enable-sparse enable sparse checker 122708fb77edSStefan Weil --disable-sparse disable sparse checker (default) 122808fb77edSStefan Weil --disable-strip disable stripping binaries 122908fb77edSStefan Weil --disable-werror disable compilation abort on warning 123008fb77edSStefan Weil --disable-sdl disable SDL 123108fb77edSStefan Weil --enable-sdl enable SDL 123247c03744SDave Airlie --with-sdlabi select preferred SDL ABI 1.2 or 2.0 123308fb77edSStefan Weil --disable-gtk disable gtk UI 123408fb77edSStefan Weil --enable-gtk enable gtk UI 123508fb77edSStefan Weil --disable-virtfs disable VirtFS 123608fb77edSStefan Weil --enable-virtfs enable VirtFS 123708fb77edSStefan Weil --disable-vnc disable VNC 123808fb77edSStefan Weil --enable-vnc enable VNC 123908fb77edSStefan Weil --disable-cocoa disable Cocoa (Mac OS X only) 124008fb77edSStefan Weil --enable-cocoa enable Cocoa (default on Mac OS X) 124108fb77edSStefan Weil --audio-drv-list=LIST set audio drivers list: 124208fb77edSStefan Weil Available drivers: $audio_possible_drivers 124308fb77edSStefan Weil --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L 124408fb77edSStefan Weil --block-drv-rw-whitelist=L 124508fb77edSStefan Weil set block driver read-write whitelist 124608fb77edSStefan Weil (affects only QEMU, not qemu-img) 124708fb77edSStefan Weil --block-drv-ro-whitelist=L 124808fb77edSStefan Weil set block driver read-only whitelist 124908fb77edSStefan Weil (affects only QEMU, not qemu-img) 125008fb77edSStefan Weil --disable-xen disable xen backend driver support 125108fb77edSStefan Weil --enable-xen enable xen backend driver support 125208fb77edSStefan Weil --disable-xen-pci-passthrough 125308fb77edSStefan Weil --enable-xen-pci-passthrough 125408fb77edSStefan Weil --disable-brlapi disable BrlAPI 125508fb77edSStefan Weil --enable-brlapi enable BrlAPI 125608fb77edSStefan Weil --disable-vnc-tls disable TLS encryption for VNC server 125708fb77edSStefan Weil --enable-vnc-tls enable TLS encryption for VNC server 125808fb77edSStefan Weil --disable-vnc-sasl disable SASL encryption for VNC server 125908fb77edSStefan Weil --enable-vnc-sasl enable SASL encryption for VNC server 126008fb77edSStefan Weil --disable-vnc-jpeg disable JPEG lossy compression for VNC server 126108fb77edSStefan Weil --enable-vnc-jpeg enable JPEG lossy compression for VNC server 126208fb77edSStefan Weil --disable-vnc-png disable PNG compression for VNC server (default) 126308fb77edSStefan Weil --enable-vnc-png enable PNG compression for VNC server 126408fb77edSStefan Weil --disable-vnc-ws disable Websockets support for VNC server 126508fb77edSStefan Weil --enable-vnc-ws enable Websockets support for VNC server 126608fb77edSStefan Weil --disable-curses disable curses output 126708fb77edSStefan Weil --enable-curses enable curses output 126808fb77edSStefan Weil --disable-curl disable curl connectivity 126908fb77edSStefan Weil --enable-curl enable curl connectivity 127008fb77edSStefan Weil --disable-fdt disable fdt device tree 127108fb77edSStefan Weil --enable-fdt enable fdt device tree 127208fb77edSStefan Weil --disable-bluez disable bluez stack connectivity 127308fb77edSStefan Weil --enable-bluez enable bluez stack connectivity 127408fb77edSStefan Weil --disable-slirp disable SLIRP userspace network connectivity 127508fb77edSStefan Weil --disable-kvm disable KVM acceleration support 127608fb77edSStefan Weil --enable-kvm enable KVM acceleration support 127708fb77edSStefan Weil --disable-rdma disable RDMA-based migration support 127808fb77edSStefan Weil --enable-rdma enable RDMA-based migration support 127908fb77edSStefan Weil --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) 128008fb77edSStefan Weil --enable-system enable all system emulation targets 128108fb77edSStefan Weil --disable-system disable all system emulation targets 128208fb77edSStefan Weil --enable-user enable supported user emulation targets 128308fb77edSStefan Weil --disable-user disable all user emulation targets 128408fb77edSStefan Weil --enable-linux-user enable all linux usermode emulation targets 128508fb77edSStefan Weil --disable-linux-user disable all linux usermode emulation targets 128608fb77edSStefan Weil --enable-bsd-user enable all BSD usermode emulation targets 128708fb77edSStefan Weil --disable-bsd-user disable all BSD usermode emulation targets 128808fb77edSStefan Weil --enable-guest-base enable GUEST_BASE support for usermode 128908fb77edSStefan Weil emulation targets 129008fb77edSStefan Weil --disable-guest-base disable GUEST_BASE support 129108fb77edSStefan Weil --enable-pie build Position Independent Executables 129208fb77edSStefan Weil --disable-pie do not build Position Independent Executables 129308fb77edSStefan Weil --fmod-lib path to FMOD library 129408fb77edSStefan Weil --fmod-inc path to FMOD includes 129508fb77edSStefan Weil --oss-lib path to OSS library 129608fb77edSStefan Weil --enable-uname-release=R Return R for uname -r in usermode emulation 129708fb77edSStefan Weil --cpu=CPU Build for host CPU [$cpu] 129808fb77edSStefan Weil --disable-uuid disable uuid support 129908fb77edSStefan Weil --enable-uuid enable uuid support 130008fb77edSStefan Weil --disable-vde disable support for vde network 130108fb77edSStefan Weil --enable-vde enable support for vde network 130208fb77edSStefan Weil --disable-netmap disable support for netmap network 130308fb77edSStefan Weil --enable-netmap enable support for netmap network 130408fb77edSStefan Weil --disable-linux-aio disable Linux AIO support 130508fb77edSStefan Weil --enable-linux-aio enable Linux AIO support 130608fb77edSStefan Weil --disable-cap-ng disable libcap-ng support 130708fb77edSStefan Weil --enable-cap-ng enable libcap-ng support 130808fb77edSStefan Weil --disable-attr disables attr and xattr support 130908fb77edSStefan Weil --enable-attr enable attr and xattr support 131008fb77edSStefan Weil --disable-blobs disable installing provided firmware blobs 131108fb77edSStefan Weil --enable-docs enable documentation build 131208fb77edSStefan Weil --disable-docs disable documentation build 131308fb77edSStefan Weil --disable-vhost-net disable vhost-net acceleration support 131408fb77edSStefan Weil --enable-vhost-net enable vhost-net acceleration support 131508fb77edSStefan Weil --enable-trace-backend=B Set trace backend 131608fb77edSStefan Weil Available backends: $($python $source_path/scripts/tracetool.py --list-backends) 131708fb77edSStefan Weil --with-trace-file=NAME Full PATH,NAME of file to store traces 131808fb77edSStefan Weil Default:trace-<pid> 131908fb77edSStefan Weil --disable-spice disable spice 132008fb77edSStefan Weil --enable-spice enable spice 132108fb77edSStefan Weil --enable-rbd enable building the rados block device (rbd) 132208fb77edSStefan Weil --disable-libiscsi disable iscsi support 132308fb77edSStefan Weil --enable-libiscsi enable iscsi support 13246542aa9cSPeter Lieven --disable-libnfs disable nfs support 13256542aa9cSPeter Lieven --enable-libnfs enable nfs support 132608fb77edSStefan Weil --disable-smartcard-nss disable smartcard nss support 132708fb77edSStefan Weil --enable-smartcard-nss enable smartcard nss support 132808fb77edSStefan Weil --disable-libusb disable libusb (for usb passthrough) 132908fb77edSStefan Weil --enable-libusb enable libusb (for usb passthrough) 133008fb77edSStefan Weil --disable-usb-redir disable usb network redirection support 133108fb77edSStefan Weil --enable-usb-redir enable usb network redirection support 1332607dacd0Sqiaonuohan --enable-lzo enable the support of lzo compression library 1333607dacd0Sqiaonuohan --enable-snappy enable the support of snappy compression library 133408fb77edSStefan Weil --disable-guest-agent disable building of the QEMU Guest Agent 133508fb77edSStefan Weil --enable-guest-agent enable building of the QEMU Guest Agent 133608fb77edSStefan Weil --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent 133708fb77edSStefan Weil --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) 133808fb77edSStefan Weil --disable-seccomp disable seccomp support 133908fb77edSStefan Weil --enable-seccomp enables seccomp support 134008fb77edSStefan Weil --with-coroutine=BACKEND coroutine backend. Supported options: 134108fb77edSStefan Weil gthread, ucontext, sigaltstack, windows 134208fb77edSStefan Weil --disable-coroutine-pool disable coroutine freelist (worse performance) 134308fb77edSStefan Weil --enable-coroutine-pool enable coroutine freelist (better performance) 134408fb77edSStefan Weil --enable-glusterfs enable GlusterFS backend 134508fb77edSStefan Weil --disable-glusterfs disable GlusterFS backend 134608fb77edSStefan Weil --enable-gcov enable test coverage analysis with gcov 134708fb77edSStefan Weil --gcov=GCOV use specified gcov [$gcov_tool] 134808fb77edSStefan Weil --enable-tpm enable TPM support 134908fb77edSStefan Weil --disable-libssh2 disable ssh block device support 135008fb77edSStefan Weil --enable-libssh2 enable ssh block device support 135108fb77edSStefan Weil --disable-vhdx disables support for the Microsoft VHDX image format 135208fb77edSStefan Weil --enable-vhdx enable support for the Microsoft VHDX image format 135395c6bff3SBenoît Canet --disable-quorum disable quorum block filter support 135495c6bff3SBenoît Canet --enable-quorum enable quorum block filter support 135508fb77edSStefan Weil 135608fb77edSStefan WeilNOTE: The object files are built at the place where configure is launched 1357af5db58eSpbrookEOF 1358af5db58eSpbrookexit 1 1359af5db58eSpbrookfi 1360af5db58eSpbrook 1361359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1362359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1363359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1364359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1365359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1366359bc95dSPeter Maydell ARCH=tci 1367359bc95dSPeter Maydell else 136876ad07a4SPeter Maydell error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1369359bc95dSPeter Maydell fi 1370359bc95dSPeter Maydellfi 1371359bc95dSPeter Maydell 13729c83ffd8SPeter Maydell# Consult white-list to determine whether to enable werror 13739c83ffd8SPeter Maydell# by default. Only enable by default for git builds 13749c83ffd8SPeter Maydellz_version=`cut -f3 -d. $source_path/VERSION` 13759c83ffd8SPeter Maydell 13769c83ffd8SPeter Maydellif test -z "$werror" ; then 13779c83ffd8SPeter Maydell if test -d "$source_path/.git" -a \ 13789c83ffd8SPeter Maydell "$linux" = "yes" ; then 13799c83ffd8SPeter Maydell werror="yes" 13809c83ffd8SPeter Maydell else 13819c83ffd8SPeter Maydell werror="no" 13829c83ffd8SPeter Maydell fi 13839c83ffd8SPeter Maydellfi 13849c83ffd8SPeter Maydell 13858d05095cSPaolo Bonzini# check that the C compiler works. 13868d05095cSPaolo Bonzinicat > $TMPC <<EOF 138775cafad7SStefan Weilint main(void) { return 0; } 13888d05095cSPaolo BonziniEOF 13898d05095cSPaolo Bonzini 13908d05095cSPaolo Bonziniif compile_object ; then 13918d05095cSPaolo Bonzini : C compiler works ok 13928d05095cSPaolo Bonzinielse 139376ad07a4SPeter Maydell error_exit "\"$cc\" either does not exist or does not work" 13948d05095cSPaolo Bonzinifi 13958d05095cSPaolo Bonzini 139698b21dcdSPeter Maydell# Check that the C++ compiler exists and works with the C compiler 139798b21dcdSPeter Maydellif has $cxx; then 139898b21dcdSPeter Maydell cat > $TMPC <<EOF 139998b21dcdSPeter Maydellint c_function(void); 140098b21dcdSPeter Maydellint main(void) { return c_function(); } 140198b21dcdSPeter MaydellEOF 140298b21dcdSPeter Maydell 140398b21dcdSPeter Maydell compile_object 140498b21dcdSPeter Maydell 14059c83ffd8SPeter Maydell cat > $TMPCXX <<EOF 140698b21dcdSPeter Maydellextern "C" { 140798b21dcdSPeter Maydell int c_function(void); 140898b21dcdSPeter Maydell} 140998b21dcdSPeter Maydellint c_function(void) { return 42; } 141098b21dcdSPeter MaydellEOF 141198b21dcdSPeter Maydell 14129c83ffd8SPeter Maydell update_cxxflags 14139c83ffd8SPeter Maydell 14149c83ffd8SPeter Maydell if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $LDFLAGS; then 141598b21dcdSPeter Maydell # C++ compiler $cxx works ok with C compiler $cc 141698b21dcdSPeter Maydell : 141798b21dcdSPeter Maydell else 141898b21dcdSPeter Maydell echo "C++ compiler $cxx does not work with C compiler $cc" 141998b21dcdSPeter Maydell echo "Disabling C++ specific optional code" 142098b21dcdSPeter Maydell cxx= 142198b21dcdSPeter Maydell fi 142298b21dcdSPeter Maydellelse 142398b21dcdSPeter Maydell echo "No C++ compiler available; disabling C++ specific optional code" 142498b21dcdSPeter Maydell cxx= 142598b21dcdSPeter Maydellfi 142698b21dcdSPeter Maydell 14278d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 14288d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 14298d05095cSPaolo Bonzinigcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 143037746c5eSMarc-André Lureaugcc_flags="-Wendif-labels $gcc_flags" 1431c1556a81SPeter Maydellgcc_flags="-Wno-initializer-overrides $gcc_flags" 143271429097SPeter Maydellgcc_flags="-Wno-string-plus-int $gcc_flags" 14336ca026cbSPeter Maydell# Note that we do not add -Werror to gcc_flags here, because that would 14346ca026cbSPeter Maydell# enable it for all configure tests. If a configure test failed due 14356ca026cbSPeter Maydell# to -Werror this would just silently disable some features, 14366ca026cbSPeter Maydell# so it's too error prone. 14378d05095cSPaolo Bonzinicat > $TMPC << EOF 14388d05095cSPaolo Bonziniint main(void) { return 0; } 14398d05095cSPaolo BonziniEOF 14408d05095cSPaolo Bonzinifor flag in $gcc_flags; do 1441a1d29d6cSPeter Maydell # Use the positive sense of the flag when testing for -Wno-wombat 1442a1d29d6cSPeter Maydell # support (gcc will happily accept the -Wno- form of unknown 1443a1d29d6cSPeter Maydell # warning options). 1444a1d29d6cSPeter Maydell optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')" 1445a1d29d6cSPeter Maydell if compile_prog "-Werror $optflag" "" ; then 14468d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 14478d05095cSPaolo Bonzini fi 14488d05095cSPaolo Bonzinidone 14498d05095cSPaolo Bonzini 145037746c5eSMarc-André Lureauif compile_prog "-Werror -fstack-protector-all" "" ; then 145137746c5eSMarc-André Lureau QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all" 145237746c5eSMarc-André Lureau LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all" 145337746c5eSMarc-André Lureaufi 145437746c5eSMarc-André Lureau 1455cbdd1999SPaolo Bonzini# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and 1456cbdd1999SPaolo Bonzini# large functions that use global variables. The bug is in all releases of 1457cbdd1999SPaolo Bonzini# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in 1458cbdd1999SPaolo Bonzini# 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. 1459cbdd1999SPaolo Bonzinicat > $TMPC << EOF 1460cbdd1999SPaolo Bonzini#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) 1461cbdd1999SPaolo Bonziniint main(void) { return 0; } 1462cbdd1999SPaolo Bonzini#else 1463cbdd1999SPaolo Bonzini#error No bug in this compiler. 1464cbdd1999SPaolo Bonzini#endif 1465cbdd1999SPaolo BonziniEOF 1466cbdd1999SPaolo Bonziniif compile_prog "-Werror -fno-gcse" "" ; then 1467cbdd1999SPaolo Bonzini TRANSLATE_OPT_CFLAGS=-fno-gcse 1468cbdd1999SPaolo Bonzinifi 1469cbdd1999SPaolo Bonzini 147040d6444eSAvi Kivityif test "$static" = "yes" ; then 1471aa0d1f44SPaolo Bonzini if test "$modules" = "yes" ; then 1472aa0d1f44SPaolo Bonzini error_exit "static and modules are mutually incompatible" 1473aa0d1f44SPaolo Bonzini fi 147440d6444eSAvi Kivity if test "$pie" = "yes" ; then 147576ad07a4SPeter Maydell error_exit "static and pie are mutually incompatible" 147640d6444eSAvi Kivity else 147740d6444eSAvi Kivity pie="no" 147840d6444eSAvi Kivity fi 147940d6444eSAvi Kivityfi 148040d6444eSAvi Kivity 148140d6444eSAvi Kivityif test "$pie" = ""; then 148240d6444eSAvi Kivity case "$cpu-$targetos" in 1483c72b26ecSRichard Henderson i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) 148440d6444eSAvi Kivity ;; 148540d6444eSAvi Kivity *) 148640d6444eSAvi Kivity pie="no" 148740d6444eSAvi Kivity ;; 148840d6444eSAvi Kivity esac 148940d6444eSAvi Kivityfi 149040d6444eSAvi Kivity 149140d6444eSAvi Kivityif test "$pie" != "no" ; then 149240d6444eSAvi Kivity cat > $TMPC << EOF 149321d4a791SAvi Kivity 149421d4a791SAvi Kivity#ifdef __linux__ 149521d4a791SAvi Kivity# define THREAD __thread 149621d4a791SAvi Kivity#else 149721d4a791SAvi Kivity# define THREAD 149821d4a791SAvi Kivity#endif 149921d4a791SAvi Kivity 150021d4a791SAvi Kivitystatic THREAD int tls_var; 150121d4a791SAvi Kivity 150221d4a791SAvi Kivityint main(void) { return tls_var; } 150321d4a791SAvi Kivity 150440d6444eSAvi KivityEOF 150540d6444eSAvi Kivity if compile_prog "-fPIE -DPIE" "-pie"; then 150640d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 150740d6444eSAvi Kivity LDFLAGS="-pie $LDFLAGS" 150840d6444eSAvi Kivity pie="yes" 150940d6444eSAvi Kivity if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 151040d6444eSAvi Kivity LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" 151140d6444eSAvi Kivity fi 151240d6444eSAvi Kivity else 151340d6444eSAvi Kivity if test "$pie" = "yes"; then 151476ad07a4SPeter Maydell error_exit "PIE not available due to missing toolchain support" 151540d6444eSAvi Kivity else 151640d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 151740d6444eSAvi Kivity pie="no" 151840d6444eSAvi Kivity fi 151940d6444eSAvi Kivity fi 152046eef33bSBrad 152146eef33bSBrad if compile_prog "-fno-pie" "-nopie"; then 152246eef33bSBrad CFLAGS_NOPIE="-fno-pie" 152346eef33bSBrad LDFLAGS_NOPIE="-nopie" 152446eef33bSBrad fi 152540d6444eSAvi Kivityfi 152640d6444eSAvi Kivity 152766518bf6SDon Slutz# check for broken gcc and libtool in RHEL5 152866518bf6SDon Slutzif test -n "$libtool" -a "$pie" != "no" ; then 152966518bf6SDon Slutz cat > $TMPC <<EOF 153066518bf6SDon Slutz 153166518bf6SDon Slutzvoid *f(unsigned char *buf, int len); 153266518bf6SDon Slutzvoid *g(unsigned char *buf, int len); 153366518bf6SDon Slutz 153466518bf6SDon Slutzvoid * 153566518bf6SDon Slutzf(unsigned char *buf, int len) 153666518bf6SDon Slutz{ 153766518bf6SDon Slutz return (void*)0L; 153866518bf6SDon Slutz} 153966518bf6SDon Slutz 154066518bf6SDon Slutzvoid * 154166518bf6SDon Slutzg(unsigned char *buf, int len) 154266518bf6SDon Slutz{ 154366518bf6SDon Slutz return f(buf, len); 154466518bf6SDon Slutz} 154566518bf6SDon Slutz 154666518bf6SDon SlutzEOF 154766518bf6SDon Slutz if ! libtool_prog; then 154866518bf6SDon Slutz echo "Disabling libtool due to broken toolchain support" 154966518bf6SDon Slutz libtool= 155066518bf6SDon Slutz fi 155166518bf6SDon Slutzfi 155266518bf6SDon Slutz 155309dada40SPaolo Bonzini########################################## 155409dada40SPaolo Bonzini# __sync_fetch_and_and requires at least -march=i486. Many toolchains 155509dada40SPaolo Bonzini# use i686 as default anyway, but for those that don't, an explicit 155609dada40SPaolo Bonzini# specification is necessary 155709dada40SPaolo Bonzini 155809dada40SPaolo Bonziniif test "$cpu" = "i386"; then 155909dada40SPaolo Bonzini cat > $TMPC << EOF 156009dada40SPaolo Bonzinistatic int sfaa(int *ptr) 156109dada40SPaolo Bonzini{ 156209dada40SPaolo Bonzini return __sync_fetch_and_and(ptr, 0); 156309dada40SPaolo Bonzini} 156409dada40SPaolo Bonzini 156509dada40SPaolo Bonziniint main(void) 156609dada40SPaolo Bonzini{ 156709dada40SPaolo Bonzini int val = 42; 15681405b629SStefan Weil val = __sync_val_compare_and_swap(&val, 0, 1); 156909dada40SPaolo Bonzini sfaa(&val); 157009dada40SPaolo Bonzini return val; 157109dada40SPaolo Bonzini} 157209dada40SPaolo BonziniEOF 157309dada40SPaolo Bonzini if ! compile_prog "" "" ; then 157409dada40SPaolo Bonzini QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" 157509dada40SPaolo Bonzini fi 157609dada40SPaolo Bonzinifi 157709dada40SPaolo Bonzini 157809dada40SPaolo Bonzini######################################### 1579ec530c81Sbellard# Solaris specific configure tool chain decisions 158009dada40SPaolo Bonzini 1581ec530c81Sbellardif test "$solaris" = "yes" ; then 15826792aa11SLoïc Minier if has $install; then 15836792aa11SLoïc Minier : 15846792aa11SLoïc Minier else 158576ad07a4SPeter Maydell error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ 158676ad07a4SPeter Maydell "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ 158776ad07a4SPeter Maydell "to get ginstall which is used by default (which lives in /opt/csw/bin)" 1588ec530c81Sbellard fi 15896792aa11SLoïc Minier if test "`path_of $install`" = "/usr/sbin/install" ; then 159076ad07a4SPeter Maydell error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ 159176ad07a4SPeter Maydell "try ginstall from the GNU fileutils available from www.blastwave.org" \ 159276ad07a4SPeter Maydell "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 1593ec530c81Sbellard fi 15946792aa11SLoïc Minier if has ar; then 15956792aa11SLoïc Minier : 15966792aa11SLoïc Minier else 1597ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 159876ad07a4SPeter Maydell error_exit "No path includes ar" \ 159976ad07a4SPeter Maydell "Add /usr/ccs/bin to your path and rerun configure" 1600ec530c81Sbellard fi 160176ad07a4SPeter Maydell error_exit "No path includes ar" 1602ec530c81Sbellard fi 1603ec530c81Sbellardfi 1604ec530c81Sbellard 1605afb63ebdSStefan Weilif test -z "${target_list+xxx}" ; then 1606121afa9eSAnthony Liguori target_list="$default_target_list" 1607121afa9eSAnthony Liguorielse 1608121afa9eSAnthony Liguori target_list=`echo "$target_list" | sed -e 's/,/ /g'` 16095327cf48Sbellardfi 161025b48338SPeter Maydell 161125b48338SPeter Maydell# Check that we recognised the target name; this allows a more 161225b48338SPeter Maydell# friendly error message than if we let it fall through. 161325b48338SPeter Maydellfor target in $target_list; do 161425b48338SPeter Maydell case " $default_target_list " in 161525b48338SPeter Maydell *" $target "*) 161625b48338SPeter Maydell ;; 161725b48338SPeter Maydell *) 161825b48338SPeter Maydell error_exit "Unknown target name '$target'" 161925b48338SPeter Maydell ;; 162025b48338SPeter Maydell esac 162125b48338SPeter Maydelldone 162225b48338SPeter Maydell 1623f55fe278SPaolo Bonzini# see if system emulation was really requested 1624f55fe278SPaolo Bonzinicase " $target_list " in 1625f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 1626f55fe278SPaolo Bonzini ;; 1627f55fe278SPaolo Bonzini *) softmmu=no 1628f55fe278SPaolo Bonzini ;; 1629f55fe278SPaolo Bonziniesac 16305327cf48Sbellard 1631249247c9SJuan Quintelafeature_not_found() { 1632249247c9SJuan Quintela feature=$1 163321684af0SStewart Smith remedy=$2 1634249247c9SJuan Quintela 163576ad07a4SPeter Maydell error_exit "User requested feature $feature" \ 163621684af0SStewart Smith "configure was not able to find it." \ 163721684af0SStewart Smith "$remedy" 1638249247c9SJuan Quintela} 1639249247c9SJuan Quintela 16407d13299dSbellard# --- 16417d13299dSbellard# big/little endian test 16427d13299dSbellardcat > $TMPC << EOF 164361cc919fSMike Frysingershort big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; 164461cc919fSMike Frysingershort little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; 164561cc919fSMike Frysingerextern int foo(short *, short *); 164661cc919fSMike Frysingerint main(int argc, char *argv[]) { 164761cc919fSMike Frysinger return foo(big_endian, little_endian); 16487d13299dSbellard} 16497d13299dSbellardEOF 16507d13299dSbellard 165161cc919fSMike Frysingerif compile_object ; then 165261cc919fSMike Frysinger if grep -q BiGeNdIaN $TMPO ; then 165361cc919fSMike Frysinger bigendian="yes" 165461cc919fSMike Frysinger elif grep -q LiTtLeEnDiAn $TMPO ; then 165561cc919fSMike Frysinger bigendian="no" 16567d13299dSbellard else 16577d13299dSbellard echo big/little test failed 16587d13299dSbellard fi 16597d13299dSbellardelse 166061cc919fSMike Frysinger echo big/little test failed 16617d13299dSbellardfi 16627d13299dSbellard 1663b0a47e79SJuan Quintela########################################## 1664779ab5e3SStefan Weil# pkg-config probe 1665779ab5e3SStefan Weil 1666779ab5e3SStefan Weilif ! has "$pkg_config_exe"; then 166776ad07a4SPeter Maydell error_exit "pkg-config binary '$pkg_config_exe' not found" 1668779ab5e3SStefan Weilfi 1669779ab5e3SStefan Weil 1670779ab5e3SStefan Weil########################################## 1671b0a47e79SJuan Quintela# NPTL probe 1672b0a47e79SJuan Quintela 167324cb36a6SPeter Maydellif test "$linux_user" = "yes"; then 1674bd0c5661Spbrook cat > $TMPC <<EOF 1675bd0c5661Spbrook#include <sched.h> 167630813ceaSpbrook#include <linux/futex.h> 1677182eacc0SStefan Weilint main(void) { 1678bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 1679bd0c5661Spbrook#error bork 1680bd0c5661Spbrook#endif 1681182eacc0SStefan Weil return 0; 1682bd0c5661Spbrook} 1683bd0c5661SpbrookEOF 168424cb36a6SPeter Maydell if ! compile_object ; then 168521684af0SStewart Smith feature_not_found "nptl" "Install glibc and linux kernel headers." 1686b0a47e79SJuan Quintela fi 1687bd0c5661Spbrookfi 1688bd0c5661Spbrook 168911d9f695Sbellard########################################## 1690ac62922eSbalrog# zlib check 1691ac62922eSbalrog 16921ece9905SAlon Levyif test "$zlib" != "no" ; then 1693ac62922eSbalrog cat > $TMPC << EOF 1694ac62922eSbalrog#include <zlib.h> 1695ac62922eSbalrogint main(void) { zlibVersion(); return 0; } 1696ac62922eSbalrogEOF 169752166aa0SJuan Quintela if compile_prog "" "-lz" ; then 1698ac62922eSbalrog : 1699ac62922eSbalrog else 170076ad07a4SPeter Maydell error_exit "zlib check failed" \ 170176ad07a4SPeter Maydell "Make sure to have the zlib libs and headers installed." 1702ac62922eSbalrog fi 17031ece9905SAlon Levyfi 1704eb0ecd5aSWill NewtonLIBS="$LIBS -lz" 1705ac62922eSbalrog 1706ac62922eSbalrog########################################## 1707607dacd0Sqiaonuohan# lzo check 1708607dacd0Sqiaonuohan 1709607dacd0Sqiaonuohanif test "$lzo" != "no" ; then 1710607dacd0Sqiaonuohan cat > $TMPC << EOF 1711607dacd0Sqiaonuohan#include <lzo/lzo1x.h> 1712607dacd0Sqiaonuohanint main(void) { lzo_version(); return 0; } 1713607dacd0SqiaonuohanEOF 1714607dacd0Sqiaonuohan if compile_prog "" "-llzo2" ; then 1715607dacd0Sqiaonuohan : 1716607dacd0Sqiaonuohan else 1717607dacd0Sqiaonuohan error_exit "lzo check failed" \ 1718607dacd0Sqiaonuohan "Make sure to have the lzo libs and headers installed." 1719607dacd0Sqiaonuohan fi 1720607dacd0Sqiaonuohan 1721607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -llzo2" 1722607dacd0Sqiaonuohanfi 1723607dacd0Sqiaonuohan 1724607dacd0Sqiaonuohan########################################## 1725607dacd0Sqiaonuohan# snappy check 1726607dacd0Sqiaonuohan 1727607dacd0Sqiaonuohanif test "$snappy" != "no" ; then 1728607dacd0Sqiaonuohan cat > $TMPC << EOF 1729607dacd0Sqiaonuohan#include <snappy-c.h> 1730607dacd0Sqiaonuohanint main(void) { snappy_max_compressed_length(4096); return 0; } 1731607dacd0SqiaonuohanEOF 1732607dacd0Sqiaonuohan if compile_prog "" "-lsnappy" ; then 1733607dacd0Sqiaonuohan : 1734607dacd0Sqiaonuohan else 1735607dacd0Sqiaonuohan error_exit "snappy check failed" \ 1736607dacd0Sqiaonuohan "Make sure to have the snappy libs and headers installed." 1737607dacd0Sqiaonuohan fi 1738607dacd0Sqiaonuohan 1739607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -lsnappy" 1740607dacd0Sqiaonuohanfi 1741607dacd0Sqiaonuohan 1742607dacd0Sqiaonuohan########################################## 1743f794573eSEduardo Otubo# libseccomp check 1744f794573eSEduardo Otubo 1745f794573eSEduardo Otuboif test "$seccomp" != "no" ; then 174665d5d3f9SStefan Weil if $pkg_config --atleast-version=2.1.0 libseccomp; then 1747b4451996SMichael Tokarev libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`" 1748372e47e9SAndreas Färber QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`" 1749f794573eSEduardo Otubo seccomp="yes" 1750f794573eSEduardo Otubo else 1751f794573eSEduardo Otubo if test "$seccomp" = "yes"; then 175221684af0SStewart Smith feature_not_found "libseccomp" "Install libseccomp devel >= 2.1.0" 1753f794573eSEduardo Otubo fi 1754e84d5956SYann E. MORIN seccomp="no" 1755f794573eSEduardo Otubo fi 1756f794573eSEduardo Otubofi 1757f794573eSEduardo Otubo########################################## 1758e37630caSaliguori# xen probe 1759e37630caSaliguori 1760fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 1761b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 1762d5b93ddfSAnthony PERARD 176350ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 176450ced5b3SStefan Weil # If no, we are done and there is no Xen support. 176550ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 176650ced5b3SStefan Weil 176750ced5b3SStefan Weil # Xen (any) 176850ced5b3SStefan Weil cat > $TMPC <<EOF 176950ced5b3SStefan Weil#include <xenctrl.h> 177050ced5b3SStefan Weilint main(void) { 177150ced5b3SStefan Weil return 0; 177250ced5b3SStefan Weil} 177350ced5b3SStefan WeilEOF 177450ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 177550ced5b3SStefan Weil # Xen not found 177650ced5b3SStefan Weil if test "$xen" = "yes" ; then 177721684af0SStewart Smith feature_not_found "xen" "Install xen devel" 177850ced5b3SStefan Weil fi 177950ced5b3SStefan Weil xen=no 178050ced5b3SStefan Weil 1781d5b93ddfSAnthony PERARD # Xen unstable 178269deef08SPeter Maydell elif 178369deef08SPeter Maydell cat > $TMPC <<EOF && 1784e37630caSaliguori#include <xenctrl.h> 1785e108a3c1SAnthony PERARD#include <xenstore.h> 1786d5b93ddfSAnthony PERARD#include <stdint.h> 1787d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1788d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1789d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1790d5b93ddfSAnthony PERARD#endif 1791d5b93ddfSAnthony PERARDint main(void) { 1792d5b93ddfSAnthony PERARD xc_interface *xc; 1793d5b93ddfSAnthony PERARD xs_daemon_open(); 1794d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 1795d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1796d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 1797b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 17988688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 17998688e065SStefano Stabellini return 0; 18008688e065SStefano Stabellini} 18018688e065SStefano StabelliniEOF 18028688e065SStefano Stabellini compile_prog "" "$xen_libs" 180369deef08SPeter Maydell then 18048688e065SStefano Stabellini xen_ctrl_version=420 18058688e065SStefano Stabellini xen=yes 18068688e065SStefano Stabellini 180769deef08SPeter Maydell elif 180869deef08SPeter Maydell cat > $TMPC <<EOF && 18098688e065SStefano Stabellini#include <xenctrl.h> 18108688e065SStefano Stabellini#include <xs.h> 18118688e065SStefano Stabellini#include <stdint.h> 18128688e065SStefano Stabellini#include <xen/hvm/hvm_info_table.h> 18138688e065SStefano Stabellini#if !defined(HVM_MAX_VCPUS) 18148688e065SStefano Stabellini# error HVM_MAX_VCPUS not defined 18158688e065SStefano Stabellini#endif 18168688e065SStefano Stabelliniint main(void) { 18178688e065SStefano Stabellini xs_daemon_open(); 18189b4c0b56SPeter Maydell xc_interface_open(0, 0, 0); 18198688e065SStefano Stabellini xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 18208688e065SStefano Stabellini xc_gnttab_open(NULL, 0); 18218688e065SStefano Stabellini xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 1822d5b93ddfSAnthony PERARD return 0; 1823d5b93ddfSAnthony PERARD} 1824e37630caSaliguoriEOF 182550ced5b3SStefan Weil compile_prog "" "$xen_libs" 182669deef08SPeter Maydell then 1827d5b93ddfSAnthony PERARD xen_ctrl_version=410 1828fc321b4bSJuan Quintela xen=yes 1829d5b93ddfSAnthony PERARD 1830d5b93ddfSAnthony PERARD # Xen 4.0.0 183169deef08SPeter Maydell elif 183269deef08SPeter Maydell cat > $TMPC <<EOF && 1833d5b93ddfSAnthony PERARD#include <xenctrl.h> 1834d5b93ddfSAnthony PERARD#include <xs.h> 1835d5b93ddfSAnthony PERARD#include <stdint.h> 1836d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1837d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1838d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1839d5b93ddfSAnthony PERARD#endif 1840d5b93ddfSAnthony PERARDint main(void) { 1841b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1842b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1843b87de24eSAnthony PERARD }; 1844d5b93ddfSAnthony PERARD xs_daemon_open(); 1845d5b93ddfSAnthony PERARD xc_interface_open(); 1846d5b93ddfSAnthony PERARD xc_gnttab_open(); 1847d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1848b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1849d5b93ddfSAnthony PERARD return 0; 1850d5b93ddfSAnthony PERARD} 1851d5b93ddfSAnthony PERARDEOF 1852d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 185369deef08SPeter Maydell then 1854d5b93ddfSAnthony PERARD xen_ctrl_version=400 1855d5b93ddfSAnthony PERARD xen=yes 1856d5b93ddfSAnthony PERARD 1857b87de24eSAnthony PERARD # Xen 3.4.0 185869deef08SPeter Maydell elif 185969deef08SPeter Maydell cat > $TMPC <<EOF && 1860b87de24eSAnthony PERARD#include <xenctrl.h> 1861b87de24eSAnthony PERARD#include <xs.h> 1862b87de24eSAnthony PERARDint main(void) { 1863b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1864b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1865b87de24eSAnthony PERARD }; 1866b87de24eSAnthony PERARD xs_daemon_open(); 1867b87de24eSAnthony PERARD xc_interface_open(); 1868b87de24eSAnthony PERARD xc_gnttab_open(); 1869b87de24eSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1870b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1871b87de24eSAnthony PERARD return 0; 1872b87de24eSAnthony PERARD} 1873b87de24eSAnthony PERARDEOF 1874b87de24eSAnthony PERARD compile_prog "" "$xen_libs" 187569deef08SPeter Maydell then 1876b87de24eSAnthony PERARD xen_ctrl_version=340 1877b87de24eSAnthony PERARD xen=yes 1878b87de24eSAnthony PERARD 1879b87de24eSAnthony PERARD # Xen 3.3.0 188069deef08SPeter Maydell elif 188169deef08SPeter Maydell cat > $TMPC <<EOF && 1882d5b93ddfSAnthony PERARD#include <xenctrl.h> 1883d5b93ddfSAnthony PERARD#include <xs.h> 1884d5b93ddfSAnthony PERARDint main(void) { 1885d5b93ddfSAnthony PERARD xs_daemon_open(); 1886d5b93ddfSAnthony PERARD xc_interface_open(); 1887d5b93ddfSAnthony PERARD xc_gnttab_open(); 1888d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1889d5b93ddfSAnthony PERARD return 0; 1890d5b93ddfSAnthony PERARD} 1891d5b93ddfSAnthony PERARDEOF 1892d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 189369deef08SPeter Maydell then 1894d5b93ddfSAnthony PERARD xen_ctrl_version=330 1895d5b93ddfSAnthony PERARD xen=yes 1896d5b93ddfSAnthony PERARD 189750ced5b3SStefan Weil # Xen version unsupported 1898e37630caSaliguori else 1899fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 190021684af0SStewart Smith feature_not_found "xen (unsupported version)" "Install supported xen (e.g. 4.0, 3.4, 3.3)" 1901fc321b4bSJuan Quintela fi 1902fc321b4bSJuan Quintela xen=no 1903e37630caSaliguori fi 1904d5b93ddfSAnthony PERARD 1905d5b93ddfSAnthony PERARD if test "$xen" = yes; then 1906d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 1907d5b93ddfSAnthony PERARD fi 1908e37630caSaliguorifi 1909e37630caSaliguori 1910eb6fda0fSAnthony PERARDif test "$xen_pci_passthrough" != "no"; then 1911eb6fda0fSAnthony PERARD if test "$xen" = "yes" && test "$linux" = "yes" && 1912eb6fda0fSAnthony PERARD test "$xen_ctrl_version" -ge 340; then 1913eb6fda0fSAnthony PERARD xen_pci_passthrough=yes 1914eb6fda0fSAnthony PERARD else 1915eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = "yes"; then 1916eb6fda0fSAnthony PERARD if test "$xen_ctrl_version" -lt 340; then 191776ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 191876ad07a4SPeter Maydell "This feature does not work with Xen 3.3" 1919eb6fda0fSAnthony PERARD fi 192076ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 192176ad07a4SPeter Maydell " but this feature requires /sys from Linux" 1922eb6fda0fSAnthony PERARD fi 1923eb6fda0fSAnthony PERARD xen_pci_passthrough=no 1924eb6fda0fSAnthony PERARD fi 1925eb6fda0fSAnthony PERARDfi 1926eb6fda0fSAnthony PERARD 1927e37630caSaliguori########################################## 192844dc0ca3SAlon Levy# libtool probe 192944dc0ca3SAlon Levy 19303f534581SBradif ! has $libtool; then 193144dc0ca3SAlon Levy libtool= 193244dc0ca3SAlon Levyfi 193344dc0ca3SAlon Levy 19348e515b12SPeter Maydell# MacOSX ships with a libtool which isn't the GNU one; weed this 19358e515b12SPeter Maydell# out by checking whether libtool supports the --version switch 19368e515b12SPeter Maydellif test -n "$libtool"; then 19378e515b12SPeter Maydell if ! "$libtool" --version >/dev/null 2>&1; then 19388e515b12SPeter Maydell libtool= 19398e515b12SPeter Maydell fi 19408e515b12SPeter Maydellfi 19418e515b12SPeter Maydell 194244dc0ca3SAlon Levy########################################## 1943dfffc653SJuan Quintela# Sparse probe 1944dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 19450dba6195SLoïc Minier if has cgcc; then 1946dfffc653SJuan Quintela sparse=yes 1947dfffc653SJuan Quintela else 1948dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 194921684af0SStewart Smith feature_not_found "sparse" "Install sparse binary" 1950dfffc653SJuan Quintela fi 1951dfffc653SJuan Quintela sparse=no 1952dfffc653SJuan Quintela fi 1953dfffc653SJuan Quintelafi 1954dfffc653SJuan Quintela 1955dfffc653SJuan Quintela########################################## 1956a4ccabcfSAnthony Liguori# GTK probe 1957a4ccabcfSAnthony Liguori 1958a4ccabcfSAnthony Liguoriif test "$gtk" != "no"; then 1959528de90aSDaniel P. Berrange gtkpackage="gtk+-$gtkabi" 1960528de90aSDaniel P. Berrange if test "$gtkabi" = "3.0" ; then 1961528de90aSDaniel P. Berrange gtkversion="3.0.0" 1962528de90aSDaniel P. Berrange vtepackage="vte-2.90" 1963528de90aSDaniel P. Berrange vteversion="0.32.0" 1964528de90aSDaniel P. Berrange else 1965528de90aSDaniel P. Berrange gtkversion="2.18.0" 1966528de90aSDaniel P. Berrange vtepackage="vte" 1967528de90aSDaniel P. Berrange vteversion="0.24.0" 1968528de90aSDaniel P. Berrange fi 19690d185e63SPeter Maydell if ! $pkg_config --exists "$gtkpackage >= $gtkversion"; then 19700d185e63SPeter Maydell if test "$gtk" = "yes" ; then 197121684af0SStewart Smith feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel" 19720d185e63SPeter Maydell fi 19730d185e63SPeter Maydell gtk="no" 19740d185e63SPeter Maydell elif ! $pkg_config --exists "$vtepackage >= $vteversion"; then 19750d185e63SPeter Maydell if test "$gtk" = "yes" ; then 19760d185e63SPeter Maydell error_exit "libvte not found (required for gtk support)" 19770d185e63SPeter Maydell fi 19780d185e63SPeter Maydell gtk="no" 19790d185e63SPeter Maydell else 1980ca871ec8SStefan Weil gtk_cflags=`$pkg_config --cflags $gtkpackage` 1981ca871ec8SStefan Weil gtk_libs=`$pkg_config --libs $gtkpackage` 1982ca871ec8SStefan Weil vte_cflags=`$pkg_config --cflags $vtepackage` 1983ca871ec8SStefan Weil vte_libs=`$pkg_config --libs $vtepackage` 1984a4ccabcfSAnthony Liguori libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" 1985a4ccabcfSAnthony Liguori gtk="yes" 1986a4ccabcfSAnthony Liguori fi 1987a4ccabcfSAnthony Liguorifi 1988a4ccabcfSAnthony Liguori 1989a4ccabcfSAnthony Liguori########################################## 199011d9f695Sbellard# SDL probe 199111d9f695Sbellard 19923ec87ffeSPaolo Bonzini# Look for sdl configuration program (pkg-config or sdl-config). Try 19933ec87ffeSPaolo Bonzini# sdl-config even without cross prefix, and favour pkg-config over sdl-config. 199447c03744SDave Airlie 199547c03744SDave Airlieif test $sdlabi = "2.0"; then 199647c03744SDave Airlie sdl_config=$sdl2_config 199747c03744SDave Airlie sdlname=sdl2 199847c03744SDave Airlie sdlconfigname=sdl2_config 199947c03744SDave Airlieelse 200047c03744SDave Airlie sdlname=sdl 200147c03744SDave Airlie sdlconfigname=sdl_config 20023ec87ffeSPaolo Bonzinifi 20033ec87ffeSPaolo Bonzini 200447c03744SDave Airlieif test "`basename $sdl_config`" != $sdlconfigname && ! has ${sdl_config}; then 200547c03744SDave Airlie sdl_config=$sdlconfigname 200647c03744SDave Airliefi 200747c03744SDave Airlie 200847c03744SDave Airlieif $pkg_config $sdlname --exists; then 200947c03744SDave Airlie sdlconfig="$pkg_config $sdlname" 2010fec0e3e8SStefan Weil _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` 20113ec87ffeSPaolo Bonzinielif has ${sdl_config}; then 20123ec87ffeSPaolo Bonzini sdlconfig="$sdl_config" 20139316f803SPaolo Bonzini _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` 2014a0dfd8a4SLoïc Minierelse 2015a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 201621684af0SStewart Smith feature_not_found "sdl" "Install SDL devel" 2017a0dfd8a4SLoïc Minier fi 2018a0dfd8a4SLoïc Minier sdl=no 20199316f803SPaolo Bonzinifi 202029e5badaSScott Woodif test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then 20213ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 20223ec87ffeSPaolo Bonzinifi 202311d9f695Sbellard 20249316f803SPaolo Bonzinisdl_too_old=no 2025c4198157SJuan Quintelaif test "$sdl" != "no" ; then 202611d9f695Sbellard cat > $TMPC << EOF 202711d9f695Sbellard#include <SDL.h> 202811d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 202911d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 203011d9f695SbellardEOF 20319316f803SPaolo Bonzini sdl_cflags=`$sdlconfig --cflags 2> /dev/null` 203274f42e18STeLeMan if test "$static" = "yes" ; then 203374f42e18STeLeMan sdl_libs=`$sdlconfig --static-libs 2>/dev/null` 203474f42e18STeLeMan else 20359316f803SPaolo Bonzini sdl_libs=`$sdlconfig --libs 2> /dev/null` 203674f42e18STeLeMan fi 203752166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 203811d9f695Sbellard if test "$_sdlversion" -lt 121 ; then 203911d9f695Sbellard sdl_too_old=yes 204011d9f695Sbellard else 2041fd677642Sths if test "$cocoa" = "no" ; then 204211d9f695Sbellard sdl=yes 204311d9f695Sbellard fi 2044fd677642Sths fi 20457c1f25b4Sbellard 204667c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 20471ac88f28SJuan Quintela if test "$sdl" = "yes" -a "$static" = "yes" ; then 204867c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 2049f8aa6c7bSStefan Weil sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" 2050f8aa6c7bSStefan Weil sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" 205111d9f695Sbellard fi 205252166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 20531ac88f28SJuan Quintela : 20541ac88f28SJuan Quintela else 20551ac88f28SJuan Quintela sdl=no 20567c1f25b4Sbellard fi 20577c1f25b4Sbellard fi # static link 2058c4198157SJuan Quintela else # sdl not found 2059c4198157SJuan Quintela if test "$sdl" = "yes" ; then 206021684af0SStewart Smith feature_not_found "sdl" "Install SDL devel" 2061c4198157SJuan Quintela fi 2062c4198157SJuan Quintela sdl=no 20637c1f25b4Sbellard fi # sdl compile test 2064fd677642Sthsfi 206511d9f695Sbellard 20665368a422Saliguoriif test "$sdl" = "yes" ; then 20675368a422Saliguori cat > $TMPC <<EOF 20685368a422Saliguori#include <SDL.h> 20695368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 20705368a422Saliguori#include <X11/XKBlib.h> 20715368a422Saliguori#else 20725368a422Saliguori#error No x11 support 20735368a422Saliguori#endif 20745368a422Saliguoriint main(void) { return 0; } 20755368a422SaliguoriEOF 207652166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 2077681306dfSJuan Quintela sdl_libs="$sdl_libs -lX11" 20785368a422Saliguori fi 20790705667eSJuan Quintela libs_softmmu="$sdl_libs $libs_softmmu" 20805368a422Saliguorifi 20815368a422Saliguori 20828f28f3fbSths########################################## 20832da776dbSMichael R. Hines# RDMA needs OpenFabrics libraries 20842da776dbSMichael R. Hinesif test "$rdma" != "no" ; then 20852da776dbSMichael R. Hines cat > $TMPC <<EOF 20862da776dbSMichael R. Hines#include <rdma/rdma_cma.h> 20872da776dbSMichael R. Hinesint main(void) { return 0; } 20882da776dbSMichael R. HinesEOF 20892da776dbSMichael R. Hines rdma_libs="-lrdmacm -libverbs" 20902da776dbSMichael R. Hines if compile_prog "" "$rdma_libs" ; then 20912da776dbSMichael R. Hines rdma="yes" 20922da776dbSMichael R. Hines libs_softmmu="$libs_softmmu $rdma_libs" 20932da776dbSMichael R. Hines else 20942da776dbSMichael R. Hines if test "$rdma" = "yes" ; then 20952da776dbSMichael R. Hines error_exit \ 20962da776dbSMichael R. Hines " OpenFabrics librdmacm/libibverbs not present." \ 20972da776dbSMichael R. Hines " Your options:" \ 20982da776dbSMichael R. Hines " (1) Fast: Install infiniband packages from your distro." \ 20992da776dbSMichael R. Hines " (2) Cleanest: Install libraries from www.openfabrics.org" \ 21002da776dbSMichael R. Hines " (3) Also: Install softiwarp if you don't have RDMA hardware" 21012da776dbSMichael R. Hines fi 21022da776dbSMichael R. Hines rdma="no" 21032da776dbSMichael R. Hines fi 21042da776dbSMichael R. Hinesfi 21052da776dbSMichael R. Hines 21062da776dbSMichael R. Hines########################################## 21077536ee4bSTim Hardeck# VNC TLS/WS detection 21087536ee4bSTim Hardeckif test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then 2109ae6b5e5aSaliguori cat > $TMPC <<EOF 2110ae6b5e5aSaliguori#include <gnutls/gnutls.h> 2111ae6b5e5aSaliguoriint main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } 2112ae6b5e5aSaliguoriEOF 2113a8bd70adSPaolo Bonzini vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 2114a8bd70adSPaolo Bonzini vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 211552166aa0SJuan Quintela if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then 21167536ee4bSTim Hardeck if test "$vnc_tls" != "no" ; then 21171be10ad2SJuan Quintela vnc_tls=yes 21187536ee4bSTim Hardeck fi 21197536ee4bSTim Hardeck if test "$vnc_ws" != "no" ; then 21207536ee4bSTim Hardeck vnc_ws=yes 21217536ee4bSTim Hardeck fi 2122a5e32cc9SJuan Quintela libs_softmmu="$vnc_tls_libs $libs_softmmu" 2123ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_tls_cflags" 2124ae6b5e5aSaliguori else 21251be10ad2SJuan Quintela if test "$vnc_tls" = "yes" ; then 212621684af0SStewart Smith feature_not_found "vnc-tls" "Install gnutls devel" 21271be10ad2SJuan Quintela fi 21287536ee4bSTim Hardeck if test "$vnc_ws" = "yes" ; then 212921684af0SStewart Smith feature_not_found "vnc-ws" "Install gnutls devel" 21307536ee4bSTim Hardeck fi 21311be10ad2SJuan Quintela vnc_tls=no 21327536ee4bSTim Hardeck vnc_ws=no 21338d5d2d4cSths fi 21348d5d2d4cSthsfi 21358d5d2d4cSths 21368d5d2d4cSths########################################## 213795c6bff3SBenoît Canet# Quorum probe (check for gnutls) 213895c6bff3SBenoît Canetif test "$quorum" != "no" ; then 213995c6bff3SBenoît Canetcat > $TMPC <<EOF 214095c6bff3SBenoît Canet#include <gnutls/gnutls.h> 214195c6bff3SBenoît Canet#include <gnutls/crypto.h> 214295c6bff3SBenoît Canetint main(void) {char data[4096], digest[32]; 214395c6bff3SBenoît Canetgnutls_hash_fast(GNUTLS_DIG_SHA256, data, 4096, digest); 214495c6bff3SBenoît Canetreturn 0; 214595c6bff3SBenoît Canet} 214695c6bff3SBenoît CanetEOF 214795c6bff3SBenoît Canetquorum_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 214895c6bff3SBenoît Canetquorum_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 214995c6bff3SBenoît Canetif compile_prog "$quorum_tls_cflags" "$quorum_tls_libs" ; then 215095c6bff3SBenoît Canet qcow_tls=yes 215195c6bff3SBenoît Canet libs_softmmu="$quorum_tls_libs $libs_softmmu" 215295c6bff3SBenoît Canet libs_tools="$quorum_tls_libs $libs_softmmu" 215395c6bff3SBenoît Canet QEMU_CFLAGS="$QEMU_CFLAGS $quorum_tls_cflags" 215495c6bff3SBenoît Canetelse 215595c6bff3SBenoît Canet echo "gnutls > 2.10.0 required to compile Quorum" 215695c6bff3SBenoît Canet exit 1 215795c6bff3SBenoît Canetfi 215895c6bff3SBenoît Canetfi 215995c6bff3SBenoît Canet 216095c6bff3SBenoît Canet########################################## 21612f9606b3Saliguori# VNC SASL detection 2162821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then 21632f9606b3Saliguori cat > $TMPC <<EOF 21642f9606b3Saliguori#include <sasl/sasl.h> 21652f9606b3Saliguori#include <stdio.h> 21662f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 21672f9606b3SaliguoriEOF 21682f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 21692f9606b3Saliguori vnc_sasl_cflags="" 21702f9606b3Saliguori vnc_sasl_libs="-lsasl2" 217152166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 2172ea784e3bSJuan Quintela vnc_sasl=yes 2173fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 2174ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" 21752f9606b3Saliguori else 2176ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 217721684af0SStewart Smith feature_not_found "vnc-sasl" "Install Cyrus SASL devel" 2178ea784e3bSJuan Quintela fi 2179ea784e3bSJuan Quintela vnc_sasl=no 21802f9606b3Saliguori fi 21812f9606b3Saliguorifi 21822f9606b3Saliguori 21832f9606b3Saliguori########################################## 21842f6f5c7aSCorentin Chary# VNC JPEG detection 2185821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then 21862f6f5c7aSCorentin Charycat > $TMPC <<EOF 21872f6f5c7aSCorentin Chary#include <stdio.h> 21882f6f5c7aSCorentin Chary#include <jpeglib.h> 21892f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 21902f6f5c7aSCorentin CharyEOF 21912f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 21922f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 21932f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 21942f6f5c7aSCorentin Chary vnc_jpeg=yes 21952f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 2196ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" 21972f6f5c7aSCorentin Chary else 21982f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 219921684af0SStewart Smith feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" 22002f6f5c7aSCorentin Chary fi 22012f6f5c7aSCorentin Chary vnc_jpeg=no 22022f6f5c7aSCorentin Chary fi 22032f6f5c7aSCorentin Charyfi 22042f6f5c7aSCorentin Chary 22052f6f5c7aSCorentin Chary########################################## 2206efe556adSCorentin Chary# VNC PNG detection 2207821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_png" != "no" ; then 2208efe556adSCorentin Charycat > $TMPC <<EOF 2209efe556adSCorentin Chary//#include <stdio.h> 2210efe556adSCorentin Chary#include <png.h> 2211832ce9c2SScott Wood#include <stddef.h> 2212efe556adSCorentin Charyint main(void) { 2213efe556adSCorentin Chary png_structp png_ptr; 2214efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 22157edc3fedSPeter Maydell return png_ptr != 0; 2216efe556adSCorentin Chary} 2217efe556adSCorentin CharyEOF 221865d5d3f9SStefan Weil if $pkg_config libpng --exists; then 2219ca871ec8SStefan Weil vnc_png_cflags=`$pkg_config libpng --cflags` 2220ca871ec8SStefan Weil vnc_png_libs=`$pkg_config libpng --libs` 22219af8025eSBrad else 2222efe556adSCorentin Chary vnc_png_cflags="" 2223efe556adSCorentin Chary vnc_png_libs="-lpng" 22249af8025eSBrad fi 2225efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 2226efe556adSCorentin Chary vnc_png=yes 2227efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 22289af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 2229efe556adSCorentin Chary else 2230efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 223121684af0SStewart Smith feature_not_found "vnc-png" "Install libpng devel" 2232efe556adSCorentin Chary fi 2233efe556adSCorentin Chary vnc_png=no 2234efe556adSCorentin Chary fi 2235efe556adSCorentin Charyfi 2236efe556adSCorentin Chary 2237efe556adSCorentin Chary########################################## 223876655d6dSaliguori# fnmatch() probe, used for ACL routines 223976655d6dSaliguorifnmatch="no" 224076655d6dSaliguoricat > $TMPC << EOF 224176655d6dSaliguori#include <fnmatch.h> 224276655d6dSaliguoriint main(void) 224376655d6dSaliguori{ 224476655d6dSaliguori fnmatch("foo", "foo", 0); 224576655d6dSaliguori return 0; 224676655d6dSaliguori} 224776655d6dSaliguoriEOF 224852166aa0SJuan Quintelaif compile_prog "" "" ; then 224976655d6dSaliguori fnmatch="yes" 225076655d6dSaliguorifi 225176655d6dSaliguori 225276655d6dSaliguori########################################## 2253ee682d27SStefan Weil# uuid_generate() probe, used for vdi block driver 22542d16c8e9SPeter Maydell# Note that on some systems (notably MacOSX) no extra library 22552d16c8e9SPeter Maydell# need be linked to get the uuid functions. 2256ee682d27SStefan Weilif test "$uuid" != "no" ; then 2257ee682d27SStefan Weil uuid_libs="-luuid" 2258ee682d27SStefan Weil cat > $TMPC << EOF 2259ee682d27SStefan Weil#include <uuid/uuid.h> 2260ee682d27SStefan Weilint main(void) 2261ee682d27SStefan Weil{ 2262ee682d27SStefan Weil uuid_t my_uuid; 2263ee682d27SStefan Weil uuid_generate(my_uuid); 2264ee682d27SStefan Weil return 0; 2265ee682d27SStefan Weil} 2266ee682d27SStefan WeilEOF 22672d16c8e9SPeter Maydell if compile_prog "" "" ; then 22682d16c8e9SPeter Maydell uuid="yes" 22692d16c8e9SPeter Maydell elif compile_prog "" "$uuid_libs" ; then 2270ee682d27SStefan Weil uuid="yes" 2271ee682d27SStefan Weil libs_softmmu="$uuid_libs $libs_softmmu" 2272ee682d27SStefan Weil libs_tools="$uuid_libs $libs_tools" 2273ee682d27SStefan Weil else 2274ee682d27SStefan Weil if test "$uuid" = "yes" ; then 227521684af0SStewart Smith feature_not_found "uuid" "Install libuuid devel" 2276ee682d27SStefan Weil fi 2277ee682d27SStefan Weil uuid=no 2278ee682d27SStefan Weil fi 2279ee682d27SStefan Weilfi 2280ee682d27SStefan Weil 22814f18b782SJeff Codyif test "$vhdx" = "yes" ; then 22824f18b782SJeff Cody if test "$uuid" = "no" ; then 22834f18b782SJeff Cody error_exit "uuid required for VHDX support" 22844f18b782SJeff Cody fi 22854f18b782SJeff Codyelif test "$vhdx" != "no" ; then 22864f18b782SJeff Cody if test "$uuid" = "yes" ; then 22874f18b782SJeff Cody vhdx=yes 22884f18b782SJeff Cody else 22894f18b782SJeff Cody vhdx=no 22904f18b782SJeff Cody fi 22914f18b782SJeff Codyfi 22924f18b782SJeff Cody 2293ee682d27SStefan Weil########################################## 2294dce512deSChristoph Hellwig# xfsctl() probe, used for raw-posix 2295dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 2296dce512deSChristoph Hellwig cat > $TMPC << EOF 2297ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 2298dce512deSChristoph Hellwig#include <xfs/xfs.h> 2299dce512deSChristoph Hellwigint main(void) 2300dce512deSChristoph Hellwig{ 2301dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 2302dce512deSChristoph Hellwig return 0; 2303dce512deSChristoph Hellwig} 2304dce512deSChristoph HellwigEOF 2305dce512deSChristoph Hellwig if compile_prog "" "" ; then 2306dce512deSChristoph Hellwig xfs="yes" 2307dce512deSChristoph Hellwig else 2308dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 230921684af0SStewart Smith feature_not_found "xfs" "Instal xfsprogs/xfslibs devel" 2310dce512deSChristoph Hellwig fi 2311dce512deSChristoph Hellwig xfs=no 2312dce512deSChristoph Hellwig fi 2313dce512deSChristoph Hellwigfi 2314dce512deSChristoph Hellwig 2315dce512deSChristoph Hellwig########################################## 23168a16d273Sths# vde libraries probe 2317dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 23184baae0acSJuan Quintela vde_libs="-lvdeplug" 23198a16d273Sths cat > $TMPC << EOF 23208a16d273Sths#include <libvdeplug.h> 23214a7f0e06Spbrookint main(void) 23224a7f0e06Spbrook{ 23234a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 2324fea08e08SPeter Maydell char s[] = ""; 2325fea08e08SPeter Maydell vde_open(s, s, &a); 23264a7f0e06Spbrook return 0; 23274a7f0e06Spbrook} 23288a16d273SthsEOF 232952166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 23304baae0acSJuan Quintela vde=yes 23318e02e54cSJuan Quintela libs_softmmu="$vde_libs $libs_softmmu" 23328e02e54cSJuan Quintela libs_tools="$vde_libs $libs_tools" 2333dfb278bdSJuan Quintela else 2334dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 233521684af0SStewart Smith feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" 2336dfb278bdSJuan Quintela fi 2337dfb278bdSJuan Quintela vde=no 23388a16d273Sths fi 23398a16d273Sthsfi 23408a16d273Sths 23418a16d273Sths########################################## 23420a985b37SVincenzo Maffione# netmap support probe 23430a985b37SVincenzo Maffione# Apart from looking for netmap headers, we make sure that the host API version 23440a985b37SVincenzo Maffione# supports the netmap backend (>=11). The upper bound (15) is meant to simulate 23450a985b37SVincenzo Maffione# a minor/major version number. Minor new features will be marked with values up 23460a985b37SVincenzo Maffione# to 15, and if something happens that requires a change to the backend we will 23470a985b37SVincenzo Maffione# move above 15, submit the backend fixes and modify this two bounds. 234858952137SVincenzo Maffioneif test "$netmap" != "no" ; then 234958952137SVincenzo Maffione cat > $TMPC << EOF 235058952137SVincenzo Maffione#include <inttypes.h> 235158952137SVincenzo Maffione#include <net/if.h> 235258952137SVincenzo Maffione#include <net/netmap.h> 235358952137SVincenzo Maffione#include <net/netmap_user.h> 23540a985b37SVincenzo Maffione#if (NETMAP_API < 11) || (NETMAP_API > 15) 23550a985b37SVincenzo Maffione#error 23560a985b37SVincenzo Maffione#endif 235758952137SVincenzo Maffioneint main(void) { return 0; } 235858952137SVincenzo MaffioneEOF 235958952137SVincenzo Maffione if compile_prog "" "" ; then 236058952137SVincenzo Maffione netmap=yes 236158952137SVincenzo Maffione else 236258952137SVincenzo Maffione if test "$netmap" = "yes" ; then 236358952137SVincenzo Maffione feature_not_found "netmap" 236458952137SVincenzo Maffione fi 236558952137SVincenzo Maffione netmap=no 236658952137SVincenzo Maffione fi 236758952137SVincenzo Maffionefi 236858952137SVincenzo Maffione 236958952137SVincenzo Maffione########################################## 237047e98658SCorey Bryant# libcap-ng library probe 237147e98658SCorey Bryantif test "$cap_ng" != "no" ; then 237247e98658SCorey Bryant cap_libs="-lcap-ng" 237347e98658SCorey Bryant cat > $TMPC << EOF 237447e98658SCorey Bryant#include <cap-ng.h> 237547e98658SCorey Bryantint main(void) 237647e98658SCorey Bryant{ 237747e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 237847e98658SCorey Bryant return 0; 237947e98658SCorey Bryant} 238047e98658SCorey BryantEOF 238147e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 238247e98658SCorey Bryant cap_ng=yes 238347e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 238447e98658SCorey Bryant else 238547e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 238621684af0SStewart Smith feature_not_found "cap_ng" "Install libcap-ng devel" 238747e98658SCorey Bryant fi 238847e98658SCorey Bryant cap_ng=no 238947e98658SCorey Bryant fi 239047e98658SCorey Bryantfi 239147e98658SCorey Bryant 239247e98658SCorey Bryant########################################## 2393c2de5c91Smalc# Sound support libraries probe 23948f28f3fbSths 2395c2de5c91Smalcaudio_drv_probe() 2396c2de5c91Smalc{ 2397c2de5c91Smalc drv=$1 2398c2de5c91Smalc hdr=$2 2399c2de5c91Smalc lib=$3 2400c2de5c91Smalc exp=$4 2401c2de5c91Smalc cfl=$5 24028f28f3fbSths cat > $TMPC << EOF 2403c2de5c91Smalc#include <$hdr> 2404c2de5c91Smalcint main(void) { $exp } 24058f28f3fbSthsEOF 240652166aa0SJuan Quintela if compile_prog "$cfl" "$lib" ; then 24078f28f3fbSths : 24088f28f3fbSths else 240976ad07a4SPeter Maydell error_exit "$drv check failed" \ 241076ad07a4SPeter Maydell "Make sure to have the $drv libs and headers installed." 24118f28f3fbSths fi 2412c2de5c91Smalc} 2413c2de5c91Smalc 24142fa7d3bfSmalcaudio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` 2415c2de5c91Smalcfor drv in $audio_drv_list; do 2416c2de5c91Smalc case $drv in 2417c2de5c91Smalc alsa) 2418c2de5c91Smalc audio_drv_probe $drv alsa/asoundlib.h -lasound \ 2419e35bcb0cSStefan Weil "return snd_pcm_close((snd_pcm_t *)0);" 2420a4bf6780SJuan Quintela libs_softmmu="-lasound $libs_softmmu" 2421c2de5c91Smalc ;; 2422c2de5c91Smalc 2423c2de5c91Smalc fmod) 2424c2de5c91Smalc if test -z $fmod_lib || test -z $fmod_inc; then 242576ad07a4SPeter Maydell error_exit "You must specify path to FMOD library and headers" \ 242676ad07a4SPeter Maydell "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 24278f28f3fbSths fi 2428c2de5c91Smalc audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" 2429a4bf6780SJuan Quintela libs_softmmu="$fmod_lib $libs_softmmu" 2430c2de5c91Smalc ;; 2431c2de5c91Smalc 2432c2de5c91Smalc esd) 2433c2de5c91Smalc audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' 2434a4bf6780SJuan Quintela libs_softmmu="-lesd $libs_softmmu" 243567f86e8eSJuan Quintela audio_pt_int="yes" 2436c2de5c91Smalc ;; 2437b8e59f18Smalc 2438b8e59f18Smalc pa) 2439a394aed2SMarc-André Lureau audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ 2440a394aed2SMarc-André Lureau "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" 2441a394aed2SMarc-André Lureau libs_softmmu="-lpulse $libs_softmmu" 244267f86e8eSJuan Quintela audio_pt_int="yes" 2443b8e59f18Smalc ;; 2444b8e59f18Smalc 2445997e690aSJuan Quintela coreaudio) 2446997e690aSJuan Quintela libs_softmmu="-framework CoreAudio $libs_softmmu" 2447997e690aSJuan Quintela ;; 2448997e690aSJuan Quintela 2449a4bf6780SJuan Quintela dsound) 2450a4bf6780SJuan Quintela libs_softmmu="-lole32 -ldxguid $libs_softmmu" 2451d5631638Smalc audio_win_int="yes" 2452a4bf6780SJuan Quintela ;; 2453a4bf6780SJuan Quintela 2454a4bf6780SJuan Quintela oss) 2455a4bf6780SJuan Quintela libs_softmmu="$oss_lib $libs_softmmu" 2456a4bf6780SJuan Quintela ;; 2457a4bf6780SJuan Quintela 2458a4bf6780SJuan Quintela sdl|wav) 24592f6a1ab0Sblueswir1 # XXX: Probes for CoreAudio, DirectSound, SDL(?) 24602f6a1ab0Sblueswir1 ;; 24612f6a1ab0Sblueswir1 2462d5631638Smalc winwave) 2463d5631638Smalc libs_softmmu="-lwinmm $libs_softmmu" 2464d5631638Smalc audio_win_int="yes" 2465d5631638Smalc ;; 2466d5631638Smalc 2467e4c63a6aSmalc *) 24681c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 246976ad07a4SPeter Maydell error_exit "Unknown driver '$drv' selected" \ 247076ad07a4SPeter Maydell "Possible drivers are: $audio_possible_drivers" 2471e4c63a6aSmalc } 2472e4c63a6aSmalc ;; 2473c2de5c91Smalc esac 2474c2de5c91Smalcdone 24758f28f3fbSths 24764d3b6f6eSbalrog########################################## 24772e4d9fb1Saurel32# BrlAPI probe 24782e4d9fb1Saurel32 24794ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 2480eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 24812e4d9fb1Saurel32 cat > $TMPC << EOF 24822e4d9fb1Saurel32#include <brlapi.h> 2483832ce9c2SScott Wood#include <stddef.h> 24842e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 24852e4d9fb1Saurel32EOF 248652166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 24872e4d9fb1Saurel32 brlapi=yes 2488264606b3SJuan Quintela libs_softmmu="$brlapi_libs $libs_softmmu" 24894ffcedb6SJuan Quintela else 24904ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 249121684af0SStewart Smith feature_not_found "brlapi" "Install brlapi devel" 24924ffcedb6SJuan Quintela fi 24934ffcedb6SJuan Quintela brlapi=no 2494eb82284fSJuan Quintela fi 2495eb82284fSJuan Quintelafi 24962e4d9fb1Saurel32 24972e4d9fb1Saurel32########################################## 24984d3b6f6eSbalrog# curses probe 2499a3605bf6SMichael Tokarevif test "$curses" != "no" ; then 2500e095e2f3SStefan Weil if test "$mingw32" = "yes" ; then 2501e095e2f3SStefan Weil curses_list="-lpdcurses" 2502e095e2f3SStefan Weil else 2503cfeda5f4SEd Maste curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses" 2504e095e2f3SStefan Weil fi 2505c584a6d0SJuan Quintela curses_found=no 25064d3b6f6eSbalrog cat > $TMPC << EOF 25074d3b6f6eSbalrog#include <curses.h> 2508ef9a2524SStefan Weilint main(void) { 2509ef9a2524SStefan Weil const char *s = curses_version(); 2510ef9a2524SStefan Weil resize_term(0, 0); 2511ef9a2524SStefan Weil return s != 0; 2512ef9a2524SStefan Weil} 25134d3b6f6eSbalrogEOF 2514ecbe251fSVadim Evard IFS=: 25154f78ef9aSJuan Quintela for curses_lib in $curses_list; do 2516ecbe251fSVadim Evard unset IFS 25174f78ef9aSJuan Quintela if compile_prog "" "$curses_lib" ; then 2518c584a6d0SJuan Quintela curses_found=yes 25194f78ef9aSJuan Quintela libs_softmmu="$curses_lib $libs_softmmu" 25204f78ef9aSJuan Quintela break 25214d3b6f6eSbalrog fi 25224f78ef9aSJuan Quintela done 2523ecbe251fSVadim Evard unset IFS 2524c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 2525c584a6d0SJuan Quintela curses=yes 2526c584a6d0SJuan Quintela else 2527c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 252821684af0SStewart Smith feature_not_found "curses" "Install ncurses devel" 2529c584a6d0SJuan Quintela fi 2530c584a6d0SJuan Quintela curses=no 2531c584a6d0SJuan Quintela fi 25324f78ef9aSJuan Quintelafi 25334d3b6f6eSbalrog 2534414f0dabSblueswir1########################################## 2535769ce76dSAlexander Graf# curl probe 2536a3605bf6SMichael Tokarevif test "$curl" != "no" ; then 253765d5d3f9SStefan Weil if $pkg_config libcurl --exists; then 2538a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 25394e2b0658SPaolo Bonzini else 25404e2b0658SPaolo Bonzini curlconfig=curl-config 25414e2b0658SPaolo Bonzini fi 2542769ce76dSAlexander Graf cat > $TMPC << EOF 2543769ce76dSAlexander Graf#include <curl/curl.h> 25440b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 2545769ce76dSAlexander GrafEOF 25464e2b0658SPaolo Bonzini curl_cflags=`$curlconfig --cflags 2>/dev/null` 25474e2b0658SPaolo Bonzini curl_libs=`$curlconfig --libs 2>/dev/null` 2548b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 2549769ce76dSAlexander Graf curl=yes 2550788c8196SJuan Quintela else 2551788c8196SJuan Quintela if test "$curl" = "yes" ; then 255221684af0SStewart Smith feature_not_found "curl" "Install libcurl devel" 2553788c8196SJuan Quintela fi 2554788c8196SJuan Quintela curl=no 2555769ce76dSAlexander Graf fi 2556769ce76dSAlexander Graffi # test "$curl" 2557769ce76dSAlexander Graf 2558769ce76dSAlexander Graf########################################## 2559fb599c9aSbalrog# bluez support probe 2560a20a6f46SJuan Quintelaif test "$bluez" != "no" ; then 2561e820e3f4Sbalrog cat > $TMPC << EOF 2562e820e3f4Sbalrog#include <bluetooth/bluetooth.h> 2563e820e3f4Sbalrogint main(void) { return bt_error(0); } 2564e820e3f4SbalrogEOF 2565a8bd70adSPaolo Bonzini bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` 2566a8bd70adSPaolo Bonzini bluez_libs=`$pkg_config --libs bluez 2> /dev/null` 256752166aa0SJuan Quintela if compile_prog "$bluez_cflags" "$bluez_libs" ; then 2568a20a6f46SJuan Quintela bluez=yes 2569e482d56aSJuan Quintela libs_softmmu="$bluez_libs $libs_softmmu" 2570e820e3f4Sbalrog else 2571a20a6f46SJuan Quintela if test "$bluez" = "yes" ; then 257221684af0SStewart Smith feature_not_found "bluez" "Install bluez-libs/libbluetooth devel" 2573a20a6f46SJuan Quintela fi 2574e820e3f4Sbalrog bluez="no" 2575e820e3f4Sbalrog fi 2576fb599c9aSbalrogfi 2577fb599c9aSbalrog 2578fb599c9aSbalrog########################################## 2579e18df141SAnthony Liguori# glib support probe 2580a52d28afSPaolo Bonzini 2581a52d28afSPaolo Bonziniif test "$mingw32" = yes; then 2582a52d28afSPaolo Bonzini # g_poll is required in order to integrate with the glib main loop. 2583a52d28afSPaolo Bonzini glib_req_ver=2.20 2584a52d28afSPaolo Bonzinielse 2585a52d28afSPaolo Bonzini glib_req_ver=2.12 2586a52d28afSPaolo Bonzinifi 2587aa0d1f44SPaolo Bonziniglib_modules=gthread-2.0 2588aa0d1f44SPaolo Bonziniif test "$modules" = yes; then 2589aa0d1f44SPaolo Bonzini glib_modules="$glib_modules gmodule-2.0" 2590aa0d1f44SPaolo Bonzinifi 2591e26110cfSFam Zheng 2592aa0d1f44SPaolo Bonzinifor i in $glib_modules; do 2593e26110cfSFam Zheng if $pkg_config --atleast-version=$glib_req_ver $i; then 2594e26110cfSFam Zheng glib_cflags=`$pkg_config --cflags $i` 2595e26110cfSFam Zheng glib_libs=`$pkg_config --libs $i` 2596ba1183daSFam Zheng CFLAGS="$glib_cflags $CFLAGS" 259714015304SAnthony Liguori LIBS="$glib_libs $LIBS" 2598957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 2599e18df141SAnthony Liguori else 2600e26110cfSFam Zheng error_exit "glib-$glib_req_ver $i is required to compile QEMU" 2601e26110cfSFam Zheng fi 2602e26110cfSFam Zhengdone 2603e26110cfSFam Zheng 2604e26110cfSFam Zheng########################################## 2605e26110cfSFam Zheng# SHA command probe for modules 2606e26110cfSFam Zhengif test "$modules" = yes; then 2607e26110cfSFam Zheng shacmd_probe="sha1sum sha1 shasum" 2608e26110cfSFam Zheng for c in $shacmd_probe; do 2609e26110cfSFam Zheng if which $c &>/dev/null; then 2610e26110cfSFam Zheng shacmd="$c" 2611e26110cfSFam Zheng break 2612e26110cfSFam Zheng fi 2613e26110cfSFam Zheng done 2614e26110cfSFam Zheng if test "$shacmd" = ""; then 2615e26110cfSFam Zheng error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" 2616e26110cfSFam Zheng fi 2617e18df141SAnthony Liguorifi 2618e18df141SAnthony Liguori 2619e18df141SAnthony Liguori########################################## 2620e2134eb9SGerd Hoffmann# pixman support probe 2621e2134eb9SGerd Hoffmann 2622e2134eb9SGerd Hoffmannif test "$pixman" = ""; then 262374880fe2SRobert Schiele if test "$want_tools" = "no" -a "$softmmu" = "no"; then 262474880fe2SRobert Schiele pixman="none" 262574880fe2SRobert Schiele elif $pkg_config pixman-1 > /dev/null 2>&1; then 2626e2134eb9SGerd Hoffmann pixman="system" 2627e2134eb9SGerd Hoffmann else 2628e2134eb9SGerd Hoffmann pixman="internal" 2629e2134eb9SGerd Hoffmann fi 2630e2134eb9SGerd Hoffmannfi 263174880fe2SRobert Schieleif test "$pixman" = "none"; then 263274880fe2SRobert Schiele if test "$want_tools" != "no" -o "$softmmu" != "no"; then 263376ad07a4SPeter Maydell error_exit "pixman disabled but system emulation or tools build" \ 263476ad07a4SPeter Maydell "enabled. You can turn off pixman only if you also" \ 263576ad07a4SPeter Maydell "disable all system emulation targets and the tools" \ 263676ad07a4SPeter Maydell "build with '--disable-tools --disable-system'." 263774880fe2SRobert Schiele fi 263874880fe2SRobert Schiele pixman_cflags= 263974880fe2SRobert Schiele pixman_libs= 264074880fe2SRobert Schieleelif test "$pixman" = "system"; then 2641ca871ec8SStefan Weil pixman_cflags=`$pkg_config --cflags pixman-1` 2642ca871ec8SStefan Weil pixman_libs=`$pkg_config --libs pixman-1` 2643e2134eb9SGerd Hoffmannelse 2644e2134eb9SGerd Hoffmann if test ! -d ${source_path}/pixman/pixman; then 264576ad07a4SPeter Maydell error_exit "pixman not present. Your options:" \ 264676ad07a4SPeter Maydell " (1) Preferred: Install the pixman devel package (any recent" \ 264776ad07a4SPeter Maydell " distro should have packages as Xorg needs pixman too)." \ 264876ad07a4SPeter Maydell " (2) Fetch the pixman submodule, using:" \ 264976ad07a4SPeter Maydell " git submodule update --init pixman" 2650e2134eb9SGerd Hoffmann fi 26515ca9388aSGerd Hoffmann mkdir -p pixman/pixman 26525ca9388aSGerd Hoffmann pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman" 26535ca9388aSGerd Hoffmann pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1" 2654e2134eb9SGerd Hoffmannfi 2655e2134eb9SGerd Hoffmann 2656e2134eb9SGerd Hoffmann########################################## 265717bff52bSM. Mohan Kumar# libcap probe 265817bff52bSM. Mohan Kumar 265917bff52bSM. Mohan Kumarif test "$cap" != "no" ; then 266017bff52bSM. Mohan Kumar cat > $TMPC <<EOF 266117bff52bSM. Mohan Kumar#include <stdio.h> 266217bff52bSM. Mohan Kumar#include <sys/capability.h> 2663cc939743SStefan Weilint main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } 266417bff52bSM. Mohan KumarEOF 266517bff52bSM. Mohan Kumar if compile_prog "" "-lcap" ; then 266617bff52bSM. Mohan Kumar cap=yes 266717bff52bSM. Mohan Kumar else 266817bff52bSM. Mohan Kumar cap=no 266917bff52bSM. Mohan Kumar fi 267017bff52bSM. Mohan Kumarfi 267117bff52bSM. Mohan Kumar 267217bff52bSM. Mohan Kumar########################################## 2673e5d355d1Saliguori# pthread probe 26744b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 26753c529d93Saliguori 2676e5d355d1Saliguoripthread=no 2677414f0dabSblueswir1cat > $TMPC << EOF 26783c529d93Saliguori#include <pthread.h> 26797a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 26807a42bbe4SStefan Weilint main(void) { 26817a42bbe4SStefan Weil pthread_t thread; 26827a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 26837a42bbe4SStefan Weil return 0; 26847a42bbe4SStefan Weil} 2685414f0dabSblueswir1EOF 2686bd00d539SAndreas Färberif compile_prog "" "" ; then 2687bd00d539SAndreas Färber pthread=yes 2688bd00d539SAndreas Färberelse 2689de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 269052166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 2691e5d355d1Saliguori pthread=yes 2692e3c56761SPeter Portante found=no 2693e3c56761SPeter Portante for lib_entry in $LIBS; do 2694e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 2695e3c56761SPeter Portante found=yes 2696e3c56761SPeter Portante break 2697e3c56761SPeter Portante fi 2698e3c56761SPeter Portante done 2699e3c56761SPeter Portante if test "$found" = "no"; then 27005572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 2701e3c56761SPeter Portante fi 2702de65fe0fSSebastian Herbszt break 2703414f0dabSblueswir1 fi 2704de65fe0fSSebastian Herbszt done 2705bd00d539SAndreas Färberfi 2706414f0dabSblueswir1 27074617e593SAnthony Liguoriif test "$mingw32" != yes -a "$pthread" = no; then 270876ad07a4SPeter Maydell error_exit "pthread check failed" \ 270976ad07a4SPeter Maydell "Make sure to have the pthread libs and headers installed." 2710e5d355d1Saliguorifi 2711e5d355d1Saliguori 2712bf9298b9Saliguori########################################## 2713f27aaf4bSChristian Brunner# rbd probe 2714f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 2715f27aaf4bSChristian Brunner cat > $TMPC <<EOF 2716f27aaf4bSChristian Brunner#include <stdio.h> 2717ad32e9c0SJosh Durgin#include <rbd/librbd.h> 2718f27aaf4bSChristian Brunnerint main(void) { 2719ad32e9c0SJosh Durgin rados_t cluster; 2720ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 2721f27aaf4bSChristian Brunner return 0; 2722f27aaf4bSChristian Brunner} 2723f27aaf4bSChristian BrunnerEOF 2724ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 2725f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 2726f27aaf4bSChristian Brunner rbd=yes 2727f27aaf4bSChristian Brunner else 2728f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 272921684af0SStewart Smith feature_not_found "rados block device" "Install librbd/ceph devel" 2730f27aaf4bSChristian Brunner fi 2731f27aaf4bSChristian Brunner rbd=no 2732f27aaf4bSChristian Brunner fi 2733f27aaf4bSChristian Brunnerfi 2734f27aaf4bSChristian Brunner 2735f27aaf4bSChristian Brunner########################################## 27360a12ec87SRichard W.M. Jones# libssh2 probe 27374fc16838SRichard W.M. Jonesmin_libssh2_version=1.2.8 27380a12ec87SRichard W.M. Jonesif test "$libssh2" != "no" ; then 273965d5d3f9SStefan Weil if $pkg_config --atleast-version=$min_libssh2_version libssh2; then 27400a12ec87SRichard W.M. Jones libssh2_cflags=`$pkg_config libssh2 --cflags` 27410a12ec87SRichard W.M. Jones libssh2_libs=`$pkg_config libssh2 --libs` 27420a12ec87SRichard W.M. Jones libssh2=yes 27430a12ec87SRichard W.M. Jones else 27440a12ec87SRichard W.M. Jones if test "$libssh2" = "yes" ; then 27454fc16838SRichard W.M. Jones error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2" 27460a12ec87SRichard W.M. Jones fi 27470a12ec87SRichard W.M. Jones libssh2=no 27480a12ec87SRichard W.M. Jones fi 27490a12ec87SRichard W.M. Jonesfi 27500a12ec87SRichard W.M. Jones 27510a12ec87SRichard W.M. Jones########################################## 27529a2d462eSRichard W.M. Jones# libssh2_sftp_fsync probe 27539a2d462eSRichard W.M. Jones 27549a2d462eSRichard W.M. Jonesif test "$libssh2" = "yes"; then 27559a2d462eSRichard W.M. Jones cat > $TMPC <<EOF 27569a2d462eSRichard W.M. Jones#include <stdio.h> 27579a2d462eSRichard W.M. Jones#include <libssh2.h> 27589a2d462eSRichard W.M. Jones#include <libssh2_sftp.h> 27599a2d462eSRichard W.M. Jonesint main(void) { 27609a2d462eSRichard W.M. Jones LIBSSH2_SESSION *session; 27619a2d462eSRichard W.M. Jones LIBSSH2_SFTP *sftp; 27629a2d462eSRichard W.M. Jones LIBSSH2_SFTP_HANDLE *sftp_handle; 27639a2d462eSRichard W.M. Jones session = libssh2_session_init (); 27649a2d462eSRichard W.M. Jones sftp = libssh2_sftp_init (session); 27659a2d462eSRichard W.M. Jones sftp_handle = libssh2_sftp_open (sftp, "/", 0, 0); 27669a2d462eSRichard W.M. Jones libssh2_sftp_fsync (sftp_handle); 27679a2d462eSRichard W.M. Jones return 0; 27689a2d462eSRichard W.M. Jones} 27699a2d462eSRichard W.M. JonesEOF 27709a2d462eSRichard W.M. Jones # libssh2_cflags/libssh2_libs defined in previous test. 27719a2d462eSRichard W.M. Jones if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then 27729a2d462eSRichard W.M. Jones QEMU_CFLAGS="-DHAS_LIBSSH2_SFTP_FSYNC $QEMU_CFLAGS" 27739a2d462eSRichard W.M. Jones fi 27749a2d462eSRichard W.M. Jonesfi 27759a2d462eSRichard W.M. Jones 27769a2d462eSRichard W.M. Jones########################################## 27775c6c3a6cSChristoph Hellwig# linux-aio probe 27785c6c3a6cSChristoph Hellwig 27795c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 27805c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 27815c6c3a6cSChristoph Hellwig#include <libaio.h> 27825c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 2783832ce9c2SScott Wood#include <stddef.h> 27845c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 27855c6c3a6cSChristoph HellwigEOF 27865c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 27875c6c3a6cSChristoph Hellwig linux_aio=yes 27885c6c3a6cSChristoph Hellwig else 27895c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 279021684af0SStewart Smith feature_not_found "linux AIO" "Install libaio devel" 27915c6c3a6cSChristoph Hellwig fi 27923cfcae3cSLuiz Capitulino linux_aio=no 27935c6c3a6cSChristoph Hellwig fi 27945c6c3a6cSChristoph Hellwigfi 27955c6c3a6cSChristoph Hellwig 27965c6c3a6cSChristoph Hellwig########################################## 27973b8acc11SPaolo Bonzini# TPM passthrough is only on x86 Linux 27983b8acc11SPaolo Bonzini 27993b8acc11SPaolo Bonziniif test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then 28003b8acc11SPaolo Bonzini tpm_passthrough=$tpm 28013b8acc11SPaolo Bonzinielse 28023b8acc11SPaolo Bonzini tpm_passthrough=no 28033b8acc11SPaolo Bonzinifi 28043b8acc11SPaolo Bonzini 28053b8acc11SPaolo Bonzini########################################## 2806583f6e7bSStefan Hajnoczi# adjust virtio-blk-data-plane based on linux-aio 2807583f6e7bSStefan Hajnoczi 2808583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" -a \ 2809583f6e7bSStefan Hajnoczi "$linux_aio" != "yes" ; then 281076ad07a4SPeter Maydell error_exit "virtio-blk-data-plane requires Linux AIO, please try --enable-linux-aio" 2811583f6e7bSStefan Hajnoczielif test -z "$virtio_blk_data_plane" ; then 2812583f6e7bSStefan Hajnoczi virtio_blk_data_plane=$linux_aio 2813583f6e7bSStefan Hajnoczifi 2814583f6e7bSStefan Hajnoczi 2815583f6e7bSStefan Hajnoczi########################################## 2816758e8e38SVenkateswararao Jujjuri (JV)# attr probe 2817758e8e38SVenkateswararao Jujjuri (JV) 2818758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 2819758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 2820758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 2821758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 2822f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 2823f2338fb4SPavel Borzenkov#include <attr/xattr.h> 2824f2338fb4SPavel Borzenkov#else 28254f26f2b6SAvi Kivity#include <sys/xattr.h> 2826f2338fb4SPavel Borzenkov#endif 2827758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 2828758e8e38SVenkateswararao Jujjuri (JV)EOF 28294f26f2b6SAvi Kivity if compile_prog "" "" ; then 28304f26f2b6SAvi Kivity attr=yes 28314f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 2832f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 2833758e8e38SVenkateswararao Jujjuri (JV) attr=yes 2834758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 28354f26f2b6SAvi Kivity libattr=yes 2836758e8e38SVenkateswararao Jujjuri (JV) else 2837758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 283821684af0SStewart Smith feature_not_found "ATTR" "Install libc6 or libattr devel" 2839758e8e38SVenkateswararao Jujjuri (JV) fi 2840758e8e38SVenkateswararao Jujjuri (JV) attr=no 2841758e8e38SVenkateswararao Jujjuri (JV) fi 2842758e8e38SVenkateswararao Jujjuri (JV)fi 2843758e8e38SVenkateswararao Jujjuri (JV) 2844758e8e38SVenkateswararao Jujjuri (JV)########################################## 2845bf9298b9Saliguori# iovec probe 2846bf9298b9Saliguoricat > $TMPC <<EOF 2847db34f0b3Sblueswir1#include <sys/types.h> 2848bf9298b9Saliguori#include <sys/uio.h> 2849db34f0b3Sblueswir1#include <unistd.h> 2850f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 2851bf9298b9SaliguoriEOF 2852bf9298b9Saliguoriiovec=no 285352166aa0SJuan Quintelaif compile_prog "" "" ; then 2854bf9298b9Saliguori iovec=yes 2855bf9298b9Saliguorifi 2856bf9298b9Saliguori 2857f652e6afSaurel32########################################## 2858ceb42de8Saliguori# preadv probe 2859ceb42de8Saliguoricat > $TMPC <<EOF 2860ceb42de8Saliguori#include <sys/types.h> 2861ceb42de8Saliguori#include <sys/uio.h> 2862ceb42de8Saliguori#include <unistd.h> 2863c075a723SBlue Swirlint main(void) { return preadv(0, 0, 0, 0); } 2864ceb42de8SaliguoriEOF 2865ceb42de8Saliguoripreadv=no 286652166aa0SJuan Quintelaif compile_prog "" "" ; then 2867ceb42de8Saliguori preadv=yes 2868ceb42de8Saliguorifi 2869ceb42de8Saliguori 2870ceb42de8Saliguori########################################## 2871f652e6afSaurel32# fdt probe 2872e169e1e1SPeter Maydell# fdt support is mandatory for at least some target architectures, 2873e169e1e1SPeter Maydell# so insist on it if we're building those system emulators. 2874e169e1e1SPeter Maydellfdt_required=no 2875e169e1e1SPeter Maydellfor target in $target_list; do 2876e169e1e1SPeter Maydell case $target in 28776a49fa95SAlexander Graf aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu) 2878e169e1e1SPeter Maydell fdt_required=yes 2879e169e1e1SPeter Maydell ;; 2880e169e1e1SPeter Maydell esac 2881e169e1e1SPeter Maydelldone 2882e169e1e1SPeter Maydell 2883e169e1e1SPeter Maydellif test "$fdt_required" = "yes"; then 2884e169e1e1SPeter Maydell if test "$fdt" = "no"; then 2885e169e1e1SPeter Maydell error_exit "fdt disabled but some requested targets require it." \ 2886e169e1e1SPeter Maydell "You can turn off fdt only if you also disable all the system emulation" \ 2887e169e1e1SPeter Maydell "targets which need it (by specifying a cut down --target-list)." 2888e169e1e1SPeter Maydell fi 2889e169e1e1SPeter Maydell fdt=yes 2890e169e1e1SPeter Maydellfi 2891e169e1e1SPeter Maydell 28922df87df7SJuan Quintelaif test "$fdt" != "no" ; then 2893b41af4baSJuan Quintela fdt_libs="-lfdt" 289496ce6545SPeter Crosthwaite # explicitly check for libfdt_env.h as it is missing in some stable installs 2895f652e6afSaurel32 cat > $TMPC << EOF 289696ce6545SPeter Crosthwaite#include <libfdt_env.h> 2897f652e6afSaurel32int main(void) { return 0; } 2898f652e6afSaurel32EOF 289952166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 2900a540f158SPeter Crosthwaite # system DTC is good - use it 2901f652e6afSaurel32 fdt=yes 2902a540f158SPeter Crosthwaite elif test -d ${source_path}/dtc/libfdt ; then 2903a540f158SPeter Crosthwaite # have submodule DTC - use it 2904a540f158SPeter Crosthwaite fdt=yes 2905a540f158SPeter Crosthwaite dtc_internal="yes" 2906a540f158SPeter Crosthwaite mkdir -p dtc 2907a540f158SPeter Crosthwaite if [ "$source_path" != `pwd` ] ; then 2908a540f158SPeter Crosthwaite symlink "$source_path/dtc/Makefile" "dtc/Makefile" 2909a540f158SPeter Crosthwaite symlink "$source_path/dtc/scripts" "dtc/scripts" 29102df87df7SJuan Quintela fi 2911a540f158SPeter Crosthwaite fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" 2912a540f158SPeter Crosthwaite fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs" 2913a540f158SPeter Crosthwaite elif test "$fdt" = "yes" ; then 2914a540f158SPeter Crosthwaite # have neither and want - prompt for system/submodule install 29153f281822SStewart Smith error_exit "DTC (libfdt) not present. Your options:" \ 29163f281822SStewart Smith " (1) Preferred: Install the DTC (libfdt) devel package" \ 2917a540f158SPeter Crosthwaite " (2) Fetch the DTC submodule, using:" \ 2918a540f158SPeter Crosthwaite " git submodule update --init dtc" 2919a540f158SPeter Crosthwaite else 2920a540f158SPeter Crosthwaite # don't have and don't want 2921de3a354aSMichael Walle fdt_libs= 29222df87df7SJuan Quintela fdt=no 2923f652e6afSaurel32 fi 2924f652e6afSaurel32fi 2925f652e6afSaurel32 2926a540f158SPeter Crosthwaitelibs_softmmu="$libs_softmmu $fdt_libs" 2927a540f158SPeter Crosthwaite 292820ff075bSMichael Walle########################################## 2929b1e5fff4SMichael Walle# GLX probe, used by milkymist-tmu2 2930b1e5fff4SMichael Walleif test "$glx" != "no" ; then 2931b1e5fff4SMichael Walle glx_libs="-lGL -lX11" 293220ff075bSMichael Walle cat > $TMPC << EOF 293320ff075bSMichael Walle#include <X11/Xlib.h> 293420ff075bSMichael Walle#include <GL/gl.h> 293520ff075bSMichael Walle#include <GL/glx.h> 2936d3fcbb16SMichael Walleint main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } 293720ff075bSMichael WalleEOF 2938d3fcbb16SMichael Walle if compile_prog "" "-lGL -lX11" ; then 2939b1e5fff4SMichael Walle glx=yes 294020ff075bSMichael Walle else 2941b1e5fff4SMichael Walle if test "$glx" = "yes" ; then 294221684af0SStewart Smith feature_not_found "glx" "Install GL devel (e.g. MESA)" 294320ff075bSMichael Walle fi 2944b1e5fff4SMichael Walle glx_libs= 2945b1e5fff4SMichael Walle glx=no 294620ff075bSMichael Walle fi 294720ff075bSMichael Wallefi 294820ff075bSMichael Walle 2949eb100396SBharata B Rao########################################## 2950eb100396SBharata B Rao# glusterfs probe 2951eb100396SBharata B Raoif test "$glusterfs" != "no" ; then 295265d5d3f9SStefan Weil if $pkg_config --atleast-version=3 glusterfs-api; then 2953e01bee08SBharata B Rao glusterfs="yes" 2954ca871ec8SStefan Weil glusterfs_cflags=`$pkg_config --cflags glusterfs-api` 2955ca871ec8SStefan Weil glusterfs_libs=`$pkg_config --libs glusterfs-api` 295665d5d3f9SStefan Weil if $pkg_config --atleast-version=5 glusterfs-api; then 29570c14fb47SBharata B Rao glusterfs_discard="yes" 29580c14fb47SBharata B Rao fi 29597c815372SBharata B Rao if $pkg_config --atleast-version=6 glusterfs-api; then 29607c815372SBharata B Rao glusterfs_zerofill="yes" 29617c815372SBharata B Rao fi 2962eb100396SBharata B Rao else 2963eb100396SBharata B Rao if test "$glusterfs" = "yes" ; then 296421684af0SStewart Smith feature_not_found "GlusterFS backend support" "Install glusterfs-api devel" 2965eb100396SBharata B Rao fi 2966e01bee08SBharata B Rao glusterfs="no" 2967eb100396SBharata B Rao fi 2968eb100396SBharata B Raofi 2969eb100396SBharata B Rao 297039386ac7Saurel32# Check for inotify functions when we are building linux-user 29713b3f24adSaurel32# emulator. This is done because older glibc versions don't 29723b3f24adSaurel32# have syscall stubs for these implemented. In that case we 29733b3f24adSaurel32# don't provide them even if kernel supports them. 29743b3f24adSaurel32# 29753b3f24adSaurel32inotify=no 29763b3f24adSaurel32cat > $TMPC << EOF 29773b3f24adSaurel32#include <sys/inotify.h> 29783b3f24adSaurel32 29793b3f24adSaurel32int 29803b3f24adSaurel32main(void) 29813b3f24adSaurel32{ 29823b3f24adSaurel32 /* try to start inotify */ 29838690e420Saurel32 return inotify_init(); 29843b3f24adSaurel32} 29853b3f24adSaurel32EOF 298652166aa0SJuan Quintelaif compile_prog "" "" ; then 29873b3f24adSaurel32 inotify=yes 29883b3f24adSaurel32fi 29893b3f24adSaurel32 2990c05c7a73SRiku Voipioinotify1=no 2991c05c7a73SRiku Voipiocat > $TMPC << EOF 2992c05c7a73SRiku Voipio#include <sys/inotify.h> 2993c05c7a73SRiku Voipio 2994c05c7a73SRiku Voipioint 2995c05c7a73SRiku Voipiomain(void) 2996c05c7a73SRiku Voipio{ 2997c05c7a73SRiku Voipio /* try to start inotify */ 2998c05c7a73SRiku Voipio return inotify_init1(0); 2999c05c7a73SRiku Voipio} 3000c05c7a73SRiku VoipioEOF 3001c05c7a73SRiku Voipioif compile_prog "" "" ; then 3002c05c7a73SRiku Voipio inotify1=yes 3003c05c7a73SRiku Voipiofi 3004c05c7a73SRiku Voipio 3005ebc996f3SRiku Voipio# check if utimensat and futimens are supported 3006ebc996f3SRiku Voipioutimens=no 3007ebc996f3SRiku Voipiocat > $TMPC << EOF 3008ebc996f3SRiku Voipio#define _ATFILE_SOURCE 3009ebc996f3SRiku Voipio#include <stddef.h> 3010ebc996f3SRiku Voipio#include <fcntl.h> 30113014ee00SPeter Maydell#include <sys/stat.h> 3012ebc996f3SRiku Voipio 3013ebc996f3SRiku Voipioint main(void) 3014ebc996f3SRiku Voipio{ 3015ebc996f3SRiku Voipio utimensat(AT_FDCWD, "foo", NULL, 0); 3016ebc996f3SRiku Voipio futimens(0, NULL); 3017ebc996f3SRiku Voipio return 0; 3018ebc996f3SRiku Voipio} 3019ebc996f3SRiku VoipioEOF 302052166aa0SJuan Quintelaif compile_prog "" "" ; then 3021ebc996f3SRiku Voipio utimens=yes 3022ebc996f3SRiku Voipiofi 3023ebc996f3SRiku Voipio 3024099d6b0fSRiku Voipio# check if pipe2 is there 3025099d6b0fSRiku Voipiopipe2=no 3026099d6b0fSRiku Voipiocat > $TMPC << EOF 3027099d6b0fSRiku Voipio#include <unistd.h> 3028099d6b0fSRiku Voipio#include <fcntl.h> 3029099d6b0fSRiku Voipio 3030099d6b0fSRiku Voipioint main(void) 3031099d6b0fSRiku Voipio{ 3032099d6b0fSRiku Voipio int pipefd[2]; 30339bca8162SBruce Rogers return pipe2(pipefd, O_CLOEXEC); 3034099d6b0fSRiku Voipio} 3035099d6b0fSRiku VoipioEOF 303652166aa0SJuan Quintelaif compile_prog "" "" ; then 3037099d6b0fSRiku Voipio pipe2=yes 3038099d6b0fSRiku Voipiofi 3039099d6b0fSRiku Voipio 304040ff6d7eSKevin Wolf# check if accept4 is there 304140ff6d7eSKevin Wolfaccept4=no 304240ff6d7eSKevin Wolfcat > $TMPC << EOF 304340ff6d7eSKevin Wolf#include <sys/socket.h> 304440ff6d7eSKevin Wolf#include <stddef.h> 304540ff6d7eSKevin Wolf 304640ff6d7eSKevin Wolfint main(void) 304740ff6d7eSKevin Wolf{ 304840ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 304940ff6d7eSKevin Wolf return 0; 305040ff6d7eSKevin Wolf} 305140ff6d7eSKevin WolfEOF 305240ff6d7eSKevin Wolfif compile_prog "" "" ; then 305340ff6d7eSKevin Wolf accept4=yes 305440ff6d7eSKevin Wolffi 305540ff6d7eSKevin Wolf 30563ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 30573ce34dfbSvibisreenivasansplice=no 30583ce34dfbSvibisreenivasancat > $TMPC << EOF 30593ce34dfbSvibisreenivasan#include <unistd.h> 30603ce34dfbSvibisreenivasan#include <fcntl.h> 30613ce34dfbSvibisreenivasan#include <limits.h> 30623ce34dfbSvibisreenivasan 30633ce34dfbSvibisreenivasanint main(void) 30643ce34dfbSvibisreenivasan{ 306566ea0f22SStefan Weil int len, fd = 0; 30663ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 30673ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 30683ce34dfbSvibisreenivasan return 0; 30693ce34dfbSvibisreenivasan} 30703ce34dfbSvibisreenivasanEOF 307152166aa0SJuan Quintelaif compile_prog "" "" ; then 30723ce34dfbSvibisreenivasan splice=yes 30733ce34dfbSvibisreenivasanfi 30743ce34dfbSvibisreenivasan 3075dcc38d1cSMarcelo Tosatti########################################## 3076dcc38d1cSMarcelo Tosatti# signalfd probe 3077dcc38d1cSMarcelo Tosattisignalfd="no" 3078dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 3079dcc38d1cSMarcelo Tosatti#include <unistd.h> 3080dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 3081dcc38d1cSMarcelo Tosatti#include <signal.h> 3082dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 3083dcc38d1cSMarcelo TosattiEOF 3084dcc38d1cSMarcelo Tosatti 3085dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 3086dcc38d1cSMarcelo Tosatti signalfd=yes 3087dcc38d1cSMarcelo Tosattifi 3088dcc38d1cSMarcelo Tosatti 3089c2882b96SRiku Voipio# check if eventfd is supported 3090c2882b96SRiku Voipioeventfd=no 3091c2882b96SRiku Voipiocat > $TMPC << EOF 3092c2882b96SRiku Voipio#include <sys/eventfd.h> 3093c2882b96SRiku Voipio 3094c2882b96SRiku Voipioint main(void) 3095c2882b96SRiku Voipio{ 309655cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 3097c2882b96SRiku Voipio} 3098c2882b96SRiku VoipioEOF 3099c2882b96SRiku Voipioif compile_prog "" "" ; then 3100c2882b96SRiku Voipio eventfd=yes 3101c2882b96SRiku Voipiofi 3102c2882b96SRiku Voipio 3103d0927938SUlrich Hecht# check for fallocate 3104d0927938SUlrich Hechtfallocate=no 3105d0927938SUlrich Hechtcat > $TMPC << EOF 3106d0927938SUlrich Hecht#include <fcntl.h> 3107d0927938SUlrich Hecht 3108d0927938SUlrich Hechtint main(void) 3109d0927938SUlrich Hecht{ 3110d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 3111d0927938SUlrich Hecht return 0; 3112d0927938SUlrich Hecht} 3113d0927938SUlrich HechtEOF 31148fb03151SPeter Maydellif compile_prog "" "" ; then 3115d0927938SUlrich Hecht fallocate=yes 3116d0927938SUlrich Hechtfi 3117d0927938SUlrich Hecht 31183d4fa43eSKusanagi Kouichi# check for fallocate hole punching 31193d4fa43eSKusanagi Kouichifallocate_punch_hole=no 31203d4fa43eSKusanagi Kouichicat > $TMPC << EOF 31213d4fa43eSKusanagi Kouichi#include <fcntl.h> 31223d4fa43eSKusanagi Kouichi#include <linux/falloc.h> 31233d4fa43eSKusanagi Kouichi 31243d4fa43eSKusanagi Kouichiint main(void) 31253d4fa43eSKusanagi Kouichi{ 31263d4fa43eSKusanagi Kouichi fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); 31273d4fa43eSKusanagi Kouichi return 0; 31283d4fa43eSKusanagi Kouichi} 31293d4fa43eSKusanagi KouichiEOF 31303d4fa43eSKusanagi Kouichiif compile_prog "" "" ; then 31313d4fa43eSKusanagi Kouichi fallocate_punch_hole=yes 31323d4fa43eSKusanagi Kouichifi 31333d4fa43eSKusanagi Kouichi 3134c727f47dSPeter Maydell# check for sync_file_range 3135c727f47dSPeter Maydellsync_file_range=no 3136c727f47dSPeter Maydellcat > $TMPC << EOF 3137c727f47dSPeter Maydell#include <fcntl.h> 3138c727f47dSPeter Maydell 3139c727f47dSPeter Maydellint main(void) 3140c727f47dSPeter Maydell{ 3141c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 3142c727f47dSPeter Maydell return 0; 3143c727f47dSPeter Maydell} 3144c727f47dSPeter MaydellEOF 31458fb03151SPeter Maydellif compile_prog "" "" ; then 3146c727f47dSPeter Maydell sync_file_range=yes 3147c727f47dSPeter Maydellfi 3148c727f47dSPeter Maydell 3149dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 3150dace20dcSPeter Maydellfiemap=no 3151dace20dcSPeter Maydellcat > $TMPC << EOF 3152dace20dcSPeter Maydell#include <sys/ioctl.h> 3153dace20dcSPeter Maydell#include <linux/fs.h> 3154dace20dcSPeter Maydell#include <linux/fiemap.h> 3155dace20dcSPeter Maydell 3156dace20dcSPeter Maydellint main(void) 3157dace20dcSPeter Maydell{ 3158dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 3159dace20dcSPeter Maydell return 0; 3160dace20dcSPeter Maydell} 3161dace20dcSPeter MaydellEOF 31628fb03151SPeter Maydellif compile_prog "" "" ; then 3163dace20dcSPeter Maydell fiemap=yes 3164dace20dcSPeter Maydellfi 3165dace20dcSPeter Maydell 3166d0927938SUlrich Hecht# check for dup3 3167d0927938SUlrich Hechtdup3=no 3168d0927938SUlrich Hechtcat > $TMPC << EOF 3169d0927938SUlrich Hecht#include <unistd.h> 3170d0927938SUlrich Hecht 3171d0927938SUlrich Hechtint main(void) 3172d0927938SUlrich Hecht{ 3173d0927938SUlrich Hecht dup3(0, 0, 0); 3174d0927938SUlrich Hecht return 0; 3175d0927938SUlrich Hecht} 3176d0927938SUlrich HechtEOF 317778f5d726SJan Kiszkaif compile_prog "" "" ; then 3178d0927938SUlrich Hecht dup3=yes 3179d0927938SUlrich Hechtfi 3180d0927938SUlrich Hecht 31814e0c6529SAlex Bligh# check for ppoll support 31824e0c6529SAlex Blighppoll=no 31834e0c6529SAlex Blighcat > $TMPC << EOF 31844e0c6529SAlex Bligh#include <poll.h> 31854e0c6529SAlex Bligh 31864e0c6529SAlex Blighint main(void) 31874e0c6529SAlex Bligh{ 31884e0c6529SAlex Bligh struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; 31894e0c6529SAlex Bligh ppoll(&pfd, 1, 0, 0); 31904e0c6529SAlex Bligh return 0; 31914e0c6529SAlex Bligh} 31924e0c6529SAlex BlighEOF 31934e0c6529SAlex Blighif compile_prog "" "" ; then 31944e0c6529SAlex Bligh ppoll=yes 31954e0c6529SAlex Blighfi 31964e0c6529SAlex Bligh 3197cd758dd0SAlex Bligh# check for prctl(PR_SET_TIMERSLACK , ... ) support 3198cd758dd0SAlex Blighprctl_pr_set_timerslack=no 3199cd758dd0SAlex Blighcat > $TMPC << EOF 3200cd758dd0SAlex Bligh#include <sys/prctl.h> 3201cd758dd0SAlex Bligh 3202cd758dd0SAlex Blighint main(void) 3203cd758dd0SAlex Bligh{ 3204cd758dd0SAlex Bligh prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); 3205cd758dd0SAlex Bligh return 0; 3206cd758dd0SAlex Bligh} 3207cd758dd0SAlex BlighEOF 3208cd758dd0SAlex Blighif compile_prog "" "" ; then 3209cd758dd0SAlex Bligh prctl_pr_set_timerslack=yes 3210cd758dd0SAlex Blighfi 3211cd758dd0SAlex Bligh 32123b6edd16SPeter Maydell# check for epoll support 32133b6edd16SPeter Maydellepoll=no 32143b6edd16SPeter Maydellcat > $TMPC << EOF 32153b6edd16SPeter Maydell#include <sys/epoll.h> 32163b6edd16SPeter Maydell 32173b6edd16SPeter Maydellint main(void) 32183b6edd16SPeter Maydell{ 32193b6edd16SPeter Maydell epoll_create(0); 32203b6edd16SPeter Maydell return 0; 32213b6edd16SPeter Maydell} 32223b6edd16SPeter MaydellEOF 32238fb03151SPeter Maydellif compile_prog "" "" ; then 32243b6edd16SPeter Maydell epoll=yes 32253b6edd16SPeter Maydellfi 32263b6edd16SPeter Maydell 32273b6edd16SPeter Maydell# epoll_create1 and epoll_pwait are later additions 32283b6edd16SPeter Maydell# so we must check separately for their presence 32293b6edd16SPeter Maydellepoll_create1=no 32303b6edd16SPeter Maydellcat > $TMPC << EOF 32313b6edd16SPeter Maydell#include <sys/epoll.h> 32323b6edd16SPeter Maydell 32333b6edd16SPeter Maydellint main(void) 32343b6edd16SPeter Maydell{ 323519e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 323619e83f6bSPeter Maydell * a function being called. This is necessary so that on 323719e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 323819e83f6bSPeter Maydell * the library but not declared in the header file we will 323919e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 324019e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 324119e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 324219e83f6bSPeter Maydell */ 3243c075a723SBlue Swirl return (int)(uintptr_t)&epoll_create1; 32443b6edd16SPeter Maydell} 32453b6edd16SPeter MaydellEOF 32468fb03151SPeter Maydellif compile_prog "" "" ; then 32473b6edd16SPeter Maydell epoll_create1=yes 32483b6edd16SPeter Maydellfi 32493b6edd16SPeter Maydell 32503b6edd16SPeter Maydellepoll_pwait=no 32513b6edd16SPeter Maydellcat > $TMPC << EOF 32523b6edd16SPeter Maydell#include <sys/epoll.h> 32533b6edd16SPeter Maydell 32543b6edd16SPeter Maydellint main(void) 32553b6edd16SPeter Maydell{ 32563b6edd16SPeter Maydell epoll_pwait(0, 0, 0, 0, 0); 32573b6edd16SPeter Maydell return 0; 32583b6edd16SPeter Maydell} 32593b6edd16SPeter MaydellEOF 32608fb03151SPeter Maydellif compile_prog "" "" ; then 32613b6edd16SPeter Maydell epoll_pwait=yes 32623b6edd16SPeter Maydellfi 32633b6edd16SPeter Maydell 3264a8fd1abaSPeter Maydell# check for sendfile support 3265a8fd1abaSPeter Maydellsendfile=no 3266a8fd1abaSPeter Maydellcat > $TMPC << EOF 3267a8fd1abaSPeter Maydell#include <sys/sendfile.h> 3268a8fd1abaSPeter Maydell 3269a8fd1abaSPeter Maydellint main(void) 3270a8fd1abaSPeter Maydell{ 3271a8fd1abaSPeter Maydell return sendfile(0, 0, 0, 0); 3272a8fd1abaSPeter Maydell} 3273a8fd1abaSPeter MaydellEOF 3274a8fd1abaSPeter Maydellif compile_prog "" "" ; then 3275a8fd1abaSPeter Maydell sendfile=yes 3276a8fd1abaSPeter Maydellfi 3277a8fd1abaSPeter Maydell 3278cc8ae6deSpbrook# Check if tools are available to build documentation. 3279a25dba17SJuan Quintelaif test "$docs" != "no" ; then 328001668d98SStefan Weil if has makeinfo && has pod2man; then 3281a25dba17SJuan Quintela docs=yes 328283a3ab8bSJuan Quintela else 3283a25dba17SJuan Quintela if test "$docs" = "yes" ; then 328421684af0SStewart Smith feature_not_found "docs" "Install texinfo and Perl/perl-podlators" 328583a3ab8bSJuan Quintela fi 3286a25dba17SJuan Quintela docs=no 328783a3ab8bSJuan Quintela fi 3288cc8ae6deSpbrookfi 3289cc8ae6deSpbrook 3290f514f41cSStefan Weil# Search for bswap_32 function 32916ae9a1f4SJuan Quintelabyteswap_h=no 32926ae9a1f4SJuan Quintelacat > $TMPC << EOF 32936ae9a1f4SJuan Quintela#include <byteswap.h> 32946ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 32956ae9a1f4SJuan QuintelaEOF 329652166aa0SJuan Quintelaif compile_prog "" "" ; then 32976ae9a1f4SJuan Quintela byteswap_h=yes 32986ae9a1f4SJuan Quintelafi 32996ae9a1f4SJuan Quintela 330075f13596SStefan Weil# Search for bswap32 function 33016ae9a1f4SJuan Quintelabswap_h=no 33026ae9a1f4SJuan Quintelacat > $TMPC << EOF 33036ae9a1f4SJuan Quintela#include <sys/endian.h> 33046ae9a1f4SJuan Quintela#include <sys/types.h> 33056ae9a1f4SJuan Quintela#include <machine/bswap.h> 33066ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 33076ae9a1f4SJuan QuintelaEOF 330852166aa0SJuan Quintelaif compile_prog "" "" ; then 33096ae9a1f4SJuan Quintela bswap_h=yes 33106ae9a1f4SJuan Quintelafi 33116ae9a1f4SJuan Quintela 3312da93a1fdSaliguori########################################## 3313c589b249SRonnie Sahlberg# Do we have libiscsi 3314063c3378SPeter Lieven# We check for iscsi_write16_sync() to make sure we have a 3315063c3378SPeter Lieven# at least version 1.4.0 of libiscsi. 3316c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 3317c589b249SRonnie Sahlberg cat > $TMPC << EOF 3318fa6acb0cSRonnie Sahlberg#include <stdio.h> 3319c589b249SRonnie Sahlberg#include <iscsi/iscsi.h> 3320063c3378SPeter Lievenint main(void) { iscsi_write16_sync(NULL,0,0,NULL,0,0,0,0,0,0,0); return 0; } 3321c589b249SRonnie SahlbergEOF 332265d5d3f9SStefan Weil if $pkg_config --atleast-version=1.7.0 libiscsi; then 33233c33ea96SPaolo Bonzini libiscsi="yes" 3324ca871ec8SStefan Weil libiscsi_cflags=$($pkg_config --cflags libiscsi) 3325ca871ec8SStefan Weil libiscsi_libs=$($pkg_config --libs libiscsi) 33263c33ea96SPaolo Bonzini elif compile_prog "" "-liscsi" ; then 3327c589b249SRonnie Sahlberg libiscsi="yes" 33286ebc91e5SFam Zheng libiscsi_libs="-liscsi" 3329c589b249SRonnie Sahlberg else 3330c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 333121684af0SStewart Smith feature_not_found "libiscsi" "Install libiscsi devel" 3332c589b249SRonnie Sahlberg fi 3333c589b249SRonnie Sahlberg libiscsi="no" 3334c589b249SRonnie Sahlberg fi 3335c589b249SRonnie Sahlbergfi 3336c589b249SRonnie Sahlberg 3337219c2521SStefan Weil# We also need to know the API version because there was an 3338219c2521SStefan Weil# API change from 1.4.0 to 1.5.0. 3339219c2521SStefan Weilif test "$libiscsi" = "yes"; then 3340219c2521SStefan Weil cat >$TMPC <<EOF 3341219c2521SStefan Weil#include <iscsi/iscsi.h> 3342219c2521SStefan Weilint main(void) 3343219c2521SStefan Weil{ 3344219c2521SStefan Weil iscsi_read10_task(0, 0, 0, 0, 0, 0, 0); 3345219c2521SStefan Weil return 0; 3346219c2521SStefan Weil} 3347219c2521SStefan WeilEOF 3348219c2521SStefan Weil if compile_prog "" "-liscsi"; then 3349219c2521SStefan Weil libiscsi_version="1.4.0" 3350219c2521SStefan Weil fi 3351219c2521SStefan Weilfi 3352c589b249SRonnie Sahlberg 3353c589b249SRonnie Sahlberg########################################## 33548bacde8dSNatanael Copa# Do we need libm 33558bacde8dSNatanael Copacat > $TMPC << EOF 33568bacde8dSNatanael Copa#include <math.h> 33578bacde8dSNatanael Copaint main(void) { return isnan(sin(0.0)); } 33588bacde8dSNatanael CopaEOF 33598bacde8dSNatanael Copaif compile_prog "" "" ; then 33608bacde8dSNatanael Copa : 33618bacde8dSNatanael Copaelif compile_prog "" "-lm" ; then 33628bacde8dSNatanael Copa LIBS="-lm $LIBS" 33638bacde8dSNatanael Copa libs_qga="-lm $libs_qga" 33648bacde8dSNatanael Copaelse 336576ad07a4SPeter Maydell error_exit "libm check failed" 33668bacde8dSNatanael Copafi 33678bacde8dSNatanael Copa 33688bacde8dSNatanael Copa########################################## 3369da93a1fdSaliguori# Do we need librt 33708bacde8dSNatanael Copa# uClibc provides 2 versions of clock_gettime(), one with realtime 33718bacde8dSNatanael Copa# support and one without. This means that the clock_gettime() don't 33728bacde8dSNatanael Copa# need -lrt. We still need it for timer_create() so we check for this 33738bacde8dSNatanael Copa# function in addition. 3374da93a1fdSaliguoricat > $TMPC <<EOF 3375da93a1fdSaliguori#include <signal.h> 3376da93a1fdSaliguori#include <time.h> 33778bacde8dSNatanael Copaint main(void) { 33788bacde8dSNatanael Copa timer_create(CLOCK_REALTIME, NULL, NULL); 33798bacde8dSNatanael Copa return clock_gettime(CLOCK_REALTIME, NULL); 33808bacde8dSNatanael Copa} 3381da93a1fdSaliguoriEOF 3382da93a1fdSaliguori 338352166aa0SJuan Quintelaif compile_prog "" "" ; then 338407ffa4bdSJuan Quintela : 33858bacde8dSNatanael Copa# we need pthread for static linking. use previous pthread test result 33868bacde8dSNatanael Copaelif compile_prog "" "-lrt $pthread_lib" ; then 338707ffa4bdSJuan Quintela LIBS="-lrt $LIBS" 33888bacde8dSNatanael Copa libs_qga="-lrt $libs_qga" 3389da93a1fdSaliguorifi 3390da93a1fdSaliguori 339131ff504dSBlue Swirlif test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ 3392179cf400SAndreas Färber "$aix" != "yes" -a "$haiku" != "yes" ; then 33936362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 33946362a53fSJuan Quintelafi 33956362a53fSJuan Quintela 3396de5071c5SBlue Swirl########################################## 3397cd4ec0b4SGerd Hoffmann# spice probe 3398cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 3399cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 3400cd4ec0b4SGerd Hoffmann#include <spice.h> 3401cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 3402cd4ec0b4SGerd HoffmannEOF 3403710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 3404710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 340565d5d3f9SStefan Weil if $pkg_config --atleast-version=0.12.0 spice-server && \ 340665d5d3f9SStefan Weil $pkg_config --atleast-version=0.12.3 spice-protocol && \ 3407cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 3408cd4ec0b4SGerd Hoffmann spice="yes" 3409cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 3410cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 34112e0e3c39SAlon Levy spice_protocol_version=$($pkg_config --modversion spice-protocol) 34122e0e3c39SAlon Levy spice_server_version=$($pkg_config --modversion spice-server) 3413cd4ec0b4SGerd Hoffmann else 3414cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 341521684af0SStewart Smith feature_not_found "spice" "Install spice-server and spice-protocol devel" 3416cd4ec0b4SGerd Hoffmann fi 3417cd4ec0b4SGerd Hoffmann spice="no" 3418cd4ec0b4SGerd Hoffmann fi 3419cd4ec0b4SGerd Hoffmannfi 3420cd4ec0b4SGerd Hoffmann 3421111a38b0SRobert Relyea# check for libcacard for smartcard support 3422111a38b0SRobert Relyeasmartcard_cflags="" 3423111a38b0SRobert Relyea# TODO - what's the minimal nss version we support? 3424111a38b0SRobert Relyeaif test "$smartcard_nss" != "no"; then 34255f01e06fSSergei Trofimovich cat > $TMPC << EOF 34265f01e06fSSergei Trofimovich#include <pk11pub.h> 34275f01e06fSSergei Trofimovichint main(void) { PK11_FreeSlot(0); return 0; } 34285f01e06fSSergei TrofimovichEOF 34290b22ef0fSPeter Maydell smartcard_includes="-I\$(SRC_PATH)/libcacard" 34308c741c22SAlon Levy libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" 34318c741c22SAlon Levy libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" 34326ca026cbSPeter Maydell test_cflags="$libcacard_cflags" 34336ca026cbSPeter Maydell # The header files in nss < 3.13.3 have a bug which causes them to 34346ca026cbSPeter Maydell # emit a warning. If we're going to compile QEMU with -Werror, then 34356ca026cbSPeter Maydell # test that the headers don't have this bug. Otherwise we would pass 34366ca026cbSPeter Maydell # the configure test but fail to compile QEMU later. 34376ca026cbSPeter Maydell if test "$werror" = "yes"; then 34386ca026cbSPeter Maydell test_cflags="-Werror $test_cflags" 34396ca026cbSPeter Maydell fi 3440b6fc675bSPaolo Bonzini if test -n "$libtool" && 344165d5d3f9SStefan Weil $pkg_config --atleast-version=3.12.8 nss && \ 34426ca026cbSPeter Maydell compile_prog "$test_cflags" "$libcacard_libs"; then 34435f01e06fSSergei Trofimovich smartcard_nss="yes" 34440b22ef0fSPeter Maydell QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" 34450b22ef0fSPeter Maydell QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" 3446ad4cf3f6SPaul Brook libs_softmmu="$libcacard_libs $libs_softmmu" 3447111a38b0SRobert Relyea else 3448111a38b0SRobert Relyea if test "$smartcard_nss" = "yes"; then 3449111a38b0SRobert Relyea feature_not_found "nss" 3450111a38b0SRobert Relyea fi 3451111a38b0SRobert Relyea smartcard_nss="no" 3452111a38b0SRobert Relyea fi 3453111a38b0SRobert Relyeafi 3454111a38b0SRobert Relyea 34552b2325ffSGerd Hoffmann# check for libusb 34562b2325ffSGerd Hoffmannif test "$libusb" != "no" ; then 345765d5d3f9SStefan Weil if $pkg_config --atleast-version=1.0.13 libusb-1.0; then 34582b2325ffSGerd Hoffmann libusb="yes" 3459ca871ec8SStefan Weil libusb_cflags=$($pkg_config --cflags libusb-1.0) 3460ca871ec8SStefan Weil libusb_libs=$($pkg_config --libs libusb-1.0) 34612b2325ffSGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" 34622b2325ffSGerd Hoffmann libs_softmmu="$libs_softmmu $libusb_libs" 34632b2325ffSGerd Hoffmann else 34642b2325ffSGerd Hoffmann if test "$libusb" = "yes"; then 346521684af0SStewart Smith feature_not_found "libusb" "Install libusb devel" 34662b2325ffSGerd Hoffmann fi 34672b2325ffSGerd Hoffmann libusb="no" 34682b2325ffSGerd Hoffmann fi 34692b2325ffSGerd Hoffmannfi 34702b2325ffSGerd Hoffmann 347169354a83SHans de Goede# check for usbredirparser for usb network redirection support 347269354a83SHans de Goedeif test "$usb_redir" != "no" ; then 347365d5d3f9SStefan Weil if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then 347469354a83SHans de Goede usb_redir="yes" 3475ca871ec8SStefan Weil usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) 3476ca871ec8SStefan Weil usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) 347769354a83SHans de Goede QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" 347856ab2ad1SAurelien Jarno libs_softmmu="$libs_softmmu $usb_redir_libs" 347969354a83SHans de Goede else 348069354a83SHans de Goede if test "$usb_redir" = "yes"; then 348121684af0SStewart Smith feature_not_found "usb-redir" "Install usbredir devel" 348269354a83SHans de Goede fi 348369354a83SHans de Goede usb_redir="no" 348469354a83SHans de Goede fi 348569354a83SHans de Goedefi 348669354a83SHans de Goede 3487cd4ec0b4SGerd Hoffmann########################################## 3488d9840e25STomoki Sekiyama# check if we have VSS SDK headers for win 3489d9840e25STomoki Sekiyama 3490d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then 3491d9840e25STomoki Sekiyama case "$vss_win32_sdk" in 3492d9840e25STomoki Sekiyama "") vss_win32_include="-I$source_path" ;; 3493d9840e25STomoki Sekiyama *\ *) # The SDK is installed in "Program Files" by default, but we cannot 3494d9840e25STomoki Sekiyama # handle path with spaces. So we symlink the headers into ".sdk/vss". 3495d9840e25STomoki Sekiyama vss_win32_include="-I$source_path/.sdk/vss" 3496d9840e25STomoki Sekiyama symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" 3497d9840e25STomoki Sekiyama ;; 3498d9840e25STomoki Sekiyama *) vss_win32_include="-I$vss_win32_sdk" 3499d9840e25STomoki Sekiyama esac 3500d9840e25STomoki Sekiyama cat > $TMPC << EOF 3501d9840e25STomoki Sekiyama#define __MIDL_user_allocate_free_DEFINED__ 3502d9840e25STomoki Sekiyama#include <inc/win2003/vss.h> 3503d9840e25STomoki Sekiyamaint main(void) { return VSS_CTX_BACKUP; } 3504d9840e25STomoki SekiyamaEOF 3505d9840e25STomoki Sekiyama if compile_prog "$vss_win32_include" "" ; then 3506d9840e25STomoki Sekiyama guest_agent_with_vss="yes" 3507d9840e25STomoki Sekiyama QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" 3508d9840e25STomoki Sekiyama libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" 3509d9840e25STomoki Sekiyama else 3510d9840e25STomoki Sekiyama if test "$vss_win32_sdk" != "" ; then 3511d9840e25STomoki Sekiyama echo "ERROR: Please download and install Microsoft VSS SDK:" 3512d9840e25STomoki Sekiyama echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" 3513d9840e25STomoki Sekiyama echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" 3514d9840e25STomoki Sekiyama echo "ERROR: scripts/extract-vsssdk-headers setup.exe" 3515d9840e25STomoki Sekiyama echo "ERROR: The headers are extracted in the directory \`inc'." 3516d9840e25STomoki Sekiyama feature_not_found "VSS support" 3517d9840e25STomoki Sekiyama fi 3518d9840e25STomoki Sekiyama guest_agent_with_vss="no" 3519d9840e25STomoki Sekiyama fi 3520d9840e25STomoki Sekiyamafi 3521d9840e25STomoki Sekiyama 3522d9840e25STomoki Sekiyama########################################## 3523d9840e25STomoki Sekiyama# lookup Windows platform SDK (if not specified) 3524d9840e25STomoki Sekiyama# The SDK is needed only to build .tlb (type library) file of guest agent 3525d9840e25STomoki Sekiyama# VSS provider from the source. It is usually unnecessary because the 3526d9840e25STomoki Sekiyama# pre-compiled .tlb file is included. 3527d9840e25STomoki Sekiyama 3528d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then 3529d9840e25STomoki Sekiyama if test -z "$win_sdk"; then 3530d9840e25STomoki Sekiyama programfiles="$PROGRAMFILES" 3531d9840e25STomoki Sekiyama test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" 3532d9840e25STomoki Sekiyama if test -n "$programfiles"; then 3533d9840e25STomoki Sekiyama win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null 3534d9840e25STomoki Sekiyama else 3535d9840e25STomoki Sekiyama feature_not_found "Windows SDK" 3536d9840e25STomoki Sekiyama fi 3537d9840e25STomoki Sekiyama elif test "$win_sdk" = "no"; then 3538d9840e25STomoki Sekiyama win_sdk="" 3539d9840e25STomoki Sekiyama fi 3540d9840e25STomoki Sekiyamafi 3541d9840e25STomoki Sekiyama 3542d9840e25STomoki Sekiyama########################################## 3543cd4ec0b4SGerd Hoffmann 3544747bbdf7SBlue Swirl########################################## 35455f6b9e8fSBlue Swirl# check if we have fdatasync 35465f6b9e8fSBlue Swirl 35475f6b9e8fSBlue Swirlfdatasync=no 35485f6b9e8fSBlue Swirlcat > $TMPC << EOF 35495f6b9e8fSBlue Swirl#include <unistd.h> 3550d1722a27SAlexandre Raymondint main(void) { 3551d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 3552d1722a27SAlexandre Raymondreturn fdatasync(0); 3553d1722a27SAlexandre Raymond#else 3554e172fe11SStefan Weil#error Not supported 3555d1722a27SAlexandre Raymond#endif 3556d1722a27SAlexandre Raymond} 35575f6b9e8fSBlue SwirlEOF 35585f6b9e8fSBlue Swirlif compile_prog "" "" ; then 35595f6b9e8fSBlue Swirl fdatasync=yes 35605f6b9e8fSBlue Swirlfi 35615f6b9e8fSBlue Swirl 356294a420b1SStefan Hajnoczi########################################## 3563e78815a5SAndreas Färber# check if we have madvise 3564e78815a5SAndreas Färber 3565e78815a5SAndreas Färbermadvise=no 3566e78815a5SAndreas Färbercat > $TMPC << EOF 3567e78815a5SAndreas Färber#include <sys/types.h> 3568e78815a5SAndreas Färber#include <sys/mman.h> 3569832ce9c2SScott Wood#include <stddef.h> 3570e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 3571e78815a5SAndreas FärberEOF 3572e78815a5SAndreas Färberif compile_prog "" "" ; then 3573e78815a5SAndreas Färber madvise=yes 3574e78815a5SAndreas Färberfi 3575e78815a5SAndreas Färber 3576e78815a5SAndreas Färber########################################## 3577e78815a5SAndreas Färber# check if we have posix_madvise 3578e78815a5SAndreas Färber 3579e78815a5SAndreas Färberposix_madvise=no 3580e78815a5SAndreas Färbercat > $TMPC << EOF 3581e78815a5SAndreas Färber#include <sys/mman.h> 3582832ce9c2SScott Wood#include <stddef.h> 3583e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 3584e78815a5SAndreas FärberEOF 3585e78815a5SAndreas Färberif compile_prog "" "" ; then 3586e78815a5SAndreas Färber posix_madvise=yes 3587e78815a5SAndreas Färberfi 3588e78815a5SAndreas Färber 3589e78815a5SAndreas Färber########################################## 35901e9737daSRichard Henderson# check if we have usable SIGEV_THREAD_ID 35911e9737daSRichard Henderson 35921e9737daSRichard Hendersonsigev_thread_id=no 35931e9737daSRichard Hendersoncat > $TMPC << EOF 35941e9737daSRichard Henderson#include <signal.h> 35951e9737daSRichard Hendersonint main(void) { 35961e9737daSRichard Henderson struct sigevent ev; 35971e9737daSRichard Henderson ev.sigev_notify = SIGEV_THREAD_ID; 35981e9737daSRichard Henderson ev._sigev_un._tid = 0; 35991e9737daSRichard Henderson asm volatile("" : : "g"(&ev)); 36001e9737daSRichard Henderson return 0; 36011e9737daSRichard Henderson} 36021e9737daSRichard HendersonEOF 36031e9737daSRichard Hendersonif compile_prog "" "" ; then 36041e9737daSRichard Henderson sigev_thread_id=yes 36051e9737daSRichard Hendersonfi 36061e9737daSRichard Henderson 36071e9737daSRichard Henderson########################################## 360894a420b1SStefan Hajnoczi# check if trace backend exists 360994a420b1SStefan Hajnoczi 3610650ab98dSLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null 361194a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 361276ad07a4SPeter Maydell error_exit "invalid trace backend" \ 361376ad07a4SPeter Maydell "Please choose a supported trace backend." 361494a420b1SStefan Hajnoczifi 361594a420b1SStefan Hajnoczi 36167e24e92aSStefan Hajnoczi########################################## 36177e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 36187e24e92aSStefan Hajnocziif test "$trace_backend" = "ust"; then 36197e24e92aSStefan Hajnoczi cat > $TMPC << EOF 3620bf15f63cSMohamad Gebai#include <lttng/tracepoint.h> 36217e24e92aSStefan Hajnocziint main(void) { return 0; } 36227e24e92aSStefan HajnocziEOF 36237e24e92aSStefan Hajnoczi if compile_prog "" "" ; then 3624bf15f63cSMohamad Gebai if $pkg_config lttng-ust --exists; then 3625bf15f63cSMohamad Gebai lttng_ust_libs=`$pkg_config --libs lttng-ust` 36267e24e92aSStefan Hajnoczi else 3627bf15f63cSMohamad Gebai lttng_ust_libs="-llttng-ust" 3628bf15f63cSMohamad Gebai fi 3629bf15f63cSMohamad Gebai if $pkg_config liburcu-bp --exists; then 3630bf15f63cSMohamad Gebai urcu_bp_libs=`$pkg_config --libs liburcu-bp` 3631bf15f63cSMohamad Gebai else 3632bf15f63cSMohamad Gebai urcu_bp_libs="-lurcu-bp" 3633bf15f63cSMohamad Gebai fi 3634bf15f63cSMohamad Gebai 3635bf15f63cSMohamad Gebai LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" 3636bf15f63cSMohamad Gebai libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga" 3637bf15f63cSMohamad Gebai else 3638bf15f63cSMohamad Gebai error_exit "Trace backend 'ust' missing lttng-ust header files" 36397e24e92aSStefan Hajnoczi fi 36407e24e92aSStefan Hajnoczifi 3641b3d08c02SDaniel P. Berrange 3642b3d08c02SDaniel P. Berrange########################################## 3643b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 3644b3d08c02SDaniel P. Berrangeif test "$trace_backend" = "dtrace"; then 3645b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 364676ad07a4SPeter Maydell error_exit "dtrace command is not found in PATH $PATH" 3647b3d08c02SDaniel P. Berrange fi 3648c276b17dSDaniel P. Berrange trace_backend_stap="no" 3649c276b17dSDaniel P. Berrange if has 'stap' ; then 3650c276b17dSDaniel P. Berrange trace_backend_stap="yes" 3651c276b17dSDaniel P. Berrange fi 3652b3d08c02SDaniel P. Berrangefi 3653b3d08c02SDaniel P. Berrange 36547e24e92aSStefan Hajnoczi########################################## 3655519175a2SAlex Barcelo# check and set a backend for coroutine 3656d0e2fce5SAneesh Kumar K.V 36577c2acc70SPeter Maydell# We prefer ucontext, but it's not always possible. The fallback 36587c2acc70SPeter Maydell# is sigcontext. gthread is not selectable except explicitly, because 36597c2acc70SPeter Maydell# it is not functional enough to run QEMU proper. (It is occasionally 36607c2acc70SPeter Maydell# useful for debugging purposes.) On Windows the only valid backend 36617c2acc70SPeter Maydell# is the Windows-specific one. 36627c2acc70SPeter Maydell 36637c2acc70SPeter Maydellucontext_works=no 3664d0e2fce5SAneesh Kumar K.Vif test "$darwin" != "yes"; then 3665d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 3666d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 3667cdf84806SPeter Maydell#ifdef __stub_makecontext 3668cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 3669cdf84806SPeter Maydell#endif 367075cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 3671d0e2fce5SAneesh Kumar K.VEOF 3672d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 36737c2acc70SPeter Maydell ucontext_works=yes 3674d0e2fce5SAneesh Kumar K.V fi 3675519175a2SAlex Barcelofi 36767c2acc70SPeter Maydell 36777c2acc70SPeter Maydellif test "$coroutine" = ""; then 36787c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 36797c2acc70SPeter Maydell coroutine=win32 36807c2acc70SPeter Maydell elif test "$ucontext_works" = "yes"; then 36817c2acc70SPeter Maydell coroutine=ucontext 3682519175a2SAlex Barcelo else 36837c2acc70SPeter Maydell coroutine=sigaltstack 36847c2acc70SPeter Maydell fi 36857c2acc70SPeter Maydellelse 36867c2acc70SPeter Maydell case $coroutine in 36877c2acc70SPeter Maydell windows) 36887c2acc70SPeter Maydell if test "$mingw32" != "yes"; then 36897c2acc70SPeter Maydell error_exit "'windows' coroutine backend only valid for Windows" 36907c2acc70SPeter Maydell fi 36917c2acc70SPeter Maydell # Unfortunately the user visible backend name doesn't match the 36927c2acc70SPeter Maydell # coroutine-*.c filename for this case, so we have to adjust it here. 36937c2acc70SPeter Maydell coroutine=win32 36947c2acc70SPeter Maydell ;; 36957c2acc70SPeter Maydell ucontext) 36967c2acc70SPeter Maydell if test "$ucontext_works" != "yes"; then 36977c2acc70SPeter Maydell feature_not_found "ucontext" 36987c2acc70SPeter Maydell fi 36997c2acc70SPeter Maydell ;; 37007c2acc70SPeter Maydell gthread|sigaltstack) 37017c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 37027c2acc70SPeter Maydell error_exit "only the 'windows' coroutine backend is valid for Windows" 37037c2acc70SPeter Maydell fi 37047c2acc70SPeter Maydell ;; 37057c2acc70SPeter Maydell *) 370676ad07a4SPeter Maydell error_exit "unknown coroutine backend $coroutine" 37077c2acc70SPeter Maydell ;; 37087c2acc70SPeter Maydell esac 3709d0e2fce5SAneesh Kumar K.Vfi 3710d0e2fce5SAneesh Kumar K.V 371170c60c08SStefan Hajnocziif test "$coroutine_pool" = ""; then 371270c60c08SStefan Hajnoczi if test "$coroutine" = "gthread"; then 371370c60c08SStefan Hajnoczi coroutine_pool=no 371470c60c08SStefan Hajnoczi else 371570c60c08SStefan Hajnoczi coroutine_pool=yes 371670c60c08SStefan Hajnoczi fi 371770c60c08SStefan Hajnoczifi 371870c60c08SStefan Hajnocziif test "$coroutine" = "gthread" -a "$coroutine_pool" = "yes"; then 371970c60c08SStefan Hajnoczi error_exit "'gthread' coroutine backend does not support pool (use --disable-coroutine-pool)" 372070c60c08SStefan Hajnoczifi 372170c60c08SStefan Hajnoczi 3722d0e2fce5SAneesh Kumar K.V########################################## 3723d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 3724d2042378SAneesh Kumar K.V 37254e1797f9SStefan Weilopen_by_handle_at=no 3726d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 3727d2042378SAneesh Kumar K.V#include <fcntl.h> 3728acc55ba8SStefan Weil#if !defined(AT_EMPTY_PATH) 3729acc55ba8SStefan Weil# error missing definition 3730acc55ba8SStefan Weil#else 373175cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 3732acc55ba8SStefan Weil#endif 3733d2042378SAneesh Kumar K.VEOF 3734d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 3735d2042378SAneesh Kumar K.V open_by_handle_at=yes 3736d2042378SAneesh Kumar K.Vfi 3737d2042378SAneesh Kumar K.V 3738e06a765eSHarsh Prateek Bora######################################## 3739e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 3740e06a765eSHarsh Prateek Bora 3741e06a765eSHarsh Prateek Boralinux_magic_h=no 3742e06a765eSHarsh Prateek Boracat > $TMPC << EOF 3743e06a765eSHarsh Prateek Bora#include <linux/magic.h> 3744e06a765eSHarsh Prateek Boraint main(void) { 374575cafad7SStefan Weil return 0; 3746e06a765eSHarsh Prateek Bora} 3747e06a765eSHarsh Prateek BoraEOF 3748e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 3749e06a765eSHarsh Prateek Bora linux_magic_h=yes 3750e06a765eSHarsh Prateek Borafi 3751e06a765eSHarsh Prateek Bora 37528ab1bf12SLuiz Capitulino######################################## 3753c95e3080SKevin Wolf# check whether we can disable warning option with a pragma (this is needed 3754c95e3080SKevin Wolf# to silence warnings in the headers of some versions of external libraries). 3755c95e3080SKevin Wolf# This test has to be compiled with -Werror as otherwise an unknown pragma is 3756c95e3080SKevin Wolf# only a warning. 3757c95e3080SKevin Wolf# 3758c95e3080SKevin Wolf# If we can't selectively disable warning in the code, disable -Werror so that 3759c95e3080SKevin Wolf# the build doesn't fail anyway. 3760c95e3080SKevin Wolf 376106d71fa1SPeter Maydellpragma_disable_unused_but_set=no 376206d71fa1SPeter Maydellcat > $TMPC << EOF 3763e6f53fd5SMarkus Armbruster#pragma GCC diagnostic push 376406d71fa1SPeter Maydell#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 3765c95e3080SKevin Wolf#pragma GCC diagnostic ignored "-Wstrict-prototypes" 3766e6f53fd5SMarkus Armbruster#pragma GCC diagnostic pop 3767c95e3080SKevin Wolf 376806d71fa1SPeter Maydellint main(void) { 376906d71fa1SPeter Maydell return 0; 377006d71fa1SPeter Maydell} 377106d71fa1SPeter MaydellEOF 377206d71fa1SPeter Maydellif compile_prog "-Werror" "" ; then 3773cc6e3ca9SGerd Hoffmann pragma_diagnostic_available=yes 3774c95e3080SKevin Wolfelse 3775c95e3080SKevin Wolf werror=no 377606d71fa1SPeter Maydellfi 377706d71fa1SPeter Maydell 377806d71fa1SPeter Maydell######################################## 377962fe8331SChristian Borntraeger# check if we have valgrind/valgrind.h and valgrind/memcheck.h 37803f4349dcSKevin Wolf 37813f4349dcSKevin Wolfvalgrind_h=no 37823f4349dcSKevin Wolfcat > $TMPC << EOF 37833f4349dcSKevin Wolf#include <valgrind/valgrind.h> 378462fe8331SChristian Borntraeger#include <valgrind/memcheck.h> 37853f4349dcSKevin Wolfint main(void) { 37863f4349dcSKevin Wolf return 0; 37873f4349dcSKevin Wolf} 37883f4349dcSKevin WolfEOF 37893f4349dcSKevin Wolfif compile_prog "" "" ; then 37903f4349dcSKevin Wolf valgrind_h=yes 37913f4349dcSKevin Wolffi 37923f4349dcSKevin Wolf 37933f4349dcSKevin Wolf######################################## 37948ab1bf12SLuiz Capitulino# check if environ is declared 37958ab1bf12SLuiz Capitulino 37968ab1bf12SLuiz Capitulinohas_environ=no 37978ab1bf12SLuiz Capitulinocat > $TMPC << EOF 37988ab1bf12SLuiz Capitulino#include <unistd.h> 37998ab1bf12SLuiz Capitulinoint main(void) { 3800c075a723SBlue Swirl environ = 0; 38018ab1bf12SLuiz Capitulino return 0; 38028ab1bf12SLuiz Capitulino} 38038ab1bf12SLuiz CapitulinoEOF 38048ab1bf12SLuiz Capitulinoif compile_prog "" "" ; then 38058ab1bf12SLuiz Capitulino has_environ=yes 38068ab1bf12SLuiz Capitulinofi 38078ab1bf12SLuiz Capitulino 380876a347e1SRichard Henderson######################################## 380976a347e1SRichard Henderson# check if cpuid.h is usable. 381076a347e1SRichard Henderson 381176a347e1SRichard Hendersoncpuid_h=no 381276a347e1SRichard Hendersoncat > $TMPC << EOF 381376a347e1SRichard Henderson#include <cpuid.h> 381476a347e1SRichard Hendersonint main(void) { 3815774d566cSPeter Maydell unsigned a, b, c, d; 3816774d566cSPeter Maydell int max = __get_cpuid_max(0, 0); 3817774d566cSPeter Maydell 3818774d566cSPeter Maydell if (max >= 1) { 3819774d566cSPeter Maydell __cpuid(1, a, b, c, d); 3820774d566cSPeter Maydell } 3821774d566cSPeter Maydell 3822774d566cSPeter Maydell if (max >= 7) { 3823774d566cSPeter Maydell __cpuid_count(7, 0, a, b, c, d); 3824774d566cSPeter Maydell } 3825774d566cSPeter Maydell 382676a347e1SRichard Henderson return 0; 382776a347e1SRichard Henderson} 382876a347e1SRichard HendersonEOF 382976a347e1SRichard Hendersonif compile_prog "" "" ; then 383076a347e1SRichard Henderson cpuid_h=yes 383176a347e1SRichard Hendersonfi 383276a347e1SRichard Henderson 3833f540166bSRichard Henderson######################################## 3834f540166bSRichard Henderson# check if __[u]int128_t is usable. 3835f540166bSRichard Henderson 3836f540166bSRichard Hendersonint128=no 3837f540166bSRichard Hendersoncat > $TMPC << EOF 3838f540166bSRichard Henderson__int128_t a; 3839f540166bSRichard Henderson__uint128_t b; 3840f540166bSRichard Hendersonint main (void) { 3841f540166bSRichard Henderson a = a + b; 3842f540166bSRichard Henderson b = a * b; 3843464e3671SPeter Maydell a = a * a; 3844f540166bSRichard Henderson return 0; 3845f540166bSRichard Henderson} 3846f540166bSRichard HendersonEOF 3847f540166bSRichard Hendersonif compile_prog "" "" ; then 3848f540166bSRichard Henderson int128=yes 3849f540166bSRichard Hendersonfi 385076a347e1SRichard Henderson 38511e6e9acaSRichard Henderson######################################## 38521e6e9acaSRichard Henderson# check if getauxval is available. 38531e6e9acaSRichard Henderson 38541e6e9acaSRichard Hendersongetauxval=no 38551e6e9acaSRichard Hendersoncat > $TMPC << EOF 38561e6e9acaSRichard Henderson#include <sys/auxv.h> 38571e6e9acaSRichard Hendersonint main(void) { 38581e6e9acaSRichard Henderson return getauxval(AT_HWCAP) == 0; 38591e6e9acaSRichard Henderson} 38601e6e9acaSRichard HendersonEOF 38611e6e9acaSRichard Hendersonif compile_prog "" "" ; then 38621e6e9acaSRichard Henderson getauxval=yes 38631e6e9acaSRichard Hendersonfi 38641e6e9acaSRichard Henderson 3865d2042378SAneesh Kumar K.V########################################## 3866e86ecd4bSJuan Quintela# End of CC checks 3867e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 3868e86ecd4bSJuan Quintela 38691d728c39SBlue Swirlif test "$gcov" = "yes" ; then 38701d728c39SBlue Swirl CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" 38711d728c39SBlue Swirl LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" 38721d728c39SBlue Swirlelif test "$debug" = "no" ; then 3873e600cdf3SMichal Privoznik CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" 3874e86ecd4bSJuan Quintelafi 3875a316e378SJuan Quintela 38766542aa9cSPeter Lieven########################################## 38776542aa9cSPeter Lieven# Do we have libnfs 38786542aa9cSPeter Lievenif test "$libnfs" != "no" ; then 38796542aa9cSPeter Lieven if $pkg_config --atleast-version=1.9.2 libnfs; then 38806542aa9cSPeter Lieven libnfs="yes" 38816542aa9cSPeter Lieven libnfs_libs=$($pkg_config --libs libnfs) 38826542aa9cSPeter Lieven LIBS="$LIBS $libnfs_libs" 38836542aa9cSPeter Lieven else 38846542aa9cSPeter Lieven if test "$libnfs" = "yes" ; then 38856542aa9cSPeter Lieven feature_not_found "libnfs" 38866542aa9cSPeter Lieven fi 38876542aa9cSPeter Lieven libnfs="no" 38886542aa9cSPeter Lieven fi 38896542aa9cSPeter Lievenfi 38901d728c39SBlue Swirl 389120ff6c80SAnthony Liguori# Disable zero malloc errors for official releases unless explicitly told to 389220ff6c80SAnthony Liguori# enable/disable 389320ff6c80SAnthony Liguoriif test -z "$zero_malloc" ; then 389420ff6c80SAnthony Liguori if test "$z_version" = "50" ; then 389520ff6c80SAnthony Liguori zero_malloc="no" 389620ff6c80SAnthony Liguori else 389720ff6c80SAnthony Liguori zero_malloc="yes" 389820ff6c80SAnthony Liguori fi 389920ff6c80SAnthony Liguorifi 390020ff6c80SAnthony Liguori 39016ca026cbSPeter Maydell# Now we've finished running tests it's OK to add -Werror to the compiler flags 39026ca026cbSPeter Maydellif test "$werror" = "yes"; then 39036ca026cbSPeter Maydell QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 39046ca026cbSPeter Maydellfi 39056ca026cbSPeter Maydell 3906e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 3907e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 39081156c669SJuan Quintela LDFLAGS="-Wl,--warn-common $LDFLAGS" 3909e86ecd4bSJuan Quintela fi 3910e86ecd4bSJuan Quintelafi 3911e86ecd4bSJuan Quintela 391294dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 391394dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 391494dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 391594dd53c5SGerd Hoffmannelse 391694dd53c5SGerd Hoffmann POD2MAN="pod2man" 391794dd53c5SGerd Hoffmannfi 391894dd53c5SGerd Hoffmann 3919952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 3920952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 3921952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 3922952afb71SBlue Swirl if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then 3923952afb71SBlue Swirl LDFLAGS="-Wl,$flag $LDFLAGS" 3924952afb71SBlue Swirl fi 3925952afb71SBlue Swirl done 3926952afb71SBlue Swirlfi 3927952afb71SBlue Swirl 392810ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 3929e26110cfSFam Zhengqemu_moddir=$libdir$confsuffix 3930528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 3931834574eaSAnthony Liguoriqemu_localedir="$datadir/locale" 39325a67135aSbellard 39334b1c11fdSDaniel P. Berrangetools="" 39344b1c11fdSDaniel P. Berrangeif test "$want_tools" = "yes" ; then 3935ca35f780SPaolo Bonzini tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" 39364b1c11fdSDaniel P. Berrange if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 39374b1c11fdSDaniel P. Berrange tools="qemu-nbd\$(EXESUF) $tools" 39384b1c11fdSDaniel P. Berrange fi 39394b1c11fdSDaniel P. Berrangefi 39404b1c11fdSDaniel P. Berrangeif test "$softmmu" = yes ; then 3941983eef5aSMeador Inge if test "$virtfs" != no ; then 3942be5ea8edSAnthony Liguori if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then 3943983eef5aSMeador Inge virtfs=yes 394417bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 3945983eef5aSMeador Inge else 3946983eef5aSMeador Inge if test "$virtfs" = yes; then 394776ad07a4SPeter Maydell error_exit "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" 3948983eef5aSMeador Inge fi 394917500370SAndreas Färber virtfs=no 3950983eef5aSMeador Inge fi 395117bff52bSM. Mohan Kumar fi 3952d138cee9SMichael Rothfi 3953e8ef31a3SMichael Tokarevif [ "$guest_agent" != "no" ]; then 3954b39297aeSTomoki Sekiyama if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then 3955e8ef31a3SMichael Tokarev tools="qemu-ga\$(EXESUF) $tools" 3956b39297aeSTomoki Sekiyama if [ "$mingw32" = "yes" -a "$guest_agent_with_vss" = "yes" ]; then 3957b39297aeSTomoki Sekiyama tools="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb $tools" 3958b39297aeSTomoki Sekiyama fi 3959e8ef31a3SMichael Tokarev guest_agent=yes 3960e8ef31a3SMichael Tokarev elif [ "$guest_agent" != yes ]; then 3961e8ef31a3SMichael Tokarev guest_agent=no 3962e8ef31a3SMichael Tokarev else 3963e8ef31a3SMichael Tokarev error_exit "Guest agent is not supported on this platform" 3964ca35f780SPaolo Bonzini fi 39654b1c11fdSDaniel P. Berrangefi 3966ca35f780SPaolo Bonzini 3967ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 3968ca35f780SPaolo Bonziniroms= 3969ca35f780SPaolo Bonziniif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ 3970ca35f780SPaolo Bonzini "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ 3971ca35f780SPaolo Bonzini "$softmmu" = yes ; then 3972ca35f780SPaolo Bonzini roms="optionrom" 3973ca35f780SPaolo Bonzinifi 3974d0384d1dSAndreas Färberif test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then 397539ac8455SDavid Gibson roms="$roms spapr-rtas" 397639ac8455SDavid Gibsonfi 3977ca35f780SPaolo Bonzini 39789933c305SChristian Borntraegerif test "$cpu" = "s390x" ; then 39799933c305SChristian Borntraeger roms="$roms s390-ccw" 39809933c305SChristian Borntraegerfi 39819933c305SChristian Borntraeger 3982964c6fa1SRichard Henderson# Probe for the need for relocating the user-only binary. 3983964c6fa1SRichard Hendersonif test "$pie" = "no" ; then 3984964c6fa1SRichard Henderson textseg_addr= 3985964c6fa1SRichard Henderson case "$cpu" in 3986c72b26ecSRichard Henderson arm | hppa | i386 | m68k | ppc | ppc64 | s390* | sparc | sparc64 | x86_64 | x32) 3987964c6fa1SRichard Henderson textseg_addr=0x60000000 3988964c6fa1SRichard Henderson ;; 3989964c6fa1SRichard Henderson mips) 3990964c6fa1SRichard Henderson textseg_addr=0x400000 3991964c6fa1SRichard Henderson ;; 3992964c6fa1SRichard Henderson esac 3993964c6fa1SRichard Henderson if [ -n "$textseg_addr" ]; then 3994964c6fa1SRichard Henderson cat > $TMPC <<EOF 3995964c6fa1SRichard Henderson int main(void) { return 0; } 3996964c6fa1SRichard HendersonEOF 3997964c6fa1SRichard Henderson textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" 3998964c6fa1SRichard Henderson if ! compile_prog "" "$textseg_ldflags"; then 3999964c6fa1SRichard Henderson # In case ld does not support -Ttext-segment, edit the default linker 4000964c6fa1SRichard Henderson # script via sed to set the .text start addr. This is needed on FreeBSD 4001964c6fa1SRichard Henderson # at least. 4002964c6fa1SRichard Henderson $ld --verbose | sed \ 4003964c6fa1SRichard Henderson -e '1,/==================================================/d' \ 4004964c6fa1SRichard Henderson -e '/==================================================/,$d' \ 4005964c6fa1SRichard Henderson -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ 4006964c6fa1SRichard Henderson -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld 4007964c6fa1SRichard Henderson textseg_ldflags="-Wl,-T../config-host.ld" 4008964c6fa1SRichard Henderson fi 4009964c6fa1SRichard Henderson fi 4010964c6fa1SRichard Hendersonfi 4011964c6fa1SRichard Henderson 40125ca9388aSGerd Hoffmann# add pixman flags after all config tests are done 4013a540f158SPeter CrosthwaiteQEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags" 40145ca9388aSGerd Hoffmannlibs_softmmu="$libs_softmmu $pixman_libs" 40155ca9388aSGerd Hoffmann 40167d13299dSbellardecho "Install prefix $prefix" 4017c00b2808SEduardo Habkostecho "BIOS directory `eval echo $qemu_datadir`" 4018f2b9e1e3SPaolo Bonziniecho "binary directory `eval echo $bindir`" 40193aa5d2beSAlon Levyecho "library directory `eval echo $libdir`" 4020e26110cfSFam Zhengecho "module directory `eval echo $qemu_moddir`" 40218bf188aaSMichael Tokarevecho "libexec directory `eval echo $libexecdir`" 40220f94d6daSAlon Levyecho "include directory `eval echo $includedir`" 40231c0fd160SAurelien Jarnoecho "config directory `eval echo $sysconfdir`" 402411d9f695Sbellardif test "$mingw32" = "no" ; then 40255a699bbbSLaszlo Ersekecho "local state directory `eval echo $local_statedir`" 4026f2b9e1e3SPaolo Bonziniecho "Manual directory `eval echo $mandir`" 402743ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 40285a699bbbSLaszlo Ersekelse 40295a699bbbSLaszlo Ersekecho "local state directory queried at runtime" 4030d9840e25STomoki Sekiyamaecho "Windows SDK $win_sdk" 403111d9f695Sbellardfi 40325a67135aSbellardecho "Source path $source_path" 40337d13299dSbellardecho "C compiler $cc" 403483469015Sbellardecho "Host C compiler $host_cc" 403583f73fceSTomoki Sekiyamaecho "C++ compiler $cxx" 40363c4a4d0dSPeter Maydellecho "Objective-C compiler $objcc" 403745d285abSPeter Maydellecho "ARFLAGS $ARFLAGS" 40380c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 4039a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 40400c439cbfSJuan Quintelaecho "LDFLAGS $LDFLAGS" 40417d13299dSbellardecho "make $make" 40426a882643Spbrookecho "install $install" 4043c886edfbSBlue Swirlecho "python $python" 4044e2d8830eSBradif test "$slirp" = "yes" ; then 4045e2d8830eSBrad echo "smbd $smbd" 4046e2d8830eSBradfi 404717969268SFam Zhengecho "module support $modules" 4048a98fd896Sbellardecho "host CPU $cpu" 4049de83cd02Sbellardecho "host big endian $bigendian" 405097a847bcSbellardecho "target list $target_list" 4051ade25b0dSaurel32echo "tcg debug enabled $debug_tcg" 40527d13299dSbellardecho "gprof enabled $gprof" 405303b4fe7dSaliguoriecho "sparse enabled $sparse" 40541625af87Saliguoriecho "strip binaries $strip_opt" 405505c2a3e7Sbellardecho "profiler $profiler" 405643ce4dfeSbellardecho "static build $static" 405785aa5189Sbellardecho "-Werror enabled $werror" 40585b0753e0Sbellardif test "$darwin" = "yes" ; then 40595b0753e0Sbellard echo "Cocoa support $cocoa" 40605b0753e0Sbellardfi 4061e2134eb9SGerd Hoffmannecho "pixman $pixman" 406297a847bcSbellardecho "SDL support $sdl" 4063a4ccabcfSAnthony Liguoriecho "GTK support $gtk" 40644d3b6f6eSbalrogecho "curses support $curses" 4065769ce76dSAlexander Grafecho "curl support $curl" 406667b915a5Sbellardecho "mingw32 support $mingw32" 40670c58ac1cSmalcecho "Audio drivers $audio_drv_list" 4068b64ec4e4SFam Zhengecho "Block whitelist (rw) $block_drv_rw_whitelist" 4069b64ec4e4SFam Zhengecho "Block whitelist (ro) $block_drv_ro_whitelist" 4070983eef5aSMeador Ingeecho "VirtFS support $virtfs" 4071821601eaSJes Sorensenecho "VNC support $vnc" 4072821601eaSJes Sorensenif test "$vnc" = "yes" ; then 40738d5d2d4cSths echo "VNC TLS support $vnc_tls" 40742f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 40752f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 4076efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 40777536ee4bSTim Hardeck echo "VNC WS support $vnc_ws" 4078821601eaSJes Sorensenfi 40793142255cSblueswir1if test -n "$sparc_cpu"; then 40803142255cSblueswir1 echo "Target Sparc Arch $sparc_cpu" 40813142255cSblueswir1fi 4082e37630caSaliguoriecho "xen support $xen" 40832e4d9fb1Saurel32echo "brlapi support $brlapi" 4084a20a6f46SJuan Quintelaecho "bluez support $bluez" 4085a25dba17SJuan Quintelaecho "Documentation $docs" 4086c5937220Spbrook[ ! -z "$uname_release" ] && \ 4087c5937220Spbrookecho "uname -r $uname_release" 4088379f6698SPaul Brookecho "GUEST_BASE $guest_base" 408940d6444eSAvi Kivityecho "PIE $pie" 40908a16d273Sthsecho "vde support $vde" 409158952137SVincenzo Maffioneecho "netmap support $netmap" 40925c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 4093758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 409477755340Sthsecho "Install blobs $blobs" 4095b31a0277SJuan Quintelaecho "KVM support $kvm" 40962da776dbSMichael R. Hinesecho "RDMA support $rdma" 40979195b2c2SStefan Weilecho "TCG interpreter $tcg_interpreter" 4098f652e6afSaurel32echo "fdt support $fdt" 4099ceb42de8Saliguoriecho "preadv support $preadv" 41005f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 4101e78815a5SAndreas Färberecho "madvise $madvise" 4102e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 41031e9737daSRichard Hendersonecho "sigev_thread_id $sigev_thread_id" 4104ee682d27SStefan Weilecho "uuid support $uuid" 410547e98658SCorey Bryantecho "libcap-ng support $cap_ng" 4106d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 41075e9be92dSNicholas Bellingerecho "vhost-scsi support $vhost_scsi" 410894a420b1SStefan Hajnocziecho "Trace backend $trace_backend" 41099410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 4110*c9dd4074SStefan Weilif test "$spice" = "yes"; then 41112e0e3c39SAlon Levyecho "spice support $spice ($spice_protocol_version/$spice_server_version)" 4112*c9dd4074SStefan Weilelse 4113*c9dd4074SStefan Weilecho "spice support $spice" 4114*c9dd4074SStefan Weilfi 4115f27aaf4bSChristian Brunnerecho "rbd support $rbd" 4116dce512deSChristoph Hellwigecho "xfsctl support $xfs" 4117111a38b0SRobert Relyeaecho "nss used $smartcard_nss" 41182b2325ffSGerd Hoffmannecho "libusb $libusb" 411969354a83SHans de Goedeecho "usb net redir $usb_redir" 4120b1e5fff4SMichael Walleecho "GLX support $glx" 4121219c2521SStefan Weilif test "$libiscsi_version" = "1.4.0"; then 4122219c2521SStefan Weilecho "libiscsi support $libiscsi (1.4.0)" 4123219c2521SStefan Weilelse 4124c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 4125219c2521SStefan Weilfi 41266542aa9cSPeter Lievenecho "libnfs support $libnfs" 4127d138cee9SMichael Rothecho "build guest agent $guest_agent" 4128d9840e25STomoki Sekiyamaecho "QGA VSS support $guest_agent_with_vss" 4129f794573eSEduardo Otuboecho "seccomp support $seccomp" 41307c2acc70SPeter Maydellecho "coroutine backend $coroutine" 413170c60c08SStefan Hajnocziecho "coroutine pool $coroutine_pool" 4132eb100396SBharata B Raoecho "GlusterFS support $glusterfs" 4133583f6e7bSStefan Hajnocziecho "virtio-blk-data-plane $virtio_blk_data_plane" 41341d728c39SBlue Swirlecho "gcov $gcov_tool" 41351d728c39SBlue Swirlecho "gcov enabled $gcov" 4136ab214c29SStefan Bergerecho "TPM support $tpm" 41370a12ec87SRichard W.M. Jonesecho "libssh2 support $libssh2" 41383b8acc11SPaolo Bonziniecho "TPM passthrough $tpm_passthrough" 41393556c233SPaolo Bonziniecho "QOM debugging $qom_cast_debug" 41404f18b782SJeff Codyecho "vhdx $vhdx" 414195c6bff3SBenoît Canetecho "Quorum $quorum" 4142607dacd0Sqiaonuohanecho "lzo support $lzo" 4143607dacd0Sqiaonuohanecho "snappy support $snappy" 414467b915a5Sbellard 41451ba16968SStefan Weilif test "$sdl_too_old" = "yes"; then 414624b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 4147e8cd23deSbellardfi 414897a847bcSbellard 414998ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 415097a847bcSbellard 4151dbd99ae3SStefan Weilecho "# Automatically generated by configure - do not modify" >config-all-disas.mak 4152dbd99ae3SStefan Weil 415398ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 415498ec69acSJuan Quintelaecho >> $config_host_mak 415598ec69acSJuan Quintela 4156e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 415799d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 415899d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 41593aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 41608bf188aaSMichael Tokarevecho "libexecdir=$libexecdir" >> $config_host_mak 41610f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 416299d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 416399d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 416422d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 41659afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 41669afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 4167e26110cfSFam Zhengecho "qemu_moddir=$qemu_moddir" >> $config_host_mak 41685a699bbbSLaszlo Ersekif test "$mingw32" = "no" ; then 4169785c23aeSLuiz Capitulino echo "qemu_localstatedir=$local_statedir" >> $config_host_mak 41705a699bbbSLaszlo Ersekfi 4171f354b1a1SMichael Tokarevecho "qemu_helperdir=$libexecdir" >> $config_host_mak 4172f9943cd5SGerd Hoffmannecho "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak 4173f9943cd5SGerd Hoffmannecho "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak 4174834574eaSAnthony Liguoriecho "qemu_localedir=$qemu_localedir" >> $config_host_mak 4175f544a488SPaolo Bonziniecho "libs_softmmu=$libs_softmmu" >> $config_host_mak 4176804edf29SJuan Quintela 417798ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 4178727e5283SPaolo Bonzini 4179f8393946Saurel32if test "$debug_tcg" = "yes" ; then 41802358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 4181f8393946Saurel32fi 41821625af87Saliguoriif test "$strip_opt" = "yes" ; then 418352ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 41841625af87Saliguorifi 41857d13299dSbellardif test "$bigendian" = "yes" ; then 4186e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 418797a847bcSbellardfi 418867b915a5Sbellardif test "$mingw32" = "yes" ; then 418998ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 41909fe6de94SBlue Swirl rc_version=`cat $source_path/VERSION` 41919fe6de94SBlue Swirl version_major=${rc_version%%.*} 41929fe6de94SBlue Swirl rc_version=${rc_version#*.} 41939fe6de94SBlue Swirl version_minor=${rc_version%%.*} 41949fe6de94SBlue Swirl rc_version=${rc_version#*.} 41959fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 41969fe6de94SBlue Swirl version_micro=0 41979fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 41989fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 4199d9840e25STomoki Sekiyama if test "$guest_agent_with_vss" = "yes" ; then 4200d9840e25STomoki Sekiyama echo "CONFIG_QGA_VSS=y" >> $config_host_mak 4201d9840e25STomoki Sekiyama echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak 4202d9840e25STomoki Sekiyama fi 4203210fa556Spbrookelse 420435f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 4205210fa556Spbrookfi 4206128ab2ffSblueswir1 4207dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 4208dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 4209dffcb71cSMark McLoughlinfi 4210dffcb71cSMark McLoughlin 421183fb7adfSbellardif test "$darwin" = "yes" ; then 421298ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 421383fb7adfSbellardfi 4214b29fe3edSmalc 4215b29fe3edSmalcif test "$aix" = "yes" ; then 421698ec69acSJuan Quintela echo "CONFIG_AIX=y" >> $config_host_mak 4217b29fe3edSmalcfi 4218b29fe3edSmalc 4219ec530c81Sbellardif test "$solaris" = "yes" ; then 422098ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 42212358a494SJuan Quintela echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak 42220475a5caSths if test "$needs_libsunmath" = "yes" ; then 422375b5a697SJuan Quintela echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak 42240475a5caSths fi 4225ec530c81Sbellardfi 4226179cf400SAndreas Färberif test "$haiku" = "yes" ; then 4227179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 4228179cf400SAndreas Färberfi 422997a847bcSbellardif test "$static" = "yes" ; then 423098ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 423197a847bcSbellardfi 42321ba16968SStefan Weilif test "$profiler" = "yes" ; then 42332358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 423405c2a3e7Sbellardfi 4235c20709aaSbellardif test "$slirp" = "yes" ; then 423698ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 4237e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 4238c20709aaSbellardfi 42398a16d273Sthsif test "$vde" = "yes" ; then 424098ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 42418a16d273Sthsfi 424258952137SVincenzo Maffioneif test "$netmap" = "yes" ; then 424358952137SVincenzo Maffione echo "CONFIG_NETMAP=y" >> $config_host_mak 424458952137SVincenzo Maffionefi 424547e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 424647e98658SCorey Bryant echo "CONFIG_LIBCAP=y" >> $config_host_mak 424747e98658SCorey Bryantfi 42482358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 42490c58ac1cSmalcfor drv in $audio_drv_list; do 4250bb55b712SStefan Weil def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` 425198ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 4252923e4521Smalc if test "$drv" = "fmod"; then 42537aac6cb1SJuan Quintela echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak 4254fb065187Sbellard fi 42550c58ac1cSmalcdone 425667f86e8eSJuan Quintelaif test "$audio_pt_int" = "yes" ; then 425767f86e8eSJuan Quintela echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak 425867f86e8eSJuan Quintelafi 4259d5631638Smalcif test "$audio_win_int" = "yes" ; then 4260d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 4261d5631638Smalcfi 4262b64ec4e4SFam Zhengecho "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak 4263b64ec4e4SFam Zhengecho "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak 4264821601eaSJes Sorensenif test "$vnc" = "yes" ; then 4265821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 4266821601eaSJes Sorensenfi 42678d5d2d4cSthsif test "$vnc_tls" = "yes" ; then 426898ec69acSJuan Quintela echo "CONFIG_VNC_TLS=y" >> $config_host_mak 42698d5d2d4cSthsfi 42702f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 427198ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 42722f9606b3Saliguorifi 4273821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 42742f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 42752f6f5c7aSCorentin Charyfi 4276821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 4277efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 4278efe556adSCorentin Charyfi 42797536ee4bSTim Hardeckif test "$vnc_ws" = "yes" ; then 42807536ee4bSTim Hardeck echo "CONFIG_VNC_WS=y" >> $config_host_mak 42817536ee4bSTim Hardeck echo "VNC_WS_CFLAGS=$vnc_ws_cflags" >> $config_host_mak 42827536ee4bSTim Hardeckfi 428376655d6dSaliguoriif test "$fnmatch" = "yes" ; then 42842358a494SJuan Quintela echo "CONFIG_FNMATCH=y" >> $config_host_mak 428576655d6dSaliguorifi 4286ee682d27SStefan Weilif test "$uuid" = "yes" ; then 4287ee682d27SStefan Weil echo "CONFIG_UUID=y" >> $config_host_mak 4288ee682d27SStefan Weilfi 4289dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 4290dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 4291dce512deSChristoph Hellwigfi 4292b1a550a0Spbrookqemu_version=`head $source_path/VERSION` 429398ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 42942358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 429598ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 429698ec69acSJuan Quintelaecho "TARGET_DIRS=$target_list" >> $config_host_mak 4297a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 429898ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 4299cc8ae6deSpbrookfi 430017969268SFam Zhengif test "$modules" = "yes"; then 4301e26110cfSFam Zheng # $shacmd can generate a hash started with digit, which the compiler doesn't 4302e26110cfSFam Zheng # like as an symbol. So prefix it with an underscore 4303e26110cfSFam Zheng echo "CONFIG_STAMP=_`(echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ `" >> $config_host_mak 430417969268SFam Zheng echo "CONFIG_MODULES=y" >> $config_host_mak 430517969268SFam Zhengfi 43061ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 430798ec69acSJuan Quintela echo "CONFIG_SDL=y" >> $config_host_mak 43088ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 430949ecc3faSbellardfi 431049ecc3faSbellardif test "$cocoa" = "yes" ; then 431198ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 431249ecc3faSbellardfi 43134d3b6f6eSbalrogif test "$curses" = "yes" ; then 431498ec69acSJuan Quintela echo "CONFIG_CURSES=y" >> $config_host_mak 4315ab4e5602SJan Kiszkafi 4316ebc996f3SRiku Voipioif test "$utimens" = "yes" ; then 43172358a494SJuan Quintela echo "CONFIG_UTIMENSAT=y" >> $config_host_mak 4318ebc996f3SRiku Voipiofi 4319099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 43202358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 4321099d6b0fSRiku Voipiofi 432240ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 432340ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 432440ff6d7eSKevin Wolffi 43253ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 43262358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 43273ce34dfbSvibisreenivasanfi 4328c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 4329c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 4330c2882b96SRiku Voipiofi 4331d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 4332d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 4333d0927938SUlrich Hechtfi 43343d4fa43eSKusanagi Kouichiif test "$fallocate_punch_hole" = "yes" ; then 43353d4fa43eSKusanagi Kouichi echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak 43363d4fa43eSKusanagi Kouichifi 4337c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 4338c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 4339c727f47dSPeter Maydellfi 4340dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 4341dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 4342dace20dcSPeter Maydellfi 4343d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 4344d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 4345d0927938SUlrich Hechtfi 43464e0c6529SAlex Blighif test "$ppoll" = "yes" ; then 43474e0c6529SAlex Bligh echo "CONFIG_PPOLL=y" >> $config_host_mak 43484e0c6529SAlex Blighfi 4349cd758dd0SAlex Blighif test "$prctl_pr_set_timerslack" = "yes" ; then 4350cd758dd0SAlex Bligh echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak 4351cd758dd0SAlex Blighfi 43523b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 43533b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 43543b6edd16SPeter Maydellfi 43553b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 43563b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 43573b6edd16SPeter Maydellfi 43583b6edd16SPeter Maydellif test "$epoll_pwait" = "yes" ; then 43593b6edd16SPeter Maydell echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak 43603b6edd16SPeter Maydellfi 4361a8fd1abaSPeter Maydellif test "$sendfile" = "yes" ; then 4362a8fd1abaSPeter Maydell echo "CONFIG_SENDFILE=y" >> $config_host_mak 4363a8fd1abaSPeter Maydellfi 43643b3f24adSaurel32if test "$inotify" = "yes" ; then 43652358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 43663b3f24adSaurel32fi 4367c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 4368c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 4369c05c7a73SRiku Voipiofi 43706ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 43716ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 43726ae9a1f4SJuan Quintelafi 43736ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 43746ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 43756ae9a1f4SJuan Quintelafi 4376769ce76dSAlexander Grafif test "$curl" = "yes" ; then 4377d3399d7cSFam Zheng echo "CONFIG_CURL=m" >> $config_host_mak 4378b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 43796ebc91e5SFam Zheng echo "CURL_LIBS=$curl_libs" >> $config_host_mak 4380769ce76dSAlexander Graffi 43812e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 438298ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 43832e4d9fb1Saurel32fi 4384fb599c9aSbalrogif test "$bluez" = "yes" ; then 438598ec69acSJuan Quintela echo "CONFIG_BLUEZ=y" >> $config_host_mak 4386ef7635ecSJuan Quintela echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak 4387fb599c9aSbalrogfi 4388e18df141SAnthony Liguoriecho "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 4389a4ccabcfSAnthony Liguoriif test "$gtk" = "yes" ; then 4390a4ccabcfSAnthony Liguori echo "CONFIG_GTK=y" >> $config_host_mak 4391a4ccabcfSAnthony Liguori echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak 4392a4ccabcfSAnthony Liguori echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak 4393a4ccabcfSAnthony Liguorifi 4394e37630caSaliguoriif test "$xen" = "yes" ; then 43956dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 4396d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 4397e37630caSaliguorifi 43985c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 43995c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 44005c6c3a6cSChristoph Hellwigfi 4401758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 4402758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 4403758e8e38SVenkateswararao Jujjuri (JV)fi 44044f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 44054f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 44064f26f2b6SAvi Kivityfi 4407983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 4408758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 4409758e8e38SVenkateswararao Jujjuri (JV)fi 44105e9be92dSNicholas Bellingerif test "$vhost_scsi" = "yes" ; then 44115e9be92dSNicholas Bellinger echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak 44125e9be92dSNicholas Bellingerfi 441377755340Sthsif test "$blobs" = "yes" ; then 441498ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 441577755340Sthsfi 4416bf9298b9Saliguoriif test "$iovec" = "yes" ; then 44172358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 4418bf9298b9Saliguorifi 4419ceb42de8Saliguoriif test "$preadv" = "yes" ; then 44202358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 4421ceb42de8Saliguorifi 4422f652e6afSaurel32if test "$fdt" = "yes" ; then 44233f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 4424f652e6afSaurel32fi 4425dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 4426dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 4427dcc38d1cSMarcelo Tosattifi 44289195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 44299195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 44309195b2c2SStefan Weilfi 44315f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 44325f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 44335f6b9e8fSBlue Swirlfi 4434e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 4435e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 4436e78815a5SAndreas Färberfi 4437e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 4438e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 4439e78815a5SAndreas Färberfi 44401e9737daSRichard Hendersonif test "$sigev_thread_id" = "yes" ; then 44411e9737daSRichard Henderson echo "CONFIG_SIGEV_THREAD_ID=y" >> $config_host_mak 44421e9737daSRichard Hendersonfi 444397a847bcSbellard 4444cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 4445cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 4446cd4ec0b4SGerd Hoffmannfi 4447cd4ec0b4SGerd Hoffmann 4448111a38b0SRobert Relyeaif test "$smartcard_nss" = "yes" ; then 4449111a38b0SRobert Relyea echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak 4450ad4cf3f6SPaul Brook echo "libcacard_libs=$libcacard_libs" >> $config_host_mak 4451ad4cf3f6SPaul Brook echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak 4452111a38b0SRobert Relyeafi 4453111a38b0SRobert Relyea 44542b2325ffSGerd Hoffmannif test "$libusb" = "yes" ; then 44552b2325ffSGerd Hoffmann echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak 44562b2325ffSGerd Hoffmannfi 44572b2325ffSGerd Hoffmann 445869354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 445969354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 446069354a83SHans de Goedefi 446169354a83SHans de Goede 4462b1e5fff4SMichael Walleif test "$glx" = "yes" ; then 4463b1e5fff4SMichael Walle echo "CONFIG_GLX=y" >> $config_host_mak 44642b6b7099SPaolo Bonzini echo "GLX_LIBS=$glx_libs" >> $config_host_mak 446520ff075bSMichael Wallefi 446620ff075bSMichael Walle 4467607dacd0Sqiaonuohanif test "$lzo" = "yes" ; then 4468607dacd0Sqiaonuohan echo "CONFIG_LZO=y" >> $config_host_mak 4469607dacd0Sqiaonuohanfi 4470607dacd0Sqiaonuohan 4471607dacd0Sqiaonuohanif test "$snappy" = "yes" ; then 4472607dacd0Sqiaonuohan echo "CONFIG_SNAPPY=y" >> $config_host_mak 4473607dacd0Sqiaonuohanfi 4474607dacd0Sqiaonuohan 4475c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 4476d3399d7cSFam Zheng echo "CONFIG_LIBISCSI=m" >> $config_host_mak 4477219c2521SStefan Weil if test "$libiscsi_version" = "1.4.0"; then 4478219c2521SStefan Weil echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak 4479219c2521SStefan Weil fi 44806ebc91e5SFam Zheng echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak 44816ebc91e5SFam Zheng echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak 4482c589b249SRonnie Sahlbergfi 4483c589b249SRonnie Sahlberg 44846542aa9cSPeter Lievenif test "$libnfs" = "yes" ; then 44856542aa9cSPeter Lieven echo "CONFIG_LIBNFS=y" >> $config_host_mak 44866542aa9cSPeter Lievenfi 44876542aa9cSPeter Lieven 4488f794573eSEduardo Otuboif test "$seccomp" = "yes"; then 4489f794573eSEduardo Otubo echo "CONFIG_SECCOMP=y" >> $config_host_mak 4490f794573eSEduardo Otubofi 4491f794573eSEduardo Otubo 449283fb7adfSbellard# XXX: suppress that 44937d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 44942358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 44957d3505c5Sbellardfi 44967d3505c5Sbellard 44972358a494SJuan Quintelaecho "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak 4498c5937220Spbrook 449920ff6c80SAnthony Liguoriif test "$zero_malloc" = "yes" ; then 450020ff6c80SAnthony Liguori echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak 450120ff6c80SAnthony Liguorifi 45023556c233SPaolo Bonziniif test "$qom_cast_debug" = "yes" ; then 45033556c233SPaolo Bonzini echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak 45043556c233SPaolo Bonzinifi 4505f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 4506d3399d7cSFam Zheng echo "CONFIG_RBD=m" >> $config_host_mak 45076ebc91e5SFam Zheng echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak 45086ebc91e5SFam Zheng echo "RBD_LIBS=$rbd_libs" >> $config_host_mak 4509f27aaf4bSChristian Brunnerfi 451020ff6c80SAnthony Liguori 45117c2acc70SPeter Maydellecho "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak 451270c60c08SStefan Hajnocziif test "$coroutine_pool" = "yes" ; then 451370c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak 451470c60c08SStefan Hajnoczielse 451570c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak 451670c60c08SStefan Hajnoczifi 4517d0e2fce5SAneesh Kumar K.V 4518d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 4519d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 4520d2042378SAneesh Kumar K.Vfi 4521d2042378SAneesh Kumar K.V 4522e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 4523e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 4524e06a765eSHarsh Prateek Borafi 4525e06a765eSHarsh Prateek Bora 4526cc6e3ca9SGerd Hoffmannif test "$pragma_diagnostic_available" = "yes" ; then 4527cc6e3ca9SGerd Hoffmann echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak 452806d71fa1SPeter Maydellfi 452906d71fa1SPeter Maydell 45303f4349dcSKevin Wolfif test "$valgrind_h" = "yes" ; then 45313f4349dcSKevin Wolf echo "CONFIG_VALGRIND_H=y" >> $config_host_mak 45323f4349dcSKevin Wolffi 45333f4349dcSKevin Wolf 45348ab1bf12SLuiz Capitulinoif test "$has_environ" = "yes" ; then 45358ab1bf12SLuiz Capitulino echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak 45368ab1bf12SLuiz Capitulinofi 45378ab1bf12SLuiz Capitulino 453876a347e1SRichard Hendersonif test "$cpuid_h" = "yes" ; then 453976a347e1SRichard Henderson echo "CONFIG_CPUID_H=y" >> $config_host_mak 454076a347e1SRichard Hendersonfi 454176a347e1SRichard Henderson 4542f540166bSRichard Hendersonif test "$int128" = "yes" ; then 4543f540166bSRichard Henderson echo "CONFIG_INT128=y" >> $config_host_mak 4544f540166bSRichard Hendersonfi 4545f540166bSRichard Henderson 45461e6e9acaSRichard Hendersonif test "$getauxval" = "yes" ; then 45471e6e9acaSRichard Henderson echo "CONFIG_GETAUXVAL=y" >> $config_host_mak 45481e6e9acaSRichard Hendersonfi 45491e6e9acaSRichard Henderson 4550eb100396SBharata B Raoif test "$glusterfs" = "yes" ; then 4551d3399d7cSFam Zheng echo "CONFIG_GLUSTERFS=m" >> $config_host_mak 45526ebc91e5SFam Zheng echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak 45536ebc91e5SFam Zheng echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak 4554eb100396SBharata B Raofi 4555eb100396SBharata B Rao 45560c14fb47SBharata B Raoif test "$glusterfs_discard" = "yes" ; then 45570c14fb47SBharata B Rao echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak 45580c14fb47SBharata B Raofi 45590c14fb47SBharata B Rao 45607c815372SBharata B Raoif test "$glusterfs_zerofill" = "yes" ; then 45617c815372SBharata B Rao echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak 45627c815372SBharata B Raofi 45637c815372SBharata B Rao 45640a12ec87SRichard W.M. Jonesif test "$libssh2" = "yes" ; then 4565d3399d7cSFam Zheng echo "CONFIG_LIBSSH2=m" >> $config_host_mak 45666ebc91e5SFam Zheng echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak 45676ebc91e5SFam Zheng echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak 45680a12ec87SRichard W.M. Jonesfi 45690a12ec87SRichard W.M. Jones 457095c6bff3SBenoît Canetif test "$quorum" = "yes" ; then 457195c6bff3SBenoît Canet echo "CONFIG_QUORUM=y" >> $config_host_mak 457295c6bff3SBenoît Canetfi 457395c6bff3SBenoît Canet 4574583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" ; then 45756e790746SPaolo Bonzini echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=$(CONFIG_VIRTIO)' >> $config_host_mak 4576583f6e7bSStefan Hajnoczifi 4577583f6e7bSStefan Hajnoczi 45784f18b782SJeff Codyif test "$vhdx" = "yes" ; then 45794f18b782SJeff Cody echo "CONFIG_VHDX=y" >> $config_host_mak 45804f18b782SJeff Codyfi 45814f18b782SJeff Cody 458268063649Sblueswir1# USB host support 4583b5613fdcSGerd Hoffmannif test "$libusb" = "yes"; then 45842b2325ffSGerd Hoffmann echo "HOST_USB=libusb legacy" >> $config_host_mak 4585b5613fdcSGerd Hoffmannelse 458698ec69acSJuan Quintela echo "HOST_USB=stub" >> $config_host_mak 4587b5613fdcSGerd Hoffmannfi 458868063649Sblueswir1 45893b8acc11SPaolo Bonzini# TPM passthrough support? 45903b8acc11SPaolo Bonziniif test "$tpm" = "yes"; then 45913b8acc11SPaolo Bonzini echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak 45923b8acc11SPaolo Bonzini if test "$tpm_passthrough" = "yes"; then 45933b8acc11SPaolo Bonzini echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak 45943b8acc11SPaolo Bonzini fi 45953b8acc11SPaolo Bonzinifi 45963b8acc11SPaolo Bonzini 4597e4858974SLluís# use default implementation for tracing backend-specific routines 4598e4858974SLluístrace_default=yes 459994a420b1SStefan Hajnocziecho "TRACE_BACKEND=$trace_backend" >> $config_host_mak 46006d8a764eSLluísif test "$trace_backend" = "nop"; then 46016d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 460222890ab5SPrerna Saxenafi 46039410b56cSPrerna Saxenaif test "$trace_backend" = "simple"; then 46046d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 4605e4858974SLluís trace_default=no 46066d8a764eSLluís # Set the appropriate trace file. 4607953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 46089410b56cSPrerna Saxenafi 46096d8a764eSLluísif test "$trace_backend" = "stderr"; then 46106d8a764eSLluís echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak 46119a82b6a5SLluís trace_default=no 46126d8a764eSLluísfi 46136d8a764eSLluísif test "$trace_backend" = "ust"; then 46146d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 46156d8a764eSLluísfi 46166d8a764eSLluísif test "$trace_backend" = "dtrace"; then 46176d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 46186d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 46196d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 46206d8a764eSLluís fi 4621c276b17dSDaniel P. Berrangefi 4622781e9545SEiichi Tsukataif test "$trace_backend" = "ftrace"; then 4623781e9545SEiichi Tsukata if test "$linux" = "yes" ; then 4624781e9545SEiichi Tsukata echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak 4625781e9545SEiichi Tsukata trace_default=no 4626781e9545SEiichi Tsukata else 462721684af0SStewart Smith feature_not_found "ftrace(trace backend)" "ftrace requires Linux" 4628781e9545SEiichi Tsukata fi 4629781e9545SEiichi Tsukatafi 46309410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 4631e4858974SLluísif test "$trace_default" = "yes"; then 4632e4858974SLluís echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak 4633e4858974SLluísfi 46349410b56cSPrerna Saxena 46352da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 46362da776dbSMichael R. Hines echo "CONFIG_RDMA=y" >> $config_host_mak 46372da776dbSMichael R. Hinesfi 46382da776dbSMichael R. Hines 46395b5e3037SPaolo Bonziniif test "$tcg_interpreter" = "yes"; then 46405b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 46415b5e3037SPaolo Bonzinielif test "$ARCH" = "sparc64" ; then 46425b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 46435b5e3037SPaolo Bonzinielif test "$ARCH" = "s390x" ; then 46445b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 4645c72b26ecSRichard Hendersonelif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then 46465b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 46475b5e3037SPaolo Bonzinielse 46485b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 46495b5e3037SPaolo Bonzinifi 46505b5e3037SPaolo BonziniQEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" 46515b5e3037SPaolo Bonzini 465298ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 465398ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 4654804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 4655804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 46561901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 46571901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 465821655882SPaolo Bonziniif test -n "$libtool"; then 465921655882SPaolo Bonzini echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak 466021655882SPaolo Bonzini echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak 466121655882SPaolo Bonzinielse 46621901cb14SBrad echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 466321655882SPaolo Bonzini echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak 466421655882SPaolo Bonzinifi 4665c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 4666804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 4667a31a8642SMichael S. Tsirkinif $iasl -h > /dev/null 2>&1; then 4668a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_host_mak 4669a31a8642SMichael S. Tsirkinfi 46702b2e59e6SPaolo Bonziniecho "CC_I386=$cc_i386" >> $config_host_mak 4671804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 467283f73fceSTomoki Sekiyamaecho "CXX=$cxx" >> $config_host_mak 46733c4a4d0dSPeter Maydellecho "OBJCC=$objcc" >> $config_host_mak 4674804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 467545d285abSPeter Maydellecho "ARFLAGS=$ARFLAGS" >> $config_host_mak 46763dd46c78SBlue Swirlecho "AS=$as" >> $config_host_mak 46773dd46c78SBlue Swirlecho "CPP=$cpp" >> $config_host_mak 4678804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 4679804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 46809fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 468144dc0ca3SAlon Levyecho "LIBTOOL=$libtool" >> $config_host_mak 4682e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 468346eef33bSBradecho "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak 4684a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 4685f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 4686e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 4687e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 4688e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 4689e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 4690e39f0062SPaolo Bonzinifi 469142da6041SGerd Hoffmannif test "$cross_prefix" != ""; then 469242da6041SGerd Hoffmann echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak 469342da6041SGerd Hoffmannelse 469442da6041SGerd Hoffmann echo "AUTOCONF_HOST := " >> $config_host_mak 469542da6041SGerd Hoffmannfi 4696e2a2ed06SJuan Quintelaecho "LDFLAGS=$LDFLAGS" >> $config_host_mak 469746eef33bSBradecho "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak 469837746c5eSMarc-André Lureauecho "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak 469973da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 47003e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 4701804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 470217969268SFam Zhengecho "DSOSUF=$DSOSUF" >> $config_host_mak 470317969268SFam Zhengecho "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak 4704957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 470594dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 4706cbdd1999SPaolo Bonziniecho "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak 47071d728c39SBlue Swirlif test "$gcov" = "yes" ; then 47081d728c39SBlue Swirl echo "CONFIG_GCOV=y" >> $config_host_mak 47091d728c39SBlue Swirl echo "GCOV=$gcov_tool" >> $config_host_mak 47101d728c39SBlue Swirlfi 4711804edf29SJuan Quintela 47126efd7517SPeter Maydell# use included Linux headers 47136efd7517SPeter Maydellif test "$linux" = "yes" ; then 4714a307beb6SAndreas Färber mkdir -p linux-headers 47156efd7517SPeter Maydell case "$cpu" in 4716c72b26ecSRichard Henderson i386|x86_64|x32) 471708312a63SPeter Maydell linux_arch=x86 47186efd7517SPeter Maydell ;; 47196efd7517SPeter Maydell ppcemb|ppc|ppc64) 472008312a63SPeter Maydell linux_arch=powerpc 47216efd7517SPeter Maydell ;; 47226efd7517SPeter Maydell s390x) 472308312a63SPeter Maydell linux_arch=s390 472408312a63SPeter Maydell ;; 47251f080313SClaudio Fontana aarch64) 47261f080313SClaudio Fontana linux_arch=arm64 47271f080313SClaudio Fontana ;; 472808312a63SPeter Maydell *) 472908312a63SPeter Maydell # For most CPUs the kernel architecture name and QEMU CPU name match. 473008312a63SPeter Maydell linux_arch="$cpu" 47316efd7517SPeter Maydell ;; 47326efd7517SPeter Maydell esac 473308312a63SPeter Maydell # For non-KVM architectures we will not have asm headers 473408312a63SPeter Maydell if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then 473508312a63SPeter Maydell symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 473608312a63SPeter Maydell fi 47376efd7517SPeter Maydellfi 47386efd7517SPeter Maydell 473997a847bcSbellardfor target in $target_list; do 474097a847bcSbellardtarget_dir="$target" 474125be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 4742c1799a84SPaolo Bonzinitarget_name=`echo $target | cut -d '-' -f 1` 474397a847bcSbellardtarget_bigendian="no" 47441f3d3c8fSJuan Quintela 4745c1799a84SPaolo Bonzinicase "$target_name" in 4746d15a9c23SAnthony Green armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 4747ea2d6a39SJuan Quintela target_bigendian=yes 4748ea2d6a39SJuan Quintela ;; 4749ea2d6a39SJuan Quintelaesac 475097a847bcSbellardtarget_softmmu="no" 4751997344f3Sbellardtarget_user_only="no" 4752831b7825Sthstarget_linux_user="no" 475384778508Sblueswir1target_bsd_user="no" 47549e407a85Spbrookcase "$target" in 4755c1799a84SPaolo Bonzini ${target_name}-softmmu) 47569e407a85Spbrook target_softmmu="yes" 47579e407a85Spbrook ;; 4758c1799a84SPaolo Bonzini ${target_name}-linux-user) 47599c7a4202SBlue Swirl if test "$linux" != "yes" ; then 476076ad07a4SPeter Maydell error_exit "Target '$target' is only available on a Linux host" 47619c7a4202SBlue Swirl fi 47629e407a85Spbrook target_user_only="yes" 47639e407a85Spbrook target_linux_user="yes" 47649e407a85Spbrook ;; 4765c1799a84SPaolo Bonzini ${target_name}-bsd-user) 47669cf55765SBlue Swirl if test "$bsd" != "yes" ; then 476776ad07a4SPeter Maydell error_exit "Target '$target' is only available on a BSD host" 47689c7a4202SBlue Swirl fi 476984778508Sblueswir1 target_user_only="yes" 477084778508Sblueswir1 target_bsd_user="yes" 477184778508Sblueswir1 ;; 47729e407a85Spbrook *) 477376ad07a4SPeter Maydell error_exit "Target '$target' not recognised" 47749e407a85Spbrook exit 1 47759e407a85Spbrook ;; 47769e407a85Spbrookesac 4777831b7825Sths 477897a847bcSbellardmkdir -p $target_dir 477925be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 478097a847bcSbellard 4781e5fe0c52Spbrookbflt="no" 4782c1799a84SPaolo Bonziniinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"` 478356aebc89Spbrookgdb_xml_files="" 47847ba1e619Saliguori 4785c1799a84SPaolo BonziniTARGET_ARCH="$target_name" 47866acff7daSJuan QuintelaTARGET_BASE_ARCH="" 4787e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 4788e73aae67SJuan Quintela 4789c1799a84SPaolo Bonzinicase "$target_name" in 47902408a527Saurel32 i386) 47912408a527Saurel32 ;; 47922408a527Saurel32 x86_64) 47936acff7daSJuan Quintela TARGET_BASE_ARCH=i386 47942408a527Saurel32 ;; 47952408a527Saurel32 alpha) 47962408a527Saurel32 ;; 47972408a527Saurel32 arm|armeb) 4798b498c8a0SJuan Quintela TARGET_ARCH=arm 4799e5fe0c52Spbrook bflt="yes" 480056aebc89Spbrook gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" 48012408a527Saurel32 ;; 48026a49fa95SAlexander Graf aarch64) 48036a49fa95SAlexander Graf TARGET_BASE_ARCH=arm 48046a49fa95SAlexander Graf bflt="yes" 48056a669427SPeter Maydell gdb_xml_files="aarch64-core.xml aarch64-fpu.xml" 48066a49fa95SAlexander Graf ;; 48072408a527Saurel32 cris) 48082408a527Saurel32 ;; 4809613a22c9SMichael Walle lm32) 4810613a22c9SMichael Walle ;; 48112408a527Saurel32 m68k) 48120938cda5Saurel32 bflt="yes" 481356aebc89Spbrook gdb_xml_files="cf-core.xml cf-fp.xml" 48142408a527Saurel32 ;; 4815877fdc12SEdgar E. Iglesias microblaze|microblazeel) 4816877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 481772b675caSEdgar E. Iglesias bflt="yes" 481872b675caSEdgar E. Iglesias ;; 48192408a527Saurel32 mips|mipsel) 4820b498c8a0SJuan Quintela TARGET_ARCH=mips 482125be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 48222408a527Saurel32 ;; 48232408a527Saurel32 mipsn32|mipsn32el) 4824597e2cecSRichard Henderson TARGET_ARCH=mips64 48256acff7daSJuan Quintela TARGET_BASE_ARCH=mips 482625be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 4827597e2cecSRichard Henderson echo "TARGET_ABI32=y" >> $config_target_mak 48282408a527Saurel32 ;; 48292408a527Saurel32 mips64|mips64el) 4830b498c8a0SJuan Quintela TARGET_ARCH=mips64 48316acff7daSJuan Quintela TARGET_BASE_ARCH=mips 483225be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 48332408a527Saurel32 ;; 4834d15a9c23SAnthony Green moxie) 4835d15a9c23SAnthony Green ;; 4836e67db06eSJia Liu or32) 4837e67db06eSJia Liu TARGET_ARCH=openrisc 4838e67db06eSJia Liu TARGET_BASE_ARCH=openrisc 4839e67db06eSJia Liu ;; 48402408a527Saurel32 ppc) 4841c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48422408a527Saurel32 ;; 48432408a527Saurel32 ppcemb) 48446acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4845e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4846c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48472408a527Saurel32 ;; 48482408a527Saurel32 ppc64) 48496acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4850e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4851c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48522408a527Saurel32 ;; 48532408a527Saurel32 ppc64abi32) 4854b498c8a0SJuan Quintela TARGET_ARCH=ppc64 48556acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4856e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 485725be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 4858c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48592408a527Saurel32 ;; 48602408a527Saurel32 sh4|sh4eb) 4861b498c8a0SJuan Quintela TARGET_ARCH=sh4 48624dbed897Spbrook bflt="yes" 48632408a527Saurel32 ;; 48642408a527Saurel32 sparc) 48652408a527Saurel32 ;; 48662408a527Saurel32 sparc64) 48676acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 48682408a527Saurel32 ;; 48692408a527Saurel32 sparc32plus) 4870b498c8a0SJuan Quintela TARGET_ARCH=sparc64 48716acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 4872e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 487325be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 48742408a527Saurel32 ;; 487524e804ecSAlexander Graf s390x) 487624e804ecSAlexander Graf ;; 4877d2fbca94SGuan Xuetao unicore32) 4878d2fbca94SGuan Xuetao ;; 4879cfa550c6SMax Filippov xtensa|xtensaeb) 4880cfa550c6SMax Filippov TARGET_ARCH=xtensa 4881cfa550c6SMax Filippov ;; 48822408a527Saurel32 *) 488376ad07a4SPeter Maydell error_exit "Unsupported target CPU" 48842408a527Saurel32 ;; 48852408a527Saurel32esac 48865e8861a0SPaolo Bonzini# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 48875e8861a0SPaolo Bonziniif [ "$TARGET_BASE_ARCH" = "" ]; then 48885e8861a0SPaolo Bonzini TARGET_BASE_ARCH=$TARGET_ARCH 48895e8861a0SPaolo Bonzinifi 48905e8861a0SPaolo Bonzini 48915e8861a0SPaolo Bonzinisymlink "$source_path/Makefile.target" "$target_dir/Makefile" 48925e8861a0SPaolo Bonzini 489399afc91dSDaniel P. Berrangeupper() { 489499afc91dSDaniel P. Berrange echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' 489599afc91dSDaniel P. Berrange} 489699afc91dSDaniel P. Berrange 489799afc91dSDaniel P. Berrangetarget_arch_name="`upper $TARGET_ARCH`" 489825be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 4899c1799a84SPaolo Bonziniecho "TARGET_NAME=$target_name" >> $config_target_mak 490025be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 4901e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 4902e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 4903e6e91b9cSJuan Quintelafi 490425be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 4905c1799a84SPaolo Bonzinicase "$target_name" in 49061b0c87fcSJuan Quintela i386|x86_64) 49071b0c87fcSJuan Quintela if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then 490825be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 4909eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = yes; then 4910eb6fda0fSAnthony PERARD echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" 4911eb6fda0fSAnthony PERARD fi 4912432d268cSJun Nakajima fi 491359d21e53SAlexander Graf ;; 491459d21e53SAlexander Graf *) 49151b0c87fcSJuan Quintelaesac 4916c1799a84SPaolo Bonzinicase "$target_name" in 491770a5f682SPeter Maydell aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x) 4918c59249f9SJuan Quintela # Make sure the target and host cpus are compatible 4919c59249f9SJuan Quintela if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ 4920c1799a84SPaolo Bonzini \( "$target_name" = "$cpu" -o \ 4921c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc" \) -o \ 4922c1799a84SPaolo Bonzini \( "$target_name" = "ppc64" -a "$cpu" = "ppc" \) -o \ 4923c1799a84SPaolo Bonzini \( "$target_name" = "ppc" -a "$cpu" = "ppc64" \) -o \ 4924c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ 4925c1799a84SPaolo Bonzini \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \ 4926c1799a84SPaolo Bonzini \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) \) ; then 492725be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 49281ba16968SStefan Weil if test "$vhost_net" = "yes" ; then 4929d5970055SMichael S. Tsirkin echo "CONFIG_VHOST_NET=y" >> $config_target_mak 4930d5970055SMichael S. Tsirkin fi 4931c59249f9SJuan Quintela fi 4932c59249f9SJuan Quintelaesac 4933de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 493425be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 493597a847bcSbellardfi 493697a847bcSbellardif test "$target_softmmu" = "yes" ; then 493725be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 4938de83cd02Sbellardfi 4939997344f3Sbellardif test "$target_user_only" = "yes" ; then 494025be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 4941a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 4942997344f3Sbellardfi 4943831b7825Sthsif test "$target_linux_user" = "yes" ; then 494425be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 4945831b7825Sthsfi 494656aebc89Spbrooklist="" 494756aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 494856aebc89Spbrook for x in $gdb_xml_files; do 494956aebc89Spbrook list="$list $source_path/gdb-xml/$x" 495056aebc89Spbrook done 495125be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 49523d0f1517SJuan Quintelafi 4953de83cd02Sbellard 4954e5fe0c52Spbrookif test "$target_user_only" = "yes" -a "$bflt" = "yes"; then 495525be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 4956e5fe0c52Spbrookfi 4957379f6698SPaul Brookif test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then 495825be210fSJuan Quintela echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak 4959379f6698SPaul Brookfi 496084778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 496125be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 496284778508Sblueswir1fi 49635b0753e0Sbellard 49644afddb55SJuan Quintela# generate QEMU_CFLAGS/LDFLAGS for targets 4965fa282484SJuan Quintela 49664afddb55SJuan Quintelacflags="" 4967fa282484SJuan Quintelaldflags="" 49689b8e111fSJuan Quintela 496964656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 497064656024SJuan Quintela case "$i" in 497164656024SJuan Quintela alpha) 497225be210fSJuan Quintela echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak 497376cad711SPaolo Bonzini echo "CONFIG_ALPHA_DIS=y" >> config-all-disas.mak 497464656024SJuan Quintela ;; 497564656024SJuan Quintela arm) 497625be210fSJuan Quintela echo "CONFIG_ARM_DIS=y" >> $config_target_mak 497776cad711SPaolo Bonzini echo "CONFIG_ARM_DIS=y" >> config-all-disas.mak 4978999b53ecSClaudio Fontana if test -n "${cxx}"; then 4979999b53ecSClaudio Fontana echo "CONFIG_ARM_A64_DIS=y" >> $config_target_mak 4980999b53ecSClaudio Fontana echo "CONFIG_ARM_A64_DIS=y" >> config-all-disas.mak 4981999b53ecSClaudio Fontana fi 498264656024SJuan Quintela ;; 498364656024SJuan Quintela cris) 498425be210fSJuan Quintela echo "CONFIG_CRIS_DIS=y" >> $config_target_mak 498576cad711SPaolo Bonzini echo "CONFIG_CRIS_DIS=y" >> config-all-disas.mak 498664656024SJuan Quintela ;; 498764656024SJuan Quintela hppa) 498825be210fSJuan Quintela echo "CONFIG_HPPA_DIS=y" >> $config_target_mak 498976cad711SPaolo Bonzini echo "CONFIG_HPPA_DIS=y" >> config-all-disas.mak 499064656024SJuan Quintela ;; 4991c72b26ecSRichard Henderson i386|x86_64|x32) 499225be210fSJuan Quintela echo "CONFIG_I386_DIS=y" >> $config_target_mak 499376cad711SPaolo Bonzini echo "CONFIG_I386_DIS=y" >> config-all-disas.mak 499464656024SJuan Quintela ;; 4995903ec55cSAurelien Jarno ia64*) 4996903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $config_target_mak 499776cad711SPaolo Bonzini echo "CONFIG_IA64_DIS=y" >> config-all-disas.mak 4998903ec55cSAurelien Jarno ;; 499979368f49SMichael Walle lm32) 500079368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $config_target_mak 500176cad711SPaolo Bonzini echo "CONFIG_LM32_DIS=y" >> config-all-disas.mak 500279368f49SMichael Walle ;; 500364656024SJuan Quintela m68k) 500425be210fSJuan Quintela echo "CONFIG_M68K_DIS=y" >> $config_target_mak 500576cad711SPaolo Bonzini echo "CONFIG_M68K_DIS=y" >> config-all-disas.mak 500664656024SJuan Quintela ;; 5007877fdc12SEdgar E. Iglesias microblaze*) 500825be210fSJuan Quintela echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak 500976cad711SPaolo Bonzini echo "CONFIG_MICROBLAZE_DIS=y" >> config-all-disas.mak 501064656024SJuan Quintela ;; 501164656024SJuan Quintela mips*) 501225be210fSJuan Quintela echo "CONFIG_MIPS_DIS=y" >> $config_target_mak 501376cad711SPaolo Bonzini echo "CONFIG_MIPS_DIS=y" >> config-all-disas.mak 501464656024SJuan Quintela ;; 5015d15a9c23SAnthony Green moxie*) 5016d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> $config_target_mak 5017d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> config-all-disas.mak 5018d15a9c23SAnthony Green ;; 5019e67db06eSJia Liu or32) 5020e67db06eSJia Liu echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak 502176cad711SPaolo Bonzini echo "CONFIG_OPENRISC_DIS=y" >> config-all-disas.mak 5022e67db06eSJia Liu ;; 502364656024SJuan Quintela ppc*) 502425be210fSJuan Quintela echo "CONFIG_PPC_DIS=y" >> $config_target_mak 502576cad711SPaolo Bonzini echo "CONFIG_PPC_DIS=y" >> config-all-disas.mak 502664656024SJuan Quintela ;; 502724e804ecSAlexander Graf s390*) 502825be210fSJuan Quintela echo "CONFIG_S390_DIS=y" >> $config_target_mak 502976cad711SPaolo Bonzini echo "CONFIG_S390_DIS=y" >> config-all-disas.mak 503064656024SJuan Quintela ;; 503164656024SJuan Quintela sh4) 503225be210fSJuan Quintela echo "CONFIG_SH4_DIS=y" >> $config_target_mak 503376cad711SPaolo Bonzini echo "CONFIG_SH4_DIS=y" >> config-all-disas.mak 503464656024SJuan Quintela ;; 503564656024SJuan Quintela sparc*) 503625be210fSJuan Quintela echo "CONFIG_SPARC_DIS=y" >> $config_target_mak 503776cad711SPaolo Bonzini echo "CONFIG_SPARC_DIS=y" >> config-all-disas.mak 503864656024SJuan Quintela ;; 5039cfa550c6SMax Filippov xtensa*) 5040cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak 504176cad711SPaolo Bonzini echo "CONFIG_XTENSA_DIS=y" >> config-all-disas.mak 5042cfa550c6SMax Filippov ;; 504364656024SJuan Quintela esac 504464656024SJuan Quinteladone 50459195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 50469195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $config_target_mak 504776cad711SPaolo Bonzini echo "CONFIG_TCI_DIS=y" >> config-all-disas.mak 50489195b2c2SStefan Weilfi 504964656024SJuan Quintela 50506ee7126fSJuan Quintelacase "$ARCH" in 50516ee7126fSJuan Quintelaalpha) 50526ee7126fSJuan Quintela # Ensure there's only a single GP 50536ee7126fSJuan Quintela cflags="-msmall-data $cflags" 50546ee7126fSJuan Quintela;; 50556ee7126fSJuan Quintelaesac 50566ee7126fSJuan Quintela 5057d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 505825be210fSJuan Quintela echo "TARGET_GPROF=yes" >> $config_target_mak 5059d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 5060d02c1db3SJuan Quintela cflags="-p $cflags" 5061d02c1db3SJuan Quintela ldflags="-p $ldflags" 5062d02c1db3SJuan Quintela fi 5063d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 5064d02c1db3SJuan Quintela ldflags="-p $ldflags" 506525be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 5066d02c1db3SJuan Quintela fi 5067d02c1db3SJuan Quintelafi 5068d02c1db3SJuan Quintela 50699b8e111fSJuan Quintelaif test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then 5070964c6fa1SRichard Henderson ldflags="$ldflags $textseg_ldflags" 5071fa282484SJuan Quintelafi 5072fa282484SJuan Quintela 507325be210fSJuan Quintelaecho "LDFLAGS+=$ldflags" >> $config_target_mak 507425be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 5075fa282484SJuan Quintela 507697a847bcSbellarddone # for target in $targets 50777d13299dSbellard 5078b776eca1SGerd Hoffmannif [ "$pixman" = "internal" ]; then 5079b776eca1SGerd Hoffmann echo "config-host.h: subdir-pixman" >> $config_host_mak 5080b776eca1SGerd Hoffmannfi 5081b776eca1SGerd Hoffmann 50822da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 50832da776dbSMichael R. Hinesecho "CONFIG_RDMA=y" >> $config_host_mak 50842da776dbSMichael R. Hinesfi 50852da776dbSMichael R. Hines 5086a540f158SPeter Crosthwaiteif [ "$dtc_internal" = "yes" ]; then 5087a540f158SPeter Crosthwaite echo "config-host.h: subdir-dtc" >> $config_host_mak 5088a540f158SPeter Crosthwaitefi 5089a540f158SPeter Crosthwaite 5090d1807a4fSPaolo Bonzini# build tree in object directory in case the source is not in the current directory 5091f93296eaSWenchao XiaDIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" 50922b170effSMichael TokarevDIRS="$DIRS fsdev" 50939933c305SChristian BorntraegerDIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" 50942d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 50952dee8d54SPaolo BonziniDIRS="$DIRS qapi-generated" 5096c09015ddSAnthony LiguoriFILES="Makefile tests/tcg/Makefile qdict-test-data.txt" 5097c09015ddSAnthony LiguoriFILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" 5098aaa2ebc5SAndreas FärberFILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" 5099ae0bfb79SBlue SwirlFILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" 5100446b9165SAndreas FärberFILES="$FILES pc-bios/spapr-rtas/Makefile" 51019933c305SChristian BorntraegerFILES="$FILES pc-bios/s390-ccw/Makefile" 51022d9f27d2SAnthony LiguoriFILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" 51034652b792SJan KiszkaFILES="$FILES pc-bios/qemu-icon.bmp" 5104753d11f2SRichard Hendersonfor bios_file in \ 5105753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 51065acc2ec0SGerd Hoffmann $source_path/pc-bios/*.aml \ 5107753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 5108753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 5109e89e33e1SDominik Dingel $source_path/pc-bios/*.img \ 5110753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 5111753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 5112753d11f2SRichard Hendersondo 51137ea78b74SJan Kiszka FILES="$FILES pc-bios/`basename $bios_file`" 51147ea78b74SJan Kiszkadone 5115c2304b52SMarcel Apfelbaumfor test_file in `find $source_path/tests/acpi-test-data -type f` 5116c2304b52SMarcel Apfelbaumdo 5117c2304b52SMarcel Apfelbaum FILES="$FILES tests/acpi-test-data`echo $test_file | sed -e 's/.*acpi-test-data//'`" 5118c2304b52SMarcel Apfelbaumdone 5119d1807a4fSPaolo Bonzinimkdir -p $DIRS 51207d13299dSbellardfor f in $FILES ; do 512172b8b5a1SStefan Weil if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then 5122f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 5123f9245e10SPeter Maydell fi 51247d13299dSbellarddone 51251ad2134fSPaul Brook 5126c34ebfdcSAnthony Liguori# temporary config to build submodules 51272d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 5128c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 512937116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 5130c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 51313dd46c78SBlue Swirl echo "AS=$as" >> $config_mak 5132c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 5133c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 51343dd46c78SBlue Swirl echo "CPP=$cpp" >> $config_mak 5135c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 5136a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_mak 5137c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 5138c34ebfdcSAnthony Liguoridone 5139c34ebfdcSAnthony Liguori 5140b40292e7SJan Kiszkaif test "$docs" = "yes" ; then 5141b40292e7SJan Kiszka mkdir -p QMP 5142b40292e7SJan Kiszkafi 5143