Statistics
| Branch: | Revision:

root / configure @ 520860ef

History | View | Annotate | Download (51.7 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 3ef693a0 bellard
TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
18 9d56d2dc malc
TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
19 d4742de8 malc
TMPSDLLOG="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log"
20 7d13299d bellard
21 d4742de8 malc
trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
22 9ac81bbb malc
23 7d13299d bellard
# default parameters
24 11d9f695 bellard
prefix=""
25 1e43adfc bellard
interp_prefix="/usr/gnemul/qemu-%M"
26 43ce4dfe bellard
static="no"
27 7d13299d bellard
cross_prefix=""
28 7d13299d bellard
cc="gcc"
29 0c58ac1c malc
audio_drv_list=""
30 4c9b53e3 malc
audio_card_list="ac97 es1370 sb16"
31 4c9b53e3 malc
audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
32 7d13299d bellard
host_cc="gcc"
33 7d13299d bellard
ar="ar"
34 7d13299d bellard
make="make"
35 6a882643 pbrook
install="install"
36 7d13299d bellard
strip="strip"
37 ac0df51d aliguori
38 ac0df51d aliguori
# parse CC options first
39 ac0df51d aliguori
for opt do
40 ac0df51d aliguori
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
41 ac0df51d aliguori
  case "$opt" in
42 ac0df51d aliguori
  --cross-prefix=*) cross_prefix="$optarg"
43 ac0df51d aliguori
  ;;
44 ac0df51d aliguori
  --cc=*) cc="$optarg"
45 ac0df51d aliguori
  ;;
46 ac0df51d aliguori
  esac
47 ac0df51d aliguori
done
48 ac0df51d aliguori
49 ac0df51d aliguori
# OS specific
50 ac0df51d aliguori
# Using uname is really, really broken.  Once we have the right set of checks
51 ac0df51d aliguori
# we can eliminate it's usage altogether
52 ac0df51d aliguori
53 ac0df51d aliguori
cc="${cross_prefix}${cc}"
54 ac0df51d aliguori
ar="${cross_prefix}${ar}"
55 ac0df51d aliguori
strip="${cross_prefix}${strip}"
56 ac0df51d aliguori
57 ac0df51d aliguori
# check that the C compiler works.
58 ac0df51d aliguori
cat > $TMPC <<EOF
59 ac0df51d aliguori
int main(void) {}
60 ac0df51d aliguori
EOF
61 ac0df51d aliguori
62 ac0df51d aliguori
if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
63 ac0df51d aliguori
  : C compiler works ok
64 ac0df51d aliguori
else
65 ac0df51d aliguori
    echo "ERROR: \"$cc\" either does not exist or does not work"
66 ac0df51d aliguori
    exit 1
67 ac0df51d aliguori
fi
68 ac0df51d aliguori
69 ac0df51d aliguori
check_define() {
70 ac0df51d aliguori
cat > $TMPC <<EOF
71 ac0df51d aliguori
#if !defined($1)
72 ac0df51d aliguori
#error Not defined
73 ac0df51d aliguori
#endif
74 ac0df51d aliguori
int main(void) { return 0; }
75 ac0df51d aliguori
EOF
76 ac0df51d aliguori
  $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
77 ac0df51d aliguori
}
78 ac0df51d aliguori
79 ac0df51d aliguori
if check_define __i386__ ; then
80 ac0df51d aliguori
  cpu="i386"
81 ac0df51d aliguori
elif check_define __x86_64__ ; then
82 ac0df51d aliguori
  cpu="x86_64"
83 3aa9bd6c blueswir1
elif check_define __sparc__ ; then
84 3aa9bd6c blueswir1
  # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
85 3aa9bd6c blueswir1
  # They must be specified using --sparc_cpu
86 3aa9bd6c blueswir1
  if check_define __arch64__ ; then
87 3aa9bd6c blueswir1
    cpu="sparc64"
88 3aa9bd6c blueswir1
  else
89 3aa9bd6c blueswir1
    cpu="sparc"
90 3aa9bd6c blueswir1
  fi
91 fdf7ed96 malc
elif check_define _ARCH_PPC ; then
92 fdf7ed96 malc
  if check_define _ARCH_PPC64 ; then
93 fdf7ed96 malc
    cpu="ppc64"
94 fdf7ed96 malc
  else
95 fdf7ed96 malc
    cpu="ppc"
96 fdf7ed96 malc
  fi
97 ac0df51d aliguori
else
98 fdf7ed96 malc
  cpu=`uname -m`
99 ac0df51d aliguori
fi
100 ac0df51d aliguori
101 5327cf48 bellard
target_list=""
102 7d13299d bellard
case "$cpu" in
103 7d13299d bellard
  i386|i486|i586|i686|i86pc|BePC)
104 97a847bc bellard
    cpu="i386"
105 7d13299d bellard
  ;;
106 aaa5fa14 aurel32
  x86_64|amd64)
107 aaa5fa14 aurel32
    cpu="x86_64"
108 aaa5fa14 aurel32
  ;;
109 aaa5fa14 aurel32
  alpha)
110 aaa5fa14 aurel32
    cpu="alpha"
111 aaa5fa14 aurel32
  ;;
112 ba68055e bellard
  armv*b)
113 808c4954 bellard
    cpu="armv4b"
114 808c4954 bellard
  ;;
115 ba68055e bellard
  armv*l)
116 7d13299d bellard
    cpu="armv4l"
117 7d13299d bellard
  ;;
118 aaa5fa14 aurel32
  cris)
119 aaa5fa14 aurel32
    cpu="cris"
120 7d13299d bellard
  ;;
121 f54b3f92 aurel32
  parisc|parisc64)
122 f54b3f92 aurel32
    cpu="hppa"
123 f54b3f92 aurel32
  ;;
124 aaa5fa14 aurel32
  ia64)
125 aaa5fa14 aurel32
    cpu="ia64"
126 aaa5fa14 aurel32
  ;;
127 aaa5fa14 aurel32
  m68k)
128 aaa5fa14 aurel32
    cpu="m68k"
129 7d13299d bellard
  ;;
130 7d13299d bellard
  mips)
131 7d13299d bellard
    cpu="mips"
132 7d13299d bellard
  ;;
133 fbe4f65b ths
  mips64)
134 fbe4f65b ths
    cpu="mips64"
135 fbe4f65b ths
  ;;
136 fdf7ed96 malc
  ppc)
137 fdf7ed96 malc
    cpu="ppc"
138 fdf7ed96 malc
  ;;
139 fdf7ed96 malc
  ppc64)
140 fdf7ed96 malc
    cpu="ppc64"
141 e7daa605 ths
  ;;
142 0e7b8a9f ths
  s390*)
143 fb3e5849 bellard
    cpu="s390"
144 fb3e5849 bellard
  ;;
145 3142255c blueswir1
  sparc|sun4[cdmuv])
146 ae228531 bellard
    cpu="sparc"
147 ae228531 bellard
  ;;
148 ae228531 bellard
  sparc64)
149 ae228531 bellard
    cpu="sparc64"
150 ae228531 bellard
  ;;
151 7d13299d bellard
  *)
152 7d13299d bellard
    cpu="unknown"
153 7d13299d bellard
  ;;
154 7d13299d bellard
esac
155 7d13299d bellard
gprof="no"
156 03b4fe7d aliguori
sparse="no"
157 1625af87 aliguori
strip_opt="yes"
158 7d13299d bellard
bigendian="no"
159 67b915a5 bellard
mingw32="no"
160 67b915a5 bellard
EXESUF=""
161 67b915a5 bellard
gdbstub="yes"
162 443f1376 bellard
slirp="yes"
163 e0e6c8c0 aliguori
vde="yes"
164 102a52e4 bellard
fmod_lib=""
165 102a52e4 bellard
fmod_inc=""
166 2f6a1ab0 blueswir1
oss_lib=""
167 8d5d2d4c ths
vnc_tls="yes"
168 2f9606b3 aliguori
vnc_sasl="yes"
169 b1a550a0 pbrook
bsd="no"
170 5327cf48 bellard
linux="no"
171 d2c7c9b8 blueswir1
solaris="no"
172 c9ec1fe4 bellard
kqemu="no"
173 05c2a3e7 bellard
profiler="no"
174 5b0753e0 bellard
cocoa="no"
175 97ccc689 bellard
check_gfx="yes"
176 0a8e90f4 pbrook
softmmu="yes"
177 831b7825 ths
linux_user="no"
178 831b7825 ths
darwin_user="no"
179 84778508 blueswir1
bsd_user="no"
180 cc8ae6de pbrook
build_docs="no"
181 c5937220 pbrook
uname_release=""
182 4d3b6f6e balrog
curses="yes"
183 414f0dab blueswir1
aio="yes"
184 bd0c5661 pbrook
nptl="yes"
185 8ff9cbf7 malc
mixemu="no"
186 fb599c9a balrog
bluez="yes"
187 7ba1e619 aliguori
kvm="yes"
188 eac30262 aliguori
kerneldir=""
189 b29fe3ed malc
aix="no"
190 77755340 ths
blobs="yes"
191 f652e6af aurel32
fdt="yes"
192 5368a422 aliguori
sdl_x11="no"
193 4a19f1ec pbrook
pkgversion=""
194 7d13299d bellard
195 7d13299d bellard
# OS specific
196 ac0df51d aliguori
if check_define __linux__ ; then
197 ac0df51d aliguori
  targetos="Linux"
198 ac0df51d aliguori
elif check_define _WIN32 ; then
199 ac0df51d aliguori
  targetos='MINGW32'
200 ac0df51d aliguori
else
201 ac0df51d aliguori
  targetos=`uname -s`
202 ac0df51d aliguori
fi
203 7d13299d bellard
case $targetos in
204 c326e0af bellard
CYGWIN*)
205 c326e0af bellard
mingw32="yes"
206 6f30fa85 ths
OS_CFLAGS="-mno-cygwin"
207 db8d7dd1 ths
if [ "$cpu" = "i386" ] ; then
208 db8d7dd1 ths
    kqemu="yes"
209 db8d7dd1 ths
fi
210 c2de5c91 malc
audio_possible_drivers="sdl"
211 c326e0af bellard
;;
212 67b915a5 bellard
MINGW32*)
213 67b915a5 bellard
mingw32="yes"
214 db8d7dd1 ths
if [ "$cpu" = "i386" ] ; then
215 db8d7dd1 ths
    kqemu="yes"
216 db8d7dd1 ths
fi
217 c2de5c91 malc
audio_possible_drivers="dsound sdl fmod"
218 67b915a5 bellard
;;
219 5c40d2bd ths
GNU/kFreeBSD)
220 0c58ac1c malc
audio_drv_list="oss"
221 f34af52c aurel32
audio_possible_drivers="oss sdl esd pa"
222 5c40d2bd ths
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
223 5c40d2bd ths
    kqemu="yes"
224 5c40d2bd ths
fi
225 5c40d2bd ths
;;
226 7d3505c5 bellard
FreeBSD)
227 7d3505c5 bellard
bsd="yes"
228 0c58ac1c malc
audio_drv_list="oss"
229 f34af52c aurel32
audio_possible_drivers="oss sdl esd pa"
230 e99f9060 bellard
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
231 07f4ddbf bellard
    kqemu="yes"
232 07f4ddbf bellard
fi
233 7d3505c5 bellard
;;
234 c5e97233 blueswir1
DragonFly)
235 c5e97233 blueswir1
bsd="yes"
236 c5e97233 blueswir1
audio_drv_list="oss"
237 c5e97233 blueswir1
audio_possible_drivers="oss sdl esd pa"
238 c5e97233 blueswir1
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
239 c5e97233 blueswir1
    kqemu="yes"
240 c5e97233 blueswir1
fi
241 c5e97233 blueswir1
aio="no"
242 c5e97233 blueswir1
;;
243 7d3505c5 bellard
NetBSD)
244 7d3505c5 bellard
bsd="yes"
245 0c58ac1c malc
audio_drv_list="oss"
246 c2de5c91 malc
audio_possible_drivers="oss sdl esd"
247 8ef92a88 blueswir1
oss_lib="-lossaudio"
248 7d3505c5 bellard
;;
249 7d3505c5 bellard
OpenBSD)
250 7d3505c5 bellard
bsd="yes"
251 128ab2ff blueswir1
openbsd="yes"
252 0c58ac1c malc
audio_drv_list="oss"
253 c2de5c91 malc
audio_possible_drivers="oss sdl esd"
254 2f6a1ab0 blueswir1
oss_lib="-lossaudio"
255 7d3505c5 bellard
;;
256 83fb7adf bellard
Darwin)
257 83fb7adf bellard
bsd="yes"
258 83fb7adf bellard
darwin="yes"
259 1b0f9cc2 aliguori
# on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
260 aab8588a malc
if [ "$cpu" = "i386" ] ; then
261 aab8588a malc
    is_x86_64=`sysctl -n hw.optional.x86_64`
262 aab8588a malc
    [ "$is_x86_64" = "1" ] && cpu=x86_64
263 1b0f9cc2 aliguori
fi
264 1b0f9cc2 aliguori
if [ "$cpu" = "x86_64" ] ; then
265 1b0f9cc2 aliguori
    OS_CFLAGS="-arch x86_64"
266 1b0f9cc2 aliguori
    LDFLAGS="-arch x86_64"
267 1b0f9cc2 aliguori
else
268 1b0f9cc2 aliguori
    OS_CFLAGS="-mdynamic-no-pic"
269 1b0f9cc2 aliguori
fi
270 831b7825 ths
darwin_user="yes"
271 fd677642 ths
cocoa="yes"
272 0c58ac1c malc
audio_drv_list="coreaudio"
273 c2de5c91 malc
audio_possible_drivers="coreaudio sdl fmod"
274 c2c59c3e ths
OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
275 83fb7adf bellard
;;
276 ec530c81 bellard
SunOS)
277 c2b84fab ths
    solaris="yes"
