Statistics
| Branch: | Revision:

root / configure @ b40292e7

History | View | Annotate | Download (70.6 kB)

1 7d13299d bellard
#!/bin/sh
2 7d13299d bellard
#
3 3ef693a0 bellard
# qemu configure script (c) 2003 Fabrice Bellard
4 7d13299d bellard
#
5 7d13299d bellard
# set temporary file name
6 7d13299d bellard
if test ! -z "$TMPDIR" ; then
7 7d13299d bellard
    TMPDIR1="${TMPDIR}"
8 7d13299d bellard
elif test ! -z "$TEMPDIR" ; then
9 7d13299d bellard
    TMPDIR1="${TEMPDIR}"
10 7d13299d bellard
else
11 7d13299d bellard
    TMPDIR1="/tmp"
12 7d13299d bellard
fi
13 7d13299d bellard
14 3ef693a0 bellard
TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 3ef693a0 bellard
TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 a91b857c malc
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe"
17 7d13299d bellard
18 02d5467e malc
trap "rm -f $TMPC $TMPO $TMPE ; exit" 0 2 3 15
19 9ac81bbb malc
20 52166aa0 Juan Quintela
compile_object() {
21 a558ee17 Juan Quintela
  $cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
22 52166aa0 Juan Quintela
}
23 52166aa0 Juan Quintela
24 52166aa0 Juan Quintela
compile_prog() {
25 52166aa0 Juan Quintela
  local_cflags="$1"
26 52166aa0 Juan Quintela
  local_ldflags="$2"
27 a558ee17 Juan Quintela
  $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > /dev/null 2> /dev/null
28 52166aa0 Juan Quintela
}
29 52166aa0 Juan Quintela
30 0dba6195 Loïc Minier
# check whether a command is available to this shell (may be either an
31 0dba6195 Loïc Minier
# executable or a builtin)
32 0dba6195 Loïc Minier
has() {
33 0dba6195 Loïc Minier
    type "$1" >/dev/null 2>&1
34 0dba6195 Loïc Minier
}
35 0dba6195 Loïc Minier
36 0dba6195 Loïc Minier
# search for an executable in PATH
37 0dba6195 Loïc Minier
path_of() {
38 0dba6195 Loïc Minier
    local_command="$1"
39 0dba6195 Loïc Minier
    local_ifs="$IFS"
40 0dba6195 Loïc Minier
    local_dir=""
41 0dba6195 Loïc Minier
42 0dba6195 Loïc Minier
    # pathname has a dir component?
43 0dba6195 Loïc Minier
    if [ "${local_command#*/}" != "$local_command" ]; then
44 0dba6195 Loïc Minier
        if [ -x "$local_command" ] && [ ! -d "$local_command" ]; then
45 0dba6195 Loïc Minier
            echo "$local_command"
46 0dba6195 Loïc Minier
            return 0
47 0dba6195 Loïc Minier
        fi
48 0dba6195 Loïc Minier
    fi
49 0dba6195 Loïc Minier
    if [ -z "$local_command" ]; then
50 0dba6195 Loïc Minier
        return 1
51 0dba6195 Loïc Minier
    fi
52 0dba6195 Loïc Minier
53 0dba6195 Loïc Minier
    IFS=:
54 0dba6195 Loïc Minier
    for local_dir in $PATH; do
55 0dba6195 Loïc Minier
        if [ -x "$local_dir/$local_command" ] && [ ! -d "$local_dir/$local_command" ]; then
56 0dba6195 Loïc Minier
            echo "$local_dir/$local_command"
57 0dba6195 Loïc Minier
            IFS="${local_ifs:-$(printf ' \t\n')}"
58 0dba6195 Loïc Minier
            return 0
59 0dba6195 Loïc Minier
        fi
60 0dba6195 Loïc Minier
    done
61 0dba6195 Loïc Minier
    # not found
62 0dba6195 Loïc Minier
    IFS="${local_ifs:-$(printf ' \t\n')}"
63 0dba6195 Loïc Minier
    return 1
64 0dba6195 Loïc Minier
}
65 0dba6195 Loïc Minier
66 7d13299d bellard
# default parameters
67 2ff6b91e Juan Quintela
cpu=""
68 11d9f695 bellard
prefix=""
69 1e43adfc bellard
interp_prefix="/usr/gnemul/qemu-%M"
70 43ce4dfe bellard
static="no"
71 07381cc1 Anthony Liguori
sysconfdir=""
72 ed968ff1 Juan Quintela
sparc_cpu=""
73 7d13299d bellard
cross_prefix=""
74 7d13299d bellard
cc="gcc"
75 0c58ac1c malc
audio_drv_list=""
76 4c9b53e3 malc
audio_card_list="ac97 es1370 sb16"
77 4c9b53e3 malc
audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
78 eb852011 Markus Armbruster
block_drv_whitelist=""
79 7d13299d bellard
host_cc="gcc"
80 7d13299d bellard
ar="ar"
81 7d13299d bellard
make="make"
82 6a882643 pbrook
install="install"
83 7aa486fe Anthony Liguori
objcopy="objcopy"
84 7aa486fe Anthony Liguori
ld="ld"
85 c81da56e Juan Quintela
helper_cflags=""
86 73da375e Juan Quintela
libs_softmmu=""
87 3e2e0e6b Juan Quintela
libs_tools=""
88 67f86e8e Juan Quintela
audio_pt_int=""
89 d5631638 malc
audio_win_int=""
90 ac0df51d aliguori
91 ac0df51d aliguori
# parse CC options first
92 ac0df51d aliguori
for opt do
93 ac0df51d aliguori
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
94 ac0df51d aliguori
  case "$opt" in
95 ac0df51d aliguori
  --cross-prefix=*) cross_prefix="$optarg"
96 ac0df51d aliguori
  ;;
97 ac0df51d aliguori
  --cc=*) cc="$optarg"
98 ac0df51d aliguori
  ;;
99 2ff6b91e Juan Quintela
  --cpu=*) cpu="$optarg"
100 2ff6b91e Juan Quintela
  ;;
101 a558ee17 Juan Quintela
  --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS"
102 e2a2ed06 Juan Quintela
  ;;
103 e2a2ed06 Juan Quintela
  --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS"
104 e2a2ed06 Juan Quintela
  ;;
105 50e7b1a0 Juan Quintela
  --sparc_cpu=*)
106 50e7b1a0 Juan Quintela
    sparc_cpu="$optarg"
107 50e7b1a0 Juan Quintela
    case $sparc_cpu in
108 ed968ff1 Juan Quintela
    v7|v8|v8plus|v8plusa)
109 50e7b1a0 Juan Quintela
      cpu="sparc"
110 50e7b1a0 Juan Quintela
    ;;
111 50e7b1a0 Juan Quintela
    v9)
112 50e7b1a0 Juan Quintela
      cpu="sparc64"
113 50e7b1a0 Juan Quintela
    ;;
114 50e7b1a0 Juan Quintela
    *)
115 50e7b1a0 Juan Quintela
      echo "undefined SPARC architecture. Exiting";
116 50e7b1a0 Juan Quintela
      exit 1
117 50e7b1a0 Juan Quintela
    ;;
118 50e7b1a0 Juan Quintela
    esac
119 50e7b1a0 Juan Quintela
  ;;
120 ac0df51d aliguori
  esac
121 ac0df51d aliguori
done
122 ac0df51d aliguori
# OS specific
123 ac0df51d aliguori
# Using uname is really, really broken.  Once we have the right set of checks
124 ac0df51d aliguori
# we can eliminate it's usage altogether
125 ac0df51d aliguori
126 ac0df51d aliguori
cc="${cross_prefix}${cc}"
127 ac0df51d aliguori
ar="${cross_prefix}${ar}"
128 7aa486fe Anthony Liguori
objcopy="${cross_prefix}${objcopy}"
129 7aa486fe Anthony Liguori
ld="${cross_prefix}${ld}"
130 ac0df51d aliguori
131 be17dc90 Michael S. Tsirkin
# default flags for all hosts
132 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
133 be17dc90 Michael S. Tsirkin
CFLAGS="-g $CFLAGS"
134 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
135 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
136 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
137 84958305 Kirill A. Shutemov
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
138 be17dc90 Michael S. Tsirkin
QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
139 be17dc90 Michael S. Tsirkin
LDFLAGS="-g $LDFLAGS"
140 be17dc90 Michael S. Tsirkin
141 a0f291fc Juan Quintela
gcc_flags="-Wold-style-declaration -Wold-style-definition -fstack-protector-all"
142 be17dc90 Michael S. Tsirkin
cat > $TMPC << EOF
143 aa527b65 Aurelien Jarno
int main(void) { return 0; }
144 be17dc90 Michael S. Tsirkin
EOF
145 be17dc90 Michael S. Tsirkin
for flag in $gcc_flags; do
146 aa527b65 Aurelien Jarno
    if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
147 be17dc90 Michael S. Tsirkin
	QEMU_CFLAGS="$flag $QEMU_CFLAGS"
148 be17dc90 Michael S. Tsirkin
    fi
149 be17dc90 Michael S. Tsirkin
done
150 be17dc90 Michael S. Tsirkin
151 ac0df51d aliguori
# check that the C compiler works.
152 ac0df51d aliguori
cat > $TMPC <<EOF
153 ac0df51d aliguori
int main(void) {}
154 ac0df51d aliguori
EOF
155 ac0df51d aliguori
156 52166aa0 Juan Quintela
if compile_object ; then
157 ac0df51d aliguori
  : C compiler works ok
158 ac0df51d aliguori
else
159 ac0df51d aliguori
    echo "ERROR: \"$cc\" either does not exist or does not work"
160 ac0df51d aliguori
    exit 1
161 ac0df51d aliguori
fi
162 ac0df51d aliguori
163 ac0df51d aliguori
check_define() {
164 ac0df51d aliguori
cat > $TMPC <<EOF
165 ac0df51d aliguori
#if !defined($1)
166 ac0df51d aliguori
#error Not defined
167 ac0df51d aliguori
#endif
168 ac0df51d aliguori
int main(void) { return 0; }
169 ac0df51d aliguori
EOF
170 52166aa0 Juan Quintela
  compile_object
171 ac0df51d aliguori
}
172 ac0df51d aliguori
173 2ff6b91e Juan Quintela
if test ! -z "$cpu" ; then
174 2ff6b91e Juan Quintela
  # command line argument
175 2ff6b91e Juan Quintela
  :
176 2ff6b91e Juan Quintela
elif check_define __i386__ ; then
177 ac0df51d aliguori
  cpu="i386"
178 ac0df51d aliguori
elif check_define __x86_64__ ; then
179 ac0df51d aliguori
  cpu="x86_64"
180 3aa9bd6c blueswir1
elif check_define __sparc__ ; then
181 3aa9bd6c blueswir1
  # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
182 3aa9bd6c blueswir1
  # They must be specified using --sparc_cpu
183 3aa9bd6c blueswir1
  if check_define __arch64__ ; then
184 3aa9bd6c blueswir1
    cpu="sparc64"
185 3aa9bd6c blueswir1
  else
186 3aa9bd6c blueswir1
    cpu="sparc"
187 3aa9bd6c blueswir1
  fi
188 fdf7ed96 malc
elif check_define _ARCH_PPC ; then
189 fdf7ed96 malc
  if check_define _ARCH_PPC64 ; then
190 fdf7ed96 malc
    cpu="ppc64"
191 fdf7ed96 malc
  else
192 fdf7ed96 malc
    cpu="ppc"
193 fdf7ed96 malc
  fi
194 afa05235 Aurelien Jarno
elif check_define __mips__ ; then
195 afa05235 Aurelien Jarno
  cpu="mips"
196 477ba620 Aurelien Jarno
elif check_define __ia64__ ; then
197 477ba620 Aurelien Jarno
  cpu="ia64"
198 ac0df51d aliguori
else
199 fdf7ed96 malc
  cpu=`uname -m`
200 ac0df51d aliguori
fi
201 ac0df51d aliguori
202 5327cf48 bellard
target_list=""
203 7d13299d bellard
case "$cpu" in
204 afa05235 Aurelien Jarno
  alpha|cris|ia64|m68k|microblaze|ppc|ppc64|sparc64)
205 ea8f20f8 Juan Quintela
    cpu="$cpu"
206 ea8f20f8 Juan Quintela
  ;;
207 7d13299d bellard
  i386|i486|i586|i686|i86pc|BePC)
208 97a847bc bellard
    cpu="i386"
209 7d13299d bellard
  ;;
210 aaa5fa14 aurel32
  x86_64|amd64)
211 aaa5fa14 aurel32
    cpu="x86_64"
212 aaa5fa14 aurel32
  ;;
213 ba68055e bellard
  armv*b)
214 808c4954 bellard
    cpu="armv4b"
215 808c4954 bellard
  ;;
216 ba68055e bellard
  armv*l)
217 7d13299d bellard
    cpu="armv4l"
218 7d13299d bellard
  ;;
219 f54b3f92 aurel32
  parisc|parisc64)
220 f54b3f92 aurel32
    cpu="hppa"
221 f54b3f92 aurel32
  ;;
222 afa05235 Aurelien Jarno
  mips*)
223 afa05235 Aurelien Jarno
    cpu="mips"
224 afa05235 Aurelien Jarno
  ;;
225 24e804ec Alexander Graf
  s390)
226 fb3e5849 bellard
    cpu="s390"
227 fb3e5849 bellard
  ;;
228 24e804ec Alexander Graf
  s390x)
229 24e804ec Alexander Graf
    cpu="s390x"
230 24e804ec Alexander Graf
  ;;
231 3142255c blueswir1
  sparc|sun4[cdmuv])
232 ae228531 bellard
    cpu="sparc"
233 ae228531 bellard
  ;;
234 7d13299d bellard
  *)
235 7d13299d bellard
    cpu="unknown"
236 7d13299d bellard
  ;;
237 7d13299d bellard
esac
238 e2d52ad3 Juan Quintela
239 3a3fb96d Stefan Weil
# Default value for a variable defining feature "foo".
240 3a3fb96d Stefan Weil
#  * foo="no"  feature will only be used if --enable-foo arg is given
241 3a3fb96d Stefan Weil
#  * foo=""    feature will be searched for, and if found, will be used
242 3a3fb96d Stefan Weil
#              unless --disable-foo is given
243 3a3fb96d Stefan Weil
#  * foo="yes" this value will only be set by --enable-foo flag.
244 3a3fb96d Stefan Weil
#              feature will searched for,
245 3a3fb96d Stefan Weil
#              if not found, configure exits with error
246 e2d52ad3 Juan Quintela
#
247 3a3fb96d Stefan Weil
# Always add --enable-foo and --disable-foo command line args.
248 3a3fb96d Stefan Weil
# Distributions want to ensure that several features are compiled in, and it
249 3a3fb96d Stefan Weil
# is impossible without a --enable-foo that exits if a feature is not found.
250 e2d52ad3 Juan Quintela
251 a20a6f46 Juan Quintela
bluez=""
252 4ffcedb6 Juan Quintela
brlapi=""
253 788c8196 Juan Quintela
curl=""
254 c584a6d0 Juan Quintela
curses=""
255 a25dba17 Juan Quintela
docs=""
256 2df87df7 Juan Quintela
fdt=""
257 b31a0277 Juan Quintela
kvm=""
258 dae5079a Jan Kiszka
kvm_para=""
259 b0a47e79 Juan Quintela
nptl=""
260 c4198157 Juan Quintela
sdl=""
261 dfffc653 Juan Quintela
sparse="no"
262 ee682d27 Stefan Weil
uuid=""
263 dfb278bd Juan Quintela
vde=""
264 1be10ad2 Juan Quintela
vnc_tls=""
265 ea784e3b Juan Quintela
vnc_sasl=""
266 fc321b4b Juan Quintela
xen=""
267 5c6c3a6c Christoph Hellwig
linux_aio=""
268 d5970055 Michael S. Tsirkin
vhost_net=""
269 dfb278bd Juan Quintela
270 7d13299d bellard
gprof="no"
271 f8393946 aurel32
debug_tcg="no"
272 b4475aa2 Luiz Capitulino
debug_mon="no"
273 f3d08ee6 Paul Brook
debug="no"
274 1625af87 aliguori
strip_opt="yes"
275 7d13299d bellard
bigendian="no"
276 67b915a5 bellard
mingw32="no"
277 67b915a5 bellard
EXESUF=""
278 443f1376 bellard
slirp="yes"
279 102a52e4 bellard
fmod_lib=""
280 102a52e4 bellard
fmod_inc=""
281 2f6a1ab0 blueswir1
oss_lib=""
282 b1a550a0 pbrook
bsd="no"
283 5327cf48 bellard
linux="no"
284 d2c7c9b8 blueswir1
solaris="no"
285 05c2a3e7 bellard
profiler="no"
286 5b0753e0 bellard
cocoa="no"
287 0a8e90f4 pbrook
softmmu="yes"
288 831b7825 ths
linux_user="no"
289 831b7825 ths
darwin_user="no"
290 84778508 blueswir1
bsd_user="no"
291 379f6698 Paul Brook
guest_base=""
292 c5937220 pbrook
uname_release=""
293 e5d355d1 aliguori
io_thread="no"
294 8ff9cbf7 malc
mixemu="no"
295 eac30262 aliguori
kerneldir=""
296 b29fe3ed malc
aix="no"
297 77755340 ths
blobs="yes"
298 4a19f1ec pbrook
pkgversion=""
299 5495ed11 Luiz Capitulino
check_utests="no"
300 34005a00 Kirill A. Shutemov
user_pie="no"
301 20ff6c80 Anthony Liguori
zero_malloc=""
302 7d13299d bellard
303 7d13299d bellard
# OS specific
304 ac0df51d aliguori
if check_define __linux__ ; then
305 ac0df51d aliguori
  targetos="Linux"
306 ac0df51d aliguori
elif check_define _WIN32 ; then
307 ac0df51d aliguori
  targetos='MINGW32'
308 169dc5d3 blueswir1
elif check_define __OpenBSD__ ; then
309 169dc5d3 blueswir1
  targetos='OpenBSD'
310 169dc5d3 blueswir1
elif check_define __sun__ ; then
311 169dc5d3 blueswir1
  targetos='SunOS'
312 ac0df51d aliguori
else
313 ac0df51d aliguori
  targetos=`uname -s`
314 ac0df51d aliguori
fi
315 0dbfc675 Juan Quintela
316 7d13299d bellard
case $targetos in
317 c326e0af bellard
CYGWIN*)
318 0dbfc675 Juan Quintela
  mingw32="yes"
319 a558ee17 Juan Quintela
  QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS"
320 d5631638 malc
  audio_possible_drivers="winwave sdl"
321 d5631638 malc
  audio_drv_list="winwave"
322 c326e0af bellard
;;
323 67b915a5 bellard
MINGW32*)
324 0dbfc675 Juan Quintela
  mingw32="yes"
325 d5631638 malc
  audio_possible_drivers="winwave dsound sdl fmod"
326 d5631638 malc
  audio_drv_list="winwave"
327 67b915a5 bellard
;;
328 5c40d2bd ths
GNU/kFreeBSD)
329 a167ba50 Aurelien Jarno
  bsd="yes"
330 0dbfc675 Juan Quintela
  audio_drv_list="oss"
331 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
332 5c40d2bd ths
;;
333 7d3505c5 bellard
FreeBSD)
334 0dbfc675 Juan Quintela
  bsd="yes"
335 a167ba50 Aurelien Jarno
  make="gmake"
336 0dbfc675 Juan Quintela
  audio_drv_list="oss"
337 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
338 f01576f1 Juergen Lock
  # needed for kinfo_getvmmap(3) in libutil.h
339 f01576f1 Juergen Lock
  LIBS="-lutil $LIBS"
340 7d3505c5 bellard
;;
341 c5e97233 blueswir1
DragonFly)
342 0dbfc675 Juan Quintela
  bsd="yes"
343 a167ba50 Aurelien Jarno
  make="gmake"
344 0dbfc675 Juan Quintela
  audio_drv_list="oss"
345 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd pa"
346 c5e97233 blueswir1
;;
347 7d3505c5 bellard
NetBSD)
348 0dbfc675 Juan Quintela
  bsd="yes"
349 a167ba50 Aurelien Jarno
  make="gmake"
350 0dbfc675 Juan Quintela
  audio_drv_list="oss"
351 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd"
352 0dbfc675 Juan Quintela
  oss_lib="-lossaudio"
353 7d3505c5 bellard
;;
354 7d3505c5 bellard
OpenBSD)
355 0dbfc675 Juan Quintela
  bsd="yes"
356 a167ba50 Aurelien Jarno
  make="gmake"
357 0dbfc675 Juan Quintela
  audio_drv_list="oss"
358 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl esd"
359 0dbfc675 Juan Quintela
  oss_lib="-lossaudio"
360 7d3505c5 bellard
;;
361 83fb7adf bellard
Darwin)
362 0dbfc675 Juan Quintela
  bsd="yes"
363 0dbfc675 Juan Quintela
  darwin="yes"
364 0dbfc675 Juan Quintela
  # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can
365 0dbfc675 Juan Quintela
  # run 64-bit userspace code
366 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" ] ; then
367 aab8588a malc
    is_x86_64=`sysctl -n hw.optional.x86_64`
368 aab8588a malc
    [ "$is_x86_64" = "1" ] && cpu=x86_64
369 0dbfc675 Juan Quintela
  fi
370 0dbfc675 Juan Quintela
  if [ "$cpu" = "x86_64" ] ; then
371 a558ee17 Juan Quintela
    QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS"
372 0c439cbf Juan Quintela
    LDFLAGS="-arch x86_64 $LDFLAGS"
373 0dbfc675 Juan Quintela
  else
374 a558ee17 Juan Quintela
    QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS"
375 0dbfc675 Juan Quintela
  fi
376 0dbfc675 Juan Quintela
  darwin_user="yes"
377 0dbfc675 Juan Quintela
  cocoa="yes"
378 0dbfc675 Juan Quintela
  audio_drv_list="coreaudio"
379 0dbfc675 Juan Quintela
  audio_possible_drivers="coreaudio sdl fmod"
380 0dbfc675 Juan Quintela
  LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS"
381 7973f21c Juan Quintela
  libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu"
382 83fb7adf bellard
;;
383 ec530c81 bellard
SunOS)
384 0dbfc675 Juan Quintela
  solaris="yes"
385 0dbfc675 Juan Quintela
  make="gmake"
386 0dbfc675 Juan Quintela
  install="ginstall"
387 fa58948d Blue Swirl
  ld="gld"
388 0dbfc675 Juan Quintela
  needs_libsunmath="no"
