Statistics
| Branch: | Revision:

root / configure @ 61c04807

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