Statistics
| Branch: | Revision:

root / configure @ b48e3611

History | View | Annotate | Download (95.9 kB)

1 7d13299d bellard
#!/bin/sh
2 7d13299d bellard
#
3 3ef693a0 bellard
# qemu configure script (c) 2003 Fabrice Bellard
4 7d13299d bellard
#
5 7d13299d bellard
# set temporary file name
6 7d13299d bellard
if test ! -z "$TMPDIR" ; then
7 7d13299d bellard
    TMPDIR1="${TMPDIR}"
8 7d13299d bellard
elif test ! -z "$TEMPDIR" ; then
9 7d13299d bellard
    TMPDIR1="${TEMPDIR}"
10 7d13299d bellard
else
11 7d13299d bellard
    TMPDIR1="/tmp"
12 7d13299d bellard
fi
13 7d13299d bellard
14 3ef693a0 bellard
TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 3ef693a0 bellard
TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 a91b857c malc
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe"
17 7d13299d bellard
18 0ba8681e Loïc Minier
# NB: do not call "exit" in the trap handler; this is buggy with some shells;
19 0ba8681e Loïc Minier
# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
20 0ba8681e Loïc Minier
trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
21 da1d85e3 Gerd Hoffmann
rm -f config.log
22 9ac81bbb malc
23 b48e3611 Peter Maydell
# Print a helpful header at the top of config.log
24 b48e3611 Peter Maydell
echo "# QEMU configure log $(date)" >> config.log
25 b48e3611 Peter Maydell
echo "# produced by $0 $*" >> config.log
26 b48e3611 Peter Maydell
echo "#" >> config.log
27 b48e3611 Peter Maydell
28 52166aa0 Juan Quintela
compile_object() {
29 da1d85e3 Gerd Hoffmann
  echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log
30 da1d85e3 Gerd Hoffmann
  $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 2>&1
31 52166aa0 Juan Quintela
}
32 52166aa0 Juan Quintela
33 52166aa0 Juan Quintela
compile_prog() {
34 52166aa0 Juan Quintela
  local_cflags="$1"
35 52166aa0 Juan Quintela
  local_ldflags="$2"
36 da1d85e3 Gerd Hoffmann
  echo $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log
37 da1d85e3 Gerd Hoffmann
  $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log 2>&1
38 52166aa0 Juan Quintela
}
39 52166aa0 Juan Quintela
40 11568d6d Paolo Bonzini
# symbolically link $1 to $2.  Portable version of "ln -sf".
41 11568d6d Paolo Bonzini
symlink() {
42 11568d6d Paolo Bonzini
  rm -f $2
43 11568d6d Paolo Bonzini
  ln -s $1 $2
44 11568d6d Paolo Bonzini
}
45 11568d6d Paolo Bonzini
46 0dba6195 Loïc Minier
# check whether a command is available to this shell (may be either an
47 0dba6195 Loïc Minier
# executable or a builtin)
48 0dba6195 Loïc Minier
has() {
49 0dba6195 Loïc Minier
    type "$1" >/dev/null 2>&1
50 0dba6195 Loïc Minier
}
51 0dba6195 Loïc Minier
52 0dba6195 Loïc Minier
# search for an executable in PATH
53 0dba6195 Loïc Minier
path_of() {
54 0dba6195 Loïc Minier
    local_command="$1"
55 0dba6195 Loïc Minier
    local_ifs="$IFS"
56 0dba6195 Loïc Minier
    local_dir=""
57 0dba6195 Loïc Minier
58 0dba6195 Loïc Minier
    # pathname has a dir component?
59 0dba6195 Loïc Minier
    if [ "${local_command#*/}" != "$local_command" ]; then
60 0dba6195 Loïc Minier
        if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then
61 0dba6195 Loïc Minier
            echo "$local_command"
62 0dba6195 Loïc Minier
            return 0
63 0dba6195 Loïc Minier
        fi
64 0dba6195 Loïc Minier
    fi
65 0dba6195 Loïc Minier
    if [ -z "$local_command" ]; then
66 0dba6195 Loïc Minier
        return 1
67 0dba6195 Loïc Minier
    fi
68 0dba6195 Loïc Minier
69 0dba6195 Loïc Minier
    IFS=:
70 0dba6195 Loïc Minier
    for local_dir in $PATH; do
71 0dba6195 Loïc Minier
        if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then
72 0dba6195 Loïc Minier
            echo "$local_dir/$local_command"
73 0dba6195 Loïc Minier
            IFS="${local_ifs:-$(printf ' \t\n')}"
74 0dba6195 Loïc Minier
            return 0
75 0dba6195 Loïc Minier
        fi
76 0dba6195 Loïc Minier
    done
77 0dba6195 Loïc Minier
    # not found
78 0dba6195 Loïc Minier
    IFS="${local_ifs:-$(printf ' \t\n')}"
79 0dba6195 Loïc Minier
    return 1
80 0dba6195 Loïc Minier
}
81 0dba6195 Loïc Minier
82 7d13299d bellard
# default parameters
83 ca4deeb1 Paolo Bonzini
source_path=`dirname "$0"`
84 2ff6b91e Juan Quintela
cpu=""
85 1e43adfc bellard
interp_prefix="/usr/gnemul/qemu-%M"
86 43ce4dfe bellard
static="no"
87 ed968ff1 Juan Quintela
sparc_cpu=""
88 7d13299d bellard
cross_prefix=""
89 0c58ac1c malc
audio_drv_list=""
90 d61a4ce8 Gerd Hoffmann
audio_card_list="ac97 es1370 sb16 hda"
91 d61a4ce8 Gerd Hoffmann
audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus hda"
92 eb852011 Markus Armbruster
block_drv_whitelist=""
93 7d13299d bellard
host_cc="gcc"
94 c81da56e Juan Quintela
helper_cflags=""
95 73da375e Juan Quintela
libs_softmmu=""
96 3e2e0e6b Juan Quintela
libs_tools=""
97 67f86e8e Juan Quintela
audio_pt_int=""
98 d5631638 malc
audio_win_int=""
99 2b2e59e6 Paolo Bonzini
cc_i386=i386-pc-linux-gnu-gcc
100 957f1f99 Michael Roth
libs_qga=""
101 ac0df51d aliguori
102 377529c0 Paolo Bonzini
target_list=""
103 377529c0 Paolo Bonzini
104 377529c0 Paolo Bonzini
# Default value for a variable defining feature "foo".
105 377529c0 Paolo Bonzini
#  * foo="no"  feature will only be used if --enable-foo arg is given
106 377529c0 Paolo Bonzini
#  * foo=""    feature will be searched for, and if found, will be used
107 377529c0 Paolo Bonzini
#              unless --disable-foo is given
108 377529c0 Paolo Bonzini
#  * foo="yes" this value will only be set by --enable-foo flag.
109 377529c0 Paolo Bonzini
#              feature will searched for,
110 377529c0 Paolo Bonzini
#              if not found, configure exits with error
111 377529c0 Paolo Bonzini
#
112 377529c0 Paolo Bonzini
# Always add --enable-foo and --disable-foo command line args.
113 377529c0 Paolo Bonzini
# Distributions want to ensure that several features are compiled in, and it
114 377529c0 Paolo Bonzini
# is impossible without a --enable-foo that exits if a feature is not found.
115 377529c0 Paolo Bonzini
116 377529c0 Paolo Bonzini
bluez=""
117 377529c0 Paolo Bonzini
brlapi=""
118 377529c0 Paolo Bonzini
curl=""
119 377529c0 Paolo Bonzini
curses=""
120 377529c0 Paolo Bonzini
docs=""
121 377529c0 Paolo Bonzini
fdt=""
122 377529c0 Paolo Bonzini
nptl=""
123 377529c0 Paolo Bonzini
sdl=""
124 821601ea Jes Sorensen
vnc="yes"
125 377529c0 Paolo Bonzini
sparse="no"
126 377529c0 Paolo Bonzini
uuid=""
127 377529c0 Paolo Bonzini
vde=""
128 377529c0 Paolo Bonzini
vnc_tls=""
129 377529c0 Paolo Bonzini
vnc_sasl=""
130 377529c0 Paolo Bonzini
vnc_jpeg=""
131 377529c0 Paolo Bonzini
vnc_png=""
132 377529c0 Paolo Bonzini
vnc_thread="no"
133 377529c0 Paolo Bonzini
xen=""
134 d5b93ddf Anthony PERARD
xen_ctrl_version=""
135 377529c0 Paolo Bonzini
linux_aio=""
136 377529c0 Paolo Bonzini
attr=""
137 4f26f2b6 Avi Kivity
libattr=""
138 377529c0 Paolo Bonzini
xfs=""
139 377529c0 Paolo Bonzini
140 d41a75a2 Brad
vhost_net="no"
141 d41a75a2 Brad
kvm="no"
142 377529c0 Paolo Bonzini
gprof="no"
143 377529c0 Paolo Bonzini
debug_tcg="no"
144 377529c0 Paolo Bonzini
debug_mon="no"
145 377529c0 Paolo Bonzini
debug="no"
146 377529c0 Paolo Bonzini
strip_opt="yes"
147 9195b2c2 Stefan Weil
tcg_interpreter="no"
148 377529c0 Paolo Bonzini
bigendian="no"
149 377529c0 Paolo Bonzini
mingw32="no"
150 377529c0 Paolo Bonzini
EXESUF=""
151 377529c0 Paolo Bonzini
prefix="/usr/local"
152 377529c0 Paolo Bonzini
mandir="\${prefix}/share/man"
153 377529c0 Paolo Bonzini
datadir="\${prefix}/share/qemu"
154 377529c0 Paolo Bonzini
docdir="\${prefix}/share/doc/qemu"
155 377529c0 Paolo Bonzini
bindir="\${prefix}/bin"
156 3aa5d2be Alon Levy
libdir="\${prefix}/lib"
157 0f94d6da Alon Levy
includedir="\${prefix}/include"
158 377529c0 Paolo Bonzini
sysconfdir="\${prefix}/etc"
159 377529c0 Paolo Bonzini
confsuffix="/qemu"
160 377529c0 Paolo Bonzini
slirp="yes"
161 377529c0 Paolo Bonzini
fmod_lib=""
162 377529c0 Paolo Bonzini
fmod_inc=""
163 377529c0 Paolo Bonzini
oss_lib=""
164 377529c0 Paolo Bonzini
bsd="no"
165 377529c0 Paolo Bonzini
linux="no"
166 377529c0 Paolo Bonzini
solaris="no"
167 377529c0 Paolo Bonzini
profiler="no"
168 377529c0 Paolo Bonzini
cocoa="no"
169 377529c0 Paolo Bonzini
softmmu="yes"
170 377529c0 Paolo Bonzini
linux_user="no"
171 377529c0 Paolo Bonzini
darwin_user="no"
172 377529c0 Paolo Bonzini
bsd_user="no"
173 377529c0 Paolo Bonzini
guest_base=""
174 377529c0 Paolo Bonzini
uname_release=""
175 377529c0 Paolo Bonzini
mixemu="no"
176 377529c0 Paolo Bonzini
aix="no"
177 377529c0 Paolo Bonzini
blobs="yes"
178 377529c0 Paolo Bonzini
pkgversion=""
179 25b651be Gerd Hoffmann
check_utests=""
180 40d6444e Avi Kivity
pie=""
181 377529c0 Paolo Bonzini
zero_malloc=""
182 377529c0 Paolo Bonzini
trace_backend="nop"
183 377529c0 Paolo Bonzini
trace_file="trace"
184 377529c0 Paolo Bonzini
spice=""
185 377529c0 Paolo Bonzini
rbd=""
186 36707144 Alon Levy
smartcard=""
187 111a38b0 Robert Relyea
smartcard_nss=""
188 69354a83 Hans de Goede
usb_redir=""
189 430a3c18 Michael Walle
opengl=""
190 1ece9905 Alon Levy
zlib="yes"
191 d138cee9 Michael Roth
guest_agent="yes"
192 c589b249 Ronnie Sahlberg
libiscsi=""
193 377529c0 Paolo Bonzini
194 ac0df51d aliguori
# parse CC options first
195 ac0df51d aliguori
for opt do
196 ac0df51d aliguori
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
197 ac0df51d aliguori
  case "$opt" in
198 ac0df51d aliguori
  --cross-prefix=*) cross_prefix="$optarg"
199 ac0df51d aliguori
  ;;
200 3d8df640 Paolo Bonzini
  --cc=*) CC="$optarg"
201 ac0df51d aliguori
  ;;
202 ca4deeb1 Paolo Bonzini
  --source-path=*) source_path="$optarg"
203 ca4deeb1 Paolo Bonzini
  ;;
204 2ff6b91e Juan Quintela
  --cpu=*) cpu="$optarg"
205 2ff6b91e Juan Quintela
  ;;
206 a558ee17 Juan Quintela
  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
207 e2a2ed06 Juan Quintela
  ;;
208 e2a2ed06 Juan Quintela
  --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
209 e2a2ed06 Juan Quintela
  ;;
210 50e7b1a0 Juan Quintela
  --sparc_cpu=*)
211 50e7b1a0 Juan Quintela
    sparc_cpu="$optarg"
212 50e7b1a0 Juan Quintela
    case $sparc_cpu in
213 ed968ff1 Juan Quintela
    v7|v8|v8plus|v8plusa)
214 50e7b1a0 Juan Quintela
      cpu="sparc"
215 50e7b1a0 Juan Quintela
    ;;
216 50e7b1a0 Juan Quintela
    v9)
217 50e7b1a0 Juan Quintela
      cpu="sparc64"
218 50e7b1a0 Juan Quintela
    ;;
219 50e7b1a0 Juan Quintela
    *)
220 50e7b1a0 Juan Quintela
      echo "undefined SPARC architecture. Exiting";
221 50e7b1a0 Juan Quintela
      exit 1
222 50e7b1a0 Juan Quintela
    ;;
223 50e7b1a0 Juan Quintela
    esac
224 50e7b1a0 Juan Quintela
  ;;
225 ac0df51d aliguori
  esac
226 ac0df51d aliguori
done
227 ac0df51d aliguori
# OS specific
228 ac0df51d aliguori
# Using uname is really, really broken.  Once we have the right set of checks
229 ac0df51d aliguori
# we can eliminate it's usage altogether
230 ac0df51d aliguori
231 b3198cc2 Stuart Yoder
cc="${CC-${cross_prefix}gcc}"
232 b3198cc2 Stuart Yoder
ar="${AR-${cross_prefix}ar}"
233 b3198cc2 Stuart Yoder
objcopy="${OBJCOPY-${cross_prefix}objcopy}"
234 b3198cc2 Stuart Yoder
ld="${LD-${cross_prefix}ld}"
235 3f534581 Brad
libtool="${LIBTOOL-${cross_prefix}libtool}"
236 b3198cc2 Stuart Yoder
strip="${STRIP-${cross_prefix}strip}"
237 b3198cc2 Stuart Yoder
windres="${WINDRES-${cross_prefix}windres}"
238 b3198cc2 Stuart Yoder
pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
239 b3198cc2 Stuart Yoder
sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
240 ac0df51d aliguori
241 be17dc90 Michael S. Tsirkin
# default flags for all hosts
242 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
243 be17dc90 Michael S. Tsirkin
CFLAGS="-g $CFLAGS"
244 f9188227 Mike Frysinger
QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
245 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
246 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
247 84958305 Kirill A. Shutemov
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
248 cbbab922 Paolo Bonzini
QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
249 be17dc90 Michael S. Tsirkin
LDFLAGS="-g $LDFLAGS"
250 be17dc90 Michael S. Tsirkin
251 ca4deeb1 Paolo Bonzini
# make source path absolute
252 ca4deeb1 Paolo Bonzini
source_path=`cd "$source_path"; pwd`
253 ca4deeb1 Paolo Bonzini
254 ac0df51d aliguori
check_define() {
255 ac0df51d aliguori
cat > $TMPC <<EOF
256 ac0df51d aliguori
#if !defined($1)
257 fd786e1a Peter Maydell
#error $1 not defined
258 ac0df51d aliguori
#endif
259 ac0df51d aliguori
int main(void) { return 0; }
260 ac0df51d aliguori
EOF
261 52166aa0 Juan Quintela
  compile_object
262 ac0df51d aliguori
}
263 ac0df51d aliguori
264 2ff6b91e Juan Quintela
if test ! -z "$cpu" ; then
265 2ff6b91e Juan Quintela
  # command line argument
266 2ff6b91e Juan Quintela
  :
267 2ff6b91e Juan Quintela
elif check_define __i386__ ; then
268 ac0df51d aliguori
  cpu="i386"
269 ac0df51d aliguori
elif check_define __x86_64__ ; then
270 ac0df51d aliguori
  cpu="x86_64"
271 3aa9bd6c blueswir1
elif check_define __sparc__ ; then
272 3aa9bd6c blueswir1
  # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
273 3aa9bd6c blueswir1
  # They must be specified using --sparc_cpu
274 3aa9bd6c blueswir1
  if check_define __arch64__ ; then
275 3aa9bd6c blueswir1
    cpu="sparc64"
276 3aa9bd6c blueswir1
  else
277 3aa9bd6c blueswir1
    cpu="sparc"
278 3aa9bd6c blueswir1
  fi
279 fdf7ed96 malc
elif check_define _ARCH_PPC ; then
280 fdf7ed96 malc
  if check_define _ARCH_PPC64 ; then
281 fdf7ed96 malc
    cpu="ppc64"
282 fdf7ed96 malc
  else
283 fdf7ed96 malc
    cpu="ppc"
284 fdf7ed96 malc
  fi
285 afa05235 Aurelien Jarno
elif check_define __mips__ ; then
286 afa05235 Aurelien Jarno
  cpu="mips"
287 477ba620 Aurelien Jarno
elif check_define __ia64__ ; then
288 477ba620 Aurelien Jarno
  cpu="ia64"
289 d66ed0ea Aurelien Jarno
elif check_define __s390__ ; then
290 d66ed0ea Aurelien Jarno
  if check_define __s390x__ ; then
291 d66ed0ea Aurelien Jarno
    cpu="s390x"
292 d66ed0ea Aurelien Jarno
  else
293 d66ed0ea Aurelien Jarno
    cpu="s390"
294 d66ed0ea Aurelien Jarno
  fi
295 21d89f84 Peter Maydell
elif check_define __arm__ ; then
296 21d89f84 Peter Maydell
  cpu="arm"
297 f28ffed5 Brad
elif check_define __hppa__ ; then
298 f28ffed5 Brad
  cpu="hppa"
299 ac0df51d aliguori
else
300 fdf7ed96 malc
  cpu=`uname -m`
301 ac0df51d aliguori
fi
302 ac0df51d aliguori
303 7d13299d bellard
case "$cpu" in
304 d2fbca94 Guan Xuetao
  alpha|cris|ia64|lm32|m68k|microblaze|ppc|ppc64|sparc64|unicore32)
305 ea8f20f8 Juan Quintela
    cpu="$cpu"
306 ea8f20f8 Juan Quintela
  ;;
307 7d13299d bellard
  i386|i486|i586|i686|i86pc|BePC)
308 97a847bc bellard
    cpu="i386"
309 7d13299d bellard
  ;;
310 aaa5fa14 aurel32
  x86_64|amd64)
311 aaa5fa14 aurel32
    cpu="x86_64"
312 aaa5fa14 aurel32
  ;;
313 21d89f84 Peter Maydell
  armv*b|armv*l|arm)
314 21d89f84 Peter Maydell
    cpu="arm"
315 7d13299d bellard
  ;;
316 f28ffed5 Brad
  hppa|parisc|parisc64)
317 f54b3f92 aurel32
    cpu="hppa"
318 f54b3f92 aurel32
  ;;
319 afa05235 Aurelien Jarno
  mips*)
320 afa05235 Aurelien Jarno
    cpu="mips"
321 afa05235 Aurelien Jarno
  ;;
322 24e804ec Alexander Graf
  s390)
323 fb3e5849 bellard
    cpu="s390"
324 fb3e5849 bellard
  ;;
325 24e804ec Alexander Graf
  s390x)
326 24e804ec Alexander Graf
    cpu="s390x"
327 24e804ec Alexander Graf
  ;;
328 3142255c blueswir1
  sparc|sun4[cdmuv])
329 ae228531 bellard
    cpu="sparc"
330 ae228531 bellard
  ;;
331 7d13299d bellard
  *)
332 a447d4dc Paolo Bonzini
    echo "Unsupported CPU = $cpu"
333 a447d4dc Paolo Bonzini
    exit 1
334 7d13299d bellard
  ;;
335 7d13299d bellard
esac
336 e2d52ad3 Juan Quintela
337 7d13299d bellard
# OS specific
338 ac0df51d aliguori
if check_define __linux__ ; then
339 ac0df51d aliguori
  targetos="Linux"
340 ac0df51d aliguori
elif check_define _WIN32 ; then
341 ac0df51d aliguori
  targetos='MINGW32'
342 169dc5d3 blueswir1
elif check_define __OpenBSD__ ; then
343 169dc5d3 blueswir1
  targetos='OpenBSD'
344 169dc5d3 blueswir1
elif check_define __sun__ ; then
345 169dc5d3 blueswir1
  targetos='SunOS'
346 179cf400 Andreas Färber
elif check_define __HAIKU__ ; then
347 179cf400 Andreas Färber
  targetos='Haiku'
348 ac0df51d aliguori
else
349 ac0df51d aliguori
  targetos=`uname -s`
350 ac0df51d aliguori
fi
351 0dbfc675 Juan Quintela
352 7d13299d bellard
case $targetos in
353 c326e0af bellard
CYGWIN*)
354 0dbfc675 Juan Quintela
  mingw32="yes"
355 a558ee17 Juan Quintela
  QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS"
356 d5631638 malc
  audio_possible_drivers="winwave sdl"
357 d5631638 malc
  audio_drv_list="winwave"
358 c326e0af bellard
;;
359 67b915a5 bellard
MINGW32*)
360 0dbfc675 Juan Quintela
  mingw32="yes"
361 d5631638 malc
  audio_possible_drivers="winwave dsound sdl fmod"
362 d5631638 malc
  audio_drv_list="winwave"
363 67b915a5 bellard
;;
364 5c40d2bd ths
GNU/kFreeBSD)
365 a167ba50 Aurelien Jarno
  bsd="yes"
366 0dbfc675 Juan Quintela
  audio_drv_list="oss"
367 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
368 5c40d2bd ths
;;
369 7d3505c5 bellard
FreeBSD)
370 0dbfc675 Juan Quintela
  bsd="yes"
371 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
372 0dbfc675 Juan Quintela
  audio_drv_list="oss"
373 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
374 f01576f1 Juergen Lock
  # needed for kinfo_getvmmap(3) in libutil.h
375 f01576f1 Juergen Lock
  LIBS="-lutil $LIBS"
376 7d3505c5 bellard
;;
377 c5e97233 blueswir1
DragonFly)
378 0dbfc675 Juan Quintela
  bsd="yes"
379 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
380 0dbfc675 Juan Quintela
  audio_drv_list="oss"
381 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
382 c5e97233 blueswir1
;;
383 7d3505c5 bellard
NetBSD)
384 0dbfc675 Juan Quintela
  bsd="yes"
385 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
386 0dbfc675 Juan Quintela
  audio_drv_list="oss"
387 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd"
388 0dbfc675 Juan Quintela
  oss_lib="-lossaudio"
389 7d3505c5 bellard
;;
390 7d3505c5 bellard
OpenBSD)
391 0dbfc675 Juan Quintela
  bsd="yes"
392 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
393 0dbfc675 Juan Quintela
  audio_drv_list="oss"
394 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd"
395 0dbfc675 Juan Quintela
  oss_lib="-lossaudio"
396 7d3505c5 bellard
;;
397 83fb7adf bellard
Darwin)
398 0dbfc675 Juan Quintela
  bsd="yes"
399 0dbfc675 Juan Quintela
  darwin="yes"
400 0dbfc675 Juan Quintela
  # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can
401 0dbfc675 Juan Quintela
  # run 64-bit userspace code
402 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" ] ; then
403 aab8588a malc
    is_x86_64=`sysctl -n hw.optional.x86_64`
404 aab8588a malc
    [ "$is_x86_64" = "1" ] && cpu=x86_64
405 0dbfc675 Juan Quintela
  fi
406 0dbfc675 Juan Quintela
  if [ "$cpu" = "x86_64" ] ; then
407 a558ee17 Juan Quintela
    QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
408 0c439cbf Juan Quintela
    LDFLAGS="-arch x86_64 $LDFLAGS"
409 0dbfc675 Juan Quintela
  else
410 a558ee17 Juan Quintela
    QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
411 0dbfc675 Juan Quintela
  fi
412 0dbfc675 Juan Quintela
  darwin_user="yes"
413 0dbfc675 Juan Quintela
  cocoa="yes"
414 0dbfc675 Juan Quintela
  audio_drv_list="coreaudio"
415 0dbfc675 Juan Quintela
  audio_possible_drivers="coreaudio sdl fmod"
416 0dbfc675 Juan Quintela
  LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS"
417 7973f21c Juan Quintela
  libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
418 83fb7adf bellard
;;
419 ec530c81 bellard
SunOS)
420 0dbfc675 Juan Quintela
  solaris="yes"
421 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
422 0db4a067 Paolo Bonzini
  install="${INSTALL-ginstall}"
423 fa58948d Blue Swirl
  ld="gld"
424 e2d8830e Brad
  smbd="${SMBD-/usr/sfw/sbin/smbd}"
425 0dbfc675 Juan Quintela
  needs_libsunmath="no"
426 0dbfc675 Juan Quintela
  solarisrev=`uname -r | cut -f2 -d.`
427 0dbfc675 Juan Quintela
  # have to select again, because `uname -m` returns i86pc
428 0dbfc675 Juan Quintela
  # even on an x86_64 box.
429 0dbfc675 Juan Quintela
  solariscpu=`isainfo -k`
430 0dbfc675 Juan Quintela
  if test "${solariscpu}" = "amd64" ; then
431 0dbfc675 Juan Quintela
    cpu="x86_64"
432 0dbfc675 Juan Quintela
  fi
433 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
434 0dbfc675 Juan Quintela
    if test "$solarisrev" -le 9 ; then
435 0dbfc675 Juan Quintela
      if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
436 0dbfc675 Juan Quintela
        needs_libsunmath="yes"
437 f14bfdf9 Juan Quintela
        QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS"
438 f14bfdf9 Juan Quintela
        LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
439 f14bfdf9 Juan Quintela
        LIBS="-lsunmath $LIBS"
440 0dbfc675 Juan Quintela
      else
441 0dbfc675 Juan Quintela
        echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
442 0dbfc675 Juan Quintela
        echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
443 0dbfc675 Juan Quintela
        echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
444 0dbfc675 Juan Quintela
        echo "Studio 11 can be downloaded from www.sun.com."
445 0dbfc675 Juan Quintela
        exit 1
446 0dbfc675 Juan Quintela
      fi
447 86b2bd93 ths
    fi
448 0dbfc675 Juan Quintela
  fi
449 0dbfc675 Juan Quintela
  if test -f /usr/include/sys/soundcard.h ; then
450 0dbfc675 Juan Quintela
    audio_drv_list="oss"
451 0dbfc675 Juan Quintela
  fi
452 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl"
453 d741429a Blue Swirl
# needed for CMSG_ macros in sys/socket.h
454 d741429a Blue Swirl
  QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
455 d741429a Blue Swirl
# needed for TIOCWIN* defines in termios.h
456 d741429a Blue Swirl
  QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
457 a558ee17 Juan Quintela
  QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
458 e174c0bb Juan Quintela
  LIBS="-lsocket -lnsl -lresolv $LIBS"
459 86b2bd93 ths
;;
460 b29fe3ed malc
AIX)
461 0dbfc675 Juan Quintela
  aix="yes"
462 0db4a067 Paolo Bonzini
  make="${MAKE-gmake}"
463 b29fe3ed malc
;;
464 179cf400 Andreas Färber
Haiku)
465 179cf400 Andreas Färber
  haiku="yes"
466 179cf400 Andreas Färber
  QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
467 179cf400 Andreas Färber
  LIBS="-lposix_error_mapper -lnetwork $LIBS"
468 179cf400 Andreas Färber
;;
469 1d14ffa9 bellard
*)
470 0dbfc675 Juan Quintela
  audio_drv_list="oss"
471 0dbfc675 Juan Quintela
  audio_possible_drivers="oss alsa sdl esd pa"
472 0dbfc675 Juan Quintela
  linux="yes"
473 0dbfc675 Juan Quintela
  linux_user="yes"
474 0dbfc675 Juan Quintela
  usb="linux"
475 af2be207 Jan Kiszka
  kvm="yes"
476 af2be207 Jan Kiszka
  vhost_net="yes"
477 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
478 c2de5c91 malc
    audio_possible_drivers="$audio_possible_drivers fmod"
479 0dbfc675 Juan Quintela
  fi
480 fb065187 bellard
;;
481 7d13299d bellard
esac
482 7d13299d bellard
483 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
484 b1a550a0 pbrook
  if [ "$darwin" != "yes" ] ; then
485 68063649 blueswir1
    usb="bsd"
486 83fb7adf bellard
  fi
487 84778508 blueswir1
  bsd_user="yes"
488 7d3505c5 bellard
fi
489 7d3505c5 bellard
490 0db4a067 Paolo Bonzini
: ${make=${MAKE-make}}
491 0db4a067 Paolo Bonzini
: ${install=${INSTALL-install}}
492 c886edfb Blue Swirl
: ${python=${PYTHON-python}}
493 e2d8830e Brad
: ${smbd=${SMBD-/usr/sbin/smbd}}
494 0db4a067 Paolo Bonzini
495 3457a3f8 Juan Quintela
if test "$mingw32" = "yes" ; then
496 3457a3f8 Juan Quintela
  EXESUF=".exe"
497 a558ee17 Juan Quintela
  QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
498 e94a7936 Stefan Weil
  # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
499 e94a7936 Stefan Weil
  QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
500 08f3896a Stefan Weil
  LIBS="-lwinmm -lws2_32 -liberty -liphlpapi $LIBS"
501 683035de Paolo Bonzini
  prefix="c:/Program Files/Qemu"
502 683035de Paolo Bonzini
  mandir="\${prefix}"
503 683035de Paolo Bonzini
  datadir="\${prefix}"
504 683035de Paolo Bonzini
  docdir="\${prefix}"
505 683035de Paolo Bonzini
  bindir="\${prefix}"
506 683035de Paolo Bonzini
  sysconfdir="\${prefix}"
507 683035de Paolo Bonzini
  confsuffix=""
508 83b2f0a0 Stefan Weil
  guest_agent="no"
509 3457a3f8 Juan Quintela
fi
510 3457a3f8 Juan Quintela
511 487fefdb Anthony Liguori
werror=""
512 85aa5189 bellard
513 7d13299d bellard
for opt do
514 a46e4035 pbrook
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
515 7d13299d bellard
  case "$opt" in
516 2efc3265 bellard
  --help|-h) show_help=yes
517 2efc3265 bellard
  ;;
518 99123e13 Mike Frysinger
  --version|-V) exec cat $source_path/VERSION
519 99123e13 Mike Frysinger
  ;;
520 b1a550a0 pbrook
  --prefix=*) prefix="$optarg"
521 7d13299d bellard
  ;;
522 b1a550a0 pbrook
  --interp-prefix=*) interp_prefix="$optarg"
523 32ce6337 bellard
  ;;
524 ca4deeb1 Paolo Bonzini
  --source-path=*)
525 7d13299d bellard
  ;;
526 ac0df51d aliguori
  --cross-prefix=*)
527 7d13299d bellard
  ;;
528 ac0df51d aliguori
  --cc=*)
529 7d13299d bellard
  ;;
530 b1a550a0 pbrook
  --host-cc=*) host_cc="$optarg"
