Statistics
| Branch: | Revision:

root / configure @ ac41a620

History | View | Annotate | Download (41.6 kB)

1 7d13299d bellard
#!/bin/sh
2 7d13299d bellard
#
3 3ef693a0 bellard
# qemu configure script (c) 2003 Fabrice Bellard
4 7d13299d bellard
#
5 7d13299d bellard
# set temporary file name
6 7d13299d bellard
if test ! -z "$TMPDIR" ; then
7 7d13299d bellard
    TMPDIR1="${TMPDIR}"
8 7d13299d bellard
elif test ! -z "$TEMPDIR" ; then
9 7d13299d bellard
    TMPDIR1="${TEMPDIR}"
10 7d13299d bellard
else
11 7d13299d bellard
    TMPDIR1="/tmp"
12 7d13299d bellard
fi
13 7d13299d bellard
14 3ef693a0 bellard
TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15 3ef693a0 bellard
TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16 3ef693a0 bellard
TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17 3ef693a0 bellard
TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
18 7d13299d bellard
19 7d13299d bellard
# default parameters
20 11d9f695 bellard
prefix=""
21 1e43adfc bellard
interp_prefix="/usr/gnemul/qemu-%M"
22 43ce4dfe bellard
static="no"
23 7d13299d bellard
cross_prefix=""
24 7d13299d bellard
cc="gcc"
25 328a4240 pbrook
gcc3_search="yes"
26 fe8f78e4 balrog
gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
27 0c58ac1c malc
audio_drv_list=""
28 0c58ac1c malc
audio_card_list=""
29 7d13299d bellard
host_cc="gcc"
30 7d13299d bellard
ar="ar"
31 7d13299d bellard
make="make"
32 6a882643 pbrook
install="install"
33 7d13299d bellard
strip="strip"
34 7d13299d bellard
cpu=`uname -m`
35 5327cf48 bellard
target_list=""
36 7d13299d bellard
case "$cpu" in
37 7d13299d bellard
  i386|i486|i586|i686|i86pc|BePC)
38 97a847bc bellard
    cpu="i386"
39 7d13299d bellard
  ;;
40 aaa5fa14 aurel32
  x86_64|amd64)
41 aaa5fa14 aurel32
    cpu="x86_64"
42 aaa5fa14 aurel32
  ;;
43 aaa5fa14 aurel32
  alpha)
44 aaa5fa14 aurel32
    cpu="alpha"
45 aaa5fa14 aurel32
  ;;
46 ba68055e bellard
  armv*b)
47 808c4954 bellard
    cpu="armv4b"
48 808c4954 bellard
  ;;
49 ba68055e bellard
  armv*l)
50 7d13299d bellard
    cpu="armv4l"
51 7d13299d bellard
  ;;
52 aaa5fa14 aurel32
  cris)
53 aaa5fa14 aurel32
    cpu="cris"
54 7d13299d bellard
  ;;
55 f54b3f92 aurel32
  parisc|parisc64)
56 f54b3f92 aurel32
    cpu="hppa"
57 f54b3f92 aurel32
  ;;
58 aaa5fa14 aurel32
  ia64)
59 aaa5fa14 aurel32
    cpu="ia64"
60 aaa5fa14 aurel32
  ;;
61 aaa5fa14 aurel32
  m68k)
62 aaa5fa14 aurel32
    cpu="m68k"
63 7d13299d bellard
  ;;
64 7d13299d bellard
  mips)
65 7d13299d bellard
    cpu="mips"
66 7d13299d bellard
  ;;
67 fbe4f65b ths
  mips64)
68 fbe4f65b ths
    cpu="mips64"
69 fbe4f65b ths
  ;;
70 aaa5fa14 aurel32
  "Power Macintosh"|ppc|ppc64)
71 aaa5fa14 aurel32
    cpu="powerpc"
72 e7daa605 ths
  ;;
73 0e7b8a9f ths
  s390*)
74 fb3e5849 bellard
    cpu="s390"
75 fb3e5849 bellard
  ;;
76 3142255c blueswir1
  sparc|sun4[cdmuv])
77 ae228531 bellard
    cpu="sparc"
78 ae228531 bellard
  ;;
79 ae228531 bellard
  sparc64)
80 ae228531 bellard
    cpu="sparc64"
81 ae228531 bellard
  ;;
82 7d13299d bellard
  *)
83 7d13299d bellard
    cpu="unknown"
84 7d13299d bellard
  ;;
85 7d13299d bellard
esac
86 7d13299d bellard
gprof="no"
87 7d13299d bellard
bigendian="no"
88 67b915a5 bellard
mingw32="no"
89 67b915a5 bellard
EXESUF=""
90 67b915a5 bellard
gdbstub="yes"
91 443f1376 bellard
slirp="yes"
92 e0e6c8c0 aliguori
vde="yes"
93 102a52e4 bellard
fmod_lib=""
94 102a52e4 bellard
fmod_inc=""
95 2f6a1ab0 blueswir1
oss_lib=""
96 8d5d2d4c ths
vnc_tls="yes"
97 b1a550a0 pbrook
bsd="no"
98 5327cf48 bellard
linux="no"
99 c9ec1fe4 bellard
kqemu="no"
100 05c2a3e7 bellard
profiler="no"
101 5b0753e0 bellard
cocoa="no"
102 97ccc689 bellard
check_gfx="yes"
103 1aff381f bellard
check_gcc="yes"
104 0a8e90f4 pbrook
softmmu="yes"
105 831b7825 ths
linux_user="no"
106 831b7825 ths
darwin_user="no"
107 cc8ae6de pbrook
build_docs="no"
108 c5937220 pbrook
uname_release=""
109 4d3b6f6e balrog
curses="yes"
110 414f0dab blueswir1
aio="yes"
111 bd0c5661 pbrook
nptl="yes"
112 8ff9cbf7 malc
mixemu="no"
113 7d13299d bellard
114 7d13299d bellard
# OS specific
115 7d13299d bellard
targetos=`uname -s`
116 7d13299d bellard
case $targetos in
117 c326e0af bellard
CYGWIN*)
118 c326e0af bellard
mingw32="yes"
119 6f30fa85 ths
OS_CFLAGS="-mno-cygwin"
120 db8d7dd1 ths
if [ "$cpu" = "i386" ] ; then
121 db8d7dd1 ths
    kqemu="yes"
122 db8d7dd1 ths
fi
123 c2de5c91 malc
audio_possible_drivers="sdl"
124 c326e0af bellard
;;
125 67b915a5 bellard
MINGW32*)
126 67b915a5 bellard
mingw32="yes"
127 db8d7dd1 ths
if [ "$cpu" = "i386" ] ; then
128 db8d7dd1 ths
    kqemu="yes"
129 db8d7dd1 ths
fi
130 c2de5c91 malc
audio_possible_drivers="dsound sdl fmod"
131 67b915a5 bellard
;;
132 5c40d2bd ths
GNU/kFreeBSD)
133 0c58ac1c malc
audio_drv_list="oss"
134 f34af52c aurel32
audio_possible_drivers="oss sdl esd pa"
135 5c40d2bd ths
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
136 5c40d2bd ths
    kqemu="yes"
137 5c40d2bd ths
fi
138 5c40d2bd ths
;;
139 7d3505c5 bellard
FreeBSD)
140 7d3505c5 bellard
bsd="yes"
141 0c58ac1c malc
audio_drv_list="oss"
142 f34af52c aurel32
audio_possible_drivers="oss sdl esd pa"
143 e99f9060 bellard
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
144 07f4ddbf bellard
    kqemu="yes"
145 07f4ddbf bellard
fi
146 7d3505c5 bellard
;;
147 7d3505c5 bellard
NetBSD)
148 7d3505c5 bellard
bsd="yes"
149 0c58ac1c malc
audio_drv_list="oss"
150 c2de5c91 malc
audio_possible_drivers="oss sdl esd"
151 7d3505c5 bellard
;;
152 7d3505c5 bellard
OpenBSD)
153 7d3505c5 bellard
bsd="yes"
154 128ab2ff blueswir1
openbsd="yes"
155 0c58ac1c malc
audio_drv_list="oss"
156 c2de5c91 malc
audio_possible_drivers="oss sdl esd"
157 2f6a1ab0 blueswir1
oss_lib="-lossaudio"
158 7d3505c5 bellard
;;
159 83fb7adf bellard
Darwin)
160 83fb7adf bellard
bsd="yes"
161 83fb7adf bellard
darwin="yes"
162 831b7825 ths
darwin_user="yes"
163 fd677642 ths
cocoa="yes"
164 0c58ac1c malc
audio_drv_list="coreaudio"
165 c2de5c91 malc
audio_possible_drivers="coreaudio sdl fmod"
166 6f30fa85 ths
OS_CFLAGS="-mdynamic-no-pic"
167 c2c59c3e ths
OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
168 83fb7adf bellard
;;
169 ec530c81 bellard
SunOS)
170 c2b84fab ths
    solaris="yes"
171 c2b84fab ths
    make="gmake"
172 c2b84fab ths
    install="ginstall"
173 0475a5ca ths
    needs_libsunmath="no"
174 c2b84fab ths
    solarisrev=`uname -r | cut -f2 -d.`
175 ef18c883 ths
    # have to select again, because `uname -m` returns i86pc
176 ef18c883 ths
    # even on an x86_64 box.
177 ef18c883 ths
    solariscpu=`isainfo -k`
178 ef18c883 ths
    if test "${solariscpu}" = "amd64" ; then
179 ef18c883 ths
        cpu="x86_64"
180 ef18c883 ths
    fi
181 c2b84fab ths
    if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
182 0475a5ca ths
        if test "$solarisrev" -le 9 ; then
183 0475a5ca ths
            if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
184 0475a5ca ths
                needs_libsunmath="yes"
185 0475a5ca ths
            else
186 0475a5ca ths
                echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
187 0475a5ca ths
                echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
188 0475a5ca ths
                echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
189 0475a5ca ths
                echo "Studio 11 can be downloaded from www.sun.com."
190 0475a5ca ths
                exit 1
191 0475a5ca ths
            fi
192 0475a5ca ths
        fi
193 0475a5ca ths
        if test "$solarisrev" -ge 9 ; then
194 c2b84fab ths
            kqemu="yes"
195 c2b84fab ths
        fi
196 86b2bd93 ths
    fi
197 6b4d2ba1 ths
    if test -f /usr/include/sys/soundcard.h ; then
198 0c58ac1c malc
        audio_drv_list="oss"
199 6b4d2ba1 ths
    fi
200 c2de5c91 malc
    audio_possible_drivers="oss sdl"
201 86b2bd93 ths
;;
202 1d14ffa9 bellard
*)
203 0c58ac1c malc
audio_drv_list="oss"
204 b8e59f18 malc
audio_possible_drivers="oss alsa sdl esd pa"
205 5327cf48 bellard
linux="yes"
206 831b7825 ths
linux_user="yes"
207 07f4ddbf bellard
if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
208 c9ec1fe4 bellard
    kqemu="yes"
209 c2de5c91 malc
    audio_possible_drivers="$audio_possible_drivers fmod"