389 0dbfc675 Juan Quintela
  solarisrev=`uname -r | cut -f2 -d.`
390 0dbfc675 Juan Quintela
  # have to select again, because `uname -m` returns i86pc
391 0dbfc675 Juan Quintela
  # even on an x86_64 box.
392 0dbfc675 Juan Quintela
  solariscpu=`isainfo -k`
393 0dbfc675 Juan Quintela
  if test "${solariscpu}" = "amd64" ; then
394 0dbfc675 Juan Quintela
    cpu="x86_64"
395 0dbfc675 Juan Quintela
  fi
396 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
397 0dbfc675 Juan Quintela
    if test "$solarisrev" -le 9 ; then
398 0dbfc675 Juan Quintela
      if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
399 0dbfc675 Juan Quintela
        needs_libsunmath="yes"
400 f14bfdf9 Juan Quintela
        QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS"
401 f14bfdf9 Juan Quintela
        LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS"
402 f14bfdf9 Juan Quintela
        LIBS="-lsunmath $LIBS"
403 0dbfc675 Juan Quintela
      else
404 0dbfc675 Juan Quintela
        echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
405 0dbfc675 Juan Quintela
        echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
406 0dbfc675 Juan Quintela
        echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
407 0dbfc675 Juan Quintela
        echo "Studio 11 can be downloaded from www.sun.com."
408 0dbfc675 Juan Quintela
        exit 1
409 0dbfc675 Juan Quintela
      fi
410 86b2bd93 ths
    fi
411 0dbfc675 Juan Quintela
  fi
412 0dbfc675 Juan Quintela
  if test -f /usr/include/sys/soundcard.h ; then
413 0dbfc675 Juan Quintela
    audio_drv_list="oss"
414 0dbfc675 Juan Quintela
  fi
415 0dbfc675 Juan Quintela
  audio_possible_drivers="oss sdl"
416 d741429a Blue Swirl
# needed for CMSG_ macros in sys/socket.h
417 d741429a Blue Swirl
  QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS"
418 d741429a Blue Swirl
# needed for TIOCWIN* defines in termios.h
419 d741429a Blue Swirl
  QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
420 a558ee17 Juan Quintela
  QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS"
421 e174c0bb Juan Quintela
  LIBS="-lsocket -lnsl -lresolv $LIBS"
422 86b2bd93 ths
;;
423 b29fe3ed malc
AIX)
424 0dbfc675 Juan Quintela
  aix="yes"
425 0dbfc675 Juan Quintela
  make="gmake"
426 b29fe3ed malc
;;
427 1d14ffa9 bellard
*)
428 0dbfc675 Juan Quintela
  audio_drv_list="oss"
429 0dbfc675 Juan Quintela
  audio_possible_drivers="oss alsa sdl esd pa"
430 0dbfc675 Juan Quintela
  linux="yes"
431 0dbfc675 Juan Quintela
  linux_user="yes"
432 0dbfc675 Juan Quintela
  usb="linux"
433 0dbfc675 Juan Quintela
  if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
434 c2de5c91 malc
    audio_possible_drivers="$audio_possible_drivers fmod"
435 0dbfc675 Juan Quintela
  fi
436 fb065187 bellard
;;
437 7d13299d bellard
esac
438 7d13299d bellard
439 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
440 b1a550a0 pbrook
  if [ "$darwin" != "yes" ] ; then
441 68063649 blueswir1
    usb="bsd"
442 83fb7adf bellard
  fi
443 84778508 blueswir1
  bsd_user="yes"
444 7d3505c5 bellard
fi
445 7d3505c5 bellard
446 3457a3f8 Juan Quintela
if test "$mingw32" = "yes" ; then
447 3457a3f8 Juan Quintela
  EXESUF=".exe"
448 a558ee17 Juan Quintela
  QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
449 e94a7936 Stefan Weil
  # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
450 e94a7936 Stefan Weil
  QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
451 884044aa Juan Quintela
  LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
452 3457a3f8 Juan Quintela
fi
453 3457a3f8 Juan Quintela
454 7d13299d bellard
# find source path
455 ad064840 pbrook
source_path=`dirname "$0"`
456 59faef3a balrog
source_path_used="no"
457 59faef3a balrog
workdir=`pwd`
458 ad064840 pbrook
if [ -z "$source_path" ]; then
459 59faef3a balrog
    source_path=$workdir
460 ad064840 pbrook
else
461 ad064840 pbrook
    source_path=`cd "$source_path"; pwd`
462 7d13299d bellard
fi
463 724db118 pbrook
[ -f "$workdir/vl.c" ] || source_path_used="yes"
464 7d13299d bellard
465 487fefdb Anthony Liguori
werror=""
466 85aa5189 bellard
467 7d13299d bellard
for opt do
468 a46e4035 pbrook
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
469 7d13299d bellard
  case "$opt" in
470 2efc3265 bellard
  --help|-h) show_help=yes
471 2efc3265 bellard
  ;;
472 b1a550a0 pbrook
  --prefix=*) prefix="$optarg"
473 7d13299d bellard
  ;;
474 b1a550a0 pbrook
  --interp-prefix=*) interp_prefix="$optarg"
475 32ce6337 bellard
  ;;
476 b1a550a0 pbrook
  --source-path=*) source_path="$optarg"
477 ad064840 pbrook
  source_path_used="yes"
478 7d13299d bellard
  ;;
479 ac0df51d aliguori
  --cross-prefix=*)
480 7d13299d bellard
  ;;
481 ac0df51d aliguori
  --cc=*)
482 7d13299d bellard
  ;;
483 b1a550a0 pbrook
  --host-cc=*) host_cc="$optarg"
484 83469015 bellard
  ;;
485 b1a550a0 pbrook
  --make=*) make="$optarg"
486 7d13299d bellard
  ;;
487 6a882643 pbrook
  --install=*) install="$optarg"
488 6a882643 pbrook
  ;;
489 e2a2ed06 Juan Quintela
  --extra-cflags=*)
490 7d13299d bellard
  ;;
491 e2a2ed06 Juan Quintela
  --extra-ldflags=*)
492 7d13299d bellard
  ;;
493 2ff6b91e Juan Quintela
  --cpu=*)
494 7d13299d bellard
  ;;
495 b1a550a0 pbrook
  --target-list=*) target_list="$optarg"
496 de83cd02 bellard
  ;;
497 7d13299d bellard
  --enable-gprof) gprof="yes"
498 7d13299d bellard
  ;;
499 79427693 Loïc Minier
  --static)
500 79427693 Loïc Minier
    static="yes"
501 79427693 Loïc Minier
    LDFLAGS="-static $LDFLAGS"
502 43ce4dfe bellard
  ;;
503 ca2fb938 Andre Przywara
  --sysconfdir=*) sysconfdir="$optarg"
504 07381cc1 Anthony Liguori
  ;;
505 97a847bc bellard
  --disable-sdl) sdl="no"
506 97a847bc bellard
  ;;
507 c4198157 Juan Quintela
  --enable-sdl) sdl="yes"
508 c4198157 Juan Quintela
  ;;
509 0c58ac1c malc
  --fmod-lib=*) fmod_lib="$optarg"
510 1d14ffa9 bellard
  ;;
511 c2de5c91 malc
  --fmod-inc=*) fmod_inc="$optarg"
512 c2de5c91 malc
  ;;
513 2f6a1ab0 blueswir1
  --oss-lib=*) oss_lib="$optarg"
514 2f6a1ab0 blueswir1
  ;;
515 2fa7d3bf malc
  --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
516 102a52e4 bellard
  ;;
517 0c58ac1c malc
  --audio-drv-list=*) audio_drv_list="$optarg"
518 102a52e4 bellard
  ;;
519 eb852011 Markus Armbruster
  --block-drv-whitelist=*) block_drv_whitelist=`echo "$optarg" | sed -e 's/,/ /g'`
520 eb852011 Markus Armbruster
  ;;
521 f8393946 aurel32
  --enable-debug-tcg) debug_tcg="yes"
522 f8393946 aurel32
  ;;
523 f8393946 aurel32
  --disable-debug-tcg) debug_tcg="no"
524 f8393946 aurel32
  ;;
525 b4475aa2 Luiz Capitulino
  --enable-debug-mon) debug_mon="yes"
526 b4475aa2 Luiz Capitulino
  ;;
527 b4475aa2 Luiz Capitulino
  --disable-debug-mon) debug_mon="no"
528 b4475aa2 Luiz Capitulino
  ;;
529 f3d08ee6 Paul Brook
  --enable-debug)
530 f3d08ee6 Paul Brook
      # Enable debugging options that aren't excessively noisy
531 f3d08ee6 Paul Brook
      debug_tcg="yes"
532 b4475aa2 Luiz Capitulino
      debug_mon="yes"
533 f3d08ee6 Paul Brook
      debug="yes"
534 f3d08ee6 Paul Brook
      strip_opt="no"
535 f3d08ee6 Paul Brook
  ;;
536 03b4fe7d aliguori
  --enable-sparse) sparse="yes"
537 03b4fe7d aliguori
  ;;
538 03b4fe7d aliguori
  --disable-sparse) sparse="no"
539 03b4fe7d aliguori
  ;;
540 1625af87 aliguori
  --disable-strip) strip_opt="no"
541 1625af87 aliguori
  ;;
542 8d5d2d4c ths
  --disable-vnc-tls) vnc_tls="no"
543 8d5d2d4c ths
  ;;
544 1be10ad2 Juan Quintela
  --enable-vnc-tls) vnc_tls="yes"
545 1be10ad2 Juan Quintela
  ;;
546 2f9606b3 aliguori
  --disable-vnc-sasl) vnc_sasl="no"
547 2f9606b3 aliguori
  ;;
548 ea784e3b Juan Quintela
  --enable-vnc-sasl) vnc_sasl="yes"
549 ea784e3b Juan Quintela
  ;;
550 443f1376 bellard
  --disable-slirp) slirp="no"
551 1d14ffa9 bellard
  ;;
552 ee682d27 Stefan Weil
  --disable-uuid) uuid="no"
553 ee682d27 Stefan Weil
  ;;
554 ee682d27 Stefan Weil
  --enable-uuid) uuid="yes"
555 ee682d27 Stefan Weil
  ;;
556 e0e6c8c0 aliguori
  --disable-vde) vde="no"
557 8a16d273 ths
  ;;
558 dfb278bd Juan Quintela
  --enable-vde) vde="yes"
559 dfb278bd Juan Quintela
  ;;
560 e37630ca aliguori
  --disable-xen) xen="no"
561 e37630ca aliguori
  ;;
562 fc321b4b Juan Quintela
  --enable-xen) xen="yes"
563 fc321b4b Juan Quintela
  ;;
564 2e4d9fb1 aurel32
  --disable-brlapi) brlapi="no"
565 2e4d9fb1 aurel32
  ;;
566 4ffcedb6 Juan Quintela
  --enable-brlapi) brlapi="yes"
567 4ffcedb6 Juan Quintela
  ;;
568 fb599c9a balrog
  --disable-bluez) bluez="no"
569 fb599c9a balrog
  ;;
570 a20a6f46 Juan Quintela
  --enable-bluez) bluez="yes"
571 a20a6f46 Juan Quintela
  ;;
572 7ba1e619 aliguori
  --disable-kvm) kvm="no"
573 7ba1e619 aliguori
  ;;
574 b31a0277 Juan Quintela
  --enable-kvm) kvm="yes"
575 b31a0277 Juan Quintela
  ;;
576 05c2a3e7 bellard
  --enable-profiler) profiler="yes"
577 05c2a3e7 bellard
  ;;
578 c2de5c91 malc
  --enable-cocoa)
579 c2de5c91 malc
      cocoa="yes" ;
580 c2de5c91 malc
      sdl="no" ;
581 c2de5c91 malc
      audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
582 1d14ffa9 bellard
  ;;
583 cad25d69 pbrook
  --disable-system) softmmu="no"
584 0a8e90f4 pbrook
  ;;
585 cad25d69 pbrook
  --enable-system) softmmu="yes"
586 0a8e90f4 pbrook
  ;;
587 0953a80f Zachary Amsden
  --disable-user)
588 0953a80f Zachary Amsden
      linux_user="no" ;
589 0953a80f Zachary Amsden
      bsd_user="no" ;
590 0953a80f Zachary Amsden
      darwin_user="no"
591 0953a80f Zachary Amsden
  ;;
592 0953a80f Zachary Amsden
  --enable-user) ;;
593 831b7825 ths
  --disable-linux-user) linux_user="no"
594 0a8e90f4 pbrook
  ;;
595 831b7825 ths
  --enable-linux-user) linux_user="yes"
596 831b7825 ths
  ;;
597 831b7825 ths
  --disable-darwin-user) darwin_user="no"
598 831b7825 ths
  ;;
599 831b7825 ths
  --enable-darwin-user) darwin_user="yes"
600 0a8e90f4 pbrook
  ;;
601 84778508 blueswir1
  --disable-bsd-user) bsd_user="no"
602 84778508 blueswir1
  ;;
603 84778508 blueswir1
  --enable-bsd-user) bsd_user="yes"
604 84778508 blueswir1
  ;;
605 379f6698 Paul Brook
  --enable-guest-base) guest_base="yes"
606 379f6698 Paul Brook
  ;;
607 379f6698 Paul Brook
  --disable-guest-base) guest_base="no"
608 379f6698 Paul Brook
  ;;
609 34005a00 Kirill A. Shutemov
  --enable-user-pie) user_pie="yes"
610 34005a00 Kirill A. Shutemov
  ;;
611 34005a00 Kirill A. Shutemov
  --disable-user-pie) user_pie="no"
612 34005a00 Kirill A. Shutemov
  ;;
613 c5937220 pbrook
  --enable-uname-release=*) uname_release="$optarg"
614 c5937220 pbrook
  ;;
615 3142255c blueswir1
  --sparc_cpu=*)
616 3142255c blueswir1
  ;;
617 85aa5189 bellard
  --enable-werror) werror="yes"
618 85aa5189 bellard
  ;;
619 85aa5189 bellard
  --disable-werror) werror="no"
620 85aa5189 bellard
  ;;
621 4d3b6f6e balrog
  --disable-curses) curses="no"
622 4d3b6f6e balrog
  ;;
623 c584a6d0 Juan Quintela
  --enable-curses) curses="yes"
624 c584a6d0 Juan Quintela
  ;;
625 769ce76d Alexander Graf
  --disable-curl) curl="no"
626 769ce76d Alexander Graf
  ;;
627 788c8196 Juan Quintela
  --enable-curl) curl="yes"
628 788c8196 Juan Quintela
  ;;
629 2df87df7 Juan Quintela
  --disable-fdt) fdt="no"
630 2df87df7 Juan Quintela
  ;;
631 2df87df7 Juan Quintela
  --enable-fdt) fdt="yes"
632 2df87df7 Juan Quintela
  ;;
633 5495ed11 Luiz Capitulino
  --disable-check-utests) check_utests="no"
634 5495ed11 Luiz Capitulino
  ;;
635 5495ed11 Luiz Capitulino
  --enable-check-utests) check_utests="yes"
636 5495ed11 Luiz Capitulino
  ;;
637 bd0c5661 pbrook
  --disable-nptl) nptl="no"
638 bd0c5661 pbrook
  ;;
639 b0a47e79 Juan Quintela
  --enable-nptl) nptl="yes"
640 b0a47e79 Juan Quintela
  ;;
641 8ff9cbf7 malc
  --enable-mixemu) mixemu="yes"
642 8ff9cbf7 malc
  ;;
643 5c6c3a6c Christoph Hellwig
  --disable-linux-aio) linux_aio="no"
644 5c6c3a6c Christoph Hellwig
  ;;
645 5c6c3a6c Christoph Hellwig
  --enable-linux-aio) linux_aio="yes"
646 5c6c3a6c Christoph Hellwig
  ;;
647 e5d355d1 aliguori
  --enable-io-thread) io_thread="yes"
648 e5d355d1 aliguori
  ;;
649 77755340 ths
  --disable-blobs) blobs="no"
650 77755340 ths
  ;;
651 eac30262 aliguori
  --kerneldir=*) kerneldir="$optarg"
652 eac30262 aliguori
  ;;
653 4a19f1ec pbrook
  --with-pkgversion=*) pkgversion=" ($optarg)"
654 4a19f1ec pbrook
  ;;
655 a25dba17 Juan Quintela
  --disable-docs) docs="no"
656 70ec5dc0 Anthony Liguori
  ;;
657 a25dba17 Juan Quintela
  --enable-docs) docs="yes"
658 83a3ab8b Juan Quintela
  ;;
659 d5970055 Michael S. Tsirkin
  --disable-vhost-net) vhost_net="no"
660 d5970055 Michael S. Tsirkin
  ;;
661 d5970055 Michael S. Tsirkin
  --enable-vhost-net) vhost_net="yes"
662 d5970055 Michael S. Tsirkin
  ;;
663 7f1559c6 balrog
  *) echo "ERROR: unknown option $opt"; show_help="yes"
664 7f1559c6 balrog
  ;;
665 7d13299d bellard
  esac
666 7d13299d bellard
done
667 7d13299d bellard
668 3142255c blueswir1
#
669 3142255c blueswir1
# If cpu ~= sparc and  sparc_cpu hasn't been defined, plug in the right
670 a558ee17 Juan Quintela
# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
671 3142255c blueswir1
#
672 379f6698 Paul Brook
host_guest_base="no"
673 40293e58 bellard
case "$cpu" in
674 ed968ff1 Juan Quintela
    sparc) case $sparc_cpu in
675 ed968ff1 Juan Quintela
           v7|v8)
676 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
677 ed968ff1 Juan Quintela
           ;;
678 ed968ff1 Juan Quintela
           v8plus|v8plusa)
679 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS"
680 ed968ff1 Juan Quintela
           ;;
681 ed968ff1 Juan Quintela
           *) # sparc_cpu not defined in the command line
682 a558ee17 Juan Quintela
             QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS"
683 ed968ff1 Juan Quintela
           esac
684 ed968ff1 Juan Quintela
           LDFLAGS="-m32 $LDFLAGS"
685 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
686 762e8230 blueswir1
           if test "$solaris" = "no" ; then
687 a558ee17 Juan Quintela
             QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
688 c81da56e Juan Quintela
             helper_cflags="-ffixed-i0"
689 762e8230 blueswir1
           fi
690 3142255c blueswir1
           ;;
691 ed968ff1 Juan Quintela
    sparc64)
692 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS"
693 ed968ff1 Juan Quintela
           LDFLAGS="-m64 $LDFLAGS"
694 a558ee17 Juan Quintela
           QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS"
695 ed968ff1 Juan Quintela
           if test "$solaris" != "no" ; then
696 a558ee17 Juan Quintela
             QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS"
697 762e8230 blueswir1
           fi
698 3142255c blueswir1
           ;;
699 76d83bde ths
    s390)
700 a558ee17 Juan Quintela
           QEMU_CFLAGS="-march=z900 $QEMU_CFLAGS"
701 76d83bde ths
           ;;
702 40293e58 bellard
    i386)
703 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
704 0c439cbf Juan Quintela
           LDFLAGS="-m32 $LDFLAGS"
705 c81da56e Juan Quintela
           helper_cflags="-fomit-frame-pointer"
706 379f6698 Paul Brook
           host_guest_base="yes"
707 40293e58 bellard
           ;;
708 40293e58 bellard
    x86_64)
709 a558ee17 Juan Quintela
           QEMU_CFLAGS="-m64 $QEMU_CFLAGS"
710 0c439cbf Juan Quintela
           LDFLAGS="-m64 $LDFLAGS"
711 379f6698 Paul Brook
           host_guest_base="yes"
712 379f6698 Paul Brook
           ;;
713 379f6698 Paul Brook
    arm*)
714 379f6698 Paul Brook
           host_guest_base="yes"
715 40293e58 bellard
           ;;
716 f6548c0a malc
    ppc*)
717 f6548c0a malc
           host_guest_base="yes"
718 f6548c0a malc
           ;;
719 cc01cc8e Aurelien Jarno
    mips*)
720 cc01cc8e Aurelien Jarno
           host_guest_base="yes"
721 cc01cc8e Aurelien Jarno
           ;;
722 477ba620 Aurelien Jarno
    ia64*)
723 477ba620 Aurelien Jarno
           host_guest_base="yes"
724 477ba620 Aurelien Jarno
           ;;
725 fd76e73a Richard Henderson
    hppa*)
726 fd76e73a Richard Henderson
           host_guest_base="yes"
727 fd76e73a Richard Henderson
           ;;
