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