root / configure @ 8d0eb050
History | View | Annotate | Download (63.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 | 7d13299d | bellard | |
18 | 9784cde5 | Juan Quintela | trap "rm -f $TMPC $TMPO $TMPE ; exit" 0 2 3 15 |
19 | 9ac81bbb | malc | |
20 | 52166aa0 | Juan Quintela | compile_object() { |
21 | a558ee17 | Juan Quintela | $cc $QEMU_CFLAGS -c -o $TMPO $TMPC > /dev/null 2> /dev/null |
22 | 52166aa0 | Juan Quintela | } |
23 | 52166aa0 | Juan Quintela | |
24 | 52166aa0 | Juan Quintela | compile_prog() { |
25 | 52166aa0 | Juan Quintela | local_cflags="$1" |
26 | 52166aa0 | Juan Quintela | local_ldflags="$2" |
27 | a558ee17 | Juan Quintela | $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags > /dev/null 2> /dev/null |
28 | 52166aa0 | Juan Quintela | } |
29 | 52166aa0 | Juan Quintela | |
30 | 7d13299d | bellard | # default parameters |
31 | 2ff6b91e | Juan Quintela | cpu="" |
32 | 11d9f695 | bellard | prefix="" |
33 | 1e43adfc | bellard | interp_prefix="/usr/gnemul/qemu-%M" |
34 | 43ce4dfe | bellard | static="no" |
35 | ed968ff1 | Juan Quintela | sparc_cpu="" |
36 | 7d13299d | bellard | cross_prefix="" |
37 | 7d13299d | bellard | cc="gcc" |
38 | 0c58ac1c | malc | audio_drv_list="" |
39 | 4c9b53e3 | malc | audio_card_list="ac97 es1370 sb16" |
40 | 4c9b53e3 | malc | audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus" |
41 | 7d13299d | bellard | host_cc="gcc" |
42 | 7d13299d | bellard | ar="ar" |
43 | 7d13299d | bellard | make="make" |
44 | 6a882643 | pbrook | install="install" |
45 | 7aa486fe | Anthony Liguori | objcopy="objcopy" |
46 | 7aa486fe | Anthony Liguori | ld="ld" |
47 | c81da56e | Juan Quintela | helper_cflags="" |
48 | 73da375e | Juan Quintela | libs_softmmu="" |
49 | 3e2e0e6b | Juan Quintela | libs_tools="" |
50 | 67f86e8e | Juan Quintela | audio_pt_int="" |
51 | ac0df51d | aliguori | |
52 | ac0df51d | aliguori | # parse CC options first |
53 | ac0df51d | aliguori | for opt do |
54 | ac0df51d | aliguori | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
55 | ac0df51d | aliguori | case "$opt" in |
56 | ac0df51d | aliguori | --cross-prefix=*) cross_prefix="$optarg" |
57 | ac0df51d | aliguori | ;; |
58 | ac0df51d | aliguori | --cc=*) cc="$optarg" |
59 | ac0df51d | aliguori | ;; |
60 | 2ff6b91e | Juan Quintela | --cpu=*) cpu="$optarg" |
61 | 2ff6b91e | Juan Quintela | ;; |
62 | a558ee17 | Juan Quintela | --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" |
63 | e2a2ed06 | Juan Quintela | ;; |
64 | e2a2ed06 | Juan Quintela | --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" |
65 | e2a2ed06 | Juan Quintela | ;; |
66 | 50e7b1a0 | Juan Quintela | --sparc_cpu=*) |
67 | 50e7b1a0 | Juan Quintela | sparc_cpu="$optarg" |
68 | 50e7b1a0 | Juan Quintela | case $sparc_cpu in |
69 | ed968ff1 | Juan Quintela | v7|v8|v8plus|v8plusa) |
70 | 50e7b1a0 | Juan Quintela | cpu="sparc" |
71 | 50e7b1a0 | Juan Quintela | ;; |
72 | 50e7b1a0 | Juan Quintela | v9) |
73 | 50e7b1a0 | Juan Quintela | cpu="sparc64" |
74 | 50e7b1a0 | Juan Quintela | ;; |
75 | 50e7b1a0 | Juan Quintela | *) |
76 | 50e7b1a0 | Juan Quintela | echo "undefined SPARC architecture. Exiting"; |
77 | 50e7b1a0 | Juan Quintela | exit 1 |
78 | 50e7b1a0 | Juan Quintela | ;; |
79 | 50e7b1a0 | Juan Quintela | esac |
80 | 50e7b1a0 | Juan Quintela | ;; |
81 | ac0df51d | aliguori | esac |
82 | ac0df51d | aliguori | done |
83 | ac0df51d | aliguori | # OS specific |
84 | ac0df51d | aliguori | # Using uname is really, really broken. Once we have the right set of checks |
85 | ac0df51d | aliguori | # we can eliminate it's usage altogether |
86 | ac0df51d | aliguori | |
87 | ac0df51d | aliguori | cc="${cross_prefix}${cc}" |
88 | ac0df51d | aliguori | ar="${cross_prefix}${ar}" |
89 | 7aa486fe | Anthony Liguori | objcopy="${cross_prefix}${objcopy}" |
90 | 7aa486fe | Anthony Liguori | ld="${cross_prefix}${ld}" |
91 | ac0df51d | aliguori | |
92 | ac0df51d | aliguori | # check that the C compiler works. |
93 | ac0df51d | aliguori | cat > $TMPC <<EOF |
94 | ac0df51d | aliguori | int main(void) {} |
95 | ac0df51d | aliguori | EOF |
96 | ac0df51d | aliguori | |
97 | 52166aa0 | Juan Quintela | if compile_object ; then |
98 | ac0df51d | aliguori | : C compiler works ok |
99 | ac0df51d | aliguori | else |
100 | ac0df51d | aliguori | echo "ERROR: \"$cc\" either does not exist or does not work" |
101 | ac0df51d | aliguori | exit 1 |
102 | ac0df51d | aliguori | fi |
103 | ac0df51d | aliguori | |
104 | ac0df51d | aliguori | check_define() { |
105 | ac0df51d | aliguori | cat > $TMPC <<EOF |
106 | ac0df51d | aliguori | #if !defined($1) |
107 | ac0df51d | aliguori | #error Not defined |
108 | ac0df51d | aliguori | #endif |
109 | ac0df51d | aliguori | int main(void) { return 0; } |
110 | ac0df51d | aliguori | EOF |
111 | 52166aa0 | Juan Quintela | compile_object |
112 | ac0df51d | aliguori | } |
113 | ac0df51d | aliguori | |
114 | 2ff6b91e | Juan Quintela | if test ! -z "$cpu" ; then |
115 | 2ff6b91e | Juan Quintela | # command line argument |
116 | 2ff6b91e | Juan Quintela | : |
117 | 2ff6b91e | Juan Quintela | elif check_define __i386__ ; then |
118 | ac0df51d | aliguori | cpu="i386" |
119 | ac0df51d | aliguori | elif check_define __x86_64__ ; then |
120 | ac0df51d | aliguori | cpu="x86_64" |
121 | 3aa9bd6c | blueswir1 | elif check_define __sparc__ ; then |
122 | 3aa9bd6c | blueswir1 | # We can't check for 64 bit (when gcc is biarch) or V8PLUSA |
123 | 3aa9bd6c | blueswir1 | # They must be specified using --sparc_cpu |
124 | 3aa9bd6c | blueswir1 | if check_define __arch64__ ; then |
125 | 3aa9bd6c | blueswir1 | cpu="sparc64" |
126 | 3aa9bd6c | blueswir1 | else |
127 | 3aa9bd6c | blueswir1 | cpu="sparc" |
128 | 3aa9bd6c | blueswir1 | fi |
129 | fdf7ed96 | malc | elif check_define _ARCH_PPC ; then |
130 | fdf7ed96 | malc | if check_define _ARCH_PPC64 ; then |
131 | fdf7ed96 | malc | cpu="ppc64" |
132 | fdf7ed96 | malc | else |
133 | fdf7ed96 | malc | cpu="ppc" |
134 | fdf7ed96 | malc | fi |
135 | ac0df51d | aliguori | else |
136 | fdf7ed96 | malc | cpu=`uname -m` |
137 | ac0df51d | aliguori | fi |
138 | ac0df51d | aliguori | |
139 | 5327cf48 | bellard | target_list="" |
140 | 7d13299d | bellard | case "$cpu" in |
141 | ea8f20f8 | Juan Quintela | alpha|cris|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|sparc64) |
142 | ea8f20f8 | Juan Quintela | cpu="$cpu" |
143 | ea8f20f8 | Juan Quintela | ;; |
144 | 7d13299d | bellard | i386|i486|i586|i686|i86pc|BePC) |
145 | 97a847bc | bellard | cpu="i386" |
146 | 7d13299d | bellard | ;; |
147 | aaa5fa14 | aurel32 | x86_64|amd64) |
148 | aaa5fa14 | aurel32 | cpu="x86_64" |
149 | aaa5fa14 | aurel32 | ;; |
150 | ba68055e | bellard | armv*b) |
151 | 808c4954 | bellard | cpu="armv4b" |
152 | 808c4954 | bellard | ;; |
153 | ba68055e | bellard | armv*l) |
154 | 7d13299d | bellard | cpu="armv4l" |
155 | 7d13299d | bellard | ;; |
156 | f54b3f92 | aurel32 | parisc|parisc64) |
157 | f54b3f92 | aurel32 | cpu="hppa" |
158 | f54b3f92 | aurel32 | ;; |
159 | 0e7b8a9f | ths | s390*) |
160 | fb3e5849 | bellard | cpu="s390" |
161 | fb3e5849 | bellard | ;; |
162 | 3142255c | blueswir1 | sparc|sun4[cdmuv]) |
163 | ae228531 | bellard | cpu="sparc" |
164 | ae228531 | bellard | ;; |
165 | 7d13299d | bellard | *) |
166 | 7d13299d | bellard | cpu="unknown" |
167 | 7d13299d | bellard | ;; |
168 | 7d13299d | bellard | esac |
169 | e2d52ad3 | Juan Quintela | |
170 | e2d52ad3 | Juan Quintela | # Default value for a variable defining feature "foo" |
171 | e2d52ad3 | Juan Quintela | # * foo="no", feature will only be used if --enable-foo arg is given |
172 | e2d52ad3 | Juan Quintela | # * foo="", feature will be searched for, and if found, will be used |
173 | e2d52ad3 | Juan Quintela | # * foo="yes", this value vill only be set by --enable-foo flag. |
174 | e2d52ad3 | Juan Quintela | # feature will searched for, if not found, configure exits with error |
175 | e2d52ad3 | Juan Quintela | # |
176 | e2d52ad3 | Juan Quintela | # Always add --enable-foo and --disable-foo command line args. Distributions want |
177 | e2d52ad3 | Juan Quintela | # to ensure that several features are compiled in, and it is impossible without a |
178 | e2d52ad3 | Juan Quintela | # --enable-foo that exits if feature is not found |
179 | e2d52ad3 | Juan Quintela | |
180 | a20a6f46 | Juan Quintela | bluez="" |
181 | 4ffcedb6 | Juan Quintela | brlapi="" |
182 | 788c8196 | Juan Quintela | curl="" |
183 | c584a6d0 | Juan Quintela | curses="" |
184 | a25dba17 | Juan Quintela | docs="" |
185 | 2df87df7 | Juan Quintela | fdt="" |
186 | b31a0277 | Juan Quintela | kvm="" |
187 | b0a47e79 | Juan Quintela | nptl="" |
188 | c4198157 | Juan Quintela | sdl="" |
189 | dfffc653 | Juan Quintela | sparse="no" |
190 | ee682d27 | Stefan Weil | uuid="" |
191 | dfb278bd | Juan Quintela | vde="" |
192 | 1be10ad2 | Juan Quintela | vnc_tls="" |
193 | ea784e3b | Juan Quintela | vnc_sasl="" |
194 | fc321b4b | Juan Quintela | xen="" |
195 | 5c6c3a6c | Christoph Hellwig | linux_aio="" |
196 | dfb278bd | Juan Quintela | |
197 | 7d13299d | bellard | gprof="no" |
198 | f8393946 | aurel32 | debug_tcg="no" |
199 | f3d08ee6 | Paul Brook | debug="no" |
200 | 1625af87 | aliguori | strip_opt="yes" |
201 | 7d13299d | bellard | bigendian="no" |
202 | 67b915a5 | bellard | mingw32="no" |
203 | 67b915a5 | bellard | EXESUF="" |
204 | 443f1376 | bellard | slirp="yes" |
205 | 102a52e4 | bellard | fmod_lib="" |
206 | 102a52e4 | bellard | fmod_inc="" |
207 | 2f6a1ab0 | blueswir1 | oss_lib="" |
208 | b1a550a0 | pbrook | bsd="no" |
209 | 5327cf48 | bellard | linux="no" |
210 | d2c7c9b8 | blueswir1 | solaris="no" |
211 | 05c2a3e7 | bellard | profiler="no" |
212 | 5b0753e0 | bellard | cocoa="no" |
213 | 0a8e90f4 | pbrook | softmmu="yes" |
214 | 831b7825 | ths | linux_user="no" |
215 | 831b7825 | ths | darwin_user="no" |
216 | 84778508 | blueswir1 | bsd_user="no" |
217 | 379f6698 | Paul Brook | guest_base="" |
218 | c5937220 | pbrook | uname_release="" |
219 | e5d355d1 | aliguori | io_thread="no" |
220 | 8ff9cbf7 | malc | mixemu="no" |
221 | eac30262 | aliguori | kerneldir="" |
222 | b29fe3ed | malc | aix="no" |
223 | 77755340 | ths | blobs="yes" |
224 | 4a19f1ec | pbrook | pkgversion="" |
225 | 5495ed11 | Luiz Capitulino | check_utests="no" |
226 | 34005a00 | Kirill A. Shutemov | user_pie="no" |
227 | 7d13299d | bellard | |
228 | 7d13299d | bellard | # OS specific |
229 | ac0df51d | aliguori | if check_define __linux__ ; then |
230 | ac0df51d | aliguori | targetos="Linux" |
231 | ac0df51d | aliguori | elif check_define _WIN32 ; then |
232 | ac0df51d | aliguori | targetos='MINGW32' |
233 | 169dc5d3 | blueswir1 | elif check_define __OpenBSD__ ; then |
234 | 169dc5d3 | blueswir1 | targetos='OpenBSD' |
235 | 169dc5d3 | blueswir1 | elif check_define __sun__ ; then |
236 | 169dc5d3 | blueswir1 | targetos='SunOS' |
237 | ac0df51d | aliguori | else |
238 | ac0df51d | aliguori | targetos=`uname -s` |
239 | ac0df51d | aliguori | fi |
240 | 0dbfc675 | Juan Quintela | |
241 | 7d13299d | bellard | case $targetos in |
242 | c326e0af | bellard | CYGWIN*) |
243 | 0dbfc675 | Juan Quintela | mingw32="yes" |
244 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" |
245 | 0dbfc675 | Juan Quintela | audio_possible_drivers="sdl" |
246 | c326e0af | bellard | ;; |
247 | 67b915a5 | bellard | MINGW32*) |
248 | 0dbfc675 | Juan Quintela | mingw32="yes" |
249 | 0dbfc675 | Juan Quintela | audio_possible_drivers="dsound sdl fmod" |
250 | 67b915a5 | bellard | ;; |
251 | 5c40d2bd | ths | GNU/kFreeBSD) |
252 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
253 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
254 | 5c40d2bd | ths | ;; |
255 | 7d3505c5 | bellard | FreeBSD) |
256 | 0dbfc675 | Juan Quintela | bsd="yes" |
257 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
258 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
259 | 7d3505c5 | bellard | ;; |
260 | c5e97233 | blueswir1 | DragonFly) |
261 | 0dbfc675 | Juan Quintela | bsd="yes" |
262 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
263 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd pa" |
264 | c5e97233 | blueswir1 | ;; |
265 | 7d3505c5 | bellard | NetBSD) |
266 | 0dbfc675 | Juan Quintela | bsd="yes" |
267 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
268 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd" |
269 | 0dbfc675 | Juan Quintela | oss_lib="-lossaudio" |
270 | 7d3505c5 | bellard | ;; |
271 | 7d3505c5 | bellard | OpenBSD) |
272 | 0dbfc675 | Juan Quintela | bsd="yes" |
273 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
274 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl esd" |
275 | 0dbfc675 | Juan Quintela | oss_lib="-lossaudio" |
276 | 7d3505c5 | bellard | ;; |
277 | 83fb7adf | bellard | Darwin) |
278 | 0dbfc675 | Juan Quintela | bsd="yes" |
279 | 0dbfc675 | Juan Quintela | darwin="yes" |
280 | 0dbfc675 | Juan Quintela | # on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can |
281 | 0dbfc675 | Juan Quintela | # run 64-bit userspace code |
282 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" ] ; then |
283 | aab8588a | malc | is_x86_64=`sysctl -n hw.optional.x86_64` |
284 | aab8588a | malc | [ "$is_x86_64" = "1" ] && cpu=x86_64 |
285 | 0dbfc675 | Juan Quintela | fi |
286 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "x86_64" ] ; then |
287 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" |
288 | 0c439cbf | Juan Quintela | LDFLAGS="-arch x86_64 $LDFLAGS" |
289 | 0dbfc675 | Juan Quintela | else |
290 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" |
291 | 0dbfc675 | Juan Quintela | fi |
292 | 0dbfc675 | Juan Quintela | darwin_user="yes" |
293 | 0dbfc675 | Juan Quintela | cocoa="yes" |
294 | 0dbfc675 | Juan Quintela | audio_drv_list="coreaudio" |
295 | 0dbfc675 | Juan Quintela | audio_possible_drivers="coreaudio sdl fmod" |
296 | 0dbfc675 | Juan Quintela | LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" |
297 | 7973f21c | Juan Quintela | libs_softmmu="-F/System/Library/Frameworks -framework Cocoa -framework IOKit $libs_softmmu" |
298 | 83fb7adf | bellard | ;; |
299 | ec530c81 | bellard | SunOS) |
300 | 0dbfc675 | Juan Quintela | solaris="yes" |
301 | 0dbfc675 | Juan Quintela | make="gmake" |
302 | 0dbfc675 | Juan Quintela | install="ginstall" |
303 | fa58948d | Blue Swirl | ld="gld" |
304 | 0dbfc675 | Juan Quintela | needs_libsunmath="no" |
305 | 0dbfc675 | Juan Quintela | solarisrev=`uname -r | cut -f2 -d.` |
306 | 0dbfc675 | Juan Quintela | # have to select again, because `uname -m` returns i86pc |
307 | 0dbfc675 | Juan Quintela | # even on an x86_64 box. |
308 | 0dbfc675 | Juan Quintela | solariscpu=`isainfo -k` |
309 | 0dbfc675 | Juan Quintela | if test "${solariscpu}" = "amd64" ; then |
310 | 0dbfc675 | Juan Quintela | cpu="x86_64" |
311 | 0dbfc675 | Juan Quintela | fi |
312 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
313 | 0dbfc675 | Juan Quintela | if test "$solarisrev" -le 9 ; then |
314 | 0dbfc675 | Juan Quintela | if test -f /opt/SUNWspro/prod/lib/libsunmath.so.1; then |
315 | 0dbfc675 | Juan Quintela | needs_libsunmath="yes" |
316 | f14bfdf9 | Juan Quintela | QEMU_CFLAGS="-I/opt/SUNWspro/prod/include/cc $QEMU_CFLAGS" |
317 | f14bfdf9 | Juan Quintela | LDFLAGS="-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib $LDFLAGS" |
318 | f14bfdf9 | Juan Quintela | LIBS="-lsunmath $LIBS" |
319 | 0dbfc675 | Juan Quintela | else |
320 | 0dbfc675 | Juan Quintela | echo "QEMU will not link correctly on Solaris 8/X86 or 9/x86 without" |
321 | 0dbfc675 | Juan Quintela | echo "libsunmath from the Sun Studio compilers tools, due to a lack of" |
322 | 0dbfc675 | Juan Quintela | echo "C99 math features in libm.so in Solaris 8/x86 and Solaris 9/x86" |
323 | 0dbfc675 | Juan Quintela | echo "Studio 11 can be downloaded from www.sun.com." |
324 | 0dbfc675 | Juan Quintela | exit 1 |
325 | 0dbfc675 | Juan Quintela | fi |
326 | 86b2bd93 | ths | fi |
327 | 0dbfc675 | Juan Quintela | fi |
328 | 0dbfc675 | Juan Quintela | if test -f /usr/include/sys/soundcard.h ; then |
329 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
330 | 0dbfc675 | Juan Quintela | fi |
331 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss sdl" |
332 | d741429a | Blue Swirl | # needed for CMSG_ macros in sys/socket.h |
333 | d741429a | Blue Swirl | QEMU_CFLAGS="-D_XOPEN_SOURCE=600 $QEMU_CFLAGS" |
334 | d741429a | Blue Swirl | # needed for TIOCWIN* defines in termios.h |
335 | d741429a | Blue Swirl | QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" |
336 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-std=gnu99 $QEMU_CFLAGS" |
337 | e174c0bb | Juan Quintela | LIBS="-lsocket -lnsl -lresolv $LIBS" |
338 | 86b2bd93 | ths | ;; |
339 | b29fe3ed | malc | AIX) |
340 | 0dbfc675 | Juan Quintela | aix="yes" |
341 | 0dbfc675 | Juan Quintela | make="gmake" |
342 | b29fe3ed | malc | ;; |
343 | 1d14ffa9 | bellard | *) |
344 | 0dbfc675 | Juan Quintela | audio_drv_list="oss" |
345 | 0dbfc675 | Juan Quintela | audio_possible_drivers="oss alsa sdl esd pa" |
346 | 0dbfc675 | Juan Quintela | linux="yes" |
347 | 0dbfc675 | Juan Quintela | linux_user="yes" |
348 | 0dbfc675 | Juan Quintela | usb="linux" |
349 | 0dbfc675 | Juan Quintela | if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then |
350 | c2de5c91 | malc | audio_possible_drivers="$audio_possible_drivers fmod" |
351 | 0dbfc675 | Juan Quintela | fi |
352 | fb065187 | bellard | ;; |
353 | 7d13299d | bellard | esac |
354 | 7d13299d | bellard | |
355 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
356 | b1a550a0 | pbrook | if [ "$darwin" != "yes" ] ; then |
357 | 83fb7adf | bellard | make="gmake" |
358 | 68063649 | blueswir1 | usb="bsd" |
359 | 83fb7adf | bellard | fi |
360 | 84778508 | blueswir1 | bsd_user="yes" |
361 | 7d3505c5 | bellard | fi |
362 | 7d3505c5 | bellard | |
363 | 3457a3f8 | Juan Quintela | if test "$mingw32" = "yes" ; then |
364 | 3457a3f8 | Juan Quintela | EXESUF=".exe" |
365 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" |
366 | 884044aa | Juan Quintela | LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" |
367 | 3457a3f8 | Juan Quintela | fi |
368 | 3457a3f8 | Juan Quintela | |
369 | 7d13299d | bellard | # find source path |
370 | ad064840 | pbrook | source_path=`dirname "$0"` |
371 | 59faef3a | balrog | source_path_used="no" |
372 | 59faef3a | balrog | workdir=`pwd` |
373 | ad064840 | pbrook | if [ -z "$source_path" ]; then |
374 | 59faef3a | balrog | source_path=$workdir |
375 | ad064840 | pbrook | else |
376 | ad064840 | pbrook | source_path=`cd "$source_path"; pwd` |
377 | 7d13299d | bellard | fi |
378 | 724db118 | pbrook | [ -f "$workdir/vl.c" ] || source_path_used="yes" |
379 | 7d13299d | bellard | |
380 | 487fefdb | Anthony Liguori | werror="" |
381 | 85aa5189 | bellard | |
382 | 7d13299d | bellard | for opt do |
383 | a46e4035 | pbrook | optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` |
384 | 7d13299d | bellard | case "$opt" in |
385 | 2efc3265 | bellard | --help|-h) show_help=yes |
386 | 2efc3265 | bellard | ;; |
387 | b1a550a0 | pbrook | --prefix=*) prefix="$optarg" |
388 | 7d13299d | bellard | ;; |
389 | b1a550a0 | pbrook | --interp-prefix=*) interp_prefix="$optarg" |
390 | 32ce6337 | bellard | ;; |
391 | b1a550a0 | pbrook | --source-path=*) source_path="$optarg" |
392 | ad064840 | pbrook | source_path_used="yes" |
393 | 7d13299d | bellard | ;; |
394 | ac0df51d | aliguori | --cross-prefix=*) |
395 | 7d13299d | bellard | ;; |
396 | ac0df51d | aliguori | --cc=*) |
397 | 7d13299d | bellard | ;; |
398 | b1a550a0 | pbrook | --host-cc=*) host_cc="$optarg" |
399 | 83469015 | bellard | ;; |
400 | b1a550a0 | pbrook | --make=*) make="$optarg" |
401 | 7d13299d | bellard | ;; |
402 | 6a882643 | pbrook | --install=*) install="$optarg" |
403 | 6a882643 | pbrook | ;; |
404 | e2a2ed06 | Juan Quintela | --extra-cflags=*) |
405 | 7d13299d | bellard | ;; |
406 | e2a2ed06 | Juan Quintela | --extra-ldflags=*) |
407 | 7d13299d | bellard | ;; |
408 | 2ff6b91e | Juan Quintela | --cpu=*) |
409 | 7d13299d | bellard | ;; |
410 | b1a550a0 | pbrook | --target-list=*) target_list="$optarg" |
411 | de83cd02 | bellard | ;; |
412 | 7d13299d | bellard | --enable-gprof) gprof="yes" |
413 | 7d13299d | bellard | ;; |
414 | 43ce4dfe | bellard | --static) static="yes" |
415 | 43ce4dfe | bellard | ;; |
416 | 97a847bc | bellard | --disable-sdl) sdl="no" |
417 | 97a847bc | bellard | ;; |
418 | c4198157 | Juan Quintela | --enable-sdl) sdl="yes" |
419 | c4198157 | Juan Quintela | ;; |
420 | 0c58ac1c | malc | --fmod-lib=*) fmod_lib="$optarg" |
421 | 1d14ffa9 | bellard | ;; |
422 | c2de5c91 | malc | --fmod-inc=*) fmod_inc="$optarg" |
423 | c2de5c91 | malc | ;; |
424 | 2f6a1ab0 | blueswir1 | --oss-lib=*) oss_lib="$optarg" |
425 | 2f6a1ab0 | blueswir1 | ;; |
426 | 2fa7d3bf | malc | --audio-card-list=*) audio_card_list=`echo "$optarg" | sed -e 's/,/ /g'` |
427 | 102a52e4 | bellard | ;; |
428 | 0c58ac1c | malc | --audio-drv-list=*) audio_drv_list="$optarg" |
429 | 102a52e4 | bellard | ;; |
430 | f8393946 | aurel32 | --enable-debug-tcg) debug_tcg="yes" |
431 | f8393946 | aurel32 | ;; |
432 | f8393946 | aurel32 | --disable-debug-tcg) debug_tcg="no" |
433 | f8393946 | aurel32 | ;; |
434 | f3d08ee6 | Paul Brook | --enable-debug) |
435 | f3d08ee6 | Paul Brook | # Enable debugging options that aren't excessively noisy |
436 | f3d08ee6 | Paul Brook | debug_tcg="yes" |
437 | f3d08ee6 | Paul Brook | debug="yes" |
438 | f3d08ee6 | Paul Brook | strip_opt="no" |
439 | f3d08ee6 | Paul Brook | ;; |
440 | 03b4fe7d | aliguori | --enable-sparse) sparse="yes" |
441 | 03b4fe7d | aliguori | ;; |
442 | 03b4fe7d | aliguori | --disable-sparse) sparse="no" |
443 | 03b4fe7d | aliguori | ;; |
444 | 1625af87 | aliguori | --disable-strip) strip_opt="no" |
445 | 1625af87 | aliguori | ;; |
446 | 8d5d2d4c | ths | --disable-vnc-tls) vnc_tls="no" |
447 | 8d5d2d4c | ths | ;; |
448 | 1be10ad2 | Juan Quintela | --enable-vnc-tls) vnc_tls="yes" |
449 | 1be10ad2 | Juan Quintela | ;; |
450 | 2f9606b3 | aliguori | --disable-vnc-sasl) vnc_sasl="no" |
451 | 2f9606b3 | aliguori | ;; |
452 | ea784e3b | Juan Quintela | --enable-vnc-sasl) vnc_sasl="yes" |
453 | ea784e3b | Juan Quintela | ;; |
454 | 443f1376 | bellard | --disable-slirp) slirp="no" |
455 | 1d14ffa9 | bellard | ;; |
456 | ee682d27 | Stefan Weil | --disable-uuid) uuid="no" |
457 | ee682d27 | Stefan Weil | ;; |
458 | ee682d27 | Stefan Weil | --enable-uuid) uuid="yes" |
459 | ee682d27 | Stefan Weil | ;; |
460 | e0e6c8c0 | aliguori | --disable-vde) vde="no" |
461 | 8a16d273 | ths | ;; |
462 | dfb278bd | Juan Quintela | --enable-vde) vde="yes" |
463 | dfb278bd | Juan Quintela | ;; |
464 | e37630ca | aliguori | --disable-xen) xen="no" |
465 | e37630ca | aliguori | ;; |
466 | fc321b4b | Juan Quintela | --enable-xen) xen="yes" |
467 | fc321b4b | Juan Quintela | ;; |
468 | 2e4d9fb1 | aurel32 | --disable-brlapi) brlapi="no" |
469 | 2e4d9fb1 | aurel32 | ;; |
470 | 4ffcedb6 | Juan Quintela | --enable-brlapi) brlapi="yes" |
471 | 4ffcedb6 | Juan Quintela | ;; |
472 | fb599c9a | balrog | --disable-bluez) bluez="no" |
473 | fb599c9a | balrog | ;; |
474 | a20a6f46 | Juan Quintela | --enable-bluez) bluez="yes" |
475 | a20a6f46 | Juan Quintela | ;; |
476 | 7ba1e619 | aliguori | --disable-kvm) kvm="no" |
477 | 7ba1e619 | aliguori | ;; |
478 | b31a0277 | Juan Quintela | --enable-kvm) kvm="yes" |
479 | b31a0277 | Juan Quintela | ;; |
480 | 05c2a3e7 | bellard | --enable-profiler) profiler="yes" |
481 | 05c2a3e7 | bellard | ;; |
482 | c2de5c91 | malc | --enable-cocoa) |
483 | c2de5c91 | malc | cocoa="yes" ; |
484 | c2de5c91 | malc | sdl="no" ; |
485 | c2de5c91 | malc | audio_drv_list="coreaudio `echo $audio_drv_list | sed s,coreaudio,,g`" |
486 | 1d14ffa9 | bellard | ;; |
487 | cad25d69 | pbrook | --disable-system) softmmu="no" |
488 | 0a8e90f4 | pbrook | ;; |
489 | cad25d69 | pbrook | --enable-system) softmmu="yes" |
490 | 0a8e90f4 | pbrook | ;; |
491 | 0953a80f | Zachary Amsden | --disable-user) |
492 | 0953a80f | Zachary Amsden | linux_user="no" ; |
493 | 0953a80f | Zachary Amsden | bsd_user="no" ; |
494 | 0953a80f | Zachary Amsden | darwin_user="no" |
495 | 0953a80f | Zachary Amsden | ;; |
496 | 0953a80f | Zachary Amsden | --enable-user) ;; |
497 | 831b7825 | ths | --disable-linux-user) linux_user="no" |
498 | 0a8e90f4 | pbrook | ;; |
499 | 831b7825 | ths | --enable-linux-user) linux_user="yes" |
500 | 831b7825 | ths | ;; |
501 | 831b7825 | ths | --disable-darwin-user) darwin_user="no" |
502 | 831b7825 | ths | ;; |
503 | 831b7825 | ths | --enable-darwin-user) darwin_user="yes" |
504 | 0a8e90f4 | pbrook | ;; |
505 | 84778508 | blueswir1 | --disable-bsd-user) bsd_user="no" |
506 | 84778508 | blueswir1 | ;; |
507 | 84778508 | blueswir1 | --enable-bsd-user) bsd_user="yes" |
508 | 84778508 | blueswir1 | ;; |
509 | 379f6698 | Paul Brook | --enable-guest-base) guest_base="yes" |
510 | 379f6698 | Paul Brook | ;; |
511 | 379f6698 | Paul Brook | --disable-guest-base) guest_base="no" |
512 | 379f6698 | Paul Brook | ;; |
513 | 34005a00 | Kirill A. Shutemov | --enable-user-pie) user_pie="yes" |
514 | 34005a00 | Kirill A. Shutemov | ;; |
515 | 34005a00 | Kirill A. Shutemov | --disable-user-pie) user_pie="no" |
516 | 34005a00 | Kirill A. Shutemov | ;; |
517 | c5937220 | pbrook | --enable-uname-release=*) uname_release="$optarg" |
518 | c5937220 | pbrook | ;; |
519 | 3142255c | blueswir1 | --sparc_cpu=*) |
520 | 3142255c | blueswir1 | ;; |
521 | 85aa5189 | bellard | --enable-werror) werror="yes" |
522 | 85aa5189 | bellard | ;; |
523 | 85aa5189 | bellard | --disable-werror) werror="no" |
524 | 85aa5189 | bellard | ;; |
525 | 4d3b6f6e | balrog | --disable-curses) curses="no" |
526 | 4d3b6f6e | balrog | ;; |
527 | c584a6d0 | Juan Quintela | --enable-curses) curses="yes" |
528 | c584a6d0 | Juan Quintela | ;; |
529 | 769ce76d | Alexander Graf | --disable-curl) curl="no" |
530 | 769ce76d | Alexander Graf | ;; |
531 | 788c8196 | Juan Quintela | --enable-curl) curl="yes" |
532 | 788c8196 | Juan Quintela | ;; |
533 | 2df87df7 | Juan Quintela | --disable-fdt) fdt="no" |
534 | 2df87df7 | Juan Quintela | ;; |
535 | 2df87df7 | Juan Quintela | --enable-fdt) fdt="yes" |
536 | 2df87df7 | Juan Quintela | ;; |
537 | 5495ed11 | Luiz Capitulino | --disable-check-utests) check_utests="no" |
538 | 5495ed11 | Luiz Capitulino | ;; |
539 | 5495ed11 | Luiz Capitulino | --enable-check-utests) check_utests="yes" |
540 | 5495ed11 | Luiz Capitulino | ;; |
541 | bd0c5661 | pbrook | --disable-nptl) nptl="no" |
542 | bd0c5661 | pbrook | ;; |
543 | b0a47e79 | Juan Quintela | --enable-nptl) nptl="yes" |
544 | b0a47e79 | Juan Quintela | ;; |
545 | 8ff9cbf7 | malc | --enable-mixemu) mixemu="yes" |
546 | 8ff9cbf7 | malc | ;; |
547 | 5c6c3a6c | Christoph Hellwig | --disable-linux-aio) linux_aio="no" |
548 | 5c6c3a6c | Christoph Hellwig | ;; |
549 | 5c6c3a6c | Christoph Hellwig | --enable-linux-aio) linux_aio="yes" |
550 | 5c6c3a6c | Christoph Hellwig | ;; |
551 | e5d355d1 | aliguori | --enable-io-thread) io_thread="yes" |
552 | e5d355d1 | aliguori | ;; |
553 | 77755340 | ths | --disable-blobs) blobs="no" |
554 | 77755340 | ths | ;; |
555 | eac30262 | aliguori | --kerneldir=*) kerneldir="$optarg" |
556 | eac30262 | aliguori | ;; |
557 | 4a19f1ec | pbrook | --with-pkgversion=*) pkgversion=" ($optarg)" |
558 | 4a19f1ec | pbrook | ;; |
559 | a25dba17 | Juan Quintela | --disable-docs) docs="no" |
560 | 70ec5dc0 | Anthony Liguori | ;; |
561 | a25dba17 | Juan Quintela | --enable-docs) docs="yes" |
562 | 83a3ab8b | Juan Quintela | ;; |
563 | 7f1559c6 | balrog | *) echo "ERROR: unknown option $opt"; show_help="yes" |
564 | 7f1559c6 | balrog | ;; |
565 | 7d13299d | bellard | esac |
566 | 7d13299d | bellard | done |
567 | 7d13299d | bellard | |
568 | 3142255c | blueswir1 | # |
569 | 3142255c | blueswir1 | # If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right |
570 | a558ee17 | Juan Quintela | # QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) |
571 | 3142255c | blueswir1 | # |
572 | 379f6698 | Paul Brook | host_guest_base="no" |
573 | 40293e58 | bellard | case "$cpu" in |
574 | ed968ff1 | Juan Quintela | sparc) case $sparc_cpu in |
575 | ed968ff1 | Juan Quintela | v7|v8) |
576 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
577 | ed968ff1 | Juan Quintela | ;; |
578 | ed968ff1 | Juan Quintela | v8plus|v8plusa) |
579 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" |
580 | ed968ff1 | Juan Quintela | ;; |
581 | ed968ff1 | Juan Quintela | *) # sparc_cpu not defined in the command line |
582 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" |
583 | ed968ff1 | Juan Quintela | esac |
584 | ed968ff1 | Juan Quintela | LDFLAGS="-m32 $LDFLAGS" |
585 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS" |
586 | 762e8230 | blueswir1 | if test "$solaris" = "no" ; then |
587 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS" |
588 | c81da56e | Juan Quintela | helper_cflags="-ffixed-i0" |
589 | 762e8230 | blueswir1 | fi |
590 | 3142255c | blueswir1 | ;; |
591 | ed968ff1 | Juan Quintela | sparc64) |
592 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" |
593 | ed968ff1 | Juan Quintela | LDFLAGS="-m64 $LDFLAGS" |
594 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" |
595 | ed968ff1 | Juan Quintela | if test "$solaris" != "no" ; then |
596 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS" |
597 | 762e8230 | blueswir1 | fi |
598 | 3142255c | blueswir1 | ;; |
599 | 76d83bde | ths | s390) |
600 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-march=z900 $QEMU_CFLAGS" |
601 | 76d83bde | ths | ;; |
602 | 40293e58 | bellard | i386) |
603 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m32 $QEMU_CFLAGS" |
604 | 0c439cbf | Juan Quintela | LDFLAGS="-m32 $LDFLAGS" |
605 | c81da56e | Juan Quintela | helper_cflags="-fomit-frame-pointer" |
606 | 379f6698 | Paul Brook | host_guest_base="yes" |
607 | 40293e58 | bellard | ;; |
608 | 40293e58 | bellard | x86_64) |
609 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-m64 $QEMU_CFLAGS" |
610 | 0c439cbf | Juan Quintela | LDFLAGS="-m64 $LDFLAGS" |
611 | 379f6698 | Paul Brook | host_guest_base="yes" |
612 | 379f6698 | Paul Brook | ;; |
613 | 379f6698 | Paul Brook | arm*) |
614 | 379f6698 | Paul Brook | host_guest_base="yes" |
615 | 40293e58 | bellard | ;; |
616 | f6548c0a | malc | ppc*) |
617 | f6548c0a | malc | host_guest_base="yes" |
618 | f6548c0a | malc | ;; |
619 | 3142255c | blueswir1 | esac |
620 | 3142255c | blueswir1 | |
621 | 379f6698 | Paul Brook | [ -z "$guest_base" ] && guest_base="$host_guest_base" |
622 | 379f6698 | Paul Brook | |
623 | af5db58e | pbrook | if test x"$show_help" = x"yes" ; then |
624 | af5db58e | pbrook | cat << EOF |
625 | af5db58e | pbrook | |
626 | af5db58e | pbrook | Usage: configure [options] |
627 | af5db58e | pbrook | Options: [defaults in brackets after descriptions] |
628 | af5db58e | pbrook | |
629 | af5db58e | pbrook | EOF |
630 | af5db58e | pbrook | echo "Standard options:" |
631 | af5db58e | pbrook | echo " --help print this message" |
632 | af5db58e | pbrook | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
633 | af5db58e | pbrook | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
634 | af5db58e | pbrook | echo " use %M for cpu name [$interp_prefix]" |
635 | af5db58e | pbrook | echo " --target-list=LIST set target list [$target_list]" |
636 | af5db58e | pbrook | echo "" |
637 | af5db58e | pbrook | echo "Advanced options (experts only):" |
638 | af5db58e | pbrook | echo " --source-path=PATH path of source code [$source_path]" |
639 | af5db58e | pbrook | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
640 | af5db58e | pbrook | echo " --cc=CC use C compiler CC [$cc]" |
641 | af5db58e | pbrook | echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." |
642 | a558ee17 | Juan Quintela | echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" |
643 | e3fc14c3 | Jan Kiszka | echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" |
644 | af5db58e | pbrook | echo " --make=MAKE use specified make [$make]" |
645 | 6a882643 | pbrook | echo " --install=INSTALL use specified install [$install]" |
646 | af5db58e | pbrook | echo " --static enable static build [$static]" |
647 | f8393946 | aurel32 | echo " --enable-debug-tcg enable TCG debugging" |
648 | f8393946 | aurel32 | echo " --disable-debug-tcg disable TCG debugging (default)" |
649 | 09695a4a | Stefan Weil | echo " --enable-debug enable common debug build options" |
650 | 890b1658 | aliguori | echo " --enable-sparse enable sparse checker" |
651 | 890b1658 | aliguori | echo " --disable-sparse disable sparse checker (default)" |
652 | 1625af87 | aliguori | echo " --disable-strip disable stripping binaries" |
653 | 85aa5189 | bellard | echo " --disable-werror disable compilation abort on warning" |
654 | fe8f78e4 | balrog | echo " --disable-sdl disable SDL" |
655 | c4198157 | Juan Quintela | echo " --enable-sdl enable SDL" |
656 | af5db58e | pbrook | echo " --enable-cocoa enable COCOA (Mac OS X only)" |
657 | c2de5c91 | malc | echo " --audio-drv-list=LIST set audio drivers list:" |
658 | c2de5c91 | malc | echo " Available drivers: $audio_possible_drivers" |
659 | 4c9b53e3 | malc | echo " --audio-card-list=LIST set list of emulated audio cards [$audio_card_list]" |
660 | 4c9b53e3 | malc | echo " Available cards: $audio_possible_cards" |
661 | 8ff9cbf7 | malc | echo " --enable-mixemu enable mixer emulation" |
662 | e37630ca | aliguori | echo " --disable-xen disable xen backend driver support" |
663 | fc321b4b | Juan Quintela | echo " --enable-xen enable xen backend driver support" |
664 | 2e4d9fb1 | aurel32 | echo " --disable-brlapi disable BrlAPI" |
665 | 4ffcedb6 | Juan Quintela | echo " --enable-brlapi enable BrlAPI" |
666 | 8d5d2d4c | ths | echo " --disable-vnc-tls disable TLS encryption for VNC server" |
667 | 1be10ad2 | Juan Quintela | echo " --enable-vnc-tls enable TLS encryption for VNC server" |
668 | 2f9606b3 | aliguori | echo " --disable-vnc-sasl disable SASL encryption for VNC server" |
669 | ea784e3b | Juan Quintela | echo " --enable-vnc-sasl enable SASL encryption for VNC server" |
670 | af896aaa | pbrook | echo " --disable-curses disable curses output" |
671 | c584a6d0 | Juan Quintela | echo " --enable-curses enable curses output" |
672 | 769ce76d | Alexander Graf | echo " --disable-curl disable curl connectivity" |
673 | 788c8196 | Juan Quintela | echo " --enable-curl enable curl connectivity" |
674 | 2df87df7 | Juan Quintela | echo " --disable-fdt disable fdt device tree" |
675 | 2df87df7 | Juan Quintela | echo " --enable-fdt enable fdt device tree" |
676 | 5495ed11 | Luiz Capitulino | echo " --disable-check-utests disable check unit-tests" |
677 | 5495ed11 | Luiz Capitulino | echo " --enable-check-utests enable check unit-tests" |
678 | fb599c9a | balrog | echo " --disable-bluez disable bluez stack connectivity" |
679 | a20a6f46 | Juan Quintela | echo " --enable-bluez enable bluez stack connectivity" |
680 | 7ba1e619 | aliguori | echo " --disable-kvm disable KVM acceleration support" |
681 | b31a0277 | Juan Quintela | echo " --enable-kvm enable KVM acceleration support" |
682 | bd0c5661 | pbrook | echo " --disable-nptl disable usermode NPTL support" |
683 | e5934d33 | Andre Przywara | echo " --enable-nptl enable usermode NPTL support" |
684 | af5db58e | pbrook | echo " --enable-system enable all system emulation targets" |
685 | af5db58e | pbrook | echo " --disable-system disable all system emulation targets" |
686 | 0953a80f | Zachary Amsden | echo " --enable-user enable supported user emulation targets" |
687 | 0953a80f | Zachary Amsden | echo " --disable-user disable all user emulation targets" |
688 | 831b7825 | ths | echo " --enable-linux-user enable all linux usermode emulation targets" |
689 | 831b7825 | ths | echo " --disable-linux-user disable all linux usermode emulation targets" |
690 | 831b7825 | ths | echo " --enable-darwin-user enable all darwin usermode emulation targets" |
691 | 831b7825 | ths | echo " --disable-darwin-user disable all darwin usermode emulation targets" |
692 | 84778508 | blueswir1 | echo " --enable-bsd-user enable all BSD usermode emulation targets" |
693 | 84778508 | blueswir1 | echo " --disable-bsd-user disable all BSD usermode emulation targets" |
694 | 379f6698 | Paul Brook | echo " --enable-guest-base enable GUEST_BASE support for usermode" |
695 | 379f6698 | Paul Brook | echo " emulation targets" |
696 | 379f6698 | Paul Brook | echo " --disable-guest-base disable GUEST_BASE support" |
697 | 34005a00 | Kirill A. Shutemov | echo " --enable-user-pie build usermode emulation targets as PIE" |
698 | 34005a00 | Kirill A. Shutemov | echo " --disable-user-pie do not build usermode emulation targets as PIE" |
699 | af5db58e | pbrook | echo " --fmod-lib path to FMOD library" |
700 | af5db58e | pbrook | echo " --fmod-inc path to FMOD includes" |
701 | 2f6a1ab0 | blueswir1 | echo " --oss-lib path to OSS library" |
702 | c5937220 | pbrook | echo " --enable-uname-release=R Return R for uname -r in usermode emulation" |
703 | 3142255c | blueswir1 | echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" |
704 | ee682d27 | Stefan Weil | echo " --disable-uuid disable uuid support" |
705 | ee682d27 | Stefan Weil | echo " --enable-uuid enable uuid support" |
706 | e0e6c8c0 | aliguori | echo " --disable-vde disable support for vde network" |
707 | dfb278bd | Juan Quintela | echo " --enable-vde enable support for vde network" |
708 | 5c6c3a6c | Christoph Hellwig | echo " --disable-linux-aio disable Linux AIO support" |
709 | 5c6c3a6c | Christoph Hellwig | echo " --enable-linux-aio enable Linux AIO support" |
710 | e5d355d1 | aliguori | echo " --enable-io-thread enable IO thread" |
711 | 77755340 | ths | echo " --disable-blobs disable installing provided firmware blobs" |
712 | eac30262 | aliguori | echo " --kerneldir=PATH look for kernel includes in PATH" |
713 | af5db58e | pbrook | echo "" |
714 | 5bf08934 | ths | echo "NOTE: The object files are built at the place where configure is launched" |
715 | af5db58e | pbrook | exit 1 |
716 | af5db58e | pbrook | fi |
717 | af5db58e | pbrook | |
718 | ec530c81 | bellard | # |
719 | ec530c81 | bellard | # Solaris specific configure tool chain decisions |
720 | ec530c81 | bellard | # |
721 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
722 | ec530c81 | bellard | solinst=`which $install 2> /dev/null | /usr/bin/grep -v "no $install in"` |
723 | ec530c81 | bellard | if test -z "$solinst" ; then |
724 | ec530c81 | bellard | echo "Solaris install program not found. Use --install=/usr/ucb/install or" |
725 | ec530c81 | bellard | echo "install fileutils from www.blastwave.org using pkg-get -i fileutils" |
726 | ec530c81 | bellard | echo "to get ginstall which is used by default (which lives in /opt/csw/bin)" |
727 | ec530c81 | bellard | exit 1 |
728 | ec530c81 | bellard | fi |
729 | ec530c81 | bellard | if test "$solinst" = "/usr/sbin/install" ; then |
730 | ec530c81 | bellard | echo "Error: Solaris /usr/sbin/install is not an appropriate install program." |
731 | ec530c81 | bellard | echo "try ginstall from the GNU fileutils available from www.blastwave.org" |
732 | ec530c81 | bellard | echo "using pkg-get -i fileutils, or use --install=/usr/ucb/install" |
733 | ec530c81 | bellard | exit 1 |
734 | ec530c81 | bellard | fi |
735 | ec530c81 | bellard | sol_ar=`which ar 2> /dev/null | /usr/bin/grep -v "no ar in"` |
736 | ec530c81 | bellard | if test -z "$sol_ar" ; then |
737 | ec530c81 | bellard | echo "Error: No path includes ar" |
738 | ec530c81 | bellard | if test -f /usr/ccs/bin/ar ; then |
739 | ec530c81 | bellard | echo "Add /usr/ccs/bin to your path and rerun configure" |
740 | ec530c81 | bellard | fi |
741 | ec530c81 | bellard | exit 1 |
742 | ec530c81 | bellard | fi |
743 | 5fafdf24 | ths | fi |
744 | ec530c81 | bellard | |
745 | ec530c81 | bellard | |
746 | 5327cf48 | bellard | if test -z "$target_list" ; then |
747 | 5327cf48 | bellard | # these targets are portable |
748 | 0a8e90f4 | pbrook | if [ "$softmmu" = "yes" ] ; then |
749 | 2408a527 | aurel32 | target_list="\ |
750 | 2408a527 | aurel32 | i386-softmmu \ |
751 | 2408a527 | aurel32 | x86_64-softmmu \ |
752 | 2408a527 | aurel32 | arm-softmmu \ |
753 | 2408a527 | aurel32 | cris-softmmu \ |
754 | 2408a527 | aurel32 | m68k-softmmu \ |
755 | 72b675ca | Edgar E. Iglesias | microblaze-softmmu \ |
756 | 2408a527 | aurel32 | mips-softmmu \ |
757 | 2408a527 | aurel32 | mipsel-softmmu \ |
758 | 2408a527 | aurel32 | mips64-softmmu \ |
759 | 2408a527 | aurel32 | mips64el-softmmu \ |
760 | 2408a527 | aurel32 | ppc-softmmu \ |
761 | 2408a527 | aurel32 | ppcemb-softmmu \ |
762 | 2408a527 | aurel32 | ppc64-softmmu \ |
763 | 2408a527 | aurel32 | sh4-softmmu \ |
764 | 2408a527 | aurel32 | sh4eb-softmmu \ |
765 | 2408a527 | aurel32 | sparc-softmmu \ |
766 | 1b64fcae | Igor V. Kovalenko | sparc64-softmmu \ |
767 | 2408a527 | aurel32 | " |
768 | 0a8e90f4 | pbrook | fi |
769 | 5327cf48 | bellard | # the following are Linux specific |
770 | 831b7825 | ths | if [ "$linux_user" = "yes" ] ; then |
771 | 2408a527 | aurel32 | target_list="${target_list}\ |
772 | 2408a527 | aurel32 | i386-linux-user \ |
773 | 2408a527 | aurel32 | x86_64-linux-user \ |
774 | 2408a527 | aurel32 | alpha-linux-user \ |
775 | 2408a527 | aurel32 | arm-linux-user \ |
776 | 2408a527 | aurel32 | armeb-linux-user \ |
777 | 2408a527 | aurel32 | cris-linux-user \ |
778 | 2408a527 | aurel32 | m68k-linux-user \ |
779 | 72b675ca | Edgar E. Iglesias | microblaze-linux-user \ |
780 | 2408a527 | aurel32 | mips-linux-user \ |
781 | 2408a527 | aurel32 | mipsel-linux-user \ |
782 | 2408a527 | aurel32 | ppc-linux-user \ |
783 | 2408a527 | aurel32 | ppc64-linux-user \ |
784 | 2408a527 | aurel32 | ppc64abi32-linux-user \ |
785 | 2408a527 | aurel32 | sh4-linux-user \ |
786 | 2408a527 | aurel32 | sh4eb-linux-user \ |
787 | 2408a527 | aurel32 | sparc-linux-user \ |
788 | 2408a527 | aurel32 | sparc64-linux-user \ |
789 | 2408a527 | aurel32 | sparc32plus-linux-user \ |
790 | 2408a527 | aurel32 | " |
791 | 831b7825 | ths | fi |
792 | 831b7825 | ths | # the following are Darwin specific |
793 | 831b7825 | ths | if [ "$darwin_user" = "yes" ] ; then |
794 | 6cdc7375 | malc | target_list="$target_list i386-darwin-user ppc-darwin-user " |
795 | 5327cf48 | bellard | fi |
796 | 84778508 | blueswir1 | # the following are BSD specific |
797 | 84778508 | blueswir1 | if [ "$bsd_user" = "yes" ] ; then |
798 | 84778508 | blueswir1 | target_list="${target_list}\ |
799 | 31fc12df | blueswir1 | i386-bsd-user \ |
800 | 31fc12df | blueswir1 | x86_64-bsd-user \ |
801 | 31fc12df | blueswir1 | sparc-bsd-user \ |
802 | 84778508 | blueswir1 | sparc64-bsd-user \ |
803 | 84778508 | blueswir1 | " |
804 | 84778508 | blueswir1 | fi |
805 | 6e20a45f | bellard | else |
806 | b1a550a0 | pbrook | target_list=`echo "$target_list" | sed -e 's/,/ /g'` |
807 | 5327cf48 | bellard | fi |
808 | 0a8e90f4 | pbrook | if test -z "$target_list" ; then |
809 | 0a8e90f4 | pbrook | echo "No targets enabled" |
810 | 0a8e90f4 | pbrook | exit 1 |
811 | 0a8e90f4 | pbrook | fi |
812 | 5327cf48 | bellard | |
813 | 249247c9 | Juan Quintela | feature_not_found() { |
814 | 249247c9 | Juan Quintela | feature=$1 |
815 | 249247c9 | Juan Quintela | |
816 | 249247c9 | Juan Quintela | echo "ERROR" |
817 | 249247c9 | Juan Quintela | echo "ERROR: User requested feature $feature" |
818 | 9332f6a2 | Sebastian Herbszt | echo "ERROR: configure was not able to find it" |
819 | 249247c9 | Juan Quintela | echo "ERROR" |
820 | 249247c9 | Juan Quintela | exit 1; |
821 | 249247c9 | Juan Quintela | } |
822 | 249247c9 | Juan Quintela | |
823 | 7d13299d | bellard | if test -z "$cross_prefix" ; then |
824 | 7d13299d | bellard | |
825 | 7d13299d | bellard | # --- |
826 | 7d13299d | bellard | # big/little endian test |
827 | 7d13299d | bellard | cat > $TMPC << EOF |
828 | 7d13299d | bellard | #include <inttypes.h> |
829 | 7d13299d | bellard | int main(int argc, char ** argv){ |
830 | 1d14ffa9 | bellard | volatile uint32_t i=0x01234567; |
831 | 1d14ffa9 | bellard | return (*((uint8_t*)(&i))) == 0x67; |
832 | 7d13299d | bellard | } |
833 | 7d13299d | bellard | EOF |
834 | 7d13299d | bellard | |
835 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
836 | 7d13299d | bellard | $TMPE && bigendian="yes" |
837 | 7d13299d | bellard | else |
838 | 7d13299d | bellard | echo big/little test failed |
839 | 7d13299d | bellard | fi |
840 | 7d13299d | bellard | |
841 | 7d13299d | bellard | else |
842 | 7d13299d | bellard | |
843 | 7d13299d | bellard | # if cross compiling, cannot launch a program, so make a static guess |
844 | ea8f20f8 | Juan Quintela | case "$cpu" in |
845 | ea8f20f8 | Juan Quintela | armv4b|hppa|m68k|mips|mips64|ppc|ppc64|s390|sparc|sparc64) |
846 | ea8f20f8 | Juan Quintela | bigendian=yes |
847 | ea8f20f8 | Juan Quintela | ;; |
848 | ea8f20f8 | Juan Quintela | esac |
849 | 7d13299d | bellard | |
850 | 7d13299d | bellard | fi |
851 | 7d13299d | bellard | |
852 | b6853697 | bellard | # host long bits test |
853 | b6853697 | bellard | hostlongbits="32" |
854 | ea8f20f8 | Juan Quintela | case "$cpu" in |
855 | ea8f20f8 | Juan Quintela | x86_64|alpha|ia64|sparc64|ppc64) |
856 | ea8f20f8 | Juan Quintela | hostlongbits=64 |
857 | ea8f20f8 | Juan Quintela | ;; |
858 | ea8f20f8 | Juan Quintela | esac |
859 | b6853697 | bellard | |
860 | b0a47e79 | Juan Quintela | |
861 | b0a47e79 | Juan Quintela | ########################################## |
862 | b0a47e79 | Juan Quintela | # NPTL probe |
863 | b0a47e79 | Juan Quintela | |
864 | b0a47e79 | Juan Quintela | if test "$nptl" != "no" ; then |
865 | b0a47e79 | Juan Quintela | cat > $TMPC <<EOF |
866 | bd0c5661 | pbrook | #include <sched.h> |
867 | 30813cea | pbrook | #include <linux/futex.h> |
868 | bd0c5661 | pbrook | void foo() |
869 | bd0c5661 | pbrook | { |
870 | bd0c5661 | pbrook | #if !defined(CLONE_SETTLS) || !defined(FUTEX_WAIT) |
871 | bd0c5661 | pbrook | #error bork |
872 | bd0c5661 | pbrook | #endif |
873 | bd0c5661 | pbrook | } |
874 | bd0c5661 | pbrook | EOF |
875 | bd0c5661 | pbrook | |
876 | b0a47e79 | Juan Quintela | if compile_object ; then |
877 | b0a47e79 | Juan Quintela | nptl=yes |
878 | b0a47e79 | Juan Quintela | else |
879 | b0a47e79 | Juan Quintela | if test "$nptl" = "yes" ; then |
880 | b0a47e79 | Juan Quintela | feature_not_found "nptl" |
881 | b0a47e79 | Juan Quintela | fi |
882 | b0a47e79 | Juan Quintela | nptl=no |
883 | b0a47e79 | Juan Quintela | fi |
884 | bd0c5661 | pbrook | fi |
885 | bd0c5661 | pbrook | |
886 | 11d9f695 | bellard | ########################################## |
887 | ac62922e | balrog | # zlib check |
888 | ac62922e | balrog | |
889 | ac62922e | balrog | cat > $TMPC << EOF |
890 | ac62922e | balrog | #include <zlib.h> |
891 | ac62922e | balrog | int main(void) { zlibVersion(); return 0; } |
892 | ac62922e | balrog | EOF |
893 | 52166aa0 | Juan Quintela | if compile_prog "" "-lz" ; then |
894 | ac62922e | balrog | : |
895 | ac62922e | balrog | else |
896 | ac62922e | balrog | echo |
897 | ac62922e | balrog | echo "Error: zlib check failed" |
898 | ac62922e | balrog | echo "Make sure to have the zlib libs and headers installed." |
899 | ac62922e | balrog | echo |
900 | ac62922e | balrog | exit 1 |
901 | ac62922e | balrog | fi |
902 | ac62922e | balrog | |
903 | ac62922e | balrog | ########################################## |
904 | e37630ca | aliguori | # xen probe |
905 | e37630ca | aliguori | |
906 | fc321b4b | Juan Quintela | if test "$xen" != "no" ; then |
907 | b2266bee | Juan Quintela | xen_libs="-lxenstore -lxenctrl -lxenguest" |
908 | b2266bee | Juan Quintela | cat > $TMPC <<EOF |
909 | e37630ca | aliguori | #include <xenctrl.h> |
910 | e37630ca | aliguori | #include <xs.h> |
911 | df7a607b | Christoph Egger | int main(void) { xs_daemon_open(); xc_interface_open(); return 0; } |
912 | e37630ca | aliguori | EOF |
913 | 52166aa0 | Juan Quintela | if compile_prog "" "$xen_libs" ; then |
914 | fc321b4b | Juan Quintela | xen=yes |
915 | 3efd632b | Juan Quintela | libs_softmmu="$xen_libs $libs_softmmu" |
916 | b2266bee | Juan Quintela | else |
917 | fc321b4b | Juan Quintela | if test "$xen" = "yes" ; then |
918 | fc321b4b | Juan Quintela | feature_not_found "xen" |
919 | fc321b4b | Juan Quintela | fi |
920 | fc321b4b | Juan Quintela | xen=no |
921 | b2266bee | Juan Quintela | fi |
922 | e37630ca | aliguori | fi |
923 | e37630ca | aliguori | |
924 | e37630ca | aliguori | ########################################## |
925 | dfffc653 | Juan Quintela | # Sparse probe |
926 | dfffc653 | Juan Quintela | if test "$sparse" != "no" ; then |
927 | dfffc653 | Juan Quintela | if test -x "$(which cgcc 2>/dev/null)"; then |
928 | dfffc653 | Juan Quintela | sparse=yes |
929 | dfffc653 | Juan Quintela | else |
930 | dfffc653 | Juan Quintela | if test "$sparse" = "yes" ; then |
931 | dfffc653 | Juan Quintela | feature_not_found "sparse" |
932 | dfffc653 | Juan Quintela | fi |
933 | dfffc653 | Juan Quintela | sparse=no |
934 | dfffc653 | Juan Quintela | fi |
935 | dfffc653 | Juan Quintela | fi |
936 | dfffc653 | Juan Quintela | |
937 | dfffc653 | Juan Quintela | ########################################## |
938 | 11d9f695 | bellard | # SDL probe |
939 | 11d9f695 | bellard | |
940 | 11d9f695 | bellard | sdl_too_old=no |
941 | 11d9f695 | bellard | |
942 | c4198157 | Juan Quintela | if test "$sdl" != "no" ; then |
943 | ac119f9d | Juan Quintela | cat > $TMPC << EOF |
944 | 11d9f695 | bellard | #include <SDL.h> |
945 | 11d9f695 | bellard | #undef main /* We don't want SDL to override our main() */ |
946 | 11d9f695 | bellard | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
947 | 11d9f695 | bellard | EOF |
948 | ac119f9d | Juan Quintela | sdl_cflags=`sdl-config --cflags 2> /dev/null` |
949 | ac119f9d | Juan Quintela | sdl_libs=`sdl-config --libs 2> /dev/null` |
950 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
951 | ac119f9d | Juan Quintela | _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` |
952 | ac119f9d | Juan Quintela | if test "$_sdlversion" -lt 121 ; then |
953 | ac119f9d | Juan Quintela | sdl_too_old=yes |
954 | ac119f9d | Juan Quintela | else |
955 | ac119f9d | Juan Quintela | if test "$cocoa" = "no" ; then |
956 | ac119f9d | Juan Quintela | sdl=yes |
957 | ac119f9d | Juan Quintela | fi |
958 | ac119f9d | Juan Quintela | fi |
959 | cd01b4a3 | aliguori | |
960 | ac119f9d | Juan Quintela | # static link with sdl ? |
961 | ac119f9d | Juan Quintela | if test "$sdl" = "yes" -a "$static" = "yes" ; then |
962 | ac119f9d | Juan Quintela | sdl_libs=`sdl-config --static-libs 2>/dev/null` |
963 | ac119f9d | Juan Quintela | if test `sdl-config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` ; then |
964 | ac119f9d | Juan Quintela | sdl_libs="$sdl_libs `aalib-config --static-libs >2 /dev/null`" |
965 | ac119f9d | Juan Quintela | sdl_cflags="$sd_cflags `aalib-config --cflags >2 /dev/null`" |
966 | ac119f9d | Juan Quintela | fi |
967 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
968 | ac119f9d | Juan Quintela | : |
969 | ac119f9d | Juan Quintela | else |
970 | ac119f9d | Juan Quintela | sdl=no |
971 | ac119f9d | Juan Quintela | fi |
972 | ac119f9d | Juan Quintela | fi # static link |
973 | c4198157 | Juan Quintela | else # sdl not found |
974 | c4198157 | Juan Quintela | if test "$sdl" = "yes" ; then |
975 | c4198157 | Juan Quintela | feature_not_found "sdl" |
976 | c4198157 | Juan Quintela | fi |
977 | c4198157 | Juan Quintela | sdl=no |
978 | ac119f9d | Juan Quintela | fi # sdl compile test |
979 | a68551bc | Juan Quintela | fi |
980 | 11d9f695 | bellard | |
981 | 5368a422 | aliguori | if test "$sdl" = "yes" ; then |
982 | ac119f9d | Juan Quintela | cat > $TMPC <<EOF |
983 | 5368a422 | aliguori | #include <SDL.h> |
984 | 5368a422 | aliguori | #if defined(SDL_VIDEO_DRIVER_X11) |
985 | 5368a422 | aliguori | #include <X11/XKBlib.h> |
986 | 5368a422 | aliguori | #else |
987 | 5368a422 | aliguori | #error No x11 support |
988 | 5368a422 | aliguori | #endif |
989 | 5368a422 | aliguori | int main(void) { return 0; } |
990 | 5368a422 | aliguori | EOF |
991 | 52166aa0 | Juan Quintela | if compile_prog "$sdl_cflags" "$sdl_libs" ; then |
992 | ac119f9d | Juan Quintela | sdl_libs="$sdl_libs -lX11" |
993 | ac119f9d | Juan Quintela | fi |
994 | 07d9ac44 | Juan Quintela | if test "$mingw32" = "yes" ; then |
995 | 07d9ac44 | Juan Quintela | sdl_libs="`echo $sdl_libs | sed s/-mwindows//g` -mconsole" |
996 | 07d9ac44 | Juan Quintela | fi |
997 | 0705667e | Juan Quintela | libs_softmmu="$sdl_libs $libs_softmmu" |
998 | 5368a422 | aliguori | fi |
999 | 5368a422 | aliguori | |
1000 | 8f28f3fb | ths | ########################################## |
1001 | 8d5d2d4c | ths | # VNC TLS detection |
1002 | 1be10ad2 | Juan Quintela | if test "$vnc_tls" != "no" ; then |
1003 | 1be10ad2 | Juan Quintela | cat > $TMPC <<EOF |
1004 | ae6b5e5a | aliguori | #include <gnutls/gnutls.h> |
1005 | ae6b5e5a | aliguori | int main(void) { gnutls_session_t s; gnutls_init(&s, GNUTLS_SERVER); return 0; } |
1006 | ae6b5e5a | aliguori | EOF |
1007 | 1be10ad2 | Juan Quintela | vnc_tls_cflags=`pkg-config --cflags gnutls 2> /dev/null` |
1008 | 1be10ad2 | Juan Quintela | vnc_tls_libs=`pkg-config --libs gnutls 2> /dev/null` |
1009 | 1be10ad2 | Juan Quintela | if compile_prog "$vnc_tls_cflags" "$vnc_tls_libs" ; then |
1010 | 1be10ad2 | Juan Quintela | vnc_tls=yes |
1011 | 1be10ad2 | Juan Quintela | libs_softmmu="$vnc_tls_libs $libs_softmmu" |
1012 | 1be10ad2 | Juan Quintela | else |
1013 | 1be10ad2 | Juan Quintela | if test "$vnc_tls" = "yes" ; then |
1014 | 1be10ad2 | Juan Quintela | feature_not_found "vnc-tls" |
1015 | ae6b5e5a | aliguori | fi |
1016 | 1be10ad2 | Juan Quintela | vnc_tls=no |
1017 | 1be10ad2 | Juan Quintela | fi |
1018 | 8d5d2d4c | ths | fi |
1019 | 8d5d2d4c | ths | |
1020 | 8d5d2d4c | ths | ########################################## |
1021 | 2f9606b3 | aliguori | # VNC SASL detection |
1022 | 3aefa744 | Juan Quintela | if test "$vnc_sasl" != "no" ; then |
1023 | ea784e3b | Juan Quintela | cat > $TMPC <<EOF |
1024 | 2f9606b3 | aliguori | #include <sasl/sasl.h> |
1025 | 2f9606b3 | aliguori | #include <stdio.h> |
1026 | 2f9606b3 | aliguori | int main(void) { sasl_server_init(NULL, "qemu"); return 0; } |
1027 | 2f9606b3 | aliguori | EOF |
1028 | ea784e3b | Juan Quintela | # Assuming Cyrus-SASL installed in /usr prefix |
1029 | ea784e3b | Juan Quintela | vnc_sasl_cflags="" |
1030 | ea784e3b | Juan Quintela | vnc_sasl_libs="-lsasl2" |
1031 | ea784e3b | Juan Quintela | if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then |
1032 | ea784e3b | Juan Quintela | vnc_sasl=yes |
1033 | ea784e3b | Juan Quintela | libs_softmmu="$vnc_sasl_libs $libs_softmmu" |
1034 | ea784e3b | Juan Quintela | else |
1035 | ea784e3b | Juan Quintela | if test "$vnc_sasl" = "yes" ; then |
1036 | ea784e3b | Juan Quintela | feature_not_found "vnc-sasl" |
1037 | 2f9606b3 | aliguori | fi |
1038 | ea784e3b | Juan Quintela | vnc_sasl=no |
1039 | ea784e3b | Juan Quintela | fi |
1040 | 2f9606b3 | aliguori | fi |
1041 | 2f9606b3 | aliguori | |
1042 | 2f9606b3 | aliguori | ########################################## |
1043 | 76655d6d | aliguori | # fnmatch() probe, used for ACL routines |
1044 | 76655d6d | aliguori | fnmatch="no" |
1045 | 76655d6d | aliguori | cat > $TMPC << EOF |
1046 | 76655d6d | aliguori | #include <fnmatch.h> |
1047 | 76655d6d | aliguori | int main(void) |
1048 | 76655d6d | aliguori | { |
1049 | 76655d6d | aliguori | fnmatch("foo", "foo", 0); |
1050 | 76655d6d | aliguori | return 0; |
1051 | 76655d6d | aliguori | } |
1052 | 76655d6d | aliguori | EOF |
1053 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1054 | 76655d6d | aliguori | fnmatch="yes" |
1055 | 76655d6d | aliguori | fi |
1056 | 76655d6d | aliguori | |
1057 | 76655d6d | aliguori | ########################################## |
1058 | ee682d27 | Stefan Weil | # uuid_generate() probe, used for vdi block driver |
1059 | ee682d27 | Stefan Weil | if test "$uuid" != "no" ; then |
1060 | ee682d27 | Stefan Weil | uuid_libs="-luuid" |
1061 | ee682d27 | Stefan Weil | cat > $TMPC << EOF |
1062 | ee682d27 | Stefan Weil | #include <uuid/uuid.h> |
1063 | ee682d27 | Stefan Weil | int main(void) |
1064 | ee682d27 | Stefan Weil | { |
1065 | ee682d27 | Stefan Weil | uuid_t my_uuid; |
1066 | ee682d27 | Stefan Weil | uuid_generate(my_uuid); |
1067 | ee682d27 | Stefan Weil | return 0; |
1068 | ee682d27 | Stefan Weil | } |
1069 | ee682d27 | Stefan Weil | EOF |
1070 | ee682d27 | Stefan Weil | if compile_prog "" "$uuid_libs" ; then |
1071 | ee682d27 | Stefan Weil | uuid="yes" |
1072 | ee682d27 | Stefan Weil | libs_softmmu="$uuid_libs $libs_softmmu" |
1073 | ee682d27 | Stefan Weil | libs_tools="$uuid_libs $libs_tools" |
1074 | ee682d27 | Stefan Weil | else |
1075 | ee682d27 | Stefan Weil | if test "$uuid" = "yes" ; then |
1076 | ee682d27 | Stefan Weil | feature_not_found "uuid" |
1077 | ee682d27 | Stefan Weil | fi |
1078 | ee682d27 | Stefan Weil | uuid=no |
1079 | ee682d27 | Stefan Weil | fi |
1080 | ee682d27 | Stefan Weil | fi |
1081 | ee682d27 | Stefan Weil | |
1082 | ee682d27 | Stefan Weil | ########################################## |
1083 | 8a16d273 | ths | # vde libraries probe |
1084 | dfb278bd | Juan Quintela | if test "$vde" != "no" ; then |
1085 | 4baae0ac | Juan Quintela | vde_libs="-lvdeplug" |
1086 | 8a16d273 | ths | cat > $TMPC << EOF |
1087 | 8a16d273 | ths | #include <libvdeplug.h> |
1088 | 4a7f0e06 | pbrook | int main(void) |
1089 | 4a7f0e06 | pbrook | { |
1090 | 4a7f0e06 | pbrook | struct vde_open_args a = {0, 0, 0}; |
1091 | 4a7f0e06 | pbrook | vde_open("", "", &a); |
1092 | 4a7f0e06 | pbrook | return 0; |
1093 | 4a7f0e06 | pbrook | } |
1094 | 8a16d273 | ths | EOF |
1095 | 52166aa0 | Juan Quintela | if compile_prog "" "$vde_libs" ; then |
1096 | 4baae0ac | Juan Quintela | vde=yes |
1097 | 8e02e54c | Juan Quintela | libs_softmmu="$vde_libs $libs_softmmu" |
1098 | 8e02e54c | Juan Quintela | libs_tools="$vde_libs $libs_tools" |
1099 | dfb278bd | Juan Quintela | else |
1100 | dfb278bd | Juan Quintela | if test "$vde" = "yes" ; then |
1101 | dfb278bd | Juan Quintela | feature_not_found "vde" |
1102 | dfb278bd | Juan Quintela | fi |
1103 | dfb278bd | Juan Quintela | vde=no |
1104 | 4baae0ac | Juan Quintela | fi |
1105 | 8a16d273 | ths | fi |
1106 | 8a16d273 | ths | |
1107 | 8a16d273 | ths | ########################################## |
1108 | c2de5c91 | malc | # Sound support libraries probe |
1109 | 8f28f3fb | ths | |
1110 | c2de5c91 | malc | audio_drv_probe() |
1111 | c2de5c91 | malc | { |
1112 | c2de5c91 | malc | drv=$1 |
1113 | c2de5c91 | malc | hdr=$2 |
1114 | c2de5c91 | malc | lib=$3 |
1115 | c2de5c91 | malc | exp=$4 |
1116 | c2de5c91 | malc | cfl=$5 |
1117 | c2de5c91 | malc | cat > $TMPC << EOF |
1118 | c2de5c91 | malc | #include <$hdr> |
1119 | c2de5c91 | malc | int main(void) { $exp } |
1120 | 8f28f3fb | ths | EOF |
1121 | 52166aa0 | Juan Quintela | if compile_prog "$cfl" "$lib" ; then |
1122 | c2de5c91 | malc | : |
1123 | c2de5c91 | malc | else |
1124 | c2de5c91 | malc | echo |
1125 | c2de5c91 | malc | echo "Error: $drv check failed" |
1126 | c2de5c91 | malc | echo "Make sure to have the $drv libs and headers installed." |
1127 | c2de5c91 | malc | echo |
1128 | c2de5c91 | malc | exit 1 |
1129 | c2de5c91 | malc | fi |
1130 | c2de5c91 | malc | } |
1131 | c2de5c91 | malc | |
1132 | 2fa7d3bf | malc | audio_drv_list=`echo "$audio_drv_list" | sed -e 's/,/ /g'` |
1133 | c2de5c91 | malc | for drv in $audio_drv_list; do |
1134 | c2de5c91 | malc | case $drv in |
1135 | c2de5c91 | malc | alsa) |
1136 | c2de5c91 | malc | audio_drv_probe $drv alsa/asoundlib.h -lasound \ |
1137 | c2de5c91 | malc | "snd_pcm_t **handle; return snd_pcm_close(*handle);" |
1138 | a4bf6780 | Juan Quintela | libs_softmmu="-lasound $libs_softmmu" |
1139 | c2de5c91 | malc | ;; |
1140 | c2de5c91 | malc | |
1141 | c2de5c91 | malc | fmod) |
1142 | c2de5c91 | malc | if test -z $fmod_lib || test -z $fmod_inc; then |
1143 | c2de5c91 | malc | echo |
1144 | c2de5c91 | malc | echo "Error: You must specify path to FMOD library and headers" |
1145 | c2de5c91 | malc | echo "Example: --fmod-inc=/path/include/fmod --fmod-lib=/path/lib/libfmod-3.74.so" |
1146 | c2de5c91 | malc | echo |
1147 | c2de5c91 | malc | exit 1 |
1148 | c2de5c91 | malc | fi |
1149 | c2de5c91 | malc | audio_drv_probe $drv fmod.h $fmod_lib "return FSOUND_GetVersion();" "-I $fmod_inc" |
1150 | a4bf6780 | Juan Quintela | libs_softmmu="$fmod_lib $libs_softmmu" |
1151 | c2de5c91 | malc | ;; |
1152 | c2de5c91 | malc | |
1153 | c2de5c91 | malc | esd) |
1154 | c2de5c91 | malc | audio_drv_probe $drv esd.h -lesd 'return esd_play_stream(0, 0, "", 0);' |
1155 | a4bf6780 | Juan Quintela | libs_softmmu="-lesd $libs_softmmu" |
1156 | 67f86e8e | Juan Quintela | audio_pt_int="yes" |
1157 | c2de5c91 | malc | ;; |
1158 | b8e59f18 | malc | |
1159 | b8e59f18 | malc | pa) |
1160 | b8e59f18 | malc | audio_drv_probe $drv pulse/simple.h -lpulse-simple \ |
1161 | b8e59f18 | malc | "pa_simple *s = NULL; pa_simple_free(s); return 0;" |
1162 | a4bf6780 | Juan Quintela | libs_softmmu="-lpulse-simple $libs_softmmu" |
1163 | 67f86e8e | Juan Quintela | audio_pt_int="yes" |
1164 | b8e59f18 | malc | ;; |
1165 | b8e59f18 | malc | |
1166 | 997e690a | Juan Quintela | coreaudio) |
1167 | 997e690a | Juan Quintela | libs_softmmu="-framework CoreAudio $libs_softmmu" |
1168 | 997e690a | Juan Quintela | ;; |
1169 | 997e690a | Juan Quintela | |
1170 | a4bf6780 | Juan Quintela | dsound) |
1171 | a4bf6780 | Juan Quintela | libs_softmmu="-lole32 -ldxguid $libs_softmmu" |
1172 | a4bf6780 | Juan Quintela | ;; |
1173 | a4bf6780 | Juan Quintela | |
1174 | a4bf6780 | Juan Quintela | oss) |
1175 | a4bf6780 | Juan Quintela | libs_softmmu="$oss_lib $libs_softmmu" |
1176 | a4bf6780 | Juan Quintela | ;; |
1177 | a4bf6780 | Juan Quintela | |
1178 | a4bf6780 | Juan Quintela | sdl|wav) |
1179 | 2f6a1ab0 | blueswir1 | # XXX: Probes for CoreAudio, DirectSound, SDL(?) |
1180 | 2f6a1ab0 | blueswir1 | ;; |
1181 | 2f6a1ab0 | blueswir1 | |
1182 | e4c63a6a | malc | *) |
1183 | 1c9b2a52 | malc | echo "$audio_possible_drivers" | grep -q "\<$drv\>" || { |
1184 | e4c63a6a | malc | echo |
1185 | e4c63a6a | malc | echo "Error: Unknown driver '$drv' selected" |
1186 | e4c63a6a | malc | echo "Possible drivers are: $audio_possible_drivers" |
1187 | e4c63a6a | malc | echo |
1188 | e4c63a6a | malc | exit 1 |
1189 | e4c63a6a | malc | } |
1190 | e4c63a6a | malc | ;; |
1191 | c2de5c91 | malc | esac |
1192 | c2de5c91 | malc | done |
1193 | 8f28f3fb | ths | |
1194 | 4d3b6f6e | balrog | ########################################## |
1195 | 2e4d9fb1 | aurel32 | # BrlAPI probe |
1196 | 2e4d9fb1 | aurel32 | |
1197 | 4ffcedb6 | Juan Quintela | if test "$brlapi" != "no" ; then |
1198 | eb82284f | Juan Quintela | brlapi_libs="-lbrlapi" |
1199 | eb82284f | Juan Quintela | cat > $TMPC << EOF |
1200 | 2e4d9fb1 | aurel32 | #include <brlapi.h> |
1201 | 2e4d9fb1 | aurel32 | int main( void ) { return brlapi__openConnection (NULL, NULL, NULL); } |
1202 | 2e4d9fb1 | aurel32 | EOF |
1203 | 52166aa0 | Juan Quintela | if compile_prog "" "$brlapi_libs" ; then |
1204 | eb82284f | Juan Quintela | brlapi=yes |
1205 | 264606b3 | Juan Quintela | libs_softmmu="$brlapi_libs $libs_softmmu" |
1206 | 4ffcedb6 | Juan Quintela | else |
1207 | 4ffcedb6 | Juan Quintela | if test "$brlapi" = "yes" ; then |
1208 | 4ffcedb6 | Juan Quintela | feature_not_found "brlapi" |
1209 | 4ffcedb6 | Juan Quintela | fi |
1210 | 4ffcedb6 | Juan Quintela | brlapi=no |
1211 | eb82284f | Juan Quintela | fi |
1212 | eb82284f | Juan Quintela | fi |
1213 | 2e4d9fb1 | aurel32 | |
1214 | 2e4d9fb1 | aurel32 | ########################################## |
1215 | 4d3b6f6e | balrog | # curses probe |
1216 | 4f78ef9a | Juan Quintela | curses_list="-lncurses -lcurses" |
1217 | 4d3b6f6e | balrog | |
1218 | c584a6d0 | Juan Quintela | if test "$curses" != "no" ; then |
1219 | c584a6d0 | Juan Quintela | curses_found=no |
1220 | 4d3b6f6e | balrog | cat > $TMPC << EOF |
1221 | 4d3b6f6e | balrog | #include <curses.h> |
1222 | 5a8ff3aa | blueswir1 | #ifdef __OpenBSD__ |
1223 | 5a8ff3aa | blueswir1 | #define resize_term resizeterm |
1224 | 5a8ff3aa | blueswir1 | #endif |
1225 | 5a8ff3aa | blueswir1 | int main(void) { resize_term(0, 0); return curses_version(); } |
1226 | 4d3b6f6e | balrog | EOF |
1227 | 4f78ef9a | Juan Quintela | for curses_lib in $curses_list; do |
1228 | 4f78ef9a | Juan Quintela | if compile_prog "" "$curses_lib" ; then |
1229 | c584a6d0 | Juan Quintela | curses_found=yes |
1230 | 4f78ef9a | Juan Quintela | libs_softmmu="$curses_lib $libs_softmmu" |
1231 | 4f78ef9a | Juan Quintela | break |
1232 | 4f78ef9a | Juan Quintela | fi |
1233 | 4f78ef9a | Juan Quintela | done |
1234 | c584a6d0 | Juan Quintela | if test "$curses_found" = "yes" ; then |
1235 | c584a6d0 | Juan Quintela | curses=yes |
1236 | c584a6d0 | Juan Quintela | else |
1237 | c584a6d0 | Juan Quintela | if test "$curses" = "yes" ; then |
1238 | c584a6d0 | Juan Quintela | feature_not_found "curses" |
1239 | c584a6d0 | Juan Quintela | fi |
1240 | c584a6d0 | Juan Quintela | curses=no |
1241 | c584a6d0 | Juan Quintela | fi |
1242 | 4f78ef9a | Juan Quintela | fi |
1243 | 4d3b6f6e | balrog | |
1244 | 414f0dab | blueswir1 | ########################################## |
1245 | 769ce76d | Alexander Graf | # curl probe |
1246 | 769ce76d | Alexander Graf | |
1247 | 788c8196 | Juan Quintela | if test "$curl" != "no" ; then |
1248 | 769ce76d | Alexander Graf | cat > $TMPC << EOF |
1249 | 769ce76d | Alexander Graf | #include <curl/curl.h> |
1250 | 769ce76d | Alexander Graf | int main(void) { return curl_easy_init(); } |
1251 | 769ce76d | Alexander Graf | EOF |
1252 | b1d5a277 | Juan Quintela | curl_cflags=`curl-config --cflags 2>/dev/null` |
1253 | 52368552 | Paul Brook | curl_libs=`curl-config --libs 2>/dev/null` |
1254 | b1d5a277 | Juan Quintela | if compile_prog "$curl_cflags" "$curl_libs" ; then |
1255 | 769ce76d | Alexander Graf | curl=yes |
1256 | f0302935 | Juan Quintela | libs_tools="$curl_libs $libs_tools" |
1257 | f0302935 | Juan Quintela | libs_softmmu="$curl_libs $libs_softmmu" |
1258 | 788c8196 | Juan Quintela | else |
1259 | 788c8196 | Juan Quintela | if test "$curl" = "yes" ; then |
1260 | 788c8196 | Juan Quintela | feature_not_found "curl" |
1261 | 788c8196 | Juan Quintela | fi |
1262 | 788c8196 | Juan Quintela | curl=no |
1263 | 769ce76d | Alexander Graf | fi |
1264 | 769ce76d | Alexander Graf | fi # test "$curl" |
1265 | 769ce76d | Alexander Graf | |
1266 | 769ce76d | Alexander Graf | ########################################## |
1267 | 5495ed11 | Luiz Capitulino | # check framework probe |
1268 | 5495ed11 | Luiz Capitulino | |
1269 | 5495ed11 | Luiz Capitulino | if test "$check_utests" != "no" ; then |
1270 | 5495ed11 | Luiz Capitulino | cat > $TMPC << EOF |
1271 | 5495ed11 | Luiz Capitulino | #include <check.h> |
1272 | 5495ed11 | Luiz Capitulino | int main(void) { suite_create("qemu test"); return 0; } |
1273 | 5495ed11 | Luiz Capitulino | EOF |
1274 | 5495ed11 | Luiz Capitulino | check_libs=`pkg-config --libs check` |
1275 | 5495ed11 | Luiz Capitulino | if compile_prog "" $check_libs ; then |
1276 | 5495ed11 | Luiz Capitulino | check_utests=yes |
1277 | 5495ed11 | Luiz Capitulino | libs_tools="$check_libs $libs_tools" |
1278 | 5495ed11 | Luiz Capitulino | else |
1279 | 5495ed11 | Luiz Capitulino | if test "$check_utests" = "yes" ; then |
1280 | 5495ed11 | Luiz Capitulino | feature_not_found "check" |
1281 | 5495ed11 | Luiz Capitulino | fi |
1282 | 5495ed11 | Luiz Capitulino | check_utests=no |
1283 | 5495ed11 | Luiz Capitulino | fi |
1284 | 5495ed11 | Luiz Capitulino | fi # test "$check_utests" |
1285 | 5495ed11 | Luiz Capitulino | |
1286 | 5495ed11 | Luiz Capitulino | ########################################## |
1287 | fb599c9a | balrog | # bluez support probe |
1288 | a20a6f46 | Juan Quintela | if test "$bluez" != "no" ; then |
1289 | e820e3f4 | balrog | cat > $TMPC << EOF |
1290 | e820e3f4 | balrog | #include <bluetooth/bluetooth.h> |
1291 | e820e3f4 | balrog | int main(void) { return bt_error(0); } |
1292 | e820e3f4 | balrog | EOF |
1293 | efcfd0c5 | Blue Swirl | bluez_cflags=`pkg-config --cflags bluez 2> /dev/null` |
1294 | efcfd0c5 | Blue Swirl | bluez_libs=`pkg-config --libs bluez 2> /dev/null` |
1295 | 52166aa0 | Juan Quintela | if compile_prog "$bluez_cflags" "$bluez_libs" ; then |
1296 | a20a6f46 | Juan Quintela | bluez=yes |
1297 | e482d56a | Juan Quintela | libs_softmmu="$bluez_libs $libs_softmmu" |
1298 | e820e3f4 | balrog | else |
1299 | a20a6f46 | Juan Quintela | if test "$bluez" = "yes" ; then |
1300 | a20a6f46 | Juan Quintela | feature_not_found "bluez" |
1301 | a20a6f46 | Juan Quintela | fi |
1302 | e820e3f4 | balrog | bluez="no" |
1303 | e820e3f4 | balrog | fi |
1304 | fb599c9a | balrog | fi |
1305 | fb599c9a | balrog | |
1306 | fb599c9a | balrog | ########################################## |
1307 | 7ba1e619 | aliguori | # kvm probe |
1308 | b31a0277 | Juan Quintela | if test "$kvm" != "no" ; then |
1309 | 7ba1e619 | aliguori | cat > $TMPC <<EOF |
1310 | 7ba1e619 | aliguori | #include <linux/kvm.h> |
1311 | 9fd8d8d7 | aliguori | #if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12 |
1312 | 7ba1e619 | aliguori | #error Invalid KVM version |
1313 | 7ba1e619 | aliguori | #endif |
1314 | 9fd8d8d7 | aliguori | #if !defined(KVM_CAP_USER_MEMORY) |
1315 | 9fd8d8d7 | aliguori | #error Missing KVM capability KVM_CAP_USER_MEMORY |
1316 | 9fd8d8d7 | aliguori | #endif |
1317 | 9fd8d8d7 | aliguori | #if !defined(KVM_CAP_SET_TSS_ADDR) |
1318 | 9fd8d8d7 | aliguori | #error Missing KVM capability KVM_CAP_SET_TSS_ADDR |
1319 | 9fd8d8d7 | aliguori | #endif |
1320 | 9fd8d8d7 | aliguori | #if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) |
1321 | 9fd8d8d7 | aliguori | #error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS |
1322 | 9fd8d8d7 | aliguori | #endif |
1323 | 7ba1e619 | aliguori | int main(void) { return 0; } |
1324 | 7ba1e619 | aliguori | EOF |
1325 | eac30262 | aliguori | if test "$kerneldir" != "" ; then |
1326 | eac30262 | aliguori | kvm_cflags=-I"$kerneldir"/include |
1327 | 8444eb6e | aliguori | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \ |
1328 | 8444eb6e | aliguori | -a -d "$kerneldir/arch/x86/include" ; then |
1329 | 8444eb6e | aliguori | kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include" |
1330 | 406b430d | aliguori | elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then |
1331 | 406b430d | aliguori | kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include" |
1332 | 8444eb6e | aliguori | elif test -d "$kerneldir/arch/$cpu/include" ; then |
1333 | 8444eb6e | aliguori | kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include" |
1334 | 8444eb6e | aliguori | fi |
1335 | eac30262 | aliguori | else |
1336 | eac30262 | aliguori | kvm_cflags="" |
1337 | eac30262 | aliguori | fi |
1338 | 52166aa0 | Juan Quintela | if compile_prog "$kvm_cflags" "" ; then |
1339 | b31a0277 | Juan Quintela | kvm=yes |
1340 | 7ba1e619 | aliguori | else |
1341 | b31a0277 | Juan Quintela | if test "$kvm" = "yes" ; then |
1342 | b31a0277 | Juan Quintela | if [ -x "`which awk 2>/dev/null`" ] && \ |
1343 | b31a0277 | Juan Quintela | [ -x "`which grep 2>/dev/null`" ]; then |
1344 | b31a0277 | Juan Quintela | kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \ |
1345 | 9fd8d8d7 | aliguori | | grep "error: " \ |
1346 | 9fd8d8d7 | aliguori | | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'` |
1347 | b31a0277 | Juan Quintela | if test "$kvmerr" != "" ; then |
1348 | b31a0277 | Juan Quintela | echo -e "${kvmerr}\n\ |
1349 | b31a0277 | Juan Quintela | NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \ |
1350 | b31a0277 | Juan Quintela | recent kvm-kmod from http://sourceforge.net/projects/kvm." |
1351 | b31a0277 | Juan Quintela | fi |
1352 | 9fd8d8d7 | aliguori | fi |
1353 | b31a0277 | Juan Quintela | feature_not_found "kvm" |
1354 | 9fd8d8d7 | aliguori | fi |
1355 | b31a0277 | Juan Quintela | kvm=no |
1356 | 7ba1e619 | aliguori | fi |
1357 | 7ba1e619 | aliguori | fi |
1358 | 7ba1e619 | aliguori | |
1359 | 7ba1e619 | aliguori | ########################################## |
1360 | e5d355d1 | aliguori | # pthread probe |
1361 | de65fe0f | Sebastian Herbszt | PTHREADLIBS_LIST="-lpthread -lpthreadGC2" |
1362 | 3c529d93 | aliguori | |
1363 | 4dd75c70 | Christoph Hellwig | pthread=no |
1364 | e5d355d1 | aliguori | cat > $TMPC << EOF |
1365 | 3c529d93 | aliguori | #include <pthread.h> |
1366 | de65fe0f | Sebastian Herbszt | int main(void) { pthread_create(0,0,0,0); return 0; } |
1367 | 414f0dab | blueswir1 | EOF |
1368 | 4dd75c70 | Christoph Hellwig | for pthread_lib in $PTHREADLIBS_LIST; do |
1369 | 4dd75c70 | Christoph Hellwig | if compile_prog "" "$pthread_lib" ; then |
1370 | 4dd75c70 | Christoph Hellwig | pthread=yes |
1371 | 4dd75c70 | Christoph Hellwig | LIBS="$pthread_lib $LIBS" |
1372 | 4dd75c70 | Christoph Hellwig | break |
1373 | 4dd75c70 | Christoph Hellwig | fi |
1374 | 4dd75c70 | Christoph Hellwig | done |
1375 | 414f0dab | blueswir1 | |
1376 | 4617e593 | Anthony Liguori | if test "$mingw32" != yes -a "$pthread" = no; then |
1377 | 4dd75c70 | Christoph Hellwig | echo |
1378 | 4dd75c70 | Christoph Hellwig | echo "Error: pthread check failed" |
1379 | 4dd75c70 | Christoph Hellwig | echo "Make sure to have the pthread libs and headers installed." |
1380 | 4dd75c70 | Christoph Hellwig | echo |
1381 | 4dd75c70 | Christoph Hellwig | exit 1 |
1382 | e5d355d1 | aliguori | fi |
1383 | e5d355d1 | aliguori | |
1384 | bf9298b9 | aliguori | ########################################## |
1385 | 5c6c3a6c | Christoph Hellwig | # linux-aio probe |
1386 | 5c6c3a6c | Christoph Hellwig | AIOLIBS="" |
1387 | 5c6c3a6c | Christoph Hellwig | |
1388 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" != "no" ; then |
1389 | 5c6c3a6c | Christoph Hellwig | cat > $TMPC <<EOF |
1390 | 5c6c3a6c | Christoph Hellwig | #include <libaio.h> |
1391 | 5c6c3a6c | Christoph Hellwig | #include <sys/eventfd.h> |
1392 | 5c6c3a6c | Christoph Hellwig | int main(void) { io_setup(0, NULL); io_set_eventfd(NULL, 0); eventfd(0, 0); return 0; } |
1393 | 5c6c3a6c | Christoph Hellwig | EOF |
1394 | 5c6c3a6c | Christoph Hellwig | if compile_prog "" "-laio" ; then |
1395 | 5c6c3a6c | Christoph Hellwig | linux_aio=yes |
1396 | 5c6c3a6c | Christoph Hellwig | LIBS="$LIBS -laio" |
1397 | 5c6c3a6c | Christoph Hellwig | else |
1398 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" = "yes" ; then |
1399 | 5c6c3a6c | Christoph Hellwig | feature_not_found "linux AIO" |
1400 | 5c6c3a6c | Christoph Hellwig | fi |
1401 | 3cfcae3c | Luiz Capitulino | linux_aio=no |
1402 | 5c6c3a6c | Christoph Hellwig | fi |
1403 | 5c6c3a6c | Christoph Hellwig | fi |
1404 | 5c6c3a6c | Christoph Hellwig | |
1405 | 5c6c3a6c | Christoph Hellwig | ########################################## |
1406 | bf9298b9 | aliguori | # iovec probe |
1407 | bf9298b9 | aliguori | cat > $TMPC <<EOF |
1408 | db34f0b3 | blueswir1 | #include <sys/types.h> |
1409 | bf9298b9 | aliguori | #include <sys/uio.h> |
1410 | db34f0b3 | blueswir1 | #include <unistd.h> |
1411 | bf9298b9 | aliguori | int main(void) { struct iovec iov; return 0; } |
1412 | bf9298b9 | aliguori | EOF |
1413 | bf9298b9 | aliguori | iovec=no |
1414 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1415 | bf9298b9 | aliguori | iovec=yes |
1416 | bf9298b9 | aliguori | fi |
1417 | bf9298b9 | aliguori | |
1418 | f652e6af | aurel32 | ########################################## |
1419 | ceb42de8 | aliguori | # preadv probe |
1420 | ceb42de8 | aliguori | cat > $TMPC <<EOF |
1421 | ceb42de8 | aliguori | #include <sys/types.h> |
1422 | ceb42de8 | aliguori | #include <sys/uio.h> |
1423 | ceb42de8 | aliguori | #include <unistd.h> |
1424 | ceb42de8 | aliguori | int main(void) { preadv; } |
1425 | ceb42de8 | aliguori | EOF |
1426 | ceb42de8 | aliguori | preadv=no |
1427 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1428 | ceb42de8 | aliguori | preadv=yes |
1429 | ceb42de8 | aliguori | fi |
1430 | ceb42de8 | aliguori | |
1431 | ceb42de8 | aliguori | ########################################## |
1432 | f652e6af | aurel32 | # fdt probe |
1433 | 2df87df7 | Juan Quintela | if test "$fdt" != "no" ; then |
1434 | b41af4ba | Juan Quintela | fdt_libs="-lfdt" |
1435 | b41af4ba | Juan Quintela | cat > $TMPC << EOF |
1436 | f652e6af | aurel32 | int main(void) { return 0; } |
1437 | f652e6af | aurel32 | EOF |
1438 | 52166aa0 | Juan Quintela | if compile_prog "" "$fdt_libs" ; then |
1439 | f652e6af | aurel32 | fdt=yes |
1440 | e4782985 | Juan Quintela | libs_softmmu="$fdt_libs $libs_softmmu" |
1441 | 2df87df7 | Juan Quintela | else |
1442 | 2df87df7 | Juan Quintela | if test "$fdt" = "yes" ; then |
1443 | 2df87df7 | Juan Quintela | feature_not_found "fdt" |
1444 | 2df87df7 | Juan Quintela | fi |
1445 | 2df87df7 | Juan Quintela | fdt=no |
1446 | f652e6af | aurel32 | fi |
1447 | f652e6af | aurel32 | fi |
1448 | f652e6af | aurel32 | |
1449 | 3b3f24ad | aurel32 | # |
1450 | 3b3f24ad | aurel32 | # Check for xxxat() functions when we are building linux-user |
1451 | 3b3f24ad | aurel32 | # emulator. This is done because older glibc versions don't |
1452 | 3b3f24ad | aurel32 | # have syscall stubs for these implemented. |
1453 | 3b3f24ad | aurel32 | # |
1454 | 3b3f24ad | aurel32 | atfile=no |
1455 | 67ba57f6 | Riku Voipio | cat > $TMPC << EOF |
1456 | 3b3f24ad | aurel32 | #define _ATFILE_SOURCE |
1457 | 3b3f24ad | aurel32 | #include <sys/types.h> |
1458 | 3b3f24ad | aurel32 | #include <fcntl.h> |
1459 | 3b3f24ad | aurel32 | #include <unistd.h> |
1460 | 3b3f24ad | aurel32 | |
1461 | 3b3f24ad | aurel32 | int |
1462 | 3b3f24ad | aurel32 | main(void) |
1463 | 3b3f24ad | aurel32 | { |
1464 | 3b3f24ad | aurel32 | /* try to unlink nonexisting file */ |
1465 | 3b3f24ad | aurel32 | return (unlinkat(AT_FDCWD, "nonexistent_file", 0)); |
1466 | 3b3f24ad | aurel32 | } |
1467 | 3b3f24ad | aurel32 | EOF |
1468 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1469 | 67ba57f6 | Riku Voipio | atfile=yes |
1470 | 3b3f24ad | aurel32 | fi |
1471 | 3b3f24ad | aurel32 | |
1472 | 39386ac7 | aurel32 | # Check for inotify functions when we are building linux-user |
1473 | 3b3f24ad | aurel32 | # emulator. This is done because older glibc versions don't |
1474 | 3b3f24ad | aurel32 | # have syscall stubs for these implemented. In that case we |
1475 | 3b3f24ad | aurel32 | # don't provide them even if kernel supports them. |
1476 | 3b3f24ad | aurel32 | # |
1477 | 3b3f24ad | aurel32 | inotify=no |
1478 | 67ba57f6 | Riku Voipio | cat > $TMPC << EOF |
1479 | 3b3f24ad | aurel32 | #include <sys/inotify.h> |
1480 | 3b3f24ad | aurel32 | |
1481 | 3b3f24ad | aurel32 | int |
1482 | 3b3f24ad | aurel32 | main(void) |
1483 | 3b3f24ad | aurel32 | { |
1484 | 3b3f24ad | aurel32 | /* try to start inotify */ |
1485 | 8690e420 | aurel32 | return inotify_init(); |
1486 | 3b3f24ad | aurel32 | } |
1487 | 3b3f24ad | aurel32 | EOF |
1488 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1489 | 67ba57f6 | Riku Voipio | inotify=yes |
1490 | 3b3f24ad | aurel32 | fi |
1491 | 3b3f24ad | aurel32 | |
1492 | ebc996f3 | Riku Voipio | # check if utimensat and futimens are supported |
1493 | ebc996f3 | Riku Voipio | utimens=no |
1494 | ebc996f3 | Riku Voipio | cat > $TMPC << EOF |
1495 | ebc996f3 | Riku Voipio | #define _ATFILE_SOURCE |
1496 | ebc996f3 | Riku Voipio | #define _GNU_SOURCE |
1497 | ebc996f3 | Riku Voipio | #include <stddef.h> |
1498 | ebc996f3 | Riku Voipio | #include <fcntl.h> |
1499 | ebc996f3 | Riku Voipio | |
1500 | ebc996f3 | Riku Voipio | int main(void) |
1501 | ebc996f3 | Riku Voipio | { |
1502 | ebc996f3 | Riku Voipio | utimensat(AT_FDCWD, "foo", NULL, 0); |
1503 | ebc996f3 | Riku Voipio | futimens(0, NULL); |
1504 | ebc996f3 | Riku Voipio | return 0; |
1505 | ebc996f3 | Riku Voipio | } |
1506 | ebc996f3 | Riku Voipio | EOF |
1507 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1508 | ebc996f3 | Riku Voipio | utimens=yes |
1509 | ebc996f3 | Riku Voipio | fi |
1510 | ebc996f3 | Riku Voipio | |
1511 | 099d6b0f | Riku Voipio | # check if pipe2 is there |
1512 | 099d6b0f | Riku Voipio | pipe2=no |
1513 | 099d6b0f | Riku Voipio | cat > $TMPC << EOF |
1514 | 099d6b0f | Riku Voipio | #define _GNU_SOURCE |
1515 | 099d6b0f | Riku Voipio | #include <unistd.h> |
1516 | 099d6b0f | Riku Voipio | #include <fcntl.h> |
1517 | 099d6b0f | Riku Voipio | |
1518 | 099d6b0f | Riku Voipio | int main(void) |
1519 | 099d6b0f | Riku Voipio | { |
1520 | 099d6b0f | Riku Voipio | int pipefd[2]; |
1521 | 099d6b0f | Riku Voipio | pipe2(pipefd, O_CLOEXEC); |
1522 | 099d6b0f | Riku Voipio | return 0; |
1523 | 099d6b0f | Riku Voipio | } |
1524 | 099d6b0f | Riku Voipio | EOF |
1525 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1526 | 099d6b0f | Riku Voipio | pipe2=yes |
1527 | 099d6b0f | Riku Voipio | fi |
1528 | 099d6b0f | Riku Voipio | |
1529 | 3ce34dfb | vibisreenivasan | # check if tee/splice is there. vmsplice was added same time. |
1530 | 3ce34dfb | vibisreenivasan | splice=no |
1531 | 3ce34dfb | vibisreenivasan | cat > $TMPC << EOF |
1532 | 3ce34dfb | vibisreenivasan | #define _GNU_SOURCE |
1533 | 3ce34dfb | vibisreenivasan | #include <unistd.h> |
1534 | 3ce34dfb | vibisreenivasan | #include <fcntl.h> |
1535 | 3ce34dfb | vibisreenivasan | #include <limits.h> |
1536 | 3ce34dfb | vibisreenivasan | |
1537 | 3ce34dfb | vibisreenivasan | int main(void) |
1538 | 3ce34dfb | vibisreenivasan | { |
1539 | 3ce34dfb | vibisreenivasan | int len, fd; |
1540 | 3ce34dfb | vibisreenivasan | len = tee(STDIN_FILENO, STDOUT_FILENO, INT_MAX, SPLICE_F_NONBLOCK); |
1541 | 3ce34dfb | vibisreenivasan | splice(STDIN_FILENO, NULL, fd, NULL, len, SPLICE_F_MOVE); |
1542 | 3ce34dfb | vibisreenivasan | return 0; |
1543 | 3ce34dfb | vibisreenivasan | } |
1544 | 3ce34dfb | vibisreenivasan | EOF |
1545 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1546 | 3ce34dfb | vibisreenivasan | splice=yes |
1547 | 3ce34dfb | vibisreenivasan | fi |
1548 | 3ce34dfb | vibisreenivasan | |
1549 | c2882b96 | Riku Voipio | # check if eventfd is supported |
1550 | c2882b96 | Riku Voipio | eventfd=no |
1551 | c2882b96 | Riku Voipio | cat > $TMPC << EOF |
1552 | c2882b96 | Riku Voipio | #include <sys/eventfd.h> |
1553 | c2882b96 | Riku Voipio | |
1554 | c2882b96 | Riku Voipio | int main(void) |
1555 | c2882b96 | Riku Voipio | { |
1556 | c2882b96 | Riku Voipio | int efd = eventfd(0, 0); |
1557 | c2882b96 | Riku Voipio | return 0; |
1558 | c2882b96 | Riku Voipio | } |
1559 | c2882b96 | Riku Voipio | EOF |
1560 | c2882b96 | Riku Voipio | if compile_prog "" "" ; then |
1561 | c2882b96 | Riku Voipio | eventfd=yes |
1562 | c2882b96 | Riku Voipio | fi |
1563 | c2882b96 | Riku Voipio | |
1564 | cc8ae6de | pbrook | # Check if tools are available to build documentation. |
1565 | a25dba17 | Juan Quintela | if test "$docs" != "no" ; then |
1566 | 83a3ab8b | Juan Quintela | if test -x "`which texi2html 2>/dev/null`" -a \ |
1567 | 83a3ab8b | Juan Quintela | -x "`which pod2man 2>/dev/null`" ; then |
1568 | a25dba17 | Juan Quintela | docs=yes |
1569 | 83a3ab8b | Juan Quintela | else |
1570 | a25dba17 | Juan Quintela | if test "$docs" = "yes" ; then |
1571 | a25dba17 | Juan Quintela | feature_not_found "docs" |
1572 | 83a3ab8b | Juan Quintela | fi |
1573 | a25dba17 | Juan Quintela | docs=no |
1574 | 83a3ab8b | Juan Quintela | fi |
1575 | cc8ae6de | pbrook | fi |
1576 | cc8ae6de | pbrook | |
1577 | 6ae9a1f4 | Juan Quintela | # Search for bsawp_32 function |
1578 | 6ae9a1f4 | Juan Quintela | byteswap_h=no |
1579 | 6ae9a1f4 | Juan Quintela | cat > $TMPC << EOF |
1580 | 6ae9a1f4 | Juan Quintela | #include <byteswap.h> |
1581 | 6ae9a1f4 | Juan Quintela | int main(void) { return bswap_32(0); } |
1582 | 6ae9a1f4 | Juan Quintela | EOF |
1583 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1584 | 6ae9a1f4 | Juan Quintela | byteswap_h=yes |
1585 | 6ae9a1f4 | Juan Quintela | fi |
1586 | 6ae9a1f4 | Juan Quintela | |
1587 | 6ae9a1f4 | Juan Quintela | # Search for bsawp_32 function |
1588 | 6ae9a1f4 | Juan Quintela | bswap_h=no |
1589 | 6ae9a1f4 | Juan Quintela | cat > $TMPC << EOF |
1590 | 6ae9a1f4 | Juan Quintela | #include <sys/endian.h> |
1591 | 6ae9a1f4 | Juan Quintela | #include <sys/types.h> |
1592 | 6ae9a1f4 | Juan Quintela | #include <machine/bswap.h> |
1593 | 6ae9a1f4 | Juan Quintela | int main(void) { return bswap32(0); } |
1594 | 6ae9a1f4 | Juan Quintela | EOF |
1595 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1596 | 6ae9a1f4 | Juan Quintela | bswap_h=yes |
1597 | 6ae9a1f4 | Juan Quintela | fi |
1598 | 6ae9a1f4 | Juan Quintela | |
1599 | da93a1fd | aliguori | ########################################## |
1600 | da93a1fd | aliguori | # Do we need librt |
1601 | da93a1fd | aliguori | cat > $TMPC <<EOF |
1602 | da93a1fd | aliguori | #include <signal.h> |
1603 | da93a1fd | aliguori | #include <time.h> |
1604 | da93a1fd | aliguori | int main(void) { clockid_t id; return clock_gettime(id, NULL); } |
1605 | da93a1fd | aliguori | EOF |
1606 | da93a1fd | aliguori | |
1607 | 52166aa0 | Juan Quintela | if compile_prog "" "" ; then |
1608 | 07ffa4bd | Juan Quintela | : |
1609 | 52166aa0 | Juan Quintela | elif compile_prog "" "-lrt" ; then |
1610 | 07ffa4bd | Juan Quintela | LIBS="-lrt $LIBS" |
1611 | da93a1fd | aliguori | fi |
1612 | da93a1fd | aliguori | |
1613 | a36abbbb | Juan Quintela | # Determine what linker flags to use to force archive inclusion |
1614 | a36abbbb | Juan Quintela | check_linker_flags() |
1615 | a36abbbb | Juan Quintela | { |
1616 | a36abbbb | Juan Quintela | w2= |
1617 | a36abbbb | Juan Quintela | if test "$2" ; then |
1618 | a36abbbb | Juan Quintela | w2=-Wl,$2 |
1619 | a36abbbb | Juan Quintela | fi |
1620 | 52166aa0 | Juan Quintela | compile_prog "" "-Wl,$1 ${w2}" |
1621 | a36abbbb | Juan Quintela | } |
1622 | a36abbbb | Juan Quintela | |
1623 | a36abbbb | Juan Quintela | cat > $TMPC << EOF |
1624 | a36abbbb | Juan Quintela | int main(void) { } |
1625 | a36abbbb | Juan Quintela | EOF |
1626 | a36abbbb | Juan Quintela | if check_linker_flags --whole-archive --no-whole-archive ; then |
1627 | a36abbbb | Juan Quintela | # GNU ld |
1628 | a36abbbb | Juan Quintela | arlibs_begin="-Wl,--whole-archive" |
1629 | a36abbbb | Juan Quintela | arlibs_end="-Wl,--no-whole-archive" |
1630 | a36abbbb | Juan Quintela | elif check_linker_flags -z,allextract -z,defaultextract ; then |
1631 | a36abbbb | Juan Quintela | # Solaris ld |
1632 | 31ff504d | Blue Swirl | arlibs_begin="-Wl,-z,allextract" |
1633 | a36abbbb | Juan Quintela | arlibs_end="-Wl,-z,defaultextract" |
1634 | a36abbbb | Juan Quintela | elif check_linker_flags -all_load ; then |
1635 | a36abbbb | Juan Quintela | # Mac OS X |
1636 | a36abbbb | Juan Quintela | arlibs_begin="-all_load" |
1637 | a36abbbb | Juan Quintela | arlibs_end="" |
1638 | a36abbbb | Juan Quintela | else |
1639 | a36abbbb | Juan Quintela | echo "Error: your linker does not support --whole-archive or -z." |
1640 | a36abbbb | Juan Quintela | echo "Please report to qemu-devel@nongnu.org" |
1641 | a36abbbb | Juan Quintela | exit 1 |
1642 | a36abbbb | Juan Quintela | fi |
1643 | a36abbbb | Juan Quintela | |
1644 | 31ff504d | Blue Swirl | if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \ |
1645 | 6362a53f | Juan Quintela | "$aix" != "yes" ; then |
1646 | 6362a53f | Juan Quintela | libs_softmmu="-lutil $libs_softmmu" |
1647 | 6362a53f | Juan Quintela | fi |
1648 | 6362a53f | Juan Quintela | |
1649 | de5071c5 | Blue Swirl | ########################################## |
1650 | de5071c5 | Blue Swirl | # check if the compiler defines offsetof |
1651 | de5071c5 | Blue Swirl | |
1652 | de5071c5 | Blue Swirl | need_offsetof=yes |
1653 | de5071c5 | Blue Swirl | cat > $TMPC << EOF |
1654 | de5071c5 | Blue Swirl | #include <stddef.h> |
1655 | de5071c5 | Blue Swirl | int main(void) { struct s { int f; }; return offsetof(struct s, f); } |
1656 | de5071c5 | Blue Swirl | EOF |
1657 | de5071c5 | Blue Swirl | if compile_prog "" "" ; then |
1658 | de5071c5 | Blue Swirl | need_offsetof=no |
1659 | de5071c5 | Blue Swirl | fi |
1660 | de5071c5 | Blue Swirl | |
1661 | 5f6b9e8f | Blue Swirl | ########################################## |
1662 | 5f6b9e8f | Blue Swirl | # check if we have fdatasync |
1663 | 5f6b9e8f | Blue Swirl | |
1664 | 5f6b9e8f | Blue Swirl | fdatasync=no |
1665 | 5f6b9e8f | Blue Swirl | cat > $TMPC << EOF |
1666 | 5f6b9e8f | Blue Swirl | #include <unistd.h> |
1667 | 5f6b9e8f | Blue Swirl | int main(void) { return fdatasync(0); } |
1668 | 5f6b9e8f | Blue Swirl | EOF |
1669 | 5f6b9e8f | Blue Swirl | if compile_prog "" "" ; then |
1670 | 5f6b9e8f | Blue Swirl | fdatasync=yes |
1671 | 5f6b9e8f | Blue Swirl | fi |
1672 | 5f6b9e8f | Blue Swirl | |
1673 | e86ecd4b | Juan Quintela | # End of CC checks |
1674 | e86ecd4b | Juan Quintela | # After here, no more $cc or $ld runs |
1675 | e86ecd4b | Juan Quintela | |
1676 | e86ecd4b | Juan Quintela | # default flags for all hosts |
1677 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" |
1678 | a558ee17 | Juan Quintela | CFLAGS="-g $CFLAGS" |
1679 | e86ecd4b | Juan Quintela | if test "$debug" = "no" ; then |
1680 | 1156c669 | Juan Quintela | CFLAGS="-O2 $CFLAGS" |
1681 | e86ecd4b | Juan Quintela | fi |
1682 | 867c16fd | Juan Quintela | QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" |
1683 | 867c16fd | Juan Quintela | QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" |
1684 | 6c90361a | Juan Quintela | QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" |
1685 | 6c90361a | Juan Quintela | QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS" |
1686 | 6c90361a | Juan Quintela | QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS" |
1687 | 1156c669 | Juan Quintela | LDFLAGS="-g $LDFLAGS" |
1688 | e86ecd4b | Juan Quintela | |
1689 | e86ecd4b | Juan Quintela | # Consult white-list to determine whether to enable werror |
1690 | e86ecd4b | Juan Quintela | # by default. Only enable by default for git builds |
1691 | e86ecd4b | Juan Quintela | if test -z "$werror" ; then |
1692 | e86ecd4b | Juan Quintela | z_version=`cut -f3 -d. $source_path/VERSION` |
1693 | e86ecd4b | Juan Quintela | if test "$z_version" = "50" -a \ |
1694 | e86ecd4b | Juan Quintela | "$linux" = "yes" ; then |
1695 | e86ecd4b | Juan Quintela | werror="yes" |
1696 | e86ecd4b | Juan Quintela | else |
1697 | e86ecd4b | Juan Quintela | werror="no" |
1698 | e86ecd4b | Juan Quintela | fi |
1699 | e86ecd4b | Juan Quintela | fi |
1700 | e86ecd4b | Juan Quintela | |
1701 | e86ecd4b | Juan Quintela | if test "$werror" = "yes" ; then |
1702 | a558ee17 | Juan Quintela | QEMU_CFLAGS="-Werror $QEMU_CFLAGS" |
1703 | e86ecd4b | Juan Quintela | fi |
1704 | e86ecd4b | Juan Quintela | |
1705 | e86ecd4b | Juan Quintela | if test "$solaris" = "no" ; then |
1706 | e86ecd4b | Juan Quintela | if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then |
1707 | 1156c669 | Juan Quintela | LDFLAGS="-Wl,--warn-common $LDFLAGS" |
1708 | e86ecd4b | Juan Quintela | fi |
1709 | e86ecd4b | Juan Quintela | fi |
1710 | e86ecd4b | Juan Quintela | |
1711 | 11d9f695 | bellard | if test "$mingw32" = "yes" ; then |
1712 | 308c3593 | pbrook | if test -z "$prefix" ; then |
1713 | 55418b96 | Stefan Weil | prefix="c:/Program Files/Qemu" |
1714 | 308c3593 | pbrook | fi |
1715 | 308c3593 | pbrook | mansuffix="" |
1716 | 308c3593 | pbrook | datasuffix="" |
1717 | 308c3593 | pbrook | docsuffix="" |
1718 | 308c3593 | pbrook | binsuffix="" |
1719 | 11d9f695 | bellard | else |
1720 | 308c3593 | pbrook | if test -z "$prefix" ; then |
1721 | 308c3593 | pbrook | prefix="/usr/local" |
1722 | 308c3593 | pbrook | fi |
1723 | 308c3593 | pbrook | mansuffix="/share/man" |
1724 | 308c3593 | pbrook | datasuffix="/share/qemu" |
1725 | 308c3593 | pbrook | docsuffix="/share/doc/qemu" |
1726 | 308c3593 | pbrook | binsuffix="/bin" |
1727 | 11d9f695 | bellard | fi |
1728 | 5a67135a | bellard | |
1729 | 43ce4dfe | bellard | echo "Install prefix $prefix" |
1730 | 308c3593 | pbrook | echo "BIOS directory $prefix$datasuffix" |
1731 | 308c3593 | pbrook | echo "binary directory $prefix$binsuffix" |
1732 | 11d9f695 | bellard | if test "$mingw32" = "no" ; then |
1733 | 308c3593 | pbrook | echo "Manual directory $prefix$mansuffix" |
1734 | 43ce4dfe | bellard | echo "ELF interp prefix $interp_prefix" |
1735 | 11d9f695 | bellard | fi |
1736 | 5a67135a | bellard | echo "Source path $source_path" |
1737 | 43ce4dfe | bellard | echo "C compiler $cc" |
1738 | 83469015 | bellard | echo "Host C compiler $host_cc" |
1739 | 0c439cbf | Juan Quintela | echo "CFLAGS $CFLAGS" |
1740 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS $QEMU_CFLAGS" |
1741 | 0c439cbf | Juan Quintela | echo "LDFLAGS $LDFLAGS" |
1742 | 43ce4dfe | bellard | echo "make $make" |
1743 | 6a882643 | pbrook | echo "install $install" |
1744 | 43ce4dfe | bellard | echo "host CPU $cpu" |
1745 | de83cd02 | bellard | echo "host big endian $bigendian" |
1746 | 97a847bc | bellard | echo "target list $target_list" |
1747 | ade25b0d | aurel32 | echo "tcg debug enabled $debug_tcg" |
1748 | 43ce4dfe | bellard | echo "gprof enabled $gprof" |
1749 | 03b4fe7d | aliguori | echo "sparse enabled $sparse" |
1750 | 1625af87 | aliguori | echo "strip binaries $strip_opt" |
1751 | 05c2a3e7 | bellard | echo "profiler $profiler" |
1752 | 43ce4dfe | bellard | echo "static build $static" |
1753 | 85aa5189 | bellard | echo "-Werror enabled $werror" |
1754 | 5b0753e0 | bellard | if test "$darwin" = "yes" ; then |
1755 | 5b0753e0 | bellard | echo "Cocoa support $cocoa" |
1756 | 5b0753e0 | bellard | fi |
1757 | 97a847bc | bellard | echo "SDL support $sdl" |
1758 | 4d3b6f6e | balrog | echo "curses support $curses" |
1759 | 769ce76d | Alexander Graf | echo "curl support $curl" |
1760 | 5495ed11 | Luiz Capitulino | echo "check support $check_utests" |
1761 | 67b915a5 | bellard | echo "mingw32 support $mingw32" |
1762 | 0c58ac1c | malc | echo "Audio drivers $audio_drv_list" |
1763 | 0c58ac1c | malc | echo "Extra audio cards $audio_card_list" |
1764 | 8ff9cbf7 | malc | echo "Mixer emulation $mixemu" |
1765 | 8d5d2d4c | ths | echo "VNC TLS support $vnc_tls" |
1766 | 2f9606b3 | aliguori | echo "VNC SASL support $vnc_sasl" |
1767 | 3142255c | blueswir1 | if test -n "$sparc_cpu"; then |
1768 | 3142255c | blueswir1 | echo "Target Sparc Arch $sparc_cpu" |
1769 | 3142255c | blueswir1 | fi |
1770 | e37630ca | aliguori | echo "xen support $xen" |
1771 | 2e4d9fb1 | aurel32 | echo "brlapi support $brlapi" |
1772 | a20a6f46 | Juan Quintela | echo "bluez support $bluez" |
1773 | a25dba17 | Juan Quintela | echo "Documentation $docs" |
1774 | c5937220 | pbrook | [ ! -z "$uname_release" ] && \ |
1775 | c5937220 | pbrook | echo "uname -r $uname_release" |
1776 | bd0c5661 | pbrook | echo "NPTL support $nptl" |
1777 | 379f6698 | Paul Brook | echo "GUEST_BASE $guest_base" |
1778 | 34005a00 | Kirill A. Shutemov | echo "PIE user targets $user_pie" |
1779 | 8a16d273 | ths | echo "vde support $vde" |
1780 | e5d355d1 | aliguori | echo "IO thread $io_thread" |
1781 | 5c6c3a6c | Christoph Hellwig | echo "Linux AIO support $linux_aio" |
1782 | 77755340 | ths | echo "Install blobs $blobs" |
1783 | b31a0277 | Juan Quintela | echo "KVM support $kvm" |
1784 | f652e6af | aurel32 | echo "fdt support $fdt" |
1785 | ceb42de8 | aliguori | echo "preadv support $preadv" |
1786 | 5f6b9e8f | Blue Swirl | echo "fdatasync $fdatasync" |
1787 | ee682d27 | Stefan Weil | echo "uuid support $uuid" |
1788 | 67b915a5 | bellard | |
1789 | 97a847bc | bellard | if test $sdl_too_old = "yes"; then |
1790 | 24b55b96 | bellard | echo "-> Your SDL version is too old - please upgrade to have SDL support" |
1791 | 7c1f25b4 | bellard | fi |
1792 | 7d13299d | bellard | |
1793 | 98ec69ac | Juan Quintela | config_host_mak="config-host.mak" |
1794 | 98ec69ac | Juan Quintela | config_host_h="config-host.h" |
1795 | 4bf6b55b | Juan Quintela | config_host_ld="config-host.ld" |
1796 | 98ec69ac | Juan Quintela | |
1797 | 98ec69ac | Juan Quintela | #echo "Creating $config_host_mak and $config_host_h" |
1798 | 98ec69ac | Juan Quintela | |
1799 | 98ec69ac | Juan Quintela | test -f $config_host_h && mv $config_host_h ${config_host_h}~ |
1800 | 98ec69ac | Juan Quintela | |
1801 | 98ec69ac | Juan Quintela | echo "# Automatically generated by configure - do not modify" > $config_host_mak |
1802 | 98ec69ac | Juan Quintela | printf "# Configured with:" >> $config_host_mak |
1803 | 98ec69ac | Juan Quintela | printf " '%s'" "$0" "$@" >> $config_host_mak |
1804 | 98ec69ac | Juan Quintela | echo >> $config_host_mak |
1805 | 98ec69ac | Juan Quintela | |
1806 | 2358a494 | Juan Quintela | echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak |
1807 | 804edf29 | Juan Quintela | |
1808 | 2408a527 | aurel32 | case "$cpu" in |
1809 | c62bbcd3 | Andrzej Zaborowski | i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|sparc|sparc64) |
1810 | e0da9dd3 | Juan Quintela | ARCH=$cpu |
1811 | 2408a527 | aurel32 | ;; |
1812 | a302c32d | Laurent Desnogues | armv4b|armv4l) |
1813 | 16dbd14f | Juan Quintela | ARCH=arm |
1814 | 2408a527 | aurel32 | ;; |
1815 | 2408a527 | aurel32 | *) |
1816 | 2408a527 | aurel32 | echo "Unsupported CPU = $cpu" |
1817 | 2408a527 | aurel32 | exit 1 |
1818 | 2408a527 | aurel32 | ;; |
1819 | 2408a527 | aurel32 | esac |
1820 | 98ec69ac | Juan Quintela | echo "ARCH=$ARCH" >> $config_host_mak |
1821 | f8393946 | aurel32 | if test "$debug_tcg" = "yes" ; then |
1822 | 2358a494 | Juan Quintela | echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak |
1823 | f8393946 | aurel32 | fi |
1824 | f3d08ee6 | Paul Brook | if test "$debug" = "yes" ; then |
1825 | 2358a494 | Juan Quintela | echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak |
1826 | f3d08ee6 | Paul Brook | fi |
1827 | 1625af87 | aliguori | if test "$strip_opt" = "yes" ; then |
1828 | 98ec69ac | Juan Quintela | echo "STRIP_OPT=-s" >> $config_host_mak |
1829 | 1625af87 | aliguori | fi |
1830 | 7d13299d | bellard | if test "$bigendian" = "yes" ; then |
1831 | e2542fe2 | Juan Quintela | echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak |
1832 | 97a847bc | bellard | fi |
1833 | 2358a494 | Juan Quintela | echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak |
1834 | 67b915a5 | bellard | if test "$mingw32" = "yes" ; then |
1835 | 98ec69ac | Juan Quintela | echo "CONFIG_WIN32=y" >> $config_host_mak |
1836 | 210fa556 | pbrook | else |
1837 | 35f4df27 | Juan Quintela | echo "CONFIG_POSIX=y" >> $config_host_mak |
1838 | 67b915a5 | bellard | fi |
1839 | 128ab2ff | blueswir1 | |
1840 | 83fb7adf | bellard | if test "$darwin" = "yes" ; then |
1841 | 98ec69ac | Juan Quintela | echo "CONFIG_DARWIN=y" >> $config_host_mak |
1842 | 83fb7adf | bellard | fi |
1843 | b29fe3ed | malc | |
1844 | b29fe3ed | malc | if test "$aix" = "yes" ; then |
1845 | 98ec69ac | Juan Quintela | echo "CONFIG_AIX=y" >> $config_host_mak |
1846 | b29fe3ed | malc | fi |
1847 | b29fe3ed | malc | |
1848 | ec530c81 | bellard | if test "$solaris" = "yes" ; then |
1849 | 98ec69ac | Juan Quintela | echo "CONFIG_SOLARIS=y" >> $config_host_mak |
1850 | 2358a494 | Juan Quintela | echo "CONFIG_SOLARIS_VERSION=$solarisrev" >> $config_host_mak |
1851 | 0475a5ca | ths | if test "$needs_libsunmath" = "yes" ; then |
1852 | 75b5a697 | Juan Quintela | echo "CONFIG_NEEDS_LIBSUNMATH=y" >> $config_host_mak |
1853 | 0475a5ca | ths | fi |
1854 | ec530c81 | bellard | fi |
1855 | 97a847bc | bellard | if test "$static" = "yes" ; then |
1856 | 98ec69ac | Juan Quintela | echo "CONFIG_STATIC=y" >> $config_host_mak |
1857 | 1156c669 | Juan Quintela | LDFLAGS="-static $LDFLAGS" |
1858 | 7d13299d | bellard | fi |
1859 | 05c2a3e7 | bellard | if test $profiler = "yes" ; then |
1860 | 2358a494 | Juan Quintela | echo "CONFIG_PROFILER=y" >> $config_host_mak |
1861 | 05c2a3e7 | bellard | fi |
1862 | c20709aa | bellard | if test "$slirp" = "yes" ; then |
1863 | 98ec69ac | Juan Quintela | echo "CONFIG_SLIRP=y" >> $config_host_mak |
1864 | 4de67f2f | Juan Quintela | CFLAGS="-I\$(SRC_PATH)/slirp $CFLAGS" |
1865 | c20709aa | bellard | fi |
1866 | 8a16d273 | ths | if test "$vde" = "yes" ; then |
1867 | 98ec69ac | Juan Quintela | echo "CONFIG_VDE=y" >> $config_host_mak |
1868 | 8a16d273 | ths | fi |
1869 | 0c58ac1c | malc | for card in $audio_card_list; do |
1870 | f6e5889e | pbrook | def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` |
1871 | 98ec69ac | Juan Quintela | echo "$def=y" >> $config_host_mak |
1872 | 0c58ac1c | malc | done |
1873 | 2358a494 | Juan Quintela | echo "CONFIG_AUDIO_DRIVERS=$audio_drv_list" >> $config_host_mak |
1874 | 0c58ac1c | malc | for drv in $audio_drv_list; do |
1875 | f6e5889e | pbrook | def=CONFIG_`echo $drv | tr '[:lower:]' '[:upper:]'` |
1876 | 98ec69ac | Juan Quintela | echo "$def=y" >> $config_host_mak |
1877 | 923e4521 | malc | if test "$drv" = "fmod"; then |
1878 | 7aac6cb1 | Juan Quintela | echo "FMOD_CFLAGS=-I$fmod_inc" >> $config_host_mak |
1879 | 0c58ac1c | malc | fi |
1880 | 0c58ac1c | malc | done |
1881 | 67f86e8e | Juan Quintela | if test "$audio_pt_int" = "yes" ; then |
1882 | 67f86e8e | Juan Quintela | echo "CONFIG_AUDIO_PT_INT=y" >> $config_host_mak |
1883 | 67f86e8e | Juan Quintela | fi |
1884 | 8ff9cbf7 | malc | if test "$mixemu" = "yes" ; then |
1885 | 98ec69ac | Juan Quintela | echo "CONFIG_MIXEMU=y" >> $config_host_mak |
1886 | 8ff9cbf7 | malc | fi |
1887 | 8d5d2d4c | ths | if test "$vnc_tls" = "yes" ; then |
1888 | 98ec69ac | Juan Quintela | echo "CONFIG_VNC_TLS=y" >> $config_host_mak |
1889 | 525061bf | Juan Quintela | echo "VNC_TLS_CFLAGS=$vnc_tls_cflags" >> $config_host_mak |
1890 | 8d5d2d4c | ths | fi |
1891 | 2f9606b3 | aliguori | if test "$vnc_sasl" = "yes" ; then |
1892 | 98ec69ac | Juan Quintela | echo "CONFIG_VNC_SASL=y" >> $config_host_mak |
1893 | 60ddf533 | Juan Quintela | echo "VNC_SASL_CFLAGS=$vnc_sasl_cflags" >> $config_host_mak |
1894 | 2f9606b3 | aliguori | fi |
1895 | 76655d6d | aliguori | if test "$fnmatch" = "yes" ; then |
1896 | 2358a494 | Juan Quintela | echo "CONFIG_FNMATCH=y" >> $config_host_mak |
1897 | 76655d6d | aliguori | fi |
1898 | ee682d27 | Stefan Weil | if test "$uuid" = "yes" ; then |
1899 | ee682d27 | Stefan Weil | echo "CONFIG_UUID=y" >> $config_host_mak |
1900 | ee682d27 | Stefan Weil | fi |
1901 | b1a550a0 | pbrook | qemu_version=`head $source_path/VERSION` |
1902 | 98ec69ac | Juan Quintela | echo "VERSION=$qemu_version" >>$config_host_mak |
1903 | 2358a494 | Juan Quintela | echo "PKGVERSION=$pkgversion" >>$config_host_mak |
1904 | 98ec69ac | Juan Quintela | echo "SRC_PATH=$source_path" >> $config_host_mak |
1905 | ad064840 | pbrook | if [ "$source_path_used" = "yes" ]; then |
1906 | 98ec69ac | Juan Quintela | echo "VPATH=$source_path" >> $config_host_mak |
1907 | ad064840 | pbrook | fi |
1908 | 98ec69ac | Juan Quintela | echo "TARGET_DIRS=$target_list" >> $config_host_mak |
1909 | a25dba17 | Juan Quintela | if [ "$docs" = "yes" ] ; then |
1910 | 98ec69ac | Juan Quintela | echo "BUILD_DOCS=yes" >> $config_host_mak |
1911 | cc8ae6de | pbrook | fi |
1912 | 1ac88f28 | Juan Quintela | if test "$sdl" = "yes" ; then |
1913 | 98ec69ac | Juan Quintela | echo "CONFIG_SDL=y" >> $config_host_mak |
1914 | 1ac88f28 | Juan Quintela | echo "SDL_CFLAGS=$sdl_cflags" >> $config_host_mak |
1915 | 49ecc3fa | bellard | fi |
1916 | 49ecc3fa | bellard | if test "$cocoa" = "yes" ; then |
1917 | 98ec69ac | Juan Quintela | echo "CONFIG_COCOA=y" >> $config_host_mak |
1918 | 4d3b6f6e | balrog | fi |
1919 | 4d3b6f6e | balrog | if test "$curses" = "yes" ; then |
1920 | 98ec69ac | Juan Quintela | echo "CONFIG_CURSES=y" >> $config_host_mak |
1921 | 49ecc3fa | bellard | fi |
1922 | 3b3f24ad | aurel32 | if test "$atfile" = "yes" ; then |
1923 | 2358a494 | Juan Quintela | echo "CONFIG_ATFILE=y" >> $config_host_mak |
1924 | 3b3f24ad | aurel32 | fi |
1925 | ebc996f3 | Riku Voipio | if test "$utimens" = "yes" ; then |
1926 | 2358a494 | Juan Quintela | echo "CONFIG_UTIMENSAT=y" >> $config_host_mak |
1927 | ebc996f3 | Riku Voipio | fi |
1928 | 099d6b0f | Riku Voipio | if test "$pipe2" = "yes" ; then |
1929 | 2358a494 | Juan Quintela | echo "CONFIG_PIPE2=y" >> $config_host_mak |
1930 | 099d6b0f | Riku Voipio | fi |
1931 | 3ce34dfb | vibisreenivasan | if test "$splice" = "yes" ; then |
1932 | 2358a494 | Juan Quintela | echo "CONFIG_SPLICE=y" >> $config_host_mak |
1933 | 3ce34dfb | vibisreenivasan | fi |
1934 | c2882b96 | Riku Voipio | if test "$eventfd" = "yes" ; then |
1935 | c2882b96 | Riku Voipio | echo "CONFIG_EVENTFD=y" >> $config_host_mak |
1936 | c2882b96 | Riku Voipio | fi |
1937 | 3b3f24ad | aurel32 | if test "$inotify" = "yes" ; then |
1938 | 2358a494 | Juan Quintela | echo "CONFIG_INOTIFY=y" >> $config_host_mak |
1939 | 3b3f24ad | aurel32 | fi |
1940 | 6ae9a1f4 | Juan Quintela | if test "$byteswap_h" = "yes" ; then |
1941 | 6ae9a1f4 | Juan Quintela | echo "CONFIG_BYTESWAP_H=y" >> $config_host_mak |
1942 | 6ae9a1f4 | Juan Quintela | fi |
1943 | 6ae9a1f4 | Juan Quintela | if test "$bswap_h" = "yes" ; then |
1944 | 6ae9a1f4 | Juan Quintela | echo "CONFIG_MACHINE_BSWAP_H=y" >> $config_host_mak |
1945 | 6ae9a1f4 | Juan Quintela | fi |
1946 | 769ce76d | Alexander Graf | if test "$curl" = "yes" ; then |
1947 | 98ec69ac | Juan Quintela | echo "CONFIG_CURL=y" >> $config_host_mak |
1948 | b1d5a277 | Juan Quintela | echo "CURL_CFLAGS=$curl_cflags" >> $config_host_mak |
1949 | 769ce76d | Alexander Graf | fi |
1950 | 2e4d9fb1 | aurel32 | if test "$brlapi" = "yes" ; then |
1951 | 98ec69ac | Juan Quintela | echo "CONFIG_BRLAPI=y" >> $config_host_mak |
1952 | 2e4d9fb1 | aurel32 | fi |
1953 | fb599c9a | balrog | if test "$bluez" = "yes" ; then |
1954 | 98ec69ac | Juan Quintela | echo "CONFIG_BLUEZ=y" >> $config_host_mak |
1955 | ef7635ec | Juan Quintela | echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak |
1956 | fb599c9a | balrog | fi |
1957 | e37630ca | aliguori | if test "$xen" = "yes" ; then |
1958 | 5647eb74 | Juan Quintela | echo "CONFIG_XEN=y" >> $config_host_mak |
1959 | e37630ca | aliguori | fi |
1960 | e5d355d1 | aliguori | if test "$io_thread" = "yes" ; then |
1961 | 98ec69ac | Juan Quintela | echo "CONFIG_IOTHREAD=y" >> $config_host_mak |
1962 | e5d355d1 | aliguori | fi |
1963 | 5c6c3a6c | Christoph Hellwig | if test "$linux_aio" = "yes" ; then |
1964 | 5c6c3a6c | Christoph Hellwig | echo "CONFIG_LINUX_AIO=y" >> $config_host_mak |
1965 | 5c6c3a6c | Christoph Hellwig | fi |
1966 | 77755340 | ths | if test "$blobs" = "yes" ; then |
1967 | 98ec69ac | Juan Quintela | echo "INSTALL_BLOBS=yes" >> $config_host_mak |
1968 | 77755340 | ths | fi |
1969 | bf9298b9 | aliguori | if test "$iovec" = "yes" ; then |
1970 | 2358a494 | Juan Quintela | echo "CONFIG_IOVEC=y" >> $config_host_mak |
1971 | bf9298b9 | aliguori | fi |
1972 | ceb42de8 | aliguori | if test "$preadv" = "yes" ; then |
1973 | 2358a494 | Juan Quintela | echo "CONFIG_PREADV=y" >> $config_host_mak |
1974 | ceb42de8 | aliguori | fi |
1975 | f652e6af | aurel32 | if test "$fdt" = "yes" ; then |
1976 | 3f0855b1 | Juan Quintela | echo "CONFIG_FDT=y" >> $config_host_mak |
1977 | f652e6af | aurel32 | fi |
1978 | de5071c5 | Blue Swirl | if test "$need_offsetof" = "yes" ; then |
1979 | de5071c5 | Blue Swirl | echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak |
1980 | de5071c5 | Blue Swirl | fi |
1981 | 5f6b9e8f | Blue Swirl | if test "$fdatasync" = "yes" ; then |
1982 | 5f6b9e8f | Blue Swirl | echo "CONFIG_FDATASYNC=y" >> $config_host_mak |
1983 | 5f6b9e8f | Blue Swirl | fi |
1984 | 97a847bc | bellard | |
1985 | 83fb7adf | bellard | # XXX: suppress that |
1986 | 7d3505c5 | bellard | if [ "$bsd" = "yes" ] ; then |
1987 | 2358a494 | Juan Quintela | echo "CONFIG_BSD=y" >> $config_host_mak |
1988 | 7d3505c5 | bellard | fi |
1989 | 7d3505c5 | bellard | |
1990 | 2358a494 | Juan Quintela | echo "CONFIG_UNAME_RELEASE=\"$uname_release\"" >> $config_host_mak |
1991 | c5937220 | pbrook | |
1992 | 68063649 | blueswir1 | # USB host support |
1993 | 68063649 | blueswir1 | case "$usb" in |
1994 | 68063649 | blueswir1 | linux) |
1995 | 98ec69ac | Juan Quintela | echo "HOST_USB=linux" >> $config_host_mak |
1996 | 68063649 | blueswir1 | ;; |
1997 | 68063649 | blueswir1 | bsd) |
1998 | 98ec69ac | Juan Quintela | echo "HOST_USB=bsd" >> $config_host_mak |
1999 | 68063649 | blueswir1 | ;; |
2000 | 68063649 | blueswir1 | *) |
2001 | 98ec69ac | Juan Quintela | echo "HOST_USB=stub" >> $config_host_mak |
2002 | 68063649 | blueswir1 | ;; |
2003 | 68063649 | blueswir1 | esac |
2004 | 68063649 | blueswir1 | |
2005 | c39e3338 | pbrook | tools= |
2006 | c39e3338 | pbrook | if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then |
2007 | 3dd1f8ef | aliguori | tools="qemu-img\$(EXESUF) $tools" |
2008 | 7a5ca864 | bellard | if [ "$linux" = "yes" ] ; then |
2009 | 3dd1f8ef | aliguori | tools="qemu-nbd\$(EXESUF) qemu-io\$(EXESUF) $tools" |
2010 | 5495ed11 | Luiz Capitulino | if [ "$check_utests" = "yes" ]; then |
2011 | 7b8c51ad | Luiz Capitulino | tools="check-qint check-qstring check-qdict $tools" |
2012 | 5495ed11 | Luiz Capitulino | fi |
2013 | c32d766a | Stefan Weil | elif test "$mingw32" = "yes" ; then |
2014 | c32d766a | Stefan Weil | tools="qemu-io\$(EXESUF) $tools" |
2015 | 7a5ca864 | bellard | fi |
2016 | c39e3338 | pbrook | fi |
2017 | 98ec69ac | Juan Quintela | echo "TOOLS=$tools" >> $config_host_mak |
2018 | c39e3338 | pbrook | |
2019 | 161294d8 | Juan Quintela | # Mac OS X ships with a broken assembler |
2020 | 253d0942 | Alexander Graf | roms= |
2021 | 161294d8 | Juan Quintela | if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) -a \ |
2022 | b461cdc9 | Blue Swirl | "$targetos" != "Darwin" -a \ |
2023 | b461cdc9 | Blue Swirl | `expr "$target_list" : ".*softmmu.*"` != 0 ; then |
2024 | c05ac895 | Paul Brook | roms="optionrom" |
2025 | 253d0942 | Alexander Graf | fi |
2026 | 98ec69ac | Juan Quintela | echo "ROMS=$roms" >> $config_host_mak |
2027 | 253d0942 | Alexander Graf | |
2028 | 804edf29 | Juan Quintela | echo "prefix=$prefix" >> $config_host_mak |
2029 | 804edf29 | Juan Quintela | echo "bindir=\${prefix}$binsuffix" >> $config_host_mak |
2030 | 804edf29 | Juan Quintela | echo "mandir=\${prefix}$mansuffix" >> $config_host_mak |
2031 | 804edf29 | Juan Quintela | echo "datadir=\${prefix}$datasuffix" >> $config_host_mak |
2032 | 804edf29 | Juan Quintela | echo "docdir=\${prefix}$docsuffix" >> $config_host_mak |
2033 | 804edf29 | Juan Quintela | echo "MAKE=$make" >> $config_host_mak |
2034 | 804edf29 | Juan Quintela | echo "INSTALL=$install" >> $config_host_mak |
2035 | 804edf29 | Juan Quintela | echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak |
2036 | 804edf29 | Juan Quintela | echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak |
2037 | 804edf29 | Juan Quintela | echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak |
2038 | 804edf29 | Juan Quintela | echo "CC=$cc" >> $config_host_mak |
2039 | 804edf29 | Juan Quintela | echo "HOST_CC=$host_cc" >> $config_host_mak |
2040 | 804edf29 | Juan Quintela | if test "$sparse" = "yes" ; then |
2041 | 804edf29 | Juan Quintela | echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak |
2042 | 804edf29 | Juan Quintela | echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak |
2043 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_host_mak |
2044 | 804edf29 | Juan Quintela | fi |
2045 | 804edf29 | Juan Quintela | echo "AR=$ar" >> $config_host_mak |
2046 | 804edf29 | Juan Quintela | echo "OBJCOPY=$objcopy" >> $config_host_mak |
2047 | 804edf29 | Juan Quintela | echo "LD=$ld" >> $config_host_mak |
2048 | e2a2ed06 | Juan Quintela | echo "CFLAGS=$CFLAGS" >> $config_host_mak |
2049 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak |
2050 | c81da56e | Juan Quintela | echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak |
2051 | e2a2ed06 | Juan Quintela | echo "LDFLAGS=$LDFLAGS" >> $config_host_mak |
2052 | a36abbbb | Juan Quintela | echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak |
2053 | a36abbbb | Juan Quintela | echo "ARLIBS_END=$arlibs_end" >> $config_host_mak |
2054 | 73da375e | Juan Quintela | echo "LIBS+=$LIBS" >> $config_host_mak |
2055 | 3e2e0e6b | Juan Quintela | echo "LIBS_TOOLS+=$libs_tools" >> $config_host_mak |
2056 | 804edf29 | Juan Quintela | echo "EXESUF=$EXESUF" >> $config_host_mak |
2057 | 804edf29 | Juan Quintela | |
2058 | 2358a494 | Juan Quintela | echo "/* Automatically generated by configure - do not modify */" > $config_host_h |
2059 | 2358a494 | Juan Quintela | |
2060 | aa0cba4a | malc | /bin/sh $source_path/create_config < $config_host_mak >> $config_host_h |
2061 | 2358a494 | Juan Quintela | |
2062 | 98ec69ac | Juan Quintela | if test -f ${config_host_h}~ ; then |
2063 | 98ec69ac | Juan Quintela | if cmp -s $config_host_h ${config_host_h}~ ; then |
2064 | 98ec69ac | Juan Quintela | mv ${config_host_h}~ $config_host_h |
2065 | 370ab986 | Paul Brook | else |
2066 | 98ec69ac | Juan Quintela | rm ${config_host_h}~ |
2067 | 370ab986 | Paul Brook | fi |
2068 | 370ab986 | Paul Brook | fi |
2069 | 370ab986 | Paul Brook | |
2070 | 4bf6b55b | Juan Quintela | # generate list of library paths for linker script |
2071 | 4bf6b55b | Juan Quintela | |
2072 | 4bf6b55b | Juan Quintela | $ld --verbose -v 2> /dev/null | grep SEARCH_DIR > ${config_host_ld} |
2073 | 4bf6b55b | Juan Quintela | |
2074 | 4bf6b55b | Juan Quintela | if test -f ${config_host_ld}~ ; then |
2075 | 4bf6b55b | Juan Quintela | if cmp -s $config_host_ld ${config_host_ld}~ ; then |
2076 | 4bf6b55b | Juan Quintela | mv ${config_host_ld}~ $config_host_ld |
2077 | 4bf6b55b | Juan Quintela | else |
2078 | 4bf6b55b | Juan Quintela | rm ${config_host_ld}~ |
2079 | 4bf6b55b | Juan Quintela | fi |
2080 | 4bf6b55b | Juan Quintela | fi |
2081 | 4bf6b55b | Juan Quintela | |
2082 | 1d14ffa9 | bellard | for target in $target_list; do |
2083 | 97a847bc | bellard | target_dir="$target" |
2084 | 97a847bc | bellard | config_mak=$target_dir/config.mak |
2085 | 97a847bc | bellard | config_h=$target_dir/config.h |
2086 | 600309b6 | Blue Swirl | target_arch2=`echo $target | cut -d '-' -f 1` |
2087 | 97a847bc | bellard | target_bigendian="no" |
2088 | ea2d6a39 | Juan Quintela | case "$target_arch2" in |
2089 | ea2d6a39 | Juan Quintela | armeb|m68k|microblaze|mips|mipsn32|mips64|ppc|ppcemb|ppc64|ppc64abi32|sh4eb|sparc|sparc64|sparc32plus) |
2090 | ea2d6a39 | Juan Quintela | target_bigendian=yes |
2091 | ea2d6a39 | Juan Quintela | ;; |
2092 | ea2d6a39 | Juan Quintela | esac |
2093 | 97a847bc | bellard | target_softmmu="no" |
2094 | 997344f3 | bellard | target_user_only="no" |
2095 | 831b7825 | ths | target_linux_user="no" |
2096 | 831b7825 | ths | target_darwin_user="no" |
2097 | 84778508 | blueswir1 | target_bsd_user="no" |
2098 | 9e407a85 | pbrook | case "$target" in |
2099 | 600309b6 | Blue Swirl | ${target_arch2}-softmmu) |
2100 | 9e407a85 | pbrook | target_softmmu="yes" |
2101 | 9e407a85 | pbrook | ;; |
2102 | 600309b6 | Blue Swirl | ${target_arch2}-linux-user) |
2103 | 9e407a85 | pbrook | target_user_only="yes" |
2104 | 9e407a85 | pbrook | target_linux_user="yes" |
2105 | 9e407a85 | pbrook | ;; |
2106 | 600309b6 | Blue Swirl | ${target_arch2}-darwin-user) |
2107 | 9e407a85 | pbrook | target_user_only="yes" |
2108 | 9e407a85 | pbrook | target_darwin_user="yes" |
2109 | 9e407a85 | pbrook | ;; |
2110 | 600309b6 | Blue Swirl | ${target_arch2}-bsd-user) |
2111 | 84778508 | blueswir1 | target_user_only="yes" |
2112 | 84778508 | blueswir1 | target_bsd_user="yes" |
2113 | 84778508 | blueswir1 | ;; |
2114 | 9e407a85 | pbrook | *) |
2115 | 9e407a85 | pbrook | echo "ERROR: Target '$target' not recognised" |
2116 | 9e407a85 | pbrook | exit 1 |
2117 | 9e407a85 | pbrook | ;; |
2118 | 9e407a85 | pbrook | esac |
2119 | 831b7825 | ths | |
2120 | 7c1f25b4 | bellard | #echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
2121 | 97a847bc | bellard | |
2122 | 15d9ca0f | ths | test -f $config_h && mv $config_h ${config_h}~ |
2123 | 15d9ca0f | ths | |
2124 | 97a847bc | bellard | mkdir -p $target_dir |
2125 | 158142c2 | bellard | mkdir -p $target_dir/fpu |
2126 | 57fec1fe | bellard | mkdir -p $target_dir/tcg |
2127 | 59f2a787 | Gerd Hoffmann | mkdir -p $target_dir/ide |
2128 | 84778508 | blueswir1 | if test "$target" = "arm-linux-user" -o "$target" = "armeb-linux-user" -o "$target" = "arm-bsd-user" -o "$target" = "armeb-bsd-user" ; then |
2129 | 69de927c | bellard | mkdir -p $target_dir/nwfpe |
2130 | 69de927c | bellard | fi |
2131 | 69de927c | bellard | |
2132 | ec530c81 | bellard | # |
2133 | ec530c81 | bellard | # don't use ln -sf as not all "ln -sf" over write the file/link |
2134 | ec530c81 | bellard | # |
2135 | ec530c81 | bellard | rm -f $target_dir/Makefile |
2136 | ec530c81 | bellard | ln -s $source_path/Makefile.target $target_dir/Makefile |
2137 | ec530c81 | bellard | |
2138 | 97a847bc | bellard | |
2139 | 97a847bc | bellard | echo "# Automatically generated by configure - do not modify" > $config_mak |
2140 | de83cd02 | bellard | |
2141 | 97a847bc | bellard | echo "include ../config-host.mak" >> $config_mak |
2142 | 1e43adfc | bellard | |
2143 | e5fe0c52 | pbrook | bflt="no" |
2144 | cb33da57 | blueswir1 | elfload32="no" |
2145 | bd0c5661 | pbrook | target_nptl="no" |
2146 | 600309b6 | Blue Swirl | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` |
2147 | 42bc608b | Juan Quintela | echo "CONFIG_QEMU_PREFIX=\"$interp_prefix1\"" >> $config_mak |
2148 | 56aebc89 | pbrook | gdb_xml_files="" |
2149 | 7ba1e619 | aliguori | |
2150 | 938b1edd | Juan Quintela | TARGET_ARCH="$target_arch2" |
2151 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH="" |
2152 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR="" |
2153 | e73aae67 | Juan Quintela | |
2154 | 600309b6 | Blue Swirl | case "$target_arch2" in |
2155 | 2408a527 | aurel32 | i386) |
2156 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2157 | 2408a527 | aurel32 | ;; |
2158 | 2408a527 | aurel32 | x86_64) |
2159 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=i386 |
2160 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2161 | 2408a527 | aurel32 | ;; |
2162 | 2408a527 | aurel32 | alpha) |
2163 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2164 | 2408a527 | aurel32 | ;; |
2165 | 2408a527 | aurel32 | arm|armeb) |
2166 | b498c8a0 | Juan Quintela | TARGET_ARCH=arm |
2167 | 2408a527 | aurel32 | bflt="yes" |
2168 | bd0c5661 | pbrook | target_nptl="yes" |
2169 | 56aebc89 | pbrook | gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" |
2170 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2171 | 2408a527 | aurel32 | ;; |
2172 | 2408a527 | aurel32 | cris) |
2173 | 253bd7f8 | edgar_igl | target_nptl="yes" |
2174 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2175 | 2408a527 | aurel32 | ;; |
2176 | 2408a527 | aurel32 | m68k) |
2177 | 2408a527 | aurel32 | bflt="yes" |
2178 | 56aebc89 | pbrook | gdb_xml_files="cf-core.xml cf-fp.xml" |
2179 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2180 | 2408a527 | aurel32 | ;; |
2181 | 72b675ca | Edgar E. Iglesias | microblaze) |
2182 | 72b675ca | Edgar E. Iglesias | bflt="yes" |
2183 | 72b675ca | Edgar E. Iglesias | target_nptl="yes" |
2184 | 72b675ca | Edgar E. Iglesias | target_phys_bits=32 |
2185 | 72b675ca | Edgar E. Iglesias | ;; |
2186 | 0adcffb1 | Juan Quintela | mips|mipsel) |
2187 | b498c8a0 | Juan Quintela | TARGET_ARCH=mips |
2188 | 42bc608b | Juan Quintela | echo "TARGET_ABI_MIPSO32=y" >> $config_mak |
2189 | f04dc72f | Paul Brook | target_nptl="yes" |
2190 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2191 | 2408a527 | aurel32 | ;; |
2192 | 2408a527 | aurel32 | mipsn32|mipsn32el) |
2193 | b498c8a0 | Juan Quintela | TARGET_ARCH=mipsn32 |
2194 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=mips |
2195 | 42bc608b | Juan Quintela | echo "TARGET_ABI_MIPSN32=y" >> $config_mak |
2196 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2197 | 2408a527 | aurel32 | ;; |
2198 | 2408a527 | aurel32 | mips64|mips64el) |
2199 | b498c8a0 | Juan Quintela | TARGET_ARCH=mips64 |
2200 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=mips |
2201 | 42bc608b | Juan Quintela | echo "TARGET_ABI_MIPSN64=y" >> $config_mak |
2202 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2203 | 2408a527 | aurel32 | ;; |
2204 | 2408a527 | aurel32 | ppc) |
2205 | c8b3532d | aurel32 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2206 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2207 | d6630708 | Nathan Froyd | target_nptl="yes" |
2208 | 2408a527 | aurel32 | ;; |
2209 | 2408a527 | aurel32 | ppcemb) |
2210 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
2211 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
2212 | c8b3532d | aurel32 | gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2213 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2214 | d6630708 | Nathan Froyd | target_nptl="yes" |
2215 | 2408a527 | aurel32 | ;; |
2216 | 2408a527 | aurel32 | ppc64) |
2217 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
2218 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
2219 | c8b3532d | aurel32 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2220 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2221 | 2408a527 | aurel32 | ;; |
2222 | 2408a527 | aurel32 | ppc64abi32) |
2223 | b498c8a0 | Juan Quintela | TARGET_ARCH=ppc64 |
2224 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=ppc |
2225 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=ppc |
2226 | 42bc608b | Juan Quintela | echo "TARGET_ABI32=y" >> $config_mak |
2227 | c8b3532d | aurel32 | gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml" |
2228 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2229 | 2408a527 | aurel32 | ;; |
2230 | 2408a527 | aurel32 | sh4|sh4eb) |
2231 | b498c8a0 | Juan Quintela | TARGET_ARCH=sh4 |
2232 | 2408a527 | aurel32 | bflt="yes" |
2233 | 0b6d3ae0 | aurel32 | target_nptl="yes" |
2234 | 1ad2134f | Paul Brook | target_phys_bits=32 |
2235 | 2408a527 | aurel32 | ;; |
2236 | 2408a527 | aurel32 | sparc) |
2237 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2238 | 2408a527 | aurel32 | ;; |
2239 | 2408a527 | aurel32 | sparc64) |
2240 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=sparc |
2241 | 2408a527 | aurel32 | elfload32="yes" |
2242 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2243 | 2408a527 | aurel32 | ;; |
2244 | 2408a527 | aurel32 | sparc32plus) |
2245 | b498c8a0 | Juan Quintela | TARGET_ARCH=sparc64 |
2246 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=sparc |
2247 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=sparc |
2248 | 42bc608b | Juan Quintela | echo "TARGET_ABI32=y" >> $config_mak |
2249 | 1ad2134f | Paul Brook | target_phys_bits=64 |
2250 | 2408a527 | aurel32 | ;; |
2251 | 2408a527 | aurel32 | *) |
2252 | 2408a527 | aurel32 | echo "Unsupported target CPU" |
2253 | 2408a527 | aurel32 | exit 1 |
2254 | 2408a527 | aurel32 | ;; |
2255 | 2408a527 | aurel32 | esac |
2256 | b498c8a0 | Juan Quintela | echo "TARGET_ARCH=$TARGET_ARCH" >> $config_mak |
2257 | 053dd92e | Juan Quintela | target_arch_name="`echo $TARGET_ARCH | tr '[:lower:]' '[:upper:]'`" |
2258 | 053dd92e | Juan Quintela | echo "TARGET_$target_arch_name=y" >> $config_mak |
2259 | 0adcffb1 | Juan Quintela | echo "TARGET_ARCH2=$target_arch2" >> $config_mak |
2260 | 42bc608b | Juan Quintela | # TARGET_BASE_ARCH needs to be defined after TARGET_ARCH |
2261 | 6acff7da | Juan Quintela | if [ "$TARGET_BASE_ARCH" = "" ]; then |
2262 | 6acff7da | Juan Quintela | TARGET_BASE_ARCH=$TARGET_ARCH |
2263 | 6acff7da | Juan Quintela | fi |
2264 | 6acff7da | Juan Quintela | echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_mak |
2265 | e6e91b9c | Juan Quintela | if [ "$TARGET_ABI_DIR" = "" ]; then |
2266 | e6e91b9c | Juan Quintela | TARGET_ABI_DIR=$TARGET_ARCH |
2267 | e6e91b9c | Juan Quintela | fi |
2268 | e6e91b9c | Juan Quintela | echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_mak |
2269 | 1ad2134f | Paul Brook | if [ $target_phys_bits -lt $hostlongbits ] ; then |
2270 | 1ad2134f | Paul Brook | target_phys_bits=$hostlongbits |
2271 | 1ad2134f | Paul Brook | fi |
2272 | 1b0c87fc | Juan Quintela | case "$target_arch2" in |
2273 | 1b0c87fc | Juan Quintela | i386|x86_64) |
2274 | 1b0c87fc | Juan Quintela | if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then |
2275 | 1b0c87fc | Juan Quintela | echo "CONFIG_XEN=y" >> $config_mak |
2276 | 1b0c87fc | Juan Quintela | fi |
2277 | 1b0c87fc | Juan Quintela | esac |
2278 | c59249f9 | Juan Quintela | case "$target_arch2" in |
2279 | 5f114bc6 | Alexander Graf | i386|x86_64|ppcemb|ppc|ppc64) |
2280 | c59249f9 | Juan Quintela | # Make sure the target and host cpus are compatible |
2281 | c59249f9 | Juan Quintela | if test "$kvm" = "yes" -a "$target_softmmu" = "yes" -a \ |
2282 | c59249f9 | Juan Quintela | \( "$target_arch2" = "$cpu" -o \ |
2283 | c59249f9 | Juan Quintela | \( "$target_arch2" = "ppcemb" -a "$cpu" = "ppc" \) -o \ |
2284 | 5f114bc6 | Alexander Graf | \( "$target_arch2" = "ppc64" -a "$cpu" = "ppc" \) -o \ |
2285 | c59249f9 | Juan Quintela | \( "$target_arch2" = "x86_64" -a "$cpu" = "i386" \) -o \ |
2286 | c59249f9 | Juan Quintela | \( "$target_arch2" = "i386" -a "$cpu" = "x86_64" \) \) ; then |
2287 | c59249f9 | Juan Quintela | echo "CONFIG_KVM=y" >> $config_mak |
2288 | c59249f9 | Juan Quintela | echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak |
2289 | c59249f9 | Juan Quintela | fi |
2290 | c59249f9 | Juan Quintela | esac |
2291 | 42bc608b | Juan Quintela | echo "TARGET_PHYS_ADDR_BITS=$target_phys_bits" >> $config_mak |
2292 | de83cd02 | bellard | if test "$target_bigendian" = "yes" ; then |
2293 | 42bc608b | Juan Quintela | echo "TARGET_WORDS_BIGENDIAN=y" >> $config_mak |
2294 | de83cd02 | bellard | fi |
2295 | 97a847bc | bellard | if test "$target_softmmu" = "yes" ; then |
2296 | e34af2ce | Juan Quintela | echo "CONFIG_SOFTMMU=y" >> $config_mak |
2297 | 73da375e | Juan Quintela | echo "LIBS+=$libs_softmmu" >> $config_mak |
2298 | 5791f45b | Kirill A. Shutemov | echo "HWLIB=../libhw$target_phys_bits/libqemuhw$target_phys_bits.a" >> $config_mak |
2299 | 5791f45b | Kirill A. Shutemov | echo "subdir-$target: subdir-libhw$target_phys_bits" >> $config_host_mak |
2300 | 43ce4dfe | bellard | fi |
2301 | 997344f3 | bellard | if test "$target_user_only" = "yes" ; then |
2302 | e34af2ce | Juan Quintela | echo "CONFIG_USER_ONLY=y" >> $config_mak |
2303 | 997344f3 | bellard | fi |
2304 | 831b7825 | ths | if test "$target_linux_user" = "yes" ; then |
2305 | e34af2ce | Juan Quintela | echo "CONFIG_LINUX_USER=y" >> $config_mak |
2306 | 831b7825 | ths | fi |
2307 | 831b7825 | ths | if test "$target_darwin_user" = "yes" ; then |
2308 | e34af2ce | Juan Quintela | echo "CONFIG_DARWIN_USER=y" >> $config_mak |
2309 | 831b7825 | ths | fi |
2310 | 56aebc89 | pbrook | list="" |
2311 | 56aebc89 | pbrook | if test ! -z "$gdb_xml_files" ; then |
2312 | 56aebc89 | pbrook | for x in $gdb_xml_files; do |
2313 | 56aebc89 | pbrook | list="$list $source_path/gdb-xml/$x" |
2314 | 56aebc89 | pbrook | done |
2315 | 56aebc89 | pbrook | fi |
2316 | 56aebc89 | pbrook | echo "TARGET_XML_FILES=$list" >> $config_mak |
2317 | 97a847bc | bellard | |
2318 | f57975fb | Juan Quintela | case "$target_arch2" in |
2319 | f57975fb | Juan Quintela | arm|armeb|m68k|microblaze|mips|mipsel|mipsn32|mipsn32el|mips64|mips64el|ppc|ppc64|ppc64abi32|ppcemb|sparc|sparc64|sparc32plus) |
2320 | f57975fb | Juan Quintela | echo "CONFIG_SOFTFLOAT=y" >> $config_mak |
2321 | f57975fb | Juan Quintela | ;; |
2322 | d6b38939 | Juan Quintela | *) |
2323 | d6b38939 | Juan Quintela | echo "CONFIG_NOSOFTFLOAT=y" >> $config_mak |
2324 | d6b38939 | Juan Quintela | ;; |
2325 | f57975fb | Juan Quintela | esac |
2326 | f57975fb | Juan Quintela | |
2327 | e5fe0c52 | pbrook | if test "$target_user_only" = "yes" -a "$bflt" = "yes"; then |
2328 | e34af2ce | Juan Quintela | echo "TARGET_HAS_BFLT=y" >> $config_mak |
2329 | e5fe0c52 | pbrook | fi |
2330 | bd0c5661 | pbrook | if test "$target_user_only" = "yes" \ |
2331 | bd0c5661 | pbrook | -a "$nptl" = "yes" -a "$target_nptl" = "yes"; then |
2332 | 2f7bb878 | Juan Quintela | echo "CONFIG_USE_NPTL=y" >> $config_mak |
2333 | bd0c5661 | pbrook | fi |
2334 | cb33da57 | blueswir1 | # 32 bit ELF loader in addition to native 64 bit loader? |
2335 | cb33da57 | blueswir1 | if test "$target_user_only" = "yes" -a "$elfload32" = "yes"; then |
2336 | e34af2ce | Juan Quintela | echo "TARGET_HAS_ELFLOAD32=y" >> $config_mak |
2337 | cb33da57 | blueswir1 | fi |
2338 | 379f6698 | Paul Brook | if test "$target_user_only" = "yes" -a "$guest_base" = "yes"; then |
2339 | 379f6698 | Paul Brook | echo "CONFIG_USE_GUEST_BASE=y" >> $config_mak |
2340 | 379f6698 | Paul Brook | fi |
2341 | 84778508 | blueswir1 | if test "$target_bsd_user" = "yes" ; then |
2342 | e34af2ce | Juan Quintela | echo "CONFIG_BSD_USER=y" >> $config_mak |
2343 | 84778508 | blueswir1 | fi |
2344 | 5b0753e0 | bellard | |
2345 | 4afddb55 | Juan Quintela | # generate QEMU_CFLAGS/LDFLAGS for targets |
2346 | fa282484 | Juan Quintela | |
2347 | 4afddb55 | Juan Quintela | cflags="" |
2348 | fa282484 | Juan Quintela | ldflags="" |
2349 | 9b8e111f | Juan Quintela | |
2350 | 57ddfbf7 | Juan Quintela | if test "$ARCH" = "sparc64" ; then |
2351 | 57ddfbf7 | Juan Quintela | cflags="-I\$(SRC_PATH)/tcg/sparc $cflags" |
2352 | 57ddfbf7 | Juan Quintela | else |
2353 | 57ddfbf7 | Juan Quintela | cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags" |
2354 | 57ddfbf7 | Juan Quintela | fi |
2355 | 57ddfbf7 | Juan Quintela | cflags="-I\$(SRC_PATH)/tcg $cflags" |
2356 | 57ddfbf7 | Juan Quintela | cflags="-I\$(SRC_PATH)/fpu $cflags" |
2357 | 57ddfbf7 | Juan Quintela | |
2358 | 64656024 | Juan Quintela | for i in $ARCH $TARGET_BASE_ARCH ; do |
2359 | 64656024 | Juan Quintela | case "$i" in |
2360 | 64656024 | Juan Quintela | alpha) |
2361 | 64656024 | Juan Quintela | echo "CONFIG_ALPHA_DIS=y" >> $config_mak |
2362 | 64656024 | Juan Quintela | ;; |
2363 | 64656024 | Juan Quintela | arm) |
2364 | 64656024 | Juan Quintela | echo "CONFIG_ARM_DIS=y" >> $config_mak |
2365 | 64656024 | Juan Quintela | ;; |
2366 | 64656024 | Juan Quintela | cris) |
2367 | 64656024 | Juan Quintela | echo "CONFIG_CRIS_DIS=y" >> $config_mak |
2368 | 64656024 | Juan Quintela | ;; |
2369 | 64656024 | Juan Quintela | hppa) |
2370 | 64656024 | Juan Quintela | echo "CONFIG_HPPA_DIS=y" >> $config_mak |
2371 | 64656024 | Juan Quintela | ;; |
2372 | 64656024 | Juan Quintela | i386|x86_64) |
2373 | 64656024 | Juan Quintela | echo "CONFIG_I386_DIS=y" >> $config_mak |
2374 | 64656024 | Juan Quintela | ;; |
2375 | 64656024 | Juan Quintela | m68k) |
2376 | 64656024 | Juan Quintela | echo "CONFIG_M68K_DIS=y" >> $config_mak |
2377 | 64656024 | Juan Quintela | ;; |
2378 | 64656024 | Juan Quintela | microblaze) |
2379 | 64656024 | Juan Quintela | echo "CONFIG_MICROBLAZE_DIS=y" >> $config_mak |
2380 | 64656024 | Juan Quintela | ;; |
2381 | 64656024 | Juan Quintela | mips*) |
2382 | 64656024 | Juan Quintela | echo "CONFIG_MIPS_DIS=y" >> $config_mak |
2383 | 64656024 | Juan Quintela | ;; |
2384 | 64656024 | Juan Quintela | ppc*) |
2385 | 64656024 | Juan Quintela | echo "CONFIG_PPC_DIS=y" >> $config_mak |
2386 | 64656024 | Juan Quintela | ;; |
2387 | 64656024 | Juan Quintela | s390) |
2388 | 64656024 | Juan Quintela | echo "CONFIG_S390_DIS=y" >> $config_mak |
2389 | 64656024 | Juan Quintela | ;; |
2390 | 64656024 | Juan Quintela | sh4) |
2391 | 64656024 | Juan Quintela | echo "CONFIG_SH4_DIS=y" >> $config_mak |
2392 | 64656024 | Juan Quintela | ;; |
2393 | 64656024 | Juan Quintela | sparc*) |
2394 | 64656024 | Juan Quintela | echo "CONFIG_SPARC_DIS=y" >> $config_mak |
2395 | 64656024 | Juan Quintela | ;; |
2396 | 64656024 | Juan Quintela | esac |
2397 | 64656024 | Juan Quintela | done |
2398 | 64656024 | Juan Quintela | |
2399 | 6ee7126f | Juan Quintela | case "$ARCH" in |
2400 | 6ee7126f | Juan Quintela | alpha) |
2401 | 6ee7126f | Juan Quintela | # Ensure there's only a single GP |
2402 | 6ee7126f | Juan Quintela | cflags="-msmall-data $cflags" |
2403 | 6ee7126f | Juan Quintela | ;; |
2404 | c60d0afa | Juan Quintela | ia64) |
2405 | c60d0afa | Juan Quintela | cflags="-mno-sdata $cflags" |
2406 | c60d0afa | Juan Quintela | ;; |
2407 | 6ee7126f | Juan Quintela | esac |
2408 | 6ee7126f | Juan Quintela | |
2409 | 55d9c04b | Juan Quintela | if test "$target_softmmu" = "yes" ; then |
2410 | 55d9c04b | Juan Quintela | case "$TARGET_BASE_ARCH" in |
2411 | 55d9c04b | Juan Quintela | arm) |
2412 | 55d9c04b | Juan Quintela | cflags="-DHAS_AUDIO $cflags" |
2413 | 55d9c04b | Juan Quintela | ;; |
2414 | 55d9c04b | Juan Quintela | i386|mips|ppc) |
2415 | 55d9c04b | Juan Quintela | cflags="-DHAS_AUDIO -DHAS_AUDIO_CHOICE $cflags" |
2416 | 55d9c04b | Juan Quintela | ;; |
2417 | 55d9c04b | Juan Quintela | esac |
2418 | 55d9c04b | Juan Quintela | fi |
2419 | 55d9c04b | Juan Quintela | |
2420 | 34005a00 | Kirill A. Shutemov | if test "$target_user_only" = "yes" -a "$static" = "no" -a \ |
2421 | 50108930 | Blue Swirl | "$user_pie" = "yes" ; then |
2422 | 34005a00 | Kirill A. Shutemov | cflags="-fpie $cflags" |
2423 | 34005a00 | Kirill A. Shutemov | ldflags="-pie $ldflags" |
2424 | 34005a00 | Kirill A. Shutemov | fi |
2425 | 34005a00 | Kirill A. Shutemov | |
2426 | 471857dd | Juan Quintela | if test "$target_softmmu" = "yes" -a \( \ |
2427 | 471857dd | Juan Quintela | "$TARGET_ARCH" = "microblaze" -o \ |
2428 | 471857dd | Juan Quintela | "$TARGET_ARCH" = "cris" \) ; then |
2429 | 471857dd | Juan Quintela | echo "CONFIG_NEED_MMU=y" >> $config_mak |
2430 | 471857dd | Juan Quintela | fi |
2431 | 471857dd | Juan Quintela | |
2432 | d02c1db3 | Juan Quintela | if test "$gprof" = "yes" ; then |
2433 | d02c1db3 | Juan Quintela | echo "TARGET_GPROF=yes" >> $config_mak |
2434 | d02c1db3 | Juan Quintela | if test "$target_linux_user" = "yes" ; then |
2435 | d02c1db3 | Juan Quintela | cflags="-p $cflags" |
2436 | d02c1db3 | Juan Quintela | ldflags="-p $ldflags" |
2437 | d02c1db3 | Juan Quintela | fi |
2438 | d02c1db3 | Juan Quintela | if test "$target_softmmu" = "yes" ; then |
2439 | d02c1db3 | Juan Quintela | ldflags="-p $ldflags" |
2440 | f622d8a3 | Juan Quintela | echo "GPROF_CFLAGS=-p" >> $config_mak |
2441 | d02c1db3 | Juan Quintela | fi |
2442 | d02c1db3 | Juan Quintela | fi |
2443 | d02c1db3 | Juan Quintela | |
2444 | 6ee7126f | Juan Quintela | linker_script="-Wl,-T../config-host.ld -Wl,-T,\$(SRC_PATH)/\$(ARCH).ld" |
2445 | 9b8e111f | Juan Quintela | if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then |
2446 | fa282484 | Juan Quintela | case "$ARCH" in |
2447 | fa282484 | Juan Quintela | sparc) |
2448 | fa282484 | Juan Quintela | # -static is used to avoid g1/g3 usage by the dynamic linker |
2449 | 322e5878 | Juan Quintela | ldflags="$linker_script -static $ldflags" |
2450 | fa282484 | Juan Quintela | ;; |
2451 | fa282484 | Juan Quintela | ia64) |
2452 | 322e5878 | Juan Quintela | ldflags="-Wl,-G0 $linker_script -static $ldflags" |
2453 | fa282484 | Juan Quintela | ;; |
2454 | df70204d | Kirill A. Shutemov | i386|x86_64|ppc|ppc64|s390|sparc64|alpha|arm|m68k|mips|mips64) |
2455 | 322e5878 | Juan Quintela | ldflags="$linker_script $ldflags" |
2456 | fa282484 | Juan Quintela | ;; |
2457 | fa282484 | Juan Quintela | esac |
2458 | fa282484 | Juan Quintela | fi |
2459 | fa282484 | Juan Quintela | if test "$target_softmmu" = "yes" ; then |
2460 | fa282484 | Juan Quintela | case "$ARCH" in |
2461 | fa282484 | Juan Quintela | ia64) |
2462 | 322e5878 | Juan Quintela | ldflags="-Wl,-G0 $linker_script -static $ldflags" |
2463 | fa282484 | Juan Quintela | ;; |
2464 | fa282484 | Juan Quintela | esac |
2465 | fa282484 | Juan Quintela | fi |
2466 | fa282484 | Juan Quintela | |
2467 | 07dac55d | Juan Quintela | echo "LDFLAGS+=$ldflags" >> $config_mak |
2468 | 4afddb55 | Juan Quintela | echo "QEMU_CFLAGS+=$cflags" >> $config_mak |
2469 | fa282484 | Juan Quintela | |
2470 | 2358a494 | Juan Quintela | echo "/* Automatically generated by configure - do not modify */" > $config_h |
2471 | 2358a494 | Juan Quintela | echo "#include \"../config-host.h\"" >> $config_h |
2472 | 2358a494 | Juan Quintela | |
2473 | aa0cba4a | malc | /bin/sh $source_path/create_config < $config_mak >> $config_h |
2474 | 42bc608b | Juan Quintela | |
2475 | a900c002 | Juan Quintela | if test -f ${config_h}~ ; then |
2476 | a900c002 | Juan Quintela | if cmp -s $config_h ${config_h}~ ; then |
2477 | a900c002 | Juan Quintela | mv ${config_h}~ $config_h |
2478 | a900c002 | Juan Quintela | else |
2479 | a900c002 | Juan Quintela | rm ${config_h}~ |
2480 | a900c002 | Juan Quintela | fi |
2481 | a900c002 | Juan Quintela | fi |
2482 | 15d9ca0f | ths | |
2483 | 97a847bc | bellard | done # for target in $targets |
2484 | 7d13299d | bellard | |
2485 | 7d13299d | bellard | # build tree in object directory if source path is different from current one |
2486 | 7d13299d | bellard | if test "$source_path_used" = "yes" ; then |
2487 | 253d0942 | Alexander Graf | DIRS="tests tests/cris slirp audio block pc-bios/optionrom" |
2488 | c34ebfdc | Anthony Liguori | DIRS="$DIRS roms/pcbios roms/seabios roms/vgabios" |
2489 | 7d13299d | bellard | FILES="Makefile tests/Makefile" |
2490 | e7daa605 | ths | FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" |
2491 | e1ffb0f1 | edgar_igl | FILES="$FILES tests/test-mmap.c" |
2492 | 7ea78b74 | Jan Kiszka | FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps pc-bios/video.x" |
2493 | c34ebfdc | Anthony Liguori | FILES="$FILES roms/pcbios/Makefile roms/seabios/Makefile roms/vgabios/Makefile" |
2494 | 7ea78b74 | Jan Kiszka | for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do |
2495 | 7ea78b74 | Jan Kiszka | FILES="$FILES pc-bios/`basename $bios_file`" |
2496 | 7ea78b74 | Jan Kiszka | done |
2497 | 7d13299d | bellard | for dir in $DIRS ; do |
2498 | 7d13299d | bellard | mkdir -p $dir |
2499 | 7d13299d | bellard | done |
2500 | ec530c81 | bellard | # remove the link and recreate it, as not all "ln -sf" overwrite the link |
2501 | 7d13299d | bellard | for f in $FILES ; do |
2502 | ec530c81 | bellard | rm -f $f |
2503 | ec530c81 | bellard | ln -s $source_path/$f $f |
2504 | 7d13299d | bellard | done |
2505 | 7d13299d | bellard | fi |
2506 | 1ad2134f | Paul Brook | |
2507 | c34ebfdc | Anthony Liguori | # temporary config to build submodules |
2508 | c34ebfdc | Anthony Liguori | for rom in seabios vgabios pcbios; do |
2509 | c34ebfdc | Anthony Liguori | config_mak=roms/$rom/config.mak |
2510 | c34ebfdc | Anthony Liguori | echo "# Automatically generated by configure - do not modify" >> $config_mak |
2511 | c34ebfdc | Anthony Liguori | echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak |
2512 | c34ebfdc | Anthony Liguori | echo "CC=$cc" >> $config_mak |
2513 | c34ebfdc | Anthony Liguori | echo "BCC=bcc" >> $config_mak |
2514 | c34ebfdc | Anthony Liguori | echo "CPP=${cross_prefix}cpp" >> $config_mak |
2515 | c34ebfdc | Anthony Liguori | echo "OBJCOPY=objcopy" >> $config_mak |
2516 | c34ebfdc | Anthony Liguori | echo "IASL=iasl" >> $config_mak |
2517 | c34ebfdc | Anthony Liguori | echo "HOST_CC=$host_cc" >> $config_mak |
2518 | c34ebfdc | Anthony Liguori | echo "LD=$ld" >> $config_mak |
2519 | c34ebfdc | Anthony Liguori | done |
2520 | c34ebfdc | Anthony Liguori | |
2521 | 1ad2134f | Paul Brook | for hwlib in 32 64; do |
2522 | 1ad2134f | Paul Brook | d=libhw$hwlib |
2523 | 1ad2134f | Paul Brook | mkdir -p $d |
2524 | 1ad2134f | Paul Brook | rm -f $d/Makefile |
2525 | 1ad2134f | Paul Brook | ln -s $source_path/Makefile.hw $d/Makefile |
2526 | 1ad2134f | Paul Brook | echo "HWLIB=libqemuhw$hwlib.a" > $d/config.mak |
2527 | a558ee17 | Juan Quintela | echo "QEMU_CFLAGS+=-DTARGET_PHYS_ADDR_BITS=$hwlib" >> $d/config.mak |
2528 | 1ad2134f | Paul Brook | done |
2529 | add16157 | Blue Swirl | |
2530 | add16157 | Blue Swirl | d=libuser |
2531 | add16157 | Blue Swirl | mkdir -p $d |
2532 | add16157 | Blue Swirl | rm -f $d/Makefile |
2533 | add16157 | Blue Swirl | ln -s $source_path/Makefile.user $d/Makefile |