728 3142255c blueswir1
esac
729 3142255c blueswir1
730 379f6698 Paul Brook
[ -z "$guest_base" ] && guest_base="$host_guest_base"
731 379f6698 Paul Brook
732 af5db58e pbrook
if test x"$show_help" = x"yes" ; then
733 af5db58e pbrook
cat << EOF
734 af5db58e pbrook
735 af5db58e pbrook
Usage: configure [options]
736 af5db58e pbrook
Options: [defaults in brackets after descriptions]
737 af5db58e pbrook
738 af5db58e pbrook
EOF
739 af5db58e pbrook
echo "Standard options:"
740 af5db58e pbrook
echo "  --help                   print this message"
741 af5db58e pbrook
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
742 af5db58e pbrook
echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
743 af5db58e pbrook
echo "                           use %M for cpu name [$interp_prefix]"
744 af5db58e pbrook
echo "  --target-list=LIST       set target list [$target_list]"
745 af5db58e pbrook
echo ""
746 af5db58e pbrook
echo "Advanced options (experts only):"
747 af5db58e pbrook
echo "  --source-path=PATH       path of source code [$source_path]"
748 af5db58e pbrook
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
749 af5db58e pbrook
echo "  --cc=CC                  use C compiler CC [$cc]"
750 af5db58e pbrook
echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
751 a558ee17 Juan Quintela
echo "  --extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS"
752 e3fc14c3 Jan Kiszka
echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
753 af5db58e pbrook
echo "  --make=MAKE              use specified make [$make]"
754 6a882643 pbrook
echo "  --install=INSTALL        use specified install [$install]"
755 af5db58e pbrook
echo "  --static                 enable static build [$static]"
756 07381cc1 Anthony Liguori
echo "  --sysconfdir=PATH        install config in PATH"
757 f8393946 aurel32
echo "  --enable-debug-tcg       enable TCG debugging"
758 f8393946 aurel32
echo "  --disable-debug-tcg      disable TCG debugging (default)"
759 09695a4a Stefan Weil
echo "  --enable-debug           enable common debug build options"
760 890b1658 aliguori
echo "  --enable-sparse          enable sparse checker"
761 890b1658 aliguori
echo "  --disable-sparse         disable sparse checker (default)"
762 1625af87 aliguori
echo "  --disable-strip          disable stripping binaries"
763 85aa5189 bellard
echo "  --disable-werror         disable compilation abort on warning"
764 fe8f78e4 balrog
echo "  --disable-sdl            disable SDL"
765 c4198157 Juan Quintela
echo "  --enable-sdl             enable SDL"
766 af5db58e pbrook
echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
767 c2de5c91 malc
echo "  --audio-drv-list=LIST    set audio drivers list:"
768 c2de5c91 malc
echo "                           Available drivers: $audio_possible_drivers"
769 4c9b53e3 malc
echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_list]"
770 4c9b53e3 malc
echo "                           Available cards: $audio_possible_cards"
771 eb852011 Markus Armbruster
echo "  --block-drv-whitelist=L  set block driver whitelist"
772 eb852011 Markus Armbruster
echo "                           (affects only QEMU, not qemu-img)"
773 8ff9cbf7 malc
echo "  --enable-mixemu          enable mixer emulation"
774 e37630ca aliguori
echo "  --disable-xen            disable xen backend driver support"
775 fc321b4b Juan Quintela
echo "  --enable-xen             enable xen backend driver support"
776 2e4d9fb1 aurel32
echo "  --disable-brlapi         disable BrlAPI"
777 4ffcedb6 Juan Quintela
echo "  --enable-brlapi          enable BrlAPI"
778 8d5d2d4c ths
echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
779 1be10ad2 Juan Quintela
echo "  --enable-vnc-tls         enable TLS encryption for VNC server"
780 2f9606b3 aliguori
echo "  --disable-vnc-sasl       disable SASL encryption for VNC server"
781 ea784e3b Juan Quintela
echo "  --enable-vnc-sasl        enable SASL encryption for VNC server"
782 af896aaa pbrook
echo "  --disable-curses         disable curses output"
783 c584a6d0 Juan Quintela
echo "  --enable-curses          enable curses output"
784 769ce76d Alexander Graf
echo "  --disable-curl           disable curl connectivity"
785 788c8196 Juan Quintela
echo "  --enable-curl            enable curl connectivity"
786 2df87df7 Juan Quintela
echo "  --disable-fdt            disable fdt device tree"
787 2df87df7 Juan Quintela
echo "  --enable-fdt             enable fdt device tree"
788 5495ed11 Luiz Capitulino
echo "  --disable-check-utests   disable check unit-tests"
789 5495ed11 Luiz Capitulino
echo "  --enable-check-utests    enable check unit-tests"
790 fb599c9a balrog
echo "  --disable-bluez          disable bluez stack connectivity"
791 a20a6f46 Juan Quintela
echo "  --enable-bluez           enable bluez stack connectivity"
792 7ba1e619 aliguori
echo "  --disable-kvm            disable KVM acceleration support"
793 b31a0277 Juan Quintela
echo "  --enable-kvm             enable KVM acceleration support"
794 bd0c5661 pbrook
echo "  --disable-nptl           disable usermode NPTL support"
795 e5934d33 Andre Przywara
echo "  --enable-nptl            enable usermode NPTL support"
796 af5db58e pbrook
echo "  --enable-system          enable all system emulation targets"
797 af5db58e pbrook
echo "  --disable-system         disable all system emulation targets"
798 0953a80f Zachary Amsden
echo "  --enable-user            enable supported user emulation targets"
799 0953a80f Zachary Amsden
echo "  --disable-user           disable all user emulation targets"
800 831b7825 ths
echo "  --enable-linux-user      enable all linux usermode emulation targets"
801 831b7825 ths
echo "  --disable-linux-user     disable all linux usermode emulation targets"
802 831b7825 ths
echo "  --enable-darwin-user     enable all darwin usermode emulation targets"
803 831b7825 ths
echo "  --disable-darwin-user    disable all darwin usermode emulation targets"
804 84778508 blueswir1
echo "  --enable-bsd-user        enable all BSD usermode emulation targets"
805 84778508 blueswir1
echo "  --disable-bsd-user       disable all BSD usermode emulation targets"
806 379f6698 Paul Brook
echo "  --enable-guest-base      enable GUEST_BASE support for usermode"
807 379f6698 Paul Brook
echo "                           emulation targets"
808 379f6698 Paul Brook
echo "  --disable-guest-base     disable GUEST_BASE support"
809 34005a00 Kirill A. Shutemov
echo "  --enable-user-pie        build usermode emulation targets as PIE"
810 34005a00 Kirill A. Shutemov
echo "  --disable-user-pie       do not build usermode emulation targets as PIE"
811 af5db58e pbrook
echo "  --fmod-lib               path to FMOD library"
812 af5db58e pbrook
echo "  --fmod-inc               path to FMOD includes"
813 2f6a1ab0 blueswir1
echo "  --oss-lib                path to OSS library"
814 c5937220 pbrook
echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
815 3142255c blueswir1
echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
816 ee682d27 Stefan Weil
echo "  --disable-uuid           disable uuid support"
817 ee682d27 Stefan Weil
echo "  --enable-uuid            enable uuid support"
818 e0e6c8c0 aliguori
echo "  --disable-vde            disable support for vde network"
819 dfb278bd Juan Quintela
echo "  --enable-vde             enable support for vde network"
820 5c6c3a6c Christoph Hellwig
echo "  --disable-linux-aio      disable Linux AIO support"
821 5c6c3a6c Christoph Hellwig
echo "  --enable-linux-aio       enable Linux AIO support"
822 e5d355d1 aliguori
echo "  --enable-io-thread       enable IO thread"
823 77755340 ths
echo "  --disable-blobs          disable installing provided firmware blobs"
824 eac30262 aliguori
echo "  --kerneldir=PATH         look for kernel includes in PATH"
825 d2807bc9 Dirk Ullrich
echo "  --enable-docs            enable documentation build"
826 d2807bc9 Dirk Ullrich
echo "  --disable-docs           disable documentation build"
827 d5970055 Michael S. Tsirkin
echo "  --disable-vhost-net      disable vhost-net acceleration support"
828 d5970055 Michael S. Tsirkin
echo "  --enable-vhost-net       enable vhost-net acceleration support"
829 af5db58e pbrook
echo ""
830 5bf08934 ths
echo "NOTE: The object files are built at the place where configure is launched"
831 af5db58e pbrook
exit 1
832 af5db58e pbrook
fi
833 af5db58e pbrook
834 ec530c81 bellard
#
835 ec530c81 bellard
# Solaris specific configure tool chain decisions
836 ec530c81 bellard
#
837 ec530c81 bellard
if test "$solaris" = "yes" ; then
838 6792aa11 Loïc Minier
  if has $install; then
839 6792aa11 Loïc Minier
    :
840 6792aa11 Loïc Minier
  else
841 ec530c81 bellard
    echo "Solaris install program not found. Use --install=/usr/ucb/install or"
842 ec530c81 bellard
    echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
843 ec530c81 bellard
    echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
844 ec530c81 bellard
    exit 1
845 ec530c81 bellard
  fi
846 6792aa11 Loïc Minier
  if test "`path_of $install`" = "/usr/sbin/install" ; then
847 ec530c81 bellard
    echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
848 ec530c81 bellard
    echo "try ginstall from the GNU fileutils available from www.blastwave.org"
849 ec530c81 bellard
    echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
850 ec530c81 bellard
    exit 1
851 ec530c81 bellard
  fi
852 6792aa11 Loïc Minier
  if has ar; then
853 6792aa11 Loïc Minier
    :
854 6792aa11 Loïc Minier
  else
855 ec530c81 bellard
    echo "Error: No path includes ar"
856 ec530c81 bellard
    if test -f /usr/ccs/bin/ar ; then
857 ec530c81 bellard
      echo "Add /usr/ccs/bin to your path and rerun configure"
858 ec530c81 bellard
    fi
859 ec530c81 bellard
    exit 1
860 ec530c81 bellard
  fi
861 5fafdf24 ths
fi
862 ec530c81 bellard
863 ec530c81 bellard
864 5327cf48 bellard
if test -z "$target_list" ; then
865 5327cf48 bellard
# these targets are portable
866 0a8e90f4 pbrook
    if [ "$softmmu" = "yes" ] ; then
867 2408a527 aurel32
        target_list="\
868 2408a527 aurel32
i386-softmmu \
869 2408a527 aurel32
x86_64-softmmu \
870 2408a527 aurel32
arm-softmmu \
871 2408a527 aurel32
cris-softmmu \
872 2408a527 aurel32
m68k-softmmu \
873 72b675ca Edgar E. Iglesias
microblaze-softmmu \
874 2408a527 aurel32
mips-softmmu \
875 2408a527 aurel32
mipsel-softmmu \
876 2408a527 aurel32
mips64-softmmu \
877 2408a527 aurel32
mips64el-softmmu \
878 2408a527 aurel32
ppc-softmmu \
879 2408a527 aurel32
ppcemb-softmmu \
880 2408a527 aurel32
ppc64-softmmu \
881 2408a527 aurel32
sh4-softmmu \
882 2408a527 aurel32
sh4eb-softmmu \
883 2408a527 aurel32
sparc-softmmu \
884 1b64fcae Igor V. Kovalenko
sparc64-softmmu \
885 2408a527 aurel32
"
886 0a8e90f4 pbrook
    fi
887 5327cf48 bellard
# the following are Linux specific
888 831b7825 ths
    if [ "$linux_user" = "yes" ] ; then
889 2408a527 aurel32
        target_list="${target_list}\
890 2408a527 aurel32
i386-linux-user \
891 2408a527 aurel32
x86_64-linux-user \
892 2408a527 aurel32
alpha-linux-user \
893 2408a527 aurel32
arm-linux-user \
894 2408a527 aurel32
armeb-linux-user \
895 2408a527 aurel32
cris-linux-user \
896 2408a527 aurel32
m68k-linux-user \
897 72b675ca Edgar E. Iglesias
microblaze-linux-user \
898 2408a527 aurel32
mips-linux-user \
899 2408a527 aurel32
mipsel-linux-user \
900 2408a527 aurel32
ppc-linux-user \
901 2408a527 aurel32
ppc64-linux-user \
902 2408a527 aurel32
ppc64abi32-linux-user \
903 2408a527 aurel32
sh4-linux-user \
904 2408a527 aurel32
sh4eb-linux-user \
905 2408a527 aurel32
sparc-linux-user \
906 2408a527 aurel32
sparc64-linux-user \
907 2408a527 aurel32
sparc32plus-linux-user \
908 2408a527 aurel32
"
909 831b7825 ths
    fi
910 831b7825 ths
# the following are Darwin specific
911 831b7825 ths
    if [ "$darwin_user" = "yes" ] ; then
912 6cdc7375 malc
        target_list="$target_list i386-darwin-user ppc-darwin-user "
913 5327cf48 bellard
    fi
914 84778508 blueswir1
# the following are BSD specific
915 84778508 blueswir1
    if [ "$bsd_user" = "yes" ] ; then
916 84778508 blueswir1
        target_list="${target_list}\
917 31fc12df blueswir1
i386-bsd-user \
918 31fc12df blueswir1
x86_64-bsd-user \
919 31fc12df blueswir1
sparc-bsd-user \
920 84778508 blueswir1
sparc64-bsd-user \
921 84778508 blueswir1
"
922 84778508 blueswir1
    fi
923 6e20a45f bellard
else
924 b1a550a0 pbrook
    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
925 5327cf48 bellard
fi
926 0a8e90f4 pbrook
if test -z "$target_list" ; then
927 0a8e90f4 pbrook
    echo "No targets enabled"
928 0a8e90f4 pbrook
    exit 1
929 0a8e90f4 pbrook
fi
930 5327cf48 bellard
931 249247c9 Juan Quintela
feature_not_found() {
932 249247c9 Juan Quintela
  feature=$1
933 249247c9 Juan Quintela
934 249247c9 Juan Quintela
  echo "ERROR"
935 249247c9 Juan Quintela
  echo "ERROR: User requested feature $feature"
936 9332f6a2 Sebastian Herbszt
  echo "ERROR: configure was not able to find it"
937 249247c9 Juan Quintela
  echo "ERROR"
938 249247c9 Juan Quintela
  exit 1;
939 249247c9 Juan Quintela
}
940 249247c9 Juan Quintela
941 7d13299d bellard
if test -z "$cross_prefix" ; then
942 7d13299d bellard
943 7d13299d bellard
# ---
944 7d13299d bellard
# big/little endian test
945 7d13299d bellard
cat > $TMPC << EOF
946 7d13299d bellard
#include <inttypes.h>
947 7d13299d bellard
int main(int argc, char ** argv){
948 1d14ffa9 bellard
        volatile uint32_t i=0x01234567;
949 1d14ffa9 bellard
        return (*((uint8_t*)(&i))) == 0x67;
950 7d13299d bellard
}
951 7d13299d bellard
EOF
952 7d13299d bellard
953 52166aa0 Juan Quintela
if compile_prog "" "" ; then
954 7d13299d bellard
$TMPE && bigendian="yes"
955 7d13299d bellard
else
956 7d13299d bellard
echo big/little test failed
957 7d13299d bellard
fi
958 7d13299d bellard
959 7d13299d bellard
else
960 7d13299d bellard
961 7d13299d bellard
# if cross compiling, cannot launch a program, so make a static guess
962 ea8f20f8 Juan Quintela
case "$cpu" in
963 24e804ec Alexander Graf
  armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
964 ea8f20f8 Juan Quintela
    bigendian=yes
965 ea8f20f8 Juan Quintela
  ;;
966 ea8f20f8 Juan Quintela
esac
967 7d13299d bellard
968 7d13299d bellard
fi
969 7d13299d bellard
970 b6853697 bellard
# host long bits test
971 b6853697 bellard
hostlongbits="32"
972 ea8f20f8 Juan Quintela
case "$cpu" in
973 24e804ec Alexander Graf
  x86_64|alpha|ia64|sparc64|ppc64|s390x)
974 ea8f20f8 Juan Quintela
    hostlongbits=64
975 ea8f20f8 Juan Quintela
  ;;
976 ea8f20f8 Juan Quintela
esac
977 b6853697 bellard
978 b0a47e79 Juan Quintela
979 b0a47e79 Juan Quintela
##########################################
980 b0a47e79 Juan Quintela
# NPTL probe
981 b0a47e79 Juan Quintela
982 b0a47e79 Juan Quintela
if test "$nptl" != "no" ; then
983 b0a47e79 Juan Quintela
  cat > $TMPC <<EOF
984 bd0c5661 pbrook
#include <sched.h>
985 30813cea pbrook
#include <linux/futex.h>
986 bd0c5661 pbrook
void foo()
987 bd0c5661 pbrook
{
988 bd0c5661 pbrook
#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
989 bd0c5661 pbrook
#error bork
990 bd0c5661 pbrook
#endif
991 bd0c5661 pbrook
}
992 bd0c5661 pbrook
EOF
993 bd0c5661 pbrook
994 b0a47e79 Juan Quintela
  if compile_object ; then
995 b0a47e79 Juan Quintela
    nptl=yes
996 b0a47e79 Juan Quintela
  else
997 b0a47e79 Juan Quintela
    if test "$nptl" = "yes" ; then
998 b0a47e79 Juan Quintela
      feature_not_found "nptl"
999 b0a47e79 Juan Quintela
    fi
1000 b0a47e79 Juan Quintela
    nptl=no
1001 b0a47e79 Juan Quintela
  fi
1002 bd0c5661 pbrook
fi
1003 bd0c5661 pbrook
1004 11d9f695 bellard
##########################################
1005 ac62922e balrog
# zlib check
1006 ac62922e balrog
1007 ac62922e balrog
cat > $TMPC << EOF
1008 ac62922e balrog
#include <zlib.h>
1009 ac62922e balrog
int main(void) { zlibVersion(); return 0; }
1010 ac62922e balrog
EOF
1011 52166aa0 Juan Quintela
if compile_prog "" "-lz" ; then
1012 ac62922e balrog
    :
1013 ac62922e balrog
else
1014 ac62922e balrog
    echo
1015 ac62922e balrog
    echo "Error: zlib check failed"
1016 ac62922e balrog
    echo "Make sure to have the zlib libs and headers installed."
1017 ac62922e balrog
    echo
1018 ac62922e balrog
    exit 1
1019 ac62922e balrog
fi
1020 ac62922e balrog
1021 ac62922e balrog
##########################################
1022 e37630ca aliguori
# xen probe
1023 e37630ca aliguori
1024 fc321b4b Juan Quintela
if test "$xen" != "no" ; then
1025 b2266bee Juan Quintela
  xen_libs="-lxenstore -lxenctrl -lxenguest"
1026 b2266bee Juan Quintela
  cat > $TMPC <<EOF
1027 e37630ca aliguori
#include <xenctrl.h>
1028 e37630ca aliguori
#include <xs.h>
1029 df7a607b Christoph Egger
int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
1030 e37630ca aliguori
EOF
1031 52166aa0 Juan Quintela
  if compile_prog "" "$xen_libs" ; then
1032 fc321b4b Juan Quintela
    xen=yes
1033 3efd632b Juan Quintela
    libs_softmmu="$xen_libs $libs_softmmu"
1034 b2266bee Juan Quintela
  else
1035 fc321b4b Juan Quintela
    if test "$xen" = "yes" ; then
1036 fc321b4b Juan Quintela
      feature_not_found "xen"
1037 fc321b4b Juan Quintela
    fi
1038 fc321b4b Juan Quintela
    xen=no
1039 b2266bee Juan Quintela
  fi
1040 e37630ca aliguori
fi
1041 e37630ca aliguori
1042 e37630ca aliguori
##########################################
1043 f91672e5 Paolo Bonzini
# pkgconfig probe
1044 f91672e5 Paolo Bonzini
1045 f91672e5 Paolo Bonzini
pkgconfig="${cross_prefix}pkg-config"
1046 0dba6195 Loïc Minier
if ! has $pkgconfig; then
1047 f91672e5 Paolo Bonzini
  # likely not cross compiling, or hope for the best
1048 f91672e5 Paolo Bonzini
  pkgconfig=pkg-config
1049 f91672e5 Paolo Bonzini
fi
1050 f91672e5 Paolo Bonzini
1051 f91672e5 Paolo Bonzini
##########################################
1052 dfffc653 Juan Quintela
# Sparse probe
1053 dfffc653 Juan Quintela
if test "$sparse" != "no" ; then
1054 0dba6195 Loïc Minier
  if has cgcc; then
1055 dfffc653 Juan Quintela
    sparse=yes
1056 dfffc653 Juan Quintela
  else
1057 dfffc653 Juan Quintela
    if test "$sparse" = "yes" ; then
1058 dfffc653 Juan Quintela
      feature_not_found "sparse"
1059 dfffc653 Juan Quintela
    fi
1060 dfffc653 Juan Quintela
    sparse=no
1061 dfffc653 Juan Quintela
  fi
1062 dfffc653 Juan Quintela
fi
1063 dfffc653 Juan Quintela
1064 dfffc653 Juan Quintela
##########################################
1065 11d9f695 bellard
# SDL probe
1066 11d9f695 bellard
1067 fec0e3e8 Stefan Weil
# Look for sdl configuration program (pkg-config or sdl-config).
1068 fec0e3e8 Stefan Weil
# Prefer variant with cross prefix if cross compiling,
1069 fec0e3e8 Stefan Weil
# and favour pkg-config with sdl over sdl-config.
1070 fec0e3e8 Stefan Weil
if test -n "$cross_prefix" -a $pkgconfig != pkg-config && \
1071 fec0e3e8 Stefan Weil
     $pkgconfig sdl --modversion >/dev/null 2>&1; then
1072 fec0e3e8 Stefan Weil
  sdlconfig="$pkgconfig sdl"
1073 fec0e3e8 Stefan Weil
  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1074 fec0e3e8 Stefan Weil
elif test -n "$cross_prefix" && has ${cross_prefix}sdl-config; then
1075 fec0e3e8 Stefan Weil
  sdlconfig="${cross_prefix}sdl-config"
1076 fec0e3e8 Stefan Weil
  _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
1077 fec0e3e8 Stefan Weil
elif $pkgconfig sdl --modversion >/dev/null 2>&1; then
1078 9316f803 Paolo Bonzini
  sdlconfig="$pkgconfig sdl"
1079 9316f803 Paolo Bonzini
  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
1080 0dba6195 Loïc Minier
elif has sdl-config; then
1081 9316f803 Paolo Bonzini
  sdlconfig='sdl-config'
1082 9316f803 Paolo Bonzini
  _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
1083 a0dfd8a4 Loïc Minier
else
1084 a0dfd8a4 Loïc Minier
  if test "$sdl" = "yes" ; then
1085 a0dfd8a4 Loïc Minier
    feature_not_found "sdl"
1086 a0dfd8a4 Loïc Minier
  fi
1087 a0dfd8a4 Loïc Minier
  sdl=no
1088 9316f803 Paolo Bonzini
fi
1089 11d9f695 bellard
1090 9316f803 Paolo Bonzini
sdl_too_old=no
1091 c4198157 Juan Quintela
if test "$sdl" != "no" ; then
1092 ac119f9d Juan Quintela
  cat > $TMPC << EOF
1093 11d9f695 bellard
#include <SDL.h>
1094 11d9f695 bellard
#undef main /* We don't want SDL to override our main() */
1095 11d9f695 bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1096 11d9f695 bellard
EOF
1097 9316f803 Paolo Bonzini
  sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
1098 74f42e18 TeLeMan
  if test "$static" = "yes" ; then
1099 74f42e18 TeLeMan
    sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
1100 74f42e18 TeLeMan
  else
1101 74f42e18 TeLeMan
    sdl_libs=`$sdlconfig --libs 2> /dev/null`
1102 74f42e18 TeLeMan
  fi
1103 52166aa0 Juan Quintela
  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1104 ac119f9d Juan Quintela
    if test "$_sdlversion" -lt 121 ; then
1105 ac119f9d Juan Quintela
      sdl_too_old=yes
1106 ac119f9d Juan Quintela
    else
1107 ac119f9d Juan Quintela
      if test "$cocoa" = "no" ; then
1108 ac119f9d Juan Quintela
        sdl=yes
1109 ac119f9d Juan Quintela
      fi
1110 ac119f9d Juan Quintela
    fi
1111 cd01b4a3 aliguori
1112 67c274d3 Paolo Bonzini
    # static link with sdl ? (note: sdl.pc's --static --libs is broken)
1113 ac119f9d Juan Quintela
    if test "$sdl" = "yes" -a "$static" = "yes" ; then
1114 67c274d3 Paolo Bonzini
      if test $? = 0 && echo $sdl_libs | grep -- -laa > /dev/null; then