210 c9ec1fe4 bellard
fi
211 fb065187 bellard
;;
212 7d13299d bellard
esac
213 7d13299d bellard
214 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
215 b1a550a0 pbrook
  if [ "$darwin" != "yes" ] ; then
216 83fb7adf bellard
    make="gmake"
217 83fb7adf bellard
  fi
218 7d3505c5 bellard
fi
219 7d3505c5 bellard
220 7d13299d bellard
# find source path
221 ad064840 pbrook
source_path=`dirname "$0"`
222 59faef3a balrog
source_path_used="no"
223 59faef3a balrog
workdir=`pwd`
224 ad064840 pbrook
if [ -z "$source_path" ]; then
225 59faef3a balrog
    source_path=$workdir
226 ad064840 pbrook
else
227 ad064840 pbrook
    source_path=`cd "$source_path"; pwd`
228 7d13299d bellard
fi
229 724db118 pbrook
[ -f "$workdir/vl.c" ] || source_path_used="yes"
230 7d13299d bellard
231 85aa5189 bellard
werror="no"
232 0d1e2394 bellard
# generate compile errors on warnings for development builds
233 0d1e2394 bellard
#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
234 0d1e2394 bellard
#werror="yes";
235 0d1e2394 bellard
#fi
236 85aa5189 bellard
237 7d13299d bellard
for opt do
238 a46e4035 pbrook
  optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
239 7d13299d bellard
  case "$opt" in
240 2efc3265 bellard
  --help|-h) show_help=yes
241 2efc3265 bellard
  ;;
242 b1a550a0 pbrook
  --prefix=*) prefix="$optarg"
243 7d13299d bellard
  ;;
244 b1a550a0 pbrook
  --interp-prefix=*) interp_prefix="$optarg"
245 32ce6337 bellard
  ;;
246 b1a550a0 pbrook
  --source-path=*) source_path="$optarg"
247 ad064840 pbrook
  source_path_used="yes"
248 7d13299d bellard
  ;;
249 b1a550a0 pbrook
  --cross-prefix=*) cross_prefix="$optarg"
250 7d13299d bellard
  ;;
251 b1a550a0 pbrook
  --cc=*) cc="$optarg"
252 328a4240 pbrook
  gcc3_search="no"
253 7d13299d bellard
  ;;
254 b1a550a0 pbrook
  --host-cc=*) host_cc="$optarg"
255 83469015 bellard
  ;;
256 b1a550a0 pbrook
  --make=*) make="$optarg"
257 7d13299d bellard
  ;;
258 6a882643 pbrook
  --install=*) install="$optarg"
259 6a882643 pbrook
  ;;
260 b1a550a0 pbrook
  --extra-cflags=*) CFLAGS="$optarg"
261 7d13299d bellard
  ;;
262 b1a550a0 pbrook
  --extra-ldflags=*) LDFLAGS="$optarg"
263 7d13299d bellard
  ;;
264 b1a550a0 pbrook
  --cpu=*) cpu="$optarg"
265 7d13299d bellard
  ;;
266 b1a550a0 pbrook
  --target-list=*) target_list="$optarg"
267 de83cd02 bellard
  ;;
268 7d13299d bellard
  --enable-gprof) gprof="yes"
269 7d13299d bellard
  ;;
270 43ce4dfe bellard
  --static) static="yes"
271 43ce4dfe bellard
  ;;
272 97a847bc bellard
  --disable-sdl) sdl="no"
273 97a847bc bellard
  ;;
274 0c58ac1c malc
  --fmod-lib=*) fmod_lib="$optarg"
275 1d14ffa9 bellard
  ;;
276 c2de5c91 malc
  --fmod-inc=*) fmod_inc="$optarg"
277 c2de5c91 malc
  ;;
278 2f6a1ab0 blueswir1
  --oss-lib=*) oss_lib="$optarg"
279 2f6a1ab0 blueswir1
  ;;
280 2fa7d3bf malc
  --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
281 102a52e4 bellard
  ;;
282 0c58ac1c malc
  --audio-drv-list=*) audio_drv_list="$optarg"
283 102a52e4 bellard
  ;;
284 8d5d2d4c ths
  --disable-vnc-tls) vnc_tls="no"
285 8d5d2d4c ths
  ;;
286 443f1376 bellard
  --disable-slirp) slirp="no"
287 1d14ffa9 bellard
  ;;
288 e0e6c8c0 aliguori
  --disable-vde) vde="no"
289 8a16d273 ths
  ;;
290 c9ec1fe4 bellard
  --disable-kqemu) kqemu="no"
291 1d14ffa9 bellard
  ;;
292 2e4d9fb1 aurel32
  --disable-brlapi) brlapi="no"
293 2e4d9fb1 aurel32
  ;;
294 05c2a3e7 bellard
  --enable-profiler) profiler="yes"
295 05c2a3e7 bellard
  ;;
296 c2de5c91 malc
  --enable-cocoa)
297 c2de5c91 malc
      cocoa="yes" ;
298 c2de5c91 malc
      sdl="no" ;
299 c2de5c91 malc
      audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
300 1d14ffa9 bellard
  ;;
301 97ccc689 bellard
  --disable-gfx-check) check_gfx="no"
302 97ccc689 bellard
  ;;
303 1aff381f bellard
  --disable-gcc-check) check_gcc="no"
304 1aff381f bellard
  ;;
305 cad25d69 pbrook
  --disable-system) softmmu="no"
306 0a8e90f4 pbrook
  ;;
307 cad25d69 pbrook
  --enable-system) softmmu="yes"
308 0a8e90f4 pbrook
  ;;
309 831b7825 ths
  --disable-linux-user) linux_user="no"
310 0a8e90f4 pbrook
  ;;
311 831b7825 ths
  --enable-linux-user) linux_user="yes"
312 831b7825 ths
  ;;
313 831b7825 ths
  --disable-darwin-user) darwin_user="no"
314 831b7825 ths
  ;;
315 831b7825 ths
  --enable-darwin-user) darwin_user="yes"
316 0a8e90f4 pbrook
  ;;
317 c5937220 pbrook
  --enable-uname-release=*) uname_release="$optarg"
318 c5937220 pbrook
  ;;
319 3142255c blueswir1
  --sparc_cpu=*)
320 3142255c blueswir1
      sparc_cpu="$optarg"
321 3142255c blueswir1
      case $sparc_cpu in
322 3142255c blueswir1
        v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
323 3142255c blueswir1
                 target_cpu="sparc"; cpu="sparc" ;;
324 3142255c blueswir1
        v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
325 3142255c blueswir1
                 target_cpu="sparc"; cpu="sparc" ;;
326 3142255c blueswir1
        v9)    SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
327 3142255c blueswir1
                 target_cpu="sparc64"; cpu="sparc64" ;;
328 3142255c blueswir1
        *)     echo "undefined SPARC architecture. Exiting";exit 1;;
329 3142255c blueswir1
      esac
330 3142255c blueswir1
  ;;
331 85aa5189 bellard
  --enable-werror) werror="yes"
332 85aa5189 bellard
  ;;
333 85aa5189 bellard
  --disable-werror) werror="no"
334 85aa5189 bellard
  ;;
335 4d3b6f6e balrog
  --disable-curses) curses="no"
336 4d3b6f6e balrog
  ;;
337 bd0c5661 pbrook
  --disable-nptl) nptl="no"
338 bd0c5661 pbrook
  ;;
339 8ff9cbf7 malc
  --enable-mixemu) mixemu="yes"
340 8ff9cbf7 malc
  ;;
341 414f0dab blueswir1
  --disable-aio) aio="no"
342 414f0dab blueswir1
  ;;
343 7f1559c6 balrog
  *) echo "ERROR: unknown option $opt"; show_help="yes"
344 7f1559c6 balrog
  ;;
345 7d13299d bellard
  esac
346 7d13299d bellard
done
347 7d13299d bellard
348 6f30fa85 ths
# default flags for all hosts
349 ac41a620 blueswir1
CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
350 ac41a620 blueswir1
CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
351 6f30fa85 ths
LDFLAGS="$LDFLAGS -g"
352 85aa5189 bellard
if test "$werror" = "yes" ; then
353 85aa5189 bellard
CFLAGS="$CFLAGS -Werror"
354 85aa5189 bellard
fi
355 6f30fa85 ths
356 3142255c blueswir1
#
357 3142255c blueswir1
# If cpu ~= sparc and  sparc_cpu hasn't been defined, plug in the right
358 3142255c blueswir1
# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
359 3142255c blueswir1
#
360 40293e58 bellard
case "$cpu" in
361 3142255c blueswir1
    sparc) if test -z "$sparc_cpu" ; then
362 3142255c blueswir1
               ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
363 3142255c blueswir1
               ARCH_LDFLAGS="-m32"
364 3142255c blueswir1
           else
365 3142255c blueswir1
               ARCH_CFLAGS="${SP_CFLAGS}"
366 3142255c blueswir1
               ARCH_LDFLAGS="${SP_LDFLAGS}"
367 3142255c blueswir1
           fi
368 3142255c blueswir1
           ;;
369 3142255c blueswir1
    sparc64) if test -z "$sparc_cpu" ; then
370 3142255c blueswir1
               ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
371 3142255c blueswir1
               ARCH_LDFLAGS="-m64"
372 3142255c blueswir1
           else
373 3142255c blueswir1
               ARCH_CFLAGS="${SP_CFLAGS}"
374 3142255c blueswir1
               ARCH_LDFLAGS="${SP_LDFLAGS}"
375 3142255c blueswir1
           fi
376 3142255c blueswir1
           ;;
377 76d83bde ths
    s390)
378 76d83bde ths
           ARCH_CFLAGS="-march=z900"
379 76d83bde ths
           ;;
380 40293e58 bellard
    i386)
381 40293e58 bellard
           ARCH_CFLAGS="-m32"
382 40293e58 bellard
           ARCH_LDFLAGS="-m32"
383 40293e58 bellard
           ;;
384 40293e58 bellard
    x86_64)
385 40293e58 bellard
           ARCH_CFLAGS="-m64"
386 40293e58 bellard
           ARCH_LDFLAGS="-m64"
387 40293e58 bellard
           ;;
