blob: cf76e9c357a1c08bd4aae2c6c445a223ff3c3b84 [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"
malc9d56d2d2008-09-30 19:44:32 +000018TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
bellard7d132992003-03-06 23:23:54 +000019
20# default parameters
bellard11d9f692004-04-02 20:55:59 +000021prefix=""
bellard1e43adf2003-09-30 20:54:24 +000022interp_prefix="/usr/gnemul/qemu-%M"
bellard43ce4df2003-06-09 19:53:12 +000023static="no"
bellard7d132992003-03-06 23:23:54 +000024cross_prefix=""
25cc="gcc"
pbrook328a4242006-12-19 03:31:34 +000026gcc3_search="yes"
balrogfe8f78e2007-10-31 01:03:28 +000027gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
malc0c58ac12008-06-25 21:04:05 +000028audio_drv_list=""
29audio_card_list=""
bellard7d132992003-03-06 23:23:54 +000030host_cc="gcc"
31ar="ar"
32make="make"
pbrook6a882642006-04-17 13:57:12 +000033install="install"
bellard7d132992003-03-06 23:23:54 +000034strip="strip"
35cpu=`uname -m`
bellard5327cf42005-01-10 23:18:50 +000036target_list=""
bellard7d132992003-03-06 23:23:54 +000037case "$cpu" in
38 i386|i486|i586|i686|i86pc|BePC)
bellard97a847b2003-08-10 21:36:04 +000039 cpu="i386"
bellard7d132992003-03-06 23:23:54 +000040 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000041 x86_64|amd64)
42 cpu="x86_64"
43 ;;
44 alpha)
45 cpu="alpha"
46 ;;
bellardba680552005-03-13 09:49:52 +000047 armv*b)
bellard808c4952004-12-19 23:33:47 +000048 cpu="armv4b"
49 ;;
bellardba680552005-03-13 09:49:52 +000050 armv*l)
bellard7d132992003-03-06 23:23:54 +000051 cpu="armv4l"
52 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000053 cris)
54 cpu="cris"
bellard7d132992003-03-06 23:23:54 +000055 ;;
aurel32f54b3f92008-04-12 20:14:54 +000056 parisc|parisc64)
57 cpu="hppa"
58 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000059 ia64)
60 cpu="ia64"
61 ;;
62 m68k)
63 cpu="m68k"
bellard7d132992003-03-06 23:23:54 +000064 ;;
65 mips)
66 cpu="mips"
67 ;;
thsfbe4f652007-04-01 11:16:48 +000068 mips64)
69 cpu="mips64"
70 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000071 "Power Macintosh"|ppc|ppc64)
72 cpu="powerpc"
thse7daa602007-10-08 13:38:27 +000073 ;;
ths0e7b8a92007-08-01 00:09:31 +000074 s390*)
bellardfb3e5842003-03-29 17:32:36 +000075 cpu="s390"
76 ;;
blueswir131422552007-04-16 18:27:06 +000077 sparc|sun4[cdmuv])
bellardae228532003-05-13 18:59:59 +000078 cpu="sparc"
79 ;;
80 sparc64)
81 cpu="sparc64"
82 ;;
bellard7d132992003-03-06 23:23:54 +000083 *)
84 cpu="unknown"
85 ;;
86esac
87gprof="no"
aliguori03b4fe72008-10-07 19:16:17 +000088sparse="no"
bellard7d132992003-03-06 23:23:54 +000089bigendian="no"
bellard67b915a2004-03-31 23:37:16 +000090mingw32="no"
91EXESUF=""
92gdbstub="yes"
bellard443f1372004-06-04 11:13:20 +000093slirp="yes"
aliguorie0e6c8c02008-07-23 18:14:33 +000094vde="yes"
bellard102a52e2004-11-14 19:57:29 +000095fmod_lib=""
96fmod_inc=""
blueswir12f6a1ab2008-08-21 18:00:53 +000097oss_lib=""
ths8d5d2d42007-08-25 01:37:51 +000098vnc_tls="yes"
pbrookb1a550a2006-04-16 13:28:56 +000099bsd="no"
bellard5327cf42005-01-10 23:18:50 +0000100linux="no"
blueswir1d2c7c9b2008-11-01 14:50:20 +0000101solaris="no"
bellardc9ec1fe2005-02-10 21:55:30 +0000102kqemu="no"
bellard05c2a3e2006-02-08 22:39:17 +0000103profiler="no"
bellard5b0753e2005-03-01 21:37:28 +0000104cocoa="no"
bellard97ccc682005-07-02 13:32:17 +0000105check_gfx="yes"
bellard1aff3812005-11-02 22:30:45 +0000106check_gcc="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000107softmmu="yes"
ths831b7822007-01-18 20:06:33 +0000108linux_user="no"
109darwin_user="no"
blueswir184778502008-10-26 20:33:16 +0000110bsd_user="no"
pbrookcc8ae6d2006-04-23 17:57:59 +0000111build_docs="no"
pbrookc5937222006-05-14 11:30:38 +0000112uname_release=""
balrog4d3b6f62008-02-10 16:33:14 +0000113curses="yes"
blueswir1414f0da2008-08-15 18:20:52 +0000114aio="yes"
pbrookbd0c5662008-05-29 14:34:11 +0000115nptl="yes"
malc8ff9cbf2008-06-23 18:33:30 +0000116mixemu="no"
balrogfb599c92008-09-28 23:49:55 +0000117bluez="yes"
aliguori7ba1e612008-11-05 16:04:33 +0000118kvm="yes"
aliguorieac30262008-11-05 16:28:56 +0000119kerneldir=""
bellard7d132992003-03-06 23:23:54 +0000120
121# OS specific
122targetos=`uname -s`
123case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000124CYGWIN*)
125mingw32="yes"
ths6f30fa82007-01-05 01:00:47 +0000126OS_CFLAGS="-mno-cygwin"
thsdb8d7dd2007-07-12 09:29:18 +0000127if [ "$cpu" = "i386" ] ; then
128 kqemu="yes"
129fi
malcc2de5c92008-06-28 19:13:06 +0000130audio_possible_drivers="sdl"
bellardc326e0a2005-04-23 18:30:28 +0000131;;
bellard67b915a2004-03-31 23:37:16 +0000132MINGW32*)
133mingw32="yes"
thsdb8d7dd2007-07-12 09:29:18 +0000134if [ "$cpu" = "i386" ] ; then
135 kqemu="yes"
136fi
malcc2de5c92008-06-28 19:13:06 +0000137audio_possible_drivers="dsound sdl fmod"
bellard67b915a2004-03-31 23:37:16 +0000138;;
ths5c40d2b2007-06-23 16:03:36 +0000139GNU/kFreeBSD)
malc0c58ac12008-06-25 21:04:05 +0000140audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000141audio_possible_drivers="oss sdl esd pa"
ths5c40d2b2007-06-23 16:03:36 +0000142if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
143 kqemu="yes"
144fi
145;;
bellard7d3505c2004-05-12 19:32:15 +0000146FreeBSD)
147bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000148audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000149audio_possible_drivers="oss sdl esd pa"
bellarde99f9062005-07-28 21:45:38 +0000150if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000151 kqemu="yes"
152fi
bellard7d3505c2004-05-12 19:32:15 +0000153;;
154NetBSD)
155bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000156audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000157audio_possible_drivers="oss sdl esd"
bellard7d3505c2004-05-12 19:32:15 +0000158;;
159OpenBSD)
160bsd="yes"
blueswir1128ab2f2008-08-15 18:33:42 +0000161openbsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000162audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000163audio_possible_drivers="oss sdl esd"
blueswir12f6a1ab2008-08-21 18:00:53 +0000164oss_lib="-lossaudio"
bellard7d3505c2004-05-12 19:32:15 +0000165;;
bellard83fb7ad2004-07-05 21:25:26 +0000166Darwin)
167bsd="yes"
168darwin="yes"
ths831b7822007-01-18 20:06:33 +0000169darwin_user="yes"
thsfd677642007-01-31 12:10:07 +0000170cocoa="yes"
malc0c58ac12008-06-25 21:04:05 +0000171audio_drv_list="coreaudio"
malcc2de5c92008-06-28 19:13:06 +0000172audio_possible_drivers="coreaudio sdl fmod"
ths6f30fa82007-01-05 01:00:47 +0000173OS_CFLAGS="-mdynamic-no-pic"
thsc2c59c32008-01-08 00:00:20 +0000174OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
bellard83fb7ad2004-07-05 21:25:26 +0000175;;
bellardec530c82006-04-25 22:36:06 +0000176SunOS)
thsc2b84fa2007-02-10 23:21:21 +0000177 solaris="yes"
178 make="gmake"
179 install="ginstall"
ths0475a5c2007-04-01 18:54:44 +0000180 needs_libsunmath="no"
thsc2b84fa2007-02-10 23:21:21 +0000181 solarisrev=`uname -r | cut -f2 -d.`
thsef18c882007-09-16 22:12:39 +0000182 # have to select again, because `uname -m` returns i86pc
183 # even on an x86_64 box.
184 solariscpu=`isainfo -k`
185 if test "${solariscpu}" = "amd64" ; then
186 cpu="x86_64"
187 fi
thsc2b84fa2007-02-10 23:21:21 +0000188 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
ths0475a5c2007-04-01 18:54:44 +0000189 if test "$solarisrev" -le 9 ; then
190 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
191 needs_libsunmath="yes"
192 else
193 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
194 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
195 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
196 echo "Studio 11 can be downloaded from www.sun.com."
197 exit 1
198 fi
199 fi
200 if test "$solarisrev" -ge 9 ; then
thsc2b84fa2007-02-10 23:21:21 +0000201 kqemu="yes"
202 fi
ths86b2bd92007-02-11 00:31:33 +0000203 fi
ths6b4d2ba2007-05-13 18:02:43 +0000204 if test -f /usr/include/sys/soundcard.h ; then
malc0c58ac12008-06-25 21:04:05 +0000205 audio_drv_list="oss"
ths6b4d2ba2007-05-13 18:02:43 +0000206 fi
malcc2de5c92008-06-28 19:13:06 +0000207 audio_possible_drivers="oss sdl"
ths86b2bd92007-02-11 00:31:33 +0000208;;
bellard1d14ffa2005-10-30 18:58:22 +0000209*)
malc0c58ac12008-06-25 21:04:05 +0000210audio_drv_list="oss"
malcb8e59f12008-07-02 21:03:08 +0000211audio_possible_drivers="oss alsa sdl esd pa"
bellard5327cf42005-01-10 23:18:50 +0000212linux="yes"
ths831b7822007-01-18 20:06:33 +0000213linux_user="yes"
bellard07f4ddb2005-04-23 17:44:28 +0000214if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000215 kqemu="yes"
malcc2de5c92008-06-28 19:13:06 +0000216 audio_possible_drivers="$audio_possible_drivers fmod"
bellardc9ec1fe2005-02-10 21:55:30 +0000217fi
bellardfb065182004-11-09 23:09:44 +0000218;;
bellard7d132992003-03-06 23:23:54 +0000219esac
220
bellard7d3505c2004-05-12 19:32:15 +0000221if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000222 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000223 make="gmake"
224 fi
blueswir184778502008-10-26 20:33:16 +0000225 bsd_user="yes"
bellard7d3505c2004-05-12 19:32:15 +0000226fi
227
bellard7d132992003-03-06 23:23:54 +0000228# find source path
pbrookad064842006-04-16 12:41:07 +0000229source_path=`dirname "$0"`
balrog59faef32008-02-03 04:22:24 +0000230source_path_used="no"
231workdir=`pwd`
pbrookad064842006-04-16 12:41:07 +0000232if [ -z "$source_path" ]; then
balrog59faef32008-02-03 04:22:24 +0000233 source_path=$workdir
pbrookad064842006-04-16 12:41:07 +0000234else
235 source_path=`cd "$source_path"; pwd`
bellard7d132992003-03-06 23:23:54 +0000236fi
pbrook724db112008-02-03 19:20:13 +0000237[ -f "$workdir/vl.c" ] || source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000238
bellard85aa5182007-11-11 20:17:03 +0000239werror="no"
bellard0d1e2392007-11-11 20:24:30 +0000240# generate compile errors on warnings for development builds
241#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
242#werror="yes";
243#fi
bellard85aa5182007-11-11 20:17:03 +0000244
bellard7d132992003-03-06 23:23:54 +0000245for opt do
pbrooka46e4032006-04-29 23:05:22 +0000246 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000247 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000248 --help|-h) show_help=yes
249 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000250 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000251 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000252 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000253 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000254 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000255 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000256 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000257 --cross-prefix=*) cross_prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000258 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000259 --cc=*) cc="$optarg"
pbrook328a4242006-12-19 03:31:34 +0000260 gcc3_search="no"
bellard7d132992003-03-06 23:23:54 +0000261 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000262 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000263 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000264 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000265 ;;
pbrook6a882642006-04-17 13:57:12 +0000266 --install=*) install="$optarg"
267 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000268 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000269 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000270 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000271 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000272 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000273 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000274 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000275 ;;
bellard7d132992003-03-06 23:23:54 +0000276 --enable-gprof) gprof="yes"
277 ;;
bellard43ce4df2003-06-09 19:53:12 +0000278 --static) static="yes"
279 ;;
bellard97a847b2003-08-10 21:36:04 +0000280 --disable-sdl) sdl="no"
281 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000282 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000283 ;;
malcc2de5c92008-06-28 19:13:06 +0000284 --fmod-inc=*) fmod_inc="$optarg"
285 ;;
blueswir12f6a1ab2008-08-21 18:00:53 +0000286 --oss-lib=*) oss_lib="$optarg"
287 ;;
malc2fa7d3b2008-07-29 12:58:44 +0000288 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
malc0c58ac12008-06-25 21:04:05 +0000289 ;;
290 --audio-drv-list=*) audio_drv_list="$optarg"
291 ;;
aliguori03b4fe72008-10-07 19:16:17 +0000292 --enable-sparse) sparse="yes"
293 ;;
294 --disable-sparse) sparse="no"
295 ;;
ths8d5d2d42007-08-25 01:37:51 +0000296 --disable-vnc-tls) vnc_tls="no"
297 ;;
bellard443f1372004-06-04 11:13:20 +0000298 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000299 ;;
aliguorie0e6c8c02008-07-23 18:14:33 +0000300 --disable-vde) vde="no"
ths8a16d272008-07-19 09:56:24 +0000301 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000302 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000303 ;;
aurel322e4d9fb2008-04-08 06:01:02 +0000304 --disable-brlapi) brlapi="no"
305 ;;
balrogfb599c92008-09-28 23:49:55 +0000306 --disable-bluez) bluez="no"
307 ;;
aliguori7ba1e612008-11-05 16:04:33 +0000308 --disable-kvm) kvm="no"
309 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000310 --enable-profiler) profiler="yes"
311 ;;
malcc2de5c92008-06-28 19:13:06 +0000312 --enable-cocoa)
313 cocoa="yes" ;
314 sdl="no" ;
315 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
bellard1d14ffa2005-10-30 18:58:22 +0000316 ;;
bellard97ccc682005-07-02 13:32:17 +0000317 --disable-gfx-check) check_gfx="no"
318 ;;
bellard1aff3812005-11-02 22:30:45 +0000319 --disable-gcc-check) check_gcc="no"
320 ;;
pbrookcad25d62006-03-19 16:31:11 +0000321 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000322 ;;
pbrookcad25d62006-03-19 16:31:11 +0000323 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000324 ;;
ths831b7822007-01-18 20:06:33 +0000325 --disable-linux-user) linux_user="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000326 ;;
ths831b7822007-01-18 20:06:33 +0000327 --enable-linux-user) linux_user="yes"
328 ;;
329 --disable-darwin-user) darwin_user="no"
330 ;;
331 --enable-darwin-user) darwin_user="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000332 ;;
blueswir184778502008-10-26 20:33:16 +0000333 --disable-bsd-user) bsd_user="no"
334 ;;
335 --enable-bsd-user) bsd_user="yes"
336 ;;
pbrookc5937222006-05-14 11:30:38 +0000337 --enable-uname-release=*) uname_release="$optarg"
338 ;;
blueswir131422552007-04-16 18:27:06 +0000339 --sparc_cpu=*)
340 sparc_cpu="$optarg"
341 case $sparc_cpu in
342 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
343 target_cpu="sparc"; cpu="sparc" ;;
344 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
345 target_cpu="sparc"; cpu="sparc" ;;
346 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
347 target_cpu="sparc64"; cpu="sparc64" ;;
348 *) echo "undefined SPARC architecture. Exiting";exit 1;;
349 esac
350 ;;
bellard85aa5182007-11-11 20:17:03 +0000351 --enable-werror) werror="yes"
352 ;;
353 --disable-werror) werror="no"
354 ;;
balrog4d3b6f62008-02-10 16:33:14 +0000355 --disable-curses) curses="no"
356 ;;
pbrookbd0c5662008-05-29 14:34:11 +0000357 --disable-nptl) nptl="no"
358 ;;
malc8ff9cbf2008-06-23 18:33:30 +0000359 --enable-mixemu) mixemu="yes"
360 ;;
blueswir1414f0da2008-08-15 18:20:52 +0000361 --disable-aio) aio="no"
362 ;;
aliguorieac30262008-11-05 16:28:56 +0000363 --kerneldir=*) kerneldir="$optarg"
364 ;;
balrog7f1559c2007-11-17 10:24:32 +0000365 *) echo "ERROR: unknown option $opt"; show_help="yes"
366 ;;
bellard7d132992003-03-06 23:23:54 +0000367 esac
368done
369
ths6f30fa82007-01-05 01:00:47 +0000370# default flags for all hosts
blueswir1ac41a622008-09-14 06:46:31 +0000371CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
372CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
ths6f30fa82007-01-05 01:00:47 +0000373LDFLAGS="$LDFLAGS -g"
bellard85aa5182007-11-11 20:17:03 +0000374if test "$werror" = "yes" ; then
375CFLAGS="$CFLAGS -Werror"
376fi
ths6f30fa82007-01-05 01:00:47 +0000377
blueswir1d2c7c9b2008-11-01 14:50:20 +0000378if test "$solaris" = "no" ; then
379 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
380 LDFLAGS="$LDFLAGS -Wl,--warn-common"
381 fi
blueswir149237ac2008-09-17 19:05:19 +0000382fi
383
blueswir131422552007-04-16 18:27:06 +0000384#
385# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
386# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
387#
bellard40293e52008-01-31 11:32:10 +0000388case "$cpu" in
blueswir131422552007-04-16 18:27:06 +0000389 sparc) if test -z "$sparc_cpu" ; then
390 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
391 ARCH_LDFLAGS="-m32"
392 else
393 ARCH_CFLAGS="${SP_CFLAGS}"
394 ARCH_LDFLAGS="${SP_LDFLAGS}"
395 fi
396 ;;
397 sparc64) if test -z "$sparc_cpu" ; then
398 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
399 ARCH_LDFLAGS="-m64"
400 else
401 ARCH_CFLAGS="${SP_CFLAGS}"
402 ARCH_LDFLAGS="${SP_LDFLAGS}"
403 fi
404 ;;
ths76d83bd2007-11-18 21:22:10 +0000405 s390)
406 ARCH_CFLAGS="-march=z900"
407 ;;
bellard40293e52008-01-31 11:32:10 +0000408 i386)
409 ARCH_CFLAGS="-m32"
410 ARCH_LDFLAGS="-m32"
411 ;;
412 x86_64)
413 ARCH_CFLAGS="-m64"
414 ARCH_LDFLAGS="-m64"
415 ;;
blueswir131422552007-04-16 18:27:06 +0000416esac
417
pbrookaf5db582006-04-08 14:26:41 +0000418if test x"$show_help" = x"yes" ; then
419cat << EOF
420
421Usage: configure [options]
422Options: [defaults in brackets after descriptions]
423
424EOF
425echo "Standard options:"
426echo " --help print this message"
427echo " --prefix=PREFIX install in PREFIX [$prefix]"
428echo " --interp-prefix=PREFIX where to find shared libraries, etc."
429echo " use %M for cpu name [$interp_prefix]"
430echo " --target-list=LIST set target list [$target_list]"
431echo ""
432echo "kqemu kernel acceleration support:"
433echo " --disable-kqemu disable kqemu support"
pbrookaf5db582006-04-08 14:26:41 +0000434echo ""
435echo "Advanced options (experts only):"
436echo " --source-path=PATH path of source code [$source_path]"
437echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
438echo " --cc=CC use C compiler CC [$cc]"
439echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
440echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000441echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000442echo " --static enable static build [$static]"
aliguori890b1652008-10-07 21:22:41 +0000443echo " --enable-sparse enable sparse checker"
444echo " --disable-sparse disable sparse checker (default)"
bellard85aa5182007-11-11 20:17:03 +0000445echo " --disable-werror disable compilation abort on warning"
balrogfe8f78e2007-10-31 01:03:28 +0000446echo " --disable-sdl disable SDL"
pbrookaf5db582006-04-08 14:26:41 +0000447echo " --enable-cocoa enable COCOA (Mac OS X only)"
malcc2de5c92008-06-28 19:13:06 +0000448echo " --audio-drv-list=LIST set audio drivers list:"
449echo " Available drivers: $audio_possible_drivers"
450echo " --audio-card-list=LIST set list of additional emulated audio cards"
451echo " Available cards: ac97 adlib cs4231a gus"
malc8ff9cbf2008-06-23 18:33:30 +0000452echo " --enable-mixemu enable mixer emulation"
aurel322e4d9fb2008-04-08 06:01:02 +0000453echo " --disable-brlapi disable BrlAPI"
ths8d5d2d42007-08-25 01:37:51 +0000454echo " --disable-vnc-tls disable TLS encryption for VNC server"
pbrookaf896aa2008-03-23 00:47:42 +0000455echo " --disable-curses disable curses output"
balrogfb599c92008-09-28 23:49:55 +0000456echo " --disable-bluez disable bluez stack connectivity"
aliguori7ba1e612008-11-05 16:04:33 +0000457echo " --disable-kvm disable KVM acceleration support"
pbrookbd0c5662008-05-29 14:34:11 +0000458echo " --disable-nptl disable usermode NPTL support"
pbrookaf5db582006-04-08 14:26:41 +0000459echo " --enable-system enable all system emulation targets"
460echo " --disable-system disable all system emulation targets"
ths831b7822007-01-18 20:06:33 +0000461echo " --enable-linux-user enable all linux usermode emulation targets"
462echo " --disable-linux-user disable all linux usermode emulation targets"
463echo " --enable-darwin-user enable all darwin usermode emulation targets"
464echo " --disable-darwin-user disable all darwin usermode emulation targets"
blueswir184778502008-10-26 20:33:16 +0000465echo " --enable-bsd-user enable all BSD usermode emulation targets"
466echo " --disable-bsd-user disable all BSD usermode emulation targets"
pbrookaf5db582006-04-08 14:26:41 +0000467echo " --fmod-lib path to FMOD library"
468echo " --fmod-inc path to FMOD includes"
blueswir12f6a1ab2008-08-21 18:00:53 +0000469echo " --oss-lib path to OSS library"
pbrookc5937222006-05-14 11:30:38 +0000470echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
blueswir131422552007-04-16 18:27:06 +0000471echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
aliguorie0e6c8c02008-07-23 18:14:33 +0000472echo " --disable-vde disable support for vde network"
blueswir1414f0da2008-08-15 18:20:52 +0000473echo " --disable-aio disable AIO support"
aliguorieac30262008-11-05 16:28:56 +0000474echo " --kerneldir=PATH look for kernel includes in PATH"
pbrookaf5db582006-04-08 14:26:41 +0000475echo ""
ths5bf08932006-12-23 00:33:26 +0000476echo "NOTE: The object files are built at the place where configure is launched"
pbrookaf5db582006-04-08 14:26:41 +0000477exit 1
478fi
479
bellard7d132992003-03-06 23:23:54 +0000480cc="${cross_prefix}${cc}"
481ar="${cross_prefix}${ar}"
482strip="${cross_prefix}${strip}"
483
pbrook064aae12006-05-08 00:51:44 +0000484# check that the C compiler works.
485cat > $TMPC <<EOF
486int main(void) {}
487EOF
488
pbrookdb7287e2008-02-03 16:27:13 +0000489if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
pbrook064aae12006-05-08 00:51:44 +0000490 : C compiler works ok
491else
492 echo "ERROR: \"$cc\" either does not exist or does not work"
493 exit 1
bellarda7350fa2006-04-23 14:35:23 +0000494fi
495
aliguoricd01b4a2008-08-21 19:25:45 +0000496# check compiler to see if we're on mingw32
497cat > $TMPC <<EOF
498#include <windows.h>
499#ifndef _WIN32
500#error not windows
501#endif
502int main(void) {}
503EOF
504
505if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
506 mingw32="yes"
507fi
508
bellard67b915a2004-03-31 23:37:16 +0000509if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000510 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000511 EXESUF=".exe"
bellard9f059ec2004-11-14 18:59:52 +0000512 oss="no"
aliguoricd01b4a2008-08-21 19:25:45 +0000513 linux_user="no"
blueswir184778502008-10-26 20:33:16 +0000514 bsd_user="no"
aliguoricd01b4a2008-08-21 19:25:45 +0000515fi
516
aliguori997306f2008-09-26 15:52:17 +0000517if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
aliguoricd01b4a2008-08-21 19:25:45 +0000518 AIOLIBS=
aliguori997306f2008-09-26 15:52:17 +0000519elif [ "$bsd" = "yes" ]; then
520 AIOLIBS="-lpthread"
aliguoricd01b4a2008-08-21 19:25:45 +0000521else
522 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
523 AIOLIBS="-lrt -lpthread"
bellard67b915a2004-03-31 23:37:16 +0000524fi
525
ths5fafdf22007-09-16 21:08:06 +0000526# Check for gcc4, error if pre-gcc4
pbrook328a4242006-12-19 03:31:34 +0000527if test "$check_gcc" = "yes" ; then
528 cat > $TMPC <<EOF
529#if __GNUC__ < 4
530#error gcc3
531#endif
532int main(){return 0;}
533EOF
pbrookdb7287e2008-02-03 16:27:13 +0000534 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook328a4242006-12-19 03:31:34 +0000535 echo "WARNING: \"$cc\" looks like gcc 4.x"
536 found_compat_cc="no"
537 if test "$gcc3_search" = "yes" ; then
538 echo "Looking for gcc 3.x"
539 for compat_cc in $gcc3_list ; do
balrogd4af3de2007-07-26 20:41:46 +0000540 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
pbrook328a4242006-12-19 03:31:34 +0000541 echo "Found \"$compat_cc\""
pbrook11244262007-02-27 01:03:41 +0000542 cc="$cross_prefix$compat_cc"
pbrook328a4242006-12-19 03:31:34 +0000543 found_compat_cc="yes"
544 break
545 fi
546 done
547 if test "$found_compat_cc" = "no" ; then
548 echo "gcc 3.x not found!"
549 fi
550 fi
551 if test "$found_compat_cc" = "no" ; then
552 echo "QEMU is known to have problems when compiled with gcc 4.x"
553 echo "It is recommended that you use gcc 3.x to build QEMU"
554 echo "To use this compiler anyway, configure with --disable-gcc-check"
555 exit 1;
556 fi
557 fi
558fi
559
aliguori03b4fe72008-10-07 19:16:17 +0000560if test ! -x "$(which cgcc 2>/dev/null)"; then
561 sparse="no"
562fi
563
bellardec530c82006-04-25 22:36:06 +0000564#
565# Solaris specific configure tool chain decisions
566#
567if test "$solaris" = "yes" ; then
568 #
569 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
570 # override the check with --disable-gcc-check
ths5fafdf22007-09-16 21:08:06 +0000571 #
bellardec530c82006-04-25 22:36:06 +0000572 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
573 solgcc=`which $cc`
574 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
575 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
576 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
577 echo "or get the latest patch from SunSolve for gcc"
578 exit 1
579 fi
580 fi
581 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
582 if test -z "$solinst" ; then
583 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
584 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
585 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
586 exit 1
587 fi
588 if test "$solinst" = "/usr/sbin/install" ; then
589 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
590 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
591 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
592 exit 1
593 fi
bellardec530c82006-04-25 22:36:06 +0000594 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
595 if test -z "$sol_ar" ; then
596 echo "Error: No path includes ar"
597 if test -f /usr/ccs/bin/ar ; then
598 echo "Add /usr/ccs/bin to your path and rerun configure"
599 fi
600 exit 1
601 fi
ths5fafdf22007-09-16 21:08:06 +0000602fi
bellardec530c82006-04-25 22:36:06 +0000603
604
bellard5327cf42005-01-10 23:18:50 +0000605if test -z "$target_list" ; then
606# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000607 if [ "$softmmu" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000608 target_list="\
609i386-softmmu \
610x86_64-softmmu \
611arm-softmmu \
612cris-softmmu \
613m68k-softmmu \
614mips-softmmu \
615mipsel-softmmu \
616mips64-softmmu \
617mips64el-softmmu \
618ppc-softmmu \
619ppcemb-softmmu \
620ppc64-softmmu \
621sh4-softmmu \
622sh4eb-softmmu \
623sparc-softmmu \
624"
pbrook0a8e90f2006-03-19 14:54:16 +0000625 fi
bellard5327cf42005-01-10 23:18:50 +0000626# the following are Linux specific
ths831b7822007-01-18 20:06:33 +0000627 if [ "$linux_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000628 target_list="${target_list}\
629i386-linux-user \
630x86_64-linux-user \
631alpha-linux-user \
632arm-linux-user \
633armeb-linux-user \
634cris-linux-user \
635m68k-linux-user \
636mips-linux-user \
637mipsel-linux-user \
638ppc-linux-user \
639ppc64-linux-user \
640ppc64abi32-linux-user \
641sh4-linux-user \
642sh4eb-linux-user \
643sparc-linux-user \
644sparc64-linux-user \
645sparc32plus-linux-user \
646"
ths831b7822007-01-18 20:06:33 +0000647 fi
648# the following are Darwin specific
649 if [ "$darwin_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000650 target_list="$target_list i386-darwin-user ppc-darwin-user"
bellard5327cf42005-01-10 23:18:50 +0000651 fi
blueswir184778502008-10-26 20:33:16 +0000652# the following are BSD specific
653 if [ "$bsd_user" = "yes" ] ; then
654 target_list="${target_list}\
655sparc64-bsd-user \
656"
657 fi
bellard6e20a452005-06-05 15:56:02 +0000658else
pbrookb1a550a2006-04-16 13:28:56 +0000659 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000660fi
pbrook0a8e90f2006-03-19 14:54:16 +0000661if test -z "$target_list" ; then
662 echo "No targets enabled"
663 exit 1
664fi
bellard5327cf42005-01-10 23:18:50 +0000665
bellard7d132992003-03-06 23:23:54 +0000666if test -z "$cross_prefix" ; then
667
668# ---
669# big/little endian test
670cat > $TMPC << EOF
671#include <inttypes.h>
672int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000673 volatile uint32_t i=0x01234567;
674 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000675}
676EOF
677
pbrookdb7287e2008-02-03 16:27:13 +0000678if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
bellard7d132992003-03-06 23:23:54 +0000679$TMPE && bigendian="yes"
680else
681echo big/little test failed
682fi
683
684else
685
686# if cross compiling, cannot launch a program, so make a static guess
aurel320938cda2008-04-11 21:36:06 +0000687if test "$cpu" = "armv4b" \
aurel32f54b3f92008-04-12 20:14:54 +0000688 -o "$cpu" = "hppa" \
aurel320938cda2008-04-11 21:36:06 +0000689 -o "$cpu" = "m68k" \
690 -o "$cpu" = "mips" \
691 -o "$cpu" = "mips64" \
692 -o "$cpu" = "powerpc" \
693 -o "$cpu" = "s390" \
694 -o "$cpu" = "sparc" \
695 -o "$cpu" = "sparc64"; then
bellard7d132992003-03-06 23:23:54 +0000696 bigendian="yes"
697fi
698
699fi
700
bellardb6853692005-06-05 17:10:39 +0000701# host long bits test
702hostlongbits="32"
aurel320938cda2008-04-11 21:36:06 +0000703if test "$cpu" = "x86_64" \
704 -o "$cpu" = "alpha" \
705 -o "$cpu" = "ia64" \
706 -o "$cpu" = "sparc64"; then
bellardb6853692005-06-05 17:10:39 +0000707 hostlongbits="64"
708fi
709
malc810260a2008-07-23 19:17:46 +0000710# ppc specific hostlongbits selection
711if test "$cpu" = "powerpc" ; then
malc9d56d2d2008-09-30 19:44:32 +0000712 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev/null </dev/null; then
713 grep -q __powerpc64__ $TMPI && hostlongbits=64
malc810260a2008-07-23 19:17:46 +0000714 else
715 echo hostlongbits test failed
malcba69a082008-07-24 17:51:36 +0000716 exit 1
malc810260a2008-07-23 19:17:46 +0000717 fi
718fi
719
bellarde8cd23d2003-06-25 16:08:13 +0000720# check gcc options support
bellard04369ff2003-03-20 22:33:23 +0000721cat > $TMPC <<EOF
722int main(void) {
bellard04369ff2003-03-20 22:33:23 +0000723}
724EOF
725
pbrookbd0c5662008-05-29 14:34:11 +0000726# Check host NPTL support
727cat > $TMPC <<EOF
728#include <sched.h>
pbrook30813ce2008-06-02 15:45:44 +0000729#include <linux/futex.h>
pbrookbd0c5662008-05-29 14:34:11 +0000730void foo()
731{
732#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
733#error bork
734#endif
735}
736EOF
737
738if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
739 :
740else
741 nptl="no"
742fi
743
bellard11d9f692004-04-02 20:55:59 +0000744##########################################
balrogac629222008-10-11 09:56:04 +0000745# zlib check
746
747cat > $TMPC << EOF
748#include <zlib.h>
749int main(void) { zlibVersion(); return 0; }
750EOF
balrog17e15922008-10-11 12:00:42 +0000751if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev/null ; then
balrogac629222008-10-11 09:56:04 +0000752 :
753else
754 echo
755 echo "Error: zlib check failed"
756 echo "Make sure to have the zlib libs and headers installed."
757 echo
758 exit 1
759fi
760
761##########################################
bellard11d9f692004-04-02 20:55:59 +0000762# SDL probe
763
764sdl_too_old=no
765
766if test -z "$sdl" ; then
ths069b0bd2007-07-12 00:27:15 +0000767 sdl_config="sdl-config"
768 sdl=no
769 sdl_static=no
bellard11d9f692004-04-02 20:55:59 +0000770
771cat > $TMPC << EOF
772#include <SDL.h>
773#undef main /* We don't want SDL to override our main() */
774int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
775EOF
aliguoricd01b4a2008-08-21 19:25:45 +0000776 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
777 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
778 if test "$_sdlversion" -lt 121 ; then
779 sdl_too_old=yes
780 else
781 if test "$cocoa" = "no" ; then
782 sdl=yes
783 fi
784 fi
785
786 # static link with sdl ?
787 if test "$sdl" = "yes" ; then
788 aa="no"
789 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
790 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
791 if [ "$aa" = "yes" ] ; then
792 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
ths069b0bd2007-07-12 00:27:15 +0000793 fi
bellard11d9f692004-04-02 20:55:59 +0000794
aliguoricd01b4a2008-08-21 19:25:45 +0000795 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
796 sdl_static=yes
797 fi
798 fi # static link
799 fi # sdl compile test
bellard11d9f692004-04-02 20:55:59 +0000800else
ths069b0bd2007-07-12 00:27:15 +0000801 # Make sure to disable cocoa if sdl was set
802 if test "$sdl" = "yes" ; then
803 cocoa="no"
malcc2de5c92008-06-28 19:13:06 +0000804 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
ths069b0bd2007-07-12 00:27:15 +0000805 fi
bellarda6e022a2004-04-02 21:55:47 +0000806fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000807
ths8f28f3f2007-01-05 21:25:54 +0000808##########################################
ths8d5d2d42007-08-25 01:37:51 +0000809# VNC TLS detection
810if test "$vnc_tls" = "yes" ; then
aliguoriae6b5e52008-08-06 16:55:50 +0000811cat > $TMPC <<EOF
812#include <gnutls/gnutls.h>
813int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
814EOF
815 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
816 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
817 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
818 $vnc_tls_libs 2> /dev/null ; then
819 :
820 else
821 vnc_tls="no"
822 fi
ths8d5d2d42007-08-25 01:37:51 +0000823fi
824
825##########################################
ths8a16d272008-07-19 09:56:24 +0000826# vde libraries probe
827if test "$vde" = "yes" ; then
828 cat > $TMPC << EOF
829#include <libvdeplug.h>
pbrook4a7f0e02008-09-07 16:42:53 +0000830int main(void)
831{
832 struct vde_open_args a = {0, 0, 0};
833 vde_open("", "", &a);
834 return 0;
835}
ths8a16d272008-07-19 09:56:24 +0000836EOF
pbrook4a7f0e02008-09-07 16:42:53 +0000837 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then
ths8a16d272008-07-19 09:56:24 +0000838 :
839 else
aliguorie0e6c8c02008-07-23 18:14:33 +0000840 vde="no"
ths8a16d272008-07-19 09:56:24 +0000841 fi
842fi
843
844##########################################
malcc2de5c92008-06-28 19:13:06 +0000845# Sound support libraries probe
ths8f28f3f2007-01-05 21:25:54 +0000846
malcc2de5c92008-06-28 19:13:06 +0000847audio_drv_probe()
848{
849 drv=$1
850 hdr=$2
851 lib=$3
852 exp=$4
853 cfl=$5
854 cat > $TMPC << EOF
855#include <$hdr>
856int main(void) { $exp }
ths8f28f3f2007-01-05 21:25:54 +0000857EOF
malcc2de5c92008-06-28 19:13:06 +0000858 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then
859 :
860 else
861 echo
862 echo "Error: $drv check failed"
863 echo "Make sure to have the $drv libs and headers installed."
864 echo
865 exit 1
866 fi
867}
868
malc2fa7d3b2008-07-29 12:58:44 +0000869audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
malcc2de5c92008-06-28 19:13:06 +0000870for drv in $audio_drv_list; do
871 case $drv in
872 alsa)
873 audio_drv_probe $drv alsa/asoundlib.h -lasound \
874 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
875 ;;
876
877 fmod)
878 if test -z $fmod_lib || test -z $fmod_inc; then
879 echo
880 echo "Error: You must specify path to FMOD library and headers"
881 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
882 echo
883 exit 1
884 fi
885 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
886 ;;
887
888 esd)
889 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
890 ;;
malcb8e59f12008-07-02 21:03:08 +0000891
892 pa)
893 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
894 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
895 ;;
896
blueswir12f6a1ab2008-08-21 18:00:53 +0000897 oss|sdl|core|wav|dsound)
898 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
899 ;;
900
malce4c63a62008-07-19 16:15:16 +0000901 *)
malc1c9b2a52008-07-19 16:57:30 +0000902 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
malce4c63a62008-07-19 16:15:16 +0000903 echo
904 echo "Error: Unknown driver '$drv' selected"
905 echo "Possible drivers are: $audio_possible_drivers"
906 echo
907 exit 1
908 }
909 ;;
malcc2de5c92008-06-28 19:13:06 +0000910 esac
911done
ths8f28f3f2007-01-05 21:25:54 +0000912
balrog4d3b6f62008-02-10 16:33:14 +0000913##########################################
aurel322e4d9fb2008-04-08 06:01:02 +0000914# BrlAPI probe
915
916if test -z "$brlapi" ; then
917 brlapi=no
918cat > $TMPC << EOF
919#include <brlapi.h>
920int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
921EOF
aurel32a40e56d2008-05-04 00:50:25 +0000922 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
aurel322e4d9fb2008-04-08 06:01:02 +0000923 brlapi=yes
924 fi # brlapi compile test
925fi # -z $brlapi
926
927##########################################
balrog4d3b6f62008-02-10 16:33:14 +0000928# curses probe
929
930if test "$curses" = "yes" ; then
931 curses=no
932 cat > $TMPC << EOF
933#include <curses.h>
934int main(void) { return curses_version(); }
935EOF
pbrookaf896aa2008-03-23 00:47:42 +0000936 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
balrog4d3b6f62008-02-10 16:33:14 +0000937 curses=yes
938 fi
939fi # test "$curses"
940
blueswir1414f0da2008-08-15 18:20:52 +0000941##########################################
balrogfb599c92008-09-28 23:49:55 +0000942# bluez support probe
943if test "$bluez" = "yes" ; then
944 `pkg-config bluez` || bluez="no"
945fi
946if test "$bluez" = "yes" ; then
balroge820e3f2008-09-30 02:27:44 +0000947 cat > $TMPC << EOF
948#include <bluetooth/bluetooth.h>
949int main(void) { return bt_error(0); }
950EOF
balrogfb599c92008-09-28 23:49:55 +0000951 bluez_cflags=`pkg-config --cflags bluez`
952 bluez_libs=`pkg-config --libs bluez`
balrog17e15922008-10-11 12:00:42 +0000953 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
balroge820e3f2008-09-30 02:27:44 +0000954 $bluez_libs 2> /dev/null ; then
955 :
956 else
957 bluez="no"
958 fi
balrogfb599c92008-09-28 23:49:55 +0000959fi
960
961##########################################
aliguori7ba1e612008-11-05 16:04:33 +0000962# kvm probe
963if test "$kvm" = "yes" ; then
964 cat > $TMPC <<EOF
965#include <linux/kvm.h>
966#if !defined(KVM_API_VERSION) || \
967 KVM_API_VERSION < 12 || \
968 KVM_API_VERSION > 12 || \
969 !defined(KVM_CAP_USER_MEMORY) || \
970 !defined(KVM_CAP_SET_TSS_ADDR)
971#error Invalid KVM version
972#endif
973int main(void) { return 0; }
974EOF
aliguorieac30262008-11-05 16:28:56 +0000975 if test "$kerneldir" != "" ; then
976 kvm_cflags=-I"$kerneldir"/include
977 else
978 kvm_cflags=""
979 fi
aliguori7ba1e612008-11-05 16:04:33 +0000980 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
981 2>/dev/null ; then
982 :
983 else
984 kvm="no"
985 fi
986fi
987
988##########################################
blueswir1414f0da2008-08-15 18:20:52 +0000989# AIO probe
990if test "$aio" = "yes" ; then
991 aio=no
992 cat > $TMPC << EOF
993#include <aio.h>
994int main(void) { return aio_write(NULL); }
995EOF
996 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
997 aio=yes
998 fi
999fi
1000
pbrookcc8ae6d2006-04-23 17:57:59 +00001001# Check if tools are available to build documentation.
ths6c591862007-05-09 13:55:03 +00001002if [ -x "`which texi2html 2>/dev/null`" ] && \
1003 [ -x "`which pod2man 2>/dev/null`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +00001004 build_docs="yes"
1005fi
1006
bellard11d9f692004-04-02 20:55:59 +00001007if test "$mingw32" = "yes" ; then
pbrook308c3592007-02-27 00:52:01 +00001008 if test -z "$prefix" ; then
aliguori17e90972008-10-24 14:11:41 +00001009 prefix="c:\\\\Program Files\\\\Qemu"
pbrook308c3592007-02-27 00:52:01 +00001010 fi
1011 mansuffix=""
1012 datasuffix=""
1013 docsuffix=""
1014 binsuffix=""
bellard11d9f692004-04-02 20:55:59 +00001015else
pbrook308c3592007-02-27 00:52:01 +00001016 if test -z "$prefix" ; then
1017 prefix="/usr/local"
1018 fi
1019 mansuffix="/share/man"
1020 datasuffix="/share/qemu"
1021 docsuffix="/share/doc/qemu"
1022 binsuffix="/bin"
bellard11d9f692004-04-02 20:55:59 +00001023fi
bellard5a671352003-10-01 00:13:48 +00001024
bellard43ce4df2003-06-09 19:53:12 +00001025echo "Install prefix $prefix"
pbrook308c3592007-02-27 00:52:01 +00001026echo "BIOS directory $prefix$datasuffix"
1027echo "binary directory $prefix$binsuffix"
bellard11d9f692004-04-02 20:55:59 +00001028if test "$mingw32" = "no" ; then
pbrook308c3592007-02-27 00:52:01 +00001029echo "Manual directory $prefix$mansuffix"
bellard43ce4df2003-06-09 19:53:12 +00001030echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +00001031fi
bellard5a671352003-10-01 00:13:48 +00001032echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +00001033echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +00001034echo "Host C compiler $host_cc"
pbrookdb7287e2008-02-03 16:27:13 +00001035echo "ARCH_CFLAGS $ARCH_CFLAGS"
bellard43ce4df2003-06-09 19:53:12 +00001036echo "make $make"
pbrook6a882642006-04-17 13:57:12 +00001037echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +00001038echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +00001039echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +00001040echo "target list $target_list"
bellard43ce4df2003-06-09 19:53:12 +00001041echo "gprof enabled $gprof"
aliguori03b4fe72008-10-07 19:16:17 +00001042echo "sparse enabled $sparse"
bellard05c2a3e2006-02-08 22:39:17 +00001043echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +00001044echo "static build $static"
bellard85aa5182007-11-11 20:17:03 +00001045echo "-Werror enabled $werror"
bellard5b0753e2005-03-01 21:37:28 +00001046if test "$darwin" = "yes" ; then
1047 echo "Cocoa support $cocoa"
1048fi
bellard97a847b2003-08-10 21:36:04 +00001049echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +00001050if test "$sdl" != "no" ; then
1051 echo "SDL static link $sdl_static"
1052fi
balrog4d3b6f62008-02-10 16:33:14 +00001053echo "curses support $curses"
bellard67b915a2004-03-31 23:37:16 +00001054echo "mingw32 support $mingw32"
malc0c58ac12008-06-25 21:04:05 +00001055echo "Audio drivers $audio_drv_list"
1056echo "Extra audio cards $audio_card_list"
malc8ff9cbf2008-06-23 18:33:30 +00001057echo "Mixer emulation $mixemu"
ths8d5d2d42007-08-25 01:37:51 +00001058echo "VNC TLS support $vnc_tls"
1059if test "$vnc_tls" = "yes" ; then
1060 echo " TLS CFLAGS $vnc_tls_cflags"
1061 echo " TLS LIBS $vnc_tls_libs"
1062fi
blueswir131422552007-04-16 18:27:06 +00001063if test -n "$sparc_cpu"; then
1064 echo "Target Sparc Arch $sparc_cpu"
1065fi
bellard07f4ddb2005-04-23 17:44:28 +00001066echo "kqemu support $kqemu"
aurel322e4d9fb2008-04-08 06:01:02 +00001067echo "brlapi support $brlapi"
pbrookcc8ae6d2006-04-23 17:57:59 +00001068echo "Documentation $build_docs"
pbrookc5937222006-05-14 11:30:38 +00001069[ ! -z "$uname_release" ] && \
1070echo "uname -r $uname_release"
pbrookbd0c5662008-05-29 14:34:11 +00001071echo "NPTL support $nptl"
ths8a16d272008-07-19 09:56:24 +00001072echo "vde support $vde"
blueswir1414f0da2008-08-15 18:20:52 +00001073echo "AIO support $aio"
aliguori7ba1e612008-11-05 16:04:33 +00001074echo "KVM support $kvm"
bellard67b915a2004-03-31 23:37:16 +00001075
bellard97a847b2003-08-10 21:36:04 +00001076if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +00001077echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +00001078fi
ths20b40c62007-07-11 23:39:45 +00001079if [ -s /tmp/qemu-$$-sdl-config.log ]; then
1080 echo "The error log from compiling the libSDL test is: "
1081 cat /tmp/qemu-$$-sdl-config.log
1082fi
1083rm -f /tmp/qemu-$$-sdl-config.log
bellard24b55b92005-03-01 22:30:41 +00001084#if test "$sdl_static" = "no"; then
1085# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1086#fi
bellard97a847b2003-08-10 21:36:04 +00001087config_mak="config-host.mak"
1088config_h="config-host.h"
1089
bellard7c1f25b2004-04-22 00:02:08 +00001090#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +00001091
ths15d9ca02007-07-31 23:07:32 +00001092test -f $config_h && mv $config_h ${config_h}~
1093
bellard97a847b2003-08-10 21:36:04 +00001094echo "# Automatically generated by configure - do not modify" > $config_mak
pbrook29517132006-02-09 17:58:47 +00001095echo "# Configured with: $0 $@" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001096echo "/* Automatically generated by configure - do not modify */" > $config_h
1097
1098echo "prefix=$prefix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001099echo "bindir=\${prefix}$binsuffix" >> $config_mak
1100echo "mandir=\${prefix}$mansuffix" >> $config_mak
1101echo "datadir=\${prefix}$datasuffix" >> $config_mak
ths4ad5b062007-03-03 21:47:02 +00001102echo "docdir=\${prefix}$docsuffix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001103echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001104echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +00001105echo "INSTALL=$install" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001106echo "CC=$cc" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001107echo "HOST_CC=$host_cc" >> $config_mak
1108echo "AR=$ar" >> $config_mak
1109echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
bellard40293e52008-01-31 11:32:10 +00001110# XXX: only use CFLAGS and LDFLAGS ?
1111# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1112# compilation of dyngen tool (useful for win32 build on Linux host)
ths6f30fa82007-01-05 01:00:47 +00001113echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
blueswir131422552007-04-16 18:27:06 +00001114echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1115echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1116echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001117echo "CFLAGS=$CFLAGS" >> $config_mak
1118echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +00001119echo "EXESUF=$EXESUF" >> $config_mak
ths70956b72007-03-17 15:00:37 +00001120echo "AIOLIBS=$AIOLIBS" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001121case "$cpu" in
1122 i386)
1123 echo "ARCH=i386" >> $config_mak
1124 echo "#define HOST_I386 1" >> $config_h
1125 ;;
1126 x86_64)
1127 echo "ARCH=x86_64" >> $config_mak
1128 echo "#define HOST_X86_64 1" >> $config_h
1129 ;;
1130 alpha)
1131 echo "ARCH=alpha" >> $config_mak
1132 echo "#define HOST_ALPHA 1" >> $config_h
1133 ;;
1134 armv4b)
1135 echo "ARCH=arm" >> $config_mak
1136 echo "#define HOST_ARM 1" >> $config_h
1137 ;;
1138 armv4l)
1139 echo "ARCH=arm" >> $config_mak
1140 echo "#define HOST_ARM 1" >> $config_h
1141 ;;
1142 cris)
1143 echo "ARCH=cris" >> $config_mak
1144 echo "#define HOST_CRIS 1" >> $config_h
1145 ;;
1146 hppa)
1147 echo "ARCH=hppa" >> $config_mak
1148 echo "#define HOST_HPPA 1" >> $config_h
1149 ;;
1150 ia64)
1151 echo "ARCH=ia64" >> $config_mak
1152 echo "#define HOST_IA64 1" >> $config_h
1153 ;;
1154 m68k)
1155 echo "ARCH=m68k" >> $config_mak
1156 echo "#define HOST_M68K 1" >> $config_h
1157 ;;
1158 mips)
1159 echo "ARCH=mips" >> $config_mak
1160 echo "#define HOST_MIPS 1" >> $config_h
1161 ;;
1162 mips64)
1163 echo "ARCH=mips64" >> $config_mak
1164 echo "#define HOST_MIPS64 1" >> $config_h
1165 ;;
1166 powerpc)
malc810260a2008-07-23 19:17:46 +00001167 if test "$hostlongbits" = "32"; then
1168 echo "ARCH=ppc" >> $config_mak
1169 echo "#define HOST_PPC 1" >> $config_h
1170 else
1171 echo "ARCH=ppc64" >> $config_mak
1172 echo "#define HOST_PPC64 1" >> $config_h
1173 fi
aurel322408a522008-04-20 20:19:44 +00001174 ;;
1175 s390)
1176 echo "ARCH=s390" >> $config_mak
1177 echo "#define HOST_S390 1" >> $config_h
1178 ;;
1179 sparc)
1180 echo "ARCH=sparc" >> $config_mak
1181 echo "#define HOST_SPARC 1" >> $config_h
1182 ;;
1183 sparc64)
1184 echo "ARCH=sparc64" >> $config_mak
1185 echo "#define HOST_SPARC64 1" >> $config_h
1186 ;;
1187 *)
1188 echo "Unsupported CPU = $cpu"
1189 exit 1
1190 ;;
1191esac
aliguori03b4fe72008-10-07 19:16:17 +00001192if test "$sparse" = "yes" ; then
1193 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1194 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1195 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1196fi
bellard7d132992003-03-06 23:23:54 +00001197if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001198 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1199 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1200fi
bellardb6853692005-06-05 17:10:39 +00001201echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +00001202if test "$mingw32" = "yes" ; then
1203 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +00001204 echo "#define CONFIG_WIN32 1" >> $config_h
pbrook210fa552007-02-27 21:04:49 +00001205else
1206 cat > $TMPC << EOF
1207#include <byteswap.h>
1208int main(void) { return bswap_32(0); }
1209EOF
pbrookdb7287e2008-02-03 16:27:13 +00001210 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook210fa552007-02-27 21:04:49 +00001211 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1212 fi
bellard67b915a2004-03-31 23:37:16 +00001213fi
blueswir1128ab2f2008-08-15 18:33:42 +00001214
1215if [ "$openbsd" = "yes" ] ; then
1216 echo "#define ENOTSUP 4096" >> $config_h
1217fi
1218
bellard83fb7ad2004-07-05 21:25:26 +00001219if test "$darwin" = "yes" ; then
1220 echo "CONFIG_DARWIN=yes" >> $config_mak
1221 echo "#define CONFIG_DARWIN 1" >> $config_h
1222fi
bellardec530c82006-04-25 22:36:06 +00001223if test "$solaris" = "yes" ; then
1224 echo "CONFIG_SOLARIS=yes" >> $config_mak
bellard38cfa062006-05-01 13:58:07 +00001225 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ths0475a5c2007-04-01 18:54:44 +00001226 if test "$needs_libsunmath" = "yes" ; then
1227 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1228 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1229 fi
bellardec530c82006-04-25 22:36:06 +00001230fi
blueswir131422552007-04-16 18:27:06 +00001231if test -n "$sparc_cpu"; then
1232 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1233 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1234fi
bellard67b915a2004-03-31 23:37:16 +00001235if test "$gdbstub" = "yes" ; then
1236 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1237 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1238fi
bellard97a847b2003-08-10 21:36:04 +00001239if test "$gprof" = "yes" ; then
1240 echo "TARGET_GPROF=yes" >> $config_mak
1241 echo "#define HAVE_GPROF 1" >> $config_h
1242fi
1243if test "$static" = "yes" ; then
1244 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +00001245 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001246fi
bellard05c2a3e2006-02-08 22:39:17 +00001247if test $profiler = "yes" ; then
1248 echo "#define CONFIG_PROFILER 1" >> $config_h
1249fi
bellardc20709a2004-04-21 23:27:19 +00001250if test "$slirp" = "yes" ; then
1251 echo "CONFIG_SLIRP=yes" >> $config_mak
1252 echo "#define CONFIG_SLIRP 1" >> $config_h
1253fi
ths8a16d272008-07-19 09:56:24 +00001254if test "$vde" = "yes" ; then
1255 echo "CONFIG_VDE=yes" >> $config_mak
1256 echo "#define CONFIG_VDE 1" >> $config_h
1257 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1258fi
malc0c58ac12008-06-25 21:04:05 +00001259for card in $audio_card_list; do
pbrookf6e58892008-06-29 01:00:34 +00001260 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001261 echo "$def=yes" >> $config_mak
1262 echo "#define $def 1" >> $config_h
1263done
1264echo "#define AUDIO_DRIVERS \\" >> $config_h
1265for drv in $audio_drv_list; do
1266 echo " &${drv}_audio_driver, \\" >>$config_h
pbrookf6e58892008-06-29 01:00:34 +00001267 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001268 echo "$def=yes" >> $config_mak
malc923e4522008-07-02 18:13:46 +00001269 if test "$drv" = "fmod"; then
malc0c58ac12008-06-25 21:04:05 +00001270 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1271 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
blueswir12f6a1ab2008-08-21 18:00:53 +00001272 elif test "$drv" = "oss"; then
1273 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
malc0c58ac12008-06-25 21:04:05 +00001274 fi
1275done
1276echo "" >>$config_h
malc8ff9cbf2008-06-23 18:33:30 +00001277if test "$mixemu" = "yes" ; then
1278 echo "CONFIG_MIXEMU=yes" >> $config_mak
1279 echo "#define CONFIG_MIXEMU 1" >> $config_h
1280fi
ths8d5d2d42007-08-25 01:37:51 +00001281if test "$vnc_tls" = "yes" ; then
1282 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1283 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1284 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1285 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1286fi
pbrookb1a550a2006-04-16 13:28:56 +00001287qemu_version=`head $source_path/VERSION`
1288echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +00001289echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001290
1291echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +00001292if [ "$source_path_used" = "yes" ]; then
1293 echo "VPATH=$source_path" >> $config_mak
1294fi
bellard97a847b2003-08-10 21:36:04 +00001295echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +00001296if [ "$build_docs" = "yes" ] ; then
1297 echo "BUILD_DOCS=yes" >> $config_mak
1298fi
bellard49ecc3f2007-11-07 19:25:15 +00001299if test "$static" = "yes"; then
1300 sdl1=$sdl_static
1301else
1302 sdl1=$sdl
1303fi
1304if test "$sdl1" = "yes" ; then
1305 echo "#define CONFIG_SDL 1" >> $config_h
1306 echo "CONFIG_SDL=yes" >> $config_mak
1307 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1308 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1309 else
1310 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1311 fi
1312 if [ "${aa}" = "yes" ] ; then
1313 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1314 else
1315 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1316 fi
1317fi
1318if test "$cocoa" = "yes" ; then
balrog4d3b6f62008-02-10 16:33:14 +00001319 echo "#define CONFIG_COCOA 1" >> $config_h
1320 echo "CONFIG_COCOA=yes" >> $config_mak
1321fi
1322if test "$curses" = "yes" ; then
1323 echo "#define CONFIG_CURSES 1" >> $config_h
1324 echo "CONFIG_CURSES=yes" >> $config_mak
1325 echo "CURSES_LIBS=-lcurses" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001326fi
aurel322e4d9fb2008-04-08 06:01:02 +00001327if test "$brlapi" = "yes" ; then
1328 echo "CONFIG_BRLAPI=yes" >> $config_mak
1329 echo "#define CONFIG_BRLAPI 1" >> $config_h
1330 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1331fi
balrogfb599c92008-09-28 23:49:55 +00001332if test "$bluez" = "yes" ; then
1333 echo "CONFIG_BLUEZ=yes" >> $config_mak
1334 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1335 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1336 echo "#define CONFIG_BLUEZ 1" >> $config_h
1337fi
blueswir1414f0da2008-08-15 18:20:52 +00001338if test "$aio" = "yes" ; then
1339 echo "#define CONFIG_AIO 1" >> $config_h
aliguoria3392f92008-09-11 18:00:19 +00001340 echo "CONFIG_AIO=yes" >> $config_mak
blueswir1414f0da2008-08-15 18:20:52 +00001341fi
bellard97a847b2003-08-10 21:36:04 +00001342
bellard83fb7ad2004-07-05 21:25:26 +00001343# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +00001344if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +00001345 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +00001346 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +00001347 echo "#define _BSD 1" >> $config_h
1348fi
1349
pbrookc5937222006-05-14 11:30:38 +00001350echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1351
pbrookc39e3332007-09-22 16:49:14 +00001352tools=
1353if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1354 tools="qemu-img\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001355 if [ "$linux" = "yes" ] ; then
1356 tools="qemu-nbd\$(EXESUF) $tools"
1357 fi
pbrookc39e3332007-09-22 16:49:14 +00001358fi
1359echo "TOOLS=$tools" >> $config_mak
1360
ths15d9ca02007-07-31 23:07:32 +00001361test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1362
bellard1d14ffa2005-10-30 18:58:22 +00001363for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +00001364target_dir="$target"
1365config_mak=$target_dir/config.mak
1366config_h=$target_dir/config.h
1367target_cpu=`echo $target | cut -d '-' -f 1`
1368target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +00001369[ "$target_cpu" = "armeb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001370[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1371[ "$target_cpu" = "mips" ] && target_bigendian=yes
1372[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1373[ "$target_cpu" = "mips64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +00001374[ "$target_cpu" = "ppc" ] && target_bigendian=yes
j_mayerd4082e92007-04-24 07:34:03 +00001375[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
j_mayer22f8a8b2007-10-14 08:38:29 +00001376[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
j_mayere85e7c62007-10-18 19:59:49 +00001377[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
pbrook908f52b2006-06-18 19:16:53 +00001378[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001379[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1380[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1381[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +00001382target_softmmu="no"
bellard997344f2003-10-27 21:10:39 +00001383target_user_only="no"
ths831b7822007-01-18 20:06:33 +00001384target_linux_user="no"
ths831b7822007-01-18 20:06:33 +00001385target_darwin_user="no"
blueswir184778502008-10-26 20:33:16 +00001386target_bsd_user="no"
pbrook9e407a82007-05-26 16:38:53 +00001387case "$target" in
1388 ${target_cpu}-softmmu)
1389 target_softmmu="yes"
1390 ;;
1391 ${target_cpu}-linux-user)
1392 target_user_only="yes"
1393 target_linux_user="yes"
1394 ;;
1395 ${target_cpu}-darwin-user)
1396 target_user_only="yes"
1397 target_darwin_user="yes"
1398 ;;
blueswir184778502008-10-26 20:33:16 +00001399 ${target_cpu}-bsd-user)
1400 target_user_only="yes"
1401 target_bsd_user="yes"
1402 ;;
pbrook9e407a82007-05-26 16:38:53 +00001403 *)
1404 echo "ERROR: Target '$target' not recognised"
1405 exit 1
1406 ;;
1407esac
ths831b7822007-01-18 20:06:33 +00001408
bellard97ccc682005-07-02 13:32:17 +00001409if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +00001410 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +00001411 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +00001412 echo "To build QEMU without graphical output configure with --disable-gfx-check"
balrog4d3b6f62008-02-10 16:33:14 +00001413 echo "Note that this will disable all output from the virtual graphics card"
1414 echo "except through VNC or curses."
bellard97ccc682005-07-02 13:32:17 +00001415 exit 1;
1416fi
1417
bellard7c1f25b2004-04-22 00:02:08 +00001418#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +00001419
ths15d9ca02007-07-31 23:07:32 +00001420test -f $config_h && mv $config_h ${config_h}~
1421
bellard97a847b2003-08-10 21:36:04 +00001422mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +00001423mkdir -p $target_dir/fpu
bellard57fec1f2008-02-01 10:50:11 +00001424mkdir -p $target_dir/tcg
blueswir184778502008-10-26 20:33:16 +00001425if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
bellard69de9272004-02-16 21:40:43 +00001426 mkdir -p $target_dir/nwfpe
1427fi
1428
bellardec530c82006-04-25 22:36:06 +00001429#
1430# don't use ln -sf as not all "ln -sf" over write the file/link
1431#
1432rm -f $target_dir/Makefile
1433ln -s $source_path/Makefile.target $target_dir/Makefile
1434
bellard97a847b2003-08-10 21:36:04 +00001435
1436echo "# Automatically generated by configure - do not modify" > $config_mak
1437echo "/* Automatically generated by configure - do not modify */" > $config_h
1438
1439
1440echo "include ../config-host.mak" >> $config_mak
1441echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +00001442
pbrooke5fe0c52006-06-11 13:32:59 +00001443bflt="no"
blueswir1cb33da52007-10-09 16:34:29 +00001444elfload32="no"
pbrookbd0c5662008-05-29 14:34:11 +00001445target_nptl="no"
bellard1e43adf2003-09-30 20:54:24 +00001446interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1447echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
pbrook56aebc82008-10-11 17:55:29 +00001448gdb_xml_files=""
bellard97a847b2003-08-10 21:36:04 +00001449
aliguori5985ece2008-11-05 19:59:25 +00001450# Make sure the target and host cpus are compatible
1451if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1452 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1453 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
aliguori7ba1e612008-11-05 16:04:33 +00001454 kvm="no"
1455fi
1456# Disable KVM for linux-user
1457if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1458 kvm="no"
1459fi
1460
aurel322408a522008-04-20 20:19:44 +00001461case "$target_cpu" in
1462 i386)
1463 echo "TARGET_ARCH=i386" >> $config_mak
1464 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1465 echo "#define TARGET_I386 1" >> $config_h
bellardda260242008-05-30 20:48:25 +00001466 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
aurel322408a522008-04-20 20:19:44 +00001467 then
1468 echo "#define USE_KQEMU 1" >> $config_h
1469 fi
aliguori7ba1e612008-11-05 16:04:33 +00001470 if test "$kvm" = "yes" ; then
1471 echo "CONFIG_KVM=yes" >> $config_mak
1472 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
aliguori5985ece2008-11-05 19:59:25 +00001473 echo "#define CONFIG_KVM 1" >> $config_h
aliguori7ba1e612008-11-05 16:04:33 +00001474 fi
aurel32f2bf0942008-05-05 06:00:27 +00001475 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
pbrook11d1fdb2008-05-23 23:16:42 +00001476 if test -n "$gcc3minver" && test $gcc3minver -gt 3
aurel32f2bf0942008-05-05 06:00:27 +00001477 then
1478 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1479 else
1480 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1481 fi
aurel322408a522008-04-20 20:19:44 +00001482 ;;
1483 x86_64)
1484 echo "TARGET_ARCH=x86_64" >> $config_mak
1485 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1486 echo "#define TARGET_I386 1" >> $config_h
1487 echo "#define TARGET_X86_64 1" >> $config_h
1488 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1489 then
1490 echo "#define USE_KQEMU 1" >> $config_h
1491 fi
aliguori7ba1e612008-11-05 16:04:33 +00001492 if test "$kvm" = "yes" ; then
1493 echo "CONFIG_KVM=yes" >> $config_mak
1494 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1495 echo "#define CONFIG_KVM 1" >> $config_h
1496 fi
aurel322408a522008-04-20 20:19:44 +00001497 ;;
1498 alpha)
1499 echo "TARGET_ARCH=alpha" >> $config_mak
1500 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1501 echo "#define TARGET_ALPHA 1" >> $config_h
1502 ;;
1503 arm|armeb)
1504 echo "TARGET_ARCH=arm" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001505 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1506 echo "#define TARGET_ARM 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001507 bflt="yes"
pbrookbd0c5662008-05-29 14:34:11 +00001508 target_nptl="yes"
pbrook56aebc82008-10-11 17:55:29 +00001509 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
aurel322408a522008-04-20 20:19:44 +00001510 ;;
1511 cris)
1512 echo "TARGET_ARCH=cris" >> $config_mak
1513 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1514 echo "#define TARGET_CRIS 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001515 ;;
1516 m68k)
1517 echo "TARGET_ARCH=m68k" >> $config_mak
1518 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1519 echo "#define TARGET_M68K 1" >> $config_h
1520 bflt="yes"
pbrook56aebc82008-10-11 17:55:29 +00001521 gdb_xml_files="cf-core.xml cf-fp.xml"
aurel322408a522008-04-20 20:19:44 +00001522 ;;
1523 mips|mipsel)
1524 echo "TARGET_ARCH=mips" >> $config_mak
1525 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1526 echo "#define TARGET_MIPS 1" >> $config_h
1527 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1528 ;;
1529 mipsn32|mipsn32el)
1530 echo "TARGET_ARCH=mipsn32" >> $config_mak
1531 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1532 echo "#define TARGET_MIPS 1" >> $config_h
1533 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1534 ;;
1535 mips64|mips64el)
1536 echo "TARGET_ARCH=mips64" >> $config_mak
1537 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1538 echo "#define TARGET_MIPS 1" >> $config_h
1539 echo "#define TARGET_MIPS64 1" >> $config_h
1540 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1541 ;;
1542 ppc)
1543 echo "TARGET_ARCH=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001544 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001545 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1546 echo "#define TARGET_PPC 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001547 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001548 ;;
1549 ppcemb)
1550 echo "TARGET_ARCH=ppcemb" >> $config_mak
1551 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001552 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001553 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1554 echo "#define TARGET_PPC 1" >> $config_h
1555 echo "#define TARGET_PPCEMB 1" >> $config_h
blueswir1ec5b78c2008-05-10 17:23:18 +00001556 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001557 ;;
1558 ppc64)
1559 echo "TARGET_ARCH=ppc64" >> $config_mak
1560 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001561 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001562 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1563 echo "#define TARGET_PPC 1" >> $config_h
1564 echo "#define TARGET_PPC64 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001565 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001566 ;;
1567 ppc64abi32)
1568 echo "TARGET_ARCH=ppc64" >> $config_mak
1569 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1570 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001571 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001572 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1573 echo "#define TARGET_PPC 1" >> $config_h
1574 echo "#define TARGET_PPC64 1" >> $config_h
1575 echo "#define TARGET_ABI32 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001576 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001577 ;;
1578 sh4|sh4eb)
1579 echo "TARGET_ARCH=sh4" >> $config_mak
1580 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1581 echo "#define TARGET_SH4 1" >> $config_h
1582 bflt="yes"
aurel320b6d3ae2008-09-15 07:43:43 +00001583 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001584 ;;
1585 sparc)
1586 echo "TARGET_ARCH=sparc" >> $config_mak
1587 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1588 echo "#define TARGET_SPARC 1" >> $config_h
1589 ;;
1590 sparc64)
1591 echo "TARGET_ARCH=sparc64" >> $config_mak
1592 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1593 echo "#define TARGET_SPARC 1" >> $config_h
1594 echo "#define TARGET_SPARC64 1" >> $config_h
1595 elfload32="yes"
1596 ;;
1597 sparc32plus)
1598 echo "TARGET_ARCH=sparc64" >> $config_mak
1599 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1600 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1601 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1602 echo "#define TARGET_SPARC 1" >> $config_h
1603 echo "#define TARGET_SPARC64 1" >> $config_h
1604 echo "#define TARGET_ABI32 1" >> $config_h
1605 ;;
1606 *)
1607 echo "Unsupported target CPU"
1608 exit 1
1609 ;;
1610esac
bellardde83cd02003-06-15 20:25:43 +00001611if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001612 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1613 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1614fi
1615if test "$target_softmmu" = "yes" ; then
1616 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1617 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +00001618fi
bellard997344f2003-10-27 21:10:39 +00001619if test "$target_user_only" = "yes" ; then
1620 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1621 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1622fi
ths831b7822007-01-18 20:06:33 +00001623if test "$target_linux_user" = "yes" ; then
1624 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1625 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1626fi
1627if test "$target_darwin_user" = "yes" ; then
1628 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1629 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1630fi
pbrook56aebc82008-10-11 17:55:29 +00001631list=""
1632if test ! -z "$gdb_xml_files" ; then
1633 for x in $gdb_xml_files; do
1634 list="$list $source_path/gdb-xml/$x"
1635 done
1636fi
1637echo "TARGET_XML_FILES=$list" >> $config_mak
bellardde83cd02003-06-15 20:25:43 +00001638
aurel320938cda2008-04-11 21:36:06 +00001639if test "$target_cpu" = "arm" \
1640 -o "$target_cpu" = "armeb" \
1641 -o "$target_cpu" = "m68k" \
1642 -o "$target_cpu" = "mips" \
1643 -o "$target_cpu" = "mipsel" \
1644 -o "$target_cpu" = "mipsn32" \
1645 -o "$target_cpu" = "mipsn32el" \
1646 -o "$target_cpu" = "mips64" \
1647 -o "$target_cpu" = "mips64el" \
1648 -o "$target_cpu" = "sparc" \
1649 -o "$target_cpu" = "sparc64" \
1650 -o "$target_cpu" = "sparc32plus"; then
bellard158142c2005-03-13 16:54:06 +00001651 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1652 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1653fi
pbrooke5fe0c52006-06-11 13:32:59 +00001654if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1655 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1656 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1657fi
pbrookbd0c5662008-05-29 14:34:11 +00001658if test "$target_user_only" = "yes" \
1659 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1660 echo "#define USE_NPTL 1" >> $config_h
1661fi
blueswir1cb33da52007-10-09 16:34:29 +00001662# 32 bit ELF loader in addition to native 64 bit loader?
1663if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1664 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1665 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1666fi
blueswir184778502008-10-26 20:33:16 +00001667if test "$target_bsd_user" = "yes" ; then
1668 echo "CONFIG_BSD_USER=yes" >> $config_mak
1669 echo "#define CONFIG_BSD_USER 1" >> $config_h
1670fi
bellard5b0753e2005-03-01 21:37:28 +00001671
ths15d9ca02007-07-31 23:07:32 +00001672test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1673
bellard97a847b2003-08-10 21:36:04 +00001674done # for target in $targets
bellard7d132992003-03-06 23:23:54 +00001675
1676# build tree in object directory if source path is different from current one
1677if test "$source_path_used" = "yes" ; then
bellard49ecc3f2007-11-07 19:25:15 +00001678 DIRS="tests tests/cris slirp audio"
bellard7d132992003-03-06 23:23:54 +00001679 FILES="Makefile tests/Makefile"
thse7daa602007-10-08 13:38:27 +00001680 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
edgar_igle1ffb0f2008-03-01 22:23:17 +00001681 FILES="$FILES tests/test-mmap.c"
bellard7d132992003-03-06 23:23:54 +00001682 for dir in $DIRS ; do
1683 mkdir -p $dir
1684 done
bellardec530c82006-04-25 22:36:06 +00001685 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +00001686 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +00001687 rm -f $f
1688 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +00001689 done
1690fi
bellard7d132992003-03-06 23:23:54 +00001691
malc9d56d2d2008-09-30 19:44:32 +00001692rm -f $TMPO $TMPC $TMPE $TMPS $TMPI