root / configure @ 4118a970
History | View | Annotate | Download (33.1 kB)
1 | 7d13299d | bellard | #!/bin/sh |
---|---|---|---|
2 | 7d13299d | bellard | # |
3 | 3ef693a0 | bellard | # qemu configure script (c) 2003 Fabrice Bellard |
4 | 7d13299d | bellard | # |
5 | 7d13299d | bellard | # set temporary file name |
6 | 7d13299d | bellard | if test ! -z "$TMPDIR" ; then |
7 | 7d13299d | bellard | TMPDIR1="${TMPDIR}" |
8 | 7d13299d | bellard | elif test ! -z "$TEMPDIR" ; then |
9 | 7d13299d | bellard | TMPDIR1="${TEMPDIR}" |
10 | 7d13299d | bellard | else |
11 | 7d13299d | bellard | TMPDIR1="/tmp" |
12 | 7d13299d | bellard | fi |
13 | 7d13299d | bellard | |
14 | 3ef693a0 | bellard | TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" |
15 | 3ef693a0 | bellard | TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" |
16 | 3ef693a0 | bellard | TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}" |
17 | 3ef693a0 | bellard | TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" |
18 | 7d13299d | bellard | |
19 | 7d13299d | bellard | # default parameters |
20 | 11d9f695 | bellard | prefix="" |
21 | 1e43adfc | bellard | interp_prefix="/usr/gnemul/qemu-%M" |
22 | 43ce4dfe | bellard | static="no" |
23 | 7d13299d | bellard | cross_prefix="" |
24 | 7d13299d | bellard | cc="gcc" |
25 | 328a4240 | pbrook | gcc3_search="yes" |
26 | d4af3de2 | balrog | gcc3_list="gcc-3.4 gcc34 gcc-3.3.6 gcc-3.3 gcc33 gcc-3.2 gcc32" |
27 | 7d13299d | bellard | host_cc="gcc" |
28 | 7d13299d | bellard | ar="ar" |
29 | 7d13299d | bellard | make="make" |
30 | 6a882643 | pbrook | install="install" |
31 | 7d13299d | bellard | strip="strip" |
32 | 7d13299d | bellard | cpu=`uname -m` |
33 | 5327cf48 | bellard | target_list="" |
34 | 7d13299d | bellard | case "$cpu" in |
35 | 7d13299d | bellard | i386|i486|i586|i686|i86pc|BePC) |
36 | 97a847bc | bellard | cpu="i386" |
37 | 7d13299d | bellard | ;; |
38 | ba68055e | bellard | armv*b) |
39 | 808c4954 | bellard | cpu="armv4b" |
40 | 808c4954 | bellard | ;; |
41 | ba68055e | bellard | armv*l) |
42 | 7d13299d | bellard | cpu="armv4l" |
43 | 7d13299d | bellard | ;; |
44 | 7d13299d | bellard | alpha) |
45 | 7d13299d | bellard | cpu="alpha" |
46 | 7d13299d | bellard | ;; |
47 | 295defa5 | bellard | "Power Macintosh"|ppc|ppc64) |
48 | 7d13299d | bellard | cpu="powerpc" |
49 | 7d13299d | bellard | ;; |
50 | 7d13299d | bellard | mips) |
51 | 7d13299d | bellard | cpu="mips" |
52 | 7d13299d | bellard | ;; |
53 | fbe4f65b | ths | mips64) |
54 | fbe4f65b | ths | cpu="mips64" |
55 | fbe4f65b | ths | ;; |
56 | 0e7b8a9f | ths | s390*) |
57 | fb3e5849 | bellard | cpu="s390" |
58 | fb3e5849 | bellard | ;; |
59 | 3142255c | blueswir1 | sparc|sun4[cdmuv]) |
60 | ae228531 | bellard | cpu="sparc" |
61 | ae228531 | bellard | ;; |
62 | ae228531 | bellard | sparc64) |
63 | ae228531 | bellard | cpu="sparc64" |
64 | ae228531 | bellard | ;; |
65 | a8baa8c5 | bellard | ia64) |
66 | a8baa8c5 | bellard | cpu="ia64" |
67 | a8baa8c5 | bellard | ;; |
68 | 38e584a0 | bellard | m68k) |
69 | 38e584a0 | bellard | cpu="m68k" |
70 | 38e584a0 | bellard | ;; |
71 | bc51c5c9 | bellard | x86_64|amd64) |
72 | 0b0babc6 | bellard | cpu="x86_64" |
73 | bc51c5c9 | bellard | ;; |
74 | 7d13299d | bellard | *) |
75 | 7d13299d | bellard | cpu="unknown" |
76 | 7d13299d | bellard | ;; |
77 | 7d13299d | bellard | esac |
78 | 7d13299d | bellard | gprof="no" |
79 | 7d13299d | bellard | bigendian="no" |
80 | 67b915a5 | bellard | mingw32="no" |
81 | 67b915a5 | bellard | EXESUF="" |
82 | 67b915a5 | bellard | gdbstub="yes" |
83 | 443f1376 | bellard | slirp="yes" |
84 | fb065187 | bellard | adlib="no" |
85 | fb065187 | bellard | oss="no" |
86 | 1d14ffa9 | bellard | dsound="no" |
87 | 1d14ffa9 | bellard | coreaudio="no" |
88 | 1d14ffa9 | bellard | alsa="no" |
89 | 102a52e4 | bellard | fmod="no" |
90 | 102a52e4 | bellard | fmod_lib="" |
91 | 102a52e4 | bellard | fmod_inc="" |
92 | 8d5d2d4c | ths | vnc_tls="yes" |
93 | b1a550a0 | pbrook | bsd="no" |
94 | 5327cf48 | bellard | linux="no" |
95 | c9ec1fe4 | bellard | kqemu="no" |
96 | 05c2a3e7 | bellard | profiler="no" |
97 | 5b0753e0 | bellard | cocoa="no" |
98 | 97ccc689 | bellard | check_gfx="yes" |
99 | 1aff381f | bellard | check_gcc="yes" |
100 | 0a8e90f4 | pbrook | softmmu="yes" |
101 | 831b7825 | ths | linux_user="no" |
102 | 831b7825 | ths | darwin_user="no" |
103 | cc8ae6de | pbrook | build_docs="no" |
104 | c5937220 | pbrook | uname_release="" |
105 | 7d13299d | bellard | |
106 | 7d13299d | bellard | # OS specific |
107 | 7d13299d | bellard | targetos=`uname -s` |
108 | 7d13299d | bellard | case $targetos in |
109 | c326e0af | bellard | CYGWIN*) |
110 | c326e0af | bellard | mingw32="yes" |
111 | 6f30fa85 | ths | OS_CFLAGS="-mno-cygwin" |
112 | db8d7dd1 | ths | VL_OS_LDFLAGS="-mno-cygwin" |
113 | db8d7dd1 | ths | if [ "$cpu" = "i386" ] ; then |
114 | db8d7dd1 | ths | kqemu="yes" |
115 | db8d7dd1 | ths | fi |
116 | c326e0af | bellard | ;; |
117 | 67b915a5 | bellard | MINGW32*) |
118 | 67b915a5 | bellard | mingw32="yes" |
119 | db8d7dd1 | ths | if [ "$cpu" = "i386" ] ; then |
120 | db8d7dd1 | ths | kqemu="yes" |
121 | db8d7dd1 | ths | fi |
122 | 67b915a5 | bellard | ;; |
123 | 5c40d2bd | ths | GNU/kFreeBSD) |
124 | 5c40d2bd | ths | oss="yes" |
125 | 5c40d2bd | ths | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
126 | 5c40d2bd | ths | kqemu="yes" |
127 | 5c40d2bd | ths | fi |
128 | 5c40d2bd | ths | ;; |
129 | 7d3505c5 | bellard | FreeBSD) |
130 | 7d3505c5 | bellard | bsd="yes" |
131 | fb065187 | bellard | oss="yes" |
132 | e99f9060 | bellard | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
133 | 07f4ddbf | bellard | kqemu="yes" |
134 | 07f4ddbf | bellard | fi |
135 | 7d3505c5 | bellard | ;; |
136 | 7d3505c5 | bellard | NetBSD) |
137 | 7d3505c5 | bellard | bsd="yes" |
138 | fb065187 | bellard | oss="yes" |
139 | 7d3505c5 | bellard | ;; |
140 | 7d3505c5 | bellard | OpenBSD) |
141 | 7d3505c5 | bellard | bsd="yes" |
142 | fb065187 | bellard | oss="yes" |
143 | 7d3505c5 | bellard | ;; |
144 | 83fb7adf | bellard | Darwin) |
145 | 83fb7adf | bellard | bsd="yes" |
146 | 83fb7adf | bellard | darwin="yes" |
147 | 831b7825 | ths | darwin_user="yes" |
148 | fd677642 | ths | cocoa="yes" |
149 | fd677642 | ths | coreaudio="yes" |
150 | 6f30fa85 | ths | OS_CFLAGS="-mdynamic-no-pic" |
151 | 83fb7adf | bellard | ;; |
152 | ec530c81 | bellard | SunOS) |
153 | c2b84fab | ths | solaris="yes" |
154 | c2b84fab | ths | make="gmake" |
155 | c2b84fab | ths | install="ginstall" |
156 | 0475a5ca | ths | needs_libsunmath="no" |
157 | c2b84fab | ths | solarisrev=`uname -r | cut -f2 -d.` |
158 | ef18c883 | ths | # have to select again, because `uname -m` returns i86pc |
159 | ef18c883 | ths | # even on an x86_64 box. |
160 | ef18c883 | ths | solariscpu=`isainfo -k` |
161 | ef18c883 | ths | if test "${solariscpu}" = "amd64" ; then |
162 | ef18c883 | ths | cpu="x86_64" |
163 | ef18c883 | ths | fi |
164 | c2b84fab | ths | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
165 | 0475a5ca | ths | if test "$solarisrev" -le 9 ; then |
166 | 0475a5ca | ths | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then |
167 | 0475a5ca | ths | needs_libsunmath="yes" |
168 | 0475a5ca | ths | else |
169 | 0475a5ca | ths | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" |
170 | 0475a5ca | ths | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" |
171 | 0475a5ca | ths | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" |
172 | 0475a5ca | ths | echo "Studio 11 can be downloaded from www.sun.com." |
173 | 0475a5ca | ths | exit 1 |
174 | 0475a5ca | ths | fi |
175 | 0475a5ca | ths | fi |
176 | 0475a5ca | ths | if test "$solarisrev" -ge 9 ; then |
177 | c2b84fab | ths | kqemu="yes" |
178 | c2b84fab | ths | fi |
179 | 86b2bd93 | ths | fi |
180 | 6b4d2ba1 | ths | if test -f /usr/include/sys/soundcard.h ; then |
181 | 6b4d2ba1 | ths | oss=yes |
182 | 6b4d2ba1 | ths | fi |
183 | 86b2bd93 | ths | ;; |
184 | 1d14ffa9 | bellard | *) |
185 | fb065187 | bellard | oss="yes" |
186 | 5327cf48 | bellard | linux="yes" |
187 | 831b7825 | ths | linux_user="yes" |
188 | 07f4ddbf | bellard | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
189 | c9ec1fe4 | bellard | kqemu="yes" |
190 | c9ec1fe4 | bellard | fi |
191 | fb065187 | bellard | ;; |
192 | 7d13299d | bellard | esac |
193 | 7d13299d | bellard | |
194 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
195 | b1a550a0 | pbrook | if [ "$darwin" != "yes" ] ; then |
196 | 83fb7adf | bellard | make="gmake" |
197 | 83fb7adf | bellard | fi |
198 | 7d3505c5 | bellard | fi |
199 | 7d3505c5 | bellard | |
200 | 7d13299d | bellard | # find source path |
201 | ad064840 | pbrook | source_path=`dirname "$0"` |
202 | ad064840 | pbrook | if [ -z "$source_path" ]; then |
203 | 7d13299d | bellard | source_path=`pwd` |
204 | ad064840 | pbrook | else |
205 | ad064840 | pbrook | source_path=`cd "$source_path"; pwd` |
206 | ad064840 | pbrook | fi |
207 | ad064840 | pbrook | if test "$source_path" = `pwd` ; then |
208 | 7d13299d | bellard | source_path_used="no" |
209 | ad064840 | pbrook | else |
210 | ad064840 | pbrook | source_path_used="yes" |
211 | 7d13299d | bellard | fi |
212 | 7d13299d | bellard | |
213 | 7d13299d | bellard | for opt do |
214 | a46e4035 | pbrook | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
215 | 7d13299d | bellard | case "$opt" in |
216 | 2efc3265 | bellard | --help|-h) show_help=yes |
217 | 2efc3265 | bellard | ;; |
218 | b1a550a0 | pbrook | --prefix=*) prefix="$optarg" |
219 | 7d13299d | bellard | ;; |
220 | b1a550a0 | pbrook | --interp-prefix=*) interp_prefix="$optarg" |
221 | 32ce6337 | bellard | ;; |
222 | b1a550a0 | pbrook | --source-path=*) source_path="$optarg" |
223 | ad064840 | pbrook | source_path_used="yes" |
224 | 7d13299d | bellard | ;; |
225 | b1a550a0 | pbrook | --cross-prefix=*) cross_prefix="$optarg" |
226 | 7d13299d | bellard | ;; |
227 | b1a550a0 | pbrook | --cc=*) cc="$optarg" |
228 | 328a4240 | pbrook | gcc3_search="no" |
229 | 7d13299d | bellard | ;; |
230 | b1a550a0 | pbrook | --host-cc=*) host_cc="$optarg" |
231 | 83469015 | bellard | ;; |
232 | b1a550a0 | pbrook | --make=*) make="$optarg" |
233 | 7d13299d | bellard | ;; |
234 | 6a882643 | pbrook | --install=*) install="$optarg" |
235 | 6a882643 | pbrook | ;; |
236 | b1a550a0 | pbrook | --extra-cflags=*) CFLAGS="$optarg" |
237 | 7d13299d | bellard | ;; |
238 | b1a550a0 | pbrook | --extra-ldflags=*) LDFLAGS="$optarg" |
239 | 7d13299d | bellard | ;; |
240 | b1a550a0 | pbrook | --cpu=*) cpu="$optarg" |
241 | 7d13299d | bellard | ;; |
242 | b1a550a0 | pbrook | --target-list=*) target_list="$optarg" |
243 | de83cd02 | bellard | ;; |
244 | 7d13299d | bellard | --enable-gprof) gprof="yes" |
245 | 7d13299d | bellard | ;; |
246 | 43ce4dfe | bellard | --static) static="yes" |
247 | 43ce4dfe | bellard | ;; |
248 | 97a847bc | bellard | --disable-sdl) sdl="no" |
249 | 97a847bc | bellard | ;; |
250 | 1d14ffa9 | bellard | --enable-coreaudio) coreaudio="yes" |
251 | 1d14ffa9 | bellard | ;; |
252 | 1d14ffa9 | bellard | --enable-alsa) alsa="yes" |
253 | 1d14ffa9 | bellard | ;; |
254 | 1d14ffa9 | bellard | --enable-dsound) dsound="yes" |
255 | 1d14ffa9 | bellard | ;; |
256 | 102a52e4 | bellard | --enable-fmod) fmod="yes" |
257 | 102a52e4 | bellard | ;; |
258 | b1a550a0 | pbrook | --fmod-lib=*) fmod_lib="$optarg" |
259 | 102a52e4 | bellard | ;; |
260 | b1a550a0 | pbrook | --fmod-inc=*) fmod_inc="$optarg" |
261 | 102a52e4 | bellard | ;; |
262 | 8d5d2d4c | ths | --disable-vnc-tls) vnc_tls="no" |
263 | 8d5d2d4c | ths | ;; |
264 | b93aebec | bellard | --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; linux_user="no" |
265 | 1d14ffa9 | bellard | ;; |
266 | 443f1376 | bellard | --disable-slirp) slirp="no" |
267 | 1d14ffa9 | bellard | ;; |
268 | fb065187 | bellard | --enable-adlib) adlib="yes" |
269 | 1d14ffa9 | bellard | ;; |
270 | c9ec1fe4 | bellard | --disable-kqemu) kqemu="no" |
271 | 1d14ffa9 | bellard | ;; |
272 | 05c2a3e7 | bellard | --enable-profiler) profiler="yes" |
273 | 05c2a3e7 | bellard | ;; |
274 | 1d14ffa9 | bellard | --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" |
275 | 1d14ffa9 | bellard | ;; |
276 | 97ccc689 | bellard | --disable-gfx-check) check_gfx="no" |
277 | 97ccc689 | bellard | ;; |
278 | 1aff381f | bellard | --disable-gcc-check) check_gcc="no" |
279 | 1aff381f | bellard | ;; |
280 | cad25d69 | pbrook | --disable-system) softmmu="no" |
281 | 0a8e90f4 | pbrook | ;; |
282 | cad25d69 | pbrook | --enable-system) softmmu="yes" |
283 | 0a8e90f4 | pbrook | ;; |
284 | 831b7825 | ths | --disable-linux-user) linux_user="no" |
285 | 0a8e90f4 | pbrook | ;; |
286 | 831b7825 | ths | --enable-linux-user) linux_user="yes" |
287 | 831b7825 | ths | ;; |
288 | 831b7825 | ths | --disable-darwin-user) darwin_user="no" |
289 | 831b7825 | ths | ;; |
290 | 831b7825 | ths | --enable-darwin-user) darwin_user="yes" |
291 | 0a8e90f4 | pbrook | ;; |
292 | c5937220 | pbrook | --enable-uname-release=*) uname_release="$optarg" |
293 | c5937220 | pbrook | ;; |
294 | 3142255c | blueswir1 | --sparc_cpu=*) |
295 | 3142255c | blueswir1 | sparc_cpu="$optarg" |
296 | 3142255c | blueswir1 | case $sparc_cpu in |
297 | 3142255c | blueswir1 | v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
298 | 3142255c | blueswir1 | target_cpu="sparc"; cpu="sparc" ;; |
299 | 3142255c | blueswir1 | v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32" |
300 | 3142255c | blueswir1 | target_cpu="sparc"; cpu="sparc" ;; |
301 | 3142255c | blueswir1 | v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64" |
302 | 3142255c | blueswir1 | target_cpu="sparc64"; cpu="sparc64" ;; |
303 | 3142255c | blueswir1 | *) echo "undefined SPARC architecture. Exiting";exit 1;; |
304 | 3142255c | blueswir1 | esac |
305 | 3142255c | blueswir1 | ;; |
306 | 7d13299d | bellard | esac |
307 | 7d13299d | bellard | done |
308 | 7d13299d | bellard | |
309 | 209afb9e | ths | if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then |
310 | 209afb9e | ths | AIOLIBS= |
311 | 209afb9e | ths | else |
312 | 209afb9e | ths | AIOLIBS="-lrt" |
313 | 209afb9e | ths | fi |
314 | 209afb9e | ths | |
315 | 6f30fa85 | ths | # default flags for all hosts |
316 | 6f30fa85 | ths | CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" |
317 | 6f30fa85 | ths | LDFLAGS="$LDFLAGS -g" |
318 | 6f30fa85 | ths | |
319 | 3142255c | blueswir1 | # |
320 | 3142255c | blueswir1 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
321 | 3142255c | blueswir1 | # ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
322 | 3142255c | blueswir1 | # |
323 | 3142255c | blueswir1 | case $cpu in |
324 | 3142255c | blueswir1 | sparc) if test -z "$sparc_cpu" ; then |
325 | 3142255c | blueswir1 | ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__" |
326 | 3142255c | blueswir1 | ARCH_LDFLAGS="-m32" |
327 | 3142255c | blueswir1 | else |
328 | 3142255c | blueswir1 | ARCH_CFLAGS="${SP_CFLAGS}" |
329 | 3142255c | blueswir1 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
330 | 3142255c | blueswir1 | fi |
331 | 3142255c | blueswir1 | ;; |
332 | 3142255c | blueswir1 | sparc64) if test -z "$sparc_cpu" ; then |
333 | 3142255c | blueswir1 | ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__" |
334 | 3142255c | blueswir1 | ARCH_LDFLAGS="-m64" |
335 | 3142255c | blueswir1 | else |
336 | 3142255c | blueswir1 | ARCH_CFLAGS="${SP_CFLAGS}" |
337 | 3142255c | blueswir1 | ARCH_LDFLAGS="${SP_LDFLAGS}" |
338 | 3142255c | blueswir1 | fi |
339 | 3142255c | blueswir1 | ;; |
340 | 3142255c | blueswir1 | esac |
341 | 3142255c | blueswir1 | |
342 | ef18c883 | ths | if [ "$solaris" = "yes" -a "$cpu" = "x86_64" ] ; then |
343 | ef18c883 | ths | CFLAGS="${CFLAGS} -m64" |
344 | ef18c883 | ths | OS_CFLAGS="${OS_CFLAGS} -m64" |
345 | ef18c883 | ths | fi |
346 | ef18c883 | ths | |
347 | ef18c883 | ths | if [ "$solaris" = "yes" -a "$cpu" = "i386" ] ; then |
348 | ef18c883 | ths | CFLAGS="${CFLAGS} -m32" |
349 | ef18c883 | ths | OS_CFLAGS="${OS_CFLAGS} -m32" |
350 | ef18c883 | ths | fi |
351 | ef18c883 | ths | |
352 | af5db58e | pbrook | if test x"$show_help" = x"yes" ; then |
353 | af5db58e | pbrook | cat << EOF |
354 | af5db58e | pbrook | |
355 | af5db58e | pbrook | Usage: configure [options] |
356 | af5db58e | pbrook | Options: [defaults in brackets after descriptions] |
357 | af5db58e | pbrook | |
358 | af5db58e | pbrook | EOF |
359 | af5db58e | pbrook | echo "Standard options:" |
360 | af5db58e | pbrook | echo " --help print this message" |
361 | af5db58e | pbrook | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
362 | af5db58e | pbrook | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
363 | af5db58e | pbrook | echo " use %M for cpu name [$interp_prefix]" |
364 | af5db58e | pbrook | echo " --target-list=LIST set target list [$target_list]" |
365 | af5db58e | pbrook | echo "" |
366 | af5db58e | pbrook | echo "kqemu kernel acceleration support:" |
367 | af5db58e | pbrook | echo " --disable-kqemu disable kqemu support" |
368 | af5db58e | pbrook | echo "" |
369 | af5db58e | pbrook | echo "Advanced options (experts only):" |
370 | af5db58e | pbrook | echo " --source-path=PATH path of source code [$source_path]" |
371 | af5db58e | pbrook | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
372 | af5db58e | pbrook | echo " --cc=CC use C compiler CC [$cc]" |
373 | af5db58e | pbrook | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
374 | af5db58e | pbrook | echo " --make=MAKE use specified make [$make]" |
375 | 6a882643 | pbrook | echo " --install=INSTALL use specified install [$install]" |
376 | af5db58e | pbrook | echo " --static enable static build [$static]" |
377 | af5db58e | pbrook | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
378 | af5db58e | pbrook | echo " --enable-mingw32 enable Win32 cross compilation with mingw32" |
379 | af5db58e | pbrook | echo " --enable-adlib enable Adlib emulation" |
380 | af5db58e | pbrook | echo " --enable-coreaudio enable Coreaudio audio driver" |
381 | af5db58e | pbrook | echo " --enable-alsa enable ALSA audio driver" |
382 | af5db58e | pbrook | echo " --enable-fmod enable FMOD audio driver" |
383 | ed5065e1 | ths | echo " --enable-dsound enable DirectSound audio driver" |
384 | 8d5d2d4c | ths | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
385 | af5db58e | pbrook | echo " --enable-system enable all system emulation targets" |
386 | af5db58e | pbrook | echo " --disable-system disable all system emulation targets" |
387 | 831b7825 | ths | echo " --enable-linux-user enable all linux usermode emulation targets" |
388 | 831b7825 | ths | echo " --disable-linux-user disable all linux usermode emulation targets" |
389 | 831b7825 | ths | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
390 | 831b7825 | ths | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
391 | af5db58e | pbrook | echo " --fmod-lib path to FMOD library" |
392 | af5db58e | pbrook | echo " --fmod-inc path to FMOD includes" |
393 | c5937220 | pbrook | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
394 | 3142255c | blueswir1 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
395 | af5db58e | pbrook | echo "" |
396 | 5bf08934 | ths | echo "NOTE: The object files are built at the place where configure is launched" |
397 | af5db58e | pbrook | exit 1 |
398 | af5db58e | pbrook | fi |
399 | af5db58e | pbrook | |
400 | 7d13299d | bellard | cc="${cross_prefix}${cc}" |
401 | 7d13299d | bellard | ar="${cross_prefix}${ar}" |
402 | 7d13299d | bellard | strip="${cross_prefix}${strip}" |
403 | 7d13299d | bellard | |
404 | 064aae13 | pbrook | # check that the C compiler works. |
405 | 064aae13 | pbrook | cat > $TMPC <<EOF |
406 | 064aae13 | pbrook | int main(void) {} |
407 | 064aae13 | pbrook | EOF |
408 | 064aae13 | pbrook | |
409 | cf257238 | ths | if $cc -c -o $TMPO $TMPC 2> /dev/null ; then |
410 | 064aae13 | pbrook | : C compiler works ok |
411 | 064aae13 | pbrook | else |
412 | 064aae13 | pbrook | echo "ERROR: \"$cc\" either does not exist or does not work" |
413 | 064aae13 | pbrook | exit 1 |
414 | a7350fa1 | bellard | fi |
415 | a7350fa1 | bellard | |
416 | 67b915a5 | bellard | if test "$mingw32" = "yes" ; then |
417 | 5327cf48 | bellard | linux="no" |
418 | 67b915a5 | bellard | EXESUF=".exe" |
419 | 9f059eca | bellard | oss="no" |
420 | 67b915a5 | bellard | fi |
421 | 67b915a5 | bellard | |
422 | 5fafdf24 | ths | # Check for gcc4, error if pre-gcc4 |
423 | 328a4240 | pbrook | if test "$check_gcc" = "yes" ; then |
424 | 328a4240 | pbrook | cat > $TMPC <<EOF |
425 | 328a4240 | pbrook | #if __GNUC__ < 4 |
426 | 328a4240 | pbrook | #error gcc3 |
427 | 328a4240 | pbrook | #endif |
428 | 328a4240 | pbrook | int main(){return 0;} |
429 | 328a4240 | pbrook | EOF |
430 | cf257238 | ths | if "$cc" -o $TMPE $TMPC 2> /dev/null ; then |
431 | 328a4240 | pbrook | echo "WARNING: \"$cc\" looks like gcc 4.x" |
432 | 328a4240 | pbrook | found_compat_cc="no" |
433 | 328a4240 | pbrook | if test "$gcc3_search" = "yes" ; then |
434 | 328a4240 | pbrook | echo "Looking for gcc 3.x" |
435 | 328a4240 | pbrook | for compat_cc in $gcc3_list ; do |
436 | d4af3de2 | balrog | if "$cross_prefix$compat_cc" --version 2> /dev/null | fgrep '(GCC) 3.' > /dev/null 2>&1 ; then |
437 | 328a4240 | pbrook | echo "Found \"$compat_cc\"" |
438 | 1124426a | pbrook | cc="$cross_prefix$compat_cc" |
439 | 328a4240 | pbrook | found_compat_cc="yes" |
440 | 328a4240 | pbrook | break |
441 | 328a4240 | pbrook | fi |
442 | 328a4240 | pbrook | done |
443 | 328a4240 | pbrook | if test "$found_compat_cc" = "no" ; then |
444 | 328a4240 | pbrook | echo "gcc 3.x not found!" |
445 | 328a4240 | pbrook | fi |
446 | 328a4240 | pbrook | fi |
447 | 328a4240 | pbrook | if test "$found_compat_cc" = "no" ; then |
448 | 328a4240 | pbrook | echo "QEMU is known to have problems when compiled with gcc 4.x" |
449 | 328a4240 | pbrook | echo "It is recommended that you use gcc 3.x to build QEMU" |
450 | 328a4240 | pbrook | echo "To use this compiler anyway, configure with --disable-gcc-check" |
451 | 328a4240 | pbrook | exit 1; |
452 | 328a4240 | pbrook | fi |
453 | 328a4240 | pbrook | fi |
454 | 328a4240 | pbrook | fi |
455 | 328a4240 | pbrook | |
456 | ec530c81 | bellard | # |
457 | ec530c81 | bellard | # Solaris specific configure tool chain decisions |
458 | ec530c81 | bellard | # |
459 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
460 | ec530c81 | bellard | # |
461 | ec530c81 | bellard | # gcc for solaris 10/fcs in /usr/sfw/bin doesn't compile qemu correctly |
462 | ec530c81 | bellard | # override the check with --disable-gcc-check |
463 | 5fafdf24 | ths | # |
464 | ec530c81 | bellard | if test "$solarisrev" -eq 10 -a "$check_gcc" = "yes" ; then |
465 | ec530c81 | bellard | solgcc=`which $cc` |
466 | ec530c81 | bellard | if test "$solgcc" = "/usr/sfw/bin/gcc" ; then |
467 | ec530c81 | bellard | echo "Solaris 10/FCS gcc in /usr/sfw/bin will not compiled qemu correctly." |
468 | ec530c81 | bellard | echo "please get gcc-3.4.3 or later, from www.blastwave.org using pkg-get -i gcc3" |
469 | ec530c81 | bellard | echo "or get the latest patch from SunSolve for gcc" |
470 | ec530c81 | bellard | exit 1 |
471 | ec530c81 | bellard | fi |
472 | ec530c81 | bellard | fi |
473 | ec530c81 | bellard | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
474 | ec530c81 | bellard | if test -z "$solinst" ; then |
475 | ec530c81 | bellard | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
476 | ec530c81 | bellard | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
477 | ec530c81 | bellard | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
478 | ec530c81 | bellard | exit 1 |
479 | ec530c81 | bellard | fi |
480 | ec530c81 | bellard | if test "$solinst" = "/usr/sbin/install" ; then |
481 | ec530c81 | bellard | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
482 | ec530c81 | bellard | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
483 | ec530c81 | bellard | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
484 | ec530c81 | bellard | exit 1 |
485 | ec530c81 | bellard | fi |
486 | ec530c81 | bellard | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
487 | ec530c81 | bellard | if test -z "$sol_ar" ; then |
488 | ec530c81 | bellard | echo "Error: No path includes ar" |
489 | ec530c81 | bellard | if test -f /usr/ccs/bin/ar ; then |
490 | ec530c81 | bellard | echo "Add /usr/ccs/bin to your path and rerun configure" |
491 | ec530c81 | bellard | fi |
492 | ec530c81 | bellard | exit 1 |
493 | ec530c81 | bellard | fi |
494 | 5fafdf24 | ths | fi |
495 | ec530c81 | bellard | |
496 | ec530c81 | bellard | |
497 | 5327cf48 | bellard | if test -z "$target_list" ; then |
498 | 5327cf48 | bellard | # these targets are portable |
499 | 0a8e90f4 | pbrook | if [ "$softmmu" = "yes" ] ; then |
500 | 0633879f | pbrook | target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu ppcemb-softmmu m68k-softmmu" |
501 | 0a8e90f4 | pbrook | fi |
502 | 5327cf48 | bellard | # the following are Linux specific |
503 | 831b7825 | ths | if [ "$linux_user" = "yes" ] ; then |
504 | 92a343da | j_mayer | target_list="i386-linux-user arm-linux-user armeb-linux-user sparc-linux-user ppc-linux-user mips-linux-user mipsel-linux-user m68k-linux-user alpha-linux-user ppc64-linux-user $target_list" |
505 | 831b7825 | ths | fi |
506 | 831b7825 | ths | # the following are Darwin specific |
507 | 831b7825 | ths | if [ "$darwin_user" = "yes" ] ; then |
508 | 831b7825 | ths | target_list="i386-darwin-user ppc-darwin-user $target_list" |
509 | 5327cf48 | bellard | fi |
510 | 6e20a45f | bellard | else |
511 | b1a550a0 | pbrook | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
512 | 5327cf48 | bellard | fi |
513 | 0a8e90f4 | pbrook | if test -z "$target_list" ; then |
514 | 0a8e90f4 | pbrook | echo "No targets enabled" |
515 | 0a8e90f4 | pbrook | exit 1 |
516 | 0a8e90f4 | pbrook | fi |
517 | 5327cf48 | bellard | |
518 | 7d13299d | bellard | if test -z "$cross_prefix" ; then |
519 | 7d13299d | bellard | |
520 | 7d13299d | bellard | # --- |
521 | 7d13299d | bellard | # big/little endian test |
522 | 7d13299d | bellard | cat > $TMPC << EOF |
523 | 7d13299d | bellard | #include <inttypes.h> |
524 | 7d13299d | bellard | int main(int argc, char ** argv){ |
525 | 1d14ffa9 | bellard | volatile uint32_t i=0x01234567; |
526 | 1d14ffa9 | bellard | return (*((uint8_t*)(&i))) == 0x67; |
527 | 7d13299d | bellard | } |
528 | 7d13299d | bellard | EOF |
529 | 7d13299d | bellard | |
530 | cf257238 | ths | if $cc -o $TMPE $TMPC 2> /dev/null ; then |
531 | 7d13299d | bellard | $TMPE && bigendian="yes" |
532 | 7d13299d | bellard | else |
533 | 7d13299d | bellard | echo big/little test failed |
534 | 7d13299d | bellard | fi |
535 | 7d13299d | bellard | |
536 | 7d13299d | bellard | else |
537 | 7d13299d | bellard | |
538 | 7d13299d | bellard | # if cross compiling, cannot launch a program, so make a static guess |
539 | fbe4f65b | ths | if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "mips64" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k" -o "$cpu" = "armv4b"; then |
540 | 7d13299d | bellard | bigendian="yes" |
541 | 7d13299d | bellard | fi |
542 | 7d13299d | bellard | |
543 | 7d13299d | bellard | fi |
544 | 7d13299d | bellard | |
545 | b6853697 | bellard | # host long bits test |
546 | b6853697 | bellard | hostlongbits="32" |
547 | b6853697 | bellard | if test "$cpu" = "sparc64" -o "$cpu" = "ia64" -o "$cpu" = "x86_64" -o "$cpu" = "alpha"; then |
548 | b6853697 | bellard | hostlongbits="64" |
549 | b6853697 | bellard | fi |
550 | b6853697 | bellard | |
551 | e8cd23de | bellard | # check gcc options support |
552 | 04369ff2 | bellard | cat > $TMPC <<EOF |
553 | 04369ff2 | bellard | int main(void) { |
554 | 04369ff2 | bellard | } |
555 | 04369ff2 | bellard | EOF |
556 | 04369ff2 | bellard | |
557 | 11d9f695 | bellard | ########################################## |
558 | 11d9f695 | bellard | # SDL probe |
559 | 11d9f695 | bellard | |
560 | 11d9f695 | bellard | sdl_too_old=no |
561 | 11d9f695 | bellard | |
562 | 11d9f695 | bellard | if test -z "$sdl" ; then |
563 | 069b0bda | ths | sdl_config="sdl-config" |
564 | 069b0bda | ths | sdl=no |
565 | 069b0bda | ths | sdl_static=no |
566 | 069b0bda | ths | |
567 | 069b0bda | ths | if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then |
568 | 069b0bda | ths | # win32 cross compilation case |
569 | 069b0bda | ths | sdl_config="i386-mingw32msvc-sdl-config" |
570 | 069b0bda | ths | sdl=yes |
571 | 069b0bda | ths | else |
572 | 069b0bda | ths | # normal SDL probe |
573 | 11d9f695 | bellard | cat > $TMPC << EOF |
574 | 11d9f695 | bellard | #include <SDL.h> |
575 | 11d9f695 | bellard | #undef main /* We don't want SDL to override our main() */ |
576 | 11d9f695 | bellard | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
577 | 11d9f695 | bellard | EOF |
578 | 069b0bda | ths | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then |
579 | 069b0bda | ths | _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'` |
580 | 069b0bda | ths | if test "$_sdlversion" -lt 121 ; then |
581 | 069b0bda | ths | sdl_too_old=yes |
582 | 069b0bda | ths | else |
583 | 069b0bda | ths | if test "$cocoa" = "no" ; then |
584 | 069b0bda | ths | sdl=yes |
585 | 069b0bda | ths | fi |
586 | 069b0bda | ths | fi |
587 | 11d9f695 | bellard | |
588 | 069b0bda | ths | # static link with sdl ? |
589 | 069b0bda | ths | if test "$sdl" = "yes" ; then |
590 | 069b0bda | ths | aa="no" |
591 | 069b0bda | ths | `$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes" |
592 | 069b0bda | ths | sdl_static_libs=`$sdl_config --static-libs 2>/dev/null` |
593 | 069b0bda | ths | if [ "$aa" = "yes" ] ; then |
594 | 069b0bda | ths | sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`" |
595 | 069b0bda | ths | fi |
596 | 069b0bda | ths | |
597 | 069b0bda | ths | if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC $sdl_static_libs 2> /dev/null; then |
598 | 069b0bda | ths | sdl_static=yes |
599 | 069b0bda | ths | fi |
600 | 069b0bda | ths | fi # static link |
601 | 069b0bda | ths | fi # sdl compile test |
602 | 069b0bda | ths | fi # cross compilation |
603 | fd677642 | ths | else |
604 | 069b0bda | ths | # Make sure to disable cocoa if sdl was set |
605 | 069b0bda | ths | if test "$sdl" = "yes" ; then |
606 | 069b0bda | ths | cocoa="no" |
607 | 069b0bda | ths | coreaudio="no" |
608 | 069b0bda | ths | fi |
609 | a6e022ad | bellard | fi # -z $sdl |
610 | 11d9f695 | bellard | |
611 | 8f28f3fb | ths | ########################################## |
612 | 8d5d2d4c | ths | # VNC TLS detection |
613 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
614 | 8d5d2d4c | ths | `pkg-config gnutls` || vnc_tls="no" |
615 | 8d5d2d4c | ths | fi |
616 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
617 | 8d5d2d4c | ths | vnc_tls_cflags=`pkg-config --cflags gnutls` |
618 | 8d5d2d4c | ths | vnc_tls_libs=`pkg-config --libs gnutls` |
619 | 8d5d2d4c | ths | fi |
620 | 8d5d2d4c | ths | |
621 | 8d5d2d4c | ths | ########################################## |
622 | 8f28f3fb | ths | # alsa sound support libraries |
623 | 8f28f3fb | ths | |
624 | 8f28f3fb | ths | if test "$alsa" = "yes" ; then |
625 | 8f28f3fb | ths | cat > $TMPC << EOF |
626 | 8f28f3fb | ths | #include <alsa/asoundlib.h> |
627 | 8f28f3fb | ths | int main(void) { snd_pcm_t **handle; return snd_pcm_close(*handle); } |
628 | 8f28f3fb | ths | EOF |
629 | 8f28f3fb | ths | if $cc -o $TMPE $TMPC -lasound 2> /dev/null ; then |
630 | 8f28f3fb | ths | : |
631 | 8f28f3fb | ths | else |
632 | 8f28f3fb | ths | echo |
633 | 8f28f3fb | ths | echo "Error: Could not find alsa" |
634 | 8f28f3fb | ths | echo "Make sure to have the alsa libs and headers installed." |
635 | 8f28f3fb | ths | echo |
636 | 8f28f3fb | ths | exit 1 |
637 | 8f28f3fb | ths | fi |
638 | 8f28f3fb | ths | fi |
639 | 8f28f3fb | ths | |
640 | cc8ae6de | pbrook | # Check if tools are available to build documentation. |
641 | 6c591867 | ths | if [ -x "`which texi2html 2>/dev/null`" ] && \ |
642 | 6c591867 | ths | [ -x "`which pod2man 2>/dev/null`" ]; then |
643 | cc8ae6de | pbrook | build_docs="yes" |
644 | cc8ae6de | pbrook | fi |
645 | cc8ae6de | pbrook | |
646 | 11d9f695 | bellard | if test "$mingw32" = "yes" ; then |
647 | 308c3593 | pbrook | if test -z "$prefix" ; then |
648 | 308c3593 | pbrook | prefix="/c/Program Files/Qemu" |
649 | 308c3593 | pbrook | fi |
650 | 308c3593 | pbrook | mansuffix="" |
651 | 308c3593 | pbrook | datasuffix="" |
652 | 308c3593 | pbrook | docsuffix="" |
653 | 308c3593 | pbrook | binsuffix="" |
654 | 11d9f695 | bellard | else |
655 | 308c3593 | pbrook | if test -z "$prefix" ; then |
656 | 308c3593 | pbrook | prefix="/usr/local" |
657 | 308c3593 | pbrook | fi |
658 | 308c3593 | pbrook | mansuffix="/share/man" |
659 | 308c3593 | pbrook | datasuffix="/share/qemu" |
660 | 308c3593 | pbrook | docsuffix="/share/doc/qemu" |
661 | 308c3593 | pbrook | binsuffix="/bin" |
662 | 11d9f695 | bellard | fi |
663 | 5a67135a | bellard | |
664 | 43ce4dfe | bellard | echo "Install prefix $prefix" |
665 | 308c3593 | pbrook | echo "BIOS directory $prefix$datasuffix" |
666 | 308c3593 | pbrook | echo "binary directory $prefix$binsuffix" |
667 | 11d9f695 | bellard | if test "$mingw32" = "no" ; then |
668 | 308c3593 | pbrook | echo "Manual directory $prefix$mansuffix" |
669 | 43ce4dfe | bellard | echo "ELF interp prefix $interp_prefix" |
670 | 11d9f695 | bellard | fi |
671 | 5a67135a | bellard | echo "Source path $source_path" |
672 | 43ce4dfe | bellard | echo "C compiler $cc" |
673 | 83469015 | bellard | echo "Host C compiler $host_cc" |
674 | 43ce4dfe | bellard | echo "make $make" |
675 | 6a882643 | pbrook | echo "install $install" |
676 | 43ce4dfe | bellard | echo "host CPU $cpu" |
677 | de83cd02 | bellard | echo "host big endian $bigendian" |
678 | 97a847bc | bellard | echo "target list $target_list" |
679 | 43ce4dfe | bellard | echo "gprof enabled $gprof" |
680 | 05c2a3e7 | bellard | echo "profiler $profiler" |
681 | 43ce4dfe | bellard | echo "static build $static" |
682 | 5b0753e0 | bellard | if test "$darwin" = "yes" ; then |
683 | 5b0753e0 | bellard | echo "Cocoa support $cocoa" |
684 | 5b0753e0 | bellard | fi |
685 | 97a847bc | bellard | echo "SDL support $sdl" |
686 | e4afee97 | bellard | if test "$sdl" != "no" ; then |
687 | e4afee97 | bellard | echo "SDL static link $sdl_static" |
688 | e4afee97 | bellard | fi |
689 | 67b915a5 | bellard | echo "mingw32 support $mingw32" |
690 | fb065187 | bellard | echo "Adlib support $adlib" |
691 | 1d14ffa9 | bellard | echo "CoreAudio support $coreaudio" |
692 | 1d14ffa9 | bellard | echo "ALSA support $alsa" |
693 | 1d14ffa9 | bellard | echo "DSound support $dsound" |
694 | 1d14ffa9 | bellard | if test "$fmod" = "yes"; then |
695 | 1d14ffa9 | bellard | if test -z $fmod_lib || test -z $fmod_inc; then |
696 | 1d14ffa9 | bellard | echo |
697 | 1d14ffa9 | bellard | echo "Error: You must specify path to FMOD library and headers" |
698 | 1d14ffa9 | bellard | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
699 | 1d14ffa9 | bellard | echo |
700 | 1d14ffa9 | bellard | exit 1 |
701 | 1d14ffa9 | bellard | fi |
702 | b1a550a0 | pbrook | fmod_support=" (lib='$fmod_lib' include='$fmod_inc')" |
703 | b1a550a0 | pbrook | else |
704 | b1a550a0 | pbrook | fmod_support="" |
705 | 102a52e4 | bellard | fi |
706 | b1a550a0 | pbrook | echo "FMOD support $fmod $fmod_support" |
707 | 6b4d2ba1 | ths | echo "OSS support $oss" |
708 | 8d5d2d4c | ths | echo "VNC TLS support $vnc_tls" |
709 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
710 | 8d5d2d4c | ths | echo " TLS CFLAGS $vnc_tls_cflags" |
711 | 8d5d2d4c | ths | echo " TLS LIBS $vnc_tls_libs" |
712 | 8d5d2d4c | ths | fi |
713 | 3142255c | blueswir1 | if test -n "$sparc_cpu"; then |
714 | 3142255c | blueswir1 | echo "Target Sparc Arch $sparc_cpu" |
715 | 3142255c | blueswir1 | fi |
716 | 07f4ddbf | bellard | echo "kqemu support $kqemu" |
717 | cc8ae6de | pbrook | echo "Documentation $build_docs" |
718 | c5937220 | pbrook | [ ! -z "$uname_release" ] && \ |
719 | c5937220 | pbrook | echo "uname -r $uname_release" |
720 | 67b915a5 | bellard | |
721 | 97a847bc | bellard | if test $sdl_too_old = "yes"; then |
722 | 24b55b96 | bellard | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
723 | 7c1f25b4 | bellard | fi |
724 | 20b40c6a | ths | if [ -s /tmp/qemu-$$-sdl-config.log ]; then |
725 | 20b40c6a | ths | echo "The error log from compiling the libSDL test is: " |
726 | 20b40c6a | ths | cat /tmp/qemu-$$-sdl-config.log |
727 | 20b40c6a | ths | fi |
728 | 20b40c6a | ths | rm -f /tmp/qemu-$$-sdl-config.log |
729 | 24b55b96 | bellard | #if test "$sdl_static" = "no"; then |
730 | 24b55b96 | bellard | # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" |
731 | 24b55b96 | bellard | #fi |
732 | 97a847bc | bellard | config_mak="config-host.mak" |
733 | 97a847bc | bellard | config_h="config-host.h" |
734 | 7d13299d | bellard | |
735 | 7c1f25b4 | bellard | #echo "Creating $config_mak and $config_h" |
736 | 7d13299d | bellard | |
737 | 15d9ca0f | ths | test -f $config_h && mv $config_h ${config_h}~ |
738 | 15d9ca0f | ths | |
739 | 97a847bc | bellard | echo "# Automatically generated by configure - do not modify" > $config_mak |
740 | 29517134 | pbrook | echo "# Configured with: $0 $@" >> $config_mak |
741 | 97a847bc | bellard | echo "/* Automatically generated by configure - do not modify */" > $config_h |
742 | 7d13299d | bellard | |
743 | 97a847bc | bellard | echo "prefix=$prefix" >> $config_mak |
744 | 308c3593 | pbrook | echo "bindir=\${prefix}$binsuffix" >> $config_mak |
745 | 308c3593 | pbrook | echo "mandir=\${prefix}$mansuffix" >> $config_mak |
746 | 308c3593 | pbrook | echo "datadir=\${prefix}$datasuffix" >> $config_mak |
747 | 4ad5b06d | ths | echo "docdir=\${prefix}$docsuffix" >> $config_mak |
748 | 308c3593 | pbrook | echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h |
749 | 97a847bc | bellard | echo "MAKE=$make" >> $config_mak |
750 | 6a882643 | pbrook | echo "INSTALL=$install" >> $config_mak |
751 | 97a847bc | bellard | echo "CC=$cc" >> $config_mak |
752 | 97a847bc | bellard | echo "HOST_CC=$host_cc" >> $config_mak |
753 | 97a847bc | bellard | echo "AR=$ar" >> $config_mak |
754 | 97a847bc | bellard | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak |
755 | 6f30fa85 | ths | echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak |
756 | 3142255c | blueswir1 | echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak |
757 | db8d7dd1 | ths | echo "VL_OS_LDFLAGS=$VL_OS_LDFLAGS" >> $config_mak |
758 | 3142255c | blueswir1 | echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak |
759 | 3142255c | blueswir1 | echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak |
760 | 97a847bc | bellard | echo "CFLAGS=$CFLAGS" >> $config_mak |
761 | 97a847bc | bellard | echo "LDFLAGS=$LDFLAGS" >> $config_mak |
762 | 67b915a5 | bellard | echo "EXESUF=$EXESUF" >> $config_mak |
763 | 70956b77 | ths | echo "AIOLIBS=$AIOLIBS" >> $config_mak |
764 | 97a847bc | bellard | if test "$cpu" = "i386" ; then |
765 | 97a847bc | bellard | echo "ARCH=i386" >> $config_mak |
766 | 97a847bc | bellard | echo "#define HOST_I386 1" >> $config_h |
767 | 0b0babc6 | bellard | elif test "$cpu" = "x86_64" ; then |
768 | 0b0babc6 | bellard | echo "ARCH=x86_64" >> $config_mak |
769 | 0b0babc6 | bellard | echo "#define HOST_X86_64 1" >> $config_h |
770 | 808c4954 | bellard | elif test "$cpu" = "armv4b" ; then |
771 | 808c4954 | bellard | echo "ARCH=arm" >> $config_mak |
772 | 808c4954 | bellard | echo "#define HOST_ARM 1" >> $config_h |
773 | 7d13299d | bellard | elif test "$cpu" = "armv4l" ; then |
774 | 97a847bc | bellard | echo "ARCH=arm" >> $config_mak |
775 | 97a847bc | bellard | echo "#define HOST_ARM 1" >> $config_h |
776 | 7d13299d | bellard | elif test "$cpu" = "powerpc" ; then |
777 | 97a847bc | bellard | echo "ARCH=ppc" >> $config_mak |
778 | 97a847bc | bellard | echo "#define HOST_PPC 1" >> $config_h |
779 | 7d13299d | bellard | elif test "$cpu" = "mips" ; then |
780 | 97a847bc | bellard | echo "ARCH=mips" >> $config_mak |
781 | 97a847bc | bellard | echo "#define HOST_MIPS 1" >> $config_h |
782 | fbe4f65b | ths | elif test "$cpu" = "mips64" ; then |
783 | fbe4f65b | ths | echo "ARCH=mips64" >> $config_mak |
784 | fbe4f65b | ths | echo "#define HOST_MIPS64 1" >> $config_h |
785 | fb3e5849 | bellard | elif test "$cpu" = "s390" ; then |
786 | 97a847bc | bellard | echo "ARCH=s390" >> $config_mak |
787 | 97a847bc | bellard | echo "#define HOST_S390 1" >> $config_h |
788 | 295defa5 | bellard | elif test "$cpu" = "alpha" ; then |
789 | 97a847bc | bellard | echo "ARCH=alpha" >> $config_mak |
790 | 97a847bc | bellard | echo "#define HOST_ALPHA 1" >> $config_h |
791 | ae228531 | bellard | elif test "$cpu" = "sparc" ; then |
792 | 97a847bc | bellard | echo "ARCH=sparc" >> $config_mak |
793 | 97a847bc | bellard | echo "#define HOST_SPARC 1" >> $config_h |
794 | ae228531 | bellard | elif test "$cpu" = "sparc64" ; then |
795 | 97a847bc | bellard | echo "ARCH=sparc64" >> $config_mak |
796 | 97a847bc | bellard | echo "#define HOST_SPARC64 1" >> $config_h |
797 | a8baa8c5 | bellard | elif test "$cpu" = "ia64" ; then |
798 | 97a847bc | bellard | echo "ARCH=ia64" >> $config_mak |
799 | 97a847bc | bellard | echo "#define HOST_IA64 1" >> $config_h |
800 | 38e584a0 | bellard | elif test "$cpu" = "m68k" ; then |
801 | 38ca2abc | bellard | echo "ARCH=m68k" >> $config_mak |
802 | 38ca2abc | bellard | echo "#define HOST_M68K 1" >> $config_h |
803 | 7d13299d | bellard | else |
804 | 3142255c | blueswir1 | echo "Unsupported CPU = $cpu" |
805 | 7d13299d | bellard | exit 1 |
806 | 7d13299d | bellard | fi |
807 | 7d13299d | bellard | if test "$bigendian" = "yes" ; then |
808 | 97a847bc | bellard | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
809 | 97a847bc | bellard | echo "#define WORDS_BIGENDIAN 1" >> $config_h |
810 | 97a847bc | bellard | fi |
811 | b6853697 | bellard | echo "#define HOST_LONG_BITS $hostlongbits" >> $config_h |
812 | 67b915a5 | bellard | if test "$mingw32" = "yes" ; then |
813 | 67b915a5 | bellard | echo "CONFIG_WIN32=yes" >> $config_mak |
814 | 11d9f695 | bellard | echo "#define CONFIG_WIN32 1" >> $config_h |
815 | 210fa556 | pbrook | else |
816 | 210fa556 | pbrook | cat > $TMPC << EOF |
817 | 210fa556 | pbrook | #include <byteswap.h> |
818 | 210fa556 | pbrook | int main(void) { return bswap_32(0); } |
819 | 210fa556 | pbrook | EOF |
820 | 210fa556 | pbrook | if $cc -o $TMPE $TMPC 2> /dev/null ; then |
821 | 210fa556 | pbrook | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
822 | 210fa556 | pbrook | fi |
823 | 67b915a5 | bellard | fi |
824 | 83fb7adf | bellard | if test "$darwin" = "yes" ; then |
825 | 83fb7adf | bellard | echo "CONFIG_DARWIN=yes" >> $config_mak |
826 | 83fb7adf | bellard | echo "#define CONFIG_DARWIN 1" >> $config_h |
827 | 83fb7adf | bellard | fi |
828 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
829 | ec530c81 | bellard | echo "CONFIG_SOLARIS=yes" >> $config_mak |
830 | 38cfa06c | bellard | echo "#define HOST_SOLARIS $solarisrev" >> $config_h |
831 | 0475a5ca | ths | if test "$needs_libsunmath" = "yes" ; then |
832 | 0475a5ca | ths | echo "NEEDS_LIBSUNMATH=yes" >> $config_mak |
833 | 0475a5ca | ths | echo "#define NEEDS_LIBSUNMATH 1" >> $config_h |
834 | 0475a5ca | ths | fi |
835 | ec530c81 | bellard | fi |
836 | 3142255c | blueswir1 | if test -n "$sparc_cpu"; then |
837 | 3142255c | blueswir1 | echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak |
838 | 3142255c | blueswir1 | echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h |
839 | 3142255c | blueswir1 | fi |
840 | 67b915a5 | bellard | if test "$gdbstub" = "yes" ; then |
841 | 67b915a5 | bellard | echo "CONFIG_GDBSTUB=yes" >> $config_mak |
842 | 67b915a5 | bellard | echo "#define CONFIG_GDBSTUB 1" >> $config_h |
843 | 67b915a5 | bellard | fi |
844 | 97a847bc | bellard | if test "$gprof" = "yes" ; then |
845 | 97a847bc | bellard | echo "TARGET_GPROF=yes" >> $config_mak |
846 | 97a847bc | bellard | echo "#define HAVE_GPROF 1" >> $config_h |
847 | 97a847bc | bellard | fi |
848 | 97a847bc | bellard | if test "$static" = "yes" ; then |
849 | 97a847bc | bellard | echo "CONFIG_STATIC=yes" >> $config_mak |
850 | 50863472 | bellard | echo "#define CONFIG_STATIC 1" >> $config_h |
851 | 7d13299d | bellard | fi |
852 | 05c2a3e7 | bellard | if test $profiler = "yes" ; then |
853 | 05c2a3e7 | bellard | echo "#define CONFIG_PROFILER 1" >> $config_h |
854 | 05c2a3e7 | bellard | fi |
855 | c20709aa | bellard | if test "$slirp" = "yes" ; then |
856 | c20709aa | bellard | echo "CONFIG_SLIRP=yes" >> $config_mak |
857 | c20709aa | bellard | echo "#define CONFIG_SLIRP 1" >> $config_h |
858 | c20709aa | bellard | fi |
859 | fb065187 | bellard | if test "$adlib" = "yes" ; then |
860 | fb065187 | bellard | echo "CONFIG_ADLIB=yes" >> $config_mak |
861 | fb065187 | bellard | echo "#define CONFIG_ADLIB 1" >> $config_h |
862 | fb065187 | bellard | fi |
863 | fb065187 | bellard | if test "$oss" = "yes" ; then |
864 | fb065187 | bellard | echo "CONFIG_OSS=yes" >> $config_mak |
865 | fb065187 | bellard | echo "#define CONFIG_OSS 1" >> $config_h |
866 | fb065187 | bellard | fi |
867 | 1d14ffa9 | bellard | if test "$coreaudio" = "yes" ; then |
868 | 1d14ffa9 | bellard | echo "CONFIG_COREAUDIO=yes" >> $config_mak |
869 | 1d14ffa9 | bellard | echo "#define CONFIG_COREAUDIO 1" >> $config_h |
870 | 1d14ffa9 | bellard | fi |
871 | 1d14ffa9 | bellard | if test "$alsa" = "yes" ; then |
872 | 1d14ffa9 | bellard | echo "CONFIG_ALSA=yes" >> $config_mak |
873 | 1d14ffa9 | bellard | echo "#define CONFIG_ALSA 1" >> $config_h |
874 | 1d14ffa9 | bellard | fi |
875 | 1d14ffa9 | bellard | if test "$dsound" = "yes" ; then |
876 | 1d14ffa9 | bellard | echo "CONFIG_DSOUND=yes" >> $config_mak |
877 | 1d14ffa9 | bellard | echo "#define CONFIG_DSOUND 1" >> $config_h |
878 | 1d14ffa9 | bellard | fi |
879 | 102a52e4 | bellard | if test "$fmod" = "yes" ; then |
880 | 102a52e4 | bellard | echo "CONFIG_FMOD=yes" >> $config_mak |
881 | 102a52e4 | bellard | echo "CONFIG_FMOD_LIB=$fmod_lib" >> $config_mak |
882 | 102a52e4 | bellard | echo "CONFIG_FMOD_INC=$fmod_inc" >> $config_mak |
883 | 102a52e4 | bellard | echo "#define CONFIG_FMOD 1" >> $config_h |
884 | 102a52e4 | bellard | fi |
885 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
886 | 8d5d2d4c | ths | echo "CONFIG_VNC_TLS=yes" >> $config_mak |
887 | 8d5d2d4c | ths | echo "CONFIG_VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_mak |
888 | 8d5d2d4c | ths | echo "CONFIG_VNC_TLS_LIBS=$vnc_tls_libs" >> $config_mak |
889 | 8d5d2d4c | ths | echo "#define CONFIG_VNC_TLS 1" >> $config_h |
890 | 8d5d2d4c | ths | fi |
891 | b1a550a0 | pbrook | qemu_version=`head $source_path/VERSION` |
892 | b1a550a0 | pbrook | echo "VERSION=$qemu_version" >>$config_mak |
893 | d4b8f039 | pbrook | echo "#define QEMU_VERSION \"$qemu_version\"" >> $config_h |
894 | 97a847bc | bellard | |
895 | 97a847bc | bellard | echo "SRC_PATH=$source_path" >> $config_mak |
896 | ad064840 | pbrook | if [ "$source_path_used" = "yes" ]; then |
897 | ad064840 | pbrook | echo "VPATH=$source_path" >> $config_mak |
898 | ad064840 | pbrook | fi |
899 | 97a847bc | bellard | echo "TARGET_DIRS=$target_list" >> $config_mak |
900 | cc8ae6de | pbrook | if [ "$build_docs" = "yes" ] ; then |
901 | cc8ae6de | pbrook | echo "BUILD_DOCS=yes" >> $config_mak |
902 | cc8ae6de | pbrook | fi |
903 | 97a847bc | bellard | |
904 | 83fb7adf | bellard | # XXX: suppress that |
905 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
906 | 43003046 | bellard | echo "#define O_LARGEFILE 0" >> $config_h |
907 | 43003046 | bellard | echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h |
908 | 7d3505c5 | bellard | echo "#define _BSD 1" >> $config_h |
909 | 7d3505c5 | bellard | fi |
910 | 7d3505c5 | bellard | |
911 | c5937220 | pbrook | echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h |
912 | c5937220 | pbrook | |
913 | c39e3338 | pbrook | tools= |
914 | c39e3338 | pbrook | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then |
915 | c39e3338 | pbrook | tools="qemu-img\$(EXESUF) $tools" |
916 | c39e3338 | pbrook | fi |
917 | c39e3338 | pbrook | echo "TOOLS=$tools" >> $config_mak |
918 | c39e3338 | pbrook | |
919 | 15d9ca0f | ths | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
920 | 15d9ca0f | ths | |
921 | 1d14ffa9 | bellard | for target in $target_list; do |
922 | 97a847bc | bellard | target_dir="$target" |
923 | 97a847bc | bellard | config_mak=$target_dir/config.mak |
924 | 97a847bc | bellard | config_h=$target_dir/config.h |
925 | 97a847bc | bellard | target_cpu=`echo $target | cut -d '-' -f 1` |
926 | 97a847bc | bellard | target_bigendian="no" |
927 | 808c4954 | bellard | [ "$target_cpu" = "armeb" ] && target_bigendian=yes |
928 | 1e43adfc | bellard | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
929 | 64b3ab24 | bellard | [ "$target_cpu" = "sparc64" ] && target_bigendian=yes |
930 | 67867308 | bellard | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
931 | a2458627 | bellard | [ "$target_cpu" = "ppc64" ] && target_bigendian=yes |
932 | d4082e95 | j_mayer | [ "$target_cpu" = "ppcemb" ] && target_bigendian=yes |
933 | d3258560 | bellard | [ "$target_cpu" = "mips" ] && target_bigendian=yes |
934 | fbe4f65b | ths | [ "$target_cpu" = "mips64" ] && target_bigendian=yes |
935 | 908f52b0 | pbrook | [ "$target_cpu" = "sh4eb" ] && target_bigendian=yes |
936 | e6e5906b | pbrook | [ "$target_cpu" = "m68k" ] && target_bigendian=yes |
937 | 97a847bc | bellard | target_softmmu="no" |
938 | 997344f3 | bellard | target_user_only="no" |
939 | 831b7825 | ths | target_linux_user="no" |
940 | 831b7825 | ths | target_darwin_user="no" |
941 | 9e407a85 | pbrook | case "$target" in |
942 | 9e407a85 | pbrook | ${target_cpu}-softmmu) |
943 | 9e407a85 | pbrook | target_softmmu="yes" |
944 | 9e407a85 | pbrook | ;; |
945 | 9e407a85 | pbrook | ${target_cpu}-linux-user) |
946 | 9e407a85 | pbrook | target_user_only="yes" |
947 | 9e407a85 | pbrook | target_linux_user="yes" |
948 | 9e407a85 | pbrook | ;; |
949 | 9e407a85 | pbrook | ${target_cpu}-darwin-user) |
950 | 9e407a85 | pbrook | target_user_only="yes" |
951 | 9e407a85 | pbrook | target_darwin_user="yes" |
952 | 9e407a85 | pbrook | ;; |
953 | 9e407a85 | pbrook | *) |
954 | 9e407a85 | pbrook | echo "ERROR: Target '$target' not recognised" |
955 | 9e407a85 | pbrook | exit 1 |
956 | 9e407a85 | pbrook | ;; |
957 | 9e407a85 | pbrook | esac |
958 | 831b7825 | ths | |
959 | 97ccc689 | bellard | if test "$target_user_only" = "no" -a "$check_gfx" = "yes" \ |
960 | 1d14ffa9 | bellard | -a "$sdl" = "no" -a "$cocoa" = "no" ; then |
961 | 97ccc689 | bellard | echo "ERROR: QEMU requires SDL or Cocoa for graphical output" |
962 | 9c038506 | pbrook | echo "To build QEMU without graphical output configure with --disable-gfx-check" |
963 | 97ccc689 | bellard | echo "Note that this will disable all output from the virtual graphics card." |
964 | 97ccc689 | bellard | exit 1; |
965 | 97ccc689 | bellard | fi |
966 | 97ccc689 | bellard | |
967 | 7c1f25b4 | bellard | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
968 | 97a847bc | bellard | |
969 | 15d9ca0f | ths | test -f $config_h && mv $config_h ${config_h}~ |
970 | 15d9ca0f | ths | |
971 | 97a847bc | bellard | mkdir -p $target_dir |
972 | 158142c2 | bellard | mkdir -p $target_dir/fpu |
973 | 831b7825 | ths | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" ; then |
974 | 69de927c | bellard | mkdir -p $target_dir/nwfpe |
975 | 69de927c | bellard | fi |
976 | a7e61ed4 | bellard | if test "$target_user_only" = "no" ; then |
977 | a7e61ed4 | bellard | mkdir -p $target_dir/slirp |
978 | a7e61ed4 | bellard | fi |
979 | 69de927c | bellard | |
980 | ec530c81 | bellard | # |
981 | ec530c81 | bellard | # don't use ln -sf as not all "ln -sf" over write the file/link |
982 | ec530c81 | bellard | # |
983 | ec530c81 | bellard | rm -f $target_dir/Makefile |
984 | ec530c81 | bellard | ln -s $source_path/Makefile.target $target_dir/Makefile |
985 | ec530c81 | bellard | |
986 | 97a847bc | bellard | |
987 | 97a847bc | bellard | echo "# Automatically generated by configure - do not modify" > $config_mak |
988 | 97a847bc | bellard | echo "/* Automatically generated by configure - do not modify */" > $config_h |
989 | 97a847bc | bellard | |
990 | de83cd02 | bellard | |
991 | 97a847bc | bellard | echo "include ../config-host.mak" >> $config_mak |
992 | 97a847bc | bellard | echo "#include \"../config-host.h\"" >> $config_h |
993 | 1e43adfc | bellard | |
994 | e5fe0c52 | pbrook | bflt="no" |
995 | 1e43adfc | bellard | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
996 | 1e43adfc | bellard | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h |
997 | 97a847bc | bellard | |
998 | 97a847bc | bellard | if test "$target_cpu" = "i386" ; then |
999 | 97a847bc | bellard | echo "TARGET_ARCH=i386" >> $config_mak |
1000 | 97a847bc | bellard | echo "#define TARGET_ARCH \"i386\"" >> $config_h |
1001 | 97a847bc | bellard | echo "#define TARGET_I386 1" >> $config_h |
1002 | 07f4ddbf | bellard | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then |
1003 | 824d560f | bellard | echo "#define USE_KQEMU 1" >> $config_h |
1004 | 824d560f | bellard | fi |
1005 | 808c4954 | bellard | elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then |
1006 | 97a847bc | bellard | echo "TARGET_ARCH=arm" >> $config_mak |
1007 | 97a847bc | bellard | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
1008 | 97a847bc | bellard | echo "#define TARGET_ARM 1" >> $config_h |
1009 | e5fe0c52 | pbrook | bflt="yes" |
1010 | 1e43adfc | bellard | elif test "$target_cpu" = "sparc" ; then |
1011 | 1e43adfc | bellard | echo "TARGET_ARCH=sparc" >> $config_mak |
1012 | 1e43adfc | bellard | echo "#define TARGET_ARCH \"sparc\"" >> $config_h |
1013 | 1e43adfc | bellard | echo "#define TARGET_SPARC 1" >> $config_h |
1014 | 64b3ab24 | bellard | elif test "$target_cpu" = "sparc64" ; then |
1015 | 64b3ab24 | bellard | echo "TARGET_ARCH=sparc64" >> $config_mak |
1016 | 64b3ab24 | bellard | echo "#define TARGET_ARCH \"sparc64\"" >> $config_h |
1017 | 64b3ab24 | bellard | echo "#define TARGET_SPARC 1" >> $config_h |
1018 | 64b3ab24 | bellard | echo "#define TARGET_SPARC64 1" >> $config_h |
1019 | 67867308 | bellard | elif test "$target_cpu" = "ppc" ; then |
1020 | 67867308 | bellard | echo "TARGET_ARCH=ppc" >> $config_mak |
1021 | 67867308 | bellard | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
1022 | 67867308 | bellard | echo "#define TARGET_PPC 1" >> $config_h |
1023 | a2458627 | bellard | elif test "$target_cpu" = "ppc64" ; then |
1024 | a2458627 | bellard | echo "TARGET_ARCH=ppc64" >> $config_mak |
1025 | a2458627 | bellard | echo "#define TARGET_ARCH \"ppc64\"" >> $config_h |
1026 | a2458627 | bellard | echo "#define TARGET_PPC 1" >> $config_h |
1027 | a2458627 | bellard | echo "#define TARGET_PPC64 1" >> $config_h |
1028 | d4082e95 | j_mayer | elif test "$target_cpu" = "ppcemb" ; then |
1029 | d4082e95 | j_mayer | echo "TARGET_ARCH=ppcemb" >> $config_mak |
1030 | d4082e95 | j_mayer | echo "#define TARGET_ARCH \"ppcemb\"" >> $config_h |
1031 | d4082e95 | j_mayer | echo "#define TARGET_PPC 1" >> $config_h |
1032 | d4082e95 | j_mayer | echo "#define TARGET_PPCEMB 1" >> $config_h |
1033 | 0b0babc6 | bellard | elif test "$target_cpu" = "x86_64" ; then |
1034 | 0b0babc6 | bellard | echo "TARGET_ARCH=x86_64" >> $config_mak |
1035 | 0b0babc6 | bellard | echo "#define TARGET_ARCH \"x86_64\"" >> $config_h |
1036 | 0b0babc6 | bellard | echo "#define TARGET_I386 1" >> $config_h |
1037 | 0b0babc6 | bellard | echo "#define TARGET_X86_64 1" >> $config_h |
1038 | 07f4ddbf | bellard | if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "x86_64" ; then |
1039 | 07f4ddbf | bellard | echo "#define USE_KQEMU 1" >> $config_h |
1040 | 07f4ddbf | bellard | fi |
1041 | c20eb473 | bellard | elif test "$target_cpu" = "mips" -o "$target_cpu" = "mipsel" ; then |
1042 | d3258560 | bellard | echo "TARGET_ARCH=mips" >> $config_mak |
1043 | d3258560 | bellard | echo "#define TARGET_ARCH \"mips\"" >> $config_h |
1044 | d3258560 | bellard | echo "#define TARGET_MIPS 1" >> $config_h |
1045 | 6ea83fed | bellard | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
1046 | 6ea83fed | bellard | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
1047 | fbe4f65b | ths | elif test "$target_cpu" = "mips64" -o "$target_cpu" = "mips64el" ; then |
1048 | fbe4f65b | ths | echo "TARGET_ARCH=mips64" >> $config_mak |
1049 | fbe4f65b | ths | echo "#define TARGET_ARCH \"mips64\"" >> $config_h |
1050 | fbe4f65b | ths | echo "#define TARGET_MIPS 1" >> $config_h |
1051 | fbe4f65b | ths | echo "#define TARGET_MIPS64 1" >> $config_h |
1052 | fbe4f65b | ths | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
1053 | fbe4f65b | ths | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
1054 | 908f52b0 | pbrook | elif test "$target_cpu" = "sh4" -o "$target_cpu" = "sh4eb" ; then |
1055 | fdf9b3e8 | bellard | echo "TARGET_ARCH=sh4" >> $config_mak |
1056 | fdf9b3e8 | bellard | echo "#define TARGET_ARCH \"sh4\"" >> $config_h |
1057 | fdf9b3e8 | bellard | echo "#define TARGET_SH4 1" >> $config_h |
1058 | 4dbed897 | pbrook | bflt="yes" |
1059 | e6e5906b | pbrook | elif test "$target_cpu" = "m68k" ; then |
1060 | e6e5906b | pbrook | echo "TARGET_ARCH=m68k" >> $config_mak |
1061 | e6e5906b | pbrook | echo "#define TARGET_ARCH \"m68k\"" >> $config_h |
1062 | e6e5906b | pbrook | echo "#define TARGET_M68K 1" >> $config_h |
1063 | e6e5906b | pbrook | bflt="yes" |
1064 | cf6c1b16 | j_mayer | elif test "$target_cpu" = "alpha" ; then |
1065 | cf6c1b16 | j_mayer | echo "TARGET_ARCH=alpha" >> $config_mak |
1066 | cf6c1b16 | j_mayer | echo "#define TARGET_ARCH \"alpha\"" >> $config_h |
1067 | cf6c1b16 | j_mayer | echo "#define TARGET_ALPHA 1" >> $config_h |
1068 | de83cd02 | bellard | else |
1069 | de83cd02 | bellard | echo "Unsupported target CPU" |
1070 | de83cd02 | bellard | exit 1 |
1071 | de83cd02 | bellard | fi |
1072 | de83cd02 | bellard | if test "$target_bigendian" = "yes" ; then |
1073 | 97a847bc | bellard | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
1074 | 97a847bc | bellard | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h |
1075 | de83cd02 | bellard | fi |
1076 | 97a847bc | bellard | if test "$target_softmmu" = "yes" ; then |
1077 | 97a847bc | bellard | echo "CONFIG_SOFTMMU=yes" >> $config_mak |
1078 | 97a847bc | bellard | echo "#define CONFIG_SOFTMMU 1" >> $config_h |
1079 | 43ce4dfe | bellard | fi |
1080 | 997344f3 | bellard | if test "$target_user_only" = "yes" ; then |
1081 | 997344f3 | bellard | echo "CONFIG_USER_ONLY=yes" >> $config_mak |
1082 | 997344f3 | bellard | echo "#define CONFIG_USER_ONLY 1" >> $config_h |
1083 | 997344f3 | bellard | fi |
1084 | 831b7825 | ths | if test "$target_linux_user" = "yes" ; then |
1085 | 831b7825 | ths | echo "CONFIG_LINUX_USER=yes" >> $config_mak |
1086 | 831b7825 | ths | echo "#define CONFIG_LINUX_USER 1" >> $config_h |
1087 | 831b7825 | ths | fi |
1088 | 831b7825 | ths | if test "$target_darwin_user" = "yes" ; then |
1089 | 831b7825 | ths | echo "CONFIG_DARWIN_USER=yes" >> $config_mak |
1090 | 831b7825 | ths | echo "#define CONFIG_DARWIN_USER 1" >> $config_h |
1091 | 831b7825 | ths | fi |
1092 | 97a847bc | bellard | |
1093 | e6e5906b | pbrook | if test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" -o "$target_cpu" = "sparc" -o "$target_cpu" = "sparc64" -o "$target_cpu" = "m68k"; then |
1094 | 158142c2 | bellard | echo "CONFIG_SOFTFLOAT=yes" >> $config_mak |
1095 | 158142c2 | bellard | echo "#define CONFIG_SOFTFLOAT 1" >> $config_h |
1096 | 158142c2 | bellard | fi |
1097 | e5fe0c52 | pbrook | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
1098 | e5fe0c52 | pbrook | echo "TARGET_HAS_BFLT=yes" >> $config_mak |
1099 | e5fe0c52 | pbrook | echo "#define TARGET_HAS_BFLT 1" >> $config_h |
1100 | e5fe0c52 | pbrook | fi |
1101 | 7c1f25b4 | bellard | # sdl defines |
1102 | 7c1f25b4 | bellard | |
1103 | 7c1f25b4 | bellard | if test "$target_user_only" = "no"; then |
1104 | 7c1f25b4 | bellard | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
1105 | dbb2c921 | bellard | sdl1=$sdl_static |
1106 | 7c1f25b4 | bellard | else |
1107 | dbb2c921 | bellard | sdl1=$sdl |
1108 | dbb2c921 | bellard | fi |
1109 | dbb2c921 | bellard | if test "$sdl1" = "yes" ; then |
1110 | dbb2c921 | bellard | echo "#define CONFIG_SDL 1" >> $config_h |
1111 | dbb2c921 | bellard | echo "CONFIG_SDL=yes" >> $config_mak |
1112 | dbb2c921 | bellard | if test "$target_softmmu" = "no" -o "$static" = "yes"; then |
1113 | dbb2c921 | bellard | echo "SDL_LIBS=$sdl_static_libs" >> $config_mak |
1114 | dbb2c921 | bellard | else |
1115 | 7c1f25b4 | bellard | echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak |
1116 | 7c1f25b4 | bellard | fi |
1117 | dbb2c921 | bellard | if [ "${aa}" = "yes" ] ; then |
1118 | b1a550a0 | pbrook | echo "SDL_CFLAGS=`$sdl_config --cflags` `aalib-config --cflags`" >> $config_mak |
1119 | b1a550a0 | pbrook | else |
1120 | b1a550a0 | pbrook | echo "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak |
1121 | dbb2c921 | bellard | fi |
1122 | 7c1f25b4 | bellard | fi |
1123 | 7c1f25b4 | bellard | fi |
1124 | 7c1f25b4 | bellard | |
1125 | 5b0753e0 | bellard | if test "$cocoa" = "yes" ; then |
1126 | 5b0753e0 | bellard | echo "#define CONFIG_COCOA 1" >> $config_h |
1127 | 5b0753e0 | bellard | echo "CONFIG_COCOA=yes" >> $config_mak |
1128 | 5b0753e0 | bellard | fi |
1129 | 5b0753e0 | bellard | |
1130 | 15d9ca0f | ths | test -f ${config_h}~ && cmp -s $config_h ${config_h}~ && mv ${config_h}~ $config_h |
1131 | 15d9ca0f | ths | |
1132 | 97a847bc | bellard | done # for target in $targets |
1133 | 7d13299d | bellard | |
1134 | 7d13299d | bellard | # build tree in object directory if source path is different from current one |
1135 | 7d13299d | bellard | if test "$source_path_used" = "yes" ; then |
1136 | 7d13299d | bellard | DIRS="tests" |
1137 | 7d13299d | bellard | FILES="Makefile tests/Makefile" |
1138 | 7d13299d | bellard | for dir in $DIRS ; do |
1139 | 7d13299d | bellard | mkdir -p $dir |
1140 | 7d13299d | bellard | done |
1141 | ec530c81 | bellard | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
1142 | 7d13299d | bellard | for f in $FILES ; do |
1143 | ec530c81 | bellard | rm -f $f |
1144 | ec530c81 | bellard | ln -s $source_path/$f $f |
1145 | 7d13299d | bellard | done |
1146 | 7d13299d | bellard | fi |
1147 | 7d13299d | bellard | |
1148 | 97a847bc | bellard | rm -f $TMPO $TMPC $TMPE $TMPS |