278 c2b84fab ths
    make="gmake"
279 c2b84fab ths
    install="ginstall"
280 0475a5ca ths
    needs_libsunmath="no"
281 c2b84fab ths
    solarisrev=`uname -r | cut -f2 -d.`
282 ef18c883 ths
    # have to select again, because `uname -m` returns i86pc
283 ef18c883 ths
    # even on an x86_64 box.
284 ef18c883 ths
    solariscpu=`isainfo -k`
285 ef18c883 ths
    if test "${solariscpu}" = "amd64" ; then
286 ef18c883 ths
        cpu="x86_64"
287 ef18c883 ths
    fi
288 c2b84fab ths
    if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
289 0475a5ca ths
        if test "$solarisrev" -le 9 ; then
290 0475a5ca ths
            if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
291 0475a5ca ths
                needs_libsunmath="yes"
292 0475a5ca ths
            else
293 0475a5ca ths
                echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
294 0475a5ca ths
                echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
295 0475a5ca ths
                echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
296 0475a5ca ths
                echo "Studio 11 can be downloaded from www.sun.com."
297 0475a5ca ths
                exit 1
298 0475a5ca ths
            fi
299 0475a5ca ths
        fi
300 0475a5ca ths
        if test "$solarisrev" -ge 9 ; then
301 c2b84fab ths
            kqemu="yes"
302 c2b84fab ths
        fi
303 86b2bd93 ths
    fi
304 6b4d2ba1 ths
    if test -f /usr/include/sys/soundcard.h ; then
305 0c58ac1c malc
        audio_drv_list="oss"
306 6b4d2ba1 ths
    fi
307 c2de5c91 malc
    audio_possible_drivers="oss sdl"
308 86b2bd93 ths
;;
309 b29fe3ed malc
AIX)
310 b29fe3ed malc
aix="yes"
311 b29fe3ed malc
make="gmake"
312 b29fe3ed malc
;;
313 1d14ffa9 bellard
*)
314 0c58ac1c malc
audio_drv_list="oss"
315 b8e59f18 malc
audio_possible_drivers="oss alsa sdl esd pa"
316 5327cf48 bellard
linux="yes"
317 831b7825 ths
linux_user="yes"
318 68063649 blueswir1
usb="linux"
319 07f4ddbf bellard
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
320 c9ec1fe4 bellard
    kqemu="yes"
321 c2de5c91 malc
    audio_possible_drivers="$audio_possible_drivers fmod"
322 c9ec1fe4 bellard
fi
323 fb065187 bellard
;;
324 7d13299d bellard
esac
325 7d13299d bellard
326 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
327 b1a550a0 pbrook
  if [ "$darwin" != "yes" ] ; then
328 83fb7adf bellard
    make="gmake"
329 68063649 blueswir1
    usb="bsd"
330 83fb7adf bellard
  fi
331 84778508 blueswir1
  bsd_user="yes"
332 7d3505c5 bellard
fi
333 7d3505c5 bellard
334 7d13299d bellard
# find source path
335 ad064840 pbrook
source_path=`dirname "$0"`
336 59faef3a balrog
source_path_used="no"
337 59faef3a balrog
workdir=`pwd`
338 ad064840 pbrook
if [ -z "$source_path" ]; then
339 59faef3a balrog
    source_path=$workdir
340 ad064840 pbrook
else
341 ad064840 pbrook
    source_path=`cd "$source_path"; pwd`
342 7d13299d bellard
fi
343 724db118 pbrook
[ -f "$workdir/vl.c" ] || source_path_used="yes"
344 7d13299d bellard
345 85aa5189 bellard
werror="no"
346 0d1e2394 bellard
# generate compile errors on warnings for development builds
347 0d1e2394 bellard
#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
348 0d1e2394 bellard
#werror="yes";
349 0d1e2394 bellard
#fi
350 85aa5189 bellard
351 7d13299d bellard
for opt do
352 a46e4035 pbrook
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
353 7d13299d bellard
  case "$opt" in
354 2efc3265 bellard
  --help|-h) show_help=yes
355 2efc3265 bellard
  ;;
356 b1a550a0 pbrook
  --prefix=*) prefix="$optarg"
357 7d13299d bellard
  ;;
358 b1a550a0 pbrook
  --interp-prefix=*) interp_prefix="$optarg"
359 32ce6337 bellard
  ;;
360 b1a550a0 pbrook
  --source-path=*) source_path="$optarg"
361 ad064840 pbrook
  source_path_used="yes"
362 7d13299d bellard
  ;;
363 ac0df51d aliguori
  --cross-prefix=*)
364 7d13299d bellard
  ;;
365 ac0df51d aliguori
  --cc=*)
366 7d13299d bellard
  ;;
367 b1a550a0 pbrook
  --host-cc=*) host_cc="$optarg"
368 83469015 bellard
  ;;
369 b1a550a0 pbrook
  --make=*) make="$optarg"
370 7d13299d bellard
  ;;
371 6a882643 pbrook
  --install=*) install="$optarg"
372 6a882643 pbrook
  ;;
373 b1a550a0 pbrook
  --extra-cflags=*) CFLAGS="$optarg"
374 7d13299d bellard
  ;;
375 b1a550a0 pbrook
  --extra-ldflags=*) LDFLAGS="$optarg"
376 7d13299d bellard
  ;;
377 b1a550a0 pbrook
  --cpu=*) cpu="$optarg"
378 7d13299d bellard
  ;;
379 b1a550a0 pbrook
  --target-list=*) target_list="$optarg"
380 de83cd02 bellard
  ;;
381 7d13299d bellard
  --enable-gprof) gprof="yes"
382 7d13299d bellard
  ;;
383 43ce4dfe bellard
  --static) static="yes"
384 43ce4dfe bellard
  ;;
385 97a847bc bellard
  --disable-sdl) sdl="no"
386 97a847bc bellard
  ;;
387 0c58ac1c malc
  --fmod-lib=*) fmod_lib="$optarg"
388 1d14ffa9 bellard
  ;;
389 c2de5c91 malc
  --fmod-inc=*) fmod_inc="$optarg"
390 c2de5c91 malc
  ;;
391 2f6a1ab0 blueswir1
  --oss-lib=*) oss_lib="$optarg"
392 2f6a1ab0 blueswir1
  ;;
393 2fa7d3bf malc
  --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
394 102a52e4 bellard
  ;;
395 0c58ac1c malc
  --audio-drv-list=*) audio_drv_list="$optarg"
396 102a52e4 bellard
  ;;
397 03b4fe7d aliguori
  --enable-sparse) sparse="yes"
398 03b4fe7d aliguori
  ;;
399 03b4fe7d aliguori
  --disable-sparse) sparse="no"
400 03b4fe7d aliguori
  ;;
401 1625af87 aliguori
  --disable-strip) strip_opt="no"
402 1625af87 aliguori
  ;;
403 8d5d2d4c ths
  --disable-vnc-tls) vnc_tls="no"
404 8d5d2d4c ths
  ;;
405 2f9606b3 aliguori
  --disable-vnc-sasl) vnc_sasl="no"
406 2f9606b3 aliguori
  ;;
407 443f1376 bellard
  --disable-slirp) slirp="no"
408 1d14ffa9 bellard
  ;;
409 e0e6c8c0 aliguori
  --disable-vde) vde="no"
410 8a16d273 ths
  ;;
411 c9ec1fe4 bellard
  --disable-kqemu) kqemu="no"
412 1d14ffa9 bellard
  ;;
413 2e4d9fb1 aurel32
  --disable-brlapi) brlapi="no"
414 2e4d9fb1 aurel32
  ;;
415 fb599c9a balrog
  --disable-bluez) bluez="no"
416 fb599c9a balrog
  ;;
417 7ba1e619 aliguori
  --disable-kvm) kvm="no"
418 7ba1e619 aliguori
  ;;
419 05c2a3e7 bellard
  --enable-profiler) profiler="yes"
420 05c2a3e7 bellard
  ;;
421 c2de5c91 malc
  --enable-cocoa)
422 c2de5c91 malc
      cocoa="yes" ;
423 c2de5c91 malc
      sdl="no" ;
424 c2de5c91 malc
      audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
425 1d14ffa9 bellard
  ;;
426 97ccc689 bellard
  --disable-gfx-check) check_gfx="no"
427 97ccc689 bellard
  ;;
428 cad25d69 pbrook
  --disable-system) softmmu="no"
429 0a8e90f4 pbrook
  ;;
430 cad25d69 pbrook
  --enable-system) softmmu="yes"
431 0a8e90f4 pbrook
  ;;
432 831b7825 ths
  --disable-linux-user) linux_user="no"
433 0a8e90f4 pbrook
  ;;
434 831b7825 ths
  --enable-linux-user) linux_user="yes"
435 831b7825 ths
  ;;
436 831b7825 ths
  --disable-darwin-user) darwin_user="no"
437 831b7825 ths
  ;;
438 831b7825 ths
  --enable-darwin-user) darwin_user="yes"
439 0a8e90f4 pbrook
  ;;
440 84778508 blueswir1
  --disable-bsd-user) bsd_user="no"
441 84778508 blueswir1
  ;;
442 84778508 blueswir1
  --enable-bsd-user) bsd_user="yes"
443 84778508 blueswir1
  ;;
444 c5937220 pbrook
  --enable-uname-release=*) uname_release="$optarg"
445 c5937220 pbrook
  ;;
446 3142255c blueswir1
  --sparc_cpu=*)
447 3142255c blueswir1
      sparc_cpu="$optarg"
448 3142255c blueswir1
      case $sparc_cpu in
449 3142255c blueswir1
        v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
450 3142255c blueswir1
                 target_cpu="sparc"; cpu="sparc" ;;
451 3142255c blueswir1
        v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
452 3142255c blueswir1
                 target_cpu="sparc"; cpu="sparc" ;;
453 3142255c blueswir1
        v9)    SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
454 3142255c blueswir1
                 target_cpu="sparc64"; cpu="sparc64" ;;
455 3142255c blueswir1
        *)     echo "undefined SPARC architecture. Exiting";exit 1;;
456 3142255c blueswir1
      esac
457 3142255c blueswir1
  ;;
458 85aa5189 bellard
  --enable-werror) werror="yes"
459 85aa5189 bellard
  ;;
460 85aa5189 bellard
  --disable-werror) werror="no"
461 85aa5189 bellard
  ;;
462 4d3b6f6e balrog
  --disable-curses) curses="no"
463 4d3b6f6e balrog
  ;;
464 bd0c5661 pbrook
  --disable-nptl) nptl="no"
465 bd0c5661 pbrook
  ;;
466 8ff9cbf7 malc
  --enable-mixemu) mixemu="yes"
467 8ff9cbf7 malc
  ;;
468 414f0dab blueswir1
  --disable-aio) aio="no"
469 414f0dab blueswir1
  ;;
470 77755340 ths
  --disable-blobs) blobs="no"
471 77755340 ths
  ;;
472 eac30262 aliguori
  --kerneldir=*) kerneldir="$optarg"
473 eac30262 aliguori
  ;;
474 4a19f1ec pbrook
  --with-pkgversion=*) pkgversion=" ($optarg)"
475 4a19f1ec pbrook
  ;;
476 7f1559c6 balrog
  *) echo "ERROR: unknown option $opt"; show_help="yes"
477 7f1559c6 balrog
  ;;
478 7d13299d bellard
  esac
479 7d13299d bellard
done
480 7d13299d bellard
481 6f30fa85 ths
# default flags for all hosts
482 ac41a620 blueswir1
CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
483 e0e36fe9 blueswir1
CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
484 6f30fa85 ths
LDFLAGS="$LDFLAGS -g"
485 85aa5189 bellard
if test "$werror" = "yes" ; then
486 85aa5189 bellard
CFLAGS="$CFLAGS -Werror"
487 85aa5189 bellard
fi
488 6f30fa85 ths
489 d2c7c9b8 blueswir1
if test "$solaris" = "no" ; then
490 d2c7c9b8 blueswir1
    if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
491 d2c7c9b8 blueswir1
        LDFLAGS="$LDFLAGS -Wl,--warn-common"
492 d2c7c9b8 blueswir1
    fi
493 49237acd blueswir1
fi
494 49237acd blueswir1
495 3142255c blueswir1
#
496 3142255c blueswir1
# If cpu ~= sparc and  sparc_cpu hasn't been defined, plug in the right
497 3142255c blueswir1
# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
498 3142255c blueswir1
#
499 40293e58 bellard
case "$cpu" in
500 3142255c blueswir1
    sparc) if test -z "$sparc_cpu" ; then
501 3142255c blueswir1
               ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
502 3142255c blueswir1
               ARCH_LDFLAGS="-m32"
503 3142255c blueswir1
           else
504 3142255c blueswir1
               ARCH_CFLAGS="${SP_CFLAGS}"
505 3142255c blueswir1
               ARCH_LDFLAGS="${SP_LDFLAGS}"
506 3142255c blueswir1
           fi
507 762e8230 blueswir1
           ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
508 762e8230 blueswir1
           if test "$solaris" = "no" ; then
509 762e8230 blueswir1
               ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6"
510 762e8230 blueswir1
           fi
511 3142255c blueswir1
           ;;
512 3142255c blueswir1
    sparc64) if test -z "$sparc_cpu" ; then
513 3142255c blueswir1
               ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
514 3142255c blueswir1
               ARCH_LDFLAGS="-m64"
515 3142255c blueswir1
           else
516 3142255c blueswir1
               ARCH_CFLAGS="${SP_CFLAGS}"
517 3142255c blueswir1
               ARCH_LDFLAGS="${SP_LDFLAGS}"
518 3142255c blueswir1
           fi
519 762e8230 blueswir1
           if test "$solaris" = "no" ; then
520 762e8230 blueswir1
               ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
521 762e8230 blueswir1
           else