531 83469015 bellard
  ;;
532 b1a550a0 pbrook
  --make=*) make="$optarg"
533 7d13299d bellard
  ;;
534 6a882643 pbrook
  --install=*) install="$optarg"
535 6a882643 pbrook
  ;;
536 c886edfb Blue Swirl
  --python=*) python="$optarg"
537 c886edfb Blue Swirl
  ;;
538 e2d8830e Brad
  --smbd=*) smbd="$optarg"
539 e2d8830e Brad
  ;;
540 e2a2ed06 Juan Quintela
  --extra-cflags=*)
541 7d13299d bellard
  ;;
542 e2a2ed06 Juan Quintela
  --extra-ldflags=*)
543 7d13299d bellard
  ;;
544 2ff6b91e Juan Quintela
  --cpu=*)
545 7d13299d bellard
  ;;
546 b1a550a0 pbrook
  --target-list=*) target_list="$optarg"
547 de83cd02 bellard
  ;;
548 74242e0f Paolo Bonzini
  --enable-trace-backend=*) trace_backend="$optarg"
549 94a420b1 Stefan Hajnoczi
  ;;
550 74242e0f Paolo Bonzini
  --with-trace-file=*) trace_file="$optarg"
551 9410b56c Prerna Saxena
  ;;
552 7d13299d bellard
  --enable-gprof) gprof="yes"
553 7d13299d bellard
  ;;
554 79427693 Loïc Minier
  --static)
555 79427693 Loïc Minier
    static="yes"
556 79427693 Loïc Minier
    LDFLAGS="-static $LDFLAGS"
557 43ce4dfe bellard
  ;;
558 0b24e75f Paolo Bonzini
  --mandir=*) mandir="$optarg"
559 0b24e75f Paolo Bonzini
  ;;
560 0b24e75f Paolo Bonzini
  --bindir=*) bindir="$optarg"
561 0b24e75f Paolo Bonzini
  ;;
562 3aa5d2be Alon Levy
  --libdir=*) libdir="$optarg"
563 3aa5d2be Alon Levy
  ;;
564 0f94d6da Alon Levy
  --includedir=*) includedir="$optarg"
565 0f94d6da Alon Levy
  ;;
566 0b24e75f Paolo Bonzini
  --datadir=*) datadir="$optarg"
567 0b24e75f Paolo Bonzini
  ;;
568 0b24e75f Paolo Bonzini
  --docdir=*) docdir="$optarg"
569 0b24e75f Paolo Bonzini
  ;;
570 ca2fb938 Andre Przywara
  --sysconfdir=*) sysconfdir="$optarg"
571 07381cc1 Anthony Liguori
  ;;
572 023ddd74 Max Filippov
  --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\
573 023ddd74 Max Filippov
  --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\
574 023ddd74 Max Filippov
  --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
575 023ddd74 Max Filippov
    # These switches are silently ignored, for compatibility with
576 023ddd74 Max Filippov
    # autoconf-generated configure scripts. This allows QEMU's
577 023ddd74 Max Filippov
    # configure to be used by RPM and similar macros that set
578 023ddd74 Max Filippov
    # lots of directory switches by default.
579 023ddd74 Max Filippov
  ;;
580 97a847bc bellard
  --disable-sdl) sdl="no"
581 97a847bc bellard
  ;;
582 c4198157 Juan Quintela
  --enable-sdl) sdl="yes"
583 c4198157 Juan Quintela
  ;;
584 821601ea Jes Sorensen
  --disable-vnc) vnc="no"
585 821601ea Jes Sorensen
  ;;
586 821601ea Jes Sorensen
  --enable-vnc) vnc="yes"
587 821601ea Jes Sorensen
  ;;
588 0c58ac1c malc
  --fmod-lib=*) fmod_lib="$optarg"
589 1d14ffa9 bellard
  ;;
590 c2de5c91 malc
  --fmod-inc=*) fmod_inc="$optarg"
591 c2de5c91 malc
  ;;
592 2f6a1ab0 blueswir1
  --oss-lib=*) oss_lib="$optarg"
593 2f6a1ab0 blueswir1
  ;;
594 2fa7d3bf malc
  --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
595 102a52e4 bellard
  ;;
596 0c58ac1c malc
  --audio-drv-list=*) audio_drv_list="$optarg"
597 102a52e4 bellard
  ;;
598 eb852011 Markus Armbruster
  --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
599 eb852011 Markus Armbruster
  ;;
600 f8393946 aurel32
  --enable-debug-tcg) debug_tcg="yes"
601 f8393946 aurel32
  ;;
602 f8393946 aurel32
  --disable-debug-tcg) debug_tcg="no"
603 f8393946 aurel32
  ;;
604 b4475aa2 Luiz Capitulino
  --enable-debug-mon) debug_mon="yes"
605 b4475aa2 Luiz Capitulino
  ;;
606 b4475aa2 Luiz Capitulino
  --disable-debug-mon) debug_mon="no"
607 b4475aa2 Luiz Capitulino
  ;;
608 f3d08ee6 Paul Brook
  --enable-debug)
609 f3d08ee6 Paul Brook
      # Enable debugging options that aren't excessively noisy
610 f3d08ee6 Paul Brook
      debug_tcg="yes"
611 b4475aa2 Luiz Capitulino
      debug_mon="yes"
612 f3d08ee6 Paul Brook
      debug="yes"
613 f3d08ee6 Paul Brook
      strip_opt="no"
614 f3d08ee6 Paul Brook
  ;;
615 03b4fe7d aliguori
  --enable-sparse) sparse="yes"
616 03b4fe7d aliguori
  ;;
617 03b4fe7d aliguori
  --disable-sparse) sparse="no"
618 03b4fe7d aliguori
  ;;
619 1625af87 aliguori
  --disable-strip) strip_opt="no"
620 1625af87 aliguori
  ;;
621 8d5d2d4c ths
  --disable-vnc-tls) vnc_tls="no"
622 8d5d2d4c ths
  ;;
623 1be10ad2 Juan Quintela
  --enable-vnc-tls) vnc_tls="yes"
624 1be10ad2 Juan Quintela
  ;;
625 2f9606b3 aliguori
  --disable-vnc-sasl) vnc_sasl="no"
626 2f9606b3 aliguori
  ;;
627 ea784e3b Juan Quintela
  --enable-vnc-sasl) vnc_sasl="yes"
628 ea784e3b Juan Quintela
  ;;
629 2f6f5c7a Corentin Chary
  --disable-vnc-jpeg) vnc_jpeg="no"
630 2f6f5c7a Corentin Chary
  ;;
631 2f6f5c7a Corentin Chary
  --enable-vnc-jpeg) vnc_jpeg="yes"
632 2f6f5c7a Corentin Chary
  ;;
633 efe556ad Corentin Chary
  --disable-vnc-png) vnc_png="no"
634 efe556ad Corentin Chary
  ;;
635 efe556ad Corentin Chary
  --enable-vnc-png) vnc_png="yes"
636 efe556ad Corentin Chary
  ;;
637 bd023f95 Corentin Chary
  --disable-vnc-thread) vnc_thread="no"
638 bd023f95 Corentin Chary
  ;;
639 bd023f95 Corentin Chary
  --enable-vnc-thread) vnc_thread="yes"
640 bd023f95 Corentin Chary
  ;;
641 443f1376 bellard
  --disable-slirp) slirp="no"
642 1d14ffa9 bellard
  ;;
643 ee682d27 Stefan Weil
  --disable-uuid) uuid="no"
644 ee682d27 Stefan Weil
  ;;
645 ee682d27 Stefan Weil
  --enable-uuid) uuid="yes"
646 ee682d27 Stefan Weil
  ;;
647 e0e6c8c0 aliguori
  --disable-vde) vde="no"
648 8a16d273 ths
  ;;
649 dfb278bd Juan Quintela
  --enable-vde) vde="yes"
650 dfb278bd Juan Quintela
  ;;
651 e37630ca aliguori
  --disable-xen) xen="no"
652 e37630ca aliguori
  ;;
653 fc321b4b Juan Quintela
  --enable-xen) xen="yes"
654 fc321b4b Juan Quintela
  ;;
655 2e4d9fb1 aurel32
  --disable-brlapi) brlapi="no"
656 2e4d9fb1 aurel32
  ;;
657 4ffcedb6 Juan Quintela
  --enable-brlapi) brlapi="yes"
658 4ffcedb6 Juan Quintela
  ;;
659 fb599c9a balrog
  --disable-bluez) bluez="no"
660 fb599c9a balrog
  ;;
661 a20a6f46 Juan Quintela
  --enable-bluez) bluez="yes"
662 a20a6f46 Juan Quintela
  ;;
663 7ba1e619 aliguori
  --disable-kvm) kvm="no"
664 7ba1e619 aliguori
  ;;
665 b31a0277 Juan Quintela
  --enable-kvm) kvm="yes"
666 b31a0277 Juan Quintela
  ;;
667 9195b2c2 Stefan Weil
  --disable-tcg-interpreter) tcg_interpreter="no"
668 9195b2c2 Stefan Weil
  ;;
669 9195b2c2 Stefan Weil
  --enable-tcg-interpreter) tcg_interpreter="yes"
670 9195b2c2 Stefan Weil
  ;;
671 cd4ec0b4 Gerd Hoffmann
  --disable-spice) spice="no"
672 cd4ec0b4 Gerd Hoffmann
  ;;
673 cd4ec0b4 Gerd Hoffmann
  --enable-spice) spice="yes"
674 cd4ec0b4 Gerd Hoffmann
  ;;
675 c589b249 Ronnie Sahlberg
  --disable-libiscsi) libiscsi="no"
676 c589b249 Ronnie Sahlberg
  ;;
677 c589b249 Ronnie Sahlberg
  --enable-libiscsi) libiscsi="yes"
678 c589b249 Ronnie Sahlberg
  ;;
679 05c2a3e7 bellard
  --enable-profiler) profiler="yes"
680 05c2a3e7 bellard
  ;;
681 c2de5c91 malc
  --enable-cocoa)
682 c2de5c91 malc
      cocoa="yes" ;
683 c2de5c91 malc
      sdl="no" ;
684 c2de5c91 malc
      audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
685 1d14ffa9 bellard
  ;;
686 cad25d69 pbrook
  --disable-system) softmmu="no"
687 0a8e90f4 pbrook
  ;;
688 cad25d69 pbrook
  --enable-system) softmmu="yes"
689 0a8e90f4 pbrook
  ;;
690 0953a80f Zachary Amsden
  --disable-user)
691 0953a80f Zachary Amsden
      linux_user="no" ;
692 0953a80f Zachary Amsden
      bsd_user="no" ;
693 0953a80f Zachary Amsden
      darwin_user="no"
694 0953a80f Zachary Amsden
  ;;
695 0953a80f Zachary Amsden
  --enable-user) ;;
696 831b7825 ths
  --disable-linux-user) linux_user="no"
697 0a8e90f4 pbrook
  ;;
698 831b7825 ths
  --enable-linux-user) linux_user="yes"
699 831b7825 ths
  ;;
700 831b7825 ths
  --disable-darwin-user) darwin_user="no"
701 831b7825 ths
  ;;
702 831b7825 ths
  --enable-darwin-user) darwin_user="yes"
703 0a8e90f4 pbrook
  ;;
704 84778508 blueswir1
  --disable-bsd-user) bsd_user="no"
705 84778508 blueswir1
  ;;
706 84778508 blueswir1
  --enable-bsd-user) bsd_user="yes"
707 84778508 blueswir1
  ;;
708 379f6698 Paul Brook
  --enable-guest-base) guest_base="yes"
709 379f6698 Paul Brook
  ;;
710 379f6698 Paul Brook
  --disable-guest-base) guest_base="no"
711 379f6698 Paul Brook
  ;;
712 40d6444e Avi Kivity
  --enable-pie) pie="yes"
713 34005a00 Kirill A. Shutemov
  ;;
714 40d6444e Avi Kivity
  --disable-pie) pie="no"
715 34005a00 Kirill A. Shutemov
  ;;
716 c5937220 pbrook
  --enable-uname-release=*) uname_release="$optarg"
717 c5937220 pbrook
  ;;
718 3142255c blueswir1
  --sparc_cpu=*)
719 3142255c blueswir1
  ;;
720 85aa5189 bellard
  --enable-werror) werror="yes"
721 85aa5189 bellard
  ;;
722 85aa5189 bellard
  --disable-werror) werror="no"
723 85aa5189 bellard
  ;;
724 4d3b6f6e balrog
  --disable-curses) curses="no"
725 4d3b6f6e balrog
  ;;
726 c584a6d0 Juan Quintela
  --enable-curses) curses="yes"
727 c584a6d0 Juan Quintela
  ;;
728 769ce76d Alexander Graf
  --disable-curl) curl="no"
729 769ce76d Alexander Graf
  ;;
730 788c8196 Juan Quintela
  --enable-curl) curl="yes"
731 788c8196 Juan Quintela
  ;;
732 2df87df7 Juan Quintela
  --disable-fdt) fdt="no"
733 2df87df7 Juan Quintela
  ;;
734 2df87df7 Juan Quintela
  --enable-fdt) fdt="yes"
735 2df87df7 Juan Quintela
  ;;
736 5495ed11 Luiz Capitulino
  --disable-check-utests) check_utests="no"
737 5495ed11 Luiz Capitulino
  ;;
738 5495ed11 Luiz Capitulino
  --enable-check-utests) check_utests="yes"
739 5495ed11 Luiz Capitulino
  ;;
740 bd0c5661 pbrook
  --disable-nptl) nptl="no"
741 bd0c5661 pbrook
  ;;
742 b0a47e79 Juan Quintela
  --enable-nptl) nptl="yes"
743 b0a47e79 Juan Quintela
  ;;
744 8ff9cbf7 malc
  --enable-mixemu) mixemu="yes"
745 8ff9cbf7 malc
  ;;
746 5c6c3a6c Christoph Hellwig
  --disable-linux-aio) linux_aio="no"
747 5c6c3a6c Christoph Hellwig
  ;;
748 5c6c3a6c Christoph Hellwig
  --enable-linux-aio) linux_aio="yes"
749 5c6c3a6c Christoph Hellwig
  ;;
750 758e8e38 Venkateswararao Jujjuri (JV)
  --disable-attr) attr="no"
751 758e8e38 Venkateswararao Jujjuri (JV)
  ;;
752 758e8e38 Venkateswararao Jujjuri (JV)
  --enable-attr) attr="yes"
753 758e8e38 Venkateswararao Jujjuri (JV)
  ;;
754 77755340 ths
  --disable-blobs) blobs="no"
755 77755340 ths
  ;;
756 4a19f1ec pbrook
  --with-pkgversion=*) pkgversion=" ($optarg)"
757 4a19f1ec pbrook
  ;;
758 a25dba17 Juan Quintela
  --disable-docs) docs="no"
759 70ec5dc0 Anthony Liguori
  ;;
760 a25dba17 Juan Quintela
  --enable-docs) docs="yes"
761 83a3ab8b Juan Quintela
  ;;
762 d5970055 Michael S. Tsirkin
  --disable-vhost-net) vhost_net="no"
763 d5970055 Michael S. Tsirkin
  ;;
764 d5970055 Michael S. Tsirkin
  --enable-vhost-net) vhost_net="yes"
765 d5970055 Michael S. Tsirkin
  ;;
766 20ff075b Michael Walle
  --disable-opengl) opengl="no"
767 20ff075b Michael Walle
  ;;
768 20ff075b Michael Walle
  --enable-opengl) opengl="yes"
769 20ff075b Michael Walle
  ;;
770 f27aaf4b Christian Brunner
  --disable-rbd) rbd="no"
771 f27aaf4b Christian Brunner
  ;;
772 f27aaf4b Christian Brunner
  --enable-rbd) rbd="yes"
773 f27aaf4b Christian Brunner
  ;;
774 36707144 Alon Levy
  --disable-smartcard) smartcard="no"
775 36707144 Alon Levy
  ;;
776 36707144 Alon Levy
  --enable-smartcard) smartcard="yes"
777 36707144 Alon Levy
  ;;
778 111a38b0 Robert Relyea
  --disable-smartcard-nss) smartcard_nss="no"
779 111a38b0 Robert Relyea
  ;;
780 111a38b0 Robert Relyea
  --enable-smartcard-nss) smartcard_nss="yes"
781 111a38b0 Robert Relyea
  ;;
782 69354a83 Hans de Goede
  --disable-usb-redir) usb_redir="no"
783 69354a83 Hans de Goede
  ;;
784 69354a83 Hans de Goede
  --enable-usb-redir) usb_redir="yes"
785 69354a83 Hans de Goede
  ;;
786 1ece9905 Alon Levy
  --disable-zlib-test) zlib="no"
787 1ece9905 Alon Levy
  ;;
788 d138cee9 Michael Roth
  --enable-guest-agent) guest_agent="yes"
789 d138cee9 Michael Roth
  ;;
790 d138cee9 Michael Roth
  --disable-guest-agent) guest_agent="no"
791 d138cee9 Michael Roth
  ;;
792 7f1559c6 balrog
  *) echo "ERROR: unknown option $opt"; show_help="yes"
793 7f1559c6 balrog
  ;;
794 7d13299d bellard
  esac
795 7d13299d bellard
done
796 7d13299d bellard
797 3142255c blueswir1
#
798 3142255c blueswir1
# If cpu ~= sparc and  sparc_cpu hasn't been defined, plug in the right
799 a558ee17 Juan Quintela
# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
800 3142255c blueswir1
#
801 379f6698 Paul Brook
host_guest_base="no"
802 40293e58 bellard
case "$cpu" in
803 ed968ff1 Juan Quintela
    sparc) case $sparc_cpu in
804 ed968ff1 Juan Quintela
           v7|v8)
805 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
806 ed968ff1 Juan Quintela
           ;;
807 ed968ff1 Juan Quintela
           v8plus|v8plusa)
808 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
809 ed968ff1 Juan Quintela
           ;;
810 ed968ff1 Juan Quintela
           *) # sparc_cpu not defined in the command line
811 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
812 ed968ff1 Juan Quintela
           esac
813 ed968ff1 Juan Quintela
           LDFLAGS="-m32 $LDFLAGS"
814 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
815 762e8230 blueswir1
           if test "$solaris" = "no" ; then
816 a558ee17 Juan Quintela
             QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
817 c81da56e Juan Quintela
             helper_cflags="-ffixed-i0"
818 762e8230 blueswir1
           fi
819 3142255c blueswir1
           ;;
820 ed968ff1 Juan Quintela
    sparc64)
821 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
822 ed968ff1 Juan Quintela
           LDFLAGS="-m64 $LDFLAGS"
823 a558ee17 Juan Quintela
           QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
824 ed968ff1 Juan Quintela
           if test "$solaris" != "no" ; then
825 a558ee17 Juan Quintela
             QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS"
826 762e8230 blueswir1
           fi
827 3142255c blueswir1
           ;;
828 76d83bde ths
    s390)
829 28d7cc49 Richard Henderson
           QEMU_CFLAGS="-m31 -march=z990 $QEMU_CFLAGS"
830 28d7cc49 Richard Henderson
           LDFLAGS="-m31 $LDFLAGS"
831 48bb3750 Richard Henderson
           host_guest_base="yes"
832 28d7cc49 Richard Henderson
           ;;
833 28d7cc49 Richard Henderson
    s390x)
834 28d7cc49 Richard Henderson
           QEMU_CFLAGS="-m64 -march=z990 $QEMU_CFLAGS"
835 28d7cc49 Richard Henderson
           LDFLAGS="-m64 $LDFLAGS"
836 48bb3750 Richard Henderson
           host_guest_base="yes"
837 76d83bde ths
           ;;
838 40293e58 bellard
    i386)
839 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
840 0c439cbf Juan Quintela
           LDFLAGS="-m32 $LDFLAGS"
841 2b2e59e6 Paolo Bonzini
           cc_i386='$(CC) -m32'
842 c81da56e Juan Quintela
           helper_cflags="-fomit-frame-pointer"
843 379f6698 Paul Brook
           host_guest_base="yes"
844 40293e58 bellard
           ;;
845 40293e58 bellard
    x86_64)
846 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
847 0c439cbf Juan Quintela
           LDFLAGS="-m64 $LDFLAGS"
848 2b2e59e6 Paolo Bonzini
           cc_i386='$(CC) -m32'
849 379f6698 Paul Brook
           host_guest_base="yes"
850 379f6698 Paul Brook
           ;;
851 379f6698 Paul Brook
    arm*)
852 379f6698 Paul Brook
           host_guest_base="yes"
853 40293e58 bellard
           ;;
854 f6548c0a malc
    ppc*)
855 f6548c0a malc
           host_guest_base="yes"
856 f6548c0a malc
           ;;
857 cc01cc8e Aurelien Jarno
    mips*)
858 cc01cc8e Aurelien Jarno
           host_guest_base="yes"
859 cc01cc8e Aurelien Jarno
           ;;
860 477ba620 Aurelien Jarno
    ia64*)
861 477ba620 Aurelien Jarno
           host_guest_base="yes"
862 477ba620 Aurelien Jarno
           ;;
863 fd76e73a Richard Henderson
    hppa*)
864 fd76e73a Richard Henderson
           host_guest_base="yes"
865 fd76e73a Richard Henderson
           ;;
866 d2fbca94 Guan Xuetao
    unicore32*)
867 d2fbca94 Guan Xuetao
           host_guest_base="yes"
868 d2fbca94 Guan Xuetao
           ;;
869 3142255c blueswir1
esac
870 3142255c blueswir1
871 379f6698 Paul Brook
[ -z "$guest_base" ] && guest_base="$host_guest_base"
872 379f6698 Paul Brook
873 60e0df25 Peter Maydell
874 60e0df25 Peter Maydell
default_target_list=""
875 60e0df25 Peter Maydell
876 60e0df25 Peter Maydell
# these targets are portable
877 60e0df25 Peter Maydell
if [ "$softmmu" = "yes" ] ; then
878 60e0df25 Peter Maydell
    default_target_list="\
879 60e0df25 Peter Maydell
i386-softmmu \
880 60e0df25 Peter Maydell
x86_64-softmmu \
881 27cdad67 Richard Henderson
alpha-softmmu \
882 60e0df25 Peter Maydell
arm-softmmu \
883 60e0df25 Peter Maydell
cris-softmmu \
884 60e0df25 Peter Maydell
lm32-softmmu \
885 60e0df25 Peter Maydell
m68k-softmmu \
886 60e0df25 Peter Maydell
microblaze-softmmu \
887 60e0df25 Peter Maydell
microblazeel-softmmu \
888 60e0df25 Peter Maydell
mips-softmmu \
889 60e0df25 Peter Maydell
mipsel-softmmu \
890 60e0df25 Peter Maydell
mips64-softmmu \
891 60e0df25 Peter Maydell
mips64el-softmmu \
892 60e0df25 Peter Maydell
ppc-softmmu \
893 60e0df25 Peter Maydell
ppcemb-softmmu \
894 60e0df25 Peter Maydell
ppc64-softmmu \
895 60e0df25 Peter Maydell
sh4-softmmu \
896 60e0df25 Peter Maydell
sh4eb-softmmu \
897 60e0df25 Peter Maydell
sparc-softmmu \
898 60e0df25 Peter Maydell
sparc64-softmmu \
899 0f3301d4 Alexander Graf
s390x-softmmu \
900 cfa550c6 Max Filippov
xtensa-softmmu \
901 cfa550c6 Max Filippov
xtensaeb-softmmu \
902 60e0df25 Peter Maydell
"
903 60e0df25 Peter Maydell
fi
904 60e0df25 Peter Maydell
# the following are Linux specific
905 60e0df25 Peter Maydell
if [ "$linux_user" = "yes" ] ; then
906 60e0df25 Peter Maydell
    default_target_list="${default_target_list}\
907 60e0df25 Peter Maydell
i386-linux-user \
908 60e0df25 Peter Maydell
x86_64-linux-user \
909 60e0df25 Peter Maydell
alpha-linux-user \
910 60e0df25 Peter Maydell
arm-linux-user \
911 60e0df25 Peter Maydell
armeb-linux-user \
912 60e0df25 Peter Maydell
cris-linux-user \
913 60e0df25 Peter Maydell
m68k-linux-user \
914 60e0df25 Peter Maydell
microblaze-linux-user \
915 60e0df25 Peter Maydell
microblazeel-linux-user \
916 60e0df25 Peter Maydell
mips-linux-user \
917 60e0df25 Peter Maydell
mipsel-linux-user \
918 60e0df25 Peter Maydell
ppc-linux-user \
919 60e0df25 Peter Maydell
ppc64-linux-user \
920 60e0df25 Peter Maydell
ppc64abi32-linux-user \
921 60e0df25 Peter Maydell
sh4-linux-user \
922 60e0df25 Peter Maydell
sh4eb-linux-user \
923 60e0df25 Peter Maydell
sparc-linux-user \
924 60e0df25 Peter Maydell
sparc64-linux-user \
925 60e0df25 Peter Maydell
sparc32plus-linux-user \
926 60e0df25 Peter Maydell
unicore32-linux-user \
927 0f3301d4 Alexander Graf
s390x-linux-user \
928 60e0df25 Peter Maydell
"
929 60e0df25 Peter Maydell
fi
930 60e0df25 Peter Maydell
# the following are Darwin specific
931 60e0df25 Peter Maydell
if [ "$darwin_user" = "yes" ] ; then
932 60e0df25 Peter Maydell
    default_target_list="$default_target_list i386-darwin-user ppc-darwin-user "
933 60e0df25 Peter Maydell
fi
934 60e0df25 Peter Maydell
# the following are BSD specific
935 60e0df25 Peter Maydell
if [ "$bsd_user" = "yes" ] ; then
936 60e0df25 Peter Maydell
    default_target_list="${default_target_list}\
937 60e0df25 Peter Maydell
i386-bsd-user \
938 60e0df25 Peter Maydell
x86_64-bsd-user \
939 60e0df25 Peter Maydell
sparc-bsd-user \
940 60e0df25 Peter Maydell
sparc64-bsd-user \
941 60e0df25 Peter Maydell
"
942 60e0df25 Peter Maydell
fi
943 60e0df25 Peter Maydell
944 af5db58e pbrook
if test x"$show_help" = x"yes" ; then
945 af5db58e pbrook
cat << EOF
946 af5db58e pbrook
947 af5db58e pbrook
Usage: configure [options]
948 af5db58e pbrook
Options: [defaults in brackets after descriptions]
949 af5db58e pbrook
950 af5db58e pbrook
EOF
951 af5db58e pbrook
echo "Standard options:"
952 af5db58e pbrook
echo "  --help                   print this message"
953 af5db58e pbrook
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
954 af5db58e pbrook
echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
955 af5db58e pbrook
echo "                           use %M for cpu name [$interp_prefix]"
956 60e0df25 Peter Maydell
echo "  --target-list=LIST       set target list (default: build everything)"
957 60e0df25 Peter Maydell
echo "Available targets: $default_target_list" | \
958 60e0df25 Peter Maydell
    fold -s -w 53 | sed -e 's/^/                           /'
