blob: 1f3d23397cfa9c811740ff1390da93882ababc4c [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"
malcb29fe3e2008-11-18 01:42:22 +000035cpu=`test $(uname -s) = AIX && uname -p || 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 ;;
malcb29fe3e2008-11-18 01:42:22 +000071 "Power Macintosh"|ppc|ppc64|powerpc)
aurel32aaa5fa12008-04-11 22:04:22 +000072 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=""
malcb29fe3e2008-11-18 01:42:22 +0000120aix="no"
bellard7d132992003-03-06 23:23:54 +0000121
122# OS specific
123targetos=`uname -s`
124case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000125CYGWIN*)
126mingw32="yes"
ths6f30fa82007-01-05 01:00:47 +0000127OS_CFLAGS="-mno-cygwin"
thsdb8d7dd2007-07-12 09:29:18 +0000128if [ "$cpu" = "i386" ] ; then
129 kqemu="yes"
130fi
malcc2de5c92008-06-28 19:13:06 +0000131audio_possible_drivers="sdl"
bellardc326e0a2005-04-23 18:30:28 +0000132;;
bellard67b915a2004-03-31 23:37:16 +0000133MINGW32*)
134mingw32="yes"
thsdb8d7dd2007-07-12 09:29:18 +0000135if [ "$cpu" = "i386" ] ; then
136 kqemu="yes"
137fi
malcc2de5c92008-06-28 19:13:06 +0000138audio_possible_drivers="dsound sdl fmod"
bellard67b915a2004-03-31 23:37:16 +0000139;;
ths5c40d2b2007-06-23 16:03:36 +0000140GNU/kFreeBSD)
malc0c58ac12008-06-25 21:04:05 +0000141audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000142audio_possible_drivers="oss sdl esd pa"
ths5c40d2b2007-06-23 16:03:36 +0000143if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
144 kqemu="yes"
145fi
146;;
bellard7d3505c2004-05-12 19:32:15 +0000147FreeBSD)
148bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000149audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000150audio_possible_drivers="oss sdl esd pa"
bellarde99f9062005-07-28 21:45:38 +0000151if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000152 kqemu="yes"
153fi
bellard7d3505c2004-05-12 19:32:15 +0000154;;
155NetBSD)
156bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000157audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000158audio_possible_drivers="oss sdl esd"
bellard7d3505c2004-05-12 19:32:15 +0000159;;
160OpenBSD)
161bsd="yes"
blueswir1128ab2f2008-08-15 18:33:42 +0000162openbsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000163audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000164audio_possible_drivers="oss sdl esd"
blueswir12f6a1ab2008-08-21 18:00:53 +0000165oss_lib="-lossaudio"
bellard7d3505c2004-05-12 19:32:15 +0000166;;
bellard83fb7ad2004-07-05 21:25:26 +0000167Darwin)
168bsd="yes"
169darwin="yes"
ths831b7822007-01-18 20:06:33 +0000170darwin_user="yes"
thsfd677642007-01-31 12:10:07 +0000171cocoa="yes"
malc0c58ac12008-06-25 21:04:05 +0000172audio_drv_list="coreaudio"
malcc2de5c92008-06-28 19:13:06 +0000173audio_possible_drivers="coreaudio sdl fmod"
ths6f30fa82007-01-05 01:00:47 +0000174OS_CFLAGS="-mdynamic-no-pic"
thsc2c59c32008-01-08 00:00:20 +0000175OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
bellard83fb7ad2004-07-05 21:25:26 +0000176;;
bellardec530c82006-04-25 22:36:06 +0000177SunOS)
thsc2b84fa2007-02-10 23:21:21 +0000178 solaris="yes"
179 make="gmake"
180 install="ginstall"
ths0475a5c2007-04-01 18:54:44 +0000181 needs_libsunmath="no"
thsc2b84fa2007-02-10 23:21:21 +0000182 solarisrev=`uname -r | cut -f2 -d.`
thsef18c882007-09-16 22:12:39 +0000183 # have to select again, because `uname -m` returns i86pc
184 # even on an x86_64 box.
185 solariscpu=`isainfo -k`
186 if test "${solariscpu}" = "amd64" ; then
187 cpu="x86_64"
188 fi
thsc2b84fa2007-02-10 23:21:21 +0000189 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
ths0475a5c2007-04-01 18:54:44 +0000190 if test "$solarisrev" -le 9 ; then
191 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
192 needs_libsunmath="yes"
193 else
194 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
195 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
196 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
197 echo "Studio 11 can be downloaded from www.sun.com."
198 exit 1
199 fi
200 fi
201 if test "$solarisrev" -ge 9 ; then
thsc2b84fa2007-02-10 23:21:21 +0000202 kqemu="yes"
203 fi
ths86b2bd92007-02-11 00:31:33 +0000204 fi
ths6b4d2ba2007-05-13 18:02:43 +0000205 if test -f /usr/include/sys/soundcard.h ; then
malc0c58ac12008-06-25 21:04:05 +0000206 audio_drv_list="oss"
ths6b4d2ba2007-05-13 18:02:43 +0000207 fi
malcc2de5c92008-06-28 19:13:06 +0000208 audio_possible_drivers="oss sdl"
ths86b2bd92007-02-11 00:31:33 +0000209;;
malcb29fe3e2008-11-18 01:42:22 +0000210AIX)
211aix="yes"
212make="gmake"
213;;
bellard1d14ffa2005-10-30 18:58:22 +0000214*)
malc0c58ac12008-06-25 21:04:05 +0000215audio_drv_list="oss"
malcb8e59f12008-07-02 21:03:08 +0000216audio_possible_drivers="oss alsa sdl esd pa"
bellard5327cf42005-01-10 23:18:50 +0000217linux="yes"
ths831b7822007-01-18 20:06:33 +0000218linux_user="yes"
bellard07f4ddb2005-04-23 17:44:28 +0000219if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000220 kqemu="yes"
malcc2de5c92008-06-28 19:13:06 +0000221 audio_possible_drivers="$audio_possible_drivers fmod"
bellardc9ec1fe2005-02-10 21:55:30 +0000222fi
bellardfb065182004-11-09 23:09:44 +0000223;;
bellard7d132992003-03-06 23:23:54 +0000224esac
225
bellard7d3505c2004-05-12 19:32:15 +0000226if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000227 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000228 make="gmake"
229 fi
blueswir184778502008-10-26 20:33:16 +0000230 bsd_user="yes"
bellard7d3505c2004-05-12 19:32:15 +0000231fi
232
bellard7d132992003-03-06 23:23:54 +0000233# find source path
pbrookad064842006-04-16 12:41:07 +0000234source_path=`dirname "$0"`
balrog59faef32008-02-03 04:22:24 +0000235source_path_used="no"
236workdir=`pwd`
pbrookad064842006-04-16 12:41:07 +0000237if [ -z "$source_path" ]; then
balrog59faef32008-02-03 04:22:24 +0000238 source_path=$workdir
pbrookad064842006-04-16 12:41:07 +0000239else
240 source_path=`cd "$source_path"; pwd`
bellard7d132992003-03-06 23:23:54 +0000241fi
pbrook724db112008-02-03 19:20:13 +0000242[ -f "$workdir/vl.c" ] || source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000243
bellard85aa5182007-11-11 20:17:03 +0000244werror="no"
bellard0d1e2392007-11-11 20:24:30 +0000245# generate compile errors on warnings for development builds
246#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
247#werror="yes";
248#fi
bellard85aa5182007-11-11 20:17:03 +0000249
bellard7d132992003-03-06 23:23:54 +0000250for opt do
pbrooka46e4032006-04-29 23:05:22 +0000251 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000252 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000253 --help|-h) show_help=yes
254 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000255 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000256 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000257 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000258 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000259 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000260 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000261 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000262 --cross-prefix=*) cross_prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000263 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000264 --cc=*) cc="$optarg"
pbrook328a4242006-12-19 03:31:34 +0000265 gcc3_search="no"
bellard7d132992003-03-06 23:23:54 +0000266 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000267 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000268 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000269 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000270 ;;
pbrook6a882642006-04-17 13:57:12 +0000271 --install=*) install="$optarg"
272 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000273 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000274 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000275 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000276 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000277 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000278 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000279 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000280 ;;
bellard7d132992003-03-06 23:23:54 +0000281 --enable-gprof) gprof="yes"
282 ;;
bellard43ce4df2003-06-09 19:53:12 +0000283 --static) static="yes"
284 ;;
bellard97a847b2003-08-10 21:36:04 +0000285 --disable-sdl) sdl="no"
286 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000287 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000288 ;;
malcc2de5c92008-06-28 19:13:06 +0000289 --fmod-inc=*) fmod_inc="$optarg"
290 ;;
blueswir12f6a1ab2008-08-21 18:00:53 +0000291 --oss-lib=*) oss_lib="$optarg"
292 ;;
malc2fa7d3b2008-07-29 12:58:44 +0000293 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
malc0c58ac12008-06-25 21:04:05 +0000294 ;;
295 --audio-drv-list=*) audio_drv_list="$optarg"
296 ;;
aliguori03b4fe72008-10-07 19:16:17 +0000297 --enable-sparse) sparse="yes"
298 ;;
299 --disable-sparse) sparse="no"
300 ;;
ths8d5d2d42007-08-25 01:37:51 +0000301 --disable-vnc-tls) vnc_tls="no"
302 ;;
bellard443f1372004-06-04 11:13:20 +0000303 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000304 ;;
aliguorie0e6c8c02008-07-23 18:14:33 +0000305 --disable-vde) vde="no"
ths8a16d272008-07-19 09:56:24 +0000306 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000307 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000308 ;;
aurel322e4d9fb2008-04-08 06:01:02 +0000309 --disable-brlapi) brlapi="no"
310 ;;
balrogfb599c92008-09-28 23:49:55 +0000311 --disable-bluez) bluez="no"
312 ;;
aliguori7ba1e612008-11-05 16:04:33 +0000313 --disable-kvm) kvm="no"
314 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000315 --enable-profiler) profiler="yes"
316 ;;
malcc2de5c92008-06-28 19:13:06 +0000317 --enable-cocoa)
318 cocoa="yes" ;
319 sdl="no" ;
320 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
bellard1d14ffa2005-10-30 18:58:22 +0000321 ;;
bellard97ccc682005-07-02 13:32:17 +0000322 --disable-gfx-check) check_gfx="no"
323 ;;
bellard1aff3812005-11-02 22:30:45 +0000324 --disable-gcc-check) check_gcc="no"
325 ;;
pbrookcad25d62006-03-19 16:31:11 +0000326 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000327 ;;
pbrookcad25d62006-03-19 16:31:11 +0000328 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000329 ;;
ths831b7822007-01-18 20:06:33 +0000330 --disable-linux-user) linux_user="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000331 ;;
ths831b7822007-01-18 20:06:33 +0000332 --enable-linux-user) linux_user="yes"
333 ;;
334 --disable-darwin-user) darwin_user="no"
335 ;;
336 --enable-darwin-user) darwin_user="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000337 ;;
blueswir184778502008-10-26 20:33:16 +0000338 --disable-bsd-user) bsd_user="no"
339 ;;
340 --enable-bsd-user) bsd_user="yes"
341 ;;
pbrookc5937222006-05-14 11:30:38 +0000342 --enable-uname-release=*) uname_release="$optarg"
343 ;;
blueswir131422552007-04-16 18:27:06 +0000344 --sparc_cpu=*)
345 sparc_cpu="$optarg"
346 case $sparc_cpu in
347 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
348 target_cpu="sparc"; cpu="sparc" ;;
349 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
350 target_cpu="sparc"; cpu="sparc" ;;
351 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
352 target_cpu="sparc64"; cpu="sparc64" ;;
353 *) echo "undefined SPARC architecture. Exiting";exit 1;;
354 esac
355 ;;
bellard85aa5182007-11-11 20:17:03 +0000356 --enable-werror) werror="yes"
357 ;;
358 --disable-werror) werror="no"
359 ;;
balrog4d3b6f62008-02-10 16:33:14 +0000360 --disable-curses) curses="no"
361 ;;
pbrookbd0c5662008-05-29 14:34:11 +0000362 --disable-nptl) nptl="no"
363 ;;
malc8ff9cbf2008-06-23 18:33:30 +0000364 --enable-mixemu) mixemu="yes"
365 ;;
blueswir1414f0da2008-08-15 18:20:52 +0000366 --disable-aio) aio="no"
367 ;;
aliguorieac30262008-11-05 16:28:56 +0000368 --kerneldir=*) kerneldir="$optarg"
369 ;;
balrog7f1559c2007-11-17 10:24:32 +0000370 *) echo "ERROR: unknown option $opt"; show_help="yes"
371 ;;
bellard7d132992003-03-06 23:23:54 +0000372 esac
373done
374
ths6f30fa82007-01-05 01:00:47 +0000375# default flags for all hosts
blueswir1ac41a622008-09-14 06:46:31 +0000376CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
377CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings"
ths6f30fa82007-01-05 01:00:47 +0000378LDFLAGS="$LDFLAGS -g"
bellard85aa5182007-11-11 20:17:03 +0000379if test "$werror" = "yes" ; then
380CFLAGS="$CFLAGS -Werror"
381fi
ths6f30fa82007-01-05 01:00:47 +0000382
blueswir1d2c7c9b2008-11-01 14:50:20 +0000383if test "$solaris" = "no" ; then
384 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
385 LDFLAGS="$LDFLAGS -Wl,--warn-common"
386 fi
blueswir149237ac2008-09-17 19:05:19 +0000387fi
388
blueswir131422552007-04-16 18:27:06 +0000389#
390# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
391# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
392#
bellard40293e52008-01-31 11:32:10 +0000393case "$cpu" in
blueswir131422552007-04-16 18:27:06 +0000394 sparc) if test -z "$sparc_cpu" ; then
395 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
396 ARCH_LDFLAGS="-m32"
397 else
398 ARCH_CFLAGS="${SP_CFLAGS}"
399 ARCH_LDFLAGS="${SP_LDFLAGS}"
400 fi
401 ;;
402 sparc64) if test -z "$sparc_cpu" ; then
403 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
404 ARCH_LDFLAGS="-m64"
405 else
406 ARCH_CFLAGS="${SP_CFLAGS}"
407 ARCH_LDFLAGS="${SP_LDFLAGS}"
408 fi
409 ;;
ths76d83bd2007-11-18 21:22:10 +0000410 s390)
411 ARCH_CFLAGS="-march=z900"
412 ;;
bellard40293e52008-01-31 11:32:10 +0000413 i386)
414 ARCH_CFLAGS="-m32"
415 ARCH_LDFLAGS="-m32"
416 ;;
417 x86_64)
418 ARCH_CFLAGS="-m64"
419 ARCH_LDFLAGS="-m64"
420 ;;
blueswir131422552007-04-16 18:27:06 +0000421esac
422
pbrookaf5db582006-04-08 14:26:41 +0000423if test x"$show_help" = x"yes" ; then
424cat << EOF
425
426Usage: configure [options]
427Options: [defaults in brackets after descriptions]
428
429EOF
430echo "Standard options:"
431echo " --help print this message"
432echo " --prefix=PREFIX install in PREFIX [$prefix]"
433echo " --interp-prefix=PREFIX where to find shared libraries, etc."
434echo " use %M for cpu name [$interp_prefix]"
435echo " --target-list=LIST set target list [$target_list]"
436echo ""
437echo "kqemu kernel acceleration support:"
438echo " --disable-kqemu disable kqemu support"
pbrookaf5db582006-04-08 14:26:41 +0000439echo ""
440echo "Advanced options (experts only):"
441echo " --source-path=PATH path of source code [$source_path]"
442echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
443echo " --cc=CC use C compiler CC [$cc]"
444echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
445echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000446echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000447echo " --static enable static build [$static]"
aliguori890b1652008-10-07 21:22:41 +0000448echo " --enable-sparse enable sparse checker"
449echo " --disable-sparse disable sparse checker (default)"
bellard85aa5182007-11-11 20:17:03 +0000450echo " --disable-werror disable compilation abort on warning"
balrogfe8f78e2007-10-31 01:03:28 +0000451echo " --disable-sdl disable SDL"
pbrookaf5db582006-04-08 14:26:41 +0000452echo " --enable-cocoa enable COCOA (Mac OS X only)"
malcc2de5c92008-06-28 19:13:06 +0000453echo " --audio-drv-list=LIST set audio drivers list:"
454echo " Available drivers: $audio_possible_drivers"
455echo " --audio-card-list=LIST set list of additional emulated audio cards"
456echo " Available cards: ac97 adlib cs4231a gus"
malc8ff9cbf2008-06-23 18:33:30 +0000457echo " --enable-mixemu enable mixer emulation"
aurel322e4d9fb2008-04-08 06:01:02 +0000458echo " --disable-brlapi disable BrlAPI"
ths8d5d2d42007-08-25 01:37:51 +0000459echo " --disable-vnc-tls disable TLS encryption for VNC server"
pbrookaf896aa2008-03-23 00:47:42 +0000460echo " --disable-curses disable curses output"
balrogfb599c92008-09-28 23:49:55 +0000461echo " --disable-bluez disable bluez stack connectivity"
aliguori7ba1e612008-11-05 16:04:33 +0000462echo " --disable-kvm disable KVM acceleration support"
pbrookbd0c5662008-05-29 14:34:11 +0000463echo " --disable-nptl disable usermode NPTL support"
pbrookaf5db582006-04-08 14:26:41 +0000464echo " --enable-system enable all system emulation targets"
465echo " --disable-system disable all system emulation targets"
ths831b7822007-01-18 20:06:33 +0000466echo " --enable-linux-user enable all linux usermode emulation targets"
467echo " --disable-linux-user disable all linux usermode emulation targets"
468echo " --enable-darwin-user enable all darwin usermode emulation targets"
469echo " --disable-darwin-user disable all darwin usermode emulation targets"
blueswir184778502008-10-26 20:33:16 +0000470echo " --enable-bsd-user enable all BSD usermode emulation targets"
471echo " --disable-bsd-user disable all BSD usermode emulation targets"
pbrookaf5db582006-04-08 14:26:41 +0000472echo " --fmod-lib path to FMOD library"
473echo " --fmod-inc path to FMOD includes"
blueswir12f6a1ab2008-08-21 18:00:53 +0000474echo " --oss-lib path to OSS library"
pbrookc5937222006-05-14 11:30:38 +0000475echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
blueswir131422552007-04-16 18:27:06 +0000476echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
aliguorie0e6c8c02008-07-23 18:14:33 +0000477echo " --disable-vde disable support for vde network"
blueswir1414f0da2008-08-15 18:20:52 +0000478echo " --disable-aio disable AIO support"
aliguorieac30262008-11-05 16:28:56 +0000479echo " --kerneldir=PATH look for kernel includes in PATH"
pbrookaf5db582006-04-08 14:26:41 +0000480echo ""
ths5bf08932006-12-23 00:33:26 +0000481echo "NOTE: The object files are built at the place where configure is launched"
pbrookaf5db582006-04-08 14:26:41 +0000482exit 1
483fi
484
bellard7d132992003-03-06 23:23:54 +0000485cc="${cross_prefix}${cc}"
486ar="${cross_prefix}${ar}"
487strip="${cross_prefix}${strip}"
488
pbrook064aae12006-05-08 00:51:44 +0000489# check that the C compiler works.
490cat > $TMPC <<EOF
491int main(void) {}
492EOF
493
pbrookdb7287e2008-02-03 16:27:13 +0000494if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
pbrook064aae12006-05-08 00:51:44 +0000495 : C compiler works ok
496else
497 echo "ERROR: \"$cc\" either does not exist or does not work"
498 exit 1
bellarda7350fa2006-04-23 14:35:23 +0000499fi
500
aliguoricd01b4a2008-08-21 19:25:45 +0000501# check compiler to see if we're on mingw32
502cat > $TMPC <<EOF
503#include <windows.h>
504#ifndef _WIN32
505#error not windows
506#endif
507int main(void) {}
508EOF
509
510if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
511 mingw32="yes"
512fi
513
bellard67b915a2004-03-31 23:37:16 +0000514if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000515 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000516 EXESUF=".exe"
bellard9f059ec2004-11-14 18:59:52 +0000517 oss="no"
aliguoricd01b4a2008-08-21 19:25:45 +0000518 linux_user="no"
blueswir184778502008-10-26 20:33:16 +0000519 bsd_user="no"
aliguoricd01b4a2008-08-21 19:25:45 +0000520fi
521
aliguori997306f2008-09-26 15:52:17 +0000522if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
aliguoricd01b4a2008-08-21 19:25:45 +0000523 AIOLIBS=
aliguori997306f2008-09-26 15:52:17 +0000524elif [ "$bsd" = "yes" ]; then
525 AIOLIBS="-lpthread"
aliguoricd01b4a2008-08-21 19:25:45 +0000526else
527 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
528 AIOLIBS="-lrt -lpthread"
bellard67b915a2004-03-31 23:37:16 +0000529fi
530
ths5fafdf22007-09-16 21:08:06 +0000531# Check for gcc4, error if pre-gcc4
pbrook328a4242006-12-19 03:31:34 +0000532if test "$check_gcc" = "yes" ; then
533 cat > $TMPC <<EOF
534#if __GNUC__ < 4
535#error gcc3
536#endif
537int main(){return 0;}
538EOF
pbrookdb7287e2008-02-03 16:27:13 +0000539 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook328a4242006-12-19 03:31:34 +0000540 echo "WARNING: \"$cc\" looks like gcc 4.x"
541 found_compat_cc="no"
542 if test "$gcc3_search" = "yes" ; then
543 echo "Looking for gcc 3.x"
544 for compat_cc in $gcc3_list ; do
balrogd4af3de2007-07-26 20:41:46 +0000545 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
pbrook328a4242006-12-19 03:31:34 +0000546 echo "Found \"$compat_cc\""
pbrook11244262007-02-27 01:03:41 +0000547 cc="$cross_prefix$compat_cc"
pbrook328a4242006-12-19 03:31:34 +0000548 found_compat_cc="yes"
549 break
550 fi
551 done
552 if test "$found_compat_cc" = "no" ; then
553 echo "gcc 3.x not found!"
554 fi
555 fi
556 if test "$found_compat_cc" = "no" ; then
557 echo "QEMU is known to have problems when compiled with gcc 4.x"
558 echo "It is recommended that you use gcc 3.x to build QEMU"
559 echo "To use this compiler anyway, configure with --disable-gcc-check"
560 exit 1;
561 fi
562 fi
563fi
564
aliguori03b4fe72008-10-07 19:16:17 +0000565if test ! -x "$(which cgcc 2>/dev/null)"; then
566 sparse="no"
567fi
568
bellardec530c82006-04-25 22:36:06 +0000569#
570# Solaris specific configure tool chain decisions
571#
572if test "$solaris" = "yes" ; then
573 #
574 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
575 # override the check with --disable-gcc-check
ths5fafdf22007-09-16 21:08:06 +0000576 #
bellardec530c82006-04-25 22:36:06 +0000577 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
578 solgcc=`which $cc`
579 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
580 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
581 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
582 echo "or get the latest patch from SunSolve for gcc"
583 exit 1
584 fi
585 fi
586 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
587 if test -z "$solinst" ; then
588 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
589 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
590 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
591 exit 1
592 fi
593 if test "$solinst" = "/usr/sbin/install" ; then
594 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
595 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
596 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
597 exit 1
598 fi
bellardec530c82006-04-25 22:36:06 +0000599 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
600 if test -z "$sol_ar" ; then
601 echo "Error: No path includes ar"
602 if test -f /usr/ccs/bin/ar ; then
603 echo "Add /usr/ccs/bin to your path and rerun configure"
604 fi
605 exit 1
606 fi
ths5fafdf22007-09-16 21:08:06 +0000607fi
bellardec530c82006-04-25 22:36:06 +0000608
609
bellard5327cf42005-01-10 23:18:50 +0000610if test -z "$target_list" ; then
611# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000612 if [ "$softmmu" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000613 target_list="\
614i386-softmmu \
615x86_64-softmmu \
616arm-softmmu \
617cris-softmmu \
618m68k-softmmu \
619mips-softmmu \
620mipsel-softmmu \
621mips64-softmmu \
622mips64el-softmmu \
623ppc-softmmu \
624ppcemb-softmmu \
625ppc64-softmmu \
626sh4-softmmu \
627sh4eb-softmmu \
628sparc-softmmu \
629"
pbrook0a8e90f2006-03-19 14:54:16 +0000630 fi
bellard5327cf42005-01-10 23:18:50 +0000631# the following are Linux specific
ths831b7822007-01-18 20:06:33 +0000632 if [ "$linux_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000633 target_list="${target_list}\
634i386-linux-user \
635x86_64-linux-user \
636alpha-linux-user \
637arm-linux-user \
638armeb-linux-user \
639cris-linux-user \
640m68k-linux-user \
641mips-linux-user \
642mipsel-linux-user \
643ppc-linux-user \
644ppc64-linux-user \
645ppc64abi32-linux-user \
646sh4-linux-user \
647sh4eb-linux-user \
648sparc-linux-user \
649sparc64-linux-user \
650sparc32plus-linux-user \
651"
ths831b7822007-01-18 20:06:33 +0000652 fi
653# the following are Darwin specific
654 if [ "$darwin_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000655 target_list="$target_list i386-darwin-user ppc-darwin-user"
bellard5327cf42005-01-10 23:18:50 +0000656 fi
blueswir184778502008-10-26 20:33:16 +0000657# the following are BSD specific
658 if [ "$bsd_user" = "yes" ] ; then
659 target_list="${target_list}\
660sparc64-bsd-user \
661"
662 fi
bellard6e20a452005-06-05 15:56:02 +0000663else
pbrookb1a550a2006-04-16 13:28:56 +0000664 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000665fi
pbrook0a8e90f2006-03-19 14:54:16 +0000666if test -z "$target_list" ; then
667 echo "No targets enabled"
668 exit 1
669fi
bellard5327cf42005-01-10 23:18:50 +0000670
bellard7d132992003-03-06 23:23:54 +0000671if test -z "$cross_prefix" ; then
672
673# ---
674# big/little endian test
675cat > $TMPC << EOF
676#include <inttypes.h>
677int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000678 volatile uint32_t i=0x01234567;
679 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000680}
681EOF
682
pbrookdb7287e2008-02-03 16:27:13 +0000683if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
bellard7d132992003-03-06 23:23:54 +0000684$TMPE && bigendian="yes"
685else
686echo big/little test failed
687fi
688
689else
690
691# if cross compiling, cannot launch a program, so make a static guess
aurel320938cda2008-04-11 21:36:06 +0000692if test "$cpu" = "armv4b" \
aurel32f54b3f92008-04-12 20:14:54 +0000693 -o "$cpu" = "hppa" \
aurel320938cda2008-04-11 21:36:06 +0000694 -o "$cpu" = "m68k" \
695 -o "$cpu" = "mips" \
696 -o "$cpu" = "mips64" \
697 -o "$cpu" = "powerpc" \
698 -o "$cpu" = "s390" \
699 -o "$cpu" = "sparc" \
700 -o "$cpu" = "sparc64"; then
bellard7d132992003-03-06 23:23:54 +0000701 bigendian="yes"
702fi
703
704fi
705
bellardb6853692005-06-05 17:10:39 +0000706# host long bits test
707hostlongbits="32"
aurel320938cda2008-04-11 21:36:06 +0000708if test "$cpu" = "x86_64" \
709 -o "$cpu" = "alpha" \
710 -o "$cpu" = "ia64" \
711 -o "$cpu" = "sparc64"; then
bellardb6853692005-06-05 17:10:39 +0000712 hostlongbits="64"
713fi
714
malc810260a2008-07-23 19:17:46 +0000715# ppc specific hostlongbits selection
716if test "$cpu" = "powerpc" ; then
malc9d56d2d2008-09-30 19:44:32 +0000717 if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev/null </dev/null; then
718 grep -q __powerpc64__ $TMPI && hostlongbits=64
malc810260a2008-07-23 19:17:46 +0000719 else
720 echo hostlongbits test failed
malcba69a082008-07-24 17:51:36 +0000721 exit 1
malc810260a2008-07-23 19:17:46 +0000722 fi
723fi
724
bellarde8cd23d2003-06-25 16:08:13 +0000725# check gcc options support
bellard04369ff2003-03-20 22:33:23 +0000726cat > $TMPC <<EOF
727int main(void) {
bellard04369ff2003-03-20 22:33:23 +0000728}
729EOF
730
pbrookbd0c5662008-05-29 14:34:11 +0000731# Check host NPTL support
732cat > $TMPC <<EOF
733#include <sched.h>
pbrook30813ce2008-06-02 15:45:44 +0000734#include <linux/futex.h>
pbrookbd0c5662008-05-29 14:34:11 +0000735void foo()
736{
737#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
738#error bork
739#endif
740}
741EOF
742
743if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
744 :
745else
746 nptl="no"
747fi
748
bellard11d9f692004-04-02 20:55:59 +0000749##########################################
balrogac629222008-10-11 09:56:04 +0000750# zlib check
751
752cat > $TMPC << EOF
753#include <zlib.h>
754int main(void) { zlibVersion(); return 0; }
755EOF
balrog17e15922008-10-11 12:00:42 +0000756if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev/null ; then
balrogac629222008-10-11 09:56:04 +0000757 :
758else
759 echo
760 echo "Error: zlib check failed"
761 echo "Make sure to have the zlib libs and headers installed."
762 echo
763 exit 1
764fi
765
766##########################################
bellard11d9f692004-04-02 20:55:59 +0000767# SDL probe
768
769sdl_too_old=no
770
771if test -z "$sdl" ; then
ths069b0bd2007-07-12 00:27:15 +0000772 sdl_config="sdl-config"
773 sdl=no
774 sdl_static=no
bellard11d9f692004-04-02 20:55:59 +0000775
776cat > $TMPC << EOF
777#include <SDL.h>
778#undef main /* We don't want SDL to override our main() */
779int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
780EOF
aliguoricd01b4a2008-08-21 19:25:45 +0000781 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
782 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
783 if test "$_sdlversion" -lt 121 ; then
784 sdl_too_old=yes
785 else
786 if test "$cocoa" = "no" ; then
787 sdl=yes
788 fi
789 fi
790
791 # static link with sdl ?
792 if test "$sdl" = "yes" ; then
793 aa="no"
794 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
795 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
796 if [ "$aa" = "yes" ] ; then
797 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
ths069b0bd2007-07-12 00:27:15 +0000798 fi
bellard11d9f692004-04-02 20:55:59 +0000799
aliguoricd01b4a2008-08-21 19:25:45 +0000800 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
801 sdl_static=yes
802 fi
803 fi # static link
804 fi # sdl compile test
bellard11d9f692004-04-02 20:55:59 +0000805else
ths069b0bd2007-07-12 00:27:15 +0000806 # Make sure to disable cocoa if sdl was set
807 if test "$sdl" = "yes" ; then
808 cocoa="no"
malcc2de5c92008-06-28 19:13:06 +0000809 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
ths069b0bd2007-07-12 00:27:15 +0000810 fi
bellarda6e022a2004-04-02 21:55:47 +0000811fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000812
ths8f28f3f2007-01-05 21:25:54 +0000813##########################################
ths8d5d2d42007-08-25 01:37:51 +0000814# VNC TLS detection
815if test "$vnc_tls" = "yes" ; then
aliguoriae6b5e52008-08-06 16:55:50 +0000816cat > $TMPC <<EOF
817#include <gnutls/gnutls.h>
818int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
819EOF
820 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
821 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
822 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
823 $vnc_tls_libs 2> /dev/null ; then
824 :
825 else
826 vnc_tls="no"
827 fi
ths8d5d2d42007-08-25 01:37:51 +0000828fi
829
830##########################################
ths8a16d272008-07-19 09:56:24 +0000831# vde libraries probe
832if test "$vde" = "yes" ; then
833 cat > $TMPC << EOF
834#include <libvdeplug.h>
pbrook4a7f0e02008-09-07 16:42:53 +0000835int main(void)
836{
837 struct vde_open_args a = {0, 0, 0};
838 vde_open("", "", &a);
839 return 0;
840}
ths8a16d272008-07-19 09:56:24 +0000841EOF
pbrook4a7f0e02008-09-07 16:42:53 +0000842 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then
ths8a16d272008-07-19 09:56:24 +0000843 :
844 else
aliguorie0e6c8c02008-07-23 18:14:33 +0000845 vde="no"
ths8a16d272008-07-19 09:56:24 +0000846 fi
847fi
848
849##########################################
malcc2de5c92008-06-28 19:13:06 +0000850# Sound support libraries probe
ths8f28f3f2007-01-05 21:25:54 +0000851
malcc2de5c92008-06-28 19:13:06 +0000852audio_drv_probe()
853{
854 drv=$1
855 hdr=$2
856 lib=$3
857 exp=$4
858 cfl=$5
859 cat > $TMPC << EOF
860#include <$hdr>
861int main(void) { $exp }
ths8f28f3f2007-01-05 21:25:54 +0000862EOF
malcc2de5c92008-06-28 19:13:06 +0000863 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then
864 :
865 else
866 echo
867 echo "Error: $drv check failed"
868 echo "Make sure to have the $drv libs and headers installed."
869 echo
870 exit 1
871 fi
872}
873
malc2fa7d3b2008-07-29 12:58:44 +0000874audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
malcc2de5c92008-06-28 19:13:06 +0000875for drv in $audio_drv_list; do
876 case $drv in
877 alsa)
878 audio_drv_probe $drv alsa/asoundlib.h -lasound \
879 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
880 ;;
881
882 fmod)
883 if test -z $fmod_lib || test -z $fmod_inc; then
884 echo
885 echo "Error: You must specify path to FMOD library and headers"
886 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
887 echo
888 exit 1
889 fi
890 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
891 ;;
892
893 esd)
894 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
895 ;;
malcb8e59f12008-07-02 21:03:08 +0000896
897 pa)
898 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
899 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
900 ;;
901
blueswir12f6a1ab2008-08-21 18:00:53 +0000902 oss|sdl|core|wav|dsound)
903 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
904 ;;
905
malce4c63a62008-07-19 16:15:16 +0000906 *)
malc1c9b2a52008-07-19 16:57:30 +0000907 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
malce4c63a62008-07-19 16:15:16 +0000908 echo
909 echo "Error: Unknown driver '$drv' selected"
910 echo "Possible drivers are: $audio_possible_drivers"
911 echo
912 exit 1
913 }
914 ;;
malcc2de5c92008-06-28 19:13:06 +0000915 esac
916done
ths8f28f3f2007-01-05 21:25:54 +0000917
balrog4d3b6f62008-02-10 16:33:14 +0000918##########################################
aurel322e4d9fb2008-04-08 06:01:02 +0000919# BrlAPI probe
920
921if test -z "$brlapi" ; then
922 brlapi=no
923cat > $TMPC << EOF
924#include <brlapi.h>
925int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
926EOF
aurel32a40e56d2008-05-04 00:50:25 +0000927 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
aurel322e4d9fb2008-04-08 06:01:02 +0000928 brlapi=yes
929 fi # brlapi compile test
930fi # -z $brlapi
931
932##########################################
balrog4d3b6f62008-02-10 16:33:14 +0000933# curses probe
934
935if test "$curses" = "yes" ; then
936 curses=no
937 cat > $TMPC << EOF
938#include <curses.h>
939int main(void) { return curses_version(); }
940EOF
pbrookaf896aa2008-03-23 00:47:42 +0000941 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
balrog4d3b6f62008-02-10 16:33:14 +0000942 curses=yes
943 fi
944fi # test "$curses"
945
blueswir1414f0da2008-08-15 18:20:52 +0000946##########################################
balrogfb599c92008-09-28 23:49:55 +0000947# bluez support probe
948if test "$bluez" = "yes" ; then
949 `pkg-config bluez` || bluez="no"
950fi
951if test "$bluez" = "yes" ; then
balroge820e3f2008-09-30 02:27:44 +0000952 cat > $TMPC << EOF
953#include <bluetooth/bluetooth.h>
954int main(void) { return bt_error(0); }
955EOF
balrogfb599c92008-09-28 23:49:55 +0000956 bluez_cflags=`pkg-config --cflags bluez`
957 bluez_libs=`pkg-config --libs bluez`
balrog17e15922008-10-11 12:00:42 +0000958 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
balroge820e3f2008-09-30 02:27:44 +0000959 $bluez_libs 2> /dev/null ; then
960 :
961 else
962 bluez="no"
963 fi
balrogfb599c92008-09-28 23:49:55 +0000964fi
965
966##########################################
aliguori7ba1e612008-11-05 16:04:33 +0000967# kvm probe
968if test "$kvm" = "yes" ; then
969 cat > $TMPC <<EOF
970#include <linux/kvm.h>
971#if !defined(KVM_API_VERSION) || \
972 KVM_API_VERSION < 12 || \
973 KVM_API_VERSION > 12 || \
974 !defined(KVM_CAP_USER_MEMORY) || \
975 !defined(KVM_CAP_SET_TSS_ADDR)
976#error Invalid KVM version
977#endif
978int main(void) { return 0; }
979EOF
aliguorieac30262008-11-05 16:28:56 +0000980 if test "$kerneldir" != "" ; then
981 kvm_cflags=-I"$kerneldir"/include
982 else
983 kvm_cflags=""
984 fi
aliguori7ba1e612008-11-05 16:04:33 +0000985 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
986 2>/dev/null ; then
987 :
988 else
989 kvm="no"
990 fi
991fi
992
993##########################################
blueswir1414f0da2008-08-15 18:20:52 +0000994# AIO probe
995if test "$aio" = "yes" ; then
996 aio=no
997 cat > $TMPC << EOF
998#include <aio.h>
999int main(void) { return aio_write(NULL); }
1000EOF
1001 if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then
1002 aio=yes
1003 fi
1004fi
1005
pbrookcc8ae6d2006-04-23 17:57:59 +00001006# Check if tools are available to build documentation.
ths6c591862007-05-09 13:55:03 +00001007if [ -x "`which texi2html 2>/dev/null`" ] && \
1008 [ -x "`which pod2man 2>/dev/null`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +00001009 build_docs="yes"
1010fi
1011
bellard11d9f692004-04-02 20:55:59 +00001012if test "$mingw32" = "yes" ; then
pbrook308c3592007-02-27 00:52:01 +00001013 if test -z "$prefix" ; then
aliguori17e90972008-10-24 14:11:41 +00001014 prefix="c:\\\\Program Files\\\\Qemu"
pbrook308c3592007-02-27 00:52:01 +00001015 fi
1016 mansuffix=""
1017 datasuffix=""
1018 docsuffix=""
1019 binsuffix=""
bellard11d9f692004-04-02 20:55:59 +00001020else
pbrook308c3592007-02-27 00:52:01 +00001021 if test -z "$prefix" ; then
1022 prefix="/usr/local"
1023 fi
1024 mansuffix="/share/man"
1025 datasuffix="/share/qemu"
1026 docsuffix="/share/doc/qemu"
1027 binsuffix="/bin"
bellard11d9f692004-04-02 20:55:59 +00001028fi
bellard5a671352003-10-01 00:13:48 +00001029
bellard43ce4df2003-06-09 19:53:12 +00001030echo "Install prefix $prefix"
pbrook308c3592007-02-27 00:52:01 +00001031echo "BIOS directory $prefix$datasuffix"
1032echo "binary directory $prefix$binsuffix"
bellard11d9f692004-04-02 20:55:59 +00001033if test "$mingw32" = "no" ; then
pbrook308c3592007-02-27 00:52:01 +00001034echo "Manual directory $prefix$mansuffix"
bellard43ce4df2003-06-09 19:53:12 +00001035echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +00001036fi
bellard5a671352003-10-01 00:13:48 +00001037echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +00001038echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +00001039echo "Host C compiler $host_cc"
pbrookdb7287e2008-02-03 16:27:13 +00001040echo "ARCH_CFLAGS $ARCH_CFLAGS"
bellard43ce4df2003-06-09 19:53:12 +00001041echo "make $make"
pbrook6a882642006-04-17 13:57:12 +00001042echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +00001043echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +00001044echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +00001045echo "target list $target_list"
bellard43ce4df2003-06-09 19:53:12 +00001046echo "gprof enabled $gprof"
aliguori03b4fe72008-10-07 19:16:17 +00001047echo "sparse enabled $sparse"
bellard05c2a3e2006-02-08 22:39:17 +00001048echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +00001049echo "static build $static"
bellard85aa5182007-11-11 20:17:03 +00001050echo "-Werror enabled $werror"
bellard5b0753e2005-03-01 21:37:28 +00001051if test "$darwin" = "yes" ; then
1052 echo "Cocoa support $cocoa"
1053fi
bellard97a847b2003-08-10 21:36:04 +00001054echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +00001055if test "$sdl" != "no" ; then
1056 echo "SDL static link $sdl_static"
1057fi
balrog4d3b6f62008-02-10 16:33:14 +00001058echo "curses support $curses"
bellard67b915a2004-03-31 23:37:16 +00001059echo "mingw32 support $mingw32"
malc0c58ac12008-06-25 21:04:05 +00001060echo "Audio drivers $audio_drv_list"
1061echo "Extra audio cards $audio_card_list"
malc8ff9cbf2008-06-23 18:33:30 +00001062echo "Mixer emulation $mixemu"
ths8d5d2d42007-08-25 01:37:51 +00001063echo "VNC TLS support $vnc_tls"
1064if test "$vnc_tls" = "yes" ; then
1065 echo " TLS CFLAGS $vnc_tls_cflags"
1066 echo " TLS LIBS $vnc_tls_libs"
1067fi
blueswir131422552007-04-16 18:27:06 +00001068if test -n "$sparc_cpu"; then
1069 echo "Target Sparc Arch $sparc_cpu"
1070fi
bellard07f4ddb2005-04-23 17:44:28 +00001071echo "kqemu support $kqemu"
aurel322e4d9fb2008-04-08 06:01:02 +00001072echo "brlapi support $brlapi"
pbrookcc8ae6d2006-04-23 17:57:59 +00001073echo "Documentation $build_docs"
pbrookc5937222006-05-14 11:30:38 +00001074[ ! -z "$uname_release" ] && \
1075echo "uname -r $uname_release"
pbrookbd0c5662008-05-29 14:34:11 +00001076echo "NPTL support $nptl"
ths8a16d272008-07-19 09:56:24 +00001077echo "vde support $vde"
blueswir1414f0da2008-08-15 18:20:52 +00001078echo "AIO support $aio"
aliguori7ba1e612008-11-05 16:04:33 +00001079echo "KVM support $kvm"
bellard67b915a2004-03-31 23:37:16 +00001080
bellard97a847b2003-08-10 21:36:04 +00001081if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +00001082echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +00001083fi
ths20b40c62007-07-11 23:39:45 +00001084if [ -s /tmp/qemu-$$-sdl-config.log ]; then
1085 echo "The error log from compiling the libSDL test is: "
1086 cat /tmp/qemu-$$-sdl-config.log
1087fi
1088rm -f /tmp/qemu-$$-sdl-config.log
bellard24b55b92005-03-01 22:30:41 +00001089#if test "$sdl_static" = "no"; then
1090# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1091#fi
bellard97a847b2003-08-10 21:36:04 +00001092config_mak="config-host.mak"
1093config_h="config-host.h"
1094
bellard7c1f25b2004-04-22 00:02:08 +00001095#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +00001096
ths15d9ca02007-07-31 23:07:32 +00001097test -f $config_h && mv $config_h ${config_h}~
1098
bellard97a847b2003-08-10 21:36:04 +00001099echo "# Automatically generated by configure - do not modify" > $config_mak
pbrook29517132006-02-09 17:58:47 +00001100echo "# Configured with: $0 $@" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001101echo "/* Automatically generated by configure - do not modify */" > $config_h
1102
1103echo "prefix=$prefix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001104echo "bindir=\${prefix}$binsuffix" >> $config_mak
1105echo "mandir=\${prefix}$mansuffix" >> $config_mak
1106echo "datadir=\${prefix}$datasuffix" >> $config_mak
ths4ad5b062007-03-03 21:47:02 +00001107echo "docdir=\${prefix}$docsuffix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001108echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001109echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +00001110echo "INSTALL=$install" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001111echo "CC=$cc" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001112echo "HOST_CC=$host_cc" >> $config_mak
1113echo "AR=$ar" >> $config_mak
1114echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
bellard40293e52008-01-31 11:32:10 +00001115# XXX: only use CFLAGS and LDFLAGS ?
1116# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1117# compilation of dyngen tool (useful for win32 build on Linux host)
ths6f30fa82007-01-05 01:00:47 +00001118echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
blueswir131422552007-04-16 18:27:06 +00001119echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1120echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1121echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001122echo "CFLAGS=$CFLAGS" >> $config_mak
1123echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +00001124echo "EXESUF=$EXESUF" >> $config_mak
ths70956b72007-03-17 15:00:37 +00001125echo "AIOLIBS=$AIOLIBS" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001126case "$cpu" in
1127 i386)
1128 echo "ARCH=i386" >> $config_mak
1129 echo "#define HOST_I386 1" >> $config_h
1130 ;;
1131 x86_64)
1132 echo "ARCH=x86_64" >> $config_mak
1133 echo "#define HOST_X86_64 1" >> $config_h
1134 ;;
1135 alpha)
1136 echo "ARCH=alpha" >> $config_mak
1137 echo "#define HOST_ALPHA 1" >> $config_h
1138 ;;
1139 armv4b)
1140 echo "ARCH=arm" >> $config_mak
1141 echo "#define HOST_ARM 1" >> $config_h
1142 ;;
1143 armv4l)
1144 echo "ARCH=arm" >> $config_mak
1145 echo "#define HOST_ARM 1" >> $config_h
1146 ;;
1147 cris)
1148 echo "ARCH=cris" >> $config_mak
1149 echo "#define HOST_CRIS 1" >> $config_h
1150 ;;
1151 hppa)
1152 echo "ARCH=hppa" >> $config_mak
1153 echo "#define HOST_HPPA 1" >> $config_h
1154 ;;
1155 ia64)
1156 echo "ARCH=ia64" >> $config_mak
1157 echo "#define HOST_IA64 1" >> $config_h
1158 ;;
1159 m68k)
1160 echo "ARCH=m68k" >> $config_mak
1161 echo "#define HOST_M68K 1" >> $config_h
1162 ;;
1163 mips)
1164 echo "ARCH=mips" >> $config_mak
1165 echo "#define HOST_MIPS 1" >> $config_h
1166 ;;
1167 mips64)
1168 echo "ARCH=mips64" >> $config_mak
1169 echo "#define HOST_MIPS64 1" >> $config_h
1170 ;;
1171 powerpc)
malc810260a2008-07-23 19:17:46 +00001172 if test "$hostlongbits" = "32"; then
1173 echo "ARCH=ppc" >> $config_mak
1174 echo "#define HOST_PPC 1" >> $config_h
1175 else
1176 echo "ARCH=ppc64" >> $config_mak
1177 echo "#define HOST_PPC64 1" >> $config_h
1178 fi
aurel322408a522008-04-20 20:19:44 +00001179 ;;
1180 s390)
1181 echo "ARCH=s390" >> $config_mak
1182 echo "#define HOST_S390 1" >> $config_h
1183 ;;
1184 sparc)
1185 echo "ARCH=sparc" >> $config_mak
1186 echo "#define HOST_SPARC 1" >> $config_h
1187 ;;
1188 sparc64)
1189 echo "ARCH=sparc64" >> $config_mak
1190 echo "#define HOST_SPARC64 1" >> $config_h
1191 ;;
1192 *)
1193 echo "Unsupported CPU = $cpu"
1194 exit 1
1195 ;;
1196esac
aliguori03b4fe72008-10-07 19:16:17 +00001197if test "$sparse" = "yes" ; then
1198 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1199 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1200 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1201fi
bellard7d132992003-03-06 23:23:54 +00001202if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001203 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1204 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1205fi
bellardb6853692005-06-05 17:10:39 +00001206echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +00001207if test "$mingw32" = "yes" ; then
1208 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +00001209 echo "#define CONFIG_WIN32 1" >> $config_h
pbrook210fa552007-02-27 21:04:49 +00001210else
1211 cat > $TMPC << EOF
1212#include <byteswap.h>
1213int main(void) { return bswap_32(0); }
1214EOF
pbrookdb7287e2008-02-03 16:27:13 +00001215 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook210fa552007-02-27 21:04:49 +00001216 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1217 fi
bellard67b915a2004-03-31 23:37:16 +00001218fi
blueswir1128ab2f2008-08-15 18:33:42 +00001219
1220if [ "$openbsd" = "yes" ] ; then
1221 echo "#define ENOTSUP 4096" >> $config_h
1222fi
1223
bellard83fb7ad2004-07-05 21:25:26 +00001224if test "$darwin" = "yes" ; then
1225 echo "CONFIG_DARWIN=yes" >> $config_mak
1226 echo "#define CONFIG_DARWIN 1" >> $config_h
1227fi
malcb29fe3e2008-11-18 01:42:22 +00001228
1229if test "$aix" = "yes" ; then
1230 echo "CONFIG_AIX=yes" >> $config_mak
1231 echo "#define CONFIG_AIX 1" >> $config_h
1232fi
1233
bellardec530c82006-04-25 22:36:06 +00001234if test "$solaris" = "yes" ; then
1235 echo "CONFIG_SOLARIS=yes" >> $config_mak
bellard38cfa062006-05-01 13:58:07 +00001236 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ths0475a5c2007-04-01 18:54:44 +00001237 if test "$needs_libsunmath" = "yes" ; then
1238 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1239 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1240 fi
bellardec530c82006-04-25 22:36:06 +00001241fi
blueswir131422552007-04-16 18:27:06 +00001242if test -n "$sparc_cpu"; then
1243 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1244 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1245fi
bellard67b915a2004-03-31 23:37:16 +00001246if test "$gdbstub" = "yes" ; then
1247 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1248 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1249fi
bellard97a847b2003-08-10 21:36:04 +00001250if test "$gprof" = "yes" ; then
1251 echo "TARGET_GPROF=yes" >> $config_mak
1252 echo "#define HAVE_GPROF 1" >> $config_h
1253fi
1254if test "$static" = "yes" ; then
1255 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +00001256 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001257fi
bellard05c2a3e2006-02-08 22:39:17 +00001258if test $profiler = "yes" ; then
1259 echo "#define CONFIG_PROFILER 1" >> $config_h
1260fi
bellardc20709a2004-04-21 23:27:19 +00001261if test "$slirp" = "yes" ; then
1262 echo "CONFIG_SLIRP=yes" >> $config_mak
1263 echo "#define CONFIG_SLIRP 1" >> $config_h
1264fi
ths8a16d272008-07-19 09:56:24 +00001265if test "$vde" = "yes" ; then
1266 echo "CONFIG_VDE=yes" >> $config_mak
1267 echo "#define CONFIG_VDE 1" >> $config_h
1268 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1269fi
malc0c58ac12008-06-25 21:04:05 +00001270for card in $audio_card_list; do
pbrookf6e58892008-06-29 01:00:34 +00001271 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001272 echo "$def=yes" >> $config_mak
1273 echo "#define $def 1" >> $config_h
1274done
1275echo "#define AUDIO_DRIVERS \\" >> $config_h
1276for drv in $audio_drv_list; do
1277 echo " &${drv}_audio_driver, \\" >>$config_h
pbrookf6e58892008-06-29 01:00:34 +00001278 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001279 echo "$def=yes" >> $config_mak
malc923e4522008-07-02 18:13:46 +00001280 if test "$drv" = "fmod"; then
malc0c58ac12008-06-25 21:04:05 +00001281 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1282 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
blueswir12f6a1ab2008-08-21 18:00:53 +00001283 elif test "$drv" = "oss"; then
1284 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
malc0c58ac12008-06-25 21:04:05 +00001285 fi
1286done
1287echo "" >>$config_h
malc8ff9cbf2008-06-23 18:33:30 +00001288if test "$mixemu" = "yes" ; then
1289 echo "CONFIG_MIXEMU=yes" >> $config_mak
1290 echo "#define CONFIG_MIXEMU 1" >> $config_h
1291fi
ths8d5d2d42007-08-25 01:37:51 +00001292if test "$vnc_tls" = "yes" ; then
1293 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1294 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1295 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1296 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1297fi
pbrookb1a550a2006-04-16 13:28:56 +00001298qemu_version=`head $source_path/VERSION`
1299echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +00001300echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001301
1302echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +00001303if [ "$source_path_used" = "yes" ]; then
1304 echo "VPATH=$source_path" >> $config_mak
1305fi
bellard97a847b2003-08-10 21:36:04 +00001306echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +00001307if [ "$build_docs" = "yes" ] ; then
1308 echo "BUILD_DOCS=yes" >> $config_mak
1309fi
bellard49ecc3f2007-11-07 19:25:15 +00001310if test "$static" = "yes"; then
1311 sdl1=$sdl_static
1312else
1313 sdl1=$sdl
1314fi
1315if test "$sdl1" = "yes" ; then
1316 echo "#define CONFIG_SDL 1" >> $config_h
1317 echo "CONFIG_SDL=yes" >> $config_mak
1318 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1319 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1320 else
1321 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1322 fi
1323 if [ "${aa}" = "yes" ] ; then
1324 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1325 else
1326 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1327 fi
1328fi
1329if test "$cocoa" = "yes" ; then
balrog4d3b6f62008-02-10 16:33:14 +00001330 echo "#define CONFIG_COCOA 1" >> $config_h
1331 echo "CONFIG_COCOA=yes" >> $config_mak
1332fi
1333if test "$curses" = "yes" ; then
1334 echo "#define CONFIG_CURSES 1" >> $config_h
1335 echo "CONFIG_CURSES=yes" >> $config_mak
1336 echo "CURSES_LIBS=-lcurses" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001337fi
aurel322e4d9fb2008-04-08 06:01:02 +00001338if test "$brlapi" = "yes" ; then
1339 echo "CONFIG_BRLAPI=yes" >> $config_mak
1340 echo "#define CONFIG_BRLAPI 1" >> $config_h
1341 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1342fi
balrogfb599c92008-09-28 23:49:55 +00001343if test "$bluez" = "yes" ; then
1344 echo "CONFIG_BLUEZ=yes" >> $config_mak
1345 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1346 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1347 echo "#define CONFIG_BLUEZ 1" >> $config_h
1348fi
blueswir1414f0da2008-08-15 18:20:52 +00001349if test "$aio" = "yes" ; then
1350 echo "#define CONFIG_AIO 1" >> $config_h
aliguoria3392f92008-09-11 18:00:19 +00001351 echo "CONFIG_AIO=yes" >> $config_mak
blueswir1414f0da2008-08-15 18:20:52 +00001352fi
bellard97a847b2003-08-10 21:36:04 +00001353
bellard83fb7ad2004-07-05 21:25:26 +00001354# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +00001355if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +00001356 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +00001357 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +00001358 echo "#define _BSD 1" >> $config_h
1359fi
1360
pbrookc5937222006-05-14 11:30:38 +00001361echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1362
pbrookc39e3332007-09-22 16:49:14 +00001363tools=
1364if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1365 tools="qemu-img\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001366 if [ "$linux" = "yes" ] ; then
1367 tools="qemu-nbd\$(EXESUF) $tools"
1368 fi
pbrookc39e3332007-09-22 16:49:14 +00001369fi
1370echo "TOOLS=$tools" >> $config_mak
1371
ths15d9ca02007-07-31 23:07:32 +00001372test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1373
bellard1d14ffa2005-10-30 18:58:22 +00001374for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +00001375target_dir="$target"
1376config_mak=$target_dir/config.mak
1377config_h=$target_dir/config.h
1378target_cpu=`echo $target | cut -d '-' -f 1`
1379target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +00001380[ "$target_cpu" = "armeb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001381[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1382[ "$target_cpu" = "mips" ] && target_bigendian=yes
1383[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1384[ "$target_cpu" = "mips64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +00001385[ "$target_cpu" = "ppc" ] && target_bigendian=yes
j_mayerd4082e92007-04-24 07:34:03 +00001386[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
j_mayer22f8a8b2007-10-14 08:38:29 +00001387[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
j_mayere85e7c62007-10-18 19:59:49 +00001388[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
pbrook908f52b2006-06-18 19:16:53 +00001389[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001390[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1391[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1392[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +00001393target_softmmu="no"
bellard997344f2003-10-27 21:10:39 +00001394target_user_only="no"
ths831b7822007-01-18 20:06:33 +00001395target_linux_user="no"
ths831b7822007-01-18 20:06:33 +00001396target_darwin_user="no"
blueswir184778502008-10-26 20:33:16 +00001397target_bsd_user="no"
pbrook9e407a82007-05-26 16:38:53 +00001398case "$target" in
1399 ${target_cpu}-softmmu)
1400 target_softmmu="yes"
1401 ;;
1402 ${target_cpu}-linux-user)
1403 target_user_only="yes"
1404 target_linux_user="yes"
1405 ;;
1406 ${target_cpu}-darwin-user)
1407 target_user_only="yes"
1408 target_darwin_user="yes"
1409 ;;
blueswir184778502008-10-26 20:33:16 +00001410 ${target_cpu}-bsd-user)
1411 target_user_only="yes"
1412 target_bsd_user="yes"
1413 ;;
pbrook9e407a82007-05-26 16:38:53 +00001414 *)
1415 echo "ERROR: Target '$target' not recognised"
1416 exit 1
1417 ;;
1418esac
ths831b7822007-01-18 20:06:33 +00001419
bellard97ccc682005-07-02 13:32:17 +00001420if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +00001421 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +00001422 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +00001423 echo "To build QEMU without graphical output configure with --disable-gfx-check"
balrog4d3b6f62008-02-10 16:33:14 +00001424 echo "Note that this will disable all output from the virtual graphics card"
1425 echo "except through VNC or curses."
bellard97ccc682005-07-02 13:32:17 +00001426 exit 1;
1427fi
1428
bellard7c1f25b2004-04-22 00:02:08 +00001429#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +00001430
ths15d9ca02007-07-31 23:07:32 +00001431test -f $config_h && mv $config_h ${config_h}~
1432
bellard97a847b2003-08-10 21:36:04 +00001433mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +00001434mkdir -p $target_dir/fpu
bellard57fec1f2008-02-01 10:50:11 +00001435mkdir -p $target_dir/tcg
blueswir184778502008-10-26 20:33:16 +00001436if 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 +00001437 mkdir -p $target_dir/nwfpe
1438fi
1439
bellardec530c82006-04-25 22:36:06 +00001440#
1441# don't use ln -sf as not all "ln -sf" over write the file/link
1442#
1443rm -f $target_dir/Makefile
1444ln -s $source_path/Makefile.target $target_dir/Makefile
1445
bellard97a847b2003-08-10 21:36:04 +00001446
1447echo "# Automatically generated by configure - do not modify" > $config_mak
1448echo "/* Automatically generated by configure - do not modify */" > $config_h
1449
1450
1451echo "include ../config-host.mak" >> $config_mak
1452echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +00001453
pbrooke5fe0c52006-06-11 13:32:59 +00001454bflt="no"
blueswir1cb33da52007-10-09 16:34:29 +00001455elfload32="no"
pbrookbd0c5662008-05-29 14:34:11 +00001456target_nptl="no"
bellard1e43adf2003-09-30 20:54:24 +00001457interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1458echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
pbrook56aebc82008-10-11 17:55:29 +00001459gdb_xml_files=""
bellard97a847b2003-08-10 21:36:04 +00001460
aliguori5985ece2008-11-05 19:59:25 +00001461# Make sure the target and host cpus are compatible
1462if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
1463 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1464 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
aliguori7ba1e612008-11-05 16:04:33 +00001465 kvm="no"
1466fi
1467# Disable KVM for linux-user
1468if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1469 kvm="no"
1470fi
1471
aurel322408a522008-04-20 20:19:44 +00001472case "$target_cpu" in
1473 i386)
1474 echo "TARGET_ARCH=i386" >> $config_mak
1475 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1476 echo "#define TARGET_I386 1" >> $config_h
bellardda260242008-05-30 20:48:25 +00001477 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
aurel322408a522008-04-20 20:19:44 +00001478 then
1479 echo "#define USE_KQEMU 1" >> $config_h
1480 fi
aliguori7ba1e612008-11-05 16:04:33 +00001481 if test "$kvm" = "yes" ; then
1482 echo "CONFIG_KVM=yes" >> $config_mak
1483 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
aliguori5985ece2008-11-05 19:59:25 +00001484 echo "#define CONFIG_KVM 1" >> $config_h
aliguori7ba1e612008-11-05 16:04:33 +00001485 fi
aurel32f2bf0942008-05-05 06:00:27 +00001486 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
pbrook11d1fdb2008-05-23 23:16:42 +00001487 if test -n "$gcc3minver" && test $gcc3minver -gt 3
aurel32f2bf0942008-05-05 06:00:27 +00001488 then
1489 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1490 else
1491 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1492 fi
aurel322408a522008-04-20 20:19:44 +00001493 ;;
1494 x86_64)
1495 echo "TARGET_ARCH=x86_64" >> $config_mak
1496 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1497 echo "#define TARGET_I386 1" >> $config_h
1498 echo "#define TARGET_X86_64 1" >> $config_h
1499 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1500 then
1501 echo "#define USE_KQEMU 1" >> $config_h
1502 fi
aliguori7ba1e612008-11-05 16:04:33 +00001503 if test "$kvm" = "yes" ; then
1504 echo "CONFIG_KVM=yes" >> $config_mak
1505 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1506 echo "#define CONFIG_KVM 1" >> $config_h
1507 fi
aurel322408a522008-04-20 20:19:44 +00001508 ;;
1509 alpha)
1510 echo "TARGET_ARCH=alpha" >> $config_mak
1511 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1512 echo "#define TARGET_ALPHA 1" >> $config_h
1513 ;;
1514 arm|armeb)
1515 echo "TARGET_ARCH=arm" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001516 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1517 echo "#define TARGET_ARM 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001518 bflt="yes"
pbrookbd0c5662008-05-29 14:34:11 +00001519 target_nptl="yes"
pbrook56aebc82008-10-11 17:55:29 +00001520 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
aurel322408a522008-04-20 20:19:44 +00001521 ;;
1522 cris)
1523 echo "TARGET_ARCH=cris" >> $config_mak
1524 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1525 echo "#define TARGET_CRIS 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001526 ;;
1527 m68k)
1528 echo "TARGET_ARCH=m68k" >> $config_mak
1529 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1530 echo "#define TARGET_M68K 1" >> $config_h
1531 bflt="yes"
pbrook56aebc82008-10-11 17:55:29 +00001532 gdb_xml_files="cf-core.xml cf-fp.xml"
aurel322408a522008-04-20 20:19:44 +00001533 ;;
1534 mips|mipsel)
1535 echo "TARGET_ARCH=mips" >> $config_mak
1536 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1537 echo "#define TARGET_MIPS 1" >> $config_h
1538 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1539 ;;
1540 mipsn32|mipsn32el)
1541 echo "TARGET_ARCH=mipsn32" >> $config_mak
1542 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1543 echo "#define TARGET_MIPS 1" >> $config_h
1544 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1545 ;;
1546 mips64|mips64el)
1547 echo "TARGET_ARCH=mips64" >> $config_mak
1548 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1549 echo "#define TARGET_MIPS 1" >> $config_h
1550 echo "#define TARGET_MIPS64 1" >> $config_h
1551 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1552 ;;
1553 ppc)
1554 echo "TARGET_ARCH=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001555 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001556 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1557 echo "#define TARGET_PPC 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001558 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001559 ;;
1560 ppcemb)
1561 echo "TARGET_ARCH=ppcemb" >> $config_mak
1562 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001563 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001564 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1565 echo "#define TARGET_PPC 1" >> $config_h
1566 echo "#define TARGET_PPCEMB 1" >> $config_h
blueswir1ec5b78c2008-05-10 17:23:18 +00001567 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001568 ;;
1569 ppc64)
1570 echo "TARGET_ARCH=ppc64" >> $config_mak
1571 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001572 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001573 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1574 echo "#define TARGET_PPC 1" >> $config_h
1575 echo "#define TARGET_PPC64 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 ppc64abi32)
1579 echo "TARGET_ARCH=ppc64" >> $config_mak
1580 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1581 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001582 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001583 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1584 echo "#define TARGET_PPC 1" >> $config_h
1585 echo "#define TARGET_PPC64 1" >> $config_h
1586 echo "#define TARGET_ABI32 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001587 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001588 ;;
1589 sh4|sh4eb)
1590 echo "TARGET_ARCH=sh4" >> $config_mak
1591 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1592 echo "#define TARGET_SH4 1" >> $config_h
1593 bflt="yes"
aurel320b6d3ae2008-09-15 07:43:43 +00001594 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001595 ;;
1596 sparc)
1597 echo "TARGET_ARCH=sparc" >> $config_mak
1598 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1599 echo "#define TARGET_SPARC 1" >> $config_h
1600 ;;
1601 sparc64)
1602 echo "TARGET_ARCH=sparc64" >> $config_mak
1603 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1604 echo "#define TARGET_SPARC 1" >> $config_h
1605 echo "#define TARGET_SPARC64 1" >> $config_h
1606 elfload32="yes"
1607 ;;
1608 sparc32plus)
1609 echo "TARGET_ARCH=sparc64" >> $config_mak
1610 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1611 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1612 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1613 echo "#define TARGET_SPARC 1" >> $config_h
1614 echo "#define TARGET_SPARC64 1" >> $config_h
1615 echo "#define TARGET_ABI32 1" >> $config_h
1616 ;;
1617 *)
1618 echo "Unsupported target CPU"
1619 exit 1
1620 ;;
1621esac
bellardde83cd02003-06-15 20:25:43 +00001622if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001623 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1624 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1625fi
1626if test "$target_softmmu" = "yes" ; then
1627 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1628 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +00001629fi
bellard997344f2003-10-27 21:10:39 +00001630if test "$target_user_only" = "yes" ; then
1631 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1632 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1633fi
ths831b7822007-01-18 20:06:33 +00001634if test "$target_linux_user" = "yes" ; then
1635 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1636 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1637fi
1638if test "$target_darwin_user" = "yes" ; then
1639 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1640 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1641fi
pbrook56aebc82008-10-11 17:55:29 +00001642list=""
1643if test ! -z "$gdb_xml_files" ; then
1644 for x in $gdb_xml_files; do
1645 list="$list $source_path/gdb-xml/$x"
1646 done
1647fi
1648echo "TARGET_XML_FILES=$list" >> $config_mak
bellardde83cd02003-06-15 20:25:43 +00001649
aurel320938cda2008-04-11 21:36:06 +00001650if test "$target_cpu" = "arm" \
1651 -o "$target_cpu" = "armeb" \
1652 -o "$target_cpu" = "m68k" \
1653 -o "$target_cpu" = "mips" \
1654 -o "$target_cpu" = "mipsel" \
1655 -o "$target_cpu" = "mipsn32" \
1656 -o "$target_cpu" = "mipsn32el" \
1657 -o "$target_cpu" = "mips64" \
1658 -o "$target_cpu" = "mips64el" \
1659 -o "$target_cpu" = "sparc" \
1660 -o "$target_cpu" = "sparc64" \
1661 -o "$target_cpu" = "sparc32plus"; then
bellard158142c2005-03-13 16:54:06 +00001662 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1663 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1664fi
pbrooke5fe0c52006-06-11 13:32:59 +00001665if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1666 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1667 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1668fi
pbrookbd0c5662008-05-29 14:34:11 +00001669if test "$target_user_only" = "yes" \
1670 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1671 echo "#define USE_NPTL 1" >> $config_h
1672fi
blueswir1cb33da52007-10-09 16:34:29 +00001673# 32 bit ELF loader in addition to native 64 bit loader?
1674if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1675 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1676 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1677fi
blueswir184778502008-10-26 20:33:16 +00001678if test "$target_bsd_user" = "yes" ; then
1679 echo "CONFIG_BSD_USER=yes" >> $config_mak
1680 echo "#define CONFIG_BSD_USER 1" >> $config_h
1681fi
bellard5b0753e2005-03-01 21:37:28 +00001682
ths15d9ca02007-07-31 23:07:32 +00001683test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1684
bellard97a847b2003-08-10 21:36:04 +00001685done # for target in $targets
bellard7d132992003-03-06 23:23:54 +00001686
1687# build tree in object directory if source path is different from current one
1688if test "$source_path_used" = "yes" ; then
bellard49ecc3f2007-11-07 19:25:15 +00001689 DIRS="tests tests/cris slirp audio"
bellard7d132992003-03-06 23:23:54 +00001690 FILES="Makefile tests/Makefile"
thse7daa602007-10-08 13:38:27 +00001691 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
edgar_igle1ffb0f2008-03-01 22:23:17 +00001692 FILES="$FILES tests/test-mmap.c"
bellard7d132992003-03-06 23:23:54 +00001693 for dir in $DIRS ; do
1694 mkdir -p $dir
1695 done
bellardec530c82006-04-25 22:36:06 +00001696 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +00001697 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +00001698 rm -f $f
1699 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +00001700 done
1701fi
bellard7d132992003-03-06 23:23:54 +00001702
malc9d56d2d2008-09-30 19:44:32 +00001703rm -f $TMPO $TMPC $TMPE $TMPS $TMPI