Statistics
| Branch: | Revision:

root / configure @ f54b3f92

History | View | Annotate | Download (38.4 kB)

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