1115 f8aa6c7b Stefan Weil
         sdl_libs="$sdl_libs `aalib-config --static-libs 2>/dev/null`"
1116 f8aa6c7b Stefan Weil
         sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
1117 ac119f9d Juan Quintela
      fi
1118 52166aa0 Juan Quintela
      if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1119 ac119f9d Juan Quintela
	:
1120 ac119f9d Juan Quintela
      else
1121 ac119f9d Juan Quintela
        sdl=no
1122 ac119f9d Juan Quintela
      fi
1123 ac119f9d Juan Quintela
    fi # static link
1124 c4198157 Juan Quintela
  else # sdl not found
1125 c4198157 Juan Quintela
    if test "$sdl" = "yes" ; then
1126 c4198157 Juan Quintela
      feature_not_found "sdl"
1127 c4198157 Juan Quintela
    fi
1128 c4198157 Juan Quintela
    sdl=no
1129 ac119f9d Juan Quintela
  fi # sdl compile test
1130 a68551bc Juan Quintela
fi
1131 11d9f695 bellard
1132 5368a422 aliguori
if test "$sdl" = "yes" ; then
1133 ac119f9d Juan Quintela
  cat > $TMPC <<EOF
1134 5368a422 aliguori
#include <SDL.h>
1135 5368a422 aliguori
#if defined(SDL_VIDEO_DRIVER_X11)
1136 5368a422 aliguori
#include <X11/XKBlib.h>
1137 5368a422 aliguori
#else
1138 5368a422 aliguori
#error No x11 support
1139 5368a422 aliguori
#endif
1140 5368a422 aliguori
int main(void) { return 0; }
1141 5368a422 aliguori
EOF
1142 52166aa0 Juan Quintela
  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
1143 ac119f9d Juan Quintela
    sdl_libs="$sdl_libs -lX11"
1144 ac119f9d Juan Quintela
  fi
1145 07d9ac44 Juan Quintela
  if test "$mingw32" = "yes" ; then
1146 07d9ac44 Juan Quintela
    sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole"
1147 07d9ac44 Juan Quintela
  fi
1148 0705667e Juan Quintela
  libs_softmmu="$sdl_libs $libs_softmmu"
1149 5368a422 aliguori
fi
1150 5368a422 aliguori
1151 8f28f3fb ths
##########################################
1152 8d5d2d4c ths
# VNC TLS detection
1153 1be10ad2 Juan Quintela
if test "$vnc_tls" != "no" ; then
1154 1be10ad2 Juan Quintela
  cat > $TMPC <<EOF
1155 ae6b5e5a aliguori
#include <gnutls/gnutls.h>
1156 ae6b5e5a aliguori
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
1157 ae6b5e5a aliguori
EOF
1158 f91672e5 Paolo Bonzini
  vnc_tls_cflags=`$pkgconfig --cflags gnutls 2> /dev/null`
1159 f91672e5 Paolo Bonzini
  vnc_tls_libs=`$pkgconfig --libs gnutls 2> /dev/null`
1160 1be10ad2 Juan Quintela
  if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then
1161 1be10ad2 Juan Quintela
    vnc_tls=yes
1162 1be10ad2 Juan Quintela
    libs_softmmu="$vnc_tls_libs $libs_softmmu"
1163 1be10ad2 Juan Quintela
  else
1164 1be10ad2 Juan Quintela
    if test "$vnc_tls" = "yes" ; then
1165 1be10ad2 Juan Quintela
      feature_not_found "vnc-tls"
1166 ae6b5e5a aliguori
    fi
1167 1be10ad2 Juan Quintela
    vnc_tls=no
1168 1be10ad2 Juan Quintela
  fi
1169 8d5d2d4c ths
fi
1170 8d5d2d4c ths
1171 8d5d2d4c ths
##########################################
1172 2f9606b3 aliguori
# VNC SASL detection
1173 3aefa744 Juan Quintela
if test "$vnc_sasl" != "no" ; then
1174 ea784e3b Juan Quintela
  cat > $TMPC <<EOF
1175 2f9606b3 aliguori
#include <sasl/sasl.h>
1176 2f9606b3 aliguori
#include <stdio.h>
1177 2f9606b3 aliguori
int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
1178 2f9606b3 aliguori
EOF
1179 ea784e3b Juan Quintela
  # Assuming Cyrus-SASL installed in /usr prefix
1180 ea784e3b Juan Quintela
  vnc_sasl_cflags=""
1181 ea784e3b Juan Quintela
  vnc_sasl_libs="-lsasl2"
1182 ea784e3b Juan Quintela
  if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
1183 ea784e3b Juan Quintela
    vnc_sasl=yes
1184 ea784e3b Juan Quintela
    libs_softmmu="$vnc_sasl_libs $libs_softmmu"
1185 ea784e3b Juan Quintela
  else
1186 ea784e3b Juan Quintela
    if test "$vnc_sasl" = "yes" ; then
1187 ea784e3b Juan Quintela
      feature_not_found "vnc-sasl"
1188 2f9606b3 aliguori
    fi
1189 ea784e3b Juan Quintela
    vnc_sasl=no
1190 ea784e3b Juan Quintela
  fi
1191 2f9606b3 aliguori
fi
1192 2f9606b3 aliguori
1193 2f9606b3 aliguori
##########################################
1194 76655d6d aliguori
# fnmatch() probe, used for ACL routines
1195 76655d6d aliguori
fnmatch="no"
1196 76655d6d aliguori
cat > $TMPC << EOF
1197 76655d6d aliguori
#include <fnmatch.h>
1198 76655d6d aliguori
int main(void)
1199 76655d6d aliguori
{
1200 76655d6d aliguori
    fnmatch("foo", "foo", 0);
1201 76655d6d aliguori
    return 0;
1202 76655d6d aliguori
}
1203 76655d6d aliguori
EOF
1204 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1205 76655d6d aliguori
   fnmatch="yes"
1206 76655d6d aliguori
fi
1207 76655d6d aliguori
1208 76655d6d aliguori
##########################################
1209 ee682d27 Stefan Weil
# uuid_generate() probe, used for vdi block driver
1210 ee682d27 Stefan Weil
if test "$uuid" != "no" ; then
1211 ee682d27 Stefan Weil
  uuid_libs="-luuid"
1212 ee682d27 Stefan Weil
  cat > $TMPC << EOF
1213 ee682d27 Stefan Weil
#include <uuid/uuid.h>
1214 ee682d27 Stefan Weil
int main(void)
1215 ee682d27 Stefan Weil
{
1216 ee682d27 Stefan Weil
    uuid_t my_uuid;
1217 ee682d27 Stefan Weil
    uuid_generate(my_uuid);
1218 ee682d27 Stefan Weil
    return 0;
1219 ee682d27 Stefan Weil
}
1220 ee682d27 Stefan Weil
EOF
1221 ee682d27 Stefan Weil
  if compile_prog "" "$uuid_libs" ; then
1222 ee682d27 Stefan Weil
    uuid="yes"
1223 ee682d27 Stefan Weil
    libs_softmmu="$uuid_libs $libs_softmmu"
1224 ee682d27 Stefan Weil
    libs_tools="$uuid_libs $libs_tools"
1225 ee682d27 Stefan Weil
  else
1226 ee682d27 Stefan Weil
    if test "$uuid" = "yes" ; then
1227 ee682d27 Stefan Weil
      feature_not_found "uuid"
1228 ee682d27 Stefan Weil
    fi
1229 ee682d27 Stefan Weil
    uuid=no
1230 ee682d27 Stefan Weil
  fi
1231 ee682d27 Stefan Weil
fi
1232 ee682d27 Stefan Weil
1233 ee682d27 Stefan Weil
##########################################
1234 8a16d273 ths
# vde libraries probe
1235 dfb278bd Juan Quintela
if test "$vde" != "no" ; then
1236 4baae0ac Juan Quintela
  vde_libs="-lvdeplug"
1237 8a16d273 ths
  cat > $TMPC << EOF
1238 8a16d273 ths
#include <libvdeplug.h>
1239 4a7f0e06 pbrook
int main(void)
1240 4a7f0e06 pbrook
{
1241 4a7f0e06 pbrook
    struct vde_open_args a = {0, 0, 0};
1242 4a7f0e06 pbrook
    vde_open("", "", &a);
1243 4a7f0e06 pbrook
    return 0;
1244 4a7f0e06 pbrook
}
1245 8a16d273 ths
EOF
1246 52166aa0 Juan Quintela
  if compile_prog "" "$vde_libs" ; then
1247 4baae0ac Juan Quintela
    vde=yes
1248 8e02e54c Juan Quintela
    libs_softmmu="$vde_libs $libs_softmmu"
1249 8e02e54c Juan Quintela
    libs_tools="$vde_libs $libs_tools"
1250 dfb278bd Juan Quintela
  else
1251 dfb278bd Juan Quintela
    if test "$vde" = "yes" ; then
1252 dfb278bd Juan Quintela
      feature_not_found "vde"
1253 dfb278bd Juan Quintela
    fi
1254 dfb278bd Juan Quintela
    vde=no
1255 4baae0ac Juan Quintela
  fi
1256 8a16d273 ths
fi
1257 8a16d273 ths
1258 8a16d273 ths
##########################################
1259 c2de5c91 malc
# Sound support libraries probe
1260 8f28f3fb ths
1261 c2de5c91 malc
audio_drv_probe()
1262 c2de5c91 malc
{
1263 c2de5c91 malc
    drv=$1
1264 c2de5c91 malc
    hdr=$2
1265 c2de5c91 malc
    lib=$3
1266 c2de5c91 malc
    exp=$4
1267 c2de5c91 malc
    cfl=$5
1268 c2de5c91 malc
        cat > $TMPC << EOF
1269 c2de5c91 malc
#include <$hdr>
1270 c2de5c91 malc
int main(void) { $exp }
1271 8f28f3fb ths
EOF
1272 52166aa0 Juan Quintela
    if compile_prog "$cfl" "$lib" ; then
1273 c2de5c91 malc
        :
1274 c2de5c91 malc
    else
1275 c2de5c91 malc
        echo
1276 c2de5c91 malc
        echo "Error: $drv check failed"
1277 c2de5c91 malc
        echo "Make sure to have the $drv libs and headers installed."
1278 c2de5c91 malc
        echo
1279 c2de5c91 malc
        exit 1
1280 c2de5c91 malc
    fi
1281 c2de5c91 malc
}
1282 c2de5c91 malc
1283 2fa7d3bf malc
audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
1284 c2de5c91 malc
for drv in $audio_drv_list; do
1285 c2de5c91 malc
    case $drv in
1286 c2de5c91 malc
    alsa)
1287 c2de5c91 malc
    audio_drv_probe $drv alsa/asoundlib.h -lasound \
1288 c2de5c91 malc
        "snd_pcm_t **handle; return snd_pcm_close(*handle);"
1289 a4bf6780 Juan Quintela
    libs_softmmu="-lasound $libs_softmmu"
1290 c2de5c91 malc
    ;;
1291 c2de5c91 malc
1292 c2de5c91 malc
    fmod)
1293 c2de5c91 malc
    if test -z $fmod_lib || test -z $fmod_inc; then
1294 c2de5c91 malc
        echo
1295 c2de5c91 malc
        echo "Error: You must specify path to FMOD library and headers"
1296 c2de5c91 malc
        echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1297 c2de5c91 malc
        echo
1298 c2de5c91 malc
        exit 1
1299 c2de5c91 malc
    fi
1300 c2de5c91 malc
    audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1301 a4bf6780 Juan Quintela
    libs_softmmu="$fmod_lib $libs_softmmu"
1302 c2de5c91 malc
    ;;
1303 c2de5c91 malc
1304 c2de5c91 malc
    esd)
1305 c2de5c91 malc
    audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1306 a4bf6780 Juan Quintela
    libs_softmmu="-lesd $libs_softmmu"
1307 67f86e8e Juan Quintela
    audio_pt_int="yes"
1308 c2de5c91 malc
    ;;
1309 b8e59f18 malc
1310 b8e59f18 malc
    pa)
1311 493abda6 Aurelien Jarno
    audio_drv_probe $drv pulse/simple.h "-lpulse-simple -lpulse" \
1312 b8e59f18 malc
        "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1313 493abda6 Aurelien Jarno
    libs_softmmu="-lpulse -lpulse-simple $libs_softmmu"
1314 67f86e8e Juan Quintela
    audio_pt_int="yes"
1315 b8e59f18 malc
    ;;
1316 b8e59f18 malc
1317 997e690a Juan Quintela
    coreaudio)
1318 997e690a Juan Quintela
      libs_softmmu="-framework CoreAudio $libs_softmmu"
1319 997e690a Juan Quintela
    ;;
1320 997e690a Juan Quintela
1321 a4bf6780 Juan Quintela
    dsound)
1322 a4bf6780 Juan Quintela
      libs_softmmu="-lole32 -ldxguid $libs_softmmu"
1323 d5631638 malc
      audio_win_int="yes"
1324 a4bf6780 Juan Quintela
    ;;
1325 a4bf6780 Juan Quintela
1326 a4bf6780 Juan Quintela
    oss)
1327 a4bf6780 Juan Quintela
      libs_softmmu="$oss_lib $libs_softmmu"
1328 a4bf6780 Juan Quintela
    ;;
1329 a4bf6780 Juan Quintela
1330 a4bf6780 Juan Quintela
    sdl|wav)
1331 2f6a1ab0 blueswir1
    # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1332 2f6a1ab0 blueswir1
    ;;
1333 2f6a1ab0 blueswir1
1334 d5631638 malc
    winwave)
1335 d5631638 malc
      libs_softmmu="-lwinmm $libs_softmmu"
1336 d5631638 malc
      audio_win_int="yes"
1337 d5631638 malc
    ;;
1338 d5631638 malc
1339 e4c63a6a malc
    *)
1340 1c9b2a52 malc
    echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
1341 e4c63a6a malc
        echo
1342 e4c63a6a malc
        echo "Error: Unknown driver '$drv' selected"
1343 e4c63a6a malc
        echo "Possible drivers are: $audio_possible_drivers"
1344 e4c63a6a malc
        echo
1345 e4c63a6a malc
        exit 1
1346 e4c63a6a malc
    }
1347 e4c63a6a malc
    ;;
1348 c2de5c91 malc
    esac
1349 c2de5c91 malc
done
1350 8f28f3fb ths
1351 4d3b6f6e balrog
##########################################
1352 2e4d9fb1 aurel32
# BrlAPI probe
1353 2e4d9fb1 aurel32
1354 4ffcedb6 Juan Quintela
if test "$brlapi" != "no" ; then
1355 eb82284f Juan Quintela
  brlapi_libs="-lbrlapi"
1356 eb82284f Juan Quintela
  cat > $TMPC << EOF
1357 2e4d9fb1 aurel32
#include <brlapi.h>
1358 2e4d9fb1 aurel32
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1359 2e4d9fb1 aurel32
EOF
1360 52166aa0 Juan Quintela
  if compile_prog "" "$brlapi_libs" ; then
1361 eb82284f Juan Quintela
    brlapi=yes
1362 264606b3 Juan Quintela
    libs_softmmu="$brlapi_libs $libs_softmmu"
1363 4ffcedb6 Juan Quintela
  else
1364 4ffcedb6 Juan Quintela
    if test "$brlapi" = "yes" ; then
1365 4ffcedb6 Juan Quintela
      feature_not_found "brlapi"
1366 4ffcedb6 Juan Quintela
    fi
1367 4ffcedb6 Juan Quintela
    brlapi=no
1368 eb82284f Juan Quintela
  fi
1369 eb82284f Juan Quintela
fi
1370 2e4d9fb1 aurel32
1371 2e4d9fb1 aurel32
##########################################
1372 4d3b6f6e balrog
# curses probe
1373 4f78ef9a Juan Quintela
curses_list="-lncurses -lcurses"
1374 4d3b6f6e balrog
1375 c584a6d0 Juan Quintela
if test "$curses" != "no" ; then
1376 c584a6d0 Juan Quintela
  curses_found=no
1377 4d3b6f6e balrog
  cat > $TMPC << EOF
1378 4d3b6f6e balrog
#include <curses.h>
1379 5a8ff3aa blueswir1
#ifdef __OpenBSD__
1380 5a8ff3aa blueswir1
#define resize_term resizeterm
1381 5a8ff3aa blueswir1
#endif
1382 5a8ff3aa blueswir1
int main(void) { resize_term(0, 0); return curses_version(); }
1383 4d3b6f6e balrog
EOF
1384 4f78ef9a Juan Quintela
  for curses_lib in $curses_list; do
1385 4f78ef9a Juan Quintela
    if compile_prog "" "$curses_lib" ; then
1386 c584a6d0 Juan Quintela
      curses_found=yes
1387 4f78ef9a Juan Quintela
      libs_softmmu="$curses_lib $libs_softmmu"
1388 4f78ef9a Juan Quintela
      break
1389 4f78ef9a Juan Quintela
    fi
1390 4f78ef9a Juan Quintela
  done
1391 c584a6d0 Juan Quintela
  if test "$curses_found" = "yes" ; then
1392 c584a6d0 Juan Quintela
    curses=yes
1393 c584a6d0 Juan Quintela
  else
1394 c584a6d0 Juan Quintela
    if test "$curses" = "yes" ; then
1395 c584a6d0 Juan Quintela
      feature_not_found "curses"
1396 c584a6d0 Juan Quintela
    fi
1397 c584a6d0 Juan Quintela
    curses=no
1398 c584a6d0 Juan Quintela
  fi
1399 4f78ef9a Juan Quintela
fi
1400 4d3b6f6e balrog
1401 414f0dab blueswir1
##########################################
1402 769ce76d Alexander Graf
# curl probe
1403 769ce76d Alexander Graf
1404 4e2b0658 Paolo Bonzini
if $pkgconfig libcurl --modversion >/dev/null 2>&1; then
1405 4e2b0658 Paolo Bonzini
  curlconfig="$pkgconfig libcurl"
1406 4e2b0658 Paolo Bonzini
else
1407 4e2b0658 Paolo Bonzini
  curlconfig=curl-config
1408 4e2b0658 Paolo Bonzini
fi
1409 4e2b0658 Paolo Bonzini
1410 788c8196 Juan Quintela
if test "$curl" != "no" ; then
1411 769ce76d Alexander Graf
  cat > $TMPC << EOF
1412 769ce76d Alexander Graf
#include <curl/curl.h>
1413 769ce76d Alexander Graf
int main(void) { return curl_easy_init(); }
1414 769ce76d Alexander Graf
EOF
1415 4e2b0658 Paolo Bonzini
  curl_cflags=`$curlconfig --cflags 2>/dev/null`
1416 4e2b0658 Paolo Bonzini
  curl_libs=`$curlconfig --libs 2>/dev/null`
1417 b1d5a277 Juan Quintela
  if compile_prog "$curl_cflags" "$curl_libs" ; then
1418 769ce76d Alexander Graf
    curl=yes
1419 f0302935 Juan Quintela
    libs_tools="$curl_libs $libs_tools"
1420 f0302935 Juan Quintela
    libs_softmmu="$curl_libs $libs_softmmu"
1421 788c8196 Juan Quintela
  else
1422 788c8196 Juan Quintela
    if test "$curl" = "yes" ; then
1423 788c8196 Juan Quintela
      feature_not_found "curl"
1424 788c8196 Juan Quintela
    fi
1425 788c8196 Juan Quintela
    curl=no
1426 769ce76d Alexander Graf
  fi
1427 769ce76d Alexander Graf
fi # test "$curl"
1428 769ce76d Alexander Graf
1429 769ce76d Alexander Graf
##########################################
1430 5495ed11 Luiz Capitulino
# check framework probe
1431 5495ed11 Luiz Capitulino
1432 5495ed11 Luiz Capitulino
if test "$check_utests" != "no" ; then
1433 5495ed11 Luiz Capitulino
  cat > $TMPC << EOF
1434 5495ed11 Luiz Capitulino
#include <check.h>
1435 5495ed11 Luiz Capitulino
int main(void) { suite_create("qemu test"); return 0; }
1436 5495ed11 Luiz Capitulino
EOF
1437 f91672e5 Paolo Bonzini
  check_libs=`$pkgconfig --libs check`
1438 5495ed11 Luiz Capitulino
  if compile_prog "" $check_libs ; then
1439 5495ed11 Luiz Capitulino
    check_utests=yes
1440 5495ed11 Luiz Capitulino
    libs_tools="$check_libs $libs_tools"
1441 5495ed11 Luiz Capitulino
  else
1442 5495ed11 Luiz Capitulino
    if test "$check_utests" = "yes" ; then
1443 5495ed11 Luiz Capitulino
      feature_not_found "check"
1444 5495ed11 Luiz Capitulino
    fi
1445 5495ed11 Luiz Capitulino
    check_utests=no
1446 5495ed11 Luiz Capitulino
  fi
1447 5495ed11 Luiz Capitulino
fi # test "$check_utests"
1448 5495ed11 Luiz Capitulino
1449 5495ed11 Luiz Capitulino
##########################################
1450 fb599c9a balrog
# bluez support probe
1451 a20a6f46 Juan Quintela
if test "$bluez" != "no" ; then
1452 e820e3f4 balrog
  cat > $TMPC << EOF
1453 e820e3f4 balrog
#include <bluetooth/bluetooth.h>
1454 e820e3f4 balrog
int main(void) { return bt_error(0); }
1455 e820e3f4 balrog
EOF
1456 f91672e5 Paolo Bonzini
  bluez_cflags=`$pkgconfig --cflags bluez 2> /dev/null`
1457 f91672e5 Paolo Bonzini
  bluez_libs=`$pkgconfig --libs bluez 2> /dev/null`
1458 52166aa0 Juan Quintela
  if compile_prog "$bluez_cflags" "$bluez_libs" ; then
1459 a20a6f46 Juan Quintela
    bluez=yes
1460 e482d56a Juan Quintela
    libs_softmmu="$bluez_libs $libs_softmmu"
1461 e820e3f4 balrog
  else
1462 a20a6f46 Juan Quintela
    if test "$bluez" = "yes" ; then
1463 a20a6f46 Juan Quintela
      feature_not_found "bluez"
1464 a20a6f46 Juan Quintela
    fi
1465 e820e3f4 balrog
    bluez="no"
1466 e820e3f4 balrog
  fi
1467 fb599c9a balrog
fi
1468 fb599c9a balrog
1469 fb599c9a balrog
##########################################
1470 7ba1e619 aliguori
# kvm probe
1471 b31a0277 Juan Quintela
if test "$kvm" != "no" ; then
1472 7ba1e619 aliguori
    cat > $TMPC <<EOF
