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 3052166aa0SJuan Quintelacompile_object() { 31da1d85e3SGerd Hoffmann echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 32da1d85e3SGerd Hoffmann $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 2>&1 3352166aa0SJuan Quintela} 3452166aa0SJuan Quintela 3552166aa0SJuan Quintelacompile_prog() { 3652166aa0SJuan Quintela local_cflags="$1" 3752166aa0SJuan Quintela local_ldflags="$2" 38da1d85e3SGerd Hoffmann echo $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log 39da1d85e3SGerd Hoffmann $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log 2>&1 4052166aa0SJuan Quintela} 4152166aa0SJuan Quintela 4211568d6dSPaolo Bonzini# symbolically link $1 to $2. Portable version of "ln -sf". 4311568d6dSPaolo Bonzinisymlink() { 4472b8b5a1SStefan Weil rm -rf "$2" 4572b8b5a1SStefan Weil ln -s "$1" "$2" 4611568d6dSPaolo Bonzini} 4711568d6dSPaolo Bonzini 480dba6195SLoïc Minier# check whether a command is available to this shell (may be either an 490dba6195SLoïc Minier# executable or a builtin) 500dba6195SLoïc Minierhas() { 510dba6195SLoïc Minier type "$1" >/dev/null 2>&1 520dba6195SLoïc Minier} 530dba6195SLoïc Minier 540dba6195SLoïc Minier# search for an executable in PATH 550dba6195SLoïc Minierpath_of() { 560dba6195SLoïc Minier local_command="$1" 570dba6195SLoïc Minier local_ifs="$IFS" 580dba6195SLoïc Minier local_dir="" 590dba6195SLoïc Minier 600dba6195SLoïc Minier # pathname has a dir component? 610dba6195SLoïc Minier if [ "${local_command#*/}" != "$local_command" ]; then 620dba6195SLoïc Minier if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then 630dba6195SLoïc Minier echo "$local_command" 640dba6195SLoïc Minier return 0 650dba6195SLoïc Minier fi 660dba6195SLoïc Minier fi 670dba6195SLoïc Minier if [ -z "$local_command" ]; then 680dba6195SLoïc Minier return 1 690dba6195SLoïc Minier fi 700dba6195SLoïc Minier 710dba6195SLoïc Minier IFS=: 720dba6195SLoïc Minier for local_dir in $PATH; do 730dba6195SLoïc Minier if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then 740dba6195SLoïc Minier echo "$local_dir/$local_command" 750dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 760dba6195SLoïc Minier return 0 770dba6195SLoïc Minier fi 780dba6195SLoïc Minier done 790dba6195SLoïc Minier # not found 800dba6195SLoïc Minier IFS="${local_ifs:-$(printf ' \t\n')}" 810dba6195SLoïc Minier return 1 820dba6195SLoïc Minier} 830dba6195SLoïc Minier 847d13299dSbellard# default parameters 85ca4deeb1SPaolo Bonzinisource_path=`dirname "$0"` 862ff6b91eSJuan Quintelacpu="" 871e43adfcSbellardinterp_prefix="/usr/gnemul/qemu-%M" 8843ce4dfeSbellardstatic="no" 89ed968ff1SJuan Quintelasparc_cpu="" 907d13299dSbellardcross_prefix="" 910c58ac1cSmalcaudio_drv_list="" 92d61a4ce8SGerd Hoffmannaudio_card_list="ac97 es1370 sb16 hda" 93d61a4ce8SGerd Hoffmannaudio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda" 94eb852011SMarkus Armbrusterblock_drv_whitelist="" 957d13299dSbellardhost_cc="gcc" 96c81da56eSJuan Quintelahelper_cflags="" 9773da375eSJuan Quintelalibs_softmmu="" 983e2e0e6bSJuan Quintelalibs_tools="" 9967f86e8eSJuan Quintelaaudio_pt_int="" 100d5631638Smalcaudio_win_int="" 1012b2e59e6SPaolo Bonzinicc_i386=i386-pc-linux-gnu-gcc 102957f1f99SMichael Rothlibs_qga="" 1035bc62e01SGerd Hoffmanndebug_info="yes" 104ac0df51dSaliguori 105377529c0SPaolo Bonzinitarget_list="" 106377529c0SPaolo Bonzini 107377529c0SPaolo Bonzini# Default value for a variable defining feature "foo". 108377529c0SPaolo Bonzini# * foo="no" feature will only be used if --enable-foo arg is given 109377529c0SPaolo Bonzini# * foo="" feature will be searched for, and if found, will be used 110377529c0SPaolo Bonzini# unless --disable-foo is given 111377529c0SPaolo Bonzini# * foo="yes" this value will only be set by --enable-foo flag. 112377529c0SPaolo Bonzini# feature will searched for, 113377529c0SPaolo Bonzini# if not found, configure exits with error 114377529c0SPaolo Bonzini# 115377529c0SPaolo Bonzini# Always add --enable-foo and --disable-foo command line args. 116377529c0SPaolo Bonzini# Distributions want to ensure that several features are compiled in, and it 117377529c0SPaolo Bonzini# is impossible without a --enable-foo that exits if a feature is not found. 118377529c0SPaolo Bonzini 119377529c0SPaolo Bonzinibluez="" 120377529c0SPaolo Bonzinibrlapi="" 121377529c0SPaolo Bonzinicurl="" 122377529c0SPaolo Bonzinicurses="" 123377529c0SPaolo Bonzinidocs="" 124377529c0SPaolo Bonzinifdt="" 125377529c0SPaolo Bonzininptl="" 126377529c0SPaolo Bonzinisdl="" 127983eef5aSMeador Ingevirtfs="" 128821601eaSJes Sorensenvnc="yes" 129377529c0SPaolo Bonzinisparse="no" 130377529c0SPaolo Bonziniuuid="" 131377529c0SPaolo Bonzinivde="" 132377529c0SPaolo Bonzinivnc_tls="" 133377529c0SPaolo Bonzinivnc_sasl="" 134377529c0SPaolo Bonzinivnc_jpeg="" 135377529c0SPaolo Bonzinivnc_png="" 136377529c0SPaolo Bonzinivnc_thread="no" 137377529c0SPaolo Bonzinixen="" 138d5b93ddfSAnthony PERARDxen_ctrl_version="" 139377529c0SPaolo Bonzinilinux_aio="" 14047e98658SCorey Bryantcap_ng="" 141377529c0SPaolo Bonziniattr="" 1424f26f2b6SAvi Kivitylibattr="" 143377529c0SPaolo Bonzinixfs="" 144377529c0SPaolo Bonzini 145d41a75a2SBradvhost_net="no" 146d41a75a2SBradkvm="no" 147377529c0SPaolo Bonzinigprof="no" 148377529c0SPaolo Bonzinidebug_tcg="no" 149377529c0SPaolo Bonzinidebug_mon="no" 150377529c0SPaolo Bonzinidebug="no" 151377529c0SPaolo Bonzinistrip_opt="yes" 1529195b2c2SStefan Weiltcg_interpreter="no" 153377529c0SPaolo Bonzinibigendian="no" 154377529c0SPaolo Bonzinimingw32="no" 155377529c0SPaolo BonziniEXESUF="" 156377529c0SPaolo Bonziniprefix="/usr/local" 157377529c0SPaolo Bonzinimandir="\${prefix}/share/man" 158528ae5b8SEduardo Habkostdatadir="\${prefix}/share" 159850da188SEduardo Habkostqemu_docdir="\${prefix}/share/doc/qemu" 160377529c0SPaolo Bonzinibindir="\${prefix}/bin" 1613aa5d2beSAlon Levylibdir="\${prefix}/lib" 1620f94d6daSAlon Levyincludedir="\${prefix}/include" 163377529c0SPaolo Bonzinisysconfdir="\${prefix}/etc" 164377529c0SPaolo Bonziniconfsuffix="/qemu" 165377529c0SPaolo Bonzinislirp="yes" 166377529c0SPaolo Bonzinifmod_lib="" 167377529c0SPaolo Bonzinifmod_inc="" 168377529c0SPaolo Bonzinioss_lib="" 169377529c0SPaolo Bonzinibsd="no" 170377529c0SPaolo Bonzinilinux="no" 171377529c0SPaolo Bonzinisolaris="no" 172377529c0SPaolo Bonziniprofiler="no" 173377529c0SPaolo Bonzinicocoa="no" 174377529c0SPaolo Bonzinisoftmmu="yes" 175377529c0SPaolo Bonzinilinux_user="no" 176377529c0SPaolo Bonzinibsd_user="no" 177377529c0SPaolo Bonziniguest_base="" 178377529c0SPaolo Bonziniuname_release="" 179377529c0SPaolo Bonzinimixemu="no" 180377529c0SPaolo Bonziniaix="no" 181377529c0SPaolo Bonziniblobs="yes" 182377529c0SPaolo Bonzinipkgversion="" 18340d6444eSAvi Kivitypie="" 184377529c0SPaolo Bonzinizero_malloc="" 185377529c0SPaolo Bonzinitrace_backend="nop" 186377529c0SPaolo Bonzinitrace_file="trace" 187377529c0SPaolo Bonzinispice="" 188377529c0SPaolo Bonzinirbd="" 18936707144SAlon Levysmartcard="" 190111a38b0SRobert Relyeasmartcard_nss="" 19169354a83SHans de Goedeusb_redir="" 192430a3c18SMichael Walleopengl="" 1931ece9905SAlon Levyzlib="yes" 194d138cee9SMichael Rothguest_agent="yes" 195c589b249SRonnie Sahlberglibiscsi="" 196519175a2SAlex Barcelocoroutine="" 197377529c0SPaolo Bonzini 198ac0df51dSaliguori# parse CC options first 199ac0df51dSaliguorifor opt do 200ac0df51dSaliguori optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 201ac0df51dSaliguori case "$opt" in 202ac0df51dSaliguori --cross-prefix=*) cross_prefix="$optarg" 203ac0df51dSaliguori ;; 2043d8df640SPaolo Bonzini --cc=*) CC="$optarg" 205ac0df51dSaliguori ;; 206ca4deeb1SPaolo Bonzini --source-path=*) source_path="$optarg" 207ca4deeb1SPaolo Bonzini ;; 2082ff6b91eSJuan Quintela --cpu=*) cpu="$optarg" 2092ff6b91eSJuan Quintela ;; 210a558ee17SJuan Quintela --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" 211e2a2ed06SJuan Quintela ;; 212e2a2ed06SJuan Quintela --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" 213e2a2ed06SJuan Quintela ;; 2145bc62e01SGerd Hoffmann --enable-debug-info) debug_info="yes" 2155bc62e01SGerd Hoffmann ;; 2165bc62e01SGerd Hoffmann --disable-debug-info) debug_info="no" 2175bc62e01SGerd Hoffmann ;; 21850e7b1a0SJuan Quintela --sparc_cpu=*) 21950e7b1a0SJuan Quintela sparc_cpu="$optarg" 22050e7b1a0SJuan Quintela case $sparc_cpu in 221ed968ff1SJuan Quintela v7|v8|v8plus|v8plusa) 22250e7b1a0SJuan Quintela cpu="sparc" 22350e7b1a0SJuan Quintela ;; 22450e7b1a0SJuan Quintela v9) 22550e7b1a0SJuan Quintela cpu="sparc64" 22650e7b1a0SJuan Quintela ;; 22750e7b1a0SJuan Quintela *) 22850e7b1a0SJuan Quintela echo "undefined SPARC architecture. Exiting"; 22950e7b1a0SJuan Quintela exit 1 23050e7b1a0SJuan Quintela ;; 23150e7b1a0SJuan Quintela esac 23250e7b1a0SJuan Quintela ;; 233ac0df51dSaliguori esac 234ac0df51dSaliguoridone 235ac0df51dSaliguori# OS specific 236ac0df51dSaliguori# Using uname is really, really broken. Once we have the right set of checks 23793148aa5SStefan Weil# we can eliminate its usage altogether. 238ac0df51dSaliguori 239b3198cc2SStuart Yodercc="${CC-${cross_prefix}gcc}" 240b3198cc2SStuart Yoderar="${AR-${cross_prefix}ar}" 241b3198cc2SStuart Yoderobjcopy="${OBJCOPY-${cross_prefix}objcopy}" 242b3198cc2SStuart Yoderld="${LD-${cross_prefix}ld}" 2433f534581SBradlibtool="${LIBTOOL-${cross_prefix}libtool}" 244b3198cc2SStuart Yoderstrip="${STRIP-${cross_prefix}strip}" 245b3198cc2SStuart Yoderwindres="${WINDRES-${cross_prefix}windres}" 24617884d7bSSergei Trofimovichpkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}" 24717884d7bSSergei Trofimovichquery_pkg_config() { 24817884d7bSSergei Trofimovich "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@" 24917884d7bSSergei Trofimovich} 25017884d7bSSergei Trofimovichpkg_config=query_pkg_config 251b3198cc2SStuart Yodersdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" 252ac0df51dSaliguori 253be17dc90SMichael S. Tsirkin# default flags for all hosts 254be17dc90SMichael S. TsirkinQEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" 255f9188227SMike FrysingerQEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 256be17dc90SMichael S. TsirkinQEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 257be17dc90SMichael S. TsirkinQEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 25884958305SKirill A. ShutemovQEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" 259cbbab922SPaolo BonziniQEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" 2605bc62e01SGerd Hoffmannif test "$debug_info" = "yes"; then 2615bc62e01SGerd Hoffmann CFLAGS="-g $CFLAGS" 262be17dc90SMichael S. Tsirkin LDFLAGS="-g $LDFLAGS" 2635bc62e01SGerd Hoffmannfi 264be17dc90SMichael S. Tsirkin 265ca4deeb1SPaolo Bonzini# make source path absolute 266ca4deeb1SPaolo Bonzinisource_path=`cd "$source_path"; pwd` 267ca4deeb1SPaolo Bonzini 268ac0df51dSaliguoricheck_define() { 269ac0df51dSaliguoricat > $TMPC <<EOF 270ac0df51dSaliguori#if !defined($1) 271fd786e1aSPeter Maydell#error $1 not defined 272ac0df51dSaliguori#endif 273ac0df51dSaliguoriint main(void) { return 0; } 274ac0df51dSaliguoriEOF 27552166aa0SJuan Quintela compile_object 276ac0df51dSaliguori} 277ac0df51dSaliguori 2782ff6b91eSJuan Quintelaif test ! -z "$cpu" ; then 2792ff6b91eSJuan Quintela # command line argument 2802ff6b91eSJuan Quintela : 2812ff6b91eSJuan Quintelaelif check_define __i386__ ; then 282ac0df51dSaliguori cpu="i386" 283ac0df51dSaliguorielif check_define __x86_64__ ; then 284ac0df51dSaliguori cpu="x86_64" 2853aa9bd6cSblueswir1elif check_define __sparc__ ; then 2863aa9bd6cSblueswir1 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA 2873aa9bd6cSblueswir1 # They must be specified using --sparc_cpu 2883aa9bd6cSblueswir1 if check_define __arch64__ ; then 2893aa9bd6cSblueswir1 cpu="sparc64" 2903aa9bd6cSblueswir1 else 2913aa9bd6cSblueswir1 cpu="sparc" 2923aa9bd6cSblueswir1 fi 293fdf7ed96Smalcelif check_define _ARCH_PPC ; then 294fdf7ed96Smalc if check_define _ARCH_PPC64 ; then 295fdf7ed96Smalc cpu="ppc64" 296ac0df51dSaliguori else 297fdf7ed96Smalc cpu="ppc" 298fdf7ed96Smalc fi 299afa05235SAurelien Jarnoelif check_define __mips__ ; then 300afa05235SAurelien Jarno cpu="mips" 301477ba620SAurelien Jarnoelif check_define __ia64__ ; then 302477ba620SAurelien Jarno cpu="ia64" 303d66ed0eaSAurelien Jarnoelif check_define __s390__ ; then 304d66ed0eaSAurelien Jarno if check_define __s390x__ ; then 305d66ed0eaSAurelien Jarno cpu="s390x" 306d66ed0eaSAurelien Jarno else 307d66ed0eaSAurelien Jarno cpu="s390" 308d66ed0eaSAurelien Jarno fi 30921d89f84SPeter Maydellelif check_define __arm__ ; then 31021d89f84SPeter Maydell cpu="arm" 311f28ffed5SBradelif check_define __hppa__ ; then 312f28ffed5SBrad cpu="hppa" 313fdf7ed96Smalcelse 314fdf7ed96Smalc cpu=`uname -m` 315ac0df51dSaliguorifi 316ac0df51dSaliguori 317359bc95dSPeter MaydellARCH= 318359bc95dSPeter Maydell# Normalise host CPU name and set ARCH. 319359bc95dSPeter Maydell# Note that this case should only have supported host CPUs, not guests. 3207d13299dSbellardcase "$cpu" in 321359bc95dSPeter Maydell ia64|ppc|ppc64|s390|s390x|sparc64) 322ea8f20f8SJuan Quintela cpu="$cpu" 323ea8f20f8SJuan Quintela ;; 3247d13299dSbellard i386|i486|i586|i686|i86pc|BePC) 32597a847bcSbellard cpu="i386" 3267d13299dSbellard ;; 327aaa5fa14Saurel32 x86_64|amd64) 328aaa5fa14Saurel32 cpu="x86_64" 329aaa5fa14Saurel32 ;; 33021d89f84SPeter Maydell armv*b|armv*l|arm) 33121d89f84SPeter Maydell cpu="arm" 3327d13299dSbellard ;; 333f28ffed5SBrad hppa|parisc|parisc64) 334f54b3f92Saurel32 cpu="hppa" 335f54b3f92Saurel32 ;; 336afa05235SAurelien Jarno mips*) 337afa05235SAurelien Jarno cpu="mips" 338afa05235SAurelien Jarno ;; 3393142255cSblueswir1 sparc|sun4[cdmuv]) 340ae228531Sbellard cpu="sparc" 341ae228531Sbellard ;; 3427d13299dSbellard *) 343359bc95dSPeter Maydell # This will result in either an error or falling back to TCI later 344359bc95dSPeter Maydell ARCH=unknown 3457d13299dSbellard ;; 3467d13299dSbellardesac 347359bc95dSPeter Maydellif test -z "$ARCH"; then 348359bc95dSPeter Maydell ARCH="$cpu" 349359bc95dSPeter Maydellfi 350e2d52ad3SJuan Quintela 3517d13299dSbellard# OS specific 352ac0df51dSaliguoriif check_define __linux__ ; then 353ac0df51dSaliguori targetos="Linux" 354ac0df51dSaliguorielif check_define _WIN32 ; then 355ac0df51dSaliguori targetos='MINGW32' 356169dc5d3Sblueswir1elif check_define __OpenBSD__ ; then 357169dc5d3Sblueswir1 targetos='OpenBSD' 358169dc5d3Sblueswir1elif check_define __sun__ ; then 359169dc5d3Sblueswir1 targetos='SunOS' 360179cf400SAndreas Färberelif check_define __HAIKU__ ; then 361179cf400SAndreas Färber targetos='Haiku' 362ac0df51dSaliguorielse 3637d13299dSbellard targetos=`uname -s` 364ac0df51dSaliguorifi 3650dbfc675SJuan Quintela 3667d13299dSbellardcase $targetos in 367c326e0afSbellardCYGWIN*) 368c326e0afSbellard mingw32="yes" 369a558ee17SJuan Quintela QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" 370d5631638Smalc audio_possible_drivers="winwave sdl" 371d5631638Smalc audio_drv_list="winwave" 372c326e0afSbellard;; 37367b915a5SbellardMINGW32*) 37467b915a5Sbellard mingw32="yes" 375d5631638Smalc audio_possible_drivers="winwave dsound sdl fmod" 376d5631638Smalc audio_drv_list="winwave" 37767b915a5Sbellard;; 3785c40d2bdSthsGNU/kFreeBSD) 379a167ba50SAurelien Jarno bsd="yes" 3800c58ac1cSmalc audio_drv_list="oss" 381f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 3825c40d2bdSths;; 3837d3505c5SbellardFreeBSD) 3847d3505c5Sbellard bsd="yes" 3850db4a067SPaolo Bonzini make="${MAKE-gmake}" 3860c58ac1cSmalc audio_drv_list="oss" 387f34af52cSaurel32 audio_possible_drivers="oss sdl esd pa" 388f01576f1SJuergen Lock # needed for kinfo_getvmmap(3) in libutil.h 389f01576f1SJuergen Lock LIBS="-lutil $LIBS" 3907d3505c5Sbellard;; 391c5e97233Sblueswir1DragonFly) 392c5e97233Sblueswir1 bsd="yes" 3930db4a067SPaolo Bonzini make="${MAKE-gmake}" 394c5e97233Sblueswir1 audio_drv_list="oss" 395c5e97233Sblueswir1 audio_possible_drivers="oss sdl esd pa" 396c5e97233Sblueswir1;; 3977d3505c5SbellardNetBSD) 3987d3505c5Sbellard bsd="yes" 3990db4a067SPaolo Bonzini make="${MAKE-gmake}" 4000c58ac1cSmalc audio_drv_list="oss" 401c2de5c91Smalc audio_possible_drivers="oss sdl esd" 4028ef92a88Sblueswir1 oss_lib="-lossaudio" 4037d3505c5Sbellard;; 4047d3505c5SbellardOpenBSD) 4057d3505c5Sbellard bsd="yes" 4060db4a067SPaolo Bonzini make="${MAKE-gmake}" 4070c58ac1cSmalc audio_drv_list="oss" 408c2de5c91Smalc audio_possible_drivers="oss sdl esd" 4092f6a1ab0Sblueswir1 oss_lib="-lossaudio" 4107d3505c5Sbellard;; 41183fb7adfSbellardDarwin) 41283fb7adfSbellard bsd="yes" 41383fb7adfSbellard darwin="yes" 4140dbfc675SJuan Quintela # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can 4150dbfc675SJuan Quintela # run 64-bit userspace code 416aab8588aSmalc if [ "$cpu" = "i386" ] ; then 4171b0f9cc2Saliguori is_x86_64=`sysctl -n hw.optional.x86_64` 418aab8588aSmalc [ "$is_x86_64" = "1" ] && cpu=x86_64 4191b0f9cc2Saliguori fi 4201b0f9cc2Saliguori if [ "$cpu" = "x86_64" ] ; then 421a558ee17SJuan Quintela QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" 4220c439cbfSJuan Quintela LDFLAGS="-arch x86_64 $LDFLAGS" 4231b0f9cc2Saliguori else 424a558ee17SJuan Quintela QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" 4251b0f9cc2Saliguori fi 426fd677642Sths cocoa="yes" 4270c58ac1cSmalc audio_drv_list="coreaudio" 428c2de5c91Smalc audio_possible_drivers="coreaudio sdl fmod" 4290c439cbfSJuan Quintela LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" 4307973f21cSJuan Quintela libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" 43183fb7adfSbellard;; 432ec530c81SbellardSunOS) 433ec530c81Sbellard solaris="yes" 4340db4a067SPaolo Bonzini make="${MAKE-gmake}" 4350db4a067SPaolo Bonzini install="${INSTALL-ginstall}" 436fa58948dSBlue Swirl ld="gld" 437e2d8830eSBrad smbd="${SMBD-/usr/sfw/sbin/smbd}" 4380475a5caSths needs_libsunmath="no" 439c2b84fabSths solarisrev=`uname -r | cut -f2 -d.` 440ef18c883Sths # have to select again, because `uname -m` returns i86pc 441ef18c883Sths # even on an x86_64 box. 442ef18c883Sths solariscpu=`isainfo -k` 443ef18c883Sths if test "${solariscpu}" = "amd64" ; then 444ef18c883Sths cpu="x86_64" 445ef18c883Sths fi 446c2b84fabSths if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 4470475a5caSths if test "$solarisrev" -le 9 ; then 4480475a5caSths if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then 4490475a5caSths needs_libsunmath="yes" 450f14bfdf9SJuan Quintela QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" 451f14bfdf9SJuan Quintela LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" 452f14bfdf9SJuan Quintela LIBS="-lsunmath $LIBS" 4530475a5caSths else 4540475a5caSths echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" 4550475a5caSths echo "libsunmath from the Sun Studio compilers tools, due to a lack of" 4560475a5caSths echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" 4570475a5caSths echo "Studio 11 can be downloaded from www.sun.com." 4580475a5caSths exit 1 4590475a5caSths fi 4600475a5caSths fi 46186b2bd93Sths fi 4626b4d2ba1Sths if test -f /usr/include/sys/soundcard.h ; then 4630c58ac1cSmalc audio_drv_list="oss" 4646b4d2ba1Sths fi 465c2de5c91Smalc audio_possible_drivers="oss sdl" 466d741429aSBlue Swirl# needed for CMSG_ macros in sys/socket.h 467d741429aSBlue Swirl QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" 468d741429aSBlue Swirl# needed for TIOCWIN* defines in termios.h 469d741429aSBlue Swirl QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" 470a558ee17SJuan Quintela QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" 471560d375fSAndreas Färber solarisnetlibs="-lsocket -lnsl -lresolv" 472560d375fSAndreas Färber LIBS="$solarisnetlibs $LIBS" 473560d375fSAndreas Färber libs_qga="$solarisnetlibs $libs_qga" 474ec530c81Sbellard;; 475b29fe3edSmalcAIX) 476b29fe3edSmalc aix="yes" 4770db4a067SPaolo Bonzini make="${MAKE-gmake}" 478b29fe3edSmalc;; 479179cf400SAndreas FärberHaiku) 480179cf400SAndreas Färber haiku="yes" 481179cf400SAndreas Färber QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS" 482179cf400SAndreas Färber LIBS="-lposix_error_mapper -lnetwork $LIBS" 483179cf400SAndreas Färber;; 484fb065187Sbellard*) 4850c58ac1cSmalc audio_drv_list="oss" 486b8e59f18Smalc audio_possible_drivers="oss alsa sdl esd pa" 4875327cf48Sbellard linux="yes" 488831b7825Sths linux_user="yes" 48968063649Sblueswir1 usb="linux" 490af2be207SJan Kiszka kvm="yes" 491af2be207SJan Kiszka vhost_net="yes" 49207f4ddbfSbellard if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then 493c2de5c91Smalc audio_possible_drivers="$audio_possible_drivers fmod" 494c9ec1fe4Sbellard fi 495fb065187Sbellard;; 4967d13299dSbellardesac 4977d13299dSbellard 4987d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 499b1a550a0Spbrook if [ "$darwin" != "yes" ] ; then 50068063649Sblueswir1 usb="bsd" 50184778508Sblueswir1 bsd_user="yes" 5027d3505c5Sbellard fi 50308de3949SAndreas Färberfi 5047d3505c5Sbellard 5050db4a067SPaolo Bonzini: ${make=${MAKE-make}} 5060db4a067SPaolo Bonzini: ${install=${INSTALL-install}} 507c886edfbSBlue Swirl: ${python=${PYTHON-python}} 508e2d8830eSBrad: ${smbd=${SMBD-/usr/sbin/smbd}} 5090db4a067SPaolo Bonzini 5103457a3f8SJuan Quintelaif test "$mingw32" = "yes" ; then 5113457a3f8SJuan Quintela EXESUF=".exe" 512a558ee17SJuan Quintela QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" 513e94a7936SStefan Weil # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) 514e94a7936SStefan Weil QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" 515f7cf5d5bSStefan Weil LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" 516f7cf5d5bSStefan Weilcat > $TMPC << EOF 517f7cf5d5bSStefan Weilint main(void) { return 0; } 518f7cf5d5bSStefan WeilEOF 519f7cf5d5bSStefan Weil if compile_prog "" "-liberty" ; then 520f7cf5d5bSStefan Weil LIBS="-liberty $LIBS" 521f7cf5d5bSStefan Weil fi 522c5ec15eaSStefan Weil prefix="c:/Program Files/QEMU" 523683035deSPaolo Bonzini mandir="\${prefix}" 524528ae5b8SEduardo Habkost datadir="\${prefix}" 525850da188SEduardo Habkost qemu_docdir="\${prefix}" 526683035deSPaolo Bonzini bindir="\${prefix}" 527683035deSPaolo Bonzini sysconfdir="\${prefix}" 528683035deSPaolo Bonzini confsuffix="" 529368542b8SStefan Hajnoczi libs_qga="-lws2_32 -lwinmm -lpowrprof $libs_qga" 5303457a3f8SJuan Quintelafi 5313457a3f8SJuan Quintela 532487fefdbSAnthony Liguoriwerror="" 53385aa5189Sbellard 5347d13299dSbellardfor opt do 535a46e4035Spbrook optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` 5367d13299dSbellard case "$opt" in 5372efc3265Sbellard --help|-h) show_help=yes 5382efc3265Sbellard ;; 53999123e13SMike Frysinger --version|-V) exec cat $source_path/VERSION 54099123e13SMike Frysinger ;; 541b1a550a0Spbrook --prefix=*) prefix="$optarg" 5427d13299dSbellard ;; 543b1a550a0Spbrook --interp-prefix=*) interp_prefix="$optarg" 54432ce6337Sbellard ;; 545ca4deeb1SPaolo Bonzini --source-path=*) 5467d13299dSbellard ;; 547ac0df51dSaliguori --cross-prefix=*) 5487d13299dSbellard ;; 549ac0df51dSaliguori --cc=*) 5507d13299dSbellard ;; 551b1a550a0Spbrook --host-cc=*) host_cc="$optarg" 55283469015Sbellard ;; 553b1a550a0Spbrook --make=*) make="$optarg" 5547d13299dSbellard ;; 5556a882643Spbrook --install=*) install="$optarg" 5566a882643Spbrook ;; 557c886edfbSBlue Swirl --python=*) python="$optarg" 558c886edfbSBlue Swirl ;; 559e2d8830eSBrad --smbd=*) smbd="$optarg" 560e2d8830eSBrad ;; 561e2a2ed06SJuan Quintela --extra-cflags=*) 5627d13299dSbellard ;; 563e2a2ed06SJuan Quintela --extra-ldflags=*) 5647d13299dSbellard ;; 5655bc62e01SGerd Hoffmann --enable-debug-info) 5665bc62e01SGerd Hoffmann ;; 5675bc62e01SGerd Hoffmann --disable-debug-info) 5685bc62e01SGerd Hoffmann ;; 5692ff6b91eSJuan Quintela --cpu=*) 5707d13299dSbellard ;; 571b1a550a0Spbrook --target-list=*) target_list="$optarg" 572de83cd02Sbellard ;; 57374242e0fSPaolo Bonzini --enable-trace-backend=*) trace_backend="$optarg" 57494a420b1SStefan Hajnoczi ;; 57574242e0fSPaolo Bonzini --with-trace-file=*) trace_file="$optarg" 5769410b56cSPrerna Saxena ;; 5777d13299dSbellard --enable-gprof) gprof="yes" 5787d13299dSbellard ;; 57979427693SLoïc Minier --static) 58079427693SLoïc Minier static="yes" 58179427693SLoïc Minier LDFLAGS="-static $LDFLAGS" 58217884d7bSSergei Trofimovich QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" 58343ce4dfeSbellard ;; 5840b24e75fSPaolo Bonzini --mandir=*) mandir="$optarg" 5850b24e75fSPaolo Bonzini ;; 5860b24e75fSPaolo Bonzini --bindir=*) bindir="$optarg" 5870b24e75fSPaolo Bonzini ;; 5883aa5d2beSAlon Levy --libdir=*) libdir="$optarg" 5893aa5d2beSAlon Levy ;; 5900f94d6daSAlon Levy --includedir=*) includedir="$optarg" 5910f94d6daSAlon Levy ;; 592528ae5b8SEduardo Habkost --datadir=*) datadir="$optarg" 5930b24e75fSPaolo Bonzini ;; 594023d3d67SEduardo Habkost --with-confsuffix=*) confsuffix="$optarg" 595023d3d67SEduardo Habkost ;; 596850da188SEduardo Habkost --docdir=*) qemu_docdir="$optarg" 5970b24e75fSPaolo Bonzini ;; 598ca2fb938SAndre Przywara --sysconfdir=*) sysconfdir="$optarg" 59907381cc1SAnthony Liguori ;; 600023ddd74SMax Filippov --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\ 601023ddd74SMax Filippov --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ 602023ddd74SMax Filippov --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*) 603023ddd74SMax Filippov # These switches are silently ignored, for compatibility with 604023ddd74SMax Filippov # autoconf-generated configure scripts. This allows QEMU's 605023ddd74SMax Filippov # configure to be used by RPM and similar macros that set 606023ddd74SMax Filippov # lots of directory switches by default. 607023ddd74SMax Filippov ;; 60897a847bcSbellard --disable-sdl) sdl="no" 60997a847bcSbellard ;; 610c4198157SJuan Quintela --enable-sdl) sdl="yes" 611c4198157SJuan Quintela ;; 612983eef5aSMeador Inge --disable-virtfs) virtfs="no" 613983eef5aSMeador Inge ;; 614983eef5aSMeador Inge --enable-virtfs) virtfs="yes" 615983eef5aSMeador Inge ;; 616821601eaSJes Sorensen --disable-vnc) vnc="no" 617821601eaSJes Sorensen ;; 618821601eaSJes Sorensen --enable-vnc) vnc="yes" 619821601eaSJes Sorensen ;; 620b1a550a0Spbrook --fmod-lib=*) fmod_lib="$optarg" 621102a52e4Sbellard ;; 622c2de5c91Smalc --fmod-inc=*) fmod_inc="$optarg" 623c2de5c91Smalc ;; 6242f6a1ab0Sblueswir1 --oss-lib=*) oss_lib="$optarg" 6252f6a1ab0Sblueswir1 ;; 6262fa7d3bfSmalc --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` 6270c58ac1cSmalc ;; 6280c58ac1cSmalc --audio-drv-list=*) audio_drv_list="$optarg" 6290c58ac1cSmalc ;; 630eb852011SMarkus Armbruster --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'` 631eb852011SMarkus Armbruster ;; 632f8393946Saurel32 --enable-debug-tcg) debug_tcg="yes" 633f8393946Saurel32 ;; 634f8393946Saurel32 --disable-debug-tcg) debug_tcg="no" 635f8393946Saurel32 ;; 636b4475aa2SLuiz Capitulino --enable-debug-mon) debug_mon="yes" 637b4475aa2SLuiz Capitulino ;; 638b4475aa2SLuiz Capitulino --disable-debug-mon) debug_mon="no" 639b4475aa2SLuiz Capitulino ;; 640f3d08ee6SPaul Brook --enable-debug) 641f3d08ee6SPaul Brook # Enable debugging options that aren't excessively noisy 642f3d08ee6SPaul Brook debug_tcg="yes" 643b4475aa2SLuiz Capitulino debug_mon="yes" 644f3d08ee6SPaul Brook debug="yes" 645f3d08ee6SPaul Brook strip_opt="no" 646f3d08ee6SPaul Brook ;; 64703b4fe7dSaliguori --enable-sparse) sparse="yes" 64803b4fe7dSaliguori ;; 64903b4fe7dSaliguori --disable-sparse) sparse="no" 65003b4fe7dSaliguori ;; 6511625af87Saliguori --disable-strip) strip_opt="no" 6521625af87Saliguori ;; 6538d5d2d4cSths --disable-vnc-tls) vnc_tls="no" 6548d5d2d4cSths ;; 6551be10ad2SJuan Quintela --enable-vnc-tls) vnc_tls="yes" 6561be10ad2SJuan Quintela ;; 6572f9606b3Saliguori --disable-vnc-sasl) vnc_sasl="no" 6582f9606b3Saliguori ;; 659ea784e3bSJuan Quintela --enable-vnc-sasl) vnc_sasl="yes" 660ea784e3bSJuan Quintela ;; 6612f6f5c7aSCorentin Chary --disable-vnc-jpeg) vnc_jpeg="no" 6622f6f5c7aSCorentin Chary ;; 6632f6f5c7aSCorentin Chary --enable-vnc-jpeg) vnc_jpeg="yes" 6642f6f5c7aSCorentin Chary ;; 665efe556adSCorentin Chary --disable-vnc-png) vnc_png="no" 666efe556adSCorentin Chary ;; 667efe556adSCorentin Chary --enable-vnc-png) vnc_png="yes" 668efe556adSCorentin Chary ;; 669bd023f95SCorentin Chary --disable-vnc-thread) vnc_thread="no" 670bd023f95SCorentin Chary ;; 671bd023f95SCorentin Chary --enable-vnc-thread) vnc_thread="yes" 672bd023f95SCorentin Chary ;; 673443f1376Sbellard --disable-slirp) slirp="no" 674c20709aaSbellard ;; 675ee682d27SStefan Weil --disable-uuid) uuid="no" 676ee682d27SStefan Weil ;; 677ee682d27SStefan Weil --enable-uuid) uuid="yes" 678ee682d27SStefan Weil ;; 679e0e6c8c0Saliguori --disable-vde) vde="no" 6808a16d273Sths ;; 681dfb278bdSJuan Quintela --enable-vde) vde="yes" 682dfb278bdSJuan Quintela ;; 683e37630caSaliguori --disable-xen) xen="no" 684e37630caSaliguori ;; 685fc321b4bSJuan Quintela --enable-xen) xen="yes" 686fc321b4bSJuan Quintela ;; 6872e4d9fb1Saurel32 --disable-brlapi) brlapi="no" 6882e4d9fb1Saurel32 ;; 6894ffcedb6SJuan Quintela --enable-brlapi) brlapi="yes" 6904ffcedb6SJuan Quintela ;; 691fb599c9aSbalrog --disable-bluez) bluez="no" 692fb599c9aSbalrog ;; 693a20a6f46SJuan Quintela --enable-bluez) bluez="yes" 694a20a6f46SJuan Quintela ;; 6957ba1e619Saliguori --disable-kvm) kvm="no" 6967ba1e619Saliguori ;; 697b31a0277SJuan Quintela --enable-kvm) kvm="yes" 698b31a0277SJuan Quintela ;; 6999195b2c2SStefan Weil --disable-tcg-interpreter) tcg_interpreter="no" 7009195b2c2SStefan Weil ;; 7019195b2c2SStefan Weil --enable-tcg-interpreter) tcg_interpreter="yes" 7029195b2c2SStefan Weil ;; 70347e98658SCorey Bryant --disable-cap-ng) cap_ng="no" 70447e98658SCorey Bryant ;; 70547e98658SCorey Bryant --enable-cap-ng) cap_ng="yes" 70647e98658SCorey Bryant ;; 707cd4ec0b4SGerd Hoffmann --disable-spice) spice="no" 708cd4ec0b4SGerd Hoffmann ;; 709cd4ec0b4SGerd Hoffmann --enable-spice) spice="yes" 710cd4ec0b4SGerd Hoffmann ;; 711c589b249SRonnie Sahlberg --disable-libiscsi) libiscsi="no" 712c589b249SRonnie Sahlberg ;; 713c589b249SRonnie Sahlberg --enable-libiscsi) libiscsi="yes" 714c589b249SRonnie Sahlberg ;; 71505c2a3e7Sbellard --enable-profiler) profiler="yes" 71605c2a3e7Sbellard ;; 71714821030SPavel Borzenkov --disable-cocoa) cocoa="no" 71814821030SPavel Borzenkov ;; 719c2de5c91Smalc --enable-cocoa) 720c2de5c91Smalc cocoa="yes" ; 721c2de5c91Smalc sdl="no" ; 722c2de5c91Smalc audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" 7235b0753e0Sbellard ;; 724cad25d69Spbrook --disable-system) softmmu="no" 7250a8e90f4Spbrook ;; 726cad25d69Spbrook --enable-system) softmmu="yes" 7270a8e90f4Spbrook ;; 7280953a80fSZachary Amsden --disable-user) 7290953a80fSZachary Amsden linux_user="no" ; 7300953a80fSZachary Amsden bsd_user="no" ; 7310953a80fSZachary Amsden ;; 7320953a80fSZachary Amsden --enable-user) ;; 733831b7825Sths --disable-linux-user) linux_user="no" 7340a8e90f4Spbrook ;; 735831b7825Sths --enable-linux-user) linux_user="yes" 736831b7825Sths ;; 73784778508Sblueswir1 --disable-bsd-user) bsd_user="no" 73884778508Sblueswir1 ;; 73984778508Sblueswir1 --enable-bsd-user) bsd_user="yes" 74084778508Sblueswir1 ;; 741379f6698SPaul Brook --enable-guest-base) guest_base="yes" 742379f6698SPaul Brook ;; 743379f6698SPaul Brook --disable-guest-base) guest_base="no" 744379f6698SPaul Brook ;; 74540d6444eSAvi Kivity --enable-pie) pie="yes" 74634005a00SKirill A. Shutemov ;; 74740d6444eSAvi Kivity --disable-pie) pie="no" 74834005a00SKirill A. Shutemov ;; 749c5937220Spbrook --enable-uname-release=*) uname_release="$optarg" 750c5937220Spbrook ;; 7513142255cSblueswir1 --sparc_cpu=*) 7523142255cSblueswir1 ;; 75385aa5189Sbellard --enable-werror) werror="yes" 75485aa5189Sbellard ;; 75585aa5189Sbellard --disable-werror) werror="no" 75685aa5189Sbellard ;; 7574d3b6f6eSbalrog --disable-curses) curses="no" 7584d3b6f6eSbalrog ;; 759c584a6d0SJuan Quintela --enable-curses) curses="yes" 760c584a6d0SJuan Quintela ;; 761769ce76dSAlexander Graf --disable-curl) curl="no" 762769ce76dSAlexander Graf ;; 763788c8196SJuan Quintela --enable-curl) curl="yes" 764788c8196SJuan Quintela ;; 7652df87df7SJuan Quintela --disable-fdt) fdt="no" 7662df87df7SJuan Quintela ;; 7672df87df7SJuan Quintela --enable-fdt) fdt="yes" 7682df87df7SJuan Quintela ;; 769bd0c5661Spbrook --disable-nptl) nptl="no" 770bd0c5661Spbrook ;; 771b0a47e79SJuan Quintela --enable-nptl) nptl="yes" 772b0a47e79SJuan Quintela ;; 7738ff9cbf7Smalc --enable-mixemu) mixemu="yes" 7748ff9cbf7Smalc ;; 7755c6c3a6cSChristoph Hellwig --disable-linux-aio) linux_aio="no" 7765c6c3a6cSChristoph Hellwig ;; 7775c6c3a6cSChristoph Hellwig --enable-linux-aio) linux_aio="yes" 7785c6c3a6cSChristoph Hellwig ;; 779758e8e38SVenkateswararao Jujjuri (JV) --disable-attr) attr="no" 780758e8e38SVenkateswararao Jujjuri (JV) ;; 781758e8e38SVenkateswararao Jujjuri (JV) --enable-attr) attr="yes" 782758e8e38SVenkateswararao Jujjuri (JV) ;; 78377755340Sths --disable-blobs) blobs="no" 78477755340Sths ;; 7854a19f1ecSpbrook --with-pkgversion=*) pkgversion=" ($optarg)" 7864a19f1ecSpbrook ;; 787519175a2SAlex Barcelo --with-coroutine=*) coroutine="$optarg" 788519175a2SAlex Barcelo ;; 789a25dba17SJuan Quintela --disable-docs) docs="no" 79070ec5dc0SAnthony Liguori ;; 791a25dba17SJuan Quintela --enable-docs) docs="yes" 79283a3ab8bSJuan Quintela ;; 793d5970055SMichael S. Tsirkin --disable-vhost-net) vhost_net="no" 794d5970055SMichael S. Tsirkin ;; 795d5970055SMichael S. Tsirkin --enable-vhost-net) vhost_net="yes" 796d5970055SMichael S. Tsirkin ;; 79720ff075bSMichael Walle --disable-opengl) opengl="no" 79820ff075bSMichael Walle ;; 79920ff075bSMichael Walle --enable-opengl) opengl="yes" 80020ff075bSMichael Walle ;; 801f27aaf4bSChristian Brunner --disable-rbd) rbd="no" 802f27aaf4bSChristian Brunner ;; 803f27aaf4bSChristian Brunner --enable-rbd) rbd="yes" 804f27aaf4bSChristian Brunner ;; 8058c84cf11SSergei Trofimovich --disable-xfsctl) xfs="no" 8068c84cf11SSergei Trofimovich ;; 8078c84cf11SSergei Trofimovich --enable-xfsctl) xfs="yes" 8088c84cf11SSergei Trofimovich ;; 80936707144SAlon Levy --disable-smartcard) smartcard="no" 81036707144SAlon Levy ;; 81136707144SAlon Levy --enable-smartcard) smartcard="yes" 81236707144SAlon Levy ;; 813111a38b0SRobert Relyea --disable-smartcard-nss) smartcard_nss="no" 814111a38b0SRobert Relyea ;; 815111a38b0SRobert Relyea --enable-smartcard-nss) smartcard_nss="yes" 816111a38b0SRobert Relyea ;; 81769354a83SHans de Goede --disable-usb-redir) usb_redir="no" 81869354a83SHans de Goede ;; 81969354a83SHans de Goede --enable-usb-redir) usb_redir="yes" 82069354a83SHans de Goede ;; 8211ece9905SAlon Levy --disable-zlib-test) zlib="no" 8221ece9905SAlon Levy ;; 823d138cee9SMichael Roth --enable-guest-agent) guest_agent="yes" 824d138cee9SMichael Roth ;; 825d138cee9SMichael Roth --disable-guest-agent) guest_agent="no" 826d138cee9SMichael Roth ;; 8277f1559c6Sbalrog *) echo "ERROR: unknown option $opt"; show_help="yes" 8287f1559c6Sbalrog ;; 8297d13299dSbellard esac 8307d13299dSbellarddone 8317d13299dSbellard 8323142255cSblueswir1# 8333142255cSblueswir1# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right 834a558ee17SJuan Quintela# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) 8353142255cSblueswir1# 836379f6698SPaul Brookhost_guest_base="no" 83740293e58Sbellardcase "$cpu" in 838ed968ff1SJuan Quintela sparc) case $sparc_cpu in 839ed968ff1SJuan Quintela v7|v8) 840a558ee17SJuan Quintela QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" 841ed968ff1SJuan Quintela ;; 842ed968ff1SJuan Quintela v8plus|v8plusa) 843a558ee17SJuan Quintela QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" 844ed968ff1SJuan Quintela ;; 845ed968ff1SJuan Quintela *) # sparc_cpu not defined in the command line 846a558ee17SJuan Quintela QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" 847ed968ff1SJuan Quintela esac 8480c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 849a558ee17SJuan Quintela QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS" 850762e8230Sblueswir1 if test "$solaris" = "no" ; then 851a558ee17SJuan Quintela QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS" 852c81da56eSJuan Quintela helper_cflags="-ffixed-i0" 853762e8230Sblueswir1 fi 8543142255cSblueswir1 ;; 855ed968ff1SJuan Quintela sparc64) 856a558ee17SJuan Quintela QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" 8570c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 858a558ee17SJuan Quintela QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" 859ed968ff1SJuan Quintela if test "$solaris" != "no" ; then 860a558ee17SJuan Quintela QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS" 861762e8230Sblueswir1 fi 8623142255cSblueswir1 ;; 86376d83bdeSths s390) 86428d7cc49SRichard Henderson QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS" 86528d7cc49SRichard Henderson LDFLAGS="-m31 $LDFLAGS" 86648bb3750SRichard Henderson host_guest_base="yes" 86728d7cc49SRichard Henderson ;; 86828d7cc49SRichard Henderson s390x) 86928d7cc49SRichard Henderson QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS" 87028d7cc49SRichard Henderson LDFLAGS="-m64 $LDFLAGS" 87148bb3750SRichard Henderson host_guest_base="yes" 87276d83bdeSths ;; 87340293e58Sbellard i386) 874a558ee17SJuan Quintela QEMU_CFLAGS="-m32 $QEMU_CFLAGS" 8750c439cbfSJuan Quintela LDFLAGS="-m32 $LDFLAGS" 8762b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 877c81da56eSJuan Quintela helper_cflags="-fomit-frame-pointer" 878379f6698SPaul Brook host_guest_base="yes" 87940293e58Sbellard ;; 88040293e58Sbellard x86_64) 881a558ee17SJuan Quintela QEMU_CFLAGS="-m64 $QEMU_CFLAGS" 8820c439cbfSJuan Quintela LDFLAGS="-m64 $LDFLAGS" 8832b2e59e6SPaolo Bonzini cc_i386='$(CC) -m32' 884379f6698SPaul Brook host_guest_base="yes" 885379f6698SPaul Brook ;; 886379f6698SPaul Brook arm*) 887379f6698SPaul Brook host_guest_base="yes" 88840293e58Sbellard ;; 889f6548c0aSmalc ppc*) 890f6548c0aSmalc host_guest_base="yes" 891f6548c0aSmalc ;; 892cc01cc8eSAurelien Jarno mips*) 893cc01cc8eSAurelien Jarno host_guest_base="yes" 894cc01cc8eSAurelien Jarno ;; 895477ba620SAurelien Jarno ia64*) 896477ba620SAurelien Jarno host_guest_base="yes" 897477ba620SAurelien Jarno ;; 898fd76e73aSRichard Henderson hppa*) 899fd76e73aSRichard Henderson host_guest_base="yes" 900fd76e73aSRichard Henderson ;; 901d2fbca94SGuan Xuetao unicore32*) 902d2fbca94SGuan Xuetao host_guest_base="yes" 903d2fbca94SGuan Xuetao ;; 9043142255cSblueswir1esac 9053142255cSblueswir1 906379f6698SPaul Brook[ -z "$guest_base" ] && guest_base="$host_guest_base" 907379f6698SPaul Brook 90860e0df25SPeter Maydell 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 \ 92760e0df25SPeter Maydellppc-softmmu \ 92860e0df25SPeter Maydellppcemb-softmmu \ 92960e0df25SPeter Maydellppc64-softmmu \ 93060e0df25SPeter Maydellsh4-softmmu \ 93160e0df25SPeter Maydellsh4eb-softmmu \ 93260e0df25SPeter Maydellsparc-softmmu \ 93360e0df25SPeter Maydellsparc64-softmmu \ 9340f3301d4SAlexander Grafs390x-softmmu \ 935cfa550c6SMax Filippovxtensa-softmmu \ 936cfa550c6SMax Filippovxtensaeb-softmmu \ 93760e0df25SPeter Maydell" 93860e0df25SPeter Maydellfi 93960e0df25SPeter Maydell# the following are Linux specific 94060e0df25SPeter Maydellif [ "$linux_user" = "yes" ] ; then 94160e0df25SPeter Maydell default_target_list="${default_target_list}\ 94260e0df25SPeter Maydelli386-linux-user \ 94360e0df25SPeter Maydellx86_64-linux-user \ 94460e0df25SPeter Maydellalpha-linux-user \ 94560e0df25SPeter Maydellarm-linux-user \ 94660e0df25SPeter Maydellarmeb-linux-user \ 94760e0df25SPeter Maydellcris-linux-user \ 94860e0df25SPeter Maydellm68k-linux-user \ 94960e0df25SPeter Maydellmicroblaze-linux-user \ 95060e0df25SPeter Maydellmicroblazeel-linux-user \ 95160e0df25SPeter Maydellmips-linux-user \ 95260e0df25SPeter Maydellmipsel-linux-user \ 95360e0df25SPeter Maydellppc-linux-user \ 95460e0df25SPeter Maydellppc64-linux-user \ 95560e0df25SPeter Maydellppc64abi32-linux-user \ 95660e0df25SPeter Maydellsh4-linux-user \ 95760e0df25SPeter Maydellsh4eb-linux-user \ 95860e0df25SPeter Maydellsparc-linux-user \ 95960e0df25SPeter Maydellsparc64-linux-user \ 96060e0df25SPeter Maydellsparc32plus-linux-user \ 96160e0df25SPeter Maydellunicore32-linux-user \ 9620f3301d4SAlexander Grafs390x-linux-user \ 96360e0df25SPeter Maydell" 96460e0df25SPeter Maydellfi 96560e0df25SPeter Maydell# the following are BSD specific 96660e0df25SPeter Maydellif [ "$bsd_user" = "yes" ] ; then 96760e0df25SPeter Maydell default_target_list="${default_target_list}\ 96860e0df25SPeter Maydelli386-bsd-user \ 96960e0df25SPeter Maydellx86_64-bsd-user \ 97060e0df25SPeter Maydellsparc-bsd-user \ 97160e0df25SPeter Maydellsparc64-bsd-user \ 97260e0df25SPeter Maydell" 97360e0df25SPeter Maydellfi 97460e0df25SPeter Maydell 975af5db58eSpbrookif test x"$show_help" = x"yes" ; then 976af5db58eSpbrookcat << EOF 977af5db58eSpbrook 978af5db58eSpbrookUsage: configure [options] 979af5db58eSpbrookOptions: [defaults in brackets after descriptions] 980af5db58eSpbrook 981af5db58eSpbrookEOF 982af5db58eSpbrookecho "Standard options:" 983af5db58eSpbrookecho " --help print this message" 984af5db58eSpbrookecho " --prefix=PREFIX install in PREFIX [$prefix]" 985af5db58eSpbrookecho " --interp-prefix=PREFIX where to find shared libraries, etc." 986af5db58eSpbrookecho " use %M for cpu name [$interp_prefix]" 98760e0df25SPeter Maydellecho " --target-list=LIST set target list (default: build everything)" 98860e0df25SPeter Maydellecho "Available targets: $default_target_list" | \ 98960e0df25SPeter Maydell fold -s -w 53 | sed -e 's/^/ /' 990af5db58eSpbrookecho "" 991af5db58eSpbrookecho "Advanced options (experts only):" 992af5db58eSpbrookecho " --source-path=PATH path of source code [$source_path]" 993af5db58eSpbrookecho " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" 994af5db58eSpbrookecho " --cc=CC use C compiler CC [$cc]" 9950bfe8cc0SPaolo Bonziniecho " --host-cc=CC use C compiler CC [$host_cc] for code run at" 9960bfe8cc0SPaolo Bonziniecho " build time" 997a558ee17SJuan Quintelaecho " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" 998e3fc14c3SJan Kiszkaecho " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" 999af5db58eSpbrookecho " --make=MAKE use specified make [$make]" 10006a882643Spbrookecho " --install=INSTALL use specified install [$install]" 1001c886edfbSBlue Swirlecho " --python=PYTHON use specified python [$python]" 1002e2d8830eSBradecho " --smbd=SMBD use specified smbd [$smbd]" 1003af5db58eSpbrookecho " --static enable static build [$static]" 10040b24e75fSPaolo Bonziniecho " --mandir=PATH install man pages in PATH" 1005023d3d67SEduardo Habkostecho " --datadir=PATH install firmware in PATH$confsuffix" 1006023d3d67SEduardo Habkostecho " --docdir=PATH install documentation in PATH$confsuffix" 10070b24e75fSPaolo Bonziniecho " --bindir=PATH install binaries in PATH" 1008023d3d67SEduardo Habkostecho " --sysconfdir=PATH install config in PATH$confsuffix" 1009023d3d67SEduardo Habkostecho " --with-confsuffix=SUFFIX suffix for Qemu data inside datadir and sysconfdir [$confsuffix]" 1010f8393946Saurel32echo " --enable-debug-tcg enable TCG debugging" 1011f8393946Saurel32echo " --disable-debug-tcg disable TCG debugging (default)" 101209695a4aSStefan Weilecho " --enable-debug enable common debug build options" 1013890b1658Saliguoriecho " --enable-sparse enable sparse checker" 1014890b1658Saliguoriecho " --disable-sparse disable sparse checker (default)" 10151625af87Saliguoriecho " --disable-strip disable stripping binaries" 101685aa5189Sbellardecho " --disable-werror disable compilation abort on warning" 1017fe8f78e4Sbalrogecho " --disable-sdl disable SDL" 1018c4198157SJuan Quintelaecho " --enable-sdl enable SDL" 1019983eef5aSMeador Ingeecho " --disable-virtfs disable VirtFS" 1020983eef5aSMeador Ingeecho " --enable-virtfs enable VirtFS" 1021821601eaSJes Sorensenecho " --disable-vnc disable VNC" 1022821601eaSJes Sorensenecho " --enable-vnc enable VNC" 102314821030SPavel Borzenkovecho " --disable-cocoa disable Cocoa (Mac OS X only)" 102414821030SPavel Borzenkovecho " --enable-cocoa enable Cocoa (default on Mac OS X)" 1025c2de5c91Smalcecho " --audio-drv-list=LIST set audio drivers list:" 1026c2de5c91Smalcecho " Available drivers: $audio_possible_drivers" 10274c9b53e3Smalcecho " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" 10284c9b53e3Smalcecho " Available cards: $audio_possible_cards" 1029eb852011SMarkus Armbrusterecho " --block-drv-whitelist=L set block driver whitelist" 1030eb852011SMarkus Armbrusterecho " (affects only QEMU, not qemu-img)" 10318ff9cbf7Smalcecho " --enable-mixemu enable mixer emulation" 1032e37630caSaliguoriecho " --disable-xen disable xen backend driver support" 1033fc321b4bSJuan Quintelaecho " --enable-xen enable xen backend driver support" 10342e4d9fb1Saurel32echo " --disable-brlapi disable BrlAPI" 10354ffcedb6SJuan Quintelaecho " --enable-brlapi enable BrlAPI" 10368d5d2d4cSthsecho " --disable-vnc-tls disable TLS encryption for VNC server" 10371be10ad2SJuan Quintelaecho " --enable-vnc-tls enable TLS encryption for VNC server" 10382f9606b3Saliguoriecho " --disable-vnc-sasl disable SASL encryption for VNC server" 1039ea784e3bSJuan Quintelaecho " --enable-vnc-sasl enable SASL encryption for VNC server" 10402f6f5c7aSCorentin Charyecho " --disable-vnc-jpeg disable JPEG lossy compression for VNC server" 10412f6f5c7aSCorentin Charyecho " --enable-vnc-jpeg enable JPEG lossy compression for VNC server" 104296763cf9SCorentin Charyecho " --disable-vnc-png disable PNG compression for VNC server (default)" 1043efe556adSCorentin Charyecho " --enable-vnc-png enable PNG compression for VNC server" 1044bd023f95SCorentin Charyecho " --disable-vnc-thread disable threaded VNC server" 1045bd023f95SCorentin Charyecho " --enable-vnc-thread enable threaded VNC server" 1046af896aaaSpbrookecho " --disable-curses disable curses output" 1047c584a6d0SJuan Quintelaecho " --enable-curses enable curses output" 1048769ce76dSAlexander Grafecho " --disable-curl disable curl connectivity" 1049788c8196SJuan Quintelaecho " --enable-curl enable curl connectivity" 10502df87df7SJuan Quintelaecho " --disable-fdt disable fdt device tree" 10512df87df7SJuan Quintelaecho " --enable-fdt enable fdt device tree" 1052fb599c9aSbalrogecho " --disable-bluez disable bluez stack connectivity" 1053a20a6f46SJuan Quintelaecho " --enable-bluez enable bluez stack connectivity" 10546093d3d4SPeter Maydellecho " --disable-slirp disable SLIRP userspace network connectivity" 10557ba1e619Saliguoriecho " --disable-kvm disable KVM acceleration support" 1056b31a0277SJuan Quintelaecho " --enable-kvm enable KVM acceleration support" 10579195b2c2SStefan Weilecho " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" 1058bd0c5661Spbrookecho " --disable-nptl disable usermode NPTL support" 1059e5934d33SAndre Przywaraecho " --enable-nptl enable usermode NPTL support" 1060af5db58eSpbrookecho " --enable-system enable all system emulation targets" 1061af5db58eSpbrookecho " --disable-system disable all system emulation targets" 10620953a80fSZachary Amsdenecho " --enable-user enable supported user emulation targets" 10630953a80fSZachary Amsdenecho " --disable-user disable all user emulation targets" 1064831b7825Sthsecho " --enable-linux-user enable all linux usermode emulation targets" 1065831b7825Sthsecho " --disable-linux-user disable all linux usermode emulation targets" 106684778508Sblueswir1echo " --enable-bsd-user enable all BSD usermode emulation targets" 106784778508Sblueswir1echo " --disable-bsd-user disable all BSD usermode emulation targets" 1068379f6698SPaul Brookecho " --enable-guest-base enable GUEST_BASE support for usermode" 1069379f6698SPaul Brookecho " emulation targets" 1070379f6698SPaul Brookecho " --disable-guest-base disable GUEST_BASE support" 107140d6444eSAvi Kivityecho " --enable-pie build Position Independent Executables" 107240d6444eSAvi Kivityecho " --disable-pie do not build Position Independent Executables" 1073af5db58eSpbrookecho " --fmod-lib path to FMOD library" 1074af5db58eSpbrookecho " --fmod-inc path to FMOD includes" 10752f6a1ab0Sblueswir1echo " --oss-lib path to OSS library" 1076c5937220Spbrookecho " --enable-uname-release=R Return R for uname -r in usermode emulation" 1077235e510cS陳韋任echo " --cpu=CPU Build for host CPU [$cpu]" 10783142255cSblueswir1echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" 1079ee682d27SStefan Weilecho " --disable-uuid disable uuid support" 1080ee682d27SStefan Weilecho " --enable-uuid enable uuid support" 1081e0e6c8c0Saliguoriecho " --disable-vde disable support for vde network" 1082dfb278bdSJuan Quintelaecho " --enable-vde enable support for vde network" 10835c6c3a6cSChristoph Hellwigecho " --disable-linux-aio disable Linux AIO support" 10845c6c3a6cSChristoph Hellwigecho " --enable-linux-aio enable Linux AIO support" 108547e98658SCorey Bryantecho " --disable-cap-ng disable libcap-ng support" 108647e98658SCorey Bryantecho " --enable-cap-ng enable libcap-ng support" 1087758e8e38SVenkateswararao Jujjuri (JV)echo " --disable-attr disables attr and xattr support" 1088758e8e38SVenkateswararao Jujjuri (JV)echo " --enable-attr enable attr and xattr support" 108977755340Sthsecho " --disable-blobs disable installing provided firmware blobs" 1090d2807bc9SDirk Ullrichecho " --enable-docs enable documentation build" 1091d2807bc9SDirk Ullrichecho " --disable-docs disable documentation build" 1092d5970055SMichael S. Tsirkinecho " --disable-vhost-net disable vhost-net acceleration support" 1093d5970055SMichael S. Tsirkinecho " --enable-vhost-net enable vhost-net acceleration support" 1094320fba2aSFabien Chouteauecho " --enable-trace-backend=B Set trace backend" 1095650ab98dSLluís Vilanovaecho " Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends) 109674242e0fSPaolo Bonziniecho " --with-trace-file=NAME Full PATH,NAME of file to store traces" 10979410b56cSPrerna Saxenaecho " Default:trace-<pid>" 1098cd4ec0b4SGerd Hoffmannecho " --disable-spice disable spice" 1099cd4ec0b4SGerd Hoffmannecho " --enable-spice enable spice" 1100f27aaf4bSChristian Brunnerecho " --enable-rbd enable building the rados block device (rbd)" 1101c589b249SRonnie Sahlbergecho " --disable-libiscsi disable iscsi support" 1102c589b249SRonnie Sahlbergecho " --enable-libiscsi enable iscsi support" 110336707144SAlon Levyecho " --disable-smartcard disable smartcard support" 110436707144SAlon Levyecho " --enable-smartcard enable smartcard support" 1105111a38b0SRobert Relyeaecho " --disable-smartcard-nss disable smartcard nss support" 1106111a38b0SRobert Relyeaecho " --enable-smartcard-nss enable smartcard nss support" 110769354a83SHans de Goedeecho " --disable-usb-redir disable usb network redirection support" 110869354a83SHans de Goedeecho " --enable-usb-redir enable usb network redirection support" 1109d138cee9SMichael Rothecho " --disable-guest-agent disable building of the QEMU Guest Agent" 1110d138cee9SMichael Rothecho " --enable-guest-agent enable building of the QEMU Guest Agent" 1111519175a2SAlex Barceloecho " --with-coroutine=BACKEND coroutine backend. Supported options:" 1112fe91bfa8SAlex Barceloecho " gthread, ucontext, sigaltstack, windows" 1113af5db58eSpbrookecho "" 11145bf08934Sthsecho "NOTE: The object files are built at the place where configure is launched" 1115af5db58eSpbrookexit 1 1116af5db58eSpbrookfi 1117af5db58eSpbrook 1118359bc95dSPeter Maydell# Now we have handled --enable-tcg-interpreter and know we're not just 1119359bc95dSPeter Maydell# printing the help message, bail out if the host CPU isn't supported. 1120359bc95dSPeter Maydellif test "$ARCH" = "unknown"; then 1121359bc95dSPeter Maydell if test "$tcg_interpreter" = "yes" ; then 1122359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)" 1123359bc95dSPeter Maydell ARCH=tci 1124359bc95dSPeter Maydell else 1125359bc95dSPeter Maydell echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter" 1126359bc95dSPeter Maydell exit 1 1127359bc95dSPeter Maydell fi 1128359bc95dSPeter Maydellfi 1129359bc95dSPeter Maydell 11308d05095cSPaolo Bonzini# check that the C compiler works. 11318d05095cSPaolo Bonzinicat > $TMPC <<EOF 113275cafad7SStefan Weilint main(void) { return 0; } 11338d05095cSPaolo BonziniEOF 11348d05095cSPaolo Bonzini 11358d05095cSPaolo Bonziniif compile_object ; then 11368d05095cSPaolo Bonzini : C compiler works ok 11378d05095cSPaolo Bonzinielse 11388d05095cSPaolo Bonzini echo "ERROR: \"$cc\" either does not exist or does not work" 11398d05095cSPaolo Bonzini exit 1 11408d05095cSPaolo Bonzinifi 11418d05095cSPaolo Bonzini 11428d05095cSPaolo Bonzinigcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" 11438d05095cSPaolo Bonzinigcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" 11448d05095cSPaolo Bonzinigcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" 1145f9188227SMike Frysingergcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags" 11468d05095cSPaolo Bonzinicat > $TMPC << EOF 11478d05095cSPaolo Bonziniint main(void) { return 0; } 11488d05095cSPaolo BonziniEOF 11498d05095cSPaolo Bonzinifor flag in $gcc_flags; do 1150bd947d30SStefan Weil if compile_prog "-Werror $flag" "" ; then 11518d05095cSPaolo Bonzini QEMU_CFLAGS="$QEMU_CFLAGS $flag" 11528d05095cSPaolo Bonzini fi 11538d05095cSPaolo Bonzinidone 11548d05095cSPaolo Bonzini 115540d6444eSAvi Kivityif test "$static" = "yes" ; then 115640d6444eSAvi Kivity if test "$pie" = "yes" ; then 115740d6444eSAvi Kivity echo "static and pie are mutually incompatible" 115840d6444eSAvi Kivity exit 1 115940d6444eSAvi Kivity else 116040d6444eSAvi Kivity pie="no" 116140d6444eSAvi Kivity fi 116240d6444eSAvi Kivityfi 116340d6444eSAvi Kivity 116440d6444eSAvi Kivityif test "$pie" = ""; then 116540d6444eSAvi Kivity case "$cpu-$targetos" in 1166f9db31a2SBrad i386-Linux|x86_64-Linux|i386-OpenBSD|x86_64-OpenBSD) 116740d6444eSAvi Kivity ;; 116840d6444eSAvi Kivity *) 116940d6444eSAvi Kivity pie="no" 117040d6444eSAvi Kivity ;; 117140d6444eSAvi Kivity esac 117240d6444eSAvi Kivityfi 117340d6444eSAvi Kivity 117440d6444eSAvi Kivityif test "$pie" != "no" ; then 117540d6444eSAvi Kivity cat > $TMPC << EOF 117621d4a791SAvi Kivity 117721d4a791SAvi Kivity#ifdef __linux__ 117821d4a791SAvi Kivity# define THREAD __thread 117921d4a791SAvi Kivity#else 118021d4a791SAvi Kivity# define THREAD 118121d4a791SAvi Kivity#endif 118221d4a791SAvi Kivity 118321d4a791SAvi Kivitystatic THREAD int tls_var; 118421d4a791SAvi Kivity 118521d4a791SAvi Kivityint main(void) { return tls_var; } 118621d4a791SAvi Kivity 118740d6444eSAvi KivityEOF 118840d6444eSAvi Kivity if compile_prog "-fPIE -DPIE" "-pie"; then 118940d6444eSAvi Kivity QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS" 119040d6444eSAvi Kivity LDFLAGS="-pie $LDFLAGS" 119140d6444eSAvi Kivity pie="yes" 119240d6444eSAvi Kivity if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then 119340d6444eSAvi Kivity LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS" 119440d6444eSAvi Kivity fi 119540d6444eSAvi Kivity else 119640d6444eSAvi Kivity if test "$pie" = "yes"; then 119740d6444eSAvi Kivity echo "PIE not available due to missing toolchain support" 119840d6444eSAvi Kivity exit 1 119940d6444eSAvi Kivity else 120040d6444eSAvi Kivity echo "Disabling PIE due to missing toolchain support" 120140d6444eSAvi Kivity pie="no" 120240d6444eSAvi Kivity fi 120340d6444eSAvi Kivity fi 120440d6444eSAvi Kivityfi 120540d6444eSAvi Kivity 1206ec530c81Sbellard# 1207ec530c81Sbellard# Solaris specific configure tool chain decisions 1208ec530c81Sbellard# 1209ec530c81Sbellardif test "$solaris" = "yes" ; then 12106792aa11SLoïc Minier if has $install; then 12116792aa11SLoïc Minier : 12126792aa11SLoïc Minier else 1213ec530c81Sbellard echo "Solaris install program not found. Use --install=/usr/ucb/install or" 1214ec530c81Sbellard echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" 1215ec530c81Sbellard echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" 1216ec530c81Sbellard exit 1 1217ec530c81Sbellard fi 12186792aa11SLoïc Minier if test "`path_of $install`" = "/usr/sbin/install" ; then 1219ec530c81Sbellard echo "Error: Solaris /usr/sbin/install is not an appropriate install program." 1220ec530c81Sbellard echo "try ginstall from the GNU fileutils available from www.blastwave.org" 1221ec530c81Sbellard echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" 1222ec530c81Sbellard exit 1 1223ec530c81Sbellard fi 12246792aa11SLoïc Minier if has ar; then 12256792aa11SLoïc Minier : 12266792aa11SLoïc Minier else 1227ec530c81Sbellard echo "Error: No path includes ar" 1228ec530c81Sbellard if test -f /usr/ccs/bin/ar ; then 1229ec530c81Sbellard echo "Add /usr/ccs/bin to your path and rerun configure" 1230ec530c81Sbellard fi 1231ec530c81Sbellard exit 1 1232ec530c81Sbellard fi 1233ec530c81Sbellardfi 1234ec530c81Sbellard 12357a3fc891SSebastian Herbsztif ! has $python; then 1236c886edfbSBlue Swirl echo "Python not found. Use --python=/path/to/python" 1237c886edfbSBlue Swirl exit 1 1238c886edfbSBlue Swirlfi 1239c886edfbSBlue Swirl 12406ccea1e4SPeter Maydell# Note that if the Python conditional here evaluates True we will exit 12416ccea1e4SPeter Maydell# with status 1 which is a shell 'false' value. 1242e120d449SStefan Hajnocziif ! "$python" -c 'import sys; sys.exit(sys.version_info < (2,4) or sys.version_info >= (3,))'; then 1243e120d449SStefan Hajnoczi echo "Cannot use '$python', Python 2.4 or later is required." 1244e120d449SStefan Hajnoczi echo "Note that Python 3 or later is not yet supported." 1245e120d449SStefan Hajnoczi echo "Use --python=/path/to/python to specify a supported Python." 12466ccea1e4SPeter Maydell exit 1 12476ccea1e4SPeter Maydellfi 12486ccea1e4SPeter Maydell 12495327cf48Sbellardif test -z "$target_list" ; then 125060e0df25SPeter Maydell target_list="$default_target_list" 12516e20a45fSbellardelse 1252b1a550a0Spbrook target_list=`echo "$target_list" | sed -e 's/,/ /g'` 12535327cf48Sbellardfi 12540a8e90f4Spbrookif test -z "$target_list" ; then 12550a8e90f4Spbrook echo "No targets enabled" 12560a8e90f4Spbrook exit 1 12570a8e90f4Spbrookfi 1258f55fe278SPaolo Bonzini# see if system emulation was really requested 1259f55fe278SPaolo Bonzinicase " $target_list " in 1260f55fe278SPaolo Bonzini *"-softmmu "*) softmmu=yes 1261f55fe278SPaolo Bonzini ;; 1262f55fe278SPaolo Bonzini *) softmmu=no 1263f55fe278SPaolo Bonzini ;; 1264f55fe278SPaolo Bonziniesac 12655327cf48Sbellard 1266249247c9SJuan Quintelafeature_not_found() { 1267249247c9SJuan Quintela feature=$1 1268249247c9SJuan Quintela 1269249247c9SJuan Quintela echo "ERROR" 1270249247c9SJuan Quintela echo "ERROR: User requested feature $feature" 12719332f6a2SSebastian Herbszt echo "ERROR: configure was not able to find it" 1272249247c9SJuan Quintela echo "ERROR" 1273249247c9SJuan Quintela exit 1; 1274249247c9SJuan Quintela} 1275249247c9SJuan Quintela 12767d13299dSbellardif test -z "$cross_prefix" ; then 12777d13299dSbellard 12787d13299dSbellard# --- 12797d13299dSbellard# big/little endian test 12807d13299dSbellardcat > $TMPC << EOF 12817d13299dSbellard#include <inttypes.h> 12827d13299dSbellardint main(int argc, char ** argv){ 12837d13299dSbellard volatile uint32_t i=0x01234567; 12847d13299dSbellard return (*((uint8_t*)(&i))) == 0x67; 12857d13299dSbellard} 12867d13299dSbellardEOF 12877d13299dSbellard 128852166aa0SJuan Quintelaif compile_prog "" "" ; then 12897d13299dSbellard$TMPE && bigendian="yes" 12907d13299dSbellardelse 12917d13299dSbellardecho big/little test failed 12927d13299dSbellardfi 12937d13299dSbellard 12947d13299dSbellardelse 12957d13299dSbellard 12967d13299dSbellard# if cross compiling, cannot launch a program, so make a static guess 1297ea8f20f8SJuan Quintelacase "$cpu" in 129821d89f84SPeter Maydell arm) 129921d89f84SPeter Maydell # ARM can be either way; ask the compiler which one we are 130021d89f84SPeter Maydell if check_define __ARMEB__; then 130121d89f84SPeter Maydell bigendian=yes 130221d89f84SPeter Maydell fi 130321d89f84SPeter Maydell ;; 130421d89f84SPeter Maydell hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64) 1305ea8f20f8SJuan Quintela bigendian=yes 1306ea8f20f8SJuan Quintela ;; 1307ea8f20f8SJuan Quintelaesac 13087d13299dSbellard 13097d13299dSbellardfi 13107d13299dSbellard 1311b0a47e79SJuan Quintela########################################## 1312b0a47e79SJuan Quintela# NPTL probe 1313b0a47e79SJuan Quintela 1314b0a47e79SJuan Quintelaif test "$nptl" != "no" ; then 1315bd0c5661Spbrook cat > $TMPC <<EOF 1316bd0c5661Spbrook#include <sched.h> 131730813ceaSpbrook#include <linux/futex.h> 1318182eacc0SStefan Weilint main(void) { 1319bd0c5661Spbrook#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) 1320bd0c5661Spbrook#error bork 1321bd0c5661Spbrook#endif 1322182eacc0SStefan Weil return 0; 1323bd0c5661Spbrook} 1324bd0c5661SpbrookEOF 1325bd0c5661Spbrook 132652166aa0SJuan Quintela if compile_object ; then 1327b0a47e79SJuan Quintela nptl=yes 1328bd0c5661Spbrook else 1329b0a47e79SJuan Quintela if test "$nptl" = "yes" ; then 1330b0a47e79SJuan Quintela feature_not_found "nptl" 1331b0a47e79SJuan Quintela fi 1332b0a47e79SJuan Quintela nptl=no 1333b0a47e79SJuan Quintela fi 1334bd0c5661Spbrookfi 1335bd0c5661Spbrook 133611d9f695Sbellard########################################## 1337ac62922eSbalrog# zlib check 1338ac62922eSbalrog 13391ece9905SAlon Levyif test "$zlib" != "no" ; then 1340ac62922eSbalrog cat > $TMPC << EOF 1341ac62922eSbalrog#include <zlib.h> 1342ac62922eSbalrogint main(void) { zlibVersion(); return 0; } 1343ac62922eSbalrogEOF 134452166aa0SJuan Quintela if compile_prog "" "-lz" ; then 1345ac62922eSbalrog : 1346ac62922eSbalrog else 1347ac62922eSbalrog echo 1348ac62922eSbalrog echo "Error: zlib check failed" 1349ac62922eSbalrog echo "Make sure to have the zlib libs and headers installed." 1350ac62922eSbalrog echo 1351ac62922eSbalrog exit 1 1352ac62922eSbalrog fi 13531ece9905SAlon Levyfi 1354ac62922eSbalrog 1355ac62922eSbalrog########################################## 1356e37630caSaliguori# xen probe 1357e37630caSaliguori 1358fc321b4bSJuan Quintelaif test "$xen" != "no" ; then 1359b2266beeSJuan Quintela xen_libs="-lxenstore -lxenctrl -lxenguest" 1360d5b93ddfSAnthony PERARD 136150ced5b3SStefan Weil # First we test whether Xen headers and libraries are available. 136250ced5b3SStefan Weil # If no, we are done and there is no Xen support. 136350ced5b3SStefan Weil # If yes, more tests are run to detect the Xen version. 136450ced5b3SStefan Weil 136550ced5b3SStefan Weil # Xen (any) 136650ced5b3SStefan Weil cat > $TMPC <<EOF 136750ced5b3SStefan Weil#include <xenctrl.h> 136850ced5b3SStefan Weil#include <xs.h> 136950ced5b3SStefan Weilint main(void) { 137050ced5b3SStefan Weil return 0; 137150ced5b3SStefan Weil} 137250ced5b3SStefan WeilEOF 137350ced5b3SStefan Weil if ! compile_prog "" "$xen_libs" ; then 137450ced5b3SStefan Weil # Xen not found 137550ced5b3SStefan Weil if test "$xen" = "yes" ; then 137650ced5b3SStefan Weil feature_not_found "xen" 137750ced5b3SStefan Weil fi 137850ced5b3SStefan Weil xen=no 137950ced5b3SStefan Weil 1380d5b93ddfSAnthony PERARD # Xen unstable 138150ced5b3SStefan Weil elif ( 1382e37630caSaliguori cat > $TMPC <<EOF 1383e37630caSaliguori#include <xenctrl.h> 1384e37630caSaliguori#include <xs.h> 1385d5b93ddfSAnthony PERARD#include <stdint.h> 1386d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1387d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1388d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1389d5b93ddfSAnthony PERARD#endif 1390d5b93ddfSAnthony PERARDint main(void) { 1391d5b93ddfSAnthony PERARD xc_interface *xc; 1392d5b93ddfSAnthony PERARD xs_daemon_open(); 1393d5b93ddfSAnthony PERARD xc = xc_interface_open(0, 0, 0); 1394d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1395d5b93ddfSAnthony PERARD xc_gnttab_open(NULL, 0); 1396b87de24eSAnthony PERARD xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 13978688e065SStefano Stabellini xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); 13988688e065SStefano Stabellini return 0; 13998688e065SStefano Stabellini} 14008688e065SStefano StabelliniEOF 14018688e065SStefano Stabellini compile_prog "" "$xen_libs" 14028688e065SStefano Stabellini ) ; then 14038688e065SStefano Stabellini xen_ctrl_version=420 14048688e065SStefano Stabellini xen=yes 14058688e065SStefano Stabellini 14068688e065SStefano Stabellini elif ( 14078688e065SStefano Stabellini cat > $TMPC <<EOF 14088688e065SStefano Stabellini#include <xenctrl.h> 14098688e065SStefano Stabellini#include <xs.h> 14108688e065SStefano Stabellini#include <stdint.h> 14118688e065SStefano Stabellini#include <xen/hvm/hvm_info_table.h> 14128688e065SStefano Stabellini#if !defined(HVM_MAX_VCPUS) 14138688e065SStefano Stabellini# error HVM_MAX_VCPUS not defined 14148688e065SStefano Stabellini#endif 14158688e065SStefano Stabelliniint main(void) { 14168688e065SStefano Stabellini xc_interface *xc; 14178688e065SStefano Stabellini xs_daemon_open(); 14188688e065SStefano Stabellini xc = xc_interface_open(0, 0, 0); 14198688e065SStefano Stabellini xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 14208688e065SStefano Stabellini xc_gnttab_open(NULL, 0); 14218688e065SStefano Stabellini xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); 1422d5b93ddfSAnthony PERARD return 0; 1423d5b93ddfSAnthony PERARD} 1424e37630caSaliguoriEOF 142550ced5b3SStefan Weil compile_prog "" "$xen_libs" 142650ced5b3SStefan Weil ) ; then 1427d5b93ddfSAnthony PERARD xen_ctrl_version=410 1428fc321b4bSJuan Quintela xen=yes 1429d5b93ddfSAnthony PERARD 1430d5b93ddfSAnthony PERARD # Xen 4.0.0 1431d5b93ddfSAnthony PERARD elif ( 1432d5b93ddfSAnthony PERARD cat > $TMPC <<EOF 1433d5b93ddfSAnthony PERARD#include <xenctrl.h> 1434d5b93ddfSAnthony PERARD#include <xs.h> 1435d5b93ddfSAnthony PERARD#include <stdint.h> 1436d5b93ddfSAnthony PERARD#include <xen/hvm/hvm_info_table.h> 1437d5b93ddfSAnthony PERARD#if !defined(HVM_MAX_VCPUS) 1438d5b93ddfSAnthony PERARD# error HVM_MAX_VCPUS not defined 1439d5b93ddfSAnthony PERARD#endif 1440d5b93ddfSAnthony PERARDint main(void) { 1441b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1442b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1443b87de24eSAnthony PERARD }; 1444d5b93ddfSAnthony PERARD xs_daemon_open(); 1445d5b93ddfSAnthony PERARD xc_interface_open(); 1446d5b93ddfSAnthony PERARD xc_gnttab_open(); 1447d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1448b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1449d5b93ddfSAnthony PERARD return 0; 1450d5b93ddfSAnthony PERARD} 1451d5b93ddfSAnthony PERARDEOF 1452d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 1453d5b93ddfSAnthony PERARD ) ; then 1454d5b93ddfSAnthony PERARD xen_ctrl_version=400 1455d5b93ddfSAnthony PERARD xen=yes 1456d5b93ddfSAnthony PERARD 1457b87de24eSAnthony PERARD # Xen 3.4.0 1458b87de24eSAnthony PERARD elif ( 1459b87de24eSAnthony PERARD cat > $TMPC <<EOF 1460b87de24eSAnthony PERARD#include <xenctrl.h> 1461b87de24eSAnthony PERARD#include <xs.h> 1462b87de24eSAnthony PERARDint main(void) { 1463b87de24eSAnthony PERARD struct xen_add_to_physmap xatp = { 1464b87de24eSAnthony PERARD .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0, 1465b87de24eSAnthony PERARD }; 1466b87de24eSAnthony PERARD xs_daemon_open(); 1467b87de24eSAnthony PERARD xc_interface_open(); 1468b87de24eSAnthony PERARD xc_gnttab_open(); 1469b87de24eSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1470b87de24eSAnthony PERARD xc_memory_op(0, XENMEM_add_to_physmap, &xatp); 1471b87de24eSAnthony PERARD return 0; 1472b87de24eSAnthony PERARD} 1473b87de24eSAnthony PERARDEOF 1474b87de24eSAnthony PERARD compile_prog "" "$xen_libs" 1475b87de24eSAnthony PERARD ) ; then 1476b87de24eSAnthony PERARD xen_ctrl_version=340 1477b87de24eSAnthony PERARD xen=yes 1478b87de24eSAnthony PERARD 1479b87de24eSAnthony PERARD # Xen 3.3.0 1480d5b93ddfSAnthony PERARD elif ( 1481d5b93ddfSAnthony PERARD cat > $TMPC <<EOF 1482d5b93ddfSAnthony PERARD#include <xenctrl.h> 1483d5b93ddfSAnthony PERARD#include <xs.h> 1484d5b93ddfSAnthony PERARDint main(void) { 1485d5b93ddfSAnthony PERARD xs_daemon_open(); 1486d5b93ddfSAnthony PERARD xc_interface_open(); 1487d5b93ddfSAnthony PERARD xc_gnttab_open(); 1488d5b93ddfSAnthony PERARD xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); 1489d5b93ddfSAnthony PERARD return 0; 1490d5b93ddfSAnthony PERARD} 1491d5b93ddfSAnthony PERARDEOF 1492d5b93ddfSAnthony PERARD compile_prog "" "$xen_libs" 1493d5b93ddfSAnthony PERARD ) ; then 1494d5b93ddfSAnthony PERARD xen_ctrl_version=330 1495d5b93ddfSAnthony PERARD xen=yes 1496d5b93ddfSAnthony PERARD 149750ced5b3SStefan Weil # Xen version unsupported 1498e37630caSaliguori else 1499fc321b4bSJuan Quintela if test "$xen" = "yes" ; then 150050ced5b3SStefan Weil feature_not_found "xen (unsupported version)" 1501fc321b4bSJuan Quintela fi 1502fc321b4bSJuan Quintela xen=no 1503e37630caSaliguori fi 1504d5b93ddfSAnthony PERARD 1505d5b93ddfSAnthony PERARD if test "$xen" = yes; then 1506d5b93ddfSAnthony PERARD libs_softmmu="$xen_libs $libs_softmmu" 1507d5b93ddfSAnthony PERARD fi 1508e37630caSaliguorifi 1509e37630caSaliguori 1510e37630caSaliguori########################################## 1511a8bd70adSPaolo Bonzini# pkg-config probe 1512f91672e5SPaolo Bonzini 151317884d7bSSergei Trofimovichif ! has "$pkg_config_exe"; then 151417884d7bSSergei Trofimovich echo "Error: pkg-config binary '$pkg_config_exe' not found" 1515a213fcb2SPeter Maydell exit 1 1516f91672e5SPaolo Bonzinifi 1517f91672e5SPaolo Bonzini 1518f91672e5SPaolo Bonzini########################################## 151944dc0ca3SAlon Levy# libtool probe 152044dc0ca3SAlon Levy 15213f534581SBradif ! has $libtool; then 152244dc0ca3SAlon Levy libtool= 152344dc0ca3SAlon Levyfi 152444dc0ca3SAlon Levy 152544dc0ca3SAlon Levy########################################## 1526dfffc653SJuan Quintela# Sparse probe 1527dfffc653SJuan Quintelaif test "$sparse" != "no" ; then 15280dba6195SLoïc Minier if has cgcc; then 1529dfffc653SJuan Quintela sparse=yes 1530dfffc653SJuan Quintela else 1531dfffc653SJuan Quintela if test "$sparse" = "yes" ; then 1532dfffc653SJuan Quintela feature_not_found "sparse" 1533dfffc653SJuan Quintela fi 1534dfffc653SJuan Quintela sparse=no 1535dfffc653SJuan Quintela fi 1536dfffc653SJuan Quintelafi 1537dfffc653SJuan Quintela 1538dfffc653SJuan Quintela########################################## 153911d9f695Sbellard# SDL probe 154011d9f695Sbellard 15413ec87ffeSPaolo Bonzini# Look for sdl configuration program (pkg-config or sdl-config). Try 15423ec87ffeSPaolo Bonzini# sdl-config even without cross prefix, and favour pkg-config over sdl-config. 15433ec87ffeSPaolo Bonziniif test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then 15443ec87ffeSPaolo Bonzini sdl_config=sdl-config 15453ec87ffeSPaolo Bonzinifi 15463ec87ffeSPaolo Bonzini 15473ec87ffeSPaolo Bonziniif $pkg_config sdl --modversion >/dev/null 2>&1; then 1548a8bd70adSPaolo Bonzini sdlconfig="$pkg_config sdl" 1549fec0e3e8SStefan Weil _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'` 15503ec87ffeSPaolo Bonzinielif has ${sdl_config}; then 15513ec87ffeSPaolo Bonzini sdlconfig="$sdl_config" 15529316f803SPaolo Bonzini _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'` 1553a0dfd8a4SLoïc Minierelse 1554a0dfd8a4SLoïc Minier if test "$sdl" = "yes" ; then 1555a0dfd8a4SLoïc Minier feature_not_found "sdl" 1556a0dfd8a4SLoïc Minier fi 1557a0dfd8a4SLoïc Minier sdl=no 15589316f803SPaolo Bonzinifi 155929e5badaSScott Woodif test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then 15603ec87ffeSPaolo Bonzini echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 15613ec87ffeSPaolo Bonzinifi 156211d9f695Sbellard 15639316f803SPaolo Bonzinisdl_too_old=no 1564c4198157SJuan Quintelaif test "$sdl" != "no" ; then 156511d9f695Sbellard cat > $TMPC << EOF 156611d9f695Sbellard#include <SDL.h> 156711d9f695Sbellard#undef main /* We don't want SDL to override our main() */ 156811d9f695Sbellardint main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 156911d9f695SbellardEOF 15709316f803SPaolo Bonzini sdl_cflags=`$sdlconfig --cflags 2> /dev/null` 157174f42e18STeLeMan if test "$static" = "yes" ; then 157274f42e18STeLeMan sdl_libs=`$sdlconfig --static-libs 2>/dev/null` 157374f42e18STeLeMan else 15749316f803SPaolo Bonzini sdl_libs=`$sdlconfig --libs 2> /dev/null` 157574f42e18STeLeMan fi 157652166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 157711d9f695Sbellard if test "$_sdlversion" -lt 121 ; then 157811d9f695Sbellard sdl_too_old=yes 157911d9f695Sbellard else 1580fd677642Sths if test "$cocoa" = "no" ; then 158111d9f695Sbellard sdl=yes 158211d9f695Sbellard fi 1583fd677642Sths fi 15847c1f25b4Sbellard 158567c274d3SPaolo Bonzini # static link with sdl ? (note: sdl.pc's --static --libs is broken) 15861ac88f28SJuan Quintela if test "$sdl" = "yes" -a "$static" = "yes" ; then 158767c274d3SPaolo Bonzini if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then 1588f8aa6c7bSStefan Weil sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`" 1589f8aa6c7bSStefan Weil sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`" 159011d9f695Sbellard fi 159152166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 15921ac88f28SJuan Quintela : 15931ac88f28SJuan Quintela else 15941ac88f28SJuan Quintela sdl=no 15957c1f25b4Sbellard fi 15967c1f25b4Sbellard fi # static link 1597c4198157SJuan Quintela else # sdl not found 1598c4198157SJuan Quintela if test "$sdl" = "yes" ; then 1599c4198157SJuan Quintela feature_not_found "sdl" 1600c4198157SJuan Quintela fi 1601c4198157SJuan Quintela sdl=no 16027c1f25b4Sbellard fi # sdl compile test 1603fd677642Sthsfi 160411d9f695Sbellard 16055368a422Saliguoriif test "$sdl" = "yes" ; then 16065368a422Saliguori cat > $TMPC <<EOF 16075368a422Saliguori#include <SDL.h> 16085368a422Saliguori#if defined(SDL_VIDEO_DRIVER_X11) 16095368a422Saliguori#include <X11/XKBlib.h> 16105368a422Saliguori#else 16115368a422Saliguori#error No x11 support 16125368a422Saliguori#endif 16135368a422Saliguoriint main(void) { return 0; } 16145368a422SaliguoriEOF 161552166aa0SJuan Quintela if compile_prog "$sdl_cflags" "$sdl_libs" ; then 1616681306dfSJuan Quintela sdl_libs="$sdl_libs -lX11" 16175368a422Saliguori fi 16180705667eSJuan Quintela libs_softmmu="$sdl_libs $libs_softmmu" 16195368a422Saliguorifi 16205368a422Saliguori 16218f28f3fbSths########################################## 16228d5d2d4cSths# VNC TLS detection 1623821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then 1624ae6b5e5aSaliguori cat > $TMPC <<EOF 1625ae6b5e5aSaliguori#include <gnutls/gnutls.h> 1626ae6b5e5aSaliguoriint main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } 1627ae6b5e5aSaliguoriEOF 1628a8bd70adSPaolo Bonzini vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null` 1629a8bd70adSPaolo Bonzini vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null` 163052166aa0SJuan Quintela if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then 16311be10ad2SJuan Quintela vnc_tls=yes 1632a5e32cc9SJuan Quintela libs_softmmu="$vnc_tls_libs $libs_softmmu" 1633ae6b5e5aSaliguori else 16341be10ad2SJuan Quintela if test "$vnc_tls" = "yes" ; then 16351be10ad2SJuan Quintela feature_not_found "vnc-tls" 16361be10ad2SJuan Quintela fi 16371be10ad2SJuan Quintela vnc_tls=no 16388d5d2d4cSths fi 16398d5d2d4cSthsfi 16408d5d2d4cSths 16418d5d2d4cSths########################################## 16422f9606b3Saliguori# VNC SASL detection 1643821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then 16442f9606b3Saliguori cat > $TMPC <<EOF 16452f9606b3Saliguori#include <sasl/sasl.h> 16462f9606b3Saliguori#include <stdio.h> 16472f9606b3Saliguoriint main(void) { sasl_server_init(NULL, "qemu"); return 0; } 16482f9606b3SaliguoriEOF 16492f9606b3Saliguori # Assuming Cyrus-SASL installed in /usr prefix 16502f9606b3Saliguori vnc_sasl_cflags="" 16512f9606b3Saliguori vnc_sasl_libs="-lsasl2" 165252166aa0SJuan Quintela if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then 1653ea784e3bSJuan Quintela vnc_sasl=yes 1654fa838301SJuan Quintela libs_softmmu="$vnc_sasl_libs $libs_softmmu" 16552f9606b3Saliguori else 1656ea784e3bSJuan Quintela if test "$vnc_sasl" = "yes" ; then 1657ea784e3bSJuan Quintela feature_not_found "vnc-sasl" 1658ea784e3bSJuan Quintela fi 1659ea784e3bSJuan Quintela vnc_sasl=no 16602f9606b3Saliguori fi 16612f9606b3Saliguorifi 16622f9606b3Saliguori 16632f9606b3Saliguori########################################## 16642f6f5c7aSCorentin Chary# VNC JPEG detection 1665821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then 16662f6f5c7aSCorentin Charycat > $TMPC <<EOF 16672f6f5c7aSCorentin Chary#include <stdio.h> 16682f6f5c7aSCorentin Chary#include <jpeglib.h> 16692f6f5c7aSCorentin Charyint main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; } 16702f6f5c7aSCorentin CharyEOF 16712f6f5c7aSCorentin Chary vnc_jpeg_cflags="" 16722f6f5c7aSCorentin Chary vnc_jpeg_libs="-ljpeg" 16732f6f5c7aSCorentin Chary if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then 16742f6f5c7aSCorentin Chary vnc_jpeg=yes 16752f6f5c7aSCorentin Chary libs_softmmu="$vnc_jpeg_libs $libs_softmmu" 16762f6f5c7aSCorentin Chary else 16772f6f5c7aSCorentin Chary if test "$vnc_jpeg" = "yes" ; then 16782f6f5c7aSCorentin Chary feature_not_found "vnc-jpeg" 16792f6f5c7aSCorentin Chary fi 16802f6f5c7aSCorentin Chary vnc_jpeg=no 16812f6f5c7aSCorentin Chary fi 16822f6f5c7aSCorentin Charyfi 16832f6f5c7aSCorentin Chary 16842f6f5c7aSCorentin Chary########################################## 1685efe556adSCorentin Chary# VNC PNG detection 1686821601eaSJes Sorensenif test "$vnc" = "yes" -a "$vnc_png" != "no" ; then 1687efe556adSCorentin Charycat > $TMPC <<EOF 1688efe556adSCorentin Chary//#include <stdio.h> 1689efe556adSCorentin Chary#include <png.h> 1690832ce9c2SScott Wood#include <stddef.h> 1691efe556adSCorentin Charyint main(void) { 1692efe556adSCorentin Chary png_structp png_ptr; 1693efe556adSCorentin Chary png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 1694efe556adSCorentin Chary return 0; 1695efe556adSCorentin Chary} 1696efe556adSCorentin CharyEOF 16979af8025eSBrad if $pkg_config libpng --modversion >/dev/null 2>&1; then 16989af8025eSBrad vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` 16999af8025eSBrad vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` 17009af8025eSBrad else 1701efe556adSCorentin Chary vnc_png_cflags="" 1702efe556adSCorentin Chary vnc_png_libs="-lpng" 17039af8025eSBrad fi 1704efe556adSCorentin Chary if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then 1705efe556adSCorentin Chary vnc_png=yes 1706efe556adSCorentin Chary libs_softmmu="$vnc_png_libs $libs_softmmu" 17079af8025eSBrad QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" 1708efe556adSCorentin Chary else 1709efe556adSCorentin Chary if test "$vnc_png" = "yes" ; then 1710efe556adSCorentin Chary feature_not_found "vnc-png" 1711efe556adSCorentin Chary fi 1712efe556adSCorentin Chary vnc_png=no 1713efe556adSCorentin Chary fi 1714efe556adSCorentin Charyfi 1715efe556adSCorentin Chary 1716efe556adSCorentin Chary########################################## 171776655d6dSaliguori# fnmatch() probe, used for ACL routines 171876655d6dSaliguorifnmatch="no" 171976655d6dSaliguoricat > $TMPC << EOF 172076655d6dSaliguori#include <fnmatch.h> 172176655d6dSaliguoriint main(void) 172276655d6dSaliguori{ 172376655d6dSaliguori fnmatch("foo", "foo", 0); 172476655d6dSaliguori return 0; 172576655d6dSaliguori} 172676655d6dSaliguoriEOF 172752166aa0SJuan Quintelaif compile_prog "" "" ; then 172876655d6dSaliguori fnmatch="yes" 172976655d6dSaliguorifi 173076655d6dSaliguori 173176655d6dSaliguori########################################## 1732ee682d27SStefan Weil# uuid_generate() probe, used for vdi block driver 1733ee682d27SStefan Weilif test "$uuid" != "no" ; then 1734ee682d27SStefan Weil uuid_libs="-luuid" 1735ee682d27SStefan Weil cat > $TMPC << EOF 1736ee682d27SStefan Weil#include <uuid/uuid.h> 1737ee682d27SStefan Weilint main(void) 1738ee682d27SStefan Weil{ 1739ee682d27SStefan Weil uuid_t my_uuid; 1740ee682d27SStefan Weil uuid_generate(my_uuid); 1741ee682d27SStefan Weil return 0; 1742ee682d27SStefan Weil} 1743ee682d27SStefan WeilEOF 1744ee682d27SStefan Weil if compile_prog "" "$uuid_libs" ; then 1745ee682d27SStefan Weil uuid="yes" 1746ee682d27SStefan Weil libs_softmmu="$uuid_libs $libs_softmmu" 1747ee682d27SStefan Weil libs_tools="$uuid_libs $libs_tools" 1748ee682d27SStefan Weil else 1749ee682d27SStefan Weil if test "$uuid" = "yes" ; then 1750ee682d27SStefan Weil feature_not_found "uuid" 1751ee682d27SStefan Weil fi 1752ee682d27SStefan Weil uuid=no 1753ee682d27SStefan Weil fi 1754ee682d27SStefan Weilfi 1755ee682d27SStefan Weil 1756ee682d27SStefan Weil########################################## 1757dce512deSChristoph Hellwig# xfsctl() probe, used for raw-posix 1758dce512deSChristoph Hellwigif test "$xfs" != "no" ; then 1759dce512deSChristoph Hellwig cat > $TMPC << EOF 1760ffc41d10SStefan Weil#include <stddef.h> /* NULL */ 1761dce512deSChristoph Hellwig#include <xfs/xfs.h> 1762dce512deSChristoph Hellwigint main(void) 1763dce512deSChristoph Hellwig{ 1764dce512deSChristoph Hellwig xfsctl(NULL, 0, 0, NULL); 1765dce512deSChristoph Hellwig return 0; 1766dce512deSChristoph Hellwig} 1767dce512deSChristoph HellwigEOF 1768dce512deSChristoph Hellwig if compile_prog "" "" ; then 1769dce512deSChristoph Hellwig xfs="yes" 1770dce512deSChristoph Hellwig else 1771dce512deSChristoph Hellwig if test "$xfs" = "yes" ; then 1772dce512deSChristoph Hellwig feature_not_found "xfs" 1773dce512deSChristoph Hellwig fi 1774dce512deSChristoph Hellwig xfs=no 1775dce512deSChristoph Hellwig fi 1776dce512deSChristoph Hellwigfi 1777dce512deSChristoph Hellwig 1778dce512deSChristoph Hellwig########################################## 17798a16d273Sths# vde libraries probe 1780dfb278bdSJuan Quintelaif test "$vde" != "no" ; then 17814baae0acSJuan Quintela vde_libs="-lvdeplug" 17828a16d273Sths cat > $TMPC << EOF 17838a16d273Sths#include <libvdeplug.h> 17844a7f0e06Spbrookint main(void) 17854a7f0e06Spbrook{ 17864a7f0e06Spbrook struct vde_open_args a = {0, 0, 0}; 17874a7f0e06Spbrook vde_open("", "", &a); 17884a7f0e06Spbrook return 0; 17894a7f0e06Spbrook} 17908a16d273SthsEOF 179152166aa0SJuan Quintela if compile_prog "" "$vde_libs" ; then 17924baae0acSJuan Quintela vde=yes 17938e02e54cSJuan Quintela libs_softmmu="$vde_libs $libs_softmmu" 17948e02e54cSJuan Quintela libs_tools="$vde_libs $libs_tools" 1795dfb278bdSJuan Quintela else 1796dfb278bdSJuan Quintela if test "$vde" = "yes" ; then 1797dfb278bdSJuan Quintela feature_not_found "vde" 1798dfb278bdSJuan Quintela fi 1799dfb278bdSJuan Quintela vde=no 18008a16d273Sths fi 18018a16d273Sthsfi 18028a16d273Sths 18038a16d273Sths########################################## 180447e98658SCorey Bryant# libcap-ng library probe 180547e98658SCorey Bryantif test "$cap_ng" != "no" ; then 180647e98658SCorey Bryant cap_libs="-lcap-ng" 180747e98658SCorey Bryant cat > $TMPC << EOF 180847e98658SCorey Bryant#include <cap-ng.h> 180947e98658SCorey Bryantint main(void) 181047e98658SCorey Bryant{ 181147e98658SCorey Bryant capng_capability_to_name(CAPNG_EFFECTIVE); 181247e98658SCorey Bryant return 0; 181347e98658SCorey Bryant} 181447e98658SCorey BryantEOF 181547e98658SCorey Bryant if compile_prog "" "$cap_libs" ; then 181647e98658SCorey Bryant cap_ng=yes 181747e98658SCorey Bryant libs_tools="$cap_libs $libs_tools" 181847e98658SCorey Bryant else 181947e98658SCorey Bryant if test "$cap_ng" = "yes" ; then 182047e98658SCorey Bryant feature_not_found "cap_ng" 182147e98658SCorey Bryant fi 182247e98658SCorey Bryant cap_ng=no 182347e98658SCorey Bryant fi 182447e98658SCorey Bryantfi 182547e98658SCorey Bryant 182647e98658SCorey Bryant########################################## 1827c2de5c91Smalc# Sound support libraries probe 18288f28f3fbSths 1829c2de5c91Smalcaudio_drv_probe() 1830c2de5c91Smalc{ 1831c2de5c91Smalc drv=$1 1832c2de5c91Smalc hdr=$2 1833c2de5c91Smalc lib=$3 1834c2de5c91Smalc exp=$4 1835c2de5c91Smalc cfl=$5 18368f28f3fbSths cat > $TMPC << EOF 1837c2de5c91Smalc#include <$hdr> 1838c2de5c91Smalcint main(void) { $exp } 18398f28f3fbSthsEOF 184052166aa0SJuan Quintela if compile_prog "$cfl" "$lib" ; then 18418f28f3fbSths : 18428f28f3fbSths else 18438f28f3fbSths echo 1844c2de5c91Smalc echo "Error: $drv check failed" 1845c2de5c91Smalc echo "Make sure to have the $drv libs and headers installed." 18468f28f3fbSths echo 18478f28f3fbSths exit 1 18488f28f3fbSths fi 1849c2de5c91Smalc} 1850c2de5c91Smalc 18512fa7d3bfSmalcaudio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` 1852c2de5c91Smalcfor drv in $audio_drv_list; do 1853c2de5c91Smalc case $drv in 1854c2de5c91Smalc alsa) 1855c2de5c91Smalc audio_drv_probe $drv alsa/asoundlib.h -lasound \ 1856c2de5c91Smalc "snd_pcm_t **handle; return snd_pcm_close(*handle);" 1857a4bf6780SJuan Quintela libs_softmmu="-lasound $libs_softmmu" 1858c2de5c91Smalc ;; 1859c2de5c91Smalc 1860c2de5c91Smalc fmod) 1861c2de5c91Smalc if test -z $fmod_lib || test -z $fmod_inc; then 1862c2de5c91Smalc echo 1863c2de5c91Smalc echo "Error: You must specify path to FMOD library and headers" 1864c2de5c91Smalc echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" 1865c2de5c91Smalc echo 1866c2de5c91Smalc exit 1 18678f28f3fbSths fi 1868c2de5c91Smalc audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" 1869a4bf6780SJuan Quintela libs_softmmu="$fmod_lib $libs_softmmu" 1870c2de5c91Smalc ;; 1871c2de5c91Smalc 1872c2de5c91Smalc esd) 1873c2de5c91Smalc audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' 1874a4bf6780SJuan Quintela libs_softmmu="-lesd $libs_softmmu" 187567f86e8eSJuan Quintela audio_pt_int="yes" 1876c2de5c91Smalc ;; 1877b8e59f18Smalc 1878b8e59f18Smalc pa) 1879a394aed2SMarc-André Lureau audio_drv_probe $drv pulse/mainloop.h "-lpulse" \ 1880a394aed2SMarc-André Lureau "pa_mainloop *m = 0; pa_mainloop_free (m); return 0;" 1881a394aed2SMarc-André Lureau libs_softmmu="-lpulse $libs_softmmu" 188267f86e8eSJuan Quintela audio_pt_int="yes" 1883b8e59f18Smalc ;; 1884b8e59f18Smalc 1885997e690aSJuan Quintela coreaudio) 1886997e690aSJuan Quintela libs_softmmu="-framework CoreAudio $libs_softmmu" 1887997e690aSJuan Quintela ;; 1888997e690aSJuan Quintela 1889a4bf6780SJuan Quintela dsound) 1890a4bf6780SJuan Quintela libs_softmmu="-lole32 -ldxguid $libs_softmmu" 1891d5631638Smalc audio_win_int="yes" 1892a4bf6780SJuan Quintela ;; 1893a4bf6780SJuan Quintela 1894a4bf6780SJuan Quintela oss) 1895a4bf6780SJuan Quintela libs_softmmu="$oss_lib $libs_softmmu" 1896a4bf6780SJuan Quintela ;; 1897a4bf6780SJuan Quintela 1898a4bf6780SJuan Quintela sdl|wav) 18992f6a1ab0Sblueswir1 # XXX: Probes for CoreAudio, DirectSound, SDL(?) 19002f6a1ab0Sblueswir1 ;; 19012f6a1ab0Sblueswir1 1902d5631638Smalc winwave) 1903d5631638Smalc libs_softmmu="-lwinmm $libs_softmmu" 1904d5631638Smalc audio_win_int="yes" 1905d5631638Smalc ;; 1906d5631638Smalc 1907e4c63a6aSmalc *) 19081c9b2a52Smalc echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { 1909e4c63a6aSmalc echo 1910e4c63a6aSmalc echo "Error: Unknown driver '$drv' selected" 1911e4c63a6aSmalc echo "Possible drivers are: $audio_possible_drivers" 1912e4c63a6aSmalc echo 1913e4c63a6aSmalc exit 1 1914e4c63a6aSmalc } 1915e4c63a6aSmalc ;; 1916c2de5c91Smalc esac 1917c2de5c91Smalcdone 19188f28f3fbSths 19194d3b6f6eSbalrog########################################## 19202e4d9fb1Saurel32# BrlAPI probe 19212e4d9fb1Saurel32 19224ffcedb6SJuan Quintelaif test "$brlapi" != "no" ; then 1923eb82284fSJuan Quintela brlapi_libs="-lbrlapi" 19242e4d9fb1Saurel32 cat > $TMPC << EOF 19252e4d9fb1Saurel32#include <brlapi.h> 1926832ce9c2SScott Wood#include <stddef.h> 19272e4d9fb1Saurel32int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } 19282e4d9fb1Saurel32EOF 192952166aa0SJuan Quintela if compile_prog "" "$brlapi_libs" ; then 19302e4d9fb1Saurel32 brlapi=yes 1931264606b3SJuan Quintela libs_softmmu="$brlapi_libs $libs_softmmu" 19324ffcedb6SJuan Quintela else 19334ffcedb6SJuan Quintela if test "$brlapi" = "yes" ; then 19344ffcedb6SJuan Quintela feature_not_found "brlapi" 19354ffcedb6SJuan Quintela fi 19364ffcedb6SJuan Quintela brlapi=no 1937eb82284fSJuan Quintela fi 1938eb82284fSJuan Quintelafi 19392e4d9fb1Saurel32 19402e4d9fb1Saurel32########################################## 19414d3b6f6eSbalrog# curses probe 1942e095e2f3SStefan Weilif test "$mingw32" = "yes" ; then 1943e095e2f3SStefan Weil curses_list="-lpdcurses" 1944e095e2f3SStefan Weilelse 19454f78ef9aSJuan Quintela curses_list="-lncurses -lcurses" 1946e095e2f3SStefan Weilfi 19474d3b6f6eSbalrog 1948c584a6d0SJuan Quintelaif test "$curses" != "no" ; then 1949c584a6d0SJuan Quintela curses_found=no 19504d3b6f6eSbalrog cat > $TMPC << EOF 19514d3b6f6eSbalrog#include <curses.h> 1952ef9a2524SStefan Weilint main(void) { 1953ef9a2524SStefan Weil const char *s = curses_version(); 1954ef9a2524SStefan Weil resize_term(0, 0); 1955ef9a2524SStefan Weil return s != 0; 1956ef9a2524SStefan Weil} 19574d3b6f6eSbalrogEOF 19584f78ef9aSJuan Quintela for curses_lib in $curses_list; do 19594f78ef9aSJuan Quintela if compile_prog "" "$curses_lib" ; then 1960c584a6d0SJuan Quintela curses_found=yes 19614f78ef9aSJuan Quintela libs_softmmu="$curses_lib $libs_softmmu" 19624f78ef9aSJuan Quintela break 19634d3b6f6eSbalrog fi 19644f78ef9aSJuan Quintela done 1965c584a6d0SJuan Quintela if test "$curses_found" = "yes" ; then 1966c584a6d0SJuan Quintela curses=yes 1967c584a6d0SJuan Quintela else 1968c584a6d0SJuan Quintela if test "$curses" = "yes" ; then 1969c584a6d0SJuan Quintela feature_not_found "curses" 1970c584a6d0SJuan Quintela fi 1971c584a6d0SJuan Quintela curses=no 1972c584a6d0SJuan Quintela fi 19734f78ef9aSJuan Quintelafi 19744d3b6f6eSbalrog 1975414f0dabSblueswir1########################################## 1976769ce76dSAlexander Graf# curl probe 1977769ce76dSAlexander Graf 1978a8bd70adSPaolo Bonziniif $pkg_config libcurl --modversion >/dev/null 2>&1; then 1979a8bd70adSPaolo Bonzini curlconfig="$pkg_config libcurl" 19804e2b0658SPaolo Bonzinielse 19814e2b0658SPaolo Bonzini curlconfig=curl-config 19824e2b0658SPaolo Bonzinifi 19834e2b0658SPaolo Bonzini 1984788c8196SJuan Quintelaif test "$curl" != "no" ; then 1985769ce76dSAlexander Graf cat > $TMPC << EOF 1986769ce76dSAlexander Graf#include <curl/curl.h> 19870b862cedSPeter Maydellint main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } 1988769ce76dSAlexander GrafEOF 19894e2b0658SPaolo Bonzini curl_cflags=`$curlconfig --cflags 2>/dev/null` 19904e2b0658SPaolo Bonzini curl_libs=`$curlconfig --libs 2>/dev/null` 1991b1d5a277SJuan Quintela if compile_prog "$curl_cflags" "$curl_libs" ; then 1992769ce76dSAlexander Graf curl=yes 1993f0302935SJuan Quintela libs_tools="$curl_libs $libs_tools" 1994f0302935SJuan Quintela libs_softmmu="$curl_libs $libs_softmmu" 1995788c8196SJuan Quintela else 1996788c8196SJuan Quintela if test "$curl" = "yes" ; then 1997788c8196SJuan Quintela feature_not_found "curl" 1998788c8196SJuan Quintela fi 1999788c8196SJuan Quintela curl=no 2000769ce76dSAlexander Graf fi 2001769ce76dSAlexander Graffi # test "$curl" 2002769ce76dSAlexander Graf 2003769ce76dSAlexander Graf########################################## 2004fb599c9aSbalrog# bluez support probe 2005a20a6f46SJuan Quintelaif test "$bluez" != "no" ; then 2006e820e3f4Sbalrog cat > $TMPC << EOF 2007e820e3f4Sbalrog#include <bluetooth/bluetooth.h> 2008e820e3f4Sbalrogint main(void) { return bt_error(0); } 2009e820e3f4SbalrogEOF 2010a8bd70adSPaolo Bonzini bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null` 2011a8bd70adSPaolo Bonzini bluez_libs=`$pkg_config --libs bluez 2> /dev/null` 201252166aa0SJuan Quintela if compile_prog "$bluez_cflags" "$bluez_libs" ; then 2013a20a6f46SJuan Quintela bluez=yes 2014e482d56aSJuan Quintela libs_softmmu="$bluez_libs $libs_softmmu" 2015e820e3f4Sbalrog else 2016a20a6f46SJuan Quintela if test "$bluez" = "yes" ; then 2017a20a6f46SJuan Quintela feature_not_found "bluez" 2018a20a6f46SJuan Quintela fi 2019e820e3f4Sbalrog bluez="no" 2020e820e3f4Sbalrog fi 2021fb599c9aSbalrogfi 2022fb599c9aSbalrog 2023fb599c9aSbalrog########################################## 2024e18df141SAnthony Liguori# glib support probe 2025a52d28afSPaolo Bonzini 2026a52d28afSPaolo Bonziniif test "$mingw32" = yes; then 2027a52d28afSPaolo Bonzini # g_poll is required in order to integrate with the glib main loop. 2028a52d28afSPaolo Bonzini glib_req_ver=2.20 2029a52d28afSPaolo Bonzinielse 2030a52d28afSPaolo Bonzini glib_req_ver=2.12 2031a52d28afSPaolo Bonzinifi 2032a52d28afSPaolo Bonziniif $pkg_config --atleast-version=$glib_req_ver gthread-2.0 > /dev/null 2>&1 2033a52d28afSPaolo Bonzinithen 20344b76a481SStefan Hajnoczi glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null` 20354b76a481SStefan Hajnoczi glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null` 203614015304SAnthony Liguori LIBS="$glib_libs $LIBS" 2037957f1f99SMichael Roth libs_qga="$glib_libs $libs_qga" 2038e18df141SAnthony Liguorielse 2039a52d28afSPaolo Bonzini echo "glib-$glib_req_ver required to compile QEMU" 2040e18df141SAnthony Liguori exit 1 2041e18df141SAnthony Liguorifi 2042e18df141SAnthony Liguori 2043e18df141SAnthony Liguori########################################## 204417bff52bSM. Mohan Kumar# libcap probe 204517bff52bSM. Mohan Kumar 204617bff52bSM. Mohan Kumarif test "$cap" != "no" ; then 204717bff52bSM. Mohan Kumar cat > $TMPC <<EOF 204817bff52bSM. Mohan Kumar#include <stdio.h> 204917bff52bSM. Mohan Kumar#include <sys/capability.h> 205017bff52bSM. Mohan Kumarint main(void) { cap_t caps; caps = cap_init(); } 205117bff52bSM. Mohan KumarEOF 205217bff52bSM. Mohan Kumar if compile_prog "" "-lcap" ; then 205317bff52bSM. Mohan Kumar cap=yes 205417bff52bSM. Mohan Kumar else 205517bff52bSM. Mohan Kumar cap=no 205617bff52bSM. Mohan Kumar fi 205717bff52bSM. Mohan Kumarfi 205817bff52bSM. Mohan Kumar 205917bff52bSM. Mohan Kumar########################################## 2060e5d355d1Saliguori# pthread probe 20614b29ec41SBradPTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" 20623c529d93Saliguori 2063e5d355d1Saliguoripthread=no 2064414f0dabSblueswir1cat > $TMPC << EOF 20653c529d93Saliguori#include <pthread.h> 20667a42bbe4SStefan Weilstatic void *f(void *p) { return NULL; } 20677a42bbe4SStefan Weilint main(void) { 20687a42bbe4SStefan Weil pthread_t thread; 20697a42bbe4SStefan Weil pthread_create(&thread, 0, f, 0); 20707a42bbe4SStefan Weil return 0; 20717a42bbe4SStefan Weil} 2072414f0dabSblueswir1EOF 2073bd00d539SAndreas Färberif compile_prog "" "" ; then 2074bd00d539SAndreas Färber pthread=yes 2075bd00d539SAndreas Färberelse 2076de65fe0fSSebastian Herbszt for pthread_lib in $PTHREADLIBS_LIST; do 207752166aa0SJuan Quintela if compile_prog "" "$pthread_lib" ; then 2078e5d355d1Saliguori pthread=yes 2079e3c56761SPeter Portante found=no 2080e3c56761SPeter Portante for lib_entry in $LIBS; do 2081e3c56761SPeter Portante if test "$lib_entry" = "$pthread_lib"; then 2082e3c56761SPeter Portante found=yes 2083e3c56761SPeter Portante break 2084e3c56761SPeter Portante fi 2085e3c56761SPeter Portante done 2086e3c56761SPeter Portante if test "$found" = "no"; then 20875572b539SJuan Quintela LIBS="$pthread_lib $LIBS" 2088e3c56761SPeter Portante fi 2089de65fe0fSSebastian Herbszt break 2090414f0dabSblueswir1 fi 2091de65fe0fSSebastian Herbszt done 2092bd00d539SAndreas Färberfi 2093414f0dabSblueswir1 20944617e593SAnthony Liguoriif test "$mingw32" != yes -a "$pthread" = no; then 20954dd75c70SChristoph Hellwig echo 20964dd75c70SChristoph Hellwig echo "Error: pthread check failed" 20974dd75c70SChristoph Hellwig echo "Make sure to have the pthread libs and headers installed." 20984dd75c70SChristoph Hellwig echo 20994dd75c70SChristoph Hellwig exit 1 2100e5d355d1Saliguorifi 2101e5d355d1Saliguori 2102bf9298b9Saliguori########################################## 2103f27aaf4bSChristian Brunner# rbd probe 2104f27aaf4bSChristian Brunnerif test "$rbd" != "no" ; then 2105f27aaf4bSChristian Brunner cat > $TMPC <<EOF 2106f27aaf4bSChristian Brunner#include <stdio.h> 2107ad32e9c0SJosh Durgin#include <rbd/librbd.h> 2108f27aaf4bSChristian Brunnerint main(void) { 2109ad32e9c0SJosh Durgin rados_t cluster; 2110ad32e9c0SJosh Durgin rados_create(&cluster, NULL); 2111f27aaf4bSChristian Brunner return 0; 2112f27aaf4bSChristian Brunner} 2113f27aaf4bSChristian BrunnerEOF 2114ad32e9c0SJosh Durgin rbd_libs="-lrbd -lrados" 2115f27aaf4bSChristian Brunner if compile_prog "" "$rbd_libs" ; then 2116f27aaf4bSChristian Brunner rbd=yes 2117f27aaf4bSChristian Brunner libs_tools="$rbd_libs $libs_tools" 2118f27aaf4bSChristian Brunner libs_softmmu="$rbd_libs $libs_softmmu" 2119f27aaf4bSChristian Brunner else 2120f27aaf4bSChristian Brunner if test "$rbd" = "yes" ; then 2121f27aaf4bSChristian Brunner feature_not_found "rados block device" 2122f27aaf4bSChristian Brunner fi 2123f27aaf4bSChristian Brunner rbd=no 2124f27aaf4bSChristian Brunner fi 2125f27aaf4bSChristian Brunnerfi 2126f27aaf4bSChristian Brunner 2127f27aaf4bSChristian Brunner########################################## 21285c6c3a6cSChristoph Hellwig# linux-aio probe 21295c6c3a6cSChristoph Hellwig 21305c6c3a6cSChristoph Hellwigif test "$linux_aio" != "no" ; then 21315c6c3a6cSChristoph Hellwig cat > $TMPC <<EOF 21325c6c3a6cSChristoph Hellwig#include <libaio.h> 21335c6c3a6cSChristoph Hellwig#include <sys/eventfd.h> 2134832ce9c2SScott Wood#include <stddef.h> 21355c6c3a6cSChristoph Hellwigint main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } 21365c6c3a6cSChristoph HellwigEOF 21375c6c3a6cSChristoph Hellwig if compile_prog "" "-laio" ; then 21385c6c3a6cSChristoph Hellwig linux_aio=yes 2139048d179fSPaul Brook libs_softmmu="$libs_softmmu -laio" 2140048d179fSPaul Brook libs_tools="$libs_tools -laio" 21415c6c3a6cSChristoph Hellwig else 21425c6c3a6cSChristoph Hellwig if test "$linux_aio" = "yes" ; then 21435c6c3a6cSChristoph Hellwig feature_not_found "linux AIO" 21445c6c3a6cSChristoph Hellwig fi 21453cfcae3cSLuiz Capitulino linux_aio=no 21465c6c3a6cSChristoph Hellwig fi 21475c6c3a6cSChristoph Hellwigfi 21485c6c3a6cSChristoph Hellwig 21495c6c3a6cSChristoph Hellwig########################################## 2150758e8e38SVenkateswararao Jujjuri (JV)# attr probe 2151758e8e38SVenkateswararao Jujjuri (JV) 2152758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" != "no" ; then 2153758e8e38SVenkateswararao Jujjuri (JV) cat > $TMPC <<EOF 2154758e8e38SVenkateswararao Jujjuri (JV)#include <stdio.h> 2155758e8e38SVenkateswararao Jujjuri (JV)#include <sys/types.h> 2156f2338fb4SPavel Borzenkov#ifdef CONFIG_LIBATTR 2157f2338fb4SPavel Borzenkov#include <attr/xattr.h> 2158f2338fb4SPavel Borzenkov#else 21594f26f2b6SAvi Kivity#include <sys/xattr.h> 2160f2338fb4SPavel Borzenkov#endif 2161758e8e38SVenkateswararao Jujjuri (JV)int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; } 2162758e8e38SVenkateswararao Jujjuri (JV)EOF 21634f26f2b6SAvi Kivity if compile_prog "" "" ; then 21644f26f2b6SAvi Kivity attr=yes 21654f26f2b6SAvi Kivity # Older distros have <attr/xattr.h>, and need -lattr: 2166f2338fb4SPavel Borzenkov elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then 2167758e8e38SVenkateswararao Jujjuri (JV) attr=yes 2168758e8e38SVenkateswararao Jujjuri (JV) LIBS="-lattr $LIBS" 21694f26f2b6SAvi Kivity libattr=yes 2170758e8e38SVenkateswararao Jujjuri (JV) else 2171758e8e38SVenkateswararao Jujjuri (JV) if test "$attr" = "yes" ; then 2172758e8e38SVenkateswararao Jujjuri (JV) feature_not_found "ATTR" 2173758e8e38SVenkateswararao Jujjuri (JV) fi 2174758e8e38SVenkateswararao Jujjuri (JV) attr=no 2175758e8e38SVenkateswararao Jujjuri (JV) fi 2176758e8e38SVenkateswararao Jujjuri (JV)fi 2177758e8e38SVenkateswararao Jujjuri (JV) 2178758e8e38SVenkateswararao Jujjuri (JV)########################################## 2179bf9298b9Saliguori# iovec probe 2180bf9298b9Saliguoricat > $TMPC <<EOF 2181db34f0b3Sblueswir1#include <sys/types.h> 2182bf9298b9Saliguori#include <sys/uio.h> 2183db34f0b3Sblueswir1#include <unistd.h> 2184f91f9beeSStefan Weilint main(void) { return sizeof(struct iovec); } 2185bf9298b9SaliguoriEOF 2186bf9298b9Saliguoriiovec=no 218752166aa0SJuan Quintelaif compile_prog "" "" ; then 2188bf9298b9Saliguori iovec=yes 2189bf9298b9Saliguorifi 2190bf9298b9Saliguori 2191f652e6afSaurel32########################################## 2192ceb42de8Saliguori# preadv probe 2193ceb42de8Saliguoricat > $TMPC <<EOF 2194ceb42de8Saliguori#include <sys/types.h> 2195ceb42de8Saliguori#include <sys/uio.h> 2196ceb42de8Saliguori#include <unistd.h> 219784972cbbSStefan Weilint main(void) { return preadv == preadv; } 2198ceb42de8SaliguoriEOF 2199ceb42de8Saliguoripreadv=no 220052166aa0SJuan Quintelaif compile_prog "" "" ; then 2201ceb42de8Saliguori preadv=yes 2202ceb42de8Saliguorifi 2203ceb42de8Saliguori 2204ceb42de8Saliguori########################################## 2205f652e6afSaurel32# fdt probe 22062df87df7SJuan Quintelaif test "$fdt" != "no" ; then 2207b41af4baSJuan Quintela fdt_libs="-lfdt" 2208f652e6afSaurel32 cat > $TMPC << EOF 2209f652e6afSaurel32int main(void) { return 0; } 2210f652e6afSaurel32EOF 221152166aa0SJuan Quintela if compile_prog "" "$fdt_libs" ; then 2212f652e6afSaurel32 fdt=yes 22132df87df7SJuan Quintela else 22142df87df7SJuan Quintela if test "$fdt" = "yes" ; then 22152df87df7SJuan Quintela feature_not_found "fdt" 22162df87df7SJuan Quintela fi 2217de3a354aSMichael Walle fdt_libs= 22182df87df7SJuan Quintela fdt=no 2219f652e6afSaurel32 fi 2220f652e6afSaurel32fi 2221f652e6afSaurel32 222220ff075bSMichael Walle########################################## 222320ff075bSMichael Walle# opengl probe, used by milkymist-tmu2 222420ff075bSMichael Walleif test "$opengl" != "no" ; then 222520ff075bSMichael Walle opengl_libs="-lGL" 222620ff075bSMichael Walle cat > $TMPC << EOF 222720ff075bSMichael Walle#include <X11/Xlib.h> 222820ff075bSMichael Walle#include <GL/gl.h> 222920ff075bSMichael Walle#include <GL/glx.h> 223084972cbbSStefan Weilint main(void) { return GL_VERSION != 0; } 223120ff075bSMichael WalleEOF 223220ff075bSMichael Walle if compile_prog "" "-lGL" ; then 223320ff075bSMichael Walle opengl=yes 223420ff075bSMichael Walle else 223520ff075bSMichael Walle if test "$opengl" = "yes" ; then 223620ff075bSMichael Walle feature_not_found "opengl" 223720ff075bSMichael Walle fi 2238de3a354aSMichael Walle opengl_libs= 223920ff075bSMichael Walle opengl=no 224020ff075bSMichael Walle fi 224120ff075bSMichael Wallefi 224220ff075bSMichael Walle 22433b3f24adSaurel32# 22443b3f24adSaurel32# Check for xxxat() functions when we are building linux-user 22453b3f24adSaurel32# emulator. This is done because older glibc versions don't 22463b3f24adSaurel32# have syscall stubs for these implemented. 22473b3f24adSaurel32# 22483b3f24adSaurel32atfile=no 22493b3f24adSaurel32cat > $TMPC << EOF 22503b3f24adSaurel32#define _ATFILE_SOURCE 22513b3f24adSaurel32#include <sys/types.h> 22523b3f24adSaurel32#include <fcntl.h> 22533b3f24adSaurel32#include <unistd.h> 22543b3f24adSaurel32 22553b3f24adSaurel32int 22563b3f24adSaurel32main(void) 22573b3f24adSaurel32{ 22583b3f24adSaurel32 /* try to unlink nonexisting file */ 22593b3f24adSaurel32 return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); 22603b3f24adSaurel32} 22613b3f24adSaurel32EOF 226252166aa0SJuan Quintelaif compile_prog "" "" ; then 22633b3f24adSaurel32 atfile=yes 22643b3f24adSaurel32fi 22653b3f24adSaurel32 226639386ac7Saurel32# Check for inotify functions when we are building linux-user 22673b3f24adSaurel32# emulator. This is done because older glibc versions don't 22683b3f24adSaurel32# have syscall stubs for these implemented. In that case we 22693b3f24adSaurel32# don't provide them even if kernel supports them. 22703b3f24adSaurel32# 22713b3f24adSaurel32inotify=no 22723b3f24adSaurel32cat > $TMPC << EOF 22733b3f24adSaurel32#include <sys/inotify.h> 22743b3f24adSaurel32 22753b3f24adSaurel32int 22763b3f24adSaurel32main(void) 22773b3f24adSaurel32{ 22783b3f24adSaurel32 /* try to start inotify */ 22798690e420Saurel32 return inotify_init(); 22803b3f24adSaurel32} 22813b3f24adSaurel32EOF 228252166aa0SJuan Quintelaif compile_prog "" "" ; then 22833b3f24adSaurel32 inotify=yes 22843b3f24adSaurel32fi 22853b3f24adSaurel32 2286c05c7a73SRiku Voipioinotify1=no 2287c05c7a73SRiku Voipiocat > $TMPC << EOF 2288c05c7a73SRiku Voipio#include <sys/inotify.h> 2289c05c7a73SRiku Voipio 2290c05c7a73SRiku Voipioint 2291c05c7a73SRiku Voipiomain(void) 2292c05c7a73SRiku Voipio{ 2293c05c7a73SRiku Voipio /* try to start inotify */ 2294c05c7a73SRiku Voipio return inotify_init1(0); 2295c05c7a73SRiku Voipio} 2296c05c7a73SRiku VoipioEOF 2297c05c7a73SRiku Voipioif compile_prog "" "" ; then 2298c05c7a73SRiku Voipio inotify1=yes 2299c05c7a73SRiku Voipiofi 2300c05c7a73SRiku Voipio 2301ebc996f3SRiku Voipio# check if utimensat and futimens are supported 2302ebc996f3SRiku Voipioutimens=no 2303ebc996f3SRiku Voipiocat > $TMPC << EOF 2304ebc996f3SRiku Voipio#define _ATFILE_SOURCE 2305ebc996f3SRiku Voipio#include <stddef.h> 2306ebc996f3SRiku Voipio#include <fcntl.h> 2307ebc996f3SRiku Voipio 2308ebc996f3SRiku Voipioint main(void) 2309ebc996f3SRiku Voipio{ 2310ebc996f3SRiku Voipio utimensat(AT_FDCWD, "foo", NULL, 0); 2311ebc996f3SRiku Voipio futimens(0, NULL); 2312ebc996f3SRiku Voipio return 0; 2313ebc996f3SRiku Voipio} 2314ebc996f3SRiku VoipioEOF 231552166aa0SJuan Quintelaif compile_prog "" "" ; then 2316ebc996f3SRiku Voipio utimens=yes 2317ebc996f3SRiku Voipiofi 2318ebc996f3SRiku Voipio 2319099d6b0fSRiku Voipio# check if pipe2 is there 2320099d6b0fSRiku Voipiopipe2=no 2321099d6b0fSRiku Voipiocat > $TMPC << EOF 2322099d6b0fSRiku Voipio#include <unistd.h> 2323099d6b0fSRiku Voipio#include <fcntl.h> 2324099d6b0fSRiku Voipio 2325099d6b0fSRiku Voipioint main(void) 2326099d6b0fSRiku Voipio{ 2327099d6b0fSRiku Voipio int pipefd[2]; 2328099d6b0fSRiku Voipio pipe2(pipefd, O_CLOEXEC); 2329099d6b0fSRiku Voipio return 0; 2330099d6b0fSRiku Voipio} 2331099d6b0fSRiku VoipioEOF 233252166aa0SJuan Quintelaif compile_prog "" "" ; then 2333099d6b0fSRiku Voipio pipe2=yes 2334099d6b0fSRiku Voipiofi 2335099d6b0fSRiku Voipio 233640ff6d7eSKevin Wolf# check if accept4 is there 233740ff6d7eSKevin Wolfaccept4=no 233840ff6d7eSKevin Wolfcat > $TMPC << EOF 233940ff6d7eSKevin Wolf#include <sys/socket.h> 234040ff6d7eSKevin Wolf#include <stddef.h> 234140ff6d7eSKevin Wolf 234240ff6d7eSKevin Wolfint main(void) 234340ff6d7eSKevin Wolf{ 234440ff6d7eSKevin Wolf accept4(0, NULL, NULL, SOCK_CLOEXEC); 234540ff6d7eSKevin Wolf return 0; 234640ff6d7eSKevin Wolf} 234740ff6d7eSKevin WolfEOF 234840ff6d7eSKevin Wolfif compile_prog "" "" ; then 234940ff6d7eSKevin Wolf accept4=yes 235040ff6d7eSKevin Wolffi 235140ff6d7eSKevin Wolf 23523ce34dfbSvibisreenivasan# check if tee/splice is there. vmsplice was added same time. 23533ce34dfbSvibisreenivasansplice=no 23543ce34dfbSvibisreenivasancat > $TMPC << EOF 23553ce34dfbSvibisreenivasan#include <unistd.h> 23563ce34dfbSvibisreenivasan#include <fcntl.h> 23573ce34dfbSvibisreenivasan#include <limits.h> 23583ce34dfbSvibisreenivasan 23593ce34dfbSvibisreenivasanint main(void) 23603ce34dfbSvibisreenivasan{ 236166ea0f22SStefan Weil int len, fd = 0; 23623ce34dfbSvibisreenivasan len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); 23633ce34dfbSvibisreenivasan splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); 23643ce34dfbSvibisreenivasan return 0; 23653ce34dfbSvibisreenivasan} 23663ce34dfbSvibisreenivasanEOF 236752166aa0SJuan Quintelaif compile_prog "" "" ; then 23683ce34dfbSvibisreenivasan splice=yes 23693ce34dfbSvibisreenivasanfi 23703ce34dfbSvibisreenivasan 2371dcc38d1cSMarcelo Tosatti########################################## 2372dcc38d1cSMarcelo Tosatti# signalfd probe 2373dcc38d1cSMarcelo Tosattisignalfd="no" 2374dcc38d1cSMarcelo Tosatticat > $TMPC << EOF 2375dcc38d1cSMarcelo Tosatti#include <unistd.h> 2376dcc38d1cSMarcelo Tosatti#include <sys/syscall.h> 2377dcc38d1cSMarcelo Tosatti#include <signal.h> 2378dcc38d1cSMarcelo Tosattiint main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); } 2379dcc38d1cSMarcelo TosattiEOF 2380dcc38d1cSMarcelo Tosatti 2381dcc38d1cSMarcelo Tosattiif compile_prog "" "" ; then 2382dcc38d1cSMarcelo Tosatti signalfd=yes 2383dcc38d1cSMarcelo Tosattifi 2384dcc38d1cSMarcelo Tosatti 2385c2882b96SRiku Voipio# check if eventfd is supported 2386c2882b96SRiku Voipioeventfd=no 2387c2882b96SRiku Voipiocat > $TMPC << EOF 2388c2882b96SRiku Voipio#include <sys/eventfd.h> 2389c2882b96SRiku Voipio 2390c2882b96SRiku Voipioint main(void) 2391c2882b96SRiku Voipio{ 239255cc7f3eSStefan Weil return eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); 2393c2882b96SRiku Voipio} 2394c2882b96SRiku VoipioEOF 2395c2882b96SRiku Voipioif compile_prog "" "" ; then 2396c2882b96SRiku Voipio eventfd=yes 2397c2882b96SRiku Voipiofi 2398c2882b96SRiku Voipio 2399d0927938SUlrich Hecht# check for fallocate 2400d0927938SUlrich Hechtfallocate=no 2401d0927938SUlrich Hechtcat > $TMPC << EOF 2402d0927938SUlrich Hecht#include <fcntl.h> 2403d0927938SUlrich Hecht 2404d0927938SUlrich Hechtint main(void) 2405d0927938SUlrich Hecht{ 2406d0927938SUlrich Hecht fallocate(0, 0, 0, 0); 2407d0927938SUlrich Hecht return 0; 2408d0927938SUlrich Hecht} 2409d0927938SUlrich HechtEOF 24108fb03151SPeter Maydellif compile_prog "" "" ; then 2411d0927938SUlrich Hecht fallocate=yes 2412d0927938SUlrich Hechtfi 2413d0927938SUlrich Hecht 2414c727f47dSPeter Maydell# check for sync_file_range 2415c727f47dSPeter Maydellsync_file_range=no 2416c727f47dSPeter Maydellcat > $TMPC << EOF 2417c727f47dSPeter Maydell#include <fcntl.h> 2418c727f47dSPeter Maydell 2419c727f47dSPeter Maydellint main(void) 2420c727f47dSPeter Maydell{ 2421c727f47dSPeter Maydell sync_file_range(0, 0, 0, 0); 2422c727f47dSPeter Maydell return 0; 2423c727f47dSPeter Maydell} 2424c727f47dSPeter MaydellEOF 24258fb03151SPeter Maydellif compile_prog "" "" ; then 2426c727f47dSPeter Maydell sync_file_range=yes 2427c727f47dSPeter Maydellfi 2428c727f47dSPeter Maydell 2429dace20dcSPeter Maydell# check for linux/fiemap.h and FS_IOC_FIEMAP 2430dace20dcSPeter Maydellfiemap=no 2431dace20dcSPeter Maydellcat > $TMPC << EOF 2432dace20dcSPeter Maydell#include <sys/ioctl.h> 2433dace20dcSPeter Maydell#include <linux/fs.h> 2434dace20dcSPeter Maydell#include <linux/fiemap.h> 2435dace20dcSPeter Maydell 2436dace20dcSPeter Maydellint main(void) 2437dace20dcSPeter Maydell{ 2438dace20dcSPeter Maydell ioctl(0, FS_IOC_FIEMAP, 0); 2439dace20dcSPeter Maydell return 0; 2440dace20dcSPeter Maydell} 2441dace20dcSPeter MaydellEOF 24428fb03151SPeter Maydellif compile_prog "" "" ; then 2443dace20dcSPeter Maydell fiemap=yes 2444dace20dcSPeter Maydellfi 2445dace20dcSPeter Maydell 2446d0927938SUlrich Hecht# check for dup3 2447d0927938SUlrich Hechtdup3=no 2448d0927938SUlrich Hechtcat > $TMPC << EOF 2449d0927938SUlrich Hecht#include <unistd.h> 2450d0927938SUlrich Hecht 2451d0927938SUlrich Hechtint main(void) 2452d0927938SUlrich Hecht{ 2453d0927938SUlrich Hecht dup3(0, 0, 0); 2454d0927938SUlrich Hecht return 0; 2455d0927938SUlrich Hecht} 2456d0927938SUlrich HechtEOF 245778f5d726SJan Kiszkaif compile_prog "" "" ; then 2458d0927938SUlrich Hecht dup3=yes 2459d0927938SUlrich Hechtfi 2460d0927938SUlrich Hecht 24613b6edd16SPeter Maydell# check for epoll support 24623b6edd16SPeter Maydellepoll=no 24633b6edd16SPeter Maydellcat > $TMPC << EOF 24643b6edd16SPeter Maydell#include <sys/epoll.h> 24653b6edd16SPeter Maydell 24663b6edd16SPeter Maydellint main(void) 24673b6edd16SPeter Maydell{ 24683b6edd16SPeter Maydell epoll_create(0); 24693b6edd16SPeter Maydell return 0; 24703b6edd16SPeter Maydell} 24713b6edd16SPeter MaydellEOF 24728fb03151SPeter Maydellif compile_prog "" "" ; then 24733b6edd16SPeter Maydell epoll=yes 24743b6edd16SPeter Maydellfi 24753b6edd16SPeter Maydell 24763b6edd16SPeter Maydell# epoll_create1 and epoll_pwait are later additions 24773b6edd16SPeter Maydell# so we must check separately for their presence 24783b6edd16SPeter Maydellepoll_create1=no 24793b6edd16SPeter Maydellcat > $TMPC << EOF 24803b6edd16SPeter Maydell#include <sys/epoll.h> 24813b6edd16SPeter Maydell 24823b6edd16SPeter Maydellint main(void) 24833b6edd16SPeter Maydell{ 248419e83f6bSPeter Maydell /* Note that we use epoll_create1 as a value, not as 248519e83f6bSPeter Maydell * a function being called. This is necessary so that on 248619e83f6bSPeter Maydell * old SPARC glibc versions where the function was present in 248719e83f6bSPeter Maydell * the library but not declared in the header file we will 248819e83f6bSPeter Maydell * fail the configure check. (Otherwise we will get a compiler 248919e83f6bSPeter Maydell * warning but not an error, and will proceed to fail the 249019e83f6bSPeter Maydell * qemu compile where we compile with -Werror.) 249119e83f6bSPeter Maydell */ 249284972cbbSStefan Weil return epoll_create1 == epoll_create1; 24933b6edd16SPeter Maydell} 24943b6edd16SPeter MaydellEOF 24958fb03151SPeter Maydellif compile_prog "" "" ; then 24963b6edd16SPeter Maydell epoll_create1=yes 24973b6edd16SPeter Maydellfi 24983b6edd16SPeter Maydell 24993b6edd16SPeter Maydellepoll_pwait=no 25003b6edd16SPeter Maydellcat > $TMPC << EOF 25013b6edd16SPeter Maydell#include <sys/epoll.h> 25023b6edd16SPeter Maydell 25033b6edd16SPeter Maydellint main(void) 25043b6edd16SPeter Maydell{ 25053b6edd16SPeter Maydell epoll_pwait(0, 0, 0, 0, 0); 25063b6edd16SPeter Maydell return 0; 25073b6edd16SPeter Maydell} 25083b6edd16SPeter MaydellEOF 25098fb03151SPeter Maydellif compile_prog "" "" ; then 25103b6edd16SPeter Maydell epoll_pwait=yes 25113b6edd16SPeter Maydellfi 25123b6edd16SPeter Maydell 2513cc8ae6deSpbrook# Check if tools are available to build documentation. 2514a25dba17SJuan Quintelaif test "$docs" != "no" ; then 251501668d98SStefan Weil if has makeinfo && has pod2man; then 2516a25dba17SJuan Quintela docs=yes 251783a3ab8bSJuan Quintela else 2518a25dba17SJuan Quintela if test "$docs" = "yes" ; then 2519a25dba17SJuan Quintela feature_not_found "docs" 252083a3ab8bSJuan Quintela fi 2521a25dba17SJuan Quintela docs=no 252283a3ab8bSJuan Quintela fi 2523cc8ae6deSpbrookfi 2524cc8ae6deSpbrook 2525f514f41cSStefan Weil# Search for bswap_32 function 25266ae9a1f4SJuan Quintelabyteswap_h=no 25276ae9a1f4SJuan Quintelacat > $TMPC << EOF 25286ae9a1f4SJuan Quintela#include <byteswap.h> 25296ae9a1f4SJuan Quintelaint main(void) { return bswap_32(0); } 25306ae9a1f4SJuan QuintelaEOF 253152166aa0SJuan Quintelaif compile_prog "" "" ; then 25326ae9a1f4SJuan Quintela byteswap_h=yes 25336ae9a1f4SJuan Quintelafi 25346ae9a1f4SJuan Quintela 2535f514f41cSStefan Weil# Search for bswap_32 function 25366ae9a1f4SJuan Quintelabswap_h=no 25376ae9a1f4SJuan Quintelacat > $TMPC << EOF 25386ae9a1f4SJuan Quintela#include <sys/endian.h> 25396ae9a1f4SJuan Quintela#include <sys/types.h> 25406ae9a1f4SJuan Quintela#include <machine/bswap.h> 25416ae9a1f4SJuan Quintelaint main(void) { return bswap32(0); } 25426ae9a1f4SJuan QuintelaEOF 254352166aa0SJuan Quintelaif compile_prog "" "" ; then 25446ae9a1f4SJuan Quintela bswap_h=yes 25456ae9a1f4SJuan Quintelafi 25466ae9a1f4SJuan Quintela 2547da93a1fdSaliguori########################################## 2548c589b249SRonnie Sahlberg# Do we have libiscsi 2549fa6acb0cSRonnie Sahlberg# We check for iscsi_unmap_sync() to make sure we have a 2550fa6acb0cSRonnie Sahlberg# recent enough version of libiscsi. 2551c589b249SRonnie Sahlbergif test "$libiscsi" != "no" ; then 2552c589b249SRonnie Sahlberg cat > $TMPC << EOF 2553fa6acb0cSRonnie Sahlberg#include <stdio.h> 2554c589b249SRonnie Sahlberg#include <iscsi/iscsi.h> 2555fa6acb0cSRonnie Sahlbergint main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; } 2556c589b249SRonnie SahlbergEOF 2557c589b249SRonnie Sahlberg if compile_prog "-Werror" "-liscsi" ; then 2558c589b249SRonnie Sahlberg libiscsi="yes" 2559c589b249SRonnie Sahlberg LIBS="$LIBS -liscsi" 2560c589b249SRonnie Sahlberg else 2561c589b249SRonnie Sahlberg if test "$libiscsi" = "yes" ; then 2562c589b249SRonnie Sahlberg feature_not_found "libiscsi" 2563c589b249SRonnie Sahlberg fi 2564c589b249SRonnie Sahlberg libiscsi="no" 2565c589b249SRonnie Sahlberg fi 2566c589b249SRonnie Sahlbergfi 2567c589b249SRonnie Sahlberg 2568c589b249SRonnie Sahlberg 2569c589b249SRonnie Sahlberg########################################## 2570da93a1fdSaliguori# Do we need librt 2571da93a1fdSaliguoricat > $TMPC <<EOF 2572da93a1fdSaliguori#include <signal.h> 2573da93a1fdSaliguori#include <time.h> 257466ea0f22SStefan Weilint main(void) { return clock_gettime(CLOCK_REALTIME, NULL); } 2575da93a1fdSaliguoriEOF 2576da93a1fdSaliguori 257752166aa0SJuan Quintelaif compile_prog "" "" ; then 257807ffa4bdSJuan Quintela : 257952166aa0SJuan Quintelaelif compile_prog "" "-lrt" ; then 258007ffa4bdSJuan Quintela LIBS="-lrt $LIBS" 2581da93a1fdSaliguorifi 2582da93a1fdSaliguori 258331ff504dSBlue Swirlif test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ 2584179cf400SAndreas Färber "$aix" != "yes" -a "$haiku" != "yes" ; then 25856362a53fSJuan Quintela libs_softmmu="-lutil $libs_softmmu" 25866362a53fSJuan Quintelafi 25876362a53fSJuan Quintela 2588de5071c5SBlue Swirl########################################## 2589cd4ec0b4SGerd Hoffmann# spice probe 2590cd4ec0b4SGerd Hoffmannif test "$spice" != "no" ; then 2591cd4ec0b4SGerd Hoffmann cat > $TMPC << EOF 2592cd4ec0b4SGerd Hoffmann#include <spice.h> 2593cd4ec0b4SGerd Hoffmannint main(void) { spice_server_new(); return 0; } 2594cd4ec0b4SGerd HoffmannEOF 2595710fc4f5SJiri Denemark spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null) 2596710fc4f5SJiri Denemark spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null) 25974295e15aSAlon Levy if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \ 25987e3efdacSAlon Levy $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \ 2599cd4ec0b4SGerd Hoffmann compile_prog "$spice_cflags" "$spice_libs" ; then 2600cd4ec0b4SGerd Hoffmann spice="yes" 2601cd4ec0b4SGerd Hoffmann libs_softmmu="$libs_softmmu $spice_libs" 2602cd4ec0b4SGerd Hoffmann QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags" 2603cd4ec0b4SGerd Hoffmann else 2604cd4ec0b4SGerd Hoffmann if test "$spice" = "yes" ; then 2605cd4ec0b4SGerd Hoffmann feature_not_found "spice" 2606cd4ec0b4SGerd Hoffmann fi 2607cd4ec0b4SGerd Hoffmann spice="no" 2608cd4ec0b4SGerd Hoffmann fi 2609cd4ec0b4SGerd Hoffmannfi 2610cd4ec0b4SGerd Hoffmann 2611111a38b0SRobert Relyea# check for libcacard for smartcard support 2612111a38b0SRobert Relyeaif test "$smartcard" != "no" ; then 2613111a38b0SRobert Relyea smartcard="yes" 2614111a38b0SRobert Relyea smartcard_cflags="" 2615111a38b0SRobert Relyea # TODO - what's the minimal nss version we support? 2616111a38b0SRobert Relyea if test "$smartcard_nss" != "no"; then 26175f01e06fSSergei Trofimovich cat > $TMPC << EOF 26185f01e06fSSergei Trofimovich#include <pk11pub.h> 26195f01e06fSSergei Trofimovichint main(void) { PK11_FreeSlot(0); return 0; } 26205f01e06fSSergei TrofimovichEOF 2621111a38b0SRobert Relyea smartcard_cflags="-I\$(SRC_PATH)/libcacard" 26228c741c22SAlon Levy libcacard_libs="$($pkg_config --libs nss 2>/dev/null) $glib_libs" 26238c741c22SAlon Levy libcacard_cflags="$($pkg_config --cflags nss 2>/dev/null) $glib_cflags" 26245f01e06fSSergei Trofimovich if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 && \ 26255f01e06fSSergei Trofimovich compile_prog "$smartcard_cflags $libcacard_cflags" "$libcacard_libs"; then 26265f01e06fSSergei Trofimovich smartcard_nss="yes" 2627111a38b0SRobert Relyea QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags" 2628ad4cf3f6SPaul Brook libs_softmmu="$libcacard_libs $libs_softmmu" 2629111a38b0SRobert Relyea else 2630111a38b0SRobert Relyea if test "$smartcard_nss" = "yes"; then 2631111a38b0SRobert Relyea feature_not_found "nss" 2632111a38b0SRobert Relyea fi 2633111a38b0SRobert Relyea smartcard_nss="no" 2634111a38b0SRobert Relyea fi 2635111a38b0SRobert Relyea fi 2636111a38b0SRobert Relyeafi 2637111a38b0SRobert Relyeaif test "$smartcard" = "no" ; then 2638111a38b0SRobert Relyea smartcard_nss="no" 2639111a38b0SRobert Relyeafi 2640111a38b0SRobert Relyea 264169354a83SHans de Goede# check for usbredirparser for usb network redirection support 264269354a83SHans de Goedeif test "$usb_redir" != "no" ; then 2643097a66efSHans de Goede if $pkg_config --atleast-version=0.3.4 libusbredirparser >/dev/null 2>&1 ; then 264469354a83SHans de Goede usb_redir="yes" 264569354a83SHans de Goede usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null) 264669354a83SHans de Goede usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null) 264769354a83SHans de Goede QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags" 264869354a83SHans de Goede LIBS="$LIBS $usb_redir_libs" 264969354a83SHans de Goede else 265069354a83SHans de Goede if test "$usb_redir" = "yes"; then 265169354a83SHans de Goede feature_not_found "usb-redir" 265269354a83SHans de Goede fi 265369354a83SHans de Goede usb_redir="no" 265469354a83SHans de Goede fi 265569354a83SHans de Goedefi 265669354a83SHans de Goede 2657cd4ec0b4SGerd Hoffmann########################################## 2658cd4ec0b4SGerd Hoffmann 2659747bbdf7SBlue Swirl########################################## 26605f6b9e8fSBlue Swirl# check if we have fdatasync 26615f6b9e8fSBlue Swirl 26625f6b9e8fSBlue Swirlfdatasync=no 26635f6b9e8fSBlue Swirlcat > $TMPC << EOF 26645f6b9e8fSBlue Swirl#include <unistd.h> 2665d1722a27SAlexandre Raymondint main(void) { 2666d1722a27SAlexandre Raymond#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 2667d1722a27SAlexandre Raymondreturn fdatasync(0); 2668d1722a27SAlexandre Raymond#else 2669e172fe11SStefan Weil#error Not supported 2670d1722a27SAlexandre Raymond#endif 2671d1722a27SAlexandre Raymond} 26725f6b9e8fSBlue SwirlEOF 26735f6b9e8fSBlue Swirlif compile_prog "" "" ; then 26745f6b9e8fSBlue Swirl fdatasync=yes 26755f6b9e8fSBlue Swirlfi 26765f6b9e8fSBlue Swirl 267794a420b1SStefan Hajnoczi########################################## 2678e78815a5SAndreas Färber# check if we have madvise 2679e78815a5SAndreas Färber 2680e78815a5SAndreas Färbermadvise=no 2681e78815a5SAndreas Färbercat > $TMPC << EOF 2682e78815a5SAndreas Färber#include <sys/types.h> 2683e78815a5SAndreas Färber#include <sys/mman.h> 2684832ce9c2SScott Wood#include <stddef.h> 2685e78815a5SAndreas Färberint main(void) { return madvise(NULL, 0, MADV_DONTNEED); } 2686e78815a5SAndreas FärberEOF 2687e78815a5SAndreas Färberif compile_prog "" "" ; then 2688e78815a5SAndreas Färber madvise=yes 2689e78815a5SAndreas Färberfi 2690e78815a5SAndreas Färber 2691e78815a5SAndreas Färber########################################## 2692e78815a5SAndreas Färber# check if we have posix_madvise 2693e78815a5SAndreas Färber 2694e78815a5SAndreas Färberposix_madvise=no 2695e78815a5SAndreas Färbercat > $TMPC << EOF 2696e78815a5SAndreas Färber#include <sys/mman.h> 2697832ce9c2SScott Wood#include <stddef.h> 2698e78815a5SAndreas Färberint main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); } 2699e78815a5SAndreas FärberEOF 2700e78815a5SAndreas Färberif compile_prog "" "" ; then 2701e78815a5SAndreas Färber posix_madvise=yes 2702e78815a5SAndreas Färberfi 2703e78815a5SAndreas Färber 2704e78815a5SAndreas Färber########################################## 270594a420b1SStefan Hajnoczi# check if trace backend exists 270694a420b1SStefan Hajnoczi 2707650ab98dSLluís Vilanova$python "$source_path/scripts/tracetool.py" "--backend=$trace_backend" --check-backend > /dev/null 2> /dev/null 270894a420b1SStefan Hajnocziif test "$?" -ne 0 ; then 270994a420b1SStefan Hajnoczi echo 271094a420b1SStefan Hajnoczi echo "Error: invalid trace backend" 271194a420b1SStefan Hajnoczi echo "Please choose a supported trace backend." 271294a420b1SStefan Hajnoczi echo 271394a420b1SStefan Hajnoczi exit 1 271494a420b1SStefan Hajnoczifi 271594a420b1SStefan Hajnoczi 27167e24e92aSStefan Hajnoczi########################################## 27177e24e92aSStefan Hajnoczi# For 'ust' backend, test if ust headers are present 27187e24e92aSStefan Hajnocziif test "$trace_backend" = "ust"; then 27197e24e92aSStefan Hajnoczi cat > $TMPC << EOF 27207e24e92aSStefan Hajnoczi#include <ust/tracepoint.h> 27217e24e92aSStefan Hajnoczi#include <ust/marker.h> 27227e24e92aSStefan Hajnocziint main(void) { return 0; } 27237e24e92aSStefan HajnocziEOF 27247e24e92aSStefan Hajnoczi if compile_prog "" "" ; then 272594b4fefaSLluís Vilanova LIBS="-lust -lurcu-bp $LIBS" 2726c9a2e37cSLluís Vilanova libs_qga="-lust -lurcu-bp $libs_qga" 27277e24e92aSStefan Hajnoczi else 27287e24e92aSStefan Hajnoczi echo 27297e24e92aSStefan Hajnoczi echo "Error: Trace backend 'ust' missing libust header files" 27307e24e92aSStefan Hajnoczi echo 27317e24e92aSStefan Hajnoczi exit 1 27327e24e92aSStefan Hajnoczi fi 27337e24e92aSStefan Hajnoczifi 2734b3d08c02SDaniel P. Berrange 2735b3d08c02SDaniel P. Berrange########################################## 2736b3d08c02SDaniel P. Berrange# For 'dtrace' backend, test if 'dtrace' command is present 2737b3d08c02SDaniel P. Berrangeif test "$trace_backend" = "dtrace"; then 2738b3d08c02SDaniel P. Berrange if ! has 'dtrace' ; then 2739b3d08c02SDaniel P. Berrange echo 2740b3d08c02SDaniel P. Berrange echo "Error: dtrace command is not found in PATH $PATH" 2741b3d08c02SDaniel P. Berrange echo 2742b3d08c02SDaniel P. Berrange exit 1 2743b3d08c02SDaniel P. Berrange fi 2744c276b17dSDaniel P. Berrange trace_backend_stap="no" 2745c276b17dSDaniel P. Berrange if has 'stap' ; then 2746c276b17dSDaniel P. Berrange trace_backend_stap="yes" 2747c276b17dSDaniel P. Berrange fi 2748b3d08c02SDaniel P. Berrangefi 2749b3d08c02SDaniel P. Berrange 27507e24e92aSStefan Hajnoczi########################################## 2751023367e6SWolfgang Mauerer# __sync_fetch_and_and requires at least -march=i486. Many toolchains 2752023367e6SWolfgang Mauerer# use i686 as default anyway, but for those that don't, an explicit 2753023367e6SWolfgang Mauerer# specification is necessary 27541ba16968SStefan Weilif test "$vhost_net" = "yes" && test "$cpu" = "i386"; then 2755023367e6SWolfgang Mauerer cat > $TMPC << EOF 2756023367e6SWolfgang Mauererint sfaa(unsigned *ptr) 2757023367e6SWolfgang Mauerer{ 2758023367e6SWolfgang Mauerer return __sync_fetch_and_and(ptr, 0); 2759023367e6SWolfgang Mauerer} 2760023367e6SWolfgang Mauerer 2761023367e6SWolfgang Mauererint main(int argc, char **argv) 2762023367e6SWolfgang Mauerer{ 2763023367e6SWolfgang Mauerer int val = 42; 2764023367e6SWolfgang Mauerer sfaa(&val); 2765023367e6SWolfgang Mauerer return val; 2766023367e6SWolfgang Mauerer} 2767023367e6SWolfgang MauererEOF 2768023367e6SWolfgang Mauerer if ! compile_prog "" "" ; then 2769023367e6SWolfgang Mauerer CFLAGS+="-march=i486" 2770023367e6SWolfgang Mauerer fi 2771023367e6SWolfgang Mauererfi 2772023367e6SWolfgang Mauerer 2773023367e6SWolfgang Mauerer########################################## 2774519175a2SAlex Barcelo# check and set a backend for coroutine 2775d0e2fce5SAneesh Kumar K.V 2776519175a2SAlex Barcelo# default is ucontext, but always fallback to gthread 2777519175a2SAlex Barcelo# windows autodetected by make 2778519175a2SAlex Barceloif test "$coroutine" = "" -o "$coroutine" = "ucontext"; then 2779d0e2fce5SAneesh Kumar K.V if test "$darwin" != "yes"; then 2780d0e2fce5SAneesh Kumar K.V cat > $TMPC << EOF 2781d0e2fce5SAneesh Kumar K.V#include <ucontext.h> 2782cdf84806SPeter Maydell#ifdef __stub_makecontext 2783cdf84806SPeter Maydell#error Ignoring glibc stub makecontext which will always fail 2784cdf84806SPeter Maydell#endif 278575cafad7SStefan Weilint main(void) { makecontext(0, 0, 0); return 0; } 2786d0e2fce5SAneesh Kumar K.VEOF 2787d0e2fce5SAneesh Kumar K.V if compile_prog "" "" ; then 2788519175a2SAlex Barcelo coroutine_backend=ucontext 2789519175a2SAlex Barcelo else 2790519175a2SAlex Barcelo coroutine_backend=gthread 2791d0e2fce5SAneesh Kumar K.V fi 2792519175a2SAlex Barcelo else 2793519175a2SAlex Barcelo echo "Silently falling back into gthread backend under darwin" 2794519175a2SAlex Barcelo fi 2795519175a2SAlex Barceloelif test "$coroutine" = "gthread" ; then 2796519175a2SAlex Barcelo coroutine_backend=gthread 2797519175a2SAlex Barceloelif test "$coroutine" = "windows" ; then 2798519175a2SAlex Barcelo coroutine_backend=windows 2799fe91bfa8SAlex Barceloelif test "$coroutine" = "sigaltstack" ; then 2800fe91bfa8SAlex Barcelo coroutine_backend=sigaltstack 2801519175a2SAlex Barceloelse 2802519175a2SAlex Barcelo echo 2803519175a2SAlex Barcelo echo "Error: unknown coroutine backend $coroutine" 2804519175a2SAlex Barcelo echo 2805519175a2SAlex Barcelo exit 1 2806d0e2fce5SAneesh Kumar K.Vfi 2807d0e2fce5SAneesh Kumar K.V 2808d0e2fce5SAneesh Kumar K.V########################################## 2809d2042378SAneesh Kumar K.V# check if we have open_by_handle_at 2810d2042378SAneesh Kumar K.V 2811d2042378SAneesh Kumar K.Vopen_by_hande_at=no 2812d2042378SAneesh Kumar K.Vcat > $TMPC << EOF 2813d2042378SAneesh Kumar K.V#include <fcntl.h> 281475cafad7SStefan Weilint main(void) { struct file_handle fh; return open_by_handle_at(0, &fh, 0); } 2815d2042378SAneesh Kumar K.VEOF 2816d2042378SAneesh Kumar K.Vif compile_prog "" "" ; then 2817d2042378SAneesh Kumar K.V open_by_handle_at=yes 2818d2042378SAneesh Kumar K.Vfi 2819d2042378SAneesh Kumar K.V 2820e06a765eSHarsh Prateek Bora######################################## 2821e06a765eSHarsh Prateek Bora# check if we have linux/magic.h 2822e06a765eSHarsh Prateek Bora 2823e06a765eSHarsh Prateek Boralinux_magic_h=no 2824e06a765eSHarsh Prateek Boracat > $TMPC << EOF 2825e06a765eSHarsh Prateek Bora#include <linux/magic.h> 2826e06a765eSHarsh Prateek Boraint main(void) { 282775cafad7SStefan Weil return 0; 2828e06a765eSHarsh Prateek Bora} 2829e06a765eSHarsh Prateek BoraEOF 2830e06a765eSHarsh Prateek Boraif compile_prog "" "" ; then 2831e06a765eSHarsh Prateek Bora linux_magic_h=yes 2832e06a765eSHarsh Prateek Borafi 2833e06a765eSHarsh Prateek Bora 2834d2042378SAneesh Kumar K.V########################################## 2835e86ecd4bSJuan Quintela# End of CC checks 2836e86ecd4bSJuan Quintela# After here, no more $cc or $ld runs 2837e86ecd4bSJuan Quintela 2838e86ecd4bSJuan Quintelaif test "$debug" = "no" ; then 28391156c669SJuan Quintela CFLAGS="-O2 $CFLAGS" 2840e86ecd4bSJuan Quintelafi 2841a316e378SJuan Quintela 2842e86ecd4bSJuan Quintela# Consult white-list to determine whether to enable werror 2843e86ecd4bSJuan Quintela# by default. Only enable by default for git builds 2844e86ecd4bSJuan Quintelaz_version=`cut -f3 -d. $source_path/VERSION` 284520ff6c80SAnthony Liguori 284620ff6c80SAnthony Liguoriif test -z "$werror" ; then 2847e86ecd4bSJuan Quintela if test "$z_version" = "50" -a \ 2848e86ecd4bSJuan Quintela "$linux" = "yes" ; then 2849e86ecd4bSJuan Quintela werror="yes" 2850e86ecd4bSJuan Quintela else 2851e86ecd4bSJuan Quintela werror="no" 2852e86ecd4bSJuan Quintela fi 2853e86ecd4bSJuan Quintelafi 2854e86ecd4bSJuan Quintela 285520ff6c80SAnthony Liguori# Disable zero malloc errors for official releases unless explicitly told to 285620ff6c80SAnthony Liguori# enable/disable 285720ff6c80SAnthony Liguoriif test -z "$zero_malloc" ; then 285820ff6c80SAnthony Liguori if test "$z_version" = "50" ; then 285920ff6c80SAnthony Liguori zero_malloc="no" 286020ff6c80SAnthony Liguori else 286120ff6c80SAnthony Liguori zero_malloc="yes" 286220ff6c80SAnthony Liguori fi 286320ff6c80SAnthony Liguorifi 286420ff6c80SAnthony Liguori 2865e86ecd4bSJuan Quintelaif test "$werror" = "yes" ; then 2866a558ee17SJuan Quintela QEMU_CFLAGS="-Werror $QEMU_CFLAGS" 2867e86ecd4bSJuan Quintelafi 2868e86ecd4bSJuan Quintela 2869e86ecd4bSJuan Quintelaif test "$solaris" = "no" ; then 2870e86ecd4bSJuan Quintela if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then 28711156c669SJuan Quintela LDFLAGS="-Wl,--warn-common $LDFLAGS" 2872e86ecd4bSJuan Quintela fi 2873e86ecd4bSJuan Quintelafi 2874e86ecd4bSJuan Quintela 287594dd53c5SGerd Hoffmann# test if pod2man has --utf8 option 287694dd53c5SGerd Hoffmannif pod2man --help | grep -q utf8; then 287794dd53c5SGerd Hoffmann POD2MAN="pod2man --utf8" 287894dd53c5SGerd Hoffmannelse 287994dd53c5SGerd Hoffmann POD2MAN="pod2man" 288094dd53c5SGerd Hoffmannfi 288194dd53c5SGerd Hoffmann 2882952afb71SBlue Swirl# Use ASLR, no-SEH and DEP if available 2883952afb71SBlue Swirlif test "$mingw32" = "yes" ; then 2884952afb71SBlue Swirl for flag in --dynamicbase --no-seh --nxcompat; do 2885952afb71SBlue Swirl if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then 2886952afb71SBlue Swirl LDFLAGS="-Wl,$flag $LDFLAGS" 2887952afb71SBlue Swirl fi 2888952afb71SBlue Swirl done 2889952afb71SBlue Swirlfi 2890952afb71SBlue Swirl 289110ea68b3SEduardo Habkostqemu_confdir=$sysconfdir$confsuffix 2892528ae5b8SEduardo Habkostqemu_datadir=$datadir$confsuffix 28935a67135aSbellard 2894ca35f780SPaolo Bonzinitools= 2895ca35f780SPaolo Bonziniif test "$softmmu" = yes ; then 2896ca35f780SPaolo Bonzini tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" 2897983eef5aSMeador Inge if test "$virtfs" != no ; then 2898be5ea8edSAnthony Liguori if test "$cap" = yes && test "$linux" = yes && test "$attr" = yes ; then 2899983eef5aSMeador Inge virtfs=yes 290017bff52bSM. Mohan Kumar tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)" 2901983eef5aSMeador Inge else 2902983eef5aSMeador Inge if test "$virtfs" = yes; then 2903983eef5aSMeador Inge feature_not_found "virtfs" 2904983eef5aSMeador Inge fi 2905*17500370SAndreas Färber virtfs=no 2906983eef5aSMeador Inge fi 290717bff52bSM. Mohan Kumar fi 2908ca35f780SPaolo Bonzini if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then 2909ca35f780SPaolo Bonzini tools="qemu-nbd\$(EXESUF) $tools" 2910d138cee9SMichael Roth if [ "$guest_agent" = "yes" ]; then 291148ff7a62SMichael Roth tools="qemu-ga\$(EXESUF) $tools" 2912d138cee9SMichael Roth fi 2913ca35f780SPaolo Bonzini fi 2914ca35f780SPaolo Bonzinifi 2915ca35f780SPaolo Bonzini 2916ca35f780SPaolo Bonzini# Mac OS X ships with a broken assembler 2917ca35f780SPaolo Bonziniroms= 2918ca35f780SPaolo Bonziniif test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ 2919ca35f780SPaolo Bonzini "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \ 2920ca35f780SPaolo Bonzini "$softmmu" = yes ; then 2921ca35f780SPaolo Bonzini roms="optionrom" 2922ca35f780SPaolo Bonzinifi 2923d0384d1dSAndreas Färberif test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then 292439ac8455SDavid Gibson roms="$roms spapr-rtas" 292539ac8455SDavid Gibsonfi 2926ca35f780SPaolo Bonzini 29277d13299dSbellardecho "Install prefix $prefix" 2928c00b2808SEduardo Habkostecho "BIOS directory `eval echo $qemu_datadir`" 2929f2b9e1e3SPaolo Bonziniecho "binary directory `eval echo $bindir`" 29303aa5d2beSAlon Levyecho "library directory `eval echo $libdir`" 29310f94d6daSAlon Levyecho "include directory `eval echo $includedir`" 29321c0fd160SAurelien Jarnoecho "config directory `eval echo $sysconfdir`" 293311d9f695Sbellardif test "$mingw32" = "no" ; then 2934f2b9e1e3SPaolo Bonziniecho "Manual directory `eval echo $mandir`" 293543ce4dfeSbellardecho "ELF interp prefix $interp_prefix" 293611d9f695Sbellardfi 29375a67135aSbellardecho "Source path $source_path" 29387d13299dSbellardecho "C compiler $cc" 293983469015Sbellardecho "Host C compiler $host_cc" 29400c439cbfSJuan Quintelaecho "CFLAGS $CFLAGS" 2941a558ee17SJuan Quintelaecho "QEMU_CFLAGS $QEMU_CFLAGS" 29420c439cbfSJuan Quintelaecho "LDFLAGS $LDFLAGS" 29437d13299dSbellardecho "make $make" 29446a882643Spbrookecho "install $install" 2945c886edfbSBlue Swirlecho "python $python" 2946e2d8830eSBradif test "$slirp" = "yes" ; then 2947e2d8830eSBrad echo "smbd $smbd" 2948e2d8830eSBradfi 2949a98fd896Sbellardecho "host CPU $cpu" 2950de83cd02Sbellardecho "host big endian $bigendian" 295197a847bcSbellardecho "target list $target_list" 2952ade25b0dSaurel32echo "tcg debug enabled $debug_tcg" 2953b4475aa2SLuiz Capitulinoecho "Mon debug enabled $debug_mon" 29547d13299dSbellardecho "gprof enabled $gprof" 295503b4fe7dSaliguoriecho "sparse enabled $sparse" 29561625af87Saliguoriecho "strip binaries $strip_opt" 295705c2a3e7Sbellardecho "profiler $profiler" 295843ce4dfeSbellardecho "static build $static" 295985aa5189Sbellardecho "-Werror enabled $werror" 29605b0753e0Sbellardif test "$darwin" = "yes" ; then 29615b0753e0Sbellard echo "Cocoa support $cocoa" 29625b0753e0Sbellardfi 296397a847bcSbellardecho "SDL support $sdl" 29644d3b6f6eSbalrogecho "curses support $curses" 2965769ce76dSAlexander Grafecho "curl support $curl" 296667b915a5Sbellardecho "mingw32 support $mingw32" 29670c58ac1cSmalcecho "Audio drivers $audio_drv_list" 29680c58ac1cSmalcecho "Extra audio cards $audio_card_list" 2969eb852011SMarkus Armbrusterecho "Block whitelist $block_drv_whitelist" 29708ff9cbf7Smalcecho "Mixer emulation $mixemu" 2971983eef5aSMeador Ingeecho "VirtFS support $virtfs" 2972821601eaSJes Sorensenecho "VNC support $vnc" 2973821601eaSJes Sorensenif test "$vnc" = "yes" ; then 29748d5d2d4cSths echo "VNC TLS support $vnc_tls" 29752f9606b3Saliguori echo "VNC SASL support $vnc_sasl" 29762f6f5c7aSCorentin Chary echo "VNC JPEG support $vnc_jpeg" 2977efe556adSCorentin Chary echo "VNC PNG support $vnc_png" 2978bd023f95SCorentin Chary echo "VNC thread $vnc_thread" 2979821601eaSJes Sorensenfi 29803142255cSblueswir1if test -n "$sparc_cpu"; then 29813142255cSblueswir1 echo "Target Sparc Arch $sparc_cpu" 29823142255cSblueswir1fi 2983e37630caSaliguoriecho "xen support $xen" 29842e4d9fb1Saurel32echo "brlapi support $brlapi" 2985a20a6f46SJuan Quintelaecho "bluez support $bluez" 2986a25dba17SJuan Quintelaecho "Documentation $docs" 2987c5937220Spbrook[ ! -z "$uname_release" ] && \ 2988c5937220Spbrookecho "uname -r $uname_release" 2989bd0c5661Spbrookecho "NPTL support $nptl" 2990379f6698SPaul Brookecho "GUEST_BASE $guest_base" 299140d6444eSAvi Kivityecho "PIE $pie" 29928a16d273Sthsecho "vde support $vde" 29935c6c3a6cSChristoph Hellwigecho "Linux AIO support $linux_aio" 2994758e8e38SVenkateswararao Jujjuri (JV)echo "ATTR/XATTR support $attr" 299577755340Sthsecho "Install blobs $blobs" 2996b31a0277SJuan Quintelaecho "KVM support $kvm" 29979195b2c2SStefan Weilecho "TCG interpreter $tcg_interpreter" 2998f652e6afSaurel32echo "fdt support $fdt" 2999ceb42de8Saliguoriecho "preadv support $preadv" 30005f6b9e8fSBlue Swirlecho "fdatasync $fdatasync" 3001e78815a5SAndreas Färberecho "madvise $madvise" 3002e78815a5SAndreas Färberecho "posix_madvise $posix_madvise" 3003ee682d27SStefan Weilecho "uuid support $uuid" 300447e98658SCorey Bryantecho "libcap-ng support $cap_ng" 3005d5970055SMichael S. Tsirkinecho "vhost-net support $vhost_net" 300694a420b1SStefan Hajnocziecho "Trace backend $trace_backend" 30079410b56cSPrerna Saxenaecho "Trace output file $trace_file-<pid>" 3008cd4ec0b4SGerd Hoffmannecho "spice support $spice" 3009f27aaf4bSChristian Brunnerecho "rbd support $rbd" 3010dce512deSChristoph Hellwigecho "xfsctl support $xfs" 3011111a38b0SRobert Relyeaecho "nss used $smartcard_nss" 301269354a83SHans de Goedeecho "usb net redir $usb_redir" 301320ff075bSMichael Walleecho "OpenGL support $opengl" 3014c589b249SRonnie Sahlbergecho "libiscsi support $libiscsi" 3015d138cee9SMichael Rothecho "build guest agent $guest_agent" 3016519175a2SAlex Barceloecho "coroutine backend $coroutine_backend" 301767b915a5Sbellard 30181ba16968SStefan Weilif test "$sdl_too_old" = "yes"; then 301924b55b96Sbellardecho "-> Your SDL version is too old - please upgrade to have SDL support" 3020e8cd23deSbellardfi 302197a847bcSbellard 302298ec69acSJuan Quintelaconfig_host_mak="config-host.mak" 30234bf6b55bSJuan Quintelaconfig_host_ld="config-host.ld" 302497a847bcSbellard 302598ec69acSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_host_mak 302698ec69acSJuan Quintelaprintf "# Configured with:" >> $config_host_mak 302798ec69acSJuan Quintelaprintf " '%s'" "$0" "$@" >> $config_host_mak 302898ec69acSJuan Quintelaecho >> $config_host_mak 302998ec69acSJuan Quintela 3030e6c3b0f7SPaolo Bonziniecho all: >> $config_host_mak 303199d7cc75SPaolo Bonziniecho "prefix=$prefix" >> $config_host_mak 303299d7cc75SPaolo Bonziniecho "bindir=$bindir" >> $config_host_mak 30333aa5d2beSAlon Levyecho "libdir=$libdir" >> $config_host_mak 30340f94d6daSAlon Levyecho "includedir=$includedir" >> $config_host_mak 303599d7cc75SPaolo Bonziniecho "mandir=$mandir" >> $config_host_mak 303699d7cc75SPaolo Bonziniecho "sysconfdir=$sysconfdir" >> $config_host_mak 303722d07038SEduardo Habkostecho "qemu_confdir=$qemu_confdir" >> $config_host_mak 30389afa52ceSEduardo Habkostecho "qemu_datadir=$qemu_datadir" >> $config_host_mak 30399afa52ceSEduardo Habkostecho "qemu_docdir=$qemu_docdir" >> $config_host_mak 30407b93fadfSCorey Bryantecho "libexecdir=\${prefix}/libexec" >> $config_host_mak 3041a7c36ee4SCorey Bryantecho "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak 3042804edf29SJuan Quintela 304398ec69acSJuan Quintelaecho "ARCH=$ARCH" >> $config_host_mak 3044f8393946Saurel32if test "$debug_tcg" = "yes" ; then 30452358a494SJuan Quintela echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak 3046f8393946Saurel32fi 3047b4475aa2SLuiz Capitulinoif test "$debug_mon" = "yes" ; then 3048b4475aa2SLuiz Capitulino echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak 3049b4475aa2SLuiz Capitulinofi 3050f3d08ee6SPaul Brookif test "$debug" = "yes" ; then 30512358a494SJuan Quintela echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak 3052f3d08ee6SPaul Brookfi 30531625af87Saliguoriif test "$strip_opt" = "yes" ; then 305452ba784dSHollis Blanchard echo "STRIP=${strip}" >> $config_host_mak 30551625af87Saliguorifi 30567d13299dSbellardif test "$bigendian" = "yes" ; then 3057e2542fe2SJuan Quintela echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak 305897a847bcSbellardfi 305967b915a5Sbellardif test "$mingw32" = "yes" ; then 306098ec69acSJuan Quintela echo "CONFIG_WIN32=y" >> $config_host_mak 30619fe6de94SBlue Swirl rc_version=`cat $source_path/VERSION` 30629fe6de94SBlue Swirl version_major=${rc_version%%.*} 30639fe6de94SBlue Swirl rc_version=${rc_version#*.} 30649fe6de94SBlue Swirl version_minor=${rc_version%%.*} 30659fe6de94SBlue Swirl rc_version=${rc_version#*.} 30669fe6de94SBlue Swirl version_subminor=${rc_version%%.*} 30679fe6de94SBlue Swirl version_micro=0 30689fe6de94SBlue Swirl echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 30699fe6de94SBlue Swirl echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak 3070210fa556Spbrookelse 307135f4df27SJuan Quintela echo "CONFIG_POSIX=y" >> $config_host_mak 3072210fa556Spbrookfi 3073128ab2ffSblueswir1 3074dffcb71cSMark McLoughlinif test "$linux" = "yes" ; then 3075dffcb71cSMark McLoughlin echo "CONFIG_LINUX=y" >> $config_host_mak 3076dffcb71cSMark McLoughlinfi 3077dffcb71cSMark McLoughlin 307883fb7adfSbellardif test "$darwin" = "yes" ; then 307998ec69acSJuan Quintela echo "CONFIG_DARWIN=y" >> $config_host_mak 308083fb7adfSbellardfi 3081b29fe3edSmalc 3082b29fe3edSmalcif test "$aix" = "yes" ; then 308398ec69acSJuan Quintela echo "CONFIG_AIX=y" >> $config_host_mak 3084b29fe3edSmalcfi 3085b29fe3edSmalc 3086ec530c81Sbellardif test "$solaris" = "yes" ; then 308798ec69acSJuan Quintela echo "CONFIG_SOLARIS=y" >> $config_host_mak 30882358a494SJuan Quintela echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak 30890475a5caSths if test "$needs_libsunmath" = "yes" ; then 309075b5a697SJuan Quintela echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak 30910475a5caSths fi 3092ec530c81Sbellardfi 3093179cf400SAndreas Färberif test "$haiku" = "yes" ; then 3094179cf400SAndreas Färber echo "CONFIG_HAIKU=y" >> $config_host_mak 3095179cf400SAndreas Färberfi 309697a847bcSbellardif test "$static" = "yes" ; then 309798ec69acSJuan Quintela echo "CONFIG_STATIC=y" >> $config_host_mak 309897a847bcSbellardfi 30991ba16968SStefan Weilif test "$profiler" = "yes" ; then 31002358a494SJuan Quintela echo "CONFIG_PROFILER=y" >> $config_host_mak 310105c2a3e7Sbellardfi 3102c20709aaSbellardif test "$slirp" = "yes" ; then 310398ec69acSJuan Quintela echo "CONFIG_SLIRP=y" >> $config_host_mak 3104e2d8830eSBrad echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak 3105f9728943SPaolo Bonzini QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" 3106c20709aaSbellardfi 31078a16d273Sthsif test "$vde" = "yes" ; then 310898ec69acSJuan Quintela echo "CONFIG_VDE=y" >> $config_host_mak 31098a16d273Sthsfi 311047e98658SCorey Bryantif test "$cap_ng" = "yes" ; then 311147e98658SCorey Bryant echo "CONFIG_LIBCAP=y" >> $config_host_mak 311247e98658SCorey Bryantfi 31130c58ac1cSmalcfor card in $audio_card_list; do 3114bb55b712SStefan Weil def=CONFIG_`echo $card | LC_ALL=C tr '[a-z]' '[A-Z]'` 311598ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 31160c58ac1cSmalcdone 31172358a494SJuan Quintelaecho "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak 31180c58ac1cSmalcfor drv in $audio_drv_list; do 3119bb55b712SStefan Weil def=CONFIG_`echo $drv | LC_ALL=C tr '[a-z]' '[A-Z]'` 312098ec69acSJuan Quintela echo "$def=y" >> $config_host_mak 3121923e4521Smalc if test "$drv" = "fmod"; then 31227aac6cb1SJuan Quintela echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak 3123fb065187Sbellard fi 31240c58ac1cSmalcdone 312567f86e8eSJuan Quintelaif test "$audio_pt_int" = "yes" ; then 312667f86e8eSJuan Quintela echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak 312767f86e8eSJuan Quintelafi 3128d5631638Smalcif test "$audio_win_int" = "yes" ; then 3129d5631638Smalc echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak 3130d5631638Smalcfi 3131eb852011SMarkus Armbrusterecho "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak 31328ff9cbf7Smalcif test "$mixemu" = "yes" ; then 313398ec69acSJuan Quintela echo "CONFIG_MIXEMU=y" >> $config_host_mak 31348ff9cbf7Smalcfi 3135821601eaSJes Sorensenif test "$vnc" = "yes" ; then 3136821601eaSJes Sorensen echo "CONFIG_VNC=y" >> $config_host_mak 3137821601eaSJes Sorensenfi 31388d5d2d4cSthsif test "$vnc_tls" = "yes" ; then 313998ec69acSJuan Quintela echo "CONFIG_VNC_TLS=y" >> $config_host_mak 3140525061bfSJuan Quintela echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak 31418d5d2d4cSthsfi 31422f9606b3Saliguoriif test "$vnc_sasl" = "yes" ; then 314398ec69acSJuan Quintela echo "CONFIG_VNC_SASL=y" >> $config_host_mak 314460ddf533SJuan Quintela echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak 31452f9606b3Saliguorifi 3146821601eaSJes Sorensenif test "$vnc_jpeg" = "yes" ; then 31472f6f5c7aSCorentin Chary echo "CONFIG_VNC_JPEG=y" >> $config_host_mak 31482f6f5c7aSCorentin Chary echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak 31492f6f5c7aSCorentin Charyfi 3150821601eaSJes Sorensenif test "$vnc_png" = "yes" ; then 3151efe556adSCorentin Chary echo "CONFIG_VNC_PNG=y" >> $config_host_mak 3152efe556adSCorentin Chary echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak 3153efe556adSCorentin Charyfi 3154821601eaSJes Sorensenif test "$vnc_thread" = "yes" ; then 3155bd023f95SCorentin Chary echo "CONFIG_VNC_THREAD=y" >> $config_host_mak 3156bd023f95SCorentin Charyfi 315776655d6dSaliguoriif test "$fnmatch" = "yes" ; then 31582358a494SJuan Quintela echo "CONFIG_FNMATCH=y" >> $config_host_mak 315976655d6dSaliguorifi 3160ee682d27SStefan Weilif test "$uuid" = "yes" ; then 3161ee682d27SStefan Weil echo "CONFIG_UUID=y" >> $config_host_mak 3162ee682d27SStefan Weilfi 3163dce512deSChristoph Hellwigif test "$xfs" = "yes" ; then 3164dce512deSChristoph Hellwig echo "CONFIG_XFS=y" >> $config_host_mak 3165dce512deSChristoph Hellwigfi 3166b1a550a0Spbrookqemu_version=`head $source_path/VERSION` 316798ec69acSJuan Quintelaecho "VERSION=$qemu_version" >>$config_host_mak 31682358a494SJuan Quintelaecho "PKGVERSION=$pkgversion" >>$config_host_mak 316998ec69acSJuan Quintelaecho "SRC_PATH=$source_path" >> $config_host_mak 317098ec69acSJuan Quintelaecho "TARGET_DIRS=$target_list" >> $config_host_mak 3171a25dba17SJuan Quintelaif [ "$docs" = "yes" ] ; then 317298ec69acSJuan Quintela echo "BUILD_DOCS=yes" >> $config_host_mak 3173cc8ae6deSpbrookfi 31741ac88f28SJuan Quintelaif test "$sdl" = "yes" ; then 317598ec69acSJuan Quintela echo "CONFIG_SDL=y" >> $config_host_mak 31768ad3a7ddSJuan Quintela echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak 317749ecc3faSbellardfi 317849ecc3faSbellardif test "$cocoa" = "yes" ; then 317998ec69acSJuan Quintela echo "CONFIG_COCOA=y" >> $config_host_mak 318049ecc3faSbellardfi 31814d3b6f6eSbalrogif test "$curses" = "yes" ; then 318298ec69acSJuan Quintela echo "CONFIG_CURSES=y" >> $config_host_mak 3183ab4e5602SJan Kiszkafi 31843b3f24adSaurel32if test "$atfile" = "yes" ; then 31852358a494SJuan Quintela echo "CONFIG_ATFILE=y" >> $config_host_mak 31863b3f24adSaurel32fi 3187ebc996f3SRiku Voipioif test "$utimens" = "yes" ; then 31882358a494SJuan Quintela echo "CONFIG_UTIMENSAT=y" >> $config_host_mak 3189ebc996f3SRiku Voipiofi 3190099d6b0fSRiku Voipioif test "$pipe2" = "yes" ; then 31912358a494SJuan Quintela echo "CONFIG_PIPE2=y" >> $config_host_mak 3192099d6b0fSRiku Voipiofi 319340ff6d7eSKevin Wolfif test "$accept4" = "yes" ; then 319440ff6d7eSKevin Wolf echo "CONFIG_ACCEPT4=y" >> $config_host_mak 319540ff6d7eSKevin Wolffi 31963ce34dfbSvibisreenivasanif test "$splice" = "yes" ; then 31972358a494SJuan Quintela echo "CONFIG_SPLICE=y" >> $config_host_mak 31983ce34dfbSvibisreenivasanfi 3199c2882b96SRiku Voipioif test "$eventfd" = "yes" ; then 3200c2882b96SRiku Voipio echo "CONFIG_EVENTFD=y" >> $config_host_mak 3201c2882b96SRiku Voipiofi 3202d0927938SUlrich Hechtif test "$fallocate" = "yes" ; then 3203d0927938SUlrich Hecht echo "CONFIG_FALLOCATE=y" >> $config_host_mak 3204d0927938SUlrich Hechtfi 3205c727f47dSPeter Maydellif test "$sync_file_range" = "yes" ; then 3206c727f47dSPeter Maydell echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak 3207c727f47dSPeter Maydellfi 3208dace20dcSPeter Maydellif test "$fiemap" = "yes" ; then 3209dace20dcSPeter Maydell echo "CONFIG_FIEMAP=y" >> $config_host_mak 3210dace20dcSPeter Maydellfi 3211d0927938SUlrich Hechtif test "$dup3" = "yes" ; then 3212d0927938SUlrich Hecht echo "CONFIG_DUP3=y" >> $config_host_mak 3213d0927938SUlrich Hechtfi 32143b6edd16SPeter Maydellif test "$epoll" = "yes" ; then 32153b6edd16SPeter Maydell echo "CONFIG_EPOLL=y" >> $config_host_mak 32163b6edd16SPeter Maydellfi 32173b6edd16SPeter Maydellif test "$epoll_create1" = "yes" ; then 32183b6edd16SPeter Maydell echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak 32193b6edd16SPeter Maydellfi 32203b6edd16SPeter Maydellif test "$epoll_pwait" = "yes" ; then 32213b6edd16SPeter Maydell echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak 32223b6edd16SPeter Maydellfi 32233b3f24adSaurel32if test "$inotify" = "yes" ; then 32242358a494SJuan Quintela echo "CONFIG_INOTIFY=y" >> $config_host_mak 32253b3f24adSaurel32fi 3226c05c7a73SRiku Voipioif test "$inotify1" = "yes" ; then 3227c05c7a73SRiku Voipio echo "CONFIG_INOTIFY1=y" >> $config_host_mak 3228c05c7a73SRiku Voipiofi 32296ae9a1f4SJuan Quintelaif test "$byteswap_h" = "yes" ; then 32306ae9a1f4SJuan Quintela echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak 32316ae9a1f4SJuan Quintelafi 32326ae9a1f4SJuan Quintelaif test "$bswap_h" = "yes" ; then 32336ae9a1f4SJuan Quintela echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak 32346ae9a1f4SJuan Quintelafi 3235769ce76dSAlexander Grafif test "$curl" = "yes" ; then 323698ec69acSJuan Quintela echo "CONFIG_CURL=y" >> $config_host_mak 3237b1d5a277SJuan Quintela echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak 3238769ce76dSAlexander Graffi 32392e4d9fb1Saurel32if test "$brlapi" = "yes" ; then 324098ec69acSJuan Quintela echo "CONFIG_BRLAPI=y" >> $config_host_mak 32412e4d9fb1Saurel32fi 3242fb599c9aSbalrogif test "$bluez" = "yes" ; then 324398ec69acSJuan Quintela echo "CONFIG_BLUEZ=y" >> $config_host_mak 3244ef7635ecSJuan Quintela echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak 3245fb599c9aSbalrogfi 3246e18df141SAnthony Liguoriecho "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak 3247e37630caSaliguoriif test "$xen" = "yes" ; then 32486dbd588aSJan Kiszka echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak 3249d5b93ddfSAnthony PERARD echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak 3250e37630caSaliguorifi 32515c6c3a6cSChristoph Hellwigif test "$linux_aio" = "yes" ; then 32525c6c3a6cSChristoph Hellwig echo "CONFIG_LINUX_AIO=y" >> $config_host_mak 32535c6c3a6cSChristoph Hellwigfi 3254758e8e38SVenkateswararao Jujjuri (JV)if test "$attr" = "yes" ; then 3255758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_ATTR=y" >> $config_host_mak 3256758e8e38SVenkateswararao Jujjuri (JV)fi 32574f26f2b6SAvi Kivityif test "$libattr" = "yes" ; then 32584f26f2b6SAvi Kivity echo "CONFIG_LIBATTR=y" >> $config_host_mak 32594f26f2b6SAvi Kivityfi 3260983eef5aSMeador Ingeif test "$virtfs" = "yes" ; then 3261758e8e38SVenkateswararao Jujjuri (JV) echo "CONFIG_VIRTFS=y" >> $config_host_mak 3262758e8e38SVenkateswararao Jujjuri (JV)fi 326377755340Sthsif test "$blobs" = "yes" ; then 326498ec69acSJuan Quintela echo "INSTALL_BLOBS=yes" >> $config_host_mak 326577755340Sthsfi 3266bf9298b9Saliguoriif test "$iovec" = "yes" ; then 32672358a494SJuan Quintela echo "CONFIG_IOVEC=y" >> $config_host_mak 3268bf9298b9Saliguorifi 3269ceb42de8Saliguoriif test "$preadv" = "yes" ; then 32702358a494SJuan Quintela echo "CONFIG_PREADV=y" >> $config_host_mak 3271ceb42de8Saliguorifi 3272f652e6afSaurel32if test "$fdt" = "yes" ; then 32733f0855b1SJuan Quintela echo "CONFIG_FDT=y" >> $config_host_mak 3274f652e6afSaurel32fi 3275dcc38d1cSMarcelo Tosattiif test "$signalfd" = "yes" ; then 3276dcc38d1cSMarcelo Tosatti echo "CONFIG_SIGNALFD=y" >> $config_host_mak 3277dcc38d1cSMarcelo Tosattifi 32789195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 32799195b2c2SStefan Weil echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak 32809195b2c2SStefan Weilfi 32815f6b9e8fSBlue Swirlif test "$fdatasync" = "yes" ; then 32825f6b9e8fSBlue Swirl echo "CONFIG_FDATASYNC=y" >> $config_host_mak 32835f6b9e8fSBlue Swirlfi 3284e78815a5SAndreas Färberif test "$madvise" = "yes" ; then 3285e78815a5SAndreas Färber echo "CONFIG_MADVISE=y" >> $config_host_mak 3286e78815a5SAndreas Färberfi 3287e78815a5SAndreas Färberif test "$posix_madvise" = "yes" ; then 3288e78815a5SAndreas Färber echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak 3289e78815a5SAndreas Färberfi 329097a847bcSbellard 3291cd4ec0b4SGerd Hoffmannif test "$spice" = "yes" ; then 3292cd4ec0b4SGerd Hoffmann echo "CONFIG_SPICE=y" >> $config_host_mak 3293cd4ec0b4SGerd Hoffmannfi 3294cd4ec0b4SGerd Hoffmann 329536707144SAlon Levyif test "$smartcard" = "yes" ; then 329636707144SAlon Levy echo "CONFIG_SMARTCARD=y" >> $config_host_mak 329736707144SAlon Levyfi 329836707144SAlon Levy 3299111a38b0SRobert Relyeaif test "$smartcard_nss" = "yes" ; then 3300111a38b0SRobert Relyea echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak 3301ad4cf3f6SPaul Brook echo "libcacard_libs=$libcacard_libs" >> $config_host_mak 3302ad4cf3f6SPaul Brook echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak 3303111a38b0SRobert Relyeafi 3304111a38b0SRobert Relyea 330569354a83SHans de Goedeif test "$usb_redir" = "yes" ; then 330669354a83SHans de Goede echo "CONFIG_USB_REDIR=y" >> $config_host_mak 330769354a83SHans de Goedefi 330869354a83SHans de Goede 330920ff075bSMichael Walleif test "$opengl" = "yes" ; then 331020ff075bSMichael Walle echo "CONFIG_OPENGL=y" >> $config_host_mak 331120ff075bSMichael Wallefi 331220ff075bSMichael Walle 3313c589b249SRonnie Sahlbergif test "$libiscsi" = "yes" ; then 3314c589b249SRonnie Sahlberg echo "CONFIG_LIBISCSI=y" >> $config_host_mak 3315c589b249SRonnie Sahlbergfi 3316c589b249SRonnie Sahlberg 331783fb7adfSbellard# XXX: suppress that 33187d3505c5Sbellardif [ "$bsd" = "yes" ] ; then 33192358a494SJuan Quintela echo "CONFIG_BSD=y" >> $config_host_mak 33207d3505c5Sbellardfi 33217d3505c5Sbellard 33222358a494SJuan Quintelaecho "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak 3323c5937220Spbrook 332420ff6c80SAnthony Liguoriif test "$zero_malloc" = "yes" ; then 332520ff6c80SAnthony Liguori echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak 332620ff6c80SAnthony Liguorifi 3327f27aaf4bSChristian Brunnerif test "$rbd" = "yes" ; then 3328f27aaf4bSChristian Brunner echo "CONFIG_RBD=y" >> $config_host_mak 3329f27aaf4bSChristian Brunnerfi 333020ff6c80SAnthony Liguori 3331519175a2SAlex Barceloif test "$coroutine_backend" = "ucontext" ; then 3332d0e2fce5SAneesh Kumar K.V echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak 3333fe91bfa8SAlex Barceloelif test "$coroutine_backend" = "sigaltstack" ; then 3334fe91bfa8SAlex Barcelo echo "CONFIG_SIGALTSTACK_COROUTINE=y" >> $config_host_mak 3335d0e2fce5SAneesh Kumar K.Vfi 3336d0e2fce5SAneesh Kumar K.V 3337d2042378SAneesh Kumar K.Vif test "$open_by_handle_at" = "yes" ; then 3338d2042378SAneesh Kumar K.V echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak 3339d2042378SAneesh Kumar K.Vfi 3340d2042378SAneesh Kumar K.V 3341e06a765eSHarsh Prateek Boraif test "$linux_magic_h" = "yes" ; then 3342e06a765eSHarsh Prateek Bora echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak 3343e06a765eSHarsh Prateek Borafi 3344e06a765eSHarsh Prateek Bora 334568063649Sblueswir1# USB host support 334668063649Sblueswir1case "$usb" in 334768063649Sblueswir1linux) 334898ec69acSJuan Quintela echo "HOST_USB=linux" >> $config_host_mak 334968063649Sblueswir1;; 335068063649Sblueswir1bsd) 335198ec69acSJuan Quintela echo "HOST_USB=bsd" >> $config_host_mak 335268063649Sblueswir1;; 335368063649Sblueswir1*) 335498ec69acSJuan Quintela echo "HOST_USB=stub" >> $config_host_mak 335568063649Sblueswir1;; 335668063649Sblueswir1esac 335768063649Sblueswir1 3358e4858974SLluís# use default implementation for tracing backend-specific routines 3359e4858974SLluístrace_default=yes 336094a420b1SStefan Hajnocziecho "TRACE_BACKEND=$trace_backend" >> $config_host_mak 33616d8a764eSLluísif test "$trace_backend" = "nop"; then 33626d8a764eSLluís echo "CONFIG_TRACE_NOP=y" >> $config_host_mak 336322890ab5SPrerna Saxenafi 33649410b56cSPrerna Saxenaif test "$trace_backend" = "simple"; then 33656d8a764eSLluís echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak 3366e4858974SLluís trace_default=no 33676d8a764eSLluís # Set the appropriate trace file. 3368953ffe0fSAndreas Färber trace_file="\"$trace_file-\" FMT_pid" 33699410b56cSPrerna Saxenafi 33706d8a764eSLluísif test "$trace_backend" = "stderr"; then 33716d8a764eSLluís echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak 33729a82b6a5SLluís trace_default=no 33736d8a764eSLluísfi 33746d8a764eSLluísif test "$trace_backend" = "ust"; then 33756d8a764eSLluís echo "CONFIG_TRACE_UST=y" >> $config_host_mak 33766d8a764eSLluísfi 33776d8a764eSLluísif test "$trace_backend" = "dtrace"; then 33786d8a764eSLluís echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak 33796d8a764eSLluís if test "$trace_backend_stap" = "yes" ; then 33806d8a764eSLluís echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak 33816d8a764eSLluís fi 3382c276b17dSDaniel P. Berrangefi 33839410b56cSPrerna Saxenaecho "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak 3384e4858974SLluísif test "$trace_default" = "yes"; then 3385e4858974SLluís echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak 3386e4858974SLluísfi 33879410b56cSPrerna Saxena 338898ec69acSJuan Quintelaecho "TOOLS=$tools" >> $config_host_mak 338998ec69acSJuan Quintelaecho "ROMS=$roms" >> $config_host_mak 3390804edf29SJuan Quintelaecho "MAKE=$make" >> $config_host_mak 3391804edf29SJuan Quintelaecho "INSTALL=$install" >> $config_host_mak 33921901cb14SBradecho "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak 33931901cb14SBradecho "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak 33941901cb14SBradecho "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak 3395c886edfbSBlue Swirlecho "PYTHON=$python" >> $config_host_mak 3396804edf29SJuan Quintelaecho "CC=$cc" >> $config_host_mak 33972b2e59e6SPaolo Bonziniecho "CC_I386=$cc_i386" >> $config_host_mak 3398804edf29SJuan Quintelaecho "HOST_CC=$host_cc" >> $config_host_mak 3399804edf29SJuan Quintelaecho "AR=$ar" >> $config_host_mak 3400804edf29SJuan Quintelaecho "OBJCOPY=$objcopy" >> $config_host_mak 3401804edf29SJuan Quintelaecho "LD=$ld" >> $config_host_mak 34029fe6de94SBlue Swirlecho "WINDRES=$windres" >> $config_host_mak 340344dc0ca3SAlon Levyecho "LIBTOOL=$libtool" >> $config_host_mak 3404e2a2ed06SJuan Quintelaecho "CFLAGS=$CFLAGS" >> $config_host_mak 3405a558ee17SJuan Quintelaecho "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak 3406f9728943SPaolo Bonziniecho "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak 3407e39f0062SPaolo Bonziniif test "$sparse" = "yes" ; then 3408e39f0062SPaolo Bonzini echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak 3409e39f0062SPaolo Bonzini echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak 3410e39f0062SPaolo Bonzini echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak 3411e39f0062SPaolo Bonzinifi 3412c81da56eSJuan Quintelaecho "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak 3413e2a2ed06SJuan Quintelaecho "LDFLAGS=$LDFLAGS" >> $config_host_mak 3414a36abbbbSJuan Quintelaecho "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak 3415a36abbbbSJuan Quintelaecho "ARLIBS_END=$arlibs_end" >> $config_host_mak 341673da375eSJuan Quintelaecho "LIBS+=$LIBS" >> $config_host_mak 34173e2e0e6bSJuan Quintelaecho "LIBS_TOOLS+=$libs_tools" >> $config_host_mak 3418804edf29SJuan Quintelaecho "EXESUF=$EXESUF" >> $config_host_mak 3419957f1f99SMichael Rothecho "LIBS_QGA+=$libs_qga" >> $config_host_mak 342094dd53c5SGerd Hoffmannecho "POD2MAN=$POD2MAN" >> $config_host_mak 3421804edf29SJuan Quintela 34224bf6b55bSJuan Quintela# generate list of library paths for linker script 34234bf6b55bSJuan Quintela 34244bf6b55bSJuan Quintela$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld} 34254bf6b55bSJuan Quintela 34264bf6b55bSJuan Quintelaif test -f ${config_host_ld}~ ; then 34274bf6b55bSJuan Quintela if cmp -s $config_host_ld ${config_host_ld}~ ; then 34284bf6b55bSJuan Quintela mv ${config_host_ld}~ $config_host_ld 34294bf6b55bSJuan Quintela else 34304bf6b55bSJuan Quintela rm ${config_host_ld}~ 34314bf6b55bSJuan Quintela fi 34324bf6b55bSJuan Quintelafi 34334bf6b55bSJuan Quintela 34344d904533SBlue Swirlfor d in libdis libdis-user; do 34354d904533SBlue Swirl mkdir -p $d 343672b8b5a1SStefan Weil symlink "$source_path/Makefile.dis" "$d/Makefile" 34374d904533SBlue Swirl echo > $d/config.mak 34384d904533SBlue Swirldone 34394d904533SBlue Swirl 34406efd7517SPeter Maydell# use included Linux headers 34416efd7517SPeter Maydellif test "$linux" = "yes" ; then 34426efd7517SPeter Maydell mkdir -p linux-headers 34436efd7517SPeter Maydell case "$cpu" in 34446efd7517SPeter Maydell i386|x86_64) 344572b8b5a1SStefan Weil symlink "$source_path/linux-headers/asm-x86" linux-headers/asm 34466efd7517SPeter Maydell ;; 34476efd7517SPeter Maydell ppcemb|ppc|ppc64) 344872b8b5a1SStefan Weil symlink "$source_path/linux-headers/asm-powerpc" linux-headers/asm 34496efd7517SPeter Maydell ;; 34506efd7517SPeter Maydell s390x) 345172b8b5a1SStefan Weil symlink "$source_path/linux-headers/asm-s390" linux-headers/asm 34526efd7517SPeter Maydell ;; 34536efd7517SPeter Maydell esac 34546efd7517SPeter Maydellfi 34556efd7517SPeter Maydell 345697a847bcSbellardfor target in $target_list; do 345797a847bcSbellardtarget_dir="$target" 345825be210fSJuan Quintelaconfig_target_mak=$target_dir/config-target.mak 3459600309b6SBlue Swirltarget_arch2=`echo $target | cut -d '-' -f 1` 346097a847bcSbellardtarget_bigendian="no" 34611f3d3c8fSJuan Quintela 3462ea2d6a39SJuan Quintelacase "$target_arch2" in 3463cfa550c6SMax Filippov armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) 3464ea2d6a39SJuan Quintela target_bigendian=yes 3465ea2d6a39SJuan Quintela ;; 3466ea2d6a39SJuan Quintelaesac 346797a847bcSbellardtarget_softmmu="no" 3468997344f3Sbellardtarget_user_only="no" 3469831b7825Sthstarget_linux_user="no" 347084778508Sblueswir1target_bsd_user="no" 34719e407a85Spbrookcase "$target" in 3472600309b6SBlue Swirl ${target_arch2}-softmmu) 34739e407a85Spbrook target_softmmu="yes" 34749e407a85Spbrook ;; 3475600309b6SBlue Swirl ${target_arch2}-linux-user) 34769c7a4202SBlue Swirl if test "$linux" != "yes" ; then 34779c7a4202SBlue Swirl echo "ERROR: Target '$target' is only available on a Linux host" 34789c7a4202SBlue Swirl exit 1 34799c7a4202SBlue Swirl fi 34809e407a85Spbrook target_user_only="yes" 34819e407a85Spbrook target_linux_user="yes" 34829e407a85Spbrook ;; 3483600309b6SBlue Swirl ${target_arch2}-bsd-user) 34849cf55765SBlue Swirl if test "$bsd" != "yes" ; then 34859c7a4202SBlue Swirl echo "ERROR: Target '$target' is only available on a BSD host" 34869c7a4202SBlue Swirl exit 1 34879c7a4202SBlue Swirl fi 348884778508Sblueswir1 target_user_only="yes" 348984778508Sblueswir1 target_bsd_user="yes" 349084778508Sblueswir1 ;; 34919e407a85Spbrook *) 34929e407a85Spbrook echo "ERROR: Target '$target' not recognised" 34939e407a85Spbrook exit 1 34949e407a85Spbrook ;; 34959e407a85Spbrookesac 3496831b7825Sths 349797a847bcSbellardmkdir -p $target_dir 3498158142c2Sbellardmkdir -p $target_dir/fpu 349957fec1feSbellardmkdir -p $target_dir/tcg 350059f2a787SGerd Hoffmannmkdir -p $target_dir/ide 3501f1ae32a1SGerd Hoffmannmkdir -p $target_dir/usb 3502353ac78dSAneesh Kumar K.Vmkdir -p $target_dir/9pfs 35033b9a6ee5SJan Kiszkamkdir -p $target_dir/kvm 350484778508Sblueswir1if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then 350569de927cSbellard mkdir -p $target_dir/nwfpe 350669de927cSbellardfi 350772b8b5a1SStefan Weilsymlink "$source_path/Makefile.target" "$target_dir/Makefile" 3508ec530c81Sbellard 350997a847bcSbellard 351025be210fSJuan Quintelaecho "# Automatically generated by configure - do not modify" > $config_target_mak 351197a847bcSbellard 3512e5fe0c52Spbrookbflt="no" 3513bd0c5661Spbrooktarget_nptl="no" 3514600309b6SBlue Swirlinterp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` 351556aebc89Spbrookgdb_xml_files="" 3516c2e3dee6SLaurent Viviertarget_short_alignment=2 3517c2e3dee6SLaurent Viviertarget_int_alignment=4 3518c2e3dee6SLaurent Viviertarget_long_alignment=4 3519c2e3dee6SLaurent Viviertarget_llong_alignment=8 3520de3a354aSMichael Walletarget_libs_softmmu= 35217ba1e619Saliguori 3522938b1eddSJuan QuintelaTARGET_ARCH="$target_arch2" 35236acff7daSJuan QuintelaTARGET_BASE_ARCH="" 3524e6e91b9cSJuan QuintelaTARGET_ABI_DIR="" 3525e73aae67SJuan Quintela 3526600309b6SBlue Swirlcase "$target_arch2" in 35272408a527Saurel32 i386) 352871deff27SAurelien Jarno target_phys_bits=64 35292408a527Saurel32 ;; 35302408a527Saurel32 x86_64) 35316acff7daSJuan Quintela TARGET_BASE_ARCH=i386 35321ad2134fSPaul Brook target_phys_bits=64 3533c2e3dee6SLaurent Vivier target_long_alignment=8 35342408a527Saurel32 ;; 35352408a527Saurel32 alpha) 35361ad2134fSPaul Brook target_phys_bits=64 3537c2e3dee6SLaurent Vivier target_long_alignment=8 3538a4b388ffSRichard Henderson target_nptl="yes" 35392408a527Saurel32 ;; 35402408a527Saurel32 arm|armeb) 3541b498c8a0SJuan Quintela TARGET_ARCH=arm 3542e5fe0c52Spbrook bflt="yes" 3543bd0c5661Spbrook target_nptl="yes" 354456aebc89Spbrook gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" 35451ad2134fSPaul Brook target_phys_bits=32 3546c2e3dee6SLaurent Vivier target_llong_alignment=4 3547412beee6SGrant Likely target_libs_softmmu="$fdt_libs" 35482408a527Saurel32 ;; 35492408a527Saurel32 cris) 3550253bd7f8Sedgar_igl target_nptl="yes" 35511ad2134fSPaul Brook target_phys_bits=32 35522408a527Saurel32 ;; 3553613a22c9SMichael Walle lm32) 3554613a22c9SMichael Walle target_phys_bits=32 3555de3a354aSMichael Walle target_libs_softmmu="$opengl_libs" 3556613a22c9SMichael Walle ;; 35572408a527Saurel32 m68k) 35580938cda5Saurel32 bflt="yes" 355956aebc89Spbrook gdb_xml_files="cf-core.xml cf-fp.xml" 35601ad2134fSPaul Brook target_phys_bits=32 3561c2e3dee6SLaurent Vivier target_int_alignment=2 3562c2e3dee6SLaurent Vivier target_long_alignment=2 3563c2e3dee6SLaurent Vivier target_llong_alignment=2 35642408a527Saurel32 ;; 3565877fdc12SEdgar E. Iglesias microblaze|microblazeel) 3566877fdc12SEdgar E. Iglesias TARGET_ARCH=microblaze 356772b675caSEdgar E. Iglesias bflt="yes" 356872b675caSEdgar E. Iglesias target_nptl="yes" 356972b675caSEdgar E. Iglesias target_phys_bits=32 3570de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 357172b675caSEdgar E. Iglesias ;; 35722408a527Saurel32 mips|mipsel) 3573b498c8a0SJuan Quintela TARGET_ARCH=mips 357425be210fSJuan Quintela echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak 3575f04dc72fSPaul Brook target_nptl="yes" 35761ad2134fSPaul Brook target_phys_bits=64 35772408a527Saurel32 ;; 35782408a527Saurel32 mipsn32|mipsn32el) 3579b498c8a0SJuan Quintela TARGET_ARCH=mipsn32 35806acff7daSJuan Quintela TARGET_BASE_ARCH=mips 358125be210fSJuan Quintela echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak 35821ad2134fSPaul Brook target_phys_bits=64 35832408a527Saurel32 ;; 35842408a527Saurel32 mips64|mips64el) 3585b498c8a0SJuan Quintela TARGET_ARCH=mips64 35866acff7daSJuan Quintela TARGET_BASE_ARCH=mips 358725be210fSJuan Quintela echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak 35881ad2134fSPaul Brook target_phys_bits=64 3589c2e3dee6SLaurent Vivier target_long_alignment=8 35902408a527Saurel32 ;; 35912408a527Saurel32 ppc) 3592c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 35938b242ebaSAlexander Graf target_phys_bits=64 3594d6630708SNathan Froyd target_nptl="yes" 3595de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 35962408a527Saurel32 ;; 35972408a527Saurel32 ppcemb) 35986acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3599e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 3600c8b3532dSaurel32 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 36011ad2134fSPaul Brook target_phys_bits=64 3602d6630708SNathan Froyd target_nptl="yes" 3603de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 36042408a527Saurel32 ;; 36052408a527Saurel32 ppc64) 36066acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3607e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 3608c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 36091ad2134fSPaul Brook target_phys_bits=64 3610c2e3dee6SLaurent Vivier target_long_alignment=8 3611de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 36122408a527Saurel32 ;; 36132408a527Saurel32 ppc64abi32) 3614b498c8a0SJuan Quintela TARGET_ARCH=ppc64 36156acff7daSJuan Quintela TARGET_BASE_ARCH=ppc 3616e6e91b9cSJuan Quintela TARGET_ABI_DIR=ppc 361725be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 3618c8b3532dSaurel32 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" 36191ad2134fSPaul Brook target_phys_bits=64 3620de3a354aSMichael Walle target_libs_softmmu="$fdt_libs" 36212408a527Saurel32 ;; 36222408a527Saurel32 sh4|sh4eb) 3623b498c8a0SJuan Quintela TARGET_ARCH=sh4 36244dbed897Spbrook bflt="yes" 36250b6d3ae0Saurel32 target_nptl="yes" 36261ad2134fSPaul Brook target_phys_bits=32 36272408a527Saurel32 ;; 36282408a527Saurel32 sparc) 36291ad2134fSPaul Brook target_phys_bits=64 36302408a527Saurel32 ;; 36312408a527Saurel32 sparc64) 36326acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 36331ad2134fSPaul Brook target_phys_bits=64 3634c2e3dee6SLaurent Vivier target_long_alignment=8 36352408a527Saurel32 ;; 36362408a527Saurel32 sparc32plus) 3637b498c8a0SJuan Quintela TARGET_ARCH=sparc64 36386acff7daSJuan Quintela TARGET_BASE_ARCH=sparc 3639e6e91b9cSJuan Quintela TARGET_ABI_DIR=sparc 364025be210fSJuan Quintela echo "TARGET_ABI32=y" >> $config_target_mak 36411ad2134fSPaul Brook target_phys_bits=64 36422408a527Saurel32 ;; 364324e804ecSAlexander Graf s390x) 3644bc434676SUlrich Hecht target_nptl="yes" 364524e804ecSAlexander Graf target_phys_bits=64 36467b3da903SAlexander Graf target_long_alignment=8 364724e804ecSAlexander Graf ;; 3648d2fbca94SGuan Xuetao unicore32) 3649d2fbca94SGuan Xuetao target_phys_bits=32 3650d2fbca94SGuan Xuetao ;; 3651cfa550c6SMax Filippov xtensa|xtensaeb) 3652cfa550c6SMax Filippov TARGET_ARCH=xtensa 3653cfa550c6SMax Filippov target_phys_bits=32 3654cfa550c6SMax Filippov ;; 36552408a527Saurel32 *) 3656de83cd02Sbellard echo "Unsupported target CPU" 3657de83cd02Sbellard exit 1 36582408a527Saurel32 ;; 36592408a527Saurel32esac 36600184e266SBlue Swirl 36610184e266SBlue Swirlcase "$target_arch2" in 3662c3082755SRichard Henderson alpha | sparc*) 36630184e266SBlue Swirl echo "CONFIG_TCG_PASS_AREG0=y" >> $config_target_mak 36640184e266SBlue Swirl ;; 36650184e266SBlue Swirlesac 36660184e266SBlue Swirl 3667c2e3dee6SLaurent Vivierecho "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak 3668c2e3dee6SLaurent Vivierecho "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak 3669c2e3dee6SLaurent Vivierecho "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak 3670c2e3dee6SLaurent Vivierecho "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak 367125be210fSJuan Quintelaecho "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak 3672bb55b712SStefan Weiltarget_arch_name="`echo $TARGET_ARCH | LC_ALL=C tr '[a-z]' '[A-Z]'`" 367325be210fSJuan Quintelaecho "TARGET_$target_arch_name=y" >> $config_target_mak 367425be210fSJuan Quintelaecho "TARGET_ARCH2=$target_arch2" >> $config_target_mak 367542bc608bSJuan Quintela# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH 36766acff7daSJuan Quintelaif [ "$TARGET_BASE_ARCH" = "" ]; then 36776acff7daSJuan Quintela TARGET_BASE_ARCH=$TARGET_ARCH 36786acff7daSJuan Quintelafi 367925be210fSJuan Quintelaecho "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak 3680e6e91b9cSJuan Quintelaif [ "$TARGET_ABI_DIR" = "" ]; then 3681e6e91b9cSJuan Quintela TARGET_ABI_DIR=$TARGET_ARCH 3682e6e91b9cSJuan Quintelafi 368325be210fSJuan Quintelaecho "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak 36841b0c87fcSJuan Quintelacase "$target_arch2" in 36851b0c87fcSJuan Quintela i386|x86_64) 36861b0c87fcSJuan Quintela if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then 368764b3cfdbSAnthony PERARD target_phys_bits=64 368825be210fSJuan Quintela echo "CONFIG_XEN=y" >> $config_target_mak 368959d21e53SAlexander Graf else 369059d21e53SAlexander Graf echo "CONFIG_NO_XEN=y" >> $config_target_mak 3691432d268cSJun Nakajima fi 369259d21e53SAlexander Graf ;; 369359d21e53SAlexander Graf *) 369459d21e53SAlexander Graf echo "CONFIG_NO_XEN=y" >> $config_target_mak 36951b0c87fcSJuan Quintelaesac 3696c59249f9SJuan Quintelacase "$target_arch2" in 36970e60a699SAlexander Graf i386|x86_64|ppcemb|ppc|ppc64|s390x) 3698c59249f9SJuan Quintela # Make sure the target and host cpus are compatible 3699c59249f9SJuan Quintela if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ 3700c59249f9SJuan Quintela \( "$target_arch2" = "$cpu" -o \ 3701c59249f9SJuan Quintela \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ 37025f114bc6SAlexander Graf \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ 3703adf82011SRené Rebe \( "$target_arch2" = "ppc" -a "$cpu" = "ppc64" \) -o \ 3704adf82011SRené Rebe \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \ 3705c59249f9SJuan Quintela \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ 3706c59249f9SJuan Quintela \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then 370725be210fSJuan Quintela echo "CONFIG_KVM=y" >> $config_target_mak 37081ba16968SStefan Weil if test "$vhost_net" = "yes" ; then 3709d5970055SMichael S. Tsirkin echo "CONFIG_VHOST_NET=y" >> $config_target_mak 3710d5970055SMichael S. Tsirkin fi 3711c59249f9SJuan Quintela fi 3712c59249f9SJuan Quintelaesac 37137f762366SBlue Swirlif test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then 37140a6b8ddeSAlexander Graf echo "CONFIG_PSERIES=y" >> $config_target_mak 37150a6b8ddeSAlexander Graffi 3716de83cd02Sbellardif test "$target_bigendian" = "yes" ; then 371725be210fSJuan Quintela echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak 371897a847bcSbellardfi 371997a847bcSbellardif test "$target_softmmu" = "yes" ; then 3720b1aa27c4SPaul Brook echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak 372125be210fSJuan Quintela echo "CONFIG_SOFTMMU=y" >> $config_target_mak 3722de3a354aSMichael Walle echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak 37230e8c9214SAndreas Färber echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak 37245791f45bSKirill A. Shutemov echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak 3725ad4cf3f6SPaul Brook if test "$smartcard_nss" = "yes" ; then 3726ad4cf3f6SPaul Brook echo "subdir-$target: subdir-libcacard" >> $config_host_mak 3727ad4cf3f6SPaul Brook fi 3728de83cd02Sbellardfi 3729997344f3Sbellardif test "$target_user_only" = "yes" ; then 373025be210fSJuan Quintela echo "CONFIG_USER_ONLY=y" >> $config_target_mak 3731a2c80be9SStefan Weil echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak 3732997344f3Sbellardfi 3733831b7825Sthsif test "$target_linux_user" = "yes" ; then 373425be210fSJuan Quintela echo "CONFIG_LINUX_USER=y" >> $config_target_mak 3735831b7825Sthsfi 373656aebc89Spbrooklist="" 373756aebc89Spbrookif test ! -z "$gdb_xml_files" ; then 373856aebc89Spbrook for x in $gdb_xml_files; do 373956aebc89Spbrook list="$list $source_path/gdb-xml/$x" 374056aebc89Spbrook done 374125be210fSJuan Quintela echo "TARGET_XML_FILES=$list" >> $config_target_mak 37423d0f1517SJuan Quintelafi 3743de83cd02Sbellard 3744e5fe0c52Spbrookif test "$target_user_only" = "yes" -a "$bflt" = "yes"; then 374525be210fSJuan Quintela echo "TARGET_HAS_BFLT=y" >> $config_target_mak 3746e5fe0c52Spbrookfi 3747bd0c5661Spbrookif test "$target_user_only" = "yes" \ 3748bd0c5661Spbrook -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then 374925be210fSJuan Quintela echo "CONFIG_USE_NPTL=y" >> $config_target_mak 3750bd0c5661Spbrookfi 3751379f6698SPaul Brookif test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then 375225be210fSJuan Quintela echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak 3753379f6698SPaul Brookfi 375484778508Sblueswir1if test "$target_bsd_user" = "yes" ; then 375525be210fSJuan Quintela echo "CONFIG_BSD_USER=y" >> $config_target_mak 375684778508Sblueswir1fi 37575b0753e0Sbellard 37584afddb55SJuan Quintela# generate QEMU_CFLAGS/LDFLAGS for targets 3759fa282484SJuan Quintela 37604afddb55SJuan Quintelacflags="" 3761f9728943SPaolo Bonziniincludes="" 3762fa282484SJuan Quintelaldflags="" 37639b8e111fSJuan Quintela 37649195b2c2SStefan Weilif test "$tcg_interpreter" = "yes"; then 37659195b2c2SStefan Weil includes="-I\$(SRC_PATH)/tcg/tci $includes" 37669195b2c2SStefan Weilelif test "$ARCH" = "sparc64" ; then 3767f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/sparc $includes" 376824e804ecSAlexander Grafelif test "$ARCH" = "s390x" ; then 3769f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/s390 $includes" 37705d8a4f8fSRichard Hendersonelif test "$ARCH" = "x86_64" ; then 3771f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/i386 $includes" 377257ddfbf7SJuan Quintelaelse 3773f9728943SPaolo Bonzini includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes" 377457ddfbf7SJuan Quintelafi 3775f9728943SPaolo Bonziniincludes="-I\$(SRC_PATH)/tcg $includes" 377657ddfbf7SJuan Quintela 37776efd7517SPeter Maydellif test "$linux" = "yes" ; then 37786efd7517SPeter Maydell includes="-I\$(SRC_PATH)/linux-headers $includes" 37796efd7517SPeter Maydellfi 37806efd7517SPeter Maydell 37814d904533SBlue Swirlif test "$target_user_only" = "yes" ; then 37824d904533SBlue Swirl libdis_config_mak=libdis-user/config.mak 37834d904533SBlue Swirlelse 37844d904533SBlue Swirl libdis_config_mak=libdis/config.mak 37854d904533SBlue Swirlfi 37864d904533SBlue Swirl 378764656024SJuan Quintelafor i in $ARCH $TARGET_BASE_ARCH ; do 378864656024SJuan Quintela case "$i" in 378964656024SJuan Quintela alpha) 379025be210fSJuan Quintela echo "CONFIG_ALPHA_DIS=y" >> $config_target_mak 37914d904533SBlue Swirl echo "CONFIG_ALPHA_DIS=y" >> $libdis_config_mak 379264656024SJuan Quintela ;; 379364656024SJuan Quintela arm) 379425be210fSJuan Quintela echo "CONFIG_ARM_DIS=y" >> $config_target_mak 37954d904533SBlue Swirl echo "CONFIG_ARM_DIS=y" >> $libdis_config_mak 379664656024SJuan Quintela ;; 379764656024SJuan Quintela cris) 379825be210fSJuan Quintela echo "CONFIG_CRIS_DIS=y" >> $config_target_mak 37994d904533SBlue Swirl echo "CONFIG_CRIS_DIS=y" >> $libdis_config_mak 380064656024SJuan Quintela ;; 380164656024SJuan Quintela hppa) 380225be210fSJuan Quintela echo "CONFIG_HPPA_DIS=y" >> $config_target_mak 38034d904533SBlue Swirl echo "CONFIG_HPPA_DIS=y" >> $libdis_config_mak 380464656024SJuan Quintela ;; 380564656024SJuan Quintela i386|x86_64) 380625be210fSJuan Quintela echo "CONFIG_I386_DIS=y" >> $config_target_mak 38074d904533SBlue Swirl echo "CONFIG_I386_DIS=y" >> $libdis_config_mak 380864656024SJuan Quintela ;; 3809903ec55cSAurelien Jarno ia64*) 3810903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $config_target_mak 3811903ec55cSAurelien Jarno echo "CONFIG_IA64_DIS=y" >> $libdis_config_mak 3812903ec55cSAurelien Jarno ;; 381379368f49SMichael Walle lm32) 381479368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $config_target_mak 381579368f49SMichael Walle echo "CONFIG_LM32_DIS=y" >> $libdis_config_mak 381679368f49SMichael Walle ;; 381764656024SJuan Quintela m68k) 381825be210fSJuan Quintela echo "CONFIG_M68K_DIS=y" >> $config_target_mak 38194d904533SBlue Swirl echo "CONFIG_M68K_DIS=y" >> $libdis_config_mak 382064656024SJuan Quintela ;; 3821877fdc12SEdgar E. Iglesias microblaze*) 382225be210fSJuan Quintela echo "CONFIG_MICROBLAZE_DIS=y" >> $config_target_mak 38234d904533SBlue Swirl echo "CONFIG_MICROBLAZE_DIS=y" >> $libdis_config_mak 382464656024SJuan Quintela ;; 382564656024SJuan Quintela mips*) 382625be210fSJuan Quintela echo "CONFIG_MIPS_DIS=y" >> $config_target_mak 38274d904533SBlue Swirl echo "CONFIG_MIPS_DIS=y" >> $libdis_config_mak 382864656024SJuan Quintela ;; 382964656024SJuan Quintela ppc*) 383025be210fSJuan Quintela echo "CONFIG_PPC_DIS=y" >> $config_target_mak 38314d904533SBlue Swirl echo "CONFIG_PPC_DIS=y" >> $libdis_config_mak 383264656024SJuan Quintela ;; 383324e804ecSAlexander Graf s390*) 383425be210fSJuan Quintela echo "CONFIG_S390_DIS=y" >> $config_target_mak 38354d904533SBlue Swirl echo "CONFIG_S390_DIS=y" >> $libdis_config_mak 383664656024SJuan Quintela ;; 383764656024SJuan Quintela sh4) 383825be210fSJuan Quintela echo "CONFIG_SH4_DIS=y" >> $config_target_mak 38394d904533SBlue Swirl echo "CONFIG_SH4_DIS=y" >> $libdis_config_mak 384064656024SJuan Quintela ;; 384164656024SJuan Quintela sparc*) 384225be210fSJuan Quintela echo "CONFIG_SPARC_DIS=y" >> $config_target_mak 38434d904533SBlue Swirl echo "CONFIG_SPARC_DIS=y" >> $libdis_config_mak 384464656024SJuan Quintela ;; 3845cfa550c6SMax Filippov xtensa*) 3846cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $config_target_mak 3847cfa550c6SMax Filippov echo "CONFIG_XTENSA_DIS=y" >> $libdis_config_mak 3848cfa550c6SMax Filippov ;; 384964656024SJuan Quintela esac 385064656024SJuan Quinteladone 38519195b2c2SStefan Weilif test "$tcg_interpreter" = "yes" ; then 38529195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $config_target_mak 38539195b2c2SStefan Weil echo "CONFIG_TCI_DIS=y" >> $libdis_config_mak 38549195b2c2SStefan Weilfi 385564656024SJuan Quintela 38566ee7126fSJuan Quintelacase "$ARCH" in 38576ee7126fSJuan Quintelaalpha) 38586ee7126fSJuan Quintela # Ensure there's only a single GP 38596ee7126fSJuan Quintela cflags="-msmall-data $cflags" 38606ee7126fSJuan Quintela;; 38616ee7126fSJuan Quintelaesac 38626ee7126fSJuan Quintela 386355d9c04bSJuan Quintelaif test "$target_softmmu" = "yes" ; then 386455d9c04bSJuan Quintela case "$TARGET_BASE_ARCH" in 386555d9c04bSJuan Quintela arm) 386655d9c04bSJuan Quintela cflags="-DHAS_AUDIO $cflags" 386755d9c04bSJuan Quintela ;; 386825a8bb96SMichael Walle lm32) 386925a8bb96SMichael Walle cflags="-DHAS_AUDIO $cflags" 387025a8bb96SMichael Walle ;; 387155d9c04bSJuan Quintela i386|mips|ppc) 387255d9c04bSJuan Quintela cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" 387355d9c04bSJuan Quintela ;; 387455d9c04bSJuan Quintela esac 387555d9c04bSJuan Quintelafi 387655d9c04bSJuan Quintela 3877471857ddSJuan Quintelaif test "$target_softmmu" = "yes" -a \( \ 3878471857ddSJuan Quintela "$TARGET_ARCH" = "microblaze" -o \ 3879471857ddSJuan Quintela "$TARGET_ARCH" = "cris" \) ; then 388025be210fSJuan Quintela echo "CONFIG_NEED_MMU=y" >> $config_target_mak 3881471857ddSJuan Quintelafi 3882471857ddSJuan Quintela 3883d02c1db3SJuan Quintelaif test "$gprof" = "yes" ; then 388425be210fSJuan Quintela echo "TARGET_GPROF=yes" >> $config_target_mak 3885d02c1db3SJuan Quintela if test "$target_linux_user" = "yes" ; then 3886d02c1db3SJuan Quintela cflags="-p $cflags" 3887d02c1db3SJuan Quintela ldflags="-p $ldflags" 3888d02c1db3SJuan Quintela fi 3889d02c1db3SJuan Quintela if test "$target_softmmu" = "yes" ; then 3890d02c1db3SJuan Quintela ldflags="-p $ldflags" 389125be210fSJuan Quintela echo "GPROF_CFLAGS=-p" >> $config_target_mak 3892d02c1db3SJuan Quintela fi 3893d02c1db3SJuan Quintelafi 3894d02c1db3SJuan Quintela 38959195b2c2SStefan Weilif test "$ARCH" = "tci"; then 38969195b2c2SStefan Weil linker_script="" 38979195b2c2SStefan Weilelse 38986ee7126fSJuan Quintela linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld" 38999195b2c2SStefan Weilfi 39009195b2c2SStefan Weil 39019b8e111fSJuan Quintelaif test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then 3902fa282484SJuan Quintela case "$ARCH" in 3903fa282484SJuan Quintela sparc) 3904fa282484SJuan Quintela # -static is used to avoid g1/g3 usage by the dynamic linker 3905322e5878SJuan Quintela ldflags="$linker_script -static $ldflags" 3906fa282484SJuan Quintela ;; 39074d58be06SRichard Henderson alpha | s390x) 39084d58be06SRichard Henderson # The default placement of the application is fine. 39094d58be06SRichard Henderson ;; 3910fd76e73aSRichard Henderson *) 3911322e5878SJuan Quintela ldflags="$linker_script $ldflags" 3912fa282484SJuan Quintela ;; 3913fa282484SJuan Quintela esac 3914fa282484SJuan Quintelafi 3915fa282484SJuan Quintela 391625be210fSJuan Quintelaecho "LDFLAGS+=$ldflags" >> $config_target_mak 391725be210fSJuan Quintelaecho "QEMU_CFLAGS+=$cflags" >> $config_target_mak 3918f9728943SPaolo Bonziniecho "QEMU_INCLUDES+=$includes" >> $config_target_mak 3919fa282484SJuan Quintela 392097a847bcSbellarddone # for target in $targets 39217d13299dSbellard 3922d1807a4fSPaolo Bonzini# build tree in object directory in case the source is not in the current directory 3923927b241dSMichael WalleDIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32" 3924927b241dSMichael WalleDIRS="$DIRS slirp audio block net pc-bios/optionrom" 3925446b9165SAndreas FärberDIRS="$DIRS pc-bios/spapr-rtas" 39262d9f27d2SAnthony LiguoriDIRS="$DIRS roms/seabios roms/vgabios" 3927f1ae32a1SGerd HoffmannDIRS="$DIRS fsdev ui usb" 3928e098fc3fSMichael RothDIRS="$DIRS qapi qapi-generated" 39292f28d2ffSAnthony LiguoriDIRS="$DIRS qga trace qom" 3930c09015ddSAnthony LiguoriFILES="Makefile tests/tcg/Makefile qdict-test-data.txt" 3931c09015ddSAnthony LiguoriFILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" 3932927b241dSMichael WalleFILES="$FILES tests/tcg/lm32/Makefile" 3933ae0bfb79SBlue SwirlFILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" 3934446b9165SAndreas FärberFILES="$FILES pc-bios/spapr-rtas/Makefile" 39352d9f27d2SAnthony LiguoriFILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" 3936753d11f2SRichard Hendersonfor bios_file in \ 3937753d11f2SRichard Henderson $source_path/pc-bios/*.bin \ 3938753d11f2SRichard Henderson $source_path/pc-bios/*.rom \ 3939753d11f2SRichard Henderson $source_path/pc-bios/*.dtb \ 3940753d11f2SRichard Henderson $source_path/pc-bios/openbios-* \ 3941753d11f2SRichard Henderson $source_path/pc-bios/palcode-* 3942753d11f2SRichard Hendersondo 39437ea78b74SJan Kiszka FILES="$FILES pc-bios/`basename $bios_file`" 39447ea78b74SJan Kiszkadone 3945d1807a4fSPaolo Bonzinimkdir -p $DIRS 39467d13299dSbellardfor f in $FILES ; do 394772b8b5a1SStefan Weil if [ -e "$source_path/$f" ] && [ "$source_path" != `pwd` ]; then 3948f9245e10SPeter Maydell symlink "$source_path/$f" "$f" 3949f9245e10SPeter Maydell fi 39507d13299dSbellarddone 39511ad2134fSPaul Brook 3952c34ebfdcSAnthony Liguori# temporary config to build submodules 39532d9f27d2SAnthony Liguorifor rom in seabios vgabios ; do 3954c34ebfdcSAnthony Liguori config_mak=roms/$rom/config.mak 395537116c89SStefan Weil echo "# Automatically generated by configure - do not modify" > $config_mak 3956c34ebfdcSAnthony Liguori echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak 3957c34ebfdcSAnthony Liguori echo "CC=$cc" >> $config_mak 3958c34ebfdcSAnthony Liguori echo "BCC=bcc" >> $config_mak 3959c34ebfdcSAnthony Liguori echo "CPP=${cross_prefix}cpp" >> $config_mak 3960c34ebfdcSAnthony Liguori echo "OBJCOPY=objcopy" >> $config_mak 3961c34ebfdcSAnthony Liguori echo "IASL=iasl" >> $config_mak 3962c34ebfdcSAnthony Liguori echo "LD=$ld" >> $config_mak 3963c34ebfdcSAnthony Liguoridone 3964c34ebfdcSAnthony Liguori 39651ad2134fSPaul Brookfor hwlib in 32 64; do 39661ad2134fSPaul Brook d=libhw$hwlib 39671ad2134fSPaul Brook mkdir -p $d 39689953b2fcSBlue Swirl mkdir -p $d/ide 3969f1ae32a1SGerd Hoffmann mkdir -p $d/usb 397072b8b5a1SStefan Weil symlink "$source_path/Makefile.hw" "$d/Makefile" 3971353ac78dSAneesh Kumar K.V mkdir -p $d/9pfs 397237116c89SStefan Weil echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak 39731ad2134fSPaul Brookdone 3974add16157SBlue Swirl 3975111a38b0SRobert Relyeaif [ "$source_path" != `pwd` ]; then 3976111a38b0SRobert Relyea # out of tree build 3977111a38b0SRobert Relyea mkdir -p libcacard 397844dc0ca3SAlon Levy symlink "$source_path/libcacard/Makefile" libcacard/Makefile 3979111a38b0SRobert Relyeafi 3980111a38b0SRobert Relyea 3981add16157SBlue Swirld=libuser 3982add16157SBlue Swirlmkdir -p $d 3983937b1258SLluís Vilanovamkdir -p $d/trace 3984dd83b06aSAndreas Färbermkdir -p $d/qom 398572b8b5a1SStefan Weilsymlink "$source_path/Makefile.user" "$d/Makefile" 3986b40292e7SJan Kiszka 3987b40292e7SJan Kiszkaif test "$docs" = "yes" ; then 3988b40292e7SJan Kiszka mkdir -p QMP 3989b40292e7SJan Kiszkafi 3990