Statistics
| Branch: | Revision:

root / configure @ 4f26a486

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