1473 7ba1e619 aliguori
#include <linux/kvm.h>
1474 9fd8d8d7 aliguori
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1475 7ba1e619 aliguori
#error Invalid KVM version
1476 7ba1e619 aliguori
#endif
1477 9fd8d8d7 aliguori
#if !defined(KVM_CAP_USER_MEMORY)
1478 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_USER_MEMORY
1479 9fd8d8d7 aliguori
#endif
1480 9fd8d8d7 aliguori
#if !defined(KVM_CAP_SET_TSS_ADDR)
1481 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1482 9fd8d8d7 aliguori
#endif
1483 9fd8d8d7 aliguori
#if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1484 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1485 9fd8d8d7 aliguori
#endif
1486 7ba1e619 aliguori
int main(void) { return 0; }
1487 7ba1e619 aliguori
EOF
1488 eac30262 aliguori
  if test "$kerneldir" != "" ; then
1489 eac30262 aliguori
      kvm_cflags=-I"$kerneldir"/include
1490 8444eb6e aliguori
      if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1491 8444eb6e aliguori
         -a -d "$kerneldir/arch/x86/include" ; then
1492 8444eb6e aliguori
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1493 406b430d aliguori
	elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1494 406b430d aliguori
	    kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1495 0e60a699 Alexander Graf
	elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
1496 0e60a699 Alexander Graf
	    kvm_cflags="$kvm_cflags -I$kerneldir/arch/s390/include"
1497 8444eb6e aliguori
        elif test -d "$kerneldir/arch/$cpu/include" ; then
1498 8444eb6e aliguori
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1499 8444eb6e aliguori
      fi
1500 eac30262 aliguori
  else
1501 f038e8f7 Stefan Weil
    kvm_cflags=`$pkgconfig --cflags kvm-kmod 2>/dev/null`
1502 eac30262 aliguori
  fi
1503 52166aa0 Juan Quintela
  if compile_prog "$kvm_cflags" "" ; then
1504 b31a0277 Juan Quintela
    kvm=yes
1505 dae5079a Jan Kiszka
    cat > $TMPC <<EOF
1506 dae5079a Jan Kiszka
#include <linux/kvm_para.h>
1507 dae5079a Jan Kiszka
int main(void) { return 0; }
1508 dae5079a Jan Kiszka
EOF
1509 dae5079a Jan Kiszka
    if compile_prog "$kvm_cflags" "" ; then
1510 dae5079a Jan Kiszka
      kvm_para=yes
1511 dae5079a Jan Kiszka
    fi
1512 7ba1e619 aliguori
  else
1513 b31a0277 Juan Quintela
    if test "$kvm" = "yes" ; then
1514 0dba6195 Loïc Minier
      if has awk && has grep; then
1515 b31a0277 Juan Quintela
        kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
1516 9fd8d8d7 aliguori
	| grep "error: " \
1517 9fd8d8d7 aliguori
	| awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1518 b31a0277 Juan Quintela
        if test "$kvmerr" != "" ; then
1519 b31a0277 Juan Quintela
          echo -e "${kvmerr}\n\
1520 b31a0277 Juan Quintela
      NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
1521 b31a0277 Juan Quintela
  recent kvm-kmod from http://sourceforge.net/projects/kvm."
1522 b31a0277 Juan Quintela
        fi
1523 9fd8d8d7 aliguori
      fi
1524 b31a0277 Juan Quintela
      feature_not_found "kvm"
1525 9fd8d8d7 aliguori
    fi
1526 b31a0277 Juan Quintela
    kvm=no
1527 7ba1e619 aliguori
  fi
1528 7ba1e619 aliguori
fi
1529 7ba1e619 aliguori
1530 7ba1e619 aliguori
##########################################
1531 d5970055 Michael S. Tsirkin
# test for vhost net
1532 d5970055 Michael S. Tsirkin
1533 d5970055 Michael S. Tsirkin
if test "$vhost_net" != "no"; then
1534 d5970055 Michael S. Tsirkin
    if test "$kvm" != "no"; then
1535 d5970055 Michael S. Tsirkin
            cat > $TMPC <<EOF
1536 d5970055 Michael S. Tsirkin
    #include <linux/vhost.h>
1537 d5970055 Michael S. Tsirkin
    int main(void) { return 0; }
1538 d5970055 Michael S. Tsirkin
EOF
1539 d5970055 Michael S. Tsirkin
            if compile_prog "$kvm_cflags" "" ; then
1540 d5970055 Michael S. Tsirkin
                vhost_net=yes
1541 d5970055 Michael S. Tsirkin
            else
1542 d5970055 Michael S. Tsirkin
                if test "$vhost_net" = "yes" ; then
1543 d5970055 Michael S. Tsirkin
                    feature_not_found "vhost-net"
1544 d5970055 Michael S. Tsirkin
                fi
1545 d5970055 Michael S. Tsirkin
                vhost_net=no
1546 d5970055 Michael S. Tsirkin
            fi
1547 d5970055 Michael S. Tsirkin
    else
1548 d5970055 Michael S. Tsirkin
            if test "$vhost_net" = "yes" ; then
1549 d5970055 Michael S. Tsirkin
                echo -e "NOTE: vhost-net feature requires KVM (--enable-kvm)."
1550 d5970055 Michael S. Tsirkin
                feature_not_found "vhost-net"
1551 d5970055 Michael S. Tsirkin
            fi
1552 d5970055 Michael S. Tsirkin
            vhost_net=no
1553 d5970055 Michael S. Tsirkin
    fi
1554 d5970055 Michael S. Tsirkin
fi
1555 d5970055 Michael S. Tsirkin
1556 d5970055 Michael S. Tsirkin
##########################################
1557 e5d355d1 aliguori
# pthread probe
1558 de65fe0f Sebastian Herbszt
PTHREADLIBS_LIST="-lpthread -lpthreadGC2"
1559 3c529d93 aliguori
1560 4dd75c70 Christoph Hellwig
pthread=no
1561 e5d355d1 aliguori
cat > $TMPC << EOF
1562 3c529d93 aliguori
#include <pthread.h>
1563 de65fe0f Sebastian Herbszt
int main(void) { pthread_create(0,0,0,0); return 0; }
1564 414f0dab blueswir1
EOF
1565 4dd75c70 Christoph Hellwig
for pthread_lib in $PTHREADLIBS_LIST; do
1566 4dd75c70 Christoph Hellwig
  if compile_prog "" "$pthread_lib" ; then
1567 4dd75c70 Christoph Hellwig
    pthread=yes
1568 4dd75c70 Christoph Hellwig
    LIBS="$pthread_lib $LIBS"
1569 4dd75c70 Christoph Hellwig
    break
1570 4dd75c70 Christoph Hellwig
  fi
1571 4dd75c70 Christoph Hellwig
done
1572 414f0dab blueswir1
1573 4617e593 Anthony Liguori
if test "$mingw32" != yes -a "$pthread" = no; then
1574 4dd75c70 Christoph Hellwig
  echo
1575 4dd75c70 Christoph Hellwig
  echo "Error: pthread check failed"
1576 4dd75c70 Christoph Hellwig
  echo "Make sure to have the pthread libs and headers installed."
1577 4dd75c70 Christoph Hellwig
  echo
1578 4dd75c70 Christoph Hellwig
  exit 1
1579 e5d355d1 aliguori
fi
1580 e5d355d1 aliguori
1581 bf9298b9 aliguori
##########################################
1582 5c6c3a6c Christoph Hellwig
# linux-aio probe
1583 5c6c3a6c Christoph Hellwig
1584 5c6c3a6c Christoph Hellwig
if test "$linux_aio" != "no" ; then
1585 5c6c3a6c Christoph Hellwig
  cat > $TMPC <<EOF
1586 5c6c3a6c Christoph Hellwig
#include <libaio.h>
1587 5c6c3a6c Christoph Hellwig
#include <sys/eventfd.h>
1588 5c6c3a6c Christoph Hellwig
int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; }
1589 5c6c3a6c Christoph Hellwig
EOF
1590 5c6c3a6c Christoph Hellwig
  if compile_prog "" "-laio" ; then
1591 5c6c3a6c Christoph Hellwig
    linux_aio=yes
1592 048d179f Paul Brook
    libs_softmmu="$libs_softmmu -laio"
1593 048d179f Paul Brook
    libs_tools="$libs_tools -laio"
1594 5c6c3a6c Christoph Hellwig
  else
1595 5c6c3a6c Christoph Hellwig
    if test "$linux_aio" = "yes" ; then
1596 5c6c3a6c Christoph Hellwig
      feature_not_found "linux AIO"
1597 5c6c3a6c Christoph Hellwig
    fi
1598 3cfcae3c Luiz Capitulino
    linux_aio=no
1599 5c6c3a6c Christoph Hellwig
  fi
1600 5c6c3a6c Christoph Hellwig
fi
1601 5c6c3a6c Christoph Hellwig
1602 5c6c3a6c Christoph Hellwig
##########################################
1603 bf9298b9 aliguori
# iovec probe
1604 bf9298b9 aliguori
cat > $TMPC <<EOF
1605 db34f0b3 blueswir1
#include <sys/types.h>
1606 bf9298b9 aliguori
#include <sys/uio.h>
1607 db34f0b3 blueswir1
#include <unistd.h>
1608 bf9298b9 aliguori
int main(void) { struct iovec iov; return 0; }
1609 bf9298b9 aliguori
EOF
1610 bf9298b9 aliguori
iovec=no
1611 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1612 bf9298b9 aliguori
  iovec=yes
1613 bf9298b9 aliguori
fi
1614 bf9298b9 aliguori
1615 f652e6af aurel32
##########################################
1616 ceb42de8 aliguori
# preadv probe
1617 ceb42de8 aliguori
cat > $TMPC <<EOF
1618 ceb42de8 aliguori
#include <sys/types.h>
1619 ceb42de8 aliguori
#include <sys/uio.h>
1620 ceb42de8 aliguori
#include <unistd.h>
1621 ceb42de8 aliguori
int main(void) { preadv; }
1622 ceb42de8 aliguori
EOF
1623 ceb42de8 aliguori
preadv=no
1624 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1625 ceb42de8 aliguori
  preadv=yes
1626 ceb42de8 aliguori
fi
1627 ceb42de8 aliguori
1628 ceb42de8 aliguori
##########################################
1629 f652e6af aurel32
# fdt probe
1630 2df87df7 Juan Quintela
if test "$fdt" != "no" ; then
1631 b41af4ba Juan Quintela
  fdt_libs="-lfdt"
1632 b41af4ba Juan Quintela
  cat > $TMPC << EOF
1633 f652e6af aurel32
int main(void) { return 0; }
1634 f652e6af aurel32
EOF
1635 52166aa0 Juan Quintela
  if compile_prog "" "$fdt_libs" ; then
1636 f652e6af aurel32
    fdt=yes
1637 e4782985 Juan Quintela
    libs_softmmu="$fdt_libs $libs_softmmu"
1638 2df87df7 Juan Quintela
  else
1639 2df87df7 Juan Quintela
    if test "$fdt" = "yes" ; then
1640 2df87df7 Juan Quintela
      feature_not_found "fdt"
1641 2df87df7 Juan Quintela
    fi
1642 2df87df7 Juan Quintela
    fdt=no
1643 f652e6af aurel32
  fi
1644 f652e6af aurel32
fi
1645 f652e6af aurel32
1646 3b3f24ad aurel32
#
1647 3b3f24ad aurel32
# Check for xxxat() functions when we are building linux-user
1648 3b3f24ad aurel32
# emulator.  This is done because older glibc versions don't
1649 3b3f24ad aurel32
# have syscall stubs for these implemented.
1650 3b3f24ad aurel32
#
1651 3b3f24ad aurel32
atfile=no
1652 67ba57f6 Riku Voipio
cat > $TMPC << EOF
1653 3b3f24ad aurel32
#define _ATFILE_SOURCE
1654 3b3f24ad aurel32
#include <sys/types.h>
1655 3b3f24ad aurel32
#include <fcntl.h>
1656 3b3f24ad aurel32
#include <unistd.h>
1657 3b3f24ad aurel32
1658 3b3f24ad aurel32
int
1659 3b3f24ad aurel32
main(void)
1660 3b3f24ad aurel32
{
1661 3b3f24ad aurel32
	/* try to unlink nonexisting file */
1662 3b3f24ad aurel32
	return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
1663 3b3f24ad aurel32
}
1664 3b3f24ad aurel32
EOF
1665 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1666 67ba57f6 Riku Voipio
  atfile=yes
1667 3b3f24ad aurel32
fi
1668 3b3f24ad aurel32
1669 39386ac7 aurel32
# Check for inotify functions when we are building linux-user
1670 3b3f24ad aurel32
# emulator.  This is done because older glibc versions don't
1671 3b3f24ad aurel32
# have syscall stubs for these implemented.  In that case we
1672 3b3f24ad aurel32
# don't provide them even if kernel supports them.
1673 3b3f24ad aurel32
#
1674 3b3f24ad aurel32
inotify=no
1675 67ba57f6 Riku Voipio
cat > $TMPC << EOF
1676 3b3f24ad aurel32
#include <sys/inotify.h>
1677 3b3f24ad aurel32
1678 3b3f24ad aurel32
int
1679 3b3f24ad aurel32
main(void)
1680 3b3f24ad aurel32
{
1681 3b3f24ad aurel32
	/* try to start inotify */
1682 8690e420 aurel32
	return inotify_init();
1683 3b3f24ad aurel32
}
1684 3b3f24ad aurel32
EOF
1685 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1686 67ba57f6 Riku Voipio
  inotify=yes
1687 3b3f24ad aurel32
fi
1688 3b3f24ad aurel32
1689 c05c7a73 Riku Voipio
inotify1=no
1690 c05c7a73 Riku Voipio
cat > $TMPC << EOF
1691 c05c7a73 Riku Voipio
#include <sys/inotify.h>
1692 c05c7a73 Riku Voipio
1693 c05c7a73 Riku Voipio
int
1694 c05c7a73 Riku Voipio
main(void)
1695 c05c7a73 Riku Voipio
{
1696 c05c7a73 Riku Voipio
    /* try to start inotify */
1697 c05c7a73 Riku Voipio
    return inotify_init1(0);
1698 c05c7a73 Riku Voipio
}
1699 c05c7a73 Riku Voipio
EOF
1700 c05c7a73 Riku Voipio
if compile_prog "" "" ; then
1701 c05c7a73 Riku Voipio
  inotify1=yes
1702 c05c7a73 Riku Voipio
fi
1703 c05c7a73 Riku Voipio
1704 ebc996f3 Riku Voipio
# check if utimensat and futimens are supported
1705 ebc996f3 Riku Voipio
utimens=no
1706 ebc996f3 Riku Voipio
cat > $TMPC << EOF
1707 ebc996f3 Riku Voipio
#define _ATFILE_SOURCE
1708 ebc996f3 Riku Voipio
#define _GNU_SOURCE
1709 ebc996f3 Riku Voipio
#include <stddef.h>
1710 ebc996f3 Riku Voipio
#include <fcntl.h>
1711 ebc996f3 Riku Voipio
1712 ebc996f3 Riku Voipio
int main(void)
1713 ebc996f3 Riku Voipio
{
1714 ebc996f3 Riku Voipio
    utimensat(AT_FDCWD, "foo", NULL, 0);
1715 ebc996f3 Riku Voipio
    futimens(0, NULL);
1716 ebc996f3 Riku Voipio
    return 0;
1717 ebc996f3 Riku Voipio
}
1718 ebc996f3 Riku Voipio
EOF
1719 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1720 ebc996f3 Riku Voipio
  utimens=yes
1721 ebc996f3 Riku Voipio
fi
1722 ebc996f3 Riku Voipio
1723 099d6b0f Riku Voipio
# check if pipe2 is there
1724 099d6b0f Riku Voipio
pipe2=no
1725 099d6b0f Riku Voipio
cat > $TMPC << EOF
1726 099d6b0f Riku Voipio
#define _GNU_SOURCE
1727 099d6b0f Riku Voipio
#include <unistd.h>
1728 099d6b0f Riku Voipio
#include <fcntl.h>
1729 099d6b0f Riku Voipio
1730 099d6b0f Riku Voipio
int main(void)
1731 099d6b0f Riku Voipio
{
1732 099d6b0f Riku Voipio
    int pipefd[2];
1733 099d6b0f Riku Voipio
    pipe2(pipefd, O_CLOEXEC);
1734 099d6b0f Riku Voipio
    return 0;
1735 099d6b0f Riku Voipio
}
1736 099d6b0f Riku Voipio
EOF
1737 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1738 099d6b0f Riku Voipio
  pipe2=yes
1739 099d6b0f Riku Voipio
fi
1740 099d6b0f Riku Voipio
1741 40ff6d7e Kevin Wolf
# check if accept4 is there
1742 40ff6d7e Kevin Wolf
accept4=no
1743 40ff6d7e Kevin Wolf
cat > $TMPC << EOF
1744 40ff6d7e Kevin Wolf
#define _GNU_SOURCE
1745 40ff6d7e Kevin Wolf
#include <sys/socket.h>
1746 40ff6d7e Kevin Wolf
#include <stddef.h>
1747 40ff6d7e Kevin Wolf
1748 40ff6d7e Kevin Wolf
int main(void)
1749 40ff6d7e Kevin Wolf
{
1750 40ff6d7e Kevin Wolf
    accept4(0, NULL, NULL, SOCK_CLOEXEC);
1751 40ff6d7e Kevin Wolf
    return 0;
1752 40ff6d7e Kevin Wolf
}
1753 40ff6d7e Kevin Wolf
EOF
1754 40ff6d7e Kevin Wolf
if compile_prog "" "" ; then
1755 40ff6d7e Kevin Wolf
  accept4=yes
1756 40ff6d7e Kevin Wolf
fi
1757 40ff6d7e Kevin Wolf
1758 3ce34dfb vibisreenivasan
# check if tee/splice is there. vmsplice was added same time.
1759 3ce34dfb vibisreenivasan
splice=no
1760 3ce34dfb vibisreenivasan
cat > $TMPC << EOF
1761 3ce34dfb vibisreenivasan
#define _GNU_SOURCE
1762 3ce34dfb vibisreenivasan
#include <unistd.h>
1763 3ce34dfb vibisreenivasan
#include <fcntl.h>
1764 3ce34dfb vibisreenivasan
#include <limits.h>
1765 3ce34dfb vibisreenivasan
1766 3ce34dfb vibisreenivasan
int main(void)
1767 3ce34dfb vibisreenivasan
{
1768 3ce34dfb vibisreenivasan
    int len, fd;
1769 3ce34dfb vibisreenivasan
    len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK);
1770 3ce34dfb vibisreenivasan
    splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE);
1771 3ce34dfb vibisreenivasan
    return 0;
1772 3ce34dfb vibisreenivasan
}
1773 3ce34dfb vibisreenivasan
EOF
1774 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1775 3ce34dfb vibisreenivasan
  splice=yes
1776 3ce34dfb vibisreenivasan
fi
1777 3ce34dfb vibisreenivasan
1778 c2882b96 Riku Voipio
# check if eventfd is supported
1779 c2882b96 Riku Voipio
eventfd=no
1780 c2882b96 Riku Voipio
cat > $TMPC << EOF
1781 c2882b96 Riku Voipio
#include <sys/eventfd.h>
1782 c2882b96 Riku Voipio
1783 c2882b96 Riku Voipio
int main(void)
1784 c2882b96 Riku Voipio
{
1785 c2882b96 Riku Voipio
    int efd = eventfd(0, 0);
1786 c2882b96 Riku Voipio
    return 0;
1787 c2882b96 Riku Voipio
}
1788 c2882b96 Riku Voipio
EOF
1789 c2882b96 Riku Voipio
if compile_prog "" "" ; then
1790 c2882b96 Riku Voipio
  eventfd=yes
1791 c2882b96 Riku Voipio
fi
1792 c2882b96 Riku Voipio
1793 d0927938 Ulrich Hecht
# check for fallocate
1794 d0927938 Ulrich Hecht
fallocate=no
1795 d0927938 Ulrich Hecht
cat > $TMPC << EOF
1796 d0927938 Ulrich Hecht
#include <fcntl.h>
1797 d0927938 Ulrich Hecht
1798 d0927938 Ulrich Hecht
int main(void)
1799 d0927938 Ulrich Hecht
{
1800 d0927938 Ulrich Hecht
    fallocate(0, 0, 0, 0);
1801 d0927938 Ulrich Hecht
    return 0;
1802 d0927938 Ulrich Hecht
}
1803 d0927938 Ulrich Hecht
EOF
1804 be17dc90 Michael S. Tsirkin
if compile_prog "$ARCH_CFLAGS" "" ; then
1805 d0927938 Ulrich Hecht
  fallocate=yes
1806 d0927938 Ulrich Hecht
fi
1807 d0927938 Ulrich Hecht
1808 d0927938 Ulrich Hecht
# check for dup3
1809 d0927938 Ulrich Hecht
dup3=no
1810 d0927938 Ulrich Hecht
cat > $TMPC << EOF
1811 d0927938 Ulrich Hecht
#include <unistd.h>
1812 d0927938 Ulrich Hecht
1813 d0927938 Ulrich Hecht
int main(void)
1814 d0927938 Ulrich Hecht
{
1815 d0927938 Ulrich Hecht
    dup3(0, 0, 0);
1816 d0927938 Ulrich Hecht
    return 0;
1817 d0927938 Ulrich Hecht
}
1818 d0927938 Ulrich Hecht
EOF
1819 78f5d726 Jan Kiszka
if compile_prog "" "" ; then
1820 d0927938 Ulrich Hecht
  dup3=yes
1821 d0927938 Ulrich Hecht
fi
1822 d0927938 Ulrich Hecht
1823 cc8ae6de pbrook
# Check if tools are available to build documentation.
1824 a25dba17 Juan Quintela
if test "$docs" != "no" ; then
1825 01668d98 Stefan Weil
  if has makeinfo && has pod2man; then
1826 a25dba17 Juan Quintela
    docs=yes
1827 83a3ab8b Juan Quintela
  else
1828 a25dba17 Juan Quintela
    if test "$docs" = "yes" ; then
1829 a25dba17 Juan Quintela
      feature_not_found "docs"
1830 83a3ab8b Juan Quintela
    fi
1831 a25dba17 Juan Quintela
    docs=no
1832 83a3ab8b Juan Quintela
  fi
