Statistics
| Branch: | Revision:

root / configure @ 79d342dc

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