Statistics
| Branch: | Revision:

root / configure @ 2ada0ed7

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