1833 cc8ae6de pbrook
fi
1834 cc8ae6de pbrook
1835 f514f41c Stefan Weil
# Search for bswap_32 function
1836 6ae9a1f4 Juan Quintela
byteswap_h=no
1837 6ae9a1f4 Juan Quintela
cat > $TMPC << EOF
1838 6ae9a1f4 Juan Quintela
#include <byteswap.h>
1839 6ae9a1f4 Juan Quintela
int main(void) { return bswap_32(0); }
1840 6ae9a1f4 Juan Quintela
EOF
1841 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1842 6ae9a1f4 Juan Quintela
  byteswap_h=yes
1843 6ae9a1f4 Juan Quintela
fi
1844 6ae9a1f4 Juan Quintela
1845 f514f41c Stefan Weil
# Search for bswap_32 function
1846 6ae9a1f4 Juan Quintela
bswap_h=no
1847 6ae9a1f4 Juan Quintela
cat > $TMPC << EOF
1848 6ae9a1f4 Juan Quintela
#include <sys/endian.h>
1849 6ae9a1f4 Juan Quintela
#include <sys/types.h>
1850 6ae9a1f4 Juan Quintela
#include <machine/bswap.h>
1851 6ae9a1f4 Juan Quintela
int main(void) { return bswap32(0); }
1852 6ae9a1f4 Juan Quintela
EOF
1853 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1854 6ae9a1f4 Juan Quintela
  bswap_h=yes
1855 6ae9a1f4 Juan Quintela
fi
1856 6ae9a1f4 Juan Quintela
1857 da93a1fd aliguori
##########################################
1858 da93a1fd aliguori
# Do we need librt
1859 da93a1fd aliguori
cat > $TMPC <<EOF
1860 da93a1fd aliguori
#include <signal.h>
1861 da93a1fd aliguori
#include <time.h>
1862 da93a1fd aliguori
int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1863 da93a1fd aliguori
EOF
1864 da93a1fd aliguori
1865 52166aa0 Juan Quintela
if compile_prog "" "" ; then
1866 07ffa4bd Juan Quintela
  :
1867 52166aa0 Juan Quintela
elif compile_prog "" "-lrt" ; then
1868 07ffa4bd Juan Quintela
  LIBS="-lrt $LIBS"
1869 da93a1fd aliguori
fi
1870 da93a1fd aliguori
1871 31ff504d Blue Swirl
if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
1872 6362a53f Juan Quintela
        "$aix" != "yes" ; then
1873 6362a53f Juan Quintela
    libs_softmmu="-lutil $libs_softmmu"
1874 6362a53f Juan Quintela
fi
1875 6362a53f Juan Quintela
1876 de5071c5 Blue Swirl
##########################################
1877 de5071c5 Blue Swirl
# check if the compiler defines offsetof
1878 de5071c5 Blue Swirl
1879 de5071c5 Blue Swirl
need_offsetof=yes
1880 de5071c5 Blue Swirl
cat > $TMPC << EOF
1881 de5071c5 Blue Swirl
#include <stddef.h>
1882 de5071c5 Blue Swirl
int main(void) { struct s { int f; }; return offsetof(struct s, f); }
1883 de5071c5 Blue Swirl
EOF
1884 de5071c5 Blue Swirl
if compile_prog "" "" ; then
1885 de5071c5 Blue Swirl
    need_offsetof=no
1886 de5071c5 Blue Swirl
fi
1887 de5071c5 Blue Swirl
1888 5f6b9e8f Blue Swirl
##########################################
1889 747bbdf7 Blue Swirl
# check if the compiler understands attribute warn_unused_result
1890 747bbdf7 Blue Swirl
#
1891 747bbdf7 Blue Swirl
# This could be smarter, but gcc -Werror does not error out even when warning
1892 747bbdf7 Blue Swirl
# about attribute warn_unused_result
1893 747bbdf7 Blue Swirl
1894 747bbdf7 Blue Swirl
gcc_attribute_warn_unused_result=no
1895 747bbdf7 Blue Swirl
cat > $TMPC << EOF
1896 747bbdf7 Blue Swirl
#if defined(__GNUC__) && (__GNUC__ < 4) && defined(__GNUC_MINOR__) && (__GNUC__ < 4)
1897 747bbdf7 Blue Swirl
#error gcc 3.3 or older
1898 747bbdf7 Blue Swirl
#endif
1899 747bbdf7 Blue Swirl
int main(void) { return 0;}
1900 747bbdf7 Blue Swirl
EOF
1901 747bbdf7 Blue Swirl
if compile_prog "" ""; then
1902 747bbdf7 Blue Swirl
    gcc_attribute_warn_unused_result=yes
1903 747bbdf7 Blue Swirl
fi
1904 747bbdf7 Blue Swirl
1905 747bbdf7 Blue Swirl
##########################################
1906 5f6b9e8f Blue Swirl
# check if we have fdatasync
1907 5f6b9e8f Blue Swirl
1908 5f6b9e8f Blue Swirl
fdatasync=no
1909 5f6b9e8f Blue Swirl
cat > $TMPC << EOF
1910 5f6b9e8f Blue Swirl
#include <unistd.h>
1911 5f6b9e8f Blue Swirl
int main(void) { return fdatasync(0); }
1912 5f6b9e8f Blue Swirl
EOF
1913 5f6b9e8f Blue Swirl
if compile_prog "" "" ; then
1914 5f6b9e8f Blue Swirl
    fdatasync=yes
1915 5f6b9e8f Blue Swirl
fi
1916 5f6b9e8f Blue Swirl
1917 e86ecd4b Juan Quintela
# End of CC checks
1918 e86ecd4b Juan Quintela
# After here, no more $cc or $ld runs
1919 e86ecd4b Juan Quintela
1920 e86ecd4b Juan Quintela
if test "$debug" = "no" ; then
1921 1156c669 Juan Quintela
  CFLAGS="-O2 $CFLAGS"
1922 e86ecd4b Juan Quintela
fi
1923 a316e378 Juan Quintela
1924 e86ecd4b Juan Quintela
# Consult white-list to determine whether to enable werror
1925 e86ecd4b Juan Quintela
# by default.  Only enable by default for git builds
1926 20ff6c80 Anthony Liguori
z_version=`cut -f3 -d. $source_path/VERSION`
1927 20ff6c80 Anthony Liguori
1928 e86ecd4b Juan Quintela
if test -z "$werror" ; then
1929 e86ecd4b Juan Quintela
    if test "$z_version" = "50" -a \
1930 e86ecd4b Juan Quintela
        "$linux" = "yes" ; then
1931 e86ecd4b Juan Quintela
        werror="yes"
1932 e86ecd4b Juan Quintela
    else
1933 e86ecd4b Juan Quintela
        werror="no"
1934 e86ecd4b Juan Quintela
    fi
1935 e86ecd4b Juan Quintela
fi
1936 e86ecd4b Juan Quintela
1937 20ff6c80 Anthony Liguori
# Disable zero malloc errors for official releases unless explicitly told to
1938 20ff6c80 Anthony Liguori
# enable/disable
1939 20ff6c80 Anthony Liguori
if test -z "$zero_malloc" ; then
1940 20ff6c80 Anthony Liguori
    if test "$z_version" = "50" ; then
1941 20ff6c80 Anthony Liguori
	zero_malloc="no"
1942 20ff6c80 Anthony Liguori
    else
1943 20ff6c80 Anthony Liguori
	zero_malloc="yes"
1944 20ff6c80 Anthony Liguori
    fi
1945 20ff6c80 Anthony Liguori
fi
1946 20ff6c80 Anthony Liguori
1947 e86ecd4b Juan Quintela
if test "$werror" = "yes" ; then
1948 a558ee17 Juan Quintela
    QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
1949 e86ecd4b Juan Quintela
fi
1950 e86ecd4b Juan Quintela
1951 e86ecd4b Juan Quintela
if test "$solaris" = "no" ; then
1952 e86ecd4b Juan Quintela
    if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
1953 1156c669 Juan Quintela
        LDFLAGS="-Wl,--warn-common $LDFLAGS"
1954 e86ecd4b Juan Quintela
    fi
1955 e86ecd4b Juan Quintela
fi
1956 e86ecd4b Juan Quintela
1957 11d9f695 bellard
if test "$mingw32" = "yes" ; then
1958 308c3593 pbrook
  if test -z "$prefix" ; then
1959 55418b96 Stefan Weil
      prefix="c:/Program Files/Qemu"
1960 308c3593 pbrook
  fi
1961 308c3593 pbrook
  mansuffix=""
1962 308c3593 pbrook
  datasuffix=""
1963 07381cc1 Anthony Liguori
  confsuffix=""
1964 308c3593 pbrook
  docsuffix=""
1965 308c3593 pbrook
  binsuffix=""
1966 07381cc1 Anthony Liguori
  if test -z "$sysconfdir" ; then
1967 07381cc1 Anthony Liguori
      sysconfdir="${prefix}"
1968 07381cc1 Anthony Liguori
  fi
1969 11d9f695 bellard
else
1970 308c3593 pbrook
  if test -z "$prefix" ; then
1971 308c3593 pbrook
      prefix="/usr/local"
1972 308c3593 pbrook
  fi
1973 308c3593 pbrook
  mansuffix="/share/man"
1974 308c3593 pbrook
  datasuffix="/share/qemu"
1975 308c3593 pbrook
  docsuffix="/share/doc/qemu"
1976 308c3593 pbrook
  binsuffix="/bin"
1977 07381cc1 Anthony Liguori
  if test -z "$sysconfdir" ; then
1978 07381cc1 Anthony Liguori
      sysconfdir="${prefix}/etc"
1979 07381cc1 Anthony Liguori
  fi
1980 11d9f695 bellard
fi
1981 5a67135a bellard
1982 43ce4dfe bellard
echo "Install prefix    $prefix"
1983 308c3593 pbrook
echo "BIOS directory    $prefix$datasuffix"
1984 308c3593 pbrook
echo "binary directory  $prefix$binsuffix"
1985 11d9f695 bellard
if test "$mingw32" = "no" ; then
1986 308c3593 pbrook
echo "Manual directory  $prefix$mansuffix"
1987 43ce4dfe bellard
echo "ELF interp prefix $interp_prefix"
1988 11d9f695 bellard
fi
1989 5a67135a bellard
echo "Source path       $source_path"
1990 43ce4dfe bellard
echo "C compiler        $cc"
1991 83469015 bellard
echo "Host C compiler   $host_cc"
1992 0c439cbf Juan Quintela
echo "CFLAGS            $CFLAGS"
1993 a558ee17 Juan Quintela
echo "QEMU_CFLAGS       $QEMU_CFLAGS"
1994 0c439cbf Juan Quintela
echo "LDFLAGS           $LDFLAGS"
1995 43ce4dfe bellard
echo "make              $make"
1996 6a882643 pbrook
echo "install           $install"
1997 43ce4dfe bellard
echo "host CPU          $cpu"
1998 de83cd02 bellard
echo "host big endian   $bigendian"
1999 97a847bc bellard
echo "target list       $target_list"
2000 ade25b0d aurel32
echo "tcg debug enabled $debug_tcg"
2001 b4475aa2 Luiz Capitulino
echo "Mon debug enabled $debug_mon"
2002 43ce4dfe bellard
echo "gprof enabled     $gprof"
2003 03b4fe7d aliguori
echo "sparse enabled    $sparse"
2004 1625af87 aliguori
echo "strip binaries    $strip_opt"
2005 05c2a3e7 bellard
echo "profiler          $profiler"
2006 43ce4dfe bellard
echo "static build      $static"
2007 85aa5189 bellard
echo "-Werror enabled   $werror"
2008 5b0753e0 bellard
if test "$darwin" = "yes" ; then
2009 5b0753e0 bellard
    echo "Cocoa support     $cocoa"
2010 5b0753e0 bellard
fi
2011 97a847bc bellard
echo "SDL support       $sdl"
2012 4d3b6f6e balrog
echo "curses support    $curses"
2013 769ce76d Alexander Graf
echo "curl support      $curl"
2014 5495ed11 Luiz Capitulino
echo "check support     $check_utests"
2015 67b915a5 bellard
echo "mingw32 support   $mingw32"
2016 0c58ac1c malc
echo "Audio drivers     $audio_drv_list"
2017 0c58ac1c malc
echo "Extra audio cards $audio_card_list"
2018 eb852011 Markus Armbruster
echo "Block whitelist   $block_drv_whitelist"
2019 8ff9cbf7 malc
echo "Mixer emulation   $mixemu"
2020 8d5d2d4c ths
echo "VNC TLS support   $vnc_tls"
2021 2f9606b3 aliguori
echo "VNC SASL support  $vnc_sasl"
2022 3142255c blueswir1
if test -n "$sparc_cpu"; then
2023 3142255c blueswir1
    echo "Target Sparc Arch $sparc_cpu"
2024 3142255c blueswir1
fi
2025 e37630ca aliguori
echo "xen support       $xen"
2026 2e4d9fb1 aurel32
echo "brlapi support    $brlapi"
2027 a20a6f46 Juan Quintela
echo "bluez  support    $bluez"
2028 a25dba17 Juan Quintela
echo "Documentation     $docs"
2029 c5937220 pbrook
[ ! -z "$uname_release" ] && \
2030 c5937220 pbrook
echo "uname -r          $uname_release"
2031 bd0c5661 pbrook
echo "NPTL support      $nptl"
2032 379f6698 Paul Brook
echo "GUEST_BASE        $guest_base"
2033 34005a00 Kirill A. Shutemov
echo "PIE user targets  $user_pie"
2034 8a16d273 ths
echo "vde support       $vde"
2035 e5d355d1 aliguori
echo "IO thread         $io_thread"
2036 5c6c3a6c Christoph Hellwig
echo "Linux AIO support $linux_aio"
2037 77755340 ths
echo "Install blobs     $blobs"
2038 b31a0277 Juan Quintela
echo "KVM support       $kvm"
2039 f652e6af aurel32
echo "fdt support       $fdt"
2040 ceb42de8 aliguori
echo "preadv support    $preadv"
2041 5f6b9e8f Blue Swirl
echo "fdatasync         $fdatasync"
2042 ee682d27 Stefan Weil
echo "uuid support      $uuid"
2043 d5970055 Michael S. Tsirkin
echo "vhost-net support $vhost_net"
2044 67b915a5 bellard
2045 97a847bc bellard
if test $sdl_too_old = "yes"; then
2046 24b55b96 bellard
echo "-> Your SDL version is too old - please upgrade to have SDL support"
2047 7c1f25b4 bellard
fi
2048 7d13299d bellard
2049 98ec69ac Juan Quintela
config_host_mak="config-host.mak"
2050 4bf6b55b Juan Quintela
config_host_ld="config-host.ld"
2051 98ec69ac Juan Quintela
2052 98ec69ac Juan Quintela
echo "# Automatically generated by configure - do not modify" > $config_host_mak
2053 98ec69ac Juan Quintela
printf "# Configured with:" >> $config_host_mak
2054 98ec69ac Juan Quintela
printf " '%s'" "$0" "$@" >> $config_host_mak
2055 98ec69ac Juan Quintela
echo >> $config_host_mak
2056 98ec69ac Juan Quintela
2057 2358a494 Juan Quintela
echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
2058 07381cc1 Anthony Liguori
if test "$mingw32" = "yes" ; then
2059 07381cc1 Anthony Liguori
  echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
2060 07381cc1 Anthony Liguori
else
2061 07381cc1 Anthony Liguori
  echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
2062 07381cc1 Anthony Liguori
fi
2063 804edf29 Juan Quintela
2064 2408a527 aurel32
case "$cpu" in
2065 24e804ec Alexander Graf
  i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
2066 e0da9dd3 Juan Quintela
    ARCH=$cpu
2067 2408a527 aurel32
  ;;
2068 a302c32d Laurent Desnogues
  armv4b|armv4l)
2069 16dbd14f Juan Quintela
    ARCH=arm
2070 2408a527 aurel32
  ;;
2071 2408a527 aurel32
  *)
2072 2408a527 aurel32
    echo "Unsupported CPU = $cpu"
2073 2408a527 aurel32
    exit 1
2074 2408a527 aurel32
  ;;
2075 2408a527 aurel32
esac
2076 98ec69ac Juan Quintela
echo "ARCH=$ARCH" >> $config_host_mak
2077 f8393946 aurel32
if test "$debug_tcg" = "yes" ; then
2078 2358a494 Juan Quintela
  echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
2079 f8393946 aurel32
fi
2080 b4475aa2 Luiz Capitulino
if test "$debug_mon" = "yes" ; then
2081 b4475aa2 Luiz Capitulino
  echo "CONFIG_DEBUG_MONITOR=y" >> $config_host_mak
2082 b4475aa2 Luiz Capitulino
fi
2083 f3d08ee6 Paul Brook
if test "$debug" = "yes" ; then
2084 2358a494 Juan Quintela
  echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak
2085 f3d08ee6 Paul Brook
fi
2086 1625af87 aliguori
if test "$strip_opt" = "yes" ; then
2087 98ec69ac Juan Quintela
  echo "STRIP_OPT=-s" >> $config_host_mak
2088 1625af87 aliguori
fi
2089 7d13299d bellard
if test "$bigendian" = "yes" ; then
2090 e2542fe2 Juan Quintela
  echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak
2091 97a847bc bellard
fi
2092 2358a494 Juan Quintela
echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
2093 67b915a5 bellard
if test "$mingw32" = "yes" ; then
2094 98ec69ac Juan Quintela
  echo "CONFIG_WIN32=y" >> $config_host_mak
2095 210fa556 pbrook
else
2096 35f4df27 Juan Quintela
  echo "CONFIG_POSIX=y" >> $config_host_mak
2097 dffcb71c Mark McLoughlin
fi
2098 dffcb71c Mark McLoughlin
2099 dffcb71c Mark McLoughlin
if test "$linux" = "yes" ; then
2100 dffcb71c Mark McLoughlin
  echo "CONFIG_LINUX=y" >> $config_host_mak
2101 67b915a5 bellard
fi
2102 128ab2ff blueswir1
2103 83fb7adf bellard
if test "$darwin" = "yes" ; then
2104 98ec69ac Juan Quintela
  echo "CONFIG_DARWIN=y" >> $config_host_mak
2105 83fb7adf bellard
fi
2106 b29fe3ed malc
2107 b29fe3ed malc
if test "$aix" = "yes" ; then
2108 98ec69ac Juan Quintela
  echo "CONFIG_AIX=y" >> $config_host_mak
2109 b29fe3ed malc
fi
2110 b29fe3ed malc
2111 ec530c81 bellard
if test "$solaris" = "yes" ; then
2112 98ec69ac Juan Quintela
  echo "CONFIG_SOLARIS=y" >> $config_host_mak
2113 2358a494 Juan Quintela
  echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak
2114 0475a5ca ths
  if test "$needs_libsunmath" = "yes" ; then
2115 75b5a697 Juan Quintela
    echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak
2116 0475a5ca ths
  fi
2117 ec530c81 bellard
fi
2118 97a847bc bellard
if test "$static" = "yes" ; then
2119 98ec69ac Juan Quintela
  echo "CONFIG_STATIC=y" >> $config_host_mak
2120 7d13299d bellard
fi
2121 05c2a3e7 bellard
if test $profiler = "yes" ; then
2122 2358a494 Juan Quintela
  echo "CONFIG_PROFILER=y" >> $config_host_mak
2123 05c2a3e7 bellard
fi
2124 c20709aa bellard
if test "$slirp" = "yes" ; then
2125 98ec69ac Juan Quintela
  echo "CONFIG_SLIRP=y" >> $config_host_mak
2126 b6e31c12 Juan Quintela
  QEMU_CFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
2127 c20709aa bellard
fi
2128 8a16d273 ths
if test "$vde" = "yes" ; then
2129 98ec69ac Juan Quintela
  echo "CONFIG_VDE=y" >> $config_host_mak
2130 8a16d273 ths
fi
2131 0c58ac1c malc
for card in $audio_card_list; do
2132 f6e5889e pbrook
    def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
2133 98ec69ac Juan Quintela
    echo "$def=y" >> $config_host_mak
2134 0c58ac1c malc
done
2135 2358a494 Juan Quintela
echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak
2136 0c58ac1c malc
for drv in $audio_drv_list; do
2137 f6e5889e pbrook
    def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
2138 98ec69ac Juan Quintela
    echo "$def=y" >> $config_host_mak
2139 923e4521 malc
    if test "$drv" = "fmod"; then
2140 7aac6cb1 Juan Quintela
        echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak
2141 0c58ac1c malc
    fi
2142 0c58ac1c malc
done
2143 67f86e8e Juan Quintela
if test "$audio_pt_int" = "yes" ; then
2144 67f86e8e Juan Quintela
  echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak
2145 67f86e8e Juan Quintela
fi
2146 d5631638 malc
if test "$audio_win_int" = "yes" ; then
2147 d5631638 malc
  echo "CONFIG_AUDIO_WIN_INT=y" >> $config_host_mak
2148 d5631638 malc
fi
2149 eb852011 Markus Armbruster
echo "CONFIG_BDRV_WHITELIST=$block_drv_whitelist" >> $config_host_mak
2150 8ff9cbf7 malc
if test "$mixemu" = "yes" ; then
2151 98ec69ac Juan Quintela
  echo "CONFIG_MIXEMU=y" >> $config_host_mak
2152 8ff9cbf7 malc
fi
2153 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
2154 98ec69ac Juan Quintela
  echo "CONFIG_VNC_TLS=y" >> $config_host_mak
2155 525061bf Juan Quintela
  echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak
2156 8d5d2d4c ths
fi
2157 2f9606b3 aliguori
if test "$vnc_sasl" = "yes" ; then
2158 98ec69ac Juan Quintela
  echo "CONFIG_VNC_SASL=y" >> $config_host_mak
2159 60ddf533 Juan Quintela
  echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak
2160 2f9606b3 aliguori
fi
2161 76655d6d aliguori
if test "$fnmatch" = "yes" ; then
2162 2358a494 Juan Quintela
  echo "CONFIG_FNMATCH=y" >> $config_host_mak
2163 76655d6d aliguori
fi
2164 ee682d27 Stefan Weil
if test "$uuid" = "yes" ; then
2165 ee682d27 Stefan Weil
  echo "CONFIG_UUID=y" >> $config_host_mak
2166 ee682d27 Stefan Weil
fi
2167 b1a550a0 pbrook
qemu_version=`head $source_path/VERSION`
2168 98ec69ac Juan Quintela
echo "VERSION=$qemu_version" >>$config_host_mak
2169 2358a494 Juan Quintela
echo "PKGVERSION=$pkgversion" >>$config_host_mak
2170 98ec69ac Juan Quintela
echo "SRC_PATH=$source_path" >> $config_host_mak
2171 98ec69ac Juan Quintela
echo "TARGET_DIRS=$target_list" >> $config_host_mak
2172 a25dba17 Juan Quintela
if [ "$docs" = "yes" ] ; then
2173 98ec69ac Juan Quintela
  echo "BUILD_DOCS=yes" >> $config_host_mak
