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