bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 3 | # qemu configure script (c) 2003 Fabrice Bellard |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 4 | # |
| 5 | # set temporary file name |
| 6 | if test ! -z "$TMPDIR" ; then |
| 7 | TMPDIR1="${TMPDIR}" |
| 8 | elif test ! -z "$TEMPDIR" ; then |
| 9 | TMPDIR1="${TEMPDIR}" |
| 10 | else |
| 11 | TMPDIR1="/tmp" |
| 12 | fi |
| 13 | |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 14 | TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" |
| 15 | TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" |
| 16 | TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}" |
| 17 | TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" |
malc | 9d56d2d | 2008-09-30 19:44:32 +0000 | [diff] [blame] | 18 | TMPI="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.i" |
malc | d4742de | 2008-11-29 22:04:31 +0000 | [diff] [blame] | 19 | TMPSDLLOG="${TMPDIR1}/qemu-conf-sdl-$$-${RANDOM}.log" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 20 | |
malc | d4742de | 2008-11-29 22:04:31 +0000 | [diff] [blame] | 21 | trap "rm -f $TMPC $TMPO $TMPE $TMPS $TMPI $TMPSDLLOG; exit" 0 2 3 15 |
malc | 9ac81bb | 2008-11-29 20:09:56 +0000 | [diff] [blame] | 22 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 23 | # default parameters |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 24 | prefix="" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 25 | interp_prefix="/usr/gnemul/qemu-%M" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 26 | static="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 27 | cross_prefix="" |
| 28 | cc="gcc" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 29 | audio_drv_list="" |
| 30 | audio_card_list="" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 31 | host_cc="gcc" |
| 32 | ar="ar" |
| 33 | make="make" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 34 | install="install" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 35 | strip="strip" |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 36 | cpu=`test $(uname -s) = AIX && uname -p || uname -m` |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 37 | target_list="" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 38 | case "$cpu" in |
| 39 | i386|i486|i586|i686|i86pc|BePC) |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 40 | cpu="i386" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 41 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 42 | x86_64|amd64) |
| 43 | cpu="x86_64" |
| 44 | ;; |
| 45 | alpha) |
| 46 | cpu="alpha" |
| 47 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 48 | armv*b) |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 49 | cpu="armv4b" |
| 50 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 51 | armv*l) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 52 | cpu="armv4l" |
| 53 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 54 | cris) |
| 55 | cpu="cris" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 56 | ;; |
aurel32 | f54b3f9 | 2008-04-12 20:14:54 +0000 | [diff] [blame] | 57 | parisc|parisc64) |
| 58 | cpu="hppa" |
| 59 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 60 | ia64) |
| 61 | cpu="ia64" |
| 62 | ;; |
| 63 | m68k) |
| 64 | cpu="m68k" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 65 | ;; |
| 66 | mips) |
| 67 | cpu="mips" |
| 68 | ;; |
ths | fbe4f65 | 2007-04-01 11:16:48 +0000 | [diff] [blame] | 69 | mips64) |
| 70 | cpu="mips64" |
| 71 | ;; |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 72 | "Power Macintosh"|ppc|ppc64|powerpc) |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 73 | cpu="powerpc" |
ths | e7daa60 | 2007-10-08 13:38:27 +0000 | [diff] [blame] | 74 | ;; |
ths | 0e7b8a9 | 2007-08-01 00:09:31 +0000 | [diff] [blame] | 75 | s390*) |
bellard | fb3e584 | 2003-03-29 17:32:36 +0000 | [diff] [blame] | 76 | cpu="s390" |
| 77 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 78 | sparc|sun4[cdmuv]) |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 79 | cpu="sparc" |
| 80 | ;; |
| 81 | sparc64) |
| 82 | cpu="sparc64" |
| 83 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 84 | *) |
| 85 | cpu="unknown" |
| 86 | ;; |
| 87 | esac |
| 88 | gprof="no" |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 89 | sparse="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 90 | bigendian="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 91 | mingw32="no" |
| 92 | EXESUF="" |
| 93 | gdbstub="yes" |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 94 | slirp="yes" |
aliguori | e0e6c8c0 | 2008-07-23 18:14:33 +0000 | [diff] [blame] | 95 | vde="yes" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 96 | fmod_lib="" |
| 97 | fmod_inc="" |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 98 | oss_lib="" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 99 | vnc_tls="yes" |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 100 | bsd="no" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 101 | linux="no" |
blueswir1 | d2c7c9b | 2008-11-01 14:50:20 +0000 | [diff] [blame] | 102 | solaris="no" |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 103 | kqemu="no" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 104 | profiler="no" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 105 | cocoa="no" |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 106 | check_gfx="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 107 | softmmu="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 108 | linux_user="no" |
| 109 | darwin_user="no" |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 110 | bsd_user="no" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 111 | build_docs="no" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 112 | uname_release="" |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 113 | curses="yes" |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 114 | aio="yes" |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 115 | nptl="yes" |
malc | 8ff9cbf | 2008-06-23 18:33:30 +0000 | [diff] [blame] | 116 | mixemu="no" |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 117 | bluez="yes" |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 118 | kvm="yes" |
aliguori | eac3026 | 2008-11-05 16:28:56 +0000 | [diff] [blame] | 119 | kerneldir="" |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 120 | aix="no" |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 121 | blobs="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 122 | |
| 123 | # OS specific |
| 124 | targetos=`uname -s` |
| 125 | case $targetos in |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 126 | CYGWIN*) |
| 127 | mingw32="yes" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 128 | OS_CFLAGS="-mno-cygwin" |
ths | db8d7dd | 2007-07-12 09:29:18 +0000 | [diff] [blame] | 129 | if [ "$cpu" = "i386" ] ; then |
| 130 | kqemu="yes" |
| 131 | fi |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 132 | audio_possible_drivers="sdl" |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 133 | ;; |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 134 | MINGW32*) |
| 135 | mingw32="yes" |
ths | db8d7dd | 2007-07-12 09:29:18 +0000 | [diff] [blame] | 136 | if [ "$cpu" = "i386" ] ; then |
| 137 | kqemu="yes" |
| 138 | fi |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 139 | audio_possible_drivers="dsound sdl fmod" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 140 | ;; |
ths | 5c40d2b | 2007-06-23 16:03:36 +0000 | [diff] [blame] | 141 | GNU/kFreeBSD) |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 142 | audio_drv_list="oss" |
aurel32 | f34af52 | 2008-08-21 23:03:15 +0000 | [diff] [blame] | 143 | audio_possible_drivers="oss sdl esd pa" |
ths | 5c40d2b | 2007-06-23 16:03:36 +0000 | [diff] [blame] | 144 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 145 | kqemu="yes" |
| 146 | fi |
| 147 | ;; |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 148 | FreeBSD) |
| 149 | bsd="yes" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 150 | audio_drv_list="oss" |
aurel32 | f34af52 | 2008-08-21 23:03:15 +0000 | [diff] [blame] | 151 | audio_possible_drivers="oss sdl esd pa" |
bellard | e99f906 | 2005-07-28 21:45:38 +0000 | [diff] [blame] | 152 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 153 | kqemu="yes" |
| 154 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 155 | ;; |
| 156 | NetBSD) |
| 157 | bsd="yes" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 158 | audio_drv_list="oss" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 159 | audio_possible_drivers="oss sdl esd" |
blueswir1 | 8ef92a8 | 2008-11-22 20:24:29 +0000 | [diff] [blame] | 160 | oss_lib="-lossaudio" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 161 | ;; |
| 162 | OpenBSD) |
| 163 | bsd="yes" |
blueswir1 | 128ab2f | 2008-08-15 18:33:42 +0000 | [diff] [blame] | 164 | openbsd="yes" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 165 | audio_drv_list="oss" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 166 | audio_possible_drivers="oss sdl esd" |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 167 | oss_lib="-lossaudio" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 168 | ;; |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 169 | Darwin) |
| 170 | bsd="yes" |
| 171 | darwin="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 172 | darwin_user="yes" |
ths | fd67764 | 2007-01-31 12:10:07 +0000 | [diff] [blame] | 173 | cocoa="yes" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 174 | audio_drv_list="coreaudio" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 175 | audio_possible_drivers="coreaudio sdl fmod" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 176 | OS_CFLAGS="-mdynamic-no-pic" |
ths | c2c59c3 | 2008-01-08 00:00:20 +0000 | [diff] [blame] | 177 | OS_LDFLAGS="-framework CoreFoundation -framework IOKit" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 178 | ;; |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 179 | SunOS) |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 180 | solaris="yes" |
| 181 | make="gmake" |
| 182 | install="ginstall" |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 183 | needs_libsunmath="no" |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 184 | solarisrev=`uname -r | cut -f2 -d.` |
ths | ef18c88 | 2007-09-16 22:12:39 +0000 | [diff] [blame] | 185 | # have to select again, because `uname -m` returns i86pc |
| 186 | # even on an x86_64 box. |
| 187 | solariscpu=`isainfo -k` |
| 188 | if test "${solariscpu}" = "amd64" ; then |
| 189 | cpu="x86_64" |
| 190 | fi |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 191 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 192 | if test "$solarisrev" -le 9 ; then |
| 193 | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then |
| 194 | needs_libsunmath="yes" |
| 195 | else |
| 196 | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" |
| 197 | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" |
| 198 | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" |
| 199 | echo "Studio 11 can be downloaded from www.sun.com." |
| 200 | exit 1 |
| 201 | fi |
| 202 | fi |
| 203 | if test "$solarisrev" -ge 9 ; then |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 204 | kqemu="yes" |
| 205 | fi |
ths | 86b2bd9 | 2007-02-11 00:31:33 +0000 | [diff] [blame] | 206 | fi |
ths | 6b4d2ba | 2007-05-13 18:02:43 +0000 | [diff] [blame] | 207 | if test -f /usr/include/sys/soundcard.h ; then |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 208 | audio_drv_list="oss" |
ths | 6b4d2ba | 2007-05-13 18:02:43 +0000 | [diff] [blame] | 209 | fi |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 210 | audio_possible_drivers="oss sdl" |
ths | 86b2bd9 | 2007-02-11 00:31:33 +0000 | [diff] [blame] | 211 | ;; |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 212 | AIX) |
| 213 | aix="yes" |
| 214 | make="gmake" |
| 215 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 216 | *) |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 217 | audio_drv_list="oss" |
malc | b8e59f1 | 2008-07-02 21:03:08 +0000 | [diff] [blame] | 218 | audio_possible_drivers="oss alsa sdl esd pa" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 219 | linux="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 220 | linux_user="yes" |
blueswir1 | 6806364 | 2008-11-22 21:03:55 +0000 | [diff] [blame] | 221 | usb="linux" |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 222 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 223 | kqemu="yes" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 224 | audio_possible_drivers="$audio_possible_drivers fmod" |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 225 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 226 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 227 | esac |
| 228 | |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 229 | if [ "$bsd" = "yes" ] ; then |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 230 | if [ "$darwin" != "yes" ] ; then |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 231 | make="gmake" |
blueswir1 | 6806364 | 2008-11-22 21:03:55 +0000 | [diff] [blame] | 232 | usb="bsd" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 233 | fi |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 234 | bsd_user="yes" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 235 | fi |
| 236 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 237 | # find source path |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 238 | source_path=`dirname "$0"` |
balrog | 59faef3 | 2008-02-03 04:22:24 +0000 | [diff] [blame] | 239 | source_path_used="no" |
| 240 | workdir=`pwd` |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 241 | if [ -z "$source_path" ]; then |
balrog | 59faef3 | 2008-02-03 04:22:24 +0000 | [diff] [blame] | 242 | source_path=$workdir |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 243 | else |
| 244 | source_path=`cd "$source_path"; pwd` |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 245 | fi |
pbrook | 724db11 | 2008-02-03 19:20:13 +0000 | [diff] [blame] | 246 | [ -f "$workdir/vl.c" ] || source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 247 | |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 248 | werror="no" |
bellard | 0d1e239 | 2007-11-11 20:24:30 +0000 | [diff] [blame] | 249 | # generate compile errors on warnings for development builds |
| 250 | #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then |
| 251 | #werror="yes"; |
| 252 | #fi |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 253 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 254 | for opt do |
pbrook | a46e403 | 2006-04-29 23:05:22 +0000 | [diff] [blame] | 255 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 256 | case "$opt" in |
bellard | 2efc326 | 2005-12-18 19:14:49 +0000 | [diff] [blame] | 257 | --help|-h) show_help=yes |
| 258 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 259 | --prefix=*) prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 260 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 261 | --interp-prefix=*) interp_prefix="$optarg" |
bellard | 32ce633 | 2003-04-11 00:16:16 +0000 | [diff] [blame] | 262 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 263 | --source-path=*) source_path="$optarg" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 264 | source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 265 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 266 | --cross-prefix=*) cross_prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 267 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 268 | --cc=*) cc="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 269 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 270 | --host-cc=*) host_cc="$optarg" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 271 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 272 | --make=*) make="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 273 | ;; |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 274 | --install=*) install="$optarg" |
| 275 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 276 | --extra-cflags=*) CFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 277 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 278 | --extra-ldflags=*) LDFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 279 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 280 | --cpu=*) cpu="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 281 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 282 | --target-list=*) target_list="$optarg" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 283 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 284 | --enable-gprof) gprof="yes" |
| 285 | ;; |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 286 | --static) static="yes" |
| 287 | ;; |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 288 | --disable-sdl) sdl="no" |
| 289 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 290 | --fmod-lib=*) fmod_lib="$optarg" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 291 | ;; |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 292 | --fmod-inc=*) fmod_inc="$optarg" |
| 293 | ;; |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 294 | --oss-lib=*) oss_lib="$optarg" |
| 295 | ;; |
malc | 2fa7d3b | 2008-07-29 12:58:44 +0000 | [diff] [blame] | 296 | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 297 | ;; |
| 298 | --audio-drv-list=*) audio_drv_list="$optarg" |
| 299 | ;; |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 300 | --enable-sparse) sparse="yes" |
| 301 | ;; |
| 302 | --disable-sparse) sparse="no" |
| 303 | ;; |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 304 | --disable-vnc-tls) vnc_tls="no" |
| 305 | ;; |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 306 | --disable-slirp) slirp="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 307 | ;; |
aliguori | e0e6c8c0 | 2008-07-23 18:14:33 +0000 | [diff] [blame] | 308 | --disable-vde) vde="no" |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 309 | ;; |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 310 | --disable-kqemu) kqemu="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 311 | ;; |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 312 | --disable-brlapi) brlapi="no" |
| 313 | ;; |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 314 | --disable-bluez) bluez="no" |
| 315 | ;; |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 316 | --disable-kvm) kvm="no" |
| 317 | ;; |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 318 | --enable-profiler) profiler="yes" |
| 319 | ;; |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 320 | --enable-cocoa) |
| 321 | cocoa="yes" ; |
| 322 | sdl="no" ; |
| 323 | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 324 | ;; |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 325 | --disable-gfx-check) check_gfx="no" |
| 326 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 327 | --disable-system) softmmu="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 328 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 329 | --enable-system) softmmu="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 330 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 331 | --disable-linux-user) linux_user="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 332 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 333 | --enable-linux-user) linux_user="yes" |
| 334 | ;; |
| 335 | --disable-darwin-user) darwin_user="no" |
| 336 | ;; |
| 337 | --enable-darwin-user) darwin_user="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 338 | ;; |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 339 | --disable-bsd-user) bsd_user="no" |
| 340 | ;; |
| 341 | --enable-bsd-user) bsd_user="yes" |
| 342 | ;; |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 343 | --enable-uname-release=*) uname_release="$optarg" |
| 344 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 345 | --sparc_cpu=*) |
| 346 | sparc_cpu="$optarg" |
| 347 | case $sparc_cpu in |
| 348 | v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
| 349 | target_cpu="sparc"; cpu="sparc" ;; |
| 350 | v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
| 351 | target_cpu="sparc"; cpu="sparc" ;; |
| 352 | v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64" |
| 353 | target_cpu="sparc64"; cpu="sparc64" ;; |
| 354 | *) echo "undefined SPARC architecture. Exiting";exit 1;; |
| 355 | esac |
| 356 | ;; |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 357 | --enable-werror) werror="yes" |
| 358 | ;; |
| 359 | --disable-werror) werror="no" |
| 360 | ;; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 361 | --disable-curses) curses="no" |
| 362 | ;; |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 363 | --disable-nptl) nptl="no" |
| 364 | ;; |
malc | 8ff9cbf | 2008-06-23 18:33:30 +0000 | [diff] [blame] | 365 | --enable-mixemu) mixemu="yes" |
| 366 | ;; |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 367 | --disable-aio) aio="no" |
| 368 | ;; |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 369 | --disable-blobs) blobs="no" |
| 370 | ;; |
aliguori | eac3026 | 2008-11-05 16:28:56 +0000 | [diff] [blame] | 371 | --kerneldir=*) kerneldir="$optarg" |
| 372 | ;; |
balrog | 7f1559c | 2007-11-17 10:24:32 +0000 | [diff] [blame] | 373 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
| 374 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 375 | esac |
| 376 | done |
| 377 | |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 378 | # default flags for all hosts |
blueswir1 | ac41a62 | 2008-09-14 06:46:31 +0000 | [diff] [blame] | 379 | CFLAGS="$CFLAGS -O2 -g -fno-strict-aliasing" |
blueswir1 | e0e36fe | 2008-12-07 19:16:27 +0000 | [diff] [blame] | 380 | CFLAGS="$CFLAGS -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 381 | LDFLAGS="$LDFLAGS -g" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 382 | if test "$werror" = "yes" ; then |
| 383 | CFLAGS="$CFLAGS -Werror" |
| 384 | fi |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 385 | |
blueswir1 | d2c7c9b | 2008-11-01 14:50:20 +0000 | [diff] [blame] | 386 | if test "$solaris" = "no" ; then |
| 387 | if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then |
| 388 | LDFLAGS="$LDFLAGS -Wl,--warn-common" |
| 389 | fi |
blueswir1 | 49237ac | 2008-09-17 19:05:19 +0000 | [diff] [blame] | 390 | fi |
| 391 | |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 392 | # |
| 393 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
| 394 | # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
| 395 | # |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 396 | case "$cpu" in |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 397 | sparc) if test -z "$sparc_cpu" ; then |
| 398 | ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__" |
| 399 | ARCH_LDFLAGS="-m32" |
| 400 | else |
| 401 | ARCH_CFLAGS="${SP_CFLAGS}" |
| 402 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
| 403 | fi |
| 404 | ;; |
| 405 | sparc64) if test -z "$sparc_cpu" ; then |
| 406 | ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__" |
| 407 | ARCH_LDFLAGS="-m64" |
| 408 | else |
| 409 | ARCH_CFLAGS="${SP_CFLAGS}" |
| 410 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
| 411 | fi |
| 412 | ;; |
ths | 76d83bd | 2007-11-18 21:22:10 +0000 | [diff] [blame] | 413 | s390) |
| 414 | ARCH_CFLAGS="-march=z900" |
| 415 | ;; |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 416 | i386) |
| 417 | ARCH_CFLAGS="-m32" |
| 418 | ARCH_LDFLAGS="-m32" |
| 419 | ;; |
| 420 | x86_64) |
| 421 | ARCH_CFLAGS="-m64" |
| 422 | ARCH_LDFLAGS="-m64" |
| 423 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 424 | esac |
| 425 | |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 426 | if test x"$show_help" = x"yes" ; then |
| 427 | cat << EOF |
| 428 | |
| 429 | Usage: configure [options] |
| 430 | Options: [defaults in brackets after descriptions] |
| 431 | |
| 432 | EOF |
| 433 | echo "Standard options:" |
| 434 | echo " --help print this message" |
| 435 | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
| 436 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
| 437 | echo " use %M for cpu name [$interp_prefix]" |
| 438 | echo " --target-list=LIST set target list [$target_list]" |
| 439 | echo "" |
| 440 | echo "kqemu kernel acceleration support:" |
| 441 | echo " --disable-kqemu disable kqemu support" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 442 | echo "" |
| 443 | echo "Advanced options (experts only):" |
| 444 | echo " --source-path=PATH path of source code [$source_path]" |
| 445 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
| 446 | echo " --cc=CC use C compiler CC [$cc]" |
| 447 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
| 448 | echo " --make=MAKE use specified make [$make]" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 449 | echo " --install=INSTALL use specified install [$install]" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 450 | echo " --static enable static build [$static]" |
aliguori | 890b165 | 2008-10-07 21:22:41 +0000 | [diff] [blame] | 451 | echo " --enable-sparse enable sparse checker" |
| 452 | echo " --disable-sparse disable sparse checker (default)" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 453 | echo " --disable-werror disable compilation abort on warning" |
balrog | fe8f78e | 2007-10-31 01:03:28 +0000 | [diff] [blame] | 454 | echo " --disable-sdl disable SDL" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 455 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 456 | echo " --audio-drv-list=LIST set audio drivers list:" |
| 457 | echo " Available drivers: $audio_possible_drivers" |
| 458 | echo " --audio-card-list=LIST set list of additional emulated audio cards" |
| 459 | echo " Available cards: ac97 adlib cs4231a gus" |
malc | 8ff9cbf | 2008-06-23 18:33:30 +0000 | [diff] [blame] | 460 | echo " --enable-mixemu enable mixer emulation" |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 461 | echo " --disable-brlapi disable BrlAPI" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 462 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
pbrook | af896aa | 2008-03-23 00:47:42 +0000 | [diff] [blame] | 463 | echo " --disable-curses disable curses output" |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 464 | echo " --disable-bluez disable bluez stack connectivity" |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 465 | echo " --disable-kvm disable KVM acceleration support" |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 466 | echo " --disable-nptl disable usermode NPTL support" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 467 | echo " --enable-system enable all system emulation targets" |
| 468 | echo " --disable-system disable all system emulation targets" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 469 | echo " --enable-linux-user enable all linux usermode emulation targets" |
| 470 | echo " --disable-linux-user disable all linux usermode emulation targets" |
| 471 | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
| 472 | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 473 | echo " --enable-bsd-user enable all BSD usermode emulation targets" |
| 474 | echo " --disable-bsd-user disable all BSD usermode emulation targets" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 475 | echo " --fmod-lib path to FMOD library" |
| 476 | echo " --fmod-inc path to FMOD includes" |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 477 | echo " --oss-lib path to OSS library" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 478 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 479 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
aliguori | e0e6c8c0 | 2008-07-23 18:14:33 +0000 | [diff] [blame] | 480 | echo " --disable-vde disable support for vde network" |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 481 | echo " --disable-aio disable AIO support" |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 482 | echo " --disable-blobs disable installing provided firmware blobs" |
aliguori | eac3026 | 2008-11-05 16:28:56 +0000 | [diff] [blame] | 483 | echo " --kerneldir=PATH look for kernel includes in PATH" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 484 | echo "" |
ths | 5bf0893 | 2006-12-23 00:33:26 +0000 | [diff] [blame] | 485 | echo "NOTE: The object files are built at the place where configure is launched" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 486 | exit 1 |
| 487 | fi |
| 488 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 489 | cc="${cross_prefix}${cc}" |
| 490 | ar="${cross_prefix}${ar}" |
| 491 | strip="${cross_prefix}${strip}" |
| 492 | |
pbrook | 064aae1 | 2006-05-08 00:51:44 +0000 | [diff] [blame] | 493 | # check that the C compiler works. |
| 494 | cat > $TMPC <<EOF |
| 495 | int main(void) {} |
| 496 | EOF |
| 497 | |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 498 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then |
pbrook | 064aae1 | 2006-05-08 00:51:44 +0000 | [diff] [blame] | 499 | : C compiler works ok |
| 500 | else |
| 501 | echo "ERROR: \"$cc\" either does not exist or does not work" |
| 502 | exit 1 |
bellard | a7350fa | 2006-04-23 14:35:23 +0000 | [diff] [blame] | 503 | fi |
| 504 | |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 505 | # check compiler to see if we're on mingw32 |
| 506 | cat > $TMPC <<EOF |
| 507 | #include <windows.h> |
| 508 | #ifndef _WIN32 |
| 509 | #error not windows |
| 510 | #endif |
| 511 | int main(void) {} |
| 512 | EOF |
| 513 | |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 514 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null ; then |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 515 | mingw32="yes" |
| 516 | fi |
| 517 | |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 518 | if test "$mingw32" = "yes" ; then |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 519 | linux="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 520 | EXESUF=".exe" |
bellard | 9f059ec | 2004-11-14 18:59:52 +0000 | [diff] [blame] | 521 | oss="no" |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 522 | linux_user="no" |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 523 | bsd_user="no" |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 524 | fi |
| 525 | |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 526 | if test ! -x "$(which cgcc 2>/dev/null)"; then |
| 527 | sparse="no" |
| 528 | fi |
| 529 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 530 | # |
| 531 | # Solaris specific configure tool chain decisions |
| 532 | # |
| 533 | if test "$solaris" = "yes" ; then |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 534 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
| 535 | if test -z "$solinst" ; then |
| 536 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
| 537 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
| 538 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
| 539 | exit 1 |
| 540 | fi |
| 541 | if test "$solinst" = "/usr/sbin/install" ; then |
| 542 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
| 543 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
| 544 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
| 545 | exit 1 |
| 546 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 547 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
| 548 | if test -z "$sol_ar" ; then |
| 549 | echo "Error: No path includes ar" |
| 550 | if test -f /usr/ccs/bin/ar ; then |
| 551 | echo "Add /usr/ccs/bin to your path and rerun configure" |
| 552 | fi |
| 553 | exit 1 |
| 554 | fi |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 555 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 556 | |
| 557 | |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 558 | if test -z "$target_list" ; then |
| 559 | # these targets are portable |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 560 | if [ "$softmmu" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 561 | target_list="\ |
| 562 | i386-softmmu \ |
| 563 | x86_64-softmmu \ |
| 564 | arm-softmmu \ |
| 565 | cris-softmmu \ |
| 566 | m68k-softmmu \ |
| 567 | mips-softmmu \ |
| 568 | mipsel-softmmu \ |
| 569 | mips64-softmmu \ |
| 570 | mips64el-softmmu \ |
| 571 | ppc-softmmu \ |
| 572 | ppcemb-softmmu \ |
| 573 | ppc64-softmmu \ |
| 574 | sh4-softmmu \ |
| 575 | sh4eb-softmmu \ |
| 576 | sparc-softmmu \ |
| 577 | " |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 578 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 579 | # the following are Linux specific |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 580 | if [ "$linux_user" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 581 | target_list="${target_list}\ |
| 582 | i386-linux-user \ |
| 583 | x86_64-linux-user \ |
| 584 | alpha-linux-user \ |
| 585 | arm-linux-user \ |
| 586 | armeb-linux-user \ |
| 587 | cris-linux-user \ |
| 588 | m68k-linux-user \ |
| 589 | mips-linux-user \ |
| 590 | mipsel-linux-user \ |
| 591 | ppc-linux-user \ |
| 592 | ppc64-linux-user \ |
| 593 | ppc64abi32-linux-user \ |
| 594 | sh4-linux-user \ |
| 595 | sh4eb-linux-user \ |
| 596 | sparc-linux-user \ |
| 597 | sparc64-linux-user \ |
| 598 | sparc32plus-linux-user \ |
| 599 | " |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 600 | fi |
| 601 | # the following are Darwin specific |
| 602 | if [ "$darwin_user" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 603 | target_list="$target_list i386-darwin-user ppc-darwin-user" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 604 | fi |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 605 | # the following are BSD specific |
| 606 | if [ "$bsd_user" = "yes" ] ; then |
| 607 | target_list="${target_list}\ |
| 608 | sparc64-bsd-user \ |
| 609 | " |
| 610 | fi |
bellard | 6e20a45 | 2005-06-05 15:56:02 +0000 | [diff] [blame] | 611 | else |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 612 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 613 | fi |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 614 | if test -z "$target_list" ; then |
| 615 | echo "No targets enabled" |
| 616 | exit 1 |
| 617 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 618 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 619 | if test -z "$cross_prefix" ; then |
| 620 | |
| 621 | # --- |
| 622 | # big/little endian test |
| 623 | cat > $TMPC << EOF |
| 624 | #include <inttypes.h> |
| 625 | int main(int argc, char ** argv){ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 626 | volatile uint32_t i=0x01234567; |
| 627 | return (*((uint8_t*)(&i))) == 0x67; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 628 | } |
| 629 | EOF |
| 630 | |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 631 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC > /dev/null 2> /dev/null ; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 632 | $TMPE && bigendian="yes" |
| 633 | else |
| 634 | echo big/little test failed |
| 635 | fi |
| 636 | |
| 637 | else |
| 638 | |
| 639 | # if cross compiling, cannot launch a program, so make a static guess |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 640 | if test "$cpu" = "armv4b" \ |
aurel32 | f54b3f9 | 2008-04-12 20:14:54 +0000 | [diff] [blame] | 641 | -o "$cpu" = "hppa" \ |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 642 | -o "$cpu" = "m68k" \ |
| 643 | -o "$cpu" = "mips" \ |
| 644 | -o "$cpu" = "mips64" \ |
| 645 | -o "$cpu" = "powerpc" \ |
| 646 | -o "$cpu" = "s390" \ |
| 647 | -o "$cpu" = "sparc" \ |
| 648 | -o "$cpu" = "sparc64"; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 649 | bigendian="yes" |
| 650 | fi |
| 651 | |
| 652 | fi |
| 653 | |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 654 | # host long bits test |
| 655 | hostlongbits="32" |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 656 | if test "$cpu" = "x86_64" \ |
| 657 | -o "$cpu" = "alpha" \ |
| 658 | -o "$cpu" = "ia64" \ |
| 659 | -o "$cpu" = "sparc64"; then |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 660 | hostlongbits="64" |
| 661 | fi |
| 662 | |
malc | 810260a | 2008-07-23 19:17:46 +0000 | [diff] [blame] | 663 | # ppc specific hostlongbits selection |
| 664 | if test "$cpu" = "powerpc" ; then |
malc | 9d56d2d | 2008-09-30 19:44:32 +0000 | [diff] [blame] | 665 | if $cc $ARCH_CFLAGS -dM -E - -o $TMPI 2>/dev/null </dev/null; then |
| 666 | grep -q __powerpc64__ $TMPI && hostlongbits=64 |
malc | 810260a | 2008-07-23 19:17:46 +0000 | [diff] [blame] | 667 | else |
| 668 | echo hostlongbits test failed |
malc | ba69a08 | 2008-07-24 17:51:36 +0000 | [diff] [blame] | 669 | exit 1 |
malc | 810260a | 2008-07-23 19:17:46 +0000 | [diff] [blame] | 670 | fi |
| 671 | fi |
| 672 | |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 673 | # check gcc options support |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 674 | cat > $TMPC <<EOF |
| 675 | int main(void) { |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 676 | } |
| 677 | EOF |
| 678 | |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 679 | # Check host NPTL support |
| 680 | cat > $TMPC <<EOF |
| 681 | #include <sched.h> |
pbrook | 30813ce | 2008-06-02 15:45:44 +0000 | [diff] [blame] | 682 | #include <linux/futex.h> |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 683 | void foo() |
| 684 | { |
| 685 | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
| 686 | #error bork |
| 687 | #endif |
| 688 | } |
| 689 | EOF |
| 690 | |
| 691 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then |
| 692 | : |
| 693 | else |
| 694 | nptl="no" |
| 695 | fi |
| 696 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 697 | ########################################## |
balrog | ac62922 | 2008-10-11 09:56:04 +0000 | [diff] [blame] | 698 | # zlib check |
| 699 | |
| 700 | cat > $TMPC << EOF |
| 701 | #include <zlib.h> |
| 702 | int main(void) { zlibVersion(); return 0; } |
| 703 | EOF |
balrog | 17e1592 | 2008-10-11 12:00:42 +0000 | [diff] [blame] | 704 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC -lz 2> /dev/null ; then |
balrog | ac62922 | 2008-10-11 09:56:04 +0000 | [diff] [blame] | 705 | : |
| 706 | else |
| 707 | echo |
| 708 | echo "Error: zlib check failed" |
| 709 | echo "Make sure to have the zlib libs and headers installed." |
| 710 | echo |
| 711 | exit 1 |
| 712 | fi |
| 713 | |
| 714 | ########################################## |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 715 | # SDL probe |
| 716 | |
| 717 | sdl_too_old=no |
| 718 | |
| 719 | if test -z "$sdl" ; then |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 720 | sdl_config="sdl-config" |
| 721 | sdl=no |
| 722 | sdl_static=no |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 723 | |
| 724 | cat > $TMPC << EOF |
| 725 | #include <SDL.h> |
| 726 | #undef main /* We don't want SDL to override our main() */ |
| 727 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
| 728 | EOF |
malc | d4742de | 2008-11-29 22:04:31 +0000 | [diff] [blame] | 729 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> $TMPSDLLOG ; then |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 730 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` |
| 731 | if test "$_sdlversion" -lt 121 ; then |
| 732 | sdl_too_old=yes |
| 733 | else |
| 734 | if test "$cocoa" = "no" ; then |
| 735 | sdl=yes |
| 736 | fi |
| 737 | fi |
| 738 | |
| 739 | # static link with sdl ? |
| 740 | if test "$sdl" = "yes" ; then |
| 741 | aa="no" |
| 742 | `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes" |
| 743 | sdl_static_libs=`$sdl_config --static-libs 2>/dev/null` |
| 744 | if [ "$aa" = "yes" ] ; then |
| 745 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 746 | fi |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 747 | |
aliguori | cd01b4a | 2008-08-21 19:25:45 +0000 | [diff] [blame] | 748 | if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then |
| 749 | sdl_static=yes |
| 750 | fi |
| 751 | fi # static link |
| 752 | fi # sdl compile test |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 753 | else |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 754 | # Make sure to disable cocoa if sdl was set |
| 755 | if test "$sdl" = "yes" ; then |
| 756 | cocoa="no" |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 757 | audio_drv_list="`echo $audio_drv_list | sed s,coreaudio,,g`" |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 758 | fi |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 759 | fi # -z $sdl |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 760 | |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 761 | ########################################## |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 762 | # VNC TLS detection |
| 763 | if test "$vnc_tls" = "yes" ; then |
aliguori | ae6b5e5 | 2008-08-06 16:55:50 +0000 | [diff] [blame] | 764 | cat > $TMPC <<EOF |
| 765 | #include <gnutls/gnutls.h> |
| 766 | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } |
| 767 | EOF |
| 768 | vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null` |
| 769 | vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null` |
| 770 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $vnc_tls_cflags $TMPC \ |
| 771 | $vnc_tls_libs 2> /dev/null ; then |
| 772 | : |
| 773 | else |
| 774 | vnc_tls="no" |
| 775 | fi |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 776 | fi |
| 777 | |
| 778 | ########################################## |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 779 | # vde libraries probe |
| 780 | if test "$vde" = "yes" ; then |
| 781 | cat > $TMPC << EOF |
| 782 | #include <libvdeplug.h> |
pbrook | 4a7f0e0 | 2008-09-07 16:42:53 +0000 | [diff] [blame] | 783 | int main(void) |
| 784 | { |
| 785 | struct vde_open_args a = {0, 0, 0}; |
| 786 | vde_open("", "", &a); |
| 787 | return 0; |
| 788 | } |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 789 | EOF |
pbrook | 4a7f0e0 | 2008-09-07 16:42:53 +0000 | [diff] [blame] | 790 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lvdeplug 2> /dev/null ; then |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 791 | : |
| 792 | else |
aliguori | e0e6c8c0 | 2008-07-23 18:14:33 +0000 | [diff] [blame] | 793 | vde="no" |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 794 | fi |
| 795 | fi |
| 796 | |
| 797 | ########################################## |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 798 | # Sound support libraries probe |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 799 | |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 800 | audio_drv_probe() |
| 801 | { |
| 802 | drv=$1 |
| 803 | hdr=$2 |
| 804 | lib=$3 |
| 805 | exp=$4 |
| 806 | cfl=$5 |
| 807 | cat > $TMPC << EOF |
| 808 | #include <$hdr> |
| 809 | int main(void) { $exp } |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 810 | EOF |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 811 | if $cc $ARCH_CFLAGS $cfl -o $TMPE $TMPC $lib 2> /dev/null ; then |
| 812 | : |
| 813 | else |
| 814 | echo |
| 815 | echo "Error: $drv check failed" |
| 816 | echo "Make sure to have the $drv libs and headers installed." |
| 817 | echo |
| 818 | exit 1 |
| 819 | fi |
| 820 | } |
| 821 | |
malc | 2fa7d3b | 2008-07-29 12:58:44 +0000 | [diff] [blame] | 822 | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 823 | for drv in $audio_drv_list; do |
| 824 | case $drv in |
| 825 | alsa) |
| 826 | audio_drv_probe $drv alsa/asoundlib.h -lasound \ |
| 827 | "snd_pcm_t **handle; return snd_pcm_close(*handle);" |
| 828 | ;; |
| 829 | |
| 830 | fmod) |
| 831 | if test -z $fmod_lib || test -z $fmod_inc; then |
| 832 | echo |
| 833 | echo "Error: You must specify path to FMOD library and headers" |
| 834 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
| 835 | echo |
| 836 | exit 1 |
| 837 | fi |
| 838 | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" |
| 839 | ;; |
| 840 | |
| 841 | esd) |
| 842 | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' |
| 843 | ;; |
malc | b8e59f1 | 2008-07-02 21:03:08 +0000 | [diff] [blame] | 844 | |
| 845 | pa) |
| 846 | audio_drv_probe $drv pulse/simple.h -lpulse-simple \ |
| 847 | "pa_simple *s = NULL; pa_simple_free(s); return 0;" |
| 848 | ;; |
| 849 | |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 850 | oss|sdl|core|wav|dsound) |
| 851 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) |
| 852 | ;; |
| 853 | |
malc | e4c63a6 | 2008-07-19 16:15:16 +0000 | [diff] [blame] | 854 | *) |
malc | 1c9b2a5 | 2008-07-19 16:57:30 +0000 | [diff] [blame] | 855 | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
malc | e4c63a6 | 2008-07-19 16:15:16 +0000 | [diff] [blame] | 856 | echo |
| 857 | echo "Error: Unknown driver '$drv' selected" |
| 858 | echo "Possible drivers are: $audio_possible_drivers" |
| 859 | echo |
| 860 | exit 1 |
| 861 | } |
| 862 | ;; |
malc | c2de5c9 | 2008-06-28 19:13:06 +0000 | [diff] [blame] | 863 | esac |
| 864 | done |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 865 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 866 | ########################################## |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 867 | # BrlAPI probe |
| 868 | |
| 869 | if test -z "$brlapi" ; then |
| 870 | brlapi=no |
| 871 | cat > $TMPC << EOF |
| 872 | #include <brlapi.h> |
| 873 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
| 874 | EOF |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 875 | if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi > /dev/null 2> /dev/null ; then |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 876 | brlapi=yes |
| 877 | fi # brlapi compile test |
| 878 | fi # -z $brlapi |
| 879 | |
| 880 | ########################################## |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 881 | # curses probe |
| 882 | |
| 883 | if test "$curses" = "yes" ; then |
| 884 | curses=no |
| 885 | cat > $TMPC << EOF |
| 886 | #include <curses.h> |
| 887 | int main(void) { return curses_version(); } |
| 888 | EOF |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 889 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses > /dev/null 2> /dev/null ; then |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 890 | curses=yes |
| 891 | fi |
| 892 | fi # test "$curses" |
| 893 | |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 894 | ########################################## |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 895 | # bluez support probe |
| 896 | if test "$bluez" = "yes" ; then |
| 897 | `pkg-config bluez` || bluez="no" |
| 898 | fi |
| 899 | if test "$bluez" = "yes" ; then |
balrog | e820e3f | 2008-09-30 02:27:44 +0000 | [diff] [blame] | 900 | cat > $TMPC << EOF |
| 901 | #include <bluetooth/bluetooth.h> |
| 902 | int main(void) { return bt_error(0); } |
| 903 | EOF |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 904 | bluez_cflags=`pkg-config --cflags bluez` |
| 905 | bluez_libs=`pkg-config --libs bluez` |
balrog | 17e1592 | 2008-10-11 12:00:42 +0000 | [diff] [blame] | 906 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $bluez_cflags $TMPC \ |
balrog | e820e3f | 2008-09-30 02:27:44 +0000 | [diff] [blame] | 907 | $bluez_libs 2> /dev/null ; then |
| 908 | : |
| 909 | else |
| 910 | bluez="no" |
| 911 | fi |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 912 | fi |
| 913 | |
| 914 | ########################################## |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 915 | # kvm probe |
| 916 | if test "$kvm" = "yes" ; then |
| 917 | cat > $TMPC <<EOF |
| 918 | #include <linux/kvm.h> |
| 919 | #if !defined(KVM_API_VERSION) || \ |
| 920 | KVM_API_VERSION < 12 || \ |
| 921 | KVM_API_VERSION > 12 || \ |
| 922 | !defined(KVM_CAP_USER_MEMORY) || \ |
aliguori | d85dc28 | 2008-12-09 19:59:09 +0000 | [diff] [blame] | 923 | !defined(KVM_CAP_SET_TSS_ADDR) || \ |
| 924 | !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 925 | #error Invalid KVM version |
| 926 | #endif |
| 927 | int main(void) { return 0; } |
| 928 | EOF |
aliguori | eac3026 | 2008-11-05 16:28:56 +0000 | [diff] [blame] | 929 | if test "$kerneldir" != "" ; then |
| 930 | kvm_cflags=-I"$kerneldir"/include |
| 931 | else |
| 932 | kvm_cflags="" |
| 933 | fi |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 934 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC \ |
| 935 | 2>/dev/null ; then |
| 936 | : |
| 937 | else |
| 938 | kvm="no" |
| 939 | fi |
| 940 | fi |
| 941 | |
| 942 | ########################################## |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 943 | # AIO probe |
aliguori | 3c529d9 | 2008-12-12 16:41:40 +0000 | [diff] [blame] | 944 | AIOLIBS="" |
| 945 | |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 946 | if test "$aio" = "yes" ; then |
| 947 | aio=no |
| 948 | cat > $TMPC << EOF |
aliguori | 3c529d9 | 2008-12-12 16:41:40 +0000 | [diff] [blame] | 949 | #include <pthread.h> |
| 950 | int main(void) { pthread_mutex_t lock; return 0; } |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 951 | EOF |
| 952 | if $cc $ARCH_CFLAGS -o $TMPE $AIOLIBS $TMPC 2> /dev/null ; then |
| 953 | aio=yes |
aliguori | 3c529d9 | 2008-12-12 16:41:40 +0000 | [diff] [blame] | 954 | AIOLIBS="-lpthread" |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 955 | fi |
| 956 | fi |
| 957 | |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 958 | ########################################## |
| 959 | # iovec probe |
| 960 | cat > $TMPC <<EOF |
| 961 | #include <sys/uio.h> |
| 962 | int main(void) { struct iovec iov; return 0; } |
| 963 | EOF |
| 964 | iovec=no |
| 965 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
| 966 | iovec=yes |
| 967 | fi |
| 968 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 969 | # Check if tools are available to build documentation. |
ths | 6c59186 | 2007-05-09 13:55:03 +0000 | [diff] [blame] | 970 | if [ -x "`which texi2html 2>/dev/null`" ] && \ |
| 971 | [ -x "`which pod2man 2>/dev/null`" ]; then |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 972 | build_docs="yes" |
| 973 | fi |
| 974 | |
aliguori | da93a1f | 2008-12-12 20:02:52 +0000 | [diff] [blame] | 975 | ########################################## |
| 976 | # Do we need librt |
| 977 | cat > $TMPC <<EOF |
| 978 | #include <signal.h> |
| 979 | #include <time.h> |
| 980 | int main(void) { clockid_t id; return clock_gettime(id, NULL); } |
| 981 | EOF |
| 982 | |
| 983 | rt=no |
| 984 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
| 985 | : |
| 986 | elif $cc $ARCH_CFLAGS -o $TMPE $TMPC -lrt 2> /dev/null ; then |
| 987 | rt=yes |
| 988 | fi |
| 989 | |
| 990 | if test "$rt" = "yes" ; then |
| 991 | # Hack, we should have a general purpose LIBS for this sort of thing |
| 992 | AIOLIBS="$AIOLIBS -lrt" |
| 993 | fi |
| 994 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 995 | if test "$mingw32" = "yes" ; then |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 996 | if test -z "$prefix" ; then |
aliguori | 17e9097 | 2008-10-24 14:11:41 +0000 | [diff] [blame] | 997 | prefix="c:\\\\Program Files\\\\Qemu" |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 998 | fi |
| 999 | mansuffix="" |
| 1000 | datasuffix="" |
| 1001 | docsuffix="" |
| 1002 | binsuffix="" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 1003 | else |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 1004 | if test -z "$prefix" ; then |
| 1005 | prefix="/usr/local" |
| 1006 | fi |
| 1007 | mansuffix="/share/man" |
| 1008 | datasuffix="/share/qemu" |
| 1009 | docsuffix="/share/doc/qemu" |
| 1010 | binsuffix="/bin" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 1011 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 1012 | |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1013 | echo "Install prefix $prefix" |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 1014 | echo "BIOS directory $prefix$datasuffix" |
| 1015 | echo "binary directory $prefix$binsuffix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 1016 | if test "$mingw32" = "no" ; then |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 1017 | echo "Manual directory $prefix$mansuffix" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1018 | echo "ELF interp prefix $interp_prefix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 1019 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 1020 | echo "Source path $source_path" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1021 | echo "C compiler $cc" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 1022 | echo "Host C compiler $host_cc" |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 1023 | echo "ARCH_CFLAGS $ARCH_CFLAGS" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1024 | echo "make $make" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 1025 | echo "install $install" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1026 | echo "host CPU $cpu" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1027 | echo "host big endian $bigendian" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1028 | echo "target list $target_list" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1029 | echo "gprof enabled $gprof" |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 1030 | echo "sparse enabled $sparse" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 1031 | echo "profiler $profiler" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 1032 | echo "static build $static" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 1033 | echo "-Werror enabled $werror" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 1034 | if test "$darwin" = "yes" ; then |
| 1035 | echo "Cocoa support $cocoa" |
| 1036 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1037 | echo "SDL support $sdl" |
bellard | e4afee9 | 2005-04-26 20:46:24 +0000 | [diff] [blame] | 1038 | if test "$sdl" != "no" ; then |
| 1039 | echo "SDL static link $sdl_static" |
| 1040 | fi |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1041 | echo "curses support $curses" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1042 | echo "mingw32 support $mingw32" |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1043 | echo "Audio drivers $audio_drv_list" |
| 1044 | echo "Extra audio cards $audio_card_list" |
malc | 8ff9cbf | 2008-06-23 18:33:30 +0000 | [diff] [blame] | 1045 | echo "Mixer emulation $mixemu" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 1046 | echo "VNC TLS support $vnc_tls" |
| 1047 | if test "$vnc_tls" = "yes" ; then |
| 1048 | echo " TLS CFLAGS $vnc_tls_cflags" |
| 1049 | echo " TLS LIBS $vnc_tls_libs" |
| 1050 | fi |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1051 | if test -n "$sparc_cpu"; then |
| 1052 | echo "Target Sparc Arch $sparc_cpu" |
| 1053 | fi |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 1054 | echo "kqemu support $kqemu" |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 1055 | echo "brlapi support $brlapi" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 1056 | echo "Documentation $build_docs" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 1057 | [ ! -z "$uname_release" ] && \ |
| 1058 | echo "uname -r $uname_release" |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 1059 | echo "NPTL support $nptl" |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 1060 | echo "vde support $vde" |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 1061 | echo "AIO support $aio" |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 1062 | echo "Install blobs $blobs" |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1063 | echo "KVM support $kvm" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1064 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1065 | if test $sdl_too_old = "yes"; then |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 1066 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 1067 | fi |
malc | d4742de | 2008-11-29 22:04:31 +0000 | [diff] [blame] | 1068 | if [ -s $TMPSDLLOG ]; then |
ths | 20b40c6 | 2007-07-11 23:39:45 +0000 | [diff] [blame] | 1069 | echo "The error log from compiling the libSDL test is: " |
malc | d4742de | 2008-11-29 22:04:31 +0000 | [diff] [blame] | 1070 | cat $TMPSDLLOG |
ths | 20b40c6 | 2007-07-11 23:39:45 +0000 | [diff] [blame] | 1071 | fi |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 1072 | #if test "$sdl_static" = "no"; then |
| 1073 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" |
| 1074 | #fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1075 | config_mak="config-host.mak" |
| 1076 | config_h="config-host.h" |
| 1077 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 1078 | #echo "Creating $config_mak and $config_h" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1079 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1080 | test -f $config_h && mv $config_h ${config_h}~ |
| 1081 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1082 | echo "# Automatically generated by configure - do not modify" > $config_mak |
malc | fd69fe2 | 2008-12-07 22:50:16 +0000 | [diff] [blame] | 1083 | echo -n "# Configured with:" >> $config_mak |
| 1084 | printf " '%s'" "$0" "$@" >> $config_mak |
| 1085 | echo >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1086 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 1087 | |
| 1088 | echo "prefix=$prefix" >> $config_mak |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 1089 | echo "bindir=\${prefix}$binsuffix" >> $config_mak |
| 1090 | echo "mandir=\${prefix}$mansuffix" >> $config_mak |
| 1091 | echo "datadir=\${prefix}$datasuffix" >> $config_mak |
ths | 4ad5b06 | 2007-03-03 21:47:02 +0000 | [diff] [blame] | 1092 | echo "docdir=\${prefix}$docsuffix" >> $config_mak |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 1093 | echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1094 | echo "MAKE=$make" >> $config_mak |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 1095 | echo "INSTALL=$install" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1096 | echo "CC=$cc" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1097 | echo "HOST_CC=$host_cc" >> $config_mak |
| 1098 | echo "AR=$ar" >> $config_mak |
| 1099 | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 1100 | # XXX: only use CFLAGS and LDFLAGS ? |
| 1101 | # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross |
| 1102 | # compilation of dyngen tool (useful for win32 build on Linux host) |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 1103 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1104 | echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak |
| 1105 | echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak |
| 1106 | echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1107 | echo "CFLAGS=$CFLAGS" >> $config_mak |
| 1108 | echo "LDFLAGS=$LDFLAGS" >> $config_mak |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1109 | echo "EXESUF=$EXESUF" >> $config_mak |
ths | 70956b7 | 2007-03-17 15:00:37 +0000 | [diff] [blame] | 1110 | echo "AIOLIBS=$AIOLIBS" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1111 | case "$cpu" in |
| 1112 | i386) |
| 1113 | echo "ARCH=i386" >> $config_mak |
| 1114 | echo "#define HOST_I386 1" >> $config_h |
| 1115 | ;; |
| 1116 | x86_64) |
| 1117 | echo "ARCH=x86_64" >> $config_mak |
| 1118 | echo "#define HOST_X86_64 1" >> $config_h |
| 1119 | ;; |
| 1120 | alpha) |
| 1121 | echo "ARCH=alpha" >> $config_mak |
| 1122 | echo "#define HOST_ALPHA 1" >> $config_h |
| 1123 | ;; |
| 1124 | armv4b) |
| 1125 | echo "ARCH=arm" >> $config_mak |
| 1126 | echo "#define HOST_ARM 1" >> $config_h |
| 1127 | ;; |
| 1128 | armv4l) |
| 1129 | echo "ARCH=arm" >> $config_mak |
| 1130 | echo "#define HOST_ARM 1" >> $config_h |
| 1131 | ;; |
| 1132 | cris) |
| 1133 | echo "ARCH=cris" >> $config_mak |
| 1134 | echo "#define HOST_CRIS 1" >> $config_h |
| 1135 | ;; |
| 1136 | hppa) |
| 1137 | echo "ARCH=hppa" >> $config_mak |
| 1138 | echo "#define HOST_HPPA 1" >> $config_h |
| 1139 | ;; |
| 1140 | ia64) |
| 1141 | echo "ARCH=ia64" >> $config_mak |
| 1142 | echo "#define HOST_IA64 1" >> $config_h |
| 1143 | ;; |
| 1144 | m68k) |
| 1145 | echo "ARCH=m68k" >> $config_mak |
| 1146 | echo "#define HOST_M68K 1" >> $config_h |
| 1147 | ;; |
| 1148 | mips) |
| 1149 | echo "ARCH=mips" >> $config_mak |
| 1150 | echo "#define HOST_MIPS 1" >> $config_h |
| 1151 | ;; |
| 1152 | mips64) |
| 1153 | echo "ARCH=mips64" >> $config_mak |
| 1154 | echo "#define HOST_MIPS64 1" >> $config_h |
| 1155 | ;; |
| 1156 | powerpc) |
malc | 810260a | 2008-07-23 19:17:46 +0000 | [diff] [blame] | 1157 | if test "$hostlongbits" = "32"; then |
| 1158 | echo "ARCH=ppc" >> $config_mak |
| 1159 | echo "#define HOST_PPC 1" >> $config_h |
| 1160 | else |
| 1161 | echo "ARCH=ppc64" >> $config_mak |
| 1162 | echo "#define HOST_PPC64 1" >> $config_h |
| 1163 | fi |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1164 | ;; |
| 1165 | s390) |
| 1166 | echo "ARCH=s390" >> $config_mak |
| 1167 | echo "#define HOST_S390 1" >> $config_h |
| 1168 | ;; |
| 1169 | sparc) |
| 1170 | echo "ARCH=sparc" >> $config_mak |
| 1171 | echo "#define HOST_SPARC 1" >> $config_h |
| 1172 | ;; |
| 1173 | sparc64) |
| 1174 | echo "ARCH=sparc64" >> $config_mak |
| 1175 | echo "#define HOST_SPARC64 1" >> $config_h |
| 1176 | ;; |
| 1177 | *) |
| 1178 | echo "Unsupported CPU = $cpu" |
| 1179 | exit 1 |
| 1180 | ;; |
| 1181 | esac |
aliguori | 03b4fe7 | 2008-10-07 19:16:17 +0000 | [diff] [blame] | 1182 | if test "$sparse" = "yes" ; then |
| 1183 | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak |
| 1184 | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak |
| 1185 | echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak |
| 1186 | fi |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1187 | if test "$bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1188 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
| 1189 | echo "#define WORDS_BIGENDIAN 1" >> $config_h |
| 1190 | fi |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 1191 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1192 | if test "$mingw32" = "yes" ; then |
| 1193 | echo "CONFIG_WIN32=yes" >> $config_mak |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 1194 | echo "#define CONFIG_WIN32 1" >> $config_h |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 1195 | else |
| 1196 | cat > $TMPC << EOF |
| 1197 | #include <byteswap.h> |
| 1198 | int main(void) { return bswap_32(0); } |
| 1199 | EOF |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 1200 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 1201 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
| 1202 | fi |
blueswir1 | 1360677 | 2008-12-05 17:54:09 +0000 | [diff] [blame] | 1203 | cat > $TMPC << EOF |
| 1204 | #include <sys/endian.h> |
| 1205 | #include <sys/types.h> |
| 1206 | #include <machine/bswap.h> |
| 1207 | int main(void) { return bswap32(0); } |
| 1208 | EOF |
aurel32 | 178baee | 2008-12-08 18:11:57 +0000 | [diff] [blame] | 1209 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC >/dev/null 2> /dev/null ; then |
blueswir1 | 1360677 | 2008-12-05 17:54:09 +0000 | [diff] [blame] | 1210 | echo "#define HAVE_MACHINE_BSWAP_H 1" >> $config_h |
| 1211 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1212 | fi |
blueswir1 | 128ab2f | 2008-08-15 18:33:42 +0000 | [diff] [blame] | 1213 | |
| 1214 | if [ "$openbsd" = "yes" ] ; then |
| 1215 | echo "#define ENOTSUP 4096" >> $config_h |
| 1216 | fi |
| 1217 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 1218 | if test "$darwin" = "yes" ; then |
| 1219 | echo "CONFIG_DARWIN=yes" >> $config_mak |
| 1220 | echo "#define CONFIG_DARWIN 1" >> $config_h |
| 1221 | fi |
malc | b29fe3e | 2008-11-18 01:42:22 +0000 | [diff] [blame] | 1222 | |
| 1223 | if test "$aix" = "yes" ; then |
| 1224 | echo "CONFIG_AIX=yes" >> $config_mak |
| 1225 | echo "#define CONFIG_AIX 1" >> $config_h |
| 1226 | fi |
| 1227 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1228 | if test "$solaris" = "yes" ; then |
| 1229 | echo "CONFIG_SOLARIS=yes" >> $config_mak |
bellard | 38cfa06 | 2006-05-01 13:58:07 +0000 | [diff] [blame] | 1230 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 1231 | if test "$needs_libsunmath" = "yes" ; then |
| 1232 | echo "NEEDS_LIBSUNMATH=yes" >> $config_mak |
| 1233 | echo "#define NEEDS_LIBSUNMATH 1" >> $config_h |
| 1234 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1235 | fi |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 1236 | if test -n "$sparc_cpu"; then |
| 1237 | echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak |
| 1238 | echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h |
| 1239 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 1240 | if test "$gdbstub" = "yes" ; then |
| 1241 | echo "CONFIG_GDBSTUB=yes" >> $config_mak |
| 1242 | echo "#define CONFIG_GDBSTUB 1" >> $config_h |
| 1243 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1244 | if test "$gprof" = "yes" ; then |
| 1245 | echo "TARGET_GPROF=yes" >> $config_mak |
| 1246 | echo "#define HAVE_GPROF 1" >> $config_h |
| 1247 | fi |
| 1248 | if test "$static" = "yes" ; then |
| 1249 | echo "CONFIG_STATIC=yes" >> $config_mak |
bellard | 5086347 | 2003-10-28 23:04:01 +0000 | [diff] [blame] | 1250 | echo "#define CONFIG_STATIC 1" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1251 | fi |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 1252 | if test $profiler = "yes" ; then |
| 1253 | echo "#define CONFIG_PROFILER 1" >> $config_h |
| 1254 | fi |
bellard | c20709a | 2004-04-21 23:27:19 +0000 | [diff] [blame] | 1255 | if test "$slirp" = "yes" ; then |
| 1256 | echo "CONFIG_SLIRP=yes" >> $config_mak |
| 1257 | echo "#define CONFIG_SLIRP 1" >> $config_h |
| 1258 | fi |
ths | 8a16d27 | 2008-07-19 09:56:24 +0000 | [diff] [blame] | 1259 | if test "$vde" = "yes" ; then |
| 1260 | echo "CONFIG_VDE=yes" >> $config_mak |
| 1261 | echo "#define CONFIG_VDE 1" >> $config_h |
| 1262 | echo "VDE_LIBS=-lvdeplug" >> $config_mak |
| 1263 | fi |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1264 | for card in $audio_card_list; do |
pbrook | f6e5889 | 2008-06-29 01:00:34 +0000 | [diff] [blame] | 1265 | def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1266 | echo "$def=yes" >> $config_mak |
| 1267 | echo "#define $def 1" >> $config_h |
| 1268 | done |
| 1269 | echo "#define AUDIO_DRIVERS \\" >> $config_h |
| 1270 | for drv in $audio_drv_list; do |
| 1271 | echo " &${drv}_audio_driver, \\" >>$config_h |
pbrook | f6e5889 | 2008-06-29 01:00:34 +0000 | [diff] [blame] | 1272 | def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1273 | echo "$def=yes" >> $config_mak |
malc | 923e452 | 2008-07-02 18:13:46 +0000 | [diff] [blame] | 1274 | if test "$drv" = "fmod"; then |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1275 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
| 1276 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak |
blueswir1 | 2f6a1ab | 2008-08-21 18:00:53 +0000 | [diff] [blame] | 1277 | elif test "$drv" = "oss"; then |
| 1278 | echo "CONFIG_OSS_LIB=$oss_lib" >> $config_mak |
malc | 0c58ac1 | 2008-06-25 21:04:05 +0000 | [diff] [blame] | 1279 | fi |
| 1280 | done |
| 1281 | echo "" >>$config_h |
malc | 8ff9cbf | 2008-06-23 18:33:30 +0000 | [diff] [blame] | 1282 | if test "$mixemu" = "yes" ; then |
| 1283 | echo "CONFIG_MIXEMU=yes" >> $config_mak |
| 1284 | echo "#define CONFIG_MIXEMU 1" >> $config_h |
| 1285 | fi |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 1286 | if test "$vnc_tls" = "yes" ; then |
| 1287 | echo "CONFIG_VNC_TLS=yes" >> $config_mak |
| 1288 | echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak |
| 1289 | echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak |
| 1290 | echo "#define CONFIG_VNC_TLS 1" >> $config_h |
| 1291 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1292 | qemu_version=`head $source_path/VERSION` |
| 1293 | echo "VERSION=$qemu_version" >>$config_mak |
pbrook | d4b8f03 | 2006-04-16 13:49:23 +0000 | [diff] [blame] | 1294 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1295 | |
| 1296 | echo "SRC_PATH=$source_path" >> $config_mak |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 1297 | if [ "$source_path_used" = "yes" ]; then |
| 1298 | echo "VPATH=$source_path" >> $config_mak |
| 1299 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1300 | echo "TARGET_DIRS=$target_list" >> $config_mak |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 1301 | if [ "$build_docs" = "yes" ] ; then |
| 1302 | echo "BUILD_DOCS=yes" >> $config_mak |
| 1303 | fi |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1304 | if test "$static" = "yes"; then |
| 1305 | sdl1=$sdl_static |
| 1306 | else |
| 1307 | sdl1=$sdl |
| 1308 | fi |
| 1309 | if test "$sdl1" = "yes" ; then |
| 1310 | echo "#define CONFIG_SDL 1" >> $config_h |
| 1311 | echo "CONFIG_SDL=yes" >> $config_mak |
| 1312 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
| 1313 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak |
| 1314 | else |
| 1315 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak |
| 1316 | fi |
| 1317 | if [ "${aa}" = "yes" ] ; then |
| 1318 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak |
| 1319 | else |
| 1320 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak |
| 1321 | fi |
| 1322 | fi |
| 1323 | if test "$cocoa" = "yes" ; then |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1324 | echo "#define CONFIG_COCOA 1" >> $config_h |
| 1325 | echo "CONFIG_COCOA=yes" >> $config_mak |
| 1326 | fi |
| 1327 | if test "$curses" = "yes" ; then |
| 1328 | echo "#define CONFIG_CURSES 1" >> $config_h |
| 1329 | echo "CONFIG_CURSES=yes" >> $config_mak |
| 1330 | echo "CURSES_LIBS=-lcurses" >> $config_mak |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1331 | fi |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 1332 | if test "$brlapi" = "yes" ; then |
| 1333 | echo "CONFIG_BRLAPI=yes" >> $config_mak |
| 1334 | echo "#define CONFIG_BRLAPI 1" >> $config_h |
| 1335 | echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak |
| 1336 | fi |
balrog | fb599c9 | 2008-09-28 23:49:55 +0000 | [diff] [blame] | 1337 | if test "$bluez" = "yes" ; then |
| 1338 | echo "CONFIG_BLUEZ=yes" >> $config_mak |
| 1339 | echo "CONFIG_BLUEZ_CFLAGS=$bluez_cflags" >> $config_mak |
| 1340 | echo "CONFIG_BLUEZ_LIBS=$bluez_libs" >> $config_mak |
| 1341 | echo "#define CONFIG_BLUEZ 1" >> $config_h |
| 1342 | fi |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 1343 | if test "$aio" = "yes" ; then |
| 1344 | echo "#define CONFIG_AIO 1" >> $config_h |
aliguori | a3392f9 | 2008-09-11 18:00:19 +0000 | [diff] [blame] | 1345 | echo "CONFIG_AIO=yes" >> $config_mak |
blueswir1 | 414f0da | 2008-08-15 18:20:52 +0000 | [diff] [blame] | 1346 | fi |
ths | 7775534 | 2008-11-27 15:45:16 +0000 | [diff] [blame] | 1347 | if test "$blobs" = "yes" ; then |
| 1348 | echo "INSTALL_BLOBS=yes" >> $config_mak |
| 1349 | fi |
aliguori | bf9298b | 2008-12-05 20:05:26 +0000 | [diff] [blame] | 1350 | if test "$iovec" = "yes" ; then |
| 1351 | echo "#define HAVE_IOVEC 1" >> $config_h |
| 1352 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1353 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 1354 | # XXX: suppress that |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 1355 | if [ "$bsd" = "yes" ] ; then |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 1356 | echo "#define O_LARGEFILE 0" >> $config_h |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 1357 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 1358 | echo "#define _BSD 1" >> $config_h |
| 1359 | fi |
| 1360 | |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 1361 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
| 1362 | |
blueswir1 | 6806364 | 2008-11-22 21:03:55 +0000 | [diff] [blame] | 1363 | # USB host support |
| 1364 | case "$usb" in |
| 1365 | linux) |
| 1366 | echo "HOST_USB=linux" >> $config_mak |
| 1367 | ;; |
| 1368 | bsd) |
| 1369 | echo "HOST_USB=bsd" >> $config_mak |
| 1370 | ;; |
| 1371 | *) |
| 1372 | echo "HOST_USB=stub" >> $config_mak |
| 1373 | ;; |
| 1374 | esac |
| 1375 | |
pbrook | c39e333 | 2007-09-22 16:49:14 +0000 | [diff] [blame] | 1376 | tools= |
| 1377 | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then |
| 1378 | tools="qemu-img\$(EXESUF) $tools" |
bellard | 7a5ca86 | 2008-05-27 21:13:40 +0000 | [diff] [blame] | 1379 | if [ "$linux" = "yes" ] ; then |
| 1380 | tools="qemu-nbd\$(EXESUF) $tools" |
| 1381 | fi |
pbrook | c39e333 | 2007-09-22 16:49:14 +0000 | [diff] [blame] | 1382 | fi |
| 1383 | echo "TOOLS=$tools" >> $config_mak |
| 1384 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1385 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
| 1386 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1387 | for target in $target_list; do |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1388 | target_dir="$target" |
| 1389 | config_mak=$target_dir/config.mak |
| 1390 | config_h=$target_dir/config.h |
| 1391 | target_cpu=`echo $target | cut -d '-' -f 1` |
| 1392 | target_bigendian="no" |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 1393 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1394 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
| 1395 | [ "$target_cpu" = "mips" ] && target_bigendian=yes |
| 1396 | [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes |
| 1397 | [ "$target_cpu" = "mips64" ] && target_bigendian=yes |
bellard | 6786730 | 2003-11-23 17:05:30 +0000 | [diff] [blame] | 1398 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
j_mayer | d4082e9 | 2007-04-24 07:34:03 +0000 | [diff] [blame] | 1399 | [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes |
j_mayer | 22f8a8b | 2007-10-14 08:38:29 +0000 | [diff] [blame] | 1400 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
j_mayer | e85e7c6 | 2007-10-18 19:59:49 +0000 | [diff] [blame] | 1401 | [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes |
pbrook | 908f52b | 2006-06-18 19:16:53 +0000 | [diff] [blame] | 1402 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1403 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
| 1404 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes |
| 1405 | [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1406 | target_softmmu="no" |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 1407 | target_user_only="no" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1408 | target_linux_user="no" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1409 | target_darwin_user="no" |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 1410 | target_bsd_user="no" |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 1411 | case "$target" in |
| 1412 | ${target_cpu}-softmmu) |
| 1413 | target_softmmu="yes" |
| 1414 | ;; |
| 1415 | ${target_cpu}-linux-user) |
| 1416 | target_user_only="yes" |
| 1417 | target_linux_user="yes" |
| 1418 | ;; |
| 1419 | ${target_cpu}-darwin-user) |
| 1420 | target_user_only="yes" |
| 1421 | target_darwin_user="yes" |
| 1422 | ;; |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 1423 | ${target_cpu}-bsd-user) |
| 1424 | target_user_only="yes" |
| 1425 | target_bsd_user="yes" |
| 1426 | ;; |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 1427 | *) |
| 1428 | echo "ERROR: Target '$target' not recognised" |
| 1429 | exit 1 |
| 1430 | ;; |
| 1431 | esac |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1432 | |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1433 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1434 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1435 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
pbrook | 9c03850 | 2006-04-16 15:19:15 +0000 | [diff] [blame] | 1436 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1437 | echo "Note that this will disable all output from the virtual graphics card" |
| 1438 | echo "except through VNC or curses." |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1439 | exit 1; |
| 1440 | fi |
| 1441 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 1442 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1443 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1444 | test -f $config_h && mv $config_h ${config_h}~ |
| 1445 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1446 | mkdir -p $target_dir |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 1447 | mkdir -p $target_dir/fpu |
bellard | 57fec1f | 2008-02-01 10:50:11 +0000 | [diff] [blame] | 1448 | mkdir -p $target_dir/tcg |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 1449 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then |
bellard | 69de927 | 2004-02-16 21:40:43 +0000 | [diff] [blame] | 1450 | mkdir -p $target_dir/nwfpe |
| 1451 | fi |
| 1452 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1453 | # |
| 1454 | # don't use ln -sf as not all "ln -sf" over write the file/link |
| 1455 | # |
| 1456 | rm -f $target_dir/Makefile |
| 1457 | ln -s $source_path/Makefile.target $target_dir/Makefile |
| 1458 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1459 | |
| 1460 | echo "# Automatically generated by configure - do not modify" > $config_mak |
| 1461 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 1462 | |
| 1463 | |
| 1464 | echo "include ../config-host.mak" >> $config_mak |
| 1465 | echo "#include \"../config-host.h\"" >> $config_h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 1466 | |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 1467 | bflt="no" |
blueswir1 | cb33da5 | 2007-10-09 16:34:29 +0000 | [diff] [blame] | 1468 | elfload32="no" |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 1469 | target_nptl="no" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 1470 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
| 1471 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 1472 | gdb_xml_files="" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1473 | |
aliguori | 5985ece | 2008-11-05 19:59:25 +0000 | [diff] [blame] | 1474 | # Make sure the target and host cpus are compatible |
| 1475 | if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \ |
| 1476 | \( "$target_cpu" = "x86_64" -a "$cpu" = "i386" \) -o \ |
| 1477 | \( "$target_cpu" = "i386" -a "$cpu" = "x86_64" \) \) ; then |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1478 | kvm="no" |
| 1479 | fi |
| 1480 | # Disable KVM for linux-user |
| 1481 | if test "$kvm" = "yes" -a "$target_softmmu" = "no" ; then |
| 1482 | kvm="no" |
| 1483 | fi |
| 1484 | |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1485 | case "$target_cpu" in |
| 1486 | i386) |
| 1487 | echo "TARGET_ARCH=i386" >> $config_mak |
| 1488 | echo "#define TARGET_ARCH \"i386\"" >> $config_h |
| 1489 | echo "#define TARGET_I386 1" >> $config_h |
bellard | da26024 | 2008-05-30 20:48:25 +0000 | [diff] [blame] | 1490 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1491 | then |
| 1492 | echo "#define USE_KQEMU 1" >> $config_h |
| 1493 | fi |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1494 | if test "$kvm" = "yes" ; then |
| 1495 | echo "CONFIG_KVM=yes" >> $config_mak |
| 1496 | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak |
aliguori | 5985ece | 2008-11-05 19:59:25 +0000 | [diff] [blame] | 1497 | echo "#define CONFIG_KVM 1" >> $config_h |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1498 | fi |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1499 | ;; |
| 1500 | x86_64) |
| 1501 | echo "TARGET_ARCH=x86_64" >> $config_mak |
| 1502 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h |
| 1503 | echo "#define TARGET_I386 1" >> $config_h |
| 1504 | echo "#define TARGET_X86_64 1" >> $config_h |
| 1505 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" |
| 1506 | then |
| 1507 | echo "#define USE_KQEMU 1" >> $config_h |
| 1508 | fi |
aliguori | 7ba1e61 | 2008-11-05 16:04:33 +0000 | [diff] [blame] | 1509 | if test "$kvm" = "yes" ; then |
| 1510 | echo "CONFIG_KVM=yes" >> $config_mak |
| 1511 | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak |
| 1512 | echo "#define CONFIG_KVM 1" >> $config_h |
| 1513 | fi |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1514 | ;; |
| 1515 | alpha) |
| 1516 | echo "TARGET_ARCH=alpha" >> $config_mak |
| 1517 | echo "#define TARGET_ARCH \"alpha\"" >> $config_h |
| 1518 | echo "#define TARGET_ALPHA 1" >> $config_h |
| 1519 | ;; |
| 1520 | arm|armeb) |
| 1521 | echo "TARGET_ARCH=arm" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1522 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
| 1523 | echo "#define TARGET_ARM 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1524 | bflt="yes" |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 1525 | target_nptl="yes" |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 1526 | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1527 | ;; |
| 1528 | cris) |
| 1529 | echo "TARGET_ARCH=cris" >> $config_mak |
| 1530 | echo "#define TARGET_ARCH \"cris\"" >> $config_h |
| 1531 | echo "#define TARGET_CRIS 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1532 | ;; |
| 1533 | m68k) |
| 1534 | echo "TARGET_ARCH=m68k" >> $config_mak |
| 1535 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h |
| 1536 | echo "#define TARGET_M68K 1" >> $config_h |
| 1537 | bflt="yes" |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 1538 | gdb_xml_files="cf-core.xml cf-fp.xml" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1539 | ;; |
| 1540 | mips|mipsel) |
| 1541 | echo "TARGET_ARCH=mips" >> $config_mak |
| 1542 | echo "#define TARGET_ARCH \"mips\"" >> $config_h |
| 1543 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1544 | echo "#define TARGET_ABI_MIPSO32 1" >> $config_h |
| 1545 | ;; |
| 1546 | mipsn32|mipsn32el) |
| 1547 | echo "TARGET_ARCH=mipsn32" >> $config_mak |
| 1548 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h |
| 1549 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1550 | echo "#define TARGET_ABI_MIPSN32 1" >> $config_h |
| 1551 | ;; |
| 1552 | mips64|mips64el) |
| 1553 | echo "TARGET_ARCH=mips64" >> $config_mak |
| 1554 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h |
| 1555 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1556 | echo "#define TARGET_MIPS64 1" >> $config_h |
| 1557 | echo "#define TARGET_ABI_MIPSN64 1" >> $config_h |
| 1558 | ;; |
| 1559 | ppc) |
| 1560 | echo "TARGET_ARCH=ppc" >> $config_mak |
| 1561 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
| 1562 | echo "#define TARGET_PPC 1" >> $config_h |
| 1563 | ;; |
| 1564 | ppcemb) |
| 1565 | echo "TARGET_ARCH=ppcemb" >> $config_mak |
| 1566 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
| 1567 | echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h |
| 1568 | echo "#define TARGET_PPC 1" >> $config_h |
| 1569 | echo "#define TARGET_PPCEMB 1" >> $config_h |
| 1570 | ;; |
| 1571 | ppc64) |
| 1572 | echo "TARGET_ARCH=ppc64" >> $config_mak |
| 1573 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
| 1574 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
| 1575 | echo "#define TARGET_PPC 1" >> $config_h |
| 1576 | echo "#define TARGET_PPC64 1" >> $config_h |
| 1577 | ;; |
| 1578 | ppc64abi32) |
| 1579 | echo "TARGET_ARCH=ppc64" >> $config_mak |
| 1580 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
| 1581 | echo "TARGET_ARCH2=ppc64abi32" >> $config_mak |
| 1582 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
| 1583 | echo "#define TARGET_PPC 1" >> $config_h |
| 1584 | echo "#define TARGET_PPC64 1" >> $config_h |
| 1585 | echo "#define TARGET_ABI32 1" >> $config_h |
| 1586 | ;; |
| 1587 | sh4|sh4eb) |
| 1588 | echo "TARGET_ARCH=sh4" >> $config_mak |
| 1589 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h |
| 1590 | echo "#define TARGET_SH4 1" >> $config_h |
| 1591 | bflt="yes" |
aurel32 | 0b6d3ae | 2008-09-15 07:43:43 +0000 | [diff] [blame] | 1592 | target_nptl="yes" |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1593 | ;; |
| 1594 | sparc) |
| 1595 | echo "TARGET_ARCH=sparc" >> $config_mak |
| 1596 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h |
| 1597 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1598 | ;; |
| 1599 | sparc64) |
| 1600 | echo "TARGET_ARCH=sparc64" >> $config_mak |
| 1601 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
| 1602 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1603 | echo "#define TARGET_SPARC64 1" >> $config_h |
| 1604 | elfload32="yes" |
| 1605 | ;; |
| 1606 | sparc32plus) |
| 1607 | echo "TARGET_ARCH=sparc64" >> $config_mak |
| 1608 | echo "TARGET_ABI_DIR=sparc" >> $config_mak |
| 1609 | echo "TARGET_ARCH2=sparc32plus" >> $config_mak |
| 1610 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
| 1611 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1612 | echo "#define TARGET_SPARC64 1" >> $config_h |
| 1613 | echo "#define TARGET_ABI32 1" >> $config_h |
| 1614 | ;; |
| 1615 | *) |
| 1616 | echo "Unsupported target CPU" |
| 1617 | exit 1 |
| 1618 | ;; |
| 1619 | esac |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1620 | if test "$target_bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1621 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
| 1622 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h |
| 1623 | fi |
| 1624 | if test "$target_softmmu" = "yes" ; then |
| 1625 | echo "CONFIG_SOFTMMU=yes" >> $config_mak |
| 1626 | echo "#define CONFIG_SOFTMMU 1" >> $config_h |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1627 | fi |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 1628 | if test "$target_user_only" = "yes" ; then |
| 1629 | echo "CONFIG_USER_ONLY=yes" >> $config_mak |
| 1630 | echo "#define CONFIG_USER_ONLY 1" >> $config_h |
| 1631 | fi |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1632 | if test "$target_linux_user" = "yes" ; then |
| 1633 | echo "CONFIG_LINUX_USER=yes" >> $config_mak |
| 1634 | echo "#define CONFIG_LINUX_USER 1" >> $config_h |
| 1635 | fi |
| 1636 | if test "$target_darwin_user" = "yes" ; then |
| 1637 | echo "CONFIG_DARWIN_USER=yes" >> $config_mak |
| 1638 | echo "#define CONFIG_DARWIN_USER 1" >> $config_h |
| 1639 | fi |
pbrook | 56aebc8 | 2008-10-11 17:55:29 +0000 | [diff] [blame] | 1640 | list="" |
| 1641 | if test ! -z "$gdb_xml_files" ; then |
| 1642 | for x in $gdb_xml_files; do |
| 1643 | list="$list $source_path/gdb-xml/$x" |
| 1644 | done |
| 1645 | fi |
| 1646 | echo "TARGET_XML_FILES=$list" >> $config_mak |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1647 | |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1648 | if test "$target_cpu" = "arm" \ |
| 1649 | -o "$target_cpu" = "armeb" \ |
| 1650 | -o "$target_cpu" = "m68k" \ |
| 1651 | -o "$target_cpu" = "mips" \ |
| 1652 | -o "$target_cpu" = "mipsel" \ |
| 1653 | -o "$target_cpu" = "mipsn32" \ |
| 1654 | -o "$target_cpu" = "mipsn32el" \ |
| 1655 | -o "$target_cpu" = "mips64" \ |
| 1656 | -o "$target_cpu" = "mips64el" \ |
| 1657 | -o "$target_cpu" = "sparc" \ |
| 1658 | -o "$target_cpu" = "sparc64" \ |
| 1659 | -o "$target_cpu" = "sparc32plus"; then |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 1660 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
| 1661 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
| 1662 | fi |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 1663 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
| 1664 | echo "TARGET_HAS_BFLT=yes" >> $config_mak |
| 1665 | echo "#define TARGET_HAS_BFLT 1" >> $config_h |
| 1666 | fi |
pbrook | bd0c566 | 2008-05-29 14:34:11 +0000 | [diff] [blame] | 1667 | if test "$target_user_only" = "yes" \ |
| 1668 | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then |
| 1669 | echo "#define USE_NPTL 1" >> $config_h |
| 1670 | fi |
blueswir1 | cb33da5 | 2007-10-09 16:34:29 +0000 | [diff] [blame] | 1671 | # 32 bit ELF loader in addition to native 64 bit loader? |
| 1672 | if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then |
| 1673 | echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak |
| 1674 | echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h |
| 1675 | fi |
blueswir1 | 8477850 | 2008-10-26 20:33:16 +0000 | [diff] [blame] | 1676 | if test "$target_bsd_user" = "yes" ; then |
| 1677 | echo "CONFIG_BSD_USER=yes" >> $config_mak |
| 1678 | echo "#define CONFIG_BSD_USER 1" >> $config_h |
| 1679 | fi |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 1680 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1681 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
| 1682 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1683 | done # for target in $targets |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1684 | |
| 1685 | # build tree in object directory if source path is different from current one |
| 1686 | if test "$source_path_used" = "yes" ; then |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1687 | DIRS="tests tests/cris slirp audio" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1688 | FILES="Makefile tests/Makefile" |
ths | e7daa60 | 2007-10-08 13:38:27 +0000 | [diff] [blame] | 1689 | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
edgar_igl | e1ffb0f | 2008-03-01 22:23:17 +0000 | [diff] [blame] | 1690 | FILES="$FILES tests/test-mmap.c" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1691 | for dir in $DIRS ; do |
| 1692 | mkdir -p $dir |
| 1693 | done |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1694 | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1695 | for f in $FILES ; do |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1696 | rm -f $f |
| 1697 | ln -s $source_path/$f $f |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1698 | done |
| 1699 | fi |