522 762e8230 blueswir1
               ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7"
523 762e8230 blueswir1
           fi
524 3142255c blueswir1
           ;;
525 76d83bde ths
    s390)
526 76d83bde ths
           ARCH_CFLAGS="-march=z900"
527 76d83bde ths
           ;;
528 40293e58 bellard
    i386)
529 40293e58 bellard
           ARCH_CFLAGS="-m32"
530 40293e58 bellard
           ARCH_LDFLAGS="-m32"
531 40293e58 bellard
           ;;
532 40293e58 bellard
    x86_64)
533 40293e58 bellard
           ARCH_CFLAGS="-m64"
534 40293e58 bellard
           ARCH_LDFLAGS="-m64"
535 40293e58 bellard
           ;;
536 3142255c blueswir1
esac
537 3142255c blueswir1
538 af5db58e pbrook
if test x"$show_help" = x"yes" ; then
539 af5db58e pbrook
cat << EOF
540 af5db58e pbrook
541 af5db58e pbrook
Usage: configure [options]
542 af5db58e pbrook
Options: [defaults in brackets after descriptions]
543 af5db58e pbrook
544 af5db58e pbrook
EOF
545 af5db58e pbrook
echo "Standard options:"
546 af5db58e pbrook
echo "  --help                   print this message"
547 af5db58e pbrook
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
548 af5db58e pbrook
echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
549 af5db58e pbrook
echo "                           use %M for cpu name [$interp_prefix]"
550 af5db58e pbrook
echo "  --target-list=LIST       set target list [$target_list]"
551 af5db58e pbrook
echo ""
552 af5db58e pbrook
echo "kqemu kernel acceleration support:"
553 af5db58e pbrook
echo "  --disable-kqemu          disable kqemu support"
554 af5db58e pbrook
echo ""
555 af5db58e pbrook
echo "Advanced options (experts only):"
556 af5db58e pbrook
echo "  --source-path=PATH       path of source code [$source_path]"
557 af5db58e pbrook
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
558 af5db58e pbrook
echo "  --cc=CC                  use C compiler CC [$cc]"
559 af5db58e pbrook
echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
560 2981fa96 aurel32
echo "  --extra-cflags=CFLAGS    add C compiler flags CFLAGS"
561 2981fa96 aurel32
echo "  --extra-ldflags=LDFLAGS  add linker flags LDFLAGS"
562 af5db58e pbrook
echo "  --make=MAKE              use specified make [$make]"
563 6a882643 pbrook
echo "  --install=INSTALL        use specified install [$install]"
564 af5db58e pbrook
echo "  --static                 enable static build [$static]"
565 890b1658 aliguori
echo "  --enable-sparse          enable sparse checker"
566 890b1658 aliguori
echo "  --disable-sparse         disable sparse checker (default)"
567 1625af87 aliguori
echo "  --disable-strip          disable stripping binaries"
568 85aa5189 bellard
echo "  --disable-werror         disable compilation abort on warning"
569 fe8f78e4 balrog
echo "  --disable-sdl            disable SDL"
570 af5db58e pbrook
echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
571 c2de5c91 malc
echo "  --audio-drv-list=LIST    set audio drivers list:"
572 c2de5c91 malc
echo "                           Available drivers: $audio_possible_drivers"
573 4c9b53e3 malc
echo "  --audio-card-list=LIST   set list of emulated audio cards [$audio_card_list]"
574 4c9b53e3 malc
echo "                           Available cards: $audio_possible_cards"
575 8ff9cbf7 malc
echo "  --enable-mixemu          enable mixer emulation"
576 2e4d9fb1 aurel32
echo "  --disable-brlapi         disable BrlAPI"
577 8d5d2d4c ths
echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
578 2f9606b3 aliguori
echo "  --disable-vnc-sasl       disable SASL encryption for VNC server"
579 af896aaa pbrook
echo "  --disable-curses         disable curses output"
580 fb599c9a balrog
echo "  --disable-bluez          disable bluez stack connectivity"
581 7ba1e619 aliguori
echo "  --disable-kvm            disable KVM acceleration support"
582 bd0c5661 pbrook
echo "  --disable-nptl           disable usermode NPTL support"
583 af5db58e pbrook
echo "  --enable-system          enable all system emulation targets"
584 af5db58e pbrook
echo "  --disable-system         disable all system emulation targets"
585 831b7825 ths
echo "  --enable-linux-user      enable all linux usermode emulation targets"
586 831b7825 ths
echo "  --disable-linux-user     disable all linux usermode emulation targets"
587 831b7825 ths
echo "  --enable-darwin-user     enable all darwin usermode emulation targets"
588 831b7825 ths
echo "  --disable-darwin-user    disable all darwin usermode emulation targets"
589 84778508 blueswir1
echo "  --enable-bsd-user        enable all BSD usermode emulation targets"
590 84778508 blueswir1
echo "  --disable-bsd-user       disable all BSD usermode emulation targets"
591 af5db58e pbrook
echo "  --fmod-lib               path to FMOD library"
592 af5db58e pbrook
echo "  --fmod-inc               path to FMOD includes"
593 2f6a1ab0 blueswir1
echo "  --oss-lib                path to OSS library"
594 c5937220 pbrook
echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
595 3142255c blueswir1
echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
596 e0e6c8c0 aliguori
echo "  --disable-vde            disable support for vde network"
597 414f0dab blueswir1
echo "  --disable-aio            disable AIO support"
598 77755340 ths
echo "  --disable-blobs          disable installing provided firmware blobs"
599 eac30262 aliguori
echo "  --kerneldir=PATH         look for kernel includes in PATH"
600 af5db58e pbrook
echo ""
601 5bf08934 ths
echo "NOTE: The object files are built at the place where configure is launched"
602 af5db58e pbrook
exit 1
603 af5db58e pbrook
fi
604 af5db58e pbrook
605 67b915a5 bellard
if test "$mingw32" = "yes" ; then
606 5327cf48 bellard
    linux="no"
607 67b915a5 bellard
    EXESUF=".exe"
608 9f059eca bellard
    oss="no"
609 cd01b4a3 aliguori
    linux_user="no"
610 84778508 blueswir1
    bsd_user="no"
611 49dc768d aliguori
    OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
612 cd01b4a3 aliguori
fi
613 cd01b4a3 aliguori
614 03b4fe7d aliguori
if test ! -x "$(which cgcc 2>/dev/null)"; then
615 03b4fe7d aliguori
    sparse="no"
616 03b4fe7d aliguori
fi
617 03b4fe7d aliguori
618 ec530c81 bellard
#
619 ec530c81 bellard
# Solaris specific configure tool chain decisions
620 ec530c81 bellard
#
621 ec530c81 bellard
if test "$solaris" = "yes" ; then
622 ec530c81 bellard
  solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
623 ec530c81 bellard
  if test -z "$solinst" ; then
624 ec530c81 bellard
    echo "Solaris install program not found. Use --install=/usr/ucb/install or"
625 ec530c81 bellard
    echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
626 ec530c81 bellard
    echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
627 ec530c81 bellard
    exit 1
628 ec530c81 bellard
  fi
629 ec530c81 bellard
  if test "$solinst" = "/usr/sbin/install" ; then
630 ec530c81 bellard
    echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
631 ec530c81 bellard
    echo "try ginstall from the GNU fileutils available from www.blastwave.org"
632 ec530c81 bellard
    echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
633 ec530c81 bellard
    exit 1
634 ec530c81 bellard
  fi
635 ec530c81 bellard
  sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
636 ec530c81 bellard
  if test -z "$sol_ar" ; then
637 ec530c81 bellard
    echo "Error: No path includes ar"
638 ec530c81 bellard
    if test -f /usr/ccs/bin/ar ; then
639 ec530c81 bellard
      echo "Add /usr/ccs/bin to your path and rerun configure"
640 ec530c81 bellard
    fi
641 ec530c81 bellard
    exit 1
642 ec530c81 bellard
  fi
643 5fafdf24 ths
fi
644 ec530c81 bellard
645 ec530c81 bellard
646 5327cf48 bellard
if test -z "$target_list" ; then
647 5327cf48 bellard
# these targets are portable
648 0a8e90f4 pbrook
    if [ "$softmmu" = "yes" ] ; then
649 2408a527 aurel32
        target_list="\
650 2408a527 aurel32
i386-softmmu \
651 2408a527 aurel32
x86_64-softmmu \
652 2408a527 aurel32
arm-softmmu \
653 2408a527 aurel32
cris-softmmu \
654 2408a527 aurel32
m68k-softmmu \
655 2408a527 aurel32
mips-softmmu \
656 2408a527 aurel32
mipsel-softmmu \
657 2408a527 aurel32
mips64-softmmu \
658 2408a527 aurel32
mips64el-softmmu \
659 2408a527 aurel32
ppc-softmmu \
660 2408a527 aurel32
ppcemb-softmmu \
661 2408a527 aurel32
ppc64-softmmu \
662 2408a527 aurel32
sh4-softmmu \
663 2408a527 aurel32
sh4eb-softmmu \
664 2408a527 aurel32
sparc-softmmu \
665 2408a527 aurel32
"
666 0a8e90f4 pbrook
    fi
667 5327cf48 bellard
# the following are Linux specific
668 831b7825 ths
    if [ "$linux_user" = "yes" ] ; then
669 2408a527 aurel32
        target_list="${target_list}\
670 2408a527 aurel32
i386-linux-user \
671 2408a527 aurel32
x86_64-linux-user \
672 2408a527 aurel32
alpha-linux-user \
673 2408a527 aurel32
arm-linux-user \
674 2408a527 aurel32
armeb-linux-user \
675 2408a527 aurel32
cris-linux-user \
676 2408a527 aurel32
m68k-linux-user \
677 2408a527 aurel32
mips-linux-user \
678 2408a527 aurel32
mipsel-linux-user \
679 2408a527 aurel32
ppc-linux-user \
680 2408a527 aurel32
ppc64-linux-user \
681 2408a527 aurel32
ppc64abi32-linux-user \
682 2408a527 aurel32
sh4-linux-user \
683 2408a527 aurel32
sh4eb-linux-user \
684 2408a527 aurel32
sparc-linux-user \
685 2408a527 aurel32
sparc64-linux-user \
686 2408a527 aurel32
sparc32plus-linux-user \
687 2408a527 aurel32
"
688 831b7825 ths
    fi
689 831b7825 ths
# the following are Darwin specific
690 831b7825 ths
    if [ "$darwin_user" = "yes" ] ; then
691 6cdc7375 malc
        target_list="$target_list i386-darwin-user ppc-darwin-user "
692 5327cf48 bellard
    fi
693 84778508 blueswir1
# the following are BSD specific
694 84778508 blueswir1
    if [ "$bsd_user" = "yes" ] ; then
695 84778508 blueswir1
        target_list="${target_list}\
696 31fc12df blueswir1
i386-bsd-user \
697 31fc12df blueswir1
x86_64-bsd-user \
698 31fc12df blueswir1
sparc-bsd-user \
699 84778508 blueswir1
sparc64-bsd-user \
700 84778508 blueswir1
"
701 84778508 blueswir1
    fi
702 6e20a45f bellard
else
703 b1a550a0 pbrook
    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
704 5327cf48 bellard
fi
705 0a8e90f4 pbrook
if test -z "$target_list" ; then
706 0a8e90f4 pbrook
    echo "No targets enabled"
707 0a8e90f4 pbrook
    exit 1
708 0a8e90f4 pbrook
fi
709 5327cf48 bellard
710 7d13299d bellard
if test -z "$cross_prefix" ; then
711 7d13299d bellard
712 7d13299d bellard
# ---
713 7d13299d bellard
# big/little endian test
714 7d13299d bellard
cat > $TMPC << EOF
715 7d13299d bellard
#include <inttypes.h>
716 7d13299d bellard
int main(int argc, char ** argv){
717 1d14ffa9 bellard
        volatile uint32_t i=0x01234567;
718 1d14ffa9 bellard
        return (*((uint8_t*)(&i))) == 0x67;
719 7d13299d bellard
}
720 7d13299d bellard
EOF
721 7d13299d bellard
722 178baee6 aurel32
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
723 7d13299d bellard
$TMPE && bigendian="yes"
724 7d13299d bellard
else
725 7d13299d bellard
echo big/little test failed
726 7d13299d bellard
fi
727 7d13299d bellard
728 7d13299d bellard
else
729 7d13299d bellard
730 7d13299d bellard
# if cross compiling, cannot launch a program, so make a static guess
731 0938cda5 aurel32
if test "$cpu" = "armv4b" \
732 f54b3f92 aurel32
     -o "$cpu" = "hppa" \
733 0938cda5 aurel32
     -o "$cpu" = "m68k" \
734 0938cda5 aurel32
     -o "$cpu" = "mips" \
735 0938cda5 aurel32
     -o "$cpu" = "mips64" \
736 fdf7ed96 malc
     -o "$cpu" = "ppc" \
737 fdf7ed96 malc
     -o "$cpu" = "ppc64" \
738 0938cda5 aurel32
     -o "$cpu" = "s390" \
739 0938cda5 aurel32
     -o "$cpu" = "sparc" \
740 0938cda5 aurel32
     -o "$cpu" = "sparc64"; then
741 7d13299d bellard
    bigendian="yes"
742 7d13299d bellard
fi
743 7d13299d bellard
744 7d13299d bellard
fi
745 7d13299d bellard
746 b6853697 bellard
# host long bits test
747 b6853697 bellard
hostlongbits="32"
748 0938cda5 aurel32
if test "$cpu" = "x86_64" \
749 0938cda5 aurel32
     -o "$cpu" = "alpha" \
750 0938cda5 aurel32
     -o "$cpu" = "ia64" \
751 fdf7ed96 malc
     -o "$cpu" = "sparc64" \
