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