388 3142255c blueswir1
esac
389 3142255c blueswir1
390 af5db58e pbrook
if test x"$show_help" = x"yes" ; then
391 af5db58e pbrook
cat << EOF
392 af5db58e pbrook
393 af5db58e pbrook
Usage: configure [options]
394 af5db58e pbrook
Options: [defaults in brackets after descriptions]
395 af5db58e pbrook
396 af5db58e pbrook
EOF
397 af5db58e pbrook
echo "Standard options:"
398 af5db58e pbrook
echo "  --help                   print this message"
399 af5db58e pbrook
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
400 af5db58e pbrook
echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
401 af5db58e pbrook
echo "                           use %M for cpu name [$interp_prefix]"
402 af5db58e pbrook
echo "  --target-list=LIST       set target list [$target_list]"
403 af5db58e pbrook
echo ""
404 af5db58e pbrook
echo "kqemu kernel acceleration support:"
405 af5db58e pbrook
echo "  --disable-kqemu          disable kqemu support"
406 af5db58e pbrook
echo ""
407 af5db58e pbrook
echo "Advanced options (experts only):"
408 af5db58e pbrook
echo "  --source-path=PATH       path of source code [$source_path]"
409 af5db58e pbrook
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
410 af5db58e pbrook
echo "  --cc=CC                  use C compiler CC [$cc]"
411 af5db58e pbrook
echo "  --host-cc=CC             use C compiler CC [$host_cc] for dyngen etc."
412 af5db58e pbrook
echo "  --make=MAKE              use specified make [$make]"
413 6a882643 pbrook
echo "  --install=INSTALL        use specified install [$install]"
414 af5db58e pbrook
echo "  --static                 enable static build [$static]"
415 85aa5189 bellard
echo "  --disable-werror         disable compilation abort on warning"
416 fe8f78e4 balrog
echo "  --disable-sdl            disable SDL"
417 af5db58e pbrook
echo "  --enable-cocoa           enable COCOA (Mac OS X only)"
418 c2de5c91 malc
echo "  --audio-drv-list=LIST    set audio drivers list:"
419 c2de5c91 malc
echo "                           Available drivers: $audio_possible_drivers"
420 c2de5c91 malc
echo "  --audio-card-list=LIST   set list of additional emulated audio cards"
421 c2de5c91 malc
echo "                           Available cards: ac97 adlib cs4231a gus"
422 8ff9cbf7 malc
echo "  --enable-mixemu          enable mixer emulation"
423 2e4d9fb1 aurel32
echo "  --disable-brlapi         disable BrlAPI"
424 8d5d2d4c ths
echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
425 af896aaa pbrook
echo "  --disable-curses         disable curses output"
426 bd0c5661 pbrook
echo "  --disable-nptl           disable usermode NPTL support"
427 af5db58e pbrook
echo "  --enable-system          enable all system emulation targets"
428 af5db58e pbrook
echo "  --disable-system         disable all system emulation targets"
429 831b7825 ths
echo "  --enable-linux-user      enable all linux usermode emulation targets"
430 831b7825 ths
echo "  --disable-linux-user     disable all linux usermode emulation targets"
431 831b7825 ths
echo "  --enable-darwin-user     enable all darwin usermode emulation targets"
432 831b7825 ths
echo "  --disable-darwin-user    disable all darwin usermode emulation targets"
433 af5db58e pbrook
echo "  --fmod-lib               path to FMOD library"
434 af5db58e pbrook
echo "  --fmod-inc               path to FMOD includes"
435 2f6a1ab0 blueswir1
echo "  --oss-lib                path to OSS library"
436 c5937220 pbrook
echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
437 3142255c blueswir1
echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
438 e0e6c8c0 aliguori
echo "  --disable-vde            disable support for vde network"
439 414f0dab blueswir1
echo "  --disable-aio            disable AIO support"
440 af5db58e pbrook
echo ""
441 5bf08934 ths
echo "NOTE: The object files are built at the place where configure is launched"
442 af5db58e pbrook
exit 1
443 af5db58e pbrook
fi
444 af5db58e pbrook
445 7d13299d bellard
cc="${cross_prefix}${cc}"
446 7d13299d bellard
ar="${cross_prefix}${ar}"
447 7d13299d bellard
strip="${cross_prefix}${strip}"
448 7d13299d bellard
449 064aae13 pbrook
# check that the C compiler works.
450 064aae13 pbrook
cat > $TMPC <<EOF
451 064aae13 pbrook
int main(void) {}
452 064aae13 pbrook
EOF
453 064aae13 pbrook
454 db7287ed pbrook
if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
455 064aae13 pbrook
  : C compiler works ok
456 064aae13 pbrook
else
457 064aae13 pbrook
    echo "ERROR: \"$cc\" either does not exist or does not work"
458 064aae13 pbrook
    exit 1
459 a7350fa1 bellard
fi
460 a7350fa1 bellard
461 cd01b4a3 aliguori
# check compiler to see if we're on mingw32
462 cd01b4a3 aliguori
cat > $TMPC <<EOF
463 cd01b4a3 aliguori
#include <windows.h>
464 cd01b4a3 aliguori
#ifndef _WIN32
465 cd01b4a3 aliguori
#error not windows
466 cd01b4a3 aliguori
#endif
467 cd01b4a3 aliguori
int main(void) {}
468 cd01b4a3 aliguori
EOF
469 cd01b4a3 aliguori
470 cd01b4a3 aliguori
if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
471 cd01b4a3 aliguori
    mingw32="yes"
472 cd01b4a3 aliguori
fi
473 cd01b4a3 aliguori
474 67b915a5 bellard
if test "$mingw32" = "yes" ; then
475 5327cf48 bellard
    linux="no"
476 67b915a5 bellard
    EXESUF=".exe"
477 9f059eca bellard
    oss="no"
478 cd01b4a3 aliguori
    linux_user="no"
479 cd01b4a3 aliguori
fi
480 cd01b4a3 aliguori
481 cd01b4a3 aliguori
if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
482 cd01b4a3 aliguori
    AIOLIBS=
483 cd01b4a3 aliguori
else
484 cd01b4a3 aliguori
    # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
485 cd01b4a3 aliguori
    AIOLIBS="-lrt -lpthread"
486 67b915a5 bellard
fi
487 67b915a5 bellard
488 5fafdf24 ths
# Check for gcc4, error if pre-gcc4
489 328a4240 pbrook
if test "$check_gcc" = "yes" ; then
490 328a4240 pbrook
    cat > $TMPC <<EOF
491 328a4240 pbrook
#if __GNUC__ < 4
492 328a4240 pbrook
#error gcc3
493 328a4240 pbrook
#endif
494 328a4240 pbrook
int main(){return 0;}
495 328a4240 pbrook
EOF
496 db7287ed pbrook
    if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
497 328a4240 pbrook
	echo "WARNING: \"$cc\" looks like gcc 4.x"
498 328a4240 pbrook
	found_compat_cc="no"
499 328a4240 pbrook
	if test "$gcc3_search" = "yes" ; then
500 328a4240 pbrook
	    echo "Looking for gcc 3.x"
501 328a4240 pbrook
	    for compat_cc in $gcc3_list ; do
502 d4af3de2 balrog
		if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
503 328a4240 pbrook
		    echo "Found \"$compat_cc\""
504 1124426a pbrook
		    cc="$cross_prefix$compat_cc"
505 328a4240 pbrook
		    found_compat_cc="yes"
506 328a4240 pbrook
		    break
507 328a4240 pbrook
		fi
508 328a4240 pbrook
	    done
509 328a4240 pbrook
	    if test "$found_compat_cc" = "no" ; then
510 328a4240 pbrook
		echo "gcc 3.x not found!"
511 328a4240 pbrook
	    fi
512 328a4240 pbrook
	fi
513 328a4240 pbrook
	if test "$found_compat_cc" = "no" ; then
514 328a4240 pbrook
	    echo "QEMU is known to have problems when compiled with gcc 4.x"
515 328a4240 pbrook
	    echo "It is recommended that you use gcc 3.x to build QEMU"
516 328a4240 pbrook
	    echo "To use this compiler anyway, configure with --disable-gcc-check"
517 328a4240 pbrook
	    exit 1;
518 328a4240 pbrook
	fi
519 328a4240 pbrook
    fi
520 328a4240 pbrook
fi
521 328a4240 pbrook
522 ec530c81 bellard
#
523 ec530c81 bellard
# Solaris specific configure tool chain decisions
524 ec530c81 bellard
#
525 ec530c81 bellard
if test "$solaris" = "yes" ; then
526 ec530c81 bellard
  #
527 ec530c81 bellard
  # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
528 ec530c81 bellard
  # override the check with --disable-gcc-check
529 5fafdf24 ths
  #
530 ec530c81 bellard
  if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
531 ec530c81 bellard
    solgcc=`which $cc`
532 ec530c81 bellard
    if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
533 ec530c81 bellard
      echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
534 ec530c81 bellard
      echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
535 ec530c81 bellard
      echo "or get the latest patch from SunSolve for gcc"
536 ec530c81 bellard
      exit 1
537 ec530c81 bellard
    fi
538 ec530c81 bellard
  fi
539 ec530c81 bellard
  solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
540 ec530c81 bellard
  if test -z "$solinst" ; then
541 ec530c81 bellard
    echo "Solaris install program not found. Use --install=/usr/ucb/install or"
542 ec530c81 bellard
    echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
543 ec530c81 bellard
    echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
544 ec530c81 bellard
    exit 1
545 ec530c81 bellard
  fi
546 ec530c81 bellard
  if test "$solinst" = "/usr/sbin/install" ; then
547 ec530c81 bellard
    echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
548 ec530c81 bellard
    echo "try ginstall from the GNU fileutils available from www.blastwave.org"
549 ec530c81 bellard
    echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
550 ec530c81 bellard
    exit 1
551 ec530c81 bellard
  fi
552 ec530c81 bellard
  sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
553 ec530c81 bellard
  if test -z "$sol_ar" ; then
554 ec530c81 bellard
    echo "Error: No path includes ar"
555 ec530c81 bellard
    if test -f /usr/ccs/bin/ar ; then
556 ec530c81 bellard
      echo "Add /usr/ccs/bin to your path and rerun configure"
557 ec530c81 bellard
    fi
558 ec530c81 bellard
    exit 1
559 ec530c81 bellard
  fi
560 5fafdf24 ths
fi
561 ec530c81 bellard
562 ec530c81 bellard
563 5327cf48 bellard
if test -z "$target_list" ; then
564 5327cf48 bellard
# these targets are portable
565 0a8e90f4 pbrook
    if [ "$softmmu" = "yes" ] ; then
566 2408a527 aurel32
        target_list="\
567 2408a527 aurel32
i386-softmmu \
568 2408a527 aurel32
x86_64-softmmu \
569 2408a527 aurel32
arm-softmmu \
570 2408a527 aurel32
cris-softmmu \
571 2408a527 aurel32
m68k-softmmu \
572 2408a527 aurel32
mips-softmmu \
573 2408a527 aurel32
mipsel-softmmu \
574 2408a527 aurel32
mips64-softmmu \
575 2408a527 aurel32
mips64el-softmmu \
576 2408a527 aurel32
ppc-softmmu \
577 2408a527 aurel32
ppcemb-softmmu \
578 2408a527 aurel32
ppc64-softmmu \
579 2408a527 aurel32
sh4-softmmu \
580 2408a527 aurel32
sh4eb-softmmu \
581 2408a527 aurel32
sparc-softmmu \
582 2408a527 aurel32
"
583 0a8e90f4 pbrook
    fi
584 5327cf48 bellard
# the following are Linux specific
585 831b7825 ths
    if [ "$linux_user" = "yes" ] ; then
586 2408a527 aurel32
        target_list="${target_list}\
587 2408a527 aurel32
i386-linux-user \
588 2408a527 aurel32
x86_64-linux-user \
589 2408a527 aurel32
alpha-linux-user \
590 2408a527 aurel32
arm-linux-user \
591 2408a527 aurel32
armeb-linux-user \
592 2408a527 aurel32
cris-linux-user \
593 2408a527 aurel32
m68k-linux-user \
594 2408a527 aurel32
mips-linux-user \
595 2408a527 aurel32
mipsel-linux-user \
596 2408a527 aurel32
ppc-linux-user \
597 2408a527 aurel32
ppc64-linux-user \
598 2408a527 aurel32
ppc64abi32-linux-user \
599 2408a527 aurel32
sh4-linux-user \
600 2408a527 aurel32
sh4eb-linux-user \
601 2408a527 aurel32
sparc-linux-user \
602 2408a527 aurel32
sparc64-linux-user \
603 2408a527 aurel32
sparc32plus-linux-user \
604 2408a527 aurel32
"
605 831b7825 ths
    fi
