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