blob: 2f4ccfb407e329d7ef2c1c89410574200beb5d23 [file] [log] [blame]
bellard7d132992003-03-06 23:23:54 +00001#!/bin/sh
2#
bellard3ef693a2003-03-23 20:17:16 +00003# qemu configure script (c) 2003 Fabrice Bellard
bellard7d132992003-03-06 23:23:54 +00004#
5# set temporary file name
6if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10else
11 TMPDIR1="/tmp"
12fi
13
bellard3ef693a2003-03-23 20:17:16 +000014TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c"
15TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o"
16TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}"
17TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S"
malc9d56d2d2008-09-30 19:44:32 +000018TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i"
malcd4742de2008-11-29 22:04:31 +000019TMPSDLLOG="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log"
bellard7d132992003-03-06 23:23:54 +000020
malcd4742de2008-11-29 22:04:31 +000021trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15
malc9ac81bb2008-11-29 20:09:56 +000022
bellard7d132992003-03-06 23:23:54 +000023# default parameters
bellard11d9f692004-04-02 20:55:59 +000024prefix=""
bellard1e43adf2003-09-30 20:54:24 +000025interp_prefix="/usr/gnemul/qemu-%M"
bellard43ce4df2003-06-09 19:53:12 +000026static="no"
bellard7d132992003-03-06 23:23:54 +000027cross_prefix=""
28cc="gcc"
malc0c58ac12008-06-25 21:04:05 +000029audio_drv_list=""
malc4c9b53e2009-01-09 10:46:34 +000030audio_card_list="ac97 es1370 sb16"
31audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus"
bellard7d132992003-03-06 23:23:54 +000032host_cc="gcc"
33ar="ar"
34make="make"
pbrook6a882642006-04-17 13:57:12 +000035install="install"
bellard7d132992003-03-06 23:23:54 +000036strip="strip"
aliguoriac0df512008-12-29 17:14:15 +000037
38# parse CC options first
39for opt do
40 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
41 case "$opt" in
42 --cross-prefix=*) cross_prefix="$optarg"
43 ;;
44 --cc=*) cc="$optarg"
45 ;;
46 esac
47done
48
49# OS specific
50# Using uname is really, really broken. Once we have the right set of checks
51# we can eliminate it's usage altogether
52
53cc="${cross_prefix}${cc}"
54ar="${cross_prefix}${ar}"
55strip="${cross_prefix}${strip}"
56
57# check that the C compiler works.
58cat > $TMPC <<EOF
59int main(void) {}
60EOF
61
62if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
63 : C compiler works ok
64else
65 echo "ERROR: \"$cc\" either does not exist or does not work"
66 exit 1
67fi
68
69check_define() {
70cat > $TMPC <<EOF
71#if !defined($1)
72#error Not defined
73#endif
74int main(void) { return 0; }
75EOF
76 $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null
77}
78
79if check_define __i386__ ; then
80 cpu="i386"
81elif check_define __x86_64__ ; then
82 cpu="x86_64"
blueswir13aa9bd62008-12-31 16:55:26 +000083elif check_define __sparc__ ; then
84 # We can't check for 64 bit (when gcc is biarch) or V8PLUSA
85 # They must be specified using --sparc_cpu
86 if check_define __arch64__ ; then
87 cpu="sparc64"
88 else
89 cpu="sparc"
90 fi
malcfdf7ed92009-01-14 18:39:52 +000091elif check_define _ARCH_PPC ; then
92 if check_define _ARCH_PPC64 ; then
93 cpu="ppc64"
94 else
95 cpu="ppc"
96 fi
aliguoriac0df512008-12-29 17:14:15 +000097else
malcfdf7ed92009-01-14 18:39:52 +000098 cpu=`uname -m`
aliguoriac0df512008-12-29 17:14:15 +000099fi
100
bellard5327cf42005-01-10 23:18:50 +0000101target_list=""
bellard7d132992003-03-06 23:23:54 +0000102case "$cpu" in
103 i386|i486|i586|i686|i86pc|BePC)
bellard97a847b2003-08-10 21:36:04 +0000104 cpu="i386"
bellard7d132992003-03-06 23:23:54 +0000105 ;;
aurel32aaa5fa12008-04-11 22:04:22 +0000106 x86_64|amd64)
107 cpu="x86_64"
108 ;;
109 alpha)
110 cpu="alpha"
111 ;;
bellardba680552005-03-13 09:49:52 +0000112 armv*b)
bellard808c4952004-12-19 23:33:47 +0000113 cpu="armv4b"
114 ;;
bellardba680552005-03-13 09:49:52 +0000115 armv*l)
bellard7d132992003-03-06 23:23:54 +0000116 cpu="armv4l"
117 ;;
aurel32aaa5fa12008-04-11 22:04:22 +0000118 cris)
119 cpu="cris"
bellard7d132992003-03-06 23:23:54 +0000120 ;;
aurel32f54b3f92008-04-12 20:14:54 +0000121 parisc|parisc64)
122 cpu="hppa"
123 ;;
aurel32aaa5fa12008-04-11 22:04:22 +0000124 ia64)
125 cpu="ia64"
126 ;;
127 m68k)
128 cpu="m68k"
bellard7d132992003-03-06 23:23:54 +0000129 ;;
130 mips)
131 cpu="mips"
132 ;;
thsfbe4f652007-04-01 11:16:48 +0000133 mips64)
134 cpu="mips64"
135 ;;
malcfdf7ed92009-01-14 18:39:52 +0000136 ppc)
137 cpu="ppc"
138 ;;
139 ppc64)
140 cpu="ppc64"
thse7daa602007-10-08 13:38:27 +0000141 ;;
ths0e7b8a92007-08-01 00:09:31 +0000142 s390*)
bellardfb3e5842003-03-29 17:32:36 +0000143 cpu="s390"
144 ;;
blueswir131422552007-04-16 18:27:06 +0000145 sparc|sun4[cdmuv])
bellardae228532003-05-13 18:59:59 +0000146 cpu="sparc"
147 ;;
148 sparc64)
149 cpu="sparc64"
150 ;;
bellard7d132992003-03-06 23:23:54 +0000151 *)
152 cpu="unknown"
153 ;;
154esac
155gprof="no"
aurel32f8393942009-04-13 18:45:38 +0000156debug_tcg="no"
aliguori03b4fe72008-10-07 19:16:17 +0000157sparse="no"
aliguori1625af82009-04-05 17:41:02 +0000158strip_opt="yes"
bellard7d132992003-03-06 23:23:54 +0000159bigendian="no"
bellard67b915a2004-03-31 23:37:16 +0000160mingw32="no"
161EXESUF=""
162gdbstub="yes"
bellard443f1372004-06-04 11:13:20 +0000163slirp="yes"
aliguorie0e6c8c02008-07-23 18:14:33 +0000164vde="yes"
bellard102a52e2004-11-14 19:57:29 +0000165fmod_lib=""
166fmod_inc=""
blueswir12f6a1ab2008-08-21 18:00:53 +0000167oss_lib=""
ths8d5d2d42007-08-25 01:37:51 +0000168vnc_tls="yes"
aliguori2f9606b2009-03-06 20:27:28 +0000169vnc_sasl="yes"
pbrookb1a550a2006-04-16 13:28:56 +0000170bsd="no"
bellard5327cf42005-01-10 23:18:50 +0000171linux="no"
blueswir1d2c7c9b2008-11-01 14:50:20 +0000172solaris="no"
bellardc9ec1fe2005-02-10 21:55:30 +0000173kqemu="no"
bellard05c2a3e2006-02-08 22:39:17 +0000174profiler="no"
bellard5b0753e2005-03-01 21:37:28 +0000175cocoa="no"
bellard97ccc682005-07-02 13:32:17 +0000176check_gfx="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000177softmmu="yes"
ths831b7822007-01-18 20:06:33 +0000178linux_user="no"
179darwin_user="no"
blueswir184778502008-10-26 20:33:16 +0000180bsd_user="no"
pbrookcc8ae6d2006-04-23 17:57:59 +0000181build_docs="no"
pbrookc5937222006-05-14 11:30:38 +0000182uname_release=""
balrog4d3b6f62008-02-10 16:33:14 +0000183curses="yes"
aliguorie5d355d2009-04-24 18:03:15 +0000184pthread="yes"
blueswir1414f0da2008-08-15 18:20:52 +0000185aio="yes"
aliguorie5d355d2009-04-24 18:03:15 +0000186io_thread="no"
pbrookbd0c5662008-05-29 14:34:11 +0000187nptl="yes"
malc8ff9cbf2008-06-23 18:33:30 +0000188mixemu="no"
balrogfb599c92008-09-28 23:49:55 +0000189bluez="yes"
aliguori7ba1e612008-11-05 16:04:33 +0000190kvm="yes"
aliguorieac30262008-11-05 16:28:56 +0000191kerneldir=""
malcb29fe3e2008-11-18 01:42:22 +0000192aix="no"
ths77755342008-11-27 15:45:16 +0000193blobs="yes"
aurel32f652e6a2008-12-16 10:43:48 +0000194fdt="yes"
aliguori5368a422009-03-03 17:37:21 +0000195sdl_x11="no"
aliguorie37630c2009-04-22 15:19:10 +0000196xen="yes"
pbrook4a19f1e2009-04-07 23:17:49 +0000197pkgversion=""
bellard7d132992003-03-06 23:23:54 +0000198
199# OS specific
aliguoriac0df512008-12-29 17:14:15 +0000200if check_define __linux__ ; then
201 targetos="Linux"
202elif check_define _WIN32 ; then
203 targetos='MINGW32'
blueswir1169dc5d2009-04-13 17:19:26 +0000204elif check_define __OpenBSD__ ; then
205 targetos='OpenBSD'
206elif check_define __sun__ ; then
207 targetos='SunOS'
aliguoriac0df512008-12-29 17:14:15 +0000208else
209 targetos=`uname -s`
210fi
bellard7d132992003-03-06 23:23:54 +0000211case $targetos in
bellardc326e0a2005-04-23 18:30:28 +0000212CYGWIN*)
213mingw32="yes"
ths6f30fa82007-01-05 01:00:47 +0000214OS_CFLAGS="-mno-cygwin"
thsdb8d7dd2007-07-12 09:29:18 +0000215if [ "$cpu" = "i386" ] ; then
216 kqemu="yes"
217fi
malcc2de5c92008-06-28 19:13:06 +0000218audio_possible_drivers="sdl"
bellardc326e0a2005-04-23 18:30:28 +0000219;;
bellard67b915a2004-03-31 23:37:16 +0000220MINGW32*)
221mingw32="yes"
thsdb8d7dd2007-07-12 09:29:18 +0000222if [ "$cpu" = "i386" ] ; then
223 kqemu="yes"
224fi
malcc2de5c92008-06-28 19:13:06 +0000225audio_possible_drivers="dsound sdl fmod"
bellard67b915a2004-03-31 23:37:16 +0000226;;
ths5c40d2b2007-06-23 16:03:36 +0000227GNU/kFreeBSD)
malc0c58ac12008-06-25 21:04:05 +0000228audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000229audio_possible_drivers="oss sdl esd pa"
ths5c40d2b2007-06-23 16:03:36 +0000230if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
231 kqemu="yes"
232fi
233;;
bellard7d3505c2004-05-12 19:32:15 +0000234FreeBSD)
235bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000236audio_drv_list="oss"
aurel32f34af522008-08-21 23:03:15 +0000237audio_possible_drivers="oss sdl esd pa"
bellarde99f9062005-07-28 21:45:38 +0000238if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellard07f4ddb2005-04-23 17:44:28 +0000239 kqemu="yes"
240fi
bellard7d3505c2004-05-12 19:32:15 +0000241;;
blueswir1c5e97232009-03-07 20:06:23 +0000242DragonFly)
243bsd="yes"
244audio_drv_list="oss"
245audio_possible_drivers="oss sdl esd pa"
246if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
247 kqemu="yes"
248fi
249aio="no"
250;;
bellard7d3505c2004-05-12 19:32:15 +0000251NetBSD)
252bsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000253audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000254audio_possible_drivers="oss sdl esd"
blueswir18ef92a82008-11-22 20:24:29 +0000255oss_lib="-lossaudio"
bellard7d3505c2004-05-12 19:32:15 +0000256;;
257OpenBSD)
258bsd="yes"
blueswir1128ab2f2008-08-15 18:33:42 +0000259openbsd="yes"
malc0c58ac12008-06-25 21:04:05 +0000260audio_drv_list="oss"
malcc2de5c92008-06-28 19:13:06 +0000261audio_possible_drivers="oss sdl esd"
blueswir12f6a1ab2008-08-21 18:00:53 +0000262oss_lib="-lossaudio"
bellard7d3505c2004-05-12 19:32:15 +0000263;;
bellard83fb7ad2004-07-05 21:25:26 +0000264Darwin)
265bsd="yes"
266darwin="yes"
aliguori1b0f9cc2009-01-26 15:37:40 +0000267# on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code
malcaab85882009-02-23 14:11:10 +0000268if [ "$cpu" = "i386" ] ; then
269 is_x86_64=`sysctl -n hw.optional.x86_64`
270 [ "$is_x86_64" = "1" ] && cpu=x86_64
aliguori1b0f9cc2009-01-26 15:37:40 +0000271fi
272if [ "$cpu" = "x86_64" ] ; then
273 OS_CFLAGS="-arch x86_64"
274 LDFLAGS="-arch x86_64"
275else
276 OS_CFLAGS="-mdynamic-no-pic"
277fi
ths831b7822007-01-18 20:06:33 +0000278darwin_user="yes"
thsfd677642007-01-31 12:10:07 +0000279cocoa="yes"
malc0c58ac12008-06-25 21:04:05 +0000280audio_drv_list="coreaudio"
malcc2de5c92008-06-28 19:13:06 +0000281audio_possible_drivers="coreaudio sdl fmod"
thsc2c59c32008-01-08 00:00:20 +0000282OS_LDFLAGS="-framework CoreFoundation -framework IOKit"
bellard83fb7ad2004-07-05 21:25:26 +0000283;;
bellardec530c82006-04-25 22:36:06 +0000284SunOS)
thsc2b84fa2007-02-10 23:21:21 +0000285 solaris="yes"
286 make="gmake"
287 install="ginstall"
ths0475a5c2007-04-01 18:54:44 +0000288 needs_libsunmath="no"
blueswir1acda94b2009-04-13 16:23:22 +0000289 kvm="no"
thsc2b84fa2007-02-10 23:21:21 +0000290 solarisrev=`uname -r | cut -f2 -d.`
thsef18c882007-09-16 22:12:39 +0000291 # have to select again, because `uname -m` returns i86pc
292 # even on an x86_64 box.
293 solariscpu=`isainfo -k`
294 if test "${solariscpu}" = "amd64" ; then
295 cpu="x86_64"
296 fi
thsc2b84fa2007-02-10 23:21:21 +0000297 if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
ths0475a5c2007-04-01 18:54:44 +0000298 if test "$solarisrev" -le 9 ; then
299 if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then
300 needs_libsunmath="yes"
301 else
302 echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without"
303 echo "libsunmath from the Sun Studio compilers tools, due to a lack of"
304 echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86"
305 echo "Studio 11 can be downloaded from www.sun.com."
306 exit 1
307 fi
308 fi
309 if test "$solarisrev" -ge 9 ; then
thsc2b84fa2007-02-10 23:21:21 +0000310 kqemu="yes"
311 fi
ths86b2bd92007-02-11 00:31:33 +0000312 fi
ths6b4d2ba2007-05-13 18:02:43 +0000313 if test -f /usr/include/sys/soundcard.h ; then
malc0c58ac12008-06-25 21:04:05 +0000314 audio_drv_list="oss"
ths6b4d2ba2007-05-13 18:02:43 +0000315 fi
malcc2de5c92008-06-28 19:13:06 +0000316 audio_possible_drivers="oss sdl"
blueswir114d483e2009-04-13 16:27:08 +0000317 OS_CFLAGS=-std=gnu99
ths86b2bd92007-02-11 00:31:33 +0000318;;
malcb29fe3e2008-11-18 01:42:22 +0000319AIX)
320aix="yes"
321make="gmake"
322;;
bellard1d14ffa2005-10-30 18:58:22 +0000323*)
malc0c58ac12008-06-25 21:04:05 +0000324audio_drv_list="oss"
malcb8e59f12008-07-02 21:03:08 +0000325audio_possible_drivers="oss alsa sdl esd pa"
bellard5327cf42005-01-10 23:18:50 +0000326linux="yes"
ths831b7822007-01-18 20:06:33 +0000327linux_user="yes"
blueswir168063642008-11-22 21:03:55 +0000328usb="linux"
bellard07f4ddb2005-04-23 17:44:28 +0000329if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
bellardc9ec1fe2005-02-10 21:55:30 +0000330 kqemu="yes"
malcc2de5c92008-06-28 19:13:06 +0000331 audio_possible_drivers="$audio_possible_drivers fmod"
bellardc9ec1fe2005-02-10 21:55:30 +0000332fi
bellardfb065182004-11-09 23:09:44 +0000333;;
bellard7d132992003-03-06 23:23:54 +0000334esac
335
bellard7d3505c2004-05-12 19:32:15 +0000336if [ "$bsd" = "yes" ] ; then
pbrookb1a550a2006-04-16 13:28:56 +0000337 if [ "$darwin" != "yes" ] ; then
bellard83fb7ad2004-07-05 21:25:26 +0000338 make="gmake"
blueswir168063642008-11-22 21:03:55 +0000339 usb="bsd"
bellard83fb7ad2004-07-05 21:25:26 +0000340 fi
blueswir184778502008-10-26 20:33:16 +0000341 bsd_user="yes"
bellard7d3505c2004-05-12 19:32:15 +0000342fi
343
bellard7d132992003-03-06 23:23:54 +0000344# find source path
pbrookad064842006-04-16 12:41:07 +0000345source_path=`dirname "$0"`
balrog59faef32008-02-03 04:22:24 +0000346source_path_used="no"
347workdir=`pwd`
pbrookad064842006-04-16 12:41:07 +0000348if [ -z "$source_path" ]; then
balrog59faef32008-02-03 04:22:24 +0000349 source_path=$workdir
pbrookad064842006-04-16 12:41:07 +0000350else
351 source_path=`cd "$source_path"; pwd`
bellard7d132992003-03-06 23:23:54 +0000352fi
pbrook724db112008-02-03 19:20:13 +0000353[ -f "$workdir/vl.c" ] || source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000354
bellard85aa5182007-11-11 20:17:03 +0000355werror="no"
bellard0d1e2392007-11-11 20:24:30 +0000356# generate compile errors on warnings for development builds
357#if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then
358#werror="yes";
359#fi
bellard85aa5182007-11-11 20:17:03 +0000360
bellard7d132992003-03-06 23:23:54 +0000361for opt do
pbrooka46e4032006-04-29 23:05:22 +0000362 optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
bellard7d132992003-03-06 23:23:54 +0000363 case "$opt" in
bellard2efc3262005-12-18 19:14:49 +0000364 --help|-h) show_help=yes
365 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000366 --prefix=*) prefix="$optarg"
bellard7d132992003-03-06 23:23:54 +0000367 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000368 --interp-prefix=*) interp_prefix="$optarg"
bellard32ce6332003-04-11 00:16:16 +0000369 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000370 --source-path=*) source_path="$optarg"
pbrookad064842006-04-16 12:41:07 +0000371 source_path_used="yes"
bellard7d132992003-03-06 23:23:54 +0000372 ;;
aliguoriac0df512008-12-29 17:14:15 +0000373 --cross-prefix=*)
bellard7d132992003-03-06 23:23:54 +0000374 ;;
aliguoriac0df512008-12-29 17:14:15 +0000375 --cc=*)
bellard7d132992003-03-06 23:23:54 +0000376 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000377 --host-cc=*) host_cc="$optarg"
bellard83469012005-07-23 14:27:54 +0000378 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000379 --make=*) make="$optarg"
bellard7d132992003-03-06 23:23:54 +0000380 ;;
pbrook6a882642006-04-17 13:57:12 +0000381 --install=*) install="$optarg"
382 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000383 --extra-cflags=*) CFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000384 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000385 --extra-ldflags=*) LDFLAGS="$optarg"
bellard7d132992003-03-06 23:23:54 +0000386 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000387 --cpu=*) cpu="$optarg"
bellard7d132992003-03-06 23:23:54 +0000388 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000389 --target-list=*) target_list="$optarg"
bellardde83cd02003-06-15 20:25:43 +0000390 ;;
bellard7d132992003-03-06 23:23:54 +0000391 --enable-gprof) gprof="yes"
392 ;;
bellard43ce4df2003-06-09 19:53:12 +0000393 --static) static="yes"
394 ;;
bellard97a847b2003-08-10 21:36:04 +0000395 --disable-sdl) sdl="no"
396 ;;
pbrookb1a550a2006-04-16 13:28:56 +0000397 --fmod-lib=*) fmod_lib="$optarg"
bellard102a52e2004-11-14 19:57:29 +0000398 ;;
malcc2de5c92008-06-28 19:13:06 +0000399 --fmod-inc=*) fmod_inc="$optarg"
400 ;;
blueswir12f6a1ab2008-08-21 18:00:53 +0000401 --oss-lib=*) oss_lib="$optarg"
402 ;;
malc2fa7d3b2008-07-29 12:58:44 +0000403 --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'`
malc0c58ac12008-06-25 21:04:05 +0000404 ;;
405 --audio-drv-list=*) audio_drv_list="$optarg"
406 ;;
aurel32f8393942009-04-13 18:45:38 +0000407 --enable-debug-tcg) debug_tcg="yes"
408 ;;
409 --disable-debug-tcg) debug_tcg="no"
410 ;;
aliguori03b4fe72008-10-07 19:16:17 +0000411 --enable-sparse) sparse="yes"
412 ;;
413 --disable-sparse) sparse="no"
414 ;;
aliguori1625af82009-04-05 17:41:02 +0000415 --disable-strip) strip_opt="no"
416 ;;
ths8d5d2d42007-08-25 01:37:51 +0000417 --disable-vnc-tls) vnc_tls="no"
418 ;;
aliguori2f9606b2009-03-06 20:27:28 +0000419 --disable-vnc-sasl) vnc_sasl="no"
420 ;;
bellard443f1372004-06-04 11:13:20 +0000421 --disable-slirp) slirp="no"
bellard1d14ffa2005-10-30 18:58:22 +0000422 ;;
aliguorie0e6c8c02008-07-23 18:14:33 +0000423 --disable-vde) vde="no"
ths8a16d272008-07-19 09:56:24 +0000424 ;;
bellardc9ec1fe2005-02-10 21:55:30 +0000425 --disable-kqemu) kqemu="no"
bellard1d14ffa2005-10-30 18:58:22 +0000426 ;;
aliguorie37630c2009-04-22 15:19:10 +0000427 --disable-xen) xen="no"
428 ;;
aurel322e4d9fb2008-04-08 06:01:02 +0000429 --disable-brlapi) brlapi="no"
430 ;;
balrogfb599c92008-09-28 23:49:55 +0000431 --disable-bluez) bluez="no"
432 ;;
aliguori7ba1e612008-11-05 16:04:33 +0000433 --disable-kvm) kvm="no"
434 ;;
bellard05c2a3e2006-02-08 22:39:17 +0000435 --enable-profiler) profiler="yes"
436 ;;
malcc2de5c92008-06-28 19:13:06 +0000437 --enable-cocoa)
438 cocoa="yes" ;
439 sdl="no" ;
440 audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`"
bellard1d14ffa2005-10-30 18:58:22 +0000441 ;;
bellard97ccc682005-07-02 13:32:17 +0000442 --disable-gfx-check) check_gfx="no"
443 ;;
pbrookcad25d62006-03-19 16:31:11 +0000444 --disable-system) softmmu="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000445 ;;
pbrookcad25d62006-03-19 16:31:11 +0000446 --enable-system) softmmu="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000447 ;;
ths831b7822007-01-18 20:06:33 +0000448 --disable-linux-user) linux_user="no"
pbrook0a8e90f2006-03-19 14:54:16 +0000449 ;;
ths831b7822007-01-18 20:06:33 +0000450 --enable-linux-user) linux_user="yes"
451 ;;
452 --disable-darwin-user) darwin_user="no"
453 ;;
454 --enable-darwin-user) darwin_user="yes"
pbrook0a8e90f2006-03-19 14:54:16 +0000455 ;;
blueswir184778502008-10-26 20:33:16 +0000456 --disable-bsd-user) bsd_user="no"
457 ;;
458 --enable-bsd-user) bsd_user="yes"
459 ;;
pbrookc5937222006-05-14 11:30:38 +0000460 --enable-uname-release=*) uname_release="$optarg"
461 ;;
blueswir131422552007-04-16 18:27:06 +0000462 --sparc_cpu=*)
463 sparc_cpu="$optarg"
464 case $sparc_cpu in
465 v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
466 target_cpu="sparc"; cpu="sparc" ;;
467 v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
468 target_cpu="sparc"; cpu="sparc" ;;
469 v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
470 target_cpu="sparc64"; cpu="sparc64" ;;
471 *) echo "undefined SPARC architecture. Exiting";exit 1;;
472 esac
473 ;;
bellard85aa5182007-11-11 20:17:03 +0000474 --enable-werror) werror="yes"
475 ;;
476 --disable-werror) werror="no"
477 ;;
balrog4d3b6f62008-02-10 16:33:14 +0000478 --disable-curses) curses="no"
479 ;;
pbrookbd0c5662008-05-29 14:34:11 +0000480 --disable-nptl) nptl="no"
481 ;;
malc8ff9cbf2008-06-23 18:33:30 +0000482 --enable-mixemu) mixemu="yes"
483 ;;
aliguorie5d355d2009-04-24 18:03:15 +0000484 --disable-pthread) pthread="no"
485 ;;
blueswir1414f0da2008-08-15 18:20:52 +0000486 --disable-aio) aio="no"
487 ;;
aliguorie5d355d2009-04-24 18:03:15 +0000488 --enable-io-thread) io_thread="yes"
489 ;;
ths77755342008-11-27 15:45:16 +0000490 --disable-blobs) blobs="no"
491 ;;
aliguorieac30262008-11-05 16:28:56 +0000492 --kerneldir=*) kerneldir="$optarg"
493 ;;
pbrook4a19f1e2009-04-07 23:17:49 +0000494 --with-pkgversion=*) pkgversion=" ($optarg)"
495 ;;
balrog7f1559c2007-11-17 10:24:32 +0000496 *) echo "ERROR: unknown option $opt"; show_help="yes"
497 ;;
bellard7d132992003-03-06 23:23:54 +0000498 esac
499done
500
ths6f30fa82007-01-05 01:00:47 +0000501# default flags for all hosts
blueswir1ac41a622008-09-14 06:46:31 +0000502CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing"
blueswir1e0e36fe2008-12-07 19:16:27 +0000503CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
ths6f30fa82007-01-05 01:00:47 +0000504LDFLAGS="$LDFLAGS -g"
bellard85aa5182007-11-11 20:17:03 +0000505if test "$werror" = "yes" ; then
506CFLAGS="$CFLAGS -Werror"
507fi
ths6f30fa82007-01-05 01:00:47 +0000508
blueswir1d2c7c9b2008-11-01 14:50:20 +0000509if test "$solaris" = "no" ; then
510 if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
511 LDFLAGS="$LDFLAGS -Wl,--warn-common"
512 fi
blueswir149237ac2008-09-17 19:05:19 +0000513fi
514
blueswir131422552007-04-16 18:27:06 +0000515#
516# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
517# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
518#
bellard40293e52008-01-31 11:32:10 +0000519case "$cpu" in
blueswir131422552007-04-16 18:27:06 +0000520 sparc) if test -z "$sparc_cpu" ; then
521 ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
522 ARCH_LDFLAGS="-m32"
523 else
524 ARCH_CFLAGS="${SP_CFLAGS}"
525 ARCH_LDFLAGS="${SP_LDFLAGS}"
526 fi
blueswir1762e8232009-04-04 09:21:28 +0000527 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g2 -ffixed-g3"
528 if test "$solaris" = "no" ; then
529 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g6"
530 fi
blueswir131422552007-04-16 18:27:06 +0000531 ;;
532 sparc64) if test -z "$sparc_cpu" ; then
533 ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
534 ARCH_LDFLAGS="-m64"
535 else
536 ARCH_CFLAGS="${SP_CFLAGS}"
537 ARCH_LDFLAGS="${SP_LDFLAGS}"
538 fi
blueswir1762e8232009-04-04 09:21:28 +0000539 if test "$solaris" = "no" ; then
540 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g5 -ffixed-g6 -ffixed-g7"
541 else
542 ARCH_CFLAGS="$ARCH_CFLAGS -ffixed-g1 -ffixed-g5 -ffixed-g6 -ffixed-g7"
543 fi
blueswir131422552007-04-16 18:27:06 +0000544 ;;
ths76d83bd2007-11-18 21:22:10 +0000545 s390)
546 ARCH_CFLAGS="-march=z900"
547 ;;
bellard40293e52008-01-31 11:32:10 +0000548 i386)
549 ARCH_CFLAGS="-m32"
550 ARCH_LDFLAGS="-m32"
551 ;;
552 x86_64)
553 ARCH_CFLAGS="-m64"
554 ARCH_LDFLAGS="-m64"
555 ;;
blueswir131422552007-04-16 18:27:06 +0000556esac
557
pbrookaf5db582006-04-08 14:26:41 +0000558if test x"$show_help" = x"yes" ; then
559cat << EOF
560
561Usage: configure [options]
562Options: [defaults in brackets after descriptions]
563
564EOF
565echo "Standard options:"
566echo " --help print this message"
567echo " --prefix=PREFIX install in PREFIX [$prefix]"
568echo " --interp-prefix=PREFIX where to find shared libraries, etc."
569echo " use %M for cpu name [$interp_prefix]"
570echo " --target-list=LIST set target list [$target_list]"
571echo ""
572echo "kqemu kernel acceleration support:"
573echo " --disable-kqemu disable kqemu support"
pbrookaf5db582006-04-08 14:26:41 +0000574echo ""
575echo "Advanced options (experts only):"
576echo " --source-path=PATH path of source code [$source_path]"
577echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
578echo " --cc=CC use C compiler CC [$cc]"
579echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc."
aurel322981fa92009-04-07 19:57:17 +0000580echo " --extra-cflags=CFLAGS add C compiler flags CFLAGS"
581echo " --extra-ldflags=LDFLAGS add linker flags LDFLAGS"
pbrookaf5db582006-04-08 14:26:41 +0000582echo " --make=MAKE use specified make [$make]"
pbrook6a882642006-04-17 13:57:12 +0000583echo " --install=INSTALL use specified install [$install]"
pbrookaf5db582006-04-08 14:26:41 +0000584echo " --static enable static build [$static]"
aurel32f8393942009-04-13 18:45:38 +0000585echo " --enable-debug-tcg enable TCG debugging"
586echo " --disable-debug-tcg disable TCG debugging (default)"
aliguori890b1652008-10-07 21:22:41 +0000587echo " --enable-sparse enable sparse checker"
588echo " --disable-sparse disable sparse checker (default)"
aliguori1625af82009-04-05 17:41:02 +0000589echo " --disable-strip disable stripping binaries"
bellard85aa5182007-11-11 20:17:03 +0000590echo " --disable-werror disable compilation abort on warning"
balrogfe8f78e2007-10-31 01:03:28 +0000591echo " --disable-sdl disable SDL"
pbrookaf5db582006-04-08 14:26:41 +0000592echo " --enable-cocoa enable COCOA (Mac OS X only)"
malcc2de5c92008-06-28 19:13:06 +0000593echo " --audio-drv-list=LIST set audio drivers list:"
594echo " Available drivers: $audio_possible_drivers"
malc4c9b53e2009-01-09 10:46:34 +0000595echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]"
596echo " Available cards: $audio_possible_cards"
malc8ff9cbf2008-06-23 18:33:30 +0000597echo " --enable-mixemu enable mixer emulation"
aliguorie37630c2009-04-22 15:19:10 +0000598echo " --disable-xen disable xen backend driver support"
aurel322e4d9fb2008-04-08 06:01:02 +0000599echo " --disable-brlapi disable BrlAPI"
ths8d5d2d42007-08-25 01:37:51 +0000600echo " --disable-vnc-tls disable TLS encryption for VNC server"
aliguori2f9606b2009-03-06 20:27:28 +0000601echo " --disable-vnc-sasl disable SASL encryption for VNC server"
pbrookaf896aa2008-03-23 00:47:42 +0000602echo " --disable-curses disable curses output"
balrogfb599c92008-09-28 23:49:55 +0000603echo " --disable-bluez disable bluez stack connectivity"
aliguori7ba1e612008-11-05 16:04:33 +0000604echo " --disable-kvm disable KVM acceleration support"
pbrookbd0c5662008-05-29 14:34:11 +0000605echo " --disable-nptl disable usermode NPTL support"
pbrookaf5db582006-04-08 14:26:41 +0000606echo " --enable-system enable all system emulation targets"
607echo " --disable-system disable all system emulation targets"
ths831b7822007-01-18 20:06:33 +0000608echo " --enable-linux-user enable all linux usermode emulation targets"
609echo " --disable-linux-user disable all linux usermode emulation targets"
610echo " --enable-darwin-user enable all darwin usermode emulation targets"
611echo " --disable-darwin-user disable all darwin usermode emulation targets"
blueswir184778502008-10-26 20:33:16 +0000612echo " --enable-bsd-user enable all BSD usermode emulation targets"
613echo " --disable-bsd-user disable all BSD usermode emulation targets"
pbrookaf5db582006-04-08 14:26:41 +0000614echo " --fmod-lib path to FMOD library"
615echo " --fmod-inc path to FMOD includes"
blueswir12f6a1ab2008-08-21 18:00:53 +0000616echo " --oss-lib path to OSS library"
pbrookc5937222006-05-14 11:30:38 +0000617echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
blueswir131422552007-04-16 18:27:06 +0000618echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
aliguorie0e6c8c02008-07-23 18:14:33 +0000619echo " --disable-vde disable support for vde network"
aliguorie5d355d2009-04-24 18:03:15 +0000620echo " --disable-pthread disable pthread support"
blueswir1414f0da2008-08-15 18:20:52 +0000621echo " --disable-aio disable AIO support"
aliguorie5d355d2009-04-24 18:03:15 +0000622echo " --enable-io-thread enable IO thread"
ths77755342008-11-27 15:45:16 +0000623echo " --disable-blobs disable installing provided firmware blobs"
aliguorieac30262008-11-05 16:28:56 +0000624echo " --kerneldir=PATH look for kernel includes in PATH"
pbrookaf5db582006-04-08 14:26:41 +0000625echo ""
ths5bf08932006-12-23 00:33:26 +0000626echo "NOTE: The object files are built at the place where configure is launched"
pbrookaf5db582006-04-08 14:26:41 +0000627exit 1
628fi
629
bellard67b915a2004-03-31 23:37:16 +0000630if test "$mingw32" = "yes" ; then
bellard5327cf42005-01-10 23:18:50 +0000631 linux="no"
bellard67b915a2004-03-31 23:37:16 +0000632 EXESUF=".exe"
bellard9f059ec2004-11-14 18:59:52 +0000633 oss="no"
aliguoricd01b4a2008-08-21 19:25:45 +0000634 linux_user="no"
blueswir184778502008-10-26 20:33:16 +0000635 bsd_user="no"
aliguori49dc7682009-03-08 16:26:59 +0000636 OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
aliguoricd01b4a2008-08-21 19:25:45 +0000637fi
638
aliguori03b4fe72008-10-07 19:16:17 +0000639if test ! -x "$(which cgcc 2>/dev/null)"; then
640 sparse="no"
641fi
642
bellardec530c82006-04-25 22:36:06 +0000643#
644# Solaris specific configure tool chain decisions
645#
646if test "$solaris" = "yes" ; then
bellardec530c82006-04-25 22:36:06 +0000647 solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"`
648 if test -z "$solinst" ; then
649 echo "Solaris install program not found. Use --install=/usr/ucb/install or"
650 echo "install fileutils from www.blastwave.org using pkg-get -i fileutils"
651 echo "to get ginstall which is used by default (which lives in /opt/csw/bin)"
652 exit 1
653 fi
654 if test "$solinst" = "/usr/sbin/install" ; then
655 echo "Error: Solaris /usr/sbin/install is not an appropriate install program."
656 echo "try ginstall from the GNU fileutils available from www.blastwave.org"
657 echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install"
658 exit 1
659 fi
bellardec530c82006-04-25 22:36:06 +0000660 sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"`
661 if test -z "$sol_ar" ; then
662 echo "Error: No path includes ar"
663 if test -f /usr/ccs/bin/ar ; then
664 echo "Add /usr/ccs/bin to your path and rerun configure"
665 fi
666 exit 1
667 fi
ths5fafdf22007-09-16 21:08:06 +0000668fi
bellardec530c82006-04-25 22:36:06 +0000669
670
bellard5327cf42005-01-10 23:18:50 +0000671if test -z "$target_list" ; then
672# these targets are portable
pbrook0a8e90f2006-03-19 14:54:16 +0000673 if [ "$softmmu" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000674 target_list="\
675i386-softmmu \
676x86_64-softmmu \
677arm-softmmu \
678cris-softmmu \
679m68k-softmmu \
680mips-softmmu \
681mipsel-softmmu \
682mips64-softmmu \
683mips64el-softmmu \
684ppc-softmmu \
685ppcemb-softmmu \
686ppc64-softmmu \
687sh4-softmmu \
688sh4eb-softmmu \
689sparc-softmmu \
690"
pbrook0a8e90f2006-03-19 14:54:16 +0000691 fi
bellard5327cf42005-01-10 23:18:50 +0000692# the following are Linux specific
ths831b7822007-01-18 20:06:33 +0000693 if [ "$linux_user" = "yes" ] ; then
aurel322408a522008-04-20 20:19:44 +0000694 target_list="${target_list}\
695i386-linux-user \
696x86_64-linux-user \
697alpha-linux-user \
698arm-linux-user \
699armeb-linux-user \
700cris-linux-user \
701m68k-linux-user \
702mips-linux-user \
703mipsel-linux-user \
704ppc-linux-user \
705ppc64-linux-user \
706ppc64abi32-linux-user \
707sh4-linux-user \
708sh4eb-linux-user \
709sparc-linux-user \
710sparc64-linux-user \
711sparc32plus-linux-user \
712"
ths831b7822007-01-18 20:06:33 +0000713 fi
714# the following are Darwin specific
715 if [ "$darwin_user" = "yes" ] ; then
malc6cdc7372009-01-06 18:57:51 +0000716 target_list="$target_list i386-darwin-user ppc-darwin-user "
bellard5327cf42005-01-10 23:18:50 +0000717 fi
blueswir184778502008-10-26 20:33:16 +0000718# the following are BSD specific
719 if [ "$bsd_user" = "yes" ] ; then
720 target_list="${target_list}\
blueswir131fc12d2009-04-11 11:09:31 +0000721i386-bsd-user \
722x86_64-bsd-user \
723sparc-bsd-user \
blueswir184778502008-10-26 20:33:16 +0000724sparc64-bsd-user \
725"
726 fi
bellard6e20a452005-06-05 15:56:02 +0000727else
pbrookb1a550a2006-04-16 13:28:56 +0000728 target_list=`echo "$target_list" | sed -e 's/,/ /g'`
bellard5327cf42005-01-10 23:18:50 +0000729fi
pbrook0a8e90f2006-03-19 14:54:16 +0000730if test -z "$target_list" ; then
731 echo "No targets enabled"
732 exit 1
733fi
bellard5327cf42005-01-10 23:18:50 +0000734
bellard7d132992003-03-06 23:23:54 +0000735if test -z "$cross_prefix" ; then
736
737# ---
738# big/little endian test
739cat > $TMPC << EOF
740#include <inttypes.h>
741int main(int argc, char ** argv){
bellard1d14ffa2005-10-30 18:58:22 +0000742 volatile uint32_t i=0x01234567;
743 return (*((uint8_t*)(&i))) == 0x67;
bellard7d132992003-03-06 23:23:54 +0000744}
745EOF
746
aurel32178baee2008-12-08 18:11:57 +0000747if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
bellard7d132992003-03-06 23:23:54 +0000748$TMPE && bigendian="yes"
749else
750echo big/little test failed
751fi
752
753else
754
755# if cross compiling, cannot launch a program, so make a static guess
aurel320938cda2008-04-11 21:36:06 +0000756if test "$cpu" = "armv4b" \
aurel32f54b3f92008-04-12 20:14:54 +0000757 -o "$cpu" = "hppa" \
aurel320938cda2008-04-11 21:36:06 +0000758 -o "$cpu" = "m68k" \
759 -o "$cpu" = "mips" \
760 -o "$cpu" = "mips64" \
malcfdf7ed92009-01-14 18:39:52 +0000761 -o "$cpu" = "ppc" \
762 -o "$cpu" = "ppc64" \
aurel320938cda2008-04-11 21:36:06 +0000763 -o "$cpu" = "s390" \
764 -o "$cpu" = "sparc" \
765 -o "$cpu" = "sparc64"; then
bellard7d132992003-03-06 23:23:54 +0000766 bigendian="yes"
767fi
768
769fi
770
bellardb6853692005-06-05 17:10:39 +0000771# host long bits test
772hostlongbits="32"
aurel320938cda2008-04-11 21:36:06 +0000773if test "$cpu" = "x86_64" \
774 -o "$cpu" = "alpha" \
775 -o "$cpu" = "ia64" \
malcfdf7ed92009-01-14 18:39:52 +0000776 -o "$cpu" = "sparc64" \
777 -o "$cpu" = "ppc64"; then
bellardb6853692005-06-05 17:10:39 +0000778 hostlongbits="64"
779fi
780
pbrookbd0c5662008-05-29 14:34:11 +0000781# Check host NPTL support
782cat > $TMPC <<EOF
783#include <sched.h>
pbrook30813ce2008-06-02 15:45:44 +0000784#include <linux/futex.h>
pbrookbd0c5662008-05-29 14:34:11 +0000785void foo()
786{
787#if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT)
788#error bork
789#endif
790}
791EOF
792
balrog8c7f7572008-12-15 03:15:36 +0000793if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then
pbrookbd0c5662008-05-29 14:34:11 +0000794 :
795else
796 nptl="no"
797fi
798
bellard11d9f692004-04-02 20:55:59 +0000799##########################################
balrogac629222008-10-11 09:56:04 +0000800# zlib check
801
802cat > $TMPC << EOF
803#include <zlib.h>
804int main(void) { zlibVersion(); return 0; }
805EOF
balrog8c7f7572008-12-15 03:15:36 +0000806if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz > /dev/null 2> /dev/null ; then
balrogac629222008-10-11 09:56:04 +0000807 :
808else
809 echo
810 echo "Error: zlib check failed"
811 echo "Make sure to have the zlib libs and headers installed."
812 echo
813 exit 1
814fi
815
816##########################################
aliguorie37630c2009-04-22 15:19:10 +0000817# xen probe
818
819if test "$xen" = "yes" ; then
820cat > $TMPC <<EOF
821#include <xenctrl.h>
822#include <xs.h>
823int main(void) { xs_daemon_open; xc_interface_open; }
824EOF
825 if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC -lxenstore -lxenctrl 2> /dev/null ; then
826 :
827 else
828 xen="no"
829 fi
830fi
831
832##########################################
bellard11d9f692004-04-02 20:55:59 +0000833# SDL probe
834
835sdl_too_old=no
836
837if test -z "$sdl" ; then
ths069b0bd2007-07-12 00:27:15 +0000838 sdl_config="sdl-config"
839 sdl=no
840 sdl_static=no
bellard11d9f692004-04-02 20:55:59 +0000841
842cat > $TMPC << EOF
843#include <SDL.h>
844#undef main /* We don't want SDL to override our main() */
845int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
846EOF
balrog8c7f7572008-12-15 03:15:36 +0000847 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > $TMPSDLLOG 2>&1 ; then
aliguoricd01b4a2008-08-21 19:25:45 +0000848 _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
849 if test "$_sdlversion" -lt 121 ; then
850 sdl_too_old=yes
851 else
852 if test "$cocoa" = "no" ; then
853 sdl=yes
854 fi
855 fi
856
857 # static link with sdl ?
858 if test "$sdl" = "yes" ; then
859 aa="no"
860 `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
861 sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
862 if [ "$aa" = "yes" ] ; then
863 sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
ths069b0bd2007-07-12 00:27:15 +0000864 fi
bellard11d9f692004-04-02 20:55:59 +0000865
balrog8c7f7572008-12-15 03:15:36 +0000866 if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs > /dev/null 2> /dev/null; then
aliguoricd01b4a2008-08-21 19:25:45 +0000867 sdl_static=yes
868 fi
869 fi # static link
870 fi # sdl compile test
bellard11d9f692004-04-02 20:55:59 +0000871else
ths069b0bd2007-07-12 00:27:15 +0000872 # Make sure to disable cocoa if sdl was set
873 if test "$sdl" = "yes" ; then
874 cocoa="no"
malcc2de5c92008-06-28 19:13:06 +0000875 audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`"
ths069b0bd2007-07-12 00:27:15 +0000876 fi
bellarda6e022a2004-04-02 21:55:47 +0000877fi # -z $sdl
bellard11d9f692004-04-02 20:55:59 +0000878
aliguori5368a422009-03-03 17:37:21 +0000879if test "$sdl" = "yes" ; then
880cat > $TMPC <<EOF
881#include <SDL.h>
882#if defined(SDL_VIDEO_DRIVER_X11)
883#include <X11/XKBlib.h>
884#else
885#error No x11 support
886#endif
887int main(void) { return 0; }
888EOF
889 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` > /dev/null 2>&1 ; then
890 sdl_x11="yes"
891 fi
892fi
893
ths8f28f3f2007-01-05 21:25:54 +0000894##########################################
ths8d5d2d42007-08-25 01:37:51 +0000895# VNC TLS detection
896if test "$vnc_tls" = "yes" ; then
aliguoriae6b5e52008-08-06 16:55:50 +0000897cat > $TMPC <<EOF
898#include <gnutls/gnutls.h>
899int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; }
900EOF
901 vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null`
902 vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null`
903 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \
balrog8c7f7572008-12-15 03:15:36 +0000904 $vnc_tls_libs > /dev/null 2> /dev/null ; then
aliguoriae6b5e52008-08-06 16:55:50 +0000905 :
906 else
907 vnc_tls="no"
908 fi
ths8d5d2d42007-08-25 01:37:51 +0000909fi
910
911##########################################
aliguori2f9606b2009-03-06 20:27:28 +0000912# VNC SASL detection
913if test "$vnc_sasl" = "yes" ; then
914cat > $TMPC <<EOF
915#include <sasl/sasl.h>
916#include <stdio.h>
917int main(void) { sasl_server_init(NULL, "qemu"); return 0; }
918EOF
919 # Assuming Cyrus-SASL installed in /usr prefix
920 vnc_sasl_cflags=""
921 vnc_sasl_libs="-lsasl2"
922 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_sasl_cflags $TMPC \
923 $vnc_sasl_libs 2> /dev/null ; then
924 :
925 else
926 vnc_sasl="no"
927 fi
928fi
929
930##########################################
aliguori76655d62009-03-06 20:27:37 +0000931# fnmatch() probe, used for ACL routines
932fnmatch="no"
933cat > $TMPC << EOF
934#include <fnmatch.h>
935int main(void)
936{
937 fnmatch("foo", "foo", 0);
938 return 0;
939}
940EOF
941if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
942 fnmatch="yes"
943fi
944
945##########################################
ths8a16d272008-07-19 09:56:24 +0000946# vde libraries probe
947if test "$vde" = "yes" ; then
948 cat > $TMPC << EOF
949#include <libvdeplug.h>
pbrook4a7f0e02008-09-07 16:42:53 +0000950int main(void)
951{
952 struct vde_open_args a = {0, 0, 0};
953 vde_open("", "", &a);
954 return 0;
955}
ths8a16d272008-07-19 09:56:24 +0000956EOF
balrog8c7f7572008-12-15 03:15:36 +0000957 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug > /dev/null 2> /dev/null ; then
ths8a16d272008-07-19 09:56:24 +0000958 :
959 else
aliguorie0e6c8c02008-07-23 18:14:33 +0000960 vde="no"
ths8a16d272008-07-19 09:56:24 +0000961 fi
962fi
963
964##########################################
malcc2de5c92008-06-28 19:13:06 +0000965# Sound support libraries probe
ths8f28f3f2007-01-05 21:25:54 +0000966
malcc2de5c92008-06-28 19:13:06 +0000967audio_drv_probe()
968{
969 drv=$1
970 hdr=$2
971 lib=$3
972 exp=$4
973 cfl=$5
974 cat > $TMPC << EOF
975#include <$hdr>
976int main(void) { $exp }
ths8f28f3f2007-01-05 21:25:54 +0000977EOF
balrog8c7f7572008-12-15 03:15:36 +0000978 if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib > /dev/null 2> /dev/null ; then
malcc2de5c92008-06-28 19:13:06 +0000979 :
980 else
981 echo
982 echo "Error: $drv check failed"
983 echo "Make sure to have the $drv libs and headers installed."
984 echo
985 exit 1
986 fi
987}
988
malc2fa7d3b2008-07-29 12:58:44 +0000989audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'`
malcc2de5c92008-06-28 19:13:06 +0000990for drv in $audio_drv_list; do
991 case $drv in
992 alsa)
993 audio_drv_probe $drv alsa/asoundlib.h -lasound \
994 "snd_pcm_t **handle; return snd_pcm_close(*handle);"
995 ;;
996
997 fmod)
998 if test -z $fmod_lib || test -z $fmod_inc; then
999 echo
1000 echo "Error: You must specify path to FMOD library and headers"
1001 echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so"
1002 echo
1003 exit 1
1004 fi
1005 audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc"
1006 ;;
1007
1008 esd)
1009 audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);'
1010 ;;
malcb8e59f12008-07-02 21:03:08 +00001011
1012 pa)
1013 audio_drv_probe $drv pulse/simple.h -lpulse-simple \
1014 "pa_simple *s = NULL; pa_simple_free(s); return 0;"
1015 ;;
1016
blueswir12f6a1ab2008-08-21 18:00:53 +00001017 oss|sdl|core|wav|dsound)
1018 # XXX: Probes for CoreAudio, DirectSound, SDL(?)
1019 ;;
1020
malce4c63a62008-07-19 16:15:16 +00001021 *)
malc1c9b2a52008-07-19 16:57:30 +00001022 echo "$audio_possible_drivers" | grep -q "\<$drv\>" || {
malce4c63a62008-07-19 16:15:16 +00001023 echo
1024 echo "Error: Unknown driver '$drv' selected"
1025 echo "Possible drivers are: $audio_possible_drivers"
1026 echo
1027 exit 1
1028 }
1029 ;;
malcc2de5c92008-06-28 19:13:06 +00001030 esac
1031done
ths8f28f3f2007-01-05 21:25:54 +00001032
balrog4d3b6f62008-02-10 16:33:14 +00001033##########################################
aurel322e4d9fb2008-04-08 06:01:02 +00001034# BrlAPI probe
1035
1036if test -z "$brlapi" ; then
1037 brlapi=no
1038cat > $TMPC << EOF
1039#include <brlapi.h>
1040int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); }
1041EOF
aurel32178baee2008-12-08 18:11:57 +00001042 if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then
aurel322e4d9fb2008-04-08 06:01:02 +00001043 brlapi=yes
1044 fi # brlapi compile test
1045fi # -z $brlapi
1046
1047##########################################
balrog4d3b6f62008-02-10 16:33:14 +00001048# curses probe
1049
1050if test "$curses" = "yes" ; then
1051 curses=no
1052 cat > $TMPC << EOF
1053#include <curses.h>
blueswir15a8ff3a2009-04-13 16:18:34 +00001054#ifdef __OpenBSD__
1055#define resize_term resizeterm
1056#endif
1057int main(void) { resize_term(0, 0); return curses_version(); }
balrog4d3b6f62008-02-10 16:33:14 +00001058EOF
aurel32178baee2008-12-08 18:11:57 +00001059 if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then
balrog4d3b6f62008-02-10 16:33:14 +00001060 curses=yes
1061 fi
1062fi # test "$curses"
1063
blueswir1414f0da2008-08-15 18:20:52 +00001064##########################################
balrogfb599c92008-09-28 23:49:55 +00001065# bluez support probe
1066if test "$bluez" = "yes" ; then
1067 `pkg-config bluez` || bluez="no"
1068fi
1069if test "$bluez" = "yes" ; then
balroge820e3f2008-09-30 02:27:44 +00001070 cat > $TMPC << EOF
1071#include <bluetooth/bluetooth.h>
1072int main(void) { return bt_error(0); }
1073EOF
balrogfb599c92008-09-28 23:49:55 +00001074 bluez_cflags=`pkg-config --cflags bluez`
1075 bluez_libs=`pkg-config --libs bluez`
balrog17e15922008-10-11 12:00:42 +00001076 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \
balrog8c7f7572008-12-15 03:15:36 +00001077 $bluez_libs > /dev/null 2> /dev/null ; then
balroge820e3f2008-09-30 02:27:44 +00001078 :
1079 else
1080 bluez="no"
1081 fi
balrogfb599c92008-09-28 23:49:55 +00001082fi
1083
1084##########################################
aliguori7ba1e612008-11-05 16:04:33 +00001085# kvm probe
1086if test "$kvm" = "yes" ; then
1087 cat > $TMPC <<EOF
1088#include <linux/kvm.h>
aliguori9fd8d8d2009-01-15 21:57:30 +00001089#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12
aliguori7ba1e612008-11-05 16:04:33 +00001090#error Invalid KVM version
1091#endif
aliguori9fd8d8d2009-01-15 21:57:30 +00001092#if !defined(KVM_CAP_USER_MEMORY)
1093#error Missing KVM capability KVM_CAP_USER_MEMORY
1094#endif
1095#if !defined(KVM_CAP_SET_TSS_ADDR)
1096#error Missing KVM capability KVM_CAP_SET_TSS_ADDR
1097#endif
1098#if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
1099#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
1100#endif
aliguori7ba1e612008-11-05 16:04:33 +00001101int main(void) { return 0; }
1102EOF
aliguorieac30262008-11-05 16:28:56 +00001103 if test "$kerneldir" != "" ; then
1104 kvm_cflags=-I"$kerneldir"/include
aliguori8444eb62009-01-09 20:05:10 +00001105 if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
1106 -a -d "$kerneldir/arch/x86/include" ; then
1107 kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
aliguori406b4302009-01-15 21:13:33 +00001108 elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
1109 kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
aliguori8444eb62009-01-09 20:05:10 +00001110 elif test -d "$kerneldir/arch/$cpu/include" ; then
1111 kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
1112 fi
aliguorieac30262008-11-05 16:28:56 +00001113 else
1114 kvm_cflags=""
1115 fi
aliguori7ba1e612008-11-05 16:04:33 +00001116 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \
balrog8c7f7572008-12-15 03:15:36 +00001117 > /dev/null 2>/dev/null ; then
aliguori7ba1e612008-11-05 16:04:33 +00001118 :
1119 else
aliguori9fd8d8d2009-01-15 21:57:30 +00001120 kvm="no";
1121 if [ -x "`which awk 2>/dev/null`" ] && \
1122 [ -x "`which grep 2>/dev/null`" ]; then
blueswir1e4f51002009-03-09 17:36:50 +00001123 kvmerr=`LANG=C $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \
aliguori9fd8d8d2009-01-15 21:57:30 +00001124 | grep "error: " \
1125 | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
1126 if test "$kvmerr" != "" ; then
1127 kvm="no - (${kvmerr})"
1128 fi
1129 fi
aliguori7ba1e612008-11-05 16:04:33 +00001130 fi
1131fi
1132
1133##########################################
aliguorie5d355d2009-04-24 18:03:15 +00001134# pthread probe
1135PTHREADLIBS=""
aliguori3c529d92008-12-12 16:41:40 +00001136
aliguorie5d355d2009-04-24 18:03:15 +00001137if test "$pthread" = yes; then
1138 pthread=no
1139cat > $TMPC << EOF
aliguori3c529d92008-12-12 16:41:40 +00001140#include <pthread.h>
blueswir1c9db92f2009-01-17 06:49:15 +00001141int main(void) { pthread_mutex_t lock; return 0; }
blueswir1414f0da2008-08-15 18:20:52 +00001142EOF
aliguorie5d355d2009-04-24 18:03:15 +00001143 if $cc $ARCH_CFLAGS -o $TMPE $PTHREADLIBS $TMPC 2> /dev/null ; then
1144 pthread=yes
1145 PTHREADLIBS="-lpthread"
blueswir1414f0da2008-08-15 18:20:52 +00001146 fi
1147fi
1148
aliguorie5d355d2009-04-24 18:03:15 +00001149if test "$pthread" = no; then
1150 aio=no
1151 io_thread=no
1152fi
1153
aliguoribf9298b2008-12-05 20:05:26 +00001154##########################################
1155# iovec probe
1156cat > $TMPC <<EOF
blueswir1db34f0b2009-01-14 18:03:53 +00001157#include <sys/types.h>
aliguoribf9298b2008-12-05 20:05:26 +00001158#include <sys/uio.h>
blueswir1db34f0b2009-01-14 18:03:53 +00001159#include <unistd.h>
aliguoribf9298b2008-12-05 20:05:26 +00001160int main(void) { struct iovec iov; return 0; }
1161EOF
1162iovec=no
balrog8c7f7572008-12-15 03:15:36 +00001163if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
aliguoribf9298b2008-12-05 20:05:26 +00001164 iovec=yes
1165fi
1166
aurel32f652e6a2008-12-16 10:43:48 +00001167##########################################
aliguoriceb42de2009-04-07 18:43:28 +00001168# preadv probe
1169cat > $TMPC <<EOF
1170#include <sys/types.h>
1171#include <sys/uio.h>
1172#include <unistd.h>
1173int main(void) { preadv; }
1174EOF
1175preadv=no
1176if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
1177 preadv=yes
1178fi
1179
1180##########################################
aurel32f652e6a2008-12-16 10:43:48 +00001181# fdt probe
1182if test "$fdt" = "yes" ; then
1183 fdt=no
1184 cat > $TMPC << EOF
1185int main(void) { return 0; }
1186EOF
1187 if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lfdt 2> /dev/null ; then
1188 fdt=yes
1189 fi
1190fi
1191
aurel323b3f24a2009-04-15 16:12:13 +00001192#
1193# Check for xxxat() functions when we are building linux-user
1194# emulator. This is done because older glibc versions don't
1195# have syscall stubs for these implemented.
1196#
1197atfile=no
1198if [ "$linux_user" = "yes" ] ; then
1199 cat > $TMPC << EOF
1200#define _ATFILE_SOURCE
1201#include <sys/types.h>
1202#include <fcntl.h>
1203#include <unistd.h>
1204
1205int
1206main(void)
1207{
1208 /* try to unlink nonexisting file */
1209 return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
1210}
1211EOF
1212 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1213 atfile=yes
1214 fi
1215fi
1216
aurel3239386ac2009-04-15 19:48:17 +00001217# Check for inotify functions when we are building linux-user
aurel323b3f24a2009-04-15 16:12:13 +00001218# emulator. This is done because older glibc versions don't
1219# have syscall stubs for these implemented. In that case we
1220# don't provide them even if kernel supports them.
1221#
1222inotify=no
1223if [ "$linux_user" = "yes" ] ; then
1224 cat > $TMPC << EOF
1225#include <sys/inotify.h>
1226
1227int
1228main(void)
1229{
1230 /* try to start inotify */
aurel328690e422009-04-17 13:50:32 +00001231 return inotify_init();
aurel323b3f24a2009-04-15 16:12:13 +00001232}
1233EOF
1234 if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
1235 inotify=yes
1236 fi
1237fi
1238
pbrookcc8ae6d2006-04-23 17:57:59 +00001239# Check if tools are available to build documentation.
ths6c591862007-05-09 13:55:03 +00001240if [ -x "`which texi2html 2>/dev/null`" ] && \
1241 [ -x "`which pod2man 2>/dev/null`" ]; then
pbrookcc8ae6d2006-04-23 17:57:59 +00001242 build_docs="yes"
1243fi
1244
aliguorida93a1f2008-12-12 20:02:52 +00001245##########################################
1246# Do we need librt
aliguorie5d355d2009-04-24 18:03:15 +00001247CLOCKLIBS=""
aliguorida93a1f2008-12-12 20:02:52 +00001248cat > $TMPC <<EOF
1249#include <signal.h>
1250#include <time.h>
1251int main(void) { clockid_t id; return clock_gettime(id, NULL); }
1252EOF
1253
1254rt=no
balrog8c7f7572008-12-15 03:15:36 +00001255if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
aliguorida93a1f2008-12-12 20:02:52 +00001256 :
balrog8c7f7572008-12-15 03:15:36 +00001257elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt > /dev/null 2> /dev/null ; then
aliguorida93a1f2008-12-12 20:02:52 +00001258 rt=yes
1259fi
1260
1261if test "$rt" = "yes" ; then
aliguorie5d355d2009-04-24 18:03:15 +00001262 CLOCKLIBS="-lrt"
aliguorida93a1f2008-12-12 20:02:52 +00001263fi
1264
bellard11d9f692004-04-02 20:55:59 +00001265if test "$mingw32" = "yes" ; then
pbrook308c3592007-02-27 00:52:01 +00001266 if test -z "$prefix" ; then
aliguori17e90972008-10-24 14:11:41 +00001267 prefix="c:\\\\Program Files\\\\Qemu"
pbrook308c3592007-02-27 00:52:01 +00001268 fi
1269 mansuffix=""
1270 datasuffix=""
1271 docsuffix=""
1272 binsuffix=""
bellard11d9f692004-04-02 20:55:59 +00001273else
pbrook308c3592007-02-27 00:52:01 +00001274 if test -z "$prefix" ; then
1275 prefix="/usr/local"
1276 fi
1277 mansuffix="/share/man"
1278 datasuffix="/share/qemu"
1279 docsuffix="/share/doc/qemu"
1280 binsuffix="/bin"
bellard11d9f692004-04-02 20:55:59 +00001281fi
bellard5a671352003-10-01 00:13:48 +00001282
bellard43ce4df2003-06-09 19:53:12 +00001283echo "Install prefix $prefix"
pbrook308c3592007-02-27 00:52:01 +00001284echo "BIOS directory $prefix$datasuffix"
1285echo "binary directory $prefix$binsuffix"
bellard11d9f692004-04-02 20:55:59 +00001286if test "$mingw32" = "no" ; then
pbrook308c3592007-02-27 00:52:01 +00001287echo "Manual directory $prefix$mansuffix"
bellard43ce4df2003-06-09 19:53:12 +00001288echo "ELF interp prefix $interp_prefix"
bellard11d9f692004-04-02 20:55:59 +00001289fi
bellard5a671352003-10-01 00:13:48 +00001290echo "Source path $source_path"
bellard43ce4df2003-06-09 19:53:12 +00001291echo "C compiler $cc"
bellard83469012005-07-23 14:27:54 +00001292echo "Host C compiler $host_cc"
pbrookdb7287e2008-02-03 16:27:13 +00001293echo "ARCH_CFLAGS $ARCH_CFLAGS"
bellard43ce4df2003-06-09 19:53:12 +00001294echo "make $make"
pbrook6a882642006-04-17 13:57:12 +00001295echo "install $install"
bellard43ce4df2003-06-09 19:53:12 +00001296echo "host CPU $cpu"
bellardde83cd02003-06-15 20:25:43 +00001297echo "host big endian $bigendian"
bellard97a847b2003-08-10 21:36:04 +00001298echo "target list $target_list"
aurel32ade25b02009-04-16 09:58:41 +00001299echo "tcg debug enabled $debug_tcg"
bellard43ce4df2003-06-09 19:53:12 +00001300echo "gprof enabled $gprof"
aliguori03b4fe72008-10-07 19:16:17 +00001301echo "sparse enabled $sparse"
aliguori1625af82009-04-05 17:41:02 +00001302echo "strip binaries $strip_opt"
bellard05c2a3e2006-02-08 22:39:17 +00001303echo "profiler $profiler"
bellard43ce4df2003-06-09 19:53:12 +00001304echo "static build $static"
bellard85aa5182007-11-11 20:17:03 +00001305echo "-Werror enabled $werror"
bellard5b0753e2005-03-01 21:37:28 +00001306if test "$darwin" = "yes" ; then
1307 echo "Cocoa support $cocoa"
1308fi
bellard97a847b2003-08-10 21:36:04 +00001309echo "SDL support $sdl"
bellarde4afee92005-04-26 20:46:24 +00001310if test "$sdl" != "no" ; then
1311 echo "SDL static link $sdl_static"
1312fi
balrog4d3b6f62008-02-10 16:33:14 +00001313echo "curses support $curses"
bellard67b915a2004-03-31 23:37:16 +00001314echo "mingw32 support $mingw32"
malc0c58ac12008-06-25 21:04:05 +00001315echo "Audio drivers $audio_drv_list"
1316echo "Extra audio cards $audio_card_list"
malc8ff9cbf2008-06-23 18:33:30 +00001317echo "Mixer emulation $mixemu"
ths8d5d2d42007-08-25 01:37:51 +00001318echo "VNC TLS support $vnc_tls"
1319if test "$vnc_tls" = "yes" ; then
1320 echo " TLS CFLAGS $vnc_tls_cflags"
1321 echo " TLS LIBS $vnc_tls_libs"
1322fi
aliguori2f9606b2009-03-06 20:27:28 +00001323echo "VNC SASL support $vnc_sasl"
1324if test "$vnc_sasl" = "yes" ; then
1325 echo " SASL CFLAGS $vnc_sasl_cflags"
1326 echo " SASL LIBS $vnc_sasl_libs"
1327fi
blueswir131422552007-04-16 18:27:06 +00001328if test -n "$sparc_cpu"; then
1329 echo "Target Sparc Arch $sparc_cpu"
1330fi
bellard07f4ddb2005-04-23 17:44:28 +00001331echo "kqemu support $kqemu"
aliguorie37630c2009-04-22 15:19:10 +00001332echo "xen support $xen"
aurel322e4d9fb2008-04-08 06:01:02 +00001333echo "brlapi support $brlapi"
pbrookcc8ae6d2006-04-23 17:57:59 +00001334echo "Documentation $build_docs"
pbrookc5937222006-05-14 11:30:38 +00001335[ ! -z "$uname_release" ] && \
1336echo "uname -r $uname_release"
pbrookbd0c5662008-05-29 14:34:11 +00001337echo "NPTL support $nptl"
ths8a16d272008-07-19 09:56:24 +00001338echo "vde support $vde"
blueswir1414f0da2008-08-15 18:20:52 +00001339echo "AIO support $aio"
aliguorie5d355d2009-04-24 18:03:15 +00001340echo "IO thread $io_thread"
ths77755342008-11-27 15:45:16 +00001341echo "Install blobs $blobs"
aliguori7ba1e612008-11-05 16:04:33 +00001342echo "KVM support $kvm"
aurel32f652e6a2008-12-16 10:43:48 +00001343echo "fdt support $fdt"
aliguoriceb42de2009-04-07 18:43:28 +00001344echo "preadv support $preadv"
bellard67b915a2004-03-31 23:37:16 +00001345
bellard97a847b2003-08-10 21:36:04 +00001346if test $sdl_too_old = "yes"; then
bellard24b55b92005-03-01 22:30:41 +00001347echo "-> Your SDL version is too old - please upgrade to have SDL support"
bellarde8cd23d2003-06-25 16:08:13 +00001348fi
malcd4742de2008-11-29 22:04:31 +00001349if [ -s $TMPSDLLOG ]; then
ths20b40c62007-07-11 23:39:45 +00001350 echo "The error log from compiling the libSDL test is: "
malcd4742de2008-11-29 22:04:31 +00001351 cat $TMPSDLLOG
ths20b40c62007-07-11 23:39:45 +00001352fi
bellard24b55b92005-03-01 22:30:41 +00001353#if test "$sdl_static" = "no"; then
1354# echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output"
1355#fi
bellard97a847b2003-08-10 21:36:04 +00001356config_mak="config-host.mak"
1357config_h="config-host.h"
1358
bellard7c1f25b2004-04-22 00:02:08 +00001359#echo "Creating $config_mak and $config_h"
bellard97a847b2003-08-10 21:36:04 +00001360
ths15d9ca02007-07-31 23:07:32 +00001361test -f $config_h && mv $config_h ${config_h}~
1362
bellard97a847b2003-08-10 21:36:04 +00001363echo "# Automatically generated by configure - do not modify" > $config_mak
malcfc9902d2008-12-17 19:00:18 +00001364printf "# Configured with:" >> $config_mak
malcfd69fe22008-12-07 22:50:16 +00001365printf " '%s'" "$0" "$@" >> $config_mak
1366echo >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001367echo "/* Automatically generated by configure - do not modify */" > $config_h
1368
1369echo "prefix=$prefix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001370echo "bindir=\${prefix}$binsuffix" >> $config_mak
1371echo "mandir=\${prefix}$mansuffix" >> $config_mak
1372echo "datadir=\${prefix}$datasuffix" >> $config_mak
ths4ad5b062007-03-03 21:47:02 +00001373echo "docdir=\${prefix}$docsuffix" >> $config_mak
pbrook308c3592007-02-27 00:52:01 +00001374echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001375echo "MAKE=$make" >> $config_mak
pbrook6a882642006-04-17 13:57:12 +00001376echo "INSTALL=$install" >> $config_mak
aliguori58f8aea2009-04-18 15:36:02 +00001377echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_mak
1378echo "INSTALL_DATA=$install -m0644 -p" >> $config_mak
1379echo "INSTALL_PROG=$install -m0755 -p" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001380echo "CC=$cc" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001381echo "HOST_CC=$host_cc" >> $config_mak
1382echo "AR=$ar" >> $config_mak
bellard40293e52008-01-31 11:32:10 +00001383# XXX: only use CFLAGS and LDFLAGS ?
1384# XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross
1385# compilation of dyngen tool (useful for win32 build on Linux host)
ths6f30fa82007-01-05 01:00:47 +00001386echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
blueswir131422552007-04-16 18:27:06 +00001387echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
1388echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
1389echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
bellard97a847b2003-08-10 21:36:04 +00001390echo "CFLAGS=$CFLAGS" >> $config_mak
1391echo "LDFLAGS=$LDFLAGS" >> $config_mak
bellard67b915a2004-03-31 23:37:16 +00001392echo "EXESUF=$EXESUF" >> $config_mak
aliguorie5d355d2009-04-24 18:03:15 +00001393echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak
1394echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001395case "$cpu" in
1396 i386)
1397 echo "ARCH=i386" >> $config_mak
1398 echo "#define HOST_I386 1" >> $config_h
1399 ;;
1400 x86_64)
1401 echo "ARCH=x86_64" >> $config_mak
1402 echo "#define HOST_X86_64 1" >> $config_h
1403 ;;
1404 alpha)
1405 echo "ARCH=alpha" >> $config_mak
1406 echo "#define HOST_ALPHA 1" >> $config_h
1407 ;;
1408 armv4b)
1409 echo "ARCH=arm" >> $config_mak
1410 echo "#define HOST_ARM 1" >> $config_h
1411 ;;
1412 armv4l)
1413 echo "ARCH=arm" >> $config_mak
1414 echo "#define HOST_ARM 1" >> $config_h
1415 ;;
1416 cris)
1417 echo "ARCH=cris" >> $config_mak
1418 echo "#define HOST_CRIS 1" >> $config_h
1419 ;;
1420 hppa)
1421 echo "ARCH=hppa" >> $config_mak
1422 echo "#define HOST_HPPA 1" >> $config_h
1423 ;;
1424 ia64)
1425 echo "ARCH=ia64" >> $config_mak
1426 echo "#define HOST_IA64 1" >> $config_h
1427 ;;
1428 m68k)
1429 echo "ARCH=m68k" >> $config_mak
1430 echo "#define HOST_M68K 1" >> $config_h
1431 ;;
1432 mips)
1433 echo "ARCH=mips" >> $config_mak
1434 echo "#define HOST_MIPS 1" >> $config_h
1435 ;;
1436 mips64)
1437 echo "ARCH=mips64" >> $config_mak
1438 echo "#define HOST_MIPS64 1" >> $config_h
1439 ;;
malcfdf7ed92009-01-14 18:39:52 +00001440 ppc)
1441 echo "ARCH=ppc" >> $config_mak
1442 echo "#define HOST_PPC 1" >> $config_h
1443 ;;
1444 ppc64)
1445 echo "ARCH=ppc64" >> $config_mak
1446 echo "#define HOST_PPC64 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001447 ;;
1448 s390)
1449 echo "ARCH=s390" >> $config_mak
1450 echo "#define HOST_S390 1" >> $config_h
1451 ;;
1452 sparc)
1453 echo "ARCH=sparc" >> $config_mak
1454 echo "#define HOST_SPARC 1" >> $config_h
1455 ;;
1456 sparc64)
1457 echo "ARCH=sparc64" >> $config_mak
1458 echo "#define HOST_SPARC64 1" >> $config_h
1459 ;;
1460 *)
1461 echo "Unsupported CPU = $cpu"
1462 exit 1
1463 ;;
1464esac
aurel32f8393942009-04-13 18:45:38 +00001465if test "$debug_tcg" = "yes" ; then
1466 echo "#define DEBUG_TCG 1" >> $config_h
1467fi
aliguori03b4fe72008-10-07 19:16:17 +00001468if test "$sparse" = "yes" ; then
1469 echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak
1470 echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak
1471 echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak
1472fi
aliguori1625af82009-04-05 17:41:02 +00001473if test "$strip_opt" = "yes" ; then
1474 echo "STRIP_OPT=-s" >> $config_mak
1475fi
bellard7d132992003-03-06 23:23:54 +00001476if test "$bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001477 echo "WORDS_BIGENDIAN=yes" >> $config_mak
1478 echo "#define WORDS_BIGENDIAN 1" >> $config_h
1479fi
bellardb6853692005-06-05 17:10:39 +00001480echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h
bellard67b915a2004-03-31 23:37:16 +00001481if test "$mingw32" = "yes" ; then
1482 echo "CONFIG_WIN32=yes" >> $config_mak
bellard11d9f692004-04-02 20:55:59 +00001483 echo "#define CONFIG_WIN32 1" >> $config_h
pbrook210fa552007-02-27 21:04:49 +00001484else
1485 cat > $TMPC << EOF
1486#include <byteswap.h>
1487int main(void) { return bswap_32(0); }
1488EOF
aurel32178baee2008-12-08 18:11:57 +00001489 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
pbrook210fa552007-02-27 21:04:49 +00001490 echo "#define HAVE_BYTESWAP_H 1" >> $config_h
1491 fi
blueswir113606772008-12-05 17:54:09 +00001492 cat > $TMPC << EOF
1493#include <sys/endian.h>
1494#include <sys/types.h>
1495#include <machine/bswap.h>
1496int main(void) { return bswap32(0); }
1497EOF
aurel32178baee2008-12-08 18:11:57 +00001498 if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then
blueswir113606772008-12-05 17:54:09 +00001499 echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h
1500 fi
bellard67b915a2004-03-31 23:37:16 +00001501fi
blueswir1128ab2f2008-08-15 18:33:42 +00001502
1503if [ "$openbsd" = "yes" ] ; then
1504 echo "#define ENOTSUP 4096" >> $config_h
1505fi
1506
bellard83fb7ad2004-07-05 21:25:26 +00001507if test "$darwin" = "yes" ; then
1508 echo "CONFIG_DARWIN=yes" >> $config_mak
1509 echo "#define CONFIG_DARWIN 1" >> $config_h
1510fi
malcb29fe3e2008-11-18 01:42:22 +00001511
1512if test "$aix" = "yes" ; then
1513 echo "CONFIG_AIX=yes" >> $config_mak
1514 echo "#define CONFIG_AIX 1" >> $config_h
1515fi
1516
bellardec530c82006-04-25 22:36:06 +00001517if test "$solaris" = "yes" ; then
1518 echo "CONFIG_SOLARIS=yes" >> $config_mak
bellard38cfa062006-05-01 13:58:07 +00001519 echo "#define HOST_SOLARIS $solarisrev" >> $config_h
ths0475a5c2007-04-01 18:54:44 +00001520 if test "$needs_libsunmath" = "yes" ; then
1521 echo "NEEDS_LIBSUNMATH=yes" >> $config_mak
1522 echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
1523 fi
bellardec530c82006-04-25 22:36:06 +00001524fi
blueswir131422552007-04-16 18:27:06 +00001525if test -n "$sparc_cpu"; then
1526 echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
1527 echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
1528fi
bellard67b915a2004-03-31 23:37:16 +00001529if test "$gdbstub" = "yes" ; then
1530 echo "CONFIG_GDBSTUB=yes" >> $config_mak
1531 echo "#define CONFIG_GDBSTUB 1" >> $config_h
1532fi
bellard97a847b2003-08-10 21:36:04 +00001533if test "$gprof" = "yes" ; then
1534 echo "TARGET_GPROF=yes" >> $config_mak
1535 echo "#define HAVE_GPROF 1" >> $config_h
1536fi
1537if test "$static" = "yes" ; then
1538 echo "CONFIG_STATIC=yes" >> $config_mak
bellard50863472003-10-28 23:04:01 +00001539 echo "#define CONFIG_STATIC 1" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001540fi
bellard05c2a3e2006-02-08 22:39:17 +00001541if test $profiler = "yes" ; then
1542 echo "#define CONFIG_PROFILER 1" >> $config_h
1543fi
bellardc20709a2004-04-21 23:27:19 +00001544if test "$slirp" = "yes" ; then
1545 echo "CONFIG_SLIRP=yes" >> $config_mak
1546 echo "#define CONFIG_SLIRP 1" >> $config_h
1547fi
ths8a16d272008-07-19 09:56:24 +00001548if test "$vde" = "yes" ; then
1549 echo "CONFIG_VDE=yes" >> $config_mak
1550 echo "#define CONFIG_VDE 1" >> $config_h
1551 echo "VDE_LIBS=-lvdeplug" >> $config_mak
1552fi
malc0c58ac12008-06-25 21:04:05 +00001553for card in $audio_card_list; do
pbrookf6e58892008-06-29 01:00:34 +00001554 def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001555 echo "$def=yes" >> $config_mak
1556 echo "#define $def 1" >> $config_h
1557done
1558echo "#define AUDIO_DRIVERS \\" >> $config_h
1559for drv in $audio_drv_list; do
1560 echo " &${drv}_audio_driver, \\" >>$config_h
pbrookf6e58892008-06-29 01:00:34 +00001561 def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'`
malc0c58ac12008-06-25 21:04:05 +00001562 echo "$def=yes" >> $config_mak
malc923e4522008-07-02 18:13:46 +00001563 if test "$drv" = "fmod"; then
malc0c58ac12008-06-25 21:04:05 +00001564 echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak
1565 echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak
blueswir12f6a1ab2008-08-21 18:00:53 +00001566 elif test "$drv" = "oss"; then
1567 echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak
malc0c58ac12008-06-25 21:04:05 +00001568 fi
1569done
1570echo "" >>$config_h
malc8ff9cbf2008-06-23 18:33:30 +00001571if test "$mixemu" = "yes" ; then
1572 echo "CONFIG_MIXEMU=yes" >> $config_mak
1573 echo "#define CONFIG_MIXEMU 1" >> $config_h
1574fi
ths8d5d2d42007-08-25 01:37:51 +00001575if test "$vnc_tls" = "yes" ; then
1576 echo "CONFIG_VNC_TLS=yes" >> $config_mak
1577 echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak
1578 echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak
1579 echo "#define CONFIG_VNC_TLS 1" >> $config_h
1580fi
aliguori2f9606b2009-03-06 20:27:28 +00001581if test "$vnc_sasl" = "yes" ; then
1582 echo "CONFIG_VNC_SASL=yes" >> $config_mak
1583 echo "CONFIG_VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_mak
1584 echo "CONFIG_VNC_SASL_LIBS=$vnc_sasl_libs" >> $config_mak
1585 echo "#define CONFIG_VNC_SASL 1" >> $config_h
1586fi
aliguori76655d62009-03-06 20:27:37 +00001587if test "$fnmatch" = "yes" ; then
1588 echo "#define HAVE_FNMATCH_H 1" >> $config_h
1589fi
pbrookb1a550a2006-04-16 13:28:56 +00001590qemu_version=`head $source_path/VERSION`
1591echo "VERSION=$qemu_version" >>$config_mak
pbrookd4b8f032006-04-16 13:49:23 +00001592echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h
bellard97a847b2003-08-10 21:36:04 +00001593
pbrook4a19f1e2009-04-07 23:17:49 +00001594echo "#define QEMU_PKGVERSION \"$pkgversion\"" >> $config_h
1595
bellard97a847b2003-08-10 21:36:04 +00001596echo "SRC_PATH=$source_path" >> $config_mak
pbrookad064842006-04-16 12:41:07 +00001597if [ "$source_path_used" = "yes" ]; then
1598 echo "VPATH=$source_path" >> $config_mak
1599fi
bellard97a847b2003-08-10 21:36:04 +00001600echo "TARGET_DIRS=$target_list" >> $config_mak
pbrookcc8ae6d2006-04-23 17:57:59 +00001601if [ "$build_docs" = "yes" ] ; then
1602 echo "BUILD_DOCS=yes" >> $config_mak
1603fi
bellard49ecc3f2007-11-07 19:25:15 +00001604if test "$static" = "yes"; then
1605 sdl1=$sdl_static
1606else
1607 sdl1=$sdl
1608fi
1609if test "$sdl1" = "yes" ; then
1610 echo "#define CONFIG_SDL 1" >> $config_h
1611 echo "CONFIG_SDL=yes" >> $config_mak
1612 if test "$target_softmmu" = "no" -o "$static" = "yes"; then
1613 echo "SDL_LIBS=$sdl_static_libs" >> $config_mak
aliguori5368a422009-03-03 17:37:21 +00001614 elif test "$sdl_x11" = "yes" ; then
1615 echo "SDL_LIBS=`$sdl_config --libs` -lX11" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001616 else
1617 echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
1618 fi
1619 if [ "${aa}" = "yes" ] ; then
1620 echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak
1621 else
1622 echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
1623 fi
1624fi
1625if test "$cocoa" = "yes" ; then
balrog4d3b6f62008-02-10 16:33:14 +00001626 echo "#define CONFIG_COCOA 1" >> $config_h
1627 echo "CONFIG_COCOA=yes" >> $config_mak
1628fi
1629if test "$curses" = "yes" ; then
1630 echo "#define CONFIG_CURSES 1" >> $config_h
1631 echo "CONFIG_CURSES=yes" >> $config_mak
1632 echo "CURSES_LIBS=-lcurses" >> $config_mak
bellard49ecc3f2007-11-07 19:25:15 +00001633fi
aurel323b3f24a2009-04-15 16:12:13 +00001634if test "$atfile" = "yes" ; then
1635 echo "#define CONFIG_ATFILE 1" >> $config_h
1636fi
1637if test "$inotify" = "yes" ; then
1638 echo "#define CONFIG_INOTIFY 1" >> $config_h
1639fi
aurel322e4d9fb2008-04-08 06:01:02 +00001640if test "$brlapi" = "yes" ; then
1641 echo "CONFIG_BRLAPI=yes" >> $config_mak
1642 echo "#define CONFIG_BRLAPI 1" >> $config_h
1643 echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak
1644fi
balrogfb599c92008-09-28 23:49:55 +00001645if test "$bluez" = "yes" ; then
1646 echo "CONFIG_BLUEZ=yes" >> $config_mak
1647 echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak
1648 echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak
1649 echo "#define CONFIG_BLUEZ 1" >> $config_h
1650fi
aliguorie37630c2009-04-22 15:19:10 +00001651if test "$xen" = "yes" ; then
aliguori9306acb2009-04-22 15:19:44 +00001652 echo "XEN_LIBS=-lxenstore -lxenctrl -lxenguest" >> $config_mak
aliguorie37630c2009-04-22 15:19:10 +00001653fi
blueswir1414f0da2008-08-15 18:20:52 +00001654if test "$aio" = "yes" ; then
1655 echo "#define CONFIG_AIO 1" >> $config_h
aliguoria3392f92008-09-11 18:00:19 +00001656 echo "CONFIG_AIO=yes" >> $config_mak
blueswir1414f0da2008-08-15 18:20:52 +00001657fi
aliguorie5d355d2009-04-24 18:03:15 +00001658if test "$io_thread" = "yes" ; then
1659 echo "CONFIG_IOTHREAD=yes" >> $config_mak
1660 echo "#define CONFIG_IOTHREAD 1" >> $config_h
1661fi
ths77755342008-11-27 15:45:16 +00001662if test "$blobs" = "yes" ; then
1663 echo "INSTALL_BLOBS=yes" >> $config_mak
1664fi
aliguoribf9298b2008-12-05 20:05:26 +00001665if test "$iovec" = "yes" ; then
1666 echo "#define HAVE_IOVEC 1" >> $config_h
1667fi
aliguoriceb42de2009-04-07 18:43:28 +00001668if test "$preadv" = "yes" ; then
1669 echo "#define HAVE_PREADV 1" >> $config_h
1670fi
aurel32f652e6a2008-12-16 10:43:48 +00001671if test "$fdt" = "yes" ; then
1672 echo "#define HAVE_FDT 1" >> $config_h
1673 echo "FDT_LIBS=-lfdt" >> $config_mak
1674fi
bellard97a847b2003-08-10 21:36:04 +00001675
bellard83fb7ad2004-07-05 21:25:26 +00001676# XXX: suppress that
bellard7d3505c2004-05-12 19:32:15 +00001677if [ "$bsd" = "yes" ] ; then
bellard43003042004-05-20 13:23:39 +00001678 echo "#define O_LARGEFILE 0" >> $config_h
bellard43003042004-05-20 13:23:39 +00001679 echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
blueswir1179a2c12009-03-08 08:23:32 +00001680 echo "#define HOST_BSD 1" >> $config_h
bellard7d3505c2004-05-12 19:32:15 +00001681fi
1682
pbrookc5937222006-05-14 11:30:38 +00001683echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
1684
blueswir168063642008-11-22 21:03:55 +00001685# USB host support
1686case "$usb" in
1687linux)
1688 echo "HOST_USB=linux" >> $config_mak
1689;;
1690bsd)
1691 echo "HOST_USB=bsd" >> $config_mak
1692;;
1693*)
1694 echo "HOST_USB=stub" >> $config_mak
1695;;
1696esac
1697
pbrookc39e3332007-09-22 16:49:14 +00001698tools=
1699if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
aliguori3dd1f8e2009-04-05 19:29:26 +00001700 tools="qemu-img\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001701 if [ "$linux" = "yes" ] ; then
aliguori3dd1f8e2009-04-05 19:29:26 +00001702 tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools"
bellard7a5ca862008-05-27 21:13:40 +00001703 fi
pbrookc39e3332007-09-22 16:49:14 +00001704fi
1705echo "TOOLS=$tools" >> $config_mak
1706
ths15d9ca02007-07-31 23:07:32 +00001707test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
1708
bellard1d14ffa2005-10-30 18:58:22 +00001709for target in $target_list; do
bellard97a847b2003-08-10 21:36:04 +00001710target_dir="$target"
1711config_mak=$target_dir/config.mak
1712config_h=$target_dir/config.h
1713target_cpu=`echo $target | cut -d '-' -f 1`
1714target_bigendian="no"
bellard808c4952004-12-19 23:33:47 +00001715[ "$target_cpu" = "armeb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001716[ "$target_cpu" = "m68k" ] && target_bigendian=yes
1717[ "$target_cpu" = "mips" ] && target_bigendian=yes
1718[ "$target_cpu" = "mipsn32" ] && target_bigendian=yes
1719[ "$target_cpu" = "mips64" ] && target_bigendian=yes
bellard67867302003-11-23 17:05:30 +00001720[ "$target_cpu" = "ppc" ] && target_bigendian=yes
j_mayerd4082e92007-04-24 07:34:03 +00001721[ "$target_cpu" = "ppcemb" ] && target_bigendian=yes
j_mayer22f8a8b2007-10-14 08:38:29 +00001722[ "$target_cpu" = "ppc64" ] && target_bigendian=yes
j_mayere85e7c62007-10-18 19:59:49 +00001723[ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes
pbrook908f52b2006-06-18 19:16:53 +00001724[ "$target_cpu" = "sh4eb" ] && target_bigendian=yes
aurel320938cda2008-04-11 21:36:06 +00001725[ "$target_cpu" = "sparc" ] && target_bigendian=yes
1726[ "$target_cpu" = "sparc64" ] && target_bigendian=yes
1727[ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes
bellard97a847b2003-08-10 21:36:04 +00001728target_softmmu="no"
bellard997344f2003-10-27 21:10:39 +00001729target_user_only="no"
ths831b7822007-01-18 20:06:33 +00001730target_linux_user="no"
ths831b7822007-01-18 20:06:33 +00001731target_darwin_user="no"
blueswir184778502008-10-26 20:33:16 +00001732target_bsd_user="no"
pbrook9e407a82007-05-26 16:38:53 +00001733case "$target" in
1734 ${target_cpu}-softmmu)
1735 target_softmmu="yes"
1736 ;;
1737 ${target_cpu}-linux-user)
1738 target_user_only="yes"
1739 target_linux_user="yes"
1740 ;;
1741 ${target_cpu}-darwin-user)
1742 target_user_only="yes"
1743 target_darwin_user="yes"
1744 ;;
blueswir184778502008-10-26 20:33:16 +00001745 ${target_cpu}-bsd-user)
1746 target_user_only="yes"
1747 target_bsd_user="yes"
1748 ;;
pbrook9e407a82007-05-26 16:38:53 +00001749 *)
1750 echo "ERROR: Target '$target' not recognised"
1751 exit 1
1752 ;;
1753esac
ths831b7822007-01-18 20:06:33 +00001754
bellard97ccc682005-07-02 13:32:17 +00001755if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \
bellard1d14ffa2005-10-30 18:58:22 +00001756 -a "$sdl" = "no" -a "$cocoa" = "no" ; then
bellard97ccc682005-07-02 13:32:17 +00001757 echo "ERROR: QEMU requires SDL or Cocoa for graphical output"
pbrook9c038502006-04-16 15:19:15 +00001758 echo "To build QEMU without graphical output configure with --disable-gfx-check"
balrog4d3b6f62008-02-10 16:33:14 +00001759 echo "Note that this will disable all output from the virtual graphics card"
1760 echo "except through VNC or curses."
bellard97ccc682005-07-02 13:32:17 +00001761 exit 1;
1762fi
1763
bellard7c1f25b2004-04-22 00:02:08 +00001764#echo "Creating $config_mak, $config_h and $target_dir/Makefile"
bellard97a847b2003-08-10 21:36:04 +00001765
ths15d9ca02007-07-31 23:07:32 +00001766test -f $config_h && mv $config_h ${config_h}~
1767
bellard97a847b2003-08-10 21:36:04 +00001768mkdir -p $target_dir
bellard158142c2005-03-13 16:54:06 +00001769mkdir -p $target_dir/fpu
bellard57fec1f2008-02-01 10:50:11 +00001770mkdir -p $target_dir/tcg
blueswir184778502008-10-26 20:33:16 +00001771if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then
bellard69de9272004-02-16 21:40:43 +00001772 mkdir -p $target_dir/nwfpe
1773fi
1774
bellardec530c82006-04-25 22:36:06 +00001775#
1776# don't use ln -sf as not all "ln -sf" over write the file/link
1777#
1778rm -f $target_dir/Makefile
1779ln -s $source_path/Makefile.target $target_dir/Makefile
1780
bellard97a847b2003-08-10 21:36:04 +00001781
1782echo "# Automatically generated by configure - do not modify" > $config_mak
1783echo "/* Automatically generated by configure - do not modify */" > $config_h
1784
1785
1786echo "include ../config-host.mak" >> $config_mak
1787echo "#include \"../config-host.h\"" >> $config_h
bellard1e43adf2003-09-30 20:54:24 +00001788
pbrooke5fe0c52006-06-11 13:32:59 +00001789bflt="no"
blueswir1cb33da52007-10-09 16:34:29 +00001790elfload32="no"
pbrookbd0c5662008-05-29 14:34:11 +00001791target_nptl="no"
bellard1e43adf2003-09-30 20:54:24 +00001792interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"`
1793echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h
pbrook56aebc82008-10-11 17:55:29 +00001794gdb_xml_files=""
bellard97a847b2003-08-10 21:36:04 +00001795
aliguori5985ece2008-11-05 19:59:25 +00001796# Make sure the target and host cpus are compatible
1797if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
malcfdf7ed92009-01-14 18:39:52 +00001798 \( "$target_cpu" = "ppcemb" -a "$cpu" = "ppc" \) -o \
aliguori5985ece2008-11-05 19:59:25 +00001799 \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \
1800 \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then
aliguori7ba1e612008-11-05 16:04:33 +00001801 kvm="no"
1802fi
1803# Disable KVM for linux-user
1804if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then
1805 kvm="no"
1806fi
1807
aurel322408a522008-04-20 20:19:44 +00001808case "$target_cpu" in
1809 i386)
1810 echo "TARGET_ARCH=i386" >> $config_mak
1811 echo "#define TARGET_ARCH \"i386\"" >> $config_h
1812 echo "#define TARGET_I386 1" >> $config_h
bellardda260242008-05-30 20:48:25 +00001813 if test $kqemu = "yes" -a "$target_softmmu" = "yes"
aurel322408a522008-04-20 20:19:44 +00001814 then
blueswir12d6ebb02009-04-18 19:25:43 +00001815 echo "CONFIG_KQEMU=yes" >> $config_mak
blueswir1640f42e2009-04-19 10:18:01 +00001816 echo "#define CONFIG_KQEMU 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001817 fi
aliguori7ba1e612008-11-05 16:04:33 +00001818 if test "$kvm" = "yes" ; then
1819 echo "CONFIG_KVM=yes" >> $config_mak
1820 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
aliguori5985ece2008-11-05 19:59:25 +00001821 echo "#define CONFIG_KVM 1" >> $config_h
aliguori7ba1e612008-11-05 16:04:33 +00001822 fi
aliguorie37630c2009-04-22 15:19:10 +00001823 if test "$xen" = "yes" -a "$target_softmmu" = "yes";
1824 then
1825 echo "CONFIG_XEN=yes" >> $config_mak
1826 echo "#define CONFIG_XEN 1" >> $config_h
1827 fi
aurel322408a522008-04-20 20:19:44 +00001828 ;;
1829 x86_64)
1830 echo "TARGET_ARCH=x86_64" >> $config_mak
1831 echo "#define TARGET_ARCH \"x86_64\"" >> $config_h
1832 echo "#define TARGET_I386 1" >> $config_h
1833 echo "#define TARGET_X86_64 1" >> $config_h
1834 if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64"
1835 then
blueswir12d6ebb02009-04-18 19:25:43 +00001836 echo "CONFIG_KQEMU=yes" >> $config_mak
blueswir1640f42e2009-04-19 10:18:01 +00001837 echo "#define CONFIG_KQEMU 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001838 fi
aliguori7ba1e612008-11-05 16:04:33 +00001839 if test "$kvm" = "yes" ; then
1840 echo "CONFIG_KVM=yes" >> $config_mak
1841 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1842 echo "#define CONFIG_KVM 1" >> $config_h
1843 fi
aliguorie37630c2009-04-22 15:19:10 +00001844 if test "$xen" = "yes" -a "$target_softmmu" = "yes"
1845 then
1846 echo "CONFIG_XEN=yes" >> $config_mak
1847 echo "#define CONFIG_XEN 1" >> $config_h
1848 fi
aurel322408a522008-04-20 20:19:44 +00001849 ;;
1850 alpha)
1851 echo "TARGET_ARCH=alpha" >> $config_mak
1852 echo "#define TARGET_ARCH \"alpha\"" >> $config_h
1853 echo "#define TARGET_ALPHA 1" >> $config_h
1854 ;;
1855 arm|armeb)
1856 echo "TARGET_ARCH=arm" >> $config_mak
aurel322408a522008-04-20 20:19:44 +00001857 echo "#define TARGET_ARCH \"arm\"" >> $config_h
1858 echo "#define TARGET_ARM 1" >> $config_h
aurel322408a522008-04-20 20:19:44 +00001859 bflt="yes"
pbrookbd0c5662008-05-29 14:34:11 +00001860 target_nptl="yes"
pbrook56aebc82008-10-11 17:55:29 +00001861 gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml"
aurel322408a522008-04-20 20:19:44 +00001862 ;;
1863 cris)
1864 echo "TARGET_ARCH=cris" >> $config_mak
1865 echo "#define TARGET_ARCH \"cris\"" >> $config_h
1866 echo "#define TARGET_CRIS 1" >> $config_h
edgar_igl253bd7f2009-01-07 20:07:09 +00001867 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001868 ;;
1869 m68k)
1870 echo "TARGET_ARCH=m68k" >> $config_mak
1871 echo "#define TARGET_ARCH \"m68k\"" >> $config_h
1872 echo "#define TARGET_M68K 1" >> $config_h
1873 bflt="yes"
pbrook56aebc82008-10-11 17:55:29 +00001874 gdb_xml_files="cf-core.xml cf-fp.xml"
aurel322408a522008-04-20 20:19:44 +00001875 ;;
1876 mips|mipsel)
1877 echo "TARGET_ARCH=mips" >> $config_mak
1878 echo "#define TARGET_ARCH \"mips\"" >> $config_h
1879 echo "#define TARGET_MIPS 1" >> $config_h
1880 echo "#define TARGET_ABI_MIPSO32 1" >> $config_h
1881 ;;
1882 mipsn32|mipsn32el)
1883 echo "TARGET_ARCH=mipsn32" >> $config_mak
1884 echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h
1885 echo "#define TARGET_MIPS 1" >> $config_h
1886 echo "#define TARGET_ABI_MIPSN32 1" >> $config_h
1887 ;;
1888 mips64|mips64el)
1889 echo "TARGET_ARCH=mips64" >> $config_mak
1890 echo "#define TARGET_ARCH \"mips64\"" >> $config_h
1891 echo "#define TARGET_MIPS 1" >> $config_h
1892 echo "#define TARGET_MIPS64 1" >> $config_h
1893 echo "#define TARGET_ABI_MIPSN64 1" >> $config_h
1894 ;;
1895 ppc)
1896 echo "TARGET_ARCH=ppc" >> $config_mak
1897 echo "#define TARGET_ARCH \"ppc\"" >> $config_h
1898 echo "#define TARGET_PPC 1" >> $config_h
aurel32c8b35322009-01-24 15:07:34 +00001899 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
aurel322408a522008-04-20 20:19:44 +00001900 ;;
1901 ppcemb)
1902 echo "TARGET_ARCH=ppcemb" >> $config_mak
1903 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1904 echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h
1905 echo "#define TARGET_PPC 1" >> $config_h
1906 echo "#define TARGET_PPCEMB 1" >> $config_h
aurel32d76d1652008-12-16 10:43:58 +00001907 if test "$kvm" = "yes" ; then
1908 echo "CONFIG_KVM=yes" >> $config_mak
1909 echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
1910 echo "#define CONFIG_KVM 1" >> $config_h
1911 fi
aurel32c8b35322009-01-24 15:07:34 +00001912 gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
aurel322408a522008-04-20 20:19:44 +00001913 ;;
1914 ppc64)
1915 echo "TARGET_ARCH=ppc64" >> $config_mak
1916 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1917 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1918 echo "#define TARGET_PPC 1" >> $config_h
1919 echo "#define TARGET_PPC64 1" >> $config_h
aurel32c8b35322009-01-24 15:07:34 +00001920 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
aurel322408a522008-04-20 20:19:44 +00001921 ;;
1922 ppc64abi32)
1923 echo "TARGET_ARCH=ppc64" >> $config_mak
1924 echo "TARGET_ABI_DIR=ppc" >> $config_mak
1925 echo "TARGET_ARCH2=ppc64abi32" >> $config_mak
1926 echo "#define TARGET_ARCH \"ppc64\"" >> $config_h
1927 echo "#define TARGET_PPC 1" >> $config_h
1928 echo "#define TARGET_PPC64 1" >> $config_h
1929 echo "#define TARGET_ABI32 1" >> $config_h
aurel32c8b35322009-01-24 15:07:34 +00001930 gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
aurel322408a522008-04-20 20:19:44 +00001931 ;;
1932 sh4|sh4eb)
1933 echo "TARGET_ARCH=sh4" >> $config_mak
1934 echo "#define TARGET_ARCH \"sh4\"" >> $config_h
1935 echo "#define TARGET_SH4 1" >> $config_h
1936 bflt="yes"
aurel320b6d3ae2008-09-15 07:43:43 +00001937 target_nptl="yes"
aurel322408a522008-04-20 20:19:44 +00001938 ;;
1939 sparc)
1940 echo "TARGET_ARCH=sparc" >> $config_mak
1941 echo "#define TARGET_ARCH \"sparc\"" >> $config_h
1942 echo "#define TARGET_SPARC 1" >> $config_h
1943 ;;
1944 sparc64)
1945 echo "TARGET_ARCH=sparc64" >> $config_mak
1946 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1947 echo "#define TARGET_SPARC 1" >> $config_h
1948 echo "#define TARGET_SPARC64 1" >> $config_h
1949 elfload32="yes"
1950 ;;
1951 sparc32plus)
1952 echo "TARGET_ARCH=sparc64" >> $config_mak
1953 echo "TARGET_ABI_DIR=sparc" >> $config_mak
1954 echo "TARGET_ARCH2=sparc32plus" >> $config_mak
1955 echo "#define TARGET_ARCH \"sparc64\"" >> $config_h
1956 echo "#define TARGET_SPARC 1" >> $config_h
1957 echo "#define TARGET_SPARC64 1" >> $config_h
1958 echo "#define TARGET_ABI32 1" >> $config_h
1959 ;;
1960 *)
1961 echo "Unsupported target CPU"
1962 exit 1
1963 ;;
1964esac
bellardde83cd02003-06-15 20:25:43 +00001965if test "$target_bigendian" = "yes" ; then
bellard97a847b2003-08-10 21:36:04 +00001966 echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak
1967 echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h
1968fi
1969if test "$target_softmmu" = "yes" ; then
1970 echo "CONFIG_SOFTMMU=yes" >> $config_mak
1971 echo "#define CONFIG_SOFTMMU 1" >> $config_h
bellardde83cd02003-06-15 20:25:43 +00001972fi
bellard997344f2003-10-27 21:10:39 +00001973if test "$target_user_only" = "yes" ; then
1974 echo "CONFIG_USER_ONLY=yes" >> $config_mak
1975 echo "#define CONFIG_USER_ONLY 1" >> $config_h
1976fi
ths831b7822007-01-18 20:06:33 +00001977if test "$target_linux_user" = "yes" ; then
1978 echo "CONFIG_LINUX_USER=yes" >> $config_mak
1979 echo "#define CONFIG_LINUX_USER 1" >> $config_h
1980fi
1981if test "$target_darwin_user" = "yes" ; then
1982 echo "CONFIG_DARWIN_USER=yes" >> $config_mak
1983 echo "#define CONFIG_DARWIN_USER 1" >> $config_h
1984fi
pbrook56aebc82008-10-11 17:55:29 +00001985list=""
1986if test ! -z "$gdb_xml_files" ; then
1987 for x in $gdb_xml_files; do
1988 list="$list $source_path/gdb-xml/$x"
1989 done
1990fi
1991echo "TARGET_XML_FILES=$list" >> $config_mak
bellardde83cd02003-06-15 20:25:43 +00001992
aurel320938cda2008-04-11 21:36:06 +00001993if test "$target_cpu" = "arm" \
1994 -o "$target_cpu" = "armeb" \
1995 -o "$target_cpu" = "m68k" \
1996 -o "$target_cpu" = "mips" \
1997 -o "$target_cpu" = "mipsel" \
1998 -o "$target_cpu" = "mipsn32" \
1999 -o "$target_cpu" = "mipsn32el" \
2000 -o "$target_cpu" = "mips64" \
2001 -o "$target_cpu" = "mips64el" \
aurel323147d1e2008-12-15 06:34:37 +00002002 -o "$target_cpu" = "ppc" \
2003 -o "$target_cpu" = "ppc64" \
aurel3271e991f2008-12-15 17:13:19 +00002004 -o "$target_cpu" = "ppc64abi32" \
2005 -o "$target_cpu" = "ppcemb" \
aurel320938cda2008-04-11 21:36:06 +00002006 -o "$target_cpu" = "sparc" \
2007 -o "$target_cpu" = "sparc64" \
2008 -o "$target_cpu" = "sparc32plus"; then
bellard158142c2005-03-13 16:54:06 +00002009 echo "CONFIG_SOFTFLOAT=yes" >> $config_mak
2010 echo "#define CONFIG_SOFTFLOAT 1" >> $config_h
2011fi
pbrooke5fe0c52006-06-11 13:32:59 +00002012if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then
2013 echo "TARGET_HAS_BFLT=yes" >> $config_mak
2014 echo "#define TARGET_HAS_BFLT 1" >> $config_h
2015fi
pbrookbd0c5662008-05-29 14:34:11 +00002016if test "$target_user_only" = "yes" \
2017 -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then
2018 echo "#define USE_NPTL 1" >> $config_h
2019fi
blueswir1cb33da52007-10-09 16:34:29 +00002020# 32 bit ELF loader in addition to native 64 bit loader?
2021if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then
2022 echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak
2023 echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h
2024fi
blueswir184778502008-10-26 20:33:16 +00002025if test "$target_bsd_user" = "yes" ; then
2026 echo "CONFIG_BSD_USER=yes" >> $config_mak
2027 echo "#define CONFIG_BSD_USER 1" >> $config_h
2028fi
bellard5b0753e2005-03-01 21:37:28 +00002029
ths15d9ca02007-07-31 23:07:32 +00002030test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h
2031
bellard97a847b2003-08-10 21:36:04 +00002032done # for target in $targets
bellard7d132992003-03-06 23:23:54 +00002033
2034# build tree in object directory if source path is different from current one
2035if test "$source_path_used" = "yes" ; then
bellard49ecc3f2007-11-07 19:25:15 +00002036 DIRS="tests tests/cris slirp audio"
bellard7d132992003-03-06 23:23:54 +00002037 FILES="Makefile tests/Makefile"
thse7daa602007-10-08 13:38:27 +00002038 FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
edgar_igle1ffb0f2008-03-01 22:23:17 +00002039 FILES="$FILES tests/test-mmap.c"
bellard7d132992003-03-06 23:23:54 +00002040 for dir in $DIRS ; do
2041 mkdir -p $dir
2042 done
bellardec530c82006-04-25 22:36:06 +00002043 # remove the link and recreate it, as not all "ln -sf" overwrite the link
bellard7d132992003-03-06 23:23:54 +00002044 for f in $FILES ; do
bellardec530c82006-04-25 22:36:06 +00002045 rm -f $f
2046 ln -s $source_path/$f $f
bellard7d132992003-03-06 23:23:54 +00002047 done
2048fi