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 3476ad07a4SPeter Maydellerror_exit() { 3576ad07a4SPeter Maydell echo 3676ad07a4SPeter Maydell echo "ERROR: $1" 3776ad07a4SPeter Maydell while test -n "$2"; do 3876ad07a4SPeter Maydell echo " $2" 3976ad07a4SPeter Maydell shift 4076ad07a4SPeter Maydell done 4176ad07a4SPeter Maydell echo 4276ad07a4SPeter Maydell exit 1 4376ad07a4SPeter Maydell} 4476ad07a4SPeter Maydell 459c83ffd8SPeter Maydelldo_compiler() { 469c83ffd8SPeter Maydell # Run the compiler, capturing its output to the log. First argument 479c83ffd8SPeter Maydell # is compiler binary to execute. 489c83ffd8SPeter Maydell local compiler="$1" 499c83ffd8SPeter Maydell shift 509c83ffd8SPeter Maydell echo $compiler "$@" >> config.log 519c83ffd8SPeter Maydell $compiler "$@" >> config.log 2>&1 || return $? 528dc38a78SPeter Maydell # Test passed. If this is an --enable-werror build, rerun 538dc38a78SPeter Maydell # the test with -Werror and bail out if it fails. This 548dc38a78SPeter Maydell # makes warning-generating-errors in configure test code 558dc38a78SPeter Maydell # obvious to developers. 568dc38a78SPeter Maydell if test "$werror" != "yes"; then 578dc38a78SPeter Maydell return 0 588dc38a78SPeter Maydell fi 598dc38a78SPeter Maydell # Don't bother rerunning the compile if we were already using -Werror 608dc38a78SPeter Maydell case "$*" in 618dc38a78SPeter Maydell *-Werror*) 628dc38a78SPeter Maydell return 0 638dc38a78SPeter Maydell ;; 648dc38a78SPeter Maydell esac 659c83ffd8SPeter Maydell echo $compiler -Werror "$@" >> config.log 669c83ffd8SPeter Maydell $compiler -Werror "$@" >> config.log 2>&1 && return $? 6776ad07a4SPeter Maydell error_exit "configure test passed without -Werror but failed with -Werror." \ 6876ad07a4SPeter Maydell "This is probably a bug in the configure script. The failing command" \ 6976ad07a4SPeter Maydell "will be at the bottom of config.log." \ 7076ad07a4SPeter Maydell "You can run configure with --disable-werror to bypass this check." 718dc38a78SPeter Maydell} 728dc38a78SPeter Maydell 739c83ffd8SPeter Maydelldo_cc() { 749c83ffd8SPeter Maydell do_compiler "$cc" "$@" 759c83ffd8SPeter Maydell} 769c83ffd8SPeter Maydell 779c83ffd8SPeter Maydelldo_cxx() { 789c83ffd8SPeter Maydell do_compiler "$cxx" "$@" 799c83ffd8SPeter Maydell} 809c83ffd8SPeter Maydell 819c83ffd8SPeter Maydellupdate_cxxflags() { 829c83ffd8SPeter Maydell # Set QEMU_CXXFLAGS from QEMU_CFLAGS by filtering out those 839c83ffd8SPeter Maydell # options which some versions of GCC's C++ compiler complain about 849c83ffd8SPeter Maydell # because they only make sense for C programs. 859c83ffd8SPeter Maydell QEMU_CXXFLAGS= 869c83ffd8SPeter Maydell for arg in $QEMU_CFLAGS; do 879c83ffd8SPeter Maydell case $arg in 889c83ffd8SPeter Maydell -Wstrict-prototypes|-Wmissing-prototypes|-Wnested-externs|\ 899c83ffd8SPeter Maydell -Wold-style-declaration|-Wold-style-definition|-Wredundant-decls) 909c83ffd8SPeter Maydell ;; 919c83ffd8SPeter Maydell *) 929c83ffd8SPeter Maydell QEMU_CXXFLAGS=${QEMU_CXXFLAGS:+$QEMU_CXXFLAGS }$arg 939c83ffd8SPeter Maydell ;; 949c83ffd8SPeter Maydell esac 959c83ffd8SPeter Maydell done 969c83ffd8SPeter Maydell} 979c83ffd8SPeter Maydell 9852166aa0SJuan Quintelacompile_object() { 998dc38a78SPeter Maydell do_cc $QEMU_CFLAGS -c -o $TMPO $TMPC 10052166aa0SJuan Quintela} 10152166aa0SJuan Quintela 10252166aa0SJuan Quintelacompile_prog() { 10352166aa0SJuan Quintela local_cflags="$1" 10452166aa0SJuan Quintela local_ldflags="$2" 1058dc38a78SPeter Maydell do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags 10652166aa0SJuan Quintela} 10752166aa0SJuan Quintela 10866518bf6SDon Slutzdo_libtool() { 10966518bf6SDon Slutz local mode=$1 11066518bf6SDon Slutz shift 11166518bf6SDon Slutz # Run the compiler, capturing its output to the log. 11266518bf6SDon Slutz echo $libtool $mode --tag=CC $cc "$@" >> config.log 11366518bf6SDon Slutz $libtool $mode --tag=CC $cc "$@" >> config.log 2>&1 || return $? 11466518bf6SDon Slutz # Test passed. If this is an --enable-werror build, rerun 11566518bf6SDon Slutz # the test with -Werror and bail out if it fails. This 11666518bf6SDon Slutz # makes warning-generating-errors in configure test code 11766518bf6SDon Slutz # obvious to developers. 11866518bf6SDon Slutz if test "$werror" != "yes"; then 11966518bf6SDon Slutz return 0 12066518bf6SDon Slutz fi 12166518bf6SDon Slutz # Don't bother rerunning the compile if we were already using -Werror 12266518bf6SDon Slutz case "$*" in 12366518bf6SDon Slutz *-Werror*) 12466518bf6SDon Slutz return 0 12566518bf6SDon Slutz ;; 12666518bf6SDon Slutz esac 12766518bf6SDon Slutz echo $libtool $mode --tag=CC $cc -Werror "$@" >> config.log 12866518bf6SDon Slutz $libtool $mode --tag=CC $cc -Werror "$@" >> config.log 2>&1 && return $? 12966518bf6SDon Slutz error_exit "configure test passed without -Werror but failed with -Werror." \ 13066518bf6SDon Slutz "This is probably a bug in the configure script. The failing command" \ 13166518bf6SDon Slutz "will be at the bottom of config.log." \ 13266518bf6SDon Slutz "You can run configure with --disable-werror to bypass this check." 13366518bf6SDon Slutz} 13466518bf6SDon Slutz 13566518bf6SDon Slutzlibtool_prog() { 13666518bf6SDon Slutz do_libtool --mode=compile $QEMU_CFLAGS -c -fPIE -DPIE -o $TMPO $TMPC || return $? 13766518bf6SDon Slutz do_libtool --mode=link $LDFLAGS -o $TMPA $TMPL -rpath /usr/local/lib 13866518bf6SDon Slutz} 13966518bf6SDon Slutz 14011568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 14111568d6dSPaolo Bonzinisymlink() { 14272b8b5a1SStefan Weil rm -rf "$2" 143ec5b06d7SAnthony Liguori mkdir -p "$(dirname "$2")" 14472b8b5a1SStefan Weil ln -s "$1" "$2" 14511568d6dSPaolo Bonzini} 14611568d6dSPaolo Bonzini 1470dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 1480dba6195SLoïc Minier# executable or a builtin) 1490dba6195SLoïc Minierhas() { 1500dba6195SLoïc Minier type "$1" >/dev/null 2>&1 1510dba6195SLoïc Minier} 1520dba6195SLoïc Minier 1530dba6195SLoïc Minier# search for an executable in PATH 1540dba6195SLoïc Minierpath_of() { 1550dba6195SLoïc Minier local_command="$1" 1560dba6195SLoïc Minier local_ifs="$IFS" 1570dba6195SLoïc Minier local_dir="" 1580dba6195SLoïc Minier 1590dba6195SLoïc Minier # pathname has a dir component? 1600dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 1610dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 1620dba6195SLoïc Minier echo "$local_command" 1630dba6195SLoïc Minier return 0 1640dba6195SLoïc Minier fi 1650dba6195SLoïc Minier fi 1660dba6195SLoïc Minier if [ -z "$local_command" ]; then 1670dba6195SLoïc Minier return 1 1680dba6195SLoïc Minier fi 1690dba6195SLoïc Minier 1700dba6195SLoïc Minier IFS=: 1710dba6195SLoïc Minier for local_dir in $PATH; do 1720dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 1730dba6195SLoïc Minier echo "$local_dir/$local_command" 1740dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1750dba6195SLoïc Minier return 0 1760dba6195SLoïc Minier fi 1770dba6195SLoïc Minier done 1780dba6195SLoïc Minier # not found 1790dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1800dba6195SLoïc Minier return 1 1810dba6195SLoïc Minier} 1820dba6195SLoïc Minier 1837d13299dSbellard# default parameters 184ca4deeb1SPaolo Bonzinisource_path=`dirname "$0"` 1852ff6b91eSJuan Quintelacpu="" 186a31a8642SMichael S. Tsirkiniasl="iasl" 1871e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 18843ce4dfeSbellardstatic="no" 1897d13299dSbellardcross_prefix="" 1900c58ac1cSmalcaudio_drv_list="" 191b64ec4e4SFam Zhengblock_drv_rw_whitelist="" 192b64ec4e4SFam Zhengblock_drv_ro_whitelist="" 193e49d021eSPeter Maydellhost_cc="cc" 19473da375eSJuan Quintelalibs_softmmu="" 1953e2e0e6bSJuan Quintelalibs_tools="" 19667f86e8eSJuan Quintelaaudio_pt_int="" 197d5631638Smalcaudio_win_int="" 1982b2e59e6SPaolo Bonzinicc_i386=i386-pc-linux-gnu-gcc 199957f1f99SMichael Rothlibs_qga="" 2005bc62e01SGerd Hoffmanndebug_info="yes" 201ac0df51dSaliguori 202afb63ebdSStefan Weil# Don't accept a target_list environment variable. 203afb63ebdSStefan Weilunset target_list 204377529c0SPaolo Bonzini 205377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 206377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 207377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 208377529c0SPaolo Bonzini# unless --disable-foo is given 209377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 210377529c0SPaolo Bonzini# feature will searched for, 211377529c0SPaolo Bonzini# if not found, configure exits with error 212377529c0SPaolo Bonzini# 213377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 214377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 215377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 216377529c0SPaolo Bonzini 217377529c0SPaolo Bonzinibluez="" 218377529c0SPaolo Bonzinibrlapi="" 219377529c0SPaolo Bonzinicurl="" 220377529c0SPaolo Bonzinicurses="" 221377529c0SPaolo Bonzinidocs="" 222377529c0SPaolo Bonzinifdt="" 22358952137SVincenzo Maffionenetmap="no" 224e2134eb9SGerd Hoffmannpixman="" 225377529c0SPaolo Bonzinisdl="" 22647c03744SDave Airliesdlabi="1.2" 227983eef5aSMeador Ingevirtfs="" 228821601eaSJes Sorensenvnc="yes" 229377529c0SPaolo Bonzinisparse="no" 230377529c0SPaolo Bonziniuuid="" 231377529c0SPaolo Bonzinivde="" 232377529c0SPaolo Bonzinivnc_tls="" 233377529c0SPaolo Bonzinivnc_sasl="" 234377529c0SPaolo Bonzinivnc_jpeg="" 235377529c0SPaolo Bonzinivnc_png="" 2367536ee4bSTim Hardeckvnc_ws="" 237377529c0SPaolo Bonzinixen="" 238d5b93ddfSAnthony PERARDxen_ctrl_version="" 239eb6fda0fSAnthony PERARDxen_pci_passthrough="" 240377529c0SPaolo Bonzinilinux_aio="" 24147e98658SCorey Bryantcap_ng="" 242377529c0SPaolo Bonziniattr="" 2434f26f2b6SAvi Kivitylibattr="" 244377529c0SPaolo Bonzinixfs="" 245377529c0SPaolo Bonzini 246d41a75a2SBradvhost_net="no" 2475e9be92dSNicholas Bellingervhost_scsi="no" 248d41a75a2SBradkvm="no" 2492da776dbSMichael R. Hinesrdma="" 250377529c0SPaolo Bonzinigprof="no" 251377529c0SPaolo Bonzinidebug_tcg="no" 252377529c0SPaolo Bonzinidebug="no" 253377529c0SPaolo Bonzinistrip_opt="yes" 2549195b2c2SStefan Weiltcg_interpreter="no" 255377529c0SPaolo Bonzinibigendian="no" 256377529c0SPaolo Bonzinimingw32="no" 2571d728c39SBlue Swirlgcov="no" 2581d728c39SBlue Swirlgcov_tool="gcov" 259377529c0SPaolo BonziniEXESUF="" 26017969268SFam ZhengDSOSUF=".so" 26117969268SFam ZhengLDFLAGS_SHARED="-shared" 26217969268SFam Zhengmodules="no" 263377529c0SPaolo Bonziniprefix="/usr/local" 264377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 265528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 266850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 267377529c0SPaolo Bonzinibindir="\${prefix}/bin" 2683aa5d2beSAlon Levylibdir="\${prefix}/lib" 2698bf188aaSMichael Tokarevlibexecdir="\${prefix}/libexec" 2700f94d6daSAlon Levyincludedir="\${prefix}/include" 271377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 272785c23aeSLuiz Capitulinolocal_statedir="\${prefix}/var" 273377529c0SPaolo Bonziniconfsuffix="/qemu" 274377529c0SPaolo Bonzinislirp="yes" 275377529c0SPaolo Bonzinifmod_lib="" 276377529c0SPaolo Bonzinifmod_inc="" 277377529c0SPaolo Bonzinioss_lib="" 278377529c0SPaolo Bonzinibsd="no" 279377529c0SPaolo Bonzinilinux="no" 280377529c0SPaolo Bonzinisolaris="no" 281377529c0SPaolo Bonziniprofiler="no" 282377529c0SPaolo Bonzinicocoa="no" 283377529c0SPaolo Bonzinisoftmmu="yes" 284377529c0SPaolo Bonzinilinux_user="no" 285377529c0SPaolo Bonzinibsd_user="no" 28630163d89SPeter Maydellguest_base="yes" 287377529c0SPaolo Bonziniuname_release="" 288377529c0SPaolo Bonziniaix="no" 289377529c0SPaolo Bonziniblobs="yes" 290377529c0SPaolo Bonzinipkgversion="" 29140d6444eSAvi Kivitypie="" 292377529c0SPaolo Bonzinizero_malloc="" 2933556c233SPaolo Bonziniqom_cast_debug="yes" 294377529c0SPaolo Bonzinitrace_backend="nop" 295377529c0SPaolo Bonzinitrace_file="trace" 296377529c0SPaolo Bonzinispice="" 297377529c0SPaolo Bonzinirbd="" 298111a38b0SRobert Relyeasmartcard_nss="" 2992b2325ffSGerd Hoffmannlibusb="" 30069354a83SHans de Goedeusb_redir="" 301b1e5fff4SMichael Walleglx="" 3021ece9905SAlon Levyzlib="yes" 303607dacd0Sqiaonuohanlzo="no" 304607dacd0Sqiaonuohansnappy="no" 305e8ef31a3SMichael Tokarevguest_agent="" 306d9840e25STomoki Sekiyamaguest_agent_with_vss="no" 307d9840e25STomoki Sekiyamavss_win32_sdk="" 308d9840e25STomoki Sekiyamawin_sdk="no" 3094b1c11fdSDaniel P. Berrangewant_tools="yes" 310c589b249SRonnie Sahlberglibiscsi="" 3116542aa9cSPeter Lievenlibnfs="" 312519175a2SAlex Barcelocoroutine="" 31370c60c08SStefan Hajnoczicoroutine_pool="" 314f794573eSEduardo Otuboseccomp="" 315eb100396SBharata B Raoglusterfs="" 3160c14fb47SBharata B Raoglusterfs_discard="no" 3177c815372SBharata B Raoglusterfs_zerofill="no" 318583f6e7bSStefan Hajnoczivirtio_blk_data_plane="" 319a4ccabcfSAnthony Liguorigtk="" 320528de90aSDaniel P. Berrangegtkabi="2.0" 321*bbbf9bfbSStefan Weilvte="" 322ab214c29SStefan Bergertpm="no" 3230a12ec87SRichard W.M. Joneslibssh2="" 3244f18b782SJeff Codyvhdx="" 32595c6bff3SBenoît Canetquorum="no" 326377529c0SPaolo Bonzini 327ac0df51dSaliguori# parse CC options first 328ac0df51dSaliguorifor opt do 329ac0df51dSaliguori optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 330ac0df51dSaliguori case "$opt" in 331ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 332ac0df51dSaliguori ;; 3333d8df640SPaolo Bonzini --cc=*) CC="$optarg" 334ac0df51dSaliguori ;; 33583f73fceSTomoki Sekiyama --cxx=*) CXX="$optarg" 33683f73fceSTomoki Sekiyama ;; 337ca4deeb1SPaolo Bonzini --source-path=*) source_path="$optarg" 338ca4deeb1SPaolo Bonzini ;; 3392ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 3402ff6b91eSJuan Quintela ;; 341a558ee17SJuan Quintela --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" 342f9943cd5SGerd Hoffmann EXTRA_CFLAGS="$optarg" 343e2a2ed06SJuan Quintela ;; 344e2a2ed06SJuan Quintela --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" 345f9943cd5SGerd Hoffmann EXTRA_LDFLAGS="$optarg" 346e2a2ed06SJuan Quintela ;; 3475bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 3485bc62e01SGerd Hoffmann ;; 3495bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 3505bc62e01SGerd Hoffmann ;; 351ac0df51dSaliguori esac 352ac0df51dSaliguoridone 353ac0df51dSaliguori# OS specific 354ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 35593148aa5SStefan Weil# we can eliminate its usage altogether. 356ac0df51dSaliguori 357e49d021eSPeter Maydell# Preferred compiler: 358e49d021eSPeter Maydell# ${CC} (if set) 359e49d021eSPeter Maydell# ${cross_prefix}gcc (if cross-prefix specified) 360e49d021eSPeter Maydell# system compiler 361e49d021eSPeter Maydellif test -z "${CC}${cross_prefix}"; then 362e49d021eSPeter Maydell cc="$host_cc" 363e49d021eSPeter Maydellelse 364b3198cc2SStuart Yoder cc="${CC-${cross_prefix}gcc}" 365e49d021eSPeter Maydellfi 366e49d021eSPeter Maydell 36783f73fceSTomoki Sekiyamaif test -z "${CXX}${cross_prefix}"; then 36883f73fceSTomoki Sekiyama cxx="c++" 36983f73fceSTomoki Sekiyamaelse 37083f73fceSTomoki Sekiyama cxx="${CXX-${cross_prefix}g++}" 37183f73fceSTomoki Sekiyamafi 37283f73fceSTomoki Sekiyama 373b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 3743dd46c78SBlue Swirlas="${AS-${cross_prefix}as}" 3753dd46c78SBlue Swirlcpp="${CPP-$cc -E}" 376b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 377b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 3783f534581SBradlibtool="${LIBTOOL-${cross_prefix}libtool}" 379b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 380b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 38117884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 38217884d7bSSergei Trofimovichquery_pkg_config() { 38317884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 38417884d7bSSergei Trofimovich} 38517884d7bSSergei Trofimovichpkg_config=query_pkg_config 386b3198cc2SStuart Yodersdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" 38747c03744SDave Airliesdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}" 388ac0df51dSaliguori 38945d285abSPeter Maydell# If the user hasn't specified ARFLAGS, default to 'rv', just as make does. 39045d285abSPeter MaydellARFLAGS="${ARFLAGS-rv}" 39145d285abSPeter Maydell 392be17dc90SMichael S. Tsirkin# default flags for all hosts 3934c288acbSPeter MaydellQEMU_CFLAGS="-fno-strict-aliasing -fno-common $QEMU_CFLAGS" 394f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 395c95e3080SKevin WolfQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 396be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 3976b4c305cSPaolo BonziniQEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include" 3985bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 3995bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 400be17dc90SMichael S. Tsirkin LDFLAGS="-g $LDFLAGS" 4015bc62e01SGerd Hoffmannfi 402be17dc90SMichael S. Tsirkin 403ca4deeb1SPaolo Bonzini# make source path absolute 404ca4deeb1SPaolo Bonzinisource_path=`cd "$source_path"; pwd` 405ca4deeb1SPaolo Bonzini 406ac0df51dSaliguoricheck_define() { 407ac0df51dSaliguoricat > $TMPC <<EOF 408ac0df51dSaliguori#if !defined($1) 409fd786e1aSPeter Maydell#error $1 not defined 410ac0df51dSaliguori#endif 411ac0df51dSaliguoriint main(void) { return 0; } 412ac0df51dSaliguoriEOF 41352166aa0SJuan Quintela compile_object 414ac0df51dSaliguori} 415ac0df51dSaliguori 416bbea4050SPeter Maydellif check_define __linux__ ; then 417bbea4050SPeter Maydell targetos="Linux" 418bbea4050SPeter Maydellelif check_define _WIN32 ; then 419bbea4050SPeter Maydell targetos='MINGW32' 420bbea4050SPeter Maydellelif check_define __OpenBSD__ ; then 421bbea4050SPeter Maydell targetos='OpenBSD' 422bbea4050SPeter Maydellelif check_define __sun__ ; then 423bbea4050SPeter Maydell targetos='SunOS' 424bbea4050SPeter Maydellelif check_define __HAIKU__ ; then 425bbea4050SPeter Maydell targetos='Haiku' 426bbea4050SPeter Maydellelse 427bbea4050SPeter Maydell targetos=`uname -s` 428bbea4050SPeter Maydellfi 429bbea4050SPeter Maydell 430bbea4050SPeter Maydell# Some host OSes need non-standard checks for which CPU to use. 431bbea4050SPeter Maydell# Note that these checks are broken for cross-compilation: if you're 432bbea4050SPeter Maydell# cross-compiling to one of these OSes then you'll need to specify 433bbea4050SPeter Maydell# the correct CPU with the --cpu option. 434bbea4050SPeter Maydellcase $targetos in 435bbea4050SPeter MaydellDarwin) 436bbea4050SPeter Maydell # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can 437bbea4050SPeter Maydell # run 64-bit userspace code. 438bbea4050SPeter Maydell # If the user didn't specify a CPU explicitly and the kernel says this is 439bbea4050SPeter Maydell # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. 440bbea4050SPeter Maydell if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then 441bbea4050SPeter Maydell cpu="x86_64" 442bbea4050SPeter Maydell fi 443bbea4050SPeter Maydell ;; 444bbea4050SPeter MaydellSunOS) 445bbea4050SPeter Maydell # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo 446bbea4050SPeter Maydell if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then 447bbea4050SPeter Maydell cpu="x86_64" 448bbea4050SPeter Maydell fi 449bbea4050SPeter Maydellesac 450bbea4050SPeter Maydell 4512ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 4522ff6b91eSJuan Quintela # command line argument 4532ff6b91eSJuan Quintela : 4542ff6b91eSJuan Quintelaelif check_define __i386__ ; then 455ac0df51dSaliguori cpu="i386" 456ac0df51dSaliguorielif check_define __x86_64__ ; then 457c72b26ecSRichard Henderson if check_define __ILP32__ ; then 458c72b26ecSRichard Henderson cpu="x32" 459c72b26ecSRichard Henderson else 460ac0df51dSaliguori cpu="x86_64" 461c72b26ecSRichard Henderson fi 4623aa9bd6cSblueswir1elif check_define __sparc__ ; then 4633aa9bd6cSblueswir1 if check_define __arch64__ ; then 4643aa9bd6cSblueswir1 cpu="sparc64" 4653aa9bd6cSblueswir1 else 4663aa9bd6cSblueswir1 cpu="sparc" 4673aa9bd6cSblueswir1 fi 468fdf7ed96Smalcelif check_define _ARCH_PPC ; then 469fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 470fdf7ed96Smalc cpu="ppc64" 471ac0df51dSaliguori else 472fdf7ed96Smalc cpu="ppc" 473fdf7ed96Smalc fi 474afa05235SAurelien Jarnoelif check_define __mips__ ; then 475afa05235SAurelien Jarno cpu="mips" 476477ba620SAurelien Jarnoelif check_define __ia64__ ; then 477477ba620SAurelien Jarno cpu="ia64" 478d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 479d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 480d66ed0eaSAurelien Jarno cpu="s390x" 481d66ed0eaSAurelien Jarno else 482d66ed0eaSAurelien Jarno cpu="s390" 483d66ed0eaSAurelien Jarno fi 48421d89f84SPeter Maydellelif check_define __arm__ ; then 48521d89f84SPeter Maydell cpu="arm" 4861f080313SClaudio Fontanaelif check_define __aarch64__ ; then 4871f080313SClaudio Fontana cpu="aarch64" 488f28ffed5SBradelif check_define __hppa__ ; then 489f28ffed5SBrad cpu="hppa" 490fdf7ed96Smalcelse 491fdf7ed96Smalc cpu=`uname -m` 492ac0df51dSaliguorifi 493ac0df51dSaliguori 494359bc95dSPeter MaydellARCH= 495359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 496359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 4977d13299dSbellardcase "$cpu" in 498c72b26ecSRichard Henderson ia64|ppc|ppc64|s390|s390x|sparc64|x32) 499ea8f20f8SJuan Quintela cpu="$cpu" 500ea8f20f8SJuan Quintela ;; 5017d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 50297a847bcSbellard cpu="i386" 5037d13299dSbellard ;; 504aaa5fa14Saurel32 x86_64|amd64) 505aaa5fa14Saurel32 cpu="x86_64" 506aaa5fa14Saurel32 ;; 50721d89f84SPeter Maydell armv*b|armv*l|arm) 50821d89f84SPeter Maydell cpu="arm" 5097d13299dSbellard ;; 5101f080313SClaudio Fontana aarch64) 5111f080313SClaudio Fontana cpu="aarch64" 5121f080313SClaudio Fontana ;; 513afa05235SAurelien Jarno mips*) 514afa05235SAurelien Jarno cpu="mips" 515afa05235SAurelien Jarno ;; 5163142255cSblueswir1 sparc|sun4[cdmuv]) 517ae228531Sbellard cpu="sparc" 518ae228531Sbellard ;; 5197d13299dSbellard *) 520359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 521359bc95dSPeter Maydell ARCH=unknown 5227d13299dSbellard ;; 5237d13299dSbellardesac 524359bc95dSPeter Maydellif test -z "$ARCH"; then 525359bc95dSPeter Maydell ARCH="$cpu" 526359bc95dSPeter Maydellfi 527e2d52ad3SJuan Quintela 5287d13299dSbellard# OS specific 5290dbfc675SJuan Quintela 5307d13299dSbellardcase $targetos in 531c326e0afSbellardCYGWIN*) 532c326e0afSbellard mingw32="yes" 533a558ee17SJuan Quintela QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" 534d5631638Smalc audio_possible_drivers="winwave sdl" 535d5631638Smalc audio_drv_list="winwave" 536c326e0afSbellard;; 53767b915a5SbellardMINGW32*) 53867b915a5Sbellard mingw32="yes" 539d5631638Smalc audio_possible_drivers="winwave dsound sdl fmod" 540d5631638Smalc audio_drv_list="winwave" 54167b915a5Sbellard;; 5425c40d2bdSthsGNU/kFreeBSD) 543a167ba50SAurelien Jarno bsd="yes" 5440c58ac1cSmalc audio_drv_list="oss" 545f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 5465c40d2bdSths;; 5477d3505c5SbellardFreeBSD) 5487d3505c5Sbellard bsd="yes" 5490db4a067SPaolo Bonzini make="${MAKE-gmake}" 5500c58ac1cSmalc audio_drv_list="oss" 551f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 552f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 553f01576f1SJuergen Lock LIBS="-lutil $LIBS" 55458952137SVincenzo Maffione netmap="" # enable netmap autodetect 5557d3505c5Sbellard;; 556c5e97233Sblueswir1DragonFly) 557c5e97233Sblueswir1 bsd="yes" 5580db4a067SPaolo Bonzini make="${MAKE-gmake}" 559c5e97233Sblueswir1 audio_drv_list="oss" 560c5e97233Sblueswir1 audio_possible_drivers="oss sdl esd pa" 561c5e97233Sblueswir1;; 5627d3505c5SbellardNetBSD) 5637d3505c5Sbellard bsd="yes" 5640db4a067SPaolo Bonzini make="${MAKE-gmake}" 5650c58ac1cSmalc audio_drv_list="oss" 566c2de5c91Smalc audio_possible_drivers="oss sdl esd" 5678ef92a88Sblueswir1 oss_lib="-lossaudio" 5687d3505c5Sbellard;; 5697d3505c5SbellardOpenBSD) 5707d3505c5Sbellard bsd="yes" 5710db4a067SPaolo Bonzini make="${MAKE-gmake}" 5724f6ab397SBrad Smith audio_drv_list="sdl" 5734f6ab397SBrad Smith audio_possible_drivers="sdl esd" 5747d3505c5Sbellard;; 57583fb7adfSbellardDarwin) 57683fb7adfSbellard bsd="yes" 57783fb7adfSbellard darwin="yes" 57817969268SFam Zheng LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" 5791b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 580a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 5810c439cbfSJuan Quintela LDFLAGS="-arch x86_64 $LDFLAGS" 5821b0f9cc2Saliguori fi 583fd677642Sths cocoa="yes" 5840c58ac1cSmalc audio_drv_list="coreaudio" 585c2de5c91Smalc audio_possible_drivers="coreaudio sdl fmod" 5860c439cbfSJuan Quintela LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" 5877973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 588a0b7cf6bSPeter Maydell # Disable attempts to use ObjectiveC features in os/object.h since they 589a0b7cf6bSPeter Maydell # won't work when we're compiling with gcc as a C compiler. 590a0b7cf6bSPeter Maydell QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" 59183fb7adfSbellard;; 592ec530c81SbellardSunOS) 593ec530c81Sbellard solaris="yes" 5940db4a067SPaolo Bonzini make="${MAKE-gmake}" 5950db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 596fa58948dSBlue Swirl ld="gld" 597e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 5980475a5caSths needs_libsunmath="no" 599c2b84fabSths solarisrev=`uname -r | cut -f2 -d.` 600c2b84fabSths if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 6010475a5caSths if test "$solarisrev" -le 9 ; then 6020475a5caSths if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then 6030475a5caSths needs_libsunmath="yes" 604f14bfdf9SJuan Quintela QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" 605f14bfdf9SJuan Quintela LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" 606f14bfdf9SJuan Quintela LIBS="-lsunmath $LIBS" 6070475a5caSths else 60876ad07a4SPeter Maydell error_exit "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" \ 60976ad07a4SPeter Maydell "libsunmath from the Sun Studio compilers tools, due to a lack of" \ 61076ad07a4SPeter Maydell "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" \ 61176ad07a4SPeter Maydell "Studio 11 can be downloaded from www.sun.com." 6120475a5caSths fi 6130475a5caSths fi 61486b2bd93Sths fi 6156b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 6160c58ac1cSmalc audio_drv_list="oss" 6176b4d2ba1Sths fi 618c2de5c91Smalc audio_possible_drivers="oss sdl" 619d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 620d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 621d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 622d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 623a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 624560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 625560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 626560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 627ec530c81Sbellard;; 628b29fe3edSmalcAIX) 629b29fe3edSmalc aix="yes" 6300db4a067SPaolo Bonzini make="${MAKE-gmake}" 631b29fe3edSmalc;; 632179cf400SAndreas FärberHaiku) 633179cf400SAndreas Färber haiku="yes" 634179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 635179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 636179cf400SAndreas Färber;; 637fb065187Sbellard*) 6380c58ac1cSmalc audio_drv_list="oss" 639b8e59f18Smalc audio_possible_drivers="oss alsa sdl esd pa" 6405327cf48Sbellard linux="yes" 641831b7825Sths linux_user="yes" 642af2be207SJan Kiszka kvm="yes" 643af2be207SJan Kiszka vhost_net="yes" 6445e9be92dSNicholas Bellinger vhost_scsi="yes" 645c72b26ecSRichard Henderson if [ "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "x32" ] ; then 646c2de5c91Smalc audio_possible_drivers="$audio_possible_drivers fmod" 647c9ec1fe4Sbellard fi 648a585140dSAlexey Kardashevskiy QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES" 649fb065187Sbellard;; 6507d13299dSbellardesac 6517d13299dSbellard 6527d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 653b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 65484778508Sblueswir1 bsd_user="yes" 6557d3505c5Sbellard fi 65608de3949SAndreas Färberfi 6577d3505c5Sbellard 6580db4a067SPaolo Bonzini: ${make=${MAKE-make}} 6590db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 66052510f8bSStefan Weil: ${python=${PYTHON-python}} 661e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 6620db4a067SPaolo Bonzini 6633c4a4d0dSPeter Maydell# Default objcc to clang if available, otherwise use CC 6643c4a4d0dSPeter Maydellif has clang; then 6653c4a4d0dSPeter Maydell objcc=clang 6663c4a4d0dSPeter Maydellelse 6673c4a4d0dSPeter Maydell objcc="$cc" 6683c4a4d0dSPeter Maydellfi 6693c4a4d0dSPeter Maydell 6703457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 6713457a3f8SJuan Quintela EXESUF=".exe" 67217969268SFam Zheng DSOSUF=".dll" 673a558ee17SJuan Quintela QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" 674e94a7936SStefan Weil # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) 675e94a7936SStefan Weil QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" 676f7cf5d5bSStefan Weil LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" 677f7cf5d5bSStefan Weilcat > $TMPC << EOF 678f7cf5d5bSStefan Weilint main(void) { return 0; } 679f7cf5d5bSStefan WeilEOF 680f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 681f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 682f7cf5d5bSStefan Weil fi 683c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 684683035deSPaolo Bonzini mandir="\${prefix}" 685528ae5b8SEduardo Habkost datadir="\${prefix}" 686850da188SEduardo Habkost qemu_docdir="\${prefix}" 687683035deSPaolo Bonzini bindir="\${prefix}" 688683035deSPaolo Bonzini sysconfdir="\${prefix}" 6895a699bbbSLaszlo Ersek local_statedir= 690683035deSPaolo Bonzini confsuffix="" 691368542b8SStefan Hajnoczi libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" 6923457a3f8SJuan Quintelafi 6933457a3f8SJuan Quintela 694487fefdbSAnthony Liguoriwerror="" 69585aa5189Sbellard 6967d13299dSbellardfor opt do 697a46e4035Spbrook optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 6987d13299dSbellard case "$opt" in 6992efc3265Sbellard --help|-h) show_help=yes 7002efc3265Sbellard ;; 70199123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 70299123e13SMike Frysinger ;; 703b1a550a0Spbrook --prefix=*) prefix="$optarg" 7047d13299dSbellard ;; 705b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 70632ce6337Sbellard ;; 707ca4deeb1SPaolo Bonzini --source-path=*) 7087d13299dSbellard ;; 709ac0df51dSaliguori --cross-prefix=*) 7107d13299dSbellard ;; 711ac0df51dSaliguori --cc=*) 7127d13299dSbellard ;; 713b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 71483469015Sbellard ;; 71583f73fceSTomoki Sekiyama --cxx=*) 71683f73fceSTomoki Sekiyama ;; 717e007dbecSMichael S. Tsirkin --iasl=*) iasl="$optarg" 718e007dbecSMichael S. Tsirkin ;; 7193c4a4d0dSPeter Maydell --objcc=*) objcc="$optarg" 7203c4a4d0dSPeter Maydell ;; 721b1a550a0Spbrook --make=*) make="$optarg" 7227d13299dSbellard ;; 7236a882643Spbrook --install=*) install="$optarg" 7246a882643Spbrook ;; 725c886edfbSBlue Swirl --python=*) python="$optarg" 726c886edfbSBlue Swirl ;; 7271d728c39SBlue Swirl --gcov=*) gcov_tool="$optarg" 7281d728c39SBlue Swirl ;; 729e2d8830eSBrad --smbd=*) smbd="$optarg" 730e2d8830eSBrad ;; 731e2a2ed06SJuan Quintela --extra-cflags=*) 7327d13299dSbellard ;; 733e2a2ed06SJuan Quintela --extra-ldflags=*) 7347d13299dSbellard ;; 7355bc62e01SGerd Hoffmann --enable-debug-info) 7365bc62e01SGerd Hoffmann ;; 7375bc62e01SGerd Hoffmann --disable-debug-info) 7385bc62e01SGerd Hoffmann ;; 73917969268SFam Zheng --enable-modules) 74017969268SFam Zheng modules="yes" 74117969268SFam Zheng ;; 7422ff6b91eSJuan Quintela --cpu=*) 7437d13299dSbellard ;; 744b1a550a0Spbrook --target-list=*) target_list="$optarg" 745de83cd02Sbellard ;; 74674242e0fSPaolo Bonzini --enable-trace-backend=*) trace_backend="$optarg" 74794a420b1SStefan Hajnoczi ;; 74874242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 7499410b56cSPrerna Saxena ;; 7507d13299dSbellard --enable-gprof) gprof="yes" 7517d13299dSbellard ;; 7521d728c39SBlue Swirl --enable-gcov) gcov="yes" 7531d728c39SBlue Swirl ;; 75479427693SLoïc Minier --static) 75579427693SLoïc Minier static="yes" 75679427693SLoïc Minier LDFLAGS="-static $LDFLAGS" 75717884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 75843ce4dfeSbellard ;; 7590b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 7600b24e75fSPaolo Bonzini ;; 7610b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 7620b24e75fSPaolo Bonzini ;; 7633aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 7643aa5d2beSAlon Levy ;; 7658bf188aaSMichael Tokarev --libexecdir=*) libexecdir="$optarg" 7668bf188aaSMichael Tokarev ;; 7670f94d6daSAlon Levy --includedir=*) includedir="$optarg" 7680f94d6daSAlon Levy ;; 769528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 7700b24e75fSPaolo Bonzini ;; 771023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 772023d3d67SEduardo Habkost ;; 773850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 7740b24e75fSPaolo Bonzini ;; 775ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 77607381cc1SAnthony Liguori ;; 777785c23aeSLuiz Capitulino --localstatedir=*) local_statedir="$optarg" 778785c23aeSLuiz Capitulino ;; 779785c23aeSLuiz Capitulino --sbindir=*|--sharedstatedir=*|\ 780023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 781023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 782023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 783023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 784023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 785023ddd74SMax Filippov # lots of directory switches by default. 786023ddd74SMax Filippov ;; 787e2134eb9SGerd Hoffmann --with-system-pixman) pixman="system" 788e2134eb9SGerd Hoffmann ;; 789e2134eb9SGerd Hoffmann --without-system-pixman) pixman="internal" 790e2134eb9SGerd Hoffmann ;; 79174880fe2SRobert Schiele --without-pixman) pixman="none" 79274880fe2SRobert Schiele ;; 79397a847bcSbellard --disable-sdl) sdl="no" 79497a847bcSbellard ;; 795c4198157SJuan Quintela --enable-sdl) sdl="yes" 796c4198157SJuan Quintela ;; 79747c03744SDave Airlie --with-sdlabi=*) sdlabi="$optarg" 79847c03744SDave Airlie ;; 7993556c233SPaolo Bonzini --disable-qom-cast-debug) qom_cast_debug="no" 8003556c233SPaolo Bonzini ;; 8013556c233SPaolo Bonzini --enable-qom-cast-debug) qom_cast_debug="yes" 8023556c233SPaolo Bonzini ;; 803983eef5aSMeador Inge --disable-virtfs) virtfs="no" 804983eef5aSMeador Inge ;; 805983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 806983eef5aSMeador Inge ;; 807821601eaSJes Sorensen --disable-vnc) vnc="no" 808821601eaSJes Sorensen ;; 809821601eaSJes Sorensen --enable-vnc) vnc="yes" 810821601eaSJes Sorensen ;; 811b1a550a0Spbrook --fmod-lib=*) fmod_lib="$optarg" 812102a52e4Sbellard ;; 813c2de5c91Smalc --fmod-inc=*) fmod_inc="$optarg" 814c2de5c91Smalc ;; 8152f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 8162f6a1ab0Sblueswir1 ;; 8170c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 8180c58ac1cSmalc ;; 819b64ec4e4SFam Zheng --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 820b64ec4e4SFam Zheng ;; 821b64ec4e4SFam Zheng --block-drv-ro-whitelist=*) block_drv_ro_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 822eb852011SMarkus Armbruster ;; 823f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 824f8393946Saurel32 ;; 825f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 826f8393946Saurel32 ;; 827f3d08ee6SPaul Brook --enable-debug) 828f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 829f3d08ee6SPaul Brook debug_tcg="yes" 830f3d08ee6SPaul Brook debug="yes" 831f3d08ee6SPaul Brook strip_opt="no" 832f3d08ee6SPaul Brook ;; 83303b4fe7dSaliguori --enable-sparse) sparse="yes" 83403b4fe7dSaliguori ;; 83503b4fe7dSaliguori --disable-sparse) sparse="no" 83603b4fe7dSaliguori ;; 8371625af87Saliguori --disable-strip) strip_opt="no" 8381625af87Saliguori ;; 8398d5d2d4cSths --disable-vnc-tls) vnc_tls="no" 8408d5d2d4cSths ;; 8411be10ad2SJuan Quintela --enable-vnc-tls) vnc_tls="yes" 8421be10ad2SJuan Quintela ;; 8432f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 8442f9606b3Saliguori ;; 845ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 846ea784e3bSJuan Quintela ;; 8472f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 8482f6f5c7aSCorentin Chary ;; 8492f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 8502f6f5c7aSCorentin Chary ;; 851efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 852efe556adSCorentin Chary ;; 853efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 854efe556adSCorentin Chary ;; 8557536ee4bSTim Hardeck --disable-vnc-ws) vnc_ws="no" 8567536ee4bSTim Hardeck ;; 8577536ee4bSTim Hardeck --enable-vnc-ws) vnc_ws="yes" 8587536ee4bSTim Hardeck ;; 859443f1376Sbellard --disable-slirp) slirp="no" 860c20709aaSbellard ;; 861ee682d27SStefan Weil --disable-uuid) uuid="no" 862ee682d27SStefan Weil ;; 863ee682d27SStefan Weil --enable-uuid) uuid="yes" 864ee682d27SStefan Weil ;; 865e0e6c8c0Saliguori --disable-vde) vde="no" 8668a16d273Sths ;; 867dfb278bdSJuan Quintela --enable-vde) vde="yes" 868dfb278bdSJuan Quintela ;; 86958952137SVincenzo Maffione --disable-netmap) netmap="no" 87058952137SVincenzo Maffione ;; 87158952137SVincenzo Maffione --enable-netmap) netmap="yes" 87258952137SVincenzo Maffione ;; 873e37630caSaliguori --disable-xen) xen="no" 874e37630caSaliguori ;; 875fc321b4bSJuan Quintela --enable-xen) xen="yes" 876fc321b4bSJuan Quintela ;; 877eb6fda0fSAnthony PERARD --disable-xen-pci-passthrough) xen_pci_passthrough="no" 878eb6fda0fSAnthony PERARD ;; 879eb6fda0fSAnthony PERARD --enable-xen-pci-passthrough) xen_pci_passthrough="yes" 880eb6fda0fSAnthony PERARD ;; 8812e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 8822e4d9fb1Saurel32 ;; 8834ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 8844ffcedb6SJuan Quintela ;; 885fb599c9aSbalrog --disable-bluez) bluez="no" 886fb599c9aSbalrog ;; 887a20a6f46SJuan Quintela --enable-bluez) bluez="yes" 888a20a6f46SJuan Quintela ;; 8897ba1e619Saliguori --disable-kvm) kvm="no" 8907ba1e619Saliguori ;; 891b31a0277SJuan Quintela --enable-kvm) kvm="yes" 892b31a0277SJuan Quintela ;; 8939195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 8949195b2c2SStefan Weil ;; 8959195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 8969195b2c2SStefan Weil ;; 89747e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 89847e98658SCorey Bryant ;; 89947e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 90047e98658SCorey Bryant ;; 901cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 902cd4ec0b4SGerd Hoffmann ;; 903cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 904cd4ec0b4SGerd Hoffmann ;; 905c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 906c589b249SRonnie Sahlberg ;; 907c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 908c589b249SRonnie Sahlberg ;; 9096542aa9cSPeter Lieven --disable-libnfs) libnfs="no" 9106542aa9cSPeter Lieven ;; 9116542aa9cSPeter Lieven --enable-libnfs) libnfs="yes" 9126542aa9cSPeter Lieven ;; 91305c2a3e7Sbellard --enable-profiler) profiler="yes" 91405c2a3e7Sbellard ;; 91514821030SPavel Borzenkov --disable-cocoa) cocoa="no" 91614821030SPavel Borzenkov ;; 917c2de5c91Smalc --enable-cocoa) 918c2de5c91Smalc cocoa="yes" ; 919c2de5c91Smalc sdl="no" ; 920c2de5c91Smalc audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" 9215b0753e0Sbellard ;; 922cad25d69Spbrook --disable-system) softmmu="no" 9230a8e90f4Spbrook ;; 924cad25d69Spbrook --enable-system) softmmu="yes" 9250a8e90f4Spbrook ;; 9260953a80fSZachary Amsden --disable-user) 9270953a80fSZachary Amsden linux_user="no" ; 9280953a80fSZachary Amsden bsd_user="no" ; 9290953a80fSZachary Amsden ;; 9300953a80fSZachary Amsden --enable-user) ;; 931831b7825Sths --disable-linux-user) linux_user="no" 9320a8e90f4Spbrook ;; 933831b7825Sths --enable-linux-user) linux_user="yes" 934831b7825Sths ;; 93584778508Sblueswir1 --disable-bsd-user) bsd_user="no" 93684778508Sblueswir1 ;; 93784778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 93884778508Sblueswir1 ;; 939379f6698SPaul Brook --enable-guest-base) guest_base="yes" 940379f6698SPaul Brook ;; 941379f6698SPaul Brook --disable-guest-base) guest_base="no" 942379f6698SPaul Brook ;; 94340d6444eSAvi Kivity --enable-pie) pie="yes" 94434005a00SKirill A. Shutemov ;; 94540d6444eSAvi Kivity --disable-pie) pie="no" 94634005a00SKirill A. Shutemov ;; 947c5937220Spbrook --enable-uname-release=*) uname_release="$optarg" 948c5937220Spbrook ;; 94985aa5189Sbellard --enable-werror) werror="yes" 95085aa5189Sbellard ;; 95185aa5189Sbellard --disable-werror) werror="no" 95285aa5189Sbellard ;; 9534d3b6f6eSbalrog --disable-curses) curses="no" 9544d3b6f6eSbalrog ;; 955c584a6d0SJuan Quintela --enable-curses) curses="yes" 956c584a6d0SJuan Quintela ;; 957769ce76dSAlexander Graf --disable-curl) curl="no" 958769ce76dSAlexander Graf ;; 959788c8196SJuan Quintela --enable-curl) curl="yes" 960788c8196SJuan Quintela ;; 9612df87df7SJuan Quintela --disable-fdt) fdt="no" 9622df87df7SJuan Quintela ;; 9632df87df7SJuan Quintela --enable-fdt) fdt="yes" 9642df87df7SJuan Quintela ;; 9655c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 9665c6c3a6cSChristoph Hellwig ;; 9675c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 9685c6c3a6cSChristoph Hellwig ;; 969758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 970758e8e38SVenkateswararao Jujjuri (JV) ;; 971758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 972758e8e38SVenkateswararao Jujjuri (JV) ;; 97377755340Sths --disable-blobs) blobs="no" 97477755340Sths ;; 9754a19f1ecSpbrook --with-pkgversion=*) pkgversion=" ($optarg)" 9764a19f1ecSpbrook ;; 977519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 978519175a2SAlex Barcelo ;; 97970c60c08SStefan Hajnoczi --disable-coroutine-pool) coroutine_pool="no" 98070c60c08SStefan Hajnoczi ;; 98170c60c08SStefan Hajnoczi --enable-coroutine-pool) coroutine_pool="yes" 98270c60c08SStefan Hajnoczi ;; 983a25dba17SJuan Quintela --disable-docs) docs="no" 98470ec5dc0SAnthony Liguori ;; 985a25dba17SJuan Quintela --enable-docs) docs="yes" 98683a3ab8bSJuan Quintela ;; 987d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 988d5970055SMichael S. Tsirkin ;; 989d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 990d5970055SMichael S. Tsirkin ;; 9915e9be92dSNicholas Bellinger --disable-vhost-scsi) vhost_scsi="no" 9925e9be92dSNicholas Bellinger ;; 9935e9be92dSNicholas Bellinger --enable-vhost-scsi) vhost_scsi="yes" 9945e9be92dSNicholas Bellinger ;; 995b1e5fff4SMichael Walle --disable-glx) glx="no" 99620ff075bSMichael Walle ;; 997b1e5fff4SMichael Walle --enable-glx) glx="yes" 99820ff075bSMichael Walle ;; 999f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 1000f27aaf4bSChristian Brunner ;; 1001f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 1002f27aaf4bSChristian Brunner ;; 10038c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 10048c84cf11SSergei Trofimovich ;; 10058c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 10068c84cf11SSergei Trofimovich ;; 1007111a38b0SRobert Relyea --disable-smartcard-nss) smartcard_nss="no" 1008111a38b0SRobert Relyea ;; 1009111a38b0SRobert Relyea --enable-smartcard-nss) smartcard_nss="yes" 1010111a38b0SRobert Relyea ;; 10112b2325ffSGerd Hoffmann --disable-libusb) libusb="no" 10122b2325ffSGerd Hoffmann ;; 10132b2325ffSGerd Hoffmann --enable-libusb) libusb="yes" 10142b2325ffSGerd Hoffmann ;; 101569354a83SHans de Goede --disable-usb-redir) usb_redir="no" 101669354a83SHans de Goede ;; 101769354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 101869354a83SHans de Goede ;; 10191ece9905SAlon Levy --disable-zlib-test) zlib="no" 10201ece9905SAlon Levy ;; 1021607dacd0Sqiaonuohan --enable-lzo) lzo="yes" 1022607dacd0Sqiaonuohan ;; 1023607dacd0Sqiaonuohan --enable-snappy) snappy="yes" 1024607dacd0Sqiaonuohan ;; 1025d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 1026d138cee9SMichael Roth ;; 1027d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 1028d138cee9SMichael Roth ;; 1029d9840e25STomoki Sekiyama --with-vss-sdk) vss_win32_sdk="" 1030d9840e25STomoki Sekiyama ;; 1031d9840e25STomoki Sekiyama --with-vss-sdk=*) vss_win32_sdk="$optarg" 1032d9840e25STomoki Sekiyama ;; 1033d9840e25STomoki Sekiyama --without-vss-sdk) vss_win32_sdk="no" 1034d9840e25STomoki Sekiyama ;; 1035d9840e25STomoki Sekiyama --with-win-sdk) win_sdk="" 1036d9840e25STomoki Sekiyama ;; 1037d9840e25STomoki Sekiyama --with-win-sdk=*) win_sdk="$optarg" 1038d9840e25STomoki Sekiyama ;; 1039d9840e25STomoki Sekiyama --without-win-sdk) win_sdk="no" 1040d9840e25STomoki Sekiyama ;; 10414b1c11fdSDaniel P. Berrange --enable-tools) want_tools="yes" 10424b1c11fdSDaniel P. Berrange ;; 10434b1c11fdSDaniel P. Berrange --disable-tools) want_tools="no" 10444b1c11fdSDaniel P. Berrange ;; 1045f794573eSEduardo Otubo --enable-seccomp) seccomp="yes" 1046f794573eSEduardo Otubo ;; 1047f794573eSEduardo Otubo --disable-seccomp) seccomp="no" 1048f794573eSEduardo Otubo ;; 1049eb100396SBharata B Rao --disable-glusterfs) glusterfs="no" 1050eb100396SBharata B Rao ;; 1051eb100396SBharata B Rao --enable-glusterfs) glusterfs="yes" 1052eb100396SBharata B Rao ;; 1053583f6e7bSStefan Hajnoczi --disable-virtio-blk-data-plane) virtio_blk_data_plane="no" 1054583f6e7bSStefan Hajnoczi ;; 1055583f6e7bSStefan Hajnoczi --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes" 1056583f6e7bSStefan Hajnoczi ;; 1057a4ccabcfSAnthony Liguori --disable-gtk) gtk="no" 1058a4ccabcfSAnthony Liguori ;; 1059a4ccabcfSAnthony Liguori --enable-gtk) gtk="yes" 1060a4ccabcfSAnthony Liguori ;; 10612da776dbSMichael R. Hines --enable-rdma) rdma="yes" 10622da776dbSMichael R. Hines ;; 10632da776dbSMichael R. Hines --disable-rdma) rdma="no" 10642da776dbSMichael R. Hines ;; 1065528de90aSDaniel P. Berrange --with-gtkabi=*) gtkabi="$optarg" 1066528de90aSDaniel P. Berrange ;; 1067*bbbf9bfbSStefan Weil --disable-vte) vte="no" 1068*bbbf9bfbSStefan Weil ;; 1069*bbbf9bfbSStefan Weil --enable-vte) vte="yes" 1070*bbbf9bfbSStefan Weil ;; 1071ab214c29SStefan Berger --enable-tpm) tpm="yes" 1072ab214c29SStefan Berger ;; 10730a12ec87SRichard W.M. Jones --disable-libssh2) libssh2="no" 10740a12ec87SRichard W.M. Jones ;; 10750a12ec87SRichard W.M. Jones --enable-libssh2) libssh2="yes" 10760a12ec87SRichard W.M. Jones ;; 10774f18b782SJeff Cody --enable-vhdx) vhdx="yes" 10784f18b782SJeff Cody ;; 10794f18b782SJeff Cody --disable-vhdx) vhdx="no" 10804f18b782SJeff Cody ;; 108195c6bff3SBenoît Canet --disable-quorum) quorum="no" 108295c6bff3SBenoît Canet ;; 108395c6bff3SBenoît Canet --enable-quorum) quorum="yes" 108495c6bff3SBenoît Canet ;; 10857f1559c6Sbalrog *) echo "ERROR: unknown option $opt"; show_help="yes" 10867f1559c6Sbalrog ;; 10877d13299dSbellard esac 10887d13299dSbellarddone 10897d13299dSbellard 1090f6f0b7d9SStefan Weilif ! has $python; then 1091f6f0b7d9SStefan Weil error_exit "Python not found. Use --python=/path/to/python" 1092f6f0b7d9SStefan Weilfi 1093f6f0b7d9SStefan Weil 1094f6f0b7d9SStefan Weil# Note that if the Python conditional here evaluates True we will exit 1095f6f0b7d9SStefan Weil# with status 1 which is a shell 'false' value. 1096f6f0b7d9SStefan Weilif ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then 1097f6f0b7d9SStefan Weil error_exit "Cannot use '$python', Python 2.4 or later is required." \ 1098f6f0b7d9SStefan Weil "Note that Python 3 or later is not yet supported." \ 1099f6f0b7d9SStefan Weil "Use --python=/path/to/python to specify a supported Python." 1100f6f0b7d9SStefan Weilfi 1101f6f0b7d9SStefan Weil 1102f6f0b7d9SStefan Weil# The -B switch was added in Python 2.6. 1103f6f0b7d9SStefan Weil# If it is supplied, compiled files are not written. 1104f6f0b7d9SStefan Weil# Use it for Python versions which support it. 1105f6f0b7d9SStefan Weilif $python -B -c 'import sys; sys.exit(0)' 2>/dev/null; then 1106f6f0b7d9SStefan Weil python="$python -B" 1107f6f0b7d9SStefan Weilfi 1108f6f0b7d9SStefan Weil 110940293e58Sbellardcase "$cpu" in 1110e3608d66SRichard Henderson ppc) 1111e3608d66SRichard Henderson CPU_CFLAGS="-m32" 1112e3608d66SRichard Henderson LDFLAGS="-m32 $LDFLAGS" 1113e3608d66SRichard Henderson ;; 1114e3608d66SRichard Henderson ppc64) 1115e3608d66SRichard Henderson CPU_CFLAGS="-m64" 1116e3608d66SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 1117e3608d66SRichard Henderson ;; 11189b9c37c3SRichard Henderson sparc) 11190c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 112079f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32 -mcpu=ultrasparc" 11213142255cSblueswir1 ;; 1122ed968ff1SJuan Quintela sparc64) 11230c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 112479f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -mcpu=ultrasparc" 11253142255cSblueswir1 ;; 112676d83bdeSths s390) 112779f3b12fSPeter Crosthwaite CPU_CFLAGS="-m31 -march=z990" 112828d7cc49SRichard Henderson LDFLAGS="-m31 $LDFLAGS" 112928d7cc49SRichard Henderson ;; 113028d7cc49SRichard Henderson s390x) 113179f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -march=z990" 113228d7cc49SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 113376d83bdeSths ;; 113440293e58Sbellard i386) 113579f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32" 11360c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 11372b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 113840293e58Sbellard ;; 113940293e58Sbellard x86_64) 114079f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64" 11410c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 11422b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 1143379f6698SPaul Brook ;; 1144c72b26ecSRichard Henderson x32) 1145c72b26ecSRichard Henderson CPU_CFLAGS="-mx32" 1146c72b26ecSRichard Henderson LDFLAGS="-mx32 $LDFLAGS" 1147c72b26ecSRichard Henderson cc_i386='$(CC) -m32' 1148c72b26ecSRichard Henderson ;; 114930163d89SPeter Maydell # No special flags required for other host CPUs 11503142255cSblueswir1esac 11513142255cSblueswir1 115279f3b12fSPeter CrosthwaiteQEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" 115379f3b12fSPeter CrosthwaiteEXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS" 115479f3b12fSPeter Crosthwaite 115560e0df25SPeter Maydelldefault_target_list="" 115660e0df25SPeter Maydell 11576e92f823SPeter Maydellmak_wilds="" 11586e92f823SPeter Maydell 115960e0df25SPeter Maydellif [ "$softmmu" = "yes" ]; then 11606e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" 116160e0df25SPeter Maydellfi 116260e0df25SPeter Maydellif [ "$linux_user" = "yes" ]; then 11636e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" 116460e0df25SPeter Maydellfi 116560e0df25SPeter Maydellif [ "$bsd_user" = "yes" ]; then 11666e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" 116760e0df25SPeter Maydellfi 116860e0df25SPeter Maydell 11696e92f823SPeter Maydellfor config in $mak_wilds; do 11706e92f823SPeter Maydell default_target_list="${default_target_list} $(basename "$config" .mak)" 11716e92f823SPeter Maydelldone 11726e92f823SPeter Maydell 1173af5db58eSpbrookif test x"$show_help" = x"yes" ; then 1174af5db58eSpbrookcat << EOF 1175af5db58eSpbrook 1176af5db58eSpbrookUsage: configure [options] 1177af5db58eSpbrookOptions: [defaults in brackets after descriptions] 1178af5db58eSpbrook 117908fb77edSStefan WeilStandard options: 118008fb77edSStefan Weil --help print this message 118108fb77edSStefan Weil --prefix=PREFIX install in PREFIX [$prefix] 118208fb77edSStefan Weil --interp-prefix=PREFIX where to find shared libraries, etc. 118308fb77edSStefan Weil use %M for cpu name [$interp_prefix] 118408fb77edSStefan Weil --target-list=LIST set target list (default: build everything) 118508fb77edSStefan Weil$(echo Available targets: $default_target_list | \ 118608fb77edSStefan Weil fold -s -w 53 | sed -e 's/^/ /') 118708fb77edSStefan Weil 118808fb77edSStefan WeilAdvanced options (experts only): 118908fb77edSStefan Weil --source-path=PATH path of source code [$source_path] 119008fb77edSStefan Weil --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] 119108fb77edSStefan Weil --cc=CC use C compiler CC [$cc] 119208fb77edSStefan Weil --iasl=IASL use ACPI compiler IASL [$iasl] 119308fb77edSStefan Weil --host-cc=CC use C compiler CC [$host_cc] for code run at 119408fb77edSStefan Weil build time 119508fb77edSStefan Weil --cxx=CXX use C++ compiler CXX [$cxx] 119608fb77edSStefan Weil --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] 119708fb77edSStefan Weil --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS 119808fb77edSStefan Weil --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS 119908fb77edSStefan Weil --make=MAKE use specified make [$make] 120008fb77edSStefan Weil --install=INSTALL use specified install [$install] 120108fb77edSStefan Weil --python=PYTHON use specified python [$python] 120208fb77edSStefan Weil --smbd=SMBD use specified smbd [$smbd] 120308fb77edSStefan Weil --static enable static build [$static] 120408fb77edSStefan Weil --mandir=PATH install man pages in PATH 120508fb77edSStefan Weil --datadir=PATH install firmware in PATH$confsuffix 120608fb77edSStefan Weil --docdir=PATH install documentation in PATH$confsuffix 120708fb77edSStefan Weil --bindir=PATH install binaries in PATH 120808fb77edSStefan Weil --libdir=PATH install libraries in PATH 120908fb77edSStefan Weil --sysconfdir=PATH install config in PATH$confsuffix 121008fb77edSStefan Weil --localstatedir=PATH install local state in PATH (set at runtime on win32) 1211e26110cfSFam Zheng --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] 121217969268SFam Zheng --enable-modules enable modules support 121308fb77edSStefan Weil --enable-debug-tcg enable TCG debugging 121408fb77edSStefan Weil --disable-debug-tcg disable TCG debugging (default) 121508fb77edSStefan Weil --enable-debug-info enable debugging information (default) 121608fb77edSStefan Weil --disable-debug-info disable debugging information 121708fb77edSStefan Weil --enable-debug enable common debug build options 121808fb77edSStefan Weil --enable-sparse enable sparse checker 121908fb77edSStefan Weil --disable-sparse disable sparse checker (default) 122008fb77edSStefan Weil --disable-strip disable stripping binaries 122108fb77edSStefan Weil --disable-werror disable compilation abort on warning 122208fb77edSStefan Weil --disable-sdl disable SDL 122308fb77edSStefan Weil --enable-sdl enable SDL 122447c03744SDave Airlie --with-sdlabi select preferred SDL ABI 1.2 or 2.0 122508fb77edSStefan Weil --disable-gtk disable gtk UI 122608fb77edSStefan Weil --enable-gtk enable gtk UI 122708fb77edSStefan Weil --disable-virtfs disable VirtFS 122808fb77edSStefan Weil --enable-virtfs enable VirtFS 122908fb77edSStefan Weil --disable-vnc disable VNC 123008fb77edSStefan Weil --enable-vnc enable VNC 123108fb77edSStefan Weil --disable-cocoa disable Cocoa (Mac OS X only) 123208fb77edSStefan Weil --enable-cocoa enable Cocoa (default on Mac OS X) 123308fb77edSStefan Weil --audio-drv-list=LIST set audio drivers list: 123408fb77edSStefan Weil Available drivers: $audio_possible_drivers 123508fb77edSStefan Weil --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L 123608fb77edSStefan Weil --block-drv-rw-whitelist=L 123708fb77edSStefan Weil set block driver read-write whitelist 123808fb77edSStefan Weil (affects only QEMU, not qemu-img) 123908fb77edSStefan Weil --block-drv-ro-whitelist=L 124008fb77edSStefan Weil set block driver read-only whitelist 124108fb77edSStefan Weil (affects only QEMU, not qemu-img) 124208fb77edSStefan Weil --disable-xen disable xen backend driver support 124308fb77edSStefan Weil --enable-xen enable xen backend driver support 124408fb77edSStefan Weil --disable-xen-pci-passthrough 124508fb77edSStefan Weil --enable-xen-pci-passthrough 124608fb77edSStefan Weil --disable-brlapi disable BrlAPI 124708fb77edSStefan Weil --enable-brlapi enable BrlAPI 124808fb77edSStefan Weil --disable-vnc-tls disable TLS encryption for VNC server 124908fb77edSStefan Weil --enable-vnc-tls enable TLS encryption for VNC server 125008fb77edSStefan Weil --disable-vnc-sasl disable SASL encryption for VNC server 125108fb77edSStefan Weil --enable-vnc-sasl enable SASL encryption for VNC server 125208fb77edSStefan Weil --disable-vnc-jpeg disable JPEG lossy compression for VNC server 125308fb77edSStefan Weil --enable-vnc-jpeg enable JPEG lossy compression for VNC server 125408fb77edSStefan Weil --disable-vnc-png disable PNG compression for VNC server (default) 125508fb77edSStefan Weil --enable-vnc-png enable PNG compression for VNC server 125608fb77edSStefan Weil --disable-vnc-ws disable Websockets support for VNC server 125708fb77edSStefan Weil --enable-vnc-ws enable Websockets support for VNC server 125808fb77edSStefan Weil --disable-curses disable curses output 125908fb77edSStefan Weil --enable-curses enable curses output 126008fb77edSStefan Weil --disable-curl disable curl connectivity 126108fb77edSStefan Weil --enable-curl enable curl connectivity 126208fb77edSStefan Weil --disable-fdt disable fdt device tree 126308fb77edSStefan Weil --enable-fdt enable fdt device tree 126408fb77edSStefan Weil --disable-bluez disable bluez stack connectivity 126508fb77edSStefan Weil --enable-bluez enable bluez stack connectivity 126608fb77edSStefan Weil --disable-slirp disable SLIRP userspace network connectivity 126708fb77edSStefan Weil --disable-kvm disable KVM acceleration support 126808fb77edSStefan Weil --enable-kvm enable KVM acceleration support 126908fb77edSStefan Weil --disable-rdma disable RDMA-based migration support 127008fb77edSStefan Weil --enable-rdma enable RDMA-based migration support 127108fb77edSStefan Weil --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) 127208fb77edSStefan Weil --enable-system enable all system emulation targets 127308fb77edSStefan Weil --disable-system disable all system emulation targets 127408fb77edSStefan Weil --enable-user enable supported user emulation targets 127508fb77edSStefan Weil --disable-user disable all user emulation targets 127608fb77edSStefan Weil --enable-linux-user enable all linux usermode emulation targets 127708fb77edSStefan Weil --disable-linux-user disable all linux usermode emulation targets 127808fb77edSStefan Weil --enable-bsd-user enable all BSD usermode emulation targets 127908fb77edSStefan Weil --disable-bsd-user disable all BSD usermode emulation targets 128008fb77edSStefan Weil --enable-guest-base enable GUEST_BASE support for usermode 128108fb77edSStefan Weil emulation targets 128208fb77edSStefan Weil --disable-guest-base disable GUEST_BASE support 128308fb77edSStefan Weil --enable-pie build Position Independent Executables 128408fb77edSStefan Weil --disable-pie do not build Position Independent Executables 128508fb77edSStefan Weil --fmod-lib path to FMOD library 128608fb77edSStefan Weil --fmod-inc path to FMOD includes 128708fb77edSStefan Weil --oss-lib path to OSS library 128808fb77edSStefan Weil --enable-uname-release=R Return R for uname -r in usermode emulation 128908fb77edSStefan Weil --cpu=CPU Build for host CPU [$cpu] 129008fb77edSStefan Weil --disable-uuid disable uuid support 129108fb77edSStefan Weil --enable-uuid enable uuid support 129208fb77edSStefan Weil --disable-vde disable support for vde network 129308fb77edSStefan Weil --enable-vde enable support for vde network 129408fb77edSStefan Weil --disable-netmap disable support for netmap network 129508fb77edSStefan Weil --enable-netmap enable support for netmap network 129608fb77edSStefan Weil --disable-linux-aio disable Linux AIO support 129708fb77edSStefan Weil --enable-linux-aio enable Linux AIO support 129808fb77edSStefan Weil --disable-cap-ng disable libcap-ng support 129908fb77edSStefan Weil --enable-cap-ng enable libcap-ng support 130008fb77edSStefan Weil --disable-attr disables attr and xattr support 130108fb77edSStefan Weil --enable-attr enable attr and xattr support 130208fb77edSStefan Weil --disable-blobs disable installing provided firmware blobs 130308fb77edSStefan Weil --enable-docs enable documentation build 130408fb77edSStefan Weil --disable-docs disable documentation build 130508fb77edSStefan Weil --disable-vhost-net disable vhost-net acceleration support 130608fb77edSStefan Weil --enable-vhost-net enable vhost-net acceleration support 130708fb77edSStefan Weil --enable-trace-backend=B Set trace backend 130808fb77edSStefan Weil Available backends: $($python $source_path/scripts/tracetool.py --list-backends) 130908fb77edSStefan Weil --with-trace-file=NAME Full PATH,NAME of file to store traces 131008fb77edSStefan Weil Default:trace-<pid> 131108fb77edSStefan Weil --disable-spice disable spice 131208fb77edSStefan Weil --enable-spice enable spice 131308fb77edSStefan Weil --enable-rbd enable building the rados block device (rbd) 131408fb77edSStefan Weil --disable-libiscsi disable iscsi support 131508fb77edSStefan Weil --enable-libiscsi enable iscsi support 13166542aa9cSPeter Lieven --disable-libnfs disable nfs support 13176542aa9cSPeter Lieven --enable-libnfs enable nfs support 131808fb77edSStefan Weil --disable-smartcard-nss disable smartcard nss support 131908fb77edSStefan Weil --enable-smartcard-nss enable smartcard nss support 132008fb77edSStefan Weil --disable-libusb disable libusb (for usb passthrough) 132108fb77edSStefan Weil --enable-libusb enable libusb (for usb passthrough) 132208fb77edSStefan Weil --disable-usb-redir disable usb network redirection support 132308fb77edSStefan Weil --enable-usb-redir enable usb network redirection support 1324607dacd0Sqiaonuohan --enable-lzo enable the support of lzo compression library 1325607dacd0Sqiaonuohan --enable-snappy enable the support of snappy compression library 132608fb77edSStefan Weil --disable-guest-agent disable building of the QEMU Guest Agent 132708fb77edSStefan Weil --enable-guest-agent enable building of the QEMU Guest Agent 132808fb77edSStefan Weil --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent 132908fb77edSStefan Weil --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) 133008fb77edSStefan Weil --disable-seccomp disable seccomp support 133108fb77edSStefan Weil --enable-seccomp enables seccomp support 133208fb77edSStefan Weil --with-coroutine=BACKEND coroutine backend. Supported options: 133308fb77edSStefan Weil gthread, ucontext, sigaltstack, windows 133408fb77edSStefan Weil --disable-coroutine-pool disable coroutine freelist (worse performance) 133508fb77edSStefan Weil --enable-coroutine-pool enable coroutine freelist (better performance) 133608fb77edSStefan Weil --enable-glusterfs enable GlusterFS backend 133708fb77edSStefan Weil --disable-glusterfs disable GlusterFS backend 133808fb77edSStefan Weil --enable-gcov enable test coverage analysis with gcov 133908fb77edSStefan Weil --gcov=GCOV use specified gcov [$gcov_tool] 134008fb77edSStefan Weil --enable-tpm enable TPM support 134108fb77edSStefan Weil --disable-libssh2 disable ssh block device support 134208fb77edSStefan Weil --enable-libssh2 enable ssh block device support 134308fb77edSStefan Weil --disable-vhdx disables support for the Microsoft VHDX image format 134408fb77edSStefan Weil --enable-vhdx enable support for the Microsoft VHDX image format 134595c6bff3SBenoît Canet --disable-quorum disable quorum block filter support 134695c6bff3SBenoît Canet --enable-quorum enable quorum block filter support 134708fb77edSStefan Weil 134808fb77edSStefan WeilNOTE: The object files are built at the place where configure is launched 1349af5db58eSpbrookEOF 1350af5db58eSpbrookexit 1 1351af5db58eSpbrookfi 1352af5db58eSpbrook 1353359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1354359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1355359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1356359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1357359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1358359bc95dSPeter Maydell ARCH=tci 1359359bc95dSPeter Maydell else 136076ad07a4SPeter Maydell error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1361359bc95dSPeter Maydell fi 1362359bc95dSPeter Maydellfi 1363359bc95dSPeter Maydell 13649c83ffd8SPeter Maydell# Consult white-list to determine whether to enable werror 13659c83ffd8SPeter Maydell# by default. Only enable by default for git builds 13669c83ffd8SPeter Maydellz_version=`cut -f3 -d. $source_path/VERSION` 13679c83ffd8SPeter Maydell 13689c83ffd8SPeter Maydellif test -z "$werror" ; then 13699c83ffd8SPeter Maydell if test -d "$source_path/.git" -a \ 13709c83ffd8SPeter Maydell "$linux" = "yes" ; then 13719c83ffd8SPeter Maydell werror="yes" 13729c83ffd8SPeter Maydell else 13739c83ffd8SPeter Maydell werror="no" 13749c83ffd8SPeter Maydell fi 13759c83ffd8SPeter Maydellfi 13769c83ffd8SPeter Maydell 13778d05095cSPaolo Bonzini# check that the C compiler works. 13788d05095cSPaolo Bonzinicat > $TMPC <<EOF 137975cafad7SStefan Weilint main(void) { return 0; } 13808d05095cSPaolo BonziniEOF 13818d05095cSPaolo Bonzini 13828d05095cSPaolo Bonziniif compile_object ; then 13838d05095cSPaolo Bonzini : C compiler works ok 13848d05095cSPaolo Bonzinielse 138576ad07a4SPeter Maydell error_exit "\"$cc\" either does not exist or does not work" 13868d05095cSPaolo Bonzinifi 13878d05095cSPaolo Bonzini 138898b21dcdSPeter Maydell# Check that the C++ compiler exists and works with the C compiler 138998b21dcdSPeter Maydellif has $cxx; then 139098b21dcdSPeter Maydell cat > $TMPC <<EOF 139198b21dcdSPeter Maydellint c_function(void); 139298b21dcdSPeter Maydellint main(void) { return c_function(); } 139398b21dcdSPeter MaydellEOF 139498b21dcdSPeter Maydell 139598b21dcdSPeter Maydell compile_object 139698b21dcdSPeter Maydell 13979c83ffd8SPeter Maydell cat > $TMPCXX <<EOF 139898b21dcdSPeter Maydellextern "C" { 139998b21dcdSPeter Maydell int c_function(void); 140098b21dcdSPeter Maydell} 140198b21dcdSPeter Maydellint c_function(void) { return 42; } 140298b21dcdSPeter MaydellEOF 140398b21dcdSPeter Maydell 14049c83ffd8SPeter Maydell update_cxxflags 14059c83ffd8SPeter Maydell 14069c83ffd8SPeter Maydell if do_cxx $QEMU_CXXFLAGS -o $TMPE $TMPCXX $TMPO $LDFLAGS; then 140798b21dcdSPeter Maydell # C++ compiler $cxx works ok with C compiler $cc 140898b21dcdSPeter Maydell : 140998b21dcdSPeter Maydell else 141098b21dcdSPeter Maydell echo "C++ compiler $cxx does not work with C compiler $cc" 141198b21dcdSPeter Maydell echo "Disabling C++ specific optional code" 141298b21dcdSPeter Maydell cxx= 141398b21dcdSPeter Maydell fi 141498b21dcdSPeter Maydellelse 141598b21dcdSPeter Maydell echo "No C++ compiler available; disabling C++ specific optional code" 141698b21dcdSPeter Maydell cxx= 141798b21dcdSPeter Maydellfi 141898b21dcdSPeter Maydell 14198d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 14208d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 14218d05095cSPaolo Bonzinigcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 142237746c5eSMarc-André Lureaugcc_flags="-Wendif-labels $gcc_flags" 1423c1556a81SPeter Maydellgcc_flags="-Wno-initializer-overrides $gcc_flags" 142471429097SPeter Maydellgcc_flags="-Wno-string-plus-int $gcc_flags" 14256ca026cbSPeter Maydell# Note that we do not add -Werror to gcc_flags here, because that would 14266ca026cbSPeter Maydell# enable it for all configure tests. If a configure test failed due 14276ca026cbSPeter Maydell# to -Werror this would just silently disable some features, 14286ca026cbSPeter Maydell# so it's too error prone. 14298d05095cSPaolo Bonzinicat > $TMPC << EOF 14308d05095cSPaolo Bonziniint main(void) { return 0; } 14318d05095cSPaolo BonziniEOF 14328d05095cSPaolo Bonzinifor flag in $gcc_flags; do 1433a1d29d6cSPeter Maydell # Use the positive sense of the flag when testing for -Wno-wombat 1434a1d29d6cSPeter Maydell # support (gcc will happily accept the -Wno- form of unknown 1435a1d29d6cSPeter Maydell # warning options). 1436a1d29d6cSPeter Maydell optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')" 1437a1d29d6cSPeter Maydell if compile_prog "-Werror $optflag" "" ; then 14388d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 14398d05095cSPaolo Bonzini fi 14408d05095cSPaolo Bonzinidone 14418d05095cSPaolo Bonzini 144237746c5eSMarc-André Lureauif compile_prog "-Werror -fstack-protector-all" "" ; then 144337746c5eSMarc-André Lureau QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all" 144437746c5eSMarc-André Lureau LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all" 144537746c5eSMarc-André Lureaufi 144637746c5eSMarc-André Lureau 1447cbdd1999SPaolo Bonzini# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and 1448cbdd1999SPaolo Bonzini# large functions that use global variables. The bug is in all releases of 1449cbdd1999SPaolo Bonzini# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in 1450cbdd1999SPaolo Bonzini# 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. 1451cbdd1999SPaolo Bonzinicat > $TMPC << EOF 1452cbdd1999SPaolo Bonzini#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) 1453cbdd1999SPaolo Bonziniint main(void) { return 0; } 1454cbdd1999SPaolo Bonzini#else 1455cbdd1999SPaolo Bonzini#error No bug in this compiler. 1456cbdd1999SPaolo Bonzini#endif 1457cbdd1999SPaolo BonziniEOF 1458cbdd1999SPaolo Bonziniif compile_prog "-Werror -fno-gcse" "" ; then 1459cbdd1999SPaolo Bonzini TRANSLATE_OPT_CFLAGS=-fno-gcse 1460cbdd1999SPaolo Bonzinifi 1461cbdd1999SPaolo Bonzini 146240d6444eSAvi Kivityif test "$static" = "yes" ; then 1463aa0d1f44SPaolo Bonzini if test "$modules" = "yes" ; then 1464aa0d1f44SPaolo Bonzini error_exit "static and modules are mutually incompatible" 1465aa0d1f44SPaolo Bonzini fi 146640d6444eSAvi Kivity if test "$pie" = "yes" ; then 146776ad07a4SPeter Maydell error_exit "static and pie are mutually incompatible" 146840d6444eSAvi Kivity else 146940d6444eSAvi Kivity pie="no" 147040d6444eSAvi Kivity fi 147140d6444eSAvi Kivityfi 147240d6444eSAvi Kivity 147340d6444eSAvi Kivityif test "$pie" = ""; then 147440d6444eSAvi Kivity case "$cpu-$targetos" in 1475c72b26ecSRichard Henderson i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) 147640d6444eSAvi Kivity ;; 147740d6444eSAvi Kivity *) 147840d6444eSAvi Kivity pie="no" 147940d6444eSAvi Kivity ;; 148040d6444eSAvi Kivity esac 148140d6444eSAvi Kivityfi 148240d6444eSAvi Kivity 148340d6444eSAvi Kivityif test "$pie" != "no" ; then 148440d6444eSAvi Kivity cat > $TMPC << EOF 148521d4a791SAvi Kivity 148621d4a791SAvi Kivity#ifdef __linux__ 148721d4a791SAvi Kivity# define THREAD __thread 148821d4a791SAvi Kivity#else 148921d4a791SAvi Kivity# define THREAD 149021d4a791SAvi Kivity#endif 149121d4a791SAvi Kivity 149221d4a791SAvi Kivitystatic THREAD int tls_var; 149321d4a791SAvi Kivity 149421d4a791SAvi Kivityint main(void) { return tls_var; } 149521d4a791SAvi Kivity 149640d6444eSAvi KivityEOF 149740d6444eSAvi Kivity if compile_prog "-fPIE -DPIE" "-pie"; then 149840d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 149940d6444eSAvi Kivity LDFLAGS="-pie $LDFLAGS" 150040d6444eSAvi Kivity pie="yes" 150140d6444eSAvi Kivity if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 150240d6444eSAvi Kivity LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" 150340d6444eSAvi Kivity fi 150440d6444eSAvi Kivity else 150540d6444eSAvi Kivity if test "$pie" = "yes"; then 150676ad07a4SPeter Maydell error_exit "PIE not available due to missing toolchain support" 150740d6444eSAvi Kivity else 150840d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 150940d6444eSAvi Kivity pie="no" 151040d6444eSAvi Kivity fi 151140d6444eSAvi Kivity fi 151246eef33bSBrad 151346eef33bSBrad if compile_prog "-fno-pie" "-nopie"; then 151446eef33bSBrad CFLAGS_NOPIE="-fno-pie" 151546eef33bSBrad LDFLAGS_NOPIE="-nopie" 151646eef33bSBrad fi 151740d6444eSAvi Kivityfi 151840d6444eSAvi Kivity 151966518bf6SDon Slutz# check for broken gcc and libtool in RHEL5 152066518bf6SDon Slutzif test -n "$libtool" -a "$pie" != "no" ; then 152166518bf6SDon Slutz cat > $TMPC <<EOF 152266518bf6SDon Slutz 152366518bf6SDon Slutzvoid *f(unsigned char *buf, int len); 152466518bf6SDon Slutzvoid *g(unsigned char *buf, int len); 152566518bf6SDon Slutz 152666518bf6SDon Slutzvoid * 152766518bf6SDon Slutzf(unsigned char *buf, int len) 152866518bf6SDon Slutz{ 152966518bf6SDon Slutz return (void*)0L; 153066518bf6SDon Slutz} 153166518bf6SDon Slutz 153266518bf6SDon Slutzvoid * 153366518bf6SDon Slutzg(unsigned char *buf, int len) 153466518bf6SDon Slutz{ 153566518bf6SDon Slutz return f(buf, len); 153666518bf6SDon Slutz} 153766518bf6SDon Slutz 153866518bf6SDon SlutzEOF 153966518bf6SDon Slutz if ! libtool_prog; then 154066518bf6SDon Slutz echo "Disabling libtool due to broken toolchain support" 154166518bf6SDon Slutz libtool= 154266518bf6SDon Slutz fi 154366518bf6SDon Slutzfi 154466518bf6SDon Slutz 154509dada40SPaolo Bonzini########################################## 154609dada40SPaolo Bonzini# __sync_fetch_and_and requires at least -march=i486. Many toolchains 154709dada40SPaolo Bonzini# use i686 as default anyway, but for those that don't, an explicit 154809dada40SPaolo Bonzini# specification is necessary 154909dada40SPaolo Bonzini 155009dada40SPaolo Bonziniif test "$cpu" = "i386"; then 155109dada40SPaolo Bonzini cat > $TMPC << EOF 155209dada40SPaolo Bonzinistatic int sfaa(int *ptr) 155309dada40SPaolo Bonzini{ 155409dada40SPaolo Bonzini return __sync_fetch_and_and(ptr, 0); 155509dada40SPaolo Bonzini} 155609dada40SPaolo Bonzini 155709dada40SPaolo Bonziniint main(void) 155809dada40SPaolo Bonzini{ 155909dada40SPaolo Bonzini int val = 42; 15601405b629SStefan Weil val = __sync_val_compare_and_swap(&val, 0, 1); 156109dada40SPaolo Bonzini sfaa(&val); 156209dada40SPaolo Bonzini return val; 156309dada40SPaolo Bonzini} 156409dada40SPaolo BonziniEOF 156509dada40SPaolo Bonzini if ! compile_prog "" "" ; then 156609dada40SPaolo Bonzini QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" 156709dada40SPaolo Bonzini fi 156809dada40SPaolo Bonzinifi 156909dada40SPaolo Bonzini 157009dada40SPaolo Bonzini######################################### 1571ec530c81Sbellard# Solaris specific configure tool chain decisions 157209dada40SPaolo Bonzini 1573ec530c81Sbellardif test "$solaris" = "yes" ; then 15746792aa11SLoïc Minier if has $install; then 15756792aa11SLoïc Minier : 15766792aa11SLoïc Minier else 157776ad07a4SPeter Maydell error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ 157876ad07a4SPeter Maydell "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ 157976ad07a4SPeter Maydell "to get ginstall which is used by default (which lives in /opt/csw/bin)" 1580ec530c81Sbellard fi 15816792aa11SLoïc Minier if test "`path_of $install`" = "/usr/sbin/install" ; then 158276ad07a4SPeter Maydell error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ 158376ad07a4SPeter Maydell "try ginstall from the GNU fileutils available from www.blastwave.org" \ 158476ad07a4SPeter Maydell "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 1585ec530c81Sbellard fi 15866792aa11SLoïc Minier if has ar; then 15876792aa11SLoïc Minier : 15886792aa11SLoïc Minier else 1589ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 159076ad07a4SPeter Maydell error_exit "No path includes ar" \ 159176ad07a4SPeter Maydell "Add /usr/ccs/bin to your path and rerun configure" 1592ec530c81Sbellard fi 159376ad07a4SPeter Maydell error_exit "No path includes ar" 1594ec530c81Sbellard fi 1595ec530c81Sbellardfi 1596ec530c81Sbellard 1597afb63ebdSStefan Weilif test -z "${target_list+xxx}" ; then 1598121afa9eSAnthony Liguori target_list="$default_target_list" 1599121afa9eSAnthony Liguorielse 1600121afa9eSAnthony Liguori target_list=`echo "$target_list" | sed -e 's/,/ /g'` 16015327cf48Sbellardfi 160225b48338SPeter Maydell 160325b48338SPeter Maydell# Check that we recognised the target name; this allows a more 160425b48338SPeter Maydell# friendly error message than if we let it fall through. 160525b48338SPeter Maydellfor target in $target_list; do 160625b48338SPeter Maydell case " $default_target_list " in 160725b48338SPeter Maydell *" $target "*) 160825b48338SPeter Maydell ;; 160925b48338SPeter Maydell *) 161025b48338SPeter Maydell error_exit "Unknown target name '$target'" 161125b48338SPeter Maydell ;; 161225b48338SPeter Maydell esac 161325b48338SPeter Maydelldone 161425b48338SPeter Maydell 1615f55fe278SPaolo Bonzini# see if system emulation was really requested 1616f55fe278SPaolo Bonzinicase " $target_list " in 1617f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 1618f55fe278SPaolo Bonzini ;; 1619f55fe278SPaolo Bonzini *) softmmu=no 1620f55fe278SPaolo Bonzini ;; 1621f55fe278SPaolo Bonziniesac 16225327cf48Sbellard 1623249247c9SJuan Quintelafeature_not_found() { 1624249247c9SJuan Quintela feature=$1 162521684af0SStewart Smith remedy=$2 1626249247c9SJuan Quintela 162776ad07a4SPeter Maydell error_exit "User requested feature $feature" \ 162821684af0SStewart Smith "configure was not able to find it." \ 162921684af0SStewart Smith "$remedy" 1630249247c9SJuan Quintela} 1631249247c9SJuan Quintela 16327d13299dSbellard# --- 16337d13299dSbellard# big/little endian test 16347d13299dSbellardcat > $TMPC << EOF 163561cc919fSMike Frysingershort big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; 163661cc919fSMike Frysingershort little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; 163761cc919fSMike Frysingerextern int foo(short *, short *); 163861cc919fSMike Frysingerint main(int argc, char *argv[]) { 163961cc919fSMike Frysinger return foo(big_endian, little_endian); 16407d13299dSbellard} 16417d13299dSbellardEOF 16427d13299dSbellard 164361cc919fSMike Frysingerif compile_object ; then 164461cc919fSMike Frysinger if grep -q BiGeNdIaN $TMPO ; then 164561cc919fSMike Frysinger bigendian="yes" 164661cc919fSMike Frysinger elif grep -q LiTtLeEnDiAn $TMPO ; then 164761cc919fSMike Frysinger bigendian="no" 16487d13299dSbellard else 16497d13299dSbellard echo big/little test failed 16507d13299dSbellard fi 16517d13299dSbellardelse 165261cc919fSMike Frysinger echo big/little test failed 16537d13299dSbellardfi 16547d13299dSbellard 1655b0a47e79SJuan Quintela########################################## 1656779ab5e3SStefan Weil# pkg-config probe 1657779ab5e3SStefan Weil 1658779ab5e3SStefan Weilif ! has "$pkg_config_exe"; then 165976ad07a4SPeter Maydell error_exit "pkg-config binary '$pkg_config_exe' not found" 1660779ab5e3SStefan Weilfi 1661779ab5e3SStefan Weil 1662779ab5e3SStefan Weil########################################## 1663b0a47e79SJuan Quintela# NPTL probe 1664b0a47e79SJuan Quintela 166524cb36a6SPeter Maydellif test "$linux_user" = "yes"; then 1666bd0c5661Spbrook cat > $TMPC <<EOF 1667bd0c5661Spbrook#include <sched.h> 166830813ceaSpbrook#include <linux/futex.h> 1669182eacc0SStefan Weilint main(void) { 1670bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 1671bd0c5661Spbrook#error bork 1672bd0c5661Spbrook#endif 1673182eacc0SStefan Weil return 0; 1674bd0c5661Spbrook} 1675bd0c5661SpbrookEOF 167624cb36a6SPeter Maydell if ! compile_object ; then 167721684af0SStewart Smith feature_not_found "nptl" "Install glibc and linux kernel headers." 1678b0a47e79SJuan Quintela fi 1679bd0c5661Spbrookfi 1680bd0c5661Spbrook 168111d9f695Sbellard########################################## 1682ac62922eSbalrog# zlib check 1683ac62922eSbalrog 16841ece9905SAlon Levyif test "$zlib" != "no" ; then 1685ac62922eSbalrog cat > $TMPC << EOF 1686ac62922eSbalrog#include <zlib.h> 1687ac62922eSbalrogint main(void) { zlibVersion(); return 0; } 1688ac62922eSbalrogEOF 168952166aa0SJuan Quintela if compile_prog "" "-lz" ; then 1690ac62922eSbalrog : 1691ac62922eSbalrog else 169276ad07a4SPeter Maydell error_exit "zlib check failed" \ 169376ad07a4SPeter Maydell "Make sure to have the zlib libs and headers installed." 1694ac62922eSbalrog fi 16951ece9905SAlon Levyfi 1696eb0ecd5aSWill NewtonLIBS="$LIBS -lz" 1697ac62922eSbalrog 1698ac62922eSbalrog########################################## 1699607dacd0Sqiaonuohan# lzo check 1700607dacd0Sqiaonuohan 1701607dacd0Sqiaonuohanif test "$lzo" != "no" ; then 1702607dacd0Sqiaonuohan cat > $TMPC << EOF 1703607dacd0Sqiaonuohan#include <lzo/lzo1x.h> 1704607dacd0Sqiaonuohanint main(void) { lzo_version(); return 0; } 1705607dacd0SqiaonuohanEOF 1706607dacd0Sqiaonuohan if compile_prog "" "-llzo2" ; then 1707607dacd0Sqiaonuohan : 1708607dacd0Sqiaonuohan else 1709607dacd0Sqiaonuohan error_exit "lzo check failed" \ 1710607dacd0Sqiaonuohan "Make sure to have the lzo libs and headers installed." 1711607dacd0Sqiaonuohan fi 1712607dacd0Sqiaonuohan 1713607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -llzo2" 1714607dacd0Sqiaonuohanfi 1715607dacd0Sqiaonuohan 1716607dacd0Sqiaonuohan########################################## 1717607dacd0Sqiaonuohan# snappy check 1718607dacd0Sqiaonuohan 1719607dacd0Sqiaonuohanif test "$snappy" != "no" ; then 1720607dacd0Sqiaonuohan cat > $TMPC << EOF 1721607dacd0Sqiaonuohan#include <snappy-c.h> 1722607dacd0Sqiaonuohanint main(void) { snappy_max_compressed_length(4096); return 0; } 1723607dacd0SqiaonuohanEOF 1724607dacd0Sqiaonuohan if compile_prog "" "-lsnappy" ; then 1725607dacd0Sqiaonuohan : 1726607dacd0Sqiaonuohan else 1727607dacd0Sqiaonuohan error_exit "snappy check failed" \ 1728607dacd0Sqiaonuohan "Make sure to have the snappy libs and headers installed." 1729607dacd0Sqiaonuohan fi 1730607dacd0Sqiaonuohan 1731607dacd0Sqiaonuohan libs_softmmu="$libs_softmmu -lsnappy" 1732607dacd0Sqiaonuohanfi 1733607dacd0Sqiaonuohan 1734607dacd0Sqiaonuohan########################################## 1735f794573eSEduardo Otubo# libseccomp check 1736f794573eSEduardo Otubo 1737f794573eSEduardo Otuboif test "$seccomp" != "no" ; then 173865d5d3f9SStefan Weil if $pkg_config --atleast-version=2.1.0 libseccomp; then 1739b4451996SMichael Tokarev libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`" 1740372e47e9SAndreas Färber QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`" 1741f794573eSEduardo Otubo seccomp="yes" 1742f794573eSEduardo Otubo else 1743f794573eSEduardo Otubo if test "$seccomp" = "yes"; then 174421684af0SStewart Smith feature_not_found "libseccomp" "Install libseccomp devel >= 2.1.0" 1745f794573eSEduardo Otubo fi 1746e84d5956SYann E. MORIN seccomp="no" 1747f794573eSEduardo Otubo fi 1748f794573eSEduardo Otubofi 1749f794573eSEduardo Otubo########################################## 1750e37630caSaliguori# xen probe 1751e37630caSaliguori 1752fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 1753b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 1754d5b93ddfSAnthony PERARD 175550ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 175650ced5b3SStefan Weil # If no, we are done and there is no Xen support. 175750ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 175850ced5b3SStefan Weil 175950ced5b3SStefan Weil # Xen (any) 176050ced5b3SStefan Weil cat > $TMPC <<EOF 176150ced5b3SStefan Weil#include <xenctrl.h> 176250ced5b3SStefan Weilint main(void) { 176350ced5b3SStefan Weil return 0; 176450ced5b3SStefan Weil} 176550ced5b3SStefan WeilEOF 176650ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 176750ced5b3SStefan Weil # Xen not found 176850ced5b3SStefan Weil if test "$xen" = "yes" ; then 176921684af0SStewart Smith feature_not_found "xen" "Install xen devel" 177050ced5b3SStefan Weil fi 177150ced5b3SStefan Weil xen=no 177250ced5b3SStefan Weil 1773d5b93ddfSAnthony PERARD # Xen unstable 177469deef08SPeter Maydell elif 177569deef08SPeter Maydell cat > $TMPC <<EOF && 1776e37630caSaliguori#include <xenctrl.h> 1777e108a3c1SAnthony PERARD#include <xenstore.h> 1778d5b93ddfSAnthony PERARD#include <stdint.h> 1779d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1780d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1781d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1782d5b93ddfSAnthony PERARD#endif 1783d5b93ddfSAnthony PERARDint main(void) { 1784d5b93ddfSAnthony PERARD xc_interface *xc; 1785d5b93ddfSAnthony PERARD xs_daemon_open(); 1786d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 1787d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1788d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 1789b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 17908688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 17918688e065SStefano Stabellini return 0; 17928688e065SStefano Stabellini} 17938688e065SStefano StabelliniEOF 17948688e065SStefano Stabellini compile_prog "" "$xen_libs" 179569deef08SPeter Maydell then 17968688e065SStefano Stabellini xen_ctrl_version=420 17978688e065SStefano Stabellini xen=yes 17988688e065SStefano Stabellini 179969deef08SPeter Maydell elif 180069deef08SPeter Maydell cat > $TMPC <<EOF && 18018688e065SStefano Stabellini#include <xenctrl.h> 18028688e065SStefano Stabellini#include <xs.h> 18038688e065SStefano Stabellini#include <stdint.h> 18048688e065SStefano Stabellini#include <xen/hvm/hvm_info_table.h> 18058688e065SStefano Stabellini#if !defined(HVM_MAX_VCPUS) 18068688e065SStefano Stabellini# error HVM_MAX_VCPUS not defined 18078688e065SStefano Stabellini#endif 18088688e065SStefano Stabelliniint main(void) { 18098688e065SStefano Stabellini xs_daemon_open(); 18109b4c0b56SPeter Maydell xc_interface_open(0, 0, 0); 18118688e065SStefano Stabellini xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 18128688e065SStefano Stabellini xc_gnttab_open(NULL, 0); 18138688e065SStefano Stabellini xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 1814d5b93ddfSAnthony PERARD return 0; 1815d5b93ddfSAnthony PERARD} 1816e37630caSaliguoriEOF 181750ced5b3SStefan Weil compile_prog "" "$xen_libs" 181869deef08SPeter Maydell then 1819d5b93ddfSAnthony PERARD xen_ctrl_version=410 1820fc321b4bSJuan Quintela xen=yes 1821d5b93ddfSAnthony PERARD 1822d5b93ddfSAnthony PERARD # Xen 4.0.0 182369deef08SPeter Maydell elif 182469deef08SPeter Maydell cat > $TMPC <<EOF && 1825d5b93ddfSAnthony PERARD#include <xenctrl.h> 1826d5b93ddfSAnthony PERARD#include <xs.h> 1827d5b93ddfSAnthony PERARD#include <stdint.h> 1828d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1829d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1830d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1831d5b93ddfSAnthony PERARD#endif 1832d5b93ddfSAnthony PERARDint main(void) { 1833b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1834b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1835b87de24eSAnthony PERARD }; 1836d5b93ddfSAnthony PERARD xs_daemon_open(); 1837d5b93ddfSAnthony PERARD xc_interface_open(); 1838d5b93ddfSAnthony PERARD xc_gnttab_open(); 1839d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1840b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1841d5b93ddfSAnthony PERARD return 0; 1842d5b93ddfSAnthony PERARD} 1843d5b93ddfSAnthony PERARDEOF 1844d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 184569deef08SPeter Maydell then 1846d5b93ddfSAnthony PERARD xen_ctrl_version=400 1847d5b93ddfSAnthony PERARD xen=yes 1848d5b93ddfSAnthony PERARD 1849b87de24eSAnthony PERARD # Xen 3.4.0 185069deef08SPeter Maydell elif 185169deef08SPeter Maydell cat > $TMPC <<EOF && 1852b87de24eSAnthony PERARD#include <xenctrl.h> 1853b87de24eSAnthony PERARD#include <xs.h> 1854b87de24eSAnthony PERARDint main(void) { 1855b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1856b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1857b87de24eSAnthony PERARD }; 1858b87de24eSAnthony PERARD xs_daemon_open(); 1859b87de24eSAnthony PERARD xc_interface_open(); 1860b87de24eSAnthony PERARD xc_gnttab_open(); 1861b87de24eSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1862b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1863b87de24eSAnthony PERARD return 0; 1864b87de24eSAnthony PERARD} 1865b87de24eSAnthony PERARDEOF 1866b87de24eSAnthony PERARD compile_prog "" "$xen_libs" 186769deef08SPeter Maydell then 1868b87de24eSAnthony PERARD xen_ctrl_version=340 1869b87de24eSAnthony PERARD xen=yes 1870b87de24eSAnthony PERARD 1871b87de24eSAnthony PERARD # Xen 3.3.0 187269deef08SPeter Maydell elif 187369deef08SPeter Maydell cat > $TMPC <<EOF && 1874d5b93ddfSAnthony PERARD#include <xenctrl.h> 1875d5b93ddfSAnthony PERARD#include <xs.h> 1876d5b93ddfSAnthony PERARDint main(void) { 1877d5b93ddfSAnthony PERARD xs_daemon_open(); 1878d5b93ddfSAnthony PERARD xc_interface_open(); 1879d5b93ddfSAnthony PERARD xc_gnttab_open(); 1880d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1881d5b93ddfSAnthony PERARD return 0; 1882d5b93ddfSAnthony PERARD} 1883d5b93ddfSAnthony PERARDEOF 1884d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 188569deef08SPeter Maydell then 1886d5b93ddfSAnthony PERARD xen_ctrl_version=330 1887d5b93ddfSAnthony PERARD xen=yes 1888d5b93ddfSAnthony PERARD 188950ced5b3SStefan Weil # Xen version unsupported 1890e37630caSaliguori else 1891fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 189221684af0SStewart Smith feature_not_found "xen (unsupported version)" "Install supported xen (e.g. 4.0, 3.4, 3.3)" 1893fc321b4bSJuan Quintela fi 1894fc321b4bSJuan Quintela xen=no 1895e37630caSaliguori fi 1896d5b93ddfSAnthony PERARD 1897d5b93ddfSAnthony PERARD if test "$xen" = yes; then 1898d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 1899d5b93ddfSAnthony PERARD fi 1900e37630caSaliguorifi 1901e37630caSaliguori 1902eb6fda0fSAnthony PERARDif test "$xen_pci_passthrough" != "no"; then 1903eb6fda0fSAnthony PERARD if test "$xen" = "yes" && test "$linux" = "yes" && 1904eb6fda0fSAnthony PERARD test "$xen_ctrl_version" -ge 340; then 1905eb6fda0fSAnthony PERARD xen_pci_passthrough=yes 1906eb6fda0fSAnthony PERARD else 1907eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = "yes"; then 1908eb6fda0fSAnthony PERARD if test "$xen_ctrl_version" -lt 340; then 190976ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 191076ad07a4SPeter Maydell "This feature does not work with Xen 3.3" 1911eb6fda0fSAnthony PERARD fi 191276ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 191376ad07a4SPeter Maydell " but this feature requires /sys from Linux" 1914eb6fda0fSAnthony PERARD fi 1915eb6fda0fSAnthony PERARD xen_pci_passthrough=no 1916eb6fda0fSAnthony PERARD fi 1917eb6fda0fSAnthony PERARDfi 1918eb6fda0fSAnthony PERARD 1919e37630caSaliguori########################################## 192044dc0ca3SAlon Levy# libtool probe 192144dc0ca3SAlon Levy 19223f534581SBradif ! has $libtool; then 192344dc0ca3SAlon Levy libtool= 192444dc0ca3SAlon Levyfi 192544dc0ca3SAlon Levy 19268e515b12SPeter Maydell# MacOSX ships with a libtool which isn't the GNU one; weed this 19278e515b12SPeter Maydell# out by checking whether libtool supports the --version switch 19288e515b12SPeter Maydellif test -n "$libtool"; then 19298e515b12SPeter Maydell if ! "$libtool" --version >/dev/null 2>&1; then 19308e515b12SPeter Maydell libtool= 19318e515b12SPeter Maydell fi 19328e515b12SPeter Maydellfi 19338e515b12SPeter Maydell 193444dc0ca3SAlon Levy########################################## 1935dfffc653SJuan Quintela# Sparse probe 1936dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 19370dba6195SLoïc Minier if has cgcc; then 1938dfffc653SJuan Quintela sparse=yes 1939dfffc653SJuan Quintela else 1940dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 194121684af0SStewart Smith feature_not_found "sparse" "Install sparse binary" 1942dfffc653SJuan Quintela fi 1943dfffc653SJuan Quintela sparse=no 1944dfffc653SJuan Quintela fi 1945dfffc653SJuan Quintelafi 1946dfffc653SJuan Quintela 1947dfffc653SJuan Quintela########################################## 1948a4ccabcfSAnthony Liguori# GTK probe 1949a4ccabcfSAnthony Liguori 1950a4ccabcfSAnthony Liguoriif test "$gtk" != "no"; then 1951528de90aSDaniel P. Berrange gtkpackage="gtk+-$gtkabi" 1952528de90aSDaniel P. Berrange if test "$gtkabi" = "3.0" ; then 1953528de90aSDaniel P. Berrange gtkversion="3.0.0" 1954*bbbf9bfbSStefan Weil else 1955*bbbf9bfbSStefan Weil gtkversion="2.18.0" 1956*bbbf9bfbSStefan Weil fi 1957*bbbf9bfbSStefan Weil if $pkg_config --exists "$gtkpackage >= $gtkversion"; then 1958*bbbf9bfbSStefan Weil gtk_cflags=`$pkg_config --cflags $gtkpackage` 1959*bbbf9bfbSStefan Weil gtk_libs=`$pkg_config --libs $gtkpackage` 1960*bbbf9bfbSStefan Weil libs_softmmu="$gtk_libs $libs_softmmu" 1961*bbbf9bfbSStefan Weil gtk="yes" 1962*bbbf9bfbSStefan Weil elif test "$gtk" = "yes"; then 1963*bbbf9bfbSStefan Weil feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel" 1964*bbbf9bfbSStefan Weil else 1965*bbbf9bfbSStefan Weil gtk="no" 1966*bbbf9bfbSStefan Weil fi 1967*bbbf9bfbSStefan Weilfi 1968*bbbf9bfbSStefan Weil 1969*bbbf9bfbSStefan Weil########################################## 1970*bbbf9bfbSStefan Weil# VTE probe 1971*bbbf9bfbSStefan Weil 1972*bbbf9bfbSStefan Weilif test "$vte" != "no"; then 1973*bbbf9bfbSStefan Weil if test "$gtkabi" = "3.0"; then 1974528de90aSDaniel P. Berrange vtepackage="vte-2.90" 1975528de90aSDaniel P. Berrange vteversion="0.32.0" 1976528de90aSDaniel P. Berrange else 1977528de90aSDaniel P. Berrange vtepackage="vte" 1978528de90aSDaniel P. Berrange vteversion="0.24.0" 1979528de90aSDaniel P. Berrange fi 1980*bbbf9bfbSStefan Weil if $pkg_config --exists "$vtepackage >= $vteversion"; then 1981ca871ec8SStefan Weil vte_cflags=`$pkg_config --cflags $vtepackage` 1982ca871ec8SStefan Weil vte_libs=`$pkg_config --libs $vtepackage` 1983*bbbf9bfbSStefan Weil libs_softmmu="$vte_libs $libs_softmmu" 1984*bbbf9bfbSStefan Weil vte="yes" 1985*bbbf9bfbSStefan Weil elif test "$vte" = "yes"; then 1986*bbbf9bfbSStefan Weil feature_not_found "vte" "Install libvte or libvte-2.90 (requires --with-gtkabi=3.0 option to configure) devel" 1987*bbbf9bfbSStefan Weil else 1988*bbbf9bfbSStefan Weil vte="no" 1989a4ccabcfSAnthony Liguori fi 1990a4ccabcfSAnthony Liguorifi 1991a4ccabcfSAnthony Liguori 1992a4ccabcfSAnthony Liguori########################################## 199311d9f695Sbellard# SDL probe 199411d9f695Sbellard 19953ec87ffeSPaolo Bonzini# Look for sdl configuration program (pkg-config or sdl-config). Try 19963ec87ffeSPaolo Bonzini# sdl-config even without cross prefix, and favour pkg-config over sdl-config. 199747c03744SDave Airlie 199847c03744SDave Airlieif test $sdlabi = "2.0"; then 199947c03744SDave Airlie sdl_config=$sdl2_config 200047c03744SDave Airlie sdlname=sdl2 200147c03744SDave Airlie sdlconfigname=sdl2_config 200247c03744SDave Airlieelse 200347c03744SDave Airlie sdlname=sdl 200447c03744SDave Airlie sdlconfigname=sdl_config 20053ec87ffeSPaolo Bonzinifi 20063ec87ffeSPaolo Bonzini 200747c03744SDave Airlieif test "`basename $sdl_config`" != $sdlconfigname && ! has ${sdl_config}; then 200847c03744SDave Airlie sdl_config=$sdlconfigname 200947c03744SDave Airliefi 201047c03744SDave Airlie 201147c03744SDave Airlieif $pkg_config $sdlname --exists; then 201247c03744SDave Airlie sdlconfig="$pkg_config $sdlname" 2013fec0e3e8SStefan Weil _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` 20143ec87ffeSPaolo Bonzinielif has ${sdl_config}; then 20153ec87ffeSPaolo Bonzini sdlconfig="$sdl_config" 20169316f803SPaolo Bonzini _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` 2017a0dfd8a4SLoïc Minierelse 2018a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 201921684af0SStewart Smith feature_not_found "sdl" "Install SDL devel" 2020a0dfd8a4SLoïc Minier fi 2021a0dfd8a4SLoïc Minier sdl=no 20229316f803SPaolo Bonzinifi 202329e5badaSScott Woodif test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then 20243ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 20253ec87ffeSPaolo Bonzinifi 202611d9f695Sbellard 20279316f803SPaolo Bonzinisdl_too_old=no 2028c4198157SJuan Quintelaif test "$sdl" != "no" ; then 202911d9f695Sbellard cat > $TMPC << EOF 203011d9f695Sbellard#include <SDL.h> 203111d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 203211d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 203311d9f695SbellardEOF 20349316f803SPaolo Bonzini sdl_cflags=`$sdlconfig --cflags 2> /dev/null` 203574f42e18STeLeMan if test "$static" = "yes" ; then 203674f42e18STeLeMan sdl_libs=`$sdlconfig --static-libs 2>/dev/null` 203774f42e18STeLeMan else 20389316f803SPaolo Bonzini sdl_libs=`$sdlconfig --libs 2> /dev/null` 203974f42e18STeLeMan fi 204052166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 204111d9f695Sbellard if test "$_sdlversion" -lt 121 ; then 204211d9f695Sbellard sdl_too_old=yes 204311d9f695Sbellard else 2044fd677642Sths if test "$cocoa" = "no" ; then 204511d9f695Sbellard sdl=yes 204611d9f695Sbellard fi 2047fd677642Sths fi 20487c1f25b4Sbellard 204967c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 20501ac88f28SJuan Quintela if test "$sdl" = "yes" -a "$static" = "yes" ; then 205167c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 2052f8aa6c7bSStefan Weil sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" 2053f8aa6c7bSStefan Weil sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" 205411d9f695Sbellard fi 205552166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 20561ac88f28SJuan Quintela : 20571ac88f28SJuan Quintela else 20581ac88f28SJuan Quintela sdl=no 20597c1f25b4Sbellard fi 20607c1f25b4Sbellard fi # static link 2061c4198157SJuan Quintela else # sdl not found 2062c4198157SJuan Quintela if test "$sdl" = "yes" ; then 206321684af0SStewart Smith feature_not_found "sdl" "Install SDL devel" 2064c4198157SJuan Quintela fi 2065c4198157SJuan Quintela sdl=no 20667c1f25b4Sbellard fi # sdl compile test 2067fd677642Sthsfi 206811d9f695Sbellard 20695368a422Saliguoriif test "$sdl" = "yes" ; then 20705368a422Saliguori cat > $TMPC <<EOF 20715368a422Saliguori#include <SDL.h> 20725368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 20735368a422Saliguori#include <X11/XKBlib.h> 20745368a422Saliguori#else 20755368a422Saliguori#error No x11 support 20765368a422Saliguori#endif 20775368a422Saliguoriint main(void) { return 0; } 20785368a422SaliguoriEOF 207952166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 2080681306dfSJuan Quintela sdl_libs="$sdl_libs -lX11" 20815368a422Saliguori fi 20820705667eSJuan Quintela libs_softmmu="$sdl_libs $libs_softmmu" 20835368a422Saliguorifi 20845368a422Saliguori 20858f28f3fbSths########################################## 20862da776dbSMichael R. Hines# RDMA needs OpenFabrics libraries 20872da776dbSMichael R. Hinesif test "$rdma" != "no" ; then 20882da776dbSMichael R. Hines cat > $TMPC <<EOF 20892da776dbSMichael R. Hines#include <rdma/rdma_cma.h> 20902da776dbSMichael R. Hinesint main(void) { return 0; } 20912da776dbSMichael R. HinesEOF 20922da776dbSMichael R. Hines rdma_libs="-lrdmacm -libverbs" 20932da776dbSMichael R. Hines if compile_prog "" "$rdma_libs" ; then 20942da776dbSMichael R. Hines rdma="yes" 20952da776dbSMichael R. Hines libs_softmmu="$libs_softmmu $rdma_libs" 20962da776dbSMichael R. Hines else 20972da776dbSMichael R. Hines if test "$rdma" = "yes" ; then 20982da776dbSMichael R. Hines error_exit \ 20992da776dbSMichael R. Hines " OpenFabrics librdmacm/libibverbs not present." \ 21002da776dbSMichael R. Hines " Your options:" \ 21012da776dbSMichael R. Hines " (1) Fast: Install infiniband packages from your distro." \ 21022da776dbSMichael R. Hines " (2) Cleanest: Install libraries from www.openfabrics.org" \ 21032da776dbSMichael R. Hines " (3) Also: Install softiwarp if you don't have RDMA hardware" 21042da776dbSMichael R. Hines fi 21052da776dbSMichael R. Hines rdma="no" 21062da776dbSMichael R. Hines fi 21072da776dbSMichael R. Hinesfi 21082da776dbSMichael R. Hines 21092da776dbSMichael R. Hines########################################## 21107536ee4bSTim Hardeck# VNC TLS/WS detection 21117536ee4bSTim Hardeckif test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then 2112ae6b5e5aSaliguori cat > $TMPC <<EOF 2113ae6b5e5aSaliguori#include <gnutls/gnutls.h> 2114ae6b5e5aSaliguoriint main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } 2115ae6b5e5aSaliguoriEOF 2116a8bd70adSPaolo Bonzini vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 2117a8bd70adSPaolo Bonzini vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 211852166aa0SJuan Quintela if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then 21197536ee4bSTim Hardeck if test "$vnc_tls" != "no" ; then 21201be10ad2SJuan Quintela vnc_tls=yes 21217536ee4bSTim Hardeck fi 21227536ee4bSTim Hardeck if test "$vnc_ws" != "no" ; then 21237536ee4bSTim Hardeck vnc_ws=yes 21247536ee4bSTim Hardeck fi 2125a5e32cc9SJuan Quintela libs_softmmu="$vnc_tls_libs $libs_softmmu" 2126ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_tls_cflags" 2127ae6b5e5aSaliguori else 21281be10ad2SJuan Quintela if test "$vnc_tls" = "yes" ; then 212921684af0SStewart Smith feature_not_found "vnc-tls" "Install gnutls devel" 21301be10ad2SJuan Quintela fi 21317536ee4bSTim Hardeck if test "$vnc_ws" = "yes" ; then 213221684af0SStewart Smith feature_not_found "vnc-ws" "Install gnutls devel" 21337536ee4bSTim Hardeck fi 21341be10ad2SJuan Quintela vnc_tls=no 21357536ee4bSTim Hardeck vnc_ws=no 21368d5d2d4cSths fi 21378d5d2d4cSthsfi 21388d5d2d4cSths 21398d5d2d4cSths########################################## 214095c6bff3SBenoît Canet# Quorum probe (check for gnutls) 214195c6bff3SBenoît Canetif test "$quorum" != "no" ; then 214295c6bff3SBenoît Canetcat > $TMPC <<EOF 214395c6bff3SBenoît Canet#include <gnutls/gnutls.h> 214495c6bff3SBenoît Canet#include <gnutls/crypto.h> 214595c6bff3SBenoît Canetint main(void) {char data[4096], digest[32]; 214695c6bff3SBenoît Canetgnutls_hash_fast(GNUTLS_DIG_SHA256, data, 4096, digest); 214795c6bff3SBenoît Canetreturn 0; 214895c6bff3SBenoît Canet} 214995c6bff3SBenoît CanetEOF 215095c6bff3SBenoît Canetquorum_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 215195c6bff3SBenoît Canetquorum_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 215295c6bff3SBenoît Canetif compile_prog "$quorum_tls_cflags" "$quorum_tls_libs" ; then 215395c6bff3SBenoît Canet qcow_tls=yes 215495c6bff3SBenoît Canet libs_softmmu="$quorum_tls_libs $libs_softmmu" 215595c6bff3SBenoît Canet libs_tools="$quorum_tls_libs $libs_softmmu" 215695c6bff3SBenoît Canet QEMU_CFLAGS="$QEMU_CFLAGS $quorum_tls_cflags" 215795c6bff3SBenoît Canetelse 215895c6bff3SBenoît Canet echo "gnutls > 2.10.0 required to compile Quorum" 215995c6bff3SBenoît Canet exit 1 216095c6bff3SBenoît Canetfi 216195c6bff3SBenoît Canetfi 216295c6bff3SBenoît Canet 216395c6bff3SBenoît Canet########################################## 21642f9606b3Saliguori# VNC SASL detection 2165821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then 21662f9606b3Saliguori cat > $TMPC <<EOF 21672f9606b3Saliguori#include <sasl/sasl.h> 21682f9606b3Saliguori#include <stdio.h> 21692f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 21702f9606b3SaliguoriEOF 21712f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 21722f9606b3Saliguori vnc_sasl_cflags="" 21732f9606b3Saliguori vnc_sasl_libs="-lsasl2" 217452166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 2175ea784e3bSJuan Quintela vnc_sasl=yes 2176fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 2177ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" 21782f9606b3Saliguori else 2179ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 218021684af0SStewart Smith feature_not_found "vnc-sasl" "Install Cyrus SASL devel" 2181ea784e3bSJuan Quintela fi 2182ea784e3bSJuan Quintela vnc_sasl=no 21832f9606b3Saliguori fi 21842f9606b3Saliguorifi 21852f9606b3Saliguori 21862f9606b3Saliguori########################################## 21872f6f5c7aSCorentin Chary# VNC JPEG detection 2188821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then 21892f6f5c7aSCorentin Charycat > $TMPC <<EOF 21902f6f5c7aSCorentin Chary#include <stdio.h> 21912f6f5c7aSCorentin Chary#include <jpeglib.h> 21922f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 21932f6f5c7aSCorentin CharyEOF 21942f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 21952f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 21962f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 21972f6f5c7aSCorentin Chary vnc_jpeg=yes 21982f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 2199ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" 22002f6f5c7aSCorentin Chary else 22012f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 220221684af0SStewart Smith feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" 22032f6f5c7aSCorentin Chary fi 22042f6f5c7aSCorentin Chary vnc_jpeg=no 22052f6f5c7aSCorentin Chary fi 22062f6f5c7aSCorentin Charyfi 22072f6f5c7aSCorentin Chary 22082f6f5c7aSCorentin Chary########################################## 2209efe556adSCorentin Chary# VNC PNG detection 2210821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_png" != "no" ; then 2211efe556adSCorentin Charycat > $TMPC <<EOF 2212efe556adSCorentin Chary//#include <stdio.h> 2213efe556adSCorentin Chary#include <png.h> 2214832ce9c2SScott Wood#include <stddef.h> 2215efe556adSCorentin Charyint main(void) { 2216efe556adSCorentin Chary png_structp png_ptr; 2217efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 22187edc3fedSPeter Maydell return png_ptr != 0; 2219efe556adSCorentin Chary} 2220efe556adSCorentin CharyEOF 222165d5d3f9SStefan Weil if $pkg_config libpng --exists; then 2222ca871ec8SStefan Weil vnc_png_cflags=`$pkg_config libpng --cflags` 2223ca871ec8SStefan Weil vnc_png_libs=`$pkg_config libpng --libs` 22249af8025eSBrad else 2225efe556adSCorentin Chary vnc_png_cflags="" 2226efe556adSCorentin Chary vnc_png_libs="-lpng" 22279af8025eSBrad fi 2228efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 2229efe556adSCorentin Chary vnc_png=yes 2230efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 22319af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 2232efe556adSCorentin Chary else 2233efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 223421684af0SStewart Smith feature_not_found "vnc-png" "Install libpng devel" 2235efe556adSCorentin Chary fi 2236efe556adSCorentin Chary vnc_png=no 2237efe556adSCorentin Chary fi 2238efe556adSCorentin Charyfi 2239efe556adSCorentin Chary 2240efe556adSCorentin Chary########################################## 224176655d6dSaliguori# fnmatch() probe, used for ACL routines 224276655d6dSaliguorifnmatch="no" 224376655d6dSaliguoricat > $TMPC << EOF 224476655d6dSaliguori#include <fnmatch.h> 224576655d6dSaliguoriint main(void) 224676655d6dSaliguori{ 224776655d6dSaliguori fnmatch("foo", "foo", 0); 224876655d6dSaliguori return 0; 224976655d6dSaliguori} 225076655d6dSaliguoriEOF 225152166aa0SJuan Quintelaif compile_prog "" "" ; then 225276655d6dSaliguori fnmatch="yes" 225376655d6dSaliguorifi 225476655d6dSaliguori 225576655d6dSaliguori########################################## 2256ee682d27SStefan Weil# uuid_generate() probe, used for vdi block driver 22572d16c8e9SPeter Maydell# Note that on some systems (notably MacOSX) no extra library 22582d16c8e9SPeter Maydell# need be linked to get the uuid functions. 2259ee682d27SStefan Weilif test "$uuid" != "no" ; then 2260ee682d27SStefan Weil uuid_libs="-luuid" 2261ee682d27SStefan Weil cat > $TMPC << EOF 2262ee682d27SStefan Weil#include <uuid/uuid.h> 2263ee682d27SStefan Weilint main(void) 2264ee682d27SStefan Weil{ 2265ee682d27SStefan Weil uuid_t my_uuid; 2266ee682d27SStefan Weil uuid_generate(my_uuid); 2267ee682d27SStefan Weil return 0; 2268ee682d27SStefan Weil} 2269ee682d27SStefan WeilEOF 22702d16c8e9SPeter Maydell if compile_prog "" "" ; then 22712d16c8e9SPeter Maydell uuid="yes" 22722d16c8e9SPeter Maydell elif compile_prog "" "$uuid_libs" ; then 2273ee682d27SStefan Weil uuid="yes" 2274ee682d27SStefan Weil libs_softmmu="$uuid_libs $libs_softmmu" 2275ee682d27SStefan Weil libs_tools="$uuid_libs $libs_tools" 2276ee682d27SStefan Weil else 2277ee682d27SStefan Weil if test "$uuid" = "yes" ; then 227821684af0SStewart Smith feature_not_found "uuid" "Install libuuid devel" 2279ee682d27SStefan Weil fi 2280ee682d27SStefan Weil uuid=no 2281ee682d27SStefan Weil fi 2282ee682d27SStefan Weilfi 2283ee682d27SStefan Weil 22844f18b782SJeff Codyif test "$vhdx" = "yes" ; then 22854f18b782SJeff Cody if test "$uuid" = "no" ; then 22864f18b782SJeff Cody error_exit "uuid required for VHDX support" 22874f18b782SJeff Cody fi 22884f18b782SJeff Codyelif test "$vhdx" != "no" ; then 22894f18b782SJeff Cody if test "$uuid" = "yes" ; then 22904f18b782SJeff Cody vhdx=yes 22914f18b782SJeff Cody else 22924f18b782SJeff Cody vhdx=no 22934f18b782SJeff Cody fi 22944f18b782SJeff Codyfi 22954f18b782SJeff Cody 2296ee682d27SStefan Weil########################################## 2297dce512deSChristoph Hellwig# xfsctl() probe, used for raw-posix 2298dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 2299dce512deSChristoph Hellwig cat > $TMPC << EOF 2300ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 2301dce512deSChristoph Hellwig#include <xfs/xfs.h> 2302dce512deSChristoph Hellwigint main(void) 2303dce512deSChristoph Hellwig{ 2304dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 2305dce512deSChristoph Hellwig return 0; 2306dce512deSChristoph Hellwig} 2307dce512deSChristoph HellwigEOF 2308dce512deSChristoph Hellwig if compile_prog "" "" ; then 2309dce512deSChristoph Hellwig xfs="yes" 2310dce512deSChristoph Hellwig else 2311dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 231221684af0SStewart Smith feature_not_found "xfs" "Instal xfsprogs/xfslibs devel" 2313dce512deSChristoph Hellwig fi 2314dce512deSChristoph Hellwig xfs=no 2315dce512deSChristoph Hellwig fi 2316dce512deSChristoph Hellwigfi 2317dce512deSChristoph Hellwig 2318dce512deSChristoph Hellwig########################################## 23198a16d273Sths# vde libraries probe 2320dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 23214baae0acSJuan Quintela vde_libs="-lvdeplug" 23228a16d273Sths cat > $TMPC << EOF 23238a16d273Sths#include <libvdeplug.h> 23244a7f0e06Spbrookint main(void) 23254a7f0e06Spbrook{ 23264a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 2327fea08e08SPeter Maydell char s[] = ""; 2328fea08e08SPeter Maydell vde_open(s, s, &a); 23294a7f0e06Spbrook return 0; 23304a7f0e06Spbrook} 23318a16d273SthsEOF 233252166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 23334baae0acSJuan Quintela vde=yes 23348e02e54cSJuan Quintela libs_softmmu="$vde_libs $libs_softmmu" 23358e02e54cSJuan Quintela libs_tools="$vde_libs $libs_tools" 2336dfb278bdSJuan Quintela else 2337dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 233821684af0SStewart Smith feature_not_found "vde" "Install vde (Virtual Distributed Ethernet) devel" 2339dfb278bdSJuan Quintela fi 2340dfb278bdSJuan Quintela vde=no 23418a16d273Sths fi 23428a16d273Sthsfi 23438a16d273Sths 23448a16d273Sths########################################## 23450a985b37SVincenzo Maffione# netmap support probe 23460a985b37SVincenzo Maffione# Apart from looking for netmap headers, we make sure that the host API version 23470a985b37SVincenzo Maffione# supports the netmap backend (>=11). The upper bound (15) is meant to simulate 23480a985b37SVincenzo Maffione# a minor/major version number. Minor new features will be marked with values up 23490a985b37SVincenzo Maffione# to 15, and if something happens that requires a change to the backend we will 23500a985b37SVincenzo Maffione# move above 15, submit the backend fixes and modify this two bounds. 235158952137SVincenzo Maffioneif test "$netmap" != "no" ; then 235258952137SVincenzo Maffione cat > $TMPC << EOF 235358952137SVincenzo Maffione#include <inttypes.h> 235458952137SVincenzo Maffione#include <net/if.h> 235558952137SVincenzo Maffione#include <net/netmap.h> 235658952137SVincenzo Maffione#include <net/netmap_user.h> 23570a985b37SVincenzo Maffione#if (NETMAP_API < 11) || (NETMAP_API > 15) 23580a985b37SVincenzo Maffione#error 23590a985b37SVincenzo Maffione#endif 236058952137SVincenzo Maffioneint main(void) { return 0; } 236158952137SVincenzo MaffioneEOF 236258952137SVincenzo Maffione if compile_prog "" "" ; then 236358952137SVincenzo Maffione netmap=yes 236458952137SVincenzo Maffione else 236558952137SVincenzo Maffione if test "$netmap" = "yes" ; then 236658952137SVincenzo Maffione feature_not_found "netmap" 236758952137SVincenzo Maffione fi 236858952137SVincenzo Maffione netmap=no 236958952137SVincenzo Maffione fi 237058952137SVincenzo Maffionefi 237158952137SVincenzo Maffione 237258952137SVincenzo Maffione########################################## 237347e98658SCorey Bryant# libcap-ng library probe 237447e98658SCorey Bryantif test "$cap_ng" != "no" ; then 237547e98658SCorey Bryant cap_libs="-lcap-ng" 237647e98658SCorey Bryant cat > $TMPC << EOF 237747e98658SCorey Bryant#include <cap-ng.h> 237847e98658SCorey Bryantint main(void) 237947e98658SCorey Bryant{ 238047e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 238147e98658SCorey Bryant return 0; 238247e98658SCorey Bryant} 238347e98658SCorey BryantEOF 238447e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 238547e98658SCorey Bryant cap_ng=yes 238647e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 238747e98658SCorey Bryant else 238847e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 238921684af0SStewart Smith feature_not_found "cap_ng" "Install libcap-ng devel" 239047e98658SCorey Bryant fi 239147e98658SCorey Bryant cap_ng=no 239247e98658SCorey Bryant fi 239347e98658SCorey Bryantfi 239447e98658SCorey Bryant 239547e98658SCorey Bryant########################################## 2396c2de5c91Smalc# Sound support libraries probe 23978f28f3fbSths 2398c2de5c91Smalcaudio_drv_probe() 2399c2de5c91Smalc{ 2400c2de5c91Smalc drv=$1 2401c2de5c91Smalc hdr=$2 2402c2de5c91Smalc lib=$3 2403c2de5c91Smalc exp=$4 2404c2de5c91Smalc cfl=$5 24058f28f3fbSths cat > $TMPC << EOF 2406c2de5c91Smalc#include <$hdr> 2407c2de5c91Smalcint main(void) { $exp } 24088f28f3fbSthsEOF 240952166aa0SJuan Quintela if compile_prog "$cfl" "$lib" ; then 24108f28f3fbSths : 24118f28f3fbSths else 241276ad07a4SPeter Maydell error_exit "$drv check failed" \ 241376ad07a4SPeter Maydell "Make sure to have the $drv libs and headers installed." 24148f28f3fbSths fi 2415c2de5c91Smalc} 2416c2de5c91Smalc 24172fa7d3bfSmalcaudio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` 2418c2de5c91Smalcfor drv in $audio_drv_list; do 2419c2de5c91Smalc case $drv in 2420c2de5c91Smalc alsa) 2421c2de5c91Smalc audio_drv_probe $drv alsa/asoundlib.h -lasound \ 2422e35bcb0cSStefan Weil "return snd_pcm_close((snd_pcm_t *)0);" 2423a4bf6780SJuan Quintela libs_softmmu="-lasound $libs_softmmu" 2424c2de5c91Smalc ;; 2425c2de5c91Smalc 2426c2de5c91Smalc fmod) 2427c2de5c91Smalc if test -z $fmod_lib || test -z $fmod_inc; then 242876ad07a4SPeter Maydell error_exit "You must specify path to FMOD library and headers" \ 242976ad07a4SPeter Maydell "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 24308f28f3fbSths fi 2431c2de5c91Smalc audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" 2432a4bf6780SJuan Quintela libs_softmmu="$fmod_lib $libs_softmmu" 2433c2de5c91Smalc ;; 2434c2de5c91Smalc 2435c2de5c91Smalc esd) 2436c2de5c91Smalc audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' 2437a4bf6780SJuan Quintela libs_softmmu="-lesd $libs_softmmu" 243867f86e8eSJuan Quintela audio_pt_int="yes" 2439c2de5c91Smalc ;; 2440b8e59f18Smalc 2441b8e59f18Smalc pa) 2442a394aed2SMarc-André Lureau audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ 2443a394aed2SMarc-André Lureau "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" 2444a394aed2SMarc-André Lureau libs_softmmu="-lpulse $libs_softmmu" 244567f86e8eSJuan Quintela audio_pt_int="yes" 2446b8e59f18Smalc ;; 2447b8e59f18Smalc 2448997e690aSJuan Quintela coreaudio) 2449997e690aSJuan Quintela libs_softmmu="-framework CoreAudio $libs_softmmu" 2450997e690aSJuan Quintela ;; 2451997e690aSJuan Quintela 2452a4bf6780SJuan Quintela dsound) 2453a4bf6780SJuan Quintela libs_softmmu="-lole32 -ldxguid $libs_softmmu" 2454d5631638Smalc audio_win_int="yes" 2455a4bf6780SJuan Quintela ;; 2456a4bf6780SJuan Quintela 2457a4bf6780SJuan Quintela oss) 2458a4bf6780SJuan Quintela libs_softmmu="$oss_lib $libs_softmmu" 2459a4bf6780SJuan Quintela ;; 2460a4bf6780SJuan Quintela 2461a4bf6780SJuan Quintela sdl|wav) 24622f6a1ab0Sblueswir1 # XXX: Probes for CoreAudio, DirectSound, SDL(?) 24632f6a1ab0Sblueswir1 ;; 24642f6a1ab0Sblueswir1 2465d5631638Smalc winwave) 2466d5631638Smalc libs_softmmu="-lwinmm $libs_softmmu" 2467d5631638Smalc audio_win_int="yes" 2468d5631638Smalc ;; 2469d5631638Smalc 2470e4c63a6aSmalc *) 24711c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 247276ad07a4SPeter Maydell error_exit "Unknown driver '$drv' selected" \ 247376ad07a4SPeter Maydell "Possible drivers are: $audio_possible_drivers" 2474e4c63a6aSmalc } 2475e4c63a6aSmalc ;; 2476c2de5c91Smalc esac 2477c2de5c91Smalcdone 24788f28f3fbSths 24794d3b6f6eSbalrog########################################## 24802e4d9fb1Saurel32# BrlAPI probe 24812e4d9fb1Saurel32 24824ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 2483eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 24842e4d9fb1Saurel32 cat > $TMPC << EOF 24852e4d9fb1Saurel32#include <brlapi.h> 2486832ce9c2SScott Wood#include <stddef.h> 24872e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 24882e4d9fb1Saurel32EOF 248952166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 24902e4d9fb1Saurel32 brlapi=yes 2491264606b3SJuan Quintela libs_softmmu="$brlapi_libs $libs_softmmu" 24924ffcedb6SJuan Quintela else 24934ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 249421684af0SStewart Smith feature_not_found "brlapi" "Install brlapi devel" 24954ffcedb6SJuan Quintela fi 24964ffcedb6SJuan Quintela brlapi=no 2497eb82284fSJuan Quintela fi 2498eb82284fSJuan Quintelafi 24992e4d9fb1Saurel32 25002e4d9fb1Saurel32########################################## 25014d3b6f6eSbalrog# curses probe 2502a3605bf6SMichael Tokarevif test "$curses" != "no" ; then 2503e095e2f3SStefan Weil if test "$mingw32" = "yes" ; then 2504e095e2f3SStefan Weil curses_list="-lpdcurses" 2505e095e2f3SStefan Weil else 2506cfeda5f4SEd Maste curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses" 2507e095e2f3SStefan Weil fi 2508c584a6d0SJuan Quintela curses_found=no 25094d3b6f6eSbalrog cat > $TMPC << EOF 25104d3b6f6eSbalrog#include <curses.h> 2511ef9a2524SStefan Weilint main(void) { 2512ef9a2524SStefan Weil const char *s = curses_version(); 2513ef9a2524SStefan Weil resize_term(0, 0); 2514ef9a2524SStefan Weil return s != 0; 2515ef9a2524SStefan Weil} 25164d3b6f6eSbalrogEOF 2517ecbe251fSVadim Evard IFS=: 25184f78ef9aSJuan Quintela for curses_lib in $curses_list; do 2519ecbe251fSVadim Evard unset IFS 25204f78ef9aSJuan Quintela if compile_prog "" "$curses_lib" ; then 2521c584a6d0SJuan Quintela curses_found=yes 25224f78ef9aSJuan Quintela libs_softmmu="$curses_lib $libs_softmmu" 25234f78ef9aSJuan Quintela break 25244d3b6f6eSbalrog fi 25254f78ef9aSJuan Quintela done 2526ecbe251fSVadim Evard unset IFS 2527c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 2528c584a6d0SJuan Quintela curses=yes 2529c584a6d0SJuan Quintela else 2530c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 253121684af0SStewart Smith feature_not_found "curses" "Install ncurses devel" 2532c584a6d0SJuan Quintela fi 2533c584a6d0SJuan Quintela curses=no 2534c584a6d0SJuan Quintela fi 25354f78ef9aSJuan Quintelafi 25364d3b6f6eSbalrog 2537414f0dabSblueswir1########################################## 2538769ce76dSAlexander Graf# curl probe 2539a3605bf6SMichael Tokarevif test "$curl" != "no" ; then 254065d5d3f9SStefan Weil if $pkg_config libcurl --exists; then 2541a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 25424e2b0658SPaolo Bonzini else 25434e2b0658SPaolo Bonzini curlconfig=curl-config 25444e2b0658SPaolo Bonzini fi 2545769ce76dSAlexander Graf cat > $TMPC << EOF 2546769ce76dSAlexander Graf#include <curl/curl.h> 25470b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 2548769ce76dSAlexander GrafEOF 25494e2b0658SPaolo Bonzini curl_cflags=`$curlconfig --cflags 2>/dev/null` 25504e2b0658SPaolo Bonzini curl_libs=`$curlconfig --libs 2>/dev/null` 2551b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 2552769ce76dSAlexander Graf curl=yes 2553788c8196SJuan Quintela else 2554788c8196SJuan Quintela if test "$curl" = "yes" ; then 255521684af0SStewart Smith feature_not_found "curl" "Install libcurl devel" 2556788c8196SJuan Quintela fi 2557788c8196SJuan Quintela curl=no 2558769ce76dSAlexander Graf fi 2559769ce76dSAlexander Graffi # test "$curl" 2560769ce76dSAlexander Graf 2561769ce76dSAlexander Graf########################################## 2562fb599c9aSbalrog# bluez support probe 2563a20a6f46SJuan Quintelaif test "$bluez" != "no" ; then 2564e820e3f4Sbalrog cat > $TMPC << EOF 2565e820e3f4Sbalrog#include <bluetooth/bluetooth.h> 2566e820e3f4Sbalrogint main(void) { return bt_error(0); } 2567e820e3f4SbalrogEOF 2568a8bd70adSPaolo Bonzini bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` 2569a8bd70adSPaolo Bonzini bluez_libs=`$pkg_config --libs bluez 2> /dev/null` 257052166aa0SJuan Quintela if compile_prog "$bluez_cflags" "$bluez_libs" ; then 2571a20a6f46SJuan Quintela bluez=yes 2572e482d56aSJuan Quintela libs_softmmu="$bluez_libs $libs_softmmu" 2573e820e3f4Sbalrog else 2574a20a6f46SJuan Quintela if test "$bluez" = "yes" ; then 257521684af0SStewart Smith feature_not_found "bluez" "Install bluez-libs/libbluetooth devel" 2576a20a6f46SJuan Quintela fi 2577e820e3f4Sbalrog bluez="no" 2578e820e3f4Sbalrog fi 2579fb599c9aSbalrogfi 2580fb599c9aSbalrog 2581fb599c9aSbalrog########################################## 2582e18df141SAnthony Liguori# glib support probe 2583a52d28afSPaolo Bonzini 2584a52d28afSPaolo Bonziniif test "$mingw32" = yes; then 2585a52d28afSPaolo Bonzini # g_poll is required in order to integrate with the glib main loop. 2586a52d28afSPaolo Bonzini glib_req_ver=2.20 2587a52d28afSPaolo Bonzinielse 2588a52d28afSPaolo Bonzini glib_req_ver=2.12 2589a52d28afSPaolo Bonzinifi 2590aa0d1f44SPaolo Bonziniglib_modules=gthread-2.0 2591aa0d1f44SPaolo Bonziniif test "$modules" = yes; then 2592aa0d1f44SPaolo Bonzini glib_modules="$glib_modules gmodule-2.0" 2593aa0d1f44SPaolo Bonzinifi 2594e26110cfSFam Zheng 2595aa0d1f44SPaolo Bonzinifor i in $glib_modules; do 2596e26110cfSFam Zheng if $pkg_config --atleast-version=$glib_req_ver $i; then 2597e26110cfSFam Zheng glib_cflags=`$pkg_config --cflags $i` 2598e26110cfSFam Zheng glib_libs=`$pkg_config --libs $i` 2599ba1183daSFam Zheng CFLAGS="$glib_cflags $CFLAGS" 260014015304SAnthony Liguori LIBS="$glib_libs $LIBS" 2601957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 2602e18df141SAnthony Liguori else 2603e26110cfSFam Zheng error_exit "glib-$glib_req_ver $i is required to compile QEMU" 2604e26110cfSFam Zheng fi 2605e26110cfSFam Zhengdone 2606e26110cfSFam Zheng 2607e26110cfSFam Zheng########################################## 2608e26110cfSFam Zheng# SHA command probe for modules 2609e26110cfSFam Zhengif test "$modules" = yes; then 2610e26110cfSFam Zheng shacmd_probe="sha1sum sha1 shasum" 2611e26110cfSFam Zheng for c in $shacmd_probe; do 2612e26110cfSFam Zheng if which $c &>/dev/null; then 2613e26110cfSFam Zheng shacmd="$c" 2614e26110cfSFam Zheng break 2615e26110cfSFam Zheng fi 2616e26110cfSFam Zheng done 2617e26110cfSFam Zheng if test "$shacmd" = ""; then 2618e26110cfSFam Zheng error_exit "one of the checksum commands is required to enable modules: $shacmd_probe" 2619e26110cfSFam Zheng fi 2620e18df141SAnthony Liguorifi 2621e18df141SAnthony Liguori 2622e18df141SAnthony Liguori########################################## 2623e2134eb9SGerd Hoffmann# pixman support probe 2624e2134eb9SGerd Hoffmann 2625e2134eb9SGerd Hoffmannif test "$pixman" = ""; then 262674880fe2SRobert Schiele if test "$want_tools" = "no" -a "$softmmu" = "no"; then 262774880fe2SRobert Schiele pixman="none" 262874880fe2SRobert Schiele elif $pkg_config pixman-1 > /dev/null 2>&1; then 2629e2134eb9SGerd Hoffmann pixman="system" 2630e2134eb9SGerd Hoffmann else 2631e2134eb9SGerd Hoffmann pixman="internal" 2632e2134eb9SGerd Hoffmann fi 2633e2134eb9SGerd Hoffmannfi 263474880fe2SRobert Schieleif test "$pixman" = "none"; then 263574880fe2SRobert Schiele if test "$want_tools" != "no" -o "$softmmu" != "no"; then 263676ad07a4SPeter Maydell error_exit "pixman disabled but system emulation or tools build" \ 263776ad07a4SPeter Maydell "enabled. You can turn off pixman only if you also" \ 263876ad07a4SPeter Maydell "disable all system emulation targets and the tools" \ 263976ad07a4SPeter Maydell "build with '--disable-tools --disable-system'." 264074880fe2SRobert Schiele fi 264174880fe2SRobert Schiele pixman_cflags= 264274880fe2SRobert Schiele pixman_libs= 264374880fe2SRobert Schieleelif test "$pixman" = "system"; then 2644ca871ec8SStefan Weil pixman_cflags=`$pkg_config --cflags pixman-1` 2645ca871ec8SStefan Weil pixman_libs=`$pkg_config --libs pixman-1` 2646e2134eb9SGerd Hoffmannelse 2647e2134eb9SGerd Hoffmann if test ! -d ${source_path}/pixman/pixman; then 264876ad07a4SPeter Maydell error_exit "pixman not present. Your options:" \ 264976ad07a4SPeter Maydell " (1) Preferred: Install the pixman devel package (any recent" \ 265076ad07a4SPeter Maydell " distro should have packages as Xorg needs pixman too)." \ 265176ad07a4SPeter Maydell " (2) Fetch the pixman submodule, using:" \ 265276ad07a4SPeter Maydell " git submodule update --init pixman" 2653e2134eb9SGerd Hoffmann fi 26545ca9388aSGerd Hoffmann mkdir -p pixman/pixman 26555ca9388aSGerd Hoffmann pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman" 26565ca9388aSGerd Hoffmann pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1" 2657e2134eb9SGerd Hoffmannfi 2658e2134eb9SGerd Hoffmann 2659e2134eb9SGerd Hoffmann########################################## 266017bff52bSM. Mohan Kumar# libcap probe 266117bff52bSM. Mohan Kumar 266217bff52bSM. Mohan Kumarif test "$cap" != "no" ; then 266317bff52bSM. Mohan Kumar cat > $TMPC <<EOF 266417bff52bSM. Mohan Kumar#include <stdio.h> 266517bff52bSM. Mohan Kumar#include <sys/capability.h> 2666cc939743SStefan Weilint main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } 266717bff52bSM. Mohan KumarEOF 266817bff52bSM. Mohan Kumar if compile_prog "" "-lcap" ; then 266917bff52bSM. Mohan Kumar cap=yes 267017bff52bSM. Mohan Kumar else 267117bff52bSM. Mohan Kumar cap=no 267217bff52bSM. Mohan Kumar fi 267317bff52bSM. Mohan Kumarfi 267417bff52bSM. Mohan Kumar 267517bff52bSM. Mohan Kumar########################################## 2676e5d355d1Saliguori# pthread probe 26774b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 26783c529d93Saliguori 2679e5d355d1Saliguoripthread=no 2680414f0dabSblueswir1cat > $TMPC << EOF 26813c529d93Saliguori#include <pthread.h> 26827a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 26837a42bbe4SStefan Weilint main(void) { 26847a42bbe4SStefan Weil pthread_t thread; 26857a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 26867a42bbe4SStefan Weil return 0; 26877a42bbe4SStefan Weil} 2688414f0dabSblueswir1EOF 2689bd00d539SAndreas Färberif compile_prog "" "" ; then 2690bd00d539SAndreas Färber pthread=yes 2691bd00d539SAndreas Färberelse 2692de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 269352166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 2694e5d355d1Saliguori pthread=yes 2695e3c56761SPeter Portante found=no 2696e3c56761SPeter Portante for lib_entry in $LIBS; do 2697e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 2698e3c56761SPeter Portante found=yes 2699e3c56761SPeter Portante break 2700e3c56761SPeter Portante fi 2701e3c56761SPeter Portante done 2702e3c56761SPeter Portante if test "$found" = "no"; then 27035572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 2704e3c56761SPeter Portante fi 2705de65fe0fSSebastian Herbszt break 2706414f0dabSblueswir1 fi 2707de65fe0fSSebastian Herbszt done 2708bd00d539SAndreas Färberfi 2709414f0dabSblueswir1 27104617e593SAnthony Liguoriif test "$mingw32" != yes -a "$pthread" = no; then 271176ad07a4SPeter Maydell error_exit "pthread check failed" \ 271276ad07a4SPeter Maydell "Make sure to have the pthread libs and headers installed." 2713e5d355d1Saliguorifi 2714e5d355d1Saliguori 2715bf9298b9Saliguori########################################## 2716f27aaf4bSChristian Brunner# rbd probe 2717f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 2718f27aaf4bSChristian Brunner cat > $TMPC <<EOF 2719f27aaf4bSChristian Brunner#include <stdio.h> 2720ad32e9c0SJosh Durgin#include <rbd/librbd.h> 2721f27aaf4bSChristian Brunnerint main(void) { 2722ad32e9c0SJosh Durgin rados_t cluster; 2723ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 2724f27aaf4bSChristian Brunner return 0; 2725f27aaf4bSChristian Brunner} 2726f27aaf4bSChristian BrunnerEOF 2727ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 2728f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 2729f27aaf4bSChristian Brunner rbd=yes 2730f27aaf4bSChristian Brunner else 2731f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 273221684af0SStewart Smith feature_not_found "rados block device" "Install librbd/ceph devel" 2733f27aaf4bSChristian Brunner fi 2734f27aaf4bSChristian Brunner rbd=no 2735f27aaf4bSChristian Brunner fi 2736f27aaf4bSChristian Brunnerfi 2737f27aaf4bSChristian Brunner 2738f27aaf4bSChristian Brunner########################################## 27390a12ec87SRichard W.M. Jones# libssh2 probe 27404fc16838SRichard W.M. Jonesmin_libssh2_version=1.2.8 27410a12ec87SRichard W.M. Jonesif test "$libssh2" != "no" ; then 274265d5d3f9SStefan Weil if $pkg_config --atleast-version=$min_libssh2_version libssh2; then 27430a12ec87SRichard W.M. Jones libssh2_cflags=`$pkg_config libssh2 --cflags` 27440a12ec87SRichard W.M. Jones libssh2_libs=`$pkg_config libssh2 --libs` 27450a12ec87SRichard W.M. Jones libssh2=yes 27460a12ec87SRichard W.M. Jones else 27470a12ec87SRichard W.M. Jones if test "$libssh2" = "yes" ; then 27484fc16838SRichard W.M. Jones error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2" 27490a12ec87SRichard W.M. Jones fi 27500a12ec87SRichard W.M. Jones libssh2=no 27510a12ec87SRichard W.M. Jones fi 27520a12ec87SRichard W.M. Jonesfi 27530a12ec87SRichard W.M. Jones 27540a12ec87SRichard W.M. Jones########################################## 27559a2d462eSRichard W.M. Jones# libssh2_sftp_fsync probe 27569a2d462eSRichard W.M. Jones 27579a2d462eSRichard W.M. Jonesif test "$libssh2" = "yes"; then 27589a2d462eSRichard W.M. Jones cat > $TMPC <<EOF 27599a2d462eSRichard W.M. Jones#include <stdio.h> 27609a2d462eSRichard W.M. Jones#include <libssh2.h> 27619a2d462eSRichard W.M. Jones#include <libssh2_sftp.h> 27629a2d462eSRichard W.M. Jonesint main(void) { 27639a2d462eSRichard W.M. Jones LIBSSH2_SESSION *session; 27649a2d462eSRichard W.M. Jones LIBSSH2_SFTP *sftp; 27659a2d462eSRichard W.M. Jones LIBSSH2_SFTP_HANDLE *sftp_handle; 27669a2d462eSRichard W.M. Jones session = libssh2_session_init (); 27679a2d462eSRichard W.M. Jones sftp = libssh2_sftp_init (session); 27689a2d462eSRichard W.M. Jones sftp_handle = libssh2_sftp_open (sftp, "/", 0, 0); 27699a2d462eSRichard W.M. Jones libssh2_sftp_fsync (sftp_handle); 27709a2d462eSRichard W.M. Jones return 0; 27719a2d462eSRichard W.M. Jones} 27729a2d462eSRichard W.M. JonesEOF 27739a2d462eSRichard W.M. Jones # libssh2_cflags/libssh2_libs defined in previous test. 27749a2d462eSRichard W.M. Jones if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then 27759a2d462eSRichard W.M. Jones QEMU_CFLAGS="-DHAS_LIBSSH2_SFTP_FSYNC $QEMU_CFLAGS" 27769a2d462eSRichard W.M. Jones fi 27779a2d462eSRichard W.M. Jonesfi 27789a2d462eSRichard W.M. Jones 27799a2d462eSRichard W.M. Jones########################################## 27805c6c3a6cSChristoph Hellwig# linux-aio probe 27815c6c3a6cSChristoph Hellwig 27825c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 27835c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 27845c6c3a6cSChristoph Hellwig#include <libaio.h> 27855c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 2786832ce9c2SScott Wood#include <stddef.h> 27875c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 27885c6c3a6cSChristoph HellwigEOF 27895c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 27905c6c3a6cSChristoph Hellwig linux_aio=yes 27915c6c3a6cSChristoph Hellwig else 27925c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 279321684af0SStewart Smith feature_not_found "linux AIO" "Install libaio devel" 27945c6c3a6cSChristoph Hellwig fi 27953cfcae3cSLuiz Capitulino linux_aio=no 27965c6c3a6cSChristoph Hellwig fi 27975c6c3a6cSChristoph Hellwigfi 27985c6c3a6cSChristoph Hellwig 27995c6c3a6cSChristoph Hellwig########################################## 28003b8acc11SPaolo Bonzini# TPM passthrough is only on x86 Linux 28013b8acc11SPaolo Bonzini 28023b8acc11SPaolo Bonziniif test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then 28033b8acc11SPaolo Bonzini tpm_passthrough=$tpm 28043b8acc11SPaolo Bonzinielse 28053b8acc11SPaolo Bonzini tpm_passthrough=no 28063b8acc11SPaolo Bonzinifi 28073b8acc11SPaolo Bonzini 28083b8acc11SPaolo Bonzini########################################## 2809583f6e7bSStefan Hajnoczi# adjust virtio-blk-data-plane based on linux-aio 2810583f6e7bSStefan Hajnoczi 2811583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" -a \ 2812583f6e7bSStefan Hajnoczi "$linux_aio" != "yes" ; then 281376ad07a4SPeter Maydell error_exit "virtio-blk-data-plane requires Linux AIO, please try --enable-linux-aio" 2814583f6e7bSStefan Hajnoczielif test -z "$virtio_blk_data_plane" ; then 2815583f6e7bSStefan Hajnoczi virtio_blk_data_plane=$linux_aio 2816583f6e7bSStefan Hajnoczifi 2817583f6e7bSStefan Hajnoczi 2818583f6e7bSStefan Hajnoczi########################################## 2819758e8e38SVenkateswararao Jujjuri (JV)# attr probe 2820758e8e38SVenkateswararao Jujjuri (JV) 2821758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 2822758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 2823758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 2824758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 2825f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 2826f2338fb4SPavel Borzenkov#include <attr/xattr.h> 2827f2338fb4SPavel Borzenkov#else 28284f26f2b6SAvi Kivity#include <sys/xattr.h> 2829f2338fb4SPavel Borzenkov#endif 2830758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 2831758e8e38SVenkateswararao Jujjuri (JV)EOF 28324f26f2b6SAvi Kivity if compile_prog "" "" ; then 28334f26f2b6SAvi Kivity attr=yes 28344f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 2835f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 2836758e8e38SVenkateswararao Jujjuri (JV) attr=yes 2837758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 28384f26f2b6SAvi Kivity libattr=yes 2839758e8e38SVenkateswararao Jujjuri (JV) else 2840758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 284121684af0SStewart Smith feature_not_found "ATTR" "Install libc6 or libattr devel" 2842758e8e38SVenkateswararao Jujjuri (JV) fi 2843758e8e38SVenkateswararao Jujjuri (JV) attr=no 2844758e8e38SVenkateswararao Jujjuri (JV) fi 2845758e8e38SVenkateswararao Jujjuri (JV)fi 2846758e8e38SVenkateswararao Jujjuri (JV) 2847758e8e38SVenkateswararao Jujjuri (JV)########################################## 2848bf9298b9Saliguori# iovec probe 2849bf9298b9Saliguoricat > $TMPC <<EOF 2850db34f0b3Sblueswir1#include <sys/types.h> 2851bf9298b9Saliguori#include <sys/uio.h> 2852db34f0b3Sblueswir1#include <unistd.h> 2853f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 2854bf9298b9SaliguoriEOF 2855bf9298b9Saliguoriiovec=no 285652166aa0SJuan Quintelaif compile_prog "" "" ; then 2857bf9298b9Saliguori iovec=yes 2858bf9298b9Saliguorifi 2859bf9298b9Saliguori 2860f652e6afSaurel32########################################## 2861ceb42de8Saliguori# preadv probe 2862ceb42de8Saliguoricat > $TMPC <<EOF 2863ceb42de8Saliguori#include <sys/types.h> 2864ceb42de8Saliguori#include <sys/uio.h> 2865ceb42de8Saliguori#include <unistd.h> 2866c075a723SBlue Swirlint main(void) { return preadv(0, 0, 0, 0); } 2867ceb42de8SaliguoriEOF 2868ceb42de8Saliguoripreadv=no 286952166aa0SJuan Quintelaif compile_prog "" "" ; then 2870ceb42de8Saliguori preadv=yes 2871ceb42de8Saliguorifi 2872ceb42de8Saliguori 2873ceb42de8Saliguori########################################## 2874f652e6afSaurel32# fdt probe 2875e169e1e1SPeter Maydell# fdt support is mandatory for at least some target architectures, 2876e169e1e1SPeter Maydell# so insist on it if we're building those system emulators. 2877e169e1e1SPeter Maydellfdt_required=no 2878e169e1e1SPeter Maydellfor target in $target_list; do 2879e169e1e1SPeter Maydell case $target in 28806a49fa95SAlexander Graf aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu) 2881e169e1e1SPeter Maydell fdt_required=yes 2882e169e1e1SPeter Maydell ;; 2883e169e1e1SPeter Maydell esac 2884e169e1e1SPeter Maydelldone 2885e169e1e1SPeter Maydell 2886e169e1e1SPeter Maydellif test "$fdt_required" = "yes"; then 2887e169e1e1SPeter Maydell if test "$fdt" = "no"; then 2888e169e1e1SPeter Maydell error_exit "fdt disabled but some requested targets require it." \ 2889e169e1e1SPeter Maydell "You can turn off fdt only if you also disable all the system emulation" \ 2890e169e1e1SPeter Maydell "targets which need it (by specifying a cut down --target-list)." 2891e169e1e1SPeter Maydell fi 2892e169e1e1SPeter Maydell fdt=yes 2893e169e1e1SPeter Maydellfi 2894e169e1e1SPeter Maydell 28952df87df7SJuan Quintelaif test "$fdt" != "no" ; then 2896b41af4baSJuan Quintela fdt_libs="-lfdt" 289796ce6545SPeter Crosthwaite # explicitly check for libfdt_env.h as it is missing in some stable installs 2898f652e6afSaurel32 cat > $TMPC << EOF 289996ce6545SPeter Crosthwaite#include <libfdt_env.h> 2900f652e6afSaurel32int main(void) { return 0; } 2901f652e6afSaurel32EOF 290252166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 2903a540f158SPeter Crosthwaite # system DTC is good - use it 2904f652e6afSaurel32 fdt=yes 2905a540f158SPeter Crosthwaite elif test -d ${source_path}/dtc/libfdt ; then 2906a540f158SPeter Crosthwaite # have submodule DTC - use it 2907a540f158SPeter Crosthwaite fdt=yes 2908a540f158SPeter Crosthwaite dtc_internal="yes" 2909a540f158SPeter Crosthwaite mkdir -p dtc 2910a540f158SPeter Crosthwaite if [ "$source_path" != `pwd` ] ; then 2911a540f158SPeter Crosthwaite symlink "$source_path/dtc/Makefile" "dtc/Makefile" 2912a540f158SPeter Crosthwaite symlink "$source_path/dtc/scripts" "dtc/scripts" 29132df87df7SJuan Quintela fi 2914a540f158SPeter Crosthwaite fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" 2915a540f158SPeter Crosthwaite fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs" 2916a540f158SPeter Crosthwaite elif test "$fdt" = "yes" ; then 2917a540f158SPeter Crosthwaite # have neither and want - prompt for system/submodule install 29183f281822SStewart Smith error_exit "DTC (libfdt) not present. Your options:" \ 29193f281822SStewart Smith " (1) Preferred: Install the DTC (libfdt) devel package" \ 2920a540f158SPeter Crosthwaite " (2) Fetch the DTC submodule, using:" \ 2921a540f158SPeter Crosthwaite " git submodule update --init dtc" 2922a540f158SPeter Crosthwaite else 2923a540f158SPeter Crosthwaite # don't have and don't want 2924de3a354aSMichael Walle fdt_libs= 29252df87df7SJuan Quintela fdt=no 2926f652e6afSaurel32 fi 2927f652e6afSaurel32fi 2928f652e6afSaurel32 2929a540f158SPeter Crosthwaitelibs_softmmu="$libs_softmmu $fdt_libs" 2930a540f158SPeter Crosthwaite 293120ff075bSMichael Walle########################################## 2932b1e5fff4SMichael Walle# GLX probe, used by milkymist-tmu2 2933b1e5fff4SMichael Walleif test "$glx" != "no" ; then 2934b1e5fff4SMichael Walle glx_libs="-lGL -lX11" 293520ff075bSMichael Walle cat > $TMPC << EOF 293620ff075bSMichael Walle#include <X11/Xlib.h> 293720ff075bSMichael Walle#include <GL/gl.h> 293820ff075bSMichael Walle#include <GL/glx.h> 2939d3fcbb16SMichael Walleint main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } 294020ff075bSMichael WalleEOF 2941d3fcbb16SMichael Walle if compile_prog "" "-lGL -lX11" ; then 2942b1e5fff4SMichael Walle glx=yes 294320ff075bSMichael Walle else 2944b1e5fff4SMichael Walle if test "$glx" = "yes" ; then 294521684af0SStewart Smith feature_not_found "glx" "Install GL devel (e.g. MESA)" 294620ff075bSMichael Walle fi 2947b1e5fff4SMichael Walle glx_libs= 2948b1e5fff4SMichael Walle glx=no 294920ff075bSMichael Walle fi 295020ff075bSMichael Wallefi 295120ff075bSMichael Walle 2952eb100396SBharata B Rao########################################## 2953eb100396SBharata B Rao# glusterfs probe 2954eb100396SBharata B Raoif test "$glusterfs" != "no" ; then 295565d5d3f9SStefan Weil if $pkg_config --atleast-version=3 glusterfs-api; then 2956e01bee08SBharata B Rao glusterfs="yes" 2957ca871ec8SStefan Weil glusterfs_cflags=`$pkg_config --cflags glusterfs-api` 2958ca871ec8SStefan Weil glusterfs_libs=`$pkg_config --libs glusterfs-api` 295965d5d3f9SStefan Weil if $pkg_config --atleast-version=5 glusterfs-api; then 29600c14fb47SBharata B Rao glusterfs_discard="yes" 29610c14fb47SBharata B Rao fi 29627c815372SBharata B Rao if $pkg_config --atleast-version=6 glusterfs-api; then 29637c815372SBharata B Rao glusterfs_zerofill="yes" 29647c815372SBharata B Rao fi 2965eb100396SBharata B Rao else 2966eb100396SBharata B Rao if test "$glusterfs" = "yes" ; then 296721684af0SStewart Smith feature_not_found "GlusterFS backend support" "Install glusterfs-api devel" 2968eb100396SBharata B Rao fi 2969e01bee08SBharata B Rao glusterfs="no" 2970eb100396SBharata B Rao fi 2971eb100396SBharata B Raofi 2972eb100396SBharata B Rao 297339386ac7Saurel32# Check for inotify functions when we are building linux-user 29743b3f24adSaurel32# emulator. This is done because older glibc versions don't 29753b3f24adSaurel32# have syscall stubs for these implemented. In that case we 29763b3f24adSaurel32# don't provide them even if kernel supports them. 29773b3f24adSaurel32# 29783b3f24adSaurel32inotify=no 29793b3f24adSaurel32cat > $TMPC << EOF 29803b3f24adSaurel32#include <sys/inotify.h> 29813b3f24adSaurel32 29823b3f24adSaurel32int 29833b3f24adSaurel32main(void) 29843b3f24adSaurel32{ 29853b3f24adSaurel32 /* try to start inotify */ 29868690e420Saurel32 return inotify_init(); 29873b3f24adSaurel32} 29883b3f24adSaurel32EOF 298952166aa0SJuan Quintelaif compile_prog "" "" ; then 29903b3f24adSaurel32 inotify=yes 29913b3f24adSaurel32fi 29923b3f24adSaurel32 2993c05c7a73SRiku Voipioinotify1=no 2994c05c7a73SRiku Voipiocat > $TMPC << EOF 2995c05c7a73SRiku Voipio#include <sys/inotify.h> 2996c05c7a73SRiku Voipio 2997c05c7a73SRiku Voipioint 2998c05c7a73SRiku Voipiomain(void) 2999c05c7a73SRiku Voipio{ 3000c05c7a73SRiku Voipio /* try to start inotify */ 3001c05c7a73SRiku Voipio return inotify_init1(0); 3002c05c7a73SRiku Voipio} 3003c05c7a73SRiku VoipioEOF 3004c05c7a73SRiku Voipioif compile_prog "" "" ; then 3005c05c7a73SRiku Voipio inotify1=yes 3006c05c7a73SRiku Voipiofi 3007c05c7a73SRiku Voipio 3008ebc996f3SRiku Voipio# check if utimensat and futimens are supported 3009ebc996f3SRiku Voipioutimens=no 3010ebc996f3SRiku Voipiocat > $TMPC << EOF 3011ebc996f3SRiku Voipio#define _ATFILE_SOURCE 3012ebc996f3SRiku Voipio#include <stddef.h> 3013ebc996f3SRiku Voipio#include <fcntl.h> 30143014ee00SPeter Maydell#include <sys/stat.h> 3015ebc996f3SRiku Voipio 3016ebc996f3SRiku Voipioint main(void) 3017ebc996f3SRiku Voipio{ 3018ebc996f3SRiku Voipio utimensat(AT_FDCWD, "foo", NULL, 0); 3019ebc996f3SRiku Voipio futimens(0, NULL); 3020ebc996f3SRiku Voipio return 0; 3021ebc996f3SRiku Voipio} 3022ebc996f3SRiku VoipioEOF 302352166aa0SJuan Quintelaif compile_prog "" "" ; then 3024ebc996f3SRiku Voipio utimens=yes 3025ebc996f3SRiku Voipiofi 3026ebc996f3SRiku Voipio 3027099d6b0fSRiku Voipio# check if pipe2 is there 3028099d6b0fSRiku Voipiopipe2=no 3029099d6b0fSRiku Voipiocat > $TMPC << EOF 3030099d6b0fSRiku Voipio#include <unistd.h> 3031099d6b0fSRiku Voipio#include <fcntl.h> 3032099d6b0fSRiku Voipio 3033099d6b0fSRiku Voipioint main(void) 3034099d6b0fSRiku Voipio{ 3035099d6b0fSRiku Voipio int pipefd[2]; 30369bca8162SBruce Rogers return pipe2(pipefd, O_CLOEXEC); 3037099d6b0fSRiku Voipio} 3038099d6b0fSRiku VoipioEOF 303952166aa0SJuan Quintelaif compile_prog "" "" ; then 3040099d6b0fSRiku Voipio pipe2=yes 3041099d6b0fSRiku Voipiofi 3042099d6b0fSRiku Voipio 304340ff6d7eSKevin Wolf# check if accept4 is there 304440ff6d7eSKevin Wolfaccept4=no 304540ff6d7eSKevin Wolfcat > $TMPC << EOF 304640ff6d7eSKevin Wolf#include <sys/socket.h> 304740ff6d7eSKevin Wolf#include <stddef.h> 304840ff6d7eSKevin Wolf 304940ff6d7eSKevin Wolfint main(void) 305040ff6d7eSKevin Wolf{ 305140ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 305240ff6d7eSKevin Wolf return 0; 305340ff6d7eSKevin Wolf} 305440ff6d7eSKevin WolfEOF 305540ff6d7eSKevin Wolfif compile_prog "" "" ; then 305640ff6d7eSKevin Wolf accept4=yes 305740ff6d7eSKevin Wolffi 305840ff6d7eSKevin Wolf 30593ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 30603ce34dfbSvibisreenivasansplice=no 30613ce34dfbSvibisreenivasancat > $TMPC << EOF 30623ce34dfbSvibisreenivasan#include <unistd.h> 30633ce34dfbSvibisreenivasan#include <fcntl.h> 30643ce34dfbSvibisreenivasan#include <limits.h> 30653ce34dfbSvibisreenivasan 30663ce34dfbSvibisreenivasanint main(void) 30673ce34dfbSvibisreenivasan{ 306866ea0f22SStefan Weil int len, fd = 0; 30693ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 30703ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 30713ce34dfbSvibisreenivasan return 0; 30723ce34dfbSvibisreenivasan} 30733ce34dfbSvibisreenivasanEOF 307452166aa0SJuan Quintelaif compile_prog "" "" ; then 30753ce34dfbSvibisreenivasan splice=yes 30763ce34dfbSvibisreenivasanfi 30773ce34dfbSvibisreenivasan 3078dcc38d1cSMarcelo Tosatti########################################## 3079dcc38d1cSMarcelo Tosatti# signalfd probe 3080dcc38d1cSMarcelo Tosattisignalfd="no" 3081dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 3082dcc38d1cSMarcelo Tosatti#include <unistd.h> 3083dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 3084dcc38d1cSMarcelo Tosatti#include <signal.h> 3085dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 3086dcc38d1cSMarcelo TosattiEOF 3087dcc38d1cSMarcelo Tosatti 3088dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 3089dcc38d1cSMarcelo Tosatti signalfd=yes 3090dcc38d1cSMarcelo Tosattifi 3091dcc38d1cSMarcelo Tosatti 3092c2882b96SRiku Voipio# check if eventfd is supported 3093c2882b96SRiku Voipioeventfd=no 3094c2882b96SRiku Voipiocat > $TMPC << EOF 3095c2882b96SRiku Voipio#include <sys/eventfd.h> 3096c2882b96SRiku Voipio 3097c2882b96SRiku Voipioint main(void) 3098c2882b96SRiku Voipio{ 309955cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 3100c2882b96SRiku Voipio} 3101c2882b96SRiku VoipioEOF 3102c2882b96SRiku Voipioif compile_prog "" "" ; then 3103c2882b96SRiku Voipio eventfd=yes 3104c2882b96SRiku Voipiofi 3105c2882b96SRiku Voipio 3106d0927938SUlrich Hecht# check for fallocate 3107d0927938SUlrich Hechtfallocate=no 3108d0927938SUlrich Hechtcat > $TMPC << EOF 3109d0927938SUlrich Hecht#include <fcntl.h> 3110d0927938SUlrich Hecht 3111d0927938SUlrich Hechtint main(void) 3112d0927938SUlrich Hecht{ 3113d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 3114d0927938SUlrich Hecht return 0; 3115d0927938SUlrich Hecht} 3116d0927938SUlrich HechtEOF 31178fb03151SPeter Maydellif compile_prog "" "" ; then 3118d0927938SUlrich Hecht fallocate=yes 3119d0927938SUlrich Hechtfi 3120d0927938SUlrich Hecht 31213d4fa43eSKusanagi Kouichi# check for fallocate hole punching 31223d4fa43eSKusanagi Kouichifallocate_punch_hole=no 31233d4fa43eSKusanagi Kouichicat > $TMPC << EOF 31243d4fa43eSKusanagi Kouichi#include <fcntl.h> 31253d4fa43eSKusanagi Kouichi#include <linux/falloc.h> 31263d4fa43eSKusanagi Kouichi 31273d4fa43eSKusanagi Kouichiint main(void) 31283d4fa43eSKusanagi Kouichi{ 31293d4fa43eSKusanagi Kouichi fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); 31303d4fa43eSKusanagi Kouichi return 0; 31313d4fa43eSKusanagi Kouichi} 31323d4fa43eSKusanagi KouichiEOF 31333d4fa43eSKusanagi Kouichiif compile_prog "" "" ; then 31343d4fa43eSKusanagi Kouichi fallocate_punch_hole=yes 31353d4fa43eSKusanagi Kouichifi 31363d4fa43eSKusanagi Kouichi 3137c727f47dSPeter Maydell# check for sync_file_range 3138c727f47dSPeter Maydellsync_file_range=no 3139c727f47dSPeter Maydellcat > $TMPC << EOF 3140c727f47dSPeter Maydell#include <fcntl.h> 3141c727f47dSPeter Maydell 3142c727f47dSPeter Maydellint main(void) 3143c727f47dSPeter Maydell{ 3144c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 3145c727f47dSPeter Maydell return 0; 3146c727f47dSPeter Maydell} 3147c727f47dSPeter MaydellEOF 31488fb03151SPeter Maydellif compile_prog "" "" ; then 3149c727f47dSPeter Maydell sync_file_range=yes 3150c727f47dSPeter Maydellfi 3151c727f47dSPeter Maydell 3152dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 3153dace20dcSPeter Maydellfiemap=no 3154dace20dcSPeter Maydellcat > $TMPC << EOF 3155dace20dcSPeter Maydell#include <sys/ioctl.h> 3156dace20dcSPeter Maydell#include <linux/fs.h> 3157dace20dcSPeter Maydell#include <linux/fiemap.h> 3158dace20dcSPeter Maydell 3159dace20dcSPeter Maydellint main(void) 3160dace20dcSPeter Maydell{ 3161dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 3162dace20dcSPeter Maydell return 0; 3163dace20dcSPeter Maydell} 3164dace20dcSPeter MaydellEOF 31658fb03151SPeter Maydellif compile_prog "" "" ; then 3166dace20dcSPeter Maydell fiemap=yes 3167dace20dcSPeter Maydellfi 3168dace20dcSPeter Maydell 3169d0927938SUlrich Hecht# check for dup3 3170d0927938SUlrich Hechtdup3=no 3171d0927938SUlrich Hechtcat > $TMPC << EOF 3172d0927938SUlrich Hecht#include <unistd.h> 3173d0927938SUlrich Hecht 3174d0927938SUlrich Hechtint main(void) 3175d0927938SUlrich Hecht{ 3176d0927938SUlrich Hecht dup3(0, 0, 0); 3177d0927938SUlrich Hecht return 0; 3178d0927938SUlrich Hecht} 3179d0927938SUlrich HechtEOF 318078f5d726SJan Kiszkaif compile_prog "" "" ; then 3181d0927938SUlrich Hecht dup3=yes 3182d0927938SUlrich Hechtfi 3183d0927938SUlrich Hecht 31844e0c6529SAlex Bligh# check for ppoll support 31854e0c6529SAlex Blighppoll=no 31864e0c6529SAlex Blighcat > $TMPC << EOF 31874e0c6529SAlex Bligh#include <poll.h> 31884e0c6529SAlex Bligh 31894e0c6529SAlex Blighint main(void) 31904e0c6529SAlex Bligh{ 31914e0c6529SAlex Bligh struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; 31924e0c6529SAlex Bligh ppoll(&pfd, 1, 0, 0); 31934e0c6529SAlex Bligh return 0; 31944e0c6529SAlex Bligh} 31954e0c6529SAlex BlighEOF 31964e0c6529SAlex Blighif compile_prog "" "" ; then 31974e0c6529SAlex Bligh ppoll=yes 31984e0c6529SAlex Blighfi 31994e0c6529SAlex Bligh 3200cd758dd0SAlex Bligh# check for prctl(PR_SET_TIMERSLACK , ... ) support 3201cd758dd0SAlex Blighprctl_pr_set_timerslack=no 3202cd758dd0SAlex Blighcat > $TMPC << EOF 3203cd758dd0SAlex Bligh#include <sys/prctl.h> 3204cd758dd0SAlex Bligh 3205cd758dd0SAlex Blighint main(void) 3206cd758dd0SAlex Bligh{ 3207cd758dd0SAlex Bligh prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); 3208cd758dd0SAlex Bligh return 0; 3209cd758dd0SAlex Bligh} 3210cd758dd0SAlex BlighEOF 3211cd758dd0SAlex Blighif compile_prog "" "" ; then 3212cd758dd0SAlex Bligh prctl_pr_set_timerslack=yes 3213cd758dd0SAlex Blighfi 3214cd758dd0SAlex Bligh 32153b6edd16SPeter Maydell# check for epoll support 32163b6edd16SPeter Maydellepoll=no 32173b6edd16SPeter Maydellcat > $TMPC << EOF 32183b6edd16SPeter Maydell#include <sys/epoll.h> 32193b6edd16SPeter Maydell 32203b6edd16SPeter Maydellint main(void) 32213b6edd16SPeter Maydell{ 32223b6edd16SPeter Maydell epoll_create(0); 32233b6edd16SPeter Maydell return 0; 32243b6edd16SPeter Maydell} 32253b6edd16SPeter MaydellEOF 32268fb03151SPeter Maydellif compile_prog "" "" ; then 32273b6edd16SPeter Maydell epoll=yes 32283b6edd16SPeter Maydellfi 32293b6edd16SPeter Maydell 32303b6edd16SPeter Maydell# epoll_create1 and epoll_pwait are later additions 32313b6edd16SPeter Maydell# so we must check separately for their presence 32323b6edd16SPeter Maydellepoll_create1=no 32333b6edd16SPeter Maydellcat > $TMPC << EOF 32343b6edd16SPeter Maydell#include <sys/epoll.h> 32353b6edd16SPeter Maydell 32363b6edd16SPeter Maydellint main(void) 32373b6edd16SPeter Maydell{ 323819e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 323919e83f6bSPeter Maydell * a function being called. This is necessary so that on 324019e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 324119e83f6bSPeter Maydell * the library but not declared in the header file we will 324219e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 324319e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 324419e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 324519e83f6bSPeter Maydell */ 3246c075a723SBlue Swirl return (int)(uintptr_t)&epoll_create1; 32473b6edd16SPeter Maydell} 32483b6edd16SPeter MaydellEOF 32498fb03151SPeter Maydellif compile_prog "" "" ; then 32503b6edd16SPeter Maydell epoll_create1=yes 32513b6edd16SPeter Maydellfi 32523b6edd16SPeter Maydell 32533b6edd16SPeter Maydellepoll_pwait=no 32543b6edd16SPeter Maydellcat > $TMPC << EOF 32553b6edd16SPeter Maydell#include <sys/epoll.h> 32563b6edd16SPeter Maydell 32573b6edd16SPeter Maydellint main(void) 32583b6edd16SPeter Maydell{ 32593b6edd16SPeter Maydell epoll_pwait(0, 0, 0, 0, 0); 32603b6edd16SPeter Maydell return 0; 32613b6edd16SPeter Maydell} 32623b6edd16SPeter MaydellEOF 32638fb03151SPeter Maydellif compile_prog "" "" ; then 32643b6edd16SPeter Maydell epoll_pwait=yes 32653b6edd16SPeter Maydellfi 32663b6edd16SPeter Maydell 3267a8fd1abaSPeter Maydell# check for sendfile support 3268a8fd1abaSPeter Maydellsendfile=no 3269a8fd1abaSPeter Maydellcat > $TMPC << EOF 3270a8fd1abaSPeter Maydell#include <sys/sendfile.h> 3271a8fd1abaSPeter Maydell 3272a8fd1abaSPeter Maydellint main(void) 3273a8fd1abaSPeter Maydell{ 3274a8fd1abaSPeter Maydell return sendfile(0, 0, 0, 0); 3275a8fd1abaSPeter Maydell} 3276a8fd1abaSPeter MaydellEOF 3277a8fd1abaSPeter Maydellif compile_prog "" "" ; then 3278a8fd1abaSPeter Maydell sendfile=yes 3279a8fd1abaSPeter Maydellfi 3280a8fd1abaSPeter Maydell 3281cc8ae6deSpbrook# Check if tools are available to build documentation. 3282a25dba17SJuan Quintelaif test "$docs" != "no" ; then 328301668d98SStefan Weil if has makeinfo && has pod2man; then 3284a25dba17SJuan Quintela docs=yes 328583a3ab8bSJuan Quintela else 3286a25dba17SJuan Quintela if test "$docs" = "yes" ; then 328721684af0SStewart Smith feature_not_found "docs" "Install texinfo and Perl/perl-podlators" 328883a3ab8bSJuan Quintela fi 3289a25dba17SJuan Quintela docs=no 329083a3ab8bSJuan Quintela fi 3291cc8ae6deSpbrookfi 3292cc8ae6deSpbrook 3293f514f41cSStefan Weil# Search for bswap_32 function 32946ae9a1f4SJuan Quintelabyteswap_h=no 32956ae9a1f4SJuan Quintelacat > $TMPC << EOF 32966ae9a1f4SJuan Quintela#include <byteswap.h> 32976ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 32986ae9a1f4SJuan QuintelaEOF 329952166aa0SJuan Quintelaif compile_prog "" "" ; then 33006ae9a1f4SJuan Quintela byteswap_h=yes 33016ae9a1f4SJuan Quintelafi 33026ae9a1f4SJuan Quintela 330375f13596SStefan Weil# Search for bswap32 function 33046ae9a1f4SJuan Quintelabswap_h=no 33056ae9a1f4SJuan Quintelacat > $TMPC << EOF 33066ae9a1f4SJuan Quintela#include <sys/endian.h> 33076ae9a1f4SJuan Quintela#include <sys/types.h> 33086ae9a1f4SJuan Quintela#include <machine/bswap.h> 33096ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 33106ae9a1f4SJuan QuintelaEOF 331152166aa0SJuan Quintelaif compile_prog "" "" ; then 33126ae9a1f4SJuan Quintela bswap_h=yes 33136ae9a1f4SJuan Quintelafi 33146ae9a1f4SJuan Quintela 3315da93a1fdSaliguori########################################## 3316c589b249SRonnie Sahlberg# Do we have libiscsi 3317063c3378SPeter Lieven# We check for iscsi_write16_sync() to make sure we have a 3318063c3378SPeter Lieven# at least version 1.4.0 of libiscsi. 3319c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 3320c589b249SRonnie Sahlberg cat > $TMPC << EOF 3321fa6acb0cSRonnie Sahlberg#include <stdio.h> 3322c589b249SRonnie Sahlberg#include <iscsi/iscsi.h> 3323063c3378SPeter Lievenint main(void) { iscsi_write16_sync(NULL,0,0,NULL,0,0,0,0,0,0,0); return 0; } 3324c589b249SRonnie SahlbergEOF 332565d5d3f9SStefan Weil if $pkg_config --atleast-version=1.7.0 libiscsi; then 33263c33ea96SPaolo Bonzini libiscsi="yes" 3327ca871ec8SStefan Weil libiscsi_cflags=$($pkg_config --cflags libiscsi) 3328ca871ec8SStefan Weil libiscsi_libs=$($pkg_config --libs libiscsi) 33293c33ea96SPaolo Bonzini elif compile_prog "" "-liscsi" ; then 3330c589b249SRonnie Sahlberg libiscsi="yes" 33316ebc91e5SFam Zheng libiscsi_libs="-liscsi" 3332c589b249SRonnie Sahlberg else 3333c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 333421684af0SStewart Smith feature_not_found "libiscsi" "Install libiscsi devel" 3335c589b249SRonnie Sahlberg fi 3336c589b249SRonnie Sahlberg libiscsi="no" 3337c589b249SRonnie Sahlberg fi 3338c589b249SRonnie Sahlbergfi 3339c589b249SRonnie Sahlberg 3340219c2521SStefan Weil# We also need to know the API version because there was an 3341219c2521SStefan Weil# API change from 1.4.0 to 1.5.0. 3342219c2521SStefan Weilif test "$libiscsi" = "yes"; then 3343219c2521SStefan Weil cat >$TMPC <<EOF 3344219c2521SStefan Weil#include <iscsi/iscsi.h> 3345219c2521SStefan Weilint main(void) 3346219c2521SStefan Weil{ 3347219c2521SStefan Weil iscsi_read10_task(0, 0, 0, 0, 0, 0, 0); 3348219c2521SStefan Weil return 0; 3349219c2521SStefan Weil} 3350219c2521SStefan WeilEOF 3351219c2521SStefan Weil if compile_prog "" "-liscsi"; then 3352219c2521SStefan Weil libiscsi_version="1.4.0" 3353219c2521SStefan Weil fi 3354219c2521SStefan Weilfi 3355c589b249SRonnie Sahlberg 3356c589b249SRonnie Sahlberg########################################## 33578bacde8dSNatanael Copa# Do we need libm 33588bacde8dSNatanael Copacat > $TMPC << EOF 33598bacde8dSNatanael Copa#include <math.h> 33608bacde8dSNatanael Copaint main(void) { return isnan(sin(0.0)); } 33618bacde8dSNatanael CopaEOF 33628bacde8dSNatanael Copaif compile_prog "" "" ; then 33638bacde8dSNatanael Copa : 33648bacde8dSNatanael Copaelif compile_prog "" "-lm" ; then 33658bacde8dSNatanael Copa LIBS="-lm $LIBS" 33668bacde8dSNatanael Copa libs_qga="-lm $libs_qga" 33678bacde8dSNatanael Copaelse 336876ad07a4SPeter Maydell error_exit "libm check failed" 33698bacde8dSNatanael Copafi 33708bacde8dSNatanael Copa 33718bacde8dSNatanael Copa########################################## 3372da93a1fdSaliguori# Do we need librt 33738bacde8dSNatanael Copa# uClibc provides 2 versions of clock_gettime(), one with realtime 33748bacde8dSNatanael Copa# support and one without. This means that the clock_gettime() don't 33758bacde8dSNatanael Copa# need -lrt. We still need it for timer_create() so we check for this 33768bacde8dSNatanael Copa# function in addition. 3377da93a1fdSaliguoricat > $TMPC <<EOF 3378da93a1fdSaliguori#include <signal.h> 3379da93a1fdSaliguori#include <time.h> 33808bacde8dSNatanael Copaint main(void) { 33818bacde8dSNatanael Copa timer_create(CLOCK_REALTIME, NULL, NULL); 33828bacde8dSNatanael Copa return clock_gettime(CLOCK_REALTIME, NULL); 33838bacde8dSNatanael Copa} 3384da93a1fdSaliguoriEOF 3385da93a1fdSaliguori 338652166aa0SJuan Quintelaif compile_prog "" "" ; then 338707ffa4bdSJuan Quintela : 33888bacde8dSNatanael Copa# we need pthread for static linking. use previous pthread test result 33898bacde8dSNatanael Copaelif compile_prog "" "-lrt $pthread_lib" ; then 339007ffa4bdSJuan Quintela LIBS="-lrt $LIBS" 33918bacde8dSNatanael Copa libs_qga="-lrt $libs_qga" 3392da93a1fdSaliguorifi 3393da93a1fdSaliguori 339431ff504dSBlue Swirlif test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ 3395179cf400SAndreas Färber "$aix" != "yes" -a "$haiku" != "yes" ; then 33966362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 33976362a53fSJuan Quintelafi 33986362a53fSJuan Quintela 3399de5071c5SBlue Swirl########################################## 3400cd4ec0b4SGerd Hoffmann# spice probe 3401cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 3402cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 3403cd4ec0b4SGerd Hoffmann#include <spice.h> 3404cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 3405cd4ec0b4SGerd HoffmannEOF 3406710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 3407710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 340865d5d3f9SStefan Weil if $pkg_config --atleast-version=0.12.0 spice-server && \ 340965d5d3f9SStefan Weil $pkg_config --atleast-version=0.12.3 spice-protocol && \ 3410cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 3411cd4ec0b4SGerd Hoffmann spice="yes" 3412cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 3413cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 34142e0e3c39SAlon Levy spice_protocol_version=$($pkg_config --modversion spice-protocol) 34152e0e3c39SAlon Levy spice_server_version=$($pkg_config --modversion spice-server) 3416cd4ec0b4SGerd Hoffmann else 3417cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 341821684af0SStewart Smith feature_not_found "spice" "Install spice-server and spice-protocol devel" 3419cd4ec0b4SGerd Hoffmann fi 3420cd4ec0b4SGerd Hoffmann spice="no" 3421cd4ec0b4SGerd Hoffmann fi 3422cd4ec0b4SGerd Hoffmannfi 3423cd4ec0b4SGerd Hoffmann 3424111a38b0SRobert Relyea# check for libcacard for smartcard support 3425111a38b0SRobert Relyeasmartcard_cflags="" 3426111a38b0SRobert Relyea# TODO - what's the minimal nss version we support? 3427111a38b0SRobert Relyeaif test "$smartcard_nss" != "no"; then 34285f01e06fSSergei Trofimovich cat > $TMPC << EOF 34295f01e06fSSergei Trofimovich#include <pk11pub.h> 34305f01e06fSSergei Trofimovichint main(void) { PK11_FreeSlot(0); return 0; } 34315f01e06fSSergei TrofimovichEOF 34320b22ef0fSPeter Maydell smartcard_includes="-I\$(SRC_PATH)/libcacard" 34338c741c22SAlon Levy libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" 34348c741c22SAlon Levy libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" 34356ca026cbSPeter Maydell test_cflags="$libcacard_cflags" 34366ca026cbSPeter Maydell # The header files in nss < 3.13.3 have a bug which causes them to 34376ca026cbSPeter Maydell # emit a warning. If we're going to compile QEMU with -Werror, then 34386ca026cbSPeter Maydell # test that the headers don't have this bug. Otherwise we would pass 34396ca026cbSPeter Maydell # the configure test but fail to compile QEMU later. 34406ca026cbSPeter Maydell if test "$werror" = "yes"; then 34416ca026cbSPeter Maydell test_cflags="-Werror $test_cflags" 34426ca026cbSPeter Maydell fi 3443b6fc675bSPaolo Bonzini if test -n "$libtool" && 344465d5d3f9SStefan Weil $pkg_config --atleast-version=3.12.8 nss && \ 34456ca026cbSPeter Maydell compile_prog "$test_cflags" "$libcacard_libs"; then 34465f01e06fSSergei Trofimovich smartcard_nss="yes" 34470b22ef0fSPeter Maydell QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" 34480b22ef0fSPeter Maydell QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" 3449ad4cf3f6SPaul Brook libs_softmmu="$libcacard_libs $libs_softmmu" 3450111a38b0SRobert Relyea else 3451111a38b0SRobert Relyea if test "$smartcard_nss" = "yes"; then 3452111a38b0SRobert Relyea feature_not_found "nss" 3453111a38b0SRobert Relyea fi 3454111a38b0SRobert Relyea smartcard_nss="no" 3455111a38b0SRobert Relyea fi 3456111a38b0SRobert Relyeafi 3457111a38b0SRobert Relyea 34582b2325ffSGerd Hoffmann# check for libusb 34592b2325ffSGerd Hoffmannif test "$libusb" != "no" ; then 346065d5d3f9SStefan Weil if $pkg_config --atleast-version=1.0.13 libusb-1.0; then 34612b2325ffSGerd Hoffmann libusb="yes" 3462ca871ec8SStefan Weil libusb_cflags=$($pkg_config --cflags libusb-1.0) 3463ca871ec8SStefan Weil libusb_libs=$($pkg_config --libs libusb-1.0) 34642b2325ffSGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" 34652b2325ffSGerd Hoffmann libs_softmmu="$libs_softmmu $libusb_libs" 34662b2325ffSGerd Hoffmann else 34672b2325ffSGerd Hoffmann if test "$libusb" = "yes"; then 346821684af0SStewart Smith feature_not_found "libusb" "Install libusb devel" 34692b2325ffSGerd Hoffmann fi 34702b2325ffSGerd Hoffmann libusb="no" 34712b2325ffSGerd Hoffmann fi 34722b2325ffSGerd Hoffmannfi 34732b2325ffSGerd Hoffmann 347469354a83SHans de Goede# check for usbredirparser for usb network redirection support 347569354a83SHans de Goedeif test "$usb_redir" != "no" ; then 347665d5d3f9SStefan Weil if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then 347769354a83SHans de Goede usb_redir="yes" 3478ca871ec8SStefan Weil usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) 3479ca871ec8SStefan Weil usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) 348069354a83SHans de Goede QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" 348156ab2ad1SAurelien Jarno libs_softmmu="$libs_softmmu $usb_redir_libs" 348269354a83SHans de Goede else 348369354a83SHans de Goede if test "$usb_redir" = "yes"; then 348421684af0SStewart Smith feature_not_found "usb-redir" "Install usbredir devel" 348569354a83SHans de Goede fi 348669354a83SHans de Goede usb_redir="no" 348769354a83SHans de Goede fi 348869354a83SHans de Goedefi 348969354a83SHans de Goede 3490cd4ec0b4SGerd Hoffmann########################################## 3491d9840e25STomoki Sekiyama# check if we have VSS SDK headers for win 3492d9840e25STomoki Sekiyama 3493d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then 3494d9840e25STomoki Sekiyama case "$vss_win32_sdk" in 3495d9840e25STomoki Sekiyama "") vss_win32_include="-I$source_path" ;; 3496d9840e25STomoki Sekiyama *\ *) # The SDK is installed in "Program Files" by default, but we cannot 3497d9840e25STomoki Sekiyama # handle path with spaces. So we symlink the headers into ".sdk/vss". 3498d9840e25STomoki Sekiyama vss_win32_include="-I$source_path/.sdk/vss" 3499d9840e25STomoki Sekiyama symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" 3500d9840e25STomoki Sekiyama ;; 3501d9840e25STomoki Sekiyama *) vss_win32_include="-I$vss_win32_sdk" 3502d9840e25STomoki Sekiyama esac 3503d9840e25STomoki Sekiyama cat > $TMPC << EOF 3504d9840e25STomoki Sekiyama#define __MIDL_user_allocate_free_DEFINED__ 3505d9840e25STomoki Sekiyama#include <inc/win2003/vss.h> 3506d9840e25STomoki Sekiyamaint main(void) { return VSS_CTX_BACKUP; } 3507d9840e25STomoki SekiyamaEOF 3508d9840e25STomoki Sekiyama if compile_prog "$vss_win32_include" "" ; then 3509d9840e25STomoki Sekiyama guest_agent_with_vss="yes" 3510d9840e25STomoki Sekiyama QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" 3511d9840e25STomoki Sekiyama libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" 3512d9840e25STomoki Sekiyama else 3513d9840e25STomoki Sekiyama if test "$vss_win32_sdk" != "" ; then 3514d9840e25STomoki Sekiyama echo "ERROR: Please download and install Microsoft VSS SDK:" 3515d9840e25STomoki Sekiyama echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" 3516d9840e25STomoki Sekiyama echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" 3517d9840e25STomoki Sekiyama echo "ERROR: scripts/extract-vsssdk-headers setup.exe" 3518d9840e25STomoki Sekiyama echo "ERROR: The headers are extracted in the directory \`inc'." 3519d9840e25STomoki Sekiyama feature_not_found "VSS support" 3520d9840e25STomoki Sekiyama fi 3521d9840e25STomoki Sekiyama guest_agent_with_vss="no" 3522d9840e25STomoki Sekiyama fi 3523d9840e25STomoki Sekiyamafi 3524d9840e25STomoki Sekiyama 3525d9840e25STomoki Sekiyama########################################## 3526d9840e25STomoki Sekiyama# lookup Windows platform SDK (if not specified) 3527d9840e25STomoki Sekiyama# The SDK is needed only to build .tlb (type library) file of guest agent 3528d9840e25STomoki Sekiyama# VSS provider from the source. It is usually unnecessary because the 3529d9840e25STomoki Sekiyama# pre-compiled .tlb file is included. 3530d9840e25STomoki Sekiyama 3531d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then 3532d9840e25STomoki Sekiyama if test -z "$win_sdk"; then 3533d9840e25STomoki Sekiyama programfiles="$PROGRAMFILES" 3534d9840e25STomoki Sekiyama test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" 3535d9840e25STomoki Sekiyama if test -n "$programfiles"; then 3536d9840e25STomoki Sekiyama win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null 3537d9840e25STomoki Sekiyama else 3538d9840e25STomoki Sekiyama feature_not_found "Windows SDK" 3539d9840e25STomoki Sekiyama fi 3540d9840e25STomoki Sekiyama elif test "$win_sdk" = "no"; then 3541d9840e25STomoki Sekiyama win_sdk="" 3542d9840e25STomoki Sekiyama fi 3543d9840e25STomoki Sekiyamafi 3544d9840e25STomoki Sekiyama 3545d9840e25STomoki Sekiyama########################################## 3546cd4ec0b4SGerd Hoffmann 3547747bbdf7SBlue Swirl########################################## 35485f6b9e8fSBlue Swirl# check if we have fdatasync 35495f6b9e8fSBlue Swirl 35505f6b9e8fSBlue Swirlfdatasync=no 35515f6b9e8fSBlue Swirlcat > $TMPC << EOF 35525f6b9e8fSBlue Swirl#include <unistd.h> 3553d1722a27SAlexandre Raymondint main(void) { 3554d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 3555d1722a27SAlexandre Raymondreturn fdatasync(0); 3556d1722a27SAlexandre Raymond#else 3557e172fe11SStefan Weil#error Not supported 3558d1722a27SAlexandre Raymond#endif 3559d1722a27SAlexandre Raymond} 35605f6b9e8fSBlue SwirlEOF 35615f6b9e8fSBlue Swirlif compile_prog "" "" ; then 35625f6b9e8fSBlue Swirl fdatasync=yes 35635f6b9e8fSBlue Swirlfi 35645f6b9e8fSBlue Swirl 356594a420b1SStefan Hajnoczi########################################## 3566e78815a5SAndreas Färber# check if we have madvise 3567e78815a5SAndreas Färber 3568e78815a5SAndreas Färbermadvise=no 3569e78815a5SAndreas Färbercat > $TMPC << EOF 3570e78815a5SAndreas Färber#include <sys/types.h> 3571e78815a5SAndreas Färber#include <sys/mman.h> 3572832ce9c2SScott Wood#include <stddef.h> 3573e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 3574e78815a5SAndreas FärberEOF 3575e78815a5SAndreas Färberif compile_prog "" "" ; then 3576e78815a5SAndreas Färber madvise=yes 3577e78815a5SAndreas Färberfi 3578e78815a5SAndreas Färber 3579e78815a5SAndreas Färber########################################## 3580e78815a5SAndreas Färber# check if we have posix_madvise 3581e78815a5SAndreas Färber 3582e78815a5SAndreas Färberposix_madvise=no 3583e78815a5SAndreas Färbercat > $TMPC << EOF 3584e78815a5SAndreas Färber#include <sys/mman.h> 3585832ce9c2SScott Wood#include <stddef.h> 3586e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 3587e78815a5SAndreas FärberEOF 3588e78815a5SAndreas Färberif compile_prog "" "" ; then 3589e78815a5SAndreas Färber posix_madvise=yes 3590e78815a5SAndreas Färberfi 3591e78815a5SAndreas Färber 3592e78815a5SAndreas Färber########################################## 35931e9737daSRichard Henderson# check if we have usable SIGEV_THREAD_ID 35941e9737daSRichard Henderson 35951e9737daSRichard Hendersonsigev_thread_id=no 35961e9737daSRichard Hendersoncat > $TMPC << EOF 35971e9737daSRichard Henderson#include <signal.h> 35981e9737daSRichard Hendersonint main(void) { 35991e9737daSRichard Henderson struct sigevent ev; 36001e9737daSRichard Henderson ev.sigev_notify = SIGEV_THREAD_ID; 36011e9737daSRichard Henderson ev._sigev_un._tid = 0; 36021e9737daSRichard Henderson asm volatile("" : : "g"(&ev)); 36031e9737daSRichard Henderson return 0; 36041e9737daSRichard Henderson} 36051e9737daSRichard HendersonEOF 36061e9737daSRichard Hendersonif compile_prog "" "" ; then 36071e9737daSRichard Henderson sigev_thread_id=yes 36081e9737daSRichard Hendersonfi 36091e9737daSRichard Henderson 36101e9737daSRichard Henderson########################################## 361194a420b1SStefan Hajnoczi# check if trace backend exists 361294a420b1SStefan Hajnoczi 3613650ab98dSLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null 361494a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 361576ad07a4SPeter Maydell error_exit "invalid trace backend" \ 361676ad07a4SPeter Maydell "Please choose a supported trace backend." 361794a420b1SStefan Hajnoczifi 361894a420b1SStefan Hajnoczi 36197e24e92aSStefan Hajnoczi########################################## 36207e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 36217e24e92aSStefan Hajnocziif test "$trace_backend" = "ust"; then 36227e24e92aSStefan Hajnoczi cat > $TMPC << EOF 3623bf15f63cSMohamad Gebai#include <lttng/tracepoint.h> 36247e24e92aSStefan Hajnocziint main(void) { return 0; } 36257e24e92aSStefan HajnocziEOF 36267e24e92aSStefan Hajnoczi if compile_prog "" "" ; then 3627bf15f63cSMohamad Gebai if $pkg_config lttng-ust --exists; then 3628bf15f63cSMohamad Gebai lttng_ust_libs=`$pkg_config --libs lttng-ust` 36297e24e92aSStefan Hajnoczi else 3630bf15f63cSMohamad Gebai lttng_ust_libs="-llttng-ust" 3631bf15f63cSMohamad Gebai fi 3632bf15f63cSMohamad Gebai if $pkg_config liburcu-bp --exists; then 3633bf15f63cSMohamad Gebai urcu_bp_libs=`$pkg_config --libs liburcu-bp` 3634bf15f63cSMohamad Gebai else 3635bf15f63cSMohamad Gebai urcu_bp_libs="-lurcu-bp" 3636bf15f63cSMohamad Gebai fi 3637bf15f63cSMohamad Gebai 3638bf15f63cSMohamad Gebai LIBS="$lttng_ust_libs $urcu_bp_libs $LIBS" 3639bf15f63cSMohamad Gebai libs_qga="$lttng_ust_libs $urcu_bp_libs $libs_qga" 3640bf15f63cSMohamad Gebai else 3641bf15f63cSMohamad Gebai error_exit "Trace backend 'ust' missing lttng-ust header files" 36427e24e92aSStefan Hajnoczi fi 36437e24e92aSStefan Hajnoczifi 3644b3d08c02SDaniel P. Berrange 3645b3d08c02SDaniel P. Berrange########################################## 3646b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 3647b3d08c02SDaniel P. Berrangeif test "$trace_backend" = "dtrace"; then 3648b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 364976ad07a4SPeter Maydell error_exit "dtrace command is not found in PATH $PATH" 3650b3d08c02SDaniel P. Berrange fi 3651c276b17dSDaniel P. Berrange trace_backend_stap="no" 3652c276b17dSDaniel P. Berrange if has 'stap' ; then 3653c276b17dSDaniel P. Berrange trace_backend_stap="yes" 3654c276b17dSDaniel P. Berrange fi 3655b3d08c02SDaniel P. Berrangefi 3656b3d08c02SDaniel P. Berrange 36577e24e92aSStefan Hajnoczi########################################## 3658519175a2SAlex Barcelo# check and set a backend for coroutine 3659d0e2fce5SAneesh Kumar K.V 36607c2acc70SPeter Maydell# We prefer ucontext, but it's not always possible. The fallback 36617c2acc70SPeter Maydell# is sigcontext. gthread is not selectable except explicitly, because 36627c2acc70SPeter Maydell# it is not functional enough to run QEMU proper. (It is occasionally 36637c2acc70SPeter Maydell# useful for debugging purposes.) On Windows the only valid backend 36647c2acc70SPeter Maydell# is the Windows-specific one. 36657c2acc70SPeter Maydell 36667c2acc70SPeter Maydellucontext_works=no 3667d0e2fce5SAneesh Kumar K.Vif test "$darwin" != "yes"; then 3668d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 3669d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 3670cdf84806SPeter Maydell#ifdef __stub_makecontext 3671cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 3672cdf84806SPeter Maydell#endif 367375cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 3674d0e2fce5SAneesh Kumar K.VEOF 3675d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 36767c2acc70SPeter Maydell ucontext_works=yes 3677d0e2fce5SAneesh Kumar K.V fi 3678519175a2SAlex Barcelofi 36797c2acc70SPeter Maydell 36807c2acc70SPeter Maydellif test "$coroutine" = ""; then 36817c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 36827c2acc70SPeter Maydell coroutine=win32 36837c2acc70SPeter Maydell elif test "$ucontext_works" = "yes"; then 36847c2acc70SPeter Maydell coroutine=ucontext 3685519175a2SAlex Barcelo else 36867c2acc70SPeter Maydell coroutine=sigaltstack 36877c2acc70SPeter Maydell fi 36887c2acc70SPeter Maydellelse 36897c2acc70SPeter Maydell case $coroutine in 36907c2acc70SPeter Maydell windows) 36917c2acc70SPeter Maydell if test "$mingw32" != "yes"; then 36927c2acc70SPeter Maydell error_exit "'windows' coroutine backend only valid for Windows" 36937c2acc70SPeter Maydell fi 36947c2acc70SPeter Maydell # Unfortunately the user visible backend name doesn't match the 36957c2acc70SPeter Maydell # coroutine-*.c filename for this case, so we have to adjust it here. 36967c2acc70SPeter Maydell coroutine=win32 36977c2acc70SPeter Maydell ;; 36987c2acc70SPeter Maydell ucontext) 36997c2acc70SPeter Maydell if test "$ucontext_works" != "yes"; then 37007c2acc70SPeter Maydell feature_not_found "ucontext" 37017c2acc70SPeter Maydell fi 37027c2acc70SPeter Maydell ;; 37037c2acc70SPeter Maydell gthread|sigaltstack) 37047c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 37057c2acc70SPeter Maydell error_exit "only the 'windows' coroutine backend is valid for Windows" 37067c2acc70SPeter Maydell fi 37077c2acc70SPeter Maydell ;; 37087c2acc70SPeter Maydell *) 370976ad07a4SPeter Maydell error_exit "unknown coroutine backend $coroutine" 37107c2acc70SPeter Maydell ;; 37117c2acc70SPeter Maydell esac 3712d0e2fce5SAneesh Kumar K.Vfi 3713d0e2fce5SAneesh Kumar K.V 371470c60c08SStefan Hajnocziif test "$coroutine_pool" = ""; then 371570c60c08SStefan Hajnoczi if test "$coroutine" = "gthread"; then 371670c60c08SStefan Hajnoczi coroutine_pool=no 371770c60c08SStefan Hajnoczi else 371870c60c08SStefan Hajnoczi coroutine_pool=yes 371970c60c08SStefan Hajnoczi fi 372070c60c08SStefan Hajnoczifi 372170c60c08SStefan Hajnocziif test "$coroutine" = "gthread" -a "$coroutine_pool" = "yes"; then 372270c60c08SStefan Hajnoczi error_exit "'gthread' coroutine backend does not support pool (use --disable-coroutine-pool)" 372370c60c08SStefan Hajnoczifi 372470c60c08SStefan Hajnoczi 3725d0e2fce5SAneesh Kumar K.V########################################## 3726d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 3727d2042378SAneesh Kumar K.V 37284e1797f9SStefan Weilopen_by_handle_at=no 3729d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 3730d2042378SAneesh Kumar K.V#include <fcntl.h> 3731acc55ba8SStefan Weil#if !defined(AT_EMPTY_PATH) 3732acc55ba8SStefan Weil# error missing definition 3733acc55ba8SStefan Weil#else 373475cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 3735acc55ba8SStefan Weil#endif 3736d2042378SAneesh Kumar K.VEOF 3737d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 3738d2042378SAneesh Kumar K.V open_by_handle_at=yes 3739d2042378SAneesh Kumar K.Vfi 3740d2042378SAneesh Kumar K.V 3741e06a765eSHarsh Prateek Bora######################################## 3742e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 3743e06a765eSHarsh Prateek Bora 3744e06a765eSHarsh Prateek Boralinux_magic_h=no 3745e06a765eSHarsh Prateek Boracat > $TMPC << EOF 3746e06a765eSHarsh Prateek Bora#include <linux/magic.h> 3747e06a765eSHarsh Prateek Boraint main(void) { 374875cafad7SStefan Weil return 0; 3749e06a765eSHarsh Prateek Bora} 3750e06a765eSHarsh Prateek BoraEOF 3751e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 3752e06a765eSHarsh Prateek Bora linux_magic_h=yes 3753e06a765eSHarsh Prateek Borafi 3754e06a765eSHarsh Prateek Bora 37558ab1bf12SLuiz Capitulino######################################## 3756c95e3080SKevin Wolf# check whether we can disable warning option with a pragma (this is needed 3757c95e3080SKevin Wolf# to silence warnings in the headers of some versions of external libraries). 3758c95e3080SKevin Wolf# This test has to be compiled with -Werror as otherwise an unknown pragma is 3759c95e3080SKevin Wolf# only a warning. 3760c95e3080SKevin Wolf# 3761c95e3080SKevin Wolf# If we can't selectively disable warning in the code, disable -Werror so that 3762c95e3080SKevin Wolf# the build doesn't fail anyway. 3763c95e3080SKevin Wolf 376406d71fa1SPeter Maydellpragma_disable_unused_but_set=no 376506d71fa1SPeter Maydellcat > $TMPC << EOF 3766e6f53fd5SMarkus Armbruster#pragma GCC diagnostic push 376706d71fa1SPeter Maydell#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 3768c95e3080SKevin Wolf#pragma GCC diagnostic ignored "-Wstrict-prototypes" 3769e6f53fd5SMarkus Armbruster#pragma GCC diagnostic pop 3770c95e3080SKevin Wolf 377106d71fa1SPeter Maydellint main(void) { 377206d71fa1SPeter Maydell return 0; 377306d71fa1SPeter Maydell} 377406d71fa1SPeter MaydellEOF 377506d71fa1SPeter Maydellif compile_prog "-Werror" "" ; then 3776cc6e3ca9SGerd Hoffmann pragma_diagnostic_available=yes 3777c95e3080SKevin Wolfelse 3778c95e3080SKevin Wolf werror=no 377906d71fa1SPeter Maydellfi 378006d71fa1SPeter Maydell 378106d71fa1SPeter Maydell######################################## 378262fe8331SChristian Borntraeger# check if we have valgrind/valgrind.h and valgrind/memcheck.h 37833f4349dcSKevin Wolf 37843f4349dcSKevin Wolfvalgrind_h=no 37853f4349dcSKevin Wolfcat > $TMPC << EOF 37863f4349dcSKevin Wolf#include <valgrind/valgrind.h> 378762fe8331SChristian Borntraeger#include <valgrind/memcheck.h> 37883f4349dcSKevin Wolfint main(void) { 37893f4349dcSKevin Wolf return 0; 37903f4349dcSKevin Wolf} 37913f4349dcSKevin WolfEOF 37923f4349dcSKevin Wolfif compile_prog "" "" ; then 37933f4349dcSKevin Wolf valgrind_h=yes 37943f4349dcSKevin Wolffi 37953f4349dcSKevin Wolf 37963f4349dcSKevin Wolf######################################## 37978ab1bf12SLuiz Capitulino# check if environ is declared 37988ab1bf12SLuiz Capitulino 37998ab1bf12SLuiz Capitulinohas_environ=no 38008ab1bf12SLuiz Capitulinocat > $TMPC << EOF 38018ab1bf12SLuiz Capitulino#include <unistd.h> 38028ab1bf12SLuiz Capitulinoint main(void) { 3803c075a723SBlue Swirl environ = 0; 38048ab1bf12SLuiz Capitulino return 0; 38058ab1bf12SLuiz Capitulino} 38068ab1bf12SLuiz CapitulinoEOF 38078ab1bf12SLuiz Capitulinoif compile_prog "" "" ; then 38088ab1bf12SLuiz Capitulino has_environ=yes 38098ab1bf12SLuiz Capitulinofi 38108ab1bf12SLuiz Capitulino 381176a347e1SRichard Henderson######################################## 381276a347e1SRichard Henderson# check if cpuid.h is usable. 381376a347e1SRichard Henderson 381476a347e1SRichard Hendersoncpuid_h=no 381576a347e1SRichard Hendersoncat > $TMPC << EOF 381676a347e1SRichard Henderson#include <cpuid.h> 381776a347e1SRichard Hendersonint main(void) { 3818774d566cSPeter Maydell unsigned a, b, c, d; 3819774d566cSPeter Maydell int max = __get_cpuid_max(0, 0); 3820774d566cSPeter Maydell 3821774d566cSPeter Maydell if (max >= 1) { 3822774d566cSPeter Maydell __cpuid(1, a, b, c, d); 3823774d566cSPeter Maydell } 3824774d566cSPeter Maydell 3825774d566cSPeter Maydell if (max >= 7) { 3826774d566cSPeter Maydell __cpuid_count(7, 0, a, b, c, d); 3827774d566cSPeter Maydell } 3828774d566cSPeter Maydell 382976a347e1SRichard Henderson return 0; 383076a347e1SRichard Henderson} 383176a347e1SRichard HendersonEOF 383276a347e1SRichard Hendersonif compile_prog "" "" ; then 383376a347e1SRichard Henderson cpuid_h=yes 383476a347e1SRichard Hendersonfi 383576a347e1SRichard Henderson 3836f540166bSRichard Henderson######################################## 3837f540166bSRichard Henderson# check if __[u]int128_t is usable. 3838f540166bSRichard Henderson 3839f540166bSRichard Hendersonint128=no 3840f540166bSRichard Hendersoncat > $TMPC << EOF 3841a00f66abSStefan Weil#if defined(__clang_major__) && defined(__clang_minor__) 3842a00f66abSStefan Weil# if ((__clang_major__ < 3) || (__clang_major__ == 3) && (__clang_minor__ < 2)) 3843a00f66abSStefan Weil# error __int128_t does not work in CLANG before 3.2 3844a00f66abSStefan Weil# endif 3845a00f66abSStefan Weil#endif 3846f540166bSRichard Henderson__int128_t a; 3847f540166bSRichard Henderson__uint128_t b; 3848f540166bSRichard Hendersonint main (void) { 3849f540166bSRichard Henderson a = a + b; 3850f540166bSRichard Henderson b = a * b; 3851464e3671SPeter Maydell a = a * a; 3852f540166bSRichard Henderson return 0; 3853f540166bSRichard Henderson} 3854f540166bSRichard HendersonEOF 3855f540166bSRichard Hendersonif compile_prog "" "" ; then 3856f540166bSRichard Henderson int128=yes 3857f540166bSRichard Hendersonfi 385876a347e1SRichard Henderson 38591e6e9acaSRichard Henderson######################################## 38601e6e9acaSRichard Henderson# check if getauxval is available. 38611e6e9acaSRichard Henderson 38621e6e9acaSRichard Hendersongetauxval=no 38631e6e9acaSRichard Hendersoncat > $TMPC << EOF 38641e6e9acaSRichard Henderson#include <sys/auxv.h> 38651e6e9acaSRichard Hendersonint main(void) { 38661e6e9acaSRichard Henderson return getauxval(AT_HWCAP) == 0; 38671e6e9acaSRichard Henderson} 38681e6e9acaSRichard HendersonEOF 38691e6e9acaSRichard Hendersonif compile_prog "" "" ; then 38701e6e9acaSRichard Henderson getauxval=yes 38711e6e9acaSRichard Hendersonfi 38721e6e9acaSRichard Henderson 3873d2042378SAneesh Kumar K.V########################################## 3874e86ecd4bSJuan Quintela# End of CC checks 3875e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 3876e86ecd4bSJuan Quintela 38771d728c39SBlue Swirlif test "$gcov" = "yes" ; then 38781d728c39SBlue Swirl CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" 38791d728c39SBlue Swirl LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" 38801d728c39SBlue Swirlelif test "$debug" = "no" ; then 3881e600cdf3SMichal Privoznik CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" 3882e86ecd4bSJuan Quintelafi 3883a316e378SJuan Quintela 38846542aa9cSPeter Lieven########################################## 38856542aa9cSPeter Lieven# Do we have libnfs 38866542aa9cSPeter Lievenif test "$libnfs" != "no" ; then 3887b7d769c9SPeter Lieven if $pkg_config --atleast-version=1.9.3 libnfs; then 38886542aa9cSPeter Lieven libnfs="yes" 38896542aa9cSPeter Lieven libnfs_libs=$($pkg_config --libs libnfs) 38906542aa9cSPeter Lieven LIBS="$LIBS $libnfs_libs" 38916542aa9cSPeter Lieven else 38926542aa9cSPeter Lieven if test "$libnfs" = "yes" ; then 38936542aa9cSPeter Lieven feature_not_found "libnfs" 38946542aa9cSPeter Lieven fi 38956542aa9cSPeter Lieven libnfs="no" 38966542aa9cSPeter Lieven fi 38976542aa9cSPeter Lievenfi 38981d728c39SBlue Swirl 389920ff6c80SAnthony Liguori# Disable zero malloc errors for official releases unless explicitly told to 390020ff6c80SAnthony Liguori# enable/disable 390120ff6c80SAnthony Liguoriif test -z "$zero_malloc" ; then 390220ff6c80SAnthony Liguori if test "$z_version" = "50" ; then 390320ff6c80SAnthony Liguori zero_malloc="no" 390420ff6c80SAnthony Liguori else 390520ff6c80SAnthony Liguori zero_malloc="yes" 390620ff6c80SAnthony Liguori fi 390720ff6c80SAnthony Liguorifi 390820ff6c80SAnthony Liguori 39096ca026cbSPeter Maydell# Now we've finished running tests it's OK to add -Werror to the compiler flags 39106ca026cbSPeter Maydellif test "$werror" = "yes"; then 39116ca026cbSPeter Maydell QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 39126ca026cbSPeter Maydellfi 39136ca026cbSPeter Maydell 3914e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 3915e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 39161156c669SJuan Quintela LDFLAGS="-Wl,--warn-common $LDFLAGS" 3917e86ecd4bSJuan Quintela fi 3918e86ecd4bSJuan Quintelafi 3919e86ecd4bSJuan Quintela 392094dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 392194dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 392294dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 392394dd53c5SGerd Hoffmannelse 392494dd53c5SGerd Hoffmann POD2MAN="pod2man" 392594dd53c5SGerd Hoffmannfi 392694dd53c5SGerd Hoffmann 3927952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 3928952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 3929952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 3930952afb71SBlue Swirl if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then 3931952afb71SBlue Swirl LDFLAGS="-Wl,$flag $LDFLAGS" 3932952afb71SBlue Swirl fi 3933952afb71SBlue Swirl done 3934952afb71SBlue Swirlfi 3935952afb71SBlue Swirl 393610ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 3937e26110cfSFam Zhengqemu_moddir=$libdir$confsuffix 3938528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 3939834574eaSAnthony Liguoriqemu_localedir="$datadir/locale" 39405a67135aSbellard 39414b1c11fdSDaniel P. Berrangetools="" 39424b1c11fdSDaniel P. Berrangeif test "$want_tools" = "yes" ; then 3943ca35f780SPaolo Bonzini tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" 39444b1c11fdSDaniel P. Berrange if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 39454b1c11fdSDaniel P. Berrange tools="qemu-nbd\$(EXESUF) $tools" 39464b1c11fdSDaniel P. Berrange fi 39474b1c11fdSDaniel P. Berrangefi 39484b1c11fdSDaniel P. Berrangeif test "$softmmu" = yes ; then 3949983eef5aSMeador Inge if test "$virtfs" != no ; then 3950be5ea8edSAnthony Liguori if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then 3951983eef5aSMeador Inge virtfs=yes 395217bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 3953983eef5aSMeador Inge else 3954983eef5aSMeador Inge if test "$virtfs" = yes; then 395576ad07a4SPeter Maydell error_exit "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" 3956983eef5aSMeador Inge fi 395717500370SAndreas Färber virtfs=no 3958983eef5aSMeador Inge fi 395917bff52bSM. Mohan Kumar fi 3960d138cee9SMichael Rothfi 3961e8ef31a3SMichael Tokarevif [ "$guest_agent" != "no" ]; then 3962b39297aeSTomoki Sekiyama if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then 3963e8ef31a3SMichael Tokarev tools="qemu-ga\$(EXESUF) $tools" 3964b39297aeSTomoki Sekiyama if [ "$mingw32" = "yes" -a "$guest_agent_with_vss" = "yes" ]; then 3965b39297aeSTomoki Sekiyama tools="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb $tools" 3966b39297aeSTomoki Sekiyama fi 3967e8ef31a3SMichael Tokarev guest_agent=yes 3968e8ef31a3SMichael Tokarev elif [ "$guest_agent" != yes ]; then 3969e8ef31a3SMichael Tokarev guest_agent=no 3970e8ef31a3SMichael Tokarev else 3971e8ef31a3SMichael Tokarev error_exit "Guest agent is not supported on this platform" 3972ca35f780SPaolo Bonzini fi 39734b1c11fdSDaniel P. Berrangefi 3974ca35f780SPaolo Bonzini 3975ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 3976ca35f780SPaolo Bonziniroms= 3977ca35f780SPaolo Bonziniif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ 3978ca35f780SPaolo Bonzini "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ 3979ca35f780SPaolo Bonzini "$softmmu" = yes ; then 3980ca35f780SPaolo Bonzini roms="optionrom" 3981ca35f780SPaolo Bonzinifi 3982d0384d1dSAndreas Färberif test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then 398339ac8455SDavid Gibson roms="$roms spapr-rtas" 398439ac8455SDavid Gibsonfi 3985ca35f780SPaolo Bonzini 39869933c305SChristian Borntraegerif test "$cpu" = "s390x" ; then 39879933c305SChristian Borntraeger roms="$roms s390-ccw" 39889933c305SChristian Borntraegerfi 39899933c305SChristian Borntraeger 3990964c6fa1SRichard Henderson# Probe for the need for relocating the user-only binary. 3991964c6fa1SRichard Hendersonif test "$pie" = "no" ; then 3992964c6fa1SRichard Henderson textseg_addr= 3993964c6fa1SRichard Henderson case "$cpu" in 3994c72b26ecSRichard Henderson arm | hppa | i386 | m68k | ppc | ppc64 | s390* | sparc | sparc64 | x86_64 | x32) 3995964c6fa1SRichard Henderson textseg_addr=0x60000000 3996964c6fa1SRichard Henderson ;; 3997964c6fa1SRichard Henderson mips) 3998964c6fa1SRichard Henderson textseg_addr=0x400000 3999964c6fa1SRichard Henderson ;; 4000964c6fa1SRichard Henderson esac 4001964c6fa1SRichard Henderson if [ -n "$textseg_addr" ]; then 4002964c6fa1SRichard Henderson cat > $TMPC <<EOF 4003964c6fa1SRichard Henderson int main(void) { return 0; } 4004964c6fa1SRichard HendersonEOF 4005964c6fa1SRichard Henderson textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" 4006964c6fa1SRichard Henderson if ! compile_prog "" "$textseg_ldflags"; then 4007964c6fa1SRichard Henderson # In case ld does not support -Ttext-segment, edit the default linker 4008964c6fa1SRichard Henderson # script via sed to set the .text start addr. This is needed on FreeBSD 4009964c6fa1SRichard Henderson # at least. 4010964c6fa1SRichard Henderson $ld --verbose | sed \ 4011964c6fa1SRichard Henderson -e '1,/==================================================/d' \ 4012964c6fa1SRichard Henderson -e '/==================================================/,$d' \ 4013964c6fa1SRichard Henderson -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ 4014964c6fa1SRichard Henderson -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld 4015964c6fa1SRichard Henderson textseg_ldflags="-Wl,-T../config-host.ld" 4016964c6fa1SRichard Henderson fi 4017964c6fa1SRichard Henderson fi 4018964c6fa1SRichard Hendersonfi 4019964c6fa1SRichard Henderson 40205ca9388aSGerd Hoffmann# add pixman flags after all config tests are done 4021a540f158SPeter CrosthwaiteQEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags" 40225ca9388aSGerd Hoffmannlibs_softmmu="$libs_softmmu $pixman_libs" 40235ca9388aSGerd Hoffmann 40247d13299dSbellardecho "Install prefix $prefix" 4025c00b2808SEduardo Habkostecho "BIOS directory `eval echo $qemu_datadir`" 4026f2b9e1e3SPaolo Bonziniecho "binary directory `eval echo $bindir`" 40273aa5d2beSAlon Levyecho "library directory `eval echo $libdir`" 4028e26110cfSFam Zhengecho "module directory `eval echo $qemu_moddir`" 40298bf188aaSMichael Tokarevecho "libexec directory `eval echo $libexecdir`" 40300f94d6daSAlon Levyecho "include directory `eval echo $includedir`" 40311c0fd160SAurelien Jarnoecho "config directory `eval echo $sysconfdir`" 403211d9f695Sbellardif test "$mingw32" = "no" ; then 40335a699bbbSLaszlo Ersekecho "local state directory `eval echo $local_statedir`" 4034f2b9e1e3SPaolo Bonziniecho "Manual directory `eval echo $mandir`" 403543ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 40365a699bbbSLaszlo Ersekelse 40375a699bbbSLaszlo Ersekecho "local state directory queried at runtime" 4038d9840e25STomoki Sekiyamaecho "Windows SDK $win_sdk" 403911d9f695Sbellardfi 40405a67135aSbellardecho "Source path $source_path" 40417d13299dSbellardecho "C compiler $cc" 404283469015Sbellardecho "Host C compiler $host_cc" 404383f73fceSTomoki Sekiyamaecho "C++ compiler $cxx" 40443c4a4d0dSPeter Maydellecho "Objective-C compiler $objcc" 404545d285abSPeter Maydellecho "ARFLAGS $ARFLAGS" 40460c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 4047a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 40480c439cbfSJuan Quintelaecho "LDFLAGS $LDFLAGS" 40497d13299dSbellardecho "make $make" 40506a882643Spbrookecho "install $install" 4051c886edfbSBlue Swirlecho "python $python" 4052e2d8830eSBradif test "$slirp" = "yes" ; then 4053e2d8830eSBrad echo "smbd $smbd" 4054e2d8830eSBradfi 405517969268SFam Zhengecho "module support $modules" 4056a98fd896Sbellardecho "host CPU $cpu" 4057de83cd02Sbellardecho "host big endian $bigendian" 405897a847bcSbellardecho "target list $target_list" 4059ade25b0dSaurel32echo "tcg debug enabled $debug_tcg" 40607d13299dSbellardecho "gprof enabled $gprof" 406103b4fe7dSaliguoriecho "sparse enabled $sparse" 40621625af87Saliguoriecho "strip binaries $strip_opt" 406305c2a3e7Sbellardecho "profiler $profiler" 406443ce4dfeSbellardecho "static build $static" 406585aa5189Sbellardecho "-Werror enabled $werror" 40665b0753e0Sbellardif test "$darwin" = "yes" ; then 40675b0753e0Sbellard echo "Cocoa support $cocoa" 40685b0753e0Sbellardfi 4069e2134eb9SGerd Hoffmannecho "pixman $pixman" 407097a847bcSbellardecho "SDL support $sdl" 4071a4ccabcfSAnthony Liguoriecho "GTK support $gtk" 4072*bbbf9bfbSStefan Weilecho "VTE support $vte" 40734d3b6f6eSbalrogecho "curses support $curses" 4074769ce76dSAlexander Grafecho "curl support $curl" 407567b915a5Sbellardecho "mingw32 support $mingw32" 40760c58ac1cSmalcecho "Audio drivers $audio_drv_list" 4077b64ec4e4SFam Zhengecho "Block whitelist (rw) $block_drv_rw_whitelist" 4078b64ec4e4SFam Zhengecho "Block whitelist (ro) $block_drv_ro_whitelist" 4079983eef5aSMeador Ingeecho "VirtFS support $virtfs" 4080821601eaSJes Sorensenecho "VNC support $vnc" 4081821601eaSJes Sorensenif test "$vnc" = "yes" ; then 40828d5d2d4cSths echo "VNC TLS support $vnc_tls" 40832f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 40842f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 4085efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 40867536ee4bSTim Hardeck echo "VNC WS support $vnc_ws" 4087821601eaSJes Sorensenfi 40883142255cSblueswir1if test -n "$sparc_cpu"; then 40893142255cSblueswir1 echo "Target Sparc Arch $sparc_cpu" 40903142255cSblueswir1fi 4091e37630caSaliguoriecho "xen support $xen" 40922e4d9fb1Saurel32echo "brlapi support $brlapi" 4093a20a6f46SJuan Quintelaecho "bluez support $bluez" 4094a25dba17SJuan Quintelaecho "Documentation $docs" 4095c5937220Spbrook[ ! -z "$uname_release" ] && \ 4096c5937220Spbrookecho "uname -r $uname_release" 4097379f6698SPaul Brookecho "GUEST_BASE $guest_base" 409840d6444eSAvi Kivityecho "PIE $pie" 40998a16d273Sthsecho "vde support $vde" 410058952137SVincenzo Maffioneecho "netmap support $netmap" 41015c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 4102758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 410377755340Sthsecho "Install blobs $blobs" 4104b31a0277SJuan Quintelaecho "KVM support $kvm" 41052da776dbSMichael R. Hinesecho "RDMA support $rdma" 41069195b2c2SStefan Weilecho "TCG interpreter $tcg_interpreter" 4107f652e6afSaurel32echo "fdt support $fdt" 4108ceb42de8Saliguoriecho "preadv support $preadv" 41095f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 4110e78815a5SAndreas Färberecho "madvise $madvise" 4111e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 41121e9737daSRichard Hendersonecho "sigev_thread_id $sigev_thread_id" 4113ee682d27SStefan Weilecho "uuid support $uuid" 411447e98658SCorey Bryantecho "libcap-ng support $cap_ng" 4115d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 41165e9be92dSNicholas Bellingerecho "vhost-scsi support $vhost_scsi" 411794a420b1SStefan Hajnocziecho "Trace backend $trace_backend" 41189410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 4119c9dd4074SStefan Weilif test "$spice" = "yes"; then 41202e0e3c39SAlon Levyecho "spice support $spice ($spice_protocol_version/$spice_server_version)" 4121c9dd4074SStefan Weilelse 4122c9dd4074SStefan Weilecho "spice support $spice" 4123c9dd4074SStefan Weilfi 4124f27aaf4bSChristian Brunnerecho "rbd support $rbd" 4125dce512deSChristoph Hellwigecho "xfsctl support $xfs" 4126111a38b0SRobert Relyeaecho "nss used $smartcard_nss" 41272b2325ffSGerd Hoffmannecho "libusb $libusb" 412869354a83SHans de Goedeecho "usb net redir $usb_redir" 4129b1e5fff4SMichael Walleecho "GLX support $glx" 4130219c2521SStefan Weilif test "$libiscsi_version" = "1.4.0"; then 4131219c2521SStefan Weilecho "libiscsi support $libiscsi (1.4.0)" 4132219c2521SStefan Weilelse 4133c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 4134219c2521SStefan Weilfi 41356542aa9cSPeter Lievenecho "libnfs support $libnfs" 4136d138cee9SMichael Rothecho "build guest agent $guest_agent" 4137d9840e25STomoki Sekiyamaecho "QGA VSS support $guest_agent_with_vss" 4138f794573eSEduardo Otuboecho "seccomp support $seccomp" 41397c2acc70SPeter Maydellecho "coroutine backend $coroutine" 414070c60c08SStefan Hajnocziecho "coroutine pool $coroutine_pool" 4141eb100396SBharata B Raoecho "GlusterFS support $glusterfs" 4142583f6e7bSStefan Hajnocziecho "virtio-blk-data-plane $virtio_blk_data_plane" 41431d728c39SBlue Swirlecho "gcov $gcov_tool" 41441d728c39SBlue Swirlecho "gcov enabled $gcov" 4145ab214c29SStefan Bergerecho "TPM support $tpm" 41460a12ec87SRichard W.M. Jonesecho "libssh2 support $libssh2" 41473b8acc11SPaolo Bonziniecho "TPM passthrough $tpm_passthrough" 41483556c233SPaolo Bonziniecho "QOM debugging $qom_cast_debug" 41494f18b782SJeff Codyecho "vhdx $vhdx" 415095c6bff3SBenoît Canetecho "Quorum $quorum" 4151607dacd0Sqiaonuohanecho "lzo support $lzo" 4152607dacd0Sqiaonuohanecho "snappy support $snappy" 415367b915a5Sbellard 41541ba16968SStefan Weilif test "$sdl_too_old" = "yes"; then 415524b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 4156e8cd23deSbellardfi 415797a847bcSbellard 415898ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 415997a847bcSbellard 4160dbd99ae3SStefan Weilecho "# Automatically generated by configure - do not modify" >config-all-disas.mak 4161dbd99ae3SStefan Weil 416298ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 416398ec69acSJuan Quintelaecho >> $config_host_mak 416498ec69acSJuan Quintela 4165e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 416699d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 416799d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 41683aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 41698bf188aaSMichael Tokarevecho "libexecdir=$libexecdir" >> $config_host_mak 41700f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 417199d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 417299d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 417322d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 41749afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 41759afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 4176e26110cfSFam Zhengecho "qemu_moddir=$qemu_moddir" >> $config_host_mak 41775a699bbbSLaszlo Ersekif test "$mingw32" = "no" ; then 4178785c23aeSLuiz Capitulino echo "qemu_localstatedir=$local_statedir" >> $config_host_mak 41795a699bbbSLaszlo Ersekfi 4180f354b1a1SMichael Tokarevecho "qemu_helperdir=$libexecdir" >> $config_host_mak 4181f9943cd5SGerd Hoffmannecho "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak 4182f9943cd5SGerd Hoffmannecho "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak 4183834574eaSAnthony Liguoriecho "qemu_localedir=$qemu_localedir" >> $config_host_mak 4184f544a488SPaolo Bonziniecho "libs_softmmu=$libs_softmmu" >> $config_host_mak 4185804edf29SJuan Quintela 418698ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 4187727e5283SPaolo Bonzini 4188f8393946Saurel32if test "$debug_tcg" = "yes" ; then 41892358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 4190f8393946Saurel32fi 41911625af87Saliguoriif test "$strip_opt" = "yes" ; then 419252ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 41931625af87Saliguorifi 41947d13299dSbellardif test "$bigendian" = "yes" ; then 4195e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 419697a847bcSbellardfi 419767b915a5Sbellardif test "$mingw32" = "yes" ; then 419898ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 41999fe6de94SBlue Swirl rc_version=`cat $source_path/VERSION` 42009fe6de94SBlue Swirl version_major=${rc_version%%.*} 42019fe6de94SBlue Swirl rc_version=${rc_version#*.} 42029fe6de94SBlue Swirl version_minor=${rc_version%%.*} 42039fe6de94SBlue Swirl rc_version=${rc_version#*.} 42049fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 42059fe6de94SBlue Swirl version_micro=0 42069fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 42079fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 4208d9840e25STomoki Sekiyama if test "$guest_agent_with_vss" = "yes" ; then 4209d9840e25STomoki Sekiyama echo "CONFIG_QGA_VSS=y" >> $config_host_mak 4210d9840e25STomoki Sekiyama echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak 4211d9840e25STomoki Sekiyama fi 4212210fa556Spbrookelse 421335f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 4214210fa556Spbrookfi 4215128ab2ffSblueswir1 4216dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 4217dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 4218dffcb71cSMark McLoughlinfi 4219dffcb71cSMark McLoughlin 422083fb7adfSbellardif test "$darwin" = "yes" ; then 422198ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 422283fb7adfSbellardfi 4223b29fe3edSmalc 4224b29fe3edSmalcif test "$aix" = "yes" ; then 422598ec69acSJuan Quintela echo "CONFIG_AIX=y" >> $config_host_mak 4226b29fe3edSmalcfi 4227b29fe3edSmalc 4228ec530c81Sbellardif test "$solaris" = "yes" ; then 422998ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 42302358a494SJuan Quintela echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak 42310475a5caSths if test "$needs_libsunmath" = "yes" ; then 423275b5a697SJuan Quintela echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak 42330475a5caSths fi 4234ec530c81Sbellardfi 4235179cf400SAndreas Färberif test "$haiku" = "yes" ; then 4236179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 4237179cf400SAndreas Färberfi 423897a847bcSbellardif test "$static" = "yes" ; then 423998ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 424097a847bcSbellardfi 42411ba16968SStefan Weilif test "$profiler" = "yes" ; then 42422358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 424305c2a3e7Sbellardfi 4244c20709aaSbellardif test "$slirp" = "yes" ; then 424598ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 4246e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 4247c20709aaSbellardfi 42488a16d273Sthsif test "$vde" = "yes" ; then 424998ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 42508a16d273Sthsfi 425158952137SVincenzo Maffioneif test "$netmap" = "yes" ; then 425258952137SVincenzo Maffione echo "CONFIG_NETMAP=y" >> $config_host_mak 425358952137SVincenzo Maffionefi 425447e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 425547e98658SCorey Bryant echo "CONFIG_LIBCAP=y" >> $config_host_mak 425647e98658SCorey Bryantfi 42572358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 42580c58ac1cSmalcfor drv in $audio_drv_list; do 4259bb55b712SStefan Weil def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` 426098ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 4261923e4521Smalc if test "$drv" = "fmod"; then 42627aac6cb1SJuan Quintela echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak 4263fb065187Sbellard fi 42640c58ac1cSmalcdone 426567f86e8eSJuan Quintelaif test "$audio_pt_int" = "yes" ; then 426667f86e8eSJuan Quintela echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak 426767f86e8eSJuan Quintelafi 4268d5631638Smalcif test "$audio_win_int" = "yes" ; then 4269d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 4270d5631638Smalcfi 4271b64ec4e4SFam Zhengecho "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak 4272b64ec4e4SFam Zhengecho "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak 4273821601eaSJes Sorensenif test "$vnc" = "yes" ; then 4274821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 4275821601eaSJes Sorensenfi 42768d5d2d4cSthsif test "$vnc_tls" = "yes" ; then 427798ec69acSJuan Quintela echo "CONFIG_VNC_TLS=y" >> $config_host_mak 42788d5d2d4cSthsfi 42792f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 428098ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 42812f9606b3Saliguorifi 4282821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 42832f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 42842f6f5c7aSCorentin Charyfi 4285821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 4286efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 4287efe556adSCorentin Charyfi 42887536ee4bSTim Hardeckif test "$vnc_ws" = "yes" ; then 42897536ee4bSTim Hardeck echo "CONFIG_VNC_WS=y" >> $config_host_mak 42907536ee4bSTim Hardeck echo "VNC_WS_CFLAGS=$vnc_ws_cflags" >> $config_host_mak 42917536ee4bSTim Hardeckfi 429276655d6dSaliguoriif test "$fnmatch" = "yes" ; then 42932358a494SJuan Quintela echo "CONFIG_FNMATCH=y" >> $config_host_mak 429476655d6dSaliguorifi 4295ee682d27SStefan Weilif test "$uuid" = "yes" ; then 4296ee682d27SStefan Weil echo "CONFIG_UUID=y" >> $config_host_mak 4297ee682d27SStefan Weilfi 4298dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 4299dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 4300dce512deSChristoph Hellwigfi 4301b1a550a0Spbrookqemu_version=`head $source_path/VERSION` 430298ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 43032358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 430498ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 430598ec69acSJuan Quintelaecho "TARGET_DIRS=$target_list" >> $config_host_mak 4306a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 430798ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 4308cc8ae6deSpbrookfi 430917969268SFam Zhengif test "$modules" = "yes"; then 4310e26110cfSFam Zheng # $shacmd can generate a hash started with digit, which the compiler doesn't 4311e26110cfSFam Zheng # like as an symbol. So prefix it with an underscore 4312e26110cfSFam Zheng echo "CONFIG_STAMP=_`(echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ `" >> $config_host_mak 431317969268SFam Zheng echo "CONFIG_MODULES=y" >> $config_host_mak 431417969268SFam Zhengfi 43151ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 431698ec69acSJuan Quintela echo "CONFIG_SDL=y" >> $config_host_mak 43178ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 431849ecc3faSbellardfi 431949ecc3faSbellardif test "$cocoa" = "yes" ; then 432098ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 432149ecc3faSbellardfi 43224d3b6f6eSbalrogif test "$curses" = "yes" ; then 432398ec69acSJuan Quintela echo "CONFIG_CURSES=y" >> $config_host_mak 4324ab4e5602SJan Kiszkafi 4325ebc996f3SRiku Voipioif test "$utimens" = "yes" ; then 43262358a494SJuan Quintela echo "CONFIG_UTIMENSAT=y" >> $config_host_mak 4327ebc996f3SRiku Voipiofi 4328099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 43292358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 4330099d6b0fSRiku Voipiofi 433140ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 433240ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 433340ff6d7eSKevin Wolffi 43343ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 43352358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 43363ce34dfbSvibisreenivasanfi 4337c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 4338c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 4339c2882b96SRiku Voipiofi 4340d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 4341d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 4342d0927938SUlrich Hechtfi 43433d4fa43eSKusanagi Kouichiif test "$fallocate_punch_hole" = "yes" ; then 43443d4fa43eSKusanagi Kouichi echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak 43453d4fa43eSKusanagi Kouichifi 4346c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 4347c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 4348c727f47dSPeter Maydellfi 4349dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 4350dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 4351dace20dcSPeter Maydellfi 4352d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 4353d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 4354d0927938SUlrich Hechtfi 43554e0c6529SAlex Blighif test "$ppoll" = "yes" ; then 43564e0c6529SAlex Bligh echo "CONFIG_PPOLL=y" >> $config_host_mak 43574e0c6529SAlex Blighfi 4358cd758dd0SAlex Blighif test "$prctl_pr_set_timerslack" = "yes" ; then 4359cd758dd0SAlex Bligh echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak 4360cd758dd0SAlex Blighfi 43613b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 43623b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 43633b6edd16SPeter Maydellfi 43643b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 43653b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 43663b6edd16SPeter Maydellfi 43673b6edd16SPeter Maydellif test "$epoll_pwait" = "yes" ; then 43683b6edd16SPeter Maydell echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak 43693b6edd16SPeter Maydellfi 4370a8fd1abaSPeter Maydellif test "$sendfile" = "yes" ; then 4371a8fd1abaSPeter Maydell echo "CONFIG_SENDFILE=y" >> $config_host_mak 4372a8fd1abaSPeter Maydellfi 43733b3f24adSaurel32if test "$inotify" = "yes" ; then 43742358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 43753b3f24adSaurel32fi 4376c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 4377c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 4378c05c7a73SRiku Voipiofi 43796ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 43806ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 43816ae9a1f4SJuan Quintelafi 43826ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 43836ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 43846ae9a1f4SJuan Quintelafi 4385769ce76dSAlexander Grafif test "$curl" = "yes" ; then 4386d3399d7cSFam Zheng echo "CONFIG_CURL=m" >> $config_host_mak 4387b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 43886ebc91e5SFam Zheng echo "CURL_LIBS=$curl_libs" >> $config_host_mak 4389769ce76dSAlexander Graffi 43902e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 439198ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 43922e4d9fb1Saurel32fi 4393fb599c9aSbalrogif test "$bluez" = "yes" ; then 439498ec69acSJuan Quintela echo "CONFIG_BLUEZ=y" >> $config_host_mak 4395ef7635ecSJuan Quintela echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak 4396fb599c9aSbalrogfi 4397e18df141SAnthony Liguoriecho "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 4398a4ccabcfSAnthony Liguoriif test "$gtk" = "yes" ; then 4399a4ccabcfSAnthony Liguori echo "CONFIG_GTK=y" >> $config_host_mak 4400a4ccabcfSAnthony Liguori echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak 4401*bbbf9bfbSStefan Weilfi 4402*bbbf9bfbSStefan Weilif test "$vte" = "yes" ; then 4403*bbbf9bfbSStefan Weil echo "CONFIG_VTE=y" >> $config_host_mak 4404a4ccabcfSAnthony Liguori echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak 4405a4ccabcfSAnthony Liguorifi 4406e37630caSaliguoriif test "$xen" = "yes" ; then 44076dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 4408d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 4409e37630caSaliguorifi 44105c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 44115c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 44125c6c3a6cSChristoph Hellwigfi 4413758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 4414758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 4415758e8e38SVenkateswararao Jujjuri (JV)fi 44164f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 44174f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 44184f26f2b6SAvi Kivityfi 4419983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 4420758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 4421758e8e38SVenkateswararao Jujjuri (JV)fi 44225e9be92dSNicholas Bellingerif test "$vhost_scsi" = "yes" ; then 44235e9be92dSNicholas Bellinger echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak 44245e9be92dSNicholas Bellingerfi 442577755340Sthsif test "$blobs" = "yes" ; then 442698ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 442777755340Sthsfi 4428bf9298b9Saliguoriif test "$iovec" = "yes" ; then 44292358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 4430bf9298b9Saliguorifi 4431ceb42de8Saliguoriif test "$preadv" = "yes" ; then 44322358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 4433ceb42de8Saliguorifi 4434f652e6afSaurel32if test "$fdt" = "yes" ; then 44353f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 4436f652e6afSaurel32fi 4437dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 4438dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 4439dcc38d1cSMarcelo Tosattifi 44409195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 44419195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 44429195b2c2SStefan Weilfi 44435f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 44445f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 44455f6b9e8fSBlue Swirlfi 4446e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 4447e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 4448e78815a5SAndreas Färberfi 4449e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 4450e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 4451e78815a5SAndreas Färberfi 44521e9737daSRichard Hendersonif test "$sigev_thread_id" = "yes" ; then 44531e9737daSRichard Henderson echo "CONFIG_SIGEV_THREAD_ID=y" >> $config_host_mak 44541e9737daSRichard Hendersonfi 445597a847bcSbellard 4456cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 4457cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 4458cd4ec0b4SGerd Hoffmannfi 4459cd4ec0b4SGerd Hoffmann 4460111a38b0SRobert Relyeaif test "$smartcard_nss" = "yes" ; then 4461111a38b0SRobert Relyea echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak 4462ad4cf3f6SPaul Brook echo "libcacard_libs=$libcacard_libs" >> $config_host_mak 4463ad4cf3f6SPaul Brook echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak 4464111a38b0SRobert Relyeafi 4465111a38b0SRobert Relyea 44662b2325ffSGerd Hoffmannif test "$libusb" = "yes" ; then 44672b2325ffSGerd Hoffmann echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak 44682b2325ffSGerd Hoffmannfi 44692b2325ffSGerd Hoffmann 447069354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 447169354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 447269354a83SHans de Goedefi 447369354a83SHans de Goede 4474b1e5fff4SMichael Walleif test "$glx" = "yes" ; then 4475b1e5fff4SMichael Walle echo "CONFIG_GLX=y" >> $config_host_mak 44762b6b7099SPaolo Bonzini echo "GLX_LIBS=$glx_libs" >> $config_host_mak 447720ff075bSMichael Wallefi 447820ff075bSMichael Walle 4479607dacd0Sqiaonuohanif test "$lzo" = "yes" ; then 4480607dacd0Sqiaonuohan echo "CONFIG_LZO=y" >> $config_host_mak 4481607dacd0Sqiaonuohanfi 4482607dacd0Sqiaonuohan 4483607dacd0Sqiaonuohanif test "$snappy" = "yes" ; then 4484607dacd0Sqiaonuohan echo "CONFIG_SNAPPY=y" >> $config_host_mak 4485607dacd0Sqiaonuohanfi 4486607dacd0Sqiaonuohan 4487c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 4488d3399d7cSFam Zheng echo "CONFIG_LIBISCSI=m" >> $config_host_mak 4489219c2521SStefan Weil if test "$libiscsi_version" = "1.4.0"; then 4490219c2521SStefan Weil echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak 4491219c2521SStefan Weil fi 44926ebc91e5SFam Zheng echo "LIBISCSI_CFLAGS=$libiscsi_cflags" >> $config_host_mak 44936ebc91e5SFam Zheng echo "LIBISCSI_LIBS=$libiscsi_libs" >> $config_host_mak 4494c589b249SRonnie Sahlbergfi 4495c589b249SRonnie Sahlberg 44966542aa9cSPeter Lievenif test "$libnfs" = "yes" ; then 44976542aa9cSPeter Lieven echo "CONFIG_LIBNFS=y" >> $config_host_mak 44986542aa9cSPeter Lievenfi 44996542aa9cSPeter Lieven 4500f794573eSEduardo Otuboif test "$seccomp" = "yes"; then 4501f794573eSEduardo Otubo echo "CONFIG_SECCOMP=y" >> $config_host_mak 4502f794573eSEduardo Otubofi 4503f794573eSEduardo Otubo 450483fb7adfSbellard# XXX: suppress that 45057d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 45062358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 45077d3505c5Sbellardfi 45087d3505c5Sbellard 45092358a494SJuan Quintelaecho "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak 4510c5937220Spbrook 451120ff6c80SAnthony Liguoriif test "$zero_malloc" = "yes" ; then 451220ff6c80SAnthony Liguori echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak 451320ff6c80SAnthony Liguorifi 45143556c233SPaolo Bonziniif test "$qom_cast_debug" = "yes" ; then 45153556c233SPaolo Bonzini echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak 45163556c233SPaolo Bonzinifi 4517f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 4518d3399d7cSFam Zheng echo "CONFIG_RBD=m" >> $config_host_mak 45196ebc91e5SFam Zheng echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak 45206ebc91e5SFam Zheng echo "RBD_LIBS=$rbd_libs" >> $config_host_mak 4521f27aaf4bSChristian Brunnerfi 452220ff6c80SAnthony Liguori 45237c2acc70SPeter Maydellecho "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak 452470c60c08SStefan Hajnocziif test "$coroutine_pool" = "yes" ; then 452570c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak 452670c60c08SStefan Hajnoczielse 452770c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak 452870c60c08SStefan Hajnoczifi 4529d0e2fce5SAneesh Kumar K.V 4530d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 4531d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 4532d2042378SAneesh Kumar K.Vfi 4533d2042378SAneesh Kumar K.V 4534e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 4535e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 4536e06a765eSHarsh Prateek Borafi 4537e06a765eSHarsh Prateek Bora 4538cc6e3ca9SGerd Hoffmannif test "$pragma_diagnostic_available" = "yes" ; then 4539cc6e3ca9SGerd Hoffmann echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak 454006d71fa1SPeter Maydellfi 454106d71fa1SPeter Maydell 45423f4349dcSKevin Wolfif test "$valgrind_h" = "yes" ; then 45433f4349dcSKevin Wolf echo "CONFIG_VALGRIND_H=y" >> $config_host_mak 45443f4349dcSKevin Wolffi 45453f4349dcSKevin Wolf 45468ab1bf12SLuiz Capitulinoif test "$has_environ" = "yes" ; then 45478ab1bf12SLuiz Capitulino echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak 45488ab1bf12SLuiz Capitulinofi 45498ab1bf12SLuiz Capitulino 455076a347e1SRichard Hendersonif test "$cpuid_h" = "yes" ; then 455176a347e1SRichard Henderson echo "CONFIG_CPUID_H=y" >> $config_host_mak 455276a347e1SRichard Hendersonfi 455376a347e1SRichard Henderson 4554f540166bSRichard Hendersonif test "$int128" = "yes" ; then 4555f540166bSRichard Henderson echo "CONFIG_INT128=y" >> $config_host_mak 4556f540166bSRichard Hendersonfi 4557f540166bSRichard Henderson 45581e6e9acaSRichard Hendersonif test "$getauxval" = "yes" ; then 45591e6e9acaSRichard Henderson echo "CONFIG_GETAUXVAL=y" >> $config_host_mak 45601e6e9acaSRichard Hendersonfi 45611e6e9acaSRichard Henderson 4562eb100396SBharata B Raoif test "$glusterfs" = "yes" ; then 4563d3399d7cSFam Zheng echo "CONFIG_GLUSTERFS=m" >> $config_host_mak 45646ebc91e5SFam Zheng echo "GLUSTERFS_CFLAGS=$glusterfs_cflags" >> $config_host_mak 45656ebc91e5SFam Zheng echo "GLUSTERFS_LIBS=$glusterfs_libs" >> $config_host_mak 4566eb100396SBharata B Raofi 4567eb100396SBharata B Rao 45680c14fb47SBharata B Raoif test "$glusterfs_discard" = "yes" ; then 45690c14fb47SBharata B Rao echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak 45700c14fb47SBharata B Raofi 45710c14fb47SBharata B Rao 45727c815372SBharata B Raoif test "$glusterfs_zerofill" = "yes" ; then 45737c815372SBharata B Rao echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak 45747c815372SBharata B Raofi 45757c815372SBharata B Rao 45760a12ec87SRichard W.M. Jonesif test "$libssh2" = "yes" ; then 4577d3399d7cSFam Zheng echo "CONFIG_LIBSSH2=m" >> $config_host_mak 45786ebc91e5SFam Zheng echo "LIBSSH2_CFLAGS=$libssh2_cflags" >> $config_host_mak 45796ebc91e5SFam Zheng echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak 45800a12ec87SRichard W.M. Jonesfi 45810a12ec87SRichard W.M. Jones 458295c6bff3SBenoît Canetif test "$quorum" = "yes" ; then 458395c6bff3SBenoît Canet echo "CONFIG_QUORUM=y" >> $config_host_mak 458495c6bff3SBenoît Canetfi 458595c6bff3SBenoît Canet 4586583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" ; then 45876e790746SPaolo Bonzini echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=$(CONFIG_VIRTIO)' >> $config_host_mak 4588583f6e7bSStefan Hajnoczifi 4589583f6e7bSStefan Hajnoczi 45904f18b782SJeff Codyif test "$vhdx" = "yes" ; then 45914f18b782SJeff Cody echo "CONFIG_VHDX=y" >> $config_host_mak 45924f18b782SJeff Codyfi 45934f18b782SJeff Cody 459468063649Sblueswir1# USB host support 4595b5613fdcSGerd Hoffmannif test "$libusb" = "yes"; then 45962b2325ffSGerd Hoffmann echo "HOST_USB=libusb legacy" >> $config_host_mak 4597b5613fdcSGerd Hoffmannelse 459898ec69acSJuan Quintela echo "HOST_USB=stub" >> $config_host_mak 4599b5613fdcSGerd Hoffmannfi 460068063649Sblueswir1 46013b8acc11SPaolo Bonzini# TPM passthrough support? 46023b8acc11SPaolo Bonziniif test "$tpm" = "yes"; then 46033b8acc11SPaolo Bonzini echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak 46043b8acc11SPaolo Bonzini if test "$tpm_passthrough" = "yes"; then 46053b8acc11SPaolo Bonzini echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak 46063b8acc11SPaolo Bonzini fi 46073b8acc11SPaolo Bonzinifi 46083b8acc11SPaolo Bonzini 4609e4858974SLluís# use default implementation for tracing backend-specific routines 4610e4858974SLluístrace_default=yes 461194a420b1SStefan Hajnocziecho "TRACE_BACKEND=$trace_backend" >> $config_host_mak 46126d8a764eSLluísif test "$trace_backend" = "nop"; then 46136d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 461422890ab5SPrerna Saxenafi 46159410b56cSPrerna Saxenaif test "$trace_backend" = "simple"; then 46166d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 4617e4858974SLluís trace_default=no 46186d8a764eSLluís # Set the appropriate trace file. 4619953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 46209410b56cSPrerna Saxenafi 46216d8a764eSLluísif test "$trace_backend" = "stderr"; then 46226d8a764eSLluís echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak 46239a82b6a5SLluís trace_default=no 46246d8a764eSLluísfi 46256d8a764eSLluísif test "$trace_backend" = "ust"; then 46266d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 46276d8a764eSLluísfi 46286d8a764eSLluísif test "$trace_backend" = "dtrace"; then 46296d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 46306d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 46316d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 46326d8a764eSLluís fi 4633c276b17dSDaniel P. Berrangefi 4634781e9545SEiichi Tsukataif test "$trace_backend" = "ftrace"; then 4635781e9545SEiichi Tsukata if test "$linux" = "yes" ; then 4636781e9545SEiichi Tsukata echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak 4637781e9545SEiichi Tsukata trace_default=no 4638781e9545SEiichi Tsukata else 463921684af0SStewart Smith feature_not_found "ftrace(trace backend)" "ftrace requires Linux" 4640781e9545SEiichi Tsukata fi 4641781e9545SEiichi Tsukatafi 46429410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 4643e4858974SLluísif test "$trace_default" = "yes"; then 4644e4858974SLluís echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak 4645e4858974SLluísfi 46469410b56cSPrerna Saxena 46472da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 46482da776dbSMichael R. Hines echo "CONFIG_RDMA=y" >> $config_host_mak 46492da776dbSMichael R. Hinesfi 46502da776dbSMichael R. Hines 46515b5e3037SPaolo Bonziniif test "$tcg_interpreter" = "yes"; then 46525b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 46535b5e3037SPaolo Bonzinielif test "$ARCH" = "sparc64" ; then 46545b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 46555b5e3037SPaolo Bonzinielif test "$ARCH" = "s390x" ; then 46565b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 4657c72b26ecSRichard Hendersonelif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then 46585b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 46595b5e3037SPaolo Bonzinielse 46605b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 46615b5e3037SPaolo Bonzinifi 46625b5e3037SPaolo BonziniQEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" 46635b5e3037SPaolo Bonzini 466498ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 466598ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 4666804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 4667804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 46681901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 46691901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 467021655882SPaolo Bonziniif test -n "$libtool"; then 467121655882SPaolo Bonzini echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak 467221655882SPaolo Bonzini echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak 467321655882SPaolo Bonzinielse 46741901cb14SBrad echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 467521655882SPaolo Bonzini echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak 467621655882SPaolo Bonzinifi 4677c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 4678804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 4679a31a8642SMichael S. Tsirkinif $iasl -h > /dev/null 2>&1; then 4680a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_host_mak 4681a31a8642SMichael S. Tsirkinfi 46822b2e59e6SPaolo Bonziniecho "CC_I386=$cc_i386" >> $config_host_mak 4683804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 468483f73fceSTomoki Sekiyamaecho "CXX=$cxx" >> $config_host_mak 46853c4a4d0dSPeter Maydellecho "OBJCC=$objcc" >> $config_host_mak 4686804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 468745d285abSPeter Maydellecho "ARFLAGS=$ARFLAGS" >> $config_host_mak 46883dd46c78SBlue Swirlecho "AS=$as" >> $config_host_mak 46893dd46c78SBlue Swirlecho "CPP=$cpp" >> $config_host_mak 4690804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 4691804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 46929fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 469344dc0ca3SAlon Levyecho "LIBTOOL=$libtool" >> $config_host_mak 4694e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 469546eef33bSBradecho "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak 4696a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 4697f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 4698e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 4699e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 4700e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 4701e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 4702e39f0062SPaolo Bonzinifi 470342da6041SGerd Hoffmannif test "$cross_prefix" != ""; then 470442da6041SGerd Hoffmann echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak 470542da6041SGerd Hoffmannelse 470642da6041SGerd Hoffmann echo "AUTOCONF_HOST := " >> $config_host_mak 470742da6041SGerd Hoffmannfi 4708e2a2ed06SJuan Quintelaecho "LDFLAGS=$LDFLAGS" >> $config_host_mak 470946eef33bSBradecho "LDFLAGS_NOPIE=$LDFLAGS_NOPIE" >> $config_host_mak 471037746c5eSMarc-André Lureauecho "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak 471173da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 47123e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 4713804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 471417969268SFam Zhengecho "DSOSUF=$DSOSUF" >> $config_host_mak 471517969268SFam Zhengecho "LDFLAGS_SHARED=$LDFLAGS_SHARED" >> $config_host_mak 4716957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 471794dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 4718cbdd1999SPaolo Bonziniecho "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak 47191d728c39SBlue Swirlif test "$gcov" = "yes" ; then 47201d728c39SBlue Swirl echo "CONFIG_GCOV=y" >> $config_host_mak 47211d728c39SBlue Swirl echo "GCOV=$gcov_tool" >> $config_host_mak 47221d728c39SBlue Swirlfi 4723804edf29SJuan Quintela 47246efd7517SPeter Maydell# use included Linux headers 47256efd7517SPeter Maydellif test "$linux" = "yes" ; then 4726a307beb6SAndreas Färber mkdir -p linux-headers 47276efd7517SPeter Maydell case "$cpu" in 4728c72b26ecSRichard Henderson i386|x86_64|x32) 472908312a63SPeter Maydell linux_arch=x86 47306efd7517SPeter Maydell ;; 47316efd7517SPeter Maydell ppcemb|ppc|ppc64) 473208312a63SPeter Maydell linux_arch=powerpc 47336efd7517SPeter Maydell ;; 47346efd7517SPeter Maydell s390x) 473508312a63SPeter Maydell linux_arch=s390 473608312a63SPeter Maydell ;; 47371f080313SClaudio Fontana aarch64) 47381f080313SClaudio Fontana linux_arch=arm64 47391f080313SClaudio Fontana ;; 474008312a63SPeter Maydell *) 474108312a63SPeter Maydell # For most CPUs the kernel architecture name and QEMU CPU name match. 474208312a63SPeter Maydell linux_arch="$cpu" 47436efd7517SPeter Maydell ;; 47446efd7517SPeter Maydell esac 474508312a63SPeter Maydell # For non-KVM architectures we will not have asm headers 474608312a63SPeter Maydell if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then 474708312a63SPeter Maydell symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 474808312a63SPeter Maydell fi 47496efd7517SPeter Maydellfi 47506efd7517SPeter Maydell 475197a847bcSbellardfor target in $target_list; do 475297a847bcSbellardtarget_dir="$target" 475325be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 4754c1799a84SPaolo Bonzinitarget_name=`echo $target | cut -d '-' -f 1` 475597a847bcSbellardtarget_bigendian="no" 47561f3d3c8fSJuan Quintela 4757c1799a84SPaolo Bonzinicase "$target_name" in 4758d15a9c23SAnthony Green armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 4759ea2d6a39SJuan Quintela target_bigendian=yes 4760ea2d6a39SJuan Quintela ;; 4761ea2d6a39SJuan Quintelaesac 476297a847bcSbellardtarget_softmmu="no" 4763997344f3Sbellardtarget_user_only="no" 4764831b7825Sthstarget_linux_user="no" 476584778508Sblueswir1target_bsd_user="no" 47669e407a85Spbrookcase "$target" in 4767c1799a84SPaolo Bonzini ${target_name}-softmmu) 47689e407a85Spbrook target_softmmu="yes" 47699e407a85Spbrook ;; 4770c1799a84SPaolo Bonzini ${target_name}-linux-user) 47719c7a4202SBlue Swirl if test "$linux" != "yes" ; then 477276ad07a4SPeter Maydell error_exit "Target '$target' is only available on a Linux host" 47739c7a4202SBlue Swirl fi 47749e407a85Spbrook target_user_only="yes" 47759e407a85Spbrook target_linux_user="yes" 47769e407a85Spbrook ;; 4777c1799a84SPaolo Bonzini ${target_name}-bsd-user) 47789cf55765SBlue Swirl if test "$bsd" != "yes" ; then 477976ad07a4SPeter Maydell error_exit "Target '$target' is only available on a BSD host" 47809c7a4202SBlue Swirl fi 478184778508Sblueswir1 target_user_only="yes" 478284778508Sblueswir1 target_bsd_user="yes" 478384778508Sblueswir1 ;; 47849e407a85Spbrook *) 478576ad07a4SPeter Maydell error_exit "Target '$target' not recognised" 47869e407a85Spbrook exit 1 47879e407a85Spbrook ;; 47889e407a85Spbrookesac 4789831b7825Sths 479097a847bcSbellardmkdir -p $target_dir 479125be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 479297a847bcSbellard 4793e5fe0c52Spbrookbflt="no" 4794c1799a84SPaolo Bonziniinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"` 479556aebc89Spbrookgdb_xml_files="" 47967ba1e619Saliguori 4797c1799a84SPaolo BonziniTARGET_ARCH="$target_name" 47986acff7daSJuan QuintelaTARGET_BASE_ARCH="" 4799e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 4800e73aae67SJuan Quintela 4801c1799a84SPaolo Bonzinicase "$target_name" in 48022408a527Saurel32 i386) 48032408a527Saurel32 ;; 48042408a527Saurel32 x86_64) 48056acff7daSJuan Quintela TARGET_BASE_ARCH=i386 48062408a527Saurel32 ;; 48072408a527Saurel32 alpha) 48082408a527Saurel32 ;; 48092408a527Saurel32 arm|armeb) 4810b498c8a0SJuan Quintela TARGET_ARCH=arm 4811e5fe0c52Spbrook bflt="yes" 481256aebc89Spbrook gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" 48132408a527Saurel32 ;; 48146a49fa95SAlexander Graf aarch64) 48156a49fa95SAlexander Graf TARGET_BASE_ARCH=arm 48166a49fa95SAlexander Graf bflt="yes" 48176a669427SPeter Maydell gdb_xml_files="aarch64-core.xml aarch64-fpu.xml" 48186a49fa95SAlexander Graf ;; 48192408a527Saurel32 cris) 48202408a527Saurel32 ;; 4821613a22c9SMichael Walle lm32) 4822613a22c9SMichael Walle ;; 48232408a527Saurel32 m68k) 48240938cda5Saurel32 bflt="yes" 482556aebc89Spbrook gdb_xml_files="cf-core.xml cf-fp.xml" 48262408a527Saurel32 ;; 4827877fdc12SEdgar E. Iglesias microblaze|microblazeel) 4828877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 482972b675caSEdgar E. Iglesias bflt="yes" 483072b675caSEdgar E. Iglesias ;; 48312408a527Saurel32 mips|mipsel) 4832b498c8a0SJuan Quintela TARGET_ARCH=mips 483325be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 48342408a527Saurel32 ;; 48352408a527Saurel32 mipsn32|mipsn32el) 4836597e2cecSRichard Henderson TARGET_ARCH=mips64 48376acff7daSJuan Quintela TARGET_BASE_ARCH=mips 483825be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 4839597e2cecSRichard Henderson echo "TARGET_ABI32=y" >> $config_target_mak 48402408a527Saurel32 ;; 48412408a527Saurel32 mips64|mips64el) 4842b498c8a0SJuan Quintela TARGET_ARCH=mips64 48436acff7daSJuan Quintela TARGET_BASE_ARCH=mips 484425be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 48452408a527Saurel32 ;; 4846d15a9c23SAnthony Green moxie) 4847d15a9c23SAnthony Green ;; 4848e67db06eSJia Liu or32) 4849e67db06eSJia Liu TARGET_ARCH=openrisc 4850e67db06eSJia Liu TARGET_BASE_ARCH=openrisc 4851e67db06eSJia Liu ;; 48522408a527Saurel32 ppc) 4853c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48542408a527Saurel32 ;; 48552408a527Saurel32 ppcemb) 48566acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4857e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4858c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48592408a527Saurel32 ;; 48602408a527Saurel32 ppc64) 48616acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4862e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4863c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48642408a527Saurel32 ;; 48652408a527Saurel32 ppc64abi32) 4866b498c8a0SJuan Quintela TARGET_ARCH=ppc64 48676acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4868e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 486925be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 4870c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 48712408a527Saurel32 ;; 48722408a527Saurel32 sh4|sh4eb) 4873b498c8a0SJuan Quintela TARGET_ARCH=sh4 48744dbed897Spbrook bflt="yes" 48752408a527Saurel32 ;; 48762408a527Saurel32 sparc) 48772408a527Saurel32 ;; 48782408a527Saurel32 sparc64) 48796acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 48802408a527Saurel32 ;; 48812408a527Saurel32 sparc32plus) 4882b498c8a0SJuan Quintela TARGET_ARCH=sparc64 48836acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 4884e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 488525be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 48862408a527Saurel32 ;; 488724e804ecSAlexander Graf s390x) 488824e804ecSAlexander Graf ;; 4889d2fbca94SGuan Xuetao unicore32) 4890d2fbca94SGuan Xuetao ;; 4891cfa550c6SMax Filippov xtensa|xtensaeb) 4892cfa550c6SMax Filippov TARGET_ARCH=xtensa 4893cfa550c6SMax Filippov ;; 48942408a527Saurel32 *) 489576ad07a4SPeter Maydell error_exit "Unsupported target CPU" 48962408a527Saurel32 ;; 48972408a527Saurel32esac 48985e8861a0SPaolo Bonzini# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 48995e8861a0SPaolo Bonziniif [ "$TARGET_BASE_ARCH" = "" ]; then 49005e8861a0SPaolo Bonzini TARGET_BASE_ARCH=$TARGET_ARCH 49015e8861a0SPaolo Bonzinifi 49025e8861a0SPaolo Bonzini 49035e8861a0SPaolo Bonzinisymlink "$source_path/Makefile.target" "$target_dir/Makefile" 49045e8861a0SPaolo Bonzini 490599afc91dSDaniel P. Berrangeupper() { 490699afc91dSDaniel P. Berrange echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' 490799afc91dSDaniel P. Berrange} 490899afc91dSDaniel P. Berrange 490999afc91dSDaniel P. Berrangetarget_arch_name="`upper $TARGET_ARCH`" 491025be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 4911c1799a84SPaolo Bonziniecho "TARGET_NAME=$target_name" >> $config_target_mak 491225be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 4913e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 4914e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 4915e6e91b9cSJuan Quintelafi 491625be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 4917c1799a84SPaolo Bonzinicase "$target_name" in 49181b0c87fcSJuan Quintela i386|x86_64) 49191b0c87fcSJuan Quintela if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then 492025be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 4921eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = yes; then 4922eb6fda0fSAnthony PERARD echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" 4923eb6fda0fSAnthony PERARD fi 4924432d268cSJun Nakajima fi 492559d21e53SAlexander Graf ;; 492659d21e53SAlexander Graf *) 49271b0c87fcSJuan Quintelaesac 4928c1799a84SPaolo Bonzinicase "$target_name" in 492970a5f682SPeter Maydell aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x) 4930c59249f9SJuan Quintela # Make sure the target and host cpus are compatible 4931c59249f9SJuan Quintela if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ 4932c1799a84SPaolo Bonzini \( "$target_name" = "$cpu" -o \ 4933c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc" \) -o \ 4934c1799a84SPaolo Bonzini \( "$target_name" = "ppc64" -a "$cpu" = "ppc" \) -o \ 4935c1799a84SPaolo Bonzini \( "$target_name" = "ppc" -a "$cpu" = "ppc64" \) -o \ 4936c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ 4937c1799a84SPaolo Bonzini \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \ 4938c1799a84SPaolo Bonzini \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) \) ; then 493925be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 49401ba16968SStefan Weil if test "$vhost_net" = "yes" ; then 4941d5970055SMichael S. Tsirkin echo "CONFIG_VHOST_NET=y" >> $config_target_mak 4942d5970055SMichael S. Tsirkin fi 4943c59249f9SJuan Quintela fi 4944c59249f9SJuan Quintelaesac 4945de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 494625be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 494797a847bcSbellardfi 494897a847bcSbellardif test "$target_softmmu" = "yes" ; then 494925be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 4950de83cd02Sbellardfi 4951997344f3Sbellardif test "$target_user_only" = "yes" ; then 495225be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 4953a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 4954997344f3Sbellardfi 4955831b7825Sthsif test "$target_linux_user" = "yes" ; then 495625be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 4957831b7825Sthsfi 495856aebc89Spbrooklist="" 495956aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 496056aebc89Spbrook for x in $gdb_xml_files; do 496156aebc89Spbrook list="$list $source_path/gdb-xml/$x" 496256aebc89Spbrook done 496325be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 49643d0f1517SJuan Quintelafi 4965de83cd02Sbellard 4966e5fe0c52Spbrookif test "$target_user_only" = "yes" -a "$bflt" = "yes"; then 496725be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 4968e5fe0c52Spbrookfi 4969379f6698SPaul Brookif test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then 497025be210fSJuan Quintela echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak 4971379f6698SPaul Brookfi 497284778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 497325be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 497484778508Sblueswir1fi 49755b0753e0Sbellard 49764afddb55SJuan Quintela# generate QEMU_CFLAGS/LDFLAGS for targets 4977fa282484SJuan Quintela 49784afddb55SJuan Quintelacflags="" 4979fa282484SJuan Quintelaldflags="" 49809b8e111fSJuan Quintela 498164656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 498264656024SJuan Quintela case "$i" in 498364656024SJuan Quintela alpha) 498425be210fSJuan Quintela echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak 498576cad711SPaolo Bonzini echo "CONFIG_ALPHA_DIS=y" >> config-all-disas.mak 498664656024SJuan Quintela ;; 498782295d8aSRichard Henderson aarch64) 498882295d8aSRichard Henderson if test -n "${cxx}"; then 498982295d8aSRichard Henderson echo "CONFIG_ARM_A64_DIS=y" >> $config_target_mak 499082295d8aSRichard Henderson echo "CONFIG_ARM_A64_DIS=y" >> config-all-disas.mak 499182295d8aSRichard Henderson fi 499282295d8aSRichard Henderson ;; 499364656024SJuan Quintela arm) 499425be210fSJuan Quintela echo "CONFIG_ARM_DIS=y" >> $config_target_mak 499576cad711SPaolo Bonzini echo "CONFIG_ARM_DIS=y" >> config-all-disas.mak 4996999b53ecSClaudio Fontana if test -n "${cxx}"; then 4997999b53ecSClaudio Fontana echo "CONFIG_ARM_A64_DIS=y" >> $config_target_mak 4998999b53ecSClaudio Fontana echo "CONFIG_ARM_A64_DIS=y" >> config-all-disas.mak 4999999b53ecSClaudio Fontana fi 500064656024SJuan Quintela ;; 500164656024SJuan Quintela cris) 500225be210fSJuan Quintela echo "CONFIG_CRIS_DIS=y" >> $config_target_mak 500376cad711SPaolo Bonzini echo "CONFIG_CRIS_DIS=y" >> config-all-disas.mak 500464656024SJuan Quintela ;; 500564656024SJuan Quintela hppa) 500625be210fSJuan Quintela echo "CONFIG_HPPA_DIS=y" >> $config_target_mak 500776cad711SPaolo Bonzini echo "CONFIG_HPPA_DIS=y" >> config-all-disas.mak 500864656024SJuan Quintela ;; 5009c72b26ecSRichard Henderson i386|x86_64|x32) 501025be210fSJuan Quintela echo "CONFIG_I386_DIS=y" >> $config_target_mak 501176cad711SPaolo Bonzini echo "CONFIG_I386_DIS=y" >> config-all-disas.mak 501264656024SJuan Quintela ;; 5013903ec55cSAurelien Jarno ia64*) 5014903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $config_target_mak 501576cad711SPaolo Bonzini echo "CONFIG_IA64_DIS=y" >> config-all-disas.mak 5016903ec55cSAurelien Jarno ;; 501779368f49SMichael Walle lm32) 501879368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $config_target_mak 501976cad711SPaolo Bonzini echo "CONFIG_LM32_DIS=y" >> config-all-disas.mak 502079368f49SMichael Walle ;; 502164656024SJuan Quintela m68k) 502225be210fSJuan Quintela echo "CONFIG_M68K_DIS=y" >> $config_target_mak 502376cad711SPaolo Bonzini echo "CONFIG_M68K_DIS=y" >> config-all-disas.mak 502464656024SJuan Quintela ;; 5025877fdc12SEdgar E. Iglesias microblaze*) 502625be210fSJuan Quintela echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak 502776cad711SPaolo Bonzini echo "CONFIG_MICROBLAZE_DIS=y" >> config-all-disas.mak 502864656024SJuan Quintela ;; 502964656024SJuan Quintela mips*) 503025be210fSJuan Quintela echo "CONFIG_MIPS_DIS=y" >> $config_target_mak 503176cad711SPaolo Bonzini echo "CONFIG_MIPS_DIS=y" >> config-all-disas.mak 503264656024SJuan Quintela ;; 5033d15a9c23SAnthony Green moxie*) 5034d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> $config_target_mak 5035d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> config-all-disas.mak 5036d15a9c23SAnthony Green ;; 5037e67db06eSJia Liu or32) 5038e67db06eSJia Liu echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak 503976cad711SPaolo Bonzini echo "CONFIG_OPENRISC_DIS=y" >> config-all-disas.mak 5040e67db06eSJia Liu ;; 504164656024SJuan Quintela ppc*) 504225be210fSJuan Quintela echo "CONFIG_PPC_DIS=y" >> $config_target_mak 504376cad711SPaolo Bonzini echo "CONFIG_PPC_DIS=y" >> config-all-disas.mak 504464656024SJuan Quintela ;; 504524e804ecSAlexander Graf s390*) 504625be210fSJuan Quintela echo "CONFIG_S390_DIS=y" >> $config_target_mak 504776cad711SPaolo Bonzini echo "CONFIG_S390_DIS=y" >> config-all-disas.mak 504864656024SJuan Quintela ;; 504964656024SJuan Quintela sh4) 505025be210fSJuan Quintela echo "CONFIG_SH4_DIS=y" >> $config_target_mak 505176cad711SPaolo Bonzini echo "CONFIG_SH4_DIS=y" >> config-all-disas.mak 505264656024SJuan Quintela ;; 505364656024SJuan Quintela sparc*) 505425be210fSJuan Quintela echo "CONFIG_SPARC_DIS=y" >> $config_target_mak 505576cad711SPaolo Bonzini echo "CONFIG_SPARC_DIS=y" >> config-all-disas.mak 505664656024SJuan Quintela ;; 5057cfa550c6SMax Filippov xtensa*) 5058cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak 505976cad711SPaolo Bonzini echo "CONFIG_XTENSA_DIS=y" >> config-all-disas.mak 5060cfa550c6SMax Filippov ;; 506164656024SJuan Quintela esac 506264656024SJuan Quinteladone 50639195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 50649195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $config_target_mak 506576cad711SPaolo Bonzini echo "CONFIG_TCI_DIS=y" >> config-all-disas.mak 50669195b2c2SStefan Weilfi 506764656024SJuan Quintela 50686ee7126fSJuan Quintelacase "$ARCH" in 50696ee7126fSJuan Quintelaalpha) 50706ee7126fSJuan Quintela # Ensure there's only a single GP 50716ee7126fSJuan Quintela cflags="-msmall-data $cflags" 50726ee7126fSJuan Quintela;; 50736ee7126fSJuan Quintelaesac 50746ee7126fSJuan Quintela 5075d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 507625be210fSJuan Quintela echo "TARGET_GPROF=yes" >> $config_target_mak 5077d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 5078d02c1db3SJuan Quintela cflags="-p $cflags" 5079d02c1db3SJuan Quintela ldflags="-p $ldflags" 5080d02c1db3SJuan Quintela fi 5081d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 5082d02c1db3SJuan Quintela ldflags="-p $ldflags" 508325be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 5084d02c1db3SJuan Quintela fi 5085d02c1db3SJuan Quintelafi 5086d02c1db3SJuan Quintela 50879b8e111fSJuan Quintelaif test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then 5088964c6fa1SRichard Henderson ldflags="$ldflags $textseg_ldflags" 5089fa282484SJuan Quintelafi 5090fa282484SJuan Quintela 509125be210fSJuan Quintelaecho "LDFLAGS+=$ldflags" >> $config_target_mak 509225be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 5093fa282484SJuan Quintela 509497a847bcSbellarddone # for target in $targets 50957d13299dSbellard 5096b776eca1SGerd Hoffmannif [ "$pixman" = "internal" ]; then 5097b776eca1SGerd Hoffmann echo "config-host.h: subdir-pixman" >> $config_host_mak 5098b776eca1SGerd Hoffmannfi 5099b776eca1SGerd Hoffmann 51002da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 51012da776dbSMichael R. Hinesecho "CONFIG_RDMA=y" >> $config_host_mak 51022da776dbSMichael R. Hinesfi 51032da776dbSMichael R. Hines 5104a540f158SPeter Crosthwaiteif [ "$dtc_internal" = "yes" ]; then 5105a540f158SPeter Crosthwaite echo "config-host.h: subdir-dtc" >> $config_host_mak 5106a540f158SPeter Crosthwaitefi 5107a540f158SPeter Crosthwaite 5108d1807a4fSPaolo Bonzini# build tree in object directory in case the source is not in the current directory 5109f93296eaSWenchao XiaDIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" 51102b170effSMichael TokarevDIRS="$DIRS fsdev" 51119933c305SChristian BorntraegerDIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" 51122d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 51132dee8d54SPaolo BonziniDIRS="$DIRS qapi-generated" 5114c09015ddSAnthony LiguoriFILES="Makefile tests/tcg/Makefile qdict-test-data.txt" 5115c09015ddSAnthony LiguoriFILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" 5116aaa2ebc5SAndreas FärberFILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" 5117ae0bfb79SBlue SwirlFILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" 5118446b9165SAndreas FärberFILES="$FILES pc-bios/spapr-rtas/Makefile" 51199933c305SChristian BorntraegerFILES="$FILES pc-bios/s390-ccw/Makefile" 51202d9f27d2SAnthony LiguoriFILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" 51214652b792SJan KiszkaFILES="$FILES pc-bios/qemu-icon.bmp" 5122753d11f2SRichard Hendersonfor bios_file in \ 5123753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 51245acc2ec0SGerd Hoffmann $source_path/pc-bios/*.aml \ 5125753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 5126753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 5127e89e33e1SDominik Dingel $source_path/pc-bios/*.img \ 5128753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 5129753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 5130753d11f2SRichard Hendersondo 51317ea78b74SJan Kiszka FILES="$FILES pc-bios/`basename $bios_file`" 51327ea78b74SJan Kiszkadone 5133c2304b52SMarcel Apfelbaumfor test_file in `find $source_path/tests/acpi-test-data -type f` 5134c2304b52SMarcel Apfelbaumdo 5135c2304b52SMarcel Apfelbaum FILES="$FILES tests/acpi-test-data`echo $test_file | sed -e 's/.*acpi-test-data//'`" 5136c2304b52SMarcel Apfelbaumdone 5137d1807a4fSPaolo Bonzinimkdir -p $DIRS 51387d13299dSbellardfor f in $FILES ; do 513972b8b5a1SStefan Weil if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then 5140f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 5141f9245e10SPeter Maydell fi 51427d13299dSbellarddone 51431ad2134fSPaul Brook 5144c34ebfdcSAnthony Liguori# temporary config to build submodules 51452d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 5146c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 514737116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 5148c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 51493dd46c78SBlue Swirl echo "AS=$as" >> $config_mak 5150c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 5151c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 51523dd46c78SBlue Swirl echo "CPP=$cpp" >> $config_mak 5153c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 5154a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_mak 5155c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 5156c34ebfdcSAnthony Liguoridone 5157c34ebfdcSAnthony Liguori 5158b40292e7SJan Kiszkaif test "$docs" = "yes" ; then 5159b40292e7SJan Kiszka mkdir -p QMP 5160b40292e7SJan Kiszkafi 5161dc655404SMichael S. Tsirkin 5162dc655404SMichael S. Tsirkin# Save the configure command line for later reuse. 5163dc655404SMichael S. Tsirkincat <<EOD >config.status 5164dc655404SMichael S. Tsirkin#!/bin/sh 5165dc655404SMichael S. Tsirkin# Generated by configure. 5166dc655404SMichael S. Tsirkin# Run this file to recreate the current configuration. 5167dc655404SMichael S. Tsirkin# Compiler output produced by configure, useful for debugging 5168dc655404SMichael S. Tsirkin# configure, is in config.log if it exists. 5169dc655404SMichael S. TsirkinEOD 5170dc655404SMichael S. Tsirkinprintf "exec" >>config.status 5171dc655404SMichael S. Tsirkinprintf " '%s'" "$0" "$@" >>config.status 5172dc655404SMichael S. Tsirkinecho >>config.status 5173dc655404SMichael S. Tsirkinchmod +x config.status 5174dc655404SMichael S. Tsirkin 5175