959 af5db58e pbrook
echo ""
960 af5db58e pbrook
echo "Advanced options (experts only):"
961 af5db58e pbrook
echo "  --source-path=PATH       path of source code [$source_path]"
962 af5db58e pbrook
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
963 af5db58e pbrook
echo "  --cc=CC                  use C compiler CC [$cc]"
964 0bfe8cc0 Paolo Bonzini
echo "  --host-cc=CC             use C compiler CC [$host_cc] for code run at"
965 0bfe8cc0 Paolo Bonzini
echo "                           build time"
966 a558ee17 Juan Quintela
echo "  --extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS"
967 e3fc14c3 Jan Kiszka
echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
968 af5db58e pbrook
echo "  --make=MAKE              use specified make [$make]"
969 6a882643 pbrook
echo "  --install=INSTALL        use specified install [$install]"
970 c886edfb Blue Swirl
echo "  --python=PYTHON          use specified python [$python]"
971 e2d8830e Brad
echo "  --smbd=SMBD              use specified smbd [$smbd]"
972 af5db58e pbrook
echo "  --static                 enable static build [$static]"
973 0b24e75f Paolo Bonzini
echo "  --mandir=PATH            install man pages in PATH"
974 0b24e75f Paolo Bonzini
echo "  --datadir=PATH           install firmware in PATH"
975 0b24e75f Paolo Bonzini
echo "  --docdir=PATH            install documentation in PATH"
976 0b24e75f Paolo Bonzini
echo "  --bindir=PATH            install binaries in PATH"
977 0b24e75f Paolo Bonzini
echo "  --sysconfdir=PATH        install config in PATH/qemu"
978 f8393946 aurel32
echo "  --enable-debug-tcg       enable TCG debugging"
979 f8393946 aurel32
echo "  --disable-debug-tcg      disable TCG debugging (default)"
980 09695a4a Stefan Weil
echo "  --enable-debug           enable common debug build options"
981 890b1658 aliguori
echo "  --enable-sparse          enable sparse checker"
982 890b1658 aliguori
echo "  --disable-sparse         disable sparse checker (default)"
983 1625af87 aliguori
echo "  --disable-strip          disable stripping binaries"
984 85aa5189 bellard
echo "  --disable-werror         disable compilation abort on warning"
985 fe8f78e4 balrog
echo "  --disable-sdl            disable SDL"
986 c4198157 Juan Quintela
echo "  --enable-sdl             enable SDL"
987 821601ea Jes Sorensen
echo "  --disable-vnc            disable VNC"
988 821601ea Jes Sorensen
echo "  --enable-vnc             enable VNC"
989 af5db58e pbrook
echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
990 c2de5c91 malc
echo "  --audio-drv-list=LIST    set audio drivers list:"
991 c2de5c91 malc
echo "                           Available drivers: $audio_possible_drivers"
992 4c9b53e3 malc
echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_list]"
993 4c9b53e3 malc
echo "                           Available cards: $audio_possible_cards"
994 eb852011 Markus Armbruster
echo "  --block-drv-whitelist=L  set block driver whitelist"
995 eb852011 Markus Armbruster
echo "                           (affects only QEMU, not qemu-img)"
996 8ff9cbf7 malc
echo "  --enable-mixemu          enable mixer emulation"
997 e37630ca aliguori
echo "  --disable-xen            disable xen backend driver support"
998 fc321b4b Juan Quintela
echo "  --enable-xen             enable xen backend driver support"
999 2e4d9fb1 aurel32
echo "  --disable-brlapi         disable BrlAPI"
1000 4ffcedb6 Juan Quintela
echo "  --enable-brlapi          enable BrlAPI"
1001 8d5d2d4c ths
echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
1002 1be10ad2 Juan Quintela
echo "  --enable-vnc-tls         enable TLS encryption for VNC server"
1003 2f9606b3 aliguori
echo "  --disable-vnc-sasl       disable SASL encryption for VNC server"
1004 ea784e3b Juan Quintela
echo "  --enable-vnc-sasl        enable SASL encryption for VNC server"
1005 2f6f5c7a Corentin Chary
echo "  --disable-vnc-jpeg       disable JPEG lossy compression for VNC server"
1006 2f6f5c7a Corentin Chary
echo "  --enable-vnc-jpeg        enable JPEG lossy compression for VNC server"
1007 96763cf9 Corentin Chary
echo "  --disable-vnc-png        disable PNG compression for VNC server (default)"
1008 efe556ad Corentin Chary
echo "  --enable-vnc-png         enable PNG compression for VNC server"
1009 bd023f95 Corentin Chary
echo "  --disable-vnc-thread     disable threaded VNC server"
1010 bd023f95 Corentin Chary
echo "  --enable-vnc-thread      enable threaded VNC server"
1011 af896aaa pbrook
echo "  --disable-curses         disable curses output"
1012 c584a6d0 Juan Quintela
echo "  --enable-curses          enable curses output"
1013 769ce76d Alexander Graf
echo "  --disable-curl           disable curl connectivity"
1014 788c8196 Juan Quintela
echo "  --enable-curl            enable curl connectivity"
1015 2df87df7 Juan Quintela
echo "  --disable-fdt            disable fdt device tree"
1016 2df87df7 Juan Quintela
echo "  --enable-fdt             enable fdt device tree"
1017 5495ed11 Luiz Capitulino
echo "  --disable-check-utests   disable check unit-tests"
1018 5495ed11 Luiz Capitulino
echo "  --enable-check-utests    enable check unit-tests"
1019 fb599c9a balrog
echo "  --disable-bluez          disable bluez stack connectivity"
1020 a20a6f46 Juan Quintela
echo "  --enable-bluez           enable bluez stack connectivity"
1021 6093d3d4 Peter Maydell
echo "  --disable-slirp          disable SLIRP userspace network connectivity"
1022 7ba1e619 aliguori
echo "  --disable-kvm            disable KVM acceleration support"
1023 b31a0277 Juan Quintela
echo "  --enable-kvm             enable KVM acceleration support"
1024 9195b2c2 Stefan Weil
echo "  --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
1025 bd0c5661 pbrook
echo "  --disable-nptl           disable usermode NPTL support"
1026 e5934d33 Andre Przywara
echo "  --enable-nptl            enable usermode NPTL support"
1027 af5db58e pbrook
echo "  --enable-system          enable all system emulation targets"
1028 af5db58e pbrook
echo "  --disable-system         disable all system emulation targets"
1029 0953a80f Zachary Amsden
echo "  --enable-user            enable supported user emulation targets"
1030 0953a80f Zachary Amsden
echo "  --disable-user           disable all user emulation targets"
1031 831b7825 ths
echo "  --enable-linux-user      enable all linux usermode emulation targets"
1032 831b7825 ths
echo "  --disable-linux-user     disable all linux usermode emulation targets"
1033 831b7825 ths
echo "  --enable-darwin-user     enable all darwin usermode emulation targets"
1034 831b7825 ths
echo "  --disable-darwin-user    disable all darwin usermode emulation targets"
1035 84778508 blueswir1
echo "  --enable-bsd-user        enable all BSD usermode emulation targets"
1036 84778508 blueswir1
echo "  --disable-bsd-user       disable all BSD usermode emulation targets"
1037 379f6698 Paul Brook
echo "  --enable-guest-base      enable GUEST_BASE support for usermode"
1038 379f6698 Paul Brook
echo "                           emulation targets"
1039 379f6698 Paul Brook
echo "  --disable-guest-base     disable GUEST_BASE support"
1040 40d6444e Avi Kivity
echo "  --enable-pie             build Position Independent Executables"
1041 40d6444e Avi Kivity
echo "  --disable-pie            do not build Position Independent Executables"
1042 af5db58e pbrook
echo "  --fmod-lib               path to FMOD library"
1043 af5db58e pbrook
echo "  --fmod-inc               path to FMOD includes"
1044 2f6a1ab0 blueswir1
echo "  --oss-lib                path to OSS library"
1045 c5937220 pbrook
echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
1046 235e510c 陳韋任
echo "  --cpu=CPU                Build for host CPU [$cpu]"
1047 3142255c blueswir1
echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
1048 ee682d27 Stefan Weil
echo "  --disable-uuid           disable uuid support"
1049 ee682d27 Stefan Weil
echo "  --enable-uuid            enable uuid support"
1050 e0e6c8c0 aliguori
echo "  --disable-vde            disable support for vde network"
1051 dfb278bd Juan Quintela
echo "  --enable-vde             enable support for vde network"
1052 5c6c3a6c Christoph Hellwig
echo "  --disable-linux-aio      disable Linux AIO support"
1053 5c6c3a6c Christoph Hellwig
echo "  --enable-linux-aio       enable Linux AIO support"
1054 758e8e38 Venkateswararao Jujjuri (JV)
echo "  --disable-attr           disables attr and xattr support"
1055 758e8e38 Venkateswararao Jujjuri (JV)
echo "  --enable-attr            enable attr and xattr support"
1056 77755340 ths
echo "  --disable-blobs          disable installing provided firmware blobs"
1057 d2807bc9 Dirk Ullrich
echo "  --enable-docs            enable documentation build"
1058 d2807bc9 Dirk Ullrich
echo "  --disable-docs           disable documentation build"
1059 d5970055 Michael S. Tsirkin
echo "  --disable-vhost-net      disable vhost-net acceleration support"
1060 d5970055 Michael S. Tsirkin
echo "  --enable-vhost-net       enable vhost-net acceleration support"
1061 320fba2a Fabien Chouteau
echo "  --enable-trace-backend=B Set trace backend"
1062 320fba2a Fabien Chouteau
echo "                           Available backends:" $("$source_path"/scripts/tracetool --list-backends)
1063 74242e0f Paolo Bonzini
echo "  --with-trace-file=NAME   Full PATH,NAME of file to store traces"
1064 9410b56c Prerna Saxena
echo "                           Default:trace-<pid>"
1065 cd4ec0b4 Gerd Hoffmann
echo "  --disable-spice          disable spice"
1066 cd4ec0b4 Gerd Hoffmann
echo "  --enable-spice           enable spice"
1067 f27aaf4b Christian Brunner
echo "  --enable-rbd             enable building the rados block device (rbd)"
1068 c589b249 Ronnie Sahlberg
echo "  --disable-libiscsi       disable iscsi support"
1069 c589b249 Ronnie Sahlberg
echo "  --enable-libiscsi        enable iscsi support"
1070 36707144 Alon Levy
echo "  --disable-smartcard      disable smartcard support"
1071 36707144 Alon Levy
echo "  --enable-smartcard       enable smartcard support"
1072 111a38b0 Robert Relyea
echo "  --disable-smartcard-nss  disable smartcard nss support"
1073 111a38b0 Robert Relyea
echo "  --enable-smartcard-nss   enable smartcard nss support"
1074 69354a83 Hans de Goede
echo "  --disable-usb-redir      disable usb network redirection support"
1075 69354a83 Hans de Goede
echo "  --enable-usb-redir       enable usb network redirection support"
1076 d138cee9 Michael Roth
echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
1077 d138cee9 Michael Roth
echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
1078 af5db58e pbrook
echo ""
1079 5bf08934 ths
echo "NOTE: The object files are built at the place where configure is launched"
1080 af5db58e pbrook
exit 1
1081 af5db58e pbrook
fi
1082 af5db58e pbrook
1083 8d05095c Paolo Bonzini
# check that the C compiler works.
1084 8d05095c Paolo Bonzini
cat > $TMPC <<EOF
1085 8d05095c Paolo Bonzini
int main(void) {}
1086 8d05095c Paolo Bonzini
EOF
1087 8d05095c Paolo Bonzini
1088 8d05095c Paolo Bonzini
if compile_object ; then
1089 8d05095c Paolo Bonzini
  : C compiler works ok
1090 8d05095c Paolo Bonzini
else
1091 8d05095c Paolo Bonzini
    echo "ERROR: \"$cc\" either does not exist or does not work"
1092 8d05095c Paolo Bonzini
    exit 1
1093 8d05095c Paolo Bonzini
fi
1094 8d05095c Paolo Bonzini
1095 8d05095c Paolo Bonzini
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
1096 8d05095c Paolo Bonzini
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
1097 8d05095c Paolo Bonzini
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
1098 f9188227 Mike Frysinger
gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
1099 8d05095c Paolo Bonzini
cat > $TMPC << EOF
1100 8d05095c Paolo Bonzini
int main(void) { return 0; }
1101 8d05095c Paolo Bonzini
EOF
1102 8d05095c Paolo Bonzini
for flag in $gcc_flags; do
1103 af2d37de Stefan Weil
    if compile_prog "$flag -Werror" "" ; then
1104 8d05095c Paolo Bonzini
	QEMU_CFLAGS="$QEMU_CFLAGS $flag"
1105 8d05095c Paolo Bonzini
    fi
1106 8d05095c Paolo Bonzini
done
1107 8d05095c Paolo Bonzini
1108 40d6444e Avi Kivity
if test "$static" = "yes" ; then
1109 40d6444e Avi Kivity
  if test "$pie" = "yes" ; then
1110 40d6444e Avi Kivity
    echo "static and pie are mutually incompatible"
1111 40d6444e Avi Kivity
    exit 1
1112 40d6444e Avi Kivity
  else
1113 40d6444e Avi Kivity
    pie="no"
1114 40d6444e Avi Kivity
  fi
1115 40d6444e Avi Kivity
fi
1116 40d6444e Avi Kivity
1117 40d6444e Avi Kivity
if test "$pie" = ""; then
1118 40d6444e Avi Kivity
  case "$cpu-$targetos" in
1119 40d6444e Avi Kivity
    i386-Linux|x86_64-Linux)
1120 40d6444e Avi Kivity
      ;;
1121 40d6444e Avi Kivity
    *)
1122 40d6444e Avi Kivity
      pie="no"
1123 40d6444e Avi Kivity
      ;;
1124 40d6444e Avi Kivity
  esac
1125 40d6444e Avi Kivity
fi
1126 40d6444e Avi Kivity
1127 40d6444e Avi Kivity
if test "$pie" != "no" ; then
1128 40d6444e Avi Kivity
  cat > $TMPC << EOF
1129 21d4a791 Avi Kivity
1130 21d4a791 Avi Kivity
#ifdef __linux__
1131 21d4a791 Avi Kivity
#  define THREAD __thread
1132 21d4a791 Avi Kivity
#else
1133 21d4a791 Avi Kivity
#  define THREAD
1134 21d4a791 Avi Kivity
#endif
1135 21d4a791 Avi Kivity
1136 21d4a791 Avi Kivity
static THREAD int tls_var;
1137 21d4a791 Avi Kivity
1138 21d4a791 Avi Kivity
int main(void) { return tls_var; }
1139 21d4a791 Avi Kivity
1140 40d6444e Avi Kivity
EOF
1141 40d6444e Avi Kivity
  if compile_prog "-fPIE -DPIE" "-pie"; then
1142 40d6444e Avi Kivity
    QEMU_CFLAGS="-fPIE -DPIE $QEMU_CFLAGS"
1143 40d6444e Avi Kivity
    LDFLAGS="-pie $LDFLAGS"
1144 40d6444e Avi Kivity
    pie="yes"
1145 40d6444e Avi Kivity
    if compile_prog "" "-Wl,-z,relro -Wl,-z,now" ; then
1146 40d6444e Avi Kivity
      LDFLAGS="-Wl,-z,relro -Wl,-z,now $LDFLAGS"
1147 40d6444e Avi Kivity
    fi
1148 40d6444e Avi Kivity
  else
1149 40d6444e Avi Kivity
    if test "$pie" = "yes"; then
1150 40d6444e Avi Kivity
      echo "PIE not available due to missing toolchain support"
1151 40d6444e Avi Kivity
      exit 1
1152 40d6444e Avi Kivity
    else
1153 40d6444e Avi Kivity
      echo "Disabling PIE due to missing toolchain support"
1154 40d6444e Avi Kivity
      pie="no"
1155 40d6444e Avi Kivity
    fi
1156 40d6444e Avi Kivity
  fi
1157 40d6444e Avi Kivity
fi
1158 40d6444e Avi Kivity
1159 ec530c81 bellard
#
1160 ec530c81 bellard
# Solaris specific configure tool chain decisions
1161 ec530c81 bellard
#
1162 ec530c81 bellard
if test "$solaris" = "yes" ; then
1163 6792aa11 Loïc Minier
  if has $install; then
1164 6792aa11 Loïc Minier
    :
1165 6792aa11 Loïc Minier
  else
1166 ec530c81 bellard
    echo "Solaris install program not found. Use --install=/usr/ucb/install or"
1167 ec530c81 bellard
    echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
1168 ec530c81 bellard
    echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
1169 ec530c81 bellard
    exit 1
1170 ec530c81 bellard
  fi
1171 6792aa11 Loïc Minier
  if test "`path_of $install`" = "/usr/sbin/install" ; then
1172 ec530c81 bellard
    echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
1173 ec530c81 bellard
    echo "try ginstall from the GNU fileutils available from www.blastwave.org"
1174 ec530c81 bellard
    echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
1175 ec530c81 bellard
    exit 1
1176 ec530c81 bellard
  fi
1177 6792aa11 Loïc Minier
  if has ar; then
1178 6792aa11 Loïc Minier
    :
1179 6792aa11 Loïc Minier
  else
1180 ec530c81 bellard
    echo "Error: No path includes ar"
1181 ec530c81 bellard
    if test -f /usr/ccs/bin/ar ; then
1182 ec530c81 bellard
      echo "Add /usr/ccs/bin to your path and rerun configure"
1183 ec530c81 bellard
    fi
1184 ec530c81 bellard
    exit 1
1185 ec530c81 bellard
  fi
1186 5fafdf24 ths
fi
1187 ec530c81 bellard
1188 d138cee9 Michael Roth
if test "$guest_agent" != "no" ; then
1189 d138cee9 Michael Roth
  if has $python; then
1190 d138cee9 Michael Roth
    :
1191 d138cee9 Michael Roth
  else
1192 d138cee9 Michael Roth
    echo "Python not found. Use --python=/path/to/python"
1193 d138cee9 Michael Roth
    exit 1
1194 d138cee9 Michael Roth
  fi
1195 c886edfb Blue Swirl
fi
1196 c886edfb Blue Swirl
1197 5327cf48 bellard
if test -z "$target_list" ; then
1198 60e0df25 Peter Maydell
    target_list="$default_target_list"
1199 6e20a45f bellard
else
1200 b1a550a0 pbrook
    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
1201 5327cf48 bellard
fi
1202 0a8e90f4 pbrook
if test -z "$target_list" ; then
1203 0a8e90f4 pbrook
    echo "No targets enabled"
1204 0a8e90f4 pbrook
    exit 1
1205 0a8e90f4 pbrook
fi
1206 f55fe278 Paolo Bonzini
# see if system emulation was really requested
1207 f55fe278 Paolo Bonzini
case " $target_list " in
1208 f55fe278 Paolo Bonzini
  *"-softmmu "*) softmmu=yes
1209 f55fe278 Paolo Bonzini
  ;;
1210 f55fe278 Paolo Bonzini
  *) softmmu=no
1211 f55fe278 Paolo Bonzini
  ;;
1212 f55fe278 Paolo Bonzini
esac
1213 5327cf48 bellard
1214 249247c9 Juan Quintela
feature_not_found() {
1215 249247c9 Juan Quintela
  feature=$1
1216 249247c9 Juan Quintela
1217 249247c9 Juan Quintela
  echo "ERROR"
1218 249247c9 Juan Quintela
  echo "ERROR: User requested feature $feature"
1219 9332f6a2 Sebastian Herbszt
  echo "ERROR: configure was not able to find it"
1220 249247c9 Juan Quintela
  echo "ERROR"
1221 249247c9 Juan Quintela
  exit 1;
1222 249247c9 Juan Quintela
}
1223 249247c9 Juan Quintela
1224 7d13299d bellard
if test -z "$cross_prefix" ; then
1225 7d13299d bellard
1226 7d13299d bellard
# ---
1227 7d13299d bellard
# big/little endian test
1228 7d13299d bellard
cat > $TMPC << EOF
1229 7d13299d bellard
#include <inttypes.h>
1230 7d13299d bellard
int main(int argc, char ** argv){
1231 1d14ffa9 bellard
        volatile uint32_t i=0x01234567;
1232 1d14ffa9 bellard
        return (*((uint8_t*)(&i))) == 0x67;
1233 7d13299d bellard
}
1234 7d13299d bellard
EOF
1235 7d13299d bellard
1236 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1237 7d13299d bellard
$TMPE && bigendian="yes"
1238 7d13299d bellard
else
1239 7d13299d bellard
echo big/little test failed
1240 7d13299d bellard
fi
1241 7d13299d bellard
1242 7d13299d bellard
else
1243 7d13299d bellard
1244 7d13299d bellard
# if cross compiling, cannot launch a program, so make a static guess
1245 ea8f20f8 Juan Quintela
case "$cpu" in
1246 21d89f84 Peter Maydell
  arm)
1247 21d89f84 Peter Maydell
    # ARM can be either way; ask the compiler which one we are
1248 21d89f84 Peter Maydell
    if check_define __ARMEB__; then
1249 21d89f84 Peter Maydell
      bigendian=yes
1250 21d89f84 Peter Maydell
    fi
1251 21d89f84 Peter Maydell
  ;;
1252 21d89f84 Peter Maydell
  hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
1253 ea8f20f8 Juan Quintela
    bigendian=yes
1254 ea8f20f8 Juan Quintela
  ;;
1255 ea8f20f8 Juan Quintela
esac
1256 7d13299d bellard
1257 7d13299d bellard
fi
1258 7d13299d bellard
1259 70be1a2e Paolo Bonzini
# host long bits test, actually a pointer size test
1260 70be1a2e Paolo Bonzini
cat > $TMPC << EOF
1261 70be1a2e Paolo Bonzini
int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1];
1262 70be1a2e Paolo Bonzini
EOF
1263 70be1a2e Paolo Bonzini
if compile_object; then
1264 70be1a2e Paolo Bonzini
hostlongbits=64
1265 70be1a2e Paolo Bonzini
else
1266 70be1a2e Paolo Bonzini
hostlongbits=32
1267 70be1a2e Paolo Bonzini
fi
1268 b6853697 bellard
1269 b0a47e79 Juan Quintela
1270 b0a47e79 Juan Quintela
##########################################
1271 b0a47e79 Juan Quintela
# NPTL probe
1272 b0a47e79 Juan Quintela
1273 b0a47e79 Juan Quintela
if test "$nptl" != "no" ; then
1274 b0a47e79 Juan Quintela
  cat > $TMPC <<EOF
1275 bd0c5661 pbrook
#include <sched.h>
1276 30813cea pbrook
#include <linux/futex.h>
1277 bd0c5661 pbrook
void foo()
1278 bd0c5661 pbrook
{
1279 bd0c5661 pbrook
#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
1280 bd0c5661 pbrook
#error bork
1281 bd0c5661 pbrook
#endif
1282 bd0c5661 pbrook
}
1283 bd0c5661 pbrook
EOF
1284 bd0c5661 pbrook
1285 b0a47e79 Juan Quintela
  if compile_object ; then
1286 b0a47e79 Juan Quintela
    nptl=yes
1287 b0a47e79 Juan Quintela
  else
1288 b0a47e79 Juan Quintela
    if test "$nptl" = "yes" ; then
1289 b0a47e79 Juan Quintela
      feature_not_found "nptl"
1290 b0a47e79 Juan Quintela
    fi
1291 b0a47e79 Juan Quintela
    nptl=no
1292 b0a47e79 Juan Quintela
  fi
1293 bd0c5661 pbrook
fi
1294 bd0c5661 pbrook
1295 11d9f695 bellard
##########################################
1296 ac62922e balrog
# zlib check
1297 ac62922e balrog
1298 1ece9905 Alon Levy
if test "$zlib" != "no" ; then
1299 1ece9905 Alon Levy
    cat > $TMPC << EOF
1300 ac62922e balrog
#include <zlib.h>
1301 ac62922e balrog
int main(void) { zlibVersion(); return 0; }
1302 ac62922e balrog
EOF
1303 1ece9905 Alon Levy
    if compile_prog "" "-lz" ; then
1304 1ece9905 Alon Levy
        :
1305 1ece9905 Alon Levy
    else
1306 1ece9905 Alon Levy
        echo
1307 1ece9905 Alon Levy
        echo "Error: zlib check failed"
1308 1ece9905 Alon Levy
        echo "Make sure to have the zlib libs and headers installed."
1309 1ece9905 Alon Levy
        echo
1310 1ece9905 Alon Levy
        exit 1
1311 1ece9905 Alon Levy
    fi
1312 ac62922e balrog
fi
1313 ac62922e balrog
1314 ac62922e balrog
##########################################
1315 e37630ca aliguori
# xen probe
1316 e37630ca aliguori
1317 fc321b4b Juan Quintela
if test "$xen" != "no" ; then
1318 b2266bee Juan Quintela
  xen_libs="-lxenstore -lxenctrl -lxenguest"
1319 d5b93ddf Anthony PERARD
1320 d5b93ddf Anthony PERARD
  # Xen unstable
1321 b2266bee Juan Quintela
  cat > $TMPC <<EOF
1322 e37630ca aliguori
#include <xenctrl.h>
1323 e37630ca aliguori
#include <xs.h>
1324 d5b93ddf Anthony PERARD
#include <stdint.h>
1325 d5b93ddf Anthony PERARD
#include <xen/hvm/hvm_info_table.h>
1326 d5b93ddf Anthony PERARD
#if !defined(HVM_MAX_VCPUS)
1327 d5b93ddf Anthony PERARD
# error HVM_MAX_VCPUS not defined
1328 d5b93ddf Anthony PERARD
#endif
1329 d5b93ddf Anthony PERARD
int main(void) {
1330 d5b93ddf Anthony PERARD
  xc_interface *xc;
1331 d5b93ddf Anthony PERARD
  xs_daemon_open();
1332 d5b93ddf Anthony PERARD
  xc = xc_interface_open(0, 0, 0);
1333 d5b93ddf Anthony PERARD
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1334 d5b93ddf Anthony PERARD
  xc_gnttab_open(NULL, 0);
1335 b87de24e Anthony PERARD
  xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
1336 d5b93ddf Anthony PERARD
  return 0;
1337 d5b93ddf Anthony PERARD
}
1338 e37630ca aliguori
EOF
1339 52166aa0 Juan Quintela
  if compile_prog "" "$xen_libs" ; then
1340 d5b93ddf Anthony PERARD
    xen_ctrl_version=410
1341 fc321b4b Juan Quintela
    xen=yes
1342 d5b93ddf Anthony PERARD
1343 d5b93ddf Anthony PERARD
  # Xen 4.0.0
1344 d5b93ddf Anthony PERARD
  elif (
1345 d5b93ddf Anthony PERARD
      cat > $TMPC <<EOF
1346 d5b93ddf Anthony PERARD
#include <xenctrl.h>
1347 d5b93ddf Anthony PERARD
#include <xs.h>
1348 d5b93ddf Anthony PERARD
#include <stdint.h>
1349 d5b93ddf Anthony PERARD
#include <xen/hvm/hvm_info_table.h>
1350 d5b93ddf Anthony PERARD
#if !defined(HVM_MAX_VCPUS)
1351 d5b93ddf Anthony PERARD
# error HVM_MAX_VCPUS not defined
1352 d5b93ddf Anthony PERARD
#endif
1353 d5b93ddf Anthony PERARD
int main(void) {
1354 b87de24e Anthony PERARD
  struct xen_add_to_physmap xatp = {
1355 b87de24e Anthony PERARD
    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
1356 b87de24e Anthony PERARD
  };
1357 d5b93ddf Anthony PERARD
  xs_daemon_open();
1358 d5b93ddf Anthony PERARD
  xc_interface_open();
1359 d5b93ddf Anthony PERARD
  xc_gnttab_open();
1360 d5b93ddf Anthony PERARD
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1361 b87de24e Anthony PERARD
  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
1362 d5b93ddf Anthony PERARD
  return 0;
1363 d5b93ddf Anthony PERARD
}
1364 d5b93ddf Anthony PERARD
EOF
1365 d5b93ddf Anthony PERARD
      compile_prog "" "$xen_libs"
1366 d5b93ddf Anthony PERARD
    ) ; then
1367 d5b93ddf Anthony PERARD
    xen_ctrl_version=400
1368 d5b93ddf Anthony PERARD
    xen=yes
1369 d5b93ddf Anthony PERARD
1370 b87de24e Anthony PERARD
  # Xen 3.4.0
1371 b87de24e Anthony PERARD
  elif (
1372 b87de24e Anthony PERARD
      cat > $TMPC <<EOF
1373 b87de24e Anthony PERARD
#include <xenctrl.h>
1374 b87de24e Anthony PERARD
#include <xs.h>
1375 b87de24e Anthony PERARD
int main(void) {
1376 b87de24e Anthony PERARD
  struct xen_add_to_physmap xatp = {
1377 b87de24e Anthony PERARD
    .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
1378 b87de24e Anthony PERARD
  };
1379 b87de24e Anthony PERARD
  xs_daemon_open();
1380 b87de24e Anthony PERARD
  xc_interface_open();
1381 b87de24e Anthony PERARD
  xc_gnttab_open();
1382 b87de24e Anthony PERARD
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1383 b87de24e Anthony PERARD
  xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
1384 b87de24e Anthony PERARD
  return 0;
1385 b87de24e Anthony PERARD
}
1386 b87de24e Anthony PERARD
EOF
1387 b87de24e Anthony PERARD
      compile_prog "" "$xen_libs"
1388 b87de24e Anthony PERARD
    ) ; then
1389 b87de24e Anthony PERARD
    xen_ctrl_version=340
1390 b87de24e Anthony PERARD
    xen=yes
1391 b87de24e Anthony PERARD
1392 b87de24e Anthony PERARD
  # Xen 3.3.0
1393 d5b93ddf Anthony PERARD
  elif (
1394 d5b93ddf Anthony PERARD
      cat > $TMPC <<EOF
1395 d5b93ddf Anthony PERARD
#include <xenctrl.h>
1396 d5b93ddf Anthony PERARD
#include <xs.h>
1397 d5b93ddf Anthony PERARD
int main(void) {
1398 d5b93ddf Anthony PERARD
  xs_daemon_open();
1399 d5b93ddf Anthony PERARD
  xc_interface_open();
1400 d5b93ddf Anthony PERARD
  xc_gnttab_open();
1401 d5b93ddf Anthony PERARD
  xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
1402 d5b93ddf Anthony PERARD
  return 0;
1403 d5b93ddf Anthony PERARD
}
1404 d5b93ddf Anthony PERARD
EOF
1405 d5b93ddf Anthony PERARD
      compile_prog "" "$xen_libs"
1406 d5b93ddf Anthony PERARD
    ) ; then
1407 d5b93ddf Anthony PERARD
    xen_ctrl_version=330
1408 d5b93ddf Anthony PERARD
    xen=yes
1409 d5b93ddf Anthony PERARD
1410 d5b93ddf Anthony PERARD
  # Xen not found or unsupported
1411 b2266bee Juan Quintela
  else
1412 fc321b4b Juan Quintela
    if test "$xen" = "yes" ; then
1413 fc321b4b Juan Quintela
      feature_not_found "xen"
1414 fc321b4b Juan Quintela
    fi
1415 fc321b4b Juan Quintela
    xen=no
1416 b2266bee Juan Quintela
  fi
1417 d5b93ddf Anthony PERARD
1418 d5b93ddf Anthony PERARD
  if test "$xen" = yes; then
1419 d5b93ddf Anthony PERARD
    libs_softmmu="$xen_libs $libs_softmmu"
1420 d5b93ddf Anthony PERARD
  fi
1421 e37630ca aliguori
fi
1422 e37630ca aliguori
1423 e37630ca aliguori
##########################################
1424 a8bd70ad Paolo Bonzini
# pkg-config probe
1425 f91672e5 Paolo Bonzini
1426 a8bd70ad Paolo Bonzini
if ! has $pkg_config; then
1427 a213fcb2 Peter Maydell
  echo "Error: pkg-config binary '$pkg_config' not found"
1428 a213fcb2 Peter Maydell
  exit 1
1429 f91672e5 Paolo Bonzini
fi
1430 f91672e5 Paolo Bonzini
1431 f91672e5 Paolo Bonzini
##########################################
1432 44dc0ca3 Alon Levy
# libtool probe
1433 44dc0ca3 Alon Levy
1434 3f534581 Brad
if ! has $libtool; then
1435 44dc0ca3 Alon Levy
    libtool=
1436 44dc0ca3 Alon Levy
fi
1437 44dc0ca3 Alon Levy
1438 44dc0ca3 Alon Levy
##########################################
1439 dfffc653 Juan Quintela
# Sparse probe
1440 dfffc653 Juan Quintela
if test "$sparse" != "no" ; then
1441 0dba6195 Loïc Minier
  if has cgcc; then
1442 dfffc653 Juan Quintela
    sparse=yes
1443 dfffc653 Juan Quintela
  else
1444 dfffc653 Juan Quintela
    if test "$sparse" = "yes" ; then
1445 dfffc653 Juan Quintela
      feature_not_found "sparse"
1446 dfffc653 Juan Quintela
    fi
1447 dfffc653 Juan Quintela
    sparse=no
1448 dfffc653 Juan Quintela
  fi
1449 dfffc653 Juan Quintela
fi
1450 dfffc653 Juan Quintela
1451 dfffc653 Juan Quintela
##########################################
1452 11d9f695 bellard
# SDL probe
1453 11d9f695 bellard
1454 3ec87ffe Paolo Bonzini
# Look for sdl configuration program (pkg-config or sdl-config).  Try
1455 3ec87ffe Paolo Bonzini
# sdl-config even without cross prefix, and favour pkg-config over sdl-config.
1456 3ec87ffe Paolo Bonzini
if test "`basename $sdl_config`" != sdl-config && ! has ${sdl_config}; then
1457 3ec87ffe Paolo Bonzini
  sdl_config=sdl-config
1458 3ec87ffe Paolo Bonzini
fi
1459 3ec87ffe Paolo Bonzini
1460 3ec87ffe Paolo Bonzini
if $pkg_config sdl --modversion >/dev/null 2>&1; then
1461 a8bd70ad Paolo Bonzini
  sdlconfig="$pkg_config sdl"
1462 9316f803 Paolo Bonzini
  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1463 3ec87ffe Paolo Bonzini
elif has ${sdl_config}; then
1464 3ec87ffe Paolo Bonzini
  sdlconfig="$sdl_config"
1465 9316f803 Paolo Bonzini
  _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
1466 a0dfd8a4 Loïc Minier
else
1467 a0dfd8a4 Loïc Minier
  if test "$sdl" = "yes" ; then
1468 a0dfd8a4 Loïc Minier
    feature_not_found "sdl"
1469 a0dfd8a4 Loïc Minier
  fi
1470 a0dfd8a4 Loïc Minier
  sdl=no
1471 9316f803 Paolo Bonzini
fi
1472 29e5bada Scott Wood
if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
1473 3ec87ffe Paolo Bonzini
  echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
1474 3ec87ffe Paolo Bonzini
fi
1475 11d9f695 bellard
1476 9316f803 Paolo Bonzini
sdl_too_old=no
1477 c4198157 Juan Quintela
if test "$sdl" != "no" ; then
1478 ac119f9d Juan Quintela
  cat > $TMPC << EOF
1479 11d9f695 bellard
#include <SDL.h>
1480 11d9f695 bellard
#undef main /* We don't want SDL to override our main() */
1481 11d9f695 bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1482 11d9f695 bellard
EOF
1483 9316f803 Paolo Bonzini
  sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
1484 74f42e18 TeLeMan
  if test "$static" = "yes" ; then
1485 74f42e18 TeLeMan
    sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
1486 74f42e18 TeLeMan
  else
1487 74f42e18 TeLeMan
    sdl_libs=`$sdlconfig --libs 2> /dev/null`
1488 74f42e18 TeLeMan
  fi
1489 52166aa0 Juan Quintela
  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1490 ac119f9d Juan Quintela
    if test "$_sdlversion" -lt 121 ; then
1491 ac119f9d Juan Quintela
      sdl_too_old=yes
1492 ac119f9d Juan Quintela
    else
1493 ac119f9d Juan Quintela
      if test "$cocoa" = "no" ; then
1494 ac119f9d Juan Quintela
        sdl=yes
1495 ac119f9d Juan Quintela
      fi
1496 ac119f9d Juan Quintela
    fi
1497 cd01b4a3 aliguori
1498 67c274d3 Paolo Bonzini
    # static link with sdl ? (note: sdl.pc's --static --libs is broken)