752 fdf7ed96 malc
     -o "$cpu" = "ppc64"; then
753 b6853697 bellard
    hostlongbits="64"
754 b6853697 bellard
fi
755 b6853697 bellard
756 bd0c5661 pbrook
# Check host NPTL support
757 bd0c5661 pbrook
cat > $TMPC <<EOF
758 bd0c5661 pbrook
#include <sched.h>
759 30813cea pbrook
#include <linux/futex.h>
760 bd0c5661 pbrook
void foo()
761 bd0c5661 pbrook
{
762 bd0c5661 pbrook
#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
763 bd0c5661 pbrook
#error bork
764 bd0c5661 pbrook
#endif
765 bd0c5661 pbrook
}
766 bd0c5661 pbrook
EOF
767 bd0c5661 pbrook
768 8c7f7574 balrog
if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
769 bd0c5661 pbrook
  :
770 bd0c5661 pbrook
else
771 bd0c5661 pbrook
   nptl="no"
772 bd0c5661 pbrook
fi
773 bd0c5661 pbrook
774 11d9f695 bellard
##########################################
775 ac62922e balrog
# zlib check
776 ac62922e balrog
777 ac62922e balrog
cat > $TMPC << EOF
778 ac62922e balrog
#include <zlib.h>
779 ac62922e balrog
int main(void) { zlibVersion(); return 0; }
780 ac62922e balrog
EOF
781 8c7f7574 balrog
if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
782 ac62922e balrog
    :
783 ac62922e balrog
else
784 ac62922e balrog
    echo
785 ac62922e balrog
    echo "Error: zlib check failed"
786 ac62922e balrog
    echo "Make sure to have the zlib libs and headers installed."
787 ac62922e balrog
    echo
788 ac62922e balrog
    exit 1
789 ac62922e balrog
fi
790 ac62922e balrog
791 ac62922e balrog
##########################################
792 11d9f695 bellard
# SDL probe
793 11d9f695 bellard
794 11d9f695 bellard
sdl_too_old=no
795 11d9f695 bellard
796 11d9f695 bellard
if test -z "$sdl" ; then
797 069b0bda ths
    sdl_config="sdl-config"
798 069b0bda ths
    sdl=no
799 069b0bda ths
    sdl_static=no
800 069b0bda ths
801 11d9f695 bellard
cat > $TMPC << EOF
802 11d9f695 bellard
#include <SDL.h>
803 11d9f695 bellard
#undef main /* We don't want SDL to override our main() */
804 11d9f695 bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
805 11d9f695 bellard
EOF
806 8c7f7574 balrog
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then
807 cd01b4a3 aliguori
        _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
808 cd01b4a3 aliguori
        if test "$_sdlversion" -lt 121 ; then
809 cd01b4a3 aliguori
            sdl_too_old=yes
810 cd01b4a3 aliguori
        else
811 cd01b4a3 aliguori
            if test "$cocoa" = "no" ; then
812 cd01b4a3 aliguori
                sdl=yes
813 069b0bda ths
            fi
814 cd01b4a3 aliguori
        fi
815 11d9f695 bellard
816 cd01b4a3 aliguori
        # static link with sdl ?
817 cd01b4a3 aliguori
        if test "$sdl" = "yes" ; then
818 cd01b4a3 aliguori
            aa="no"
