blob: 92632e24d820759e0508ee478dd0f7b9cbdeb642 [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"
25host_cc="gcc"
26ar="ar"
27make="make"
pbrook6a882642006-04-17 13:57:12 +000028install="install"
bellard7d132992003-03-06 23:23:54 +000029strip="strip"
30cpu=`uname -m`
bellard5327cf42005-01-10 23:18:50 +000031target_list=""
bellard7d132992003-03-06 23:23:54 +000032case "$cpu" in
33 i386|i486|i586|i686|i86pc|BePC)
bellard97a847b2003-08-10 21:36:04 +000034 cpu="i386"
bellard7d132992003-03-06 23:23:54 +000035 ;;
bellardba680552005-03-13 09:49:52 +000036 armv*b)
bellard808c4952004-12-19 23:33:47 +000037 cpu="armv4b"
38 ;;
bellardba680552005-03-13 09:49:52 +000039 armv*l)
bellard7d132992003-03-06 23:23:54 +000040 cpu="armv4l"
41 ;;
42 alpha)
43 cpu="alpha"
44 ;;
bellard295defa2003-04-07 21:31:29 +000045 "Power Macintosh"|ppc|ppc64)
bellard7d132992003-03-06 23:23:54 +000046 cpu="powerpc"
47 ;;
48 mips)
49 cpu="mips"
50 ;;
bellardfb3e5842003-03-29 17:32:36 +000051 s390)
52 cpu="s390"
53 ;;
pbrook94ac5152006-04-26 16:07:35 +000054 sparc|sun4[muv])
bellardae228532003-05-13 18:59:59 +000055 cpu="sparc"
56 ;;
57 sparc64)
58 cpu="sparc64"
59 ;;
bellarda8baa8c2003-04-29 20:53:31 +000060 ia64)
61 cpu="ia64"
62 ;;
bellard38e584a2003-08-10 22:14:22 +000063 m68k)
64 cpu="m68k"
65 ;;
bellardbc51c5c2004-03-17 23:46:04 +000066 x86_64|amd64)
bellard0b0babc2005-01-03 23:38:40 +000067 cpu="x86_64"
bellardbc51c5c2004-03-17 23:46:04 +000068 ;;
bellard7d132992003-03-06 23:23:54 +000069 *)
70 cpu="unknown"
71 ;;
72esac
73gprof="no"
74bigendian="no"
bellard67b915a2004-03-31 23:37:16 +000075mingw32="no"
76EXESUF=""
77gdbstub="yes"
bellard443f1372004-06-04 11:13:20 +000078slirp="yes"
bellardfb065182004-11-09 23:09:44 +000079adlib="no"
80oss="no"
bellard1d14ffa2005-10-30 18:58:22 +000081dsound="no"
82coreaudio="no"
83alsa="no"
bellard102a52e2004-11-14 19:57:29 +000084fmod="no"
85fmod_lib=""
86fmod_inc=""
pbrookb1a550a2006-04-16 13:28:56 +000087bsd="no"
bellard5327cf42005-01-10 23:18:50 +000088linux="no"
bellardc9ec1fe2005-02-10 21:55:30 +000089kqemu="no"
bellard05c2a3e2006-02-08 22:39:17 +000090profiler="no"
bellardc9ec1fe2005-02-10 21:55:30 +000091kernel_path=""
bellard5b0753e2005-03-01 21:37:28 +000092cocoa="no"
bellard97ccc682005-07-02 13:32:17 +000093check_gfx="yes"
bellard1aff3812005-11-02 22:30:45 +000094check_gcc="yes"
pbrook0a8e90f2006-03-19 14:54:16 +000095softmmu="yes"
96user="no"
pbrookcc8ae6d2006-04-23 17:57:59 +000097build_docs="no"
bellard7d132992003-03-06 23:23:54 +000098
99# OS specific
100targetos=`uname -s`
101case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000102CYGWIN*)
103mingw32="yes"
104CFLAGS="-O2 -mno-cygwin"
105;;
bellard67b915a2004-03-31 23:37:16 +0000106MINGW32*)
107mingw32="yes"
108;;
bellard7d3505c2004-05-12 19:32:15 +0000109FreeBSD)
110bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000111oss="yes"
bellarde99f9062005-07-28 21:45:38 +0000112if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000113 kqemu="yes"
114fi
bellard7d3505c2004-05-12 19:32:15 +0000115;;
116NetBSD)
117bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000118oss="yes"
bellard7d3505c2004-05-12 19:32:15 +0000119;;
120OpenBSD)
121bsd="yes"
bellardfb065182004-11-09 23:09:44 +0000122oss="yes"
bellard7d3505c2004-05-12 19:32:15 +0000123;;
bellard83fb7ad2004-07-05 21:25:26 +0000124Darwin)
125bsd="yes"
126darwin="yes"
127;;
bellardec530c82006-04-25 22:36:06 +0000128SunOS)
129solaris="yes"
130;;
bellard1d14ffa2005-10-30 18:58:22 +0000131*)
bellardfb065182004-11-09 23:09:44 +0000132oss="yes"
bellard5327cf42005-01-10 23:18:50 +0000133linux="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000134user="yes"
bellard07f4ddb2005-04-23 17:44:28 +0000135if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000136 kqemu="yes"
137fi
bellardfb065182004-11-09 23:09:44 +0000138;;
bellard7d132992003-03-06 23:23:54 +0000139esac
140
bellard7d3505c2004-05-12 19:32:15 +0000141if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000142 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000143 make="gmake"
144 fi
bellard7d3505c2004-05-12 19:32:15 +0000145fi
146
bellardec530c82006-04-25 22:36:06 +0000147if [ "$solaris" = "yes" ] ; then
148 make="gmake"
149 install="ginstall"
150 solarisrev=`uname -r | cut -f2 -d.`
151 if test $solarisrev -lt 10 ; then
152 presolaris10="yes"
153 fi
154fi
155
bellard7d132992003-03-06 23:23:54 +0000156# find source path
pbrookad064842006-04-16 12:41:07 +0000157source_path=`dirname "$0"`
158if [ -z "$source_path" ]; then
bellard7d132992003-03-06 23:23:54 +0000159 source_path=`pwd`
pbrookad064842006-04-16 12:41:07 +0000160else
161 source_path=`cd "$source_path"; pwd`
162fi
163if test "$source_path" = `pwd` ; then
bellard7d132992003-03-06 23:23:54 +0000164 source_path_used="no"
pbrookad064842006-04-16 12:41:07 +0000165else
166 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000167fi
168
169for opt do
pbrookb1a550a2006-04-16 13:28:56 +0000170 optarg=`expr "$opt" : '[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000171 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000172 --help|-h) show_help=yes
173 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000174 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000175 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000176 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000177 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000178 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000179 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000180 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000181 --cross-prefix=*) cross_prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000182 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000183 --cc=*) cc="$optarg"
bellard7d132992003-03-06 23:23:54 +0000184 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000185 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000186 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000187 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000188 ;;
pbrook6a882642006-04-17 13:57:12 +0000189 --install=*) install="$optarg"
190 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000191 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000192 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000193 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000194 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000195 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000196 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000197 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000198 ;;
bellard7d132992003-03-06 23:23:54 +0000199 --enable-gprof) gprof="yes"
200 ;;
bellard43ce4df2003-06-09 19:53:12 +0000201 --static) static="yes"
202 ;;
bellard97a847b2003-08-10 21:36:04 +0000203 --disable-sdl) sdl="no"
204 ;;
bellard1d14ffa2005-10-30 18:58:22 +0000205 --enable-coreaudio) coreaudio="yes"
206 ;;
207 --enable-alsa) alsa="yes"
208 ;;
209 --enable-dsound) dsound="yes"
210 ;;
bellard102a52e2004-11-14 19:57:29 +0000211 --enable-fmod) fmod="yes"
212 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000213 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000214 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000215 --fmod-inc=*) fmod_inc="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000216 ;;
bellard67b915a2004-03-31 23:37:16 +0000217 --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-"
bellard1d14ffa2005-10-30 18:58:22 +0000218 ;;
bellard443f1372004-06-04 11:13:20 +0000219 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000220 ;;
bellardfb065182004-11-09 23:09:44 +0000221 --enable-adlib) adlib="yes"
bellard1d14ffa2005-10-30 18:58:22 +0000222 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000223 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000224 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000225 --enable-profiler) profiler="yes"
226 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000227 --kernel-path=*) kernel_path="$optarg"
bellard1d14ffa2005-10-30 18:58:22 +0000228 ;;
229 --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no"
230 ;;
bellard97ccc682005-07-02 13:32:17 +0000231 --disable-gfx-check) check_gfx="no"
232 ;;
bellard1aff3812005-11-02 22:30:45 +0000233 --disable-gcc-check) check_gcc="no"
234 ;;
pbrookcad25d62006-03-19 16:31:11 +0000235 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000236 ;;
pbrookcad25d62006-03-19 16:31:11 +0000237 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000238 ;;
239 --disable-user) user="no"
240 ;;
241 --enable-user) user="yes"
242 ;;
bellard7d132992003-03-06 23:23:54 +0000243 esac
244done
245
246# Checking for CFLAGS
247if test -z "$CFLAGS"; then
248 CFLAGS="-O2"
249fi
250
pbrookaf5db582006-04-08 14:26:41 +0000251if test x"$show_help" = x"yes" ; then
252cat << EOF
253
254Usage: configure [options]
255Options: [defaults in brackets after descriptions]
256
257EOF
258echo "Standard options:"
259echo " --help print this message"
260echo " --prefix=PREFIX install in PREFIX [$prefix]"
261echo " --interp-prefix=PREFIX where to find shared libraries, etc."
262echo " use %M for cpu name [$interp_prefix]"
263echo " --target-list=LIST set target list [$target_list]"
264echo ""
265echo "kqemu kernel acceleration support:"
266echo " --disable-kqemu disable kqemu support"
267echo " --kernel-path=PATH set the kernel path (configure probes it)"
268echo ""
269echo "Advanced options (experts only):"
270echo " --source-path=PATH path of source code [$source_path]"
271echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
272echo " --cc=CC use C compiler CC [$cc]"
273echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
274echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000275echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000276echo " --static enable static build [$static]"
277echo " --enable-cocoa enable COCOA (Mac OS X only)"
278echo " --enable-mingw32 enable Win32 cross compilation with mingw32"
279echo " --enable-adlib enable Adlib emulation"
280echo " --enable-coreaudio enable Coreaudio audio driver"
281echo " --enable-alsa enable ALSA audio driver"
282echo " --enable-fmod enable FMOD audio driver"
283echo " --enabled-dsound enable DirectSound audio driver"
284echo " --enable-system enable all system emulation targets"
285echo " --disable-system disable all system emulation targets"
286echo " --enable-user enable all linux usermode emulation targets"
287echo " --disable-user disable all linux usermode emulation targets"
288echo " --fmod-lib path to FMOD library"
289echo " --fmod-inc path to FMOD includes"
290echo ""
291echo "NOTE: The object files are build at the place where configure is launched"
292exit 1
293fi
294
bellard7d132992003-03-06 23:23:54 +0000295cc="${cross_prefix}${cc}"
296ar="${cross_prefix}${ar}"
297strip="${cross_prefix}${strip}"
298
pbrook94ac5152006-04-26 16:07:35 +0000299if [ ! -x "`which $cc`" ] ; then
bellarda7350fa2006-04-23 14:35:23 +0000300 echo "Compiler $cc could not be found"
301 exit
302fi
303
bellard67b915a2004-03-31 23:37:16 +0000304if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000305 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000306 EXESUF=".exe"
307 gdbstub="no"
bellard9f059ec2004-11-14 18:59:52 +0000308 oss="no"
bellard07f4ddb2005-04-23 17:44:28 +0000309 if [ "$cpu" = "i386" ] ; then
310 kqemu="yes"
311 fi
bellard67b915a2004-03-31 23:37:16 +0000312fi
313
bellardec530c82006-04-25 22:36:06 +0000314#
315# Solaris specific configure tool chain decisions
316#
317if test "$solaris" = "yes" ; then
318 #
319 # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly
320 # override the check with --disable-gcc-check
321 #
322 if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then
323 solgcc=`which $cc`
324 if test "$solgcc" = "/usr/sfw/bin/gcc" ; then
325 echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly."
326 echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3"
327 echo "or get the latest patch from SunSolve for gcc"
328 exit 1
329 fi
330 fi
331 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
332 if test -z "$solinst" ; then
333 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
334 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
335 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
336 exit 1
337 fi
338 if test "$solinst" = "/usr/sbin/install" ; then
339 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
340 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
341 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
342 exit 1
343 fi
bellardec530c82006-04-25 22:36:06 +0000344 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
345 if test -z "$sol_ar" ; then
346 echo "Error: No path includes ar"
347 if test -f /usr/ccs/bin/ar ; then
348 echo "Add /usr/ccs/bin to your path and rerun configure"
349 fi
350 exit 1
351 fi
352fi
353
354
bellard5327cf42005-01-10 23:18:50 +0000355if test -z "$target_list" ; then
356# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000357 if [ "$softmmu" = "yes" ] ; then
358 target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu"
359 fi
bellard5327cf42005-01-10 23:18:50 +0000360# the following are Linux specific
pbrook0a8e90f2006-03-19 14:54:16 +0000361 if [ "$user" = "yes" ] ; then
bellardfdf9b3e2006-04-27 21:07:38 +0000362 target_list="i386-user arm-user armeb-user sparc-user ppc-user mips-user mipsel-user sh4-user $target_list"
bellard5327cf42005-01-10 23:18:50 +0000363 fi
bellard6e20a452005-06-05 15:56:02 +0000364else
pbrookb1a550a2006-04-16 13:28:56 +0000365 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000366fi
pbrook0a8e90f2006-03-19 14:54:16 +0000367if test -z "$target_list" ; then
368 echo "No targets enabled"
369 exit 1
370fi
bellard5327cf42005-01-10 23:18:50 +0000371
bellard7d132992003-03-06 23:23:54 +0000372if test -z "$cross_prefix" ; then
373
374# ---
375# big/little endian test
376cat > $TMPC << EOF
377#include <inttypes.h>
378int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000379 volatile uint32_t i=0x01234567;
380 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000381}
382EOF
383
384if $cc -o $TMPE $TMPC 2>/dev/null ; then
385$TMPE && bigendian="yes"
386else
387echo big/little test failed
388fi
389
390else
391
392# if cross compiling, cannot launch a program, so make a static guess
bellard808c4952004-12-19 23:33:47 +0000393if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then
bellard7d132992003-03-06 23:23:54 +0000394 bigendian="yes"
395fi
396
397fi
398
bellardb6853692005-06-05 17:10:39 +0000399# host long bits test
400hostlongbits="32"
401if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then
402 hostlongbits="64"
403fi
404
bellarde8cd23d2003-06-25 16:08:13 +0000405# check gcc options support
bellard04369ff2003-03-20 22:33:23 +0000406cat > $TMPC <<EOF
407int main(void) {
bellard04369ff2003-03-20 22:33:23 +0000408}
409EOF
410
bellarde8cd23d2003-06-25 16:08:13 +0000411have_gcc3_options="no"
412if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then
413 have_gcc3_options="yes"
bellard04369ff2003-03-20 22:33:23 +0000414fi
bellardca735202003-03-18 20:41:34 +0000415
pbrookb1a550a2006-04-16 13:28:56 +0000416# Check for gcc4, error if pre-gcc4
bellard1aff3812005-11-02 22:30:45 +0000417if test "$check_gcc" = "yes" ; then
418 cat > $TMPC <<EOF
pbrookb1a550a2006-04-16 13:28:56 +0000419#if __GNUC__ < 4
420#error gcc3
bellard1aff3812005-11-02 22:30:45 +0000421#endif
422int main(){return 0;}
423EOF
pbrookb1a550a2006-04-16 13:28:56 +0000424 if $cc -o $TMPO $TMPC 2>/dev/null ; then
bellard1aff3812005-11-02 22:30:45 +0000425 echo "ERROR: \"$cc\" looks like gcc 4.x"
426 echo "QEMU is known to have problems when compiled with gcc 4.x"
427 echo "It is recommended that you use gcc 3.x to build QEMU"
428 echo "To use this compiler anyway, configure with --disable-gcc-check"
429 exit 1;
430 fi
431fi
432
bellard11d9f692004-04-02 20:55:59 +0000433##########################################
434# SDL probe
435
436sdl_too_old=no
437
438if test -z "$sdl" ; then
439
bellarda6e022a2004-04-02 21:55:47 +0000440sdl_config="sdl-config"
441sdl=no
bellard7c1f25b2004-04-22 00:02:08 +0000442sdl_static=no
bellarda6e022a2004-04-02 21:55:47 +0000443
444if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
445# win32 cross compilation case
446 sdl_config="i386-mingw32msvc-sdl-config"
447 sdl=yes
448else
449# normal SDL probe
bellard11d9f692004-04-02 20:55:59 +0000450cat > $TMPC << EOF
451#include <SDL.h>
452#undef main /* We don't want SDL to override our main() */
453int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
454EOF
455
bellarda6e022a2004-04-02 21:55:47 +0000456if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
457_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
bellard11d9f692004-04-02 20:55:59 +0000458if test "$_sdlversion" -lt 121 ; then
459sdl_too_old=yes
460else
461sdl=yes
462fi
bellard7c1f25b2004-04-22 00:02:08 +0000463
464# static link with sdl ?
465if test "$sdl" = "yes" ; then
466aa="no"
467`$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
468sdl_static_libs=`$sdl_config --static-libs`
469if [ "$aa" = "yes" ] ; then
bellardd8d8aa42004-04-29 20:14:07 +0000470 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
bellard11d9f692004-04-02 20:55:59 +0000471fi
472
bellard7c1f25b2004-04-22 00:02:08 +0000473if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then
474 sdl_static=yes
475fi
476
477fi # static link
478
479fi # sdl compile test
480
bellarda6e022a2004-04-02 21:55:47 +0000481fi # cross compilation
482fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000483
pbrookcc8ae6d2006-04-23 17:57:59 +0000484# Check if tools are available to build documentation.
pbrook94ac5152006-04-26 16:07:35 +0000485if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +0000486 build_docs="yes"
487fi
488
bellard11d9f692004-04-02 20:55:59 +0000489if test "$mingw32" = "yes" ; then
490if test -z "$prefix" ; then
491 prefix="/c/Program Files/Qemu"
492fi
493mandir="$prefix"
bellard7efa4382004-05-12 18:54:06 +0000494datadir="$prefix"
bellard1f50f8d2004-05-08 14:44:43 +0000495docdir="$prefix"
bellard11d9f692004-04-02 20:55:59 +0000496bindir="$prefix"
497else
498if test -z "$prefix" ; then
499 prefix="/usr/local"
500fi
bellard5a671352003-10-01 00:13:48 +0000501mandir="$prefix/share/man"
bellard7efa4382004-05-12 18:54:06 +0000502datadir="$prefix/share/qemu"
bellard1f50f8d2004-05-08 14:44:43 +0000503docdir="$prefix/share/doc/qemu"
bellard11d9f692004-04-02 20:55:59 +0000504bindir="$prefix/bin"
505fi
bellard5a671352003-10-01 00:13:48 +0000506
bellard43ce4df2003-06-09 19:53:12 +0000507echo "Install prefix $prefix"
bellard7efa4382004-05-12 18:54:06 +0000508echo "BIOS directory $datadir"
bellard11d9f692004-04-02 20:55:59 +0000509echo "binary directory $bindir"
510if test "$mingw32" = "no" ; then
511echo "Manual directory $mandir"
bellard43ce4df2003-06-09 19:53:12 +0000512echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +0000513fi
bellard5a671352003-10-01 00:13:48 +0000514echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +0000515echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +0000516echo "Host C compiler $host_cc"
bellard43ce4df2003-06-09 19:53:12 +0000517echo "make $make"
pbrook6a882642006-04-17 13:57:12 +0000518echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +0000519echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +0000520echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +0000521echo "target list $target_list"
bellard43ce4df2003-06-09 19:53:12 +0000522echo "gprof enabled $gprof"
bellard05c2a3e2006-02-08 22:39:17 +0000523echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +0000524echo "static build $static"
bellard5b0753e2005-03-01 21:37:28 +0000525if test "$darwin" = "yes" ; then
526 echo "Cocoa support $cocoa"
527fi
bellard97a847b2003-08-10 21:36:04 +0000528echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +0000529if test "$sdl" != "no" ; then
530 echo "SDL static link $sdl_static"
531fi
bellard67b915a2004-03-31 23:37:16 +0000532echo "mingw32 support $mingw32"
bellardfb065182004-11-09 23:09:44 +0000533echo "Adlib support $adlib"
bellard1d14ffa2005-10-30 18:58:22 +0000534echo "CoreAudio support $coreaudio"
535echo "ALSA support $alsa"
536echo "DSound support $dsound"
bellard1d14ffa2005-10-30 18:58:22 +0000537if test "$fmod" = "yes"; then
538 if test -z $fmod_lib || test -z $fmod_inc; then
539 echo
540 echo "Error: You must specify path to FMOD library and headers"
541 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
542 echo
543 exit 1
544 fi
pbrookb1a550a2006-04-16 13:28:56 +0000545 fmod_support=" (lib='$fmod_lib' include='$fmod_inc')"
546else
547 fmod_support=""
bellard102a52e2004-11-14 19:57:29 +0000548fi
pbrookb1a550a2006-04-16 13:28:56 +0000549echo "FMOD support $fmod $fmod_support"
bellard07f4ddb2005-04-23 17:44:28 +0000550echo "kqemu support $kqemu"
pbrookcc8ae6d2006-04-23 17:57:59 +0000551echo "Documentation $build_docs"
bellard67b915a2004-03-31 23:37:16 +0000552
bellard97a847b2003-08-10 21:36:04 +0000553if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +0000554echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +0000555fi
bellard24b55b92005-03-01 22:30:41 +0000556#if test "$sdl_static" = "no"; then
557# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
558#fi
bellard97a847b2003-08-10 21:36:04 +0000559config_mak="config-host.mak"
560config_h="config-host.h"
561
bellard7c1f25b2004-04-22 00:02:08 +0000562#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +0000563
564echo "# Automatically generated by configure - do not modify" > $config_mak
pbrook29517132006-02-09 17:58:47 +0000565echo "# Configured with: $0 $@" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000566echo "/* Automatically generated by configure - do not modify */" > $config_h
567
568echo "prefix=$prefix" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +0000569echo "bindir=$bindir" >> $config_mak
bellard5a671352003-10-01 00:13:48 +0000570echo "mandir=$mandir" >> $config_mak
bellard7efa4382004-05-12 18:54:06 +0000571echo "datadir=$datadir" >> $config_mak
bellard1f50f8d2004-05-08 14:44:43 +0000572echo "docdir=$docdir" >> $config_mak
bellard7efa4382004-05-12 18:54:06 +0000573echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000574echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +0000575echo "INSTALL=$install" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000576echo "CC=$cc" >> $config_mak
577if test "$have_gcc3_options" = "yes" ; then
578 echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak
579fi
580echo "HOST_CC=$host_cc" >> $config_mak
581echo "AR=$ar" >> $config_mak
582echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
583echo "CFLAGS=$CFLAGS" >> $config_mak
584echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +0000585echo "EXESUF=$EXESUF" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +0000586if test "$cpu" = "i386" ; then
587 echo "ARCH=i386" >> $config_mak
588 echo "#define HOST_I386 1" >> $config_h
bellard0b0babc2005-01-03 23:38:40 +0000589elif test "$cpu" = "x86_64" ; then
590 echo "ARCH=x86_64" >> $config_mak
591 echo "#define HOST_X86_64 1" >> $config_h
bellard808c4952004-12-19 23:33:47 +0000592elif test "$cpu" = "armv4b" ; then
593 echo "ARCH=arm" >> $config_mak
594 echo "#define HOST_ARM 1" >> $config_h
bellard7d132992003-03-06 23:23:54 +0000595elif test "$cpu" = "armv4l" ; then
bellard97a847b2003-08-10 21:36:04 +0000596 echo "ARCH=arm" >> $config_mak
597 echo "#define HOST_ARM 1" >> $config_h
bellard7d132992003-03-06 23:23:54 +0000598elif test "$cpu" = "powerpc" ; then
bellard97a847b2003-08-10 21:36:04 +0000599 echo "ARCH=ppc" >> $config_mak
600 echo "#define HOST_PPC 1" >> $config_h
bellard7d132992003-03-06 23:23:54 +0000601elif test "$cpu" = "mips" ; then
bellard97a847b2003-08-10 21:36:04 +0000602 echo "ARCH=mips" >> $config_mak
603 echo "#define HOST_MIPS 1" >> $config_h
bellardfb3e5842003-03-29 17:32:36 +0000604elif test "$cpu" = "s390" ; then
bellard97a847b2003-08-10 21:36:04 +0000605 echo "ARCH=s390" >> $config_mak
606 echo "#define HOST_S390 1" >> $config_h
bellard295defa2003-04-07 21:31:29 +0000607elif test "$cpu" = "alpha" ; then
bellard97a847b2003-08-10 21:36:04 +0000608 echo "ARCH=alpha" >> $config_mak
609 echo "#define HOST_ALPHA 1" >> $config_h
bellardae228532003-05-13 18:59:59 +0000610elif test "$cpu" = "sparc" ; then
bellard97a847b2003-08-10 21:36:04 +0000611 echo "ARCH=sparc" >> $config_mak
612 echo "#define HOST_SPARC 1" >> $config_h
bellardae228532003-05-13 18:59:59 +0000613elif test "$cpu" = "sparc64" ; then
bellard97a847b2003-08-10 21:36:04 +0000614 echo "ARCH=sparc64" >> $config_mak
615 echo "#define HOST_SPARC64 1" >> $config_h
bellarda8baa8c2003-04-29 20:53:31 +0000616elif test "$cpu" = "ia64" ; then
bellard97a847b2003-08-10 21:36:04 +0000617 echo "ARCH=ia64" >> $config_mak
618 echo "#define HOST_IA64 1" >> $config_h
bellard38e584a2003-08-10 22:14:22 +0000619elif test "$cpu" = "m68k" ; then
bellard38ca2ab2004-03-13 18:32:13 +0000620 echo "ARCH=m68k" >> $config_mak
621 echo "#define HOST_M68K 1" >> $config_h
bellard7d132992003-03-06 23:23:54 +0000622else
623 echo "Unsupported CPU"
624 exit 1
625fi
626if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +0000627 echo "WORDS_BIGENDIAN=yes" >> $config_mak
628 echo "#define WORDS_BIGENDIAN 1" >> $config_h
629fi
bellardb6853692005-06-05 17:10:39 +0000630echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +0000631if test "$mingw32" = "yes" ; then
632 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +0000633 echo "#define CONFIG_WIN32 1" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +0000634elif test -f "/usr/include/byteswap.h" ; then
bellard67b915a2004-03-31 23:37:16 +0000635 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
636fi
bellard83fb7ad2004-07-05 21:25:26 +0000637if test "$darwin" = "yes" ; then
638 echo "CONFIG_DARWIN=yes" >> $config_mak
639 echo "#define CONFIG_DARWIN 1" >> $config_h
640fi
bellardec530c82006-04-25 22:36:06 +0000641if test "$solaris" = "yes" ; then
642 echo "CONFIG_SOLARIS=yes" >> $config_mak
643 if test "$presolaris10" = "yes" ; then
644 echo "#define _PRESOLARIS10 1" >> $config_h
645 fi
646fi
bellard67b915a2004-03-31 23:37:16 +0000647if test "$gdbstub" = "yes" ; then
648 echo "CONFIG_GDBSTUB=yes" >> $config_mak
649 echo "#define CONFIG_GDBSTUB 1" >> $config_h
650fi
bellard97a847b2003-08-10 21:36:04 +0000651if test "$gprof" = "yes" ; then
652 echo "TARGET_GPROF=yes" >> $config_mak
653 echo "#define HAVE_GPROF 1" >> $config_h
654fi
655if test "$static" = "yes" ; then
656 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +0000657 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000658fi
bellard05c2a3e2006-02-08 22:39:17 +0000659if test $profiler = "yes" ; then
660 echo "#define CONFIG_PROFILER 1" >> $config_h
661fi
bellardc20709a2004-04-21 23:27:19 +0000662if test "$slirp" = "yes" ; then
663 echo "CONFIG_SLIRP=yes" >> $config_mak
664 echo "#define CONFIG_SLIRP 1" >> $config_h
665fi
bellardfb065182004-11-09 23:09:44 +0000666if test "$adlib" = "yes" ; then
667 echo "CONFIG_ADLIB=yes" >> $config_mak
668 echo "#define CONFIG_ADLIB 1" >> $config_h
669fi
670if test "$oss" = "yes" ; then
671 echo "CONFIG_OSS=yes" >> $config_mak
672 echo "#define CONFIG_OSS 1" >> $config_h
673fi
bellard1d14ffa2005-10-30 18:58:22 +0000674if test "$coreaudio" = "yes" ; then
675 echo "CONFIG_COREAUDIO=yes" >> $config_mak
676 echo "#define CONFIG_COREAUDIO 1" >> $config_h
677fi
678if test "$alsa" = "yes" ; then
679 echo "CONFIG_ALSA=yes" >> $config_mak
680 echo "#define CONFIG_ALSA 1" >> $config_h
681fi
682if test "$dsound" = "yes" ; then
683 echo "CONFIG_DSOUND=yes" >> $config_mak
684 echo "#define CONFIG_DSOUND 1" >> $config_h
685fi
bellard102a52e2004-11-14 19:57:29 +0000686if test "$fmod" = "yes" ; then
687 echo "CONFIG_FMOD=yes" >> $config_mak
688 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
689 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
690 echo "#define CONFIG_FMOD 1" >> $config_h
691fi
pbrookb1a550a2006-04-16 13:28:56 +0000692qemu_version=`head $source_path/VERSION`
693echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +0000694echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000695
696echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +0000697if [ "$source_path_used" = "yes" ]; then
698 echo "VPATH=$source_path" >> $config_mak
699fi
bellard97a847b2003-08-10 21:36:04 +0000700echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +0000701if [ "$build_docs" = "yes" ] ; then
702 echo "BUILD_DOCS=yes" >> $config_mak
703fi
bellard97a847b2003-08-10 21:36:04 +0000704
bellard83fb7ad2004-07-05 21:25:26 +0000705# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +0000706if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +0000707 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +0000708 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +0000709 echo "#define _BSD 1" >> $config_h
710fi
711
bellard1d14ffa2005-10-30 18:58:22 +0000712for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +0000713target_dir="$target"
714config_mak=$target_dir/config.mak
715config_h=$target_dir/config.h
716target_cpu=`echo $target | cut -d '-' -f 1`
717target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +0000718[ "$target_cpu" = "armeb" ] && target_bigendian=yes
bellard1e43adf2003-09-30 20:54:24 +0000719[ "$target_cpu" = "sparc" ] && target_bigendian=yes
bellard64b3ab22005-01-30 22:43:42 +0000720[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +0000721[ "$target_cpu" = "ppc" ] && target_bigendian=yes
bellarda2458622005-07-23 22:39:53 +0000722[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
bellardd3258562005-07-02 15:37:12 +0000723[ "$target_cpu" = "mips" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +0000724target_softmmu="no"
725if expr $target : '.*-softmmu' > /dev/null ; then
726 target_softmmu="yes"
bellard7d132992003-03-06 23:23:54 +0000727fi
bellard997344f2003-10-27 21:10:39 +0000728target_user_only="no"
729if expr $target : '.*-user' > /dev/null ; then
730 target_user_only="yes"
731fi
bellardde83cd02003-06-15 20:25:43 +0000732
bellard97ccc682005-07-02 13:32:17 +0000733if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +0000734 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +0000735 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +0000736 echo "To build QEMU without graphical output configure with --disable-gfx-check"
bellard97ccc682005-07-02 13:32:17 +0000737 echo "Note that this will disable all output from the virtual graphics card."
738 exit 1;
739fi
740
bellard7c1f25b2004-04-22 00:02:08 +0000741#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +0000742
743mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +0000744mkdir -p $target_dir/fpu
bellard808c4952004-12-19 23:33:47 +0000745if test "$target" = "arm-user" -o "$target" = "armeb-user" ; then
bellard69de9272004-02-16 21:40:43 +0000746 mkdir -p $target_dir/nwfpe
747fi
bellarda7e61ed2004-04-22 21:46:47 +0000748if test "$target_user_only" = "no" ; then
749 mkdir -p $target_dir/slirp
750fi
bellard69de9272004-02-16 21:40:43 +0000751
bellardec530c82006-04-25 22:36:06 +0000752#
753# don't use ln -sf as not all "ln -sf" over write the file/link
754#
755rm -f $target_dir/Makefile
756ln -s $source_path/Makefile.target $target_dir/Makefile
757
bellard97a847b2003-08-10 21:36:04 +0000758
759echo "# Automatically generated by configure - do not modify" > $config_mak
760echo "/* Automatically generated by configure - do not modify */" > $config_h
761
762
763echo "include ../config-host.mak" >> $config_mak
764echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +0000765
766interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
767echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +0000768
769if test "$target_cpu" = "i386" ; then
770 echo "TARGET_ARCH=i386" >> $config_mak
771 echo "#define TARGET_ARCH \"i386\"" >> $config_h
772 echo "#define TARGET_I386 1" >> $config_h
bellard07f4ddb2005-04-23 17:44:28 +0000773 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then
bellard824d5602005-02-12 18:58:00 +0000774 echo "#define USE_KQEMU 1" >> $config_h
775 fi
bellard808c4952004-12-19 23:33:47 +0000776elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
bellard97a847b2003-08-10 21:36:04 +0000777 echo "TARGET_ARCH=arm" >> $config_mak
778 echo "#define TARGET_ARCH \"arm\"" >> $config_h
779 echo "#define TARGET_ARM 1" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +0000780elif test "$target_cpu" = "sparc" ; then
781 echo "TARGET_ARCH=sparc" >> $config_mak
782 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
783 echo "#define TARGET_SPARC 1" >> $config_h
bellard64b3ab22005-01-30 22:43:42 +0000784elif test "$target_cpu" = "sparc64" ; then
785 echo "TARGET_ARCH=sparc64" >> $config_mak
786 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
787 echo "#define TARGET_SPARC 1" >> $config_h
788 echo "#define TARGET_SPARC64 1" >> $config_h
bellard67867302003-11-23 17:05:30 +0000789elif test "$target_cpu" = "ppc" ; then
790 echo "TARGET_ARCH=ppc" >> $config_mak
791 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
792 echo "#define TARGET_PPC 1" >> $config_h
bellarda2458622005-07-23 22:39:53 +0000793elif test "$target_cpu" = "ppc64" ; then
794 echo "TARGET_ARCH=ppc64" >> $config_mak
795 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
796 echo "#define TARGET_PPC 1" >> $config_h
797 echo "#define TARGET_PPC64 1" >> $config_h
bellard0b0babc2005-01-03 23:38:40 +0000798elif test "$target_cpu" = "x86_64" ; then
799 echo "TARGET_ARCH=x86_64" >> $config_mak
800 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
801 echo "#define TARGET_I386 1" >> $config_h
802 echo "#define TARGET_X86_64 1" >> $config_h
bellard07f4ddb2005-04-23 17:44:28 +0000803 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then
804 echo "#define USE_KQEMU 1" >> $config_h
805 fi
bellardc20eb472005-12-06 21:42:55 +0000806elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then
bellardd3258562005-07-02 15:37:12 +0000807 echo "TARGET_ARCH=mips" >> $config_mak
808 echo "#define TARGET_ARCH \"mips\"" >> $config_h
809 echo "#define TARGET_MIPS 1" >> $config_h
bellardfdf9b3e2006-04-27 21:07:38 +0000810elif test "$target_cpu" = "sh4" ; then
811 echo "TARGET_ARCH=sh4" >> $config_mak
812 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
813 echo "#define TARGET_SH4 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +0000814else
815 echo "Unsupported target CPU"
816 exit 1
817fi
818if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +0000819 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
820 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
821fi
822if test "$target_softmmu" = "yes" ; then
823 echo "CONFIG_SOFTMMU=yes" >> $config_mak
824 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +0000825fi
bellard997344f2003-10-27 21:10:39 +0000826if test "$target_user_only" = "yes" ; then
827 echo "CONFIG_USER_ONLY=yes" >> $config_mak
828 echo "#define CONFIG_USER_ONLY 1" >> $config_h
829fi
bellardde83cd02003-06-15 20:25:43 +0000830
bellard158142c2005-03-13 16:54:06 +0000831if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then
832 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
833 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
834fi
bellard7c1f25b2004-04-22 00:02:08 +0000835# sdl defines
836
837if test "$target_user_only" = "no"; then
838 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
bellarddbb2c922004-10-24 22:17:47 +0000839 sdl1=$sdl_static
bellard7c1f25b2004-04-22 00:02:08 +0000840 else
bellarddbb2c922004-10-24 22:17:47 +0000841 sdl1=$sdl
842 fi
843 if test "$sdl1" = "yes" ; then
844 echo "#define CONFIG_SDL 1" >> $config_h
845 echo "CONFIG_SDL=yes" >> $config_mak
846 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
847 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
848 else
bellard7c1f25b2004-04-22 00:02:08 +0000849 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
850 fi
bellarddbb2c922004-10-24 22:17:47 +0000851 if [ "${aa}" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000852 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
853 else
854 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
bellarddbb2c922004-10-24 22:17:47 +0000855 fi
bellard7c1f25b2004-04-22 00:02:08 +0000856 fi
bellard7c1f25b2004-04-22 00:02:08 +0000857fi
858
bellard5b0753e2005-03-01 21:37:28 +0000859if test "$cocoa" = "yes" ; then
860 echo "#define CONFIG_COCOA 1" >> $config_h
861 echo "CONFIG_COCOA=yes" >> $config_mak
862fi
863
bellard97a847b2003-08-10 21:36:04 +0000864done # for target in $targets
bellard7d132992003-03-06 23:23:54 +0000865
866# build tree in object directory if source path is different from current one
867if test "$source_path_used" = "yes" ; then
868 DIRS="tests"
869 FILES="Makefile tests/Makefile"
870 for dir in $DIRS ; do
871 mkdir -p $dir
872 done
bellardec530c82006-04-25 22:36:06 +0000873 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +0000874 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +0000875 rm -f $f
876 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +0000877 done
878fi
bellard7d132992003-03-06 23:23:54 +0000879
bellard97a847b2003-08-10 21:36:04 +0000880rm -f $TMPO $TMPC $TMPE $TMPS