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" |
| 26 | gcc3_list="gcc-3.4 gcc34 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 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 38 | armv*b) |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 39 | cpu="armv4b" |
| 40 | ;; |
bellard | ba68055 | 2005-03-13 09:49:52 +0000 | [diff] [blame] | 41 | armv*l) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 42 | cpu="armv4l" |
| 43 | ;; |
| 44 | alpha) |
| 45 | cpu="alpha" |
| 46 | ;; |
bellard | 295defa | 2003-04-07 21:31:29 +0000 | [diff] [blame] | 47 | "Power Macintosh"|ppc|ppc64) |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 48 | cpu="powerpc" |
| 49 | ;; |
| 50 | mips) |
| 51 | cpu="mips" |
| 52 | ;; |
bellard | fb3e584 | 2003-03-29 17:32:36 +0000 | [diff] [blame] | 53 | s390) |
| 54 | cpu="s390" |
| 55 | ;; |
pbrook | 94ac515 | 2006-04-26 16:07:35 +0000 | [diff] [blame] | 56 | sparc|sun4[muv]) |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 57 | cpu="sparc" |
| 58 | ;; |
| 59 | sparc64) |
| 60 | cpu="sparc64" |
| 61 | ;; |
bellard | a8baa8c | 2003-04-29 20:53:31 +0000 | [diff] [blame] | 62 | ia64) |
| 63 | cpu="ia64" |
| 64 | ;; |
bellard | 38e584a | 2003-08-10 22:14:22 +0000 | [diff] [blame] | 65 | m68k) |
| 66 | cpu="m68k" |
| 67 | ;; |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 68 | x86_64|amd64) |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 69 | cpu="x86_64" |
bellard | bc51c5c | 2004-03-17 23:46:04 +0000 | [diff] [blame] | 70 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 71 | *) |
| 72 | cpu="unknown" |
| 73 | ;; |
| 74 | esac |
| 75 | gprof="no" |
| 76 | bigendian="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 77 | mingw32="no" |
| 78 | EXESUF="" |
| 79 | gdbstub="yes" |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 80 | slirp="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 81 | adlib="no" |
| 82 | oss="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 83 | dsound="no" |
| 84 | coreaudio="no" |
| 85 | alsa="no" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 86 | fmod="no" |
| 87 | fmod_lib="" |
| 88 | fmod_inc="" |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 89 | bsd="no" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 90 | linux="no" |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 91 | kqemu="no" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 92 | profiler="no" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 93 | cocoa="no" |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 94 | check_gfx="yes" |
bellard | 1aff381 | 2005-11-02 22:30:45 +0000 | [diff] [blame] | 95 | check_gcc="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 96 | softmmu="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 97 | linux_user="no" |
| 98 | darwin_user="no" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 99 | build_docs="no" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 100 | uname_release="" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 101 | |
| 102 | # OS specific |
| 103 | targetos=`uname -s` |
| 104 | case $targetos in |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 105 | CYGWIN*) |
| 106 | mingw32="yes" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 107 | OS_CFLAGS="-mno-cygwin" |
bellard | c326e0a | 2005-04-23 18:30:28 +0000 | [diff] [blame] | 108 | ;; |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 109 | MINGW32*) |
| 110 | mingw32="yes" |
| 111 | ;; |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 112 | FreeBSD) |
| 113 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 114 | oss="yes" |
bellard | e99f906 | 2005-07-28 21:45:38 +0000 | [diff] [blame] | 115 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 116 | kqemu="yes" |
| 117 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 118 | ;; |
| 119 | NetBSD) |
| 120 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 121 | oss="yes" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 122 | ;; |
| 123 | OpenBSD) |
| 124 | bsd="yes" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 125 | oss="yes" |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 126 | ;; |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 127 | Darwin) |
| 128 | bsd="yes" |
| 129 | darwin="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 130 | darwin_user="yes" |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 131 | OS_CFLAGS="-mdynamic-no-pic" |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 132 | ;; |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 133 | SunOS) |
| 134 | solaris="yes" |
| 135 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 136 | *) |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 137 | oss="yes" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 138 | linux="yes" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 139 | linux_user="yes" |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 140 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 141 | kqemu="yes" |
| 142 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 143 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 144 | esac |
| 145 | |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 146 | if [ "$bsd" = "yes" ] ; then |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 147 | if [ "$darwin" != "yes" ] ; then |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 148 | make="gmake" |
| 149 | fi |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 150 | fi |
| 151 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 152 | if [ "$solaris" = "yes" ] ; then |
| 153 | make="gmake" |
| 154 | install="ginstall" |
| 155 | solarisrev=`uname -r | cut -f2 -d.` |
ths | 605686c | 2007-01-17 23:31:19 +0000 | [diff] [blame] | 156 | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
| 157 | if test "$solarisrev" -gt 10 ; then |
| 158 | kqemu="yes" |
| 159 | fi |
| 160 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 161 | fi |
| 162 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 163 | # find source path |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 164 | source_path=`dirname "$0"` |
| 165 | if [ -z "$source_path" ]; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 166 | source_path=`pwd` |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 167 | else |
| 168 | source_path=`cd "$source_path"; pwd` |
| 169 | fi |
| 170 | if test "$source_path" = `pwd` ; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 171 | source_path_used="no" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 172 | else |
| 173 | source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 174 | fi |
| 175 | |
| 176 | for opt do |
pbrook | a46e403 | 2006-04-29 23:05:22 +0000 | [diff] [blame] | 177 | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 178 | case "$opt" in |
bellard | 2efc326 | 2005-12-18 19:14:49 +0000 | [diff] [blame] | 179 | --help|-h) show_help=yes |
| 180 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 181 | --prefix=*) prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 182 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 183 | --interp-prefix=*) interp_prefix="$optarg" |
bellard | 32ce633 | 2003-04-11 00:16:16 +0000 | [diff] [blame] | 184 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 185 | --source-path=*) source_path="$optarg" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 186 | source_path_used="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 187 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 188 | --cross-prefix=*) cross_prefix="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 189 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 190 | --cc=*) cc="$optarg" |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 191 | gcc3_search="no" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 192 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 193 | --host-cc=*) host_cc="$optarg" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 194 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 195 | --make=*) make="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 196 | ;; |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 197 | --install=*) install="$optarg" |
| 198 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 199 | --extra-cflags=*) CFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 200 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 201 | --extra-ldflags=*) LDFLAGS="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 202 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 203 | --cpu=*) cpu="$optarg" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 204 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 205 | --target-list=*) target_list="$optarg" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 206 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 207 | --enable-gprof) gprof="yes" |
| 208 | ;; |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 209 | --static) static="yes" |
| 210 | ;; |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 211 | --disable-sdl) sdl="no" |
| 212 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 213 | --enable-coreaudio) coreaudio="yes" |
| 214 | ;; |
| 215 | --enable-alsa) alsa="yes" |
| 216 | ;; |
| 217 | --enable-dsound) dsound="yes" |
| 218 | ;; |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 219 | --enable-fmod) fmod="yes" |
| 220 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 221 | --fmod-lib=*) fmod_lib="$optarg" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 222 | ;; |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 223 | --fmod-inc=*) fmod_inc="$optarg" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 224 | ;; |
bellard | 87ac542 | 2006-06-25 17:35:56 +0000 | [diff] [blame] | 225 | --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 226 | ;; |
bellard | 443f137 | 2004-06-04 11:13:20 +0000 | [diff] [blame] | 227 | --disable-slirp) slirp="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 228 | ;; |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 229 | --enable-adlib) adlib="yes" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 230 | ;; |
bellard | c9ec1fe | 2005-02-10 21:55:30 +0000 | [diff] [blame] | 231 | --disable-kqemu) kqemu="no" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 232 | ;; |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 233 | --enable-profiler) profiler="yes" |
| 234 | ;; |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 235 | --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" |
| 236 | ;; |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 237 | --disable-gfx-check) check_gfx="no" |
| 238 | ;; |
bellard | 1aff381 | 2005-11-02 22:30:45 +0000 | [diff] [blame] | 239 | --disable-gcc-check) check_gcc="no" |
| 240 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 241 | --disable-system) softmmu="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 242 | ;; |
pbrook | cad25d6 | 2006-03-19 16:31:11 +0000 | [diff] [blame] | 243 | --enable-system) softmmu="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 244 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 245 | --disable-linux-user) linux_user="no" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 246 | ;; |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 247 | --enable-linux-user) linux_user="yes" |
| 248 | ;; |
| 249 | --disable-darwin-user) darwin_user="no" |
| 250 | ;; |
| 251 | --enable-darwin-user) darwin_user="yes" |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 252 | ;; |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 253 | --enable-uname-release=*) uname_release="$optarg" |
| 254 | ;; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 255 | esac |
| 256 | done |
| 257 | |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 258 | # default flags for all hosts |
| 259 | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" |
| 260 | LDFLAGS="$LDFLAGS -g" |
| 261 | |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 262 | if test x"$show_help" = x"yes" ; then |
| 263 | cat << EOF |
| 264 | |
| 265 | Usage: configure [options] |
| 266 | Options: [defaults in brackets after descriptions] |
| 267 | |
| 268 | EOF |
| 269 | echo "Standard options:" |
| 270 | echo " --help print this message" |
| 271 | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
| 272 | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
| 273 | echo " use %M for cpu name [$interp_prefix]" |
| 274 | echo " --target-list=LIST set target list [$target_list]" |
| 275 | echo "" |
| 276 | echo "kqemu kernel acceleration support:" |
| 277 | echo " --disable-kqemu disable kqemu support" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 278 | echo "" |
| 279 | echo "Advanced options (experts only):" |
| 280 | echo " --source-path=PATH path of source code [$source_path]" |
| 281 | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
| 282 | echo " --cc=CC use C compiler CC [$cc]" |
| 283 | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
| 284 | echo " --make=MAKE use specified make [$make]" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 285 | echo " --install=INSTALL use specified install [$install]" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 286 | echo " --static enable static build [$static]" |
| 287 | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
| 288 | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
| 289 | echo " --enable-adlib enable Adlib emulation" |
| 290 | echo " --enable-coreaudio enable Coreaudio audio driver" |
| 291 | echo " --enable-alsa enable ALSA audio driver" |
| 292 | echo " --enable-fmod enable FMOD audio driver" |
| 293 | echo " --enabled-dsound enable DirectSound audio driver" |
| 294 | echo " --enable-system enable all system emulation targets" |
| 295 | echo " --disable-system disable all system emulation targets" |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 296 | echo " --enable-linux-user enable all linux usermode emulation targets" |
| 297 | echo " --disable-linux-user disable all linux usermode emulation targets" |
| 298 | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
| 299 | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 300 | echo " --fmod-lib path to FMOD library" |
| 301 | echo " --fmod-inc path to FMOD includes" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 302 | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
pbrook | af5db58 | 2006-04-08 14:26:41 +0000 | [diff] [blame] | 303 | echo "" |
ths | 5bf0893 | 2006-12-23 00:33:26 +0000 | [diff] [blame] | 304 | 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] | 305 | exit 1 |
| 306 | fi |
| 307 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 308 | cc="${cross_prefix}${cc}" |
| 309 | ar="${cross_prefix}${ar}" |
| 310 | strip="${cross_prefix}${strip}" |
| 311 | |
pbrook | 064aae1 | 2006-05-08 00:51:44 +0000 | [diff] [blame] | 312 | # check that the C compiler works. |
| 313 | cat > $TMPC <<EOF |
| 314 | int main(void) {} |
| 315 | EOF |
| 316 | |
| 317 | if $cc -c -o $TMPO $TMPC 2>/dev/null ; then |
| 318 | : C compiler works ok |
| 319 | else |
| 320 | echo "ERROR: \"$cc\" either does not exist or does not work" |
| 321 | exit 1 |
bellard | a7350fa | 2006-04-23 14:35:23 +0000 | [diff] [blame] | 322 | fi |
| 323 | |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 324 | if test "$mingw32" = "yes" ; then |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 325 | linux="no" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 326 | EXESUF=".exe" |
bellard | 9f059ec | 2004-11-14 18:59:52 +0000 | [diff] [blame] | 327 | oss="no" |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 328 | if [ "$cpu" = "i386" ] ; then |
| 329 | kqemu="yes" |
| 330 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 331 | fi |
| 332 | |
pbrook | 328a424 | 2006-12-19 03:31:34 +0000 | [diff] [blame] | 333 | # Check for gcc4, error if pre-gcc4 |
| 334 | if test "$check_gcc" = "yes" ; then |
| 335 | cat > $TMPC <<EOF |
| 336 | #if __GNUC__ < 4 |
| 337 | #error gcc3 |
| 338 | #endif |
| 339 | int main(){return 0;} |
| 340 | EOF |
| 341 | check_cc() { |
| 342 | which "$1" >&/dev/null |
| 343 | return $? |
| 344 | } |
| 345 | |
| 346 | if "$cc" -o $TMPE $TMPC 2>/dev/null ; then |
| 347 | echo "WARNING: \"$cc\" looks like gcc 4.x" |
| 348 | found_compat_cc="no" |
| 349 | if test "$gcc3_search" = "yes" ; then |
| 350 | echo "Looking for gcc 3.x" |
| 351 | for compat_cc in $gcc3_list ; do |
| 352 | if check_cc "$compat_cc" ; then |
| 353 | echo "Found \"$compat_cc\"" |
| 354 | cc="$compat_cc" |
| 355 | found_compat_cc="yes" |
| 356 | break |
| 357 | fi |
| 358 | done |
| 359 | if test "$found_compat_cc" = "no" ; then |
| 360 | echo "gcc 3.x not found!" |
| 361 | fi |
| 362 | fi |
| 363 | if test "$found_compat_cc" = "no" ; then |
| 364 | echo "QEMU is known to have problems when compiled with gcc 4.x" |
| 365 | echo "It is recommended that you use gcc 3.x to build QEMU" |
| 366 | echo "To use this compiler anyway, configure with --disable-gcc-check" |
| 367 | exit 1; |
| 368 | fi |
| 369 | fi |
| 370 | fi |
| 371 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 372 | # |
| 373 | # Solaris specific configure tool chain decisions |
| 374 | # |
| 375 | if test "$solaris" = "yes" ; then |
| 376 | # |
| 377 | # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly |
| 378 | # override the check with --disable-gcc-check |
| 379 | # |
| 380 | if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then |
| 381 | solgcc=`which $cc` |
| 382 | if test "$solgcc" = "/usr/sfw/bin/gcc" ; then |
| 383 | echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly." |
| 384 | echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3" |
| 385 | echo "or get the latest patch from SunSolve for gcc" |
| 386 | exit 1 |
| 387 | fi |
| 388 | fi |
| 389 | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
| 390 | if test -z "$solinst" ; then |
| 391 | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
| 392 | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
| 393 | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
| 394 | exit 1 |
| 395 | fi |
| 396 | if test "$solinst" = "/usr/sbin/install" ; then |
| 397 | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
| 398 | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
| 399 | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
| 400 | exit 1 |
| 401 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 402 | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
| 403 | if test -z "$sol_ar" ; then |
| 404 | echo "Error: No path includes ar" |
| 405 | if test -f /usr/ccs/bin/ar ; then |
| 406 | echo "Add /usr/ccs/bin to your path and rerun configure" |
| 407 | fi |
| 408 | exit 1 |
| 409 | fi |
| 410 | fi |
| 411 | |
| 412 | |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 413 | if test -z "$target_list" ; then |
| 414 | # these targets are portable |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 415 | if [ "$softmmu" = "yes" ] ; then |
| 416 | target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu arm-softmmu" |
| 417 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 418 | # the following are Linux specific |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 419 | if [ "$linux_user" = "yes" ] ; then |
| 420 | target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user $target_list" |
| 421 | fi |
| 422 | # the following are Darwin specific |
| 423 | if [ "$darwin_user" = "yes" ] ; then |
| 424 | target_list="i386-darwin-user ppc-darwin-user $target_list" |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 425 | fi |
bellard | 6e20a45 | 2005-06-05 15:56:02 +0000 | [diff] [blame] | 426 | else |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 427 | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 428 | fi |
pbrook | 0a8e90f | 2006-03-19 14:54:16 +0000 | [diff] [blame] | 429 | if test -z "$target_list" ; then |
| 430 | echo "No targets enabled" |
| 431 | exit 1 |
| 432 | fi |
bellard | 5327cf4 | 2005-01-10 23:18:50 +0000 | [diff] [blame] | 433 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 434 | if test -z "$cross_prefix" ; then |
| 435 | |
| 436 | # --- |
| 437 | # big/little endian test |
| 438 | cat > $TMPC << EOF |
| 439 | #include <inttypes.h> |
| 440 | int main(int argc, char ** argv){ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 441 | volatile uint32_t i=0x01234567; |
| 442 | return (*((uint8_t*)(&i))) == 0x67; |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 443 | } |
| 444 | EOF |
| 445 | |
| 446 | if $cc -o $TMPE $TMPC 2>/dev/null ; then |
| 447 | $TMPE && bigendian="yes" |
| 448 | else |
| 449 | echo big/little test failed |
| 450 | fi |
| 451 | |
| 452 | else |
| 453 | |
| 454 | # if cross compiling, cannot launch a program, so make a static guess |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 455 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 456 | bigendian="yes" |
| 457 | fi |
| 458 | |
| 459 | fi |
| 460 | |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 461 | # host long bits test |
| 462 | hostlongbits="32" |
| 463 | if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then |
| 464 | hostlongbits="64" |
| 465 | fi |
| 466 | |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 467 | # check gcc options support |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 468 | cat > $TMPC <<EOF |
| 469 | int main(void) { |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 470 | } |
| 471 | EOF |
| 472 | |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 473 | have_gcc3_options="no" |
| 474 | if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then |
| 475 | have_gcc3_options="yes" |
bellard | 04369ff | 2003-03-20 22:33:23 +0000 | [diff] [blame] | 476 | fi |
bellard | ca73520 | 2003-03-18 20:41:34 +0000 | [diff] [blame] | 477 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 478 | ########################################## |
| 479 | # SDL probe |
| 480 | |
| 481 | sdl_too_old=no |
| 482 | |
| 483 | if test -z "$sdl" ; then |
| 484 | |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 485 | sdl_config="sdl-config" |
| 486 | sdl=no |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 487 | sdl_static=no |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 488 | |
| 489 | if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then |
| 490 | # win32 cross compilation case |
| 491 | sdl_config="i386-mingw32msvc-sdl-config" |
| 492 | sdl=yes |
| 493 | else |
| 494 | # normal SDL probe |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 495 | cat > $TMPC << EOF |
| 496 | #include <SDL.h> |
| 497 | #undef main /* We don't want SDL to override our main() */ |
| 498 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
| 499 | EOF |
| 500 | |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 501 | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then |
| 502 | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 503 | if test "$_sdlversion" -lt 121 ; then |
| 504 | sdl_too_old=yes |
| 505 | else |
| 506 | sdl=yes |
| 507 | fi |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 508 | |
| 509 | # static link with sdl ? |
| 510 | if test "$sdl" = "yes" ; then |
| 511 | aa="no" |
| 512 | `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes" |
| 513 | sdl_static_libs=`$sdl_config --static-libs` |
| 514 | if [ "$aa" = "yes" ] ; then |
bellard | d8d8aa4 | 2004-04-29 20:14:07 +0000 | [diff] [blame] | 515 | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 516 | fi |
| 517 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 518 | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then |
| 519 | sdl_static=yes |
| 520 | fi |
| 521 | |
| 522 | fi # static link |
| 523 | |
| 524 | fi # sdl compile test |
| 525 | |
bellard | a6e022a | 2004-04-02 21:55:47 +0000 | [diff] [blame] | 526 | fi # cross compilation |
| 527 | fi # -z $sdl |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 528 | |
ths | 8f28f3f | 2007-01-05 21:25:54 +0000 | [diff] [blame] | 529 | ########################################## |
| 530 | # alsa sound support libraries |
| 531 | |
| 532 | if test "$alsa" = "yes" ; then |
| 533 | cat > $TMPC << EOF |
| 534 | #include <alsa/asoundlib.h> |
| 535 | int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); } |
| 536 | EOF |
| 537 | if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then |
| 538 | : |
| 539 | else |
| 540 | echo |
| 541 | echo "Error: Could not find alsa" |
| 542 | echo "Make sure to have the alsa libs and headers installed." |
| 543 | echo |
| 544 | exit 1 |
| 545 | fi |
| 546 | fi |
| 547 | |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 548 | # Check if tools are available to build documentation. |
pbrook | 94ac515 | 2006-04-26 16:07:35 +0000 | [diff] [blame] | 549 | if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 550 | build_docs="yes" |
| 551 | fi |
| 552 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 553 | if test "$mingw32" = "yes" ; then |
| 554 | if test -z "$prefix" ; then |
| 555 | prefix="/c/Program Files/Qemu" |
| 556 | fi |
| 557 | mandir="$prefix" |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 558 | datadir="$prefix" |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 559 | docdir="$prefix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 560 | bindir="$prefix" |
| 561 | else |
| 562 | if test -z "$prefix" ; then |
| 563 | prefix="/usr/local" |
| 564 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 565 | mandir="$prefix/share/man" |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 566 | datadir="$prefix/share/qemu" |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 567 | docdir="$prefix/share/doc/qemu" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 568 | bindir="$prefix/bin" |
| 569 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 570 | |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 571 | echo "Install prefix $prefix" |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 572 | echo "BIOS directory $datadir" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 573 | echo "binary directory $bindir" |
| 574 | if test "$mingw32" = "no" ; then |
| 575 | echo "Manual directory $mandir" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 576 | echo "ELF interp prefix $interp_prefix" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 577 | fi |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 578 | echo "Source path $source_path" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 579 | echo "C compiler $cc" |
bellard | 8346901 | 2005-07-23 14:27:54 +0000 | [diff] [blame] | 580 | echo "Host C compiler $host_cc" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 581 | echo "make $make" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 582 | echo "install $install" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 583 | echo "host CPU $cpu" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 584 | echo "host big endian $bigendian" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 585 | echo "target list $target_list" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 586 | echo "gprof enabled $gprof" |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 587 | echo "profiler $profiler" |
bellard | 43ce4df | 2003-06-09 19:53:12 +0000 | [diff] [blame] | 588 | echo "static build $static" |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 589 | if test "$darwin" = "yes" ; then |
| 590 | echo "Cocoa support $cocoa" |
| 591 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 592 | echo "SDL support $sdl" |
bellard | e4afee9 | 2005-04-26 20:46:24 +0000 | [diff] [blame] | 593 | if test "$sdl" != "no" ; then |
| 594 | echo "SDL static link $sdl_static" |
| 595 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 596 | echo "mingw32 support $mingw32" |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 597 | echo "Adlib support $adlib" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 598 | echo "CoreAudio support $coreaudio" |
| 599 | echo "ALSA support $alsa" |
| 600 | echo "DSound support $dsound" |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 601 | if test "$fmod" = "yes"; then |
| 602 | if test -z $fmod_lib || test -z $fmod_inc; then |
| 603 | echo |
| 604 | echo "Error: You must specify path to FMOD library and headers" |
| 605 | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
| 606 | echo |
| 607 | exit 1 |
| 608 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 609 | fmod_support=" (lib='$fmod_lib' include='$fmod_inc')" |
| 610 | else |
| 611 | fmod_support="" |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 612 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 613 | echo "FMOD support $fmod $fmod_support" |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 614 | echo "kqemu support $kqemu" |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 615 | echo "Documentation $build_docs" |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 616 | [ ! -z "$uname_release" ] && \ |
| 617 | echo "uname -r $uname_release" |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 618 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 619 | if test $sdl_too_old = "yes"; then |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 620 | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
bellard | e8cd23d | 2003-06-25 16:08:13 +0000 | [diff] [blame] | 621 | fi |
bellard | 24b55b9 | 2005-03-01 22:30:41 +0000 | [diff] [blame] | 622 | #if test "$sdl_static" = "no"; then |
| 623 | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" |
| 624 | #fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 625 | config_mak="config-host.mak" |
| 626 | config_h="config-host.h" |
| 627 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 628 | #echo "Creating $config_mak and $config_h" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 629 | |
| 630 | echo "# Automatically generated by configure - do not modify" > $config_mak |
pbrook | 2951713 | 2006-02-09 17:58:47 +0000 | [diff] [blame] | 631 | echo "# Configured with: $0 $@" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 632 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 633 | |
| 634 | echo "prefix=$prefix" >> $config_mak |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 635 | echo "bindir=$bindir" >> $config_mak |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 636 | echo "mandir=$mandir" >> $config_mak |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 637 | echo "datadir=$datadir" >> $config_mak |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 638 | echo "docdir=$docdir" >> $config_mak |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 639 | echo "#define CONFIG_QEMU_SHAREDIR \"$datadir\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 640 | echo "MAKE=$make" >> $config_mak |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame] | 641 | echo "INSTALL=$install" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 642 | echo "CC=$cc" >> $config_mak |
| 643 | if test "$have_gcc3_options" = "yes" ; then |
| 644 | echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak |
| 645 | fi |
| 646 | echo "HOST_CC=$host_cc" >> $config_mak |
| 647 | echo "AR=$ar" >> $config_mak |
| 648 | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak |
ths | 6f30fa8 | 2007-01-05 01:00:47 +0000 | [diff] [blame] | 649 | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 650 | echo "CFLAGS=$CFLAGS" >> $config_mak |
| 651 | echo "LDFLAGS=$LDFLAGS" >> $config_mak |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 652 | echo "EXESUF=$EXESUF" >> $config_mak |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 653 | if test "$cpu" = "i386" ; then |
| 654 | echo "ARCH=i386" >> $config_mak |
| 655 | echo "#define HOST_I386 1" >> $config_h |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 656 | elif test "$cpu" = "x86_64" ; then |
| 657 | echo "ARCH=x86_64" >> $config_mak |
| 658 | echo "#define HOST_X86_64 1" >> $config_h |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 659 | elif test "$cpu" = "armv4b" ; then |
| 660 | echo "ARCH=arm" >> $config_mak |
| 661 | echo "#define HOST_ARM 1" >> $config_h |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 662 | elif test "$cpu" = "armv4l" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 663 | echo "ARCH=arm" >> $config_mak |
| 664 | echo "#define HOST_ARM 1" >> $config_h |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 665 | elif test "$cpu" = "powerpc" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 666 | echo "ARCH=ppc" >> $config_mak |
| 667 | echo "#define HOST_PPC 1" >> $config_h |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 668 | elif test "$cpu" = "mips" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 669 | echo "ARCH=mips" >> $config_mak |
| 670 | echo "#define HOST_MIPS 1" >> $config_h |
bellard | fb3e584 | 2003-03-29 17:32:36 +0000 | [diff] [blame] | 671 | elif test "$cpu" = "s390" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 672 | echo "ARCH=s390" >> $config_mak |
| 673 | echo "#define HOST_S390 1" >> $config_h |
bellard | 295defa | 2003-04-07 21:31:29 +0000 | [diff] [blame] | 674 | elif test "$cpu" = "alpha" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 675 | echo "ARCH=alpha" >> $config_mak |
| 676 | echo "#define HOST_ALPHA 1" >> $config_h |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 677 | elif test "$cpu" = "sparc" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 678 | echo "ARCH=sparc" >> $config_mak |
| 679 | echo "#define HOST_SPARC 1" >> $config_h |
bellard | ae22853 | 2003-05-13 18:59:59 +0000 | [diff] [blame] | 680 | elif test "$cpu" = "sparc64" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 681 | echo "ARCH=sparc64" >> $config_mak |
| 682 | echo "#define HOST_SPARC64 1" >> $config_h |
bellard | a8baa8c | 2003-04-29 20:53:31 +0000 | [diff] [blame] | 683 | elif test "$cpu" = "ia64" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 684 | echo "ARCH=ia64" >> $config_mak |
| 685 | echo "#define HOST_IA64 1" >> $config_h |
bellard | 38e584a | 2003-08-10 22:14:22 +0000 | [diff] [blame] | 686 | elif test "$cpu" = "m68k" ; then |
bellard | 38ca2ab | 2004-03-13 18:32:13 +0000 | [diff] [blame] | 687 | echo "ARCH=m68k" >> $config_mak |
| 688 | echo "#define HOST_M68K 1" >> $config_h |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 689 | else |
| 690 | echo "Unsupported CPU" |
| 691 | exit 1 |
| 692 | fi |
| 693 | if test "$bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 694 | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
| 695 | echo "#define WORDS_BIGENDIAN 1" >> $config_h |
| 696 | fi |
bellard | b685369 | 2005-06-05 17:10:39 +0000 | [diff] [blame] | 697 | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 698 | if test "$mingw32" = "yes" ; then |
| 699 | echo "CONFIG_WIN32=yes" >> $config_mak |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 700 | echo "#define CONFIG_WIN32 1" >> $config_h |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 701 | elif test -f "/usr/include/byteswap.h" ; then |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 702 | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
| 703 | fi |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 704 | if test "$darwin" = "yes" ; then |
| 705 | echo "CONFIG_DARWIN=yes" >> $config_mak |
| 706 | echo "#define CONFIG_DARWIN 1" >> $config_h |
| 707 | fi |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 708 | if test "$solaris" = "yes" ; then |
| 709 | echo "CONFIG_SOLARIS=yes" >> $config_mak |
bellard | 38cfa06 | 2006-05-01 13:58:07 +0000 | [diff] [blame] | 710 | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 711 | fi |
bellard | 67b915a | 2004-03-31 23:37:16 +0000 | [diff] [blame] | 712 | if test "$gdbstub" = "yes" ; then |
| 713 | echo "CONFIG_GDBSTUB=yes" >> $config_mak |
| 714 | echo "#define CONFIG_GDBSTUB 1" >> $config_h |
| 715 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 716 | if test "$gprof" = "yes" ; then |
| 717 | echo "TARGET_GPROF=yes" >> $config_mak |
| 718 | echo "#define HAVE_GPROF 1" >> $config_h |
| 719 | fi |
| 720 | if test "$static" = "yes" ; then |
| 721 | echo "CONFIG_STATIC=yes" >> $config_mak |
bellard | 5086347 | 2003-10-28 23:04:01 +0000 | [diff] [blame] | 722 | echo "#define CONFIG_STATIC 1" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 723 | fi |
bellard | 05c2a3e | 2006-02-08 22:39:17 +0000 | [diff] [blame] | 724 | if test $profiler = "yes" ; then |
| 725 | echo "#define CONFIG_PROFILER 1" >> $config_h |
| 726 | fi |
bellard | c20709a | 2004-04-21 23:27:19 +0000 | [diff] [blame] | 727 | if test "$slirp" = "yes" ; then |
| 728 | echo "CONFIG_SLIRP=yes" >> $config_mak |
| 729 | echo "#define CONFIG_SLIRP 1" >> $config_h |
| 730 | fi |
bellard | fb06518 | 2004-11-09 23:09:44 +0000 | [diff] [blame] | 731 | if test "$adlib" = "yes" ; then |
| 732 | echo "CONFIG_ADLIB=yes" >> $config_mak |
| 733 | echo "#define CONFIG_ADLIB 1" >> $config_h |
| 734 | fi |
| 735 | if test "$oss" = "yes" ; then |
| 736 | echo "CONFIG_OSS=yes" >> $config_mak |
| 737 | echo "#define CONFIG_OSS 1" >> $config_h |
| 738 | fi |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 739 | if test "$coreaudio" = "yes" ; then |
| 740 | echo "CONFIG_COREAUDIO=yes" >> $config_mak |
| 741 | echo "#define CONFIG_COREAUDIO 1" >> $config_h |
| 742 | fi |
| 743 | if test "$alsa" = "yes" ; then |
| 744 | echo "CONFIG_ALSA=yes" >> $config_mak |
| 745 | echo "#define CONFIG_ALSA 1" >> $config_h |
| 746 | fi |
| 747 | if test "$dsound" = "yes" ; then |
| 748 | echo "CONFIG_DSOUND=yes" >> $config_mak |
| 749 | echo "#define CONFIG_DSOUND 1" >> $config_h |
| 750 | fi |
bellard | 102a52e | 2004-11-14 19:57:29 +0000 | [diff] [blame] | 751 | if test "$fmod" = "yes" ; then |
| 752 | echo "CONFIG_FMOD=yes" >> $config_mak |
| 753 | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
| 754 | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak |
| 755 | echo "#define CONFIG_FMOD 1" >> $config_h |
| 756 | fi |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 757 | qemu_version=`head $source_path/VERSION` |
| 758 | echo "VERSION=$qemu_version" >>$config_mak |
pbrook | d4b8f03 | 2006-04-16 13:49:23 +0000 | [diff] [blame] | 759 | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 760 | |
| 761 | echo "SRC_PATH=$source_path" >> $config_mak |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 762 | if [ "$source_path_used" = "yes" ]; then |
| 763 | echo "VPATH=$source_path" >> $config_mak |
| 764 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 765 | echo "TARGET_DIRS=$target_list" >> $config_mak |
pbrook | cc8ae6d | 2006-04-23 17:57:59 +0000 | [diff] [blame] | 766 | if [ "$build_docs" = "yes" ] ; then |
| 767 | echo "BUILD_DOCS=yes" >> $config_mak |
| 768 | fi |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 769 | |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 770 | # XXX: suppress that |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 771 | if [ "$bsd" = "yes" ] ; then |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 772 | echo "#define O_LARGEFILE 0" >> $config_h |
bellard | 4300304 | 2004-05-20 13:23:39 +0000 | [diff] [blame] | 773 | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 774 | echo "#define _BSD 1" >> $config_h |
| 775 | fi |
| 776 | |
pbrook | c593722 | 2006-05-14 11:30:38 +0000 | [diff] [blame] | 777 | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
| 778 | |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 779 | for target in $target_list; do |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 780 | target_dir="$target" |
| 781 | config_mak=$target_dir/config.mak |
| 782 | config_h=$target_dir/config.h |
| 783 | target_cpu=`echo $target | cut -d '-' -f 1` |
| 784 | target_bigendian="no" |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 785 | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 786 | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 787 | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes |
bellard | 6786730 | 2003-11-23 17:05:30 +0000 | [diff] [blame] | 788 | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 789 | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
bellard | d325856 | 2005-07-02 15:37:12 +0000 | [diff] [blame] | 790 | [ "$target_cpu" = "mips" ] && target_bigendian=yes |
pbrook | 908f52b | 2006-06-18 19:16:53 +0000 | [diff] [blame] | 791 | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
pbrook | e6e5906 | 2006-10-22 00:18:54 +0000 | [diff] [blame] | 792 | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 793 | target_softmmu="no" |
| 794 | if expr $target : '.*-softmmu' > /dev/null ; then |
| 795 | target_softmmu="yes" |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 796 | fi |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 797 | target_user_only="no" |
| 798 | if expr $target : '.*-user' > /dev/null ; then |
| 799 | target_user_only="yes" |
| 800 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 801 | |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 802 | target_linux_user="no" |
| 803 | if expr $target : '.*-linux-user' > /dev/null ; then |
| 804 | target_linux_user="yes" |
| 805 | fi |
| 806 | |
| 807 | target_darwin_user="no" |
| 808 | if expr $target : '.*-darwin-user' > /dev/null ; then |
| 809 | target_darwin_user="yes" |
| 810 | fi |
| 811 | |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 812 | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
bellard | 1d14ffa | 2005-10-30 18:58:22 +0000 | [diff] [blame] | 813 | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 814 | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
pbrook | 9c03850 | 2006-04-16 15:19:15 +0000 | [diff] [blame] | 815 | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
bellard | 97ccc68 | 2005-07-02 13:32:17 +0000 | [diff] [blame] | 816 | echo "Note that this will disable all output from the virtual graphics card." |
| 817 | exit 1; |
| 818 | fi |
| 819 | |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 820 | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 821 | |
| 822 | mkdir -p $target_dir |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 823 | mkdir -p $target_dir/fpu |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 824 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then |
bellard | 69de927 | 2004-02-16 21:40:43 +0000 | [diff] [blame] | 825 | mkdir -p $target_dir/nwfpe |
| 826 | fi |
bellard | a7e61ed | 2004-04-22 21:46:47 +0000 | [diff] [blame] | 827 | if test "$target_user_only" = "no" ; then |
| 828 | mkdir -p $target_dir/slirp |
| 829 | fi |
bellard | 69de927 | 2004-02-16 21:40:43 +0000 | [diff] [blame] | 830 | |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 831 | # |
| 832 | # don't use ln -sf as not all "ln -sf" over write the file/link |
| 833 | # |
| 834 | rm -f $target_dir/Makefile |
| 835 | ln -s $source_path/Makefile.target $target_dir/Makefile |
| 836 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 837 | |
| 838 | echo "# Automatically generated by configure - do not modify" > $config_mak |
| 839 | echo "/* Automatically generated by configure - do not modify */" > $config_h |
| 840 | |
| 841 | |
| 842 | echo "include ../config-host.mak" >> $config_mak |
| 843 | echo "#include \"../config-host.h\"" >> $config_h |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 844 | |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 845 | bflt="no" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 846 | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
| 847 | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 848 | |
| 849 | if test "$target_cpu" = "i386" ; then |
| 850 | echo "TARGET_ARCH=i386" >> $config_mak |
| 851 | echo "#define TARGET_ARCH \"i386\"" >> $config_h |
| 852 | echo "#define TARGET_I386 1" >> $config_h |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 853 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then |
bellard | 824d560 | 2005-02-12 18:58:00 +0000 | [diff] [blame] | 854 | echo "#define USE_KQEMU 1" >> $config_h |
| 855 | fi |
bellard | 808c495 | 2004-12-19 23:33:47 +0000 | [diff] [blame] | 856 | elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 857 | echo "TARGET_ARCH=arm" >> $config_mak |
| 858 | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
| 859 | echo "#define TARGET_ARM 1" >> $config_h |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 860 | bflt="yes" |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 861 | elif test "$target_cpu" = "sparc" ; then |
| 862 | echo "TARGET_ARCH=sparc" >> $config_mak |
| 863 | echo "#define TARGET_ARCH \"sparc\"" >> $config_h |
| 864 | echo "#define TARGET_SPARC 1" >> $config_h |
bellard | 64b3ab2 | 2005-01-30 22:43:42 +0000 | [diff] [blame] | 865 | elif test "$target_cpu" = "sparc64" ; then |
| 866 | echo "TARGET_ARCH=sparc64" >> $config_mak |
| 867 | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
| 868 | echo "#define TARGET_SPARC 1" >> $config_h |
| 869 | echo "#define TARGET_SPARC64 1" >> $config_h |
bellard | 6786730 | 2003-11-23 17:05:30 +0000 | [diff] [blame] | 870 | elif test "$target_cpu" = "ppc" ; then |
| 871 | echo "TARGET_ARCH=ppc" >> $config_mak |
| 872 | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
| 873 | echo "#define TARGET_PPC 1" >> $config_h |
bellard | a245862 | 2005-07-23 22:39:53 +0000 | [diff] [blame] | 874 | elif test "$target_cpu" = "ppc64" ; then |
| 875 | echo "TARGET_ARCH=ppc64" >> $config_mak |
| 876 | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
| 877 | echo "#define TARGET_PPC 1" >> $config_h |
| 878 | echo "#define TARGET_PPC64 1" >> $config_h |
bellard | 0b0babc | 2005-01-03 23:38:40 +0000 | [diff] [blame] | 879 | elif test "$target_cpu" = "x86_64" ; then |
| 880 | echo "TARGET_ARCH=x86_64" >> $config_mak |
| 881 | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h |
| 882 | echo "#define TARGET_I386 1" >> $config_h |
| 883 | echo "#define TARGET_X86_64 1" >> $config_h |
bellard | 07f4ddb | 2005-04-23 17:44:28 +0000 | [diff] [blame] | 884 | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then |
| 885 | echo "#define USE_KQEMU 1" >> $config_h |
| 886 | fi |
bellard | c20eb47 | 2005-12-06 21:42:55 +0000 | [diff] [blame] | 887 | elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then |
bellard | d325856 | 2005-07-02 15:37:12 +0000 | [diff] [blame] | 888 | echo "TARGET_ARCH=mips" >> $config_mak |
| 889 | echo "#define TARGET_ARCH \"mips\"" >> $config_h |
| 890 | echo "#define TARGET_MIPS 1" >> $config_h |
bellard | 6ea83fe | 2006-06-14 12:56:19 +0000 | [diff] [blame] | 891 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
| 892 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
pbrook | 908f52b | 2006-06-18 19:16:53 +0000 | [diff] [blame] | 893 | elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then |
bellard | fdf9b3e | 2006-04-27 21:07:38 +0000 | [diff] [blame] | 894 | echo "TARGET_ARCH=sh4" >> $config_mak |
| 895 | echo "#define TARGET_ARCH \"sh4\"" >> $config_h |
| 896 | echo "#define TARGET_SH4 1" >> $config_h |
pbrook | 4dbed89 | 2006-06-17 20:01:14 +0000 | [diff] [blame] | 897 | bflt="yes" |
pbrook | e6e5906 | 2006-10-22 00:18:54 +0000 | [diff] [blame] | 898 | elif test "$target_cpu" = "m68k" ; then |
| 899 | echo "TARGET_ARCH=m68k" >> $config_mak |
| 900 | echo "#define TARGET_ARCH \"m68k\"" >> $config_h |
| 901 | echo "#define TARGET_M68K 1" >> $config_h |
| 902 | bflt="yes" |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 903 | else |
| 904 | echo "Unsupported target CPU" |
| 905 | exit 1 |
| 906 | fi |
| 907 | if test "$target_bigendian" = "yes" ; then |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 908 | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
| 909 | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h |
| 910 | fi |
| 911 | if test "$target_softmmu" = "yes" ; then |
| 912 | echo "CONFIG_SOFTMMU=yes" >> $config_mak |
| 913 | echo "#define CONFIG_SOFTMMU 1" >> $config_h |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 914 | fi |
bellard | 997344f | 2003-10-27 21:10:39 +0000 | [diff] [blame] | 915 | if test "$target_user_only" = "yes" ; then |
| 916 | echo "CONFIG_USER_ONLY=yes" >> $config_mak |
| 917 | echo "#define CONFIG_USER_ONLY 1" >> $config_h |
| 918 | fi |
ths | 831b782 | 2007-01-18 20:06:33 +0000 | [diff] [blame^] | 919 | if test "$target_linux_user" = "yes" ; then |
| 920 | echo "CONFIG_LINUX_USER=yes" >> $config_mak |
| 921 | echo "#define CONFIG_LINUX_USER 1" >> $config_h |
| 922 | fi |
| 923 | if test "$target_darwin_user" = "yes" ; then |
| 924 | echo "CONFIG_DARWIN_USER=yes" >> $config_mak |
| 925 | echo "#define CONFIG_DARWIN_USER 1" >> $config_h |
| 926 | fi |
bellard | de83cd0 | 2003-06-15 20:25:43 +0000 | [diff] [blame] | 927 | |
pbrook | e6e5906 | 2006-10-22 00:18:54 +0000 | [diff] [blame] | 928 | if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then |
bellard | 158142c | 2005-03-13 16:54:06 +0000 | [diff] [blame] | 929 | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
| 930 | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
| 931 | fi |
pbrook | e5fe0c5 | 2006-06-11 13:32:59 +0000 | [diff] [blame] | 932 | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
| 933 | echo "TARGET_HAS_BFLT=yes" >> $config_mak |
| 934 | echo "#define TARGET_HAS_BFLT 1" >> $config_h |
| 935 | fi |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 936 | # sdl defines |
| 937 | |
| 938 | if test "$target_user_only" = "no"; then |
| 939 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
bellard | dbb2c92 | 2004-10-24 22:17:47 +0000 | [diff] [blame] | 940 | sdl1=$sdl_static |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 941 | else |
bellard | dbb2c92 | 2004-10-24 22:17:47 +0000 | [diff] [blame] | 942 | sdl1=$sdl |
| 943 | fi |
| 944 | if test "$sdl1" = "yes" ; then |
| 945 | echo "#define CONFIG_SDL 1" >> $config_h |
| 946 | echo "CONFIG_SDL=yes" >> $config_mak |
| 947 | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
| 948 | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak |
| 949 | else |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 950 | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak |
| 951 | fi |
bellard | dbb2c92 | 2004-10-24 22:17:47 +0000 | [diff] [blame] | 952 | if [ "${aa}" = "yes" ] ; then |
pbrook | b1a550a | 2006-04-16 13:28:56 +0000 | [diff] [blame] | 953 | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak |
| 954 | else |
| 955 | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak |
bellard | dbb2c92 | 2004-10-24 22:17:47 +0000 | [diff] [blame] | 956 | fi |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 957 | fi |
bellard | 7c1f25b | 2004-04-22 00:02:08 +0000 | [diff] [blame] | 958 | fi |
| 959 | |
bellard | 5b0753e | 2005-03-01 21:37:28 +0000 | [diff] [blame] | 960 | if test "$cocoa" = "yes" ; then |
| 961 | echo "#define CONFIG_COCOA 1" >> $config_h |
| 962 | echo "CONFIG_COCOA=yes" >> $config_mak |
| 963 | fi |
| 964 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 965 | done # for target in $targets |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 966 | |
| 967 | # build tree in object directory if source path is different from current one |
| 968 | if test "$source_path_used" = "yes" ; then |
| 969 | DIRS="tests" |
| 970 | FILES="Makefile tests/Makefile" |
| 971 | for dir in $DIRS ; do |
| 972 | mkdir -p $dir |
| 973 | done |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 974 | # 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] | 975 | for f in $FILES ; do |
bellard | ec530c8 | 2006-04-25 22:36:06 +0000 | [diff] [blame] | 976 | rm -f $f |
| 977 | ln -s $source_path/$f $f |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 978 | done |
| 979 | fi |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 980 | |
bellard | 97a847b | 2003-08-10 21:36:04 +0000 | [diff] [blame] | 981 | rm -f $TMPO $TMPC $TMPE $TMPS |