1499 ac119f9d Juan Quintela
    if test "$sdl" = "yes" -a "$static" = "yes" ; then
1500 67c274d3 Paolo Bonzini
      if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then
1501 f8aa6c7b Stefan Weil
         sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
1502 f8aa6c7b Stefan Weil
         sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
1503 ac119f9d Juan Quintela
      fi
1504 52166aa0 Juan Quintela
      if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1505 ac119f9d Juan Quintela
	:
1506 ac119f9d Juan Quintela
      else
1507 ac119f9d Juan Quintela
        sdl=no
1508 ac119f9d Juan Quintela
      fi
1509 ac119f9d Juan Quintela
    fi # static link
1510 c4198157 Juan Quintela
  else # sdl not found
1511 c4198157 Juan Quintela
    if test "$sdl" = "yes" ; then
1512 c4198157 Juan Quintela
      feature_not_found "sdl"
1513 c4198157 Juan Quintela
    fi
1514 c4198157 Juan Quintela
    sdl=no
1515 ac119f9d Juan Quintela
  fi # sdl compile test
1516 a68551bc Juan Quintela
fi
1517 11d9f695 bellard
1518 5368a422 aliguori
if test "$sdl" = "yes" ; then
1519 ac119f9d Juan Quintela
  cat > $TMPC <<EOF
1520 5368a422 aliguori
#include <SDL.h>
1521 5368a422 aliguori
#if defined(SDL_VIDEO_DRIVER_X11)
1522 5368a422 aliguori
#include <X11/XKBlib.h>
1523 5368a422 aliguori
#else
1524 5368a422 aliguori
#error No x11 support
1525 5368a422 aliguori
#endif
1526 5368a422 aliguori
int main(void) { return 0; }
1527 5368a422 aliguori
EOF
1528 52166aa0 Juan Quintela
  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1529 ac119f9d Juan Quintela
    sdl_libs="$sdl_libs -lX11"
1530 ac119f9d Juan Quintela
  fi
1531 07d9ac44 Juan Quintela
  if test "$mingw32" = "yes" ; then
1532 07d9ac44 Juan Quintela
    sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole"
1533 07d9ac44 Juan Quintela
  fi
1534 0705667e Juan Quintela
  libs_softmmu="$sdl_libs $libs_softmmu"
1535 5368a422 aliguori
fi
1536 5368a422 aliguori
1537 8f28f3fb ths
##########################################
1538 8d5d2d4c ths
# VNC TLS detection
1539 821601ea Jes Sorensen
if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then
1540 1be10ad2 Juan Quintela
  cat > $TMPC <<EOF
1541 ae6b5e5a aliguori
#include <gnutls/gnutls.h>
1542 ae6b5e5a aliguori
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1543 ae6b5e5a aliguori
EOF
1544 a8bd70ad Paolo Bonzini
  vnc_tls_cflags=`$pkg_config --cflags gnutls 2> /dev/null`
1545 a8bd70ad Paolo Bonzini
  vnc_tls_libs=`$pkg_config --libs gnutls 2> /dev/null`
1546 1be10ad2 Juan Quintela
  if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then
1547 1be10ad2 Juan Quintela
    vnc_tls=yes
1548 1be10ad2 Juan Quintela
    libs_softmmu="$vnc_tls_libs $libs_softmmu"
1549 1be10ad2 Juan Quintela
  else
1550 1be10ad2 Juan Quintela
    if test "$vnc_tls" = "yes" ; then
1551 1be10ad2 Juan Quintela
      feature_not_found "vnc-tls"
1552 ae6b5e5a aliguori
    fi
1553 1be10ad2 Juan Quintela
    vnc_tls=no
1554 1be10ad2 Juan Quintela
  fi
1555 8d5d2d4c ths
fi
1556 8d5d2d4c ths
1557 8d5d2d4c ths
##########################################
1558 2f9606b3 aliguori
# VNC SASL detection
1559 821601ea Jes Sorensen
if test "$vnc" = "yes" -a "$vnc_sasl" != "no" ; then
1560 ea784e3b Juan Quintela
  cat > $TMPC <<EOF
1561 2f9606b3 aliguori
#include <sasl/sasl.h>
1562 2f9606b3 aliguori
#include <stdio.h>
1563 2f9606b3 aliguori
int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
1564 2f9606b3 aliguori
EOF
1565 ea784e3b Juan Quintela
  # Assuming Cyrus-SASL installed in /usr prefix
1566 ea784e3b Juan Quintela
  vnc_sasl_cflags=""
1567 ea784e3b Juan Quintela
  vnc_sasl_libs="-lsasl2"
1568 ea784e3b Juan Quintela
  if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
1569 ea784e3b Juan Quintela
    vnc_sasl=yes
1570 ea784e3b Juan Quintela
    libs_softmmu="$vnc_sasl_libs $libs_softmmu"
1571 ea784e3b Juan Quintela
  else
1572 ea784e3b Juan Quintela
    if test "$vnc_sasl" = "yes" ; then
1573 ea784e3b Juan Quintela
      feature_not_found "vnc-sasl"
1574 2f9606b3 aliguori
    fi
1575 ea784e3b Juan Quintela
    vnc_sasl=no
1576 ea784e3b Juan Quintela
  fi
1577 2f9606b3 aliguori
fi
1578 2f9606b3 aliguori
1579 2f9606b3 aliguori
##########################################
1580 2f6f5c7a Corentin Chary
# VNC JPEG detection
1581 821601ea Jes Sorensen
if test "$vnc" = "yes" -a "$vnc_jpeg" != "no" ; then
1582 2f6f5c7a Corentin Chary
cat > $TMPC <<EOF
1583 2f6f5c7a Corentin Chary
#include <stdio.h>
1584 2f6f5c7a Corentin Chary
#include <jpeglib.h>
1585 2f6f5c7a Corentin Chary
int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); return 0; }
1586 2f6f5c7a Corentin Chary
EOF
1587 2f6f5c7a Corentin Chary
    vnc_jpeg_cflags=""
1588 2f6f5c7a Corentin Chary
    vnc_jpeg_libs="-ljpeg"
1589 2f6f5c7a Corentin Chary
  if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then
1590 2f6f5c7a Corentin Chary
    vnc_jpeg=yes
1591 2f6f5c7a Corentin Chary
    libs_softmmu="$vnc_jpeg_libs $libs_softmmu"
1592 2f6f5c7a Corentin Chary
  else
1593 2f6f5c7a Corentin Chary
    if test "$vnc_jpeg" = "yes" ; then
1594 2f6f5c7a Corentin Chary
      feature_not_found "vnc-jpeg"
1595 2f6f5c7a Corentin Chary
    fi
1596 2f6f5c7a Corentin Chary
    vnc_jpeg=no
1597 2f6f5c7a Corentin Chary
  fi
1598 2f6f5c7a Corentin Chary
fi
1599 2f6f5c7a Corentin Chary
1600 2f6f5c7a Corentin Chary
##########################################
1601 efe556ad Corentin Chary
# VNC PNG detection
1602 821601ea Jes Sorensen
if test "$vnc" = "yes" -a "$vnc_png" != "no" ; then
1603 efe556ad Corentin Chary
cat > $TMPC <<EOF
1604 efe556ad Corentin Chary
//#include <stdio.h>
1605 efe556ad Corentin Chary
#include <png.h>
1606 832ce9c2 Scott Wood
#include <stddef.h>
1607 efe556ad Corentin Chary
int main(void) {
1608 efe556ad Corentin Chary
    png_structp png_ptr;
1609 efe556ad Corentin Chary
    png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
1610 efe556ad Corentin Chary
    return 0;
1611 efe556ad Corentin Chary
}
1612 efe556ad Corentin Chary
EOF
1613 9af8025e Brad
  if $pkg_config libpng --modversion >/dev/null 2>&1; then
1614 9af8025e Brad
    vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null`
1615 9af8025e Brad
    vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null`
1616 9af8025e Brad
  else
1617 efe556ad Corentin Chary
    vnc_png_cflags=""
1618 efe556ad Corentin Chary
    vnc_png_libs="-lpng"
1619 9af8025e Brad
  fi
1620 efe556ad Corentin Chary
  if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then
1621 efe556ad Corentin Chary
    vnc_png=yes
1622 efe556ad Corentin Chary
    libs_softmmu="$vnc_png_libs $libs_softmmu"
1623 9af8025e Brad
    QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags"
1624 efe556ad Corentin Chary
  else
1625 efe556ad Corentin Chary
    if test "$vnc_png" = "yes" ; then
1626 efe556ad Corentin Chary
      feature_not_found "vnc-png"
1627 efe556ad Corentin Chary
    fi
1628 efe556ad Corentin Chary
    vnc_png=no
1629 efe556ad Corentin Chary
  fi
1630 efe556ad Corentin Chary
fi
1631 efe556ad Corentin Chary
1632 efe556ad Corentin Chary
##########################################
1633 76655d6d aliguori
# fnmatch() probe, used for ACL routines
1634 76655d6d aliguori
fnmatch="no"
1635 76655d6d aliguori
cat > $TMPC << EOF
1636 76655d6d aliguori
#include <fnmatch.h>
1637 76655d6d aliguori
int main(void)
1638 76655d6d aliguori
{
1639 76655d6d aliguori
    fnmatch("foo", "foo", 0);
1640 76655d6d aliguori
    return 0;
1641 76655d6d aliguori
}
1642 76655d6d aliguori
EOF
1643 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1644 76655d6d aliguori
   fnmatch="yes"
1645 76655d6d aliguori
fi
1646 76655d6d aliguori
1647 76655d6d aliguori
##########################################
1648 ee682d27 Stefan Weil
# uuid_generate() probe, used for vdi block driver
1649 ee682d27 Stefan Weil
if test "$uuid" != "no" ; then
1650 ee682d27 Stefan Weil
  uuid_libs="-luuid"
1651 ee682d27 Stefan Weil
  cat > $TMPC << EOF
1652 ee682d27 Stefan Weil
#include <uuid/uuid.h>
1653 ee682d27 Stefan Weil
int main(void)
1654 ee682d27 Stefan Weil
{
1655 ee682d27 Stefan Weil
    uuid_t my_uuid;
1656 ee682d27 Stefan Weil
    uuid_generate(my_uuid);
1657 ee682d27 Stefan Weil
    return 0;
1658 ee682d27 Stefan Weil
}
1659 ee682d27 Stefan Weil
EOF
1660 ee682d27 Stefan Weil
  if compile_prog "" "$uuid_libs" ; then
1661 ee682d27 Stefan Weil
    uuid="yes"
1662 ee682d27 Stefan Weil
    libs_softmmu="$uuid_libs $libs_softmmu"
1663 ee682d27 Stefan Weil
    libs_tools="$uuid_libs $libs_tools"
1664 ee682d27 Stefan Weil
  else
1665 ee682d27 Stefan Weil
    if test "$uuid" = "yes" ; then
1666 ee682d27 Stefan Weil
      feature_not_found "uuid"
1667 ee682d27 Stefan Weil
    fi
1668 ee682d27 Stefan Weil
    uuid=no
1669 ee682d27 Stefan Weil
  fi
1670 ee682d27 Stefan Weil
fi
1671 ee682d27 Stefan Weil
1672 ee682d27 Stefan Weil
##########################################
1673 dce512de Christoph Hellwig
# xfsctl() probe, used for raw-posix
1674 dce512de Christoph Hellwig
if test "$xfs" != "no" ; then
1675 dce512de Christoph Hellwig
  cat > $TMPC << EOF
1676 dce512de Christoph Hellwig
#include <xfs/xfs.h>
1677 dce512de Christoph Hellwig
int main(void)
1678 dce512de Christoph Hellwig
{
1679 dce512de Christoph Hellwig
    xfsctl(NULL, 0, 0, NULL);
1680 dce512de Christoph Hellwig
    return 0;
1681 dce512de Christoph Hellwig
}
1682 dce512de Christoph Hellwig
EOF
1683 dce512de Christoph Hellwig
  if compile_prog "" "" ; then
1684 dce512de Christoph Hellwig
    xfs="yes"
1685 dce512de Christoph Hellwig
  else
1686 dce512de Christoph Hellwig
    if test "$xfs" = "yes" ; then
1687 dce512de Christoph Hellwig
      feature_not_found "xfs"
1688 dce512de Christoph Hellwig
    fi
1689 dce512de Christoph Hellwig
    xfs=no
1690 dce512de Christoph Hellwig
  fi
1691 dce512de Christoph Hellwig
fi
1692 dce512de Christoph Hellwig
1693 dce512de Christoph Hellwig
##########################################
1694 8a16d273 ths
# vde libraries probe
1695 dfb278bd Juan Quintela
if test "$vde" != "no" ; then
1696 4baae0ac Juan Quintela
  vde_libs="-lvdeplug"
1697 8a16d273 ths
  cat > $TMPC << EOF
1698 8a16d273 ths
#include <libvdeplug.h>
1699 4a7f0e06 pbrook
int main(void)
1700 4a7f0e06 pbrook
{
1701 4a7f0e06 pbrook
    struct vde_open_args a = {0, 0, 0};
1702 4a7f0e06 pbrook
    vde_open("", "", &a);
1703 4a7f0e06 pbrook
    return 0;
1704 4a7f0e06 pbrook
}
1705 8a16d273 ths
EOF
1706 52166aa0 Juan Quintela
  if compile_prog "" "$vde_libs" ; then
1707 4baae0ac Juan Quintela
    vde=yes
1708 8e02e54c Juan Quintela
    libs_softmmu="$vde_libs $libs_softmmu"
1709 8e02e54c Juan Quintela
    libs_tools="$vde_libs $libs_tools"
1710 dfb278bd Juan Quintela
  else
1711 dfb278bd Juan Quintela
    if test "$vde" = "yes" ; then
1712 dfb278bd Juan Quintela
      feature_not_found "vde"
1713 dfb278bd Juan Quintela
    fi
1714 dfb278bd Juan Quintela
    vde=no
1715 4baae0ac Juan Quintela
  fi
1716 8a16d273 ths
fi
1717 8a16d273 ths
1718 8a16d273 ths
##########################################
1719 c2de5c91 malc
# Sound support libraries probe
1720 8f28f3fb ths
1721 c2de5c91 malc
audio_drv_probe()
1722 c2de5c91 malc
{
1723 c2de5c91 malc
    drv=$1
1724 c2de5c91 malc
    hdr=$2
1725 c2de5c91 malc
    lib=$3
1726 c2de5c91 malc
    exp=$4
1727 c2de5c91 malc
    cfl=$5
1728 c2de5c91 malc
        cat > $TMPC << EOF
1729 c2de5c91 malc
#include <$hdr>
1730 c2de5c91 malc
int main(void) { $exp }
1731 8f28f3fb ths
EOF
1732 52166aa0 Juan Quintela
    if compile_prog "$cfl" "$lib" ; then
1733 c2de5c91 malc
        :
1734 c2de5c91 malc
    else
1735 c2de5c91 malc
        echo
1736 c2de5c91 malc
        echo "Error: $drv check failed"
1737 c2de5c91 malc
        echo "Make sure to have the $drv libs and headers installed."
1738 c2de5c91 malc
        echo
1739 c2de5c91 malc
        exit 1
1740 c2de5c91 malc
    fi
1741 c2de5c91 malc
}
1742 c2de5c91 malc
1743 2fa7d3bf malc
audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1744 c2de5c91 malc
for drv in $audio_drv_list; do
1745 c2de5c91 malc
    case $drv in
1746 c2de5c91 malc
    alsa)
1747 c2de5c91 malc
    audio_drv_probe $drv alsa/asoundlib.h -lasound \
1748 c2de5c91 malc
        "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1749 a4bf6780 Juan Quintela
    libs_softmmu="-lasound $libs_softmmu"
1750 c2de5c91 malc
    ;;
1751 c2de5c91 malc
1752 c2de5c91 malc
    fmod)
1753 c2de5c91 malc
    if test -z $fmod_lib || test -z $fmod_inc; then
1754 c2de5c91 malc
        echo
1755 c2de5c91 malc
        echo "Error: You must specify path to FMOD library and headers"
1756 c2de5c91 malc
        echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1757 c2de5c91 malc
        echo
1758 c2de5c91 malc
        exit 1
1759 c2de5c91 malc
    fi
1760 c2de5c91 malc
    audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1761 a4bf6780 Juan Quintela
    libs_softmmu="$fmod_lib $libs_softmmu"
1762 c2de5c91 malc
    ;;
1763 c2de5c91 malc
1764 c2de5c91 malc
    esd)
1765 c2de5c91 malc
    audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1766 a4bf6780 Juan Quintela
    libs_softmmu="-lesd $libs_softmmu"
1767 67f86e8e Juan Quintela
    audio_pt_int="yes"
1768 c2de5c91 malc
    ;;
1769 b8e59f18 malc
1770 b8e59f18 malc
    pa)
1771 493abda6 Aurelien Jarno
    audio_drv_probe $drv pulse/simple.h "-lpulse-simple -lpulse" \
1772 20fa53ec Marc-Antoine Perennou
        "pa_simple *s = 0; pa_simple_free(s); return 0;"
1773 493abda6 Aurelien Jarno
    libs_softmmu="-lpulse -lpulse-simple $libs_softmmu"
1774 67f86e8e Juan Quintela
    audio_pt_int="yes"
1775 b8e59f18 malc
    ;;
1776 b8e59f18 malc
1777 997e690a Juan Quintela
    coreaudio)
1778 997e690a Juan Quintela
      libs_softmmu="-framework CoreAudio $libs_softmmu"
1779 997e690a Juan Quintela
    ;;
1780 997e690a Juan Quintela
1781 a4bf6780 Juan Quintela
    dsound)
1782 a4bf6780 Juan Quintela
      libs_softmmu="-lole32 -ldxguid $libs_softmmu"
1783 d5631638 malc
      audio_win_int="yes"
1784 a4bf6780 Juan Quintela
    ;;
1785 a4bf6780 Juan Quintela
1786 a4bf6780 Juan Quintela
    oss)
1787 a4bf6780 Juan Quintela
      libs_softmmu="$oss_lib $libs_softmmu"
1788 a4bf6780 Juan Quintela
    ;;
1789 a4bf6780 Juan Quintela
1790 a4bf6780 Juan Quintela
    sdl|wav)
1791 2f6a1ab0 blueswir1
    # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1792 2f6a1ab0 blueswir1
    ;;
1793 2f6a1ab0 blueswir1
1794 d5631638 malc
    winwave)
1795 d5631638 malc
      libs_softmmu="-lwinmm $libs_softmmu"
1796 d5631638 malc
      audio_win_int="yes"
1797 d5631638 malc
    ;;
1798 d5631638 malc
1799 e4c63a6a malc
    *)
1800 1c9b2a52 malc
    echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1801 e4c63a6a malc
        echo
1802 e4c63a6a malc
        echo "Error: Unknown driver '$drv' selected"
1803 e4c63a6a malc
        echo "Possible drivers are: $audio_possible_drivers"
1804 e4c63a6a malc
        echo
1805 e4c63a6a malc
        exit 1
1806 e4c63a6a malc
    }
1807 e4c63a6a malc
    ;;
1808 c2de5c91 malc
    esac
1809 c2de5c91 malc
done
1810 8f28f3fb ths
1811 4d3b6f6e balrog
##########################################
1812 2e4d9fb1 aurel32
# BrlAPI probe
1813 2e4d9fb1 aurel32
1814 4ffcedb6 Juan Quintela
if test "$brlapi" != "no" ; then
1815 eb82284f Juan Quintela
  brlapi_libs="-lbrlapi"
1816 eb82284f Juan Quintela
  cat > $TMPC << EOF
1817 2e4d9fb1 aurel32
#include <brlapi.h>
1818 832ce9c2 Scott Wood
#include <stddef.h>
1819 2e4d9fb1 aurel32
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1820 2e4d9fb1 aurel32
EOF
1821 52166aa0 Juan Quintela
  if compile_prog "" "$brlapi_libs" ; then
1822 eb82284f Juan Quintela
    brlapi=yes
1823 264606b3 Juan Quintela
    libs_softmmu="$brlapi_libs $libs_softmmu"
1824 4ffcedb6 Juan Quintela
  else
1825 4ffcedb6 Juan Quintela
    if test "$brlapi" = "yes" ; then
1826 4ffcedb6 Juan Quintela
      feature_not_found "brlapi"
1827 4ffcedb6 Juan Quintela
    fi
1828 4ffcedb6 Juan Quintela
    brlapi=no
1829 eb82284f Juan Quintela
  fi
1830 eb82284f Juan Quintela
fi
1831 2e4d9fb1 aurel32
1832 2e4d9fb1 aurel32
##########################################
1833 4d3b6f6e balrog
# curses probe
1834 e095e2f3 Stefan Weil
if test "$mingw32" = "yes" ; then
1835 e095e2f3 Stefan Weil
    curses_list="-lpdcurses"
1836 e095e2f3 Stefan Weil
else
1837 e095e2f3 Stefan Weil
    curses_list="-lncurses -lcurses"
1838 e095e2f3 Stefan Weil
fi
1839 4d3b6f6e balrog
1840 c584a6d0 Juan Quintela
if test "$curses" != "no" ; then
1841 c584a6d0 Juan Quintela
  curses_found=no
1842 4d3b6f6e balrog
  cat > $TMPC << EOF
1843 4d3b6f6e balrog
#include <curses.h>
1844 5a8ff3aa blueswir1
#ifdef __OpenBSD__
1845 5a8ff3aa blueswir1
#define resize_term resizeterm
1846 5a8ff3aa blueswir1
#endif
1847 5a8ff3aa blueswir1
int main(void) { resize_term(0, 0); return curses_version(); }
1848 4d3b6f6e balrog
EOF
1849 4f78ef9a Juan Quintela
  for curses_lib in $curses_list; do
1850 4f78ef9a Juan Quintela
    if compile_prog "" "$curses_lib" ; then
1851 c584a6d0 Juan Quintela
      curses_found=yes
1852 4f78ef9a Juan Quintela
      libs_softmmu="$curses_lib $libs_softmmu"
1853 4f78ef9a Juan Quintela
      break
1854 4f78ef9a Juan Quintela
    fi
1855 4f78ef9a Juan Quintela
  done
1856 c584a6d0 Juan Quintela
  if test "$curses_found" = "yes" ; then
1857 c584a6d0 Juan Quintela
    curses=yes
1858 c584a6d0 Juan Quintela
  else
1859 c584a6d0 Juan Quintela
    if test "$curses" = "yes" ; then
1860 c584a6d0 Juan Quintela
      feature_not_found "curses"
1861 c584a6d0 Juan Quintela
    fi
1862 c584a6d0 Juan Quintela
    curses=no
1863 c584a6d0 Juan Quintela
  fi
1864 4f78ef9a Juan Quintela
fi
1865 4d3b6f6e balrog
1866 414f0dab blueswir1
##########################################
1867 769ce76d Alexander Graf
# curl probe
1868 769ce76d Alexander Graf
1869 a8bd70ad Paolo Bonzini
if $pkg_config libcurl --modversion >/dev/null 2>&1; then
1870 a8bd70ad Paolo Bonzini
  curlconfig="$pkg_config libcurl"
1871 4e2b0658 Paolo Bonzini
else
1872 4e2b0658 Paolo Bonzini
  curlconfig=curl-config
1873 4e2b0658 Paolo Bonzini
fi
1874 4e2b0658 Paolo Bonzini
1875 788c8196 Juan Quintela
if test "$curl" != "no" ; then
1876 769ce76d Alexander Graf
  cat > $TMPC << EOF
1877 769ce76d Alexander Graf
#include <curl/curl.h>
1878 0b862ced Peter Maydell
int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; }
1879 769ce76d Alexander Graf
EOF
1880 4e2b0658 Paolo Bonzini
  curl_cflags=`$curlconfig --cflags 2>/dev/null`
1881 4e2b0658 Paolo Bonzini
  curl_libs=`$curlconfig --libs 2>/dev/null`
1882 b1d5a277 Juan Quintela
  if compile_prog "$curl_cflags" "$curl_libs" ; then
1883 769ce76d Alexander Graf
    curl=yes
1884 f0302935 Juan Quintela
    libs_tools="$curl_libs $libs_tools"
1885 f0302935 Juan Quintela
    libs_softmmu="$curl_libs $libs_softmmu"
1886 788c8196 Juan Quintela
  else
1887 788c8196 Juan Quintela
    if test "$curl" = "yes" ; then
1888 788c8196 Juan Quintela
      feature_not_found "curl"
1889 788c8196 Juan Quintela
    fi
1890 788c8196 Juan Quintela
    curl=no
1891 769ce76d Alexander Graf
  fi
1892 769ce76d Alexander Graf
fi # test "$curl"
1893 769ce76d Alexander Graf
1894 769ce76d Alexander Graf
##########################################
1895 5495ed11 Luiz Capitulino
# check framework probe
1896 5495ed11 Luiz Capitulino
1897 5495ed11 Luiz Capitulino
if test "$check_utests" != "no" ; then
1898 5495ed11 Luiz Capitulino
  cat > $TMPC << EOF
1899 5495ed11 Luiz Capitulino
#include <check.h>
1900 5495ed11 Luiz Capitulino
int main(void) { suite_create("qemu test"); return 0; }
1901 5495ed11 Luiz Capitulino
EOF
1902 f809c0d6 Peter Maydell
  check_libs=`$pkg_config --libs check 2>/dev/null`
1903 5495ed11 Luiz Capitulino
  if compile_prog "" $check_libs ; then
1904 5495ed11 Luiz Capitulino
    check_utests=yes
1905 5495ed11 Luiz Capitulino
    libs_tools="$check_libs $libs_tools"
1906 5495ed11 Luiz Capitulino
  else
1907 5495ed11 Luiz Capitulino
    if test "$check_utests" = "yes" ; then
1908 5495ed11 Luiz Capitulino
      feature_not_found "check"
1909 5495ed11 Luiz Capitulino
    fi
1910 5495ed11 Luiz Capitulino
    check_utests=no
1911 5495ed11 Luiz Capitulino
  fi
1912 5495ed11 Luiz Capitulino
fi # test "$check_utests"
1913 5495ed11 Luiz Capitulino
1914 5495ed11 Luiz Capitulino
##########################################
1915 fb599c9a balrog
# bluez support probe
1916 a20a6f46 Juan Quintela
if test "$bluez" != "no" ; then
1917 e820e3f4 balrog
  cat > $TMPC << EOF
1918 e820e3f4 balrog
#include <bluetooth/bluetooth.h>
1919 e820e3f4 balrog
int main(void) { return bt_error(0); }
1920 e820e3f4 balrog
EOF
1921 a8bd70ad Paolo Bonzini
  bluez_cflags=`$pkg_config --cflags bluez 2> /dev/null`
1922 a8bd70ad Paolo Bonzini
  bluez_libs=`$pkg_config --libs bluez 2> /dev/null`
1923 52166aa0 Juan Quintela
  if compile_prog "$bluez_cflags" "$bluez_libs" ; then
1924 a20a6f46 Juan Quintela
    bluez=yes
1925 e482d56a Juan Quintela
    libs_softmmu="$bluez_libs $libs_softmmu"
1926 e820e3f4 balrog
  else
1927 a20a6f46 Juan Quintela
    if test "$bluez" = "yes" ; then
1928 a20a6f46 Juan Quintela
      feature_not_found "bluez"
1929 a20a6f46 Juan Quintela
    fi
1930 e820e3f4 balrog
    bluez="no"
1931 e820e3f4 balrog
  fi
1932 fb599c9a balrog
fi
1933 fb599c9a balrog
1934 fb599c9a balrog
##########################################
1935 e18df141 Anthony Liguori
# glib support probe
1936 4b76a481 Stefan Hajnoczi
if $pkg_config --modversion gthread-2.0 > /dev/null 2>&1 ; then
1937 4b76a481 Stefan Hajnoczi
    glib_cflags=`$pkg_config --cflags gthread-2.0 2>/dev/null`
1938 4b76a481 Stefan Hajnoczi
    glib_libs=`$pkg_config --libs gthread-2.0 2>/dev/null`
1939 14015304 Anthony Liguori
    LIBS="$glib_libs $LIBS"
1940 957f1f99 Michael Roth
    libs_qga="$glib_libs $libs_qga"
1941 4b76a481 Stefan Hajnoczi
else
1942 4b76a481 Stefan Hajnoczi
    echo "glib-2.0 required to compile QEMU"
1943 4b76a481 Stefan Hajnoczi
    exit 1
1944 e18df141 Anthony Liguori
fi
1945 e18df141 Anthony Liguori
1946 e18df141 Anthony Liguori
##########################################
1947 e5d355d1 aliguori
# pthread probe
1948 4b29ec41 Brad
PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2"
1949 3c529d93 aliguori
1950 4dd75c70 Christoph Hellwig
pthread=no
1951 e5d355d1 aliguori
cat > $TMPC << EOF
1952 3c529d93 aliguori
#include <pthread.h>
1953 de65fe0f Sebastian Herbszt
int main(void) { pthread_create(0,0,0,0); return 0; }
1954 414f0dab blueswir1
EOF
1955 bd00d539 Andreas Färber
if compile_prog "" "" ; then
1956 bd00d539 Andreas Färber
  pthread=yes
1957 bd00d539 Andreas Färber
else
1958 bd00d539 Andreas Färber
  for pthread_lib in $PTHREADLIBS_LIST; do
1959 bd00d539 Andreas Färber
    if compile_prog "" "$pthread_lib" ; then
1960 bd00d539 Andreas Färber
      pthread=yes
1961 bd00d539 Andreas Färber
      LIBS="$pthread_lib $LIBS"
1962 bd00d539 Andreas Färber
      break
1963 bd00d539 Andreas Färber
    fi
1964 bd00d539 Andreas Färber
  done
1965 bd00d539 Andreas Färber
fi
1966 414f0dab blueswir1
1967 4617e593 Anthony Liguori
if test "$mingw32" != yes -a "$pthread" = no; then
1968 4dd75c70 Christoph Hellwig
  echo
1969 4dd75c70 Christoph Hellwig
  echo "Error: pthread check failed"
1970 4dd75c70 Christoph Hellwig
  echo "Make sure to have the pthread libs and headers installed."
1971 4dd75c70 Christoph Hellwig
  echo
1972 4dd75c70 Christoph Hellwig
  exit 1
1973 e5d355d1 aliguori
fi
1974 e5d355d1 aliguori
1975 bf9298b9 aliguori
##########################################
1976 f27aaf4b Christian Brunner
# rbd probe
1977 f27aaf4b Christian Brunner
if test "$rbd" != "no" ; then
1978 f27aaf4b Christian Brunner
  cat > $TMPC <<EOF
1979 f27aaf4b Christian Brunner
#include <stdio.h>
1980 ad32e9c0 Josh Durgin
#include <rbd/librbd.h>
1981 f27aaf4b Christian Brunner
int main(void) {
1982 ad32e9c0 Josh Durgin
    rados_t cluster;
1983 ad32e9c0 Josh Durgin
    rados_create(&cluster, NULL);
1984 f27aaf4b Christian Brunner
    return 0;
1985 f27aaf4b Christian Brunner
}
1986 f27aaf4b Christian Brunner
EOF
1987 ad32e9c0 Josh Durgin
  rbd_libs="-lrbd -lrados"
1988 ad32e9c0 Josh Durgin
  if compile_prog "" "$rbd_libs" ; then
1989 ad32e9c0 Josh Durgin
    rbd=yes
1990 ad32e9c0 Josh Durgin
    libs_tools="$rbd_libs $libs_tools"
1991 ad32e9c0 Josh Durgin
    libs_softmmu="$rbd_libs $libs_softmmu"
1992 f27aaf4b Christian Brunner
  else
1993 f27aaf4b Christian Brunner
    if test "$rbd" = "yes" ; then
1994 f27aaf4b Christian Brunner
      feature_not_found "rados block device"
1995 f27aaf4b Christian Brunner
    fi
