Statistics
| Branch: | Revision:

root / configure @ add16157

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