2174 cc8ae6de pbrook
fi
2175 1ac88f28 Juan Quintela
if test "$sdl" = "yes" ; then
2176 98ec69ac Juan Quintela
  echo "CONFIG_SDL=y" >> $config_host_mak
2177 1ac88f28 Juan Quintela
  echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak
2178 49ecc3fa bellard
fi
2179 49ecc3fa bellard
if test "$cocoa" = "yes" ; then
2180 98ec69ac Juan Quintela
  echo "CONFIG_COCOA=y" >> $config_host_mak
2181 4d3b6f6e balrog
fi
2182 4d3b6f6e balrog
if test "$curses" = "yes" ; then
2183 98ec69ac Juan Quintela
  echo "CONFIG_CURSES=y" >> $config_host_mak
2184 49ecc3fa bellard
fi
2185 3b3f24ad aurel32
if test "$atfile" = "yes" ; then
2186 2358a494 Juan Quintela
  echo "CONFIG_ATFILE=y" >> $config_host_mak
2187 3b3f24ad aurel32
fi
2188 ebc996f3 Riku Voipio
if test "$utimens" = "yes" ; then
2189 2358a494 Juan Quintela
  echo "CONFIG_UTIMENSAT=y" >> $config_host_mak
2190 ebc996f3 Riku Voipio
fi
2191 099d6b0f Riku Voipio
if test "$pipe2" = "yes" ; then
2192 2358a494 Juan Quintela
  echo "CONFIG_PIPE2=y" >> $config_host_mak
2193 099d6b0f Riku Voipio
fi
2194 40ff6d7e Kevin Wolf
if test "$accept4" = "yes" ; then
2195 40ff6d7e Kevin Wolf
  echo "CONFIG_ACCEPT4=y" >> $config_host_mak
2196 40ff6d7e Kevin Wolf
fi
2197 3ce34dfb vibisreenivasan
if test "$splice" = "yes" ; then
2198 2358a494 Juan Quintela
  echo "CONFIG_SPLICE=y" >> $config_host_mak
2199 3ce34dfb vibisreenivasan
fi
2200 c2882b96 Riku Voipio
if test "$eventfd" = "yes" ; then
2201 c2882b96 Riku Voipio
  echo "CONFIG_EVENTFD=y" >> $config_host_mak
2202 c2882b96 Riku Voipio
fi
2203 d0927938 Ulrich Hecht
if test "$fallocate" = "yes" ; then
2204 d0927938 Ulrich Hecht
  echo "CONFIG_FALLOCATE=y" >> $config_host_mak
2205 d0927938 Ulrich Hecht
fi
2206 d0927938 Ulrich Hecht
if test "$dup3" = "yes" ; then
2207 d0927938 Ulrich Hecht
  echo "CONFIG_DUP3=y" >> $config_host_mak
2208 d0927938 Ulrich Hecht
fi
2209 3b3f24ad aurel32
if test "$inotify" = "yes" ; then
2210 2358a494 Juan Quintela
  echo "CONFIG_INOTIFY=y" >> $config_host_mak
2211 3b3f24ad aurel32
fi
2212 c05c7a73 Riku Voipio
if test "$inotify1" = "yes" ; then
2213 c05c7a73 Riku Voipio
  echo "CONFIG_INOTIFY1=y" >> $config_host_mak
2214 c05c7a73 Riku Voipio
fi
2215 6ae9a1f4 Juan Quintela
if test "$byteswap_h" = "yes" ; then
2216 6ae9a1f4 Juan Quintela
  echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak
2217 6ae9a1f4 Juan Quintela
fi
2218 6ae9a1f4 Juan Quintela
if test "$bswap_h" = "yes" ; then
2219 6ae9a1f4 Juan Quintela
  echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak
2220 6ae9a1f4 Juan Quintela
fi
2221 769ce76d Alexander Graf
if test "$curl" = "yes" ; then
2222 98ec69ac Juan Quintela
  echo "CONFIG_CURL=y" >> $config_host_mak
2223 b1d5a277 Juan Quintela
  echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak
2224 769ce76d Alexander Graf
fi
2225 2e4d9fb1 aurel32
if test "$brlapi" = "yes" ; then
2226 98ec69ac Juan Quintela
  echo "CONFIG_BRLAPI=y" >> $config_host_mak
2227 2e4d9fb1 aurel32
fi
2228 fb599c9a balrog
if test "$bluez" = "yes" ; then
2229 98ec69ac Juan Quintela
  echo "CONFIG_BLUEZ=y" >> $config_host_mak
2230 ef7635ec Juan Quintela
  echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
2231 fb599c9a balrog
fi
2232 e37630ca aliguori
if test "$xen" = "yes" ; then
2233 5647eb74 Juan Quintela
  echo "CONFIG_XEN=y" >> $config_host_mak
2234 e37630ca aliguori
fi
2235 e5d355d1 aliguori
if test "$io_thread" = "yes" ; then
2236 98ec69ac Juan Quintela
  echo "CONFIG_IOTHREAD=y" >> $config_host_mak
2237 e5d355d1 aliguori
fi
2238 5c6c3a6c Christoph Hellwig
if test "$linux_aio" = "yes" ; then
2239 5c6c3a6c Christoph Hellwig
  echo "CONFIG_LINUX_AIO=y" >> $config_host_mak
2240 5c6c3a6c Christoph Hellwig
fi
2241 77755340 ths
if test "$blobs" = "yes" ; then
2242 98ec69ac Juan Quintela
  echo "INSTALL_BLOBS=yes" >> $config_host_mak
2243 77755340 ths
fi
2244 bf9298b9 aliguori
if test "$iovec" = "yes" ; then
2245 2358a494 Juan Quintela
  echo "CONFIG_IOVEC=y" >> $config_host_mak
2246 bf9298b9 aliguori
fi
2247 ceb42de8 aliguori
if test "$preadv" = "yes" ; then
2248 2358a494 Juan Quintela
  echo "CONFIG_PREADV=y" >> $config_host_mak
2249 ceb42de8 aliguori
fi
2250 f652e6af aurel32
if test "$fdt" = "yes" ; then
2251 3f0855b1 Juan Quintela
  echo "CONFIG_FDT=y" >> $config_host_mak
2252 f652e6af aurel32
fi
2253 de5071c5 Blue Swirl
if test "$need_offsetof" = "yes" ; then
2254 de5071c5 Blue Swirl
  echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
2255 de5071c5 Blue Swirl
fi
2256 747bbdf7 Blue Swirl
if test "$gcc_attribute_warn_unused_result" = "yes" ; then
2257 747bbdf7 Blue Swirl
  echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
2258 747bbdf7 Blue Swirl
fi
2259 5f6b9e8f Blue Swirl
if test "$fdatasync" = "yes" ; then
2260 5f6b9e8f Blue Swirl
  echo "CONFIG_FDATASYNC=y" >> $config_host_mak
2261 5f6b9e8f Blue Swirl
fi
2262 97a847bc bellard
2263 83fb7adf bellard
# XXX: suppress that
2264 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
2265 2358a494 Juan Quintela
  echo "CONFIG_BSD=y" >> $config_host_mak
2266 7d3505c5 bellard
fi
2267 7d3505c5 bellard
2268 2358a494 Juan Quintela
echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak
2269 c5937220 pbrook
2270 20ff6c80 Anthony Liguori
if test "$zero_malloc" = "yes" ; then
2271 20ff6c80 Anthony Liguori
  echo "CONFIG_ZERO_MALLOC=y" >> $config_host_mak
2272 20ff6c80 Anthony Liguori
fi
2273 20ff6c80 Anthony Liguori
2274 68063649 blueswir1
# USB host support
2275 68063649 blueswir1
case "$usb" in
2276 68063649 blueswir1
linux)
2277 98ec69ac Juan Quintela
  echo "HOST_USB=linux" >> $config_host_mak
2278 68063649 blueswir1
;;
2279 68063649 blueswir1
bsd)
2280 98ec69ac Juan Quintela
  echo "HOST_USB=bsd" >> $config_host_mak
2281 68063649 blueswir1
;;
2282 68063649 blueswir1
*)
2283 98ec69ac Juan Quintela
  echo "HOST_USB=stub" >> $config_host_mak
2284 68063649 blueswir1
;;
2285 68063649 blueswir1
esac
2286 68063649 blueswir1
2287 c39e3338 pbrook
tools=
2288 c39e3338 pbrook
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
2289 86355e07 Aurelien Jarno
  tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
2290 2bff4b6f Blue Swirl
  if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
2291 86355e07 Aurelien Jarno
      tools="qemu-nbd\$(EXESUF) $tools"
2292 5495ed11 Luiz Capitulino
    if [ "$check_utests" = "yes" ]; then
2293 3aa3dcff Luiz Capitulino
      tools="check-qint check-qstring check-qdict check-qlist $tools"
2294 422c46a8 Anthony Liguori
      tools="check-qfloat check-qjson $tools"
2295 5495ed11 Luiz Capitulino
    fi
2296 7a5ca864 bellard
  fi
2297 c39e3338 pbrook
fi
2298 98ec69ac Juan Quintela
echo "TOOLS=$tools" >> $config_host_mak
2299 c39e3338 pbrook
2300 161294d8 Juan Quintela
# Mac OS X ships with a broken assembler
2301 253d0942 Alexander Graf
roms=
2302 161294d8 Juan Quintela
if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \
2303 ea5ad306 Andreas Faerber
        "$targetos" != "Darwin" -a "$targetos" != "SunOS" -a \
2304 b461cdc9 Blue Swirl
        `expr "$target_list" : ".*softmmu.*"` != 0 ; then
2305 c05ac895 Paul Brook
  roms="optionrom"
2306 253d0942 Alexander Graf
fi
2307 98ec69ac Juan Quintela
echo "ROMS=$roms" >> $config_host_mak
2308 253d0942 Alexander Graf
2309 804edf29 Juan Quintela
echo "prefix=$prefix" >> $config_host_mak
2310 804edf29 Juan Quintela
echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
2311 804edf29 Juan Quintela
echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
2312 804edf29 Juan Quintela
echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
2313 07381cc1 Anthony Liguori
echo "sysconfdir=$sysconfdir" >> $config_host_mak
2314 804edf29 Juan Quintela
echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
2315 804edf29 Juan Quintela
echo "MAKE=$make" >> $config_host_mak
2316 804edf29 Juan Quintela
echo "INSTALL=$install" >> $config_host_mak
2317 804edf29 Juan Quintela
echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak
2318 804edf29 Juan Quintela
echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak
2319 804edf29 Juan Quintela
echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak
2320 804edf29 Juan Quintela
echo "CC=$cc" >> $config_host_mak
2321 804edf29 Juan Quintela
echo "HOST_CC=$host_cc" >> $config_host_mak
2322 804edf29 Juan Quintela
if test "$sparse" = "yes" ; then
2323 804edf29 Juan Quintela
  echo "CC      := REAL_CC=\"\$(CC)\" cgcc"       >> $config_host_mak
2324 804edf29 Juan Quintela
  echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc"  >> $config_host_mak
2325 a558ee17 Juan Quintela
  echo "QEMU_CFLAGS  += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak
2326 804edf29 Juan Quintela
fi
2327 804edf29 Juan Quintela
echo "AR=$ar" >> $config_host_mak
2328 804edf29 Juan Quintela
echo "OBJCOPY=$objcopy" >> $config_host_mak
2329 804edf29 Juan Quintela
echo "LD=$ld" >> $config_host_mak
2330 e2a2ed06 Juan Quintela
echo "CFLAGS=$CFLAGS" >> $config_host_mak
2331 a558ee17 Juan Quintela
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
2332 c81da56e Juan Quintela
echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
2333 e2a2ed06 Juan Quintela
echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
2334 a36abbbb Juan Quintela
echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
2335 a36abbbb Juan Quintela
echo "ARLIBS_END=$arlibs_end" >> $config_host_mak
2336 73da375e Juan Quintela
echo "LIBS+=$LIBS" >> $config_host_mak
2337 3e2e0e6b Juan Quintela
echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak
2338 804edf29 Juan Quintela
echo "EXESUF=$EXESUF" >> $config_host_mak
2339 804edf29 Juan Quintela
2340 4bf6b55b Juan Quintela
# generate list of library paths for linker script
2341 4bf6b55b Juan Quintela
2342 4bf6b55b Juan Quintela
$ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld}
2343 4bf6b55b Juan Quintela
2344 4bf6b55b Juan Quintela
if test -f ${config_host_ld}~ ; then
2345 4bf6b55b Juan Quintela
  if cmp -s $config_host_ld ${config_host_ld}~ ; then
2346 4bf6b55b Juan Quintela
    mv ${config_host_ld}~ $config_host_ld
2347 4bf6b55b Juan Quintela
  else
2348 4bf6b55b Juan Quintela
    rm ${config_host_ld}~
2349 4bf6b55b Juan Quintela
  fi
2350 4bf6b55b Juan Quintela
fi
2351 4bf6b55b Juan Quintela
2352 4d904533 Blue Swirl
for d in libdis libdis-user; do
2353 4d904533 Blue Swirl
    mkdir -p $d
2354 4d904533 Blue Swirl
    rm -f $d/Makefile
2355 4d904533 Blue Swirl
    ln -s $source_path/Makefile.dis $d/Makefile
2356 4d904533 Blue Swirl
    echo > $d/config.mak
2357 4d904533 Blue Swirl
done
2358 4d904533 Blue Swirl
2359 1d14ffa9 bellard
for target in $target_list; do
2360 97a847bc bellard
target_dir="$target"
2361 25be210f Juan Quintela
config_target_mak=$target_dir/config-target.mak
2362 600309b6 Blue Swirl
target_arch2=`echo $target | cut -d '-' -f 1`
2363 97a847bc bellard
target_bigendian="no"
2364 1f3d3c8f Juan Quintela
2365 ea2d6a39 Juan Quintela
case "$target_arch2" in
2366 24e804ec Alexander Graf
  armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus)
2367 ea2d6a39 Juan Quintela
  target_bigendian=yes
2368 ea2d6a39 Juan Quintela
  ;;
2369 ea2d6a39 Juan Quintela
esac
2370 97a847bc bellard
target_softmmu="no"
2371 997344f3 bellard
target_user_only="no"
2372 831b7825 ths
target_linux_user="no"
2373 831b7825 ths
target_darwin_user="no"
2374 84778508 blueswir1
target_bsd_user="no"
2375 9e407a85 pbrook
case "$target" in
2376 600309b6 Blue Swirl
  ${target_arch2}-softmmu)
2377 9e407a85 pbrook
    target_softmmu="yes"
2378 9e407a85 pbrook
    ;;
2379 600309b6 Blue Swirl
  ${target_arch2}-linux-user)
2380 9c7a4202 Blue Swirl
    if test "$linux" != "yes" ; then
2381 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a Linux host"
2382 9c7a4202 Blue Swirl
      exit 1
2383 9c7a4202 Blue Swirl
    fi
2384 9e407a85 pbrook
    target_user_only="yes"
2385 9e407a85 pbrook
    target_linux_user="yes"
2386 9e407a85 pbrook
    ;;
2387 600309b6 Blue Swirl
  ${target_arch2}-darwin-user)
2388 9c7a4202 Blue Swirl
    if test "$darwin" != "yes" ; then
2389 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a Darwin host"
2390 9c7a4202 Blue Swirl
      exit 1
2391 9c7a4202 Blue Swirl
    fi
2392 9e407a85 pbrook
    target_user_only="yes"
2393 9e407a85 pbrook
    target_darwin_user="yes"
2394 9e407a85 pbrook
    ;;
2395 600309b6 Blue Swirl
  ${target_arch2}-bsd-user)
2396 9cf55765 Blue Swirl
    if test "$bsd" != "yes" ; then
2397 9c7a4202 Blue Swirl
      echo "ERROR: Target '$target' is only available on a BSD host"
2398 9c7a4202 Blue Swirl
      exit 1
2399 9c7a4202 Blue Swirl
    fi
2400 84778508 blueswir1
    target_user_only="yes"
2401 84778508 blueswir1
    target_bsd_user="yes"
2402 84778508 blueswir1
    ;;
2403 9e407a85 pbrook
  *)
2404 9e407a85 pbrook
    echo "ERROR: Target '$target' not recognised"
2405 9e407a85 pbrook
    exit 1
2406 9e407a85 pbrook
    ;;
2407 9e407a85 pbrook
esac
2408 831b7825 ths
2409 97a847bc bellard
mkdir -p $target_dir
2410 158142c2 bellard
mkdir -p $target_dir/fpu
2411 57fec1fe bellard
mkdir -p $target_dir/tcg
2412 59f2a787 Gerd Hoffmann
mkdir -p $target_dir/ide
2413 84778508 blueswir1
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
2414 69de927c bellard
  mkdir -p $target_dir/nwfpe
2415 69de927c bellard
fi
2416 69de927c bellard
2417 ec530c81 bellard
#
2418 ec530c81 bellard
# don't use ln -sf as not all "ln -sf" over write the file/link
2419 ec530c81 bellard
#
2420 ec530c81 bellard
rm -f $target_dir/Makefile
2421 ec530c81 bellard
ln -s $source_path/Makefile.target $target_dir/Makefile
2422 ec530c81 bellard
2423 97a847bc bellard
2424 25be210f Juan Quintela
echo "# Automatically generated by configure - do not modify" > $config_target_mak
2425 de83cd02 bellard
2426 e5fe0c52 pbrook
bflt="no"
2427 bd0c5661 pbrook
target_nptl="no"
2428 600309b6 Blue Swirl
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"`
2429 25be210f Juan Quintela
echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_target_mak
2430 56aebc89 pbrook
gdb_xml_files=""
2431 7ba1e619 aliguori
2432 938b1edd Juan Quintela
TARGET_ARCH="$target_arch2"
2433 6acff7da Juan Quintela
TARGET_BASE_ARCH=""
2434 e6e91b9c Juan Quintela
TARGET_ABI_DIR=""
2435 e73aae67 Juan Quintela
2436 600309b6 Blue Swirl
case "$target_arch2" in
2437 2408a527 aurel32
  i386)
2438 1ad2134f Paul Brook
    target_phys_bits=32
2439 2408a527 aurel32
  ;;
2440 2408a527 aurel32
  x86_64)
2441 6acff7da Juan Quintela
    TARGET_BASE_ARCH=i386
2442 1ad2134f Paul Brook
    target_phys_bits=64
2443 2408a527 aurel32
  ;;
2444 2408a527 aurel32
  alpha)
2445 1ad2134f Paul Brook
    target_phys_bits=64
2446 a4b388ff Richard Henderson
    target_nptl="yes"
2447 2408a527 aurel32
  ;;
2448 2408a527 aurel32
  arm|armeb)
2449 b498c8a0 Juan Quintela
    TARGET_ARCH=arm
2450 2408a527 aurel32
    bflt="yes"
2451 bd0c5661 pbrook
    target_nptl="yes"
2452 56aebc89 pbrook
    gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
2453 1ad2134f Paul Brook
    target_phys_bits=32
2454 2408a527 aurel32
  ;;
2455 2408a527 aurel32
  cris)
2456 253bd7f8 edgar_igl
    target_nptl="yes"
2457 1ad2134f Paul Brook
    target_phys_bits=32
2458 2408a527 aurel32
  ;;
2459 2408a527 aurel32
  m68k)
2460 2408a527 aurel32
    bflt="yes"
2461 56aebc89 pbrook
    gdb_xml_files="cf-core.xml cf-fp.xml"
2462 1ad2134f Paul Brook
    target_phys_bits=32
2463 2408a527 aurel32
  ;;
2464 72b675ca Edgar E. Iglesias
  microblaze)
2465 72b675ca Edgar E. Iglesias
    bflt="yes"
2466 72b675ca Edgar E. Iglesias
    target_nptl="yes"
2467 72b675ca Edgar E. Iglesias
    target_phys_bits=32
2468 72b675ca Edgar E. Iglesias
  ;;
2469 0adcffb1 Juan Quintela
  mips|mipsel)
2470 b498c8a0 Juan Quintela
    TARGET_ARCH=mips
2471 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
2472 f04dc72f Paul Brook
    target_nptl="yes"
2473 1ad2134f Paul Brook
    target_phys_bits=64
2474 2408a527 aurel32
  ;;
2475 2408a527 aurel32
  mipsn32|mipsn32el)
2476 b498c8a0 Juan Quintela
    TARGET_ARCH=mipsn32
2477 6acff7da Juan Quintela
    TARGET_BASE_ARCH=mips
2478 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSN32=y" >> $config_target_mak
2479 1ad2134f Paul Brook
    target_phys_bits=64
2480 2408a527 aurel32
  ;;
2481 2408a527 aurel32
  mips64|mips64el)
2482 b498c8a0 Juan Quintela
    TARGET_ARCH=mips64
2483 6acff7da Juan Quintela
    TARGET_BASE_ARCH=mips
2484 25be210f Juan Quintela
    echo "TARGET_ABI_MIPSN64=y" >> $config_target_mak
2485 1ad2134f Paul Brook
    target_phys_bits=64
2486 2408a527 aurel32
  ;;
2487 2408a527 aurel32
  ppc)
2488 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2489 1ad2134f Paul Brook
    target_phys_bits=32
2490 d6630708 Nathan Froyd
    target_nptl="yes"
2491 2408a527 aurel32
  ;;
2492 2408a527 aurel32
  ppcemb)
2493 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
2494 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
2495 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2496 1ad2134f Paul Brook
    target_phys_bits=64
2497 d6630708 Nathan Froyd
    target_nptl="yes"
2498 2408a527 aurel32
  ;;
2499 2408a527 aurel32
  ppc64)
2500 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
2501 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
2502 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2503 1ad2134f Paul Brook
    target_phys_bits=64
2504 2408a527 aurel32
  ;;
2505 2408a527 aurel32
  ppc64abi32)
2506 b498c8a0 Juan Quintela
    TARGET_ARCH=ppc64
2507 6acff7da Juan Quintela
    TARGET_BASE_ARCH=ppc
2508 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=ppc
2509 25be210f Juan Quintela
    echo "TARGET_ABI32=y" >> $config_target_mak
2510 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
2511 1ad2134f Paul Brook
    target_phys_bits=64
2512 2408a527 aurel32
  ;;
2513 2408a527 aurel32
  sh4|sh4eb)