1996 f27aaf4b Christian Brunner
    rbd=no
1997 f27aaf4b Christian Brunner
  fi
1998 f27aaf4b Christian Brunner
fi
1999 f27aaf4b Christian Brunner
2000 f27aaf4b Christian Brunner
##########################################
2001 5c6c3a6c Christoph Hellwig
# linux-aio probe
2002 5c6c3a6c Christoph Hellwig
2003 5c6c3a6c Christoph Hellwig
if test "$linux_aio" != "no" ; then
2004 5c6c3a6c Christoph Hellwig
  cat > $TMPC <<EOF
2005 5c6c3a6c Christoph Hellwig
#include <libaio.h>
2006 5c6c3a6c Christoph Hellwig
#include <sys/eventfd.h>
2007 832ce9c2 Scott Wood
#include <stddef.h>
2008 5c6c3a6c Christoph Hellwig
int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
2009 5c6c3a6c Christoph Hellwig
EOF
2010 5c6c3a6c Christoph Hellwig
  if compile_prog "" "-laio" ; then
2011 5c6c3a6c Christoph Hellwig
    linux_aio=yes
2012 048d179f Paul Brook
    libs_softmmu="$libs_softmmu -laio"
2013 048d179f Paul Brook
    libs_tools="$libs_tools -laio"
2014 5c6c3a6c Christoph Hellwig
  else
2015 5c6c3a6c Christoph Hellwig
    if test "$linux_aio" = "yes" ; then
2016 5c6c3a6c Christoph Hellwig
      feature_not_found "linux AIO"
2017 5c6c3a6c Christoph Hellwig
    fi
2018 3cfcae3c Luiz Capitulino
    linux_aio=no
2019 5c6c3a6c Christoph Hellwig
  fi
2020 5c6c3a6c Christoph Hellwig
fi
2021 5c6c3a6c Christoph Hellwig
2022 5c6c3a6c Christoph Hellwig
##########################################
2023 758e8e38 Venkateswararao Jujjuri (JV)
# attr probe
2024 758e8e38 Venkateswararao Jujjuri (JV)
2025 758e8e38 Venkateswararao Jujjuri (JV)
if test "$attr" != "no" ; then
2026 758e8e38 Venkateswararao Jujjuri (JV)
  cat > $TMPC <<EOF
2027 758e8e38 Venkateswararao Jujjuri (JV)
#include <stdio.h>
2028 758e8e38 Venkateswararao Jujjuri (JV)
#include <sys/types.h>
2029 f2338fb4 Pavel Borzenkov
#ifdef CONFIG_LIBATTR
2030 f2338fb4 Pavel Borzenkov
#include <attr/xattr.h>
2031 f2338fb4 Pavel Borzenkov
#else
2032 4f26f2b6 Avi Kivity
#include <sys/xattr.h>
2033 f2338fb4 Pavel Borzenkov
#endif
2034 758e8e38 Venkateswararao Jujjuri (JV)
int main(void) { getxattr(NULL, NULL, NULL, 0); setxattr(NULL, NULL, NULL, 0, 0); return 0; }
2035 758e8e38 Venkateswararao Jujjuri (JV)
EOF
2036 4f26f2b6 Avi Kivity
  if compile_prog "" "" ; then
2037 4f26f2b6 Avi Kivity
    attr=yes
2038 4f26f2b6 Avi Kivity
  # Older distros have <attr/xattr.h>, and need -lattr:
2039 f2338fb4 Pavel Borzenkov
  elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then
2040 758e8e38 Venkateswararao Jujjuri (JV)
    attr=yes
2041 758e8e38 Venkateswararao Jujjuri (JV)
    LIBS="-lattr $LIBS"
2042 4f26f2b6 Avi Kivity
    libattr=yes
2043 758e8e38 Venkateswararao Jujjuri (JV)
  else
2044 758e8e38 Venkateswararao Jujjuri (JV)
    if test "$attr" = "yes" ; then
2045 758e8e38 Venkateswararao Jujjuri (JV)
      feature_not_found "ATTR"
2046 758e8e38 Venkateswararao Jujjuri (JV)
    fi
2047 758e8e38 Venkateswararao Jujjuri (JV)
    attr=no
2048 758e8e38 Venkateswararao Jujjuri (JV)
  fi
2049 758e8e38 Venkateswararao Jujjuri (JV)
fi
2050 758e8e38 Venkateswararao Jujjuri (JV)
2051 758e8e38 Venkateswararao Jujjuri (JV)
##########################################
2052 bf9298b9 aliguori
# iovec probe
2053 bf9298b9 aliguori
cat > $TMPC <<EOF
2054 db34f0b3 blueswir1
#include <sys/types.h>
2055 bf9298b9 aliguori
#include <sys/uio.h>
2056 db34f0b3 blueswir1
#include <unistd.h>
2057 bf9298b9 aliguori
int main(void) { struct iovec iov; return 0; }
2058 bf9298b9 aliguori
EOF
2059 bf9298b9 aliguori
iovec=no
2060 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2061 bf9298b9 aliguori
  iovec=yes
2062 bf9298b9 aliguori
fi
2063 bf9298b9 aliguori
2064 f652e6af aurel32
##########################################
2065 ceb42de8 aliguori
# preadv probe
2066 ceb42de8 aliguori
cat > $TMPC <<EOF
2067 ceb42de8 aliguori
#include <sys/types.h>
2068 ceb42de8 aliguori
#include <sys/uio.h>
2069 ceb42de8 aliguori
#include <unistd.h>
2070 ceb42de8 aliguori
int main(void) { preadv; }
2071 ceb42de8 aliguori
EOF
2072 ceb42de8 aliguori
preadv=no
2073 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2074 ceb42de8 aliguori
  preadv=yes
2075 ceb42de8 aliguori
fi
2076 ceb42de8 aliguori
2077 ceb42de8 aliguori
##########################################
2078 f652e6af aurel32
# fdt probe
2079 2df87df7 Juan Quintela
if test "$fdt" != "no" ; then
2080 b41af4ba Juan Quintela
  fdt_libs="-lfdt"
2081 b41af4ba Juan Quintela
  cat > $TMPC << EOF
2082 f652e6af aurel32
int main(void) { return 0; }
2083 f652e6af aurel32
EOF
2084 52166aa0 Juan Quintela
  if compile_prog "" "$fdt_libs" ; then
2085 f652e6af aurel32
    fdt=yes
2086 2df87df7 Juan Quintela
  else
2087 2df87df7 Juan Quintela
    if test "$fdt" = "yes" ; then
2088 2df87df7 Juan Quintela
      feature_not_found "fdt"
2089 2df87df7 Juan Quintela
    fi
2090 de3a354a Michael Walle
    fdt_libs=
2091 2df87df7 Juan Quintela
    fdt=no
2092 f652e6af aurel32
  fi
2093 f652e6af aurel32
fi
2094 f652e6af aurel32
2095 20ff075b Michael Walle
##########################################
2096 20ff075b Michael Walle
# opengl probe, used by milkymist-tmu2
2097 20ff075b Michael Walle
if test "$opengl" != "no" ; then
2098 20ff075b Michael Walle
  opengl_libs="-lGL"
2099 20ff075b Michael Walle
  cat > $TMPC << EOF
2100 20ff075b Michael Walle
#include <X11/Xlib.h>
2101 20ff075b Michael Walle
#include <GL/gl.h>
2102 20ff075b Michael Walle
#include <GL/glx.h>
2103 20ff075b Michael Walle
int main(void) { GL_VERSION; return 0; }
2104 20ff075b Michael Walle
EOF
2105 20ff075b Michael Walle
  if compile_prog "" "-lGL" ; then
2106 20ff075b Michael Walle
    opengl=yes
2107 20ff075b Michael Walle
  else
2108 20ff075b Michael Walle
    if test "$opengl" = "yes" ; then
2109 20ff075b Michael Walle
      feature_not_found "opengl"
2110 20ff075b Michael Walle
    fi
2111 de3a354a Michael Walle
    opengl_libs=
2112 20ff075b Michael Walle
    opengl=no
2113 20ff075b Michael Walle
  fi
2114 20ff075b Michael Walle
fi
2115 20ff075b Michael Walle
2116 3b3f24ad aurel32
#
2117 3b3f24ad aurel32
# Check for xxxat() functions when we are building linux-user
2118 3b3f24ad aurel32
# emulator.  This is done because older glibc versions don't
2119 3b3f24ad aurel32
# have syscall stubs for these implemented.
2120 3b3f24ad aurel32
#
2121 3b3f24ad aurel32
atfile=no
2122 67ba57f6 Riku Voipio
cat > $TMPC << EOF
2123 3b3f24ad aurel32
#define _ATFILE_SOURCE
2124 3b3f24ad aurel32
#include <sys/types.h>
2125 3b3f24ad aurel32
#include <fcntl.h>
2126 3b3f24ad aurel32
#include <unistd.h>
2127 3b3f24ad aurel32
2128 3b3f24ad aurel32
int
2129 3b3f24ad aurel32
main(void)
2130 3b3f24ad aurel32
{
2131 3b3f24ad aurel32
	/* try to unlink nonexisting file */
2132 3b3f24ad aurel32
	return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
2133 3b3f24ad aurel32
}
2134 3b3f24ad aurel32
EOF
2135 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2136 67ba57f6 Riku Voipio
  atfile=yes
2137 3b3f24ad aurel32
fi
2138 3b3f24ad aurel32
2139 39386ac7 aurel32
# Check for inotify functions when we are building linux-user
2140 3b3f24ad aurel32
# emulator.  This is done because older glibc versions don't
2141 3b3f24ad aurel32
# have syscall stubs for these implemented.  In that case we
2142 3b3f24ad aurel32
# don't provide them even if kernel supports them.
2143 3b3f24ad aurel32
#
2144 3b3f24ad aurel32
inotify=no
2145 67ba57f6 Riku Voipio
cat > $TMPC << EOF
2146 3b3f24ad aurel32
#include <sys/inotify.h>
2147 3b3f24ad aurel32
2148 3b3f24ad aurel32
int
2149 3b3f24ad aurel32
main(void)
2150 3b3f24ad aurel32
{
2151 3b3f24ad aurel32
	/* try to start inotify */
2152 8690e420 aurel32
	return inotify_init();
2153 3b3f24ad aurel32
}
2154 3b3f24ad aurel32
EOF
2155 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2156 67ba57f6 Riku Voipio
  inotify=yes
2157 3b3f24ad aurel32
fi
2158 3b3f24ad aurel32
2159 c05c7a73 Riku Voipio
inotify1=no
2160 c05c7a73 Riku Voipio
cat > $TMPC << EOF
2161 c05c7a73 Riku Voipio
#include <sys/inotify.h>
2162 c05c7a73 Riku Voipio
2163 c05c7a73 Riku Voipio
int
2164 c05c7a73 Riku Voipio
main(void)
2165 c05c7a73 Riku Voipio
{
2166 c05c7a73 Riku Voipio
    /* try to start inotify */
2167 c05c7a73 Riku Voipio
    return inotify_init1(0);
2168 c05c7a73 Riku Voipio
}
2169 c05c7a73 Riku Voipio
EOF
2170 c05c7a73 Riku Voipio
if compile_prog "" "" ; then
2171 c05c7a73 Riku Voipio
  inotify1=yes
2172 c05c7a73 Riku Voipio
fi
2173 c05c7a73 Riku Voipio
2174 ebc996f3 Riku Voipio
# check if utimensat and futimens are supported
2175 ebc996f3 Riku Voipio
utimens=no
2176 ebc996f3 Riku Voipio
cat > $TMPC << EOF
2177 ebc996f3 Riku Voipio
#define _ATFILE_SOURCE
2178 ebc996f3 Riku Voipio
#include <stddef.h>
2179 ebc996f3 Riku Voipio
#include <fcntl.h>
2180 ebc996f3 Riku Voipio
2181 ebc996f3 Riku Voipio
int main(void)
2182 ebc996f3 Riku Voipio
{
2183 ebc996f3 Riku Voipio
    utimensat(AT_FDCWD, "foo", NULL, 0);
2184 ebc996f3 Riku Voipio
    futimens(0, NULL);
2185 ebc996f3 Riku Voipio
    return 0;
2186 ebc996f3 Riku Voipio
}
2187 ebc996f3 Riku Voipio
EOF
2188 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2189 ebc996f3 Riku Voipio
  utimens=yes
2190 ebc996f3 Riku Voipio
fi
2191 ebc996f3 Riku Voipio
2192 099d6b0f Riku Voipio
# check if pipe2 is there
2193 099d6b0f Riku Voipio
pipe2=no
2194 099d6b0f Riku Voipio
cat > $TMPC << EOF
2195 099d6b0f Riku Voipio
#include <unistd.h>
2196 099d6b0f Riku Voipio
#include <fcntl.h>
2197 099d6b0f Riku Voipio
2198 099d6b0f Riku Voipio
int main(void)
2199 099d6b0f Riku Voipio
{
2200 099d6b0f Riku Voipio
    int pipefd[2];
2201 099d6b0f Riku Voipio
    pipe2(pipefd, O_CLOEXEC);
2202 099d6b0f Riku Voipio
    return 0;
2203 099d6b0f Riku Voipio
}
2204 099d6b0f Riku Voipio
EOF
2205 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2206 099d6b0f Riku Voipio
  pipe2=yes
2207 099d6b0f Riku Voipio
fi
2208 099d6b0f Riku Voipio
2209 40ff6d7e Kevin Wolf
# check if accept4 is there
2210 40ff6d7e Kevin Wolf
accept4=no
2211 40ff6d7e Kevin Wolf
cat > $TMPC << EOF
2212 40ff6d7e Kevin Wolf
#include <sys/socket.h>
2213 40ff6d7e Kevin Wolf
#include <stddef.h>
2214 40ff6d7e Kevin Wolf
2215 40ff6d7e Kevin Wolf
int main(void)
2216 40ff6d7e Kevin Wolf
{
2217 40ff6d7e Kevin Wolf
    accept4(0, NULL, NULL, SOCK_CLOEXEC);
2218 40ff6d7e Kevin Wolf
    return 0;
2219 40ff6d7e Kevin Wolf
}
2220 40ff6d7e Kevin Wolf
EOF
2221 40ff6d7e Kevin Wolf
if compile_prog "" "" ; then
2222 40ff6d7e Kevin Wolf
  accept4=yes
2223 40ff6d7e Kevin Wolf
fi
2224 40ff6d7e Kevin Wolf
2225 3ce34dfb vibisreenivasan
# check if tee/splice is there. vmsplice was added same time.
2226 3ce34dfb vibisreenivasan
splice=no
2227 3ce34dfb vibisreenivasan
cat > $TMPC << EOF
2228 3ce34dfb vibisreenivasan
#include <unistd.h>
2229 3ce34dfb vibisreenivasan
#include <fcntl.h>
2230 3ce34dfb vibisreenivasan
#include <limits.h>
2231 3ce34dfb vibisreenivasan
2232 3ce34dfb vibisreenivasan
int main(void)
2233 3ce34dfb vibisreenivasan
{
2234 3ce34dfb vibisreenivasan
    int len, fd;
2235 3ce34dfb vibisreenivasan
    len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
2236 3ce34dfb vibisreenivasan
    splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
2237 3ce34dfb vibisreenivasan
    return 0;
2238 3ce34dfb vibisreenivasan
}
2239 3ce34dfb vibisreenivasan
EOF
2240 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2241 3ce34dfb vibisreenivasan
  splice=yes
2242 3ce34dfb vibisreenivasan
fi
2243 3ce34dfb vibisreenivasan
2244 dcc38d1c Marcelo Tosatti
##########################################
2245 dcc38d1c Marcelo Tosatti
# signalfd probe
2246 dcc38d1c Marcelo Tosatti
signalfd="no"
2247 dcc38d1c Marcelo Tosatti
cat > $TMPC << EOF
2248 dcc38d1c Marcelo Tosatti
#define _GNU_SOURCE
2249 dcc38d1c Marcelo Tosatti
#include <unistd.h>
2250 dcc38d1c Marcelo Tosatti
#include <sys/syscall.h>
2251 dcc38d1c Marcelo Tosatti
#include <signal.h>
2252 dcc38d1c Marcelo Tosatti
int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
2253 dcc38d1c Marcelo Tosatti
EOF
2254 dcc38d1c Marcelo Tosatti
2255 dcc38d1c Marcelo Tosatti
if compile_prog "" "" ; then
2256 dcc38d1c Marcelo Tosatti
  signalfd=yes
2257 dcc38d1c Marcelo Tosatti
fi
2258 dcc38d1c Marcelo Tosatti
2259 c2882b96 Riku Voipio
# check if eventfd is supported
2260 c2882b96 Riku Voipio
eventfd=no
2261 c2882b96 Riku Voipio
cat > $TMPC << EOF
2262 c2882b96 Riku Voipio
#include <sys/eventfd.h>
2263 c2882b96 Riku Voipio
2264 c2882b96 Riku Voipio
int main(void)
2265 c2882b96 Riku Voipio
{
2266 3439eec3 Max Filippov
    int efd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
2267 c2882b96 Riku Voipio
    return 0;
2268 c2882b96 Riku Voipio
}
2269 c2882b96 Riku Voipio
EOF
2270 c2882b96 Riku Voipio
if compile_prog "" "" ; then
2271 c2882b96 Riku Voipio
  eventfd=yes
2272 c2882b96 Riku Voipio
fi
2273 c2882b96 Riku Voipio
2274 d0927938 Ulrich Hecht
# check for fallocate
2275 d0927938 Ulrich Hecht
fallocate=no
2276 d0927938 Ulrich Hecht
cat > $TMPC << EOF
2277 d0927938 Ulrich Hecht
#include <fcntl.h>
2278 d0927938 Ulrich Hecht
2279 d0927938 Ulrich Hecht
int main(void)
2280 d0927938 Ulrich Hecht
{
2281 d0927938 Ulrich Hecht
    fallocate(0, 0, 0, 0);
2282 d0927938 Ulrich Hecht
    return 0;
2283 d0927938 Ulrich Hecht
}
2284 d0927938 Ulrich Hecht
EOF
2285 be17dc90 Michael S. Tsirkin
if compile_prog "$ARCH_CFLAGS" "" ; then
2286 d0927938 Ulrich Hecht
  fallocate=yes
2287 d0927938 Ulrich Hecht
fi
2288 d0927938 Ulrich Hecht
2289 c727f47d Peter Maydell
# check for sync_file_range
2290 c727f47d Peter Maydell
sync_file_range=no
2291 c727f47d Peter Maydell
cat > $TMPC << EOF
2292 c727f47d Peter Maydell
#include <fcntl.h>
2293 c727f47d Peter Maydell
2294 c727f47d Peter Maydell
int main(void)
2295 c727f47d Peter Maydell
{
2296 c727f47d Peter Maydell
    sync_file_range(0, 0, 0, 0);
2297 c727f47d Peter Maydell
    return 0;
2298 c727f47d Peter Maydell
}
2299 c727f47d Peter Maydell
EOF
2300 c727f47d Peter Maydell
if compile_prog "$ARCH_CFLAGS" "" ; then
2301 c727f47d Peter Maydell
  sync_file_range=yes
2302 c727f47d Peter Maydell
fi
2303 c727f47d Peter Maydell
2304 dace20dc Peter Maydell
# check for linux/fiemap.h and FS_IOC_FIEMAP
2305 dace20dc Peter Maydell
fiemap=no
2306 dace20dc Peter Maydell
cat > $TMPC << EOF
2307 dace20dc Peter Maydell
#include <sys/ioctl.h>
2308 dace20dc Peter Maydell
#include <linux/fs.h>
2309 dace20dc Peter Maydell
#include <linux/fiemap.h>
2310 dace20dc Peter Maydell
2311 dace20dc Peter Maydell
int main(void)
2312 dace20dc Peter Maydell
{
2313 dace20dc Peter Maydell
    ioctl(0, FS_IOC_FIEMAP, 0);
2314 dace20dc Peter Maydell
    return 0;
2315 dace20dc Peter Maydell
}
2316 dace20dc Peter Maydell
EOF
2317 dace20dc Peter Maydell
if compile_prog "$ARCH_CFLAGS" "" ; then
2318 dace20dc Peter Maydell
  fiemap=yes
2319 dace20dc Peter Maydell
fi
2320 dace20dc Peter Maydell
2321 d0927938 Ulrich Hecht
# check for dup3
2322 d0927938 Ulrich Hecht
dup3=no
2323 d0927938 Ulrich Hecht
cat > $TMPC << EOF
2324 d0927938 Ulrich Hecht
#include <unistd.h>
2325 d0927938 Ulrich Hecht
2326 d0927938 Ulrich Hecht
int main(void)
2327 d0927938 Ulrich Hecht
{
2328 d0927938 Ulrich Hecht
    dup3(0, 0, 0);
2329 d0927938 Ulrich Hecht
    return 0;
2330 d0927938 Ulrich Hecht
}
2331 d0927938 Ulrich Hecht
EOF
2332 78f5d726 Jan Kiszka
if compile_prog "" "" ; then
2333 d0927938 Ulrich Hecht
  dup3=yes
2334 d0927938 Ulrich Hecht
fi
2335 d0927938 Ulrich Hecht
2336 3b6edd16 Peter Maydell
# check for epoll support
2337 3b6edd16 Peter Maydell
epoll=no
2338 3b6edd16 Peter Maydell
cat > $TMPC << EOF
2339 3b6edd16 Peter Maydell
#include <sys/epoll.h>
2340 3b6edd16 Peter Maydell
2341 3b6edd16 Peter Maydell
int main(void)
2342 3b6edd16 Peter Maydell
{
2343 3b6edd16 Peter Maydell
    epoll_create(0);
2344 3b6edd16 Peter Maydell
    return 0;
2345 3b6edd16 Peter Maydell
}
2346 3b6edd16 Peter Maydell
EOF
2347 3b6edd16 Peter Maydell
if compile_prog "$ARCH_CFLAGS" "" ; then
2348 3b6edd16 Peter Maydell
  epoll=yes
2349 3b6edd16 Peter Maydell
fi
2350 3b6edd16 Peter Maydell
2351 3b6edd16 Peter Maydell
# epoll_create1 and epoll_pwait are later additions
2352 3b6edd16 Peter Maydell
# so we must check separately for their presence
2353 3b6edd16 Peter Maydell
epoll_create1=no
2354 3b6edd16 Peter Maydell
cat > $TMPC << EOF
2355 3b6edd16 Peter Maydell
#include <sys/epoll.h>
2356 3b6edd16 Peter Maydell
2357 3b6edd16 Peter Maydell
int main(void)
2358 3b6edd16 Peter Maydell
{
2359 19e83f6b Peter Maydell
    /* Note that we use epoll_create1 as a value, not as
2360 19e83f6b Peter Maydell
     * a function being called. This is necessary so that on
2361 19e83f6b Peter Maydell
     * old SPARC glibc versions where the function was present in
2362 19e83f6b Peter Maydell
     * the library but not declared in the header file we will
2363 19e83f6b Peter Maydell
     * fail the configure check. (Otherwise we will get a compiler
2364 19e83f6b Peter Maydell
     * warning but not an error, and will proceed to fail the
2365 19e83f6b Peter Maydell
     * qemu compile where we compile with -Werror.)
2366 19e83f6b Peter Maydell
     */
2367 19e83f6b Peter Maydell
    epoll_create1;
2368 3b6edd16 Peter Maydell
    return 0;
2369 3b6edd16 Peter Maydell
}
2370 3b6edd16 Peter Maydell
EOF
2371 3b6edd16 Peter Maydell
if compile_prog "$ARCH_CFLAGS" "" ; then
2372 3b6edd16 Peter Maydell
  epoll_create1=yes
2373 3b6edd16 Peter Maydell
fi
2374 3b6edd16 Peter Maydell
2375 3b6edd16 Peter Maydell
epoll_pwait=no
2376 3b6edd16 Peter Maydell
cat > $TMPC << EOF
2377 3b6edd16 Peter Maydell
#include <sys/epoll.h>
2378 3b6edd16 Peter Maydell
2379 3b6edd16 Peter Maydell
int main(void)
2380 3b6edd16 Peter Maydell
{
2381 3b6edd16 Peter Maydell
    epoll_pwait(0, 0, 0, 0, 0);
2382 3b6edd16 Peter Maydell
    return 0;
2383 3b6edd16 Peter Maydell
}
2384 3b6edd16 Peter Maydell
EOF
2385 3b6edd16 Peter Maydell
if compile_prog "$ARCH_CFLAGS" "" ; then
2386 3b6edd16 Peter Maydell
  epoll_pwait=yes
2387 3b6edd16 Peter Maydell
fi
2388 3b6edd16 Peter Maydell
2389 cc8ae6de pbrook
# Check if tools are available to build documentation.
2390 a25dba17 Juan Quintela
if test "$docs" != "no" ; then
2391 01668d98 Stefan Weil
  if has makeinfo && has pod2man; then
2392 a25dba17 Juan Quintela
    docs=yes
2393 83a3ab8b Juan Quintela
  else
2394 a25dba17 Juan Quintela
    if test "$docs" = "yes" ; then
2395 a25dba17 Juan Quintela
      feature_not_found "docs"
2396 83a3ab8b Juan Quintela
    fi
2397 a25dba17 Juan Quintela
    docs=no
2398 83a3ab8b Juan Quintela
  fi
2399 cc8ae6de pbrook
fi
2400 cc8ae6de pbrook
2401 f514f41c Stefan Weil
# Search for bswap_32 function
2402 6ae9a1f4 Juan Quintela
byteswap_h=no
2403 6ae9a1f4 Juan Quintela
cat > $TMPC << EOF
2404 6ae9a1f4 Juan Quintela
#include <byteswap.h>
2405 6ae9a1f4 Juan Quintela
int main(void) { return bswap_32(0); }
2406 6ae9a1f4 Juan Quintela
EOF
2407 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2408 6ae9a1f4 Juan Quintela
  byteswap_h=yes
2409 6ae9a1f4 Juan Quintela
fi
2410 6ae9a1f4 Juan Quintela
2411 f514f41c Stefan Weil
# Search for bswap_32 function
2412 6ae9a1f4 Juan Quintela
bswap_h=no
2413 6ae9a1f4 Juan Quintela
cat > $TMPC << EOF
2414 6ae9a1f4 Juan Quintela
#include <sys/endian.h>
2415 6ae9a1f4 Juan Quintela
#include <sys/types.h>
2416 6ae9a1f4 Juan Quintela
#include <machine/bswap.h>
2417 6ae9a1f4 Juan Quintela
int main(void) { return bswap32(0); }
2418 6ae9a1f4 Juan Quintela
EOF
2419 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2420 6ae9a1f4 Juan Quintela
  bswap_h=yes
2421 6ae9a1f4 Juan Quintela
fi
2422 6ae9a1f4 Juan Quintela
2423 da93a1fd aliguori
##########################################
2424 c589b249 Ronnie Sahlberg
# Do we have libiscsi
2425 c589b249 Ronnie Sahlberg
if test "$libiscsi" != "no" ; then
2426 c589b249 Ronnie Sahlberg
  cat > $TMPC << EOF
2427 c589b249 Ronnie Sahlberg
#include <iscsi/iscsi.h>
2428 c589b249 Ronnie Sahlberg
int main(void) { iscsi_create_context(""); return 0; }
2429 c589b249 Ronnie Sahlberg
EOF
2430 c589b249 Ronnie Sahlberg
  if compile_prog "-Werror" "-liscsi" ; then
2431 c589b249 Ronnie Sahlberg
    libiscsi="yes"
2432 c589b249 Ronnie Sahlberg
    LIBS="$LIBS -liscsi"
2433 c589b249 Ronnie Sahlberg
  else
2434 c589b249 Ronnie Sahlberg
    if test "$libiscsi" = "yes" ; then
2435 c589b249 Ronnie Sahlberg
      feature_not_found "libiscsi"
2436 c589b249 Ronnie Sahlberg
    fi
2437 c589b249 Ronnie Sahlberg
    libiscsi="no"
2438 c589b249 Ronnie Sahlberg
  fi
2439 c589b249 Ronnie Sahlberg
fi
2440 c589b249 Ronnie Sahlberg
2441 c589b249 Ronnie Sahlberg
2442 c589b249 Ronnie Sahlberg
##########################################
2443 da93a1fd aliguori
# Do we need librt
2444 da93a1fd aliguori
cat > $TMPC <<EOF
2445 da93a1fd aliguori
#include <signal.h>
2446 da93a1fd aliguori
#include <time.h>
2447 da93a1fd aliguori
int main(void) { clockid_t id; return clock_gettime(id, NULL); }
2448 da93a1fd aliguori
EOF
2449 da93a1fd aliguori
2450 52166aa0 Juan Quintela
if compile_prog "" "" ; then
2451 07ffa4bd Juan Quintela
  :
2452 52166aa0 Juan Quintela
elif compile_prog "" "-lrt" ; then
2453 07ffa4bd Juan Quintela
  LIBS="-lrt $LIBS"
2454 da93a1fd aliguori
fi
2455 da93a1fd aliguori
2456 31ff504d Blue Swirl
if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
2457 179cf400 Andreas Färber
        "$aix" != "yes" -a "$haiku" != "yes" ; then
2458 6362a53f Juan Quintela
    libs_softmmu="-lutil $libs_softmmu"
2459 6362a53f Juan Quintela
fi
2460 6362a53f Juan Quintela
2461 de5071c5 Blue Swirl
##########################################
2462 de5071c5 Blue Swirl
# check if the compiler defines offsetof
2463 de5071c5 Blue Swirl
2464 de5071c5 Blue Swirl
need_offsetof=yes
2465 de5071c5 Blue Swirl
cat > $TMPC << EOF
2466 de5071c5 Blue Swirl
#include <stddef.h>
2467 de5071c5 Blue Swirl
int main(void) { struct s { int f; }; return offsetof(struct s, f); }
2468 de5071c5 Blue Swirl
EOF
2469 de5071c5 Blue Swirl
if compile_prog "" "" ; then
2470 de5071c5 Blue Swirl
    need_offsetof=no
2471 de5071c5 Blue Swirl
fi
2472 de5071c5 Blue Swirl
2473 cd4ec0b4 Gerd Hoffmann
# spice probe
2474 cd4ec0b4 Gerd Hoffmann
if test "$spice" != "no" ; then
2475 cd4ec0b4 Gerd Hoffmann
  cat > $TMPC << EOF
2476 cd4ec0b4 Gerd Hoffmann
#include <spice.h>
2477 cd4ec0b4 Gerd Hoffmann
int main(void) { spice_server_new(); return 0; }
2478 cd4ec0b4 Gerd Hoffmann
EOF
2479 710fc4f5 Jiri Denemark
  spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
2480 710fc4f5 Jiri Denemark
  spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
2481 012b80d3 Gerd Hoffmann
  if $pkg_config --atleast-version=0.6.0 spice-server >/dev/null 2>&1 && \
2482 cd4ec0b4 Gerd Hoffmann
     compile_prog "$spice_cflags" "$spice_libs" ; then
2483 cd4ec0b4 Gerd Hoffmann
    spice="yes"
2484 cd4ec0b4 Gerd Hoffmann
    libs_softmmu="$libs_softmmu $spice_libs"
2485 cd4ec0b4 Gerd Hoffmann
    QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags"
2486 cd4ec0b4 Gerd Hoffmann
  else
2487 cd4ec0b4 Gerd Hoffmann
    if test "$spice" = "yes" ; then
2488 cd4ec0b4 Gerd Hoffmann
      feature_not_found "spice"
2489 cd4ec0b4 Gerd Hoffmann
    fi
2490 cd4ec0b4 Gerd Hoffmann
    spice="no"
2491 cd4ec0b4 Gerd Hoffmann
  fi
