blob: efecd20c4208805e4e57ab56a3316e33147a7c4c [file] [log] [blame]
bellard7d132992003-03-06 23:23:54 +00001#!/bin/sh
2#
bellard3ef693a2003-03-23 20:17:16 +00003# qemu configure script (c) 2003 Fabrice Bellard
bellard7d132992003-03-06 23:23:54 +00004#
5# set temporary file name
6if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10else
11 TMPDIR1="/tmp"
12fi
13
bellard3ef693a2003-03-23 20:17:16 +000014TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
bellard7d132992003-03-06 23:23:54 +000018
19# default parameters
bellard11d9f692004-04-02 20:55:59 +000020prefix=""
bellard1e43adf2003-09-30 20:54:24 +000021interp_prefix="/usr/gnemul/qemu-%M"
bellard43ce4df2003-06-09 19:53:12 +000022static="no"
bellard7d132992003-03-06 23:23:54 +000023cross_prefix=""
24cc="gcc"
pbrook328a4242006-12-19 03:31:34 +000025gcc3_search="yes"
balrogfe8f78e2007-10-31 01:03:28 +000026gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
bellard7d132992003-03-06 23:23:54 +000027host_cc="gcc"
28ar="ar"
29make="make"
pbrook6a882642006-04-17 13:57:12 +000030install="install"
bellard7d132992003-03-06 23:23:54 +000031strip="strip"
32cpu=`uname -m`
bellard5327cf42005-01-10 23:18:50 +000033target_list=""
bellard7d132992003-03-06 23:23:54 +000034case "$cpu" in
35 i386|i486|i586|i686|i86pc|BePC)
bellard97a847b2003-08-10 21:36:04 +000036 cpu="i386"
bellard7d132992003-03-06 23:23:54 +000037 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000038 x86_64|amd64)
39 cpu="x86_64"
40 ;;
41 alpha)
42 cpu="alpha"
43 ;;
bellardba680552005-03-13 09:49:52 +000044 armv*b)
bellard808c4952004-12-19 23:33:47 +000045 cpu="armv4b"
46 ;;
bellardba680552005-03-13 09:49:52 +000047 armv*l)
bellard7d132992003-03-06 23:23:54 +000048 cpu="armv4l"
49 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000050 cris)
51 cpu="cris"
bellard7d132992003-03-06 23:23:54 +000052 ;;
aurel32f54b3f92008-04-12 20:14:54 +000053 parisc|parisc64)
54 cpu="hppa"
55 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000056 ia64)
57 cpu="ia64"
58 ;;
59 m68k)
60 cpu="m68k"
bellard7d132992003-03-06 23:23:54 +000061 ;;
62 mips)
63 cpu="mips"
64 ;;
thsfbe4f652007-04-01 11:16:48 +000065 mips64)
66 cpu="mips64"
67 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000068 "Power Macintosh"|ppc|ppc64)
69 cpu="powerpc"
thse7daa602007-10-08 13:38:27 +000070 ;;
ths0e7b8a92007-08-01 00:09:31 +000071 s390*)
bellardfb3e5842003-03-29 17:32:36 +000072 cpu="s390"
73 ;;
blueswir131422552007-04-16 18:27:06 +000074 sparc|sun4[cdmuv])
bellardae228532003-05-13 18:59:59 +000075 cpu="sparc"
76 ;;
77 sparc64)
78 cpu="sparc64"
79 ;;
bellard7d132992003-03-06 23:23:54 +000080 *)
81 cpu="unknown"
82 ;;
83esac
84gprof="no"
85bigendian="no"
bellard67b915a2004-03-31 23:37:16 +000086mingw32="no"
87EXESUF=""
88gdbstub="yes"
bellard443f1372004-06-04 11:13:20 +000089slirp="yes"
bellardfb065182004-11-09 23:09:44 +000090adlib="no"
balroge5c9a132008-01-14 04:27:55 +000091ac97="no"
balrog423d65f2008-01-14 22:09:11 +000092gus="no"
malccc53d262008-06-13 10:48:22 +000093cs4231a="no"
bellardfb065182004-11-09 23:09:44 +000094oss="no"
bellard1d14ffa2005-10-30 18:58:22 +000095dsound="no"
96coreaudio="no"
97alsa="no"
balrogca9cc282008-01-14 04:24:29 +000098esd="no"
bellard102a52e2004-11-14 19:57:29 +000099fmod="no"
100fmod_lib=""
101fmod_inc=""
ths8d5d2d42007-08-25 01:37:51 +0000102vnc_tls="yes"
pbrookb1a550a2006-04-16 13:28:56 +0000103bsd="no"
bellard5327cf42005-01-10 23:18:50 +0000104linux="no"
bellardc9ec1fe2005-02-10 21:55:30 +0000105kqemu="no"
bellard05c2a3e2006-02-08 22:39:17 +0000106profiler="no"
bellard5b0753e2005-03-01 21:37:28 +0000107cocoa="no"
bellard97ccc682005-07-02 13:32:17 +0000108check_gfx="yes"
bellard1aff3812005-11-02 22:30:45 +0000109check_gcc="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000110softmmu="yes"
ths831b7822007-01-18 20:06:33 +0000111linux_user="no"
112darwin_user="no"
pbrookcc8ae6d2006-04-23 17:57:59 +0000113build_docs="no"
pbrookc5937222006-05-14 11:30:38 +0000114uname_release=""
balrog4d3b6f62008-02-10 16:33:14 +0000115curses="yes"
pbrookbd0c5662008-05-29 14:34:11 +0000116nptl="yes"
malc8ff9cbf2008-06-23 18:33:30 +0000117mixemu="no"
bellard7d132992003-03-06 23:23:54 +0000118
119# OS specific
120targetos=`uname -s`
121case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000122CYGWIN*)
123mingw32="yes"
ths6f30fa82007-01-05 01:00:47 +0000124OS_CFLAGS="-mno-cygwin"
thsdb8d7dd2007-07-12 09:29:18 +0000125if [ "$cpu" = "i386" ] ; then
126 kqemu="yes"
127fi
bellardc326e0a2005-04-23 18:30:28 +0000128;;
bellard67b915a2004-03-31 23:37:16 +0000129MINGW32*)
130mingw32="yes"
thsdb8d7dd2007-07-12 09:29:18 +0000131if [ "$cpu" = "i386" ] ; then
132 kqemu="yes"
133fi
bellard67b915a2004-03-31 23:37:16 +0000134;;
ths5c40d2b2007-06-23 16:03:36 +0000135GNU/kFreeBSD)
136oss="yes"
137if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
138 kqemu="yes"
139fi
140;;
bellard7d3505c2004-05-12 19:32:15 +0000141FreeBSD)
142bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000143oss="yes"
bellarde99f9062005-07-28 21:45:38 +0000144if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000145 kqemu="yes"
146fi
bellard7d3505c2004-05-12 19:32:15 +0000147;;
148NetBSD)
149bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000150oss="yes"
bellard7d3505c2004-05-12 19:32:15 +0000151;;
152OpenBSD)
153bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000154oss="yes"
bellard7d3505c2004-05-12 19:32:15 +0000155;;
bellard83fb7ad2004-07-05 21:25:26 +0000156Darwin)
157bsd="yes"
158darwin="yes"
ths831b7822007-01-18 20:06:33 +0000159darwin_user="yes"
thsfd677642007-01-31 12:10:07 +0000160cocoa="yes"
161coreaudio="yes"
ths6f30fa82007-01-05 01:00:47 +0000162OS_CFLAGS="-mdynamic-no-pic"
thsc2c59c32008-01-08 00:00:20 +0000163OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
bellard83fb7ad2004-07-05 21:25:26 +0000164;;
bellardec530c82006-04-25 22:36:06 +0000165SunOS)
thsc2b84fa2007-02-10 23:21:21 +0000166 solaris="yes"
167 make="gmake"
168 install="ginstall"
ths0475a5c2007-04-01 18:54:44 +0000169 needs_libsunmath="no"
thsc2b84fa2007-02-10 23:21:21 +0000170 solarisrev=`uname -r | cut -f2 -d.`
thsef18c882007-09-16 22:12:39 +0000171 # have to select again, because `uname -m` returns i86pc
172 # even on an x86_64 box.
173 solariscpu=`isainfo -k`
174 if test "${solariscpu}" = "amd64" ; then
175 cpu="x86_64"
176 fi
thsc2b84fa2007-02-10 23:21:21 +0000177 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
ths0475a5c2007-04-01 18:54:44 +0000178 if test "$solarisrev" -le 9 ; then
179 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
180 needs_libsunmath="yes"
181 else
182 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
183 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
184 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
185 echo "Studio 11 can be downloaded from www.sun.com."
186 exit 1
187 fi
188 fi
189 if test "$solarisrev" -ge 9 ; then
thsc2b84fa2007-02-10 23:21:21 +0000190 kqemu="yes"
191 fi
ths86b2bd92007-02-11 00:31:33 +0000192 fi
ths6b4d2ba2007-05-13 18:02:43 +0000193 if test -f /usr/include/sys/soundcard.h ; then
194 oss=yes
195 fi
ths86b2bd92007-02-11 00:31:33 +0000196;;
bellard1d14ffa2005-10-30 18:58:22 +0000197*)
bellardfb065182004-11-09 23:09:44 +0000198oss="yes"
bellard5327cf42005-01-10 23:18:50 +0000199linux="yes"
ths831b7822007-01-18 20:06:33 +0000200linux_user="yes"
bellard07f4ddb2005-04-23 17:44:28 +0000201if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000202 kqemu="yes"
203fi
bellardfb065182004-11-09 23:09:44 +0000204;;
bellard7d132992003-03-06 23:23:54 +0000205esac
206
bellard7d3505c2004-05-12 19:32:15 +0000207if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000208 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000209 make="gmake"
210 fi
bellard7d3505c2004-05-12 19:32:15 +0000211fi
212
bellard7d132992003-03-06 23:23:54 +0000213# find source path
pbrookad064842006-04-16 12:41:07 +0000214source_path=`dirname "$0"`
balrog59faef32008-02-03 04:22:24 +0000215source_path_used="no"
216workdir=`pwd`
pbrookad064842006-04-16 12:41:07 +0000217if [ -z "$source_path" ]; then
balrog59faef32008-02-03 04:22:24 +0000218 source_path=$workdir
pbrookad064842006-04-16 12:41:07 +0000219else
220 source_path=`cd "$source_path"; pwd`
bellard7d132992003-03-06 23:23:54 +0000221fi
pbrook724db112008-02-03 19:20:13 +0000222[ -f "$workdir/vl.c" ] || source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000223
bellard85aa5182007-11-11 20:17:03 +0000224werror="no"
bellard0d1e2392007-11-11 20:24:30 +0000225# generate compile errors on warnings for development builds
226#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
227#werror="yes";
228#fi
bellard85aa5182007-11-11 20:17:03 +0000229
bellard7d132992003-03-06 23:23:54 +0000230for opt do
pbrooka46e4032006-04-29 23:05:22 +0000231 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000232 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000233 --help|-h) show_help=yes
234 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000235 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000236 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000237 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000238 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000239 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000240 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000241 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000242 --cross-prefix=*) cross_prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000243 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000244 --cc=*) cc="$optarg"
pbrook328a4242006-12-19 03:31:34 +0000245 gcc3_search="no"
bellard7d132992003-03-06 23:23:54 +0000246 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000247 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000248 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000249 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000250 ;;
pbrook6a882642006-04-17 13:57:12 +0000251 --install=*) install="$optarg"
252 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000253 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000254 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000255 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000256 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000257 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000258 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000259 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000260 ;;
bellard7d132992003-03-06 23:23:54 +0000261 --enable-gprof) gprof="yes"
262 ;;
bellard43ce4df2003-06-09 19:53:12 +0000263 --static) static="yes"
264 ;;
bellard97a847b2003-08-10 21:36:04 +0000265 --disable-sdl) sdl="no"
266 ;;
bellard1d14ffa2005-10-30 18:58:22 +0000267 --enable-coreaudio) coreaudio="yes"
268 ;;
269 --enable-alsa) alsa="yes"
270 ;;
balrogca9cc282008-01-14 04:24:29 +0000271 --enable-esd) esd="yes"
272 ;;
bellard1d14ffa2005-10-30 18:58:22 +0000273 --enable-dsound) dsound="yes"
274 ;;
bellard102a52e2004-11-14 19:57:29 +0000275 --enable-fmod) fmod="yes"
276 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000277 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000278 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000279 --fmod-inc=*) fmod_inc="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000280 ;;
ths8d5d2d42007-08-25 01:37:51 +0000281 --disable-vnc-tls) vnc_tls="no"
282 ;;
bellardb93aebe2007-02-15 22:58:18 +0000283 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
bellard1d14ffa2005-10-30 18:58:22 +0000284 ;;
bellard443f1372004-06-04 11:13:20 +0000285 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000286 ;;
bellardfb065182004-11-09 23:09:44 +0000287 --enable-adlib) adlib="yes"
bellard1d14ffa2005-10-30 18:58:22 +0000288 ;;
balroge5c9a132008-01-14 04:27:55 +0000289 --enable-ac97) ac97="yes"
290 ;;
balrog423d65f2008-01-14 22:09:11 +0000291 --enable-gus) gus="yes"
292 ;;
malccc53d262008-06-13 10:48:22 +0000293 --enable-cs4231a) cs4231a="yes"
294 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000295 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000296 ;;
aurel322e4d9fb2008-04-08 06:01:02 +0000297 --disable-brlapi) brlapi="no"
298 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000299 --enable-profiler) profiler="yes"
300 ;;
bellard1d14ffa2005-10-30 18:58:22 +0000301 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
302 ;;
bellard97ccc682005-07-02 13:32:17 +0000303 --disable-gfx-check) check_gfx="no"
304 ;;
bellard1aff3812005-11-02 22:30:45 +0000305 --disable-gcc-check) check_gcc="no"
306 ;;
pbrookcad25d62006-03-19 16:31:11 +0000307 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000308 ;;
pbrookcad25d62006-03-19 16:31:11 +0000309 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000310 ;;
ths831b7822007-01-18 20:06:33 +0000311 --disable-linux-user) linux_user="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000312 ;;
ths831b7822007-01-18 20:06:33 +0000313 --enable-linux-user) linux_user="yes"
314 ;;
315 --disable-darwin-user) darwin_user="no"
316 ;;
317 --enable-darwin-user) darwin_user="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000318 ;;
pbrookc5937222006-05-14 11:30:38 +0000319 --enable-uname-release=*) uname_release="$optarg"
320 ;;
blueswir131422552007-04-16 18:27:06 +0000321 --sparc_cpu=*)
322 sparc_cpu="$optarg"
323 case $sparc_cpu in
324 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
325 target_cpu="sparc"; cpu="sparc" ;;
326 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
327 target_cpu="sparc"; cpu="sparc" ;;
328 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
329 target_cpu="sparc64"; cpu="sparc64" ;;
330 *) echo "undefined SPARC architecture. Exiting";exit 1;;
331 esac
332 ;;
bellard85aa5182007-11-11 20:17:03 +0000333 --enable-werror) werror="yes"
334 ;;
335 --disable-werror) werror="no"
336 ;;
balrog4d3b6f62008-02-10 16:33:14 +0000337 --disable-curses) curses="no"
338 ;;
pbrookbd0c5662008-05-29 14:34:11 +0000339 --disable-nptl) nptl="no"
340 ;;
malc8ff9cbf2008-06-23 18:33:30 +0000341 --enable-mixemu) mixemu="yes"
342 ;;
balrog7f1559c2007-11-17 10:24:32 +0000343 *) echo "ERROR: unknown option $opt"; show_help="yes"
344 ;;
bellard7d132992003-03-06 23:23:54 +0000345 esac
346done
347
ths209afb92007-03-25 20:55:00 +0000348if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
349 AIOLIBS=
350else
ths4259e1a2007-11-05 13:27:21 +0000351 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
352 AIOLIBS="-lrt -lpthread"
ths209afb92007-03-25 20:55:00 +0000353fi
354
ths6f30fa82007-01-05 01:00:47 +0000355# default flags for all hosts
356CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
357LDFLAGS="$LDFLAGS -g"
bellard85aa5182007-11-11 20:17:03 +0000358if test "$werror" = "yes" ; then
359CFLAGS="$CFLAGS -Werror"
360fi
ths6f30fa82007-01-05 01:00:47 +0000361
blueswir131422552007-04-16 18:27:06 +0000362#
363# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
364# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
365#
bellard40293e52008-01-31 11:32:10 +0000366case "$cpu" in
blueswir131422552007-04-16 18:27:06 +0000367 sparc) if test -z "$sparc_cpu" ; then
368 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
369 ARCH_LDFLAGS="-m32"
370 else
371 ARCH_CFLAGS="${SP_CFLAGS}"
372 ARCH_LDFLAGS="${SP_LDFLAGS}"
373 fi
374 ;;
375 sparc64) if test -z "$sparc_cpu" ; then
376 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
377 ARCH_LDFLAGS="-m64"
378 else
379 ARCH_CFLAGS="${SP_CFLAGS}"
380 ARCH_LDFLAGS="${SP_LDFLAGS}"
381 fi
382 ;;
ths76d83bd2007-11-18 21:22:10 +0000383 s390)
384 ARCH_CFLAGS="-march=z900"
385 ;;
bellard40293e52008-01-31 11:32:10 +0000386 i386)
387 ARCH_CFLAGS="-m32"
388 ARCH_LDFLAGS="-m32"
389 ;;
390 x86_64)
391 ARCH_CFLAGS="-m64"
392 ARCH_LDFLAGS="-m64"
393 ;;
blueswir131422552007-04-16 18:27:06 +0000394esac
395
pbrookaf5db582006-04-08 14:26:41 +0000396if test x"$show_help" = x"yes" ; then
397cat << EOF
398
399Usage: configure [options]
400Options: [defaults in brackets after descriptions]
401
402EOF
403echo "Standard options:"
404echo " --help print this message"
405echo " --prefix=PREFIX install in PREFIX [$prefix]"
406echo " --interp-prefix=PREFIX where to find shared libraries, etc."
407echo " use %M for cpu name [$interp_prefix]"
408echo " --target-list=LIST set target list [$target_list]"
409echo ""
410echo "kqemu kernel acceleration support:"
411echo " --disable-kqemu disable kqemu support"
pbrookaf5db582006-04-08 14:26:41 +0000412echo ""
413echo "Advanced options (experts only):"
414echo " --source-path=PATH path of source code [$source_path]"
415echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
416echo " --cc=CC use C compiler CC [$cc]"
417echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
418echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000419echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000420echo " --static enable static build [$static]"
bellard85aa5182007-11-11 20:17:03 +0000421echo " --disable-werror disable compilation abort on warning"
balrogfe8f78e2007-10-31 01:03:28 +0000422echo " --disable-sdl disable SDL"
pbrookaf5db582006-04-08 14:26:41 +0000423echo " --enable-cocoa enable COCOA (Mac OS X only)"
424echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
425echo " --enable-adlib enable Adlib emulation"
balroge5c9a132008-01-14 04:27:55 +0000426echo " --enable-ac97 enable AC97 emulation"
balrog423d65f2008-01-14 22:09:11 +0000427echo " --enable-gus enable Gravis Ultrasound emulation"
malccc53d262008-06-13 10:48:22 +0000428echo " --enable-cs4231a enable CS4231A emulation"
pbrookaf5db582006-04-08 14:26:41 +0000429echo " --enable-coreaudio enable Coreaudio audio driver"
430echo " --enable-alsa enable ALSA audio driver"
balrogca9cc282008-01-14 04:24:29 +0000431echo " --enable-esd enable EsoundD audio driver"
pbrookaf5db582006-04-08 14:26:41 +0000432echo " --enable-fmod enable FMOD audio driver"
thsed5065e2007-03-25 16:15:21 +0000433echo " --enable-dsound enable DirectSound audio driver"
malc8ff9cbf2008-06-23 18:33:30 +0000434echo " --enable-mixemu enable mixer emulation"
aurel322e4d9fb2008-04-08 06:01:02 +0000435echo " --disable-brlapi disable BrlAPI"
ths8d5d2d42007-08-25 01:37:51 +0000436echo " --disable-vnc-tls disable TLS encryption for VNC server"
pbrookaf896aa2008-03-23 00:47:42 +0000437echo " --disable-curses disable curses output"
pbrookbd0c5662008-05-29 14:34:11 +0000438echo " --disable-nptl disable usermode NPTL support"
pbrookaf5db582006-04-08 14:26:41 +0000439echo " --enable-system enable all system emulation targets"
440echo " --disable-system disable all system emulation targets"
ths831b7822007-01-18 20:06:33 +0000441echo " --enable-linux-user enable all linux usermode emulation targets"
442echo " --disable-linux-user disable all linux usermode emulation targets"
443echo " --enable-darwin-user enable all darwin usermode emulation targets"
444echo " --disable-darwin-user disable all darwin usermode emulation targets"
pbrookaf5db582006-04-08 14:26:41 +0000445echo " --fmod-lib path to FMOD library"
446echo " --fmod-inc path to FMOD includes"
pbrookc5937222006-05-14 11:30:38 +0000447echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
blueswir131422552007-04-16 18:27:06 +0000448echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
pbrookaf5db582006-04-08 14:26:41 +0000449echo ""
ths5bf08932006-12-23 00:33:26 +0000450echo "NOTE: The object files are built at the place where configure is launched"
pbrookaf5db582006-04-08 14:26:41 +0000451exit 1
452fi
453
bellard7d132992003-03-06 23:23:54 +0000454cc="${cross_prefix}${cc}"
455ar="${cross_prefix}${ar}"
456strip="${cross_prefix}${strip}"
457
pbrook064aae12006-05-08 00:51:44 +0000458# check that the C compiler works.
459cat > $TMPC <<EOF
460int main(void) {}
461EOF
462
pbrookdb7287e2008-02-03 16:27:13 +0000463if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
pbrook064aae12006-05-08 00:51:44 +0000464 : C compiler works ok
465else
466 echo "ERROR: \"$cc\" either does not exist or does not work"
467 exit 1
bellarda7350fa2006-04-23 14:35:23 +0000468fi
469
bellard67b915a2004-03-31 23:37:16 +0000470if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000471 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000472 EXESUF=".exe"
bellard9f059ec2004-11-14 18:59:52 +0000473 oss="no"
bellard67b915a2004-03-31 23:37:16 +0000474fi
475
ths5fafdf22007-09-16 21:08:06 +0000476# Check for gcc4, error if pre-gcc4
pbrook328a4242006-12-19 03:31:34 +0000477if test "$check_gcc" = "yes" ; then
478 cat > $TMPC <<EOF
479#if __GNUC__ < 4
480#error gcc3
481#endif
482int main(){return 0;}
483EOF
pbrookdb7287e2008-02-03 16:27:13 +0000484 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook328a4242006-12-19 03:31:34 +0000485 echo "WARNING: \"$cc\" looks like gcc 4.x"
486 found_compat_cc="no"
487 if test "$gcc3_search" = "yes" ; then
488 echo "Looking for gcc 3.x"
489 for compat_cc in $gcc3_list ; do
balrogd4af3de2007-07-26 20:41:46 +0000490 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
pbrook328a4242006-12-19 03:31:34 +0000491 echo "Found \"$compat_cc\""
pbrook11244262007-02-27 01:03:41 +0000492 cc="$cross_prefix$compat_cc"
pbrook328a4242006-12-19 03:31:34 +0000493 found_compat_cc="yes"
494 break
495 fi
496 done
497 if test "$found_compat_cc" = "no" ; then
498 echo "gcc 3.x not found!"
499 fi
500 fi
501 if test "$found_compat_cc" = "no" ; then
502 echo "QEMU is known to have problems when compiled with gcc 4.x"
503 echo "It is recommended that you use gcc 3.x to build QEMU"
504 echo "To use this compiler anyway, configure with --disable-gcc-check"
505 exit 1;
506 fi
507 fi
508fi
509
bellardec530c82006-04-25 22:36:06 +0000510#
511# Solaris specific configure tool chain decisions
512#
513if test "$solaris" = "yes" ; then
514 #
515 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
516 # override the check with --disable-gcc-check
ths5fafdf22007-09-16 21:08:06 +0000517 #
bellardec530c82006-04-25 22:36:06 +0000518 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
519 solgcc=`which $cc`
520 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
521 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
522 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
523 echo "or get the latest patch from SunSolve for gcc"
524 exit 1
525 fi
526 fi
527 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
528 if test -z "$solinst" ; then
529 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
530 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
531 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
532 exit 1
533 fi
534 if test "$solinst" = "/usr/sbin/install" ; then
535 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
536 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
537 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
538 exit 1
539 fi
bellardec530c82006-04-25 22:36:06 +0000540 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
541 if test -z "$sol_ar" ; then
542 echo "Error: No path includes ar"
543 if test -f /usr/ccs/bin/ar ; then
544 echo "Add /usr/ccs/bin to your path and rerun configure"
545 fi
546 exit 1
547 fi
ths5fafdf22007-09-16 21:08:06 +0000548fi
bellardec530c82006-04-25 22:36:06 +0000549
550
bellard5327cf42005-01-10 23:18:50 +0000551if test -z "$target_list" ; then
552# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000553 if [ "$softmmu" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000554 target_list="\
555i386-softmmu \
556x86_64-softmmu \
557arm-softmmu \
558cris-softmmu \
559m68k-softmmu \
560mips-softmmu \
561mipsel-softmmu \
562mips64-softmmu \
563mips64el-softmmu \
564ppc-softmmu \
565ppcemb-softmmu \
566ppc64-softmmu \
567sh4-softmmu \
568sh4eb-softmmu \
569sparc-softmmu \
570"
pbrook0a8e90f2006-03-19 14:54:16 +0000571 fi
bellard5327cf42005-01-10 23:18:50 +0000572# the following are Linux specific
ths831b7822007-01-18 20:06:33 +0000573 if [ "$linux_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000574 target_list="${target_list}\
575i386-linux-user \
576x86_64-linux-user \
577alpha-linux-user \
578arm-linux-user \
579armeb-linux-user \
580cris-linux-user \
581m68k-linux-user \
582mips-linux-user \
583mipsel-linux-user \
584ppc-linux-user \
585ppc64-linux-user \
586ppc64abi32-linux-user \
587sh4-linux-user \
588sh4eb-linux-user \
589sparc-linux-user \
590sparc64-linux-user \
591sparc32plus-linux-user \
592"
ths831b7822007-01-18 20:06:33 +0000593 fi
594# the following are Darwin specific
595 if [ "$darwin_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000596 target_list="$target_list i386-darwin-user ppc-darwin-user"
bellard5327cf42005-01-10 23:18:50 +0000597 fi
bellard6e20a452005-06-05 15:56:02 +0000598else
pbrookb1a550a2006-04-16 13:28:56 +0000599 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000600fi
pbrook0a8e90f2006-03-19 14:54:16 +0000601if test -z "$target_list" ; then
602 echo "No targets enabled"
603 exit 1
604fi
bellard5327cf42005-01-10 23:18:50 +0000605
bellard7d132992003-03-06 23:23:54 +0000606if test -z "$cross_prefix" ; then
607
608# ---
609# big/little endian test
610cat > $TMPC << EOF
611#include <inttypes.h>
612int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000613 volatile uint32_t i=0x01234567;
614 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000615}
616EOF
617
pbrookdb7287e2008-02-03 16:27:13 +0000618if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
bellard7d132992003-03-06 23:23:54 +0000619$TMPE && bigendian="yes"
620else
621echo big/little test failed
622fi
623
624else
625
626# if cross compiling, cannot launch a program, so make a static guess
aurel320938cda2008-04-11 21:36:06 +0000627if test "$cpu" = "armv4b" \
aurel32f54b3f92008-04-12 20:14:54 +0000628 -o "$cpu" = "hppa" \
aurel320938cda2008-04-11 21:36:06 +0000629 -o "$cpu" = "m68k" \
630 -o "$cpu" = "mips" \
631 -o "$cpu" = "mips64" \
632 -o "$cpu" = "powerpc" \
633 -o "$cpu" = "s390" \
634 -o "$cpu" = "sparc" \
635 -o "$cpu" = "sparc64"; then
bellard7d132992003-03-06 23:23:54 +0000636 bigendian="yes"
637fi
638
639fi
640
bellardb6853692005-06-05 17:10:39 +0000641# host long bits test
642hostlongbits="32"
aurel320938cda2008-04-11 21:36:06 +0000643if test "$cpu" = "x86_64" \
644 -o "$cpu" = "alpha" \
645 -o "$cpu" = "ia64" \
646 -o "$cpu" = "sparc64"; then
bellardb6853692005-06-05 17:10:39 +0000647 hostlongbits="64"
648fi
649
bellarde8cd23d2003-06-25 16:08:13 +0000650# check gcc options support
bellard04369ff2003-03-20 22:33:23 +0000651cat > $TMPC <<EOF
652int main(void) {
bellard04369ff2003-03-20 22:33:23 +0000653}
654EOF
655
pbrookbd0c5662008-05-29 14:34:11 +0000656# Check host NPTL support
657cat > $TMPC <<EOF
658#include <sched.h>
pbrook30813ce2008-06-02 15:45:44 +0000659#include <linux/futex.h>
pbrookbd0c5662008-05-29 14:34:11 +0000660void foo()
661{
662#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
663#error bork
664#endif
665}
666EOF
667
668if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
669 :
670else
671 nptl="no"
672fi
673
bellard11d9f692004-04-02 20:55:59 +0000674##########################################
675# SDL probe
676
677sdl_too_old=no
678
679if test -z "$sdl" ; then
ths069b0bd2007-07-12 00:27:15 +0000680 sdl_config="sdl-config"
681 sdl=no
682 sdl_static=no
bellard11d9f692004-04-02 20:55:59 +0000683
ths069b0bd2007-07-12 00:27:15 +0000684 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
685 # win32 cross compilation case
686 sdl_config="i386-mingw32msvc-sdl-config"
687 sdl=yes
688 else
689 # normal SDL probe
bellard11d9f692004-04-02 20:55:59 +0000690cat > $TMPC << EOF
691#include <SDL.h>
692#undef main /* We don't want SDL to override our main() */
693int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
694EOF
pbrookdb7287e2008-02-03 16:27:13 +0000695 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
ths069b0bd2007-07-12 00:27:15 +0000696 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
697 if test "$_sdlversion" -lt 121 ; then
698 sdl_too_old=yes
699 else
700 if test "$cocoa" = "no" ; then
701 sdl=yes
702 fi
703 fi
bellard11d9f692004-04-02 20:55:59 +0000704
ths069b0bd2007-07-12 00:27:15 +0000705 # static link with sdl ?
706 if test "$sdl" = "yes" ; then
707 aa="no"
708 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
709 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
710 if [ "$aa" = "yes" ] ; then
711 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
712 fi
713
ths8281db42007-11-18 21:37:07 +0000714 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
ths069b0bd2007-07-12 00:27:15 +0000715 sdl_static=yes
716 fi
717 fi # static link
718 fi # sdl compile test
719 fi # cross compilation
bellard11d9f692004-04-02 20:55:59 +0000720else
ths069b0bd2007-07-12 00:27:15 +0000721 # Make sure to disable cocoa if sdl was set
722 if test "$sdl" = "yes" ; then
723 cocoa="no"
724 coreaudio="no"
725 fi
bellarda6e022a2004-04-02 21:55:47 +0000726fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000727
ths8f28f3f2007-01-05 21:25:54 +0000728##########################################
ths8d5d2d42007-08-25 01:37:51 +0000729# VNC TLS detection
730if test "$vnc_tls" = "yes" ; then
731 `pkg-config gnutls` || vnc_tls="no"
732fi
733if test "$vnc_tls" = "yes" ; then
734 vnc_tls_cflags=`pkg-config --cflags gnutls`
735 vnc_tls_libs=`pkg-config --libs gnutls`
736fi
737
738##########################################
ths8f28f3f2007-01-05 21:25:54 +0000739# alsa sound support libraries
740
741if test "$alsa" = "yes" ; then
742 cat > $TMPC << EOF
743#include <alsa/asoundlib.h>
744int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
745EOF
pbrookdb7287e2008-02-03 16:27:13 +0000746 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then
ths8f28f3f2007-01-05 21:25:54 +0000747 :
748 else
749 echo
750 echo "Error: Could not find alsa"
751 echo "Make sure to have the alsa libs and headers installed."
752 echo
753 exit 1
754 fi
755fi
756
balrog4d3b6f62008-02-10 16:33:14 +0000757##########################################
aurel322e4d9fb2008-04-08 06:01:02 +0000758# BrlAPI probe
759
760if test -z "$brlapi" ; then
761 brlapi=no
762cat > $TMPC << EOF
763#include <brlapi.h>
764int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
765EOF
aurel32a40e56d2008-05-04 00:50:25 +0000766 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
aurel322e4d9fb2008-04-08 06:01:02 +0000767 brlapi=yes
768 fi # brlapi compile test
769fi # -z $brlapi
770
771##########################################
balrog4d3b6f62008-02-10 16:33:14 +0000772# curses probe
773
774if test "$curses" = "yes" ; then
775 curses=no
776 cat > $TMPC << EOF
777#include <curses.h>
778int main(void) { return curses_version(); }
779EOF
pbrookaf896aa2008-03-23 00:47:42 +0000780 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
balrog4d3b6f62008-02-10 16:33:14 +0000781 curses=yes
782 fi
783fi # test "$curses"
784
pbrookcc8ae6d2006-04-23 17:57:59 +0000785# Check if tools are available to build documentation.
ths6c591862007-05-09 13:55:03 +0000786if [ -x "`which texi2html 2>/dev/null`" ] && \
787 [ -x "`which pod2man 2>/dev/null`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +0000788 build_docs="yes"
789fi
790
bellard11d9f692004-04-02 20:55:59 +0000791if test "$mingw32" = "yes" ; then
pbrook308c3592007-02-27 00:52:01 +0000792 if test -z "$prefix" ; then
793 prefix="/c/Program Files/Qemu"
794 fi
795 mansuffix=""
796 datasuffix=""
797 docsuffix=""
798 binsuffix=""
bellard11d9f692004-04-02 20:55:59 +0000799else
pbrook308c3592007-02-27 00:52:01 +0000800 if test -z "$prefix" ; then
801 prefix="/usr/local"
802 fi
803 mansuffix="/share/man"
804 datasuffix="/share/qemu"
805 docsuffix="/share/doc/qemu"
806 binsuffix="/bin"
bellard11d9f692004-04-02 20:55:59 +0000807fi
bellard5a671352003-10-01 00:13:48 +0000808
bellard43ce4df2003-06-09 19:53:12 +0000809echo "Install prefix $prefix"
pbrook308c3592007-02-27 00:52:01 +0000810echo "BIOS directory $prefix$datasuffix"
811echo "binary directory $prefix$binsuffix"
bellard11d9f692004-04-02 20:55:59 +0000812if test "$mingw32" = "no" ; then
pbrook308c3592007-02-27 00:52:01 +0000813echo "Manual directory $prefix$mansuffix"
bellard43ce4df2003-06-09 19:53:12 +0000814echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +0000815fi
bellard5a671352003-10-01 00:13:48 +0000816echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +0000817echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +0000818echo "Host C compiler $host_cc"
pbrookdb7287e2008-02-03 16:27:13 +0000819echo "ARCH_CFLAGS $ARCH_CFLAGS"
bellard43ce4df2003-06-09 19:53:12 +0000820echo "make $make"
pbrook6a882642006-04-17 13:57:12 +0000821echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +0000822echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +0000823echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +0000824echo "target list $target_list"
bellard43ce4df2003-06-09 19:53:12 +0000825echo "gprof enabled $gprof"
bellard05c2a3e2006-02-08 22:39:17 +0000826echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +0000827echo "static build $static"
bellard85aa5182007-11-11 20:17:03 +0000828echo "-Werror enabled $werror"
bellard5b0753e2005-03-01 21:37:28 +0000829if test "$darwin" = "yes" ; then
830 echo "Cocoa support $cocoa"
831fi
bellard97a847b2003-08-10 21:36:04 +0000832echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +0000833if test "$sdl" != "no" ; then
834 echo "SDL static link $sdl_static"
835fi
balrog4d3b6f62008-02-10 16:33:14 +0000836echo "curses support $curses"
bellard67b915a2004-03-31 23:37:16 +0000837echo "mingw32 support $mingw32"
bellardfb065182004-11-09 23:09:44 +0000838echo "Adlib support $adlib"
balroge5c9a132008-01-14 04:27:55 +0000839echo "AC97 support $ac97"
balrog423d65f2008-01-14 22:09:11 +0000840echo "GUS support $gus"
malccc53d262008-06-13 10:48:22 +0000841echo "CS4231A support $cs4231a"
bellard1d14ffa2005-10-30 18:58:22 +0000842echo "CoreAudio support $coreaudio"
843echo "ALSA support $alsa"
balrogca9cc282008-01-14 04:24:29 +0000844echo "EsounD support $esd"
bellard1d14ffa2005-10-30 18:58:22 +0000845echo "DSound support $dsound"
malc8ff9cbf2008-06-23 18:33:30 +0000846echo "Mixer emulation $mixemu"
bellard1d14ffa2005-10-30 18:58:22 +0000847if test "$fmod" = "yes"; then
848 if test -z $fmod_lib || test -z $fmod_inc; then
849 echo
850 echo "Error: You must specify path to FMOD library and headers"
851 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
852 echo
853 exit 1
854 fi
pbrookb1a550a2006-04-16 13:28:56 +0000855 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
856else
857 fmod_support=""
bellard102a52e2004-11-14 19:57:29 +0000858fi
pbrookb1a550a2006-04-16 13:28:56 +0000859echo "FMOD support $fmod $fmod_support"
ths6b4d2ba2007-05-13 18:02:43 +0000860echo "OSS support $oss"
ths8d5d2d42007-08-25 01:37:51 +0000861echo "VNC TLS support $vnc_tls"
862if test "$vnc_tls" = "yes" ; then
863 echo " TLS CFLAGS $vnc_tls_cflags"
864 echo " TLS LIBS $vnc_tls_libs"
865fi
blueswir131422552007-04-16 18:27:06 +0000866if test -n "$sparc_cpu"; then
867 echo "Target Sparc Arch $sparc_cpu"
868fi
bellard07f4ddb2005-04-23 17:44:28 +0000869echo "kqemu support $kqemu"
aurel322e4d9fb2008-04-08 06:01:02 +0000870echo "brlapi support $brlapi"
pbrookcc8ae6d2006-04-23 17:57:59 +0000871echo "Documentation $build_docs"
pbrookc5937222006-05-14 11:30:38 +0000872[ ! -z "$uname_release" ] && \
873echo "uname -r $uname_release"
pbrookbd0c5662008-05-29 14:34:11 +0000874echo "NPTL support $nptl"
bellard67b915a2004-03-31 23:37:16 +0000875
bellard97a847b2003-08-10 21:36:04 +0000876if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +0000877echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +0000878fi
ths20b40c62007-07-11 23:39:45 +0000879if [ -s /tmp/qemu-$$-sdl-config.log ]; then
880 echo "The error log from compiling the libSDL test is: "
881 cat /tmp/qemu-$$-sdl-config.log
882fi
883rm -f /tmp/qemu-$$-sdl-config.log
bellard24b55b92005-03-01 22:30:41 +0000884#if test "$sdl_static" = "no"; then
885# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
886#fi
bellard97a847b2003-08-10 21:36:04 +0000887config_mak="config-host.mak"
888config_h="config-host.h"
889
bellard7c1f25b2004-04-22 00:02:08 +0000890#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +0000891
ths15d9ca02007-07-31 23:07:32 +0000892test -f $config_h && mv $config_h ${config_h}~
893
bellard97a847b2003-08-10 21:36:04 +0000894echo "# Automatically generated by configure - do not modify" > $config_mak
pbrook29517132006-02-09 17:58:47 +0000895echo "# Configured with: $0 $@" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000896echo "/* Automatically generated by configure - do not modify */" > $config_h
897
898echo "prefix=$prefix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +0000899echo "bindir=\${prefix}$binsuffix" >> $config_mak
900echo "mandir=\${prefix}$mansuffix" >> $config_mak
901echo "datadir=\${prefix}$datasuffix" >> $config_mak
ths4ad5b062007-03-03 21:47:02 +0000902echo "docdir=\${prefix}$docsuffix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +0000903echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000904echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +0000905echo "INSTALL=$install" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000906echo "CC=$cc" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000907echo "HOST_CC=$host_cc" >> $config_mak
908echo "AR=$ar" >> $config_mak
909echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
bellard40293e52008-01-31 11:32:10 +0000910# XXX: only use CFLAGS and LDFLAGS ?
911# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
912# compilation of dyngen tool (useful for win32 build on Linux host)
ths6f30fa82007-01-05 01:00:47 +0000913echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
blueswir131422552007-04-16 18:27:06 +0000914echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
915echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
916echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000917echo "CFLAGS=$CFLAGS" >> $config_mak
918echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +0000919echo "EXESUF=$EXESUF" >> $config_mak
ths70956b72007-03-17 15:00:37 +0000920echo "AIOLIBS=$AIOLIBS" >> $config_mak
aurel322408a522008-04-20 20:19:44 +0000921case "$cpu" in
922 i386)
923 echo "ARCH=i386" >> $config_mak
924 echo "#define HOST_I386 1" >> $config_h
925 ;;
926 x86_64)
927 echo "ARCH=x86_64" >> $config_mak
928 echo "#define HOST_X86_64 1" >> $config_h
929 ;;
930 alpha)
931 echo "ARCH=alpha" >> $config_mak
932 echo "#define HOST_ALPHA 1" >> $config_h
933 ;;
934 armv4b)
935 echo "ARCH=arm" >> $config_mak
936 echo "#define HOST_ARM 1" >> $config_h
937 ;;
938 armv4l)
939 echo "ARCH=arm" >> $config_mak
940 echo "#define HOST_ARM 1" >> $config_h
941 ;;
942 cris)
943 echo "ARCH=cris" >> $config_mak
944 echo "#define HOST_CRIS 1" >> $config_h
945 ;;
946 hppa)
947 echo "ARCH=hppa" >> $config_mak
948 echo "#define HOST_HPPA 1" >> $config_h
949 ;;
950 ia64)
951 echo "ARCH=ia64" >> $config_mak
952 echo "#define HOST_IA64 1" >> $config_h
953 ;;
954 m68k)
955 echo "ARCH=m68k" >> $config_mak
956 echo "#define HOST_M68K 1" >> $config_h
957 ;;
958 mips)
959 echo "ARCH=mips" >> $config_mak
960 echo "#define HOST_MIPS 1" >> $config_h
961 ;;
962 mips64)
963 echo "ARCH=mips64" >> $config_mak
964 echo "#define HOST_MIPS64 1" >> $config_h
965 ;;
966 powerpc)
967 echo "ARCH=ppc" >> $config_mak
968 echo "#define HOST_PPC 1" >> $config_h
969 ;;
970 s390)
971 echo "ARCH=s390" >> $config_mak
972 echo "#define HOST_S390 1" >> $config_h
973 ;;
974 sparc)
975 echo "ARCH=sparc" >> $config_mak
976 echo "#define HOST_SPARC 1" >> $config_h
977 ;;
978 sparc64)
979 echo "ARCH=sparc64" >> $config_mak
980 echo "#define HOST_SPARC64 1" >> $config_h
981 ;;
982 *)
983 echo "Unsupported CPU = $cpu"
984 exit 1
985 ;;
986esac
bellard7d132992003-03-06 23:23:54 +0000987if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +0000988 echo "WORDS_BIGENDIAN=yes" >> $config_mak
989 echo "#define WORDS_BIGENDIAN 1" >> $config_h
990fi
bellardb6853692005-06-05 17:10:39 +0000991echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +0000992if test "$mingw32" = "yes" ; then
993 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +0000994 echo "#define CONFIG_WIN32 1" >> $config_h
pbrook210fa552007-02-27 21:04:49 +0000995else
996 cat > $TMPC << EOF
997#include <byteswap.h>
998int main(void) { return bswap_32(0); }
999EOF
pbrookdb7287e2008-02-03 16:27:13 +00001000 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook210fa552007-02-27 21:04:49 +00001001 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1002 fi
bellard67b915a2004-03-31 23:37:16 +00001003fi
bellard83fb7ad2004-07-05 21:25:26 +00001004if test "$darwin" = "yes" ; then
1005 echo "CONFIG_DARWIN=yes" >> $config_mak
1006 echo "#define CONFIG_DARWIN 1" >> $config_h
1007fi
bellardec530c82006-04-25 22:36:06 +00001008if test "$solaris" = "yes" ; then
1009 echo "CONFIG_SOLARIS=yes" >> $config_mak
bellard38cfa062006-05-01 13:58:07 +00001010 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ths0475a5c2007-04-01 18:54:44 +00001011 if test "$needs_libsunmath" = "yes" ; then
1012 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1013 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1014 fi
bellardec530c82006-04-25 22:36:06 +00001015fi
blueswir131422552007-04-16 18:27:06 +00001016if test -n "$sparc_cpu"; then
1017 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1018 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1019fi
bellard67b915a2004-03-31 23:37:16 +00001020if test "$gdbstub" = "yes" ; then
1021 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1022 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1023fi
bellard97a847b2003-08-10 21:36:04 +00001024if test "$gprof" = "yes" ; then
1025 echo "TARGET_GPROF=yes" >> $config_mak
1026 echo "#define HAVE_GPROF 1" >> $config_h
1027fi
1028if test "$static" = "yes" ; then
1029 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +00001030 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001031fi
bellard05c2a3e2006-02-08 22:39:17 +00001032if test $profiler = "yes" ; then
1033 echo "#define CONFIG_PROFILER 1" >> $config_h
1034fi
bellardc20709a2004-04-21 23:27:19 +00001035if test "$slirp" = "yes" ; then
1036 echo "CONFIG_SLIRP=yes" >> $config_mak
1037 echo "#define CONFIG_SLIRP 1" >> $config_h
1038fi
bellardfb065182004-11-09 23:09:44 +00001039if test "$adlib" = "yes" ; then
1040 echo "CONFIG_ADLIB=yes" >> $config_mak
1041 echo "#define CONFIG_ADLIB 1" >> $config_h
1042fi
balroge5c9a132008-01-14 04:27:55 +00001043if test "$ac97" = "yes" ; then
1044 echo "CONFIG_AC97=yes" >> $config_mak
1045 echo "#define CONFIG_AC97 1" >> $config_h
1046fi
balrog423d65f2008-01-14 22:09:11 +00001047if test "$gus" = "yes" ; then
1048 echo "CONFIG_GUS=yes" >> $config_mak
1049 echo "#define CONFIG_GUS 1" >> $config_h
1050fi
malccc53d262008-06-13 10:48:22 +00001051if test "$cs4231a" = "yes" ; then
1052 echo "CONFIG_CS4231A=yes" >> $config_mak
1053 echo "#define CONFIG_CS4231A 1" >> $config_h
1054fi
bellardfb065182004-11-09 23:09:44 +00001055if test "$oss" = "yes" ; then
1056 echo "CONFIG_OSS=yes" >> $config_mak
1057 echo "#define CONFIG_OSS 1" >> $config_h
1058fi
bellard1d14ffa2005-10-30 18:58:22 +00001059if test "$coreaudio" = "yes" ; then
1060 echo "CONFIG_COREAUDIO=yes" >> $config_mak
1061 echo "#define CONFIG_COREAUDIO 1" >> $config_h
1062fi
1063if test "$alsa" = "yes" ; then
1064 echo "CONFIG_ALSA=yes" >> $config_mak
1065 echo "#define CONFIG_ALSA 1" >> $config_h
1066fi
balrogca9cc282008-01-14 04:24:29 +00001067if test "$esd" = "yes" ; then
1068 echo "CONFIG_ESD=yes" >> $config_mak
1069 echo "#define CONFIG_ESD 1" >> $config_h
1070fi
bellard1d14ffa2005-10-30 18:58:22 +00001071if test "$dsound" = "yes" ; then
1072 echo "CONFIG_DSOUND=yes" >> $config_mak
1073 echo "#define CONFIG_DSOUND 1" >> $config_h
1074fi
malc8ff9cbf2008-06-23 18:33:30 +00001075if test "$mixemu" = "yes" ; then
1076 echo "CONFIG_MIXEMU=yes" >> $config_mak
1077 echo "#define CONFIG_MIXEMU 1" >> $config_h
1078fi
bellard102a52e2004-11-14 19:57:29 +00001079if test "$fmod" = "yes" ; then
1080 echo "CONFIG_FMOD=yes" >> $config_mak
1081 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1082 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1083 echo "#define CONFIG_FMOD 1" >> $config_h
1084fi
ths8d5d2d42007-08-25 01:37:51 +00001085if test "$vnc_tls" = "yes" ; then
1086 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1087 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1088 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1089 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1090fi
pbrookb1a550a2006-04-16 13:28:56 +00001091qemu_version=`head $source_path/VERSION`
1092echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +00001093echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001094
1095echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +00001096if [ "$source_path_used" = "yes" ]; then
1097 echo "VPATH=$source_path" >> $config_mak
1098fi
bellard97a847b2003-08-10 21:36:04 +00001099echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +00001100if [ "$build_docs" = "yes" ] ; then
1101 echo "BUILD_DOCS=yes" >> $config_mak
1102fi
bellard49ecc3f2007-11-07 19:25:15 +00001103if test "$static" = "yes"; then
1104 sdl1=$sdl_static
1105else
1106 sdl1=$sdl
1107fi
1108if test "$sdl1" = "yes" ; then
1109 echo "#define CONFIG_SDL 1" >> $config_h
1110 echo "CONFIG_SDL=yes" >> $config_mak
1111 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1112 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1113 else
1114 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1115 fi
1116 if [ "${aa}" = "yes" ] ; then
1117 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1118 else
1119 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1120 fi
1121fi
1122if test "$cocoa" = "yes" ; then
balrog4d3b6f62008-02-10 16:33:14 +00001123 echo "#define CONFIG_COCOA 1" >> $config_h
1124 echo "CONFIG_COCOA=yes" >> $config_mak
1125fi
1126if test "$curses" = "yes" ; then
1127 echo "#define CONFIG_CURSES 1" >> $config_h
1128 echo "CONFIG_CURSES=yes" >> $config_mak
1129 echo "CURSES_LIBS=-lcurses" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001130fi
aurel322e4d9fb2008-04-08 06:01:02 +00001131if test "$brlapi" = "yes" ; then
1132 echo "CONFIG_BRLAPI=yes" >> $config_mak
1133 echo "#define CONFIG_BRLAPI 1" >> $config_h
1134 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1135fi
bellard97a847b2003-08-10 21:36:04 +00001136
bellard83fb7ad2004-07-05 21:25:26 +00001137# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +00001138if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +00001139 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +00001140 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +00001141 echo "#define _BSD 1" >> $config_h
1142fi
1143
pbrookc5937222006-05-14 11:30:38 +00001144echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1145
pbrookc39e3332007-09-22 16:49:14 +00001146tools=
1147if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1148 tools="qemu-img\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001149 if [ "$linux" = "yes" ] ; then
1150 tools="qemu-nbd\$(EXESUF) $tools"
1151 fi
pbrookc39e3332007-09-22 16:49:14 +00001152fi
1153echo "TOOLS=$tools" >> $config_mak
1154
ths15d9ca02007-07-31 23:07:32 +00001155test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1156
bellard1d14ffa2005-10-30 18:58:22 +00001157for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +00001158target_dir="$target"
1159config_mak=$target_dir/config.mak
1160config_h=$target_dir/config.h
1161target_cpu=`echo $target | cut -d '-' -f 1`
1162target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +00001163[ "$target_cpu" = "armeb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001164[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1165[ "$target_cpu" = "mips" ] && target_bigendian=yes
1166[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1167[ "$target_cpu" = "mips64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +00001168[ "$target_cpu" = "ppc" ] && target_bigendian=yes
j_mayerd4082e92007-04-24 07:34:03 +00001169[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
j_mayer22f8a8b2007-10-14 08:38:29 +00001170[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
j_mayere85e7c62007-10-18 19:59:49 +00001171[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
pbrook908f52b2006-06-18 19:16:53 +00001172[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001173[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1174[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1175[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +00001176target_softmmu="no"
bellard997344f2003-10-27 21:10:39 +00001177target_user_only="no"
ths831b7822007-01-18 20:06:33 +00001178target_linux_user="no"
ths831b7822007-01-18 20:06:33 +00001179target_darwin_user="no"
pbrook9e407a82007-05-26 16:38:53 +00001180case "$target" in
1181 ${target_cpu}-softmmu)
1182 target_softmmu="yes"
1183 ;;
1184 ${target_cpu}-linux-user)
1185 target_user_only="yes"
1186 target_linux_user="yes"
1187 ;;
1188 ${target_cpu}-darwin-user)
1189 target_user_only="yes"
1190 target_darwin_user="yes"
1191 ;;
1192 *)
1193 echo "ERROR: Target '$target' not recognised"
1194 exit 1
1195 ;;
1196esac
ths831b7822007-01-18 20:06:33 +00001197
bellard97ccc682005-07-02 13:32:17 +00001198if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +00001199 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +00001200 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +00001201 echo "To build QEMU without graphical output configure with --disable-gfx-check"
balrog4d3b6f62008-02-10 16:33:14 +00001202 echo "Note that this will disable all output from the virtual graphics card"
1203 echo "except through VNC or curses."
bellard97ccc682005-07-02 13:32:17 +00001204 exit 1;
1205fi
1206
bellard7c1f25b2004-04-22 00:02:08 +00001207#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +00001208
ths15d9ca02007-07-31 23:07:32 +00001209test -f $config_h && mv $config_h ${config_h}~
1210
bellard97a847b2003-08-10 21:36:04 +00001211mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +00001212mkdir -p $target_dir/fpu
bellard57fec1f2008-02-01 10:50:11 +00001213mkdir -p $target_dir/tcg
ths831b7822007-01-18 20:06:33 +00001214if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
bellard69de9272004-02-16 21:40:43 +00001215 mkdir -p $target_dir/nwfpe
1216fi
1217
bellardec530c82006-04-25 22:36:06 +00001218#
1219# don't use ln -sf as not all "ln -sf" over write the file/link
1220#
1221rm -f $target_dir/Makefile
1222ln -s $source_path/Makefile.target $target_dir/Makefile
1223
bellard97a847b2003-08-10 21:36:04 +00001224
1225echo "# Automatically generated by configure - do not modify" > $config_mak
1226echo "/* Automatically generated by configure - do not modify */" > $config_h
1227
1228
1229echo "include ../config-host.mak" >> $config_mak
1230echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +00001231
pbrooke5fe0c52006-06-11 13:32:59 +00001232bflt="no"
blueswir1cb33da52007-10-09 16:34:29 +00001233elfload32="no"
pbrookbd0c5662008-05-29 14:34:11 +00001234target_nptl="no"
bellard1e43adf2003-09-30 20:54:24 +00001235interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1236echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001237
aurel322408a522008-04-20 20:19:44 +00001238case "$target_cpu" in
1239 i386)
1240 echo "TARGET_ARCH=i386" >> $config_mak
1241 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1242 echo "#define TARGET_I386 1" >> $config_h
bellardda260242008-05-30 20:48:25 +00001243 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
aurel322408a522008-04-20 20:19:44 +00001244 then
1245 echo "#define USE_KQEMU 1" >> $config_h
1246 fi
aurel32f2bf0942008-05-05 06:00:27 +00001247 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
pbrook11d1fdb2008-05-23 23:16:42 +00001248 if test -n "$gcc3minver" && test $gcc3minver -gt 3
aurel32f2bf0942008-05-05 06:00:27 +00001249 then
1250 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1251 else
1252 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1253 fi
aurel322408a522008-04-20 20:19:44 +00001254 ;;
1255 x86_64)
1256 echo "TARGET_ARCH=x86_64" >> $config_mak
1257 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1258 echo "#define TARGET_I386 1" >> $config_h
1259 echo "#define TARGET_X86_64 1" >> $config_h
1260 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1261 then
1262 echo "#define USE_KQEMU 1" >> $config_h
1263 fi
1264 ;;
1265 alpha)
1266 echo "TARGET_ARCH=alpha" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001267 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001268 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1269 echo "#define TARGET_ALPHA 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001270 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001271 ;;
1272 arm|armeb)
1273 echo "TARGET_ARCH=arm" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001274 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1275 echo "#define TARGET_ARM 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001276 bflt="yes"
pbrookbd0c5662008-05-29 14:34:11 +00001277 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001278 ;;
1279 cris)
1280 echo "TARGET_ARCH=cris" >> $config_mak
1281 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1282 echo "#define TARGET_CRIS 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001283 ;;
1284 m68k)
1285 echo "TARGET_ARCH=m68k" >> $config_mak
1286 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1287 echo "#define TARGET_M68K 1" >> $config_h
1288 bflt="yes"
1289 ;;
1290 mips|mipsel)
1291 echo "TARGET_ARCH=mips" >> $config_mak
1292 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1293 echo "#define TARGET_MIPS 1" >> $config_h
1294 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1295 ;;
1296 mipsn32|mipsn32el)
1297 echo "TARGET_ARCH=mipsn32" >> $config_mak
1298 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1299 echo "#define TARGET_MIPS 1" >> $config_h
1300 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1301 ;;
1302 mips64|mips64el)
1303 echo "TARGET_ARCH=mips64" >> $config_mak
1304 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1305 echo "#define TARGET_MIPS 1" >> $config_h
1306 echo "#define TARGET_MIPS64 1" >> $config_h
1307 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1308 ;;
1309 ppc)
1310 echo "TARGET_ARCH=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001311 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001312 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1313 echo "#define TARGET_PPC 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001314 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001315 ;;
1316 ppcemb)
1317 echo "TARGET_ARCH=ppcemb" >> $config_mak
1318 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001319 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001320 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1321 echo "#define TARGET_PPC 1" >> $config_h
1322 echo "#define TARGET_PPCEMB 1" >> $config_h
blueswir1ec5b78c2008-05-10 17:23:18 +00001323 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001324 ;;
1325 ppc64)
1326 echo "TARGET_ARCH=ppc64" >> $config_mak
1327 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001328 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001329 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1330 echo "#define TARGET_PPC 1" >> $config_h
1331 echo "#define TARGET_PPC64 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001332 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001333 ;;
1334 ppc64abi32)
1335 echo "TARGET_ARCH=ppc64" >> $config_mak
1336 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1337 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001338 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001339 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1340 echo "#define TARGET_PPC 1" >> $config_h
1341 echo "#define TARGET_PPC64 1" >> $config_h
1342 echo "#define TARGET_ABI32 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001343 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001344 ;;
1345 sh4|sh4eb)
1346 echo "TARGET_ARCH=sh4" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001347 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001348 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1349 echo "#define TARGET_SH4 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001350 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001351 bflt="yes"
1352 ;;
1353 sparc)
1354 echo "TARGET_ARCH=sparc" >> $config_mak
1355 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1356 echo "#define TARGET_SPARC 1" >> $config_h
1357 ;;
1358 sparc64)
1359 echo "TARGET_ARCH=sparc64" >> $config_mak
1360 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1361 echo "#define TARGET_SPARC 1" >> $config_h
1362 echo "#define TARGET_SPARC64 1" >> $config_h
1363 elfload32="yes"
1364 ;;
1365 sparc32plus)
1366 echo "TARGET_ARCH=sparc64" >> $config_mak
1367 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1368 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1369 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1370 echo "#define TARGET_SPARC 1" >> $config_h
1371 echo "#define TARGET_SPARC64 1" >> $config_h
1372 echo "#define TARGET_ABI32 1" >> $config_h
1373 ;;
1374 *)
1375 echo "Unsupported target CPU"
1376 exit 1
1377 ;;
1378esac
bellardde83cd02003-06-15 20:25:43 +00001379if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001380 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1381 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1382fi
1383if test "$target_softmmu" = "yes" ; then
1384 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1385 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +00001386fi
bellard997344f2003-10-27 21:10:39 +00001387if test "$target_user_only" = "yes" ; then
1388 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1389 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1390fi
ths831b7822007-01-18 20:06:33 +00001391if test "$target_linux_user" = "yes" ; then
1392 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1393 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1394fi
1395if test "$target_darwin_user" = "yes" ; then
1396 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1397 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1398fi
bellardde83cd02003-06-15 20:25:43 +00001399
aurel320938cda2008-04-11 21:36:06 +00001400if test "$target_cpu" = "arm" \
1401 -o "$target_cpu" = "armeb" \
1402 -o "$target_cpu" = "m68k" \
1403 -o "$target_cpu" = "mips" \
1404 -o "$target_cpu" = "mipsel" \
1405 -o "$target_cpu" = "mipsn32" \
1406 -o "$target_cpu" = "mipsn32el" \
1407 -o "$target_cpu" = "mips64" \
1408 -o "$target_cpu" = "mips64el" \
1409 -o "$target_cpu" = "sparc" \
1410 -o "$target_cpu" = "sparc64" \
1411 -o "$target_cpu" = "sparc32plus"; then
bellard158142c2005-03-13 16:54:06 +00001412 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1413 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1414fi
pbrooke5fe0c52006-06-11 13:32:59 +00001415if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1416 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1417 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1418fi
pbrookbd0c5662008-05-29 14:34:11 +00001419if test "$target_user_only" = "yes" \
1420 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1421 echo "#define USE_NPTL 1" >> $config_h
1422fi
blueswir1cb33da52007-10-09 16:34:29 +00001423# 32 bit ELF loader in addition to native 64 bit loader?
1424if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1425 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1426 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1427fi
bellard5b0753e2005-03-01 21:37:28 +00001428
ths15d9ca02007-07-31 23:07:32 +00001429test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1430
bellard97a847b2003-08-10 21:36:04 +00001431done # for target in $targets
bellard7d132992003-03-06 23:23:54 +00001432
1433# build tree in object directory if source path is different from current one
1434if test "$source_path_used" = "yes" ; then
bellard49ecc3f2007-11-07 19:25:15 +00001435 DIRS="tests tests/cris slirp audio"
bellard7d132992003-03-06 23:23:54 +00001436 FILES="Makefile tests/Makefile"
thse7daa602007-10-08 13:38:27 +00001437 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
edgar_igle1ffb0f2008-03-01 22:23:17 +00001438 FILES="$FILES tests/test-mmap.c"
bellard7d132992003-03-06 23:23:54 +00001439 for dir in $DIRS ; do
1440 mkdir -p $dir
1441 done
bellardec530c82006-04-25 22:36:06 +00001442 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +00001443 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +00001444 rm -f $f
1445 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +00001446 done
1447fi
bellard7d132992003-03-06 23:23:54 +00001448
bellard97a847b2003-08-10 21:36:04 +00001449rm -f $TMPO $TMPC $TMPE $TMPS