606 831b7825 ths
# the following are Darwin specific
607 831b7825 ths
    if [ "$darwin_user" = "yes" ] ; then
608 2408a527 aurel32
        target_list="$target_list i386-darwin-user ppc-darwin-user"
609 5327cf48 bellard
    fi
610 6e20a45f bellard
else
611 b1a550a0 pbrook
    target_list=`echo "$target_list" | sed -e 's/,/ /g'`
612 5327cf48 bellard
fi
613 0a8e90f4 pbrook
if test -z "$target_list" ; then
614 0a8e90f4 pbrook
    echo "No targets enabled"
615 0a8e90f4 pbrook
    exit 1
616 0a8e90f4 pbrook
fi
617 5327cf48 bellard
618 7d13299d bellard
if test -z "$cross_prefix" ; then
619 7d13299d bellard
620 7d13299d bellard
# ---
621 7d13299d bellard
# big/little endian test
622 7d13299d bellard
cat > $TMPC << EOF
623 7d13299d bellard
#include <inttypes.h>
624 7d13299d bellard
int main(int argc, char ** argv){
625 1d14ffa9 bellard
        volatile uint32_t i=0x01234567;
626 1d14ffa9 bellard
        return (*((uint8_t*)(&i))) == 0x67;
627 7d13299d bellard
}
628 7d13299d bellard
EOF
629 7d13299d bellard
630 db7287ed pbrook
if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
631 7d13299d bellard
$TMPE && bigendian="yes"
632 7d13299d bellard
else
633 7d13299d bellard
echo big/little test failed
634 7d13299d bellard
fi
635 7d13299d bellard
636 7d13299d bellard
else
637 7d13299d bellard
638 7d13299d bellard
# if cross compiling, cannot launch a program, so make a static guess
639 0938cda5 aurel32
if test "$cpu" = "armv4b" \
640 f54b3f92 aurel32
     -o "$cpu" = "hppa" \
641 0938cda5 aurel32
     -o "$cpu" = "m68k" \
642 0938cda5 aurel32
     -o "$cpu" = "mips" \
643 0938cda5 aurel32
     -o "$cpu" = "mips64" \
644 0938cda5 aurel32
     -o "$cpu" = "powerpc" \
645 0938cda5 aurel32
     -o "$cpu" = "s390" \
646 0938cda5 aurel32
     -o "$cpu" = "sparc" \
647 0938cda5 aurel32
     -o "$cpu" = "sparc64"; then
648 7d13299d bellard
    bigendian="yes"
649 7d13299d bellard
fi
650 7d13299d bellard
651 7d13299d bellard
fi
652 7d13299d bellard
653 b6853697 bellard
# host long bits test
654 b6853697 bellard
hostlongbits="32"
655 0938cda5 aurel32
if test "$cpu" = "x86_64" \
656 0938cda5 aurel32
     -o "$cpu" = "alpha" \
657 0938cda5 aurel32
     -o "$cpu" = "ia64" \
658 0938cda5 aurel32
     -o "$cpu" = "sparc64"; then
659 b6853697 bellard
    hostlongbits="64"
660 b6853697 bellard
fi
661 b6853697 bellard
662 810260a8 malc
# ppc specific hostlongbits selection
663 810260a8 malc
if test "$cpu" = "powerpc" ; then
664 810260a8 malc
    cat > $TMPC <<EOF
665 810260a8 malc
int main(void){return sizeof(long);}
666 810260a8 malc
EOF
667 810260a8 malc
668 810260a8 malc
    if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null; then
669 810260a8 malc
        $TMPE
670 810260a8 malc
        case $? in
671 810260a8 malc
            4) hostlongbits="32";;
672 810260a8 malc
            8) hostlongbits="64";;
673 ba69a08a malc
            *) echo "Couldn't determine bits per long value"; exit 1;;
674 810260a8 malc
        esac
675 810260a8 malc
    else
676 810260a8 malc
        echo hostlongbits test failed
677 ba69a08a malc
        exit 1
678 810260a8 malc
    fi
679 810260a8 malc
fi
680 810260a8 malc
681 e8cd23de bellard
# check gcc options support
682 04369ff2 bellard
cat > $TMPC <<EOF
683 04369ff2 bellard
int main(void) {
684 04369ff2 bellard
}
685 04369ff2 bellard
EOF
686 04369ff2 bellard
687 bd0c5661 pbrook
# Check host NPTL support
688 bd0c5661 pbrook
cat > $TMPC <<EOF
689 bd0c5661 pbrook
#include <sched.h>
690 30813cea pbrook
#include <linux/futex.h>
691 bd0c5661 pbrook
void foo()
692 bd0c5661 pbrook
{
693 bd0c5661 pbrook
#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
694 bd0c5661 pbrook
#error bork
695 bd0c5661 pbrook
#endif
696 bd0c5661 pbrook
}
697 bd0c5661 pbrook
EOF
698 bd0c5661 pbrook
699 bd0c5661 pbrook
if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
700 bd0c5661 pbrook
  :
701 bd0c5661 pbrook
else
702 bd0c5661 pbrook
   nptl="no"
703 bd0c5661 pbrook
fi
704 bd0c5661 pbrook
705 11d9f695 bellard
##########################################
706 11d9f695 bellard
# SDL probe
707 11d9f695 bellard
708 11d9f695 bellard
sdl_too_old=no
709 11d9f695 bellard
710 11d9f695 bellard
if test -z "$sdl" ; then
711 069b0bda ths
    sdl_config="sdl-config"
712 069b0bda ths
    sdl=no
713 069b0bda ths
    sdl_static=no
714 069b0bda ths
715 11d9f695 bellard
cat > $TMPC << EOF
716 11d9f695 bellard
#include <SDL.h>
717 11d9f695 bellard
#undef main /* We don't want SDL to override our main() */
718 11d9f695 bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
719 11d9f695 bellard
EOF
720 cd01b4a3 aliguori
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
721 cd01b4a3 aliguori
        _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
722 cd01b4a3 aliguori
        if test "$_sdlversion" -lt 121 ; then
723 cd01b4a3 aliguori
            sdl_too_old=yes
724 cd01b4a3 aliguori
        else
725 cd01b4a3 aliguori
            if test "$cocoa" = "no" ; then
726 cd01b4a3 aliguori
                sdl=yes
727 069b0bda ths
            fi
728 cd01b4a3 aliguori
        fi
729 11d9f695 bellard
730 cd01b4a3 aliguori
        # static link with sdl ?
731 cd01b4a3 aliguori
        if test "$sdl" = "yes" ; then
732 cd01b4a3 aliguori
            aa="no"