2492 cd4ec0b4 Gerd Hoffmann
fi
2493 cd4ec0b4 Gerd Hoffmann
2494 111a38b0 Robert Relyea
# check for libcacard for smartcard support
2495 111a38b0 Robert Relyea
if test "$smartcard" != "no" ; then
2496 111a38b0 Robert Relyea
    smartcard="yes"
2497 111a38b0 Robert Relyea
    smartcard_cflags=""
2498 111a38b0 Robert Relyea
    # TODO - what's the minimal nss version we support?
2499 111a38b0 Robert Relyea
    if test "$smartcard_nss" != "no"; then
2500 111a38b0 Robert Relyea
        if $pkg_config --atleast-version=3.12.8 nss >/dev/null 2>&1 ; then
2501 111a38b0 Robert Relyea
            smartcard_nss="yes"
2502 111a38b0 Robert Relyea
            smartcard_cflags="-I\$(SRC_PATH)/libcacard"
2503 111a38b0 Robert Relyea
            libcacard_libs=$($pkg_config --libs nss 2>/dev/null)
2504 111a38b0 Robert Relyea
            libcacard_cflags=$($pkg_config --cflags nss 2>/dev/null)
2505 111a38b0 Robert Relyea
            QEMU_CFLAGS="$QEMU_CFLAGS $smartcard_cflags $libcacard_cflags"
2506 111a38b0 Robert Relyea
            LIBS="$libcacard_libs $LIBS"
2507 111a38b0 Robert Relyea
        else
2508 111a38b0 Robert Relyea
            if test "$smartcard_nss" = "yes"; then
2509 111a38b0 Robert Relyea
                feature_not_found "nss"
2510 111a38b0 Robert Relyea
            fi
2511 111a38b0 Robert Relyea
            smartcard_nss="no"
2512 111a38b0 Robert Relyea
        fi
2513 111a38b0 Robert Relyea
    fi
2514 111a38b0 Robert Relyea
fi
2515 111a38b0 Robert Relyea
if test "$smartcard" = "no" ; then
2516 111a38b0 Robert Relyea
    smartcard_nss="no"
2517 111a38b0 Robert Relyea
fi
2518 111a38b0 Robert Relyea
2519 69354a83 Hans de Goede
# check for usbredirparser for usb network redirection support
2520 69354a83 Hans de Goede
if test "$usb_redir" != "no" ; then
2521 69354a83 Hans de Goede
    if $pkg_config libusbredirparser >/dev/null 2>&1 ; then
2522 69354a83 Hans de Goede
        usb_redir="yes"
2523 69354a83 Hans de Goede
        usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
2524 69354a83 Hans de Goede
        usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
2525 69354a83 Hans de Goede
        QEMU_CFLAGS="$QEMU_CFLAGS $usb_redir_cflags"
2526 69354a83 Hans de Goede
        LIBS="$LIBS $usb_redir_libs"
2527 69354a83 Hans de Goede
    else
2528 69354a83 Hans de Goede
        if test "$usb_redir" = "yes"; then
2529 69354a83 Hans de Goede
            feature_not_found "usb-redir"
2530 69354a83 Hans de Goede
        fi
2531 69354a83 Hans de Goede
        usb_redir="no"
2532 69354a83 Hans de Goede
    fi
2533 69354a83 Hans de Goede
fi
2534 69354a83 Hans de Goede
2535 cd4ec0b4 Gerd Hoffmann
##########################################
2536 cd4ec0b4 Gerd Hoffmann
2537 747bbdf7 Blue Swirl
##########################################
2538 5f6b9e8f Blue Swirl
# check if we have fdatasync
2539 5f6b9e8f Blue Swirl
2540 5f6b9e8f Blue Swirl
fdatasync=no
2541 5f6b9e8f Blue Swirl
cat > $TMPC << EOF
2542 5f6b9e8f Blue Swirl
#include <unistd.h>
2543 d1722a27 Alexandre Raymond
int main(void) {
2544 d1722a27 Alexandre Raymond
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
2545 d1722a27 Alexandre Raymond
return fdatasync(0);
2546 d1722a27 Alexandre Raymond
#else
2547 d1722a27 Alexandre Raymond
#abort Not supported
2548 d1722a27 Alexandre Raymond
#endif
2549 d1722a27 Alexandre Raymond
}
2550 5f6b9e8f Blue Swirl
EOF
2551 5f6b9e8f Blue Swirl
if compile_prog "" "" ; then
2552 5f6b9e8f Blue Swirl
    fdatasync=yes
2553 5f6b9e8f Blue Swirl
fi
2554 5f6b9e8f Blue Swirl
2555 94a420b1 Stefan Hajnoczi
##########################################
2556 e78815a5 Andreas Färber
# check if we have madvise
2557 e78815a5 Andreas Färber
2558 e78815a5 Andreas Färber
madvise=no
2559 e78815a5 Andreas Färber
cat > $TMPC << EOF
2560 e78815a5 Andreas Färber
#include <sys/types.h>
2561 e78815a5 Andreas Färber
#include <sys/mman.h>
2562 832ce9c2 Scott Wood
#include <stddef.h>
2563 e78815a5 Andreas Färber
int main(void) { return madvise(NULL, 0, MADV_DONTNEED); }
2564 e78815a5 Andreas Färber
EOF
2565 e78815a5 Andreas Färber
if compile_prog "" "" ; then
2566 e78815a5 Andreas Färber
    madvise=yes
2567 e78815a5 Andreas Färber
fi
2568 e78815a5 Andreas Färber
2569 e78815a5 Andreas Färber
##########################################
2570 e78815a5 Andreas Färber
# check if we have posix_madvise
2571 e78815a5 Andreas Färber
2572 e78815a5 Andreas Färber
posix_madvise=no
2573 e78815a5 Andreas Färber
cat > $TMPC << EOF
2574 e78815a5 Andreas Färber
#include <sys/mman.h>
2575 832ce9c2 Scott Wood
#include <stddef.h>
2576 e78815a5 Andreas Färber
int main(void) { return posix_madvise(NULL, 0, POSIX_MADV_DONTNEED); }
2577 e78815a5 Andreas Färber
EOF
2578 e78815a5 Andreas Färber
if compile_prog "" "" ; then
2579 e78815a5 Andreas Färber
    posix_madvise=yes
2580 e78815a5 Andreas Färber
fi
2581 e78815a5 Andreas Färber
2582 e78815a5 Andreas Färber
##########################################
2583 94a420b1 Stefan Hajnoczi
# check if trace backend exists
2584 94a420b1 Stefan Hajnoczi
2585 4c3b5a48 Blue Swirl
sh "$source_path/scripts/tracetool" "--$trace_backend" --check-backend > /dev/null 2> /dev/null
2586 94a420b1 Stefan Hajnoczi
if test "$?" -ne 0 ; then
2587 94a420b1 Stefan Hajnoczi
  echo
2588 94a420b1 Stefan Hajnoczi
  echo "Error: invalid trace backend"
2589 94a420b1 Stefan Hajnoczi
  echo "Please choose a supported trace backend."
2590 94a420b1 Stefan Hajnoczi
  echo
2591 94a420b1 Stefan Hajnoczi
  exit 1
2592 94a420b1 Stefan Hajnoczi
fi
2593 94a420b1 Stefan Hajnoczi
2594 7e24e92a Stefan Hajnoczi
##########################################
2595 7e24e92a Stefan Hajnoczi
# For 'ust' backend, test if ust headers are present
2596 7e24e92a Stefan Hajnoczi
if test "$trace_backend" = "ust"; then
2597 7e24e92a Stefan Hajnoczi
  cat > $TMPC << EOF
2598 7e24e92a Stefan Hajnoczi
#include <ust/tracepoint.h>
2599 7e24e92a Stefan Hajnoczi
#include <ust/marker.h>
2600 7e24e92a Stefan Hajnoczi
int main(void) { return 0; }
2601 7e24e92a Stefan Hajnoczi
EOF
2602 7e24e92a Stefan Hajnoczi
  if compile_prog "" "" ; then
2603 7e24e92a Stefan Hajnoczi
    LIBS="-lust $LIBS"
2604 7e24e92a Stefan Hajnoczi
  else
2605 7e24e92a Stefan Hajnoczi
    echo
2606 7e24e92a Stefan Hajnoczi
    echo "Error: Trace backend 'ust' missing libust header files"
2607 7e24e92a Stefan Hajnoczi
    echo
2608 7e24e92a Stefan Hajnoczi
    exit 1
2609 7e24e92a Stefan Hajnoczi
  fi
2610 7e24e92a Stefan Hajnoczi
fi
2611 b3d08c02 Daniel P. Berrange
2612 b3d08c02 Daniel P. Berrange
##########################################
2613 b3d08c02 Daniel P. Berrange
# For 'dtrace' backend, test if 'dtrace' command is present
2614 b3d08c02 Daniel P. Berrange
if test "$trace_backend" = "dtrace"; then
2615 b3d08c02 Daniel P. Berrange
  if ! has 'dtrace' ; then
2616 b3d08c02 Daniel P. Berrange
    echo
2617 b3d08c02 Daniel P. Berrange
    echo "Error: dtrace command is not found in PATH $PATH"
2618 b3d08c02 Daniel P. Berrange
    echo
2619 b3d08c02 Daniel P. Berrange
    exit 1
2620 b3d08c02 Daniel P. Berrange
  fi
2621 c276b17d Daniel P. Berrange
  trace_backend_stap="no"
2622 c276b17d Daniel P. Berrange
  if has 'stap' ; then
2623 c276b17d Daniel P. Berrange
    trace_backend_stap="yes"
2624 c276b17d Daniel P. Berrange
  fi
2625 b3d08c02 Daniel P. Berrange
fi
2626 b3d08c02 Daniel P. Berrange
2627 7e24e92a Stefan Hajnoczi
##########################################
2628 023367e6 Wolfgang Mauerer
# __sync_fetch_and_and requires at least -march=i486. Many toolchains
2629 023367e6 Wolfgang Mauerer
# use i686 as default anyway, but for those that don't, an explicit
2630 023367e6 Wolfgang Mauerer
# specification is necessary
2631 1ba16968 Stefan Weil
if test "$vhost_net" = "yes" && test "$cpu" = "i386"; then
2632 023367e6 Wolfgang Mauerer
  cat > $TMPC << EOF
2633 023367e6 Wolfgang Mauerer
int sfaa(unsigned *ptr)
2634 023367e6 Wolfgang Mauerer
{
2635 023367e6 Wolfgang Mauerer
  return __sync_fetch_and_and(ptr, 0);
2636 023367e6 Wolfgang Mauerer
}
2637 023367e6 Wolfgang Mauerer
2638 023367e6 Wolfgang Mauerer
int main(int argc, char **argv)
2639 023367e6 Wolfgang Mauerer
{
2640 023367e6 Wolfgang Mauerer
  int val = 42;
2641 023367e6 Wolfgang Mauerer
  sfaa(&val);
2642 023367e6 Wolfgang Mauerer
  return val;
2643 023367e6 Wolfgang Mauerer
}
2644 023367e6 Wolfgang Mauerer
EOF
2645 023367e6 Wolfgang Mauerer
  if ! compile_prog "" "" ; then
2646 023367e6 Wolfgang Mauerer
    CFLAGS+="-march=i486"
2647 023367e6 Wolfgang Mauerer
  fi
2648 023367e6 Wolfgang Mauerer
fi
2649 023367e6 Wolfgang Mauerer
2650 023367e6 Wolfgang Mauerer
##########################################
2651 d0e2fce5 Aneesh Kumar K.V
# check if we have makecontext
2652 d0e2fce5 Aneesh Kumar K.V
2653 d0e2fce5 Aneesh Kumar K.V
ucontext_coroutine=no
2654 d0e2fce5 Aneesh Kumar K.V
if test "$darwin" != "yes"; then
2655 d0e2fce5 Aneesh Kumar K.V
  cat > $TMPC << EOF
2656 d0e2fce5 Aneesh Kumar K.V
#include <ucontext.h>
2657 d0e2fce5 Aneesh Kumar K.V
int main(void) { makecontext(0, 0, 0); }
2658 d0e2fce5 Aneesh Kumar K.V
EOF
2659 d0e2fce5 Aneesh Kumar K.V
  if compile_prog "" "" ; then
2660 d0e2fce5 Aneesh Kumar K.V
      ucontext_coroutine=yes
2661 d0e2fce5 Aneesh Kumar K.V
  fi
2662 d0e2fce5 Aneesh Kumar K.V
fi
2663 d0e2fce5 Aneesh Kumar K.V
2664 d0e2fce5 Aneesh Kumar K.V
##########################################
2665 d2042378 Aneesh Kumar K.V
# check if we have open_by_handle_at
2666 d2042378 Aneesh Kumar K.V
2667 d2042378 Aneesh Kumar K.V
open_by_hande_at=no
2668 d2042378 Aneesh Kumar K.V
cat > $TMPC << EOF
2669 d2042378 Aneesh Kumar K.V
#include <fcntl.h>
2670 15329e83 Aneesh Kumar K.V
int main(void) { struct file_handle fh; open_by_handle_at(0, &fh, 0); }
2671 d2042378 Aneesh Kumar K.V
EOF
2672 d2042378 Aneesh Kumar K.V
if compile_prog "" "" ; then
2673 d2042378 Aneesh Kumar K.V
    open_by_handle_at=yes
2674 d2042378 Aneesh Kumar K.V
fi
2675 d2042378 Aneesh Kumar K.V
2676 e06a765e Harsh Prateek Bora
########################################
2677 e06a765e Harsh Prateek Bora
# check if we have linux/magic.h
2678 e06a765e Harsh Prateek Bora
2679 e06a765e Harsh Prateek Bora
linux_magic_h=no
2680 e06a765e Harsh Prateek Bora
cat > $TMPC << EOF
2681 e06a765e Harsh Prateek Bora
#include <linux/magic.h>
2682 e06a765e Harsh Prateek Bora
int main(void) {
2683 e06a765e Harsh Prateek Bora
}
2684 e06a765e Harsh Prateek Bora
EOF
2685 e06a765e Harsh Prateek Bora
if compile_prog "" "" ; then
2686 e06a765e Harsh Prateek Bora
    linux_magic_h=yes
2687 e06a765e Harsh Prateek Bora
fi
2688 e06a765e Harsh Prateek Bora
2689 d2042378 Aneesh Kumar K.V
##########################################
2690 e86ecd4b Juan Quintela
# End of CC checks
2691 e86ecd4b Juan Quintela
# After here, no more $cc or $ld runs
2692 e86ecd4b Juan Quintela
2693 e86ecd4b Juan Quintela
if test "$debug" = "no" ; then
2694 1156c669 Juan Quintela
  CFLAGS="-O2 $CFLAGS"
2695 e86ecd4b Juan Quintela
fi
2696 a316e378 Juan Quintela
2697 e86ecd4b Juan Quintela
# Consult white-list to determine whether to enable werror
2698 e86ecd4b Juan Quintela
# by default.  Only enable by default for git builds
2699 20ff6c80 Anthony Liguori
z_version=`cut -f3 -d. $source_path/VERSION`
2700 20ff6c80 Anthony Liguori
2701 e86ecd4b Juan Quintela
if test -z "$werror" ; then
2702 e86ecd4b Juan Quintela
    if test "$z_version" = "50" -a \
2703 e86ecd4b Juan Quintela
        "$linux" = "yes" ; then
2704 e86ecd4b Juan Quintela
        werror="yes"
2705 e86ecd4b Juan Quintela
    else
2706 e86ecd4b Juan Quintela
        werror="no"
2707 e86ecd4b Juan Quintela
    fi
2708 e86ecd4b Juan Quintela
fi
2709 e86ecd4b Juan Quintela
2710 20ff6c80 Anthony Liguori
# Disable zero malloc errors for official releases unless explicitly told to
2711 20ff6c80 Anthony Liguori
# enable/disable
2712 20ff6c80 Anthony Liguori
if test -z "$zero_malloc" ; then
2713 20ff6c80 Anthony Liguori
    if test "$z_version" = "50" ; then
2714 20ff6c80 Anthony Liguori
	zero_malloc="no"
2715 20ff6c80 Anthony Liguori
    else
2716 20ff6c80 Anthony Liguori
	zero_malloc="yes"
2717 20ff6c80 Anthony Liguori
    fi
2718 20ff6c80 Anthony Liguori
fi
2719 20ff6c80 Anthony Liguori
2720 e86ecd4b Juan Quintela
if test "$werror" = "yes" ; then
2721 a558ee17 Juan Quintela
    QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
2722 e86ecd4b Juan Quintela
fi
2723 e86ecd4b Juan Quintela
2724 e86ecd4b Juan Quintela
if test "$solaris" = "no" ; then
2725 e86ecd4b Juan Quintela
    if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
2726 1156c669 Juan Quintela
        LDFLAGS="-Wl,--warn-common $LDFLAGS"
2727 e86ecd4b Juan Quintela
    fi
2728 e86ecd4b Juan Quintela
fi
2729 e86ecd4b Juan Quintela
2730 952afb71 Blue Swirl
# Use ASLR, no-SEH and DEP if available
2731 952afb71 Blue Swirl
if test "$mingw32" = "yes" ; then
2732 952afb71 Blue Swirl
    for flag in --dynamicbase --no-seh --nxcompat; do
2733 952afb71 Blue Swirl
        if $ld --help 2>/dev/null | grep ".$flag" >/dev/null 2>/dev/null ; then
2734 952afb71 Blue Swirl
            LDFLAGS="-Wl,$flag $LDFLAGS"
2735 952afb71 Blue Swirl
        fi
2736 952afb71 Blue Swirl
    done
2737 952afb71 Blue Swirl
fi
2738 952afb71 Blue Swirl
2739 190e9c59 Paolo Bonzini
confdir=$sysconfdir$confsuffix
2740 e7b45cc4 Paolo Bonzini
2741 ca35f780 Paolo Bonzini
tools=
2742 ca35f780 Paolo Bonzini
if test "$softmmu" = yes ; then
2743 ca35f780 Paolo Bonzini
  tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
2744 ca35f780 Paolo Bonzini
  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
2745 ca35f780 Paolo Bonzini
      tools="qemu-nbd\$(EXESUF) $tools"
2746 d138cee9 Michael Roth
    if [ "$guest_agent" = "yes" ]; then
2747 48ff7a62 Michael Roth
      tools="qemu-ga\$(EXESUF) $tools"
2748 d138cee9 Michael Roth
    fi
2749 ca35f780 Paolo Bonzini
    if [ "$check_utests" = "yes" ]; then
2750 fffbeb75 Gerd Hoffmann
      checks="check-qint check-qstring check-qdict check-qlist"
2751 695833bc Gerd Hoffmann
      checks="check-qfloat check-qjson test-coroutine $checks"
2752 ca35f780 Paolo Bonzini
    fi
2753 ca35f780 Paolo Bonzini
  fi
2754 ca35f780 Paolo Bonzini
fi
2755 ca35f780 Paolo Bonzini
2756 ca35f780 Paolo Bonzini
# Mac OS X ships with a broken assembler
2757 ca35f780 Paolo Bonzini
roms=
2758 ca35f780 Paolo Bonzini
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
2759 ca35f780 Paolo Bonzini
        "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
2760 ca35f780 Paolo Bonzini
        "$softmmu" = yes ; then
2761 ca35f780 Paolo Bonzini
  roms="optionrom"
2762 ca35f780 Paolo Bonzini
fi
2763 d0384d1d Andreas Färber
if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then
2764 39ac8455 David Gibson
  roms="$roms spapr-rtas"
2765 39ac8455 David Gibson
fi
2766 ca35f780 Paolo Bonzini
2767 43ce4dfe bellard
echo "Install prefix    $prefix"
2768 f2b9e1e3 Paolo Bonzini
echo "BIOS directory    `eval echo $datadir`"
2769 f2b9e1e3 Paolo Bonzini
echo "binary directory  `eval echo $bindir`"
2770 3aa5d2be Alon Levy
echo "library directory `eval echo $libdir`"
2771 0f94d6da Alon Levy
echo "include directory `eval echo $includedir`"
2772 1c0fd160 Aurelien Jarno
echo "config directory  `eval echo $sysconfdir`"
2773 11d9f695 bellard
if test "$mingw32" = "no" ; then
2774 f2b9e1e3 Paolo Bonzini
echo "Manual directory  `eval echo $mandir`"
2775 43ce4dfe bellard
echo "ELF interp prefix $interp_prefix"
2776 11d9f695 bellard
fi
2777 5a67135a bellard
echo "Source path       $source_path"
2778 43ce4dfe bellard
echo "C compiler        $cc"
2779 83469015 bellard
echo "Host C compiler   $host_cc"
2780 0c439cbf Juan Quintela
echo "CFLAGS            $CFLAGS"
2781 a558ee17 Juan Quintela
echo "QEMU_CFLAGS       $QEMU_CFLAGS"
2782 0c439cbf Juan Quintela
echo "LDFLAGS           $LDFLAGS"
2783 43ce4dfe bellard
echo "make              $make"
2784 6a882643 pbrook
echo "install           $install"
2785 c886edfb Blue Swirl
echo "python            $python"
2786 e2d8830e Brad
if test "$slirp" = "yes" ; then
2787 e2d8830e Brad
    echo "smbd              $smbd"
2788 e2d8830e Brad
fi
2789 43ce4dfe bellard
echo "host CPU          $cpu"
2790 de83cd02 bellard
echo "host big endian   $bigendian"
2791 97a847bc bellard
echo "target list       $target_list"
2792 ade25b0d aurel32
echo "tcg debug enabled $debug_tcg"
2793 b4475aa2 Luiz Capitulino
echo "Mon debug enabled $debug_mon"
2794 43ce4dfe bellard
echo "gprof enabled     $gprof"
2795 03b4fe7d aliguori
echo "sparse enabled    $sparse"
2796 1625af87 aliguori
echo "strip binaries    $strip_opt"
2797 05c2a3e7 bellard
echo "profiler          $profiler"
2798 43ce4dfe bellard
echo "static build      $static"
2799 85aa5189 bellard
echo "-Werror enabled   $werror"
2800 5b0753e0 bellard
if test "$darwin" = "yes" ; then
2801 5b0753e0 bellard
    echo "Cocoa support     $cocoa"
2802 5b0753e0 bellard
fi
2803 97a847bc bellard
echo "SDL support       $sdl"
2804 4d3b6f6e balrog
echo "curses support    $curses"
2805 769ce76d Alexander Graf
echo "curl support      $curl"
2806 5495ed11 Luiz Capitulino
echo "check support     $check_utests"
2807 67b915a5 bellard
echo "mingw32 support   $mingw32"
2808 0c58ac1c malc
echo "Audio drivers     $audio_drv_list"
2809 0c58ac1c malc
echo "Extra audio cards $audio_card_list"
2810 eb852011 Markus Armbruster
echo "Block whitelist   $block_drv_whitelist"
2811 8ff9cbf7 malc
echo "Mixer emulation   $mixemu"
2812 821601ea Jes Sorensen
echo "VNC support       $vnc"
2813 821601ea Jes Sorensen
if test "$vnc" = "yes" ; then
2814 821601ea Jes Sorensen
    echo "VNC TLS support   $vnc_tls"
2815 821601ea Jes Sorensen
    echo "VNC SASL support  $vnc_sasl"
2816 821601ea Jes Sorensen
    echo "VNC JPEG support  $vnc_jpeg"
2817 821601ea Jes Sorensen
    echo "VNC PNG support   $vnc_png"
2818 821601ea Jes Sorensen
    echo "VNC thread        $vnc_thread"
2819 821601ea Jes Sorensen
fi
2820 3142255c blueswir1
if test -n "$sparc_cpu"; then
2821 3142255c blueswir1
    echo "Target Sparc Arch $sparc_cpu"
2822 3142255c blueswir1
fi
2823 e37630ca aliguori
echo "xen support       $xen"
2824 2e4d9fb1 aurel32
echo "brlapi support    $brlapi"
2825 a20a6f46 Juan Quintela
echo "bluez  support    $bluez"
2826 a25dba17 Juan Quintela
echo "Documentation     $docs"
2827 c5937220 pbrook
[ ! -z "$uname_release" ] && \
2828 c5937220 pbrook
echo "uname -r          $uname_release"
2829 bd0c5661 pbrook
echo "NPTL support      $nptl"
2830 379f6698 Paul Brook
echo "GUEST_BASE        $guest_base"
2831 40d6444e Avi Kivity
echo "PIE               $pie"
2832 8a16d273 ths
echo "vde support       $vde"
2833 5c6c3a6c Christoph Hellwig
echo "Linux AIO support $linux_aio"
2834 758e8e38 Venkateswararao Jujjuri (JV)
echo "ATTR/XATTR support $attr"
2835 77755340 ths
echo "Install blobs     $blobs"
2836 b31a0277 Juan Quintela
echo "KVM support       $kvm"
2837 9195b2c2 Stefan Weil
echo "TCG interpreter   $tcg_interpreter"
2838 f652e6af aurel32
echo "fdt support       $fdt"
2839 ceb42de8 aliguori
echo "preadv support    $preadv"
2840 5f6b9e8f Blue Swirl
echo "fdatasync         $fdatasync"
2841 e78815a5 Andreas Färber
echo "madvise           $madvise"
2842 e78815a5 Andreas Färber
echo "posix_madvise     $posix_madvise"
2843 ee682d27 Stefan Weil
echo "uuid support      $uuid"
2844 d5970055 Michael S. Tsirkin
echo "vhost-net support $vhost_net"
2845 94a420b1 Stefan Hajnoczi
echo "Trace backend     $trace_backend"
2846 9410b56c Prerna Saxena
echo "Trace output file $trace_file-<pid>"
2847 cd4ec0b4 Gerd Hoffmann
echo "spice support     $spice"
2848 f27aaf4b Christian Brunner
echo "rbd support       $rbd"
2849 dce512de Christoph Hellwig
echo "xfsctl support    $xfs"
2850 111a38b0 Robert Relyea
echo "nss used          $smartcard_nss"
2851 69354a83 Hans de Goede
echo "usb net redir     $usb_redir"
2852 20ff075b Michael Walle
echo "OpenGL support    $opengl"
2853 c589b249 Ronnie Sahlberg
echo "libiscsi support  $libiscsi"
2854 d138cee9 Michael Roth
echo "build guest agent $guest_agent"
2855 67b915a5 bellard
2856 1ba16968 Stefan Weil
if test "$sdl_too_old" = "yes"; then
2857 24b55b96 bellard
echo "-> Your SDL version is too old - please upgrade to have SDL support"
2858 7c1f25b4 bellard
fi
2859 7d13299d bellard
2860 98ec69ac Juan Quintela
config_host_mak="config-host.mak"
2861 4bf6b55b Juan Quintela
config_host_ld="config-host.ld"
2862 98ec69ac Juan Quintela
2863 98ec69ac Juan Quintela
echo "# Automatically generated by configure - do not modify" > $config_host_mak
2864 98ec69ac Juan Quintela
printf "# Configured with:" >> $config_host_mak
2865 98ec69ac Juan Quintela
printf " '%s'" "$0" "$@" >> $config_host_mak
2866 98ec69ac Juan Quintela
echo >> $config_host_mak
2867 98ec69ac Juan Quintela
2868 e6c3b0f7 Paolo Bonzini
echo all: >> $config_host_mak
2869 99d7cc75 Paolo Bonzini
echo "prefix=$prefix" >> $config_host_mak
2870 99d7cc75 Paolo Bonzini
echo "bindir=$bindir" >> $config_host_mak
2871 3aa5d2be Alon Levy
echo "libdir=$libdir" >> $config_host_mak
2872 0f94d6da Alon Levy
echo "includedir=$includedir" >> $config_host_mak
2873 99d7cc75 Paolo Bonzini
echo "mandir=$mandir" >> $config_host_mak
2874 99d7cc75 Paolo Bonzini
echo "datadir=$datadir" >> $config_host_mak
2875 99d7cc75 Paolo Bonzini
echo "sysconfdir=$sysconfdir" >> $config_host_mak
2876 99d7cc75 Paolo Bonzini
echo "docdir=$docdir" >> $config_host_mak
2877 1dabe05c Paolo Bonzini
echo "confdir=$confdir" >> $config_host_mak
2878 804edf29 Juan Quintela
2879 2408a527 aurel32
case "$cpu" in
2880 21d89f84 Peter Maydell
  i386|x86_64|alpha|arm|cris|hppa|ia64|lm32|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64|unicore32)
2881 e0da9dd3 Juan Quintela
    ARCH=$cpu
2882 2408a527 aurel32
  ;;
2883 9195b2c2 Stefan Weil
  *)
2884 9195b2c2 Stefan Weil
    if test "$tcg_interpreter" = "yes" ; then
2885 9195b2c2 Stefan Weil
        echo "Unsupported CPU = $cpu, will use TCG with TCI (experimental)"
2886 9195b2c2 Stefan Weil
        ARCH=tci
2887 9195b2c2 Stefan Weil
    else
2888 9195b2c2 Stefan Weil
        echo "Unsupported CPU = $cpu, try --enable-tcg-interpreter"
2889 9195b2c2 Stefan Weil
        exit 1
2890 9195b2c2 Stefan Weil
    fi
2891 9195b2c2 Stefan Weil
  ;;
2892 2408a527 aurel32
esac
2893 98ec69ac Juan Quintela
echo "ARCH=$ARCH" >> $config_host_mak
2894 f8393946 aurel32
if test "$debug_tcg" = "yes" ; then
2895 2358a494 Juan Quintela
  echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
2896 f8393946 aurel32
fi
2897 b4475aa2 Luiz Capitulino
if test "$debug_mon" = "yes" ; then
2898 b4475aa2 Luiz Capitulino
  echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
2899 b4475aa2 Luiz Capitulino
fi
2900 f3d08ee6 Paul Brook
if test "$debug" = "yes" ; then
2901 2358a494 Juan Quintela
  echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
2902 f3d08ee6 Paul Brook
fi
2903 1625af87 aliguori
if test "$strip_opt" = "yes" ; then
2904 52ba784d Hollis Blanchard
  echo "STRIP=${strip}" >> $config_host_mak
2905 1625af87 aliguori
fi
2906 7d13299d bellard
if test "$bigendian" = "yes" ; then
2907 e2542fe2 Juan Quintela
  echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
2908 97a847bc bellard
fi
2909 2358a494 Juan Quintela
echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
2910 67b915a5 bellard
if test "$mingw32" = "yes" ; then
2911 98ec69ac Juan Quintela
  echo "CONFIG_WIN32=y" >> $config_host_mak
2912 9fe6de94 Blue Swirl
  rc_version=`cat $source_path/VERSION`
2913 9fe6de94 Blue Swirl
  version_major=${rc_version%%.*}
