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" 153ef693a0SbellardTMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" 16a91b857cSmalcTMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe" 177d13299dSbellard 180ba8681eSLoïc Minier# NB: do not call "exit" in the trap handler; this is buggy with some shells; 190ba8681eSLoïc Minier# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org> 200ba8681eSLoïc Miniertrap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM 21da1d85e3SGerd Hoffmannrm -f config.log 229ac81bbbSmalc 23b48e3611SPeter Maydell# Print a helpful header at the top of config.log 24b48e3611SPeter Maydellecho "# QEMU configure log $(date)" >> config.log 25979ae168SPeter Maydellprintf "# Configured with:" >> config.log 26979ae168SPeter Maydellprintf " '%s'" "$0" "$@" >> config.log 27979ae168SPeter Maydellecho >> config.log 28b48e3611SPeter Maydellecho "#" >> config.log 29b48e3611SPeter Maydell 30bdf523e6SStefan Weil# Save the configure command line for later reuse. 31bdf523e6SStefan Weilcat <<EOD >config.status 32bdf523e6SStefan Weil#!/bin/sh 33bdf523e6SStefan Weil# Generated by configure. 34bdf523e6SStefan Weil# Run this file to recreate the current configuration. 35bdf523e6SStefan Weil# Compiler output produced by configure, useful for debugging 36bdf523e6SStefan Weil# configure, is in config.log if it exists. 37bdf523e6SStefan WeilEOD 38bdf523e6SStefan Weilprintf "exec" >>config.status 39bdf523e6SStefan Weilprintf " '%s'" "$0" "$@" >>config.status 40bdf523e6SStefan Weilecho >>config.status 41bdf523e6SStefan Weilchmod +x config.status 42bdf523e6SStefan Weil 4376ad07a4SPeter Maydellerror_exit() { 4476ad07a4SPeter Maydell echo 4576ad07a4SPeter Maydell echo "ERROR: $1" 4676ad07a4SPeter Maydell while test -n "$2"; do 4776ad07a4SPeter Maydell echo " $2" 4876ad07a4SPeter Maydell shift 4976ad07a4SPeter Maydell done 5076ad07a4SPeter Maydell echo 5176ad07a4SPeter Maydell exit 1 5276ad07a4SPeter Maydell} 5376ad07a4SPeter Maydell 548dc38a78SPeter Maydelldo_cc() { 558dc38a78SPeter Maydell # Run the compiler, capturing its output to the log. 568dc38a78SPeter Maydell echo $cc "$@" >> config.log 578dc38a78SPeter Maydell $cc "$@" >> config.log 2>&1 || return $? 588dc38a78SPeter Maydell # Test passed. If this is an --enable-werror build, rerun 598dc38a78SPeter Maydell # the test with -Werror and bail out if it fails. This 608dc38a78SPeter Maydell # makes warning-generating-errors in configure test code 618dc38a78SPeter Maydell # obvious to developers. 628dc38a78SPeter Maydell if test "$werror" != "yes"; then 638dc38a78SPeter Maydell return 0 648dc38a78SPeter Maydell fi 658dc38a78SPeter Maydell # Don't bother rerunning the compile if we were already using -Werror 668dc38a78SPeter Maydell case "$*" in 678dc38a78SPeter Maydell *-Werror*) 688dc38a78SPeter Maydell return 0 698dc38a78SPeter Maydell ;; 708dc38a78SPeter Maydell esac 718dc38a78SPeter Maydell echo $cc -Werror "$@" >> config.log 728dc38a78SPeter Maydell $cc -Werror "$@" >> config.log 2>&1 && return $? 7376ad07a4SPeter Maydell error_exit "configure test passed without -Werror but failed with -Werror." \ 7476ad07a4SPeter Maydell "This is probably a bug in the configure script. The failing command" \ 7576ad07a4SPeter Maydell "will be at the bottom of config.log." \ 7676ad07a4SPeter Maydell "You can run configure with --disable-werror to bypass this check." 778dc38a78SPeter Maydell} 788dc38a78SPeter Maydell 7952166aa0SJuan Quintelacompile_object() { 808dc38a78SPeter Maydell do_cc $QEMU_CFLAGS -c -o $TMPO $TMPC 8152166aa0SJuan Quintela} 8252166aa0SJuan Quintela 8352166aa0SJuan Quintelacompile_prog() { 8452166aa0SJuan Quintela local_cflags="$1" 8552166aa0SJuan Quintela local_ldflags="$2" 868dc38a78SPeter Maydell do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags 8752166aa0SJuan Quintela} 8852166aa0SJuan Quintela 8911568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 9011568d6dSPaolo Bonzinisymlink() { 9172b8b5a1SStefan Weil rm -rf "$2" 92ec5b06d7SAnthony Liguori mkdir -p "$(dirname "$2")" 9372b8b5a1SStefan Weil ln -s "$1" "$2" 9411568d6dSPaolo Bonzini} 9511568d6dSPaolo Bonzini 960dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 970dba6195SLoïc Minier# executable or a builtin) 980dba6195SLoïc Minierhas() { 990dba6195SLoïc Minier type "$1" >/dev/null 2>&1 1000dba6195SLoïc Minier} 1010dba6195SLoïc Minier 1020dba6195SLoïc Minier# search for an executable in PATH 1030dba6195SLoïc Minierpath_of() { 1040dba6195SLoïc Minier local_command="$1" 1050dba6195SLoïc Minier local_ifs="$IFS" 1060dba6195SLoïc Minier local_dir="" 1070dba6195SLoïc Minier 1080dba6195SLoïc Minier # pathname has a dir component? 1090dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 1100dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 1110dba6195SLoïc Minier echo "$local_command" 1120dba6195SLoïc Minier return 0 1130dba6195SLoïc Minier fi 1140dba6195SLoïc Minier fi 1150dba6195SLoïc Minier if [ -z "$local_command" ]; then 1160dba6195SLoïc Minier return 1 1170dba6195SLoïc Minier fi 1180dba6195SLoïc Minier 1190dba6195SLoïc Minier IFS=: 1200dba6195SLoïc Minier for local_dir in $PATH; do 1210dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 1220dba6195SLoïc Minier echo "$local_dir/$local_command" 1230dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1240dba6195SLoïc Minier return 0 1250dba6195SLoïc Minier fi 1260dba6195SLoïc Minier done 1270dba6195SLoïc Minier # not found 1280dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1290dba6195SLoïc Minier return 1 1300dba6195SLoïc Minier} 1310dba6195SLoïc Minier 1327d13299dSbellard# default parameters 133ca4deeb1SPaolo Bonzinisource_path=`dirname "$0"` 1342ff6b91eSJuan Quintelacpu="" 135a31a8642SMichael S. Tsirkiniasl="iasl" 1361e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 13743ce4dfeSbellardstatic="no" 1387d13299dSbellardcross_prefix="" 1390c58ac1cSmalcaudio_drv_list="" 140b64ec4e4SFam Zhengblock_drv_rw_whitelist="" 141b64ec4e4SFam Zhengblock_drv_ro_whitelist="" 142e49d021eSPeter Maydellhost_cc="cc" 14373da375eSJuan Quintelalibs_softmmu="" 1443e2e0e6bSJuan Quintelalibs_tools="" 14567f86e8eSJuan Quintelaaudio_pt_int="" 146d5631638Smalcaudio_win_int="" 1472b2e59e6SPaolo Bonzinicc_i386=i386-pc-linux-gnu-gcc 148957f1f99SMichael Rothlibs_qga="" 1495bc62e01SGerd Hoffmanndebug_info="yes" 150ac0df51dSaliguori 151afb63ebdSStefan Weil# Don't accept a target_list environment variable. 152afb63ebdSStefan Weilunset target_list 153377529c0SPaolo Bonzini 154377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 155377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 156377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 157377529c0SPaolo Bonzini# unless --disable-foo is given 158377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 159377529c0SPaolo Bonzini# feature will searched for, 160377529c0SPaolo Bonzini# if not found, configure exits with error 161377529c0SPaolo Bonzini# 162377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 163377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 164377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 165377529c0SPaolo Bonzini 166377529c0SPaolo Bonzinibluez="" 167377529c0SPaolo Bonzinibrlapi="" 168377529c0SPaolo Bonzinicurl="" 169377529c0SPaolo Bonzinicurses="" 170377529c0SPaolo Bonzinidocs="" 171377529c0SPaolo Bonzinifdt="" 17258952137SVincenzo Maffionenetmap="no" 173e2134eb9SGerd Hoffmannpixman="" 174377529c0SPaolo Bonzinisdl="" 175983eef5aSMeador Ingevirtfs="" 176821601eaSJes Sorensenvnc="yes" 177377529c0SPaolo Bonzinisparse="no" 178377529c0SPaolo Bonziniuuid="" 179377529c0SPaolo Bonzinivde="" 180377529c0SPaolo Bonzinivnc_tls="" 181377529c0SPaolo Bonzinivnc_sasl="" 182377529c0SPaolo Bonzinivnc_jpeg="" 183377529c0SPaolo Bonzinivnc_png="" 1847536ee4bSTim Hardeckvnc_ws="" 185377529c0SPaolo Bonzinixen="" 186d5b93ddfSAnthony PERARDxen_ctrl_version="" 187eb6fda0fSAnthony PERARDxen_pci_passthrough="" 188377529c0SPaolo Bonzinilinux_aio="" 18947e98658SCorey Bryantcap_ng="" 190377529c0SPaolo Bonziniattr="" 1914f26f2b6SAvi Kivitylibattr="" 192377529c0SPaolo Bonzinixfs="" 193377529c0SPaolo Bonzini 194d41a75a2SBradvhost_net="no" 1955e9be92dSNicholas Bellingervhost_scsi="no" 196d41a75a2SBradkvm="no" 1972da776dbSMichael R. Hinesrdma="" 198377529c0SPaolo Bonzinigprof="no" 199377529c0SPaolo Bonzinidebug_tcg="no" 200377529c0SPaolo Bonzinidebug="no" 201377529c0SPaolo Bonzinistrip_opt="yes" 2029195b2c2SStefan Weiltcg_interpreter="no" 203377529c0SPaolo Bonzinibigendian="no" 204377529c0SPaolo Bonzinimingw32="no" 2051d728c39SBlue Swirlgcov="no" 2061d728c39SBlue Swirlgcov_tool="gcov" 207377529c0SPaolo BonziniEXESUF="" 208377529c0SPaolo Bonziniprefix="/usr/local" 209377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 210528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 211850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 212377529c0SPaolo Bonzinibindir="\${prefix}/bin" 2133aa5d2beSAlon Levylibdir="\${prefix}/lib" 2148bf188aaSMichael Tokarevlibexecdir="\${prefix}/libexec" 2150f94d6daSAlon Levyincludedir="\${prefix}/include" 216377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 217785c23aeSLuiz Capitulinolocal_statedir="\${prefix}/var" 218377529c0SPaolo Bonziniconfsuffix="/qemu" 219377529c0SPaolo Bonzinislirp="yes" 220377529c0SPaolo Bonzinifmod_lib="" 221377529c0SPaolo Bonzinifmod_inc="" 222377529c0SPaolo Bonzinioss_lib="" 223377529c0SPaolo Bonzinibsd="no" 224377529c0SPaolo Bonzinilinux="no" 225377529c0SPaolo Bonzinisolaris="no" 226377529c0SPaolo Bonziniprofiler="no" 227377529c0SPaolo Bonzinicocoa="no" 228377529c0SPaolo Bonzinisoftmmu="yes" 229377529c0SPaolo Bonzinilinux_user="no" 230377529c0SPaolo Bonzinibsd_user="no" 23130163d89SPeter Maydellguest_base="yes" 232377529c0SPaolo Bonziniuname_release="" 233377529c0SPaolo Bonziniaix="no" 234377529c0SPaolo Bonziniblobs="yes" 235377529c0SPaolo Bonzinipkgversion="" 23640d6444eSAvi Kivitypie="" 237377529c0SPaolo Bonzinizero_malloc="" 2383556c233SPaolo Bonziniqom_cast_debug="yes" 239377529c0SPaolo Bonzinitrace_backend="nop" 240377529c0SPaolo Bonzinitrace_file="trace" 241377529c0SPaolo Bonzinispice="" 242377529c0SPaolo Bonzinirbd="" 243111a38b0SRobert Relyeasmartcard_nss="" 2442b2325ffSGerd Hoffmannlibusb="" 24569354a83SHans de Goedeusb_redir="" 246b1e5fff4SMichael Walleglx="" 2471ece9905SAlon Levyzlib="yes" 248e8ef31a3SMichael Tokarevguest_agent="" 249d9840e25STomoki Sekiyamaguest_agent_with_vss="no" 250d9840e25STomoki Sekiyamavss_win32_sdk="" 251d9840e25STomoki Sekiyamawin_sdk="no" 2524b1c11fdSDaniel P. Berrangewant_tools="yes" 253c589b249SRonnie Sahlberglibiscsi="" 254*6542aa9cSPeter Lievenlibnfs="" 255519175a2SAlex Barcelocoroutine="" 25670c60c08SStefan Hajnoczicoroutine_pool="" 257f794573eSEduardo Otuboseccomp="" 258eb100396SBharata B Raoglusterfs="" 2590c14fb47SBharata B Raoglusterfs_discard="no" 2607c815372SBharata B Raoglusterfs_zerofill="no" 261583f6e7bSStefan Hajnoczivirtio_blk_data_plane="" 262a4ccabcfSAnthony Liguorigtk="" 263528de90aSDaniel P. Berrangegtkabi="2.0" 264ab214c29SStefan Bergertpm="no" 2650a12ec87SRichard W.M. Joneslibssh2="" 2664f18b782SJeff Codyvhdx="" 267377529c0SPaolo Bonzini 268ac0df51dSaliguori# parse CC options first 269ac0df51dSaliguorifor opt do 270ac0df51dSaliguori optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 271ac0df51dSaliguori case "$opt" in 272ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 273ac0df51dSaliguori ;; 2743d8df640SPaolo Bonzini --cc=*) CC="$optarg" 275ac0df51dSaliguori ;; 27683f73fceSTomoki Sekiyama --cxx=*) CXX="$optarg" 27783f73fceSTomoki Sekiyama ;; 278ca4deeb1SPaolo Bonzini --source-path=*) source_path="$optarg" 279ca4deeb1SPaolo Bonzini ;; 2802ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 2812ff6b91eSJuan Quintela ;; 282a558ee17SJuan Quintela --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" 283f9943cd5SGerd Hoffmann EXTRA_CFLAGS="$optarg" 284e2a2ed06SJuan Quintela ;; 285e2a2ed06SJuan Quintela --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" 286f9943cd5SGerd Hoffmann EXTRA_LDFLAGS="$optarg" 287e2a2ed06SJuan Quintela ;; 2885bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 2895bc62e01SGerd Hoffmann ;; 2905bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 2915bc62e01SGerd Hoffmann ;; 292ac0df51dSaliguori esac 293ac0df51dSaliguoridone 294ac0df51dSaliguori# OS specific 295ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 29693148aa5SStefan Weil# we can eliminate its usage altogether. 297ac0df51dSaliguori 298e49d021eSPeter Maydell# Preferred compiler: 299e49d021eSPeter Maydell# ${CC} (if set) 300e49d021eSPeter Maydell# ${cross_prefix}gcc (if cross-prefix specified) 301e49d021eSPeter Maydell# system compiler 302e49d021eSPeter Maydellif test -z "${CC}${cross_prefix}"; then 303e49d021eSPeter Maydell cc="$host_cc" 304e49d021eSPeter Maydellelse 305b3198cc2SStuart Yoder cc="${CC-${cross_prefix}gcc}" 306e49d021eSPeter Maydellfi 307e49d021eSPeter Maydell 30883f73fceSTomoki Sekiyamaif test -z "${CXX}${cross_prefix}"; then 30983f73fceSTomoki Sekiyama cxx="c++" 31083f73fceSTomoki Sekiyamaelse 31183f73fceSTomoki Sekiyama cxx="${CXX-${cross_prefix}g++}" 31283f73fceSTomoki Sekiyamafi 31383f73fceSTomoki Sekiyama 314b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 3153dd46c78SBlue Swirlas="${AS-${cross_prefix}as}" 3163dd46c78SBlue Swirlcpp="${CPP-$cc -E}" 317b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 318b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 3193f534581SBradlibtool="${LIBTOOL-${cross_prefix}libtool}" 320b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 321b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 32217884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 32317884d7bSSergei Trofimovichquery_pkg_config() { 32417884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 32517884d7bSSergei Trofimovich} 32617884d7bSSergei Trofimovichpkg_config=query_pkg_config 327b3198cc2SStuart Yodersdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" 328ac0df51dSaliguori 32945d285abSPeter Maydell# If the user hasn't specified ARFLAGS, default to 'rv', just as make does. 33045d285abSPeter MaydellARFLAGS="${ARFLAGS-rv}" 33145d285abSPeter Maydell 332be17dc90SMichael S. Tsirkin# default flags for all hosts 333be17dc90SMichael S. TsirkinQEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" 334f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 335c95e3080SKevin WolfQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 336be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 3376b4c305cSPaolo BonziniQEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/include" 3385bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 3395bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 340be17dc90SMichael S. Tsirkin LDFLAGS="-g $LDFLAGS" 3415bc62e01SGerd Hoffmannfi 342be17dc90SMichael S. Tsirkin 343ca4deeb1SPaolo Bonzini# make source path absolute 344ca4deeb1SPaolo Bonzinisource_path=`cd "$source_path"; pwd` 345ca4deeb1SPaolo Bonzini 346ac0df51dSaliguoricheck_define() { 347ac0df51dSaliguoricat > $TMPC <<EOF 348ac0df51dSaliguori#if !defined($1) 349fd786e1aSPeter Maydell#error $1 not defined 350ac0df51dSaliguori#endif 351ac0df51dSaliguoriint main(void) { return 0; } 352ac0df51dSaliguoriEOF 35352166aa0SJuan Quintela compile_object 354ac0df51dSaliguori} 355ac0df51dSaliguori 356bbea4050SPeter Maydellif check_define __linux__ ; then 357bbea4050SPeter Maydell targetos="Linux" 358bbea4050SPeter Maydellelif check_define _WIN32 ; then 359bbea4050SPeter Maydell targetos='MINGW32' 360bbea4050SPeter Maydellelif check_define __OpenBSD__ ; then 361bbea4050SPeter Maydell targetos='OpenBSD' 362bbea4050SPeter Maydellelif check_define __sun__ ; then 363bbea4050SPeter Maydell targetos='SunOS' 364bbea4050SPeter Maydellelif check_define __HAIKU__ ; then 365bbea4050SPeter Maydell targetos='Haiku' 366bbea4050SPeter Maydellelse 367bbea4050SPeter Maydell targetos=`uname -s` 368bbea4050SPeter Maydellfi 369bbea4050SPeter Maydell 370bbea4050SPeter Maydell# Some host OSes need non-standard checks for which CPU to use. 371bbea4050SPeter Maydell# Note that these checks are broken for cross-compilation: if you're 372bbea4050SPeter Maydell# cross-compiling to one of these OSes then you'll need to specify 373bbea4050SPeter Maydell# the correct CPU with the --cpu option. 374bbea4050SPeter Maydellcase $targetos in 375bbea4050SPeter MaydellDarwin) 376bbea4050SPeter Maydell # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can 377bbea4050SPeter Maydell # run 64-bit userspace code. 378bbea4050SPeter Maydell # If the user didn't specify a CPU explicitly and the kernel says this is 379bbea4050SPeter Maydell # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. 380bbea4050SPeter Maydell if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then 381bbea4050SPeter Maydell cpu="x86_64" 382bbea4050SPeter Maydell fi 383bbea4050SPeter Maydell ;; 384bbea4050SPeter MaydellSunOS) 385bbea4050SPeter Maydell # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo 386bbea4050SPeter Maydell if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then 387bbea4050SPeter Maydell cpu="x86_64" 388bbea4050SPeter Maydell fi 389bbea4050SPeter Maydellesac 390bbea4050SPeter Maydell 3912ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 3922ff6b91eSJuan Quintela # command line argument 3932ff6b91eSJuan Quintela : 3942ff6b91eSJuan Quintelaelif check_define __i386__ ; then 395ac0df51dSaliguori cpu="i386" 396ac0df51dSaliguorielif check_define __x86_64__ ; then 397c72b26ecSRichard Henderson if check_define __ILP32__ ; then 398c72b26ecSRichard Henderson cpu="x32" 399c72b26ecSRichard Henderson else 400ac0df51dSaliguori cpu="x86_64" 401c72b26ecSRichard Henderson fi 4023aa9bd6cSblueswir1elif check_define __sparc__ ; then 4033aa9bd6cSblueswir1 if check_define __arch64__ ; then 4043aa9bd6cSblueswir1 cpu="sparc64" 4053aa9bd6cSblueswir1 else 4063aa9bd6cSblueswir1 cpu="sparc" 4073aa9bd6cSblueswir1 fi 408fdf7ed96Smalcelif check_define _ARCH_PPC ; then 409fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 410fdf7ed96Smalc cpu="ppc64" 411ac0df51dSaliguori else 412fdf7ed96Smalc cpu="ppc" 413fdf7ed96Smalc fi 414afa05235SAurelien Jarnoelif check_define __mips__ ; then 415afa05235SAurelien Jarno cpu="mips" 416477ba620SAurelien Jarnoelif check_define __ia64__ ; then 417477ba620SAurelien Jarno cpu="ia64" 418d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 419d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 420d66ed0eaSAurelien Jarno cpu="s390x" 421d66ed0eaSAurelien Jarno else 422d66ed0eaSAurelien Jarno cpu="s390" 423d66ed0eaSAurelien Jarno fi 42421d89f84SPeter Maydellelif check_define __arm__ ; then 42521d89f84SPeter Maydell cpu="arm" 4261f080313SClaudio Fontanaelif check_define __aarch64__ ; then 4271f080313SClaudio Fontana cpu="aarch64" 428f28ffed5SBradelif check_define __hppa__ ; then 429f28ffed5SBrad cpu="hppa" 430fdf7ed96Smalcelse 431fdf7ed96Smalc cpu=`uname -m` 432ac0df51dSaliguorifi 433ac0df51dSaliguori 434359bc95dSPeter MaydellARCH= 435359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 436359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 4377d13299dSbellardcase "$cpu" in 438c72b26ecSRichard Henderson ia64|ppc|ppc64|s390|s390x|sparc64|x32) 439ea8f20f8SJuan Quintela cpu="$cpu" 440ea8f20f8SJuan Quintela ;; 4417d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 44297a847bcSbellard cpu="i386" 4437d13299dSbellard ;; 444aaa5fa14Saurel32 x86_64|amd64) 445aaa5fa14Saurel32 cpu="x86_64" 446aaa5fa14Saurel32 ;; 44721d89f84SPeter Maydell armv*b|armv*l|arm) 44821d89f84SPeter Maydell cpu="arm" 4497d13299dSbellard ;; 4501f080313SClaudio Fontana aarch64) 4511f080313SClaudio Fontana cpu="aarch64" 4521f080313SClaudio Fontana ;; 453afa05235SAurelien Jarno mips*) 454afa05235SAurelien Jarno cpu="mips" 455afa05235SAurelien Jarno ;; 4563142255cSblueswir1 sparc|sun4[cdmuv]) 457ae228531Sbellard cpu="sparc" 458ae228531Sbellard ;; 4597d13299dSbellard *) 460359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 461359bc95dSPeter Maydell ARCH=unknown 4627d13299dSbellard ;; 4637d13299dSbellardesac 464359bc95dSPeter Maydellif test -z "$ARCH"; then 465359bc95dSPeter Maydell ARCH="$cpu" 466359bc95dSPeter Maydellfi 467e2d52ad3SJuan Quintela 4687d13299dSbellard# OS specific 4690dbfc675SJuan Quintela 4707d13299dSbellardcase $targetos in 471c326e0afSbellardCYGWIN*) 472c326e0afSbellard mingw32="yes" 473a558ee17SJuan Quintela QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" 474d5631638Smalc audio_possible_drivers="winwave sdl" 475d5631638Smalc audio_drv_list="winwave" 476c326e0afSbellard;; 47767b915a5SbellardMINGW32*) 47867b915a5Sbellard mingw32="yes" 479d5631638Smalc audio_possible_drivers="winwave dsound sdl fmod" 480d5631638Smalc audio_drv_list="winwave" 48167b915a5Sbellard;; 4825c40d2bdSthsGNU/kFreeBSD) 483a167ba50SAurelien Jarno bsd="yes" 4840c58ac1cSmalc audio_drv_list="oss" 485f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 4865c40d2bdSths;; 4877d3505c5SbellardFreeBSD) 4887d3505c5Sbellard bsd="yes" 4890db4a067SPaolo Bonzini make="${MAKE-gmake}" 4900c58ac1cSmalc audio_drv_list="oss" 491f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 492f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 493f01576f1SJuergen Lock LIBS="-lutil $LIBS" 49458952137SVincenzo Maffione netmap="" # enable netmap autodetect 4957d3505c5Sbellard;; 496c5e97233Sblueswir1DragonFly) 497c5e97233Sblueswir1 bsd="yes" 4980db4a067SPaolo Bonzini make="${MAKE-gmake}" 499c5e97233Sblueswir1 audio_drv_list="oss" 500c5e97233Sblueswir1 audio_possible_drivers="oss sdl esd pa" 501c5e97233Sblueswir1;; 5027d3505c5SbellardNetBSD) 5037d3505c5Sbellard bsd="yes" 5040db4a067SPaolo Bonzini make="${MAKE-gmake}" 5050c58ac1cSmalc audio_drv_list="oss" 506c2de5c91Smalc audio_possible_drivers="oss sdl esd" 5078ef92a88Sblueswir1 oss_lib="-lossaudio" 5087d3505c5Sbellard;; 5097d3505c5SbellardOpenBSD) 5107d3505c5Sbellard bsd="yes" 5110db4a067SPaolo Bonzini make="${MAKE-gmake}" 5124f6ab397SBrad Smith audio_drv_list="sdl" 5134f6ab397SBrad Smith audio_possible_drivers="sdl esd" 5147d3505c5Sbellard;; 51583fb7adfSbellardDarwin) 51683fb7adfSbellard bsd="yes" 51783fb7adfSbellard darwin="yes" 5181b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 519a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 5200c439cbfSJuan Quintela LDFLAGS="-arch x86_64 $LDFLAGS" 5211b0f9cc2Saliguori else 522a558ee17SJuan Quintela QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" 5231b0f9cc2Saliguori fi 524fd677642Sths cocoa="yes" 5250c58ac1cSmalc audio_drv_list="coreaudio" 526c2de5c91Smalc audio_possible_drivers="coreaudio sdl fmod" 5270c439cbfSJuan Quintela LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" 5287973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 529a0b7cf6bSPeter Maydell # Disable attempts to use ObjectiveC features in os/object.h since they 530a0b7cf6bSPeter Maydell # won't work when we're compiling with gcc as a C compiler. 531a0b7cf6bSPeter Maydell QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" 53283fb7adfSbellard;; 533ec530c81SbellardSunOS) 534ec530c81Sbellard solaris="yes" 5350db4a067SPaolo Bonzini make="${MAKE-gmake}" 5360db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 537fa58948dSBlue Swirl ld="gld" 538e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 5390475a5caSths needs_libsunmath="no" 540c2b84fabSths solarisrev=`uname -r | cut -f2 -d.` 541c2b84fabSths if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 5420475a5caSths if test "$solarisrev" -le 9 ; then 5430475a5caSths if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then 5440475a5caSths needs_libsunmath="yes" 545f14bfdf9SJuan Quintela QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" 546f14bfdf9SJuan Quintela LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" 547f14bfdf9SJuan Quintela LIBS="-lsunmath $LIBS" 5480475a5caSths else 54976ad07a4SPeter Maydell error_exit "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" \ 55076ad07a4SPeter Maydell "libsunmath from the Sun Studio compilers tools, due to a lack of" \ 55176ad07a4SPeter Maydell "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" \ 55276ad07a4SPeter Maydell "Studio 11 can be downloaded from www.sun.com." 5530475a5caSths fi 5540475a5caSths fi 55586b2bd93Sths fi 5566b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 5570c58ac1cSmalc audio_drv_list="oss" 5586b4d2ba1Sths fi 559c2de5c91Smalc audio_possible_drivers="oss sdl" 560d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 561d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 562d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 563d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 564a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 565560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 566560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 567560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 568ec530c81Sbellard;; 569b29fe3edSmalcAIX) 570b29fe3edSmalc aix="yes" 5710db4a067SPaolo Bonzini make="${MAKE-gmake}" 572b29fe3edSmalc;; 573179cf400SAndreas FärberHaiku) 574179cf400SAndreas Färber haiku="yes" 575179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 576179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 577179cf400SAndreas Färber;; 578fb065187Sbellard*) 5790c58ac1cSmalc audio_drv_list="oss" 580b8e59f18Smalc audio_possible_drivers="oss alsa sdl esd pa" 5815327cf48Sbellard linux="yes" 582831b7825Sths linux_user="yes" 583af2be207SJan Kiszka kvm="yes" 584af2be207SJan Kiszka vhost_net="yes" 5855e9be92dSNicholas Bellinger vhost_scsi="yes" 586c72b26ecSRichard Henderson if [ "$cpu" = "i386" -o "$cpu" = "x86_64" -o "$cpu" = "x32" ] ; then 587c2de5c91Smalc audio_possible_drivers="$audio_possible_drivers fmod" 588c9ec1fe4Sbellard fi 589a585140dSAlexey Kardashevskiy QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$(pwd)/linux-headers $QEMU_INCLUDES" 590fb065187Sbellard;; 5917d13299dSbellardesac 5927d13299dSbellard 5937d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 594b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 59584778508Sblueswir1 bsd_user="yes" 5967d3505c5Sbellard fi 59708de3949SAndreas Färberfi 5987d3505c5Sbellard 5990db4a067SPaolo Bonzini: ${make=${MAKE-make}} 6000db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 60152510f8bSStefan Weil: ${python=${PYTHON-python}} 602e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 6030db4a067SPaolo Bonzini 6043c4a4d0dSPeter Maydell# Default objcc to clang if available, otherwise use CC 6053c4a4d0dSPeter Maydellif has clang; then 6063c4a4d0dSPeter Maydell objcc=clang 6073c4a4d0dSPeter Maydellelse 6083c4a4d0dSPeter Maydell objcc="$cc" 6093c4a4d0dSPeter Maydellfi 6103c4a4d0dSPeter Maydell 6113457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 6123457a3f8SJuan Quintela EXESUF=".exe" 613a558ee17SJuan Quintela QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" 614e94a7936SStefan Weil # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) 615e94a7936SStefan Weil QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" 616f7cf5d5bSStefan Weil LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" 617f7cf5d5bSStefan Weilcat > $TMPC << EOF 618f7cf5d5bSStefan Weilint main(void) { return 0; } 619f7cf5d5bSStefan WeilEOF 620f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 621f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 622f7cf5d5bSStefan Weil fi 623c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 624683035deSPaolo Bonzini mandir="\${prefix}" 625528ae5b8SEduardo Habkost datadir="\${prefix}" 626850da188SEduardo Habkost qemu_docdir="\${prefix}" 627683035deSPaolo Bonzini bindir="\${prefix}" 628683035deSPaolo Bonzini sysconfdir="\${prefix}" 6295a699bbbSLaszlo Ersek local_statedir= 630683035deSPaolo Bonzini confsuffix="" 631368542b8SStefan Hajnoczi libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" 6323457a3f8SJuan Quintelafi 6333457a3f8SJuan Quintela 634487fefdbSAnthony Liguoriwerror="" 63585aa5189Sbellard 6367d13299dSbellardfor opt do 637a46e4035Spbrook optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 6387d13299dSbellard case "$opt" in 6392efc3265Sbellard --help|-h) show_help=yes 6402efc3265Sbellard ;; 64199123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 64299123e13SMike Frysinger ;; 643b1a550a0Spbrook --prefix=*) prefix="$optarg" 6447d13299dSbellard ;; 645b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 64632ce6337Sbellard ;; 647ca4deeb1SPaolo Bonzini --source-path=*) 6487d13299dSbellard ;; 649ac0df51dSaliguori --cross-prefix=*) 6507d13299dSbellard ;; 651ac0df51dSaliguori --cc=*) 6527d13299dSbellard ;; 653b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 65483469015Sbellard ;; 65583f73fceSTomoki Sekiyama --cxx=*) 65683f73fceSTomoki Sekiyama ;; 657e007dbecSMichael S. Tsirkin --iasl=*) iasl="$optarg" 658e007dbecSMichael S. Tsirkin ;; 6593c4a4d0dSPeter Maydell --objcc=*) objcc="$optarg" 6603c4a4d0dSPeter Maydell ;; 661b1a550a0Spbrook --make=*) make="$optarg" 6627d13299dSbellard ;; 6636a882643Spbrook --install=*) install="$optarg" 6646a882643Spbrook ;; 665c886edfbSBlue Swirl --python=*) python="$optarg" 666c886edfbSBlue Swirl ;; 6671d728c39SBlue Swirl --gcov=*) gcov_tool="$optarg" 6681d728c39SBlue Swirl ;; 669e2d8830eSBrad --smbd=*) smbd="$optarg" 670e2d8830eSBrad ;; 671e2a2ed06SJuan Quintela --extra-cflags=*) 6727d13299dSbellard ;; 673e2a2ed06SJuan Quintela --extra-ldflags=*) 6747d13299dSbellard ;; 6755bc62e01SGerd Hoffmann --enable-debug-info) 6765bc62e01SGerd Hoffmann ;; 6775bc62e01SGerd Hoffmann --disable-debug-info) 6785bc62e01SGerd Hoffmann ;; 6792ff6b91eSJuan Quintela --cpu=*) 6807d13299dSbellard ;; 681b1a550a0Spbrook --target-list=*) target_list="$optarg" 682de83cd02Sbellard ;; 68374242e0fSPaolo Bonzini --enable-trace-backend=*) trace_backend="$optarg" 68494a420b1SStefan Hajnoczi ;; 68574242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 6869410b56cSPrerna Saxena ;; 6877d13299dSbellard --enable-gprof) gprof="yes" 6887d13299dSbellard ;; 6891d728c39SBlue Swirl --enable-gcov) gcov="yes" 6901d728c39SBlue Swirl ;; 69179427693SLoïc Minier --static) 69279427693SLoïc Minier static="yes" 69379427693SLoïc Minier LDFLAGS="-static $LDFLAGS" 69417884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 69543ce4dfeSbellard ;; 6960b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 6970b24e75fSPaolo Bonzini ;; 6980b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 6990b24e75fSPaolo Bonzini ;; 7003aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 7013aa5d2beSAlon Levy ;; 7028bf188aaSMichael Tokarev --libexecdir=*) libexecdir="$optarg" 7038bf188aaSMichael Tokarev ;; 7040f94d6daSAlon Levy --includedir=*) includedir="$optarg" 7050f94d6daSAlon Levy ;; 706528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 7070b24e75fSPaolo Bonzini ;; 708023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 709023d3d67SEduardo Habkost ;; 710850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 7110b24e75fSPaolo Bonzini ;; 712ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 71307381cc1SAnthony Liguori ;; 714785c23aeSLuiz Capitulino --localstatedir=*) local_statedir="$optarg" 715785c23aeSLuiz Capitulino ;; 716785c23aeSLuiz Capitulino --sbindir=*|--sharedstatedir=*|\ 717023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 718023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 719023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 720023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 721023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 722023ddd74SMax Filippov # lots of directory switches by default. 723023ddd74SMax Filippov ;; 724e2134eb9SGerd Hoffmann --with-system-pixman) pixman="system" 725e2134eb9SGerd Hoffmann ;; 726e2134eb9SGerd Hoffmann --without-system-pixman) pixman="internal" 727e2134eb9SGerd Hoffmann ;; 72874880fe2SRobert Schiele --without-pixman) pixman="none" 72974880fe2SRobert Schiele ;; 73097a847bcSbellard --disable-sdl) sdl="no" 73197a847bcSbellard ;; 732c4198157SJuan Quintela --enable-sdl) sdl="yes" 733c4198157SJuan Quintela ;; 7343556c233SPaolo Bonzini --disable-qom-cast-debug) qom_cast_debug="no" 7353556c233SPaolo Bonzini ;; 7363556c233SPaolo Bonzini --enable-qom-cast-debug) qom_cast_debug="yes" 7373556c233SPaolo Bonzini ;; 738983eef5aSMeador Inge --disable-virtfs) virtfs="no" 739983eef5aSMeador Inge ;; 740983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 741983eef5aSMeador Inge ;; 742821601eaSJes Sorensen --disable-vnc) vnc="no" 743821601eaSJes Sorensen ;; 744821601eaSJes Sorensen --enable-vnc) vnc="yes" 745821601eaSJes Sorensen ;; 746b1a550a0Spbrook --fmod-lib=*) fmod_lib="$optarg" 747102a52e4Sbellard ;; 748c2de5c91Smalc --fmod-inc=*) fmod_inc="$optarg" 749c2de5c91Smalc ;; 7502f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 7512f6a1ab0Sblueswir1 ;; 7520c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 7530c58ac1cSmalc ;; 754b64ec4e4SFam Zheng --block-drv-rw-whitelist=*|--block-drv-whitelist=*) block_drv_rw_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 755b64ec4e4SFam Zheng ;; 756b64ec4e4SFam Zheng --block-drv-ro-whitelist=*) block_drv_ro_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 757eb852011SMarkus Armbruster ;; 758f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 759f8393946Saurel32 ;; 760f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 761f8393946Saurel32 ;; 762f3d08ee6SPaul Brook --enable-debug) 763f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 764f3d08ee6SPaul Brook debug_tcg="yes" 765f3d08ee6SPaul Brook debug="yes" 766f3d08ee6SPaul Brook strip_opt="no" 767f3d08ee6SPaul Brook ;; 76803b4fe7dSaliguori --enable-sparse) sparse="yes" 76903b4fe7dSaliguori ;; 77003b4fe7dSaliguori --disable-sparse) sparse="no" 77103b4fe7dSaliguori ;; 7721625af87Saliguori --disable-strip) strip_opt="no" 7731625af87Saliguori ;; 7748d5d2d4cSths --disable-vnc-tls) vnc_tls="no" 7758d5d2d4cSths ;; 7761be10ad2SJuan Quintela --enable-vnc-tls) vnc_tls="yes" 7771be10ad2SJuan Quintela ;; 7782f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 7792f9606b3Saliguori ;; 780ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 781ea784e3bSJuan Quintela ;; 7822f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 7832f6f5c7aSCorentin Chary ;; 7842f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 7852f6f5c7aSCorentin Chary ;; 786efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 787efe556adSCorentin Chary ;; 788efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 789efe556adSCorentin Chary ;; 7907536ee4bSTim Hardeck --disable-vnc-ws) vnc_ws="no" 7917536ee4bSTim Hardeck ;; 7927536ee4bSTim Hardeck --enable-vnc-ws) vnc_ws="yes" 7937536ee4bSTim Hardeck ;; 794443f1376Sbellard --disable-slirp) slirp="no" 795c20709aaSbellard ;; 796ee682d27SStefan Weil --disable-uuid) uuid="no" 797ee682d27SStefan Weil ;; 798ee682d27SStefan Weil --enable-uuid) uuid="yes" 799ee682d27SStefan Weil ;; 800e0e6c8c0Saliguori --disable-vde) vde="no" 8018a16d273Sths ;; 802dfb278bdSJuan Quintela --enable-vde) vde="yes" 803dfb278bdSJuan Quintela ;; 80458952137SVincenzo Maffione --disable-netmap) netmap="no" 80558952137SVincenzo Maffione ;; 80658952137SVincenzo Maffione --enable-netmap) netmap="yes" 80758952137SVincenzo Maffione ;; 808e37630caSaliguori --disable-xen) xen="no" 809e37630caSaliguori ;; 810fc321b4bSJuan Quintela --enable-xen) xen="yes" 811fc321b4bSJuan Quintela ;; 812eb6fda0fSAnthony PERARD --disable-xen-pci-passthrough) xen_pci_passthrough="no" 813eb6fda0fSAnthony PERARD ;; 814eb6fda0fSAnthony PERARD --enable-xen-pci-passthrough) xen_pci_passthrough="yes" 815eb6fda0fSAnthony PERARD ;; 8162e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 8172e4d9fb1Saurel32 ;; 8184ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 8194ffcedb6SJuan Quintela ;; 820fb599c9aSbalrog --disable-bluez) bluez="no" 821fb599c9aSbalrog ;; 822a20a6f46SJuan Quintela --enable-bluez) bluez="yes" 823a20a6f46SJuan Quintela ;; 8247ba1e619Saliguori --disable-kvm) kvm="no" 8257ba1e619Saliguori ;; 826b31a0277SJuan Quintela --enable-kvm) kvm="yes" 827b31a0277SJuan Quintela ;; 8289195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 8299195b2c2SStefan Weil ;; 8309195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 8319195b2c2SStefan Weil ;; 83247e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 83347e98658SCorey Bryant ;; 83447e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 83547e98658SCorey Bryant ;; 836cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 837cd4ec0b4SGerd Hoffmann ;; 838cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 839cd4ec0b4SGerd Hoffmann ;; 840c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 841c589b249SRonnie Sahlberg ;; 842c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 843c589b249SRonnie Sahlberg ;; 844*6542aa9cSPeter Lieven --disable-libnfs) libnfs="no" 845*6542aa9cSPeter Lieven ;; 846*6542aa9cSPeter Lieven --enable-libnfs) libnfs="yes" 847*6542aa9cSPeter Lieven ;; 84805c2a3e7Sbellard --enable-profiler) profiler="yes" 84905c2a3e7Sbellard ;; 85014821030SPavel Borzenkov --disable-cocoa) cocoa="no" 85114821030SPavel Borzenkov ;; 852c2de5c91Smalc --enable-cocoa) 853c2de5c91Smalc cocoa="yes" ; 854c2de5c91Smalc sdl="no" ; 855c2de5c91Smalc audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" 8565b0753e0Sbellard ;; 857cad25d69Spbrook --disable-system) softmmu="no" 8580a8e90f4Spbrook ;; 859cad25d69Spbrook --enable-system) softmmu="yes" 8600a8e90f4Spbrook ;; 8610953a80fSZachary Amsden --disable-user) 8620953a80fSZachary Amsden linux_user="no" ; 8630953a80fSZachary Amsden bsd_user="no" ; 8640953a80fSZachary Amsden ;; 8650953a80fSZachary Amsden --enable-user) ;; 866831b7825Sths --disable-linux-user) linux_user="no" 8670a8e90f4Spbrook ;; 868831b7825Sths --enable-linux-user) linux_user="yes" 869831b7825Sths ;; 87084778508Sblueswir1 --disable-bsd-user) bsd_user="no" 87184778508Sblueswir1 ;; 87284778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 87384778508Sblueswir1 ;; 874379f6698SPaul Brook --enable-guest-base) guest_base="yes" 875379f6698SPaul Brook ;; 876379f6698SPaul Brook --disable-guest-base) guest_base="no" 877379f6698SPaul Brook ;; 87840d6444eSAvi Kivity --enable-pie) pie="yes" 87934005a00SKirill A. Shutemov ;; 88040d6444eSAvi Kivity --disable-pie) pie="no" 88134005a00SKirill A. Shutemov ;; 882c5937220Spbrook --enable-uname-release=*) uname_release="$optarg" 883c5937220Spbrook ;; 88485aa5189Sbellard --enable-werror) werror="yes" 88585aa5189Sbellard ;; 88685aa5189Sbellard --disable-werror) werror="no" 88785aa5189Sbellard ;; 8884d3b6f6eSbalrog --disable-curses) curses="no" 8894d3b6f6eSbalrog ;; 890c584a6d0SJuan Quintela --enable-curses) curses="yes" 891c584a6d0SJuan Quintela ;; 892769ce76dSAlexander Graf --disable-curl) curl="no" 893769ce76dSAlexander Graf ;; 894788c8196SJuan Quintela --enable-curl) curl="yes" 895788c8196SJuan Quintela ;; 8962df87df7SJuan Quintela --disable-fdt) fdt="no" 8972df87df7SJuan Quintela ;; 8982df87df7SJuan Quintela --enable-fdt) fdt="yes" 8992df87df7SJuan Quintela ;; 9005c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 9015c6c3a6cSChristoph Hellwig ;; 9025c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 9035c6c3a6cSChristoph Hellwig ;; 904758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 905758e8e38SVenkateswararao Jujjuri (JV) ;; 906758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 907758e8e38SVenkateswararao Jujjuri (JV) ;; 90877755340Sths --disable-blobs) blobs="no" 90977755340Sths ;; 9104a19f1ecSpbrook --with-pkgversion=*) pkgversion=" ($optarg)" 9114a19f1ecSpbrook ;; 912519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 913519175a2SAlex Barcelo ;; 91470c60c08SStefan Hajnoczi --disable-coroutine-pool) coroutine_pool="no" 91570c60c08SStefan Hajnoczi ;; 91670c60c08SStefan Hajnoczi --enable-coroutine-pool) coroutine_pool="yes" 91770c60c08SStefan Hajnoczi ;; 918a25dba17SJuan Quintela --disable-docs) docs="no" 91970ec5dc0SAnthony Liguori ;; 920a25dba17SJuan Quintela --enable-docs) docs="yes" 92183a3ab8bSJuan Quintela ;; 922d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 923d5970055SMichael S. Tsirkin ;; 924d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 925d5970055SMichael S. Tsirkin ;; 9265e9be92dSNicholas Bellinger --disable-vhost-scsi) vhost_scsi="no" 9275e9be92dSNicholas Bellinger ;; 9285e9be92dSNicholas Bellinger --enable-vhost-scsi) vhost_scsi="yes" 9295e9be92dSNicholas Bellinger ;; 930b1e5fff4SMichael Walle --disable-glx) glx="no" 93120ff075bSMichael Walle ;; 932b1e5fff4SMichael Walle --enable-glx) glx="yes" 93320ff075bSMichael Walle ;; 934f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 935f27aaf4bSChristian Brunner ;; 936f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 937f27aaf4bSChristian Brunner ;; 9388c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 9398c84cf11SSergei Trofimovich ;; 9408c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 9418c84cf11SSergei Trofimovich ;; 942111a38b0SRobert Relyea --disable-smartcard-nss) smartcard_nss="no" 943111a38b0SRobert Relyea ;; 944111a38b0SRobert Relyea --enable-smartcard-nss) smartcard_nss="yes" 945111a38b0SRobert Relyea ;; 9462b2325ffSGerd Hoffmann --disable-libusb) libusb="no" 9472b2325ffSGerd Hoffmann ;; 9482b2325ffSGerd Hoffmann --enable-libusb) libusb="yes" 9492b2325ffSGerd Hoffmann ;; 95069354a83SHans de Goede --disable-usb-redir) usb_redir="no" 95169354a83SHans de Goede ;; 95269354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 95369354a83SHans de Goede ;; 9541ece9905SAlon Levy --disable-zlib-test) zlib="no" 9551ece9905SAlon Levy ;; 956d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 957d138cee9SMichael Roth ;; 958d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 959d138cee9SMichael Roth ;; 960d9840e25STomoki Sekiyama --with-vss-sdk) vss_win32_sdk="" 961d9840e25STomoki Sekiyama ;; 962d9840e25STomoki Sekiyama --with-vss-sdk=*) vss_win32_sdk="$optarg" 963d9840e25STomoki Sekiyama ;; 964d9840e25STomoki Sekiyama --without-vss-sdk) vss_win32_sdk="no" 965d9840e25STomoki Sekiyama ;; 966d9840e25STomoki Sekiyama --with-win-sdk) win_sdk="" 967d9840e25STomoki Sekiyama ;; 968d9840e25STomoki Sekiyama --with-win-sdk=*) win_sdk="$optarg" 969d9840e25STomoki Sekiyama ;; 970d9840e25STomoki Sekiyama --without-win-sdk) win_sdk="no" 971d9840e25STomoki Sekiyama ;; 9724b1c11fdSDaniel P. Berrange --enable-tools) want_tools="yes" 9734b1c11fdSDaniel P. Berrange ;; 9744b1c11fdSDaniel P. Berrange --disable-tools) want_tools="no" 9754b1c11fdSDaniel P. Berrange ;; 976f794573eSEduardo Otubo --enable-seccomp) seccomp="yes" 977f794573eSEduardo Otubo ;; 978f794573eSEduardo Otubo --disable-seccomp) seccomp="no" 979f794573eSEduardo Otubo ;; 980eb100396SBharata B Rao --disable-glusterfs) glusterfs="no" 981eb100396SBharata B Rao ;; 982eb100396SBharata B Rao --enable-glusterfs) glusterfs="yes" 983eb100396SBharata B Rao ;; 984583f6e7bSStefan Hajnoczi --disable-virtio-blk-data-plane) virtio_blk_data_plane="no" 985583f6e7bSStefan Hajnoczi ;; 986583f6e7bSStefan Hajnoczi --enable-virtio-blk-data-plane) virtio_blk_data_plane="yes" 987583f6e7bSStefan Hajnoczi ;; 988a4ccabcfSAnthony Liguori --disable-gtk) gtk="no" 989a4ccabcfSAnthony Liguori ;; 990a4ccabcfSAnthony Liguori --enable-gtk) gtk="yes" 991a4ccabcfSAnthony Liguori ;; 9922da776dbSMichael R. Hines --enable-rdma) rdma="yes" 9932da776dbSMichael R. Hines ;; 9942da776dbSMichael R. Hines --disable-rdma) rdma="no" 9952da776dbSMichael R. Hines ;; 996528de90aSDaniel P. Berrange --with-gtkabi=*) gtkabi="$optarg" 997528de90aSDaniel P. Berrange ;; 998ab214c29SStefan Berger --enable-tpm) tpm="yes" 999ab214c29SStefan Berger ;; 10000a12ec87SRichard W.M. Jones --disable-libssh2) libssh2="no" 10010a12ec87SRichard W.M. Jones ;; 10020a12ec87SRichard W.M. Jones --enable-libssh2) libssh2="yes" 10030a12ec87SRichard W.M. Jones ;; 10044f18b782SJeff Cody --enable-vhdx) vhdx="yes" 10054f18b782SJeff Cody ;; 10064f18b782SJeff Cody --disable-vhdx) vhdx="no" 10074f18b782SJeff Cody ;; 10087f1559c6Sbalrog *) echo "ERROR: unknown option $opt"; show_help="yes" 10097f1559c6Sbalrog ;; 10107d13299dSbellard esac 10117d13299dSbellarddone 10127d13299dSbellard 1013f6f0b7d9SStefan Weilif ! has $python; then 1014f6f0b7d9SStefan Weil error_exit "Python not found. Use --python=/path/to/python" 1015f6f0b7d9SStefan Weilfi 1016f6f0b7d9SStefan Weil 1017f6f0b7d9SStefan Weil# Note that if the Python conditional here evaluates True we will exit 1018f6f0b7d9SStefan Weil# with status 1 which is a shell 'false' value. 1019f6f0b7d9SStefan Weilif ! $python -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then 1020f6f0b7d9SStefan Weil error_exit "Cannot use '$python', Python 2.4 or later is required." \ 1021f6f0b7d9SStefan Weil "Note that Python 3 or later is not yet supported." \ 1022f6f0b7d9SStefan Weil "Use --python=/path/to/python to specify a supported Python." 1023f6f0b7d9SStefan Weilfi 1024f6f0b7d9SStefan Weil 1025f6f0b7d9SStefan Weil# The -B switch was added in Python 2.6. 1026f6f0b7d9SStefan Weil# If it is supplied, compiled files are not written. 1027f6f0b7d9SStefan Weil# Use it for Python versions which support it. 1028f6f0b7d9SStefan Weilif $python -B -c 'import sys; sys.exit(0)' 2>/dev/null; then 1029f6f0b7d9SStefan Weil python="$python -B" 1030f6f0b7d9SStefan Weilfi 1031f6f0b7d9SStefan Weil 103240293e58Sbellardcase "$cpu" in 1033e3608d66SRichard Henderson ppc) 1034e3608d66SRichard Henderson CPU_CFLAGS="-m32" 1035e3608d66SRichard Henderson LDFLAGS="-m32 $LDFLAGS" 1036e3608d66SRichard Henderson ;; 1037e3608d66SRichard Henderson ppc64) 1038e3608d66SRichard Henderson CPU_CFLAGS="-m64" 1039e3608d66SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 1040e3608d66SRichard Henderson ;; 10419b9c37c3SRichard Henderson sparc) 10420c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 104379f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32 -mcpu=ultrasparc" 10443142255cSblueswir1 ;; 1045ed968ff1SJuan Quintela sparc64) 10460c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 104779f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -mcpu=ultrasparc" 10483142255cSblueswir1 ;; 104976d83bdeSths s390) 105079f3b12fSPeter Crosthwaite CPU_CFLAGS="-m31 -march=z990" 105128d7cc49SRichard Henderson LDFLAGS="-m31 $LDFLAGS" 105228d7cc49SRichard Henderson ;; 105328d7cc49SRichard Henderson s390x) 105479f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64 -march=z990" 105528d7cc49SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 105676d83bdeSths ;; 105740293e58Sbellard i386) 105879f3b12fSPeter Crosthwaite CPU_CFLAGS="-m32" 10590c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 10602b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 106140293e58Sbellard ;; 106240293e58Sbellard x86_64) 106379f3b12fSPeter Crosthwaite CPU_CFLAGS="-m64" 10640c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 10652b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 1066379f6698SPaul Brook ;; 1067c72b26ecSRichard Henderson x32) 1068c72b26ecSRichard Henderson CPU_CFLAGS="-mx32" 1069c72b26ecSRichard Henderson LDFLAGS="-mx32 $LDFLAGS" 1070c72b26ecSRichard Henderson cc_i386='$(CC) -m32' 1071c72b26ecSRichard Henderson ;; 107230163d89SPeter Maydell # No special flags required for other host CPUs 10733142255cSblueswir1esac 10743142255cSblueswir1 107579f3b12fSPeter CrosthwaiteQEMU_CFLAGS="$CPU_CFLAGS $QEMU_CFLAGS" 107679f3b12fSPeter CrosthwaiteEXTRA_CFLAGS="$CPU_CFLAGS $EXTRA_CFLAGS" 107779f3b12fSPeter Crosthwaite 107860e0df25SPeter Maydelldefault_target_list="" 107960e0df25SPeter Maydell 10806e92f823SPeter Maydellmak_wilds="" 10816e92f823SPeter Maydell 108260e0df25SPeter Maydellif [ "$softmmu" = "yes" ]; then 10836e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-softmmu.mak" 108460e0df25SPeter Maydellfi 108560e0df25SPeter Maydellif [ "$linux_user" = "yes" ]; then 10866e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-linux-user.mak" 108760e0df25SPeter Maydellfi 108860e0df25SPeter Maydellif [ "$bsd_user" = "yes" ]; then 10896e92f823SPeter Maydell mak_wilds="${mak_wilds} $source_path/default-configs/*-bsd-user.mak" 109060e0df25SPeter Maydellfi 109160e0df25SPeter Maydell 10926e92f823SPeter Maydellfor config in $mak_wilds; do 10936e92f823SPeter Maydell default_target_list="${default_target_list} $(basename "$config" .mak)" 10946e92f823SPeter Maydelldone 10956e92f823SPeter Maydell 1096af5db58eSpbrookif test x"$show_help" = x"yes" ; then 1097af5db58eSpbrookcat << EOF 1098af5db58eSpbrook 1099af5db58eSpbrookUsage: configure [options] 1100af5db58eSpbrookOptions: [defaults in brackets after descriptions] 1101af5db58eSpbrook 110208fb77edSStefan WeilStandard options: 110308fb77edSStefan Weil --help print this message 110408fb77edSStefan Weil --prefix=PREFIX install in PREFIX [$prefix] 110508fb77edSStefan Weil --interp-prefix=PREFIX where to find shared libraries, etc. 110608fb77edSStefan Weil use %M for cpu name [$interp_prefix] 110708fb77edSStefan Weil --target-list=LIST set target list (default: build everything) 110808fb77edSStefan Weil$(echo Available targets: $default_target_list | \ 110908fb77edSStefan Weil fold -s -w 53 | sed -e 's/^/ /') 111008fb77edSStefan Weil 111108fb77edSStefan WeilAdvanced options (experts only): 111208fb77edSStefan Weil --source-path=PATH path of source code [$source_path] 111308fb77edSStefan Weil --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] 111408fb77edSStefan Weil --cc=CC use C compiler CC [$cc] 111508fb77edSStefan Weil --iasl=IASL use ACPI compiler IASL [$iasl] 111608fb77edSStefan Weil --host-cc=CC use C compiler CC [$host_cc] for code run at 111708fb77edSStefan Weil build time 111808fb77edSStefan Weil --cxx=CXX use C++ compiler CXX [$cxx] 111908fb77edSStefan Weil --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] 112008fb77edSStefan Weil --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS 112108fb77edSStefan Weil --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS 112208fb77edSStefan Weil --make=MAKE use specified make [$make] 112308fb77edSStefan Weil --install=INSTALL use specified install [$install] 112408fb77edSStefan Weil --python=PYTHON use specified python [$python] 112508fb77edSStefan Weil --smbd=SMBD use specified smbd [$smbd] 112608fb77edSStefan Weil --static enable static build [$static] 112708fb77edSStefan Weil --mandir=PATH install man pages in PATH 112808fb77edSStefan Weil --datadir=PATH install firmware in PATH$confsuffix 112908fb77edSStefan Weil --docdir=PATH install documentation in PATH$confsuffix 113008fb77edSStefan Weil --bindir=PATH install binaries in PATH 113108fb77edSStefan Weil --libdir=PATH install libraries in PATH 113208fb77edSStefan Weil --sysconfdir=PATH install config in PATH$confsuffix 113308fb77edSStefan Weil --localstatedir=PATH install local state in PATH (set at runtime on win32) 113408fb77edSStefan Weil --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix] 113508fb77edSStefan Weil --enable-debug-tcg enable TCG debugging 113608fb77edSStefan Weil --disable-debug-tcg disable TCG debugging (default) 113708fb77edSStefan Weil --enable-debug-info enable debugging information (default) 113808fb77edSStefan Weil --disable-debug-info disable debugging information 113908fb77edSStefan Weil --enable-debug enable common debug build options 114008fb77edSStefan Weil --enable-sparse enable sparse checker 114108fb77edSStefan Weil --disable-sparse disable sparse checker (default) 114208fb77edSStefan Weil --disable-strip disable stripping binaries 114308fb77edSStefan Weil --disable-werror disable compilation abort on warning 114408fb77edSStefan Weil --disable-sdl disable SDL 114508fb77edSStefan Weil --enable-sdl enable SDL 114608fb77edSStefan Weil --disable-gtk disable gtk UI 114708fb77edSStefan Weil --enable-gtk enable gtk UI 114808fb77edSStefan Weil --disable-virtfs disable VirtFS 114908fb77edSStefan Weil --enable-virtfs enable VirtFS 115008fb77edSStefan Weil --disable-vnc disable VNC 115108fb77edSStefan Weil --enable-vnc enable VNC 115208fb77edSStefan Weil --disable-cocoa disable Cocoa (Mac OS X only) 115308fb77edSStefan Weil --enable-cocoa enable Cocoa (default on Mac OS X) 115408fb77edSStefan Weil --audio-drv-list=LIST set audio drivers list: 115508fb77edSStefan Weil Available drivers: $audio_possible_drivers 115608fb77edSStefan Weil --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L 115708fb77edSStefan Weil --block-drv-rw-whitelist=L 115808fb77edSStefan Weil set block driver read-write whitelist 115908fb77edSStefan Weil (affects only QEMU, not qemu-img) 116008fb77edSStefan Weil --block-drv-ro-whitelist=L 116108fb77edSStefan Weil set block driver read-only whitelist 116208fb77edSStefan Weil (affects only QEMU, not qemu-img) 116308fb77edSStefan Weil --disable-xen disable xen backend driver support 116408fb77edSStefan Weil --enable-xen enable xen backend driver support 116508fb77edSStefan Weil --disable-xen-pci-passthrough 116608fb77edSStefan Weil --enable-xen-pci-passthrough 116708fb77edSStefan Weil --disable-brlapi disable BrlAPI 116808fb77edSStefan Weil --enable-brlapi enable BrlAPI 116908fb77edSStefan Weil --disable-vnc-tls disable TLS encryption for VNC server 117008fb77edSStefan Weil --enable-vnc-tls enable TLS encryption for VNC server 117108fb77edSStefan Weil --disable-vnc-sasl disable SASL encryption for VNC server 117208fb77edSStefan Weil --enable-vnc-sasl enable SASL encryption for VNC server 117308fb77edSStefan Weil --disable-vnc-jpeg disable JPEG lossy compression for VNC server 117408fb77edSStefan Weil --enable-vnc-jpeg enable JPEG lossy compression for VNC server 117508fb77edSStefan Weil --disable-vnc-png disable PNG compression for VNC server (default) 117608fb77edSStefan Weil --enable-vnc-png enable PNG compression for VNC server 117708fb77edSStefan Weil --disable-vnc-ws disable Websockets support for VNC server 117808fb77edSStefan Weil --enable-vnc-ws enable Websockets support for VNC server 117908fb77edSStefan Weil --disable-curses disable curses output 118008fb77edSStefan Weil --enable-curses enable curses output 118108fb77edSStefan Weil --disable-curl disable curl connectivity 118208fb77edSStefan Weil --enable-curl enable curl connectivity 118308fb77edSStefan Weil --disable-fdt disable fdt device tree 118408fb77edSStefan Weil --enable-fdt enable fdt device tree 118508fb77edSStefan Weil --disable-bluez disable bluez stack connectivity 118608fb77edSStefan Weil --enable-bluez enable bluez stack connectivity 118708fb77edSStefan Weil --disable-slirp disable SLIRP userspace network connectivity 118808fb77edSStefan Weil --disable-kvm disable KVM acceleration support 118908fb77edSStefan Weil --enable-kvm enable KVM acceleration support 119008fb77edSStefan Weil --disable-rdma disable RDMA-based migration support 119108fb77edSStefan Weil --enable-rdma enable RDMA-based migration support 119208fb77edSStefan Weil --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) 119308fb77edSStefan Weil --enable-system enable all system emulation targets 119408fb77edSStefan Weil --disable-system disable all system emulation targets 119508fb77edSStefan Weil --enable-user enable supported user emulation targets 119608fb77edSStefan Weil --disable-user disable all user emulation targets 119708fb77edSStefan Weil --enable-linux-user enable all linux usermode emulation targets 119808fb77edSStefan Weil --disable-linux-user disable all linux usermode emulation targets 119908fb77edSStefan Weil --enable-bsd-user enable all BSD usermode emulation targets 120008fb77edSStefan Weil --disable-bsd-user disable all BSD usermode emulation targets 120108fb77edSStefan Weil --enable-guest-base enable GUEST_BASE support for usermode 120208fb77edSStefan Weil emulation targets 120308fb77edSStefan Weil --disable-guest-base disable GUEST_BASE support 120408fb77edSStefan Weil --enable-pie build Position Independent Executables 120508fb77edSStefan Weil --disable-pie do not build Position Independent Executables 120608fb77edSStefan Weil --fmod-lib path to FMOD library 120708fb77edSStefan Weil --fmod-inc path to FMOD includes 120808fb77edSStefan Weil --oss-lib path to OSS library 120908fb77edSStefan Weil --enable-uname-release=R Return R for uname -r in usermode emulation 121008fb77edSStefan Weil --cpu=CPU Build for host CPU [$cpu] 121108fb77edSStefan Weil --disable-uuid disable uuid support 121208fb77edSStefan Weil --enable-uuid enable uuid support 121308fb77edSStefan Weil --disable-vde disable support for vde network 121408fb77edSStefan Weil --enable-vde enable support for vde network 121508fb77edSStefan Weil --disable-netmap disable support for netmap network 121608fb77edSStefan Weil --enable-netmap enable support for netmap network 121708fb77edSStefan Weil --disable-linux-aio disable Linux AIO support 121808fb77edSStefan Weil --enable-linux-aio enable Linux AIO support 121908fb77edSStefan Weil --disable-cap-ng disable libcap-ng support 122008fb77edSStefan Weil --enable-cap-ng enable libcap-ng support 122108fb77edSStefan Weil --disable-attr disables attr and xattr support 122208fb77edSStefan Weil --enable-attr enable attr and xattr support 122308fb77edSStefan Weil --disable-blobs disable installing provided firmware blobs 122408fb77edSStefan Weil --enable-docs enable documentation build 122508fb77edSStefan Weil --disable-docs disable documentation build 122608fb77edSStefan Weil --disable-vhost-net disable vhost-net acceleration support 122708fb77edSStefan Weil --enable-vhost-net enable vhost-net acceleration support 122808fb77edSStefan Weil --enable-trace-backend=B Set trace backend 122908fb77edSStefan Weil Available backends: $($python $source_path/scripts/tracetool.py --list-backends) 123008fb77edSStefan Weil --with-trace-file=NAME Full PATH,NAME of file to store traces 123108fb77edSStefan Weil Default:trace-<pid> 123208fb77edSStefan Weil --disable-spice disable spice 123308fb77edSStefan Weil --enable-spice enable spice 123408fb77edSStefan Weil --enable-rbd enable building the rados block device (rbd) 123508fb77edSStefan Weil --disable-libiscsi disable iscsi support 123608fb77edSStefan Weil --enable-libiscsi enable iscsi support 1237*6542aa9cSPeter Lieven --disable-libnfs disable nfs support 1238*6542aa9cSPeter Lieven --enable-libnfs enable nfs support 123908fb77edSStefan Weil --disable-smartcard-nss disable smartcard nss support 124008fb77edSStefan Weil --enable-smartcard-nss enable smartcard nss support 124108fb77edSStefan Weil --disable-libusb disable libusb (for usb passthrough) 124208fb77edSStefan Weil --enable-libusb enable libusb (for usb passthrough) 124308fb77edSStefan Weil --disable-usb-redir disable usb network redirection support 124408fb77edSStefan Weil --enable-usb-redir enable usb network redirection support 124508fb77edSStefan Weil --disable-guest-agent disable building of the QEMU Guest Agent 124608fb77edSStefan Weil --enable-guest-agent enable building of the QEMU Guest Agent 124708fb77edSStefan Weil --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent 124808fb77edSStefan Weil --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) 124908fb77edSStefan Weil --disable-seccomp disable seccomp support 125008fb77edSStefan Weil --enable-seccomp enables seccomp support 125108fb77edSStefan Weil --with-coroutine=BACKEND coroutine backend. Supported options: 125208fb77edSStefan Weil gthread, ucontext, sigaltstack, windows 125308fb77edSStefan Weil --disable-coroutine-pool disable coroutine freelist (worse performance) 125408fb77edSStefan Weil --enable-coroutine-pool enable coroutine freelist (better performance) 125508fb77edSStefan Weil --enable-glusterfs enable GlusterFS backend 125608fb77edSStefan Weil --disable-glusterfs disable GlusterFS backend 125708fb77edSStefan Weil --enable-gcov enable test coverage analysis with gcov 125808fb77edSStefan Weil --gcov=GCOV use specified gcov [$gcov_tool] 125908fb77edSStefan Weil --enable-tpm enable TPM support 126008fb77edSStefan Weil --disable-libssh2 disable ssh block device support 126108fb77edSStefan Weil --enable-libssh2 enable ssh block device support 126208fb77edSStefan Weil --disable-vhdx disables support for the Microsoft VHDX image format 126308fb77edSStefan Weil --enable-vhdx enable support for the Microsoft VHDX image format 126408fb77edSStefan Weil 126508fb77edSStefan WeilNOTE: The object files are built at the place where configure is launched 1266af5db58eSpbrookEOF 1267af5db58eSpbrookexit 1 1268af5db58eSpbrookfi 1269af5db58eSpbrook 1270359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1271359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1272359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1273359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1274359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1275359bc95dSPeter Maydell ARCH=tci 1276359bc95dSPeter Maydell else 127776ad07a4SPeter Maydell error_exit "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1278359bc95dSPeter Maydell fi 1279359bc95dSPeter Maydellfi 1280359bc95dSPeter Maydell 12818d05095cSPaolo Bonzini# check that the C compiler works. 12828d05095cSPaolo Bonzinicat > $TMPC <<EOF 128375cafad7SStefan Weilint main(void) { return 0; } 12848d05095cSPaolo BonziniEOF 12858d05095cSPaolo Bonzini 12868d05095cSPaolo Bonziniif compile_object ; then 12878d05095cSPaolo Bonzini : C compiler works ok 12888d05095cSPaolo Bonzinielse 128976ad07a4SPeter Maydell error_exit "\"$cc\" either does not exist or does not work" 12908d05095cSPaolo Bonzinifi 12918d05095cSPaolo Bonzini 1292417c9d72SAlexander Graf# Consult white-list to determine whether to enable werror 1293417c9d72SAlexander Graf# by default. Only enable by default for git builds 1294417c9d72SAlexander Grafz_version=`cut -f3 -d. $source_path/VERSION` 1295417c9d72SAlexander Graf 1296417c9d72SAlexander Grafif test -z "$werror" ; then 12976c8fec83SAndreas Färber if test -d "$source_path/.git" -a \ 1298417c9d72SAlexander Graf "$linux" = "yes" ; then 1299417c9d72SAlexander Graf werror="yes" 1300417c9d72SAlexander Graf else 1301417c9d72SAlexander Graf werror="no" 1302417c9d72SAlexander Graf fi 1303417c9d72SAlexander Graffi 1304417c9d72SAlexander Graf 13058d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 13068d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 13078d05095cSPaolo Bonzinigcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 130837746c5eSMarc-André Lureaugcc_flags="-Wendif-labels $gcc_flags" 1309c1556a81SPeter Maydellgcc_flags="-Wno-initializer-overrides $gcc_flags" 131071429097SPeter Maydellgcc_flags="-Wno-string-plus-int $gcc_flags" 13116ca026cbSPeter Maydell# Note that we do not add -Werror to gcc_flags here, because that would 13126ca026cbSPeter Maydell# enable it for all configure tests. If a configure test failed due 13136ca026cbSPeter Maydell# to -Werror this would just silently disable some features, 13146ca026cbSPeter Maydell# so it's too error prone. 13158d05095cSPaolo Bonzinicat > $TMPC << EOF 13168d05095cSPaolo Bonziniint main(void) { return 0; } 13178d05095cSPaolo BonziniEOF 13188d05095cSPaolo Bonzinifor flag in $gcc_flags; do 1319a1d29d6cSPeter Maydell # Use the positive sense of the flag when testing for -Wno-wombat 1320a1d29d6cSPeter Maydell # support (gcc will happily accept the -Wno- form of unknown 1321a1d29d6cSPeter Maydell # warning options). 1322a1d29d6cSPeter Maydell optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')" 1323a1d29d6cSPeter Maydell if compile_prog "-Werror $optflag" "" ; then 13248d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 13258d05095cSPaolo Bonzini fi 13268d05095cSPaolo Bonzinidone 13278d05095cSPaolo Bonzini 132837746c5eSMarc-André Lureauif compile_prog "-Werror -fstack-protector-all" "" ; then 132937746c5eSMarc-André Lureau QEMU_CFLAGS="$QEMU_CFLAGS -fstack-protector-all" 133037746c5eSMarc-André Lureau LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,-fstack-protector-all" 133137746c5eSMarc-André Lureaufi 133237746c5eSMarc-André Lureau 1333cbdd1999SPaolo Bonzini# Workaround for http://gcc.gnu.org/PR55489. Happens with -fPIE/-fPIC and 1334cbdd1999SPaolo Bonzini# large functions that use global variables. The bug is in all releases of 1335cbdd1999SPaolo Bonzini# GCC, but it became particularly acute in 4.6.x and 4.7.x. It is fixed in 1336cbdd1999SPaolo Bonzini# 4.7.3 and 4.8.0. We should be able to delete this at the end of 2013. 1337cbdd1999SPaolo Bonzinicat > $TMPC << EOF 1338cbdd1999SPaolo Bonzini#if __GNUC__ == 4 && (__GNUC_MINOR__ == 6 || (__GNUC_MINOR__ == 7 && __GNUC_PATCHLEVEL__ <= 2)) 1339cbdd1999SPaolo Bonziniint main(void) { return 0; } 1340cbdd1999SPaolo Bonzini#else 1341cbdd1999SPaolo Bonzini#error No bug in this compiler. 1342cbdd1999SPaolo Bonzini#endif 1343cbdd1999SPaolo BonziniEOF 1344cbdd1999SPaolo Bonziniif compile_prog "-Werror -fno-gcse" "" ; then 1345cbdd1999SPaolo Bonzini TRANSLATE_OPT_CFLAGS=-fno-gcse 1346cbdd1999SPaolo Bonzinifi 1347cbdd1999SPaolo Bonzini 134840d6444eSAvi Kivityif test "$static" = "yes" ; then 134940d6444eSAvi Kivity if test "$pie" = "yes" ; then 135076ad07a4SPeter Maydell error_exit "static and pie are mutually incompatible" 135140d6444eSAvi Kivity else 135240d6444eSAvi Kivity pie="no" 135340d6444eSAvi Kivity fi 135440d6444eSAvi Kivityfi 135540d6444eSAvi Kivity 135640d6444eSAvi Kivityif test "$pie" = ""; then 135740d6444eSAvi Kivity case "$cpu-$targetos" in 1358c72b26ecSRichard Henderson i386-Linux|x86_64-Linux|x32-Linux|i386-OpenBSD|x86_64-OpenBSD) 135940d6444eSAvi Kivity ;; 136040d6444eSAvi Kivity *) 136140d6444eSAvi Kivity pie="no" 136240d6444eSAvi Kivity ;; 136340d6444eSAvi Kivity esac 136440d6444eSAvi Kivityfi 136540d6444eSAvi Kivity 136640d6444eSAvi Kivityif test "$pie" != "no" ; then 136740d6444eSAvi Kivity cat > $TMPC << EOF 136821d4a791SAvi Kivity 136921d4a791SAvi Kivity#ifdef __linux__ 137021d4a791SAvi Kivity# define THREAD __thread 137121d4a791SAvi Kivity#else 137221d4a791SAvi Kivity# define THREAD 137321d4a791SAvi Kivity#endif 137421d4a791SAvi Kivity 137521d4a791SAvi Kivitystatic THREAD int tls_var; 137621d4a791SAvi Kivity 137721d4a791SAvi Kivityint main(void) { return tls_var; } 137821d4a791SAvi Kivity 137940d6444eSAvi KivityEOF 138040d6444eSAvi Kivity if compile_prog "-fPIE -DPIE" "-pie"; then 138140d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 138240d6444eSAvi Kivity LDFLAGS="-pie $LDFLAGS" 138340d6444eSAvi Kivity pie="yes" 138440d6444eSAvi Kivity if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 138540d6444eSAvi Kivity LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" 138640d6444eSAvi Kivity fi 138740d6444eSAvi Kivity else 138840d6444eSAvi Kivity if test "$pie" = "yes"; then 138976ad07a4SPeter Maydell error_exit "PIE not available due to missing toolchain support" 139040d6444eSAvi Kivity else 139140d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 139240d6444eSAvi Kivity pie="no" 139340d6444eSAvi Kivity fi 139440d6444eSAvi Kivity fi 139540d6444eSAvi Kivityfi 139640d6444eSAvi Kivity 139709dada40SPaolo Bonzini########################################## 139809dada40SPaolo Bonzini# __sync_fetch_and_and requires at least -march=i486. Many toolchains 139909dada40SPaolo Bonzini# use i686 as default anyway, but for those that don't, an explicit 140009dada40SPaolo Bonzini# specification is necessary 140109dada40SPaolo Bonzini 140209dada40SPaolo Bonziniif test "$cpu" = "i386"; then 140309dada40SPaolo Bonzini cat > $TMPC << EOF 140409dada40SPaolo Bonzinistatic int sfaa(int *ptr) 140509dada40SPaolo Bonzini{ 140609dada40SPaolo Bonzini return __sync_fetch_and_and(ptr, 0); 140709dada40SPaolo Bonzini} 140809dada40SPaolo Bonzini 140909dada40SPaolo Bonziniint main(void) 141009dada40SPaolo Bonzini{ 141109dada40SPaolo Bonzini int val = 42; 14121405b629SStefan Weil val = __sync_val_compare_and_swap(&val, 0, 1); 141309dada40SPaolo Bonzini sfaa(&val); 141409dada40SPaolo Bonzini return val; 141509dada40SPaolo Bonzini} 141609dada40SPaolo BonziniEOF 141709dada40SPaolo Bonzini if ! compile_prog "" "" ; then 141809dada40SPaolo Bonzini QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" 141909dada40SPaolo Bonzini fi 142009dada40SPaolo Bonzinifi 142109dada40SPaolo Bonzini 142209dada40SPaolo Bonzini######################################### 1423ec530c81Sbellard# Solaris specific configure tool chain decisions 142409dada40SPaolo Bonzini 1425ec530c81Sbellardif test "$solaris" = "yes" ; then 14266792aa11SLoïc Minier if has $install; then 14276792aa11SLoïc Minier : 14286792aa11SLoïc Minier else 142976ad07a4SPeter Maydell error_exit "Solaris install program not found. Use --install=/usr/ucb/install or" \ 143076ad07a4SPeter Maydell "install fileutils from www.blastwave.org using pkg-get -i fileutils" \ 143176ad07a4SPeter Maydell "to get ginstall which is used by default (which lives in /opt/csw/bin)" 1432ec530c81Sbellard fi 14336792aa11SLoïc Minier if test "`path_of $install`" = "/usr/sbin/install" ; then 143476ad07a4SPeter Maydell error_exit "Solaris /usr/sbin/install is not an appropriate install program." \ 143576ad07a4SPeter Maydell "try ginstall from the GNU fileutils available from www.blastwave.org" \ 143676ad07a4SPeter Maydell "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 1437ec530c81Sbellard fi 14386792aa11SLoïc Minier if has ar; then 14396792aa11SLoïc Minier : 14406792aa11SLoïc Minier else 1441ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 144276ad07a4SPeter Maydell error_exit "No path includes ar" \ 144376ad07a4SPeter Maydell "Add /usr/ccs/bin to your path and rerun configure" 1444ec530c81Sbellard fi 144576ad07a4SPeter Maydell error_exit "No path includes ar" 1446ec530c81Sbellard fi 1447ec530c81Sbellardfi 1448ec530c81Sbellard 1449afb63ebdSStefan Weilif test -z "${target_list+xxx}" ; then 1450121afa9eSAnthony Liguori target_list="$default_target_list" 1451121afa9eSAnthony Liguorielse 1452121afa9eSAnthony Liguori target_list=`echo "$target_list" | sed -e 's/,/ /g'` 14535327cf48Sbellardfi 145425b48338SPeter Maydell 145525b48338SPeter Maydell# Check that we recognised the target name; this allows a more 145625b48338SPeter Maydell# friendly error message than if we let it fall through. 145725b48338SPeter Maydellfor target in $target_list; do 145825b48338SPeter Maydell case " $default_target_list " in 145925b48338SPeter Maydell *" $target "*) 146025b48338SPeter Maydell ;; 146125b48338SPeter Maydell *) 146225b48338SPeter Maydell error_exit "Unknown target name '$target'" 146325b48338SPeter Maydell ;; 146425b48338SPeter Maydell esac 146525b48338SPeter Maydelldone 146625b48338SPeter Maydell 1467f55fe278SPaolo Bonzini# see if system emulation was really requested 1468f55fe278SPaolo Bonzinicase " $target_list " in 1469f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 1470f55fe278SPaolo Bonzini ;; 1471f55fe278SPaolo Bonzini *) softmmu=no 1472f55fe278SPaolo Bonzini ;; 1473f55fe278SPaolo Bonziniesac 14745327cf48Sbellard 1475249247c9SJuan Quintelafeature_not_found() { 1476249247c9SJuan Quintela feature=$1 1477249247c9SJuan Quintela 147876ad07a4SPeter Maydell error_exit "User requested feature $feature" \ 147976ad07a4SPeter Maydell "configure was not able to find it" 1480249247c9SJuan Quintela} 1481249247c9SJuan Quintela 14827d13299dSbellard# --- 14837d13299dSbellard# big/little endian test 14847d13299dSbellardcat > $TMPC << EOF 148561cc919fSMike Frysingershort big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; 148661cc919fSMike Frysingershort little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; 148761cc919fSMike Frysingerextern int foo(short *, short *); 148861cc919fSMike Frysingerint main(int argc, char *argv[]) { 148961cc919fSMike Frysinger return foo(big_endian, little_endian); 14907d13299dSbellard} 14917d13299dSbellardEOF 14927d13299dSbellard 149361cc919fSMike Frysingerif compile_object ; then 149461cc919fSMike Frysinger if grep -q BiGeNdIaN $TMPO ; then 149561cc919fSMike Frysinger bigendian="yes" 149661cc919fSMike Frysinger elif grep -q LiTtLeEnDiAn $TMPO ; then 149761cc919fSMike Frysinger bigendian="no" 14987d13299dSbellard else 14997d13299dSbellard echo big/little test failed 15007d13299dSbellard fi 15017d13299dSbellardelse 150261cc919fSMike Frysinger echo big/little test failed 15037d13299dSbellardfi 15047d13299dSbellard 1505b0a47e79SJuan Quintela########################################## 1506779ab5e3SStefan Weil# pkg-config probe 1507779ab5e3SStefan Weil 1508779ab5e3SStefan Weilif ! has "$pkg_config_exe"; then 150976ad07a4SPeter Maydell error_exit "pkg-config binary '$pkg_config_exe' not found" 1510779ab5e3SStefan Weilfi 1511779ab5e3SStefan Weil 1512779ab5e3SStefan Weil########################################## 1513b0a47e79SJuan Quintela# NPTL probe 1514b0a47e79SJuan Quintela 151524cb36a6SPeter Maydellif test "$linux_user" = "yes"; then 1516bd0c5661Spbrook cat > $TMPC <<EOF 1517bd0c5661Spbrook#include <sched.h> 151830813ceaSpbrook#include <linux/futex.h> 1519182eacc0SStefan Weilint main(void) { 1520bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 1521bd0c5661Spbrook#error bork 1522bd0c5661Spbrook#endif 1523182eacc0SStefan Weil return 0; 1524bd0c5661Spbrook} 1525bd0c5661SpbrookEOF 152624cb36a6SPeter Maydell if ! compile_object ; then 1527b0a47e79SJuan Quintela feature_not_found "nptl" 1528b0a47e79SJuan Quintela fi 1529bd0c5661Spbrookfi 1530bd0c5661Spbrook 153111d9f695Sbellard########################################## 1532ac62922eSbalrog# zlib check 1533ac62922eSbalrog 15341ece9905SAlon Levyif test "$zlib" != "no" ; then 1535ac62922eSbalrog cat > $TMPC << EOF 1536ac62922eSbalrog#include <zlib.h> 1537ac62922eSbalrogint main(void) { zlibVersion(); return 0; } 1538ac62922eSbalrogEOF 153952166aa0SJuan Quintela if compile_prog "" "-lz" ; then 1540ac62922eSbalrog : 1541ac62922eSbalrog else 154276ad07a4SPeter Maydell error_exit "zlib check failed" \ 154376ad07a4SPeter Maydell "Make sure to have the zlib libs and headers installed." 1544ac62922eSbalrog fi 15451ece9905SAlon Levyfi 1546f544a488SPaolo Bonzinilibs_softmmu="$libs_softmmu -lz" 1547ac62922eSbalrog 1548ac62922eSbalrog########################################## 1549f794573eSEduardo Otubo# libseccomp check 1550f794573eSEduardo Otubo 1551f794573eSEduardo Otuboif test "$seccomp" != "no" ; then 155265d5d3f9SStefan Weil if $pkg_config --atleast-version=2.1.0 libseccomp; then 1553b4451996SMichael Tokarev libs_softmmu="$libs_softmmu `$pkg_config --libs libseccomp`" 1554372e47e9SAndreas Färber QEMU_CFLAGS="$QEMU_CFLAGS `$pkg_config --cflags libseccomp`" 1555f794573eSEduardo Otubo seccomp="yes" 1556f794573eSEduardo Otubo else 1557f794573eSEduardo Otubo if test "$seccomp" = "yes"; then 1558f794573eSEduardo Otubo feature_not_found "libseccomp" 1559f794573eSEduardo Otubo fi 1560e84d5956SYann E. MORIN seccomp="no" 1561f794573eSEduardo Otubo fi 1562f794573eSEduardo Otubofi 1563f794573eSEduardo Otubo########################################## 1564e37630caSaliguori# xen probe 1565e37630caSaliguori 1566fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 1567b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 1568d5b93ddfSAnthony PERARD 156950ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 157050ced5b3SStefan Weil # If no, we are done and there is no Xen support. 157150ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 157250ced5b3SStefan Weil 157350ced5b3SStefan Weil # Xen (any) 157450ced5b3SStefan Weil cat > $TMPC <<EOF 157550ced5b3SStefan Weil#include <xenctrl.h> 157650ced5b3SStefan Weilint main(void) { 157750ced5b3SStefan Weil return 0; 157850ced5b3SStefan Weil} 157950ced5b3SStefan WeilEOF 158050ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 158150ced5b3SStefan Weil # Xen not found 158250ced5b3SStefan Weil if test "$xen" = "yes" ; then 158350ced5b3SStefan Weil feature_not_found "xen" 158450ced5b3SStefan Weil fi 158550ced5b3SStefan Weil xen=no 158650ced5b3SStefan Weil 1587d5b93ddfSAnthony PERARD # Xen unstable 158869deef08SPeter Maydell elif 158969deef08SPeter Maydell cat > $TMPC <<EOF && 1590e37630caSaliguori#include <xenctrl.h> 1591e108a3c1SAnthony PERARD#include <xenstore.h> 1592d5b93ddfSAnthony PERARD#include <stdint.h> 1593d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1594d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1595d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1596d5b93ddfSAnthony PERARD#endif 1597d5b93ddfSAnthony PERARDint main(void) { 1598d5b93ddfSAnthony PERARD xc_interface *xc; 1599d5b93ddfSAnthony PERARD xs_daemon_open(); 1600d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 1601d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1602d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 1603b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 16048688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 16058688e065SStefano Stabellini return 0; 16068688e065SStefano Stabellini} 16078688e065SStefano StabelliniEOF 16088688e065SStefano Stabellini compile_prog "" "$xen_libs" 160969deef08SPeter Maydell then 16108688e065SStefano Stabellini xen_ctrl_version=420 16118688e065SStefano Stabellini xen=yes 16128688e065SStefano Stabellini 161369deef08SPeter Maydell elif 161469deef08SPeter Maydell cat > $TMPC <<EOF && 16158688e065SStefano Stabellini#include <xenctrl.h> 16168688e065SStefano Stabellini#include <xs.h> 16178688e065SStefano Stabellini#include <stdint.h> 16188688e065SStefano Stabellini#include <xen/hvm/hvm_info_table.h> 16198688e065SStefano Stabellini#if !defined(HVM_MAX_VCPUS) 16208688e065SStefano Stabellini# error HVM_MAX_VCPUS not defined 16218688e065SStefano Stabellini#endif 16228688e065SStefano Stabelliniint main(void) { 16238688e065SStefano Stabellini xs_daemon_open(); 16249b4c0b56SPeter Maydell xc_interface_open(0, 0, 0); 16258688e065SStefano Stabellini xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 16268688e065SStefano Stabellini xc_gnttab_open(NULL, 0); 16278688e065SStefano Stabellini xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 1628d5b93ddfSAnthony PERARD return 0; 1629d5b93ddfSAnthony PERARD} 1630e37630caSaliguoriEOF 163150ced5b3SStefan Weil compile_prog "" "$xen_libs" 163269deef08SPeter Maydell then 1633d5b93ddfSAnthony PERARD xen_ctrl_version=410 1634fc321b4bSJuan Quintela xen=yes 1635d5b93ddfSAnthony PERARD 1636d5b93ddfSAnthony PERARD # Xen 4.0.0 163769deef08SPeter Maydell elif 163869deef08SPeter Maydell cat > $TMPC <<EOF && 1639d5b93ddfSAnthony PERARD#include <xenctrl.h> 1640d5b93ddfSAnthony PERARD#include <xs.h> 1641d5b93ddfSAnthony PERARD#include <stdint.h> 1642d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1643d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1644d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1645d5b93ddfSAnthony PERARD#endif 1646d5b93ddfSAnthony PERARDint main(void) { 1647b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1648b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1649b87de24eSAnthony PERARD }; 1650d5b93ddfSAnthony PERARD xs_daemon_open(); 1651d5b93ddfSAnthony PERARD xc_interface_open(); 1652d5b93ddfSAnthony PERARD xc_gnttab_open(); 1653d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1654b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1655d5b93ddfSAnthony PERARD return 0; 1656d5b93ddfSAnthony PERARD} 1657d5b93ddfSAnthony PERARDEOF 1658d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 165969deef08SPeter Maydell then 1660d5b93ddfSAnthony PERARD xen_ctrl_version=400 1661d5b93ddfSAnthony PERARD xen=yes 1662d5b93ddfSAnthony PERARD 1663b87de24eSAnthony PERARD # Xen 3.4.0 166469deef08SPeter Maydell elif 166569deef08SPeter Maydell cat > $TMPC <<EOF && 1666b87de24eSAnthony PERARD#include <xenctrl.h> 1667b87de24eSAnthony PERARD#include <xs.h> 1668b87de24eSAnthony PERARDint main(void) { 1669b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1670b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1671b87de24eSAnthony PERARD }; 1672b87de24eSAnthony PERARD xs_daemon_open(); 1673b87de24eSAnthony PERARD xc_interface_open(); 1674b87de24eSAnthony PERARD xc_gnttab_open(); 1675b87de24eSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1676b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1677b87de24eSAnthony PERARD return 0; 1678b87de24eSAnthony PERARD} 1679b87de24eSAnthony PERARDEOF 1680b87de24eSAnthony PERARD compile_prog "" "$xen_libs" 168169deef08SPeter Maydell then 1682b87de24eSAnthony PERARD xen_ctrl_version=340 1683b87de24eSAnthony PERARD xen=yes 1684b87de24eSAnthony PERARD 1685b87de24eSAnthony PERARD # Xen 3.3.0 168669deef08SPeter Maydell elif 168769deef08SPeter Maydell cat > $TMPC <<EOF && 1688d5b93ddfSAnthony PERARD#include <xenctrl.h> 1689d5b93ddfSAnthony PERARD#include <xs.h> 1690d5b93ddfSAnthony PERARDint main(void) { 1691d5b93ddfSAnthony PERARD xs_daemon_open(); 1692d5b93ddfSAnthony PERARD xc_interface_open(); 1693d5b93ddfSAnthony PERARD xc_gnttab_open(); 1694d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1695d5b93ddfSAnthony PERARD return 0; 1696d5b93ddfSAnthony PERARD} 1697d5b93ddfSAnthony PERARDEOF 1698d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 169969deef08SPeter Maydell then 1700d5b93ddfSAnthony PERARD xen_ctrl_version=330 1701d5b93ddfSAnthony PERARD xen=yes 1702d5b93ddfSAnthony PERARD 170350ced5b3SStefan Weil # Xen version unsupported 1704e37630caSaliguori else 1705fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 170650ced5b3SStefan Weil feature_not_found "xen (unsupported version)" 1707fc321b4bSJuan Quintela fi 1708fc321b4bSJuan Quintela xen=no 1709e37630caSaliguori fi 1710d5b93ddfSAnthony PERARD 1711d5b93ddfSAnthony PERARD if test "$xen" = yes; then 1712d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 1713d5b93ddfSAnthony PERARD fi 1714e37630caSaliguorifi 1715e37630caSaliguori 1716eb6fda0fSAnthony PERARDif test "$xen_pci_passthrough" != "no"; then 1717eb6fda0fSAnthony PERARD if test "$xen" = "yes" && test "$linux" = "yes" && 1718eb6fda0fSAnthony PERARD test "$xen_ctrl_version" -ge 340; then 1719eb6fda0fSAnthony PERARD xen_pci_passthrough=yes 1720eb6fda0fSAnthony PERARD else 1721eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = "yes"; then 1722eb6fda0fSAnthony PERARD if test "$xen_ctrl_version" -lt 340; then 172376ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 172476ad07a4SPeter Maydell "This feature does not work with Xen 3.3" 1725eb6fda0fSAnthony PERARD fi 172676ad07a4SPeter Maydell error_exit "User requested feature Xen PCI Passthrough" \ 172776ad07a4SPeter Maydell " but this feature requires /sys from Linux" 1728eb6fda0fSAnthony PERARD fi 1729eb6fda0fSAnthony PERARD xen_pci_passthrough=no 1730eb6fda0fSAnthony PERARD fi 1731eb6fda0fSAnthony PERARDfi 1732eb6fda0fSAnthony PERARD 1733e37630caSaliguori########################################## 173444dc0ca3SAlon Levy# libtool probe 173544dc0ca3SAlon Levy 17363f534581SBradif ! has $libtool; then 173744dc0ca3SAlon Levy libtool= 173844dc0ca3SAlon Levyfi 173944dc0ca3SAlon Levy 17408e515b12SPeter Maydell# MacOSX ships with a libtool which isn't the GNU one; weed this 17418e515b12SPeter Maydell# out by checking whether libtool supports the --version switch 17428e515b12SPeter Maydellif test -n "$libtool"; then 17438e515b12SPeter Maydell if ! "$libtool" --version >/dev/null 2>&1; then 17448e515b12SPeter Maydell libtool= 17458e515b12SPeter Maydell fi 17468e515b12SPeter Maydellfi 17478e515b12SPeter Maydell 174844dc0ca3SAlon Levy########################################## 1749dfffc653SJuan Quintela# Sparse probe 1750dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 17510dba6195SLoïc Minier if has cgcc; then 1752dfffc653SJuan Quintela sparse=yes 1753dfffc653SJuan Quintela else 1754dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 1755dfffc653SJuan Quintela feature_not_found "sparse" 1756dfffc653SJuan Quintela fi 1757dfffc653SJuan Quintela sparse=no 1758dfffc653SJuan Quintela fi 1759dfffc653SJuan Quintelafi 1760dfffc653SJuan Quintela 1761dfffc653SJuan Quintela########################################## 1762a4ccabcfSAnthony Liguori# GTK probe 1763a4ccabcfSAnthony Liguori 1764a4ccabcfSAnthony Liguoriif test "$gtk" != "no"; then 1765528de90aSDaniel P. Berrange gtkpackage="gtk+-$gtkabi" 1766528de90aSDaniel P. Berrange if test "$gtkabi" = "3.0" ; then 1767528de90aSDaniel P. Berrange gtkversion="3.0.0" 1768528de90aSDaniel P. Berrange vtepackage="vte-2.90" 1769528de90aSDaniel P. Berrange vteversion="0.32.0" 1770528de90aSDaniel P. Berrange else 1771528de90aSDaniel P. Berrange gtkversion="2.18.0" 1772528de90aSDaniel P. Berrange vtepackage="vte" 1773528de90aSDaniel P. Berrange vteversion="0.24.0" 1774528de90aSDaniel P. Berrange fi 17750d185e63SPeter Maydell if ! $pkg_config --exists "$gtkpackage >= $gtkversion"; then 17760d185e63SPeter Maydell if test "$gtk" = "yes" ; then 17770d185e63SPeter Maydell feature_not_found "gtk" 17780d185e63SPeter Maydell fi 17790d185e63SPeter Maydell gtk="no" 17800d185e63SPeter Maydell elif ! $pkg_config --exists "$vtepackage >= $vteversion"; then 17810d185e63SPeter Maydell if test "$gtk" = "yes" ; then 17820d185e63SPeter Maydell error_exit "libvte not found (required for gtk support)" 17830d185e63SPeter Maydell fi 17840d185e63SPeter Maydell gtk="no" 17850d185e63SPeter Maydell else 1786ca871ec8SStefan Weil gtk_cflags=`$pkg_config --cflags $gtkpackage` 1787ca871ec8SStefan Weil gtk_libs=`$pkg_config --libs $gtkpackage` 1788ca871ec8SStefan Weil vte_cflags=`$pkg_config --cflags $vtepackage` 1789ca871ec8SStefan Weil vte_libs=`$pkg_config --libs $vtepackage` 1790a4ccabcfSAnthony Liguori libs_softmmu="$gtk_libs $vte_libs $libs_softmmu" 1791a4ccabcfSAnthony Liguori gtk="yes" 1792a4ccabcfSAnthony Liguori fi 1793a4ccabcfSAnthony Liguorifi 1794a4ccabcfSAnthony Liguori 1795a4ccabcfSAnthony Liguori########################################## 179611d9f695Sbellard# SDL probe 179711d9f695Sbellard 17983ec87ffeSPaolo Bonzini# Look for sdl configuration program (pkg-config or sdl-config). Try 17993ec87ffeSPaolo Bonzini# sdl-config even without cross prefix, and favour pkg-config over sdl-config. 18003ec87ffeSPaolo Bonziniif test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then 18013ec87ffeSPaolo Bonzini sdl_config=sdl-config 18023ec87ffeSPaolo Bonzinifi 18033ec87ffeSPaolo Bonzini 180465d5d3f9SStefan Weilif $pkg_config sdl --exists; then 1805a8bd70adSPaolo Bonzini sdlconfig="$pkg_config sdl" 1806fec0e3e8SStefan Weil _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` 18073ec87ffeSPaolo Bonzinielif has ${sdl_config}; then 18083ec87ffeSPaolo Bonzini sdlconfig="$sdl_config" 18099316f803SPaolo Bonzini _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` 1810a0dfd8a4SLoïc Minierelse 1811a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 1812a0dfd8a4SLoïc Minier feature_not_found "sdl" 1813a0dfd8a4SLoïc Minier fi 1814a0dfd8a4SLoïc Minier sdl=no 18159316f803SPaolo Bonzinifi 181629e5badaSScott Woodif test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then 18173ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 18183ec87ffeSPaolo Bonzinifi 181911d9f695Sbellard 18209316f803SPaolo Bonzinisdl_too_old=no 1821c4198157SJuan Quintelaif test "$sdl" != "no" ; then 182211d9f695Sbellard cat > $TMPC << EOF 182311d9f695Sbellard#include <SDL.h> 182411d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 182511d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 182611d9f695SbellardEOF 18279316f803SPaolo Bonzini sdl_cflags=`$sdlconfig --cflags 2> /dev/null` 182874f42e18STeLeMan if test "$static" = "yes" ; then 182974f42e18STeLeMan sdl_libs=`$sdlconfig --static-libs 2>/dev/null` 183074f42e18STeLeMan else 18319316f803SPaolo Bonzini sdl_libs=`$sdlconfig --libs 2> /dev/null` 183274f42e18STeLeMan fi 183352166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 183411d9f695Sbellard if test "$_sdlversion" -lt 121 ; then 183511d9f695Sbellard sdl_too_old=yes 183611d9f695Sbellard else 1837fd677642Sths if test "$cocoa" = "no" ; then 183811d9f695Sbellard sdl=yes 183911d9f695Sbellard fi 1840fd677642Sths fi 18417c1f25b4Sbellard 184267c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 18431ac88f28SJuan Quintela if test "$sdl" = "yes" -a "$static" = "yes" ; then 184467c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 1845f8aa6c7bSStefan Weil sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" 1846f8aa6c7bSStefan Weil sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" 184711d9f695Sbellard fi 184852166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 18491ac88f28SJuan Quintela : 18501ac88f28SJuan Quintela else 18511ac88f28SJuan Quintela sdl=no 18527c1f25b4Sbellard fi 18537c1f25b4Sbellard fi # static link 1854c4198157SJuan Quintela else # sdl not found 1855c4198157SJuan Quintela if test "$sdl" = "yes" ; then 1856c4198157SJuan Quintela feature_not_found "sdl" 1857c4198157SJuan Quintela fi 1858c4198157SJuan Quintela sdl=no 18597c1f25b4Sbellard fi # sdl compile test 1860fd677642Sthsfi 186111d9f695Sbellard 18625368a422Saliguoriif test "$sdl" = "yes" ; then 18635368a422Saliguori cat > $TMPC <<EOF 18645368a422Saliguori#include <SDL.h> 18655368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 18665368a422Saliguori#include <X11/XKBlib.h> 18675368a422Saliguori#else 18685368a422Saliguori#error No x11 support 18695368a422Saliguori#endif 18705368a422Saliguoriint main(void) { return 0; } 18715368a422SaliguoriEOF 187252166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 1873681306dfSJuan Quintela sdl_libs="$sdl_libs -lX11" 18745368a422Saliguori fi 18750705667eSJuan Quintela libs_softmmu="$sdl_libs $libs_softmmu" 18765368a422Saliguorifi 18775368a422Saliguori 18788f28f3fbSths########################################## 18792da776dbSMichael R. Hines# RDMA needs OpenFabrics libraries 18802da776dbSMichael R. Hinesif test "$rdma" != "no" ; then 18812da776dbSMichael R. Hines cat > $TMPC <<EOF 18822da776dbSMichael R. Hines#include <rdma/rdma_cma.h> 18832da776dbSMichael R. Hinesint main(void) { return 0; } 18842da776dbSMichael R. HinesEOF 18852da776dbSMichael R. Hines rdma_libs="-lrdmacm -libverbs" 18862da776dbSMichael R. Hines if compile_prog "" "$rdma_libs" ; then 18872da776dbSMichael R. Hines rdma="yes" 18882da776dbSMichael R. Hines libs_softmmu="$libs_softmmu $rdma_libs" 18892da776dbSMichael R. Hines else 18902da776dbSMichael R. Hines if test "$rdma" = "yes" ; then 18912da776dbSMichael R. Hines error_exit \ 18922da776dbSMichael R. Hines " OpenFabrics librdmacm/libibverbs not present." \ 18932da776dbSMichael R. Hines " Your options:" \ 18942da776dbSMichael R. Hines " (1) Fast: Install infiniband packages from your distro." \ 18952da776dbSMichael R. Hines " (2) Cleanest: Install libraries from www.openfabrics.org" \ 18962da776dbSMichael R. Hines " (3) Also: Install softiwarp if you don't have RDMA hardware" 18972da776dbSMichael R. Hines fi 18982da776dbSMichael R. Hines rdma="no" 18992da776dbSMichael R. Hines fi 19002da776dbSMichael R. Hinesfi 19012da776dbSMichael R. Hines 19022da776dbSMichael R. Hines########################################## 19037536ee4bSTim Hardeck# VNC TLS/WS detection 19047536ee4bSTim Hardeckif test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then 1905ae6b5e5aSaliguori cat > $TMPC <<EOF 1906ae6b5e5aSaliguori#include <gnutls/gnutls.h> 1907ae6b5e5aSaliguoriint main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } 1908ae6b5e5aSaliguoriEOF 1909a8bd70adSPaolo Bonzini vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 1910a8bd70adSPaolo Bonzini vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 191152166aa0SJuan Quintela if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then 19127536ee4bSTim Hardeck if test "$vnc_tls" != "no" ; then 19131be10ad2SJuan Quintela vnc_tls=yes 19147536ee4bSTim Hardeck fi 19157536ee4bSTim Hardeck if test "$vnc_ws" != "no" ; then 19167536ee4bSTim Hardeck vnc_ws=yes 19177536ee4bSTim Hardeck fi 1918a5e32cc9SJuan Quintela libs_softmmu="$vnc_tls_libs $libs_softmmu" 1919ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_tls_cflags" 1920ae6b5e5aSaliguori else 19211be10ad2SJuan Quintela if test "$vnc_tls" = "yes" ; then 19221be10ad2SJuan Quintela feature_not_found "vnc-tls" 19231be10ad2SJuan Quintela fi 19247536ee4bSTim Hardeck if test "$vnc_ws" = "yes" ; then 19257536ee4bSTim Hardeck feature_not_found "vnc-ws" 19267536ee4bSTim Hardeck fi 19271be10ad2SJuan Quintela vnc_tls=no 19287536ee4bSTim Hardeck vnc_ws=no 19298d5d2d4cSths fi 19308d5d2d4cSthsfi 19318d5d2d4cSths 19328d5d2d4cSths########################################## 19332f9606b3Saliguori# VNC SASL detection 1934821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then 19352f9606b3Saliguori cat > $TMPC <<EOF 19362f9606b3Saliguori#include <sasl/sasl.h> 19372f9606b3Saliguori#include <stdio.h> 19382f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 19392f9606b3SaliguoriEOF 19402f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 19412f9606b3Saliguori vnc_sasl_cflags="" 19422f9606b3Saliguori vnc_sasl_libs="-lsasl2" 194352166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 1944ea784e3bSJuan Quintela vnc_sasl=yes 1945fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 1946ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_sasl_cflags" 19472f9606b3Saliguori else 1948ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 1949ea784e3bSJuan Quintela feature_not_found "vnc-sasl" 1950ea784e3bSJuan Quintela fi 1951ea784e3bSJuan Quintela vnc_sasl=no 19522f9606b3Saliguori fi 19532f9606b3Saliguorifi 19542f9606b3Saliguori 19552f9606b3Saliguori########################################## 19562f6f5c7aSCorentin Chary# VNC JPEG detection 1957821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then 19582f6f5c7aSCorentin Charycat > $TMPC <<EOF 19592f6f5c7aSCorentin Chary#include <stdio.h> 19602f6f5c7aSCorentin Chary#include <jpeglib.h> 19612f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 19622f6f5c7aSCorentin CharyEOF 19632f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 19642f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 19652f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 19662f6f5c7aSCorentin Chary vnc_jpeg=yes 19672f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 1968ca273d58SPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $vnc_jpeg_cflags" 19692f6f5c7aSCorentin Chary else 19702f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 19712f6f5c7aSCorentin Chary feature_not_found "vnc-jpeg" 19722f6f5c7aSCorentin Chary fi 19732f6f5c7aSCorentin Chary vnc_jpeg=no 19742f6f5c7aSCorentin Chary fi 19752f6f5c7aSCorentin Charyfi 19762f6f5c7aSCorentin Chary 19772f6f5c7aSCorentin Chary########################################## 1978efe556adSCorentin Chary# VNC PNG detection 1979821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_png" != "no" ; then 1980efe556adSCorentin Charycat > $TMPC <<EOF 1981efe556adSCorentin Chary//#include <stdio.h> 1982efe556adSCorentin Chary#include <png.h> 1983832ce9c2SScott Wood#include <stddef.h> 1984efe556adSCorentin Charyint main(void) { 1985efe556adSCorentin Chary png_structp png_ptr; 1986efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 19877edc3fedSPeter Maydell return png_ptr != 0; 1988efe556adSCorentin Chary} 1989efe556adSCorentin CharyEOF 199065d5d3f9SStefan Weil if $pkg_config libpng --exists; then 1991ca871ec8SStefan Weil vnc_png_cflags=`$pkg_config libpng --cflags` 1992ca871ec8SStefan Weil vnc_png_libs=`$pkg_config libpng --libs` 19939af8025eSBrad else 1994efe556adSCorentin Chary vnc_png_cflags="" 1995efe556adSCorentin Chary vnc_png_libs="-lpng" 19969af8025eSBrad fi 1997efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 1998efe556adSCorentin Chary vnc_png=yes 1999efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 20009af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 2001efe556adSCorentin Chary else 2002efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 2003efe556adSCorentin Chary feature_not_found "vnc-png" 2004efe556adSCorentin Chary fi 2005efe556adSCorentin Chary vnc_png=no 2006efe556adSCorentin Chary fi 2007efe556adSCorentin Charyfi 2008efe556adSCorentin Chary 2009efe556adSCorentin Chary########################################## 201076655d6dSaliguori# fnmatch() probe, used for ACL routines 201176655d6dSaliguorifnmatch="no" 201276655d6dSaliguoricat > $TMPC << EOF 201376655d6dSaliguori#include <fnmatch.h> 201476655d6dSaliguoriint main(void) 201576655d6dSaliguori{ 201676655d6dSaliguori fnmatch("foo", "foo", 0); 201776655d6dSaliguori return 0; 201876655d6dSaliguori} 201976655d6dSaliguoriEOF 202052166aa0SJuan Quintelaif compile_prog "" "" ; then 202176655d6dSaliguori fnmatch="yes" 202276655d6dSaliguorifi 202376655d6dSaliguori 202476655d6dSaliguori########################################## 2025ee682d27SStefan Weil# uuid_generate() probe, used for vdi block driver 20262d16c8e9SPeter Maydell# Note that on some systems (notably MacOSX) no extra library 20272d16c8e9SPeter Maydell# need be linked to get the uuid functions. 2028ee682d27SStefan Weilif test "$uuid" != "no" ; then 2029ee682d27SStefan Weil uuid_libs="-luuid" 2030ee682d27SStefan Weil cat > $TMPC << EOF 2031ee682d27SStefan Weil#include <uuid/uuid.h> 2032ee682d27SStefan Weilint main(void) 2033ee682d27SStefan Weil{ 2034ee682d27SStefan Weil uuid_t my_uuid; 2035ee682d27SStefan Weil uuid_generate(my_uuid); 2036ee682d27SStefan Weil return 0; 2037ee682d27SStefan Weil} 2038ee682d27SStefan WeilEOF 20392d16c8e9SPeter Maydell if compile_prog "" "" ; then 20402d16c8e9SPeter Maydell uuid="yes" 20412d16c8e9SPeter Maydell elif compile_prog "" "$uuid_libs" ; then 2042ee682d27SStefan Weil uuid="yes" 2043ee682d27SStefan Weil libs_softmmu="$uuid_libs $libs_softmmu" 2044ee682d27SStefan Weil libs_tools="$uuid_libs $libs_tools" 2045ee682d27SStefan Weil else 2046ee682d27SStefan Weil if test "$uuid" = "yes" ; then 2047ee682d27SStefan Weil feature_not_found "uuid" 2048ee682d27SStefan Weil fi 2049ee682d27SStefan Weil uuid=no 2050ee682d27SStefan Weil fi 2051ee682d27SStefan Weilfi 2052ee682d27SStefan Weil 20534f18b782SJeff Codyif test "$vhdx" = "yes" ; then 20544f18b782SJeff Cody if test "$uuid" = "no" ; then 20554f18b782SJeff Cody error_exit "uuid required for VHDX support" 20564f18b782SJeff Cody fi 20574f18b782SJeff Codyelif test "$vhdx" != "no" ; then 20584f18b782SJeff Cody if test "$uuid" = "yes" ; then 20594f18b782SJeff Cody vhdx=yes 20604f18b782SJeff Cody else 20614f18b782SJeff Cody vhdx=no 20624f18b782SJeff Cody fi 20634f18b782SJeff Codyfi 20644f18b782SJeff Cody 2065ee682d27SStefan Weil########################################## 2066dce512deSChristoph Hellwig# xfsctl() probe, used for raw-posix 2067dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 2068dce512deSChristoph Hellwig cat > $TMPC << EOF 2069ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 2070dce512deSChristoph Hellwig#include <xfs/xfs.h> 2071dce512deSChristoph Hellwigint main(void) 2072dce512deSChristoph Hellwig{ 2073dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 2074dce512deSChristoph Hellwig return 0; 2075dce512deSChristoph Hellwig} 2076dce512deSChristoph HellwigEOF 2077dce512deSChristoph Hellwig if compile_prog "" "" ; then 2078dce512deSChristoph Hellwig xfs="yes" 2079dce512deSChristoph Hellwig else 2080dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 2081dce512deSChristoph Hellwig feature_not_found "xfs" 2082dce512deSChristoph Hellwig fi 2083dce512deSChristoph Hellwig xfs=no 2084dce512deSChristoph Hellwig fi 2085dce512deSChristoph Hellwigfi 2086dce512deSChristoph Hellwig 2087dce512deSChristoph Hellwig########################################## 20888a16d273Sths# vde libraries probe 2089dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 20904baae0acSJuan Quintela vde_libs="-lvdeplug" 20918a16d273Sths cat > $TMPC << EOF 20928a16d273Sths#include <libvdeplug.h> 20934a7f0e06Spbrookint main(void) 20944a7f0e06Spbrook{ 20954a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 2096fea08e08SPeter Maydell char s[] = ""; 2097fea08e08SPeter Maydell vde_open(s, s, &a); 20984a7f0e06Spbrook return 0; 20994a7f0e06Spbrook} 21008a16d273SthsEOF 210152166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 21024baae0acSJuan Quintela vde=yes 21038e02e54cSJuan Quintela libs_softmmu="$vde_libs $libs_softmmu" 21048e02e54cSJuan Quintela libs_tools="$vde_libs $libs_tools" 2105dfb278bdSJuan Quintela else 2106dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 2107dfb278bdSJuan Quintela feature_not_found "vde" 2108dfb278bdSJuan Quintela fi 2109dfb278bdSJuan Quintela vde=no 21108a16d273Sths fi 21118a16d273Sthsfi 21128a16d273Sths 21138a16d273Sths########################################## 211458952137SVincenzo Maffione# netmap headers probe 211558952137SVincenzo Maffioneif test "$netmap" != "no" ; then 211658952137SVincenzo Maffione cat > $TMPC << EOF 211758952137SVincenzo Maffione#include <inttypes.h> 211858952137SVincenzo Maffione#include <net/if.h> 211958952137SVincenzo Maffione#include <net/netmap.h> 212058952137SVincenzo Maffione#include <net/netmap_user.h> 212158952137SVincenzo Maffioneint main(void) { return 0; } 212258952137SVincenzo MaffioneEOF 212358952137SVincenzo Maffione if compile_prog "" "" ; then 212458952137SVincenzo Maffione netmap=yes 212558952137SVincenzo Maffione else 212658952137SVincenzo Maffione if test "$netmap" = "yes" ; then 212758952137SVincenzo Maffione feature_not_found "netmap" 212858952137SVincenzo Maffione fi 212958952137SVincenzo Maffione netmap=no 213058952137SVincenzo Maffione fi 213158952137SVincenzo Maffionefi 213258952137SVincenzo Maffione 213358952137SVincenzo Maffione########################################## 213447e98658SCorey Bryant# libcap-ng library probe 213547e98658SCorey Bryantif test "$cap_ng" != "no" ; then 213647e98658SCorey Bryant cap_libs="-lcap-ng" 213747e98658SCorey Bryant cat > $TMPC << EOF 213847e98658SCorey Bryant#include <cap-ng.h> 213947e98658SCorey Bryantint main(void) 214047e98658SCorey Bryant{ 214147e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 214247e98658SCorey Bryant return 0; 214347e98658SCorey Bryant} 214447e98658SCorey BryantEOF 214547e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 214647e98658SCorey Bryant cap_ng=yes 214747e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 214847e98658SCorey Bryant else 214947e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 215047e98658SCorey Bryant feature_not_found "cap_ng" 215147e98658SCorey Bryant fi 215247e98658SCorey Bryant cap_ng=no 215347e98658SCorey Bryant fi 215447e98658SCorey Bryantfi 215547e98658SCorey Bryant 215647e98658SCorey Bryant########################################## 2157c2de5c91Smalc# Sound support libraries probe 21588f28f3fbSths 2159c2de5c91Smalcaudio_drv_probe() 2160c2de5c91Smalc{ 2161c2de5c91Smalc drv=$1 2162c2de5c91Smalc hdr=$2 2163c2de5c91Smalc lib=$3 2164c2de5c91Smalc exp=$4 2165c2de5c91Smalc cfl=$5 21668f28f3fbSths cat > $TMPC << EOF 2167c2de5c91Smalc#include <$hdr> 2168c2de5c91Smalcint main(void) { $exp } 21698f28f3fbSthsEOF 217052166aa0SJuan Quintela if compile_prog "$cfl" "$lib" ; then 21718f28f3fbSths : 21728f28f3fbSths else 217376ad07a4SPeter Maydell error_exit "$drv check failed" \ 217476ad07a4SPeter Maydell "Make sure to have the $drv libs and headers installed." 21758f28f3fbSths fi 2176c2de5c91Smalc} 2177c2de5c91Smalc 21782fa7d3bfSmalcaudio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` 2179c2de5c91Smalcfor drv in $audio_drv_list; do 2180c2de5c91Smalc case $drv in 2181c2de5c91Smalc alsa) 2182c2de5c91Smalc audio_drv_probe $drv alsa/asoundlib.h -lasound \ 2183e35bcb0cSStefan Weil "return snd_pcm_close((snd_pcm_t *)0);" 2184a4bf6780SJuan Quintela libs_softmmu="-lasound $libs_softmmu" 2185c2de5c91Smalc ;; 2186c2de5c91Smalc 2187c2de5c91Smalc fmod) 2188c2de5c91Smalc if test -z $fmod_lib || test -z $fmod_inc; then 218976ad07a4SPeter Maydell error_exit "You must specify path to FMOD library and headers" \ 219076ad07a4SPeter Maydell "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 21918f28f3fbSths fi 2192c2de5c91Smalc audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" 2193a4bf6780SJuan Quintela libs_softmmu="$fmod_lib $libs_softmmu" 2194c2de5c91Smalc ;; 2195c2de5c91Smalc 2196c2de5c91Smalc esd) 2197c2de5c91Smalc audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' 2198a4bf6780SJuan Quintela libs_softmmu="-lesd $libs_softmmu" 219967f86e8eSJuan Quintela audio_pt_int="yes" 2200c2de5c91Smalc ;; 2201b8e59f18Smalc 2202b8e59f18Smalc pa) 2203a394aed2SMarc-André Lureau audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ 2204a394aed2SMarc-André Lureau "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" 2205a394aed2SMarc-André Lureau libs_softmmu="-lpulse $libs_softmmu" 220667f86e8eSJuan Quintela audio_pt_int="yes" 2207b8e59f18Smalc ;; 2208b8e59f18Smalc 2209997e690aSJuan Quintela coreaudio) 2210997e690aSJuan Quintela libs_softmmu="-framework CoreAudio $libs_softmmu" 2211997e690aSJuan Quintela ;; 2212997e690aSJuan Quintela 2213a4bf6780SJuan Quintela dsound) 2214a4bf6780SJuan Quintela libs_softmmu="-lole32 -ldxguid $libs_softmmu" 2215d5631638Smalc audio_win_int="yes" 2216a4bf6780SJuan Quintela ;; 2217a4bf6780SJuan Quintela 2218a4bf6780SJuan Quintela oss) 2219a4bf6780SJuan Quintela libs_softmmu="$oss_lib $libs_softmmu" 2220a4bf6780SJuan Quintela ;; 2221a4bf6780SJuan Quintela 2222a4bf6780SJuan Quintela sdl|wav) 22232f6a1ab0Sblueswir1 # XXX: Probes for CoreAudio, DirectSound, SDL(?) 22242f6a1ab0Sblueswir1 ;; 22252f6a1ab0Sblueswir1 2226d5631638Smalc winwave) 2227d5631638Smalc libs_softmmu="-lwinmm $libs_softmmu" 2228d5631638Smalc audio_win_int="yes" 2229d5631638Smalc ;; 2230d5631638Smalc 2231e4c63a6aSmalc *) 22321c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 223376ad07a4SPeter Maydell error_exit "Unknown driver '$drv' selected" \ 223476ad07a4SPeter Maydell "Possible drivers are: $audio_possible_drivers" 2235e4c63a6aSmalc } 2236e4c63a6aSmalc ;; 2237c2de5c91Smalc esac 2238c2de5c91Smalcdone 22398f28f3fbSths 22404d3b6f6eSbalrog########################################## 22412e4d9fb1Saurel32# BrlAPI probe 22422e4d9fb1Saurel32 22434ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 2244eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 22452e4d9fb1Saurel32 cat > $TMPC << EOF 22462e4d9fb1Saurel32#include <brlapi.h> 2247832ce9c2SScott Wood#include <stddef.h> 22482e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 22492e4d9fb1Saurel32EOF 225052166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 22512e4d9fb1Saurel32 brlapi=yes 2252264606b3SJuan Quintela libs_softmmu="$brlapi_libs $libs_softmmu" 22534ffcedb6SJuan Quintela else 22544ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 22554ffcedb6SJuan Quintela feature_not_found "brlapi" 22564ffcedb6SJuan Quintela fi 22574ffcedb6SJuan Quintela brlapi=no 2258eb82284fSJuan Quintela fi 2259eb82284fSJuan Quintelafi 22602e4d9fb1Saurel32 22612e4d9fb1Saurel32########################################## 22624d3b6f6eSbalrog# curses probe 2263a3605bf6SMichael Tokarevif test "$curses" != "no" ; then 2264e095e2f3SStefan Weil if test "$mingw32" = "yes" ; then 2265e095e2f3SStefan Weil curses_list="-lpdcurses" 2266e095e2f3SStefan Weil else 2267cfeda5f4SEd Maste curses_list="$($pkg_config --libs ncurses 2>/dev/null):-lncurses:-lcurses" 2268e095e2f3SStefan Weil fi 2269c584a6d0SJuan Quintela curses_found=no 22704d3b6f6eSbalrog cat > $TMPC << EOF 22714d3b6f6eSbalrog#include <curses.h> 2272ef9a2524SStefan Weilint main(void) { 2273ef9a2524SStefan Weil const char *s = curses_version(); 2274ef9a2524SStefan Weil resize_term(0, 0); 2275ef9a2524SStefan Weil return s != 0; 2276ef9a2524SStefan Weil} 22774d3b6f6eSbalrogEOF 2278ecbe251fSVadim Evard IFS=: 22794f78ef9aSJuan Quintela for curses_lib in $curses_list; do 2280ecbe251fSVadim Evard unset IFS 22814f78ef9aSJuan Quintela if compile_prog "" "$curses_lib" ; then 2282c584a6d0SJuan Quintela curses_found=yes 22834f78ef9aSJuan Quintela libs_softmmu="$curses_lib $libs_softmmu" 22844f78ef9aSJuan Quintela break 22854d3b6f6eSbalrog fi 22864f78ef9aSJuan Quintela done 2287ecbe251fSVadim Evard unset IFS 2288c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 2289c584a6d0SJuan Quintela curses=yes 2290c584a6d0SJuan Quintela else 2291c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 2292c584a6d0SJuan Quintela feature_not_found "curses" 2293c584a6d0SJuan Quintela fi 2294c584a6d0SJuan Quintela curses=no 2295c584a6d0SJuan Quintela fi 22964f78ef9aSJuan Quintelafi 22974d3b6f6eSbalrog 2298414f0dabSblueswir1########################################## 2299769ce76dSAlexander Graf# curl probe 2300a3605bf6SMichael Tokarevif test "$curl" != "no" ; then 230165d5d3f9SStefan Weil if $pkg_config libcurl --exists; then 2302a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 23034e2b0658SPaolo Bonzini else 23044e2b0658SPaolo Bonzini curlconfig=curl-config 23054e2b0658SPaolo Bonzini fi 2306769ce76dSAlexander Graf cat > $TMPC << EOF 2307769ce76dSAlexander Graf#include <curl/curl.h> 23080b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 2309769ce76dSAlexander GrafEOF 23104e2b0658SPaolo Bonzini curl_cflags=`$curlconfig --cflags 2>/dev/null` 23114e2b0658SPaolo Bonzini curl_libs=`$curlconfig --libs 2>/dev/null` 2312b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 2313769ce76dSAlexander Graf curl=yes 2314f0302935SJuan Quintela libs_tools="$curl_libs $libs_tools" 2315f0302935SJuan Quintela libs_softmmu="$curl_libs $libs_softmmu" 2316788c8196SJuan Quintela else 2317788c8196SJuan Quintela if test "$curl" = "yes" ; then 2318788c8196SJuan Quintela feature_not_found "curl" 2319788c8196SJuan Quintela fi 2320788c8196SJuan Quintela curl=no 2321769ce76dSAlexander Graf fi 2322769ce76dSAlexander Graffi # test "$curl" 2323769ce76dSAlexander Graf 2324769ce76dSAlexander Graf########################################## 2325fb599c9aSbalrog# bluez support probe 2326a20a6f46SJuan Quintelaif test "$bluez" != "no" ; then 2327e820e3f4Sbalrog cat > $TMPC << EOF 2328e820e3f4Sbalrog#include <bluetooth/bluetooth.h> 2329e820e3f4Sbalrogint main(void) { return bt_error(0); } 2330e820e3f4SbalrogEOF 2331a8bd70adSPaolo Bonzini bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` 2332a8bd70adSPaolo Bonzini bluez_libs=`$pkg_config --libs bluez 2> /dev/null` 233352166aa0SJuan Quintela if compile_prog "$bluez_cflags" "$bluez_libs" ; then 2334a20a6f46SJuan Quintela bluez=yes 2335e482d56aSJuan Quintela libs_softmmu="$bluez_libs $libs_softmmu" 2336e820e3f4Sbalrog else 2337a20a6f46SJuan Quintela if test "$bluez" = "yes" ; then 2338a20a6f46SJuan Quintela feature_not_found "bluez" 2339a20a6f46SJuan Quintela fi 2340e820e3f4Sbalrog bluez="no" 2341e820e3f4Sbalrog fi 2342fb599c9aSbalrogfi 2343fb599c9aSbalrog 2344fb599c9aSbalrog########################################## 2345e18df141SAnthony Liguori# glib support probe 2346a52d28afSPaolo Bonzini 2347a52d28afSPaolo Bonziniif test "$mingw32" = yes; then 2348a52d28afSPaolo Bonzini # g_poll is required in order to integrate with the glib main loop. 2349a52d28afSPaolo Bonzini glib_req_ver=2.20 2350a52d28afSPaolo Bonzinielse 2351a52d28afSPaolo Bonzini glib_req_ver=2.12 2352a52d28afSPaolo Bonzinifi 235365d5d3f9SStefan Weilif $pkg_config --atleast-version=$glib_req_ver gthread-2.0; then 2354ca871ec8SStefan Weil glib_cflags=`$pkg_config --cflags gthread-2.0` 2355ca871ec8SStefan Weil glib_libs=`$pkg_config --libs gthread-2.0` 235614015304SAnthony Liguori LIBS="$glib_libs $LIBS" 2357957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 2358e18df141SAnthony Liguorielse 235976ad07a4SPeter Maydell error_exit "glib-$glib_req_ver required to compile QEMU" 2360e18df141SAnthony Liguorifi 2361e18df141SAnthony Liguori 2362e18df141SAnthony Liguori########################################## 2363e2134eb9SGerd Hoffmann# pixman support probe 2364e2134eb9SGerd Hoffmann 2365e2134eb9SGerd Hoffmannif test "$pixman" = ""; then 236674880fe2SRobert Schiele if test "$want_tools" = "no" -a "$softmmu" = "no"; then 236774880fe2SRobert Schiele pixman="none" 236874880fe2SRobert Schiele elif $pkg_config pixman-1 > /dev/null 2>&1; then 2369e2134eb9SGerd Hoffmann pixman="system" 2370e2134eb9SGerd Hoffmann else 2371e2134eb9SGerd Hoffmann pixman="internal" 2372e2134eb9SGerd Hoffmann fi 2373e2134eb9SGerd Hoffmannfi 237474880fe2SRobert Schieleif test "$pixman" = "none"; then 237574880fe2SRobert Schiele if test "$want_tools" != "no" -o "$softmmu" != "no"; then 237676ad07a4SPeter Maydell error_exit "pixman disabled but system emulation or tools build" \ 237776ad07a4SPeter Maydell "enabled. You can turn off pixman only if you also" \ 237876ad07a4SPeter Maydell "disable all system emulation targets and the tools" \ 237976ad07a4SPeter Maydell "build with '--disable-tools --disable-system'." 238074880fe2SRobert Schiele fi 238174880fe2SRobert Schiele pixman_cflags= 238274880fe2SRobert Schiele pixman_libs= 238374880fe2SRobert Schieleelif test "$pixman" = "system"; then 2384ca871ec8SStefan Weil pixman_cflags=`$pkg_config --cflags pixman-1` 2385ca871ec8SStefan Weil pixman_libs=`$pkg_config --libs pixman-1` 2386e2134eb9SGerd Hoffmannelse 2387e2134eb9SGerd Hoffmann if test ! -d ${source_path}/pixman/pixman; then 238876ad07a4SPeter Maydell error_exit "pixman not present. Your options:" \ 238976ad07a4SPeter Maydell " (1) Preferred: Install the pixman devel package (any recent" \ 239076ad07a4SPeter Maydell " distro should have packages as Xorg needs pixman too)." \ 239176ad07a4SPeter Maydell " (2) Fetch the pixman submodule, using:" \ 239276ad07a4SPeter Maydell " git submodule update --init pixman" 2393e2134eb9SGerd Hoffmann fi 23945ca9388aSGerd Hoffmann mkdir -p pixman/pixman 23955ca9388aSGerd Hoffmann pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman" 23965ca9388aSGerd Hoffmann pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1" 2397e2134eb9SGerd Hoffmannfi 2398e2134eb9SGerd Hoffmann 2399e2134eb9SGerd Hoffmann########################################## 240017bff52bSM. Mohan Kumar# libcap probe 240117bff52bSM. Mohan Kumar 240217bff52bSM. Mohan Kumarif test "$cap" != "no" ; then 240317bff52bSM. Mohan Kumar cat > $TMPC <<EOF 240417bff52bSM. Mohan Kumar#include <stdio.h> 240517bff52bSM. Mohan Kumar#include <sys/capability.h> 2406cc939743SStefan Weilint main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } 240717bff52bSM. Mohan KumarEOF 240817bff52bSM. Mohan Kumar if compile_prog "" "-lcap" ; then 240917bff52bSM. Mohan Kumar cap=yes 241017bff52bSM. Mohan Kumar else 241117bff52bSM. Mohan Kumar cap=no 241217bff52bSM. Mohan Kumar fi 241317bff52bSM. Mohan Kumarfi 241417bff52bSM. Mohan Kumar 241517bff52bSM. Mohan Kumar########################################## 2416e5d355d1Saliguori# pthread probe 24174b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 24183c529d93Saliguori 2419e5d355d1Saliguoripthread=no 2420414f0dabSblueswir1cat > $TMPC << EOF 24213c529d93Saliguori#include <pthread.h> 24227a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 24237a42bbe4SStefan Weilint main(void) { 24247a42bbe4SStefan Weil pthread_t thread; 24257a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 24267a42bbe4SStefan Weil return 0; 24277a42bbe4SStefan Weil} 2428414f0dabSblueswir1EOF 2429bd00d539SAndreas Färberif compile_prog "" "" ; then 2430bd00d539SAndreas Färber pthread=yes 2431bd00d539SAndreas Färberelse 2432de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 243352166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 2434e5d355d1Saliguori pthread=yes 2435e3c56761SPeter Portante found=no 2436e3c56761SPeter Portante for lib_entry in $LIBS; do 2437e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 2438e3c56761SPeter Portante found=yes 2439e3c56761SPeter Portante break 2440e3c56761SPeter Portante fi 2441e3c56761SPeter Portante done 2442e3c56761SPeter Portante if test "$found" = "no"; then 24435572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 2444e3c56761SPeter Portante fi 2445de65fe0fSSebastian Herbszt break 2446414f0dabSblueswir1 fi 2447de65fe0fSSebastian Herbszt done 2448bd00d539SAndreas Färberfi 2449414f0dabSblueswir1 24504617e593SAnthony Liguoriif test "$mingw32" != yes -a "$pthread" = no; then 245176ad07a4SPeter Maydell error_exit "pthread check failed" \ 245276ad07a4SPeter Maydell "Make sure to have the pthread libs and headers installed." 2453e5d355d1Saliguorifi 2454e5d355d1Saliguori 2455bf9298b9Saliguori########################################## 2456f27aaf4bSChristian Brunner# rbd probe 2457f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 2458f27aaf4bSChristian Brunner cat > $TMPC <<EOF 2459f27aaf4bSChristian Brunner#include <stdio.h> 2460ad32e9c0SJosh Durgin#include <rbd/librbd.h> 2461f27aaf4bSChristian Brunnerint main(void) { 2462ad32e9c0SJosh Durgin rados_t cluster; 2463ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 2464f27aaf4bSChristian Brunner return 0; 2465f27aaf4bSChristian Brunner} 2466f27aaf4bSChristian BrunnerEOF 2467ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 2468f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 2469f27aaf4bSChristian Brunner rbd=yes 2470f27aaf4bSChristian Brunner libs_tools="$rbd_libs $libs_tools" 2471f27aaf4bSChristian Brunner libs_softmmu="$rbd_libs $libs_softmmu" 2472f27aaf4bSChristian Brunner else 2473f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 2474f27aaf4bSChristian Brunner feature_not_found "rados block device" 2475f27aaf4bSChristian Brunner fi 2476f27aaf4bSChristian Brunner rbd=no 2477f27aaf4bSChristian Brunner fi 2478f27aaf4bSChristian Brunnerfi 2479f27aaf4bSChristian Brunner 2480f27aaf4bSChristian Brunner########################################## 24810a12ec87SRichard W.M. Jones# libssh2 probe 24824fc16838SRichard W.M. Jonesmin_libssh2_version=1.2.8 24830a12ec87SRichard W.M. Jonesif test "$libssh2" != "no" ; then 248465d5d3f9SStefan Weil if $pkg_config --atleast-version=$min_libssh2_version libssh2; then 24850a12ec87SRichard W.M. Jones libssh2_cflags=`$pkg_config libssh2 --cflags` 24860a12ec87SRichard W.M. Jones libssh2_libs=`$pkg_config libssh2 --libs` 24870a12ec87SRichard W.M. Jones libssh2=yes 24880a12ec87SRichard W.M. Jones libs_tools="$libssh2_libs $libs_tools" 24890a12ec87SRichard W.M. Jones libs_softmmu="$libssh2_libs $libs_softmmu" 24900a12ec87SRichard W.M. Jones QEMU_CFLAGS="$QEMU_CFLAGS $libssh2_cflags" 24910a12ec87SRichard W.M. Jones else 24920a12ec87SRichard W.M. Jones if test "$libssh2" = "yes" ; then 24934fc16838SRichard W.M. Jones error_exit "libssh2 >= $min_libssh2_version required for --enable-libssh2" 24940a12ec87SRichard W.M. Jones fi 24950a12ec87SRichard W.M. Jones libssh2=no 24960a12ec87SRichard W.M. Jones fi 24970a12ec87SRichard W.M. Jonesfi 24980a12ec87SRichard W.M. Jones 24990a12ec87SRichard W.M. Jones########################################## 25009a2d462eSRichard W.M. Jones# libssh2_sftp_fsync probe 25019a2d462eSRichard W.M. Jones 25029a2d462eSRichard W.M. Jonesif test "$libssh2" = "yes"; then 25039a2d462eSRichard W.M. Jones cat > $TMPC <<EOF 25049a2d462eSRichard W.M. Jones#include <stdio.h> 25059a2d462eSRichard W.M. Jones#include <libssh2.h> 25069a2d462eSRichard W.M. Jones#include <libssh2_sftp.h> 25079a2d462eSRichard W.M. Jonesint main(void) { 25089a2d462eSRichard W.M. Jones LIBSSH2_SESSION *session; 25099a2d462eSRichard W.M. Jones LIBSSH2_SFTP *sftp; 25109a2d462eSRichard W.M. Jones LIBSSH2_SFTP_HANDLE *sftp_handle; 25119a2d462eSRichard W.M. Jones session = libssh2_session_init (); 25129a2d462eSRichard W.M. Jones sftp = libssh2_sftp_init (session); 25139a2d462eSRichard W.M. Jones sftp_handle = libssh2_sftp_open (sftp, "/", 0, 0); 25149a2d462eSRichard W.M. Jones libssh2_sftp_fsync (sftp_handle); 25159a2d462eSRichard W.M. Jones return 0; 25169a2d462eSRichard W.M. Jones} 25179a2d462eSRichard W.M. JonesEOF 25189a2d462eSRichard W.M. Jones # libssh2_cflags/libssh2_libs defined in previous test. 25199a2d462eSRichard W.M. Jones if compile_prog "$libssh2_cflags" "$libssh2_libs" ; then 25209a2d462eSRichard W.M. Jones QEMU_CFLAGS="-DHAS_LIBSSH2_SFTP_FSYNC $QEMU_CFLAGS" 25219a2d462eSRichard W.M. Jones fi 25229a2d462eSRichard W.M. Jonesfi 25239a2d462eSRichard W.M. Jones 25249a2d462eSRichard W.M. Jones########################################## 25255c6c3a6cSChristoph Hellwig# linux-aio probe 25265c6c3a6cSChristoph Hellwig 25275c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 25285c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 25295c6c3a6cSChristoph Hellwig#include <libaio.h> 25305c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 2531832ce9c2SScott Wood#include <stddef.h> 25325c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 25335c6c3a6cSChristoph HellwigEOF 25345c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 25355c6c3a6cSChristoph Hellwig linux_aio=yes 2536048d179fSPaul Brook libs_softmmu="$libs_softmmu -laio" 2537048d179fSPaul Brook libs_tools="$libs_tools -laio" 25385c6c3a6cSChristoph Hellwig else 25395c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 25405c6c3a6cSChristoph Hellwig feature_not_found "linux AIO" 25415c6c3a6cSChristoph Hellwig fi 25423cfcae3cSLuiz Capitulino linux_aio=no 25435c6c3a6cSChristoph Hellwig fi 25445c6c3a6cSChristoph Hellwigfi 25455c6c3a6cSChristoph Hellwig 25465c6c3a6cSChristoph Hellwig########################################## 25473b8acc11SPaolo Bonzini# TPM passthrough is only on x86 Linux 25483b8acc11SPaolo Bonzini 25493b8acc11SPaolo Bonziniif test "$targetos" = Linux && test "$cpu" = i386 -o "$cpu" = x86_64; then 25503b8acc11SPaolo Bonzini tpm_passthrough=$tpm 25513b8acc11SPaolo Bonzinielse 25523b8acc11SPaolo Bonzini tpm_passthrough=no 25533b8acc11SPaolo Bonzinifi 25543b8acc11SPaolo Bonzini 25553b8acc11SPaolo Bonzini########################################## 2556583f6e7bSStefan Hajnoczi# adjust virtio-blk-data-plane based on linux-aio 2557583f6e7bSStefan Hajnoczi 2558583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" -a \ 2559583f6e7bSStefan Hajnoczi "$linux_aio" != "yes" ; then 256076ad07a4SPeter Maydell error_exit "virtio-blk-data-plane requires Linux AIO, please try --enable-linux-aio" 2561583f6e7bSStefan Hajnoczielif test -z "$virtio_blk_data_plane" ; then 2562583f6e7bSStefan Hajnoczi virtio_blk_data_plane=$linux_aio 2563583f6e7bSStefan Hajnoczifi 2564583f6e7bSStefan Hajnoczi 2565583f6e7bSStefan Hajnoczi########################################## 2566758e8e38SVenkateswararao Jujjuri (JV)# attr probe 2567758e8e38SVenkateswararao Jujjuri (JV) 2568758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 2569758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 2570758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 2571758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 2572f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 2573f2338fb4SPavel Borzenkov#include <attr/xattr.h> 2574f2338fb4SPavel Borzenkov#else 25754f26f2b6SAvi Kivity#include <sys/xattr.h> 2576f2338fb4SPavel Borzenkov#endif 2577758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 2578758e8e38SVenkateswararao Jujjuri (JV)EOF 25794f26f2b6SAvi Kivity if compile_prog "" "" ; then 25804f26f2b6SAvi Kivity attr=yes 25814f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 2582f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 2583758e8e38SVenkateswararao Jujjuri (JV) attr=yes 2584758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 25854f26f2b6SAvi Kivity libattr=yes 2586758e8e38SVenkateswararao Jujjuri (JV) else 2587758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 2588758e8e38SVenkateswararao Jujjuri (JV) feature_not_found "ATTR" 2589758e8e38SVenkateswararao Jujjuri (JV) fi 2590758e8e38SVenkateswararao Jujjuri (JV) attr=no 2591758e8e38SVenkateswararao Jujjuri (JV) fi 2592758e8e38SVenkateswararao Jujjuri (JV)fi 2593758e8e38SVenkateswararao Jujjuri (JV) 2594758e8e38SVenkateswararao Jujjuri (JV)########################################## 2595bf9298b9Saliguori# iovec probe 2596bf9298b9Saliguoricat > $TMPC <<EOF 2597db34f0b3Sblueswir1#include <sys/types.h> 2598bf9298b9Saliguori#include <sys/uio.h> 2599db34f0b3Sblueswir1#include <unistd.h> 2600f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 2601bf9298b9SaliguoriEOF 2602bf9298b9Saliguoriiovec=no 260352166aa0SJuan Quintelaif compile_prog "" "" ; then 2604bf9298b9Saliguori iovec=yes 2605bf9298b9Saliguorifi 2606bf9298b9Saliguori 2607f652e6afSaurel32########################################## 2608ceb42de8Saliguori# preadv probe 2609ceb42de8Saliguoricat > $TMPC <<EOF 2610ceb42de8Saliguori#include <sys/types.h> 2611ceb42de8Saliguori#include <sys/uio.h> 2612ceb42de8Saliguori#include <unistd.h> 2613c075a723SBlue Swirlint main(void) { return preadv(0, 0, 0, 0); } 2614ceb42de8SaliguoriEOF 2615ceb42de8Saliguoripreadv=no 261652166aa0SJuan Quintelaif compile_prog "" "" ; then 2617ceb42de8Saliguori preadv=yes 2618ceb42de8Saliguorifi 2619ceb42de8Saliguori 2620ceb42de8Saliguori########################################## 2621f652e6afSaurel32# fdt probe 2622e169e1e1SPeter Maydell# fdt support is mandatory for at least some target architectures, 2623e169e1e1SPeter Maydell# so insist on it if we're building those system emulators. 2624e169e1e1SPeter Maydellfdt_required=no 2625e169e1e1SPeter Maydellfor target in $target_list; do 2626e169e1e1SPeter Maydell case $target in 26276a49fa95SAlexander Graf aarch64*-softmmu|arm*-softmmu|ppc*-softmmu|microblaze*-softmmu) 2628e169e1e1SPeter Maydell fdt_required=yes 2629e169e1e1SPeter Maydell ;; 2630e169e1e1SPeter Maydell esac 2631e169e1e1SPeter Maydelldone 2632e169e1e1SPeter Maydell 2633e169e1e1SPeter Maydellif test "$fdt_required" = "yes"; then 2634e169e1e1SPeter Maydell if test "$fdt" = "no"; then 2635e169e1e1SPeter Maydell error_exit "fdt disabled but some requested targets require it." \ 2636e169e1e1SPeter Maydell "You can turn off fdt only if you also disable all the system emulation" \ 2637e169e1e1SPeter Maydell "targets which need it (by specifying a cut down --target-list)." 2638e169e1e1SPeter Maydell fi 2639e169e1e1SPeter Maydell fdt=yes 2640e169e1e1SPeter Maydellfi 2641e169e1e1SPeter Maydell 26422df87df7SJuan Quintelaif test "$fdt" != "no" ; then 2643b41af4baSJuan Quintela fdt_libs="-lfdt" 264496ce6545SPeter Crosthwaite # explicitly check for libfdt_env.h as it is missing in some stable installs 2645f652e6afSaurel32 cat > $TMPC << EOF 264696ce6545SPeter Crosthwaite#include <libfdt_env.h> 2647f652e6afSaurel32int main(void) { return 0; } 2648f652e6afSaurel32EOF 264952166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 2650a540f158SPeter Crosthwaite # system DTC is good - use it 2651f652e6afSaurel32 fdt=yes 2652a540f158SPeter Crosthwaite elif test -d ${source_path}/dtc/libfdt ; then 2653a540f158SPeter Crosthwaite # have submodule DTC - use it 2654a540f158SPeter Crosthwaite fdt=yes 2655a540f158SPeter Crosthwaite dtc_internal="yes" 2656a540f158SPeter Crosthwaite mkdir -p dtc 2657a540f158SPeter Crosthwaite if [ "$source_path" != `pwd` ] ; then 2658a540f158SPeter Crosthwaite symlink "$source_path/dtc/Makefile" "dtc/Makefile" 2659a540f158SPeter Crosthwaite symlink "$source_path/dtc/scripts" "dtc/scripts" 26602df87df7SJuan Quintela fi 2661a540f158SPeter Crosthwaite fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt" 2662a540f158SPeter Crosthwaite fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs" 2663a540f158SPeter Crosthwaite elif test "$fdt" = "yes" ; then 2664a540f158SPeter Crosthwaite # have neither and want - prompt for system/submodule install 2665f2c4ddd9SAndreas Färber error_exit "DTC not present. Your options:" \ 2666a540f158SPeter Crosthwaite " (1) Preferred: Install the DTC devel package" \ 2667a540f158SPeter Crosthwaite " (2) Fetch the DTC submodule, using:" \ 2668a540f158SPeter Crosthwaite " git submodule update --init dtc" 2669a540f158SPeter Crosthwaite else 2670a540f158SPeter Crosthwaite # don't have and don't want 2671de3a354aSMichael Walle fdt_libs= 26722df87df7SJuan Quintela fdt=no 2673f652e6afSaurel32 fi 2674f652e6afSaurel32fi 2675f652e6afSaurel32 2676a540f158SPeter Crosthwaitelibs_softmmu="$libs_softmmu $fdt_libs" 2677a540f158SPeter Crosthwaite 267820ff075bSMichael Walle########################################## 2679b1e5fff4SMichael Walle# GLX probe, used by milkymist-tmu2 2680b1e5fff4SMichael Walleif test "$glx" != "no" ; then 2681b1e5fff4SMichael Walle glx_libs="-lGL -lX11" 268220ff075bSMichael Walle cat > $TMPC << EOF 268320ff075bSMichael Walle#include <X11/Xlib.h> 268420ff075bSMichael Walle#include <GL/gl.h> 268520ff075bSMichael Walle#include <GL/glx.h> 2686d3fcbb16SMichael Walleint main(void) { glBegin(0); glXQueryVersion(0,0,0); return 0; } 268720ff075bSMichael WalleEOF 2688d3fcbb16SMichael Walle if compile_prog "" "-lGL -lX11" ; then 2689b1e5fff4SMichael Walle glx=yes 269020ff075bSMichael Walle else 2691b1e5fff4SMichael Walle if test "$glx" = "yes" ; then 2692b1e5fff4SMichael Walle feature_not_found "glx" 269320ff075bSMichael Walle fi 2694b1e5fff4SMichael Walle glx_libs= 2695b1e5fff4SMichael Walle glx=no 269620ff075bSMichael Walle fi 269720ff075bSMichael Wallefi 269820ff075bSMichael Walle 2699eb100396SBharata B Rao########################################## 2700eb100396SBharata B Rao# glusterfs probe 2701eb100396SBharata B Raoif test "$glusterfs" != "no" ; then 270265d5d3f9SStefan Weil if $pkg_config --atleast-version=3 glusterfs-api; then 2703e01bee08SBharata B Rao glusterfs="yes" 2704ca871ec8SStefan Weil glusterfs_cflags=`$pkg_config --cflags glusterfs-api` 2705ca871ec8SStefan Weil glusterfs_libs=`$pkg_config --libs glusterfs-api` 2706e01bee08SBharata B Rao CFLAGS="$CFLAGS $glusterfs_cflags" 2707eb100396SBharata B Rao libs_tools="$glusterfs_libs $libs_tools" 2708eb100396SBharata B Rao libs_softmmu="$glusterfs_libs $libs_softmmu" 270965d5d3f9SStefan Weil if $pkg_config --atleast-version=5 glusterfs-api; then 27100c14fb47SBharata B Rao glusterfs_discard="yes" 27110c14fb47SBharata B Rao fi 27127c815372SBharata B Rao if $pkg_config --atleast-version=6 glusterfs-api; then 27137c815372SBharata B Rao glusterfs_zerofill="yes" 27147c815372SBharata B Rao fi 2715eb100396SBharata B Rao else 2716eb100396SBharata B Rao if test "$glusterfs" = "yes" ; then 2717eb100396SBharata B Rao feature_not_found "GlusterFS backend support" 2718eb100396SBharata B Rao fi 2719e01bee08SBharata B Rao glusterfs="no" 2720eb100396SBharata B Rao fi 2721eb100396SBharata B Raofi 2722eb100396SBharata B Rao 272339386ac7Saurel32# Check for inotify functions when we are building linux-user 27243b3f24adSaurel32# emulator. This is done because older glibc versions don't 27253b3f24adSaurel32# have syscall stubs for these implemented. In that case we 27263b3f24adSaurel32# don't provide them even if kernel supports them. 27273b3f24adSaurel32# 27283b3f24adSaurel32inotify=no 27293b3f24adSaurel32cat > $TMPC << EOF 27303b3f24adSaurel32#include <sys/inotify.h> 27313b3f24adSaurel32 27323b3f24adSaurel32int 27333b3f24adSaurel32main(void) 27343b3f24adSaurel32{ 27353b3f24adSaurel32 /* try to start inotify */ 27368690e420Saurel32 return inotify_init(); 27373b3f24adSaurel32} 27383b3f24adSaurel32EOF 273952166aa0SJuan Quintelaif compile_prog "" "" ; then 27403b3f24adSaurel32 inotify=yes 27413b3f24adSaurel32fi 27423b3f24adSaurel32 2743c05c7a73SRiku Voipioinotify1=no 2744c05c7a73SRiku Voipiocat > $TMPC << EOF 2745c05c7a73SRiku Voipio#include <sys/inotify.h> 2746c05c7a73SRiku Voipio 2747c05c7a73SRiku Voipioint 2748c05c7a73SRiku Voipiomain(void) 2749c05c7a73SRiku Voipio{ 2750c05c7a73SRiku Voipio /* try to start inotify */ 2751c05c7a73SRiku Voipio return inotify_init1(0); 2752c05c7a73SRiku Voipio} 2753c05c7a73SRiku VoipioEOF 2754c05c7a73SRiku Voipioif compile_prog "" "" ; then 2755c05c7a73SRiku Voipio inotify1=yes 2756c05c7a73SRiku Voipiofi 2757c05c7a73SRiku Voipio 2758ebc996f3SRiku Voipio# check if utimensat and futimens are supported 2759ebc996f3SRiku Voipioutimens=no 2760ebc996f3SRiku Voipiocat > $TMPC << EOF 2761ebc996f3SRiku Voipio#define _ATFILE_SOURCE 2762ebc996f3SRiku Voipio#include <stddef.h> 2763ebc996f3SRiku Voipio#include <fcntl.h> 27643014ee00SPeter Maydell#include <sys/stat.h> 2765ebc996f3SRiku Voipio 2766ebc996f3SRiku Voipioint main(void) 2767ebc996f3SRiku Voipio{ 2768ebc996f3SRiku Voipio utimensat(AT_FDCWD, "foo", NULL, 0); 2769ebc996f3SRiku Voipio futimens(0, NULL); 2770ebc996f3SRiku Voipio return 0; 2771ebc996f3SRiku Voipio} 2772ebc996f3SRiku VoipioEOF 277352166aa0SJuan Quintelaif compile_prog "" "" ; then 2774ebc996f3SRiku Voipio utimens=yes 2775ebc996f3SRiku Voipiofi 2776ebc996f3SRiku Voipio 2777099d6b0fSRiku Voipio# check if pipe2 is there 2778099d6b0fSRiku Voipiopipe2=no 2779099d6b0fSRiku Voipiocat > $TMPC << EOF 2780099d6b0fSRiku Voipio#include <unistd.h> 2781099d6b0fSRiku Voipio#include <fcntl.h> 2782099d6b0fSRiku Voipio 2783099d6b0fSRiku Voipioint main(void) 2784099d6b0fSRiku Voipio{ 2785099d6b0fSRiku Voipio int pipefd[2]; 27869bca8162SBruce Rogers return pipe2(pipefd, O_CLOEXEC); 2787099d6b0fSRiku Voipio} 2788099d6b0fSRiku VoipioEOF 278952166aa0SJuan Quintelaif compile_prog "" "" ; then 2790099d6b0fSRiku Voipio pipe2=yes 2791099d6b0fSRiku Voipiofi 2792099d6b0fSRiku Voipio 279340ff6d7eSKevin Wolf# check if accept4 is there 279440ff6d7eSKevin Wolfaccept4=no 279540ff6d7eSKevin Wolfcat > $TMPC << EOF 279640ff6d7eSKevin Wolf#include <sys/socket.h> 279740ff6d7eSKevin Wolf#include <stddef.h> 279840ff6d7eSKevin Wolf 279940ff6d7eSKevin Wolfint main(void) 280040ff6d7eSKevin Wolf{ 280140ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 280240ff6d7eSKevin Wolf return 0; 280340ff6d7eSKevin Wolf} 280440ff6d7eSKevin WolfEOF 280540ff6d7eSKevin Wolfif compile_prog "" "" ; then 280640ff6d7eSKevin Wolf accept4=yes 280740ff6d7eSKevin Wolffi 280840ff6d7eSKevin Wolf 28093ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 28103ce34dfbSvibisreenivasansplice=no 28113ce34dfbSvibisreenivasancat > $TMPC << EOF 28123ce34dfbSvibisreenivasan#include <unistd.h> 28133ce34dfbSvibisreenivasan#include <fcntl.h> 28143ce34dfbSvibisreenivasan#include <limits.h> 28153ce34dfbSvibisreenivasan 28163ce34dfbSvibisreenivasanint main(void) 28173ce34dfbSvibisreenivasan{ 281866ea0f22SStefan Weil int len, fd = 0; 28193ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 28203ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 28213ce34dfbSvibisreenivasan return 0; 28223ce34dfbSvibisreenivasan} 28233ce34dfbSvibisreenivasanEOF 282452166aa0SJuan Quintelaif compile_prog "" "" ; then 28253ce34dfbSvibisreenivasan splice=yes 28263ce34dfbSvibisreenivasanfi 28273ce34dfbSvibisreenivasan 2828dcc38d1cSMarcelo Tosatti########################################## 2829dcc38d1cSMarcelo Tosatti# signalfd probe 2830dcc38d1cSMarcelo Tosattisignalfd="no" 2831dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 2832dcc38d1cSMarcelo Tosatti#include <unistd.h> 2833dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 2834dcc38d1cSMarcelo Tosatti#include <signal.h> 2835dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 2836dcc38d1cSMarcelo TosattiEOF 2837dcc38d1cSMarcelo Tosatti 2838dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 2839dcc38d1cSMarcelo Tosatti signalfd=yes 2840dcc38d1cSMarcelo Tosattifi 2841dcc38d1cSMarcelo Tosatti 2842c2882b96SRiku Voipio# check if eventfd is supported 2843c2882b96SRiku Voipioeventfd=no 2844c2882b96SRiku Voipiocat > $TMPC << EOF 2845c2882b96SRiku Voipio#include <sys/eventfd.h> 2846c2882b96SRiku Voipio 2847c2882b96SRiku Voipioint main(void) 2848c2882b96SRiku Voipio{ 284955cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 2850c2882b96SRiku Voipio} 2851c2882b96SRiku VoipioEOF 2852c2882b96SRiku Voipioif compile_prog "" "" ; then 2853c2882b96SRiku Voipio eventfd=yes 2854c2882b96SRiku Voipiofi 2855c2882b96SRiku Voipio 2856d0927938SUlrich Hecht# check for fallocate 2857d0927938SUlrich Hechtfallocate=no 2858d0927938SUlrich Hechtcat > $TMPC << EOF 2859d0927938SUlrich Hecht#include <fcntl.h> 2860d0927938SUlrich Hecht 2861d0927938SUlrich Hechtint main(void) 2862d0927938SUlrich Hecht{ 2863d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 2864d0927938SUlrich Hecht return 0; 2865d0927938SUlrich Hecht} 2866d0927938SUlrich HechtEOF 28678fb03151SPeter Maydellif compile_prog "" "" ; then 2868d0927938SUlrich Hecht fallocate=yes 2869d0927938SUlrich Hechtfi 2870d0927938SUlrich Hecht 28713d4fa43eSKusanagi Kouichi# check for fallocate hole punching 28723d4fa43eSKusanagi Kouichifallocate_punch_hole=no 28733d4fa43eSKusanagi Kouichicat > $TMPC << EOF 28743d4fa43eSKusanagi Kouichi#include <fcntl.h> 28753d4fa43eSKusanagi Kouichi#include <linux/falloc.h> 28763d4fa43eSKusanagi Kouichi 28773d4fa43eSKusanagi Kouichiint main(void) 28783d4fa43eSKusanagi Kouichi{ 28793d4fa43eSKusanagi Kouichi fallocate(0, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 0); 28803d4fa43eSKusanagi Kouichi return 0; 28813d4fa43eSKusanagi Kouichi} 28823d4fa43eSKusanagi KouichiEOF 28833d4fa43eSKusanagi Kouichiif compile_prog "" "" ; then 28843d4fa43eSKusanagi Kouichi fallocate_punch_hole=yes 28853d4fa43eSKusanagi Kouichifi 28863d4fa43eSKusanagi Kouichi 2887c727f47dSPeter Maydell# check for sync_file_range 2888c727f47dSPeter Maydellsync_file_range=no 2889c727f47dSPeter Maydellcat > $TMPC << EOF 2890c727f47dSPeter Maydell#include <fcntl.h> 2891c727f47dSPeter Maydell 2892c727f47dSPeter Maydellint main(void) 2893c727f47dSPeter Maydell{ 2894c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 2895c727f47dSPeter Maydell return 0; 2896c727f47dSPeter Maydell} 2897c727f47dSPeter MaydellEOF 28988fb03151SPeter Maydellif compile_prog "" "" ; then 2899c727f47dSPeter Maydell sync_file_range=yes 2900c727f47dSPeter Maydellfi 2901c727f47dSPeter Maydell 2902dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 2903dace20dcSPeter Maydellfiemap=no 2904dace20dcSPeter Maydellcat > $TMPC << EOF 2905dace20dcSPeter Maydell#include <sys/ioctl.h> 2906dace20dcSPeter Maydell#include <linux/fs.h> 2907dace20dcSPeter Maydell#include <linux/fiemap.h> 2908dace20dcSPeter Maydell 2909dace20dcSPeter Maydellint main(void) 2910dace20dcSPeter Maydell{ 2911dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 2912dace20dcSPeter Maydell return 0; 2913dace20dcSPeter Maydell} 2914dace20dcSPeter MaydellEOF 29158fb03151SPeter Maydellif compile_prog "" "" ; then 2916dace20dcSPeter Maydell fiemap=yes 2917dace20dcSPeter Maydellfi 2918dace20dcSPeter Maydell 2919d0927938SUlrich Hecht# check for dup3 2920d0927938SUlrich Hechtdup3=no 2921d0927938SUlrich Hechtcat > $TMPC << EOF 2922d0927938SUlrich Hecht#include <unistd.h> 2923d0927938SUlrich Hecht 2924d0927938SUlrich Hechtint main(void) 2925d0927938SUlrich Hecht{ 2926d0927938SUlrich Hecht dup3(0, 0, 0); 2927d0927938SUlrich Hecht return 0; 2928d0927938SUlrich Hecht} 2929d0927938SUlrich HechtEOF 293078f5d726SJan Kiszkaif compile_prog "" "" ; then 2931d0927938SUlrich Hecht dup3=yes 2932d0927938SUlrich Hechtfi 2933d0927938SUlrich Hecht 29344e0c6529SAlex Bligh# check for ppoll support 29354e0c6529SAlex Blighppoll=no 29364e0c6529SAlex Blighcat > $TMPC << EOF 29374e0c6529SAlex Bligh#include <poll.h> 29384e0c6529SAlex Bligh 29394e0c6529SAlex Blighint main(void) 29404e0c6529SAlex Bligh{ 29414e0c6529SAlex Bligh struct pollfd pfd = { .fd = 0, .events = 0, .revents = 0 }; 29424e0c6529SAlex Bligh ppoll(&pfd, 1, 0, 0); 29434e0c6529SAlex Bligh return 0; 29444e0c6529SAlex Bligh} 29454e0c6529SAlex BlighEOF 29464e0c6529SAlex Blighif compile_prog "" "" ; then 29474e0c6529SAlex Bligh ppoll=yes 29484e0c6529SAlex Blighfi 29494e0c6529SAlex Bligh 2950cd758dd0SAlex Bligh# check for prctl(PR_SET_TIMERSLACK , ... ) support 2951cd758dd0SAlex Blighprctl_pr_set_timerslack=no 2952cd758dd0SAlex Blighcat > $TMPC << EOF 2953cd758dd0SAlex Bligh#include <sys/prctl.h> 2954cd758dd0SAlex Bligh 2955cd758dd0SAlex Blighint main(void) 2956cd758dd0SAlex Bligh{ 2957cd758dd0SAlex Bligh prctl(PR_SET_TIMERSLACK, 1, 0, 0, 0); 2958cd758dd0SAlex Bligh return 0; 2959cd758dd0SAlex Bligh} 2960cd758dd0SAlex BlighEOF 2961cd758dd0SAlex Blighif compile_prog "" "" ; then 2962cd758dd0SAlex Bligh prctl_pr_set_timerslack=yes 2963cd758dd0SAlex Blighfi 2964cd758dd0SAlex Bligh 29653b6edd16SPeter Maydell# check for epoll support 29663b6edd16SPeter Maydellepoll=no 29673b6edd16SPeter Maydellcat > $TMPC << EOF 29683b6edd16SPeter Maydell#include <sys/epoll.h> 29693b6edd16SPeter Maydell 29703b6edd16SPeter Maydellint main(void) 29713b6edd16SPeter Maydell{ 29723b6edd16SPeter Maydell epoll_create(0); 29733b6edd16SPeter Maydell return 0; 29743b6edd16SPeter Maydell} 29753b6edd16SPeter MaydellEOF 29768fb03151SPeter Maydellif compile_prog "" "" ; then 29773b6edd16SPeter Maydell epoll=yes 29783b6edd16SPeter Maydellfi 29793b6edd16SPeter Maydell 29803b6edd16SPeter Maydell# epoll_create1 and epoll_pwait are later additions 29813b6edd16SPeter Maydell# so we must check separately for their presence 29823b6edd16SPeter Maydellepoll_create1=no 29833b6edd16SPeter Maydellcat > $TMPC << EOF 29843b6edd16SPeter Maydell#include <sys/epoll.h> 29853b6edd16SPeter Maydell 29863b6edd16SPeter Maydellint main(void) 29873b6edd16SPeter Maydell{ 298819e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 298919e83f6bSPeter Maydell * a function being called. This is necessary so that on 299019e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 299119e83f6bSPeter Maydell * the library but not declared in the header file we will 299219e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 299319e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 299419e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 299519e83f6bSPeter Maydell */ 2996c075a723SBlue Swirl return (int)(uintptr_t)&epoll_create1; 29973b6edd16SPeter Maydell} 29983b6edd16SPeter MaydellEOF 29998fb03151SPeter Maydellif compile_prog "" "" ; then 30003b6edd16SPeter Maydell epoll_create1=yes 30013b6edd16SPeter Maydellfi 30023b6edd16SPeter Maydell 30033b6edd16SPeter Maydellepoll_pwait=no 30043b6edd16SPeter Maydellcat > $TMPC << EOF 30053b6edd16SPeter Maydell#include <sys/epoll.h> 30063b6edd16SPeter Maydell 30073b6edd16SPeter Maydellint main(void) 30083b6edd16SPeter Maydell{ 30093b6edd16SPeter Maydell epoll_pwait(0, 0, 0, 0, 0); 30103b6edd16SPeter Maydell return 0; 30113b6edd16SPeter Maydell} 30123b6edd16SPeter MaydellEOF 30138fb03151SPeter Maydellif compile_prog "" "" ; then 30143b6edd16SPeter Maydell epoll_pwait=yes 30153b6edd16SPeter Maydellfi 30163b6edd16SPeter Maydell 3017a8fd1abaSPeter Maydell# check for sendfile support 3018a8fd1abaSPeter Maydellsendfile=no 3019a8fd1abaSPeter Maydellcat > $TMPC << EOF 3020a8fd1abaSPeter Maydell#include <sys/sendfile.h> 3021a8fd1abaSPeter Maydell 3022a8fd1abaSPeter Maydellint main(void) 3023a8fd1abaSPeter Maydell{ 3024a8fd1abaSPeter Maydell return sendfile(0, 0, 0, 0); 3025a8fd1abaSPeter Maydell} 3026a8fd1abaSPeter MaydellEOF 3027a8fd1abaSPeter Maydellif compile_prog "" "" ; then 3028a8fd1abaSPeter Maydell sendfile=yes 3029a8fd1abaSPeter Maydellfi 3030a8fd1abaSPeter Maydell 3031cc8ae6deSpbrook# Check if tools are available to build documentation. 3032a25dba17SJuan Quintelaif test "$docs" != "no" ; then 303301668d98SStefan Weil if has makeinfo && has pod2man; then 3034a25dba17SJuan Quintela docs=yes 303583a3ab8bSJuan Quintela else 3036a25dba17SJuan Quintela if test "$docs" = "yes" ; then 3037a25dba17SJuan Quintela feature_not_found "docs" 303883a3ab8bSJuan Quintela fi 3039a25dba17SJuan Quintela docs=no 304083a3ab8bSJuan Quintela fi 3041cc8ae6deSpbrookfi 3042cc8ae6deSpbrook 3043f514f41cSStefan Weil# Search for bswap_32 function 30446ae9a1f4SJuan Quintelabyteswap_h=no 30456ae9a1f4SJuan Quintelacat > $TMPC << EOF 30466ae9a1f4SJuan Quintela#include <byteswap.h> 30476ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 30486ae9a1f4SJuan QuintelaEOF 304952166aa0SJuan Quintelaif compile_prog "" "" ; then 30506ae9a1f4SJuan Quintela byteswap_h=yes 30516ae9a1f4SJuan Quintelafi 30526ae9a1f4SJuan Quintela 305375f13596SStefan Weil# Search for bswap32 function 30546ae9a1f4SJuan Quintelabswap_h=no 30556ae9a1f4SJuan Quintelacat > $TMPC << EOF 30566ae9a1f4SJuan Quintela#include <sys/endian.h> 30576ae9a1f4SJuan Quintela#include <sys/types.h> 30586ae9a1f4SJuan Quintela#include <machine/bswap.h> 30596ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 30606ae9a1f4SJuan QuintelaEOF 306152166aa0SJuan Quintelaif compile_prog "" "" ; then 30626ae9a1f4SJuan Quintela bswap_h=yes 30636ae9a1f4SJuan Quintelafi 30646ae9a1f4SJuan Quintela 3065da93a1fdSaliguori########################################## 3066c589b249SRonnie Sahlberg# Do we have libiscsi 3067063c3378SPeter Lieven# We check for iscsi_write16_sync() to make sure we have a 3068063c3378SPeter Lieven# at least version 1.4.0 of libiscsi. 3069c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 3070c589b249SRonnie Sahlberg cat > $TMPC << EOF 3071fa6acb0cSRonnie Sahlberg#include <stdio.h> 3072c589b249SRonnie Sahlberg#include <iscsi/iscsi.h> 3073063c3378SPeter Lievenint main(void) { iscsi_write16_sync(NULL,0,0,NULL,0,0,0,0,0,0,0); return 0; } 3074c589b249SRonnie SahlbergEOF 307565d5d3f9SStefan Weil if $pkg_config --atleast-version=1.7.0 libiscsi; then 30763c33ea96SPaolo Bonzini libiscsi="yes" 3077ca871ec8SStefan Weil libiscsi_cflags=$($pkg_config --cflags libiscsi) 3078ca871ec8SStefan Weil libiscsi_libs=$($pkg_config --libs libiscsi) 30793c33ea96SPaolo Bonzini CFLAGS="$CFLAGS $libiscsi_cflags" 30803c33ea96SPaolo Bonzini LIBS="$LIBS $libiscsi_libs" 30813c33ea96SPaolo Bonzini elif compile_prog "" "-liscsi" ; then 3082c589b249SRonnie Sahlberg libiscsi="yes" 3083c589b249SRonnie Sahlberg LIBS="$LIBS -liscsi" 3084c589b249SRonnie Sahlberg else 3085c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 3086c589b249SRonnie Sahlberg feature_not_found "libiscsi" 3087c589b249SRonnie Sahlberg fi 3088c589b249SRonnie Sahlberg libiscsi="no" 3089c589b249SRonnie Sahlberg fi 3090c589b249SRonnie Sahlbergfi 3091c589b249SRonnie Sahlberg 3092219c2521SStefan Weil# We also need to know the API version because there was an 3093219c2521SStefan Weil# API change from 1.4.0 to 1.5.0. 3094219c2521SStefan Weilif test "$libiscsi" = "yes"; then 3095219c2521SStefan Weil cat >$TMPC <<EOF 3096219c2521SStefan Weil#include <iscsi/iscsi.h> 3097219c2521SStefan Weilint main(void) 3098219c2521SStefan Weil{ 3099219c2521SStefan Weil iscsi_read10_task(0, 0, 0, 0, 0, 0, 0); 3100219c2521SStefan Weil return 0; 3101219c2521SStefan Weil} 3102219c2521SStefan WeilEOF 3103219c2521SStefan Weil if compile_prog "" "-liscsi"; then 3104219c2521SStefan Weil libiscsi_version="1.4.0" 3105219c2521SStefan Weil fi 3106219c2521SStefan Weilfi 3107c589b249SRonnie Sahlberg 3108c589b249SRonnie Sahlberg########################################## 31098bacde8dSNatanael Copa# Do we need libm 31108bacde8dSNatanael Copacat > $TMPC << EOF 31118bacde8dSNatanael Copa#include <math.h> 31128bacde8dSNatanael Copaint main(void) { return isnan(sin(0.0)); } 31138bacde8dSNatanael CopaEOF 31148bacde8dSNatanael Copaif compile_prog "" "" ; then 31158bacde8dSNatanael Copa : 31168bacde8dSNatanael Copaelif compile_prog "" "-lm" ; then 31178bacde8dSNatanael Copa LIBS="-lm $LIBS" 31188bacde8dSNatanael Copa libs_qga="-lm $libs_qga" 31198bacde8dSNatanael Copaelse 312076ad07a4SPeter Maydell error_exit "libm check failed" 31218bacde8dSNatanael Copafi 31228bacde8dSNatanael Copa 31238bacde8dSNatanael Copa########################################## 3124da93a1fdSaliguori# Do we need librt 31258bacde8dSNatanael Copa# uClibc provides 2 versions of clock_gettime(), one with realtime 31268bacde8dSNatanael Copa# support and one without. This means that the clock_gettime() don't 31278bacde8dSNatanael Copa# need -lrt. We still need it for timer_create() so we check for this 31288bacde8dSNatanael Copa# function in addition. 3129da93a1fdSaliguoricat > $TMPC <<EOF 3130da93a1fdSaliguori#include <signal.h> 3131da93a1fdSaliguori#include <time.h> 31328bacde8dSNatanael Copaint main(void) { 31338bacde8dSNatanael Copa timer_create(CLOCK_REALTIME, NULL, NULL); 31348bacde8dSNatanael Copa return clock_gettime(CLOCK_REALTIME, NULL); 31358bacde8dSNatanael Copa} 3136da93a1fdSaliguoriEOF 3137da93a1fdSaliguori 313852166aa0SJuan Quintelaif compile_prog "" "" ; then 313907ffa4bdSJuan Quintela : 31408bacde8dSNatanael Copa# we need pthread for static linking. use previous pthread test result 31418bacde8dSNatanael Copaelif compile_prog "" "-lrt $pthread_lib" ; then 314207ffa4bdSJuan Quintela LIBS="-lrt $LIBS" 31438bacde8dSNatanael Copa libs_qga="-lrt $libs_qga" 3144da93a1fdSaliguorifi 3145da93a1fdSaliguori 314631ff504dSBlue Swirlif test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ 3147179cf400SAndreas Färber "$aix" != "yes" -a "$haiku" != "yes" ; then 31486362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 31496362a53fSJuan Quintelafi 31506362a53fSJuan Quintela 3151de5071c5SBlue Swirl########################################## 3152cd4ec0b4SGerd Hoffmann# spice probe 3153cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 3154cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 3155cd4ec0b4SGerd Hoffmann#include <spice.h> 3156cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 3157cd4ec0b4SGerd HoffmannEOF 3158710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 3159710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 316065d5d3f9SStefan Weil if $pkg_config --atleast-version=0.12.0 spice-server && \ 316165d5d3f9SStefan Weil $pkg_config --atleast-version=0.12.3 spice-protocol && \ 3162cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 3163cd4ec0b4SGerd Hoffmann spice="yes" 3164cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 3165cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 31662e0e3c39SAlon Levy spice_protocol_version=$($pkg_config --modversion spice-protocol) 31672e0e3c39SAlon Levy spice_server_version=$($pkg_config --modversion spice-server) 3168cd4ec0b4SGerd Hoffmann else 3169cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 3170cd4ec0b4SGerd Hoffmann feature_not_found "spice" 3171cd4ec0b4SGerd Hoffmann fi 3172cd4ec0b4SGerd Hoffmann spice="no" 3173cd4ec0b4SGerd Hoffmann fi 3174cd4ec0b4SGerd Hoffmannfi 3175cd4ec0b4SGerd Hoffmann 3176111a38b0SRobert Relyea# check for libcacard for smartcard support 3177111a38b0SRobert Relyeasmartcard_cflags="" 3178111a38b0SRobert Relyea# TODO - what's the minimal nss version we support? 3179111a38b0SRobert Relyeaif test "$smartcard_nss" != "no"; then 31805f01e06fSSergei Trofimovich cat > $TMPC << EOF 31815f01e06fSSergei Trofimovich#include <pk11pub.h> 31825f01e06fSSergei Trofimovichint main(void) { PK11_FreeSlot(0); return 0; } 31835f01e06fSSergei TrofimovichEOF 31840b22ef0fSPeter Maydell smartcard_includes="-I\$(SRC_PATH)/libcacard" 31858c741c22SAlon Levy libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" 31868c741c22SAlon Levy libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" 31876ca026cbSPeter Maydell test_cflags="$libcacard_cflags" 31886ca026cbSPeter Maydell # The header files in nss < 3.13.3 have a bug which causes them to 31896ca026cbSPeter Maydell # emit a warning. If we're going to compile QEMU with -Werror, then 31906ca026cbSPeter Maydell # test that the headers don't have this bug. Otherwise we would pass 31916ca026cbSPeter Maydell # the configure test but fail to compile QEMU later. 31926ca026cbSPeter Maydell if test "$werror" = "yes"; then 31936ca026cbSPeter Maydell test_cflags="-Werror $test_cflags" 31946ca026cbSPeter Maydell fi 3195b6fc675bSPaolo Bonzini if test -n "$libtool" && 319665d5d3f9SStefan Weil $pkg_config --atleast-version=3.12.8 nss && \ 31976ca026cbSPeter Maydell compile_prog "$test_cflags" "$libcacard_libs"; then 31985f01e06fSSergei Trofimovich smartcard_nss="yes" 31990b22ef0fSPeter Maydell QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" 32000b22ef0fSPeter Maydell QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" 3201ad4cf3f6SPaul Brook libs_softmmu="$libcacard_libs $libs_softmmu" 3202111a38b0SRobert Relyea else 3203111a38b0SRobert Relyea if test "$smartcard_nss" = "yes"; then 3204111a38b0SRobert Relyea feature_not_found "nss" 3205111a38b0SRobert Relyea fi 3206111a38b0SRobert Relyea smartcard_nss="no" 3207111a38b0SRobert Relyea fi 3208111a38b0SRobert Relyeafi 3209111a38b0SRobert Relyea 32102b2325ffSGerd Hoffmann# check for libusb 32112b2325ffSGerd Hoffmannif test "$libusb" != "no" ; then 321265d5d3f9SStefan Weil if $pkg_config --atleast-version=1.0.13 libusb-1.0; then 32132b2325ffSGerd Hoffmann libusb="yes" 3214ca871ec8SStefan Weil libusb_cflags=$($pkg_config --cflags libusb-1.0) 3215ca871ec8SStefan Weil libusb_libs=$($pkg_config --libs libusb-1.0) 32162b2325ffSGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $libusb_cflags" 32172b2325ffSGerd Hoffmann libs_softmmu="$libs_softmmu $libusb_libs" 32182b2325ffSGerd Hoffmann else 32192b2325ffSGerd Hoffmann if test "$libusb" = "yes"; then 32202b2325ffSGerd Hoffmann feature_not_found "libusb" 32212b2325ffSGerd Hoffmann fi 32222b2325ffSGerd Hoffmann libusb="no" 32232b2325ffSGerd Hoffmann fi 32242b2325ffSGerd Hoffmannfi 32252b2325ffSGerd Hoffmann 322669354a83SHans de Goede# check for usbredirparser for usb network redirection support 322769354a83SHans de Goedeif test "$usb_redir" != "no" ; then 322865d5d3f9SStefan Weil if $pkg_config --atleast-version=0.6 libusbredirparser-0.5; then 322969354a83SHans de Goede usb_redir="yes" 3230ca871ec8SStefan Weil usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5) 3231ca871ec8SStefan Weil usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5) 323269354a83SHans de Goede QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" 323356ab2ad1SAurelien Jarno libs_softmmu="$libs_softmmu $usb_redir_libs" 323469354a83SHans de Goede else 323569354a83SHans de Goede if test "$usb_redir" = "yes"; then 323669354a83SHans de Goede feature_not_found "usb-redir" 323769354a83SHans de Goede fi 323869354a83SHans de Goede usb_redir="no" 323969354a83SHans de Goede fi 324069354a83SHans de Goedefi 324169354a83SHans de Goede 3242cd4ec0b4SGerd Hoffmann########################################## 3243d9840e25STomoki Sekiyama# check if we have VSS SDK headers for win 3244d9840e25STomoki Sekiyama 3245d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$vss_win32_sdk" != "no" ; then 3246d9840e25STomoki Sekiyama case "$vss_win32_sdk" in 3247d9840e25STomoki Sekiyama "") vss_win32_include="-I$source_path" ;; 3248d9840e25STomoki Sekiyama *\ *) # The SDK is installed in "Program Files" by default, but we cannot 3249d9840e25STomoki Sekiyama # handle path with spaces. So we symlink the headers into ".sdk/vss". 3250d9840e25STomoki Sekiyama vss_win32_include="-I$source_path/.sdk/vss" 3251d9840e25STomoki Sekiyama symlink "$vss_win32_sdk/inc" "$source_path/.sdk/vss/inc" 3252d9840e25STomoki Sekiyama ;; 3253d9840e25STomoki Sekiyama *) vss_win32_include="-I$vss_win32_sdk" 3254d9840e25STomoki Sekiyama esac 3255d9840e25STomoki Sekiyama cat > $TMPC << EOF 3256d9840e25STomoki Sekiyama#define __MIDL_user_allocate_free_DEFINED__ 3257d9840e25STomoki Sekiyama#include <inc/win2003/vss.h> 3258d9840e25STomoki Sekiyamaint main(void) { return VSS_CTX_BACKUP; } 3259d9840e25STomoki SekiyamaEOF 3260d9840e25STomoki Sekiyama if compile_prog "$vss_win32_include" "" ; then 3261d9840e25STomoki Sekiyama guest_agent_with_vss="yes" 3262d9840e25STomoki Sekiyama QEMU_CFLAGS="$QEMU_CFLAGS $vss_win32_include" 3263d9840e25STomoki Sekiyama libs_qga="-lole32 -loleaut32 -lshlwapi -luuid -lstdc++ -Wl,--enable-stdcall-fixup $libs_qga" 3264d9840e25STomoki Sekiyama else 3265d9840e25STomoki Sekiyama if test "$vss_win32_sdk" != "" ; then 3266d9840e25STomoki Sekiyama echo "ERROR: Please download and install Microsoft VSS SDK:" 3267d9840e25STomoki Sekiyama echo "ERROR: http://www.microsoft.com/en-us/download/details.aspx?id=23490" 3268d9840e25STomoki Sekiyama echo "ERROR: On POSIX-systems, you can extract the SDK headers by:" 3269d9840e25STomoki Sekiyama echo "ERROR: scripts/extract-vsssdk-headers setup.exe" 3270d9840e25STomoki Sekiyama echo "ERROR: The headers are extracted in the directory \`inc'." 3271d9840e25STomoki Sekiyama feature_not_found "VSS support" 3272d9840e25STomoki Sekiyama fi 3273d9840e25STomoki Sekiyama guest_agent_with_vss="no" 3274d9840e25STomoki Sekiyama fi 3275d9840e25STomoki Sekiyamafi 3276d9840e25STomoki Sekiyama 3277d9840e25STomoki Sekiyama########################################## 3278d9840e25STomoki Sekiyama# lookup Windows platform SDK (if not specified) 3279d9840e25STomoki Sekiyama# The SDK is needed only to build .tlb (type library) file of guest agent 3280d9840e25STomoki Sekiyama# VSS provider from the source. It is usually unnecessary because the 3281d9840e25STomoki Sekiyama# pre-compiled .tlb file is included. 3282d9840e25STomoki Sekiyama 3283d9840e25STomoki Sekiyamaif test "$mingw32" = "yes" -a "$guest_agent" != "no" -a "$guest_agent_with_vss" = "yes" ; then 3284d9840e25STomoki Sekiyama if test -z "$win_sdk"; then 3285d9840e25STomoki Sekiyama programfiles="$PROGRAMFILES" 3286d9840e25STomoki Sekiyama test -n "$PROGRAMW6432" && programfiles="$PROGRAMW6432" 3287d9840e25STomoki Sekiyama if test -n "$programfiles"; then 3288d9840e25STomoki Sekiyama win_sdk=$(ls -d "$programfiles/Microsoft SDKs/Windows/v"* | tail -1) 2>/dev/null 3289d9840e25STomoki Sekiyama else 3290d9840e25STomoki Sekiyama feature_not_found "Windows SDK" 3291d9840e25STomoki Sekiyama fi 3292d9840e25STomoki Sekiyama elif test "$win_sdk" = "no"; then 3293d9840e25STomoki Sekiyama win_sdk="" 3294d9840e25STomoki Sekiyama fi 3295d9840e25STomoki Sekiyamafi 3296d9840e25STomoki Sekiyama 3297d9840e25STomoki Sekiyama########################################## 3298cd4ec0b4SGerd Hoffmann 3299747bbdf7SBlue Swirl########################################## 33005f6b9e8fSBlue Swirl# check if we have fdatasync 33015f6b9e8fSBlue Swirl 33025f6b9e8fSBlue Swirlfdatasync=no 33035f6b9e8fSBlue Swirlcat > $TMPC << EOF 33045f6b9e8fSBlue Swirl#include <unistd.h> 3305d1722a27SAlexandre Raymondint main(void) { 3306d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 3307d1722a27SAlexandre Raymondreturn fdatasync(0); 3308d1722a27SAlexandre Raymond#else 3309e172fe11SStefan Weil#error Not supported 3310d1722a27SAlexandre Raymond#endif 3311d1722a27SAlexandre Raymond} 33125f6b9e8fSBlue SwirlEOF 33135f6b9e8fSBlue Swirlif compile_prog "" "" ; then 33145f6b9e8fSBlue Swirl fdatasync=yes 33155f6b9e8fSBlue Swirlfi 33165f6b9e8fSBlue Swirl 331794a420b1SStefan Hajnoczi########################################## 3318e78815a5SAndreas Färber# check if we have madvise 3319e78815a5SAndreas Färber 3320e78815a5SAndreas Färbermadvise=no 3321e78815a5SAndreas Färbercat > $TMPC << EOF 3322e78815a5SAndreas Färber#include <sys/types.h> 3323e78815a5SAndreas Färber#include <sys/mman.h> 3324832ce9c2SScott Wood#include <stddef.h> 3325e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 3326e78815a5SAndreas FärberEOF 3327e78815a5SAndreas Färberif compile_prog "" "" ; then 3328e78815a5SAndreas Färber madvise=yes 3329e78815a5SAndreas Färberfi 3330e78815a5SAndreas Färber 3331e78815a5SAndreas Färber########################################## 3332e78815a5SAndreas Färber# check if we have posix_madvise 3333e78815a5SAndreas Färber 3334e78815a5SAndreas Färberposix_madvise=no 3335e78815a5SAndreas Färbercat > $TMPC << EOF 3336e78815a5SAndreas Färber#include <sys/mman.h> 3337832ce9c2SScott Wood#include <stddef.h> 3338e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 3339e78815a5SAndreas FärberEOF 3340e78815a5SAndreas Färberif compile_prog "" "" ; then 3341e78815a5SAndreas Färber posix_madvise=yes 3342e78815a5SAndreas Färberfi 3343e78815a5SAndreas Färber 3344e78815a5SAndreas Färber########################################## 33451e9737daSRichard Henderson# check if we have usable SIGEV_THREAD_ID 33461e9737daSRichard Henderson 33471e9737daSRichard Hendersonsigev_thread_id=no 33481e9737daSRichard Hendersoncat > $TMPC << EOF 33491e9737daSRichard Henderson#include <signal.h> 33501e9737daSRichard Hendersonint main(void) { 33511e9737daSRichard Henderson struct sigevent ev; 33521e9737daSRichard Henderson ev.sigev_notify = SIGEV_THREAD_ID; 33531e9737daSRichard Henderson ev._sigev_un._tid = 0; 33541e9737daSRichard Henderson asm volatile("" : : "g"(&ev)); 33551e9737daSRichard Henderson return 0; 33561e9737daSRichard Henderson} 33571e9737daSRichard HendersonEOF 33581e9737daSRichard Hendersonif compile_prog "" "" ; then 33591e9737daSRichard Henderson sigev_thread_id=yes 33601e9737daSRichard Hendersonfi 33611e9737daSRichard Henderson 33621e9737daSRichard Henderson########################################## 336394a420b1SStefan Hajnoczi# check if trace backend exists 336494a420b1SStefan Hajnoczi 3365650ab98dSLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null 336694a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 336776ad07a4SPeter Maydell error_exit "invalid trace backend" \ 336876ad07a4SPeter Maydell "Please choose a supported trace backend." 336994a420b1SStefan Hajnoczifi 337094a420b1SStefan Hajnoczi 33717e24e92aSStefan Hajnoczi########################################## 33727e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 33737e24e92aSStefan Hajnocziif test "$trace_backend" = "ust"; then 33747e24e92aSStefan Hajnoczi cat > $TMPC << EOF 33757e24e92aSStefan Hajnoczi#include <ust/tracepoint.h> 33767e24e92aSStefan Hajnoczi#include <ust/marker.h> 33777e24e92aSStefan Hajnocziint main(void) { return 0; } 33787e24e92aSStefan HajnocziEOF 33797e24e92aSStefan Hajnoczi if compile_prog "" "" ; then 338094b4fefaSLluís Vilanova LIBS="-lust -lurcu-bp $LIBS" 3381c9a2e37cSLluís Vilanova libs_qga="-lust -lurcu-bp $libs_qga" 33827e24e92aSStefan Hajnoczi else 338376ad07a4SPeter Maydell error_exit "Trace backend 'ust' missing libust header files" 33847e24e92aSStefan Hajnoczi fi 33857e24e92aSStefan Hajnoczifi 3386b3d08c02SDaniel P. Berrange 3387b3d08c02SDaniel P. Berrange########################################## 3388b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 3389b3d08c02SDaniel P. Berrangeif test "$trace_backend" = "dtrace"; then 3390b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 339176ad07a4SPeter Maydell error_exit "dtrace command is not found in PATH $PATH" 3392b3d08c02SDaniel P. Berrange fi 3393c276b17dSDaniel P. Berrange trace_backend_stap="no" 3394c276b17dSDaniel P. Berrange if has 'stap' ; then 3395c276b17dSDaniel P. Berrange trace_backend_stap="yes" 3396c276b17dSDaniel P. Berrange fi 3397b3d08c02SDaniel P. Berrangefi 3398b3d08c02SDaniel P. Berrange 33997e24e92aSStefan Hajnoczi########################################## 3400519175a2SAlex Barcelo# check and set a backend for coroutine 3401d0e2fce5SAneesh Kumar K.V 34027c2acc70SPeter Maydell# We prefer ucontext, but it's not always possible. The fallback 34037c2acc70SPeter Maydell# is sigcontext. gthread is not selectable except explicitly, because 34047c2acc70SPeter Maydell# it is not functional enough to run QEMU proper. (It is occasionally 34057c2acc70SPeter Maydell# useful for debugging purposes.) On Windows the only valid backend 34067c2acc70SPeter Maydell# is the Windows-specific one. 34077c2acc70SPeter Maydell 34087c2acc70SPeter Maydellucontext_works=no 3409d0e2fce5SAneesh Kumar K.Vif test "$darwin" != "yes"; then 3410d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 3411d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 3412cdf84806SPeter Maydell#ifdef __stub_makecontext 3413cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 3414cdf84806SPeter Maydell#endif 341575cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 3416d0e2fce5SAneesh Kumar K.VEOF 3417d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 34187c2acc70SPeter Maydell ucontext_works=yes 3419d0e2fce5SAneesh Kumar K.V fi 3420519175a2SAlex Barcelofi 34217c2acc70SPeter Maydell 34227c2acc70SPeter Maydellif test "$coroutine" = ""; then 34237c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 34247c2acc70SPeter Maydell coroutine=win32 34257c2acc70SPeter Maydell elif test "$ucontext_works" = "yes"; then 34267c2acc70SPeter Maydell coroutine=ucontext 3427519175a2SAlex Barcelo else 34287c2acc70SPeter Maydell coroutine=sigaltstack 34297c2acc70SPeter Maydell fi 34307c2acc70SPeter Maydellelse 34317c2acc70SPeter Maydell case $coroutine in 34327c2acc70SPeter Maydell windows) 34337c2acc70SPeter Maydell if test "$mingw32" != "yes"; then 34347c2acc70SPeter Maydell error_exit "'windows' coroutine backend only valid for Windows" 34357c2acc70SPeter Maydell fi 34367c2acc70SPeter Maydell # Unfortunately the user visible backend name doesn't match the 34377c2acc70SPeter Maydell # coroutine-*.c filename for this case, so we have to adjust it here. 34387c2acc70SPeter Maydell coroutine=win32 34397c2acc70SPeter Maydell ;; 34407c2acc70SPeter Maydell ucontext) 34417c2acc70SPeter Maydell if test "$ucontext_works" != "yes"; then 34427c2acc70SPeter Maydell feature_not_found "ucontext" 34437c2acc70SPeter Maydell fi 34447c2acc70SPeter Maydell ;; 34457c2acc70SPeter Maydell gthread|sigaltstack) 34467c2acc70SPeter Maydell if test "$mingw32" = "yes"; then 34477c2acc70SPeter Maydell error_exit "only the 'windows' coroutine backend is valid for Windows" 34487c2acc70SPeter Maydell fi 34497c2acc70SPeter Maydell ;; 34507c2acc70SPeter Maydell *) 345176ad07a4SPeter Maydell error_exit "unknown coroutine backend $coroutine" 34527c2acc70SPeter Maydell ;; 34537c2acc70SPeter Maydell esac 3454d0e2fce5SAneesh Kumar K.Vfi 3455d0e2fce5SAneesh Kumar K.V 345670c60c08SStefan Hajnocziif test "$coroutine_pool" = ""; then 345770c60c08SStefan Hajnoczi if test "$coroutine" = "gthread"; then 345870c60c08SStefan Hajnoczi coroutine_pool=no 345970c60c08SStefan Hajnoczi else 346070c60c08SStefan Hajnoczi coroutine_pool=yes 346170c60c08SStefan Hajnoczi fi 346270c60c08SStefan Hajnoczifi 346370c60c08SStefan Hajnocziif test "$coroutine" = "gthread" -a "$coroutine_pool" = "yes"; then 346470c60c08SStefan Hajnoczi error_exit "'gthread' coroutine backend does not support pool (use --disable-coroutine-pool)" 346570c60c08SStefan Hajnoczifi 346670c60c08SStefan Hajnoczi 3467d0e2fce5SAneesh Kumar K.V########################################## 3468d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 3469d2042378SAneesh Kumar K.V 34704e1797f9SStefan Weilopen_by_handle_at=no 3471d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 3472d2042378SAneesh Kumar K.V#include <fcntl.h> 3473acc55ba8SStefan Weil#if !defined(AT_EMPTY_PATH) 3474acc55ba8SStefan Weil# error missing definition 3475acc55ba8SStefan Weil#else 347675cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 3477acc55ba8SStefan Weil#endif 3478d2042378SAneesh Kumar K.VEOF 3479d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 3480d2042378SAneesh Kumar K.V open_by_handle_at=yes 3481d2042378SAneesh Kumar K.Vfi 3482d2042378SAneesh Kumar K.V 3483e06a765eSHarsh Prateek Bora######################################## 3484e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 3485e06a765eSHarsh Prateek Bora 3486e06a765eSHarsh Prateek Boralinux_magic_h=no 3487e06a765eSHarsh Prateek Boracat > $TMPC << EOF 3488e06a765eSHarsh Prateek Bora#include <linux/magic.h> 3489e06a765eSHarsh Prateek Boraint main(void) { 349075cafad7SStefan Weil return 0; 3491e06a765eSHarsh Prateek Bora} 3492e06a765eSHarsh Prateek BoraEOF 3493e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 3494e06a765eSHarsh Prateek Bora linux_magic_h=yes 3495e06a765eSHarsh Prateek Borafi 3496e06a765eSHarsh Prateek Bora 34978ab1bf12SLuiz Capitulino######################################## 3498c95e3080SKevin Wolf# check whether we can disable warning option with a pragma (this is needed 3499c95e3080SKevin Wolf# to silence warnings in the headers of some versions of external libraries). 3500c95e3080SKevin Wolf# This test has to be compiled with -Werror as otherwise an unknown pragma is 3501c95e3080SKevin Wolf# only a warning. 3502c95e3080SKevin Wolf# 3503c95e3080SKevin Wolf# If we can't selectively disable warning in the code, disable -Werror so that 3504c95e3080SKevin Wolf# the build doesn't fail anyway. 3505c95e3080SKevin Wolf 350606d71fa1SPeter Maydellpragma_disable_unused_but_set=no 350706d71fa1SPeter Maydellcat > $TMPC << EOF 3508e6f53fd5SMarkus Armbruster#pragma GCC diagnostic push 350906d71fa1SPeter Maydell#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 3510c95e3080SKevin Wolf#pragma GCC diagnostic ignored "-Wstrict-prototypes" 3511e6f53fd5SMarkus Armbruster#pragma GCC diagnostic pop 3512c95e3080SKevin Wolf 351306d71fa1SPeter Maydellint main(void) { 351406d71fa1SPeter Maydell return 0; 351506d71fa1SPeter Maydell} 351606d71fa1SPeter MaydellEOF 351706d71fa1SPeter Maydellif compile_prog "-Werror" "" ; then 3518cc6e3ca9SGerd Hoffmann pragma_diagnostic_available=yes 3519c95e3080SKevin Wolfelse 3520c95e3080SKevin Wolf werror=no 352106d71fa1SPeter Maydellfi 352206d71fa1SPeter Maydell 352306d71fa1SPeter Maydell######################################## 352462fe8331SChristian Borntraeger# check if we have valgrind/valgrind.h and valgrind/memcheck.h 35253f4349dcSKevin Wolf 35263f4349dcSKevin Wolfvalgrind_h=no 35273f4349dcSKevin Wolfcat > $TMPC << EOF 35283f4349dcSKevin Wolf#include <valgrind/valgrind.h> 352962fe8331SChristian Borntraeger#include <valgrind/memcheck.h> 35303f4349dcSKevin Wolfint main(void) { 35313f4349dcSKevin Wolf return 0; 35323f4349dcSKevin Wolf} 35333f4349dcSKevin WolfEOF 35343f4349dcSKevin Wolfif compile_prog "" "" ; then 35353f4349dcSKevin Wolf valgrind_h=yes 35363f4349dcSKevin Wolffi 35373f4349dcSKevin Wolf 35383f4349dcSKevin Wolf######################################## 35398ab1bf12SLuiz Capitulino# check if environ is declared 35408ab1bf12SLuiz Capitulino 35418ab1bf12SLuiz Capitulinohas_environ=no 35428ab1bf12SLuiz Capitulinocat > $TMPC << EOF 35438ab1bf12SLuiz Capitulino#include <unistd.h> 35448ab1bf12SLuiz Capitulinoint main(void) { 3545c075a723SBlue Swirl environ = 0; 35468ab1bf12SLuiz Capitulino return 0; 35478ab1bf12SLuiz Capitulino} 35488ab1bf12SLuiz CapitulinoEOF 35498ab1bf12SLuiz Capitulinoif compile_prog "" "" ; then 35508ab1bf12SLuiz Capitulino has_environ=yes 35518ab1bf12SLuiz Capitulinofi 35528ab1bf12SLuiz Capitulino 355376a347e1SRichard Henderson######################################## 355476a347e1SRichard Henderson# check if cpuid.h is usable. 355576a347e1SRichard Henderson 355676a347e1SRichard Hendersoncpuid_h=no 355776a347e1SRichard Hendersoncat > $TMPC << EOF 355876a347e1SRichard Henderson#include <cpuid.h> 355976a347e1SRichard Hendersonint main(void) { 356076a347e1SRichard Henderson return 0; 356176a347e1SRichard Henderson} 356276a347e1SRichard HendersonEOF 356376a347e1SRichard Hendersonif compile_prog "" "" ; then 356476a347e1SRichard Henderson cpuid_h=yes 356576a347e1SRichard Hendersonfi 356676a347e1SRichard Henderson 3567f540166bSRichard Henderson######################################## 3568f540166bSRichard Henderson# check if __[u]int128_t is usable. 3569f540166bSRichard Henderson 3570f540166bSRichard Hendersonint128=no 3571f540166bSRichard Hendersoncat > $TMPC << EOF 3572f540166bSRichard Henderson__int128_t a; 3573f540166bSRichard Henderson__uint128_t b; 3574f540166bSRichard Hendersonint main (void) { 3575f540166bSRichard Henderson a = a + b; 3576f540166bSRichard Henderson b = a * b; 3577464e3671SPeter Maydell a = a * a; 3578f540166bSRichard Henderson return 0; 3579f540166bSRichard Henderson} 3580f540166bSRichard HendersonEOF 3581f540166bSRichard Hendersonif compile_prog "" "" ; then 3582f540166bSRichard Henderson int128=yes 3583f540166bSRichard Hendersonfi 358476a347e1SRichard Henderson 35851e6e9acaSRichard Henderson######################################## 35861e6e9acaSRichard Henderson# check if getauxval is available. 35871e6e9acaSRichard Henderson 35881e6e9acaSRichard Hendersongetauxval=no 35891e6e9acaSRichard Hendersoncat > $TMPC << EOF 35901e6e9acaSRichard Henderson#include <sys/auxv.h> 35911e6e9acaSRichard Hendersonint main(void) { 35921e6e9acaSRichard Henderson return getauxval(AT_HWCAP) == 0; 35931e6e9acaSRichard Henderson} 35941e6e9acaSRichard HendersonEOF 35951e6e9acaSRichard Hendersonif compile_prog "" "" ; then 35961e6e9acaSRichard Henderson getauxval=yes 35971e6e9acaSRichard Hendersonfi 35981e6e9acaSRichard Henderson 3599d2042378SAneesh Kumar K.V########################################## 3600e86ecd4bSJuan Quintela# End of CC checks 3601e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 3602e86ecd4bSJuan Quintela 36031d728c39SBlue Swirlif test "$gcov" = "yes" ; then 36041d728c39SBlue Swirl CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" 36051d728c39SBlue Swirl LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" 36061d728c39SBlue Swirlelif test "$debug" = "no" ; then 3607e600cdf3SMichal Privoznik CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" 3608e86ecd4bSJuan Quintelafi 3609a316e378SJuan Quintela 3610*6542aa9cSPeter Lieven########################################## 3611*6542aa9cSPeter Lieven# Do we have libnfs 3612*6542aa9cSPeter Lievenif test "$libnfs" != "no" ; then 3613*6542aa9cSPeter Lieven if $pkg_config --atleast-version=1.9.2 libnfs; then 3614*6542aa9cSPeter Lieven libnfs="yes" 3615*6542aa9cSPeter Lieven libnfs_libs=$($pkg_config --libs libnfs) 3616*6542aa9cSPeter Lieven LIBS="$LIBS $libnfs_libs" 3617*6542aa9cSPeter Lieven else 3618*6542aa9cSPeter Lieven if test "$libnfs" = "yes" ; then 3619*6542aa9cSPeter Lieven feature_not_found "libnfs" 3620*6542aa9cSPeter Lieven fi 3621*6542aa9cSPeter Lieven libnfs="no" 3622*6542aa9cSPeter Lieven fi 3623*6542aa9cSPeter Lievenfi 36241d728c39SBlue Swirl 362520ff6c80SAnthony Liguori# Disable zero malloc errors for official releases unless explicitly told to 362620ff6c80SAnthony Liguori# enable/disable 362720ff6c80SAnthony Liguoriif test -z "$zero_malloc" ; then 362820ff6c80SAnthony Liguori if test "$z_version" = "50" ; then 362920ff6c80SAnthony Liguori zero_malloc="no" 363020ff6c80SAnthony Liguori else 363120ff6c80SAnthony Liguori zero_malloc="yes" 363220ff6c80SAnthony Liguori fi 363320ff6c80SAnthony Liguorifi 363420ff6c80SAnthony Liguori 36356ca026cbSPeter Maydell# Now we've finished running tests it's OK to add -Werror to the compiler flags 36366ca026cbSPeter Maydellif test "$werror" = "yes"; then 36376ca026cbSPeter Maydell QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 36386ca026cbSPeter Maydellfi 36396ca026cbSPeter Maydell 3640e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 3641e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 36421156c669SJuan Quintela LDFLAGS="-Wl,--warn-common $LDFLAGS" 3643e86ecd4bSJuan Quintela fi 3644e86ecd4bSJuan Quintelafi 3645e86ecd4bSJuan Quintela 364694dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 364794dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 364894dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 364994dd53c5SGerd Hoffmannelse 365094dd53c5SGerd Hoffmann POD2MAN="pod2man" 365194dd53c5SGerd Hoffmannfi 365294dd53c5SGerd Hoffmann 3653952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 3654952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 3655952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 3656952afb71SBlue Swirl if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then 3657952afb71SBlue Swirl LDFLAGS="-Wl,$flag $LDFLAGS" 3658952afb71SBlue Swirl fi 3659952afb71SBlue Swirl done 3660952afb71SBlue Swirlfi 3661952afb71SBlue Swirl 366210ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 3663528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 3664834574eaSAnthony Liguoriqemu_localedir="$datadir/locale" 36655a67135aSbellard 36664b1c11fdSDaniel P. Berrangetools="" 36674b1c11fdSDaniel P. Berrangeif test "$want_tools" = "yes" ; then 3668ca35f780SPaolo Bonzini tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" 36694b1c11fdSDaniel P. Berrange if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 36704b1c11fdSDaniel P. Berrange tools="qemu-nbd\$(EXESUF) $tools" 36714b1c11fdSDaniel P. Berrange fi 36724b1c11fdSDaniel P. Berrangefi 36734b1c11fdSDaniel P. Berrangeif test "$softmmu" = yes ; then 3674983eef5aSMeador Inge if test "$virtfs" != no ; then 3675be5ea8edSAnthony Liguori if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then 3676983eef5aSMeador Inge virtfs=yes 367717bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 3678983eef5aSMeador Inge else 3679983eef5aSMeador Inge if test "$virtfs" = yes; then 368076ad07a4SPeter Maydell error_exit "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" 3681983eef5aSMeador Inge fi 368217500370SAndreas Färber virtfs=no 3683983eef5aSMeador Inge fi 368417bff52bSM. Mohan Kumar fi 3685d138cee9SMichael Rothfi 3686e8ef31a3SMichael Tokarevif [ "$guest_agent" != "no" ]; then 3687b39297aeSTomoki Sekiyama if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then 3688e8ef31a3SMichael Tokarev tools="qemu-ga\$(EXESUF) $tools" 3689b39297aeSTomoki Sekiyama if [ "$mingw32" = "yes" -a "$guest_agent_with_vss" = "yes" ]; then 3690b39297aeSTomoki Sekiyama tools="qga/vss-win32/qga-vss.dll qga/vss-win32/qga-vss.tlb $tools" 3691b39297aeSTomoki Sekiyama fi 3692e8ef31a3SMichael Tokarev guest_agent=yes 3693e8ef31a3SMichael Tokarev elif [ "$guest_agent" != yes ]; then 3694e8ef31a3SMichael Tokarev guest_agent=no 3695e8ef31a3SMichael Tokarev else 3696e8ef31a3SMichael Tokarev error_exit "Guest agent is not supported on this platform" 3697ca35f780SPaolo Bonzini fi 36984b1c11fdSDaniel P. Berrangefi 3699ca35f780SPaolo Bonzini 3700ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 3701ca35f780SPaolo Bonziniroms= 3702ca35f780SPaolo Bonziniif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ 3703ca35f780SPaolo Bonzini "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ 3704ca35f780SPaolo Bonzini "$softmmu" = yes ; then 3705ca35f780SPaolo Bonzini roms="optionrom" 3706ca35f780SPaolo Bonzinifi 3707d0384d1dSAndreas Färberif test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then 370839ac8455SDavid Gibson roms="$roms spapr-rtas" 370939ac8455SDavid Gibsonfi 3710ca35f780SPaolo Bonzini 37119933c305SChristian Borntraegerif test "$cpu" = "s390x" ; then 37129933c305SChristian Borntraeger roms="$roms s390-ccw" 37139933c305SChristian Borntraegerfi 37149933c305SChristian Borntraeger 3715964c6fa1SRichard Henderson# Probe for the need for relocating the user-only binary. 3716964c6fa1SRichard Hendersonif test "$pie" = "no" ; then 3717964c6fa1SRichard Henderson textseg_addr= 3718964c6fa1SRichard Henderson case "$cpu" in 3719c72b26ecSRichard Henderson arm | hppa | i386 | m68k | ppc | ppc64 | s390* | sparc | sparc64 | x86_64 | x32) 3720964c6fa1SRichard Henderson textseg_addr=0x60000000 3721964c6fa1SRichard Henderson ;; 3722964c6fa1SRichard Henderson mips) 3723964c6fa1SRichard Henderson textseg_addr=0x400000 3724964c6fa1SRichard Henderson ;; 3725964c6fa1SRichard Henderson esac 3726964c6fa1SRichard Henderson if [ -n "$textseg_addr" ]; then 3727964c6fa1SRichard Henderson cat > $TMPC <<EOF 3728964c6fa1SRichard Henderson int main(void) { return 0; } 3729964c6fa1SRichard HendersonEOF 3730964c6fa1SRichard Henderson textseg_ldflags="-Wl,-Ttext-segment=$textseg_addr" 3731964c6fa1SRichard Henderson if ! compile_prog "" "$textseg_ldflags"; then 3732964c6fa1SRichard Henderson # In case ld does not support -Ttext-segment, edit the default linker 3733964c6fa1SRichard Henderson # script via sed to set the .text start addr. This is needed on FreeBSD 3734964c6fa1SRichard Henderson # at least. 3735964c6fa1SRichard Henderson $ld --verbose | sed \ 3736964c6fa1SRichard Henderson -e '1,/==================================================/d' \ 3737964c6fa1SRichard Henderson -e '/==================================================/,$d' \ 3738964c6fa1SRichard Henderson -e "s/[.] = [0-9a-fx]* [+] SIZEOF_HEADERS/. = $textseg_addr + SIZEOF_HEADERS/" \ 3739964c6fa1SRichard Henderson -e "s/__executable_start = [0-9a-fx]*/__executable_start = $textseg_addr/" > config-host.ld 3740964c6fa1SRichard Henderson textseg_ldflags="-Wl,-T../config-host.ld" 3741964c6fa1SRichard Henderson fi 3742964c6fa1SRichard Henderson fi 3743964c6fa1SRichard Hendersonfi 3744964c6fa1SRichard Henderson 37455ca9388aSGerd Hoffmann# add pixman flags after all config tests are done 3746a540f158SPeter CrosthwaiteQEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags $fdt_cflags" 37475ca9388aSGerd Hoffmannlibs_softmmu="$libs_softmmu $pixman_libs" 37485ca9388aSGerd Hoffmann 37497d13299dSbellardecho "Install prefix $prefix" 3750c00b2808SEduardo Habkostecho "BIOS directory `eval echo $qemu_datadir`" 3751f2b9e1e3SPaolo Bonziniecho "binary directory `eval echo $bindir`" 37523aa5d2beSAlon Levyecho "library directory `eval echo $libdir`" 37538bf188aaSMichael Tokarevecho "libexec directory `eval echo $libexecdir`" 37540f94d6daSAlon Levyecho "include directory `eval echo $includedir`" 37551c0fd160SAurelien Jarnoecho "config directory `eval echo $sysconfdir`" 375611d9f695Sbellardif test "$mingw32" = "no" ; then 37575a699bbbSLaszlo Ersekecho "local state directory `eval echo $local_statedir`" 3758f2b9e1e3SPaolo Bonziniecho "Manual directory `eval echo $mandir`" 375943ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 37605a699bbbSLaszlo Ersekelse 37615a699bbbSLaszlo Ersekecho "local state directory queried at runtime" 3762d9840e25STomoki Sekiyamaecho "Windows SDK $win_sdk" 376311d9f695Sbellardfi 37645a67135aSbellardecho "Source path $source_path" 37657d13299dSbellardecho "C compiler $cc" 376683469015Sbellardecho "Host C compiler $host_cc" 376783f73fceSTomoki Sekiyamaecho "C++ compiler $cxx" 37683c4a4d0dSPeter Maydellecho "Objective-C compiler $objcc" 376945d285abSPeter Maydellecho "ARFLAGS $ARFLAGS" 37700c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 3771a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 37720c439cbfSJuan Quintelaecho "LDFLAGS $LDFLAGS" 37737d13299dSbellardecho "make $make" 37746a882643Spbrookecho "install $install" 3775c886edfbSBlue Swirlecho "python $python" 3776e2d8830eSBradif test "$slirp" = "yes" ; then 3777e2d8830eSBrad echo "smbd $smbd" 3778e2d8830eSBradfi 3779a98fd896Sbellardecho "host CPU $cpu" 3780de83cd02Sbellardecho "host big endian $bigendian" 378197a847bcSbellardecho "target list $target_list" 3782ade25b0dSaurel32echo "tcg debug enabled $debug_tcg" 37837d13299dSbellardecho "gprof enabled $gprof" 378403b4fe7dSaliguoriecho "sparse enabled $sparse" 37851625af87Saliguoriecho "strip binaries $strip_opt" 378605c2a3e7Sbellardecho "profiler $profiler" 378743ce4dfeSbellardecho "static build $static" 378885aa5189Sbellardecho "-Werror enabled $werror" 37895b0753e0Sbellardif test "$darwin" = "yes" ; then 37905b0753e0Sbellard echo "Cocoa support $cocoa" 37915b0753e0Sbellardfi 3792e2134eb9SGerd Hoffmannecho "pixman $pixman" 379397a847bcSbellardecho "SDL support $sdl" 3794a4ccabcfSAnthony Liguoriecho "GTK support $gtk" 37954d3b6f6eSbalrogecho "curses support $curses" 3796769ce76dSAlexander Grafecho "curl support $curl" 379767b915a5Sbellardecho "mingw32 support $mingw32" 37980c58ac1cSmalcecho "Audio drivers $audio_drv_list" 3799b64ec4e4SFam Zhengecho "Block whitelist (rw) $block_drv_rw_whitelist" 3800b64ec4e4SFam Zhengecho "Block whitelist (ro) $block_drv_ro_whitelist" 3801983eef5aSMeador Ingeecho "VirtFS support $virtfs" 3802821601eaSJes Sorensenecho "VNC support $vnc" 3803821601eaSJes Sorensenif test "$vnc" = "yes" ; then 38048d5d2d4cSths echo "VNC TLS support $vnc_tls" 38052f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 38062f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 3807efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 38087536ee4bSTim Hardeck echo "VNC WS support $vnc_ws" 3809821601eaSJes Sorensenfi 38103142255cSblueswir1if test -n "$sparc_cpu"; then 38113142255cSblueswir1 echo "Target Sparc Arch $sparc_cpu" 38123142255cSblueswir1fi 3813e37630caSaliguoriecho "xen support $xen" 38142e4d9fb1Saurel32echo "brlapi support $brlapi" 3815a20a6f46SJuan Quintelaecho "bluez support $bluez" 3816a25dba17SJuan Quintelaecho "Documentation $docs" 3817c5937220Spbrook[ ! -z "$uname_release" ] && \ 3818c5937220Spbrookecho "uname -r $uname_release" 3819379f6698SPaul Brookecho "GUEST_BASE $guest_base" 382040d6444eSAvi Kivityecho "PIE $pie" 38218a16d273Sthsecho "vde support $vde" 382258952137SVincenzo Maffioneecho "netmap support $netmap" 38235c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 3824758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 382577755340Sthsecho "Install blobs $blobs" 3826b31a0277SJuan Quintelaecho "KVM support $kvm" 38272da776dbSMichael R. Hinesecho "RDMA support $rdma" 38289195b2c2SStefan Weilecho "TCG interpreter $tcg_interpreter" 3829f652e6afSaurel32echo "fdt support $fdt" 3830ceb42de8Saliguoriecho "preadv support $preadv" 38315f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 3832e78815a5SAndreas Färberecho "madvise $madvise" 3833e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 38341e9737daSRichard Hendersonecho "sigev_thread_id $sigev_thread_id" 3835ee682d27SStefan Weilecho "uuid support $uuid" 383647e98658SCorey Bryantecho "libcap-ng support $cap_ng" 3837d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 38385e9be92dSNicholas Bellingerecho "vhost-scsi support $vhost_scsi" 383994a420b1SStefan Hajnocziecho "Trace backend $trace_backend" 38409410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 38412e0e3c39SAlon Levyecho "spice support $spice ($spice_protocol_version/$spice_server_version)" 3842f27aaf4bSChristian Brunnerecho "rbd support $rbd" 3843dce512deSChristoph Hellwigecho "xfsctl support $xfs" 3844111a38b0SRobert Relyeaecho "nss used $smartcard_nss" 38452b2325ffSGerd Hoffmannecho "libusb $libusb" 384669354a83SHans de Goedeecho "usb net redir $usb_redir" 3847b1e5fff4SMichael Walleecho "GLX support $glx" 3848219c2521SStefan Weilif test "$libiscsi_version" = "1.4.0"; then 3849219c2521SStefan Weilecho "libiscsi support $libiscsi (1.4.0)" 3850219c2521SStefan Weilelse 3851c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 3852219c2521SStefan Weilfi 3853*6542aa9cSPeter Lievenecho "libnfs support $libnfs" 3854d138cee9SMichael Rothecho "build guest agent $guest_agent" 3855d9840e25STomoki Sekiyamaecho "QGA VSS support $guest_agent_with_vss" 3856f794573eSEduardo Otuboecho "seccomp support $seccomp" 38577c2acc70SPeter Maydellecho "coroutine backend $coroutine" 385870c60c08SStefan Hajnocziecho "coroutine pool $coroutine_pool" 3859eb100396SBharata B Raoecho "GlusterFS support $glusterfs" 3860583f6e7bSStefan Hajnocziecho "virtio-blk-data-plane $virtio_blk_data_plane" 38611d728c39SBlue Swirlecho "gcov $gcov_tool" 38621d728c39SBlue Swirlecho "gcov enabled $gcov" 3863ab214c29SStefan Bergerecho "TPM support $tpm" 38640a12ec87SRichard W.M. Jonesecho "libssh2 support $libssh2" 38653b8acc11SPaolo Bonziniecho "TPM passthrough $tpm_passthrough" 38663556c233SPaolo Bonziniecho "QOM debugging $qom_cast_debug" 38674f18b782SJeff Codyecho "vhdx $vhdx" 386867b915a5Sbellard 38691ba16968SStefan Weilif test "$sdl_too_old" = "yes"; then 387024b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 3871e8cd23deSbellardfi 387297a847bcSbellard 387398ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 387497a847bcSbellard 3875dbd99ae3SStefan Weilecho "# Automatically generated by configure - do not modify" >config-all-disas.mak 3876dbd99ae3SStefan Weil 387798ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 387898ec69acSJuan Quintelaecho >> $config_host_mak 387998ec69acSJuan Quintela 3880e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 388199d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 388299d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 38833aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 38848bf188aaSMichael Tokarevecho "libexecdir=$libexecdir" >> $config_host_mak 38850f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 388699d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 388799d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 388822d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 38899afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 38909afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 38915a699bbbSLaszlo Ersekif test "$mingw32" = "no" ; then 3892785c23aeSLuiz Capitulino echo "qemu_localstatedir=$local_statedir" >> $config_host_mak 38935a699bbbSLaszlo Ersekfi 3894f354b1a1SMichael Tokarevecho "qemu_helperdir=$libexecdir" >> $config_host_mak 3895f9943cd5SGerd Hoffmannecho "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak 3896f9943cd5SGerd Hoffmannecho "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak 3897834574eaSAnthony Liguoriecho "qemu_localedir=$qemu_localedir" >> $config_host_mak 3898f544a488SPaolo Bonziniecho "libs_softmmu=$libs_softmmu" >> $config_host_mak 3899804edf29SJuan Quintela 390098ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 3901727e5283SPaolo Bonzini 3902f8393946Saurel32if test "$debug_tcg" = "yes" ; then 39032358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 3904f8393946Saurel32fi 39051625af87Saliguoriif test "$strip_opt" = "yes" ; then 390652ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 39071625af87Saliguorifi 39087d13299dSbellardif test "$bigendian" = "yes" ; then 3909e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 391097a847bcSbellardfi 391167b915a5Sbellardif test "$mingw32" = "yes" ; then 391298ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 39139fe6de94SBlue Swirl rc_version=`cat $source_path/VERSION` 39149fe6de94SBlue Swirl version_major=${rc_version%%.*} 39159fe6de94SBlue Swirl rc_version=${rc_version#*.} 39169fe6de94SBlue Swirl version_minor=${rc_version%%.*} 39179fe6de94SBlue Swirl rc_version=${rc_version#*.} 39189fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 39199fe6de94SBlue Swirl version_micro=0 39209fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 39219fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 3922d9840e25STomoki Sekiyama if test "$guest_agent_with_vss" = "yes" ; then 3923d9840e25STomoki Sekiyama echo "CONFIG_QGA_VSS=y" >> $config_host_mak 3924d9840e25STomoki Sekiyama echo "WIN_SDK=\"$win_sdk\"" >> $config_host_mak 3925d9840e25STomoki Sekiyama fi 3926210fa556Spbrookelse 392735f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 3928210fa556Spbrookfi 3929128ab2ffSblueswir1 3930dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 3931dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 3932dffcb71cSMark McLoughlinfi 3933dffcb71cSMark McLoughlin 393483fb7adfSbellardif test "$darwin" = "yes" ; then 393598ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 393683fb7adfSbellardfi 3937b29fe3edSmalc 3938b29fe3edSmalcif test "$aix" = "yes" ; then 393998ec69acSJuan Quintela echo "CONFIG_AIX=y" >> $config_host_mak 3940b29fe3edSmalcfi 3941b29fe3edSmalc 3942ec530c81Sbellardif test "$solaris" = "yes" ; then 394398ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 39442358a494SJuan Quintela echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak 39450475a5caSths if test "$needs_libsunmath" = "yes" ; then 394675b5a697SJuan Quintela echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak 39470475a5caSths fi 3948ec530c81Sbellardfi 3949179cf400SAndreas Färberif test "$haiku" = "yes" ; then 3950179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 3951179cf400SAndreas Färberfi 395297a847bcSbellardif test "$static" = "yes" ; then 395398ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 395497a847bcSbellardfi 39551ba16968SStefan Weilif test "$profiler" = "yes" ; then 39562358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 395705c2a3e7Sbellardfi 3958c20709aaSbellardif test "$slirp" = "yes" ; then 395998ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 3960e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 3961c20709aaSbellardfi 39628a16d273Sthsif test "$vde" = "yes" ; then 396398ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 39648a16d273Sthsfi 396558952137SVincenzo Maffioneif test "$netmap" = "yes" ; then 396658952137SVincenzo Maffione echo "CONFIG_NETMAP=y" >> $config_host_mak 396758952137SVincenzo Maffionefi 396847e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 396947e98658SCorey Bryant echo "CONFIG_LIBCAP=y" >> $config_host_mak 397047e98658SCorey Bryantfi 39712358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 39720c58ac1cSmalcfor drv in $audio_drv_list; do 3973bb55b712SStefan Weil def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` 397498ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 3975923e4521Smalc if test "$drv" = "fmod"; then 39767aac6cb1SJuan Quintela echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak 3977fb065187Sbellard fi 39780c58ac1cSmalcdone 397967f86e8eSJuan Quintelaif test "$audio_pt_int" = "yes" ; then 398067f86e8eSJuan Quintela echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak 398167f86e8eSJuan Quintelafi 3982d5631638Smalcif test "$audio_win_int" = "yes" ; then 3983d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 3984d5631638Smalcfi 3985b64ec4e4SFam Zhengecho "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak 3986b64ec4e4SFam Zhengecho "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak 3987821601eaSJes Sorensenif test "$vnc" = "yes" ; then 3988821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 3989821601eaSJes Sorensenfi 39908d5d2d4cSthsif test "$vnc_tls" = "yes" ; then 399198ec69acSJuan Quintela echo "CONFIG_VNC_TLS=y" >> $config_host_mak 39928d5d2d4cSthsfi 39932f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 399498ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 39952f9606b3Saliguorifi 3996821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 39972f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 39982f6f5c7aSCorentin Charyfi 3999821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 4000efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 4001efe556adSCorentin Charyfi 40027536ee4bSTim Hardeckif test "$vnc_ws" = "yes" ; then 40037536ee4bSTim Hardeck echo "CONFIG_VNC_WS=y" >> $config_host_mak 40047536ee4bSTim Hardeck echo "VNC_WS_CFLAGS=$vnc_ws_cflags" >> $config_host_mak 40057536ee4bSTim Hardeckfi 400676655d6dSaliguoriif test "$fnmatch" = "yes" ; then 40072358a494SJuan Quintela echo "CONFIG_FNMATCH=y" >> $config_host_mak 400876655d6dSaliguorifi 4009ee682d27SStefan Weilif test "$uuid" = "yes" ; then 4010ee682d27SStefan Weil echo "CONFIG_UUID=y" >> $config_host_mak 4011ee682d27SStefan Weilfi 4012dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 4013dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 4014dce512deSChristoph Hellwigfi 4015b1a550a0Spbrookqemu_version=`head $source_path/VERSION` 401698ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 40172358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 401898ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 401998ec69acSJuan Quintelaecho "TARGET_DIRS=$target_list" >> $config_host_mak 4020a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 402198ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 4022cc8ae6deSpbrookfi 40231ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 402498ec69acSJuan Quintela echo "CONFIG_SDL=y" >> $config_host_mak 40258ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 402649ecc3faSbellardfi 402749ecc3faSbellardif test "$cocoa" = "yes" ; then 402898ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 402949ecc3faSbellardfi 40304d3b6f6eSbalrogif test "$curses" = "yes" ; then 403198ec69acSJuan Quintela echo "CONFIG_CURSES=y" >> $config_host_mak 4032ab4e5602SJan Kiszkafi 4033ebc996f3SRiku Voipioif test "$utimens" = "yes" ; then 40342358a494SJuan Quintela echo "CONFIG_UTIMENSAT=y" >> $config_host_mak 4035ebc996f3SRiku Voipiofi 4036099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 40372358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 4038099d6b0fSRiku Voipiofi 403940ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 404040ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 404140ff6d7eSKevin Wolffi 40423ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 40432358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 40443ce34dfbSvibisreenivasanfi 4045c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 4046c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 4047c2882b96SRiku Voipiofi 4048d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 4049d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 4050d0927938SUlrich Hechtfi 40513d4fa43eSKusanagi Kouichiif test "$fallocate_punch_hole" = "yes" ; then 40523d4fa43eSKusanagi Kouichi echo "CONFIG_FALLOCATE_PUNCH_HOLE=y" >> $config_host_mak 40533d4fa43eSKusanagi Kouichifi 4054c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 4055c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 4056c727f47dSPeter Maydellfi 4057dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 4058dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 4059dace20dcSPeter Maydellfi 4060d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 4061d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 4062d0927938SUlrich Hechtfi 40634e0c6529SAlex Blighif test "$ppoll" = "yes" ; then 40644e0c6529SAlex Bligh echo "CONFIG_PPOLL=y" >> $config_host_mak 40654e0c6529SAlex Blighfi 4066cd758dd0SAlex Blighif test "$prctl_pr_set_timerslack" = "yes" ; then 4067cd758dd0SAlex Bligh echo "CONFIG_PRCTL_PR_SET_TIMERSLACK=y" >> $config_host_mak 4068cd758dd0SAlex Blighfi 40693b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 40703b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 40713b6edd16SPeter Maydellfi 40723b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 40733b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 40743b6edd16SPeter Maydellfi 40753b6edd16SPeter Maydellif test "$epoll_pwait" = "yes" ; then 40763b6edd16SPeter Maydell echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak 40773b6edd16SPeter Maydellfi 4078a8fd1abaSPeter Maydellif test "$sendfile" = "yes" ; then 4079a8fd1abaSPeter Maydell echo "CONFIG_SENDFILE=y" >> $config_host_mak 4080a8fd1abaSPeter Maydellfi 40813b3f24adSaurel32if test "$inotify" = "yes" ; then 40822358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 40833b3f24adSaurel32fi 4084c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 4085c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 4086c05c7a73SRiku Voipiofi 40876ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 40886ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 40896ae9a1f4SJuan Quintelafi 40906ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 40916ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 40926ae9a1f4SJuan Quintelafi 4093769ce76dSAlexander Grafif test "$curl" = "yes" ; then 409498ec69acSJuan Quintela echo "CONFIG_CURL=y" >> $config_host_mak 4095b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 4096769ce76dSAlexander Graffi 40972e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 409898ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 40992e4d9fb1Saurel32fi 4100fb599c9aSbalrogif test "$bluez" = "yes" ; then 410198ec69acSJuan Quintela echo "CONFIG_BLUEZ=y" >> $config_host_mak 4102ef7635ecSJuan Quintela echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak 4103fb599c9aSbalrogfi 4104e18df141SAnthony Liguoriecho "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 4105a4ccabcfSAnthony Liguoriif test "$gtk" = "yes" ; then 4106a4ccabcfSAnthony Liguori echo "CONFIG_GTK=y" >> $config_host_mak 4107a4ccabcfSAnthony Liguori echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak 4108a4ccabcfSAnthony Liguori echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak 4109a4ccabcfSAnthony Liguorifi 4110e37630caSaliguoriif test "$xen" = "yes" ; then 41116dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 4112d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 4113e37630caSaliguorifi 41145c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 41155c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 41165c6c3a6cSChristoph Hellwigfi 4117758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 4118758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 4119758e8e38SVenkateswararao Jujjuri (JV)fi 41204f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 41214f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 41224f26f2b6SAvi Kivityfi 4123983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 4124758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 4125758e8e38SVenkateswararao Jujjuri (JV)fi 41265e9be92dSNicholas Bellingerif test "$vhost_scsi" = "yes" ; then 41275e9be92dSNicholas Bellinger echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak 41285e9be92dSNicholas Bellingerfi 412977755340Sthsif test "$blobs" = "yes" ; then 413098ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 413177755340Sthsfi 4132bf9298b9Saliguoriif test "$iovec" = "yes" ; then 41332358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 4134bf9298b9Saliguorifi 4135ceb42de8Saliguoriif test "$preadv" = "yes" ; then 41362358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 4137ceb42de8Saliguorifi 4138f652e6afSaurel32if test "$fdt" = "yes" ; then 41393f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 4140f652e6afSaurel32fi 4141dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 4142dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 4143dcc38d1cSMarcelo Tosattifi 41449195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 41459195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 41469195b2c2SStefan Weilfi 41475f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 41485f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 41495f6b9e8fSBlue Swirlfi 4150e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 4151e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 4152e78815a5SAndreas Färberfi 4153e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 4154e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 4155e78815a5SAndreas Färberfi 41561e9737daSRichard Hendersonif test "$sigev_thread_id" = "yes" ; then 41571e9737daSRichard Henderson echo "CONFIG_SIGEV_THREAD_ID=y" >> $config_host_mak 41581e9737daSRichard Hendersonfi 415997a847bcSbellard 4160cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 4161cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 4162cd4ec0b4SGerd Hoffmannfi 4163cd4ec0b4SGerd Hoffmann 4164111a38b0SRobert Relyeaif test "$smartcard_nss" = "yes" ; then 4165111a38b0SRobert Relyea echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak 4166ad4cf3f6SPaul Brook echo "libcacard_libs=$libcacard_libs" >> $config_host_mak 4167ad4cf3f6SPaul Brook echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak 4168111a38b0SRobert Relyeafi 4169111a38b0SRobert Relyea 41702b2325ffSGerd Hoffmannif test "$libusb" = "yes" ; then 41712b2325ffSGerd Hoffmann echo "CONFIG_USB_LIBUSB=y" >> $config_host_mak 41722b2325ffSGerd Hoffmannfi 41732b2325ffSGerd Hoffmann 417469354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 417569354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 417669354a83SHans de Goedefi 417769354a83SHans de Goede 4178b1e5fff4SMichael Walleif test "$glx" = "yes" ; then 4179b1e5fff4SMichael Walle echo "CONFIG_GLX=y" >> $config_host_mak 41802b6b7099SPaolo Bonzini echo "GLX_LIBS=$glx_libs" >> $config_host_mak 418120ff075bSMichael Wallefi 418220ff075bSMichael Walle 4183c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 4184c589b249SRonnie Sahlberg echo "CONFIG_LIBISCSI=y" >> $config_host_mak 4185219c2521SStefan Weil if test "$libiscsi_version" = "1.4.0"; then 4186219c2521SStefan Weil echo "CONFIG_LIBISCSI_1_4=y" >> $config_host_mak 4187219c2521SStefan Weil fi 4188c589b249SRonnie Sahlbergfi 4189c589b249SRonnie Sahlberg 4190*6542aa9cSPeter Lievenif test "$libnfs" = "yes" ; then 4191*6542aa9cSPeter Lieven echo "CONFIG_LIBNFS=y" >> $config_host_mak 4192*6542aa9cSPeter Lievenfi 4193*6542aa9cSPeter Lieven 4194f794573eSEduardo Otuboif test "$seccomp" = "yes"; then 4195f794573eSEduardo Otubo echo "CONFIG_SECCOMP=y" >> $config_host_mak 4196f794573eSEduardo Otubofi 4197f794573eSEduardo Otubo 419883fb7adfSbellard# XXX: suppress that 41997d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 42002358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 42017d3505c5Sbellardfi 42027d3505c5Sbellard 42032358a494SJuan Quintelaecho "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak 4204c5937220Spbrook 420520ff6c80SAnthony Liguoriif test "$zero_malloc" = "yes" ; then 420620ff6c80SAnthony Liguori echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak 420720ff6c80SAnthony Liguorifi 42083556c233SPaolo Bonziniif test "$qom_cast_debug" = "yes" ; then 42093556c233SPaolo Bonzini echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak 42103556c233SPaolo Bonzinifi 4211f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 4212f27aaf4bSChristian Brunner echo "CONFIG_RBD=y" >> $config_host_mak 4213f27aaf4bSChristian Brunnerfi 421420ff6c80SAnthony Liguori 42157c2acc70SPeter Maydellecho "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak 421670c60c08SStefan Hajnocziif test "$coroutine_pool" = "yes" ; then 421770c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak 421870c60c08SStefan Hajnoczielse 421970c60c08SStefan Hajnoczi echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak 422070c60c08SStefan Hajnoczifi 4221d0e2fce5SAneesh Kumar K.V 4222d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 4223d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 4224d2042378SAneesh Kumar K.Vfi 4225d2042378SAneesh Kumar K.V 4226e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 4227e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 4228e06a765eSHarsh Prateek Borafi 4229e06a765eSHarsh Prateek Bora 4230cc6e3ca9SGerd Hoffmannif test "$pragma_diagnostic_available" = "yes" ; then 4231cc6e3ca9SGerd Hoffmann echo "CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE=y" >> $config_host_mak 423206d71fa1SPeter Maydellfi 423306d71fa1SPeter Maydell 42343f4349dcSKevin Wolfif test "$valgrind_h" = "yes" ; then 42353f4349dcSKevin Wolf echo "CONFIG_VALGRIND_H=y" >> $config_host_mak 42363f4349dcSKevin Wolffi 42373f4349dcSKevin Wolf 42388ab1bf12SLuiz Capitulinoif test "$has_environ" = "yes" ; then 42398ab1bf12SLuiz Capitulino echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak 42408ab1bf12SLuiz Capitulinofi 42418ab1bf12SLuiz Capitulino 424276a347e1SRichard Hendersonif test "$cpuid_h" = "yes" ; then 424376a347e1SRichard Henderson echo "CONFIG_CPUID_H=y" >> $config_host_mak 424476a347e1SRichard Hendersonfi 424576a347e1SRichard Henderson 4246f540166bSRichard Hendersonif test "$int128" = "yes" ; then 4247f540166bSRichard Henderson echo "CONFIG_INT128=y" >> $config_host_mak 4248f540166bSRichard Hendersonfi 4249f540166bSRichard Henderson 42501e6e9acaSRichard Hendersonif test "$getauxval" = "yes" ; then 42511e6e9acaSRichard Henderson echo "CONFIG_GETAUXVAL=y" >> $config_host_mak 42521e6e9acaSRichard Hendersonfi 42531e6e9acaSRichard Henderson 4254eb100396SBharata B Raoif test "$glusterfs" = "yes" ; then 4255eb100396SBharata B Rao echo "CONFIG_GLUSTERFS=y" >> $config_host_mak 4256eb100396SBharata B Raofi 4257eb100396SBharata B Rao 42580c14fb47SBharata B Raoif test "$glusterfs_discard" = "yes" ; then 42590c14fb47SBharata B Rao echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak 42600c14fb47SBharata B Raofi 42610c14fb47SBharata B Rao 42627c815372SBharata B Raoif test "$glusterfs_zerofill" = "yes" ; then 42637c815372SBharata B Rao echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak 42647c815372SBharata B Raofi 42657c815372SBharata B Rao 42660a12ec87SRichard W.M. Jonesif test "$libssh2" = "yes" ; then 42670a12ec87SRichard W.M. Jones echo "CONFIG_LIBSSH2=y" >> $config_host_mak 42680a12ec87SRichard W.M. Jonesfi 42690a12ec87SRichard W.M. Jones 4270583f6e7bSStefan Hajnocziif test "$virtio_blk_data_plane" = "yes" ; then 42716e790746SPaolo Bonzini echo 'CONFIG_VIRTIO_BLK_DATA_PLANE=$(CONFIG_VIRTIO)' >> $config_host_mak 4272583f6e7bSStefan Hajnoczifi 4273583f6e7bSStefan Hajnoczi 42744f18b782SJeff Codyif test "$vhdx" = "yes" ; then 42754f18b782SJeff Cody echo "CONFIG_VHDX=y" >> $config_host_mak 42764f18b782SJeff Codyfi 42774f18b782SJeff Cody 427868063649Sblueswir1# USB host support 4279b5613fdcSGerd Hoffmannif test "$libusb" = "yes"; then 42802b2325ffSGerd Hoffmann echo "HOST_USB=libusb legacy" >> $config_host_mak 4281b5613fdcSGerd Hoffmannelse 428298ec69acSJuan Quintela echo "HOST_USB=stub" >> $config_host_mak 4283b5613fdcSGerd Hoffmannfi 428468063649Sblueswir1 42853b8acc11SPaolo Bonzini# TPM passthrough support? 42863b8acc11SPaolo Bonziniif test "$tpm" = "yes"; then 42873b8acc11SPaolo Bonzini echo 'CONFIG_TPM=$(CONFIG_SOFTMMU)' >> $config_host_mak 42883b8acc11SPaolo Bonzini if test "$tpm_passthrough" = "yes"; then 42893b8acc11SPaolo Bonzini echo "CONFIG_TPM_PASSTHROUGH=y" >> $config_host_mak 42903b8acc11SPaolo Bonzini fi 42913b8acc11SPaolo Bonzinifi 42923b8acc11SPaolo Bonzini 4293e4858974SLluís# use default implementation for tracing backend-specific routines 4294e4858974SLluístrace_default=yes 429594a420b1SStefan Hajnocziecho "TRACE_BACKEND=$trace_backend" >> $config_host_mak 42966d8a764eSLluísif test "$trace_backend" = "nop"; then 42976d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 429822890ab5SPrerna Saxenafi 42999410b56cSPrerna Saxenaif test "$trace_backend" = "simple"; then 43006d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 4301e4858974SLluís trace_default=no 43026d8a764eSLluís # Set the appropriate trace file. 4303953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 43049410b56cSPrerna Saxenafi 43056d8a764eSLluísif test "$trace_backend" = "stderr"; then 43066d8a764eSLluís echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak 43079a82b6a5SLluís trace_default=no 43086d8a764eSLluísfi 43096d8a764eSLluísif test "$trace_backend" = "ust"; then 43106d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 43116d8a764eSLluísfi 43126d8a764eSLluísif test "$trace_backend" = "dtrace"; then 43136d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 43146d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 43156d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 43166d8a764eSLluís fi 4317c276b17dSDaniel P. Berrangefi 4318781e9545SEiichi Tsukataif test "$trace_backend" = "ftrace"; then 4319781e9545SEiichi Tsukata if test "$linux" = "yes" ; then 4320781e9545SEiichi Tsukata echo "CONFIG_TRACE_FTRACE=y" >> $config_host_mak 4321781e9545SEiichi Tsukata trace_default=no 4322781e9545SEiichi Tsukata else 4323781e9545SEiichi Tsukata feature_not_found "ftrace(trace backend)" 4324781e9545SEiichi Tsukata fi 4325781e9545SEiichi Tsukatafi 43269410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 4327e4858974SLluísif test "$trace_default" = "yes"; then 4328e4858974SLluís echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak 4329e4858974SLluísfi 43309410b56cSPrerna Saxena 43312da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 43322da776dbSMichael R. Hines echo "CONFIG_RDMA=y" >> $config_host_mak 43332da776dbSMichael R. Hinesfi 43342da776dbSMichael R. Hines 43355b5e3037SPaolo Bonziniif test "$tcg_interpreter" = "yes"; then 43365b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 43375b5e3037SPaolo Bonzinielif test "$ARCH" = "sparc64" ; then 43385b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 43395b5e3037SPaolo Bonzinielif test "$ARCH" = "s390x" ; then 43405b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 4341c72b26ecSRichard Hendersonelif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then 43425b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 43435b5e3037SPaolo Bonzinielse 43445b5e3037SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 43455b5e3037SPaolo Bonzinifi 43465b5e3037SPaolo BonziniQEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" 43475b5e3037SPaolo Bonzini 434898ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 434998ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 4350804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 4351804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 43521901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 43531901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 435421655882SPaolo Bonziniif test -n "$libtool"; then 435521655882SPaolo Bonzini echo "INSTALL_PROG=\$(LIBTOOL) --mode=install $install -c -m 0755" >> $config_host_mak 435621655882SPaolo Bonzini echo "INSTALL_LIB=\$(LIBTOOL) --mode=install $install -c -m 0644" >> $config_host_mak 435721655882SPaolo Bonzinielse 43581901cb14SBrad echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 435921655882SPaolo Bonzini echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak 436021655882SPaolo Bonzinifi 4361c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 4362804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 4363a31a8642SMichael S. Tsirkinif $iasl -h > /dev/null 2>&1; then 4364a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_host_mak 4365a31a8642SMichael S. Tsirkinfi 43662b2e59e6SPaolo Bonziniecho "CC_I386=$cc_i386" >> $config_host_mak 4367804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 436883f73fceSTomoki Sekiyamaecho "CXX=$cxx" >> $config_host_mak 43693c4a4d0dSPeter Maydellecho "OBJCC=$objcc" >> $config_host_mak 4370804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 437145d285abSPeter Maydellecho "ARFLAGS=$ARFLAGS" >> $config_host_mak 43723dd46c78SBlue Swirlecho "AS=$as" >> $config_host_mak 43733dd46c78SBlue Swirlecho "CPP=$cpp" >> $config_host_mak 4374804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 4375804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 43769fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 437744dc0ca3SAlon Levyecho "LIBTOOL=$libtool" >> $config_host_mak 4378e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 4379a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 4380f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 4381e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 4382e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 4383e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 4384e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 4385e39f0062SPaolo Bonzinifi 438642da6041SGerd Hoffmannif test "$cross_prefix" != ""; then 438742da6041SGerd Hoffmann echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak 438842da6041SGerd Hoffmannelse 438942da6041SGerd Hoffmann echo "AUTOCONF_HOST := " >> $config_host_mak 439042da6041SGerd Hoffmannfi 4391e2a2ed06SJuan Quintelaecho "LDFLAGS=$LDFLAGS" >> $config_host_mak 439237746c5eSMarc-André Lureauecho "LIBTOOLFLAGS=$LIBTOOLFLAGS" >> $config_host_mak 439373da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 43943e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 4395804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 4396957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 439794dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 4398cbdd1999SPaolo Bonziniecho "TRANSLATE_OPT_CFLAGS=$TRANSLATE_OPT_CFLAGS" >> $config_host_mak 43991d728c39SBlue Swirlif test "$gcov" = "yes" ; then 44001d728c39SBlue Swirl echo "CONFIG_GCOV=y" >> $config_host_mak 44011d728c39SBlue Swirl echo "GCOV=$gcov_tool" >> $config_host_mak 44021d728c39SBlue Swirlfi 4403804edf29SJuan Quintela 44046efd7517SPeter Maydell# use included Linux headers 44056efd7517SPeter Maydellif test "$linux" = "yes" ; then 4406a307beb6SAndreas Färber mkdir -p linux-headers 44076efd7517SPeter Maydell case "$cpu" in 4408c72b26ecSRichard Henderson i386|x86_64|x32) 440908312a63SPeter Maydell linux_arch=x86 44106efd7517SPeter Maydell ;; 44116efd7517SPeter Maydell ppcemb|ppc|ppc64) 441208312a63SPeter Maydell linux_arch=powerpc 44136efd7517SPeter Maydell ;; 44146efd7517SPeter Maydell s390x) 441508312a63SPeter Maydell linux_arch=s390 441608312a63SPeter Maydell ;; 44171f080313SClaudio Fontana aarch64) 44181f080313SClaudio Fontana linux_arch=arm64 44191f080313SClaudio Fontana ;; 442008312a63SPeter Maydell *) 442108312a63SPeter Maydell # For most CPUs the kernel architecture name and QEMU CPU name match. 442208312a63SPeter Maydell linux_arch="$cpu" 44236efd7517SPeter Maydell ;; 44246efd7517SPeter Maydell esac 442508312a63SPeter Maydell # For non-KVM architectures we will not have asm headers 442608312a63SPeter Maydell if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then 442708312a63SPeter Maydell symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 442808312a63SPeter Maydell fi 44296efd7517SPeter Maydellfi 44306efd7517SPeter Maydell 443197a847bcSbellardfor target in $target_list; do 443297a847bcSbellardtarget_dir="$target" 443325be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 4434c1799a84SPaolo Bonzinitarget_name=`echo $target | cut -d '-' -f 1` 443597a847bcSbellardtarget_bigendian="no" 44361f3d3c8fSJuan Quintela 4437c1799a84SPaolo Bonzinicase "$target_name" in 4438d15a9c23SAnthony Green armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 4439ea2d6a39SJuan Quintela target_bigendian=yes 4440ea2d6a39SJuan Quintela ;; 4441ea2d6a39SJuan Quintelaesac 444297a847bcSbellardtarget_softmmu="no" 4443997344f3Sbellardtarget_user_only="no" 4444831b7825Sthstarget_linux_user="no" 444584778508Sblueswir1target_bsd_user="no" 44469e407a85Spbrookcase "$target" in 4447c1799a84SPaolo Bonzini ${target_name}-softmmu) 44489e407a85Spbrook target_softmmu="yes" 44499e407a85Spbrook ;; 4450c1799a84SPaolo Bonzini ${target_name}-linux-user) 44519c7a4202SBlue Swirl if test "$linux" != "yes" ; then 445276ad07a4SPeter Maydell error_exit "Target '$target' is only available on a Linux host" 44539c7a4202SBlue Swirl fi 44549e407a85Spbrook target_user_only="yes" 44559e407a85Spbrook target_linux_user="yes" 44569e407a85Spbrook ;; 4457c1799a84SPaolo Bonzini ${target_name}-bsd-user) 44589cf55765SBlue Swirl if test "$bsd" != "yes" ; then 445976ad07a4SPeter Maydell error_exit "Target '$target' is only available on a BSD host" 44609c7a4202SBlue Swirl fi 446184778508Sblueswir1 target_user_only="yes" 446284778508Sblueswir1 target_bsd_user="yes" 446384778508Sblueswir1 ;; 44649e407a85Spbrook *) 446576ad07a4SPeter Maydell error_exit "Target '$target' not recognised" 44669e407a85Spbrook exit 1 44679e407a85Spbrook ;; 44689e407a85Spbrookesac 4469831b7825Sths 447097a847bcSbellardmkdir -p $target_dir 447125be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 447297a847bcSbellard 4473e5fe0c52Spbrookbflt="no" 4474c1799a84SPaolo Bonziniinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_name/g"` 447556aebc89Spbrookgdb_xml_files="" 44767ba1e619Saliguori 4477c1799a84SPaolo BonziniTARGET_ARCH="$target_name" 44786acff7daSJuan QuintelaTARGET_BASE_ARCH="" 4479e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 4480e73aae67SJuan Quintela 4481c1799a84SPaolo Bonzinicase "$target_name" in 44822408a527Saurel32 i386) 44832408a527Saurel32 ;; 44842408a527Saurel32 x86_64) 44856acff7daSJuan Quintela TARGET_BASE_ARCH=i386 44862408a527Saurel32 ;; 44872408a527Saurel32 alpha) 44882408a527Saurel32 ;; 44892408a527Saurel32 arm|armeb) 4490b498c8a0SJuan Quintela TARGET_ARCH=arm 4491e5fe0c52Spbrook bflt="yes" 449256aebc89Spbrook gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" 44932408a527Saurel32 ;; 44946a49fa95SAlexander Graf aarch64) 44956a49fa95SAlexander Graf TARGET_BASE_ARCH=arm 44966a49fa95SAlexander Graf bflt="yes" 44976a669427SPeter Maydell gdb_xml_files="aarch64-core.xml aarch64-fpu.xml" 44986a49fa95SAlexander Graf ;; 44992408a527Saurel32 cris) 45002408a527Saurel32 ;; 4501613a22c9SMichael Walle lm32) 4502613a22c9SMichael Walle ;; 45032408a527Saurel32 m68k) 45040938cda5Saurel32 bflt="yes" 450556aebc89Spbrook gdb_xml_files="cf-core.xml cf-fp.xml" 45062408a527Saurel32 ;; 4507877fdc12SEdgar E. Iglesias microblaze|microblazeel) 4508877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 450972b675caSEdgar E. Iglesias bflt="yes" 451072b675caSEdgar E. Iglesias ;; 45112408a527Saurel32 mips|mipsel) 4512b498c8a0SJuan Quintela TARGET_ARCH=mips 451325be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 45142408a527Saurel32 ;; 45152408a527Saurel32 mipsn32|mipsn32el) 4516597e2cecSRichard Henderson TARGET_ARCH=mips64 45176acff7daSJuan Quintela TARGET_BASE_ARCH=mips 451825be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 4519597e2cecSRichard Henderson echo "TARGET_ABI32=y" >> $config_target_mak 45202408a527Saurel32 ;; 45212408a527Saurel32 mips64|mips64el) 4522b498c8a0SJuan Quintela TARGET_ARCH=mips64 45236acff7daSJuan Quintela TARGET_BASE_ARCH=mips 452425be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 45252408a527Saurel32 ;; 4526d15a9c23SAnthony Green moxie) 4527d15a9c23SAnthony Green ;; 4528e67db06eSJia Liu or32) 4529e67db06eSJia Liu TARGET_ARCH=openrisc 4530e67db06eSJia Liu TARGET_BASE_ARCH=openrisc 4531e67db06eSJia Liu ;; 45322408a527Saurel32 ppc) 4533c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 45342408a527Saurel32 ;; 45352408a527Saurel32 ppcemb) 45366acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4537e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4538c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 45392408a527Saurel32 ;; 45402408a527Saurel32 ppc64) 45416acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4542e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 4543c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 45442408a527Saurel32 ;; 45452408a527Saurel32 ppc64abi32) 4546b498c8a0SJuan Quintela TARGET_ARCH=ppc64 45476acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 4548e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 454925be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 4550c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 45512408a527Saurel32 ;; 45522408a527Saurel32 sh4|sh4eb) 4553b498c8a0SJuan Quintela TARGET_ARCH=sh4 45544dbed897Spbrook bflt="yes" 45552408a527Saurel32 ;; 45562408a527Saurel32 sparc) 45572408a527Saurel32 ;; 45582408a527Saurel32 sparc64) 45596acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 45602408a527Saurel32 ;; 45612408a527Saurel32 sparc32plus) 4562b498c8a0SJuan Quintela TARGET_ARCH=sparc64 45636acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 4564e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 456525be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 45662408a527Saurel32 ;; 456724e804ecSAlexander Graf s390x) 456824e804ecSAlexander Graf ;; 4569d2fbca94SGuan Xuetao unicore32) 4570d2fbca94SGuan Xuetao ;; 4571cfa550c6SMax Filippov xtensa|xtensaeb) 4572cfa550c6SMax Filippov TARGET_ARCH=xtensa 4573cfa550c6SMax Filippov ;; 45742408a527Saurel32 *) 457576ad07a4SPeter Maydell error_exit "Unsupported target CPU" 45762408a527Saurel32 ;; 45772408a527Saurel32esac 45785e8861a0SPaolo Bonzini# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 45795e8861a0SPaolo Bonziniif [ "$TARGET_BASE_ARCH" = "" ]; then 45805e8861a0SPaolo Bonzini TARGET_BASE_ARCH=$TARGET_ARCH 45815e8861a0SPaolo Bonzinifi 45825e8861a0SPaolo Bonzini 45835e8861a0SPaolo Bonzinisymlink "$source_path/Makefile.target" "$target_dir/Makefile" 45845e8861a0SPaolo Bonzini 458599afc91dSDaniel P. Berrangeupper() { 458699afc91dSDaniel P. Berrange echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' 458799afc91dSDaniel P. Berrange} 458899afc91dSDaniel P. Berrange 458999afc91dSDaniel P. Berrangetarget_arch_name="`upper $TARGET_ARCH`" 459025be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 4591c1799a84SPaolo Bonziniecho "TARGET_NAME=$target_name" >> $config_target_mak 459225be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 4593e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 4594e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 4595e6e91b9cSJuan Quintelafi 459625be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 4597c1799a84SPaolo Bonzinicase "$target_name" in 45981b0c87fcSJuan Quintela i386|x86_64) 45991b0c87fcSJuan Quintela if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then 460025be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 4601eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = yes; then 4602eb6fda0fSAnthony PERARD echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" 4603eb6fda0fSAnthony PERARD fi 4604432d268cSJun Nakajima fi 460559d21e53SAlexander Graf ;; 460659d21e53SAlexander Graf *) 46071b0c87fcSJuan Quintelaesac 4608c1799a84SPaolo Bonzinicase "$target_name" in 460970a5f682SPeter Maydell aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x) 4610c59249f9SJuan Quintela # Make sure the target and host cpus are compatible 4611c59249f9SJuan Quintela if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ 4612c1799a84SPaolo Bonzini \( "$target_name" = "$cpu" -o \ 4613c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc" \) -o \ 4614c1799a84SPaolo Bonzini \( "$target_name" = "ppc64" -a "$cpu" = "ppc" \) -o \ 4615c1799a84SPaolo Bonzini \( "$target_name" = "ppc" -a "$cpu" = "ppc64" \) -o \ 4616c1799a84SPaolo Bonzini \( "$target_name" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ 4617c1799a84SPaolo Bonzini \( "$target_name" = "x86_64" -a "$cpu" = "i386" \) -o \ 4618c1799a84SPaolo Bonzini \( "$target_name" = "i386" -a "$cpu" = "x86_64" \) \) ; then 461925be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 46201ba16968SStefan Weil if test "$vhost_net" = "yes" ; then 4621d5970055SMichael S. Tsirkin echo "CONFIG_VHOST_NET=y" >> $config_target_mak 4622d5970055SMichael S. Tsirkin fi 4623c59249f9SJuan Quintela fi 4624c59249f9SJuan Quintelaesac 4625de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 462625be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 462797a847bcSbellardfi 462897a847bcSbellardif test "$target_softmmu" = "yes" ; then 462925be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 4630de83cd02Sbellardfi 4631997344f3Sbellardif test "$target_user_only" = "yes" ; then 463225be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 4633a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 4634997344f3Sbellardfi 4635831b7825Sthsif test "$target_linux_user" = "yes" ; then 463625be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 4637831b7825Sthsfi 463856aebc89Spbrooklist="" 463956aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 464056aebc89Spbrook for x in $gdb_xml_files; do 464156aebc89Spbrook list="$list $source_path/gdb-xml/$x" 464256aebc89Spbrook done 464325be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 46443d0f1517SJuan Quintelafi 4645de83cd02Sbellard 4646e5fe0c52Spbrookif test "$target_user_only" = "yes" -a "$bflt" = "yes"; then 464725be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 4648e5fe0c52Spbrookfi 4649379f6698SPaul Brookif test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then 465025be210fSJuan Quintela echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak 4651379f6698SPaul Brookfi 465284778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 465325be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 465484778508Sblueswir1fi 46555b0753e0Sbellard 46564afddb55SJuan Quintela# generate QEMU_CFLAGS/LDFLAGS for targets 4657fa282484SJuan Quintela 46584afddb55SJuan Quintelacflags="" 4659fa282484SJuan Quintelaldflags="" 46609b8e111fSJuan Quintela 466164656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 466264656024SJuan Quintela case "$i" in 466364656024SJuan Quintela alpha) 466425be210fSJuan Quintela echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak 466576cad711SPaolo Bonzini echo "CONFIG_ALPHA_DIS=y" >> config-all-disas.mak 466664656024SJuan Quintela ;; 466764656024SJuan Quintela arm) 466825be210fSJuan Quintela echo "CONFIG_ARM_DIS=y" >> $config_target_mak 466976cad711SPaolo Bonzini echo "CONFIG_ARM_DIS=y" >> config-all-disas.mak 467064656024SJuan Quintela ;; 467164656024SJuan Quintela cris) 467225be210fSJuan Quintela echo "CONFIG_CRIS_DIS=y" >> $config_target_mak 467376cad711SPaolo Bonzini echo "CONFIG_CRIS_DIS=y" >> config-all-disas.mak 467464656024SJuan Quintela ;; 467564656024SJuan Quintela hppa) 467625be210fSJuan Quintela echo "CONFIG_HPPA_DIS=y" >> $config_target_mak 467776cad711SPaolo Bonzini echo "CONFIG_HPPA_DIS=y" >> config-all-disas.mak 467864656024SJuan Quintela ;; 4679c72b26ecSRichard Henderson i386|x86_64|x32) 468025be210fSJuan Quintela echo "CONFIG_I386_DIS=y" >> $config_target_mak 468176cad711SPaolo Bonzini echo "CONFIG_I386_DIS=y" >> config-all-disas.mak 468264656024SJuan Quintela ;; 4683903ec55cSAurelien Jarno ia64*) 4684903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $config_target_mak 468576cad711SPaolo Bonzini echo "CONFIG_IA64_DIS=y" >> config-all-disas.mak 4686903ec55cSAurelien Jarno ;; 468779368f49SMichael Walle lm32) 468879368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $config_target_mak 468976cad711SPaolo Bonzini echo "CONFIG_LM32_DIS=y" >> config-all-disas.mak 469079368f49SMichael Walle ;; 469164656024SJuan Quintela m68k) 469225be210fSJuan Quintela echo "CONFIG_M68K_DIS=y" >> $config_target_mak 469376cad711SPaolo Bonzini echo "CONFIG_M68K_DIS=y" >> config-all-disas.mak 469464656024SJuan Quintela ;; 4695877fdc12SEdgar E. Iglesias microblaze*) 469625be210fSJuan Quintela echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak 469776cad711SPaolo Bonzini echo "CONFIG_MICROBLAZE_DIS=y" >> config-all-disas.mak 469864656024SJuan Quintela ;; 469964656024SJuan Quintela mips*) 470025be210fSJuan Quintela echo "CONFIG_MIPS_DIS=y" >> $config_target_mak 470176cad711SPaolo Bonzini echo "CONFIG_MIPS_DIS=y" >> config-all-disas.mak 470264656024SJuan Quintela ;; 4703d15a9c23SAnthony Green moxie*) 4704d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> $config_target_mak 4705d15a9c23SAnthony Green echo "CONFIG_MOXIE_DIS=y" >> config-all-disas.mak 4706d15a9c23SAnthony Green ;; 4707e67db06eSJia Liu or32) 4708e67db06eSJia Liu echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak 470976cad711SPaolo Bonzini echo "CONFIG_OPENRISC_DIS=y" >> config-all-disas.mak 4710e67db06eSJia Liu ;; 471164656024SJuan Quintela ppc*) 471225be210fSJuan Quintela echo "CONFIG_PPC_DIS=y" >> $config_target_mak 471376cad711SPaolo Bonzini echo "CONFIG_PPC_DIS=y" >> config-all-disas.mak 471464656024SJuan Quintela ;; 471524e804ecSAlexander Graf s390*) 471625be210fSJuan Quintela echo "CONFIG_S390_DIS=y" >> $config_target_mak 471776cad711SPaolo Bonzini echo "CONFIG_S390_DIS=y" >> config-all-disas.mak 471864656024SJuan Quintela ;; 471964656024SJuan Quintela sh4) 472025be210fSJuan Quintela echo "CONFIG_SH4_DIS=y" >> $config_target_mak 472176cad711SPaolo Bonzini echo "CONFIG_SH4_DIS=y" >> config-all-disas.mak 472264656024SJuan Quintela ;; 472364656024SJuan Quintela sparc*) 472425be210fSJuan Quintela echo "CONFIG_SPARC_DIS=y" >> $config_target_mak 472576cad711SPaolo Bonzini echo "CONFIG_SPARC_DIS=y" >> config-all-disas.mak 472664656024SJuan Quintela ;; 4727cfa550c6SMax Filippov xtensa*) 4728cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak 472976cad711SPaolo Bonzini echo "CONFIG_XTENSA_DIS=y" >> config-all-disas.mak 4730cfa550c6SMax Filippov ;; 473164656024SJuan Quintela esac 473264656024SJuan Quinteladone 47339195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 47349195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $config_target_mak 473576cad711SPaolo Bonzini echo "CONFIG_TCI_DIS=y" >> config-all-disas.mak 47369195b2c2SStefan Weilfi 473764656024SJuan Quintela 47386ee7126fSJuan Quintelacase "$ARCH" in 47396ee7126fSJuan Quintelaalpha) 47406ee7126fSJuan Quintela # Ensure there's only a single GP 47416ee7126fSJuan Quintela cflags="-msmall-data $cflags" 47426ee7126fSJuan Quintela;; 47436ee7126fSJuan Quintelaesac 47446ee7126fSJuan Quintela 4745d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 474625be210fSJuan Quintela echo "TARGET_GPROF=yes" >> $config_target_mak 4747d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 4748d02c1db3SJuan Quintela cflags="-p $cflags" 4749d02c1db3SJuan Quintela ldflags="-p $ldflags" 4750d02c1db3SJuan Quintela fi 4751d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 4752d02c1db3SJuan Quintela ldflags="-p $ldflags" 475325be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 4754d02c1db3SJuan Quintela fi 4755d02c1db3SJuan Quintelafi 4756d02c1db3SJuan Quintela 47579b8e111fSJuan Quintelaif test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then 4758964c6fa1SRichard Henderson ldflags="$ldflags $textseg_ldflags" 4759fa282484SJuan Quintelafi 4760fa282484SJuan Quintela 476125be210fSJuan Quintelaecho "LDFLAGS+=$ldflags" >> $config_target_mak 476225be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 4763fa282484SJuan Quintela 476497a847bcSbellarddone # for target in $targets 47657d13299dSbellard 4766b776eca1SGerd Hoffmannif [ "$pixman" = "internal" ]; then 4767b776eca1SGerd Hoffmann echo "config-host.h: subdir-pixman" >> $config_host_mak 4768b776eca1SGerd Hoffmannfi 4769b776eca1SGerd Hoffmann 47702da776dbSMichael R. Hinesif test "$rdma" = "yes" ; then 47712da776dbSMichael R. Hinesecho "CONFIG_RDMA=y" >> $config_host_mak 47722da776dbSMichael R. Hinesfi 47732da776dbSMichael R. Hines 4774a540f158SPeter Crosthwaiteif [ "$dtc_internal" = "yes" ]; then 4775a540f158SPeter Crosthwaite echo "config-host.h: subdir-dtc" >> $config_host_mak 4776a540f158SPeter Crosthwaitefi 4777a540f158SPeter Crosthwaite 4778d1807a4fSPaolo Bonzini# build tree in object directory in case the source is not in the current directory 4779f93296eaSWenchao XiaDIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests" 47802b170effSMichael TokarevDIRS="$DIRS fsdev" 47819933c305SChristian BorntraegerDIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" 47822d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 47832dee8d54SPaolo BonziniDIRS="$DIRS qapi-generated" 4784c09015ddSAnthony LiguoriFILES="Makefile tests/tcg/Makefile qdict-test-data.txt" 4785c09015ddSAnthony LiguoriFILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" 4786aaa2ebc5SAndreas FärberFILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" 4787ae0bfb79SBlue SwirlFILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" 4788446b9165SAndreas FärberFILES="$FILES pc-bios/spapr-rtas/Makefile" 47899933c305SChristian BorntraegerFILES="$FILES pc-bios/s390-ccw/Makefile" 47902d9f27d2SAnthony LiguoriFILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" 47914652b792SJan KiszkaFILES="$FILES pc-bios/qemu-icon.bmp" 4792753d11f2SRichard Hendersonfor bios_file in \ 4793753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 47945acc2ec0SGerd Hoffmann $source_path/pc-bios/*.aml \ 4795753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 4796753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 4797e89e33e1SDominik Dingel $source_path/pc-bios/*.img \ 4798753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 4799753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 4800753d11f2SRichard Hendersondo 48017ea78b74SJan Kiszka FILES="$FILES pc-bios/`basename $bios_file`" 48027ea78b74SJan Kiszkadone 4803c2304b52SMarcel Apfelbaumfor test_file in `find $source_path/tests/acpi-test-data -type f` 4804c2304b52SMarcel Apfelbaumdo 4805c2304b52SMarcel Apfelbaum FILES="$FILES tests/acpi-test-data`echo $test_file | sed -e 's/.*acpi-test-data//'`" 4806c2304b52SMarcel Apfelbaumdone 4807d1807a4fSPaolo Bonzinimkdir -p $DIRS 48087d13299dSbellardfor f in $FILES ; do 480972b8b5a1SStefan Weil if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then 4810f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 4811f9245e10SPeter Maydell fi 48127d13299dSbellarddone 48131ad2134fSPaul Brook 4814c34ebfdcSAnthony Liguori# temporary config to build submodules 48152d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 4816c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 481737116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 4818c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 48193dd46c78SBlue Swirl echo "AS=$as" >> $config_mak 4820c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 4821c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 48223dd46c78SBlue Swirl echo "CPP=$cpp" >> $config_mak 4823c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 4824a31a8642SMichael S. Tsirkin echo "IASL=$iasl" >> $config_mak 4825c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 4826c34ebfdcSAnthony Liguoridone 4827c34ebfdcSAnthony Liguori 4828b40292e7SJan Kiszkaif test "$docs" = "yes" ; then 4829b40292e7SJan Kiszka mkdir -p QMP 4830b40292e7SJan Kiszkafi 4831