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" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 18 | |
| 19 | # default parameters |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 20 | prefix="" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 21 | interp_prefix="/usr/gnemul/qemu-%M" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 22 | static="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 23 | cross_prefix="" |
| 24 | cc="gcc" |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 25 | gcc3_search="yes" |
balrog | fe8f78e | 2007-10-31 01:03:28 +0000 | [diff] [blame] | 26 | gcc3_list="gcc-3.4.6 gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 27 | host_cc="gcc" |
| 28 | ar="ar" |
| 29 | make="make" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 30 | install="install" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 31 | strip="strip" |
| 32 | cpu=`uname -m` |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 33 | target_list="" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 34 | case "$cpu" in |
| 35 | i386|i486|i586|i686|i86pc|BePC) |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 36 | cpu="i386" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 37 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 38 | x86_64|amd64) |
| 39 | cpu="x86_64" |
| 40 | ;; |
| 41 | alpha) |
| 42 | cpu="alpha" |
| 43 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 44 | armv*b) |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 45 | cpu="armv4b" |
| 46 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 47 | armv*l) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 48 | cpu="armv4l" |
| 49 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 50 | cris) |
| 51 | cpu="cris" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 52 | ;; |
aurel32 | f54b3f9 | 2008-04-12 20:14:54 +0000 | [diff] [blame] | 53 | parisc|parisc64) |
| 54 | cpu="hppa" |
| 55 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 56 | ia64) |
| 57 | cpu="ia64" |
| 58 | ;; |
| 59 | m68k) |
| 60 | cpu="m68k" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 61 | ;; |
| 62 | mips) |
| 63 | cpu="mips" |
| 64 | ;; |
ths | fbe4f65 | 2007-04-01 11:16:48 +0000 | [diff] [blame] | 65 | mips64) |
| 66 | cpu="mips64" |
| 67 | ;; |
aurel32 | aaa5fa1 | 2008-04-11 22:04:22 +0000 | [diff] [blame] | 68 | "Power Macintosh"|ppc|ppc64) |
| 69 | cpu="powerpc" |
ths | e7daa60 | 2007-10-08 13:38:27 +0000 | [diff] [blame] | 70 | ;; |
ths | 0e7b8a9 | 2007-08-01 00:09:31 +0000 | [diff] [blame] | 71 | s390*) |
bellard | fb3e584 | 2003-03-29 17:32:36 +0000 | [diff] [blame] | 72 | cpu="s390" |
| 73 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 74 | sparc|sun4[cdmuv]) |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 75 | cpu="sparc" |
| 76 | ;; |
| 77 | sparc64) |
| 78 | cpu="sparc64" |
| 79 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 80 | *) |
| 81 | cpu="unknown" |
| 82 | ;; |
| 83 | esac |
| 84 | gprof="no" |
| 85 | bigendian="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 86 | mingw32="no" |
| 87 | EXESUF="" |
| 88 | gdbstub="yes" |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 89 | slirp="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 90 | adlib="no" |
balrog | e5c9a13 | 2008-01-14 04:27:55 +0000 | [diff] [blame] | 91 | ac97="no" |
balrog | 423d65f | 2008-01-14 22:09:11 +0000 | [diff] [blame] | 92 | gus="no" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 93 | oss="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 94 | dsound="no" |
| 95 | coreaudio="no" |
| 96 | alsa="no" |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 97 | esd="no" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 98 | fmod="no" |
| 99 | fmod_lib="" |
| 100 | fmod_inc="" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 101 | vnc_tls="yes" |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 102 | bsd="no" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 103 | linux="no" |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 104 | kqemu="no" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 105 | profiler="no" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 106 | cocoa="no" |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 107 | check_gfx="yes" |
bellard | 1aff381 | 2005-11-02 22:30:45 +0000 | [diff] [blame] | 108 | check_gcc="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 109 | softmmu="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 110 | linux_user="no" |
| 111 | darwin_user="no" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 112 | build_docs="no" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 113 | uname_release="" |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 114 | curses="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 115 | |
| 116 | # OS specific |
| 117 | targetos=`uname -s` |
| 118 | case $targetos in |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 119 | CYGWIN*) |
| 120 | mingw32="yes" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 121 | OS_CFLAGS="-mno-cygwin" |
ths | db8d7dd | 2007-07-12 09:29:18 +0000 | [diff] [blame] | 122 | if [ "$cpu" = "i386" ] ; then |
| 123 | kqemu="yes" |
| 124 | fi |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 125 | ;; |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 126 | MINGW32*) |
| 127 | mingw32="yes" |
ths | db8d7dd | 2007-07-12 09:29:18 +0000 | [diff] [blame] | 128 | if [ "$cpu" = "i386" ] ; then |
| 129 | kqemu="yes" |
| 130 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 131 | ;; |
ths | 5c40d2b | 2007-06-23 16:03:36 +0000 | [diff] [blame] | 132 | GNU/kFreeBSD) |
| 133 | oss="yes" |
| 134 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 135 | kqemu="yes" |
| 136 | fi |
| 137 | ;; |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 138 | FreeBSD) |
| 139 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 140 | oss="yes" |
bellard | e99f906 | 2005-07-28 21:45:38 +0000 | [diff] [blame] | 141 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 142 | kqemu="yes" |
| 143 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 144 | ;; |
| 145 | NetBSD) |
| 146 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 147 | oss="yes" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 148 | ;; |
| 149 | OpenBSD) |
| 150 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 151 | oss="yes" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 152 | ;; |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 153 | Darwin) |
| 154 | bsd="yes" |
| 155 | darwin="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 156 | darwin_user="yes" |
ths | fd67764 | 2007-01-31 12:10:07 +0000 | [diff] [blame] | 157 | cocoa="yes" |
| 158 | coreaudio="yes" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 159 | OS_CFLAGS="-mdynamic-no-pic" |
ths | c2c59c3 | 2008-01-08 00:00:20 +0000 | [diff] [blame] | 160 | OS_LDFLAGS="-framework CoreFoundation -framework IOKit" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 161 | ;; |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 162 | SunOS) |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 163 | solaris="yes" |
| 164 | make="gmake" |
| 165 | install="ginstall" |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 166 | needs_libsunmath="no" |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 167 | solarisrev=`uname -r | cut -f2 -d.` |
ths | ef18c88 | 2007-09-16 22:12:39 +0000 | [diff] [blame] | 168 | # have to select again, because `uname -m` returns i86pc |
| 169 | # even on an x86_64 box. |
| 170 | solariscpu=`isainfo -k` |
| 171 | if test "${solariscpu}" = "amd64" ; then |
| 172 | cpu="x86_64" |
| 173 | fi |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 174 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 175 | if test "$solarisrev" -le 9 ; then |
| 176 | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then |
| 177 | needs_libsunmath="yes" |
| 178 | else |
| 179 | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" |
| 180 | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" |
| 181 | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" |
| 182 | echo "Studio 11 can be downloaded from www.sun.com." |
| 183 | exit 1 |
| 184 | fi |
| 185 | fi |
| 186 | if test "$solarisrev" -ge 9 ; then |
ths | c2b84fa | 2007-02-10 23:21:21 +0000 | [diff] [blame] | 187 | kqemu="yes" |
| 188 | fi |
ths | 86b2bd9 | 2007-02-11 00:31:33 +0000 | [diff] [blame] | 189 | fi |
ths | 6b4d2ba | 2007-05-13 18:02:43 +0000 | [diff] [blame] | 190 | if test -f /usr/include/sys/soundcard.h ; then |
| 191 | oss=yes |
| 192 | fi |
ths | 86b2bd9 | 2007-02-11 00:31:33 +0000 | [diff] [blame] | 193 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 194 | *) |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 195 | oss="yes" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 196 | linux="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 197 | linux_user="yes" |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 198 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 199 | kqemu="yes" |
| 200 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 201 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 202 | esac |
| 203 | |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 204 | if [ "$bsd" = "yes" ] ; then |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 205 | if [ "$darwin" != "yes" ] ; then |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 206 | make="gmake" |
| 207 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 208 | fi |
| 209 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 210 | # find source path |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 211 | source_path=`dirname "$0"` |
balrog | 59faef3 | 2008-02-03 04:22:24 +0000 | [diff] [blame] | 212 | source_path_used="no" |
| 213 | workdir=`pwd` |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 214 | if [ -z "$source_path" ]; then |
balrog | 59faef3 | 2008-02-03 04:22:24 +0000 | [diff] [blame] | 215 | source_path=$workdir |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 216 | else |
| 217 | source_path=`cd "$source_path"; pwd` |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 218 | fi |
pbrook | 724db11 | 2008-02-03 19:20:13 +0000 | [diff] [blame] | 219 | [ -f "$workdir/vl.c" ] || source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 220 | |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 221 | werror="no" |
bellard | 0d1e239 | 2007-11-11 20:24:30 +0000 | [diff] [blame] | 222 | # generate compile errors on warnings for development builds |
| 223 | #if grep cvs $source_path/VERSION > /dev/null 2>&1 ; then |
| 224 | #werror="yes"; |
| 225 | #fi |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 226 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 227 | for opt do |
pbrook | a46e403 | 2006-04-29 23:05:22 +0000 | [diff] [blame] | 228 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 229 | case "$opt" in |
bellard | 2efc326 | 2005-12-18 19:14:49 +0000 | [diff] [blame] | 230 | --help|-h) show_help=yes |
| 231 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 232 | --prefix=*) prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 233 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 234 | --interp-prefix=*) interp_prefix="$optarg" |
bellard | 32ce633 | 2003-04-11 00:16:16 +0000 | [diff] [blame] | 235 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 236 | --source-path=*) source_path="$optarg" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 237 | source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 238 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 239 | --cross-prefix=*) cross_prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 240 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 241 | --cc=*) cc="$optarg" |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 242 | gcc3_search="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 243 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 244 | --host-cc=*) host_cc="$optarg" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 245 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 246 | --make=*) make="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 247 | ;; |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 248 | --install=*) install="$optarg" |
| 249 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 250 | --extra-cflags=*) CFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 251 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 252 | --extra-ldflags=*) LDFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 253 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 254 | --cpu=*) cpu="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 255 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 256 | --target-list=*) target_list="$optarg" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 257 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 258 | --enable-gprof) gprof="yes" |
| 259 | ;; |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 260 | --static) static="yes" |
| 261 | ;; |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 262 | --disable-sdl) sdl="no" |
| 263 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 264 | --enable-coreaudio) coreaudio="yes" |
| 265 | ;; |
| 266 | --enable-alsa) alsa="yes" |
| 267 | ;; |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 268 | --enable-esd) esd="yes" |
| 269 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 270 | --enable-dsound) dsound="yes" |
| 271 | ;; |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 272 | --enable-fmod) fmod="yes" |
| 273 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 274 | --fmod-lib=*) fmod_lib="$optarg" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 275 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 276 | --fmod-inc=*) fmod_inc="$optarg" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 277 | ;; |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 278 | --disable-vnc-tls) vnc_tls="no" |
| 279 | ;; |
bellard | b93aebe | 2007-02-15 22:58:18 +0000 | [diff] [blame] | 280 | --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 281 | ;; |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 282 | --disable-slirp) slirp="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 283 | ;; |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 284 | --enable-adlib) adlib="yes" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 285 | ;; |
balrog | e5c9a13 | 2008-01-14 04:27:55 +0000 | [diff] [blame] | 286 | --enable-ac97) ac97="yes" |
| 287 | ;; |
balrog | 423d65f | 2008-01-14 22:09:11 +0000 | [diff] [blame] | 288 | --enable-gus) gus="yes" |
| 289 | ;; |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 290 | --disable-kqemu) kqemu="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 291 | ;; |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 292 | --disable-brlapi) brlapi="no" |
| 293 | ;; |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 294 | --enable-profiler) profiler="yes" |
| 295 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 296 | --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" |
| 297 | ;; |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 298 | --disable-gfx-check) check_gfx="no" |
| 299 | ;; |
bellard | 1aff381 | 2005-11-02 22:30:45 +0000 | [diff] [blame] | 300 | --disable-gcc-check) check_gcc="no" |
| 301 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 302 | --disable-system) softmmu="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 303 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 304 | --enable-system) softmmu="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 305 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 306 | --disable-linux-user) linux_user="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 307 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 308 | --enable-linux-user) linux_user="yes" |
| 309 | ;; |
| 310 | --disable-darwin-user) darwin_user="no" |
| 311 | ;; |
| 312 | --enable-darwin-user) darwin_user="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 313 | ;; |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 314 | --enable-uname-release=*) uname_release="$optarg" |
| 315 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 316 | --sparc_cpu=*) |
| 317 | sparc_cpu="$optarg" |
| 318 | case $sparc_cpu in |
| 319 | v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
| 320 | target_cpu="sparc"; cpu="sparc" ;; |
| 321 | v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
| 322 | target_cpu="sparc"; cpu="sparc" ;; |
| 323 | v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64" |
| 324 | target_cpu="sparc64"; cpu="sparc64" ;; |
| 325 | *) echo "undefined SPARC architecture. Exiting";exit 1;; |
| 326 | esac |
| 327 | ;; |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 328 | --enable-werror) werror="yes" |
| 329 | ;; |
| 330 | --disable-werror) werror="no" |
| 331 | ;; |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 332 | --disable-curses) curses="no" |
| 333 | ;; |
balrog | 7f1559c | 2007-11-17 10:24:32 +0000 | [diff] [blame] | 334 | *) echo "ERROR: unknown option $opt"; show_help="yes" |
| 335 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 336 | esac |
| 337 | done |
| 338 | |
ths | 209afb9 | 2007-03-25 20:55:00 +0000 | [diff] [blame] | 339 | if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then |
| 340 | AIOLIBS= |
| 341 | else |
ths | 4259e1a | 2007-11-05 13:27:21 +0000 | [diff] [blame] | 342 | # Some Linux architectures (e.g. s390) don't imply -lpthread automatically. |
| 343 | AIOLIBS="-lrt -lpthread" |
ths | 209afb9 | 2007-03-25 20:55:00 +0000 | [diff] [blame] | 344 | fi |
| 345 | |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 346 | # default flags for all hosts |
| 347 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" |
| 348 | LDFLAGS="$LDFLAGS -g" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 349 | if test "$werror" = "yes" ; then |
| 350 | CFLAGS="$CFLAGS -Werror" |
| 351 | fi |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 352 | |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 353 | # |
| 354 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
| 355 | # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
| 356 | # |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 357 | case "$cpu" in |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 358 | sparc) if test -z "$sparc_cpu" ; then |
| 359 | ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__" |
| 360 | ARCH_LDFLAGS="-m32" |
| 361 | else |
| 362 | ARCH_CFLAGS="${SP_CFLAGS}" |
| 363 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
| 364 | fi |
| 365 | ;; |
| 366 | sparc64) if test -z "$sparc_cpu" ; then |
| 367 | ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__" |
| 368 | ARCH_LDFLAGS="-m64" |
| 369 | else |
| 370 | ARCH_CFLAGS="${SP_CFLAGS}" |
| 371 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
| 372 | fi |
| 373 | ;; |
ths | 76d83bd | 2007-11-18 21:22:10 +0000 | [diff] [blame] | 374 | s390) |
| 375 | ARCH_CFLAGS="-march=z900" |
| 376 | ;; |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 377 | i386) |
| 378 | ARCH_CFLAGS="-m32" |
| 379 | ARCH_LDFLAGS="-m32" |
| 380 | ;; |
| 381 | x86_64) |
| 382 | ARCH_CFLAGS="-m64" |
| 383 | ARCH_LDFLAGS="-m64" |
| 384 | ;; |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 385 | esac |
| 386 | |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 387 | if test x"$show_help" = x"yes" ; then |
| 388 | cat << EOF |
| 389 | |
| 390 | Usage: configure [options] |
| 391 | Options: [defaults in brackets after descriptions] |
| 392 | |
| 393 | EOF |
| 394 | echo "Standard options:" |
| 395 | echo " --help print this message" |
| 396 | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
| 397 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
| 398 | echo " use %M for cpu name [$interp_prefix]" |
| 399 | echo " --target-list=LIST set target list [$target_list]" |
| 400 | echo "" |
| 401 | echo "kqemu kernel acceleration support:" |
| 402 | echo " --disable-kqemu disable kqemu support" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 403 | echo "" |
| 404 | echo "Advanced options (experts only):" |
| 405 | echo " --source-path=PATH path of source code [$source_path]" |
| 406 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
| 407 | echo " --cc=CC use C compiler CC [$cc]" |
| 408 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
| 409 | echo " --make=MAKE use specified make [$make]" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 410 | echo " --install=INSTALL use specified install [$install]" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 411 | echo " --static enable static build [$static]" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 412 | echo " --disable-werror disable compilation abort on warning" |
balrog | fe8f78e | 2007-10-31 01:03:28 +0000 | [diff] [blame] | 413 | echo " --disable-sdl disable SDL" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 414 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
| 415 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
| 416 | echo " --enable-adlib enable Adlib emulation" |
balrog | e5c9a13 | 2008-01-14 04:27:55 +0000 | [diff] [blame] | 417 | echo " --enable-ac97 enable AC97 emulation" |
balrog | 423d65f | 2008-01-14 22:09:11 +0000 | [diff] [blame] | 418 | echo " --enable-gus enable Gravis Ultrasound emulation" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 419 | echo " --enable-coreaudio enable Coreaudio audio driver" |
| 420 | echo " --enable-alsa enable ALSA audio driver" |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 421 | echo " --enable-esd enable EsoundD audio driver" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 422 | echo " --enable-fmod enable FMOD audio driver" |
ths | ed5065e | 2007-03-25 16:15:21 +0000 | [diff] [blame] | 423 | echo " --enable-dsound enable DirectSound audio driver" |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 424 | echo " --disable-brlapi disable BrlAPI" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 425 | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
pbrook | af896aa | 2008-03-23 00:47:42 +0000 | [diff] [blame] | 426 | echo " --disable-curses disable curses output" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 427 | echo " --enable-system enable all system emulation targets" |
| 428 | echo " --disable-system disable all system emulation targets" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 429 | echo " --enable-linux-user enable all linux usermode emulation targets" |
| 430 | echo " --disable-linux-user disable all linux usermode emulation targets" |
| 431 | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
| 432 | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 433 | echo " --fmod-lib path to FMOD library" |
| 434 | echo " --fmod-inc path to FMOD includes" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 435 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 436 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 437 | echo "" |
ths | 5bf0893 | 2006-12-23 00:33:26 +0000 | [diff] [blame] | 438 | 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] | 439 | exit 1 |
| 440 | fi |
| 441 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 442 | cc="${cross_prefix}${cc}" |
| 443 | ar="${cross_prefix}${ar}" |
| 444 | strip="${cross_prefix}${strip}" |
| 445 | |
pbrook | 064aae1 | 2006-05-08 00:51:44 +0000 | [diff] [blame] | 446 | # check that the C compiler works. |
| 447 | cat > $TMPC <<EOF |
| 448 | int main(void) {} |
| 449 | EOF |
| 450 | |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 451 | if $cc $ARCH_CFLAGS -c -o $TMPO $TMPC 2> /dev/null ; then |
pbrook | 064aae1 | 2006-05-08 00:51:44 +0000 | [diff] [blame] | 452 | : C compiler works ok |
| 453 | else |
| 454 | echo "ERROR: \"$cc\" either does not exist or does not work" |
| 455 | exit 1 |
bellard | a7350fa | 2006-04-23 14:35:23 +0000 | [diff] [blame] | 456 | fi |
| 457 | |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 458 | if test "$mingw32" = "yes" ; then |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 459 | linux="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 460 | EXESUF=".exe" |
bellard | 9f059ec | 2004-11-14 18:59:52 +0000 | [diff] [blame] | 461 | oss="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 462 | fi |
| 463 | |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 464 | # Check for gcc4, error if pre-gcc4 |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 465 | if test "$check_gcc" = "yes" ; then |
| 466 | cat > $TMPC <<EOF |
| 467 | #if __GNUC__ < 4 |
| 468 | #error gcc3 |
| 469 | #endif |
| 470 | int main(){return 0;} |
| 471 | EOF |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 472 | if "$cc" $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 473 | echo "WARNING: \"$cc\" looks like gcc 4.x" |
| 474 | found_compat_cc="no" |
| 475 | if test "$gcc3_search" = "yes" ; then |
| 476 | echo "Looking for gcc 3.x" |
| 477 | for compat_cc in $gcc3_list ; do |
balrog | d4af3de | 2007-07-26 20:41:46 +0000 | [diff] [blame] | 478 | if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 479 | echo "Found \"$compat_cc\"" |
pbrook | 1124426 | 2007-02-27 01:03:41 +0000 | [diff] [blame] | 480 | cc="$cross_prefix$compat_cc" |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 481 | found_compat_cc="yes" |
| 482 | break |
| 483 | fi |
| 484 | done |
| 485 | if test "$found_compat_cc" = "no" ; then |
| 486 | echo "gcc 3.x not found!" |
| 487 | fi |
| 488 | fi |
| 489 | if test "$found_compat_cc" = "no" ; then |
| 490 | echo "QEMU is known to have problems when compiled with gcc 4.x" |
| 491 | echo "It is recommended that you use gcc 3.x to build QEMU" |
| 492 | echo "To use this compiler anyway, configure with --disable-gcc-check" |
| 493 | exit 1; |
| 494 | fi |
| 495 | fi |
| 496 | fi |
| 497 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 498 | # |
| 499 | # Solaris specific configure tool chain decisions |
| 500 | # |
| 501 | if test "$solaris" = "yes" ; then |
| 502 | # |
| 503 | # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly |
| 504 | # override the check with --disable-gcc-check |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 505 | # |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 506 | if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then |
| 507 | solgcc=`which $cc` |
| 508 | if test "$solgcc" = "/usr/sfw/bin/gcc" ; then |
| 509 | echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly." |
| 510 | echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3" |
| 511 | echo "or get the latest patch from SunSolve for gcc" |
| 512 | exit 1 |
| 513 | fi |
| 514 | fi |
| 515 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
| 516 | if test -z "$solinst" ; then |
| 517 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
| 518 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
| 519 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
| 520 | exit 1 |
| 521 | fi |
| 522 | if test "$solinst" = "/usr/sbin/install" ; then |
| 523 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
| 524 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
| 525 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
| 526 | exit 1 |
| 527 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 528 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
| 529 | if test -z "$sol_ar" ; then |
| 530 | echo "Error: No path includes ar" |
| 531 | if test -f /usr/ccs/bin/ar ; then |
| 532 | echo "Add /usr/ccs/bin to your path and rerun configure" |
| 533 | fi |
| 534 | exit 1 |
| 535 | fi |
ths | 5fafdf2 | 2007-09-16 21:08:06 +0000 | [diff] [blame] | 536 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 537 | |
| 538 | |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 539 | if test -z "$target_list" ; then |
| 540 | # these targets are portable |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 541 | if [ "$softmmu" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 542 | target_list="\ |
| 543 | i386-softmmu \ |
| 544 | x86_64-softmmu \ |
| 545 | arm-softmmu \ |
| 546 | cris-softmmu \ |
| 547 | m68k-softmmu \ |
| 548 | mips-softmmu \ |
| 549 | mipsel-softmmu \ |
| 550 | mips64-softmmu \ |
| 551 | mips64el-softmmu \ |
| 552 | ppc-softmmu \ |
| 553 | ppcemb-softmmu \ |
| 554 | ppc64-softmmu \ |
| 555 | sh4-softmmu \ |
| 556 | sh4eb-softmmu \ |
| 557 | sparc-softmmu \ |
| 558 | " |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 559 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 560 | # the following are Linux specific |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 561 | if [ "$linux_user" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 562 | target_list="${target_list}\ |
| 563 | i386-linux-user \ |
| 564 | x86_64-linux-user \ |
| 565 | alpha-linux-user \ |
| 566 | arm-linux-user \ |
| 567 | armeb-linux-user \ |
| 568 | cris-linux-user \ |
| 569 | m68k-linux-user \ |
| 570 | mips-linux-user \ |
| 571 | mipsel-linux-user \ |
| 572 | ppc-linux-user \ |
| 573 | ppc64-linux-user \ |
| 574 | ppc64abi32-linux-user \ |
| 575 | sh4-linux-user \ |
| 576 | sh4eb-linux-user \ |
| 577 | sparc-linux-user \ |
| 578 | sparc64-linux-user \ |
| 579 | sparc32plus-linux-user \ |
| 580 | " |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 581 | fi |
| 582 | # the following are Darwin specific |
| 583 | if [ "$darwin_user" = "yes" ] ; then |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 584 | target_list="$target_list i386-darwin-user ppc-darwin-user" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 585 | fi |
bellard | 6e20a45 | 2005-06-05 15:56:02 +0000 | [diff] [blame] | 586 | else |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 587 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 588 | fi |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 589 | if test -z "$target_list" ; then |
| 590 | echo "No targets enabled" |
| 591 | exit 1 |
| 592 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 593 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 594 | if test -z "$cross_prefix" ; then |
| 595 | |
| 596 | # --- |
| 597 | # big/little endian test |
| 598 | cat > $TMPC << EOF |
| 599 | #include <inttypes.h> |
| 600 | int main(int argc, char ** argv){ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 601 | volatile uint32_t i=0x01234567; |
| 602 | return (*((uint8_t*)(&i))) == 0x67; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 603 | } |
| 604 | EOF |
| 605 | |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 606 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 607 | $TMPE && bigendian="yes" |
| 608 | else |
| 609 | echo big/little test failed |
| 610 | fi |
| 611 | |
| 612 | else |
| 613 | |
| 614 | # if cross compiling, cannot launch a program, so make a static guess |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 615 | if test "$cpu" = "armv4b" \ |
aurel32 | f54b3f9 | 2008-04-12 20:14:54 +0000 | [diff] [blame] | 616 | -o "$cpu" = "hppa" \ |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 617 | -o "$cpu" = "m68k" \ |
| 618 | -o "$cpu" = "mips" \ |
| 619 | -o "$cpu" = "mips64" \ |
| 620 | -o "$cpu" = "powerpc" \ |
| 621 | -o "$cpu" = "s390" \ |
| 622 | -o "$cpu" = "sparc" \ |
| 623 | -o "$cpu" = "sparc64"; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 624 | bigendian="yes" |
| 625 | fi |
| 626 | |
| 627 | fi |
| 628 | |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 629 | # host long bits test |
| 630 | hostlongbits="32" |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 631 | if test "$cpu" = "x86_64" \ |
| 632 | -o "$cpu" = "alpha" \ |
| 633 | -o "$cpu" = "ia64" \ |
| 634 | -o "$cpu" = "sparc64"; then |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 635 | hostlongbits="64" |
| 636 | fi |
| 637 | |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 638 | # check gcc options support |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 639 | cat > $TMPC <<EOF |
| 640 | int main(void) { |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 641 | } |
| 642 | EOF |
| 643 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 644 | ########################################## |
| 645 | # SDL probe |
| 646 | |
| 647 | sdl_too_old=no |
| 648 | |
| 649 | if test -z "$sdl" ; then |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 650 | sdl_config="sdl-config" |
| 651 | sdl=no |
| 652 | sdl_static=no |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 653 | |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 654 | if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then |
| 655 | # win32 cross compilation case |
| 656 | sdl_config="i386-mingw32msvc-sdl-config" |
| 657 | sdl=yes |
| 658 | else |
| 659 | # normal SDL probe |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 660 | cat > $TMPC << EOF |
| 661 | #include <SDL.h> |
| 662 | #undef main /* We don't want SDL to override our main() */ |
| 663 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
| 664 | EOF |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 665 | if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 666 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` |
| 667 | if test "$_sdlversion" -lt 121 ; then |
| 668 | sdl_too_old=yes |
| 669 | else |
| 670 | if test "$cocoa" = "no" ; then |
| 671 | sdl=yes |
| 672 | fi |
| 673 | fi |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 674 | |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 675 | # static link with sdl ? |
| 676 | if test "$sdl" = "yes" ; then |
| 677 | aa="no" |
| 678 | `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes" |
| 679 | sdl_static_libs=`$sdl_config --static-libs 2>/dev/null` |
| 680 | if [ "$aa" = "yes" ] ; then |
| 681 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" |
| 682 | fi |
| 683 | |
ths | 8281db4 | 2007-11-18 21:37:07 +0000 | [diff] [blame] | 684 | if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 685 | sdl_static=yes |
| 686 | fi |
| 687 | fi # static link |
| 688 | fi # sdl compile test |
| 689 | fi # cross compilation |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 690 | else |
ths | 069b0bd | 2007-07-12 00:27:15 +0000 | [diff] [blame] | 691 | # Make sure to disable cocoa if sdl was set |
| 692 | if test "$sdl" = "yes" ; then |
| 693 | cocoa="no" |
| 694 | coreaudio="no" |
| 695 | fi |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 696 | fi # -z $sdl |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 697 | |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 698 | ########################################## |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 699 | # VNC TLS detection |
| 700 | if test "$vnc_tls" = "yes" ; then |
| 701 | `pkg-config gnutls` || vnc_tls="no" |
| 702 | fi |
| 703 | if test "$vnc_tls" = "yes" ; then |
| 704 | vnc_tls_cflags=`pkg-config --cflags gnutls` |
| 705 | vnc_tls_libs=`pkg-config --libs gnutls` |
| 706 | fi |
| 707 | |
| 708 | ########################################## |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 709 | # alsa sound support libraries |
| 710 | |
| 711 | if test "$alsa" = "yes" ; then |
| 712 | cat > $TMPC << EOF |
| 713 | #include <alsa/asoundlib.h> |
| 714 | int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); } |
| 715 | EOF |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 716 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lasound 2> /dev/null ; then |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 717 | : |
| 718 | else |
| 719 | echo |
| 720 | echo "Error: Could not find alsa" |
| 721 | echo "Make sure to have the alsa libs and headers installed." |
| 722 | echo |
| 723 | exit 1 |
| 724 | fi |
| 725 | fi |
| 726 | |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 727 | ########################################## |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 728 | # BrlAPI probe |
| 729 | |
| 730 | if test -z "$brlapi" ; then |
| 731 | brlapi=no |
| 732 | cat > $TMPC << EOF |
| 733 | #include <brlapi.h> |
| 734 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
| 735 | EOF |
aurel32 | a40e56d | 2008-05-04 00:50:25 +0000 | [diff] [blame] | 736 | if $cc ${ARCH_CFLAGS} -o $TMPE ${OS_CFLAGS} $TMPC -lbrlapi 2> /dev/null ; then |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 737 | brlapi=yes |
| 738 | fi # brlapi compile test |
| 739 | fi # -z $brlapi |
| 740 | |
| 741 | ########################################## |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 742 | # curses probe |
| 743 | |
| 744 | if test "$curses" = "yes" ; then |
| 745 | curses=no |
| 746 | cat > $TMPC << EOF |
| 747 | #include <curses.h> |
| 748 | int main(void) { return curses_version(); } |
| 749 | EOF |
pbrook | af896aa | 2008-03-23 00:47:42 +0000 | [diff] [blame] | 750 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC -lcurses 2> /dev/null ; then |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 751 | curses=yes |
| 752 | fi |
| 753 | fi # test "$curses" |
| 754 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 755 | # Check if tools are available to build documentation. |
ths | 6c59186 | 2007-05-09 13:55:03 +0000 | [diff] [blame] | 756 | if [ -x "`which texi2html 2>/dev/null`" ] && \ |
| 757 | [ -x "`which pod2man 2>/dev/null`" ]; then |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 758 | build_docs="yes" |
| 759 | fi |
| 760 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 761 | if test "$mingw32" = "yes" ; then |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 762 | if test -z "$prefix" ; then |
| 763 | prefix="/c/Program Files/Qemu" |
| 764 | fi |
| 765 | mansuffix="" |
| 766 | datasuffix="" |
| 767 | docsuffix="" |
| 768 | binsuffix="" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 769 | else |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 770 | if test -z "$prefix" ; then |
| 771 | prefix="/usr/local" |
| 772 | fi |
| 773 | mansuffix="/share/man" |
| 774 | datasuffix="/share/qemu" |
| 775 | docsuffix="/share/doc/qemu" |
| 776 | binsuffix="/bin" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 777 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 778 | |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 779 | echo "Install prefix $prefix" |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 780 | echo "BIOS directory $prefix$datasuffix" |
| 781 | echo "binary directory $prefix$binsuffix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 782 | if test "$mingw32" = "no" ; then |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 783 | echo "Manual directory $prefix$mansuffix" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 784 | echo "ELF interp prefix $interp_prefix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 785 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 786 | echo "Source path $source_path" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 787 | echo "C compiler $cc" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 788 | echo "Host C compiler $host_cc" |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 789 | echo "ARCH_CFLAGS $ARCH_CFLAGS" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 790 | echo "make $make" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 791 | echo "install $install" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 792 | echo "host CPU $cpu" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 793 | echo "host big endian $bigendian" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 794 | echo "target list $target_list" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 795 | echo "gprof enabled $gprof" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 796 | echo "profiler $profiler" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 797 | echo "static build $static" |
bellard | 85aa518 | 2007-11-11 20:17:03 +0000 | [diff] [blame] | 798 | echo "-Werror enabled $werror" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 799 | if test "$darwin" = "yes" ; then |
| 800 | echo "Cocoa support $cocoa" |
| 801 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 802 | echo "SDL support $sdl" |
bellard | e4afee9 | 2005-04-26 20:46:24 +0000 | [diff] [blame] | 803 | if test "$sdl" != "no" ; then |
| 804 | echo "SDL static link $sdl_static" |
| 805 | fi |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 806 | echo "curses support $curses" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 807 | echo "mingw32 support $mingw32" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 808 | echo "Adlib support $adlib" |
balrog | e5c9a13 | 2008-01-14 04:27:55 +0000 | [diff] [blame] | 809 | echo "AC97 support $ac97" |
balrog | 423d65f | 2008-01-14 22:09:11 +0000 | [diff] [blame] | 810 | echo "GUS support $gus" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 811 | echo "CoreAudio support $coreaudio" |
| 812 | echo "ALSA support $alsa" |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 813 | echo "EsounD support $esd" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 814 | echo "DSound support $dsound" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 815 | if test "$fmod" = "yes"; then |
| 816 | if test -z $fmod_lib || test -z $fmod_inc; then |
| 817 | echo |
| 818 | echo "Error: You must specify path to FMOD library and headers" |
| 819 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
| 820 | echo |
| 821 | exit 1 |
| 822 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 823 | fmod_support=" (lib='$fmod_lib' include='$fmod_inc')" |
| 824 | else |
| 825 | fmod_support="" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 826 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 827 | echo "FMOD support $fmod $fmod_support" |
ths | 6b4d2ba | 2007-05-13 18:02:43 +0000 | [diff] [blame] | 828 | echo "OSS support $oss" |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 829 | echo "VNC TLS support $vnc_tls" |
| 830 | if test "$vnc_tls" = "yes" ; then |
| 831 | echo " TLS CFLAGS $vnc_tls_cflags" |
| 832 | echo " TLS LIBS $vnc_tls_libs" |
| 833 | fi |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 834 | if test -n "$sparc_cpu"; then |
| 835 | echo "Target Sparc Arch $sparc_cpu" |
| 836 | fi |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 837 | echo "kqemu support $kqemu" |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 838 | echo "brlapi support $brlapi" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 839 | echo "Documentation $build_docs" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 840 | [ ! -z "$uname_release" ] && \ |
| 841 | echo "uname -r $uname_release" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 842 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 843 | if test $sdl_too_old = "yes"; then |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 844 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 845 | fi |
ths | 20b40c6 | 2007-07-11 23:39:45 +0000 | [diff] [blame] | 846 | if [ -s /tmp/qemu-$$-sdl-config.log ]; then |
| 847 | echo "The error log from compiling the libSDL test is: " |
| 848 | cat /tmp/qemu-$$-sdl-config.log |
| 849 | fi |
| 850 | rm -f /tmp/qemu-$$-sdl-config.log |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 851 | #if test "$sdl_static" = "no"; then |
| 852 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" |
| 853 | #fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 854 | config_mak="config-host.mak" |
| 855 | config_h="config-host.h" |
| 856 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 857 | #echo "Creating $config_mak and $config_h" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 858 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 859 | test -f $config_h && mv $config_h ${config_h}~ |
| 860 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 861 | echo "# Automatically generated by configure - do not modify" > $config_mak |
pbrook | 2951713 | 2006-02-09 17:58:47 +0000 | [diff] [blame] | 862 | echo "# Configured with: $0 $@" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 863 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 864 | |
| 865 | echo "prefix=$prefix" >> $config_mak |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 866 | echo "bindir=\${prefix}$binsuffix" >> $config_mak |
| 867 | echo "mandir=\${prefix}$mansuffix" >> $config_mak |
| 868 | echo "datadir=\${prefix}$datasuffix" >> $config_mak |
ths | 4ad5b06 | 2007-03-03 21:47:02 +0000 | [diff] [blame] | 869 | echo "docdir=\${prefix}$docsuffix" >> $config_mak |
pbrook | 308c359 | 2007-02-27 00:52:01 +0000 | [diff] [blame] | 870 | echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 871 | echo "MAKE=$make" >> $config_mak |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 872 | echo "INSTALL=$install" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 873 | echo "CC=$cc" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 874 | echo "HOST_CC=$host_cc" >> $config_mak |
| 875 | echo "AR=$ar" >> $config_mak |
| 876 | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak |
bellard | 40293e5 | 2008-01-31 11:32:10 +0000 | [diff] [blame] | 877 | # XXX: only use CFLAGS and LDFLAGS ? |
| 878 | # XXX: should export HOST_CFLAGS and HOST_LDFLAGS for cross |
| 879 | # compilation of dyngen tool (useful for win32 build on Linux host) |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 880 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 881 | echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak |
| 882 | echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak |
| 883 | echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 884 | echo "CFLAGS=$CFLAGS" >> $config_mak |
| 885 | echo "LDFLAGS=$LDFLAGS" >> $config_mak |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 886 | echo "EXESUF=$EXESUF" >> $config_mak |
ths | 70956b7 | 2007-03-17 15:00:37 +0000 | [diff] [blame] | 887 | echo "AIOLIBS=$AIOLIBS" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 888 | case "$cpu" in |
| 889 | i386) |
| 890 | echo "ARCH=i386" >> $config_mak |
| 891 | echo "#define HOST_I386 1" >> $config_h |
| 892 | ;; |
| 893 | x86_64) |
| 894 | echo "ARCH=x86_64" >> $config_mak |
| 895 | echo "#define HOST_X86_64 1" >> $config_h |
| 896 | ;; |
| 897 | alpha) |
| 898 | echo "ARCH=alpha" >> $config_mak |
| 899 | echo "#define HOST_ALPHA 1" >> $config_h |
| 900 | ;; |
| 901 | armv4b) |
| 902 | echo "ARCH=arm" >> $config_mak |
| 903 | echo "#define HOST_ARM 1" >> $config_h |
| 904 | ;; |
| 905 | armv4l) |
| 906 | echo "ARCH=arm" >> $config_mak |
| 907 | echo "#define HOST_ARM 1" >> $config_h |
| 908 | ;; |
| 909 | cris) |
| 910 | echo "ARCH=cris" >> $config_mak |
| 911 | echo "#define HOST_CRIS 1" >> $config_h |
| 912 | ;; |
| 913 | hppa) |
| 914 | echo "ARCH=hppa" >> $config_mak |
| 915 | echo "#define HOST_HPPA 1" >> $config_h |
| 916 | ;; |
| 917 | ia64) |
| 918 | echo "ARCH=ia64" >> $config_mak |
| 919 | echo "#define HOST_IA64 1" >> $config_h |
| 920 | ;; |
| 921 | m68k) |
| 922 | echo "ARCH=m68k" >> $config_mak |
| 923 | echo "#define HOST_M68K 1" >> $config_h |
| 924 | ;; |
| 925 | mips) |
| 926 | echo "ARCH=mips" >> $config_mak |
| 927 | echo "#define HOST_MIPS 1" >> $config_h |
| 928 | ;; |
| 929 | mips64) |
| 930 | echo "ARCH=mips64" >> $config_mak |
| 931 | echo "#define HOST_MIPS64 1" >> $config_h |
| 932 | ;; |
| 933 | powerpc) |
| 934 | echo "ARCH=ppc" >> $config_mak |
| 935 | echo "#define HOST_PPC 1" >> $config_h |
| 936 | ;; |
| 937 | s390) |
| 938 | echo "ARCH=s390" >> $config_mak |
| 939 | echo "#define HOST_S390 1" >> $config_h |
| 940 | ;; |
| 941 | sparc) |
| 942 | echo "ARCH=sparc" >> $config_mak |
| 943 | echo "#define HOST_SPARC 1" >> $config_h |
| 944 | ;; |
| 945 | sparc64) |
| 946 | echo "ARCH=sparc64" >> $config_mak |
| 947 | echo "#define HOST_SPARC64 1" >> $config_h |
| 948 | ;; |
| 949 | *) |
| 950 | echo "Unsupported CPU = $cpu" |
| 951 | exit 1 |
| 952 | ;; |
| 953 | esac |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 954 | if test "$bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 955 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
| 956 | echo "#define WORDS_BIGENDIAN 1" >> $config_h |
| 957 | fi |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 958 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 959 | if test "$mingw32" = "yes" ; then |
| 960 | echo "CONFIG_WIN32=yes" >> $config_mak |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 961 | echo "#define CONFIG_WIN32 1" >> $config_h |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 962 | else |
| 963 | cat > $TMPC << EOF |
| 964 | #include <byteswap.h> |
| 965 | int main(void) { return bswap_32(0); } |
| 966 | EOF |
pbrook | db7287e | 2008-02-03 16:27:13 +0000 | [diff] [blame] | 967 | if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then |
pbrook | 210fa55 | 2007-02-27 21:04:49 +0000 | [diff] [blame] | 968 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
| 969 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 970 | fi |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 971 | if test "$darwin" = "yes" ; then |
| 972 | echo "CONFIG_DARWIN=yes" >> $config_mak |
| 973 | echo "#define CONFIG_DARWIN 1" >> $config_h |
| 974 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 975 | if test "$solaris" = "yes" ; then |
| 976 | echo "CONFIG_SOLARIS=yes" >> $config_mak |
bellard | 38cfa06 | 2006-05-01 13:58:07 +0000 | [diff] [blame] | 977 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
ths | 0475a5c | 2007-04-01 18:54:44 +0000 | [diff] [blame] | 978 | if test "$needs_libsunmath" = "yes" ; then |
| 979 | echo "NEEDS_LIBSUNMATH=yes" >> $config_mak |
| 980 | echo "#define NEEDS_LIBSUNMATH 1" >> $config_h |
| 981 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 982 | fi |
blueswir1 | 3142255 | 2007-04-16 18:27:06 +0000 | [diff] [blame] | 983 | if test -n "$sparc_cpu"; then |
| 984 | echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak |
| 985 | echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h |
| 986 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 987 | if test "$gdbstub" = "yes" ; then |
| 988 | echo "CONFIG_GDBSTUB=yes" >> $config_mak |
| 989 | echo "#define CONFIG_GDBSTUB 1" >> $config_h |
| 990 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 991 | if test "$gprof" = "yes" ; then |
| 992 | echo "TARGET_GPROF=yes" >> $config_mak |
| 993 | echo "#define HAVE_GPROF 1" >> $config_h |
| 994 | fi |
| 995 | if test "$static" = "yes" ; then |
| 996 | echo "CONFIG_STATIC=yes" >> $config_mak |
bellard | 5086347 | 2003-10-28 23:04:01 +0000 | [diff] [blame] | 997 | echo "#define CONFIG_STATIC 1" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 998 | fi |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 999 | if test $profiler = "yes" ; then |
| 1000 | echo "#define CONFIG_PROFILER 1" >> $config_h |
| 1001 | fi |
bellard | c20709a | 2004-04-21 23:27:19 +0000 | [diff] [blame] | 1002 | if test "$slirp" = "yes" ; then |
| 1003 | echo "CONFIG_SLIRP=yes" >> $config_mak |
| 1004 | echo "#define CONFIG_SLIRP 1" >> $config_h |
| 1005 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 1006 | if test "$adlib" = "yes" ; then |
| 1007 | echo "CONFIG_ADLIB=yes" >> $config_mak |
| 1008 | echo "#define CONFIG_ADLIB 1" >> $config_h |
| 1009 | fi |
balrog | e5c9a13 | 2008-01-14 04:27:55 +0000 | [diff] [blame] | 1010 | if test "$ac97" = "yes" ; then |
| 1011 | echo "CONFIG_AC97=yes" >> $config_mak |
| 1012 | echo "#define CONFIG_AC97 1" >> $config_h |
| 1013 | fi |
balrog | 423d65f | 2008-01-14 22:09:11 +0000 | [diff] [blame] | 1014 | if test "$gus" = "yes" ; then |
| 1015 | echo "CONFIG_GUS=yes" >> $config_mak |
| 1016 | echo "#define CONFIG_GUS 1" >> $config_h |
| 1017 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 1018 | if test "$oss" = "yes" ; then |
| 1019 | echo "CONFIG_OSS=yes" >> $config_mak |
| 1020 | echo "#define CONFIG_OSS 1" >> $config_h |
| 1021 | fi |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1022 | if test "$coreaudio" = "yes" ; then |
| 1023 | echo "CONFIG_COREAUDIO=yes" >> $config_mak |
| 1024 | echo "#define CONFIG_COREAUDIO 1" >> $config_h |
| 1025 | fi |
| 1026 | if test "$alsa" = "yes" ; then |
| 1027 | echo "CONFIG_ALSA=yes" >> $config_mak |
| 1028 | echo "#define CONFIG_ALSA 1" >> $config_h |
| 1029 | fi |
balrog | ca9cc28 | 2008-01-14 04:24:29 +0000 | [diff] [blame] | 1030 | if test "$esd" = "yes" ; then |
| 1031 | echo "CONFIG_ESD=yes" >> $config_mak |
| 1032 | echo "#define CONFIG_ESD 1" >> $config_h |
| 1033 | fi |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1034 | if test "$dsound" = "yes" ; then |
| 1035 | echo "CONFIG_DSOUND=yes" >> $config_mak |
| 1036 | echo "#define CONFIG_DSOUND 1" >> $config_h |
| 1037 | fi |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 1038 | if test "$fmod" = "yes" ; then |
| 1039 | echo "CONFIG_FMOD=yes" >> $config_mak |
| 1040 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
| 1041 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak |
| 1042 | echo "#define CONFIG_FMOD 1" >> $config_h |
| 1043 | fi |
ths | 8d5d2d4 | 2007-08-25 01:37:51 +0000 | [diff] [blame] | 1044 | if test "$vnc_tls" = "yes" ; then |
| 1045 | echo "CONFIG_VNC_TLS=yes" >> $config_mak |
| 1046 | echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak |
| 1047 | echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak |
| 1048 | echo "#define CONFIG_VNC_TLS 1" >> $config_h |
| 1049 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 1050 | qemu_version=`head $source_path/VERSION` |
| 1051 | echo "VERSION=$qemu_version" >>$config_mak |
pbrook | d4b8f03 | 2006-04-16 13:49:23 +0000 | [diff] [blame] | 1052 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1053 | |
| 1054 | echo "SRC_PATH=$source_path" >> $config_mak |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 1055 | if [ "$source_path_used" = "yes" ]; then |
| 1056 | echo "VPATH=$source_path" >> $config_mak |
| 1057 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1058 | echo "TARGET_DIRS=$target_list" >> $config_mak |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 1059 | if [ "$build_docs" = "yes" ] ; then |
| 1060 | echo "BUILD_DOCS=yes" >> $config_mak |
| 1061 | fi |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1062 | if test "$static" = "yes"; then |
| 1063 | sdl1=$sdl_static |
| 1064 | else |
| 1065 | sdl1=$sdl |
| 1066 | fi |
| 1067 | if test "$sdl1" = "yes" ; then |
| 1068 | echo "#define CONFIG_SDL 1" >> $config_h |
| 1069 | echo "CONFIG_SDL=yes" >> $config_mak |
| 1070 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
| 1071 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak |
| 1072 | else |
| 1073 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak |
| 1074 | fi |
| 1075 | if [ "${aa}" = "yes" ] ; then |
| 1076 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak |
| 1077 | else |
| 1078 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak |
| 1079 | fi |
| 1080 | fi |
| 1081 | if test "$cocoa" = "yes" ; then |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1082 | echo "#define CONFIG_COCOA 1" >> $config_h |
| 1083 | echo "CONFIG_COCOA=yes" >> $config_mak |
| 1084 | fi |
| 1085 | if test "$curses" = "yes" ; then |
| 1086 | echo "#define CONFIG_CURSES 1" >> $config_h |
| 1087 | echo "CONFIG_CURSES=yes" >> $config_mak |
| 1088 | echo "CURSES_LIBS=-lcurses" >> $config_mak |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1089 | fi |
aurel32 | 2e4d9fb | 2008-04-08 06:01:02 +0000 | [diff] [blame] | 1090 | if test "$brlapi" = "yes" ; then |
| 1091 | echo "CONFIG_BRLAPI=yes" >> $config_mak |
| 1092 | echo "#define CONFIG_BRLAPI 1" >> $config_h |
| 1093 | echo "BRLAPI_LIBS=-lbrlapi" >> $config_mak |
| 1094 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1095 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 1096 | # XXX: suppress that |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 1097 | if [ "$bsd" = "yes" ] ; then |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 1098 | echo "#define O_LARGEFILE 0" >> $config_h |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 1099 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 1100 | echo "#define _BSD 1" >> $config_h |
| 1101 | fi |
| 1102 | |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 1103 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
| 1104 | |
pbrook | c39e333 | 2007-09-22 16:49:14 +0000 | [diff] [blame] | 1105 | tools= |
| 1106 | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then |
| 1107 | tools="qemu-img\$(EXESUF) $tools" |
| 1108 | fi |
| 1109 | echo "TOOLS=$tools" >> $config_mak |
| 1110 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1111 | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
| 1112 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1113 | for target in $target_list; do |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1114 | target_dir="$target" |
| 1115 | config_mak=$target_dir/config.mak |
| 1116 | config_h=$target_dir/config.h |
| 1117 | target_cpu=`echo $target | cut -d '-' -f 1` |
| 1118 | target_bigendian="no" |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 1119 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1120 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
| 1121 | [ "$target_cpu" = "mips" ] && target_bigendian=yes |
| 1122 | [ "$target_cpu" = "mipsn32" ] && target_bigendian=yes |
| 1123 | [ "$target_cpu" = "mips64" ] && target_bigendian=yes |
bellard | 6786730 | 2003-11-23 17:05:30 +0000 | [diff] [blame] | 1124 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
j_mayer | d4082e9 | 2007-04-24 07:34:03 +0000 | [diff] [blame] | 1125 | [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes |
j_mayer | 22f8a8b | 2007-10-14 08:38:29 +0000 | [diff] [blame] | 1126 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
j_mayer | e85e7c6 | 2007-10-18 19:59:49 +0000 | [diff] [blame] | 1127 | [ "$target_cpu" = "ppc64abi32" ] && target_bigendian=yes |
pbrook | 908f52b | 2006-06-18 19:16:53 +0000 | [diff] [blame] | 1128 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1129 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
| 1130 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes |
| 1131 | [ "$target_cpu" = "sparc32plus" ] && target_bigendian=yes |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1132 | target_softmmu="no" |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 1133 | target_user_only="no" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1134 | target_linux_user="no" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1135 | target_darwin_user="no" |
pbrook | 9e407a8 | 2007-05-26 16:38:53 +0000 | [diff] [blame] | 1136 | case "$target" in |
| 1137 | ${target_cpu}-softmmu) |
| 1138 | target_softmmu="yes" |
| 1139 | ;; |
| 1140 | ${target_cpu}-linux-user) |
| 1141 | target_user_only="yes" |
| 1142 | target_linux_user="yes" |
| 1143 | ;; |
| 1144 | ${target_cpu}-darwin-user) |
| 1145 | target_user_only="yes" |
| 1146 | target_darwin_user="yes" |
| 1147 | ;; |
| 1148 | *) |
| 1149 | echo "ERROR: Target '$target' not recognised" |
| 1150 | exit 1 |
| 1151 | ;; |
| 1152 | esac |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1153 | |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1154 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 1155 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1156 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
pbrook | 9c03850 | 2006-04-16 15:19:15 +0000 | [diff] [blame] | 1157 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
balrog | 4d3b6f6 | 2008-02-10 16:33:14 +0000 | [diff] [blame] | 1158 | echo "Note that this will disable all output from the virtual graphics card" |
| 1159 | echo "except through VNC or curses." |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 1160 | exit 1; |
| 1161 | fi |
| 1162 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 1163 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1164 | |
ths | 15d9ca0 | 2007-07-31 23:07:32 +0000 | [diff] [blame] | 1165 | test -f $config_h && mv $config_h ${config_h}~ |
| 1166 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1167 | mkdir -p $target_dir |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 1168 | mkdir -p $target_dir/fpu |
bellard | 57fec1f | 2008-02-01 10:50:11 +0000 | [diff] [blame] | 1169 | mkdir -p $target_dir/tcg |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1170 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then |
bellard | 69de927 | 2004-02-16 21:40:43 +0000 | [diff] [blame] | 1171 | mkdir -p $target_dir/nwfpe |
| 1172 | fi |
| 1173 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1174 | # |
| 1175 | # don't use ln -sf as not all "ln -sf" over write the file/link |
| 1176 | # |
| 1177 | rm -f $target_dir/Makefile |
| 1178 | ln -s $source_path/Makefile.target $target_dir/Makefile |
| 1179 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1180 | |
| 1181 | echo "# Automatically generated by configure - do not modify" > $config_mak |
| 1182 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 1183 | |
| 1184 | |
| 1185 | echo "include ../config-host.mak" >> $config_mak |
| 1186 | echo "#include \"../config-host.h\"" >> $config_h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 1187 | |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 1188 | bflt="no" |
blueswir1 | cb33da5 | 2007-10-09 16:34:29 +0000 | [diff] [blame] | 1189 | elfload32="no" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 1190 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
| 1191 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1192 | |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1193 | case "$target_cpu" in |
| 1194 | i386) |
| 1195 | echo "TARGET_ARCH=i386" >> $config_mak |
| 1196 | echo "#define TARGET_ARCH \"i386\"" >> $config_h |
| 1197 | echo "#define TARGET_I386 1" >> $config_h |
| 1198 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" |
| 1199 | then |
| 1200 | echo "#define USE_KQEMU 1" >> $config_h |
| 1201 | fi |
aurel32 | f2bf094 | 2008-05-05 06:00:27 +0000 | [diff] [blame] | 1202 | gcc3minver=`$cc --version 2> /dev/null| fgrep "(GCC) 3." | awk '{ print $3 }' | cut -f2 -d.` |
pbrook | 11d1fdb | 2008-05-23 23:16:42 +0000 | [diff] [blame] | 1203 | if test -n "$gcc3minver" && test $gcc3minver -gt 3 |
aurel32 | f2bf094 | 2008-05-05 06:00:27 +0000 | [diff] [blame] | 1204 | then |
| 1205 | echo "HAVE_GT_GCC_3_3=true" >> $config_mak |
| 1206 | else |
| 1207 | echo "HAVE_GT_GCC_3_3=false" >> $config_mak |
| 1208 | fi |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1209 | ;; |
| 1210 | x86_64) |
| 1211 | echo "TARGET_ARCH=x86_64" >> $config_mak |
| 1212 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h |
| 1213 | echo "#define TARGET_I386 1" >> $config_h |
| 1214 | echo "#define TARGET_X86_64 1" >> $config_h |
| 1215 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" |
| 1216 | then |
| 1217 | echo "#define USE_KQEMU 1" >> $config_h |
| 1218 | fi |
| 1219 | ;; |
| 1220 | alpha) |
| 1221 | echo "TARGET_ARCH=alpha" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1222 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1223 | echo "#define TARGET_ARCH \"alpha\"" >> $config_h |
| 1224 | echo "#define TARGET_ALPHA 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1225 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1226 | ;; |
| 1227 | arm|armeb) |
| 1228 | echo "TARGET_ARCH=arm" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1229 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
| 1230 | echo "#define TARGET_ARM 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1231 | bflt="yes" |
| 1232 | ;; |
| 1233 | cris) |
| 1234 | echo "TARGET_ARCH=cris" >> $config_mak |
| 1235 | echo "#define TARGET_ARCH \"cris\"" >> $config_h |
| 1236 | echo "#define TARGET_CRIS 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1237 | ;; |
| 1238 | m68k) |
| 1239 | echo "TARGET_ARCH=m68k" >> $config_mak |
| 1240 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h |
| 1241 | echo "#define TARGET_M68K 1" >> $config_h |
| 1242 | bflt="yes" |
| 1243 | ;; |
| 1244 | mips|mipsel) |
| 1245 | echo "TARGET_ARCH=mips" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1246 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1247 | echo "#define TARGET_ARCH \"mips\"" >> $config_h |
| 1248 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1249 | echo "#define TARGET_ABI_MIPSO32 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1250 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1251 | ;; |
| 1252 | mipsn32|mipsn32el) |
| 1253 | echo "TARGET_ARCH=mipsn32" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1254 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1255 | echo "#define TARGET_ARCH \"mipsn32\"" >> $config_h |
| 1256 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1257 | echo "#define TARGET_ABI_MIPSN32 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1258 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1259 | ;; |
| 1260 | mips64|mips64el) |
| 1261 | echo "TARGET_ARCH=mips64" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1262 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1263 | echo "#define TARGET_ARCH \"mips64\"" >> $config_h |
| 1264 | echo "#define TARGET_MIPS 1" >> $config_h |
| 1265 | echo "#define TARGET_MIPS64 1" >> $config_h |
| 1266 | echo "#define TARGET_ABI_MIPSN64 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1267 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1268 | ;; |
| 1269 | ppc) |
| 1270 | echo "TARGET_ARCH=ppc" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1271 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1272 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
| 1273 | echo "#define TARGET_PPC 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1274 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1275 | ;; |
| 1276 | ppcemb) |
| 1277 | echo "TARGET_ARCH=ppcemb" >> $config_mak |
| 1278 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1279 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1280 | echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h |
| 1281 | echo "#define TARGET_PPC 1" >> $config_h |
| 1282 | echo "#define TARGET_PPCEMB 1" >> $config_h |
blueswir1 | ec5b78c | 2008-05-10 17:23:18 +0000 | [diff] [blame] | 1283 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1284 | ;; |
| 1285 | ppc64) |
| 1286 | echo "TARGET_ARCH=ppc64" >> $config_mak |
| 1287 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1288 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1289 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
| 1290 | echo "#define TARGET_PPC 1" >> $config_h |
| 1291 | echo "#define TARGET_PPC64 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1292 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1293 | ;; |
| 1294 | ppc64abi32) |
| 1295 | echo "TARGET_ARCH=ppc64" >> $config_mak |
| 1296 | echo "TARGET_ABI_DIR=ppc" >> $config_mak |
| 1297 | echo "TARGET_ARCH2=ppc64abi32" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1298 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1299 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
| 1300 | echo "#define TARGET_PPC 1" >> $config_h |
| 1301 | echo "#define TARGET_PPC64 1" >> $config_h |
| 1302 | echo "#define TARGET_ABI32 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1303 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1304 | ;; |
| 1305 | sh4|sh4eb) |
| 1306 | echo "TARGET_ARCH=sh4" >> $config_mak |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1307 | echo "CONFIG_DYNGEN_OP=yes" >> $config_mak |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1308 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h |
| 1309 | echo "#define TARGET_SH4 1" >> $config_h |
blueswir1 | bf6247f | 2008-05-10 12:27:33 +0000 | [diff] [blame] | 1310 | echo "#define CONFIG_DYNGEN_OP 1" >> $config_h |
aurel32 | 2408a52 | 2008-04-20 20:19:44 +0000 | [diff] [blame] | 1311 | bflt="yes" |
| 1312 | ;; |
| 1313 | sparc) |
| 1314 | echo "TARGET_ARCH=sparc" >> $config_mak |
| 1315 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h |
| 1316 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1317 | ;; |
| 1318 | sparc64) |
| 1319 | echo "TARGET_ARCH=sparc64" >> $config_mak |
| 1320 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
| 1321 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1322 | echo "#define TARGET_SPARC64 1" >> $config_h |
| 1323 | elfload32="yes" |
| 1324 | ;; |
| 1325 | sparc32plus) |
| 1326 | echo "TARGET_ARCH=sparc64" >> $config_mak |
| 1327 | echo "TARGET_ABI_DIR=sparc" >> $config_mak |
| 1328 | echo "TARGET_ARCH2=sparc32plus" >> $config_mak |
| 1329 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
| 1330 | echo "#define TARGET_SPARC 1" >> $config_h |
| 1331 | echo "#define TARGET_SPARC64 1" >> $config_h |
| 1332 | echo "#define TARGET_ABI32 1" >> $config_h |
| 1333 | ;; |
| 1334 | *) |
| 1335 | echo "Unsupported target CPU" |
| 1336 | exit 1 |
| 1337 | ;; |
| 1338 | esac |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1339 | if test "$target_bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1340 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
| 1341 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h |
| 1342 | fi |
| 1343 | if test "$target_softmmu" = "yes" ; then |
| 1344 | echo "CONFIG_SOFTMMU=yes" >> $config_mak |
| 1345 | echo "#define CONFIG_SOFTMMU 1" >> $config_h |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1346 | fi |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 1347 | if test "$target_user_only" = "yes" ; then |
| 1348 | echo "CONFIG_USER_ONLY=yes" >> $config_mak |
| 1349 | echo "#define CONFIG_USER_ONLY 1" >> $config_h |
| 1350 | fi |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame] | 1351 | if test "$target_linux_user" = "yes" ; then |
| 1352 | echo "CONFIG_LINUX_USER=yes" >> $config_mak |
| 1353 | echo "#define CONFIG_LINUX_USER 1" >> $config_h |
| 1354 | fi |
| 1355 | if test "$target_darwin_user" = "yes" ; then |
| 1356 | echo "CONFIG_DARWIN_USER=yes" >> $config_mak |
| 1357 | echo "#define CONFIG_DARWIN_USER 1" >> $config_h |
| 1358 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 1359 | |
aurel32 | 0938cda | 2008-04-11 21:36:06 +0000 | [diff] [blame] | 1360 | if test "$target_cpu" = "arm" \ |
| 1361 | -o "$target_cpu" = "armeb" \ |
| 1362 | -o "$target_cpu" = "m68k" \ |
| 1363 | -o "$target_cpu" = "mips" \ |
| 1364 | -o "$target_cpu" = "mipsel" \ |
| 1365 | -o "$target_cpu" = "mipsn32" \ |
| 1366 | -o "$target_cpu" = "mipsn32el" \ |
| 1367 | -o "$target_cpu" = "mips64" \ |
| 1368 | -o "$target_cpu" = "mips64el" \ |
| 1369 | -o "$target_cpu" = "sparc" \ |
| 1370 | -o "$target_cpu" = "sparc64" \ |
| 1371 | -o "$target_cpu" = "sparc32plus"; then |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 1372 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
| 1373 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
| 1374 | fi |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 1375 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
| 1376 | echo "TARGET_HAS_BFLT=yes" >> $config_mak |
| 1377 | echo "#define TARGET_HAS_BFLT 1" >> $config_h |
| 1378 | fi |
blueswir1 | cb33da5 | 2007-10-09 16:34:29 +0000 | [diff] [blame] | 1379 | # 32 bit ELF loader in addition to native 64 bit loader? |
| 1380 | if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then |
| 1381 | echo "TARGET_HAS_ELFLOAD32=yes" >> $config_mak |
| 1382 | echo "#define TARGET_HAS_ELFLOAD32 1" >> $config_h |
| 1383 | fi |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 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 | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1387 | done # for target in $targets |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1388 | |
| 1389 | # build tree in object directory if source path is different from current one |
| 1390 | if test "$source_path_used" = "yes" ; then |
bellard | 49ecc3f | 2007-11-07 19:25:15 +0000 | [diff] [blame] | 1391 | DIRS="tests tests/cris slirp audio" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1392 | FILES="Makefile tests/Makefile" |
ths | e7daa60 | 2007-10-08 13:38:27 +0000 | [diff] [blame] | 1393 | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
edgar_igl | e1ffb0f | 2008-03-01 22:23:17 +0000 | [diff] [blame] | 1394 | FILES="$FILES tests/test-mmap.c" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1395 | for dir in $DIRS ; do |
| 1396 | mkdir -p $dir |
| 1397 | done |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1398 | # 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] | 1399 | for f in $FILES ; do |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 1400 | rm -f $f |
| 1401 | ln -s $source_path/$f $f |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1402 | done |
| 1403 | fi |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 1404 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 1405 | rm -f $TMPO $TMPC $TMPE $TMPS |