2914 9fe6de94 Blue Swirl
  rc_version=${rc_version#*.}
2915 9fe6de94 Blue Swirl
  version_minor=${rc_version%%.*}
2916 9fe6de94 Blue Swirl
  rc_version=${rc_version#*.}
2917 9fe6de94 Blue Swirl
  version_subminor=${rc_version%%.*}
2918 9fe6de94 Blue Swirl
  version_micro=0
2919 9fe6de94 Blue Swirl
  echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
2920 9fe6de94 Blue Swirl
  echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
2921 210fa556 pbrook
else
2922 35f4df27 Juan Quintela
  echo "CONFIG_POSIX=y" >> $config_host_mak
2923 dffcb71c Mark McLoughlin
fi
2924 dffcb71c Mark McLoughlin
2925 dffcb71c Mark McLoughlin
if test "$linux" = "yes" ; then
2926 dffcb71c Mark McLoughlin
  echo "CONFIG_LINUX=y" >> $config_host_mak
2927 67b915a5 bellard
fi
2928 128ab2ff blueswir1
2929 83fb7adf bellard
if test "$darwin" = "yes" ; then
2930 98ec69ac Juan Quintela
  echo "CONFIG_DARWIN=y" >> $config_host_mak
2931 83fb7adf bellard
fi
2932 b29fe3ed malc
2933 b29fe3ed malc
if test "$aix" = "yes" ; then
2934 98ec69ac Juan Quintela
  echo "CONFIG_AIX=y" >> $config_host_mak
2935 b29fe3ed malc
fi
2936 b29fe3ed malc
2937 ec530c81 bellard
if test "$solaris" = "yes" ; then
2938 98ec69ac Juan Quintela
  echo "CONFIG_SOLARIS=y" >> $config_host_mak
2939 2358a494 Juan Quintela
  echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
2940 0475a5ca ths
  if test "$needs_libsunmath" = "yes" ; then
2941 75b5a697 Juan Quintela
    echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
2942 0475a5ca ths
  fi
2943 ec530c81 bellard
fi
2944 179cf400 Andreas Färber
if test "$haiku" = "yes" ; then
2945 179cf400 Andreas Färber
  echo "CONFIG_HAIKU=y" >> $config_host_mak
2946 179cf400 Andreas Färber
fi
2947 97a847bc bellard
if test "$static" = "yes" ; then
2948 98ec69ac Juan Quintela
  echo "CONFIG_STATIC=y" >> $config_host_mak
2949 7d13299d bellard
fi
2950 1ba16968 Stefan Weil
if test "$profiler" = "yes" ; then
2951 2358a494 Juan Quintela
  echo "CONFIG_PROFILER=y" >> $config_host_mak
2952 05c2a3e7 bellard
fi
2953 c20709aa bellard
if test "$slirp" = "yes" ; then
2954 98ec69ac Juan Quintela
  echo "CONFIG_SLIRP=y" >> $config_host_mak
2955 e2d8830e Brad
  echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak
2956 f9728943 Paolo Bonzini
  QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
2957 c20709aa bellard
fi
2958 8a16d273 ths
if test "$vde" = "yes" ; then
2959 98ec69ac Juan Quintela
  echo "CONFIG_VDE=y" >> $config_host_mak
2960 8a16d273 ths
fi
2961 0c58ac1c malc
for card in $audio_card_list; do
2962 f6e5889e pbrook
    def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
2963 98ec69ac Juan Quintela
    echo "$def=y" >> $config_host_mak
2964 0c58ac1c malc
done
2965 2358a494 Juan Quintela
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
2966 0c58ac1c malc
for drv in $audio_drv_list; do
2967 f6e5889e pbrook
    def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
2968 98ec69ac Juan Quintela
    echo "$def=y" >> $config_host_mak
2969 923e4521 malc
    if test "$drv" = "fmod"; then
2970 7aac6cb1 Juan Quintela
        echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
2971 0c58ac1c malc
    fi
2972 0c58ac1c malc
done
2973 67f86e8e Juan Quintela
if test "$audio_pt_int" = "yes" ; then
2974 67f86e8e Juan Quintela
  echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
2975 67f86e8e Juan Quintela
fi
2976 d5631638 malc
if test "$audio_win_int" = "yes" ; then
2977 d5631638 malc
  echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
2978 d5631638 malc
fi
2979 eb852011 Markus Armbruster
echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
2980 8ff9cbf7 malc
if test "$mixemu" = "yes" ; then
2981 98ec69ac Juan Quintela
  echo "CONFIG_MIXEMU=y" >> $config_host_mak
2982 8ff9cbf7 malc
fi
2983 821601ea Jes Sorensen
if test "$vnc" = "yes" ; then
2984 821601ea Jes Sorensen
  echo "CONFIG_VNC=y" >> $config_host_mak
2985 821601ea Jes Sorensen
fi
2986 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
2987 98ec69ac Juan Quintela
  echo "CONFIG_VNC_TLS=y" >> $config_host_mak
2988 525061bf Juan Quintela
  echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
2989 8d5d2d4c ths
fi
2990 2f9606b3 aliguori
if test "$vnc_sasl" = "yes" ; then
2991 98ec69ac Juan Quintela
  echo "CONFIG_VNC_SASL=y" >> $config_host_mak
2992 60ddf533 Juan Quintela
  echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
2993 2f9606b3 aliguori
fi
2994 821601ea Jes Sorensen
if test "$vnc_jpeg" = "yes" ; then
2995 2f6f5c7a Corentin Chary
  echo "CONFIG_VNC_JPEG=y" >> $config_host_mak
2996 2f6f5c7a Corentin Chary
  echo "VNC_JPEG_CFLAGS=$vnc_jpeg_cflags" >> $config_host_mak
2997 2f6f5c7a Corentin Chary
fi
2998 821601ea Jes Sorensen
if test "$vnc_png" = "yes" ; then
2999 efe556ad Corentin Chary
  echo "CONFIG_VNC_PNG=y" >> $config_host_mak
3000 efe556ad Corentin Chary
  echo "VNC_PNG_CFLAGS=$vnc_png_cflags" >> $config_host_mak
3001 efe556ad Corentin Chary
fi
3002 821601ea Jes Sorensen
if test "$vnc_thread" = "yes" ; then
3003 bd023f95 Corentin Chary
  echo "CONFIG_VNC_THREAD=y" >> $config_host_mak
3004 bd023f95 Corentin Chary
fi
3005 76655d6d aliguori
if test "$fnmatch" = "yes" ; then
3006 2358a494 Juan Quintela
  echo "CONFIG_FNMATCH=y" >> $config_host_mak
3007 76655d6d aliguori
fi
3008 ee682d27 Stefan Weil
if test "$uuid" = "yes" ; then
3009 ee682d27 Stefan Weil
  echo "CONFIG_UUID=y" >> $config_host_mak
3010 ee682d27 Stefan Weil
fi
3011 dce512de Christoph Hellwig
if test "$xfs" = "yes" ; then
3012 dce512de Christoph Hellwig
  echo "CONFIG_XFS=y" >> $config_host_mak
3013 dce512de Christoph Hellwig
fi
3014 b1a550a0 pbrook
qemu_version=`head $source_path/VERSION`
3015 98ec69ac Juan Quintela
echo "VERSION=$qemu_version" >>$config_host_mak
3016 2358a494 Juan Quintela
echo "PKGVERSION=$pkgversion" >>$config_host_mak
3017 98ec69ac Juan Quintela
echo "SRC_PATH=$source_path" >> $config_host_mak
3018 98ec69ac Juan Quintela
echo "TARGET_DIRS=$target_list" >> $config_host_mak
3019 a25dba17 Juan Quintela
if [ "$docs" = "yes" ] ; then
3020 98ec69ac Juan Quintela
  echo "BUILD_DOCS=yes" >> $config_host_mak
3021 cc8ae6de pbrook
fi
3022 1ac88f28 Juan Quintela
if test "$sdl" = "yes" ; then
3023 98ec69ac Juan Quintela
  echo "CONFIG_SDL=y" >> $config_host_mak
3024 1ac88f28 Juan Quintela
  echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
3025 49ecc3fa bellard
fi
3026 49ecc3fa bellard
if test "$cocoa" = "yes" ; then
3027 98ec69ac Juan Quintela
  echo "CONFIG_COCOA=y" >> $config_host_mak
3028 4d3b6f6e balrog
fi
3029 4d3b6f6e balrog
if test "$curses" = "yes" ; then
3030 98ec69ac Juan Quintela
  echo "CONFIG_CURSES=y" >> $config_host_mak
3031 49ecc3fa bellard
fi
3032 3b3f24ad aurel32
if test "$atfile" = "yes" ; then
3033 2358a494 Juan Quintela
  echo "CONFIG_ATFILE=y" >> $config_host_mak
3034 3b3f24ad aurel32
fi
3035 ebc996f3 Riku Voipio
if test "$utimens" = "yes" ; then
3036 2358a494 Juan Quintela
  echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
3037 ebc996f3 Riku Voipio
fi
3038 099d6b0f Riku Voipio
if test "$pipe2" = "yes" ; then
3039 2358a494 Juan Quintela
  echo "CONFIG_PIPE2=y" >> $config_host_mak
3040 099d6b0f Riku Voipio
fi
3041 40ff6d7e Kevin Wolf
if test "$accept4" = "yes" ; then
3042 40ff6d7e Kevin Wolf
  echo "CONFIG_ACCEPT4=y" >> $config_host_mak
3043 40ff6d7e Kevin Wolf
fi
3044 3ce34dfb vibisreenivasan
if test "$splice" = "yes" ; then
3045 2358a494 Juan Quintela
  echo "CONFIG_SPLICE=y" >> $config_host_mak
3046 3ce34dfb vibisreenivasan
fi
3047 c2882b96 Riku Voipio
if test "$eventfd" = "yes" ; then
3048 c2882b96 Riku Voipio
  echo "CONFIG_EVENTFD=y" >> $config_host_mak
3049 c2882b96 Riku Voipio
fi
3050 d0927938 Ulrich Hecht
if test "$fallocate" = "yes" ; then
3051 d0927938 Ulrich Hecht
  echo "CONFIG_FALLOCATE=y" >> $config_host_mak
3052 d0927938 Ulrich Hecht
fi
3053 c727f47d Peter Maydell
if test "$sync_file_range" = "yes" ; then
3054 c727f47d Peter Maydell
  echo "CONFIG_SYNC_FILE_RANGE=y" >> $config_host_mak
3055 c727f47d Peter Maydell
fi
3056 dace20dc Peter Maydell
if test "$fiemap" = "yes" ; then
3057 dace20dc Peter Maydell
  echo "CONFIG_FIEMAP=y" >> $config_host_mak
3058 dace20dc Peter Maydell
fi
3059 d0927938 Ulrich Hecht
if test "$dup3" = "yes" ; then
3060 d0927938 Ulrich Hecht
  echo "CONFIG_DUP3=y" >> $config_host_mak
3061 d0927938 Ulrich Hecht
fi
3062 3b6edd16 Peter Maydell
if test "$epoll" = "yes" ; then
3063 3b6edd16 Peter Maydell
  echo "CONFIG_EPOLL=y" >> $config_host_mak
3064 3b6edd16 Peter Maydell
fi
3065 3b6edd16 Peter Maydell
if test "$epoll_create1" = "yes" ; then
3066 3b6edd16 Peter Maydell
  echo "CONFIG_EPOLL_CREATE1=y" >> $config_host_mak
3067 3b6edd16 Peter Maydell
fi
3068 3b6edd16 Peter Maydell
if test "$epoll_pwait" = "yes" ; then
3069 3b6edd16 Peter Maydell
  echo "CONFIG_EPOLL_PWAIT=y" >> $config_host_mak
3070 3b6edd16 Peter Maydell
fi
3071 3b3f24ad aurel32
if test "$inotify" = "yes" ; then
3072 2358a494 Juan Quintela
  echo "CONFIG_INOTIFY=y" >> $config_host_mak
3073 3b3f24ad aurel32
fi
3074 c05c7a73 Riku Voipio
if test "$inotify1" = "yes" ; then
3075 c05c7a73 Riku Voipio
  echo "CONFIG_INOTIFY1=y" >> $config_host_mak
3076 c05c7a73 Riku Voipio
fi
3077 6ae9a1f4 Juan Quintela
if test "$byteswap_h" = "yes" ; then
3078 6ae9a1f4 Juan Quintela
  echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
3079 6ae9a1f4 Juan Quintela
fi
3080 6ae9a1f4 Juan Quintela
if test "$bswap_h" = "yes" ; then
3081 6ae9a1f4 Juan Quintela
  echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
3082 6ae9a1f4 Juan Quintela
fi
3083 769ce76d Alexander Graf
if test "$curl" = "yes" ; then
3084 98ec69ac Juan Quintela
  echo "CONFIG_CURL=y" >> $config_host_mak
3085 b1d5a277 Juan Quintela
  echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
3086 769ce76d Alexander Graf
fi
3087 2e4d9fb1 aurel32
if test "$brlapi" = "yes" ; then
3088 98ec69ac Juan Quintela
  echo "CONFIG_BRLAPI=y" >> $config_host_mak
3089 2e4d9fb1 aurel32
fi
3090 fb599c9a balrog
if test "$bluez" = "yes" ; then
3091 98ec69ac Juan Quintela
  echo "CONFIG_BLUEZ=y" >> $config_host_mak
3092 ef7635ec Juan Quintela
  echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
3093 fb599c9a balrog
fi
3094 e18df141 Anthony Liguori
echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
3095 e37630ca aliguori
if test "$xen" = "yes" ; then
3096 6dbd588a Jan Kiszka
  echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
3097 d5b93ddf Anthony PERARD
  echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
3098 e37630ca aliguori
fi
3099 5c6c3a6c Christoph Hellwig
if test "$linux_aio" = "yes" ; then
3100 5c6c3a6c Christoph Hellwig
  echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
3101 5c6c3a6c Christoph Hellwig
fi
3102 758e8e38 Venkateswararao Jujjuri (JV)
if test "$attr" = "yes" ; then
3103 758e8e38 Venkateswararao Jujjuri (JV)
  echo "CONFIG_ATTR=y" >> $config_host_mak
3104 758e8e38 Venkateswararao Jujjuri (JV)
fi
3105 4f26f2b6 Avi Kivity
if test "$libattr" = "yes" ; then
3106 4f26f2b6 Avi Kivity
  echo "CONFIG_LIBATTR=y" >> $config_host_mak
3107 4f26f2b6 Avi Kivity
fi
3108 758e8e38 Venkateswararao Jujjuri (JV)
if test "$linux" = "yes" ; then
3109 758e8e38 Venkateswararao Jujjuri (JV)
  if test "$attr" = "yes" ; then
3110 758e8e38 Venkateswararao Jujjuri (JV)
    echo "CONFIG_VIRTFS=y" >> $config_host_mak
3111 758e8e38 Venkateswararao Jujjuri (JV)
  fi
3112 758e8e38 Venkateswararao Jujjuri (JV)
fi
3113 77755340 ths
if test "$blobs" = "yes" ; then
3114 98ec69ac Juan Quintela
  echo "INSTALL_BLOBS=yes" >> $config_host_mak
3115 77755340 ths
fi
3116 bf9298b9 aliguori
if test "$iovec" = "yes" ; then
3117 2358a494 Juan Quintela
  echo "CONFIG_IOVEC=y" >> $config_host_mak
3118 bf9298b9 aliguori
fi
3119 ceb42de8 aliguori
if test "$preadv" = "yes" ; then
3120 2358a494 Juan Quintela
  echo "CONFIG_PREADV=y" >> $config_host_mak
3121 ceb42de8 aliguori
fi
3122 f652e6af aurel32
if test "$fdt" = "yes" ; then
3123 3f0855b1 Juan Quintela
  echo "CONFIG_FDT=y" >> $config_host_mak
3124 f652e6af aurel32
fi
3125 dcc38d1c Marcelo Tosatti
if test "$signalfd" = "yes" ; then
3126 dcc38d1c Marcelo Tosatti
  echo "CONFIG_SIGNALFD=y" >> $config_host_mak
3127 dcc38d1c Marcelo Tosatti
fi
3128 9195b2c2 Stefan Weil
if test "$tcg_interpreter" = "yes" ; then
3129 9195b2c2 Stefan Weil
  echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
3130 9195b2c2 Stefan Weil
fi
3131 de5071c5 Blue Swirl
if test "$need_offsetof" = "yes" ; then
3132 de5071c5 Blue Swirl
  echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
3133 de5071c5 Blue Swirl
fi
3134 5f6b9e8f Blue Swirl
if test "$fdatasync" = "yes" ; then
3135 5f6b9e8f Blue Swirl
  echo "CONFIG_FDATASYNC=y" >> $config_host_mak
3136 5f6b9e8f Blue Swirl
fi
3137 e78815a5 Andreas Färber
if test "$madvise" = "yes" ; then
3138 e78815a5 Andreas Färber
  echo "CONFIG_MADVISE=y" >> $config_host_mak
3139 e78815a5 Andreas Färber
fi
3140 e78815a5 Andreas Färber
if test "$posix_madvise" = "yes" ; then
3141 e78815a5 Andreas Färber
  echo "CONFIG_POSIX_MADVISE=y" >> $config_host_mak
3142 e78815a5 Andreas Färber
fi
3143 97a847bc bellard
3144 cd4ec0b4 Gerd Hoffmann
if test "$spice" = "yes" ; then
3145 cd4ec0b4 Gerd Hoffmann
  echo "CONFIG_SPICE=y" >> $config_host_mak
3146 cd4ec0b4 Gerd Hoffmann
fi
3147 36707144 Alon Levy
3148 36707144 Alon Levy
if test "$smartcard" = "yes" ; then
3149 36707144 Alon Levy
  echo "CONFIG_SMARTCARD=y" >> $config_host_mak
3150 36707144 Alon Levy
fi
3151 cd4ec0b4 Gerd Hoffmann
3152 111a38b0 Robert Relyea
if test "$smartcard_nss" = "yes" ; then
3153 111a38b0 Robert Relyea
  echo "CONFIG_SMARTCARD_NSS=y" >> $config_host_mak
3154 111a38b0 Robert Relyea
fi
3155 111a38b0 Robert Relyea
3156 69354a83 Hans de Goede
if test "$usb_redir" = "yes" ; then
3157 69354a83 Hans de Goede
  echo "CONFIG_USB_REDIR=y" >> $config_host_mak
3158 69354a83 Hans de Goede
fi
3159 69354a83 Hans de Goede
3160 20ff075b Michael Walle
if test "$opengl" = "yes" ; then
3161 20ff075b Michael Walle
  echo "CONFIG_OPENGL=y" >> $config_host_mak
3162 20ff075b Michael Walle
fi
3163 20ff075b Michael Walle
3164 c589b249 Ronnie Sahlberg
if test "$libiscsi" = "yes" ; then
3165 c589b249 Ronnie Sahlberg
  echo "CONFIG_LIBISCSI=y" >> $config_host_mak
3166 c589b249 Ronnie Sahlberg
fi
3167 c589b249 Ronnie Sahlberg
3168 83fb7adf bellard
# XXX: suppress that
3169 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
3170 2358a494 Juan Quintela
  echo "CONFIG_BSD=y" >> $config_host_mak
3171 7d3505c5 bellard
fi
3172 7d3505c5 bellard
3173 2358a494 Juan Quintela
echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
3174 c5937220 pbrook
3175 20ff6c80 Anthony Liguori
if test "$zero_malloc" = "yes" ; then
3176 20ff6c80 Anthony Liguori
  echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
3177 20ff6c80 Anthony Liguori
fi
3178 f27aaf4b Christian Brunner
if test "$rbd" = "yes" ; then
3179 f27aaf4b Christian Brunner
  echo "CONFIG_RBD=y" >> $config_host_mak
3180 d0e2fce5 Aneesh Kumar K.V
fi
3181 d0e2fce5 Aneesh Kumar K.V
3182 d0e2fce5 Aneesh Kumar K.V
if test "$ucontext_coroutine" = "yes" ; then
3183 d0e2fce5 Aneesh Kumar K.V
  echo "CONFIG_UCONTEXT_COROUTINE=y" >> $config_host_mak
3184 f27aaf4b Christian Brunner
fi
3185 20ff6c80 Anthony Liguori
3186 d2042378 Aneesh Kumar K.V
if test "$open_by_handle_at" = "yes" ; then
3187 d2042378 Aneesh Kumar K.V
  echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak
3188 d2042378 Aneesh Kumar K.V
fi
3189 d2042378 Aneesh Kumar K.V
3190 e06a765e Harsh Prateek Bora
if test "$linux_magic_h" = "yes" ; then
3191 e06a765e Harsh Prateek Bora
  echo "CONFIG_LINUX_MAGIC_H=y" >> $config_host_mak
3192 e06a765e Harsh Prateek Bora
fi
3193 e06a765e Harsh Prateek Bora
3194 68063649 blueswir1
# USB host support
3195 68063649 blueswir1
case "$usb" in
3196 68063649 blueswir1
linux)
3197 98ec69ac Juan Quintela
  echo "HOST_USB=linux" >> $config_host_mak
3198 68063649 blueswir1
;;
3199 68063649 blueswir1
bsd)
3200 98ec69ac Juan Quintela
  echo "HOST_USB=bsd" >> $config_host_mak
3201 68063649 blueswir1
;;
3202 68063649 blueswir1
*)
3203 98ec69ac Juan Quintela
  echo "HOST_USB=stub" >> $config_host_mak
3204 68063649 blueswir1
;;
3205 68063649 blueswir1
esac
3206 68063649 blueswir1
3207 e4858974 Lluís
# use default implementation for tracing backend-specific routines
3208 e4858974 Lluís
trace_default=yes
3209 94a420b1 Stefan Hajnoczi
echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
3210 6d8a764e Lluís
if test "$trace_backend" = "nop"; then
3211 6d8a764e Lluís
  echo "CONFIG_TRACE_NOP=y" >> $config_host_mak
3212 22890ab5 Prerna Saxena
fi
3213 9410b56c Prerna Saxena
if test "$trace_backend" = "simple"; then
3214 6d8a764e Lluís
  echo "CONFIG_TRACE_SIMPLE=y" >> $config_host_mak
3215 e4858974 Lluís
  trace_default=no
3216 6d8a764e Lluís
  # Set the appropriate trace file.
3217 953ffe0f Andreas Färber
  trace_file="\"$trace_file-\" FMT_pid"
3218 9410b56c Prerna Saxena
fi
3219 6d8a764e Lluís
if test "$trace_backend" = "stderr"; then
3220 6d8a764e Lluís
  echo "CONFIG_TRACE_STDERR=y" >> $config_host_mak
3221 9a82b6a5 Lluís
  trace_default=no
3222 6d8a764e Lluís
fi
3223 6d8a764e Lluís
if test "$trace_backend" = "ust"; then
3224 6d8a764e Lluís
  echo "CONFIG_TRACE_UST=y" >> $config_host_mak
3225 6d8a764e Lluís
fi
3226 6d8a764e Lluís
if test "$trace_backend" = "dtrace"; then
3227 6d8a764e Lluís
  echo "CONFIG_TRACE_DTRACE=y" >> $config_host_mak
3228 6d8a764e Lluís
  if test "$trace_backend_stap" = "yes" ; then
3229 6d8a764e Lluís
    echo "CONFIG_TRACE_SYSTEMTAP=y" >> $config_host_mak
3230 6d8a764e Lluís
  fi
3231 c276b17d Daniel P. Berrange
fi
3232 9410b56c Prerna Saxena
echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
3233 e4858974 Lluís
if test "$trace_default" = "yes"; then
3234 e4858974 Lluís
  echo "CONFIG_TRACE_DEFAULT=y" >> $config_host_mak
3235 e4858974 Lluís
fi
3236 9410b56c Prerna Saxena
3237 98ec69ac Juan Quintela
echo "TOOLS=$tools" >> $config_host_mak
3238 fffbeb75 Gerd Hoffmann
echo "CHECKS=$checks" >> $config_host_mak
3239 98ec69ac Juan Quintela
echo "ROMS=$roms" >> $config_host_mak
3240 804edf29 Juan Quintela
echo "MAKE=$make" >> $config_host_mak
3241 804edf29 Juan Quintela
echo "INSTALL=$install" >> $config_host_mak
3242 1901cb14 Brad
echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak
3243 1901cb14 Brad
echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak
3244 1901cb14 Brad
echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
3245 c886edfb Blue Swirl
echo "PYTHON=$python" >> $config_host_mak
3246 804edf29 Juan Quintela
echo "CC=$cc" >> $config_host_mak
3247 2b2e59e6 Paolo Bonzini
echo "CC_I386=$cc_i386" >> $config_host_mak
3248 804edf29 Juan Quintela
echo "HOST_CC=$host_cc" >> $config_host_mak
3249 804edf29 Juan Quintela
echo "AR=$ar" >> $config_host_mak
3250 804edf29 Juan Quintela
echo "OBJCOPY=$objcopy" >> $config_host_mak
3251 804edf29 Juan Quintela
echo "LD=$ld" >> $config_host_mak
3252 9fe6de94 Blue Swirl
echo "WINDRES=$windres" >> $config_host_mak
3253 44dc0ca3 Alon Levy
echo "LIBTOOL=$libtool" >> $config_host_mak
3254 e2a2ed06 Juan Quintela
echo "CFLAGS=$CFLAGS" >> $config_host_mak
3255 a558ee17 Juan Quintela
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
3256 f9728943 Paolo Bonzini
echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
3257 e39f0062 Paolo Bonzini
if test "$sparse" = "yes" ; then
3258 e39f0062 Paolo Bonzini
  echo "CC           := REAL_CC=\"\$(CC)\" cgcc"       >> $config_host_mak
3259 e39f0062 Paolo Bonzini
  echo "HOST_CC      := REAL_CC=\"\$(HOST_CC)\" cgcc"  >> $config_host_mak
3260 e39f0062 Paolo Bonzini
  echo "QEMU_CFLAGS  += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
3261 e39f0062 Paolo Bonzini
fi
3262 c81da56e Juan Quintela
echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
3263 e2a2ed06 Juan Quintela
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
3264 a36abbbb Juan Quintela
echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
3265 a36abbbb Juan Quintela
echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
3266 73da375e Juan Quintela
echo "LIBS+=$LIBS" >> $config_host_mak
3267 3e2e0e6b Juan Quintela
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
3268 804edf29 Juan Quintela
echo "EXESUF=$EXESUF" >> $config_host_mak
3269 957f1f99 Michael Roth
echo "LIBS_QGA+=$libs_qga" >> $config_host_mak
3270 804edf29 Juan Quintela
3271 4bf6b55b Juan Quintela
# generate list of library paths for linker script
3272 4bf6b55b Juan Quintela
3273 4bf6b55b Juan Quintela
$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld}
3274 4bf6b55b Juan Quintela
3275 4bf6b55b Juan Quintela
if test -f ${config_host_ld}~ ; then
3276 4bf6b55b Juan Quintela
  if cmp -s $config_host_ld ${config_host_ld}~ ; then
3277 4bf6b55b Juan Quintela
    mv ${config_host_ld}~ $config_host_ld
3278 4bf6b55b Juan Quintela
  else
3279 4bf6b55b Juan Quintela
    rm ${config_host_ld}~
3280 4bf6b55b Juan Quintela
  fi
3281 4bf6b55b Juan Quintela
fi
3282 4bf6b55b Juan Quintela
3283 4d904533 Blue Swirl
for d in libdis libdis-user; do
3284 4d904533 Blue Swirl
    mkdir -p $d
3285 11568d6d Paolo Bonzini
    symlink $source_path/Makefile.dis $d/Makefile
3286 4d904533 Blue Swirl
    echo > $d/config.mak
3287 4d904533 Blue Swirl
done
3288 4d904533 Blue Swirl
3289 1d14ffa9 bellard
for target in $target_list; do
3290 97a847bc bellard
target_dir="$target"
3291 25be210f Juan Quintela
config_target_mak=$target_dir/config-target.mak
3292 600309b6 Blue Swirl
target_arch2=`echo $target | cut -d '-' -f 1`
3293 97a847bc bellard
target_bigendian="no"
3294 1f3d3c8f Juan Quintela
3295 ea2d6a39 Juan Quintela
case "$target_arch2" in
3296 cfa550c6 Max Filippov
  armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
3297 ea2d6a39 Juan Quintela
  target_bigendian=yes
3298 ea2d6a39 Juan Quintela
  ;;
3299 ea2d6a39 Juan Quintela
esac
3300 97a847bc bellard
target_softmmu="no"
3301 997344f3 bellard
target_user_only="no"
3302 831b7825 ths
target_linux_user="no"
3303 831b7825 ths
target_darwin_user="no"
3304 84778508 blueswir1
target_bsd_user="no"
3305 9e407a85 pbrook
case "$target" in
3306 600309b6 Blue Swirl
  ${target_arch2}-softmmu)
3307 9e407a85 pbrook
    target_softmmu="yes"
3308 9e407a85 pbrook
    ;;
3309 600309b6 Blue Swirl
  ${target_arch2}-linux-user)
3310 9c7a4202 Blue Swirl
    if test "$linux" != "yes" ; then
3311 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a Linux host"
3312 9c7a4202 Blue Swirl
      exit 1
3313 9c7a4202 Blue Swirl
    fi
3314 9e407a85 pbrook
    target_user_only="yes"
3315 9e407a85 pbrook
    target_linux_user="yes"
3316 9e407a85 pbrook
    ;;
3317 600309b6 Blue Swirl
  ${target_arch2}-darwin-user)
3318 9c7a4202 Blue Swirl
    if test "$darwin" != "yes" ; then
3319 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a Darwin host"
3320 9c7a4202 Blue Swirl
      exit 1
3321 9c7a4202 Blue Swirl
    fi
3322 9e407a85 pbrook
    target_user_only="yes"
3323 9e407a85 pbrook
    target_darwin_user="yes"
3324 9e407a85 pbrook
    ;;
3325 600309b6 Blue Swirl
  ${target_arch2}-bsd-user)
3326 9cf55765 Blue Swirl
    if test "$bsd" != "yes" ; then
3327 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a BSD host"
3328 9c7a4202 Blue Swirl
      exit 1
3329 9c7a4202 Blue Swirl
    fi
3330 84778508 blueswir1
    target_user_only="yes"
3331 84778508 blueswir1
    target_bsd_user="yes"
3332 84778508 blueswir1
    ;;
3333 9e407a85 pbrook
  *)
3334 9e407a85 pbrook
    echo "ERROR: Target '$target' not recognised"
3335 9e407a85 pbrook
    exit 1
3336 9e407a85 pbrook
    ;;
3337 9e407a85 pbrook
esac
3338 831b7825 ths
3339 97a847bc bellard
mkdir -p $target_dir
3340 158142c2 bellard
mkdir -p $target_dir/fpu
3341 57fec1fe bellard
mkdir -p $target_dir/tcg
3342 59f2a787 Gerd Hoffmann
mkdir -p $target_dir/ide
3343 353ac78d Aneesh Kumar K.V
mkdir -p $target_dir/9pfs
3344 84778508 blueswir1
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
3345 69de927c bellard
  mkdir -p $target_dir/nwfpe
3346 69de927c bellard
fi
3347 11568d6d Paolo Bonzini
symlink $source_path/Makefile.target $target_dir/Makefile
3348 ec530c81 bellard
3349 97a847bc bellard
3350 25be210f Juan Quintela
echo "# Automatically generated by configure - do not modify" > $config_target_mak
3351 de83cd02 bellard
3352 e5fe0c52 pbrook
bflt="no"
3353 bd0c5661 pbrook
target_nptl="no"
3354 600309b6 Blue Swirl
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
3355 7ee2822c Paolo Bonzini
echo "CONFIG_QEMU_INTERP_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
3356 56aebc89 pbrook
gdb_xml_files=""
3357 c2e3dee6 Laurent Vivier
target_short_alignment=2
3358 c2e3dee6 Laurent Vivier
target_int_alignment=4
3359 c2e3dee6 Laurent Vivier
target_long_alignment=4
3360 c2e3dee6 Laurent Vivier
target_llong_alignment=8
3361 de3a354a Michael Walle
target_libs_softmmu=
3362 7ba1e619 aliguori
3363 938b1edd Juan Quintela
TARGET_ARCH="$target_arch2"
3364 6acff7da Juan Quintela
TARGET_BASE_ARCH=""
3365 e6e91b9c Juan Quintela
TARGET_ABI_DIR=""
3366 e73aae67 Juan Quintela
3367 600309b6 Blue Swirl
case "$target_arch2" in
3368 2408a527 aurel32
  i386)
3369 71deff27 Aurelien Jarno
    target_phys_bits=64
3370 2408a527 aurel32
  ;;
3371 2408a527 aurel32
  x86_64)
3372 6acff7da Juan Quintela
    TARGET_BASE_ARCH=i386
3373 1ad2134f Paul Brook
    target_phys_bits=64
3374 c2e3dee6 Laurent Vivier
    target_long_alignment=8
3375 2408a527 aurel32
  ;;