733 cd01b4a3 aliguori
            `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
734 cd01b4a3 aliguori
            sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
735 cd01b4a3 aliguori
            if [ "$aa" = "yes" ] ; then
736 cd01b4a3 aliguori
                sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
737 cd01b4a3 aliguori
            fi
738 cd01b4a3 aliguori
739 cd01b4a3 aliguori
            if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
740 cd01b4a3 aliguori
                sdl_static=yes
741 cd01b4a3 aliguori
            fi
742 cd01b4a3 aliguori
        fi # static link
743 cd01b4a3 aliguori
    fi # sdl compile test
744 fd677642 ths
else
745 069b0bda ths
    # Make sure to disable cocoa if sdl was set
746 069b0bda ths
    if test "$sdl" = "yes" ; then
747 069b0bda ths
       cocoa="no"
748 c2de5c91 malc
       audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
749 069b0bda ths
    fi
750 a6e022ad bellard
fi # -z $sdl
751 11d9f695 bellard
752 8f28f3fb ths
##########################################
753 8d5d2d4c ths
# VNC TLS detection
754 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
755 ae6b5e5a aliguori
cat > $TMPC <<EOF
756 ae6b5e5a aliguori
#include <gnutls/gnutls.h>
757 ae6b5e5a aliguori
int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
758 ae6b5e5a aliguori
EOF
759 ae6b5e5a aliguori
    vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
760 ae6b5e5a aliguori
    vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
761 ae6b5e5a aliguori
    if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
762 ae6b5e5a aliguori
           $vnc_tls_libs 2> /dev/null ; then
763 ae6b5e5a aliguori
	:
764 ae6b5e5a aliguori
    else
765 ae6b5e5a aliguori
	vnc_tls="no"
766 ae6b5e5a aliguori
    fi
767 8d5d2d4c ths
fi
768 8d5d2d4c ths
769 8d5d2d4c ths
##########################################
770 8a16d273 ths
# vde libraries probe
771 8a16d273 ths
if test "$vde" = "yes" ; then
772 8a16d273 ths
  cat > $TMPC << EOF
773 8a16d273 ths
#include <libvdeplug.h>
774 4a7f0e06 pbrook
int main(void)
775 4a7f0e06 pbrook
{
776 4a7f0e06 pbrook
    struct vde_open_args a = {0, 0, 0};
777 4a7f0e06 pbrook
    vde_open("", "", &a);
778 4a7f0e06 pbrook
    return 0;
779 4a7f0e06 pbrook
}
780 8a16d273 ths
EOF
781 4a7f0e06 pbrook
    if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then
782 8a16d273 ths
        :
783 8a16d273 ths
    else
784 e0e6c8c0 aliguori
        vde="no"
785 8a16d273 ths
    fi
786 8a16d273 ths
fi
787 8a16d273 ths
788 8a16d273 ths
##########################################
789 c2de5c91 malc
# Sound support libraries probe
790 8f28f3fb ths
791 c2de5c91 malc
audio_drv_probe()
792 c2de5c91 malc
{
793 c2de5c91 malc
    drv=$1
794 c2de5c91 malc
    hdr=$2
795 c2de5c91 malc
    lib=$3
796 c2de5c91 malc
    exp=$4
797 c2de5c91 malc
    cfl=$5
798 c2de5c91 malc
        cat > $TMPC << EOF
799 c2de5c91 malc
#include <$hdr>
800 c2de5c91 malc
int main(void) { $exp }
801 8f28f3fb ths
EOF
802 c2de5c91 malc
    if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then
803 c2de5c91 malc
        :
804 c2de5c91 malc
    else
805 c2de5c91 malc
        echo
806 c2de5c91 malc
        echo "Error: $drv check failed"
807 c2de5c91 malc
        echo "Make sure to have the $drv libs and headers installed."
808 c2de5c91 malc
        echo
809 c2de5c91 malc
        exit 1
810 c2de5c91 malc
    fi
811 c2de5c91 malc
}
812 c2de5c91 malc
813 2fa7d3bf malc
audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
814 c2de5c91 malc
for drv in $audio_drv_list; do
815 c2de5c91 malc
    case $drv in
816 c2de5c91 malc
    alsa)
817 c2de5c91 malc
    audio_drv_probe $drv alsa/asoundlib.h -lasound \
818 c2de5c91 malc
        "snd_pcm_t **handle; return snd_pcm_close(*handle);"
819 c2de5c91 malc
    ;;
820 c2de5c91 malc
821 c2de5c91 malc
    fmod)
822 c2de5c91 malc
    if test -z $fmod_lib || test -z $fmod_inc; then
823 c2de5c91 malc
        echo
824 c2de5c91 malc
        echo "Error: You must specify path to FMOD library and headers"
825 c2de5c91 malc
        echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
826 c2de5c91 malc
        echo
827 c2de5c91 malc
        exit 1
828 c2de5c91 malc
    fi
829 c2de5c91 malc
    audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
830 c2de5c91 malc
    ;;
831 c2de5c91 malc
832 c2de5c91 malc
    esd)
833 c2de5c91 malc
    audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
834 c2de5c91 malc
    ;;
835 b8e59f18 malc
836 b8e59f18 malc
    pa)
837 b8e59f18 malc
    audio_drv_probe $drv pulse/simple.h -lpulse-simple \
838 b8e59f18 malc
        "pa_simple *s = NULL; pa_simple_free(s); return 0;"
839 b8e59f18 malc
    ;;
840 b8e59f18 malc
841 2f6a1ab0 blueswir1
    oss|sdl|core|wav|dsound)
842 2f6a1ab0 blueswir1
    # XXX: Probes for CoreAudio, DirectSound, SDL(?)
843 2f6a1ab0 blueswir1
    ;;
844 2f6a1ab0 blueswir1
845 e4c63a6a malc
    *)
846 1c9b2a52 malc
    echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
847 e4c63a6a malc
        echo
848 e4c63a6a malc
        echo "Error: Unknown driver '$drv' selected"
849 e4c63a6a malc
        echo "Possible drivers are: $audio_possible_drivers"
850 e4c63a6a malc
        echo
851 e4c63a6a malc
        exit 1
852 e4c63a6a malc
    }
853 e4c63a6a malc
    ;;
854 c2de5c91 malc
    esac
855 c2de5c91 malc
done
856 8f28f3fb ths
857 4d3b6f6e balrog
##########################################
858 2e4d9fb1 aurel32
# BrlAPI probe
859 2e4d9fb1 aurel32
860 2e4d9fb1 aurel32
if test -z "$brlapi" ; then
861 2e4d9fb1 aurel32
    brlapi=no
862 2e4d9fb1 aurel32
cat > $TMPC << EOF
863 2e4d9fb1 aurel32
#include <brlapi.h>
864 2e4d9fb1 aurel32
int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
865 2e4d9fb1 aurel32
EOF
866 a40e56d5 aurel32
    if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
867 2e4d9fb1 aurel32
	    brlapi=yes
868 2e4d9fb1 aurel32
    fi # brlapi compile test
869 2e4d9fb1 aurel32
fi # -z $brlapi
870 2e4d9fb1 aurel32
871 2e4d9fb1 aurel32
##########################################
872 4d3b6f6e balrog
# curses probe
873 4d3b6f6e balrog
874 4d3b6f6e balrog
if test "$curses" = "yes" ; then
875 4d3b6f6e balrog
  curses=no
876 4d3b6f6e balrog
  cat > $TMPC << EOF
877 4d3b6f6e balrog
#include <curses.h>
878 4d3b6f6e balrog
int main(void) { return curses_version(); }
879 4d3b6f6e balrog
EOF
880 af896aaa pbrook
  if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
881 4d3b6f6e balrog
    curses=yes
882 4d3b6f6e balrog
  fi
883 4d3b6f6e balrog
fi # test "$curses"
884 4d3b6f6e balrog
885 414f0dab blueswir1
##########################################
886 414f0dab blueswir1
# AIO probe
887 414f0dab blueswir1
if test "$aio" = "yes" ; then
888 414f0dab blueswir1
  aio=no
889 414f0dab blueswir1
  cat > $TMPC << EOF
890 414f0dab blueswir1
#include <aio.h>
891 414f0dab blueswir1
int main(void) { return aio_write(NULL); }
892 414f0dab blueswir1
EOF
893 414f0dab blueswir1
  if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
894 414f0dab blueswir1
    aio=yes
895 414f0dab blueswir1
  fi
896 414f0dab blueswir1
fi
897 414f0dab blueswir1
898 cc8ae6de pbrook
# Check if tools are available to build documentation.
899 6c591867 ths
if [ -x "`which texi2html 2>/dev/null`" ] && \
900 6c591867 ths
   [ -x "`which pod2man 2>/dev/null`" ]; then
901 cc8ae6de pbrook
  build_docs="yes"
902 cc8ae6de pbrook
fi
903 cc8ae6de pbrook
904 11d9f695 bellard
if test "$mingw32" = "yes" ; then
905 308c3593 pbrook
  if test -z "$prefix" ; then
906 308c3593 pbrook
      prefix="/c/Program Files/Qemu"
907 308c3593 pbrook
  fi
908 308c3593 pbrook
  mansuffix=""
909 308c3593 pbrook
  datasuffix=""
910 308c3593 pbrook
  docsuffix=""
911 308c3593 pbrook
  binsuffix=""
912 11d9f695 bellard
else
913 308c3593 pbrook
  if test -z "$prefix" ; then
914 308c3593 pbrook
      prefix="/usr/local"
915 308c3593 pbrook
  fi
916 308c3593 pbrook
  mansuffix="/share/man"
917 308c3593 pbrook
  datasuffix="/share/qemu"
918 308c3593 pbrook
  docsuffix="/share/doc/qemu"
919 308c3593 pbrook
  binsuffix="/bin"
920 11d9f695 bellard
fi
921 5a67135a bellard
922 43ce4dfe bellard
echo "Install prefix    $prefix"
923 308c3593 pbrook
echo "BIOS directory    $prefix$datasuffix"
924 308c3593 pbrook
echo "binary directory  $prefix$binsuffix"
925 11d9f695 bellard
if test "$mingw32" = "no" ; then
926 308c3593 pbrook
echo "Manual directory  $prefix$mansuffix"
927 43ce4dfe bellard
echo "ELF interp prefix $interp_prefix"
928 11d9f695 bellard
fi
929 5a67135a bellard
echo "Source path       $source_path"
930 43ce4dfe bellard
echo "C compiler        $cc"
931 83469015 bellard
echo "Host C compiler   $host_cc"
932 db7287ed pbrook
echo "ARCH_CFLAGS       $ARCH_CFLAGS"
933 43ce4dfe bellard
echo "make              $make"
934 6a882643 pbrook
echo "install           $install"
935 43ce4dfe bellard
echo "host CPU          $cpu"
936 de83cd02 bellard
echo "host big endian   $bigendian"
937 97a847bc bellard
echo "target list       $target_list"
938 43ce4dfe bellard
echo "gprof enabled     $gprof"
939 05c2a3e7 bellard
echo "profiler          $profiler"
940 43ce4dfe bellard
echo "static build      $static"
941 85aa5189 bellard
echo "-Werror enabled   $werror"
942 5b0753e0 bellard
if test "$darwin" = "yes" ; then
943 5b0753e0 bellard
    echo "Cocoa support     $cocoa"
944 5b0753e0 bellard
fi
945 97a847bc bellard
echo "SDL support       $sdl"
946 e4afee97 bellard
if test "$sdl" != "no" ; then
947 e4afee97 bellard
    echo "SDL static link   $sdl_static"
948 e4afee97 bellard
fi
949 4d3b6f6e balrog
echo "curses support    $curses"
950 67b915a5 bellard
echo "mingw32 support   $mingw32"
951 0c58ac1c malc
echo "Audio drivers     $audio_drv_list"
952 0c58ac1c malc
echo "Extra audio cards $audio_card_list"
953 8ff9cbf7 malc
echo "Mixer emulation   $mixemu"
954 8d5d2d4c ths
echo "VNC TLS support   $vnc_tls"
955 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
956 8d5d2d4c ths
    echo "    TLS CFLAGS    $vnc_tls_cflags"
957 8d5d2d4c ths
    echo "    TLS LIBS      $vnc_tls_libs"
958 8d5d2d4c ths
fi
959 3142255c blueswir1
if test -n "$sparc_cpu"; then
960 3142255c blueswir1
    echo "Target Sparc Arch $sparc_cpu"
961 3142255c blueswir1
fi
962 07f4ddbf bellard
echo "kqemu support     $kqemu"
963 2e4d9fb1 aurel32
echo "brlapi support    $brlapi"
964 cc8ae6de pbrook
echo "Documentation     $build_docs"
965 c5937220 pbrook
[ ! -z "$uname_release" ] && \
966 c5937220 pbrook
echo "uname -r          $uname_release"
967 bd0c5661 pbrook
echo "NPTL support      $nptl"
968 8a16d273 ths
echo "vde support       $vde"
969 414f0dab blueswir1
echo "AIO support       $aio"
970 67b915a5 bellard
971 97a847bc bellard
if test $sdl_too_old = "yes"; then
972 24b55b96 bellard
echo "-> Your SDL version is too old - please upgrade to have SDL support"
973 7c1f25b4 bellard
fi
974 20b40c6a ths
if [ -s /tmp/qemu-$$-sdl-config.log ]; then
975 20b40c6a ths
  echo "The error log from compiling the libSDL test is: "
976 20b40c6a ths
  cat /tmp/qemu-$$-sdl-config.log
977 20b40c6a ths
fi
978 20b40c6a ths
rm -f /tmp/qemu-$$-sdl-config.log
979 24b55b96 bellard
#if test "$sdl_static" = "no"; then
980 24b55b96 bellard
#  echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
981 24b55b96 bellard
#fi
982 97a847bc bellard
config_mak="config-host.mak"
983 97a847bc bellard
config_h="config-host.h"
984 7d13299d bellard
985 7c1f25b4 bellard
#echo "Creating $config_mak and $config_h"
986 7d13299d bellard
987 15d9ca0f ths
test -f $config_h && mv $config_h ${config_h}~
988 15d9ca0f ths
989 97a847bc bellard
echo "# Automatically generated by configure - do not modify" > $config_mak
990 29517134 pbrook
echo "# Configured with: $0 $@" >> $config_mak
991 97a847bc bellard
echo "/* Automatically generated by configure - do not modify */" > $config_h
992 7d13299d bellard
993 97a847bc bellard
echo "prefix=$prefix" >> $config_mak
994 308c3593 pbrook
echo "bindir=\${prefix}$binsuffix" >> $config_mak
995 308c3593 pbrook
echo "mandir=\${prefix}$mansuffix" >> $config_mak
996 308c3593 pbrook
echo "datadir=\${prefix}$datasuffix" >> $config_mak
997 4ad5b06d ths
echo "docdir=\${prefix}$docsuffix" >> $config_mak
998 308c3593 pbrook
echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
999 97a847bc bellard
echo "MAKE=$make" >> $config_mak
1000 6a882643 pbrook
echo "INSTALL=$install" >> $config_mak
1001 97a847bc bellard
echo "CC=$cc" >> $config_mak
1002 97a847bc bellard
echo "HOST_CC=$host_cc" >> $config_mak
1003 97a847bc bellard
echo "AR=$ar" >> $config_mak
1004 97a847bc bellard
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
1005 40293e58 bellard
# XXX: only use CFLAGS and LDFLAGS ?  
1006 40293e58 bellard
# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1007 40293e58 bellard
# compilation of dyngen tool (useful for win32 build on Linux host)
1008 6f30fa85 ths
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
1009 3142255c blueswir1
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1010 3142255c blueswir1
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1011 3142255c blueswir1
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
1012 97a847bc bellard
echo "CFLAGS=$CFLAGS" >> $config_mak
1013 97a847bc bellard
echo "LDFLAGS=$LDFLAGS" >> $config_mak
1014 67b915a5 bellard
echo "EXESUF=$EXESUF" >> $config_mak
1015 70956b77 ths
echo "AIOLIBS=$AIOLIBS" >> $config_mak
1016 2408a527 aurel32
case "$cpu" in
1017 2408a527 aurel32
  i386)
1018 2408a527 aurel32
    echo "ARCH=i386" >> $config_mak
1019 2408a527 aurel32
    echo "#define HOST_I386 1" >> $config_h
1020 2408a527 aurel32
  ;;
1021 2408a527 aurel32
  x86_64)
1022 2408a527 aurel32
    echo "ARCH=x86_64" >> $config_mak
1023 2408a527 aurel32
    echo "#define HOST_X86_64 1" >> $config_h
1024 2408a527 aurel32
  ;;
1025 2408a527 aurel32
  alpha)
1026 2408a527 aurel32
    echo "ARCH=alpha" >> $config_mak
1027 2408a527 aurel32
    echo "#define HOST_ALPHA 1" >> $config_h
1028 2408a527 aurel32
  ;;
1029 2408a527 aurel32
  armv4b)
1030 2408a527 aurel32
    echo "ARCH=arm" >> $config_mak
1031 2408a527 aurel32
    echo "#define HOST_ARM 1" >> $config_h
1032 2408a527 aurel32
  ;;
1033 2408a527 aurel32
  armv4l)
1034 2408a527 aurel32
    echo "ARCH=arm" >> $config_mak
1035 2408a527 aurel32
    echo "#define HOST_ARM 1" >> $config_h
1036 2408a527 aurel32
  ;;
1037 2408a527 aurel32
  cris)
1038 2408a527 aurel32
    echo "ARCH=cris" >> $config_mak
1039 2408a527 aurel32
    echo "#define HOST_CRIS 1" >> $config_h
1040 2408a527 aurel32
  ;;
1041 2408a527 aurel32
  hppa)
1042 2408a527 aurel32
    echo "ARCH=hppa" >> $config_mak
1043 2408a527 aurel32
    echo "#define HOST_HPPA 1" >> $config_h
1044 2408a527 aurel32
  ;;
1045 2408a527 aurel32
  ia64)
1046 2408a527 aurel32
    echo "ARCH=ia64" >> $config_mak
1047 2408a527 aurel32
    echo "#define HOST_IA64 1" >> $config_h
1048 2408a527 aurel32
  ;;
1049 2408a527 aurel32
  m68k)
1050 2408a527 aurel32
    echo "ARCH=m68k" >> $config_mak
1051 2408a527 aurel32
    echo "#define HOST_M68K 1" >> $config_h
1052 2408a527 aurel32
  ;;
1053 2408a527 aurel32
  mips)
1054 2408a527 aurel32
    echo "ARCH=mips" >> $config_mak
1055 2408a527 aurel32
    echo "#define HOST_MIPS 1" >> $config_h
1056 2408a527 aurel32
  ;;
1057 2408a527 aurel32
  mips64)
1058 2408a527 aurel32
    echo "ARCH=mips64" >> $config_mak
1059 2408a527 aurel32
    echo "#define HOST_MIPS64 1" >> $config_h
1060 2408a527 aurel32
  ;;
1061 2408a527 aurel32
  powerpc)
1062 810260a8 malc
  if test "$hostlongbits" = "32"; then
1063 810260a8 malc
      echo "ARCH=ppc" >> $config_mak
1064 810260a8 malc
      echo "#define HOST_PPC 1" >> $config_h
1065 810260a8 malc
  else
1066 810260a8 malc
      echo "ARCH=ppc64" >> $config_mak
1067 810260a8 malc
      echo "#define HOST_PPC64 1" >> $config_h
1068 810260a8 malc
  fi
1069 2408a527 aurel32
  ;;
1070 2408a527 aurel32
  s390)
1071 2408a527 aurel32
    echo "ARCH=s390" >> $config_mak
1072 2408a527 aurel32
    echo "#define HOST_S390 1" >> $config_h
1073 2408a527 aurel32
  ;;
1074 2408a527 aurel32
  sparc)
1075 2408a527 aurel32
    echo "ARCH=sparc" >> $config_mak
1076 2408a527 aurel32
    echo "#define HOST_SPARC 1" >> $config_h
1077 2408a527 aurel32
  ;;
1078 2408a527 aurel32
  sparc64)
1079 2408a527 aurel32
    echo "ARCH=sparc64" >> $config_mak
1080 2408a527 aurel32
    echo "#define HOST_SPARC64 1" >> $config_h
1081 2408a527 aurel32
  ;;
1082 2408a527 aurel32
  *)
1083 2408a527 aurel32
    echo "Unsupported CPU = $cpu"
1084 2408a527 aurel32
    exit 1
1085 2408a527 aurel32
  ;;
1086 2408a527 aurel32
esac
1087 7d13299d bellard
if test "$bigendian" = "yes" ; then
1088 97a847bc bellard
  echo "WORDS_BIGENDIAN=yes" >> $config_mak
1089 97a847bc bellard
  echo "#define WORDS_BIGENDIAN 1" >> $config_h
1090 97a847bc bellard
fi
1091 b6853697 bellard
echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
1092 67b915a5 bellard
if test "$mingw32" = "yes" ; then
1093 67b915a5 bellard
  echo "CONFIG_WIN32=yes" >> $config_mak
1094 11d9f695 bellard
  echo "#define CONFIG_WIN32 1" >> $config_h
1095 210fa556 pbrook
else
1096 210fa556 pbrook
  cat > $TMPC << EOF
1097 210fa556 pbrook
#include <byteswap.h>
1098 210fa556 pbrook
int main(void) { return bswap_32(0); }
1099 210fa556 pbrook
EOF
1100 db7287ed pbrook
  if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1101 210fa556 pbrook
    echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1102 210fa556 pbrook
  fi
1103 67b915a5 bellard
fi
1104 128ab2ff blueswir1
1105 128ab2ff blueswir1
if [ "$openbsd" = "yes" ] ; then
1106 128ab2ff blueswir1
  echo "#define ENOTSUP 4096" >> $config_h
1107 128ab2ff blueswir1
fi
1108 128ab2ff blueswir1
1109 83fb7adf bellard
if test "$darwin" = "yes" ; then
1110 83fb7adf bellard
  echo "CONFIG_DARWIN=yes" >> $config_mak
1111 83fb7adf bellard
  echo "#define CONFIG_DARWIN 1" >> $config_h
1112 83fb7adf bellard
fi
1113 ec530c81 bellard
if test "$solaris" = "yes" ; then
1114 ec530c81 bellard
  echo "CONFIG_SOLARIS=yes" >> $config_mak
1115 38cfa06c bellard
  echo "#define HOST_SOLARIS $solarisrev" >> $config_h
1116 0475a5ca ths
  if test "$needs_libsunmath" = "yes" ; then
1117 0475a5ca ths
    echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1118 0475a5ca ths
    echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1119 0475a5ca ths
  fi
1120 ec530c81 bellard
fi
1121 3142255c blueswir1
if test -n "$sparc_cpu"; then
1122 3142255c blueswir1
  echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1123 3142255c blueswir1
  echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1124 3142255c blueswir1
fi
1125 67b915a5 bellard
if test "$gdbstub" = "yes" ; then
1126 67b915a5 bellard
  echo "CONFIG_GDBSTUB=yes" >> $config_mak
1127 67b915a5 bellard
  echo "#define CONFIG_GDBSTUB 1" >> $config_h
1128 67b915a5 bellard
fi
1129 97a847bc bellard
if test "$gprof" = "yes" ; then
1130 97a847bc bellard
  echo "TARGET_GPROF=yes" >> $config_mak
1131 97a847bc bellard
  echo "#define HAVE_GPROF 1" >> $config_h
1132 97a847bc bellard
fi
1133 97a847bc bellard
if test "$static" = "yes" ; then
1134 97a847bc bellard
  echo "CONFIG_STATIC=yes" >> $config_mak
1135 50863472 bellard
  echo "#define CONFIG_STATIC 1" >> $config_h
1136 7d13299d bellard
fi
1137 05c2a3e7 bellard
if test $profiler = "yes" ; then
1138 05c2a3e7 bellard
  echo "#define CONFIG_PROFILER 1" >> $config_h
1139 05c2a3e7 bellard
fi
1140 c20709aa bellard
if test "$slirp" = "yes" ; then
1141 c20709aa bellard
  echo "CONFIG_SLIRP=yes" >> $config_mak
1142 c20709aa bellard
  echo "#define CONFIG_SLIRP 1" >> $config_h
1143 c20709aa bellard
fi
1144 8a16d273 ths
if test "$vde" = "yes" ; then
1145 8a16d273 ths
  echo "CONFIG_VDE=yes" >> $config_mak
1146 8a16d273 ths
  echo "#define CONFIG_VDE 1" >> $config_h
1147 8a16d273 ths
  echo "VDE_LIBS=-lvdeplug" >> $config_mak
1148 8a16d273 ths
fi
1149 0c58ac1c malc
for card in $audio_card_list; do
1150 f6e5889e pbrook
    def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
1151 0c58ac1c malc
    echo "$def=yes" >> $config_mak
1152 0c58ac1c malc
    echo "#define $def 1" >> $config_h
1153 0c58ac1c malc
done
1154 0c58ac1c malc
echo "#define AUDIO_DRIVERS \\" >> $config_h
1155 0c58ac1c malc
for drv in $audio_drv_list; do
1156 0c58ac1c malc
    echo "    &${drv}_audio_driver, \\" >>$config_h
1157 f6e5889e pbrook
    def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
1158 0c58ac1c malc
    echo "$def=yes" >> $config_mak
1159 923e4521 malc
    if test "$drv" = "fmod"; then
1160 0c58ac1c malc
        echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1161 0c58ac1c malc
        echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1162 2f6a1ab0 blueswir1
    elif test "$drv" = "oss"; then
1163 2f6a1ab0 blueswir1
        echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
1164 0c58ac1c malc
    fi
1165 0c58ac1c malc
done
1166 0c58ac1c malc
echo "" >>$config_h
1167 8ff9cbf7 malc
if test "$mixemu" = "yes" ; then
1168 8ff9cbf7 malc
  echo "CONFIG_MIXEMU=yes" >> $config_mak
1169 8ff9cbf7 malc
  echo "#define CONFIG_MIXEMU 1" >> $config_h
1170 8ff9cbf7 malc
fi
1171 8d5d2d4c ths
if test "$vnc_tls" = "yes" ; then
1172 8d5d2d4c ths
  echo "CONFIG_VNC_TLS=yes" >> $config_mak
1173 8d5d2d4c ths
  echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1174 8d5d2d4c ths
  echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1175 8d5d2d4c ths
  echo "#define CONFIG_VNC_TLS 1" >> $config_h
1176 8d5d2d4c ths
fi
1177 b1a550a0 pbrook
qemu_version=`head $source_path/VERSION`
1178 b1a550a0 pbrook
echo "VERSION=$qemu_version" >>$config_mak
1179 d4b8f039 pbrook
echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
1180 97a847bc bellard
1181 97a847bc bellard
echo "SRC_PATH=$source_path" >> $config_mak
1182 ad064840 pbrook
if [ "$source_path_used" = "yes" ]; then
1183 ad064840 pbrook
  echo "VPATH=$source_path" >> $config_mak
1184 ad064840 pbrook
fi
1185 97a847bc bellard
echo "TARGET_DIRS=$target_list" >> $config_mak
1186 cc8ae6de pbrook
if [ "$build_docs" = "yes" ] ; then
1187 cc8ae6de pbrook
  echo "BUILD_DOCS=yes" >> $config_mak
1188 cc8ae6de pbrook
fi
1189 49ecc3fa bellard
if test "$static" = "yes"; then
1190 49ecc3fa bellard
  sdl1=$sdl_static
1191 49ecc3fa bellard
else
1192 49ecc3fa bellard
  sdl1=$sdl
1193 49ecc3fa bellard
fi
1194 49ecc3fa bellard
if test "$sdl1" = "yes" ; then
1195 49ecc3fa bellard
  echo "#define CONFIG_SDL 1" >> $config_h
1196 49ecc3fa bellard
  echo "CONFIG_SDL=yes" >> $config_mak
1197 49ecc3fa bellard
  if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1198 49ecc3fa bellard
    echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1199 49ecc3fa bellard
  else
1200 49ecc3fa bellard
    echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1201 49ecc3fa bellard
  fi
1202 49ecc3fa bellard
  if [ "${aa}" = "yes" ] ; then
1203 49ecc3fa bellard
    echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1204 49ecc3fa bellard
  else
1205 49ecc3fa bellard
    echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1206 49ecc3fa bellard
  fi
1207 49ecc3fa bellard
fi
1208 49ecc3fa bellard
if test "$cocoa" = "yes" ; then
1209 4d3b6f6e balrog
  echo "#define CONFIG_COCOA 1" >> $config_h
1210 4d3b6f6e balrog
  echo "CONFIG_COCOA=yes" >> $config_mak
1211 4d3b6f6e balrog
fi
1212 4d3b6f6e balrog
if test "$curses" = "yes" ; then
1213 4d3b6f6e balrog
  echo "#define CONFIG_CURSES 1" >> $config_h
1214 4d3b6f6e balrog
  echo "CONFIG_CURSES=yes" >> $config_mak
1215 4d3b6f6e balrog
  echo "CURSES_LIBS=-lcurses" >> $config_mak
1216 49ecc3fa bellard
fi
1217 2e4d9fb1 aurel32
if test "$brlapi" = "yes" ; then
1218 2e4d9fb1 aurel32
  echo "CONFIG_BRLAPI=yes" >> $config_mak
1219 2e4d9fb1 aurel32
  echo "#define CONFIG_BRLAPI 1" >> $config_h
1220 2e4d9fb1 aurel32
  echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1221 2e4d9fb1 aurel32
fi
1222 414f0dab blueswir1
if test "$aio" = "yes" ; then
1223 414f0dab blueswir1
  echo "#define CONFIG_AIO 1" >> $config_h
1224 a3392f9b aliguori
  echo "CONFIG_AIO=yes" >> $config_mak
1225 414f0dab blueswir1
fi
1226 97a847bc bellard
1227 83fb7adf bellard
# XXX: suppress that
1228 7d3505c5 bellard
if [ "$bsd" = "yes" ] ; then
1229 43003046 bellard
  echo "#define O_LARGEFILE 0" >> $config_h
1230 43003046 bellard
  echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
1231 7d3505c5 bellard
  echo "#define _BSD 1" >> $config_h
1232 7d3505c5 bellard
fi
1233 7d3505c5 bellard
1234 c5937220 pbrook
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1235 c5937220 pbrook
1236 c39e3338 pbrook
tools=
1237 c39e3338 pbrook
if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1238 c39e3338 pbrook
  tools="qemu-img\$(EXESUF) $tools"
1239 7a5ca864 bellard
  if [ "$linux" = "yes" ] ; then
1240 7a5ca864 bellard
      tools="qemu-nbd\$(EXESUF) $tools"
1241 7a5ca864 bellard
  fi
1242 c39e3338 pbrook
fi
1243 c39e3338 pbrook
echo "TOOLS=$tools" >> $config_mak
1244 c39e3338 pbrook
1245 15d9ca0f ths
test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1246 15d9ca0f ths
1247 1d14ffa9 bellard
for target in $target_list; do
1248 97a847bc bellard
target_dir="$target"
1249 97a847bc bellard
config_mak=$target_dir/config.mak
1250 97a847bc bellard
config_h=$target_dir/config.h
1251 97a847bc bellard
target_cpu=`echo $target | cut -d '-' -f 1`
1252 97a847bc bellard
target_bigendian="no"
1253 808c4954 bellard
[ "$target_cpu" = "armeb" ] && target_bigendian=yes
1254 0938cda5 aurel32
[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1255 0938cda5 aurel32
[ "$target_cpu" = "mips" ] && target_bigendian=yes
1256 0938cda5 aurel32
[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1257 0938cda5 aurel32
[ "$target_cpu" = "mips64" ] && target_bigendian=yes
1258 67867308 bellard
[ "$target_cpu" = "ppc" ] && target_bigendian=yes
1259 d4082e95 j_mayer
[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
1260 22f8a8b3 j_mayer
[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
1261 e85e7c6e j_mayer
[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
1262 908f52b0 pbrook
[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
1263 0938cda5 aurel32
[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1264 0938cda5 aurel32
[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1265 0938cda5 aurel32
[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
1266 97a847bc bellard
target_softmmu="no"
1267 997344f3 bellard
target_user_only="no"
1268 831b7825 ths
target_linux_user="no"
1269 831b7825 ths
target_darwin_user="no"
1270 9e407a85 pbrook
case "$target" in
1271 9e407a85 pbrook
  ${target_cpu}-softmmu)
1272 9e407a85 pbrook
    target_softmmu="yes"
1273 9e407a85 pbrook
    ;;
1274 9e407a85 pbrook
  ${target_cpu}-linux-user)
1275 9e407a85 pbrook
    target_user_only="yes"
1276 9e407a85 pbrook
    target_linux_user="yes"
1277 9e407a85 pbrook
    ;;
1278 9e407a85 pbrook
  ${target_cpu}-darwin-user)
1279 9e407a85 pbrook
    target_user_only="yes"
1280 9e407a85 pbrook
    target_darwin_user="yes"
1281 9e407a85 pbrook
    ;;
1282 9e407a85 pbrook
  *)
1283 9e407a85 pbrook
    echo "ERROR: Target '$target' not recognised"
1284 9e407a85 pbrook
    exit 1
1285 9e407a85 pbrook
    ;;
1286 9e407a85 pbrook
esac
1287 831b7825 ths
1288 97ccc689 bellard
if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
1289 1d14ffa9 bellard
        -a "$sdl" = "no" -a "$cocoa" = "no" ; then
1290 97ccc689 bellard
    echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
1291 9c038506 pbrook
    echo "To build QEMU without graphical output configure with --disable-gfx-check"
1292 4d3b6f6e balrog
    echo "Note that this will disable all output from the virtual graphics card"
1293 4d3b6f6e balrog
    echo "except through VNC or curses."
1294 97ccc689 bellard
    exit 1;
1295 97ccc689 bellard
fi
1296 97ccc689 bellard
1297 7c1f25b4 bellard
#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
1298 97a847bc bellard
1299 15d9ca0f ths
test -f $config_h && mv $config_h ${config_h}~
1300 15d9ca0f ths
1301 97a847bc bellard
mkdir -p $target_dir
1302 158142c2 bellard
mkdir -p $target_dir/fpu
1303 57fec1fe bellard
mkdir -p $target_dir/tcg
1304 831b7825 ths
if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
1305 69de927c bellard
  mkdir -p $target_dir/nwfpe
1306 69de927c bellard
fi
1307 69de927c bellard
1308 ec530c81 bellard
#
1309 ec530c81 bellard
# don't use ln -sf as not all "ln -sf" over write the file/link
1310 ec530c81 bellard
#
1311 ec530c81 bellard
rm -f $target_dir/Makefile
1312 ec530c81 bellard
ln -s $source_path/Makefile.target $target_dir/Makefile
1313 ec530c81 bellard
1314 97a847bc bellard
1315 97a847bc bellard
echo "# Automatically generated by configure - do not modify" > $config_mak
1316 97a847bc bellard
echo "/* Automatically generated by configure - do not modify */" > $config_h
1317 97a847bc bellard
1318 de83cd02 bellard
1319 97a847bc bellard
echo "include ../config-host.mak" >> $config_mak
1320 97a847bc bellard
echo "#include \"../config-host.h\"" >> $config_h
1321 1e43adfc bellard
1322 e5fe0c52 pbrook
bflt="no"
1323 cb33da57 blueswir1
elfload32="no"
1324 bd0c5661 pbrook
target_nptl="no"
1325 1e43adfc bellard
interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1326 1e43adfc bellard
echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
1327 97a847bc bellard
1328 2408a527 aurel32
case "$target_cpu" in
1329 2408a527 aurel32
  i386)
1330 2408a527 aurel32
    echo "TARGET_ARCH=i386" >> $config_mak
1331 2408a527 aurel32
    echo "#define TARGET_ARCH \"i386\"" >> $config_h
1332 2408a527 aurel32
    echo "#define TARGET_I386 1" >> $config_h
1333 da260249 bellard
    if test $kqemu = "yes" -a "$target_softmmu" = "yes"
1334 2408a527 aurel32
    then
1335 2408a527 aurel32
      echo "#define USE_KQEMU 1" >> $config_h
1336 2408a527 aurel32
    fi
1337 f2bf094e aurel32
    gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
1338 11d1fdb0 pbrook
    if test -n "$gcc3minver" && test $gcc3minver -gt 3
1339 f2bf094e aurel32
    then
1340 f2bf094e aurel32
      echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1341 f2bf094e aurel32
    else
1342 f2bf094e aurel32
      echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1343 f2bf094e aurel32
    fi
1344 2408a527 aurel32
  ;;
1345 2408a527 aurel32
  x86_64)
1346 2408a527 aurel32
    echo "TARGET_ARCH=x86_64" >> $config_mak
1347 2408a527 aurel32
    echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1348 2408a527 aurel32
    echo "#define TARGET_I386 1" >> $config_h
1349 2408a527 aurel32
    echo "#define TARGET_X86_64 1" >> $config_h
1350 2408a527 aurel32
    if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1351 2408a527 aurel32
    then
1352 2408a527 aurel32
      echo "#define USE_KQEMU 1" >> $config_h
1353 2408a527 aurel32
    fi
1354 2408a527 aurel32
  ;;
1355 2408a527 aurel32
  alpha)
1356 2408a527 aurel32
    echo "TARGET_ARCH=alpha" >> $config_mak
1357 bf6247fb blueswir1
    echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1358 2408a527 aurel32
    echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1359 2408a527 aurel32
    echo "#define TARGET_ALPHA 1" >> $config_h
1360 bf6247fb blueswir1
    echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1361 2408a527 aurel32
  ;;
1362 2408a527 aurel32
  arm|armeb)
1363 2408a527 aurel32
    echo "TARGET_ARCH=arm" >> $config_mak
1364 2408a527 aurel32
    echo "#define TARGET_ARCH \"arm\"" >> $config_h
1365 2408a527 aurel32
    echo "#define TARGET_ARM 1" >> $config_h
1366 2408a527 aurel32
    bflt="yes"
1367 bd0c5661 pbrook
    target_nptl="yes"
1368 2408a527 aurel32
  ;;
1369 2408a527 aurel32
  cris)
1370 2408a527 aurel32
    echo "TARGET_ARCH=cris" >> $config_mak
1371 2408a527 aurel32
    echo "#define TARGET_ARCH \"cris\"" >> $config_h
1372 2408a527 aurel32
    echo "#define TARGET_CRIS 1" >> $config_h
1373 2408a527 aurel32
  ;;
1374 2408a527 aurel32
  m68k)
1375 2408a527 aurel32
    echo "TARGET_ARCH=m68k" >> $config_mak
1376 2408a527 aurel32
    echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1377 2408a527 aurel32
    echo "#define TARGET_M68K 1" >> $config_h
1378 2408a527 aurel32
    bflt="yes"
1379 2408a527 aurel32
  ;;
1380 2408a527 aurel32
  mips|mipsel)
1381 2408a527 aurel32
    echo "TARGET_ARCH=mips" >> $config_mak
1382 2408a527 aurel32
    echo "#define TARGET_ARCH \"mips\"" >> $config_h
1383 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1384 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1385 2408a527 aurel32
  ;;
1386 2408a527 aurel32
  mipsn32|mipsn32el)
1387 2408a527 aurel32
    echo "TARGET_ARCH=mipsn32" >> $config_mak
1388 2408a527 aurel32
    echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1389 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1390 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1391 2408a527 aurel32
  ;;
1392 2408a527 aurel32
  mips64|mips64el)
1393 2408a527 aurel32
    echo "TARGET_ARCH=mips64" >> $config_mak
1394 2408a527 aurel32
    echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1395 2408a527 aurel32
    echo "#define TARGET_MIPS 1" >> $config_h
1396 2408a527 aurel32
    echo "#define TARGET_MIPS64 1" >> $config_h
1397 2408a527 aurel32
    echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1398 2408a527 aurel32
  ;;
1399 2408a527 aurel32
  ppc)
1400 2408a527 aurel32
    echo "TARGET_ARCH=ppc" >> $config_mak
1401 bf6247fb blueswir1
    echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1402 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1403 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1404 bf6247fb blueswir1
    echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1405 2408a527 aurel32
  ;;
1406 2408a527 aurel32
  ppcemb)
1407 2408a527 aurel32
    echo "TARGET_ARCH=ppcemb" >> $config_mak
1408 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1409 bf6247fb blueswir1
    echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1410 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1411 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1412 2408a527 aurel32
    echo "#define TARGET_PPCEMB 1" >> $config_h
1413 ec5b78cd blueswir1
    echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1414 2408a527 aurel32
  ;;
1415 2408a527 aurel32
  ppc64)
1416 2408a527 aurel32
    echo "TARGET_ARCH=ppc64" >> $config_mak
1417 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1418 bf6247fb blueswir1
    echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1419 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1420 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1421 2408a527 aurel32
    echo "#define TARGET_PPC64 1" >> $config_h
1422 bf6247fb blueswir1
    echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1423 2408a527 aurel32
  ;;
1424 2408a527 aurel32
  ppc64abi32)
1425 2408a527 aurel32
    echo "TARGET_ARCH=ppc64" >> $config_mak
1426 2408a527 aurel32
    echo "TARGET_ABI_DIR=ppc" >> $config_mak
1427 2408a527 aurel32
    echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1428 bf6247fb blueswir1
    echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
1429 2408a527 aurel32
    echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1430 2408a527 aurel32
    echo "#define TARGET_PPC 1" >> $config_h
1431 2408a527 aurel32
    echo "#define TARGET_PPC64 1" >> $config_h
1432 2408a527 aurel32
    echo "#define TARGET_ABI32 1" >> $config_h
1433 bf6247fb blueswir1
    echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
1434 2408a527 aurel32
  ;;
1435 2408a527 aurel32
  sh4|sh4eb)
1436 2408a527 aurel32
    echo "TARGET_ARCH=sh4" >> $config_mak
1437 2408a527 aurel32
    echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1438 2408a527 aurel32
    echo "#define TARGET_SH4 1" >> $config_h
1439 2408a527 aurel32
    bflt="yes"
1440 2408a527 aurel32
  ;;
1441 2408a527 aurel32
  sparc)
1442 2408a527 aurel32
    echo "TARGET_ARCH=sparc" >> $config_mak
1443 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1444 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1445 2408a527 aurel32
  ;;
1446 2408a527 aurel32
  sparc64)
1447 2408a527 aurel32
    echo "TARGET_ARCH=sparc64" >> $config_mak
1448 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1449 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1450 2408a527 aurel32
    echo "#define TARGET_SPARC64 1" >> $config_h
1451 2408a527 aurel32
    elfload32="yes"
1452 2408a527 aurel32
  ;;
1453 2408a527 aurel32
  sparc32plus)
1454 2408a527 aurel32
    echo "TARGET_ARCH=sparc64" >> $config_mak
1455 2408a527 aurel32
    echo "TARGET_ABI_DIR=sparc" >> $config_mak
1456 2408a527 aurel32
    echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1457 2408a527 aurel32
    echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1458 2408a527 aurel32
    echo "#define TARGET_SPARC 1" >> $config_h
1459 2408a527 aurel32
    echo "#define TARGET_SPARC64 1" >> $config_h
1460 2408a527 aurel32
    echo "#define TARGET_ABI32 1" >> $config_h
1461 2408a527 aurel32
  ;;
1462 2408a527 aurel32
  *)
1463 2408a527 aurel32
    echo "Unsupported target CPU"
1464 2408a527 aurel32
    exit 1
1465 2408a527 aurel32
  ;;
1466 2408a527 aurel32
esac
1467 de83cd02 bellard
if test "$target_bigendian" = "yes" ; then
1468 97a847bc bellard
  echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1469 97a847bc bellard
  echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1470 de83cd02 bellard
fi
1471 97a847bc bellard
if test "$target_softmmu" = "yes" ; then
1472 97a847bc bellard
  echo "CONFIG_SOFTMMU=yes" >> $config_mak
1473 97a847bc bellard
  echo "#define CONFIG_SOFTMMU 1" >> $config_h
1474 43ce4dfe bellard
fi
1475 997344f3 bellard
if test "$target_user_only" = "yes" ; then
1476 997344f3 bellard
  echo "CONFIG_USER_ONLY=yes" >> $config_mak
1477 997344f3 bellard
  echo "#define CONFIG_USER_ONLY 1" >> $config_h
1478 997344f3 bellard
fi
1479 831b7825 ths
if test "$target_linux_user" = "yes" ; then
1480 831b7825 ths
  echo "CONFIG_LINUX_USER=yes" >> $config_mak
1481 831b7825 ths
  echo "#define CONFIG_LINUX_USER 1" >> $config_h
1482 831b7825 ths
fi
1483 831b7825 ths
if test "$target_darwin_user" = "yes" ; then
1484 831b7825 ths
  echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1485 831b7825 ths
  echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1486 831b7825 ths
fi
1487 97a847bc bellard
1488 0938cda5 aurel32
if test "$target_cpu" = "arm" \
1489 0938cda5 aurel32
     -o "$target_cpu" = "armeb" \
1490 0938cda5 aurel32
     -o "$target_cpu" = "m68k" \
1491 0938cda5 aurel32
     -o "$target_cpu" = "mips" \
1492 0938cda5 aurel32
     -o "$target_cpu" = "mipsel" \
1493 0938cda5 aurel32
     -o "$target_cpu" = "mipsn32" \
1494 0938cda5 aurel32
     -o "$target_cpu" = "mipsn32el" \
1495 0938cda5 aurel32
     -o "$target_cpu" = "mips64" \
1496 0938cda5 aurel32
     -o "$target_cpu" = "mips64el" \
1497 0938cda5 aurel32
     -o "$target_cpu" = "sparc" \
1498 0938cda5 aurel32
     -o "$target_cpu" = "sparc64" \
1499 0938cda5 aurel32
     -o "$target_cpu" = "sparc32plus"; then
1500 158142c2 bellard
  echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1501 158142c2 bellard
  echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1502 158142c2 bellard
fi
1503 e5fe0c52 pbrook
if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1504 e5fe0c52 pbrook
  echo "TARGET_HAS_BFLT=yes" >> $config_mak
1505 e5fe0c52 pbrook
  echo "#define TARGET_HAS_BFLT 1" >> $config_h
1506 e5fe0c52 pbrook
fi
1507 bd0c5661 pbrook
if test "$target_user_only" = "yes" \
1508 bd0c5661 pbrook
        -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1509 bd0c5661 pbrook
  echo "#define USE_NPTL 1" >> $config_h
1510 bd0c5661 pbrook
fi
1511 cb33da57 blueswir1
# 32 bit ELF loader in addition to native 64 bit loader?
1512 cb33da57 blueswir1
if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1513 cb33da57 blueswir1
  echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1514 cb33da57 blueswir1
  echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1515 cb33da57 blueswir1
fi
1516 5b0753e0 bellard
1517 15d9ca0f ths
test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1518 15d9ca0f ths
1519 97a847bc bellard
done # for target in $targets
1520 7d13299d bellard
1521 7d13299d bellard
# build tree in object directory if source path is different from current one
1522 7d13299d bellard
if test "$source_path_used" = "yes" ; then
1523 49ecc3fa bellard
    DIRS="tests tests/cris slirp audio"
1524 7d13299d bellard
    FILES="Makefile tests/Makefile"
1525 e7daa605 ths
    FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
1526 e1ffb0f1 edgar_igl
    FILES="$FILES tests/test-mmap.c"
1527 7d13299d bellard
    for dir in $DIRS ; do
1528 7d13299d bellard
            mkdir -p $dir
1529 7d13299d bellard
    done
1530 ec530c81 bellard
    # remove the link and recreate it, as not all "ln -sf" overwrite the link
1531 7d13299d bellard
    for f in $FILES ; do
1532 ec530c81 bellard
        rm -f $f
1533 ec530c81 bellard
        ln -s $source_path/$f $f
1534 7d13299d bellard
    done
1535 7d13299d bellard
fi
1536 7d13299d bellard
1537 97a847bc bellard
rm -f $TMPO $TMPC $TMPE $TMPS