blob: 05ee62c2ae4e3a10ae43279f0f35864ebe2c8001 [file] [log] [blame]
bellard7d132992003-03-06 23:23:54 +00001#!/bin/sh
2#
bellard3ef693a2003-03-23 20:17:16 +00003# qemu configure script (c) 2003 Fabrice Bellard
bellard7d132992003-03-06 23:23:54 +00004#
5# set temporary file name
6if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10else
11 TMPDIR1="/tmp"
12fi
13
bellard3ef693a2003-03-23 20:17:16 +000014TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
bellard7d132992003-03-06 23:23:54 +000018
19# default parameters
bellard11d9f692004-04-02 20:55:59 +000020prefix=""
bellard1e43adf2003-09-30 20:54:24 +000021interp_prefix="/usr/gnemul/qemu-%M"
bellard43ce4df2003-06-09 19:53:12 +000022static="no"
bellard7d132992003-03-06 23:23:54 +000023cross_prefix=""
24cc="gcc"
pbrook328a4242006-12-19 03:31:34 +000025gcc3_search="yes"
balrogfe8f78e2007-10-31 01:03:28 +000026gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32"
malc0c58ac12008-06-25 21:04:05 +000027audio_drv_list=""
28audio_card_list=""
bellard7d132992003-03-06 23:23:54 +000029host_cc="gcc"
30ar="ar"
31make="make"
pbrook6a882642006-04-17 13:57:12 +000032install="install"
bellard7d132992003-03-06 23:23:54 +000033strip="strip"
34cpu=`uname -m`
bellard5327cf42005-01-10 23:18:50 +000035target_list=""
bellard7d132992003-03-06 23:23:54 +000036case "$cpu" in
37 i386|i486|i586|i686|i86pc|BePC)
bellard97a847b2003-08-10 21:36:04 +000038 cpu="i386"
bellard7d132992003-03-06 23:23:54 +000039 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000040 x86_64|amd64)
41 cpu="x86_64"
42 ;;
43 alpha)
44 cpu="alpha"
45 ;;
bellardba680552005-03-13 09:49:52 +000046 armv*b)
bellard808c4952004-12-19 23:33:47 +000047 cpu="armv4b"
48 ;;
bellardba680552005-03-13 09:49:52 +000049 armv*l)
bellard7d132992003-03-06 23:23:54 +000050 cpu="armv4l"
51 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000052 cris)
53 cpu="cris"
bellard7d132992003-03-06 23:23:54 +000054 ;;
aurel32f54b3f92008-04-12 20:14:54 +000055 parisc|parisc64)
56 cpu="hppa"
57 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000058 ia64)
59 cpu="ia64"
60 ;;
61 m68k)
62 cpu="m68k"
bellard7d132992003-03-06 23:23:54 +000063 ;;
64 mips)
65 cpu="mips"
66 ;;
thsfbe4f652007-04-01 11:16:48 +000067 mips64)
68 cpu="mips64"
69 ;;
aurel32aaa5fa12008-04-11 22:04:22 +000070 "Power Macintosh"|ppc|ppc64)
71 cpu="powerpc"
thse7daa602007-10-08 13:38:27 +000072 ;;
ths0e7b8a92007-08-01 00:09:31 +000073 s390*)
bellardfb3e5842003-03-29 17:32:36 +000074 cpu="s390"
75 ;;
blueswir131422552007-04-16 18:27:06 +000076 sparc|sun4[cdmuv])
bellardae228532003-05-13 18:59:59 +000077 cpu="sparc"
78 ;;
79 sparc64)
80 cpu="sparc64"
81 ;;
bellard7d132992003-03-06 23:23:54 +000082 *)
83 cpu="unknown"
84 ;;
85esac
86gprof="no"
87bigendian="no"
bellard67b915a2004-03-31 23:37:16 +000088mingw32="no"
89EXESUF=""
90gdbstub="yes"
bellard443f1372004-06-04 11:13:20 +000091slirp="yes"
bellard102a52e2004-11-14 19:57:29 +000092fmod_lib=""
93fmod_inc=""
ths8d5d2d42007-08-25 01:37:51 +000094vnc_tls="yes"
pbrookb1a550a2006-04-16 13:28:56 +000095bsd="no"
bellard5327cf42005-01-10 23:18:50 +000096linux="no"
bellardc9ec1fe2005-02-10 21:55:30 +000097kqemu="no"
bellard05c2a3e2006-02-08 22:39:17 +000098profiler="no"
bellard5b0753e2005-03-01 21:37:28 +000099cocoa="no"
bellard97ccc682005-07-02 13:32:17 +0000100check_gfx="yes"
bellard1aff3812005-11-02 22:30:45 +0000101check_gcc="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000102softmmu="yes"
ths831b7822007-01-18 20:06:33 +0000103linux_user="no"
104darwin_user="no"
pbrookcc8ae6d2006-04-23 17:57:59 +0000105build_docs="no"
pbrookc5937222006-05-14 11:30:38 +0000106uname_release=""
balrog4d3b6f62008-02-10 16:33:14 +0000107curses="yes"
pbrookbd0c5662008-05-29 14:34:11 +0000108nptl="yes"
malc8ff9cbf2008-06-23 18:33:30 +0000109mixemu="no"
bellard7d132992003-03-06 23:23:54 +0000110
111# OS specific
112targetos=`uname -s`
113case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000114CYGWIN*)
115mingw32="yes"
ths6f30fa82007-01-05 01:00:47 +0000116OS_CFLAGS="-mno-cygwin"
thsdb8d7dd2007-07-12 09:29:18 +0000117if [ "$cpu" = "i386" ] ; then
118 kqemu="yes"
119fi
bellardc326e0a2005-04-23 18:30:28 +0000120;;
bellard67b915a2004-03-31 23:37:16 +0000121MINGW32*)
122mingw32="yes"
thsdb8d7dd2007-07-12 09:29:18 +0000123if [ "$cpu" = "i386" ] ; then
124 kqemu="yes"
125fi
bellard67b915a2004-03-31 23:37:16 +0000126;;
ths5c40d2b2007-06-23 16:03:36 +0000127GNU/kFreeBSD)
malc0c58ac12008-06-25 21:04:05 +0000128audio_drv_list="oss"
ths5c40d2b2007-06-23 16:03:36 +0000129if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
130 kqemu="yes"
131fi
132;;
bellard7d3505c2004-05-12 19:32:15 +0000133FreeBSD)
134bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000135audio_drv_list="oss"
bellarde99f9062005-07-28 21:45:38 +0000136if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000137 kqemu="yes"
138fi
bellard7d3505c2004-05-12 19:32:15 +0000139;;
140NetBSD)
141bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000142audio_drv_list="oss"
bellard7d3505c2004-05-12 19:32:15 +0000143;;
144OpenBSD)
145bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000146audio_drv_list="oss"
bellard7d3505c2004-05-12 19:32:15 +0000147;;
bellard83fb7ad2004-07-05 21:25:26 +0000148Darwin)
149bsd="yes"
150darwin="yes"
ths831b7822007-01-18 20:06:33 +0000151darwin_user="yes"
thsfd677642007-01-31 12:10:07 +0000152cocoa="yes"
malc0c58ac12008-06-25 21:04:05 +0000153audio_drv_list="coreaudio"
ths6f30fa82007-01-05 01:00:47 +0000154OS_CFLAGS="-mdynamic-no-pic"
thsc2c59c32008-01-08 00:00:20 +0000155OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
bellard83fb7ad2004-07-05 21:25:26 +0000156;;
bellardec530c82006-04-25 22:36:06 +0000157SunOS)
thsc2b84fa2007-02-10 23:21:21 +0000158 solaris="yes"
159 make="gmake"
160 install="ginstall"
ths0475a5c2007-04-01 18:54:44 +0000161 needs_libsunmath="no"
thsc2b84fa2007-02-10 23:21:21 +0000162 solarisrev=`uname -r | cut -f2 -d.`
thsef18c882007-09-16 22:12:39 +0000163 # have to select again, because `uname -m` returns i86pc
164 # even on an x86_64 box.
165 solariscpu=`isainfo -k`
166 if test "${solariscpu}" = "amd64" ; then
167 cpu="x86_64"
168 fi
thsc2b84fa2007-02-10 23:21:21 +0000169 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
ths0475a5c2007-04-01 18:54:44 +0000170 if test "$solarisrev" -le 9 ; then
171 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
172 needs_libsunmath="yes"
173 else
174 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
175 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
176 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
177 echo "Studio 11 can be downloaded from www.sun.com."
178 exit 1
179 fi
180 fi
181 if test "$solarisrev" -ge 9 ; then
thsc2b84fa2007-02-10 23:21:21 +0000182 kqemu="yes"
183 fi
ths86b2bd92007-02-11 00:31:33 +0000184 fi
ths6b4d2ba2007-05-13 18:02:43 +0000185 if test -f /usr/include/sys/soundcard.h ; then
malc0c58ac12008-06-25 21:04:05 +0000186 audio_drv_list="oss"
ths6b4d2ba2007-05-13 18:02:43 +0000187 fi
ths86b2bd92007-02-11 00:31:33 +0000188;;
bellard1d14ffa2005-10-30 18:58:22 +0000189*)
malc0c58ac12008-06-25 21:04:05 +0000190audio_drv_list="oss"
bellard5327cf42005-01-10 23:18:50 +0000191linux="yes"
ths831b7822007-01-18 20:06:33 +0000192linux_user="yes"
bellard07f4ddb2005-04-23 17:44:28 +0000193if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000194 kqemu="yes"
195fi
bellardfb065182004-11-09 23:09:44 +0000196;;
bellard7d132992003-03-06 23:23:54 +0000197esac
198
bellard7d3505c2004-05-12 19:32:15 +0000199if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000200 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000201 make="gmake"
202 fi
bellard7d3505c2004-05-12 19:32:15 +0000203fi
204
bellard7d132992003-03-06 23:23:54 +0000205# find source path
pbrookad064842006-04-16 12:41:07 +0000206source_path=`dirname "$0"`
balrog59faef32008-02-03 04:22:24 +0000207source_path_used="no"
208workdir=`pwd`
pbrookad064842006-04-16 12:41:07 +0000209if [ -z "$source_path" ]; then
balrog59faef32008-02-03 04:22:24 +0000210 source_path=$workdir
pbrookad064842006-04-16 12:41:07 +0000211else
212 source_path=`cd "$source_path"; pwd`
bellard7d132992003-03-06 23:23:54 +0000213fi
pbrook724db112008-02-03 19:20:13 +0000214[ -f "$workdir/vl.c" ] || source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000215
bellard85aa5182007-11-11 20:17:03 +0000216werror="no"
bellard0d1e2392007-11-11 20:24:30 +0000217# generate compile errors on warnings for development builds
218#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
219#werror="yes";
220#fi
bellard85aa5182007-11-11 20:17:03 +0000221
bellard7d132992003-03-06 23:23:54 +0000222for opt do
pbrooka46e4032006-04-29 23:05:22 +0000223 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000224 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000225 --help|-h) show_help=yes
226 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000227 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000228 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000229 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000230 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000231 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000232 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000233 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000234 --cross-prefix=*) cross_prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000235 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000236 --cc=*) cc="$optarg"
pbrook328a4242006-12-19 03:31:34 +0000237 gcc3_search="no"
bellard7d132992003-03-06 23:23:54 +0000238 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000239 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000240 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000241 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000242 ;;
pbrook6a882642006-04-17 13:57:12 +0000243 --install=*) install="$optarg"
244 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000245 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000246 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000247 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000248 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000249 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000250 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000251 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000252 ;;
bellard7d132992003-03-06 23:23:54 +0000253 --enable-gprof) gprof="yes"
254 ;;
bellard43ce4df2003-06-09 19:53:12 +0000255 --static) static="yes"
256 ;;
bellard97a847b2003-08-10 21:36:04 +0000257 --disable-sdl) sdl="no"
258 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000259 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000260 ;;
malc0c58ac12008-06-25 21:04:05 +0000261 --audio-card-list=*) audio_card_list="$optarg"
262 ;;
263 --audio-drv-list=*) audio_drv_list="$optarg"
264 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000265 --fmod-inc=*) fmod_inc="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000266 ;;
ths8d5d2d42007-08-25 01:37:51 +0000267 --disable-vnc-tls) vnc_tls="no"
268 ;;
bellardb93aebe2007-02-15 22:58:18 +0000269 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no"
bellard1d14ffa2005-10-30 18:58:22 +0000270 ;;
bellard443f1372004-06-04 11:13:20 +0000271 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000272 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000273 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000274 ;;
aurel322e4d9fb2008-04-08 06:01:02 +0000275 --disable-brlapi) brlapi="no"
276 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000277 --enable-profiler) profiler="yes"
278 ;;
malc0c58ac12008-06-25 21:04:05 +0000279 --enable-cocoa) cocoa="yes" ; sdl="no" ;
bellard1d14ffa2005-10-30 18:58:22 +0000280 ;;
bellard97ccc682005-07-02 13:32:17 +0000281 --disable-gfx-check) check_gfx="no"
282 ;;
bellard1aff3812005-11-02 22:30:45 +0000283 --disable-gcc-check) check_gcc="no"
284 ;;
pbrookcad25d62006-03-19 16:31:11 +0000285 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000286 ;;
pbrookcad25d62006-03-19 16:31:11 +0000287 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000288 ;;
ths831b7822007-01-18 20:06:33 +0000289 --disable-linux-user) linux_user="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000290 ;;
ths831b7822007-01-18 20:06:33 +0000291 --enable-linux-user) linux_user="yes"
292 ;;
293 --disable-darwin-user) darwin_user="no"
294 ;;
295 --enable-darwin-user) darwin_user="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000296 ;;
pbrookc5937222006-05-14 11:30:38 +0000297 --enable-uname-release=*) uname_release="$optarg"
298 ;;
blueswir131422552007-04-16 18:27:06 +0000299 --sparc_cpu=*)
300 sparc_cpu="$optarg"
301 case $sparc_cpu in
302 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
303 target_cpu="sparc"; cpu="sparc" ;;
304 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
305 target_cpu="sparc"; cpu="sparc" ;;
306 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
307 target_cpu="sparc64"; cpu="sparc64" ;;
308 *) echo "undefined SPARC architecture. Exiting";exit 1;;
309 esac
310 ;;
bellard85aa5182007-11-11 20:17:03 +0000311 --enable-werror) werror="yes"
312 ;;
313 --disable-werror) werror="no"
314 ;;
balrog4d3b6f62008-02-10 16:33:14 +0000315 --disable-curses) curses="no"
316 ;;
pbrookbd0c5662008-05-29 14:34:11 +0000317 --disable-nptl) nptl="no"
318 ;;
malc8ff9cbf2008-06-23 18:33:30 +0000319 --enable-mixemu) mixemu="yes"
320 ;;
balrog7f1559c2007-11-17 10:24:32 +0000321 *) echo "ERROR: unknown option $opt"; show_help="yes"
322 ;;
bellard7d132992003-03-06 23:23:54 +0000323 esac
324done
325
ths209afb92007-03-25 20:55:00 +0000326if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
327 AIOLIBS=
328else
ths4259e1a2007-11-05 13:27:21 +0000329 # Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
330 AIOLIBS="-lrt -lpthread"
ths209afb92007-03-25 20:55:00 +0000331fi
332
ths6f30fa82007-01-05 01:00:47 +0000333# default flags for all hosts
334CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
335LDFLAGS="$LDFLAGS -g"
bellard85aa5182007-11-11 20:17:03 +0000336if test "$werror" = "yes" ; then
337CFLAGS="$CFLAGS -Werror"
338fi
ths6f30fa82007-01-05 01:00:47 +0000339
blueswir131422552007-04-16 18:27:06 +0000340#
341# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
342# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
343#
bellard40293e52008-01-31 11:32:10 +0000344case "$cpu" in
blueswir131422552007-04-16 18:27:06 +0000345 sparc) if test -z "$sparc_cpu" ; then
346 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
347 ARCH_LDFLAGS="-m32"
348 else
349 ARCH_CFLAGS="${SP_CFLAGS}"
350 ARCH_LDFLAGS="${SP_LDFLAGS}"
351 fi
352 ;;
353 sparc64) if test -z "$sparc_cpu" ; then
354 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
355 ARCH_LDFLAGS="-m64"
356 else
357 ARCH_CFLAGS="${SP_CFLAGS}"
358 ARCH_LDFLAGS="${SP_LDFLAGS}"
359 fi
360 ;;
ths76d83bd2007-11-18 21:22:10 +0000361 s390)
362 ARCH_CFLAGS="-march=z900"
363 ;;
bellard40293e52008-01-31 11:32:10 +0000364 i386)
365 ARCH_CFLAGS="-m32"
366 ARCH_LDFLAGS="-m32"
367 ;;
368 x86_64)
369 ARCH_CFLAGS="-m64"
370 ARCH_LDFLAGS="-m64"
371 ;;
blueswir131422552007-04-16 18:27:06 +0000372esac
373
pbrookaf5db582006-04-08 14:26:41 +0000374if test x"$show_help" = x"yes" ; then
375cat << EOF
376
377Usage: configure [options]
378Options: [defaults in brackets after descriptions]
379
380EOF
381echo "Standard options:"
382echo " --help print this message"
383echo " --prefix=PREFIX install in PREFIX [$prefix]"
384echo " --interp-prefix=PREFIX where to find shared libraries, etc."
385echo " use %M for cpu name [$interp_prefix]"
386echo " --target-list=LIST set target list [$target_list]"
387echo ""
388echo "kqemu kernel acceleration support:"
389echo " --disable-kqemu disable kqemu support"
pbrookaf5db582006-04-08 14:26:41 +0000390echo ""
391echo "Advanced options (experts only):"
392echo " --source-path=PATH path of source code [$source_path]"
393echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
394echo " --cc=CC use C compiler CC [$cc]"
395echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
396echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000397echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000398echo " --static enable static build [$static]"
bellard85aa5182007-11-11 20:17:03 +0000399echo " --disable-werror disable compilation abort on warning"
balrogfe8f78e2007-10-31 01:03:28 +0000400echo " --disable-sdl disable SDL"
pbrookaf5db582006-04-08 14:26:41 +0000401echo " --enable-cocoa enable COCOA (Mac OS X only)"
402echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
malc0c58ac12008-06-25 21:04:05 +0000403echo " --audio-drv-list set audio drivers list"
404echo " --audio-card-list set list of additional emulated audio cards"
malc8ff9cbf2008-06-23 18:33:30 +0000405echo " --enable-mixemu enable mixer emulation"
aurel322e4d9fb2008-04-08 06:01:02 +0000406echo " --disable-brlapi disable BrlAPI"
ths8d5d2d42007-08-25 01:37:51 +0000407echo " --disable-vnc-tls disable TLS encryption for VNC server"
pbrookaf896aa2008-03-23 00:47:42 +0000408echo " --disable-curses disable curses output"
pbrookbd0c5662008-05-29 14:34:11 +0000409echo " --disable-nptl disable usermode NPTL support"
pbrookaf5db582006-04-08 14:26:41 +0000410echo " --enable-system enable all system emulation targets"
411echo " --disable-system disable all system emulation targets"
ths831b7822007-01-18 20:06:33 +0000412echo " --enable-linux-user enable all linux usermode emulation targets"
413echo " --disable-linux-user disable all linux usermode emulation targets"
414echo " --enable-darwin-user enable all darwin usermode emulation targets"
415echo " --disable-darwin-user disable all darwin usermode emulation targets"
pbrookaf5db582006-04-08 14:26:41 +0000416echo " --fmod-lib path to FMOD library"
417echo " --fmod-inc path to FMOD includes"
pbrookc5937222006-05-14 11:30:38 +0000418echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
blueswir131422552007-04-16 18:27:06 +0000419echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
pbrookaf5db582006-04-08 14:26:41 +0000420echo ""
ths5bf08932006-12-23 00:33:26 +0000421echo "NOTE: The object files are built at the place where configure is launched"
pbrookaf5db582006-04-08 14:26:41 +0000422exit 1
423fi
424
bellard7d132992003-03-06 23:23:54 +0000425cc="${cross_prefix}${cc}"
426ar="${cross_prefix}${ar}"
427strip="${cross_prefix}${strip}"
428
pbrook064aae12006-05-08 00:51:44 +0000429# check that the C compiler works.
430cat > $TMPC <<EOF
431int main(void) {}
432EOF
433
pbrookdb7287e2008-02-03 16:27:13 +0000434if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
pbrook064aae12006-05-08 00:51:44 +0000435 : C compiler works ok
436else
437 echo "ERROR: \"$cc\" either does not exist or does not work"
438 exit 1
bellarda7350fa2006-04-23 14:35:23 +0000439fi
440
bellard67b915a2004-03-31 23:37:16 +0000441if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000442 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000443 EXESUF=".exe"
bellard9f059ec2004-11-14 18:59:52 +0000444 oss="no"
bellard67b915a2004-03-31 23:37:16 +0000445fi
446
ths5fafdf22007-09-16 21:08:06 +0000447# Check for gcc4, error if pre-gcc4
pbrook328a4242006-12-19 03:31:34 +0000448if test "$check_gcc" = "yes" ; then
449 cat > $TMPC <<EOF
450#if __GNUC__ < 4
451#error gcc3
452#endif
453int main(){return 0;}
454EOF
pbrookdb7287e2008-02-03 16:27:13 +0000455 if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook328a4242006-12-19 03:31:34 +0000456 echo "WARNING: \"$cc\" looks like gcc 4.x"
457 found_compat_cc="no"
458 if test "$gcc3_search" = "yes" ; then
459 echo "Looking for gcc 3.x"
460 for compat_cc in $gcc3_list ; do
balrogd4af3de2007-07-26 20:41:46 +0000461 if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then
pbrook328a4242006-12-19 03:31:34 +0000462 echo "Found \"$compat_cc\""
pbrook11244262007-02-27 01:03:41 +0000463 cc="$cross_prefix$compat_cc"
pbrook328a4242006-12-19 03:31:34 +0000464 found_compat_cc="yes"
465 break
466 fi
467 done
468 if test "$found_compat_cc" = "no" ; then
469 echo "gcc 3.x not found!"
470 fi
471 fi
472 if test "$found_compat_cc" = "no" ; then
473 echo "QEMU is known to have problems when compiled with gcc 4.x"
474 echo "It is recommended that you use gcc 3.x to build QEMU"
475 echo "To use this compiler anyway, configure with --disable-gcc-check"
476 exit 1;
477 fi
478 fi
479fi
480
bellardec530c82006-04-25 22:36:06 +0000481#
482# Solaris specific configure tool chain decisions
483#
484if test "$solaris" = "yes" ; then
485 #
486 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
487 # override the check with --disable-gcc-check
ths5fafdf22007-09-16 21:08:06 +0000488 #
bellardec530c82006-04-25 22:36:06 +0000489 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
490 solgcc=`which $cc`
491 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
492 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
493 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
494 echo "or get the latest patch from SunSolve for gcc"
495 exit 1
496 fi
497 fi
498 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
499 if test -z "$solinst" ; then
500 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
501 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
502 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
503 exit 1
504 fi
505 if test "$solinst" = "/usr/sbin/install" ; then
506 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
507 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
508 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
509 exit 1
510 fi
bellardec530c82006-04-25 22:36:06 +0000511 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
512 if test -z "$sol_ar" ; then
513 echo "Error: No path includes ar"
514 if test -f /usr/ccs/bin/ar ; then
515 echo "Add /usr/ccs/bin to your path and rerun configure"
516 fi
517 exit 1
518 fi
ths5fafdf22007-09-16 21:08:06 +0000519fi
bellardec530c82006-04-25 22:36:06 +0000520
521
bellard5327cf42005-01-10 23:18:50 +0000522if test -z "$target_list" ; then
523# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000524 if [ "$softmmu" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000525 target_list="\
526i386-softmmu \
527x86_64-softmmu \
528arm-softmmu \
529cris-softmmu \
530m68k-softmmu \
531mips-softmmu \
532mipsel-softmmu \
533mips64-softmmu \
534mips64el-softmmu \
535ppc-softmmu \
536ppcemb-softmmu \
537ppc64-softmmu \
538sh4-softmmu \
539sh4eb-softmmu \
540sparc-softmmu \
541"
pbrook0a8e90f2006-03-19 14:54:16 +0000542 fi
bellard5327cf42005-01-10 23:18:50 +0000543# the following are Linux specific
ths831b7822007-01-18 20:06:33 +0000544 if [ "$linux_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000545 target_list="${target_list}\
546i386-linux-user \
547x86_64-linux-user \
548alpha-linux-user \
549arm-linux-user \
550armeb-linux-user \
551cris-linux-user \
552m68k-linux-user \
553mips-linux-user \
554mipsel-linux-user \
555ppc-linux-user \
556ppc64-linux-user \
557ppc64abi32-linux-user \
558sh4-linux-user \
559sh4eb-linux-user \
560sparc-linux-user \
561sparc64-linux-user \
562sparc32plus-linux-user \
563"
ths831b7822007-01-18 20:06:33 +0000564 fi
565# the following are Darwin specific
566 if [ "$darwin_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000567 target_list="$target_list i386-darwin-user ppc-darwin-user"
bellard5327cf42005-01-10 23:18:50 +0000568 fi
bellard6e20a452005-06-05 15:56:02 +0000569else
pbrookb1a550a2006-04-16 13:28:56 +0000570 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000571fi
pbrook0a8e90f2006-03-19 14:54:16 +0000572if test -z "$target_list" ; then
573 echo "No targets enabled"
574 exit 1
575fi
bellard5327cf42005-01-10 23:18:50 +0000576
bellard7d132992003-03-06 23:23:54 +0000577if test -z "$cross_prefix" ; then
578
579# ---
580# big/little endian test
581cat > $TMPC << EOF
582#include <inttypes.h>
583int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000584 volatile uint32_t i=0x01234567;
585 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000586}
587EOF
588
pbrookdb7287e2008-02-03 16:27:13 +0000589if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
bellard7d132992003-03-06 23:23:54 +0000590$TMPE && bigendian="yes"
591else
592echo big/little test failed
593fi
594
595else
596
597# if cross compiling, cannot launch a program, so make a static guess
aurel320938cda2008-04-11 21:36:06 +0000598if test "$cpu" = "armv4b" \
aurel32f54b3f92008-04-12 20:14:54 +0000599 -o "$cpu" = "hppa" \
aurel320938cda2008-04-11 21:36:06 +0000600 -o "$cpu" = "m68k" \
601 -o "$cpu" = "mips" \
602 -o "$cpu" = "mips64" \
603 -o "$cpu" = "powerpc" \
604 -o "$cpu" = "s390" \
605 -o "$cpu" = "sparc" \
606 -o "$cpu" = "sparc64"; then
bellard7d132992003-03-06 23:23:54 +0000607 bigendian="yes"
608fi
609
610fi
611
bellardb6853692005-06-05 17:10:39 +0000612# host long bits test
613hostlongbits="32"
aurel320938cda2008-04-11 21:36:06 +0000614if test "$cpu" = "x86_64" \
615 -o "$cpu" = "alpha" \
616 -o "$cpu" = "ia64" \
617 -o "$cpu" = "sparc64"; then
bellardb6853692005-06-05 17:10:39 +0000618 hostlongbits="64"
619fi
620
bellarde8cd23d2003-06-25 16:08:13 +0000621# check gcc options support
bellard04369ff2003-03-20 22:33:23 +0000622cat > $TMPC <<EOF
623int main(void) {
bellard04369ff2003-03-20 22:33:23 +0000624}
625EOF
626
pbrookbd0c5662008-05-29 14:34:11 +0000627# Check host NPTL support
628cat > $TMPC <<EOF
629#include <sched.h>
pbrook30813ce2008-06-02 15:45:44 +0000630#include <linux/futex.h>
pbrookbd0c5662008-05-29 14:34:11 +0000631void foo()
632{
633#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
634#error bork
635#endif
636}
637EOF
638
639if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then
640 :
641else
642 nptl="no"
643fi
644
bellard11d9f692004-04-02 20:55:59 +0000645##########################################
646# SDL probe
647
648sdl_too_old=no
649
650if test -z "$sdl" ; then
ths069b0bd2007-07-12 00:27:15 +0000651 sdl_config="sdl-config"
652 sdl=no
653 sdl_static=no
bellard11d9f692004-04-02 20:55:59 +0000654
ths069b0bd2007-07-12 00:27:15 +0000655 if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
656 # win32 cross compilation case
657 sdl_config="i386-mingw32msvc-sdl-config"
658 sdl=yes
659 else
660 # normal SDL probe
bellard11d9f692004-04-02 20:55:59 +0000661cat > $TMPC << EOF
662#include <SDL.h>
663#undef main /* We don't want SDL to override our main() */
664int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
665EOF
pbrookdb7287e2008-02-03 16:27:13 +0000666 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
ths069b0bd2007-07-12 00:27:15 +0000667 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
668 if test "$_sdlversion" -lt 121 ; then
669 sdl_too_old=yes
670 else
671 if test "$cocoa" = "no" ; then
672 sdl=yes
673 fi
674 fi
bellard11d9f692004-04-02 20:55:59 +0000675
ths069b0bd2007-07-12 00:27:15 +0000676 # static link with sdl ?
677 if test "$sdl" = "yes" ; then
678 aa="no"
679 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
680 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
681 if [ "$aa" = "yes" ] ; then
682 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
683 fi
684
ths8281db42007-11-18 21:37:07 +0000685 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
ths069b0bd2007-07-12 00:27:15 +0000686 sdl_static=yes
687 fi
688 fi # static link
689 fi # sdl compile test
690 fi # cross compilation
bellard11d9f692004-04-02 20:55:59 +0000691else
ths069b0bd2007-07-12 00:27:15 +0000692 # Make sure to disable cocoa if sdl was set
693 if test "$sdl" = "yes" ; then
694 cocoa="no"
malc0c58ac12008-06-25 21:04:05 +0000695 audio_drv_list="echo $audio_drv_list | sed s,coreaudio,,g"
ths069b0bd2007-07-12 00:27:15 +0000696 fi
bellarda6e022a2004-04-02 21:55:47 +0000697fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000698
ths8f28f3f2007-01-05 21:25:54 +0000699##########################################
ths8d5d2d42007-08-25 01:37:51 +0000700# VNC TLS detection
701if test "$vnc_tls" = "yes" ; then
702 `pkg-config gnutls` || vnc_tls="no"
703fi
704if test "$vnc_tls" = "yes" ; then
705 vnc_tls_cflags=`pkg-config --cflags gnutls`
706 vnc_tls_libs=`pkg-config --libs gnutls`
707fi
708
709##########################################
ths8f28f3f2007-01-05 21:25:54 +0000710# alsa sound support libraries
711
712if test "$alsa" = "yes" ; then
713 cat > $TMPC << EOF
714#include <alsa/asoundlib.h>
715int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); }
716EOF
pbrookdb7287e2008-02-03 16:27:13 +0000717 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then
ths8f28f3f2007-01-05 21:25:54 +0000718 :
719 else
720 echo
721 echo "Error: Could not find alsa"
722 echo "Make sure to have the alsa libs and headers installed."
723 echo
724 exit 1
725 fi
726fi
727
balrog4d3b6f62008-02-10 16:33:14 +0000728##########################################
aurel322e4d9fb2008-04-08 06:01:02 +0000729# BrlAPI probe
730
731if test -z "$brlapi" ; then
732 brlapi=no
733cat > $TMPC << EOF
734#include <brlapi.h>
735int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
736EOF
aurel32a40e56d2008-05-04 00:50:25 +0000737 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then
aurel322e4d9fb2008-04-08 06:01:02 +0000738 brlapi=yes
739 fi # brlapi compile test
740fi # -z $brlapi
741
742##########################################
balrog4d3b6f62008-02-10 16:33:14 +0000743# curses probe
744
745if test "$curses" = "yes" ; then
746 curses=no
747 cat > $TMPC << EOF
748#include <curses.h>
749int main(void) { return curses_version(); }
750EOF
pbrookaf896aa2008-03-23 00:47:42 +0000751 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then
balrog4d3b6f62008-02-10 16:33:14 +0000752 curses=yes
753 fi
754fi # test "$curses"
755
pbrookcc8ae6d2006-04-23 17:57:59 +0000756# Check if tools are available to build documentation.
ths6c591862007-05-09 13:55:03 +0000757if [ -x "`which texi2html 2>/dev/null`" ] && \
758 [ -x "`which pod2man 2>/dev/null`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +0000759 build_docs="yes"
760fi
761
bellard11d9f692004-04-02 20:55:59 +0000762if test "$mingw32" = "yes" ; then
pbrook308c3592007-02-27 00:52:01 +0000763 if test -z "$prefix" ; then
764 prefix="/c/Program Files/Qemu"
765 fi
766 mansuffix=""
767 datasuffix=""
768 docsuffix=""
769 binsuffix=""
bellard11d9f692004-04-02 20:55:59 +0000770else
pbrook308c3592007-02-27 00:52:01 +0000771 if test -z "$prefix" ; then
772 prefix="/usr/local"
773 fi
774 mansuffix="/share/man"
775 datasuffix="/share/qemu"
776 docsuffix="/share/doc/qemu"
777 binsuffix="/bin"
bellard11d9f692004-04-02 20:55:59 +0000778fi
bellard5a671352003-10-01 00:13:48 +0000779
bellard43ce4df2003-06-09 19:53:12 +0000780echo "Install prefix $prefix"
pbrook308c3592007-02-27 00:52:01 +0000781echo "BIOS directory $prefix$datasuffix"
782echo "binary directory $prefix$binsuffix"
bellard11d9f692004-04-02 20:55:59 +0000783if test "$mingw32" = "no" ; then
pbrook308c3592007-02-27 00:52:01 +0000784echo "Manual directory $prefix$mansuffix"
bellard43ce4df2003-06-09 19:53:12 +0000785echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +0000786fi
bellard5a671352003-10-01 00:13:48 +0000787echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +0000788echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +0000789echo "Host C compiler $host_cc"
pbrookdb7287e2008-02-03 16:27:13 +0000790echo "ARCH_CFLAGS $ARCH_CFLAGS"
bellard43ce4df2003-06-09 19:53:12 +0000791echo "make $make"
pbrook6a882642006-04-17 13:57:12 +0000792echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +0000793echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +0000794echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +0000795echo "target list $target_list"
bellard43ce4df2003-06-09 19:53:12 +0000796echo "gprof enabled $gprof"
bellard05c2a3e2006-02-08 22:39:17 +0000797echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +0000798echo "static build $static"
bellard85aa5182007-11-11 20:17:03 +0000799echo "-Werror enabled $werror"
bellard5b0753e2005-03-01 21:37:28 +0000800if test "$darwin" = "yes" ; then
801 echo "Cocoa support $cocoa"
802fi
bellard97a847b2003-08-10 21:36:04 +0000803echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +0000804if test "$sdl" != "no" ; then
805 echo "SDL static link $sdl_static"
806fi
balrog4d3b6f62008-02-10 16:33:14 +0000807echo "curses support $curses"
bellard67b915a2004-03-31 23:37:16 +0000808echo "mingw32 support $mingw32"
malc0c58ac12008-06-25 21:04:05 +0000809echo "Audio drivers $audio_drv_list"
810echo "Extra audio cards $audio_card_list"
malc8ff9cbf2008-06-23 18:33:30 +0000811echo "Mixer emulation $mixemu"
bellard1d14ffa2005-10-30 18:58:22 +0000812if test "$fmod" = "yes"; then
813 if test -z $fmod_lib || test -z $fmod_inc; then
814 echo
815 echo "Error: You must specify path to FMOD library and headers"
816 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
817 echo
818 exit 1
819 fi
pbrookb1a550a2006-04-16 13:28:56 +0000820 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
821else
822 fmod_support=""
bellard102a52e2004-11-14 19:57:29 +0000823fi
pbrookb1a550a2006-04-16 13:28:56 +0000824echo "FMOD support $fmod $fmod_support"
ths6b4d2ba2007-05-13 18:02:43 +0000825echo "OSS support $oss"
ths8d5d2d42007-08-25 01:37:51 +0000826echo "VNC TLS support $vnc_tls"
827if test "$vnc_tls" = "yes" ; then
828 echo " TLS CFLAGS $vnc_tls_cflags"
829 echo " TLS LIBS $vnc_tls_libs"
830fi
blueswir131422552007-04-16 18:27:06 +0000831if test -n "$sparc_cpu"; then
832 echo "Target Sparc Arch $sparc_cpu"
833fi
bellard07f4ddb2005-04-23 17:44:28 +0000834echo "kqemu support $kqemu"
aurel322e4d9fb2008-04-08 06:01:02 +0000835echo "brlapi support $brlapi"
pbrookcc8ae6d2006-04-23 17:57:59 +0000836echo "Documentation $build_docs"
pbrookc5937222006-05-14 11:30:38 +0000837[ ! -z "$uname_release" ] && \
838echo "uname -r $uname_release"
pbrookbd0c5662008-05-29 14:34:11 +0000839echo "NPTL support $nptl"
bellard67b915a2004-03-31 23:37:16 +0000840
bellard97a847b2003-08-10 21:36:04 +0000841if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +0000842echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +0000843fi
ths20b40c62007-07-11 23:39:45 +0000844if [ -s /tmp/qemu-$$-sdl-config.log ]; then
845 echo "The error log from compiling the libSDL test is: "
846 cat /tmp/qemu-$$-sdl-config.log
847fi
848rm -f /tmp/qemu-$$-sdl-config.log
bellard24b55b92005-03-01 22:30:41 +0000849#if test "$sdl_static" = "no"; then
850# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
851#fi
bellard97a847b2003-08-10 21:36:04 +0000852config_mak="config-host.mak"
853config_h="config-host.h"
854
bellard7c1f25b2004-04-22 00:02:08 +0000855#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +0000856
ths15d9ca02007-07-31 23:07:32 +0000857test -f $config_h && mv $config_h ${config_h}~
858
bellard97a847b2003-08-10 21:36:04 +0000859echo "# Automatically generated by configure - do not modify" > $config_mak
pbrook29517132006-02-09 17:58:47 +0000860echo "# Configured with: $0 $@" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000861echo "/* Automatically generated by configure - do not modify */" > $config_h
862
863echo "prefix=$prefix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +0000864echo "bindir=\${prefix}$binsuffix" >> $config_mak
865echo "mandir=\${prefix}$mansuffix" >> $config_mak
866echo "datadir=\${prefix}$datasuffix" >> $config_mak
ths4ad5b062007-03-03 21:47:02 +0000867echo "docdir=\${prefix}$docsuffix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +0000868echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000869echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +0000870echo "INSTALL=$install" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000871echo "CC=$cc" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000872echo "HOST_CC=$host_cc" >> $config_mak
873echo "AR=$ar" >> $config_mak
874echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
bellard40293e52008-01-31 11:32:10 +0000875# XXX: only use CFLAGS and LDFLAGS ?
876# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
877# compilation of dyngen tool (useful for win32 build on Linux host)
ths6f30fa82007-01-05 01:00:47 +0000878echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
blueswir131422552007-04-16 18:27:06 +0000879echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
880echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
881echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000882echo "CFLAGS=$CFLAGS" >> $config_mak
883echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +0000884echo "EXESUF=$EXESUF" >> $config_mak
ths70956b72007-03-17 15:00:37 +0000885echo "AIOLIBS=$AIOLIBS" >> $config_mak
aurel322408a522008-04-20 20:19:44 +0000886case "$cpu" in
887 i386)
888 echo "ARCH=i386" >> $config_mak
889 echo "#define HOST_I386 1" >> $config_h
890 ;;
891 x86_64)
892 echo "ARCH=x86_64" >> $config_mak
893 echo "#define HOST_X86_64 1" >> $config_h
894 ;;
895 alpha)
896 echo "ARCH=alpha" >> $config_mak
897 echo "#define HOST_ALPHA 1" >> $config_h
898 ;;
899 armv4b)
900 echo "ARCH=arm" >> $config_mak
901 echo "#define HOST_ARM 1" >> $config_h
902 ;;
903 armv4l)
904 echo "ARCH=arm" >> $config_mak
905 echo "#define HOST_ARM 1" >> $config_h
906 ;;
907 cris)
908 echo "ARCH=cris" >> $config_mak
909 echo "#define HOST_CRIS 1" >> $config_h
910 ;;
911 hppa)
912 echo "ARCH=hppa" >> $config_mak
913 echo "#define HOST_HPPA 1" >> $config_h
914 ;;
915 ia64)
916 echo "ARCH=ia64" >> $config_mak
917 echo "#define HOST_IA64 1" >> $config_h
918 ;;
919 m68k)
920 echo "ARCH=m68k" >> $config_mak
921 echo "#define HOST_M68K 1" >> $config_h
922 ;;
923 mips)
924 echo "ARCH=mips" >> $config_mak
925 echo "#define HOST_MIPS 1" >> $config_h
926 ;;
927 mips64)
928 echo "ARCH=mips64" >> $config_mak
929 echo "#define HOST_MIPS64 1" >> $config_h
930 ;;
931 powerpc)
932 echo "ARCH=ppc" >> $config_mak
933 echo "#define HOST_PPC 1" >> $config_h
934 ;;
935 s390)
936 echo "ARCH=s390" >> $config_mak
937 echo "#define HOST_S390 1" >> $config_h
938 ;;
939 sparc)
940 echo "ARCH=sparc" >> $config_mak
941 echo "#define HOST_SPARC 1" >> $config_h
942 ;;
943 sparc64)
944 echo "ARCH=sparc64" >> $config_mak
945 echo "#define HOST_SPARC64 1" >> $config_h
946 ;;
947 *)
948 echo "Unsupported CPU = $cpu"
949 exit 1
950 ;;
951esac
bellard7d132992003-03-06 23:23:54 +0000952if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +0000953 echo "WORDS_BIGENDIAN=yes" >> $config_mak
954 echo "#define WORDS_BIGENDIAN 1" >> $config_h
955fi
bellardb6853692005-06-05 17:10:39 +0000956echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +0000957if test "$mingw32" = "yes" ; then
958 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +0000959 echo "#define CONFIG_WIN32 1" >> $config_h
pbrook210fa552007-02-27 21:04:49 +0000960else
961 cat > $TMPC << EOF
962#include <byteswap.h>
963int main(void) { return bswap_32(0); }
964EOF
pbrookdb7287e2008-02-03 16:27:13 +0000965 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
pbrook210fa552007-02-27 21:04:49 +0000966 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
967 fi
bellard67b915a2004-03-31 23:37:16 +0000968fi
bellard83fb7ad2004-07-05 21:25:26 +0000969if test "$darwin" = "yes" ; then
970 echo "CONFIG_DARWIN=yes" >> $config_mak
971 echo "#define CONFIG_DARWIN 1" >> $config_h
972fi
bellardec530c82006-04-25 22:36:06 +0000973if test "$solaris" = "yes" ; then
974 echo "CONFIG_SOLARIS=yes" >> $config_mak
bellard38cfa062006-05-01 13:58:07 +0000975 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ths0475a5c2007-04-01 18:54:44 +0000976 if test "$needs_libsunmath" = "yes" ; then
977 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
978 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
979 fi
bellardec530c82006-04-25 22:36:06 +0000980fi
blueswir131422552007-04-16 18:27:06 +0000981if test -n "$sparc_cpu"; then
982 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
983 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
984fi
bellard67b915a2004-03-31 23:37:16 +0000985if test "$gdbstub" = "yes" ; then
986 echo "CONFIG_GDBSTUB=yes" >> $config_mak
987 echo "#define CONFIG_GDBSTUB 1" >> $config_h
988fi
bellard97a847b2003-08-10 21:36:04 +0000989if test "$gprof" = "yes" ; then
990 echo "TARGET_GPROF=yes" >> $config_mak
991 echo "#define HAVE_GPROF 1" >> $config_h
992fi
993if test "$static" = "yes" ; then
994 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +0000995 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000996fi
bellard05c2a3e2006-02-08 22:39:17 +0000997if test $profiler = "yes" ; then
998 echo "#define CONFIG_PROFILER 1" >> $config_h
999fi
bellardc20709a2004-04-21 23:27:19 +00001000if test "$slirp" = "yes" ; then
1001 echo "CONFIG_SLIRP=yes" >> $config_mak
1002 echo "#define CONFIG_SLIRP 1" >> $config_h
1003fi
malc0c58ac12008-06-25 21:04:05 +00001004for card in $audio_card_list; do
1005 def=CONFIG_`echo $card | tr [:lower:] [:upper:]`
1006 echo "$def=yes" >> $config_mak
1007 echo "#define $def 1" >> $config_h
1008done
1009echo "#define AUDIO_DRIVERS \\" >> $config_h
1010for drv in $audio_drv_list; do
1011 echo " &${drv}_audio_driver, \\" >>$config_h
1012 def=CONFIG_`echo $drv | tr [:lower:] [:upper:]`
1013 echo "$def=yes" >> $config_mak
1014 if test "$drv" == "fmod"; then
1015 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1016 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
1017 fi
1018done
1019echo "" >>$config_h
malc8ff9cbf2008-06-23 18:33:30 +00001020if test "$mixemu" = "yes" ; then
1021 echo "CONFIG_MIXEMU=yes" >> $config_mak
1022 echo "#define CONFIG_MIXEMU 1" >> $config_h
1023fi
ths8d5d2d42007-08-25 01:37:51 +00001024if test "$vnc_tls" = "yes" ; then
1025 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1026 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1027 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1028 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1029fi
pbrookb1a550a2006-04-16 13:28:56 +00001030qemu_version=`head $source_path/VERSION`
1031echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +00001032echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001033
1034echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +00001035if [ "$source_path_used" = "yes" ]; then
1036 echo "VPATH=$source_path" >> $config_mak
1037fi
bellard97a847b2003-08-10 21:36:04 +00001038echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +00001039if [ "$build_docs" = "yes" ] ; then
1040 echo "BUILD_DOCS=yes" >> $config_mak
1041fi
bellard49ecc3f2007-11-07 19:25:15 +00001042if test "$static" = "yes"; then
1043 sdl1=$sdl_static
1044else
1045 sdl1=$sdl
1046fi
1047if test "$sdl1" = "yes" ; then
1048 echo "#define CONFIG_SDL 1" >> $config_h
1049 echo "CONFIG_SDL=yes" >> $config_mak
1050 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1051 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
1052 else
1053 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1054 fi
1055 if [ "${aa}" = "yes" ] ; then
1056 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1057 else
1058 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1059 fi
1060fi
1061if test "$cocoa" = "yes" ; then
balrog4d3b6f62008-02-10 16:33:14 +00001062 echo "#define CONFIG_COCOA 1" >> $config_h
1063 echo "CONFIG_COCOA=yes" >> $config_mak
1064fi
1065if test "$curses" = "yes" ; then
1066 echo "#define CONFIG_CURSES 1" >> $config_h
1067 echo "CONFIG_CURSES=yes" >> $config_mak
1068 echo "CURSES_LIBS=-lcurses" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001069fi
aurel322e4d9fb2008-04-08 06:01:02 +00001070if test "$brlapi" = "yes" ; then
1071 echo "CONFIG_BRLAPI=yes" >> $config_mak
1072 echo "#define CONFIG_BRLAPI 1" >> $config_h
1073 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1074fi
bellard97a847b2003-08-10 21:36:04 +00001075
bellard83fb7ad2004-07-05 21:25:26 +00001076# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +00001077if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +00001078 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +00001079 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +00001080 echo "#define _BSD 1" >> $config_h
1081fi
1082
pbrookc5937222006-05-14 11:30:38 +00001083echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1084
pbrookc39e3332007-09-22 16:49:14 +00001085tools=
1086if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
1087 tools="qemu-img\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001088 if [ "$linux" = "yes" ] ; then
1089 tools="qemu-nbd\$(EXESUF) $tools"
1090 fi
pbrookc39e3332007-09-22 16:49:14 +00001091fi
1092echo "TOOLS=$tools" >> $config_mak
1093
ths15d9ca02007-07-31 23:07:32 +00001094test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1095
bellard1d14ffa2005-10-30 18:58:22 +00001096for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +00001097target_dir="$target"
1098config_mak=$target_dir/config.mak
1099config_h=$target_dir/config.h
1100target_cpu=`echo $target | cut -d '-' -f 1`
1101target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +00001102[ "$target_cpu" = "armeb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001103[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1104[ "$target_cpu" = "mips" ] && target_bigendian=yes
1105[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1106[ "$target_cpu" = "mips64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +00001107[ "$target_cpu" = "ppc" ] && target_bigendian=yes
j_mayerd4082e92007-04-24 07:34:03 +00001108[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
j_mayer22f8a8b2007-10-14 08:38:29 +00001109[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
j_mayere85e7c62007-10-18 19:59:49 +00001110[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
pbrook908f52b2006-06-18 19:16:53 +00001111[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001112[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1113[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1114[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +00001115target_softmmu="no"
bellard997344f2003-10-27 21:10:39 +00001116target_user_only="no"
ths831b7822007-01-18 20:06:33 +00001117target_linux_user="no"
ths831b7822007-01-18 20:06:33 +00001118target_darwin_user="no"
pbrook9e407a82007-05-26 16:38:53 +00001119case "$target" in
1120 ${target_cpu}-softmmu)
1121 target_softmmu="yes"
1122 ;;
1123 ${target_cpu}-linux-user)
1124 target_user_only="yes"
1125 target_linux_user="yes"
1126 ;;
1127 ${target_cpu}-darwin-user)
1128 target_user_only="yes"
1129 target_darwin_user="yes"
1130 ;;
1131 *)
1132 echo "ERROR: Target '$target' not recognised"
1133 exit 1
1134 ;;
1135esac
ths831b7822007-01-18 20:06:33 +00001136
bellard97ccc682005-07-02 13:32:17 +00001137if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +00001138 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +00001139 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +00001140 echo "To build QEMU without graphical output configure with --disable-gfx-check"
balrog4d3b6f62008-02-10 16:33:14 +00001141 echo "Note that this will disable all output from the virtual graphics card"
1142 echo "except through VNC or curses."
bellard97ccc682005-07-02 13:32:17 +00001143 exit 1;
1144fi
1145
bellard7c1f25b2004-04-22 00:02:08 +00001146#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +00001147
ths15d9ca02007-07-31 23:07:32 +00001148test -f $config_h && mv $config_h ${config_h}~
1149
bellard97a847b2003-08-10 21:36:04 +00001150mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +00001151mkdir -p $target_dir/fpu
bellard57fec1f2008-02-01 10:50:11 +00001152mkdir -p $target_dir/tcg
ths831b7822007-01-18 20:06:33 +00001153if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then
bellard69de9272004-02-16 21:40:43 +00001154 mkdir -p $target_dir/nwfpe
1155fi
1156
bellardec530c82006-04-25 22:36:06 +00001157#
1158# don't use ln -sf as not all "ln -sf" over write the file/link
1159#
1160rm -f $target_dir/Makefile
1161ln -s $source_path/Makefile.target $target_dir/Makefile
1162
bellard97a847b2003-08-10 21:36:04 +00001163
1164echo "# Automatically generated by configure - do not modify" > $config_mak
1165echo "/* Automatically generated by configure - do not modify */" > $config_h
1166
1167
1168echo "include ../config-host.mak" >> $config_mak
1169echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +00001170
pbrooke5fe0c52006-06-11 13:32:59 +00001171bflt="no"
blueswir1cb33da52007-10-09 16:34:29 +00001172elfload32="no"
pbrookbd0c5662008-05-29 14:34:11 +00001173target_nptl="no"
bellard1e43adf2003-09-30 20:54:24 +00001174interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1175echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001176
aurel322408a522008-04-20 20:19:44 +00001177case "$target_cpu" in
1178 i386)
1179 echo "TARGET_ARCH=i386" >> $config_mak
1180 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1181 echo "#define TARGET_I386 1" >> $config_h
bellardda260242008-05-30 20:48:25 +00001182 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
aurel322408a522008-04-20 20:19:44 +00001183 then
1184 echo "#define USE_KQEMU 1" >> $config_h
1185 fi
aurel32f2bf0942008-05-05 06:00:27 +00001186 gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.`
pbrook11d1fdb2008-05-23 23:16:42 +00001187 if test -n "$gcc3minver" && test $gcc3minver -gt 3
aurel32f2bf0942008-05-05 06:00:27 +00001188 then
1189 echo "HAVE_GT_GCC_3_3=true" >> $config_mak
1190 else
1191 echo "HAVE_GT_GCC_3_3=false" >> $config_mak
1192 fi
aurel322408a522008-04-20 20:19:44 +00001193 ;;
1194 x86_64)
1195 echo "TARGET_ARCH=x86_64" >> $config_mak
1196 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1197 echo "#define TARGET_I386 1" >> $config_h
1198 echo "#define TARGET_X86_64 1" >> $config_h
1199 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1200 then
1201 echo "#define USE_KQEMU 1" >> $config_h
1202 fi
1203 ;;
1204 alpha)
1205 echo "TARGET_ARCH=alpha" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001206 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001207 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1208 echo "#define TARGET_ALPHA 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001209 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001210 ;;
1211 arm|armeb)
1212 echo "TARGET_ARCH=arm" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001213 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1214 echo "#define TARGET_ARM 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001215 bflt="yes"
pbrookbd0c5662008-05-29 14:34:11 +00001216 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001217 ;;
1218 cris)
1219 echo "TARGET_ARCH=cris" >> $config_mak
1220 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1221 echo "#define TARGET_CRIS 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001222 ;;
1223 m68k)
1224 echo "TARGET_ARCH=m68k" >> $config_mak
1225 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1226 echo "#define TARGET_M68K 1" >> $config_h
1227 bflt="yes"
1228 ;;
1229 mips|mipsel)
1230 echo "TARGET_ARCH=mips" >> $config_mak
1231 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1232 echo "#define TARGET_MIPS 1" >> $config_h
1233 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1234 ;;
1235 mipsn32|mipsn32el)
1236 echo "TARGET_ARCH=mipsn32" >> $config_mak
1237 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1238 echo "#define TARGET_MIPS 1" >> $config_h
1239 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1240 ;;
1241 mips64|mips64el)
1242 echo "TARGET_ARCH=mips64" >> $config_mak
1243 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1244 echo "#define TARGET_MIPS 1" >> $config_h
1245 echo "#define TARGET_MIPS64 1" >> $config_h
1246 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1247 ;;
1248 ppc)
1249 echo "TARGET_ARCH=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001250 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001251 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1252 echo "#define TARGET_PPC 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001253 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001254 ;;
1255 ppcemb)
1256 echo "TARGET_ARCH=ppcemb" >> $config_mak
1257 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001258 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001259 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1260 echo "#define TARGET_PPC 1" >> $config_h
1261 echo "#define TARGET_PPCEMB 1" >> $config_h
blueswir1ec5b78c2008-05-10 17:23:18 +00001262 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001263 ;;
1264 ppc64)
1265 echo "TARGET_ARCH=ppc64" >> $config_mak
1266 echo "TARGET_ABI_DIR=ppc" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001267 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001268 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1269 echo "#define TARGET_PPC 1" >> $config_h
1270 echo "#define TARGET_PPC64 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001271 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001272 ;;
1273 ppc64abi32)
1274 echo "TARGET_ARCH=ppc64" >> $config_mak
1275 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1276 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001277 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001278 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1279 echo "#define TARGET_PPC 1" >> $config_h
1280 echo "#define TARGET_PPC64 1" >> $config_h
1281 echo "#define TARGET_ABI32 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001282 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001283 ;;
1284 sh4|sh4eb)
1285 echo "TARGET_ARCH=sh4" >> $config_mak
blueswir1bf6247f2008-05-10 12:27:33 +00001286 echo "CONFIG_DYNGEN_OP=yes" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001287 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1288 echo "#define TARGET_SH4 1" >> $config_h
blueswir1bf6247f2008-05-10 12:27:33 +00001289 echo "#define CONFIG_DYNGEN_OP 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001290 bflt="yes"
1291 ;;
1292 sparc)
1293 echo "TARGET_ARCH=sparc" >> $config_mak
1294 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1295 echo "#define TARGET_SPARC 1" >> $config_h
1296 ;;
1297 sparc64)
1298 echo "TARGET_ARCH=sparc64" >> $config_mak
1299 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1300 echo "#define TARGET_SPARC 1" >> $config_h
1301 echo "#define TARGET_SPARC64 1" >> $config_h
1302 elfload32="yes"
1303 ;;
1304 sparc32plus)
1305 echo "TARGET_ARCH=sparc64" >> $config_mak
1306 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1307 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1308 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1309 echo "#define TARGET_SPARC 1" >> $config_h
1310 echo "#define TARGET_SPARC64 1" >> $config_h
1311 echo "#define TARGET_ABI32 1" >> $config_h
1312 ;;
1313 *)
1314 echo "Unsupported target CPU"
1315 exit 1
1316 ;;
1317esac
bellardde83cd02003-06-15 20:25:43 +00001318if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001319 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1320 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1321fi
1322if test "$target_softmmu" = "yes" ; then
1323 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1324 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +00001325fi
bellard997344f2003-10-27 21:10:39 +00001326if test "$target_user_only" = "yes" ; then
1327 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1328 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1329fi
ths831b7822007-01-18 20:06:33 +00001330if test "$target_linux_user" = "yes" ; then
1331 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1332 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1333fi
1334if test "$target_darwin_user" = "yes" ; then
1335 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1336 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1337fi
bellardde83cd02003-06-15 20:25:43 +00001338
aurel320938cda2008-04-11 21:36:06 +00001339if test "$target_cpu" = "arm" \
1340 -o "$target_cpu" = "armeb" \
1341 -o "$target_cpu" = "m68k" \
1342 -o "$target_cpu" = "mips" \
1343 -o "$target_cpu" = "mipsel" \
1344 -o "$target_cpu" = "mipsn32" \
1345 -o "$target_cpu" = "mipsn32el" \
1346 -o "$target_cpu" = "mips64" \
1347 -o "$target_cpu" = "mips64el" \
1348 -o "$target_cpu" = "sparc" \
1349 -o "$target_cpu" = "sparc64" \
1350 -o "$target_cpu" = "sparc32plus"; then
bellard158142c2005-03-13 16:54:06 +00001351 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
1352 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
1353fi
pbrooke5fe0c52006-06-11 13:32:59 +00001354if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
1355 echo "TARGET_HAS_BFLT=yes" >> $config_mak
1356 echo "#define TARGET_HAS_BFLT 1" >> $config_h
1357fi
pbrookbd0c5662008-05-29 14:34:11 +00001358if test "$target_user_only" = "yes" \
1359 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
1360 echo "#define USE_NPTL 1" >> $config_h
1361fi
blueswir1cb33da52007-10-09 16:34:29 +00001362# 32 bit ELF loader in addition to native 64 bit loader?
1363if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
1364 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
1365 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
1366fi
bellard5b0753e2005-03-01 21:37:28 +00001367
ths15d9ca02007-07-31 23:07:32 +00001368test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1369
bellard97a847b2003-08-10 21:36:04 +00001370done # for target in $targets
bellard7d132992003-03-06 23:23:54 +00001371
1372# build tree in object directory if source path is different from current one
1373if test "$source_path_used" = "yes" ; then
bellard49ecc3f2007-11-07 19:25:15 +00001374 DIRS="tests tests/cris slirp audio"
bellard7d132992003-03-06 23:23:54 +00001375 FILES="Makefile tests/Makefile"
thse7daa602007-10-08 13:38:27 +00001376 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
edgar_igle1ffb0f2008-03-01 22:23:17 +00001377 FILES="$FILES tests/test-mmap.c"
bellard7d132992003-03-06 23:23:54 +00001378 for dir in $DIRS ; do
1379 mkdir -p $dir
1380 done
bellardec530c82006-04-25 22:36:06 +00001381 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +00001382 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +00001383 rm -f $f
1384 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +00001385 done
1386fi
bellard7d132992003-03-06 23:23:54 +00001387
bellard97a847b2003-08-10 21:36:04 +00001388rm -f $TMPO $TMPC $TMPE $TMPS