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 308dc38a78SPeter Maydelldo_cc() { 318dc38a78SPeter Maydell # Run the compiler, capturing its output to the log. 328dc38a78SPeter Maydell echo $cc "$@" >> config.log 338dc38a78SPeter Maydell $cc "$@" >> config.log 2>&1 || return $? 348dc38a78SPeter Maydell # Test passed. If this is an --enable-werror build, rerun 358dc38a78SPeter Maydell # the test with -Werror and bail out if it fails. This 368dc38a78SPeter Maydell # makes warning-generating-errors in configure test code 378dc38a78SPeter Maydell # obvious to developers. 388dc38a78SPeter Maydell if test "$werror" != "yes"; then 398dc38a78SPeter Maydell return 0 408dc38a78SPeter Maydell fi 418dc38a78SPeter Maydell # Don't bother rerunning the compile if we were already using -Werror 428dc38a78SPeter Maydell case "$*" in 438dc38a78SPeter Maydell *-Werror*) 448dc38a78SPeter Maydell return 0 458dc38a78SPeter Maydell ;; 468dc38a78SPeter Maydell esac 478dc38a78SPeter Maydell echo $cc -Werror "$@" >> config.log 488dc38a78SPeter Maydell $cc -Werror "$@" >> config.log 2>&1 && return $? 498dc38a78SPeter Maydell echo "ERROR: configure test passed without -Werror but failed with -Werror." 508dc38a78SPeter Maydell echo "This is probably a bug in the configure script. The failing command" 518dc38a78SPeter Maydell echo "will be at the bottom of config.log." 528dc38a78SPeter Maydell echo "You can run configure with --disable-werror to bypass this check." 538dc38a78SPeter Maydell exit 1 548dc38a78SPeter Maydell} 558dc38a78SPeter Maydell 5652166aa0SJuan Quintelacompile_object() { 578dc38a78SPeter Maydell do_cc $QEMU_CFLAGS -c -o $TMPO $TMPC 5852166aa0SJuan Quintela} 5952166aa0SJuan Quintela 6052166aa0SJuan Quintelacompile_prog() { 6152166aa0SJuan Quintela local_cflags="$1" 6252166aa0SJuan Quintela local_ldflags="$2" 638dc38a78SPeter Maydell do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags 6452166aa0SJuan Quintela} 6552166aa0SJuan Quintela 6611568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 6711568d6dSPaolo Bonzinisymlink() { 6872b8b5a1SStefan Weil rm -rf "$2" 69ec5b06d7SAnthony Liguori mkdir -p "$(dirname "$2")" 7072b8b5a1SStefan Weil ln -s "$1" "$2" 7111568d6dSPaolo Bonzini} 7211568d6dSPaolo Bonzini 730dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 740dba6195SLoïc Minier# executable or a builtin) 750dba6195SLoïc Minierhas() { 760dba6195SLoïc Minier type "$1" >/dev/null 2>&1 770dba6195SLoïc Minier} 780dba6195SLoïc Minier 790dba6195SLoïc Minier# search for an executable in PATH 800dba6195SLoïc Minierpath_of() { 810dba6195SLoïc Minier local_command="$1" 820dba6195SLoïc Minier local_ifs="$IFS" 830dba6195SLoïc Minier local_dir="" 840dba6195SLoïc Minier 850dba6195SLoïc Minier # pathname has a dir component? 860dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 870dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 880dba6195SLoïc Minier echo "$local_command" 890dba6195SLoïc Minier return 0 900dba6195SLoïc Minier fi 910dba6195SLoïc Minier fi 920dba6195SLoïc Minier if [ -z "$local_command" ]; then 930dba6195SLoïc Minier return 1 940dba6195SLoïc Minier fi 950dba6195SLoïc Minier 960dba6195SLoïc Minier IFS=: 970dba6195SLoïc Minier for local_dir in $PATH; do 980dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 990dba6195SLoïc Minier echo "$local_dir/$local_command" 1000dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1010dba6195SLoïc Minier return 0 1020dba6195SLoïc Minier fi 1030dba6195SLoïc Minier done 1040dba6195SLoïc Minier # not found 1050dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 1060dba6195SLoïc Minier return 1 1070dba6195SLoïc Minier} 1080dba6195SLoïc Minier 1097d13299dSbellard# default parameters 110ca4deeb1SPaolo Bonzinisource_path=`dirname "$0"` 1112ff6b91eSJuan Quintelacpu="" 1121e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 11343ce4dfeSbellardstatic="no" 1147d13299dSbellardcross_prefix="" 1150c58ac1cSmalcaudio_drv_list="" 11661dc008fSAnthony Liguoriaudio_card_list="ac97 es1370 sb16 hda" 11761dc008fSAnthony Liguoriaudio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda" 118eb852011SMarkus Armbrusterblock_drv_whitelist="" 1197d13299dSbellardhost_cc="gcc" 12073da375eSJuan Quintelalibs_softmmu="" 1213e2e0e6bSJuan Quintelalibs_tools="" 12267f86e8eSJuan Quintelaaudio_pt_int="" 123d5631638Smalcaudio_win_int="" 1242b2e59e6SPaolo Bonzinicc_i386=i386-pc-linux-gnu-gcc 125957f1f99SMichael Rothlibs_qga="" 1265bc62e01SGerd Hoffmanndebug_info="yes" 127ac0df51dSaliguori 128afb63ebdSStefan Weil# Don't accept a target_list environment variable. 129afb63ebdSStefan Weilunset target_list 130377529c0SPaolo Bonzini 131377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 132377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 133377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 134377529c0SPaolo Bonzini# unless --disable-foo is given 135377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 136377529c0SPaolo Bonzini# feature will searched for, 137377529c0SPaolo Bonzini# if not found, configure exits with error 138377529c0SPaolo Bonzini# 139377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 140377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 141377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 142377529c0SPaolo Bonzini 143377529c0SPaolo Bonzinibluez="" 144377529c0SPaolo Bonzinibrlapi="" 145377529c0SPaolo Bonzinicurl="" 146377529c0SPaolo Bonzinicurses="" 147377529c0SPaolo Bonzinidocs="" 148377529c0SPaolo Bonzinifdt="" 149377529c0SPaolo Bonzininptl="" 150e2134eb9SGerd Hoffmannpixman="" 151377529c0SPaolo Bonzinisdl="" 152983eef5aSMeador Ingevirtfs="" 153821601eaSJes Sorensenvnc="yes" 154377529c0SPaolo Bonzinisparse="no" 155377529c0SPaolo Bonziniuuid="" 156377529c0SPaolo Bonzinivde="" 157377529c0SPaolo Bonzinivnc_tls="" 158377529c0SPaolo Bonzinivnc_sasl="" 159377529c0SPaolo Bonzinivnc_jpeg="" 160377529c0SPaolo Bonzinivnc_png="" 161377529c0SPaolo Bonzinixen="" 162d5b93ddfSAnthony PERARDxen_ctrl_version="" 163eb6fda0fSAnthony PERARDxen_pci_passthrough="" 164377529c0SPaolo Bonzinilinux_aio="" 16547e98658SCorey Bryantcap_ng="" 166377529c0SPaolo Bonziniattr="" 1674f26f2b6SAvi Kivitylibattr="" 168377529c0SPaolo Bonzinixfs="" 169377529c0SPaolo Bonzini 170d41a75a2SBradvhost_net="no" 171d41a75a2SBradkvm="no" 172377529c0SPaolo Bonzinigprof="no" 173377529c0SPaolo Bonzinidebug_tcg="no" 174377529c0SPaolo Bonzinidebug="no" 175377529c0SPaolo Bonzinistrip_opt="yes" 1769195b2c2SStefan Weiltcg_interpreter="no" 177377529c0SPaolo Bonzinibigendian="no" 178377529c0SPaolo Bonzinimingw32="no" 179377529c0SPaolo BonziniEXESUF="" 180377529c0SPaolo Bonziniprefix="/usr/local" 181377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 182528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 183850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 184377529c0SPaolo Bonzinibindir="\${prefix}/bin" 1853aa5d2beSAlon Levylibdir="\${prefix}/lib" 1868bf188aaSMichael Tokarevlibexecdir="\${prefix}/libexec" 1870f94d6daSAlon Levyincludedir="\${prefix}/include" 188377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 189785c23aeSLuiz Capitulinolocal_statedir="\${prefix}/var" 190377529c0SPaolo Bonziniconfsuffix="/qemu" 191377529c0SPaolo Bonzinislirp="yes" 192377529c0SPaolo Bonzinifmod_lib="" 193377529c0SPaolo Bonzinifmod_inc="" 194377529c0SPaolo Bonzinioss_lib="" 195377529c0SPaolo Bonzinibsd="no" 196377529c0SPaolo Bonzinilinux="no" 197377529c0SPaolo Bonzinisolaris="no" 198377529c0SPaolo Bonziniprofiler="no" 199377529c0SPaolo Bonzinicocoa="no" 200377529c0SPaolo Bonzinisoftmmu="yes" 201377529c0SPaolo Bonzinilinux_user="no" 202377529c0SPaolo Bonzinibsd_user="no" 20330163d89SPeter Maydellguest_base="yes" 204377529c0SPaolo Bonziniuname_release="" 205377529c0SPaolo Bonzinimixemu="no" 206377529c0SPaolo Bonziniaix="no" 207377529c0SPaolo Bonziniblobs="yes" 208377529c0SPaolo Bonzinipkgversion="" 20940d6444eSAvi Kivitypie="" 210377529c0SPaolo Bonzinizero_malloc="" 211377529c0SPaolo Bonzinitrace_backend="nop" 212377529c0SPaolo Bonzinitrace_file="trace" 213377529c0SPaolo Bonzinispice="" 214377529c0SPaolo Bonzinirbd="" 21536707144SAlon Levysmartcard="" 216111a38b0SRobert Relyeasmartcard_nss="" 21769354a83SHans de Goedeusb_redir="" 218430a3c18SMichael Walleopengl="" 2191ece9905SAlon Levyzlib="yes" 220d138cee9SMichael Rothguest_agent="yes" 2214b1c11fdSDaniel P. Berrangewant_tools="yes" 222c589b249SRonnie Sahlberglibiscsi="" 223519175a2SAlex Barcelocoroutine="" 224f794573eSEduardo Otuboseccomp="" 225eb100396SBharata B Raoglusterfs="" 226377529c0SPaolo Bonzini 227ac0df51dSaliguori# parse CC options first 228ac0df51dSaliguorifor opt do 229ac0df51dSaliguori optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 230ac0df51dSaliguori case "$opt" in 231ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 232ac0df51dSaliguori ;; 2333d8df640SPaolo Bonzini --cc=*) CC="$optarg" 234ac0df51dSaliguori ;; 235ca4deeb1SPaolo Bonzini --source-path=*) source_path="$optarg" 236ca4deeb1SPaolo Bonzini ;; 2372ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 2382ff6b91eSJuan Quintela ;; 239a558ee17SJuan Quintela --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" 240e2a2ed06SJuan Quintela ;; 241e2a2ed06SJuan Quintela --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" 242e2a2ed06SJuan Quintela ;; 2435bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 2445bc62e01SGerd Hoffmann ;; 2455bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 2465bc62e01SGerd Hoffmann ;; 247ac0df51dSaliguori esac 248ac0df51dSaliguoridone 249ac0df51dSaliguori# OS specific 250ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 25193148aa5SStefan Weil# we can eliminate its usage altogether. 252ac0df51dSaliguori 253b3198cc2SStuart Yodercc="${CC-${cross_prefix}gcc}" 254b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 255b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 256b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 2573f534581SBradlibtool="${LIBTOOL-${cross_prefix}libtool}" 258b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 259b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 26017884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 26117884d7bSSergei Trofimovichquery_pkg_config() { 26217884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 26317884d7bSSergei Trofimovich} 26417884d7bSSergei Trofimovichpkg_config=query_pkg_config 265b3198cc2SStuart Yodersdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" 266ac0df51dSaliguori 267be17dc90SMichael S. Tsirkin# default flags for all hosts 268be17dc90SMichael S. TsirkinQEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" 269f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 270be17dc90SMichael S. TsirkinQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 271be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 272cbbab922SPaolo BonziniQEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" 2735bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 2745bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 275be17dc90SMichael S. Tsirkin LDFLAGS="-g $LDFLAGS" 2765bc62e01SGerd Hoffmannfi 277be17dc90SMichael S. Tsirkin 278ca4deeb1SPaolo Bonzini# make source path absolute 279ca4deeb1SPaolo Bonzinisource_path=`cd "$source_path"; pwd` 280ca4deeb1SPaolo Bonzini 281ac0df51dSaliguoricheck_define() { 282ac0df51dSaliguoricat > $TMPC <<EOF 283ac0df51dSaliguori#if !defined($1) 284fd786e1aSPeter Maydell#error $1 not defined 285ac0df51dSaliguori#endif 286ac0df51dSaliguoriint main(void) { return 0; } 287ac0df51dSaliguoriEOF 28852166aa0SJuan Quintela compile_object 289ac0df51dSaliguori} 290ac0df51dSaliguori 291bbea4050SPeter Maydellif check_define __linux__ ; then 292bbea4050SPeter Maydell targetos="Linux" 293bbea4050SPeter Maydellelif check_define _WIN32 ; then 294bbea4050SPeter Maydell targetos='MINGW32' 295bbea4050SPeter Maydellelif check_define __OpenBSD__ ; then 296bbea4050SPeter Maydell targetos='OpenBSD' 297bbea4050SPeter Maydellelif check_define __sun__ ; then 298bbea4050SPeter Maydell targetos='SunOS' 299bbea4050SPeter Maydellelif check_define __HAIKU__ ; then 300bbea4050SPeter Maydell targetos='Haiku' 301bbea4050SPeter Maydellelse 302bbea4050SPeter Maydell targetos=`uname -s` 303bbea4050SPeter Maydellfi 304bbea4050SPeter Maydell 305bbea4050SPeter Maydell# Some host OSes need non-standard checks for which CPU to use. 306bbea4050SPeter Maydell# Note that these checks are broken for cross-compilation: if you're 307bbea4050SPeter Maydell# cross-compiling to one of these OSes then you'll need to specify 308bbea4050SPeter Maydell# the correct CPU with the --cpu option. 309bbea4050SPeter Maydellcase $targetos in 310bbea4050SPeter MaydellDarwin) 311bbea4050SPeter Maydell # on Leopard most of the system is 32-bit, so we have to ask the kernel if we can 312bbea4050SPeter Maydell # run 64-bit userspace code. 313bbea4050SPeter Maydell # If the user didn't specify a CPU explicitly and the kernel says this is 314bbea4050SPeter Maydell # 64 bit hw, then assume x86_64. Otherwise fall through to the usual detection code. 315bbea4050SPeter Maydell if test -z "$cpu" && test "$(sysctl -n hw.optional.x86_64)" = "1"; then 316bbea4050SPeter Maydell cpu="x86_64" 317bbea4050SPeter Maydell fi 318bbea4050SPeter Maydell ;; 319bbea4050SPeter MaydellSunOS) 320bbea4050SPeter Maydell # `uname -m` returns i86pc even on an x86_64 box, so default based on isainfo 321bbea4050SPeter Maydell if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then 322bbea4050SPeter Maydell cpu="x86_64" 323bbea4050SPeter Maydell fi 324bbea4050SPeter Maydellesac 325bbea4050SPeter Maydell 3262ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 3272ff6b91eSJuan Quintela # command line argument 3282ff6b91eSJuan Quintela : 3292ff6b91eSJuan Quintelaelif check_define __i386__ ; then 330ac0df51dSaliguori cpu="i386" 331ac0df51dSaliguorielif check_define __x86_64__ ; then 332ac0df51dSaliguori cpu="x86_64" 3333aa9bd6cSblueswir1elif check_define __sparc__ ; then 3343aa9bd6cSblueswir1 if check_define __arch64__ ; then 3353aa9bd6cSblueswir1 cpu="sparc64" 3363aa9bd6cSblueswir1 else 3373aa9bd6cSblueswir1 cpu="sparc" 3383aa9bd6cSblueswir1 fi 339fdf7ed96Smalcelif check_define _ARCH_PPC ; then 340fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 341fdf7ed96Smalc cpu="ppc64" 342ac0df51dSaliguori else 343fdf7ed96Smalc cpu="ppc" 344fdf7ed96Smalc fi 345afa05235SAurelien Jarnoelif check_define __mips__ ; then 346afa05235SAurelien Jarno cpu="mips" 347477ba620SAurelien Jarnoelif check_define __ia64__ ; then 348477ba620SAurelien Jarno cpu="ia64" 349d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 350d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 351d66ed0eaSAurelien Jarno cpu="s390x" 352d66ed0eaSAurelien Jarno else 353d66ed0eaSAurelien Jarno cpu="s390" 354d66ed0eaSAurelien Jarno fi 35521d89f84SPeter Maydellelif check_define __arm__ ; then 35621d89f84SPeter Maydell cpu="arm" 357f28ffed5SBradelif check_define __hppa__ ; then 358f28ffed5SBrad cpu="hppa" 359fdf7ed96Smalcelse 360fdf7ed96Smalc cpu=`uname -m` 361ac0df51dSaliguorifi 362ac0df51dSaliguori 363359bc95dSPeter MaydellARCH= 364359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 365359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 3667d13299dSbellardcase "$cpu" in 367359bc95dSPeter Maydell ia64|ppc|ppc64|s390|s390x|sparc64) 368ea8f20f8SJuan Quintela cpu="$cpu" 369ea8f20f8SJuan Quintela ;; 3707d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 37197a847bcSbellard cpu="i386" 3727d13299dSbellard ;; 373aaa5fa14Saurel32 x86_64|amd64) 374aaa5fa14Saurel32 cpu="x86_64" 375aaa5fa14Saurel32 ;; 37621d89f84SPeter Maydell armv*b|armv*l|arm) 37721d89f84SPeter Maydell cpu="arm" 3787d13299dSbellard ;; 379f28ffed5SBrad hppa|parisc|parisc64) 380f54b3f92Saurel32 cpu="hppa" 381f54b3f92Saurel32 ;; 382afa05235SAurelien Jarno mips*) 383afa05235SAurelien Jarno cpu="mips" 384afa05235SAurelien Jarno ;; 3853142255cSblueswir1 sparc|sun4[cdmuv]) 386ae228531Sbellard cpu="sparc" 387ae228531Sbellard ;; 3887d13299dSbellard *) 389359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 390359bc95dSPeter Maydell ARCH=unknown 3917d13299dSbellard ;; 3927d13299dSbellardesac 393359bc95dSPeter Maydellif test -z "$ARCH"; then 394359bc95dSPeter Maydell ARCH="$cpu" 395359bc95dSPeter Maydellfi 396e2d52ad3SJuan Quintela 3977d13299dSbellard# OS specific 3980dbfc675SJuan Quintela 3997d13299dSbellardcase $targetos in 400c326e0afSbellardCYGWIN*) 401c326e0afSbellard mingw32="yes" 402a558ee17SJuan Quintela QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" 403d5631638Smalc audio_possible_drivers="winwave sdl" 404d5631638Smalc audio_drv_list="winwave" 405c326e0afSbellard;; 40667b915a5SbellardMINGW32*) 40767b915a5Sbellard mingw32="yes" 408d5631638Smalc audio_possible_drivers="winwave dsound sdl fmod" 409d5631638Smalc audio_drv_list="winwave" 41067b915a5Sbellard;; 4115c40d2bdSthsGNU/kFreeBSD) 412a167ba50SAurelien Jarno bsd="yes" 4130c58ac1cSmalc audio_drv_list="oss" 414f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 4155c40d2bdSths;; 4167d3505c5SbellardFreeBSD) 4177d3505c5Sbellard bsd="yes" 4180db4a067SPaolo Bonzini make="${MAKE-gmake}" 4190c58ac1cSmalc audio_drv_list="oss" 420f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 421f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 422f01576f1SJuergen Lock LIBS="-lutil $LIBS" 4237d3505c5Sbellard;; 424c5e97233Sblueswir1DragonFly) 425c5e97233Sblueswir1 bsd="yes" 4260db4a067SPaolo Bonzini make="${MAKE-gmake}" 427c5e97233Sblueswir1 audio_drv_list="oss" 428c5e97233Sblueswir1 audio_possible_drivers="oss sdl esd pa" 429c5e97233Sblueswir1;; 4307d3505c5SbellardNetBSD) 4317d3505c5Sbellard bsd="yes" 4320db4a067SPaolo Bonzini make="${MAKE-gmake}" 4330c58ac1cSmalc audio_drv_list="oss" 434c2de5c91Smalc audio_possible_drivers="oss sdl esd" 4358ef92a88Sblueswir1 oss_lib="-lossaudio" 4367d3505c5Sbellard;; 4377d3505c5SbellardOpenBSD) 4387d3505c5Sbellard bsd="yes" 4390db4a067SPaolo Bonzini make="${MAKE-gmake}" 4400c58ac1cSmalc audio_drv_list="oss" 441c2de5c91Smalc audio_possible_drivers="oss sdl esd" 4422f6a1ab0Sblueswir1 oss_lib="-lossaudio" 4437d3505c5Sbellard;; 44483fb7adfSbellardDarwin) 44583fb7adfSbellard bsd="yes" 44683fb7adfSbellard darwin="yes" 4471b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 448a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 4490c439cbfSJuan Quintela LDFLAGS="-arch x86_64 $LDFLAGS" 4501b0f9cc2Saliguori else 451a558ee17SJuan Quintela QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" 4521b0f9cc2Saliguori fi 453fd677642Sths cocoa="yes" 4540c58ac1cSmalc audio_drv_list="coreaudio" 455c2de5c91Smalc audio_possible_drivers="coreaudio sdl fmod" 4560c439cbfSJuan Quintela LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" 4577973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 458a0b7cf6bSPeter Maydell # Disable attempts to use ObjectiveC features in os/object.h since they 459a0b7cf6bSPeter Maydell # won't work when we're compiling with gcc as a C compiler. 460a0b7cf6bSPeter Maydell QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" 46183fb7adfSbellard;; 462ec530c81SbellardSunOS) 463ec530c81Sbellard solaris="yes" 4640db4a067SPaolo Bonzini make="${MAKE-gmake}" 4650db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 466fa58948dSBlue Swirl ld="gld" 467e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 4680475a5caSths needs_libsunmath="no" 469c2b84fabSths solarisrev=`uname -r | cut -f2 -d.` 470c2b84fabSths if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 4710475a5caSths if test "$solarisrev" -le 9 ; then 4720475a5caSths if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then 4730475a5caSths needs_libsunmath="yes" 474f14bfdf9SJuan Quintela QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" 475f14bfdf9SJuan Quintela LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" 476f14bfdf9SJuan Quintela LIBS="-lsunmath $LIBS" 4770475a5caSths else 4780475a5caSths echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" 4790475a5caSths echo "libsunmath from the Sun Studio compilers tools, due to a lack of" 4800475a5caSths echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" 4810475a5caSths echo "Studio 11 can be downloaded from www.sun.com." 4820475a5caSths exit 1 4830475a5caSths fi 4840475a5caSths fi 48586b2bd93Sths fi 4866b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 4870c58ac1cSmalc audio_drv_list="oss" 4886b4d2ba1Sths fi 489c2de5c91Smalc audio_possible_drivers="oss sdl" 490d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 491d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 492d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 493d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 494a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 495560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 496560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 497560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 498ec530c81Sbellard;; 499b29fe3edSmalcAIX) 500b29fe3edSmalc aix="yes" 5010db4a067SPaolo Bonzini make="${MAKE-gmake}" 502b29fe3edSmalc;; 503179cf400SAndreas FärberHaiku) 504179cf400SAndreas Färber haiku="yes" 505179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 506179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 507179cf400SAndreas Färber;; 508fb065187Sbellard*) 5090c58ac1cSmalc audio_drv_list="oss" 510b8e59f18Smalc audio_possible_drivers="oss alsa sdl esd pa" 5115327cf48Sbellard linux="yes" 512831b7825Sths linux_user="yes" 51368063649Sblueswir1 usb="linux" 514af2be207SJan Kiszka kvm="yes" 515af2be207SJan Kiszka vhost_net="yes" 51607f4ddbfSbellard if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 517c2de5c91Smalc audio_possible_drivers="$audio_possible_drivers fmod" 518c9ec1fe4Sbellard fi 519fb065187Sbellard;; 5207d13299dSbellardesac 5217d13299dSbellard 5227d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 523b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 52468063649Sblueswir1 usb="bsd" 52584778508Sblueswir1 bsd_user="yes" 5267d3505c5Sbellard fi 52708de3949SAndreas Färberfi 5287d3505c5Sbellard 5290db4a067SPaolo Bonzini: ${make=${MAKE-make}} 5300db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 531c886edfbSBlue Swirl: ${python=${PYTHON-python}} 532e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 5330db4a067SPaolo Bonzini 5343c4a4d0dSPeter Maydell# Default objcc to clang if available, otherwise use CC 5353c4a4d0dSPeter Maydellif has clang; then 5363c4a4d0dSPeter Maydell objcc=clang 5373c4a4d0dSPeter Maydellelse 5383c4a4d0dSPeter Maydell objcc="$cc" 5393c4a4d0dSPeter Maydellfi 5403c4a4d0dSPeter Maydell 5413457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 5423457a3f8SJuan Quintela EXESUF=".exe" 543a558ee17SJuan Quintela QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" 544e94a7936SStefan Weil # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) 545e94a7936SStefan Weil QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" 546f7cf5d5bSStefan Weil LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" 547f7cf5d5bSStefan Weilcat > $TMPC << EOF 548f7cf5d5bSStefan Weilint main(void) { return 0; } 549f7cf5d5bSStefan WeilEOF 550f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 551f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 552f7cf5d5bSStefan Weil fi 553c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 554683035deSPaolo Bonzini mandir="\${prefix}" 555528ae5b8SEduardo Habkost datadir="\${prefix}" 556850da188SEduardo Habkost qemu_docdir="\${prefix}" 557683035deSPaolo Bonzini bindir="\${prefix}" 558683035deSPaolo Bonzini sysconfdir="\${prefix}" 559785c23aeSLuiz Capitulino local_statedir="\${prefix}" 560683035deSPaolo Bonzini confsuffix="" 561368542b8SStefan Hajnoczi libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" 5623457a3f8SJuan Quintelafi 5633457a3f8SJuan Quintela 564487fefdbSAnthony Liguoriwerror="" 56585aa5189Sbellard 5667d13299dSbellardfor opt do 567a46e4035Spbrook optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 5687d13299dSbellard case "$opt" in 5692efc3265Sbellard --help|-h) show_help=yes 5702efc3265Sbellard ;; 57199123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 57299123e13SMike Frysinger ;; 573b1a550a0Spbrook --prefix=*) prefix="$optarg" 5747d13299dSbellard ;; 575b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 57632ce6337Sbellard ;; 577ca4deeb1SPaolo Bonzini --source-path=*) 5787d13299dSbellard ;; 579ac0df51dSaliguori --cross-prefix=*) 5807d13299dSbellard ;; 581ac0df51dSaliguori --cc=*) 5827d13299dSbellard ;; 583b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 58483469015Sbellard ;; 5853c4a4d0dSPeter Maydell --objcc=*) objcc="$optarg" 5863c4a4d0dSPeter Maydell ;; 587b1a550a0Spbrook --make=*) make="$optarg" 5887d13299dSbellard ;; 5896a882643Spbrook --install=*) install="$optarg" 5906a882643Spbrook ;; 591c886edfbSBlue Swirl --python=*) python="$optarg" 592c886edfbSBlue Swirl ;; 593e2d8830eSBrad --smbd=*) smbd="$optarg" 594e2d8830eSBrad ;; 595e2a2ed06SJuan Quintela --extra-cflags=*) 5967d13299dSbellard ;; 597e2a2ed06SJuan Quintela --extra-ldflags=*) 5987d13299dSbellard ;; 5995bc62e01SGerd Hoffmann --enable-debug-info) 6005bc62e01SGerd Hoffmann ;; 6015bc62e01SGerd Hoffmann --disable-debug-info) 6025bc62e01SGerd Hoffmann ;; 6032ff6b91eSJuan Quintela --cpu=*) 6047d13299dSbellard ;; 605b1a550a0Spbrook --target-list=*) target_list="$optarg" 606de83cd02Sbellard ;; 60774242e0fSPaolo Bonzini --enable-trace-backend=*) trace_backend="$optarg" 60894a420b1SStefan Hajnoczi ;; 60974242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 6109410b56cSPrerna Saxena ;; 6117d13299dSbellard --enable-gprof) gprof="yes" 6127d13299dSbellard ;; 61379427693SLoïc Minier --static) 61479427693SLoïc Minier static="yes" 61579427693SLoïc Minier LDFLAGS="-static $LDFLAGS" 61617884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 61743ce4dfeSbellard ;; 6180b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 6190b24e75fSPaolo Bonzini ;; 6200b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 6210b24e75fSPaolo Bonzini ;; 6223aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 6233aa5d2beSAlon Levy ;; 6248bf188aaSMichael Tokarev --libexecdir=*) libexecdir="$optarg" 6258bf188aaSMichael Tokarev ;; 6260f94d6daSAlon Levy --includedir=*) includedir="$optarg" 6270f94d6daSAlon Levy ;; 628528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 6290b24e75fSPaolo Bonzini ;; 630023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 631023d3d67SEduardo Habkost ;; 632850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 6330b24e75fSPaolo Bonzini ;; 634ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 63507381cc1SAnthony Liguori ;; 636785c23aeSLuiz Capitulino --localstatedir=*) local_statedir="$optarg" 637785c23aeSLuiz Capitulino ;; 638785c23aeSLuiz Capitulino --sbindir=*|--sharedstatedir=*|\ 639023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 640023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 641023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 642023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 643023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 644023ddd74SMax Filippov # lots of directory switches by default. 645023ddd74SMax Filippov ;; 646e2134eb9SGerd Hoffmann --with-system-pixman) pixman="system" 647e2134eb9SGerd Hoffmann ;; 648e2134eb9SGerd Hoffmann --without-system-pixman) pixman="internal" 649e2134eb9SGerd Hoffmann ;; 65097a847bcSbellard --disable-sdl) sdl="no" 65197a847bcSbellard ;; 652c4198157SJuan Quintela --enable-sdl) sdl="yes" 653c4198157SJuan Quintela ;; 654983eef5aSMeador Inge --disable-virtfs) virtfs="no" 655983eef5aSMeador Inge ;; 656983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 657983eef5aSMeador Inge ;; 658821601eaSJes Sorensen --disable-vnc) vnc="no" 659821601eaSJes Sorensen ;; 660821601eaSJes Sorensen --enable-vnc) vnc="yes" 661821601eaSJes Sorensen ;; 662b1a550a0Spbrook --fmod-lib=*) fmod_lib="$optarg" 663102a52e4Sbellard ;; 664c2de5c91Smalc --fmod-inc=*) fmod_inc="$optarg" 665c2de5c91Smalc ;; 6662f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 6672f6a1ab0Sblueswir1 ;; 6682fa7d3bfSmalc --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` 6690c58ac1cSmalc ;; 6700c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 6710c58ac1cSmalc ;; 672eb852011SMarkus Armbruster --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 673eb852011SMarkus Armbruster ;; 674f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 675f8393946Saurel32 ;; 676f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 677f8393946Saurel32 ;; 678f3d08ee6SPaul Brook --enable-debug) 679f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 680f3d08ee6SPaul Brook debug_tcg="yes" 681f3d08ee6SPaul Brook debug="yes" 682f3d08ee6SPaul Brook strip_opt="no" 683f3d08ee6SPaul Brook ;; 68403b4fe7dSaliguori --enable-sparse) sparse="yes" 68503b4fe7dSaliguori ;; 68603b4fe7dSaliguori --disable-sparse) sparse="no" 68703b4fe7dSaliguori ;; 6881625af87Saliguori --disable-strip) strip_opt="no" 6891625af87Saliguori ;; 6908d5d2d4cSths --disable-vnc-tls) vnc_tls="no" 6918d5d2d4cSths ;; 6921be10ad2SJuan Quintela --enable-vnc-tls) vnc_tls="yes" 6931be10ad2SJuan Quintela ;; 6942f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 6952f9606b3Saliguori ;; 696ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 697ea784e3bSJuan Quintela ;; 6982f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 6992f6f5c7aSCorentin Chary ;; 7002f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 7012f6f5c7aSCorentin Chary ;; 702efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 703efe556adSCorentin Chary ;; 704efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 705efe556adSCorentin Chary ;; 706443f1376Sbellard --disable-slirp) slirp="no" 707c20709aaSbellard ;; 708ee682d27SStefan Weil --disable-uuid) uuid="no" 709ee682d27SStefan Weil ;; 710ee682d27SStefan Weil --enable-uuid) uuid="yes" 711ee682d27SStefan Weil ;; 712e0e6c8c0Saliguori --disable-vde) vde="no" 7138a16d273Sths ;; 714dfb278bdSJuan Quintela --enable-vde) vde="yes" 715dfb278bdSJuan Quintela ;; 716e37630caSaliguori --disable-xen) xen="no" 717e37630caSaliguori ;; 718fc321b4bSJuan Quintela --enable-xen) xen="yes" 719fc321b4bSJuan Quintela ;; 720eb6fda0fSAnthony PERARD --disable-xen-pci-passthrough) xen_pci_passthrough="no" 721eb6fda0fSAnthony PERARD ;; 722eb6fda0fSAnthony PERARD --enable-xen-pci-passthrough) xen_pci_passthrough="yes" 723eb6fda0fSAnthony PERARD ;; 7242e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 7252e4d9fb1Saurel32 ;; 7264ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 7274ffcedb6SJuan Quintela ;; 728fb599c9aSbalrog --disable-bluez) bluez="no" 729fb599c9aSbalrog ;; 730a20a6f46SJuan Quintela --enable-bluez) bluez="yes" 731a20a6f46SJuan Quintela ;; 7327ba1e619Saliguori --disable-kvm) kvm="no" 7337ba1e619Saliguori ;; 734b31a0277SJuan Quintela --enable-kvm) kvm="yes" 735b31a0277SJuan Quintela ;; 7369195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 7379195b2c2SStefan Weil ;; 7389195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 7399195b2c2SStefan Weil ;; 74047e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 74147e98658SCorey Bryant ;; 74247e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 74347e98658SCorey Bryant ;; 744cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 745cd4ec0b4SGerd Hoffmann ;; 746cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 747cd4ec0b4SGerd Hoffmann ;; 748c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 749c589b249SRonnie Sahlberg ;; 750c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 751c589b249SRonnie Sahlberg ;; 75205c2a3e7Sbellard --enable-profiler) profiler="yes" 75305c2a3e7Sbellard ;; 75414821030SPavel Borzenkov --disable-cocoa) cocoa="no" 75514821030SPavel Borzenkov ;; 756c2de5c91Smalc --enable-cocoa) 757c2de5c91Smalc cocoa="yes" ; 758c2de5c91Smalc sdl="no" ; 759c2de5c91Smalc audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" 7605b0753e0Sbellard ;; 761cad25d69Spbrook --disable-system) softmmu="no" 7620a8e90f4Spbrook ;; 763cad25d69Spbrook --enable-system) softmmu="yes" 7640a8e90f4Spbrook ;; 7650953a80fSZachary Amsden --disable-user) 7660953a80fSZachary Amsden linux_user="no" ; 7670953a80fSZachary Amsden bsd_user="no" ; 7680953a80fSZachary Amsden ;; 7690953a80fSZachary Amsden --enable-user) ;; 770831b7825Sths --disable-linux-user) linux_user="no" 7710a8e90f4Spbrook ;; 772831b7825Sths --enable-linux-user) linux_user="yes" 773831b7825Sths ;; 77484778508Sblueswir1 --disable-bsd-user) bsd_user="no" 77584778508Sblueswir1 ;; 77684778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 77784778508Sblueswir1 ;; 778379f6698SPaul Brook --enable-guest-base) guest_base="yes" 779379f6698SPaul Brook ;; 780379f6698SPaul Brook --disable-guest-base) guest_base="no" 781379f6698SPaul Brook ;; 78240d6444eSAvi Kivity --enable-pie) pie="yes" 78334005a00SKirill A. Shutemov ;; 78440d6444eSAvi Kivity --disable-pie) pie="no" 78534005a00SKirill A. Shutemov ;; 786c5937220Spbrook --enable-uname-release=*) uname_release="$optarg" 787c5937220Spbrook ;; 78885aa5189Sbellard --enable-werror) werror="yes" 78985aa5189Sbellard ;; 79085aa5189Sbellard --disable-werror) werror="no" 79185aa5189Sbellard ;; 7924d3b6f6eSbalrog --disable-curses) curses="no" 7934d3b6f6eSbalrog ;; 794c584a6d0SJuan Quintela --enable-curses) curses="yes" 795c584a6d0SJuan Quintela ;; 796769ce76dSAlexander Graf --disable-curl) curl="no" 797769ce76dSAlexander Graf ;; 798788c8196SJuan Quintela --enable-curl) curl="yes" 799788c8196SJuan Quintela ;; 8002df87df7SJuan Quintela --disable-fdt) fdt="no" 8012df87df7SJuan Quintela ;; 8022df87df7SJuan Quintela --enable-fdt) fdt="yes" 8032df87df7SJuan Quintela ;; 804bd0c5661Spbrook --disable-nptl) nptl="no" 805bd0c5661Spbrook ;; 806b0a47e79SJuan Quintela --enable-nptl) nptl="yes" 807b0a47e79SJuan Quintela ;; 8088ff9cbf7Smalc --enable-mixemu) mixemu="yes" 8098ff9cbf7Smalc ;; 8105c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 8115c6c3a6cSChristoph Hellwig ;; 8125c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 8135c6c3a6cSChristoph Hellwig ;; 814758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 815758e8e38SVenkateswararao Jujjuri (JV) ;; 816758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 817758e8e38SVenkateswararao Jujjuri (JV) ;; 81877755340Sths --disable-blobs) blobs="no" 81977755340Sths ;; 8204a19f1ecSpbrook --with-pkgversion=*) pkgversion=" ($optarg)" 8214a19f1ecSpbrook ;; 822519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 823519175a2SAlex Barcelo ;; 824a25dba17SJuan Quintela --disable-docs) docs="no" 82570ec5dc0SAnthony Liguori ;; 826a25dba17SJuan Quintela --enable-docs) docs="yes" 82783a3ab8bSJuan Quintela ;; 828d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 829d5970055SMichael S. Tsirkin ;; 830d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 831d5970055SMichael S. Tsirkin ;; 83220ff075bSMichael Walle --disable-opengl) opengl="no" 83320ff075bSMichael Walle ;; 83420ff075bSMichael Walle --enable-opengl) opengl="yes" 83520ff075bSMichael Walle ;; 836f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 837f27aaf4bSChristian Brunner ;; 838f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 839f27aaf4bSChristian Brunner ;; 8408c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 8418c84cf11SSergei Trofimovich ;; 8428c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 8438c84cf11SSergei Trofimovich ;; 84436707144SAlon Levy --disable-smartcard) smartcard="no" 84536707144SAlon Levy ;; 84636707144SAlon Levy --enable-smartcard) smartcard="yes" 84736707144SAlon Levy ;; 848111a38b0SRobert Relyea --disable-smartcard-nss) smartcard_nss="no" 849111a38b0SRobert Relyea ;; 850111a38b0SRobert Relyea --enable-smartcard-nss) smartcard_nss="yes" 851111a38b0SRobert Relyea ;; 85269354a83SHans de Goede --disable-usb-redir) usb_redir="no" 85369354a83SHans de Goede ;; 85469354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 85569354a83SHans de Goede ;; 8561ece9905SAlon Levy --disable-zlib-test) zlib="no" 8571ece9905SAlon Levy ;; 858d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 859d138cee9SMichael Roth ;; 860d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 861d138cee9SMichael Roth ;; 8624b1c11fdSDaniel P. Berrange --enable-tools) want_tools="yes" 8634b1c11fdSDaniel P. Berrange ;; 8644b1c11fdSDaniel P. Berrange --disable-tools) want_tools="no" 8654b1c11fdSDaniel P. Berrange ;; 866f794573eSEduardo Otubo --enable-seccomp) seccomp="yes" 867f794573eSEduardo Otubo ;; 868f794573eSEduardo Otubo --disable-seccomp) seccomp="no" 869f794573eSEduardo Otubo ;; 870eb100396SBharata B Rao --disable-glusterfs) glusterfs="no" 871eb100396SBharata B Rao ;; 872eb100396SBharata B Rao --enable-glusterfs) glusterfs="yes" 873eb100396SBharata B Rao ;; 8747f1559c6Sbalrog *) echo "ERROR: unknown option $opt"; show_help="yes" 8757f1559c6Sbalrog ;; 8767d13299dSbellard esac 8777d13299dSbellarddone 8787d13299dSbellard 87940293e58Sbellardcase "$cpu" in 8809b9c37c3SRichard Henderson sparc) 8810c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 8829b9c37c3SRichard Henderson QEMU_CFLAGS="-m32 -mcpu=ultrasparc $QEMU_CFLAGS" 8833142255cSblueswir1 ;; 884ed968ff1SJuan Quintela sparc64) 8850c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 8869b9c37c3SRichard Henderson QEMU_CFLAGS="-m64 -mcpu=ultrasparc $QEMU_CFLAGS" 8873142255cSblueswir1 ;; 88876d83bdeSths s390) 88928d7cc49SRichard Henderson QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS" 89028d7cc49SRichard Henderson LDFLAGS="-m31 $LDFLAGS" 89128d7cc49SRichard Henderson ;; 89228d7cc49SRichard Henderson s390x) 89328d7cc49SRichard Henderson QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS" 89428d7cc49SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 89576d83bdeSths ;; 89640293e58Sbellard i386) 897a558ee17SJuan Quintela QEMU_CFLAGS="-m32 $QEMU_CFLAGS" 8980c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 8992b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 90040293e58Sbellard ;; 90140293e58Sbellard x86_64) 902a558ee17SJuan Quintela QEMU_CFLAGS="-m64 $QEMU_CFLAGS" 9030c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 9042b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 905379f6698SPaul Brook ;; 90630163d89SPeter Maydell # No special flags required for other host CPUs 9073142255cSblueswir1esac 9083142255cSblueswir1 90960e0df25SPeter Maydelldefault_target_list="" 91060e0df25SPeter Maydell 91160e0df25SPeter Maydell# these targets are portable 91260e0df25SPeter Maydellif [ "$softmmu" = "yes" ] ; then 91360e0df25SPeter Maydell default_target_list="\ 91460e0df25SPeter Maydelli386-softmmu \ 91560e0df25SPeter Maydellx86_64-softmmu \ 91627cdad67SRichard Hendersonalpha-softmmu \ 91760e0df25SPeter Maydellarm-softmmu \ 91860e0df25SPeter Maydellcris-softmmu \ 91960e0df25SPeter Maydelllm32-softmmu \ 92060e0df25SPeter Maydellm68k-softmmu \ 92160e0df25SPeter Maydellmicroblaze-softmmu \ 92260e0df25SPeter Maydellmicroblazeel-softmmu \ 92360e0df25SPeter Maydellmips-softmmu \ 92460e0df25SPeter Maydellmipsel-softmmu \ 92560e0df25SPeter Maydellmips64-softmmu \ 92660e0df25SPeter Maydellmips64el-softmmu \ 927e67db06eSJia Liuor32-softmmu \ 92860e0df25SPeter Maydellppc-softmmu \ 92960e0df25SPeter Maydellppcemb-softmmu \ 93060e0df25SPeter Maydellppc64-softmmu \ 93160e0df25SPeter Maydellsh4-softmmu \ 93260e0df25SPeter Maydellsh4eb-softmmu \ 93360e0df25SPeter Maydellsparc-softmmu \ 93460e0df25SPeter Maydellsparc64-softmmu \ 9350f3301d4SAlexander Grafs390x-softmmu \ 936cfa550c6SMax Filippovxtensa-softmmu \ 937cfa550c6SMax Filippovxtensaeb-softmmu \ 9384f23a1e6SGuan Xuetaounicore32-softmmu \ 93960e0df25SPeter Maydell" 94060e0df25SPeter Maydellfi 94160e0df25SPeter Maydell# the following are Linux specific 94260e0df25SPeter Maydellif [ "$linux_user" = "yes" ] ; then 94360e0df25SPeter Maydell default_target_list="${default_target_list}\ 94460e0df25SPeter Maydelli386-linux-user \ 94560e0df25SPeter Maydellx86_64-linux-user \ 94660e0df25SPeter Maydellalpha-linux-user \ 94760e0df25SPeter Maydellarm-linux-user \ 94860e0df25SPeter Maydellarmeb-linux-user \ 94960e0df25SPeter Maydellcris-linux-user \ 95060e0df25SPeter Maydellm68k-linux-user \ 95160e0df25SPeter Maydellmicroblaze-linux-user \ 95260e0df25SPeter Maydellmicroblazeel-linux-user \ 95360e0df25SPeter Maydellmips-linux-user \ 95460e0df25SPeter Maydellmipsel-linux-user \ 955d962783eSJia Liuor32-linux-user \ 95660e0df25SPeter Maydellppc-linux-user \ 95760e0df25SPeter Maydellppc64-linux-user \ 95860e0df25SPeter Maydellppc64abi32-linux-user \ 95960e0df25SPeter Maydellsh4-linux-user \ 96060e0df25SPeter Maydellsh4eb-linux-user \ 96160e0df25SPeter Maydellsparc-linux-user \ 96260e0df25SPeter Maydellsparc64-linux-user \ 96360e0df25SPeter Maydellsparc32plus-linux-user \ 96460e0df25SPeter Maydellunicore32-linux-user \ 9650f3301d4SAlexander Grafs390x-linux-user \ 96660e0df25SPeter Maydell" 96760e0df25SPeter Maydellfi 96860e0df25SPeter Maydell# the following are BSD specific 96960e0df25SPeter Maydellif [ "$bsd_user" = "yes" ] ; then 97060e0df25SPeter Maydell default_target_list="${default_target_list}\ 97160e0df25SPeter Maydelli386-bsd-user \ 97260e0df25SPeter Maydellx86_64-bsd-user \ 97360e0df25SPeter Maydellsparc-bsd-user \ 97460e0df25SPeter Maydellsparc64-bsd-user \ 97560e0df25SPeter Maydell" 97660e0df25SPeter Maydellfi 97760e0df25SPeter Maydell 978af5db58eSpbrookif test x"$show_help" = x"yes" ; then 979af5db58eSpbrookcat << EOF 980af5db58eSpbrook 981af5db58eSpbrookUsage: configure [options] 982af5db58eSpbrookOptions: [defaults in brackets after descriptions] 983af5db58eSpbrook 984af5db58eSpbrookEOF 985af5db58eSpbrookecho "Standard options:" 986af5db58eSpbrookecho " --help print this message" 987af5db58eSpbrookecho " --prefix=PREFIX install in PREFIX [$prefix]" 988af5db58eSpbrookecho " --interp-prefix=PREFIX where to find shared libraries, etc." 989af5db58eSpbrookecho " use %M for cpu name [$interp_prefix]" 99060e0df25SPeter Maydellecho " --target-list=LIST set target list (default: build everything)" 99160e0df25SPeter Maydellecho "Available targets: $default_target_list" | \ 99260e0df25SPeter Maydell fold -s -w 53 | sed -e 's/^/ /' 993af5db58eSpbrookecho "" 994af5db58eSpbrookecho "Advanced options (experts only):" 995af5db58eSpbrookecho " --source-path=PATH path of source code [$source_path]" 996af5db58eSpbrookecho " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" 997af5db58eSpbrookecho " --cc=CC use C compiler CC [$cc]" 9980bfe8cc0SPaolo Bonziniecho " --host-cc=CC use C compiler CC [$host_cc] for code run at" 9990bfe8cc0SPaolo Bonziniecho " build time" 10003c4a4d0dSPeter Maydellecho " --objcc=OBJCC use Objective-C compiler OBJCC [$objcc]" 1001a558ee17SJuan Quintelaecho " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" 1002e3fc14c3SJan Kiszkaecho " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" 1003af5db58eSpbrookecho " --make=MAKE use specified make [$make]" 10046a882643Spbrookecho " --install=INSTALL use specified install [$install]" 1005c886edfbSBlue Swirlecho " --python=PYTHON use specified python [$python]" 1006e2d8830eSBradecho " --smbd=SMBD use specified smbd [$smbd]" 1007af5db58eSpbrookecho " --static enable static build [$static]" 10080b24e75fSPaolo Bonziniecho " --mandir=PATH install man pages in PATH" 1009023d3d67SEduardo Habkostecho " --datadir=PATH install firmware in PATH$confsuffix" 1010023d3d67SEduardo Habkostecho " --docdir=PATH install documentation in PATH$confsuffix" 10110b24e75fSPaolo Bonziniecho " --bindir=PATH install binaries in PATH" 1012023d3d67SEduardo Habkostecho " --sysconfdir=PATH install config in PATH$confsuffix" 1013785c23aeSLuiz Capitulinoecho " --localstatedir=PATH install local state in PATH" 10142ae4748fSStefan Weilecho " --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]" 1015f8393946Saurel32echo " --enable-debug-tcg enable TCG debugging" 1016f8393946Saurel32echo " --disable-debug-tcg disable TCG debugging (default)" 101709695a4aSStefan Weilecho " --enable-debug enable common debug build options" 1018890b1658Saliguoriecho " --enable-sparse enable sparse checker" 1019890b1658Saliguoriecho " --disable-sparse disable sparse checker (default)" 10201625af87Saliguoriecho " --disable-strip disable stripping binaries" 102185aa5189Sbellardecho " --disable-werror disable compilation abort on warning" 1022fe8f78e4Sbalrogecho " --disable-sdl disable SDL" 1023c4198157SJuan Quintelaecho " --enable-sdl enable SDL" 1024983eef5aSMeador Ingeecho " --disable-virtfs disable VirtFS" 1025983eef5aSMeador Ingeecho " --enable-virtfs enable VirtFS" 1026821601eaSJes Sorensenecho " --disable-vnc disable VNC" 1027821601eaSJes Sorensenecho " --enable-vnc enable VNC" 102814821030SPavel Borzenkovecho " --disable-cocoa disable Cocoa (Mac OS X only)" 102914821030SPavel Borzenkovecho " --enable-cocoa enable Cocoa (default on Mac OS X)" 1030c2de5c91Smalcecho " --audio-drv-list=LIST set audio drivers list:" 1031c2de5c91Smalcecho " Available drivers: $audio_possible_drivers" 10324c9b53e3Smalcecho " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" 10334c9b53e3Smalcecho " Available cards: $audio_possible_cards" 1034eb852011SMarkus Armbrusterecho " --block-drv-whitelist=L set block driver whitelist" 1035eb852011SMarkus Armbrusterecho " (affects only QEMU, not qemu-img)" 10368ff9cbf7Smalcecho " --enable-mixemu enable mixer emulation" 1037e37630caSaliguoriecho " --disable-xen disable xen backend driver support" 1038fc321b4bSJuan Quintelaecho " --enable-xen enable xen backend driver support" 1039eb6fda0fSAnthony PERARDecho " --disable-xen-pci-passthrough" 1040eb6fda0fSAnthony PERARDecho " --enable-xen-pci-passthrough" 10412e4d9fb1Saurel32echo " --disable-brlapi disable BrlAPI" 10424ffcedb6SJuan Quintelaecho " --enable-brlapi enable BrlAPI" 10438d5d2d4cSthsecho " --disable-vnc-tls disable TLS encryption for VNC server" 10441be10ad2SJuan Quintelaecho " --enable-vnc-tls enable TLS encryption for VNC server" 10452f9606b3Saliguoriecho " --disable-vnc-sasl disable SASL encryption for VNC server" 1046ea784e3bSJuan Quintelaecho " --enable-vnc-sasl enable SASL encryption for VNC server" 10472f6f5c7aSCorentin Charyecho " --disable-vnc-jpeg disable JPEG lossy compression for VNC server" 10482f6f5c7aSCorentin Charyecho " --enable-vnc-jpeg enable JPEG lossy compression for VNC server" 104996763cf9SCorentin Charyecho " --disable-vnc-png disable PNG compression for VNC server (default)" 1050efe556adSCorentin Charyecho " --enable-vnc-png enable PNG compression for VNC server" 1051af896aaaSpbrookecho " --disable-curses disable curses output" 1052c584a6d0SJuan Quintelaecho " --enable-curses enable curses output" 1053769ce76dSAlexander Grafecho " --disable-curl disable curl connectivity" 1054788c8196SJuan Quintelaecho " --enable-curl enable curl connectivity" 10552df87df7SJuan Quintelaecho " --disable-fdt disable fdt device tree" 10562df87df7SJuan Quintelaecho " --enable-fdt enable fdt device tree" 1057fb599c9aSbalrogecho " --disable-bluez disable bluez stack connectivity" 1058a20a6f46SJuan Quintelaecho " --enable-bluez enable bluez stack connectivity" 10596093d3d4SPeter Maydellecho " --disable-slirp disable SLIRP userspace network connectivity" 10607ba1e619Saliguoriecho " --disable-kvm disable KVM acceleration support" 1061b31a0277SJuan Quintelaecho " --enable-kvm enable KVM acceleration support" 10629195b2c2SStefan Weilecho " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" 1063bd0c5661Spbrookecho " --disable-nptl disable usermode NPTL support" 1064e5934d33SAndre Przywaraecho " --enable-nptl enable usermode NPTL support" 1065af5db58eSpbrookecho " --enable-system enable all system emulation targets" 1066af5db58eSpbrookecho " --disable-system disable all system emulation targets" 10670953a80fSZachary Amsdenecho " --enable-user enable supported user emulation targets" 10680953a80fSZachary Amsdenecho " --disable-user disable all user emulation targets" 1069831b7825Sthsecho " --enable-linux-user enable all linux usermode emulation targets" 1070831b7825Sthsecho " --disable-linux-user disable all linux usermode emulation targets" 107184778508Sblueswir1echo " --enable-bsd-user enable all BSD usermode emulation targets" 107284778508Sblueswir1echo " --disable-bsd-user disable all BSD usermode emulation targets" 1073379f6698SPaul Brookecho " --enable-guest-base enable GUEST_BASE support for usermode" 1074379f6698SPaul Brookecho " emulation targets" 1075379f6698SPaul Brookecho " --disable-guest-base disable GUEST_BASE support" 107640d6444eSAvi Kivityecho " --enable-pie build Position Independent Executables" 107740d6444eSAvi Kivityecho " --disable-pie do not build Position Independent Executables" 1078af5db58eSpbrookecho " --fmod-lib path to FMOD library" 1079af5db58eSpbrookecho " --fmod-inc path to FMOD includes" 10802f6a1ab0Sblueswir1echo " --oss-lib path to OSS library" 1081c5937220Spbrookecho " --enable-uname-release=R Return R for uname -r in usermode emulation" 1082235e510cS陳韋任echo " --cpu=CPU Build for host CPU [$cpu]" 10833142255cSblueswir1echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" 1084ee682d27SStefan Weilecho " --disable-uuid disable uuid support" 1085ee682d27SStefan Weilecho " --enable-uuid enable uuid support" 1086e0e6c8c0Saliguoriecho " --disable-vde disable support for vde network" 1087dfb278bdSJuan Quintelaecho " --enable-vde enable support for vde network" 10885c6c3a6cSChristoph Hellwigecho " --disable-linux-aio disable Linux AIO support" 10895c6c3a6cSChristoph Hellwigecho " --enable-linux-aio enable Linux AIO support" 109047e98658SCorey Bryantecho " --disable-cap-ng disable libcap-ng support" 109147e98658SCorey Bryantecho " --enable-cap-ng enable libcap-ng support" 1092758e8e38SVenkateswararao Jujjuri (JV)echo " --disable-attr disables attr and xattr support" 1093758e8e38SVenkateswararao Jujjuri (JV)echo " --enable-attr enable attr and xattr support" 109477755340Sthsecho " --disable-blobs disable installing provided firmware blobs" 1095d2807bc9SDirk Ullrichecho " --enable-docs enable documentation build" 1096d2807bc9SDirk Ullrichecho " --disable-docs disable documentation build" 1097d5970055SMichael S. Tsirkinecho " --disable-vhost-net disable vhost-net acceleration support" 1098d5970055SMichael S. Tsirkinecho " --enable-vhost-net enable vhost-net acceleration support" 1099320fba2aSFabien Chouteauecho " --enable-trace-backend=B Set trace backend" 1100650ab98dSLluís Vilanovaecho " Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends) 110174242e0fSPaolo Bonziniecho " --with-trace-file=NAME Full PATH,NAME of file to store traces" 11029410b56cSPrerna Saxenaecho " Default:trace-<pid>" 1103cd4ec0b4SGerd Hoffmannecho " --disable-spice disable spice" 1104cd4ec0b4SGerd Hoffmannecho " --enable-spice enable spice" 1105f27aaf4bSChristian Brunnerecho " --enable-rbd enable building the rados block device (rbd)" 1106c589b249SRonnie Sahlbergecho " --disable-libiscsi disable iscsi support" 1107c589b249SRonnie Sahlbergecho " --enable-libiscsi enable iscsi support" 110836707144SAlon Levyecho " --disable-smartcard disable smartcard support" 110936707144SAlon Levyecho " --enable-smartcard enable smartcard support" 1110111a38b0SRobert Relyeaecho " --disable-smartcard-nss disable smartcard nss support" 1111111a38b0SRobert Relyeaecho " --enable-smartcard-nss enable smartcard nss support" 111269354a83SHans de Goedeecho " --disable-usb-redir disable usb network redirection support" 111369354a83SHans de Goedeecho " --enable-usb-redir enable usb network redirection support" 1114d138cee9SMichael Rothecho " --disable-guest-agent disable building of the QEMU Guest Agent" 1115d138cee9SMichael Rothecho " --enable-guest-agent enable building of the QEMU Guest Agent" 1116f794573eSEduardo Otuboecho " --disable-seccomp disable seccomp support" 1117f794573eSEduardo Otuboecho " --enable-seccomp enables seccomp support" 1118519175a2SAlex Barceloecho " --with-coroutine=BACKEND coroutine backend. Supported options:" 1119fe91bfa8SAlex Barceloecho " gthread, ucontext, sigaltstack, windows" 1120eb100396SBharata B Raoecho " --enable-glusterfs enable GlusterFS backend" 1121eb100396SBharata B Raoecho " --disable-glusterfs disable GlusterFS backend" 1122af5db58eSpbrookecho "" 11235bf08934Sthsecho "NOTE: The object files are built at the place where configure is launched" 1124af5db58eSpbrookexit 1 1125af5db58eSpbrookfi 1126af5db58eSpbrook 1127359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1128359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1129359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1130359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1131359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1132359bc95dSPeter Maydell ARCH=tci 1133359bc95dSPeter Maydell else 1134359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1135359bc95dSPeter Maydell exit 1 1136359bc95dSPeter Maydell fi 1137359bc95dSPeter Maydellfi 1138359bc95dSPeter Maydell 11398d05095cSPaolo Bonzini# check that the C compiler works. 11408d05095cSPaolo Bonzinicat > $TMPC <<EOF 114175cafad7SStefan Weilint main(void) { return 0; } 11428d05095cSPaolo BonziniEOF 11438d05095cSPaolo Bonzini 11448d05095cSPaolo Bonziniif compile_object ; then 11458d05095cSPaolo Bonzini : C compiler works ok 11468d05095cSPaolo Bonzinielse 11478d05095cSPaolo Bonzini echo "ERROR: \"$cc\" either does not exist or does not work" 11488d05095cSPaolo Bonzini exit 1 11498d05095cSPaolo Bonzinifi 11508d05095cSPaolo Bonzini 1151417c9d72SAlexander Graf# Consult white-list to determine whether to enable werror 1152417c9d72SAlexander Graf# by default. Only enable by default for git builds 1153417c9d72SAlexander Grafz_version=`cut -f3 -d. $source_path/VERSION` 1154417c9d72SAlexander Graf 1155417c9d72SAlexander Grafif test -z "$werror" ; then 1156417c9d72SAlexander Graf if test "$z_version" = "50" -a \ 1157417c9d72SAlexander Graf "$linux" = "yes" ; then 1158417c9d72SAlexander Graf werror="yes" 1159417c9d72SAlexander Graf else 1160417c9d72SAlexander Graf werror="no" 1161417c9d72SAlexander Graf fi 1162417c9d72SAlexander Graffi 1163417c9d72SAlexander Graf 11648d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 11658d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 11668d05095cSPaolo Bonzinigcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 1167f9188227SMike Frysingergcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags" 1168c1556a81SPeter Maydellgcc_flags="-Wno-initializer-overrides $gcc_flags" 11696ca026cbSPeter Maydell# Note that we do not add -Werror to gcc_flags here, because that would 11706ca026cbSPeter Maydell# enable it for all configure tests. If a configure test failed due 11716ca026cbSPeter Maydell# to -Werror this would just silently disable some features, 11726ca026cbSPeter Maydell# so it's too error prone. 11738d05095cSPaolo Bonzinicat > $TMPC << EOF 11748d05095cSPaolo Bonziniint main(void) { return 0; } 11758d05095cSPaolo BonziniEOF 11768d05095cSPaolo Bonzinifor flag in $gcc_flags; do 1177a1d29d6cSPeter Maydell # Use the positive sense of the flag when testing for -Wno-wombat 1178a1d29d6cSPeter Maydell # support (gcc will happily accept the -Wno- form of unknown 1179a1d29d6cSPeter Maydell # warning options). 1180a1d29d6cSPeter Maydell optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')" 1181a1d29d6cSPeter Maydell if compile_prog "-Werror $optflag" "" ; then 11828d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 11838d05095cSPaolo Bonzini fi 11848d05095cSPaolo Bonzinidone 11858d05095cSPaolo Bonzini 118640d6444eSAvi Kivityif test "$static" = "yes" ; then 118740d6444eSAvi Kivity if test "$pie" = "yes" ; then 118840d6444eSAvi Kivity echo "static and pie are mutually incompatible" 118940d6444eSAvi Kivity exit 1 119040d6444eSAvi Kivity else 119140d6444eSAvi Kivity pie="no" 119240d6444eSAvi Kivity fi 119340d6444eSAvi Kivityfi 119440d6444eSAvi Kivity 119540d6444eSAvi Kivityif test "$pie" = ""; then 119640d6444eSAvi Kivity case "$cpu-$targetos" in 1197f9db31a2SBrad i386-Linux|x86_64-Linux|i386-OpenBSD|x86_64-OpenBSD) 119840d6444eSAvi Kivity ;; 119940d6444eSAvi Kivity *) 120040d6444eSAvi Kivity pie="no" 120140d6444eSAvi Kivity ;; 120240d6444eSAvi Kivity esac 120340d6444eSAvi Kivityfi 120440d6444eSAvi Kivity 120540d6444eSAvi Kivityif test "$pie" != "no" ; then 120640d6444eSAvi Kivity cat > $TMPC << EOF 120721d4a791SAvi Kivity 120821d4a791SAvi Kivity#ifdef __linux__ 120921d4a791SAvi Kivity# define THREAD __thread 121021d4a791SAvi Kivity#else 121121d4a791SAvi Kivity# define THREAD 121221d4a791SAvi Kivity#endif 121321d4a791SAvi Kivity 121421d4a791SAvi Kivitystatic THREAD int tls_var; 121521d4a791SAvi Kivity 121621d4a791SAvi Kivityint main(void) { return tls_var; } 121721d4a791SAvi Kivity 121840d6444eSAvi KivityEOF 121940d6444eSAvi Kivity if compile_prog "-fPIE -DPIE" "-pie"; then 122040d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 122140d6444eSAvi Kivity LDFLAGS="-pie $LDFLAGS" 122240d6444eSAvi Kivity pie="yes" 122340d6444eSAvi Kivity if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 122440d6444eSAvi Kivity LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" 122540d6444eSAvi Kivity fi 122640d6444eSAvi Kivity else 122740d6444eSAvi Kivity if test "$pie" = "yes"; then 122840d6444eSAvi Kivity echo "PIE not available due to missing toolchain support" 122940d6444eSAvi Kivity exit 1 123040d6444eSAvi Kivity else 123140d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 123240d6444eSAvi Kivity pie="no" 123340d6444eSAvi Kivity fi 123440d6444eSAvi Kivity fi 123540d6444eSAvi Kivityfi 123640d6444eSAvi Kivity 1237ec530c81Sbellard# 1238ec530c81Sbellard# Solaris specific configure tool chain decisions 1239ec530c81Sbellard# 1240ec530c81Sbellardif test "$solaris" = "yes" ; then 12416792aa11SLoïc Minier if has $install; then 12426792aa11SLoïc Minier : 12436792aa11SLoïc Minier else 1244ec530c81Sbellard echo "Solaris install program not found. Use --install=/usr/ucb/install or" 1245ec530c81Sbellard echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" 1246ec530c81Sbellard echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" 1247ec530c81Sbellard exit 1 1248ec530c81Sbellard fi 12496792aa11SLoïc Minier if test "`path_of $install`" = "/usr/sbin/install" ; then 1250ec530c81Sbellard echo "Error: Solaris /usr/sbin/install is not an appropriate install program." 1251ec530c81Sbellard echo "try ginstall from the GNU fileutils available from www.blastwave.org" 1252ec530c81Sbellard echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 1253ec530c81Sbellard exit 1 1254ec530c81Sbellard fi 12556792aa11SLoïc Minier if has ar; then 12566792aa11SLoïc Minier : 12576792aa11SLoïc Minier else 1258ec530c81Sbellard echo "Error: No path includes ar" 1259ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 1260ec530c81Sbellard echo "Add /usr/ccs/bin to your path and rerun configure" 1261ec530c81Sbellard fi 1262ec530c81Sbellard exit 1 1263ec530c81Sbellard fi 1264ec530c81Sbellardfi 1265ec530c81Sbellard 12667a3fc891SSebastian Herbsztif ! has $python; then 1267c886edfbSBlue Swirl echo "Python not found. Use --python=/path/to/python" 1268c886edfbSBlue Swirl exit 1 1269c886edfbSBlue Swirlfi 1270c886edfbSBlue Swirl 12716ccea1e4SPeter Maydell# Note that if the Python conditional here evaluates True we will exit 12726ccea1e4SPeter Maydell# with status 1 which is a shell 'false' value. 1273e120d449SStefan Hajnocziif ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then 1274e120d449SStefan Hajnoczi echo "Cannot use '$python', Python 2.4 or later is required." 1275e120d449SStefan Hajnoczi echo "Note that Python 3 or later is not yet supported." 1276e120d449SStefan Hajnoczi echo "Use --python=/path/to/python to specify a supported Python." 12776ccea1e4SPeter Maydell exit 1 12786ccea1e4SPeter Maydellfi 12796ccea1e4SPeter Maydell 1280afb63ebdSStefan Weilif test -z "${target_list+xxx}" ; then 1281121afa9eSAnthony Liguori target_list="$default_target_list" 1282121afa9eSAnthony Liguorielse 1283121afa9eSAnthony Liguori target_list=`echo "$target_list" | sed -e 's/,/ /g'` 12845327cf48Sbellardfi 1285f55fe278SPaolo Bonzini# see if system emulation was really requested 1286f55fe278SPaolo Bonzinicase " $target_list " in 1287f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 1288f55fe278SPaolo Bonzini ;; 1289f55fe278SPaolo Bonzini *) softmmu=no 1290f55fe278SPaolo Bonzini ;; 1291f55fe278SPaolo Bonziniesac 12925327cf48Sbellard 1293249247c9SJuan Quintelafeature_not_found() { 1294249247c9SJuan Quintela feature=$1 1295249247c9SJuan Quintela 1296249247c9SJuan Quintela echo "ERROR" 1297249247c9SJuan Quintela echo "ERROR: User requested feature $feature" 12989332f6a2SSebastian Herbszt echo "ERROR: configure was not able to find it" 1299249247c9SJuan Quintela echo "ERROR" 1300249247c9SJuan Quintela exit 1; 1301249247c9SJuan Quintela} 1302249247c9SJuan Quintela 13037d13299dSbellardif test -z "$cross_prefix" ; then 13047d13299dSbellard 13057d13299dSbellard# --- 13067d13299dSbellard# big/little endian test 13077d13299dSbellardcat > $TMPC << EOF 13087d13299dSbellard#include <inttypes.h> 1309abab1a0fSStefan Weilint main(void) { 13107d13299dSbellard volatile uint32_t i=0x01234567; 13117d13299dSbellard return (*((uint8_t*)(&i))) == 0x67; 13127d13299dSbellard} 13137d13299dSbellardEOF 13147d13299dSbellard 131552166aa0SJuan Quintelaif compile_prog "" "" ; then 13167d13299dSbellard$TMPE && bigendian="yes" 13177d13299dSbellardelse 13187d13299dSbellardecho big/little test failed 13197d13299dSbellardfi 13207d13299dSbellard 13217d13299dSbellardelse 13227d13299dSbellard 13237d13299dSbellard# if cross compiling, cannot launch a program, so make a static guess 1324ea8f20f8SJuan Quintelacase "$cpu" in 132521d89f84SPeter Maydell arm) 132621d89f84SPeter Maydell # ARM can be either way; ask the compiler which one we are 132721d89f84SPeter Maydell if check_define __ARMEB__; then 132821d89f84SPeter Maydell bigendian=yes 132921d89f84SPeter Maydell fi 133021d89f84SPeter Maydell ;; 133121d89f84SPeter Maydell hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) 1332ea8f20f8SJuan Quintela bigendian=yes 1333ea8f20f8SJuan Quintela ;; 1334ea8f20f8SJuan Quintelaesac 13357d13299dSbellard 13367d13299dSbellardfi 13377d13299dSbellard 1338b0a47e79SJuan Quintela########################################## 1339b0a47e79SJuan Quintela# NPTL probe 1340b0a47e79SJuan Quintela 1341b0a47e79SJuan Quintelaif test "$nptl" != "no" ; then 1342bd0c5661Spbrook cat > $TMPC <<EOF 1343bd0c5661Spbrook#include <sched.h> 134430813ceaSpbrook#include <linux/futex.h> 1345182eacc0SStefan Weilint main(void) { 1346bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 1347bd0c5661Spbrook#error bork 1348bd0c5661Spbrook#endif 1349182eacc0SStefan Weil return 0; 1350bd0c5661Spbrook} 1351bd0c5661SpbrookEOF 1352bd0c5661Spbrook 135352166aa0SJuan Quintela if compile_object ; then 1354b0a47e79SJuan Quintela nptl=yes 1355bd0c5661Spbrook else 1356b0a47e79SJuan Quintela if test "$nptl" = "yes" ; then 1357b0a47e79SJuan Quintela feature_not_found "nptl" 1358b0a47e79SJuan Quintela fi 1359b0a47e79SJuan Quintela nptl=no 1360b0a47e79SJuan Quintela fi 1361bd0c5661Spbrookfi 1362bd0c5661Spbrook 136311d9f695Sbellard########################################## 1364ac62922eSbalrog# zlib check 1365ac62922eSbalrog 13661ece9905SAlon Levyif test "$zlib" != "no" ; then 1367ac62922eSbalrog cat > $TMPC << EOF 1368ac62922eSbalrog#include <zlib.h> 1369ac62922eSbalrogint main(void) { zlibVersion(); return 0; } 1370ac62922eSbalrogEOF 137152166aa0SJuan Quintela if compile_prog "" "-lz" ; then 1372ac62922eSbalrog : 1373ac62922eSbalrog else 1374ac62922eSbalrog echo 1375ac62922eSbalrog echo "Error: zlib check failed" 1376ac62922eSbalrog echo "Make sure to have the zlib libs and headers installed." 1377ac62922eSbalrog echo 1378ac62922eSbalrog exit 1 1379ac62922eSbalrog fi 13801ece9905SAlon Levyfi 1381ac62922eSbalrog 1382ac62922eSbalrog########################################## 1383f794573eSEduardo Otubo# libseccomp check 1384f794573eSEduardo Otubo 1385f794573eSEduardo Otuboif test "$seccomp" != "no" ; then 1386*2c5c4451SBlue Swirl if $pkg_config --atleast-version=1.0.0 libseccomp --modversion >/dev/null 2>&1; then 1387f794573eSEduardo Otubo LIBS=`$pkg_config --libs libseccomp` 1388f794573eSEduardo Otubo seccomp="yes" 1389f794573eSEduardo Otubo else 1390f794573eSEduardo Otubo if test "$seccomp" = "yes"; then 1391f794573eSEduardo Otubo feature_not_found "libseccomp" 1392f794573eSEduardo Otubo fi 1393e84d5956SYann E. MORIN seccomp="no" 1394f794573eSEduardo Otubo fi 1395f794573eSEduardo Otubofi 1396f794573eSEduardo Otubo########################################## 1397e37630caSaliguori# xen probe 1398e37630caSaliguori 1399fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 1400b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 1401d5b93ddfSAnthony PERARD 140250ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 140350ced5b3SStefan Weil # If no, we are done and there is no Xen support. 140450ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 140550ced5b3SStefan Weil 140650ced5b3SStefan Weil # Xen (any) 140750ced5b3SStefan Weil cat > $TMPC <<EOF 140850ced5b3SStefan Weil#include <xenctrl.h> 140950ced5b3SStefan Weilint main(void) { 141050ced5b3SStefan Weil return 0; 141150ced5b3SStefan Weil} 141250ced5b3SStefan WeilEOF 141350ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 141450ced5b3SStefan Weil # Xen not found 141550ced5b3SStefan Weil if test "$xen" = "yes" ; then 141650ced5b3SStefan Weil feature_not_found "xen" 141750ced5b3SStefan Weil fi 141850ced5b3SStefan Weil xen=no 141950ced5b3SStefan Weil 1420d5b93ddfSAnthony PERARD # Xen unstable 142169deef08SPeter Maydell elif 142269deef08SPeter Maydell cat > $TMPC <<EOF && 1423e37630caSaliguori#include <xenctrl.h> 1424e108a3c1SAnthony PERARD#include <xenstore.h> 1425d5b93ddfSAnthony PERARD#include <stdint.h> 1426d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1427d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1428d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1429d5b93ddfSAnthony PERARD#endif 1430d5b93ddfSAnthony PERARDint main(void) { 1431d5b93ddfSAnthony PERARD xc_interface *xc; 1432d5b93ddfSAnthony PERARD xs_daemon_open(); 1433d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 1434d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1435d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 1436b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 14378688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 14388688e065SStefano Stabellini return 0; 14398688e065SStefano Stabellini} 14408688e065SStefano StabelliniEOF 14418688e065SStefano Stabellini compile_prog "" "$xen_libs" 144269deef08SPeter Maydell then 14438688e065SStefano Stabellini xen_ctrl_version=420 14448688e065SStefano Stabellini xen=yes 14458688e065SStefano Stabellini 144669deef08SPeter Maydell elif 144769deef08SPeter Maydell cat > $TMPC <<EOF && 14488688e065SStefano Stabellini#include <xenctrl.h> 14498688e065SStefano Stabellini#include <xs.h> 14508688e065SStefano Stabellini#include <stdint.h> 14518688e065SStefano Stabellini#include <xen/hvm/hvm_info_table.h> 14528688e065SStefano Stabellini#if !defined(HVM_MAX_VCPUS) 14538688e065SStefano Stabellini# error HVM_MAX_VCPUS not defined 14548688e065SStefano Stabellini#endif 14558688e065SStefano Stabelliniint main(void) { 14568688e065SStefano Stabellini xs_daemon_open(); 14579b4c0b56SPeter Maydell xc_interface_open(0, 0, 0); 14588688e065SStefano Stabellini xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 14598688e065SStefano Stabellini xc_gnttab_open(NULL, 0); 14608688e065SStefano Stabellini xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 1461d5b93ddfSAnthony PERARD return 0; 1462d5b93ddfSAnthony PERARD} 1463e37630caSaliguoriEOF 146450ced5b3SStefan Weil compile_prog "" "$xen_libs" 146569deef08SPeter Maydell then 1466d5b93ddfSAnthony PERARD xen_ctrl_version=410 1467fc321b4bSJuan Quintela xen=yes 1468d5b93ddfSAnthony PERARD 1469d5b93ddfSAnthony PERARD # Xen 4.0.0 147069deef08SPeter Maydell elif 147169deef08SPeter Maydell cat > $TMPC <<EOF && 1472d5b93ddfSAnthony PERARD#include <xenctrl.h> 1473d5b93ddfSAnthony PERARD#include <xs.h> 1474d5b93ddfSAnthony PERARD#include <stdint.h> 1475d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1476d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1477d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1478d5b93ddfSAnthony PERARD#endif 1479d5b93ddfSAnthony PERARDint main(void) { 1480b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1481b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1482b87de24eSAnthony PERARD }; 1483d5b93ddfSAnthony PERARD xs_daemon_open(); 1484d5b93ddfSAnthony PERARD xc_interface_open(); 1485d5b93ddfSAnthony PERARD xc_gnttab_open(); 1486d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1487b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1488d5b93ddfSAnthony PERARD return 0; 1489d5b93ddfSAnthony PERARD} 1490d5b93ddfSAnthony PERARDEOF 1491d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 149269deef08SPeter Maydell then 1493d5b93ddfSAnthony PERARD xen_ctrl_version=400 1494d5b93ddfSAnthony PERARD xen=yes 1495d5b93ddfSAnthony PERARD 1496b87de24eSAnthony PERARD # Xen 3.4.0 149769deef08SPeter Maydell elif 149869deef08SPeter Maydell cat > $TMPC <<EOF && 1499b87de24eSAnthony PERARD#include <xenctrl.h> 1500b87de24eSAnthony PERARD#include <xs.h> 1501b87de24eSAnthony PERARDint main(void) { 1502b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1503b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1504b87de24eSAnthony PERARD }; 1505b87de24eSAnthony PERARD xs_daemon_open(); 1506b87de24eSAnthony PERARD xc_interface_open(); 1507b87de24eSAnthony PERARD xc_gnttab_open(); 1508b87de24eSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1509b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1510b87de24eSAnthony PERARD return 0; 1511b87de24eSAnthony PERARD} 1512b87de24eSAnthony PERARDEOF 1513b87de24eSAnthony PERARD compile_prog "" "$xen_libs" 151469deef08SPeter Maydell then 1515b87de24eSAnthony PERARD xen_ctrl_version=340 1516b87de24eSAnthony PERARD xen=yes 1517b87de24eSAnthony PERARD 1518b87de24eSAnthony PERARD # Xen 3.3.0 151969deef08SPeter Maydell elif 152069deef08SPeter Maydell cat > $TMPC <<EOF && 1521d5b93ddfSAnthony PERARD#include <xenctrl.h> 1522d5b93ddfSAnthony PERARD#include <xs.h> 1523d5b93ddfSAnthony PERARDint main(void) { 1524d5b93ddfSAnthony PERARD xs_daemon_open(); 1525d5b93ddfSAnthony PERARD xc_interface_open(); 1526d5b93ddfSAnthony PERARD xc_gnttab_open(); 1527d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1528d5b93ddfSAnthony PERARD return 0; 1529d5b93ddfSAnthony PERARD} 1530d5b93ddfSAnthony PERARDEOF 1531d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 153269deef08SPeter Maydell then 1533d5b93ddfSAnthony PERARD xen_ctrl_version=330 1534d5b93ddfSAnthony PERARD xen=yes 1535d5b93ddfSAnthony PERARD 153650ced5b3SStefan Weil # Xen version unsupported 1537e37630caSaliguori else 1538fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 153950ced5b3SStefan Weil feature_not_found "xen (unsupported version)" 1540fc321b4bSJuan Quintela fi 1541fc321b4bSJuan Quintela xen=no 1542e37630caSaliguori fi 1543d5b93ddfSAnthony PERARD 1544d5b93ddfSAnthony PERARD if test "$xen" = yes; then 1545d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 1546d5b93ddfSAnthony PERARD fi 1547e37630caSaliguorifi 1548e37630caSaliguori 1549eb6fda0fSAnthony PERARDif test "$xen_pci_passthrough" != "no"; then 1550eb6fda0fSAnthony PERARD if test "$xen" = "yes" && test "$linux" = "yes" && 1551eb6fda0fSAnthony PERARD test "$xen_ctrl_version" -ge 340; then 1552eb6fda0fSAnthony PERARD xen_pci_passthrough=yes 1553eb6fda0fSAnthony PERARD else 1554eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = "yes"; then 1555eb6fda0fSAnthony PERARD echo "ERROR" 1556eb6fda0fSAnthony PERARD echo "ERROR: User requested feature Xen PCI Passthrough" 1557eb6fda0fSAnthony PERARD echo "ERROR: but this feature require /sys from Linux" 1558eb6fda0fSAnthony PERARD if test "$xen_ctrl_version" -lt 340; then 1559eb6fda0fSAnthony PERARD echo "ERROR: This feature does not work with Xen 3.3" 1560eb6fda0fSAnthony PERARD fi 1561eb6fda0fSAnthony PERARD echo "ERROR" 1562eb6fda0fSAnthony PERARD exit 1; 1563eb6fda0fSAnthony PERARD fi 1564eb6fda0fSAnthony PERARD xen_pci_passthrough=no 1565eb6fda0fSAnthony PERARD fi 1566eb6fda0fSAnthony PERARDfi 1567eb6fda0fSAnthony PERARD 1568e37630caSaliguori########################################## 1569a8bd70adSPaolo Bonzini# pkg-config probe 1570f91672e5SPaolo Bonzini 157117884d7bSSergei Trofimovichif ! has "$pkg_config_exe"; then 157217884d7bSSergei Trofimovich echo "Error: pkg-config binary '$pkg_config_exe' not found" 1573a213fcb2SPeter Maydell exit 1 1574f91672e5SPaolo Bonzinifi 1575f91672e5SPaolo Bonzini 1576f91672e5SPaolo Bonzini########################################## 157744dc0ca3SAlon Levy# libtool probe 157844dc0ca3SAlon Levy 15793f534581SBradif ! has $libtool; then 158044dc0ca3SAlon Levy libtool= 158144dc0ca3SAlon Levyfi 158244dc0ca3SAlon Levy 158344dc0ca3SAlon Levy########################################## 1584dfffc653SJuan Quintela# Sparse probe 1585dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 15860dba6195SLoïc Minier if has cgcc; then 1587dfffc653SJuan Quintela sparse=yes 1588dfffc653SJuan Quintela else 1589dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 1590dfffc653SJuan Quintela feature_not_found "sparse" 1591dfffc653SJuan Quintela fi 1592dfffc653SJuan Quintela sparse=no 1593dfffc653SJuan Quintela fi 1594dfffc653SJuan Quintelafi 1595dfffc653SJuan Quintela 1596dfffc653SJuan Quintela########################################## 159711d9f695Sbellard# SDL probe 159811d9f695Sbellard 15993ec87ffeSPaolo Bonzini# Look for sdl configuration program (pkg-config or sdl-config). Try 16003ec87ffeSPaolo Bonzini# sdl-config even without cross prefix, and favour pkg-config over sdl-config. 16013ec87ffeSPaolo Bonziniif test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then 16023ec87ffeSPaolo Bonzini sdl_config=sdl-config 16033ec87ffeSPaolo Bonzinifi 16043ec87ffeSPaolo Bonzini 16053ec87ffeSPaolo Bonziniif $pkg_config sdl --modversion >/dev/null 2>&1; then 1606a8bd70adSPaolo Bonzini sdlconfig="$pkg_config sdl" 1607fec0e3e8SStefan Weil _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` 16083ec87ffeSPaolo Bonzinielif has ${sdl_config}; then 16093ec87ffeSPaolo Bonzini sdlconfig="$sdl_config" 16109316f803SPaolo Bonzini _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` 1611a0dfd8a4SLoïc Minierelse 1612a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 1613a0dfd8a4SLoïc Minier feature_not_found "sdl" 1614a0dfd8a4SLoïc Minier fi 1615a0dfd8a4SLoïc Minier sdl=no 16169316f803SPaolo Bonzinifi 161729e5badaSScott Woodif test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then 16183ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 16193ec87ffeSPaolo Bonzinifi 162011d9f695Sbellard 16219316f803SPaolo Bonzinisdl_too_old=no 1622c4198157SJuan Quintelaif test "$sdl" != "no" ; then 162311d9f695Sbellard cat > $TMPC << EOF 162411d9f695Sbellard#include <SDL.h> 162511d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 162611d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 162711d9f695SbellardEOF 16289316f803SPaolo Bonzini sdl_cflags=`$sdlconfig --cflags 2> /dev/null` 162974f42e18STeLeMan if test "$static" = "yes" ; then 163074f42e18STeLeMan sdl_libs=`$sdlconfig --static-libs 2>/dev/null` 163174f42e18STeLeMan else 16329316f803SPaolo Bonzini sdl_libs=`$sdlconfig --libs 2> /dev/null` 163374f42e18STeLeMan fi 163452166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 163511d9f695Sbellard if test "$_sdlversion" -lt 121 ; then 163611d9f695Sbellard sdl_too_old=yes 163711d9f695Sbellard else 1638fd677642Sths if test "$cocoa" = "no" ; then 163911d9f695Sbellard sdl=yes 164011d9f695Sbellard fi 1641fd677642Sths fi 16427c1f25b4Sbellard 164367c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 16441ac88f28SJuan Quintela if test "$sdl" = "yes" -a "$static" = "yes" ; then 164567c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 1646f8aa6c7bSStefan Weil sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" 1647f8aa6c7bSStefan Weil sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" 164811d9f695Sbellard fi 164952166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 16501ac88f28SJuan Quintela : 16511ac88f28SJuan Quintela else 16521ac88f28SJuan Quintela sdl=no 16537c1f25b4Sbellard fi 16547c1f25b4Sbellard fi # static link 1655c4198157SJuan Quintela else # sdl not found 1656c4198157SJuan Quintela if test "$sdl" = "yes" ; then 1657c4198157SJuan Quintela feature_not_found "sdl" 1658c4198157SJuan Quintela fi 1659c4198157SJuan Quintela sdl=no 16607c1f25b4Sbellard fi # sdl compile test 1661fd677642Sthsfi 166211d9f695Sbellard 16635368a422Saliguoriif test "$sdl" = "yes" ; then 16645368a422Saliguori cat > $TMPC <<EOF 16655368a422Saliguori#include <SDL.h> 16665368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 16675368a422Saliguori#include <X11/XKBlib.h> 16685368a422Saliguori#else 16695368a422Saliguori#error No x11 support 16705368a422Saliguori#endif 16715368a422Saliguoriint main(void) { return 0; } 16725368a422SaliguoriEOF 167352166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 1674681306dfSJuan Quintela sdl_libs="$sdl_libs -lX11" 16755368a422Saliguori fi 16760705667eSJuan Quintela libs_softmmu="$sdl_libs $libs_softmmu" 16775368a422Saliguorifi 16785368a422Saliguori 16798f28f3fbSths########################################## 16808d5d2d4cSths# VNC TLS detection 1681821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then 1682ae6b5e5aSaliguori cat > $TMPC <<EOF 1683ae6b5e5aSaliguori#include <gnutls/gnutls.h> 1684ae6b5e5aSaliguoriint main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } 1685ae6b5e5aSaliguoriEOF 1686a8bd70adSPaolo Bonzini vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 1687a8bd70adSPaolo Bonzini vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 168852166aa0SJuan Quintela if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then 16891be10ad2SJuan Quintela vnc_tls=yes 1690a5e32cc9SJuan Quintela libs_softmmu="$vnc_tls_libs $libs_softmmu" 1691ae6b5e5aSaliguori else 16921be10ad2SJuan Quintela if test "$vnc_tls" = "yes" ; then 16931be10ad2SJuan Quintela feature_not_found "vnc-tls" 16941be10ad2SJuan Quintela fi 16951be10ad2SJuan Quintela vnc_tls=no 16968d5d2d4cSths fi 16978d5d2d4cSthsfi 16988d5d2d4cSths 16998d5d2d4cSths########################################## 17002f9606b3Saliguori# VNC SASL detection 1701821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then 17022f9606b3Saliguori cat > $TMPC <<EOF 17032f9606b3Saliguori#include <sasl/sasl.h> 17042f9606b3Saliguori#include <stdio.h> 17052f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 17062f9606b3SaliguoriEOF 17072f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 17082f9606b3Saliguori vnc_sasl_cflags="" 17092f9606b3Saliguori vnc_sasl_libs="-lsasl2" 171052166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 1711ea784e3bSJuan Quintela vnc_sasl=yes 1712fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 17132f9606b3Saliguori else 1714ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 1715ea784e3bSJuan Quintela feature_not_found "vnc-sasl" 1716ea784e3bSJuan Quintela fi 1717ea784e3bSJuan Quintela vnc_sasl=no 17182f9606b3Saliguori fi 17192f9606b3Saliguorifi 17202f9606b3Saliguori 17212f9606b3Saliguori########################################## 17222f6f5c7aSCorentin Chary# VNC JPEG detection 1723821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then 17242f6f5c7aSCorentin Charycat > $TMPC <<EOF 17252f6f5c7aSCorentin Chary#include <stdio.h> 17262f6f5c7aSCorentin Chary#include <jpeglib.h> 17272f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 17282f6f5c7aSCorentin CharyEOF 17292f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 17302f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 17312f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 17322f6f5c7aSCorentin Chary vnc_jpeg=yes 17332f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 17342f6f5c7aSCorentin Chary else 17352f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 17362f6f5c7aSCorentin Chary feature_not_found "vnc-jpeg" 17372f6f5c7aSCorentin Chary fi 17382f6f5c7aSCorentin Chary vnc_jpeg=no 17392f6f5c7aSCorentin Chary fi 17402f6f5c7aSCorentin Charyfi 17412f6f5c7aSCorentin Chary 17422f6f5c7aSCorentin Chary########################################## 1743efe556adSCorentin Chary# VNC PNG detection 1744821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_png" != "no" ; then 1745efe556adSCorentin Charycat > $TMPC <<EOF 1746efe556adSCorentin Chary//#include <stdio.h> 1747efe556adSCorentin Chary#include <png.h> 1748832ce9c2SScott Wood#include <stddef.h> 1749efe556adSCorentin Charyint main(void) { 1750efe556adSCorentin Chary png_structp png_ptr; 1751efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 17527edc3fedSPeter Maydell return png_ptr != 0; 1753efe556adSCorentin Chary} 1754efe556adSCorentin CharyEOF 17559af8025eSBrad if $pkg_config libpng --modversion >/dev/null 2>&1; then 17569af8025eSBrad vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` 17579af8025eSBrad vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` 17589af8025eSBrad else 1759efe556adSCorentin Chary vnc_png_cflags="" 1760efe556adSCorentin Chary vnc_png_libs="-lpng" 17619af8025eSBrad fi 1762efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 1763efe556adSCorentin Chary vnc_png=yes 1764efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 17659af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 1766efe556adSCorentin Chary else 1767efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 1768efe556adSCorentin Chary feature_not_found "vnc-png" 1769efe556adSCorentin Chary fi 1770efe556adSCorentin Chary vnc_png=no 1771efe556adSCorentin Chary fi 1772efe556adSCorentin Charyfi 1773efe556adSCorentin Chary 1774efe556adSCorentin Chary########################################## 177576655d6dSaliguori# fnmatch() probe, used for ACL routines 177676655d6dSaliguorifnmatch="no" 177776655d6dSaliguoricat > $TMPC << EOF 177876655d6dSaliguori#include <fnmatch.h> 177976655d6dSaliguoriint main(void) 178076655d6dSaliguori{ 178176655d6dSaliguori fnmatch("foo", "foo", 0); 178276655d6dSaliguori return 0; 178376655d6dSaliguori} 178476655d6dSaliguoriEOF 178552166aa0SJuan Quintelaif compile_prog "" "" ; then 178676655d6dSaliguori fnmatch="yes" 178776655d6dSaliguorifi 178876655d6dSaliguori 178976655d6dSaliguori########################################## 1790ee682d27SStefan Weil# uuid_generate() probe, used for vdi block driver 1791ee682d27SStefan Weilif test "$uuid" != "no" ; then 1792ee682d27SStefan Weil uuid_libs="-luuid" 1793ee682d27SStefan Weil cat > $TMPC << EOF 1794ee682d27SStefan Weil#include <uuid/uuid.h> 1795ee682d27SStefan Weilint main(void) 1796ee682d27SStefan Weil{ 1797ee682d27SStefan Weil uuid_t my_uuid; 1798ee682d27SStefan Weil uuid_generate(my_uuid); 1799ee682d27SStefan Weil return 0; 1800ee682d27SStefan Weil} 1801ee682d27SStefan WeilEOF 1802ee682d27SStefan Weil if compile_prog "" "$uuid_libs" ; then 1803ee682d27SStefan Weil uuid="yes" 1804ee682d27SStefan Weil libs_softmmu="$uuid_libs $libs_softmmu" 1805ee682d27SStefan Weil libs_tools="$uuid_libs $libs_tools" 1806ee682d27SStefan Weil else 1807ee682d27SStefan Weil if test "$uuid" = "yes" ; then 1808ee682d27SStefan Weil feature_not_found "uuid" 1809ee682d27SStefan Weil fi 1810ee682d27SStefan Weil uuid=no 1811ee682d27SStefan Weil fi 1812ee682d27SStefan Weilfi 1813ee682d27SStefan Weil 1814ee682d27SStefan Weil########################################## 1815dce512deSChristoph Hellwig# xfsctl() probe, used for raw-posix 1816dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 1817dce512deSChristoph Hellwig cat > $TMPC << EOF 1818ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 1819dce512deSChristoph Hellwig#include <xfs/xfs.h> 1820dce512deSChristoph Hellwigint main(void) 1821dce512deSChristoph Hellwig{ 1822dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 1823dce512deSChristoph Hellwig return 0; 1824dce512deSChristoph Hellwig} 1825dce512deSChristoph HellwigEOF 1826dce512deSChristoph Hellwig if compile_prog "" "" ; then 1827dce512deSChristoph Hellwig xfs="yes" 1828dce512deSChristoph Hellwig else 1829dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 1830dce512deSChristoph Hellwig feature_not_found "xfs" 1831dce512deSChristoph Hellwig fi 1832dce512deSChristoph Hellwig xfs=no 1833dce512deSChristoph Hellwig fi 1834dce512deSChristoph Hellwigfi 1835dce512deSChristoph Hellwig 1836dce512deSChristoph Hellwig########################################## 18378a16d273Sths# vde libraries probe 1838dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 18394baae0acSJuan Quintela vde_libs="-lvdeplug" 18408a16d273Sths cat > $TMPC << EOF 18418a16d273Sths#include <libvdeplug.h> 18424a7f0e06Spbrookint main(void) 18434a7f0e06Spbrook{ 18444a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 1845fea08e08SPeter Maydell char s[] = ""; 1846fea08e08SPeter Maydell vde_open(s, s, &a); 18474a7f0e06Spbrook return 0; 18484a7f0e06Spbrook} 18498a16d273SthsEOF 185052166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 18514baae0acSJuan Quintela vde=yes 18528e02e54cSJuan Quintela libs_softmmu="$vde_libs $libs_softmmu" 18538e02e54cSJuan Quintela libs_tools="$vde_libs $libs_tools" 1854dfb278bdSJuan Quintela else 1855dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 1856dfb278bdSJuan Quintela feature_not_found "vde" 1857dfb278bdSJuan Quintela fi 1858dfb278bdSJuan Quintela vde=no 18598a16d273Sths fi 18608a16d273Sthsfi 18618a16d273Sths 18628a16d273Sths########################################## 186347e98658SCorey Bryant# libcap-ng library probe 186447e98658SCorey Bryantif test "$cap_ng" != "no" ; then 186547e98658SCorey Bryant cap_libs="-lcap-ng" 186647e98658SCorey Bryant cat > $TMPC << EOF 186747e98658SCorey Bryant#include <cap-ng.h> 186847e98658SCorey Bryantint main(void) 186947e98658SCorey Bryant{ 187047e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 187147e98658SCorey Bryant return 0; 187247e98658SCorey Bryant} 187347e98658SCorey BryantEOF 187447e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 187547e98658SCorey Bryant cap_ng=yes 187647e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 187747e98658SCorey Bryant else 187847e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 187947e98658SCorey Bryant feature_not_found "cap_ng" 188047e98658SCorey Bryant fi 188147e98658SCorey Bryant cap_ng=no 188247e98658SCorey Bryant fi 188347e98658SCorey Bryantfi 188447e98658SCorey Bryant 188547e98658SCorey Bryant########################################## 1886c2de5c91Smalc# Sound support libraries probe 18878f28f3fbSths 1888c2de5c91Smalcaudio_drv_probe() 1889c2de5c91Smalc{ 1890c2de5c91Smalc drv=$1 1891c2de5c91Smalc hdr=$2 1892c2de5c91Smalc lib=$3 1893c2de5c91Smalc exp=$4 1894c2de5c91Smalc cfl=$5 18958f28f3fbSths cat > $TMPC << EOF 1896c2de5c91Smalc#include <$hdr> 1897c2de5c91Smalcint main(void) { $exp } 18988f28f3fbSthsEOF 189952166aa0SJuan Quintela if compile_prog "$cfl" "$lib" ; then 19008f28f3fbSths : 19018f28f3fbSths else 19028f28f3fbSths echo 1903c2de5c91Smalc echo "Error: $drv check failed" 1904c2de5c91Smalc echo "Make sure to have the $drv libs and headers installed." 19058f28f3fbSths echo 19068f28f3fbSths exit 1 19078f28f3fbSths fi 1908c2de5c91Smalc} 1909c2de5c91Smalc 19102fa7d3bfSmalcaudio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` 1911c2de5c91Smalcfor drv in $audio_drv_list; do 1912c2de5c91Smalc case $drv in 1913c2de5c91Smalc alsa) 1914c2de5c91Smalc audio_drv_probe $drv alsa/asoundlib.h -lasound \ 1915e35bcb0cSStefan Weil "return snd_pcm_close((snd_pcm_t *)0);" 1916a4bf6780SJuan Quintela libs_softmmu="-lasound $libs_softmmu" 1917c2de5c91Smalc ;; 1918c2de5c91Smalc 1919c2de5c91Smalc fmod) 1920c2de5c91Smalc if test -z $fmod_lib || test -z $fmod_inc; then 1921c2de5c91Smalc echo 1922c2de5c91Smalc echo "Error: You must specify path to FMOD library and headers" 1923c2de5c91Smalc echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 1924c2de5c91Smalc echo 1925c2de5c91Smalc exit 1 19268f28f3fbSths fi 1927c2de5c91Smalc audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" 1928a4bf6780SJuan Quintela libs_softmmu="$fmod_lib $libs_softmmu" 1929c2de5c91Smalc ;; 1930c2de5c91Smalc 1931c2de5c91Smalc esd) 1932c2de5c91Smalc audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' 1933a4bf6780SJuan Quintela libs_softmmu="-lesd $libs_softmmu" 193467f86e8eSJuan Quintela audio_pt_int="yes" 1935c2de5c91Smalc ;; 1936b8e59f18Smalc 1937b8e59f18Smalc pa) 1938a394aed2SMarc-André Lureau audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ 1939a394aed2SMarc-André Lureau "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" 1940a394aed2SMarc-André Lureau libs_softmmu="-lpulse $libs_softmmu" 194167f86e8eSJuan Quintela audio_pt_int="yes" 1942b8e59f18Smalc ;; 1943b8e59f18Smalc 1944997e690aSJuan Quintela coreaudio) 1945997e690aSJuan Quintela libs_softmmu="-framework CoreAudio $libs_softmmu" 1946997e690aSJuan Quintela ;; 1947997e690aSJuan Quintela 1948a4bf6780SJuan Quintela dsound) 1949a4bf6780SJuan Quintela libs_softmmu="-lole32 -ldxguid $libs_softmmu" 1950d5631638Smalc audio_win_int="yes" 1951a4bf6780SJuan Quintela ;; 1952a4bf6780SJuan Quintela 1953a4bf6780SJuan Quintela oss) 1954a4bf6780SJuan Quintela libs_softmmu="$oss_lib $libs_softmmu" 1955a4bf6780SJuan Quintela ;; 1956a4bf6780SJuan Quintela 1957a4bf6780SJuan Quintela sdl|wav) 19582f6a1ab0Sblueswir1 # XXX: Probes for CoreAudio, DirectSound, SDL(?) 19592f6a1ab0Sblueswir1 ;; 19602f6a1ab0Sblueswir1 1961d5631638Smalc winwave) 1962d5631638Smalc libs_softmmu="-lwinmm $libs_softmmu" 1963d5631638Smalc audio_win_int="yes" 1964d5631638Smalc ;; 1965d5631638Smalc 1966e4c63a6aSmalc *) 19671c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 1968e4c63a6aSmalc echo 1969e4c63a6aSmalc echo "Error: Unknown driver '$drv' selected" 1970e4c63a6aSmalc echo "Possible drivers are: $audio_possible_drivers" 1971e4c63a6aSmalc echo 1972e4c63a6aSmalc exit 1 1973e4c63a6aSmalc } 1974e4c63a6aSmalc ;; 1975c2de5c91Smalc esac 1976c2de5c91Smalcdone 19778f28f3fbSths 19784d3b6f6eSbalrog########################################## 19792e4d9fb1Saurel32# BrlAPI probe 19802e4d9fb1Saurel32 19814ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 1982eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 19832e4d9fb1Saurel32 cat > $TMPC << EOF 19842e4d9fb1Saurel32#include <brlapi.h> 1985832ce9c2SScott Wood#include <stddef.h> 19862e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 19872e4d9fb1Saurel32EOF 198852166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 19892e4d9fb1Saurel32 brlapi=yes 1990264606b3SJuan Quintela libs_softmmu="$brlapi_libs $libs_softmmu" 19914ffcedb6SJuan Quintela else 19924ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 19934ffcedb6SJuan Quintela feature_not_found "brlapi" 19944ffcedb6SJuan Quintela fi 19954ffcedb6SJuan Quintela brlapi=no 1996eb82284fSJuan Quintela fi 1997eb82284fSJuan Quintelafi 19982e4d9fb1Saurel32 19992e4d9fb1Saurel32########################################## 20004d3b6f6eSbalrog# curses probe 2001e095e2f3SStefan Weilif test "$mingw32" = "yes" ; then 2002e095e2f3SStefan Weil curses_list="-lpdcurses" 2003e095e2f3SStefan Weilelse 20044f78ef9aSJuan Quintela curses_list="-lncurses -lcurses" 2005e095e2f3SStefan Weilfi 20064d3b6f6eSbalrog 2007c584a6d0SJuan Quintelaif test "$curses" != "no" ; then 2008c584a6d0SJuan Quintela curses_found=no 20094d3b6f6eSbalrog cat > $TMPC << EOF 20104d3b6f6eSbalrog#include <curses.h> 2011ef9a2524SStefan Weilint main(void) { 2012ef9a2524SStefan Weil const char *s = curses_version(); 2013ef9a2524SStefan Weil resize_term(0, 0); 2014ef9a2524SStefan Weil return s != 0; 2015ef9a2524SStefan Weil} 20164d3b6f6eSbalrogEOF 20174f78ef9aSJuan Quintela for curses_lib in $curses_list; do 20184f78ef9aSJuan Quintela if compile_prog "" "$curses_lib" ; then 2019c584a6d0SJuan Quintela curses_found=yes 20204f78ef9aSJuan Quintela libs_softmmu="$curses_lib $libs_softmmu" 20214f78ef9aSJuan Quintela break 20224d3b6f6eSbalrog fi 20234f78ef9aSJuan Quintela done 2024c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 2025c584a6d0SJuan Quintela curses=yes 2026c584a6d0SJuan Quintela else 2027c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 2028c584a6d0SJuan Quintela feature_not_found "curses" 2029c584a6d0SJuan Quintela fi 2030c584a6d0SJuan Quintela curses=no 2031c584a6d0SJuan Quintela fi 20324f78ef9aSJuan Quintelafi 20334d3b6f6eSbalrog 2034414f0dabSblueswir1########################################## 2035769ce76dSAlexander Graf# curl probe 2036769ce76dSAlexander Graf 2037a8bd70adSPaolo Bonziniif $pkg_config libcurl --modversion >/dev/null 2>&1; then 2038a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 20394e2b0658SPaolo Bonzinielse 20404e2b0658SPaolo Bonzini curlconfig=curl-config 20414e2b0658SPaolo Bonzinifi 20424e2b0658SPaolo Bonzini 2043788c8196SJuan Quintelaif test "$curl" != "no" ; then 2044769ce76dSAlexander Graf cat > $TMPC << EOF 2045769ce76dSAlexander Graf#include <curl/curl.h> 20460b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 2047769ce76dSAlexander GrafEOF 20484e2b0658SPaolo Bonzini curl_cflags=`$curlconfig --cflags 2>/dev/null` 20494e2b0658SPaolo Bonzini curl_libs=`$curlconfig --libs 2>/dev/null` 2050b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 2051769ce76dSAlexander Graf curl=yes 2052f0302935SJuan Quintela libs_tools="$curl_libs $libs_tools" 2053f0302935SJuan Quintela libs_softmmu="$curl_libs $libs_softmmu" 2054788c8196SJuan Quintela else 2055788c8196SJuan Quintela if test "$curl" = "yes" ; then 2056788c8196SJuan Quintela feature_not_found "curl" 2057788c8196SJuan Quintela fi 2058788c8196SJuan Quintela curl=no 2059769ce76dSAlexander Graf fi 2060769ce76dSAlexander Graffi # test "$curl" 2061769ce76dSAlexander Graf 2062769ce76dSAlexander Graf########################################## 2063fb599c9aSbalrog# bluez support probe 2064a20a6f46SJuan Quintelaif test "$bluez" != "no" ; then 2065e820e3f4Sbalrog cat > $TMPC << EOF 2066e820e3f4Sbalrog#include <bluetooth/bluetooth.h> 2067e820e3f4Sbalrogint main(void) { return bt_error(0); } 2068e820e3f4SbalrogEOF 2069a8bd70adSPaolo Bonzini bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` 2070a8bd70adSPaolo Bonzini bluez_libs=`$pkg_config --libs bluez 2> /dev/null` 207152166aa0SJuan Quintela if compile_prog "$bluez_cflags" "$bluez_libs" ; then 2072a20a6f46SJuan Quintela bluez=yes 2073e482d56aSJuan Quintela libs_softmmu="$bluez_libs $libs_softmmu" 2074e820e3f4Sbalrog else 2075a20a6f46SJuan Quintela if test "$bluez" = "yes" ; then 2076a20a6f46SJuan Quintela feature_not_found "bluez" 2077a20a6f46SJuan Quintela fi 2078e820e3f4Sbalrog bluez="no" 2079e820e3f4Sbalrog fi 2080fb599c9aSbalrogfi 2081fb599c9aSbalrog 2082fb599c9aSbalrog########################################## 2083e18df141SAnthony Liguori# glib support probe 2084a52d28afSPaolo Bonzini 2085a52d28afSPaolo Bonziniif test "$mingw32" = yes; then 2086a52d28afSPaolo Bonzini # g_poll is required in order to integrate with the glib main loop. 2087a52d28afSPaolo Bonzini glib_req_ver=2.20 2088a52d28afSPaolo Bonzinielse 2089a52d28afSPaolo Bonzini glib_req_ver=2.12 2090a52d28afSPaolo Bonzinifi 2091a52d28afSPaolo Bonziniif $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 2092a52d28afSPaolo Bonzinithen 20934b76a481SStefan Hajnoczi glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` 20944b76a481SStefan Hajnoczi glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` 209514015304SAnthony Liguori LIBS="$glib_libs $LIBS" 2096957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 2097e18df141SAnthony Liguorielse 2098a52d28afSPaolo Bonzini echo "glib-$glib_req_ver required to compile QEMU" 2099e18df141SAnthony Liguori exit 1 2100e18df141SAnthony Liguorifi 2101e18df141SAnthony Liguori 2102e18df141SAnthony Liguori########################################## 2103e2134eb9SGerd Hoffmann# pixman support probe 2104e2134eb9SGerd Hoffmann 2105e2134eb9SGerd Hoffmannif test "$pixman" = ""; then 2106e2134eb9SGerd Hoffmann if $pkg_config pixman-1 > /dev/null 2>&1; then 2107e2134eb9SGerd Hoffmann pixman="system" 2108e2134eb9SGerd Hoffmann else 2109e2134eb9SGerd Hoffmann pixman="internal" 2110e2134eb9SGerd Hoffmann fi 2111e2134eb9SGerd Hoffmannfi 2112e2134eb9SGerd Hoffmannif test "$pixman" = "system"; then 2113e2134eb9SGerd Hoffmann pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null` 2114e2134eb9SGerd Hoffmann pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null` 2115e2134eb9SGerd Hoffmannelse 2116e2134eb9SGerd Hoffmann if test ! -d ${source_path}/pixman/pixman; then 2117e2134eb9SGerd Hoffmann echo "ERROR: pixman not present. Your options:" 2118e2134eb9SGerd Hoffmann echo " (1) Prefered: Install the pixman devel package (any recent" 2119e2134eb9SGerd Hoffmann echo " distro should have packages as Xorg needs pixman too)." 2120e2134eb9SGerd Hoffmann echo " (2) Fetch the pixman submodule, using:" 2121e2134eb9SGerd Hoffmann echo " git submodule update --init pixman" 2122e2134eb9SGerd Hoffmann exit 1 2123e2134eb9SGerd Hoffmann fi 21245ca9388aSGerd Hoffmann mkdir -p pixman/pixman 21255ca9388aSGerd Hoffmann pixman_cflags="-I\$(SRC_PATH)/pixman/pixman -I\$(BUILD_DIR)/pixman/pixman" 21265ca9388aSGerd Hoffmann pixman_libs="-L\$(BUILD_DIR)/pixman/pixman/.libs -lpixman-1" 2127e2134eb9SGerd Hoffmannfi 2128e2134eb9SGerd Hoffmann 2129e2134eb9SGerd Hoffmann########################################## 213017bff52bSM. Mohan Kumar# libcap probe 213117bff52bSM. Mohan Kumar 213217bff52bSM. Mohan Kumarif test "$cap" != "no" ; then 213317bff52bSM. Mohan Kumar cat > $TMPC <<EOF 213417bff52bSM. Mohan Kumar#include <stdio.h> 213517bff52bSM. Mohan Kumar#include <sys/capability.h> 2136cc939743SStefan Weilint main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } 213717bff52bSM. Mohan KumarEOF 213817bff52bSM. Mohan Kumar if compile_prog "" "-lcap" ; then 213917bff52bSM. Mohan Kumar cap=yes 214017bff52bSM. Mohan Kumar else 214117bff52bSM. Mohan Kumar cap=no 214217bff52bSM. Mohan Kumar fi 214317bff52bSM. Mohan Kumarfi 214417bff52bSM. Mohan Kumar 214517bff52bSM. Mohan Kumar########################################## 2146e5d355d1Saliguori# pthread probe 21474b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 21483c529d93Saliguori 2149e5d355d1Saliguoripthread=no 2150414f0dabSblueswir1cat > $TMPC << EOF 21513c529d93Saliguori#include <pthread.h> 21527a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 21537a42bbe4SStefan Weilint main(void) { 21547a42bbe4SStefan Weil pthread_t thread; 21557a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 21567a42bbe4SStefan Weil return 0; 21577a42bbe4SStefan Weil} 2158414f0dabSblueswir1EOF 2159bd00d539SAndreas Färberif compile_prog "" "" ; then 2160bd00d539SAndreas Färber pthread=yes 2161bd00d539SAndreas Färberelse 2162de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 216352166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 2164e5d355d1Saliguori pthread=yes 2165e3c56761SPeter Portante found=no 2166e3c56761SPeter Portante for lib_entry in $LIBS; do 2167e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 2168e3c56761SPeter Portante found=yes 2169e3c56761SPeter Portante break 2170e3c56761SPeter Portante fi 2171e3c56761SPeter Portante done 2172e3c56761SPeter Portante if test "$found" = "no"; then 21735572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 2174e3c56761SPeter Portante fi 2175de65fe0fSSebastian Herbszt break 2176414f0dabSblueswir1 fi 2177de65fe0fSSebastian Herbszt done 2178bd00d539SAndreas Färberfi 2179414f0dabSblueswir1 21804617e593SAnthony Liguoriif test "$mingw32" != yes -a "$pthread" = no; then 21814dd75c70SChristoph Hellwig echo 21824dd75c70SChristoph Hellwig echo "Error: pthread check failed" 21834dd75c70SChristoph Hellwig echo "Make sure to have the pthread libs and headers installed." 21844dd75c70SChristoph Hellwig echo 21854dd75c70SChristoph Hellwig exit 1 2186e5d355d1Saliguorifi 2187e5d355d1Saliguori 2188bf9298b9Saliguori########################################## 2189f27aaf4bSChristian Brunner# rbd probe 2190f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 2191f27aaf4bSChristian Brunner cat > $TMPC <<EOF 2192f27aaf4bSChristian Brunner#include <stdio.h> 2193ad32e9c0SJosh Durgin#include <rbd/librbd.h> 2194f27aaf4bSChristian Brunnerint main(void) { 2195ad32e9c0SJosh Durgin rados_t cluster; 2196ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 2197f27aaf4bSChristian Brunner return 0; 2198f27aaf4bSChristian Brunner} 2199f27aaf4bSChristian BrunnerEOF 2200ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 2201f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 2202f27aaf4bSChristian Brunner rbd=yes 2203f27aaf4bSChristian Brunner libs_tools="$rbd_libs $libs_tools" 2204f27aaf4bSChristian Brunner libs_softmmu="$rbd_libs $libs_softmmu" 2205f27aaf4bSChristian Brunner else 2206f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 2207f27aaf4bSChristian Brunner feature_not_found "rados block device" 2208f27aaf4bSChristian Brunner fi 2209f27aaf4bSChristian Brunner rbd=no 2210f27aaf4bSChristian Brunner fi 2211f27aaf4bSChristian Brunnerfi 2212f27aaf4bSChristian Brunner 2213f27aaf4bSChristian Brunner########################################## 22145c6c3a6cSChristoph Hellwig# linux-aio probe 22155c6c3a6cSChristoph Hellwig 22165c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 22175c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 22185c6c3a6cSChristoph Hellwig#include <libaio.h> 22195c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 2220832ce9c2SScott Wood#include <stddef.h> 22215c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 22225c6c3a6cSChristoph HellwigEOF 22235c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 22245c6c3a6cSChristoph Hellwig linux_aio=yes 2225048d179fSPaul Brook libs_softmmu="$libs_softmmu -laio" 2226048d179fSPaul Brook libs_tools="$libs_tools -laio" 22275c6c3a6cSChristoph Hellwig else 22285c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 22295c6c3a6cSChristoph Hellwig feature_not_found "linux AIO" 22305c6c3a6cSChristoph Hellwig fi 22313cfcae3cSLuiz Capitulino linux_aio=no 22325c6c3a6cSChristoph Hellwig fi 22335c6c3a6cSChristoph Hellwigfi 22345c6c3a6cSChristoph Hellwig 22355c6c3a6cSChristoph Hellwig########################################## 2236758e8e38SVenkateswararao Jujjuri (JV)# attr probe 2237758e8e38SVenkateswararao Jujjuri (JV) 2238758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 2239758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 2240758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 2241758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 2242f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 2243f2338fb4SPavel Borzenkov#include <attr/xattr.h> 2244f2338fb4SPavel Borzenkov#else 22454f26f2b6SAvi Kivity#include <sys/xattr.h> 2246f2338fb4SPavel Borzenkov#endif 2247758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 2248758e8e38SVenkateswararao Jujjuri (JV)EOF 22494f26f2b6SAvi Kivity if compile_prog "" "" ; then 22504f26f2b6SAvi Kivity attr=yes 22514f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 2252f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 2253758e8e38SVenkateswararao Jujjuri (JV) attr=yes 2254758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 22554f26f2b6SAvi Kivity libattr=yes 2256758e8e38SVenkateswararao Jujjuri (JV) else 2257758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 2258758e8e38SVenkateswararao Jujjuri (JV) feature_not_found "ATTR" 2259758e8e38SVenkateswararao Jujjuri (JV) fi 2260758e8e38SVenkateswararao Jujjuri (JV) attr=no 2261758e8e38SVenkateswararao Jujjuri (JV) fi 2262758e8e38SVenkateswararao Jujjuri (JV)fi 2263758e8e38SVenkateswararao Jujjuri (JV) 2264758e8e38SVenkateswararao Jujjuri (JV)########################################## 2265bf9298b9Saliguori# iovec probe 2266bf9298b9Saliguoricat > $TMPC <<EOF 2267db34f0b3Sblueswir1#include <sys/types.h> 2268bf9298b9Saliguori#include <sys/uio.h> 2269db34f0b3Sblueswir1#include <unistd.h> 2270f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 2271bf9298b9SaliguoriEOF 2272bf9298b9Saliguoriiovec=no 227352166aa0SJuan Quintelaif compile_prog "" "" ; then 2274bf9298b9Saliguori iovec=yes 2275bf9298b9Saliguorifi 2276bf9298b9Saliguori 2277f652e6afSaurel32########################################## 2278ceb42de8Saliguori# preadv probe 2279ceb42de8Saliguoricat > $TMPC <<EOF 2280ceb42de8Saliguori#include <sys/types.h> 2281ceb42de8Saliguori#include <sys/uio.h> 2282ceb42de8Saliguori#include <unistd.h> 2283c075a723SBlue Swirlint main(void) { return preadv(0, 0, 0, 0); } 2284ceb42de8SaliguoriEOF 2285ceb42de8Saliguoripreadv=no 228652166aa0SJuan Quintelaif compile_prog "" "" ; then 2287ceb42de8Saliguori preadv=yes 2288ceb42de8Saliguorifi 2289ceb42de8Saliguori 2290ceb42de8Saliguori########################################## 2291f652e6afSaurel32# fdt probe 22922df87df7SJuan Quintelaif test "$fdt" != "no" ; then 2293b41af4baSJuan Quintela fdt_libs="-lfdt" 2294f652e6afSaurel32 cat > $TMPC << EOF 2295f652e6afSaurel32int main(void) { return 0; } 2296f652e6afSaurel32EOF 229752166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 2298f652e6afSaurel32 fdt=yes 22992df87df7SJuan Quintela else 23002df87df7SJuan Quintela if test "$fdt" = "yes" ; then 23012df87df7SJuan Quintela feature_not_found "fdt" 23022df87df7SJuan Quintela fi 2303de3a354aSMichael Walle fdt_libs= 23042df87df7SJuan Quintela fdt=no 2305f652e6afSaurel32 fi 2306f652e6afSaurel32fi 2307f652e6afSaurel32 230820ff075bSMichael Walle########################################## 230920ff075bSMichael Walle# opengl probe, used by milkymist-tmu2 231020ff075bSMichael Walleif test "$opengl" != "no" ; then 231120ff075bSMichael Walle opengl_libs="-lGL" 231220ff075bSMichael Walle cat > $TMPC << EOF 231320ff075bSMichael Walle#include <X11/Xlib.h> 231420ff075bSMichael Walle#include <GL/gl.h> 231520ff075bSMichael Walle#include <GL/glx.h> 231684972cbbSStefan Weilint main(void) { return GL_VERSION != 0; } 231720ff075bSMichael WalleEOF 231820ff075bSMichael Walle if compile_prog "" "-lGL" ; then 231920ff075bSMichael Walle opengl=yes 232020ff075bSMichael Walle else 232120ff075bSMichael Walle if test "$opengl" = "yes" ; then 232220ff075bSMichael Walle feature_not_found "opengl" 232320ff075bSMichael Walle fi 2324de3a354aSMichael Walle opengl_libs= 232520ff075bSMichael Walle opengl=no 232620ff075bSMichael Walle fi 232720ff075bSMichael Wallefi 232820ff075bSMichael Walle 2329eb100396SBharata B Rao########################################## 2330eb100396SBharata B Rao# glusterfs probe 2331eb100396SBharata B Raoif test "$glusterfs" != "no" ; then 2332eb100396SBharata B Rao cat > $TMPC <<EOF 2333eb100396SBharata B Rao#include <glusterfs/api/glfs.h> 2334eb100396SBharata B Raoint main(void) { 2335eb100396SBharata B Rao (void) glfs_new("volume"); 2336eb100396SBharata B Rao return 0; 2337eb100396SBharata B Rao} 2338eb100396SBharata B RaoEOF 2339eb100396SBharata B Rao glusterfs_libs="-lgfapi -lgfrpc -lgfxdr" 2340eb100396SBharata B Rao if compile_prog "" "$glusterfs_libs" ; then 2341eb100396SBharata B Rao glusterfs=yes 2342eb100396SBharata B Rao libs_tools="$glusterfs_libs $libs_tools" 2343eb100396SBharata B Rao libs_softmmu="$glusterfs_libs $libs_softmmu" 2344eb100396SBharata B Rao else 2345eb100396SBharata B Rao if test "$glusterfs" = "yes" ; then 2346eb100396SBharata B Rao feature_not_found "GlusterFS backend support" 2347eb100396SBharata B Rao fi 2348eb100396SBharata B Rao glusterfs=no 2349eb100396SBharata B Rao fi 2350eb100396SBharata B Raofi 2351eb100396SBharata B Rao 23523b3f24adSaurel32# 23533b3f24adSaurel32# Check for xxxat() functions when we are building linux-user 23543b3f24adSaurel32# emulator. This is done because older glibc versions don't 23553b3f24adSaurel32# have syscall stubs for these implemented. 23563b3f24adSaurel32# 23573b3f24adSaurel32atfile=no 23583b3f24adSaurel32cat > $TMPC << EOF 23593b3f24adSaurel32#define _ATFILE_SOURCE 23603b3f24adSaurel32#include <sys/types.h> 23613b3f24adSaurel32#include <fcntl.h> 23623b3f24adSaurel32#include <unistd.h> 23633b3f24adSaurel32 23643b3f24adSaurel32int 23653b3f24adSaurel32main(void) 23663b3f24adSaurel32{ 23673b3f24adSaurel32 /* try to unlink nonexisting file */ 23683b3f24adSaurel32 return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); 23693b3f24adSaurel32} 23703b3f24adSaurel32EOF 237152166aa0SJuan Quintelaif compile_prog "" "" ; then 23723b3f24adSaurel32 atfile=yes 23733b3f24adSaurel32fi 23743b3f24adSaurel32 237539386ac7Saurel32# Check for inotify functions when we are building linux-user 23763b3f24adSaurel32# emulator. This is done because older glibc versions don't 23773b3f24adSaurel32# have syscall stubs for these implemented. In that case we 23783b3f24adSaurel32# don't provide them even if kernel supports them. 23793b3f24adSaurel32# 23803b3f24adSaurel32inotify=no 23813b3f24adSaurel32cat > $TMPC << EOF 23823b3f24adSaurel32#include <sys/inotify.h> 23833b3f24adSaurel32 23843b3f24adSaurel32int 23853b3f24adSaurel32main(void) 23863b3f24adSaurel32{ 23873b3f24adSaurel32 /* try to start inotify */ 23888690e420Saurel32 return inotify_init(); 23893b3f24adSaurel32} 23903b3f24adSaurel32EOF 239152166aa0SJuan Quintelaif compile_prog "" "" ; then 23923b3f24adSaurel32 inotify=yes 23933b3f24adSaurel32fi 23943b3f24adSaurel32 2395c05c7a73SRiku Voipioinotify1=no 2396c05c7a73SRiku Voipiocat > $TMPC << EOF 2397c05c7a73SRiku Voipio#include <sys/inotify.h> 2398c05c7a73SRiku Voipio 2399c05c7a73SRiku Voipioint 2400c05c7a73SRiku Voipiomain(void) 2401c05c7a73SRiku Voipio{ 2402c05c7a73SRiku Voipio /* try to start inotify */ 2403c05c7a73SRiku Voipio return inotify_init1(0); 2404c05c7a73SRiku Voipio} 2405c05c7a73SRiku VoipioEOF 2406c05c7a73SRiku Voipioif compile_prog "" "" ; then 2407c05c7a73SRiku Voipio inotify1=yes 2408c05c7a73SRiku Voipiofi 2409c05c7a73SRiku Voipio 2410ebc996f3SRiku Voipio# check if utimensat and futimens are supported 2411ebc996f3SRiku Voipioutimens=no 2412ebc996f3SRiku Voipiocat > $TMPC << EOF 2413ebc996f3SRiku Voipio#define _ATFILE_SOURCE 2414ebc996f3SRiku Voipio#include <stddef.h> 2415ebc996f3SRiku Voipio#include <fcntl.h> 24163014ee00SPeter Maydell#include <sys/stat.h> 2417ebc996f3SRiku Voipio 2418ebc996f3SRiku Voipioint main(void) 2419ebc996f3SRiku Voipio{ 2420ebc996f3SRiku Voipio utimensat(AT_FDCWD, "foo", NULL, 0); 2421ebc996f3SRiku Voipio futimens(0, NULL); 2422ebc996f3SRiku Voipio return 0; 2423ebc996f3SRiku Voipio} 2424ebc996f3SRiku VoipioEOF 242552166aa0SJuan Quintelaif compile_prog "" "" ; then 2426ebc996f3SRiku Voipio utimens=yes 2427ebc996f3SRiku Voipiofi 2428ebc996f3SRiku Voipio 2429099d6b0fSRiku Voipio# check if pipe2 is there 2430099d6b0fSRiku Voipiopipe2=no 2431099d6b0fSRiku Voipiocat > $TMPC << EOF 2432099d6b0fSRiku Voipio#include <unistd.h> 2433099d6b0fSRiku Voipio#include <fcntl.h> 2434099d6b0fSRiku Voipio 2435099d6b0fSRiku Voipioint main(void) 2436099d6b0fSRiku Voipio{ 2437099d6b0fSRiku Voipio int pipefd[2]; 24389bca8162SBruce Rogers return pipe2(pipefd, O_CLOEXEC); 2439099d6b0fSRiku Voipio} 2440099d6b0fSRiku VoipioEOF 244152166aa0SJuan Quintelaif compile_prog "" "" ; then 2442099d6b0fSRiku Voipio pipe2=yes 2443099d6b0fSRiku Voipiofi 2444099d6b0fSRiku Voipio 244540ff6d7eSKevin Wolf# check if accept4 is there 244640ff6d7eSKevin Wolfaccept4=no 244740ff6d7eSKevin Wolfcat > $TMPC << EOF 244840ff6d7eSKevin Wolf#include <sys/socket.h> 244940ff6d7eSKevin Wolf#include <stddef.h> 245040ff6d7eSKevin Wolf 245140ff6d7eSKevin Wolfint main(void) 245240ff6d7eSKevin Wolf{ 245340ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 245440ff6d7eSKevin Wolf return 0; 245540ff6d7eSKevin Wolf} 245640ff6d7eSKevin WolfEOF 245740ff6d7eSKevin Wolfif compile_prog "" "" ; then 245840ff6d7eSKevin Wolf accept4=yes 245940ff6d7eSKevin Wolffi 246040ff6d7eSKevin Wolf 24613ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 24623ce34dfbSvibisreenivasansplice=no 24633ce34dfbSvibisreenivasancat > $TMPC << EOF 24643ce34dfbSvibisreenivasan#include <unistd.h> 24653ce34dfbSvibisreenivasan#include <fcntl.h> 24663ce34dfbSvibisreenivasan#include <limits.h> 24673ce34dfbSvibisreenivasan 24683ce34dfbSvibisreenivasanint main(void) 24693ce34dfbSvibisreenivasan{ 247066ea0f22SStefan Weil int len, fd = 0; 24713ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 24723ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 24733ce34dfbSvibisreenivasan return 0; 24743ce34dfbSvibisreenivasan} 24753ce34dfbSvibisreenivasanEOF 247652166aa0SJuan Quintelaif compile_prog "" "" ; then 24773ce34dfbSvibisreenivasan splice=yes 24783ce34dfbSvibisreenivasanfi 24793ce34dfbSvibisreenivasan 2480dcc38d1cSMarcelo Tosatti########################################## 2481dcc38d1cSMarcelo Tosatti# signalfd probe 2482dcc38d1cSMarcelo Tosattisignalfd="no" 2483dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 2484dcc38d1cSMarcelo Tosatti#include <unistd.h> 2485dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 2486dcc38d1cSMarcelo Tosatti#include <signal.h> 2487dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 2488dcc38d1cSMarcelo TosattiEOF 2489dcc38d1cSMarcelo Tosatti 2490dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 2491dcc38d1cSMarcelo Tosatti signalfd=yes 2492dcc38d1cSMarcelo Tosattifi 2493dcc38d1cSMarcelo Tosatti 2494c2882b96SRiku Voipio# check if eventfd is supported 2495c2882b96SRiku Voipioeventfd=no 2496c2882b96SRiku Voipiocat > $TMPC << EOF 2497c2882b96SRiku Voipio#include <sys/eventfd.h> 2498c2882b96SRiku Voipio 2499c2882b96SRiku Voipioint main(void) 2500c2882b96SRiku Voipio{ 250155cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 2502c2882b96SRiku Voipio} 2503c2882b96SRiku VoipioEOF 2504c2882b96SRiku Voipioif compile_prog "" "" ; then 2505c2882b96SRiku Voipio eventfd=yes 2506c2882b96SRiku Voipiofi 2507c2882b96SRiku Voipio 2508d0927938SUlrich Hecht# check for fallocate 2509d0927938SUlrich Hechtfallocate=no 2510d0927938SUlrich Hechtcat > $TMPC << EOF 2511d0927938SUlrich Hecht#include <fcntl.h> 2512d0927938SUlrich Hecht 2513d0927938SUlrich Hechtint main(void) 2514d0927938SUlrich Hecht{ 2515d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 2516d0927938SUlrich Hecht return 0; 2517d0927938SUlrich Hecht} 2518d0927938SUlrich HechtEOF 25198fb03151SPeter Maydellif compile_prog "" "" ; then 2520d0927938SUlrich Hecht fallocate=yes 2521d0927938SUlrich Hechtfi 2522d0927938SUlrich Hecht 2523c727f47dSPeter Maydell# check for sync_file_range 2524c727f47dSPeter Maydellsync_file_range=no 2525c727f47dSPeter Maydellcat > $TMPC << EOF 2526c727f47dSPeter Maydell#include <fcntl.h> 2527c727f47dSPeter Maydell 2528c727f47dSPeter Maydellint main(void) 2529c727f47dSPeter Maydell{ 2530c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 2531c727f47dSPeter Maydell return 0; 2532c727f47dSPeter Maydell} 2533c727f47dSPeter MaydellEOF 25348fb03151SPeter Maydellif compile_prog "" "" ; then 2535c727f47dSPeter Maydell sync_file_range=yes 2536c727f47dSPeter Maydellfi 2537c727f47dSPeter Maydell 2538dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 2539dace20dcSPeter Maydellfiemap=no 2540dace20dcSPeter Maydellcat > $TMPC << EOF 2541dace20dcSPeter Maydell#include <sys/ioctl.h> 2542dace20dcSPeter Maydell#include <linux/fs.h> 2543dace20dcSPeter Maydell#include <linux/fiemap.h> 2544dace20dcSPeter Maydell 2545dace20dcSPeter Maydellint main(void) 2546dace20dcSPeter Maydell{ 2547dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 2548dace20dcSPeter Maydell return 0; 2549dace20dcSPeter Maydell} 2550dace20dcSPeter MaydellEOF 25518fb03151SPeter Maydellif compile_prog "" "" ; then 2552dace20dcSPeter Maydell fiemap=yes 2553dace20dcSPeter Maydellfi 2554dace20dcSPeter Maydell 2555d0927938SUlrich Hecht# check for dup3 2556d0927938SUlrich Hechtdup3=no 2557d0927938SUlrich Hechtcat > $TMPC << EOF 2558d0927938SUlrich Hecht#include <unistd.h> 2559d0927938SUlrich Hecht 2560d0927938SUlrich Hechtint main(void) 2561d0927938SUlrich Hecht{ 2562d0927938SUlrich Hecht dup3(0, 0, 0); 2563d0927938SUlrich Hecht return 0; 2564d0927938SUlrich Hecht} 2565d0927938SUlrich HechtEOF 256678f5d726SJan Kiszkaif compile_prog "" "" ; then 2567d0927938SUlrich Hecht dup3=yes 2568d0927938SUlrich Hechtfi 2569d0927938SUlrich Hecht 25703b6edd16SPeter Maydell# check for epoll support 25713b6edd16SPeter Maydellepoll=no 25723b6edd16SPeter Maydellcat > $TMPC << EOF 25733b6edd16SPeter Maydell#include <sys/epoll.h> 25743b6edd16SPeter Maydell 25753b6edd16SPeter Maydellint main(void) 25763b6edd16SPeter Maydell{ 25773b6edd16SPeter Maydell epoll_create(0); 25783b6edd16SPeter Maydell return 0; 25793b6edd16SPeter Maydell} 25803b6edd16SPeter MaydellEOF 25818fb03151SPeter Maydellif compile_prog "" "" ; then 25823b6edd16SPeter Maydell epoll=yes 25833b6edd16SPeter Maydellfi 25843b6edd16SPeter Maydell 25853b6edd16SPeter Maydell# epoll_create1 and epoll_pwait are later additions 25863b6edd16SPeter Maydell# so we must check separately for their presence 25873b6edd16SPeter Maydellepoll_create1=no 25883b6edd16SPeter Maydellcat > $TMPC << EOF 25893b6edd16SPeter Maydell#include <sys/epoll.h> 25903b6edd16SPeter Maydell 25913b6edd16SPeter Maydellint main(void) 25923b6edd16SPeter Maydell{ 259319e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 259419e83f6bSPeter Maydell * a function being called. This is necessary so that on 259519e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 259619e83f6bSPeter Maydell * the library but not declared in the header file we will 259719e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 259819e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 259919e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 260019e83f6bSPeter Maydell */ 2601c075a723SBlue Swirl return (int)(uintptr_t)&epoll_create1; 26023b6edd16SPeter Maydell} 26033b6edd16SPeter MaydellEOF 26048fb03151SPeter Maydellif compile_prog "" "" ; then 26053b6edd16SPeter Maydell epoll_create1=yes 26063b6edd16SPeter Maydellfi 26073b6edd16SPeter Maydell 26083b6edd16SPeter Maydellepoll_pwait=no 26093b6edd16SPeter Maydellcat > $TMPC << EOF 26103b6edd16SPeter Maydell#include <sys/epoll.h> 26113b6edd16SPeter Maydell 26123b6edd16SPeter Maydellint main(void) 26133b6edd16SPeter Maydell{ 26143b6edd16SPeter Maydell epoll_pwait(0, 0, 0, 0, 0); 26153b6edd16SPeter Maydell return 0; 26163b6edd16SPeter Maydell} 26173b6edd16SPeter MaydellEOF 26188fb03151SPeter Maydellif compile_prog "" "" ; then 26193b6edd16SPeter Maydell epoll_pwait=yes 26203b6edd16SPeter Maydellfi 26213b6edd16SPeter Maydell 2622cc8ae6deSpbrook# Check if tools are available to build documentation. 2623a25dba17SJuan Quintelaif test "$docs" != "no" ; then 262401668d98SStefan Weil if has makeinfo && has pod2man; then 2625a25dba17SJuan Quintela docs=yes 262683a3ab8bSJuan Quintela else 2627a25dba17SJuan Quintela if test "$docs" = "yes" ; then 2628a25dba17SJuan Quintela feature_not_found "docs" 262983a3ab8bSJuan Quintela fi 2630a25dba17SJuan Quintela docs=no 263183a3ab8bSJuan Quintela fi 2632cc8ae6deSpbrookfi 2633cc8ae6deSpbrook 2634f514f41cSStefan Weil# Search for bswap_32 function 26356ae9a1f4SJuan Quintelabyteswap_h=no 26366ae9a1f4SJuan Quintelacat > $TMPC << EOF 26376ae9a1f4SJuan Quintela#include <byteswap.h> 26386ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 26396ae9a1f4SJuan QuintelaEOF 264052166aa0SJuan Quintelaif compile_prog "" "" ; then 26416ae9a1f4SJuan Quintela byteswap_h=yes 26426ae9a1f4SJuan Quintelafi 26436ae9a1f4SJuan Quintela 2644f514f41cSStefan Weil# Search for bswap_32 function 26456ae9a1f4SJuan Quintelabswap_h=no 26466ae9a1f4SJuan Quintelacat > $TMPC << EOF 26476ae9a1f4SJuan Quintela#include <sys/endian.h> 26486ae9a1f4SJuan Quintela#include <sys/types.h> 26496ae9a1f4SJuan Quintela#include <machine/bswap.h> 26506ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 26516ae9a1f4SJuan QuintelaEOF 265252166aa0SJuan Quintelaif compile_prog "" "" ; then 26536ae9a1f4SJuan Quintela bswap_h=yes 26546ae9a1f4SJuan Quintelafi 26556ae9a1f4SJuan Quintela 2656da93a1fdSaliguori########################################## 2657c589b249SRonnie Sahlberg# Do we have libiscsi 2658fa6acb0cSRonnie Sahlberg# We check for iscsi_unmap_sync() to make sure we have a 2659fa6acb0cSRonnie Sahlberg# recent enough version of libiscsi. 2660c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 2661c589b249SRonnie Sahlberg cat > $TMPC << EOF 2662fa6acb0cSRonnie Sahlberg#include <stdio.h> 2663c589b249SRonnie Sahlberg#include <iscsi/iscsi.h> 2664fa6acb0cSRonnie Sahlbergint main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } 2665c589b249SRonnie SahlbergEOF 2666417c9d72SAlexander Graf if compile_prog "" "-liscsi" ; then 2667c589b249SRonnie Sahlberg libiscsi="yes" 2668c589b249SRonnie Sahlberg LIBS="$LIBS -liscsi" 2669c589b249SRonnie Sahlberg else 2670c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 2671c589b249SRonnie Sahlberg feature_not_found "libiscsi" 2672c589b249SRonnie Sahlberg fi 2673c589b249SRonnie Sahlberg libiscsi="no" 2674c589b249SRonnie Sahlberg fi 2675c589b249SRonnie Sahlbergfi 2676c589b249SRonnie Sahlberg 2677c589b249SRonnie Sahlberg 2678c589b249SRonnie Sahlberg########################################## 26798bacde8dSNatanael Copa# Do we need libm 26808bacde8dSNatanael Copacat > $TMPC << EOF 26818bacde8dSNatanael Copa#include <math.h> 26828bacde8dSNatanael Copaint main(void) { return isnan(sin(0.0)); } 26838bacde8dSNatanael CopaEOF 26848bacde8dSNatanael Copaif compile_prog "" "" ; then 26858bacde8dSNatanael Copa : 26868bacde8dSNatanael Copaelif compile_prog "" "-lm" ; then 26878bacde8dSNatanael Copa LIBS="-lm $LIBS" 26888bacde8dSNatanael Copa libs_qga="-lm $libs_qga" 26898bacde8dSNatanael Copaelse 26908bacde8dSNatanael Copa echo 26918bacde8dSNatanael Copa echo "Error: libm check failed" 26928bacde8dSNatanael Copa echo 26938bacde8dSNatanael Copa exit 1 26948bacde8dSNatanael Copafi 26958bacde8dSNatanael Copa 26968bacde8dSNatanael Copa########################################## 2697da93a1fdSaliguori# Do we need librt 26988bacde8dSNatanael Copa# uClibc provides 2 versions of clock_gettime(), one with realtime 26998bacde8dSNatanael Copa# support and one without. This means that the clock_gettime() don't 27008bacde8dSNatanael Copa# need -lrt. We still need it for timer_create() so we check for this 27018bacde8dSNatanael Copa# function in addition. 2702da93a1fdSaliguoricat > $TMPC <<EOF 2703da93a1fdSaliguori#include <signal.h> 2704da93a1fdSaliguori#include <time.h> 27058bacde8dSNatanael Copaint main(void) { 27068bacde8dSNatanael Copa timer_create(CLOCK_REALTIME, NULL, NULL); 27078bacde8dSNatanael Copa return clock_gettime(CLOCK_REALTIME, NULL); 27088bacde8dSNatanael Copa} 2709da93a1fdSaliguoriEOF 2710da93a1fdSaliguori 271152166aa0SJuan Quintelaif compile_prog "" "" ; then 271207ffa4bdSJuan Quintela : 27138bacde8dSNatanael Copa# we need pthread for static linking. use previous pthread test result 27148bacde8dSNatanael Copaelif compile_prog "" "-lrt $pthread_lib" ; then 271507ffa4bdSJuan Quintela LIBS="-lrt $LIBS" 27168bacde8dSNatanael Copa libs_qga="-lrt $libs_qga" 2717da93a1fdSaliguorifi 2718da93a1fdSaliguori 271931ff504dSBlue Swirlif test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ 2720179cf400SAndreas Färber "$aix" != "yes" -a "$haiku" != "yes" ; then 27216362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 27226362a53fSJuan Quintelafi 27236362a53fSJuan Quintela 2724de5071c5SBlue Swirl########################################## 2725cd4ec0b4SGerd Hoffmann# spice probe 2726cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 2727cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 2728cd4ec0b4SGerd Hoffmann#include <spice.h> 2729cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 2730cd4ec0b4SGerd HoffmannEOF 2731710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 2732710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 273367be6726SGerd Hoffmann if $pkg_config --atleast-version=0.12.0 spice-server >/dev/null 2>&1 && \ 273467be6726SGerd Hoffmann $pkg_config --atleast-version=0.12.2 spice-protocol > /dev/null 2>&1 && \ 2735cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 2736cd4ec0b4SGerd Hoffmann spice="yes" 2737cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 2738cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 27392e0e3c39SAlon Levy spice_protocol_version=$($pkg_config --modversion spice-protocol) 27402e0e3c39SAlon Levy spice_server_version=$($pkg_config --modversion spice-server) 2741cd4ec0b4SGerd Hoffmann else 2742cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 2743cd4ec0b4SGerd Hoffmann feature_not_found "spice" 2744cd4ec0b4SGerd Hoffmann fi 2745cd4ec0b4SGerd Hoffmann spice="no" 2746cd4ec0b4SGerd Hoffmann fi 2747cd4ec0b4SGerd Hoffmannfi 2748cd4ec0b4SGerd Hoffmann 2749111a38b0SRobert Relyea# check for libcacard for smartcard support 2750111a38b0SRobert Relyeaif test "$smartcard" != "no" ; then 2751111a38b0SRobert Relyea smartcard="yes" 2752111a38b0SRobert Relyea smartcard_cflags="" 2753111a38b0SRobert Relyea # TODO - what's the minimal nss version we support? 2754111a38b0SRobert Relyea if test "$smartcard_nss" != "no"; then 27555f01e06fSSergei Trofimovich cat > $TMPC << EOF 27565f01e06fSSergei Trofimovich#include <pk11pub.h> 27575f01e06fSSergei Trofimovichint main(void) { PK11_FreeSlot(0); return 0; } 27585f01e06fSSergei TrofimovichEOF 27590b22ef0fSPeter Maydell smartcard_includes="-I\$(SRC_PATH)/libcacard" 27608c741c22SAlon Levy libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" 27618c741c22SAlon Levy libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" 27626ca026cbSPeter Maydell test_cflags="$libcacard_cflags" 27636ca026cbSPeter Maydell # The header files in nss < 3.13.3 have a bug which causes them to 27646ca026cbSPeter Maydell # emit a warning. If we're going to compile QEMU with -Werror, then 27656ca026cbSPeter Maydell # test that the headers don't have this bug. Otherwise we would pass 27666ca026cbSPeter Maydell # the configure test but fail to compile QEMU later. 27676ca026cbSPeter Maydell if test "$werror" = "yes"; then 27686ca026cbSPeter Maydell test_cflags="-Werror $test_cflags" 27696ca026cbSPeter Maydell fi 27705f01e06fSSergei Trofimovich if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ 27716ca026cbSPeter Maydell compile_prog "$test_cflags" "$libcacard_libs"; then 27725f01e06fSSergei Trofimovich smartcard_nss="yes" 27730b22ef0fSPeter Maydell QEMU_CFLAGS="$QEMU_CFLAGS $libcacard_cflags" 27740b22ef0fSPeter Maydell QEMU_INCLUDES="$QEMU_INCLUDES $smartcard_includes" 2775ad4cf3f6SPaul Brook libs_softmmu="$libcacard_libs $libs_softmmu" 2776111a38b0SRobert Relyea else 2777111a38b0SRobert Relyea if test "$smartcard_nss" = "yes"; then 2778111a38b0SRobert Relyea feature_not_found "nss" 2779111a38b0SRobert Relyea fi 2780111a38b0SRobert Relyea smartcard_nss="no" 2781111a38b0SRobert Relyea fi 2782111a38b0SRobert Relyea fi 2783111a38b0SRobert Relyeafi 2784111a38b0SRobert Relyeaif test "$smartcard" = "no" ; then 2785111a38b0SRobert Relyea smartcard_nss="no" 2786111a38b0SRobert Relyeafi 2787111a38b0SRobert Relyea 278869354a83SHans de Goede# check for usbredirparser for usb network redirection support 278969354a83SHans de Goedeif test "$usb_redir" != "no" ; then 2790c19a7981SHans de Goede if $pkg_config --atleast-version=0.5.3 libusbredirparser-0.5 >/dev/null 2>&1 ; then 279169354a83SHans de Goede usb_redir="yes" 27928b626aa7SHans de Goede usb_redir_cflags=$($pkg_config --cflags libusbredirparser-0.5 2>/dev/null) 27938b626aa7SHans de Goede usb_redir_libs=$($pkg_config --libs libusbredirparser-0.5 2>/dev/null) 279469354a83SHans de Goede QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" 279556ab2ad1SAurelien Jarno libs_softmmu="$libs_softmmu $usb_redir_libs" 279669354a83SHans de Goede else 279769354a83SHans de Goede if test "$usb_redir" = "yes"; then 279869354a83SHans de Goede feature_not_found "usb-redir" 279969354a83SHans de Goede fi 280069354a83SHans de Goede usb_redir="no" 280169354a83SHans de Goede fi 280269354a83SHans de Goedefi 280369354a83SHans de Goede 2804cd4ec0b4SGerd Hoffmann########################################## 2805cd4ec0b4SGerd Hoffmann 2806747bbdf7SBlue Swirl########################################## 28075f6b9e8fSBlue Swirl# check if we have fdatasync 28085f6b9e8fSBlue Swirl 28095f6b9e8fSBlue Swirlfdatasync=no 28105f6b9e8fSBlue Swirlcat > $TMPC << EOF 28115f6b9e8fSBlue Swirl#include <unistd.h> 2812d1722a27SAlexandre Raymondint main(void) { 2813d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 2814d1722a27SAlexandre Raymondreturn fdatasync(0); 2815d1722a27SAlexandre Raymond#else 2816e172fe11SStefan Weil#error Not supported 2817d1722a27SAlexandre Raymond#endif 2818d1722a27SAlexandre Raymond} 28195f6b9e8fSBlue SwirlEOF 28205f6b9e8fSBlue Swirlif compile_prog "" "" ; then 28215f6b9e8fSBlue Swirl fdatasync=yes 28225f6b9e8fSBlue Swirlfi 28235f6b9e8fSBlue Swirl 282494a420b1SStefan Hajnoczi########################################## 2825e78815a5SAndreas Färber# check if we have madvise 2826e78815a5SAndreas Färber 2827e78815a5SAndreas Färbermadvise=no 2828e78815a5SAndreas Färbercat > $TMPC << EOF 2829e78815a5SAndreas Färber#include <sys/types.h> 2830e78815a5SAndreas Färber#include <sys/mman.h> 2831832ce9c2SScott Wood#include <stddef.h> 2832e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 2833e78815a5SAndreas FärberEOF 2834e78815a5SAndreas Färberif compile_prog "" "" ; then 2835e78815a5SAndreas Färber madvise=yes 2836e78815a5SAndreas Färberfi 2837e78815a5SAndreas Färber 2838e78815a5SAndreas Färber########################################## 2839e78815a5SAndreas Färber# check if we have posix_madvise 2840e78815a5SAndreas Färber 2841e78815a5SAndreas Färberposix_madvise=no 2842e78815a5SAndreas Färbercat > $TMPC << EOF 2843e78815a5SAndreas Färber#include <sys/mman.h> 2844832ce9c2SScott Wood#include <stddef.h> 2845e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 2846e78815a5SAndreas FärberEOF 2847e78815a5SAndreas Färberif compile_prog "" "" ; then 2848e78815a5SAndreas Färber posix_madvise=yes 2849e78815a5SAndreas Färberfi 2850e78815a5SAndreas Färber 2851e78815a5SAndreas Färber########################################## 28521e9737daSRichard Henderson# check if we have usable SIGEV_THREAD_ID 28531e9737daSRichard Henderson 28541e9737daSRichard Hendersonsigev_thread_id=no 28551e9737daSRichard Hendersoncat > $TMPC << EOF 28561e9737daSRichard Henderson#include <signal.h> 28571e9737daSRichard Hendersonint main(void) { 28581e9737daSRichard Henderson struct sigevent ev; 28591e9737daSRichard Henderson ev.sigev_notify = SIGEV_THREAD_ID; 28601e9737daSRichard Henderson ev._sigev_un._tid = 0; 28611e9737daSRichard Henderson asm volatile("" : : "g"(&ev)); 28621e9737daSRichard Henderson return 0; 28631e9737daSRichard Henderson} 28641e9737daSRichard HendersonEOF 28651e9737daSRichard Hendersonif compile_prog "" "" ; then 28661e9737daSRichard Henderson sigev_thread_id=yes 28671e9737daSRichard Hendersonfi 28681e9737daSRichard Henderson 28691e9737daSRichard Henderson########################################## 287094a420b1SStefan Hajnoczi# check if trace backend exists 287194a420b1SStefan Hajnoczi 2872650ab98dSLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null 287394a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 287494a420b1SStefan Hajnoczi echo 287594a420b1SStefan Hajnoczi echo "Error: invalid trace backend" 287694a420b1SStefan Hajnoczi echo "Please choose a supported trace backend." 287794a420b1SStefan Hajnoczi echo 287894a420b1SStefan Hajnoczi exit 1 287994a420b1SStefan Hajnoczifi 288094a420b1SStefan Hajnoczi 28817e24e92aSStefan Hajnoczi########################################## 28827e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 28837e24e92aSStefan Hajnocziif test "$trace_backend" = "ust"; then 28847e24e92aSStefan Hajnoczi cat > $TMPC << EOF 28857e24e92aSStefan Hajnoczi#include <ust/tracepoint.h> 28867e24e92aSStefan Hajnoczi#include <ust/marker.h> 28877e24e92aSStefan Hajnocziint main(void) { return 0; } 28887e24e92aSStefan HajnocziEOF 28897e24e92aSStefan Hajnoczi if compile_prog "" "" ; then 289094b4fefaSLluís Vilanova LIBS="-lust -lurcu-bp $LIBS" 2891c9a2e37cSLluís Vilanova libs_qga="-lust -lurcu-bp $libs_qga" 28927e24e92aSStefan Hajnoczi else 28937e24e92aSStefan Hajnoczi echo 28947e24e92aSStefan Hajnoczi echo "Error: Trace backend 'ust' missing libust header files" 28957e24e92aSStefan Hajnoczi echo 28967e24e92aSStefan Hajnoczi exit 1 28977e24e92aSStefan Hajnoczi fi 28987e24e92aSStefan Hajnoczifi 2899b3d08c02SDaniel P. Berrange 2900b3d08c02SDaniel P. Berrange########################################## 2901b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 2902b3d08c02SDaniel P. Berrangeif test "$trace_backend" = "dtrace"; then 2903b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 2904b3d08c02SDaniel P. Berrange echo 2905b3d08c02SDaniel P. Berrange echo "Error: dtrace command is not found in PATH $PATH" 2906b3d08c02SDaniel P. Berrange echo 2907b3d08c02SDaniel P. Berrange exit 1 2908b3d08c02SDaniel P. Berrange fi 2909c276b17dSDaniel P. Berrange trace_backend_stap="no" 2910c276b17dSDaniel P. Berrange if has 'stap' ; then 2911c276b17dSDaniel P. Berrange trace_backend_stap="yes" 2912c276b17dSDaniel P. Berrange fi 2913b3d08c02SDaniel P. Berrangefi 2914b3d08c02SDaniel P. Berrange 29157e24e92aSStefan Hajnoczi########################################## 2916023367e6SWolfgang Mauerer# __sync_fetch_and_and requires at least -march=i486. Many toolchains 2917023367e6SWolfgang Mauerer# use i686 as default anyway, but for those that don't, an explicit 2918023367e6SWolfgang Mauerer# specification is necessary 29191ba16968SStefan Weilif test "$vhost_net" = "yes" && test "$cpu" = "i386"; then 2920023367e6SWolfgang Mauerer cat > $TMPC << EOF 29217ace252aSStefan Weilstatic int sfaa(int *ptr) 2922023367e6SWolfgang Mauerer{ 2923023367e6SWolfgang Mauerer return __sync_fetch_and_and(ptr, 0); 2924023367e6SWolfgang Mauerer} 2925023367e6SWolfgang Mauerer 2926abab1a0fSStefan Weilint main(void) 2927023367e6SWolfgang Mauerer{ 2928023367e6SWolfgang Mauerer int val = 42; 2929023367e6SWolfgang Mauerer sfaa(&val); 2930023367e6SWolfgang Mauerer return val; 2931023367e6SWolfgang Mauerer} 2932023367e6SWolfgang MauererEOF 2933023367e6SWolfgang Mauerer if ! compile_prog "" "" ; then 2934caa50971SPeter Maydell QEMU_CFLAGS="-march=i486 $QEMU_CFLAGS" 2935023367e6SWolfgang Mauerer fi 2936023367e6SWolfgang Mauererfi 2937023367e6SWolfgang Mauerer 2938023367e6SWolfgang Mauerer########################################## 2939519175a2SAlex Barcelo# check and set a backend for coroutine 2940d0e2fce5SAneesh Kumar K.V 2941519175a2SAlex Barcelo# default is ucontext, but always fallback to gthread 2942519175a2SAlex Barcelo# windows autodetected by make 2943519175a2SAlex Barceloif test "$coroutine" = "" -o "$coroutine" = "ucontext"; then 2944d0e2fce5SAneesh Kumar K.V if test "$darwin" != "yes"; then 2945d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 2946d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 2947cdf84806SPeter Maydell#ifdef __stub_makecontext 2948cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 2949cdf84806SPeter Maydell#endif 295075cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 2951d0e2fce5SAneesh Kumar K.VEOF 2952d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 2953519175a2SAlex Barcelo coroutine_backend=ucontext 2954519175a2SAlex Barcelo else 2955519175a2SAlex Barcelo coroutine_backend=gthread 2956d0e2fce5SAneesh Kumar K.V fi 2957519175a2SAlex Barcelo else 2958519175a2SAlex Barcelo echo "Silently falling back into gthread backend under darwin" 2959519175a2SAlex Barcelo fi 2960519175a2SAlex Barceloelif test "$coroutine" = "gthread" ; then 2961519175a2SAlex Barcelo coroutine_backend=gthread 2962519175a2SAlex Barceloelif test "$coroutine" = "windows" ; then 2963519175a2SAlex Barcelo coroutine_backend=windows 2964fe91bfa8SAlex Barceloelif test "$coroutine" = "sigaltstack" ; then 2965fe91bfa8SAlex Barcelo coroutine_backend=sigaltstack 2966519175a2SAlex Barceloelse 2967519175a2SAlex Barcelo echo 2968519175a2SAlex Barcelo echo "Error: unknown coroutine backend $coroutine" 2969519175a2SAlex Barcelo echo 2970519175a2SAlex Barcelo exit 1 2971d0e2fce5SAneesh Kumar K.Vfi 2972d0e2fce5SAneesh Kumar K.V 2973d0e2fce5SAneesh Kumar K.V########################################## 2974d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 2975d2042378SAneesh Kumar K.V 29764e1797f9SStefan Weilopen_by_handle_at=no 2977d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 2978d2042378SAneesh Kumar K.V#include <fcntl.h> 2979acc55ba8SStefan Weil#if !defined(AT_EMPTY_PATH) 2980acc55ba8SStefan Weil# error missing definition 2981acc55ba8SStefan Weil#else 298275cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 2983acc55ba8SStefan Weil#endif 2984d2042378SAneesh Kumar K.VEOF 2985d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 2986d2042378SAneesh Kumar K.V open_by_handle_at=yes 2987d2042378SAneesh Kumar K.Vfi 2988d2042378SAneesh Kumar K.V 2989e06a765eSHarsh Prateek Bora######################################## 2990e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 2991e06a765eSHarsh Prateek Bora 2992e06a765eSHarsh Prateek Boralinux_magic_h=no 2993e06a765eSHarsh Prateek Boracat > $TMPC << EOF 2994e06a765eSHarsh Prateek Bora#include <linux/magic.h> 2995e06a765eSHarsh Prateek Boraint main(void) { 299675cafad7SStefan Weil return 0; 2997e06a765eSHarsh Prateek Bora} 2998e06a765eSHarsh Prateek BoraEOF 2999e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 3000e06a765eSHarsh Prateek Bora linux_magic_h=yes 3001e06a765eSHarsh Prateek Borafi 3002e06a765eSHarsh Prateek Bora 30038ab1bf12SLuiz Capitulino######################################## 300406d71fa1SPeter Maydell# check whether we can disable the -Wunused-but-set-variable 300506d71fa1SPeter Maydell# option with a pragma (this is needed to silence a warning in 300606d71fa1SPeter Maydell# some versions of the valgrind VALGRIND_STACK_DEREGISTER macro.) 300706d71fa1SPeter Maydell# This test has to be compiled with -Werror as otherwise an 300806d71fa1SPeter Maydell# unknown pragma is only a warning. 300906d71fa1SPeter Maydellpragma_disable_unused_but_set=no 301006d71fa1SPeter Maydellcat > $TMPC << EOF 301106d71fa1SPeter Maydell#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 301206d71fa1SPeter Maydellint main(void) { 301306d71fa1SPeter Maydell return 0; 301406d71fa1SPeter Maydell} 301506d71fa1SPeter MaydellEOF 301606d71fa1SPeter Maydellif compile_prog "-Werror" "" ; then 301706d71fa1SPeter Maydell pragma_disable_unused_but_set=yes 301806d71fa1SPeter Maydellfi 301906d71fa1SPeter Maydell 302006d71fa1SPeter Maydell######################################## 302162fe8331SChristian Borntraeger# check if we have valgrind/valgrind.h and valgrind/memcheck.h 30223f4349dcSKevin Wolf 30233f4349dcSKevin Wolfvalgrind_h=no 30243f4349dcSKevin Wolfcat > $TMPC << EOF 30253f4349dcSKevin Wolf#include <valgrind/valgrind.h> 302662fe8331SChristian Borntraeger#include <valgrind/memcheck.h> 30273f4349dcSKevin Wolfint main(void) { 30283f4349dcSKevin Wolf return 0; 30293f4349dcSKevin Wolf} 30303f4349dcSKevin WolfEOF 30313f4349dcSKevin Wolfif compile_prog "" "" ; then 30323f4349dcSKevin Wolf valgrind_h=yes 30333f4349dcSKevin Wolffi 30343f4349dcSKevin Wolf 30353f4349dcSKevin Wolf######################################## 30368ab1bf12SLuiz Capitulino# check if environ is declared 30378ab1bf12SLuiz Capitulino 30388ab1bf12SLuiz Capitulinohas_environ=no 30398ab1bf12SLuiz Capitulinocat > $TMPC << EOF 30408ab1bf12SLuiz Capitulino#include <unistd.h> 30418ab1bf12SLuiz Capitulinoint main(void) { 3042c075a723SBlue Swirl environ = 0; 30438ab1bf12SLuiz Capitulino return 0; 30448ab1bf12SLuiz Capitulino} 30458ab1bf12SLuiz CapitulinoEOF 30468ab1bf12SLuiz Capitulinoif compile_prog "" "" ; then 30478ab1bf12SLuiz Capitulino has_environ=yes 30488ab1bf12SLuiz Capitulinofi 30498ab1bf12SLuiz Capitulino 3050d2042378SAneesh Kumar K.V########################################## 3051e86ecd4bSJuan Quintela# End of CC checks 3052e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 3053e86ecd4bSJuan Quintela 3054e86ecd4bSJuan Quintelaif test "$debug" = "no" ; then 30558be74dc0SAvi Kivity CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS" 3056e86ecd4bSJuan Quintelafi 3057a316e378SJuan Quintela 305820ff6c80SAnthony Liguori# Disable zero malloc errors for official releases unless explicitly told to 305920ff6c80SAnthony Liguori# enable/disable 306020ff6c80SAnthony Liguoriif test -z "$zero_malloc" ; then 306120ff6c80SAnthony Liguori if test "$z_version" = "50" ; then 306220ff6c80SAnthony Liguori zero_malloc="no" 306320ff6c80SAnthony Liguori else 306420ff6c80SAnthony Liguori zero_malloc="yes" 306520ff6c80SAnthony Liguori fi 306620ff6c80SAnthony Liguorifi 306720ff6c80SAnthony Liguori 30686ca026cbSPeter Maydell# Now we've finished running tests it's OK to add -Werror to the compiler flags 30696ca026cbSPeter Maydellif test "$werror" = "yes"; then 30706ca026cbSPeter Maydell QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 30716ca026cbSPeter Maydellfi 30726ca026cbSPeter Maydell 3073e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 3074e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 30751156c669SJuan Quintela LDFLAGS="-Wl,--warn-common $LDFLAGS" 3076e86ecd4bSJuan Quintela fi 3077e86ecd4bSJuan Quintelafi 3078e86ecd4bSJuan Quintela 307994dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 308094dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 308194dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 308294dd53c5SGerd Hoffmannelse 308394dd53c5SGerd Hoffmann POD2MAN="pod2man" 308494dd53c5SGerd Hoffmannfi 308594dd53c5SGerd Hoffmann 3086952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 3087952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 3088952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 3089952afb71SBlue Swirl if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then 3090952afb71SBlue Swirl LDFLAGS="-Wl,$flag $LDFLAGS" 3091952afb71SBlue Swirl fi 3092952afb71SBlue Swirl done 3093952afb71SBlue Swirlfi 3094952afb71SBlue Swirl 309510ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 3096528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 30975a67135aSbellard 30984b1c11fdSDaniel P. Berrangetools="" 30994b1c11fdSDaniel P. Berrangeif test "$want_tools" = "yes" ; then 3100ca35f780SPaolo Bonzini tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" 31014b1c11fdSDaniel P. Berrange if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 31024b1c11fdSDaniel P. Berrange tools="qemu-nbd\$(EXESUF) $tools" 31034b1c11fdSDaniel P. Berrange fi 31044b1c11fdSDaniel P. Berrangefi 31054b1c11fdSDaniel P. Berrangeif test "$softmmu" = yes ; then 3106983eef5aSMeador Inge if test "$virtfs" != no ; then 3107be5ea8edSAnthony Liguori if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then 3108983eef5aSMeador Inge virtfs=yes 310917bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 3110983eef5aSMeador Inge else 3111983eef5aSMeador Inge if test "$virtfs" = yes; then 3112263ddcc8SHarsh Prateek Bora echo "VirtFS is supported only on Linux and requires libcap-devel and libattr-devel" 3113263ddcc8SHarsh Prateek Bora exit 1 3114983eef5aSMeador Inge fi 311517500370SAndreas Färber virtfs=no 3116983eef5aSMeador Inge fi 311717bff52bSM. Mohan Kumar fi 3118ca35f780SPaolo Bonzini if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 3119d138cee9SMichael Roth if [ "$guest_agent" = "yes" ]; then 312048ff7a62SMichael Roth tools="qemu-ga\$(EXESUF) $tools" 3121d138cee9SMichael Roth fi 3122ca35f780SPaolo Bonzini fi 312300c705fbSPaolo Bonzini if test "$smartcard_nss" = "yes" ; then 312400c705fbSPaolo Bonzini tools="vscclient\$(EXESUF) $tools" 312500c705fbSPaolo Bonzini fi 31264b1c11fdSDaniel P. Berrangefi 3127ca35f780SPaolo Bonzini 3128ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 3129ca35f780SPaolo Bonziniroms= 3130ca35f780SPaolo Bonziniif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ 3131ca35f780SPaolo Bonzini "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ 3132ca35f780SPaolo Bonzini "$softmmu" = yes ; then 3133ca35f780SPaolo Bonzini roms="optionrom" 3134ca35f780SPaolo Bonzinifi 3135d0384d1dSAndreas Färberif test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then 313639ac8455SDavid Gibson roms="$roms spapr-rtas" 313739ac8455SDavid Gibsonfi 3138ca35f780SPaolo Bonzini 31395ca9388aSGerd Hoffmann# add pixman flags after all config tests are done 31405ca9388aSGerd HoffmannQEMU_CFLAGS="$QEMU_CFLAGS $pixman_cflags" 31415ca9388aSGerd Hoffmannlibs_softmmu="$libs_softmmu $pixman_libs" 31425ca9388aSGerd Hoffmann 31437d13299dSbellardecho "Install prefix $prefix" 3144c00b2808SEduardo Habkostecho "BIOS directory `eval echo $qemu_datadir`" 3145f2b9e1e3SPaolo Bonziniecho "binary directory `eval echo $bindir`" 31463aa5d2beSAlon Levyecho "library directory `eval echo $libdir`" 31478bf188aaSMichael Tokarevecho "libexec directory `eval echo $libexecdir`" 31480f94d6daSAlon Levyecho "include directory `eval echo $includedir`" 31491c0fd160SAurelien Jarnoecho "config directory `eval echo $sysconfdir`" 3150785c23aeSLuiz Capitulinoecho "local state directory `eval echo $local_statedir`" 315111d9f695Sbellardif test "$mingw32" = "no" ; then 3152f2b9e1e3SPaolo Bonziniecho "Manual directory `eval echo $mandir`" 315343ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 315411d9f695Sbellardfi 31555a67135aSbellardecho "Source path $source_path" 31567d13299dSbellardecho "C compiler $cc" 315783469015Sbellardecho "Host C compiler $host_cc" 31583c4a4d0dSPeter Maydellecho "Objective-C compiler $objcc" 31590c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 3160a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 31610c439cbfSJuan Quintelaecho "LDFLAGS $LDFLAGS" 31627d13299dSbellardecho "make $make" 31636a882643Spbrookecho "install $install" 3164c886edfbSBlue Swirlecho "python $python" 3165e2d8830eSBradif test "$slirp" = "yes" ; then 3166e2d8830eSBrad echo "smbd $smbd" 3167e2d8830eSBradfi 3168a98fd896Sbellardecho "host CPU $cpu" 3169de83cd02Sbellardecho "host big endian $bigendian" 317097a847bcSbellardecho "target list $target_list" 3171ade25b0dSaurel32echo "tcg debug enabled $debug_tcg" 31727d13299dSbellardecho "gprof enabled $gprof" 317303b4fe7dSaliguoriecho "sparse enabled $sparse" 31741625af87Saliguoriecho "strip binaries $strip_opt" 317505c2a3e7Sbellardecho "profiler $profiler" 317643ce4dfeSbellardecho "static build $static" 317785aa5189Sbellardecho "-Werror enabled $werror" 31785b0753e0Sbellardif test "$darwin" = "yes" ; then 31795b0753e0Sbellard echo "Cocoa support $cocoa" 31805b0753e0Sbellardfi 3181e2134eb9SGerd Hoffmannecho "pixman $pixman" 318297a847bcSbellardecho "SDL support $sdl" 31834d3b6f6eSbalrogecho "curses support $curses" 3184769ce76dSAlexander Grafecho "curl support $curl" 318567b915a5Sbellardecho "mingw32 support $mingw32" 31860c58ac1cSmalcecho "Audio drivers $audio_drv_list" 31870c58ac1cSmalcecho "Extra audio cards $audio_card_list" 3188eb852011SMarkus Armbrusterecho "Block whitelist $block_drv_whitelist" 31898ff9cbf7Smalcecho "Mixer emulation $mixemu" 3190983eef5aSMeador Ingeecho "VirtFS support $virtfs" 3191821601eaSJes Sorensenecho "VNC support $vnc" 3192821601eaSJes Sorensenif test "$vnc" = "yes" ; then 31938d5d2d4cSths echo "VNC TLS support $vnc_tls" 31942f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 31952f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 3196efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 3197821601eaSJes Sorensenfi 31983142255cSblueswir1if test -n "$sparc_cpu"; then 31993142255cSblueswir1 echo "Target Sparc Arch $sparc_cpu" 32003142255cSblueswir1fi 3201e37630caSaliguoriecho "xen support $xen" 32022e4d9fb1Saurel32echo "brlapi support $brlapi" 3203a20a6f46SJuan Quintelaecho "bluez support $bluez" 3204a25dba17SJuan Quintelaecho "Documentation $docs" 3205c5937220Spbrook[ ! -z "$uname_release" ] && \ 3206c5937220Spbrookecho "uname -r $uname_release" 3207bd0c5661Spbrookecho "NPTL support $nptl" 3208379f6698SPaul Brookecho "GUEST_BASE $guest_base" 320940d6444eSAvi Kivityecho "PIE $pie" 32108a16d273Sthsecho "vde support $vde" 32115c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 3212758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 321377755340Sthsecho "Install blobs $blobs" 3214b31a0277SJuan Quintelaecho "KVM support $kvm" 32159195b2c2SStefan Weilecho "TCG interpreter $tcg_interpreter" 3216f652e6afSaurel32echo "fdt support $fdt" 3217ceb42de8Saliguoriecho "preadv support $preadv" 32185f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 3219e78815a5SAndreas Färberecho "madvise $madvise" 3220e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 32211e9737daSRichard Hendersonecho "sigev_thread_id $sigev_thread_id" 3222ee682d27SStefan Weilecho "uuid support $uuid" 322347e98658SCorey Bryantecho "libcap-ng support $cap_ng" 3224d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 322594a420b1SStefan Hajnocziecho "Trace backend $trace_backend" 32269410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 32272e0e3c39SAlon Levyecho "spice support $spice ($spice_protocol_version/$spice_server_version)" 3228f27aaf4bSChristian Brunnerecho "rbd support $rbd" 3229dce512deSChristoph Hellwigecho "xfsctl support $xfs" 3230111a38b0SRobert Relyeaecho "nss used $smartcard_nss" 323169354a83SHans de Goedeecho "usb net redir $usb_redir" 323220ff075bSMichael Walleecho "OpenGL support $opengl" 3233c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 3234d138cee9SMichael Rothecho "build guest agent $guest_agent" 3235f794573eSEduardo Otuboecho "seccomp support $seccomp" 3236519175a2SAlex Barceloecho "coroutine backend $coroutine_backend" 3237eb100396SBharata B Raoecho "GlusterFS support $glusterfs" 323867b915a5Sbellard 32391ba16968SStefan Weilif test "$sdl_too_old" = "yes"; then 324024b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 3241e8cd23deSbellardfi 324297a847bcSbellard 324398ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 32444bf6b55bSJuan Quintelaconfig_host_ld="config-host.ld" 324597a847bcSbellard 324698ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 324798ec69acSJuan Quintelaprintf "# Configured with:" >> $config_host_mak 324898ec69acSJuan Quintelaprintf " '%s'" "$0" "$@" >> $config_host_mak 324998ec69acSJuan Quintelaecho >> $config_host_mak 325098ec69acSJuan Quintela 3251e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 325299d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 325399d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 32543aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 32558bf188aaSMichael Tokarevecho "libexecdir=$libexecdir" >> $config_host_mak 32560f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 325799d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 325899d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 325922d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 32609afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 32619afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 3262785c23aeSLuiz Capitulinoecho "qemu_localstatedir=$local_statedir" >> $config_host_mak 3263f354b1a1SMichael Tokarevecho "qemu_helperdir=$libexecdir" >> $config_host_mak 3264804edf29SJuan Quintela 326598ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 3266f8393946Saurel32if test "$debug_tcg" = "yes" ; then 32672358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 3268f8393946Saurel32fi 3269f3d08ee6SPaul Brookif test "$debug" = "yes" ; then 32702358a494SJuan Quintela echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak 3271f3d08ee6SPaul Brookfi 32721625af87Saliguoriif test "$strip_opt" = "yes" ; then 327352ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 32741625af87Saliguorifi 32757d13299dSbellardif test "$bigendian" = "yes" ; then 3276e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 327797a847bcSbellardfi 327867b915a5Sbellardif test "$mingw32" = "yes" ; then 327998ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 32809fe6de94SBlue Swirl rc_version=`cat $source_path/VERSION` 32819fe6de94SBlue Swirl version_major=${rc_version%%.*} 32829fe6de94SBlue Swirl rc_version=${rc_version#*.} 32839fe6de94SBlue Swirl version_minor=${rc_version%%.*} 32849fe6de94SBlue Swirl rc_version=${rc_version#*.} 32859fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 32869fe6de94SBlue Swirl version_micro=0 32879fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 32889fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 3289210fa556Spbrookelse 329035f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 3291210fa556Spbrookfi 3292128ab2ffSblueswir1 3293dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 3294dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 3295dffcb71cSMark McLoughlinfi 3296dffcb71cSMark McLoughlin 329783fb7adfSbellardif test "$darwin" = "yes" ; then 329898ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 329983fb7adfSbellardfi 3300b29fe3edSmalc 3301b29fe3edSmalcif test "$aix" = "yes" ; then 330298ec69acSJuan Quintela echo "CONFIG_AIX=y" >> $config_host_mak 3303b29fe3edSmalcfi 3304b29fe3edSmalc 3305ec530c81Sbellardif test "$solaris" = "yes" ; then 330698ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 33072358a494SJuan Quintela echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak 33080475a5caSths if test "$needs_libsunmath" = "yes" ; then 330975b5a697SJuan Quintela echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak 33100475a5caSths fi 3311ec530c81Sbellardfi 3312179cf400SAndreas Färberif test "$haiku" = "yes" ; then 3313179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 3314179cf400SAndreas Färberfi 331597a847bcSbellardif test "$static" = "yes" ; then 331698ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 331797a847bcSbellardfi 33181ba16968SStefan Weilif test "$profiler" = "yes" ; then 33192358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 332005c2a3e7Sbellardfi 3321c20709aaSbellardif test "$slirp" = "yes" ; then 332298ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 3323e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 3324f9728943SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" 3325c20709aaSbellardfi 33268a16d273Sthsif test "$vde" = "yes" ; then 332798ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 33288a16d273Sthsfi 332947e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 333047e98658SCorey Bryant echo "CONFIG_LIBCAP=y" >> $config_host_mak 333147e98658SCorey Bryantfi 33320c58ac1cSmalcfor card in $audio_card_list; do 3333bb55b712SStefan Weil def=CONFIG_`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'` 333498ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 33350c58ac1cSmalcdone 33362358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 33370c58ac1cSmalcfor drv in $audio_drv_list; do 3338bb55b712SStefan Weil def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` 333998ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 3340923e4521Smalc if test "$drv" = "fmod"; then 33417aac6cb1SJuan Quintela echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak 3342fb065187Sbellard fi 33430c58ac1cSmalcdone 334467f86e8eSJuan Quintelaif test "$audio_pt_int" = "yes" ; then 334567f86e8eSJuan Quintela echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak 334667f86e8eSJuan Quintelafi 3347d5631638Smalcif test "$audio_win_int" = "yes" ; then 3348d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 3349d5631638Smalcfi 3350eb852011SMarkus Armbrusterecho "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak 33518ff9cbf7Smalcif test "$mixemu" = "yes" ; then 335298ec69acSJuan Quintela echo "CONFIG_MIXEMU=y" >> $config_host_mak 33538ff9cbf7Smalcfi 3354821601eaSJes Sorensenif test "$vnc" = "yes" ; then 3355821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 3356821601eaSJes Sorensenfi 33578d5d2d4cSthsif test "$vnc_tls" = "yes" ; then 335898ec69acSJuan Quintela echo "CONFIG_VNC_TLS=y" >> $config_host_mak 3359525061bfSJuan Quintela echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak 33608d5d2d4cSthsfi 33612f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 336298ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 336360ddf533SJuan Quintela echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak 33642f9606b3Saliguorifi 3365821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 33662f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 33672f6f5c7aSCorentin Chary echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak 33682f6f5c7aSCorentin Charyfi 3369821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 3370efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 3371efe556adSCorentin Chary echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak 3372efe556adSCorentin Charyfi 337376655d6dSaliguoriif test "$fnmatch" = "yes" ; then 33742358a494SJuan Quintela echo "CONFIG_FNMATCH=y" >> $config_host_mak 337576655d6dSaliguorifi 3376ee682d27SStefan Weilif test "$uuid" = "yes" ; then 3377ee682d27SStefan Weil echo "CONFIG_UUID=y" >> $config_host_mak 3378ee682d27SStefan Weilfi 3379dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 3380dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 3381dce512deSChristoph Hellwigfi 3382b1a550a0Spbrookqemu_version=`head $source_path/VERSION` 338398ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 33842358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 338598ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 338698ec69acSJuan Quintelaecho "TARGET_DIRS=$target_list" >> $config_host_mak 3387a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 338898ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 3389cc8ae6deSpbrookfi 33901ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 339198ec69acSJuan Quintela echo "CONFIG_SDL=y" >> $config_host_mak 33928ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 339349ecc3faSbellardfi 339449ecc3faSbellardif test "$cocoa" = "yes" ; then 339598ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 339649ecc3faSbellardfi 33974d3b6f6eSbalrogif test "$curses" = "yes" ; then 339898ec69acSJuan Quintela echo "CONFIG_CURSES=y" >> $config_host_mak 3399ab4e5602SJan Kiszkafi 34003b3f24adSaurel32if test "$atfile" = "yes" ; then 34012358a494SJuan Quintela echo "CONFIG_ATFILE=y" >> $config_host_mak 34023b3f24adSaurel32fi 3403ebc996f3SRiku Voipioif test "$utimens" = "yes" ; then 34042358a494SJuan Quintela echo "CONFIG_UTIMENSAT=y" >> $config_host_mak 3405ebc996f3SRiku Voipiofi 3406099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 34072358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 3408099d6b0fSRiku Voipiofi 340940ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 341040ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 341140ff6d7eSKevin Wolffi 34123ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 34132358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 34143ce34dfbSvibisreenivasanfi 3415c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 3416c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 3417c2882b96SRiku Voipiofi 3418d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 3419d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 3420d0927938SUlrich Hechtfi 3421c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 3422c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 3423c727f47dSPeter Maydellfi 3424dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 3425dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 3426dace20dcSPeter Maydellfi 3427d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 3428d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 3429d0927938SUlrich Hechtfi 34303b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 34313b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 34323b6edd16SPeter Maydellfi 34333b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 34343b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 34353b6edd16SPeter Maydellfi 34363b6edd16SPeter Maydellif test "$epoll_pwait" = "yes" ; then 34373b6edd16SPeter Maydell echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak 34383b6edd16SPeter Maydellfi 34393b3f24adSaurel32if test "$inotify" = "yes" ; then 34402358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 34413b3f24adSaurel32fi 3442c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 3443c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 3444c05c7a73SRiku Voipiofi 34456ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 34466ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 34476ae9a1f4SJuan Quintelafi 34486ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 34496ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 34506ae9a1f4SJuan Quintelafi 3451769ce76dSAlexander Grafif test "$curl" = "yes" ; then 345298ec69acSJuan Quintela echo "CONFIG_CURL=y" >> $config_host_mak 3453b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 3454769ce76dSAlexander Graffi 34552e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 345698ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 34572e4d9fb1Saurel32fi 3458fb599c9aSbalrogif test "$bluez" = "yes" ; then 345998ec69acSJuan Quintela echo "CONFIG_BLUEZ=y" >> $config_host_mak 3460ef7635ecSJuan Quintela echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak 3461fb599c9aSbalrogfi 3462e18df141SAnthony Liguoriecho "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 3463e37630caSaliguoriif test "$xen" = "yes" ; then 34646dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 3465d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 3466e37630caSaliguorifi 34675c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 34685c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 34695c6c3a6cSChristoph Hellwigfi 3470758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 3471758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 3472758e8e38SVenkateswararao Jujjuri (JV)fi 34734f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 34744f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 34754f26f2b6SAvi Kivityfi 3476983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 3477758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 3478758e8e38SVenkateswararao Jujjuri (JV)fi 347977755340Sthsif test "$blobs" = "yes" ; then 348098ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 348177755340Sthsfi 3482bf9298b9Saliguoriif test "$iovec" = "yes" ; then 34832358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 3484bf9298b9Saliguorifi 3485ceb42de8Saliguoriif test "$preadv" = "yes" ; then 34862358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 3487ceb42de8Saliguorifi 3488f652e6afSaurel32if test "$fdt" = "yes" ; then 34893f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 3490f652e6afSaurel32fi 3491dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 3492dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 3493dcc38d1cSMarcelo Tosattifi 34949195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 34959195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 34969195b2c2SStefan Weilfi 34975f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 34985f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 34995f6b9e8fSBlue Swirlfi 3500e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 3501e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 3502e78815a5SAndreas Färberfi 3503e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 3504e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 3505e78815a5SAndreas Färberfi 35061e9737daSRichard Hendersonif test "$sigev_thread_id" = "yes" ; then 35071e9737daSRichard Henderson echo "CONFIG_SIGEV_THREAD_ID=y" >> $config_host_mak 35081e9737daSRichard Hendersonfi 350997a847bcSbellard 3510cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 3511cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 3512cd4ec0b4SGerd Hoffmannfi 3513cd4ec0b4SGerd Hoffmann 351436707144SAlon Levyif test "$smartcard" = "yes" ; then 351536707144SAlon Levy echo "CONFIG_SMARTCARD=y" >> $config_host_mak 351636707144SAlon Levyfi 351736707144SAlon Levy 3518111a38b0SRobert Relyeaif test "$smartcard_nss" = "yes" ; then 3519111a38b0SRobert Relyea echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak 3520ad4cf3f6SPaul Brook echo "libcacard_libs=$libcacard_libs" >> $config_host_mak 3521ad4cf3f6SPaul Brook echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak 3522111a38b0SRobert Relyeafi 3523111a38b0SRobert Relyea 352469354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 352569354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 352669354a83SHans de Goedefi 352769354a83SHans de Goede 352820ff075bSMichael Walleif test "$opengl" = "yes" ; then 352920ff075bSMichael Walle echo "CONFIG_OPENGL=y" >> $config_host_mak 353020ff075bSMichael Wallefi 353120ff075bSMichael Walle 3532c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 3533c589b249SRonnie Sahlberg echo "CONFIG_LIBISCSI=y" >> $config_host_mak 3534c589b249SRonnie Sahlbergfi 3535c589b249SRonnie Sahlberg 3536f794573eSEduardo Otuboif test "$seccomp" = "yes"; then 3537f794573eSEduardo Otubo echo "CONFIG_SECCOMP=y" >> $config_host_mak 3538f794573eSEduardo Otubofi 3539f794573eSEduardo Otubo 354083fb7adfSbellard# XXX: suppress that 35417d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 35422358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 35437d3505c5Sbellardfi 35447d3505c5Sbellard 35452358a494SJuan Quintelaecho "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak 3546c5937220Spbrook 354720ff6c80SAnthony Liguoriif test "$zero_malloc" = "yes" ; then 354820ff6c80SAnthony Liguori echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak 354920ff6c80SAnthony Liguorifi 3550f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 3551f27aaf4bSChristian Brunner echo "CONFIG_RBD=y" >> $config_host_mak 3552f27aaf4bSChristian Brunnerfi 355320ff6c80SAnthony Liguori 3554519175a2SAlex Barceloif test "$coroutine_backend" = "ucontext" ; then 3555d0e2fce5SAneesh Kumar K.V echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak 3556fe91bfa8SAlex Barceloelif test "$coroutine_backend" = "sigaltstack" ; then 3557fe91bfa8SAlex Barcelo echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak 3558d0e2fce5SAneesh Kumar K.Vfi 3559d0e2fce5SAneesh Kumar K.V 3560d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 3561d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 3562d2042378SAneesh Kumar K.Vfi 3563d2042378SAneesh Kumar K.V 3564e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 3565e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 3566e06a765eSHarsh Prateek Borafi 3567e06a765eSHarsh Prateek Bora 356806d71fa1SPeter Maydellif test "$pragma_disable_unused_but_set" = "yes" ; then 356906d71fa1SPeter Maydell echo "CONFIG_PRAGMA_DISABLE_UNUSED_BUT_SET=y" >> $config_host_mak 357006d71fa1SPeter Maydellfi 357106d71fa1SPeter Maydell 35723f4349dcSKevin Wolfif test "$valgrind_h" = "yes" ; then 35733f4349dcSKevin Wolf echo "CONFIG_VALGRIND_H=y" >> $config_host_mak 35743f4349dcSKevin Wolffi 35753f4349dcSKevin Wolf 35768ab1bf12SLuiz Capitulinoif test "$has_environ" = "yes" ; then 35778ab1bf12SLuiz Capitulino echo "CONFIG_HAS_ENVIRON=y" >> $config_host_mak 35788ab1bf12SLuiz Capitulinofi 35798ab1bf12SLuiz Capitulino 3580eb100396SBharata B Raoif test "$glusterfs" = "yes" ; then 3581eb100396SBharata B Rao echo "CONFIG_GLUSTERFS=y" >> $config_host_mak 3582eb100396SBharata B Raofi 3583eb100396SBharata B Rao 358468063649Sblueswir1# USB host support 358568063649Sblueswir1case "$usb" in 358668063649Sblueswir1linux) 358798ec69acSJuan Quintela echo "HOST_USB=linux" >> $config_host_mak 358868063649Sblueswir1;; 358968063649Sblueswir1bsd) 359098ec69acSJuan Quintela echo "HOST_USB=bsd" >> $config_host_mak 359168063649Sblueswir1;; 359268063649Sblueswir1*) 359398ec69acSJuan Quintela echo "HOST_USB=stub" >> $config_host_mak 359468063649Sblueswir1;; 359568063649Sblueswir1esac 359668063649Sblueswir1 3597e4858974SLluís# use default implementation for tracing backend-specific routines 3598e4858974SLluístrace_default=yes 359994a420b1SStefan Hajnocziecho "TRACE_BACKEND=$trace_backend" >> $config_host_mak 36006d8a764eSLluísif test "$trace_backend" = "nop"; then 36016d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 360222890ab5SPrerna Saxenafi 36039410b56cSPrerna Saxenaif test "$trace_backend" = "simple"; then 36046d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 3605e4858974SLluís trace_default=no 36066d8a764eSLluís # Set the appropriate trace file. 3607953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 36089410b56cSPrerna Saxenafi 36096d8a764eSLluísif test "$trace_backend" = "stderr"; then 36106d8a764eSLluís echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak 36119a82b6a5SLluís trace_default=no 36126d8a764eSLluísfi 36136d8a764eSLluísif test "$trace_backend" = "ust"; then 36146d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 36156d8a764eSLluísfi 36166d8a764eSLluísif test "$trace_backend" = "dtrace"; then 36176d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 36186d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 36196d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 36206d8a764eSLluís fi 3621c276b17dSDaniel P. Berrangefi 36229410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 3623e4858974SLluísif test "$trace_default" = "yes"; then 3624e4858974SLluís echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak 3625e4858974SLluísfi 36269410b56cSPrerna Saxena 362798ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 362898ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 3629804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 3630804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 36311901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 36321901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 36331901cb14SBradecho "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 3634c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 3635804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 36362b2e59e6SPaolo Bonziniecho "CC_I386=$cc_i386" >> $config_host_mak 3637804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 36383c4a4d0dSPeter Maydellecho "OBJCC=$objcc" >> $config_host_mak 3639804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 3640804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 3641804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 36429fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 364344dc0ca3SAlon Levyecho "LIBTOOL=$libtool" >> $config_host_mak 3644e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 3645a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 3646f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 3647e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 3648e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 3649e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 3650e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 3651e39f0062SPaolo Bonzinifi 365242da6041SGerd Hoffmannif test "$cross_prefix" != ""; then 365342da6041SGerd Hoffmann echo "AUTOCONF_HOST := --host=${cross_prefix%-}" >> $config_host_mak 365442da6041SGerd Hoffmannelse 365542da6041SGerd Hoffmann echo "AUTOCONF_HOST := " >> $config_host_mak 365642da6041SGerd Hoffmannfi 3657e2a2ed06SJuan Quintelaecho "LDFLAGS=$LDFLAGS" >> $config_host_mak 3658a36abbbbSJuan Quintelaecho "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak 3659a36abbbbSJuan Quintelaecho "ARLIBS_END=$arlibs_end" >> $config_host_mak 366073da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 36613e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 3662804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 3663957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 366494dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 3665804edf29SJuan Quintela 36664bf6b55bSJuan Quintela# generate list of library paths for linker script 36674bf6b55bSJuan Quintela 36684bf6b55bSJuan Quintela$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld} 36694bf6b55bSJuan Quintela 36704bf6b55bSJuan Quintelaif test -f ${config_host_ld}~ ; then 36714bf6b55bSJuan Quintela if cmp -s $config_host_ld ${config_host_ld}~ ; then 36724bf6b55bSJuan Quintela mv ${config_host_ld}~ $config_host_ld 36734bf6b55bSJuan Quintela else 36744bf6b55bSJuan Quintela rm ${config_host_ld}~ 36754bf6b55bSJuan Quintela fi 36764bf6b55bSJuan Quintelafi 36774bf6b55bSJuan Quintela 36784d904533SBlue Swirlfor d in libdis libdis-user; do 367972b8b5a1SStefan Weil symlink "$source_path/Makefile.dis" "$d/Makefile" 36804d904533SBlue Swirl echo > $d/config.mak 36814d904533SBlue Swirldone 36824d904533SBlue Swirl 36836efd7517SPeter Maydell# use included Linux headers 36846efd7517SPeter Maydellif test "$linux" = "yes" ; then 3685a307beb6SAndreas Färber mkdir -p linux-headers 36866efd7517SPeter Maydell case "$cpu" in 36876efd7517SPeter Maydell i386|x86_64) 368808312a63SPeter Maydell linux_arch=x86 36896efd7517SPeter Maydell ;; 36906efd7517SPeter Maydell ppcemb|ppc|ppc64) 369108312a63SPeter Maydell linux_arch=powerpc 36926efd7517SPeter Maydell ;; 36936efd7517SPeter Maydell s390x) 369408312a63SPeter Maydell linux_arch=s390 369508312a63SPeter Maydell ;; 369608312a63SPeter Maydell *) 369708312a63SPeter Maydell # For most CPUs the kernel architecture name and QEMU CPU name match. 369808312a63SPeter Maydell linux_arch="$cpu" 36996efd7517SPeter Maydell ;; 37006efd7517SPeter Maydell esac 370108312a63SPeter Maydell # For non-KVM architectures we will not have asm headers 370208312a63SPeter Maydell if [ -e "$source_path/linux-headers/asm-$linux_arch" ]; then 370308312a63SPeter Maydell symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm 370408312a63SPeter Maydell fi 37056efd7517SPeter Maydellfi 37066efd7517SPeter Maydell 370797a847bcSbellardfor target in $target_list; do 370897a847bcSbellardtarget_dir="$target" 370925be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 3710600309b6SBlue Swirltarget_arch2=`echo $target | cut -d '-' -f 1` 371197a847bcSbellardtarget_bigendian="no" 37121f3d3c8fSJuan Quintela 3713ea2d6a39SJuan Quintelacase "$target_arch2" in 3714e67db06eSJia Liu armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 3715ea2d6a39SJuan Quintela target_bigendian=yes 3716ea2d6a39SJuan Quintela ;; 3717ea2d6a39SJuan Quintelaesac 371897a847bcSbellardtarget_softmmu="no" 3719997344f3Sbellardtarget_user_only="no" 3720831b7825Sthstarget_linux_user="no" 372184778508Sblueswir1target_bsd_user="no" 37229e407a85Spbrookcase "$target" in 3723600309b6SBlue Swirl ${target_arch2}-softmmu) 37249e407a85Spbrook target_softmmu="yes" 37259e407a85Spbrook ;; 3726600309b6SBlue Swirl ${target_arch2}-linux-user) 37279c7a4202SBlue Swirl if test "$linux" != "yes" ; then 37289c7a4202SBlue Swirl echo "ERROR: Target '$target' is only available on a Linux host" 37299c7a4202SBlue Swirl exit 1 37309c7a4202SBlue Swirl fi 37319e407a85Spbrook target_user_only="yes" 37329e407a85Spbrook target_linux_user="yes" 37339e407a85Spbrook ;; 3734600309b6SBlue Swirl ${target_arch2}-bsd-user) 37359cf55765SBlue Swirl if test "$bsd" != "yes" ; then 37369c7a4202SBlue Swirl echo "ERROR: Target '$target' is only available on a BSD host" 37379c7a4202SBlue Swirl exit 1 37389c7a4202SBlue Swirl fi 373984778508Sblueswir1 target_user_only="yes" 374084778508Sblueswir1 target_bsd_user="yes" 374184778508Sblueswir1 ;; 37429e407a85Spbrook *) 37439e407a85Spbrook echo "ERROR: Target '$target' not recognised" 37449e407a85Spbrook exit 1 37459e407a85Spbrook ;; 37469e407a85Spbrookesac 3747831b7825Sths 374897a847bcSbellardmkdir -p $target_dir 374925be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 375097a847bcSbellard 3751e5fe0c52Spbrookbflt="no" 3752bd0c5661Spbrooktarget_nptl="no" 3753600309b6SBlue Swirlinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` 375456aebc89Spbrookgdb_xml_files="" 3755c2e3dee6SLaurent Viviertarget_short_alignment=2 3756c2e3dee6SLaurent Viviertarget_int_alignment=4 3757c2e3dee6SLaurent Viviertarget_long_alignment=4 3758c2e3dee6SLaurent Viviertarget_llong_alignment=8 3759de3a354aSMichael Walletarget_libs_softmmu= 37607ba1e619Saliguori 3761938b1eddSJuan QuintelaTARGET_ARCH="$target_arch2" 37626acff7daSJuan QuintelaTARGET_BASE_ARCH="" 3763e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 3764e73aae67SJuan Quintela 3765600309b6SBlue Swirlcase "$target_arch2" in 37662408a527Saurel32 i386) 37672408a527Saurel32 ;; 37682408a527Saurel32 x86_64) 37696acff7daSJuan Quintela TARGET_BASE_ARCH=i386 3770c2e3dee6SLaurent Vivier target_long_alignment=8 37712408a527Saurel32 ;; 37722408a527Saurel32 alpha) 3773c2e3dee6SLaurent Vivier target_long_alignment=8 3774a4b388ffSRichard Henderson target_nptl="yes" 37752408a527Saurel32 ;; 37762408a527Saurel32 arm|armeb) 3777b498c8a0SJuan Quintela TARGET_ARCH=arm 3778e5fe0c52Spbrook bflt="yes" 3779bd0c5661Spbrook target_nptl="yes" 378056aebc89Spbrook gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" 3781c2e3dee6SLaurent Vivier target_llong_alignment=4 3782412beee6SGrant Likely target_libs_softmmu="$fdt_libs" 37832408a527Saurel32 ;; 37842408a527Saurel32 cris) 3785253bd7f8Sedgar_igl target_nptl="yes" 37862408a527Saurel32 ;; 3787613a22c9SMichael Walle lm32) 3788de3a354aSMichael Walle target_libs_softmmu="$opengl_libs" 3789613a22c9SMichael Walle ;; 37902408a527Saurel32 m68k) 37910938cda5Saurel32 bflt="yes" 379256aebc89Spbrook gdb_xml_files="cf-core.xml cf-fp.xml" 3793c2e3dee6SLaurent Vivier target_int_alignment=2 3794c2e3dee6SLaurent Vivier target_long_alignment=2 3795c2e3dee6SLaurent Vivier target_llong_alignment=2 37962408a527Saurel32 ;; 3797877fdc12SEdgar E. Iglesias microblaze|microblazeel) 3798877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 379972b675caSEdgar E. Iglesias bflt="yes" 380072b675caSEdgar E. Iglesias target_nptl="yes" 3801de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 380272b675caSEdgar E. Iglesias ;; 38032408a527Saurel32 mips|mipsel) 3804b498c8a0SJuan Quintela TARGET_ARCH=mips 380525be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 3806f04dc72fSPaul Brook target_nptl="yes" 38072408a527Saurel32 ;; 38082408a527Saurel32 mipsn32|mipsn32el) 3809b498c8a0SJuan Quintela TARGET_ARCH=mipsn32 38106acff7daSJuan Quintela TARGET_BASE_ARCH=mips 381125be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 38122408a527Saurel32 ;; 38132408a527Saurel32 mips64|mips64el) 3814b498c8a0SJuan Quintela TARGET_ARCH=mips64 38156acff7daSJuan Quintela TARGET_BASE_ARCH=mips 381625be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 3817c2e3dee6SLaurent Vivier target_long_alignment=8 38182408a527Saurel32 ;; 3819e67db06eSJia Liu or32) 3820e67db06eSJia Liu TARGET_ARCH=openrisc 3821e67db06eSJia Liu TARGET_BASE_ARCH=openrisc 3822e67db06eSJia Liu ;; 38232408a527Saurel32 ppc) 3824c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 3825d6630708SNathan Froyd target_nptl="yes" 3826de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 38272408a527Saurel32 ;; 38282408a527Saurel32 ppcemb) 38296acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3830e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 3831c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 3832d6630708SNathan Froyd target_nptl="yes" 3833de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 38342408a527Saurel32 ;; 38352408a527Saurel32 ppc64) 38366acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3837e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 3838c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 3839c2e3dee6SLaurent Vivier target_long_alignment=8 3840de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 38412408a527Saurel32 ;; 38422408a527Saurel32 ppc64abi32) 3843b498c8a0SJuan Quintela TARGET_ARCH=ppc64 38446acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3845e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 384625be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 3847c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 3848de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 38492408a527Saurel32 ;; 38502408a527Saurel32 sh4|sh4eb) 3851b498c8a0SJuan Quintela TARGET_ARCH=sh4 38524dbed897Spbrook bflt="yes" 38530b6d3ae0Saurel32 target_nptl="yes" 38542408a527Saurel32 ;; 38552408a527Saurel32 sparc) 38562408a527Saurel32 ;; 38572408a527Saurel32 sparc64) 38586acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 3859c2e3dee6SLaurent Vivier target_long_alignment=8 38602408a527Saurel32 ;; 38612408a527Saurel32 sparc32plus) 3862b498c8a0SJuan Quintela TARGET_ARCH=sparc64 38636acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 3864e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 386525be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 38662408a527Saurel32 ;; 386724e804ecSAlexander Graf s390x) 3868bc434676SUlrich Hecht target_nptl="yes" 38697b3da903SAlexander Graf target_long_alignment=8 387024e804ecSAlexander Graf ;; 3871d2fbca94SGuan Xuetao unicore32) 3872d2fbca94SGuan Xuetao ;; 3873cfa550c6SMax Filippov xtensa|xtensaeb) 3874cfa550c6SMax Filippov TARGET_ARCH=xtensa 3875cfa550c6SMax Filippov ;; 38762408a527Saurel32 *) 3877de83cd02Sbellard echo "Unsupported target CPU" 3878de83cd02Sbellard exit 1 38792408a527Saurel32 ;; 38802408a527Saurel32esac 38815e8861a0SPaolo Bonzini# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 38825e8861a0SPaolo Bonziniif [ "$TARGET_BASE_ARCH" = "" ]; then 38835e8861a0SPaolo Bonzini TARGET_BASE_ARCH=$TARGET_ARCH 38845e8861a0SPaolo Bonzinifi 38855e8861a0SPaolo Bonzini 38865e8861a0SPaolo Bonzinisymlink "$source_path/Makefile.target" "$target_dir/Makefile" 38875e8861a0SPaolo Bonzini 388899afc91dSDaniel P. Berrangeupper() { 388999afc91dSDaniel P. Berrange echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' 389099afc91dSDaniel P. Berrange} 389199afc91dSDaniel P. Berrange 389232761257SYeongkyoon Leecase "$cpu" in 3893ed224a56Smalc i386|x86_64|ppc) 389432761257SYeongkyoon Lee echo "CONFIG_QEMU_LDST_OPTIMIZATION=y" >> $config_target_mak 389532761257SYeongkyoon Lee ;; 389632761257SYeongkyoon Leeesac 389732761257SYeongkyoon Lee 3898c2e3dee6SLaurent Vivierecho "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak 3899c2e3dee6SLaurent Vivierecho "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak 3900c2e3dee6SLaurent Vivierecho "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak 3901c2e3dee6SLaurent Vivierecho "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak 390225be210fSJuan Quintelaecho "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak 390399afc91dSDaniel P. Berrangetarget_arch_name="`upper $TARGET_ARCH`" 390425be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 390525be210fSJuan Quintelaecho "TARGET_ARCH2=$target_arch2" >> $config_target_mak 390699afc91dSDaniel P. Berrangeecho "TARGET_TYPE=TARGET_TYPE_`upper $target_arch2`" >> $config_target_mak 390725be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 3908e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 3909e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 3910e6e91b9cSJuan Quintelafi 391125be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 39121b0c87fcSJuan Quintelacase "$target_arch2" in 39131b0c87fcSJuan Quintela i386|x86_64) 39141b0c87fcSJuan Quintela if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then 391525be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 3916eb6fda0fSAnthony PERARD if test "$xen_pci_passthrough" = yes; then 3917eb6fda0fSAnthony PERARD echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" 3918eb6fda0fSAnthony PERARD fi 391959d21e53SAlexander Graf else 392059d21e53SAlexander Graf echo "CONFIG_NO_XEN=y" >> $config_target_mak 3921432d268cSJun Nakajima fi 392259d21e53SAlexander Graf ;; 392359d21e53SAlexander Graf *) 392459d21e53SAlexander Graf echo "CONFIG_NO_XEN=y" >> $config_target_mak 39251b0c87fcSJuan Quintelaesac 3926c59249f9SJuan Quintelacase "$target_arch2" in 39270e60a699SAlexander Graf i386|x86_64|ppcemb|ppc|ppc64|s390x) 3928c59249f9SJuan Quintela # Make sure the target and host cpus are compatible 3929c59249f9SJuan Quintela if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ 3930c59249f9SJuan Quintela \( "$target_arch2" = "$cpu" -o \ 3931c59249f9SJuan Quintela \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ 39325f114bc6SAlexander Graf \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ 3933adf82011SRené Rebe \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \ 3934adf82011SRené Rebe \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ 3935c59249f9SJuan Quintela \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ 3936c59249f9SJuan Quintela \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then 393725be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 39381ba16968SStefan Weil if test "$vhost_net" = "yes" ; then 3939d5970055SMichael S. Tsirkin echo "CONFIG_VHOST_NET=y" >> $config_target_mak 3940d5970055SMichael S. Tsirkin fi 3941c59249f9SJuan Quintela fi 3942c59249f9SJuan Quintelaesac 3943fae001f5SWen Congyangcase "$target_arch2" in 3944fae001f5SWen Congyang i386|x86_64) 3945fae001f5SWen Congyang echo "CONFIG_HAVE_GET_MEMORY_MAPPING=y" >> $config_target_mak 3946fae001f5SWen Congyangesac 39477f762366SBlue Swirlif test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then 39480a6b8ddeSAlexander Graf echo "CONFIG_PSERIES=y" >> $config_target_mak 39490a6b8ddeSAlexander Graffi 3950de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 395125be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 395297a847bcSbellardfi 395397a847bcSbellardif test "$target_softmmu" = "yes" ; then 395425be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 3955de3a354aSMichael Walle echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak 3956ad4cf3f6SPaul Brook if test "$smartcard_nss" = "yes" ; then 3957ad4cf3f6SPaul Brook echo "subdir-$target: subdir-libcacard" >> $config_host_mak 3958ad4cf3f6SPaul Brook fi 39599fecbed0SWen Congyang case "$target_arch2" in 39609fecbed0SWen Congyang i386|x86_64) 39619fecbed0SWen Congyang echo "CONFIG_HAVE_CORE_DUMP=y" >> $config_target_mak 39629fecbed0SWen Congyang esac 3963de83cd02Sbellardfi 3964997344f3Sbellardif test "$target_user_only" = "yes" ; then 396525be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 3966a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 3967997344f3Sbellardfi 3968831b7825Sthsif test "$target_linux_user" = "yes" ; then 396925be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 3970831b7825Sthsfi 397156aebc89Spbrooklist="" 397256aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 397356aebc89Spbrook for x in $gdb_xml_files; do 397456aebc89Spbrook list="$list $source_path/gdb-xml/$x" 397556aebc89Spbrook done 397625be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 39773d0f1517SJuan Quintelafi 3978de83cd02Sbellard 3979e5fe0c52Spbrookif test "$target_user_only" = "yes" -a "$bflt" = "yes"; then 398025be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 3981e5fe0c52Spbrookfi 3982bd0c5661Spbrookif test "$target_user_only" = "yes" \ 3983bd0c5661Spbrook -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then 398425be210fSJuan Quintela echo "CONFIG_USE_NPTL=y" >> $config_target_mak 3985bd0c5661Spbrookfi 3986379f6698SPaul Brookif test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then 398725be210fSJuan Quintela echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak 3988379f6698SPaul Brookfi 398984778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 399025be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 399184778508Sblueswir1fi 39925b0753e0Sbellard 39935a4d701aSJan Kiszka# the static way of configuring available audio cards requires this workaround 39945a4d701aSJan Kiszkaif test "$target_user_only" != "yes" && grep -q CONFIG_PCSPK $source_path/default-configs/$target.mak; then 39955a4d701aSJan Kiszka echo "CONFIG_PCSPK=y" >> $config_target_mak 39965a4d701aSJan Kiszkafi 39975a4d701aSJan Kiszka 39984afddb55SJuan Quintela# generate QEMU_CFLAGS/LDFLAGS for targets 3999fa282484SJuan Quintela 40004afddb55SJuan Quintelacflags="" 4001f9728943SPaolo Bonziniincludes="" 4002fa282484SJuan Quintelaldflags="" 40039b8e111fSJuan Quintela 40049195b2c2SStefan Weilif test "$tcg_interpreter" = "yes"; then 40059195b2c2SStefan Weil includes="-I\$(SRC_PATH)/tcg/tci $includes" 40069195b2c2SStefan Weilelif test "$ARCH" = "sparc64" ; then 4007f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/sparc $includes" 400824e804ecSAlexander Grafelif test "$ARCH" = "s390x" ; then 4009f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/s390 $includes" 40105d8a4f8fSRichard Hendersonelif test "$ARCH" = "x86_64" ; then 4011f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/i386 $includes" 401257ddfbf7SJuan Quintelaelse 4013f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes" 401457ddfbf7SJuan Quintelafi 4015f9728943SPaolo Bonziniincludes="-I\$(SRC_PATH)/tcg $includes" 401657ddfbf7SJuan Quintela 40176efd7517SPeter Maydellif test "$linux" = "yes" ; then 40186efd7517SPeter Maydell includes="-I\$(SRC_PATH)/linux-headers $includes" 40196efd7517SPeter Maydellfi 40206efd7517SPeter Maydell 40214d904533SBlue Swirlif test "$target_user_only" = "yes" ; then 40224d904533SBlue Swirl libdis_config_mak=libdis-user/config.mak 40234d904533SBlue Swirlelse 40244d904533SBlue Swirl libdis_config_mak=libdis/config.mak 40254d904533SBlue Swirlfi 40264d904533SBlue Swirl 402764656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 402864656024SJuan Quintela case "$i" in 402964656024SJuan Quintela alpha) 403025be210fSJuan Quintela echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak 40314d904533SBlue Swirl echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak 403264656024SJuan Quintela ;; 403364656024SJuan Quintela arm) 403425be210fSJuan Quintela echo "CONFIG_ARM_DIS=y" >> $config_target_mak 40354d904533SBlue Swirl echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak 403664656024SJuan Quintela ;; 403764656024SJuan Quintela cris) 403825be210fSJuan Quintela echo "CONFIG_CRIS_DIS=y" >> $config_target_mak 40394d904533SBlue Swirl echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak 404064656024SJuan Quintela ;; 404164656024SJuan Quintela hppa) 404225be210fSJuan Quintela echo "CONFIG_HPPA_DIS=y" >> $config_target_mak 40434d904533SBlue Swirl echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak 404464656024SJuan Quintela ;; 404564656024SJuan Quintela i386|x86_64) 404625be210fSJuan Quintela echo "CONFIG_I386_DIS=y" >> $config_target_mak 40474d904533SBlue Swirl echo "CONFIG_I386_DIS=y" >> $libdis_config_mak 404864656024SJuan Quintela ;; 4049903ec55cSAurelien Jarno ia64*) 4050903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $config_target_mak 4051903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak 4052903ec55cSAurelien Jarno ;; 405379368f49SMichael Walle lm32) 405479368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $config_target_mak 405579368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak 405679368f49SMichael Walle ;; 405764656024SJuan Quintela m68k) 405825be210fSJuan Quintela echo "CONFIG_M68K_DIS=y" >> $config_target_mak 40594d904533SBlue Swirl echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak 406064656024SJuan Quintela ;; 4061877fdc12SEdgar E. Iglesias microblaze*) 406225be210fSJuan Quintela echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak 40634d904533SBlue Swirl echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak 406464656024SJuan Quintela ;; 406564656024SJuan Quintela mips*) 406625be210fSJuan Quintela echo "CONFIG_MIPS_DIS=y" >> $config_target_mak 40674d904533SBlue Swirl echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak 406864656024SJuan Quintela ;; 4069e67db06eSJia Liu or32) 4070e67db06eSJia Liu echo "CONFIG_OPENRISC_DIS=y" >> $config_target_mak 4071e67db06eSJia Liu echo "CONFIG_OPENRISC_DIS=y" >> $libdis_config_mak 4072e67db06eSJia Liu ;; 407364656024SJuan Quintela ppc*) 407425be210fSJuan Quintela echo "CONFIG_PPC_DIS=y" >> $config_target_mak 40754d904533SBlue Swirl echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak 407664656024SJuan Quintela ;; 407724e804ecSAlexander Graf s390*) 407825be210fSJuan Quintela echo "CONFIG_S390_DIS=y" >> $config_target_mak 40794d904533SBlue Swirl echo "CONFIG_S390_DIS=y" >> $libdis_config_mak 408064656024SJuan Quintela ;; 408164656024SJuan Quintela sh4) 408225be210fSJuan Quintela echo "CONFIG_SH4_DIS=y" >> $config_target_mak 40834d904533SBlue Swirl echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak 408464656024SJuan Quintela ;; 408564656024SJuan Quintela sparc*) 408625be210fSJuan Quintela echo "CONFIG_SPARC_DIS=y" >> $config_target_mak 40874d904533SBlue Swirl echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak 408864656024SJuan Quintela ;; 4089cfa550c6SMax Filippov xtensa*) 4090cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak 4091cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $libdis_config_mak 4092cfa550c6SMax Filippov ;; 409364656024SJuan Quintela esac 409464656024SJuan Quinteladone 40959195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 40969195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $config_target_mak 40979195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $libdis_config_mak 40989195b2c2SStefan Weilfi 409964656024SJuan Quintela 41006ee7126fSJuan Quintelacase "$ARCH" in 41016ee7126fSJuan Quintelaalpha) 41026ee7126fSJuan Quintela # Ensure there's only a single GP 41036ee7126fSJuan Quintela cflags="-msmall-data $cflags" 41046ee7126fSJuan Quintela;; 41056ee7126fSJuan Quintelaesac 41066ee7126fSJuan Quintela 410755d9c04bSJuan Quintelaif test "$target_softmmu" = "yes" ; then 410855d9c04bSJuan Quintela case "$TARGET_BASE_ARCH" in 410955d9c04bSJuan Quintela arm) 411055d9c04bSJuan Quintela cflags="-DHAS_AUDIO $cflags" 411155d9c04bSJuan Quintela ;; 411225a8bb96SMichael Walle lm32) 411325a8bb96SMichael Walle cflags="-DHAS_AUDIO $cflags" 411425a8bb96SMichael Walle ;; 411555d9c04bSJuan Quintela i386|mips|ppc) 411655d9c04bSJuan Quintela cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" 411755d9c04bSJuan Quintela ;; 411855d9c04bSJuan Quintela esac 411955d9c04bSJuan Quintelafi 412055d9c04bSJuan Quintela 4121d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 412225be210fSJuan Quintela echo "TARGET_GPROF=yes" >> $config_target_mak 4123d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 4124d02c1db3SJuan Quintela cflags="-p $cflags" 4125d02c1db3SJuan Quintela ldflags="-p $ldflags" 4126d02c1db3SJuan Quintela fi 4127d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 4128d02c1db3SJuan Quintela ldflags="-p $ldflags" 412925be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 4130d02c1db3SJuan Quintela fi 4131d02c1db3SJuan Quintelafi 4132d02c1db3SJuan Quintela 41339195b2c2SStefan Weilif test "$ARCH" = "tci"; then 41349195b2c2SStefan Weil linker_script="" 41359195b2c2SStefan Weilelse 41366ee7126fSJuan Quintela linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld" 41379195b2c2SStefan Weilfi 41389195b2c2SStefan Weil 41399b8e111fSJuan Quintelaif test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then 4140fa282484SJuan Quintela case "$ARCH" in 41414d58be06SRichard Henderson alpha | s390x) 41424d58be06SRichard Henderson # The default placement of the application is fine. 41434d58be06SRichard Henderson ;; 4144fd76e73aSRichard Henderson *) 4145322e5878SJuan Quintela ldflags="$linker_script $ldflags" 4146fa282484SJuan Quintela ;; 4147fa282484SJuan Quintela esac 4148fa282484SJuan Quintelafi 4149fa282484SJuan Quintela 415025be210fSJuan Quintelaecho "LDFLAGS+=$ldflags" >> $config_target_mak 415125be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 4152f9728943SPaolo Bonziniecho "QEMU_INCLUDES+=$includes" >> $config_target_mak 4153fa282484SJuan Quintela 415497a847bcSbellarddone # for target in $targets 41557d13299dSbellard 4156b776eca1SGerd Hoffmannif [ "$pixman" = "internal" ]; then 4157b776eca1SGerd Hoffmann echo "config-host.h: subdir-pixman" >> $config_host_mak 4158b776eca1SGerd Hoffmannfi 4159b776eca1SGerd Hoffmann 4160d1807a4fSPaolo Bonzini# build tree in object directory in case the source is not in the current directory 4161927b241dSMichael WalleDIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" 41622dee8d54SPaolo BonziniDIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas" 41632d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 41642dee8d54SPaolo BonziniDIRS="$DIRS qapi-generated" 416500c705fbSPaolo BonziniDIRS="$DIRS libcacard libcacard/libcacard libcacard/trace" 4166c09015ddSAnthony LiguoriFILES="Makefile tests/tcg/Makefile qdict-test-data.txt" 4167c09015ddSAnthony LiguoriFILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" 416800c705fbSPaolo BonziniFILES="$FILES tests/tcg/lm32/Makefile libcacard/Makefile" 4169ae0bfb79SBlue SwirlFILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" 4170446b9165SAndreas FärberFILES="$FILES pc-bios/spapr-rtas/Makefile" 41712d9f27d2SAnthony LiguoriFILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" 4172753d11f2SRichard Hendersonfor bios_file in \ 4173753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 4174753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 4175753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 4176753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 4177753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 4178753d11f2SRichard Hendersondo 41797ea78b74SJan Kiszka FILES="$FILES pc-bios/`basename $bios_file`" 41807ea78b74SJan Kiszkadone 4181d1807a4fSPaolo Bonzinimkdir -p $DIRS 41827d13299dSbellardfor f in $FILES ; do 418372b8b5a1SStefan Weil if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then 4184f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 4185f9245e10SPeter Maydell fi 41867d13299dSbellarddone 41871ad2134fSPaul Brook 4188c34ebfdcSAnthony Liguori# temporary config to build submodules 41892d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 4190c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 419137116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 4192c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 4193c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 4194c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 4195c34ebfdcSAnthony Liguori echo "CPP=${cross_prefix}cpp" >> $config_mak 4196c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 4197c34ebfdcSAnthony Liguori echo "IASL=iasl" >> $config_mak 4198c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 4199c34ebfdcSAnthony Liguoridone 4200c34ebfdcSAnthony Liguori 4201add16157SBlue Swirld=libuser 420272b8b5a1SStefan Weilsymlink "$source_path/Makefile.user" "$d/Makefile" 4203b40292e7SJan Kiszka 4204b40292e7SJan Kiszkaif test "$docs" = "yes" ; then 4205b40292e7SJan Kiszka mkdir -p QMP 4206b40292e7SJan Kiszkafi 4207