3376 2408a527 aurel32
  alpha)
3377 1ad2134f Paul Brook
    target_phys_bits=64
3378 c2e3dee6 Laurent Vivier
    target_long_alignment=8
3379 a4b388ff Richard Henderson
    target_nptl="yes"
3380 2408a527 aurel32
  ;;
3381 2408a527 aurel32
  arm|armeb)
3382 b498c8a0 Juan Quintela
    TARGET_ARCH=arm
3383 2408a527 aurel32
    bflt="yes"
3384 bd0c5661 pbrook
    target_nptl="yes"
3385 56aebc89 pbrook
    gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
3386 1ad2134f Paul Brook
    target_phys_bits=32
3387 c2e3dee6 Laurent Vivier
    target_llong_alignment=4
3388 2408a527 aurel32
  ;;
3389 2408a527 aurel32
  cris)
3390 253bd7f8 edgar_igl
    target_nptl="yes"
3391 1ad2134f Paul Brook
    target_phys_bits=32
3392 2408a527 aurel32
  ;;
3393 613a22c9 Michael Walle
  lm32)
3394 613a22c9 Michael Walle
    target_phys_bits=32
3395 de3a354a Michael Walle
    target_libs_softmmu="$opengl_libs"
3396 613a22c9 Michael Walle
  ;;
3397 2408a527 aurel32
  m68k)
3398 2408a527 aurel32
    bflt="yes"
3399 56aebc89 pbrook
    gdb_xml_files="cf-core.xml cf-fp.xml"
3400 1ad2134f Paul Brook
    target_phys_bits=32
3401 c2e3dee6 Laurent Vivier
    target_int_alignment=2
3402 c2e3dee6 Laurent Vivier
    target_long_alignment=2
3403 c2e3dee6 Laurent Vivier
    target_llong_alignment=2
3404 2408a527 aurel32
  ;;
3405 877fdc12 Edgar E. Iglesias
  microblaze|microblazeel)
3406 877fdc12 Edgar E. Iglesias
    TARGET_ARCH=microblaze
3407 72b675ca Edgar E. Iglesias
    bflt="yes"
3408 72b675ca Edgar E. Iglesias
    target_nptl="yes"
3409 72b675ca Edgar E. Iglesias
    target_phys_bits=32
3410 de3a354a Michael Walle
    target_libs_softmmu="$fdt_libs"
3411 72b675ca Edgar E. Iglesias
  ;;
3412 0adcffb1 Juan Quintela
  mips|mipsel)
3413 b498c8a0 Juan Quintela
    TARGET_ARCH=mips
3414 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
3415 f04dc72f Paul Brook
    target_nptl="yes"
3416 1ad2134f Paul Brook
    target_phys_bits=64
3417 2408a527 aurel32
  ;;
3418 2408a527 aurel32
  mipsn32|mipsn32el)
3419 b498c8a0 Juan Quintela
    TARGET_ARCH=mipsn32
3420 6acff7da Juan Quintela
    TARGET_BASE_ARCH=mips
3421 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
3422 1ad2134f Paul Brook
    target_phys_bits=64
3423 2408a527 aurel32
  ;;
3424 2408a527 aurel32
  mips64|mips64el)
3425 b498c8a0 Juan Quintela
    TARGET_ARCH=mips64
3426 6acff7da Juan Quintela
    TARGET_BASE_ARCH=mips
3427 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
3428 1ad2134f Paul Brook
    target_phys_bits=64
3429 c2e3dee6 Laurent Vivier
    target_long_alignment=8
3430 2408a527 aurel32
  ;;
3431 2408a527 aurel32
  ppc)
3432 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3433 8b242eba Alexander Graf
    target_phys_bits=64
3434 d6630708 Nathan Froyd
    target_nptl="yes"
3435 de3a354a Michael Walle
    target_libs_softmmu="$fdt_libs"
3436 2408a527 aurel32
  ;;
3437 2408a527 aurel32
  ppcemb)
3438 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
3439 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
3440 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3441 1ad2134f Paul Brook
    target_phys_bits=64
3442 d6630708 Nathan Froyd
    target_nptl="yes"
3443 de3a354a Michael Walle
    target_libs_softmmu="$fdt_libs"
3444 2408a527 aurel32
  ;;
3445 2408a527 aurel32
  ppc64)
3446 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
3447 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
3448 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3449 1ad2134f Paul Brook
    target_phys_bits=64
3450 c2e3dee6 Laurent Vivier
    target_long_alignment=8
3451 de3a354a Michael Walle
    target_libs_softmmu="$fdt_libs"
3452 2408a527 aurel32
  ;;
3453 2408a527 aurel32
  ppc64abi32)
3454 b498c8a0 Juan Quintela
    TARGET_ARCH=ppc64
3455 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
3456 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
3457 25be210f Juan Quintela
    echo "TARGET_ABI32=y" >> $config_target_mak
3458 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
3459 1ad2134f Paul Brook
    target_phys_bits=64
3460 de3a354a Michael Walle
    target_libs_softmmu="$fdt_libs"
3461 2408a527 aurel32
  ;;
3462 2408a527 aurel32
  sh4|sh4eb)
3463 b498c8a0 Juan Quintela
    TARGET_ARCH=sh4
3464 2408a527 aurel32
    bflt="yes"
3465 0b6d3ae0 aurel32
    target_nptl="yes"
3466 1ad2134f Paul Brook
    target_phys_bits=32
3467 2408a527 aurel32
  ;;
3468 2408a527 aurel32
  sparc)
3469 1ad2134f Paul Brook
    target_phys_bits=64
3470 2408a527 aurel32
  ;;
3471 2408a527 aurel32
  sparc64)
3472 6acff7da Juan Quintela
    TARGET_BASE_ARCH=sparc
3473 1ad2134f Paul Brook
    target_phys_bits=64
3474 c2e3dee6 Laurent Vivier
    target_long_alignment=8
3475 2408a527 aurel32
  ;;
3476 2408a527 aurel32
  sparc32plus)
3477 b498c8a0 Juan Quintela
    TARGET_ARCH=sparc64
3478 6acff7da Juan Quintela
    TARGET_BASE_ARCH=sparc
3479 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=sparc
3480 25be210f Juan Quintela
    echo "TARGET_ABI32=y" >> $config_target_mak
3481 1ad2134f Paul Brook
    target_phys_bits=64
3482 2408a527 aurel32
  ;;
3483 24e804ec Alexander Graf
  s390x)
3484 bc434676 Ulrich Hecht
    target_nptl="yes"
3485 24e804ec Alexander Graf
    target_phys_bits=64
3486 7b3da903 Alexander Graf
    target_long_alignment=8
3487 24e804ec Alexander Graf
  ;;
3488 d2fbca94 Guan Xuetao
  unicore32)
3489 d2fbca94 Guan Xuetao
    target_phys_bits=32
3490 d2fbca94 Guan Xuetao
  ;;
3491 cfa550c6 Max Filippov
  xtensa|xtensaeb)
3492 cfa550c6 Max Filippov
    TARGET_ARCH=xtensa
3493 cfa550c6 Max Filippov
    target_phys_bits=32
3494 cfa550c6 Max Filippov
  ;;
3495 2408a527 aurel32
  *)
3496 2408a527 aurel32
    echo "Unsupported target CPU"
3497 2408a527 aurel32
    exit 1
3498 2408a527 aurel32
  ;;
3499 2408a527 aurel32
esac
3500 c2e3dee6 Laurent Vivier
echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
3501 c2e3dee6 Laurent Vivier
echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
3502 c2e3dee6 Laurent Vivier
echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak
3503 c2e3dee6 Laurent Vivier
echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak
3504 25be210f Juan Quintela
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
3505 053dd92e Juan Quintela
target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
3506 25be210f Juan Quintela
echo "TARGET_$target_arch_name=y" >> $config_target_mak
3507 25be210f Juan Quintela
echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
3508 42bc608b Juan Quintela
# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
3509 6acff7da Juan Quintela
if [ "$TARGET_BASE_ARCH" = "" ]; then
3510 6acff7da Juan Quintela
  TARGET_BASE_ARCH=$TARGET_ARCH
3511 6acff7da Juan Quintela
fi
3512 25be210f Juan Quintela
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
3513 e6e91b9c Juan Quintela
if [ "$TARGET_ABI_DIR" = "" ]; then
3514 e6e91b9c Juan Quintela
  TARGET_ABI_DIR=$TARGET_ARCH
3515 e6e91b9c Juan Quintela
fi
3516 25be210f Juan Quintela
echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
3517 1b0c87fc Juan Quintela
case "$target_arch2" in
3518 1b0c87fc Juan Quintela
  i386|x86_64)
3519 1b0c87fc Juan Quintela
    if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
3520 64b3cfdb Anthony PERARD
      target_phys_bits=64
3521 25be210f Juan Quintela
      echo "CONFIG_XEN=y" >> $config_target_mak
3522 59d21e53 Alexander Graf
    else
3523 59d21e53 Alexander Graf
      echo "CONFIG_NO_XEN=y" >> $config_target_mak
3524 1b0c87fc Juan Quintela
    fi
3525 59d21e53 Alexander Graf
    ;;
3526 59d21e53 Alexander Graf
  *)
3527 59d21e53 Alexander Graf
    echo "CONFIG_NO_XEN=y" >> $config_target_mak
3528 1b0c87fc Juan Quintela
esac
3529 c59249f9 Juan Quintela
case "$target_arch2" in
3530 0e60a699 Alexander Graf
  i386|x86_64|ppcemb|ppc|ppc64|s390x)
3531 c59249f9 Juan Quintela
    # Make sure the target and host cpus are compatible
3532 c59249f9 Juan Quintela
    if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
3533 c59249f9 Juan Quintela
      \( "$target_arch2" = "$cpu" -o \
3534 c59249f9 Juan Quintela
      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
3535 5f114bc6 Alexander Graf
      \( "$target_arch2" = "ppc64"  -a "$cpu" = "ppc" \) -o \
3536 adf82011 René Rebe
      \( "$target_arch2" = "ppc"    -a "$cpu" = "ppc64" \) -o \
3537 adf82011 René Rebe
      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc64" \) -o \
3538 c59249f9 Juan Quintela
      \( "$target_arch2" = "x86_64" -a "$cpu" = "i386"   \) -o \
3539 c59249f9 Juan Quintela
      \( "$target_arch2" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
3540 25be210f Juan Quintela
      echo "CONFIG_KVM=y" >> $config_target_mak
3541 1ba16968 Stefan Weil
      if test "$vhost_net" = "yes" ; then
3542 d5970055 Michael S. Tsirkin
        echo "CONFIG_VHOST_NET=y" >> $config_target_mak
3543 d5970055 Michael S. Tsirkin
      fi
3544 c59249f9 Juan Quintela
    fi
3545 c59249f9 Juan Quintela
esac
3546 7f762366 Blue Swirl
if test "$target_arch2" = "ppc64" -a "$fdt" = "yes"; then
3547 0a6b8dde Alexander Graf
  echo "CONFIG_PSERIES=y" >> $config_target_mak
3548 0a6b8dde Alexander Graf
fi
3549 de83cd02 bellard
if test "$target_bigendian" = "yes" ; then
3550 25be210f Juan Quintela
  echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
3551 de83cd02 bellard
fi
3552 97a847bc bellard
if test "$target_softmmu" = "yes" ; then
3553 b1aa27c4 Paul Brook
  echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
3554 25be210f Juan Quintela
  echo "CONFIG_SOFTMMU=y" >> $config_target_mak
3555 de3a354a Michael Walle
  echo "LIBS+=$libs_softmmu $target_libs_softmmu" >> $config_target_mak
3556 0e8c9214 Andreas Färber
  echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
3557 5791f45b Kirill A. Shutemov
  echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
3558 43ce4dfe bellard
fi
3559 997344f3 bellard
if test "$target_user_only" = "yes" ; then
3560 25be210f Juan Quintela
  echo "CONFIG_USER_ONLY=y" >> $config_target_mak
3561 997344f3 bellard
fi
3562 831b7825 ths
if test "$target_linux_user" = "yes" ; then
3563 25be210f Juan Quintela
  echo "CONFIG_LINUX_USER=y" >> $config_target_mak
3564 831b7825 ths
fi
3565 831b7825 ths
if test "$target_darwin_user" = "yes" ; then
3566 25be210f Juan Quintela
  echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
3567 831b7825 ths
fi
3568 111a38b0 Robert Relyea
if test "$smartcard_nss" = "yes" ; then
3569 111a38b0 Robert Relyea
  echo "subdir-$target: subdir-libcacard" >> $config_host_mak
3570 111a38b0 Robert Relyea
  echo "libcacard_libs=$libcacard_libs" >> $config_host_mak
3571 111a38b0 Robert Relyea
  echo "libcacard_cflags=$libcacard_cflags" >> $config_host_mak
3572 111a38b0 Robert Relyea
fi
3573 56aebc89 pbrook
list=""
3574 56aebc89 pbrook
if test ! -z "$gdb_xml_files" ; then
3575 56aebc89 pbrook
  for x in $gdb_xml_files; do
3576 56aebc89 pbrook
    list="$list $source_path/gdb-xml/$x"
3577 56aebc89 pbrook
  done
3578 3d0f1517 Juan Quintela
  echo "TARGET_XML_FILES=$list" >> $config_target_mak
3579 56aebc89 pbrook
fi
3580 97a847bc bellard
3581 e5fe0c52 pbrook
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
3582 25be210f Juan Quintela
  echo "TARGET_HAS_BFLT=y" >> $config_target_mak
3583 e5fe0c52 pbrook
fi
3584 bd0c5661 pbrook
if test "$target_user_only" = "yes" \
3585 bd0c5661 pbrook
        -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
3586 25be210f Juan Quintela
  echo "CONFIG_USE_NPTL=y" >> $config_target_mak
3587 bd0c5661 pbrook
fi
3588 379f6698 Paul Brook
if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
3589 25be210f Juan Quintela
  echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
3590 379f6698 Paul Brook
fi
3591 84778508 blueswir1
if test "$target_bsd_user" = "yes" ; then
3592 25be210f Juan Quintela
  echo "CONFIG_BSD_USER=y" >> $config_target_mak
3593 84778508 blueswir1
fi
3594 5b0753e0 bellard
3595 4afddb55 Juan Quintela
# generate QEMU_CFLAGS/LDFLAGS for targets
3596 fa282484 Juan Quintela
3597 4afddb55 Juan Quintela
cflags=""
3598 f9728943 Paolo Bonzini
includes=""
3599 fa282484 Juan Quintela
ldflags=""
3600 9b8e111f Juan Quintela
3601 9195b2c2 Stefan Weil
if test "$tcg_interpreter" = "yes"; then
3602 9195b2c2 Stefan Weil
  includes="-I\$(SRC_PATH)/tcg/tci $includes"
3603 9195b2c2 Stefan Weil
elif test "$ARCH" = "sparc64" ; then
3604 f9728943 Paolo Bonzini
  includes="-I\$(SRC_PATH)/tcg/sparc $includes"
3605 24e804ec Alexander Graf
elif test "$ARCH" = "s390x" ; then
3606 f9728943 Paolo Bonzini
  includes="-I\$(SRC_PATH)/tcg/s390 $includes"
3607 5d8a4f8f Richard Henderson
elif test "$ARCH" = "x86_64" ; then
3608 f9728943 Paolo Bonzini
  includes="-I\$(SRC_PATH)/tcg/i386 $includes"
3609 57ddfbf7 Juan Quintela
else
3610 f9728943 Paolo Bonzini
  includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
3611 57ddfbf7 Juan Quintela
fi
3612 f9728943 Paolo Bonzini
includes="-I\$(SRC_PATH)/tcg $includes"
3613 57ddfbf7 Juan Quintela
3614 4d904533 Blue Swirl
if test "$target_user_only" = "yes" ; then
3615 4d904533 Blue Swirl
    libdis_config_mak=libdis-user/config.mak
3616 4d904533 Blue Swirl
else
3617 4d904533 Blue Swirl
    libdis_config_mak=libdis/config.mak
3618 4d904533 Blue Swirl
fi
3619 4d904533 Blue Swirl
3620 64656024 Juan Quintela
for i in $ARCH $TARGET_BASE_ARCH ; do
3621 64656024 Juan Quintela
  case "$i" in
3622 64656024 Juan Quintela
  alpha)
3623 25be210f Juan Quintela
    echo "CONFIG_ALPHA_DIS=y"  >> $config_target_mak
3624 4d904533 Blue Swirl
    echo "CONFIG_ALPHA_DIS=y"  >> $libdis_config_mak
3625 64656024 Juan Quintela
  ;;
3626 64656024 Juan Quintela
  arm)
3627 25be210f Juan Quintela
    echo "CONFIG_ARM_DIS=y"  >> $config_target_mak
3628 4d904533 Blue Swirl
    echo "CONFIG_ARM_DIS=y"  >> $libdis_config_mak
3629 64656024 Juan Quintela
  ;;
3630 64656024 Juan Quintela
  cris)
3631 25be210f Juan Quintela
    echo "CONFIG_CRIS_DIS=y"  >> $config_target_mak
3632 4d904533 Blue Swirl
    echo "CONFIG_CRIS_DIS=y"  >> $libdis_config_mak
3633 64656024 Juan Quintela
  ;;
3634 64656024 Juan Quintela
  hppa)
3635 25be210f Juan Quintela
    echo "CONFIG_HPPA_DIS=y"  >> $config_target_mak
3636 4d904533 Blue Swirl
    echo "CONFIG_HPPA_DIS=y"  >> $libdis_config_mak
3637 64656024 Juan Quintela
  ;;
3638 64656024 Juan Quintela
  i386|x86_64)
3639 25be210f Juan Quintela
    echo "CONFIG_I386_DIS=y"  >> $config_target_mak
3640 4d904533 Blue Swirl
    echo "CONFIG_I386_DIS=y"  >> $libdis_config_mak
3641 64656024 Juan Quintela
  ;;
3642 903ec55c Aurelien Jarno
  ia64*)
3643 903ec55c Aurelien Jarno
    echo "CONFIG_IA64_DIS=y"  >> $config_target_mak
3644 903ec55c Aurelien Jarno
    echo "CONFIG_IA64_DIS=y"  >> $libdis_config_mak
3645 903ec55c Aurelien Jarno
  ;;
3646 64656024 Juan Quintela
  m68k)
3647 25be210f Juan Quintela
    echo "CONFIG_M68K_DIS=y"  >> $config_target_mak
3648 4d904533 Blue Swirl
    echo "CONFIG_M68K_DIS=y"  >> $libdis_config_mak
3649 64656024 Juan Quintela
  ;;
3650 877fdc12 Edgar E. Iglesias
  microblaze*)
3651 25be210f Juan Quintela
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $config_target_mak
3652 4d904533 Blue Swirl
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $libdis_config_mak
3653 64656024 Juan Quintela
  ;;
3654 64656024 Juan Quintela
  mips*)
3655 25be210f Juan Quintela
    echo "CONFIG_MIPS_DIS=y"  >> $config_target_mak
3656 4d904533 Blue Swirl
    echo "CONFIG_MIPS_DIS=y"  >> $libdis_config_mak
3657 64656024 Juan Quintela
  ;;
3658 64656024 Juan Quintela
  ppc*)
3659 25be210f Juan Quintela
    echo "CONFIG_PPC_DIS=y"  >> $config_target_mak
3660 4d904533 Blue Swirl
    echo "CONFIG_PPC_DIS=y"  >> $libdis_config_mak
3661 64656024 Juan Quintela
  ;;
3662 24e804ec Alexander Graf
  s390*)
3663 25be210f Juan Quintela
    echo "CONFIG_S390_DIS=y"  >> $config_target_mak
3664 4d904533 Blue Swirl
    echo "CONFIG_S390_DIS=y"  >> $libdis_config_mak
3665 64656024 Juan Quintela
  ;;
3666 64656024 Juan Quintela
  sh4)
3667 25be210f Juan Quintela
    echo "CONFIG_SH4_DIS=y"  >> $config_target_mak
3668 4d904533 Blue Swirl
    echo "CONFIG_SH4_DIS=y"  >> $libdis_config_mak
3669 64656024 Juan Quintela
  ;;
3670 64656024 Juan Quintela
  sparc*)
3671 25be210f Juan Quintela
    echo "CONFIG_SPARC_DIS=y"  >> $config_target_mak
3672 4d904533 Blue Swirl
    echo "CONFIG_SPARC_DIS=y"  >> $libdis_config_mak
3673 64656024 Juan Quintela
  ;;
3674 cfa550c6 Max Filippov
  xtensa*)
3675 cfa550c6 Max Filippov
    echo "CONFIG_XTENSA_DIS=y"  >> $config_target_mak
3676 cfa550c6 Max Filippov
    echo "CONFIG_XTENSA_DIS=y"  >> $libdis_config_mak
3677 cfa550c6 Max Filippov
  ;;
3678 64656024 Juan Quintela
  esac
3679 64656024 Juan Quintela
done
3680 9195b2c2 Stefan Weil
if test "$tcg_interpreter" = "yes" ; then
3681 9195b2c2 Stefan Weil
  echo "CONFIG_TCI_DIS=y"  >> $config_target_mak
3682 9195b2c2 Stefan Weil
  echo "CONFIG_TCI_DIS=y"  >> $libdis_config_mak
3683 9195b2c2 Stefan Weil
fi
3684 64656024 Juan Quintela
3685 6ee7126f Juan Quintela
case "$ARCH" in
3686 6ee7126f Juan Quintela
alpha)
3687 6ee7126f Juan Quintela
  # Ensure there's only a single GP
3688 6ee7126f Juan Quintela
  cflags="-msmall-data $cflags"
3689 6ee7126f Juan Quintela
;;
3690 6ee7126f Juan Quintela
esac
3691 6ee7126f Juan Quintela
3692 55d9c04b Juan Quintela
if test "$target_softmmu" = "yes" ; then
3693 55d9c04b Juan Quintela
  case "$TARGET_BASE_ARCH" in
3694 55d9c04b Juan Quintela
  arm)
3695 55d9c04b Juan Quintela
    cflags="-DHAS_AUDIO $cflags"
3696 25a8bb96 Michael Walle
  ;;
3697 25a8bb96 Michael Walle
  lm32)
3698 25a8bb96 Michael Walle
    cflags="-DHAS_AUDIO $cflags"
3699 55d9c04b Juan Quintela
  ;;
3700 55d9c04b Juan Quintela
  i386|mips|ppc)
3701 55d9c04b Juan Quintela
    cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
3702 55d9c04b Juan Quintela
  ;;
3703 55d9c04b Juan Quintela
  esac
3704 55d9c04b Juan Quintela
fi
3705 55d9c04b Juan Quintela
3706 471857dd Juan Quintela
if test "$target_softmmu" = "yes" -a \( \
3707 471857dd Juan Quintela
        "$TARGET_ARCH" = "microblaze" -o \
3708 471857dd Juan Quintela
        "$TARGET_ARCH" = "cris" \) ; then
3709 25be210f Juan Quintela
  echo "CONFIG_NEED_MMU=y" >> $config_target_mak
3710 471857dd Juan Quintela
fi
3711 471857dd Juan Quintela
3712 d02c1db3 Juan Quintela
if test "$gprof" = "yes" ; then
3713 25be210f Juan Quintela
  echo "TARGET_GPROF=yes" >> $config_target_mak
3714 d02c1db3 Juan Quintela
  if test "$target_linux_user" = "yes" ; then
3715 d02c1db3 Juan Quintela
    cflags="-p $cflags"
3716 d02c1db3 Juan Quintela
    ldflags="-p $ldflags"
3717 d02c1db3 Juan Quintela
  fi
3718 d02c1db3 Juan Quintela
  if test "$target_softmmu" = "yes" ; then
3719 d02c1db3 Juan Quintela
    ldflags="-p $ldflags"
3720 25be210f Juan Quintela
    echo "GPROF_CFLAGS=-p" >> $config_target_mak
3721 d02c1db3 Juan Quintela
  fi
3722 d02c1db3 Juan Quintela
fi
3723 d02c1db3 Juan Quintela
3724 9195b2c2 Stefan Weil
if test "$ARCH" = "tci"; then
3725 9195b2c2 Stefan Weil
  linker_script=""
3726 9195b2c2 Stefan Weil
else
3727 9195b2c2 Stefan Weil
  linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
3728 9195b2c2 Stefan Weil
fi
3729 9195b2c2 Stefan Weil
3730 9b8e111f Juan Quintela
if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
3731 fa282484 Juan Quintela
  case "$ARCH" in
3732 fa282484 Juan Quintela
  sparc)
3733 fa282484 Juan Quintela
    # -static is used to avoid g1/g3 usage by the dynamic linker
3734 322e5878 Juan Quintela
    ldflags="$linker_script -static $ldflags"
3735 fa282484 Juan Quintela
    ;;
3736 4d58be06 Richard Henderson
  alpha | s390x)
3737 4d58be06 Richard Henderson
    # The default placement of the application is fine.
3738 4d58be06 Richard Henderson
    ;;
3739 fd76e73a Richard Henderson
  *)
3740 322e5878 Juan Quintela
    ldflags="$linker_script $ldflags"
3741 fa282484 Juan Quintela
    ;;
3742 fa282484 Juan Quintela
  esac
3743 fa282484 Juan Quintela
fi
3744 fa282484 Juan Quintela
3745 e205c790 Jan Kiszka
# use included Linux headers
3746 af2be207 Jan Kiszka
if test "$linux" = "yes" ; then
3747 af2be207 Jan Kiszka
  includes="-I\$(SRC_PATH)/linux-headers $includes"
3748 af2be207 Jan Kiszka
  mkdir -p linux-headers
3749 af2be207 Jan Kiszka
  case "$cpu" in
3750 af2be207 Jan Kiszka
  i386|x86_64)
3751 af2be207 Jan Kiszka
    symlink $source_path/linux-headers/asm-x86 linux-headers/asm
3752 af2be207 Jan Kiszka
    ;;
3753 af2be207 Jan Kiszka
  ppcemb|ppc|ppc64)
3754 af2be207 Jan Kiszka
    symlink $source_path/linux-headers/asm-powerpc linux-headers/asm
3755 af2be207 Jan Kiszka
    ;;
3756 af2be207 Jan Kiszka
  s390x)
3757 af2be207 Jan Kiszka
    symlink $source_path/linux-headers/asm-s390 linux-headers/asm
3758 af2be207 Jan Kiszka
    ;;
3759 af2be207 Jan Kiszka
  esac
3760 af2be207 Jan Kiszka
fi
3761 e205c790 Jan Kiszka
3762 25be210f Juan Quintela
echo "LDFLAGS+=$ldflags" >> $config_target_mak
3763 25be210f Juan Quintela
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
3764 f9728943 Paolo Bonzini
echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
3765 fa282484 Juan Quintela
3766 97a847bc bellard
done # for target in $targets
3767 7d13299d bellard
3768 d1807a4f Paolo Bonzini
# build tree in object directory in case the source is not in the current directory
3769 d1807a4f Paolo Bonzini
DIRS="tests tests/cris slirp audio block net pc-bios/optionrom"
3770 446b9165 Andreas Färber
DIRS="$DIRS pc-bios/spapr-rtas"
3771 d1807a4f Paolo Bonzini
DIRS="$DIRS roms/seabios roms/vgabios"
3772 d1807a4f Paolo Bonzini
DIRS="$DIRS fsdev ui"
3773 e098fc3f Michael Roth
DIRS="$DIRS qapi qapi-generated"
3774 d9cd446b Anthony Liguori
DIRS="$DIRS qga trace"
3775 70371cfb Luiz Capitulino
FILES="Makefile tests/Makefile qdict-test-data.txt"
3776 d1807a4f Paolo Bonzini
FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
3777 d1807a4f Paolo Bonzini
FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps"
3778 446b9165 Andreas Färber
FILES="$FILES pc-bios/spapr-rtas/Makefile"
3779 d1807a4f Paolo Bonzini
FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
3780 753d11f2 Richard Henderson
for bios_file in \
3781 753d11f2 Richard Henderson
    $source_path/pc-bios/*.bin \
3782 753d11f2 Richard Henderson
    $source_path/pc-bios/*.rom \
3783 753d11f2 Richard Henderson
    $source_path/pc-bios/*.dtb \
3784 753d11f2 Richard Henderson
    $source_path/pc-bios/openbios-* \
3785 753d11f2 Richard Henderson
    $source_path/pc-bios/palcode-*
3786 753d11f2 Richard Henderson
do
3787 d1807a4f Paolo Bonzini
    FILES="$FILES pc-bios/`basename $bios_file`"
3788 d1807a4f Paolo Bonzini
done
3789 d1807a4f Paolo Bonzini
mkdir -p $DIRS
3790 d1807a4f Paolo Bonzini
for f in $FILES ; do
3791 f9245e10 Peter Maydell
    if [ -e "$source_path/$f" ] && ! [ -e "$f" ]; then
3792 f9245e10 Peter Maydell
        symlink "$source_path/$f" "$f"
3793 f9245e10 Peter Maydell
    fi
3794 d1807a4f Paolo Bonzini
done
3795 1ad2134f Paul Brook
3796 c34ebfdc Anthony Liguori
# temporary config to build submodules
3797 2d9f27d2 Anthony Liguori
for rom in seabios vgabios ; do
3798 c34ebfdc Anthony Liguori
    config_mak=roms/$rom/config.mak
3799 37116c89 Stefan Weil
    echo "# Automatically generated by configure - do not modify" > $config_mak
3800 c34ebfdc Anthony Liguori
    echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
3801 c34ebfdc Anthony Liguori
    echo "CC=$cc" >> $config_mak
3802 c34ebfdc Anthony Liguori
    echo "BCC=bcc" >> $config_mak
3803 c34ebfdc Anthony Liguori
    echo "CPP=${cross_prefix}cpp" >> $config_mak
3804 c34ebfdc Anthony Liguori
    echo "OBJCOPY=objcopy" >> $config_mak
3805 c34ebfdc Anthony Liguori
    echo "IASL=iasl" >> $config_mak
3806 c34ebfdc Anthony Liguori
    echo "LD=$ld" >> $config_mak
3807 c34ebfdc Anthony Liguori
done
3808 c34ebfdc Anthony Liguori
3809 1ad2134f Paul Brook
for hwlib in 32 64; do
3810 1ad2134f Paul Brook
  d=libhw$hwlib
3811 1ad2134f Paul Brook
  mkdir -p $d
3812 9953b2fc Blue Swirl
  mkdir -p $d/ide
3813 11568d6d Paolo Bonzini
  symlink $source_path/Makefile.hw $d/Makefile
3814 353ac78d Aneesh Kumar K.V
  mkdir -p $d/9pfs
3815 37116c89 Stefan Weil
  echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
3816 1ad2134f Paul Brook
done
3817 add16157 Blue Swirl
3818 111a38b0 Robert Relyea
if [ "$source_path" != `pwd` ]; then
3819 111a38b0 Robert Relyea
    # out of tree build
3820 111a38b0 Robert Relyea
    mkdir -p libcacard
3821 111a38b0 Robert Relyea
    rm -f libcacard/Makefile
3822 44dc0ca3 Alon Levy
    symlink "$source_path/libcacard/Makefile" libcacard/Makefile
3823 111a38b0 Robert Relyea
fi
3824 111a38b0 Robert Relyea
3825 add16157 Blue Swirl
d=libuser
3826 add16157 Blue Swirl
mkdir -p $d
3827 937b1258 Lluís Vilanova
mkdir -p $d/trace
3828 11568d6d Paolo Bonzini
symlink $source_path/Makefile.user $d/Makefile
3829 b40292e7 Jan Kiszka
3830 b40292e7 Jan Kiszka
if test "$docs" = "yes" ; then
3831 b40292e7 Jan Kiszka
  mkdir -p QMP
3832 b40292e7 Jan Kiszka
fi