2514 b498c8a0 Juan Quintela
    TARGET_ARCH=sh4
2515 2408a527 aurel32
    bflt="yes"
2516 0b6d3ae0 aurel32
    target_nptl="yes"
2517 1ad2134f Paul Brook
    target_phys_bits=32
2518 2408a527 aurel32
  ;;
2519 2408a527 aurel32
  sparc)
2520 1ad2134f Paul Brook
    target_phys_bits=64
2521 2408a527 aurel32
  ;;
2522 2408a527 aurel32
  sparc64)
2523 6acff7da Juan Quintela
    TARGET_BASE_ARCH=sparc
2524 1ad2134f Paul Brook
    target_phys_bits=64
2525 2408a527 aurel32
  ;;
2526 2408a527 aurel32
  sparc32plus)
2527 b498c8a0 Juan Quintela
    TARGET_ARCH=sparc64
2528 6acff7da Juan Quintela
    TARGET_BASE_ARCH=sparc
2529 e6e91b9c Juan Quintela
    TARGET_ABI_DIR=sparc
2530 25be210f Juan Quintela
    echo "TARGET_ABI32=y" >> $config_target_mak
2531 1ad2134f Paul Brook
    target_phys_bits=64
2532 2408a527 aurel32
  ;;
2533 24e804ec Alexander Graf
  s390x)
2534 24e804ec Alexander Graf
    target_phys_bits=64
2535 24e804ec Alexander Graf
  ;;
2536 2408a527 aurel32
  *)
2537 2408a527 aurel32
    echo "Unsupported target CPU"
2538 2408a527 aurel32
    exit 1
2539 2408a527 aurel32
  ;;
2540 2408a527 aurel32
esac
2541 25be210f Juan Quintela
echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak
2542 053dd92e Juan Quintela
target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`"
2543 25be210f Juan Quintela
echo "TARGET_$target_arch_name=y" >> $config_target_mak
2544 25be210f Juan Quintela
echo "TARGET_ARCH2=$target_arch2" >> $config_target_mak
2545 42bc608b Juan Quintela
# TARGET_BASE_ARCH needs to be defined after TARGET_ARCH
2546 6acff7da Juan Quintela
if [ "$TARGET_BASE_ARCH" = "" ]; then
2547 6acff7da Juan Quintela
  TARGET_BASE_ARCH=$TARGET_ARCH
2548 6acff7da Juan Quintela
fi
2549 25be210f Juan Quintela
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
2550 e6e91b9c Juan Quintela
if [ "$TARGET_ABI_DIR" = "" ]; then
2551 e6e91b9c Juan Quintela
  TARGET_ABI_DIR=$TARGET_ARCH
2552 e6e91b9c Juan Quintela
fi
2553 25be210f Juan Quintela
echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
2554 1b0c87fc Juan Quintela
case "$target_arch2" in
2555 1b0c87fc Juan Quintela
  i386|x86_64)
2556 1b0c87fc Juan Quintela
    if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
2557 25be210f Juan Quintela
      echo "CONFIG_XEN=y" >> $config_target_mak
2558 1b0c87fc Juan Quintela
    fi
2559 1b0c87fc Juan Quintela
esac
2560 c59249f9 Juan Quintela
case "$target_arch2" in
2561 0e60a699 Alexander Graf
  i386|x86_64|ppcemb|ppc|ppc64|s390x)
2562 c59249f9 Juan Quintela
    # Make sure the target and host cpus are compatible
2563 c59249f9 Juan Quintela
    if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \
2564 c59249f9 Juan Quintela
      \( "$target_arch2" = "$cpu" -o \
2565 c59249f9 Juan Quintela
      \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \
2566 5f114bc6 Alexander Graf
      \( "$target_arch2" = "ppc64"  -a "$cpu" = "ppc" \) -o \
2567 c59249f9 Juan Quintela
      \( "$target_arch2" = "x86_64" -a "$cpu" = "i386"   \) -o \
2568 c59249f9 Juan Quintela
      \( "$target_arch2" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
2569 25be210f Juan Quintela
      echo "CONFIG_KVM=y" >> $config_target_mak
2570 25be210f Juan Quintela
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_target_mak
2571 dae5079a Jan Kiszka
      if test "$kvm_para" = "yes"; then
2572 dae5079a Jan Kiszka
        echo "CONFIG_KVM_PARA=y" >> $config_target_mak
2573 dae5079a Jan Kiszka
      fi
2574 d5970055 Michael S. Tsirkin
      if test $vhost_net = "yes" ; then
2575 d5970055 Michael S. Tsirkin
        echo "CONFIG_VHOST_NET=y" >> $config_target_mak
2576 d5970055 Michael S. Tsirkin
      fi
2577 c59249f9 Juan Quintela
    fi
2578 c59249f9 Juan Quintela
esac
2579 de83cd02 bellard
if test "$target_bigendian" = "yes" ; then
2580 25be210f Juan Quintela
  echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak
2581 de83cd02 bellard
fi
2582 97a847bc bellard
if test "$target_softmmu" = "yes" ; then
2583 b1aa27c4 Paul Brook
  echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_target_mak
2584 25be210f Juan Quintela
  echo "CONFIG_SOFTMMU=y" >> $config_target_mak
2585 25be210f Juan Quintela
  echo "LIBS+=$libs_softmmu" >> $config_target_mak
2586 0e8c9214 Andreas Färber
  echo "HWDIR=../libhw$target_phys_bits" >> $config_target_mak
2587 5791f45b Kirill A. Shutemov
  echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak
2588 43ce4dfe bellard
fi
2589 997344f3 bellard
if test "$target_user_only" = "yes" ; then
2590 25be210f Juan Quintela
  echo "CONFIG_USER_ONLY=y" >> $config_target_mak
2591 997344f3 bellard
fi
2592 831b7825 ths
if test "$target_linux_user" = "yes" ; then
2593 25be210f Juan Quintela
  echo "CONFIG_LINUX_USER=y" >> $config_target_mak
2594 831b7825 ths
fi
2595 831b7825 ths
if test "$target_darwin_user" = "yes" ; then
2596 25be210f Juan Quintela
  echo "CONFIG_DARWIN_USER=y" >> $config_target_mak
2597 831b7825 ths
fi
2598 56aebc89 pbrook
list=""
2599 56aebc89 pbrook
if test ! -z "$gdb_xml_files" ; then
2600 56aebc89 pbrook
  for x in $gdb_xml_files; do
2601 56aebc89 pbrook
    list="$list $source_path/gdb-xml/$x"
2602 56aebc89 pbrook
  done
2603 3d0f1517 Juan Quintela
  echo "TARGET_XML_FILES=$list" >> $config_target_mak
2604 56aebc89 pbrook
fi
2605 97a847bc bellard
2606 f57975fb Juan Quintela
case "$target_arch2" in
2607 990b3e19 Richard Henderson
  alpha|arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|s390x|sparc|sparc64|sparc32plus)
2608 25be210f Juan Quintela
    echo "CONFIG_SOFTFLOAT=y" >> $config_target_mak
2609 f57975fb Juan Quintela
    ;;
2610 d6b38939 Juan Quintela
  *)
2611 25be210f Juan Quintela
    echo "CONFIG_NOSOFTFLOAT=y" >> $config_target_mak
2612 d6b38939 Juan Quintela
    ;;
2613 f57975fb Juan Quintela
esac
2614 f57975fb Juan Quintela
2615 e5fe0c52 pbrook
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2616 25be210f Juan Quintela
  echo "TARGET_HAS_BFLT=y" >> $config_target_mak
2617 e5fe0c52 pbrook
fi
2618 bd0c5661 pbrook
if test "$target_user_only" = "yes" \
2619 bd0c5661 pbrook
        -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2620 25be210f Juan Quintela
  echo "CONFIG_USE_NPTL=y" >> $config_target_mak
2621 bd0c5661 pbrook
fi
2622 379f6698 Paul Brook
if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then
2623 25be210f Juan Quintela
  echo "CONFIG_USE_GUEST_BASE=y" >> $config_target_mak
2624 379f6698 Paul Brook
fi
2625 84778508 blueswir1
if test "$target_bsd_user" = "yes" ; then
2626 25be210f Juan Quintela
  echo "CONFIG_BSD_USER=y" >> $config_target_mak
2627 84778508 blueswir1
fi
2628 5b0753e0 bellard
2629 4afddb55 Juan Quintela
# generate QEMU_CFLAGS/LDFLAGS for targets
2630 fa282484 Juan Quintela
2631 4afddb55 Juan Quintela
cflags=""
2632 fa282484 Juan Quintela
ldflags=""
2633 9b8e111f Juan Quintela
2634 57ddfbf7 Juan Quintela
if test "$ARCH" = "sparc64" ; then
2635 57ddfbf7 Juan Quintela
  cflags="-I\$(SRC_PATH)/tcg/sparc $cflags"
2636 24e804ec Alexander Graf
elif test "$ARCH" = "s390x" ; then
2637 24e804ec Alexander Graf
  cflags="-I\$(SRC_PATH)/tcg/s390 $cflags"
2638 57ddfbf7 Juan Quintela
else
2639 57ddfbf7 Juan Quintela
  cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
2640 57ddfbf7 Juan Quintela
fi
2641 57ddfbf7 Juan Quintela
cflags="-I\$(SRC_PATH)/tcg $cflags"
2642 57ddfbf7 Juan Quintela
cflags="-I\$(SRC_PATH)/fpu $cflags"
2643 57ddfbf7 Juan Quintela
2644 4d904533 Blue Swirl
if test "$target_user_only" = "yes" ; then
2645 4d904533 Blue Swirl
    libdis_config_mak=libdis-user/config.mak
2646 4d904533 Blue Swirl
else
2647 4d904533 Blue Swirl
    libdis_config_mak=libdis/config.mak
2648 4d904533 Blue Swirl
fi
2649 4d904533 Blue Swirl
2650 64656024 Juan Quintela
for i in $ARCH $TARGET_BASE_ARCH ; do
2651 64656024 Juan Quintela
  case "$i" in
2652 64656024 Juan Quintela
  alpha)
2653 25be210f Juan Quintela
    echo "CONFIG_ALPHA_DIS=y"  >> $config_target_mak
2654 4d904533 Blue Swirl
    echo "CONFIG_ALPHA_DIS=y"  >> $libdis_config_mak
2655 64656024 Juan Quintela
  ;;
2656 64656024 Juan Quintela
  arm)
2657 25be210f Juan Quintela
    echo "CONFIG_ARM_DIS=y"  >> $config_target_mak
2658 4d904533 Blue Swirl
    echo "CONFIG_ARM_DIS=y"  >> $libdis_config_mak
2659 64656024 Juan Quintela
  ;;
2660 64656024 Juan Quintela
  cris)
2661 25be210f Juan Quintela
    echo "CONFIG_CRIS_DIS=y"  >> $config_target_mak
2662 4d904533 Blue Swirl
    echo "CONFIG_CRIS_DIS=y"  >> $libdis_config_mak
2663 64656024 Juan Quintela
  ;;
2664 64656024 Juan Quintela
  hppa)
2665 25be210f Juan Quintela
    echo "CONFIG_HPPA_DIS=y"  >> $config_target_mak
2666 4d904533 Blue Swirl
    echo "CONFIG_HPPA_DIS=y"  >> $libdis_config_mak
2667 64656024 Juan Quintela
  ;;
2668 64656024 Juan Quintela
  i386|x86_64)
2669 25be210f Juan Quintela
    echo "CONFIG_I386_DIS=y"  >> $config_target_mak
2670 4d904533 Blue Swirl
    echo "CONFIG_I386_DIS=y"  >> $libdis_config_mak
2671 64656024 Juan Quintela
  ;;
2672 903ec55c Aurelien Jarno
  ia64*)
2673 903ec55c Aurelien Jarno
    echo "CONFIG_IA64_DIS=y"  >> $config_target_mak
2674 903ec55c Aurelien Jarno
    echo "CONFIG_IA64_DIS=y"  >> $libdis_config_mak
2675 903ec55c Aurelien Jarno
  ;;
2676 64656024 Juan Quintela
  m68k)
2677 25be210f Juan Quintela
    echo "CONFIG_M68K_DIS=y"  >> $config_target_mak
2678 4d904533 Blue Swirl
    echo "CONFIG_M68K_DIS=y"  >> $libdis_config_mak
2679 64656024 Juan Quintela
  ;;
2680 64656024 Juan Quintela
  microblaze)
2681 25be210f Juan Quintela
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $config_target_mak
2682 4d904533 Blue Swirl
    echo "CONFIG_MICROBLAZE_DIS=y"  >> $libdis_config_mak
2683 64656024 Juan Quintela
  ;;
2684 64656024 Juan Quintela
  mips*)
2685 25be210f Juan Quintela
    echo "CONFIG_MIPS_DIS=y"  >> $config_target_mak
2686 4d904533 Blue Swirl
    echo "CONFIG_MIPS_DIS=y"  >> $libdis_config_mak
2687 64656024 Juan Quintela
  ;;
2688 64656024 Juan Quintela
  ppc*)
2689 25be210f Juan Quintela
    echo "CONFIG_PPC_DIS=y"  >> $config_target_mak
2690 4d904533 Blue Swirl
    echo "CONFIG_PPC_DIS=y"  >> $libdis_config_mak
2691 64656024 Juan Quintela
  ;;
2692 24e804ec Alexander Graf
  s390*)
2693 25be210f Juan Quintela
    echo "CONFIG_S390_DIS=y"  >> $config_target_mak
2694 4d904533 Blue Swirl
    echo "CONFIG_S390_DIS=y"  >> $libdis_config_mak
2695 64656024 Juan Quintela
  ;;
2696 64656024 Juan Quintela
  sh4)
2697 25be210f Juan Quintela
    echo "CONFIG_SH4_DIS=y"  >> $config_target_mak
2698 4d904533 Blue Swirl
    echo "CONFIG_SH4_DIS=y"  >> $libdis_config_mak
2699 64656024 Juan Quintela
  ;;
2700 64656024 Juan Quintela
  sparc*)
2701 25be210f Juan Quintela
    echo "CONFIG_SPARC_DIS=y"  >> $config_target_mak
2702 4d904533 Blue Swirl
    echo "CONFIG_SPARC_DIS=y"  >> $libdis_config_mak
2703 64656024 Juan Quintela
  ;;
2704 64656024 Juan Quintela
  esac
2705 64656024 Juan Quintela
done
2706 64656024 Juan Quintela
2707 6ee7126f Juan Quintela
case "$ARCH" in
2708 6ee7126f Juan Quintela
alpha)
2709 6ee7126f Juan Quintela
  # Ensure there's only a single GP
2710 6ee7126f Juan Quintela
  cflags="-msmall-data $cflags"
2711 6ee7126f Juan Quintela
;;
2712 6ee7126f Juan Quintela
esac
2713 6ee7126f Juan Quintela
2714 55d9c04b Juan Quintela
if test "$target_softmmu" = "yes" ; then
2715 55d9c04b Juan Quintela
  case "$TARGET_BASE_ARCH" in
2716 55d9c04b Juan Quintela
  arm)
2717 55d9c04b Juan Quintela
    cflags="-DHAS_AUDIO $cflags"
2718 55d9c04b Juan Quintela
  ;;
2719 55d9c04b Juan Quintela
  i386|mips|ppc)
2720 55d9c04b Juan Quintela
    cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags"
2721 55d9c04b Juan Quintela
  ;;
2722 55d9c04b Juan Quintela
  esac
2723 55d9c04b Juan Quintela
fi
2724 55d9c04b Juan Quintela
2725 34005a00 Kirill A. Shutemov
if test "$target_user_only" = "yes" -a "$static" = "no" -a \
2726 50108930 Blue Swirl
	"$user_pie" = "yes" ; then
2727 34005a00 Kirill A. Shutemov
  cflags="-fpie $cflags"
2728 34005a00 Kirill A. Shutemov
  ldflags="-pie $ldflags"
2729 34005a00 Kirill A. Shutemov
fi
2730 34005a00 Kirill A. Shutemov
2731 471857dd Juan Quintela
if test "$target_softmmu" = "yes" -a \( \
2732 471857dd Juan Quintela
        "$TARGET_ARCH" = "microblaze" -o \
2733 471857dd Juan Quintela
        "$TARGET_ARCH" = "cris" \) ; then
2734 25be210f Juan Quintela
  echo "CONFIG_NEED_MMU=y" >> $config_target_mak
2735 471857dd Juan Quintela
fi
2736 471857dd Juan Quintela
2737 d02c1db3 Juan Quintela
if test "$gprof" = "yes" ; then
2738 25be210f Juan Quintela
  echo "TARGET_GPROF=yes" >> $config_target_mak
2739 d02c1db3 Juan Quintela
  if test "$target_linux_user" = "yes" ; then
2740 d02c1db3 Juan Quintela
    cflags="-p $cflags"
2741 d02c1db3 Juan Quintela
    ldflags="-p $ldflags"
2742 d02c1db3 Juan Quintela
  fi
2743 d02c1db3 Juan Quintela
  if test "$target_softmmu" = "yes" ; then
2744 d02c1db3 Juan Quintela
    ldflags="-p $ldflags"
2745 25be210f Juan Quintela
    echo "GPROF_CFLAGS=-p" >> $config_target_mak
2746 d02c1db3 Juan Quintela
  fi
2747 d02c1db3 Juan Quintela
fi
2748 d02c1db3 Juan Quintela
2749 6ee7126f Juan Quintela
linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld"
2750 9b8e111f Juan Quintela
if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then
2751 fa282484 Juan Quintela
  case "$ARCH" in
2752 fa282484 Juan Quintela
  sparc)
2753 fa282484 Juan Quintela
    # -static is used to avoid g1/g3 usage by the dynamic linker
2754 322e5878 Juan Quintela
    ldflags="$linker_script -static $ldflags"
2755 fa282484 Juan Quintela
    ;;
2756 fd76e73a Richard Henderson
  *)
2757 322e5878 Juan Quintela
    ldflags="$linker_script $ldflags"
2758 fa282484 Juan Quintela
    ;;
2759 fa282484 Juan Quintela
  esac
2760 fa282484 Juan Quintela
fi
2761 fa282484 Juan Quintela
2762 25be210f Juan Quintela
echo "LDFLAGS+=$ldflags" >> $config_target_mak
2763 25be210f Juan Quintela
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
2764 fa282484 Juan Quintela
2765 97a847bc bellard
done # for target in $targets
2766 7d13299d bellard
2767 7d13299d bellard
# build tree in object directory if source path is different from current one
2768 7d13299d bellard
if test "$source_path_used" = "yes" ; then
2769 e1144d00 Mark McLoughlin
    DIRS="tests tests/cris slirp audio block net pc-bios/optionrom"
2770 2d9f27d2 Anthony Liguori
    DIRS="$DIRS roms/seabios roms/vgabios"
2771 74db920c Gautham R Shenoy
    DIRS="$DIRS fsdev"
2772 7d13299d bellard
    FILES="Makefile tests/Makefile"
2773 e7daa605 ths
    FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
2774 e1ffb0f1 edgar_igl
    FILES="$FILES tests/test-mmap.c"
2775 7ea78b74 Jan Kiszka
    FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps pc-bios/video.x"
2776 2d9f27d2 Anthony Liguori
    FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile"
2777 7ea78b74 Jan Kiszka
    for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do
2778 7ea78b74 Jan Kiszka
        FILES="$FILES pc-bios/`basename $bios_file`"
2779 7ea78b74 Jan Kiszka
    done
2780 7d13299d bellard
    for dir in $DIRS ; do
2781 7d13299d bellard
            mkdir -p $dir
2782 7d13299d bellard
    done
2783 ec530c81 bellard
    # remove the link and recreate it, as not all "ln -sf" overwrite the link
2784 7d13299d bellard
    for f in $FILES ; do
2785 ec530c81 bellard
        rm -f $f
2786 ec530c81 bellard
        ln -s $source_path/$f $f
2787 7d13299d bellard
    done
2788 7d13299d bellard
fi
2789 1ad2134f Paul Brook
2790 c34ebfdc Anthony Liguori
# temporary config to build submodules
2791 2d9f27d2 Anthony Liguori
for rom in seabios vgabios ; do
2792 c34ebfdc Anthony Liguori
    config_mak=roms/$rom/config.mak
2793 37116c89 Stefan Weil
    echo "# Automatically generated by configure - do not modify" > $config_mak
2794 c34ebfdc Anthony Liguori
    echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak
2795 c34ebfdc Anthony Liguori
    echo "CC=$cc" >> $config_mak
2796 c34ebfdc Anthony Liguori
    echo "BCC=bcc" >> $config_mak
2797 c34ebfdc Anthony Liguori
    echo "CPP=${cross_prefix}cpp" >> $config_mak
2798 c34ebfdc Anthony Liguori
    echo "OBJCOPY=objcopy" >> $config_mak
2799 c34ebfdc Anthony Liguori
    echo "IASL=iasl" >> $config_mak
2800 c34ebfdc Anthony Liguori
    echo "HOST_CC=$host_cc" >> $config_mak
2801 c34ebfdc Anthony Liguori
    echo "LD=$ld" >> $config_mak
2802 c34ebfdc Anthony Liguori
done
2803 c34ebfdc Anthony Liguori
2804 1ad2134f Paul Brook
for hwlib in 32 64; do
2805 1ad2134f Paul Brook
  d=libhw$hwlib
2806 1ad2134f Paul Brook
  mkdir -p $d
2807 9953b2fc Blue Swirl
  mkdir -p $d/ide
2808 1ad2134f Paul Brook
  rm -f $d/Makefile
2809 1ad2134f Paul Brook
  ln -s $source_path/Makefile.hw $d/Makefile
2810 37116c89 Stefan Weil
  echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" > $d/config.mak
2811 1ad2134f Paul Brook
done
2812 add16157 Blue Swirl
2813 add16157 Blue Swirl
d=libuser
2814 add16157 Blue Swirl
mkdir -p $d
2815 add16157 Blue Swirl
rm -f $d/Makefile
2816 add16157 Blue Swirl
ln -s $source_path/Makefile.user $d/Makefile
2817 299060a0 Kirill A. Shutemov
if test "$static" = "no" -a "$user_pie" = "yes" ; then
2818 299060a0 Kirill A. Shutemov
  echo "QEMU_CFLAGS+=-fpie" > $d/config.mak
2819 299060a0 Kirill A. Shutemov
fi
2820 b40292e7 Jan Kiszka
2821 b40292e7 Jan Kiszka
if test "$docs" = "yes" ; then
2822 b40292e7 Jan Kiszka
  mkdir -p QMP
2823 b40292e7 Jan Kiszka
fi