819 cd01b4a3 aliguori
            `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
820 cd01b4a3 aliguori
            sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
821 cd01b4a3 aliguori
            if [ "$aa" = "yes" ] ; then
822 cd01b4a3 aliguori
                sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
823 cd01b4a3 aliguori
            fi
824 cd01b4a3 aliguori
825 8c7f7574 balrog
            if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
826 cd01b4a3 aliguori
                sdl_static=yes
827 cd01b4a3 aliguori
            fi
828 cd01b4a3 aliguori
        fi # static link
829 cd01b4a3 aliguori
    fi # sdl compile test
830 fd677642 ths
else
831 069b0bda ths
    # Make sure to disable cocoa if sdl was set
832 069b0bda ths
    if test "$sdl" = "yes" ; then
833 069b0bda ths
       cocoa="no"
834 c2de5c91 malc
       audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
835 069b0bda ths
    fi
836 a6e022ad bellard
fi # -z $sdl
837 11d9f695 bellard
838 5368a422 aliguori
if test "$sdl" = "yes" ; then
839 5368a422 aliguori
cat > $TMPC <<EOF
840 5368a422 aliguori
#include <SDL.h>
841 5368a422 aliguori
#if defined(SDL_VIDEO_DRIVER_X11)
842 5368a422 aliguori
#include <X11/XKBlib.h>
843 5368a422 aliguori
#else
844 5368a422 aliguori
#error No x11 support
845 5368a422 aliguori
#endif
846 5368a422 aliguori
int main(void) { return 0; }
847 5368a422 aliguori
EOF
848 5368a422 aliguori
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then
849 5368a422 aliguori
	sdl_x11="yes"
850 5368a422 aliguori
    fi
851 5368a422 aliguori
fi
852 5368a422 aliguori
853 8f28f3fb ths
##########################################
854 8d5d2d4c ths
# VNC TLS detection
855 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
856 ae6b5e5a aliguori
cat > $TMPC <<EOF
857 ae6b5e5a aliguori
#include <gnutls/gnutls.h>
858 ae6b5e5a aliguori
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
859 ae6b5e5a aliguori
EOF
860 ae6b5e5a aliguori
    vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
861 ae6b5e5a aliguori
    vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
862 ae6b5e5a aliguori
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
863 8c7f7574 balrog
           $vnc_tls_libs > /dev/null 2> /dev/null ; then
864 ae6b5e5a aliguori
	:
865 ae6b5e5a aliguori
    else
866 ae6b5e5a aliguori
	vnc_tls="no"
867 ae6b5e5a aliguori
    fi
868 8d5d2d4c ths
fi
869 8d5d2d4c ths
870 8d5d2d4c ths
##########################################
871 2f9606b3 aliguori
# VNC SASL detection
872 2f9606b3 aliguori
if test "$vnc_sasl" = "yes" ; then
873 2f9606b3 aliguori
cat > $TMPC <<EOF
874 2f9606b3 aliguori
#include <sasl/sasl.h>
875 2f9606b3 aliguori
#include <stdio.h>
876 2f9606b3 aliguori
int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
877 2f9606b3 aliguori
EOF
878 2f9606b3 aliguori
    # Assuming Cyrus-SASL installed in /usr prefix
879 2f9606b3 aliguori
    vnc_sasl_cflags=""
880 2f9606b3 aliguori
    vnc_sasl_libs="-lsasl2"
881 2f9606b3 aliguori
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
882 2f9606b3 aliguori
           $vnc_sasl_libs 2> /dev/null ; then
883 2f9606b3 aliguori
	:
884 2f9606b3 aliguori
    else
885 2f9606b3 aliguori
	vnc_sasl="no"
886 2f9606b3 aliguori
    fi
887 2f9606b3 aliguori
fi
888 2f9606b3 aliguori
889 2f9606b3 aliguori
##########################################
890 76655d6d aliguori
# fnmatch() probe, used for ACL routines
891 76655d6d aliguori
fnmatch="no"
892 76655d6d aliguori
cat > $TMPC << EOF
893 76655d6d aliguori
#include <fnmatch.h>
894 76655d6d aliguori
int main(void)
895 76655d6d aliguori
{
896 76655d6d aliguori
    fnmatch("foo", "foo", 0);
897 76655d6d aliguori
    return 0;
898 76655d6d aliguori
}
899 76655d6d aliguori
EOF
900 76655d6d aliguori
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
901 76655d6d aliguori
   fnmatch="yes"
902 76655d6d aliguori
fi
903 76655d6d aliguori
904 76655d6d aliguori
##########################################
905 8a16d273 ths
# vde libraries probe
906 8a16d273 ths
if test "$vde" = "yes" ; then
907 8a16d273 ths
  cat > $TMPC << EOF
908 8a16d273 ths
#include <libvdeplug.h>
909 4a7f0e06 pbrook
int main(void)
910 4a7f0e06 pbrook
{
911 4a7f0e06 pbrook
    struct vde_open_args a = {0, 0, 0};
912 4a7f0e06 pbrook
    vde_open("", "", &a);
913 4a7f0e06 pbrook
    return 0;
914 4a7f0e06 pbrook
}
915 8a16d273 ths
EOF
916 8c7f7574 balrog
    if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
917 8a16d273 ths
        :
918 8a16d273 ths
    else
919 e0e6c8c0 aliguori
        vde="no"
920 8a16d273 ths
    fi
921 8a16d273 ths
fi
922 8a16d273 ths
923 8a16d273 ths
##########################################
924 c2de5c91 malc
# Sound support libraries probe
925 8f28f3fb ths
926 c2de5c91 malc
audio_drv_probe()
927 c2de5c91 malc
{
928 c2de5c91 malc
    drv=$1
929 c2de5c91 malc
    hdr=$2
930 c2de5c91 malc
    lib=$3
931 c2de5c91 malc
    exp=$4
932 c2de5c91 malc
    cfl=$5
933 c2de5c91 malc
        cat > $TMPC << EOF
934 c2de5c91 malc
#include <$hdr>
935 c2de5c91 malc
int main(void) { $exp }
936 8f28f3fb ths
EOF
937 8c7f7574 balrog
    if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
938 c2de5c91 malc
        :
939 c2de5c91 malc
    else
940 c2de5c91 malc
        echo
941 c2de5c91 malc
        echo "Error: $drv check failed"
942 c2de5c91 malc
        echo "Make sure to have the $drv libs and headers installed."
943 c2de5c91 malc
        echo
944 c2de5c91 malc
        exit 1
945 c2de5c91 malc
    fi
946 c2de5c91 malc
}
947 c2de5c91 malc
948 2fa7d3bf malc
audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
949 c2de5c91 malc
for drv in $audio_drv_list; do
950 c2de5c91 malc
    case $drv in
951 c2de5c91 malc
    alsa)
952 c2de5c91 malc
    audio_drv_probe $drv alsa/asoundlib.h -lasound \
953 c2de5c91 malc
        "snd_pcm_t **handle; return snd_pcm_close(*handle);"
954 c2de5c91 malc
    ;;
955 c2de5c91 malc
956 c2de5c91 malc
    fmod)
957 c2de5c91 malc
    if test -z $fmod_lib || test -z $fmod_inc; then
958 c2de5c91 malc
        echo
959 c2de5c91 malc
        echo "Error: You must specify path to FMOD library and headers"
960 c2de5c91 malc
        echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
961 c2de5c91 malc
        echo
962 c2de5c91 malc
        exit 1
963 c2de5c91 malc
    fi
964 c2de5c91 malc
    audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
965 c2de5c91 malc
    ;;
966 c2de5c91 malc
967 c2de5c91 malc
    esd)
968 c2de5c91 malc
    audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
969 c2de5c91 malc
    ;;
970 b8e59f18 malc
971 b8e59f18 malc
    pa)
972 b8e59f18 malc
    audio_drv_probe $drv pulse/simple.h -lpulse-simple \
973 b8e59f18 malc
        "pa_simple *s = NULL; pa_simple_free(s); return 0;"
974 b8e59f18 malc
    ;;
975 b8e59f18 malc
976 2f6a1ab0 blueswir1
    oss|sdl|core|wav|dsound)
977 2f6a1ab0 blueswir1
    # XXX: Probes for CoreAudio, DirectSound, SDL(?)
978 2f6a1ab0 blueswir1
    ;;
979 2f6a1ab0 blueswir1
980 e4c63a6a malc
    *)
981 1c9b2a52 malc
    echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
982 e4c63a6a malc
        echo
983 e4c63a6a malc
        echo "Error: Unknown driver '$drv' selected"
984 e4c63a6a malc
        echo "Possible drivers are: $audio_possible_drivers"
985 e4c63a6a malc
        echo
986 e4c63a6a malc
        exit 1
987 e4c63a6a malc
    }
988 e4c63a6a malc
    ;;
989 c2de5c91 malc
    esac
990 c2de5c91 malc
done
991 8f28f3fb ths
992 4d3b6f6e balrog
##########################################
993 2e4d9fb1 aurel32
# BrlAPI probe
994 2e4d9fb1 aurel32
995 2e4d9fb1 aurel32
if test -z "$brlapi" ; then
996 2e4d9fb1 aurel32
    brlapi=no
997 2e4d9fb1 aurel32
cat > $TMPC << EOF
998 2e4d9fb1 aurel32
#include <brlapi.h>
999 2e4d9fb1 aurel32
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1000 2e4d9fb1 aurel32
EOF
1001 178baee6 aurel32
    if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
1002 2e4d9fb1 aurel32
	    brlapi=yes
1003 2e4d9fb1 aurel32
    fi # brlapi compile test
1004 2e4d9fb1 aurel32
fi # -z $brlapi
1005 2e4d9fb1 aurel32
1006 2e4d9fb1 aurel32
##########################################
1007 4d3b6f6e balrog
# curses probe
1008 4d3b6f6e balrog
1009 4d3b6f6e balrog
if test "$curses" = "yes" ; then
1010 4d3b6f6e balrog
  curses=no
1011 4d3b6f6e balrog
  cat > $TMPC << EOF
1012 4d3b6f6e balrog
#include <curses.h>
1013 4d3b6f6e balrog
int main(void) { return curses_version(); }
1014 4d3b6f6e balrog
EOF
1015 178baee6 aurel32
  if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
1016 4d3b6f6e balrog
    curses=yes
1017 4d3b6f6e balrog
  fi
1018 4d3b6f6e balrog
fi # test "$curses"
1019 4d3b6f6e balrog
1020 414f0dab blueswir1
##########################################
1021 fb599c9a balrog
# bluez support probe
1022 fb599c9a balrog
if test "$bluez" = "yes" ; then
1023 fb599c9a balrog
  `pkg-config bluez` || bluez="no"
1024 fb599c9a balrog
fi
1025 fb599c9a balrog
if test "$bluez" = "yes" ; then
1026 e820e3f4 balrog
  cat > $TMPC << EOF
1027 e820e3f4 balrog
#include <bluetooth/bluetooth.h>
1028 e820e3f4 balrog
int main(void) { return bt_error(0); }
1029 e820e3f4 balrog
EOF
1030 fb599c9a balrog
  bluez_cflags=`pkg-config --cflags bluez`
1031 fb599c9a balrog
  bluez_libs=`pkg-config --libs bluez`
1032 17e1592d balrog
  if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
1033 8c7f7574 balrog
      $bluez_libs > /dev/null 2> /dev/null ; then
1034 e820e3f4 balrog
    :
1035 e820e3f4 balrog
  else
1036 e820e3f4 balrog
    bluez="no"
1037 e820e3f4 balrog
  fi
1038 fb599c9a balrog
fi
1039 fb599c9a balrog
1040 fb599c9a balrog
##########################################
1041 7ba1e619 aliguori
# kvm probe
1042 7ba1e619 aliguori
if test "$kvm" = "yes" ; then
1043 7ba1e619 aliguori
    cat > $TMPC <<EOF
1044 7ba1e619 aliguori
#include <linux/kvm.h>
1045 9fd8d8d7 aliguori
#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
1046 7ba1e619 aliguori
#error Invalid KVM version
1047 7ba1e619 aliguori
#endif
1048 9fd8d8d7 aliguori
#if !defined(KVM_CAP_USER_MEMORY)
1049 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_USER_MEMORY
1050 9fd8d8d7 aliguori
#endif
1051 9fd8d8d7 aliguori
#if !defined(KVM_CAP_SET_TSS_ADDR)
1052 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1053 9fd8d8d7 aliguori
#endif
1054 9fd8d8d7 aliguori
#if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1055 9fd8d8d7 aliguori
#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1056 9fd8d8d7 aliguori
#endif
1057 7ba1e619 aliguori
int main(void) { return 0; }
1058 7ba1e619 aliguori
EOF
1059 eac30262 aliguori
  if test "$kerneldir" != "" ; then
1060 eac30262 aliguori
      kvm_cflags=-I"$kerneldir"/include
1061 8444eb6e aliguori
      if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1062 8444eb6e aliguori
         -a -d "$kerneldir/arch/x86/include" ; then
1063 8444eb6e aliguori
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
1064 406b430d aliguori
	elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1065 406b430d aliguori
	    kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
1066 8444eb6e aliguori
        elif test -d "$kerneldir/arch/$cpu/include" ; then
1067 8444eb6e aliguori
            kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1068 8444eb6e aliguori
      fi
1069 eac30262 aliguori
  else
1070 eac30262 aliguori
      kvm_cflags=""
1071 eac30262 aliguori
  fi
1072 7ba1e619 aliguori
  if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
1073 8c7f7574 balrog
      > /dev/null 2>/dev/null ; then
1074 7ba1e619 aliguori
    :
1075 7ba1e619 aliguori
  else
1076 9fd8d8d7 aliguori
    kvm="no";
1077 9fd8d8d7 aliguori
    if [ -x "`which awk 2>/dev/null`" ] && \
1078 9fd8d8d7 aliguori
       [ -x "`which grep 2>/dev/null`" ]; then
1079 e4f5100c blueswir1
      kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
1080 9fd8d8d7 aliguori
	| grep "error: " \
1081 9fd8d8d7 aliguori
	| awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1082 9fd8d8d7 aliguori
      if test "$kvmerr" != "" ; then
1083 9fd8d8d7 aliguori
        kvm="no - (${kvmerr})"
1084 9fd8d8d7 aliguori
      fi
1085 9fd8d8d7 aliguori
    fi
1086 7ba1e619 aliguori
  fi
1087 7ba1e619 aliguori
fi
1088 7ba1e619 aliguori
1089 7ba1e619 aliguori
##########################################
1090 414f0dab blueswir1
# AIO probe
1091 3c529d93 aliguori
AIOLIBS=""
1092 3c529d93 aliguori
1093 414f0dab blueswir1
if test "$aio" = "yes" ; then
1094 414f0dab blueswir1
  aio=no
1095 414f0dab blueswir1
  cat > $TMPC << EOF
1096 3c529d93 aliguori
#include <pthread.h>
1097 c9db92fc blueswir1
int main(void) { pthread_mutex_t lock;  return 0; }
1098 414f0dab blueswir1
EOF
1099 414f0dab blueswir1
  if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1100 414f0dab blueswir1
    aio=yes
1101 3c529d93 aliguori
    AIOLIBS="-lpthread"
1102 414f0dab blueswir1
  fi
1103 414f0dab blueswir1
fi
1104 414f0dab blueswir1
1105 bf9298b9 aliguori
##########################################
1106 bf9298b9 aliguori
# iovec probe
1107 bf9298b9 aliguori
cat > $TMPC <<EOF
1108 db34f0b3 blueswir1
#include <sys/types.h>
1109 bf9298b9 aliguori
#include <sys/uio.h>
1110 db34f0b3 blueswir1
#include <unistd.h>
1111 bf9298b9 aliguori
int main(void) { struct iovec iov; return 0; }
1112 bf9298b9 aliguori
EOF
1113 bf9298b9 aliguori
iovec=no
1114 8c7f7574 balrog
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1115 bf9298b9 aliguori
  iovec=yes
1116 bf9298b9 aliguori
fi
1117 bf9298b9 aliguori
1118 f652e6af aurel32
##########################################
1119 ceb42de8 aliguori
# preadv probe
1120 ceb42de8 aliguori
cat > $TMPC <<EOF
1121 ceb42de8 aliguori
#include <sys/types.h>
1122 ceb42de8 aliguori
#include <sys/uio.h>
1123 ceb42de8 aliguori
#include <unistd.h>
1124 ceb42de8 aliguori
int main(void) { preadv; }
1125 ceb42de8 aliguori
EOF
1126 ceb42de8 aliguori
preadv=no
1127 ceb42de8 aliguori
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1128 ceb42de8 aliguori
  preadv=yes
1129 ceb42de8 aliguori
fi
1130 ceb42de8 aliguori
1131 ceb42de8 aliguori
##########################################
1132 f652e6af aurel32
# fdt probe
1133 f652e6af aurel32
if test "$fdt" = "yes" ; then
1134 f652e6af aurel32
    fdt=no
1135 f652e6af aurel32
    cat > $TMPC << EOF
1136 f652e6af aurel32
int main(void) { return 0; }
1137 f652e6af aurel32
EOF
1138 f652e6af aurel32
  if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1139 f652e6af aurel32
    fdt=yes
1140 f652e6af aurel32
  fi
1141 f652e6af aurel32
fi
1142 f652e6af aurel32
1143 cc8ae6de pbrook
# Check if tools are available to build documentation.
1144 6c591867 ths
if [ -x "`which texi2html 2>/dev/null`" ] && \
1145 6c591867 ths
   [ -x "`which pod2man 2>/dev/null`" ]; then
1146 cc8ae6de pbrook
  build_docs="yes"
1147 cc8ae6de pbrook
fi
1148 cc8ae6de pbrook
1149 da93a1fd aliguori
##########################################
1150 da93a1fd aliguori
# Do we need librt
1151 da93a1fd aliguori
cat > $TMPC <<EOF
1152 da93a1fd aliguori
#include <signal.h>
1153 da93a1fd aliguori
#include <time.h>
1154 da93a1fd aliguori
int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1155 da93a1fd aliguori
EOF
1156 da93a1fd aliguori
1157 da93a1fd aliguori
rt=no
1158 8c7f7574 balrog
if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1159 da93a1fd aliguori
  :
1160 8c7f7574 balrog
elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
1161 da93a1fd aliguori
  rt=yes
1162 da93a1fd aliguori
fi
1163 da93a1fd aliguori
1164 da93a1fd aliguori
if test "$rt" = "yes" ; then
1165 da93a1fd aliguori
  # Hack, we should have a general purpose LIBS for this sort of thing
1166 da93a1fd aliguori
  AIOLIBS="$AIOLIBS -lrt"
1167 da93a1fd aliguori
fi
1168 da93a1fd aliguori
1169 11d9f695 bellard
if test "$mingw32" = "yes" ; then
1170 308c3593 pbrook
  if test -z "$prefix" ; then
1171 17e90973 aliguori
      prefix="c:\\\\Program Files\\\\Qemu"
1172 308c3593 pbrook
  fi
1173 308c3593 pbrook
  mansuffix=""
1174 308c3593 pbrook
  datasuffix=""
1175 308c3593 pbrook
  docsuffix=""
1176 308c3593 pbrook
  binsuffix=""
1177 11d9f695 bellard
else
1178 308c3593 pbrook
  if test -z "$prefix" ; then
1179 308c3593 pbrook
      prefix="/usr/local"
1180 308c3593 pbrook
  fi
1181 308c3593 pbrook
  mansuffix="/share/man"
1182 308c3593 pbrook
  datasuffix="/share/qemu"
1183 308c3593 pbrook
  docsuffix="/share/doc/qemu"
1184 308c3593 pbrook
  binsuffix="/bin"
1185 11d9f695 bellard
fi
1186 5a67135a bellard
1187 43ce4dfe bellard
echo "Install prefix    $prefix"
1188 308c3593 pbrook
echo "BIOS directory    $prefix$datasuffix"
1189 308c3593 pbrook
echo "binary directory  $prefix$binsuffix"
1190 11d9f695 bellard
if test "$mingw32" = "no" ; then
1191 308c3593 pbrook
echo "Manual directory  $prefix$mansuffix"
1192 43ce4dfe bellard
echo "ELF interp prefix $interp_prefix"
1193 11d9f695 bellard
fi
1194 5a67135a bellard
echo "Source path       $source_path"
1195 43ce4dfe bellard
echo "C compiler        $cc"
1196 83469015 bellard
echo "Host C compiler   $host_cc"
1197 db7287ed pbrook
echo "ARCH_CFLAGS       $ARCH_CFLAGS"
1198 43ce4dfe bellard
echo "make              $make"
1199 6a882643 pbrook
echo "install           $install"
1200 43ce4dfe bellard
echo "host CPU          $cpu"
1201 de83cd02 bellard
echo "host big endian   $bigendian"
1202 97a847bc bellard
echo "target list       $target_list"
1203 43ce4dfe bellard
echo "gprof enabled     $gprof"
1204 03b4fe7d aliguori
echo "sparse enabled    $sparse"
1205 1625af87 aliguori
echo "strip binaries    $strip_opt"
1206 05c2a3e7 bellard
echo "profiler          $profiler"
1207 43ce4dfe bellard
echo "static build      $static"
1208 85aa5189 bellard
echo "-Werror enabled   $werror"
1209 5b0753e0 bellard
if test "$darwin" = "yes" ; then
1210 5b0753e0 bellard
    echo "Cocoa support     $cocoa"
1211 5b0753e0 bellard
fi
1212 97a847bc bellard
echo "SDL support       $sdl"
1213 e4afee97 bellard
if test "$sdl" != "no" ; then
1214 e4afee97 bellard
    echo "SDL static link   $sdl_static"
1215 e4afee97 bellard
fi
1216 4d3b6f6e balrog
echo "curses support    $curses"
1217 67b915a5 bellard
echo "mingw32 support   $mingw32"
1218 0c58ac1c malc
echo "Audio drivers     $audio_drv_list"
1219 0c58ac1c malc
echo "Extra audio cards $audio_card_list"
1220 8ff9cbf7 malc
echo "Mixer emulation   $mixemu"
1221 8d5d2d4c ths
echo "VNC TLS support   $vnc_tls"
1222 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
1223 8d5d2d4c ths
    echo "    TLS CFLAGS    $vnc_tls_cflags"
1224 8d5d2d4c ths
    echo "    TLS LIBS      $vnc_tls_libs"
1225 8d5d2d4c ths
fi
1226 2f9606b3 aliguori
echo "VNC SASL support  $vnc_sasl"
1227 2f9606b3 aliguori
if test "$vnc_sasl" = "yes" ; then
1228 2f9606b3 aliguori
    echo "    SASL CFLAGS    $vnc_sasl_cflags"
1229 2f9606b3 aliguori
    echo "    SASL LIBS      $vnc_sasl_libs"
1230 2f9606b3 aliguori
fi
1231 3142255c blueswir1
if test -n "$sparc_cpu"; then
1232 3142255c blueswir1
    echo "Target Sparc Arch $sparc_cpu"
1233 3142255c blueswir1
fi
1234 07f4ddbf bellard
echo "kqemu support     $kqemu"
1235 2e4d9fb1 aurel32
echo "brlapi support    $brlapi"
1236 cc8ae6de pbrook
echo "Documentation     $build_docs"
1237 c5937220 pbrook
[ ! -z "$uname_release" ] && \
1238 c5937220 pbrook
echo "uname -r          $uname_release"
1239 bd0c5661 pbrook
echo "NPTL support      $nptl"
1240 8a16d273 ths
echo "vde support       $vde"
1241 414f0dab blueswir1
echo "AIO support       $aio"
1242 77755340 ths
echo "Install blobs     $blobs"
1243 7ba1e619 aliguori
echo "KVM support       $kvm"
1244 f652e6af aurel32
echo "fdt support       $fdt"
1245 ceb42de8 aliguori
echo "preadv support    $preadv"
1246 67b915a5 bellard
1247 97a847bc bellard
if test $sdl_too_old = "yes"; then
1248 24b55b96 bellard
echo "-> Your SDL version is too old - please upgrade to have SDL support"
1249 7c1f25b4 bellard
fi
1250 d4742de8 malc
if [ -s $TMPSDLLOG ]; then
1251 20b40c6a ths
  echo "The error log from compiling the libSDL test is: "
1252 d4742de8 malc
  cat $TMPSDLLOG
1253 20b40c6a ths
fi
1254 24b55b96 bellard
#if test "$sdl_static" = "no"; then
1255 24b55b96 bellard
#  echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1256 24b55b96 bellard
#fi
1257 97a847bc bellard
config_mak="config-host.mak"
1258 97a847bc bellard
config_h="config-host.h"
1259 7d13299d bellard
1260 7c1f25b4 bellard
#echo "Creating $config_mak and $config_h"
1261 7d13299d bellard
1262 15d9ca0f ths
test -f $config_h && mv $config_h ${config_h}~
1263 15d9ca0f ths
1264 97a847bc bellard
echo "# Automatically generated by configure - do not modify" > $config_mak
1265 fc9902d9 malc
printf "# Configured with:" >> $config_mak
1266 fd69fe2b malc
printf " '%s'" "$0" "$@" >> $config_mak
1267 fd69fe2b malc
echo >> $config_mak
1268 97a847bc bellard
echo "/* Automatically generated by configure - do not modify */" > $config_h
1269 7d13299d bellard
1270 97a847bc bellard
echo "prefix=$prefix" >> $config_mak
1271 308c3593 pbrook
echo "bindir=\${prefix}$binsuffix" >> $config_mak
1272 308c3593 pbrook
echo "mandir=\${prefix}$mansuffix" >> $config_mak
1273 308c3593 pbrook
echo "datadir=\${prefix}$datasuffix" >> $config_mak
1274 4ad5b06d ths
echo "docdir=\${prefix}$docsuffix" >> $config_mak
1275 308c3593 pbrook
echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
1276 97a847bc bellard
echo "MAKE=$make" >> $config_mak
1277 6a882643 pbrook
echo "INSTALL=$install" >> $config_mak
1278 97a847bc bellard
echo "CC=$cc" >> $config_mak
1279 97a847bc bellard
echo "HOST_CC=$host_cc" >> $config_mak
1280 97a847bc bellard
echo "AR=$ar" >> $config_mak
1281 40293e58 bellard
# XXX: only use CFLAGS and LDFLAGS ?  
1282 40293e58 bellard
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1283 40293e58 bellard
# compilation of dyngen tool (useful for win32 build on Linux host)
1284 6f30fa85 ths
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1285 3142255c blueswir1
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1286 3142255c blueswir1
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1287 3142255c blueswir1
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1288 97a847bc bellard
echo "CFLAGS=$CFLAGS" >> $config_mak
1289 97a847bc bellard
echo "LDFLAGS=$LDFLAGS" >> $config_mak
1290 67b915a5 bellard
echo "EXESUF=$EXESUF" >> $config_mak
1291 70956b77 ths
echo "AIOLIBS=$AIOLIBS" >> $config_mak
1292 2408a527 aurel32
case "$cpu" in
1293 2408a527 aurel32
  i386)
1294 2408a527 aurel32
    echo "ARCH=i386" >> $config_mak
1295 2408a527 aurel32
    echo "#define HOST_I386 1" >> $config_h
1296 2408a527 aurel32
  ;;
1297 2408a527 aurel32
  x86_64)
1298 2408a527 aurel32
    echo "ARCH=x86_64" >> $config_mak
1299 2408a527 aurel32
    echo "#define HOST_X86_64 1" >> $config_h
1300 2408a527 aurel32
  ;;
1301 2408a527 aurel32
  alpha)
1302 2408a527 aurel32
    echo "ARCH=alpha" >> $config_mak
1303 2408a527 aurel32
    echo "#define HOST_ALPHA 1" >> $config_h
1304 2408a527 aurel32
  ;;
1305 2408a527 aurel32
  armv4b)
1306 2408a527 aurel32
    echo "ARCH=arm" >> $config_mak
1307 2408a527 aurel32
    echo "#define HOST_ARM 1" >> $config_h
1308 2408a527 aurel32
  ;;
1309 2408a527 aurel32
  armv4l)
1310 2408a527 aurel32
    echo "ARCH=arm" >> $config_mak
1311 2408a527 aurel32
    echo "#define HOST_ARM 1" >> $config_h
1312 2408a527 aurel32
  ;;
1313 2408a527 aurel32
  cris)
1314 2408a527 aurel32
    echo "ARCH=cris" >> $config_mak
1315 2408a527 aurel32
    echo "#define HOST_CRIS 1" >> $config_h
1316 2408a527 aurel32
  ;;
1317 2408a527 aurel32
  hppa)
1318 2408a527 aurel32
    echo "ARCH=hppa" >> $config_mak
1319 2408a527 aurel32
    echo "#define HOST_HPPA 1" >> $config_h
1320 2408a527 aurel32
  ;;
1321 2408a527 aurel32
  ia64)
1322 2408a527 aurel32
    echo "ARCH=ia64" >> $config_mak
1323 2408a527 aurel32
    echo "#define HOST_IA64 1" >> $config_h
1324 2408a527 aurel32
  ;;
1325 2408a527 aurel32
  m68k)
1326 2408a527 aurel32
    echo "ARCH=m68k" >> $config_mak
1327 2408a527 aurel32
    echo "#define HOST_M68K 1" >> $config_h
1328 2408a527 aurel32
  ;;
1329 2408a527 aurel32
  mips)
1330 2408a527 aurel32
    echo "ARCH=mips" >> $config_mak
1331 2408a527 aurel32
    echo "#define HOST_MIPS 1" >> $config_h
1332 2408a527 aurel32
  ;;
1333 2408a527 aurel32
  mips64)
1334 2408a527 aurel32
    echo "ARCH=mips64" >> $config_mak
1335 2408a527 aurel32
    echo "#define HOST_MIPS64 1" >> $config_h
1336 2408a527 aurel32
  ;;
1337 fdf7ed96 malc
  ppc)
1338 fdf7ed96 malc
    echo "ARCH=ppc" >> $config_mak
1339 fdf7ed96 malc
    echo "#define HOST_PPC 1" >> $config_h
1340 fdf7ed96 malc
  ;;
1341 fdf7ed96 malc
  ppc64)
1342 fdf7ed96 malc
    echo "ARCH=ppc64" >> $config_mak
1343 fdf7ed96 malc
    echo "#define HOST_PPC64 1" >> $config_h
1344 2408a527 aurel32
  ;;
1345 2408a527 aurel32
  s390)
1346 2408a527 aurel32
    echo "ARCH=s390" >> $config_mak
1347 2408a527 aurel32
    echo "#define HOST_S390 1" >> $config_h
1348 2408a527 aurel32
  ;;
1349 2408a527 aurel32
  sparc)
1350 2408a527 aurel32
    echo "ARCH=sparc" >> $config_mak
1351 2408a527 aurel32
    echo "#define HOST_SPARC 1" >> $config_h
1352 2408a527 aurel32
  ;;
1353 2408a527 aurel32
  sparc64)
1354 2408a527 aurel32
    echo "ARCH=sparc64" >> $config_mak
1355 2408a527 aurel32
    echo "#define HOST_SPARC64 1" >> $config_h
1356 2408a527 aurel32
  ;;
1357 2408a527 aurel32
  *)
1358 2408a527 aurel32
    echo "Unsupported CPU = $cpu"
1359 2408a527 aurel32
    exit 1
1360 2408a527 aurel32
  ;;
1361 2408a527 aurel32
esac
1362 03b4fe7d aliguori
if test "$sparse" = "yes" ; then
1363 03b4fe7d aliguori
  echo "CC      := REAL_CC=\"\$(CC)\" cgcc"       >> $config_mak
1364 03b4fe7d aliguori
  echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc"  >> $config_mak
1365 03b4fe7d aliguori
  echo "CFLAGS  += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1366 03b4fe7d aliguori
fi
1367 1625af87 aliguori
if test "$strip_opt" = "yes" ; then
1368 1625af87 aliguori
  echo "STRIP_OPT=-s" >> $config_mak
1369 1625af87 aliguori
fi
1370 7d13299d bellard
if test "$bigendian" = "yes" ; then
1371 97a847bc bellard
  echo "WORDS_BIGENDIAN=yes" >> $config_mak
1372 97a847bc bellard
  echo "#define WORDS_BIGENDIAN 1" >> $config_h
1373 97a847bc bellard
fi
1374 b6853697 bellard
echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1375 67b915a5 bellard
if test "$mingw32" = "yes" ; then
1376 67b915a5 bellard
  echo "CONFIG_WIN32=yes" >> $config_mak
1377 11d9f695 bellard
  echo "#define CONFIG_WIN32 1" >> $config_h
1378 210fa556 pbrook
else
1379 210fa556 pbrook
  cat > $TMPC << EOF
1380 210fa556 pbrook
#include <byteswap.h>
1381 210fa556 pbrook
int main(void) { return bswap_32(0); }
1382 210fa556 pbrook
EOF
1383 178baee6 aurel32
  if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1384 210fa556 pbrook
    echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1385 210fa556 pbrook
  fi
1386 1360677c blueswir1
  cat > $TMPC << EOF
1387 1360677c blueswir1
#include <sys/endian.h>
1388 1360677c blueswir1
#include <sys/types.h>
1389 1360677c blueswir1
#include <machine/bswap.h>
1390 1360677c blueswir1
int main(void) { return bswap32(0); }
1391 1360677c blueswir1
EOF
1392 178baee6 aurel32
  if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
1393 1360677c blueswir1
    echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1394 1360677c blueswir1
  fi
1395 67b915a5 bellard
fi
1396 128ab2ff blueswir1
1397 128ab2ff blueswir1
if [ "$openbsd" = "yes" ] ; then
1398 128ab2ff blueswir1
  echo "#define ENOTSUP 4096" >> $config_h
1399 128ab2ff blueswir1
fi
1400 128ab2ff blueswir1
1401 83fb7adf bellard
if test "$darwin" = "yes" ; then
1402 83fb7adf bellard
  echo "CONFIG_DARWIN=yes" >> $config_mak
1403 83fb7adf bellard
  echo "#define CONFIG_DARWIN 1" >> $config_h
1404 83fb7adf bellard
fi
1405 b29fe3ed malc
1406 b29fe3ed malc
if test "$aix" = "yes" ; then
1407 b29fe3ed malc
  echo "CONFIG_AIX=yes" >> $config_mak
1408 b29fe3ed malc
  echo "#define CONFIG_AIX 1" >> $config_h
1409 b29fe3ed malc
fi
1410 b29fe3ed malc
1411 ec530c81 bellard
if test "$solaris" = "yes" ; then
1412 ec530c81 bellard
  echo "CONFIG_SOLARIS=yes" >> $config_mak
1413 38cfa06c bellard
  echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1414 0475a5ca ths
  if test "$needs_libsunmath" = "yes" ; then
1415 0475a5ca ths
    echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1416 0475a5ca ths
    echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1417 0475a5ca ths
  fi
1418 ec530c81 bellard
fi
1419 3142255c blueswir1
if test -n "$sparc_cpu"; then
1420 3142255c blueswir1
  echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1421 3142255c blueswir1
  echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1422 3142255c blueswir1
fi
1423 67b915a5 bellard
if test "$gdbstub" = "yes" ; then
1424 67b915a5 bellard
  echo "CONFIG_GDBSTUB=yes" >> $config_mak
1425 67b915a5 bellard
  echo "#define CONFIG_GDBSTUB 1" >> $config_h
1426 67b915a5 bellard
fi
1427 97a847bc bellard
if test "$gprof" = "yes" ; then
1428 97a847bc bellard
  echo "TARGET_GPROF=yes" >> $config_mak
1429 97a847bc bellard
  echo "#define HAVE_GPROF 1" >> $config_h
1430 97a847bc bellard
fi
1431 97a847bc bellard
if test "$static" = "yes" ; then
1432 97a847bc bellard
  echo "CONFIG_STATIC=yes" >> $config_mak
1433 50863472 bellard
  echo "#define CONFIG_STATIC 1" >> $config_h
1434 7d13299d bellard
fi
1435 05c2a3e7 bellard
if test $profiler = "yes" ; then
1436 05c2a3e7 bellard
  echo "#define CONFIG_PROFILER 1" >> $config_h
1437 05c2a3e7 bellard
fi
1438 c20709aa bellard
if test "$slirp" = "yes" ; then
1439 c20709aa bellard
  echo "CONFIG_SLIRP=yes" >> $config_mak
1440 c20709aa bellard
  echo "#define CONFIG_SLIRP 1" >> $config_h
1441 c20709aa bellard
fi
1442 8a16d273 ths
if test "$vde" = "yes" ; then
1443 8a16d273 ths
  echo "CONFIG_VDE=yes" >> $config_mak
1444 8a16d273 ths
  echo "#define CONFIG_VDE 1" >> $config_h
1445 8a16d273 ths
  echo "VDE_LIBS=-lvdeplug" >> $config_mak
1446 8a16d273 ths
fi
1447 0c58ac1c malc
for card in $audio_card_list; do
1448 f6e5889e pbrook
    def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1449 0c58ac1c malc
    echo "$def=yes" >> $config_mak
1450 0c58ac1c malc
    echo "#define $def 1" >> $config_h
1451 0c58ac1c malc
done
1452 0c58ac1c malc
echo "#define AUDIO_DRIVERS \\" >> $config_h
1453 0c58ac1c malc
for drv in $audio_drv_list; do
1454 0c58ac1c malc
    echo "    &${drv}_audio_driver, \\" >>$config_h
1455 f6e5889e pbrook
    def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1456 0c58ac1c malc
    echo "$def=yes" >> $config_mak
1457 923e4521 malc
    if test "$drv" = "fmod"; then
1458 0c58ac1c malc
        echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1459 0c58ac1c malc
        echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1460 2f6a1ab0 blueswir1
    elif test "$drv" = "oss"; then
1461 2f6a1ab0 blueswir1
        echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1462 0c58ac1c malc
    fi
1463 0c58ac1c malc
done
1464 0c58ac1c malc
echo "" >>$config_h
1465 8ff9cbf7 malc
if test "$mixemu" = "yes" ; then
1466 8ff9cbf7 malc
  echo "CONFIG_MIXEMU=yes" >> $config_mak
1467 8ff9cbf7 malc
  echo "#define CONFIG_MIXEMU 1" >> $config_h
1468 8ff9cbf7 malc
fi
1469 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
1470 8d5d2d4c ths
  echo "CONFIG_VNC_TLS=yes" >> $config_mak
1471 8d5d2d4c ths
  echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1472 8d5d2d4c ths
  echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1473 8d5d2d4c ths
  echo "#define CONFIG_VNC_TLS 1" >> $config_h
1474 8d5d2d4c ths
fi
1475 2f9606b3 aliguori
if test "$vnc_sasl" = "yes" ; then
1476 2f9606b3 aliguori
  echo "CONFIG_VNC_SASL=yes" >> $config_mak
1477 2f9606b3 aliguori
  echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1478 2f9606b3 aliguori
  echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1479 2f9606b3 aliguori
  echo "#define CONFIG_VNC_SASL 1" >> $config_h
1480 2f9606b3 aliguori
fi
1481 76655d6d aliguori
if test "$fnmatch" = "yes" ; then
1482 76655d6d aliguori
  echo "#define HAVE_FNMATCH_H 1" >> $config_h
1483 76655d6d aliguori
fi
1484 b1a550a0 pbrook
qemu_version=`head $source_path/VERSION`
1485 b1a550a0 pbrook
echo "VERSION=$qemu_version" >>$config_mak
1486 d4b8f039 pbrook
echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1487 97a847bc bellard
1488 4a19f1ec pbrook
echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h
1489 4a19f1ec pbrook
1490 97a847bc bellard
echo "SRC_PATH=$source_path" >> $config_mak
1491 ad064840 pbrook
if [ "$source_path_used" = "yes" ]; then
1492 ad064840 pbrook
  echo "VPATH=$source_path" >> $config_mak
1493 ad064840 pbrook
fi
1494 97a847bc bellard
echo "TARGET_DIRS=$target_list" >> $config_mak
1495 cc8ae6de pbrook
if [ "$build_docs" = "yes" ] ; then
1496 cc8ae6de pbrook
  echo "BUILD_DOCS=yes" >> $config_mak
1497 cc8ae6de pbrook
fi
1498 49ecc3fa bellard
if test "$static" = "yes"; then
1499 49ecc3fa bellard
  sdl1=$sdl_static
1500 49ecc3fa bellard
else
1501 49ecc3fa bellard
  sdl1=$sdl
1502 49ecc3fa bellard
fi
1503 49ecc3fa bellard
if test "$sdl1" = "yes" ; then
1504 49ecc3fa bellard
  echo "#define CONFIG_SDL 1" >> $config_h
1505 49ecc3fa bellard
  echo "CONFIG_SDL=yes" >> $config_mak
1506 49ecc3fa bellard
  if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1507 49ecc3fa bellard
    echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1508 5368a422 aliguori
  elif test "$sdl_x11" = "yes" ; then
1509 5368a422 aliguori
    echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
1510 49ecc3fa bellard
  else
1511 49ecc3fa bellard
    echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1512 49ecc3fa bellard
  fi
1513 49ecc3fa bellard
  if [ "${aa}" = "yes" ] ; then
1514 49ecc3fa bellard
    echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1515 49ecc3fa bellard
  else
1516 49ecc3fa bellard
    echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1517 49ecc3fa bellard
  fi
1518 49ecc3fa bellard
fi
1519 49ecc3fa bellard
if test "$cocoa" = "yes" ; then
1520 4d3b6f6e balrog
  echo "#define CONFIG_COCOA 1" >> $config_h
1521 4d3b6f6e balrog
  echo "CONFIG_COCOA=yes" >> $config_mak
1522 4d3b6f6e balrog
fi
1523 4d3b6f6e balrog
if test "$curses" = "yes" ; then
1524 4d3b6f6e balrog
  echo "#define CONFIG_CURSES 1" >> $config_h
1525 4d3b6f6e balrog
  echo "CONFIG_CURSES=yes" >> $config_mak
1526 4d3b6f6e balrog
  echo "CURSES_LIBS=-lcurses" >> $config_mak
1527 49ecc3fa bellard
fi
1528 2e4d9fb1 aurel32
if test "$brlapi" = "yes" ; then
1529 2e4d9fb1 aurel32
  echo "CONFIG_BRLAPI=yes" >> $config_mak
1530 2e4d9fb1 aurel32
  echo "#define CONFIG_BRLAPI 1" >> $config_h
1531 2e4d9fb1 aurel32
  echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1532 2e4d9fb1 aurel32
fi
1533 fb599c9a balrog
if test "$bluez" = "yes" ; then
1534 fb599c9a balrog
  echo "CONFIG_BLUEZ=yes" >> $config_mak
1535 fb599c9a balrog
  echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1536 fb599c9a balrog
  echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1537 fb599c9a balrog
  echo "#define CONFIG_BLUEZ 1" >> $config_h
1538 fb599c9a balrog
fi
1539 414f0dab blueswir1
if test "$aio" = "yes" ; then
1540 414f0dab blueswir1
  echo "#define CONFIG_AIO 1" >> $config_h
1541 a3392f9b aliguori
  echo "CONFIG_AIO=yes" >> $config_mak
1542 414f0dab blueswir1
fi
1543 77755340 ths
if test "$blobs" = "yes" ; then
1544 77755340 ths
  echo "INSTALL_BLOBS=yes" >> $config_mak
1545 77755340 ths
fi
1546 bf9298b9 aliguori
if test "$iovec" = "yes" ; then
1547 bf9298b9 aliguori
  echo "#define HAVE_IOVEC 1" >> $config_h
1548 bf9298b9 aliguori
fi
1549 ceb42de8 aliguori
if test "$preadv" = "yes" ; then
1550 ceb42de8 aliguori
  echo "#define HAVE_PREADV 1" >> $config_h
1551 ceb42de8 aliguori
fi
1552 f652e6af aurel32
if test "$fdt" = "yes" ; then
1553 f652e6af aurel32
  echo "#define HAVE_FDT 1" >> $config_h
1554 f652e6af aurel32
  echo "FDT_LIBS=-lfdt" >> $config_mak
1555 f652e6af aurel32
fi
1556 97a847bc bellard
1557 83fb7adf bellard
# XXX: suppress that
1558 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
1559 43003046 bellard
  echo "#define O_LARGEFILE 0" >> $config_h
1560 43003046 bellard
  echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1561 179a2c19 blueswir1
  echo "#define HOST_BSD 1" >> $config_h
1562 7d3505c5 bellard
fi
1563 7d3505c5 bellard
1564 c5937220 pbrook
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1565 c5937220 pbrook
1566 68063649 blueswir1
# USB host support
1567 68063649 blueswir1
case "$usb" in
1568 68063649 blueswir1
linux)
1569 68063649 blueswir1
  echo "HOST_USB=linux" >> $config_mak
1570 68063649 blueswir1
;;
1571 68063649 blueswir1
bsd)
1572 68063649 blueswir1
  echo "HOST_USB=bsd" >> $config_mak
1573 68063649 blueswir1
;;
1574 68063649 blueswir1
*)
1575 68063649 blueswir1
  echo "HOST_USB=stub" >> $config_mak
1576 68063649 blueswir1
;;
1577 68063649 blueswir1
esac
1578 68063649 blueswir1
1579 c39e3338 pbrook
tools=
1580 c39e3338 pbrook
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1581 3dd1f8ef aliguori
  tools="qemu-img\$(EXESUF) $tools"
1582 7a5ca864 bellard
  if [ "$linux" = "yes" ] ; then
1583 3dd1f8ef aliguori
      tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
1584 7a5ca864 bellard
  fi
1585 c39e3338 pbrook
fi
1586 c39e3338 pbrook
echo "TOOLS=$tools" >> $config_mak
1587 c39e3338 pbrook
1588 15d9ca0f ths
test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1589 15d9ca0f ths
1590 1d14ffa9 bellard
for target in $target_list; do
1591 97a847bc bellard
target_dir="$target"
1592 97a847bc bellard
config_mak=$target_dir/config.mak
1593 97a847bc bellard
config_h=$target_dir/config.h
1594 97a847bc bellard
target_cpu=`echo $target | cut -d '-' -f 1`
1595 97a847bc bellard
target_bigendian="no"
1596 808c4954 bellard
[ "$target_cpu" = "armeb" ] && target_bigendian=yes
1597 0938cda5 aurel32
[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1598 0938cda5 aurel32
[ "$target_cpu" = "mips" ] && target_bigendian=yes
1599 0938cda5 aurel32
[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1600 0938cda5 aurel32
[ "$target_cpu" = "mips64" ] && target_bigendian=yes
1601 67867308 bellard
[ "$target_cpu" = "ppc" ] && target_bigendian=yes
1602 d4082e95 j_mayer
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1603 22f8a8b3 j_mayer
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1604 e85e7c6e j_mayer
[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1605 908f52b0 pbrook
[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1606 0938cda5 aurel32
[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1607 0938cda5 aurel32
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1608 0938cda5 aurel32
[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1609 97a847bc bellard
target_softmmu="no"
1610 997344f3 bellard
target_user_only="no"
1611 831b7825 ths
target_linux_user="no"
1612 831b7825 ths
target_darwin_user="no"
1613 84778508 blueswir1
target_bsd_user="no"
1614 9e407a85 pbrook
case "$target" in
1615 9e407a85 pbrook
  ${target_cpu}-softmmu)
1616 9e407a85 pbrook
    target_softmmu="yes"
1617 9e407a85 pbrook
    ;;
1618 9e407a85 pbrook
  ${target_cpu}-linux-user)
1619 9e407a85 pbrook
    target_user_only="yes"
1620 9e407a85 pbrook
    target_linux_user="yes"
1621 9e407a85 pbrook
    ;;
1622 9e407a85 pbrook
  ${target_cpu}-darwin-user)
1623 9e407a85 pbrook
    target_user_only="yes"
1624 9e407a85 pbrook
    target_darwin_user="yes"
1625 9e407a85 pbrook
    ;;
1626 84778508 blueswir1
  ${target_cpu}-bsd-user)
1627 84778508 blueswir1
    target_user_only="yes"
1628 84778508 blueswir1
    target_bsd_user="yes"
1629 84778508 blueswir1
    ;;
1630 9e407a85 pbrook
  *)
1631 9e407a85 pbrook
    echo "ERROR: Target '$target' not recognised"
1632 9e407a85 pbrook
    exit 1
1633 9e407a85 pbrook
    ;;
1634 9e407a85 pbrook
esac
1635 831b7825 ths
1636 97ccc689 bellard
if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1637 1d14ffa9 bellard
        -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1638 97ccc689 bellard
    echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1639 9c038506 pbrook
    echo "To build QEMU without graphical output configure with --disable-gfx-check"
1640 4d3b6f6e balrog
    echo "Note that this will disable all output from the virtual graphics card"
1641 4d3b6f6e balrog
    echo "except through VNC or curses."
1642 97ccc689 bellard
    exit 1;
1643 97ccc689 bellard
fi
1644 97ccc689 bellard
1645 7c1f25b4 bellard
#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1646 97a847bc bellard
1647 15d9ca0f ths
test -f $config_h && mv $config_h ${config_h}~
1648 15d9ca0f ths
1649 97a847bc bellard
mkdir -p $target_dir
1650 158142c2 bellard
mkdir -p $target_dir/fpu
1651 57fec1fe bellard
mkdir -p $target_dir/tcg
1652 84778508 blueswir1
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
1653 69de927c bellard
  mkdir -p $target_dir/nwfpe
1654 69de927c bellard
fi
1655 69de927c bellard
1656 ec530c81 bellard
#
1657 ec530c81 bellard
# don't use ln -sf as not all "ln -sf" over write the file/link
1658 ec530c81 bellard
#
1659 ec530c81 bellard
rm -f $target_dir/Makefile
1660 ec530c81 bellard
ln -s $source_path/Makefile.target $target_dir/Makefile
1661 ec530c81 bellard
1662 97a847bc bellard
1663 97a847bc bellard
echo "# Automatically generated by configure - do not modify" > $config_mak
1664 97a847bc bellard
echo "/* Automatically generated by configure - do not modify */" > $config_h
1665 97a847bc bellard
1666 de83cd02 bellard
1667 97a847bc bellard
echo "include ../config-host.mak" >> $config_mak
1668 97a847bc bellard
echo "#include \"../config-host.h\"" >> $config_h
1669 1e43adfc bellard
1670 e5fe0c52 pbrook
bflt="no"
1671 cb33da57 blueswir1
elfload32="no"
1672 bd0c5661 pbrook
target_nptl="no"
1673 1e43adfc bellard
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1674 1e43adfc bellard
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1675 56aebc89 pbrook
gdb_xml_files=""
1676 97a847bc bellard
1677 5985ecee aliguori
# Make sure the target and host cpus are compatible
1678 5985ecee aliguori
if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1679 fdf7ed96 malc
  \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
1680 5985ecee aliguori
  \( "$target_cpu" = "x86_64" -a "$cpu" = "i386"   \) -o \
1681 5985ecee aliguori
  \( "$target_cpu" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
1682 7ba1e619 aliguori
  kvm="no"
1683 7ba1e619 aliguori
fi
1684 7ba1e619 aliguori
# Disable KVM for linux-user
1685 7ba1e619 aliguori
if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1686 7ba1e619 aliguori
  kvm="no"
1687 7ba1e619 aliguori
fi
1688 7ba1e619 aliguori
1689 2408a527 aurel32
case "$target_cpu" in
1690 2408a527 aurel32
  i386)
1691 2408a527 aurel32
    echo "TARGET_ARCH=i386" >> $config_mak
1692 2408a527 aurel32
    echo "#define TARGET_ARCH \"i386\"" >> $config_h
1693 2408a527 aurel32
    echo "#define TARGET_I386 1" >> $config_h
1694 da260249 bellard
    if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1695 2408a527 aurel32
    then
1696 2408a527 aurel32
      echo "#define USE_KQEMU 1" >> $config_h
1697 2408a527 aurel32
    fi
1698 7ba1e619 aliguori
    if test "$kvm" = "yes" ; then
1699 7ba1e619 aliguori
      echo "CONFIG_KVM=yes" >> $config_mak
1700 7ba1e619 aliguori
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1701 5985ecee aliguori
      echo "#define CONFIG_KVM 1" >> $config_h
1702 7ba1e619 aliguori
    fi
1703 2408a527 aurel32
  ;;
1704 2408a527 aurel32
  x86_64)
1705 2408a527 aurel32
    echo "TARGET_ARCH=x86_64" >> $config_mak
1706 2408a527 aurel32
    echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1707 2408a527 aurel32
    echo "#define TARGET_I386 1" >> $config_h
1708 2408a527 aurel32
    echo "#define TARGET_X86_64 1" >> $config_h
1709 2408a527 aurel32
    if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1710 2408a527 aurel32
    then
1711 2408a527 aurel32
      echo "#define USE_KQEMU 1" >> $config_h
1712 2408a527 aurel32
    fi
1713 7ba1e619 aliguori
    if test "$kvm" = "yes" ; then
1714 7ba1e619 aliguori
      echo "CONFIG_KVM=yes" >> $config_mak
1715 7ba1e619 aliguori
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1716 7ba1e619 aliguori
      echo "#define CONFIG_KVM 1" >> $config_h
1717 7ba1e619 aliguori
    fi
1718 2408a527 aurel32
  ;;
1719 2408a527 aurel32
  alpha)
1720 2408a527 aurel32
    echo "TARGET_ARCH=alpha" >> $config_mak
1721 2408a527 aurel32
    echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1722 2408a527 aurel32
    echo "#define TARGET_ALPHA 1" >> $config_h
1723 2408a527 aurel32
  ;;
1724 2408a527 aurel32
  arm|armeb)
1725 2408a527 aurel32
    echo "TARGET_ARCH=arm" >> $config_mak
1726 2408a527 aurel32
    echo "#define TARGET_ARCH \"arm\"" >> $config_h
1727 2408a527 aurel32
    echo "#define TARGET_ARM 1" >> $config_h
1728 2408a527 aurel32
    bflt="yes"
1729 bd0c5661 pbrook
    target_nptl="yes"
1730 56aebc89 pbrook
    gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
1731 2408a527 aurel32
  ;;
1732 2408a527 aurel32
  cris)
1733 2408a527 aurel32
    echo "TARGET_ARCH=cris" >> $config_mak
1734 2408a527 aurel32
    echo "#define TARGET_ARCH \"cris\"" >> $config_h
1735 2408a527 aurel32
    echo "#define TARGET_CRIS 1" >> $config_h
1736 253bd7f8 edgar_igl
    target_nptl="yes"
1737 2408a527 aurel32
  ;;
1738 2408a527 aurel32
  m68k)
1739 2408a527 aurel32
    echo "TARGET_ARCH=m68k" >> $config_mak
1740 2408a527 aurel32
    echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1741 2408a527 aurel32
    echo "#define TARGET_M68K 1" >> $config_h
1742 2408a527 aurel32
    bflt="yes"
1743 56aebc89 pbrook
    gdb_xml_files="cf-core.xml cf-fp.xml"
1744 2408a527 aurel32
  ;;
1745 2408a527 aurel32
  mips|mipsel)
1746 2408a527 aurel32
    echo "TARGET_ARCH=mips" >> $config_mak
1747 2408a527 aurel32
    echo "#define TARGET_ARCH \"mips\"" >> $config_h
1748 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1749 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1750 2408a527 aurel32
  ;;
1751 2408a527 aurel32
  mipsn32|mipsn32el)
1752 2408a527 aurel32
    echo "TARGET_ARCH=mipsn32" >> $config_mak
1753 2408a527 aurel32
    echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1754 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1755 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1756 2408a527 aurel32
  ;;
1757 2408a527 aurel32
  mips64|mips64el)
1758 2408a527 aurel32
    echo "TARGET_ARCH=mips64" >> $config_mak
1759 2408a527 aurel32
    echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1760 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1761 2408a527 aurel32
    echo "#define TARGET_MIPS64 1" >> $config_h
1762 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1763 2408a527 aurel32
  ;;
1764 2408a527 aurel32
  ppc)
1765 2408a527 aurel32
    echo "TARGET_ARCH=ppc" >> $config_mak
1766 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1767 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1768 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1769 2408a527 aurel32
  ;;
1770 2408a527 aurel32
  ppcemb)
1771 2408a527 aurel32
    echo "TARGET_ARCH=ppcemb" >> $config_mak
1772 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1773 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1774 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1775 2408a527 aurel32
    echo "#define TARGET_PPCEMB 1" >> $config_h
1776 d76d1650 aurel32
    if test "$kvm" = "yes" ; then
1777 d76d1650 aurel32
      echo "CONFIG_KVM=yes" >> $config_mak
1778 d76d1650 aurel32
      echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1779 d76d1650 aurel32
      echo "#define CONFIG_KVM 1" >> $config_h
1780 d76d1650 aurel32
    fi
1781 c8b3532d aurel32
    gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1782 2408a527 aurel32
  ;;
1783 2408a527 aurel32
  ppc64)
1784 2408a527 aurel32
    echo "TARGET_ARCH=ppc64" >> $config_mak
1785 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1786 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1787 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1788 2408a527 aurel32
    echo "#define TARGET_PPC64 1" >> $config_h
1789 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1790 2408a527 aurel32
  ;;
1791 2408a527 aurel32
  ppc64abi32)
1792 2408a527 aurel32
    echo "TARGET_ARCH=ppc64" >> $config_mak
1793 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1794 2408a527 aurel32
    echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1795 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1796 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1797 2408a527 aurel32
    echo "#define TARGET_PPC64 1" >> $config_h
1798 2408a527 aurel32
    echo "#define TARGET_ABI32 1" >> $config_h
1799 c8b3532d aurel32
    gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
1800 2408a527 aurel32
  ;;
1801 2408a527 aurel32
  sh4|sh4eb)
1802 2408a527 aurel32
    echo "TARGET_ARCH=sh4" >> $config_mak
1803 2408a527 aurel32
    echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1804 2408a527 aurel32
    echo "#define TARGET_SH4 1" >> $config_h
1805 2408a527 aurel32
    bflt="yes"
1806 0b6d3ae0 aurel32
    target_nptl="yes"
1807 2408a527 aurel32
  ;;
1808 2408a527 aurel32
  sparc)
1809 2408a527 aurel32
    echo "TARGET_ARCH=sparc" >> $config_mak
1810 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1811 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1812 2408a527 aurel32
  ;;
1813 2408a527 aurel32
  sparc64)
1814 2408a527 aurel32
    echo "TARGET_ARCH=sparc64" >> $config_mak
1815 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1816 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1817 2408a527 aurel32
    echo "#define TARGET_SPARC64 1" >> $config_h
1818 2408a527 aurel32
    elfload32="yes"
1819 2408a527 aurel32
  ;;
1820 2408a527 aurel32
  sparc32plus)
1821 2408a527 aurel32
    echo "TARGET_ARCH=sparc64" >> $config_mak
1822 2408a527 aurel32
    echo "TARGET_ABI_DIR=sparc" >> $config_mak
1823 2408a527 aurel32
    echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1824 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1825 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1826 2408a527 aurel32
    echo "#define TARGET_SPARC64 1" >> $config_h
1827 2408a527 aurel32
    echo "#define TARGET_ABI32 1" >> $config_h
1828 2408a527 aurel32
  ;;
1829 2408a527 aurel32
  *)
1830 2408a527 aurel32
    echo "Unsupported target CPU"
1831 2408a527 aurel32
    exit 1
1832 2408a527 aurel32
  ;;
1833 2408a527 aurel32
esac
1834 de83cd02 bellard
if test "$target_bigendian" = "yes" ; then
1835 97a847bc bellard
  echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1836 97a847bc bellard
  echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1837 de83cd02 bellard
fi
1838 97a847bc bellard
if test "$target_softmmu" = "yes" ; then
1839 97a847bc bellard
  echo "CONFIG_SOFTMMU=yes" >> $config_mak
1840 97a847bc bellard
  echo "#define CONFIG_SOFTMMU 1" >> $config_h
1841 43ce4dfe bellard
fi
1842 997344f3 bellard
if test "$target_user_only" = "yes" ; then
1843 997344f3 bellard
  echo "CONFIG_USER_ONLY=yes" >> $config_mak
1844 997344f3 bellard
  echo "#define CONFIG_USER_ONLY 1" >> $config_h
1845 997344f3 bellard
fi
1846 831b7825 ths
if test "$target_linux_user" = "yes" ; then
1847 831b7825 ths
  echo "CONFIG_LINUX_USER=yes" >> $config_mak
1848 831b7825 ths
  echo "#define CONFIG_LINUX_USER 1" >> $config_h
1849 831b7825 ths
fi
1850 831b7825 ths
if test "$target_darwin_user" = "yes" ; then
1851 831b7825 ths
  echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1852 831b7825 ths
  echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1853 831b7825 ths
fi
1854 56aebc89 pbrook
list=""
1855 56aebc89 pbrook
if test ! -z "$gdb_xml_files" ; then
1856 56aebc89 pbrook
  for x in $gdb_xml_files; do
1857 56aebc89 pbrook
    list="$list $source_path/gdb-xml/$x"
1858 56aebc89 pbrook
  done
1859 56aebc89 pbrook
fi
1860 56aebc89 pbrook
echo "TARGET_XML_FILES=$list" >> $config_mak
1861 97a847bc bellard
1862 0938cda5 aurel32
if test "$target_cpu" = "arm" \
1863 0938cda5 aurel32
     -o "$target_cpu" = "armeb" \
1864 0938cda5 aurel32
     -o "$target_cpu" = "m68k" \
1865 0938cda5 aurel32
     -o "$target_cpu" = "mips" \
1866 0938cda5 aurel32
     -o "$target_cpu" = "mipsel" \
1867 0938cda5 aurel32
     -o "$target_cpu" = "mipsn32" \
1868 0938cda5 aurel32
     -o "$target_cpu" = "mipsn32el" \
1869 0938cda5 aurel32
     -o "$target_cpu" = "mips64" \
1870 0938cda5 aurel32
     -o "$target_cpu" = "mips64el" \
1871 3147d1e8 aurel32
     -o "$target_cpu" = "ppc" \
1872 3147d1e8 aurel32
     -o "$target_cpu" = "ppc64" \
1873 71e991fd aurel32
     -o "$target_cpu" = "ppc64abi32" \
1874 71e991fd aurel32
     -o "$target_cpu" = "ppcemb" \
1875 0938cda5 aurel32
     -o "$target_cpu" = "sparc" \
1876 0938cda5 aurel32
     -o "$target_cpu" = "sparc64" \
1877 0938cda5 aurel32
     -o "$target_cpu" = "sparc32plus"; then
1878 158142c2 bellard
  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1879 158142c2 bellard
  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1880 158142c2 bellard
fi
1881 e5fe0c52 pbrook
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1882 e5fe0c52 pbrook
  echo "TARGET_HAS_BFLT=yes" >> $config_mak
1883 e5fe0c52 pbrook
  echo "#define TARGET_HAS_BFLT 1" >> $config_h
1884 e5fe0c52 pbrook
fi
1885 bd0c5661 pbrook
if test "$target_user_only" = "yes" \
1886 bd0c5661 pbrook
        -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1887 bd0c5661 pbrook
  echo "#define USE_NPTL 1" >> $config_h
1888 bd0c5661 pbrook
fi
1889 cb33da57 blueswir1
# 32 bit ELF loader in addition to native 64 bit loader?
1890 cb33da57 blueswir1
if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1891 cb33da57 blueswir1
  echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1892 cb33da57 blueswir1
  echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1893 cb33da57 blueswir1
fi
1894 84778508 blueswir1
if test "$target_bsd_user" = "yes" ; then
1895 84778508 blueswir1
  echo "CONFIG_BSD_USER=yes" >> $config_mak
1896 84778508 blueswir1
  echo "#define CONFIG_BSD_USER 1" >> $config_h
1897 84778508 blueswir1
fi
1898 5b0753e0 bellard
1899 15d9ca0f ths
test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1900 15d9ca0f ths
1901 97a847bc bellard
done # for target in $targets
1902 7d13299d bellard
1903 7d13299d bellard
# build tree in object directory if source path is different from current one
1904 7d13299d bellard
if test "$source_path_used" = "yes" ; then
1905 49ecc3fa bellard
    DIRS="tests tests/cris slirp audio"
1906 7d13299d bellard
    FILES="Makefile tests/Makefile"
1907 e7daa605 ths
    FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1908 e1ffb0f1 edgar_igl
    FILES="$FILES tests/test-mmap.c"
1909 7d13299d bellard
    for dir in $DIRS ; do
1910 7d13299d bellard
            mkdir -p $dir
1911 7d13299d bellard
    done
1912 ec530c81 bellard
    # remove the link and recreate it, as not all "ln -sf" overwrite the link
1913 7d13299d bellard
    for f in $FILES ; do
1914 ec530c81 bellard
        rm -f $f
1915 ec530c81 bellard
        ln -s $source_path/$f $f
1916 7d13299d bellard
    done
1917 7d13299d bellard
fi